1. 18 9月, 2019 1 次提交
    • D
      drm/kms: Duct-tape for mode object lifetime checks · e0f32f78
      Daniel Vetter 提交于
      commit 4f5368b5
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Jun 14 08:17:23 2019 +0200
      
          drm/kms: Catch mode_object lifetime errors
      
      uncovered a bit a mess in dp drivers. Most drivers (from a quick look,
      all except i915) register all the dp stuff in their init code, which
      is too early. With CONFIG_DRM_DP_AUX_CHARDEV this will blow up,
      because drm_dp_aux_register tries to add a child to a device in sysfs
      (the connector) which doesn't even exist yet.
      
      No one seems to have cared thus far. But with the above change I also
      moved the setting of dev->registered after the ->load callback, in an
      attempt to keep old drivers from hitting any WARN_ON backtraces. But
      that moved radeon.ko from the "working, by accident" to "now also
      broken" category.
      
      Since this is a huge mess I figured a revert would be simplest. But
      this check has already caught issues in i915:
      
      commit 1b9bd096
      Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Date:   Tue Aug 20 19:16:57 2019 +0300
      
          drm/i915: Do not create a new max_bpc prop for MST connectors
      
      Hence I'd like to retain it. Fix the radeon regression by moving the
      setting of dev->registered back to were it was, and stop the
      backtraces with an explicit check for dev->driver->load.
      
      Everyone else will stay as broken with CONFIG_DRM_DP_AUX_CHARDEV. The
      next patch will improve the kerneldoc and add a todo entry for this.
      
      Fixes: 4f5368b5 ("drm/kms: Catch mode_object lifetime errors")
      Cc: Sean Paul <sean@poorly.run>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reported-by: NMichel Dänzer <michel@daenzer.net>
      Reviewed-by: NMichel Dänzer <mdaenzer@redhat.com>
      Tested-by: NMichel Dänzer <mdaenzer@redhat.com>
      Cc: Michel Dänzer <michel@daenzer.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190917120936.7501-1-daniel.vetter@ffwll.ch
      e0f32f78
  2. 20 8月, 2019 1 次提交
  3. 10 7月, 2019 1 次提交
  4. 13 6月, 2019 1 次提交
  5. 28 5月, 2019 1 次提交
  6. 26 5月, 2019 2 次提交
    • D
      vfs: Convert drm to use the new mount API · 4a457910
      David Howells 提交于
      Convert the drm filesystem to the new internal mount API as the old
      one will be obsoleted and removed.  This allows greater flexibility in
      communication of mount parameters between userspace, the VFS and the
      filesystem.
      
      See Documentation/filesystems/mount_api.txt for more information.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cc: David Airlie <airlied@linux.ie>
      cc: dri-devel@lists.freedesktop.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4a457910
    • A
      mount_pseudo(): drop 'name' argument, switch to d_make_root() · 1f58bb18
      Al Viro 提交于
      Once upon a time we used to set ->d_name of e.g. pipefs root
      so that d_path() on pipes would work.  These days it's
      completely pointless - dentries of pipes are not even connected
      to pipefs root.  However, mount_pseudo() had set the root
      dentry name (passed as the second argument) and callers
      kept inventing names to pass to it.  Including those that
      didn't *have* any non-root dentries to start with...
      
      All of that had been pointless for about 8 years now; it's
      time to get rid of that cargo-culting...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1f58bb18
  7. 20 5月, 2019 1 次提交
  8. 24 4月, 2019 3 次提交
  9. 18 4月, 2019 1 次提交
  10. 25 3月, 2019 1 次提交
  11. 04 3月, 2019 3 次提交
  12. 21 2月, 2019 2 次提交
  13. 19 2月, 2019 1 次提交
  14. 12 1月, 2019 1 次提交
  15. 27 12月, 2018 1 次提交
  16. 25 11月, 2018 1 次提交
  17. 06 11月, 2018 1 次提交
  18. 25 10月, 2018 1 次提交
  19. 13 9月, 2018 1 次提交
  20. 16 7月, 2018 1 次提交
    • L
      drm/dp_helper: Add DP aux channel tracing · a18b2192
      Lyude Paul 提交于
      This is something we've needed for a very long time now, as it makes
      debugging issues with faulty MST hubs along with debugging issues
      regarding us interfacing with hubs correctly vastly easier to debug.
      Currently this can actually be done if you trace the i2c devices for DP
      using ftrace but that's significantly less useful for a couple of
      reasons:
      
      - Tracing the i2c devices through ftrace means all of the traces are
        going to contain a lot of "garbage" output that we're sending over the
        i2c line. Most of this garbage comes from retrying transactions, DRM's
        helper library adding extra transactions to work around bad hubs, etc.
      - Having a user set up ftrace so that they can provide debugging
        information is a lot more difficult then being able to say "just boot
        with drm.debug=0x100"
      - We can potentially expand upon this tracing in the future to print
        debugging information in regards to other DP transactions like MST
        sideband transactions
      
      This is inspired by a patch Rob Clark sent to do this a long time back.
      Neither of us could find the patch however, so we both assumed it would
      probably just be easier to rewrite it anyway.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180716154432.13433-1-lyude@redhat.com
      a18b2192
  21. 10 7月, 2018 1 次提交
  22. 31 5月, 2018 1 次提交
  23. 11 5月, 2018 1 次提交
    • H
      drm: Match sysfs name in link removal to link creation · 7f6df440
      Haneen Mohammed 提交于
      This patch matches the sysfs name used in the unlinking with the
      linking function. Otherwise, remove_compat_control_link() fails to remove
      sysfs created by create_compat_control_link() in drm_dev_register().
      
      Fixes: 6449b088 ("drm: Add fake controlD* symlinks for backwards
      compat")
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Emil Velikov <emil.l.velikov@gmail.com>
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: dri-devel@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v4.10+
      Signed-off-by: NHaneen Mohammed <hamohammed.sa@gmail.com>
      [seanpaul added Fixes and Cc tags]
      Signed-off-by: NSean Paul <seanpaul@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180511041542.GA4253@haneen-vb
      7f6df440
  24. 04 5月, 2018 1 次提交
  25. 29 3月, 2018 1 次提交
  26. 06 3月, 2018 1 次提交
  27. 25 10月, 2017 1 次提交
  28. 21 10月, 2017 1 次提交
  29. 26 9月, 2017 1 次提交
  30. 11 8月, 2017 3 次提交
  31. 11 7月, 2017 1 次提交
    • A
      drm: inhibit drm drivers register to uninitialized drm core · 371c2279
      Alexandru Moise 提交于
      If the DRM core fails to init for whatever reason, ensure that
      no driver ever calls drm_dev_register().
      
      This is best done at drm_dev_init() as it covers drivers that call
      drm_dev_alloc() as well as drivers that prefer to embed struct
      drm_device into their own device struct and call drm_dev_init()
      themselves.
      
      In my case I had so many dynamic device majors used that the major
      number for DRM (226) was stolen, causing DRM core init to fail after
      failing to register a chrdev, and ultimately calling debugfs_remove()
      on drm_debugfs_root in drm_core_exit().
      
      After drm core failed to init, VGEM was still calling drm_dev_register(),
      ultimately leading to drm_debugfs_init(), with drm_debugfs_root passed
      as the root for the new debugfs dir at debugfs_create_dir().
      
      This led to a kernel panic once we were either derefencing root->d_inode
      while it was NULL or calling root->d_inode->i_op->lookup() while it was
      NULL in debugfs at inode_lock() or lookup_*().
      Signed-off-by: NAlexandru Moise <00moses.alexander00@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170708214352.GA27205@gmail.com
      371c2279
  32. 02 6月, 2017 1 次提交
    • H
      drm: Fix oops + Xserver hang when unplugging USB drm devices · 75fb6363
      Hans de Goede 提交于
      commit a39be606 ("drm: Do a full device unregister when unplugging")
      causes backtraces like this one when unplugging an usb drm device while
      it is in use:
      
      usb 2-3: USB disconnect, device number 25
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 242 at drivers/gpu/drm/drm_mode_config.c:424
         drm_mode_config_cleanup+0x220/0x280 [drm]
      ...
      RIP: 0010:drm_mode_config_cleanup+0x220/0x280 [drm]
      ...
      Call Trace:
       gm12u320_modeset_cleanup+0xe/0x10 [gm12u320]
       gm12u320_driver_unload+0x35/0x70 [gm12u320]
       drm_dev_unregister+0x3c/0xe0 [drm]
       drm_unplug_dev+0x12/0x60 [drm]
       gm12u320_usb_disconnect+0x36/0x40 [gm12u320]
       usb_unbind_interface+0x72/0x280
       device_release_driver_internal+0x158/0x210
       device_release_driver+0x12/0x20
       bus_remove_device+0x104/0x180
       device_del+0x1d2/0x350
       usb_disable_device+0x9f/0x270
       usb_disconnect+0xc6/0x260
      ...
      [drm:drm_mode_config_cleanup [drm]] *ERROR* connector Unknown-1 leaked!
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 242 at drivers/gpu/drm/drm_mode_config.c:458
         drm_mode_config_cleanup+0x268/0x280 [drm]
      ...
      <same Call Trace>
      ---[ end trace 80df975dae439ed6 ]---
      general protection fault: 0000 [#1] SMP
      ...
      Call Trace:
       ? __switch_to+0x225/0x450
       drm_mode_rmfb_work_fn+0x55/0x70 [drm]
       process_one_work+0x193/0x3c0
       worker_thread+0x4a/0x3a0
      ...
      RIP: drm_framebuffer_remove+0x62/0x3f0 [drm] RSP: ffffb776c39dfd98
      ---[ end trace 80df975dae439ed7 ]---
      
      After which the system is unusable this is caused by drm_dev_unregister
      getting called immediately on unplug, which calls the drivers unload
      function which calls drm_mode_config_cleanup which removes the framebuffer
      object while userspace is still holding a reference to it.
      
      Reverting commit a39be606 ("drm: Do a full device unregister
      when unplugging") leads to the following oops on unplug instead,
      when userspace closes the last fd referencing the drm_dev:
      
      sysfs group 'power' not found for kobject 'card1-Unknown-1'
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 2459 at fs/sysfs/group.c:237
         sysfs_remove_group+0x80/0x90
      ...
      RIP: 0010:sysfs_remove_group+0x80/0x90
      ...
      Call Trace:
       dpm_sysfs_remove+0x57/0x60
       device_del+0xfd/0x350
       device_unregister+0x1a/0x60
       drm_sysfs_connector_remove+0x39/0x50 [drm]
       drm_connector_unregister+0x5a/0x70 [drm]
       drm_connector_unregister_all+0x45/0xa0 [drm]
       drm_modeset_unregister_all+0x12/0x30 [drm]
       drm_dev_unregister+0xca/0xe0 [drm]
       drm_put_dev+0x32/0x60 [drm]
       drm_release+0x2f3/0x380 [drm]
       __fput+0xdf/0x1e0
      ...
      ---[ end trace ecfb91ac85688bbe ]---
      BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8
      IP: down_write+0x1f/0x40
      ...
      Call Trace:
       debugfs_remove_recursive+0x55/0x1b0
       drm_debugfs_connector_remove+0x21/0x40 [drm]
       drm_connector_unregister+0x62/0x70 [drm]
       drm_connector_unregister_all+0x45/0xa0 [drm]
       drm_modeset_unregister_all+0x12/0x30 [drm]
       drm_dev_unregister+0xca/0xe0 [drm]
       drm_put_dev+0x32/0x60 [drm]
       drm_release+0x2f3/0x380 [drm]
       __fput+0xdf/0x1e0
      ...
      ---[ end trace ecfb91ac85688bbf ]---
      
      This is caused by the revert moving back to drm_unplug_dev calling
      drm_minor_unregister which does:
      
              device_del(minor->kdev);
              dev_set_drvdata(minor->kdev, NULL); /* safety belt */
              drm_debugfs_cleanup(minor);
      
      Causing the sysfs entries to already be removed even though we still
      have references to them in e.g. drm_connector.
      
      Note we must call drm_minor_unregister to notify userspace of the unplug
      of the device, so calling drm_dev_unregister is not completely wrong the
      problem is that drm_dev_unregister does too much.
      
      This commit fixes drm_unplug_dev by not only reverting
      commit a39be606 ("drm: Do a full device unregister when unplugging")
      but by also adding a call to drm_modeset_unregister_all before the
      drm_minor_unregister calls to make sure all sysfs entries are removed
      before calling device_del(minor->kdev) thereby also fixing the second
      set of oopses caused by just reverting the commit.
      
      Fixes: a39be606 ("drm: Do a full device unregister when unplugging")
      Cc: stable@vger.kernel.org
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Jeffy <jeffy.chen@rock-chips.com>
      Cc: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
      Reported-by: NMarco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NSean Paul <seanpaul@chromium.org>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170601115430.4113-1-hdegoede@redhat.com
      75fb6363