1. 25 6月, 2021 2 次提交
  2. 07 4月, 2021 1 次提交
  3. 27 1月, 2021 1 次提交
  4. 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
  5. 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
  6. 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
  7. 24 9月, 2020 1 次提交
  8. 18 9月, 2020 1 次提交
  9. 07 9月, 2020 2 次提交
  10. 28 7月, 2020 5 次提交
  11. 27 5月, 2020 1 次提交
  12. 21 5月, 2020 1 次提交
  13. 19 5月, 2020 1 次提交
  14. 11 5月, 2020 1 次提交
  15. 04 5月, 2020 2 次提交
  16. 29 4月, 2020 1 次提交
  17. 27 3月, 2020 1 次提交
  18. 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
  19. 16 1月, 2020 1 次提交
  20. 23 12月, 2019 1 次提交
  21. 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
  22. 05 8月, 2019 1 次提交
  23. 23 7月, 2019 1 次提交
  24. 05 6月, 2019 1 次提交
  25. 23 5月, 2019 1 次提交
    • L
      ACPI/IORT: Fix build error when IOMMU_SUPPORT is disabled · 82126886
      Lorenzo Pieralisi 提交于
      If IOMMU_SUPPORT is not enabled (and therefore IOMMU_API is not
      selected), struct iommu_fwspec is an empty struct and
      IOMMU_FWSPEC_PCI_RC_ATS is not defined, resulting in the following
      compilation errors:
      
      drivers/acpi/arm64/iort.c: In function iort_iommu_configure:
      drivers/acpi/arm64/iort.c:1079:21: error: struct iommu_fwspec has no member named flag:
          dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
                           ^~
      drivers/acpi/arm64/iort.c:1079:32: error: IOMMU_FWSPEC_PCI_RC_ATS
      undeclared (first use in this function)
          dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS;
                                      ^~~~~~~~~~~~~~~~~~~~~~~
      drivers/acpi/arm64/iort.c:1079:32: note: each undeclared identifier is reported only once for each function it appears in
      
      Move iort_iommu_configure() (and the helpers functions it relies on)
      into CONFIG_IOMMU_API preprocessor guarded code so that when
      CONFIG_IOMMU_SUPPORT is not enabled we prevent compiling code that is
      basically equivalent to no-OP, fixing the build errors.
      
      Cc: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Link: https://lore.kernel.org/linux-arm-kernel/20190515034253.79348-1-wangkefeng.wang@huawei.com/
      Fixes: 5702ee24 ("ACPI/IORT: Check ATS capability in root complex nodes")
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      82126886
  26. 23 4月, 2019 1 次提交
  27. 17 4月, 2019 1 次提交
    • K
      ACPI/IORT: Reject platform device creation on NUMA node mapping failure · 36a2ba07
      Kefeng Wang 提交于
      In a system where, through IORT firmware mappings, the SMMU device is
      mapped to a NUMA node that is not online, the kernel bootstrap results
      in the following crash:
      
        Unable to handle kernel paging request at virtual address 0000000000001388
        Mem abort info:
          ESR = 0x96000004
          Exception class = DABT (current EL), IL = 32 bits
          SET = 0, FnV = 0
          EA = 0, S1PTW = 0
        Data abort info:
          ISV = 0, ISS = 0x00000004
          CM = 0, WnR = 0
        [0000000000001388] user address but active_mm is swapper
        Internal error: Oops: 96000004 [#1] SMP
        Modules linked in:
        CPU: 5 PID: 1 Comm: swapper/0 Not tainted 5.0.0 #15
        pstate: 80c00009 (Nzcv daif +PAN +UAO)
        pc : __alloc_pages_nodemask+0x13c/0x1068
        lr : __alloc_pages_nodemask+0xdc/0x1068
        ...
        Process swapper/0 (pid: 1, stack limit = 0x(____ptrval____))
        Call trace:
         __alloc_pages_nodemask+0x13c/0x1068
         new_slab+0xec/0x570
         ___slab_alloc+0x3e0/0x4f8
         __slab_alloc+0x60/0x80
         __kmalloc_node_track_caller+0x10c/0x478
         devm_kmalloc+0x44/0xb0
         pinctrl_bind_pins+0x4c/0x188
         really_probe+0x78/0x2b8
         driver_probe_device+0x64/0x110
         device_driver_attach+0x74/0x98
         __driver_attach+0x9c/0xe8
         bus_for_each_dev+0x84/0xd8
         driver_attach+0x30/0x40
         bus_add_driver+0x170/0x218
         driver_register+0x64/0x118
         __platform_driver_register+0x54/0x60
         arm_smmu_driver_init+0x24/0x2c
         do_one_initcall+0xbc/0x328
         kernel_init_freeable+0x304/0x3ac
         kernel_init+0x18/0x110
         ret_from_fork+0x10/0x1c
        Code: f90013b5 b9410fa1 1a9f0694 b50014c2 (b9400804)
        ---[ end trace dfeaed4c373a32da ]--
      
      Change the dev_set_proximity() hook prototype so that it returns a
      value and make it return failure if the PXM->NUMA-node mapping
      corresponds to an offline node, fixing the crash.
      Acked-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
      Link: https://lore.kernel.org/linux-arm-kernel/20190315021940.86905-1-wangkefeng.wang@huawei.com/Signed-off-by: NWill Deacon <will.deacon@arm.com>
      36a2ba07
  28. 04 4月, 2019 2 次提交
  29. 11 1月, 2019 1 次提交
  30. 08 1月, 2019 1 次提交
    • Q
      ACPI/IORT: Fix build when CONFIG_IOMMU_API=n · 6b68835b
      Qian Cai 提交于
      Commit 8097e53e ("ACPI/IORT: Use helper functions to access
      dev->iommu_fwspec") changed by mistake the iort_fwspec_iommu_ops() stub
      definition (compiled in when CONFIG_IOMMU_API=n), that caused the
      following compilation failure:
      
      drivers/acpi/arm64/iort.c:880:1: error: expected identifier or
      '(' before '{' token
       { return NULL; }
       ^
      drivers/acpi/arm64/iort.c:879:39: warning: 'iort_fwspec_iommu_ops'
      used but never defined
       static inline const struct iommu_ops *iort_fwspec_iommu_ops(struct device *dev);
                                             ^~~~~~~~~~~~~~~~~~~~~
      
      Fix it.
      
      Fixes: 8097e53e ("ACPI/IORT: Use helper functions to access dev->iommu_fwspec")
      Signed-off-by: NQian Cai <cai@lca.pw>
      [lorenzo.pieralisi@arm.com: updated tags and log]
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Joerg Roedel <jroedel@suse.de>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6b68835b
  31. 20 12月, 2018 1 次提交
  32. 17 12月, 2018 1 次提交