Skip to contentSkip to conversation

watchdog: da9062: Add dependency on I2C

PATCH In review Guenter Roeck 3 participants 6 messages Feb 8, 2020 – Feb 12, 2020 Watchdog device drivers

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 watchdog: da9062: Add dependency on I2C

Since commit 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe"), the driver calls i2c functions directly. It now therefore depends on I2C. This is a hard dependency which overrides COMPILE_TEST.

Fixes 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe")
Cc Marco Felsch <[email protected]>
Cc Adam Thomson <[email protected]>
Cc Stefan Lengfeld <[email protected]>
---
 drivers/watchdog/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/Kconfig +1 -0
index c3c8e0786a99..9ea2b43d4b01 100644
@@ -207,6 +207,7 @@ config DA9063_WATCHDOG
 config DA9062_WATCHDOG
 	tristate "Dialog DA9062/61 Watchdog"
 	depends on MFD_DA9062 || COMPILE_TEST
+	depends on I2C
 	select WATCHDOG_CORE
 	help
 	  Support for the watchdog in the DA9062 and DA9061 PMICs.
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Guenter,

thanks for fixing that.

Quoted 10 lines · Guenter Roeck

Since commit 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe"), the driver calls i2c functions directly. It now therefore depends on I2C. This is a hard dependency which overrides COMPILE_TEST.

Fixes 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe")
Cc Marco Felsch <[email protected]>
Cc Adam Thomson <[email protected]>
Cc Stefan Lengfeld <[email protected]>
Quoted 18 lines
---
 drivers/watchdog/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/Kconfig +1 -0
index c3c8e0786a99..9ea2b43d4b01 100644
@@ -207,6 +207,7 @@ config DA9063_WATCHDOG
 config DA9062_WATCHDOG
 	tristate "Dialog DA9062/61 Watchdog"
 	depends on MFD_DA9062 || COMPILE_TEST
+	depends on I2C
 	select WATCHDOG_CORE
 	help
 	  Support for the watchdog in the DA9062 and DA9061 PMICs.
Signature · 1 line
2.17.1
#2 lore raw
In reply to Guenter Roeck

Hi,

Quoted 3 lines · Guenter Roeck

Since commit 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe"), the driver calls i2c functions directly. It now therefore depends on I2C. This is a hard dependency which overrides COMPILE_TEST.

I just wondered why it doesn't complain if no regmap support is on and surprise it provides stubs ^^ Is it worth to add i2c stubs too?

Regards,
Marco

Quoted 26 lines
Fixes 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe")
Cc Marco Felsch <[email protected]>
Cc Adam Thomson <[email protected]>
Cc Stefan Lengfeld <[email protected]>
---
 drivers/watchdog/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/Kconfig +1 -0
index c3c8e0786a99..9ea2b43d4b01 100644
@@ -207,6 +207,7 @@ config DA9063_WATCHDOG
 config DA9062_WATCHDOG
 	tristate "Dialog DA9062/61 Watchdog"
 	depends on MFD_DA9062 || COMPILE_TEST
+	depends on I2C
 	select WATCHDOG_CORE
 	help
 	  Support for the watchdog in the DA9062 and DA9061 PMICs.
Signature · 1 line
2.17.1
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author maintainer
#3 lore raw
Quoted 10 lines · Marco Felsch

Hi,

Quoted 3 lines · Guenter Roeck

Since commit 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe"), the driver calls i2c functions directly. It now therefore depends on I2C. This is a hard dependency which overrides COMPILE_TEST.

I just wondered why it doesn't complain if no regmap support is on and surprise it provides stubs ^^ Is it worth to add i2c stubs too?

I'd rather not go there. In practice it doesn't make much of a difference - it just ensures that COMPILE_TEST can run on architectures which don't support I2C. I think 0day only finds it because they select COMPILE_TEST and then selectively disable I2C (and maybe other configuration options) to catch problems like this.

Guenter

#4 lore raw
Quoted 12 lines · Guenter Roeck
Quoted 10 lines · Marco Felsch

Hi,

Quoted 3 lines · Guenter Roeck

Since commit 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe"), the driver calls i2c functions directly. It now therefore depends on I2C. This is a hard dependency which overrides COMPILE_TEST.

I just wondered why it doesn't complain if no regmap support is on and surprise it provides stubs ^^ Is it worth to add i2c stubs too?

Quoted 5 lines

I'd rather not go there. In practice it doesn't make much of a difference - it just ensures that COMPILE_TEST can run on architectures which don't support I2C. I think 0day only finds it because they select COMPILE_TEST and then selectively disable I2C (and maybe other configuration options) to catch problems like this.

I know, just saying that this is a bit confusing for a reader because the deps are handled correctly by MFD_* and REGMAP_* symbols. Anyway thanks for fixing the bug I introduced. I was a bit to busy last week.

Regards,
Marco

Quoted 2 lines

Guenter

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Acked-by on v1 1/1
#5 lore raw
In reply to Guenter Roeck
Quoted 10 lines · Guenter Roeck

Since commit 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe"), the driver calls i2c functions directly. It now therefore depends on I2C. This is a hard dependency which overrides COMPILE_TEST.

Fixes 057b52b4b3d58 ("watchdog: da9062: make restart handler atomic safe")
Cc Marco Felsch <[email protected]>
Cc Adam Thomson <[email protected]>
Cc Stefan Lengfeld <[email protected]>

Just ran into the same issue, so

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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