Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp472765yba; Wed, 15 May 2019 04:45:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQTQybPCxRZGbVbPQYjR4UY8tEV8vvI92WJo5RJtXsVDf5Hc2W+rfz53ygc7PACvCRzeRn X-Received: by 2002:a63:6fce:: with SMTP id k197mr44425333pgc.140.1557920723358; Wed, 15 May 2019 04:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920723; cv=none; d=google.com; s=arc-20160816; b=ISyhKwf+2xOJXcc+XByjpeUOWKDFduW0f8lMHe7pgNteIVRUGFUibtWe1iwUqALH5g x8mzMQ+BovEG17RNUH6P07Wp4YRr6qZPXSQHe5jFTVkwxUEnw5Xg0MTNkL4R260j6kMk AA0C0h6BPpg7R0U6pCC9EDGs6e4Bdc98v87+Ke8Pc6YBcG6STx0/IsNQL0BruCGk/TqO rI4yWfs/azGnoXfBmletpnrJxYAeg73PDY2IlcVe7przxnfpn7cZfbrxVJtlQiZJZCna iWouGr6Syx4syRvj49lcybH/O5ZCEadQOB77u+o1ns1FutK/9SjtwgyBL7TWf51YIElA +j0g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GKz4XENrw4jjb+qZONd9AqVhwwwRfxgrlB+Uds5+blE=; b=ARRaO2EjUodb0ett2v7QWLa24oGDENG+3aQn/zIT3sProH6S2RmMevNm+QXWIORNII mmKSBnG3LRi6JwdKK+1qoTWTJtQt43vwZqfZhOEKp2Cr+Cw8OekYXTjhhW+qLVfn9jCR 3SNgIS10NRw/En1IqkA0+15uFyX04WdmXd33zGlCssELaTTGo6dAisg1S3dzbfOkybEg OK9yhl42p1zlAjLrG8vQz/OgFSiTG0sigIojq9/wjqvJVH0kupx3wAVPgGBHMlb66fyC Yx0vDUd/hLG3/0Jd6d6PrZtnMn/grha/v6GozBtx8PyBUg0WqdUxUUh83lEEYyOiZHlI 8ZRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZOCoe1Kh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si1625164pgq.268.2019.05.15.04.45.08; Wed, 15 May 2019 04:45:23 -0700 (PDT) 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=@kernel.org header.s=default header.b=ZOCoe1Kh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730847AbfEOL04 (ORCPT + 99 others); Wed, 15 May 2019 07:26:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:37750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730941AbfEOL0x (ORCPT ); Wed, 15 May 2019 07:26:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ECB7D206BF; Wed, 15 May 2019 11:26:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919612; bh=EwnuNN/iKp732s9E1fnCIgPnDf11zkRNldXEtvvaLrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZOCoe1Khelo4UzhWuyneHHtlMj8GaA/hMMlYYpV4Wv/RUW+HAZm/uu3MrOeiRxUrI W5vZakgLyOzaUOPIRARjppRBwF0Ef5jZATG+oqJIKNZbDlXPf7Dfz7zOL0lpAVToxE xnqVix+cJ/mQTP0dLnLitNo4E+ruFUG6oJhcR16o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiaxun Yang , Andy Shevchenko Subject: [PATCH 5.0 003/137] platform/x86: thinkpad_acpi: Disable Bluetooth for some machines Date: Wed, 15 May 2019 12:54:44 +0200 Message-Id: <20190515090652.193487048@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiaxun Yang commit f7db839fccf087664e5587966220821289b6a9cb upstream. 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 Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/thinkpad_acpi.c | 72 ++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) --- 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,6 +4501,74 @@ 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; @@ -4513,7 +4581,7 @@ static int __init bluetooth_init(struct /* 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,