diff mbox series

[2/2] watchdog: BD70528: conditionally allow BD70528 module

Message ID 019c196041600a00143fe16bda19b2a8f060e9a9.1610001365.git.matti.vaittinen@fi.rohmeurope.com (mailing list archive)
State Changes Requested
Headers show
Series [1/2] watchdog: bd70528: don't crash if WDG is confiured with BD71828 | expand

Commit Message

Vaittinen, Matti Jan. 7, 2021, 6:37 a.m. UTC
The BD70528 watchdog module provides start/stop interface for RTC
driver because the BD70528 watchdog must be stopped when RTC time
is set. (WDG uses RTC counter and setting RTC may accidentally trigger
WDG if WDG is enabled). The BD71828 use same RTC driver as BD70528 but
don't share same WDG logic. When BD70528 is not configured a stub call
to "stop WDG" is implemented and in case when BD71828 is used, this
stub function should be called. Prevent configuring in the BD70528
watchdog when BD71828 is configured to avoid access to real WDG
functions when WDG does not exist in HW.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
---
 drivers/watchdog/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Guenter Roeck Jan. 7, 2021, 3:12 p.m. UTC | #1
On Thu, Jan 07, 2021 at 08:37:25AM +0200, Matti Vaittinen wrote:
> The BD70528 watchdog module provides start/stop interface for RTC
> driver because the BD70528 watchdog must be stopped when RTC time
> is set. (WDG uses RTC counter and setting RTC may accidentally trigger
> WDG if WDG is enabled). The BD71828 use same RTC driver as BD70528 but
> don't share same WDG logic. When BD70528 is not configured a stub call
> to "stop WDG" is implemented and in case when BD71828 is used, this
> stub function should be called. Prevent configuring in the BD70528
> watchdog when BD71828 is configured to avoid access to real WDG
> functions when WDG does not exist in HW.
> 
> Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>

As mentioned in my response to the other patch, I think this is the
wrong solution.

Guenter

> ---
>  drivers/watchdog/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index fd7968635e6d..40e1b4c69537 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -163,6 +163,7 @@ config SOFT_WATCHDOG_PRETIMEOUT
>  config BD70528_WATCHDOG
>  	tristate "ROHM BD70528 PMIC Watchdog"
>  	depends on MFD_ROHM_BD70528
> +	depends on MFD_ROHM_BD71828 = n
>  	select WATCHDOG_CORE
>  	help
>  	  Support for the watchdog in the ROHM BD70528 PMIC. Watchdog trigger
> -- 
> 2.25.4
> 
> 
> -- 
> Matti Vaittinen, Linux device drivers
> ROHM Semiconductors, Finland SWDC
> Kiviharjunlenkki 1E
> 90220 OULU
> FINLAND
> 
> ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
> Simon says - in Latin please.
> ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
> Thanks to Simon Glass for the translation =]
Matti Vaittinen Jan. 8, 2021, 6:34 a.m. UTC | #2
On Thu, Jan 7, 2021 at 5:12 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Thu, Jan 07, 2021 at 08:37:25AM +0200, Matti Vaittinen wrote:
> > The BD70528 watchdog module provides start/stop interface for RTC
> > driver because the BD70528 watchdog must be stopped when RTC time
> > is set. (WDG uses RTC counter and setting RTC may accidentally trigger
> > WDG if WDG is enabled). The BD71828 use same RTC driver as BD70528 but
> > don't share same WDG logic. When BD70528 is not configured a stub call
> > to "stop WDG" is implemented and in case when BD71828 is used, this
> > stub function should be called. Prevent configuring in the BD70528
> > watchdog when BD71828 is configured to avoid access to real WDG
> > functions when WDG does not exist in HW.
> >
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
>
> As mentioned in my response to the other patch, I think this is the
> wrong solution.

I agree. Please forget this :)
Thanks for the review!

Best Regards
Matti
diff mbox series

Patch

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index fd7968635e6d..40e1b4c69537 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -163,6 +163,7 @@  config SOFT_WATCHDOG_PRETIMEOUT
 config BD70528_WATCHDOG
 	tristate "ROHM BD70528 PMIC Watchdog"
 	depends on MFD_ROHM_BD70528
+	depends on MFD_ROHM_BD71828 = n
 	select WATCHDOG_CORE
 	help
 	  Support for the watchdog in the ROHM BD70528 PMIC. Watchdog trigger