Received: by 2002:ac8:3b51:0:b0:3f3:9eb6:4eb6 with SMTP id r17csp11480219qtf; Sun, 2 Jul 2023 13:00:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlG58VPDVfbyqkeuyvhD9ov7N4CteOFjEOHCdnmhZKZQUSPHV11W95/Pxg2Kn7X/iOxzPghl X-Received: by 2002:a17:90a:a6e:b0:263:70d9:f684 with SMTP id o101-20020a17090a0a6e00b0026370d9f684mr5154557pjo.5.1688328051187; Sun, 02 Jul 2023 13:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688328051; cv=none; d=google.com; s=arc-20160816; b=hXGWG7sr1Nn53HNjuKbihrKhx+8QmSokwgKHnrwyXmp+meuWL7xo8/ywXHgcQo6Xbq Chhzgqh2PUhM6Vssj74w3Xd1CK04fvH7HL+0nkFotQ3oeelMdBZL28XwZIp7sT33AsH3 XacCk0ECGcqV/GijkQ17ElEvNt0deeJKtErOy3PajKuvmiqu1fawU89MY+9E8tkaKYoJ rtr8gmD2hVodt1Dsy7uO5mSVgoBdDy/CmVQQNVgomzNC+oeA1JNQHnqG1Mx+Y9VbMnpT dP9xHkIpyTS1FUJosW55xQur27Zijg+UDNEjc/dkJYywTMOpdYwTZQLjLgDm9KlSwEQw CGdg== 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=mztOwR33aBF684VggndYiOGW0f8MlYMxfxGzCQ3yivA=; fh=xaFp3P3D5/IKNcc3lyAQro7aK7MMelltwxpprXm2jhg=; b=GFtyq3hLdDcF9RoHVxbj0E+V9rwKxLyH9MkRoGbwrjK/Cbafi1AoImpVanYIKLTWJQ hhlqY3bKKwf74RyyMd1yHxHr2pUnj8r0Lb4zSLlKcP9mESJJLFU1Ix89GbdjCnOcDAuJ HwCcqMi1LVZa5GGlPQurPP3mtGDJM5zUMm/YO3GSr0S6ubUCC5ekmByeXohgOFdzP9Yt 4nsS5B/A5fIktA8uRwKKqtMHhXp1DHI/WxgBQX/RLox1q5oJojvYgf5tdjE7UklAHpvI DnzHhm7TB4bgx3diFpNYQzsJ8CmIUIVdzw+rmUzlJMOoebuZNabGCuSC8AX4M6Y2hQ2f dkbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="YfTMvvO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls10-20020a17090b350a00b00262d8c82bddsi16619114pjb.157.2023.07.02.13.00.38; Sun, 02 Jul 2023 13:00:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="YfTMvvO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232965AbjGBTyx (ORCPT + 99 others); Sun, 2 Jul 2023 15:54:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232951AbjGBTyg (ORCPT ); Sun, 2 Jul 2023 15:54:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F64C1BE7; Sun, 2 Jul 2023 12:52:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5B10560C81; Sun, 2 Jul 2023 19:51:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2B10C433C7; Sun, 2 Jul 2023 19:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688327467; bh=0xWRiWQWQT9nCTgwrrHRG9BM6tm1Sh5W6GmoVHq5964=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YfTMvvO/qUno07VMzx9n+L2ZPlMDKmq5UqSMNCOpl4DxHKJg/Z2WnvnkLo/fpGpQo LG37n1Om6dkc4apI5tg5KOL5vAQafCEzqy43Vqq/VqKq5kg8ewmLocRvXEKr+Y5YDe XCjsxhNoHLv5UsuHM2rw0TxA9Z7j6xVBHLjUlepl5X4KwUzsiGCFWJcPIjNnWtv8oL pT+q0k3cll2qPVbl9D/AF3bb7ufSTYBSh6WoKxQb29Gisy9naOSym4ihQg5KTcE9FQ wrj39tYa/3yWpDk2MqR7x9MzbFOH7N37ZTejm8cDcosGmqOEHY6l9MOJNJ27l3e9JS Ph/kts/G3qCag== 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, andriy.shevchenko@linux.intel.com, mail@mariushoch.de, linux-acpi@vger.kernel.org Subject: [PATCH AUTOSEL 6.4 04/12] ACPI: x86: Add ACPI_QUIRK_UART1_SKIP for Lenovo Yoga Book yb1-x90f/l Date: Sun, 2 Jul 2023 15:50:49 -0400 Message-Id: <20230702195057.1787686-4-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230702195057.1787686-1-sashal@kernel.org> References: <20230702195057.1787686-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.4.1 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit f91280f35895d6dcb53f504968fafd1da0b00397 ] The Lenovo Yoga Book yb1-x90f/l 2-in-1 which ships with Android as Factory OS has (another) bug in its DSDT where the UART resource for the BTH0 ACPI device contains "\\_SB.PCIO.URT1" as path to the UART. Note that is with a letter 'O' instead of the number '0' which is wrong. This causes Linux to instantiate a standard /dev/ttyS? device for the UART instead of a /sys/bus/serial device, which in turn causes bluetooth to not work. Similar DSDT bugs have been encountered before and to work around those the acpi_quirk_skip_serdev_enumeration() helper exists. Previous devices had the broken resource pointing to the first UART, while the BT HCI was on the second UART, which ACPI_QUIRK_UART1_TTY_UART2_SKIP deals with. Add a new ACPI_QUIRK_UART1_SKIP quirk for skipping enumeration of UART1 instead for the Yoga Book case and add this quirk to the existing DMI quirk table entry for the yb1-x90f/l . This leaves the UART1 controller unbound allowing the x86-android-tablets module to manually instantiate a serdev for it fixing bluetooth. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/x86/utils.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c index 4cfee2da06756..c2b925f8cd4e4 100644 --- a/drivers/acpi/x86/utils.c +++ b/drivers/acpi/x86/utils.c @@ -259,10 +259,11 @@ bool force_storage_d3(void) * drivers/platform/x86/x86-android-tablets.c kernel module. */ #define ACPI_QUIRK_SKIP_I2C_CLIENTS BIT(0) -#define ACPI_QUIRK_UART1_TTY_UART2_SKIP BIT(1) -#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(2) -#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(3) -#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(4) +#define ACPI_QUIRK_UART1_SKIP BIT(1) +#define ACPI_QUIRK_UART1_TTY_UART2_SKIP BIT(2) +#define ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY BIT(3) +#define ACPI_QUIRK_USE_ACPI_AC_AND_BATTERY BIT(4) +#define ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS BIT(5) static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { /* @@ -319,6 +320,7 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = { DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), }, .driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS | + ACPI_QUIRK_UART1_SKIP | ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY | ACPI_QUIRK_SKIP_GPIO_EVENT_HANDLERS), }, @@ -449,6 +451,9 @@ int acpi_quirk_skip_serdev_enumeration(struct device *controller_parent, bool *s if (dmi_id) quirks = (unsigned long)dmi_id->driver_data; + if ((quirks & ACPI_QUIRK_UART1_SKIP) && uid == 1) + *skip = true; + if (quirks & ACPI_QUIRK_UART1_TTY_UART2_SKIP) { if (uid == 1) return -ENODEV; /* Create tty cdev instead of serdev */ -- 2.39.2