diff options
| author | Hans Verkuil <hansverk@cisco.com> | 2016-12-09 12:00:49 -0200 |
|---|---|---|
| committer | Ray Zhang <rayz@codeaurora.org> | 2017-05-25 11:22:21 +0800 |
| commit | 359324cb0fb43223affc06f19f29b43abe125152 (patch) | |
| tree | 1ec1503e86fb4a5fe36e69f4c0f43c50ca02a643 /tools/perf/scripts/python | |
| parent | 27d4bcaf69caf9b15e3b49916d685da9ef1e367f (diff) | |
[media] cec: fix race between configuring and unconfiguring
This race was discovered by running cec-compliance -A with the cec module debug
parameter set to 2: suddenly the test would fail.
It turns out that this happens when the test configures the adapter in
non-blocking mode, then it waits for the CEC_EVENT_STATE_CHANGE event and once
the event is received it unconfigures the adapter.
What happened was that the unconfigure was executed while the configure was
still transmitting the Report Features and Report Physical Address messages.
This messed up the internal state of the cec_adapter.
The fix is to transmit those messages with the adap->lock mutex held (this will
just queue them up in the internal transmit queue, and not actually transmit
anything yet). Only unlock the mutex once everything is done. The main thread
will dequeue the messages from the internal transmit queue and transmit them
one by one, unless an unconfigure was done, and in that case any messages are
just dropped.
Change-Id: I554811aa51e6781e6f9141d59f38d7c540ed5b10
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Git-commit: f60f35609f89ef4fee73776bc1ef697923251995
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
