Skip to content

Commit 303ce56

Browse files
committed
Merge: Merge branch 'pci/acs'
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6874 ``` - Correct documentation of the 'config_acs=' kernel parameter (Akihiko Odaki) - Fix bugs in 'pci=config_acs=' kernel command line parameter (Tushar Dave) * pci/acs: PCI/ACS: Fix 'pci=config_acs=' parameter JIRA: https://issues.redhat.com/browse/RHEL-72898 Signed-off-by: Myron Stowe <[email protected]> ``` Approved-by: Tony Camuso <[email protected]> Approved-by: Desnes Nunes <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Jan Stancek <[email protected]>
2 parents e0ecdbf + 0aec1c2 commit 303ce56

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4545,7 +4545,7 @@
45454545
'1' – force enabled
45464546
'x' – unchanged
45474547
For example,
4548-
pci=config_acs=10x
4548+
pci=config_acs=10x@pci:0:0
45494549
would configure all devices that support
45504550
ACS to enable P2P Request Redirect, disable
45514551
Translation Blocking, and leave Source

drivers/pci/pci.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -955,23 +955,27 @@ struct pci_acs {
955955
};
956956

957957
static void __pci_config_acs(struct pci_dev *dev, struct pci_acs *caps,
958-
const char *p, u16 mask, u16 flags)
958+
const char *p, const u16 acs_mask, const u16 acs_flags)
959959
{
960+
u16 flags = acs_flags;
961+
u16 mask = acs_mask;
960962
char *delimit;
961963
int ret = 0;
962964

963965
if (!p)
964966
return;
965967

966968
while (*p) {
967-
if (!mask) {
969+
if (!acs_mask) {
968970
/* Check for ACS flags */
969971
delimit = strstr(p, "@");
970972
if (delimit) {
971973
int end;
972974
u32 shift = 0;
973975

974976
end = delimit - p - 1;
977+
mask = 0;
978+
flags = 0;
975979

976980
while (end > -1) {
977981
if (*(p + end) == '0') {
@@ -1028,10 +1032,14 @@ static void __pci_config_acs(struct pci_dev *dev, struct pci_acs *caps,
10281032

10291033
pci_dbg(dev, "ACS mask = %#06x\n", mask);
10301034
pci_dbg(dev, "ACS flags = %#06x\n", flags);
1035+
pci_dbg(dev, "ACS control = %#06x\n", caps->ctrl);
1036+
pci_dbg(dev, "ACS fw_ctrl = %#06x\n", caps->fw_ctrl);
10311037

1032-
/* If mask is 0 then we copy the bit from the firmware setting. */
1033-
caps->ctrl = (caps->ctrl & ~mask) | (caps->fw_ctrl & mask);
1034-
caps->ctrl |= flags;
1038+
/*
1039+
* For mask bits that are 0, copy them from the firmware setting
1040+
* and apply flags for all the mask bits that are 1.
1041+
*/
1042+
caps->ctrl = (caps->fw_ctrl & ~mask) | (flags & mask);
10351043

10361044
pci_info(dev, "Configured ACS to %#06x\n", caps->ctrl);
10371045
}

0 commit comments

Comments
 (0)