Merge "icnss: Re-probe if driver probe returns error of defer"
This commit is contained in:
commit
6210ce938e
1 changed files with 21 additions and 8 deletions
|
@ -73,6 +73,8 @@ module_param(qmi_timeout, ulong, 0600);
|
|||
#define ICNSS_THRESHOLD_LOW 3450000
|
||||
#define ICNSS_THRESHOLD_GUARD 20000
|
||||
|
||||
#define ICNSS_MAX_PROBE_CNT 2
|
||||
|
||||
#define icnss_ipc_log_string(_x...) do { \
|
||||
if (icnss_ipc_log_context) \
|
||||
ipc_log_string(icnss_ipc_log_context, _x); \
|
||||
|
@ -2105,7 +2107,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;
|
||||
|
@ -2117,10 +2120,15 @@ static int icnss_call_driver_probe(struct icnss_priv *priv)
|
|||
|
||||
icnss_hw_power_on(priv);
|
||||
|
||||
ret = priv->ops->probe(&priv->pdev->dev);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -2228,6 +2236,7 @@ out:
|
|||
static int icnss_driver_event_register_driver(void *data)
|
||||
{
|
||||
int ret = 0;
|
||||
int probe_cnt = 0;
|
||||
|
||||
if (penv->ops)
|
||||
return -EEXIST;
|
||||
|
@ -2247,11 +2256,15 @@ static int icnss_driver_event_register_driver(void *data)
|
|||
if (ret)
|
||||
goto out;
|
||||
|
||||
ret = penv->ops->probe(&penv->pdev->dev);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue