Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1590147 > unrolled thread

[PATCH 0/3] remaining watchdog dependency fixes

Started byArnd Bergmann <arnd@arndb.de>
First post2017-03-01 11:00 +0100
Last post2017-03-01 15:20 +0100
Articles 7 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] remaining watchdog dependency fixes Arnd Bergmann <arnd@arndb.de> - 2017-03-01 11:00 +0100
    [PATCH 3/3] watchdog: retu: restore MFD dependency Arnd Bergmann <arnd@arndb.de> - 2017-03-01 11:00 +0100
      Re: [PATCH 3/3] watchdog: retu: restore MFD dependency Guenter Roeck <linux@roeck-us.net> - 2017-03-01 15:20 +0100
    [PATCH 2/3] watchdog: db8500: add back prmcu dependency Arnd Bergmann <arnd@arndb.de> - 2017-03-01 11:00 +0100
      Re: [PATCH 2/3] watchdog: db8500: add back prmcu dependency Guenter Roeck <linux@roeck-us.net> - 2017-03-01 15:20 +0100
    [PATCH 1/3] watchdog: kempld: fix gcc-4.3 build Arnd Bergmann <arnd@arndb.de> - 2017-03-01 11:00 +0100
      Re: [PATCH 1/3] watchdog: kempld: fix gcc-4.3 build Guenter Roeck <linux@roeck-us.net> - 2017-03-01 15:20 +0100

#1590147 — [PATCH 0/3] remaining watchdog dependency fixes

FromArnd Bergmann <arnd@arndb.de>
Date2017-03-01 11:00 +0100
Subject[PATCH 0/3] remaining watchdog dependency fixes
Message-ID<tg9d7-1fv-3@gated-at.bofh.it>
I've updated the db8500 and retu patches as requested, and
found one more patch in my backlog that we should just apply
as well.

	Arnd

[toc] | [next] | [standalone]


#1590151 — [PATCH 3/3] watchdog: retu: restore MFD dependency

FromArnd Bergmann <arnd@arndb.de>
Date2017-03-01 11:00 +0100
Subject[PATCH 3/3] watchdog: retu: restore MFD dependency
Message-ID<tg9d8-1fv-17@gated-at.bofh.it>
In reply to#1590147
The retu watchdog calls into the respective mfd driver, but fails to
link if that is diabled:

drivers/watchdog/built-in.o: In function `retu_wdt_set_timeout':
ziirave_wdt.c:(.text+0x8c88): undefined reference to `retu_write'
ziirave_wdt.c:(.text+0x8c88): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `retu_write'
drivers/watchdog/built-in.o: In function `retu_wdt_start':
ziirave_wdt.c:(.text+0x8cc8): undefined reference to `retu_write'
ziirave_wdt.c:(.text+0x8cc8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `retu_write'

This restores the dependency as it was before

Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index a199e8536ce4..52a70ee6014f 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -586,7 +586,7 @@ config UX500_WATCHDOG
 
 config RETU_WATCHDOG
 	tristate "Retu watchdog"
-	depends on MFD_RETU || COMPILE_TEST
+	depends on MFD_RETU
 	select WATCHDOG_CORE
 	help
 	  Retu watchdog driver for Nokia Internet Tablets (770, N800,
-- 
2.9.0

[toc] | [prev] | [next] | [standalone]


#1590346 — Re: [PATCH 3/3] watchdog: retu: restore MFD dependency

FromGuenter Roeck <linux@roeck-us.net>
Date2017-03-01 15:20 +0100
SubjectRe: [PATCH 3/3] watchdog: retu: restore MFD dependency
Message-ID<tgdgK-4b6-15@gated-at.bofh.it>
In reply to#1590151
On 03/01/2017 01:15 AM, Arnd Bergmann wrote:
> The retu watchdog calls into the respective mfd driver, but fails to
> link if that is diabled:
>
> drivers/watchdog/built-in.o: In function `retu_wdt_set_timeout':
> ziirave_wdt.c:(.text+0x8c88): undefined reference to `retu_write'
> ziirave_wdt.c:(.text+0x8c88): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `retu_write'
> drivers/watchdog/built-in.o: In function `retu_wdt_start':
> ziirave_wdt.c:(.text+0x8cc8): undefined reference to `retu_write'
> ziirave_wdt.c:(.text+0x8cc8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `retu_write'
>
> This restores the dependency as it was before
>
> Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index a199e8536ce4..52a70ee6014f 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -586,7 +586,7 @@ config UX500_WATCHDOG
>
>  config RETU_WATCHDOG
>  	tristate "Retu watchdog"
> -	depends on MFD_RETU || COMPILE_TEST
> +	depends on MFD_RETU
>  	select WATCHDOG_CORE
>  	help
>  	  Retu watchdog driver for Nokia Internet Tablets (770, N800,
>

[toc] | [prev] | [next] | [standalone]


#1590155 — [PATCH 2/3] watchdog: db8500: add back prmcu dependency

FromArnd Bergmann <arnd@arndb.de>
Date2017-03-01 11:00 +0100
Subject[PATCH 2/3] watchdog: db8500: add back prmcu dependency
Message-ID<tg9d8-1fv-31@gated-at.bofh.it>
In reply to#1590147
When the db8500 watchdog is enabled without the PRCMU, we get a lot of
warnings about duplicate or missing helper functions:

In file included from drivers/watchdog/ux500_wdt.c:21:0:
include/linux/mfd/dbx500-prcmu.h:422:19: error: redefinition of 'prcmu_abb_read'
 static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)

This restores the dependency as it was.

Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 47dbacf3bfb4..a199e8536ce4 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -574,7 +574,7 @@ config IMX2_WDT
 
 config UX500_WATCHDOG
 	tristate "ST-Ericsson Ux500 watchdog"
-	depends on MFD_DB8500_PRCMU || (ARM && COMPILE_TEST)
+	depends on MFD_DB8500_PRCMU
 	select WATCHDOG_CORE
 	default y
 	help
-- 
2.9.0

[toc] | [prev] | [next] | [standalone]


#1590343 — Re: [PATCH 2/3] watchdog: db8500: add back prmcu dependency

FromGuenter Roeck <linux@roeck-us.net>
Date2017-03-01 15:20 +0100
SubjectRe: [PATCH 2/3] watchdog: db8500: add back prmcu dependency
Message-ID<tgdgJ-4b6-3@gated-at.bofh.it>
In reply to#1590155
On 03/01/2017 01:15 AM, Arnd Bergmann wrote:
> When the db8500 watchdog is enabled without the PRCMU, we get a lot of
> warnings about duplicate or missing helper functions:
>
> In file included from drivers/watchdog/ux500_wdt.c:21:0:
> include/linux/mfd/dbx500-prcmu.h:422:19: error: redefinition of 'prcmu_abb_read'
>  static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
>
> This restores the dependency as it was.
>
> Fixes: da2a68b3eb47 ("watchdog: Enable COMPILE_TEST where possible")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 47dbacf3bfb4..a199e8536ce4 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -574,7 +574,7 @@ config IMX2_WDT
>
>  config UX500_WATCHDOG
>  	tristate "ST-Ericsson Ux500 watchdog"
> -	depends on MFD_DB8500_PRCMU || (ARM && COMPILE_TEST)
> +	depends on MFD_DB8500_PRCMU
>  	select WATCHDOG_CORE
>  	default y
>  	help
>

[toc] | [prev] | [next] | [standalone]


#1590164 — [PATCH 1/3] watchdog: kempld: fix gcc-4.3 build

FromArnd Bergmann <arnd@arndb.de>
Date2017-03-01 11:00 +0100
Subject[PATCH 1/3] watchdog: kempld: fix gcc-4.3 build
Message-ID<tg9d9-1fv-39@gated-at.bofh.it>
In reply to#1590147
gcc-4.3 can't decide whether the constant value in
kempld_prescaler[PRESCALER_21] is built-time constant or
not, and gets confused by the logic in do_div():

drivers/watchdog/kempld_wdt.o: In function `kempld_wdt_set_stage_timeout':
kempld_wdt.c:(.text.kempld_wdt_set_stage_timeout+0x130): undefined reference to `__aeabi_uldivmod'

This adds a call to ACCESS_ONCE() to force it to not consider
it to be constant, and leaves the more efficient normal case
in place for modern compilers, using an #ifdef to annotate
why we do this hack.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/watchdog/kempld_wdt.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/kempld_wdt.c b/drivers/watchdog/kempld_wdt.c
index 73c46b3a09ab..2f3b049ea301 100644
--- a/drivers/watchdog/kempld_wdt.c
+++ b/drivers/watchdog/kempld_wdt.c
@@ -140,12 +140,19 @@ static int kempld_wdt_set_stage_timeout(struct kempld_wdt_data *wdt_data,
 					unsigned int timeout)
 {
 	struct kempld_device_data *pld = wdt_data->pld;
-	u32 prescaler = kempld_prescaler[PRESCALER_21];
+	u32 prescaler;
 	u64 stage_timeout64;
 	u32 stage_timeout;
 	u32 remainder;
 	u8 stage_cfg;
 
+#if GCC_VERSION < 40400
+	/* work around a bug compiling do_div() */
+	prescaler = READ_ONCE(kempld_prescaler[PRESCALER_21]);
+#else
+	prescaler = kempld_prescaler[PRESCALER_21];
+#endif
+
 	if (!stage)
 		return -EINVAL;
 
-- 
2.9.0

[toc] | [prev] | [next] | [standalone]


#1590350 — Re: [PATCH 1/3] watchdog: kempld: fix gcc-4.3 build

FromGuenter Roeck <linux@roeck-us.net>
Date2017-03-01 15:20 +0100
SubjectRe: [PATCH 1/3] watchdog: kempld: fix gcc-4.3 build
Message-ID<tgdgK-4b6-19@gated-at.bofh.it>
In reply to#1590164
On 03/01/2017 01:15 AM, Arnd Bergmann wrote:
> gcc-4.3 can't decide whether the constant value in
> kempld_prescaler[PRESCALER_21] is built-time constant or
> not, and gets confused by the logic in do_div():
>
> drivers/watchdog/kempld_wdt.o: In function `kempld_wdt_set_stage_timeout':
> kempld_wdt.c:(.text.kempld_wdt_set_stage_timeout+0x130): undefined reference to `__aeabi_uldivmod'
>
> This adds a call to ACCESS_ONCE() to force it to not consider
> it to be constant, and leaves the more efficient normal case
> in place for modern compilers, using an #ifdef to annotate
> why we do this hack.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/kempld_wdt.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/kempld_wdt.c b/drivers/watchdog/kempld_wdt.c
> index 73c46b3a09ab..2f3b049ea301 100644
> --- a/drivers/watchdog/kempld_wdt.c
> +++ b/drivers/watchdog/kempld_wdt.c
> @@ -140,12 +140,19 @@ static int kempld_wdt_set_stage_timeout(struct kempld_wdt_data *wdt_data,
>  					unsigned int timeout)
>  {
>  	struct kempld_device_data *pld = wdt_data->pld;
> -	u32 prescaler = kempld_prescaler[PRESCALER_21];
> +	u32 prescaler;
>  	u64 stage_timeout64;
>  	u32 stage_timeout;
>  	u32 remainder;
>  	u8 stage_cfg;
>
> +#if GCC_VERSION < 40400
> +	/* work around a bug compiling do_div() */
> +	prescaler = READ_ONCE(kempld_prescaler[PRESCALER_21]);
> +#else
> +	prescaler = kempld_prescaler[PRESCALER_21];
> +#endif
> +
>  	if (!stage)
>  		return -EINVAL;
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web