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

Commit 2bc9d1d0 authored by Yue Ma's avatar Yue Ma
Browse files

cnss2: Collect device RAM dump during WLAN driver unload



There is a chance that firmware crashes while WLAN driver is
unloading. Collect device RAM dump for this case only in debug
builds in order to debug the issue. For other builds, ignore it
since device is going to be shutdown completely.

Change-Id: I16cab04744b376d3104f07255b4421d60ac22d20
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent 509db46a
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -985,6 +985,11 @@ void cnss_schedule_recovery(struct device *dev,


	cnss_bus_update_status(plat_priv, CNSS_FW_DOWN);
	cnss_bus_update_status(plat_priv, CNSS_FW_DOWN);


	if (test_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state)) {
		cnss_pr_dbg("Driver unload is in progress, ignore schedule recovery\n");
		return;
	}

	if (in_interrupt() || irqs_disabled())
	if (in_interrupt() || irqs_disabled())
		gfp = GFP_ATOMIC;
		gfp = GFP_ATOMIC;


+18 −5
Original line number Original line Diff line number Diff line
@@ -373,6 +373,18 @@ int cnss_pci_update_status(struct cnss_pci_data *pci_priv,
	return 0;
	return 0;
}
}


#ifdef CONFIG_CNSS2_DEBUG
static void cnss_pci_collect_dump(struct cnss_pci_data *pci_priv)
{
	cnss_pci_collect_dump_info(pci_priv, false);
	CNSS_ASSERT(0);
}
#else
static void cnss_pci_collect_dump(struct cnss_pci_data *pci_priv)
{
}
#endif

static int cnss_qca6174_powerup(struct cnss_pci_data *pci_priv)
static int cnss_qca6174_powerup(struct cnss_pci_data *pci_priv)
{
{
	int ret = 0;
	int ret = 0;
@@ -531,6 +543,12 @@ static int cnss_qca6290_shutdown(struct cnss_pci_data *pci_priv)
	cnss_pci_set_monitor_wake_intr(pci_priv, false);
	cnss_pci_set_monitor_wake_intr(pci_priv, false);
	cnss_pci_set_auto_suspended(pci_priv, 0);
	cnss_pci_set_auto_suspended(pci_priv, 0);


	if (test_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state) &&
	    test_bit(CNSS_DEV_ERR_NOTIFY, &plat_priv->driver_state)) {
		del_timer(&pci_priv->dev_rddm_timer);
		cnss_pci_collect_dump(pci_priv);
	}

	cnss_pci_stop_mhi(pci_priv);
	cnss_pci_stop_mhi(pci_priv);


	ret = cnss_suspend_pci_link(pci_priv);
	ret = cnss_suspend_pci_link(pci_priv);
@@ -2069,11 +2087,6 @@ static void cnss_mhi_notify_status(struct mhi_controller *mhi_ctrl, void *priv,
	cnss_pr_dbg("MHI status cb is called with reason %s(%d)\n",
	cnss_pr_dbg("MHI status cb is called with reason %s(%d)\n",
		    cnss_mhi_notify_status_to_str(reason), reason);
		    cnss_mhi_notify_status_to_str(reason), reason);


	if (test_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state)) {
		cnss_pr_dbg("Driver unload is in progress, ignore device error\n");
		return;
	}

	switch (reason) {
	switch (reason) {
	case MHI_CB_IDLE:
	case MHI_CB_IDLE:
		return;
		return;