History log of /freebsd/sys/dev/pci/pci.c (Results 1 – 25 of 1158)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 5884fab4 20-Jan-2025 Mitchell Horne <mhorne@FreeBSD.org>

pci: cleanup __PCI_REROUTE_INTERRUPTS

This flag was used as a transition for differing pcib implementations.
Today it is defined for all supported architectures, and can be removed.

Reviewed by: im

pci: cleanup __PCI_REROUTE_INTERRUPTS

This flag was used as a transition for differing pcib implementations.
Today it is defined for all supported architectures, and can be removed.

Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D48485

show more ...


# 6ba2c036 07-Jan-2025 Konstantin Belousov <kib@FreeBSD.org>

pci_find_cap_method(): limit number of iterations for finding a capability

Powered down device might return 0xff of extended config registers
reads, causing loop.

PR: 283815
Reviewed by: imp
Sponso

pci_find_cap_method(): limit number of iterations for finding a capability

Powered down device might return 0xff of extended config registers
reads, causing loop.

PR: 283815
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D48348

show more ...


# 143dff0f 03-Jan-2025 Andrew Turner <andrew@FreeBSD.org>

pci: Only claim to support PCI ASPM on x86

We claim to support Active State Power Management, but don't appear to
do anything different in the kernel when it's enabled other than tell
the firmware w

pci: Only claim to support PCI ASPM on x86

We claim to support Active State Power Management, but don't appear to
do anything different in the kernel when it's enabled other than tell
the firmware we do.

This breaks VMware Fusion on Apple Silicon when it's enabled as it
expects the kernel to enable the ports. As it is reported to be needed
on some x86 servers keep it enabled there, but disable on non-x86
architectures.

Reported by: kp, tuexen
Reviewed by: tuexen, mav, imp, jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48303

show more ...


# 160179ea 02-Jan-2025 John Baldwin <jhb@FreeBSD.org>

Remove now-redundant calls to device_delete_children

Earlier calls to bus_generic_detach now take care of deleting
children.

Differential Revision: https://reviews.freebsd.org/D47962


# 18250ec6 06-Dec-2024 John Baldwin <jhb@FreeBSD.org>

Replace calls to bus_generic_attach with bus_attach_children

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675


Revision tags: release/14.2.0, release/13.4.0
# 971c9f57 08-Aug-2024 John Baldwin <jhb@FreeBSD.org>

pci: Narrow the scope of recently-added PCI_IOV #ifdefs

Push the #ifdefs down into the function body instead of defining
functions conditionally for ease of readability. These aren't
critical paths

pci: Narrow the scope of recently-added PCI_IOV #ifdefs

Push the #ifdefs down into the function body instead of defining
functions conditionally for ease of readability. These aren't
critical paths, so one extra branch in the !PCI_IOV case is not a big
deal.

Requested by: jrtc27
Differential Revision: https://reviews.freebsd.org/D45877

show more ...


# 5b56413d 25-Jul-2024 Warner Losh <imp@FreeBSD.org>

newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANY

Sponsored by: Netflix


# e1d442a6 18-Jul-2024 Jessica Clarke <jrtc27@FreeBSD.org>

Retire unused non-PCI_RES_BUS code

All architectures define PCI_RES_BUS unconditionally now that only
NEW_PCIB is supported, so we no longer need the legacy code.

Reviewed by: jhb, andrew
Different

Retire unused non-PCI_RES_BUS code

All architectures define PCI_RES_BUS unconditionally now that only
NEW_PCIB is supported, so we no longer need the legacy code.

Reviewed by: jhb, andrew
Differential Revision: https://reviews.freebsd.org/D32955

show more ...


# 8415a654 18-Jul-2024 Jessica Clarke <jrtc27@FreeBSD.org>

Retire non-NEW_PCIB code and remove config option

All architectures enable NEW_PCIB in DEFAULTS (arm being the most recent
to do so in 121be555997b (arm: Set NEW_PCIB in DEFAULTS rather than a
subse

Retire non-NEW_PCIB code and remove config option

All architectures enable NEW_PCIB in DEFAULTS (arm being the most recent
to do so in 121be555997b (arm: Set NEW_PCIB in DEFAULTS rather than a
subset of kernel configs")), so it's time we removed the legacy code
that no longer sees much testing and has a significant maintenance
burden.

Reviewed by: jhb, andrew, emaste
Differential Revision: https://reviews.freebsd.org/D32954

show more ...


# 39bda097 08-Jul-2024 Ryan Libby <rlibby@FreeBSD.org>

pci: propagate vpd read error

On read error, we would return -1, but not handle it, causing a zero
size malloc of value, and then we wouldd unconditionally write
value[-1 + 1] = '\0'. This should b

pci: propagate vpd read error

On read error, we would return -1, but not handle it, causing a zero
size malloc of value, and then we wouldd unconditionally write
value[-1 + 1] = '\0'. This should be harmless in terms of buffer
overflow because we should get a minimum non-zero size allocation from
malloc, but it also effectively swallowed the error.

Reported by: GCC -Wstringop-overflow
Reviewed by: kib, se
Differential Revision: https://reviews.freebsd.org/D45895

show more ...


# 56b822a1 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

pci: Only add special VF handling for direct children in bus methods

For activate/deactivate resource, use a more standard check at the
start of the function since the addition of the PCI_IOV code m

pci: Only add special VF handling for direct children in bus methods

For activate/deactivate resource, use a more standard check at the
start of the function since the addition of the PCI_IOV code made this
more complex. For the three recently added methods, just add the
typical check at the beginning that I missed.

This wasn't always fatal as if your system only had PCI device_t's as
children of PCI bus devices it would happen to work ok, but if you
have a non-PCI child device (e.g. an ATA channel) then dereferencing
ivars for non-direct-children could fault.

Reported by: Cirrus-CI (via emaste)
Reviewed by: emaste
Fixes: 871b33ad65ba pci: Consistently use pci_vf_* for suballocated VF memory resources
Differential Revision: https://reviews.freebsd.org/D45499

show more ...


# 871b33ad 05-Jun-2024 John Baldwin <jhb@FreeBSD.org>

pci: Consistently use pci_vf_* for suballocated VF memory resources

Some of the bus resource methods were passing these up to the parent
which triggered rman mismatch assertions in INVARIANTS kernel

pci: Consistently use pci_vf_* for suballocated VF memory resources

Some of the bus resource methods were passing these up to the parent
which triggered rman mismatch assertions in INVARIANTS kernels.

Reported by: kp
Reviewed by: imp
Tested by: kp (earlier version)
Differential Revision: https://reviews.freebsd.org/D45406

show more ...


# 0f1d148c 01-Jun-2024 John Baldwin <jhb@FreeBSD.org>

pci: Use kobj typedefs for new-bus method prototypes

Reviewed by: kp, imp
Differential Revision: https://reviews.freebsd.org/D45405


Revision tags: release/14.1.0
# 9dbf5b0e 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE

The public bus_release_resource() API still accepts both forms, but
the internal kobj method no longer passes the arguments.

new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE

The public bus_release_resource() API still accepts both forms, but
the internal kobj method no longer passes the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44131

show more ...


# 2baed46e 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCE

The public bus_activate/deactivate_resource() API still accepts both
forms, but the internal kobj methods no longer pass th

new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCE

The public bus_activate/deactivate_resource() API still accepts both
forms, but the internal kobj methods no longer pass the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44130

show more ...


Revision tags: release/13.3.0, release/14.0.0
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 43e545e8 14-Aug-2023 Ed Maste <emaste@FreeBSD.org>

pci: return 0 for pci_remap_intr_method MSI-X non-error case

When remapping a MSI-X vector, we would always return ENOENT, even if
successful. This didn't really matter, as the sole caller of
BUS_R

pci: return 0 for pci_remap_intr_method MSI-X non-error case

When remapping a MSI-X vector, we would always return ENOENT, even if
successful. This didn't really matter, as the sole caller of
BUS_REMAP_INTR also didn't check for errors.

Return 0 if there's no error, so that we can start handling (or at least
warning about) actual failures.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41449

show more ...


# 586164cc 21-Jun-2023 Stefan Eßer <se@FreeBSD.org>

dev/pci: simplify PCI VPD access functions

This update contains a rewrite of the VPD parser based on the
definition of the structure of the VPD data (ident, R/O resource
data, optional R/W data, end

dev/pci: simplify PCI VPD access functions

This update contains a rewrite of the VPD parser based on the
definition of the structure of the VPD data (ident, R/O resource
data, optional R/W data, end tag).

The parser it replaces was based on a state machine, with the tags
and the parsed data controlling the state changes. The flexibility
of this parser is actually not required, and it has caused kernel
panics when operating on malformed data.

Analysis of the VPD code to make it more robust lead me to believe
that it was easier to write a "strict" parser than to restrict the
flexible state machine to detect and reject non-well-formed data.
A number of restrictions had already been added, but they make the
state machine ever more complex and harder to understand.

This updated parser has been verified to return identical parsed data
as the current implementation for the example VPD data given in the
PCI standard and in some actual PCIe VPD data.

It is strict in the sense that it detects and rejects any deviation
from a well-formed VPD structure.

PR: 272018
Approved by: kib
MFC after: 4 weeks
Differential Revision: https://reviews.freebsd.org/D34268

show more ...


# 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
# 48d70503 06-Feb-2023 Corvin Köhne <corvink@FreeBSD.org>

pci: add tunable hw.pci.enable_mps_tune

If the tunable is set to 0, the tuning of the MPS (maximum payload size)
is disabled and the default MPS values set by the BIOS are used. In this
case the sys

pci: add tunable hw.pci.enable_mps_tune

If the tunable is set to 0, the tuning of the MPS (maximum payload size)
is disabled and the default MPS values set by the BIOS are used. In this
case the system may use a lower speed or operate in a less optimized
state, but it can resolve issues with stability and compatibility. With
specific devices the tuning of the mps, can lead to a complete freeze of
the system.

Reviewed by: manu
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D38397

show more ...


Revision tags: release/12.4.0
# 6b497700 03-Sep-2022 Gordon Bergling <gbe@FreeBSD.org>

pci(4): Fix a typo in asource code comment

- s/overriden/overridden/

MFC after: 3 days


# 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 ...


# c84c5e00 18-Jul-2022 Mitchell Horne <mhorne@FreeBSD.org>

ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Spons

ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35583

show more ...


# 00c00c38 03-Jul-2022 Gordon Bergling <gbe@FreeBSD.org>

pci(4): Fix a common typo in source code comments

- s/transistions/transitions/

MFC after: 3 days


Revision tags: release/13.1.0
# 97a41013 07-May-2022 John Baldwin <jhb@FreeBSD.org>

pci: Remove unused devclass arguments to DRIVER_MODULE.


12345678910>>...47