From patchwork Wed Apr 26 11:50:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 9701271 X-Patchwork-Delegate: geert@linux-m68k.org 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 A38C8603F4 for ; Wed, 26 Apr 2017 11:52:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9173828468 for ; Wed, 26 Apr 2017 11:52:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86672284EA; Wed, 26 Apr 2017 11:52:49 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53CB328468 for ; Wed, 26 Apr 2017 11:52:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1949402AbdDZLwr (ORCPT ); Wed, 26 Apr 2017 07:52:47 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:17996 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1949594AbdDZLwh (ORCPT ); Wed, 26 Apr 2017 07:52:37 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie4.idc.renesas.com with ESMTP; 26 Apr 2017 20:52:35 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 2880A7164F; Wed, 26 Apr 2017 20:52:35 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.37,254,1488812400"; d="scan'208";a="240959737" Received: from mail-hk2apc01lp0209.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.209]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 26 Apr 2017 20:52:34 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=arpMdI0ji8EmypKPpfJ/nHUUXky2sjmsBnq04RB4KEE=; b=Q7EdbqW1Mq3snVGgKVDYB6Cy2YCXuRWrFbTiIToQmAsJlv+Mkqpv2AA25QwYzuDkmNppgmWIy0vG7SPsO0f3vD/2ID27FYtFMW70amkmcyEm6oFUvzoqhjxP7IWuyx1a/CodpV27hi6P/cjJACisEX1pSQFHr3bI7nW02fiJgMA= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from localhost.localdomain (211.11.155.144) by HK2PR06MB1683.apcprd06.prod.outlook.com (10.167.73.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Wed, 26 Apr 2017 11:52:33 +0000 From: Yoshihiro Shimoda To: CC: , , , Yoshihiro Shimoda Subject: [PATCH 4/5] usb: gadget: udc: renesas_usb3: Fix PN_INT_ENA disabling timing Date: Wed, 26 Apr 2017 20:50:10 +0900 Message-ID: <1493207411-24416-5-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493207411-24416-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1493207411-24416-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0039.jpnprd01.prod.outlook.com (10.164.161.149) To HK2PR06MB1683.apcprd06.prod.outlook.com (10.167.73.9) X-MS-Office365-Filtering-Correlation-Id: c0c88539-8eff-434f-6f5b-08d48c9aba1c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:HK2PR06MB1683; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1683; 3:ZJQaljU693P8RS38zHELB/DpdSmmtDp6d9wyVNzRdlPGqQ1AgVaRMLo4Wj2SkR2TmyBCJvJqW4q54JBwbuckTGZgXOugUvirfQgl1dHw6wxx9O0oHGfCvcj3PE2fLCnw+vhQWIZM9xDGImvNi9nJffYi6aC+PNgQBA1Jq+8WgDNrvd05koBt9niv2KNpeCoGjsqZvgLnyxpjFSvjHG/yifNSyNodZhZWn1IEBKIBx5M+ZZqYD5oc5Hyb9bm4EQJ7XJ8wRT+t3Jp9dUU06w16u6tLom5a8snCWyt5EtjBsiAox55VaV7CPdt8gBOAGzNAIOUzfibl+XYkQCy0lSqWt5nMTkY7qsuV2v3xGhKG70c=; 25:OFJfIv9Rqx6jymc/M2NILWjd+ralxrET79XS/3nVKgutjqWn3oxl4+4Xh/V6r7xXIzkWQBBtQE4MY7Z+/Ap4vdWiP69o562XgMYd6zTFu8AzeYBxSSuMokJcIJ+f5SVNBfdRgbi9WsAQXbNGkyJ1spge1hz74TQJlvs00YuRw/fDYr97C9Zom8ED/+UbDnDXUWpw1Y7YSAz3kvPS6IHhF4qpvFfldWafpOG4tD9wW+yKUDQqSqCvODjp0h2yxjWDnmj4qRJvjItKHxGn2OocMKwhoRN0NLbydTW+h2Lasc8BeJJbYj3yDKwNi5sCD8BXlsCDPFFmJlYcE4c0kDdm2OnNTHjM8DKeSumGn3/796maraa4e8dNiRXV8M18laBHI40QkCyfe/rjB6+wJhQFgUIVe8QCr67XDUVlhfpU+KAI5ifkgF1/ws0ePUFF3FGOOY+vVBa+94QzLU2AHZcQVw== X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1683; 31:CCtl/R2q9Vah//tRi7FFQo3M+4tMwyjna3Wus4dQ6zAI03umVhgMQ3RtZmwb60H6A6mScsEkCHITFJYx4MzPx5rh30t85VX4DfIcyiNmAYKC57N4If1GieVMUmzZ7/Pu/tx47pnog4Ad70u5aDfeWhGcJFQV6hIyZaXBfiyUtCYHeKcsyzgNr2nbu1AFh/4oiuNDWnGEcqk5z6MaDeFOfF+D9JR1mNh7QtwJ6c50kJg=; 20:eQL+WA+hUE4W6sjz+UI01iGMyLkgUwoW1KVC8ShExeta63TsVuU7VLrfrqXBl/+wIxPXETkp4wViCmyM2s93bdVsITylS91p8veEP2egwOW3YzOsVi2p90SVsh0t4ZntjUD7xZ4C48K1iMIEoJav6DqhDYxDr7YpgDKoCfjr0Q59t9GkpzqwA18K6k1zxGLzHW+iWfjnVlF5oUUWAzSokScBvU7/JpSZ/oXQs72nxC7f1qnNxyPZnMEeVkRrez6GnXn8skB+xR0ttO+YoeWIn1oSPDRJjrfGQ3dX14PeATlxQZdu5ms9PFFydaFMoXj31zZzE/q/b8Yyz9J9AhuJ3+cRa0ljvh3fl/W3mn5pfRA1xvwjDpRG9MV4ihxLgXy6Zqc/2SO+3sviZwRMMLKT23rn1vmA0KaofpgIOj/8FrOwckeNHVcszHC3B3JxVxKk1CEuQwEL2bAr9wMRJTouPamMt+Cw5clyRD+Eq80C327J14fnuKx7Fi+u6fndexCv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061750153)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(6072148); SRVR:HK2PR06MB1683; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB1683; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1683; 4:7q1OF4ew89iUYDUcI3VanSrcUmHbazFofCr1Ux1Yw3BpuoK2tMi0mK8wZzW2rvu1+QV+laHTI5mvcPkBjuewYEPfgTQowA27ZMydjU0z+6MMQXPJXT3wDXEAibjs6dgsZhVrT6iFi8dE8ybZZFXL/CgqCQQmzhUNjxC3MdsT5Gf5E27hIBUDr4scEzuEEr8ye3VQSolJPcM0RcuKtFr//IUfba6zDoT2wHj3c/pSzTJc3dtC98IZ4pX8QmXYUU0nnGGm+IYPyfLoobdE5qdgC0VKXVVA1a9z0EvJKsZJRa1y6Sd+9jf9RtyhfRCx4Kf5lBgMGeKwYD91Zj/0ZokxL5iTFV8Hq6PHfvDOZgA3u2dANTqlSfWAyTJ0NMRbXFN+gwCdiLjFM+3G2t8+J9MgrUXX71CXhHH77NIrHNxm0orkZ7ndHYU5AB8cMiZWOHrkCjS7HlNRd//PJIMA+NCjoQyVJbSVKoa7Py4PN2Dkgy5Y3UEhxhheewO3fCDtN5rrRfPsxtdgQIebDT4s2LAkCBMAz3KACNw9CVE0PouwpVol1jAPZ66s2o2kyiu7rD8p6ZcccdmHUGq2r/7DKJ4hZUJ4uEDYWLeG3tg9B1+VjhlAKpJSuQ8zJhgiJ3lF3rsAG1SYYREwDZLB4FNEpQMKxFBrxO9LpUQpgvlZCdpPMAstV2k7/hhfNk1/AG7CjuBs1o8qV2ANYrV1/b1wHXR1QQbTgSujxVpme/o7NF79M81j7dpnyZ4/GedKPlFb/vO7o92W8hUvyhvYrE3hRm4OmMRSB1zDkp6KMmpxEfoq7tI= X-Forefront-PRVS: 0289B6431E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(39850400002)(39450400003)(39860400002)(39410400002)(39400400002)(39840400002)(54906002)(6512007)(53936002)(189998001)(42186005)(2351001)(2906002)(38730400002)(50986999)(76176999)(33646002)(66066001)(6506006)(6486002)(6666003)(107886003)(2950100002)(6916009)(42882006)(110136004)(4326008)(47776003)(25786009)(36756003)(78352004)(5003940100001)(5660300001)(305945005)(7736002)(3846002)(6116002)(50466002)(8676002)(81166006)(50226002)(48376002); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB1683; H:localhost.localdomain; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB1683; 23:y19NScrp6eUVPOh1JToinkpE5eYDH0rcyzlOhD66v?= =?us-ascii?Q?co4DCzQLmfSZ0KjckVLYJRoZzt3PrYsroXaAURU68aNo4nA+qQcH18VgGeZU?= =?us-ascii?Q?aHWtjyyba3i0MX87rA4zJ/FsDInWI1qkyNg2wMErocIUBKH42n+ZKr38SBIT?= =?us-ascii?Q?0PXHxGcaMtp3tyb7DitJMw/9jG8krPjEK0YvPZuG4lB9ybj1alxP1mztjReH?= =?us-ascii?Q?BN9fNEgtDBQUDqPYXyyNOW/5aeoJBRZ6/tJSkvHiks1ONF3G1CN6dBP+7Tn1?= =?us-ascii?Q?WctK5wJywngn9+SBqbddI1HPQO+6JiFgEg++URkov1a8F20uwQbDKsc0d8HH?= =?us-ascii?Q?NTdP/3H/wGeUw66riUuEUZXiSRphEVyZ0prpTRW+z+2PFRviYWPlTJQwPxhT?= =?us-ascii?Q?wE2WgKobHtUsL3tJLO4XmPjKMindIoZobHBTs/nClVpOGzS+iIqGsMkUc9kK?= =?us-ascii?Q?/AHRkyKsFN0q3anhAA6c2SijGYMPYjnYFrhDqYhhVUtRWJ2SZkBVtYnobGvC?= =?us-ascii?Q?juq0KNooxhrPyf7JGYkCadSjF7uTy1e7v839ljcbOcRaiOPZ0sgIB8P/If48?= =?us-ascii?Q?xq0+oW6a1BwfzEmPUI9XExXp5DSJE2jVCkUTSF3R1Rtl7zRdOr5iUx8JFSXB?= =?us-ascii?Q?Mi9dxvDIL3Czqyy3yK/JYte97RcCzExdwALgkk0ff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RgiKpKinrXF7wRYvwbueurdar4tQsWHMX5hv34C9+Upbru+PclTrL/dJhL9EgO8Dd2Qwaf/VzheTFZrT6M7LiSagYhrHyj+lJt+b9W9zBvQl1Q12oITedmsC67k03aWtLUBVRs17OkyInAUlGzstC0nv1F5A==; 5:+u8vXB6y9IJpzucDNLfz0UYoO8Levg6pX5p03zqcdGY6FVD/hF4EPiCWcNhY6CWIpGUumym6jzTaC/CRNmTm8G9eupKmS4IfvBa8BjnauHbS1T4a0KBBJmBgrDD8s4pVfGeBLGp1qRlVnug3tsAAyQ==; 24:VxL4d5nr9qJ0YM7y6SyhdS+v54H392wyHxxGBhm5HaFpmFBbC2TnqdXyhDGATkfrbecG3+QQ+Kn06cWvS2qBVqMSMBgWskLg5c4ebc3tbUE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1683; 7:8/ofUMgWh4BsMyVCthZzf7baf5LFwNriMI/yNq5IzMbYJUD/OODMHSCUG4G5EY5FPlEuGWPSuvv7hujZecTZZASEjAn3evMiVjTqOQKz9rF6Hh/HM4qwqqo7cj7DW8IalfBFLb0bM6g4DEMTlIa4agR49UoYNqo1yUY7j1hPjNGr+heKT2It0CLFwA+n6sLDy+LKouhZQ3/SpkLe/eJazuVv35wmdqXYtuKL0HXs+MfIFefqdSUt6bNtsZMPgpFsZjNC+2RwNfDv8f9x+AjRRKmrdjpi1dmzuzd5n+7sTgA4Zmwh+alVNZnR46VFepmyKNDcaL9Fcl5/HMIBqOaifQ==; 20:QLIgYV8tvVVJTzN4qzKBFrhnQbDK/NZ6SuPXJ7XSMhRsPu+OTm+4bPzIIfDESg4O4E23PB4BJcQF+yBeojz1CMSgce7FvWfMCsbH0iwLHDYAUC0R0OjINIb+7Ev9m/bMtKcWdNf6vIUd/xMB/FaBQH/JEMPZG7hAjSpRadlu67A= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2017 11:52:33.6047 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1683 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The PN_INT_ENA register should be used after usb3_pn_change() is called. So, this patch moves the access from renesas_usb3_stop_controller() to usb3_disable_pipe_n(). Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller") Signed-off-by: Yoshihiro Shimoda --- drivers/usb/gadget/udc/renesas_usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index c05097b..cd4c885 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -623,7 +623,6 @@ static void renesas_usb3_stop_controller(struct renesas_usb3 *usb3) { usb3_disconnect(usb3); usb3_write(usb3, 0, USB3_P0_INT_ENA); - usb3_write(usb3, 0, USB3_PN_INT_ENA); usb3_write(usb3, 0, USB3_USB_OTG_INT_ENA); usb3_write(usb3, 0, USB3_USB_INT_ENA_1); usb3_write(usb3, 0, USB3_USB_INT_ENA_2); @@ -1682,6 +1681,7 @@ static int usb3_disable_pipe_n(struct renesas_usb3_ep *usb3_ep) spin_lock_irqsave(&usb3->lock, flags); if (!usb3_pn_change(usb3, usb3_ep->num)) { + usb3_write(usb3, 0, USB3_PN_INT_ENA); usb3_write(usb3, 0, USB3_PN_RAMMAP); usb3_clear_bit(usb3, PN_CON_EN, USB3_PN_CON); }