Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3652332pxv; Mon, 26 Jul 2021 08:46:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSGtZFuumxz0Yb4oMkz/yOeo0FBVhoe8KqsLQQ8aja1P/R2WmTW0uotpVAu2ilzICT7hRp X-Received: by 2002:a05:6e02:16c7:: with SMTP id 7mr14153078ilx.269.1627314397908; Mon, 26 Jul 2021 08:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627314397; cv=none; d=google.com; s=arc-20160816; b=Invr0UhNcvWlSFU/GCbZcoaIYgYMP6qqtF24iqGTbFRgDUQ4C9pXe5fpADANZCZHb7 e0uyMswu62SjySH0eY5FTTBtw1TFYH1e0tm8XFdKz4odVmHXJtaKbjGOnntlUi3lx6Re EoC2JyaDYjBda4oid6GxconiSvd9ITPTQ30WprzFEU6OlNJjwceErivFpeKsbZSdQGt0 wjwgbJ6gX2qbW5BybPlncFrof/pNZjVvu6TLEJ/eUOZpYjnApS8WUw4zXhxajzUoJWLh NEnxJklpoY73HzEQCaJiAUsMXSYDU5d198kLuKN86WcYtd3vrKGh9mxx2moCq9b1yiOL y3Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZRfPsdE9HsvSOjtMXx597O2DM6zDcn/lpWBzbjXRTJY=; b=0/MTSweK8ga4RpAoqiae+pdNxxoCRiB49m9Y9V0uiqq4eRBVmLlBMQEJ7x89ibofxI ZUHerrFn1QmpnzqJNdz8Y1BMKt71m+DPpiMKUlAu+yhJpiPyAN0khpjJxIvHr8CoXMpb p6LbrOxthneVbmNyrjIB+BkVa1IOTjkixDdTmsJaMOYfngHvAR9YRSXFLuiyHYj0Y7HZ lXCsVBp67mBG4+4eLzKnnApy/qZDlaXPz/c1AqFn/sSiJgSnDr9aCdTkphEcYb80KgRO 8NB1XR6c/Axvem7btWq70ek/cX+l1+Frp+irPAbZ4U23f5ROyyDjV5u9xK4oG+dN7KBi PLxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sKg6GzHA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si295796iod.47.2021.07.26.08.46.19; Mon, 26 Jul 2021 08:46:37 -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=pass header.i=@linuxfoundation.org header.s=korg header.b=sKg6GzHA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236052AbhGZPFJ (ORCPT + 99 others); Mon, 26 Jul 2021 11:05:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:44310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235943AbhGZPES (ORCPT ); Mon, 26 Jul 2021 11:04:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 68CFD60F38; Mon, 26 Jul 2021 15:44:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627314287; bh=GbOe5nLAvF/9W+HikZFDgRh0jNiyC0ZMZ7uVQnd7KUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sKg6GzHA8HrQGlEl8JeEIpn/+1cSgbcA8zI5+XtFEtwnjs14Y48WuOWPrSKWUhbUL ih6hwcj45oHt3C4geBcd4PQo6HoJDD5sjfEol5+2uChQuwdT8GZ5VyuyOwtWbqSq2x 7p0mfn/oC5C0jzNe/DkDk1jTgKZqB2MaLprtHVKQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH 4.9 51/60] usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop() Date: Mon, 26 Jul 2021 17:39:05 +0200 Message-Id: <20210726153826.473898767@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153824.868160836@linuxfoundation.org> References: <20210726153824.868160836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yoshihiro Shimoda commit 5719df243e118fb343725e8b2afb1637e1af1373 upstream. 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: # v4.4+ Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20210624122039.596528-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/renesas_usbhs/fifo.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -115,6 +115,8 @@ static struct dma_chan *usbhsf_dma_chan_ #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); @@ -138,6 +140,11 @@ struct usbhs_pkt *usbhs_pkt_pop(struct u dmaengine_terminate_all(chan); usbhsf_fifo_clear(pipe, fifo); 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_running(pipe, 0);