Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4790889imb; Thu, 7 Mar 2019 00:09:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwn/rmEDkBmyfS06adSNBm9emwxb8HL9WmA6TnfwEXKMnF5YV8D8odSRTPIaY/CAZmDGm8R X-Received: by 2002:a17:902:8ec1:: with SMTP id x1mr11752259plo.52.1551946182138; Thu, 07 Mar 2019 00:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551946182; cv=none; d=google.com; s=arc-20160816; b=OMQpQLPv359vvJpz8Fh3RON0W+5WxoJepZjxXo5ieB+xn6DCh8F+ZITDxr2TGTLEQV fyPPE+rfiMNhDrhTCN/Ws2Ss2WfP55oZCqgg8cTYud0WOdCXqFoDXcKGrn/iIivQ3ust LFX7SNy8bSQOkqbkP56XlKQwK8iZgyCjCIekMAz+OQr7dy8EJQYBTxXUA0oAkRWaslfy R4vOtWQG6+k0CwBaI4tGktRVTtMaZWIrJkCsxQ0+0LF3B08yU6M53T9oOJWtSGx3ecsH Szmc+PTKmYuT9mrzWEQKEFA9oaislTwgDJVn9ys7NhyG0NfcbmrMhzo2jptccHzDS5KC a1Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3eB4oJg3poxMwSiUe17lYzQQHXESev0uSRV502TCnCw=; b=ynZj0qLY2hRt+9eO97Xya1b7oyheMK3wKcu0yqIMX9d/cL4DxNO8UL+9Bg+xaoZpBf rs8InIjfrILzeqN2zm68VyQBuNJiFe7aro7lCjZKTxzIo+NgWFmAeptpCI1e1KphVR5U ZeM5W8d1PZPWtPbyfpbevTesaV+0ys4QfDFiRZGv6lzP0f/ambHMxvBiyHeIhkv0TLIN Y0L79G+M+B/fpeYlt/iVWLKAS8gUARww7bIB1V+N5Zs35Q2iI2bOIj0h6WuX0ZodQp5s i0D2qG2S8cmPLgzwQALh08Gw2SOsiNwK0qi5SmJbNBzYyRTaPtlzE62PzIS033yEIacP vtsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=Qv7YOz80; 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=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u17si3669568pfm.82.2019.03.07.00.09.26; Thu, 07 Mar 2019 00:09:42 -0800 (PST) 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; dkim=pass header.i=@flygoat.com header.s=mail header.b=Qv7YOz80; 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=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726127AbfCGIJF (ORCPT + 99 others); Thu, 7 Mar 2019 03:09:05 -0500 Received: from forward106p.mail.yandex.net ([77.88.28.109]:40058 "EHLO forward106p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfCGIJF (ORCPT ); Thu, 7 Mar 2019 03:09:05 -0500 Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward106p.mail.yandex.net (Yandex) with ESMTP id CA2761C82D32; Thu, 7 Mar 2019 11:08:54 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id RhRNaqKEsM-8rvChqfX; Thu, 07 Mar 2019 11:08:54 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1551946134; bh=3eB4oJg3poxMwSiUe17lYzQQHXESev0uSRV502TCnCw=; h=Subject:To:From:Message-Id:Cc:Date; b=Qv7YOz80C0E9BanAPQzcg+Rtj1e/7hai2JIqY/OGvL72wwnlfOExojq4EvHjjbLKq esQMUDshuks6N1uhMvbLci7KXpusfq/LyseWhFweRM3Gvts4rr5gRou5/R4DWFNVXy u8+4cZfOegRj1lh13XOb9J5U0A3bKe/5xZpYQ6Rw= Authentication-Results: mxback12g.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id hUPJSHy4bA-8YemflwU; Thu, 07 Mar 2019 11:08:48 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) From: Jiaxun Yang To: ibm-acpi@hmh.eng.br Cc: dvhart@infradead.org, andy@infradead.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jiaxun Yang Subject: [PATCH] platform/x86: thinkpad_acpi: disable bluetooth for some machines Date: Thu, 7 Mar 2019 16:08:20 +0800 Message-Id: <20190307080820.9723-1-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some AMD based ThinkPads have a firmware bug that calling "GBDC" will cause bluetooth on Intel wireless cards blocked. Probe these models by DMI match and disable bluetooth subdriver if specified Intel wireless card exist. Signed-off-by: Jiaxun Yang --- drivers/platform/x86/thinkpad_acpi.c | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 726341f2b638..29e835f9368a 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -79,6 +79,7 @@ #include #include #include +#include #include #include #include @@ -4501,11 +4502,80 @@ static void bluetooth_exit(void) bluetooth_shutdown(); } +static const struct dmi_system_id bt_fwbug_list[] __initconst = { + { + .ident = "ThinkPad E485", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_BOARD_NAME, "20KU"), + }, + }, + { + .ident = "ThinkPad E585", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_BOARD_NAME, "20KV"), + }, + }, + { + .ident = "ThinkPad A285 - 20MW", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_BOARD_NAME, "20MW"), + }, + }, + { + .ident = "ThinkPad A285 - 20MX", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_BOARD_NAME, "20MX"), + }, + }, + { + .ident = "ThinkPad A485 - 20MU", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_BOARD_NAME, "20MU"), + }, + }, + { + .ident = "ThinkPad A485 - 20MV", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_BOARD_NAME, "20MV"), + }, + }, + {} +}; + +static int __init have_bt_fwbug(void) +{ + /* Some AMD based ThinkPads have a firmware bug that calling + * "GBDC" will cause bluetooth on Intel wireless cards blocked + */ + if (dmi_check_system(bt_fwbug_list)) { + if (pci_get_device(PCI_VENDOR_ID_INTEL, 0x24F3, NULL) || \ + pci_get_device(PCI_VENDOR_ID_INTEL, 0x24FD, NULL) || \ + pci_get_device(PCI_VENDOR_ID_INTEL, 0x2526, NULL)) + return 1; + else + return 0; + } else { + return 0; + } +} + static int __init bluetooth_init(struct ibm_init_struct *iibm) { int res; int status = 0; + if (have_bt_fwbug()) { + vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL, + FW_BUG "disable bluetooth subdriver for Intel cards\n"); + return 1; + } + vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL, "initializing bluetooth subdriver\n"); -- 2.20.1