Skip to content

Commit cfe006c

Browse files
kirankrishnappa-intelgregkh
authored andcommitted
Bluetooth: btintel_pcie: Add additional to checks to clear TX/RX paths
[ Upstream commit 1c76649 ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent b70b415 commit cfe006c

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
@@ -761,10 +761,8 @@ static void btintel_pcie_msix_rx_handle(struct btintel_pcie_data *data)
761761
bt_dev_dbg(hdev, "RXQ: cr_hia: %u cr_tia: %u", cr_hia, cr_tia);
762762

763763
/* Check CR_TIA and CR_HIA for change */
764-
if (cr_tia == cr_hia) {
765-
bt_dev_warn(hdev, "RXQ: no new CD found");
764+
if (cr_tia == cr_hia)
766765
return;
767-
}
768766

769767
rxq = &data->rxq;
770768

@@ -800,6 +798,16 @@ static irqreturn_t btintel_pcie_msix_isr(int irq, void *data)
800798
return IRQ_WAKE_THREAD;
801799
}
802800

801+
static inline bool btintel_pcie_is_rxq_empty(struct btintel_pcie_data *data)
802+
{
803+
return data->ia.cr_hia[BTINTEL_PCIE_RXQ_NUM] == data->ia.cr_tia[BTINTEL_PCIE_RXQ_NUM];
804+
}
805+
806+
static inline bool btintel_pcie_is_txackq_empty(struct btintel_pcie_data *data)
807+
{
808+
return data->ia.cr_tia[BTINTEL_PCIE_TXQ_NUM] == data->ia.cr_hia[BTINTEL_PCIE_TXQ_NUM];
809+
}
810+
803811
static irqreturn_t btintel_pcie_irq_msix_handler(int irq, void *dev_id)
804812
{
805813
struct msix_entry *entry = dev_id;
@@ -827,12 +835,18 @@ static irqreturn_t btintel_pcie_irq_msix_handler(int irq, void *dev_id)
827835
btintel_pcie_msix_gp0_handler(data);
828836

829837
/* For TX */
830-
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_0)
838+
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_0) {
831839
btintel_pcie_msix_tx_handle(data);
840+
if (!btintel_pcie_is_rxq_empty(data))
841+
btintel_pcie_msix_rx_handle(data);
842+
}
832843

833844
/* For RX */
834-
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_1)
845+
if (intr_fh & BTINTEL_PCIE_MSIX_FH_INT_CAUSES_1) {
835846
btintel_pcie_msix_rx_handle(data);
847+
if (!btintel_pcie_is_txackq_empty(data))
848+
btintel_pcie_msix_tx_handle(data);
849+
}
836850

837851
/*
838852
* Before sending the interrupt the HW disables it to prevent a nested

0 commit comments

Comments
 (0)