Re: [Patch v2 7/9] cpufreq: tegra194: add OPP support and set bandwidth
From: Sumit Gupta
Date: Thu Feb 23 2023 - 04:37:40 EST
On 22/02/23 09:33, Viresh Kumar wrote:
External email: Use caution opening links or attachments
On 20-02-23, 19:35, Sumit Gupta wrote:
+static int tegra_cpufreq_set_bw(struct cpufreq_policy *policy, unsigned long freq_khz)
+{
+ struct dev_pm_opp *opp;
+ struct device *dev;
+ int ret;
+
+ dev = get_cpu_device(policy->cpu);
+ if (!dev)
+ return -ENODEV;
+
+ opp = dev_pm_opp_find_freq_exact(dev, freq_khz * KHZ, true);
+ if (IS_ERR(opp))
+ return PTR_ERR(opp);
+
+ ret = dev_pm_opp_set_opp(dev, opp);
+ dev_pm_opp_put(opp);
What about dev_pm_opp_set_rate() instead ?
+ return ret;
+}
--
viresh
Tried using it and got below crash. It seems to be coming because we
don't have clocks property within CPU node for SoC's having BPMP-FW.
Unable to handle kernel NULL pointer dereference at virtual address
000000000000002e
....
Call trace:
clk_round_rate+0x38/0xd8
dev_pm_opp_set_rate+0xe4/0x1a8
tegra194_cpufreq_set_target+0x74/0x88
__cpufreq_driver_target+0x154/0x250
cpufreq_online+0x7b4/0x9ac
Thanks,
Sumit