USB: ANDROID: Implement dynamic pm_qos voting based on USB activity
Currently USB android driver maintains only two states for DMA
latency voting with pm_qos i.e. USB connect and disconnect/suspend.
This doesn't take into consideration when USB is completely IDLE
or very minimal USB transfers are happening resulting in high
power consumption. Even though USB is used for battery charging
but not allowing CPU to enter lower power states may result in high
charging time or even device getting hot.
Driver now monitors USB traffic using UI interrupts count and based
on that takes decision to vote appropriate DMA latency. If interrupts
during a sample time are less than threshold then it allows transition
from WFI to IDLE_PC and further to IDLE_PC_RPM if no interrupts are
seen for a while.
All these thresholds and sample times (note below) are configurable and
should be defined such that we ramp up fast to WFI (up_sample_sec)
but slow down shift to IDLE_PC (down_sample_sec). User configurable
parameters are:
1. Parameters to control WFI to L2 IDLE_PC transition:
* down_pm_qos_sample_sec: Interrupts sampling time
* down_pm_qos_threshold: If interrupts during a sample are less than
this threshold then allow L2 IDLE_PC.
2. Parameters to control IDLE_PC to IDLE_PC_RPM transition:
* idle_pc_rpm_no_int_secs: If no interrupts are seen for this much
time then allow L2 IDLE_PC_RPM.
3. Parameters to control transition to WFI:
* up_pm_qos_sample_sec: Interrupts sampling time
* up_pm_qos_threshold: If interrupts during a sample are more than
this threshold then allow only WFI.
Change-Id: I945dfca84e56005e8d5940f3dc31ed2c1197cde1
Signed-off-by:
Manu Gautam <mgautam@codeaurora.org>
Loading
Please register or sign in to comment