Skip to content

Commit f5004a1

Browse files
committed
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg says: ==================== pull request: bluetooth-next 2015-08-28 One more bunch of Bluetooth patches for 4.3: - Crash fix for hci_bcm driver - Enhancements to hci_intel driver (e.g. baudrate configuration) - Fix for SCO link type after multiple connect attempts - Cleanups & minor fixes in a few other places Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 6d74232 + 917522a commit f5004a1

File tree

9 files changed

+372
-40
lines changed

9 files changed

+372
-40
lines changed

drivers/bluetooth/btintel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,5 @@ MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
173173
MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION);
174174
MODULE_VERSION(VERSION);
175175
MODULE_LICENSE("GPL");
176+
MODULE_FIRMWARE("intel/ibt-11-5.sfi");
177+
MODULE_FIRMWARE("intel/ibt-11-5.ddc");

drivers/bluetooth/btmrvl_sdio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,8 +1376,7 @@ static void btmrvl_sdio_dump_firmware(struct btmrvl_private *priv)
13761376

13771377
/* fw_dump_data will be free in device coredump release function
13781378
after 5 min*/
1379-
dev_coredumpv(&priv->btmrvl_dev.hcidev->dev, fw_dump_data,
1380-
fw_dump_len, GFP_KERNEL);
1379+
dev_coredumpv(&card->func->dev, fw_dump_data, fw_dump_len, GFP_KERNEL);
13811380
BT_INFO("== btmrvl firmware dump to /sys/class/devcoredump end");
13821381
}
13831382

drivers/bluetooth/btusb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ static int btusb_setup_intel(struct hci_dev *hdev)
15811581

15821582
/* fw_patch_num indicates the version of patch the device currently
15831583
* have. If there is no patch data in the device, it is always 0x00.
1584-
* So, if it is other than 0x00, no need to patch the deivce again.
1584+
* So, if it is other than 0x00, no need to patch the device again.
15851585
*/
15861586
if (ver->fw_patch_num) {
15871587
BT_INFO("%s: Intel device is already patched. patch num: %02x",
@@ -2100,7 +2100,7 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
21002100

21012101
frag_len += sizeof(*cmd) + cmd->plen;
21022102

2103-
/* The paramter length of the secure send command requires
2103+
/* The parameter length of the secure send command requires
21042104
* a 4 byte alignment. It happens so that the firmware file
21052105
* contains proper Intel_NOP commands to align the fragments
21062106
* as needed.

drivers/bluetooth/hci_bcm.c

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct bcm_data {
6666
};
6767

6868
/* List of BCM BT UART devices */
69-
static DEFINE_SPINLOCK(bcm_device_list_lock);
69+
static DEFINE_SPINLOCK(bcm_device_lock);
7070
static LIST_HEAD(bcm_device_list);
7171

7272
static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
@@ -118,7 +118,7 @@ static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
118118
return 0;
119119
}
120120

121-
/* bcm_device_exists should be protected by bcm_device_list_lock */
121+
/* bcm_device_exists should be protected by bcm_device_lock */
122122
static bool bcm_device_exists(struct bcm_device *device)
123123
{
124124
struct list_head *p;
@@ -138,8 +138,8 @@ static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
138138
if (powered && !IS_ERR(dev->clk) && !dev->clk_enabled)
139139
clk_enable(dev->clk);
140140

141-
gpiod_set_value_cansleep(dev->shutdown, powered);
142-
gpiod_set_value_cansleep(dev->device_wakeup, powered);
141+
gpiod_set_value(dev->shutdown, powered);
142+
gpiod_set_value(dev->device_wakeup, powered);
143143

144144
if (!powered && !IS_ERR(dev->clk) && dev->clk_enabled)
145145
clk_disable(dev->clk);
@@ -164,7 +164,7 @@ static int bcm_open(struct hci_uart *hu)
164164

165165
hu->priv = bcm;
166166

167-
spin_lock(&bcm_device_list_lock);
167+
spin_lock(&bcm_device_lock);
168168
list_for_each(p, &bcm_device_list) {
169169
struct bcm_device *dev = list_entry(p, struct bcm_device, list);
170170

@@ -185,7 +185,7 @@ static int bcm_open(struct hci_uart *hu)
185185
if (bcm->dev)
186186
bcm_gpio_set_power(bcm->dev, true);
187187

188-
spin_unlock(&bcm_device_list_lock);
188+
spin_unlock(&bcm_device_lock);
189189

190190
return 0;
191191
}
@@ -197,14 +197,14 @@ static int bcm_close(struct hci_uart *hu)
197197
BT_DBG("hu %p", hu);
198198

199199
/* Protect bcm->dev against removal of the device or driver */
200-
spin_lock(&bcm_device_list_lock);
200+
spin_lock(&bcm_device_lock);
201201
if (bcm_device_exists(bcm->dev)) {
202202
bcm_gpio_set_power(bcm->dev, false);
203203
#ifdef CONFIG_PM_SLEEP
204204
bcm->dev->hu = NULL;
205205
#endif
206206
}
207-
spin_unlock(&bcm_device_list_lock);
207+
spin_unlock(&bcm_device_lock);
208208

209209
skb_queue_purge(&bcm->txq);
210210
kfree_skb(bcm->rx_skb);
@@ -338,6 +338,11 @@ static int bcm_suspend(struct device *dev)
338338

339339
BT_DBG("suspend (%p): is_suspended %d", bdev, bdev->is_suspended);
340340

341+
spin_lock(&bcm_device_lock);
342+
343+
if (!bdev->hu)
344+
goto unlock;
345+
341346
if (!bdev->is_suspended) {
342347
hci_uart_set_flow_control(bdev->hu, true);
343348

@@ -352,6 +357,9 @@ static int bcm_suspend(struct device *dev)
352357
mdelay(15);
353358
}
354359

360+
unlock:
361+
spin_unlock(&bcm_device_lock);
362+
355363
return 0;
356364
}
357365

@@ -362,6 +370,11 @@ static int bcm_resume(struct device *dev)
362370

363371
BT_DBG("resume (%p): is_suspended %d", bdev, bdev->is_suspended);
364372

373+
spin_lock(&bcm_device_lock);
374+
375+
if (!bdev->hu)
376+
goto unlock;
377+
365378
if (bdev->device_wakeup) {
366379
gpiod_set_value(bdev->device_wakeup, true);
367380
BT_DBG("resume, delaying 15 ms");
@@ -375,6 +388,9 @@ static int bcm_resume(struct device *dev)
375388
hci_uart_set_flow_control(bdev->hu, false);
376389
}
377390

391+
unlock:
392+
spin_unlock(&bcm_device_lock);
393+
378394
return 0;
379395
}
380396
#endif
@@ -488,9 +504,9 @@ static int bcm_probe(struct platform_device *pdev)
488504
dev_info(&pdev->dev, "%s device registered.\n", dev->name);
489505

490506
/* Place this instance on the device list */
491-
spin_lock(&bcm_device_list_lock);
507+
spin_lock(&bcm_device_lock);
492508
list_add_tail(&dev->list, &bcm_device_list);
493-
spin_unlock(&bcm_device_list_lock);
509+
spin_unlock(&bcm_device_lock);
494510

495511
bcm_gpio_set_power(dev, false);
496512

@@ -501,9 +517,9 @@ static int bcm_remove(struct platform_device *pdev)
501517
{
502518
struct bcm_device *dev = platform_get_drvdata(pdev);
503519

504-
spin_lock(&bcm_device_list_lock);
520+
spin_lock(&bcm_device_lock);
505521
list_del(&dev->list);
506-
spin_unlock(&bcm_device_list_lock);
522+
spin_unlock(&bcm_device_lock);
507523

508524
acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
509525

drivers/bluetooth/hci_h4.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
223223
switch ((&pkts[i])->lsize) {
224224
case 0:
225225
/* No variable data length */
226-
(&pkts[i])->recv(hdev, skb);
227-
skb = NULL;
226+
dlen = 0;
228227
break;
229228
case 1:
230229
/* Single octet variable length */
@@ -252,6 +251,12 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
252251
kfree_skb(skb);
253252
return ERR_PTR(-EILSEQ);
254253
}
254+
255+
if (!dlen) {
256+
/* No more data, complete frame */
257+
(&pkts[i])->recv(hdev, skb);
258+
skb = NULL;
259+
}
255260
} else {
256261
/* Complete frame */
257262
(&pkts[i])->recv(hdev, skb);

0 commit comments

Comments
 (0)