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

Commit 2abdd536 authored by Sameer Thalappil's avatar Sameer Thalappil
Browse files

icnss: Allow recursive recovery for WLAN



Recursive recovery is not allowed for WLAN on debug builds,
that is to ensure that certain error conditions are captured in
stress tests(eg: Modem SSR during WLAN PDR will result in download
mode to see if Modem really failed during PDR handling). But this
prevents adversarial testing of recovery use cases, so add knob to
allow recursive recovery.

CRs-Fixed: 2170294
Change-Id: If093f432be3dac48ede2864c3635d3be6b7b7808
Signed-off-by: default avatarSameer Thalappil <sameert@codeaurora.org>
parent 1b4c2191
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -842,6 +842,7 @@ static int icnss_pd_restart_complete(struct icnss_priv *priv)
	if (ret < 0) {
		icnss_pr_err("Driver reinit failed: %d, state: 0x%lx\n",
			     ret, priv->state);
		if (!priv->allow_recursive_recovery)
			ICNSS_ASSERT(false);
		goto out_power_off;
	}
@@ -992,6 +993,7 @@ static int icnss_driver_event_pd_service_down(struct icnss_priv *priv,
	if (test_bit(ICNSS_PD_RESTART, &priv->state) && event_data->crashed) {
		icnss_pr_err("PD Down while recovery inprogress, crashed: %d, state: 0x%lx\n",
			     event_data->crashed, priv->state);
		if (!priv->allow_recursive_recovery)
			ICNSS_ASSERT(0);
		goto out;
	}
@@ -2205,6 +2207,15 @@ static int icnss_test_mode_fw_test(struct icnss_priv *priv,
	return ret;
}

static void icnss_allow_recursive_recovery(struct device *dev)
{
	struct icnss_priv *priv = dev_get_drvdata(dev);

	priv->allow_recursive_recovery = true;

	icnss_pr_info("Recursive recovery allowed for WLAN\n");
}

static ssize_t icnss_fw_debug_write(struct file *fp,
				    const char __user *user_buf,
				    size_t count, loff_t *off)
@@ -2253,6 +2264,9 @@ static ssize_t icnss_fw_debug_write(struct file *fp,
		case 3:
			ret = icnss_trigger_recovery(&priv->pdev->dev);
			break;
		case 4:
			icnss_allow_recursive_recovery(&priv->pdev->dev);
			break;
		default:
			return -EINVAL;
		}
+1 −0
Original line number Diff line number Diff line
@@ -334,6 +334,7 @@ struct icnss_priv {
	struct ramdump_device *msa0_dump_dev;
	bool bypass_s1_smmu;
	bool force_err_fatal;
	bool allow_recursive_recovery;
	u8 cause_for_rejuvenation;
	u8 requesting_sub_system;
	u16 line_number;