Skip to content

Commit b3cf2d1

Browse files
committed
Merge tag 'for-net-2025-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - fix corruption in h4_recv_buf() after cleanupCen Zhang (1): - hci_sync: fix race in hci_cmd_sync_dequeue_once - btmtksdio: Add pmctrl handling for BT closed state during reset - Revert "Bluetooth: L2CAP: convert timeouts to secs_to_jiffies()" - rfcomm: fix modem control handling - btintel_pcie: Fix event packet loss issue - ISO: Fix BIS connection dst_type handling - HCI: Fix tracking of advertisement set/instance 0x00 - ISO: Fix another instance of dst_type handling - hci_conn: Fix connection cleanup with BIG with 2 or more BIS - hci_core: Fix tracking of periodic advertisement - MGMT: fix crash in set_mesh_sync and set_mesh_complete * tag 'for-net-2025-10-24' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: rfcomm: fix modem control handling Bluetooth: hci_core: Fix tracking of periodic advertisement Bluetooth: hci_conn: Fix connection cleanup with BIG with 2 or more BIS Bluetooth: fix corruption in h4_recv_buf() after cleanup Bluetooth: btintel_pcie: Fix event packet loss issue Bluetooth: ISO: Fix another instance of dst_type handling Revert "Bluetooth: L2CAP: convert timeouts to secs_to_jiffies()" Bluetooth: MGMT: fix crash in set_mesh_sync and set_mesh_complete Bluetooth: HCI: Fix tracking of advertisement set/instance 0x00 Bluetooth: btmtksdio: Add pmctrl handling for BT closed state during reset Bluetooth: ISO: Fix BIS connection dst_type handling Bluetooth: hci_sync: fix race in hci_cmd_sync_dequeue_once ==================== Link: https://patch.msgid.link/20251024144033.355820-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 65f9c4c + 91d35ec commit b3cf2d1

27 files changed

Lines changed: 113 additions & 67 deletions

drivers/bluetooth/bpa10x.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct bpa10x_data {
4141
struct usb_anchor rx_anchor;
4242

4343
struct sk_buff *rx_skb[2];
44+
struct hci_uart hu;
4445
};
4546

4647
static void bpa10x_tx_complete(struct urb *urb)
@@ -96,7 +97,7 @@ static void bpa10x_rx_complete(struct urb *urb)
9697
if (urb->status == 0) {
9798
bool idx = usb_pipebulk(urb->pipe);
9899

99-
data->rx_skb[idx] = h4_recv_buf(hdev, data->rx_skb[idx],
100+
data->rx_skb[idx] = h4_recv_buf(&data->hu, data->rx_skb[idx],
100101
urb->transfer_buffer,
101102
urb->actual_length,
102103
bpa10x_recv_pkts,
@@ -388,6 +389,7 @@ static int bpa10x_probe(struct usb_interface *intf,
388389
hci_set_drvdata(hdev, data);
389390

390391
data->hdev = hdev;
392+
data->hu.hdev = hdev;
391393

392394
SET_HCIDEV_DEV(hdev, &intf->dev);
393395

drivers/bluetooth/btintel_pcie.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,11 +1467,6 @@ static irqreturn_t btintel_pcie_irq_msix_handler(int irq, void *dev_id)
14671467
if (intr_hw & BTINTEL_PCIE_MSIX_HW_INT_CAUSES_GP1)
14681468
btintel_pcie_msix_gp1_handler(data);
14691469

1470-
/* This interrupt is triggered by the firmware after updating
1471-
* boot_stage register and image_response register
1472-
*/
1473-
if (intr_hw & BTINTEL_PCIE_MSIX_HW_INT_CAUSES_GP0)
1474-
btintel_pcie_msix_gp0_handler(data);
14751470

14761471
/* For TX */
14771472
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_0) {
@@ -1487,6 +1482,12 @@ static irqreturn_t btintel_pcie_irq_msix_handler(int irq, void *dev_id)
14871482
btintel_pcie_msix_tx_handle(data);
14881483
}
14891484

1485+
/* This interrupt is triggered by the firmware after updating
1486+
* boot_stage register and image_response register
1487+
*/
1488+
if (intr_hw & BTINTEL_PCIE_MSIX_HW_INT_CAUSES_GP0)
1489+
btintel_pcie_msix_gp0_handler(data);
1490+
14901491
/*
14911492
* Before sending the interrupt the HW disables it to prevent a nested
14921493
* interrupt. This is done by writing 1 to the corresponding bit in

drivers/bluetooth/btmtksdio.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,12 @@ static void btmtksdio_reset(struct hci_dev *hdev)
12701270

12711271
sdio_claim_host(bdev->func);
12721272

1273+
/* set drv_pmctrl if BT is closed before doing reset */
1274+
if (!test_bit(BTMTKSDIO_FUNC_ENABLED, &bdev->tx_state)) {
1275+
sdio_enable_func(bdev->func);
1276+
btmtksdio_drv_pmctrl(bdev);
1277+
}
1278+
12731279
sdio_writel(bdev->func, C_INT_EN_CLR, MTK_REG_CHLPCR, NULL);
12741280
skb_queue_purge(&bdev->txq);
12751281
cancel_work_sync(&bdev->txrx_work);
@@ -1285,6 +1291,12 @@ static void btmtksdio_reset(struct hci_dev *hdev)
12851291
goto err;
12861292
}
12871293

1294+
/* set fw_pmctrl back if BT is closed after doing reset */
1295+
if (!test_bit(BTMTKSDIO_FUNC_ENABLED, &bdev->tx_state)) {
1296+
btmtksdio_fw_pmctrl(bdev);
1297+
sdio_disable_func(bdev->func);
1298+
}
1299+
12881300
clear_bit(BTMTKSDIO_PATCH_ENABLED, &bdev->tx_state);
12891301
err:
12901302
sdio_release_host(bdev->func);

drivers/bluetooth/btmtkuart.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ struct btmtkuart_dev {
7979
u16 stp_dlen;
8080

8181
const struct btmtkuart_data *data;
82+
struct hci_uart hu;
8283
};
8384

8485
#define btmtkuart_is_standalone(bdev) \
@@ -368,7 +369,7 @@ static void btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
368369
sz_left -= adv;
369370
p_left += adv;
370371

371-
bdev->rx_skb = h4_recv_buf(bdev->hdev, bdev->rx_skb, p_h4,
372+
bdev->rx_skb = h4_recv_buf(&bdev->hu, bdev->rx_skb, p_h4,
372373
sz_h4, mtk_recv_pkts,
373374
ARRAY_SIZE(mtk_recv_pkts));
374375
if (IS_ERR(bdev->rx_skb)) {
@@ -858,6 +859,7 @@ static int btmtkuart_probe(struct serdev_device *serdev)
858859
}
859860

860861
bdev->hdev = hdev;
862+
bdev->hu.hdev = hdev;
861863

862864
hdev->bus = HCI_UART;
863865
hci_set_drvdata(hdev, bdev);

drivers/bluetooth/btnxpuart.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ struct btnxpuart_dev {
212212
struct ps_data psdata;
213213
struct btnxpuart_data *nxp_data;
214214
struct reset_control *pdn;
215+
struct hci_uart hu;
215216
};
216217

217218
#define NXP_V1_FW_REQ_PKT 0xa5
@@ -1756,7 +1757,7 @@ static size_t btnxpuart_receive_buf(struct serdev_device *serdev,
17561757

17571758
ps_start_timer(nxpdev);
17581759

1759-
nxpdev->rx_skb = h4_recv_buf(nxpdev->hdev, nxpdev->rx_skb, data, count,
1760+
nxpdev->rx_skb = h4_recv_buf(&nxpdev->hu, nxpdev->rx_skb, data, count,
17601761
nxp_recv_pkts, ARRAY_SIZE(nxp_recv_pkts));
17611762
if (IS_ERR(nxpdev->rx_skb)) {
17621763
int err = PTR_ERR(nxpdev->rx_skb);
@@ -1875,6 +1876,7 @@ static int nxp_serdev_probe(struct serdev_device *serdev)
18751876
reset_control_deassert(nxpdev->pdn);
18761877

18771878
nxpdev->hdev = hdev;
1879+
nxpdev->hu.hdev = hdev;
18781880

18791881
hdev->bus = HCI_UART;
18801882
hci_set_drvdata(hdev, nxpdev);

drivers/bluetooth/hci_ag6xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static int ag6xx_recv(struct hci_uart *hu, const void *data, int count)
105105
if (!test_bit(HCI_UART_REGISTERED, &hu->flags))
106106
return -EUNATCH;
107107

108-
ag6xx->rx_skb = h4_recv_buf(hu->hdev, ag6xx->rx_skb, data, count,
108+
ag6xx->rx_skb = h4_recv_buf(hu, ag6xx->rx_skb, data, count,
109109
ag6xx_recv_pkts,
110110
ARRAY_SIZE(ag6xx_recv_pkts));
111111
if (IS_ERR(ag6xx->rx_skb)) {

drivers/bluetooth/hci_aml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ static int aml_recv(struct hci_uart *hu, const void *data, int count)
650650
struct aml_data *aml_data = hu->priv;
651651
int err;
652652

653-
aml_data->rx_skb = h4_recv_buf(hu->hdev, aml_data->rx_skb, data, count,
653+
aml_data->rx_skb = h4_recv_buf(hu, aml_data->rx_skb, data, count,
654654
aml_recv_pkts,
655655
ARRAY_SIZE(aml_recv_pkts));
656656
if (IS_ERR(aml_data->rx_skb)) {

drivers/bluetooth/hci_ath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static int ath_recv(struct hci_uart *hu, const void *data, int count)
191191
{
192192
struct ath_struct *ath = hu->priv;
193193

194-
ath->rx_skb = h4_recv_buf(hu->hdev, ath->rx_skb, data, count,
194+
ath->rx_skb = h4_recv_buf(hu, ath->rx_skb, data, count,
195195
ath_recv_pkts, ARRAY_SIZE(ath_recv_pkts));
196196
if (IS_ERR(ath->rx_skb)) {
197197
int err = PTR_ERR(ath->rx_skb);

drivers/bluetooth/hci_bcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ static int bcm_recv(struct hci_uart *hu, const void *data, int count)
698698
if (!test_bit(HCI_UART_REGISTERED, &hu->flags))
699699
return -EUNATCH;
700700

701-
bcm->rx_skb = h4_recv_buf(hu->hdev, bcm->rx_skb, data, count,
701+
bcm->rx_skb = h4_recv_buf(hu, bcm->rx_skb, data, count,
702702
bcm_recv_pkts, ARRAY_SIZE(bcm_recv_pkts));
703703
if (IS_ERR(bcm->rx_skb)) {
704704
int err = PTR_ERR(bcm->rx_skb);

drivers/bluetooth/hci_h4.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int h4_recv(struct hci_uart *hu, const void *data, int count)
112112
if (!test_bit(HCI_UART_REGISTERED, &hu->flags))
113113
return -EUNATCH;
114114

115-
h4->rx_skb = h4_recv_buf(hu->hdev, h4->rx_skb, data, count,
115+
h4->rx_skb = h4_recv_buf(hu, h4->rx_skb, data, count,
116116
h4_recv_pkts, ARRAY_SIZE(h4_recv_pkts));
117117
if (IS_ERR(h4->rx_skb)) {
118118
int err = PTR_ERR(h4->rx_skb);
@@ -151,12 +151,12 @@ int __exit h4_deinit(void)
151151
return hci_uart_unregister_proto(&h4p);
152152
}
153153

154-
struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
154+
struct sk_buff *h4_recv_buf(struct hci_uart *hu, struct sk_buff *skb,
155155
const unsigned char *buffer, int count,
156156
const struct h4_recv_pkt *pkts, int pkts_count)
157157
{
158-
struct hci_uart *hu = hci_get_drvdata(hdev);
159158
u8 alignment = hu->alignment ? hu->alignment : 1;
159+
struct hci_dev *hdev = hu->hdev;
160160

161161
/* Check for error from previous call */
162162
if (IS_ERR(skb))

0 commit comments

Comments
 (0)