<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/media/cec/core, branch linux-6.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-09-13T07:48:30Z</updated>
<entry>
<title>media: cec: core: add adap_unconfigured() callback</title>
<updated>2023-09-13T07:48:30Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2023-06-12T13:58:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9fa26c6ac16820d5abaa7cbcbc740d3fd40245ba'/>
<id>urn:sha1:9fa26c6ac16820d5abaa7cbcbc740d3fd40245ba</id>
<content type='text'>
[ Upstream commit 948a77aaecf202f722cf2264025f9987e5bd5c26 ]

The adap_configured() callback was called with the adap-&gt;lock mutex
held if the 'configured' argument was false, and without the adap-&gt;lock
mutex held if that argument was true.

That was very confusing, and so split this up in a adap_unconfigured()
callback and a high-level configured() callback.

This also makes it easier to understand when the mutex is held: all
low-level adap_* callbacks are called with the mutex held. All other
callbacks are called without that mutex held.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Fixes: f1b57164305d ("media: cec: add optional adap_configured callback")
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec: core: add adap_nb_transmit_canceled() callback</title>
<updated>2023-09-13T07:48:30Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2023-06-12T13:58:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=258e4784b8b5e5041f89f2ea68482ebf55502316'/>
<id>urn:sha1:258e4784b8b5e5041f89f2ea68482ebf55502316</id>
<content type='text'>
[ Upstream commit da53c36ddd3f118a525a04faa8c47ca471e6c467 ]

A potential deadlock was found by Zheng Zhang with a local syzkaller
instance.

The problem is that when a non-blocking CEC transmit is canceled by calling
cec_data_cancel, that in turn can call the high-level received() driver
callback, which can call cec_transmit_msg() to transmit a new message.

The cec_data_cancel() function is called with the adap-&gt;lock mutex held,
and cec_transmit_msg() tries to take that same lock.

The root cause is that the received() callback can either be used to pass
on a received message (and then adap-&gt;lock is not held), or to report a
canceled transmit (and then adap-&gt;lock is held).

This is confusing, so create a new low-level adap_nb_transmit_canceled
callback that reports back that a non-blocking transmit was canceled.

And the received() callback is only called when a message is received,
as was the case before commit f9d0ecbf56f4 ("media: cec: correctly pass
on reply results") complicated matters.

Reported-by: Zheng Zhang &lt;zheng.zhang@email.ucr.edu&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Fixes: f9d0ecbf56f4 ("media: cec: correctly pass on reply results")
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec: core: don't set last_initiator if tx in progress</title>
<updated>2023-05-26T09:52:22Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2023-04-24T15:07:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=73af6c7511038249cad3d5f3b44bf8d78ac0f499'/>
<id>urn:sha1:73af6c7511038249cad3d5f3b44bf8d78ac0f499</id>
<content type='text'>
When a message was received the last_initiator is set to 0xff.
This will force the signal free time for the next transmit
to that for a new initiator. However, if a new transmit is
already in progress, then don't set last_initiator, since
that's the initiator of the current transmit. Overwriting
this would cause the signal free time of a following transmit
to be that of the new initiator instead of a next transmit.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec: core: disable adapter in cec_devnode_unregister</title>
<updated>2023-05-26T09:52:05Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2023-04-20T07:26:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe4526d99e2e06b08bb80316c3a596ea6a807b75'/>
<id>urn:sha1:fe4526d99e2e06b08bb80316c3a596ea6a807b75</id>
<content type='text'>
Explicitly disable the CEC adapter in cec_devnode_unregister()

Usually this does not really do anything important, but for drivers
that use the CEC pin framework this is needed to properly stop the
hrtimer. Without this a crash would happen when such a driver is
unloaded with rmmod.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec: core: not all messages were passed on when monitoring</title>
<updated>2023-04-15T06:48:39Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2023-03-24T14:52:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6bade236f14033fa457a9e22ceb8a114a14d90e3'/>
<id>urn:sha1:6bade236f14033fa457a9e22ceb8a114a14d90e3</id>
<content type='text'>
The valid_la boolean is used to check if the destination logical
address is either 15 (broadcast) or our logical address. If it is
for another logical address, then only adapters that have the
CEC_CAP_MONITOR_ALL capability can pass it on.

However, it is also used to do more detailed validity checks,
such as whether the message was broadcast when it should have been
directed, or vice versa, in which case the message must be ignored
according to the spec. But that should not apply to monitoring.

Add a new bool that just checks the LA and nothing else.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec: add support for Absolute Volume Control</title>
<updated>2022-09-24T06:50:04Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2022-08-30T10:37:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=479747caa5bfa94b856bf47249006e6c8aa8be37'/>
<id>urn:sha1:479747caa5bfa94b856bf47249006e6c8aa8be37</id>
<content type='text'>
Add support for this new CEC message. This was added in HDMI 2.1a.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec-adap.c: log when claiming LA fails unexpectedly</title>
<updated>2022-06-20T09:30:30Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2022-05-13T07:54:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=691c3db0dc7616b3cc4ff0f52f956c9afa71b1cd'/>
<id>urn:sha1:691c3db0dc7616b3cc4ff0f52f956c9afa71b1cd</id>
<content type='text'>
If there is a hardware problem such as someone pulling the CEC line low
continuously, then the POLL message will fail with an error other than
OK, NACK, ABORTED or TIMEOUT. Log the tx_status value in that case to
help debug this.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec-adap.c: drop activate_cnt, use state info instead</title>
<updated>2022-05-13T09:29:39Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2022-05-10T08:53:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f9222f8ca18bcb1d55dd749b493b29fd8092fb82'/>
<id>urn:sha1:f9222f8ca18bcb1d55dd749b493b29fd8092fb82</id>
<content type='text'>
Using an activation counter to decide when the enable or disable the
cec adapter is not the best approach and can lead to race conditions.

Change this to determining the current status of the adapter, and
enable or disable the adapter accordingly.

It now only needs to be called whenever there is a chance that the
state changes, and it can handle enabling/disabling monitoring as
well if needed.

This simplifies the code and it should be a more robust approach as well.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec-adap.c: reconfigure if the PA changes during configuration</title>
<updated>2022-05-13T09:29:16Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2022-05-06T12:46:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3891b36364e85914fcb7a535656695a67e876a7'/>
<id>urn:sha1:e3891b36364e85914fcb7a535656695a67e876a7</id>
<content type='text'>
If the physical address changes (i.e. becomes invalid, then valid again)
while the adapter is still claiming free logical addresses, then trigger
a reconfiguration since any claimed LAs may now be stale.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cec-adap.c: fix is_configuring state</title>
<updated>2022-05-13T09:28:54Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2022-05-06T07:43:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59267fc34f4900dcd2ec3295f6be04b79aee2186'/>
<id>urn:sha1:59267fc34f4900dcd2ec3295f6be04b79aee2186</id>
<content type='text'>
If an adapter is trying to claim a free logical address then it is
in the 'is_configuring' state. If during that process the cable is
disconnected (HPD goes low, which in turn invalidates the physical
address), then cec_adap_unconfigure() is called, and that set the
is_configuring boolean to false, even though the thread that's
trying to claim an LA is still running.

Don't touch the is_configuring bool in cec_adap_unconfigure(), it
will eventually be cleared by the thread. By making that change
the cec_config_log_addr() function also had to change: it was
aborting if is_configuring became false (since that is what
cec_adap_unconfigure() did), but that no longer works. Instead
check if the physical address is invalid. That is a much
more appropriate check anyway.

This fixes a bug where the the adapter could be disabled even
though the device was still configuring. This could cause POLL
transmits to time out.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@kernel.org&gt;
</content>
</entry>
</feed>
