All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 RESEND] wifi: iwlwifi: mvm: Add error logging for iwl_finish_nic_init()
@ 2025-04-22  2:32 Wentao Liang
  2025-04-22  7:34 ` Johannes Berg
  2025-04-22 12:22 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-04-22  2:32 UTC (permalink / raw)
  To: miriam.rachel.korenblit, kvalo
  Cc: johannes.berg, emmanuel.grumbach, golan.ben.ami, linux-wireless,
	linux-kernel, Wentao Liang

The function iwl_pci_resume() calls the function iwl_finish_nic_init(),
but does not check their return values.

Log a detailed error message with the error code to aid in diagnosing
root causes if encountering irreparable errors. While this does not fix
the underlying problem, it assist debugging by making the failure
visible in logs.

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
v2: Fix improper code.

 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 8fb2aa282242..34a7a3e4f7c0 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1616,6 +1616,7 @@ static int _iwl_pci_resume(struct device *device, bool restore)
 	struct iwl_trans *trans = pci_get_drvdata(pdev);
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 	bool device_was_powered_off = false;
+	int err;
 
 	/* Before you put code here, think about WoWLAN. You cannot check here
 	 * whether WoWLAN is enabled or not, and your code will run even if
@@ -1647,7 +1648,11 @@ static int _iwl_pci_resume(struct device *device, bool restore)
 		 * won't really know how to recover.
 		 */
 		iwl_pcie_prepare_card_hw(trans);
-		iwl_finish_nic_init(trans);
+		err = iwl_finish_nic_init(trans);
+		if (err)
+			IWL_ERR(trans,
+				"NIC initialization failed after power-off (error %d).",
+				err);
 		iwl_op_mode_device_powered_off(trans->op_mode);
 	}
 
-- 
2.42.0.windows.2


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

end of thread, other threads:[~2025-04-22 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-22  2:32 [PATCH v2 RESEND] wifi: iwlwifi: mvm: Add error logging for iwl_finish_nic_init() Wentao Liang
2025-04-22  7:34 ` Johannes Berg
2025-04-22 12:22 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.