aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede2017-11-29 13:29:07 -0600
committerGreg Kroah-Hartman2018-02-16 13:09:46 -0600
commit727b1a6e72e4daa18daad0f3e862c60470df3dd0 (patch)
tree08bb7ec876e3fdd83844c43fd681fb5f3425a48c
parent24346d134b2d00408a1ba1400e0d32dab64d7e5c (diff)
downloadkernel-omap-727b1a6e72e4daa18daad0f3e862c60470df3dd0.tar.gz
kernel-omap-727b1a6e72e4daa18daad0f3e862c60470df3dd0.tar.xz
kernel-omap-727b1a6e72e4daa18daad0f3e862c60470df3dd0.zip
Bluetooth: btsdio: Do not bind to non-removable BCM43341
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 <hdegoede@redhat.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/bluetooth/btsdio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
index 7b624423a7e8..89ccb604045c 100644
--- a/drivers/bluetooth/btsdio.c
+++ b/drivers/bluetooth/btsdio.c
@@ -31,6 +31,7 @@
31#include <linux/errno.h> 31#include <linux/errno.h>
32#include <linux/skbuff.h> 32#include <linux/skbuff.h>
33 33
34#include <linux/mmc/host.h>
34#include <linux/mmc/sdio_ids.h> 35#include <linux/mmc/sdio_ids.h>
35#include <linux/mmc/sdio_func.h> 36#include <linux/mmc/sdio_func.h>
36 37
@@ -291,6 +292,14 @@ static int btsdio_probe(struct sdio_func *func,
291 tuple = tuple->next; 292 tuple = tuple->next;
292 } 293 }
293 294
295 /* BCM43341 devices soldered onto the PCB (non-removable) use an
296 * uart connection for bluetooth, ignore the BT SDIO interface.
297 */
298 if (func->vendor == SDIO_VENDOR_ID_BROADCOM &&
299 func->device == SDIO_DEVICE_ID_BROADCOM_43341 &&
300 !mmc_card_is_removable(func->card->host))
301 return -ENODEV;
302
294 data = devm_kzalloc(&func->dev, sizeof(*data), GFP_KERNEL); 303 data = devm_kzalloc(&func->dev, sizeof(*data), GFP_KERNEL);
295 if (!data) 304 if (!data)
296 return -ENOMEM; 305 return -ENOMEM;