From patchwork Thu Aug 12 13:17:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12433517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0C39C4338F for ; Thu, 12 Aug 2021 13:19:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53D0960C41 for ; Thu, 12 Aug 2021 13:19:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 53D0960C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wR555YH23uGCddke9oeTm3fLB2bIuRPsw9KSnQUplMc=; b=HY43QTc6IaDqQ+ Q4WXtfkn7SH3MCY+tRWoa13Hc7Xdd+156rEGcDc2XrLyX8N9dASK0/dMbAEAmmMTMRF9amwMgXLVX e18SJBuQdchDLN2FcDXvkpLyLbYiQPGYeAiL5o48fM16JR2t8D+606l6e2wWPvEHMl3gaXCxRc/lk gauIVxtk5Y2iwlODh9zucaFSCoekxtqxb9SEU25o0AzdCX+Zmpmi2Qw53pwdOC03Of+8rZ5e6NMzL CqB3HYARdGnmWzP7axZZlT6cHEoMPmaVHms0SPvm4+HaMabpoZ4q8M+ArHoLoNomlDyVafW3ZsZrs XKJAmanfQ7AYX3YUWQXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAbp-00A9Gc-L1; Thu, 12 Aug 2021 13:18:57 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAbZ-00A9Ci-1X; Thu, 12 Aug 2021 13:18:44 +0000 X-UUID: e076946eeea643529b2e4e758d032ae7-20210812 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=lYfkLQdUx36ZU2qdoUAg6uIkYvBii3Ny7EPO2iIfOGU=; b=Esiy54zpkaltFqM3cZK/8bZT97MkB89h8c0gkqH3kuxvT44bdF0qyM3mUI+eLQuoRsPlGW6IO39M6sg7cWLirU9x2JnzFejNsiItQm7xK1wwrxWDWkDN5Q1RGv7RpU07QI+YhCGf2YlVtsKZsbsbXTMZJWFOSlxvXyr8R/OCjGg=; X-UUID: e076946eeea643529b2e4e758d032ae7-20210812 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1293771159; Thu, 12 Aug 2021 06:18:39 -0700 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 06:18:38 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 21:18:37 +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:35 +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 1/7] usb: mtu3: restore HS function when set SS/SSP Date: Thu, 12 Aug 2021 21:17:57 +0800 Message-ID: <1628774283-475-1-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_061841_124776_515CA3F8 X-CRM114-Status: GOOD ( 11.14 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Due to HS function is disabled when set as FS, need restore it when set as SS/SSP. Fixes: dc4c1aa7eae9 ("usb: mtu3: add ->udc_set_speed()") Cc: stable Signed-off-by: Chunfeng Yun --- v2: no changes --- drivers/usb/mtu3/mtu3_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index 562f4357831e..6403f01947b2 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -227,11 +227,13 @@ static void mtu3_set_speed(struct mtu3 *mtu, enum usb_device_speed speed) mtu3_setbits(mbase, U3D_POWER_MANAGEMENT, HS_ENABLE); break; case USB_SPEED_SUPER: + mtu3_setbits(mbase, U3D_POWER_MANAGEMENT, HS_ENABLE); mtu3_clrbits(mtu->ippc_base, SSUSB_U3_CTRL(0), SSUSB_U3_PORT_SSP_SPEED); break; case USB_SPEED_SUPER_PLUS: - mtu3_setbits(mtu->ippc_base, SSUSB_U3_CTRL(0), + mtu3_setbits(mbase, U3D_POWER_MANAGEMENT, HS_ENABLE); + mtu3_setbits(mtu->ippc_base, SSUSB_U3_CTRL(0), SSUSB_U3_PORT_SSP_SPEED); break; default: From patchwork Thu Aug 12 13:17:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12433563 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 357E6C4338F for ; Thu, 12 Aug 2021 13:23:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E902A60FC4 for ; Thu, 12 Aug 2021 13:23:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E902A60FC4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WBmlJL+kbAAdNKlOn+YU3OAh903EVdwEE8BcOlHeudg=; b=FRf8lVjQfi4Kmd mfKnrKvrrdcAtn1NvXug6xjX2jtqxeH0I3iw81cUzIn5CUQAbXv0V2KdfewsvqJhb1cVFxo7Hj3xn VRxHtYb4ILs++ck9Ba78FZhAKSg2SbY6NfIK2TEKBkwIZhnLz3ESu8X5kaU5nubnmq2QmiTvRW17n KJ4JolBpS0Lhc6go3uD9IqxlHH6s8pF3WWEyBvhnalPDZKEcoCmRSmD1ukH3m3+o91ZavbZjJCdBb Z27xHR61cNZdNo4OyyY24HqCdPBRGRo/O1w5OVrajoMDokx1yp0zxkdtU+2eGrDGFO1gdWN1TGfyg W3uX/vM1Ektz8rDLVQEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAgB-00AAyv-EO; Thu, 12 Aug 2021 13:23:27 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAfI-00AAaU-0w; Thu, 12 Aug 2021 13:22:35 +0000 X-UUID: ff4cd1a5d36f421eacd39e75a07c58e8-20210812 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=tHstMLVZjCD2Vl10a0+PbM+3J6apWhGG51WfD/5Nwm4=; b=T/foLOUedIuV6sOCZ4hKE5Cm+7+vIDzgruLrr9WSSmMSCKBZkASiutKNZDi/qmVDMfJNsl87BDrAEzPrXmR4dWSjVAz9ODOP09C/OehB+WhQwUjeaqrMacavrRrjuQzefjxL/PTuW7ET9VImDec2fX0dTbdcYB4pZ2Oe+ZdMFsI=; X-UUID: ff4cd1a5d36f421eacd39e75a07c58e8-20210812 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1139306149; Thu, 12 Aug 2021 06:22:24 -0700 Received: from mtkexhb02.mediatek.inc (172.21.101.103) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 06:18:39 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 21:18:38 +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:36 +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 2/7] usb: mtu3: use @mult for HS isoc or intr Date: Thu, 12 Aug 2021 21:17:58 +0800 Message-ID: <1628774283-475-2-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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_062232_098437_5B455DB4 X-CRM114-Status: GOOD ( 12.95 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org For HS isoc or intr, should use @mult but not @burst to save mult value. Fixes: 4d79e042ed8b ("usb: mtu3: add support for usb3.1 IP") Cc: stable Signed-off-by: Chunfeng Yun --- v2: new patch, split from [2/6] suggested by Felipe --- drivers/usb/mtu3/mtu3_gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c index 5e21ba05ebf0..635ad277cb13 100644 --- a/drivers/usb/mtu3/mtu3_gadget.c +++ b/drivers/usb/mtu3/mtu3_gadget.c @@ -92,7 +92,7 @@ static int mtu3_ep_enable(struct mtu3_ep *mep) usb_endpoint_xfer_int(desc)) { interval = desc->bInterval; interval = clamp_val(interval, 1, 16) - 1; - burst = (max_packet & GENMASK(12, 11)) >> 11; + mult = (max_packet & GENMASK(12, 11)) >> 11; } break; default: From patchwork Thu Aug 12 13:17:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12433519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 943B8C4338F for ; Thu, 12 Aug 2021 13:19:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 398C260F11 for ; Thu, 12 Aug 2021 13:19:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 398C260F11 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IE5X6iTaIQVM5N8gulSqf1rCy/bI0+d8QZ1C9s9jOtI=; b=lLzD/pZz5nxyMc KQjfFLe355SR1hanfZTKj0UTV7M22zWnrZYd8Q+huY5HjHxIVkFpWmvKv02cieb6yWuoQpl+OHLaP g57BP1cvuU0RW0WMep6sCtCoVB7iuuSumjCEevI2gB4hDdtZycPNhoENg4gr4frvtHSdHpNSMMj0o alrFZRHrA1mSNFTooCAthVoqIkHu+Qjsdl0fJrbL/csMD+NOQDsgATM8DYuB/iaY9/udB1U4bCAkI VWg/uJz7BstyTlH18xuZUkYlCR7JAmQK6TuenZShZauepHoRwPHJQmQhPHqgwX4sH67H/O5tCOv2a KgKJNgO17YNfC9C9xQyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAc0-00A9Il-Sq; Thu, 12 Aug 2021 13:19:08 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAbb-00A9DU-BX; Thu, 12 Aug 2021 13:18:47 +0000 X-UUID: b481892a3fcc4aa19febf313a4b67de9-20210812 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=0MGhCGevIZdfc8ILkcD3M8l6HJk6lrSN1N1LQM3EGUk=; b=nq5PIKXWMCi28PrVdNS9miKOueTJSZZU/+eIwnwtNDya4UONqOtvydN8ObJ+DwKoMp9wt4c0ccEZ2KBWeuUNTKk71Zt8/S383PbSxZTe7hjMRnDgQAEkECv43n59iFWv7dPWCZ/WiCTjFcOJXFVucK2/nyFHma8DsCAfyiOtPh8=; X-UUID: b481892a3fcc4aa19febf313a4b67de9-20210812 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 978456447; Thu, 12 Aug 2021 06:18:42 -0700 Received: from MTKMBS02N2.mediatek.inc (172.21.101.101) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 06:18:40 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 21:18:39 +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:38 +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 3/7] usb: mtu3: fix the wrong HS mult value Date: Thu, 12 Aug 2021 21:17:59 +0800 Message-ID: <1628774283-475-3-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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_061843_441753_586E3669 X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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 Signed-off-by: Chunfeng Yun --- v2: split two patch [v2 2/7],[v2 3/7] suggested by Felipe --- drivers/usb/mtu3/mtu3_gadget.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c index 635ad277cb13..a399fd84c71f 100644 --- a/drivers/usb/mtu3/mtu3_gadget.c +++ b/drivers/usb/mtu3/mtu3_gadget.c @@ -64,14 +64,12 @@ static int mtu3_ep_enable(struct mtu3_ep *mep) 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: @@ -92,7 +90,7 @@ static int mtu3_ep_enable(struct mtu3_ep *mep) 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: From patchwork Thu Aug 12 13:18:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12433559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F19C432BE for ; Thu, 12 Aug 2021 13:22:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 19B30610A4 for ; Thu, 12 Aug 2021 13:22:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 19B30610A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rpr1RyTPlcr1emKRJKnfGFi8JFIQIDv61iej1e9DEFc=; b=uka/FbF8jGjlC9 OaKD39FYYWK0X/P3na5joJM7ch04rReoTr9BZpg4/jPa4Pf2aQ2TCOK+9u2KFjWI5NF3gHNeu4OOh 1ksJNQ+ruAY8fYU4MqG4PPvw6iwA6Qq1gORLnkz0GDO/tEbsPyDqNA0yNHie/AyC55rWBUYxp1fVu DPrTu0ca7hyHRjxAnFmq70WNZZd0Mib+Q95S/ztgNf+tUpKQQ1fnA7UdSCDJgQ9TCSPhJFSI/alfy hEMpJrf0lDOEhPaklzjJK/06FhjRRbiq7FA8V89H0OdzoyKnh3wVnIAa1wt+aR0J05cgBxOTyk4HN VgA1rnJni5GYswrip1LA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAfW-00AAhR-FY; Thu, 12 Aug 2021 13:22:46 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAfB-00AAaU-TM; Thu, 12 Aug 2021 13:22:31 +0000 X-UUID: acee62cc43894e4dba95f474bd1d44ea-20210812 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=h5olHsLopR+BYtypPrnSTo8iOF7llh+07WA8pyjdOJ8=; b=ei3jQoPnmx96WzbpqWNqBe0y0avW55+YP5uf0wWRKEkQ3FO/c/TgMqHbs5JVfEHZRHRrRexkermjeMlHHafejHjk9PSI56uOp6/a8Vb74z+Ot3m3YJ/eT86zHehtIZY5FgNb7CIcmdUcKyUBXHmSRCc/G/VIwLQkpbL7wUzXeFA=; X-UUID: acee62cc43894e4dba95f474bd1d44ea-20210812 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1504328112; Thu, 12 Aug 2021 06:22:24 -0700 Received: from MTKMBS01N1.mediatek.inc (172.21.101.68) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 06:18:41 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 21:18:40 +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:39 +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 4/7] usb: cdnsp: fix the wrong mult value for HS isoc or intr Date: Thu, 12 Aug 2021 21:18:00 +0800 Message-ID: <1628774283-475-4-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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_062226_017177_A789B0B9 X-CRM114-Status: GOOD ( 12.92 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org usb_endpoint_maxp() only returns the bit[10:0] of wMaxPacketSize of endpoint descriptor, not include bit[12:11] anymore, so use usb_endpoint_maxp_mult() instead. Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Cc: stable Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun --- v2: add fixes, cc suggested by Felipe --- drivers/usb/cdns3/cdnsp-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c index a47948a1623f..ad9aee3f1e39 100644 --- a/drivers/usb/cdns3/cdnsp-mem.c +++ b/drivers/usb/cdns3/cdnsp-mem.c @@ -882,7 +882,7 @@ static u32 cdnsp_get_endpoint_max_burst(struct usb_gadget *g, if (g->speed == USB_SPEED_HIGH && (usb_endpoint_xfer_isoc(pep->endpoint.desc) || usb_endpoint_xfer_int(pep->endpoint.desc))) - return (usb_endpoint_maxp(pep->endpoint.desc) & 0x1800) >> 11; + return usb_endpoint_maxp_mult(pep->endpoint.desc) - 1; return 0; } From patchwork Thu Aug 12 13:18:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12433585 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB258C4338F for ; Thu, 12 Aug 2021 13:29:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60C4E604D7 for ; Thu, 12 Aug 2021 13:29:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 60C4E604D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=332dtujXvgbOXTt6ijfmOXdrJxS8wJylZNXj1ZM+6NA=; b=KrUJb82oBe1r4C ZqGCA/BvV7A+2NuYHSkKRDXNJtzspNKUT9SVIHSZl7SlUhca6X2xjTImfzBAyOZI24Do+J+UjexsB 0p2CSqGtY9nRvN+Qp7dnHdtmYZA9g4Fj7uO34mnFA/oAEzNLW8aOkVMCQnyvS0TgQ8vL8Mu7seaGt SPE7rWGz956nu5fK4DReK6Q0lk42aP0J6dcFuD8wNAHAa+Xqk6C2evjwQ4+ddCgVGCF6dospzaPBK sIMJHdfWaRl4dditkl/Skd9cYasY56dzugpUVy07PCw6xvHUBm6g3h7f/s5y3FwCCG+NEcoE/m7hf XUNJ9moNHqaS9aGk+uwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAm6-00ADzr-Pz; Thu, 12 Aug 2021 13:29:34 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAlR-00ADi2-Ac; Thu, 12 Aug 2021 13:28:57 +0000 X-UUID: db0762503b6546db9ba7276cec000be4-20210812 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=RgL5t1qCvVRg400xtDH0H7w9psyO2DQgcNJfO4TNs0k=; b=IP3ev+xwhz8bpjfXs/ZhEX6+LPMWVI9WUvHjWidjMtCp9K0PWxHrspgnJ00cALh8ubNoQmozOsmXI07HcM28ve1MvO8jYnqG/ARdnHbv/WvW/VQoVtKuYp06kA0yWBVVPaRAaEfjYs662iaFT57TpL/6yftf7+WqOhXYmE+cveY=; X-UUID: db0762503b6546db9ba7276cec000be4-20210812 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1730697378; Thu, 12 Aug 2021 06:28:51 -0700 Received: from MTKMBS02N1.mediatek.inc (172.21.101.77) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 06:18:49 -0700 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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_062853_417849_7A366EE6 X-CRM114-Status: GOOD ( 13.64 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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"); From patchwork Thu Aug 12 13:18:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12433521 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FBB9C4338F for ; Thu, 12 Aug 2021 13:19:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 607A660F11 for ; Thu, 12 Aug 2021 13:19:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 607A660F11 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d1TBUxBcwUZcvBl92ZR91zvjAEQcWk4VxBzuNLiLMtw=; b=NYUi7oHOKjX2gO t3OnrVJ0X6VB+RmB5I6Y50uvoKDTQ1XDlh5NvV9V2X7oJcVe2JTKTBi6ByG78N/gaD25IsJb0HxBt pamuL3gLUEJwe3BKHqw20xFZdYVqmRmqD0gBSqLXI7heAlv7qlOO5M33PY6xdpZ0Qbwm5VN5/Zzwn w1C+el07ceHdv1IduKQg0XiQIth4gcBOCf00sj80nID9J6V4o2vOA2oBFzuOhXiJlfCn7xS5Sb0mx 4PgVUMfMbb1rxOkuKxpHCHSUWoroy0fej5xqvm9tm1H3eKWORAvoeH+TiX8HgW+rTkwUM82PlCRml bBUUoxRMaOqBqzQ/5lfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAc4-00A9L6-N7; Thu, 12 Aug 2021 13:19:12 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAbe-00A9Ea-B4; Thu, 12 Aug 2021 13:18:50 +0000 X-UUID: d6790170a4634e2aa1927ceecf02b390-20210812 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=mJh/D/jWS7Xmxizig6X8nqgkKT8I5WMyw/O7e/yTJUE=; b=qYAHpJOsjrHXaoTmJM0LkqRPqko3VVmn1+uuWRDmdBN5jFeLODtWj/n++rU02YOi5z33NVR60KaIZIuA7z+6fHrIgqZV/kIpoX/BZeXvCu3hMhzR49R9w/wOtVtlTOKqzogguxCuroCsgOY8pZ49SCKsRYQFZyEUCG5hd37tw5w=; X-UUID: d6790170a4634e2aa1927ceecf02b390-20210812 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1505252550; Thu, 12 Aug 2021 06:18:45 -0700 Received: from MTKMBS06N2.mediatek.inc (172.21.101.130) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 06:18:43 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 21:18:42 +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:41 +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 Subject: [PATCH v2 6/7] usb: gadget: bdc: remove unnecessary AND operation when get ep maxp Date: Thu, 12 Aug 2021 21:18:02 +0800 Message-ID: <1628774283-475-6-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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_061846_434998_9E3B1EA1 X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org usb_endpoint_maxp() already returns actual max packet size, no need AND 0x7ff. Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun --- v2: add acked-by felipe --- drivers/usb/gadget/udc/bdc/bdc_cmd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_cmd.c b/drivers/usb/gadget/udc/bdc/bdc_cmd.c index 995f79c79f96..67887316a1a6 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_cmd.c +++ b/drivers/usb/gadget/udc/bdc/bdc_cmd.c @@ -153,7 +153,6 @@ int bdc_config_ep(struct bdc *bdc, struct bdc_ep *ep) si = clamp_val(si, 1, 16) - 1; mps = usb_endpoint_maxp(desc); - mps &= 0x7ff; param2 |= mps << MP_SHIFT; param2 |= usb_endpoint_type(desc) << EPT_SHIFT; From patchwork Thu Aug 12 13:18:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12433561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66D20C4338F for ; Thu, 12 Aug 2021 13:22:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 19CB3610A7 for ; Thu, 12 Aug 2021 13:22:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 19CB3610A7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4HhTewWAcrmtX05U66IHqn4Ntd+sZjagnbYja74ArXg=; b=Too9cLqZySh6fy gbzGPgu4GbSetbAoMdOTazOflyU8iMs8n+AWTXjJ0dO1UOQCI6Hy4+jIEZUWhqqFmWvSQSs2NE1hS opBoUopd/2xYH/l/zhHaVCizTclrZQQH08DNiua5Gu1DWcgvmEkN5zavy1CYbkTkyQJm8pLpFwWcI fM6Vc7cnzjwFsVMWQKxXqBVLnBWT/2dZAjUQeF/gNKUCyzHJ7HXF+mjPwno1ZoM8IbdrcNw6T9dRi zTihN6zeOb/JFeFqQThZ7bCi5FSkhqmUYig2dV9NYADTXMWLLnJypvMfzFekciDFFuJaygDsWczEp IjFinIsSzAB4ZNnZazeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAfV-00AAgx-AO; Thu, 12 Aug 2021 13:22:45 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEAfC-00AAbF-Sf; Thu, 12 Aug 2021 13:22:32 +0000 X-UUID: 14e5db1e517747d285271c67757996c8-20210812 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=isZewrvhUAspj+Ym9WjkmsDhRj1UHJLxR6oBM9ThYKY=; b=t2dKCVn42kEXs8zLm1NLIBwiCaMIBcUYLcCM6z0N5LXDqRQTcADmM9idSjvr/NNtPScJ3/XKKzVw/36pDY9IFcKq3HfGDqN2b9GBuE22vP1JG+DodZLON9VfsTtb3jZzDTkFNneIVkEH4NQCU62RdOe8OhSvOCs3TQ9SH/RuI4o=; X-UUID: 14e5db1e517747d285271c67757996c8-20210812 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 987583130; Thu, 12 Aug 2021 06:22:24 -0700 Received: from mtkmbs05n2.mediatek.inc (172.21.101.140) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 06:18:44 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 21:18:43 +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:42 +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 Subject: [PATCH v2 7/7] usb: gadget: remove unnecessary AND operation when get ep maxp Date: Thu, 12 Aug 2021 21:18:03 +0800 Message-ID: <1628774283-475-7-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 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_062227_171205_8A6E74F3 X-CRM114-Status: GOOD ( 12.12 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org usb_endpoint_maxp() already returns actual max packet size, no need AND 0x7ff. Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun --- v2: add acked-by felipe --- include/linux/usb/gadget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 75c7538e350a..f181c84310b6 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -491,7 +491,7 @@ extern char *usb_get_gadget_udc_name(void); */ static inline size_t usb_ep_align(struct usb_ep *ep, size_t len) { - int max_packet_size = (size_t)usb_endpoint_maxp(ep->desc) & 0x7ff; + int max_packet_size = (size_t)usb_endpoint_maxp(ep->desc); return round_up(len, max_packet_size); }