Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 891e71b1 authored by Pratik Pujar's avatar Pratik Pujar Committed by David S. Miller
Browse files

qlcnic: Firmware dump collection when auto recovery is disabled.



o Allow collecting the firmware dump of halted firmware when auto
  recovery is disabled.

Signed-off-by: default avatarPratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 710a1a49
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -818,6 +818,7 @@ static int qlcnic_83xx_idc_ready_state(struct qlcnic_adapter *adapter)
	struct qlcnic_hardware_context *ahw = adapter->ahw;
	struct qlcnic_hardware_context *ahw = adapter->ahw;
	struct qlcnic_mailbox *mbx = ahw->mailbox;
	struct qlcnic_mailbox *mbx = ahw->mailbox;
	int ret = 0;
	int ret = 0;
	u32 owner;
	u32 val;
	u32 val;


	/* Perform NIC configuration based ready state entry actions */
	/* Perform NIC configuration based ready state entry actions */
@@ -846,6 +847,10 @@ static int qlcnic_83xx_idc_ready_state(struct qlcnic_adapter *adapter)
			clear_bit(QLC_83XX_MBX_READY, &mbx->status);
			clear_bit(QLC_83XX_MBX_READY, &mbx->status);
			set_bit(__QLCNIC_RESETTING, &adapter->state);
			set_bit(__QLCNIC_RESETTING, &adapter->state);
			qlcnic_83xx_idc_enter_need_reset_state(adapter, 1);
			qlcnic_83xx_idc_enter_need_reset_state(adapter, 1);
		}  else {
			owner = qlcnic_83xx_idc_find_reset_owner_id(adapter);
			if (ahw->pci_func == owner)
				qlcnic_dump_fw(adapter);
		}
		}
		return -EIO;
		return -EIO;
	}
	}
@@ -1058,6 +1063,12 @@ void qlcnic_83xx_idc_poll_dev_state(struct work_struct *work)
	adapter->ahw->idc.prev_state = adapter->ahw->idc.curr_state;
	adapter->ahw->idc.prev_state = adapter->ahw->idc.curr_state;
	qlcnic_83xx_periodic_tasks(adapter);
	qlcnic_83xx_periodic_tasks(adapter);


	/* Do not reschedule if firmaware is in hanged state and auto
	 * recovery is disabled
	 */
	if ((adapter->flags & QLCNIC_FW_HANG) && !qlcnic_auto_fw_reset)
		return;

	/* Re-schedule the function */
	/* Re-schedule the function */
	if (test_bit(QLC_83XX_MODULE_LOADED, &adapter->ahw->idc.status))
	if (test_bit(QLC_83XX_MODULE_LOADED, &adapter->ahw->idc.status))
		qlcnic_schedule_work(adapter, qlcnic_83xx_idc_poll_dev_state,
		qlcnic_schedule_work(adapter, qlcnic_83xx_idc_poll_dev_state,
+6 −1
Original line number Original line Diff line number Diff line
@@ -3353,6 +3353,8 @@ done:
static int
static int
qlcnic_check_health(struct qlcnic_adapter *adapter)
qlcnic_check_health(struct qlcnic_adapter *adapter)
{
{
	struct qlcnic_hardware_context *ahw = adapter->ahw;
	struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump;
	u32 state = 0, heartbeat;
	u32 state = 0, heartbeat;
	u32 peg_status;
	u32 peg_status;
	int err = 0;
	int err = 0;
@@ -3377,7 +3379,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
		if (adapter->need_fw_reset)
		if (adapter->need_fw_reset)
			goto detach;
			goto detach;


		if (adapter->ahw->reset_context && qlcnic_auto_fw_reset)
		if (ahw->reset_context && qlcnic_auto_fw_reset)
			qlcnic_reset_hw_context(adapter);
			qlcnic_reset_hw_context(adapter);


		return 0;
		return 0;
@@ -3420,6 +3422,9 @@ detach:


		qlcnic_schedule_work(adapter, qlcnic_detach_work, 0);
		qlcnic_schedule_work(adapter, qlcnic_detach_work, 0);
		QLCDB(adapter, DRV, "fw recovery scheduled.\n");
		QLCDB(adapter, DRV, "fw recovery scheduled.\n");
	} else if (!qlcnic_auto_fw_reset && fw_dump->enable &&
		   adapter->flags & QLCNIC_FW_RESET_OWNER) {
		qlcnic_dump_fw(adapter);
	}
	}


	return 1;
	return 1;