aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin/stackcollapse-record
diff options
context:
space:
mode:
authorKiran K <[email protected]>2021-08-16 05:07:47 +0530
committerMarcel Holtmann <[email protected]>2021-08-16 18:04:23 +0200
commitecb71f2566673553bc067e5b0036756871d0b9d3 (patch)
tree9513dedd4d026f232947452601b3ee9bb0ed8e16 /tools/perf/scripts/python/bin/stackcollapse-record
parent192aa65ac00ce0bc70c3f271cf3ee030acc0655a (diff)
Bluetooth: Fix race condition in handling NOP command
For NOP command, need to cancel work scheduled on cmd_timer, on receiving command status or commmand complete event. Below use case might lead to race condition multiple when NOP commands are queued sequentially: hci_cmd_work() { if (atomic_read(&hdev->cmd_cnt) { . . . atomic_dec(&hdev->cmd_cnt); hci_send_frame(hdev,...); schedule_delayed_work(&hdev->cmd_timer,...); } } On receiving event for first NOP, the work scheduled on hdev->cmd_timer is not cancelled and second NOP is dequeued and sent to controller. While waiting for an event for second NOP command, work scheduled on cmd_timer for the first NOP can get scheduled, resulting in sending third NOP command (sending back to back NOP commands). This might cause issues at controller side (like memory overrun, controller going unresponsive) resulting in hci tx timeouts, hardware errors etc. The fix to this issue is to cancel the delayed work scheduled on cmd_timer on receiving command status or command complete event for NOP command (this patch handles NOP command same as any other SIG command). Signed-off-by: Kiran K <[email protected]> Reviewed-by: Chethan T N <[email protected]> Reviewed-by: Srivatsa Ravishankar <[email protected]> Acked-by: Manish Mandlik <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions