summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Jeon <dennis.jeon@broadcom.corp-partner.google.com>2022-08-30 15:04:51 +0900
committerTreeHugger Robot <treehugger-gerrit@google.com>2022-10-06 06:22:18 +0000
commit19d1507ae8c10c782601f9d4c04b4dfcd3f8daae (patch)
treed613a16ff16ab2f4d6ec193d5b2df37b0877662f
parent83e0af1adecc1395ed24652760e607fd7ddb46e8 (diff)
downloadbcm4389-19d1507ae8c10c782601f9d4c04b4dfcd3f8daae.tar.gz
bcmdhd: Fixing missing files issue in the bugreport
dump_start and get_ring_data() being asynchronous, flushing and writing the files before completion of the dump goes out of sync and when dump_state service. 1. adb bugreport service archives the files from /data/vendor/tombstones/wifi, still some files are not yet being created Fix: Triggering the dump_start() logic in the first ring name get_ring_data call. Bug: 208572716 Test: SVT test cycle Signed-off-by: Dennis Jeon <dennis.jeon@broadcom.corp-partner.google.com> Change-Id: I603c5621c4846b83986b67c3a6a35ee9fd895cb6
-rw-r--r--dhd.h1
-rw-r--r--dhd_linux.c7
-rw-r--r--dhd_linux_exportfs.c15
-rw-r--r--dhd_log_dump.c18
-rw-r--r--dhd_log_dump.h1
-rw-r--r--dhd_pcie.c16
-rwxr-xr-xwl_cfgvendor.c17
7 files changed, 51 insertions, 24 deletions
diff --git a/dhd.h b/dhd.h
index 816c2da..9f07779 100644
--- a/dhd.h
+++ b/dhd.h
@@ -1856,6 +1856,7 @@ typedef struct dhd_pub {
bool assoc_at_suspend;
#endif /* DEVICE_TX_STUCK_DETECT && ASSOC_CHECK_SR */
uint32 p2p_disc_busy_cnt;
+ bool skip_memdump_map_read;
} dhd_pub_t;
#if defined(__linux__)
diff --git a/dhd_linux.c b/dhd_linux.c
index f03d9e4..56f016c 100644
--- a/dhd_linux.c
+++ b/dhd_linux.c
@@ -19157,6 +19157,7 @@ dhd_mem_dump(void *handle, void *event_info, u8 event)
}
#endif /* BOARD_HIKEY */
}
+ dhdp->skip_memdump_map_read = FALSE;
#elif defined(DHD_DEBUGABILITY_DEBUG_DUMP)
dhd_debug_dump_to_ring(dhdp);
#endif /* DHD_FILE_DUMP_EVENT */
@@ -19199,10 +19200,12 @@ dhd_mem_dump(void *handle, void *event_info, u8 event)
__FUNCTION__));
}
#endif /* DHD_SSSR_COREDUMP */
- if (dhdp->memdump_type == DUMP_TYPE_BY_SYSDUMP) {
- DHD_LOG_MEM(("%s: coredump is not supported for BY_SYSDUMP\n",
+ if ((dhdp->memdump_type == DUMP_TYPE_BY_SYSDUMP) &&
+ (dhdp->dongle_trap_occured == false)) {
+ DHD_LOG_MEM(("%s: coredump is not supported for BY_SYSDUMP/non trap cases\n",
__FUNCTION__));
} else {
+ DHD_ERROR(("%s: writing SoC_RAM dump\n", __FUNCTION__));
if (wifi_platform_set_coredump(dhd->adapter, dump->buf,
dump->bufsize, dhdp->memdump_str)) {
DHD_ERROR(("%s: writing SoC_RAM dump failed\n", __FUNCTION__));
diff --git a/dhd_linux_exportfs.c b/dhd_linux_exportfs.c
index 9cd18c6..1be9148 100644
--- a/dhd_linux_exportfs.c
+++ b/dhd_linux_exportfs.c
@@ -2166,28 +2166,13 @@ static ssize_t
trigger_dhd_dump_start_command(struct dhd_info *dhd, char *buf)
{
ssize_t ret = 0;
- dhd_pub_t *dhdp;
- unsigned long flags = 0;
- dhdp = &dhd->pub;
if (dhd->pub.up == 0) {
DHD_ERROR(("%s: Not up\n", __FUNCTION__));
return -EINVAL;
}
DHD_ERROR(("%s: dump_start command delivered.\n", __FUNCTION__));
- DHD_GENERAL_LOCK(dhdp, flags);
- DHD_BUS_BUSY_SET_IN_DUMP_DONGLE_MEM(&dhd->pub);
- DHD_GENERAL_UNLOCK(dhdp, flags);
-
- dhd_log_dump_trigger(dhdp, CMD_DEFAULT);
-
- DHD_GENERAL_LOCK(dhdp, flags);
- DHD_BUS_BUSY_CLEAR_IN_DUMP_DONGLE_MEM(&dhd->pub);
- dhd_os_busbusy_wake(dhdp);
- DHD_GENERAL_UNLOCK(dhdp, flags);
-
- ret = scnprintf(buf, PAGE_SIZE -1, "%u\n", 0);
return ret;
}
diff --git a/dhd_log_dump.c b/dhd_log_dump.c
index 1496d28..505c0aa 100644
--- a/dhd_log_dump.c
+++ b/dhd_log_dump.c
@@ -1887,6 +1887,24 @@ dhd_log_dump_get_timestamp(void)
}
void
+dhd_log_dump_vendor_trigger(dhd_pub_t *dhd_pub)
+{
+ unsigned long flags = 0;
+ DHD_GENERAL_LOCK(dhd_pub, flags);
+ DHD_BUS_BUSY_SET_IN_DUMP_DONGLE_MEM(dhd_pub);
+ DHD_GENERAL_UNLOCK(dhd_pub, flags);
+
+ dhd_log_dump_trigger(dhd_pub, CMD_DEFAULT);
+
+ DHD_GENERAL_LOCK(dhd_pub, flags);
+ DHD_BUS_BUSY_CLEAR_IN_DUMP_DONGLE_MEM(dhd_pub);
+ dhd_os_busbusy_wake(dhd_pub);
+ DHD_GENERAL_UNLOCK(dhd_pub, flags);
+
+ return;
+}
+
+void
dhd_log_dump_trigger(dhd_pub_t *dhdp, int subcmd)
{
#if defined(DHD_DUMP_FILE_WRITE_FROM_KERNEL)
diff --git a/dhd_log_dump.h b/dhd_log_dump.h
index 9328b27..074d426 100644
--- a/dhd_log_dump.h
+++ b/dhd_log_dump.h
@@ -280,6 +280,7 @@ extern void dhd_log_dump_write(int type, char *binary_data,
int binary_len, const char *fmt, ...);
void dhd_schedule_log_dump(dhd_pub_t *dhdp, void *type);
void dhd_log_dump_trigger(dhd_pub_t *dhdp, int subcmd);
+void dhd_log_dump_vendor_trigger(dhd_pub_t *dhd_pub);
#ifdef DHD_DEBUGABILITY_DEBUG_DUMP
int dhd_debug_dump_get_ring_num(int sec_type);
diff --git a/dhd_pcie.c b/dhd_pcie.c
index ea6e385..9b96f91 100644
--- a/dhd_pcie.c
+++ b/dhd_pcie.c
@@ -5408,7 +5408,7 @@ static int
dhdpcie_mem_dump(dhd_bus_t *bus)
{
dhd_pub_t *dhdp;
- int ret;
+ int ret = BCME_OK;
uint32 dhd_console_ms_prev = 0;
#ifdef GDB_PROXY
@@ -5534,11 +5534,15 @@ dhdpcie_mem_dump(dhd_bus_t *bus)
return BCME_ERROR;
#endif /* DHD_PCIE_NATIVE_RUNTIMEPM */
- ret = dhdpcie_get_mem_dump(bus);
- if (ret) {
- DHD_ERROR(("%s: failed to get mem dump, err=%d\n",
- __FUNCTION__, ret));
- goto exit;
+ if (dhdp->skip_memdump_map_read == FALSE) {
+ ret = dhdpcie_get_mem_dump(bus);
+ if (ret) {
+ DHD_ERROR(("%s: failed to get mem dump, err=%d\n", __FUNCTION__, ret));
+ goto exit;
+ }
+ } else {
+ DHD_ERROR(("%s: Skipped to get mem dump, err=%d\n", __FUNCTION__, ret));
+ dhdp->skip_memdump_map_read = FALSE;
}
#ifdef DHD_DEBUG_UART
bus->dhd->memdump_success = TRUE;
diff --git a/wl_cfgvendor.c b/wl_cfgvendor.c
index f836286..f1f7659 100755
--- a/wl_cfgvendor.c
+++ b/wl_cfgvendor.c
@@ -8727,6 +8727,7 @@ static int wl_cfgvendor_dbg_get_ring_data(struct wiphy *wiphy,
{
int ret = BCME_OK, rem, type;
char ring_name[DBGRING_NAME_MAX] = {0};
+ int ring_id;
const struct nlattr *iter;
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
dhd_pub_t *dhd_pub = cfg->pub;
@@ -8743,7 +8744,21 @@ static int wl_cfgvendor_dbg_get_ring_data(struct wiphy *wiphy,
}
}
- WL_MEM(("Received GET_RING_DATA ring:%s\n", ring_name));
+ /* Moved the dump_start op */
+ ring_id = dhd_dbg_find_ring_id(dhd_pub, ring_name);
+ /* Using first ring get context to trigger ring dump event. */
+ if (ring_id == DEBUG_DUMP_RING1_ID) {
+ /*
+ * The ring buffer data context timeout at framework is 100ms and
+ * hence skipping memdump invocation in this path.
+ */
+ dhd_pub->skip_memdump_map_read = true;
+ WL_MEM(("Doing dump_start op for ring_id %d ring:%s\n",
+ ring_id, ring_name));
+ dhd_log_dump_vendor_trigger(dhd_pub);
+ }
+
+ WL_DBG_MEM(("Received GET_RING_DATA ring:%s\n", ring_name));
ret = dhd_os_trigger_get_ring_data(dhd_pub, ring_name);
if (ret < 0) {
WL_ERR(("trigger_get_data failed ret:%d\n", ret));