mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH iwlwifi-next] wifi: iwlwifi: pcie: return a real errno from read_config32()
@ 2026-10-14 12:43 Yogesh Gaur
  2026-10-14 12:55 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Yogesh Gaur @ 2026-10-14 12:43 UTC (permalink / raw)
  To: miriam.rachel.korenblit, linux-wireless, linux-kernel
  Cc: johannes.berg, emmanuel.grumbach, luciano.coelho, yogesh.gaur

pci_read_config_dword() can also return a positive PCIBIOS_* error code
(e.g. PCIBIOS_DEVICE_NOT_FOUND for a disconnected device), but
iwl_trans_pcie_read_config32() passes it through unchanged and
iwl_dump_ini_config_iter() only checks for ret < 0. The error is missed,
so the loop keeps reading and stores 0xffffffff in the dump.

Convert the return value with pcibios_err_to_errno().

Fixes: f696a7ee254f ("iwlwifi: yoyo: add PCI config space region type")
Signed-off-by: Yogesh Gaur <yogesh.gaur@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c
index 28b276c65952..cfaadddfe06a 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans.c
@@ -2562,8 +2562,12 @@ int iwl_trans_pcie_read_mem_no_grab(struct iwl_trans *trans, u32 addr,
 int iwl_trans_pcie_read_config32(struct iwl_trans *trans, u32 ofs,
 				 u32 *val)
 {
-	return pci_read_config_dword(IWL_TRANS_GET_PCIE_TRANS(trans)->pci_dev,
-				     ofs, val);
+	int ret;
+
+	ret = pci_read_config_dword(IWL_TRANS_GET_PCIE_TRANS(trans)->pci_dev,
+				    ofs, val);
+
+	return pcibios_err_to_errno(ret);
 }
 
 #define IWL_FLUSH_WAIT_MS	2000
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-14 13:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 12:43 [PATCH iwlwifi-next] wifi: iwlwifi: pcie: return a real errno from read_config32() Yogesh Gaur
2026-10-14 12:55 ` Johannes Berg
2026-10-14 13:10   ` Gaur, Yogesh

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®