Page MenuHomeFreeBSD

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

Authored by jhb on Mar 4 2024, 10:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jul 4, 7:36 AM
Unknown Object (File)
Jun 3 2024, 4:13 AM
Unknown Object (File)
Jun 2 2024, 10:29 PM
Unknown Object (File)
May 22 2024, 1:42 AM
Unknown Object (File)
May 22 2024, 1:32 AM
Unknown Object (File)
May 19 2024, 5:22 AM
Unknown Object (File)
May 10 2024, 9:09 PM
Unknown Object (File)
May 7 2024, 3:12 AM
Subscribers

Details

Summary

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. This is
arguably a cleaner solution than having simplebus rewrite
SYS_RES_MEMORY to SYS_RES_IOPORT.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56428
Build 53316: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Mar 4 2024, 10:44 PM

What about all the other PCI controller drivers though? Various use ofw_pcib, for example.

ofw_pcib doesn't pass child resources up to simplebus for allocation or activation, it uses bus_space_map directly with a new-bus method to get the bus_space_tag. I think this might be the only one passing SYS_RES_IOPORT up to simplebus and that if this works we might be able to remove all SYS_RES_IOPORT support from simplebus.

In D44207#1009367, @jhb wrote:

ofw_pcib doesn't pass child resources up to simplebus for allocation or activation, it uses bus_space_map directly with a new-bus method to get the bus_space_tag. I think this might be the only one passing SYS_RES_IOPORT up to simplebus and that if this works we might be able to remove all SYS_RES_IOPORT support from simplebus.

Should ofw_pcib not be doing it this way too then?

In D44207#1009367, @jhb wrote:

ofw_pcib doesn't pass child resources up to simplebus for allocation or activation, it uses bus_space_map directly with a new-bus method to get the bus_space_tag. I think this might be the only one passing SYS_RES_IOPORT up to simplebus and that if this works we might be able to remove all SYS_RES_IOPORT support from simplebus.

Should ofw_pcib not be doing it this way too then?

I have thought about changing ofw_pcib, but to be clear, ofw_pcib is not passing SYS_RES_IOPORT resources up to its parent bus driver currently.