From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FFD7C433DB for ; Mon, 21 Dec 2020 17:57:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B29A22B51 for ; Mon, 21 Dec 2020 17:57:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725818AbgLUR5b (ORCPT ); Mon, 21 Dec 2020 12:57:31 -0500 Received: from mail-ua1-f50.google.com ([209.85.222.50]:35414 "EHLO mail-ua1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbgLUR5a (ORCPT ); Mon, 21 Dec 2020 12:57:30 -0500 Received: by mail-ua1-f50.google.com with SMTP id y21so3567688uag.2; Mon, 21 Dec 2020 09:57:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MrAF3XcfgmbCY17OqyOzfLrhkI98KCYJDR2DMtLfdY8=; b=FARL21fepaGwlqbh/znW1t6ArcgYhrw+vNSqHVaHhhpo12JPUl6ZgqPMfJovTSkS1V YRZweEnvWbfysQwqaJaBhUsQEruNg/YIqjIhXc3ko4T+y0czYl5jzOJ0hfQuExluwubW ncZ6DYd09EWUET9T3FIkl/QhY4G0cYZFKyskfQSkx89JirSj9SgbDXzbVqai1OrdbHN5 Xe2JVYjhVNrUsL9I/dfxDq+notIe/d88ifeo8V9/PS0lryRGl0WG2+36t7UI37NJBTcd K2fNFt9wjRTM0c5zBAlOhUOeVofj1wiW0PBJy/pHaYbyYuJcAPmiScGJYqU7t13G7+He dk6g== X-Gm-Message-State: AOAM532NMv9GRv9x+BOjE8Qe3nBdYdq2SRZDOfTRFTP2h2hHfY6lv4TU 1KxGhCON57ztne31MZvtGgHg0WxijSaBHElZADc= X-Google-Smtp-Source: ABdhPJzVdL7B8bTZxy+rQMk6er8L4T5ie68H4w9L1UEygB7FM35lOkrdx7hEzcfKNr2eDQb6J0Pb9eQgDYeA07DY5rA= X-Received: by 2002:ab0:1e4a:: with SMTP id n10mr13442742uak.98.1608573409390; Mon, 21 Dec 2020 09:56:49 -0800 (PST) MIME-Version: 1.0 References: <20201214060621.1102931-1-kai.heng.feng@canonical.com> <20201216124726.2842197-1-kai.heng.feng@canonical.com> In-Reply-To: From: Ilia Mirkin Date: Mon, 21 Dec 2020 12:56:38 -0500 Message-ID: Subject: Re: [Nouveau] [PATCH v2] ALSA: hda: Continue to probe when codec probe fails To: Kai-Heng Feng Cc: Takashi Iwai , "moderated list:SOUND" , Kai Vehmanen , nouveau , open list , Pierre-Louis Bossart , tiwai@suse.com, Bjorn Helgaas , Alan Stern , Linux PCI , Alex Deucher , Jaroslav Kysela , Mike Rapoport Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/quirks.c?h=v5.10#n5267 Cheers, -ilia