Currently, in get_htc_send_packets() when the
hif_system_pm_state_check() fails, we are not doing a
runtime PM put operation for the corresponding get operation.
This imbalance will never make the system enter runtime suspend
state and also we do a BUG() when such imbalance is encountered
during runtime PM deinit. This change also fixes a potential
memory leak.
Change-Id: I3e5916005d583de42a49dd2dc0632bfcca1251e4
CRs-Fixed: 2947247
Runtime PM for HTC layer has multiple cases of GET/PUT operations.
Adding runtime PM stats for HTC layer, this helps in debugging
RTPM GET/PUT out of sync issues.
Change-Id: Ib27efd73dce0bb5bd3ff030bd7ae1bc833f29610
CRs-Fixed: 2923250
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
This feature is used to detect CE tasklet scheduling delay
and credit response delay issues.
Change-Id: I9a8fcb425edd5cf96fae5f6cd3bfc7f51172c814
CRs-Fixed: 2874874
To make it generic, rename the flag QCA_WIFI_NAPIER_EMULATION
as QCA_WIFI_EMULATION.
Change-Id: I21b34475ce550b6875c5f19cf1fbba342862ecee
CRs-Fixed: 2871345
Currently if the driver is in runtime suspend/suspending
state, any packet transmission will request for resume
via hif_pm_runtime_get.
Unfortunately there is a logging in the above API which
will lead to more time consumption in the NET_TX softirq
context. This can lead to other delay in processing other
softirqs in the system.
Fix this by skipping the logging in the packet transmission
path.
Change-Id: Icc9f5b67794f7666243eb059f2e07a06a987002e
CRs-Fixed: 2844126
When the number of HTT packets in the endpoint TxQueue is more
than MaxTxQueueDepth, we hit the overflow condition. If the
overflow condition is hit, in htc_try_send(), when EpSendFull()
returns HTC_SEND_FULL_KEEP, we try to send all the excess packets.
As part of this logic, we are calling restore_tx_packet(); the
intention of calling resotre_tx_packet() is to just perform
skb_pull_head(), but restore_tx_packet() will also unmap the
HTT packet. Later, when we try to send the excess packets, these
would be already unmapped and when the HW/FW try to access this
unmapped location, it would lead to SMMU fault.
Change-Id: Ie60a302d6a2736f7aa12944b7016d2bdb9ffb10d
CRs-Fixed: 2836444
Add bus related info in hif layer in order to get bus status
when hang issue happened.
Change-Id: If922e0892e0f65de778b9696bbc56fc63c25c169
CRs-Fixed: 2801350
HTC runtime count is incremented after posting the HTT
ver req message to CE4. There could be possibility of
processing the ver response message from FW even before
htc_runtime_cnt is incremented. This can casue RTPM put
to not happen causing imbalance in get/put count.
Fix is to increment htc_runtime_cnt before enqueuing
the HTT message to CE.
Change-Id: Ib9b69910cd14193c41ecfee804b390f8a6cdef49
CRs-Fixed: 2794451
Compiling with gcc 9.3 will cause many implicit-fallthrough
compile errors.
Fix is to add keyword fallthrough to resolve such compile error.
Change-Id: I2e7dd1525861d951e3be44f6665e149499f0f5d6
CRs-Fixed: 2785178
For HTT h2t message which has a response from FW, runtime
get is done in HTC layer and the corresponding runtime_put
is done as part of the HTT response processing. In a scenario
where the HTT response is not received from FW or not processed
by host, runtime_put is not done as part of cleanup and panic
is triggered due to get/put imbalance.
Fix is to do RTPM put as part of htc cleanup when the HTT
response from FW is not received or processed.
Change-Id: I17ccb7c3e2293c95f5f233d36c6ef38a75733cce
CRs-Fixed: 2779113
The Tlv of the hang data is reduced to 2bytes from the 4bytes
change the structure defnitions accordingly.
Change-Id: I675e4d837afa92496aeebec408ebfd90cbb7ad32
CRs-Fixed: 2753821
A few functions in HIF component returns QDF status value with return
type as non QDF STATUS and vice versa. For such functions, update the
correct return type.
Change-Id: Ifc1068d60e62f7405a15e2b4f0738d91243bd6de
CRs-Fixed: 2734818
Interface down is received when wlan is in runtime
suspend state. The wmi commands that have to be sent
as part of this cause a runtime resume and the htc tx
queues are processed within runtime_resume callback.
The work that is scheduled for this tries to do a
runtime_get as part of htc_try_send but the runtime_status
is still in resuming state causing EINPROGRESS return
value. This will result in the wmi commands to be not sent
to firmware and eventually resulting wmi command timeout.
Fix is to do runtime_get_sync in htc_kick_queues.
Change-Id: I1f4ba1c3dad32f7c407c4416529424be6d4bf18d
CRs-Fixed: 2711998
To introduce counters htc_send_cnt and htc_comp_cnt per endpoint to
enhance pdev level debugging in HTC path.
Change-Id: I8d31e3a533e0f8de4c89d3609b20c148aef3a4ff
Add NULL pointer check in function hif_send_single() and
htc_dump_counter_info() for KW issues.
Change-Id: I4b020c566b14b28a825c13752dccf67b5f8bb837
CRs-Fixed: 2675205
This is regression issue.
regression cause I24cddb9d10e4cb675c8375cbd0f589c7718bd680.
Issue happens in get_htc_send_packets, and it is possible
htc_packet_dequeue but hif_pm_runtime_get failed as suspend
state.
Revise to original logical before regression change.
Change-Id: I74c309d7a3decdd6fe905e9f1e61916905876aec
CRs-Fixed: 2663338
This is to enhance statics for runtime put/get, which is
to detect if there is mismatch for usage_count.
Change-Id: I24cddb9d10e4cb675c8375cbd0f589c7718bd680
CRs-Fixed: 2647972
whenever there is a wmi command timeout and recovery is triggered,
the htc credit history gives insight into whether host had the credits
to send the command to firmware. Add the credit history from the
htc module.
Change-Id: Iaa760981296862f8af496a23e3c24bc2fda0fb55
CRs-Fixed: 2651744
When packet tx fails at transport layer, packet is re-queued and given to
HIF layer again. In this change, print the warning message about re-queue
only when tx fails for 5 consecutive attempts due to no resources
available at HIF layer.
Since re-queuing is not fatal, it need not be printed on every attempt.
Change-Id: I00082470420e29dfe4fb7a745ac709a682ba032e
CRs-Fixed: 2621763
In the scenario where nbuf_map fails during packet
send in htc_issue_packets, restore_tx_packet done
as part of cleanup, does nbuf unmap even though map
failed.
Fix is to set the fixup_netbuf flag only if nbuf map
is successful.
Change-Id: I642eff15792a7e374434e5a7a05ad546af376b3a
CRs-Fixed: 2625765
If cds_dp_open fails during driver load time, cds_close is
called in clean up path. During cds_close, HTC cleanup happens
which makes target->hif_dev = NULL and in send_packet_completion
target->hif_dev is dereferenced without NULL check.
Add NULL check before dereferencing target->hif_dev during
send_packet_completion.
Change-Id: I236a083e194bf1f16d261e6334ac512c4f6bcd94
CRs-Fixed: 2625690
There might be a race condition between htc_kick_queues which is sheduled
by RPM resume and hdd_wlan_stop_modules.
Here are detail info:
1. Run time resume is called, which will schedule a work to do the
htc_kick_queues later.
2. hdd_wlan_stop_modules is called at the same time, which will call
htc_destroy to free the HTC_TARGET.
3. the htc_kick_queues will access the HTC_TARGET, but it has been
freed.
Change-Id: I7211a8eef2a2f1924fe91eafec5a4496eea5a507
CRs-Fixed: 2622317
Add support to track tasklet execution and total time in different
buckets for debugging purposes
Change-Id: Ide459c385b2a44c0f16d05b37879c8b462782d72
CRs-Fixed: 2589199
The htc connect message buffer is not unmapped,
if the firmware does not send wmi ready event to the
host.
Scenario:
- Host sends htc init command.
- The command is queued into the src ring.
- The firmware has crashed before the Copy Engine
could copy the message to the destination ring
- Due to the above point, no copy completion
interrupt is received.
- The host times out during its wait for the wmi
ready event.
- Hence the htc init command buffer stays unmapped
and unfreed.
As a part of the wma ready event missing cleanup,
the htc connect buffer is not unmapped. Fix this
to avoid missing to unmap the buffer.
To avoid a side effect of sending a completion for
HTC connect command, all the commands are freed in
the htc completion handler in case of SSR.
CRs-Fixed: 2512344
Change-Id: I05026b3cbb764197e6df85c41634002d271a50e5
Remove the WAR, which doesnot use HTC_FLAGS_SEND_BUNDLE
This reverts commit 68f186311d
Change-Id: I7d350faca8645a5d65af708cb3fb231895a3fe37
CRs-Fixed: 2522724
In Genoa SDIO ADMA implementation Host sends packets to FW in
multiples of SDIO Block size.
If the packet/bundle is not block aligned Host adds padding at the
end of Packet/Bundle.
If the TX packet plus padding exceeds one FW TX Buffer, Padding data
will occupy the next FW TX buffer. Same applies for bundle TX packet.
For above scenario, HTC_FLAGS_PADDING_CHECK of HTC header Flags is used
to notify the FW that - Padding data follows the currentHTC packet
Since the padding data will take one extra FW Tx Buffer, host need to
handle the extra Tx credit being used by the padding data/buffer
CRs-Fixed: 2516617
Change-Id: I1eb394859689b281653bfd6d681804eb016a14cf
Genoa SDIO FW doesn't use the HTC_FLAGS_SEND_BUNDLE
in send direction, host to fw
Do not set this flag during Tx bundling for HTC Packets
This is a WAR to avoid FW crash, until fix available from FW
Crs-Fixed: 2511297
Change-Id: Iaf178f9e1a9c07ca25a8b801c667fb0d16fac85c
In case of HL, send tx completion bit in HTT tx descriptor
to receive tx completion from FW and disable DHCP indication
to FW properly.
Change-Id: I2540a125c84c322507acdc0647ee8839d21067ce
CRs-Fixed: 2506020
It is very critical to know the source of who requests runtime
PM resume to debug all kinds of runtime PM related issues. Hence
log them accordingly.
Change-Id: I9551830b1cb567fd29e9d9bbec18705f9cc5e9ec
CRs-fixed: 2496481
Bus TX resources are being read before the single thread check.
If the thread is pre-empted, the tx_resource variable may not
match with actual TX resources.
Change-Id: I7e8af58a5702172a4cfbea9175f333aad4a57238
CRs-Fixed: 2459253
Featurize wmi multi mac service with the feature flag
WMI_MULTI_MAC_SVC, to cleanup CONFIG_MCL dependency.
Change-Id: I34a513a90096c586091034029fc17b6bf23a7278
Pointer 'pPacket' returned from call to the function
'htc_packet_dequeue' may be NULL.
Add a NULL check for pPacket before dereferencing it.
Change-Id: I1ecb82cce0fc00877b3ec2de2676027dde261186
CRs-Fixed: 2478206
In case of SDIO/USB TX bundling if there is hif_send_head failure
packets are not added back to Endpoint tx queue and resulting in
packet drop.
Add packet back to tx queue if hif_send_head send failure
for bundled packet.
Change-Id: Id613a414f0caa71a33c79186ae726550cb710c4a
CRs-Fixed: 2468882
Clear HTC_TX_PACKET_FLAG_FIXUP_NETBUF flag in
hif_send_head failure scenario to avoid
multiple unamap of same netbuf.
Change-Id: Id7f6aeba1eff0d23b76927fcbb03643409fc7859
CRs-Fixed: 2437034
Add target specific HW header for ipq6018 compilation.
Remove the 8074 header dependencies for 6018 compilation.
Change-Id: I8e45e3e039a4596c6722538405dcd381918fa6b1
When polling mode is enabled, send completions for a
CE(host->target, ULpipe) for a particular service(WMI/HTC/HTT) are handled
only when recv happens in CE(target->host, DLpipe) for the same service.
Since for services like WMI there are multiple ULpipes(Eg. CE3 for
WMI<WMAC1> and CE7 for WMI<WMAC2>) and single DLpipe(CE2). Receive on a
DLpipe is the right time to poll for send completions on all ULpipes for
that service.
Change-Id: Ie2ac30d3db1bc85c888d714b782a894539e399ff
Set MaxMsgsPerBundledRecv in HTC_SETUP_COMPLETE_EX_MSG for USB,SDIO
interfaces.
This is required for enabling RX bundling.
Change-Id: Ifb6a9a7167701c051d405bfae125fcfd0c8c55c5
CRs-Fixed: 2414409
Use INI configured WMI credit for exchanging WMI messages.
Make sure INI configured value is less than FW advertised capability.
This credit configuration should be non zero.
Change-Id: I26b2dfbee0fc095aca3d37f21cd22c974189bb49
CRs-Fixed: 2411028
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within htc replace any such comparisons with logical
operations performed on the pointer itself.
Change-Id: Ibb6d24aff9824d7e7cf253c1fe3081443cbfb63b
CRs-Fixed: 2418252
For USB, do not call get_htc_send_packets() in htc_send_data_pkt()
if no TX resource is available.
Change-Id: I17a3dd54c2582620ab2be1e0f6c156904dc52d30
CRs-Fixed: 2412376
qcacld-2.0 to qcacmn propagation
Restore the correct credit for the flow control endpoint, add back
all the credits consumed by the queue, if fail to send packet by
HIFSend_head.
Change-Id: I480f7aba5ce8c8d1e57caaae5b2bfcd77209091c
CRs-Fixed: 2360669