linux-stable/drivers/gpu/drm
Dmitry Baryshkov a4e771729a drm/probe_helper: sort out poll_running vs poll_enabled
There are two flags attemting to guard connector polling:
poll_enabled and poll_running. While poll_enabled semantics is clearly
defined and fully adhered (mark that drm_kms_helper_poll_init() was
called and not finalized by the _fini() call), the poll_running flag
doesn't have such clearliness.

This flag is used only in drm_helper_probe_single_connector_modes() to
guard calling of drm_kms_helper_poll_enable, it doesn't guard the
drm_kms_helper_poll_fini(), etc. Change it to only be set if the polling
is actually running. Tie HPD enablement to this flag.

This fixes the following warning reported after merging the HPD series:

Hot plug detection already enabled
WARNING: CPU: 2 PID: 9 at drivers/gpu/drm/drm_bridge.c:1257 drm_bridge_hpd_enable+0x94/0x9c [drm]
Modules linked in: videobuf2_memops snd_soc_simple_card snd_soc_simple_card_utils fsl_imx8_ddr_perf videobuf2_common snd_soc_imx_spdif adv7511 etnaviv imx8m_ddrc imx_dcss mc cec nwl_dsi gov
CPU: 2 PID: 9 Comm: kworker/u8:0 Not tainted 6.2.0-rc2-15208-g25b283acd578 #6
Hardware name: NXP i.MX8MQ EVK (DT)
Workqueue: events_unbound deferred_probe_work_func
pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : drm_bridge_hpd_enable+0x94/0x9c [drm]
lr : drm_bridge_hpd_enable+0x94/0x9c [drm]
sp : ffff800009ef3740
x29: ffff800009ef3740 x28: ffff000009331f00 x27: 0000000000001000
x26: 0000000000000020 x25: ffff800001148ed8 x24: ffff00000a8fe000
x23: 00000000fffffffd x22: ffff000005086348 x21: ffff800001133ee0
x20: ffff00000550d800 x19: ffff000005086288 x18: 0000000000000006
x17: 0000000000000000 x16: ffff8000096ef008 x15: 97ffff2891004260
x14: 2a1403e194000000 x13: 97ffff2891004260 x12: 2a1403e194000000
x11: 7100385f29400801 x10: 0000000000000aa0 x9 : ffff800008112744
x8 : ffff000000250b00 x7 : 0000000000000003 x6 : 0000000000000011
x5 : 0000000000000000 x4 : ffff0000bd986a48 x3 : 0000000000000001
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000250000
Call trace:
 drm_bridge_hpd_enable+0x94/0x9c [drm]
 drm_bridge_connector_enable_hpd+0x2c/0x3c [drm_kms_helper]
 drm_kms_helper_poll_enable+0x94/0x10c [drm_kms_helper]
 drm_helper_probe_single_connector_modes+0x1a8/0x510 [drm_kms_helper]
 drm_client_modeset_probe+0x204/0x1190 [drm]
 __drm_fb_helper_initial_config_and_unlock+0x5c/0x4a4 [drm_kms_helper]
 drm_fb_helper_initial_config+0x54/0x6c [drm_kms_helper]
 drm_fbdev_client_hotplug+0xd0/0x140 [drm_kms_helper]
 drm_fbdev_generic_setup+0x90/0x154 [drm_kms_helper]
 dcss_kms_attach+0x1c8/0x254 [imx_dcss]
 dcss_drv_platform_probe+0x90/0xfc [imx_dcss]
 platform_probe+0x70/0xcc
 really_probe+0xc4/0x2e0
 __driver_probe_device+0x80/0xf0
 driver_probe_device+0xe0/0x164
 __device_attach_driver+0xc0/0x13c
 bus_for_each_drv+0x84/0xe0
 __device_attach+0xa4/0x1a0
 device_initial_probe+0x1c/0x30
 bus_probe_device+0xa4/0xb0
 deferred_probe_work_func+0x90/0xd0
 process_one_work+0x200/0x474
 worker_thread+0x74/0x43c
 kthread+0xfc/0x110
 ret_from_fork+0x10/0x20
---[ end trace 0000000000000000 ]---

Reported-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Fixes: c8268795c9 ("drm/probe-helper: enable and disable HPD on connectors")
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Acked-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Tested-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Tested-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230124104548.3234554-2-dmitry.baryshkov@linaro.org
(cherry picked from commit d33a54e399)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
2023-02-07 15:07:52 +01:00
..
amd Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
arm drm/arm/komeda: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:30 +01:00
armada drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function 2023-01-26 08:52:31 +01:00
aspeed drm/aspeed: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
ast drm/ast: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
atmel-hlcdc drm: atmel-hlcdc: Remove #ifdef guards for PM related functions 2022-12-12 12:30:56 +00:00
bridge drm-misc-next for $kernel-version: 2023-01-24 17:36:29 +01:00
display Merge tag 'amd-drm-next-6.3-2023-01-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-next 2023-01-30 15:37:57 +10:00
etnaviv MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
exynos drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function 2023-01-26 08:52:31 +01:00
fsl-dcu hardening updates for v6.2-rc1 2022-12-14 12:20:00 -08:00
gma500 drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function 2023-01-26 08:52:31 +01:00
gud drm/gud: use new debugfs device-centered functions 2023-01-06 16:15:08 -03:00
hisilicon drm: Only select I2C_ALGOBIT for drivers that actually need it 2023-01-10 11:15:44 +01:00
hyperv drm/fb-helper: Remove unnecessary include statements 2022-11-05 17:12:04 +01:00
i2c drm-misc-next for $kernel-version: 2023-01-24 17:36:29 +01:00
i915 Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
imx drm/imx/dcss: Don't call dev_set_drvdata(..., NULL); 2023-01-10 16:26:06 +02:00
ingenic drm/ingenic: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
kmb drm/kmb: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
lib
lima Linux 6.1-rc6 2022-11-24 11:05:43 +10:00
logicvc drm/logicvc: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
mcde drm/fb-helper: Move generic fbdev emulation into separate source file 2022-11-05 17:12:04 +01:00
mediatek drm-misc-next for v6.3: 2023-01-04 14:59:25 +01:00
meson Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
mgag200 drm: Only select I2C_ALGOBIT for drivers that actually need it 2023-01-10 11:15:44 +01:00
msm Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
mxsfb drm/mxsfb: improve clk handling for axi clk 2023-01-10 11:04:56 +01:00
nouveau Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
omapdrm drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function 2023-01-26 08:52:31 +01:00
panel drm/panel: Add driver for the AUO A030JTN01 TFT LCD 2023-01-22 11:25:06 +00:00
panfrost Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
pl111 drm/fb-helper: Move generic fbdev emulation into separate source file 2022-11-05 17:12:04 +01:00
qxl drm/qxl: stop using ttm_bo_wait 2022-12-19 09:50:06 +01:00
radeon drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function 2023-01-26 08:52:31 +01:00
rcar-du Renesas R-Car DU fixes and improvements 2023-01-30 13:49:56 +10:00
rockchip drm/rockchip: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:31 +01:00
scheduler drm/scheduler: deprecate drm_sched_resubmit_jobs 2023-01-18 12:46:52 +01:00
shmobile drm/shmobile: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
solomon drm/ssd130x: Silence a `dubious: x & !y` warning 2023-01-24 11:02:33 +01:00
sprd drm/sprd: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
sti hardening updates for v6.2-rc1 2022-12-14 12:20:00 -08:00
stm drm/fb-helper: Move generic fbdev emulation into separate source file 2022-11-05 17:12:04 +01:00
sun4i drm/sun4i: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
tegra drm/tegra: Changes for v6.3-rc1 2023-01-30 14:24:52 +10:00
tests Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
tidss drm/tidss: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
tilcdc drm: tilcdc: Remove #ifdef guards for PM related functions 2022-12-12 13:07:02 +00:00
tiny drm/simpledrm: Fix an NULL vs IS_ERR() bug 2023-02-01 11:16:46 +01:00
ttm Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
tve200 drm/fb-helper: Move generic fbdev emulation into separate source file 2022-11-05 17:12:04 +01:00
udl drm/udl: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
v3d drm/v3d: replace open-coded implementation of drm_gem_object_lookup 2023-01-03 18:16:01 -01:00
vboxvideo drm/vboxvideo: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:32 +01:00
vc4 drm/vc4: allow DRM_VC4_KUNIT_TEST to be a loadable module 2023-02-02 13:37:26 +01:00
vgem
virtio Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
vkms drm/vkms: reintroduce prepare_fb and cleanup_fb functions 2023-01-12 09:46:19 -01:00
vmwgfx Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
xen xen: branch for v6.2-rc4 2023-01-12 17:02:20 -06:00
xlnx drm-misc-next for 6.2: 2022-11-16 07:17:32 +10:00
Kconfig drm: Add comments to Kconfig 2023-01-13 09:44:53 +01:00
Makefile drm-misc-next for $kernel-version: 2023-01-24 17:36:29 +01:00
drm_agpsupport.c
drm_aperture.c
drm_atomic.c drm: use new debugfs device-centered functions on DRM core files 2022-12-22 14:58:21 -03:00
drm_atomic_helper.c drm/atomic-helper: Add {begin,end}_fb_access to plane helpers 2022-11-08 17:10:27 +01:00
drm_atomic_state_helper.c drm/atomic-helper: fix kernel-doc problems 2023-01-19 09:16:04 +01:00
drm_atomic_uapi.c drm/connector: Add TV standard property 2022-11-24 12:42:39 +01:00
drm_auth.c
drm_blend.c drm/drm_blend: Remove usage of deprecated DRM_DEBUG_ATOMIC 2023-01-10 16:14:13 +01:00
drm_bridge.c drm/bridge: Document the expected behaviour of DSI host controllers 2022-12-08 09:56:57 +01:00
drm_bridge_connector.c drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd() 2023-01-05 15:08:10 +01:00
drm_buddy.c drm: Optimize drm buddy top-down allocation method 2023-01-12 13:50:28 +01:00
drm_bufs.c drm/nouveau: Remove support for legacy contexts/buffers 2023-01-13 09:22:02 +01:00
drm_cache.c
drm_client.c drm/client: Add hotplug_failed flag 2023-01-26 08:52:26 +01:00
drm_client_modeset.c drm/client: Remove match on mode name 2022-11-24 12:42:40 +01:00
drm_color_mgmt.c
drm_connector.c drm/edid: parse VICs from CTA VDB early 2023-01-19 10:53:24 +02:00
drm_context.c drm/nouveau: Remove support for legacy contexts/buffers 2023-01-13 09:22:02 +01:00
drm_crtc.c
drm_crtc_helper.c drm/fb-helper: Remove unnecessary include statements 2022-11-05 17:12:04 +01:00
drm_crtc_helper_internal.h
drm_crtc_internal.h drm/edid: move edid load declarations to internal header 2022-10-26 09:53:56 +03:00
drm_damage_helper.c
drm_debugfs.c drm/debugfs: use octal permissions instead of symbolic permissions 2023-01-10 09:57:05 -03:00
drm_debugfs_crc.c
drm_displayid.c
drm_dma.c
drm_drv.c drm-misc-next for v6.3: 2023-01-04 14:59:25 +01:00
drm_dumb_buffers.c
drm_edid.c drm/edid: remove redundant _drm_connector_update_edid_property() 2023-01-23 11:46:50 +02:00
drm_edid_load.c drm/edid/firmware: stop using a throwaway platform device 2022-11-16 14:54:44 +02:00
drm_encoder.c
drm_encoder_slave.c
drm_fb_dma_helper.c
drm_fb_helper.c Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
drm_fbdev_generic.c Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
drm_file.c drm-misc-next for v6.3: 2023-01-16 15:33:28 +10:00
drm_flip_work.c
drm_format_helper.c drm/format-helper: Support the AB24/XB24 formats 2023-01-23 15:02:41 +01:00
drm_fourcc.c drm/fourcc: Add missing big-endian XRGB1555 and RGB565 formats 2022-11-23 20:34:46 +01:00
drm_framebuffer.c drm: use new debugfs device-centered functions on DRM core files 2022-12-22 14:58:21 -03:00
drm_gem.c drm/gem-shmem: When drm_gem_object_init failed, should release object 2022-11-21 16:55:52 +01:00
drm_gem_atomic_helper.c drm/simple-kms: Remove drm_gem_simple_display_pipe_prepare_fb() 2022-12-05 13:35:37 +01:00
drm_gem_dma_helper.c drm: Remove usage of deprecated DRM_DEBUG_PRIME 2023-01-10 16:14:13 +01:00
drm_gem_framebuffer_helper.c drm/fb-helper: Remove unnecessary include statements 2022-11-05 17:12:04 +01:00
drm_gem_shmem_helper.c drm/shmem: Cleanup drm_gem_shmem_create_with_handle() 2023-02-01 11:18:15 +01:00
drm_gem_ttm_helper.c drm/ttm: merge ttm_bo_api.h and ttm_bo_driver.h v2 2022-12-06 12:54:14 +01:00
drm_gem_vram_helper.c drm: use new debugfs device-centered functions on DRM core files 2022-12-22 14:58:21 -03:00
drm_hashtab.c
drm_internal.h drm/debugfs: create debugfs late register functions 2022-12-22 14:58:55 -03:00
drm_ioc32.c drm: Replace DRM_DEBUG with drm_dbg_core in file and ioctl handling 2023-01-03 18:20:57 +01:00
drm_ioctl.c drm: Replace DRM_DEBUG with drm_dbg_core in file and ioctl handling 2023-01-03 18:20:57 +01:00
drm_irq.c
drm_kms_helper_common.c
drm_lease.c drm: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:30 +01:00
drm_legacy.h
drm_legacy_misc.c
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c drm/mipi-dbi: Support separate I/O regulator 2022-12-14 14:57:09 +01:00
drm_mipi_dsi.c drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightness 2023-01-19 08:21:56 +01:00
drm_mm.c
drm_mode_config.c drm/debugfs: create debugfs late register functions 2022-12-22 14:58:55 -03:00
drm_mode_object.c
drm_modes.c drm: Include <linux/of.h> where needed 2023-01-13 13:18:35 +01:00
drm_modeset_helper.c drm/plane-helper: Provide DRM_PLANE_NON_ATOMIC_FUNCS initializer macro 2022-09-20 09:42:31 +02:00
drm_modeset_lock.c
drm_of.c
drm_panel.c
drm_panel_orientation_quirks.c Linux 6.2-rc6 2023-01-31 12:23:23 +01:00
drm_pci.c
drm_plane.c drm/docs: Explicitly document default CRTC background behavior 2023-01-04 16:12:15 +00:00
drm_plane_helper.c drm: Remove unnecessary include statements for drm_crtc_helper.h 2023-01-18 09:25:30 +01:00
drm_prime.c drm: Assert held reservation lock for dma-buf mmapping 2022-11-11 23:49:47 +03:00
drm_print.c drm_print: add _ddebug descriptor to drm_*dbg prototypes 2022-09-24 15:02:02 +02:00
drm_privacy_screen.c
drm_privacy_screen_x86.c
drm_probe_helper.c drm/probe_helper: sort out poll_running vs poll_enabled 2023-02-07 15:07:52 +01:00
drm_property.c
drm_rect.c gpu/drm: fix repeated words in comments 2022-10-24 09:27:04 +02:00
drm_scatter.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c drm/simple-kms: Remove drm_gem_simple_display_pipe_prepare_fb() 2022-12-05 13:35:37 +01:00
drm_syncobj.c
drm_sysfs.c Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
drm_trace.h
drm_trace_points.c
drm_vblank.c
drm_vblank_work.c
drm_vm.c
drm_vma_manager.c drm/drm_vma_manager: Add drm_vma_node_allow_once() 2023-01-19 14:16:55 +01:00
drm_writeback.c