[PATCH] cpufreq: exynos: Broadcast frequency change notifications for all cores
From: Tomasz Figa <hidden>
Date: 2013-01-31 15:04:13
Also in:
linux-pm, linux-samsung-soc
On Thursday 31 of January 2013 20:22:50 Viresh Kumar wrote:
On 31 January 2013 20:15, Tomasz Figa [off-list ref] wrote:quoted
On Thursday 31 of January 2013 09:50:37 Viresh Kumar wrote:quoted
quoted
+ policy->shared_type = CPUFREQ_SHARED_TYPE_ANY;I couldn't understand the use of this change. Can you please explain ?All cores on Exynos SoCs share the same clock source, which means that they all always run at the same frequency. So setting frequency on one core sets the frequency on all cores and so it doesn't matter on which core the frequency setting operation is done.Great, that's like most other platforms and for this you just need to set mask of all the possible cpus (online or offline) into policy->cpusquoted
As you can see in include/linux/cpufreq.h: #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ which basically tells (together with rest of the patch) the cpufreq subsystem about what I wrote earlier.I don't think so. Because i wasn't using it on my system and it was working well. Then i grepped it in kernel source viresh at blr-linut-001:$ git grep shared_type drivers/cpufreq/ drivers/cpufreq/acpi-cpufreq.c: if (policy->shared_type != CPUFREQ_SHARED_TYPE_ANY) drivers/cpufreq/acpi-cpufreq.c: policy->shared_type = perf->shared_type; drivers/cpufreq/acpi-cpufreq.c: if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || drivers/cpufreq/acpi-cpufreq.c: policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { drivers/cpufreq/acpi-cpufreq.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; drivers/cpufreq/acpi-cpufreq.c: policy->shared_type = CPUFREQ_SHARED_TYPE_HW; drivers/cpufreq/cpufreq-cpu0.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ANY; drivers/cpufreq/db8500-cpufreq.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; drivers/cpufreq/omap-cpufreq.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ANY; drivers/cpufreq/speedstep-centrino.c: if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) drivers/cpufreq/speedstep-centrino.c: if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) I couldn't see any core file using this stuff other than acpi-cpufreq.c, which is for x86 only systems if i am not wrong. @Rafael: You view on this.. ? Actually i believe it was just used by many ARM drivers without knowing the real use of it and new drivers have just followed it. I can get a patch to fix it at all places if you agree. BTW, grep in full kernel source gave, which is again acpi only: viresh at blr-linut-001:$ git grep shared_type arch/arm/mach-tegra/cpu-tegra.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; drivers/acpi/processor_perflib.c: pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL; drivers/acpi/processor_perflib.c: pr->performance->shared_type = CPUFREQ_SHARED_TYPE_HW; drivers/acpi/processor_perflib.c: pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ANY; drivers/acpi/processor_perflib.c: match_pr->performance->shared_type = drivers/acpi/processor_perflib.c: pr->performance->shared_type; drivers/acpi/processor_perflib.c: pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL; drivers/acpi/processor_throttling.c: pthrottling->shared_type = DOMAIN_COORD_TYPE_SW_ALL; drivers/acpi/processor_throttling.c: pthrottling->shared_type = pdomain->coord_type; drivers/acpi/processor_throttling.c: pthrottling->shared_type = DOMAIN_COORD_TYPE_SW_ALL; drivers/acpi/processor_throttling.c: if (p_throttling->shared_type == DOMAIN_COORD_TYPE_SW_ANY) { drivers/acpi/processor_throttling.c: pthrottling->shared_type = DOMAIN_COORD_TYPE_SW_ALL; drivers/cpufreq/acpi-cpufreq.c: if (policy->shared_type != CPUFREQ_SHARED_TYPE_ANY) drivers/cpufreq/acpi-cpufreq.c: policy->shared_type = perf->shared_type; drivers/cpufreq/acpi-cpufreq.c: if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || drivers/cpufreq/acpi-cpufreq.c: policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { drivers/cpufreq/acpi-cpufreq.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; drivers/cpufreq/acpi-cpufreq.c: policy->shared_type = CPUFREQ_SHARED_TYPE_HW; drivers/cpufreq/cpufreq-cpu0.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ANY; drivers/cpufreq/db8500-cpufreq.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; drivers/cpufreq/omap-cpufreq.c: policy->shared_type = CPUFREQ_SHARED_TYPE_ANY; drivers/cpufreq/speedstep-centrino.c: if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) drivers/cpufreq/speedstep-centrino.c: if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) drivers/net/wireless/rtlwifi/rtl8192ce/hw.c: rtlpcipriv->bt_coexist.bt_radio_shared_type = drivers/net/wireless/rtlwifi/rtl8723ae/hw.c: pcipriv->bt_coexist.bt_radio_shared_type = drivers/net/wireless/rtlwifi/rtl8723ae/hw.c: pcipriv->bt_coexist.bt_radio_shared_type); drivers/net/wireless/rtlwifi/wifi.h: u8 bt_radio_shared_type; drivers/xen/xen-acpi-processor.c: dst->shared_type = _pr->performance->shared_type; drivers/xen/xen-acpi-processor.c: dst->shared_type = CPUFREQ_SHARED_TYPE_ALL; drivers/xen/xen-acpi-processor.c: dst->shared_type = CPUFREQ_SHARED_TYPE_HW; drivers/xen/xen-acpi-processor.c: dst->shared_type = CPUFREQ_SHARED_TYPE_ANY; include/acpi/processor.h: unsigned int shared_type; include/acpi/processor.h: unsigned int shared_type; include/linux/cpufreq.h: unsigned int shared_type; /* ANY or ALL affected CPUs include/xen/interface/platform.h: uint32_t shared_type; /* coordination type of this processor */ tools/perf/util/dwarf-aux.c: tag == DW_TAG_shared_type);
Well, the fact that it isn't used at the moment doesn't mean that it shouldn't be set correctly. The field is present in the structure and has a set of defined values - one of which should be selected. For example, I can imagine some governor taking this information into account. Best regards, -- Tomasz Figa Samsung Poland R&D Center SW Solution Development, Linux Platform