question regarding ordering in btintel_pcie_send_sync()
Hi,
I was looking at the code. I do not have documentation for the device, but it looks relatively ordinary. Hence this piece of code caught my eye:
/* Set the doorbell to notify the device */
btintel_pcie_set_tx_db(data, tfd_index);Requesting an interrupt. However, are you sure the IO can be processed and trigger an interrupt only after the PCI write, which this triggers?
/* Wait for the complete interrupt - URBD0 */
ret = wait_event_timeout(data->tx_wait_q, data->tx_wait_done,
msecs_to_jiffies(BTINTEL_PCIE_TX_WAIT_TIMEOUT_MS));
Regards
OliverHi Oliver,
Quoted 13 lines
-----Original Message-----
From: Oliver Neukum <[email protected]>
Sent: Thursday, May 16, 2024 11:28 AM
To: K, Kiran <[email protected]>; Marcel Holtmann <[email protected]>
Cc: [email protected]
Subject: question regarding ordering inbtintel_pcie_send_sync()Hi,
I was looking at the code. I do not have documentation for the device, but it looks relatively ordinary. Hence this piece of code caught my eye:
Quoted 6 lines
/* Set the doorbell to notify the device */ btintel_pcie_set_tx_db(data, tfd_index);Requesting an interrupt. However, are you sure the IO can be processed and trigger an interrupt only after the PCI write, which this triggers?
This wait is for reception of packet at the device side. Bluetooth controller can raise the interrupt with different causes. Here driver waits for interrupt BTINTEL_*_CAUSE_0 which indicates that TX has been completed. Device raises BTINTEL_*_CAUSE_1 interrupt when TX packet has been processed and there is some data in RX queue to be read by driver.
Quoted 6 lines
/* Wait for the complete interrupt - URBD0 */
ret = wait_event_timeout(data->tx_wait_q, data->tx_wait_done,
msecs_to_jiffies(BTINTEL_PCIE_TX_WAIT_TIMEOUT_MS));
Regards
OliverThanks,
Kiran