Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7da61d2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "PM / devfreq: bw_hwmon: Fix event-based race condition"

parents 7d39550b 52593752
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -820,11 +820,13 @@ static struct attribute_group dev_attr_group = {
static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,
					unsigned int event, void *data)
{
	int ret;
	int ret = 0;
	unsigned int sample_ms;
	struct hwmon_node *node;
	struct bw_hwmon *hw;

	mutex_lock(&state_lock);

	switch (event) {
	case DEVFREQ_GOV_START:
		sample_ms = df->profile->polling_ms;
@@ -834,7 +836,7 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,

		ret = gov_start(df);
		if (ret)
			return ret;
			goto out;

		dev_dbg(df->dev.parent,
			"Enabled dev BW HW monitor governor\n");
@@ -864,7 +866,7 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,
		if (ret) {
			dev_err(df->dev.parent,
				"Unable to resume HW monitor (%d)\n", ret);
			return ret;
			goto out;
		}
		break;

@@ -874,7 +876,7 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,
			dev_err(df->dev.parent,
				"Unable to suspend BW HW mon governor (%d)\n",
				ret);
			return ret;
			goto out;
		}

		dev_dbg(df->dev.parent, "Suspended BW HW mon governor\n");
@@ -886,14 +888,17 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,
			dev_err(df->dev.parent,
				"Unable to resume BW HW mon governor (%d)\n",
				ret);
			return ret;
			goto out;
		}

		dev_dbg(df->dev.parent, "Resumed BW HW mon governor\n");
		break;
	}

	return 0;
out:
	mutex_unlock(&state_lock);

	return ret;
}

static struct devfreq_governor devfreq_gov_bw_hwmon = {