From patchwork Tue May 26 11:13:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 6479281 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 35272C0020 for ; Tue, 26 May 2015 11:14:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 583DB205C4 for ; Tue, 26 May 2015 11:14:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABB94205EC for ; Tue, 26 May 2015 11:14:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753076AbbEZLOi (ORCPT ); Tue, 26 May 2015 07:14:38 -0400 Received: from [210.160.252.172] ([210.160.252.172]:7791 "EHLO relmlie1.idc.renesas.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753065AbbEZLOh (ORCPT ); Tue, 26 May 2015 07:14:37 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie1.idc.renesas.com with ESMTP; 26 May 2015 20:13:57 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 150DC4F908; Tue, 26 May 2015 20:13:57 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 111B22806E; Tue, 26 May 2015 20:13:57 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 0AF6F2806D; Tue, 26 May 2015 20:13:57 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id WAK21456; Tue, 26 May 2015 20:13:57 +0900 X-IronPort-AV: E=Sophos;i="5.13,497,1427727600"; d="scan'208";a="188111828" Received: from mail-hk1lp0123.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.123]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 26 May 2015 20:13:56 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost (211.11.155.147) by HK2PR06MB0915.apcprd06.prod.outlook.com (25.162.246.30) with Microsoft SMTP Server (TLS) id 15.1.172.22; Tue, 26 May 2015 11:13:54 +0000 From: Yoshihiro Shimoda To: , CC: , , Yoshihiro Shimoda Subject: [PATCH 1/2] usb: renesas_usbhs: Fix fifo unclear in usbhsf_prepare_pop Date: Tue, 26 May 2015 20:13:42 +0900 Message-ID: <1432638823-3028-2-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1432638823-3028-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1432638823-3028-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.147] X-ClientProxiedBy: KAWPR01CA0034.jpnprd01.prod.outlook.com (25.165.48.144) To HK2PR06MB0915.apcprd06.prod.outlook.com (25.162.246.30) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0915; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520002)(3002001); SRVR:HK2PR06MB0915; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0915; X-Forefront-PRVS: 0588B2BD96 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(199003)(189002)(40100003)(106356001)(105586002)(19580405001)(19580395003)(42382002)(5001860100001)(76506005)(33646002)(68736005)(5001830100001)(122386002)(62966003)(5001960100002)(36756003)(46102003)(189998001)(2950100001)(107886002)(4001540100001)(229853001)(5001770100001)(97736004)(78352002)(77156002)(81156007)(48376002)(50226001)(47776003)(66066001)(64706001)(76176999)(50986999)(101416001)(50466002)(42186005)(87976001)(92566002)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0915; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:0; LANG:en; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2015 11:13:54.8004 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0915 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kazuya Mizuguchi This patch fixes an issue for control write. When usbhsf_prepare_pop() is called after this driver called a gadget setup function, this controller doesn't receive the control write data. So, this patch adds a code to clear the fifo for control write in usbhsf_prepare_pop(). Signed-off-by: Kazuya Mizuguchi Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/fifo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index bc23b4a..0bad84e 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -611,6 +611,8 @@ struct usbhs_pkt_handle usbhs_fifo_pio_push_handler = { static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) { struct usbhs_pipe *pipe = pkt->pipe; + struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); + struct usbhs_fifo *fifo = usbhsf_get_cfifo(priv); if (usbhs_pipe_is_busy(pipe)) return 0; @@ -624,6 +626,9 @@ static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done) usbhs_pipe_data_sequence(pipe, pkt->sequence); pkt->sequence = -1; /* -1 sequence will be ignored */ + if (usbhs_pipe_is_dcp(pipe)) + usbhsf_fifo_clear(pipe, fifo); + usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length); usbhs_pipe_enable(pipe); usbhs_pipe_running(pipe, 1);