summaryrefslogtreecommitdiff
path: root/drivers/bus
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-07-21 18:18:32 +0300
committerThomas Gleixner <tglx@linutronix.de>2020-07-21 18:18:32 +0300
commitb4a25fb0e62990df467451744b22e0e24960a5e6 (patch)
tree12a77660b289786f6197b0f33b3320cb405ce281 /drivers/bus
parente2a71bdea81690b6ef11f4368261ec6f5b6891aa (diff)
parent6cfcd5563b4fadbf49ba8fa481978e5e86d30322 (diff)
downloadlinux-b4a25fb0e62990df467451744b22e0e24960a5e6.tar.xz
Merge tag 'timers-v5.8-rc7' of https://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull a timer chip fix from Daniel Lezcano: - Fix kernel panic at suspend / resume time on TI am3/am4 (Tony Lindgren)
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/ti-sysc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index bb54fb514e40..c6427d0bc94c 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -2864,6 +2864,24 @@ static int sysc_check_disabled_devices(struct sysc *ddata)
return error;
}
+/*
+ * Ignore timers tagged with no-reset and no-idle. These are likely in use,
+ * for example by drivers/clocksource/timer-ti-dm-systimer.c. If more checks
+ * are needed, we could also look at the timer register configuration.
+ */
+static int sysc_check_active_timer(struct sysc *ddata)
+{
+ if (ddata->cap->type != TI_SYSC_OMAP2_TIMER &&
+ ddata->cap->type != TI_SYSC_OMAP4_TIMER)
+ return 0;
+
+ if ((ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) &&
+ (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE))
+ return -EBUSY;
+
+ return 0;
+}
+
static const struct of_device_id sysc_match_table[] = {
{ .compatible = "simple-bus", },
{ /* sentinel */ },
@@ -2920,6 +2938,10 @@ static int sysc_probe(struct platform_device *pdev)
if (error)
return error;
+ error = sysc_check_active_timer(ddata);
+ if (error)
+ return error;
+
error = sysc_get_clocks(ddata);
if (error)
return error;