Currently struct ipa_wdi_conn_in_params occupies 1588 bytes and putting
it on the stack is rather expensive, which could potentially lead to
stack corruption.
Fix is to reduce stack usage in dp_ipa_setup by dynamically allocating
struct ipa_wdi_conn_in_params on the heap.
Change-Id: I8f71f44906a5c95f37627f7573b57b7825daaa7e
CRs-Fixed: 2852027
WLAN HW can still access the IPA tx doorbell address post
disable pipes if there are any pending tx completions which
could result in a NOC error.
Fix is to reset the WBM2SW ring HP addr to shadow addr in
DDR before pipes are disabled.
Change-Id: I52900eb34530388487923a887354ef8839d8c728
CRs-Fixed: 2846421
Account for the Tx buffers allocated for IPA during
init. Add this memory to the overall Tx nbuf memory
allocations. Ensure that the nbuf size is taken from
end pointer to head pointer of nbuf.
Change-Id: Ie3a46c7e7674f3f2e1bf9e0791a7eb53d4bb0b21
CRs-Fixed: 2831015
When driver doing ipa rx buffer smmu mapping,
qdf_spin_lock_bh is used to protect rx descriptor pool,
but might sleep function is called by API ipa_is_ready.
This causes kernel panic about sleeping function called
from invalid context as following call trace:
Call trace:
___might_sleep+0x204/0x208
__might_sleep+0x50/0x88
__mutex_lock_common+0x5c/0x1078
mutex_lock_nested+0x40/0x50
ipa3_is_ready+0x2c/0x60
ipa_is_ready+0x24/0x38
dp_ipa_handle_rx_buf_pool_smmu_mapping+0x2dc/0x6d0 [wlan]
Move the ipa is ready check function call outside of spin lock.
Change-Id: I5d3a79dff8a045791834733514a40f7c1ccb0d8b
CRs-Fixed: 2839292
REO remap register direct writes as part of SAP stop could
result in a NOC error if the UMAC is in low power state.
Fix is to use shadow register writes for REO remap and
WBM HP registers.
Change-Id: Ie515c3d28f4ccdd99a3757808f1ab6c5cf373e3d
CRs-Fixed: 2813105
wlan Tx completions doorbell is rung after IPA pipes are disabled
To fix this, Check if tx completions are pending before disable IPA
pipes.
Change-Id: I1903e593cd6a546a277979073f0a9ba62b681644
CRs-Fixed: 2796989
Add apis to map generic registers to shadow region. Existing
logic includes mapping only srng based regs to the shadow
region.
Add support to map REO control regs and WBM2SW2 rel
ring HP reg address to the shadow region in case the direct
reg writes in IPA enable/disable autonomy fail due to UMAC
block being in a power collapsed state.
Shadow reg mapping for these regs is provided to FW during
init. Add stat shadow_reg_write_fail to track shadow reg
write failure and shadow_reg_write_succ to track successful
shadow writes.
Change-Id: I04790765a3de80047689657e2cad0b73123440b9
CRs-Fixed: 2790321
A htt message arrived after ipa context is freed as part of
deinitialization which was dereferenced by event handler
assigned to pdev->ipa_uc_op_cb, resulting in crash.
To fix this, during deinit pdev->ipa_uc_op_cb is deregistered
and assigned NULL before freeing up ipa context.
Change-Id: I8125cb104a538e88cda93960f7443129fabd850a
CRs-Fixed: 2793295
Add API to do IPA Tx buf SMMU-S1 unmapping and register it
with cdp ops for Hastings, also assert if map/unmap failed.
Change-Id: I4071b5fccd84c3c97b9dccc40c6f798d70993189
CRs-Fixed: 2792170
During driver initialization, IPA TX and RX doorbell registers
are provided to wlan as physical addresses. With SMMU S1 enabled,
they're mapped to IOVA of wlan domain.
On driver deinit path, do smmu unmap for the two IOVA addresses.
Change-Id: I85ef1c3e99bef504abf09eebf9ace760b68f35f1
CRs-Fixed: 2768303
The logging macros implicitly takes care of embedding function name
in the log, hence there is no need to include __func__ again.
Getting rid of redundant __func__ reduces driver memory footprint.
Change-Id: I26bfac840ac6732ac83fb008db8e1702996eb21e
CRs-Fixed: 2774457
Currently, check is performed only on tx_comp_ring and rx_ready ring,
after getting the resource from soc in pdev.ipa_res.
Adding check for tx ring and rx refill ring as well.
Change-Id: I462073357bcd2b4a3f5e888d77d84621855f973c
CRs-Fixed: 2771401
The variable 'ret' in ‘__dp_ipa_tx_buf_smmu_mapping()’ maybe
used uninitialized. Set one default value for it.
CRs-Fixed: 2771822
Change-Id: Ibf4bf6aa2076de84b3a47122ff4f3cae055cd0f7
Currently when IPA is enabled, all RX frames will be routed to IPA
ring REO2SW4 by default, there is no REO2HOST option. once IPA RX/TX
is slow, then likely will give RX back pressure to wlan RXDMA. per
FW feature request, when IPA RX is slow or stuck, route RX frames to
wlan host to mitigate issue, thus provide REO2SW1 ring as REO_DST
option into HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0.
To make sure if without FW dynamic REO_DST ring switching change,
current host change should not give chance that RX frames
route to host when IPA is enabled, select CTRL_IX_0 index 2 to
set REO_DST option, the reason is: if RX hash is enabled, CTRL_IX_2
and CTRL_IX_3 index 16~31 is REO_DST option filled with REO2SW4,
if RX hash is disabled, then CTRL_IX_0 index 1 and 4 filled with
REO2SW4 is REO_DST option configured by
WMI_HOST_PEER_SET_DEFAULT_ROUTING, so CTRL_IX_0 index 2
is only used for FW dynamic ring switching.
Change-Id: I6af12e07472dbdd4ab6d97f24e9fd4082c4e7328
CRs-Fixed: 2767844
Register IPA ready callback with IPA driver. The callback
sets ipa_is_ready flag in the host driver and kick starts
the ipa init sequence as part of which the Tx buffers are
mapped to IPA.
None of the IPA APIs are invoked until IPA ready registration
is complete.
Change-Id: I6570b2b347052164a274fbc22358ebf0719dcabf
CRs-Fixed: 2735107
Add debug support for VDEV refcount to take
refcount by module id and decrement corresponding
refcount with same module id
Change-Id: I15c075816994ba70155fefbc0bce208b20fb9a59
Add new API dp_vdev_get_ref_by_id() which will return vdev
pointer by holding a reference. Caller of this API has
to ensure that this reference is released by calling
dp_vdev_unref_delete() API
New lock soc->vdev_map_lock is introduced to protect
vdev id to object array
Change-Id: I883e328932e35ef31254125492dbae20cebe0e00
Add support to get the peer reference with module id
To help debug the peer reference related issues
Change-Id: Ie20c7e710b9784b52f2e0f3d7488509282528a00
Currently in_use and unmapped flag from rx_desc can not know is
the rx nbuf has done IPA smmu map/unmap accurately.
add rx nbuf IPA smmu map/unmap flag in qdf_nbuf_cb, and use
this flag to check if IPA smmu map/unmap need to be done or not.
Change-Id: I19bbc6cc69ba752ef7c58d41fbe26299ca96d29e
CRs-Fixed: 2731313
Remove self and BSS peer back pointers and added APIs to
get self and BSS peer from VDEV
These new APIs will iterate through peer list and return
the appropriate peer by taking a reference
Caller has to take care of releasing the reference
Change-Id: I550ff83d665f3ad0a185bea1a1e6270c5474ff07
Race condition is observed as dp_ipa_rx_intrabss_fwd is
accessing da_peer after releasing the ref count of the peer
while that peer is deleted parallelly.
To fix this, da_peer and sa_peer are only assigned if the
peers are found in the vdev.
Change-Id: Ib03835a509d656eb11946c075b820555b04934f8
CRs-Fixed: 2723448
IPA pipes are not disconnected successfully when the last
client disconnects and despite that smmu mappings given
to IPA for the buffers are released.
Assert instead of releasing the smmu buffer mappings as
IPA has stalled and is in a non-recoverable state.
Change-Id: I9a9a35a4019726421d7435b62defe8da4907d4e0
CRs-Fixed: 2627889
Add a framework to configure varying buffer size for both data and monitor
buffers.
For example, with this framework, the user can configure 2K SKB for Data
buffers, monitor status rings, monitor descriptor rings, monitor
destination rings and 4K SKB for monitor buffers through compile time.
Change-Id: I212d04ff6907e71e9c80b69834aa07ecc6db4d2e
CRs-Fixed: 2604646
Currently host writes to TX doorbell register after ipa connect
pipes to indicate number of free TX buffers. In case when IPA
clocks are off and host tries to access the register will leads
to invalid access. So access the tx doorbell register after ipa
enable pipes which makes sure IPA clocks are always on.
Change-Id: If11fdc9c408ebf7f22eef6a020b507bc39ee6a8e
CRs-Fixed: 2599029
Currently wlan host will re-inject defrag data with RBM 6 to
REO, this data buffer will go to REO-->REO2SW4-->IPA-->FW2RXDMA,
fix below issue introduced by this RX buffer path.
a. FW assert due to FW2RXDMA DMA address not 4 bytes aligned.
b. host skb double allocation due to qdf_nbuf_linearize() for frag skb.
c. Invalid RBM 6 for fragment RX due to RX buffer resue.
Change-Id: I36d831fc14b6b9aa0cea32682823de348f7eecd3
CRs-Fixed: 2591453
Change cmn_ops APIs to replace pdev, vdev and peer
dp handles with pdev_id, vdev_id and peer mac address
along with dp soc handle
Change-Id: I5716a87cad56b1dfe8dd56f193bbb6ff923a6af1
Local peer_id is being cleaned up across DP, HDD and PS/WMA.
So, any references to local peer_id/sta_id will be replaced
by peer mac address and all interactions between the layers
will be based on peer mac address.
Cleanup local peer id usage from DP APIs.
Change-Id: I930e1c6a09092a373c093239632d6f310fee18e2
CRs-Fixed: 2529041
For debug purpose of issues related to IPA NOC errors and
register writes not going through, record last 32 dp ipa
reo remap register writes which are outside of non shadow
region registers.
Change-Id: If2dfe7250bb2a6bbe0e180df137c92b43a150b2c
CRs-Fixed: 2571608
In case of SSR, the host driver is not supposed to
access any of the UMAC registers. The disable or
enable of autonomy during SSR can cause an invalid
access to the REO registers.
Avoid the REO registers access during SSR case.
CRs-Fixed: 2563761
Change-Id: I7e260c2894d8254eafba7038bc2677b52b6eba85
Currently cdp ops are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.
Hence as a part of cdp convergence, pass only
the pdev_id or vdev_id or peer mac address,
which will be used to get the respective handles,
and hence avoiding the unwanted access of the
handles if it has been deleted.
- ipa_get_resource
- ipa_set_doorbell_paddr
- ipa_set_active
- ipa_register_op_cb
- ipa_get_stat
- ipa_tx_data_frame
- ipa_uc_get_share_stats
- ipa_uc_set_quota
- ipa_enable_autonomy
- ipa_disable_autonomy
- ipa_setup
- ipa_enable_pipes
- ipa_disable_pipes
- ipa_rx_intrabss_fwd
Change-Id: Ieb7e48d11a69a1e4a92a7114042b1db72d5f4b65
CRs-Fixed: 2540862
NOC error is observed when PCIe accesses IPA GSI RX doorbell
register even before IPA clocks are ON. Currently for SAP vdev,
default REO dest is set to REO2SW4 and with RX hash being
disabled, packets will finally land on REO2SW4 ring. If packets
arrive on REO and are routed to SW4 ring, REO HW will ring
IPA GSI doorbell address and thus the NOC error will occur
because IPA clocks are still OFF which should be set to ON
by WLAN via ipa_wdi_enable_pipes API.
Fix is to set DEST_RING_MAPPING_4 to SW2 for REO dest ctrl
register such that packets arrived before IPA pipes are
enabled will be handled by WLAN host. Note that
DEST_RING_MAPPING_4 will be remapped to SW4 after IPA pipes
are enabled.
Also correctly configure REO dest ctrl register when RX hash
feature is disabled when enabling and disabling IPA
autonomy.
Change-Id: Ifd471bbe2e4a0e66e080d9ae51fb2a3600fd87e6
CRs-Fixed: 2554023
The reo destination ctrl registers
HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR and
HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR are used for mapping
msdu packets to different reo rings.
For QCA6390,
reo remap values varied from 0 - 7 so every 3 bits in
the register were used to map to a particular reo ring.
For QCA6490,
reo remap values vary from 0 - 9 as two extra reo rings are
added so we are using 4 bits in the register to map to a
particular reo ring.
Use the macros directly provided in the header files
to map reo rings.
Change-Id: I6d64266d3b388b3453b7df959048e3d693cf0a40
CRs-Fixed: 2544102
Add an atomic variable to indicate IPA pipes are connected.
Use it to ensure that SMMU mapping for rx buffers is sent
to IPA even if REO is not remapped but IPA pipes are connected.
Change-Id: I5d82dc073fc2f0de6df102f7bfd2a1e945297aa8
CRs-Fixed: 2552128
Currently for REO reinject path, first fragment is in the
linear part of the skb buffer while other fragments are
appended to skb buffer as non-linear paged data. The other
point is that for REO reinject buffer, l3_header_padding is
not there, meaning ethernet header is right after struct
rx_pkt_tlvs.
Above implementation will have issues when WLAN IPA path is
enabled.
Firstly, IPA assumes data buffers are linear. Thus need to
linearize skb buffer before reinjecting into REO.
Secondly, when WLAN does IPA pipe connection, RX pkt offset
is hard-coded to RX_PKT_TLVS_LEN + L3_HEADER_PADDING. Thus
need to pad L3_HEADER_PADDING before ethernet header and
after struct rx_pkt_tlvs.
Change-Id: I36d41bc91d28c2580775a1d2e431e139ff02e19e
CRs-Fixed: 2469315
WAR for IPA_OFFLOAD case. In IPA_OFFLOAD case, host provides buffers in
the WBM2SW release ring designated for IPA for TX. So this ring is used
to release TX completions into, by WBM, and also by IPA to pick up
buffers from, for TX.
In some cases, its observed that when WBM tries to release a buffer
into this ring, however the ring is full. This causes back pressure,
resulting in a FW crash.
By leaving some entries with no buffers attached, WBM will be able to
write to the ring, and from dumps we can figure out the buffer which is
causing this issue.
Change-Id: Ia0450d36dec643f2631fea13cb0b8facba7425b8
CRs-Fixed: 2535170
Add code to replace usage of void pointers from
HAL layer and instead use appropriate opaque pointers
Change-Id: Id950bd9130a99014305738937aed736cf0144aca
CRs-Fixed: 2487250
Add code to remove void pointer usage for hal_srng
and use opaque pointer dp_hal_ring_t instead.
Change-Id: I6907f7376d7fe3c9180b8795bd96f49fead2ec64
CRs-Fixed: 2484404
Add code to use cdp_vdev instead of void pointer for
API dp_tx_send_exception and dp_tx_send_mesh
Change-Id: I63ca5a62c2a8cd6feb906181702888814650dfce
CRs-Fixed: 2480836
In dp_ipa_setup function, the function qdf_mem_zero is called
and should receive a pointer instead of address to a pointer for tx
and rx when they are called. These pointers are also initialized to
NULL when declared locally.
Change-Id: Iec9c76c63cc2ec00bdfb54497cca2f22fabff045
CRs-Fixed: 2469428
Currently for WDI 3.0, IPA runtime enablement is done in the
way that dp_ipa_enable_pipes API is first invoked and followed
by dp_ipa_enable_autonomy API. With SMMU S1 enabled, RX buffers
are mapped to IPA domain in dp_ipa_enable_autonomy. However RX
buffers could be provided to IPA once after dp_ipa_enable_pipes
and this could lead to possible SMMU fault.
Fix is to map RX buffers to IPA domain before dp_ipa_enable_pipes
API.
Change-Id: Ifdad2db6fa26da06a91b84de8f8603cbc779dd67
CRs-Fixed: 2467966
Tx completion stats should be counted per wbm ring on tx completion
and not globally. Similarly, rx stats should be counter per reo ring.
Change-Id: I1e4af0d38b23e60de78ca03316861db08ff0811a
For MDM platforms, set default REO destination
ring to SW4 for STA vdev, which is same as SAP vdev.
Note that RX hashing is still enabled for STA vdev.
Also REO destination are run-time remapped when IPA
automony is enabled and disabled.
Change-Id: I49fa523673e7b736008679adec55821e198e8417
CRs-Fixed: 2456786
Allocate memory in multiple smaller chunks for dp_rx_desc_pool_alloc,
and link the pages instead of allocating one big contiguous memory to
avoid memory allocation failures.
Change-Id: Id81de10727555c4ca78963a6f01ed3b992ce9924
CRs-Fixed: 2443999
Observed that when IPA offload is enabled, RX packets
are not routed correctly to IPA ring. Currently only
IX0 of REO_DESTINATION_CTRL_IX registers are remapped,
which only covers 3-bit reo_destination_indication of
range 0 to 7.
Fix is to remap REO_DESTINATION_CTRL_IX2|3 registers
so that reo_destination_indication of range 16 to
31 can also be routed REO2IPA ring when IPA offload
is enabled. Upon IPA offload is disabled, save values
of IX2 and IX3 are reset back to HW.
Change-Id: I3428b450ab10076d27c7628a3729e8cec088bd94
CRs-Fixed: 2434331