Page MenuHomeFreeBSD

LinuxKPI: return an address string in pci_name
ClosedPublic

Authored by val_packett.cool on Feb 11 2022, 2:18 PM.
Referenced Files
Unknown Object (File)
Sun, Sep 10, 4:02 AM
Unknown Object (File)
Fri, Sep 8, 9:25 PM
Unknown Object (File)
Sat, Aug 26, 11:03 AM
Unknown Object (File)
Sat, Aug 26, 11:00 AM
Unknown Object (File)
Sat, Aug 26, 10:59 AM
Unknown Object (File)
Sat, Aug 26, 10:58 AM
Unknown Object (File)
Aug 15 2023, 10:45 PM
Unknown Object (File)
Aug 15 2023, 3:22 AM

Details

Summary

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: https://github.com/freebsd/drm-kmod/issues/134
Sponsored by: https://www.patreon.com/valpackett

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

contrib/zlib-ng
1 ↗(On Diff #102657)

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

sys/compat/linuxkpi/common/src/linux_pci.c
311

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

Looks good.

sys/compat/linuxkpi/common/src/linux_pci.c
310

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).

sys/compat/linuxkpi/common/include/linux/pci.h
264

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 ?

sys/compat/linuxkpi/common/src/linux_pci.c
280

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?

sys/compat/linuxkpi/common/src/linux_pci.c
280

Static sounds better, sure.

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

--HPS

sys/compat/linuxkpi/common/src/linux_pci.c
280

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.