<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/media, branch v5.15.72</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.72</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.72'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-01-27T10:02:53+00:00</updated>
<entry>
<title>media: cec: fix a deadlock situation</title>
<updated>2022-01-27T10:02:53+00:00</updated>
<author>
<name>Hans Verkuil</name>
<email>hverkuil-cisco@xs4all.nl</email>
</author>
<published>2021-12-01T12:41:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a0d6e64b3413cfe8e3839444eb45b26b9426d3c7'/>
<id>urn:sha1:a0d6e64b3413cfe8e3839444eb45b26b9426d3c7</id>
<content type='text'>
commit a9e6107616bb8108aa4fc22584a05e69761a91f7 upstream.

The cec_devnode struct has a lock meant to serialize access
to the fields of this struct. This lock is taken during
device node (un)registration and when opening or releasing a
filehandle to the device node. When the last open filehandle
is closed the cec adapter might be disabled by calling the
adap_enable driver callback with the devnode.lock held.

However, if during that callback a message or event arrives
then the driver will call one of the cec_queue_event()
variants in cec-adap.c, and those will take the same devnode.lock
to walk the open filehandle list.

This obviously causes a deadlock.

This is quite easy to reproduce with the cec-gpio driver since that
uses the cec-pin framework which generated lots of events and uses
a kernel thread for the processing, so when adap_enable is called
the thread is still running and can generate events.

But I suspect that it might also happen with other drivers if an
interrupt arrives signaling e.g. a received message before adap_enable
had a chance to disable the interrupts.

This patch adds a new mutex to serialize access to the fhs list.
When adap_enable() is called the devnode.lock mutex is held, but
not devnode.lock_fhs. The event functions in cec-adap.c will now
use devnode.lock_fhs instead of devnode.lock, ensuring that it is
safe to call those functions from the adap_enable callback.

This specific issue only happens if the last open filehandle is closed
and the physical address is invalid. This is not something that
happens during normal operation, but it does happen when monitoring
CEC traffic (e.g. cec-ctl --monitor) with an unconfigured CEC adapter.

Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Cc: &lt;stable@vger.kernel.org&gt;  # for v5.13 and up
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>media: videobuf2: rework vb2_mem_ops API</title>
<updated>2021-11-18T18:16:13+00:00</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>senozhatsky@chromium.org</email>
</author>
<published>2021-09-09T11:24:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e922d0b6e6a67a34a4638681b90955dfd2091991'/>
<id>urn:sha1:e922d0b6e6a67a34a4638681b90955dfd2091991</id>
<content type='text'>
[ Upstream commit a4b83deb3e76fb9385ca58e2c072a145b3a320d6 ]

With the new DMA API we need an extension of the videobuf2 API.
Previously, videobuf2 core would set the non-coherent DMA bit
in the vb2_queue dma_attr field (if user-space would pass a
corresponding memory hint); the vb2 core then would pass the
vb2_queue dma_attrs to the vb2 allocators. The vb2 allocator
would use the queue's dma_attr and the DMA API would allocate
either coherent or non-coherent memory.

But we cannot do this anymore, since there is no corresponding DMA
attr flag and, hence, there is no way for the allocator to become
aware of what type of allocation user-space has requested. So we
need to pass more context from videobuf2 core to the allocators.

Fix this by changing the call_ptr_memop() macro to pass the
vb2 pointer to the corresponding op callbacks.

Signed-off-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l: subdev: Add pre_streamon and post_streamoff callbacks</title>
<updated>2021-08-04T12:43:51+00:00</updated>
<author>
<name>Sakari Ailus</name>
<email>sakari.ailus@linux.intel.com</email>
</author>
<published>2021-06-23T12:44:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=253171a0da67304f0ee7358b37df7b715c65dd77'/>
<id>urn:sha1:253171a0da67304f0ee7358b37df7b715c65dd77</id>
<content type='text'>
Add pre_streamon and post_streamoff callbacks that can be used to set a
CSI-2 transmitter to LP-11 or LP-111 mode. This can be used by receiver
drivers to reliably initialise the receiver when its initialisation
requires software involvement.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: Documentation: media: Fix v4l2-async kerneldoc syntax</title>
<updated>2021-08-04T12:43:50+00:00</updated>
<author>
<name>Sakari Ailus</name>
<email>sakari.ailus@linux.intel.com</email>
</author>
<published>2021-02-08T10:33:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6f8f9fdec8e4615a2cf539bbcad400d4b3a39070'/>
<id>urn:sha1:6f8f9fdec8e4615a2cf539bbcad400d4b3a39070</id>
<content type='text'>
Fix kerneldoc syntax in v4l2-async. The references were not produced
correctly.

Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Reviewed-by: Jacopo Mondi &lt;jacopo@jmondi.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: v4l2-subdev: Fix documentation of the subdev_notifier member</title>
<updated>2021-08-04T12:43:49+00:00</updated>
<author>
<name>Paul Kocialkowski</name>
<email>paul.kocialkowski@bootlin.com</email>
</author>
<published>2021-06-09T11:54:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3609c45b7c207e176bbea3dfc2241c5cc2cf746'/>
<id>urn:sha1:c3609c45b7c207e176bbea3dfc2241c5cc2cf746</id>
<content type='text'>
Fix the name of the function that registers the subdev_notifier member
of the v4l2_subdev structure.

[Sakari Ailus: Drop _sensor from the function name.]

Signed-off-by: Paul Kocialkowski &lt;paul.kocialkowski@bootlin.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: rc: rename s_learning_mode() to s_wideband_receiver()</title>
<updated>2021-07-22T06:21:53+00:00</updated>
<author>
<name>Sean Young</name>
<email>sean@mess.org</email>
</author>
<published>2021-07-03T09:04:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8b777edff097ca9bb564529913f3a934d59112f4'/>
<id>urn:sha1:8b777edff097ca9bb564529913f3a934d59112f4</id>
<content type='text'>
The s_learning_mode() function is called in response to the ioctl
LIRC_SET_WIDEBAND_RECEIVER, so rename it to s_wideband_receiver().

Learning mode is when both the wideband receiver is turned on and
carrier reports are enabled.

Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: rc-loopback: max_timeout of UINT_MAX does not work</title>
<updated>2021-07-22T06:21:03+00:00</updated>
<author>
<name>Sean Young</name>
<email>sean@mess.org</email>
</author>
<published>2021-07-05T17:56:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=50634548d3c360c19013f665964e6c5b8300ff05'/>
<id>urn:sha1:50634548d3c360c19013f665964e6c5b8300ff05</id>
<content type='text'>
Any timeout larger than LIRC_VALUE_MASK cannot work for the lirc uapi.
LIRC_VALUE_MASK is about 16 seconds which is more than enough.

Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: hevc: Add segment address field</title>
<updated>2021-07-12T07:16:32+00:00</updated>
<author>
<name>Jernej Skrabec</name>
<email>jernej.skrabec@gmail.com</email>
</author>
<published>2021-06-06T08:23:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=229e5bdcd39ed3ca0a71dc8500ba4ea90d4415db'/>
<id>urn:sha1:229e5bdcd39ed3ca0a71dc8500ba4ea90d4415db</id>
<content type='text'>
If HEVC frame consists of multiple slices, segment address has to be
known in order to properly decode it.

Add segment address field to slice parameters.

Signed-off-by: Jernej Skrabec &lt;jernej.skrabec@gmail.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: dvbsky: add support for MyGica T230C2_LITE and T230A</title>
<updated>2021-07-12T07:16:29+00:00</updated>
<author>
<name>Ján Čáni</name>
<email>pego149@gmail.com</email>
</author>
<published>2021-06-17T19:59:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=387caebee00671aa6895e7b51056dca1f38e35dd'/>
<id>urn:sha1:387caebee00671aa6895e7b51056dca1f38e35dd</id>
<content type='text'>
Add Geniatech MyGica T230C2_LITE and T230A as many people
are asking support for these devices on forums.

Link: https://lore.kernel.org/linux-media/YMuptIYFLdwSmw//@kali

Signed-off-by: Ján Čáni &lt;pego149@gmail.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: Fix Media Controller API config checks</title>
<updated>2021-06-24T12:26:00+00:00</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2021-06-16T15:19:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=50e7a31d30e8221632675abed3be306382324ca2'/>
<id>urn:sha1:50e7a31d30e8221632675abed3be306382324ca2</id>
<content type='text'>
Smatch static checker warns that "mdev" can be null:

sound/usb/media.c:287 snd_media_device_create()
    warn: 'mdev' can also be NULL

If CONFIG_MEDIA_CONTROLLER is disabled, this file should not be included
in the build.

The below conditions in the sound/usb/Makefile are in place to ensure that
media.c isn't included in the build.

sound/usb/Makefile:
snd-usb-audio-$(CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER) += media.o

select SND_USB_AUDIO_USE_MEDIA_CONTROLLER if MEDIA_CONTROLLER &amp;&amp;
       (MEDIA_SUPPORT=y || MEDIA_SUPPORT=SND_USB_AUDIO)

The following config check in include/media/media-dev-allocator.h is
in place to enable the API only when CONFIG_MEDIA_CONTROLLER and
CONFIG_USB are enabled.

 #if defined(CONFIG_MEDIA_CONTROLLER) &amp;&amp; defined(CONFIG_USB)

This check doesn't work as intended when CONFIG_USB=m. When CONFIG_USB=m,
CONFIG_USB_MODULE is defined and CONFIG_USB is not. The above config check
doesn't catch that CONFIG_USB is defined as a module and disables the API.
This results in sound/usb enabling Media Controller specific ALSA driver
code, while Media disables the Media Controller API.

Fix the problem requires two changes:

1. Change the check to use IS_ENABLED to detect when CONFIG_USB is enabled
   as a module or static. Since CONFIG_MEDIA_CONTROLLER is a bool, leave
   the check unchanged to be consistent with drivers/media/Makefile.

2. Change the drivers/media/mc/Makefile to include mc-dev-allocator.o
   in mc-objs when CONFIG_USB is enabled.

Link: https://lore.kernel.org/alsa-devel/YLeAvT+R22FQ%2FEyw@mwanda/

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
</content>
</entry>
</feed>
