summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhanahuang <hanahuang@google.com>2023-06-19 07:36:56 +0000
committerhanahuang <hanahuang@google.com>2023-06-19 08:44:32 +0000
commitf9092f8183a5a2ef14ef135c24e5a612d57c8196 (patch)
tree31d1fab91c4762f5fee5c335dc032aa3ecb05319
parent4bb757afacc81de1645e009485fcd65e154c5950 (diff)
downloadbcm4398-f9092f8183a5a2ef14ef135c24e5a612d57c8196.tar.gz
[WAR] Add SW recovery in IOVAR timeout path to avoid KP
Bug: 277732484 Test: Manual. Change-Id: Id3947f9db4780c5a1e294887efa30029d8b6617a
-rw-r--r--dhd_msgbuf.c12
-rw-r--r--dhd_pcie.c2
-rw-r--r--dhd_pcie.h1
3 files changed, 15 insertions, 0 deletions
diff --git a/dhd_msgbuf.c b/dhd_msgbuf.c
index df20584..9f063da 100644
--- a/dhd_msgbuf.c
+++ b/dhd_msgbuf.c
@@ -1282,6 +1282,7 @@ static void dhd_prot_h2d_sync_init(dhd_pub_t *dhd);
void dhd_fill_cso_info(dhd_pub_t *dhd, void *pktbuf, void *txdesc, uint32 item_len);
#endif
+extern void exynos_pcie_d3_ack_timeout_set(bool val);
uint
dhd_get_ring_size_from_version_array(uint cursize, uint* size_array, int version)
@@ -11708,6 +11709,17 @@ dhd_msgbuf_wait_ioctl_cmplt(dhd_pub_t *dhd, uint32 len, void *buf)
}
#endif /* DHD_RECOVER_TIMEOUT */
+#ifdef DHD_TREAT_D3ACKTO_AS_LINKDWN
+ if ((prot->ioctl_received == 0) && (timeleft == 0)) {
+ DHD_ERROR(("%s: Treating IOVAR timeout as PCIe linkdown !\n", __FUNCTION__));
+ exynos_pcie_d3_ack_timeout_set(1);
+ dhd->bus->is_linkdown = 1;
+ dhd->bus->iovarto_as_linkdwn_cnt++;
+ dhd->hang_reason = HANG_REASON_PCIE_LINK_DOWN_RC_DETECT;
+ dhd_os_send_hang_message(dhd);
+ }
+#endif /* DHD_TREAT_D3ACKTO_AS_LINKDWN */
+
if (timeleft == 0 && (!dhd->dongle_trap_data) && (!dhd_query_bus_erros(dhd))) {
/* Dump iovar name */
dhd_msgbuf_dump_iovar_name(dhd);
diff --git a/dhd_pcie.c b/dhd_pcie.c
index eafb4ae..7250b3e 100644
--- a/dhd_pcie.c
+++ b/dhd_pcie.c
@@ -7820,6 +7820,7 @@ dhd_bus_clearcounts(dhd_pub_t *dhdp)
#ifdef DHD_TREAT_D3ACKTO_AS_LINKDWN
bus->d3ackto_as_linkdwn_cnt = 0;
+ bus->iovarto_as_linkdwn_cnt = 0;
#endif
dhdp->rx_pktgetpool_fail = 0;
@@ -13775,6 +13776,7 @@ void dhd_bus_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf)
}
#ifdef DHD_TREAT_D3ACKTO_AS_LINKDWN
bcm_bprintf(strbuf, "d3ackto_as_linkdwn_cnt: %d\n", dhdp->bus->d3ackto_as_linkdwn_cnt);
+ bcm_bprintf(strbuf, "iovarto_as_linkdwn_cnt: %d\n", dhdp->bus->iovarto_as_linkdwn_cnt);
#endif
#ifdef PCIE_INB_DW
diff --git a/dhd_pcie.h b/dhd_pcie.h
index ecc30fa..f8e7358 100644
--- a/dhd_pcie.h
+++ b/dhd_pcie.h
@@ -471,6 +471,7 @@ typedef struct dhd_bus {
uint32 d0_inform_in_use_cnt;
#ifdef DHD_TREAT_D3ACKTO_AS_LINKDWN
uint32 d3ackto_as_linkdwn_cnt;
+ uint32 iovarto_as_linkdwn_cnt;
#endif
uint8 force_suspend;
uint8 is_linkdown;