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
This commit is contained in:
Sandeep Singh
2023-02-01 15:26:29 +05:30
parent 7ea12c4e63
commit 3a589a650e

View File

@@ -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)