From patchwork Wed Sep 16 13:25:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 312446 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp445480ilg; Wed, 16 Sep 2020 06:03:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY4Ds5186gCaUuSru5aY4CaClCc4CMlmj/GogVlnZucBg/ltrQMvsTAjw8n5+fl1KYvnlo X-Received: by 2002:aa7:dd01:: with SMTP id i1mr27817428edv.121.1600261401893; Wed, 16 Sep 2020 06:03:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1600261401; cv=pass; d=google.com; s=arc-20160816; b=mKeTLA4Ve2cIdCcYwFaDNVBH4epOj4d6vXVH/1kkNF3ZQDDopkquVIk5KQmUVS/34R zG4TDAAX8lfmk9xs1jexQqDgYSZmE+5la8EhB2tnoEfqLRv8zG4bXhojO33LxvUHj3El uOdFs0Z9aYanCUeZaATPOoSPfi5+OVuPM/KRIYUtC+HTuYai6Qu84x3VM9T4FBVKulRL 8DgO6oc8Ga7v9kqnXK4KEcdYDACz1nTevcfMtdL0fb6tXmugWBCsTRRgE36bfGpmlCGY lzosY3ATetIncLsiC7BL5NHXfIJJzTtgf0t57faRTJnKR83g++Ej6mopsW10tXjWLk4n vpOw== 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=GWgFlmhWpvKah3TNkQkSc8+F3n+vP12EppyMVpsrYSUYr8mdqLXmJZlp7B2LKCWi3f OI7VruUZdT/dkTrv0gaSGDYRJUEaxcgESzcUBNYvY5UFPYzVb1rbwWAaCN3j72Q1FFMM /dZNeAmCj/QQHT8NWKpynamLGokvz4am3mLNjFk+cRotoK+txd4oTeA7QJJlhWQKhJLO z+7VkpgIkPP5J+WEVTowDuNlS/CWmCselgra4Z3Z1wM9RWrq6LQc7w608kBg8Hacd5Xe e6i5MFov7QkuVzk0cnFO4YHMglxMYvTdVQlCEUr6HBXN8nd+PLheGJuf9z/l3+8vsZ95 n7Dg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=gHS7xJne; 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 oq7si8080698ejb.650.2020.09.16.06.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 06:03:21 -0700 (PDT) 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=gHS7xJne; 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 B07AA823AC; Wed, 16 Sep 2020 15:00:42 +0200 (CEST) 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="gHS7xJne"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A646182380; Wed, 16 Sep 2020 15:00:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe1f::61b]) (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 70A6B8236D for ; Wed, 16 Sep 2020 15:00:24 +0200 (CEST) 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=T2Fw7rm2qMoQxXwn/6aRwFUJUoCnHpReRRSC+VUNkymepQZlpvV2xMshxXvr/3na8cmfjNjXn056xKzkrnfWr63Eu/02kBVmtHplZpnavxS2MwmAYyEvfDyM2FFiQQQgRIsW0nLbO5nqFPXxYduXUZsaGvfr/Hv4/EjxvnLTp0qZHO2o/y5zFr5OBA5ok+izWRbYHqzymY6QQOpU/rKvcaQP2yY6lTFt1TL6/tlXFUIdn4t7M11OUaqT9hd5mbJjo/der4e5lwfLmGVSZn89u/zx95w7ZGPcdmAOi5PC4rJzov1W9VXReISQfJMzRBpQZ0zRmWWw/01fvA3/YbPy1A== 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=aCxMsVWjNkGRtI1qw3KvIsK8ecTOzhNYkJOQrU4aldc5BrmeP3e9ojUpSTp1IeFHkJ0ocNr2J532UAm+7sMnLjQaE2/aNMtOcO3TS+1nUAL/DpZwwv86fDtYrn+yx2lpX7MDUbCNeow7LMCTPLJkzFpzY7ppEnSbENCBneWGrvfMSvB8q6dhopwaKXzOK+8i3m4RSTx5eCACrJBwBKzAShL9+01dN6AUE/aa3Q2o/NnjR5AcT0PHPbjC+G1dvWc1zCDPlBKED1v1YEcjvPeKF3mOHShqpmSShNUxgfn4sZY88f6TdlK907OF64QiVpMb1cIZHGb8meSKDAJjvCUizw== 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=gHS7xJneO91y6IuHLdowil+bzRS+sK/cfbe97NtIok46y31k6AqYZInJPoKErAimHjA7fnbyQOBZuYjIIM4ozT8jEC3IgVAWNv7Mo0sJBOcjg6VrH+HNBjbIXZaPbyzoYWWJUuXx98agIqefkQXNzGDzC1OTWjDppdVgv3x6wmk= 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 DB6PR0401MB2373.eurprd04.prod.outlook.com (2603:10a6:4:4b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.18; Wed, 16 Sep 2020 13:00:23 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413%10]) with mapi id 15.20.3370.019; Wed, 16 Sep 2020 13:00:22 +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 15/16] usb: gadget: fastboot: use correct max packet size Date: Wed, 16 Sep 2020 21:25:36 +0800 Message-Id: <20200916132537.8313-16-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916132537.8313-1-peng.fan@nxp.com> References: <20200916132537.8313-1-peng.fan@nxp.com> X-ClientProxiedBy: SG2PR03CA0131.apcprd03.prod.outlook.com (2603:1096:4:91::35) 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 SG2PR03CA0131.apcprd03.prod.outlook.com (2603:1096:4:91::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.5 via Frontend Transport; Wed, 16 Sep 2020 13:00:20 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e9d4a9ba-1e61-489b-9e20-08d85a4078ce X-MS-TrafficTypeDiagnostic: DB6PR0401MB2373: 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: IoHwAc1rMLzpbd+H0EHzbhXnvsVJjck43MwL7dzP3Zu7hRIQOAWC1RIE3SfAqZcfE0sQ0m7YWHkAgTDHSqu+UDV25c4HPkR84/6IuhWbAAxF5sMkiW00mH512mPKaV1MojdiclhQd04UI+ajZuVZxm2cO1FH4+WMtNzZVwhFGLcT+FYSBUBNyv3b12cYq19tRmPvq3vaX3RqwOueS/3lfcLQA+mjfSaks56RkJuo9bxh5u0GWZazk4MS0HxQckpt0MRYhDM7tBmrUXHCxss36xPitH6f7798Ny4zZOzJ+ZSdLSwC9JLnCZJmnzk1HjMQA2O2tGYnf4eimwmDlsaA7Q== 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)(346002)(366004)(376002)(136003)(39860400002)(396003)(54906003)(6666004)(9686003)(4744005)(1076003)(6512007)(5660300002)(478600001)(52116002)(36756003)(6506007)(66946007)(26005)(6486002)(16526019)(186003)(956004)(316002)(66556008)(66476007)(2616005)(86362001)(83380400001)(8936002)(2906002)(4326008)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: u/cRqUN/7yyEmrbyCJEBhgysMnwk2tO6StcK2527YExqbZ4Q7HRPuz1dU1FbwMN45g2PD0BPrZ5vIScstW8tkZ4pjoXKR3BIAppP3EhIvmZDUTY69AZ19j3h6K7AB+pQU7B/taCYWlbE6SxWXHJDlRMo/t/hPwMjBareDYqvUBg6JnSb5U42mfJiLB448xBp6xHbd89q5owXEyrUm4m/6+W3tZhG/Rjdmd0CPbhx/xXE4d/A51oejKZVTR/XARihCzQT169HRLik++eM7ia9QGmjRrYkHMw0tOo6T4K2OvdEJ89GZdTzxIVkzFPayTEZVes6GdOfgswk/ZeSxg1MNY9VZDXFHNMcAzgttwdzAKBfJGNayfpeNWeiXUtwymzVoTF9W6QFJPoht0p5B7uRd+qjkw0YzhpW4FyTnzr18FlOaP75zOQGyYXOuSHwZT72piJZ5AIgOfi9QxPi0y4tdyMSlACVpytOVKAu071vdEi53myj3WzLKXfnVq2cb5j09xGYZlvtop1zbifMrM1Pd5nmJbB02PEtlQHoGzXjZXcl36V6Ns59Dssu7fAGEt1/ajJXC4O3QQKFmqTrvqYJaJw0U1IzYcnS/8sNDzZhJ7O/pB/jDPnAAU4p76jwznwvX+Qaj0k8MktUD3xgUGvj2w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9d4a9ba-1e61-489b-9e20-08d85a4078ce X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 13:00:22.8386 (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: qstZPJItCfonngAMJHko6y4nEruv0P/PqCWEg924k1GdDioQ6kKNxQILz8SmwivKBmp9AJNMMbzBNsYJYrQe0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2373 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;