Page MenuHomeFreeBSD

LinuxKPI: pci: implement [linuxkpi_]pcim_request_all_regions()
ClosedPublic

Authored by bz on Aug 21 2025, 8:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 26, 3:47 AM
Unknown Object (File)
Wed, Sep 24, 3:03 PM
Unknown Object (File)
Sat, Sep 20, 1:06 AM
Unknown Object (File)
Wed, Sep 17, 10:57 PM
Unknown Object (File)
Wed, Sep 17, 10:57 PM
Unknown Object (File)
Wed, Sep 17, 9:48 PM
Unknown Object (File)
Wed, Sep 17, 9:36 PM
Unknown Object (File)
Wed, Sep 17, 11:00 AM

Details

Summary

Factor out the pci_request_region() implementation into an internal
function and make pci_request_region() a simple wrapperaround it.
Likewise implement pcim_request_all_regions() as a loop calling
pci_request_region() for each entry.

In two cases which we returned an error before (bar index is valid but
bar is not (no len), and neither IO nor MEM) we now reutrn success
(nothing to do for us). Otherwise callers, especially
pcim_request_all_regions() would error out for the wrong reasons.
This seems to also match the expected behaviour of pci_request_region().

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 66824
Build 63707: arc lint + arc unit

Event Timeline

bz requested review of this revision.Aug 21 2025, 8:59 AM
dumbbell requested changes to this revision.Wed, Sep 3, 8:31 PM
dumbbell added a subscriber: dumbbell.
dumbbell added inline comments.
sys/compat/linuxkpi/common/src/linux_pci.c
1139

Typo in "automatiaclly".

1142

Typo in "rack"?

1164

Should you take this opportunity to add a linuxkpi_ prefix to the function name?

This revision now requires changes to proceed.Wed, Sep 3, 8:31 PM
bz marked 3 inline comments as done.Wed, Sep 3, 10:11 PM

Fix typos
Add linuxkpI_ prefix to function

I spotted another typo (see the attached comment). I approve it at the same time to not waste time in back and forth comments.

sys/compat/linuxkpi/common/src/linux_pci.c
1139

Oops, another typo I notice just now…

This revision is now accepted and ready to land.Thu, Sep 4, 4:15 PM
bz marked an inline comment as done.Thu, Sep 4, 8:05 PM
bz added inline comments.
sys/compat/linuxkpi/common/src/linux_pci.c
1139

Yepp and that was there before. Fixes as well. Thank you!

bz marked an inline comment as done.

Juts pushing it, as it is easier for the final build to have them all togetehr

This revision now requires review to proceed.Thu, Sep 4, 8:08 PM
This revision was not accepted when it landed; it landed in state Needs Review.Fri, Sep 5, 11:29 PM
This revision was automatically updated to reflect the committed changes.