[{"id":1761258,"web_url":"http://patchwork.ozlabs.org/comment/1761258/","msgid":"<CAKaJLVsSTWw87=EFLFi8uaUU_e003KqGicq_-=ospeqWwEyCNQ@mail.gmail.com>","list_archive_url":null,"date":"2017-08-31T18:45:56","subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","submitter":{"id":68333,"url":"http://patchwork.ozlabs.org/api/people/68333/","name":"Sam Protsenko","email":"semen.protsenko@linaro.org"},"content":"On 31 August 2017 at 21:20, Sam Protsenko <semen.protsenko@linaro.org> wrote:\n> Since 842778a09104 commit, \"fastboot devices\" stopped to show correct\n> device serial number for TI boards, showing this line instead:\n>\n>     ????????????        fastboot\n>\n> This is because serial# env variable could be set after g_dnl gadget was\n> initialized (e.g. by using env_set() in the board file).\n>\n> To fix this, before checking g_dnl_serial, let's re-check if we have\n> valid serial# value. And if so, let's set it as g_dnl_serial value.\n>\n> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>\n> ---\n>  drivers/usb/gadget/g_dnl.c | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n>\n> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c\n> index 0491a0eea9..e4d0289757 100644\n> --- a/drivers/usb/gadget/g_dnl.c\n> +++ b/drivers/usb/gadget/g_dnl.c\n> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)\n>\n>         g_dnl_bind_fixup(&device_desc, cdev->driver->name);\n>\n> +       /* First try to obtain serial number from serial# variable */\n> +       if (strlen(g_dnl_serial) == 0) {\n> +               const char *s;\n> +\n> +               s = env_get(\"serial#\");\n> +               if (s)\n> +                       g_dnl_set_serialnumber((char *)s);\n> +       }\n> +\n>         if (strlen(g_dnl_serial)) {\n>                 id = usb_string_id(cdev);\n>                 if (id < 0)\n> --\n> 2.14.1\n>\n\nSimilar commit: [1]. But I'm not sure that implementing\ng_dnl_bind_fixup() in board file is the best way to fix it.\n\n[1] http://git.denx.de/?p=u-boot.git;a=commit;h=e91ead868b536d0a0dc49aa48f4d8c80c1a94b79","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"EcBJDlyT\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjrtV3v0Sz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 04:46:09 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid AB201C21EA1; Thu, 31 Aug 2017 18:46:02 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id A8D24C21D7A;\n\tThu, 31 Aug 2017 18:46:00 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 914BBC21D7A; Thu, 31 Aug 2017 18:45:59 +0000 (UTC)","from mail-io0-f169.google.com (mail-io0-f169.google.com\n\t[209.85.223.169])\n\tby lists.denx.de (Postfix) with ESMTPS id B0408C21D63\n\tfor <u-boot@lists.denx.de>; Thu, 31 Aug 2017 18:45:58 +0000 (UTC)","by mail-io0-f169.google.com with SMTP id 81so3666288ioj.5\n\tfor <u-boot@lists.denx.de>; Thu, 31 Aug 2017 11:45:58 -0700 (PDT)","by 10.107.26.213 with HTTP; Thu, 31 Aug 2017 11:45:56 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=1aLv0cCoYHFmEW0yh2/dUpiSfZiwsc21QVC3jcrKI1w=;\n\tb=EcBJDlyT4p2NffDo6sX04giaWU33lykw1fL4FBCp1HyR7uClO54sgM5/FFNfU7oC7s\n\t5e3B0VmiWriu72C+dhXMws7sdjbsaVsIz4U/UvMhJNK7ksUF/u3PdfYG4RPi3HyhpPeZ\n\t7UW4om1XEscsV0s9N+w8K4q/8mPwgByjL1yTA=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=1aLv0cCoYHFmEW0yh2/dUpiSfZiwsc21QVC3jcrKI1w=;\n\tb=tE+bGVrTcMtf7eZ5J68sHoMwVvKj8Rgq++mO8XmM/03CbwD18Gi19Ibm/hJm8nGlCf\n\t8zWIa9IKM1jrpCK+gwO/PjgzsNEJ9qxSus2DrolJQYgagpnz78HSxX5lUQdlg87RGc58\n\t09MxYiT1Fbc4+CdR9EX8yQT6u0gHs3plbaRSqi1Yb9T5Y4+EQHme8BFofueuyaEtI8OP\n\tMQlmIfMVUDzlYlFnAypb2T9A92rTJdr4QZ2aLLdMfz7Duannx3M5O0wpqXpncRXsMQKS\n\tAMQPdCS65uKsGoLMO5XJ157HXHifzhEzCblJDpt1DMKw/rg+LBcQr6q8dUEvZso5NAl8\n\tudWg==","X-Gm-Message-State":"AHPjjUhmikeR4n2C4SySu0qb8Ff6XFzw/xbJlhrQ8D8ibtcSygRuJY+I\n\t1PAupmPui44IUs3E283vOgFnIL0iGT+dgmNXcw==","X-Google-Smtp-Source":"ADKCNb5zFsIy6oiOP1tpQIEZdsOrB3uJJ/TwMDyz17A+tlFotFZO4zTQdKdC0jHDerLwYbF9kbrBKTJq4rrYfhBavcQ=","X-Received":"by 10.36.66.148 with SMTP id i142mr1850823itb.106.1504205157459; \n\tThu, 31 Aug 2017 11:45:57 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170831182004.24946-1-semen.protsenko@linaro.org>","References":"<20170831182004.24946-1-semen.protsenko@linaro.org>","From":"Sam Protsenko <semen.protsenko@linaro.org>","Date":"Thu, 31 Aug 2017 21:45:56 +0300","Message-ID":"<CAKaJLVsSTWw87=EFLFi8uaUU_e003KqGicq_-=ospeqWwEyCNQ@mail.gmail.com>","To":"U-Boot Mailing List <u-boot@lists.denx.de>","Cc":"Marek Vasut <marex@denx.de>, Tom Rini <trini@konsulko.com>,\n\tPraneeth Bajjuri <praneeth@ti.com>","Subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1761305,"web_url":"http://patchwork.ozlabs.org/comment/1761305/","msgid":"<3e24b88c-acf0-994d-f2b1-8bdb9383c632@denx.de>","list_archive_url":null,"date":"2017-08-31T20:24:56","subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","submitter":{"id":70701,"url":"http://patchwork.ozlabs.org/api/people/70701/","name":"Lukasz Majewski","email":"lukma@denx.de"},"content":"On 08/31/2017 08:45 PM, Sam Protsenko wrote:\n> On 31 August 2017 at 21:20, Sam Protsenko <semen.protsenko@linaro.org> wrote:\n>> Since 842778a09104 commit, \"fastboot devices\" stopped to show correct\n>> device serial number for TI boards, showing this line instead:\n>>\n>>     ????????????        fastboot\n>>\n>> This is because serial# env variable could be set after g_dnl gadget was\n>> initialized (e.g. by using env_set() in the board file).\n>>\n>> To fix this, before checking g_dnl_serial, let's re-check if we have\n>> valid serial# value. And if so, let's set it as g_dnl_serial value.\n>>\n>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>\n>> ---\n>>  drivers/usb/gadget/g_dnl.c | 9 +++++++++\n>>  1 file changed, 9 insertions(+)\n>>\n>> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c\n>> index 0491a0eea9..e4d0289757 100644\n>> --- a/drivers/usb/gadget/g_dnl.c\n>> +++ b/drivers/usb/gadget/g_dnl.c\n>> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)\n>>\n>>         g_dnl_bind_fixup(&device_desc, cdev->driver->name);\n>>\n>> +       /* First try to obtain serial number from serial# variable */\n>> +       if (strlen(g_dnl_serial) == 0) {\n>> +               const char *s;\n>> +\n>> +               s = env_get(\"serial#\");\n>> +               if (s)\n>> +                       g_dnl_set_serialnumber((char *)s);\n>> +       }\n>> +\n>>         if (strlen(g_dnl_serial)) {\n>>                 id = usb_string_id(cdev);\n>>                 if (id < 0)\n>> --\n>> 2.14.1\n>>\n>\n> Similar commit: [1]. But I'm not sure that implementing\n> g_dnl_bind_fixup() in board file is the best way to fix it.\n>\n> [1] http://git.denx.de/?p=u-boot.git;a=commit;h=e91ead868b536d0a0dc49aa48f4d8c80c1a94b79\n>\n\nI would opt for having g_dnl_bind_fixup() since it is generally used for \ntweaking board specific data to gadget subsystem (like vid, pid, serial \nnumber).","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjv4h3xZyz9s8P\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 06:25:08 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 3FEDFC21E51; Thu, 31 Aug 2017 20:25:04 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 7D2BAC21D7B;\n\tThu, 31 Aug 2017 20:25:01 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 6C4C4C21D7B; Thu, 31 Aug 2017 20:24:59 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10])\n\tby lists.denx.de (Postfix) with ESMTPS id DECA2C21D7A\n\tfor <u-boot@lists.denx.de>; Thu, 31 Aug 2017 20:24:58 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xjv4V1d7sz1qsgY;\n\tThu, 31 Aug 2017 22:24:58 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xjv4V00KWz3hhTh;\n\tThu, 31 Aug 2017 22:24:57 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id I1PpwqiFPCTc; Thu, 31 Aug 2017 22:24:56 +0200 (CEST)","from [192.168.2.222] (89-77-92-62.dynamic.chello.pl [89.77.92.62])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tThu, 31 Aug 2017 22:24:56 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","X-Virus-Scanned":"amavisd-new at mnet-online.de","X-Auth-Info":"wi22XTYkAk7t0R8PYN33s8vO0ar04VKkZKDL/3nUHtM=","To":"Sam Protsenko <semen.protsenko@linaro.org>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","References":"<20170831182004.24946-1-semen.protsenko@linaro.org>\n\t<CAKaJLVsSTWw87=EFLFi8uaUU_e003KqGicq_-=ospeqWwEyCNQ@mail.gmail.com>","From":"=?utf-8?q?=C5=81ukasz_Majewski?= <lukma@denx.de>","Organization":"DENX","Message-ID":"<3e24b88c-acf0-994d-f2b1-8bdb9383c632@denx.de>","Date":"Thu, 31 Aug 2017 22:24:56 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.8.0","MIME-Version":"1.0","In-Reply-To":"<CAKaJLVsSTWw87=EFLFi8uaUU_e003KqGicq_-=ospeqWwEyCNQ@mail.gmail.com>","Cc":"Marek Vasut <marex@denx.de>, Tom Rini <trini@konsulko.com>,\n\tPraneeth Bajjuri <praneeth@ti.com>","Subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1761512,"web_url":"http://patchwork.ozlabs.org/comment/1761512/","msgid":"<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>","list_archive_url":null,"date":"2017-09-01T08:19:02","subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","submitter":{"id":12009,"url":"http://patchwork.ozlabs.org/api/people/12009/","name":"Marek Vasut","email":"marex@denx.de"},"content":"On 08/31/2017 08:20 PM, Sam Protsenko wrote:\n> Since 842778a09104 commit, \"fastboot devices\" stopped to show correct\n> device serial number for TI boards, showing this line instead:\n> \n>     ????????????\tfastboot\n> \n> This is because serial# env variable could be set after g_dnl gadget was\n> initialized (e.g. by using env_set() in the board file).\n> \n> To fix this, before checking g_dnl_serial, let's re-check if we have\n> valid serial# value. And if so, let's set it as g_dnl_serial value.\n> \n> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>\n\nCan't we use U_BOOT_ENV_CALLBACK() here instead and set the serial\nnumber when the environment variable is set ?\n\n> ---\n>  drivers/usb/gadget/g_dnl.c | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n> \n> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c\n> index 0491a0eea9..e4d0289757 100644\n> --- a/drivers/usb/gadget/g_dnl.c\n> +++ b/drivers/usb/gadget/g_dnl.c\n> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)\n>  \n>  \tg_dnl_bind_fixup(&device_desc, cdev->driver->name);\n>  \n> +\t/* First try to obtain serial number from serial# variable */\n> +\tif (strlen(g_dnl_serial) == 0) {\n> +\t\tconst char *s;\n> +\n> +\t\ts = env_get(\"serial#\");\n> +\t\tif (s)\n> +\t\t\tg_dnl_set_serialnumber((char *)s);\n> +\t}\n> +\n>  \tif (strlen(g_dnl_serial)) {\n>  \t\tid = usb_string_id(cdev);\n>  \t\tif (id < 0)\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkBwm1hXJz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 18:19:19 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid BA096C21DF9; Fri,  1 Sep 2017 08:19:10 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 3AE6CC21DC5;\n\tFri,  1 Sep 2017 08:19:08 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 6AD88C21DC5; Fri,  1 Sep 2017 08:19:07 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9])\n\tby lists.denx.de (Postfix) with ESMTPS id DF8FDC21C27\n\tfor <u-boot@lists.denx.de>; Fri,  1 Sep 2017 08:19:06 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xkBwV2Bq2z1r7C0;\n\tFri,  1 Sep 2017 10:19:06 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xkBwT6Ktqz3jR9m;\n\tFri,  1 Sep 2017 10:19:05 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id j8Dbc5wpOEvR; Fri,  1 Sep 2017 10:19:04 +0200 (CEST)","from [IPv6:::1] (unknown [195.140.253.167])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tFri,  1 Sep 2017 10:19:03 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","X-Virus-Scanned":"amavisd-new at mnet-online.de","X-Auth-Info":"anl9xGDfgbf6ZXL6WMvwZ+yROoLlSbgu6wLG4NDUxUk=","To":"Sam Protsenko <semen.protsenko@linaro.org>, u-boot@lists.denx.de","References":"<20170831182004.24946-1-semen.protsenko@linaro.org>","From":"Marek Vasut <marex@denx.de>","Message-ID":"<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>","Date":"Fri, 1 Sep 2017 10:19:02 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170831182004.24946-1-semen.protsenko@linaro.org>","Content-Language":"en-US","Cc":"Praneeth Bajjuri <praneeth@ti.com>, Tom Rini <trini@konsulko.com>","Subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1761519,"web_url":"http://patchwork.ozlabs.org/comment/1761519/","msgid":"<6de2578a-2808-abba-f4ef-9eafb8d1df27@denx.de>","list_archive_url":null,"date":"2017-09-01T08:36:42","subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","submitter":{"id":70701,"url":"http://patchwork.ozlabs.org/api/people/70701/","name":"Lukasz Majewski","email":"lukma@denx.de"},"content":"On 09/01/2017 10:19 AM, Marek Vasut wrote:\n> On 08/31/2017 08:20 PM, Sam Protsenko wrote:\n>> Since 842778a09104 commit, \"fastboot devices\" stopped to show correct\n>> device serial number for TI boards, showing this line instead:\n>>\n>>     ????????????\tfastboot\n>>\n>> This is because serial# env variable could be set after g_dnl gadget was\n>> initialized (e.g. by using env_set() in the board file).\n>>\n>> To fix this, before checking g_dnl_serial, let's re-check if we have\n>> valid serial# value. And if so, let's set it as g_dnl_serial value.\n>>\n>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>\n>\n> Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial\n> number when the environment variable is set ?\n\nHmm... This might work.\n\nHowever, I'm a bit concerned with having \"bound\" the one particular env \nvariable (\"serial#\" in this case) to generic g_dnl.c code.\n\n\n>\n>> ---\n>>  drivers/usb/gadget/g_dnl.c | 9 +++++++++\n>>  1 file changed, 9 insertions(+)\n>>\n>> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c\n>> index 0491a0eea9..e4d0289757 100644\n>> --- a/drivers/usb/gadget/g_dnl.c\n>> +++ b/drivers/usb/gadget/g_dnl.c\n>> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)\n>>\n>>  \tg_dnl_bind_fixup(&device_desc, cdev->driver->name);\n>>\n>> +\t/* First try to obtain serial number from serial# variable */\n>> +\tif (strlen(g_dnl_serial) == 0) {\n>> +\t\tconst char *s;\n>> +\n>> +\t\ts = env_get(\"serial#\");\n>> +\t\tif (s)\n>> +\t\t\tg_dnl_set_serialnumber((char *)s);\n>> +\t}\n>> +\n>>  \tif (strlen(g_dnl_serial)) {\n>>  \t\tid = usb_string_id(cdev);\n>>  \t\tif (id < 0)\n>>\n>\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkCK95RQKz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 18:37:00 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 01740C21EE6; Fri,  1 Sep 2017 08:36:51 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 26A64C21EA8;\n\tFri,  1 Sep 2017 08:36:49 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 53770C21DC5; Fri,  1 Sep 2017 08:36:48 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10])\n\tby lists.denx.de (Postfix) with ESMTPS id D89C8C21EA8\n\tfor <u-boot@lists.denx.de>; Fri,  1 Sep 2017 08:36:47 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xkCJv1hbFz1qw7c;\n\tFri,  1 Sep 2017 10:36:47 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xkCJt71Tsz3hht1;\n\tFri,  1 Sep 2017 10:36:46 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id FjEFS8gktV-i; Fri,  1 Sep 2017 10:36:43 +0200 (CEST)","from [192.168.2.222] (89-77-92-62.dynamic.chello.pl [89.77.92.62])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tFri,  1 Sep 2017 10:36:43 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","X-Virus-Scanned":"amavisd-new at mnet-online.de","X-Auth-Info":"ux6Et9x6JDx9kbSRTzEBzC32tbYk6bLgBXeX+wT1xkA=","To":"Marek Vasut <marex@denx.de>, Sam Protsenko <semen.protsenko@linaro.org>, \n\tu-boot@lists.denx.de","References":"<20170831182004.24946-1-semen.protsenko@linaro.org>\n\t<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>","From":"=?utf-8?q?=C5=81ukasz_Majewski?= <lukma@denx.de>","Organization":"DENX","Message-ID":"<6de2578a-2808-abba-f4ef-9eafb8d1df27@denx.de>","Date":"Fri, 1 Sep 2017 10:36:42 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.8.0","MIME-Version":"1.0","In-Reply-To":"<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>","Cc":"Praneeth Bajjuri <praneeth@ti.com>, Tom Rini <trini@konsulko.com>","Subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1761557,"web_url":"http://patchwork.ozlabs.org/comment/1761557/","msgid":"<bc5a955f-f366-daa8-8092-a7a1d20112ff@denx.de>","list_archive_url":null,"date":"2017-09-01T09:51:45","subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","submitter":{"id":12009,"url":"http://patchwork.ozlabs.org/api/people/12009/","name":"Marek Vasut","email":"marex@denx.de"},"content":"On 09/01/2017 10:36 AM, Łukasz Majewski wrote:\n> On 09/01/2017 10:19 AM, Marek Vasut wrote:\n>> On 08/31/2017 08:20 PM, Sam Protsenko wrote:\n>>> Since 842778a09104 commit, \"fastboot devices\" stopped to show correct\n>>> device serial number for TI boards, showing this line instead:\n>>>\n>>>     ????????????    fastboot\n>>>\n>>> This is because serial# env variable could be set after g_dnl gadget was\n>>> initialized (e.g. by using env_set() in the board file).\n>>>\n>>> To fix this, before checking g_dnl_serial, let's re-check if we have\n>>> valid serial# value. And if so, let's set it as g_dnl_serial value.\n>>>\n>>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>\n>>\n>> Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial\n>> number when the environment variable is set ?\n> \n> Hmm... This might work.\n> \n> However, I'm a bit concerned with having \"bound\" the one particular env\n> variable (\"serial#\" in this case) to generic g_dnl.c code.\nThat's a separate problem though, we already have this serial# variable\nin place.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkDzf58cKz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 19:51:58 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 67039C21EF8; Fri,  1 Sep 2017 09:51:54 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id CEF61C21D7D;\n\tFri,  1 Sep 2017 09:51:51 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 31313C21D7D; Fri,  1 Sep 2017 09:51:50 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10])\n\tby lists.denx.de (Postfix) with ESMTPS id AF914C21D7B\n\tfor <u-boot@lists.denx.de>; Fri,  1 Sep 2017 09:51:49 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xkDzT1l5sz1qsgw;\n\tFri,  1 Sep 2017 11:51:49 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xkDzT0gCXz3hht2;\n\tFri,  1 Sep 2017 11:51:49 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id fW7IvqWQ9SX0; Fri,  1 Sep 2017 11:51:46 +0200 (CEST)","from [IPv6:::1] (unknown [195.140.253.167])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tFri,  1 Sep 2017 11:51:46 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","X-Virus-Scanned":"amavisd-new at mnet-online.de","X-Auth-Info":"q5MwlgtPjjM72w6gYR0qt44aUkiim2eVDrsUftejAnU=","To":"=?utf-8?q?=C5=81ukasz_Majewski?= <lukma@denx.de>,\n\tSam Protsenko <semen.protsenko@linaro.org>, u-boot@lists.denx.de","References":"<20170831182004.24946-1-semen.protsenko@linaro.org>\n\t<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>\n\t<6de2578a-2808-abba-f4ef-9eafb8d1df27@denx.de>","From":"Marek Vasut <marex@denx.de>","Message-ID":"<bc5a955f-f366-daa8-8092-a7a1d20112ff@denx.de>","Date":"Fri, 1 Sep 2017 11:51:45 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<6de2578a-2808-abba-f4ef-9eafb8d1df27@denx.de>","Content-Language":"en-US","Cc":"Praneeth Bajjuri <praneeth@ti.com>, Tom Rini <trini@konsulko.com>","Subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1761563,"web_url":"http://patchwork.ozlabs.org/comment/1761563/","msgid":"<441fd6cd-f7f7-d2ad-a456-930f38aa4c94@denx.de>","list_archive_url":null,"date":"2017-09-01T10:09:03","subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","submitter":{"id":70701,"url":"http://patchwork.ozlabs.org/api/people/70701/","name":"Lukasz Majewski","email":"lukma@denx.de"},"content":"On 09/01/2017 11:51 AM, Marek Vasut wrote:\n> On 09/01/2017 10:36 AM, Łukasz Majewski wrote:\n>> On 09/01/2017 10:19 AM, Marek Vasut wrote:\n>>> On 08/31/2017 08:20 PM, Sam Protsenko wrote:\n>>>> Since 842778a09104 commit, \"fastboot devices\" stopped to show correct\n>>>> device serial number for TI boards, showing this line instead:\n>>>>\n>>>>     ????????????    fastboot\n>>>>\n>>>> This is because serial# env variable could be set after g_dnl gadget was\n>>>> initialized (e.g. by using env_set() in the board file).\n>>>>\n>>>> To fix this, before checking g_dnl_serial, let's re-check if we have\n>>>> valid serial# value. And if so, let's set it as g_dnl_serial value.\n>>>>\n>>>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>\n>>>\n>>> Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial\n>>> number when the environment variable is set ?\n>>\n>> Hmm... This might work.\n>>\n>> However, I'm a bit concerned with having \"bound\" the one particular env\n>> variable (\"serial#\" in this case) to generic g_dnl.c code.\n> That's a separate problem though, we already have this serial# variable\n> in place.\n\nDo you mean that it is the same of \"fixed\" variable, as \"ipaddr\" is for \nnetwork subsytem?\n\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkFMd38Y8z9t2x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 20:09:17 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 2A79EC21F02; Fri,  1 Sep 2017 10:09:12 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id E63E7C21EB1;\n\tFri,  1 Sep 2017 10:09:09 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 7D166C21EB1; Fri,  1 Sep 2017 10:09:08 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10])\n\tby lists.denx.de (Postfix) with ESMTPS id F2CBCC21D7B\n\tfor <u-boot@lists.denx.de>; Fri,  1 Sep 2017 10:09:07 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3xkFMR33Cpz1qw74;\n\tFri,  1 Sep 2017 12:09:07 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3xkFMR271yz3hht5;\n\tFri,  1 Sep 2017 12:09:07 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id 4U5WK6I-LB1V; Fri,  1 Sep 2017 12:09:04 +0200 (CEST)","from [192.168.2.222] (89-77-92-62.dynamic.chello.pl [89.77.92.62])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tFri,  1 Sep 2017 12:09:03 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","X-Virus-Scanned":"amavisd-new at mnet-online.de","X-Auth-Info":"i6USof8GSkT6XJdD+U0AfMKQfikAMQNktdVKLj6KQPk=","To":"Marek Vasut <marex@denx.de>, Sam Protsenko <semen.protsenko@linaro.org>, \n\tu-boot@lists.denx.de","References":"<20170831182004.24946-1-semen.protsenko@linaro.org>\n\t<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>\n\t<6de2578a-2808-abba-f4ef-9eafb8d1df27@denx.de>\n\t<bc5a955f-f366-daa8-8092-a7a1d20112ff@denx.de>","From":"=?utf-8?q?=C5=81ukasz_Majewski?= <lukma@denx.de>","Organization":"DENX","Message-ID":"<441fd6cd-f7f7-d2ad-a456-930f38aa4c94@denx.de>","Date":"Fri, 1 Sep 2017 12:09:03 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.8.0","MIME-Version":"1.0","In-Reply-To":"<bc5a955f-f366-daa8-8092-a7a1d20112ff@denx.de>","Cc":"Praneeth Bajjuri <praneeth@ti.com>, Tom Rini <trini@konsulko.com>","Subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1761622,"web_url":"http://patchwork.ozlabs.org/comment/1761622/","msgid":"<CAKaJLVuH6UXBQ82eNKYm4VNqiA2rqitPF3bfu7hp=W4qrJuf7g@mail.gmail.com>","list_archive_url":null,"date":"2017-09-01T11:58:26","subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","submitter":{"id":68333,"url":"http://patchwork.ozlabs.org/api/people/68333/","name":"Sam Protsenko","email":"semen.protsenko@linaro.org"},"content":"On 1 September 2017 at 11:19, Marek Vasut <marex@denx.de> wrote:\n> On 08/31/2017 08:20 PM, Sam Protsenko wrote:\n>> Since 842778a09104 commit, \"fastboot devices\" stopped to show correct\n>> device serial number for TI boards, showing this line instead:\n>>\n>>     ????????????      fastboot\n>>\n>> This is because serial# env variable could be set after g_dnl gadget was\n>> initialized (e.g. by using env_set() in the board file).\n>>\n>> To fix this, before checking g_dnl_serial, let's re-check if we have\n>> valid serial# value. And if so, let's set it as g_dnl_serial value.\n>>\n>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>\n>\n> Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial\n> number when the environment variable is set ?\n>\n\nGood point. I've tested this approach and it works fine. Will resend\nv2 shortly. Thanks for the hint!\n\n>> ---\n>>  drivers/usb/gadget/g_dnl.c | 9 +++++++++\n>>  1 file changed, 9 insertions(+)\n>>\n>> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c\n>> index 0491a0eea9..e4d0289757 100644\n>> --- a/drivers/usb/gadget/g_dnl.c\n>> +++ b/drivers/usb/gadget/g_dnl.c\n>> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)\n>>\n>>       g_dnl_bind_fixup(&device_desc, cdev->driver->name);\n>>\n>> +     /* First try to obtain serial number from serial# variable */\n>> +     if (strlen(g_dnl_serial) == 0) {\n>> +             const char *s;\n>> +\n>> +             s = env_get(\"serial#\");\n>> +             if (s)\n>> +                     g_dnl_set_serialnumber((char *)s);\n>> +     }\n>> +\n>>       if (strlen(g_dnl_serial)) {\n>>               id = usb_string_id(cdev);\n>>               if (id < 0)\n>>\n>\n>\n> --\n> Best regards,\n> Marek Vasut","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"bVHb4Iih\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkHnn3W9Pz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 21:58:37 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 350FDC21ECF; Fri,  1 Sep 2017 11:58:32 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 70FCAC21D93;\n\tFri,  1 Sep 2017 11:58:30 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 1D613C21C72; Fri,  1 Sep 2017 11:58:29 +0000 (UTC)","from mail-io0-f177.google.com (mail-io0-f177.google.com\n\t[209.85.223.177])\n\tby lists.denx.de (Postfix) with ESMTPS id 6AE04C21C2F\n\tfor <u-boot@lists.denx.de>; Fri,  1 Sep 2017 11:58:28 +0000 (UTC)","by mail-io0-f177.google.com with SMTP id d78so14751244ioe.4\n\tfor <u-boot@lists.denx.de>; Fri, 01 Sep 2017 04:58:28 -0700 (PDT)","by 10.107.26.213 with HTTP; Fri, 1 Sep 2017 04:58:26 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=m6OcZkZ9IS1eO3s1n4Lv8WQL7ejHImBNGzmgdyUlJRc=;\n\tb=bVHb4Iih4Yf+r1qnoP3xs6oBAN4SXdSfcJtd/l2tuJOwwKXGrBoWNyEL0idhGyenPz\n\tp/htVjoHFUML8pMLwlmHlW2bPnntvPH8Pa/LSOM5LA9BWLpQ8oY2kpjQ+s/kKKRQf0gA\n\tpLmXNCtcmyvHaWXs2H1hLhyW1errxPuJFcfdQ=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=m6OcZkZ9IS1eO3s1n4Lv8WQL7ejHImBNGzmgdyUlJRc=;\n\tb=r4gbOxcFoItX+ZoJ5TN1kSOkGnLsanG2/lfvGZdt2kQ+Lg2LTVVGz0Uquyr0U1BW3r\n\tK2RU8pGZuGSe7+DqqOVGGJCDJkAUJrhra/GGIk24RlyjvM4y4h2mO9hanhrpmQPZCGk5\n\tit5Ok0LawDHdj2YLecA7EGTG72KbOFAPOekJqm39p6kVdhVzgOKbb55OegokkgidsqTR\n\trLa0Sz8aBy+ZdObSRSzmdd9VWhJDfczdyolifvEboQYNVPOv3SGjQZRZogU5Qyswa4da\n\t0XDnSOvnW3Lqt3qZsI2v/uhzUEtnxPLNXS8TWiVofplKIWhJWVHZBEAnTYJMMWDhsInU\n\tlmjw==","X-Gm-Message-State":"AHPjjUhsSU8r5O75CO4/gKdoxMYDfd5Wzcm175b274X8xOmhm1TEb7ZR\n\tGCCSmoyBfl+SkAiz6k2w5m3pnMU8hXQg","X-Google-Smtp-Source":"ADKCNb5Zi0AmTibomKR6nil0BrN5AL+P1hf5q5G7PudeEiYo9VBOfqQ9ZBA06Mo4+yDnAvMmiU5aD1rOlSwDc+gLN68=","X-Received":"by 10.107.33.80 with SMTP id h77mr1360983ioh.89.1504267106737;\n\tFri, 01 Sep 2017 04:58:26 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>","References":"<20170831182004.24946-1-semen.protsenko@linaro.org>\n\t<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>","From":"Sam Protsenko <semen.protsenko@linaro.org>","Date":"Fri, 1 Sep 2017 14:58:26 +0300","Message-ID":"<CAKaJLVuH6UXBQ82eNKYm4VNqiA2rqitPF3bfu7hp=W4qrJuf7g@mail.gmail.com>","To":"Marek Vasut <marex@denx.de>","Cc":"Praneeth Bajjuri <praneeth@ti.com>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>, Tom Rini <trini@konsulko.com>","Subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1761627,"web_url":"http://patchwork.ozlabs.org/comment/1761627/","msgid":"<CAKaJLVtMpv6PKTqJ7AVC2i-OKVMKzF383RmkRQCQB-f_Tpmr5w@mail.gmail.com>","list_archive_url":null,"date":"2017-09-01T12:02:42","subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","submitter":{"id":68333,"url":"http://patchwork.ozlabs.org/api/people/68333/","name":"Sam Protsenko","email":"semen.protsenko@linaro.org"},"content":"On 1 September 2017 at 14:58, Sam Protsenko <semen.protsenko@linaro.org> wrote:\n> On 1 September 2017 at 11:19, Marek Vasut <marex@denx.de> wrote:\n>> On 08/31/2017 08:20 PM, Sam Protsenko wrote:\n>>> Since 842778a09104 commit, \"fastboot devices\" stopped to show correct\n>>> device serial number for TI boards, showing this line instead:\n>>>\n>>>     ????????????      fastboot\n>>>\n>>> This is because serial# env variable could be set after g_dnl gadget was\n>>> initialized (e.g. by using env_set() in the board file).\n>>>\n>>> To fix this, before checking g_dnl_serial, let's re-check if we have\n>>> valid serial# value. And if so, let's set it as g_dnl_serial value.\n>>>\n>>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>\n>>\n>> Can't we use U_BOOT_ENV_CALLBACK() here instead and set the serial\n>> number when the environment variable is set ?\n>>\n>\n> Good point. I've tested this approach and it works fine. Will resend\n> v2 shortly. Thanks for the hint!\n>\n\nSent v2, using U_BOOT_ENV_CALLBACK: [1]. Guys, please review.\n\n[1] https://lists.denx.de/pipermail/u-boot/2017-September/304460.html\n\n>>> ---\n>>>  drivers/usb/gadget/g_dnl.c | 9 +++++++++\n>>>  1 file changed, 9 insertions(+)\n>>>\n>>> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c\n>>> index 0491a0eea9..e4d0289757 100644\n>>> --- a/drivers/usb/gadget/g_dnl.c\n>>> +++ b/drivers/usb/gadget/g_dnl.c\n>>> @@ -226,6 +226,15 @@ static int g_dnl_bind(struct usb_composite_dev *cdev)\n>>>\n>>>       g_dnl_bind_fixup(&device_desc, cdev->driver->name);\n>>>\n>>> +     /* First try to obtain serial number from serial# variable */\n>>> +     if (strlen(g_dnl_serial) == 0) {\n>>> +             const char *s;\n>>> +\n>>> +             s = env_get(\"serial#\");\n>>> +             if (s)\n>>> +                     g_dnl_set_serialnumber((char *)s);\n>>> +     }\n>>> +\n>>>       if (strlen(g_dnl_serial)) {\n>>>               id = usb_string_id(cdev);\n>>>               if (id < 0)\n>>>\n>>\n>>\n>> --\n>> Best regards,\n>> Marek Vasut","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"dqc72Rw0\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkHtv26v2z9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 22:03:03 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 0E75EC21EF6; Fri,  1 Sep 2017 12:02:47 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id BB883C21DC5;\n\tFri,  1 Sep 2017 12:02:45 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 11C47C21DC5; Fri,  1 Sep 2017 12:02:45 +0000 (UTC)","from mail-io0-f178.google.com (mail-io0-f178.google.com\n\t[209.85.223.178])\n\tby lists.denx.de (Postfix) with ESMTPS id 64839C21C2F\n\tfor <u-boot@lists.denx.de>; Fri,  1 Sep 2017 12:02:44 +0000 (UTC)","by mail-io0-f178.google.com with SMTP id d78so14822050ioe.4\n\tfor <u-boot@lists.denx.de>; Fri, 01 Sep 2017 05:02:44 -0700 (PDT)","by 10.107.26.213 with HTTP; Fri, 1 Sep 2017 05:02:42 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=6B/wQLMNzimDChgBzlo0Tz17QPIEwDcxjQ0LWu4VrXM=;\n\tb=dqc72Rw0mYkOJMn4rj/iVf0QP3ld/UVbRvS5Pzptz9LFmcJ+17npMykySj7n/qkQiK\n\t1w/9wFU2Atm05ihljlpY2j6WEkXuK1AtRZ5kjGkqLEPkwlyqYckdZPoCG1jnYC659x2f\n\tQj8/s89wXMNsgZAWzhC4QkoQaoHKcFb7VPNbw=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=6B/wQLMNzimDChgBzlo0Tz17QPIEwDcxjQ0LWu4VrXM=;\n\tb=T8raSJ3SxxvGKavKG1y7Ue3uentzfDY7zjRi3tJQk1kN455dov9FJBpeg1byCjFTYv\n\tpCIURfjktjD5FY8VN0pMLakZidjKcTRIdL2hLfcITSkpitfiH4jcE9pkn+WYFtZ+/uCS\n\t3N2Yzfu8SjsUjGTdM4BivFsNSqaNwK3jGwd11PlLxkAFnqUB+B2WZ0YdSs3Myk6N6DDQ\n\tB/GwXqQDpDDLE32S1hSb1l8sWszCwVbvXh3M0A6rJ1wotAYVtcsiJiwA+J88xaHsfFpp\n\tMq9SLmE8XtcX4ZPf7dZUutonALbgCIoGprewh/xr6fyA21LWphXb36ylJuPAgmJqHb/+\n\tkbNQ==","X-Gm-Message-State":"AHPjjUgXulOSa0wLz3JPbEEtEjjeHkJVJDHMflW5WyaPaTYocEK/ET72\n\tUjjklcCP4TTsbxdqcjNBqiHEbHzurv6U","X-Google-Smtp-Source":"ADKCNb4BySwm70N1P3OjF5qESvEpevkJVMgyBwRyIZ45WyPFrPR0RhXiXMMaFsBxFLDSuGNt6UtylcYNdjTWLl7ITr0=","X-Received":"by 10.36.14.75 with SMTP id 72mr356916ite.34.1504267363292; Fri,\n\t01 Sep 2017 05:02:43 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<CAKaJLVuH6UXBQ82eNKYm4VNqiA2rqitPF3bfu7hp=W4qrJuf7g@mail.gmail.com>","References":"<20170831182004.24946-1-semen.protsenko@linaro.org>\n\t<d020b548-dc48-8b59-2e17-41cb3ab52a80@denx.de>\n\t<CAKaJLVuH6UXBQ82eNKYm4VNqiA2rqitPF3bfu7hp=W4qrJuf7g@mail.gmail.com>","From":"Sam Protsenko <semen.protsenko@linaro.org>","Date":"Fri, 1 Sep 2017 15:02:42 +0300","Message-ID":"<CAKaJLVtMpv6PKTqJ7AVC2i-OKVMKzF383RmkRQCQB-f_Tpmr5w@mail.gmail.com>","To":"Marek Vasut <marex@denx.de>","Cc":"Praneeth Bajjuri <praneeth@ti.com>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>, Tom Rini <trini@konsulko.com>","Subject":"Re: [U-Boot] [PATCH 1/1] usb: gadget: g_dnl: Use serial# variable\n\tto set g_dnl_serial","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]