Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1155443ybp; Fri, 4 Oct 2019 10:17:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWCpLfYsQYlmQcr7D168nx2Iti+m7TLFTtebDIk/Oy7BhZvTCEh/kK5oxyNVLAmsqbR1+l X-Received: by 2002:a17:906:4a5a:: with SMTP id a26mr13477570ejv.154.1570209473717; Fri, 04 Oct 2019 10:17:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570209473; cv=none; d=google.com; s=arc-20160816; b=mt0RuZN1FxXLheCFPWE2fOcL+ur1JAPRwusWwD0Sl/OhpqZ4k0TzsTKw96PCn3JQq0 I+6g4oBwOV3+nX2aNVii/AU67dOMLbpyWGQk1JHaD2qc5Cy73X0Dd2+0HtoHNoJhwQHO 7Z/ingjSdn/AEC95lK82FULMy4ACjShJkK9SSS4poaQkL81XDn1nP1/NwYQwQ6RykfBC 5XMLuVhXk8i80dfjtjLYrbChxjlKA7+N/LJtTapYbDp6WYnvy0w5wnIK6XGS08Jgw8hc +kWkjeHpCyG05qAcyoE2DxIpiy5UPs8GrNk5uz/D19D+Jzv1lt9JxZW2Glk3OgREPMnG ZtOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:ironport-sdr; bh=Ypnf8INPE2SQoWdaZOlIq3oskaQrdBYlH2zP7DeOPaw=; b=yTh6s2XqSP+eUUnJH8jYyKKtfvsnMVbAe9XwgAkZ9fA66kelzL7Ek6qK3toJlQ9KfH f8xPbyAR3L2PAjqyLcgyhJakjv1pSh2zg2nQ32WnpwghJDRFSWiFHT/ARJzvhn1IZduE vk3u9yFzwGq3i+lgVhon+8C6ppOX7IKZ3Xi4lHEigcvxJiH6pscWziqiAB08f46urWq8 5J7ybb2jvrrZBdzY9s8CDHQjXgeZ9hPUYxtbriJqyAQIwYbehjVxLrQ/qGYWt2swhdSq 7qB9/0C5znDH3PAHAiDQ0H3LOOIcynfL4BIMZktlkUaKHcf4w+b+cXCxCLAmNmziqH+f w0qA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si4225907edf.6.2019.10.04.10.17.29; Fri, 04 Oct 2019 10:17:53 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387840AbfJDRQg (ORCPT + 99 others); Fri, 4 Oct 2019 13:16:36 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:45382 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387534AbfJDRQf (ORCPT ); Fri, 4 Oct 2019 13:16:35 -0400 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Cristian.Birsan@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Cristian.Birsan@microchip.com"; x-sender="Cristian.Birsan@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Cristian.Birsan@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=Cristian.Birsan@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: d0aGSb/7YfeQDRGpZ7qzkTUS57vxpPVB6jYd3meyu/pZo8VLdozIGUweKW5KZWVZyssXSDeit2 EYPsBzzdb6xtBxWdGjr4H/5cciq4G9UBq4c8AHnd8MTGVuGdDj2bMF4MZOPwm95WqTyNBzfD8x PU9uOmFyBrxEd11g2qB/i1Mm6pcdv/r6iGTrj8WEgB7O1uKVPuKD3m+XYNkWtJlwstjGJ5zgI/ L8SlIHo1VUgNSRGrJ+LU+MY51d7cRpE6JTQP2UHWIe7tf6SmXuTsTiXdo1RJAW1cCKp8N00wyp JXY= X-IronPort-AV: E=Sophos;i="5.67,257,1566889200"; d="scan'208";a="50474067" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Oct 2019 10:16:34 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 4 Oct 2019 10:16:34 -0700 Received: from cristi-W530.mchp-main.com (10.10.85.251) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Fri, 4 Oct 2019 10:16:30 -0700 From: To: , , , , CC: , , , Cristian Birsan Subject: [PATCH] usb: gadget: udc: atmel: Fix interrupt storm in FIFO mode. Date: Fri, 4 Oct 2019 20:10:54 +0300 Message-ID: <20191004171054.19453-1-cristian.birsan@microchip.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cristian Birsan 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 --- 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 86ffc8307864..1d0d8952a74b 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -449,9 +449,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.17.1