stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "watchdog: kempld: fix gcc-4.3 build" has been added to the 4.9-stable tree
@ 2017-10-19 13:14 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-10-19 13:14 UTC (permalink / raw)
  To: arnd, alexander.levin, gregkh, linux; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    watchdog: kempld: fix gcc-4.3 build

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     watchdog-kempld-fix-gcc-4.3-build.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Thu Oct 19 15:04:02 CEST 2017
From: Arnd Bergmann <arnd@arndb.de>
Date: Wed, 1 Mar 2017 10:15:29 +0100
Subject: watchdog: kempld: fix gcc-4.3 build

From: Arnd Bergmann <arnd@arndb.de>


[ Upstream commit 3736d4eb6af37492aeded7fec0072dedd959c842 ]

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>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/watchdog/kempld_wdt.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/drivers/watchdog/kempld_wdt.c
+++ b/drivers/watchdog/kempld_wdt.c
@@ -140,12 +140,19 @@ static int kempld_wdt_set_stage_timeout(
 					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;
 


Patches currently in stable-queue which might be from arnd@arndb.de are

queue-4.9/watchdog-kempld-fix-gcc-4.3-build.patch
queue-4.9/asoc-mediatek-add-i2c-dependency-for-cs42xx8.patch
queue-4.9/cpufreq-cppc-add-acpi_processor-dependency.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-19 13:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-19 13:14 Patch "watchdog: kempld: fix gcc-4.3 build" has been added to the 4.9-stable tree gregkh

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).