[PATCH AUTOSEL for 4.9 088/219] PCI: Apply Cavium ACS quirk only to CN81xx/CN83xx/CN88xx devices

From: Sasha Levin
Date: Sat Mar 03 2018 - 18:50:18 EST


From: Manish Jaggi <mjaggi@xxxxxxxxxxxxxxxxxx>

[ Upstream commit b77d537d00d08fcf0bf641cd3491dd7df0ad1475 ]

Only apply the Cavium ACS quirk to devices with ID in the range
0xa000-0xa0ff. These are the on-chip PCI devices for CN81xx/CN83xx/CN88xx.

Fixes: b404bcfbf035 ("PCI: Add ACS quirk for all Cavium devices")
Reported-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
Signed-off-by: Manish Jaggi <mjaggi@xxxxxxxxxx>
Acked-by: David Daney <david.daney@xxxxxxxxxx>
Acked-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx>
---
drivers/pci/quirks.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 0c9edc9d7c44..4c9fb8b323e8 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4104,6 +4104,9 @@ static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags)
*/
acs_flags &= ~(PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_SV | PCI_ACS_UF);

+ if (!((dev->device >= 0xa000) && (dev->device <= 0xa0ff)))
+ return -ENOTTY;
+
return acs_flags ? 0 : 1;
}

--
2.14.1