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

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

Merge "perf: Reorder idle notifier registration in armv7 PMU"

parents ba438ab1 ad9b5da1
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -1225,25 +1225,9 @@ static int armv7_pmu_idle_notifier(struct notifier_block *nb,

static int armv7_probe_pmu(struct arm_pmu *arm_pmu)
{
	int ret;
	struct armv7_pmu_idle_nb *pmu_idle_nb;

	pmu_idle_nb = devm_kzalloc(&arm_pmu->plat_device->dev,
				sizeof(*pmu_idle_nb), GFP_KERNEL);
	if (!pmu_idle_nb)
		return -ENOMEM;

	ret = smp_call_function_any(&arm_pmu->supported_cpus,
	return smp_call_function_any(&arm_pmu->supported_cpus,
				     armv7_read_num_pmnc_events,
				     &arm_pmu->num_events, 1);
	if (ret)
		return ret;

	pmu_idle_nb->cpu_pmu = arm_pmu;
	pmu_idle_nb->perf_cpu_idle_nb.notifier_call = armv7_pmu_idle_notifier;
	idle_notifier_register(&pmu_idle_nb->perf_cpu_idle_nb);

	return 0;
}

static int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu)
@@ -2077,8 +2061,24 @@ static const struct pmu_probe_info armv7_pmu_probe_table[] = {

static int armv7_pmu_device_probe(struct platform_device *pdev)
{
	return arm_pmu_device_probe(pdev, armv7_pmu_of_device_ids,
	int ret;
	struct armv7_pmu_idle_nb *pmu_idle_nb;

	pmu_idle_nb = devm_kzalloc(&pdev->dev, sizeof(*pmu_idle_nb),
				    GFP_KERNEL);
	if (!pmu_idle_nb)
		return -ENOMEM;

	ret = arm_pmu_device_probe(pdev, armv7_pmu_of_device_ids,
				    armv7_pmu_probe_table);
	if (ret)
		return ret;

	pmu_idle_nb->cpu_pmu = (struct arm_pmu *) platform_get_drvdata(pdev);
	pmu_idle_nb->perf_cpu_idle_nb.notifier_call = armv7_pmu_idle_notifier;
	idle_notifier_register(&pmu_idle_nb->perf_cpu_idle_nb);

	return 0;
}

static struct platform_driver armv7_pmu_driver = {
+1 −0
Original line number Diff line number Diff line
@@ -1128,6 +1128,7 @@ int arm_pmu_device_probe(struct platform_device *pdev,
	armpmu_init(pmu);

	pmu->plat_device = pdev;
	platform_set_drvdata(pdev, pmu);

	if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) {
		init_fn = of_id->data;