linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Plattner <aplattner@nvidia.com>
To: Roy Spliet <nouveau@spliet.org>, Lukas Wunner <lukas@wunner.de>
Cc: Karol Herbst <kherbst@redhat.com>,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	"moderated list:SOUND" <alsa-devel@alsa-project.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Takashi Iwai <tiwai@suse.de>,
	nouveau <nouveau@lists.freedesktop.org>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	<tiwai@suse.com>, Alex Deucher <alexander.deucher@amd.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Mike Rapoport <rppt@kernel.org>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jaroslav Kysela <perex@perex.cz>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [Nouveau] [PATCH v2] ALSA: hda: Continue to probe when codec probe fails
Date: Mon, 12 Apr 2021 12:06:27 -0700	[thread overview]
Message-ID: <81b2a8c7-5b0b-b8fa-fbed-f164128de7a3@nvidia.com> (raw)
In-Reply-To: <bddba2ca-15d5-7fd3-5b64-f4ba7e179ec0@spliet.org>

On 4/10/21 1:48 PM, Roy Spliet wrote:
> Op 10-04-2021 om 20:23 schreef Lukas Wunner:
>> On Sat, Apr 10, 2021 at 04:51:27PM +0100, Roy Spliet wrote:
>>> Can I ask someone with more
>>> technical knowledge of snd_hda_intel and vgaswitcheroo to brainstorm 
>>> about
>>> the possible challenges of nouveau taking matters into its own hand 
>>> rather
>>> than keeping this PCI quirk around?
>>
>> It sounds to me like the HDA is not powered if no cable is plugged in.
>> What is reponsible then for powering it up or down, firmware code on
>> the GPU or in the host's BIOS?
> 
> Sometimes the BIOS, but definitely unconditionally the PCI quirk code: 
> https://github.com/torvalds/linux/blob/master/drivers/pci/quirks.c#L5289
> 
> (CC Aaron Plattner)

My basic understanding is that the audio function stops responding 
whenever the graphics function is powered off. So the requirement here 
is that the audio driver can't try to talk to the audio function while 
the graphics function is asleep, and must trigger a graphics function 
wakeup before trying to communicate with the audio function. I think 
there are also requirements about the audio function needing to be awake 
when the graphics driver is updating the ELD, but I'm not sure.

This is harder on Windows because the audio driver lives in its own 
little world doing its own thing but on Linux we can do better.

>> Ideally, we should try to find out how to control HDA power from the
>> operating system rather than trying to cooperate with whatever firmware
>> is doing.  If we have that capability, the OS should power the HDA up
>> and down as it sees fit.

After system boot, I don't think there's any firmware involved, but I'm 
not super familiar with the low-level details and it's possible the 
situation changed since I last looked at it.

I think the problem with having nouveau write this quirk is that the 
kernel will need to re-probe the PCI device to notice that it has 
suddenly become a multi-function device with an audio function, and 
hotplug the audio driver. I originally looked into trying to do that but 
it was tricky because the PCI subsystem didn't really have a mechanism 
for a single-function device to become a multi-function device on the 
fly and it seemed easier to enable it early on during bus enumeration. 
That way the kernel sees both functions all the time without anything 
else having to be special about this configuration.

-- Aaron

>> Thanks,
>>
>> Lukas

  reply	other threads:[~2021-04-12 19:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201214060621.1102931-1-kai.heng.feng@canonical.com>
     [not found] ` <20201216124726.2842197-1-kai.heng.feng@canonical.com>
     [not found]   ` <s5h5z51oj12.wl-tiwai@suse.de>
     [not found]     ` <CAAd53p6kORC1GsW5zt+=0=J5ki43iriO-OqtFvf5W67LWhyyhA@mail.gmail.com>
     [not found]       ` <s5hzh2dn3oa.wl-tiwai@suse.de>
     [not found]         ` <CAAd53p6Ef2zFX_t3y1c6O7BmHnxYGtGSfgzXAMQSom1ainWXzg@mail.gmail.com>
     [not found]           ` <s5hsg85n2km.wl-tiwai@suse.de>
     [not found]             ` <s5hmtydn0yg.wl-tiwai@suse.de>
2020-12-18  5:09               ` [PATCH v2] ALSA: hda: Continue to probe when codec probe fails Kai-Heng Feng
2020-12-18  8:06                 ` Takashi Iwai
2020-12-21 16:33                   ` Kai-Heng Feng
2020-12-21 16:47                     ` Takashi Iwai
2020-12-21 17:15                       ` Kai-Heng Feng
2020-12-21 17:56                     ` [Nouveau] " Ilia Mirkin
2020-12-22  2:49                       ` Kai-Heng Feng
2021-01-04 13:20                         ` Karol Herbst
2021-04-10 15:51                           ` Roy Spliet
2021-04-10 19:23                             ` Lukas Wunner
2021-04-10 20:48                               ` Roy Spliet
2021-04-12 19:06                                 ` Aaron Plattner [this message]
2021-04-12 19:36                                   ` Roy Spliet
2021-04-12 20:00                                     ` Aaron Plattner
2021-04-12 20:03                                       ` Ilia Mirkin
2021-04-13  0:10                                     ` Karol Herbst
2021-04-13  8:24                                       ` Roy Spliet
2021-04-13  9:48                                         ` Karol Herbst
2021-04-13 11:17                                           ` Roy Spliet
2021-04-13 11:49                                             ` 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=81b2a8c7-5b0b-b8fa-fbed-f164128de7a3@nvidia.com \
    --to=aplattner@nvidia.com \
    --cc=alexander.deucher@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bhelgaas@google.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kherbst@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=nouveau@lists.freedesktop.org \
    --cc=nouveau@spliet.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rppt@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    /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).