diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-08-27 16:38:14 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-09-12 22:10:57 -0400 |
commit | eab3a0ee342106a1c82e10682c02632e9d6af0df (patch) | |
tree | 517babc69f1251d4d1287048d60ae1bde726e9f1 /drivers/pci/probe.c | |
parent | c6285fc5b55ecbf78c53301a191f04bb2fda1b3a (diff) |
PCI: Preserve BIOS PCI_COMMAND_SERR and PCI_COMMAND_PARITY settings
Do not clear PCI_COMMAND_SERR or PCI_COMMAND_PARITY based on _HPP. The
spec (ACPI rev 5.0, sec 6.2.7) says that when "Enable SERR" is set to 1,
we should enable SERR in the command register. It says nothing about
*disabling* SERR or PERR; in fact, the example in 6.2.7.1 says we should
leave PERR alone unless "Enable PERR" is 1.
For hot-added devices, this probably doesn't matter because they power up
with these bits cleared. But in addition to hot-plugged devices, the spec
allows the platform to use _HPP for "configuration of PCI devices not
configured by the BIOS at system boot," and it may make a difference for
devices present at boot.
This change means that if BIOS enables SERR or PERR on a device, and it
supplies _HPP or _HPX with the SERR or PERR bits *cleared*, we will now
leave SERR or PERR reporting enabled on that device instead of disabling it
as we previously did.
See also 40abb96c51bb ("pciehp: Fix programming hotplug parameters"), where
this code was first added.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 003d112a783d..a16b3472b70d 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -1264,12 +1264,8 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) | |||
1264 | pci_read_config_word(dev, PCI_COMMAND, &pci_cmd); | 1264 | pci_read_config_word(dev, PCI_COMMAND, &pci_cmd); |
1265 | if (hpp->enable_serr) | 1265 | if (hpp->enable_serr) |
1266 | pci_cmd |= PCI_COMMAND_SERR; | 1266 | pci_cmd |= PCI_COMMAND_SERR; |
1267 | else | ||
1268 | pci_cmd &= ~PCI_COMMAND_SERR; | ||
1269 | if (hpp->enable_perr) | 1267 | if (hpp->enable_perr) |
1270 | pci_cmd |= PCI_COMMAND_PARITY; | 1268 | pci_cmd |= PCI_COMMAND_PARITY; |
1271 | else | ||
1272 | pci_cmd &= ~PCI_COMMAND_PARITY; | ||
1273 | pci_write_config_word(dev, PCI_COMMAND, pci_cmd); | 1269 | pci_write_config_word(dev, PCI_COMMAND, pci_cmd); |
1274 | 1270 | ||
1275 | /* Program bridge control value */ | 1271 | /* Program bridge control value */ |
@@ -1279,12 +1275,8 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) | |||
1279 | pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &pci_bctl); | 1275 | pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &pci_bctl); |
1280 | if (hpp->enable_serr) | 1276 | if (hpp->enable_serr) |
1281 | pci_bctl |= PCI_BRIDGE_CTL_SERR; | 1277 | pci_bctl |= PCI_BRIDGE_CTL_SERR; |
1282 | else | ||
1283 | pci_bctl &= ~PCI_BRIDGE_CTL_SERR; | ||
1284 | if (hpp->enable_perr) | 1278 | if (hpp->enable_perr) |
1285 | pci_bctl |= PCI_BRIDGE_CTL_PARITY; | 1279 | pci_bctl |= PCI_BRIDGE_CTL_PARITY; |
1286 | else | ||
1287 | pci_bctl &= ~PCI_BRIDGE_CTL_PARITY; | ||
1288 | pci_write_config_word(dev, PCI_BRIDGE_CONTROL, pci_bctl); | 1280 | pci_write_config_word(dev, PCI_BRIDGE_CONTROL, pci_bctl); |
1289 | } | 1281 | } |
1290 | } | 1282 | } |