diff options
| author | Michael J. Ruhl <michael.j.ruhl@intel.com> | 2024-11-14 08:03:57 -0500 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2024-11-14 15:16:50 +0200 |
| commit | 0c32840763b1579c923b4216c18bb756ca4ba473 (patch) | |
| tree | 9f3826c75eeed5320acd5a922c38054b73b2bd8f /drivers/platform/x86/intel/pmt/telemetry.c | |
| parent | platform/x86/amd/hsmp: Change the error type (diff) | |
| download | linux-0c32840763b1579c923b4216c18bb756ca4ba473.tar.gz linux-0c32840763b1579c923b4216c18bb756ca4ba473.zip | |
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>
Diffstat (limited to 'drivers/platform/x86/intel/pmt/telemetry.c')
| -rw-r--r-- | drivers/platform/x86/intel/pmt/telemetry.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c index c9feac859e57..0cea617c6c2e 100644 --- a/drivers/platform/x86/intel/pmt/telemetry.c +++ b/drivers/platform/x86/intel/pmt/telemetry.c @@ -219,7 +219,7 @@ int pmt_telem_read(struct telem_endpoint *ep, u32 id, u64 *data, u32 count) if (offset + NUM_BYTES_QWORD(count) > size) return -EINVAL; - pmt_telem_read_mmio(ep->pcidev, ep->cb, ep->header.guid, data, ep->base + offset, + pmt_telem_read_mmio(ep->pcidev, ep->cb, ep->header.guid, data, ep->base, offset, NUM_BYTES_QWORD(count)); return ep->present ? 0 : -EPIPE; |
