Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3697634pxv; Mon, 26 Jul 2021 09:38:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJhhsZnuoKbZTubRfTTU3u7Qkc5maXCnwTnqnnkgbOMhbvsDweOV8oqusTMyFFRbLaUgsv X-Received: by 2002:a17:906:16cd:: with SMTP id t13mr18266640ejd.250.1627317511112; Mon, 26 Jul 2021 09:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627317511; cv=none; d=google.com; s=arc-20160816; b=X1sPPbUEIRg78EL6daLMZNPk7eE0TdcOL88JzIlrFygyji2O62S6TYc7k0+QU056V3 lZBw6r1VvA2J3pEUVvQXz/JVKeIGD5U7qoTLWqiYLFKCI/IRZ4MJY0F/EdZA2G/MLfCw AFwDQYIfadYRnagmvzwa81EO2UsUcUAOjdUF0rG6G86VYfJN5dGhlP/RkA+lF3srXIa2 pvQI1crVYdzo7QpObBOeH3M9fsGZf9EpOQ+gvEUbyirMQNrB1cHBi9ubPWqBVzTtfmKB SHyVJ7qjo4JKL0M0gjnn6ATvEJFtUFO8VeaAZjIlAdWNwloYe18m0usX5s2ai2budYUU MMrg== 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=w0bYJDacgWkAZVTBV7gijw7LHhgtMWcTXj8q6lePpV0=; b=0Y0i8LwwrvKgHF6U8jNL2BJ3yGYjvJZfoYUn9ZwWcLYwoqEUvW3OYsYQjXh1ea0nqm aSQz1OhsVxOWvU8TywlrOy7xDvtE+uMH54BP+vVIlrrMJJjIfYQLttHKC1KsTe2hMVDu 3vGQWPFlwJAqjyaPT1O8cpqjm9ufTIqjRyLOKGYNOuh0gklRVy3XMx7w9I21ZYva7Dx6 stkY3sGF97B+IUmpWpYnLrUm1Nrgy4GfnRoBV7OUd50dQVCoR02Cu7R0J+VOjbeStK5z thAcUojjsjCVnoX/N03PJu9DE9menLlBdczF1RDf7/5V2uWZTaAu7whOr3+Kx0U1wzUt 9CeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Lleh8S8/"; 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 l11si362013ejx.267.2021.07.26.09.38.08; Mon, 26 Jul 2021 09:38:31 -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="Lleh8S8/"; 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 S240520AbhGZPzf (ORCPT + 99 others); Mon, 26 Jul 2021 11:55:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:50590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233269AbhGZPdf (ORCPT ); Mon, 26 Jul 2021 11:33:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 67B6E60C41; Mon, 26 Jul 2021 16:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627316041; bh=0B0/m9AQhwYNUWaUVtkh/2N7DpmLSjh5El2w8Mt36ZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lleh8S8/tTduruh2ig3HvI7yJUs8Bzat7yqfRkmZwMEi9ygrP8vTOeCGq4doRuDrm E0qgTrybppPLBoM/wmlVT1oSWrDB9kC5+uxGAYTnOCOwUr/bzY4I+o9Y8w5UNt782Q B+Mqghn5q0DTned09ZcjHmU31xhGvmhnykjEsaqo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH 5.13 165/223] usb: renesas_usbhs: Fix superfluous irqs happen after usb_pkt_pop() Date: Mon, 26 Jul 2021 17:39:17 +0200 Message-Id: <20210726153851.610580818@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153846.245305071@linuxfoundation.org> References: <20210726153846.245305071@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 @@ -101,6 +101,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); @@ -123,6 +125,11 @@ struct usbhs_pkt *usbhs_pkt_pop(struct u 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);