icnss2: complete AON completion event gracefully
In some error cases AON completion event can be in wait state, so complete it gracefully. Change-Id: I98df398a74e00b9adc3c8d0cf7abcd48b66def1c CRs-Fixed: 3527640
This commit is contained in:

committed by
Rahul Choudhary

parent
8ddac0b648
commit
2f882a1189
@@ -854,7 +854,7 @@ static void icnss_send_wlan_boot_complete(void)
|
|||||||
icnss_pr_info("sent wlan boot complete command\n");
|
icnss_pr_info("sent wlan boot complete command\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void icnss_wait_for_slate_complete(struct icnss_priv *priv)
|
static int icnss_wait_for_slate_complete(struct icnss_priv *priv)
|
||||||
{
|
{
|
||||||
if (!test_bit(ICNSS_SLATE_UP, &priv->state)) {
|
if (!test_bit(ICNSS_SLATE_UP, &priv->state)) {
|
||||||
reinit_completion(&priv->slate_boot_complete);
|
reinit_completion(&priv->slate_boot_complete);
|
||||||
@@ -863,15 +863,21 @@ static void icnss_wait_for_slate_complete(struct icnss_priv *priv)
|
|||||||
wait_for_completion(&priv->slate_boot_complete);
|
wait_for_completion(&priv->slate_boot_complete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!test_bit(ICNSS_SLATE_UP, &priv->state))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
icnss_send_wlan_boot_init();
|
icnss_send_wlan_boot_init();
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static void icnss_send_wlan_boot_complete(void)
|
static void icnss_send_wlan_boot_complete(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void icnss_wait_for_slate_complete(struct icnss_priv *priv)
|
static int icnss_wait_for_slate_complete(struct icnss_priv *priv)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -890,6 +896,14 @@ static int icnss_driver_event_server_arrive(struct icnss_priv *priv,
|
|||||||
clear_bit(ICNSS_FW_DOWN, &priv->state);
|
clear_bit(ICNSS_FW_DOWN, &priv->state);
|
||||||
clear_bit(ICNSS_FW_READY, &priv->state);
|
clear_bit(ICNSS_FW_READY, &priv->state);
|
||||||
|
|
||||||
|
if (priv->is_slate_rfa) {
|
||||||
|
ret = icnss_wait_for_slate_complete(priv);
|
||||||
|
if (ret == -EINVAL) {
|
||||||
|
icnss_pr_err("Slate complete failed\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
icnss_ignore_fw_timeout(false);
|
icnss_ignore_fw_timeout(false);
|
||||||
|
|
||||||
if (test_bit(ICNSS_WLFW_CONNECTED, &priv->state)) {
|
if (test_bit(ICNSS_WLFW_CONNECTED, &priv->state)) {
|
||||||
@@ -903,9 +917,6 @@ static int icnss_driver_event_server_arrive(struct icnss_priv *priv,
|
|||||||
|
|
||||||
set_bit(ICNSS_WLFW_CONNECTED, &priv->state);
|
set_bit(ICNSS_WLFW_CONNECTED, &priv->state);
|
||||||
|
|
||||||
if (priv->is_slate_rfa)
|
|
||||||
icnss_wait_for_slate_complete(priv);
|
|
||||||
|
|
||||||
ret = wlfw_ind_register_send_sync_msg(priv);
|
ret = wlfw_ind_register_send_sync_msg(priv);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ret == -EALREADY) {
|
if (ret == -EALREADY) {
|
||||||
@@ -2224,6 +2235,9 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
|
|||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case QCOM_SSR_BEFORE_SHUTDOWN:
|
case QCOM_SSR_BEFORE_SHUTDOWN:
|
||||||
|
if (priv->is_slate_rfa)
|
||||||
|
complete(&priv->slate_boot_complete);
|
||||||
|
|
||||||
if (!notif->crashed &&
|
if (!notif->crashed &&
|
||||||
priv->low_power_support) { /* Hibernate */
|
priv->low_power_support) { /* Hibernate */
|
||||||
if (test_bit(ICNSS_MODE_ON, &priv->state))
|
if (test_bit(ICNSS_MODE_ON, &priv->state))
|
||||||
@@ -4830,6 +4844,7 @@ static int icnss_remove(struct platform_device *pdev)
|
|||||||
complete_all(&priv->unblock_shutdown);
|
complete_all(&priv->unblock_shutdown);
|
||||||
|
|
||||||
if (priv->is_slate_rfa) {
|
if (priv->is_slate_rfa) {
|
||||||
|
complete(&priv->slate_boot_complete);
|
||||||
icnss_slate_ssr_unregister_notifier(priv);
|
icnss_slate_ssr_unregister_notifier(priv);
|
||||||
icnss_unregister_slate_event_notifier(priv);
|
icnss_unregister_slate_event_notifier(priv);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user