Search Linux Wireless

Re: iwlwifi fw reset handshake

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2022-04-13 at 12:31 -0400, Chris Rogers wrote:
> In commit 906d4eb84408a4bfd63eef0de4f1bd5262f73ac0, a firmware reset
> handshake was introduced to iwlwifi. This code looks for the
> MSIX_HW_INT_CAUSES_REG_RESET_DONE interrupt in
> iwl_pcie_irq_msix_handler in rx.c, but it does not appear to handle
> anything along the MSI path.

Uh, oops.

> My environment is:
> - AX210 card, xen pci passthrough in MSI mode
> - linux v5.15.32
> 
> Based on some testing I've done, the wait_event_timeout in
> pcie/trans-gen2.c always times out.  The result is the "firmware
> didn't ACK the reset - continue anyway" message and a dump before it
> continues on.  Is the reset handshake something that should be handled
> on the MSI path? Given what's defined in iwl-csr.h, I'm not sure how
> to listen for a response from the card to wake_up the fw_reset_waitq
> like the MSI-X path.
> 

Do you get a print like

	Unhandled INTA bits 0x00000004

by any chance?

I think the number should be the same, so something like this perhaps:

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
index 3ed4e8f69f28..cf5462186f36 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
@@ -1892,7 +1892,13 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
 		iwl_disable_interrupts(trans);
 
 		isr_stats->hw++;
-		iwl_pcie_irq_handle_error(trans);
+
+		if (trans_pcie->fw_reset_state == FW_RESET_REQUESTED) {
+			trans_pcie->fw_reset_state = FW_RESET_ERROR;
+			wake_up(&trans_pcie->fw_reset_waitq);
+		} else {
+			iwl_pcie_irq_handle_error(trans);
+		}
 
 		handled |= CSR_INT_BIT_HW_ERR;
 
@@ -2025,6 +2031,14 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
 		}
 	}
 
+	/* same bit for MSI/MSI-X */
+	if (inta & MSIX_HW_INT_CAUSES_REG_RESET_DONE) {
+		handled |= MSIX_HW_INT_CAUSES_REG_RESET_DONE;
+		IWL_DEBUG_ISR(trans, "Reset flow completed\n");
+		trans_pcie->fw_reset_state = FW_RESET_OK;
+		wake_up(&trans_pcie->fw_reset_waitq);
+	}
+
 	if (inta & ~handled) {
 		IWL_ERR(trans, "Unhandled INTA bits 0x%08x\n", inta & ~handled);
 		isr_stats->unhandled++;


If you can test it that'd be nice, I'm not sure how I can force anything
into MSI vs. MSI-X.

johannes



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux