icnss2: Add Low power mode to icnss driver state

Deep Sleep is a system wide low power mode during which
Modem would be brought down and DDR would be in self
refresh mode (suspend-to-RAM) thus platform driver on
receiving deep sleep indication goes to a state similar
to SSR apart from the fact that FW is not crashed but
deliberately brought down.

In msm-5.15, there are no seperate notifications used
for deep sleep, notifications used for hibernate like
BEFORE_SHUTDOWN, AFTER_SHUTDOWN, BEFORE_POWERUP and
AFTER_POWERUP are used for deep sleep also.

In this commit add only low power mode state to
icnss driver state.

Change-Id: I4b12c5a8841e3cfc3e5e44ab6d9dff141e472876
CRs-Fixed: 3394501
这个提交包含在:
Surabhi Vishnoi
2022-11-08 15:52:05 +05:30
提交者 Gerrit - the friendly Code Review server
父节点 2ac2197477
当前提交 6c9f906a94
修改 4 个文件,包含 21 行新增4 行删除

查看文件

@@ -422,6 +422,9 @@ static int icnss_stats_show_state(struct seq_file *s, struct icnss_priv *priv)
continue; continue;
case ICNSS_SLATE_UP: case ICNSS_SLATE_UP:
seq_puts(s, "ICNSS SLATE UP"); seq_puts(s, "ICNSS SLATE UP");
continue;
case ICNSS_LOW_POWER:
seq_puts(s, "ICNSS LOW POWER");
} }
seq_printf(s, "UNKNOWN-%d", i); seq_printf(s, "UNKNOWN-%d", i);

查看文件

@@ -519,6 +519,15 @@ static int icnss_send_smp2p(struct icnss_priv *priv,
return ret; return ret;
} }
bool icnss_is_low_power(void)
{
if (!penv)
return false;
else
return test_bit(ICNSS_LOW_POWER, &penv->state);
}
EXPORT_SYMBOL(icnss_is_low_power);
static irqreturn_t fw_error_fatal_handler(int irq, void *ctx) static irqreturn_t fw_error_fatal_handler(int irq, void *ctx)
{ {
struct icnss_priv *priv = ctx; struct icnss_priv *priv = ctx;
@@ -1092,6 +1101,7 @@ static int icnss_pd_restart_complete(struct icnss_priv *priv)
clear_bit(ICNSS_PDR, &priv->state); clear_bit(ICNSS_PDR, &priv->state);
clear_bit(ICNSS_REJUVENATE, &priv->state); clear_bit(ICNSS_REJUVENATE, &priv->state);
clear_bit(ICNSS_PD_RESTART, &priv->state); clear_bit(ICNSS_PD_RESTART, &priv->state);
clear_bit(ICNSS_LOW_POWER, &priv->state);
priv->early_crash_ind = false; priv->early_crash_ind = false;
priv->is_ssr = false; priv->is_ssr = false;
@@ -2159,14 +2169,16 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
icnss_pr_vdbg("Modem-Notify: event %s(%lu)\n", icnss_pr_vdbg("Modem-Notify: event %s(%lu)\n",
icnss_qcom_ssr_notify_state_to_str(code), code); icnss_qcom_ssr_notify_state_to_str(code), code);
if (code == QCOM_SSR_AFTER_SHUTDOWN) { switch (code) {
case QCOM_SSR_BEFORE_SHUTDOWN:
break;
case QCOM_SSR_AFTER_SHUTDOWN:
icnss_pr_info("Collecting msa0 segment dump\n"); icnss_pr_info("Collecting msa0 segment dump\n");
icnss_msa0_ramdump(priv); icnss_msa0_ramdump(priv);
goto out; goto out;
} default:
if (code != QCOM_SSR_BEFORE_SHUTDOWN)
goto out; goto out;
}
priv->is_ssr = true; priv->is_ssr = true;

查看文件

@@ -128,6 +128,7 @@ enum icnss_driver_state {
ICNSS_QMI_DMS_CONNECTED, ICNSS_QMI_DMS_CONNECTED,
ICNSS_SLATE_SSR_REGISTERED, ICNSS_SLATE_SSR_REGISTERED,
ICNSS_SLATE_UP, ICNSS_SLATE_UP,
ICNSS_LOW_POWER,
}; };
struct ce_irq_list { struct ce_irq_list {

查看文件

@@ -177,6 +177,7 @@ extern unsigned int icnss_socinfo_get_serial_number(struct device *dev);
extern bool icnss_is_qmi_disable(struct device *dev); extern bool icnss_is_qmi_disable(struct device *dev);
extern bool icnss_is_fw_ready(void); extern bool icnss_is_fw_ready(void);
extern bool icnss_is_fw_down(void); extern bool icnss_is_fw_down(void);
extern bool icnss_is_low_power(void);
extern bool icnss_is_rejuvenate(void); extern bool icnss_is_rejuvenate(void);
extern int icnss_trigger_recovery(struct device *dev); extern int icnss_trigger_recovery(struct device *dev);
extern void icnss_block_shutdown(bool status); extern void icnss_block_shutdown(bool status);