1. 15 10月, 2019 1 次提交
  2. 30 7月, 2019 1 次提交
    • W
      iommu: Pass struct iommu_iotlb_gather to ->unmap() and ->iotlb_sync() · 56f8af5e
      Will Deacon 提交于
      To allow IOMMU drivers to batch up TLB flushing operations and postpone
      them until ->iotlb_sync() is called, extend the prototypes for the
      ->unmap() and ->iotlb_sync() IOMMU ops callbacks to take a pointer to
      the current iommu_iotlb_gather structure.
      
      All affected IOMMU drivers are updated, but there should be no
      functional change since the extra parameter is ignored for now.
      Signed-off-by: NWill Deacon <will@kernel.org>
      56f8af5e
  3. 19 6月, 2019 1 次提交
  4. 01 2月, 2019 1 次提交
  5. 03 12月, 2018 1 次提交
    • P
      iommu/rockchip: Make it explicitly non-modular · 669a047b
      Paul Gortmaker 提交于
      The Kconfig currently controlling compilation of this code is:
      
      drivers/iommu/Kconfig:config ROCKCHIP_IOMMU
      drivers/iommu/Kconfig:  bool "Rockchip IOMMU Support"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      The bind/unbind/remove was already explicitly disabled in commit
      98b72b94 ("iommu/rockchip: Prohibit unbind and remove").
      
      Lets remove the remaining traces of  modular infrastructure, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init was not in use by this code, the init ordering
      remains unchanged with this commit.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      was (or is now) contained at the top of the file in the comments.
      
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Simon Xue <xxm@rock-chips.com>
      Cc: Daniel Kurtz <djkurtz@chromium.org>
      Cc: Jeffy Chen <jeffy.chen@rock-chips.com>
      Cc: iommu@lists.linux-foundation.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-rockchip@lists.infradead.org
      Acked-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      669a047b
  6. 25 9月, 2018 1 次提交
  7. 24 8月, 2018 2 次提交
    • M
      iommu/rockchip: Move irq request past pm_runtime_enable · 1aa55ca9
      Marc Zyngier 提交于
      Enabling the interrupt early, before power has been applied to the
      device, can result in an interrupt being delivered too early if:
      
      - the IOMMU shares an interrupt with a VOP
      - the VOP has a pending interrupt (after a kexec, for example)
      
      In these conditions, we end-up taking the interrupt without
      the IOMMU being ready to handle the interrupt (not powered on).
      
      Moving the interrupt request past the pm_runtime_enable() call
      makes sure we can at least access the IOMMU registers. Note that
      this is only a partial fix, and that the VOP interrupt will still
      be screaming until the VOP driver kicks in, which advocates for
      a more synchronized interrupt enabling/disabling approach.
      
      Fixes: 0f181d3c ("iommu/rockchip: Add runtime PM support")
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      1aa55ca9
    • M
      iommu/rockchip: Handle errors returned from PM framework · 3fc7c5c0
      Marc Zyngier 提交于
      pm_runtime_get_if_in_use can fail: either PM has been disabled
      altogether (-EINVAL), or the device hasn't been enabled yet (0).
      Sadly, the Rockchip IOMMU driver tends to conflate the two things
      by considering a non-zero return value as successful.
      
      This has the consequence of hiding other bugs, so let's handle this
      case throughout the driver, with a WARN_ON_ONCE so that we can try
      and work out what happened.
      
      Fixes: 0f181d3c ("iommu/rockchip: Add runtime PM support")
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      3fc7c5c0
  8. 08 8月, 2018 1 次提交
  9. 10 7月, 2018 1 次提交
    • R
      iommu: Remove IOMMU_OF_DECLARE · ac6bbf0c
      Rob Herring 提交于
      Now that we use the driver core to stop deferred probe for missing
      drivers, IOMMU_OF_DECLARE can be removed.
      
      This is slightly less optimal than having a list of built-in drivers in
      that we'll now defer probe twice before giving up. This shouldn't have a
      significant impact on boot times as past discussions about deferred
      probe have given no evidence of deferred probe having a substantial
      impact.
      
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Kukjin Kim <kgene@kernel.org>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: iommu@lists.linux-foundation.org
      Cc: linux-samsung-soc@vger.kernel.org
      Cc: linux-arm-msm@vger.kernel.org
      Cc: linux-rockchip@lists.infradead.org
      Cc: devicetree@vger.kernel.org
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Acked-by: NJoerg Roedel <jroedel@suse.de>
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ac6bbf0c
  10. 13 6月, 2018 1 次提交
    • K
      treewide: devm_kzalloc() -> devm_kcalloc() · a86854d0
      Kees Cook 提交于
      The devm_kzalloc() function has a 2-factor argument form, devm_kcalloc().
      This patch replaces cases of:
      
              devm_kzalloc(handle, a * b, gfp)
      
      with:
              devm_kcalloc(handle, a * b, gfp)
      
      as well as handling cases of:
      
              devm_kzalloc(handle, a * b * c, gfp)
      
      with:
      
              devm_kzalloc(handle, array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              devm_kcalloc(handle, array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              devm_kzalloc(handle, 4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      Some manual whitespace fixes were needed in this patch, as Coccinelle
      really liked to write "=devm_kcalloc..." instead of "= devm_kcalloc...".
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      expression HANDLE;
      type TYPE;
      expression THING, E;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression HANDLE;
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      expression HANDLE;
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      expression HANDLE;
      identifier SIZE, COUNT;
      @@
      
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression HANDLE;
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression HANDLE;
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      expression HANDLE;
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        devm_kzalloc(HANDLE,
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression HANDLE;
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
      |
        devm_kzalloc(HANDLE,
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        devm_kzalloc(HANDLE,
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression HANDLE;
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        devm_kzalloc(HANDLE, sizeof(THING) * C2, ...)
      |
        devm_kzalloc(HANDLE, sizeof(TYPE) * C2, ...)
      |
        devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
      |
        devm_kzalloc(HANDLE, C1 * C2, ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - devm_kzalloc
      + devm_kcalloc
        (HANDLE,
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      a86854d0
  11. 03 5月, 2018 2 次提交
  12. 29 3月, 2018 12 次提交
  13. 15 3月, 2018 1 次提交
  14. 27 7月, 2017 2 次提交
  15. 26 7月, 2017 1 次提交
  16. 29 4月, 2017 1 次提交
  17. 03 4月, 2017 1 次提交
  18. 27 6月, 2016 5 次提交
  19. 15 6月, 2016 1 次提交
  20. 07 4月, 2016 1 次提交
  21. 05 4月, 2016 1 次提交
  22. 29 1月, 2016 1 次提交