Re: [PATCH 2/2] watchdog: rzg2l_wdt: Handle TYPE-B reset for RZ/V2M

From: Geert Uytterhoeven
Date: Mon Jan 16 2023 - 11:35:34 EST


Hi Fabrizio,

On Mon, Jan 16, 2023 at 5:18 PM Fabrizio Castro
<fabrizio.castro.jz@xxxxxxxxxxx> wrote:
> > On Thu, Nov 17, 2022 at 12:49 PM Fabrizio Castro
> > <fabrizio.castro.jz@xxxxxxxxxxx> wrote:
> > > As per section 48.4 of the HW User Manual, IPs in the RZ/V2M
> > > SoC need either a TYPE-A reset sequence or a TYPE-B reset
> > > sequence. More specifically, the watchdog IP needs a TYPE-B
> > > reset sequence.
> > >
> > > If the proper reset sequence isn't implemented, then resetting
> > > IPs may lead to undesired behaviour. In the restart callback of
> > > the watchdog driver the reset has basically no effect on the
> > > desired funcionality, as the register writes following the reset
> > > happen before the IP manages to come out of reset.
> > >
> > > Implement the TYPE-B reset sequence in the watchdog driver to
> > > address the issues with the restart callback on RZ/V2M.
> > >
> > > Fixes: ec122fd94eeb ("watchdog: rzg2l_wdt: Add rzv2m support")
> > > Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@xxxxxxxxxxx>
> >
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> >
> > Perhaps this logic can be incorporated into the RZ/V2M reset controller
> > driver later, so reset consumers don't have to care about TYPE-A and
> > TYPE-B reset, but can just call reset_control_reset()?
> > I understand that's not gonna be easy, as it needs to know about the
> > relation between resets and clocks, and how to handle both cases (clock
> > (not) switched off) for TYPE-B resets.
>
> Yeah, we have been thinking about dealing with this in the reset controller
> driver, but as you pointed out it's not going to be simple, and therefore
> it'll take some time. This change will guarantee the correct behaviour of
> the watchdog for now, we'll tackle the larger issue later on, if that's okay
> with you.

Fine for me.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds