1. 05 12月, 2019 1 次提交
    • W
      drm/dp_mst: Correct the bug in drm_dp_update_payload_part1() · e5a6ca27
      Wayne Lin 提交于
      [Why]
      If the payload_state is DP_PAYLOAD_DELETE_LOCAL in series, current
      code doesn't delete the payload at current index and just move the
      index to next one after shuffling payloads.
      
      [How]
      Drop the i++ increasing part in for loop head and decide whether
      to increase the index or not according to payload_state of current
      payload.
      
      Changes since v1:
      * Refine the code to have it easy reading
      * Amend the commit message to meet the way code is modified now.
      Signed-off-by: NWayne Lin <Wayne.Lin@amd.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Fixes: 706246c7 ("drm/dp_mst: Refactor drm_dp_update_payload_part1()")
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Juston Li <juston.li@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Sean Paul <sean@poorly.run>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v5.1+
      [Added cc for stable]
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191203042423.5961-1-Wayne.Lin@amd.com
      e5a6ca27
  2. 07 11月, 2019 1 次提交
  3. 06 11月, 2019 1 次提交
    • C
      drm/dp_mst: fix gcc compile error · 68acde76
      Chenwandun 提交于
      drivers/gpu/drm/drm_dp_mst_topology.c: In function __topology_ref_save:
      drivers/gpu/drm/drm_dp_mst_topology.c:1424:6: error: implicit declaration of function stack_trace_save; did you mean stack_depot_save? [-Werror=implicit-function-declaration]
        n = stack_trace_save(stack_entries, ARRAY_SIZE(stack_entries), 1);
            ^~~~~~~~~~~~~~~~
            stack_depot_save
      drivers/gpu/drm/drm_dp_mst_topology.c: In function __dump_topology_ref_history:
      drivers/gpu/drm/drm_dp_mst_topology.c:1513:3: error: implicit declaration of function stack_trace_snprint; did you mean acpi_trace_point? [-Werror=implicit-function-declaration]
         stack_trace_snprint(buf, PAGE_SIZE, entries, nr_entries, 4);
         ^~~~~~~~~~~~~~~~~~~
         acpi_trace_point
      
      stack_trace_save and stack_trace_snprint are declared in <linux/stacktrace.h>,
      so there is need to include it, and <linux/stackdepot.h> is already included
      by practices, so just replace <linux/stackdepot.h> by <linux/stacktrace.h>.
      Signed-off-by: NChenwandun <chenwandun@huawei.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Acked-by: NDaniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1572515029-42087-1-git-send-email-chenwandun@huawei.com
      68acde76
  4. 25 10月, 2019 10 次提交
    • L
      drm/dp_mst: Add topology ref history tracking for debugging · 12a280c7
      Lyude Paul 提交于
      For very subtle mistakes with topology refs, it can be rather difficult
      to trace them down with the debugging info that we already have. I had
      one such issue recently while trying to implement suspend/resume
      reprobing for MST, and ended up coming up with this.
      
      Inspired by Chris Wilson's wakeref tracking for i915, this adds a very
      similar feature to the DP MST helpers, which allows for partial tracking
      of topology refs for both ports and branch devices. This is a lot less
      advanced then wakeref tracking: we merely keep a count of all of the
      spots where a topology ref has been grabbed or dropped, then dump out
      that history in chronological order when a port or branch device's
      topology refcount reaches 0. So far, I've found this incredibly useful
      for debugging topology refcount errors.
      
      Since this has the potential to be somewhat slow and loud, we add an
      expert kernel config option to enable or disable this feature,
      CONFIG_DRM_DEBUG_DP_MST_TOPOLOGY_REFS.
      
      Changes since v1:
      * Don't forget to destroy topology_ref_history_lock
      Changes since v4:
      * Correct order of kref_put()/topology_ref_history_unlock - we can't
        unlock the history after kref_put() since the memory might have been
        freed by that point
      * Don't print message on allocation error failures, the kernel already
        does this for us
      Changes since v5:
      * Get rid of some leftover usages of %px
      * Remove a leftover empty return; statement
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-15-lyude@redhat.com
      12a280c7
    • L
      drm/dp_mst: Add basic topology reprobing when resuming · 6f85f738
      Lyude Paul 提交于
      Finally! For a very long time, our MST helpers have had one very
      annoying issue: They don't know how to reprobe the topology state when
      coming out of suspend. This means that if a user has a machine connected
      to an MST topology and decides to suspend their machine, we lose all
      topology changes that happened during that period. That can be a big
      problem if the machine was connected to a different topology on the same
      port before resuming, as we won't bother reprobing any of the ports and
      likely cause the user's monitors not to come back up as expected.
      
      So, we start fixing this by teaching our MST helpers how to reprobe the
      link addresses of each connected topology when resuming. As it turns
      out, the behavior that we want here is identical to the behavior we want
      when initially probing a newly connected MST topology, with a couple of
      important differences:
      
      - We need to be more careful about handling the potential races between
        events from the MST hub that could change the topology state as we're
        performing the link address reprobe
      - We need to be more careful about handling unlikely state changes on
        ports - such as an input port turning into an output port, something
        that would be far more likely to happen in situations like the MST hub
        we're connected to being changed while we're suspend
      
      Both of which have been solved by previous commits. That leaves one
      requirement:
      
      - We need to prune any MST ports in our in-memory topology state that
        were present when suspending, but have not appeared in the post-resume
        link address response from their parent branch device
      
      Which we can now handle in this commit by modifying
      drm_dp_send_link_address(). We then introduce suspend/resume reprobing
      by introducing drm_dp_mst_topology_mgr_invalidate_mstb(), which we call
      in drm_dp_mst_topology_mgr_suspend() to traverse the in-memory topology
      state to indicate that each mstb needs it's link address resent and PBN
      resources reprobed.
      
      On resume, we start back up &mgr->work and have it reprobe the topology
      in the same way we would on a hotplug, removing any leftover ports that
      no longer appear in the topology state.
      
      Changes since v4:
      * Split indenting changes in drm_dp_mst_topology_mgr_resume() into a
        separate patch
      * Only fire hotplugs when something has actually changed after a link
        address probe
      * Don't try to change port->connector at all on ports, just throw out
        ports that need their connectors removed to make things easier.
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-14-lyude@redhat.com
      6f85f738
    • L
      drm/dp_mst: Lessen indenting in drm_dp_mst_topology_mgr_resume() · 79413ed4
      Lyude Paul 提交于
      Does what it says on the tin.
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-9-lyude@redhat.com
      79413ed4
    • L
      drm/dp_mst: Don't forget to update port->input in drm_dp_mst_handle_conn_stat() · dad7d84f
      Lyude Paul 提交于
      This probably hasn't caused any problems up until now since it's
      probably nearly impossible to encounter this in the wild, however if we
      were to receive a connection status notification from the MST hub after
      resume while we're in the middle of reprobing the link addresses for a
      topology then there's a much larger chance that a port could have
      changed from being an output port to input port (or vice versa). If we
      forget to update this bit of information, we'll potentially ignore a
      valid PDT change on a downstream port because we think it's an input
      port.
      
      So, make sure we read the input_port field in connection status
      notifications in drm_dp_mst_handle_conn_stat() to prevent this from
      happening once we've implemented suspend/resume reprobing.
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-8-lyude@redhat.com
      dad7d84f
    • L
      drm/dp_mst: Protect drm_dp_mst_port members with locking · 3f9b3f02
      Lyude Paul 提交于
      This is a complicated one. Essentially, there's currently a problem in the MST
      core that hasn't really caused any issues that we're aware of (emphasis on "that
      we're aware of"): locking.
      
      When we go through and probe the link addresses and path resources in a
      topology, we hold no locks when updating ports with said information. The
      members I'm referring to in particular are:
      
      - ldps
      - ddps
      - mcs
      - pdt
      - dpcd_rev
      - num_sdp_streams
      - num_sdp_stream_sinks
      - available_pbn
      - input
      - connector
      
      Now that we're handling UP requests asynchronously and will be using some of
      the struct members mentioned above in atomic modesetting in the future for
      features such as PBN validation, this is going to become a lot more important.
      As well, the next few commits that prepare us for and introduce suspend/resume
      reprobing will also need clear locking in order to prevent from additional
      racing hilarities that we never could have hit in the past.
      
      So, let's solve this issue by using &mgr->base.lock, the modesetting
      lock which currently only protects &mgr->base.state. This works
      perfectly because it allows us to avoid blocking connection_mutex
      unnecessarily, and we can grab this in connector detection paths since
      it's a ww mutex. We start by having drm_dp_mst_handle_up_req() hold this
      when updating ports. For drm_dp_mst_handle_link_address_port() things
      are a bit more complicated. As I've learned the hard way, we can grab
      &mgr->lock.base for everything except for port->connector. See, our
      normal driver probing paths end up generating this rather obvious
      lockdep chain:
      
      &drm->mode_config.mutex
        -> crtc_ww_class_mutex/crtc_ww_class_acquire
          -> &connector->mutex
      
      However, sysfs grabs &drm->mode_config.mutex in order to protect itself
      from connector state changing under it. Because this entails grabbing
      kn->count, e.g. the lock that the kernel provides for protecting sysfs
      contexts, we end up grabbing kn->count followed by
      &drm->mode_config.mutex. This ends up creating an extremely rude chain:
      
      &kn->count
        -> &drm->mode_config.mutex
          -> crtc_ww_class_mutex/crtc_ww_class_acquire
            -> &connector->mutex
      
      I mean, look at that thing! It's just evil!!! This gross thing ends up
      making any calls to drm_connector_register()/drm_connector_unregister()
      impossible when holding any kind of modesetting lock. This is annoying
      because ideally, we always want to ensure that
      drm_dp_mst_port->connector never changes when doing an atomic commit or
      check that would affect the atomic topology state so that it can
      reliably and easily be used from future DRM DP MST helpers to assist
      with tasks such as scanning through the current VCPI allocations and
      adding connectors which need to have their allocations updated in
      response to a bandwidth change or the like.
      
      Being able to hold &mgr->base.lock throughout the entire link probe
      process would have been _great_, since we could prevent userspace from
      ever seeing any states in-between individual port changes and as a
      result likely end up with a much faster probe and more consistent
      results from said probes. But without some rework of how we handle
      connector probing in sysfs it's not at all currently possible. In the
      future, maybe we can try using the sysfs locks to protect updates to
      connector probing state and fix this mess.
      
      So for now, to protect everything other than port->connector under
      &mgr->base.lock and ensure that we still have the guarantee that atomic
      check/commit contexts will never see port->connector change we use a
      silly trick. See: port->connector only needs to change in order to
      ensure that input ports (see the MST spec) never have a ghost connector
      associated with them. But, there's nothing stopping us from simply
      throwing the entire port out and creating a new one in order to maintain
      that requirement while still keeping port->connector consistent across
      the lifetime of the port in atomic check/commit contexts. For all
      intended purposes this works fine, as we validate ports in any contexts
      we care about before using them and as such will end up reporting the
      connector as disconnected until it's port's destruction finalizes. So,
      we just do that in cases where we detect port->input has transitioned
      from true->false. We don't need to worry about the other direction,
      since a port without a connector isn't visible to userspace and as such
      doesn't need to be protected by &mgr->base.lock until we finish
      registering a connector for it.
      
      For updating members of drm_dp_mst_port other than port->connector, we
      simply grab &mgr->base.lock in drm_dp_mst_link_probe_work() for already
      registered ports, update said members and drop the lock before
      potentially registering a connector and probing the link address of it's
      children.
      
      Finally, we modify drm_dp_mst_detect_port() to take a modesetting lock
      acquisition context in order to acquire &mgr->base.lock under
      &connection_mutex and convert all it's users over to using the
      .detect_ctx probe hooks.
      
      With that, we finally have well defined locking.
      
      Changes since v4:
      * Get rid of port->mutex, stop using connection_mutex and just use our own
        modesetting lock - mgr->base.lock. Also, add a probe_lock that comes
        before this patch.
      * Just throw out ports that get changed from an output to an input, and
        replace them with new ports. This lets us ensure that modesetting
        contexts never see port->connector go from having a connector to being
        NULL.
      * Write an extremely detailed explanation of what problems this is
        trying to fix, since there's a _lot_ of context here and I honestly
        forgot some of it myself a couple times.
      * Don't grab mgr->lock when reading port->mstb in
        drm_dp_mst_handle_link_address_port(). It's not needed.
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-7-lyude@redhat.com
      3f9b3f02
    • L
      drm/dp_mst: Add probe_lock · 14692a36
      Lyude Paul 提交于
      Currently, MST lacks locking in a lot of places that really should have
      some sort of locking. Hotplugging and link address code paths are some
      of the offenders here, as there is actually nothing preventing us from
      running a link address probe while at the same time handling a
      connection status update request - something that's likely always been
      possible but never seen in the wild because hotplugging has been broken
      for ages now (with the exception of amdgpu, for reasons I don't think
      are worth digging into very far).
      
      Note: I'm going to start using the term "in-memory topology layout" here
      to refer to drm_dp_mst_port->mstb and drm_dp_mst_branch->ports.
      
      Locking in these places is a little tougher then it looks though.
      Generally we protect anything having to do with the in-memory topology
      layout under &mgr->lock. But this becomes nearly impossible to do from
      the context of link address probes due to the fact that &mgr->lock is
      usually grabbed under random various modesetting locks, meaning that
      there's no way we can just invert the &mgr->lock order and keep it
      locked throughout the whole process of updating the topology.
      
      Luckily there are only two workers which can modify the in-memory
      topology layout: drm_dp_mst_up_req_work() and
      drm_dp_mst_link_probe_work(), meaning as long as we prevent these two
      workers from traveling the topology layout in parallel with the intent
      of updating it we don't need to worry about grabbing &mgr->lock in these
      workers for reads. We only need to grab &mgr->lock in these workers for
      writes, so that readers outside these two workers are still protected
      from the topology layout changing beneath them.
      
      So, add the new &mgr->probe_lock and use it in both
      drm_dp_mst_link_probe_work() and drm_dp_mst_up_req_work(). Additionally,
      add some more detailed explanations for how this locking is intended to
      work to drm_dp_mst_port->mstb and drm_dp_mst_branch->ports.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-6-lyude@redhat.com
      14692a36
    • L
      drm/dp_mst: Handle UP requests asynchronously · 9408cc94
      Lyude Paul 提交于
      Once upon a time, hotplugging devices on MST branches actually worked in
      DRM. Now, it only works in amdgpu (likely because of how it's hotplug
      handlers are implemented). On both i915 and nouveau, hotplug
      notifications from MST branches are noticed - but trying to respond to
      them causes messaging timeouts and causes the whole topology state to go
      out of sync with reality, usually resulting in the user needing to
      replug the entire topology in hopes that it actually fixes things.
      
      The reason for this is because the way we currently handle UP requests
      in MST is completely bogus. drm_dp_mst_handle_up_req() is called from
      drm_dp_mst_hpd_irq(), which is usually called from the driver's hotplug
      handler. Because we handle sending the hotplug event from this function,
      we actually cause the driver's hotplug handler (and in turn, all
      sideband transactions) to block on
      drm_device->mode_config.connection_mutex. This makes it impossible to
      send any sideband messages from the driver's connector probing
      functions, resulting in the aforementioned sideband message timeout.
      
      There's even more problems with this beyond breaking hotplugging on MST
      branch devices. It also makes it almost impossible to protect
      drm_dp_mst_port struct members under a lock because we then have to
      worry about dealing with all of the lock dependency issues that ensue.
      
      So, let's finally actually fix this issue by handling the processing of
      up requests asyncronously. This way we can send sideband messages from
      most contexts without having to deal with getting blocked if we hold
      connection_mutex. This also fixes MST branch device hotplugging on i915,
      finally!
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-5-lyude@redhat.com
      9408cc94
    • L
      drm/dp_mst: Refactor pdt setup/teardown, add more locking · c485e2c9
      Lyude Paul 提交于
      Since we're going to be implementing suspend/resume reprobing very soon,
      we need to make sure we are extra careful to ensure that our locking
      actually protects the topology state where we expect it to. Turns out
      this isn't the case with drm_dp_port_setup_pdt() and
      drm_dp_port_teardown_pdt(), both of which change port->mstb without
      grabbing &mgr->lock.
      
      Additionally, since most callers of these functions are just using it to
      teardown the port's previous PDT and setup a new one we can simplify
      things a bit and combine drm_dp_port_setup_pdt() and
      drm_dp_port_teardown_pdt() into a single function:
      drm_dp_port_set_pdt(). This function also handles actually ensuring that
      we grab the correct locks when we need to modify port->mstb.
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-4-lyude@redhat.com
      c485e2c9
    • L
      drm/dp_mst: Remove PDT teardown in drm_dp_destroy_port() and refactor · d29333cf
      Lyude Paul 提交于
      This will allow us to add some locking for port->* members, in
      particular the PDT and ->connector, which can't be done from
      drm_dp_destroy_port() since we don't know what locks the caller might be
      holding.
      
      Note that we already do this in delayed_destroy_work (renamed from
      destroy_connector_work in this patch) for ports, we're just making it so
      mstbs are also destroyed in this worker.
      
      Changes since v2:
      * Clarify commit message
      Changes since v4:
      * Clarify commit message more
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-3-lyude@redhat.com
      d29333cf
    • L
      drm/dp_mst: Destroy MSTBs asynchronously · 7cb12d48
      Lyude Paul 提交于
      When reprobing an MST topology during resume, we have to account for the
      fact that while we were suspended it's possible that mstbs may have been
      removed from any ports in the topology. Since iterating downwards in the
      topology requires that we hold &mgr->lock, destroying MSTBs from this
      context would result in attempting to lock &mgr->lock a second time and
      deadlocking.
      
      So, fix this by first moving destruction of MSTBs into
      destroy_connector_work, then rename destroy_connector_work and friends
      to reflect that they now destroy both ports and mstbs.
      
      Note that even though this means that MSTBs will still be accessible for
      a short period of time between their removal from the topology and
      delayed destruction, we are still protected against referencing a MSTB
      with a refcount of 0 since we use kref_get_unless_zero() in most places.
      
      Changes since v1:
      * s/destroy_connector_list/destroy_port_list/
        s/connector_destroy_lock/delayed_destroy_lock/
        s/connector_destroy_work/delayed_destroy_work/
        s/drm_dp_finish_destroy_branch_device/drm_dp_delayed_destroy_mstb/
        s/drm_dp_finish_destroy_port/drm_dp_delayed_destroy_port/
        - danvet
      * Use two loops in drm_dp_delayed_destroy_work() - danvet
      * Better explain why we need to do this - danvet
      * Use cancel_work_sync() instead of flush_work() - flush_work() doesn't
        account for work requeing
      
      Cc: Juston Li <juston.li@intel.com>
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harry Wentland <hwentlan@amd.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-2-lyude@redhat.com
      7cb12d48
  5. 22 10月, 2019 1 次提交
  6. 15 10月, 2019 1 次提交
  7. 10 10月, 2019 1 次提交
  8. 02 10月, 2019 1 次提交
  9. 01 10月, 2019 3 次提交
  10. 26 9月, 2019 3 次提交
  11. 04 9月, 2019 11 次提交
  12. 27 7月, 2019 1 次提交
    • S
      drm/mst: Fix sphinx warnings in drm_dp_msg_connector register functions · 63b87c31
      Sean Paul 提交于
      Fixes the following warnings:
      
      ../drivers/gpu/drm/drm_dp_mst_topology.c:1593: warning: Excess function parameter 'drm_connector' description in 'drm_dp_mst_connector_late_register'
      ../drivers/gpu/drm/drm_dp_mst_topology.c:1613: warning: Excess function parameter 'drm_connector' description in 'drm_dp_mst_connector_early_unregister'
      ../drivers/gpu/drm/drm_dp_mst_topology.c:1594: warning: Function parameter or member 'connector' not described in 'drm_dp_mst_connector_late_register'
      ../drivers/gpu/drm/drm_dp_mst_topology.c:1614: warning: Function parameter or member 'connector' not described in 'drm_dp_mst_connector_early_unregister'
      
      Fixes: 562836a2 ("drm/dp_mst: Enable registration of AUX devices for MST ports")
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: Sean Paul <sean@poorly.run>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NSean Paul <seanpaul@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190726142057.224121-1-sean@poorly.run
      63b87c31
  13. 26 7月, 2019 1 次提交
    • V
      drm/dp_mst: Enable registration of AUX devices for MST ports · 562836a2
      Ville Syrjälä 提交于
      All available downstream ports - physical and logical - are exposed for
      each MST device. They are listed in /dev/, following the same naming
      scheme as SST devices by appending an incremental ID.
      
      Although all downstream ports are exposed, only some will work as
      expected. Consider the following topology:
      
                     +---------+
                     |  ASIC   |
                     +---------+
                    Conn-0|
                          |
                     +----v----+
                +----| MST HUB |----+
                |    +---------+    |
                |                   |
                |Port-1       Port-2|
          +-----v-----+       +-----v-----+
          |  MST      |       |  SST      |
          |  Display  |       |  Display  |
          +-----------+       +-----------+
                |Port-1
                x
      
       MST Path  | MST Device
       ----------+----------------------------------
       sst:0     | MST Hub
       mst:0-1   | MST Display
       mst:0-1-1 | MST Display's disconnected DP out
       mst:0-1-8 | MST Display's internal sink
       mst:0-2   | SST Display
      
      On certain MST displays, the upstream physical port will ACK DPCD reads.
      However, reads on the local logical port to the internal sink will
      *NAK*. i.e. reading mst:0-1 ACKs, but mst:0-1-8 NAKs.
      
      There may also be duplicates. Some displays will return the same GUID
      when reading DPCD from both mst:0-1 and mst:0-1-8.
      
      There are some device-dependent behavior as well. The MST hub used
      during testing will actually *ACK* read requests on a disconnected
      physical port, whereas the MST displays will NAK.
      
      In light of these discrepancies, it's simpler to expose all downstream
      ports - both physical and logical - and let the user decide what to use.
      
      v3 changes:
      * Change WARN_ON_ONCE -> DRM_ERROR on dpcd read errors
      * Docstring and cosmetic fixes
      
      v2 changes:
      
      Moved remote aux device (un)registration to new mst connector late
      register and early unregister helpers. Drivers should call these from
      their own mst connector function hooks.
      
      This is to solve an issue during driver unload, where mst connector
      devices are unregistered before the remote aux devices are. In a setup
      where aux devices are created as children of connector devices, the aux
      device would be removed too early, and uncleanly. Doing so in
      early_unregister solves this issue, as that is called before connector
      unregistration.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NLeo Li <sunpeng.li@amd.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NHarry Wentland <harry.wentland@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190723232808.28128-3-sunpeng.li@amd.com
      562836a2
  14. 30 5月, 2019 1 次提交
    • I
      drm/mst: Fix MST sideband up-reply failure handling · d8fd3722
      Imre Deak 提交于
      Fix the breakage resulting in the stacktrace below, due to tx queue
      being full when trying to send an up-reply. txmsg->seqno is -1 in this
      case leading to a corruption of the mstb object by
      
      	txmsg->dst->tx_slots[txmsg->seqno] = NULL;
      
      in process_single_up_tx_qlock().
      
      [  +0,005162] [drm:process_single_tx_qlock [drm_kms_helper]] set_hdr_from_dst_qlock: failed to find slot
      [  +0,000015] [drm:drm_dp_send_up_ack_reply.constprop.19 [drm_kms_helper]] failed to send msg in q -11
      [  +0,000939] BUG: kernel NULL pointer dereference, address: 00000000000005a0
      [  +0,006982] #PF: supervisor write access in kernel mode
      [  +0,005223] #PF: error_code(0x0002) - not-present page
      [  +0,005135] PGD 0 P4D 0
      [  +0,002581] Oops: 0002 [#1] PREEMPT SMP NOPTI
      [  +0,004359] CPU: 1 PID: 1200 Comm: kworker/u16:3 Tainted: G     U            5.2.0-rc1+ #410
      [  +0,008433] Hardware name: Intel Corporation Ice Lake Client Platform/IceLake U DDR4 SODIMM PD RVP, BIOS ICLSFWR1.R00.3175.A00.1904261428 04/26/2019
      [  +0,013323] Workqueue: i915-dp i915_digport_work_func [i915]
      [  +0,005676] RIP: 0010:queue_work_on+0x19/0x70
      [  +0,004372] Code: ff ff ff 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 41 56 49 89 f6 41 55 41 89 fd 41 54 55 53 48 89 d3 9c 5d fa e8 e7 81 0c 00 <f0> 48 0f ba 2b 00 73 31 45 31 e4 f7 c5 00 02 00 00 74 13 e8 cf 7f
      [  +0,018750] RSP: 0018:ffffc900007dfc50 EFLAGS: 00010006
      [  +0,005222] RAX: 0000000000000046 RBX: 00000000000005a0 RCX: 0000000000000001
      [  +0,007133] RDX: 000000000001b608 RSI: 0000000000000000 RDI: ffffffff82121972
      [  +0,007129] RBP: 0000000000000202 R08: 0000000000000000 R09: 0000000000000001
      [  +0,007129] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88847bfa5096
      [  +0,007131] R13: 0000000000000010 R14: ffff88849c08f3f8 R15: 0000000000000000
      [  +0,007128] FS:  0000000000000000(0000) GS:ffff88849dc80000(0000) knlGS:0000000000000000
      [  +0,008083] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  +0,005749] CR2: 00000000000005a0 CR3: 0000000005210006 CR4: 0000000000760ee0
      [  +0,007128] PKRU: 55555554
      [  +0,002722] Call Trace:
      [  +0,002458]  drm_dp_mst_handle_up_req+0x517/0x540 [drm_kms_helper]
      [  +0,006197]  ? drm_dp_mst_hpd_irq+0x5b/0x9c0 [drm_kms_helper]
      [  +0,005764]  drm_dp_mst_hpd_irq+0x5b/0x9c0 [drm_kms_helper]
      [  +0,005623]  ? intel_dp_hpd_pulse+0x205/0x370 [i915]
      [  +0,005018]  intel_dp_hpd_pulse+0x205/0x370 [i915]
      [  +0,004836]  i915_digport_work_func+0xbb/0x140 [i915]
      [  +0,005108]  process_one_work+0x245/0x610
      [  +0,004027]  worker_thread+0x37/0x380
      [  +0,003684]  ? process_one_work+0x610/0x610
      [  +0,004184]  kthread+0x119/0x130
      [  +0,003240]  ? kthread_park+0x80/0x80
      [  +0,003668]  ret_from_fork+0x24/0x50
      
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190523212433.9058-1-imre.deak@intel.com
      d8fd3722
  15. 06 5月, 2019 1 次提交
  16. 15 3月, 2019 1 次提交
  17. 07 2月, 2019 1 次提交