From: Dhruva Gole <d-gole@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: <linux-omap@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/5] bus: ti-sysc: Move check for no-reset-on-init
Date: Wed, 10 Apr 2024 23:33:18 +0530 [thread overview]
Message-ID: <20240410180318.ddpbdlnlss7bqweg@dhruva> (raw)
In-Reply-To: <20240410064010.57142-2-tony@atomide.com>
On Apr 10, 2024 at 09:40:05 +0300, Tony Lindgren wrote:
> We are wrongly checking SYSC_QUIRK_NO_RESET_ON_INIT flag in sysc_reset(),
> it can be called also after init from sysc_reinit_module(). Let's fix the
> issue by moving the check to the init code.
I am not able to understand exactly the potential bug here, what was the
issue exactly?
What I am able to infer is this is more of an improvement than fixing a
bug? Maybe I am missing some context, can you help me understand the
potential bug here?
>
> Fixes: 6a52bc2b81fa ("bus: ti-sysc: Add quirk handling for reset on re-init")
Fixes tag, you might want to CC stable@vger.kernel.org?
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> drivers/bus/ti-sysc.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -2145,8 +2145,7 @@ static int sysc_reset(struct sysc *ddata)
> sysc_offset = ddata->offsets[SYSC_SYSCONFIG];
>
> if (ddata->legacy_mode ||
> - ddata->cap->regbits->srst_shift < 0 ||
> - ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)
> + ddata->cap->regbits->srst_shift < 0)
> return 0;
>
> sysc_mask = BIT(ddata->cap->regbits->srst_shift);
> @@ -2240,12 +2239,14 @@ static int sysc_init_module(struct sysc *ddata)
> goto err_main_clocks;
> }
>
> - error = sysc_reset(ddata);
> - if (error)
> - dev_err(ddata->dev, "Reset failed with %d\n", error);
> + if (!(ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)) {
> + error = sysc_reset(ddata);
> + if (error)
> + dev_err(ddata->dev, "Reset failed with %d\n", error);
>
> - if (error && !ddata->legacy_mode)
> - sysc_disable_module(ddata->dev);
> + if (error && !ddata->legacy_mode)
> + sysc_disable_module(ddata->dev);
> + }
>
--
Best regards,
Dhruva
next prev parent reply other threads:[~2024-04-10 18:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 6:40 [PATCH v2 0/5] Update ti-sysc description and drop legacy quirk handling Tony Lindgren
2024-04-10 6:40 ` [PATCH v2 1/5] bus: ti-sysc: Move check for no-reset-on-init Tony Lindgren
2024-04-10 18:03 ` Dhruva Gole [this message]
2024-04-11 4:30 ` Tony Lindgren
2024-04-10 6:40 ` [PATCH v2 2/5] bus: ti-sysc: Add a description and copyrights Tony Lindgren
2024-04-10 6:40 ` [PATCH v2 3/5] bus: ti-sysc: Drop legacy quirk handling for uarts Tony Lindgren
2024-04-10 18:11 ` Dhruva Gole
2024-04-10 6:40 ` [PATCH v2 4/5] bus: ti-sysc: Drop legacy quirk handling for smartreflex Tony Lindgren
2024-04-10 6:40 ` [PATCH v2 5/5] bus: ti-sysc: Drop legacy idle quirk handling Tony Lindgren
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=20240410180318.ddpbdlnlss7bqweg@dhruva \
--to=d-gole@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
/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