diff options
-rw-r--r-- | arch/arm/mach-omap2/omap2plus-cpufreq.c | 71 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap4-common.c | 5 | ||||
-rw-r--r-- | drivers/remoteproc/remoteproc.c | 7 | ||||
-rw-r--r-- | drivers/usb/host/ehci-q.c | 5 |
4 files changed, 78 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c index fb2c25c..950d511 100644 --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c @@ -28,6 +28,7 @@ #include <linux/opp.h> #include <linux/cpu.h> #include <linux/thermal_framework.h> +#include <linux/platform_device.h> #include <asm/system.h> #include <asm/smp_plat.h> @@ -63,6 +64,7 @@ static unsigned int max_freq; static unsigned int current_target_freq; static unsigned int current_cooling_level; static bool omap_cpufreq_ready; +static bool omap_cpufreq_suspended; static unsigned int omap_getspeed(unsigned int cpu) { @@ -179,9 +181,11 @@ void omap_thermal_throttle(void) pr_warn("%s: temperature too high, cpu throttle at max %u\n", __func__, max_thermal); - cur = omap_getspeed(0); - if (cur > max_thermal) - omap_cpufreq_scale(max_thermal, cur); + if (!omap_cpufreq_suspended) { + cur = omap_getspeed(0); + if (cur > max_thermal) + omap_cpufreq_scale(max_thermal, cur); + } mutex_unlock(&omap_cpufreq_lock); } @@ -204,8 +208,10 @@ void omap_thermal_unthrottle(void) pr_warn("%s: temperature reduced, ending cpu throttling\n", __func__); - cur = omap_getspeed(0); - omap_cpufreq_scale(current_target_freq, cur); + if (!omap_cpufreq_suspended) { + cur = omap_getspeed(0); + omap_cpufreq_scale(current_target_freq, cur); + } out: mutex_unlock(&omap_cpufreq_lock); @@ -243,7 +249,9 @@ static int omap_target(struct cpufreq_policy *policy, current_target_freq = freq_table[i].frequency; - ret = omap_cpufreq_scale(current_target_freq, policy->cur); + if (!omap_cpufreq_suspended) + ret = omap_cpufreq_scale(current_target_freq, policy->cur); + mutex_unlock(&omap_cpufreq_lock); @@ -429,6 +437,41 @@ static struct cpufreq_driver omap_driver = { .attr = omap_cpufreq_attr, }; +static int omap_cpufreq_suspend_noirq(struct device *dev) +{ + mutex_lock(&omap_cpufreq_lock); + omap_cpufreq_suspended = true; + mutex_unlock(&omap_cpufreq_lock); + return 0; +} + +static int omap_cpufreq_resume_noirq(struct device *dev) +{ + unsigned int cur; + + mutex_lock(&omap_cpufreq_lock); + cur = omap_getspeed(0); + if (cur != current_target_freq) + omap_cpufreq_scale(current_target_freq, cur); + + omap_cpufreq_suspended = false; + mutex_unlock(&omap_cpufreq_lock); + return 0; +} + +static struct dev_pm_ops omap_cpufreq_driver_pm_ops = { + .suspend_noirq = omap_cpufreq_suspend_noirq, + .resume_noirq = omap_cpufreq_resume_noirq, +}; + +static struct platform_driver omap_cpufreq_platform_driver = { + .driver.name = "omap_cpufreq", + .driver.pm = &omap_cpufreq_driver_pm_ops, +}; +static struct platform_device omap_cpufreq_device = { + .name = "omap_cpufreq", +}; + static int __init omap_cpufreq_init(void) { int ret; @@ -455,6 +498,20 @@ static int __init omap_cpufreq_init(void) ret = cpufreq_register_driver(&omap_driver); omap_cpufreq_ready = !ret; + + if (!ret) { + int t; + + t = platform_device_register(&omap_cpufreq_device); + if (t) + pr_warn("%s_init: platform_device_register failed\n", + __func__); + t = platform_driver_register(&omap_cpufreq_platform_driver); + if (t) + pr_warn("%s_init: platform_driver_register failed\n", + __func__); + } + return ret; } @@ -462,6 +519,8 @@ static void __exit omap_cpufreq_exit(void) { omap_cpufreq_cooling_exit(); cpufreq_unregister_driver(&omap_driver); + platform_driver_unregister(&omap_cpufreq_platform_driver); + platform_device_unregister(&omap_cpufreq_device); } MODULE_DESCRIPTION("cpufreq driver for OMAP2PLUS SOCs"); diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index b5775a5..488a73f 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -206,9 +206,10 @@ static int __init omap_l2_cache_init(void) /* * Double linefill is available only on OMAP4460 L2X0. + * It may cause single cache line memory corruption, leave it disabled + * on all devices */ - if (cpu_is_omap446x()) - por_ctrl |= 1 << L2X0_PREFETCH_DOUBLE_LINEFILL_SHIFT; + por_ctrl &= ~(1 << L2X0_PREFETCH_DOUBLE_LINEFILL_SHIFT); if (!mpu_prefetch_disable_errata) { por_ctrl |= 1 << L2X0_PREFETCH_DATA_PREFETCH_SHIFT; por_ctrl |= L2X0_POR_OFFSET_VALUE; diff --git a/drivers/remoteproc/remoteproc.c b/drivers/remoteproc/remoteproc.c index 680a701..907fc01 100644 --- a/drivers/remoteproc/remoteproc.c +++ b/drivers/remoteproc/remoteproc.c @@ -675,7 +675,8 @@ static void rproc_start(struct rproc *rproc, u64 bootaddr) pm_runtime_set_autosuspend_delay(dev, rproc->sus_timeout); pm_runtime_get_noresume(rproc->dev); pm_runtime_set_active(rproc->dev); - pm_runtime_enable(rproc->dev); + if (!rproc->secure_mode) + pm_runtime_enable(rproc->dev); pm_runtime_mark_last_busy(rproc->dev); pm_runtime_put_autosuspend(rproc->dev); #endif @@ -1340,7 +1341,9 @@ void rproc_put(struct rproc *rproc) */ pm_runtime_get_sync(rproc->dev); pm_runtime_put_noidle(rproc->dev); - pm_runtime_disable(rproc->dev); + if (!rproc->secure_reset) + pm_runtime_disable(rproc->dev); + pm_runtime_set_suspended(rproc->dev); #endif ret = rproc->ops->stop(rproc); diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 2719879..6c6013c 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c @@ -498,6 +498,11 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) last = list_entry (qtd->qtd_list.prev, struct ehci_qtd, qtd_list); last->hw_next = qtd->hw_next; + /* + * Make sure the new hw_next pointer is visible + * to the HW before freeing the old one + */ + wmb(); } /* remove qtd; it's recycled after possible urb completion */ |