From patchwork Wed Jul 29 02:42:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 6888991 Return-Path: X-Original-To: patchwork-linux-arm@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 AC182C05AC for ; Wed, 29 Jul 2015 03:54:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0B19207B3 for ; Wed, 29 Jul 2015 03:54:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B79E4207B0 for ; Wed, 29 Jul 2015 03:54:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKIQD-0006EI-3m; Wed, 29 Jul 2015 03:52:49 +0000 Received: from mail-bn1bon0147.outbound.protection.outlook.com ([157.56.111.147] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZKIPz-00069s-Op for linux-arm-kernel@lists.infradead.org; Wed, 29 Jul 2015 03:52:36 +0000 Received: from BY2PR03CA011.namprd03.prod.outlook.com (10.255.93.28) by DM2PR0301MB0864.namprd03.prod.outlook.com (10.160.215.15) with Microsoft SMTP Server (TLS) id 15.1.219.17; Wed, 29 Jul 2015 03:52:13 +0000 Received: from BY2FFO11FD051.protection.gbl (10.255.93.4) by BY2PR03CA011.outlook.office365.com (10.255.93.28) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Wed, 29 Jul 2015 03:52:13 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD051.mail.protection.outlook.com (10.1.15.188) with Microsoft SMTP Server (TLS) id 15.1.231.11 via Frontend Transport; Wed, 29 Jul 2015 03:52:13 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t6T3q5pN011896; Tue, 28 Jul 2015 20:52:10 -0700 From: Peter Chen To: , Subject: [PATCH 01/10] usb: chipidea: udc: zero-length packet is only needed for TX Date: Wed, 29 Jul 2015 10:42:05 +0800 Message-ID: <1438137734-27311-2-git-send-email-peter.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438137734-27311-1-git-send-email-peter.chen@freescale.com> References: <1438137734-27311-1-git-send-email-peter.chen@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD051; 1:1cwnDYGZlJMeEwTZ1sUAMPzYVIkbBTHwj436UH+9tiw33eT9s7TqUoz7IgeNaAnUd7VY30dWKQUUX+Gf1Hgl8nQPO6bB0uZSc4qmXUWt8ya5CStY/pgPtEbStd7Dv3qS5j7KMNSqeJ/IQf1ivl2zbzAcS26BdlY5l8Bc6l+PgM+6PyDCsk+t0lmHG59TF2qpdBAyv7iBINqprE1qdF9fHYqZwuiv9qd7zNOOLNPH3I8qxiH5V6JfPIIAE/5XtxdopufGzyGlKQIPmT59ikepwpYQrQZsH8PKqiI/ymHi1voAxAJB4K+6/vIzCGkf0Ksgb1EffynchZ3969UmBDh/sQ== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(22813001)(189002)(199003)(87936001)(50466002)(107886002)(105606002)(48376002)(92566002)(46102003)(86362001)(50986999)(106466001)(76176999)(189998001)(50226001)(104016003)(5001960100002)(229853001)(33646002)(77096005)(47776003)(62966003)(6806004)(19580405001)(77156002)(36756003)(85426001)(2950100001)(19580395003)(5001920100001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB0864; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0864; 2:20ahx1xFOse4LxfZolj4w00lD7XFGj4oJKeBhg5WlgED2CphAKb48TC4X8uiSGR9; 3:pCKBob7itQsrFIViLIT5cPaETqHTSCQNP3aPd4N151Gltpq9YQJrbxB/tmTxYul0KgwccQxvcdhTSSGOi884CEjcRjB93bgPcccAuMgqQrNnSW0m/1IL7qNhz7T/BkaSRKEdljkgITCeA3R3RRk5n+tlncjHQsLM2KC2DceOeMXC7E4FNOXOh8JG65+bR4hsatWENeAQl2X1cMPXr+Yaz4u/iSLp8jFoZaw82mmBw/4=; 25:Yn6NnwGY39jAbfLXuZHsodCOdP00LrGVb9fHABN1xP8qn5xOiVLZFbzeo3FXK7r+BGIaDcoVWjFqz/rkdGRW9ghIT3I/lJduwq2l0gERwa8D3YsAT03laRiLz/pKiQsM+Po/mDbzhFok0kEnWLJn4XcZkHuI2OsQHTzjSoaJZw1F2d2WwNJnPacXh6vYA6DCwqrjSivi2zuH3lIk+bRTEgDelcVgGG1y7B8ba+ljhW8KBAJ11e6mTwpaQLv2a1gM; 20:Wa3Tmy+SAyIcZUnERN9Fujbv9AtTgWF7rCblD/u4aqbtZG8cb9ax0gR/Noh+tCFTYxm6U8oVeleaGlWekzjFBgEdjgCMbQznbupfg2qeHoWN82ckZ7NG4F9FAMJthsS8Uxa9vqeBnQehxG4b10C6Q4hZjQpXf1IGBBx3YDyLrBNfxpSb1QEzSXL09Od+o213aP/djV5UjHGfPWXGhMAtx17InzrULrwkiC6P3Cel9xYS/7Q4RKqhxtwVu57jAOMTKk3XTRibYvTn6ONolWhn92Tbz0Rk8AMtQKzHjvxyzre2JahpIaYqfeVRwQBjioEjY5JxOsnnmss37dRePNh//FP26ue56QUGqqHkSHxFHqU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0864; DM2PR0301MB0864: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR0301MB0864; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB0864; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0864; 4:jZiEOdR47wh+Mz1gODH9sT9PikoX7w7H2tSqFt6MAz2bNABKKq3P2j2oLhqziBPXJkk+eUNB/6VUbGT5o3qxNtY1msaleRvB1VxFDdczt6YEBJVzSt4qiCB/KBifJrRGV8sgSwztjw64ZTS3gi89MJ2hWMlO783nqV89/saag93IuK3xu2Dc2wGasEvDdOaFL4X7T5hwzeYwFf/01Geul40GL5q67nSKPNbd+yTVzrMMfph0ELh6hxanD5h/0z7Db4KGETXUIKgXv2xaFbKxJTTRSHbK51QLXdGlbZm+if8= X-Forefront-PRVS: 0652EA5565 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0864; 23:E3VrBjbQW5PlXtf8MDMmAfhI4z7Vn+mYrDOvghEB8zc8+ZkSt9O7eO6AM6WQuoVFr63ZOL5PnfD4YRXxn/ys/cwY/96x6aeTEK9hZLBuIS76c6L6jaqx/FgnZQEJcAbnVnpT4U99vELNU9pAnkSxMs6D3Tu7KS7UePD4AUvmH3aZx4l4OC5yOn9FBf9Cy+SqbJdhic3xLNfqd4qpEqMG8bqU0151b7FiX1sZ+uYRc3IGT9uav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TfLulF20txZR98+JIY7HEjxeIGLuJhlw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2015 03:52:13.2738 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0864 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150728_205236_052960_50A97AEB X-CRM114-Status: GOOD ( 12.79 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, pawel.moll@arm.com, robh+dt@kernel.org, Peter Chen , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The zero-length packet is the sendor tells the receiver that there is no more data, so it is only needed at the TX side. Signed-off-by: Peter Chen --- drivers/usb/chipidea/udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 06b7224..51e66a1 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -445,7 +445,7 @@ static int _hardware_enqueue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq) rest -= count; } - if (hwreq->req.zero && hwreq->req.length + if (hwreq->req.zero && hwreq->req.length && hwep->dir == TX && (hwreq->req.length % hwep->ep.maxpacket == 0)) add_td_to_list(hwep, hwreq, 0);