Skip to contentSkip to conversation

Bluetooth: btsdio: Do not bind to non-removable BCM43341

PATCH In review Hans de Goede 2 participants 2 messages Nov 29, 2017 – Dec 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: btsdio: Do not bind to non-removable BCM43341

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.

---
 drivers/bluetooth/btsdio.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/bluetooth/btsdio.c +10 -0
index c8e945d19ffe..76c1405c7242 100644
@@ -31,6 +31,7 @@
 #include <linux/errno.h>
 #include <linux/skbuff.h>
 
+#include <linux/mmc/host.h>
 #include <linux/mmc/sdio_ids.h>
 #include <linux/mmc/sdio_func.h>
 
@@ -292,6 +293,15 @@ static int btsdio_probe(struct sdio_func *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;
Signature · 1 line
2.14.3
maintainer
#1 lore raw

Hi Hans,

Quoted 12 lines

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.

Quoted 8 lines

This commit fixes both by making btsdio ignore BCM43341 devices when connected to a slot which is marked non-removable.

---
drivers/bluetooth/btsdio.c | 10 ++++++++++

1 file changed, 10 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel