Page MenuHomeFreeBSD

linuxkpi: Add pci_iomap and pci_iounmap
ClosedPublic

Authored by manu on May 5 2020, 10:41 AM.
Tags
None
Referenced Files
F124986617: D24696.id71399.diff
Sat, Aug 2, 2:25 AM
Unknown Object (File)
Sat, Jul 19, 1:42 PM
Unknown Object (File)
Mon, Jul 7, 2:41 PM
Unknown Object (File)
Jun 25 2025, 2:13 AM
Unknown Object (File)
Jun 17 2025, 6:30 AM
Unknown Object (File)
Jun 16 2025, 5:36 AM
Unknown Object (File)
Jun 6 2025, 1:34 PM
Unknown Object (File)
Jun 6 2025, 10:59 AM

Details

Summary

Those function are use to map/unmap io region of a pci device.
Different resource can be mapped depending on the bar so use a
tailq to store them all.

Sponsored-by: The FreeBSD Foundation
Signed-off-by: Emmanuel Vadot <manu@FreeBSD.org>

Test Plan

Tested with intel drm driver
https://github.com/evadot/kms-drm/commit/657d0aa458d0d7486ed7998a47b8a618edc2031f
I'll do a patch for the 5.0 branch at FreeBSDDesktop (that will need to be cherry-picked for the 4.16 branch too).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu requested review of this revision.May 5 2020, 10:41 AM
manu created this revision.
manu added a subscriber: zeising.

Assuming the API is only used during PCI enumeration.

Don't forget to MFC!

This revision is now accepted and ready to land.May 5 2020, 11:05 AM

Please also add "LinuxKPI" somewhere in the commit message.

will need to be cherry-picked for the 4.16 branch too

And 5.1 :)

Assuming the API is only used during PCI enumeration.

Don't forget to MFC!

It's used during initialisation and teardown (so attach/detach).

Please also add "LinuxKPI" somewhere in the commit message.

Review title is the first line of the commit :)

emaste added inline comments.
sys/compat/linuxkpi/common/include/linux/pci.h
682 ↗(On Diff #71399)

For this case (only one goto fail and no fallthrough to the fail return case) it seems lines 687/688 could just be here?

700–702 ↗(On Diff #71399)

extra wrapping?

sys/compat/linuxkpi/common/include/linux/pci.h
682 ↗(On Diff #71399)

true, I'll modify that.

700–702 ↗(On Diff #71399)

that's aligned + 4 spaces, which is style(9) compliant iirc.

sys/compat/linuxkpi/common/include/linux/pci.h
700–702 ↗(On Diff #71399)

but I mean why not mmio->type, mmio->rid, mmio->res); on one line?

sys/compat/linuxkpi/common/include/linux/pci.h
700–702 ↗(On Diff #71399)

Ah, I don't know, it's pretty ? :)
I'll change that too.

This revision was automatically updated to reflect the committed changes.