Received: by 10.223.185.116 with SMTP id b49csp4160751wrg; Mon, 26 Feb 2018 12:17:41 -0800 (PST) X-Google-Smtp-Source: AH8x226z9IE3+nVynLsSRzciGrErvZ5N2RWaIF1beCmK3A47BjojUtTmkTwS2Nzk8CAnz+RWvLNt X-Received: by 2002:a17:902:8c83:: with SMTP id t3-v6mr11994103plo.310.1519676261041; Mon, 26 Feb 2018 12:17:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519676261; cv=none; d=google.com; s=arc-20160816; b=FrVPcDRgZF472EYRNwa35KV30tsDOl+PX75OH+4pKDYC01KNyHhrCiQFeQablEzW98 6zlGyyxmK/Ji6X8+VIPOOY1AHDxGz/ttK0ykt7SwXYBoDB7ZjMDDuikZmoomswKB7NlV npYIp+pXqKDheroyUtak6EYyl2v22kRQrw79S1wVBNOa4JCzS6NUDXrtZP6q9fQH9flQ o0tuUyUEXtfSWMENSvTiR9mJ6CFR5EP4iHypB4LyP7G6T1WKKIghjr80x/ND1g2XLWLF o0SSU6YV5MHyVMwzFb9P6t3cioKN75/kyySgRms4h7MyJuuIDPTF4nencCBqn0zY3y1+ V4Nw== 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=4PTQw0kHNdZH6Cfhz9cdkjANEgZjIsmCNRKMiUPqaOY=; b=GAzLoIOHPREClqtUgD8C23yBZ4WTYtqzgpYMC7uJY4NnG4yFGyYxanlLWmiTWcJJA6 +Mk70DRhwQtQXwtjqRwNuJuq5Dt57NHMuvZcmUaN7Tppq6/teD2LSTk7v92kkw/yalBJ IK4//9hwSYYfX1Otx8xWyPeAOvU9GDMyK2QoF5GEMgpDhFVvhOrZD8V8HvgC3eOBG0uc H/TVIxq4XqGxmfysfvjbXRoomwLykaJWuGATf5D2fRh0n5AmCGuqb2RDNIiO/UKJCZzL RXg7Spxk/36+se2OZJXkgOEXu1MUgvHNsMpV6niDX8oJ9Fi+m3KKw/woFktd/GHPKnau 6E6w== 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 q3-v6si7140713plb.824.2018.02.26.12.17.24; Mon, 26 Feb 2018 12:17:41 -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 S1751654AbeBZUQB (ORCPT + 99 others); Mon, 26 Feb 2018 15:16:01 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:58514 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751485AbeBZUP6 (ORCPT ); Mon, 26 Feb 2018 15:15:58 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1C97610DB; Mon, 26 Feb 2018 20:15:54 +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 3.18 11/13] usb: dwc3: gadget: Set maxpacket size for ep0 IN Date: Mon, 26 Feb 2018 21:15:39 +0100 Message-Id: <20180226201527.731997055@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226201527.242286068@linuxfoundation.org> References: <20180226201527.242286068@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 3.18-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 @@ -2345,6 +2345,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)