Skip to content

Commit f18b113

Browse files
bartoszp-ghbjorn-helgaas
authored andcommitted
PCI: Extract ATS disabling to a helper function
Introduce quirk_no_ats() helper function to provide a standard way to disable ATS capability in PCI quirks. Suggested-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Pawlowski <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
1 parent 0bb80ec commit f18b113

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

drivers/pci/quirks.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5507,6 +5507,12 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0420, quirk_no_ext_tags);
55075507
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0422, quirk_no_ext_tags);
55085508

55095509
#ifdef CONFIG_PCI_ATS
5510+
static void quirk_no_ats(struct pci_dev *pdev)
5511+
{
5512+
pci_info(pdev, "disabling ATS\n");
5513+
pdev->ats_cap = 0;
5514+
}
5515+
55105516
/*
55115517
* Some devices require additional driver setup to enable ATS. Don't use
55125518
* ATS for those devices as ATS will be enabled before the driver has had a
@@ -5520,14 +5526,10 @@ static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
55205526
(pdev->subsystem_device == 0xce19 ||
55215527
pdev->subsystem_device == 0xcc10 ||
55225528
pdev->subsystem_device == 0xcc08))
5523-
goto no_ats;
5524-
else
5525-
return;
5529+
quirk_no_ats(pdev);
5530+
} else {
5531+
quirk_no_ats(pdev);
55265532
}
5527-
5528-
no_ats:
5529-
pci_info(pdev, "disabling ATS\n");
5530-
pdev->ats_cap = 0;
55315533
}
55325534

55335535
/* AMD Stoney platform GPU */

0 commit comments

Comments
 (0)