From patchwork Thu Aug 31 12:48:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 9932139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 544DC60309 for ; Thu, 31 Aug 2017 12:48:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4342E2895F for ; Thu, 31 Aug 2017 12:48:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37A3428962; Thu, 31 Aug 2017 12:48:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C06A52895F for ; Thu, 31 Aug 2017 12:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FG9VNcnLajpWuT0dlo+9AASwNmRnNm67B64J+IKSD3g=; b=SGeS8ZjuowuVWS iIxC2y+FCwUernjTez8NqN4DRhpovcjmxWrnMSx8w7prPzHhOVUyg5hfVyj5vYR8R/0v4oNDyuxsr 0/hbi+Nz8/pQcyTT/Agw6ykYEose5yczT4EnqwdZqNQmKfMrXzGdOJPYezlIlr7YoAD+Ub+7e9tTv Ou3Vpw5rwqeB7urCFJ2+FopTKRGtxHl8wi++vII1qIiW8ymIYJCdrwzzJLRoeH2joYTQTPch6KzFH NN+LKoxN4/YbXRAIGdHDjE7Ql7G1U7H93TbkX+cTPv9+F8r0Vs2h57YzvghKq9ZvrsZcy6NnyiJCS sEiJ7h9BtM2LwazjjMOw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dnOtE-000303-RB; Thu, 31 Aug 2017 12:48:08 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dnOt6-0002xo-OE for linux-arm-kernel@lists.infradead.org; Thu, 31 Aug 2017 12:48:07 +0000 X-IronPort-AV: E=Sophos;i="5.41,453,1498546800"; d="scan'208";a="6451080" Received: from exsmtp03.microchip.com (HELO email.microchip.com) ([198.175.253.49]) by esa4.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 Aug 2017 05:47:39 -0700 Received: from tenerife.corp.atmel.com (10.10.76.4) by chn-sv-exch03.mchp-main.com (10.10.76.49) with Microsoft SMTP Server id 14.3.352.0; Thu, 31 Aug 2017 05:47:38 -0700 From: Nicolas Ferre To: Alexandre Belloni , , , Subject: [PATCH] usb: gadget: udc: atmel: set vbus irqflags explicitly Date: Thu, 31 Aug 2017 14:48:20 +0200 Message-ID: <20170831124820.21423-1-nicolas.ferre@microchip.com> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170831_054800_880193_4145F99D X-CRM114-Status: UNSURE ( 8.95 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris BREZILLON , gregkh@linuxfoundation.org, Nicolas Ferre , linux-kernel@vger.kernel.org, "stable # v4 . 4+" , Quentin Schulz , Ludovic Desroches Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicolas Ferre The driver triggers actions on both edges of the vbus signal. The former PIO controller was triggering IRQs on both falling and rising edges by default. Newer PIO controller don't, so it's better to set it explicitly to IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING. Without this patch we may trigger the connection with host but only on some bouncing signal conditions and thus lose connecting events. Signed-off-by: Nicolas Ferre Cc: stable # v4.4+ --- drivers/usb/gadget/udc/atmel_usba_udc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c index 98d71400f8a1..a884c022df7a 100644 --- a/drivers/usb/gadget/udc/atmel_usba_udc.c +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c @@ -29,6 +29,8 @@ #include #include "atmel_usba_udc.h" +#define USBA_VBUS_IRQFLAGS (IRQF_ONESHOT \ + | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING) #ifdef CONFIG_USB_GADGET_DEBUG_FS #include @@ -2361,7 +2363,7 @@ static int usba_udc_probe(struct platform_device *pdev) IRQ_NOAUTOEN); ret = devm_request_threaded_irq(&pdev->dev, gpio_to_irq(udc->vbus_pin), NULL, - usba_vbus_irq_thread, IRQF_ONESHOT, + usba_vbus_irq_thread, USBA_VBUS_IRQFLAGS, "atmel_usba_udc", udc); if (ret) { udc->vbus_pin = -ENODEV;