Skip to content

Commit 1c76649

Browse files
kirankrishnappa-intelVudentz
authored andcommitted
Bluetooth: btintel_pcie: Add additional to checks to clear TX/RX paths
Due to a hardware issue, there is a possibility that the driver may miss an MSIx interrupt on the RX/TX data path. Since the TX and RX paths are independent, when a TX MSIx interrupt occurs, the driver can check the RX queue for any pending data and process it if present. The same approach applies to the RX path. Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport") Signed-off-by: Chandrashekar Devegowda <[email protected]> Signed-off-by: Kiran K <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 0b6d58b commit 1c76649

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

drivers/bluetooth/btintel_pcie.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,10 +1272,8 @@ static void btintel_pcie_msix_rx_handle(struct btintel_pcie_data *data)
12721272
bt_dev_dbg(hdev, "RXQ: cr_hia: %u cr_tia: %u", cr_hia, cr_tia);
12731273

12741274
/* Check CR_TIA and CR_HIA for change */
1275-
if (cr_tia == cr_hia) {
1276-
bt_dev_warn(hdev, "RXQ: no new CD found");
1275+
if (cr_tia == cr_hia)
12771276
return;
1278-
}
12791277

12801278
rxq = &data->rxq;
12811279

@@ -1311,6 +1309,16 @@ static irqreturn_t btintel_pcie_msix_isr(int irq, void *data)
13111309
return IRQ_WAKE_THREAD;
13121310
}
13131311

1312+
static inline bool btintel_pcie_is_rxq_empty(struct btintel_pcie_data *data)
1313+
{
1314+
return data->ia.cr_hia[BTINTEL_PCIE_RXQ_NUM] == data->ia.cr_tia[BTINTEL_PCIE_RXQ_NUM];
1315+
}
1316+
1317+
static inline bool btintel_pcie_is_txackq_empty(struct btintel_pcie_data *data)
1318+
{
1319+
return data->ia.cr_tia[BTINTEL_PCIE_TXQ_NUM] == data->ia.cr_hia[BTINTEL_PCIE_TXQ_NUM];
1320+
}
1321+
13141322
static irqreturn_t btintel_pcie_irq_msix_handler(int irq, void *dev_id)
13151323
{
13161324
struct msix_entry *entry = dev_id;
@@ -1342,12 +1350,18 @@ static irqreturn_t btintel_pcie_irq_msix_handler(int irq, void *dev_id)
13421350
btintel_pcie_msix_gp0_handler(data);
13431351

13441352
/* For TX */
1345-
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_0)
1353+
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_0) {
13461354
btintel_pcie_msix_tx_handle(data);
1355+
if (!btintel_pcie_is_rxq_empty(data))
1356+
btintel_pcie_msix_rx_handle(data);
1357+
}
13471358

13481359
/* For RX */
1349-
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_1)
1360+
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_1) {
13501361
btintel_pcie_msix_rx_handle(data);
1362+
if (!btintel_pcie_is_txackq_empty(data))
1363+
btintel_pcie_msix_tx_handle(data);
1364+
}
13511365

13521366
/*
13531367
* Before sending the interrupt the HW disables it to prevent a nested

0 commit comments

Comments
 (0)