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:

committed by
Madan Koyyalamudi

vanhempi
4d71059d9b
commit
d2bd912107
@@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
@@ -415,6 +416,9 @@ static int icnss_stats_show_state(struct seq_file *s, struct icnss_priv *priv)
|
|||||||
continue;
|
continue;
|
||||||
case ICNSS_QMI_DMS_CONNECTED:
|
case ICNSS_QMI_DMS_CONNECTED:
|
||||||
seq_puts(s, "DMS_CONNECTED");
|
seq_puts(s, "DMS_CONNECTED");
|
||||||
|
continue;
|
||||||
|
case ICNSS_SLATE_SSR_REGISTERED:
|
||||||
|
seq_puts(s, "SLATE SSR REGISTERED");
|
||||||
}
|
}
|
||||||
|
|
||||||
seq_printf(s, "UNKNOWN-%d", i);
|
seq_printf(s, "UNKNOWN-%d", i);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2020, 2021, The Linux Foundation. All rights reserved.
|
* 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
|
#define pr_fmt(fmt) "icnss2: " fmt
|
||||||
@@ -2200,6 +2200,44 @@ static int icnss_wpss_ssr_register_notifier(struct icnss_priv *priv)
|
|||||||
return ret;
|
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)
|
static int icnss_modem_ssr_register_notifier(struct icnss_priv *priv)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@@ -2521,6 +2559,10 @@ static int icnss_enable_recovery(struct icnss_priv *priv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
icnss_modem_ssr_register_notifier(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)) {
|
if (test_bit(SSR_ONLY, &priv->ctrl_params.quirks)) {
|
||||||
icnss_pr_dbg("PDR disabled through module parameter\n");
|
icnss_pr_dbg("PDR disabled through module parameter\n");
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3905,6 +3947,12 @@ static int icnss_resource_parse(struct icnss_priv *priv)
|
|||||||
priv->is_rf_subtype_valid = true;
|
priv->is_rf_subtype_valid = true;
|
||||||
icnss_pr_dbg("RF subtype 0x%x\n", priv->rf_subtype);
|
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) {
|
} else if (priv->device_id == WCN6750_DEVICE_ID) {
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||||
"msi_addr");
|
"msi_addr");
|
||||||
@@ -4439,6 +4487,9 @@ static int icnss_remove(struct platform_device *pdev)
|
|||||||
|
|
||||||
complete_all(&priv->unblock_shutdown);
|
complete_all(&priv->unblock_shutdown);
|
||||||
|
|
||||||
|
if (priv->is_slate_rfa)
|
||||||
|
icnss_slate_ssr_unregister_notifier(priv);
|
||||||
|
|
||||||
icnss_destroy_ramdump_device(priv->msa0_dump_dev);
|
icnss_destroy_ramdump_device(priv->msa0_dump_dev);
|
||||||
|
|
||||||
if (priv->wpss_supported) {
|
if (priv->wpss_supported) {
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2020, 2021, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2020, 2021, The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __MAIN_H__
|
#ifndef __MAIN_H__
|
||||||
@@ -124,6 +125,7 @@ enum icnss_driver_state {
|
|||||||
ICNSS_DEL_SERVER,
|
ICNSS_DEL_SERVER,
|
||||||
ICNSS_COLD_BOOT_CAL,
|
ICNSS_COLD_BOOT_CAL,
|
||||||
ICNSS_QMI_DMS_CONNECTED,
|
ICNSS_QMI_DMS_CONNECTED,
|
||||||
|
ICNSS_SLATE_SSR_REGISTERED,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ce_irq_list {
|
struct ce_irq_list {
|
||||||
@@ -427,6 +429,8 @@ struct icnss_priv {
|
|||||||
struct notifier_block modem_ssr_nb;
|
struct notifier_block modem_ssr_nb;
|
||||||
struct notifier_block wpss_ssr_nb;
|
struct notifier_block wpss_ssr_nb;
|
||||||
struct notifier_block wpss_early_ssr_nb;
|
struct notifier_block wpss_early_ssr_nb;
|
||||||
|
void *slate_notify_handler;
|
||||||
|
struct notifier_block slate_ssr_nb;
|
||||||
uint32_t diag_reg_read_addr;
|
uint32_t diag_reg_read_addr;
|
||||||
uint32_t diag_reg_read_mem_type;
|
uint32_t diag_reg_read_mem_type;
|
||||||
uint32_t diag_reg_read_len;
|
uint32_t diag_reg_read_len;
|
||||||
@@ -494,6 +498,7 @@ struct icnss_priv {
|
|||||||
bool wpss_supported;
|
bool wpss_supported;
|
||||||
bool is_rf_subtype_valid;
|
bool is_rf_subtype_valid;
|
||||||
u32 rf_subtype;
|
u32 rf_subtype;
|
||||||
|
u8 is_slate_rfa;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct icnss_reg_info {
|
struct icnss_reg_info {
|
||||||
|
Viittaa uudesa ongelmassa
Block a user