Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1231895

[PATCH 03/10] iommu/amd: Get the first/last device of iommu earlier

From Baoquan He <bhe@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 03/10] iommu/amd: Get the first/last device of iommu earlier
Date 2015-09-24 08:50 +0200
Message-ID <qc8vU-3GJ-15@gated-at.bofh.it> (permalink)
References <qc8md-3vB-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


iommu->first_device/last_device are needed by function init_iommu_from_acpi()
and init_iommu_devices(). So putting the assignment of them in iommu_init_pci()
could be late. In this patch put them earlier.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 drivers/iommu/amd_iommu_init.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index be20a56..5845918 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1115,6 +1115,9 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
 	iommu->pci_seg = h->pci_seg;
 	iommu->mmio_phys = h->mmio_phys;
 
+	iommu->first_device = find_first_devid_on_pci(h);
+	iommu->last_device = find_last_devid_on_pci(h);
+
 	/* Check if IVHD EFR contains proper max banks/counters */
 	if ((h->efr != 0) &&
 	    ((h->efr & (0xF << 13)) != 0) &&
@@ -1276,16 +1279,9 @@ static int iommu_init_pci(struct amd_iommu *iommu)
 
 	pci_read_config_dword(iommu->dev, cap_ptr + MMIO_CAP_HDR_OFFSET,
 			      &iommu->cap);
-	pci_read_config_dword(iommu->dev, cap_ptr + MMIO_RANGE_OFFSET,
-			      &range);
 	pci_read_config_dword(iommu->dev, cap_ptr + MMIO_MISC_OFFSET,
 			      &misc);
 
-	iommu->first_device = PCI_DEVID(MMIO_GET_BUS(range),
-					 MMIO_GET_FD(range));
-	iommu->last_device = PCI_DEVID(MMIO_GET_BUS(range),
-					MMIO_GET_LD(range));
-
 	if (!(iommu->cap & (1 << IOMMU_CAP_IOTLB)))
 		amd_iommu_iotlb_sup = false;
 
-- 
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] Fix AMD IOMMU faults in kdump kernel Baoquan He <bhe@redhat.com> - 2015-09-24 08:40 +0200
  [PATCH 04/10] iommu/amd: Detect pre enabled translation Baoquan He <bhe@redhat.com> - 2015-09-24 08:40 +0200
  [PATCH 09/10] iommu/amd: Clear the iommu pre enabled setting Baoquan He <bhe@redhat.com> - 2015-09-24 08:40 +0200
    Re: [PATCH 09/10] iommu/amd: Clear the iommu pre enabled setting Joerg Roedel <joro@8bytes.org> - 2015-09-29 18:20 +0200
  [PATCH 08/10] iommu/amd: Do not update the information of domain to devtables before device driver init Baoquan He <bhe@redhat.com> - 2015-09-24 08:40 +0200
  [PATCH 05/10] iommu/amd: Add function copy_dev_tables Baoquan He <bhe@redhat.com> - 2015-09-24 08:50 +0200
  [PATCH 02/10] iommu/amd: Adjust functons which get first/last devid by reading pci config Baoquan He <bhe@redhat.com> - 2015-09-24 08:50 +0200
  [PATCH 03/10] iommu/amd: Get the first/last device of iommu earlier Baoquan He <bhe@redhat.com> - 2015-09-24 08:50 +0200

csiph-web