summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandeep Singh <quic_sandsing@quicinc.com>2023-02-01 15:26:29 +0530
committerSandeep Singh <quic_sandsing@quicinc.com>2023-02-01 15:26:29 +0530
commit3a589a650e88725d84d9aca1811c792473211b1c (patch)
tree4a5d443738cf55fbb10592c313019af4260b6b9b
parent7ea12c4e63d49797e0c0e379feae7d050beb01b0 (diff)
downloadwlan-platform-3a589a650e88725d84d9aca1811c792473211b1c.tar.gz
icnss2: Remove wlan driver on device shutdown
This change shutdown wpss on device shutdown for adrastea targets. With this change icnss driver unloads wlan host driver in wpss shutdown callback. Change-Id: I6d7d2563e694786b8d74725d77dc8c25943198e9 CRs-Fixed: 3392307
-rw-r--r--icnss2/main.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/icnss2/main.c b/icnss2/main.c
index ca58cf1..54179f7 100644
--- a/icnss2/main.c
+++ b/icnss2/main.c
@@ -132,14 +132,26 @@ static struct icnss_priv *icnss_get_plat_priv(void)
return penv;
}
+static inline void icnss_wpss_unload(struct icnss_priv *priv)
+{
+ if (priv && priv->rproc) {
+ rproc_shutdown(priv->rproc);
+ rproc_put(priv->rproc);
+ priv->rproc = NULL;
+ }
+}
+
static ssize_t icnss_sysfs_store(struct kobject *kobj,
struct kobj_attribute *attr,
const char *buf, size_t count)
{
struct icnss_priv *priv = icnss_get_plat_priv();
- atomic_set(&priv->is_shutdown, true);
icnss_pr_dbg("Received shutdown indication");
+
+ atomic_set(&priv->is_shutdown, true);
+ if (priv->wpss_supported && priv->device_id == ADRASTEA_DEVICE_ID)
+ icnss_wpss_unload(priv);
return count;
}
@@ -2068,15 +2080,17 @@ static int icnss_wpss_notifier_nb(struct notifier_block *nb,
icnss_pr_info("WPSS went down, state: 0x%lx, crashed: %d\n",
priv->state, notif->crashed);
+ if (priv->device_id == ADRASTEA_DEVICE_ID)
+ icnss_update_state_send_modem_shutdown(priv, data);
+
set_bit(ICNSS_FW_DOWN, &priv->state);
+ icnss_ignore_fw_timeout(true);
if (notif->crashed)
priv->stats.recovery.root_pd_crash++;
else
priv->stats.recovery.root_pd_shutdown++;
- icnss_ignore_fw_timeout(true);
-
event_data = kzalloc(sizeof(*event_data), GFP_KERNEL);
if (event_data == NULL)
@@ -3799,15 +3813,6 @@ static void icnss_wpss_load(struct work_struct *wpss_load_work)
}
}
-static inline void icnss_wpss_unload(struct icnss_priv *priv)
-{
- if (priv && priv->rproc) {
- rproc_shutdown(priv->rproc);
- rproc_put(priv->rproc);
- priv->rproc = NULL;
- }
-}
-
static ssize_t wpss_boot_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)