From patchwork Mon Jan 25 13:43:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 370237 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp3994653jam; Mon, 25 Jan 2021 05:29:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhEbKQAbyV1uE/+SUGRYhYASzLaJsVzO0Fboz56asjgybfF2bJ6WmkHnD23OmP+o8B4WHA X-Received: by 2002:a17:907:77d2:: with SMTP id kz18mr381185ejc.2.1611581384972; Mon, 25 Jan 2021 05:29:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1611581384; cv=pass; d=google.com; s=arc-20160816; b=NUiIzRcY9mDX5U2raTbXD/k7OeuhaY4UZfaAmeGRhRHB78ojl8/PQNuoOBjbtQ5jFj 2QyetEnVZrIahQeDSinj25eKtkdGP41OrE/sILVlgY87JCiulGqFsALoFc7HperoyKIX Gm1Z/gL3Hm0jJU1DEeEbBQDOSaO0XomICo0VochDSTvClfmUY/oGt9TkCmiKxkSGfE2q i5t1KWeLQdGfWn9v3Z0ZL1jWuX45Cz6r/jhwECI1s8p88VHh24tXm4A1dI0bwAbcGmCL PIfR8domQfVd53126Z9WO7rVrTF2ESrxTk/NhyNwKgAXaBT32PPyDFdFyD3uAfUdPkgJ HB0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ow5DkjysPi0X3lFMPlCEPhI+ZWbvBlZZ6kriWqHbQoM=; b=t/IbYZK/LIA9++1PKWfq08dya5vzOZ5IfhNI30ebIASuPhzpprNJglXkrrXV7vrX8G vGrLXUC8inLaadR1Y29OKG+7II7OmVRPqeUO/VdTy/e8SYqy0jO9vtwUnrKNyQbqvaFn WB177UHm1ys8hEBv7iuJyfNKIUdD2Lb8cfLchh+u10nefDstQWZX0WdKM5gIXHtWs+X9 IcZBxKupXoD8Zz9QGiLrH3TcXCc/i1j5vVuxlSAagFKSc09m+GuHfFsIrUBK+lIsowKn UK6b4ReogcdBYv1e+5gQkdbGAwYVAt/W3BYcarMq4aI+r35/HtIJZ9G8FIa97HTTrG3E YaeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=cUBewglJ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id i18si7143573edx.293.2021.01.25.05.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 05:29:44 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=cUBewglJ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3BC3827C7; Mon, 25 Jan 2021 14:27:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="cUBewglJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A24C82686; Mon, 25 Jan 2021 14:15:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-ve1eur02on0614.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe06::614]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3245082642 for ; Mon, 25 Jan 2021 14:15:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J3V7ohaveLt1VITTKKo4eLnmSqaN9G47hFKdVc8BZZbPD2n7QQyOOpvWdULo97WHqwRGvcSh0IrMkAguryEqFloXFx4GrU6igf75BSUgchcRl46UbJsgnRPp6ZY5ng2s19Z3J/e4GhVVGe6b3nC9+d9OUESDgauRL/jZjdGCqEbcd0kCLdlDaF3HOl4dbO9WYvfET6kvkhDuxageUA+CxgoHmzPz13fQ0w7RSakqmfmNGtjj3GNqRoaV51Sh4pY+goboa6+CanPmpksRKkrr5hhSYX6NtmPSwq0JLB2txc7g4e2CPyrpfW5OsEfErW4c0ozAImWsxPJxSuWFh27s3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ow5DkjysPi0X3lFMPlCEPhI+ZWbvBlZZ6kriWqHbQoM=; b=eEgLkmxUnFquenHrA1MGv98D3fLFXJGtO9+x/p7XRalTr4G24qPYPhVSWPWEzWPHJ0i9uYghNnZDCpYBJmdZA4Dy+d/kIbY9tyPWxtv3KpoeM09tyByEfFWR4gXhQ4206KLQxNNIjCIf76PB17aV2Od8tW2V2NxPjLpGB0Qayz/6gCsI6LAbtf6QvPPlVH3CcrkDd+QKIfEqzV++/VaZ8tvh1XR/u8dA2iI5rj/hpTrSje4aJu81QirLHhF/BzE4JHTQojOXaXT30qABb/lxFcKJgCQxOvoq2ncpZPQgGD0yLhM/NPFyGUFiXnA7SaIQheEiCq9T2TVJFkbtqkFkgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ow5DkjysPi0X3lFMPlCEPhI+ZWbvBlZZ6kriWqHbQoM=; b=cUBewglJfSpAFkDyWiv6Ljd4E+weVIdDglw8cb0dev97et3vkTMEejOe6mDIAA5dvl58R+bv3vYZtd7PnNFOwwgCc5RlMOVUa8PTpAwMtFr3ZD4kfRzLsrgSyO/RbGkjOMoRKFg9QLfO92+RSLpsBIwSNZNeuJdSoXR1otyTXMQ= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DBBPR04MB7930.eurprd04.prod.outlook.com (2603:10a6:10:1ea::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.17; Mon, 25 Jan 2021 13:15:24 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::d58c:d479:d094:43d0%9]) with mapi id 15.20.3784.019; Mon, 25 Jan 2021 13:15:24 +0000 From: peng.fan@nxp.com To: sbabic@denx.de, lukma@denx.de, marex@denx.de Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Li Jun , Peter Chen , Peng Fan Subject: [PATCH V2 16/17] usb: gadget: fastboot: use correct max packet size Date: Mon, 25 Jan 2021 21:43:59 +0800 Message-Id: <20210125134400.780-17-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210125134400.780-1-peng.fan@nxp.com> References: <20210125134400.780-1-peng.fan@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR03CA0117.apcprd03.prod.outlook.com (2603:1096:4:91::21) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR03CA0117.apcprd03.prod.outlook.com (2603:1096:4:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.6 via Frontend Transport; Mon, 25 Jan 2021 13:15:21 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d322f7ed-a50a-48ff-61dc-08d8c1334658 X-MS-TrafficTypeDiagnostic: DBBPR04MB7930: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CMn84pT8N3tM0YPi+pblCntQRqRjajZz02DDF1LUqORqrcpA1iabf7JBAfYRBJw1aJsbkxkcikrjPIOKu2EIppU6XiGL1IIbd4DmmsNSvuzRKxZSh0kBoWGi4HeXcZdReGiOL/MsV5JaOreQWgjf2rcsarEBbWiP31ENMtKofdLrGg02B6JHhPfNVIHJ/mvAiqE26x/WYww8KHtehktYGU45V2D42CQ0h5Oc4DHxmKdQWbEsrTIMLiG234aip2zb0YOJ0ADbYoUpYKDvo3VD5GNQFTUxAv3ZaNAzYi9lnNnlwSNdYGvt8yjLSZ5DNdlSWY5B2P1+mEQOPmgOs0VcdDMRjemVkrDVymAUztZHUg5GPFFWCsQloTBv5GaBcuAgAWmCh9v52SmKWEeLBo/qBA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(2906002)(66476007)(66556008)(8936002)(186003)(4326008)(16526019)(83380400001)(8676002)(4744005)(478600001)(66946007)(5660300002)(6666004)(9686003)(2616005)(36756003)(54906003)(1076003)(956004)(6512007)(6486002)(6506007)(86362001)(316002)(52116002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Q3Z9SHbEuGdHQbHfXjtfuqoz3YOOMiOa7RBe0T1K5Igm01IZgZo5aTM6lxufonVBE1OInziPvW99DSAL1Hb3nOMpsvQ+VkdzHJ+eCcEP53qL3w6UwfpKaqBDmo1VdgvW8pRj/cAg9EfCKkA98cGho2oJ4YVgmKeQFfp396DNCUX3Lhs6Vy6NPtLHsKVCeq2Y4POOTSH7vv4kA8Yc+QchV2Soc5yTyqTGgqzkotdnsyzCwoen87VBe683wRIks/bXOX77kBx99n2ECdqDHGvNSqAZ88lkCYw8eB68tGRFVbcR5i/QZG1oPJyet1KE+J3G9hco0fRzSjDrQw0crd+hMRPgsyFpQPdLiBcU0elH3Sba76dDckZ9sbmWWN+UdRTpCTpvHT/IKk/YCHLnv302E5lG3EKBWewhwC0Ess82EnxzViB6AbLA0XD2lygk3lTTuT0eZ2e9fY03ny5CRLOfmM5uR0y2YlZ1n2EDUg4Xwy1o2FQ+QreYxewZ+XazwbHmKAq3RqFRJ41UY8GH3e/WuPanDOyTAOVejwE0oSpDygS0bjt/pIDXuorfELdMq5lL7kC0CQ2sr6Q7GSWXP0NMMOJwdczhnK7BCnf++yJYAISNapdxHsf7iQr57fxqZNQbz/azW/kRAGM1B/Gz6Kjsl5/bYw0OTiNEt7wH0pQ+l+99V+3hhCwTZMOAGkiz3D6I9sQVH/U0CnKKeN7sJYCv+K0wL/sLxh/UCB/FNxQNgHTcZvh+HDk/m+Z9SzZzLTMd67cD6xcSKd+uvVta7rlb4/WPM8Zu8cGN/ms2RjD8QYCa5OlazgO4vJF6TLH4ldgHqWlWPYu12/2wOpd2OGpnAwPagbFJLXaIzy4gv6wC/RAbDguM88qOVs2jGeVZzJNJX4MznuPOU4LmvsYZ3oouUiBj6xsvc7DBbZKYXvlNM8nfoEMGEVBXvdN2a8gBM9qC77m2NpJfcI57XFttmuwfxlYogdoKT3wBManJ69pz1VLqKaZHt/yh3YaXz8Fwy1ZV X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d322f7ed-a50a-48ff-61dc-08d8c1334658 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2021 13:15:24.5653 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /Om3mkQ4Qe69MXk5yLaX+CSgjJ/4InVM1VdSux5t4Pjp1Ghtk7zyIX4naqlXt2O4K0kWN/aECMBKXzvy1nK14w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7930 X-Mailman-Approved-At: Mon, 25 Jan 2021 14:26:22 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Li Jun Change to use wMaxPacketSize of current speed EP desc for request length wrap up. Reviewed-by: Peter Chen Signed-off-by: Li Jun Signed-off-by: Peng Fan --- drivers/usb/gadget/f_fastboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.28.0 diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index c2abdd66a8..2ef75a1388 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -427,7 +427,7 @@ static unsigned int rx_bytes_expected(struct usb_ep *ep) { int rx_remain = fastboot_data_remaining(); unsigned int rem; - unsigned int maxpacket = ep->maxpacket; + unsigned int maxpacket = usb_endpoint_maxp(ep->desc); if (rx_remain <= 0) return 0;