1. 23 8月, 2019 1 次提交
    • W
      iommu/arm-smmu-v3: Avoid locking on invalidation path when not using ATS · cdb8a3c3
      Will Deacon 提交于
      When ATS is not in use, we can avoid taking the 'devices_lock' for the
      domain on the invalidation path by simply caching the number of ATS
      masters currently attached. The fiddly part is handling a concurrent
      ->attach() of an ATS-enabled master to a domain that is being
      invalidated, but we can handle this using an 'smp_mb()' to ensure that
      our check of the count is ordered after completion of our prior TLB
      invalidation.
      
      This also makes our ->attach() and ->detach() flows symmetric wrt ATS
      interactions.
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      cdb8a3c3
  2. 22 8月, 2019 5 次提交
  3. 21 8月, 2019 1 次提交
    • W
      iommu/arm-smmu-v3: Document ordering guarantees of command insertion · 05cbaf4d
      Will Deacon 提交于
      It turns out that we've always relied on some subtle ordering guarantees
      when inserting commands into the SMMUv3 command queue. With the recent
      changes to elide locking when possible, these guarantees become more
      subtle and even more important.
      
      Add a comment documented the barrier semantics of command insertion so
      that we don't have to derive the behaviour from scratch each time it
      comes up on the list.
      Signed-off-by: NWill Deacon <will@kernel.org>
      05cbaf4d
  4. 08 8月, 2019 2 次提交
  5. 30 7月, 2019 12 次提交
  6. 24 7月, 2019 5 次提交
    • W
      iommu: Introduce iommu_iotlb_gather_add_page() · 4fcf8544
      Will Deacon 提交于
      Introduce a helper function for drivers to use when updating an
      iommu_iotlb_gather structure in response to an ->unmap() call, rather
      than having to open-code the logic in every page-table implementation.
      Signed-off-by: NWill Deacon <will@kernel.org>
      4fcf8544
    • W
      iommu: Introduce struct iommu_iotlb_gather for batching TLB flushes · a7d20dc1
      Will Deacon 提交于
      To permit batching of TLB flushes across multiple calls to the IOMMU
      driver's ->unmap() implementation, introduce a new structure for
      tracking the address range to be flushed and the granularity at which
      the flushing is required.
      
      This is hooked into the IOMMU API and its caller are updated to make use
      of the new structure. Subsequent patches will plumb this into the IOMMU
      drivers as well, but for now the gathering information is ignored.
      Signed-off-by: NWill Deacon <will@kernel.org>
      a7d20dc1
    • W
      iommu/io-pgtable: Rename iommu_gather_ops to iommu_flush_ops · 298f7889
      Will Deacon 提交于
      In preparation for TLB flush gathering in the IOMMU API, rename the
      iommu_gather_ops structure in io-pgtable to iommu_flush_ops, which
      better describes its purpose and avoids the potential for confusion
      between different levels of the API.
      
      $ find linux/ -type f -name '*.[ch]' | xargs sed -i 's/gather_ops/flush_ops/g'
      Signed-off-by: NWill Deacon <will@kernel.org>
      298f7889
    • W
      iommu/io-pgtable-arm: Remove redundant call to io_pgtable_tlb_sync() · f71da467
      Will Deacon 提交于
      Commit b6b65ca2 ("iommu/io-pgtable-arm: Add support for non-strict
      mode") added an unconditional call to io_pgtable_tlb_sync() immediately
      after the case where we replace a block entry with a table entry during
      an unmap() call. This is redundant, since the IOMMU API will call
      iommu_tlb_sync() on this path and the patch in question mentions this:
      
       | To save having to reason about it too much, make sure the invalidation
       | in arm_lpae_split_blk_unmap() just performs its own unconditional sync
       | to minimise the window in which we're technically violating the break-
       | before-make requirement on a live mapping. This might work out redundant
       | with an outer-level sync for strict unmaps, but we'll never be splitting
       | blocks on a DMA fastpath anyway.
      
      However, this sync gets in the way of deferred TLB invalidation for leaf
      entries and is at best a questionable, unproven hack. Remove it.
      Signed-off-by: NWill Deacon <will@kernel.org>
      f71da467
    • W
      iommu: Remove empty iommu_tlb_range_add() callback from iommu_ops · 6d1bcb95
      Will Deacon 提交于
      Commit add02cfd ("iommu: Introduce Interface for IOMMU TLB Flushing")
      added three new TLB flushing operations to the IOMMU API so that the
      underlying driver operations can be batched when unmapping large regions
      of IO virtual address space.
      
      However, the ->iotlb_range_add() callback has not been implemented by
      any IOMMU drivers (amd_iommu.c implements it as an empty function, which
      incurs the overhead of an indirect branch). Instead, drivers either flush
      the entire IOTLB in the ->iotlb_sync() callback or perform the necessary
      invalidation during ->unmap().
      
      Attempting to implement ->iotlb_range_add() for arm-smmu-v3.c revealed
      two major issues:
      
        1. The page size used to map the region in the page-table is not known,
           and so it is not generally possible to issue TLB flushes in the most
           efficient manner.
      
        2. The only mutable state passed to the callback is a pointer to the
           iommu_domain, which can be accessed concurrently and therefore
           requires expensive synchronisation to keep track of the outstanding
           flushes.
      
      Remove the callback entirely in preparation for extending ->unmap() and
      ->iotlb_sync() to update a token on the caller's stack.
      Signed-off-by: NWill Deacon <will@kernel.org>
      6d1bcb95
  7. 22 7月, 2019 7 次提交
    • L
      Linus 5.3-rc1 · 5f9e832c
      Linus Torvalds 提交于
      5f9e832c
    • L
      Merge tag 'devicetree-fixes-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · c7bf0a0f
      Linus Torvalds 提交于
      Pull Devicetree fixes from Rob Herring:
       "Fix several warnings/errors in validation of binding schemas"
      
      * tag 'devicetree-fixes-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: pinctrl: stm32: Fix missing 'clocks' property in examples
        dt-bindings: iio: ad7124: Fix dtc warnings in example
        dt-bindings: iio: avia-hx711: Fix avdd-supply typo in example
        dt-bindings: pinctrl: aspeed: Fix AST2500 example errors
        dt-bindings: pinctrl: aspeed: Fix 'compatible' schema errors
        dt-bindings: riscv: Limit cpus schema to only check RiscV 'cpu' nodes
        dt-bindings: Ensure child nodes are of type 'object'
      c7bf0a0f
    • L
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · d6788eb7
      Linus Torvalds 提交于
      Pull vfs documentation typo fix from Al Viro.
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        typo fix: it's d_make_root, not d_make_inode...
      d6788eb7
    • L
      Merge tag '5.3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 91962d0f
      Linus Torvalds 提交于
      Pull cifs fixes from Steve French:
       "Two fixes for stable, one that had dependency on earlier patch in this
        merge window and can now go in, and a perf improvement in SMB3 open"
      
      * tag '5.3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: update internal module number
        cifs: flush before set-info if we have writeable handles
        smb3: optimize open to not send query file internal info
        cifs: copy_file_range needs to strip setuid bits and update timestamps
        CIFS: fix deadlock in cached root handling
      91962d0f
    • Q
      iommu/amd: fix a crash in iova_magazine_free_pfns · 8cf66504
      Qian Cai 提交于
      The commit b3aa14f0 ("iommu: remove the mapping_error dma_map_ops
      method") incorrectly changed the checking from dma_ops_alloc_iova() in
      map_sg() causes a crash under memory pressure as dma_ops_alloc_iova()
      never return DMA_MAPPING_ERROR on failure but 0, so the error handling
      is all wrong.
      
         kernel BUG at drivers/iommu/iova.c:801!
          Workqueue: kblockd blk_mq_run_work_fn
          RIP: 0010:iova_magazine_free_pfns+0x7d/0xc0
          Call Trace:
           free_cpu_cached_iovas+0xbd/0x150
           alloc_iova_fast+0x8c/0xba
           dma_ops_alloc_iova.isra.6+0x65/0xa0
           map_sg+0x8c/0x2a0
           scsi_dma_map+0xc6/0x160
           pqi_aio_submit_io+0x1f6/0x440 [smartpqi]
           pqi_scsi_queue_command+0x90c/0xdd0 [smartpqi]
           scsi_queue_rq+0x79c/0x1200
           blk_mq_dispatch_rq_list+0x4dc/0xb70
           blk_mq_sched_dispatch_requests+0x249/0x310
           __blk_mq_run_hw_queue+0x128/0x200
           blk_mq_run_work_fn+0x27/0x30
           process_one_work+0x522/0xa10
           worker_thread+0x63/0x5b0
           kthread+0x1d2/0x1f0
           ret_from_fork+0x22/0x40
      
      Fixes: b3aa14f0 ("iommu: remove the mapping_error dma_map_ops method")
      Signed-off-by: NQian Cai <cai@lca.pw>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8cf66504
    • M
      hexagon: switch to generic version of pte allocation · 618381f0
      Mike Rapoport 提交于
      The hexagon implementation pte_alloc_one(), pte_alloc_one_kernel(),
      pte_free_kernel() and pte_free() is identical to the generic except of
      lack of __GFP_ACCOUNT for the user PTEs allocation.
      
      Switch hexagon to use generic version of these functions.
      Signed-off-by: NMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      618381f0
    • L
      Merge tag 'ntb-5.3' of git://github.com/jonmason/ntb · bec5545e
      Linus Torvalds 提交于
      Pull NTB updates from Jon Mason:
       "New feature to add support for NTB virtual MSI interrupts, the ability
        to test and use this feature in the NTB transport layer.
      
        Also, bug fixes for the AMD and Switchtec drivers, as well as some
        general patches"
      
      * tag 'ntb-5.3' of git://github.com/jonmason/ntb: (22 commits)
        NTB: Describe the ntb_msi_test client in the documentation.
        NTB: Add MSI interrupt support to ntb_transport
        NTB: Add ntb_msi_test support to ntb_test
        NTB: Introduce NTB MSI Test Client
        NTB: Introduce MSI library
        NTB: Rename ntb.c to support multiple source files in the module
        NTB: Introduce functions to calculate multi-port resource index
        NTB: Introduce helper functions to calculate logical port number
        PCI/switchtec: Add module parameter to request more interrupts
        PCI/MSI: Support allocating virtual MSI interrupts
        ntb_hw_switchtec: Fix setup MW with failure bug
        ntb_hw_switchtec: Skip unnecessary re-setup of shared memory window for crosslink case
        ntb_hw_switchtec: Remove redundant steps of switchtec_ntb_reinit_peer() function
        NTB: correct ntb_dev_ops and ntb_dev comment typos
        NTB: amd: Silence shift wrapping warning in amd_ntb_db_vector_mask()
        ntb_hw_switchtec: potential shift wrapping bug in switchtec_ntb_init_sndev()
        NTB: ntb_transport: Ensure qp->tx_mw_dma_addr is initaliazed
        NTB: ntb_hw_amd: set peer limit register
        NTB: ntb_perf: Clear stale values in doorbell and command SPAD register
        NTB: ntb_perf: Disable NTB link after clearing peer XLAT registers
        ...
      bec5545e
  8. 21 7月, 2019 7 次提交
    • A
      typo fix: it's d_make_root, not d_make_inode... · 1b03bc5c
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1b03bc5c
    • R
      dt-bindings: pinctrl: stm32: Fix missing 'clocks' property in examples · e2297f7c
      Rob Herring 提交于
      Now that examples are validated against the DT schema, an error with
      required 'clocks' property missing is exposed:
      
      Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.example.dt.yaml: \
      pinctrl@40020000: gpio@0: 'clocks' is a required property
      Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.example.dt.yaml: \
      pinctrl@50020000: gpio@1000: 'clocks' is a required property
      Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.example.dt.yaml: \
      pinctrl@50020000: gpio@2000: 'clocks' is a required property
      
      Add the missing 'clocks' properties to the examples to fix the errors.
      
      Fixes: 2c9239c1 ("dt-bindings: pinctrl: Convert stm32 pinctrl bindings to json-schema")
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: linux-gpio@vger.kernel.org
      Cc: linux-stm32@st-md-mailman.stormreply.com
      Acked-by: NAlexandre TORGUE <alexandre.torgue@st.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      e2297f7c
    • R
      dt-bindings: iio: ad7124: Fix dtc warnings in example · 20051f5f
      Rob Herring 提交于
      With the conversion to DT schema, the examples are now compiled with
      dtc. The ad7124 binding example has the following warning:
      
      Documentation/devicetree/bindings/iio/adc/adi,ad7124.example.dts:19.11-21: \
      Warning (reg_format): /example-0/adc@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
      
      There's a default #size-cells and #address-cells values of 1 for
      examples. For examples needing different values such as this one on a
      SPI bus, they need to provide a SPI bus parent node.
      
      Fixes: 26ae15e6 ("Convert AD7124 bindings documentation to YAML format.")
      
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: linux-iio@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      20051f5f
    • R
      dt-bindings: iio: avia-hx711: Fix avdd-supply typo in example · fbbf2b6e
      Rob Herring 提交于
      Now that examples are validated against the DT schema, a typo in
      avia-hx711 example generates a warning:
      
      Documentation/devicetree/bindings/iio/adc/avia-hx711.example.dt.yaml: weight: 'avdd-supply' is a required property
      
      Fix the typo.
      
      Fixes: 5150ec3f ("avia-hx711.yaml: transform DT binding to YAML")
      Cc: Andreas Klinger <ak@it-klinger.de>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: linux-iio@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      fbbf2b6e
    • R
      dt-bindings: pinctrl: aspeed: Fix AST2500 example errors · fcbe7e3c
      Rob Herring 提交于
      The schema examples are now validated against the schema itself. The
      AST2500 pinctrl schema has a couple of errors:
      
      Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.example.dt.yaml: \
      example-0: $nodename:0: 'example-0' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
      Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.example.dt.yaml: \
      pinctrl: aspeed,external-nodes: [[1, 2]] is too short
      
      Fixes: 0a617de1 ("dt-bindings: pinctrl: aspeed: Convert AST2500 bindings to json-schema")
      Cc: Andrew Jeffery <andrew@aj.id.au>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Joel Stanley <joel@jms.id.au>
      Cc: linux-aspeed@lists.ozlabs.org
      Cc: linux-gpio@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Acked-by: NAndrew Jeffery <andrew@aj.id.au>
      Signed-off-by: NRob Herring <robh@kernel.org>
      fcbe7e3c
    • R
      dt-bindings: pinctrl: aspeed: Fix 'compatible' schema errors · ad21a4ce
      Rob Herring 提交于
      The Aspeed pinctl schema have errors in the 'compatible' schema:
      
      Documentation/devicetree/bindings/pinctrl/aspeed,ast2400-pinctrl.yaml: \
      properties:compatible:enum: ['aspeed', 'ast2400-pinctrl', 'aspeed', 'g4-pinctrl'] has non-unique elements
      Documentation/devicetree/bindings/pinctrl/aspeed,ast2500-pinctrl.yaml: \
      properties:compatible:enum: ['aspeed', 'ast2500-pinctrl', 'aspeed', 'g5-pinctrl'] has non-unique elements
      
      Flow style sequences have to be quoted if the vales contain ','. Fix
      this by using the more common one line per entry formatting.
      
      Fixes: 0a617de1 ("dt-bindings: pinctrl: aspeed: Convert AST2500 bindings to json-schema")
      Fixes: 07457937 ("dt-bindings: pinctrl: aspeed: Convert AST2400 bindings to json-schema")
      Cc: Andrew Jeffery <andrew@aj.id.au>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Joel Stanley <joel@jms.id.au>
      Cc: linux-aspeed@lists.ozlabs.org
      Cc: linux-gpio@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Acked-by: NAndrew Jeffery <andrew@aj.id.au>
      Signed-off-by: NRob Herring <robh@kernel.org>
      ad21a4ce
    • R
      dt-bindings: riscv: Limit cpus schema to only check RiscV 'cpu' nodes · 7d9ef7f3
      Rob Herring 提交于
      Matching on the 'cpus' node was a bad choice because the schema is
      incorrectly applied to non-RiscV cpus nodes. As we now have a common cpus
      schema which checks the general structure, it is also redundant to do so
      in the Risc-V CPU schema.
      
      The downside is one could conceivably mix different architecture's cpu
      nodes or have typos in the compatible string. The latter problem pretty
      much exists for every schema.
      Acked-by: NPaul Walmsley <paul.walmsley@sifive.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      7d9ef7f3