Thread (5 messages) 5 messages, 2 authors, 27d ago

RE: [PATCH net] net: wan: fsl_uhdlc_hdlc: fix dma_rmb usage in hdlc_rx_done

From: Holger Brunck <hidden>
Date: 2026-05-05 08:15:06
Also in: linuxppc-dev

Le 04/05/2026 à 17:56, Holger Brunck a écrit :
quoted
If dma_rmb is used it has to be done after reading bd_status and
checking if R_E_S is zero. Therefore we need to move it into the while loop.
Can you give more details ? Why does dma_rmb() has to be done after reading
bd_status and checking if R_E_S is zero ?
when R_E_S is zero in the status of the buffer descriptor it means the buffer is
filled with data from the device.  Now the CPU owns the descriptor. Now we
should execute the dma_rmb to be sure that we read the data correctly. 
And this we need to redo for each buffer descriptor which is filled with data,
that’s why it must be done within the for loop and not before and after.

This is also consistent with the example in Documentation/memory-barriers.txt

Best regards
Holger
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help