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
F83156970: D44207.id135371.diff
Tue, May 7, 3:12 AM
Unknown Object (File)
Sat, May 4, 1:19 PM
Unknown Object (File)
Fri, May 3, 2:56 PM
Unknown Object (File)
Fri, Apr 26, 3:55 AM
Unknown Object (File)
Sun, Apr 14, 5:45 PM
Unknown Object (File)
Mar 15 2024, 9:08 PM
Unknown Object (File)
Mar 9 2024, 5:39 PM
Unknown Object (File)
Mar 7 2024, 10:18 PM
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.