Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4841000imb; Thu, 7 Mar 2019 01:38:58 -0800 (PST) X-Google-Smtp-Source: APXvYqyIFCLotje/iAVQn3KdqQRo+sN/I19QJBXmRd++burbuhm+fqcYMGjN1QrrYVg7I3zeyFvS X-Received: by 2002:a63:c307:: with SMTP id c7mr10674750pgd.386.1551951538902; Thu, 07 Mar 2019 01:38:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551951538; cv=none; d=google.com; s=arc-20160816; b=YMVhiCZgmr22RoV7kPueuANQ/bW+c2gSUGFQ3Km1aLQ0eH1FfBnp1AJH5WP0FCS4XA Rd3gvctxgLdPoqHQ/D8oPYhLkUq63BEKy3K9QrMK11QsKUvSKEj+mB49pnOx4QUTlI/y JME/41zMKAprKLTrYMz3CNf5hF6fQnyiWI8lsOUGcTOvPVQ1cC7w4PPfNSJcfa+gew67 7sCYHwW5ISVr4DrCsVqvGRiB72pzgtFO6685B38QfqmFTeXeqPFTcZBcobRI+shR4R9u At1NHGeWmmCknrsRIbL49FcDUK4zqg/Zimpq646qbWFBHyBwI3bW1j9DbE3jbhLIDtAA kFWw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J2aIWsYAPfKj8ipD9I2ZxtXmgv7R5iwmQEBtwJ5dzjc=; b=wRYP1BMf6dj95y6iXbGhg2c+ZIXHZtwch9/VEiVf6jnkOyLsx9qPGS1+9qo+1a/tO2 89apV6vqjVKH/nDOYRzfwpf4hDY0Bhm+efFtk9LG+usdCQuTUjUh5tsAgAyrSRWi9+U6 7R1iw7GfW0gT/hqlA3Ida4P9AuWN4JsGfBAL0+cEO0B29Idzu3eXhU+ChJMf7w6Q78/+ vKBPufX+vmJ4LwDovJQzTp9AhpuKTqSAEKEo77Sqc+xLYpoGdt/AS/6XCF84bafqRz5k VQqKVd5i7lI/RZT9qipH+g6AWXviXlfwmmPGCgQOlYuP40WUR1T21SM3/MHijJN5wLK/ 5D/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=kuPpIG4w; 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 p10si3631870plk.413.2019.03.07.01.38.43; Thu, 07 Mar 2019 01:38:58 -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=kuPpIG4w; 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 S1726150AbfCGJiI (ORCPT + 99 others); Thu, 7 Mar 2019 04:38:08 -0500 Received: from forward100j.mail.yandex.net ([5.45.198.240]:40988 "EHLO forward100j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbfCGJiH (ORCPT ); Thu, 7 Mar 2019 04:38:07 -0500 Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 1444A50E2A5B; Thu, 7 Mar 2019 12:38:03 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ODLEO4rUbm-c2i8SCPi; Thu, 07 Mar 2019 12:38:03 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1551951483; bh=J2aIWsYAPfKj8ipD9I2ZxtXmgv7R5iwmQEBtwJ5dzjc=; h=In-Reply-To:Subject:To:From:Message-Id:Cc:References:Date; b=kuPpIG4wV7cNivemZsA/u64ERlelQP69T+yE4px1kVUIsCmEqBp0irh22E5Oxt8ff EI86KQCctCeE6STG1wUbx1qGKWNtY5EcmNr1LCnQBaSdSJpdF+NCJZ9LFFger3XVyC nrwPVM4ylNJXdssaguynY0cv7NPWw7he/8C5DWZU= Authentication-Results: mxback19j.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id wfxfNBI23y-boemGoRT; Thu, 07 Mar 2019 12:37:59 +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 v2] platform/x86: thinkpad_acpi: disable bluetooth for some machines Date: Thu, 7 Mar 2019 17:37:16 +0800 Message-Id: <20190307093716.3439-1-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190307080820.9723-1-jiaxun.yang@flygoat.com> References: <20190307080820.9723-1-jiaxun.yang@flygoat.com> 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. Cc: stable # 4.14+ Signed-off-by: Jiaxun Yang --- drivers/platform/x86/thinkpad_acpi.c | 73 +++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 726341f2b638..2e24ee42a3c6 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -79,7 +79,7 @@ #include #include #include -#include +#include #include #include #include @@ -4501,11 +4501,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 const struct pci_device_id fwbug_cards_ids[] __initconst = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x24F3) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x24FD) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2526) }, + {} +}; + + +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) && pci_dev_present(fwbug_cards_ids)) { + vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL, + FW_BUG "disable bluetooth subdriver for Intel cards\n"); + return 1; + } else + return 0; +} + static int __init bluetooth_init(struct ibm_init_struct *iibm) { int res; int status = 0; + vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL, "initializing bluetooth subdriver\n"); @@ -4513,7 +4582,7 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm) /* bluetooth not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p, G4x, R30, R31, R40e, R50e, T20-22, X20-21 */ - tp_features.bluetooth = hkey_handle && + tp_features.bluetooth = !have_bt_fwbug() && hkey_handle && acpi_evalf(hkey_handle, &status, "GBDC", "qd"); vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL, -- 2.20.1