From patchwork Thu Aug 31 12:51:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 9932141 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 BFB0760309 for ; Thu, 31 Aug 2017 12:51:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFFF328961 for ; Thu, 31 Aug 2017 12:51:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3E5628963; Thu, 31 Aug 2017 12:51:30 +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 1B8EF28961 for ; Thu, 31 Aug 2017 12:51:29 +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:References:In-Reply-To: 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: List-Owner; bh=08TWyRkpG7Y6hzStzOttEoHN8PFWb3+EC1EPXN+5Gd0=; b=sDs9cB9+XKjp5X N8cFT4yeZVgC1IgL+e8x6OXAxTYWldJRHQDxN2TSHYKq6HQ3LIebWWiMrwr0EiJBLnXeYcr0TZcg6 w0wWt+W9up6qQ8hvlJdnylyluZ56fhlebNqoFERVzRuD4/j1VC/FyppzW6MFGXb+qBRFl4CXSBr3B TZwrVeTbZfKX7Jv8Kl+y2zfn3slyIjfyRh+wY5TbznV0EXyJlHtVkaqfxdXhGKL/vxKqwJ7g0lkJI X19wvc3HtEtMYGZIOIb+AeS9sZij6LD6rC6U2qki9+5XsgwNs9DXP7W4YlDsaN5bTe6xHAv6p3OmG ooq+qFt87OYWuOC952AQ==; 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 1dnOwN-0004cO-7c; Thu, 31 Aug 2017 12:51:23 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dnOwK-0004ao-JZ for linux-arm-kernel@lists.infradead.org; Thu, 31 Aug 2017 12:51:22 +0000 X-IronPort-AV: E=Sophos;i="5.41,453,1498546800"; d="scan'208";a="4315438" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 Aug 2017 05:51:00 -0700 Received: from tenerife.corp.atmel.com (10.10.76.4) by chn-sv-exch04.mchp-main.com (10.10.76.105) with Microsoft SMTP Server id 14.3.352.0; Thu, 31 Aug 2017 05:50:59 -0700 From: Nicolas Ferre To: Alexandre Belloni , , , Subject: [PATCH RESEND new email address] usb: gadget: udc: atmel: set vbus irqflags explicitly Date: Thu, 31 Aug 2017 14:51:40 +0200 Message-ID: <20170831125140.21600-1-nicolas.ferre@microchip.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170831124820.21423-1-nicolas.ferre@microchip.com> References: <20170831124820.21423-1-nicolas.ferre@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170831_055120_701331_1DB3D96E X-CRM114-Status: UNSURE ( 8.72 ) 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, "stable # v4 . 4+" , linux-kernel@vger.kernel.org, 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 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+ Acked-by: Ludovic Desroches --- 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;