Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6570206ybx; Mon, 11 Nov 2019 11:07:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwY3/7VMfe6e/u1poZV/E1IT/X2MZ4PWm6Z9QgLsEkXqFhcDcySLryYUdlTA+E0TPNMv5Yz X-Received: by 2002:a50:f296:: with SMTP id f22mr28152568edm.26.1573499241607; Mon, 11 Nov 2019 11:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573499241; cv=none; d=google.com; s=arc-20160816; b=eKTpjHQhudN4h/gTwerUhclYTs3LuSBoRCuC66fD0XI4A1Lbi5YD4JlKiWNbQTztIk 78Ux0Q8hKrc+wUUtH+rFmW/Z2BpngS4+fRNL78p3PRCiLhHHSMA07ARXpjznO+NMlAsk 5frwSl12HjuqLgig694ZEVVsYbg4KvpHai6Oe//NfyhKFnJmbvfd8lRHSnTsI78mPUwr LKnDZWcIWqTZRuQ+0c2aHzIafl5Fjat4SO8MvhQTQRAymod0SC0O6q0KCuYo33L2gzpX Qzl7C4Bo1TMal+AxnxIIq4td/lVthPbWu2dXMH2FwxJJFUhBmrDq2GvA/wtI2GPrT1Xj 3O6Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1wDwD4+jZ0XRc12dj1upnYbpLHQ5chFQMcpsewhJSiM=; b=phWPkQOGYf+vKvW5rN0yR4jlJWayvp/slVKEew4RbZmrhcb24402Izi9FpUJrZhKd7 mciBsvdU85Z2PeMShKr0JL7PWdvyjdWnglgPJZFuqD6SG7D2MNz+Y4KmqSuyXFZR9Uym 4EGV30x1lv35g52FqVwoGZHZOJOtnsOchDx/voZfDg48ePA1AfMGz/6/q1PSidV1UCl/ cYMH328zCMUHt72lKFPnfR++gp3ojqRYU1fgrCLRmO3m2wat0XRGzanLaKrupSvxJXne vjBVtDiVzrUv3UBp/c4lV/Fye6u+AlxaV2Ls6bDRo0X+JrUBBRsCBCpJ70EujkQO9qmN Rn0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2jjmjSyl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ga20si6571669ejb.14.2019.11.11.11.06.56; Mon, 11 Nov 2019 11:07:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2jjmjSyl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729810AbfKKSpA (ORCPT + 99 others); Mon, 11 Nov 2019 13:45:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:36764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729791AbfKKSo4 (ORCPT ); Mon, 11 Nov 2019 13:44:56 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EB54A21655; Mon, 11 Nov 2019 18:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497895; bh=8cqiK5OWDVKqI27nE2mlkiuCSWZaJuzlZyE8jlT9+WU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2jjmjSylIQrsX6DoJCIN8+NYS42Hh2xfHx3ET6lA0HkPQPhwYEgP4Z8RW4uJ6aHIP wjjM+4a1vTOgwoCgiFm+XKxFkXzRLLNlxEMlBhiSMH82iZL72zcT/NsPYz6EIjkJjq +VZ/DPeyqJOk8Ma1ADOuVCVJJ29nXIzm9SKa773M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cristian Birsan , Felipe Balbi , Sasha Levin Subject: [PATCH 4.19 090/125] usb: gadget: udc: atmel: Fix interrupt storm in FIFO mode. Date: Mon, 11 Nov 2019 19:28:49 +0100 Message-Id: <20191111181452.030204106@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cristian Birsan [ Upstream commit ba3a1a915c49cc3023e4ddfc88f21e7514e82aa4 ] Fix interrupt storm generated by endpoints when working in FIFO mode. The TX_COMPLETE interrupt is used only by control endpoints processing. Do not enable it for other types of endpoints. Fixes: 914a3f3b3754 ("USB: add atmel_usba_udc driver") Signed-off-by: Cristian Birsan Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/atmel_usba_udc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 8f267be1745d8..a4ab230335786 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -436,9 +436,11 @@ static void submit_request(struct usba_ep *ep, struct usba_request *req) next_fifo_transaction(ep, req); if (req->last_transaction) { usba_ep_writel(ep, CTL_DIS, USBA_TX_PK_RDY); - usba_ep_writel(ep, CTL_ENB, USBA_TX_COMPLETE); + if (ep_is_control(ep)) + usba_ep_writel(ep, CTL_ENB, USBA_TX_COMPLETE); } else { - usba_ep_writel(ep, CTL_DIS, USBA_TX_COMPLETE); + if (ep_is_control(ep)) + usba_ep_writel(ep, CTL_DIS, USBA_TX_COMPLETE); usba_ep_writel(ep, CTL_ENB, USBA_TX_PK_RDY); } } -- 2.20.1