Currently, NULL pointer dereferencing of objmgr PDEV
is observed in wlan_objmgr_pdev_get_comp_private_obj.
Add NULL check for pdev inside ipa_uc_force_pipe_shutdown
and ipa_fw_rejuvenate_send_msg before pass PDEV to
wlan_objmgr_pdev_get_comp_private_obj.
Change-Id: I4e19cc9c254febabad551aa62f72d2ce4897b852
CRs-Fixed: 2719149
Currently, if the time spent in a spin_lock region exceeds
a certain threshold, a system crash will be triggered.
There are chances that a log within a spin_lock region would
result in a crash if the time taken to log the buffer exceeds
the threshold which triggers the crash.
Avoid this by moving the log out of the lock region.
Change-Id: Ic51556723033e9553443250b9cb4cfee2b402309
CRs-Fixed: 2713234
Set WLAN_IPA_MAX_STA_COUNT to WLAN_MAX_CLIENTS_ALLOWED
if WLAN_MAX_CLIENTS_ALLOWED is defined.
Change-Id: Ic7b3706897cec8ee149bab12cd91c94ae04f75ef
CRs-Fixed: 2658585
osif_psoc_sync_trans_start_wait is wrongly used in
Idceff767d62c1e81046a696cb58f70a897cbd074, which will block any
vdev operation which results in tethering failure and Tx packets
also won't be transmitted whenever ipa event is processed as
we have vdev check in hard transmit too.
Fix:
Don't call osif_psoc_sync_trans_start_wait when handle IPA
event, just check recoverying state.
Change-Id: Ibb5d94e0e22413fdd9dad294fc8da58eba8a700b
CRs-Fixed: 2680423
At stop adapter flush vdev's pending wlan ipa events
and also increase the ipa resources load/unload timeout
to 500ms as current timeout of 100ms which is less taking
in to account of suspending IPA pipes, WLAN FW pipes and
also waiting separately for the RX and TX suspend ack from
the FW.
Change-Id: Ia622ab84f15089826c23502f365b11e742277ca8
CRs-Fixed: 2660807
Race condition between ifconfig and ipa uc event handler thread.
While ifconfig thread creating vdev1, the vdev is locked, ipa uc
event handler thread tries to lock psoc, becomes failed for 1
dev locked, gets error EAGAIN but doesn't try again. IPA uc
event is abandoned without handling.
Fix:
IPA uc event handling can't be abandoned but can be blocked
since it is called in separated work thread, block DSC API
should be used here.
Blocked Operation and Transition have no much difference in DSC,
and they need block each other too, should share same
completion and queue, can share same API.
With WDI 3.0 over GSI, WDI control event is not needed. Therefore
provide a wrapper API for wlan_ipa_uc_send_wdi_control_msg().
Change-Id: Idceff767d62c1e81046a696cb58f70a897cbd074
CRs-Fixed: 2618490
Currently in net dev cleanup of ipa host interface if the
ipa interface does not exist for that particular net dev,
last ipa iface reference is passed. This may lead to invalid
access. So fix by validating the iface context before clean
up of host ipa interface.
Change-Id: I753c922b5c82c676a318df87552051fdd74c983c
CRs-Fixed: 2632382
AP isolation a.k.a intra-bss forwarding is a per AP attribute. Issue in
current IPA implementation is that it does not support per AP control.
In a SAP-SAP configuration, latter SAP configuration will always overwrite
first SAP's isolation configuration.
Fix is to add vdev id parameter from protocol layer so that IPA component
could configure AP isolation on a per AP basis.
Change-Id: I9c96cdcda03eb10b4c2984a757e52d77b5bf6790
CRs-Fixed: 2624757
Currently many layers store the datapath handles i.e.
pdev and vdev handles and use them for passing as an
argument to the CDP APIs. This gives way to possible
race conditions, where the datapath handle provided by
the outer layer might be a stale pointer, which in turn
leads to unexpected results.
Remove the storage and usage of all the datapath handles
from the layers currently using them.
- cds_context
- vdev objmgr
- pdev objmgr
Change-Id: Icf24bd3792af203d1a06e153f0badd6e7405559f
CRs-Fixed: 2602199
Add a check if list count is non-zero before deleting the node
from IPA tx descriptor list.
Change-Id: I9913c636107686755ffc5da2b585028a4be7a1e9
CRs-Fixed: 2601601
In case of STA + SAP ipa pending tx timer is started when last
SAP client disconnects. Again if client connects back timer is not
stopped at pipes enable. Later some time if suspend kicks in and
during bus suspend if there are no ipa tx pending ipa pipes are
disabled. This leads to issues such as data stall, invalid IPA
doorbell register access. So reset the timer during ipa enable pipes.
Change-Id: Id6034596f52f98c793674c9d9e5f7918c5c3d455
CRs-Fixed: 2598559
In IPA uC ready handler, metering feature and perf level are not
initialized. Therefore properly initialize them after IPA pipes
are connected.
Change-Id: I99621bb2c2831d66e11b0ca903ecb324ef898836
CRs-Fixed: 2582409
At present, IPA sys pipes setup done before wlan_ipa_wdi_init,
so chances for IPA uC is not yet up and running. As wdi init
succeeds only if uC is up and running, setting up IPA sys pipes
after wlan_ipa_wdi_init succeeds.
Change-Id: I7dcae49db0b0a2114908284379096f39e6f16a50
CRs-Fixed: 2573929
Currently dual STA is not supported in WLAN IPA component,
where first STA interface info will be overridden by second
STA including iface_ctx and interface registration to IPA
driver.
When second STA is switched to SAP and a ref-client is
connected to SAP, IPA datapath will be enabled for Wifi
sharing feature. But wlan0 interface is not registered
to IPA driver and this will lead to packet drops for
STA on the RX IPA exception path. IPA driver relies
on information such as vdev_id wlan driver registered
to correctly set skb->cb[0] and wlan driver uses
skb->cb[0] to find the correct vdev to pass packets up
to stack. Since STA interface info is not in IPA,
vdev_id for RX exception packets are thus wrong.
Fix is to store multiple STA interfaces in iface_ctx
and all of them are registered to IPA driver.
Change-Id: I745618c22e24b6c56719f8ae5faf653f55b99bca
CRs-Fixed: 2573567
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: I678d7a7de7132417ff6051b0fd6da5d14426d21e
CRs-Fixed: 2540861
For wlan_ipa_setup_iface, if found the net_dev is already there, but the
device_mode is different, will remove this obsolete record and update it
with new interface context for current IPA WLAN event.
Change-Id: Ib9ecd7f7b3b9603c37dc1d69cd0f3a2868c978ec
CRs-Fixed: 2567222
Currently the cdp apis 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/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.
Converged flowctl_ops
- flow_pool_map_handler
- flow_pool_unmap_handler
- dump_flow_pool_info
- tx_desc_thresh_reached
CRs-Fixed: 2539738
Change-Id: I9b11e66d8c2644f16e0f2464c323798a4cba007a
In DBS scenario(SAP + STA) when all SPA clients disconnect, while STA is
still connected, IPA pipes are disabled on the lithium target. At this
time, its possible that some packets TX from IPA over WLAN are still
pending. If these completions come after IPA pipes are disabled, it can
lead to a NOC error, since the GSI doorbell register for WBM2SW2 ring
may be clock gated (after IPA pipes are disabled).
To avoid this situation, wait for some time before disabling IPA pipes.
IPA pipes are disabled after a timeout, when system suspend call tries
to suspend the bus. A driver unload or a softap tear-down will also
disable the pipes.
Change-Id: I542049fa19d0dcf5c31d9b8a2d836388847dd6c1
CRs-Fixed: 2553670
Support wlan ipa clk voting for kona. Host should provide
bandiwdth levels to IPA driver for which IPA uc monitors
the levels. Once the threshold is reached IPA uc interrupts
the IPA driver and IPA driver informs host driver via callback
registered.
Change-Id: I9fd805d69858a413f20b9e55a9c02a82054c646b
CRs-Fixed: 2526300
When doing IPA initialization, WLAN driver registers a
notification callback for IPA uC ready. In the callback,
we directly set uc_loaded to true before scheduling a work
task to connect WLAN IPA pipes. However issue is that in
the work handler, uc_loaded is checked and if it is true,
we return without connecting WLAN IPA pipes.
Therefore properly set uc_loaded to true so that WLAN IPA
pipes can be connected correctly.
Change-Id: I27a14e627a1a75836f08dc5dec8c8b1d09725e10
CRs-Fixed: 2537625
Implement metering stats quota to support ipa offload sta plus
sap wifi sharing use cases.
Change-Id: Ic9d5ad817ffb4d671a43f3f3aebb2d8cce293873
CRs-Fixed: 2517696
Merge from 2517936 & 2490501.
SMMU fault is observed for WDI 1.0 MCC TX when SMMU is enabled.
Issue is that dma_addr passed from IPA driver is iova of IPA
domain. WLAN driver directly uses the iova to do transmission.
Since iova is not mapped in WLAN domain, SMMU fault occurs.
Fix is to map skb to WLAN domain for TX when SMMU is enabled.
After doing DMA map, an offset of frag_header and ipa_header
is added to the iova and skb->cb is updated with the new iova.
After TX completion, skb DMA unmap is done but with the iova
of the above offset included, which leads to unmapped iova error.
Fix is to recalculate the iova and update skb->cb with new iova,
which has frag_header and ipa_header length removed.
Change-Id: Ib0112d6a3de6dc9af43e5c48a49085c7d4f41a9b
CRs-Fixed: 2534845
During wlan IPA suspend, force the bandwidth voting to high
when CFG_DP_IPA_ENABLE_FORCE_VOTING is enabled.
Change-Id: I9b368081f9c0919f5fecfacf318ad1a714cc33cf
CRs-Fixed: 2521815
There is a race condition of vdev_to_iface, it is referenced in IPA W2I
callback routine, but it's updated after IPA enable operation. If frames
received right after IPA enabled, callback function will return failure
due to vdev_to_iface value is not filled.
Change-Id: Iff831b66771539d1de4af89e395821dc50d13af3
CRs-Fixed: 2517515
In __wlan_ipa_wlan_evt, for QDF_IPA_STA_DISCONNECT event,
ipa_ctx->vdev_to_iface[session_id] is reset back to
WLAN_IPA_MAX_SESSION only when ipa_ctx->sap_num_connected_sta
is greater than 0. So, in STA+SAP concurrency case, when
no client is connected to SAP, if STA is disconnected,
vdev_to_iface is not reset for that particular session id,
making it unusable for further events involving IPA iface
creation.
Fix is to move the code to reset vdev_to_iface outside the check
for ipa_ctx->sap_num_connected_sta in QDF_IPA_STA_DISCONNECT
scenario, so that vdev_to_iface is reset irrespective of SAP.
Change-Id: I06c79b62c540546cf4842f81d235f96b2965661e
CRs-Fixed: 2525709
Set the same IPA bandwidth for both the cons and prod pipes based
on total packet counts, to avoid overwrite voting by one another,
as per IPA-PM implementation.
Change-Id: I5f93e1ff91f9fbeb42ea8bd93792e288a073b6b1
CRs-Fixed: 2521811
If STA disconnect failed for any reason, cleanup IPA STA iface
if not already done.
Change-Id: I27ff33324bc4724e8470af9a0c434fa03e8aa5c3
CRs-Fixed: 2505563
For runtime PM if the bus is suspended driver need to consider
extra 6 sec time for bus resume.
Thus add 6 sec extra in WMI timeouts if runtime PM is supported.
Change-Id: I5515cc889a0315382bac11a33ea6f901b7af1c46
CRs-Fixed: 2507029
Local sta_id or 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.
Change-Id: I78230bf1e1ec090e83245bff04953fa2e03b91cd
CRs-Fixed: 2504013
On MDM platform, low throughput is observed for SAP RX
terminated scenario. In case of SAP, SAP device itself
is added as a slave to the bridge device, which acts as
a router device.
For SAP RX terminated scenario, destination MAC address
of RX packets is the bridge device. However for WDI 3.0,
WLAN IPA has to check if destination MAC is a valid peer
for SAP intra-bss forwarding.
Currently in intra-bss forwarding, dp_find_peer_by_addr()
is used to look up if destination MAC address is a valid
peer. Issue is that in dp_find_peer_by_addr() peer
spinlock is grabbed via qdf_spin_lock_bh. IPA RX is in
process context and qdf_spin_lock_bh turns to spin_lock_bh,
which hurts netif_rx badly.
Fix is to check if RX packet is bridge device terminated
in IPA component module so as to bypass intra-bss
forwarding logic and to make the RX path BH lockless.
Note that if there's a BH lockless API to check if
destination MAC address is a valid peer, this check will
not be necessary.
Change-Id: I00fca3e75ae55ae1d2f591fddd00e49dfb634c5c
CRs-Fixed: 2494442
As for Rome, currently it usually just only support two
IPA interfaces offload, if use the default value 3, which
will cause the IPA pipe setup failure issue. So export
the max IPA interface numbers, and it's better to set
the appropriate value from build file according to
different requirement for different chipset and platform.
Meanwhile, it support SMMU on the sa415 platform, so
enable SMMU for it.
Change-Id: I2de31bcb4d38f5e7964d2cbdc2fc6f143eef510d
CRs-Fixed: 2480627
wlan_ipa_w2i_cb is notify cb for IPA RX terminated
scenario and therefore it is invoked on a per-packet
basis.
qdf_op_protect and qdf_op_unprotect leads to ~100mbps
througput degradation for IPA RX terminated scenario
on MDM platforms. Thus remove qdf_op_protect and
qdf_op_unprotect on MDM platforms as a temporary
workaround to unblock releases and meet KPI. Note that
this will be revisited.
Change-Id: I1cab0581288456662ee4aa5d63df1b0f1213436b
CRs-Fixed: 2469073
During resource unloading, if two next to next client connect
request comes, one is handled in pending event handler in
wlan_ipa_uc_op_cb callback after processing FW TX suspend response
and other one is handled in scheduler thread, this causes race
condition in sending IPA offload enable for STA iface. So send IPA
enable req to FW before queuing the client connect event to the
pending events.
Change-Id: Ifcabc2481e590e5e128434614c4b46fe53a34636
CRs-Fixed: 2460573
Abstract the callback hdd_softap_ipa_start_xmit by
hdd_softap_ipa_start_xmit, to match the return type of
wlan_ipa_softap_xmit pointer, to fix a CFI failure.
Change-Id: If1cb1a80801558d5c7831ec89ad5281b0bbe36f3
In STA-SAP config, IPA offload is enabled only when first
client is connected to SAP. This is OK for MSM platforms.
But for MDM platforms, this is not the case. There's STA
tethering cases, where traffic is routed between STA and
USB tethering devices while SAP is idle and no wifi clients
are connected to SAP. In such case, IPA offload needs to
be enabled for STA to promote performance.
Fix is to use available MDM_PLATFORM marco and STA only IPA
support is decided upon driver build time.
Change-Id: If2bc016aa941f2c0651a2669f1169e631208326b
CRs-Fixed: 2433608
Check for validity of vdev obtained from the CDP
cdp_get_vdev_from_vdev_id API.
Change-Id: Ie7fb99a0e08135bd3f2cc6b63070a4bd72df943a
CRs-Fixed: 2434583
Support WDI 3.0 SW path intra-bss forwarding. Major
difference for WDI 3.0 is the metadata info passed
from ipa driver in skb->cb[].
Previously intra-bss fwd decision is done by FW and
it passes fw_desc to IPA where IPA driver passes onto
WLAN driver. Now for WDI 3.0, FW is not involved in RX
path and SW path intra-bss fwd decision has to be done
in wlan driver.
Change-Id: I0b4b9bbf16440dd47b6f97460f8931ea3a79303c
CRs-Fixed: 2426857
When vdev is logically deleted, vdev reference will
be returned as NULL by objmgr.
Remove vdev sanity from QDF_BUG while sending IPA evt
in __wlan_ipa_wlan_evt.
Change-Id: Ie7f9697768d53c71a6bead377c35bbc3f62e808a
CRs-Fixed: 2433521
The only function called through this pointer type doesn't return
a value and the caller doesn't check for a return value. Change
the function pointer type to return void to fix a CFI failure due
to a type mismatch:
CFI failure (target: [<ffffff853ba7cee8>]
hdd_ipa_send_skb_to_network+0x0/0x4 [wlan]):
...
Call trace:
__ubsan_handle_cfi_check_fail+0x50/0x58
__cfi_check+0x31fa0/0x3d5a4 [wlan]
wlan_ipa_w2i_cb+0x5fc/0x8fc [wlan]
...
Change-Id: I94f6bb0fc06acebde12cf80294999d9419296c4a
CRs-Fixed: 2431600
ipa disable pipes request is honoured based on
ipa_pipes_down flag. However, there is a possible
synchronization issue if disable pipes request is
initiated from different contexts, as there is no
locking to protect this flag.
Add pipes_down_in_progress flag in ipa_ctx and
use this flag to ignore disable pipes requests if
one request is already in progress.
Change-Id: Iabf01249d4b6a551e03cea2ae96a0c6096f43ff8
CRs-Fixed: 2423155
qdf_delayed_work_t has been superseded by qdf_delayed_work. Replace all
instances as appropriate.
Change-Id: I83f0dcec050bc9f91624048bd171f9a86b0394b5
CRs-Fixed: 2420202