From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zf0Ad-0000tn-75 for kexec@lists.infradead.org; Thu, 24 Sep 2015 06:38:19 +0000 From: Baoquan He Subject: [PATCH 03/10] iommu/amd: Get the first/last device of iommu earlier Date: Thu, 24 Sep 2015 14:37:29 +0800 Message-Id: <1443076656-31776-4-git-send-email-bhe@redhat.com> In-Reply-To: <1443076656-31776-1-git-send-email-bhe@redhat.com> References: <1443076656-31776-1-git-send-email-bhe@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: joro@8bytes.org, iommu@lists.linux-foundation.org Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Baoquan He 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 --- 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 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec