All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] usb: renesas_usbhs: fifo: : use proper DMAENGINE API for termination
@ 2021-06-23 10:03 Wolfram Sang
  2021-06-24  1:27 ` Yoshihiro Shimoda
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2021-06-23 10:03 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Wolfram Sang,
	Greg Kroah-Hartman, linux-kernel

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(-)

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH RFC] usb: renesas_usbhs: fifo: : use proper DMAENGINE API for termination
  2021-06-23 10:03 [PATCH RFC] usb: renesas_usbhs: fifo: : use proper DMAENGINE API for termination Wolfram Sang
@ 2021-06-24  1:27 ` Yoshihiro Shimoda
  2021-06-24  5:53   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-24  1:27 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, linux-kernel, linux-usb, Greg Kroah-Hartman

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC] usb: renesas_usbhs: fifo: : use proper DMAENGINE API for termination
  2021-06-24  1:27 ` Yoshihiro Shimoda
@ 2021-06-24  5:53   ` Wolfram Sang
  2021-06-24 10:36     ` Yoshihiro Shimoda
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2021-06-24  5:53 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: linux-renesas-soc, linux-kernel, linux-usb, Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH RFC] usb: renesas_usbhs: fifo: : use proper DMAENGINE API for termination
  2021-06-24  5:53   ` Wolfram Sang
@ 2021-06-24 10:36     ` Yoshihiro Shimoda
  0 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-24 10:36 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, linux-kernel, linux-usb, Greg Kroah-Hartman

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-24 10:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 10:03 [PATCH RFC] usb: renesas_usbhs: fifo: : use proper DMAENGINE API for termination Wolfram Sang
2021-06-24  1:27 ` Yoshihiro Shimoda
2021-06-24  5:53   ` Wolfram Sang
2021-06-24 10:36     ` Yoshihiro Shimoda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.