1. 24 Oct, 2019 13 commits
    • Lyude Paul's avatar
      drm/dp_mst: Add basic topology reprobing when resuming · 6f85f738
      Lyude Paul authored
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-14-lyude@redhat.com
      6f85f738
    • Lyude Paul's avatar
      drm/amdgpu/dm: Resume short HPD IRQs before resuming MST topology · d20ebea8
      Lyude Paul authored
      Since we're going to be reprobing the entire topology state on resume
      now using sideband transactions, we need to ensure that we actually have
      short HPD irqs enabled before calling drm_dp_mst_topology_mgr_resume().
      So, do that.
      
      Changes since v3:
      * Fix typo in comments
      
      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>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-13-lyude@redhat.com
      d20ebea8
    • Lyude Paul's avatar
      drm/amdgpu: Iterate through DRM connectors correctly · 6857f879
      Lyude Paul authored
      Currently, every single piece of code in amdgpu that loops through
      connectors does it incorrectly and doesn't use the proper list iteration
      helpers, drm_connector_list_iter_begin() and
      drm_connector_list_iter_end(). Yeesh.
      
      So, do that.
      
      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: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-12-lyude@redhat.com
      6857f879
    • Lyude Paul's avatar
      drm/nouveau: Resume hotplug interrupts earlier · ac0de16a
      Lyude Paul authored
      Currently, we enable hotplug detection only after we re-enable the
      display. However, this is too late if we're planning on sending sideband
      messages during the resume process - which we'll need to do in order to
      reprobe the topology on resume.
      
      So, enable hotplug events before reinitializing the display.
      
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-11-lyude@redhat.com
      ac0de16a
    • Lyude Paul's avatar
      drm/nouveau: Don't grab runtime PM refs for HPD IRQs · 09e53065
      Lyude Paul authored
      In order for suspend/resume reprobing to work, we need to be able to
      perform sideband communications during suspend/resume, along with
      runtime PM suspend/resume. In order to do so, we also need to make sure
      that nouveau doesn't bother grabbing a runtime PM reference to do so,
      since otherwise we'll start deadlocking runtime PM again.
      
      Note that we weren't able to do this before, because of the DP MST
      helpers processing UP requests from topologies in the same context as
      drm_dp_mst_hpd_irq() which would have caused us to open ourselves up to
      receiving hotplug events and deadlocking with runtime suspend/resume.
      Now that those requests are handled asynchronously, this change should
      be completely safe.
      
      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: default avatarBen Skeggs <bskeggs@redhat.com>
      Reviewed-by: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-10-lyude@redhat.com
      09e53065
    • Lyude Paul's avatar
      drm/dp_mst: Lessen indenting in drm_dp_mst_topology_mgr_resume() · 79413ed4
      Lyude Paul authored
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-9-lyude@redhat.com
      79413ed4
    • Lyude Paul's avatar
      drm/dp_mst: Don't forget to update port->input in drm_dp_mst_handle_conn_stat() · dad7d84f
      Lyude Paul authored
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-8-lyude@redhat.com
      dad7d84f
    • Lyude Paul's avatar
      drm/dp_mst: Protect drm_dp_mst_port members with locking · 3f9b3f02
      Lyude Paul authored
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-7-lyude@redhat.com
      3f9b3f02
    • Lyude Paul's avatar
      drm/dp_mst: Add probe_lock · 14692a36
      Lyude Paul authored
      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: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarSean 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
    • Lyude Paul's avatar
      drm/dp_mst: Handle UP requests asynchronously · 9408cc94
      Lyude Paul authored
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-5-lyude@redhat.com
      9408cc94
    • Lyude Paul's avatar
      drm/dp_mst: Refactor pdt setup/teardown, add more locking · c485e2c9
      Lyude Paul authored
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-4-lyude@redhat.com
      c485e2c9
    • Lyude Paul's avatar
      drm/dp_mst: Remove PDT teardown in drm_dp_destroy_port() and refactor · d29333cf
      Lyude Paul authored
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-3-lyude@redhat.com
      d29333cf
    • Lyude Paul's avatar
      drm/dp_mst: Destroy MSTBs asynchronously · 7cb12d48
      Lyude Paul authored
      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: default avatarSean Paul <sean@poorly.run>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-2-lyude@redhat.com
      7cb12d48
  2. 23 Oct, 2019 1 commit
  3. 22 Oct, 2019 3 commits
    • Dave Airlie's avatar
      Merge tag 'du-next-20191016' of git://linuxtv.org/pinchartl/media into drm-next · f1b4a921
      Dave Airlie authored
      - R-Car DU support for R8A774B1 SoC
      - R-Car DU fixes for H2 ES2.0 and later revisions
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191015215116.GF19403@pendragon.ideasonboard.com
      f1b4a921
    • Dave Airlie's avatar
      Merge tag 'mediatek-drm-next-5.5' of https://github.com/ckhu-mediatek/linux.git-tags into drm-next · 400e9134
      Dave Airlie authored
      Mediatek DRM next for Linux 5.5
      
      This include mipi_tx, dsi, and partial crtc for MT8183 SoC.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: CK Hu <ck.hu@mediatek.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1571103548.4416.6.camel@mtksdaap41
      400e9134
    • Dave Airlie's avatar
      Merge tag 'drm-intel-next-2019-10-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-next · 89910e62
      Dave Airlie authored
      UAPI Changes:
      
      - Introduce a versioning of the i915-perf uapi (Lionel)
      - Add support for perf configuration queries (Lionel)
      
        Allow listing perf configurations with IOCTL in addition
        to sysfs. This is useful in container usecases.
      
      - Allow dynamic reconfiguration of the OA stream (Chris)
      
        Allows the OA stream to be reconfigured between
        batch buffers, giving greater flexibility in sampling.
      
      - Allow holding preemption on filtered perf ctx
      
        Allow CAP_ADMIN to block pre-emption of a context
        to query performance counters without disturbances.
      
        Mesa changes: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/932
      
      Cross-subsystem Changes:
      
      - drm-next backmerge for HDR DP changes
        https://lists.freedesktop.org/archives/dri-devel/2019-September/236453.html
      
      Driver Changes:
      
      - Add DC3CO sleep state for Tigerlake (Anshuman)
      - Tigerlake BCS engine support engine relative MMIO (Daniele)
      - Simplify the Tigerlake LRC register list for !RCS (Daniele)
      - Read SAGV block time from PCODE on Tigerlake (James)
      - Add 12 missing Tigerlake workarounds (Mika)
      - Enable DDI/Port G for Tigerlake (Khaled)
      
      - Avoid hang in tsg,vfe units by keeping l3 clocks ICL+(Mika)
      - Fix Bugzilla #111966: Favor last VBT child device (Ville)
      - Fix blue/black screen on boot due to broken gamma (Swati)
      - Add support of BT.2020 Colorimetry to DP MSA (Gwan-gyeong)
      - Attach colorspace property to DP connector (Gwan-gyeong)
      - Attach HDR metadata property to DP connector (Gwan-gyeong)
      - Base intel_memory_region support prep for local memory (Matt A)
      - Introduce Jasper Lake PCH (Matt R)
      - Support multiple GPUs in PMU (Tvrtko)
      - Fix MST oops due to MSA changes (Ville)
      - Refuse modes with hdisplay==4096 on pre-HSW DP (Ville)
      - Correct the PCH type in irq postinstall for JSP (Vivek)
      - Save Master transcoder in slave's crtc_state for Transcoder Port Sync (Manasi)
      - Enable TRANSCODER PORT SYNC for tiled displays across separate ports (Manasi)
      - HW state readout for transcoder port sync config (Manasi)
      - Enable master-slaves in trans port sync (Manasi)
      - In port sync mode disable slaves first then master (Manasi)
      - Fix port checks for MST support on gen >= 11 (Lucas)
      
      - Flush submission tasklet before waiting/retiring (Chris)
      - Flush tasklet submission before sleeping on i915_request_wait (Chris)
      - Object pin reference counting fixes (Chris, Matt A)
      - Clear semaphore immediately upon ELSP promotion (Chris)
      - Child device size remains unchanged through VBT 229 (Matt R)
      - Restore dropped 'interruptible' flag on retiring requests (Chris)
      - Treat a busy timeline as 'active' while waiting (Chris)
      - Clean up struct_mutex from perf (Chris)
      - Update locking around execlists->active (Chris)
      - Mark up expected execlist state during reset (Chris)
      - Remove cursor use of properties for coordinates (Maarten)
      - Only mark incomplete requests as -EIO on cancelling (Chris)
      - Add an rcu_barrier option to i915_drop_caches (Chris)
      - Replace perf global wakeref tracking with engine-pm (Chris)
      - Prevent merging requests with conflicting flags (Chris)
      - Allow for CS OA configs to be created lazily (Lionel)
      - Implement active wait for noa configurations (Lionel)
      - Execute OA configuration from command stream (Lionel)
      - Prefer using the pinned_ctx for emitting delays on config (Chris)
      - Port C's hotplug interrupt is associated with TC1 bits (Vivek, Matt R)
      - Extend program of VSC Header and DB for Colorimetry Format (Gwan-gyeong)
      - Fine-tune timeslicing of contexts (Chris)
      - Do initial mocs configuration directly (Chris)
      - Fix uninitialized variable on PMU error path (Tvrtko)
      - Don't disable interrupts independently of the locking (Sebastian)
      - Eliminate struct_mutext from GVT (Chris)
      
      - Move perf types to their own header (Lionel)
      - Drop list of perf streams (always size 1) (Lionel)
      - Store the perf associated engine of a stream (Lionel)
      - Make array hw_engine_mask static (Colin)
      - Prefer shortest path to RPM/perf/GT instead of dev_priv (Chris, Tvrtko)
      - Virtual request submission fixes (Chris)
      - Selftest/CI improvements (Chris)
      - Fix Kconfig indentation (Krzysztof)
      - Give engine->kernel_context distinct timeline lock classes (Chris)
      - Fix null pointer deref on selftest error path (Colin)
      - Select DPLL's via mask (Matt R)
      - Introduce and use intel_atomic_crtc_state_for_each_plane_state (Maarten)
      - Use intel_plane_state in prepare and cleanup plane_fb (Maarten)
      - Remove begin/finish_crtc_commit (Maarten)
      - Move SAGV block time to dev_priv (James)
      - Avoid polluting the i915_oa_config with error pointers (Chris)
      - Squelch display kerneldoc warnings (Chris)
      - Assert tasklet is locked for process_csb() (Chris)
      - Switch to using DP_MSA_MISC_* defines (Ville)
      - Stop using drm_atomic_helper_check_planes() (Ville)
      - Make .modeset_calc_cdclk() mandatory (Ville)
      - Use drm_rect_translate_to()/drm_rect_init() (Ville)
      - Refactor timestamping constants update (Ville)
      - Switch intel_legacy_cursor_update() to intel_ types (Ville)
      - Prepare the connector/encoder mask readout for hw vs. uapi state split (Ville)
      - Prepare the mode readout for hw vs. uapi state split (Ville)
      - Move swizzle_bit under i915_ggtt (Chris)
      - Improve microcontrollers documentation (Daniele)
      - Move the cursor rotation handling into intel_cursor_check_surface() (Ville)
      - Cleanups to pipe code (Ville)
      - Shrink eDRAM ways/sets arrays for code size (Ville)
      - Cleanups to HDCP2 timeout code (Ville)
      - Restore full symmetry in i915_driver_modeset_probe/remove (Janusz)
      - Simplify setting of ddi_io_power_domain (Lucas)
      - Add pipe id/name to pipe mismatch logs (Lucas)
      - Prettify MST debug message (Lucas)
      - Extract GT ring management to separate files (Andi)
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191021180337.GA24338@jlahtine-desk.ger.corp.intel.com
      89910e62
  4. 21 Oct, 2019 2 commits
  5. 20 Oct, 2019 8 commits
  6. 19 Oct, 2019 13 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 531e93d1
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "I was battling a cold after some recent trips, so quite a bit piled up
        meanwhile, sorry about that.
      
        Highlights:
      
         1) Fix fd leak in various bpf selftests, from Brian Vazquez.
      
         2) Fix crash in xsk when device doesn't support some methods, from
            Magnus Karlsson.
      
         3) Fix various leaks and use-after-free in rxrpc, from David Howells.
      
         4) Fix several SKB leaks due to confusion of who owns an SKB and who
            should release it in the llc code. From Eric Biggers.
      
         5) Kill a bunc of KCSAN warnings in TCP, from Eric Dumazet.
      
         6) Jumbo packets don't work after resume on r8169, as the BIOS resets
            the chip into non-jumbo mode during suspend. From Heiner Kallweit.
      
         7) Corrupt L2 header during MPLS push, from Davide Caratti.
      
         8) Prevent possible infinite loop in tc_ctl_action, from Eric
            Dumazet.
      
         9) Get register bits right in bcmgenet driver, based upon chip
            version. From Florian Fainelli.
      
        10) Fix mutex problems in microchip DSA driver, from Marek Vasut.
      
        11) Cure race between route lookup and invalidation in ipv4, from Wei
            Wang.
      
        12) Fix performance regression due to false sharing in 'net'
            structure, from Eric Dumazet"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (145 commits)
        net: reorder 'struct net' fields to avoid false sharing
        net: dsa: fix switch tree list
        net: ethernet: dwmac-sun8i: show message only when switching to promisc
        net: aquantia: add an error handling in aq_nic_set_multicast_list
        net: netem: correct the parent's backlog when corrupted packet was dropped
        net: netem: fix error path for corrupted GSO frames
        macb: propagate errors when getting optional clocks
        xen/netback: fix error path of xenvif_connect_data()
        net: hns3: fix mis-counting IRQ vector numbers issue
        net: usb: lan78xx: Connect PHY before registering MAC
        vsock/virtio: discard packets if credit is not respected
        vsock/virtio: send a credit update when buffer size is changed
        mlxsw: spectrum_trap: Push Ethernet header before reporting trap
        net: ensure correct skb->tstamp in various fragmenters
        net: bcmgenet: reset 40nm EPHY on energy detect
        net: bcmgenet: soft reset 40nm EPHYs before MAC init
        net: phy: bcm7xxx: define soft_reset for 40nm EPHY
        net: bcmgenet: don't set phydev->link from MAC
        net: Update address for MediaTek ethernet driver in MAINTAINERS
        ipv4: fix race condition between route lookup and invalidation
        ...
      531e93d1
    • Eric Dumazet's avatar
      net: reorder 'struct net' fields to avoid false sharing · 2a06b898
      Eric Dumazet authored
      Intel test robot reported a ~7% regression on TCP_CRR tests
      that they bisected to the cited commit.
      
      Indeed, every time a new TCP socket is created or deleted,
      the atomic counter net->count is touched (via get_net(net)
      and put_net(net) calls)
      
      So cpus might have to reload a contended cache line in
      net_hash_mix(net) calls.
      
      We need to reorder 'struct net' fields to move @hash_mix
      in a read mostly cache line.
      
      We move in the first cache line fields that can be
      dirtied often.
      
      We probably will have to address in a followup patch
      the __randomize_layout that was added in linux-4.13,
      since this might break our placement choices.
      
      Fixes: 355b9855 ("netns: provide pure entropy for net_hash_mix()")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a06b898
    • Vivien Didelot's avatar
      net: dsa: fix switch tree list · 50c7d2ba
      Vivien Didelot authored
      If there are multiple switch trees on the device, only the last one
      will be listed, because the arguments of list_add_tail are swapped.
      
      Fixes: 83c0afae ("net: dsa: Add new binding implementation")
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      50c7d2ba
    • Mans Rullgard's avatar
      net: ethernet: dwmac-sun8i: show message only when switching to promisc · 05908d72
      Mans Rullgard authored
      Printing the info message every time more than the max number of mac
      addresses are requested generates unnecessary log spam.  Showing it only
      when the hw is not already in promiscous mode is equally informative
      without being annoying.
      Signed-off-by: default avatarMans Rullgard <mans@mansr.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05908d72
    • Chenwandun's avatar
      net: aquantia: add an error handling in aq_nic_set_multicast_list · 3d00cf2f
      Chenwandun authored
      add an error handling in aq_nic_set_multicast_list, it may not
      work when hw_multicast_list_set error; and at the same time
      it will remove gcc Wunused-but-set-variable warning.
      Signed-off-by: default avatarChenwandun <chenwandun@huawei.com>
      Reviewed-by: default avatarIgor Russkikh <igor.russkikh@aquantia.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d00cf2f
    • David S. Miller's avatar
      Merge branch 'netem-fix-further-issues-with-packet-corruption' · 70873837
      David S. Miller authored
      Jakub Kicinski says:
      
      ====================
      net: netem: fix further issues with packet corruption
      
      This set is fixing two more issues with the netem packet corruption.
      
      First patch (which was previously posted) avoids NULL pointer dereference
      if the first frame gets freed due to allocation or checksum failure.
      v2 improves the clarity of the code a little as requested by Cong.
      
      Second patch ensures we don't return SUCCESS if the frame was in fact
      dropped. Thanks to this commit message for patch 1 no longer needs the
      "this will still break with a single-frame failure" disclaimer.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70873837
    • Jakub Kicinski's avatar
      net: netem: correct the parent's backlog when corrupted packet was dropped · e0ad032e
      Jakub Kicinski authored
      If packet corruption failed we jump to finish_segs and return
      NET_XMIT_SUCCESS. Seeing success will make the parent qdisc
      increment its backlog, that's incorrect - we need to return
      NET_XMIT_DROP.
      
      Fixes: 6071bd1a ("netem: Segment GSO packets on enqueue")
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e0ad032e
    • Jakub Kicinski's avatar
      net: netem: fix error path for corrupted GSO frames · a7fa12d1
      Jakub Kicinski authored
      To corrupt a GSO frame we first perform segmentation.  We then
      proceed using the first segment instead of the full GSO skb and
      requeue the rest of the segments as separate packets.
      
      If there are any issues with processing the first segment we
      still want to process the rest, therefore we jump to the
      finish_segs label.
      
      Commit 177b8007 ("net: netem: fix backlog accounting for
      corrupted GSO frames") started using the pointer to the first
      segment in the "rest of segments processing", but as mentioned
      above the first segment may had already been freed at this point.
      
      Backlog corrections for parent qdiscs have to be adjusted.
      
      Fixes: 177b8007 ("net: netem: fix backlog accounting for corrupted GSO frames")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reported-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7fa12d1
    • Michael Tretter's avatar
      macb: propagate errors when getting optional clocks · bd310aca
      Michael Tretter authored
      The tx_clk, rx_clk, and tsu_clk are optional. Currently the macb driver
      marks clock as not available if it receives an error when trying to get
      a clock. This is wrong, because a clock controller might return
      -EPROBE_DEFER if a clock is not available, but will eventually become
      available.
      
      In these cases, the driver would probe successfully but will never be
      able to adjust the clocks, because the clocks were not available during
      probe, but became available later.
      
      For example, the clock controller for the ZynqMP is implemented in the
      PMU firmware and the clocks are only available after the firmware driver
      has been probed.
      
      Use devm_clk_get_optional() in instead of devm_clk_get() to get the
      optional clock and propagate all errors to the calling function.
      Signed-off-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Tested-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bd310aca
    • Juergen Gross's avatar
      xen/netback: fix error path of xenvif_connect_data() · 3d5c1a03
      Juergen Gross authored
      xenvif_connect_data() calls module_put() in case of error. This is
      wrong as there is no related module_get().
      
      Remove the superfluous module_put().
      
      Fixes: 279f438e ("xen-netback: Don't destroy the netdev until the vif is shut down")
      Cc: <stable@vger.kernel.org> # 3.12
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarPaul Durrant <paul@xen.org>
      Reviewed-by: default avatarWei Liu <wei.liu@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d5c1a03
    • Yonglong Liu's avatar
      net: hns3: fix mis-counting IRQ vector numbers issue · 580a05f9
      Yonglong Liu authored
      Currently, the num_msi_left means the vector numbers of NIC,
      but if the PF supported RoCE, it contains the vector numbers
      of NIC and RoCE(Not expected).
      
      This may cause interrupts lost in some case, because of the
      NIC module used the vector resources which belongs to RoCE.
      
      This patch adds a new variable num_nic_msi to store the vector
      numbers of NIC, and adjust the default TQP numbers and rss_size
      according to the value of num_nic_msi.
      
      Fixes: 46a3df9f ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
      Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      580a05f9
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 998d7551
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "Rather a lot of fixes, almost all affecting mm/"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (26 commits)
        scripts/gdb: fix debugging modules on s390
        kernel/events/uprobes.c: only do FOLL_SPLIT_PMD for uprobe register
        mm/thp: allow dropping THP from page cache
        mm/vmscan.c: support removing arbitrary sized pages from mapping
        mm/thp: fix node page state in split_huge_page_to_list()
        proc/meminfo: fix output alignment
        mm/init-mm.c: include <linux/mman.h> for vm_committed_as_batch
        mm/filemap.c: include <linux/ramfs.h> for generic_file_vm_ops definition
        mm: include <linux/huge_mm.h> for is_vma_temporary_stack
        zram: fix race between backing_dev_show and backing_dev_store
        mm/memcontrol: update lruvec counters in mem_cgroup_move_account
        ocfs2: fix panic due to ocfs2_wq is null
        hugetlbfs: don't access uninitialized memmaps in pfn_range_valid_gigantic()
        mm: memblock: do not enforce current limit for memblock_phys* family
        mm: memcg: get number of pages on the LRU list in memcgroup base on lru_zone_size
        mm/gup: fix a misnamed "write" argument, and a related bug
        mm/gup_benchmark: add a missing "w" to getopt string
        ocfs2: fix error handling in ocfs2_setattr()
        mm: memcg/slab: fix panic in __free_slab() caused by premature memcg pointer release
        mm/memunmap: don't access uninitialized memmap in memunmap_pages()
        ...
      998d7551
    • Ilya Leoshkevich's avatar
      scripts/gdb: fix debugging modules on s390 · 585d730d
      Ilya Leoshkevich authored
      Currently lx-symbols assumes that module text is always located at
      module->core_layout->base, but s390 uses the following layout:
      
        +------+  <- module->core_layout->base
        | GOT  |
        +------+  <- module->core_layout->base + module->arch->plt_offset
        | PLT  |
        +------+  <- module->core_layout->base + module->arch->plt_offset +
        | TEXT |     module->arch->plt_size
        +------+
      
      Therefore, when trying to debug modules on s390, all the symbol
      addresses are skewed by plt_offset + plt_size.
      
      Fix by adding plt_offset + plt_size to module_addr in
      load_module_symbols().
      
      Link: http://lkml.kernel.org/r/20191017085917.81791-1-iii@linux.ibm.comSigned-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Reviewed-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
      Cc: Kieran Bingham <kbingham@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      585d730d