Page MenuHomeFreeBSD

linuxkpi: Add pci_iomap and pci_iounmap
ClosedPublic

Authored by manu on May 5 2020, 10:41 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.