[{"id":3688055,"web_url":"http://patchwork.ozlabs.org/comment/3688055/","msgid":"<CAFLszTgRUg5Dk82Gq9FVJ99cn+15Fw7RkwVsiRgZwH2tqHVS=w@mail.gmail.com>","list_archive_url":null,"date":"2026-05-07T21:11:19","subject":"Re: [PATCH v2 1/4] reset: Add reset_reset() and reset_reset_bulk()\n API","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi Michal,\n\nOn 2026-05-05T12:30:28, Michal Simek <michal.simek@amd.com> wrote:\n> reset: Add reset_reset() and reset_reset_bulk() API\n>\n> Add reset_reset() and reset_reset_bulk() functions to the reset\n> controller API. These functions assert and then deassert reset signals\n> in a single call, providing a convenient way to pulse/toggle a reset\n> line.\n>\n> This mimics the Linux kernel's reset_control_reset() and\n> reset_control_bulk_reset() APIs. The new functions are useful for\n> drivers that need to cycle a reset line during initialization or\n> error recovery but with also passing delay parameter.\n>\n> If a driver implements the rst_reset op, it will be called directly\n> with the delay parameter. Otherwise, the reset core performs\n> reset_assert(), optional udelay(), and reset_deassert() as fallback.\n>\n> Signed-off-by: Michal Simek <michal.simek@amd.com>\n>\n> drivers/reset/reset-uclass.c | 34 ++++++++++++++++++++++++++++++++++\n>  include/reset-uclass.h       | 12 ++++++++++++\n>  include/reset.h              | 41 +++++++++++++++++++++++++++++++++++++++++\n>  3 files changed, 87 insertions(+)\n\nReviewed-by: Simon Glass <sjg@chromium.org>\n\noptional nits / thoughts below\n\n> diff --git a/include/reset-uclass.h b/include/reset-uclass.h\n> @@ -76,6 +76,18 @@ struct reset_ops {\n> +     /**\n> +      * rst_reset - Reset a HW module.\n> +      *\n> +      * This optional function triggers a reset pulse on the reset line,\n> +      * asserting and then deasserting the reset signal. If not implemented,\n> +      * the reset core will use rst_assert followed by rst_deassert.\n> +      *\n> +      * @reset_ctl:  The reset signal to pulse.\n> +      * @delay_us:   Delay in microseconds between assert and deassert.\n> +      * @return 0 if OK, or a negative error code.\n> +      */\n> +     int (*rst_reset)(struct reset_ctl *reset_ctl, ulong delay_us);\n\nPlease document that the core inserts a udelay(delay_us) between\nrst_assert and rst_deassert in the fallback path, and clarify whether\nan rst_reset implementation must honour delay_us or may treat it as a\nhint. Without that, authors don't really know what to do with the\nvalue.\n\n> diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c\n> @@ -225,6 +226,39 @@ int reset_deassert_bulk(struct reset_ctl_bulk *bulk)\n> +int reset_reset_bulk(struct reset_ctl_bulk *bulk, ulong delay_us)\n> +{\n> +     int i, ret;\n> +\n> +     for (i = 0; i < bulk->count; i++) {\n> +             ret = reset_reset(&bulk->resets[i], delay_us);\n> +             if (ret < 0)\n> +                     return ret;\n> +     }\n> +\n> +     return 0;\n> +}\n\nJust to check - pulsing each reset sequentially means the first\nfinishes its full assert/delay/deassert before the next starts\nasserting. For the cadence_qspi case in 3/4, where multiple OSPI reset\nlines are expected to be asserted together, the previous code did\nassert_bulk() / udelay() / deassert_bulk() so all lines were held low\nsimultaneously. The new behaviour is different. Is that intentional,\nand have you confirmed the cadence controller is happy with it?\n\nRegards,\nSimon","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 (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=Yk3/ghaP;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"Yk3/ghaP\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org","phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\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 4gBQ0s2mWRz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 08 May 2026 07:11:41 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 8826184BD5;\n\tThu,  7 May 2026 23:11:37 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 2868C84BE5; Thu,  7 May 2026 23:11:36 +0200 (CEST)","from mail-ej1-x633.google.com (mail-ej1-x633.google.com\n [IPv6:2a00:1450:4864:20::633])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 3912484B8D\n for <u-boot@lists.denx.de>; Thu,  7 May 2026 23:11:34 +0200 (CEST)","by mail-ej1-x633.google.com with SMTP id\n a640c23a62f3a-ba6838e76f2so165357266b.2\n for <u-boot@lists.denx.de>; Thu, 07 May 2026 14:11:34 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1778188294; cv=none;\n d=google.com; s=arc-20240605;\n b=Uq9uYo7iZxysUr76wLvuGki5nRfR8q0h1eXWSBmVmOmnARs2kK1h4F+SwD3mi+54Rb\n UZIkaag0Ty4eItvE9wwWgKu9xG4gCNhYezl/gzT1uwagjFhUArr+xKosMjte2jwzv758\n W+TNVPMoRhvCEEn71SSDYUmf6eUsSBO09qZu0E6cqNXfLSNZjQFp0rnZtQyT/QRdWorU\n jlI9CBaWNyk5mzLWPr+p/Y7HTDLa2Jcrg8Z4cvsn6MAMAbIrSWSjb+Rd1Fg/HZmjg6lh\n Gfw2DuOxhilh27kgIia6/fasQI17Dps76Sz8Iu5oOVx8BBxXjRhMOZrvmgfu5CK2BczT\n Qvjg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=EGdQWYkruDyzqczNadnr0VQftqUkg5QRMqWQ/ByyMmw=;\n fh=qmb99AbYrxQTqbU8c3YoikZ37BstHm/br0rQHEGk45c=;\n b=IeFUvAfxWq1RYOiGAgMH++QeainauF1pzigjgxMsOCwk5E3LDz0j8lBOdtnkR4irrj\n 7b/LQUYiVDRD+Xxwxx9Ru0RQHcgt+5ZBiH49fC1iEn4JpJAApftsb7AN6kiNJ3OeUbhk\n mvO/FuiNmr/SnBFxmNki3n1lAvtdyymF9qD414woPIC0+3f65FzPrawTu9LbrvWkplGq\n l3zTx7U6QkPawIqWovqSz7DLaB52peqwzgoHY8dWpG7Doa2kDhAzu263YmwVXjkjYTD6\n cYcXS8x9lu5SP2m2Ay5YUw6twJfmvRiBeGy6hSTJDFshU0DjCsWnfH77AOyyBHmu077c\n rUjg==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1778188294; x=1778793094; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=EGdQWYkruDyzqczNadnr0VQftqUkg5QRMqWQ/ByyMmw=;\n b=Yk3/ghaPH9b+YY0v5d7HT2KQIA4jwnkh5Ptg850IPHSvUM53jg4GaOaS4hNuABzVEX\n +cvbcSnVjx4ETd5/F//NNN32KA26Pev6WPKP0c3zT5I5FVaKZvJZ2J4ktsmNd5W0RIBP\n gpxiTmCjeE/r+DEo/cKDrcLwGV2gHJ9/vUpvI=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778188294; x=1778793094;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=EGdQWYkruDyzqczNadnr0VQftqUkg5QRMqWQ/ByyMmw=;\n b=AmbPcDOuGBSWDZ3sgOOqUwTwcbCeohgLQfKcNPY8daEr8DKqm7gK13vLEmz7a5JZOo\n gcZc2rGUKKFWYLtpg36DjzYorbg2s1XRe+CjvUvNCUPrXf0xEl2cSJ2JctKLlDMWDNJv\n MqKeaZP7J9P5K9JlTBJBsvTeE8Mi7CIJkmNjk/SGwAegndRH3tbX1MQSPR19kDgiygDe\n CbZmRv9wU56K2OcxMS3ZtBEslA9iFXf89pDJBfU4RweIheS74u/sS3j9dMATmlE/wHbL\n ewow45Ee/V8NJ7J77L7zSLqPfNsKwGcs6ibeHN50nsX2ykhdaxU89dGN9zm4GeUGRIB/\n txUw==","X-Gm-Message-State":"AOJu0YxDyDE3qEWggHj0mUN4cUvitYbHENJonSWtsEKkfX7QqyQ+KgfY\n obbmxbuuKiAtRKfjDMulUiuIydM6gcDLbo1qgppkmepSPcgMOn9k6aKH1tZ07mgF12isd7YyZXA\n ezsaQQNUaiYdBw+DOAACQbaypuO6bdgGhPeAFgLW7","X-Gm-Gg":"AeBDiescGWj5U4BJOH1oJyo0jS3+EXtV4VmPZIKeSPn6Yg9oS9DP0xvkRa/XxzESzOu\n /XUC/ZQ/WH6DZmPbBmHcSvqICG8h8Q26WO2oyfLsBsUd6OxYEdK18rR5IkicEOvXdo8A90gGPqp\n Xj3x132BR5T6bxaScya2sZb3Y98iSMvItqpL4zgl8HYlxYz7PFGBz90t/TfegU1DNa6A9G+6Led\n 87xVi8uGbGHR5ffPs7/wDJz9xtY4v4bZ01y8A0IBXm19i/2A681/wCvk3t10ZIbeV/P6fz/hXmV\n yBarRq3tFQKwMWhB","X-Received":"by 2002:a17:907:f816:b0:bc7:efc0:9625 with SMTP id\n a640c23a62f3a-bc7efc09808mr269924166b.31.1778188293534; Thu, 07 May 2026\n 14:11:33 -0700 (PDT)","MIME-Version":"1.0","References":"<cover.1777984225.git.michal.simek@amd.com>\n <2a5fee05be84fa1cb333f3ab3db732311da321cf.1777984225.git.michal.simek@amd.com>","In-Reply-To":"\n <2a5fee05be84fa1cb333f3ab3db732311da321cf.1777984225.git.michal.simek@amd.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Thu, 7 May 2026 15:11:19 -0600","X-Gm-Features":"AVHnY4KwC4Ptiov_P7Bk4ZtPtodaElYJ0uAuO1V_i779E-7_2T32R5d7fDbgCto","Message-ID":"\n <CAFLszTgRUg5Dk82Gq9FVJ99cn+15Fw7RkwVsiRgZwH2tqHVS=w@mail.gmail.com>","Subject":"Re: [PATCH v2 1/4] reset: Add reset_reset() and reset_reset_bulk()\n API","To":"michal.simek@amd.com","Cc":"u-boot@lists.denx.de, git@amd.com, Simon Glass <sjg@chromium.org>","Content-Type":"text/plain; charset=\"UTF-8\"","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"}}]