stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog: indydog: Add dependency on SGI_HAS_INDYDOG
@ 2017-11-14 10:52 Matt Redfearn
  2017-11-14 11:17 ` James Hogan
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Redfearn @ 2017-11-14 10:52 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-mips, Matt Redfearn, # 4 . 11 +, linux-kernel,
	linux-watchdog, Wim Van Sebroeck

Commit da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
enabled building the Indy watchdog driver when COMPILE_TEST is enabled.
However, the driver makes reference to symbols that are only defined for
certain platforms are selected in the config. These platforms select
SGI_HAS_INDYDOG. Without this, link time errors result, for example
when building a MIPS allyesconfig.

drivers/watchdog/indydog.o: In function `indydog_write':
indydog.c:(.text+0x18): undefined reference to `sgimc'
indydog.c:(.text+0x1c): undefined reference to `sgimc'
drivers/watchdog/indydog.o: In function `indydog_start':
indydog.c:(.text+0x54): undefined reference to `sgimc'
indydog.c:(.text+0x58): undefined reference to `sgimc'
drivers/watchdog/indydog.o: In function `indydog_stop':
indydog.c:(.text+0xa4): undefined reference to `sgimc'
drivers/watchdog/indydog.o:indydog.c:(.text+0xa8): more undefined
references to `sgimc' follow
make: *** [Makefile:1005: vmlinux] Error 1

Fix this by ensuring that CONFIG_INDIDOG can only be selected when the
necessary dependent platform symbols are built in.

Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Cc: <stable@vger.kernel.org> # 4.11 +
---

 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index ca200d1f310a..d96e2e7544fc 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1451,7 +1451,7 @@ config RC32434_WDT
 
 config INDYDOG
 	tristate "Indy/I2 Hardware Watchdog"
-	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
+	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST && SGI_HAS_INDYDOG)
 	help
 	  Hardware driver for the Indy's/I2's watchdog. This is a
 	  watchdog timer that will reboot the machine after a 60 second
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] watchdog: indydog: Add dependency on SGI_HAS_INDYDOG
  2017-11-14 10:52 [PATCH] watchdog: indydog: Add dependency on SGI_HAS_INDYDOG Matt Redfearn
@ 2017-11-14 11:17 ` James Hogan
  2017-11-14 13:48   ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: James Hogan @ 2017-11-14 11:17 UTC (permalink / raw)
  To: Matt Redfearn
  Cc: Guenter Roeck, linux-mips, # 4 . 11 +, linux-kernel,
	linux-watchdog, Wim Van Sebroeck

[-- Attachment #1: Type: text/plain, Size: 2176 bytes --]

On Tue, Nov 14, 2017 at 10:52:54AM +0000, Matt Redfearn wrote:
> Commit da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
> enabled building the Indy watchdog driver when COMPILE_TEST is enabled.
> However, the driver makes reference to symbols that are only defined for
> certain platforms are selected in the config. These platforms select
> SGI_HAS_INDYDOG. Without this, link time errors result, for example
> when building a MIPS allyesconfig.
> 
> drivers/watchdog/indydog.o: In function `indydog_write':
> indydog.c:(.text+0x18): undefined reference to `sgimc'
> indydog.c:(.text+0x1c): undefined reference to `sgimc'
> drivers/watchdog/indydog.o: In function `indydog_start':
> indydog.c:(.text+0x54): undefined reference to `sgimc'
> indydog.c:(.text+0x58): undefined reference to `sgimc'
> drivers/watchdog/indydog.o: In function `indydog_stop':
> indydog.c:(.text+0xa4): undefined reference to `sgimc'
> drivers/watchdog/indydog.o:indydog.c:(.text+0xa8): more undefined
> references to `sgimc' follow
> make: *** [Makefile:1005: vmlinux] Error 1
> 
> Fix this by ensuring that CONFIG_INDIDOG can only be selected when the
> necessary dependent platform symbols are built in.
> 
> Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
> Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
> Cc: <stable@vger.kernel.org> # 4.11 +
> ---
> 
>  drivers/watchdog/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index ca200d1f310a..d96e2e7544fc 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1451,7 +1451,7 @@ config RC32434_WDT
>  
>  config INDYDOG
>  	tristate "Indy/I2 Hardware Watchdog"
> -	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
> +	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST && SGI_HAS_INDYDOG)

(MIPS && COMPILE_TEST && SGI_HAS_INDYDOG) implies SGI_HAS_INDYDOG

So I think you can just do:
-	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
+	depends on SGI_HAS_INDYDOG

I.e. COMPILE_TEST isn't of any value in this case.

Cheers
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] watchdog: indydog: Add dependency on SGI_HAS_INDYDOG
  2017-11-14 11:17 ` James Hogan
@ 2017-11-14 13:48   ` Ralf Baechle
  2017-11-14 16:19     ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2017-11-14 13:48 UTC (permalink / raw)
  To: James Hogan
  Cc: Matt Redfearn, Guenter Roeck, linux-mips, # 4 . 11 +,
	linux-kernel, linux-watchdog, Wim Van Sebroeck

On Tue, Nov 14, 2017 at 11:17:38AM +0000, James Hogan wrote:

> On Tue, Nov 14, 2017 at 10:52:54AM +0000, Matt Redfearn wrote:
> > Commit da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
> > enabled building the Indy watchdog driver when COMPILE_TEST is enabled.
> > However, the driver makes reference to symbols that are only defined for
> > certain platforms are selected in the config. These platforms select
> > SGI_HAS_INDYDOG. Without this, link time errors result, for example
> > when building a MIPS allyesconfig.
> > 
> > drivers/watchdog/indydog.o: In function `indydog_write':
> > indydog.c:(.text+0x18): undefined reference to `sgimc'
> > indydog.c:(.text+0x1c): undefined reference to `sgimc'
> > drivers/watchdog/indydog.o: In function `indydog_start':
> > indydog.c:(.text+0x54): undefined reference to `sgimc'
> > indydog.c:(.text+0x58): undefined reference to `sgimc'
> > drivers/watchdog/indydog.o: In function `indydog_stop':
> > indydog.c:(.text+0xa4): undefined reference to `sgimc'
> > drivers/watchdog/indydog.o:indydog.c:(.text+0xa8): more undefined
> > references to `sgimc' follow
> > make: *** [Makefile:1005: vmlinux] Error 1
> > 
> > Fix this by ensuring that CONFIG_INDIDOG can only be selected when the
> > necessary dependent platform symbols are built in.
> > 
> > Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
> > Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
> > Cc: <stable@vger.kernel.org> # 4.11 +
> > ---
> > 
> >  drivers/watchdog/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> > index ca200d1f310a..d96e2e7544fc 100644
> > --- a/drivers/watchdog/Kconfig
> > +++ b/drivers/watchdog/Kconfig
> > @@ -1451,7 +1451,7 @@ config RC32434_WDT
> >  
> >  config INDYDOG
> >  	tristate "Indy/I2 Hardware Watchdog"
> > -	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
> > +	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST && SGI_HAS_INDYDOG)
> 
> (MIPS && COMPILE_TEST && SGI_HAS_INDYDOG) implies SGI_HAS_INDYDOG
> 
> So I think you can just do:
> -	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
> +	depends on SGI_HAS_INDYDOG
> 
> I.e. COMPILE_TEST isn't of any value in this case.

I agree, due to the references to sgimc this driver will only compile for
the platforms which set SGI_HAS_INDYDOG; MIPS as the dependency is too
generic.

Updated patch for the watchdog maintainers' ease below.

  Ralf

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reported-by: Matt Redfearn <matt.redfearn@mips.com>
Suggested-by: James Hogan <james.hogan@mips.com>

 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index c722cbfdc7e6..3ece1335ba84 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1451,7 +1451,7 @@ config RC32434_WDT
 
 config INDYDOG
 	tristate "Indy/I2 Hardware Watchdog"
-	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
+	depends on SGI_HAS_INDYDOG
 	help
 	  Hardware driver for the Indy's/I2's watchdog. This is a
 	  watchdog timer that will reboot the machine after a 60 second

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] watchdog: indydog: Add dependency on SGI_HAS_INDYDOG
  2017-11-14 13:48   ` Ralf Baechle
@ 2017-11-14 16:19     ` Guenter Roeck
  0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2017-11-14 16:19 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: James Hogan, Matt Redfearn, linux-mips, # 4 . 11 +, linux-kernel,
	linux-watchdog, Wim Van Sebroeck

On Tue, Nov 14, 2017 at 02:48:12PM +0100, Ralf Baechle wrote:
> On Tue, Nov 14, 2017 at 11:17:38AM +0000, James Hogan wrote:
> 
> > On Tue, Nov 14, 2017 at 10:52:54AM +0000, Matt Redfearn wrote:
> > > Commit da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")

Yes, that patch was a tremenuous failure and definitely not worth the trouble
it caused.

> > > enabled building the Indy watchdog driver when COMPILE_TEST is enabled.
> > > However, the driver makes reference to symbols that are only defined for
> > > certain platforms are selected in the config. These platforms select
> > > SGI_HAS_INDYDOG. Without this, link time errors result, for example
> > > when building a MIPS allyesconfig.
> > > 
> > > drivers/watchdog/indydog.o: In function `indydog_write':
> > > indydog.c:(.text+0x18): undefined reference to `sgimc'
> > > indydog.c:(.text+0x1c): undefined reference to `sgimc'
> > > drivers/watchdog/indydog.o: In function `indydog_start':
> > > indydog.c:(.text+0x54): undefined reference to `sgimc'
> > > indydog.c:(.text+0x58): undefined reference to `sgimc'
> > > drivers/watchdog/indydog.o: In function `indydog_stop':
> > > indydog.c:(.text+0xa4): undefined reference to `sgimc'
> > > drivers/watchdog/indydog.o:indydog.c:(.text+0xa8): more undefined
> > > references to `sgimc' follow
> > > make: *** [Makefile:1005: vmlinux] Error 1
> > > 
> > > Fix this by ensuring that CONFIG_INDIDOG can only be selected when the
> > > necessary dependent platform symbols are built in.
> > > 
> > > Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
> > > Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
> > > Cc: <stable@vger.kernel.org> # 4.11 +
> > > ---
> > > 
> > >  drivers/watchdog/Kconfig | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> > > index ca200d1f310a..d96e2e7544fc 100644
> > > --- a/drivers/watchdog/Kconfig
> > > +++ b/drivers/watchdog/Kconfig
> > > @@ -1451,7 +1451,7 @@ config RC32434_WDT
> > >  
> > >  config INDYDOG
> > >  	tristate "Indy/I2 Hardware Watchdog"
> > > -	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
> > > +	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST && SGI_HAS_INDYDOG)
> > 
> > (MIPS && COMPILE_TEST && SGI_HAS_INDYDOG) implies SGI_HAS_INDYDOG
> > 
> > So I think you can just do:
> > -	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
> > +	depends on SGI_HAS_INDYDOG
> > 
> > I.e. COMPILE_TEST isn't of any value in this case.
> 
> I agree, due to the references to sgimc this driver will only compile for
> the platforms which set SGI_HAS_INDYDOG; MIPS as the dependency is too
> generic.
> 
> Updated patch for the watchdog maintainers' ease below.
> 
>   Ralf
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> Reported-by: Matt Redfearn <matt.redfearn@mips.com>
> Suggested-by: James Hogan <james.hogan@mips.com>
> 
Not sure if/how that helps. Now we have two patches with different
authors and sign-off statements, both of which need maintainer
manipulation. I'll pick the first patch into my tree and fix it up.
Let's see what Wim does with it.

Guenter

>  drivers/watchdog/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index c722cbfdc7e6..3ece1335ba84 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1451,7 +1451,7 @@ config RC32434_WDT
>  
>  config INDYDOG
>  	tristate "Indy/I2 Hardware Watchdog"
> -	depends on SGI_HAS_INDYDOG || (MIPS && COMPILE_TEST)
> +	depends on SGI_HAS_INDYDOG
>  	help
>  	  Hardware driver for the Indy's/I2's watchdog. This is a
>  	  watchdog timer that will reboot the machine after a 60 second

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-14 16:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14 10:52 [PATCH] watchdog: indydog: Add dependency on SGI_HAS_INDYDOG Matt Redfearn
2017-11-14 11:17 ` James Hogan
2017-11-14 13:48   ` Ralf Baechle
2017-11-14 16:19     ` 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).