RE: [PATCH RFC] usb: renesas_usbhs: fifo: : use proper DMAENGINE API for termination

From: Yoshihiro Shimoda
Date: Wed Jun 23 2021 - 21:27:16 EST


Hi Wolfram-san,

> From: Wolfram Sang, Sent: Wednesday, June 23, 2021 7:03 PM
>
> dmaengine_terminate_all() is deprecated in favor of explicitly saying if
> it should be sync or async. Here, we want dmaengine_terminate_sync()
> because there is no other synchronization code in the driver to handle
> an async case.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> ---
>
> Shimoda-san, can you please double check if this works with the
> additional locking in this function? Thank you!

Thank you for the patch! I checked and tested this patch and worked
correctly on my environment.
# To be honest, both shdma and usb-dmac driver doesn't support .device_synchronize
# so that _async() is enough for now.

However, I have a concern which this patch will conflict my fixed patch [1].

[1]
https://lore.kernel.org/linux-renesas-soc/20210611105411.543008-2-yoshihiro.shimoda.uh@xxxxxxxxxxx/

Since I caused a trouble [2], the patch [1] was not merged yet.
So, I intended to resend the patch in near the future.

[2]
https://lore.kernel.org/linux-renesas-soc/TY2PR01MB3692555C6EAC8F02BC8B3D63D8329@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/

In backporting point of view, I guess it's better to apply my fixed patch at first,
and then apply this DMAENGINE patch. But, what do you think?

Best regards,
Yoshihiro Shimoda

> drivers/usb/renesas_usbhs/fifo.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
> index b5e7991dc7d9..6176f2325f03 100644
> --- a/drivers/usb/renesas_usbhs/fifo.c
> +++ b/drivers/usb/renesas_usbhs/fifo.c
> @@ -121,7 +121,7 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
> if (fifo)
> chan = usbhsf_dma_chan_get(fifo, pkt);
> if (chan) {
> - dmaengine_terminate_all(chan);
> + dmaengine_terminate_sync(chan);
> usbhsf_dma_unmap(pkt);
> }
> --
> 2.30.2