From: Bin Liu <b-liu@ti.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <od@zcrc.me>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Paul Cercueil <paul@crapouillou.net>
Subject: Re: [PATCH] usb: musb: jz4740: Prevent lockup when CONFIG_SMP is set
Date: Thu, 21 May 2020 16:28:43 -0500 [thread overview]
Message-ID: <20200521212843.GD5684@iaqt7> (raw)
In-Reply-To: <20200520150111.76658-1-paul@crapouillou.net>
Hi Greg,
On Wed, May 20, 2020 at 05:01:11PM +0200, Paul Cercueil wrote:
> The function dma_controller_irq() locks up the exact same spinlock we
> locked before calling it, which obviously resulted in a deadlock when
> CONFIG_SMP was enabled. This flew under the radar as none of the boards
> supported by this driver needs SMP.
>
> Fixes: 57aadb46bd63 ("usb: musb: jz4740: Add support for DMA")
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Is it too late if you directly take this patch for v5.7-rc7? The bug is
introduced in v5.7-rc1. If so, here is my Acked-by:
Acked-by: Bin Liu <b-liu@ti.com>
Thanks,
-Bin.
> ---
> drivers/usb/musb/jz4740.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c
> index 54e7b30acc69..42c1e8bfc4be 100644
> --- a/drivers/usb/musb/jz4740.c
> +++ b/drivers/usb/musb/jz4740.c
> @@ -69,11 +69,11 @@ static irqreturn_t jz4740_musb_interrupt(int irq, void *__hci)
> irqreturn_t retval = IRQ_NONE, retval_dma = IRQ_NONE;
> struct musb *musb = __hci;
>
> - spin_lock_irqsave(&musb->lock, flags);
> -
> if (IS_ENABLED(CONFIG_USB_INVENTRA_DMA) && musb->dma_controller)
> retval_dma = dma_controller_irq(irq, musb->dma_controller);
>
> + spin_lock_irqsave(&musb->lock, flags);
> +
> musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB);
> musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX);
> musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX);
> --
> 2.26.2
>
prev parent reply other threads:[~2020-05-21 21:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 15:01 [PATCH] usb: musb: jz4740: Prevent lockup when CONFIG_SMP is set Paul Cercueil
2020-05-21 20:34 ` Bin Liu
2020-05-21 20:39 ` Paul Cercueil
2020-05-21 21:30 ` Bin Liu
2020-05-21 21:35 ` Bin Liu
2020-05-21 21:28 ` Bin Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200521212843.GD5684@iaqt7 \
--to=b-liu@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=od@zcrc.me \
--cc=paul@crapouillou.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).