From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Alexander Shiyan <eagle.alexander923@gmail.com>
Cc: linux-pm@vger.kernel.org, Sebastian Reichel <sre@kernel.org>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>
Subject: Re: [PATCH] power: reset: at91-reset: Optimize at91_reset()
Date: Tue, 1 Apr 2025 14:52:35 +0200 [thread overview]
Message-ID: <20250401125235b4f44db6@mail.local> (raw)
In-Reply-To: <20250307053809.20245-1-eagle.alexander923@gmail.com>
On 07/03/2025 08:38:09+0300, Alexander Shiyan wrote:
> This patch adds a small optimization to the low-level at91_reset()
> function, which includes:
> - Removes the extra branch, since the following store operations
> already have proper condition checks.
> - Removes the definition of the clobber register r4, since it is
> no longer used in the code.
>
> Fixes: fcd0532fac2a ("power: reset: at91-reset: make at91sam9g45_restart() generic")
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
> drivers/power/reset/at91-reset.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
> index 036b18a1f90f..511f5a8f8961 100644
> --- a/drivers/power/reset/at91-reset.c
> +++ b/drivers/power/reset/at91-reset.c
> @@ -129,12 +129,11 @@ static int at91_reset(struct notifier_block *this, unsigned long mode,
> " str %4, [%0, %6]\n\t"
> /* Disable SDRAM1 accesses */
> "1: tst %1, #0\n\t"
> - " beq 2f\n\t"
> " strne %3, [%1, #" __stringify(AT91_DDRSDRC_RTR) "]\n\t"
> /* Power down SDRAM1 */
> " strne %4, [%1, %6]\n\t"
> /* Reset CPU */
> - "2: str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t"
> + " str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t"
>
> " b .\n\t"
> :
> @@ -145,7 +144,7 @@ static int at91_reset(struct notifier_block *this, unsigned long mode,
> "r" cpu_to_le32(AT91_DDRSDRC_LPCB_POWER_DOWN),
> "r" (reset->data->reset_args),
> "r" (reset->ramc_lpr)
> - : "r4");
> + );
>
> return NOTIFY_DONE;
> }
> --
> 2.39.1
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-04-01 12:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 5:38 [PATCH] power: reset: at91-reset: Optimize at91_reset() Alexander Shiyan
2025-04-01 12:52 ` Alexandre Belloni [this message]
2025-04-27 22:50 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250401125235b4f44db6@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=eagle.alexander923@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).