mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
Merge branch 'pci/acs'
- Fix bugs in 'pci=config_acs=' kernel command line parameter (Tushar Dave) * pci/acs: PCI/ACS: Fix 'pci=config_acs=' parameter
This commit is contained in:
commit
c6d99abb21
|
|
@ -954,8 +954,10 @@ struct pci_acs {
|
|||
};
|
||||
|
||||
static void __pci_config_acs(struct pci_dev *dev, struct pci_acs *caps,
|
||||
const char *p, u16 mask, u16 flags)
|
||||
const char *p, const u16 acs_mask, const u16 acs_flags)
|
||||
{
|
||||
u16 flags = acs_flags;
|
||||
u16 mask = acs_mask;
|
||||
char *delimit;
|
||||
int ret = 0;
|
||||
|
||||
|
|
@ -963,7 +965,7 @@ static void __pci_config_acs(struct pci_dev *dev, struct pci_acs *caps,
|
|||
return;
|
||||
|
||||
while (*p) {
|
||||
if (!mask) {
|
||||
if (!acs_mask) {
|
||||
/* Check for ACS flags */
|
||||
delimit = strstr(p, "@");
|
||||
if (delimit) {
|
||||
|
|
@ -971,6 +973,8 @@ static void __pci_config_acs(struct pci_dev *dev, struct pci_acs *caps,
|
|||
u32 shift = 0;
|
||||
|
||||
end = delimit - p - 1;
|
||||
mask = 0;
|
||||
flags = 0;
|
||||
|
||||
while (end > -1) {
|
||||
if (*(p + end) == '0') {
|
||||
|
|
@ -1027,10 +1031,14 @@ static void __pci_config_acs(struct pci_dev *dev, struct pci_acs *caps,
|
|||
|
||||
pci_dbg(dev, "ACS mask = %#06x\n", mask);
|
||||
pci_dbg(dev, "ACS flags = %#06x\n", flags);
|
||||
pci_dbg(dev, "ACS control = %#06x\n", caps->ctrl);
|
||||
pci_dbg(dev, "ACS fw_ctrl = %#06x\n", caps->fw_ctrl);
|
||||
|
||||
/* If mask is 0 then we copy the bit from the firmware setting. */
|
||||
caps->ctrl = (caps->ctrl & ~mask) | (caps->fw_ctrl & mask);
|
||||
caps->ctrl |= flags;
|
||||
/*
|
||||
* For mask bits that are 0, copy them from the firmware setting
|
||||
* and apply flags for all the mask bits that are 1.
|
||||
*/
|
||||
caps->ctrl = (caps->fw_ctrl & ~mask) | (flags & mask);
|
||||
|
||||
pci_info(dev, "Configured ACS to %#06x\n", caps->ctrl);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user