mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
Revert "ANDROID: GKI: PM/devfreq: Do not switch governors from sysfs when device is suspended"
This reverts commit 4f9183cc24.
Conflicts:
include/linux/devfreq.h
Change-Id: I8bf76eb9113d1a1b564b396cd66a15bc4fd8e672
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
@@ -638,7 +638,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
||||
devfreq->last_status.current_frequency = profile->initial_freq;
|
||||
devfreq->data = data;
|
||||
devfreq->nb.notifier_call = devfreq_notifier_call;
|
||||
devfreq->dev_suspended = false;
|
||||
|
||||
if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
|
||||
mutex_unlock(&devfreq->lock);
|
||||
@@ -867,16 +866,12 @@ int devfreq_suspend_device(struct devfreq *devfreq)
|
||||
if (!devfreq)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&devfreq->event_lock);
|
||||
if (!devfreq->governor || devfreq->dev_suspended) {
|
||||
mutex_unlock(&devfreq->event_lock);
|
||||
if (!devfreq->governor)
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_lock(&devfreq->event_lock);
|
||||
ret = devfreq->governor->event_handler(devfreq,
|
||||
DEVFREQ_GOV_SUSPEND, NULL);
|
||||
if (!ret)
|
||||
devfreq->dev_suspended = true;
|
||||
mutex_unlock(&devfreq->event_lock);
|
||||
return ret;
|
||||
}
|
||||
@@ -896,16 +891,12 @@ int devfreq_resume_device(struct devfreq *devfreq)
|
||||
if (!devfreq)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&devfreq->event_lock);
|
||||
if (!devfreq->governor) {
|
||||
mutex_unlock(&devfreq->event_lock);
|
||||
if (!devfreq->governor)
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_lock(&devfreq->event_lock);
|
||||
ret = devfreq->governor->event_handler(devfreq,
|
||||
DEVFREQ_GOV_RESUME, NULL);
|
||||
if (!ret)
|
||||
devfreq->dev_suspended = false;
|
||||
mutex_unlock(&devfreq->event_lock);
|
||||
return ret;
|
||||
}
|
||||
@@ -1076,10 +1067,6 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
|
||||
}
|
||||
|
||||
mutex_lock(&df->event_lock);
|
||||
if (df->dev_suspended) {
|
||||
ret = -EINVAL;
|
||||
goto gov_stop_out;
|
||||
}
|
||||
if (df->governor) {
|
||||
ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL);
|
||||
if (ret) {
|
||||
|
||||
@@ -196,7 +196,6 @@ struct devfreq {
|
||||
|
||||
struct srcu_notifier_head transition_notifier_list;
|
||||
struct srcu_notifier_head policy_notifier_list;
|
||||
bool dev_suspended;
|
||||
};
|
||||
|
||||
struct devfreq_freqs {
|
||||
|
||||
Reference in New Issue
Block a user