linux/drivers/media/platform/verisilicon
Ming Qian e8d97c270c media: verisilicon: Fix kernel panic due to __initconst misuse
Fix a kernel panic when probing the driver as a module:

  Unable to handle kernel paging request at virtual address
  ffffd9c18eb05000
  of_find_matching_node_and_match+0x5c/0x1a0
  hantro_probe+0x2f4/0x7d0 [hantro_vpu]

The imx8mq_vpu_shared_resources array is referenced by variant
structures through their shared_devices field. When built as a
module, __initconst causes this data to be freed after module
init, but it's later accessed during probe, causing a page fault.

The imx8mq_vpu_shared_resources is referenced from non-init code,
so keeping __initconst or __initconst_or_module here is wrong.

Drop the __initconst annotation and let it live in the normal .rodata
section.

A bug of __initconst called from regular non-init probe code
leading to bugs during probe deferrals or during unbind-bind cycles.

Reported-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Closes: https://lore.kernel.org/all/68ef934f-baa0-4bf6-93d8-834bbc441e66@kernel.org/
Reported-by: Franz Schnyder <franz.schnyder@toradex.com>
Closes: https://lore.kernel.org/all/n3qmcb62tepxltoskpf7ws6yiirc2so62ia23b42rj3wlmpl67@rvkbuirx7kkp/
Fixes: e0203ddf9a ("media: verisilicon: Avoid G2 bus error while decoding H.264 and HEVC")
Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Suggested-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Cc: stable@kernel.org
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
2026-03-18 13:17:25 +01:00
..
hantro_drv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hantro_g1_h264_dec.c media: verisilicon: Fix some typos 2024-02-05 12:57:44 +01:00
hantro_g1_mpeg2_dec.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
hantro_g1_regs.h media: verisilicon: postproc: 4K support 2025-07-12 08:34:48 +02:00
hantro_g1_vp8_dec.c
hantro_g1.c
hantro_g2_hevc_dec.c media: verisilicon: Protect G2 HEVC decoder against invalid DPB index 2025-10-20 09:23:17 +02:00
hantro_g2_regs.h media: verisilicon: Fix CPU stalls on G2 bus error 2025-10-20 09:23:17 +02:00
hantro_g2_vp9_dec.c media: verisilicon: Fix CPU stalls on G2 bus error 2025-10-20 09:23:17 +02:00
hantro_g2.c media: verisilicon: Fix CPU stalls on G2 bus error 2025-10-20 09:23:17 +02:00
hantro_h1_jpeg_enc.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
hantro_h1_regs.h media: verisilicon: Correct a typo in H1_REG_MAD_CTRL_MAD_THRESHOLD 2024-05-02 13:12:14 +01:00
hantro_h264.c media: verisilicon: Use __set_bit() with local bitmaps 2025-06-20 13:20:17 +02:00
hantro_hevc.c media: verisilicon: Add reference buffer compression feature 2024-08-28 10:01:10 +02:00
hantro_hw.h media: verisilicon: Fix CPU stalls on G2 bus error 2025-10-20 09:23:17 +02:00
hantro_jpeg.c media: verisilicon : Use exported tables from v4l2-jpeg for hantro codec 2024-06-24 11:05:07 +02:00
hantro_jpeg.h
hantro_mpeg2.c
hantro_postproc.c media: verisilicon: postproc: 4K support 2025-07-12 08:34:48 +02:00
hantro_v4l2.c media: verisilicon: Explicitly disable selection api ioctls for decoders 2025-09-04 10:37:05 +02:00
hantro_v4l2.h media: verisilicon: Conditionally ignore native formats 2023-06-09 16:20:21 +01:00
hantro_vp8.c
hantro_vp9.c
hantro_vp9.h
hantro.h media: verisilicon: Avoid G2 bus error while decoding H.264 and HEVC 2026-01-05 15:56:31 +01:00
imx8m_vpu_hw.c media: verisilicon: Fix kernel panic due to __initconst misuse 2026-03-18 13:17:25 +01:00
Kconfig media: verisilicon: Add reference buffer compression feature 2024-08-28 10:01:10 +02:00
Makefile media: verisilicon: Move Rockchip AV1 hardware drivers to the corresponding option 2024-08-25 08:15:24 +02:00
rockchip_av1_entropymode.c media: verisilicon: Add AV1 entropy helpers 2023-06-09 16:17:20 +01:00
rockchip_av1_entropymode.h media: verisilicon: Add AV1 entropy helpers 2023-06-09 16:17:20 +01:00
rockchip_av1_filmgrain.c media: platform: use capital "OR" for multiple licenses in SPDX 2023-09-27 09:39:56 +02:00
rockchip_av1_filmgrain.h media: verisilicon: Add film grain feature to AV1 driver 2023-06-09 16:19:27 +01:00
rockchip_vpu_hw.c media: verisilicon: Fix AV1 decoder clock frequency 2025-06-20 13:20:17 +02:00
rockchip_vpu2_hw_h264_dec.c media: verisilicon: Fix some typos 2024-02-05 12:57:44 +01:00
rockchip_vpu2_hw_jpeg_enc.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
rockchip_vpu2_hw_mpeg2_dec.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
rockchip_vpu2_hw_vp8_dec.c
rockchip_vpu2_regs.h
rockchip_vpu981_hw_av1_dec.c media: verisilicon: AV1: Fix tile info buffer size 2026-01-21 14:43:09 +01:00
rockchip_vpu981_regs.h media: verisilicon: AV1: Correct some sizes/positions on register fields 2024-08-25 08:15:24 +02:00
sama5d4_vdec_hw.c
stm32mp25_vpu_hw.c media: hantro: add support for STM32MP25 VENC 2024-02-01 11:12:04 +01:00
sunxi_vpu_hw.c