Page MenuHomeFreeBSD

Add a pcib interface to translate the rid for MSI
AbandonedPublic

Authored by andrew on May 5 2016, 4:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 28 2024, 5:58 PM
Unknown Object (File)
Nov 21 2024, 12:16 AM
Unknown Object (File)
Nov 19 2024, 11:36 AM
Unknown Object (File)
Nov 16 2024, 9:25 PM
Unknown Object (File)
Nov 15 2024, 12:18 PM
Unknown Object (File)
Nov 3 2024, 1:01 PM
Unknown Object (File)
Nov 2 2024, 3:43 AM
Unknown Object (File)
Oct 27 2024, 1:44 PM
Subscribers

Details

Reviewers
zbb
wma
jhb
manu
Group Reviewers
manpages
Summary

This adds a pcib interface for use by interrupt controllers that
need to translate the pci rid. The translation could be based on
the 'msi-map' OFW property, a similar ACPI option, or hard-coded
for hardware lacking the above options.

Test Plan

I've booted on a pass 1.1 and 2.0 ThunderX

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3696
Build 3739: arc lint + arc unit

Event Timeline

andrew retitled this revision from to Add a pcib interface to translate the rid for MSI.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added a reviewer: jhb.
andrew added a subscriber: emaste.

Get the msi controller from the msi-parent property

The other odd thing is that pcib_get_rid() doesn't include the domain, but this does. That inconsistency is odd.

I would almost prefer fixing pcib_get_rid() so it took an enum for "rid type" (and fixing it to return errno while at it).

sys/dev/pci/pci_host_generic.c
717

In general this file seems poorly named. It doesn't seem very "generic" at all but is very OFW specific. It seems like it belongs in sys/dev/ofw?

sys/dev/pci/pci_pci.c
2559

Note that if a device doesn't implement a KOBJ method, the default function chosen (kobj_error_method) returns ENXIO (6). If you are adding a new method for which there is not a default implementation, it's a good idea for its API to return an errno value instead of a direct value to avoid nasty surprises in the future when ENXIO gets interpreted as a valid value.

*sigh* It seems that pcib_get_rid() already implemented this mistake which is unfortunate.

Except the nit with ENXIO, everything else looks fine. I like this change.

sys/dev/pci/pci_host_generic.c
717

I'm planning to split this file to generic and OFW parts (like it was done in ThunderX driver after this file was originally copied from there), once we finish integration of other amrv8/PCIe stuff.

sys/dev/ofw/ofw_bus_subr.c
413–414

This should be OF_getencprop

andrew edited edge metadata.

Update to be base on D6239

wma edited edge metadata.

Just tested on ThunderX and works well both for internat and external PCIe.

This revision is now accepted and ready to land.May 12 2016, 6:12 AM