<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/media/platform, branch v6.6.39</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.39</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.39'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-07-11T10:49:04+00:00</updated>
<entry>
<title>media: mediatek: vcodec: Only free buffer VA that is not NULL</title>
<updated>2024-07-11T10:49:04+00:00</updated>
<author>
<name>Fei Shao</name>
<email>fshao@chromium.org</email>
</author>
<published>2023-12-21T09:17:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5c217253c76c94f76d1df31d0bbdcb88dc07be91'/>
<id>urn:sha1:5c217253c76c94f76d1df31d0bbdcb88dc07be91</id>
<content type='text'>
[ Upstream commit eb005c801ec70ff4307727bd3bd6e8280169ef32 ]

In the MediaTek vcodec driver, while mtk_vcodec_mem_free() is mostly
called only when the buffer to free exists, there are some instances
that didn't do the check and triggered warnings in practice.

We believe those checks were forgotten unintentionally. Add the checks
back to fix the warnings.

Signed-off-by: Fei Shao &lt;fshao@chromium.org&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@collabora.com&gt;
Signed-off-by: Sebastian Fricke &lt;sebastian.fricke@collabora.com&gt;
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: mtk-vcodec: potential null pointer deference in SCP</title>
<updated>2024-06-27T11:49:03+00:00</updated>
<author>
<name>Fullway Wang</name>
<email>fullwaywang@outlook.com</email>
</author>
<published>2024-01-18T02:35:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f066882293b5ad359e44c4ed24ab1811ffb0b354'/>
<id>urn:sha1:f066882293b5ad359e44c4ed24ab1811ffb0b354</id>
<content type='text'>
[ Upstream commit 53dbe08504442dc7ba4865c09b3bbf5fe849681b ]

The return value of devm_kzalloc() needs to be checked to avoid
NULL pointer deference. This is similar to CVE-2022-3113.

Link: https://lore.kernel.org/linux-media/PH7PR20MB5925094DAE3FD750C7E39E01BF712@PH7PR20MB5925.namprd20.prod.outlook.com
Signed-off-by: Fullway Wang &lt;fullwaywang@outlook.com&gt;
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: vsp1: Remove unbalanced .s_stream(0) calls</title>
<updated>2024-06-12T09:13:02+00:00</updated>
<author>
<name>Laurent Pinchart</name>
<email>laurent.pinchart+renesas@ideasonboard.com</email>
</author>
<published>2023-10-24T14:18:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2948c1e5d5f42c656c5b9a587766127890df898d'/>
<id>urn:sha1:2948c1e5d5f42c656c5b9a587766127890df898d</id>
<content type='text'>
commit 42d62b7e47d58273c64fc1540e5d81ccfdb60f77 upstream.

The VSP1 driver uses the subdev .s_stream() operation to stop WPF
instances, without a corresponding call to start them. The V4L2 subdev
core started warning about unbalanced .s_stream() calls in commit
009905ec5043 ("media: v4l2-subdev: Document and enforce .s_stream()
requirements"), causing a regression with this driver.

Fix the problem by replacing the .s_stream() operation with an explicit
function call for WPF instances. This allows sharing an additional data
structure between RPF and WPF instances.

Fixes: 009905ec5043 ("media: v4l2-subdev: Document and enforce .s_stream() requirements")
Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Closes: https://lore.kernel.org/linux-media/2221395-6a9b-9527-d697-e76aebc6af@linux-m68k.org/
Signed-off-by: Laurent Pinchart &lt;laurent.pinchart+renesas@ideasonboard.com&gt;
Tested-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>media: sunxi: a83-mips-csi2: also select GENERIC_PHY</title>
<updated>2024-06-12T09:12:43+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2023-09-27T04:04:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=75aafce64a3a777d3d96546607ceb9058066d8b1'/>
<id>urn:sha1:75aafce64a3a777d3d96546607ceb9058066d8b1</id>
<content type='text'>
[ Upstream commit 8237026159cb6760ad22e28d57b9a1c53b612d3a ]

When selecting GENERIC_PHY_MIPI_DPHY, also select GENERIC_PHY to
prevent kconfig warnings:

WARNING: unmet direct dependencies detected for GENERIC_PHY_MIPI_DPHY
  Depends on [n]: GENERIC_PHY [=n]
  Selected by [y]:
  - VIDEO_SUN8I_A83T_MIPI_CSI2 [=y] &amp;&amp; MEDIA_SUPPORT [=y] &amp;&amp; MEDIA_PLATFORM_SUPPORT [=y] &amp;&amp; MEDIA_PLATFORM_DRIVERS [=y] &amp;&amp; V4L_PLATFORM_DRIVERS [=y] &amp;&amp; VIDEO_DEV [=y] &amp;&amp; (ARCH_SUNXI || COMPILE_TEST [=y]) &amp;&amp; PM [=y] &amp;&amp; COMMON_CLK [=y] &amp;&amp; RESET_CONTROLLER [=y]

Fixes: 94d7fd9692b5 ("media: sunxi: Depend on GENERIC_PHY_MIPI_DPHY")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/r/ZQ/WS8HC1A3F0Qn8@rli9-mobl
Link: https://lore.kernel.org/linux-media/20230927040438.5589-1-rdunlap@infradead.org

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
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: mediatek: vcodec: fix possible unbalanced PM counter</title>
<updated>2024-06-12T09:12:41+00:00</updated>
<author>
<name>Eugen Hristev</name>
<email>eugen.hristev@collabora.com</email>
</author>
<published>2023-12-28T11:32:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c73d3273272b319db4ecda1f3304060b04af010b'/>
<id>urn:sha1:c73d3273272b319db4ecda1f3304060b04af010b</id>
<content type='text'>
[ Upstream commit c28d4921a1e3ce0a0374b7e9d68593be8802c42a ]

It is possible that mtk_vcodec_enc_pw_on fails, and in that scenario
the PM counter is not incremented, and subsequent call to
mtk_vcodec_enc_pw_off decrements the counter, leading to a PM imbalance.
Fix by bailing out of venc_if_encode in the case when mtk_vcodec_enc_pw_on
fails.

Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver")
Signed-off-by: Eugen Hristev &lt;eugen.hristev@collabora.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Andrzej Pietrasiewicz &lt;andrzej.p@collabora.com&gt;
Signed-off-by: Sebastian Fricke &lt;sebastian.fricke@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: mediatek: vcodec: add encoder power management helper functions</title>
<updated>2024-06-12T09:12:41+00:00</updated>
<author>
<name>Irui Wang</name>
<email>irui.wang@mediatek.com</email>
</author>
<published>2023-09-25T04:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f29a42642069d9f8ffa432a70c8c3576b077424c'/>
<id>urn:sha1:f29a42642069d9f8ffa432a70c8c3576b077424c</id>
<content type='text'>
[ Upstream commit 3568cb6556695af163e930a75b1ed8f6dfa848ba ]

Remove PM functions at start/stop streaming, add PM helper functions
to get PM before encoding frame start and put PM after encoding frame
done. Meanwhile, remove unnecessary clock operations.

Signed-off-by: Irui Wang &lt;irui.wang@mediatek.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Stable-dep-of: c28d4921a1e3 ("media: mediatek: vcodec: fix possible unbalanced PM counter")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: cadence: csi2rx: configure DPHY before starting source stream</title>
<updated>2024-06-12T09:12:05+00:00</updated>
<author>
<name>Pratyush Yadav</name>
<email>p.yadav@ti.com</email>
</author>
<published>2024-02-23T08:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=205b6dd5b7990d06d681ebda890a7c119236e8f4'/>
<id>urn:sha1:205b6dd5b7990d06d681ebda890a7c119236e8f4</id>
<content type='text'>
[ Upstream commit fd64dda48f7e3f67ada1e1fe47e784ab350da72e ]

When the source device is operating above 1.5 Gbps per lane, it needs to
send the Skew Calibration Sequence before sending any HS data. If the
DPHY is initialized after the source stream is started, then it might
miss the sequence and not be able to receive data properly. Move the
start of source subdev to the end of the sequence to make sure
everything is ready to receive data before the source starts streaming.

Signed-off-by: Pratyush Yadav &lt;p.yadav@ti.com&gt;
Fixes: 3295cf1241d3 ("media: cadence: Add support for external dphy")
Tested-by: Julien Massot &lt;julien.massot@collabora.com&gt;
Tested-by: Changhuang Liang &lt;Changhuang.liang@starfivetech.com&gt;
Reviewed-by: Julien Massot &lt;julien.massot@collabora.com&gt;
Reviewed-by: Changhuang Liang &lt;Changhuang.liang@starfivetech.com&gt;
Signed-off-by: Jai Luthra &lt;j-luthra@ti.com&gt;
Signed-off-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: rcar-vin: work around -Wenum-compare-conditional warning</title>
<updated>2024-06-12T09:12:01+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2024-03-22T13:33:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d8076c9e02bbf28f277a5b42ac2073dc6c6785cf'/>
<id>urn:sha1:d8076c9e02bbf28f277a5b42ac2073dc6c6785cf</id>
<content type='text'>
[ Upstream commit 1a742c6010d136cb6c441a0f1dd2bfbfae3c4df2 ]

clang-19 warns about mixing two enum types here:

drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional]
drivers/media/platform/renesas/rcar-vin/rcar-core.c:216:18: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional]
drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional]
drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional]

This one is intentional, and there is already a cast to work around another
warning, so address this by adding another cast.

Fixes: 406bb586dec0 ("media: rcar-vin: Add r8a779a0 support")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Niklas Söderlund &lt;niklas.soderlund+renesas@ragnatech.se&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: mediatek: vcodec: adding lock to protect encoder context list</title>
<updated>2024-04-13T11:07:40+00:00</updated>
<author>
<name>Yunfei Dong</name>
<email>yunfei.dong@mediatek.com</email>
</author>
<published>2024-03-14T12:30:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=41671f0c0182b2bae74ca7e3b0f155559e3e2fc5'/>
<id>urn:sha1:41671f0c0182b2bae74ca7e3b0f155559e3e2fc5</id>
<content type='text'>
[ Upstream commit afaaf3a0f647a24a7bf6a2145d8ade37baaf75ad ]

Add a lock for the ctx_list, to avoid accessing a NULL pointer
within the 'vpu_enc_ipi_handler' function when the ctx_list has
been deleted due to an unexpected behavior on the SCP IP block.

Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder")
Signed-off-by: Yunfei Dong &lt;yunfei.dong@mediatek.com&gt;
Reviewed-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Sebastian Fricke &lt;sebastian.fricke@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: mediatek: vcodec: adding lock to protect decoder context list</title>
<updated>2024-04-13T11:07:40+00:00</updated>
<author>
<name>Yunfei Dong</name>
<email>yunfei.dong@mediatek.com</email>
</author>
<published>2024-03-14T12:30:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a2dc707aa42214f9c4827bd57e344e29a0841d6'/>
<id>urn:sha1:0a2dc707aa42214f9c4827bd57e344e29a0841d6</id>
<content type='text'>
[ Upstream commit 6467cda18c9f9b5f2f9a0aa1e2861c653e41f382 ]

Add a lock for the ctx_list, to avoid accessing a NULL pointer
within the 'vpu_dec_ipi_handler' function when the ctx_list has
been deleted due to an unexpected behavior on the SCP IP block.

Hardware name: Google juniper sku16 board (DT)
pstate: 20400005 (nzCv daif +PAN -UAO -TCO BTYPE=--)
pc : vpu_dec_ipi_handler+0x58/0x1f8 [mtk_vcodec_dec]
lr : scp_ipi_handler+0xd0/0x194 [mtk_scp]
sp : ffffffc0131dbbd0
x29: ffffffc0131dbbd0 x28: 0000000000000000
x27: ffffff9bb277f348 x26: ffffff9bb242ad00
x25: ffffffd2d440d3b8 x24: ffffffd2a13ff1d4
x23: ffffff9bb7fe85a0 x22: ffffffc0133fbdb0
x21: 0000000000000010 x20: ffffff9b050ea328
x19: ffffffc0131dbc08 x18: 0000000000001000
x17: 0000000000000000 x16: ffffffd2d461c6e0
x15: 0000000000000242 x14: 000000000000018f
x13: 000000000000004d x12: 0000000000000000
x11: 0000000000000001 x10: fffffffffffffff0
x9 : ffffff9bb6e793a8 x8 : 0000000000000000
x7 : 0000000000000000 x6 : 000000000000003f
x5 : 0000000000000040 x4 : fffffffffffffff0
x3 : 0000000000000020 x2 : ffffff9bb6e79080
x1 : 0000000000000010 x0 : ffffffc0131dbc08
Call trace:
vpu_dec_ipi_handler+0x58/0x1f8 [mtk_vcodec_dec (HASH:6c3f 2)]
scp_ipi_handler+0xd0/0x194 [mtk_scp (HASH:7046 3)]
mt8183_scp_irq_handler+0x44/0x88 [mtk_scp (HASH:7046 3)]
scp_irq_handler+0x48/0x90 [mtk_scp (HASH:7046 3)]
irq_thread_fn+0x38/0x94
irq_thread+0x100/0x1c0
kthread+0x140/0x1fc
ret_from_fork+0x10/0x30
Code: 54000088 f94ca50a eb14015f 54000060 (f9400108)
---[ end trace ace43ce36cbd5c93 ]---
Kernel panic - not syncing: Oops: Fatal exception
SMP: stopping secondary CPUs
Kernel Offset: 0x12c4000000 from 0xffffffc010000000
PHYS_OFFSET: 0xffffffe580000000
CPU features: 0x08240002,2188200c
Memory Limit: none

Fixes: 655b86e52eac ("media: mediatek: vcodec: Fix possible invalid memory access for decoder")
Signed-off-by: Yunfei Dong &lt;yunfei.dong@mediatek.com&gt;
Reviewed-by: Nicolas Dufresne &lt;nicolas.dufresne@collabora.com&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Signed-off-by: Sebastian Fricke &lt;sebastian.fricke@collabora.com&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
