summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-06-27 13:31:30 +0000
committerAndroid Partner Code Review <android-gerrit-partner@google.com>2023-06-27 13:31:30 +0000
commit79cc4bf00f1c5b6635a2b67445258a3be91865fa (patch)
tree7b294b3f8aa90abafaecbcee5ee8343ec570ce16
parent3537dc9587c7d226f55ff0219a6f1c1ec156d166 (diff)
parentc865fe2b86db6ef8490f288b051b16cc586e0f69 (diff)
downloadbcm4398-79cc4bf00f1c5b6635a2b67445258a3be91865fa.tar.gz
Merge "DHD: 4398 - Disable L1SS before D3 inform during suspend" into android14-gs-pixel-5.15-udc-d1
-rw-r--r--dhd_pcie.c21
-rw-r--r--dhd_pcie_linux.c1
2 files changed, 21 insertions, 1 deletions
diff --git a/dhd_pcie.c b/dhd_pcie.c
index 7250b3e..c0c7b76 100644
--- a/dhd_pcie.c
+++ b/dhd_pcie.c
@@ -11279,7 +11279,13 @@ dhdpcie_bus_suspend(struct dhd_bus *bus, bool state)
d3_read_retry++;
}
}
-#else
+#else /* DHD_PCIE_NATIVE_RUNTIMEPM */
+ /*
+ * Disable L1ss on EP and RC side before doing D3
+ */
+ DHD_PRINT(("%s: disable L1SS during suspend, before D3 inform\n", __func__));
+ dhd_plat_l1ss_ctrl(0);
+
DHD_OS_WAKE_LOCK_WAIVE(bus->dhd);
#ifdef DHD_TIMESYNC
/* disable time sync mechanism, if configed */
@@ -11297,15 +11303,22 @@ dhdpcie_bus_suspend(struct dhd_bus *bus, bool state)
#if defined(PCIE_OOB) || defined(PCIE_INB_DW)
DHD_BUS_INB_DW_LOCK(bus->inb_lock, flags);
+ DHD_PRINT(("%s: Before DW_ASSERT inband_dw_state:%d\n",
+ __FUNCTION__, dhdpcie_bus_get_pcie_inband_dw_state(bus)));
if (dhdpcie_bus_get_pcie_inband_dw_state(bus) ==
DW_DEVICE_DS_DISABLED_WAIT) {
DHD_BUS_INB_DW_UNLOCK(bus->inb_lock, flags);
DHD_ERROR(("Waiting for DS-Exit, abort suspend\n"));
rc = BCME_ERROR;
+ dhd_plat_l1ss_ctrl(1);
goto fail;
}
DHD_BUS_INB_DW_UNLOCK(bus->inb_lock, flags);
dhd_bus_set_device_wake(bus, TRUE, __FUNCTION__);
+ DHD_BUS_INB_DW_LOCK(bus->inb_lock, flags);
+ DHD_PRINT(("%s: After DW_ASSERT inband_dw_state:%d\n",
+ __FUNCTION__, dhdpcie_bus_get_pcie_inband_dw_state(bus)));
+ DHD_BUS_INB_DW_UNLOCK(bus->inb_lock, flags);
#endif /* defined(PCIE_OOB) || defined(PCIE_INB_DW) */
#ifdef PCIE_OOB
bus->oob_presuspend = TRUE;
@@ -11339,7 +11352,11 @@ dhdpcie_bus_suspend(struct dhd_bus *bus, bool state)
#ifdef PCIE_INB_DW
if (INBAND_DW_ENAB(bus)) {
DHD_BUS_INB_DW_LOCK(bus->inb_lock, flags);
+ DHD_PRINT(("%s: Before D3_INFORM inband_dw_state:%d\n",
+ __FUNCTION__, dhdpcie_bus_get_pcie_inband_dw_state(bus)));
dhdpcie_send_mb_data(bus, H2D_HOST_D3_INFORM, __FUNCTION__);
+ DHD_PRINT(("%s: After D3_INFORM inband_dw_state:%d\n",
+ __FUNCTION__, dhdpcie_bus_get_pcie_inband_dw_state(bus)));
DHD_BUS_INB_DW_UNLOCK(bus->inb_lock, flags);
} else
#endif /* PCIE_INB_DW */
@@ -11395,6 +11412,8 @@ dhdpcie_bus_suspend(struct dhd_bus *bus, bool state)
DHD_ERROR(("%s():Suspend failed because of wakelock"
"restoring Dongle to D0\n", __FUNCTION__));
+ dhd_plat_l1ss_ctrl(1);
+
if (bus->dhd->dhd_watchdog_ms_backup) {
DHD_PRINT(("%s: Enabling wdtick due to wakelock active\n",
__FUNCTION__));
diff --git a/dhd_pcie_linux.c b/dhd_pcie_linux.c
index 5a625ef..a0a4cf0 100644
--- a/dhd_pcie_linux.c
+++ b/dhd_pcie_linux.c
@@ -1398,6 +1398,7 @@ static int dhdpcie_resume_dev(struct pci_dev *dev)
* Re-enable L1ss in Resume path. Implementation defalts to NOP
* If need override in the paltform file
*/
+ DHD_PRINT(("%s: enable L1SS during resume\n", __func__));
dhd_plat_l1ss_ctrl(1);