From patchwork Wed Sep 16 13:25:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 312438 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp443780ilg; Wed, 16 Sep 2020 06:01:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ6qcJkJI6y5IEpOs7Ju7MpSaF6rGkE7Z2oOIDPj+rp8nsLM/RVVRK4IlxCJf3LY3xar7A X-Received: by 2002:a17:906:6993:: with SMTP id i19mr24362335ejr.26.1600261309370; Wed, 16 Sep 2020 06:01:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1600261309; cv=pass; d=google.com; s=arc-20160816; b=QktyWqk+CFHZRdWTJkomLo7w3A1PoOv9B4NOj4r8YMdPQy0bfLY8b57xfCMEi6Zh8k Bh4WM+H+XsDSvN2Wljx4qToQkmjKdgnyOBuNqSi9IY8GcwIA8BpmOYPu/Gh9+guSm6px I5MgBiSNntMog5avfsF+LH6O8AYxa/TdanI+t3xETIh25S9OHOOdoHuFodKsr4vSFxDw Xon/oeZCnmcBuplGJphjxvGBTZ7dMHr7emAbrcvUiI07K9iSlMSMCE1lunpoxCbaZcan TXmyIhuFZeffX2DTaAILLhWifc4AZJlox81MrqsUnVuCabD/42OvBozUtMT7UbCJPCdP Besw== 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=xJ+2eE6HdDeQe8eJSQdlgr7r59p348khGVRu63l4dMA=; b=jk88u5cIQo0/kdVjIJd+1kCaTto4fcpCs6jA8YMIoP2wfvOoBipEG4Rv62ez7j3S+z 0z0sFEWLemI0vrqVU/0E+ql+pv1UcEUpJISFgSvl0d1P2dcSYW1tEe3lVZOfqXouOjSV Xt+M/hUPev4Av/Mg5erZ6ZaI+Wto7TuVZnsCm1n39C+zcFk3ySMMYs3bDSNRPSYteyiJ dtRtyaWNXSIOoebblqqvTlkNPnrgkGj4i9bpwdJVl++shjJvsfQYE90FVpSD4Va3PbyT FcKX2skVQk4v07pb2/yFgBqkgs2b8NcTQxDFaOIbL0gfwObuZ5pPOkI017mWNLWG/cSy qtIw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=HbR+CBs8; 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 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id f11si11657615edq.528.2020.09.16.06.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 06:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=HbR+CBs8; 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 85.214.62.61 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 A4F7A82385; Wed, 16 Sep 2020 15:00:25 +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="HbR+CBs8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C874882374; Wed, 16 Sep 2020 15:00:10 +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 EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20608.outbound.protection.outlook.com [IPv6:2a01:111:f400:7d00::608]) (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 06D8982348 for ; Wed, 16 Sep 2020 15:00:01 +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=XT+Gj8r3/GSRSJSiTSVFdczYUQZfpPcXw7YnAlqL36pnE3OhmC9kkG1eZoMgv+byPi6Lkfu1fNmauKvVxGf1u6ODjgAA1KJ1AChLFurgUsKMYsNhYsMIMtwJxTLkxd4fU07zAlEtuVyrNUK37f1UFC+/+UsXLdz8Ty7xC9oTxcRZjI+T0ywQQSU9zUFmf+lKsm4pCrANjgyk/Y+1v/2RKOtZ+S9D2tO5bYgFb9pXT3nFx3gAhZ3XgkJKbLoKNHRFM3dR/jKBBq8UF6hvBnl7OSI79buytBar3eO3LvRR/0ATFeP9Benc0pFw+HPGWA/+eLt3MqorRIpqIAJUEL6k8Q== 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=xJ+2eE6HdDeQe8eJSQdlgr7r59p348khGVRu63l4dMA=; b=ZvAhtLrkEjkvVVi7alSCb/ksngXngnNbSrnygBxyXWG0RIe8Ad/Z7QSoPSAOJ1so89cQClJW2BbR/IuflTNsNxxuAnGuEhyaSP1jeYj4SWWhnjcyKeupf3o3Al2ChNB9cVISd3JHy04hb4alJejZ7AcQmgqqxFK2GdiSYuUZZVB8joGc+ee9wUXQyKGHguoPniWHJk7lxRoGhzi2FqgAZyMclrfAer85k6MDoIrt3PRXjd+dLQE1QY3TAPsHU65gnc5LEFar8B+WyRvS2DFxoELBhT9y2Kee84fCuypZxVwkiyBUg1fYR1+gCHMCQ6X0m6I+/qGNJjmyeX0+PtMx6Q== 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=xJ+2eE6HdDeQe8eJSQdlgr7r59p348khGVRu63l4dMA=; b=HbR+CBs84ECTaRQYfAcIjyiiy25CscDgC2HvIP1VTqY/H+ns0HUzdH0dz2tSilbY1nTwvOxZjWmZ7shay/NP4J/THQQiTa8fLhCLyjDhxQnG9lLfmX4pbG5WHyrqKB/tUNGVdQugYxxagPgKMl0CZYaKqKElhD7sjJcMpoaR2Gk= 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 12:59:59 +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 12:59:59 +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, Jun Li , Ye Li , Peter Chen , Peng Fan Subject: [PATCH 08/16] usb: gadget: set correct usb_configuration for os_desc_config Date: Wed, 16 Sep 2020 21:25:29 +0800 Message-Id: <20200916132537.8313-9-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 12:59:56 +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: 05a95009-651b-4da9-cd21-08d85a406b0e X-MS-TrafficTypeDiagnostic: DB6PR0401MB2373: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:569; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5WQ2dbxF5sCugwKjSs9aSV2yLB49mwZQ8qoXw/0qsvOHo0g0NkCAiqMZC321t6I16oZOUfmRteCKpPKwQXqv5o3uU2BRxLu/0QzQaQUdsp4ElJpRTkeKg8M9w9mOh3qEsAFLM8INZKq637Yz+5Dmb3EtVlShAqR/ThaIp+40xTTmRqqI8YtMlxMipjZF0JxkvJzq/FnJhM6tCEmQ9F8w3Ad9fHDWm7pDEg5+3qQOlAfoqkYQXbJWIIJG1iJ27UXtNpKbkR2owU7QMIfC2ePFMFDDetsKz8k8JVaZiFdmo0+pVD5Dfhr7B6dg1D/a5v7bnIzxXT425ZJbf2yiOOqlkg== 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)(45080400002)(54906003)(6666004)(9686003)(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: w5PwshD0XiLYHgOtYjIGFAFwKcBbJ43FvaSZAwbGMFZtM1pvbsihUzXOpF61pZ+UFfKaDFY2fzpblli0VNjGYS9aLocsjMbHiTMs9zTuLdD9otyt6JMZfTmSspjAiPV+HAADWxQhWHRTc58Rnpufqw/Pa5e62GlW2/hpmPnZyT2WqPW7Amvldy94YwxzENuAErrR53E1X6mItJBV9W9ip7PJp4spePSjzCl9041xTwIWEvpU5DYo8Z66OnGC7lNoGzfDxDYmuj9OSSTXd3QV5+90MY+R6fiAyQhr8H0HzgKOO6pNMG85BTIHpATwR8x501ZNI849u0SnXS/3aF+xFR3OgJk9FeWAOn55/+OIZJCoVndKuJI9W6VZms8GIl7rOEvSPrtUQjeRceNeT4VtVhFNoHbg7mzuee9cWiB0pYjyWszXqcfS8JUhnUba+H4gId1MEJcF9dmoVmnKA/9Oq7yJO5hZ++k/qQTtwrqNyq2S+dvDRzvcinR1MkPSmjC0WkzCGkObIt+un9m7tfcaPyPeEHJG5qWuHmNUf0a91PNKP7rQCVe02vxWHLqLWhzkZ0+issydxopC332/Uf9oNFeNSGKluvEp/xrD7WkkbarVwjWKUVg7EPcnczRm2en/U1v7xLIItH1xfyVokb3HLQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05a95009-651b-4da9-cd21-08d85a406b0e X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 12:59:59.5853 (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: mNResl9rmRz6UuP5eHuX+riNY2Wukw3BOmv6xPif1MEHmrLKt5jtNB1Z6uxo3zdAjkQo89Pjjp5VsHLwHIVriA== 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: Jun Li The current way to set cdev->os_desc_config is wrong if user restart fastboot, as the old config is not used anymore and new allocated usb_configuration will be used, so set the os_desc_config while usb_add_config. Reviewed-by: Ye Li Signed-off-by: Li Jun Signed-off-by: Peter Chen Signed-off-by: Peng Fan --- drivers/usb/gadget/composite.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.28.0 diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 411cd33be5..071b4b4a6f 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -399,10 +399,6 @@ static int set_config(struct usb_composite_dev *cdev, goto done; cdev->config = c; - if (cdev->use_os_string) { - cdev->os_desc_config = c; - os_desc_config = c; - } /* Initialize all interfaces by setting them to altsetting zero. */ for (tmp = 0; tmp < MAX_CONFIG_INTERFACES; tmp++) { @@ -516,6 +512,9 @@ int usb_add_config(struct usb_composite_dev *cdev, usb_ep_autoconfig_reset(cdev->gadget); + if (os_desc_config) + cdev->os_desc_config = os_desc_config; + done: if (status) debug("added config '%s'/%u --> %d\n", config->label, @@ -1373,9 +1372,6 @@ static int composite_bind(struct usb_gadget *gadget) /* Microsoft OS String Descriptor */ utf8_to_utf16le(qw_sign_buf, (__le16 *)cdev->qw_sign, OS_STRING_QW_SIGN_LEN / 2); - - if (os_desc_config) - cdev->os_desc_config = os_desc_config; } debug("%s: ready\n", composite->name);