1. 16 Sep, 2016 27 commits
    • Robin Murphy's avatar
      iommu/dma: Avoid PCI host bridge windows · fade1ec0
      Robin Murphy authored
      With our DMA ops enabled for PCI devices, we should avoid allocating
      IOVAs which a host bridge might misinterpret as peer-to-peer DMA and
      lead to faults, corruption or other badness. To be safe, punch out holes
      for all of the relevant host bridge's windows when initialising a DMA
      domain for a PCI device.
      
      CC: Marek Szyprowski <m.szyprowski@samsung.com>
      CC: Inki Dae <inki.dae@samsung.com>
      Reported-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      fade1ec0
    • Robin Murphy's avatar
      iommu/dma: Add support for mapping MSIs · 44bb7e24
      Robin Murphy authored
      When an MSI doorbell is located downstream of an IOMMU, attaching
      devices to a DMA ops domain and switching on translation leads to a rude
      shock when their attempt to write to the physical address returned by
      the irqchip driver faults (or worse, writes into some already-mapped
      buffer) and no interrupt is forthcoming.
      
      Address this by adding a hook for relevant irqchip drivers to call from
      their compose_msi_msg() callback, to swizzle the physical address with
      an appropriatly-mapped IOVA for any device attached to one of our DMA
      ops domains.
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      44bb7e24
    • Robin Murphy's avatar
      iommu/arm-smmu: Set domain geometry · 455eb7d3
      Robin Murphy authored
      For non-aperture-based IOMMUs, the domain geometry seems to have become
      the de-facto way of indicating the input address space size. That is
      quite a useful thing from the users' perspective, so let's do the same.
      Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
      Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      455eb7d3
    • Robin Murphy's avatar
      iommu/arm-smmu: Wire up generic configuration support · 021bb842
      Robin Murphy authored
      With everything else now in place, fill in an of_xlate callback and the
      appropriate registration to plumb into the generic configuration
      machinery, and watch everything just work.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      021bb842
    • Robin Murphy's avatar
      Docs: dt: document ARM SMMU generic binding usage · d0acbb75
      Robin Murphy authored
      Document how the generic "iommus" binding should be used to describe ARM
      SMMU stream IDs instead of the old "mmu-masters" binding.
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      d0acbb75
    • Robin Murphy's avatar
      iommu/arm-smmu: Convert to iommu_fwspec · adfec2e7
      Robin Murphy authored
      In the final step of preparation for full generic configuration support,
      swap our fixed-size master_cfg for the generic iommu_fwspec. For the
      legacy DT bindings, the driver simply gets to act as its own 'firmware'.
      Farewell, arbitrary MAX_MASTER_STREAMIDS!
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      adfec2e7
    • Robin Murphy's avatar
      iommu/arm-smmu: Intelligent SMR allocation · 588888a7
      Robin Murphy authored
      Stream Match Registers are one of the more awkward parts of the SMMUv2
      architecture; there are typically never enough to assign one to each
      stream ID in the system, and configuring them such that a single ID
      matches multiple entries is catastrophically bad - at best, every
      transaction raises a global fault; at worst, they go *somewhere*.
      
      To address the former issue, we can mask ID bits such that a single
      register may be used to match multiple IDs belonging to the same device
      or group, but doing so also heightens the risk of the latter problem
      (which can be nasty to debug).
      
      Tackle both problems at once by replacing the simple bitmap allocator
      with something much cleverer. Now that we have convenient in-memory
      representations of the stream mapping table, it becomes straightforward
      to properly validate new SMR entries against the current state, opening
      the door to arbitrary masking and SMR sharing.
      
      Another feature which falls out of this is that with IDs shared by
      separate devices being automatically accounted for, simply associating a
      group pointer with the S2CR offers appropriate group allocation almost
      for free, so hook that up in the process.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      588888a7
    • Robin Murphy's avatar
      iommu/arm-smmu: Add a stream map entry iterator · d3097e39
      Robin Murphy authored
      We iterate over the SMEs associated with a master config quite a lot in
      various places, and are about to do so even more. Let's wrap the idiom
      in a handy iterator macro before the repetition gets out of hand.
      Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      d3097e39
    • Robin Murphy's avatar
      iommu/arm-smmu: Streamline SMMU data lookups · d6fc5d97
      Robin Murphy authored
      Simplify things somewhat by stashing our arm_smmu_device instance in
      drvdata, so that it's readily available to our driver model callbacks.
      Then we can excise the private list entirely, since the driver core
      already has a perfectly good list of SMMU devices we can use in the one
      instance we actually need to. Finally, make a further modest code saving
      with the relatively new of_device_get_match_data() helper.
      Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      d6fc5d97
    • Robin Murphy's avatar
      iommu/arm-smmu: Refactor mmu-masters handling · f80cd885
      Robin Murphy authored
      To be able to support the generic bindings and handle of_xlate() calls,
      we need to be able to associate SMMUs and stream IDs directly with
      devices *before* allocating IOMMU groups. Furthermore, to support real
      default domains with multi-device groups we also have to handle domain
      attach on a per-device basis, as the "whole group at a time" assumption
      fails to properly handle subsequent devices added to a group after the
      first has already triggered default domain creation and attachment.
      
      To that end, use the now-vacant dev->archdata.iommu field for easy
      config and SMMU instance lookup, and unify config management by chopping
      down the platform-device-specific tree and probing the "mmu-masters"
      property on-demand instead. This may add a bit of one-off overhead to
      initially adding a new device, but we're about to deprecate that binding
      in favour of the inherently-more-efficient generic ones anyway.
      
      For the sake of simplicity, this patch does temporarily regress the case
      of aliasing PCI devices by losing the duplicate stream ID detection that
      the previous per-group config had. Stay tuned, because we'll be back to
      fix that in a better and more general way momentarily...
      Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      f80cd885
    • Robin Murphy's avatar
      iommu/arm-smmu: Keep track of S2CR state · 8e8b203e
      Robin Murphy authored
      Making S2CRs first-class citizens within the driver with a high-level
      representation of their state offers a neat solution to a few problems:
      
      Firstly, the information about which context a device's stream IDs are
      associated with is already present by necessity in the S2CR. With that
      state easily accessible we can refer directly to it and obviate the need
      to track an IOMMU domain in each device's archdata (its earlier purpose
      of enforcing correct attachment of multi-device groups now being handled
      by the IOMMU core itself).
      
      Secondly, the core API now deprecates explicit domain detach and expects
      domain attach to move devices smoothly from one domain to another; for
      SMMUv2, this notion maps directly to simply rewriting the S2CRs assigned
      to the device. By giving the driver a suitable abstraction of those
      S2CRs to work with, we can massively reduce the overhead of the current
      heavy-handed "detach, free resources, reallocate resources, attach"
      approach.
      
      Thirdly, making the software state hardware-shaped and attached to the
      SMMU instance once again makes suspend/resume of this register group
      that much simpler to implement in future.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      8e8b203e
    • Robin Murphy's avatar
      iommu/arm-smmu: Consolidate stream map entry state · 1f3d5ca4
      Robin Murphy authored
      In order to consider SMR masking, we really want to be able to validate
      ID/mask pairs against existing SMR contents to prevent stream match
      conflicts, which at best would cause transactions to fault unexpectedly,
      and at worst lead to silent unpredictable behaviour. With our SMMU
      instance data holding only an allocator bitmap, and the SMR values
      themselves scattered across master configs hanging off devices which we
      may have no way of finding, there's essentially no way short of digging
      everything back out of the hardware. Similarly, the thought of power
      management ops to support suspend/resume faces the exact same problem.
      
      By massaging the software state into a closer shape to the underlying
      hardware, everything comes together quite nicely; the allocator and the
      high-level view of the data become a single centralised state which we
      can easily keep track of, and to which any updates can be validated in
      full before being synchronised to the hardware itself.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      1f3d5ca4
    • Robin Murphy's avatar
      iommu/arm-smmu: Handle stream IDs more dynamically · 21174240
      Robin Murphy authored
      Rather than assuming fixed worst-case values for stream IDs and SMR
      masks, keep track of whatever implemented bits the hardware actually
      reports. This also obviates the slightly questionable validation of SMR
      fields in isolation - rather than aborting the whole SMMU probe for a
      hardware configuration which is still architecturally valid, we can
      simply refuse masters later if they try to claim an unrepresentable ID
      or mask (which almost certainly implies a DT error anyway).
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      21174240
    • Robin Murphy's avatar
      iommu/arm-smmu: Set PRIVCFG in stage 1 STEs · 95fa99aa
      Robin Murphy authored
      Implement the SMMUv3 equivalent of d346180e ("iommu/arm-smmu: Treat
      all device transactions as unprivileged"), so that once again those
      pesky DMA controllers with their privileged instruction fetches don't
      unexpectedly fault in stage 1 domains due to VMSAv8 rules.
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      95fa99aa
    • Robin Murphy's avatar
      iommu/arm-smmu: Support non-PCI devices with SMMUv3 · 08d4ca2a
      Robin Murphy authored
      With the device <-> stream ID relationship suitably abstracted and
      of_xlate() hooked up, the PCI dependency now looks, and is, entirely
      arbitrary. Any bus using the of_dma_configure() mechanism will work,
      so extend support to the platform and AMBA buses which do just that.
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      08d4ca2a
    • Robin Murphy's avatar
      iommu/arm-smmu: Implement of_xlate() for SMMUv3 · 8f785154
      Robin Murphy authored
      Now that we can properly describe the mapping between PCI RIDs and
      stream IDs via "iommu-map", and have it fed it to the driver
      automatically via of_xlate(), rework the SMMUv3 driver to benefit from
      that, and get rid of the current misuse of the "iommus" binding.
      
      Since having of_xlate wired up means that masters will now be given the
      appropriate DMA ops, we also need to make sure that default domains work
      properly. This necessitates dispensing with the "whole group at a time"
      notion for attaching to a domain, as devices which share a group get
      attached to the group's default domain one by one as they are initially
      probed.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      8f785154
    • Robin Murphy's avatar
      iommu/arm-smmu: Fall back to global bypass · dc87a98d
      Robin Murphy authored
      Unlike SMMUv2, SMMUv3 has no easy way to bypass unknown stream IDs,
      other than allocating and filling in the entire stream table with bypass
      entries, which for some configurations would waste *gigabytes* of RAM.
      Otherwise, all transactions on unknown stream IDs will simply be aborted
      with a C_BAD_STREAMID event.
      
      Rather than render the system unusable in the case of an invalid DT,
      avoid enabling the SMMU altogether such that everything bypasses
      (though letting the explicit disable_bypass option take precedence).
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      dc87a98d
    • Robin Murphy's avatar
      Docs: dt: document ARM SMMUv3 generic binding usage · b9bc8811
      Robin Murphy authored
      We're about to ratify our use of the generic binding, so document it.
      
      CC: Rob Herring <robh+dt@kernel.org>
      CC: Mark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      b9bc8811
    • Robin Murphy's avatar
      iommu: Introduce iommu_fwspec · 57f98d2f
      Robin Murphy authored
      Introduce a common structure to hold the per-device firmware data that
      most IOMMU drivers need to keep track of. This enables us to configure
      much of that data from common firmware code, and consolidate a lot of
      the equivalent implementations, device look-up tables, etc. which are
      currently strewn across IOMMU drivers.
      
      This will also be enable us to address the outstanding "multiple IOMMUs
      on the platform bus" problem by tweaking IOMMU API calls to prefer
      dev->fwspec->ops before falling back to dev->bus->iommu_ops, and thus
      gracefully handle those troublesome systems which we currently cannot.
      
      As the first user, hook up the OF IOMMU configuration mechanism. The
      driver-defined nature of DT cells means that we still need the drivers
      to translate and add the IDs themselves, but future users such as the
      much less free-form ACPI IORT will be much simpler and self-contained.
      
      CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Suggested-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      57f98d2f
    • Robin Murphy's avatar
      iommu/of: Handle iommu-map property for PCI · b996444c
      Robin Murphy authored
      Now that we have a way to pick up the RID translation and target IOMMU,
      hook up of_iommu_configure() to bring PCI devices into the of_xlate
      mechanism and allow them IOMMU-backed DMA ops without the need for
      driver-specific handling.
      Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      b996444c
    • Robin Murphy's avatar
      of/irq: Break out msi-map lookup (again) · 987068fc
      Robin Murphy authored
      The PCI msi-map code is already doing double-duty translating IDs and
      retrieving MSI parents, which unsurprisingly is the same functionality
      we need for the identically-formatted PCI iommu-map property. Drag the
      core parsing routine up yet another layer into the general OF-PCI code,
      and further generalise it for either kind of lookup in either flavour
      of map property.
      Acked-by: default avatarRob Herring <robh+dt@kernel.org>
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Tested-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      987068fc
    • Mark Rutland's avatar
      Docs: dt: add PCI IOMMU map bindings · 6ec2392c
      Mark Rutland authored
      The existing IOMMU bindings are able to specify the relationship between
      masters and IOMMUs, but they are insufficient for describing the general
      case of hotpluggable busses such as PCI where the set of masters is not
      known until runtime, and the relationship between masters and IOMMUs is
      a property of the integration of the system.
      
      This patch adds a generic binding for mapping PCI devices to IOMMUs,
      using a new iommu-map property (specific to PCI*) which may be used to
      map devices (identified by their Requester ID) to sideband data for the
      IOMMU which they master through.
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      6ec2392c
    • Will Deacon's avatar
      iommu/arm-smmu: Disable interrupts whilst holding the cmdq lock · 8ded2909
      Will Deacon authored
      The cmdq lock is taken whenever we issue commands into the command queue,
      which can occur in IRQ context (as a result of unmap) or in process
      context (as a result of a threaded IRQ handler or device probe).
      
      This can lead to a theoretical deadlock if the interrupt handler
      performing the unmap hits whilst the lock is taken, so explicitly use
      the {irqsave,irqrestore} spin_lock accessors for the cmdq lock.
      Tested-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      8ded2909
    • Jean-Philippe Brucker's avatar
      iommu/arm-smmu: Fix polling of command queue · bcfced15
      Jean-Philippe Brucker authored
      When the SMMUv3 driver attempts to send a command, it adds an entry to the
      command queue. This is a circular buffer, where both the producer and
      consumer have a wrap bit. When producer.index == consumer.index and
      producer.wrap == consumer.wrap, the list is empty. When producer.index ==
      consumer.index and producer.wrap != consumer.wrap, the list is full.
      
      If the list is full when the driver needs to add a command, it waits for
      the SMMU to consume one command, and advance the consumer pointer. The
      problem is that we currently rely on "X before Y" operation to know if
      entries have been consumed, which is a bit fiddly since it only makes
      sense when the distance between X and Y is less than or equal to the size
      of the queue. At the moment when the list is full, we use "Consumer before
      Producer + 1", which is out of range and returns a value opposite to what
      we expect: when the queue transitions to not full, we stay in the polling
      loop and time out, printing an error.
      
      Given that the actual bug was difficult to determine, simplify the polling
      logic by relying exclusively on queue_full and queue_empty, that don't
      have this range constraint. Polling the queue is now straightforward:
      
      * When we want to add a command and the list is full, wait until it isn't
        full and retry.
      * After adding a sync, wait for the list to be empty before returning.
      Suggested-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      bcfced15
    • Robin Murphy's avatar
      iommu/arm-smmu: Support v7s context format · 6070529b
      Robin Murphy authored
      Fill in the last bits of machinery required to drive a stage 1 context
      bank in v7 short descriptor format. By default we'll prefer to use it
      only when the CPUs are also using the same format, such that we're
      guaranteed that everything will be strictly 32-bit.
      Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      6070529b
    • Jean-Philippe Brucker's avatar
      iommu/arm-smmu: Fix event queues synchronization · b4163fb3
      Jean-Philippe Brucker authored
      SMMUv3 only sends interrupts for event queues (EVTQ and PRIQ) when they
      transition from empty to non-empty. At the moment, if the SMMU adds new
      items to a queue before the event thread finished consuming a previous
      batch, the driver ignores any new item. The queue is then stuck in
      non-empty state and all subsequent events will be lost.
      
      As an example, consider the following flow, where (P, C) is the SMMU view
      of producer/consumer indices, and (p, c) the driver view.
      
      						P C | p c
        1. SMMU appends a PPR to the PRI queue,	1 0 | 0 0
                sends an MSI
        2. PRIQ handler is called.			1 0 | 1 0
        3. SMMU appends a PPR to the PRI queue.	2 0 | 1 0
        4. PRIQ thread removes the first element.	2 1 | 1 1
      
        5. PRIQ thread believes that the queue is empty, goes into idle
           indefinitely.
      
      To avoid this, always synchronize the producer index and drain the queue
      once before leaving an event handler. In order to prevent races on the
      local producer index, move all event queue handling into the threads.
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      b4163fb3
    • Peng Fan's avatar
      iommu/arm-smmu: Drop devm_free_irq when driver detach · e2d42311
      Peng Fan authored
      There is no need to call devm_free_irq when driver detach.
      devres_release_all which is called after 'drv->remove' will
      release all managed resources.
      Signed-off-by: default avatarPeng Fan <van.freenix@gmail.com>
      Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      e2d42311
  2. 28 Aug, 2016 7 commits
    • Linus Torvalds's avatar
      Linux 4.8-rc4 · 3eab887a
      Linus Torvalds authored
      3eab887a
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-4.8-rc4' of git://people.freedesktop.org/~airlied/linux · 25d0d91a
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "A bunch of fixes covering i915, amdgpu, one tegra and some core DRM
        ones.  Nothing too strange at this point"
      
      * tag 'drm-fixes-for-4.8-rc4' of git://people.freedesktop.org/~airlied/linux: (21 commits)
        drm/atomic: Don't potentially reset color_mgmt_changed on successive property updates.
        drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION
        drm/amdgpu: skip TV/CV in display parsing
        drm/amdgpu: avoid a possible array overflow
        drm/amdgpu: fix lru size grouping v2
        drm/tegra: dsi: Enhance runtime power management
        drm/i915: Fix botched merge that downgrades CSR versions.
        drm/i915/skl: Ensure pipes with changed wms get added to the state
        drm/i915/gen9: Only copy WM results for changed pipes to skl_hw
        drm/i915/skl: Add support for the SAGV, fix underrun hangs
        drm/i915/gen6+: Interpret mailbox error flags
        drm/i915: Reattach comment, complete type specification
        drm/i915: Unconditionally flush any chipset buffers before execbuf
        drm/i915/gen9: Drop invalid WARN() during data rate calculation
        drm/i915/gen9: Initialize intel_state->active_crtcs during WM sanitization (v2)
        drm: Reject page_flip for !DRIVER_MODESET
        drm/amdgpu: fix timeout value check in amd_sched_job_recovery
        drm/amdgpu: fix sdma_v2_4_ring_test_ib
        drm/amdgpu: fix amdgpu_move_blit on 32bit systems
        drm/radeon: fix radeon_move_blit on 32bit systems
        ...
      25d0d91a
    • Mario Kleiner's avatar
      drm/atomic: Don't potentially reset color_mgmt_changed on successive property updates. · add1fa75
      Mario Kleiner authored
      Due to assigning the 'replaced' value instead of or'ing it,
      if drm_atomic_crtc_set_property() gets called multiple times,
      the last call will define the color_mgmt_changed flag, so
      a non-updating call to a property can reset the flag and
      prevent actual hw state updates required by preceding
      property updates.
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: <stable@vger.kernel.org> # v4.6+
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      add1fa75
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 908e373f
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "A few fixes from the perf departement
      
         - prevent a imbalanced preemption disable in the events teardown code
         - prevent out of bound acces in perf userspace
         - make perf tools compile with UCLIBC again
         - a fix for the userspace unwinder utility"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Use this_cpu_ptr() when stopping AUX events
        perf evsel: Do not access outside hw cache name arrays
        tools lib: Reinstate strlcpy() header guard with __UCLIBC__
        perf unwind: Use addr_location::addr instead of ip for entries
      908e373f
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5d84ee79
      Linus Torvalds authored
      Pull x86 fix from Thomas Gleixner:
       "A single bugfix to prevent irq remapping when the ioapic is disabled"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/apic: Do not init irq remapping if ioapic is disabled
      5d84ee79
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4340393e
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "This lot provides:
      
         - plug a hotplug race in the new affinity infrastructure
         - a fix for the trigger type of chained interrupts
         - plug a potential memory leak in the core code
         - a few fixes for ARM and MIPS GICs"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/mips-gic: Implement activate op for device domain
        irqchip/mips-gic: Cleanup chip and handler setup
        genirq/affinity: Use get/put_online_cpus around cpumask operations
        genirq: Fix potential memleak when failing to get irq pm
        irqchip/gicv3-its: Disable the ITS before initializing it
        irqchip/gicv3: Remove disabling redistributor and group1 non-secure interrupts
        irqchip/gic: Allow self-SGIs for SMP on UP configurations
        genirq: Correctly configure the trigger on chained interrupts
      4340393e
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 037d2405
      Linus Torvalds authored
      Pull timer fixes from Thomas Gleixner:
       "A few updates for timers & co:
      
         - prevent a livelock in the timekeeping code when debugging is
           enabled
      
         - prevent out of bounds access in the timekeeping debug code
      
         - various fixes in clocksource drivers
      
         - a new maintainers entry"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        clocksource/drivers/sun4i: Clear interrupts after stopping timer in probe function
        drivers/clocksource/pistachio: Fix memory corruption in init
        clocksource/drivers/timer-atmel-pit: Enable mck clock
        clocksource/drivers/pxa: Fix include files for compilation
        MAINTAINERS: Add ARM ARCHITECTED TIMER entry
        timekeeping: Cap array access in timekeeping_debug
        timekeeping: Avoid taking lock in NMI path with CONFIG_DEBUG_TIMEKEEPING
      037d2405
  3. 27 Aug, 2016 6 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · af56ff27
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "ARM:
         - fixes for ITS init issues, error handling, IRQ leakage, race
           conditions
         - an erratum workaround for timers
         - some removal of misleading use of errors and comments
         - a fix for GICv3 on 32-bit guests
      
        MIPS:
         - fix for where the guest could wrongly map the first page of
           physical memory
      
        x86:
         - nested virtualization fixes"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        MIPS: KVM: Check for pfn noslot case
        kvm: nVMX: fix nested tsc scaling
        KVM: nVMX: postpone VMCS changes on MSR_IA32_APICBASE write
        KVM: nVMX: fix msr bitmaps to prevent L2 from accessing L0 x2APIC
        arm64: KVM: report configured SRE value to 32-bit world
        arm64: KVM: remove misleading comment on pmu status
        KVM: arm/arm64: timer: Workaround misconfigured timer interrupt
        arm64: Document workaround for Cortex-A72 erratum #853709
        KVM: arm/arm64: Change misleading use of is_error_pfn
        KVM: arm64: ITS: avoid re-mapping LPIs
        KVM: arm64: check for ITS device on MSI injection
        KVM: arm64: ITS: move ITS registration into first VCPU run
        KVM: arm64: vgic-its: Make updates to propbaser/pendbaser atomic
        KVM: arm64: vgic-its: Plug race in vgic_put_irq
        KVM: arm64: vgic-its: Handle errors from vgic_add_lpi
        KVM: arm64: ITS: return 1 on successful MSI injection
      af56ff27
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 5e608a02
      Linus Torvalds authored
      Merge fixes from Andrew Morton:
       "11 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm: silently skip readahead for DAX inodes
        dax: fix device-dax region base
        fs/seq_file: fix out-of-bounds read
        mm: memcontrol: avoid unused function warning
        mm: clarify COMPACTION Kconfig text
        treewide: replace config_enabled() with IS_ENABLED() (2nd round)
        printk: fix parsing of "brl=" option
        soft_dirty: fix soft_dirty during THP split
        sysctl: handle error writing UINT_MAX to u32 fields
        get_maintainer: quiet noisy implicit -f vcs_file_exists checking
        byteswap: don't use __builtin_bswap*() with sparse
      5e608a02
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 65fc7d54
      Linus Torvalds authored
      Pull ARM64 fix from Catalin Marinas:
       "ARM64 fix to avoid potential TLB conflict when CONFIG_RANDOMIZE_BASE
        is enabled"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: avoid TLB conflict with CONFIG_RANDOMIZE_BASE
      65fc7d54
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma · a3d34698
      Linus Torvalds authored
      Pull rdma fixes from Doug Ledford:
       "Round one of 4.8 rc fixes.
      
        This should be the bulk of the -rc fixes for 4.8.  I only have a few
        things that are still outstanding (two ipoib bugs for which the
        solution is not yet fully known, and a few queued items that came in
        after my last push and I didn't want to delay this pull request for
        late comers again).
      
        Even though the patch count is kind of high, everything is minor fixes
        so the overall churn is pretty low.
      
        Summary:
      
         - minor fixes to cxgb4
         - minor fixes to mlx4
         - one minor fix each to core, rxe, isert, srpt, mlx5, ocrdma, and usnic
         - six or so fixes to i40iw fixes
         - the rest are hfi1 fixes"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (34 commits)
        i40iw: Send last streaming mode message for loopback connections
        IB/srpt: Update sport->port_guid with each port refresh
        RDMA/ocrdma: Fix the max_sge reported from FW
        i40iw: Avoid writing to freed memory
        i40iw: Fix double free of allocated_buffer
        IB/mlx5: Remove superfluous include of io-mapping.h
        i40iw: Do not set self-referencing pointer to NULL after kfree
        i40iw: Add missing NULL check for MPA private data
        iw_cxgb4: Fix cxgb4 arm CQ logic w/IB_CQ_REPORT_MISSED_EVENTS
        i40iw: Add missing check for interface already open
        i40iw: Protect req_resource_num update
        i40iw: Change mem_resources pointer to a u8
        IB/core: Use memdup_user() rather than duplicating its implementation
        IB/qib: Use memdup_user() rather than duplicating its implementation
        iw_cxgb4: use the MPA initiator's IRD if < our ORD
        iw_cxgb4: limit IRD/ORD advertised to ULP by device max.
        IB/hfi1: Fix mm_struct use after free
        IB/rdmvat: Fix double vfree() in rvt_create_qp() error path
        IB/hfi1: Improve J_KEY generation
        IB/hfi1: Return invalid field for non-QSFP CableInfo queries
        ...
      a3d34698
    • Linus Torvalds's avatar
      Merge tag 'sound-4.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 03cef710
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Here are a bunch of fixes as you can see in diffstat.
      
        One core change in ASoC is about the unexpected unbinding error, and
        another about debugfs cleanup.
      
        The rest are wide-spread driver-specific fixes: a series of LINE6 USB
        fixes, a HD-audio quirk, and various ASoC fixes including OMAP boot
        fixes and Intel SKL fixes"
      
      * tag 'sound-4.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (22 commits)
        ALSA: hda/realtek - fix headset mic detection for MSI MS-B120
        ASoC: omap-mcpdm: Fix irq resource handling
        ASoC: max98371: Add terminate entry for i2c_device_id tables
        ALSA: line6: Fix POD sysfs attributes segfault
        ALSA: line6: Give up on the lock while URBs are released.
        ALSA: line6: Remove double line6_pcm_release() after failed acquire.
        ASoC: omap-abe-twl6040: Correct dmic-codec device registration
        ASoC: core: Clean up DAPM before the card debugfs
        ASoC: omap-mcpdm: Drop pdmclk clock handling
        ASoC: atmel_ssc_dai: Don't unconditionally reset SSC on stream startup
        ASoC: compress: Fix leak of a widget list in soc_compr_open_fe
        ASoC: Intel: Skylake: Fix error return code in skl_probe()
        ASoC: wm2000: Fix return of uninitialised varible
        ASoC: Fix leak of rtd in soc_bind_dai_link
        ASoC: da7213: Default to 64 BCLKs per WCLK to support all formats
        ASoC: nau8825: fix static check error about semaphone control
        ASoC: nau8825: fix bug in playback when suspend
        ASoC: samsung: Fix clock handling in S3C24XX_UDA134X card
        ASoC: simple-card-utils: add missing MODULE_xxx()
        ASoC: Intel: Skylake: Check list empty while getting module info
        ...
      03cef710
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 28687b93
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "We've queued up a few different fixes in here.  These range from
        enospc corners to fsync and quota fixes, and a few targeted at error
        handling for corrupt metadata/fuzzing"
      
      * 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix lockdep warning on deadlock against an inode's log mutex
        Btrfs: detect corruption when non-root leaf has zero item
        Btrfs: check btree node's nritems
        btrfs: don't create or leak aliased root while cleaning up orphans
        Btrfs: fix em leak in find_first_block_group
        btrfs: do not background blkdev_put()
        Btrfs: clarify do_chunk_alloc()'s return value
        btrfs: fix fsfreeze hang caused by delayed iputs deal
        btrfs: update btrfs_space_info's bytes_may_use timely
        btrfs: divide btrfs_update_reserved_bytes() into two functions
        btrfs: use correct offset for reloc_inode in prealloc_file_extent_cluster()
        btrfs: qgroup: Fix qgroup incorrectness caused by log replay
        btrfs: relocation: Fix leaking qgroups numbers on data extents
        btrfs: qgroup: Refactor btrfs_qgroup_insert_dirty_extent()
        btrfs: waiting on qgroup rescan should not always be interruptible
        btrfs: properly track when rescan worker is running
        btrfs: flush_space: treat return value of do_chunk_alloc properly
        Btrfs: add ASSERT for block group's memory leak
        btrfs: backref: Fix soft lockup in __merge_refs function
        Btrfs: fix memory leak of reloc_root
      28687b93