Messages in this thread | | | Subject | Re: [TEGRA194_CPUFREQ Patch v2 2/3] cpufreq: Add Tegra194 cpufreq driver | From | Dmitry Osipenko <> | Date | Tue, 7 Apr 2020 22:12:00 +0300 |
| |
07.04.2020 21:55, sumitg пишет: ... >>> + * Returns freq in KHz on success, 0 if cpu is offline >> >> I don't see any checks in the code about whether CPU is offline. >> >> Googling for "queue_work_on offline cpu" suggests that this function >> should hang. >> > Tried this and didn't get crash or hang. > show_cpuinfo_cur_freq() returns "<unknown>" value on reading frequency > from a cluster having both it's cores offline. > If only one cpu is offline, then frequency of other online cpu which is > managing the policy of that cluster is returned. > Have still added below check as guard in get|set() freq calls. > if (!cpu_online(cpu)) > return -EINVAL; > Thankyou for the input.
If CPUFreq core takes care of taking into account the offline CPU, then the check isn't needed. It also wouldn't be enough if there was a problem here.
| |