freebsd-nq/sys/dev/pci
Warner Losh e64f3dee49 Work around devices which return all zeros for reads of existing MSI-X
table VCTRL registers.

Unconditionally program the MSI-X vector control Mask field for MSI-X
table entries without regarud for Mask's previous value. Some devices
return all zeros on reads of the VCTRL registers, which would cause us
to skip disabling interrupts. This fixes the Samsung SM961/PM961 SSDs
which are return zero starting from offset 0x3084 within the memory
region specified by BAR0, even when they are active MSI-X vectors.

The Illumos kernel writes these unconditionally to 0 or 1. However,
section 6.8.2.9 of the PCI Local Bus 3.0 spec (dated Feb 3, 2004)
states for bits 31::01:
	After reset, the state of these bits must be 0. However, for
	potential future use, software must preserve the value of
	these reserved bits when modifying the value of other Vector
	Control bits. If software modifies the value of these reserved
	bits, the result is undefined."
so we always set or clear the Mask bit, but otherwise preserves the
old value.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211713
Reviewed By: imp, jhb
Submitted by: Ka Ho Ng
MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D20873
2019-07-08 19:38:49 +00:00
..
fixup_pci.c
hostb_pci.c Add PCI methods to iterate over the PCI capabilities 2018-02-19 18:41:56 +00:00
ignore_pci.c
isa_pci.c
pci_host_generic_acpi.c pci: ecam: Correctly parse memory and IO region 2019-05-17 17:05:16 +00:00
pci_host_generic_fdt.c Pass pci_base address instead of physical address to rman_manage_region(). 2019-05-29 15:53:33 +00:00
pci_host_generic_fdt.h
pci_host_generic.c pci: ecam: Correctly parse memory and IO region 2019-05-17 17:05:16 +00:00
pci_host_generic.h pci_host_generic*: basic implementation of bus range 2018-11-19 02:55:18 +00:00
pci_if.m Add PCI methods to iterate over the PCI capabilities 2018-02-19 18:41:56 +00:00
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 Only respond to the PCIe Attention Button if a device is already plugged in. 2019-06-05 04:58:42 +00:00
pci_private.h Add PCI methods to iterate over the PCI capabilities 2018-02-19 18:41:56 +00:00
pci_subr.c
pci_user.c Need to apply the PCIM_BAR_MEM_BASE mask to the physical memory 2019-06-28 22:28:51 +00:00
pci.c Work around devices which return all zeros for reads of existing MSI-X 2019-07-08 19:38:49 +00:00
pcib_if.m
pcib_private.h
pcib_support.c
pcireg.h Add PCIV_INVALID definition 2018-09-26 13:16:55 +00:00
pcivar.h Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
schema_private.h
vga_pci.c Drop "All rights reserved" from my copyright statements. 2019-03-06 22:11:45 +00:00