From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrizio Castro Subject: RE: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler Date: Mon, 12 Feb 2018 10:33:47 +0000 Message-ID: References: <1517423070-24236-1-git-send-email-fabrizio.castro@bp.renesas.com> <1517423070-24236-14-git-send-email-fabrizio.castro@bp.renesas.com> <20180207230309.goxig2irkpxrw5el@katana> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20180207230309.goxig2irkpxrw5el@katana> Content-Language: en-US Sender: linux-renesas-soc-owner@vger.kernel.org To: Wolfram Sang Cc: Philipp Zabel , Rob Herring , Mark Rutland , Wim Van Sebroeck , Russell King , Catalin Marinas , Will Deacon , Michael Turquette , Stephen Boyd , Simon Horman , Magnus Damm , Geert Uytterhoeven , Wolfram Sang , Guenter Roeck , "devicetree@vger.kernel.org" , "linux-watchdog@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" l List-Id: devicetree@vger.kernel.org Hello Wolfram, thank you for your feedback! > Subject: Re: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler > > > > +static int rwdt_restart(struct watchdog_device *wdev, unsigned long ac= tion, > > +void *data) > > +{ > > +struct rwdt_priv *priv =3D watchdog_get_drvdata(wdev); > > + > > +pm_runtime_get_sync(wdev->parent); > > + > > +rwdt_write(priv, 0x00, RWTCSRB); > > +rwdt_write(priv, 0x00, RWTCSRA); > > +rwdt_write(priv, 0xffff, RWTCNT); > > + > > +while (readb_relaxed(priv->base + RWTCSRA) & RWTCSRA_WRFLG) > > +cpu_relax(); > > + > > +rwdt_write(priv, 0x80, RWTCSRA); > > +return 0; > > +} > > I used to have this simpler version (back then for the UP case): > > +rwdt_start(wdev); > +rwdt_write(priv, 0xffff, RWTCNT); > +return 0; > > It should still work probably... It should still work, but it would be slower, I would stick with the versio= n I have submitted if you don't mind. Thanks, Fabrizio Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, B= uckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered= No. 04586709. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relmlor4.renesas.com ([210.160.252.174]:12086 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932558AbeBLKdz (ORCPT ); Mon, 12 Feb 2018 05:33:55 -0500 From: Fabrizio Castro To: Wolfram Sang CC: Philipp Zabel , Rob Herring , Mark Rutland , Wim Van Sebroeck , Russell King , Catalin Marinas , Will Deacon , "Michael Turquette" , Stephen Boyd , Simon Horman , Magnus Damm , "Geert Uytterhoeven" , Wolfram Sang , Guenter Roeck , "devicetree@vger.kernel.org" , "linux-watchdog@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-clk@vger.kernel.org" , Chris Paterson , Biju Das , Ramesh Shanmugasundaram Subject: RE: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler Date: Mon, 12 Feb 2018 10:33:47 +0000 Message-ID: References: <1517423070-24236-1-git-send-email-fabrizio.castro@bp.renesas.com> <1517423070-24236-14-git-send-email-fabrizio.castro@bp.renesas.com> <20180207230309.goxig2irkpxrw5el@katana> In-Reply-To: <20180207230309.goxig2irkpxrw5el@katana> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-watchdog-owner@vger.kernel.org List-Id: linux-watchdog@vger.kernel.org Hello Wolfram, thank you for your feedback! > Subject: Re: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler > > > > +static int rwdt_restart(struct watchdog_device *wdev, unsigned long ac= tion, > > +void *data) > > +{ > > +struct rwdt_priv *priv =3D watchdog_get_drvdata(wdev); > > + > > +pm_runtime_get_sync(wdev->parent); > > + > > +rwdt_write(priv, 0x00, RWTCSRB); > > +rwdt_write(priv, 0x00, RWTCSRA); > > +rwdt_write(priv, 0xffff, RWTCNT); > > + > > +while (readb_relaxed(priv->base + RWTCSRA) & RWTCSRA_WRFLG) > > +cpu_relax(); > > + > > +rwdt_write(priv, 0x80, RWTCSRA); > > +return 0; > > +} > > I used to have this simpler version (back then for the UP case): > > +rwdt_start(wdev); > +rwdt_write(priv, 0xffff, RWTCNT); > +return 0; > > It should still work probably... It should still work, but it would be slower, I would stick with the versio= n I have submitted if you don't mind. Thanks, Fabrizio Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, B= uckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered= No. 04586709. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Fabrizio Castro To: Wolfram Sang CC: Philipp Zabel , Rob Herring , Mark Rutland , Wim Van Sebroeck , Russell King , Catalin Marinas , Will Deacon , "Michael Turquette" , Stephen Boyd , Simon Horman , Magnus Damm , "Geert Uytterhoeven" , Wolfram Sang , Guenter Roeck , "devicetree@vger.kernel.org" , "linux-watchdog@vger.kernel.org" , "linux-renesas-soc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-clk@vger.kernel.org" , Chris Paterson , Biju Das , Ramesh Shanmugasundaram Subject: RE: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler Date: Mon, 12 Feb 2018 10:33:47 +0000 Message-ID: References: <1517423070-24236-1-git-send-email-fabrizio.castro@bp.renesas.com> <1517423070-24236-14-git-send-email-fabrizio.castro@bp.renesas.com> <20180207230309.goxig2irkpxrw5el@katana> In-Reply-To: <20180207230309.goxig2irkpxrw5el@katana> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 List-ID: Hello Wolfram, thank you for your feedback! > Subject: Re: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler > > > > +static int rwdt_restart(struct watchdog_device *wdev, unsigned long ac= tion, > > +void *data) > > +{ > > +struct rwdt_priv *priv =3D watchdog_get_drvdata(wdev); > > + > > +pm_runtime_get_sync(wdev->parent); > > + > > +rwdt_write(priv, 0x00, RWTCSRB); > > +rwdt_write(priv, 0x00, RWTCSRA); > > +rwdt_write(priv, 0xffff, RWTCNT); > > + > > +while (readb_relaxed(priv->base + RWTCSRA) & RWTCSRA_WRFLG) > > +cpu_relax(); > > + > > +rwdt_write(priv, 0x80, RWTCSRA); > > +return 0; > > +} > > I used to have this simpler version (back then for the UP case): > > +rwdt_start(wdev); > +rwdt_write(priv, 0xffff, RWTCNT); > +return 0; > > It should still work probably... It should still work, but it would be slower, I would stick with the versio= n I have submitted if you don't mind. Thanks, Fabrizio Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, B= uckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered= No. 04586709. From mboxrd@z Thu Jan 1 00:00:00 1970 From: fabrizio.castro@bp.renesas.com (Fabrizio Castro) Date: Mon, 12 Feb 2018 10:33:47 +0000 Subject: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler In-Reply-To: <20180207230309.goxig2irkpxrw5el@katana> References: <1517423070-24236-1-git-send-email-fabrizio.castro@bp.renesas.com> <1517423070-24236-14-git-send-email-fabrizio.castro@bp.renesas.com> <20180207230309.goxig2irkpxrw5el@katana> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello Wolfram, thank you for your feedback! > Subject: Re: [RFC v4 13/26] watchdog: renesas_wdt: Add restart handler > > > > +static int rwdt_restart(struct watchdog_device *wdev, unsigned long action, > > +void *data) > > +{ > > +struct rwdt_priv *priv = watchdog_get_drvdata(wdev); > > + > > +pm_runtime_get_sync(wdev->parent); > > + > > +rwdt_write(priv, 0x00, RWTCSRB); > > +rwdt_write(priv, 0x00, RWTCSRA); > > +rwdt_write(priv, 0xffff, RWTCNT); > > + > > +while (readb_relaxed(priv->base + RWTCSRA) & RWTCSRA_WRFLG) > > +cpu_relax(); > > + > > +rwdt_write(priv, 0x80, RWTCSRA); > > +return 0; > > +} > > I used to have this simpler version (back then for the UP case): > > +rwdt_start(wdev); > +rwdt_write(priv, 0xffff, RWTCNT); > +return 0; > > It should still work probably... It should still work, but it would be slower, I would stick with the version I have submitted if you don't mind. Thanks, Fabrizio Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.