Skip to content

Commit 62dcee7

Browse files
Adrian Huangjoergroedel
authored andcommitted
iommu/amd: Replace two consecutive readl calls with one readq
Optimize the reigster reading by using readq instead of the two consecutive readl calls. Signed-off-by: Adrian Huang <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent bde9e6b commit 62dcee7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/iommu/amd_iommu_init.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,6 @@ static const struct attribute_group *amd_iommu_groups[] = {
17181718
static int __init iommu_init_pci(struct amd_iommu *iommu)
17191719
{
17201720
int cap_ptr = iommu->cap_ptr;
1721-
u32 low, high;
17221721
int ret;
17231722

17241723
iommu->dev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(iommu->devid),
@@ -1736,10 +1735,7 @@ static int __init iommu_init_pci(struct amd_iommu *iommu)
17361735
amd_iommu_iotlb_sup = false;
17371736

17381737
/* read extended feature bits */
1739-
low = readl(iommu->mmio_base + MMIO_EXT_FEATURES);
1740-
high = readl(iommu->mmio_base + MMIO_EXT_FEATURES + 4);
1741-
1742-
iommu->features = ((u64)high << 32) | low;
1738+
iommu->features = readq(iommu->mmio_base + MMIO_EXT_FEATURES);
17431739

17441740
if (iommu_feature(iommu, FEATURE_GT)) {
17451741
int glxval;

0 commit comments

Comments
 (0)