Add workqueue destroy in the wmi detach for the wmi_rx_diag_work_queue
to avoid the system memory leak.
Change-Id: Ic183ddaa2e53292a50e0b379877a92ddcaf45b02
CRs-Fixed: 3597405
Currently, WBUFF is being used only for WMI TX buffers.
Add HIF CE RX buffers support to WBUFF in an effort to re-use
the copy engine RX buffers instead of freeing/allocating buffers
for every CE RX transaction. This fixes the problem of CE RX
memory fragmentation.
Change-Id: Id9c043a5c5d0882a7994fa03cd8c335555d46b8d
CRs-Fixed: 3534539
Currently, WBUFF logic is being used only for WMI TX buffers and the
logic is closely tied to the WMI TX buffers alone. It is cumbersome
to extend the support of WBUFF for additional modules in the current
state.
Cleanup the WBUFF code and make it generic to add future module
additions.
Change-Id: Ib20ddd487b4e88c3225da1883ad9ade722c2a606
CRs-Fixed: 3520811
In the case of SSR, the WMI layer callbacks will not be called as part of
tx completion. Hence, the nbuf and HTC packets are freed in
send_packet_completion(). In this case, the WMI pending command count is
not decremented. During target recovery, this wmi pending command will be
increasing eventually, and assert will be seen when pending commands reach
MAX defined value.
To fix this, initialize the WMI pending commands to zero after the target
recovery.
Change-Id: I56d38d7064bc089725d5453883c22f572e51e078
CRs-Fixed: 3513491
If WMI max pending commands are reached and UMAC reset is in progress then
add the WMI pending command to host SW queue instead of crashing. The
reason is FW will not reap the WMI commands from the CE ring when umac
reset is in progress. Hence, add the pending WMI command to host SW ring.
Change-Id: I871147a80669a88875b3f6891bd0b0a56b92733b
CRs-Fixed: 3502217
wmi_handle is accessed after free to set wow_enable_ack_failed flag.
Move this to correct place to fix use-after-free access
Change-Id: I8cc956bd433776adda3ff6cca26e7c164877184d
CRs-Fixed: 3485102
Seeing kernel panic when max limit is reached for
pending WMI cmds, self-recovery is triggered that
sends a WMI cmd to crash the FW. This will not go
through and call recovery again
Change-Id: I55d025ac4fbf8b18ac441a135d10d558b2ec4d1e
CRs-Fixed: 3397524
Current code does not use the SSR host log collection API.
Fix this by adding SSR host log collection API usage.
Change-Id: I9dfb0bd7054986760a711d0752f37f4327c706b2
CRs-Fixed: 3339933
The kernel-doc script identified many documentation issues in
the wmi folder, so fix them.
Note that in quite a few cases there is duplicate documentation in .h
and .c files, and in those cases remove the documentation from the .c
files since the interface should be documented, not the
implementation.
Change-Id: I097d5b8e8f0ba09046b7b8abe338d05a00f8cc7e
CRs-Fixed: 3372831
Current log format has redundant info in wmi_log_cmd_id.
Ex: wmi_log_cmd_id: Send WMI command:WMI_INIT_CMDID command_id:1 htc_tag:0
Optimize the same by removing "Send WMI command" and "command_id"
Change-Id: I394a42033cdef2b5fb51343a1f6f9690a5a41fba
CRs-Fixed: 3328230
Copy Engine(CE14) is used for diag events on qcn9224. Add changes to
configure this CE as dest ring and fix diag event handler to use
wmi_handle from first pdev similar to other WMI events.
Change-Id: I314939169f9be32cd277af68dcd3ef7a0eb06187
CRs-Fixed: 3177987
When non-TLV targets are used, the WMI event table is not populated.
So, it shouldn't be treated as fatal and WMI event register/unregister
functions can return NOSUPPORT instead of FAILURE.
Handle this value in TWT code.
Change-Id: I5bc8e7aae2e572c84ea0333c967cff527d5cbcc3
CRs-Fixed: 3145077
Currently whenever the wmi message is allocated the wmi header
length is also added to check with against the max size supported
by the firmware, there is no need to add the extra wmi header size
as the max length shared by firmware has the wmi header size
included.
Below is the breakdown:
Max CE2 transfer size is 2048 bytes
HTC header is 8 bytes
WMI header is 4 bytes
Max payload can be (MAX CE2 Transfer size - (HTC header+ WMI header)
(2048 - (8 +4)) = 2036
During the htc handshake this max wmi length is recevied by the host as
2040 bytes which is including the wmi header so host adding the extra
4 bytes is redundant and can be removed.
HTC buffer->actual_length = 2036 + WMI(4) = 2040 bytes
Change-Id: Ib958a938506c5c96347dec5304ca30aa8690d459
CRs-Fixed: 3130493
Num stats over QMI indicates how many stats requests are fetched
without triggering RTPM resume. If RTPM resume/suspend happens in
the middle then num stats over QMI counter should reset. Add logic
to reset num stats over QMI counter during WoW enter/exit.
Change-Id: I34fe93759bf8a7a2a6c0d4b389ad96b8e1ba4d6c
CRs-Fixed: 3110590
When WMI diag events are received over CE7,
wmi handle is mapped to null and all the diag
events are freed without processing.
Fix this by properly mapping wmi handle when
diag events received over CE7.
Change-Id: I3dc4f7ce37981a31cb6f01fc66edf6248682bea3
CRs-Fixed: 3082960
Waikiki facilitates a dedicated CE (CE14) for
direct DMA & diag handling purpose. Changes to
register the respective service handler to process
DBR and DIAG events from the target.
CRs-Fixed: 3057986
Change-Id: I4ae1d5676ac702d1f28f3e4031b47ffcd1d2ad7e
As part of minidump enhancement feature, incorporate
wmi_command_tx_cmp_log_buffer data structure into the minidump.
Change-Id: I323971cc397b3ec710152c774462c85900acc603
CRs-Fixed: 2950790
Current in wmi_rx_diag_event_work, rx diag event is processing
in a while loop, if there is continuous diag event comes from
fw, it is possible that it occupy the work queue, and other work
are not able to run.
Break the while loop so give a chance to other work.
Change-Id: I7af6d60aeb8c0524cc51d663658d5b17349daa60
CRs-Fixed: 2948839
Firmware generates wmi Rx diag events every few milliseconds,
and processing the same in system shared work queue may lead to
work queue lock-up detection. Hence, move Rx diag event processing
to dedicated work queue.
Change-Id: I10cdde317794e35bc6d10677ab76ea24a66e1880
CRs-Fixed: 2941409
When unregistering wmi handlers, the position of the
old handler is replaced with the last handler in the table.
But at this stage only handler was getting replaced, but
not the context. Hence, make sure to update the context
as well.
Change-Id: If90ea9d7663fb105e8e8ad7d7e6c70da20264e44
DHCP packet is received in the IPA exception path when
system is suspending. As part of DHCP packet processing,
WMI_PEER_SET_PARAM_CMDID is sent to FW after WOW is
enabled resulting in self recovery getting triggered by
host.
Fix is to do an explicit system wakeup if a WMI command
has to be sent post WOW enablement.
Change-Id: If1904a4fe5c861deed1b35071be10cb8cc8d6407
CRs-Fixed: 2890913
For QMI events qdf_nbuf_set_pktlen is invoked twice. Once in
wmi_buf_alloc and again in __wmi_process_qmi_fw_event. Remove
this duplicate set packet length.
Change-Id: I06c7e077fb1d554215a5ebc52f9d69a333a25a84
CRs-Fixed: 2859036
Currently, Host driver assumes WMI_MIN_HEAD_ROOM is part of WMI
messages and Validations are done accordingly. But this
WMI_MIN_HEAD_ROOM is not considered in the firmware. Because of
this host may drop valid events.
To avoid this, Don't consider WMI_MIN_HEAD_ROOM while validating WMI
msg length.
Change-Id: I5f1fe12cfae570e636defb8a4a46ec154f988195
CRs-Fixed: 2844982
Currently, Stats request commands are sent over qmi right from the
target suspend request is sent to FW. This is leading to a crash in
FW since it is trying to access PCI when it is in suspend state.
To address this, send stats request over QMI only after the ack is
received for the target suspend command.
Change-Id: Id7a79d52740916f66476bf911e571c0ff466c7d3
CRs-Fixed: 2838737
Introduce wmi_validate_handle() with the caller function name
embedded in it to validate the WMI handle and log incase
of error. Calling functions can avoid logging in case
wmi_validate_handle() returns -EINVAL. This reduces logging and
thereby memory foot print.
Change-Id: Ie0a6a84ffad6e5cf2da8f547c7209dc77cdf5729
CRs-Fixed: 2838960
Currently, Rx diag event work is not being flushed during idle shutdown.
This may result in use after free access if the scheduled diag event work
gets the chance to execute after driver modules are closed.
To address this, flush diag events work during idle shutdown.
Change-Id: I348e80d2c86a5e070f0fb67d66b758529fede76c
CRs-Fixed: 2838020
Currently QMI message length is not being validated before
handling QMI event. This is resulting in illegal memory access
when QMI message length is invalid.
To address this, discard QMI events with invalid length.
Change-Id: Ia9f04bcb4fa3b365cbbf2be8885a8d30f78f8f10
CRs-Fixed: 2839277
FW diag events will be dropped when number FW diag events pending for
processing is reached to configured RX_DIAG_WQ_MAX_SIZE value. Add a
log when these diag events a getting dropped for debugging purpose.
Change-Id: Ifc303991bdf274fa7426794eaf71517722e9f386
CRs-Fixed: 2824458
Currently, FW diag logs, management frames and stats responses are
processed in worker context. Because of this, there is a possible
out of memory scenario when there are huge number of diag events
waiting in work queue.
To address this, process diag events in a separate worker thread and
set the limit for the number of diag events that can be queued in
work queue.
Change-Id: Ie6e5b905a3b591cf724cd6b024bec0612f9e2e0c
CRs-Fixed: 2818013
Skip wmi sequence check during SOC stop and enable after
initializing wmi handle. It is required to skip sequence check
during soc stop as the endpoint flush is preceding CE flush.
CRs-Fixed: 2813341
Change-Id: Ieb821483e9786471d033773dc2365ab456345f83
For QMI events, recevid QMI event length is used to allocate wmi buffer
using wmi_buf_alloc. The received QMI event length includes WMI head
room and wmi_buf_alloc also try to reserve WMI head room again.
Because of this, WMI buffer allocation is exceeding max WMI msg length.
To resolve this, use length of the received actual WMI msg to allocate
WMI event buffer using wmi_buf_alloc.
Change-Id: Icd259988c4b1091580a35aaf2c3fabc606e0f2a9
CRs-Fixed: 2786326
Reset the WMI sequence counter after FW recovery to avoid
false assert due to CE pending packets freed in htc layer
instead of WMI completion handler.
CRs-Fixed: 2787424
Change-Id: I109ff56655e5fb428aca637e6420efed5943b3f7
Add WMI command buffer address information(DMA/Physical addr) to
the WMI TX completion logging. This will help in debugging issues
when HW DMAs copies data from a different location than the one
configured.
Change-Id: I60586b865a97e7ff88e48606806ec151321ff0aa
CRs-Fixed: 2789492
Log WMI work queue call stack when WD timer expires to assist
in debugging on non slub debug enabled builds.
Change-Id: Id3dd575700ca586b0738a88ca2af88a757238d1b
CRs-Fixed: 2789114
This records all the WMI events and commands, for all
PDEVs. Set WMI_EXT_DBG flag to enable this feature. Refer
Original Change-Id: I18e46f683e35912cad717ca3b9cc3d1885315362
Change-Id: I4c9bdfe6fdd195656ca0c01ca400eba595be24a3
CRs-Fixed: 2762266