Skip to content

Commit de03d2b

Browse files
Shannon NelsonJeff Kirsher
authored andcommitted
i40e: Assure that adminq is alive in debug mode
When dropping into debug mode in a failed probe, make sure that the AdminQ is left alive for possible hand debug of driver and firmware states. Move the mutex_init calls earlier in probe so that if init fails, the admin queue interface is still available for debugging purposes. Signed-off-by: Shannon Nelson <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 6927839 commit de03d2b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10822,6 +10822,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1082210822
hw->bus.func = PCI_FUNC(pdev->devfn);
1082310823
pf->instance = pfs_found;
1082410824

10825+
/* set up the locks for the AQ, do this only once in probe
10826+
* and destroy them only once in remove
10827+
*/
10828+
mutex_init(&hw->aq.asq_mutex);
10829+
mutex_init(&hw->aq.arq_mutex);
10830+
1082510831
if (debug != -1) {
1082610832
pf->msg_enable = pf->hw.debug_mask;
1082710833
pf->msg_enable = debug;
@@ -10867,12 +10873,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1086710873
/* set up a default setting for link flow control */
1086810874
pf->hw.fc.requested_mode = I40E_FC_NONE;
1086910875

10870-
/* set up the locks for the AQ, do this only once in probe
10871-
* and destroy them only once in remove
10872-
*/
10873-
mutex_init(&hw->aq.asq_mutex);
10874-
mutex_init(&hw->aq.arq_mutex);
10875-
1087610876
err = i40e_init_adminq(hw);
1087710877
if (err) {
1087810878
if (err == I40E_ERR_FIRMWARE_API_VERSION)
@@ -11265,7 +11265,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1126511265
kfree(pf->qp_pile);
1126611266
err_sw_init:
1126711267
err_adminq_setup:
11268-
(void)i40e_shutdown_adminq(hw);
1126911268
err_pf_reset:
1127011269
iounmap(hw->hw_addr);
1127111270
err_ioremap:

0 commit comments

Comments
 (0)