Skip to content

Commit eebf098

Browse files
committed
Merge: Merge branch 'pci/acs'
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/716 ``` - 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-72899 Signed-off-by: Myron Stowe <mstowe@redhat.com> ``` Approved-by: John W. Linville <linville@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: Lucas Zampieri <lzampier@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents b39c8eb + b11c0fe commit eebf098

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

drivers/pci/pci.c

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

956956
static void __pci_config_acs(struct pci_dev *dev, struct pci_acs *caps,
957-
const char *p, u16 mask, u16 flags)
957+
const char *p, const u16 acs_mask, const u16 acs_flags)
958958
{
959+
u16 flags = acs_flags;
960+
u16 mask = acs_mask;
959961
char *delimit;
960962
int ret = 0;
961963

962964
if (!p)
963965
return;
964966

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

973975
end = delimit - p - 1;
976+
mask = 0;
977+
flags = 0;
974978

975979
while (end > -1) {
976980
if (*(p + end) == '0') {
@@ -1027,10 +1031,14 @@ static void __pci_config_acs(struct pci_dev *dev, struct pci_acs *caps,
10271031

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

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

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

0 commit comments

Comments
 (0)