Commit cf64e785 authored by Bartosz Pawlowski's avatar Bartosz Pawlowski Committed by sanglipeng1
Browse files

PCI: Extract ATS disabling to a helper function

stable inclusion
from stable-v5.10.208
commit b74a0c4ddf577293833231e52c6e885c90632036
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9T22K

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b74a0c4ddf577293833231e52c6e885c90632036



--------------------------------

commit f18b1137d38c091cc8c16365219f0a1d4a30b3d1 upstream.

Introduce quirk_no_ats() helper function to provide a standard way to
disable ATS capability in PCI quirks.

Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230908143606.685930-2-bartosz.pawlowski@intel.com


Signed-off-by: default avatarBartosz Pawlowski <bartosz.pawlowski@intel.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng1 <sanglipeng1@jd.com>
parent 930578fd
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -5425,6 +5425,12 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0420, quirk_no_ext_tags);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, 0x0422, quirk_no_ext_tags);

#ifdef CONFIG_PCI_ATS
static void quirk_no_ats(struct pci_dev *pdev)
{
	pci_info(pdev, "disabling ATS\n");
	pdev->ats_cap = 0;
}

/*
 * Some devices require additional driver setup to enable ATS.  Don't use
 * ATS for those devices as ATS will be enabled before the driver has had a
@@ -5437,8 +5443,7 @@ static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
	    (pdev->device == 0x7341 && pdev->revision != 0x00))
		return;

	pci_info(pdev, "disabling ATS\n");
	pdev->ats_cap = 0;
	quirk_no_ats(pdev);
}

/* AMD Stoney platform GPU */