Dynamically adding a PCI subfunction

Ilia Mirkin imirkin at alum.mit.edu
Mon Oct 9 14:41:38 UTC 2017


Hello,

As a bit of background, all NVIDIA GPUs since GT215 have an audio
subfunction for HDMI(/DP) audio to be sent to the sink. This generally
works.

However some, especially laptop, devices come up with that function
disabled. We have a quirk to enable it when coming back from runpm,
but that doesn't help the init case. Basically we have to write a bit
to the PCI config space:

https://github.com/torvalds/linux/blob/v4.12/drivers/gpu/drm/nouveau/nouveau_drm.c#L783

(MMIO 0x88000 is an alias for the PCI config space)

This works for runtime pm resume, since the device was originally
there and we just have to make sure the underlying device agrees with
it, but when it's missing on boot, we have to convince linux that it
exists, bind a driver, etc.

What's the best way of going about doing that?

Thanks,

  -ilia


More information about the dri-devel mailing list