From eea76553f09ef56e1539f7dea8873524c2e47e6d Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Mon, 16 Nov 2020 13:07:58 +0100 Subject: [PATCH] linux59-tkg: Add a fix for broken acs grouping upstream - https://lkml.org/lkml/2020/10/28/693 Thanks to Bill on Discord for the heads up and testing --- PKGBUILD | 2 +- .../5.9/0003-glitched-base.patch | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index ceced87..7365c6b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -267,7 +267,7 @@ case $_basever in '66a03c246037451a77b4d448565b1d7e9368270c7d02872fbd0b5d024ed0a997' 'f6383abef027fd9a430fd33415355e0df492cdc3c90e9938bf2d98f4f63b32e6' '35a7cde86fb94939c0f25a62b8c47f3de0dbd3c65f876f460b263181b3e92fc0' - '902885088ed0748e40372e04a8ec11adf5acf3d935abffc6737dd9e6ec13bb93' + 'fe13aa1ab002ebdb85569d892a7cf6c9bb60b5d0412c10c76914efaebfd89e2e' '7058e57fd68367b029adc77f2a82928f1433daaf02c8c279cb2d13556c8804d7' 'c605f638d74c61861ebdc36ebd4cb8b6475eae2f6273e1ccb2bbb3e10a2ec3fe' '2bbbac963b6ca44ef3f8a71ec7c5cad7d66df860869a73059087ee236775970a' diff --git a/linux-tkg-patches/5.9/0003-glitched-base.patch b/linux-tkg-patches/5.9/0003-glitched-base.patch index e321500..2585d40 100644 --- a/linux-tkg-patches/5.9/0003-glitched-base.patch +++ b/linux-tkg-patches/5.9/0003-glitched-base.patch @@ -767,3 +767,50 @@ index 6f12bab4d2fa..610ed0817bd7 100644 hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) { return 0x00; } + +From: Rajat Jain +Subject: [PATCH] PCI: Always call pci_enable_acs() regardless of pdev->acs_cap +Date: Wed, 28 Oct 2020 16:15:45 -0700 + +Some devices may have have anomalies with the ACS cpability structure, +and they may be using quirks to support ACS functionality via other +registers. For such devices, it is important we always call +pci_enable_acs() to give the quirks a chance to enable ACS in other ways. + +For Eg: +There seems a class of Intel devices quirked with *_intel_pch_acs_* +functions, that do not expose the standard ACS capability structure. But +these quirks help support ACS on these devices using other registers: +pci_quirk_enable_intel_pch_acs() -> doesn't use acs_cap to enable ACS + +This has already been taken care of in the quirks, in the other direction +i.e. when checking if the ACS is enabled or not. So no need to do +anything there. + +Reported-by: Boris V +Fixes: 52fbf5bdeeef ("PCI: Cache ACS capability offset in device") +Signed-off-by: Rajat Jain +--- + drivers/pci/pci.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c +index 6d4d5a2f923d..ab398226c55e 100644 +--- a/drivers/pci/pci.c ++++ b/drivers/pci/pci.c +@@ -3516,8 +3516,13 @@ void pci_acs_init(struct pci_dev *dev) + { + dev->acs_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS); + +- if (dev->acs_cap) +- pci_enable_acs(dev); ++ /* ++ * Attempt to enable ACS regardless of capability because some rootports ++ * (e.g. the ones quirked with *_intel_pch_acs_*) may not expose ++ * standard rootport capability structure, but still may support ACS via ++ * those quirks. ++ */ ++ pci_enable_acs(dev); + } + + /**