From patchwork Mon Aug 8 12:50:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 9268261 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 A8A3B60754 for ; Mon, 8 Aug 2016 12:54:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9ADEB283E4 for ; Mon, 8 Aug 2016 12:54:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F8C4283EC; Mon, 8 Aug 2016 12:54:41 +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 27FAB283E4 for ; Mon, 8 Aug 2016 12:54:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752107AbcHHMyj (ORCPT ); Mon, 8 Aug 2016 08:54:39 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:34935 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752020AbcHHMyc (ORCPT ); Mon, 8 Aug 2016 08:54:32 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie1.idc.renesas.com with ESMTP; 08 Aug 2016 21:54:30 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 9A22744165; Mon, 8 Aug 2016 21:54:30 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 7DA54480A4; Mon, 8 Aug 2016 21:54:30 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 76FEB48014; Mon, 8 Aug 2016 21:54:30 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id XAE29685; Mon, 8 Aug 2016 21:54:30 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="216948987" Received: from mail-sg2apc01lp0244.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.244]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 08 Aug 2016 21:54:29 +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=fM+lc4yB8IwL5Vyz+fHk91TODVQhW6tQ0MQb6fIR/so=; b=bPAD3b9EvWvsfhfwrwQvJ/tp4iHR9oCaXVDKKoxrGluFLDXUNiT4G6uU9bSQxkhObDOUEf+MLFIqxXtzgvqp/o5Twzz6EJDFsN0ycm+XX1P5iy9+xXLOQiA3OAQh0LbWTtjZl4kSBYFyx0G14CibbtKp3y2Rad3CNqk+L83B5cA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by HK2PR06MB0548.apcprd06.prod.outlook.com (10.161.183.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Mon, 8 Aug 2016 12:54:25 +0000 From: Yoshihiro Shimoda To: CC: , , , , "Yoshihiro Shimoda" Subject: [PATCH 2/3] usb: renesas_usbhs: clear the BRDYSTS in usbhsg_ep_enable() Date: Mon, 8 Aug 2016 21:50:52 +0900 Message-ID: <1470660653-21743-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470660653-21743-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1470660653-21743-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0025.jpnprd01.prod.outlook.com (10.161.131.163) To HK2PR06MB0548.apcprd06.prod.outlook.com (10.161.183.153) X-MS-Office365-Filtering-Correlation-Id: 5860797c-8d21-4df6-9d13-08d3bf8b20dc X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 2:KIzhNF2upD0SVc8vBR/i4zJlouiFM2LssIkMYDgy3a/ufOzWsJnvpWkmJGULij6tcwQiZLNGxuEF+IauY7MF84vLHNSO3rM3UznRABCF5HmVdkFSwRd9xegwq12Z+N+hRHPb+JUMnDU9zE65QG7yhv/Nn31RZjkgYuparUoFEoZ3KjS9cr8KU5uI28Lp2ZfF; 3:s0lBewRhQHqx0Kgz6dOIELkDfBJESmHP18GNABtQ3PGDZsGPJsXa1tgyatz3pGjXpAceq+NvKiTUqnhfkO/z5NrQaEjZpNkVJ0+39iuDJu+tR1Eil4IKPToA4p6fZvb9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0548; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 25:B6FIXihObwtBAzvAtca7inFJq4LvTajPaNXyf0Ho1lU5B4ieCJGhiazC1Dhp1ZkD2Y+MMVjY1XO0DR2e9GO+XlHXn+qjr5wtqK7ONqQWLMyObcFXJwsa8izG8rKJ28Dmt5BmBpe7TLET5VVQyMFayFvFo2IgThmLoU8tA5SPBTLzfUHD1fP/uk06Ak1QIFpuSXVbnciQsF4ynahHGaEX+79MXUeNxr7wKsZXbKycn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oWPlbUSNZjLMKELHCJ6uh6kj4lOxp2B5zxZNTdNDr3ouH8vRVuCSzTLg7okKRnbPksRAKQhvI/F1L3jiPZP04KyDnQki1UiADrTuBYMGLZjK/HWzKNCP0KwUx5jThLKmiNyTd73b4fiVSB2uBYJ2NuTGkPykb4kRZci2C51FI3yMPIuO2nW7x8fjyrbMtc2CRu2ejPHs1idK3uk9up/fLmC9GtFMka3tqat9LAtEXep/YIe4aV+YrWqhqVrjgKXN+6V68Rccia156bkb7mK7Bs9x X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:HK2PR06MB0548; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0548; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 4:2/3RRdWAdzYeAjrWN+88QsWv5wxVsZ/ivAMoRAdbLTrMXoiVq7Wkuh/TtENtBX8pRIPN0iKbzDTlp6eaVCaKrT6i37Qv3A7ZsXRt9bKG+w++CDOWRPgJCLMh0eJW5raT5EVOWDr9TvA2qRycrwqMJac3rx6TJwW1bNqr8R5y2ORRdPCfg9m4OBZO7AvTwf3z3UPX9S8cuE/FV/HNxevBr5SSo2COYJgyNfPpl2mfblK4RcNuudcn+0x0stNUczizmCLg2yBmYBTbUadBGF6W4How61P9W97kPtzPJnFuoSz6Y884xw2UfQxdkxkylnYQJw8dFe9igPJnMw2H3zZW5fWK4JsJy45gIAST7Z2H+PMSRyNmIqgZ4UHWIhrhN/o/WcWD/ANditvkAD3E5UJA0kAWaf2yAxHxlWhvMWXDtONo3KRieI92+VruUtl2ZLzp X-Forefront-PRVS: 00286C0CA6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(106356001)(77096005)(8676002)(2351001)(42186005)(5003940100001)(66066001)(33646002)(586003)(50226002)(4326007)(2950100001)(107886002)(105586002)(92566002)(81166006)(4001430100002)(81156014)(19580395003)(229853001)(19580405001)(110136002)(7846002)(7736002)(78352004)(47776003)(50986999)(76176999)(189998001)(2906002)(48376002)(50466002)(36756003)(6116002)(3846002)(68736007)(305945005)(97736004)(101416001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0548; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB0548; 23:ObYfGjMORzXwHa08tJKUdxbPmKeggPxqmIpjl05wl?= =?us-ascii?Q?akzn7daHbdLwba1COq4wOq5JNFTldVVzlcV4XmTwEZYj90d1vvIZDumALrJu?= =?us-ascii?Q?Qp9B6fR5jPaNwMuCc9y2bQpzHYVxgqdUkEE7HR7A4WivWZApknerJFKJXD5w?= =?us-ascii?Q?xX+o19vMwnqEUSRwvU/HnbZgc6g/XYE2eeZ+m9LkjldhWV2yu7EpHZaKV+QJ?= =?us-ascii?Q?0X1dGZeu1gLi9/DoeQrkGc9YYs+W4C2ycHQb6ehC3BP8yJqa06Ln4DWhBeis?= =?us-ascii?Q?/rZJnybMv1lyF/eY6ZEo/aVTiiiLcdQuf4FT2sA4MhpLQarIRa1+dlVHn8nX?= =?us-ascii?Q?HDGy+b6n2YuV+Tx8Hx0ZjDoO5MgzUzbIlmMCyfBn/I65OUajwfKBFQHr1Ben?= =?us-ascii?Q?hkkbTR1OsKMjUWH9Ui1CNymtVhEzxZr10yqdH6NvOpOO20uZFJad6Hq4teR2?= =?us-ascii?Q?YiObq9knnWi08buFJYO4kBPDvdocsPotctvLcDlpvlqMD1nf/XI0mjGqBf4U?= =?us-ascii?Q?BHcb90GIstMm4yoT9GduapGu5Q0HGs3FdDdMBDfppf4ZI4KmOGY9mD5ES6uB?= =?us-ascii?Q?YbYcIi/FwiUGWruivwt6uG1C6LVBq6WRQL+JP5qseBeT8bUBoTY1I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LzBIZgU1Gis1C5SVu80PQcmaDfpOw0h79d53cIctyITK9S6d/dCP7gNArkqkVWpXREQ5EJHm/4Fh2Uy07/UmSxXCQQUNGYEW9Vr8KnL33LJgQ==; 24:tQfngAY3MOoKDMHySlE7mqF/reJCo79YnHpvGTbvQ46Pcn8krXo81Jq2RTtOKDlgujIGJ6QjIcrcHUJgQvR9Vc+sKGl4jBqlbCb2YS/Bo8A=; 7:sJVjJbS0YjO4AvSc/ZSbSd8FIqJ+Ap+8+myrOd1G6Yaf5pGc6r8iQiHaDZ19DGZmAQfL0fLqE+MLgu7KaxOb2AENwqbByKTDPcCW3WElOO0A+k6b6uKFizdNSm/d5M1v4xEJXBBhr41Beatb2GWkHIkT1oaWcLjX31TciVnsBqfXrfhO52PQ33fI8eyATj3hdSUPg/VI8udrbItaT5GGni1KMsywh/yu0wEZSOq8mSq+HSwwWQI6wnLTw9n31JMB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 20:EC8eKRRo6gXZpV9ciXk+YcGhMvld0Awm1TW9ApLbxk0yMt6PcQw3t/rtf89xdKJ/4u9GED4dTDE0hLL6nQT+W74BrggY8vIfDOqxLViCkHBZZtB03BJnyCV0GE7AqO7Q7JOnmrPZ6n78TckWwbCDE+mhB43eqNvHkZArVewqIuY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2016 12:54:25.7376 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0548 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 This patch fixes an issue that unexpected BRDY interruption happens when the usb_ep_{enable,disable}() are called with different direction. In this case, the driver will cause the following message: renesas_usbhs e6590000.usb: irq_ready run_error 1 : -16 This issue causes the followings: 1) A pipe is enabled as transmission 2) The pipe sent a data 3) The pipe is disabled and re-enabled as reception. 4) The pipe got a queue Since the driver doesn't clear the BRDYSTS flags after 2) above, the issue happens. If we add such clearing the flags into the driver, the code will become complicate. So, this patch clears the BRDYSTS flag of reception in usbhsg_ep_enable() to avoid complicate. Cc: # v4.1+ (usbhs_xxxsts_clear() is needed) Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/mod_gadget.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 50f3363..92bc83b 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -617,10 +617,13 @@ static int usbhsg_ep_enable(struct usb_ep *ep, * use dmaengine if possible. * It will use pio handler if impossible. */ - if (usb_endpoint_dir_in(desc)) + if (usb_endpoint_dir_in(desc)) { pipe->handler = &usbhs_fifo_dma_push_handler; - else + } else { pipe->handler = &usbhs_fifo_dma_pop_handler; + usbhs_xxxsts_clear(priv, BRDYSTS, + usbhs_pipe_number(pipe)); + } ret = 0; }