Linux wireless drivers development
 help / color / mirror / Atom feed
From: Yogesh Gaur <yogesh.gaur@intel.com>
To: miriam.rachel.korenblit@intel.com,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: johannes.berg@intel.com, emmanuel.grumbach@intel.com,
	luciano.coelho@intel.com, yogesh.gaur@intel.com
Subject: [PATCH iwlwifi-next] wifi: iwlwifi: pcie: return a real errno from read_config32()
Date: Wed, 14 Oct 2026 18:13:57 +0530	[thread overview]
Message-ID: <20261014124357.2569535-1-yogesh.gaur@intel.com> (raw)

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


             reply	other threads:[~2026-10-14 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 12:43 Yogesh Gaur [this message]
2026-10-14 12:55 ` [PATCH iwlwifi-next] wifi: iwlwifi: pcie: return a real errno from read_config32() Johannes Berg
2026-10-14 13:10   ` Gaur, Yogesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261014124357.2569535-1-yogesh.gaur@intel.com \
    --to=yogesh.gaur@intel.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=miriam.rachel.korenblit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox