Page MenuHomeFreeBSD

LinuxKPI: return an address string in pci_name

Authored by on Feb 11 2022, 2:18 PM.
Referenced Files
F72359999: D34248.diff
Wed, Dec 6, 11:03 AM
Unknown Object (File)
Mon, Nov 13, 3:37 PM
Unknown Object (File)
Mon, Nov 13, 9:23 AM
Unknown Object (File)
Sat, Nov 11, 2:35 PM
Unknown Object (File)
Sat, Nov 11, 3:34 AM
Unknown Object (File)
Thu, Nov 9, 11:14 AM
Unknown Object (File)
Thu, Nov 9, 3:06 AM
Unknown Object (File)
Oct 27 2023, 11:16 AM



amdgpu's virtual display feature uses pci_name to match a module parameter string, and the documentation shows an example of 0000:26:00.0 for the name.
In our case the name was just drmn, which is silly and not actually unique across devices. Let's generate the expected string.

Related to:
Sponsored by:

Diff Detail

rG FreeBSD src repository
Lint Skipped
Tests Skipped
Build Status
Buildable 49542
Build 46432: arc lint + arc unit

Event Timeline

1 ↗(On Diff #102657)

hrm, how did git-arc add this o_0 this was not in the commit


I *think* the first part is the domain but I'm not 100% sure…

Looks good.


You don't need the "\" here.

4-space indent after line wrap.

This revision is now accepted and ready to land.Feb 11 2022, 2:55 PM

I am fine with this; iwlwifi only uses the output as informational in dumping and nowhere else and none of my other drivers I was checking do use it.

I think the only thing to clarify before commit should be the MFC path (or not).


Can we add this to the end or do we need to when doing an MFC? Or is this going to be MFCable at all? x11 ?


Do we want to do the alloc game here or should we just use a static buffer? Because if alloc can fail, then we could still return device_get_desc() above in case path_name is NULL?


Static sounds better, sure.

I think GFP_KERNEL doesn't fail, see the definition.
GFP_ATOMIC can fail.



Based on hps' feedback, I'd say leave it.

Fix format (more %02d), move the new field to the end of the struct

This revision now requires review to proceed.Feb 11 2022, 3:34 PM
This revision is now accepted and ready to land.Feb 11 2022, 3:35 PM
This revision now requires review to proceed.Feb 5 2023, 9:07 PM

I'll take it and commit it given all other consumers but the one amdgpu one seem to be in my wireless driver tree.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 6 2023, 9:58 PM
This revision was automatically updated to reflect the committed changes.