summaryrefslogtreecommitdiff
path: root/drivers/bus
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2020-07-02 10:41:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-22 09:33:01 +0200
commit47ba42786d14d1b3ff0b3a0e631e45db7475aa3d (patch)
treeed17f45eb16e135db14dc6d007ca878826104bba /drivers/bus
parent5a23897f7a411f32d531ac52cfbf46e39f137e87 (diff)
downloadlinux-47ba42786d14d1b3ff0b3a0e631e45db7475aa3d.tar.gz
linux-47ba42786d14d1b3ff0b3a0e631e45db7475aa3d.tar.bz2
linux-47ba42786d14d1b3ff0b3a0e631e45db7475aa3d.zip
bus: ti-sysc: Fix sleeping function called from invalid context for RTC quirk
[ Upstream commit afe6f1eeb08f85e57f0a02b71efb5a0839606aac ] With CONFIG_DEBUG_ATOMIC_SLEEP enabled we can see the following with RTC probe: BUG: sleeping function called from invalid context at drivers/bus/ti-sysc.c:1736 ... (sysc_quirk_rtc) from [<c060d01c>] (sysc_write_sysconfig+0x1c/0x60) (sysc_write_sysconfig) from [<c060d9f4>] (sysc_enable_module+0x11c/0x274) (sysc_enable_module) from [<c060f37c>] (sysc_probe+0xe9c/0x1380) (sysc_probe) from [<c06e9384>] (platform_drv_probe+0x48/0x98) Fixes: e8639e1c986a ("bus: ti-sysc: Handle module unlock quirk needed for some RTC") Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/ti-sysc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index da586d75962f..76e749dfc4fd 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -1571,8 +1571,8 @@ static void sysc_quirk_rtc(struct sysc *ddata, bool lock)
local_irq_save(flags);
/* RTC_STATUS BUSY bit may stay active for 1/32768 seconds (~30 usec) */
- error = readl_poll_timeout(ddata->module_va + 0x44, val,
- !(val & BIT(0)), 100, 50);
+ error = readl_poll_timeout_atomic(ddata->module_va + 0x44, val,
+ !(val & BIT(0)), 100, 50);
if (error)
dev_warn(ddata->dev, "rtc busy timeout\n");
/* Now we have ~15 microseconds to read/write various registers */