[NEUS7920-218] [9610] wlbt: un-mask interrupts on resume
authorDebabrata Purohit <d.purohit@samsung.com>
Wed, 24 Apr 2019 21:24:47 +0000 (22:24 +0100)
committerKim Gunho <gunho.kim@samsung.com>
Fri, 28 Jun 2019 14:45:10 +0000 (23:45 +0900)
WLAN service driver unmasks all interrupts when
entering suspend.
And this interrupt status is saved and restored
by platform driver on resume.
But it will be more robust (to protect against races)
to unmask all interrupts in resume callback also.

Change-Id: Ib8208fa0f062630dd817e57787a33bee4abef850
SCSC-Bug-Id: SSB-51996
Signed-off-by: Debabrata Purohit <d.purohit@samsung.com>
drivers/net/wireless/scsc/hip4.c

index 21f41bb2cb6e030d465e464947c9b94f50158add..2bc536402c7c3ffe344834cbd202c40d6f95ea24 100755 (executable)
@@ -2711,18 +2711,39 @@ void hip4_suspend(struct slsi_hip4 *hip)
 #endif
 }
 
-/* TH interrupts can be masked/unmasked */
 void hip4_resume(struct slsi_hip4 *hip)
 {
        struct slsi_dev *sdev;
+       struct scsc_service *service;
+#ifdef CONFIG_SCSC_WLAN_RX_NAPI
+       u32 conf_hip4_ver = 0;
+#endif
 
        if (!hip || !hip->hip_priv)
                return;
 
        sdev = container_of(hip, struct slsi_dev, hip4_inst);
-       if (!sdev)
+       if (!sdev || !sdev->service)
                return;
 
+       if (atomic_read(&sdev->hip.hip_state) != SLSI_HIP_STATE_STARTED)
+               return;
+
+       service = sdev->service;
+
+#ifdef CONFIG_SCSC_WLAN_RX_NAPI
+       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_unmask(service, hip->hip_priv->intr_tohost_mul[i]);
+       } else {
+               scsc_service_mifintrbit_bit_unmask(service, hip->hip_priv->intr_tohost);
+       }
+#else
+       scsc_service_mifintrbit_bit_unmask(service, hip->hip_priv->intr_tohost);
+#endif
+
        slsi_log_client_msg(sdev, UDI_DRV_RESUME_IND, 0, NULL);
        SCSC_HIP4_SAMPLER_RESUME(hip->hip_priv->minor);
        atomic_set(&hip->hip_priv->in_suspend, 0);