Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp634994pxt; Thu, 12 Aug 2021 06:25:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMXNUk6dUFuaG9KaOX1J8nalf6SnQEgSV8dQ3GKQNa7R5UU5uoBseEuP3yQ0TasER9/b03 X-Received: by 2002:a17:907:2ce7:: with SMTP id hz7mr3636919ejc.35.1628774751089; Thu, 12 Aug 2021 06:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628774751; cv=none; d=google.com; s=arc-20160816; b=LfXpXgw+iRPOUaV8y6NIV8JXliWIFdQ7HQPbJGvAgKQMgwCvXnY6u0n78YkEp7Oced c6WcWgtiRNNyYY/gbs/UH//ignAcr+gCV7BM2Uoqagd1T/JIov6i5U66AM1pdFueXrZh E5ZbabRyv71px64okkJ+4McAuDNvzlJG0jpH2L893gaPy/eFwQQy3AOFxCkMThz7gHG1 wREh7XNP2FDbp2qG9ruJWKsQk29qKcJVgWHvV7LfDR6mbbMHBT9HZ92kW8RpeEjdhBk2 O3nVOstNzlJ3zQ2qclDmvcgcnueeOUTKSeaPwP2xpU4U25Zk7GfrfGmsPJqZ+D4IqqmR jFPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=VuTIy45JHqFkfwsTmwrJuk1C8k3pM+38paJSfJwydus=; b=rmGAbMkG+oBGnRcy8ZDqf5wpksnV4HxlkX1c+ZDvHrJIuXf18KZXAU3tcwycDwoBL/ JDxT5MGwDLET05kWEgO4L+NzoaBkHi/dqu5vzayo9tnwedxQHLKzcyL7gJBbRFoMoP0c mSLWmwez1vGMX2JQOesmQObb/OMl2WECC0Ye9fyR4nM5YxnttmtSm7ORRPqDitz7/n2M 5YLQGX10wk9q6zL10+TlXQP36URe6fGwKQpyD/6tZGekH+euE1QUiYhTFaNUL59FXY0q 7il6pn5uHRuBxKywAD0XhpG9NEIAOVLhTt1hSFweU72KOcQrndMCR5Dioa/hRpt+GfMQ a/4A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y14si2591891edt.174.2021.08.12.06.25.24; Thu, 12 Aug 2021 06:25:51 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237743AbhHLNXR (ORCPT + 99 others); Thu, 12 Aug 2021 09:23:17 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:49796 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S237469AbhHLNTM (ORCPT ); Thu, 12 Aug 2021 09:19:12 -0400 X-UUID: c55574fce0214727a3983d92a4c46c74-20210812 X-UUID: c55574fce0214727a3983d92a4c46c74-20210812 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 71351244; Thu, 12 Aug 2021 21:18:42 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 21:18:41 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 12 Aug 2021 21:18:40 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Felipe Balbi CC: Pawel Laszczak , Al Cooper , Thierry Reding , Jonathan Hunter , Chunfeng Yun , Matthias Brugger , Christophe JAILLET , Yang Yingliang , Rikard Falkeborn , , , , , , , Eddie Hung , stable Subject: [PATCH v2 5/7] usb: gadget: tegra-xudc: fix the wrong mult value for HS isoc or intr Date: Thu, 12 Aug 2021 21:18:01 +0800 Message-ID: <1628774283-475-5-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1628774283-475-1-git-send-email-chunfeng.yun@mediatek.com> References: <1628774283-475-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org usb_endpoint_maxp() only returns the bit[10:0] of wMaxPacketSize of endpoint descriptor, not includes bit[12:11] anymore, so use usb_endpoint_maxp_mult() instead. Meanwhile no need AND 0x7ff when get maxp, remove it. Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller") Cc: stable Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun --- v2: add fixes, cc; add acked-by felipe; --- drivers/usb/gadget/udc/tegra-xudc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c index a54d1cef17db..40a7417e7ae4 100644 --- a/drivers/usb/gadget/udc/tegra-xudc.c +++ b/drivers/usb/gadget/udc/tegra-xudc.c @@ -1610,7 +1610,7 @@ static void tegra_xudc_ep_context_setup(struct tegra_xudc_ep *ep) u16 maxpacket, maxburst = 0, esit = 0; u32 val; - maxpacket = usb_endpoint_maxp(desc) & 0x7ff; + maxpacket = usb_endpoint_maxp(desc); if (xudc->gadget.speed == USB_SPEED_SUPER) { if (!usb_endpoint_xfer_control(desc)) maxburst = comp_desc->bMaxBurst; @@ -1621,7 +1621,7 @@ static void tegra_xudc_ep_context_setup(struct tegra_xudc_ep *ep) (usb_endpoint_xfer_int(desc) || usb_endpoint_xfer_isoc(desc))) { if (xudc->gadget.speed == USB_SPEED_HIGH) { - maxburst = (usb_endpoint_maxp(desc) >> 11) & 0x3; + maxburst = usb_endpoint_maxp_mult(desc) - 1; if (maxburst == 0x3) { dev_warn(xudc->dev, "invalid endpoint maxburst\n"); -- 2.18.0