From 493cd190339201c264cdc4cbc1c96c70c786a776 Mon Sep 17 00:00:00 2001
From: Oleksandr Natalenko <oleksandr@natalenko.name>
Date: Wed, 13 Aug 2014 08:54:09 +0300
Subject: [PATCH] add cpufreq debug
---
arch/arm/kernel/smp.c | 2 ++
arch/arm/kernel/smp_twd.c | 2 ++
arch/arm/mach-pxa/viper.c | 2 ++
arch/arm/mach-s3c24xx/mach-osiris-dvs.c | 2 ++
arch/blackfin/mach-common/dpmc.c | 2 ++
arch/cris/arch-v32/kernel/time.c | 3 +++
arch/powerpc/oprofile/op_model_cell.c | 3 +++
arch/sparc/kernel/time_64.c | 2 ++
arch/x86/kernel/tsc.c | 2 ++
arch/x86/kvm/x86.c | 2 ++
drivers/acpi/processor_perflib.c | 2 ++
drivers/acpi/processor_thermal.c | 2 ++
drivers/cpufreq/cpufreq.c | 1 +
drivers/cpufreq/cpufreq_stats.c | 2 ++
drivers/cpufreq/cris-artpec3-cpufreq.c | 3 +++
drivers/cpufreq/cris-etraxfs-cpufreq.c | 3 +++
drivers/cpufreq/loongson2_cpufreq.c | 2 ++
drivers/cpufreq/ppc_cbe_cpufreq_pmi.c | 2 ++
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 +++
drivers/i2c/busses/i2c-davinci.c | 2 ++
drivers/i2c/busses/i2c-s3c2410.c | 2 ++
drivers/macintosh/windfarm_cpufreq_clamp.c | 2 ++
drivers/mmc/host/davinci_mmc.c | 2 ++
drivers/mmc/host/s3cmci.c | 2 ++
drivers/mtd/nand/s3c2410.c | 2 ++
drivers/pcmcia/soc_common.c | 2 ++
drivers/staging/tidspbridge/rmgr/drv_interface.c | 2 ++
drivers/thermal/cpu_cooling.c | 2 ++
drivers/tty/serial/samsung.c | 2 ++
drivers/tty/serial/sh-sci.c | 2 ++
drivers/video/fbdev/da8xx-fb.c | 2 ++
drivers/video/fbdev/nuc900fb.c | 1 +
drivers/video/fbdev/pxafb.c | 2 ++
drivers/video/fbdev/s3c2410fb.c | 2 ++
drivers/video/fbdev/sa1100fb.c | 2 ++
drivers/watchdog/s3c2410_wdt.c | 2 ++
36 files changed, 75 insertions(+)
@@ -660,6 +660,8 @@ static int cpufreq_callback(struct notifier_block *nb,
struct cpufreq_freqs *freq = data;
int cpu = freq->cpu;
+ pr_info("%s\n", __func__);
+
if (freq->flags & CPUFREQ_CONST_LOOPS)
return NOTIFY_OK;
@@ -161,6 +161,8 @@ static int twd_cpufreq_transition(struct notifier_block *nb,
{
struct cpufreq_freqs *freqs = data;
+ pr_info("%s\n", __func__);
+
/*
* The twd clock events must be reprogrammed to account for the new
* frequency. The timer is local to a cpu, so cross-call to the
@@ -868,6 +868,8 @@ static int viper_cpufreq_notifier(struct notifier_block *nb,
{
struct cpufreq_freqs *freq = data;
+ pr_info("%s\n", __func__);
+
/* TODO: Adjust timings??? */
switch (val) {
@@ -61,6 +61,8 @@ static int osiris_dvs_notify(struct notifier_block *nb,
bool new_dvs = is_dvs(&freqs->new);
int ret = 0;
+ pr_info("%s\n", __func__);
+
if (!dvs_en)
return 0;
@@ -103,6 +103,8 @@ vreg_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data)
{
struct cpufreq_freqs *freq = data;
+ pr_info("%s\n", __func__);
+
if (freq->cpu != CPUFREQ_CPU)
return 0;
@@ -303,6 +303,9 @@ cris_time_freq_notifier(struct notifier_block *nb, unsigned long val,
void *data)
{
struct cpufreq_freqs *freqs = data;
+
+ pr_info("%s\n", __func__);
+
if (val == CPUFREQ_POSTCHANGE) {
reg_timer_r_tmr0_data data;
reg_timer_rw_tmr0_div div = (freqs->new * 500) / HZ;
@@ -1120,6 +1120,9 @@ oprof_cpufreq_notify(struct notifier_block *nb, unsigned long val, void *data)
{
int ret = 0;
struct cpufreq_freqs *frq = data;
+
+ pr_info("%s\n", __func__);
+
if ((val == CPUFREQ_PRECHANGE && frq->old < frq->new) ||
(val == CPUFREQ_POSTCHANGE && frq->old > frq->new))
set_spu_profiling_frequency(frq->new, spu_cycle_reset);
@@ -654,6 +654,8 @@ static int sparc64_cpufreq_notifier(struct notifier_block *nb, unsigned long val
unsigned int cpu = freq->cpu;
struct freq_table *ft = &per_cpu(sparc64_freq_table, cpu);
+ pr_info("%s\n", __func__);
+
if (!ft->ref_freq) {
ft->ref_freq = freq->old;
ft->clock_tick_ref = cpu_data(cpu).clock_tick;
@@ -899,6 +899,8 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
struct cpufreq_freqs *freq = data;
unsigned long *lpj;
+ pr_info("%s\n", __func__);
+
if (cpu_has(&cpu_data(freq->cpu), X86_FEATURE_CONSTANT_TSC))
return 0;
@@ -5402,6 +5402,8 @@ static int kvmclock_cpu_notifier(struct notifier_block *nfb,
{
unsigned int cpu = (unsigned long)hcpu;
+ pr_info("%s\n", __func__);
+
switch (action) {
case CPU_ONLINE:
case CPU_DOWN_FAILED:
@@ -79,6 +79,8 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
struct acpi_processor *pr;
unsigned int ppc = 0;
+ pr_info("CPUFREQ_NOTIFIER: %s\n", __func__);
+
if (event == CPUFREQ_START && ignore_ppc <= 0) {
ignore_ppc = 0;
return 0;
@@ -89,6 +89,8 @@ static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb,
struct cpufreq_policy *policy = data;
unsigned long max_freq = 0;
+ pr_info("CPUFREQ_NOTIFIER: %s\n", __func__);
+
if (event != CPUFREQ_ADJUST)
goto out;
@@ -1764,6 +1764,7 @@ int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list)
switch (list) {
case CPUFREQ_TRANSITION_NOTIFIER:
+ pr_info("Registered transition notifier: %p, (%p)\n", nb->notifier_call, &nb->notifier_call);
ret = srcu_notifier_chain_register(
&cpufreq_transition_notifier_list, nb);
break;
@@ -298,6 +298,8 @@ static int cpufreq_stat_notifier_trans(struct notifier_block *nb,
struct cpufreq_stats *stat;
int old_index, new_index;
+ pr_info("CPUFREQ_NOTIFIER: %s\n", __func__);
+
if (val != CPUFREQ_POSTCHANGE)
return 0;
@@ -76,6 +76,9 @@ cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
{
int i;
struct cpufreq_freqs *freqs = data;
+
+ pr_info("%s\n", __func__);
+
if (val == CPUFREQ_PRECHANGE) {
reg_ddr2_rw_cfg cfg =
REG_RD(ddr2, regi_ddr2_ctrl, rw_cfg);
@@ -76,6 +76,9 @@ cris_sdram_freq_notifier(struct notifier_block *nb, unsigned long val,
{
int i;
struct cpufreq_freqs *freqs = data;
+
+ pr_info("%s\n", __func__);
+
if (val == CPUFREQ_PRECHANGE) {
reg_bif_core_rw_sdram_timing timing =
REG_RD(bif_core, regi_bif_core, rw_sdram_timing);
@@ -36,6 +36,8 @@ static struct notifier_block loongson2_cpufreq_notifier_block = {
static int loongson2_cpu_freq_notifier(struct notifier_block *nb,
unsigned long val, void *data)
{
+ pr_info("%s\n", __func__);
+
if (val == CPUFREQ_POSTCHANGE)
current_cpu_data.udelay_val = loops_per_jiffy;
@@ -97,6 +97,8 @@ static int pmi_notifier(struct notifier_block *nb,
struct cpufreq_frequency_table *cbe_freqs;
u8 node;
+ pr_info("%s\n", __func__);
+
/* Should this really be called for CPUFREQ_ADJUST, CPUFREQ_INCOMPATIBLE
* and CPUFREQ_NOTIFY policy events?)
*/
@@ -102,6 +102,9 @@ static int cpufreq_transition(struct notifier_block *nb,
{
struct tilcdc_drm_private *priv = container_of(nb,
struct tilcdc_drm_private, freq_transition);
+
+ pr_info("%s\n", __func__);
+
if (val == CPUFREQ_POSTCHANGE) {
if (priv->lcd_fck_rate != clk_get_rate(priv->clk)) {
priv->lcd_fck_rate = clk_get_rate(priv->clk);
@@ -589,6 +589,8 @@ static int i2c_davinci_cpufreq_transition(struct notifier_block *nb,
{
struct davinci_i2c_dev *dev;
+ pr_info("%s\n", __func__);
+
dev = container_of(nb, struct davinci_i2c_dev, freq_transition);
if (val == CPUFREQ_PRECHANGE) {
wait_for_completion(&dev->xfr_complete);
@@ -928,6 +928,8 @@ static int s3c24xx_i2c_cpufreq_transition(struct notifier_block *nb,
int delta_f;
int ret;
+ pr_info("%s\n", __func__);
+
delta_f = clk_get_rate(i2c->clk) - i2c->clkrate;
/* if we're post-change and the input clock has slowed down
@@ -22,6 +22,8 @@ static int clamp_notifier_call(struct notifier_block *self,
struct cpufreq_policy *p = data;
unsigned long max_freq;
+ pr_info("%s\n", __func__);
+
if (event != CPUFREQ_ADJUST)
return 0;
@@ -1110,6 +1110,8 @@ static int mmc_davinci_cpufreq_transition(struct notifier_block *nb,
struct mmc_host *mmc;
unsigned long flags;
+ pr_info("%s\n", __func__);
+
host = container_of(nb, struct mmc_davinci_host, freq_transition);
mmc = host->mmc;
mmc_pclk = clk_get_rate(host->clk);
@@ -1451,6 +1451,8 @@ static int s3cmci_cpufreq_transition(struct notifier_block *nb,
unsigned long newclk;
unsigned long flags;
+ pr_info("%s\n", __func__);
+
host = container_of(nb, struct s3cmci_host, freq_transition);
newclk = clk_get_rate(host->clk);
mmc = host->mmc;
@@ -686,6 +686,8 @@ static int s3c2410_nand_cpufreq_transition(struct notifier_block *nb,
struct s3c2410_nand_info *info;
unsigned long newclk;
+ pr_info("%s\n", __func__);
+
info = container_of(nb, struct s3c2410_nand_info, freq_transition);
newclk = clk_get_rate(info->clk);
@@ -644,6 +644,8 @@ soc_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data)
struct cpufreq_freqs *freqs = data;
int ret = 0;
+ pr_info("%s\n", __func__);
+
mutex_lock(&soc_pcmcia_sockets_lock);
list_for_each_entry(skt, &soc_pcmcia_sockets, node)
if (skt->ops->frequency_change)
@@ -380,6 +380,8 @@ static int dspbridge_scale_notification(struct notifier_block *op,
struct omap_dsp_platform_data *pdata =
omap_dspbridge_dev->dev.platform_data;
+ pr_info("%s\n", __func__);
+
if (CPUFREQ_POSTCHANGE == val && pdata->dsp_get_opp)
pwr_pm_post_scale(PRCM_VDD1, pdata->dsp_get_opp());
@@ -317,6 +317,8 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb,
struct cpufreq_policy *policy = data;
unsigned long max_freq = 0;
+ pr_info("%s\n", __func__);
+
if (event != CPUFREQ_ADJUST || notify_device == NOTIFY_INVALID)
return 0;
@@ -1066,6 +1066,8 @@ static int s3c24xx_serial_cpufreq_transition(struct notifier_block *nb,
struct s3c24xx_uart_port *port;
struct uart_port *uport;
+ pr_info("%s\n", __func__);
+
port = container_of(nb, struct s3c24xx_uart_port, freq_transition);
uport = &port->port;
@@ -1039,6 +1039,8 @@ static int sci_notifier(struct notifier_block *self,
struct sci_port *sci_port;
unsigned long flags;
+ pr_info("%s\n", __func__);
+
sci_port = container_of(self, struct sci_port, freq_transition);
if (phase == CPUFREQ_POSTCHANGE) {
@@ -1048,6 +1048,8 @@ static int lcd_da8xx_cpufreq_transition(struct notifier_block *nb,
{
struct da8xx_fb_par *par;
+ pr_info("%s\n", __func__);
+
par = container_of(nb, struct da8xx_fb_par, freq_transition);
if (val == CPUFREQ_POSTCHANGE) {
if (par->lcdc_clk_rate != clk_get_rate(par->lcdc_clk)) {
@@ -484,6 +484,7 @@ static inline void nuc900fb_cpufreq_deregister(struct nuc900fb_info *fbi)
static inline int nuc900fb_cpufreq_transition(struct notifier_block *nb,
unsigned long val, void *data)
{
+ pr_info("%s\n", __func__);
return 0;
}
@@ -1640,6 +1640,8 @@ pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data)
/* TODO struct cpufreq_freqs *f = data; */
u_int pcd;
+ pr_info("%s\n", __func__);
+
switch (val) {
case CPUFREQ_PRECHANGE:
#ifdef CONFIG_FB_PXA_OVERLAY
@@ -776,6 +776,8 @@ static int s3c2410fb_cpufreq_transition(struct notifier_block *nb,
struct fb_info *fbinfo;
long delta_f;
+ pr_info("%s\n", __func__);
+
info = container_of(nb, struct s3c2410fb_info, freq_transition);
fbinfo = platform_get_drvdata(to_platform_device(info->dev));
@@ -1006,6 +1006,8 @@ sa1100fb_freq_transition(struct notifier_block *nb, unsigned long val,
struct cpufreq_freqs *f = data;
u_int pcd;
+ pr_info("%s\n", __func__);
+
switch (val) {
case CPUFREQ_PRECHANGE:
set_ctrlr_state(fbi, C_DISABLE_CLKCHANGE);
@@ -379,6 +379,8 @@ static int s3c2410wdt_cpufreq_transition(struct notifier_block *nb,
int ret;
struct s3c2410_wdt *wdt = freq_to_wdt(nb);
+ pr_info("%s\n", __func__);
+
if (!s3c2410wdt_is_running(wdt))
goto done;
--
1.9.1