History log of /freebsd/sys/dev/pci/pci_host_generic.c (Results 1 – 25 of 93)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# c19f1ad1 21-Jan-2025 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Use SYS_RES_MEMORY for the parent of I/O resource ranges

When a SYS_RES_IOPORT resource crosses a pci_host_generic bridge, it
is translated into a memory access for an associated r

pci_host_generic: Use SYS_RES_MEMORY for the parent of I/O resource ranges

When a SYS_RES_IOPORT resource crosses a pci_host_generic bridge, it
is translated into a memory access for an associated range, so use
SYS_RES_MEMORY for the resource allocated from the parent.

Tested by: markj
Differential Revision: https://reviews.freebsd.org/D44207

show more ...


# b3132299 29-Dec-2024 Kyle Evans <kevans@FreeBSD.org>

pci: avoid accidental clobbering of regs on some fdt platforms

Most pci controllers will just have a single reg for the config space,
but others (e.g., on Apple Silicon) may have more following that

pci: avoid accidental clobbering of regs on some fdt platforms

Most pci controllers will just have a single reg for the config space,
but others (e.g., on Apple Silicon) may have more following that to
describe, e.g., controller port space. Bump the "ranges" rid space up
to avoid overriding these other memory resources.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D43921

show more ...


# 7cafe75c 12-Dec-2024 Andrew Turner <andrew@FreeBSD.org>

pci: Make generic_pcie_read_ivar non static

Allow this to be called from attachments to allow more ivars to be
implemented.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://rev

pci: Make generic_pcie_read_ivar non static

Allow this to be called from attachments to allow more ivars to be
implemented.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48046

show more ...


# fafb43ab 12-Dec-2024 Andrew Turner <andrew@FreeBSD.org>

pci: Use a switch statement when reading ivars

In pci_host_generic.c use a switch statement rather than a series
of if statements.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: http

pci: Use a switch statement when reading ivars

In pci_host_generic.c use a switch statement rather than a series
of if statements.

Reviewed by: imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D48045

show more ...


Revision tags: release/14.2.0, release/13.4.0
# 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 ...


# 637ee139 05-Jun-2024 Enji Cooper <ngie@FreeBSD.org>

pci(4): unbreak the build

`argsp` is not defined in `generic_pcie_unmap_resource(..)`. Remove the
parameter passed to `bus_generic_unmap_resource(..)` as this parameter
is never passed to `generic_p

pci(4): unbreak the build

`argsp` is not defined in `generic_pcie_unmap_resource(..)`. Remove the
parameter passed to `bus_generic_unmap_resource(..)` as this parameter
is never passed to `generic_pcie_unmap_resource(..)`.

Fixes: 98056127ddfa ("acpi/pci/vmd: Fix a nit with nested resource mapping requests")
Reported by: Jenkins (aarch64, armv6, armv7, etc)
Differential Revision: https://reviews.freebsd.org/D45493

show more ...


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

acpi/pci/vmd: Fix a nit with nested resource mapping requests

Some bus drivers use rmans to suballocate resources to child devices.
When the driver for a child device requests a mapping for a
suball

acpi/pci/vmd: Fix a nit with nested resource mapping requests

Some bus drivers use rmans to suballocate resources to child devices.
When the driver for a child device requests a mapping for a
suballocated resource, the bus driver translates this into a mapping
request for a suitable subrange of the original resource the bus
driver allocated from its parent. This nested mapping request should
look like any other resource mapping request being made by the bus
device (i.e. as if the bus device had called bus_map_resource() or
bus_alloc_resource() with RF_ACTIVE).

I had slightly flubbed this last bit though since the direct use of
bus_generic_map/unmap_resource passed up the original child device
(second argument to the underlying kobj interface). While this is
currently harmless, it is not strictly correct as the resource being
mapped is owned by the bus device, not the child and can break for
other bus drivers in the future.

Instead, use bus_map/unmap_resource for the nested request where the
requesting device is now the bus device that owns the parent resource.

Reviewed by: imp
Fixes: 0e1246e33461 acpi: Cleanup handling of suballocated resources
Fixes: b377ff8110e3 pcib: Refine handling of resources allocated from bridge windows
Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation
Fixes: d714e73f7895 vmd: Use bus_generic_rman_* for PCI bus and memory resources
Differential Revision: https://reviews.freebsd.org/D45433

show more ...


Revision tags: release/14.1.0
# 03713f80 09-Apr-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Tolerate range resource allocation failures

QEMU for armv7 includes a PCI memory range whose CPU address is
greater than 4GB. This falls outside the range of armv7's global
mem_rm

pci_host_generic: Tolerate range resource allocation failures

QEMU for armv7 includes a PCI memory range whose CPU address is
greater than 4GB. This falls outside the range of armv7's global
mem_rman used by the nexus driver. As a result, pcib0 fails to
attach blocking all PCI devices.

Instead, change the driver to be a bit more tolerant. If allocating a
resource for a range fails, don't fail attaching the entire driver,
but do skip adding the associated PCI range to the relevant rman in
the pcib driver. This will prevent child devices from using BARs that
allocate from this range. In the case of QEMU on armv7 devices can
still allocate from an earlier PCI memory range that is within the
32-bit address space (and in fact none of the firmware-assigned memory
BARs use addresses from the upper range).

While here, reorder the operations on I/O ranges a bit: 1) print the
range under bootverbose first (rather than last) so that the range is
printed before any relevant errors for the range, 2) move
rman_manage_region last after the parent resource has been set and
allocated.

Reported by: markj, Jenkins
Reviewed by: markj
Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation
Differential Revision: https://reviews.freebsd.org/D44698

show more ...


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


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

new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCE

The public bus_map/unmap_resource() API still accepts both forms, but
the internal kobj methods no longer pass the argument.
Implement

new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCE

The public bus_map/unmap_resource() API still accepts both forms, but
the internal kobj methods no longer pass the argument.
Implementations which need the type now use rman_get_type() to fetch
the value from the allocated resource.

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

show more ...


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

new-bus: Remove the 'type' argument from BUS_ADJUST_RESOURCE

The public bus_adjust_resource() API still accepts both forms, but the
internal kobj method no longer passes the argument. Implementatio

new-bus: Remove the 'type' argument from BUS_ADJUST_RESOURCE

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

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

show more ...


# 291079d0 05-Mar-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Simplify generic_pcie_translate_resource

Inline generic_pcie_translate_resource_common into its sole caller.
No functional change.

Reviewed by: tuexen
Differential Revision: https

pci_host_generic: Simplify generic_pcie_translate_resource

Inline generic_pcie_translate_resource_common into its sole caller.
No functional change.

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D44206

show more ...


# 332dbd3a 05-Mar-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Pass a valid end address in generic_pcie_translate_resource

The generic_pcie_containing_range helper added in commit d79b6b8ec267
assumed that the passed in (start, end) range used

pci_host_generic: Pass a valid end address in generic_pcie_translate_resource

The generic_pcie_containing_range helper added in commit d79b6b8ec267
assumed that the passed in (start, end) range used to locate the
containing mapping range was a valid address range (with end >=
start). The previous version of
generic_pcie_translate_resource_common only used the start address to
locate a mapping range, so the end address of 0 did not matter, but an
end of 0 now causes the first range to match and an incorrect
translation for resources using a later range.

PR: 277211
Reported by: dch, tuexen
Reviewed by: tuexen
Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation
Differential Revision: https://reviews.freebsd.org/D44205

show more ...


# b2867001 01-Mar-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Enumerate resource ranges under bootverbose

Previously ranges were only enumerated for the FDT attachment but not
ACPI. This commit moves the enumeration to the shared attach rout

pci_host_generic: Enumerate resource ranges under bootverbose

Previously ranges were only enumerated for the FDT attachment but not
ACPI. This commit moves the enumeration to the shared attach routine
so it is done for both. While here, don't list empty ranges but do
include the resource type for each range.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D44132

show more ...


Revision tags: release/13.3.0
# 66d37dbe 16-Feb-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Fix build without PCI_RES_BUS

Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation


# feefc3c7 16-Feb-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Properly handle bus_release_resource of IRQ resources

Unlike other bus methods updated to use bus_generic_rman_* in commit
d79b6b8ec267, the bus_release_resource method was using
b

pci_host_generic: Properly handle bus_release_resource of IRQ resources

Unlike other bus methods updated to use bus_generic_rman_* in commit
d79b6b8ec267, the bus_release_resource method was using
bus_generic_rman_release_resource for all types other than
PCI_RES_BUS. Instead, bus_generic_rman_* should only be used for
memory and I/O port resources for this driver.

Tested by: cperciva
Reviewed by: cperciva
Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation
Differential Revision: https://reviews.freebsd.org/D43925

show more ...


# 992f5b16 16-Feb-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Set a valid error if allocating a range resource fails

Previously pci_host_generic_attach was returning 0 (success)
incorrectly if allocating a range failed. The error value was 0

pci_host_generic: Set a valid error if allocating a range resource fails

Previously pci_host_generic_attach was returning 0 (success)
incorrectly if allocating a range failed. The error value was 0 from
the previously successful call to bus_set_resource in this case.

Fixes: d79b6b8ec267 pci_host_generic: Don't rewrite resource start address for translation

show more ...


# d79b6b8e 14-Feb-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Don't rewrite resource start address for translation

Allocate resources from the parent device for decoded physical address
ranges. When child resources suballocated from rman's a

pci_host_generic: Don't rewrite resource start address for translation

Allocate resources from the parent device for decoded physical address
ranges. When child resources suballocated from rman's are mapped,
translate those mapping requests into a mapping request of the
associated physical address range in a bus_map_resource method.

While here, convert generic_pcie_rman to a bus_get_rman method and use
bus_generic_rman_* for operations on child resources.

Factor out a generic_pcie_containing_range to share logic between
bus_translate_resource and bus_*map_resource.

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

show more ...


# 51f8ac22 14-Feb-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Include the bridge's device name in rman descriptions

The rman description strings now match those used in the PCI-PCI
bridge driver. Using more specific names removes ambiguity i

pci_host_generic: Include the bridge's device name in rman descriptions

The rman description strings now match those used in the PCI-PCI
bridge driver. Using more specific names removes ambiguity in devinfo -u
output on systems with multiple host to PCI bridges.

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

show more ...


# e9eb353b 23-Jan-2024 John Baldwin <jhb@FreeBSD.org>

pci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources

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


Revision tags: release/14.0.0
# 7098f3c7 13-Oct-2023 Andrew Turner <andrew@FreeBSD.org>

pci: Set the domain in the pci_generic driver

Tell bus_dma(9) which NUMA domain the PCI driver is closest to so it
can allocate memory from there when possible.

Reviewed by: markj, jhb
Sponsored by

pci: Set the domain in the pci_generic driver

Tell bus_dma(9) which NUMA domain the PCI driver is closest to so it
can allocate memory from there when possible.

Reviewed by: markj, jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D42186

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

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

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


# 8bc94f25 24-Apr-2023 Andrew Turner <andrew@FreeBSD.org>

Remove redundant data from pci host generic

The bus tag and handle fields are already stored in the resource. Use
this with the bus_read/bus_write helper macros.

Sponsored by: Arm Ltd


1234