Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp467799yba; Wed, 15 May 2019 04:38:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3sJSZloXXtlumP8AUNZYx4m4UJTujDSs//WETziYv72OZFZ2uBStfQknQRKI0VIpnioxs X-Received: by 2002:a17:902:7b93:: with SMTP id w19mr28681132pll.191.1557920321862; Wed, 15 May 2019 04:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920321; cv=none; d=google.com; s=arc-20160816; b=igGXIUSEUH6RF8BIl1YFF0paM0EPgXiERANJ5s4acaIxZDQ0dg0YZC9+HFzBqi1yAu bmCuo49pRIkZ9tDKpm4t1YDL1PikyAhH5V8OqZKPfrGv+cE2/DGwy0hxCzlTM026iuPG qGvFPdqzp486xBl/iY+YBHUPFj1+vsbwAnlnEOzw/uqNg8OBFRhA+ZtYVtwXWNUtHCaa fJ53eTSluOPMngGlL/kDjTt2bqlJo5DVodGoNx1N2Qd2m2n8f3CZwemGPmZUnc4SdI58 CwDHHyY8Z5i26nCj8whJGTrQqGsuZgpmD/a6IaIUou1odfYHlyd3MI42YocqWd8vzmr8 zfYg== 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=EKsUXHF26a0Rw2eWSLJRB/ijQFqFDMl/jdSgUEyaX9pnKj00pD34KzqbS9JqcI3rPn bACiAHVBy2IDkjk1055RTgJLpsMDgWTPznzcHQ6XQ/ZMQdJL/HvaWVvW3W1NsmCLyBDH fhdX45tPC/pCxD0Wpj/Mrvem18DnAXw9Q/Fet6RDREHhiZdVtGJlOCcOwTUoE/2CNVt6 3XkFyQrsWPLDGzlbpz/aRTUvfpvVGmHdFcxcbd2OoW0p2nFemlR710Ow1jjVDmfwySlx LVPU1BvUWYlTPRlWYM+J5Ab0wGvgSUlu3NgAtoN4Qr/DDGAYl99v5/6yc3r7yvncM/c7 Msjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QTlX1Ctb; 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 129si1968115pfb.270.2019.05.15.04.38.26; Wed, 15 May 2019 04:38:41 -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=QTlX1Ctb; 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 S1731872AbfEOLgb (ORCPT + 99 others); Wed, 15 May 2019 07:36:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:44442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730797AbfEOLcg (ORCPT ); Wed, 15 May 2019 07:32:36 -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 B0516206BF; Wed, 15 May 2019 11:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919955; bh=EwnuNN/iKp732s9E1fnCIgPnDf11zkRNldXEtvvaLrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QTlX1Ctbm9rGQqgRfEyb9hW5SBMKggwnrY9IiFN+TSYTNRsiCpzSV9VesyBjcrtVh AIyO5IWzs0RtkFQiUhNpexSACX3pfH448RFCc+z/gW2x8wopqkgbvGaY9+APIvkP+R ztBhUD2yHJpWcI1AUzzuawrwVwol0egQiFAMFXz0= 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.1 02/46] platform/x86: thinkpad_acpi: Disable Bluetooth for some machines Date: Wed, 15 May 2019 12:56:26 +0200 Message-Id: <20190515090618.166336036@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090616.670410738@linuxfoundation.org> References: <20190515090616.670410738@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,