Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2232219imm; Thu, 7 Jun 2018 07:26:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLgH47AQGmpDV1B9F4+hpU31sqM8NAGp10KANg4UyEgX+1R1BkTzniPStMvBx87EKWzZ4Im X-Received: by 2002:a65:6592:: with SMTP id u18-v6mr1763968pgv.366.1528381599408; Thu, 07 Jun 2018 07:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528381599; cv=none; d=google.com; s=arc-20160816; b=yd7ntdjIlJVmnfy/pyTbBHLINn1l1U2vNMdNZDmwsu1e5P8LxYO44mKTO9ZtcEVDWm scBVDxVywPzaGxiw8y2MSuhoNoYc3g8yrxQrMVA88WK4C5VYRdPp2c4MgToMHJ7QfDeQ VzwBhLf6pu3I98H4Ff1qavoLpix6QSvnMrGutajIcMtLCVBqvXuR+RxrJmzeNeIzU3CU GgwXgXGHSkjVaKAjvDXasgSsgMmnasnOGLH10lNEl1eDNkEisymbYJ9aSy7xywx/FmRw XknGFxhZAimEWmVn8V5l2QBC0h92AYA0ubYvz+sO5CSAwUlrHz72KddHe1ltfHtfwkoN muHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=jrylybtBGrYXFV3xXSTtxDi19wqi5IbzBlq4VZnljLA=; b=DFs8xqsvshCwAYkPQlDdeaJOnUjMD52DVG5Ihbhc5zQrGZ6RwvVz08YfpgwzOvqMyA o+axsNpIXEmkssUIR+6husdoxo+SgGzWEpGT9HCgVtnBDJM4YzAiZWt4uZ8WZyOMrLo1 d+fgTxSOUksPN+9yoBCUIvZBryYP3Wy5FOU/hjKGEq+cAXj3vGzw0Q4W38sTQUpNml6d 0bEAN62ZWtTRyGJkbZRglIh9K1nCgtJMzfKjZS8xY8bQhQANSD4f2EnTlzEn6USe+7ZK 8aQs088wYgVm8Z3Z4+dbOS0z5QKht7vewmribTR8vRiQnTHYAfBykUuBzv4v9m26fIDb nZmQ== 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 h11-v6si13722586pls.399.2018.06.07.07.26.25; Thu, 07 Jun 2018 07:26:39 -0700 (PDT) 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 S933225AbeFGOVz (ORCPT + 99 others); Thu, 7 Jun 2018 10:21:55 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39446 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933076AbeFGOJK (ORCPT ); Thu, 7 Jun 2018 10:09:10 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbA-0005Zm-8Y; Thu, 07 Jun 2018 15:09:08 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb7-00032j-4b; Thu, 07 Jun 2018 15:09:05 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Felipe Balbi" , "Thinh Nguyen" , "Thinh Nguyen" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 226/410] usb: dwc3: gadget: Set maxpacket size for ep0 IN In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 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. Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi Signed-off-by: Ben Hutchings --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2436,6 +2436,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)