diff options
author | Finley Xiao <finley.xiao@rock-chips.com> | 2018-04-22 21:11:27 +0800 |
---|---|---|
committer | Tao Huang <huangtao@rock-chips.com> | 2018-04-26 16:44:24 +0800 |
commit | e37dce72a0932f34b2348860194163e83c7146cd (patch) | |
tree | 5f658360710ab1c00a4536ced8c2f28c7a10a598 | |
parent | 767bd670b9a227a822bf749389283fa01a439dc4 (diff) |
PM / devfreq: rockchip_dmc: Update cpu dma latency when change frequency
Change-Id: Ia063ce7da2f68ffac4068f4f8136acf178a28918
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: YouMin Chen <cym@rock-chips.com>
-rw-r--r-- | drivers/devfreq/rockchip_dmc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/devfreq/rockchip_dmc.c b/drivers/devfreq/rockchip_dmc.c index 79a634812051..6b5c77ef2bc8 100644 --- a/drivers/devfreq/rockchip_dmc.c +++ b/drivers/devfreq/rockchip_dmc.c @@ -34,6 +34,7 @@ #include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/pm_opp.h> +#include <linux/pm_qos.h> #include <linux/reboot.h> #include <linux/regulator/consumer.h> #include <linux/rockchip/rockchip_sip.h> @@ -808,6 +809,8 @@ struct rockchip_dmcfreq { int (*set_auto_self_refresh)(u32 en); }; +static struct pm_qos_request pm_qos; + /* * function: packaging de-skew setting to px30_ddr_dts_config_timing, * px30_ddr_dts_config_timing will pass to trust firmware, and @@ -1606,8 +1609,18 @@ int rockchip_dmcfreq_wait_complete(void) return 0; } wait_ctrl.wait_flag = -1; + + /* + * CPUs only enter WFI when idle to make sure that + * FIQn can quick response. + */ + pm_qos_update_request(&pm_qos, 0); + wait_event_timeout(wait_ctrl.wait_wq, (wait_ctrl.wait_flag == 0), msecs_to_jiffies(wait_ctrl.wait_time_out_ms)); + + pm_qos_update_request(&pm_qos, PM_QOS_DEFAULT_VALUE); + return 0; } @@ -2986,6 +2999,9 @@ static int rockchip_dmcfreq_probe(struct platform_device *pdev) else data->touchboostpulse_duration_val = 500 * USEC_PER_MSEC; + pm_qos_add_request(&pm_qos, PM_QOS_CPU_DMA_LATENCY, + PM_QOS_DEFAULT_VALUE); + ret = devfreq_add_governor(&devfreq_dmc_ondemand); if (ret) { dev_err(dev, "Failed to add rockchip governor: %d\n", ret); |