If fw is down, there is no point to dsc panic. Thus, disable dsc panic
if fw is down.
Change-Id: I1128ea3f32b879305e19fdf45a6e3588a570bd4c
CRs-Fixed: 2535312
The driver currently waits for driver transitions (loading/unloading)
to complete before allowing a psoc or vdev level transition/operation.
This can lead to race conditions if the driver acquires rtnl lock as a part
of the operation and simultaneously a driver transition is invoked.
One such scenario occurs if delete virtual interface is invoked in parallel
to rmmod. The timing of the calls can be such that the delete interface is
waiting on DSC queue to complete after rmmod while the rmmod is waiting on
the rtnl lock to be freed by the delete interface resulting in a scenario
where the threads are waiting on the other to complete.
* Thread B - Invokes rmmod and context switch happens before rtnl lock is
taken
* Thread A - Takes rtnl lock and invokes iw dev wlan0 del
- Context switch after entering wlan_hdd_del_virtual_intf
before osif_vdev_sync_trans_start_wait
* Thread B - Waits for rtnl lock to be released by Thread A
* Thread A - Waits for driver transition to be completed by Thread B
To avoid this possible scenario, modify the infrastructure such that any
down the tree transitions/operations are rejected if a driver transition
is taking place instead of waiting. Also, modify the corresponding tests
in the DSC unit test framework to correctly verify the changes made.
Change-Id: I61715c8fc2df33fd2deb46389da0375e4df5080c
CRs-Fixed: 2475386
Enter and exit prints are called everytime, causing excessive logging.
To reduce the amount of logs printed, remove the enter and exit print
statements from dsc _dsc_psoc_op_start and _dsc_psoc_op_stop.
Change-Id: Iec53285d0c39243edd6577c57c9d0b15769e1230
CRs-Fixed: 2491091
Add per module logging macros without function/line info
to avoid adding function/line info where it is not required.
Change-Id: I0bd9248122b4f49274ee05a225ce6f880fede0cb
CRs-Fixed: 2468414
dsc_debug() is impacting IPA tput, as
introduced by Ib8e1fc1e16785dfe3c5f8273e4ad8d5d6ecdb6e6.
Disable debug level DSC log in perf-build.
Change-Id: I2a18e44879b9301067844cfc6e56f57bb5588c74
CRs-Fixed: 2435880
Currently, the Driver Synchronization Core (DSC) blocks transitions
up-tree and down-tree from a node currently undergoing a transition, but
only rejects operations down-tree from the current node. Instead, reject
new operations both up-tree and down-tree from the current node under
transition. This provides more forgiving safety guarantees to operation
implementations at the cost of a reduced amount of parallelism that can
be achieved.
Change-Id: I09e1c48f7030a2252380d172c1c00ee22eac39c5
CRs-Fixed: 2421786
A common pattern in WLAN to panic the driver is to log the reason and
then unconditionally panic. QDF_DEBUG_PANIC() takes a reason string to
help make the reason for the panic more obvious, but it is not always
used. Ensure all callers of QDF_DEBUG_PANIC() provide a reason string.
Change-Id: I3d23a8980adaeaa1a9798a4a6b0fba1f36eb52ad
CRs-Fixed: 2403829
Move the contents of hdd_dsc to the new files added in osif/sync as part
of Ica94d32028d10d344294d6cc12d91a06efe1ab6c.
Change-Id: I556e9d2833edd2bd26266496b6000347649c5fbe
CRs-Fixed: 2396512
Very occasionally, the driver transition thread for the DSC race
condition unit test can be preempted before queuing the driver
transition. This leads to the transitions de-queuing in an unexpected
order, causing the test to fail. In order to close the race window, a
thread would have to set its event _after_ blocking on a pending
transition, which is impossible. So, rather than using events to
synchronize the different threads in this test case, use polling to
ensure the different transitions are queued in the appropriate order.
If the given condition is not met, call schedule() to give the other
threads a greater chance to run.
Change-Id: I05edfa9200ca7831926153f3ff0ec9dbbbab3fed
CRs-Fixed: 2378469
The lifetimes of DSC contexts do not fit nicely into the current domain
based dynamic memory leak detection scheme. Instead, allocate psoc and
vdev DSC contexts using the new qdf_talloc() API.
Change-Id: Ib15bd26004c3383e25039f4d17026d3e73f52346
CRs-Fixed: 2360348
Convert the current hard-coded list of unit-test callbacks in
hdd_we_unit_test() to a vtable. This streamlines future additions.
Change-Id: I216bbb6699ae50eaa96ac559999cb42ba080867c
CRs-Fixed: 2358606
DSC panics in debug builds in the event of various timeout events. In
addition to these panics, print the stack trace of the invoking thread
to assist in finding the exact reason for deadlocks.
Change-Id: I69666cfc52fb7ca3638c32212bae3e3c3ddd8366
CRs-Fixed: 2349387
Currently, APIs in the dsc_*_trans_assert() family assert a transition
is in flight on the given node itself. Instead, replace this API family
with another, dsc_*_assert_trans_protected(), which assert a
transition is in flight on the given node or any of its ancestors.
Change-Id: I5fb07000f955a49a4e5529806f4e49d9dbc8acb7
CRs-Fixed: 2347789
In order to catch and debug long running transitions, add a watchdog
timer to Driver Synchronization Core (DSC) transition start/stop call
pairs. If the timer expires, panic the driver for offline debugging.
Change-Id: I9b64fdb9cc20e1225394702d58b24db92a2d67e1
CRs-Fixed: 2328596
In order to catch and debug long waiting transitions, add a watchdog
timer to Driver Synchronization Core (DSC) transition start wait calls.
If the timer expires, panic the driver for offline debugging.
Change-Id: I557f87ada182ced389e7d5e63fe8b78f47e1d6b5
CRs-Fixed: 2328594
In order to catch and debug long running or stuck operations, add a
watchdog timer to Driver Synchronization Core (DSC) operation start/stop
call pairs. If the timer expires, panic the driver for offline
debugging.
Change-Id: If93914178622b993fb09c7330fded2e9bc1c25d1
CRs-Fixed: 2328591
Ic3121092c71d5c46e8521a775281ad2c45e3fe7d changed the driver-level DSC
context allocation method from static to dynamic. As a side effect, the
DSC driver lock needed a driver instance pointer instead of grabbing the
global context. However, many of the lock calls were updated to use the
input context pointer before it was validated.
Ensure the input context pointers are validated before using them to
grab the DSC driver lock.
Change-Id: Ifce2d603f3e9b7b7c0869a40f8632988a9509809
CRs-Fixed: 2327110
The DSC driver context was originally statically allocated to allow its
creation before QDF was initialized. However, other complications with
the QDF debug infrastructure lead to QDF being initialized before DSC
anyway.
Static allocation has a number of drawbacks (esp. see singleton
anit-pattern), which impacts our ability to do unit testing on a driver
which actively leverages DSC. To support unit-testing DSC in a driver
which also uses DSC, move the DSC driver context to dynamic, instead of
static, allocation.
Change-Id: Ic3121092c71d5c46e8521a775281ad2c45e3fe7d
CRs-Fixed: 2320599
The Driver Synchronization Core (DSC) is a set of synchronization
primitives for use by the driver's orchestration layer. It provides APIs
for ensuring safe state transitions (including bring up and tear down)
of major driver objects: a single driver, associated psocs, and their
associated vdevs.
APIs are divided into two categories: mutual exclusion of conflicting
transitions, and operation tracking, blocking, and waiting capabilities.
For part 5, add the unit test implementations.
Change-Id: Ia68d6df18894b254c1f5fe3855d896e96be38a90
CRs-Fixed: 2290260
The Driver Synchronization Core (DSC) is a set of synchronization
primitives for use by the driver's orchestration layer. It provides APIs
for ensuring safe state transitions (including bring up and tear down)
of major driver objects: a single driver, associated psocs, and their
associated vdevs.
APIs are divided into two categories: mutual exclusion of conflicting
transitions, and operation tracking, blocking, and waiting capabilities.
For part 4, add the vdev-level implementation.
Change-Id: I3f5ef0f7abf24a45d757d286d450ef086640c56a
CRs-Fixed: 2290260
The Driver Synchronization Core (DSC) is a set of synchronization
primitives for use by the driver's orchestration layer. It provides APIs
for ensuring safe state transitions (including bring up and tear down)
of major driver objects: a single driver, associated psocs, and their
associated vdevs.
APIs are divided into two categories: mutual exclusion of conflicting
transitions, and operation tracking, blocking, and waiting capabilities.
For part 3, add the psoc-level implementation.
Change-Id: I30406c61e89cc220a2697e13f38289554985a7bf
CRs-Fixed: 2290260
The Driver Synchronization Core (DSC) is a set of synchronization
primitives for use by the driver's orchestration layer. It provides APIs
for ensuring safe state transitions (including bring up and tear down)
of major driver objects: a single driver, associated psocs, and their
associated vdevs.
APIs are divided into two categories: mutual exclusion of conflicting
transitions, and operation tracking, blocking, and waiting capabilities.
For part 2, add the driver-level implementation.
Change-Id: I86630edfe11e89cc035974ae76ed3908cf68cde4
CRs-Fixed: 2290260
The Driver Synchronization Core (DSC) is a set of synchronization
primitives for use by the driver's orchestration layer. It provides APIs
for ensuring safe state transitions (including bring up and tear down)
of major driver objects: a single driver, associated psocs, and their
associated vdevs.
APIs are divided into two categories: mutual exclusion of conflicting
transitions, and operation tracking, blocking, and waiting capabilities.
For part 1, add common infrastructure and headers.
Change-Id: Id290e66d2dccd28b89fed5f285d3692ff3c814e7
CRs-Fixed: 2290260