Received: by 10.223.185.116 with SMTP id b49csp4186281wrg; Mon, 26 Feb 2018 12:47:53 -0800 (PST) X-Google-Smtp-Source: AH8x227wokK5UImIoa8cuuhG2R01QPuXCCGs29uHRqVsK8e90ZYMqO+YMSM1bvPTV0y+olwIP9Hg X-Received: by 10.99.167.2 with SMTP id d2mr9363628pgf.408.1519678073716; Mon, 26 Feb 2018 12:47:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519678073; cv=none; d=google.com; s=arc-20160816; b=YSDGhECY2UdENYFqXqj4wIYHSQmkDzDsxoN2v0kiHw/yuE+JUKaI2/2betzJ/K8WAI ByD/db+q5vKA2zVFSneJ26XFLwrwxbRcdYnWsI381t99wrlvrjTteVd3xhcu2yCdj980 mAuBB5rCwOUZ7VDsbo8Y2r9l8nP3KHC9zCf8IsMb7pH5LNQgeJUqvDipqbzChNmz3IUP z+jtjRMo8eqL8T2g8wMlXb1JD4LWlE60G4m15qyzl+koyYgsJXXQ+GRbQP2WgjIXpZXV UwT9RekOksgY1BAZgexEj/K5DKOfbLhvGqfbPoipe7jZCQCHFpRI54jPLNqMJ2JbiJyZ zFdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=mmM/l6yL0f7/yOtjL+y2kdzv+e+iSJpEMW9wLW/QdeY=; b=q+mV6YPCe4kn+5R0U8w4ESH7tOGCGbkKJA6GpOEoxJ5AxpoYK3Wy5mjwFVzebqJfv+ 7T6v0MhyR23FJ5GtoA644OqAnXU00CGWOnaAMme0/lXdKZj7uSqzk/TE+yXF8xgwHTBh Gc0UXJ2hBKaRM9pZci+fd5Lk4TwkJnKRZmHdRoxGpE8P4JwgaKOKjbnANU8Kl5qNjvFB h7LOLgIvOMrgcj+XjdabgdNpeVc0w22o3Gk/ECdp19QYASxHyRgOgi6+9DAdjxdbOcj5 lDUKIsgucDv22U3MFyIWdWRR0zcQt2noxucgR2KU6v7sdq4/tRW7xcBjNOCbIf9OZ3or DpVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r62si5980028pgr.77.2018.02.26.12.47.36; Mon, 26 Feb 2018 12:47:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753249AbeBZUZr (ORCPT + 99 others); Mon, 26 Feb 2018 15:25:47 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35514 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753210AbeBZUZo (ORCPT ); Mon, 26 Feb 2018 15:25:44 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2A282FE3; Mon, 26 Feb 2018 20:25:43 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thinh Nguyen , Felipe Balbi Subject: [PATCH 4.14 39/54] usb: dwc3: gadget: Set maxpacket size for ep0 IN Date: Mon, 26 Feb 2018 21:22:16 +0100 Message-Id: <20180226202146.319094222@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202144.375869933@linuxfoundation.org> References: <20180226202144.375869933@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thinh Nguyen commit 6180026341e852a250e1f97ebdcf71684a3c81b9 upstream. There are 2 control endpoint structures for DWC3. However, the driver only updates the OUT direction control endpoint structure during ConnectDone event. DWC3 driver needs to update the endpoint max packet size for control IN endpoint as well. If the max packet size is not properly set, then the driver will incorrectly calculate the data transfer size and fail to send ZLP for HS/FS 3-stage control read transfer. The fix is simply to update the max packet size for the ep0 IN direction during ConnectDone event. Cc: stable@vger.kernel.org Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2774,6 +2774,8 @@ static void dwc3_gadget_conndone_interru break; } + dwc->eps[1]->endpoint.maxpacket = dwc->gadget.ep0->maxpacket; + /* Enable USB2 LPM Capability */ if ((dwc->revision > DWC3_REVISION_194A) &&