linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Ilia Mirkin <imirkin@alum.mit.edu>,
	Linux PCI <linux-pci@vger.kernel.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Ben Skeggs <bskeggs@redhat.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: Dynamically adding a PCI subfunction
Date: Mon, 9 Oct 2017 17:45:32 +0200	[thread overview]
Message-ID: <246df1d8-cb6c-518d-7ca1-7a389ca8ef21@gmail.com> (raw)
In-Reply-To: <CAKb7UvjFYoZZCQ8p6gMx_7crUjEA0d29gCB8g7rJz4k=NPcDAA@mail.gmail.com>

Am 09.10.2017 um 16:41 schrieb Ilia Mirkin:
> 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?

Sounds similar to my work about resizing BARs.

I would just try to enable the device and then trigger a rescan of the 
BUS where it is attached (similar to echo 1 > 
/sys/bus/pci/devices/$pci_id_of_your_bus/rescan).

There is certainly a function in the PCI subsystem you just need to call 
for that.

Regards,
Christian.

>
> Thanks,
>
>    -ilia
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-10-09 15:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 14:41 Dynamically adding a PCI subfunction Ilia Mirkin
2017-10-09 15:45 ` Christian König [this message]
2017-10-09 15:57   ` Ilia Mirkin
2017-10-09 16:06     ` Christian König
2017-10-11 11:47 ` Bjorn Helgaas
2017-10-11 12:54   ` Ilia Mirkin
2017-10-11 13:46     ` Bjorn Helgaas
2017-10-11 14:18       ` Ilia Mirkin
2017-10-11 14:53         ` Karol Herbst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=246df1d8-cb6c-518d-7ca1-7a389ca8ef21@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=helgaas@kernel.org \
    --cc=imirkin@alum.mit.edu \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).