1. 10 Oct, 2024 3 commits
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2024-10-10' of... · b634acb2
      Dave Airlie authored
      Merge tag 'drm-misc-fixes-2024-10-10' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
      
      Short summary of fixes pull:
      
      fbdev-dma:
      - Only clean up deferred I/O if instanciated
      
      nouveau:
      - dmem: Fix privileged error in copy engine channel; Fix possible
      data leak in migrate_to_ram()
      - gsp: Fix coding style
      
      sched:
      - Avoid leaking lockdep map
      
      v3d:
      - Stop active perfmon before destroying it
      
      vc4:
      - Stop active perfmon before destroying it
      
      xe:
      - Drop GuC submit_wq pool
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20241010133708.GA461532@localhost.localdomain
      b634acb2
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2024-10-10' of... · fe4a435b
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2024-10-10' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes
      
      - HDCP refcount fix
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/Zwd78Tnw8t3w9F16@jlahtine-mobl.ger.corp.intel.com
      fe4a435b
    • Janne Grunau's avatar
      drm/fbdev-dma: Only cleanup deferred I/O if necessary · fcddc71e
      Janne Grunau authored
      Commit 5a498d4d ("drm/fbdev-dma: Only install deferred I/O if
      necessary") initializes deferred I/O only if it is used.
      drm_fbdev_dma_fb_destroy() however calls fb_deferred_io_cleanup()
      unconditionally with struct fb_info.fbdefio == NULL. KASAN with the
      out-of-tree Apple silicon display driver posts following warning from
      __flush_work() of a random struct work_struct instead of the expected
      NULL pointer derefs.
      
      [   22.053799] ------------[ cut here ]------------
      [   22.054832] WARNING: CPU: 2 PID: 1 at kernel/workqueue.c:4177 __flush_work+0x4d8/0x580
      [   22.056597] Modules linked in: uhid bnep uinput nls_ascii ip6_tables ip_tables i2c_dev loop fuse dm_multipath nfnetlink zram hid_magicmouse btrfs xor xor_neon brcmfmac_wcc raid6_pq hci_bcm4377 bluetooth brcmfmac hid_apple brcmutil nvmem_spmi_mfd simple_mfd_spmi dockchannel_hid cfg80211 joydev regmap_spmi nvme_apple ecdh_generic ecc macsmc_hid rfkill dwc3 appledrm snd_soc_macaudio macsmc_power nvme_core apple_isp phy_apple_atc apple_sart apple_rtkit_helper apple_dockchannel tps6598x macsmc_hwmon snd_soc_cs42l84 videobuf2_v4l2 spmi_apple_controller nvmem_apple_efuses videobuf2_dma_sg apple_z2 videobuf2_memops spi_nor panel_summit videobuf2_common asahi videodev pwm_apple apple_dcp snd_soc_apple_mca apple_admac spi_apple clk_apple_nco i2c_pasemi_platform snd_pcm_dmaengine mc i2c_pasemi_core mux_core ofpart adpdrm drm_dma_helper apple_dart apple_soc_cpufreq leds_pwm phram
      [   22.073768] CPU: 2 UID: 0 PID: 1 Comm: systemd-shutdow Not tainted 6.11.2-asahi+ #asahi-dev
      [   22.075612] Hardware name: Apple MacBook Pro (13-inch, M2, 2022) (DT)
      [   22.077032] pstate: 01400005 (nzcv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
      [   22.078567] pc : __flush_work+0x4d8/0x580
      [   22.079471] lr : __flush_work+0x54/0x580
      [   22.080345] sp : ffffc000836ef820
      [   22.081089] x29: ffffc000836ef880 x28: 0000000000000000 x27: ffff80002ddb7128
      [   22.082678] x26: dfffc00000000000 x25: 1ffff000096f0c57 x24: ffffc00082d3e358
      [   22.084263] x23: ffff80004b7862b8 x22: dfffc00000000000 x21: ffff80005aa1d470
      [   22.085855] x20: ffff80004b786000 x19: ffff80004b7862a0 x18: 0000000000000000
      [   22.087439] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000005
      [   22.089030] x14: 1ffff800106ddf0a x13: 0000000000000000 x12: 0000000000000000
      [   22.090618] x11: ffffb800106ddf0f x10: dfffc00000000000 x9 : 1ffff800106ddf0e
      [   22.092206] x8 : 0000000000000000 x7 : aaaaaaaaaaaaaaaa x6 : 0000000000000001
      [   22.093790] x5 : ffffc000836ef728 x4 : 0000000000000000 x3 : 0000000000000020
      [   22.095368] x2 : 0000000000000008 x1 : 00000000000000aa x0 : 0000000000000000
      [   22.096955] Call trace:
      [   22.097505]  __flush_work+0x4d8/0x580
      [   22.098330]  flush_delayed_work+0x80/0xb8
      [   22.099231]  fb_deferred_io_cleanup+0x3c/0x130
      [   22.100217]  drm_fbdev_dma_fb_destroy+0x6c/0xe0 [drm_dma_helper]
      [   22.101559]  unregister_framebuffer+0x210/0x2f0
      [   22.102575]  drm_fb_helper_unregister_info+0x48/0x60
      [   22.103683]  drm_fbdev_dma_client_unregister+0x4c/0x80 [drm_dma_helper]
      [   22.105147]  drm_client_dev_unregister+0x1cc/0x230
      [   22.106217]  drm_dev_unregister+0x58/0x570
      [   22.107125]  apple_drm_unbind+0x50/0x98 [appledrm]
      [   22.108199]  component_del+0x1f8/0x3a8
      [   22.109042]  dcp_platform_shutdown+0x24/0x38 [apple_dcp]
      [   22.110357]  platform_shutdown+0x70/0x90
      [   22.111219]  device_shutdown+0x368/0x4d8
      [   22.112095]  kernel_restart+0x6c/0x1d0
      [   22.112946]  __arm64_sys_reboot+0x1c8/0x328
      [   22.113868]  invoke_syscall+0x78/0x1a8
      [   22.114703]  do_el0_svc+0x124/0x1a0
      [   22.115498]  el0_svc+0x3c/0xe0
      [   22.116181]  el0t_64_sync_handler+0x70/0xc0
      [   22.117110]  el0t_64_sync+0x190/0x198
      [   22.117931] ---[ end trace 0000000000000000 ]---
      Signed-off-by: default avatarJanne Grunau <j@jannau.net>
      Fixes: 5a498d4d ("drm/fbdev-dma: Only install deferred I/O if necessary")
      Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/ZwLNuZL-8Gh5UUQb@robin
      fcddc71e
  2. 09 Oct, 2024 1 commit
  3. 08 Oct, 2024 3 commits
  4. 07 Oct, 2024 8 commits
    • Hamza Mahfooz's avatar
      drm/amd/display: fix hibernate entry for DCN35+ · 79bc412e
      Hamza Mahfooz authored
      Since, two suspend-resume cycles are required to enter hibernate and,
      since we only need to enable idle optimizations in the first cycle
      (which is pretty much equivalent to s2idle). We can check in_s0ix, to
      prevent the system from entering idle optimizations before it actually
      enters hibernate (from display's perspective). Also, call
      dc_set_power_state() before dc_allow_idle_optimizations(), since it's
      safer to do so because dc_set_power_state() writes to DMUB.
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      (cherry picked from commit 2fe79508d9c393bb9931b0037c5ecaee09a8dc39)
      Cc: stable@vger.kernel.org # 6.10+
      79bc412e
    • Josip Pavic's avatar
      drm/amd/display: Clear update flags after update has been applied · 0a9906cc
      Josip Pavic authored
      [Why]
      Since the surface/stream update flags aren't cleared after applying
      updates, those same updates may be applied again in a future call to
      update surfaces/streams for surfaces/streams that aren't actually part
      of that update (i.e. applying an update for one surface/stream can
      trigger unintended programming on a different surface/stream).
      
      For example, when an update results in a call to
      program_front_end_for_ctx, that function may call program_pipe on all
      pipes. If there are surface update flags that were never cleared on the
      surface some pipe is attached to, then the same update will be
      programmed again.
      
      [How]
      Clear the surface and stream update flags after applying the updates.
      
      Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3441
      Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3616
      Cc: Melissa Wen <mwen@igalia.com>
      Reviewed-by: default avatarAric Cyr <aric.cyr@amd.com>
      Signed-off-by: default avatarJosip Pavic <Josip.Pavic@amd.com>
      Signed-off-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
      Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      (cherry picked from commit 7671f62c10f2a4c77d89b39fd50fab7f918d6809)
      Cc: stable@vger.kernel.org
      0a9906cc
    • Alex Deucher's avatar
      drm/amdgpu: partially revert powerplay `__counted_by` changes · d6b9f492
      Alex Deucher authored
      Partially revert
      commit 0ca9f757 ("drm/amd/pm: powerplay: Add `__counted_by` attribute for flexible arrays")
      
      The count attribute for these arrays does not get set until
      after the arrays are allocated and populated leading to false
      UBSAN warnings.
      
      Fixes: 0ca9f757 ("drm/amd/pm: powerplay: Add `__counted_by` attribute for flexible arrays")
      Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3662Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      (cherry picked from commit 8a5ae927b653b43623e55610d2215ee94c027e8c)
      Cc: stable@vger.kernel.org
      d6b9f492
    • Wu Hoi Pok's avatar
      drm/radeon: add late_register for connector · 8e82d119
      Wu Hoi Pok authored
      The patch is to solve null dereference in 'aux.dev', which is
      introduced in recent radeon rework. By having 'late_register',
      the connector should be registered after 'drm_dev_register'
      automatically, where in before it is the opposite.
      
      Fixes: 90985660 ("drm/radeon: remove load callback from kms_driver")
      Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3665Tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarWu Hoi Pok <wuhoipok@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      (cherry picked from commit b4c1ad70e279bacbc772a468033bdecce2f5e0dc)
      8e82d119
    • Lang Yu's avatar
      drm/amdkfd: Fix an eviction fence leak · d7d7b947
      Lang Yu authored
      Only creating a new reference for each process instead of each VM.
      
      Fixes: 9a1c1339 ("drm/amdkfd: Run restore_workers on freezable WQs")
      Suggested-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
      Signed-off-by: default avatarLang Yu <lang.yu@amd.com>
      Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      (cherry picked from commit 5fa436289483ae56427b0896c31f72361223c758)
      Cc: stable@vger.kernel.org
      d7d7b947
    • Maíra Canal's avatar
      drm/vc4: Stop the active perfmon before being destroyed · 0b2ad4f6
      Maíra Canal authored
      Upon closing the file descriptor, the active performance monitor is not
      stopped. Although all perfmons are destroyed in `vc4_perfmon_close_file()`,
      the active performance monitor's pointer (`vc4->active_perfmon`) is still
      retained.
      
      If we open a new file descriptor and submit a few jobs with performance
      monitors, the driver will attempt to stop the active performance monitor
      using the stale pointer in `vc4->active_perfmon`. However, this pointer
      is no longer valid because the previous process has already terminated,
      and all performance monitors associated with it have been destroyed and
      freed.
      
      To fix this, when the active performance monitor belongs to a given
      process, explicitly stop it before destroying and freeing it.
      
      Cc: stable@vger.kernel.org # v4.17+
      Cc: Boris Brezillon <bbrezillon@kernel.org>
      Cc: Juan A. Suarez Romero <jasuarez@igalia.com>
      Fixes: 65101d8c ("drm/vc4: Expose performance counters to userspace")
      Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
      Reviewed-by: default avatarJuan A. Suarez <jasuarez@igalia.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20241004123817.890016-2-mcanal@igalia.com
      0b2ad4f6
    • Maíra Canal's avatar
      drm/v3d: Stop the active perfmon before being destroyed · 7d1fd363
      Maíra Canal authored
      When running `kmscube` with one or more performance monitors enabled
      via `GALLIUM_HUD`, the following kernel panic can occur:
      
      [   55.008324] Unable to handle kernel paging request at virtual address 00000000052004a4
      [   55.008368] Mem abort info:
      [   55.008377]   ESR = 0x0000000096000005
      [   55.008387]   EC = 0x25: DABT (current EL), IL = 32 bits
      [   55.008402]   SET = 0, FnV = 0
      [   55.008412]   EA = 0, S1PTW = 0
      [   55.008421]   FSC = 0x05: level 1 translation fault
      [   55.008434] Data abort info:
      [   55.008442]   ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000
      [   55.008455]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
      [   55.008467]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
      [   55.008481] user pgtable: 4k pages, 39-bit VAs, pgdp=00000001046c6000
      [   55.008497] [00000000052004a4] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
      [   55.008525] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP
      [   55.008542] Modules linked in: rfcomm [...] vc4 v3d snd_soc_hdmi_codec drm_display_helper
      gpu_sched drm_shmem_helper cec drm_dma_helper drm_kms_helper i2c_brcmstb
      drm drm_panel_orientation_quirks snd_soc_core snd_compress snd_pcm_dmaengine snd_pcm snd_timer snd backlight
      [   55.008799] CPU: 2 PID: 166 Comm: v3d_bin Tainted: G         C         6.6.47+rpt-rpi-v8 #1  Debian 1:6.6.47-1+rpt1
      [   55.008824] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
      [   55.008838] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [   55.008855] pc : __mutex_lock.constprop.0+0x90/0x608
      [   55.008879] lr : __mutex_lock.constprop.0+0x58/0x608
      [   55.008895] sp : ffffffc080673cf0
      [   55.008904] x29: ffffffc080673cf0 x28: 0000000000000000 x27: ffffff8106188a28
      [   55.008926] x26: ffffff8101e78040 x25: ffffff8101baa6c0 x24: ffffffd9d989f148
      [   55.008947] x23: ffffffda1c2a4008 x22: 0000000000000002 x21: ffffffc080673d38
      [   55.008968] x20: ffffff8101238000 x19: ffffff8104f83188 x18: 0000000000000000
      [   55.008988] x17: 0000000000000000 x16: ffffffda1bd04d18 x15: 00000055bb08bc90
      [   55.009715] x14: 0000000000000000 x13: 0000000000000000 x12: ffffffda1bd4cbb0
      [   55.010433] x11: 00000000fa83b2da x10: 0000000000001a40 x9 : ffffffda1bd04d04
      [   55.011162] x8 : ffffff8102097b80 x7 : 0000000000000000 x6 : 00000000030a5857
      [   55.011880] x5 : 00ffffffffffffff x4 : 0300000005200470 x3 : 0300000005200470
      [   55.012598] x2 : ffffff8101238000 x1 : 0000000000000021 x0 : 0300000005200470
      [   55.013292] Call trace:
      [   55.013959]  __mutex_lock.constprop.0+0x90/0x608
      [   55.014646]  __mutex_lock_slowpath+0x1c/0x30
      [   55.015317]  mutex_lock+0x50/0x68
      [   55.015961]  v3d_perfmon_stop+0x40/0xe0 [v3d]
      [   55.016627]  v3d_bin_job_run+0x10c/0x2d8 [v3d]
      [   55.017282]  drm_sched_main+0x178/0x3f8 [gpu_sched]
      [   55.017921]  kthread+0x11c/0x128
      [   55.018554]  ret_from_fork+0x10/0x20
      [   55.019168] Code: f9400260 f1001c1f 54001ea9 927df000 (b9403401)
      [   55.019776] ---[ end trace 0000000000000000 ]---
      [   55.020411] note: v3d_bin[166] exited with preempt_count 1
      
      This issue arises because, upon closing the file descriptor (which happens
      when we interrupt `kmscube`), the active performance monitor is not
      stopped. Although all perfmons are destroyed in `v3d_perfmon_close_file()`,
      the active performance monitor's pointer (`v3d->active_perfmon`) is still
      retained.
      
      If `kmscube` is run again, the driver will attempt to stop the active
      performance monitor using the stale pointer in `v3d->active_perfmon`.
      However, this pointer is no longer valid because the previous process has
      already terminated, and all performance monitors associated with it have
      been destroyed and freed.
      
      To fix this, when the active performance monitor belongs to a given
      process, explicitly stop it before destroying and freeing it.
      
      Cc: stable@vger.kernel.org # v5.15+
      Closes: https://github.com/raspberrypi/linux/issues/6389
      Fixes: 26a4dc29 ("drm/v3d: Expose performance counters to userspace")
      Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
      Reviewed-by: default avatarJuan A. Suarez <jasuarez@igalia.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20241004130625.918580-2-mcanal@igalia.com
      7d1fd363
    • Jani Nikula's avatar
      drm/i915/hdcp: fix connector refcounting · 4cc2718f
      Jani Nikula authored
      We acquire a connector reference before scheduling an HDCP prop work,
      and expect the work function to release the reference.
      
      However, if the work was already queued, it won't be queued multiple
      times, and the reference is not dropped.
      
      Release the reference immediately if the work was already queued.
      
      Fixes: a6597faa ("drm/i915: Protect workers against disappearing connectors")
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Suraj Kandpal <suraj.kandpal@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: stable@vger.kernel.org # v5.10+
      Reviewed-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240924153022.2255299-1-jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      (cherry picked from commit abc0742c79bdb3b164eacab24aea0916d2ec1cb5)
      Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      4cc2718f
  5. 06 Oct, 2024 20 commits
  6. 05 Oct, 2024 5 commits