platform/x86/intel/pmt: allow user offset for PMT callbacks
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Thu, 14 Nov 2024 13:03:57 +0000 (08:03 -0500)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 14 Nov 2024 13:16:50 +0000 (15:16 +0200)
commit0c32840763b1579c923b4216c18bb756ca4ba473
tree9f3826c75eeed5320acd5a922c38054b73b2bd8f
parent8560b2775a08bf511576a18922c3bde920e69494
platform/x86/intel/pmt: allow user offset for PMT callbacks

Usage of the telem sysfs file allows for partial reads at an offset.
The current callback method returns the buffer starting from offset 0
only.

Include the requested offset in the callback and update the necessary
address calculations with the offset.

Note: offset addition is moved from the caller to the local usage. For
non-callback usage this is unchanged behavior.

Fixes: e92affc74cd8 ("platform/x86/intel/vsec: Add PMT read callbacks")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://lore.kernel.org/r/20241114130358.2467787-2-michael.j.ruhl@intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/intel/pmt/class.c
drivers/platform/x86/intel/pmt/class.h
drivers/platform/x86/intel/pmt/telemetry.c
include/linux/intel_vsec.h