Message ID | 20210623100304.3697-1-wsa+renesas@sang-engineering.com (mailing list archive) |
---|---|
State | Under Review |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | [RFC] usb: renesas_usbhs: fifo: : use proper DMAENGINE API for termination | expand |
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@sang-engineering.com> > --- > > 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@renesas.com/ 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@TY2PR01MB3692.jpnprd01.prod.outlook.com/ 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
Hi Shimoda-san, > 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? Yes, I agree. Could you kindly notify me when your patch is accepted upstream? Or CC me on your patch? Thank you and kind regards, Wolfram
Hi Wolfram-san, > From: Wolfram Sang, Sent: Thursday, June 24, 2021 2:54 PM > > Hi Shimoda-san, > > > 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? > > Yes, I agree. Could you kindly notify me when your patch is accepted > upstream? Or CC me on your patch? Thank you for your reply! I'll resend a patch with your email address on CC. Best regards, Yoshihiro Shimoda
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); }
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@sang-engineering.com> --- Shimoda-san, can you please double check if this works with the additional locking in this function? Thank you! drivers/usb/renesas_usbhs/fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)