#
86dd379d |
| 27-Mar-2025 |
John Baldwin <jhb@FreeBSD.org> |
pci: Use a single variable for the offset of the power management registers
This is the more typical pattern for other capability register sets, and two of these variables weren't used.
Differentia
pci: Use a single variable for the offset of the power management registers
This is the more typical pattern for other capability register sets, and two of these variables weren't used.
Differential Revision: https://reviews.freebsd.org/D49267
show more ...
|
#
e5cbf0e8 |
| 27-Mar-2025 |
John Baldwin <jhb@FreeBSD.org> |
pci: Add helper routines to manage PME in device drivers
pci_has_pm is a quick check that returns true if a PCI device supports the power management capability.
pci_enable_pme can be used in DEVICE
pci: Add helper routines to manage PME in device drivers
pci_has_pm is a quick check that returns true if a PCI device supports the power management capability.
pci_enable_pme can be used in DEVICE_SUSPEND driver methods to enable PME# during suspend.
Reviewed by: Krzysztof Galazka <krzysztof.galazka@intel.com>x Differential Revision: https://reviews.freebsd.org/D49250
show more ...
|
#
82d69277 |
| 27-Mar-2025 |
John Baldwin <jhb@FreeBSD.org> |
pci: Clear active PME# and disable PME# generation
The PCI power management specification requires that the OS clear any pending PME# interrupt and generation of PME# interrupts during "initial oper
pci: Clear active PME# and disable PME# generation
The PCI power management specification requires that the OS clear any pending PME# interrupt and generation of PME# interrupts during "initial operating system load". Note that clearing a pending PME# interrupt requires writing a 1 to the Read/Write-Clear PME bit in the power management status register. To handle the boot time case, clear PME# state in pci_read_cap() when scanning new PCI devices. This should also cover hotplug devices.
In addition, clear this state on every PCI device after resume from sleep in pci_resume_child before invoking the driver's DEVICE_RESUME method.
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49222
show more ...
|
Revision tags: release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4 |
|
#
34602013 |
| 11-Feb-2025 |
John Baldwin <jhb@FreeBSD.org> |
pci: Don't cache the count of MSI/MSI-X messages before allocation
A device can in theory change the read-only fields in the MSI/MSI-X control registers that indicate the maximum number of supported
pci: Don't cache the count of MSI/MSI-X messages before allocation
A device can in theory change the read-only fields in the MSI/MSI-X control registers that indicate the maximum number of supported registers in response to changing other device registers. For example, certain Intel networking VFs change the number of messages as a result of changes in the PCI_IOV_ADD_VF callback.
To support this, always read the current value of the relevant control register in the *_count and *_alloc methods. Once messages have been allocated, the control register value remains cached.
Reported by: Krzysztof Galazka <krzysztof.galazka@intel.com> Reviewed by: Krzysztof Galazka <krzysztof.galazka@intel.com>, erj Differential Revision: https://reviews.freebsd.org/D48890
show more ...
|
#
a3835cce |
| 11-Feb-2025 |
John Baldwin <jhb@FreeBSD.org> |
pci: Cosmetic cleanups to MSI/MSI-X routines
- Use unsigned integers for various variables. The count argument to the alloc method as well as the IRQ values used with the pcib_if.m methods shou
pci: Cosmetic cleanups to MSI/MSI-X routines
- Use unsigned integers for various variables. The count argument to the alloc method as well as the IRQ values used with the pcib_if.m methods should also be unsigned eventually.
- Use mallocarray to allocate arrays
- Use bool in a few places
Reviewed by: Krzysztof Galazka <krzysztof.galazka@intel.com> Differential Revision: https://reviews.freebsd.org/D48889
show more ...
|
Revision tags: release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3 |
|
#
c118e4da |
| 22-Dec-2024 |
Jean-Sébastien Pédron <dumbbell@FreeBSD.org> |
pci: Add `pci_find_base_class_from()`
[Why] linuxkpi needs to export `pci_get_base_class()` for DRM drivers from Linux 6.7.
[How] This new function searches a PCI device with the given base class a
pci: Add `pci_find_base_class_from()`
[Why] linuxkpi needs to export `pci_get_base_class()` for DRM drivers from Linux 6.7.
[How] This new function searches a PCI device with the given base class and returns it, regardless of its subclass.
The behavior is the same as `pci_find_class_from()` but the subclass is ignored.
Reviewed by: manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48745
show more ...
|
Revision tags: release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0, release/14.0.0 |
|
#
95ee2897 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
16bedf53 |
| 19-Aug-2022 |
John Baldwin <jhb@FreeBSD.org> |
pci: Add helper routines to iterate over a device's BARs.
Reviewed by: imp, markj, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3
pci: Add helper routines to iterate over a device's BARs.
Reviewed by: imp, markj, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36237
show more ...
|
Revision tags: release/13.1.0 |
|
#
b7672a70 |
| 07-May-2022 |
Ruslan Bukin <br@FreeBSD.org> |
Add OFW_IOMMU id type for pci_get_id() so we can ask parent IOMMU controller to map PCI RID to an IOMMU specifier.
Sponsored by: UKRI Discussed with: jhb Differential Revision: https://reviews.freeb
Add OFW_IOMMU id type for pci_get_id() so we can ask parent IOMMU controller to map PCI RID to an IOMMU specifier.
Sponsored by: UKRI Discussed with: jhb Differential Revision: https://reviews.freebsd.org/D35129
show more ...
|
Revision tags: release/12.3.0, release/13.0.0 |
|
#
1acf24a0 |
| 16-Mar-2021 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Implement pci_get_relaxed_ordering_enabled() helper function.
Discussed with: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
|
#
8517a547 |
| 10-Dec-2020 |
Emmanuel Vadot <manu@FreeBSD.org> |
pci: Add pci_find_class_from
pci_find_class_from help finding one or multiple device matching a class and subclass. If the from argument is not null we will first loop in the device list until we fi
pci: Add pci_find_class_from
pci_find_class_from help finding one or multiple device matching a class and subclass. If the from argument is not null we will first loop in the device list until we find the matching device and only then start to check if the class/subclass matches.
Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D27549
show more ...
|
Revision tags: release/12.2.0 |
|
#
c7aa572c |
| 31-Jul-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
17996960 |
| 31-Jul-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r363583 through r363738.
|
#
855e49f3 |
| 27-Jul-2020 |
Alexander Motin <mav@FreeBSD.org> |
Add initial driver for ACPI Platform Error Interfaces.
APEI allows platform to report different kinds of errors to OS in several ways. We've found that Supermicro X10/X11 motherboards report PCIe e
Add initial driver for ACPI Platform Error Interfaces.
APEI allows platform to report different kinds of errors to OS in several ways. We've found that Supermicro X10/X11 motherboards report PCIe errors appearing on hot-unplug via this interface using NMI. Without respective driver it ended up in kernel panic without any additional information.
This driver introduces support for the APEI Generic Hardware Error Source reporting via NMI, SCI or polling. It decodes the reported errors and either pass them to pci(4) for processing or just logs otherwise. Errors marked as fatal still end up in kernel panic, but some more informative.
When somebody get to native PCIe AER support implementation both of the reporting mechanisms should get common error recovery code. Since in our case errors happen when the device is already gone, there is nothing to recover, so the code just clears the error statuses, practically ignoring the otherwise destructive NMIs in nicer way.
MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc.
show more ...
|
#
4cee4598 |
| 26-Jun-2020 |
Alexander Motin <mav@FreeBSD.org> |
Add mostly dummy hw.pci.enable_aspm tunable.
The only thing this tunable enables now is reporting to ACPI _OSC that Active State Power Management and Clock Power Management Capability are "supported
Add mostly dummy hw.pci.enable_aspm tunable.
The only thing this tunable enables now is reporting to ACPI _OSC that Active State Power Management and Clock Power Management Capability are "supported" by the OS.
I've found that at least some Supermicro server boards do not allow OS to support native PCIe hot-plug unless it reports those capabilities. After spending significant time in PCIe specs I have found very little motivation for that, and none of it applies to those motherboards, not enabling ASPM themselves. So unless OS explicitly wants to save power, I see nothing for it to do there actually.
I guess it may get sense to support ASPM when we get Thunderbolt support. Otherwise I have no system with PCIe hot-plug where power saving matters.
It would be nice to enable this by default, but I worry that it affect power saving of some laptops, even though I haven't noticed that myself.
show more ...
|
Revision tags: release/11.4.0 |
|
#
fce5d19d |
| 04-Dec-2019 |
Stefan Eßer <se@FreeBSD.org> |
Remove "All rights reserved" phrase from copyright notes.
With the ratification of the Berne Convention in 2000, it became obsolete.
I have removed that phrase and the "(c)" only from files without
Remove "All rights reserved" phrase from copyright notes.
With the ratification of the Berne Convention in 2000, it became obsolete.
I have removed that phrase and the "(c)" only from files without copyright claims by other parties. There are 2 files (pci.c, pci_private.h) that are also claimed by Michael Smith <msmith@freebsd.org> and by BSDi, which have therefore not been included in this commit.
When all member nations of the Buenos Aires Convention adopted the Berne Convention, the phrase "All rights reserved" became unnecessary to assert copyright. Remove it from files under my copyright.
There are 2 files (pci.c, pci_private.h) that) that do also bear msmith's and BSDi's copyright. I have left them unchanged for now, since I do not know whether they (or the legal successor in case of BSDi) would agree.
show more ...
|
Revision tags: release/12.1.0, release/11.3.0 |
|
#
0269ae4c |
| 06-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @348740
Sponsored by: The FreeBSD Foundation
|
#
e2e050c8 |
| 20-May-2019 |
Conrad Meyer <cem@FreeBSD.org> |
Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces hea
Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially.
EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).
As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files.
LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change).
No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.
show more ...
|
#
7648bc9f |
| 13-May-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @347527
Sponsored by: The FreeBSD Foundation
|
#
96ca24dc |
| 19-Apr-2019 |
Tycho Nightingale <tychon@FreeBSD.org> |
remove the 4GB boundary requirement on PCI DMA segments
Reviewed by: kib Discussed with: jhb Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D19867
|
#
5db2a4a8 |
| 05-Apr-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
Implement resets for PCI buses and PCIe bridges.
For PCI device (i.e. child of a PCI bus), reset tries FLR if implemented and worked, and falls to power reset otherwise.
For PCIe bus (child of a PC
Implement resets for PCI buses and PCIe bridges.
For PCI device (i.e. child of a PCI bus), reset tries FLR if implemented and worked, and falls to power reset otherwise.
For PCIe bus (child of a PCIe bridge or root port), reset disables PCIe link and then re-trains it, performing what is known as link-level reset.
Reviewed by: imp (previous version), jhb (previous version) Sponsored by: Mellanox Technologies MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D19646
show more ...
|
#
f9856d08 |
| 21-Mar-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @345353
|
#
31243781 |
| 19-Mar-2019 |
Warner Losh <imp@FreeBSD.org> |
Fix two typos: an -> and; the the -> the
And justify the paragraph after the change (and set fill column to 80 instead of 70).
Noticed by: rpokala@, vangyzen@
|
#
35613d10 |
| 19-Mar-2019 |
Warner Losh <imp@FreeBSD.org> |
Add comment about why we bother to use endian macros here, and why we must use bitfields.
|