All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop()
@ 2021-06-11 10:54 Yoshihiro Shimoda
  2021-06-11 10:54 ` [PATCH] usb: renesas_usbhs: Fix superfluous irqs happen " Yoshihiro Shimoda
  2021-06-11 10:57 ` [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens " Yoshihiro Shimoda
  0 siblings, 2 replies; 5+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-11 10:54 UTC (permalink / raw)
  To: balbi; +Cc: gregkh, linux-usb, linux-renesas-soc, Yoshihiro Shimoda

This driver has a potential issue which this driver is possible to
cause superfluous interrupts after usb_pkt_pop() is called. So,
after the commit 3af32605289e ("usb: renesas_usbhs: fix error return
code of usbhsf_pkt_handler()") had been applied, the following
error happened when we use g_audio.

    renesas_usbhs e6590000.usb: irq_ready run_error 1 : -22

To fix the issue, disable the tx or rx interrupt in usb_pkt_pop().

Fixes: 2743e7f90dc0 ("usb: renesas_usbhs: fix the usb_pkt_pop()")
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/usb/renesas_usbhs/fifo.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index b5e7991dc7d9..a3c2b01ccf7b 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -101,6 +101,8 @@ static struct dma_chan *usbhsf_dma_chan_get(struct usbhs_fifo *fifo,
 #define usbhsf_dma_map(p)	__usbhsf_dma_map_ctrl(p, 1)
 #define usbhsf_dma_unmap(p)	__usbhsf_dma_map_ctrl(p, 0)
 static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map);
+static void usbhsf_tx_irq_ctrl(struct usbhs_pipe *pipe, int enable);
+static void usbhsf_rx_irq_ctrl(struct usbhs_pipe *pipe, int enable);
 struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
 {
 	struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
@@ -123,6 +125,11 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
 		if (chan) {
 			dmaengine_terminate_all(chan);
 			usbhsf_dma_unmap(pkt);
+		} else {
+			if (usbhs_pipe_is_dir_in(pipe))
+				usbhsf_rx_irq_ctrl(pipe, 0);
+			else
+				usbhsf_tx_irq_ctrl(pipe, 0);
 		}
 
 		usbhs_pipe_clear_without_sequence(pipe, 0, 0);
-- 
2.25.1


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

* [PATCH] usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop()
  2021-06-11 10:54 [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop() Yoshihiro Shimoda
@ 2021-06-11 10:54 ` Yoshihiro Shimoda
  2021-06-11 10:57 ` [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens " Yoshihiro Shimoda
  1 sibling, 0 replies; 5+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-11 10:54 UTC (permalink / raw)
  To: balbi; +Cc: gregkh, linux-usb, linux-renesas-soc, Yoshihiro Shimoda

This driver has a potential issue which this driver is possible to
cause superfluous irqs after usb_pkt_pop() is called. So, after
the commit 3af32605289e ("usb: renesas_usbhs: fix error return
code of usbhsf_pkt_handler()") had been applied, we could observe
the following error happened when we used g_audio.

    renesas_usbhs e6590000.usb: irq_ready run_error 1 : -22

To fix the issue, disable the tx or rx interrupt in usb_pkt_pop().

Fixes: 2743e7f90dc0 ("usb: renesas_usbhs: fix the usb_pkt_pop()")
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/usb/renesas_usbhs/fifo.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index b5e7991dc7d9..a3c2b01ccf7b 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -101,6 +101,8 @@ static struct dma_chan *usbhsf_dma_chan_get(struct usbhs_fifo *fifo,
 #define usbhsf_dma_map(p)	__usbhsf_dma_map_ctrl(p, 1)
 #define usbhsf_dma_unmap(p)	__usbhsf_dma_map_ctrl(p, 0)
 static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map);
+static void usbhsf_tx_irq_ctrl(struct usbhs_pipe *pipe, int enable);
+static void usbhsf_rx_irq_ctrl(struct usbhs_pipe *pipe, int enable);
 struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
 {
 	struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
@@ -123,6 +125,11 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
 		if (chan) {
 			dmaengine_terminate_all(chan);
 			usbhsf_dma_unmap(pkt);
+		} else {
+			if (usbhs_pipe_is_dir_in(pipe))
+				usbhsf_rx_irq_ctrl(pipe, 0);
+			else
+				usbhsf_tx_irq_ctrl(pipe, 0);
 		}
 
 		usbhs_pipe_clear_without_sequence(pipe, 0, 0);
-- 
2.25.1


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

* RE: [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop()
  2021-06-11 10:54 [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop() Yoshihiro Shimoda
  2021-06-11 10:54 ` [PATCH] usb: renesas_usbhs: Fix superfluous irqs happen " Yoshihiro Shimoda
@ 2021-06-11 10:57 ` Yoshihiro Shimoda
  2021-06-11 13:32   ` gregkh
  1 sibling, 1 reply; 5+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-11 10:57 UTC (permalink / raw)
  To: balbi; +Cc: gregkh, linux-usb, linux-renesas-soc

Hi again,

> From: Yoshihiro Shimoda, Sent: Friday, June 11, 2021 7:54 PM
> Subject: [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop()

I'm sorry. I mistook to send this patch.
So, I would like to recall this version.

Best regards,
Yoshihiro Shimoda


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

* Re: [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop()
  2021-06-11 10:57 ` [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens " Yoshihiro Shimoda
@ 2021-06-11 13:32   ` gregkh
  2021-06-13 23:09     ` Yoshihiro Shimoda
  0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2021-06-11 13:32 UTC (permalink / raw)
  To: Yoshihiro Shimoda; +Cc: balbi, linux-usb, linux-renesas-soc

On Fri, Jun 11, 2021 at 10:57:56AM +0000, Yoshihiro Shimoda wrote:
> Hi again,
> 
> > From: Yoshihiro Shimoda, Sent: Friday, June 11, 2021 7:54 PM
> > Subject: [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop()
> 
> I'm sorry. I mistook to send this patch.
> So, I would like to recall this version.

Which version/patch?  You sent 2 here.

confused,

greg k-h

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

* RE: [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop()
  2021-06-11 13:32   ` gregkh
@ 2021-06-13 23:09     ` Yoshihiro Shimoda
  0 siblings, 0 replies; 5+ messages in thread
From: Yoshihiro Shimoda @ 2021-06-13 23:09 UTC (permalink / raw)
  To: gregkh; +Cc: balbi, linux-usb, linux-renesas-soc

Hi Greg,

> From: gregkh@linuxfoundation.org, Sent: Friday, June 11, 2021 10:33 PM
> 
> On Fri, Jun 11, 2021 at 10:57:56AM +0000, Yoshihiro Shimoda wrote:
> > Hi again,
> >
> > > From: Yoshihiro Shimoda, Sent: Friday, June 11, 2021 7:54 PM
> > > Subject: [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop()
> >
> > I'm sorry. I mistook to send this patch.
> > So, I would like to recall this version.
> 
> Which version/patch?  You sent 2 here.
> 
> confused,

I'm very sorry for the confusion. I would like to recall this patch which is subject
"[PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop()"

And, I would like to apply the patch which is the following:
https://lore.kernel.org/linux-renesas-soc/20210611105411.543008-2-yoshihiro.shimoda.uh@renesas.com/
Subject: "[PATCH] usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop()"

Best regards,
Yoshihiro Shimoda


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

end of thread, other threads:[~2021-06-13 23:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 10:54 [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens after usb_pkt_pop() Yoshihiro Shimoda
2021-06-11 10:54 ` [PATCH] usb: renesas_usbhs: Fix superfluous irqs happen " Yoshihiro Shimoda
2021-06-11 10:57 ` [PATCH] usb: renesas_usbhs: Fix superfluous interrupt happens " Yoshihiro Shimoda
2021-06-11 13:32   ` gregkh
2021-06-13 23:09     ` 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.