[{"id":3677088,"web_url":"http://patchwork.ozlabs.org/comment/3677088/","msgid":"<20260414111741.511707e5@kmaincent-XPS-13-7390>","list_archive_url":null,"date":"2026-04-14T09:17:41","subject":"Re: [PATCH] board: stm32pm1: Fix board_check_usb_power()","submitter":{"id":80520,"url":"http://patchwork.ozlabs.org/api/people/80520/","name":"Kory Maincent","email":"kory.maincent@bootlin.com"},"content":"On Tue, 14 Apr 2026 11:06:50 +0200\nPatrice Chotard <patrice.chotard@foss.st.com> wrote:\n\n> Depending of plugged power source (computer, wall charger, ...) it can\n> happen that we got the following message:\n> \n> \"****************************************************\"\n> \"*      USB TYPE-C charger not compliant with       *\"\n> \"*                   specification                  *\"\n> \"****************************************************\"\n> \"                                                    \"\n> \"### ERROR ### Please RESET the board ###            \"\n> \n> This issue has been detected on STM32MP135f-DK board.\n> \n> It's due to max_uV and min_uV value are initialized at beginning of\n> board_check_usb_power() and can then be used for the 2 iteration of\n> adc_measurement().\n> max_uV/min_uV values issued of the first adc_measurement() iteration\n> are used as input of the second adc_measurement() iteration, which\n> can lead to incoherent pair of min_uV/max_uV values.\n> \n> To ensure that adc_measurement() returns coherent value for max_uV and\n> min_uV, initialize max_uV and min_uV at each loop start.\n> \n> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>\n\nReviewed-by: Kory Maincent <kory.maincent@bootlin.com>\n\nThank you!","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256\n header.s=dkim header.b=vl1d0Xq9;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bootlin.com header.i=@bootlin.com header.b=\"vl1d0Xq9\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com","phobos.denx.de;\n spf=pass smtp.mailfrom=kory.maincent@bootlin.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvzFr0x0vz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 19:17:52 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 86999841B9;\n\tTue, 14 Apr 2026 11:17:49 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id E8E4E84181; Tue, 14 Apr 2026 11:17:47 +0200 (CEST)","from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 9E7C4841CD\n for <u-boot@lists.denx.de>; Tue, 14 Apr 2026 11:17:45 +0200 (CEST)","from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233])\n by smtpout-04.galae.net (Postfix) with ESMTPS id 394E2C5AA96\n for <u-boot@lists.denx.de>; Tue, 14 Apr 2026 09:18:22 +0000 (UTC)","from mail.galae.net (mail.galae.net [212.83.136.155])\n by smtpout-01.galae.net (Postfix) with ESMTPS id 3074B5FFBB;\n Tue, 14 Apr 2026 09:17:45 +0000 (UTC)","from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id 5DED410450093;\n Tue, 14 Apr 2026 11:17:42 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim;\n t=1776158264; h=from:subject:date:message-id:to:cc:mime-version:content-type:\n content-transfer-encoding:in-reply-to:references;\n bh=Lms9VHwybC4O364iAvPNW7+860fAl7hg+UtIui2DdoY=;\n b=vl1d0Xq9LE7nUZ3FzD1gr+NG4qi4LnfDO+lwqnvP7HYAvCrvuNzkju2dQDbSK04ib7DnfI\n qzc4eHrRvvgYmuvOidf3G5DWr5nMxGCLlOOlra/NcknQ8isnMtYLiiLdrnVXc/gtp57No1\n pGn7UtthqPSiZX5FYdNRYoA5Lul6G+4+F+072qdIn3WoJ1ZdNST1IXX0acrO5sg3gH9tSh\n dRnZAvAX8Dcc5f6ZGV7i5hb4NUIlXgHxeeE/U5B8vo4GiBCZlENWVktk9uPhiFJ/lT7XsW\n opQWuxufKWtRxjnjOTq7KI9mltEmhyuueYxj/03z2C4Ly09s6I2BhghSqLOqzw==","Date":"Tue, 14 Apr 2026 11:17:41 +0200","From":"Kory Maincent <kory.maincent@bootlin.com>","To":"Patrice Chotard <patrice.chotard@foss.st.com>","Cc":"<uboot-stm32@st-md-mailman.stormreply.com>, <u-boot@lists.denx.de>,\n Patrick Delaunay <patrick.delaunay@foss.st.com>, Tom Rini\n <trini@konsulko.com>, Marek Vasut <marek.vasut+renesas@mailbox.org>","Subject":"Re: [PATCH] board: stm32pm1: Fix board_check_usb_power()","Message-ID":"<20260414111741.511707e5@kmaincent-XPS-13-7390>","In-Reply-To":"<20260414-fix_usb_adc_meausurement-v1-1-8cdbd4c10dd8@foss.st.com>","References":"<20260414-fix_usb_adc_meausurement-v1-1-8cdbd4c10dd8@foss.st.com>","Organization":"bootlin","X-Mailer":"Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"quoted-printable","X-Last-TLS-Session-Version":"TLSv1.3","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://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 <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]