mirror_ubuntu-kernels/drivers/gpu/drm/bridge
Alvin Šipraga 40cdb02cb9
drm: bridge: adv7511: unregister cec i2c device after cec adapter
cec_unregister_adapter() assumes that the underlying adapter ops are
callable. For example, if the CEC adapter currently has a valid physical
address, then the unregistration procedure will invalidate the physical
address by setting it to f.f.f.f. Whence the following kernel oops
observed after removing the adv7511 module:

    Unable to handle kernel execution of user memory at virtual address 0000000000000000
    Internal error: Oops: 86000004 [#1] PREEMPT_RT SMP
    Call trace:
     0x0
     adv7511_cec_adap_log_addr+0x1ac/0x1c8 [adv7511]
     cec_adap_unconfigure+0x44/0x90 [cec]
     __cec_s_phys_addr.part.0+0x68/0x230 [cec]
     __cec_s_phys_addr+0x40/0x50 [cec]
     cec_unregister_adapter+0xb4/0x118 [cec]
     adv7511_remove+0x60/0x90 [adv7511]
     i2c_device_remove+0x34/0xe0
     device_release_driver_internal+0x114/0x1f0
     driver_detach+0x54/0xe0
     bus_remove_driver+0x60/0xd8
     driver_unregister+0x34/0x60
     i2c_del_driver+0x2c/0x68
     adv7511_exit+0x1c/0x67c [adv7511]
     __arm64_sys_delete_module+0x154/0x288
     invoke_syscall+0x48/0x100
     el0_svc_common.constprop.0+0x48/0xe8
     do_el0_svc+0x28/0x88
     el0_svc+0x1c/0x50
     el0t_64_sync_handler+0xa8/0xb0
     el0t_64_sync+0x15c/0x160
    Code: bad PC value
    ---[ end trace 0000000000000000 ]---

Protect against this scenario by unregistering i2c_cec after
unregistering the CEC adapter. Duly disable the CEC clock afterwards
too.

Fixes: 3b1b975003 ("drm: adv7511/33: add HDMI CEC support")
Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220612144854.2223873-3-alvin@pqrs.dk
2022-07-07 12:57:41 +02:00
..
adv7511 drm: bridge: adv7511: unregister cec i2c device after cec adapter 2022-07-07 12:57:41 +02:00
analogix drm/bridge: anx7625: Add wait_hpd_asserted() callback 2022-07-06 15:19:55 +02:00
cadence drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
imx drm: Remove linux/i2c.h from drm_crtc.h 2022-07-05 21:15:23 +03:00
synopsys drm: Remove linux/i2c.h from drm_crtc.h 2022-07-05 21:15:23 +03:00
cdns-dsi.c drm/bridge: cdns-dsi: Add support for pre_enable and post_enable control functions. 2022-05-11 14:26:13 +02:00
chipone-icn6211.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
chrontel-ch7033.c drm: Remove linux/i2c.h from drm_crtc.h 2022-07-05 21:15:23 +03:00
cros-ec-anx7688.c drm/bridge: Add ChromeOS EC ANX7688 bridge driver support 2021-05-18 16:41:01 +02:00
display-connector.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
fsl-ldb.c drm/bridge: fsl-ldb: Enable split mode for LVDS dual link 2022-07-06 15:33:14 +02:00
ite-it6505.c drm/bridge: it6505: Send DPCD SET_POWER to downstream 2022-05-02 16:36:23 +02:00
ite-it66121.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
Kconfig drm/bridge: imx: Add i.MX8qm/qxp pixel combiner support 2022-06-20 21:15:07 +02:00
lontium-lt8912b.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
lontium-lt9211.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
lontium-lt9611.c drm: Remove linux/i2c.h from drm_crtc.h 2022-07-05 21:15:23 +03:00
lontium-lt9611uxc.c drm: Remove linux/i2c.h from drm_crtc.h 2022-07-05 21:15:23 +03:00
lvds-codec.c drm/bridge: lvds-codec: Add support for pixel data sampling edge select 2021-12-16 09:37:41 +01:00
Makefile drm/bridge: imx: Add i.MX8qm/qxp pixel combiner support 2022-06-20 21:15:07 +02:00
megachips-stdpxxxx-ge-b850v3-fw.c drm/bridge: megachips: Ensure both bridges are probed before registration 2021-11-25 12:51:47 +01:00
nwl-dsi.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
nwl-dsi.h drm/bridge: Add NWL MIPI DSI host controller support 2020-04-09 15:52:47 +02:00
nxp-ptn3460.c drm/bridge: nxp-ptn3460: switch to devm_drm_of_get_bridge 2022-03-08 12:07:09 +01:00
panel.c drm: Config orientation property if panel provides it 2022-06-21 08:52:59 -07:00
parade-ps8622.c drm/bridge: parade-ps8622: Use backlight helper 2022-06-24 21:58:29 +02:00
parade-ps8640.c drm/bridge: parade-ps8640: Provide wait_hpd_asserted() in struct drm_dp_aux 2022-06-21 09:06:53 -07:00
sii902x.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
sii9234.c drm: bridge: Pass drm_display_info to drm_bridge_funcs .mode_valid() 2020-06-23 19:53:27 +02:00
sil-sii8620.c drm: bridge: sii8620: fix possible off-by-one 2022-07-04 20:38:34 +02:00
sil-sii8620.h
simple-bridge.c drm: Drop drm_edid.h from drm_crtc.h 2022-06-20 23:53:55 +03:00
tc358762.c drm/bridge: tc358762: drop connector field 2022-04-26 14:04:11 +02:00
tc358764.c drm: Remove linux/fb.h from drm_crtc.h 2022-07-05 21:14:02 +03:00
tc358767.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
tc358768.c drm/bridge: tc358768: Correct BTACNTRL1 programming 2021-10-19 11:40:02 +02:00
tc358775.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
thc63lvd1024.c drm/bridge: thc63lvd1024: Fix regulator_get_optional() misuse 2021-01-05 07:19:48 +02:00
ti-dlpc3433.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
ti-sn65dsi83.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
ti-sn65dsi86.c drm/bridge: ti-sn65dsi86: Use atomic variants of drm_bridge_funcs 2022-07-06 17:08:03 +02:00
ti-tfp410.c drm: Remove linux/media-bus-format.h from drm_crtc.h 2022-07-05 21:15:13 +03:00
ti-tpd12s015.c drm/bridge: tpd12s015: Fix irq registering in tpd12s015_probe 2020-11-05 22:09:09 +01:00