Received: by 10.223.185.116 with SMTP id b49csp4177338wrg; Mon, 26 Feb 2018 12:36:56 -0800 (PST) X-Google-Smtp-Source: AH8x227DhG2No3yykXHXcIRh9jUW4Kl8/M3pb6T7DbIx8tMSntKxMW/W5mA01Lg8d1kE9py8aHOq X-Received: by 2002:a17:902:b185:: with SMTP id s5-v6mr11728616plr.109.1519677416344; Mon, 26 Feb 2018 12:36:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519677416; cv=none; d=google.com; s=arc-20160816; b=BQssq4b2l2ktZdSuFjV0GZsqhiV819z7gdyH6QU97n3T1/CEvoKMox/X274sveFAiG mertc34j+rJ4iJ3R9oz8wdvMbB5RGkVbw/T4SpuiDDRfY5eSeF9MWvdpad2NtPQaZltN cMAGEg0HLsyp5alGw4vi0Uh32QIh7VOwL57goaoLxVd2EolIp//RZoHvZr10t0kWMNYN ERnW3ZUyV2Jum4zSRpu6M9LSWb30omTSSXa2bufSxteocexpo9Jv9RuhteZe24eW9FNU mioMdgYqrUPccxX+wlu5JMlArtvO64XCWUe1T4bfSApz5X6lfE5CmbVy9mn25qN2qOWf cLvA== 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=8zrgYiVrELcnUf8ZsxS3njXAINsFE4+3CQD5lj+diWc=; b=bRv5o1lItvbBFwDndlhRg8wtFC9IUpEUhs1PfKZ5atAmIvexaMTGaq4mrXxm/iyVME rHeKyVWmTXhN74pzUSl/EoqORdcrWseNXdyK8p7+EDXXp/nvShl2Ns8gRTKg7pXVC5lz +ljWCZBqXn3ymFFu6B0ioYluI+dGRLEU9dZMS8+zxnGiz5CVMtvofArmcfqauDGt3X0y QYLY5m6SYZP0AP+QfWEN/f6KfP1p5CzKwy3DY+W17oUu49lfmUcFa22HPLc5i2XOrdeL 3WX8wjEYIcKqx5A237l02Qe8T8WuJDxpPX9zO0G4K+qIZyv4yElWBup/ISftF/1xL59s O57g== 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 q9si5979262pgc.623.2018.02.26.12.36.39; Mon, 26 Feb 2018 12:36:56 -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 S1752457AbeBZUfN (ORCPT + 99 others); Mon, 26 Feb 2018 15:35:13 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36974 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753820AbeBZU16 (ORCPT ); Mon, 26 Feb 2018 15:27:58 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F303FE88; Mon, 26 Feb 2018 20:27:57 +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.15 45/64] usb: dwc3: gadget: Set maxpacket size for ep0 IN Date: Mon, 26 Feb 2018 21:22:22 +0100 Message-Id: <20180226202155.369082229@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202153.453363333@linuxfoundation.org> References: <20180226202153.453363333@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.15-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 @@ -2744,6 +2744,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) &&