* [PATCH 1/1] intel_th: pci: Convert PCIBIOS_* return codes to errnos
@ 2024-05-27 13:27 Ilpo Järvinen
0 siblings, 0 replies; only message in thread
From: Ilpo Järvinen @ 2024-05-27 13:27 UTC (permalink / raw)
To: Alexander Shishkin, linux-kernel; +Cc: Ilpo Järvinen, stable
intel_th_pci_activate() uses pci_{read,write}_config_dword() that
return PCIBIOS_* codes. The value is returned as is to the caller. The
non-errno return value is returned all the way to active_store() which
then returns the value like it is an error. PCIBIOS_* return codes,
however, are positive (0x8X) so the return value of the store function
is treated as the length consumed from the write buffer which can
confuse the userspace writer.
Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal
errno before returning it from intel_th_pci_activate().
Fixes: a0e7df335afd ("intel_th: Perform time resync on capture start")
Cc: stable@vger.kernel.org
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/hwtracing/intel_th/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
index 147d338c191e..40e2c922fbe7 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -46,7 +46,7 @@ static int intel_th_pci_activate(struct intel_th *th)
if (err)
dev_err(&pdev->dev, "failed to read NPKDSC register\n");
- return err;
+ return pcibios_err_to_errno(err);
}
static void intel_th_pci_deactivate(struct intel_th *th)
--
2.39.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-27 13:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27 13:27 [PATCH 1/1] intel_th: pci: Convert PCIBIOS_* return codes to errnos Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®