diff options
author | Dennis Jeon <dennis.jeon@broadcom.corp-partner.google.com> | 2022-11-11 14:27:07 +0900 |
---|---|---|
committer | Roger Wang <wangroger@google.com> | 2022-11-11 16:16:09 +0800 |
commit | 6675a60439c3aca52d63edb0e17352fc95cc9154 (patch) | |
tree | 9254dd0340929367d998d1c0223b73ca2caeb5ef | |
parent | 996c76a0295fb6646b3427964f1dc38195c5c3e8 (diff) | |
download | wlan-6675a60439c3aca52d63edb0e17352fc95cc9154.tar.gz |
HAL: Fixed to unregister the cmd when wifi_reset_log_handler is called
Exceeds the maximum registered cmd count.
"WifiHAL : Failed to add command 2: 0xb400007181ce01d0 at 64, reached max limit 64"
[Analysis]
11-04 20:49:53.142 875 875 V WifiHAL : registering command 0 - (LogHandler, set by framework)
11-04 20:49:53.142 875 875 V WifiHAL : registering command 2 - (FILE_DUMP_REQUEST_ID)
11-04 20:49:58.104 875 875 V WifiHAL : un-registering command 0 - (LogHandler, set by framework)
the cmd(FILE_DUMP_REQUEST_ID) is not un-registered and it causes to exceed the maximum cmd count.
[Reproduce the issue]
It is reproduced when enable/disable logging around 64 times on the Pixel Logger app.
[Solution]
Fixed to un-register the cmd(FILE_DUMP_REQUEST_ID) when wifi_reset_log_handler is called.
Bug:256994683
Test: passed reproduction test
Signed-off-by: Dennis Jeon <dennis.jeon@broadcom.corp-partner.google.com>
Change-Id: I472262817c3fb76c848ec0531e0f7a60c26ec762
-rwxr-xr-x | bcmdhd/wifi_hal/common.h | 3 | ||||
-rwxr-xr-x | bcmdhd/wifi_hal/wifi_logger.cpp | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/bcmdhd/wifi_hal/common.h b/bcmdhd/wifi_hal/common.h index ad9922d..379582e 100755 --- a/bcmdhd/wifi_hal/common.h +++ b/bcmdhd/wifi_hal/common.h @@ -460,8 +460,7 @@ wifi_interface_handle wifi_get_wlan_interface(wifi_handle info, #ifdef RING_DUMP wifi_error wifi_start_ring_dump(wifi_interface_handle iface, wifi_ring_buffer_data_handler ring_handle); -wifi_error wifi_stop_ring_dump(wifi_interface_handle iface, - wifi_ring_buffer_data_handler ring_handle); +wifi_error wifi_stop_ring_dump(wifi_interface_handle iface); #endif /* RING_DUMP */ wifi_error wifi_hal_ota_update(wifi_interface_handle iface, uint32_t ota_version); wifi_error wifi_hal_preInit(wifi_interface_handle iface); diff --git a/bcmdhd/wifi_hal/wifi_logger.cpp b/bcmdhd/wifi_hal/wifi_logger.cpp index 809f1ae..229dc2f 100755 --- a/bcmdhd/wifi_hal/wifi_logger.cpp +++ b/bcmdhd/wifi_hal/wifi_logger.cpp @@ -1239,6 +1239,10 @@ wifi_error wifi_reset_log_handler(wifi_request_id id, wifi_interface_handle ifac wifi_handle handle = getWifiHandle(iface); ALOGE("Loghandler reset, wifi_request_id = %d, handle = %p", id, handle); +#ifdef RING_DUMP + wifi_stop_ring_dump(iface); +#endif /* RING_DUMP */ + if (id == -1) { wifi_ring_buffer_data_handler handler; memset(&handler, 0, sizeof(handler)); @@ -1248,9 +1252,6 @@ wifi_error wifi_reset_log_handler(wifi_request_id id, wifi_interface_handle ifac cmd->cancel(); cmd->releaseRef(); -#ifdef RING_DUMP - wifi_stop_ring_dump(iface, handler); -#endif /* RING_DUMP */ return WIFI_SUCCESS; } @@ -2022,8 +2023,7 @@ wifi_error wifi_start_ring_dump(wifi_interface_handle iface, return result; } -wifi_error wifi_stop_ring_dump(wifi_interface_handle iface, - wifi_ring_buffer_data_handler ring_handle) +wifi_error wifi_stop_ring_dump(wifi_interface_handle iface) { RingDump *cmd = new RingDump(iface, FILE_DUMP_REQUEST_ID); NULL_CHECK_RETURN(cmd, "memory allocation failure", WIFI_ERROR_OUT_OF_MEMORY); |