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

Commit 207f71fa authored by Yuanyuan Liu's avatar Yuanyuan Liu
Browse files

icnss: Re-probe if driver probe returns error of defer



If wlan driver probe returns error of defer, platform driver will
try to recover by calling probe again. The maximun probe count
is 2.

CRs-Fixed: 2124152
Change-Id: Ic973d0f1d76fc59ce5950397d42a9e778cacaa5a
Signed-off-by: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
parent 9e6d8704
Loading
Loading
Loading
Loading
+20 −8
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@
#define ICNSS_DEFAULT_FEATURE_MASK 0x01

#define ICNSS_QUIRKS_DEFAULT		BIT(FW_REJUVENATE_ENABLE)
#define ICNSS_MAX_PROBE_CNT		2

static struct icnss_priv *penv;

@@ -720,7 +721,8 @@ static int icnss_driver_event_server_exit(void *data)

static int icnss_call_driver_probe(struct icnss_priv *priv)
{
	int ret;
	int ret = 0;
	int probe_cnt = 0;

	if (!priv->ops || !priv->ops->probe)
		return 0;
@@ -732,10 +734,15 @@ static int icnss_call_driver_probe(struct icnss_priv *priv)

	icnss_hw_power_on(priv);

	while (probe_cnt < ICNSS_MAX_PROBE_CNT) {
		ret = priv->ops->probe(&priv->pdev->dev);
		probe_cnt++;
		if (ret != -EPROBE_DEFER)
			break;
	}
	if (ret < 0) {
		icnss_pr_err("Driver probe failed: %d, state: 0x%lx\n",
			     ret, priv->state);
		icnss_pr_err("Driver probe failed: %d, state: 0x%lx, probe_cnt: %d\n",
			     ret, priv->state, probe_cnt);
		goto out;
	}

@@ -843,6 +850,7 @@ static int icnss_driver_event_fw_ready_ind(void *data)
static int icnss_driver_event_register_driver(void *data)
{
	int ret = 0;
	int probe_cnt = 0;

	if (penv->ops)
		return -EEXIST;
@@ -862,11 +870,15 @@ static int icnss_driver_event_register_driver(void *data)
	if (ret)
		goto out;

	while (probe_cnt < ICNSS_MAX_PROBE_CNT) {
		ret = penv->ops->probe(&penv->pdev->dev);

		probe_cnt++;
		if (ret != -EPROBE_DEFER)
			break;
	}
	if (ret) {
		icnss_pr_err("Driver probe failed: %d, state: 0x%lx\n",
			     ret, penv->state);
		icnss_pr_err("Driver probe failed: %d, state: 0x%lx, probe_cnt: %d\n",
			     ret, penv->state, probe_cnt);
		goto power_off;
	}