Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3385836pxb; Mon, 17 Jan 2022 19:16:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJx98hcJm6FYSF670ylJd8yChfGunk0STatQGRgMqjhHviEF2aUWjDL9R87rl4ktO/fj65+f X-Received: by 2002:a63:340c:: with SMTP id b12mr21813891pga.359.1642475815272; Mon, 17 Jan 2022 19:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642475815; cv=none; d=google.com; s=arc-20160816; b=wPtPaa1YG4uQsB5OTvCV71LJe0fKiMTyXZWXhB1cdRRlHiKQke37DaadJ+KNtMxPT+ k3YAe+hGS03SMoTvFS1ORuBGi4p80mRN5fKDwYtc6+LFpvr7pJNzCoA6rcj0Je7Z8oXj Bn+EGEHfYJpiTQAhffXt1GpjWSugRmP6RhhVKxd1A7Jo0KWREGVV4ychFrqSVw+l+ZRH CXL3E+5xyrbGN8p3j7P1GwTlPbgxXLPdrQEAJmp37NhPBor/Xi+pROa4axfAWRTZOcTv 0tjHaYc3YWhn8neDEM3QOByUgmlmRSxdywynM1mJta/lvuZ0QDSOWsN+N8GHWOol2l+9 /ijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I256MUr957wFBy9veJOyMyjM6dlVqu1XqsI8EopNrE0=; b=Bbp1oFCuphns77uWcTxz07C/9ymqXZ1Dkj3HqMXp1CxZ4/dXeu1QW7UX6bYTa+WLDI vphYVZeWNQ6cuP2Vsb5DogjTbTf3POjxlI6Aazupj0vlXXFh5bPGg5kVVwX7W7HikMTU Z7EbERCWJLkXKjnF+315gxcwZeJi21eTuphOTALxQtM6DGxE2tFwau2cswhVBTaUf9co KY0xPWw2G/vQ3HhMt3/GT6vRV+dXJEyCACCigc4PQRguTErylfdKEe/1oTlIjxrS8Bt6 7LDtT3tIU6b4W+wjGHJSEo6dt+GOfdzWh4Dn5JCPiVHgxhu3gwVSWhW0n2XgEJqyHeRT 0fTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OL50hDnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si15251958pfp.117.2022.01.17.19.16.42; Mon, 17 Jan 2022 19:16:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OL50hDnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244590AbiARC1I (ORCPT + 99 others); Mon, 17 Jan 2022 21:27:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245162AbiARCY5 (ORCPT ); Mon, 17 Jan 2022 21:24:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B162C0613A6; Mon, 17 Jan 2022 18:24:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F3B71B8122C; Tue, 18 Jan 2022 02:24:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9CC4C36AE3; Tue, 18 Jan 2022 02:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472649; bh=a3dFkuC1B1onUYYjOCkI8tMCtX9oDS/YpYKObjKeaao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OL50hDnG8zzk+vWIq0wUxkzufTqoWXkFI9G5oyz1EYpQ3Bh5Sxoa127DEvkamtZjp zPpXdMZXdzeBZRu/J/pMhKEQFEukJqF7mdJ32oEw74ZAUrNjTBSK/q5ZjpOIJVoH7M iAfOju4tsaQmtcD/qipI7qacIo3yBAK7XkZceeRBh9M8Jg0UlsMeeojvorv2tfdAEy zipGFLl7nps9HXTsS70bqcV+4QcVT31RdvneLQ5lFbPiZ+gE5YlJ1+iCbYWLe94B2r DIDwntqn8iGcM1rhPQKMCWsAgX1JUbrJMKSHH8HfTX+hIeXNlDZj0053FkKpGwjTGS vwS2ebbCCrmMw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , "Rafael J . Wysocki" , Sasha Levin , rafael@kernel.org, mario.limonciello@amd.com, linux-acpi@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 087/217] ACPI / x86: Add not-present quirk for the PCI0.SDHB.BRC1 device on the GPD win Date: Mon, 17 Jan 2022 21:17:30 -0500 Message-Id: <20220118021940.1942199-87-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 57d2dbf710d832841872fb15ebb79429cab90fae ] The GPD win and its sibling the GPD pocket (99% the same electronics in a different case) use a PCI wifi card. But the ACPI tables on both variants contain a bug where the SDIO MMC controller for SDIO wifi cards is enabled despite this. This SDIO MMC controller has a PCI0.SDHB.BRC1 child-device which _PS3 method sets a GPIO causing the PCI wifi card to turn off. At the moment there is a pretty ugly kludge in the sdhci-acpi.c code, just to work around the bug in the DSDT of this single design. This can be solved cleaner/simply with a quirk overriding the _STA return of the broken PCI0.SDHB.BRC1 PCI0.SDHB.BRC1 child with a status value of 0, so that its power_manageable flag gets cleared, avoiding this problem. Note that even though it is not used, the _STA method for the MMC controller is deliberately not overridden. If the status of the MMC controller were forced to 0 it would never get suspended, which would cause these mini-laptops to not reach S0i3 level when suspended. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/x86/utils.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c index 190bfc2ab3f26..b3fb428461c6f 100644 --- a/drivers/acpi/x86/utils.c +++ b/drivers/acpi/x86/utils.c @@ -94,9 +94,10 @@ static const struct override_status_id override_status_ids[] = { /* * The GPD win BIOS dated 20170221 has disabled the accelerometer, the * drivers sometimes cause crashes under Windows and this is how the - * manufacturer has solved this :| Note that the the DMI data is less - * generic then it seems, a board_vendor of "AMI Corporation" is quite - * rare and a board_name of "Default String" also is rare. + * manufacturer has solved this :| The DMI match may not seem unique, + * but it is. In the 67000+ DMI decode dumps from linux-hardware.org + * only 116 have board_vendor set to "AMI Corporation" and of those 116 + * only the GPD win and pocket entries' board_name is "Default string". * * Unfortunately the GPD pocket also uses these strings and its BIOS * was copy-pasted from the GPD win, so it has a disabled KIOX000A @@ -120,6 +121,19 @@ static const struct override_status_id override_status_ids[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Default string"), DMI_MATCH(DMI_BIOS_DATE, "05/25/2017") }), + + /* + * The GPD win/pocket have a PCI wifi card, but its DSDT has the SDIO + * mmc controller enabled and that has a child-device which _PS3 + * method sets a GPIO causing the PCI wifi card to turn off. + * See above remark about uniqueness of the DMI match. + */ + NOT_PRESENT_ENTRY_PATH("\\_SB_.PCI0.SDHB.BRC1", ATOM_AIRMONT, { + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), + DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), + }), }; bool acpi_device_override_status(struct acpi_device *adev, unsigned long long *status) -- 2.34.1