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)
Fri, Apr 26, 2:46 AM
Unknown Object (File)
Thu, Apr 25, 7:16 AM
Unknown Object (File)
Mon, Apr 22, 5:21 AM
Unknown Object (File)
Sun, Apr 21, 5:12 PM
Unknown Object (File)
Sun, Apr 14, 4:17 PM
Unknown Object (File)
Sun, Apr 14, 6:27 AM
Unknown Object (File)
Apr 5 2024, 9:22 AM
Unknown Object (File)
Feb 23 2024, 2:52 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.