All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: kernel test robot <lkp@intel.com>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	kbuild-all@lists.01.org, linux-pm@vger.kernel.org
Subject: Re: [linux-next:master 7640/10763] drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Mon, 5 Oct 2020 10:34:46 +0530	[thread overview]
Message-ID: <20201005050446.l34khuavbb24ndhx@vireshk-i7> (raw)
In-Reply-To: <202009251730.7KAszdTF%lkp@intel.com>

On 25-09-20, 17:15, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   d1d2220c7f39d0fca302c4ba6cca4ede01660a2b
> commit: b89c01c960511dcffe3666d89645c95445d00902 [7640/10763] cpufreq: tegra186: Fix initial frequency
> config: arm64-randconfig-s031-20200923 (attached as .config)
> compiler: aarch64-linux-gcc (GCC) 9.3.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.2-201-g24bdaac6-dirty
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b89c01c960511dcffe3666d89645c95445d00902
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout b89c01c960511dcffe3666d89645c95445d00902
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
>    drivers/cpufreq/tegra186-cpufreq.c:72:37: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *driver_data @@     got void [noderef] __iomem * @@
>    drivers/cpufreq/tegra186-cpufreq.c:72:37: sparse:     expected void *driver_data
>    drivers/cpufreq/tegra186-cpufreq.c:72:37: sparse:     got void [noderef] __iomem *
>    drivers/cpufreq/tegra186-cpufreq.c:87:40: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *edvd_reg @@     got void *driver_data @@
>    drivers/cpufreq/tegra186-cpufreq.c:87:40: sparse:     expected void [noderef] __iomem *edvd_reg
>    drivers/cpufreq/tegra186-cpufreq.c:87:40: sparse:     got void *driver_data
> >> drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *edvd_reg @@     got void *driver_data @@
>    drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse:     expected void [noderef] __iomem *edvd_reg
>    drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse:     got void *driver_data
> 
> vim +108 drivers/cpufreq/tegra186-cpufreq.c
> 
>     53	
>     54	static int tegra186_cpufreq_init(struct cpufreq_policy *policy)
>     55	{
>     56		struct tegra186_cpufreq_data *data = cpufreq_get_driver_data();
>     57		unsigned int i;
>     58	
>     59		for (i = 0; i < data->num_clusters; i++) {
>     60			struct tegra186_cpufreq_cluster *cluster = &data->clusters[i];
>     61			const struct tegra186_cpufreq_cluster_info *info =
>     62				cluster->info;
>     63			int core;
>     64	
>     65			for (core = 0; core < ARRAY_SIZE(info->cpus); core++) {
>     66				if (info->cpus[core] == policy->cpu)
>     67					break;
>     68			}
>     69			if (core == ARRAY_SIZE(info->cpus))
>     70				continue;
>     71	
>   > 72			policy->driver_data =
>     73				data->regs + info->offset + EDVD_CORE_VOLT_FREQ(core);
>     74			policy->freq_table = cluster->table;
>     75			break;
>     76		}
>     77	
>     78		policy->cpuinfo.transition_latency = 300 * 1000;
>     79	
>     80		return 0;
>     81	}
>     82	
>     83	static int tegra186_cpufreq_set_target(struct cpufreq_policy *policy,
>     84					       unsigned int index)
>     85	{
>     86		struct cpufreq_frequency_table *tbl = policy->freq_table + index;
>     87		void __iomem *edvd_reg = policy->driver_data;
>     88		u32 edvd_val = tbl->driver_data;
>     89	
>     90		writel(edvd_val, edvd_reg);
>     91	
>     92		return 0;
>     93	}
>     94	
>     95	static unsigned int tegra186_cpufreq_get(unsigned int cpu)
>     96	{
>     97		struct cpufreq_frequency_table *tbl;
>     98		struct cpufreq_policy *policy;
>     99		void __iomem *edvd_reg;
>    100		unsigned int i, freq = 0;
>    101		u32 ndiv;
>    102	
>    103		policy = cpufreq_cpu_get(cpu);
>    104		if (!policy)
>    105			return 0;
>    106	
>    107		tbl = policy->freq_table;
>  > 108		edvd_reg = policy->driver_data;
>    109		ndiv = readl(edvd_reg) & EDVD_CORE_VOLT_FREQ_F_MASK;
>    110	
>    111		for (i = 0; tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
>    112			if ((tbl[i].driver_data & EDVD_CORE_VOLT_FREQ_F_MASK) == ndiv) {
>    113				freq = tbl[i].frequency;
>    114				break;
>    115			}
>    116		}
>    117	
>    118		cpufreq_cpu_put(policy);
>    119	
>    120		return freq;
>    121	}
>    122	

Jon,

Please send a fix for this.

-- 
viresh

WARNING: multiple messages have this Message-ID (diff)
From: Viresh Kumar <viresh.kumar@linaro.org>
To: kbuild-all@lists.01.org
Subject: Re: [linux-next:master 7640/10763] drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Mon, 05 Oct 2020 10:34:46 +0530	[thread overview]
Message-ID: <20201005050446.l34khuavbb24ndhx@vireshk-i7> (raw)
In-Reply-To: <202009251730.7KAszdTF%lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 4909 bytes --]

On 25-09-20, 17:15, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   d1d2220c7f39d0fca302c4ba6cca4ede01660a2b
> commit: b89c01c960511dcffe3666d89645c95445d00902 [7640/10763] cpufreq: tegra186: Fix initial frequency
> config: arm64-randconfig-s031-20200923 (attached as .config)
> compiler: aarch64-linux-gcc (GCC) 9.3.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.2-201-g24bdaac6-dirty
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b89c01c960511dcffe3666d89645c95445d00902
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout b89c01c960511dcffe3666d89645c95445d00902
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> 
> sparse warnings: (new ones prefixed by >>)
> 
>    drivers/cpufreq/tegra186-cpufreq.c:72:37: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *driver_data @@     got void [noderef] __iomem * @@
>    drivers/cpufreq/tegra186-cpufreq.c:72:37: sparse:     expected void *driver_data
>    drivers/cpufreq/tegra186-cpufreq.c:72:37: sparse:     got void [noderef] __iomem *
>    drivers/cpufreq/tegra186-cpufreq.c:87:40: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *edvd_reg @@     got void *driver_data @@
>    drivers/cpufreq/tegra186-cpufreq.c:87:40: sparse:     expected void [noderef] __iomem *edvd_reg
>    drivers/cpufreq/tegra186-cpufreq.c:87:40: sparse:     got void *driver_data
> >> drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *edvd_reg @@     got void *driver_data @@
>    drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse:     expected void [noderef] __iomem *edvd_reg
>    drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse:     got void *driver_data
> 
> vim +108 drivers/cpufreq/tegra186-cpufreq.c
> 
>     53	
>     54	static int tegra186_cpufreq_init(struct cpufreq_policy *policy)
>     55	{
>     56		struct tegra186_cpufreq_data *data = cpufreq_get_driver_data();
>     57		unsigned int i;
>     58	
>     59		for (i = 0; i < data->num_clusters; i++) {
>     60			struct tegra186_cpufreq_cluster *cluster = &data->clusters[i];
>     61			const struct tegra186_cpufreq_cluster_info *info =
>     62				cluster->info;
>     63			int core;
>     64	
>     65			for (core = 0; core < ARRAY_SIZE(info->cpus); core++) {
>     66				if (info->cpus[core] == policy->cpu)
>     67					break;
>     68			}
>     69			if (core == ARRAY_SIZE(info->cpus))
>     70				continue;
>     71	
>   > 72			policy->driver_data =
>     73				data->regs + info->offset + EDVD_CORE_VOLT_FREQ(core);
>     74			policy->freq_table = cluster->table;
>     75			break;
>     76		}
>     77	
>     78		policy->cpuinfo.transition_latency = 300 * 1000;
>     79	
>     80		return 0;
>     81	}
>     82	
>     83	static int tegra186_cpufreq_set_target(struct cpufreq_policy *policy,
>     84					       unsigned int index)
>     85	{
>     86		struct cpufreq_frequency_table *tbl = policy->freq_table + index;
>     87		void __iomem *edvd_reg = policy->driver_data;
>     88		u32 edvd_val = tbl->driver_data;
>     89	
>     90		writel(edvd_val, edvd_reg);
>     91	
>     92		return 0;
>     93	}
>     94	
>     95	static unsigned int tegra186_cpufreq_get(unsigned int cpu)
>     96	{
>     97		struct cpufreq_frequency_table *tbl;
>     98		struct cpufreq_policy *policy;
>     99		void __iomem *edvd_reg;
>    100		unsigned int i, freq = 0;
>    101		u32 ndiv;
>    102	
>    103		policy = cpufreq_cpu_get(cpu);
>    104		if (!policy)
>    105			return 0;
>    106	
>    107		tbl = policy->freq_table;
>  > 108		edvd_reg = policy->driver_data;
>    109		ndiv = readl(edvd_reg) & EDVD_CORE_VOLT_FREQ_F_MASK;
>    110	
>    111		for (i = 0; tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
>    112			if ((tbl[i].driver_data & EDVD_CORE_VOLT_FREQ_F_MASK) == ndiv) {
>    113				freq = tbl[i].frequency;
>    114				break;
>    115			}
>    116		}
>    117	
>    118		cpufreq_cpu_put(policy);
>    119	
>    120		return freq;
>    121	}
>    122	

Jon,

Please send a fix for this.

-- 
viresh

  reply	other threads:[~2020-10-05  5:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  9:15 [linux-next:master 7640/10763] drivers/cpufreq/tegra186-cpufreq.c:108:18: sparse: sparse: incorrect type in assignment (different address spaces) kernel test robot
2020-10-05  5:04 ` Viresh Kumar [this message]
2020-10-05  5:04   ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201005050446.l34khuavbb24ndhx@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=jonathanh@nvidia.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.