Skip to contentSkip to conversation

PCI: Put the IVRS table in AMD ACS quirk handler

PATCH Applied Hanjun Guo 3 participants 4 messages Jul 22, 2020 – Jul 30, 2020 PCI

lore
Share & tools
lore

Hanjun Guo

author
#0 lore raw

PATCH 1/1 PCI: Put the IVRS table in AMD ACS quirk handler

The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used at runtime to release the table mapping.

In pci_quirk_amd_sb_acs(), IVRS table is just used for checking AMD IOMMU is supported, not used at runtime, put the table after using it.

---
 drivers/pci/quirks.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/quirks.c +2 -0
index 812bfc3..487ed4d 100644
@@ -4409,6 +4409,8 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)
 	if (ACPI_FAILURE(status))
 		return -ENODEV;
 
+	acpi_put_table(header);
+
 	/* Filter out flags not applicable to multifunction */
 	acs_flags &= (PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_EC | PCI_ACS_DT);
 
Signature · 1 line
1.7.12.4
#1 lore raw

[+cc Alex, Don]

Quoted 9 lines · Hanjun Guo

The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used at runtime to release the table mapping.

In pci_quirk_amd_sb_acs(), IVRS table is just used for checking AMD IOMMU is supported, not used at runtime, put the table after using it.

Applied to pci/virtualization for v5.9, thanks!

I added this:

Fixes 15b100dfd1c9 ("PCI: Claim ACS support for AMD southbridge devices")

but I didn't add a stable tag. Does this cause any issue that would warrant a stable tag?

Quoted 20 lines
---
 drivers/pci/quirks.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/quirks.c +2 -0
index 812bfc3..487ed4d 100644
@@ -4409,6 +4409,8 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)
 	if (ACPI_FAILURE(status))
 		return -ENODEV;
 
+	acpi_put_table(header);
+
 	/* Filter out flags not applicable to multifunction */
 	acs_flags &= (PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_EC | PCI_ACS_DT);
 
Signature · 1 line
1.7.12.4
author
#2 lore raw
Quoted 13 lines · Bjorn Helgaas

[+cc Alex, Don]

Quoted 9 lines · Hanjun Guo

The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used at runtime to release the table mapping.

In pci_quirk_amd_sb_acs(), IVRS table is just used for checking AMD IOMMU is supported, not used at runtime, put the table after using it.

Quoted 8 lines

Applied to pci/virtualization for v5.9, thanks!

I added this:

Fixes 15b100dfd1c9 ("PCI: Claim ACS support for AMD southbridge devices")

but I didn't add a stable tag. Does this cause any issue that would warrant a stable tag?

We don't have one when I was sending same function patch for ACPI subsystem, so I think it's OK to without a stable tag for this patch as well.

Thanks
Hanjun

#3 lore raw
Quoted 14 lines · Hanjun Guo
Quoted 13 lines · Bjorn Helgaas

[+cc Alex, Don]

Quoted 9 lines · Hanjun Guo

The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used at runtime to release the table mapping.

In pci_quirk_amd_sb_acs(), IVRS table is just used for checking AMD IOMMU is supported, not used at runtime, put the table after using it.

Quoted 9 lines
Quoted 8 lines

Applied to pci/virtualization for v5.9, thanks!

I added this:

Fixes 15b100dfd1c9 ("PCI: Claim ACS support for AMD southbridge devices")

but I didn't add a stable tag.  Does this cause any issue that would warrant a stable tag?

For most of our (bug-fix & functional backport tooling) we focus on 'Fixes' and not
specific stable tagging, since our kernel becomes quite a mix of upstream once we venture much past the RHEL-X.0 GA.
I have seen others that use/reference the stable trees as another sanity check; or a way to
modify a RHEL kernel source into their own private use. Thus, RHEL doesn't have as strong a dependency on stable, as much as it does upstream-tip.

Quoted 7 lines

We don't have one when I was sending same function patch for ACPI subsystem, so I think it's OK to without a stable tag for this patch as well.

Thanks
Hanjun