1. 21 10月, 2022 1 次提交
  2. 29 7月, 2022 1 次提交
    • R
      ACPI/IORT: Fix build error implicit-function-declaration · de026976
      Ren Zhijie 提交于
      If CONFIG_ACPI_IORT=y and CONFIG_IOMMU_API is not set,
      make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-,
      will be failed, like this:
      
      drivers/acpi/arm64/iort.c: In function ‘iort_get_rmr_sids’:
      drivers/acpi/arm64/iort.c:1406:2: error: implicit declaration of function ‘iort_iommu_rmr_get_resv_regions’; did you mean ‘iort_iommu_get_resv_regions’? [-Werror=implicit-function-declaration]
        iort_iommu_rmr_get_resv_regions(iommu_fwnode, NULL, head);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        iort_iommu_get_resv_regions
      cc1: some warnings being treated as errors
      make[3]: *** [drivers/acpi/arm64/iort.o] Error 1
      
      The function iort_iommu_rmr_get_resv_regions()
      is declared under CONFIG_IOMMU_API,
      and the callers of iort_get_rmr_sids() and iort_put_rmr_sids()
      would select IOMMU_API.
      
      To fix this error, move the definitions to #ifdef CONFIG_IOMMU_API.
      
      Fixes: e302eea8 ("ACPI/IORT: Add a helper to retrieve RMR info directly")
      Signed-off-by: NRen Zhijie <renzhijie2@huawei.com>
      Acked-by: NHanjun Guo <guohanjun@huawei.com>
      Link: https://lore.kernel.org/r/20220726033520.47865-1-renzhijie2@huawei.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      de026976
  3. 06 7月, 2022 4 次提交
  4. 10 2月, 2022 1 次提交
  5. 25 6月, 2021 2 次提交
  6. 08 6月, 2021 1 次提交
  7. 17 5月, 2021 1 次提交
  8. 07 4月, 2021 1 次提交
  9. 27 1月, 2021 1 次提交
  10. 23 11月, 2020 1 次提交
    • S
      ACPI/IORT: Fix doc warnings in iort.c · 774c4a3b
      Shiju Jose 提交于
      Fix following warnings caused by mismatch between
      function parameters and function comments.
      
      drivers/acpi/arm64/iort.c:55: warning: Function parameter or member 'iort_node' not described in 'iort_set_fwnode'
      drivers/acpi/arm64/iort.c:55: warning: Excess function parameter 'node' description in 'iort_set_fwnode'
      drivers/acpi/arm64/iort.c:682: warning: Function parameter or member 'id' not described in 'iort_get_device_domain'
      drivers/acpi/arm64/iort.c:682: warning: Function parameter or member 'bus_token' not described in 'iort_get_device_domain'
      drivers/acpi/arm64/iort.c:682: warning: Excess function parameter 'req_id' description in 'iort_get_device_domain'
      drivers/acpi/arm64/iort.c:1142: warning: Function parameter or member 'dma_size' not described in 'iort_dma_setup'
      drivers/acpi/arm64/iort.c:1142: warning: Excess function parameter 'size' description in 'iort_dma_setup'
      drivers/acpi/arm64/iort.c:1534: warning: Function parameter or member 'ops' not described in 'iort_add_platform_device'
      Signed-off-by: NShiju Jose <shiju.jose@huawei.com>
      Acked-by: NHanjun Guo <guohanjun@huawei.com>
      Acked-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Link: https://lore.kernel.org/r/20201014093139.1580-1-shiju.jose@huawei.comSigned-off-by: NWill Deacon <will@kernel.org>
      774c4a3b
  11. 20 11月, 2020 1 次提交
    • A
      arm64: mm: Set ZONE_DMA size based on early IORT scan · 2b865293
      Ard Biesheuvel 提交于
      We recently introduced a 1 GB sized ZONE_DMA to cater for platforms
      incorporating masters that can address less than 32 bits of DMA, in
      particular the Raspberry Pi 4, which has 4 or 8 GB of DRAM, but has
      peripherals that can only address up to 1 GB (and its PCIe host
      bridge can only access the bottom 3 GB)
      
      Instructing the DMA layer about these limitations is straight-forward,
      even though we had to fix some issues regarding memory limits set in
      the IORT for named components, and regarding the handling of ACPI _DMA
      methods. However, the DMA layer also needs to be able to allocate
      memory that is guaranteed to meet those DMA constraints, for bounce
      buffering as well as allocating the backing for consistent mappings.
      
      This is why the 1 GB ZONE_DMA was introduced recently. Unfortunately,
      it turns out the having a 1 GB ZONE_DMA as well as a ZONE_DMA32 causes
      problems with kdump, and potentially in other places where allocations
      cannot cross zone boundaries. Therefore, we should avoid having two
      separate DMA zones when possible.
      
      So let's do an early scan of the IORT, and only create the ZONE_DMA
      if we encounter any devices that need it. This puts the burden on
      the firmware to describe such limitations in the IORT, which may be
      redundant (and less precise) if _DMA methods are also being provided.
      However, it should be noted that this situation is highly unusual for
      arm64 ACPI machines. Also, the DMA subsystem still gives precedence to
      the _DMA method if implemented, and so we will not lose the ability to
      perform streaming DMA outside the ZONE_DMA if the _DMA method permits
      it.
      
      [nsaenz: unified implementation with DT's counterpart]
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NNicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Tested-by: NJeremy Linton <jeremy.linton@arm.com>
      Acked-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NHanjun Guo <guohanjun@huawei.com>
      Cc: Jeremy Linton <jeremy.linton@arm.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Hanjun Guo <guohanjun@huawei.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Link: https://lore.kernel.org/r/20201119175400.9995-7-nsaenzjulienne@suse.deSigned-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      2b865293
  12. 06 10月, 2020 1 次提交
    • C
      dma-mapping: split <linux/dma-mapping.h> · 0a0f0d8b
      Christoph Hellwig 提交于
      Split out all the bits that are purely for dma_map_ops implementations
      and related code into a new <linux/dma-map-ops.h> header so that they
      don't get pulled into all the drivers.  That also means the architecture
      specific <asm/dma-mapping.h> is not pulled in by <linux/dma-mapping.h>
      any more, which leads to a missing includes that were pulled in by the
      x86 or arm versions in a few not overly portable drivers.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      0a0f0d8b
  13. 24 9月, 2020 1 次提交
  14. 18 9月, 2020 1 次提交
  15. 07 9月, 2020 2 次提交
  16. 28 7月, 2020 5 次提交
  17. 27 5月, 2020 1 次提交
  18. 21 5月, 2020 1 次提交
  19. 19 5月, 2020 1 次提交
  20. 11 5月, 2020 1 次提交
  21. 04 5月, 2020 2 次提交
  22. 29 4月, 2020 1 次提交
  23. 27 3月, 2020 1 次提交
  24. 17 1月, 2020 1 次提交
    • H
      ACPI/IORT: Fix 'Number of IDs' handling in iort_id_map() · 3c23b83a
      Hanjun Guo 提交于
      The IORT specification [0] (Section 3, table 4, page 9) defines the
      'Number of IDs' as 'The number of IDs in the range minus one'.
      
      However, the IORT ID mapping function iort_id_map() treats the 'Number
      of IDs' field as if it were the full IDs mapping count, with the
      following check in place to detect out of boundary input IDs:
      
      InputID >= Input base + Number of IDs
      
      This check is flawed in that it considers the 'Number of IDs' field as
      the full number of IDs mapping and disregards the 'minus one' from
      the IDs count.
      
      The correct check in iort_id_map() should be implemented as:
      
      InputID > Input base + Number of IDs
      
      this implements the specification correctly but unfortunately it breaks
      existing firmwares that erroneously set the 'Number of IDs' as the full
      IDs mapping count rather than IDs mapping count minus one.
      
      e.g.
      
      PCI hostbridge mapping entry 1:
      Input base:  0x1000
      ID Count:    0x100
      Output base: 0x1000
      Output reference: 0xC4  //ITS reference
      
      PCI hostbridge mapping entry 2:
      Input base:  0x1100
      ID Count:    0x100
      Output base: 0x2000
      Output reference: 0xD4  //ITS reference
      
      Two mapping entries which the second entry's Input base = the first
      entry's Input base + ID count, so for InputID 0x1100 and with the
      correct InputID check in place in iort_id_map() the kernel would map
      the InputID to ITS 0xC4 not 0xD4 as it would be expected.
      
      Therefore, to keep supporting existing flawed firmwares, introduce a
      workaround that instructs the kernel to use the old InputID range check
      logic in iort_id_map(), so that we can support both firmwares written
      with the flawed 'Number of IDs' logic and the correct one as defined in
      the specifications.
      
      [0]: http://infocenter.arm.com/help/topic/com.arm.doc.den0049d/DEN0049D_IO_Remapping_Table.pdfReported-by: NPankaj Bansal <pankaj.bansal@nxp.com>
      Link: https://lore.kernel.org/linux-acpi/20191215203303.29811-1-pankaj.bansal@nxp.com/Signed-off-by: NHanjun Guo <guohanjun@huawei.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Pankaj Bansal <pankaj.bansal@nxp.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      3c23b83a
  25. 16 1月, 2020 1 次提交
  26. 23 12月, 2019 1 次提交
  27. 22 11月, 2019 1 次提交
    • N
      dma-mapping: treat dev->bus_dma_mask as a DMA limit · a7ba70f1
      Nicolas Saenz Julienne 提交于
      Using a mask to represent bus DMA constraints has a set of limitations.
      The biggest one being it can only hold a power of two (minus one). The
      DMA mapping code is already aware of this and treats dev->bus_dma_mask
      as a limit. This quirk is already used by some architectures although
      still rare.
      
      With the introduction of the Raspberry Pi 4 we've found a new contender
      for the use of bus DMA limits, as its PCIe bus can only address the
      lower 3GB of memory (of a total of 4GB). This is impossible to represent
      with a mask. To make things worse the device-tree code rounds non power
      of two bus DMA limits to the next power of two, which is unacceptable in
      this case.
      
      In the light of this, rename dev->bus_dma_mask to dev->bus_dma_limit all
      over the tree and treat it as such. Note that dev->bus_dma_limit should
      contain the higher accessible DMA address.
      Signed-off-by: NNicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      a7ba70f1
  28. 05 8月, 2019 1 次提交
  29. 23 7月, 2019 1 次提交
  30. 05 6月, 2019 1 次提交