OSDN Git Service

PCI: Preserve BIOS PCI_COMMAND_SERR and PCI_COMMAND_PARITY settings
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 27 Aug 2014 20:38:14 +0000 (14:38 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Sat, 13 Sep 2014 02:10:57 +0000 (20:10 -0600)
commiteab3a0ee342106a1c82e10682c02632e9d6af0df
tree517babc69f1251d4d1287048d60ae1bde726e9f1
parentc6285fc5b55ecbf78c53301a191f04bb2fda1b3a
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>
drivers/pci/probe.c