From ae32912529e9d02f1ba90ff74f48a8a61f4b22dd Mon Sep 17 00:00:00 2001 From: Biao Long Date: Mon, 7 Dec 2020 10:32:52 +0800 Subject: [PATCH] msm-cpufreq: fix cpufreq compile error problem When enable Qcom-cpufreq driver on 5.4,because some data struct has been changed, and trace_cpu_frequency has been removed, this will cause the compile issue, so fix these problem to pass compile. Change-Id: I71f76b92a52cfd8a905a5fc7fad6e5a5f4e6b39f Signed-off-by: Biao Long --- drivers/cpufreq/qcom-cpufreq.c | 5 ++-- include/trace/events/power.h | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq.c b/drivers/cpufreq/qcom-cpufreq.c index 2797f2f112f6..af57ba4bc505 100644 --- a/drivers/cpufreq/qcom-cpufreq.c +++ b/drivers/cpufreq/qcom-cpufreq.c @@ -4,7 +4,7 @@ * MSM architecture cpufreq driver * * Copyright (C) 2007 Google, Inc. - * Copyright (c) 2007-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2007-2020, The Linux Foundation. All rights reserved. * Author: Mike A. Chan * */ @@ -49,7 +49,6 @@ static int set_cpu_freq(struct cpufreq_policy *policy, unsigned int new_freq, freqs.old = policy->cur; freqs.new = new_freq; - freqs.cpu = policy->cpu; trace_cpu_frequency_switch_start(freqs.old, freqs.new, policy->cpu); cpufreq_freq_transition_begin(policy, &freqs); @@ -123,7 +122,7 @@ static unsigned int msm_cpufreq_resolve_freq(struct cpufreq_policy *policy, return freq; } -static int msm_cpufreq_verify(struct cpufreq_policy *policy) +static int msm_cpufreq_verify(struct cpufreq_policy_data *policy) { cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 5b3e77be7bfa..8d3c50e9e86f 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h @@ -203,6 +203,48 @@ TRACE_EVENT(cpu_frequency_limits, (unsigned long)__entry->cpu_id) ); +TRACE_EVENT(cpu_frequency_switch_start, + + TP_PROTO(unsigned int start_freq, unsigned int end_freq, + unsigned int cpu_id), + + TP_ARGS(start_freq, end_freq, cpu_id), + + TP_STRUCT__entry( + __field(u32, start_freq) + __field(u32, end_freq) + __field(u32, cpu_id) + ), + + TP_fast_assign( + __entry->start_freq = start_freq; + __entry->end_freq = end_freq; + __entry->cpu_id = cpu_id; + ), + + TP_printk("start=%lu end=%lu cpu_id=%lu", + (unsigned long)__entry->start_freq, + (unsigned long)__entry->end_freq, + (unsigned long)__entry->cpu_id) +); + +TRACE_EVENT(cpu_frequency_switch_end, + + TP_PROTO(unsigned int cpu_id), + + TP_ARGS(cpu_id), + + TP_STRUCT__entry( + __field(u32, cpu_id) + ), + + TP_fast_assign( + __entry->cpu_id = cpu_id; + ), + + TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id) +); + TRACE_EVENT(device_pm_callback_start, TP_PROTO(struct device *dev, const char *pm_ops, int event),