icnss2: Register for co-processor subsystem notifier

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 wait for
POWER_UP event before starting QMI handshake.

Change-Id: Idf65e508a09d93e481349afc73de4804c7841111
This commit is contained in:
Dundi Raviteja
2022-11-08 12:18:55 +05:30
committed by Madan Koyyalamudi
parent 4d71059d9b
commit d2bd912107
3 changed files with 61 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2015-2020, 2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#define pr_fmt(fmt) "icnss2: " fmt
@@ -2200,6 +2200,44 @@ static int icnss_wpss_ssr_register_notifier(struct icnss_priv *priv)
return ret;
}
static int icnss_slate_notifier_nb(struct notifier_block *nb,
unsigned long code,
void *data)
{
return NOTIFY_OK;
}
static int icnss_slate_ssr_register_notifier(struct icnss_priv *priv)
{
int ret = 0;
priv->slate_ssr_nb.notifier_call = icnss_slate_notifier_nb;
priv->slate_notify_handler =
qcom_register_ssr_notifier("slatefw", &priv->slate_ssr_nb);
if (IS_ERR(priv->slate_notify_handler)) {
ret = PTR_ERR(priv->slate_notify_handler);
icnss_pr_err("SLATE register notifier failed: %d\n", ret);
}
set_bit(ICNSS_SLATE_SSR_REGISTERED, &priv->state);
return ret;
}
static int icnss_slate_ssr_unregister_notifier(struct icnss_priv *priv)
{
if (!test_and_clear_bit(ICNSS_SLATE_SSR_REGISTERED, &priv->state))
return 0;
qcom_unregister_ssr_notifier(priv->slate_notify_handler,
&priv->slate_ssr_nb);
priv->slate_notify_handler = NULL;
return 0;
}
static int icnss_modem_ssr_register_notifier(struct icnss_priv *priv)
{
int ret = 0;
@@ -2521,6 +2559,10 @@ static int icnss_enable_recovery(struct icnss_priv *priv)
}
icnss_modem_ssr_register_notifier(priv);
if (priv->is_slate_rfa)
icnss_slate_ssr_register_notifier(priv);
if (test_bit(SSR_ONLY, &priv->ctrl_params.quirks)) {
icnss_pr_dbg("PDR disabled through module parameter\n");
return 0;
@@ -3905,6 +3947,12 @@ static int icnss_resource_parse(struct icnss_priv *priv)
priv->is_rf_subtype_valid = true;
icnss_pr_dbg("RF subtype 0x%x\n", priv->rf_subtype);
}
if (of_property_read_bool(pdev->dev.of_node,
"qcom,is_slate_rfa")) {
priv->is_slate_rfa = true;
icnss_pr_err("SLATE rfa is enabled\n");
}
} else if (priv->device_id == WCN6750_DEVICE_ID) {
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"msi_addr");
@@ -4439,6 +4487,9 @@ static int icnss_remove(struct platform_device *pdev)
complete_all(&priv->unblock_shutdown);
if (priv->is_slate_rfa)
icnss_slate_ssr_unregister_notifier(priv);
icnss_destroy_ramdump_device(priv->msa0_dump_dev);
if (priv->wpss_supported) {