Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp627809ybk; Wed, 20 May 2020 08:04:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMSjsdzL0TC1GwxKkZl6ddStQ1/KNJzZQKohUbu1sd89TVnuWJwu9xi+35G36BuQu//AVz X-Received: by 2002:a17:906:645:: with SMTP id t5mr4292430ejb.412.1589987085631; Wed, 20 May 2020 08:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589987085; cv=none; d=google.com; s=arc-20160816; b=u5wI2uA3xX3FwmSj9W5cUgzClgO9rvYbODVX8ZiqsiPGtQJXlUT+InLtEyzd4t2BWn sLbFkkJ3ho3c2k1m9HU1C93j5/0cJWnlbizcwPnMy53z64mY/0ELoOP2fKsUGB8en7xO gltHYiEVbZ2D2+0K0GCImojZIoLrMhimEK20Bi57+QdNJkkDC5VMgGjo5KY3r9uA53zP GkZqFP+anUIBDgzCmU70FlIotYul+rnNcEjzyR7Lf2HF3iJS3Lo3CZ/cmKFzbNutbGO2 6qvqpVuZxQb4CGP56gz8gU500wVSurfFu/BYvZwZfK29coyPGhy764Bj2hA7b6UPkLm8 y7BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JhyigP6vJLmsxF5F3FTyUVYAcaYZFZ9aUdyQLkCz8+Q=; b=AW+EKkEznMUcLNUa929ud+qVLi5gJyae6gxXrEzUA495WsT/obTgKP0Orh+ugOLOi6 MpAQ/SCNe/0MFrEi2XmzPKp2p6Yju7t4kg7xAa3+GSSiNoNnsdJSOMGRQu3fs7vOpHxN 8lW0eBz2rXaX3IiZdfaZ6vrhvdn+wyI9zkd1YCGA5X7NpkLje9mKTGRJR3lMoAlnOCsT LM7iQx2uwIaWbYtpgn8vvWywIVXrbJFbt07LcOKzjYnDlqq+NJGRBO8nDvJKDXTVJahW h78o3lZ0/yZBQN6FSGY52HiBWcbDzChU4VDbMYKICa7YSS7TSIRJ7ranU7iKdoviQhRy yHAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=plBHmauC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si1861006ejm.613.2020.05.20.08.04.13; Wed, 20 May 2020 08:04:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=plBHmauC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbgETPBf (ORCPT + 99 others); Wed, 20 May 2020 11:01:35 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:56804 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbgETPBf (ORCPT ); Wed, 20 May 2020 11:01:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1589986893; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=JhyigP6vJLmsxF5F3FTyUVYAcaYZFZ9aUdyQLkCz8+Q=; b=plBHmauCTOLW0yzuH1qGg+mtNilkhxHpdMKm8jiCubeYq0pFXAeMAPgEzYD88T3bG7nUZr Xd9ft6ee/jn3c1wqmlhANAOjL/94mDmihLxGbCZFsb5BMXRyT3iPD8QABvhlenqVF1LYlb AJvJSqJMIH+sIv3/7egv4Ykw4doBu3k= From: Paul Cercueil To: Bin Liu Cc: od@zcrc.me, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH] usb: musb: jz4740: Prevent lockup when CONFIG_SMP is set Date: Wed, 20 May 2020 17:01:11 +0200 Message-Id: <20200520150111.76658-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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