> 
> Le 04/05/2026 à 17:56, Holger Brunck a écrit :
> > 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

Reply via email to