From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kai-Heng Feng Subject: Re: [PATCH v2] ALSA: hda: Continue to probe when codec probe fails Date: Tue, 22 Dec 2020 10:49:53 +0800 Message-ID: References: <20201214060621.1102931-1-kai.heng.feng@canonical.com> <20201216124726.2842197-1-kai.heng.feng@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: Ilia Mirkin Cc: "moderated list:SOUND" , Kai Vehmanen , Takashi Iwai , nouveau , tiwai-IBi9RG/b67k@public.gmane.org, open list , Pierre-Louis Bossart , Alex Deucher , Alan Stern , Linux PCI , Bjorn Helgaas , Jaroslav Kysela , Mike Rapoport List-Id: nouveau.vger.kernel.org On Tue, Dec 22, 2020 at 1:56 AM Ilia Mirkin wrote: > > On Mon, Dec 21, 2020 at 11:33 AM Kai-Heng Feng > wrote: > > > > [+Cc nouveau] > > > > On Fri, Dec 18, 2020 at 4:06 PM Takashi Iwai wrote: > > [snip] > > > > Quite possibly the system doesn't power up HDA controller when there's > > > > no external monitor. > > > > So when it's connected to external monitor, it's still needed for HDMI audio. > > > > Let me ask the user to confirm this. > > > > > > Yeah, it's the basic question whether the HD-audio is supposed to work > > > on this machine at all. If yes, the current approach we take makes > > > less sense - instead we should rather make the HD-audio controller > > > working. > > > > Yea, confirmed that the Nvidia HDA works when HDMI is connected prior boot. > > > > > > > - The second problem is that pci_enable_device() ignores the error > > > > > returned from pci_set_power_state() if it's -EIO. And the > > > > > inaccessible access error returns -EIO, although it's rather a fatal > > > > > problem. So the driver believes as the PCI device gets enabled > > > > > properly. > > > > > > > > This was introduced in 2005, by Alan's 11f3859b1e85 ("[PATCH] PCI: Fix > > > > regression in pci_enable_device_bars") to fix UHCI controller. > > > > > > > > > > > > > > - The third problem is that HD-audio driver blindly believes the > > > > > codec_mask read from the register even if it's a read failure as I > > > > > already showed. > > > > > > > > This approach has least regression risk. > > > > > > Yes, but it assumes that HD-audio is really non-existent. > > > > I really don't know any good approach to address this. > > On Windows, HDA PCI is "hidden" until HDMI cable is plugged, then the > > driver will flag the magic bit to make HDA audio appear on the PCI > > bus. > > IIRC the current approach is to make nouveau and device link work. > > I don't have the full context of this discussion, but the kernel > force-enables the HDA subfunction nowadays, irrespective of nouveau or > nvidia or whatever: That's the problem. The nvidia HDA controller on the affected system only gets its power after HDMI cable plugged, so the probe on boot fails. Kai-Heng > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/quirks.c?h=v5.10#n5267 > > Cheers, > > -ilia