Skip to content

Commit e37dce7

Browse files
finley1226rkhuangtao
authored andcommitted
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>
1 parent 767bd67 commit e37dce7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

drivers/devfreq/rockchip_dmc.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/of_irq.h>
3535
#include <linux/platform_device.h>
3636
#include <linux/pm_opp.h>
37+
#include <linux/pm_qos.h>
3738
#include <linux/reboot.h>
3839
#include <linux/regulator/consumer.h>
3940
#include <linux/rockchip/rockchip_sip.h>
@@ -808,6 +809,8 @@ struct rockchip_dmcfreq {
808809
int (*set_auto_self_refresh)(u32 en);
809810
};
810811

812+
static struct pm_qos_request pm_qos;
813+
811814
/*
812815
* function: packaging de-skew setting to px30_ddr_dts_config_timing,
813816
* px30_ddr_dts_config_timing will pass to trust firmware, and
@@ -1606,8 +1609,18 @@ int rockchip_dmcfreq_wait_complete(void)
16061609
return 0;
16071610
}
16081611
wait_ctrl.wait_flag = -1;
1612+
1613+
/*
1614+
* CPUs only enter WFI when idle to make sure that
1615+
* FIQn can quick response.
1616+
*/
1617+
pm_qos_update_request(&pm_qos, 0);
1618+
16091619
wait_event_timeout(wait_ctrl.wait_wq, (wait_ctrl.wait_flag == 0),
16101620
msecs_to_jiffies(wait_ctrl.wait_time_out_ms));
1621+
1622+
pm_qos_update_request(&pm_qos, PM_QOS_DEFAULT_VALUE);
1623+
16111624
return 0;
16121625
}
16131626

@@ -2986,6 +2999,9 @@ static int rockchip_dmcfreq_probe(struct platform_device *pdev)
29862999
else
29873000
data->touchboostpulse_duration_val = 500 * USEC_PER_MSEC;
29883001

3002+
pm_qos_add_request(&pm_qos, PM_QOS_CPU_DMA_LATENCY,
3003+
PM_QOS_DEFAULT_VALUE);
3004+
29893005
ret = devfreq_add_governor(&devfreq_dmc_ondemand);
29903006
if (ret) {
29913007
dev_err(dev, "Failed to add rockchip governor: %d\n", ret);

0 commit comments

Comments
 (0)