1. 15 6月, 2017 1 次提交
  2. 29 4月, 2017 1 次提交
    • L
      ACPI/IORT: Fix CONFIG_IOMMU_API dependency · d49f2ded
      Lorenzo Pieralisi 提交于
      The IOMMU probe deferral IORT rework had to add code in
      iort_iommu_configure() and iort_iommu_xlate() that requires
      the IOMMU_API to be selected in order to compile and work.
      
      Stub out the pieces of code that depend on CONFIG_IOMMU_API
      to be selected to prevent compilation failures such as:
      
      drivers/acpi/arm64/iort.c: In function 'iort_iommu_xlate':
      drivers/acpi/arm64/iort.c:647:22: error: 'struct iommu_fwspec' has no
      member named 'ops'
      
      by wrapping the code in static inline functions that provide a NOP
      implementation when CONFIG_IOMMU_API is not selected.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reported-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Sricharan R <sricharan@codeaurora.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      d49f2ded
  3. 20 4月, 2017 3 次提交
  4. 30 3月, 2017 2 次提交
  5. 29 3月, 2017 2 次提交
  6. 22 3月, 2017 3 次提交
  7. 10 2月, 2017 1 次提交
  8. 07 2月, 2017 2 次提交
    • D
      ACPI/IORT: Fix the error return code in iort_add_smmu_platform_device() · 5e5afa6c
      Dan Carpenter 提交于
      The function iort_add_smmu_platform_device() accidentally returns 0
      (ie PTR_ERR(pdev) where pdev == NULL) if platform_device_alloc() fails;
      fix the bug by returning a proper error value.
      
      Fixes: 846f0e9e ("ACPI/IORT: Add support for ARM SMMU platform devices creation")
      Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      [lorenzo.pieralisi@arm.com: improved commit log]
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      5e5afa6c
    • L
      ACPI/IORT: Fix iort_node_get_id() mapping entries indexing · 030abd8a
      Lorenzo Pieralisi 提交于
      Commit 618f535a ("ACPI/IORT: Add single mapping function")
      introduced a function (iort_node_get_id()) to retrieve ids for IORT
      named components.
      
      The iort_node_get_id() takes an index as input to refer to a specific
      mapping entry in the named component IORT node mapping array.
      
      For a mapping entry at a given index, iort_node_get_id() should return
      the id value (through the id_out function parameter) and the IORT node
      output_reference (through function return value) the given mapping entry
      refers to.
      
      Technically output_reference values may differ for different map
      entries, (see diagram below - mapped id values may refer to different eg
      IORT SMMU nodes; the kernel may not be able to handle different
      output_reference values for a given named component but the IORT kernel
      layer should still report the IORT mappings as reported by firmware) but
      current code in iort_node_get_id() fails to use the index function
      parameter to return the correct output_reference value (ie it always
      returns the output_reference value of the first entry in the mapping
      array whilst using the index correctly to retrieve the id value from the
      respective entry).
      
      	|----------------------|
      	|     named component  |
      	|----------------------|
      	|      map entry[0]    |
      	|----------------------|
      	|       id value       |
      	| output_reference----------------> eg SMMU 1
      	|----------------------|
      	|      map entry[1]    |
      	|----------------------|
      	|       id value       |
      	| output_reference----------------> eg SMMU 2
      	|----------------------|
      		    .
      		    .
      		    .
      	|----------------------|
      	|      map entry[N]    |
      	|----------------------|
      	|       id value       |
      	| output_reference----------------> eg SMMU 1
      	|----------------------|
      
      Consequently the iort_node_get_id() function always returns the IORT
      node pointed at by the output_reference value of the first named
      component mapping array entry, irrespective of the index parameter,
      which is a bug.
      
      Update the map array entry pointer computation in iort_node_get_id() to
      take into account the index value, fixing the issue.
      
      Fixes: 618f535a ("ACPI/IORT: Add single mapping function")
      Reported-by: NHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Sinan Kaya <okaya@codeaurora.org>
      Cc: Tomasz Nowicki <tn@semihalf.com>
      Cc: Nate Watterson <nwatters@codeaurora.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      030abd8a
  9. 06 12月, 2016 1 次提交
    • L
      ACPI/IORT: Make dma masks set-up IORT specific · 18b709be
      Lorenzo Pieralisi 提交于
      The introduction of acpi_dma_configure() allows to configure DMA
      and related IOMMU for any device that is DMA capable. To achieve
      that goal it ensures DMA masks are set-up to sane default values
      before proceeding with IOMMU and DMA ops configuration.
      
      On x86/ia64 systems, through acpi_bind_one(), acpi_dma_configure() is
      called for every device that has an ACPI companion, in that every device
      is considered DMA capable on x86/ia64 systems (ie acpi_get_dma_attr() API),
      which has the side effect of initializing dma masks also for
      pseudo-devices (eg CPUs and memory nodes) and potentially for devices
      whose dma masks were not set-up before the acpi_dma_configure() API was
      introduced, which may have noxious side effects.
      
      Therefore, in preparation for IORT firmware specific DMA masks set-up,
      wrap the default DMA masks set-up in acpi_dma_configure() inside an IORT
      specific wrapper that reverts to a NOP on x86/ia64 systems, restoring the
      default expected behaviour on x86/ia64 systems and keeping DMA default
      masks set-up on IORT based (ie ARM) arch configurations.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Tomasz Nowicki <tn@semihalf.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Sricharan R <sricharan@codeaurora.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      18b709be
  10. 29 11月, 2016 9 次提交
  11. 13 9月, 2016 2 次提交
    • T
      ACPI: Add new IORT functions to support MSI domain handling · 4bf2efd2
      Tomasz Nowicki 提交于
      For ITS, MSI functionality consists on building domain stack and
      during that process we need to reference to domain stack components
      e.g. before we create new DOMAIN_BUS_PCI_MSI domain we need to specify
      its DOMAIN_BUS_NEXUS parent domain. In order to manage that process
      properly, maintain list which elements contain domain token
      (unique for MSI domain stack) and ITS ID: iort_register_domain_token()
      and iort_deregister_domain_token(). Then retrieve domain token
      any time later with ITS ID being key off: iort_find_domain_token().
      With domain token and domain type we are able to find corresponding
      IRQ domain.
      
      Since IORT is prepared to describe MSI domain on a per-device basis,
      use existing IORT helpers and implement two calls:
      1. iort_msi_map_rid() to map MSI RID for a device
      2. iort_get_device_domain() to find domain token for a device
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Acked-by: NRafael J. Wysocki <rjw@rjwysocki.net>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      4bf2efd2
    • T
      ACPI: I/O Remapping Table (IORT) initial support · 88ef16d8
      Tomasz Nowicki 提交于
      IORT shows representation of IO topology for ARM based systems.
      It describes how various components are connected together on
      parent-child basis e.g. PCI RC -> SMMU -> ITS. Also see IORT spec.
      http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf
      
      Initial support allows to detect IORT table presence and save its
      root pointer obtained through acpi_get_table(). The pointer validity
      depends on acpi_gbl_permanent_mmap because if acpi_gbl_permanent_mmap
      is not set while using IORT nodes we would dereference unmapped pointers.
      
      For the aforementioned reason call acpi_iort_init() from acpi_init()
      which guarantees acpi_gbl_permanent_mmap to be set at that point.
      
      Add generic helpers which are helpful for scanning and retrieving
      information from IORT table content. List of the most important helpers:
      - iort_find_dev_node() finds IORT node for a given device
      - iort_node_map_rid() maps device RID and returns IORT node which provides
        final translation
      
      IORT support is placed under drivers/acpi/arm64/ new directory due to its
      ARM64 specific nature. The code there is considered only for ARM64.
      The long term plan is to keep all ARM64 specific tables support
      in this place e.g. GTDT table.
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Acked-by: NRafael J. Wysocki <rjw@rjwysocki.net>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      88ef16d8