Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1419555pxb; Fri, 10 Sep 2021 05:39:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQeNSoWF8hc1/gRNvhYFgxtWNtVHQFEKFoKUMS6W9YWCslKY2g6YNUPX8d7KoTqqdHARzr X-Received: by 2002:a6b:e70f:: with SMTP id b15mr6925829ioh.140.1631277578292; Fri, 10 Sep 2021 05:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631277578; cv=none; d=google.com; s=arc-20160816; b=UWRaWifQuDMADDeEO0XcBTEYaD7hNDP++qbfS35c3IJjjcWmt1jvQg1bb/Y6Vq7Pp1 L85FuI6D8YpBljjO3APyvX6JiSqAS10s/Hm8+31z5RiGK1f0DvQZ7ir4vTM1FiFpOlpa nAq5XNMh0PZjsB2iyBOHtKq2qLCUDOLWBWxdfuRVLBiCmoeWptlyrUpXMn9r9KYsPxCs qDMkE1i7IcZREQHgl7/H9atb5sEz9QXonMTYOGHFaOkja7X1eXIbk0bCNUNTDp+rjbjw IyB/wFddo1hM1tOOGNlf5sZk34guAeztXKptGvVSyRDcBzxbFVygYhCxBQXI/ibOn0nZ aShg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vBMonJ08v4j/3WfmC6Bn4GiNKmnfreCUx4nDAe2negE=; b=ihKgT9maMcsvR8WJqL7QumHzxPvcu9Qab1Z9LULHFGe7zyx0pDxNfWkd27WcqnjY8D 7IykRNPxBZYahzDOFDE5m6w/3NNhMfP/ndgIWhh00zj77kq2p8gbNuarFt1mam1+Zagw YWrK2FaMQjnDkMkE6Jv6v2soaW6sJ6HUBz7gpFN7vvDKqUtL4bgek1WA9S7Y3QyfGsOB HyKe6B2RyWPfreMtpE0ZPMWrDMChkuedjJ4y6YpV046OFaIBXQdR5Fc8jQKd86Rgb9j3 414UeFGuvMqx++9Vj7v6GQhF8oCgNqQSQKuUOS2/7PXgl9MJ7Y1YEhqXo2BQxEy2SZDI i/Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U84RdJRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si4383156iod.86.2021.09.10.05.39.27; Fri, 10 Sep 2021 05:39:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U84RdJRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233816AbhIJMiQ (ORCPT + 99 others); Fri, 10 Sep 2021 08:38:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:53226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234697AbhIJMgl (ORCPT ); Fri, 10 Sep 2021 08:36:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 52DED611EE; Fri, 10 Sep 2021 12:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631277322; bh=SSeeiPNyM3+Zj6ddTIJ8A4oMXcIPbCf50nSwuo96Wvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U84RdJRgSIum5YtQuLezbsVYvGM4LlG+2WqEZqOpspHBh0BhgzgHdeJv17ji0DKJT EJJZc30UobrE8oAOe5N/rARcvBgglkg78hPlR9CWM3gsNpKNGvBk6OXiirNm9cUNxh K+gpdSXA4IBauQ6yvkPy/eainrq/qpSne1x6/kaI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun Subject: [PATCH 5.4 34/37] usb: mtu3: fix the wrong HS mult value Date: Fri, 10 Sep 2021 14:30:37 +0200 Message-Id: <20210910122918.283630591@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910122917.149278545@linuxfoundation.org> References: <20210910122917.149278545@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunfeng Yun commit 44e4439d8f9f8d0e9da767d1f31e7c211081feca upstream. usb_endpoint_maxp() returns actual max packet size, @mult will always be zero, fix it by using usb_endpoint_maxp_mult() instead to get mult. Fixes: 4d79e042ed8b ("usb: mtu3: add support for usb3.1 IP") Cc: stable@vger.kernel.org Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1628836253-7432-3-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/mtu3/mtu3_gadget.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/usb/mtu3/mtu3_gadget.c +++ b/drivers/usb/mtu3/mtu3_gadget.c @@ -72,14 +72,12 @@ static int mtu3_ep_enable(struct mtu3_ep u32 interval = 0; u32 mult = 0; u32 burst = 0; - int max_packet; int ret; desc = mep->desc; comp_desc = mep->comp_desc; mep->type = usb_endpoint_type(desc); - max_packet = usb_endpoint_maxp(desc); - mep->maxp = max_packet & GENMASK(10, 0); + mep->maxp = usb_endpoint_maxp(desc); switch (mtu->g.speed) { case USB_SPEED_SUPER: @@ -100,7 +98,7 @@ static int mtu3_ep_enable(struct mtu3_ep usb_endpoint_xfer_int(desc)) { interval = desc->bInterval; interval = clamp_val(interval, 1, 16) - 1; - mult = (max_packet & GENMASK(12, 11)) >> 11; + mult = usb_endpoint_maxp_mult(desc) - 1; } break; default: