PCI: Enhance the ACS quirk for Cavium devices
PATCH 1/1 PCI: Enhance the ACS quirk for Cavium devices
Enhance the ACS quirk for Cavium Processors. Add the root port vendor ID's in an array and use the same in match function. For newer devices add the vendor ID's in the array so that the match function is simpler.
--- drivers/pci/quirks.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
drivers/pci/quirks.c +19 -9
@@ -4241,17 +4241,27 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +/* CN88xx family of devices */ +0xa180 ,0xa170 , +/* CN99xx family of devices */ +0xaf84 , +/* CN11xxx family of devices */ +0xb884 , +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
Signature · 1 line
2.17.1
[+cc Vadim, Manish]
Quoted 35 lines · George Cherian
Enhance the ACS quirk for Cavium Processors. Add the root port vendor ID's in an array and use the same in match function. For newer devices add the vendor ID's in the array so that the match function is simpler.
Signed-off-by George Cherian <[email protected]>--- drivers/pci/quirks.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)drivers/pci/quirks.c +9
-6@@ -4241,17 +4241,27 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +/* CN88xx family of devices */ +0xa180 ,0xa170 , +/* CN99xx family of devices */ +0xaf84 , +/* CN11xxx family of devices */ +0xb884 , +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/
drivers/pci/quirks.c static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) · line 4261
Quoted 10 lines
drivers/pci/quirks.c +7
-3-return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device)
I'm a little skeptical of this because the previous test:
(dev->device & 0xf800) == 0xa000
could match *many* devices, but of those, the new code only matches two (0xa180, 0xa170).
And the comment says the new code matches the CN99xx and CN11xxx *families*, but it only matches a single device ID for each, which makes me think there may be more devices to come.
Maybe this is all what you want, but please confirm.
The commit log should be explicit that this adds CN99xx and CN11xxx, which previously were not matched.
This looks like stable material?
Quoted 9 lines
drivers/pci/quirks.c +3
-0+return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)Signature · 1 line
2.17.1
Quoted 1 line · Bjorn Helgaas
[+cc Vadim, Manish]
Manish and Vadim are no longer with Cavium, adding Robert for ThunderX1 and Sunil for Cavium networking processors.
Quoted 51 lines · George Cherian
Quoted 35 lines
Enhance the ACS quirk for Cavium Processors. Add the root port vendor ID's in an array and use the same in match function. For newer devices add the vendor ID's in the array so that the match function is simpler.
Signed-off-by George Cherian <[email protected]>--- drivers/pci/quirks.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)drivers/pci/quirks.c +9
-6@@ -4241,17 +4241,27 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +/* CN88xx family of devices */ +0xa180 ,0xa170 , +/* CN99xx family of devices */ +0xaf84 , +/* CN11xxx family of devices */ +0xb884 , +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ drivers/pci/quirks.c static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) · line 4261
Quoted 10 lines
drivers/pci/quirks.c +7
-3-return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device)I'm a little skeptical of this because the previous test:
(
dev->device&0xf800) ==0xa000
Quoted 8 lines
could match *many* devices, but of those, the new code only matches two (
0xa180,0xa170).And the comment says the new code matches the CN99xx and CN11xxx *families*, but it only matches a single device ID for each, which makes me think there may be more devices to come.
Maybe this is all what you want, but please confirm.
There are only a very few device IDs for root ports, so just listing them out like this maybe better. The earlier match covered a lot of ThunderX1 devices, but did not really match the ThunderX2 root ports.
This looks ok for ThunderX2. Sunil & Robert can comment on other processor families I hope.
Quoted 11 lines
The commit log should be explicit that this adds CN99xx and CN11xxx, which previously were not matched.
This looks like stable material?
drivers/pci/quirks.c static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) · line 4267
Quoted 6 lines
drivers/pci/quirks.c +3
-0+return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
JC
Quoted 59 lines · Jayachandran Chandrasekharan Nair
Quoted 58 lines · Bjorn Helgaas
Quoted 35 lines · George Cherian
Enhance the ACS quirk for Cavium Processors. Add the root port vendor ID's in an array and use the same in match function. For newer devices add the vendor ID's in the array so that the match function is simpler.
Signed-off-by George Cherian <[email protected]>--- drivers/pci/quirks.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)drivers/pci/quirks.c +9
-6@@ -4241,17 +4241,27 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +/* CN88xx family of devices */ +0xa180 ,0xa170 , +/* CN99xx family of devices */ +0xaf84 , +/* CN11xxx family of devices */ +0xb884 , +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ drivers/pci/quirks.c static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) · line 4261
Quoted 10 lines
drivers/pci/quirks.c +7
-3-return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device)I'm a little skeptical of this because the previous test:
(
dev->device&0xf800) ==0xa000could match *many* devices, but of those, the new code only matches two (
0xa180,0xa170).And the comment says the new code matches the CN99xx and CN11xxx *families*, but it only matches a single device ID for each, which makes me think there may be more devices to come.
Quoted 8 lines
Quoted 1 line
Maybe this is all what you want, but please confirm.
There are only a very few device IDs for root ports, so just listing them out like this maybe better. The earlier match covered a lot of ThunderX1 devices, but did not really match the ThunderX2 root ports.
This looks ok for ThunderX2. Sunil & Robert can comment on other processor families I hope.
I don't know which of these are ThunderX2 vs ThunderX1.
I currently have the change below on a branch waiting for confirmation that this is what you intend.
Quoted 11 lines
Quoted 11 lines
The commit log should be explicit that this adds CN99xx and CN11xxx, which previously were not matched.
This looks like stable material?
drivers/pci/quirks.c static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) · line 4267
Quoted 6 lines
drivers/pci/quirks.c +3
-0+return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
commit 37b22fbfec2d
Author: George Cherian <[email protected]> Date: Thu Sep 19 02:43:34 2019 +0000
PCI: Apply Cavium ACS quirk to CN99xx and CN11xxx Root Ports
Add an array of Cavium Root Port device IDs and apply the quirk only to the listed devices.
Instead of applying the quirk to all Root Ports where "(dev->device & 0xf800) == 0xa000", apply it only to CN88xx 0xa180 and 0xa170 Root Ports.
Also apply the quirk to CN99xx (0xaf84) and CN11xxx (0xb884) Root Ports.
drivers/pci/quirks.c +16 -9
@@ -4311,17 +4311,24 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +0xa180 ,0xa170 ,/* CN88xx family of devices */ +0xaf84 ,/* CN99xx family of devices */ +0xb884 ,/* CN11xxx family of devices */ +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
Quoted 4 lines · Bjorn Helgaas
commit
37b22fbfec2dAuthor: George Cherian <[email protected]> Date: Thu Sep 19 02:43:34 2019 +0000
Quoted 8 lines
PCI: Apply Cavium ACS quirk to CN99xx and CN11xxx Root Ports
Add an array of Cavium Root Port device IDs and apply the quirk only to the listed devices.
Instead of applying the quirk to all Root Ports where "(
dev->device&0xf800) ==0xa000", apply it only to CN88xx0xa180and0xa170Root Ports.
No, this can't be removed. It is a match all for all CN8xxx variants (note the 3 'x', all TX1 cores). So all device ids from 0xa000 to 0xa7FF are affected here and need the quirk.
Quoted 2 lines
Also apply the quirk to CN99xx (0xaf84) and CN11xxx (0xb884) Root Ports.I thought the quirk is CN8xxx specific, but I could be wrong here.
-Robert
Quoted 46 lines
Fixes f2ddaf8dfd4a ("PCI: Apply Cavium ThunderX ACS quirk to more Root Ports")Fixes b404bcfbf035 ("PCI: Add ACS quirk for all Cavium devices")Signed-off-by George Cherian <[email protected]>Signed-off-by Bjorn Helgaas <[email protected]>Cc [email protected] # v4.12+drivers/pci/quirks.c +16
-9@@ -4311,17 +4311,24 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +0xa180 ,0xa170 ,/* CN88xx family of devices */ +0xaf84 ,/* CN99xx family of devices */ +0xb884 ,/* CN11xxx family of devices */ +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
Quoted 10 lines · Robert Richter
Quoted 9 lines · Bjorn Helgaas
commit
37b22fbfec2dAuthor: George Cherian <[email protected]> Date: Thu Sep 19 02:43:34 2019 +0000PCI: Apply Cavium ACS quirk to CN99xx and CN11xxx Root Ports
Add an array of Cavium Root Port device IDs and apply the quirk only to the listed devices.
Quoted 7 lines
Quoted 3 lines
Instead of applying the quirk to all Root Ports where "(dev->device & 0xf800) == 0xa000", apply it only to CN88xx 0xa180 and 0xa170 Root Ports.No, this can't be removed. It is a match all for all CN8xxx variants (note the 3 'x', all TX1 cores). So all device ids from
0xa000to0xa7FFare affected here and need the quirk.
OK, I'll drop the patch and wait for a new one. Maybe what was needed was to keep the "(dev->device & 0xf800) == 0xa000" part and add the pci_quirk_cavium_acs_ids[] array in addition?
Quoted 52 lines
Quoted 1 line
Also apply the quirk to CN99xx (0xaf84) and CN11xxx (0xb884) Root Ports.I thought the quirk is CN8xxx specific, but I could be wrong here.
-Robert
Quoted 46 lines
Fixes f2ddaf8dfd4a ("PCI: Apply Cavium ThunderX ACS quirk to more Root Ports")Fixes b404bcfbf035 ("PCI: Add ACS quirk for all Cavium devices")Signed-off-by George Cherian <[email protected]>Signed-off-by Bjorn Helgaas <[email protected]>Cc [email protected] # v4.12+drivers/pci/quirks.c +16
-9@@ -4311,17 +4311,24 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +0xa180 ,0xa170 ,/* CN88xx family of devices */ +0xaf84 ,/* CN99xx family of devices */ +0xb884 ,/* CN11xxx family of devices */ +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
Hi Bjorn,
Sorry for the late reply I was off for couple of days.
Quoted 17 lines · Bjorn Helgaas
External Email
----------------------------------------------------------------------
Quoted 13 lines · Robert Richter
Quoted 12 lines · Bjorn Helgaas
commit
37b22fbfec2dAuthor: George Cherian <[email protected]> Date: Thu Sep 19 02:43:34 2019 +0000PCI: Apply Cavium ACS quirk to CN99xx and CN11xxx Root Ports
Add an array of Cavium Root Port device IDs and apply the quirk only to the listed devices.
Instead of applying the quirk to all Root Ports where "(
dev->device&0xf800) ==0xa000", apply it only to CN88xx0xa180and0xa170Root Ports.
All the root ports of CN88xx series will have device id's 0xa180 and 0xa170.
This patch currently targets only CN88xx series and not all of the CN8xxx.
For eg:- 83xx devices don't wont the quirk to be applied as of today. The quirk
needs to be applied only for TX1 series and not oncteon-tx1 series.
Quoted 8 lines
Quoted 3 lines
No, this can't be removed. It is a match all for all CN8xxx variants (note the 3 'x', all TX1 cores). So all device ids from
0xa000to0xa7FFare affected here and need the quirk.OK, I'll drop the patch and wait for a new one. Maybe what was needed was to keep the "(
dev->device&0xf800) ==0xa000" part and add the pci_quirk_cavium_acs_ids[] array in addition?Quoted 1 line
Quoted 1 line
Also apply the quirk to CN99xx (0xaf84) and CN11xxx (0xb884) Root Ports.
The device id's for all variants of CN99xx is 0xaf84 and CN11xxx will be 0xb884.
So this patch holds good for TX2 as well as TX3 series of processors.
Quoted 50 lines
Quoted 50 lines
I thought the quirk is CN8xxx specific, but I could be wrong here.
-Robert
Quoted 46 lines
Fixes f2ddaf8dfd4a ("PCI: Apply Cavium ThunderX ACS quirk to more Root Ports")Fixes b404bcfbf035 ("PCI: Add ACS quirk for all Cavium devices")Signed-off-by George Cherian <[email protected]>Signed-off-by Bjorn Helgaas <[email protected]>Cc [email protected] # v4.12+drivers/pci/quirks.c +16
-9@@ -4311,17 +4311,24 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +0xa180 ,0xa170 ,/* CN88xx family of devices */ +0xaf84 ,/* CN99xx family of devices */ +0xb884 ,/* CN11xxx family of devices */ +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
Quoted 39 lines · George Cherian
Hi Bjorn,
Sorry for the late reply I was off for couple of days.
Quoted 17 lines · Bjorn Helgaas
External Email
----------------------------------------------------------------------
Quoted 13 lines · Robert Richter
Quoted 12 lines · Bjorn Helgaas
commit
37b22fbfec2dAuthor: George Cherian <[email protected]> Date: Thu Sep 19 02:43:34 2019 +0000PCI: Apply Cavium ACS quirk to CN99xx and CN11xxx Root Ports
Add an array of Cavium Root Port device IDs and apply the quirk only to the listed devices.
Instead of applying the quirk to all Root Ports where "(
dev->device&0xf800) ==0xa000", apply it only to CN88xx0xa180and0xa170Root Ports.All the root ports of CN88xx series will have device id's
0xa180and0xa170.This patch currently targets only CN88xx series and not all of the CN8xxx.
For eg:- 83xx devices don't wont the quirk to be applied as of today. The quirk
needs to be applied only for TX1 series and not oncteon-tx1 series.
Quoted 7 lines
Quoted 3 lines
No, this can't be removed. It is a match all for all CN8xxx variants (note the 3 'x', all TX1 cores). So all device ids from
0xa000to0xa7FFare affected here and need the quirk.OK, I'll drop the patch and wait for a new one. Maybe what was needed was to keep the "(
dev->device&0xf800) ==0xa000" part and add the pci_quirk_cavium_acs_ids[] array in addition?
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Also apply the quirk to CN99xx (0xaf84) and CN11xxx (0xb884) Root Ports.The device id's for all variants of CN99xx is
0xaf84and CN11xxx will be0xb884.So this patch holds good for TX2 as well as TX3 series of processors.
OK, can you and Robert get together and post something with Robert's Reviewed-by? Please make the commit log a little more specific about which families/variants are supported (the vendor IDs are very specific, but not as user-friendly as CN99xx, etc).
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
I thought the quirk is CN8xxx specific, but I could be wrong here.
-Robert
Quoted 46 lines
Fixes f2ddaf8dfd4a ("PCI: Apply Cavium ThunderX ACS quirk to more Root Ports")Fixes b404bcfbf035 ("PCI: Add ACS quirk for all Cavium devices")Signed-off-by George Cherian <[email protected]>Signed-off-by Bjorn Helgaas <[email protected]>Cc [email protected] # v4.12+drivers/pci/quirks.c +16
-9@@ -4311,17 +4311,24 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +0xa180 ,0xa170 ,/* CN88xx family of devices */ +0xaf84 ,/* CN99xx family of devices */ +0xb884 ,/* CN11xxx family of devices */ +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
Quoted 45 lines · Bjorn Helgaas
Quoted 44 lines · George Cherian
Hi Bjorn,
Sorry for the late reply I was off for couple of days.
Quoted 17 lines · Bjorn Helgaas
External Email
----------------------------------------------------------------------
Quoted 13 lines · Robert Richter
Quoted 12 lines · Bjorn Helgaas
commit
37b22fbfec2dAuthor: George Cherian <[email protected]> Date: Thu Sep 19 02:43:34 2019 +0000PCI: Apply Cavium ACS quirk to CN99xx and CN11xxx Root Ports
Add an array of Cavium Root Port device IDs and apply the quirk only to the listed devices.
Instead of applying the quirk to all Root Ports where "(
dev->device&0xf800) ==0xa000", apply it only to CN88xx0xa180and0xa170Root Ports.All the root ports of CN88xx series will have device id's
0xa180and0xa170.This patch currently targets only CN88xx series and not all of the CN8xxx.
For eg:- 83xx devices don't wont the quirk to be applied as of today. The quirk
needs to be applied only for TX1 series and not oncteon-tx1 series.
Quoted 8 lines
Quoted 3 lines
No, this can't be removed. It is a match all for all CN8xxx variants (note the 3 'x', all TX1 cores). So all device ids from
0xa000to0xa7FFare affected here and need the quirk.OK, I'll drop the patch and wait for a new one. Maybe what was needed was to keep the "(
dev->device&0xf800) ==0xa000" part and add the pci_quirk_cavium_acs_ids[] array in addition?Quoted 1 line
Quoted 1 line
Also apply the quirk to CN99xx (0xaf84) and CN11xxx (0xb884) Root Ports.The device id's for all variants of CN99xx is
0xaf84and CN11xxx will be0xb884.
Quoted 6 lines
Quoted 1 line
So this patch holds good for TX2 as well as TX3 series of processors.
OK, can you and Robert get together and post something with Robert's Reviewed-by? Please make the commit log a little more specific about which families/variants are supported (the vendor IDs are very specific, but not as user-friendly as CN99xx, etc).
Just to make sure this doesn't get lost, please post an update. I currently do not have this patch queued up for v5.5 because I haven't seen a clear consensus on what it should look like.
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
I thought the quirk is CN8xxx specific, but I could be wrong here.
-Robert
Quoted 46 lines
Fixes f2ddaf8dfd4a ("PCI: Apply Cavium ThunderX ACS quirk to more Root Ports")Fixes b404bcfbf035 ("PCI: Add ACS quirk for all Cavium devices")Signed-off-by George Cherian <[email protected]>Signed-off-by Bjorn Helgaas <[email protected]>Cc [email protected] # v4.12+drivers/pci/quirks.c +16
-9@@ -4311,17 +4311,24 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +0xa180 ,0xa170 ,/* CN88xx family of devices */ +0xaf84 ,/* CN99xx family of devices */ +0xb884 ,/* CN11xxx family of devices */ +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
Quoted 48 lines · Bjorn Helgaas
Quoted 47 lines · Bjorn Helgaas
Quoted 45 lines · George Cherian
Hi Bjorn,
Sorry for the late reply I was off for couple of days.
Quoted 17 lines · Bjorn Helgaas
External Email
----------------------------------------------------------------------
Quoted 13 lines · Robert Richter
Quoted 12 lines · Bjorn Helgaas
commit
37b22fbfec2dAuthor: George Cherian <[email protected]> Date: Thu Sep 19 02:43:34 2019 +0000PCI: Apply Cavium ACS quirk to CN99xx and CN11xxx Root Ports
Add an array of Cavium Root Port device IDs and apply the quirk only to the listed devices.
Instead of applying the quirk to all Root Ports where "(
dev->device&0xf800) ==0xa000", apply it only to CN88xx0xa180and0xa170Root Ports.All the root ports of CN88xx series will have device id's
0xa180and0xa170.This patch currently targets only CN88xx series and not all of the CN8xxx.
For eg:- 83xx devices don't wont the quirk to be applied as of today. The quirk
needs to be applied only for TX1 series and not oncteon-tx1 series.
Quoted 8 lines
Quoted 3 lines
No, this can't be removed. It is a match all for all CN8xxx variants (note the 3 'x', all TX1 cores). So all device ids from
0xa000to0xa7FFare affected here and need the quirk.OK, I'll drop the patch and wait for a new one. Maybe what was needed was to keep the "(
dev->device&0xf800) ==0xa000" part and add the pci_quirk_cavium_acs_ids[] array in addition?Quoted 1 line
Quoted 1 line
Also apply the quirk to CN99xx (0xaf84) and CN11xxx (0xb884) Root Ports.The device id's for all variants of CN99xx is
0xaf84and CN11xxx will be0xb884.So this patch holds good for TX2 as well as TX3 series of processors.
Quoted 8 lines
Quoted 4 lines
OK, can you and Robert get together and post something with Robert's Reviewed-by? Please make the commit log a little more specific about which families/variants are supported (the vendor IDs are very specific, but not as user-friendly as CN99xx, etc).
Just to make sure this doesn't get lost, please post an update. I currently do not have this patch queued up for v5.5 because I haven't seen a clear consensus on what it should look like.
Ping?
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
I thought the quirk is CN8xxx specific, but I could be wrong here.
-Robert
Quoted 46 lines
Fixes f2ddaf8dfd4a ("PCI: Apply Cavium ThunderX ACS quirk to more Root Ports")Fixes b404bcfbf035 ("PCI: Add ACS quirk for all Cavium devices")Signed-off-by George Cherian <[email protected]>Signed-off-by Bjorn Helgaas <[email protected]>Cc [email protected] # v4.12+drivers/pci/quirks.c +16
-9@@ -4311,17 +4311,24 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +0xa180 ,0xa170 ,/* CN88xx family of devices */ +0xaf84 ,/* CN99xx family of devices */ +0xb884 ,/* CN11xxx family of devices */ +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)
Quoted 54 lines · Bjorn Helgaas
Quoted 53 lines · Bjorn Helgaas
Quoted 51 lines · Bjorn Helgaas
Quoted 39 lines · George Cherian
Hi Bjorn,
Sorry for the late reply I was off for couple of days.
Quoted 17 lines · Bjorn Helgaas
External Email
----------------------------------------------------------------------
Quoted 13 lines · Robert Richter
Quoted 12 lines · Bjorn Helgaas
commit
37b22fbfec2dAuthor: George Cherian <[email protected]> Date: Thu Sep 19 02:43:34 2019 +0000PCI: Apply Cavium ACS quirk to CN99xx and CN11xxx Root Ports
Add an array of Cavium Root Port device IDs and apply the quirk only to the listed devices.
Instead of applying the quirk to all Root Ports where "(
dev->device&0xf800) ==0xa000", apply it only to CN88xx0xa180and0xa170Root Ports.All the root ports of CN88xx series will have device id's
0xa180and0xa170.This patch currently targets only CN88xx series and not all of the CN8xxx.
For eg:- 83xx devices don't wont the quirk to be applied as of today. The quirk
needs to be applied only for TX1 series and not oncteon-tx1 series.
Quoted 7 lines
Quoted 3 lines
No, this can't be removed. It is a match all for all CN8xxx variants (note the 3 'x', all TX1 cores). So all device ids from
0xa000to0xa7FFare affected here and need the quirk.OK, I'll drop the patch and wait for a new one. Maybe what was needed was to keep the "(
dev->device&0xf800) ==0xa000" part and add the pci_quirk_cavium_acs_ids[] array in addition?Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Also apply the quirk to CN99xx (0xaf84) and CN11xxx (0xb884) Root Ports.The device id's for all variants of CN99xx is
0xaf84and CN11xxx will be0xb884.So this patch holds good for TX2 as well as TX3 series of processors.
OK, can you and Robert get together and post something with Robert's Reviewed-by? Please make the commit log a little more specific about which families/variants are supported (the vendor IDs are very specific, but not as user-friendly as CN99xx, etc).
Quoted 5 lines
Quoted 3 lines
Just to make sure this doesn't get lost, please post an update. I currently do not have this patch queued up for v5.5 because I haven't seen a clear consensus on what it should look like.
Ping?
Ping again. This Cavium ACS quirk is *not* queued up for v5.5.
If you still want the quirk, please repost it and get Robert's Reviewed-by.
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
Quoted 50 lines
I thought the quirk is CN8xxx specific, but I could be wrong here.
-Robert
Quoted 46 lines
Fixes f2ddaf8dfd4a ("PCI: Apply Cavium ThunderX ACS quirk to more Root Ports")Fixes b404bcfbf035 ("PCI: Add ACS quirk for all Cavium devices")Signed-off-by George Cherian <[email protected]>Signed-off-by Bjorn Helgaas <[email protected]>Cc [email protected] # v4.12+drivers/pci/quirks.c +16
-9@@ -4311,17 +4311,24 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)#endif } +static const u16 pci_quirk_cavium_acs_ids[] = { +0xa180 ,0xa170 ,/* CN88xx family of devices */ +0xaf84 ,/* CN99xx family of devices */ +0xb884 ,/* CN11xxx family of devices */ +}; +static bool pci_quirk_cavium_acs_match (struct pci_dev *dev) { -/* -* Effectively selects all downstream ports for whole ThunderX 1 -* family by 0xf800 mask (which represents 8 SoCs), while the lower -* bits of device ID are used to indicate which subdevice is used -* within the SoC. -*/ -return (pci_is_pcie (dev) && - (pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT ) && - ((dev->device &0xf800 ) ==0xa000 )); +int i; + +if (!pci_is_pcie (dev) ||pci_pcie_type (dev) !=PCI_EXP_TYPE_ROOT_PORT ) +return false; + +for (i =0 ; i <ARRAY_SIZE (pci_quirk_cavium_acs_ids); i++) +if (pci_quirk_cavium_acs_ids[i] == dev->device) +return true; + +return false; }static int pci_quirk_cavium_acs (struct pci_dev *dev,u16 acs_flags)