Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2510798imm; Mon, 24 Sep 2018 05:41:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZRrfRwESiyVCXpPSI7F6WCYnCeZVRRC0+X2mUEHVAFS0PJwV7uRoi7KA0f9qND1fl9Xamx X-Received: by 2002:a62:4dc1:: with SMTP id a184-v6mr10191110pfb.5.1537792917469; Mon, 24 Sep 2018 05:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792917; cv=none; d=google.com; s=arc-20160816; b=so1wWCLz0EitS8P4CnCjiFLZz8xv2aWHq/oryGbXHiGZxnEVIE+ROIEFps8LvsySHc dDPLot2XwTk8ysBd4H7tsAFdaVMHTDQVmfBtpcTWE62ixvAHI6K3BUyqyucJmuS8bPC4 JYjV1ymLVmhoDHxXaal7+vBvnKiyqgBxg4wB+dwFKJMNUM8Ze+x5LsOfvq9yjmdjgkZ4 JnbuZMXZdL+JlZeYz1zzTYnZEFGBIF7w0PbSERLJttRtaw3RoiZYHIFgIqAeNeEnRqD6 I5qdkFogTlBF/uV+Wyr+X+tE4sZZG/LtxB5BuLNXxmV4LuG/WOdFt5AezySbr5O+Nutj bEog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=mecPljgnORLfJLyqpInkX2rFpCoSVH2UtfeCuPyC8Gs=; b=OLpyBMZ+SSmeGr0fypbTUoLVWynEAevmY3BeUjO/l3TauI6VFq8zmxvk3BY54l46i1 rNhOv1f4yRB2K8I5h8ICoDAegxaAaO6Pgl3ud0uP5TnH63m7lveAZojl9V4hXfhA9FrQ W2sOkxASnqaPJkUx3T92u2ztWdnYdK1E2GThyqC5+drP4d8Xe3H5LEkmcJdsSDNQoQY5 EcMPk4tUKys8+dt4Q8OxjqNbjF9vCXiDOA0hiaCtDhiyfkoJ30dc6kqsSqH1hirArR8N bcSoWqMYYztTKRryasy9uzcxIVizg+2NAqX0Ukmn1BYFjY6+bnuLHptzM/x/Tl2nrcVV G+rw== 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 i124-v6si38828756pfc.110.2018.09.24.05.41.41; Mon, 24 Sep 2018 05:41:57 -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 S2388658AbeIXSmk (ORCPT + 99 others); Mon, 24 Sep 2018 14:42:40 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59026 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388652AbeIXSmk (ORCPT ); Mon, 24 Sep 2018 14:42:40 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E8B6A109A; Mon, 24 Sep 2018 12:40:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Junki Kato , Yoshihiro Shimoda , Felipe Balbi Subject: [PATCH 4.18 126/235] usb: gadget: udc: renesas_usb3: fix maxpacket size of ep0 Date: Mon, 24 Sep 2018 13:51:52 +0200 Message-Id: <20180924113118.624099612@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda commit dfe1a51d2a36647f74cbad478801efa7cf394376 upstream. This patch fixes an issue that maxpacket size of ep0 is incorrect for SuperSpeed. Otherwise, CDC NCM class with SuperSpeed doesn't work correctly on this driver because its control read data size is more than 64 bytes. Reported-by: Junki Kato Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller") Cc: # v4.5+ Signed-off-by: Yoshihiro Shimoda Tested-by: Junki Kato Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/renesas_usb3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -787,12 +787,15 @@ static void usb3_irq_epc_int_1_speed(str switch (speed) { case USB_STA_SPEED_SS: usb3->gadget.speed = USB_SPEED_SUPER; + usb3->gadget.ep0->maxpacket = USB3_EP0_SS_MAX_PACKET_SIZE; break; case USB_STA_SPEED_HS: usb3->gadget.speed = USB_SPEED_HIGH; + usb3->gadget.ep0->maxpacket = USB3_EP0_HSFS_MAX_PACKET_SIZE; break; case USB_STA_SPEED_FS: usb3->gadget.speed = USB_SPEED_FULL; + usb3->gadget.ep0->maxpacket = USB3_EP0_HSFS_MAX_PACKET_SIZE; break; default: usb3->gadget.speed = USB_SPEED_UNKNOWN; @@ -2451,7 +2454,7 @@ static int renesas_usb3_init_ep(struct r /* for control pipe */ usb3->gadget.ep0 = &usb3_ep->ep; usb_ep_set_maxpacket_limit(&usb3_ep->ep, - USB3_EP0_HSFS_MAX_PACKET_SIZE); + USB3_EP0_SS_MAX_PACKET_SIZE); usb3_ep->ep.caps.type_control = true; usb3_ep->ep.caps.dir_in = true; usb3_ep->ep.caps.dir_out = true;