[RAMEN9610-12700][Common] wlbt: Fix interrupt leakage
authorAlbert Cano <a.canocamps@samsung.com>
Fri, 22 Feb 2019 13:35:17 +0000 (13:35 +0000)
committerhskang <hs1218.kang@samsung.com>
Thu, 28 Feb 2019 16:53:06 +0000 (01:53 +0900)
SSB-49603 has introduced a regression where intr_tohost interrupt is not
getting freed on hip4_deinit. If BT remains on, and WIFI runs few on-off
cycles we will see that allocation will eventually fail.

Change-Id: I3419b3f47ad7fc75970d30e870efe607469c3a27
SCSC-Bug-Id: SSB-49808
Signed-off-by: Albert Cano <a.canocamps@samsung.com>
drivers/net/wireless/scsc/hip4.c

index 4f621534ab92b3b3a1e2e8348124edc13507d0e1..9a9cab372f1a9063ce2266719cc86bdc18388fe0 100755 (executable)
@@ -2584,7 +2584,6 @@ void hip4_deinit(struct slsi_hip4 *hip)
 #ifdef CONFIG_SCSC_WLAN_RX_NAPI
        u32 conf_hip4_ver = 0;
 #endif
-
        if (!sdev || !sdev->service)
                return;
 
@@ -2615,29 +2614,26 @@ void hip4_deinit(struct slsi_hip4 *hip)
        atomic_set(&hip->hip_priv->closing, 1);
 
 #ifdef CONFIG_SCSC_WLAN_RX_NAPI
+       for (u8 i = 0; i < MIF_HIP_CFG_Q_NUM; i++)
+               scsc_service_mifintrbit_bit_mask(service, hip->hip_priv->intr_tohost_mul[i]);
+
+       tasklet_kill(&hip->hip_priv->intr_tasklet);
+       cancel_work_sync(&hip->hip_priv->intr_wq_ctrl);
+       cancel_work_sync(&hip->hip_priv->intr_wq_fb);
+
+       for (i = 0; i < MIF_HIP_CFG_Q_NUM; i++)
+               scsc_service_mifintrbit_unregister_tohost(service, hip->hip_priv->intr_tohost_mul[i]);
+
+       /* Get the Version reported by the FW */
        conf_hip4_ver = scsc_wifi_get_hip_config_version(&hip->hip_control->init);
 
        if (conf_hip4_ver == 4) {
-               for (u8 i = 0; i < MIF_HIP_CFG_Q_NUM; i++)
-                       scsc_service_mifintrbit_bit_mask(service, hip->hip_priv->intr_tohost_mul[i]);
-
                netif_napi_del(&hip->hip_priv->napi);
-               tasklet_kill(&hip->hip_priv->intr_tasklet);
-               cancel_work_sync(&hip->hip_priv->intr_wq_ctrl);
-               cancel_work_sync(&hip->hip_priv->intr_wq_fb);
-
-               for (i = 0; i < MIF_HIP_CFG_Q_NUM; i++)
-                       scsc_service_mifintrbit_unregister_tohost(service, hip->hip_priv->intr_tohost_mul[i]);
-       } else {
-               scsc_service_mifintrbit_bit_mask(service, hip->hip_priv->intr_tohost);
-               cancel_work_sync(&hip->hip_priv->intr_wq);
-               scsc_service_mifintrbit_unregister_tohost(service, hip->hip_priv->intr_tohost);
        }
-#else
+#endif
        scsc_service_mifintrbit_bit_mask(service, hip->hip_priv->intr_tohost);
        cancel_work_sync(&hip->hip_priv->intr_wq);
        scsc_service_mifintrbit_unregister_tohost(service, hip->hip_priv->intr_tohost);
-#endif
 
        scsc_service_mifintrbit_free_fromhost(service, hip->hip_priv->intr_fromhost, SCSC_MIFINTR_TARGET_R4);