Commit Graph

35 Commits

Author SHA1 Message Date
Vivek
97f44cd39e qcacmn: Add API to configure scheduler watchdog timeout
The scheduler watchdog timeout is currently fixed at 10secs.
There are few customer use cases, where the CPU is busy for
sometime and the scheduler message processing is taking longer than
the coinfigured watchdog timeout value.

Add a new API to be able to configure this value different than the
default as per the requirement.

CRs-Fixed: 2834194
Change-Id: I976f1f0ad17f09cf3960f99ad80226d775b8b2f2
2020-12-09 23:54:46 -08:00
Lincoln Tran
a86b23ee68 qcacmn: Update scheduler_msg callback type
This fixes a CFI failure in callback assignment.

Currently, the callbacks in scheduler_msg are void function
pointers. Update them to have a defined type as
scheduler_msg_process_fn_t to catch type mismatch during
compilation.

Other changes to conform to this new type include:
	1. Cast callback to qdf_mc_timer_callback_t when
	   referencing, and back when assigning
	2. Cast wlan_serialization_generic_timer_cb to
	   take fit into scheduler_msg
	3. Cast target_if_vdev_mgr_rsp_timer_cb to fit
	   into scheduler_msg

Change-Id: I052bc54826d377ae92f5bcc80ca08afb6f5e01e3
CRs-fixed: 2719975
2020-06-27 06:18:28 -07:00
Vivek
f28396d060 qcacmn: Add API to print scheduler history
The scheduler maintains a history of the recent messages
in the scheduler that were queued, started or completed execution.

This information can be reviewed while debugging issues
if the scheduler is taking longer to process any message.

The new API will print the scheduler history on request.

Change-Id: I2ed7989296f6891cfd9779e7b96383253d680f51
CRs-Fixed: 2599281
2020-02-11 21:53:15 -08:00
Neha Bisht
503663c6da qcacmn: Structure optimized through poke-a-hole tool
Structure memory is being optimized by aligning field with
bus address length using pokeahole tool.
This patch optimizes structure linked in obj_mgr and scheduler
modules.
Structure           Bytes saved (64bit)   Bytes saved (32bit)
scheduler_ctx       8 bytes               4 bytes
wlan_channel        8 bytes               8 bytes

Change-Id: I298946b55328d8d9b564c140e0a59e0b8702fab0
CRs-Fixed: 2587842
2020-01-11 16:18:50 -08:00
sheenam monga
dd4dc88b83 qcacmn: CONFIG_MCL cleanup for msg queue depth and reduction limit
Remove CONFIG_MCL for Serialization msg queue depth and reduction limit to
make code generic. In case SCHEDULER_CORE_MAX_MESSAGES not defined, then
define SCHEDULER_CORE_MAX_MESSAGES to 4000 for WIN . If
WLAN_SCHED_REDUCTION_LIMIT not defined for MCL then define
WLAN_SCHED_REDUCTION_LIMIT to 32 for WIN .

Change-Id: If64f117f6f0af56f6a9e1041e583b022c6c419fb
CRs-Fixed: 2457723
2019-05-27 06:07:20 -07:00
Ashish Kumar Dhanotiya
ad85c38928 qcacmn: Update driver timer APIs according to kernel 4.19
There are some changes to timer APIs in latest kernel,
update driver APIs accordingly to invoke correct kernel
APIs for timer functionalities.

Change-Id: Ie017c8b1ef8237ca34f696c23509519a1187167c
CRs-fixed: 2383574
2019-02-02 15:27:54 -08:00
Vivek
fa47688f04 qcacmn: Change max scheduler buffers for WIN
Since the usage of the scheduler for WIN,
is now not limited only to scan component alone and
would be used by the new converged MLME also for few specific cases,
we need to increase the size of max scheduler buffers to 4K.

Change-Id: I11818c311b39c42ffda5a79eb7b7137dcb491649
CRs-Fixed: 2387644
2019-01-30 02:32:18 -08:00
Santosh Anbu
6e2fed8f5f qcacmn: Add scheduler mq handler for mlme
Add mlme message queue handler as the call back for non scan commands
getting activated in the scheduler context.
Add cmd already exists enum to be returned if the command already exists
in the serialization queue.

Change-Id: I24fe453ffddbd4341459874458f11688adebc740
CRs-Fixed: 2377219
2019-01-22 05:06:24 -08:00
Madhvapathi Sriram
1397a33f48 qcacmn: Optimize schedule msg post error logging
This change will reduce the repeated logging of scheduler posts

Change-Id: I26c297d2d3def55377f062a2de94f61cf09522de
CRs-Fixed: 2373005
2019-01-22 02:37:53 -08:00
Dustin Brown
dae10a5fbc qcacmn: Add queue information to scheduler history
In order to triage latency issues in the scheduler thread, track which
queue a message was queue in, when each message was queued, how long it
spent in queue, and the depth of the queue at the point of insertion.

Change-Id: I83edd04e668d5a2674ca71495fc904092b3ab800
CRs-Fixed: 2322561
2018-10-03 11:48:07 -07:00
gaurank kathpalia
302a1d9701 qcacmn: Add support for que_id in scheduler
Currently the scheduler cant differentiate between
the destination, and que to which it has to post the
message.

Add que_id, to differentiate between the destination
and que.

Change-Id: I94f81cb4b976dba4571f9cd0d6e059dc72024fcd
CRs-Fixed: 2308108
2018-09-11 03:49:11 -07:00
gaurank kathpalia
6e4b9c54b6 qcacmn: Add support for src, dest in scheduler
Currently the scheduler is unaware of the source module
which posts the message to another layer.

To trace the src, dest, and the message under ML
logging, modify current infra, to include the src,
dest in the qip argument of the API
scheduler_post_msg_by_priority

Change-Id: Ia234f60cc33fcc37ab741c462052a6e50993e3bd
CRs-Fixed: 2300537
2018-08-23 15:25:42 -07:00
Vignesh Viswanathan
87a8e44583 qcacmn: Drop beacon/probe frames posted on Scan Queue if queue is full
Drop beacon/probe frames before posting on Scan queue if the queue
already has too many beacon/probes to process.

Also add scheduler API to get the queue size given the module ID.

Change-Id: I9153c7e77e74377863774b68e8163839e992358d
CRs-Fixed: 2298584
2018-08-21 01:51:29 -07:00
Nirav Shah
1b9674e21e qcacmn: umac: Add logging macros without function/line info
Add per module logging macros without function/line info
to avoid adding function/line info where it is not required.

Change-Id: I34ba6f6485f9b506264daf4e116052d2858bed40
CRs-Fixed: 2278876
2018-08-14 21:44:21 -07:00
Nirav Shah
a175314c51 qcacmn: Map all module logs to per-level log APIs
Map all module level log APIs to per-level log APIs
to compile out specific log level if required.

Change-Id: I4072b6740cb43200fd95c40943b66e1d5f8f1847
CRs-Fixed: 2266719
2018-07-13 10:36:22 -07:00
Dustin Brown
92d87f5161 qcacmn: Remove SYS_MSG_ID_MC_THR_PROBE
SYS_MSG_ID_MC_THR_PROBE is no longer used. Remove it from scheduler.

Change-Id: I23504da35778a54404e57df27ff4fa9100fa0cf3
CRs-Fixed: 2250404
2018-06-05 15:57:50 -07:00
Dustin Brown
c7ee85c4a8 qcacmn: Use qdf_flex_mem for scheduler messages
Currently, the scheduler thread keeps a large, pre-allocated array of
messages for use in message posting. The vast majority of the time,
however, the scheduler thread has zero or one messages pending in the
queue. This leads to a huge memory overhead for nominal driver
operation.

Replace the current pre-allocated scheduler message pool with a
hybrid static/dynamic approach.

Change-Id: Ie942bacfef43edf142a9f35ad0309069096cda90
CRs-Fixed: 2204172
2018-05-21 21:48:10 -07:00
Vivek
d78dedc9dd qcacmn: Configure qdf_flex_mem segments for scheduler pool
Configure the qdf_flex_mem segments for scheduler pool
to 32, which creates 1024 scheduler message buffers
during init.

Change-Id: Iefa9427b55b427f79aa21a90cbf6e8a05be35e59
CRs-Fixed:
2018-05-21 21:48:06 -07:00
Jeff Johnson
4865edfd19 qcacmn: scheduler: Fix misspelling of "message"
Address the following issue in scheduler_api.h:
CHECK: 'mesage' may be misspelled - perhaps 'message'?

Change-Id: Iaf5138f335be1dad2db2e3c52ffd47e28da21251
CRs-Fixed: 2241581
2018-05-19 19:40:36 -07:00
Vignesh Viswanathan
6ecd284e5a qcacmn: Add handlers for scan queue in scheduler core
Add scheduler message handler function for QDF_MODULE_ID_SCAN queue.

Also post scan beacon/probe frames and scan events to SCAN queue instead
of TARGET_IF queue.

Change-Id: I94e3ea2f0eb5c9592f5cfcd91738778fa65ba815
CRs-Fixed: 2214554
2018-04-23 00:30:55 -07:00
Dustin Brown
c8e2987f93 qcacmn: Reduce SCHEDULER_CORE_MAX_MESSAGES to 1000
After profiling many iterations of several driver operations, the
observed absolute maximum number of queue scheduler messages was 452
during soft AP startup. Typical maximums for this test case are less
than 100, occasionally getting as high as 250. The median for all of
the driver operations in general were in the range of 1-2. Given this
information, a round number around twice the worst case rate was
picked.

Reduce SCHEDULER_CORE_MAX_MESSAGES to 1000, down from 8000 for MCL.
This saves a significant amount of unused statically allocated memory.

Change-Id: I6ef65db84ca524cea68afbc3bb49347c6d996992
CRs-Fixed: 2202692
2018-03-12 22:00:46 -07:00
Dustin Brown
3149adf58a qcacmn: Migrate scheduler logging functions
Part of the scheduler component has been migrated to the new sched_*
logging wrappers, but part of it still remains to be ported. Finish
migrating all of the scheduler logging APIs.

Change-Id: I5065d849a1523d6c27d6c6a27b1ad4605036c3e6
CRs-Fixed: 2201038
2018-03-09 13:39:51 -08:00
Vivek
f227fb7417 qcacmn: Reduce the number of scheduler message buffers for WIN
Reduced the number of scheduler message buffers for WIN to
2k from 4k since WIN is only using 2 scheduler queues.

Changed the order of two members of scheduler messgae structure
to avoid additional padding on 64bit platform.

Change-Id: Ic74d60878867c45413bc4fbd5c56feb4dd421699
CRs-Fixed: 2157621
2018-01-09 06:12:44 -08:00
Dustin Brown
e0c9f6699f qcacmn: split scheduler init/deinit
A commonly used and robust life-cycle pattern consists of the following
4 steps:

	1) create (allocate resources)
	2) start (mark resources as safe for use)
	3) stop (mark resources as unsafe for use)
	4) destroy (deallocate resources)

This pattern effectively prevents access to uninitialized and freed
resources. While the dispatcher psoc life-cycle follows this pattern,
the global life-cycle is condensed into steps 1 and 4. Unsurprisingly,
this led to uninitialized and freed resource access problems, especially
in regards to the scheduler thread.

Split the scheduler init and deinit life-cycle functions into init,
enable, disable, and deinit. Create new global enable and disable
dispatcher functions, and call the new scheduler APIs as appropriate.
This brings the global dispatcher life-cycle in line with the existing
psoc life-cycle, and prevents many scheduler related resource access
issues.

Change-Id: I58b65be0611f48e48354f28c221185f6f490f30c
CRs-Fixed: 2153283
2017-12-15 05:25:35 -08:00
Naveen Rawat
c3b7a68d54 qcacmn: Add SYS_MSG_ID_UMAC_STOP system message
Add SYS_MSG_ID_UMAC_STOP to allow umac close to be done in
mc thread context.

Change-Id: I11946ce7aa21ce96f71d604244b9981dcae9704a
CRs-Fixed: 2156189
2017-12-15 03:42:16 -08:00
Dustin Brown
91abaccb45 qcacmn: Use sched logging helpers in scheduler_api.c
A set of logging helpers for the scheduler component were previously
added to reduce boilerplate logging code. Update scheduler_api.c to use
the new logging helpers.

Change-Id: I45715e40dbdd5a94d064ca4c64290a443cacea34
CRs-Fixed: 2152575
2017-12-11 22:08:30 -08:00
Poddar, Siddarth
5c57a8905e qcacmn: Add register/deregister data stall detect cb api
Add register and deregister data stall detect callback apis.

Change-Id: I59d5871b7ec03da4b4f69d87b14f7eb5e8606c4a
CRs-Fixed: 2090654
2017-10-06 12:27:19 -07:00
Jeff Johnson
9b24afb720 qcacmn: Remove obsolete START and STOP SYS_MSG_IDs
The SYS_MSG_ID_MC_START and SYS_MSG_ID_MC_STOP message IDs are no
longer being used. so remove them.

Change-Id: I8d35a537ac2c2f7436b23033561e5d0ef09895df
CRs-Fixed: 2107075
2017-09-12 23:27:33 -07:00
Rajeev Kumar
e7e6e37448 qcacmn: Properly format new line spacing in scheduler_api.h
In scheudler_api.h properly format new line spacing between functions
and include files.

Change-Id: I7960ea7aeec3aef9c50a4a39efcd9db4d6f3951f
CRs-Fixed: 2051329
2017-05-30 17:31:20 -07:00
Dustin Brown
e1d3d092f6 qcacmn: Add scheduler logging macros
To reduce boilerplate code, add standard logging macros to the scheduler
module.

Change-Id: I478ec2d16d340f419135101704f0ab3a5bf0b4d8
CRs-Fixed: 2042761
2017-05-19 23:58:21 -07:00
Dustin Brown
e226cebdd2 qcacmn: Add Scheduler Watchdog Timer
In order to catch long running scheduler messages, start a watchdog
timer before processing each message, and stop the timer after each
message is processed. When the watchdog timer expires, immediately
crash the device in debug builds for easier debugging.

Change-Id: I4b43a9e12fc1f5b8a795fec790fe7548a100d9db
CRs-Fixed: 2037094
2017-04-26 17:01:52 -07:00
Rajeev Kumar
928e3ecad0 qcacmn: Add provision for flush callback in scheduler message
Add provision for flush callback in scheduler message such that
during driver unload scheduler can invoke the flush callback and
components can release the common object ref count which is taken
before posting the message.

Change-Id: I28490e18247239af27feef3a4b53e5080ab012fc
CRs-Fixed: 2034772
2017-04-18 17:13:14 -07:00
Krunal Soni
dce49ecf59 qcacmn: Deregister legacy & target queue callbacks upon scheduler down
Driver is missing couple of deregister handler while bringing down the
scheduler.

Change-Id: I99fe6e9a5d3cac800154945e41e707ebb7ee6396
CRs-Fixed: 2001133
2017-02-07 15:02:27 -08:00
Rajeev Kumar
73c05a8087 qcacmn: Add changes to detect if scheduler thread is stuck
Scheduler thread can get stuck because of many reasons like
mutex deadlock, resource starvation etc. Add changes to detect
if scheduler thread is stuck.

Change-Id: Ib9d4e3b240077464b3a51ab6be6af728cb845bfe
CRs-Fixed: 1107636
2017-01-10 18:20:24 -08:00
Rajeev Kumar
cd39549564 qcacmn: Rename control path scheduler from sch to scheduler
Legacy protocol engine already has a module name 'sch' rename
control path scheduler from sch to scheduler to avoid naming
conflict with protocol sch.

Change-Id: I94ce9aa5037aa75319aaad2287116462444c03f4
CRs-Fixed: 1105115
2016-12-27 16:37:34 -08:00