Skip to content

Commit

Permalink
PM / devfreq: rockchip_dmc: clear the irq if waiting complt_irq timeout
Browse files Browse the repository at this point in the history
If waiting for wait_ctrl.complt_irq times out, clear the IRQ and stop the MCU by
sip_smc_dram(DRAM_POST_SET_RATE). Prevent the complt_irq which blocked from responding
in the next DDR frequency conversion flow.

Signed-off-by: YouMin Chen <cym@rock-chips.com>
Change-Id: I771ac2471dd1ef388f249c367d4f875ea0502e6c
  • Loading branch information
YouMinChen authored and RadxaStephen committed Aug 22, 2022
1 parent 4ce9a74 commit 0cdf37b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/devfreq/rockchip_dmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,16 @@ int rockchip_dmcfreq_wait_complete(void)
wait_event_timeout(wait_ctrl.wait_wq, (wait_ctrl.wait_flag == 0),
msecs_to_jiffies(wait_ctrl.wait_time_out_ms));

/*
* If waiting for wait_ctrl.complt_irq times out, clear the IRQ and stop the MCU by
* sip_smc_dram(DRAM_POST_SET_RATE).
*/
if (wait_ctrl.dcf_en == 2 && wait_ctrl.wait_flag != 0) {
res = sip_smc_dram(SHARE_PAGE_TYPE_DDR, 0, ROCKCHIP_SIP_CONFIG_DRAM_POST_SET_RATE);
if (res.a0)
pr_err("%s: dram post set rate error:%lx\n", __func__, res.a0);
}

cpu_latency_qos_update_request(&pm_qos, PM_QOS_DEFAULT_VALUE);
disable_irq(wait_ctrl.complt_irq);

Expand Down

0 comments on commit 0cdf37b

Please sign in to comment.