Skip to content

Commit f190c5c

Browse files
committed
drivers: mspi_dw: Remove needless TXEIR check
This is a follow-up to commit f0f5f8c. There is no need to check if TXE interrupt flag is set before calling tx_dummy_bytes(), as the function can handle the case when it is called even though there is no room in the TX FIFO. On the other hand, the check may be actually harmful, as it may prevent adding more items to the TX FIFO while the SSI controller is waiting until the FIFO achieves its transfer start level. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 16f4d6c commit f190c5c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/mspi/mspi_dw.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ static bool tx_dummy_bytes(const struct device *dev)
209209
* FIFO to avoid overflowing it; `max_queued_dummy_bytes` accounts
210210
* that one byte that can be partially received, thus not included
211211
* in the value from the RXFLR register.
212+
* This check also handles the case when the function is called but
213+
* the TX FIFO is already filled up (fifo_room == 0).
212214
*/
213215
if (fifo_room <= rx_fifo_items) {
214216
return false;
@@ -363,8 +365,15 @@ static void handle_fifos(const struct device *dev)
363365
break;
364366
}
365367

366-
if (dev_data->dummy_bytes == 0 ||
367-
!(int_status & RISR_TXEIR_BIT)) {
368+
/* If there are still some dummy bytes to transmit,
369+
* always try to put some into the TX FIFO, no matter
370+
* what's the TXE interrupt status (the TX FIFO may be
371+
* filled over its threshold level, hence its interrupt
372+
* flag will not be set, but below its transmit level,
373+
* so the controller may be waiting for more items to
374+
* appear there).
375+
*/
376+
if (dev_data->dummy_bytes == 0) {
368377
break;
369378
}
370379

0 commit comments

Comments
 (0)