[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240527132743.14309-1-ilpo.jarvinen@linux.intel.com>
Date: Mon, 27 May 2024 16:27:43 +0300
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
linux-kernel@...r.kernel.org
Cc: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
stable@...r.kernel.org
Subject: [PATCH 1/1] intel_th: pci: Convert PCIBIOS_* return codes to errnos
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@...r.kernel.org
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.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
Powered by blists - more mailing lists