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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0BC0BC636D6 for ; Thu, 16 Feb 2023 13:30:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5AD57E77; Thu, 16 Feb 2023 14:30:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5AD57E77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1676554254; bh=PIEfek2XSyFXiT78fsCeDpKQSF3oRPrbKj4TXKb2tBI=; h=From:To:Subject:Date:CC:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=ONT+CvAvV1AJ/C8COcUOAStSOOfJS16YdyamrMzL02qVWV2zcqUbWmmX7oV28kXm0 8eygAAXfdzKmtCL4o9w1ZEVsSV5G3W3mZqz9gFocD7BY+XTQfCI69+F9QG11FBK9Hz VSeNq8+5dFTImZQmxp+SjzJFVzxY5q5f367YHmg4= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 29CB9F80171; Thu, 16 Feb 2023 14:29:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8600DF801C0; Thu, 16 Feb 2023 11:36:57 +0100 (CET) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 913F8F80083 for ; Thu, 16 Feb 2023 11:36:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 913F8F80083 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lgF0FfKx Received: by mail-pj1-x102c.google.com with SMTP id d13-20020a17090ad3cd00b0023127b2d602so1714478pjw.2 for ; Thu, 16 Feb 2023 02:36:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dehvFsN/oQxRP7kvlw0fqQwAKQjez3uQqjF/59ORbl4=; b=lgF0FfKxqho3//7JsLS7WJ3E3Sqd+i836bjeXgjdRRssOE0dlvKQtmAPiMq+hsbLRP axK6NE+ewD1NxTLIW/nja3vxOSozERFr81HeoFAtXYfu83p+0jsykr5p54QoxEu9fC9G QPn3AcrwH50yV1JiOlZUWye7jz9zM6aZ6fZDaWrYUTzrr/UdMM+EpdHY2DmHo+o8Ncg/ rUot3Y1947U5t4YNXABclbQwUhKrBn135xDvUgNm2l0aC34Bmhj803InqDHaIPrFlB+0 gj7k1Fx9e1KqFujM/ETYgmPHjvhden7FLp8tDqMQgEKCXDbpFatKNI1TeSs611kHZWKI uziA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dehvFsN/oQxRP7kvlw0fqQwAKQjez3uQqjF/59ORbl4=; b=ut7nFaCGIOuoPLXhw2og6eXbh3n89qpVbaOQUw5q4qZT6/uaNF682jrMIGnVyfWwfh DN3gj1yt4h7NV3MSUuQ7p1Z4MMUpzc/PioOM4ULSHApV2BzsHtUz9orrnAIoSKIsOHD4 pgmMKFMGFEPGhjreOGrsB6ZG0kWpHJf4w1Y8PI6VPz6Y9C82yP3cX8W4Z8UoNagPB1Zj 98XBSF2CcVojCZk3EeUVOj1pweH0Wsg98xYcK/AxPr2wL5KNjAm1+2d9jrhr41NfTtjZ ewV+75TuwZ8UXD8rB357wrNFFyNiSpUi2dnTUB/DDFEeq78S5BHtdEe0sfk3lRBnGgiD dZXA== X-Gm-Message-State: AO0yUKWbf0Msy4DaRMQ9e5zQV9k47XQtEU6vSBFkKmngnCHJvHVA7Wie DQUQRCUlm7Mh+HYA9JPgzkXSnCh0uWJ/Pg== X-Google-Smtp-Source: AK7set/ngPMAQ3tYexF8aGEns4clZ+Ez4ftXZTHe9+juQLLYrTknhPH+iaIRpUR+23rWc5WyU1GXPQ== X-Received: by 2002:a05:6a20:12ca:b0:b8:66d3:30aa with SMTP id v10-20020a056a2012ca00b000b866d330aamr6208582pzg.50.1676543800805; Thu, 16 Feb 2023 02:36:40 -0800 (PST) Received: from localhost.localdomain ([202.53.32.211]) by smtp.gmail.com with ESMTPSA id x52-20020a056a000bf400b00592591d1634sm1012380pfu.97.2023.02.16.02.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 02:36:40 -0800 (PST) From: Orlando Chamberlain To: alsa-devel@alsa-project.org Subject: [PATCHv2] hda/hdmi: Register with vga_switcheroo on Dual GPU Macbooks Date: Thu, 16 Feb 2023 21:34:51 +1100 Message-Id: <20230216103450.12925-1-orlandoch.dev@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MailFrom: orlandoch.dev@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: KJIEC5QQZEX6GF64O3RTAMH5TYTOWU7L X-Message-ID-Hash: KJIEC5QQZEX6GF64O3RTAMH5TYTOWU7L X-Mailman-Approved-At: Thu, 16 Feb 2023 13:29:33 +0000 CC: Takashi Iwai , Evan Quan , Alex Deucher , linux-kernel@vger.kernel.org, Aditya Garg , Aun-Ali Zaidi , Kerem Karabay , Orlando Chamberlain X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Commit 586bc4aab878 ("ALSA: hda/hdmi - fix vgaswitcheroo detection for AMD") caused only AMD gpu's with PX to have their audio component register with vga_switcheroo. This meant that Apple Macbooks with apple-gmux as the gpu switcher no longer had the audio client registering, so when the gpu is powered off by vga_switcheroo snd_hda_intel is unaware that it should have suspended the device: amdgpu: switched off snd_hda_intel 0000:03:00.1: Unable to change power state from D3hot to D0, device inaccessible snd_hda_intel 0000:03:00.1: CORB reset timeout#2, CORBRP = 65535 To resolve this, we use apple_gmux_detect() and register a vga_switcheroo audio client when apple-gmux is detected. Fixes: 586bc4aab878 ("ALSA: hda/hdmi - fix vgaswitcheroo detection for AMD") Link: https://lore.kernel.org/all/20230210044826.9834-9-orlandoch.dev@gmail.com/ Signed-off-by: Orlando Chamberlain --- v1->v2: Use apple_gmux_detect(), split this patch out of the patch series sound/pci/hda/hda_intel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 87002670c0c9..cfd2ddfde112 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include "hda_controller.h" @@ -1463,7 +1464,7 @@ static struct pci_dev *get_bound_vga(struct pci_dev *pci) * vgaswitcheroo. */ if (((p->class >> 16) == PCI_BASE_CLASS_DISPLAY) && - atpx_present()) + (atpx_present() || apple_gmux_detect(NULL, NULL))) return p; pci_dev_put(p); } -- 2.39.1