Skip to content
Snippets Groups Projects
  1. Mar 11, 2025
    • Imre Deak's avatar
      drm/dp_mst: Fix locking when skipping CSN before topology probing · 12d8f318
      Imre Deak authored
      
      The handling of the MST Connection Status Notify message is skipped if
      the probing of the topology is still pending. Acquiring the
      drm_dp_mst_topology_mgr::probe_lock for this in
      drm_dp_mst_handle_up_req() is problematic: the task/work this function
      is called from is also responsible for handling MST down-request replies
      (in drm_dp_mst_handle_down_rep()). Thus drm_dp_mst_link_probe_work() -
      holding already probe_lock - could be blocked waiting for an MST
      down-request reply while drm_dp_mst_handle_up_req() is waiting for
      probe_lock while processing a CSN message. This leads to the probe
      work's down-request message timing out.
      
      A scenario similar to the above leading to a down-request timeout is
      handling a CSN message in drm_dp_mst_handle_conn_stat(), holding the
      probe_lock and sending down-request messages while a second CSN message
      sent by the sink subsequently is handled by drm_dp_mst_handle_up_req().
      
      Fix the above by moving the logic to skip the CSN handling to
      drm_dp_mst_process_up_req(). This function is called from a work
      (separate from the task/work handling new up/down messages), already
      holding probe_lock. This solves the above timeout issue, since handling
      of down-request replies won't be blocked by probe_lock.
      
      Fixes: ddf98348 ("drm/dp_mst: Skip CSN if topology probing is not done yet")
      Cc: Wayne Lin <Wayne.Lin@amd.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: stable@vger.kernel.org # v6.6+
      Reviewed-by: default avatarWayne Lin <Wayne.Lin@amd.com>
      Reviewed-by: Lyude Paul's avatarLyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20250307183152.3822170-1-imre.deak@intel.com
  2. Mar 10, 2025
  3. Mar 07, 2025
  4. Mar 06, 2025
  5. Mar 03, 2025
  6. Feb 27, 2025
  7. Feb 26, 2025
  8. Feb 25, 2025
  9. Feb 20, 2025
  10. Feb 19, 2025
  11. Feb 14, 2025
  12. Feb 13, 2025
  13. Feb 09, 2025
    • Arnd Bergmann's avatar
      drm/hisilicon/hibmc: select CONFIG_DRM_DISPLAY_DP_HELPER · 9ab127a1
      Arnd Bergmann authored and Dmitry Baryshkov's avatar Dmitry Baryshkov committed
      
      Without the DP helper code, the newly added displayport support
      causes a link failure:
      
      x86_64-linux-ld: drivers/gpu/drm/hisilicon/hibmc/dp/dp_aux.o: in function `hibmc_dp_aux_init':
      dp_aux.c:(.text+0x37e): undefined reference to `drm_dp_aux_init'
      x86_64-linux-ld: drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.o: in function `hibmc_dp_link_set_pattern':
      dp_link.c:(.text+0xae): undefined reference to `drm_dp_dpcd_write'
      x86_64-linux-ld: drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.o: in function `hibmc_dp_link_get_adjust_train':
      dp_link.c:(.text+0x121): undefined reference to `drm_dp_get_adjust_request_voltage'
      x86_64-linux-ld: dp_link.c:(.text+0x12e): undefined reference to `drm_dp_get_adjust_request_pre_emphasis'
      x86_64-linux-ld: drivers/gpu/drm/hisilicon/hibmc/dp/dp_link.o: in function `hibmc_dp_link_training':
      dp_link.c:(.text+0x2b0): undefined reference to `drm_dp_dpcd_write'
      x86_64-linux-ld: dp_link.c:(.text+0x2e3): undefined reference to `drm_dp_dpcd_write'
      
      Add both DRM_DISPLAY_DP_HELPER and DRM_DISPLAY_HELPER, which is
      in turn required by the former.
      
      Fixes: 0ab6ea26 ("drm/hisilicon/hibmc: add dp module in hibmc")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20250127071059.617567-1-arnd@kernel.org
      
      
      Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      9ab127a1
  14. Feb 07, 2025
    • Su Hui's avatar
      drm/panthor: avoid garbage value in panthor_ioctl_dev_query() · 3b32b7f6
      Su Hui authored and Boris Brezillon's avatar Boris Brezillon committed
      
      'priorities_info' is uninitialized, and the uninitialized value is copied
      to user object when calling PANTHOR_UOBJ_SET(). Using memset to initialize
      'priorities_info' to avoid this garbage value problem.
      
      Fixes: f70000ef ("drm/panthor: Add DEV_QUERY_GROUP_PRIORITIES_INFO dev query")
      Signed-off-by: default avatarSu Hui <suhui@nfschina.com>
      Reviewed-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
      Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
      Reviewed-by: default avatarSteven Price <steven.price@arm.com>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20250119025828.1168419-1-suhui@nfschina.com
      3b32b7f6
    • Rupinderjit Singh's avatar
      gpu: host1x: Fix a use of uninitialized mutex · 02458fbf
      Rupinderjit Singh authored
      
      commit c8347f91 ("gpu: host1x: Fix boot regression for Tegra")
      caused a use of uninitialized mutex leading to below warning when
      CONFIG_DEBUG_MUTEXES and CONFIG_DEBUG_LOCK_ALLOC are enabled.
      
      [   41.662843] ------------[ cut here ]------------
      [   41.663012] DEBUG_LOCKS_WARN_ON(lock->magic != lock)
      [   41.663035] WARNING: CPU: 4 PID: 794 at kernel/locking/mutex.c:587 __mutex_lock+0x670/0x878
      [   41.663458] Modules linked in: rtw88_8822c(+) bluetooth(+) rtw88_pci rtw88_core mac80211 aquantia libarc4 crc_itu_t cfg80211 tegra194_cpufreq dwmac_tegra(+) arm_dsu_pmu stmmac_platform stmmac pcs_xpcs rfkill at24 host1x(+) tegra_bpmp_thermal ramoops reed_solomon fuse loop nfnetlink xfs mmc_block rpmb_core ucsi_ccg ina3221 crct10dif_ce xhci_tegra ghash_ce lm90 sha2_ce sha256_arm64 sha1_ce sdhci_tegra pwm_fan sdhci_pltfm sdhci gpio_keys rtc_tegra cqhci mmc_core phy_tegra_xusb i2c_tegra tegra186_gpc_dma i2c_tegra_bpmp spi_tegra114 dm_mirror dm_region_hash dm_log dm_mod
      [   41.665078] CPU: 4 UID: 0 PID: 794 Comm: (udev-worker) Not tainted 6.11.0-29.31_1538613708.el10.aarch64+debug #1
      [   41.665838] Hardware name: NVIDIA NVIDIA Jetson AGX Orin Developer Kit/Jetson, BIOS 36.3.0-gcid-35594366 02/26/2024
      [   41.672555] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [   41.679636] pc : __mutex_lock+0x670/0x878
      [   41.683834] lr : __mutex_lock+0x670/0x878
      [   41.688035] sp : ffff800084b77090
      [   41.691446] x29: ffff800084b77160 x28: ffffdd4bebf7b000 x27: ffffdd4be96b1000
      [   41.698799] x26: 1fffe0002308361c x25: 1ffff0001096ee18 x24: 0000000000000000
      [   41.706149] x23: 0000000000000000 x22: 0000000000000002 x21: ffffdd4be6e3c7a0
      [   41.713500] x20: ffff800084b770f0 x19: ffff00011841b1e8 x18: 0000000000000000
      [   41.720675] x17: 0000000000000000 x16: 0000000000000000 x15: 0720072007200720
      [   41.728023] x14: 0000000000000000 x13: 0000000000000001 x12: ffff6001a96eaab3
      [   41.735375] x11: 1fffe001a96eaab2 x10: ffff6001a96eaab2 x9 : ffffdd4be4838bbc
      [   41.742723] x8 : 00009ffe5691554e x7 : ffff000d4b755593 x6 : 0000000000000001
      [   41.749985] x5 : ffff000d4b755590 x4 : 1fffe0001d88f001 x3 : dfff800000000000
      [   41.756988] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000ec478000
      [   41.764251] Call trace:
      [   41.766695]  __mutex_lock+0x670/0x878
      [   41.770373]  mutex_lock_nested+0x2c/0x40
      [   41.774134]  host1x_intr_start+0x54/0xf8 [host1x]
      [   41.778863]  host1x_runtime_resume+0x150/0x228 [host1x]
      [   41.783935]  pm_generic_runtime_resume+0x84/0xc8
      [   41.788485]  __rpm_callback+0xa0/0x478
      [   41.792422]  rpm_callback+0x15c/0x1a8
      [   41.795922]  rpm_resume+0x698/0xc08
      [   41.799597]  __pm_runtime_resume+0xa8/0x140
      [   41.803621]  host1x_probe+0x810/0xbc0 [host1x]
      [   41.807909]  platform_probe+0xcc/0x1a8
      [   41.811845]  really_probe+0x188/0x800
      [   41.815347]  __driver_probe_device+0x164/0x360
      [   41.819810]  driver_probe_device+0x64/0x1a8
      [   41.823834]  __driver_attach+0x180/0x490
      [   41.827773]  bus_for_each_dev+0x104/0x1a0
      [   41.831797]  driver_attach+0x44/0x68
      [   41.835296]  bus_add_driver+0x23c/0x4e8
      [   41.839235]  driver_register+0x15c/0x3a8
      [   41.843170]  __platform_register_drivers+0xa4/0x208
      [   41.848159]  tegra_host1x_init+0x4c/0xff8 [host1x]
      [   41.853147]  do_one_initcall+0xd4/0x380
      [   41.856997]  do_init_module+0x1dc/0x698
      [   41.860758]  load_module+0xc70/0x1300
      [   41.864435]  __do_sys_init_module+0x1a8/0x1d0
      [   41.868721]  __arm64_sys_init_module+0x74/0xb0
      [   41.873183]  invoke_syscall.constprop.0+0xdc/0x1e8
      [   41.877997]  do_el0_svc+0x154/0x1d0
      [   41.881671]  el0_svc+0x54/0x140
      [   41.884820]  el0t_64_sync_handler+0x120/0x130
      [   41.889285]  el0t_64_sync+0x1a4/0x1a8
      [   41.892960] irq event stamp: 69737
      [   41.896370] hardirqs last  enabled at (69737): [<ffffdd4be6d7768c>] _raw_spin_unlock_irqrestore+0x44/0xe8
      [   41.905739] hardirqs last disabled at (69736): [<ffffdd4be59dcd40>] clk_enable_lock+0x98/0x198
      [   41.914314] softirqs last  enabled at (68082): [<ffffdd4be466b1d0>] handle_softirqs+0x4c8/0x890
      [   41.922977] softirqs last disabled at (67945): [<ffffdd4be44f02a4>] __do_softirq+0x1c/0x28
      [   41.931289] ---[ end trace 0000000000000000 ]---
      
      Inside the probe function when pm_runtime_enable() is called,
      the PM core invokes a resume callback if the device Host1x is
      in a suspended state. As it can be seen in the logs above,
      this leads to host1x_intr_start() function call which is
      trying to acquire a mutex lock. But, the function
      host_intr_init() only gets called after the pm_runtime_enable()
      where mutex is initialised leading to the use of mutex
      prior to its initialisation.
      
      Fix this by moving the mutex initialisation prior to the runtime
      PM enablement function pm_runtime_enable() in probe.
      
      Fixes: c8347f91 ("gpu: host1x: Fix boot regression for Tegra")
      Signed-off-by: default avatarRupinderjit Singh <rusingh@redhat.com>
      Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Link: https://patchwork.ozlabs.org/project/linux-tegra/patch/20250206155803.201942-1-rusingh@redhat.com/
      02458fbf
  15. Feb 06, 2025
  16. Feb 04, 2025
  17. Feb 03, 2025
  18. Jan 31, 2025
    • Hans Verkuil's avatar
      gpu: drm_dp_cec: fix broken CEC adapter properties check · 6daaae5f
      Hans Verkuil authored and Dmitry Baryshkov's avatar Dmitry Baryshkov committed
      
      If the hotplug detect of a display is low for longer than one second
      (configurable through drm_dp_cec_unregister_delay), then the CEC adapter
      is unregistered since we assume the display was disconnected. If the
      HPD went low for less than one second, then we check if the properties
      of the CEC adapter have changed, since that indicates that we actually
      switch to new hardware and we have to unregister the old CEC device and
      register a new one.
      
      Unfortunately, the test for changed properties was written poorly, and
      after a new CEC capability was added to the CEC core code the test always
      returned true (i.e. the properties had changed).
      
      As a result the CEC device was unregistered and re-registered for every
      HPD toggle. If the CEC remote controller integration was also enabled
      (CONFIG_MEDIA_CEC_RC was set), then the corresponding input device was
      also unregistered and re-registered. As a result the input device in
      /sys would keep incrementing its number, e.g.:
      
      /sys/devices/pci0000:00/0000:00:08.1/0000:e7:00.0/rc/rc0/input20
      
      Since short HPD toggles are common, the number could over time get into
      the thousands.
      
      While not a serious issue (i.e. nothing crashes), it is not intended
      to work that way.
      
      This patch changes the test so that it only checks for the single CEC
      capability that can actually change, and it ignores any other
      capabilities, so this is now safe as well if new caps are added in
      the future.
      
      With the changed test the bit under #ifndef CONFIG_MEDIA_CEC_RC can be
      dropped as well, so that's a nice cleanup.
      
      Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
      Reported-by: default avatarFarblos <farblos@vodafonemail.de>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Fixes: 2c6d1fff ("drm: add support for DisplayPort CEC-Tunneling-over-AUX")
      Tested-by: default avatarFarblos <farblos@vodafonemail.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/361bb03d-1691-4e23-84da-0861ead5dbdc@xs4all.nl
      
      
      Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      6daaae5f
  19. Jan 29, 2025
  20. Jan 28, 2025
    • Thomas Zimmermann's avatar
      drm/ast: astdp: Fix timeout for enabling video signal · fd39c41b
      Thomas Zimmermann authored
      
      The ASTDP transmitter sometimes takes up to 1 second for enabling the
      video signal, while the timeout is only 200 msec. This results in a
      kernel error message. Increase the timeout to 1 second. An example
      of the error message is shown below.
      
      [  697.084433] ------------[ cut here ]------------
      [  697.091115] ast 0000:02:00.0: [drm] drm_WARN_ON(!__ast_dp_wait_enable(ast, enabled))
      [  697.091233] WARNING: CPU: 1 PID: 160 at drivers/gpu/drm/ast/ast_dp.c:232 ast_dp_set_enable+0x123/0x140 [ast]
      [...]
      [  697.272469] RIP: 0010:ast_dp_set_enable+0x123/0x140 [ast]
      [...]
      [  697.415283] Call Trace:
      [  697.420727]  <TASK>
      [  697.425908]  ? show_trace_log_lvl+0x196/0x2c0
      [  697.433304]  ? show_trace_log_lvl+0x196/0x2c0
      [  697.440693]  ? drm_atomic_helper_commit_modeset_enables+0x30a/0x470
      [  697.450115]  ? ast_dp_set_enable+0x123/0x140 [ast]
      [  697.458059]  ? __warn.cold+0xaf/0xca
      [  697.464713]  ? ast_dp_set_enable+0x123/0x140 [ast]
      [  697.472633]  ? report_bug+0x134/0x1d0
      [  697.479544]  ? handle_bug+0x58/0x90
      [  697.486127]  ? exc_invalid_op+0x13/0x40
      [  697.492975]  ? asm_exc_invalid_op+0x16/0x20
      [  697.500224]  ? preempt_count_sub+0x14/0xc0
      [  697.507473]  ? ast_dp_set_enable+0x123/0x140 [ast]
      [  697.515377]  ? ast_dp_set_enable+0x123/0x140 [ast]
      [  697.523227]  drm_atomic_helper_commit_modeset_enables+0x30a/0x470
      [  697.532388]  drm_atomic_helper_commit_tail+0x58/0x90
      [  697.540400]  ast_mode_config_helper_atomic_commit_tail+0x30/0x40 [ast]
      [  697.550009]  commit_tail+0xfe/0x1d0
      [  697.556547]  drm_atomic_helper_commit+0x198/0x1c0
      
      This is a cosmetical problem. Enabling the video signal still works
      even with the error message. The problem has always been present, but
      only recent versions of the ast driver warn about missing the timeout.
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Fixes: 4e29cc7c ("drm/ast: astdp: Replace ast_dp_set_on_off()")
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: Jocelyn Falempe <jfalempe@redhat.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v6.13+
      Reviewed-by: default avatarJocelyn Falempe <jfalempe@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20250127134423.84266-1-tzimmermann@suse.de
      fd39c41b
  21. Jan 25, 2025
Loading