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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 63832C43381 for ; Mon, 4 Jan 2021 13:22:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41DAC207B1 for ; Mon, 4 Jan 2021 13:22:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbhADNWe (ORCPT ); Mon, 4 Jan 2021 08:22:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34292 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726670AbhADNWd (ORCPT ); Mon, 4 Jan 2021 08:22:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609766466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vPrbs+ygK2nW6UXpFCX2PTOIhaEcotjknLDYayf1rbg=; b=RR+t52c/ES0bgXN62OrfOtjjhLmMeMkufS98DPBRXA5g9l+rBb+QiyOfyxQisqKx0uxmtQ 3VlvqXta2VBHyOSRCx6Isg5nMZsQ1u9/kJd3iXt6wmy+5nDWPVqfg4u9pib2EHkMPXVNGv mUDSiKXc81BwnOfOlZ57btbEyfCu4z0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-317-skHsRw5jOvqfXn9Kyt7T3A-1; Mon, 04 Jan 2021 08:21:04 -0500 X-MC-Unique: skHsRw5jOvqfXn9Kyt7T3A-1 Received: by mail-wm1-f69.google.com with SMTP id s130so10590290wme.0 for ; Mon, 04 Jan 2021 05:21:04 -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=vPrbs+ygK2nW6UXpFCX2PTOIhaEcotjknLDYayf1rbg=; b=CPiTmON7VChO/DPxj0o0YHXDMQ7J8IyzrNs9GRJWGbOq3pO/kGkapU3qTMPkiWUPs6 JHjVul7aGG8si8cDOTrxMvODNqRGqnFafy/ff/IjyOq4wjpJpwVLPYf7gGtFZlZSL+9U l41MTnfyDzDSDAhKPNo8n+o1Ua/NWU/PvVMMNAfZFMG4HqOTSmWdAlNhWplTw6ddQPgF Q+Pf4O7yVWHnuOz43ykgwR+kOBhQpddhbqdGgEoUqGc3DXivEUEdX/st9BsHMz8yYwQI EQ2tYfBUWcgfDmUhSk8Q2I1S/PzEa8LAzbSmKw6+POZZaURRoSI5hATXl45D13i92I6k RaCQ== X-Gm-Message-State: AOAM533UfaKtV/3Ig16WIklsRDS6W38bM1hAD8Fyg36Vyh23l9A+giPR HaCqC0KkPsnJ3K5uevcPZCI1Iru17H72RxFthtGZVsfyuo7CocKmZB9zQSwAOfIA7kxIIxUx5JR bfPlhox+/1q7ElLIsLQPf2x4n5nrvS8uK9LksQsgM X-Received: by 2002:adf:e452:: with SMTP id t18mr76929197wrm.177.1609766463247; Mon, 04 Jan 2021 05:21:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyejyAsfaLxHqjg5lrewtBBFczMjR6pbLPXoTYYnr8a8cMlhhVl17ylXysIJXWiOsLQQV2XV28iok3dOsd31w= X-Received: by 2002:adf:e452:: with SMTP id t18mr76929177wrm.177.1609766463058; Mon, 04 Jan 2021 05:21:03 -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: Karol Herbst Date: Mon, 4 Jan 2021 14:20:52 +0100 Message-ID: Subject: Re: [Nouveau] [PATCH v2] ALSA: hda: Continue to probe when codec probe fails To: Kai-Heng Feng Cc: Ilia Mirkin , "moderated list:SOUND" , Kai Vehmanen , Takashi Iwai , nouveau , tiwai@suse.com, open list , Pierre-Louis Bossart , Alex Deucher , Alan Stern , Linux PCI , Bjorn Helgaas , Jaroslav Kysela , Mike Rapoport Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 22, 2020 at 3:50 AM Kai-Heng Feng wrote: > > 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. > it might be that the code to enable the sub function is a bit broken :/ but it should work. Maybe the quirk_nvidia_hda function needs to be called on more occasions? No idea. > 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 > _______________________________________________ > Nouveau mailing list > Nouveau@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau > 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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 53357C433DB for ; Mon, 4 Jan 2021 13:22:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7C2802072D for ; Mon, 4 Jan 2021 13:22:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C2802072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C38171679; Mon, 4 Jan 2021 14:21:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C38171679 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1609766530; bh=VBJx6d0XXtsqidybrhudWNcpFp1DlkerENqMPkzNI0M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ZN9B3CJ3gkV3pEW/FhwOLPZTO3pmW4g8MUXDH+iujfMZq688cYgD2Etn2PcA5db/8 SyVa+HsRn7qoO0dX0sG3x5bkjAcK4q6fOpFB7yIb/txDeqAOkPom8y7EjMEefUbWgv AMeO3dYzUomDZUQhfZBIko5iqlxc/GdC0QMNnABU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5B2F7F8012C; Mon, 4 Jan 2021 14:21:20 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3EA15F80166; Mon, 4 Jan 2021 14:21:16 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DEBF5F80158 for ; Mon, 4 Jan 2021 14:21:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DEBF5F80158 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RR+t52c/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609766466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vPrbs+ygK2nW6UXpFCX2PTOIhaEcotjknLDYayf1rbg=; b=RR+t52c/ES0bgXN62OrfOtjjhLmMeMkufS98DPBRXA5g9l+rBb+QiyOfyxQisqKx0uxmtQ 3VlvqXta2VBHyOSRCx6Isg5nMZsQ1u9/kJd3iXt6wmy+5nDWPVqfg4u9pib2EHkMPXVNGv mUDSiKXc81BwnOfOlZ57btbEyfCu4z0= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-ypL9F6GfNSauXQWcfwY5Ww-1; Mon, 04 Jan 2021 08:21:04 -0500 X-MC-Unique: ypL9F6GfNSauXQWcfwY5Ww-1 Received: by mail-wr1-f70.google.com with SMTP id u29so13315296wru.6 for ; Mon, 04 Jan 2021 05:21:04 -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=vPrbs+ygK2nW6UXpFCX2PTOIhaEcotjknLDYayf1rbg=; b=rmAJ8x8WH3/SOnTzdWMVToq5aUvS/rF9aIT0CF0uUcPD5bhxUOlGaTxKM/3IU+lJZZ Ug+LFj7JO7LvwzKdiKRdHbxodVdi4K+bpy1amo8tHCjepdJ141VrUq2AlBR5dE1ynbEX yqWqf+cjj46Smph+GE93TnsvuKDkewfTFYCNTD2fIY56wmR5zRhTu9Pulicde6R/ycZa axReoYUXJJ4onRHQ2mdZOqQH8yzxYb2A7TG50WhK6je0Ul3Wwk7S26R2V7mETTGkhjP4 68JKkkckeUYXBL4odKNB9ocCfj4F/f2OGho+SuS6HCKKTH3x2Ywdp/pqATbZwhbLj2Lu QWVQ== X-Gm-Message-State: AOAM530BZGlZ/A08QsK6SXDJrq4z394vuUQGLTElWKTXTgM15gnWXtB5 ujMBof8GKJRX90zF2I6LqK6B2OyqHh9kqfXAmJ4ttVQjLvb1QULID+DvXfo5bByj8Wk8E1IiMkF AkbBENNB5sBCBmGSv+obHWe3YwmlSO3xteDYl/as= X-Received: by 2002:adf:e452:: with SMTP id t18mr76929210wrm.177.1609766463252; Mon, 04 Jan 2021 05:21:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyejyAsfaLxHqjg5lrewtBBFczMjR6pbLPXoTYYnr8a8cMlhhVl17ylXysIJXWiOsLQQV2XV28iok3dOsd31w= X-Received: by 2002:adf:e452:: with SMTP id t18mr76929177wrm.177.1609766463058; Mon, 04 Jan 2021 05:21:03 -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: Karol Herbst Date: Mon, 4 Jan 2021 14:20:52 +0100 Message-ID: Subject: Re: [Nouveau] [PATCH v2] ALSA: hda: Continue to probe when codec probe fails To: Kai-Heng Feng Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kherbst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Cc: Pierre-Louis Bossart , "moderated list:SOUND" , Kai Vehmanen , Takashi Iwai , nouveau , tiwai@suse.com, open list , Bjorn Helgaas , Alan Stern , Mike Rapoport , Linux PCI , Alex Deucher , Ilia Mirkin X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Tue, Dec 22, 2020 at 3:50 AM Kai-Heng Feng wrote: > > 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. > it might be that the code to enable the sub function is a bit broken :/ but it should work. Maybe the quirk_nvidia_hda function needs to be called on more occasions? No idea. > 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 > _______________________________________________ > Nouveau mailing list > Nouveau@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karol Herbst Subject: Re: [PATCH v2] ALSA: hda: Continue to probe when codec probe fails Date: Mon, 4 Jan 2021 14:20:52 +0100 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: Kai-Heng Feng Cc: Pierre-Louis Bossart , "moderated list:SOUND" , Kai Vehmanen , Takashi Iwai , nouveau , tiwai-IBi9RG/b67k@public.gmane.org, open list , Bjorn Helgaas , Alan Stern , Mike Rapoport , Linux PCI , Alex Deucher , Jaroslav Kysela List-Id: nouveau.vger.kernel.org On Tue, Dec 22, 2020 at 3:50 AM Kai-Heng Feng wrote: > > 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. > it might be that the code to enable the sub function is a bit broken :/ but it should work. Maybe the quirk_nvidia_hda function needs to be called on more occasions? No idea. > 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 > _______________________________________________ > Nouveau mailing list > Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > https://lists.freedesktop.org/mailman/listinfo/nouveau >