Skip to contentSkip to conversation

watchdog: mtx-1: Relax build dependencies

PATCH In review Florian Fainelli 3 participants 10 messages Dec 11, 2019 – Dec 12, 2019 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

cover watchdog: mtx-1: Relax build dependencies

Hi Wim, Guenter,

This came up with Denis trying to fix a MIPS-related build failure:

https://lore.kernel.org/linux-mips/[email protected]/

Florian Fainelli (2):
watchdog: mtx-1: Drop au1000.h header inclusion
watchdog: Relax dependencies for CONFIG_WDT_MTX1

 drivers/watchdog/Kconfig     | 2 +-
 drivers/watchdog/mtx-1_wdt.c | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 watchdog: mtx-1: Drop au1000.h header inclusion

Including au1000.h from the machine specific header directory prevents this driver from being built on any other platforms (MIPS included). Since we do not use any definitions, drop it.

---
 drivers/watchdog/mtx-1_wdt.c | 2 --
 1 file changed, 2 deletions(-)
drivers/watchdog/mtx-1_wdt.c +0 -2
index 25a92857b217..aeca22f7450e 100644
@@ -41,8 +41,6 @@
 #include <linux/uaccess.h>
 #include <linux/gpio/consumer.h>
 
-#include <asm/mach-au1x00/au1000.h>
-
 #define MTX1_WDT_INTERVAL	(5 * HZ)
 
 static int ticks = 100 * HZ;
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [PATCH 1/2] watchdog: mtx-1: Drop au1000.h header inclusion

Quoted 16 lines · Florian Fainelli

Including au1000.h from the machine specific header directory prevents this driver from being built on any other platforms (MIPS included). Since we do not use any definitions, drop it.

---
  drivers/watchdog/mtx-1_wdt.c | 2 --
  1 file changed, 2 deletions(-)
drivers/watchdog/mtx-1_wdt.c +0 -0
index 25a92857b217..aeca22f7450e 100644

drivers/watchdog/mtx-1_wdt.c line 46

Quoted 8 lines
drivers/watchdog/mtx-1_wdt.c +0 -2
@@ -41,8 +41,6 @@
  #include <linux/uaccess.h>
  #include <linux/gpio/consumer.h>
 
-#include <asm/mach-au1x00/au1000.h>
-
  #define MTX1_WDT_INTERVAL	(5 * HZ)
 
  static int ticks = 100 * HZ;

Given that this is nothing but yet another gpio watchdog driver, I'd personally rather have it merged with gpio_wdt.c. On a higher level, cleaning up old-style watchdog drivers, without converting them to using the watchdog core, is a waste of time.

Wim, should we make it a policy to reject patches into old-style drivers unless they fix a real bug ? It is getting a pain to have to review those patches.

Thanks,
Guenter

#3 lore raw

Re: [PATCH 1/2] watchdog: mtx-1: Drop au1000.h header inclusion

Quoted 20 lines · Guenter Roeck
Quoted 19 lines · Florian Fainelli

Including au1000.h from the machine specific header directory prevents this driver from being built on any other platforms (MIPS included). Since we do not use any definitions, drop it.

---
  drivers/watchdog/mtx-1_wdt.c | 2 --

  1 file changed, 2 deletions(-)
drivers/watchdog/mtx-1_wdt.c +0 -0
index 25a92857b217..aeca22f7450e 100644
@@ -41,8 +41,6 @@
   #include <linux/uaccess.h>
   #include <linux/gpio/consumer.h>

  -#include <asm/mach-au1x00/au1000.h>
-

Quoted 8 lines
Quoted 3 lines

  #define MTX1_WDT_INTERVAL    (5 * HZ)
    static int ticks = 100 * HZ;

Given that this is nothing but yet another gpio watchdog driver, I'd personally rather have it merged with gpio_wdt.c. On a higher level, cleaning up old-style watchdog drivers, without converting them to using the watchdog core, is a waste of time.

If that makes you feel any better, I was not planning on going further than that, and yes, removing this driver and using gpio_wdt.c would be the way to go, this driver greatly predates gpio_wdt.c and I have since then not had access to my MTX-1 platforms which is why this did not happen. We can attempt a "blind conversion" without testing, but what good would that make, not sure.

Quoted 7 lines

Wim, should we make it a policy to reject patches into old-style drivers unless they fix a real bug ? It is getting a pain to have to review those patches.

Thanks,
Guenter

Signature · 1 line
Florian
maintainer
#4 lore raw

Re: [PATCH 1/2] watchdog: mtx-1: Drop au1000.h header inclusion

Quoted 32 lines · Florian Fainelli
Quoted 20 lines · Guenter Roeck
Quoted 19 lines · Florian Fainelli

Including au1000.h from the machine specific header directory prevents this driver from being built on any other platforms (MIPS included). Since we do not use any definitions, drop it.

---
  drivers/watchdog/mtx-1_wdt.c | 2 --

  1 file changed, 2 deletions(-)
drivers/watchdog/mtx-1_wdt.c +0 -0
index 25a92857b217..aeca22f7450e 100644
@@ -41,8 +41,6 @@
   #include <linux/uaccess.h>
   #include <linux/gpio/consumer.h>

  -#include <asm/mach-au1x00/au1000.h>
-

Quoted 8 lines
Quoted 3 lines

  #define MTX1_WDT_INTERVAL    (5 * HZ)
    static int ticks = 100 * HZ;

Given that this is nothing but yet another gpio watchdog driver, I'd personally rather have it merged with gpio_wdt.c. On a higher level, cleaning up old-style watchdog drivers, without converting them to using the watchdog core, is a waste of time.

Quoted 7 lines

If that makes you feel any better, I was not planning on going further than that, and yes, removing this driver and using gpio_wdt.c would be the way to go, this driver greatly predates gpio_wdt.c and I have since then not had access to my MTX-1 platforms which is why this did not happen. We can attempt a "blind conversion" without testing, but what good would that make, not sure.

It sounds like this is a purely cosmetical change to improve test build coverage for a more or less obsolete driver. No, that doesn't make me feel better; I get way too many of those lately. Worse, some of those test build "improvements" actually end up breaking real builds, which then costs me and others even more time to track down.

We should really discourage that. Is there some challenge going on somewhere, along the line of "improve test build coverage" ?

Guenter

Quoted 10 lines
Quoted 7 lines

Wim, should we make it a policy to reject patches into old-style drivers unless they fix a real bug ? It is getting a pain to have to review those patches.

Thanks,
Guenter

Signature · 1 line
Florian
#5 lore raw

Re: [PATCH 1/2] watchdog: mtx-1: Drop au1000.h header inclusion

Quoted 41 lines · Guenter Roeck
Quoted 32 lines · Florian Fainelli
Quoted 20 lines · Guenter Roeck
Quoted 19 lines · Florian Fainelli

Including au1000.h from the machine specific header directory prevents this driver from being built on any other platforms (MIPS included). Since we do not use any definitions, drop it.

---
  drivers/watchdog/mtx-1_wdt.c | 2 --

  1 file changed, 2 deletions(-)
drivers/watchdog/mtx-1_wdt.c +0 -0
index 25a92857b217..aeca22f7450e 100644
@@ -41,8 +41,6 @@
   #include <linux/uaccess.h>
   #include <linux/gpio/consumer.h>

  -#include <asm/mach-au1x00/au1000.h>
-

Quoted 8 lines
Quoted 3 lines

  #define MTX1_WDT_INTERVAL    (5 * HZ)
    static int ticks = 100 * HZ;

Given that this is nothing but yet another gpio watchdog driver, I'd personally rather have it merged with gpio_wdt.c. On a higher level, cleaning up old-style watchdog drivers, without converting them to using the watchdog core, is a waste of time.

Quoted 7 lines

If that makes you feel any better, I was not planning on going further than that, and yes, removing this driver and using gpio_wdt.c would be the way to go, this driver greatly predates gpio_wdt.c and I have since then not had access to my MTX-1 platforms which is why this did not happen. We can attempt a "blind conversion" without testing, but what good would that make, not sure.

Quoted 8 lines

It sounds like this is a purely cosmetical change to improve test build coverage for a more or less obsolete driver. No, that doesn't make me feel better; I get way too many of those lately. Worse, some of those test build "improvements" actually end up breaking real builds, which then costs me and others even more time to track down.

We should really discourage that. Is there some challenge going on somewhere, along the line of "improve test build coverage" ?

Not really, the only challenge would be access to the original hardware in order to remove the driver and migrate over to gpio_wdt, which is low risk, but the watchdog on that platform has bitten me before.

Signature · 1 line
Florian
#6 lore raw

PATCH 2/2 watchdog: Relax dependencies for CONFIG_WDT_MTX1

In reply to Florian Fainelli

Now that we have dropped the inclusion of a machine specific header, we can allow the driver to be compile tested beyond just MIPS.

---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/Kconfig +1 -1
index 1679e0dc869b..982897ff074e 100644
@@ -1651,7 +1651,7 @@ config JZ4740_WDT
 
 config WDT_MTX1
 	tristate "MTX-1 Hardware Watchdog"
-	depends on MIPS_MTX1 || (MIPS && COMPILE_TEST)
+	depends on MIPS_MTX1 || COMPILE_TEST
 	help
 	  Hardware driver for the MTX-1 boards. This is a watchdog timer that
 	  will reboot the machine after a 100 seconds timer expired.
Signature · 1 line
2.17.1
Tested-by on the v1 series
#7 lore raw
In reply to Florian Fainelli

Hi,

Thanks for the fix.
I tested the compilation with these patches.
You can add my:

Look like this error could be fixed the same way:
In file included from drivers/watchdog/ar7_wdt.c:29:
./arch/mips/include/asm/mach-ar7/ar7.h: In function ‘ar7_is_titan’:
./arch/mips/include/asm/mach-ar7/ar7.h:111:24: error: implicit declaration of function ‘KSEG1ADDR’; did you mean ‘CKSEG1ADDR’? [-Werror=implicit-function-declaration]

Quoted 6 lines · Florian Fainelli

Hi Wim, Guenter,

This came up with Denis trying to fix a MIPS-related build failure:

https://lore.kernel.org/linux-mips/[email protected]/

Quoted 8 lines

Florian Fainelli (2):
watchdog: mtx-1: Drop au1000.h header inclusion
watchdog: Relax dependencies for CONFIG_WDT_MTX1

 drivers/watchdog/Kconfig     | 2 +-
 drivers/watchdog/mtx-1_wdt.c | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

Thanks,
Denis

maintainer
#8 lore raw
Quoted 5 lines · Denis Efremov

Hi,

Thanks for the fix.
I tested the compilation with these patches.
You can add my:

Quoted 7 lines

Look like this error could be fixed the same way:
In file included from drivers/watchdog/ar7_wdt.c:29:
./arch/mips/include/asm/mach-ar7/ar7.h: In function ‘ar7_is_titan’:
./arch/mips/include/asm/mach-ar7/ar7.h:111:24: error: implicit declaration of function ‘KSEG1ADDR’; did you mean ‘CKSEG1ADDR’? [-Werror=implicit-function-declaration]

This is yet another old-style watchdog driver which should be left alone unless it has a bug that needs to be fixed. Really, if anyone out there is still using this driver, converting it to use the watchdog core would make much more sense.

Guenter

#9 lore raw
Quoted 16 lines · Guenter Roeck
Quoted 5 lines · Denis Efremov

Hi,

Thanks for the fix.
I tested the compilation with these patches.
You can add my:

Quoted 9 lines

Look like this error could be fixed the same way:
In file included from drivers/watchdog/ar7_wdt.c:29:
./arch/mips/include/asm/mach-ar7/ar7.h: In function ‘ar7_is_titan’:
./arch/mips/include/asm/mach-ar7/ar7.h:111:24: error: implicit declaration of function ‘KSEG1ADDR’; did you mean ‘CKSEG1ADDR’? [-Werror=implicit-function-declaration]

Quoted 4 lines

This is yet another old-style watchdog driver which should be left alone unless it has a bug that needs to be fixed. Really, if anyone out there is still using this driver, converting it to use the watchdog core would make much more sense.

AR7 is still largely available, so we might be able to get some people within the OpenWrt community to give a watchdog modernization patch a try.

Signature · 1 line
Florian