1. 15 Jan, 2024 1 commit
    • Fedor Pchelkin's avatar
      drm/ttm: fix ttm pool initialization for no-dma-device drivers · 1f1626ac
      Fedor Pchelkin authored
      QXL driver doesn't use any device for DMA mappings or allocations so
      dev_to_node() will panic inside ttm_device_init() on NUMA systems:
      
      general protection fault, probably for non-canonical address 0xdffffc000000007a: 0000 [#1] PREEMPT SMP KASAN NOPTI
      KASAN: null-ptr-deref in range [0x00000000000003d0-0x00000000000003d7]
      CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.7.0+ #9
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
      RIP: 0010:ttm_device_init+0x10e/0x340
      Call Trace:
       <TASK>
       qxl_ttm_init+0xaa/0x310
       qxl_device_init+0x1071/0x2000
       qxl_pci_probe+0x167/0x3f0
       local_pci_probe+0xe1/0x1b0
       pci_device_probe+0x29d/0x790
       really_probe+0x251/0x910
       __driver_probe_device+0x1ea/0x390
       driver_probe_device+0x4e/0x2e0
       __driver_attach+0x1e3/0x600
       bus_for_each_dev+0x12d/0x1c0
       bus_add_driver+0x25a/0x590
       driver_register+0x15c/0x4b0
       qxl_pci_driver_init+0x67/0x80
       do_one_initcall+0xf5/0x5d0
       kernel_init_freeable+0x637/0xb10
       kernel_init+0x1c/0x2e0
       ret_from_fork+0x48/0x80
       ret_from_fork_asm+0x1b/0x30
       </TASK>
      Modules linked in:
      ---[ end trace 0000000000000000 ]---
      RIP: 0010:ttm_device_init+0x10e/0x340
      
      Fall back to NUMA_NO_NODE if there is no device for DMA.
      
      Found by Linux Verification Center (linuxtesting.org).
      
      Fixes: b0a7ce53 ("drm/ttm: Schedule delayed_delete worker closer")
      Signed-off-by: default avatarFedor Pchelkin <pchelkin@ispras.ru>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240113213347.9562-1-pchelkin@ispras.ruSigned-off-by: default avatarChristian König <christian.koenig@amd.com>
      1f1626ac
  2. 11 Jan, 2024 1 commit
    • Maíra Canal's avatar
      drm/v3d: Free the job and assign it to NULL if initialization fails · 2ad62d16
      Maíra Canal authored
      Currently, if `v3d_job_init()` fails (e.g. in the IGT test "bad-in-sync",
      where we submit an invalid in-sync to the IOCTL), then we end up with
      the following NULL pointer dereference:
      
      [   34.146279] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000078
      [   34.146301] Mem abort info:
      [   34.146306]   ESR = 0x0000000096000005
      [   34.146315]   EC = 0x25: DABT (current EL), IL = 32 bits
      [   34.146322]   SET = 0, FnV = 0
      [   34.146328]   EA = 0, S1PTW = 0
      [   34.146334]   FSC = 0x05: level 1 translation fault
      [   34.146340] Data abort info:
      [   34.146345]   ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000
      [   34.146351]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
      [   34.146357]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
      [   34.146366] user pgtable: 4k pages, 39-bit VAs, pgdp=00000001232e6000
      [   34.146375] [0000000000000078] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
      [   34.146399] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP
      [   34.146406] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device algif_hash aes_neon_bs aes_neon_blk algif_skcipher af_alg bnep hid_logitech_hidpp brcmfmac_wcc brcmfmac brcmutil hci_uart vc4 btbcm cfg80211 bluetooth bcm2835_v4l2(C) snd_soc_hdmi_codec binfmt_misc cec drm_display_helper hid_logitech_dj bcm2835_mmal_vchiq(C) drm_dma_helper drm_kms_helper videobuf2_v4l2 raspberrypi_hwmon ecdh_generic videobuf2_vmalloc videobuf2_memops ecc videobuf2_common rfkill videodev libaes snd_soc_core dwc2 i2c_brcmstb snd_pcm_dmaengine snd_bcm2835(C) i2c_bcm2835 pwm_bcm2835 snd_pcm mc v3d snd_timer snd gpu_sched drm_shmem_helper nvmem_rmem uio_pdrv_genirq uio i2c_dev drm fuse dm_mod drm_panel_orientation_quirks backlight configfs ip_tables x_tables ipv6
      [   34.146556] CPU: 1 PID: 1890 Comm: v3d_submit_csd Tainted: G         C         6.7.0-rc3-g49ddab08 #68
      [   34.146563] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
      [   34.146569] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [   34.146575] pc : drm_sched_job_cleanup+0x3c/0x190 [gpu_sched]
      [   34.146611] lr : v3d_submit_csd_ioctl+0x1b4/0x460 [v3d]
      [   34.146653] sp : ffffffc083cbbb80
      [   34.146658] x29: ffffffc083cbbb90 x28: ffffff81035afc00 x27: ffffffe77a641168
      [   34.146668] x26: ffffff81056a8000 x25: 0000000000000058 x24: 0000000000000000
      [   34.146677] x23: ffffff81065e2000 x22: ffffff81035afe00 x21: ffffffc083cbbcf0
      [   34.146686] x20: ffffff81035afe00 x19: 00000000ffffffea x18: 0000000000000000
      [   34.146694] x17: 0000000000000000 x16: ffffffe7989e34b0 x15: 0000000000000000
      [   34.146703] x14: 0000000004000004 x13: ffffff81035afe80 x12: ffffffc083cb8000
      [   34.146711] x11: cc57e05dfbe5ef00 x10: cc57e05dfbe5ef00 x9 : ffffffe77a64131c
      [   34.146719] x8 : 0000000000000000 x7 : 0000000000000000 x6 : 000000000000003f
      [   34.146727] x5 : 0000000000000040 x4 : ffffff81fefb03f0 x3 : ffffffc083cbba40
      [   34.146736] x2 : ffffff81056a8000 x1 : ffffffe7989e35e8 x0 : 0000000000000000
      [   34.146745] Call trace:
      [   34.146748]  drm_sched_job_cleanup+0x3c/0x190 [gpu_sched]
      [   34.146768]  v3d_submit_csd_ioctl+0x1b4/0x460 [v3d]
      [   34.146791]  drm_ioctl_kernel+0xe0/0x120 [drm]
      [   34.147029]  drm_ioctl+0x264/0x408 [drm]
      [   34.147135]  __arm64_sys_ioctl+0x9c/0xe0
      [   34.147152]  invoke_syscall+0x4c/0x118
      [   34.147162]  el0_svc_common+0xb8/0xf0
      [   34.147168]  do_el0_svc+0x28/0x40
      [   34.147174]  el0_svc+0x38/0x88
      [   34.147184]  el0t_64_sync_handler+0x84/0x100
      [   34.147191]  el0t_64_sync+0x190/0x198
      [   34.147201] Code: aa0003f4 f90007e8 f9401008 aa0803e0 (b8478c09)
      [   34.147210] ---[ end trace 0000000000000000 ]---
      
      This happens because we are calling `drm_sched_job_cleanup()` twice:
      once at `v3d_job_init()` and again when we call `v3d_job_cleanup()`.
      
      To mitigate this issue, we can return to the same approach that we used
      to use before 464c61e7: deallocate the job after `v3d_job_init()`
      fails and assign it to NULL. Then, when we call `v3d_job_cleanup()`, job
      is NULL and the function returns.
      
      Fixes: 464c61e7 ("drm/v3d: Decouple job allocation from job initiation")
      Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
      Reviewed-by: default avatarIago Toral Quiroga <itoral@igalia.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240109142857.1122704-1-mcanal@igalia.com
      2ad62d16
  3. 09 Jan, 2024 1 commit
  4. 05 Jan, 2024 1 commit
  5. 04 Jan, 2024 1 commit
  6. 02 Jan, 2024 2 commits
    • Randy Dunlap's avatar
      drm/imagination: pvr_device.h: fix all kernel-doc warnings · eee70683
      Randy Dunlap authored
      Correct all kernel-doc notation on pvr_device.h so that there are no
      kernel-doc warnings remaining.
      
      pvr_device.h:292: warning: Excess struct member 'active' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'idle' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'lock' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'work' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'old_kccb_cmds_executed' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'kccb_stall_count' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'ccb' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'rtn_q' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'rtn_obj' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'rtn' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'slot_count' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'reserved_count' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'waiters' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'fence_ctx' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'id' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'seqno' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'lock' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'active' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'idle' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'lock' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'work' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'old_kccb_cmds_executed' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'kccb_stall_count' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'ccb' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'rtn_q' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'rtn_obj' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'rtn' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'slot_count' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'reserved_count' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'waiters' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'fence_ctx' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'id' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'seqno' description in 'pvr_device'
      pvr_device.h:292: warning: Excess struct member 'lock' description in 'pvr_device'
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Frank Binns <frank.binns@imgtec.com>
      Cc: Donald Robson <donald.robson@imgtec.com>
      Cc: Matt Coster <matt.coster@imgtec.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@gmail.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Vegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231231054910.31805-1-rdunlap@infradead.org
      eee70683
    • Randy Dunlap's avatar
      drm/gpuvm: fix all kernel-doc warnings in include/drm/drm_gpuvm.h · 200a6b3a
      Randy Dunlap authored
      Update kernel-doc comments in <drm/drm_gpuvm.h> to correct all
      kernel-doc warnings:
      
      drm_gpuvm.h:148: warning: Excess struct member 'addr' description in 'drm_gpuva'
      drm_gpuvm.h:148: warning: Excess struct member 'offset' description in 'drm_gpuva'
      drm_gpuvm.h:148: warning: Excess struct member 'obj' description in 'drm_gpuva'
      drm_gpuvm.h:148: warning: Excess struct member 'entry' description in 'drm_gpuva'
      drm_gpuvm.h:148: warning: Excess struct member '__subtree_last' description in 'drm_gpuva'
      drm_gpuvm.h:192: warning: No description found for return value of 'drm_gpuva_invalidated'
      drm_gpuvm.h:331: warning: Excess struct member 'tree' description in 'drm_gpuvm'
      drm_gpuvm.h:331: warning: Excess struct member 'list' description in 'drm_gpuvm'
      drm_gpuvm.h:331: warning: Excess struct member 'list' description in 'drm_gpuvm'
      drm_gpuvm.h:331: warning: Excess struct member 'local_list' description in 'drm_gpuvm'
      drm_gpuvm.h:331: warning: Excess struct member 'lock' description in 'drm_gpuvm'
      drm_gpuvm.h:331: warning: Excess struct member 'list' description in 'drm_gpuvm'
      drm_gpuvm.h:331: warning: Excess struct member 'local_list' description in 'drm_gpuvm'
      drm_gpuvm.h:331: warning: Excess struct member 'lock' description in 'drm_gpuvm'
      drm_gpuvm.h:352: warning: No description found for return value of 'drm_gpuvm_get'
      drm_gpuvm.h:545: warning: Excess struct member 'fn' description in 'drm_gpuvm_exec'
      drm_gpuvm.h:545: warning: Excess struct member 'priv' description in 'drm_gpuvm_exec'
      drm_gpuvm.h:597: warning: missing initial short description on line:
       * drm_gpuvm_exec_resv_add_fence()
      drm_gpuvm.h:616: warning: missing initial short description on line:
       * drm_gpuvm_exec_validate()
      drm_gpuvm.h:623: warning: No description found for return value of 'drm_gpuvm_exec_validate'
      drm_gpuvm.h:698: warning: Excess struct member 'gpuva' description in 'drm_gpuvm_bo'
      drm_gpuvm.h:698: warning: Excess struct member 'entry' description in 'drm_gpuvm_bo'
      drm_gpuvm.h:698: warning: Excess struct member 'gem' description in 'drm_gpuvm_bo'
      drm_gpuvm.h:698: warning: Excess struct member 'evict' description in 'drm_gpuvm_bo'
      drm_gpuvm.h:726: warning: No description found for return value of 'drm_gpuvm_bo_get'
      drm_gpuvm.h:738: warning: missing initial short description on line:
       * drm_gpuvm_bo_gem_evict()
      drm_gpuvm.h:740: warning: missing initial short description on line:
       * drm_gpuvm_bo_gem_evict()
      drm_gpuvm.h:698: warning: Excess struct member 'evict' description in 'drm_gpuvm_bo'
      drm_gpuvm.h:844: warning: Excess struct member 'addr' description in 'drm_gpuva_op_map'
      drm_gpuvm.h:844: warning: Excess struct member 'range' description in 'drm_gpuva_op_map'
      drm_gpuvm.h:844: warning: Excess struct member 'offset' description in 'drm_gpuva_op_map'
      drm_gpuvm.h:844: warning: Excess struct member 'obj' description in 'drm_gpuva_op_map'
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@gmail.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Vegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20231231054856.31786-1-rdunlap@infradead.org
      200a6b3a
  7. 24 Dec, 2023 2 commits
  8. 23 Dec, 2023 2 commits
  9. 19 Dec, 2023 2 commits
  10. 15 Dec, 2023 4 commits
  11. 13 Dec, 2023 23 commits