freebsd-nq/sys/dev/pci
Andriy Gapon cffd37da23 do not enable pci bridge decoding on resume until I/O windows are restored
PCI bus driver restores most but not all of a child PCI-PCI bridge
configuration.  The bridge's I/O windows are restored by pcib driver and
that happens later in time.  This can be problematic because the Command
register is restored before the windows are restored.  If the firmware
programs the windows incorrectly or even does not program them at all,
then the bridge can start claiming I/O cycles that are not intended for
it.  This will continue until the correct windows are restored.

I have observed this problem with a buggy BIOS where after resuming from
S3 an I/O port window of a PCI-PCI bridge was configured with zero base
and limit causing the bridge to claim 0x0 - 0xFFF port range.  That
interfered with ACPI port access including ACPI PM Timer at port 0x808,
thus wreaking havoc in the time keeping.

The solution is to restore the Command register of PCI-PCI bridges after
the windows are restored in pcib driver.  While here, I decided that for
other PCI device types (normal and cardbus) it's better to restore the
Command register after their BARs are restored.

To do: per jhb's suggestion, move the window handling to pci driver.

Reviewed by:	imp, jhb, kib
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D25028
2020-05-29 07:50:55 +00:00
..
controller Add PCI Express driver for the ARM Neoverse N1 System Development 2020-02-11 15:12:09 +00:00
fixup_pci.c
hostb_pci.c Remove "All rights reserved" phrase from copyright notes. 2019-12-04 08:03:33 +00:00
ignore_pci.c
isa_pci.c
pci_dw_if.m Add driver for DesignWare PCIE core, and its Armada 8K specific attachement. 2019-10-20 11:11:32 +00:00
pci_dw_mv.c Add driver for DesignWare PCIE core, and its Armada 8K specific attachement. 2019-10-20 11:11:32 +00:00
pci_dw.c Add driver for DesignWare PCIE core, and its Armada 8K specific attachement. 2019-10-20 11:11:32 +00:00
pci_dw.h Add driver for DesignWare PCIE core, and its Armada 8K specific attachement. 2019-10-20 11:11:32 +00:00
pci_host_generic_acpi.c Add PCI Express driver for the ARM Neoverse N1 System Development 2020-02-11 15:12:09 +00:00
pci_host_generic_acpi.h Add PCI Express driver for the ARM Neoverse N1 System Development 2020-02-11 15:12:09 +00:00
pci_host_generic_fdt.c Remove PCI_IO_WINDOW_OFFSET from the pci host generic fdt attachment. 2020-04-24 11:03:15 +00:00
pci_host_generic_fdt.h
pci_host_generic.c Move the ECAM macroses to the header file. 2020-01-24 16:08:06 +00:00
pci_host_generic.h Move the ECAM macroses to the header file. 2020-01-24 16:08:06 +00:00
pci_if.m
pci_iov_if.m
pci_iov_private.h
pci_iov_schema.c
pci_iov.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
pci_iov.h
pci_pci.c do not enable pci bridge decoding on resume until I/O windows are restored 2020-05-29 07:50:55 +00:00
pci_private.h Export pci_attach() and pci_detach(). 2019-10-15 18:58:01 +00:00
pci_subr.c
pci_user.c Remove "All rights reserved" phrase from copyright notes. 2019-12-04 08:03:33 +00:00
pci.c do not enable pci bridge decoding on resume until I/O windows are restored 2020-05-29 07:50:55 +00:00
pcib_if.m
pcib_private.h Abstract the locking for PCIe hotplug. It still uses Giant so there's 2019-12-26 21:00:06 +00:00
pcib_support.c
pcireg.h Add more values for PCI capabilities, PCIe extended capabilities, and subclasses. 2020-02-20 17:08:52 +00:00
pcivar.h Remove "All rights reserved" phrase from copyright notes. 2019-12-04 08:03:33 +00:00
schema_private.h
vga_pci.c Fix the build after r350570. 2019-08-04 19:47:02 +00:00