diff --git a/arch/arm64/configs/vendor/lahaina_QGKI.config b/arch/arm64/configs/vendor/lahaina_QGKI.config index 41b8f149a000..2d7b36a4ec6c 100644 --- a/arch/arm64/configs/vendor/lahaina_QGKI.config +++ b/arch/arm64/configs/vendor/lahaina_QGKI.config @@ -168,6 +168,7 @@ CONFIG_SLIMBUS_MSM_NGD=m CONFIG_QCOM_KGSL=y CONFIG_QCOM_KGSL_CONTEXT_DEBUG=y CONFIG_QCOM_QFPROM=y +CONFIG_ICNSS2_RESTART_LEVEL_NOTIF=y CONFIG_ARM_QCOM_CPUFREQ_HW=y CONFIG_NETFILTER_XT_TARGET_TEE=y CONFIG_NETFILTER_XT_TARGET_NOTRACK=y diff --git a/drivers/soc/qcom/icnss2/Kconfig b/drivers/soc/qcom/icnss2/Kconfig index 829db44f2cd8..ea716df701d2 100644 --- a/drivers/soc/qcom/icnss2/Kconfig +++ b/drivers/soc/qcom/icnss2/Kconfig @@ -28,6 +28,15 @@ config ICNSS2_QMI and configurations. It also send WLAN on/off control message to FW over QMI channel. +config ICNSS2_RESTART_LEVEL_NOTIF + bool "Enable Restart level change notification" + depends on ICNSS2 + help + Say 'Y' here to enable ICNSS2_RESTART_LEVEL_NOTIF support. + This will be needed to register notifier and get notification for + restart_level change of WLAN Sub system. On receiving notification + ICNSS2 enable/disable M3 SSR. This is only enabled for QGKI config. + config CNSS_QCA6750 bool "Enable ICNSS QCA6750 chipset specific changes" depends on ICNSS2 diff --git a/drivers/soc/qcom/icnss2/main.c b/drivers/soc/qcom/icnss2/main.c index b022ec250052..0363f2e1963b 100644 --- a/drivers/soc/qcom/icnss2/main.c +++ b/drivers/soc/qcom/icnss2/main.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "main.h" #include "qmi.h" #include "debug.h" @@ -3907,6 +3908,22 @@ static inline bool icnss_use_nv_mac(struct icnss_priv *priv) "use-nv-mac"); } +#ifdef CONFIG_ICNSS2_RESTART_LEVEL_NOTIF +static void pil_restart_level_notifier(void *ignore, + int restart_level, + const char *fw) +{ + icnss_pr_err("PIL Notifier, restart_level: %d, FW:%s", + restart_level, fw); + if (!strcmp(fw, "wpss")) { + if (restart_level == RESET_SUBSYS_COUPLED) + icnss_send_smp2p(penv, ICNSS_ENABLE_M3_SSR); + else + icnss_send_smp2p(penv, ICNSS_DISABLE_M3_SSR); + } +} +#endif + static int icnss_probe(struct platform_device *pdev) { int ret = 0; @@ -4023,6 +4040,9 @@ static int icnss_probe(struct platform_device *pdev) icnss_pr_dbg("NV MAC feature is %s\n", priv->use_nv_mac ? "Mandatory":"Not Mandatory"); INIT_WORK(&wpss_loader, icnss_wpss_load); +#ifdef CONFIG_ICNSS2_RESTART_LEVEL_NOTIF + register_trace_pil_restart_level(pil_restart_level_notifier, NULL); +#endif } INIT_LIST_HEAD(&priv->icnss_tcdev_list); @@ -4054,6 +4074,9 @@ static int icnss_remove(struct platform_device *pdev) icnss_dms_deinit(priv); icnss_genl_exit(); icnss_runtime_pm_deinit(priv); +#ifdef CONFIG_ICNSS2_RESTART_LEVEL_NOTIF + unregister_trace_pil_restart_level(pil_restart_level_notifier, NULL); +#endif } device_init_wakeup(&priv->pdev->dev, false); diff --git a/drivers/soc/qcom/icnss2/main.h b/drivers/soc/qcom/icnss2/main.h index 0615d9a53896..47d9a5e43f6c 100644 --- a/drivers/soc/qcom/icnss2/main.h +++ b/drivers/soc/qcom/icnss2/main.h @@ -183,6 +183,10 @@ enum icnss_smp2p_msg_id { ICNSS_POWER_SAVE_ENTER = 1, ICNSS_POWER_SAVE_EXIT, ICNSS_TRIGGER_SSR, +#ifdef CONFIG_ICNSS2_RESTART_LEVEL_NOTIF + ICNSS_ENABLE_M3_SSR, + ICNSS_DISABLE_M3_SSR, +#endif ICNSS_PCI_EP_POWER_SAVE_ENTER = 6, ICNSS_PCI_EP_POWER_SAVE_EXIT, };