Received: by 10.223.185.116 with SMTP id b49csp658538wrg; Fri, 16 Feb 2018 05:13:01 -0800 (PST) X-Google-Smtp-Source: AH8x224yst4XSglc/BUxf/T8V8QdlBTpLkjIradWDfdvFPjsaTXbGm+KJ90WP3z6eyiONWtKQ6Zd X-Received: by 2002:a17:902:7887:: with SMTP id q7-v6mr5869246pll.385.1518786781621; Fri, 16 Feb 2018 05:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518786781; cv=none; d=google.com; s=arc-20160816; b=KOaTwCQgFx7RGiEhY7eKmLzuWhJWdkh0GLCBbSge30Kmou1IG+7BqYU/y8YWKkJM6R PBy/Mfqg2l52oJ/k/iZeIdSw6rFJkA+FpmUxHBU5hZP1+4y0Fna3JYImlbPWEnkjmK+F fTDeWXN+3utk/QiVPHualXm+bouostE5M7sYG8PnWfZfzllmvYAsTcfy8BSgKRP3Fgks equWqFcVj6rSaw944QDkpulA4guahcA0oeSaAOd58xvU5rRtY1OPz98cO09ullFi+eo7 H/HTNRAOjt0vRHRK7MouTyDSsYqBSYcPV+SnihaDIuH89b3KIok9IrlM1Ut5tKZqb+gq qaBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fynkW+AUswng/PApyRKOHx96e8VzR2jggqwusgZonTs=; b=v8f/VC0C3sn0OfCAf3+7pGHUlF5yNJc7YfaRXfYVbN/7zvEGjC+ReB/jvdDvdFjwl9 gPxlJIeLYA8wrbqqrh6mmLY7kzCIqFy6ukcnpZYqMXaJYoE+ktE3Q8nvzrCJumzWpszD LtpyI61vQvKqYqDKWjM6keAjElZ3GqiQ25pVTrGTU3SvkcCo+gLxuBErUXOdZB+LrqiV y+58P+Z9aN0kdeZ8c0jnp0tR5qdGxi+eifSkjO3Oc1kZQlI2p1VjWCtDM+XkN0kQ8KWZ UI3F6S21slA1J6Gegp1SsuY9jgJBrrxVHgFJoG3Xa0W9JVqPPzuLij3WJLtAM8WWuihh 8XNg== ARC-Authentication-Results: i=1; mx.google.com; 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 33-v6si1468114pll.161.2018.02.16.05.12.46; Fri, 16 Feb 2018 05:13:01 -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; 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 S1166478AbeBOS2p (ORCPT + 99 others); Thu, 15 Feb 2018 13:28:45 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52212 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163176AbeBOPZZ (ORCPT ); Thu, 15 Feb 2018 10:25:25 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 25CC61110; Thu, 15 Feb 2018 15:25:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Marcel Holtmann Subject: [PATCH 4.4 093/108] Bluetooth: btsdio: Do not bind to non-removable BCM43341 Date: Thu, 15 Feb 2018 16:17:30 +0100 Message-Id: <20180215151235.362338659@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede commit b4cdaba274247c9c841c6a682c08fa91fb3aa549 upstream. BCM43341 devices soldered onto the PCB (non-removable) always (AFAICT) use an UART connection for bluetooth. But they also advertise btsdio support on their 3th sdio function, this causes 2 problems: 1) A non functioning BT HCI getting registered 2) Since the btsdio driver does not have suspend/resume callbacks, mmc_sdio_pre_suspend will return -ENOSYS, causing mmc_pm_notify() to react as if the SDIO-card is removed and since the slot is marked as non-removable it will never get detected as inserted again. Which results in wifi no longer working after a suspend/resume. This commit fixes both by making btsdio ignore BCM43341 devices when connected to a slot which is marked non-removable. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- drivers/bluetooth/btsdio.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/bluetooth/btsdio.c +++ b/drivers/bluetooth/btsdio.c @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -291,6 +292,14 @@ static int btsdio_probe(struct sdio_func tuple = tuple->next; } + /* BCM43341 devices soldered onto the PCB (non-removable) use an + * uart connection for bluetooth, ignore the BT SDIO interface. + */ + if (func->vendor == SDIO_VENDOR_ID_BROADCOM && + func->device == SDIO_DEVICE_ID_BROADCOM_43341 && + !mmc_card_is_removable(func->card->host)) + return -ENODEV; + data = devm_kzalloc(&func->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM;