Received: by 10.213.65.68 with SMTP id h4csp198414imn; Tue, 13 Mar 2018 00:57:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELswkltSuu5MCQeL8dqKI8fPGTYU/TJ01ErOpRfoCzpwqRbBv4a9dZ1YEqXL7ENCuPmrnPAS X-Received: by 10.99.64.198 with SMTP id n189mr8924141pga.191.1520927867043; Tue, 13 Mar 2018 00:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520927867; cv=none; d=google.com; s=arc-20160816; b=0N1XFmP4mZXR5EcUviEpVxwZWuaNcCLd0Bdq857mCErnJ0FoKe+Be2xI5xnWfPRwZf bS37JOYTNwKW/FFTccE78wRIDyR/T8T8qBzeCt+dJeLg/sEBQSyAEZZs2Xe64/lG+AlP 3DdS56KEWeRj6z1x82L5ICgb/H5/eTnx8Zdm8ZkQ3RKRfSMoKhEjKJ+MI/Q7lJXO2HIn ItFNYGLlQ+z9eMN/BI3R8IouJDnQViXnaeccPgvbapMIm4wd46BH9Z2Qp3ih8yjRajcc H1HA4G8VC1BLPgE9fPV75Y9qjWkzwJUEGkaSFIsNR4nTylKpd+R7RlITFleObg3GFnZq BeVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=KqnDl0uWMI4Piiw+gxLo+8bK3Wa0PyAZSJ9kj0WkpgU=; b=b5ZvZSbg+WfDy6nVGNz5YJ8J1qjKjdjHxjBNx+5+S/5g54HmXFi8VC3zc0SCWrNAks xdydriRAHFlEdra3qKw1VGJmuwKKhjihtW6NXeCtjr8Wafh6+Sj6NhgVQa1y/M2ZaQMK Q+z5EcV+TXJMMgaii1pFB1/erBhEDE8o5nikY+VDHAd60BR6+RULaUEzDbbKEQS02wef 6Z19ycCfrHf4mB/WQB3odhDZA41sWFh6kWUJuLLE9IojAs9hXd3ghnDfY+e89QYJky25 sD7IMNOrJTt0JtqjKNsW3BE0ReWskTIyvB+Wkh9qsl5c7nsMi6FyurDQ1vOTfQDLi4Xu NqWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61-v6si7302245plc.669.2018.03.13.00.57.33; Tue, 13 Mar 2018 00:57:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752220AbeCMH4U (ORCPT + 99 others); Tue, 13 Mar 2018 03:56:20 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:47717 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbeCMH4S (ORCPT ); Tue, 13 Mar 2018 03:56:18 -0400 Received: from mail-pg0-f72.google.com ([74.125.83.72]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1evenB-0002x1-7N for linux-kernel@vger.kernel.org; Tue, 13 Mar 2018 07:56:17 +0000 Received: by mail-pg0-f72.google.com with SMTP id v25so2102027pgn.20 for ; Tue, 13 Mar 2018 00:56:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=KqnDl0uWMI4Piiw+gxLo+8bK3Wa0PyAZSJ9kj0WkpgU=; b=hXmZgBmnB0afcOc1lswHSVTLjalmNCkwWm+j+Oi9p5J6hkGNgKgAw0WxX8H0X5sLYb iKcAKh6yo/4+Zvx3+2rtiC+E7Ct1dPoqKFiTlT4PGQjfo0Czge2hz1Lv3vRWSDgiuGIy jG+BMwMoKuyGQuFb0MxoGVd1+IPbw1DIkSB01DcDuWVE0q0xOaPTtQ1GFxp65dumz9Ft L/XHxbIteywknXGDlq4feg4aZJPyIIppCIHmU9n1TYwYkpD01i2a2RH0j7aAbXWuA6rE kziIDpxozw0DvalNV1OiBTOeyuk4yL0OSBO14FYQ4uyfI8eniLs5S3KLA/zWEH3ZBxGr 0Ewg== X-Gm-Message-State: AElRT7F2g275jZEk7OMXijssCTgNzhV/Y6TFOmulP63RRNwMOF0xobOo MgDlxrY+TwrAIybHoAC1YGTHJvQlDyymCjsAoXJrGisiQLEdXWQ+OFI07w5EujuZzsq8o3vBIkZ CT6Nn0Wu4XWLrKrczy34eJg+BlfB8AP9fsABHcvTRsA== X-Received: by 2002:a17:902:28e2:: with SMTP id f89-v6mr10943385plb.114.1520927775880; Tue, 13 Mar 2018 00:56:15 -0700 (PDT) X-Received: by 2002:a17:902:28e2:: with SMTP id f89-v6mr10943370plb.114.1520927775575; Tue, 13 Mar 2018 00:56:15 -0700 (PDT) Received: from [10.101.46.95] ([175.41.48.77]) by smtp.gmail.com with ESMTPSA id n13sm20626360pfg.45.2018.03.13.00.56.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 00:56:14 -0700 (PDT) Content-Type: text/plain; charset=us-ascii; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.15\)) Subject: Re: [PATCH v2 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics From: Kai Heng Feng In-Reply-To: Date: Tue, 13 Mar 2018 15:56:10 +0800 Cc: pali.rohar@gmail.com, mjg59@srcf.ucam.org, dvhart@infradead.org, andy@infradead.org, tiwai@suse.com, platform-driver-x86@vger.kernel.org, Linux Kernel Mailing List , alsa-devel@alsa-project.org Content-Transfer-Encoding: 7bit Message-Id: References: <20180308091023.9061-1-kai.heng.feng@canonical.com> <20180308091023.9061-3-kai.heng.feng@canonical.com> <20180309090223.xb55ltac4pfesdrh@pali> <723DA929-C9FA-4F69-8D3A-03D8A75D09A6@canonical.com> <014795f5a3014cd3bf55de26f76a5af8@ausx13mpc124.AMER.DELL.COM> <20180309094600.m24d3zbzdsmls7aw@pali> <09eadabb264f401a88b427744505adf8@ausx13mpc124.AMER.DELL.COM> <20180310103809.5nnwoulua2u64rku@pali> <20180311143018.u64cldtxuv7divta@pali> To: Mario.Limonciello@dell.com X-Mailer: Apple Mail (2.3445.6.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 12, 2018, at 9:30 AM, Mario.Limonciello@dell.com wrote: > >>> I think the missing aspect is that this is only used in AIO and laptop >>> form >>> factors where the discrete graphics is in a non-removable form factor. >> >> Why we are not checking if kernel is running on AIO or laptop form >> factor then? Or it is not possible? > > Kai Heng, can you please confirm if AIO sets chassis type properly? > It should be 0Dh. > > If so, then I think as second check for chassis type should be possible for > next version of this patch. The chassis type is correctly set as 0Dh on AIOs. > >> Basically what I see there is that we need to detect if current HW >> platform has switchable graphics and check how is configured AUDIO MUX. >> >> But instead of directly checking hw state of audio MUX, we are trying to >> check something different which could get us information of state of the >> audio mux. >> >> I suspect that we do not have a way how to check audio MUX directly, so >> it needs to be done indirectly -- via some Dell SMBIOS call and some >> other heuristic. This is something which should be specified either in >> comment or in commit message (problem of type: we need X, but check for >> Y). >> >> And if we are doing this check indirectly, we should do the most >> specific test and not more general. > > Right. > >> I think that PCI vendor ID check of audio device is more general test >> then checking if kernel is running on Dell laptop (check via DMI). And >> if we can check also if running on AIO or laptop form, then it would be >> more specific test. >> >>> Running with your hypothetical though, what would happen is if it's >>> on a non-Dell machine the PCI check would pass and then the code >>> would not be executed by dell-laptop (since dell-smbios didn't load). >> >> Right. >> >>> If it was on a Dell machine it would load but the BIOS would return >>> either Switchable graphics turned off, or invalid token. >>> >>> Even though these aren't real for switchable graphics on Dell I don't >>> see a problem with either of these situations if it ever came up. >> >> I see, this solution is working... >> >> ... but, I see there a very bad precedense. What would happen if another >> laptop manufactor comes with similar solution for hybrid graphics. Does >> it mean that hda audio driver would try to call for every one vendor its >> vendor dependent API function (EFI, SMM, WMI, whatever) to check if >> current HW has some switchable graphics and needs special checks? >> >> Those vendor dependent API functions (which Dell SMBIOS is) should be >> really called on vendor hardware. >> >> Otherwise audio drivers would load bunch of the other vendor dependent >> platform modules and all of those modules (except maximally one) just >> return error. > > Sure the more specific the check the less symbol requests needed that > will fail. > > Kai Heng, > > Can you please use Alex Hung's OEM strings patch in your series to match > "Dell System" in OEM strings too? Sure, but this probably need to wait till it gets merged in Linus' tree. > > Between chassis type, OEM strings match, and AMD vendor/Dell subsystem > vendor that should satisfy all of Pali's concerns I think. > > If anyone thinks that's too much, please speak up. > >>> Compiling a whitelist is a wasted effort because it will have to change >>> Every year for every new platform that has AMD switchable graphics. >> >> I agree, But see that this patch already uses vendor ID whitelisting. > > I mean making a whitelist of all individual affected Dell platforms will > grow > each year. I want to avoid that approach.