Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp241874lqt; Thu, 18 Apr 2024 13:45:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbl0XKbY/A0Mtnlpx1F2KOTCZ2FoKCyHiVzDcwQvm/YcJKcuUmRVDjmABPRLXHEvCkfno1rSE+DsI1XCQN2cJKYs84fkudJvxD0idafg== X-Google-Smtp-Source: AGHT+IGCcVdQdw1Ft7uzNZGcjQq3DsJuHg9654zb0NcnCvQPn6CFvOy/d6Z7BAB4DSxA8l18PS7Z X-Received: by 2002:a17:902:d4c5:b0:1e5:2883:6ff6 with SMTP id o5-20020a170902d4c500b001e528836ff6mr232649plg.11.1713473152494; Thu, 18 Apr 2024 13:45:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713473152; cv=pass; d=google.com; s=arc-20160816; b=RgD5uIlYUuPqkru/RgWS+HlzS4IVWBqT5Yu6RZf4NBN75zwLK3GQJv60HSlF/vLbU8 JPGBo1WanfG7P0Bbojuq64zwk1N2LRqQlNWZXkIPOf/HKin7HXTm0wtcx4x1r4VT+wB4 5aISKTLeza5hioWjJazpeqQjnTTntdBfeR7fZOqbaOjGsI0KHKgQJsfW8Y2zIu61gMyx ks6YlZ955PjCEG0lZDWVBE0tYC7olvodHYV28c03x+qi9Hr1mZJQlzFBf44q3tem/rts 9ScsYnvx4mk3ZyvQgKR+jvC2X/IcOd6f6ZP9hq9qiMr9ZNNM7KzxzZy+FuIv+X+rUcpH hDrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=JVyHSxN6J/YG4N2sOK1CGjewLrful+GSCJJm/J/o4xg=; fh=EuyWv+dtvzW3snjyxgC4i1y613kfGF9ZmKTrCS4U/Mc=; b=DsrIPZqKz29ka0gw2sIswhhsEpmYzzeska0QS9XNmr8hHydS5sjCeqRDqvqH2ocH2I xYGVUPR9Vlip/dAWdUY7qwhVQ9kWnC33zlmr4LeAokQHmCHla0XQktOw4nRUR1RxfNSz rL0C7GpMAh8rZ7aLpFh9GnZY1QHhLxQWVKdxu/jV26Af8Tx7A9akOlEd3IXpv95+yPF5 MBkcIBzgvFQ77bhFDlNSjHWHcQ7oW0DibDUzZxC3MUKlleXN0fUsPuYqtRM/eSIyrqHr LKfWl6DuML5+/Y0jrv8uqmEMci1yRxfOPDw9zx0pigywH+FZyUwuBCMldAo4dM9h7gjT YVWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nHVRut7M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-150742-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150742-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l8-20020a170903244800b001e3e24562b3si2070249pls.123.2024.04.18.13.45.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 13:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150742-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nHVRut7M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-150742-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150742-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 259ECB22F7D for ; Thu, 18 Apr 2024 20:22:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48D5D1836E1; Thu, 18 Apr 2024 20:22:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nHVRut7M" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CC7713D626; Thu, 18 Apr 2024 20:22:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713471762; cv=none; b=rARuJyKe1IQEfHkTxnoDNtStBJBj7TvOr679CGcRSNjAsVO45z7VahwDdBqX4sh1/q94AIxg+PFHy0uwUtrwogH2yWJXZClGUZpVynooFUYXoNMJLEa4Shjmbdh2kbndN7S+++qoGFQEJndhBYvjmbMINBJOeYTkjbqCgtWMYgQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713471762; c=relaxed/simple; bh=40SDlxrTEy1tKYcd/loaYV6z14zKTw8+g0WRYTiJ/ks=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hnHupSuURrIwTEo6wd+sdLD+j3SUJTCtI/FokMRRKvAPxuy8I7ddO7qPX1UaE1UxQrWYU8VPCP25PQ+11XV96Bpj7J4oxNnGp65Zcq6ZL6JVvkc2qMTXYZLj0qfM2QQ0ZWqsgTe0jBmxSULnjNaVFbHMmT8t4tUKQQI++ejuKbI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nHVRut7M; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB98BC113CC; Thu, 18 Apr 2024 20:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713471761; bh=40SDlxrTEy1tKYcd/loaYV6z14zKTw8+g0WRYTiJ/ks=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nHVRut7MRgBEAkVf8AHawXLsTxYwcLi9zi/FHqkACKu0XmdEJZcwvxmO7Tg3l2hJc kYOcW0eR7xm5UmiMUD0o3potGz1qT05c1CFdHQx1yTLCPFqp6HpAsmUtsmWNb8jabn 9iZ/6h9TPocn6hF5c5W/ErWDI0L4fM5Z6OUOp6THhRp4RyLBl6Vq+ZZwGiGMWF9Kyh wW3N6GYbU9q8gfFi+GvW9zcvOy2m6dhqnEyanb1Pe93DwsbSBnc753somSKVUtX+dT BcaA+Om88/hUx9bPbFY7SnIB/xQIrc6eqfFjmlKNT3a9n9O7ZwKJSnyXFwxufYSeSP 3UKuacSS4S/IQ== Date: Thu, 18 Apr 2024 21:22:35 +0100 From: Mauro Carvalho Chehab To: Pierre-Louis Bossart Cc: linux-kernel@vger.kernel.org, Amadeusz =?UTF-8?B?U8WCYXdpxYRza2k=?= , Andy Shevchenko , Bard Liao , Brady Norander , Jaroslav Kysela , Mark Brown , Mark Hasemeyer , Takashi Iwai , linux-sound@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] ALSA: hda: intel-dsp-config: Fix Huawei Matebook D14 NBLB-WAX9N quirk detection Message-ID: <20240418212235.6548447d@sal.lan> In-Reply-To: <848bcc94-3a31-4fb4-81bc-bd3f138e12f6@linux.intel.com> References: <5e6ba980c0738199589749b68b83f2d730512107.1713430105.git.mchehab@kernel.org> <20240418110453.10efcb60@sal.lan> <848bcc94-3a31-4fb4-81bc-bd3f138e12f6@linux.intel.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Em Thu, 18 Apr 2024 08:24:10 -0500 Pierre-Louis Bossart escreveu: > On 4/18/24 05:04, Mauro Carvalho Chehab wrote: > > Em Thu, 18 Apr 2024 09:48:27 +0100 > > Mauro Carvalho Chehab escreveu: > > > >> Newer Matebook D14 model comes with essx8336 and supports SOF, > >> but the initial models use the legacy driver, with a Realtek ALC 256 > >> AC97 chip on it. > >> > >> The BIOS seems to be prepared to be used by both models, so > >> it contains an entry for ESSX8336 on its DSDT table. > >> > >> Add a quirk, as otherwise dspconfig driver will try to load > >> SOF, causing audio probe to fail. > >> > >> Cc: stable@vger.kernel.org > >> Signed-off-by: Mauro Carvalho Chehab > > > > Worth to mention that I opened an issue on Github about that: > > > > https://github.com/thesofproject/linux/issues/4934 > > > > I added there the ACPI DSDT table as a reference. > > This sounds like an 'easy enough' fix, but I don't have a burning desire > to start adding quirks of this nature. To be clear, the entire support > of the ES8336 is an absolute nightmare that I've stopped looking at > completely given the lack of support of vendor/OEMs. Heh, I know the pain, having working myself to have some support for audio on two different notebooks with my siblings, both with es8336. On both cases, the BIOS info was not really useful, requiring quirks to make device to work properly. This is btw a common issue I'm aware for a long time: BIOS data is not reliable, as vendors tend to re-use BIOS from one device on others, without actually reflecting what it is on each device. The EDAC subsystem never relies on DMI data for memory banks - as even server BIOS from top tear manufacturers usually report wrong data for motherboard's DIMM labels. Instead, an userspace application reads DMI data and propose changes, but patches for rasdaemon are required to add such labels to a database. - In any case, this specific device doesn't have es8336 ;-) Also, I don't think this problem will remain confined to es8336: any other SOF driver may have the same problem: a BIOS (or a BIOS update) may add non-existent _HID devices to DSDT, causing the driver to disable AC97 support, enabling SOF instead and causing regressions. As I wrote at the Github issue, one solution would be to do an I2C scan to detect if the SOF device(s) reported by BIOS are really present. This would require that, before calling snd_intel_acpi_dsp_driver_probe(): - the I2C bus to be created; - Runtime PM for the audio device needs to put resume the device and I2C bus controller, if suspended; - the I2C address of the audio device needs to be known by sound/hda/intel-dsp-config.c With that, a zero-byte (or one-byte if zero-byte not support) read or write could detect if the device is there, before initializing it - or calling the device-specific driver. Another solution would be to probe the SOF driver, falling back to AC97 if SOF init fails. > > In this case, the ACPI table is completely wrong, we should try to > 'mark' the ES8336 device as 'not present' or detect the presence of HDaudio. > > Andy, what do you think and what would be your recommendation? > > >> --- > >> sound/hda/intel-dsp-config.c | 16 ++++++++++++++++ > >> 1 file changed, 16 insertions(+) > >> > >> diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c > >> index 6a384b922e4f..8e728f0585dd 100644 > >> --- a/sound/hda/intel-dsp-config.c > >> +++ b/sound/hda/intel-dsp-config.c > >> @@ -46,6 +46,22 @@ static const struct snd_soc_acpi_codecs __maybe_unused essx_83x6 = { > >> * - the first successful match will win > >> */ > >> static const struct config_entry config_table[] = { > >> + /* Quirks */ > >> + { > >> + .flags = 0, /* Model uses AC97 with Realtek ALC 256 */ > >> + .device = PCI_DEVICE_ID_INTEL_HDA_CML_LP, > >> + .dmi_table = (const struct dmi_system_id []) { > >> + { > >> + .ident = "Huawei NBLB-WAX9N", > >> + .matches = { > >> + DMI_MATCH(DMI_SYS_VENDOR, "HUAWEI"), > >> + DMI_MATCH(DMI_PRODUCT_NAME, "NBLB-WAX9N"), > >> + } > >> + }, > >> + {} > >> + } > >> + }, > >> + > >> /* Merrifield */ > >> #if IS_ENABLED(CONFIG_SND_SOC_SOF_MERRIFIELD) > >> {