mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: [GIT PULL for-4.4 02/25] watchdog: kempld: fix gcc-4.3 build
Date: Wed, 11 Oct 2017 00:45:39 +0000	[thread overview]
Message-ID: <20171011004533.8044-3-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171011004533.8044-1-alexander.levin@verizon.com>

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>
---
 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 5bf931ce1353..978098f71761 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.11.0

  parent reply	other threads:[~2017-10-11  0:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11  0:45 [GIT PULL for-4.4 00/25] Commits for v4.4 LTS Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 01/25] locking/lockdep: Add nest_lock integrity test Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 05/25] mac80211: fix power saving clients handling in iwlwifi Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 04/25] mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 03/25] irqchip/crossbar: Fix incorrect type of local variables Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` Levin, Alexander (Sasha Levin) [this message]
2017-10-11  0:45 ` [GIT PULL for-4.4 10/25] f2fs: do not wait for writeback in write_begin Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 08/25] iio: adc: xilinx: Fix error handling Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 07/25] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 09/25] Btrfs: send, fix failure to rename top level inode due to name collision Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 06/25] net/mlx4_en: fix overflow in mlx4_en_init_timestamp() Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 11/25] md/linear: shutup lockdep warnning Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 12/25] sparc64: Migrate hvcons irq to panicked cpu Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 13/25] net/mlx4_core: Fix VF overwrite of module param which disables DMFS on new probed PFs Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 14/25] crypto: xts - Add ECB dependency Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 17/25] scsi: scsi_dh_emc: return success in clariion_std_inquiry() Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 16/25] slub: do not merge cache if slub_debug contains a never-merge flag Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 15/25] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 18/25] net: mvpp2: release reference to txq_cpu[] entry after unmapping Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 21/25] uapi: fix linux/rds.h userspace compilation errors Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 19/25] i2c: at91: ensure state is restored after suspending Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 22/25] uapi: fix linux/mroute6.h userspace compilation errors Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 20/25] ceph: clean up unsafe d_parent accesses in build_dentry_path Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 25/25] cpufreq: CPPC: add ACPI_PROCESSOR dependency Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 23/25] target/iscsi: Fix unsolicited data seq_end_offset calculation Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.4 24/25] nfsd/callback: Cleanup callback cred on shutdown Levin, Alexander (Sasha Levin)
2017-10-19 13:20 ` [GIT PULL for-4.4 00/25] Commits for v4.4 LTS gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171011004533.8044-3-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®