Page MenuHomeFreeBSD

linuxkpi: Add pci_iomap and pci_iounmap
ClosedPublic

Authored by manu on May 5 2020, 10:41 AM.
Tags
None
Referenced Files
F102933657: D24696.id.diff
Mon, Nov 18, 10:37 PM
Unknown Object (File)
Oct 7 2024, 6:51 PM
Unknown Object (File)
Oct 4 2024, 8:53 PM
Unknown Object (File)
Oct 4 2024, 8:48 AM
Unknown Object (File)
Sep 29 2024, 4:06 AM
Unknown Object (File)
Sep 23 2024, 3:16 PM
Unknown Object (File)
Sep 21 2024, 3:14 AM
Unknown Object (File)
Sep 5 2024, 8:45 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.