#
82a5a275 |
| 17-Dec-2018 |
Andriy Gapon <avg@FreeBSD.org> |
add support for marking interrupt handlers as suspended
The goal of this change is to fix a problem with PCI shared interrupts during suspend and resume.
I have observed a couple of variations of t
add support for marking interrupt handlers as suspended
The goal of this change is to fix a problem with PCI shared interrupts during suspend and resume.
I have observed a couple of variations of the following scenario. Devices A and B are on the same PCI bus and share the same interrupt. Device A's driver is suspended first and the device is powered down. Device B generates an interrupt. Interrupt handlers of both drivers are called. Device A's interrupt handler accesses registers of the powered down device and gets back bogus values (I assume all 0xff). That data is interpreted as interrupt status bits, etc. So, the interrupt handler gets confused and may produce some noise or enter an infinite loop, etc.
This change affects only PCI devices. The pci(4) bus driver marks a child's interrupt handler as suspended after the child's suspend method is called and before the device is powered down. This is done only for traditional PCI interrupts, because only they can be shared.
At the moment the change is only for x86.
Notable changes in core subsystems / interfaces: - BUS_SUSPEND_INTR and BUS_RESUME_INTR methods are added to bus interface along with convenience functions bus_suspend_intr and bus_resume_intr; - rman_set_irq_cookie and rman_get_irq_cookie functions are added to provide a way to associate an interrupt resource with an interrupt cookie; - intr_event_suspend_handler and intr_event_resume_handler functions are added to the MI interrupt handler interface.
I added two new interrupt handler flags, IH_SUSP and IH_CHANGED, to implement the new intr_event functions. IH_SUSP marks a suspended interrupt handler. IH_CHANGED is used to implement a barrier that ensures that a change to the interrupt handler's state is visible to future interrupts. While there, I fixed some whitespace issues in comments and changed a couple of logically boolean variables to be bool.
MFC after: 1 month (maybe) Differential Revision: https://reviews.freebsd.org/D15755
show more ...
|
#
867bb99b |
| 17-Dec-2018 |
Greg Lehey <grog@FreeBSD.org> |
Work around BIOS quirks on HPE Proliant MicroServer Gen10
PR: 221350 Submitted by: Bob Bishop Reported by: Rafal Lukawiecki Reviewed by: jhb MFC after: 2 weeks
|
#
bfed756a |
| 04-Dec-2018 |
Justin Hibbits <jhibbits@FreeBSD.org> |
Sprinkle EARLY_DRIVER_MODULE around the tree
Mark some buses as BUS_PASS_BUS, and some resources as BUS_PASS_RESOURCE. This also decouples some resource attachment orderings from being races by devi
Sprinkle EARLY_DRIVER_MODULE around the tree
Mark some buses as BUS_PASS_BUS, and some resources as BUS_PASS_RESOURCE. This also decouples some resource attachment orderings from being races by device tree ordering, instead relying on the bus pass to provide the ordering.
This was originally intended to support multipass suspend/resume, but it's also needed on PowerMacs when using fdt, as the device tree seems to get created in reverse of the OFW tree. Reviewed by: nwhitehorn (long ago) Differential Revision: https://reviews.freebsd.org/D918
show more ...
|
#
1ace6e5b |
| 18-Aug-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Rudimentary AER reading code for ddb(4).
This is very primitive code to inspect the PCI error state and AER error state, dump the log and clear errors, from ddb. pci_print_faulted_dev() is made exte
Rudimentary AER reading code for ddb(4).
This is very primitive code to inspect the PCI error state and AER error state, dump the log and clear errors, from ddb. pci_print_faulted_dev() is made external to allow calling it from other places. It was called from NMI handler but this chunk is not included.
Also there is a tunable-controlled code to clear AER on device attach, disabled by default.
All this code was useful to me when I debugged ACPI_DMAR failures (not faults) long time ago.
Reviewed by: cem, imp (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7813
show more ...
|
#
971b5f76 |
| 07-Jul-2018 |
Warner Losh <imp@FreeBSD.org> |
Create PCI_MATCH and pci_match_device
Create a covenience function to match PCI device IDs. It's about 15 years overdue.
Differential Revision: https://reviews.freebsd.org/D15999
|
#
7a16dacd |
| 19-Feb-2018 |
Bryan Venteicher <bryanv@FreeBSD.org> |
Add PCI methods to iterate over the PCI capabilities
VirtIO V1 provides configuration in multiple VENDOR capabilities so this allows all of the configuration to be discovered.
Reviewed by: jhb MFC
Add PCI methods to iterate over the PCI capabilities
VirtIO V1 provides configuration in multiple VENDOR capabilities so this allows all of the configuration to be discovered.
Reviewed by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14325
show more ...
|
#
151ba793 |
| 25-Dec-2017 |
Alexander Kabaev <kan@FreeBSD.org> |
Do pass removing some write-only variables from the kernel.
This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports.
Reviewed by: kib, andrew(
Do pass removing some write-only variables from the kernel.
This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports.
Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial) Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c) Differential Revision: https://reviews.freebsd.org/D10385
show more ...
|
#
bb010783 |
| 20-Dec-2017 |
Warner Losh <imp@FreeBSD.org> |
Add device location wiring to the pci bus.
This allows one to specify, for example, that if there's an igb card in bus 12, slot 0, function 0, it should be assigned igb5. If there isn't, or there's
Add device location wiring to the pci bus.
This allows one to specify, for example, that if there's an igb card in bus 12, slot 0, function 0, it should be assigned igb5. If there isn't, or there's one in a different slot, normal numbering rules apply (hinted units are skipped). Adding 'hint.igb.5.at="pci12:0:0"' or 'hint.igb.5.at="pci0:12:0:0"' to /boot/device.hints will accomplish this. The double quotes are important.
The kernel only accepts the strings (in shell notation): pci$d:$b:$s:$f and pci$b:$s:$f where $d is the pci domain, $b is the pci bus number, $s is the slot number and $f is the function number. A string compare is done with the current device to avoid another string parser in the kernel. All numbers are unsigned decimal without leading zeros.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13546
show more ...
|
#
718cf2cc |
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
show more ...
|
#
eab9d0a8 |
| 15-Nov-2017 |
Warner Losh <imp@FreeBSD.org> |
Inline pcie_link_{status,caps} where needed. Remove them as they aren't really needed and I don't want to document them.
Suggested by: jhb@ Sponsored by: Netflix
|
#
d505913c |
| 14-Nov-2017 |
Warner Losh <imp@FreeBSD.org> |
Provide pcie_link_status and pcie_link_cap convenience functions.
Sponsored by: Netflix
|
#
ceb972cf |
| 09-Oct-2017 |
Alan Somers <asomers@FreeBSD.org> |
Remove embedded newlines from sysctl variable descriptions
PR: 112556 Submitted by: Willem Jan Withagen <wjw@digiware.nl> (earlier version) Reported by: Willem Jan Withagen, ighighi@gmail.com MFC a
Remove embedded newlines from sysctl variable descriptions
PR: 112556 Submitted by: Willem Jan Withagen <wjw@digiware.nl> (earlier version) Reported by: Willem Jan Withagen, ighighi@gmail.com MFC after: 3 weeks Sponsored by: Spectra Logic Corp
show more ...
|
#
d4ed36cd |
| 01-Aug-2017 |
Roger Pau Monné <royger@FreeBSD.org> |
pci: fix write order when sizing BARs
According to the PCI Local Specification rev. 3.0 in case of a 64-bit BAR both the low and the high parts of the register should be set to ~0 before attempting
pci: fix write order when sizing BARs
According to the PCI Local Specification rev. 3.0 in case of a 64-bit BAR both the low and the high parts of the register should be set to ~0 before attempting to read back the size.
So far I have found no single device that has problems with the previous approach, but I think it's better to stay on the safe size.
This commit should not introduce any functional change.
MFC after: 3 weeks Sponsored by: Citrix Systems R&D Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D11750
show more ...
|
#
1536a1b8 |
| 16-Jan-2017 |
Sepherosa Ziehau <sephe@FreeBSD.org> |
alc: Add Killer E2500 support
Reviewed by: jhb, yongari MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9058
|
#
db4fcadf |
| 15-Jan-2017 |
Conrad Meyer <cem@FreeBSD.org> |
"Buses" is the preferred plural of "bus"
Replace archaic "busses" with modern form "buses."
Intentionally excluded: * Old/random drivers I didn't recognize * Old hardware in general * Use of "bus
"Buses" is the preferred plural of "bus"
Replace archaic "busses" with modern form "buses."
Intentionally excluded: * Old/random drivers I didn't recognize * Old hardware in general * Use of "busses" in code as identifiers
No functional change.
http://grammarist.com/spelling/buses-busses/
PR: 216099 Reported by: bltsrc at mail.ru Sponsored by: Dell EMC Isilon
show more ...
|
#
fafbaf79 |
| 30-Dec-2016 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Add MSIX rewrite table quirk for use with VMs.
This patch solves IRQ generation problems using the mlx5en(4) driver with xenserver v6.5.0 in SRIOV and PCI-passthrough modes.
Until further the hw.pc
Add MSIX rewrite table quirk for use with VMs.
This patch solves IRQ generation problems using the mlx5en(4) driver with xenserver v6.5.0 in SRIOV and PCI-passthrough modes.
Until further the hw.pci.msix_rewrite_table quirk must be set manually in /boot/loader.conf .
Reviewed by: jhb @ Sponsored by: Mellanox Technologies MFC after: 2 weeks
show more ...
|
#
a7a560be |
| 21-Oct-2016 |
Alexander Motin <mav@FreeBSD.org> |
Add names for some DASP devices.
Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week
|
#
4d6e19e4 |
| 27-Sep-2016 |
Sepherosa Ziehau <sephe@FreeBSD.org> |
pci: Clear the MEM/PORT_EN bit when updating PCI BAR
It's unsafe to update the BAR when the related EN bit is set.
Submitted by: Dexuan Cui <decui microsoft com> Reviewed by: jhb MFC after: 1 week
pci: Clear the MEM/PORT_EN bit when updating PCI BAR
It's unsafe to update the BAR when the related EN bit is set.
Submitted by: Dexuan Cui <decui microsoft com> Reviewed by: jhb MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7914
show more ...
|
#
bd716692 |
| 21-Sep-2016 |
John Baldwin <jhb@FreeBSD.org> |
Fix invalid vendor ID constant (typo).
During a bus rescan the check for an invalid vendor ID of a subfunction used the wrong constant.
Submitted by: Dexuan Cui <decui@microsoft.com> MFC after: 3 d
Fix invalid vendor ID constant (typo).
During a bus rescan the check for an invalid vendor ID of a subfunction used the wrong constant.
Submitted by: Dexuan Cui <decui@microsoft.com> MFC after: 3 days
show more ...
|
#
da0fc925 |
| 06-Sep-2016 |
John Baldwin <jhb@FreeBSD.org> |
Reset PCI pass through devices via PCI-e FLR during VM start and end.
Add routines to trigger a function level reset (FLR) of a PCI-express device via the PCI-express device control register. This
Reset PCI pass through devices via PCI-e FLR during VM start and end.
Add routines to trigger a function level reset (FLR) of a PCI-express device via the PCI-express device control register. This also includes support routines to wait for pending transactions to complete as well as calculating the maximum completion timeout permitted by a device.
Change the ppt(4) driver to reset pass through devices before attaching to a VM during startup and before detaching from a VM during shutdown.
Reviewed by: imp, wblock (earlier version) MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7751
show more ...
|
#
64414cc0 |
| 06-Sep-2016 |
John Baldwin <jhb@FreeBSD.org> |
Update the I/O MMU in bhyve when PCI devices are added and removed.
When the I/O MMU is active in bhyve, all PCI devices need valid entries in the DMAR context tables. The I/O MMU code does a single
Update the I/O MMU in bhyve when PCI devices are added and removed.
When the I/O MMU is active in bhyve, all PCI devices need valid entries in the DMAR context tables. The I/O MMU code does a single enumeration of the available PCI devices during initialization to add all existing devices to a domain representing the host. The ppt(4) driver then moves pass through devices in and out of domains for virtual machines as needed. However, when new PCI devices were added at runtime either via SR-IOV or HotPlug, the I/O MMU tables were not updated.
This change adds a new set of EVENTHANDLERS that are invoked when PCI devices are added and deleted. The I/O MMU driver in bhyve installs handlers for these events which it uses to add and remove devices to the "host" domain.
Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7667
show more ...
|
#
477cba21 |
| 22-Aug-2016 |
Pyun YongHyeon <yongari@FreeBSD.org> |
Add Killer E2400 Gigabit Ethernet support. It seems Killer E2200/E2400 has a BIOS misconfiguration or silicon bug which triggers DMA write errors when driver uses advertised maximum payload size. Fo
Add Killer E2400 Gigabit Ethernet support. It seems Killer E2200/E2400 has a BIOS misconfiguration or silicon bug which triggers DMA write errors when driver uses advertised maximum payload size. Force the maximum payload size to 128 bytes in DMA configuration. This change should fix occasional DMA write errors reported on Killer E2200.
Tested by: <psy0nic@sys-tek.org>
show more ...
|
#
2ab0398d |
| 24-Jun-2016 |
John Baldwin <jhb@FreeBSD.org> |
Add pci_get_max_payload() to fetch the PCI-express maximum payload size.
Approved by: re (gjb) MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.
Add pci_get_max_payload() to fetch the PCI-express maximum payload size.
Approved by: re (gjb) MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D6951
show more ...
|
#
d7be980d |
| 16-May-2016 |
Andrew Turner <andrew@FreeBSD.org> |
Re-commit r299467 having fixed the build:
Add a new get_id interface to pci and pcib. This will allow us to both detect failures, and get different PCI IDs.
For the former the interface returns an
Re-commit r299467 having fixed the build:
Add a new get_id interface to pci and pcib. This will allow us to both detect failures, and get different PCI IDs.
For the former the interface returns an int to signal an error. The ID is returned at a uintptr_t * argument.
For the latter there is a type argument that allows selecting the ID type. This only specifies a single type, however a MSI type will be added to handle the need to find the ID the hardware passes to the ARM GICv3 interrupt controller.
A follow up commit will be made to remove pci_get_rid.
Reviewed by: jhb, rstone (previous version) Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6239
show more ...
|
#
f41be0f0 |
| 11-May-2016 |
Conrad Meyer <cem@FreeBSD.org> |
Revert r299467 to fix the kernel build.
$ svn merge -c -299467 .
Approved by: build being broken for six hours
|