icnss2: Handle co-processor subsys down notification

WLAN RFA is present on another co-processor subsystem.
Any error fatal in co-processor subsystem will result in
WLAN reset.

In order to make sure that rf clock/rails are up
before accessing WLAN hardware, ICNSS platform driver
needs to register with co-processor SSR notification and trigger
PDR once co-processor is down.

Change-Id: I28cdc997646cc15ef0de23c28dfada87972eb465
This commit is contained in:
Dundi Raviteja
2022-11-08 15:43:36 +05:30
committed by Madan Koyyalamudi
parent 951c866f53
commit e5906b5e52

View File

@@ -2213,6 +2213,8 @@ static int icnss_slate_notifier_nb(struct notifier_block *nb,
{
struct icnss_priv *priv = container_of(nb, struct icnss_priv,
slate_ssr_nb);
int ret = 0;
icnss_pr_vdbg("Slate-subsys-notify: event %lu\n", code);
if (code == QCOM_SSR_AFTER_POWERUP) {
@@ -2220,8 +2222,25 @@ static int icnss_slate_notifier_nb(struct notifier_block *nb,
complete(&priv->slate_boot_complete);
icnss_pr_dbg("Slate boot complete, state: 0x%lx\n",
priv->state);
} else if (code == QCOM_SSR_BEFORE_SHUTDOWN &&
test_bit(ICNSS_SLATE_UP, &priv->state)) {
clear_bit(ICNSS_SLATE_UP, &priv->state);
if (test_bit(ICNSS_PD_RESTART, &priv->state)) {
icnss_pr_err("PD_RESTART in progress 0x%lx\n",
priv->state);
goto skip_pdr;
}
icnss_pr_dbg("Initiating PDR 0x%lx\n", priv->state);
ret = icnss_trigger_recovery(&priv->pdev->dev);
if (ret < 0) {
icnss_fatal_err("Fail to trigger PDR: ret: %d, state: 0x%lx\n",
ret, priv->state);
goto skip_pdr;
}
}
skip_pdr:
return NOTIFY_OK;
}