* [PATCH] watchdog: mtk: add disable_wdt_extrst support @ 2021-09-02 8:04 Fengquan Chen 2021-09-02 8:04 ` Fengquan Chen 2021-09-02 13:39 ` Guenter Roeck 0 siblings, 2 replies; 5+ messages in thread From: Fengquan Chen @ 2021-09-02 8:04 UTC (permalink / raw) To: Wim Van Sebroeck, Guenter Roeck, Matthias Brugger, linux-watchdog, linux-arm-kernel, linux-mediatek, linux-kernel Cc: fengquan.chen, tinghan.shen, randy.wu, rex-bc.chen, christine.zhu, joe.yang, zhishuang.zhang From: "fengquan.chen" <fengquan.chen@mediatek.com> In some cases, we may need watchdog just to trigger an internal soc reset without sending any output signal. Provide a disable_wdt_extrst parameter for configuration. We can disable or enable it just by configuring dts. fengquan.chen (1): watchdog: mtk: add disable_wdt_extrst support drivers/watchdog/mtk_wdt.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 1.8.1.1.dirty ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] watchdog: mtk: add disable_wdt_extrst support 2021-09-02 8:04 [PATCH] watchdog: mtk: add disable_wdt_extrst support Fengquan Chen @ 2021-09-02 8:04 ` Fengquan Chen 2021-09-02 13:43 ` Guenter Roeck 2021-09-02 13:39 ` Guenter Roeck 1 sibling, 1 reply; 5+ messages in thread From: Fengquan Chen @ 2021-09-02 8:04 UTC (permalink / raw) To: Wim Van Sebroeck, Guenter Roeck, Matthias Brugger, linux-watchdog, linux-arm-kernel, linux-mediatek, linux-kernel Cc: fengquan.chen, tinghan.shen, randy.wu, rex-bc.chen, christine.zhu, joe.yang, zhishuang.zhang From: "fengquan.chen" <fengquan.chen@mediatek.com> In some cases, we may need watchdog just to trigger an internal soc reset without sending any output signal. Provide a disable_wdt_extrst parameter for configuration. We can disable or enable it just by configuring dts. igned-off-by: Fengquan Chen <fengquan.chen@mediatek.com> --- drivers/watchdog/mtk_wdt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c index 97ca993..4824c07 100644 --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c @@ -63,6 +63,7 @@ struct mtk_wdt_dev { void __iomem *wdt_base; spinlock_t lock; /* protects WDT_SWSYSRST reg */ struct reset_controller_dev rcdev; + bool disable_wdt_extrst; }; struct mtk_wdt_data { @@ -240,6 +241,8 @@ static int mtk_wdt_start(struct watchdog_device *wdt_dev) reg = ioread32(wdt_base + WDT_MODE); reg &= ~(WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN); + if (mtk_wdt->disable_wdt_extrst) + reg &= ~WDT_MODE_EXRST_EN; reg |= (WDT_MODE_EN | WDT_MODE_KEY); iowrite32(reg, wdt_base + WDT_MODE); @@ -309,6 +312,10 @@ static int mtk_wdt_probe(struct platform_device *pdev) if (err) return err; } + + mtk_wdt->disable_wdt_extrst = + of_property_read_bool(dev->of_node, "disable_extrst"); + return 0; } -- 1.8.1.1.dirty ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] watchdog: mtk: add disable_wdt_extrst support 2021-09-02 8:04 ` Fengquan Chen @ 2021-09-02 13:43 ` Guenter Roeck 2021-09-03 6:51 ` Fengquan Chen 0 siblings, 1 reply; 5+ messages in thread From: Guenter Roeck @ 2021-09-02 13:43 UTC (permalink / raw) To: Fengquan Chen, Wim Van Sebroeck, Matthias Brugger, linux-watchdog, linux-arm-kernel, linux-mediatek, linux-kernel Cc: tinghan.shen, randy.wu, rex-bc.chen, christine.zhu, joe.yang, zhishuang.zhang On 9/2/21 1:04 AM, Fengquan Chen wrote: > From: "fengquan.chen" <fengquan.chen@mediatek.com> There should not be such From: line. > > In some cases, we may need watchdog just to trigger an > internal soc reset without sending any output signal. > > Provide a disable_wdt_extrst parameter for configuration. > We can disable or enable it just by configuring dts. > > igned-off-by: Fengquan Chen <fengquan.chen@mediatek.com> Missing "S". > --- > drivers/watchdog/mtk_wdt.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c > index 97ca993..4824c07 100644 > --- a/drivers/watchdog/mtk_wdt.c > +++ b/drivers/watchdog/mtk_wdt.c > @@ -63,6 +63,7 @@ struct mtk_wdt_dev { > void __iomem *wdt_base; > spinlock_t lock; /* protects WDT_SWSYSRST reg */ > struct reset_controller_dev rcdev; > + bool disable_wdt_extrst; > }; > > struct mtk_wdt_data { > @@ -240,6 +241,8 @@ static int mtk_wdt_start(struct watchdog_device *wdt_dev) > > reg = ioread32(wdt_base + WDT_MODE); > reg &= ~(WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN); > + if (mtk_wdt->disable_wdt_extrst) > + reg &= ~WDT_MODE_EXRST_EN; > reg |= (WDT_MODE_EN | WDT_MODE_KEY); > iowrite32(reg, wdt_base + WDT_MODE); > > @@ -309,6 +312,10 @@ static int mtk_wdt_probe(struct platform_device *pdev) > if (err) > return err; > } > + > + mtk_wdt->disable_wdt_extrst = > + of_property_read_bool(dev->of_node, "disable_extrst"); > + The new property needs to be documented and approved by a DT maintainer (separate patch). Something like "mtk,disable-extrst" would probably be a better property name. Guenter ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] watchdog: mtk: add disable_wdt_extrst support 2021-09-02 13:43 ` Guenter Roeck @ 2021-09-03 6:51 ` Fengquan Chen 0 siblings, 0 replies; 5+ messages in thread From: Fengquan Chen @ 2021-09-03 6:51 UTC (permalink / raw) To: Guenter Roeck, Wim Van Sebroeck, Matthias Brugger, linux-watchdog, linux-arm-kernel, linux-mediatek, linux-kernel Cc: tinghan.shen, randy.wu, rex-bc.chen, christine.zhu, joe.yang, zhishuang.zhang On Thu, 2021-09-02 at 06:43 -0700, Guenter Roeck wrote: > On 9/2/21 1:04 AM, Fengquan Chen wrote: > > From: "fengquan.chen" <fengquan.chen@mediatek.com> > > There should not be such From: line. Thanks, i have removed it and uploaded a new version: https://patchwork.kernel.org/project/linux-mediatek/list/?series=541567 > > > > > In some cases, we may need watchdog just to trigger an > > internal soc reset without sending any output signal. > > > > Provide a disable_wdt_extrst parameter for configuration. > > We can disable or enable it just by configuring dts. > > > > igned-off-by: Fengquan Chen <fengquan.chen@mediatek.com> > > Missing "S". Thanks, has been added back in v2. > > > --- > > drivers/watchdog/mtk_wdt.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/watchdog/mtk_wdt.c > > b/drivers/watchdog/mtk_wdt.c > > index 97ca993..4824c07 100644 > > --- a/drivers/watchdog/mtk_wdt.c > > +++ b/drivers/watchdog/mtk_wdt.c > > @@ -63,6 +63,7 @@ struct mtk_wdt_dev { > > void __iomem *wdt_base; > > spinlock_t lock; /* protects WDT_SWSYSRST reg */ > > struct reset_controller_dev rcdev; > > + bool disable_wdt_extrst; > > }; > > > > struct mtk_wdt_data { > > @@ -240,6 +241,8 @@ static int mtk_wdt_start(struct watchdog_device > > *wdt_dev) > > > > reg = ioread32(wdt_base + WDT_MODE); > > reg &= ~(WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN); > > + if (mtk_wdt->disable_wdt_extrst) > > + reg &= ~WDT_MODE_EXRST_EN; > > reg |= (WDT_MODE_EN | WDT_MODE_KEY); > > iowrite32(reg, wdt_base + WDT_MODE); > > > > @@ -309,6 +312,10 @@ static int mtk_wdt_probe(struct > > platform_device *pdev) > > if (err) > > return err; > > } > > + > > + mtk_wdt->disable_wdt_extrst = > > + of_property_read_bool(dev->of_node, "disable_extrst"); > > + > > The new property needs to be documented and approved by a DT > maintainer > (separate patch). Something like "mtk,disable-extrst" would probably > be > a better property name. > > Guenter Thanks, the property name has been modified, and related dt-binding has been added,see series 541567 Best Regards Fengquan ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] watchdog: mtk: add disable_wdt_extrst support 2021-09-02 8:04 [PATCH] watchdog: mtk: add disable_wdt_extrst support Fengquan Chen 2021-09-02 8:04 ` Fengquan Chen @ 2021-09-02 13:39 ` Guenter Roeck 1 sibling, 0 replies; 5+ messages in thread From: Guenter Roeck @ 2021-09-02 13:39 UTC (permalink / raw) To: Fengquan Chen, Wim Van Sebroeck, Matthias Brugger, linux-watchdog, linux-arm-kernel, linux-mediatek, linux-kernel Cc: tinghan.shen, randy.wu, rex-bc.chen, christine.zhu, joe.yang, zhishuang.zhang On 9/2/21 1:04 AM, Fengquan Chen wrote: > From: "fengquan.chen" <fengquan.chen@mediatek.com> > > In some cases, we may need watchdog just to trigger an > internal soc reset without sending any output signal. > > Provide a disable_wdt_extrst parameter for configuration. > We can disable or enable it just by configuring dts. > > fengquan.chen (1): > watchdog: mtk: add disable_wdt_extrst support > > drivers/watchdog/mtk_wdt.c | 7 +++++++ > 1 file changed, 7 insertions(+) > A single patch does not require an introductory e-mail. Also, if provided, it needed to be numbered (PATCH 0/1) to distinguish it from the actual patch. Guenter ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-09-03 6:51 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-09-02 8:04 [PATCH] watchdog: mtk: add disable_wdt_extrst support Fengquan Chen 2021-09-02 8:04 ` Fengquan Chen 2021-09-02 13:43 ` Guenter Roeck 2021-09-03 6:51 ` Fengquan Chen 2021-09-02 13:39 ` Guenter Roeck
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).