1. 21 5月, 2020 1 次提交
    • C
      drm: Restore the NULL check for drm_gem_object_put() · 0e799e84
      Chris Wilson 提交于
      Some users want to pass NULL to drm_gem_object_put(), but those using
      __drm_gem_object_put() did not. Compromise, have both and let the
      compiler sort it out.
      
      drm_gem_fb_destroy() calls drm_gem_object_put() with NULL obj causing:
      [   11.584209] BUG: kernel NULL pointer dereference, address: 0000000000000000
      [   11.584213] #PF: supervisor write access in kernel mode
      [   11.584215] #PF: error_code(0x0002) - not-present page
      [   11.584216] PGD 0 P4D 0
      [   11.584220] Oops: 0002 [#1] SMP NOPTI
      [   11.584223] CPU: 7 PID: 1571 Comm: gnome-shell Tainted: G            E     5.7.0-rc1-1-default+ #27
      [   11.584225] Hardware name: Micro-Star International Co., Ltd. MS-7A31/X370 XPOWER GAMING TITANIUM (MS-7A31), BIOS 1.MR 12/03/2019
      [   11.584237] RIP: 0010:drm_gem_fb_destroy+0x28/0x70 [drm_kms_helper]
      <snip>
      [   11.584256] Call Trace:
      [   11.584279]  drm_mode_rmfb+0x189/0x1c0 [drm]
      [   11.584299]  ? drm_mode_rmfb+0x1c0/0x1c0 [drm]
      [   11.584314]  drm_ioctl_kernel+0xaa/0xf0 [drm]
      [   11.584329]  drm_ioctl+0x1ff/0x3b0 [drm]
      [   11.584347]  ? drm_mode_rmfb+0x1c0/0x1c0 [drm]
      [   11.584421]  amdgpu_drm_ioctl+0x49/0x80 [amdgpu]
      [   11.584427]  ksys_ioctl+0x87/0xc0
      [   11.584430]  __x64_sys_ioctl+0x16/0x20
      [   11.584434]  do_syscall_64+0x5f/0x240
      [   11.584438]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [   11.584440] RIP: 0033:0x7f0ef80f7227
      Reported-by: NNirmoy Das <nirmoy.das@amd.com>
      Fixes: b5d25074 ("drm/gem: fold drm_gem_object_put_unlocked and __drm_gem_object_put()")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Nirmoy Das <nirmoy.das@amd.com>
      Cc: Emil Velikov <emil.velikov@collabora.com>
      Cc: Christian König <christian.koenig@amd.com>.
      Acked-by: NNirmoy Das <nirmoy.das@amd.com>
      Reviewed-by: NEmil Velikov <emil.velikov@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200520142347.29060-1-chris@chris-wilson.co.uk
      0e799e84
  2. 20 5月, 2020 2 次提交
  3. 29 4月, 2020 2 次提交
  4. 08 4月, 2020 8 次提交
  5. 07 4月, 2020 5 次提交
  6. 03 4月, 2020 1 次提交
  7. 27 3月, 2020 8 次提交
  8. 26 3月, 2020 3 次提交
    • D
      drm: Garbage collect drm_dev_fini · d33b58d0
      Daniel Vetter 提交于
      It has become empty. Given the few users I figured not much point
      splitting this up.
      
      v2: Rebase over i915 changes.
      
      v3: Rebase over patch split fix.
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-26-daniel.vetter@ffwll.ch
      d33b58d0
    • D
      drm/i915: Use drmm_add_final_kfree · 7fb81e9d
      Daniel Vetter 提交于
      With this we can drop the final kfree from the release function.
      
      The mock device in the selftests needed it's pci_device split
      up from the drm_device. In the future we could simplify this again
      by allocating the pci_device as a managed allocation too.
      
      v2: I overlooked that i915_driver_destroy is also called in the
      unwind code of the error path. There we need a drm_dev_put.
      Similar for the mock object.
      
      Now the problem with that is that the drm_driver->release callbacks
      for both the real driver and the mock one assume everything has been
      set up. Hence going through that path for a partially set up driver
      will result in issues. Quickest fix is to disable the ->release() hook
      until the driver is fully initialized, and keep the onion unwinding.
      Long term would be cleanest to move everything over to drmm_ release
      actions, but that's a lot of work for a big driver like i915. Plus
      more core work needed first anyway.
      
      v3: Fix i915_drm pointer wrangling in mock_gem_device. Also switch
      over to start using drm_dev_put() to clean up even on the error path.
      Aside I think the current error path is leaking the allocation.
      
      v4: more fixes for intel-gfx-ci, some if it damage from v3 :-/
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Matthew Auld <matthew.auld@intel.com>
      Cc: Andi Shyti <andi.shyti@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-9-daniel.vetter@ffwll.ch
      7fb81e9d
    • D
      drm/i915: Don't clear drvdata in ->release · 0ce542f7
      Daniel Vetter 提交于
      For two reasons:
      
      - The driver core clears this already for us after we're unloaded in
        __device_release_driver().
      
      - It's way too late, the drm_device ->release callback might massively
        outlive the underlying physical device, since a drm_device can be
        kept alive by open drm_file or well really anything else userspace
        is still hanging onto. So if we clear this ourselves, we should
        clear it in the pci ->remove callback, not in the drm_device
        ->release callback.
      
      Looking at git history this was fixed in the driver core with
      
      commit 0998d063
      Author: Hans de Goede <hdegoede@redhat.com>
      Date:   Wed May 23 00:09:34 2012 +0200
      
          device-core: Ensure drvdata = NULL when no driver is bound
      
      v2: Cite the core fix in the commit message (Chris).
      
      v3: Fix commit message and unused variable warning (Jani).
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-3-daniel.vetter@ffwll.ch
      0ce542f7
  9. 25 3月, 2020 1 次提交
  10. 20 3月, 2020 3 次提交
  11. 18 3月, 2020 3 次提交
  12. 17 3月, 2020 2 次提交
  13. 16 3月, 2020 1 次提交