Skip to content

Commit

Permalink
iommu/amd: Replace two consecutive readl calls with one readq
Browse files Browse the repository at this point in the history
Optimize the reigster reading by using readq instead of the two
consecutive readl calls.

Signed-off-by: Adrian Huang <ahuang12@lenovo.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Adrian Huang authored and Joerg Roedel committed Jan 17, 2020
1 parent bde9e6b commit 62dcee7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/iommu/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,6 @@ static const struct attribute_group *amd_iommu_groups[] = {
static int __init iommu_init_pci(struct amd_iommu *iommu)
{
int cap_ptr = iommu->cap_ptr;
u32 low, high;
int ret;

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

/* read extended feature bits */
low = readl(iommu->mmio_base + MMIO_EXT_FEATURES);
high = readl(iommu->mmio_base + MMIO_EXT_FEATURES + 4);

iommu->features = ((u64)high << 32) | low;
iommu->features = readq(iommu->mmio_base + MMIO_EXT_FEATURES);

if (iommu_feature(iommu, FEATURE_GT)) {
int glxval;
Expand Down

0 comments on commit 62dcee7

Please sign in to comment.