Commit Graph

181 次程式碼提交

作者 SHA1 備註 提交日期
jinbao liu
b80337cee1 qcacmn: Refine htc_tx_completion_handler() log to avoid flooding
This change refines the log in htc_tx_completion_handler()
to avoid flooding by using qdf_rl_err().

Change-Id: If24f29cab89098a5e33f79aaa2cf43704b957d0f
CRs-Fixed: 3694797
2024-01-04 02:53:02 -08:00
Jinwei Chen
dcad508db8 qcacmn: remove QDF_ASSERT warning for htc packets sending
If WMI cmd sending and runtime PM suspending happened at same time,
there is chance get_htc_send_packets_credit_based() report warning
to dmesg, this warning info is not much helpful.

Use one line print instead to avoid confusion.

Change-Id: Ia71657876b25cb180abba28b107553a99d015358
CRs-Fixed: 3583473
2023-08-13 23:59:46 -07:00
Ananya Gupta
3ef9a59299 qcacmn: Add enum for xpan in link vote user IDs
Add enum for xpan in  link vote user IDs

Change-Id: I5a1e33d853c0f8937b6e1a6c3acd169207296e58
CRs-Fixed: 3559119
2023-07-30 19:08:08 -07:00
Manikanta Pubbisetty
cbe8170798 qcacmn: Add HIF CE RX support to WBUFF
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
2023-07-18 09:51:03 -07:00
Manoj Ekbote
eae87639ca qcacmn: Change log level of HTC print
Use module level flag to print HTC information

Change-Id: I81ffd0cff392786df9da1c5c0f8ba00b6b2e9d23
CRs-Fixed: 4702091
2023-06-20 20:49:46 -07:00
Aditya Kodukula
58e80d75bd qcacmn: Fix typographical errors
Fix typographical errors spanned over various files in cmn.

Change-Id: I9fcf3b7f9bb7d7dd406e6576a60aa4eb783c9ceb
CRs-Fixed: 3529628
2023-06-14 22:02:33 -07:00
Amit Mehta
dd5f5c1afa qcacmn: Get wow nack reason code
Currently, Fw did not set NACK reason code
to Host when Fw is not ready for WoW.

As part of the new change, Fw will send NACK
reason code along with WoW NACK to host.
Make changes in host to parse NACK reason
code from the received message.

Change-Id: I17ee99cb302ff546731a46d3ce03977c3c3d5a67
CRs-Fixed: 3481189
2023-05-18 04:35:41 -07:00
Edayilliam Jayadev
10fe6982eb qcacmn: Add HTC APIs to schedule/cancel custom callbacks
Add HTC layer APIs to schedule/cancel custom callbacks.

CRs-Fixed: 3408693
Change-Id: I1316685707b7abc6c8d86ec4d237dc920f9f78eb
2023-03-14 08:46:06 -07:00
Mohammed Ahmed
cef49bdf89 qcacmn: add SSR host log collection API usage
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
2023-01-19 20:44:09 -08:00
Jeff Johnson
22f89679c1 qcacmn: Fix HTC documentation
The kernel-doc script identified some kernel-doc issues in the htc
folder, so fix them.

Change-Id: I6523448836f4a0cdd1ff174634fce287b2d85d6a
CRs-Fixed: 3377576
2023-01-14 19:59:53 -08:00
Amit Mehta
ea172ef154 qcacmn: Do RTPM put during cleanup in case of WMI Tx completion failure
For WMI messages RTPM get is done during HTC message send and the
corresponding put is done in Tx failure or in Tx completion handler
for Tx success case. In the case where Tx completion is not received
for WMI messages RTPM put is not done as part of the cleanup which
results in RTPM Get and PUT call out of sync issues.

To fix the issue as part of HTC cleanup do RTPM put for WMI messages
for which tx completion is not received.

Change-Id: If92f4bd8a6c104d7ccef1e33b31aa765ea6100bd
CRs-Fixed: 3315404
2022-10-26 07:29:49 -07:00
Rakesh Pillai
8e7416b1e6 qcacmn: Flush HTT endpoint TxLookUpQueue during de-init
If SSR happens, before any tx_completion is received for
packets queued on copy-engine, there will not be any
tx completions received for these packets and should be
freed during de-init.

Currently the TxLookUpQueue is being flushed only for
WMI and HTC_CTRL endpoint only. HTT_DATA_SVC endpoint
also has interrupt based tx completion processing
enabled for certain targets, and the packets for this
endpoint are not being flushed during de-init.

Fix the above issue, by flushing the TxLookUpQueue for
HTT_DATA_SVC endpoint if interrupt based tx completions
has been enabled for this CE pipe.

Change-Id: If79c2ace17c3bfb8ffeb03cb69c142f7ad43aedb
CRs-Fixed: 3307267
2022-10-16 02:06:17 -07:00
Jeff Johnson
664b1762ea qcacmn: htc: Fix misspellings
Fix misspellings in htc/...

Change-Id: Id533c5659a137bfe8e2b6ce9380e65d432ba5ad5
CRs-Fixed: 3304687
2022-10-10 16:22:04 -07:00
Nandha Kishore Easwaran
93bf7e1fb1 qcacmn: Schedule CE tasklet when resource runs out
If there is no resourse to send packet via HTC, then check if interrupts
are not processed from that CE for last 3 seconds. If so, schedule a
tasklet to reap available entries. Also if Queue has reached 1024 entries
within 3 seconds, then also schedule tasklet.

This change is added because there is a case where intermittently
completion interrupts are not received from CE3 and hence adding
this WAR in host to come out of this issue scenario.

Change-Id: I126cd5e678517127659237308f8f6b1313f8f422
CRs-Fixed: 3234943
2022-07-14 01:02:11 -07:00
David Oladunjoye
4cfc54cf60 qcacmn: htc: Replace fallthrough comment with attribute
-Wimplicit-fallthrough is being enabled by default. Some compilers
such as clang require the attribute instead of just a fallthrough comment.

Change-Id: I7ed1baaad93aea2cd2551dd3b5f9a93953154188
CRs-Fixed: 3218240
2022-07-07 02:38:39 -07:00
Ananya Gupta
8565e7029f qcacmn: Register DP, HTC, HAL modules with Runtime PM module
With restructuring in HIF runtime PM module, modules are
required to register with the HIF runtime PM module. Also,
changes are done in functions of allowing and preventing
runtime PM suspend as part of restructuring.
This change registers DP, HTC and HAL internal modules
with runtime PM module and update HIF runtime PM function
calls with the restructured code of HIF runtime PM module.

Change-Id: I8899a1d3b92a90a05c5eaf4df7609f4008f739f8
CRs-Fixed: 3169372
2022-06-18 23:11:24 -07:00
Vishal Miskin
ff97c457a2 qcacmn: Refer qdf defined macros instead of redefine
Refer qdf_container_of for A_CONTAINING_STRUCT

Change-Id: I9cd939bdefb34ae74ac4263ff86830bc83b7068b
CRs-Fixed: 3187163
2022-05-24 13:15:52 -07:00
Amit Mehta
70a8e8a708 qcacmn: Track HTT nbuf map and unmap count
Add logs to track nbuf map and unmap count for HTT messages.

Change-Id: Ib2fdcdb03b2a8d5e574f34e3eef30601d3976664
CRs-Fixed: 3184850
2022-05-11 01:03:15 -07:00
Kiran Venkatappa
19ceffca9d qcacmn: Use WMI_MULTI_MAC_SVC and remove target defs
Remove target type #ifdefs for multi WMI svc by setting
WMI_MULTI_MAC_SVC in makefile.

Change-Id: I46d968328825ff8f6578cf3ba4454f559d5a7315
CRs-Fixed: 3131513
2022-02-17 09:40:44 -08:00
Alan Chen
75c2cf25ab qcacmn: Add debug log to print link vote id
Add debug log to print details about the link vote id.

Change-Id: I2e89a3d6f06a0f3ec38ea9e8345d854553dbe86d
CRs-Fixed: 2964961
2021-06-24 16:32:11 -07:00
Aditya Kodukula
45daa78c52 qcacmn: Add credit history into the minidump
As part of minidump enhancement feature, incorporate
credit_history data structure into the minidump.

Change-Id: I66a899f6d4054677f25453e87ebf672a575e1b9a
CRs-Fixed: 2946301
2021-06-21 23:14:21 -07:00
Basamma Yakkanahalli
00bcc8cbd3 qcacmn: Initial changes for ipq9574 target compilation
Added device ID and target type checks for ipq9574 traget
compilation.

Change-Id: Ie337d1256f828987ed469a609c8fb74de2180dca
2021-06-18 11:07:50 -07:00
Sajini R
ffc4a9de53 qcacmn: Add option to configure H-T-C pipe ready message timeout
Add INI option to configure Host-Target communication pipe ready
message timeout for debug.

Change-Id: I0b29ced69b67debcc4059b3ffb6578f3e808bf5c
2021-06-17 11:14:19 -07:00
Manikanta Pubbisetty
fe0463deb8 qcacmn: additional runtime PM stats for HTC layer
Add few more stats to the existing runtime PM stats for
HTC layer.

Change-Id: I1610acc534997b14ae070c48da03b4e07a00d9ef
CRs-Fixed: 2949969
2021-05-20 07:58:46 -07:00
Manikanta Pubbisetty
536d86610b qcacmn: fix runtime PM get/put out of sync
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
2021-05-20 05:56:55 -07:00
sandhu
9dc81d7965 qcacmn: Add HTT HTC tx completion based packet free
Add CE4 tx completion for htt htc packets. current logic
uses htt htc misc list to free packets.

Change-Id: Iea15d0dba544d3cc7581b11aa7ab7e5c0024133a
CRs-Fixed: 2630768
2021-05-17 18:56:02 -07:00
Manikanta Pubbisetty
42c4fca998 qcacmn: add runtime PM stats for HTC layer
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
2021-04-21 04:23:30 -07:00
Yeshwanth Sriram Guntuka
6611374cf4 qcacmn: Trigger sys wakeup for WMI command when WOW is enabled
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
2021-03-31 01:04:01 -07:00
Jingxiang Ge
2c6d25c0ad qcacmn: Add detection for tasklet delay
This feature is used to detect CE tasklet scheduling delay
and credit response delay issues.

Change-Id: I9a8fcb425edd5cf96fae5f6cd3bfc7f51172c814
CRs-Fixed: 2874874
2021-03-16 00:45:23 -07:00
Aditya Kodukula
c8963655ef qcacmn: Rename the flag QCA_QIFI_NAPIER_EMULATION
To make it generic, rename the flag QCA_WIFI_NAPIER_EMULATION
as QCA_WIFI_EMULATION.

Change-Id: I21b34475ce550b6875c5f19cf1fbba342862ecee
CRs-Fixed: 2871345
2021-02-06 14:51:18 -08:00
Rakesh Pillai
6ee7aeb0bd qcacmn: Avoid logging in packet transmission path
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
2021-01-12 14:34:40 -08:00
Manikanta Pubbisetty
ade01cf0de qcacmn: fix use after unmap case for HTT packets
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
2020-12-17 13:40:03 -08:00
Kai Liu
4be28ba641 qcacmn: Enhance hang info feature
Add bus related info in hif layer in order to get bus status
when hang issue happened.

Change-Id: If922e0892e0f65de778b9696bbc56fc63c25c169
CRs-Fixed: 2801350
2020-10-30 13:03:35 -07:00
Yeshwanth Sriram Guntuka
b2fa2a1dbd qcacmn: Increment htc runtime cnt prior to hif_send_head
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
2020-10-12 15:06:33 -07:00
hqu
ba45fe7e2c qcacmn: Fix implicit-fallthrough compile error casued by gcc 9.3
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
2020-10-08 12:24:02 -07:00
Yeshwanth Sriram Guntuka
478749a365 qcacmn: Do RTPM put during cleanup when HTT ver resp is not received
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
2020-10-02 10:37:14 -07:00
Arun Kumar Khandavalli
ffaafd74ef qcacmn: Correct the tlv length of the hangdata
The Tlv of the hang data is reduced to 2bytes from the 4bytes
change the structure defnitions accordingly.

Change-Id: I675e4d837afa92496aeebec408ebfd90cbb7ad32
CRs-Fixed: 2753821
2020-08-17 08:06:33 -07:00
Arun Kumar Khandavalli
d564955d05 qcacmn: Trim the hang data size as per requirement
Trim the hang data as per the customer data size requirement.

Change-Id: I5a5d848f820ddeaa721dba176e67dba97fed7a71
CRs-Fixed: 2751370
2020-08-17 08:06:29 -07:00
Shashikala Prabhu
cb2acc0ea0 qcacmn: Correct the return types of functions in HIF component
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
2020-07-24 09:21:14 -07:00
Yeshwanth Sriram Guntuka
86084af159 qcacmn: Do runtime_get_sync in htc_kick_queues
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
2020-06-25 18:14:01 -07:00
Neha Bisht
f224d5dc91 qcacmn: Introduce counters per endpoint to improve HTC debuggability
To introduce counters htc_send_cnt and htc_comp_cnt per endpoint to
enhance pdev level debugging in HTC path.

Change-Id: I8d31e3a533e0f8de4c89d3609b20c148aef3a4ff
2020-06-25 15:08:09 -07:00
Ke Huang
b404458d20 qcacmn: Add NULL pointer check for KW issues
Add NULL pointer check in function hif_send_single() and
htc_dump_counter_info() for KW issues.

Change-Id: I4b020c566b14b28a825c13752dccf67b5f8bb837
CRs-Fixed: 2675205
2020-05-29 03:13:53 -07:00
Jingxiang Ge
b75ec972c4 qcacmn: Fix regression issue for EAPOL fail
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
2020-04-19 01:14:01 -07:00
Jingxiang Ge
e7d41574f3 qcacmn: Add dbgid for each runtime put/get
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
2020-04-07 01:20:41 -07:00
Arun Kumar Khandavalli
1f76b82659 qcacmn: update the hang data for htc
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
2020-04-01 21:16:54 -07:00
Manoj Ekbote
1c1ef8c2bd qcacmn: Print re-queue message based on threshold
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
2020-03-26 20:18:56 -07:00
Yeshwanth Sriram Guntuka
e71aeae1bd qcacmn: Set FIXUP_NBUF flag only on successful nbuf map
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
2020-02-26 13:31:07 -08:00
Alok Kumar
9cc180ec26 qcacmn: Avoid NULL pointer dereference in send_packet_completion
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
2020-02-25 06:23:56 -08:00
Tiger Yu
a3a9160cf8 qcacmn: Destroy the queue_kicker work which is triggered by RPM resume
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
2020-02-19 16:08:43 -08:00
Surya Prakash Raajen
b976076b3b qcacmn: Track tasklet execution and total time (sched+exec)
Add support to track tasklet execution and total time in different
buckets for debugging purposes

Change-Id: Ide459c385b2a44c0f16d05b37879c8b462782d72
CRs-Fixed: 2589199
2020-01-05 10:16:57 -08:00