[android-common:android12-5.10 3217/3240] kernel/smp.c:957:7: error: 's2idle_state' undeclared; did you mean
by kernel test robot
tree: https://android.googlesource.com/kernel/common android12-5.10
head: 43edfc892e926ffa364f591dea27729ff4a60f3d
commit: 5ada76d0563798c02c4217d61d85cfacc1279a7a [3217/3240] ANDROID: sched/pause: prevent wake up paused cpus
config: i386-randconfig-r032-20210114 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android12-5.10
git checkout 5ada76d0563798c02c4217d61d85cfacc1279a7a
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
kernel/smp.c:444:6: warning: no previous prototype for 'flush_smp_call_function_from_idle' [-Wmissing-prototypes]
444 | void flush_smp_call_function_from_idle(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/smp.c: In function 'wake_up_all_idle_cpus':
>> kernel/smp.c:957:7: error: 's2idle_state' undeclared (first use in this function); did you mean 's2idle_wake'?
957 | if (s2idle_state == S2IDLE_STATE_ENTER || cpu_active(cpu))
| ^~~~~~~~~~~~
| s2idle_wake
kernel/smp.c:957:7: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/smp.c:957:23: error: 'S2IDLE_STATE_ENTER' undeclared (first use in this function)
957 | if (s2idle_state == S2IDLE_STATE_ENTER || cpu_active(cpu))
| ^~~~~~~~~~~~~~~~~~
vim +957 kernel/smp.c
941
942 /**
943 * wake_up_all_idle_cpus - break all cpus out of idle
944 * wake_up_all_idle_cpus try to break all cpus which is in idle state even
945 * including idle polling cpus, for non-idle cpus, we will do nothing
946 * for them.
947 */
948 void wake_up_all_idle_cpus(void)
949 {
950 int cpu;
951
952 preempt_disable();
953 for_each_online_cpu(cpu) {
954 if (cpu == smp_processor_id())
955 continue;
956
> 957 if (s2idle_state == S2IDLE_STATE_ENTER || cpu_active(cpu))
958 wake_up_if_idle(cpu);
959 }
960 preempt_enable();
961 }
962 EXPORT_SYMBOL_GPL(wake_up_all_idle_cpus);
963
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
[freescale-fslc:5.4-2.3.x-imx 15426/16543] sound/soc/fsl/imx-pcm512x.c:357:23: warning: initialized field overwritten
by kernel test robot
tree: https://github.com/Freescale/linux-fslc 5.4-2.3.x-imx
head: a8a2b9ee4bec0b29d031324160b7f11af42a563a
commit: 8efc3af011c524745935866310f8ec44a37bf384 [15426/16543] MLK-24930-1: sound: soc: fsl: imx pcm512x: iqaudio dac
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/Freescale/linux-fslc/commit/8efc3af011c524745935866310...
git remote add freescale-fslc https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc 5.4-2.3.x-imx
git checkout 8efc3af011c524745935866310f8ec44a37bf384
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
sound/soc/fsl/imx-pcm512x.c: In function 'imx_pcm512x_hw_params':
sound/soc/fsl/imx-pcm512x.c:250:5: error: 'PCM512x_SYSCLK_MCLK1' undeclared (first use in this function); did you mean 'PCM512x_SDAC_MCK'?
250 | PCM512x_SYSCLK_MCLK1, mclk_freq, SND_SOC_CLOCK_IN);
| ^~~~~~~~~~~~~~~~~~~~
| PCM512x_SDAC_MCK
sound/soc/fsl/imx-pcm512x.c:250:5: note: each undeclared identifier is reported only once for each function it appears in
sound/soc/fsl/imx-pcm512x.c:255:5: error: 'PCM512x_SYSCLK_MCLK2' undeclared (first use in this function); did you mean 'PCM512x_SDAC_MCK'?
255 | PCM512x_SYSCLK_MCLK2, mclk_freq, SND_SOC_CLOCK_IN);
| ^~~~~~~~~~~~~~~~~~~~
| PCM512x_SDAC_MCK
In file included from sound/soc/fsl/imx-pcm512x.c:21:
sound/soc/fsl/imx-pcm512x.c: At top level:
>> sound/soc/fsl/imx-pcm512x.c:357:23: warning: initialized field overwritten [-Woverride-init]
357 | SND_SOC_DAILINK_REG(hifi),
| ^~~~
include/sound/soc.h:919:13: note: in definition of macro 'SND_SOC_DAILINK_REG3'
919 | .codecs = codec, \
| ^~~~~
include/sound/soc.h:924:53: note: in expansion of macro 'SND_SOC_DAILINK_REG1'
924 | #define SND_SOC_DAILINK_REGx(_1, _2, _3, func, ...) func
| ^~~~
sound/soc/fsl/imx-pcm512x.c:357:3: note: in expansion of macro 'SND_SOC_DAILINK_REG'
357 | SND_SOC_DAILINK_REG(hifi),
| ^~~~~~~~~~~~~~~~~~~
sound/soc/fsl/imx-pcm512x.c:357:23: note: (near initialization for 'imx_pcm512x_dai[0].codecs')
357 | SND_SOC_DAILINK_REG(hifi),
| ^~~~
include/sound/soc.h:919:13: note: in definition of macro 'SND_SOC_DAILINK_REG3'
919 | .codecs = codec, \
| ^~~~~
include/sound/soc.h:924:53: note: in expansion of macro 'SND_SOC_DAILINK_REG1'
924 | #define SND_SOC_DAILINK_REGx(_1, _2, _3, func, ...) func
| ^~~~
sound/soc/fsl/imx-pcm512x.c:357:3: note: in expansion of macro 'SND_SOC_DAILINK_REG'
357 | SND_SOC_DAILINK_REG(hifi),
| ^~~~~~~~~~~~~~~~~~~
In file included from include/linux/list.h:9,
from include/linux/module.h:9,
from sound/soc/fsl/imx-pcm512x.c:13:
>> include/linux/kernel.h:47:25: warning: initialized field overwritten [-Woverride-init]
47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^
include/sound/soc.h:920:16: note: in expansion of macro 'ARRAY_SIZE'
920 | .num_codecs = ARRAY_SIZE(codec), \
| ^~~~~~~~~~
include/sound/soc.h:914:37: note: in expansion of macro 'SND_SOC_DAILINK_REG3'
914 | #define SND_SOC_DAILINK_REG1(name) SND_SOC_DAILINK_REG3(name##_cpus, name##_codecs, name##_platforms)
| ^~~~~~~~~~~~~~~~~~~~
include/sound/soc.h:924:53: note: in expansion of macro 'SND_SOC_DAILINK_REG1'
924 | #define SND_SOC_DAILINK_REGx(_1, _2, _3, func, ...) func
| ^~~~
include/sound/soc.h:926:2: note: in expansion of macro 'SND_SOC_DAILINK_REGx'
926 | SND_SOC_DAILINK_REGx(__VA_ARGS__, \
| ^~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/imx-pcm512x.c:357:3: note: in expansion of macro 'SND_SOC_DAILINK_REG'
357 | SND_SOC_DAILINK_REG(hifi),
| ^~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:47:25: note: (near initialization for 'imx_pcm512x_dai[0].num_codecs')
47 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^
include/sound/soc.h:920:16: note: in expansion of macro 'ARRAY_SIZE'
920 | .num_codecs = ARRAY_SIZE(codec), \
| ^~~~~~~~~~
include/sound/soc.h:914:37: note: in expansion of macro 'SND_SOC_DAILINK_REG3'
914 | #define SND_SOC_DAILINK_REG1(name) SND_SOC_DAILINK_REG3(name##_cpus, name##_codecs, name##_platforms)
| ^~~~~~~~~~~~~~~~~~~~
include/sound/soc.h:924:53: note: in expansion of macro 'SND_SOC_DAILINK_REG1'
924 | #define SND_SOC_DAILINK_REGx(_1, _2, _3, func, ...) func
| ^~~~
include/sound/soc.h:926:2: note: in expansion of macro 'SND_SOC_DAILINK_REGx'
926 | SND_SOC_DAILINK_REGx(__VA_ARGS__, \
| ^~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/imx-pcm512x.c:357:3: note: in expansion of macro 'SND_SOC_DAILINK_REG'
357 | SND_SOC_DAILINK_REG(hifi),
| ^~~~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for GPIO_MXC
Depends on GPIOLIB && HAS_IOMEM && ARCH_MXC
Selected by
- GPIO_MXC_PAD_WAKEUP && GPIOLIB && HAS_IOMEM && IMX_SCU
vim +357 sound/soc/fsl/imx-pcm512x.c
347
348 static struct snd_soc_dai_link imx_pcm512x_dai[] = {
349 {
350 .name = "pcm512x-audio",
351 .stream_name = "audio",
352 .codecs = pcm512x_codecs,
353 .num_codecs = 1,
354 .ops = &imx_pcm512x_ops,
355 .init = imx_pcm512x_dai_init,
356 .ignore_pmdown_time = 1,
> 357 SND_SOC_DAILINK_REG(hifi),
358 },
359 };
360
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
Re: [PATCH V1 resend] dcookies: Make dcookies depend on CONFIG_OPROFILE
by kernel test robot
Hi Viresh,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.11-rc3 next-20210114]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Viresh-Kumar/dcookies-Make-dcook...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7c53f6b671f4aba70ff15e1b05148b10d58c2837
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/d48f031313d175610c430e9f04c3b6974...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Viresh-Kumar/dcookies-Make-dcookies-depend-on-CONFIG_OPROFILE/20210111-140734
git checkout d48f031313d175610c430e9f04c3b6974e3fd3e2
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> fs/dcookies.c:117:5: error: redefinition of 'get_dcookie'
117 | int get_dcookie(const struct path *path, unsigned long *cookie)
| ^~~~~~~~~~~
In file included from fs/dcookies.c:26:
include/linux/dcookies.h:62:19: note: previous definition of 'get_dcookie' was here
62 | static inline int get_dcookie(const struct path *path, unsigned long *cookie)
| ^~~~~~~~~~~
>> fs/dcookies.c:316:23: error: redefinition of 'dcookie_register'
316 | struct dcookie_user * dcookie_register(void)
| ^~~~~~~~~~~~~~~~
In file included from fs/dcookies.c:26:
include/linux/dcookies.h:52:37: note: previous definition of 'dcookie_register' was here
52 | static inline struct dcookie_user * dcookie_register(void)
| ^~~~~~~~~~~~~~~~
>> fs/dcookies.c:341:6: error: redefinition of 'dcookie_unregister'
341 | void dcookie_unregister(struct dcookie_user * user)
| ^~~~~~~~~~~~~~~~~~
In file included from fs/dcookies.c:26:
include/linux/dcookies.h:57:20: note: previous definition of 'dcookie_unregister' was here
57 | static inline void dcookie_unregister(struct dcookie_user * user)
| ^~~~~~~~~~~~~~~~~~
vim +/get_dcookie +117 fs/dcookies.c
^1da177e4c3f4152 Linus Torvalds 2005-04-16 112
^1da177e4c3f4152 Linus Torvalds 2005-04-16 113
^1da177e4c3f4152 Linus Torvalds 2005-04-16 114 /* This is the main kernel-side routine that retrieves the cookie
^1da177e4c3f4152 Linus Torvalds 2005-04-16 115 * value for a dentry/vfsmnt pair.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 116 */
71215a75ceddf38b Al Viro 2016-11-20 @117 int get_dcookie(const struct path *path, unsigned long *cookie)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 118 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 119 int err = 0;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 120 struct dcookie_struct * dcs;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 121
353ab6e97b8f209d Ingo Molnar 2006-03-26 122 mutex_lock(&dcookie_mutex);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 123
^1da177e4c3f4152 Linus Torvalds 2005-04-16 124 if (!is_live()) {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 125 err = -EINVAL;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 126 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 127 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 128
c2452f32786159ed Nick Piggin 2008-12-01 129 if (path->dentry->d_flags & DCACHE_COOKIE) {
c2452f32786159ed Nick Piggin 2008-12-01 130 dcs = find_dcookie((unsigned long)path->dentry);
c2452f32786159ed Nick Piggin 2008-12-01 131 } else {
448678a0f3cdd015 Jan Blunck 2008-02-14 132 dcs = alloc_dcookie(path);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 133 if (!dcs) {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 134 err = -ENOMEM;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 135 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 136 }
c2452f32786159ed Nick Piggin 2008-12-01 137 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 138
^1da177e4c3f4152 Linus Torvalds 2005-04-16 139 *cookie = dcookie_value(dcs);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 140
^1da177e4c3f4152 Linus Torvalds 2005-04-16 141 out:
353ab6e97b8f209d Ingo Molnar 2006-03-26 142 mutex_unlock(&dcookie_mutex);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 143 return err;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 144 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 145
^1da177e4c3f4152 Linus Torvalds 2005-04-16 146
^1da177e4c3f4152 Linus Torvalds 2005-04-16 147 /* And here is where the userspace process can look up the cookie value
^1da177e4c3f4152 Linus Torvalds 2005-04-16 148 * to retrieve the path.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 149 */
98e5f7bd2c67f402 Dominik Brodowski 2018-03-17 150 static int do_lookup_dcookie(u64 cookie64, char __user *buf, size_t len)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 151 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 152 unsigned long cookie = (unsigned long)cookie64;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 153 int err = -EINVAL;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 154 char * kbuf;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 155 char * path;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 156 size_t pathlen;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 157 struct dcookie_struct * dcs;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 158
^1da177e4c3f4152 Linus Torvalds 2005-04-16 159 /* we could leak path information to users
^1da177e4c3f4152 Linus Torvalds 2005-04-16 160 * without dir read permission without this
^1da177e4c3f4152 Linus Torvalds 2005-04-16 161 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 162 if (!capable(CAP_SYS_ADMIN))
^1da177e4c3f4152 Linus Torvalds 2005-04-16 163 return -EPERM;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 164
353ab6e97b8f209d Ingo Molnar 2006-03-26 165 mutex_lock(&dcookie_mutex);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 166
^1da177e4c3f4152 Linus Torvalds 2005-04-16 167 if (!is_live()) {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 168 err = -EINVAL;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 169 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 170 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 171
^1da177e4c3f4152 Linus Torvalds 2005-04-16 172 if (!(dcs = find_dcookie(cookie)))
^1da177e4c3f4152 Linus Torvalds 2005-04-16 173 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 174
^1da177e4c3f4152 Linus Torvalds 2005-04-16 175 err = -ENOMEM;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 176 kbuf = kmalloc(PAGE_SIZE, GFP_KERNEL);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 177 if (!kbuf)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 178 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 179
^1da177e4c3f4152 Linus Torvalds 2005-04-16 180 /* FIXME: (deleted) ? */
cf28b4863f9ee8f1 Jan Blunck 2008-02-14 181 path = d_path(&dcs->path, kbuf, PAGE_SIZE);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 182
fe47ae7f53e179d2 Robert Richter 2011-05-31 183 mutex_unlock(&dcookie_mutex);
fe47ae7f53e179d2 Robert Richter 2011-05-31 184
^1da177e4c3f4152 Linus Torvalds 2005-04-16 185 if (IS_ERR(path)) {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 186 err = PTR_ERR(path);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 187 goto out_free;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 188 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 189
^1da177e4c3f4152 Linus Torvalds 2005-04-16 190 err = -ERANGE;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 191
^1da177e4c3f4152 Linus Torvalds 2005-04-16 192 pathlen = kbuf + PAGE_SIZE - path;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 193 if (pathlen <= len) {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 194 err = pathlen;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 195 if (copy_to_user(buf, path, pathlen))
^1da177e4c3f4152 Linus Torvalds 2005-04-16 196 err = -EFAULT;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 197 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 198
^1da177e4c3f4152 Linus Torvalds 2005-04-16 199 out_free:
^1da177e4c3f4152 Linus Torvalds 2005-04-16 200 kfree(kbuf);
fe47ae7f53e179d2 Robert Richter 2011-05-31 201 return err;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 202 out:
353ab6e97b8f209d Ingo Molnar 2006-03-26 203 mutex_unlock(&dcookie_mutex);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 204 return err;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 205 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 206
98e5f7bd2c67f402 Dominik Brodowski 2018-03-17 207 SYSCALL_DEFINE3(lookup_dcookie, u64, cookie64, char __user *, buf, size_t, len)
98e5f7bd2c67f402 Dominik Brodowski 2018-03-17 208 {
98e5f7bd2c67f402 Dominik Brodowski 2018-03-17 209 return do_lookup_dcookie(cookie64, buf, len);
98e5f7bd2c67f402 Dominik Brodowski 2018-03-17 210 }
98e5f7bd2c67f402 Dominik Brodowski 2018-03-17 211
d5dc77bfeeab0b03 Al Viro 2013-02-25 212 #ifdef CONFIG_COMPAT
d8d14bd09cddbaf0 Heiko Carstens 2014-01-29 213 COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, w0, u32, w1, char __user *, buf, compat_size_t, len)
d5dc77bfeeab0b03 Al Viro 2013-02-25 214 {
d5dc77bfeeab0b03 Al Viro 2013-02-25 215 #ifdef __BIG_ENDIAN
98e5f7bd2c67f402 Dominik Brodowski 2018-03-17 216 return do_lookup_dcookie(((u64)w0 << 32) | w1, buf, len);
d5dc77bfeeab0b03 Al Viro 2013-02-25 217 #else
98e5f7bd2c67f402 Dominik Brodowski 2018-03-17 218 return do_lookup_dcookie(((u64)w1 << 32) | w0, buf, len);
d5dc77bfeeab0b03 Al Viro 2013-02-25 219 #endif
d5dc77bfeeab0b03 Al Viro 2013-02-25 220 }
d5dc77bfeeab0b03 Al Viro 2013-02-25 221 #endif
d5dc77bfeeab0b03 Al Viro 2013-02-25 222
^1da177e4c3f4152 Linus Torvalds 2005-04-16 223 static int dcookie_init(void)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 224 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 225 struct list_head * d;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 226 unsigned int i, hash_bits;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 227 int err = -ENOMEM;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 228
^1da177e4c3f4152 Linus Torvalds 2005-04-16 229 dcookie_cache = kmem_cache_create("dcookie_cache",
^1da177e4c3f4152 Linus Torvalds 2005-04-16 230 sizeof(struct dcookie_struct),
20c2df83d25c6a95 Paul Mundt 2007-07-20 231 0, 0, NULL);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 232
^1da177e4c3f4152 Linus Torvalds 2005-04-16 233 if (!dcookie_cache)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 234 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 235
^1da177e4c3f4152 Linus Torvalds 2005-04-16 236 dcookie_hashtable = kmalloc(PAGE_SIZE, GFP_KERNEL);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 237 if (!dcookie_hashtable)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 238 goto out_kmem;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 239
^1da177e4c3f4152 Linus Torvalds 2005-04-16 240 err = 0;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 241
^1da177e4c3f4152 Linus Torvalds 2005-04-16 242 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 243 * Find the power-of-two list-heads that can fit into the allocation..
^1da177e4c3f4152 Linus Torvalds 2005-04-16 244 * We don't guarantee that "sizeof(struct list_head)" is necessarily
^1da177e4c3f4152 Linus Torvalds 2005-04-16 245 * a power-of-two.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 246 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 247 hash_size = PAGE_SIZE / sizeof(struct list_head);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 248 hash_bits = 0;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 249 do {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 250 hash_bits++;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 251 } while ((hash_size >> hash_bits) != 0);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 252 hash_bits--;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 253
^1da177e4c3f4152 Linus Torvalds 2005-04-16 254 /*
^1da177e4c3f4152 Linus Torvalds 2005-04-16 255 * Re-calculate the actual number of entries and the mask
^1da177e4c3f4152 Linus Torvalds 2005-04-16 256 * from the number of bits we can fit.
^1da177e4c3f4152 Linus Torvalds 2005-04-16 257 */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 258 hash_size = 1UL << hash_bits;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 259
^1da177e4c3f4152 Linus Torvalds 2005-04-16 260 /* And initialize the newly allocated array */
^1da177e4c3f4152 Linus Torvalds 2005-04-16 261 d = dcookie_hashtable;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 262 i = hash_size;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 263 do {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 264 INIT_LIST_HEAD(d);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 265 d++;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 266 i--;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 267 } while (i);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 268
^1da177e4c3f4152 Linus Torvalds 2005-04-16 269 out:
^1da177e4c3f4152 Linus Torvalds 2005-04-16 270 return err;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 271 out_kmem:
^1da177e4c3f4152 Linus Torvalds 2005-04-16 272 kmem_cache_destroy(dcookie_cache);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 273 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 274 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 275
^1da177e4c3f4152 Linus Torvalds 2005-04-16 276
^1da177e4c3f4152 Linus Torvalds 2005-04-16 277 static void free_dcookie(struct dcookie_struct * dcs)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 278 {
c2452f32786159ed Nick Piggin 2008-12-01 279 struct dentry *d = dcs->path.dentry;
c2452f32786159ed Nick Piggin 2008-12-01 280
c2452f32786159ed Nick Piggin 2008-12-01 281 spin_lock(&d->d_lock);
c2452f32786159ed Nick Piggin 2008-12-01 282 d->d_flags &= ~DCACHE_COOKIE;
c2452f32786159ed Nick Piggin 2008-12-01 283 spin_unlock(&d->d_lock);
c2452f32786159ed Nick Piggin 2008-12-01 284
448678a0f3cdd015 Jan Blunck 2008-02-14 285 path_put(&dcs->path);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 286 kmem_cache_free(dcookie_cache, dcs);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 287 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 288
^1da177e4c3f4152 Linus Torvalds 2005-04-16 289
^1da177e4c3f4152 Linus Torvalds 2005-04-16 290 static void dcookie_exit(void)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 291 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 292 struct list_head * list;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 293 struct list_head * pos;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 294 struct list_head * pos2;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 295 struct dcookie_struct * dcs;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 296 size_t i;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 297
^1da177e4c3f4152 Linus Torvalds 2005-04-16 298 for (i = 0; i < hash_size; ++i) {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 299 list = dcookie_hashtable + i;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 300 list_for_each_safe(pos, pos2, list) {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 301 dcs = list_entry(pos, struct dcookie_struct, hash_list);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 302 list_del(&dcs->hash_list);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 303 free_dcookie(dcs);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 304 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 305 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 306
^1da177e4c3f4152 Linus Torvalds 2005-04-16 307 kfree(dcookie_hashtable);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 308 kmem_cache_destroy(dcookie_cache);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 309 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 310
^1da177e4c3f4152 Linus Torvalds 2005-04-16 311
^1da177e4c3f4152 Linus Torvalds 2005-04-16 312 struct dcookie_user {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 313 struct list_head next;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 314 };
^1da177e4c3f4152 Linus Torvalds 2005-04-16 315
^1da177e4c3f4152 Linus Torvalds 2005-04-16 @316 struct dcookie_user * dcookie_register(void)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 317 {
^1da177e4c3f4152 Linus Torvalds 2005-04-16 318 struct dcookie_user * user;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 319
353ab6e97b8f209d Ingo Molnar 2006-03-26 320 mutex_lock(&dcookie_mutex);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 321
^1da177e4c3f4152 Linus Torvalds 2005-04-16 322 user = kmalloc(sizeof(struct dcookie_user), GFP_KERNEL);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 323 if (!user)
^1da177e4c3f4152 Linus Torvalds 2005-04-16 324 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 325
^1da177e4c3f4152 Linus Torvalds 2005-04-16 326 if (!is_live() && dcookie_init())
^1da177e4c3f4152 Linus Torvalds 2005-04-16 327 goto out_free;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 328
^1da177e4c3f4152 Linus Torvalds 2005-04-16 329 list_add(&user->next, &dcookie_users);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 330
^1da177e4c3f4152 Linus Torvalds 2005-04-16 331 out:
353ab6e97b8f209d Ingo Molnar 2006-03-26 332 mutex_unlock(&dcookie_mutex);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 333 return user;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 334 out_free:
^1da177e4c3f4152 Linus Torvalds 2005-04-16 335 kfree(user);
^1da177e4c3f4152 Linus Torvalds 2005-04-16 336 user = NULL;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 337 goto out;
^1da177e4c3f4152 Linus Torvalds 2005-04-16 338 }
^1da177e4c3f4152 Linus Torvalds 2005-04-16 339
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
[intel-linux-intel-lts:5.4/yocto 1/13] drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
by kernel test robot
Hi Boris,
First bad commit (maybe != root cause):
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: 756623e2f190038a96e780f5f07990a065ebf2b9
commit: 4541b62447f9a65c9192597304d5f6cd11664386 [1/13] mtd: spi-nor: Prepare core / manufacturer code split
config: i386-randconfig-s001-20210114 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-208-g46a52ca4-dirty
# https://github.com/intel/linux-intel-lts/commit/4541b62447f9a65c919259730...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 5.4/yocto
git checkout 4541b62447f9a65c9192597304d5f6cd11664386
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/mtd/spi-nor/core.c:3383:34: sparse: sparse: cast to restricted __le32
>> drivers/mtd/spi-nor/core.c:3651:38: sparse: sparse: dubious: x | !y
drivers/mtd/spi-nor/core.c:3837:27: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:3931:29: sparse: sparse: cast to restricted __le32
drivers/mtd/spi-nor/core.c:4071:13: sparse: sparse: cast to restricted __le32
vim +3383 drivers/mtd/spi-nor/core.c
2aaa5f7e0c07a0f1 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2018-12-06 3324
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3325 /**
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3326 * spi_nor_parse_bfpt() - read and parse the Basic Flash Parameter Table.
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3327 * @nor: pointer to a 'struct spi_nor'
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3328 * @bfpt_header: pointer to the 'struct sfdp_parameter_header' describing
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3329 * the Basic Flash Parameter Table length and version
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3330 * @params: pointer to the 'struct spi_nor_flash_parameter' to be
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3331 * filled
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3332 *
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3333 * The Basic Flash Parameter Table is the main and only mandatory table as
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3334 * defined by the SFDP (JESD216) specification.
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3335 * It provides us with the total size (memory density) of the data array and
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3336 * the number of address bytes for Fast Read, Page Program and Sector Erase
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3337 * commands.
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3338 * For Fast READ commands, it also gives the number of mode clock cycles and
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3339 * wait states (regrouped in the number of dummy clock cycles) for each
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3340 * supported instruction op code.
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3341 * For Page Program, the page size is now available since JESD216 rev A, however
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3342 * the supported instruction op codes are still not provided.
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3343 * For Sector Erase commands, this table stores the supported instruction op
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3344 * codes and the associated sector sizes.
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3345 * Finally, the Quad Enable Requirements (QER) are also available since JESD216
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3346 * rev A. The QER bits encode the manufacturer dependent procedure to be
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3347 * executed to set the Quad Enable (QE) bit in some internal register of the
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3348 * Quad SPI memory. Indeed the QE bit, when it exists, must be set before
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3349 * sending any Quad SPI command to the memory. Actually, setting the QE bit
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3350 * tells the memory to reassign its WP# and HOLD#/RESET# pins to functions IO2
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3351 * and IO3 hence enabling 4 (Quad) I/O lines.
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3352 *
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3353 * Return: 0 on success, -errno otherwise.
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3354 */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3355 static int spi_nor_parse_bfpt(struct spi_nor *nor,
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3356 const struct sfdp_parameter_header *bfpt_header,
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3357 struct spi_nor_flash_parameter *params)
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3358 {
c46872170a54c902 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2019-08-23 3359 struct spi_nor_erase_map *map = ¶ms->erase_map;
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3360 struct spi_nor_erase_type *erase_type = map->erase_type;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3361 struct sfdp_bfpt bfpt;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3362 size_t len;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3363 int i, cmd, err;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3364 u32 addr;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3365 u16 half;
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3366 u8 erase_mask;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3367
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3368 /* JESD216 Basic Flash Parameter Table length is at least 9 DWORDs. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3369 if (bfpt_header->length < BFPT_DWORD_MAX_JESD216)
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3370 return -EINVAL;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3371
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3372 /* Read the Basic Flash Parameter Table. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3373 len = min_t(size_t, sizeof(bfpt),
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3374 bfpt_header->length * sizeof(u32));
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3375 addr = SFDP_PARAM_HEADER_PTP(bfpt_header);
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3376 memset(&bfpt, 0, sizeof(bfpt));
bfa4133795e5a0ba drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-09-06 3377 err = spi_nor_read_sfdp_dma_unsafe(nor, addr, len, &bfpt);
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3378 if (err < 0)
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3379 return err;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3380
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3381 /* Fix endianness of the BFPT DWORDs. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3382 for (i = 0; i < BFPT_DWORD_MAX; i++)
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 @3383 bfpt.dwords[i] = le32_to_cpu(bfpt.dwords[i]);
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3384
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3385 /* Number of address bytes. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3386 switch (bfpt.dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) {
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3387 case BFPT_DWORD1_ADDRESS_BYTES_3_ONLY:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3388 nor->addr_width = 3;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3389 break;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3390
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3391 case BFPT_DWORD1_ADDRESS_BYTES_4_ONLY:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3392 nor->addr_width = 4;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3393 break;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3394
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3395 default:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3396 break;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3397 }
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3398
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3399 /* Flash Memory Density (in bits). */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3400 params->size = bfpt.dwords[BFPT_DWORD(2)];
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3401 if (params->size & BIT(31)) {
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3402 params->size &= ~BIT(31);
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3403
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3404 /*
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3405 * Prevent overflows on params->size. Anyway, a NOR of 2^64
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3406 * bits is unlikely to exist so this error probably means
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3407 * the BFPT we are reading is corrupted/wrong.
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3408 */
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3409 if (params->size > 63)
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3410 return -EINVAL;
b8f3911610529ba5 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2017-09-12 3411
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3412 params->size = 1ULL << params->size;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3413 } else {
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3414 params->size++;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3415 }
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3416 params->size >>= 3; /* Convert to bytes. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3417
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3418 /* Fast Read settings. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3419 for (i = 0; i < ARRAY_SIZE(sfdp_bfpt_reads); i++) {
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3420 const struct sfdp_bfpt_read *rd = &sfdp_bfpt_reads[i];
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3421 struct spi_nor_read_command *read;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3422
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3423 if (!(bfpt.dwords[rd->supported_dword] & rd->supported_bit)) {
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3424 params->hwcaps.mask &= ~rd->hwcaps;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3425 continue;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3426 }
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3427
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3428 params->hwcaps.mask |= rd->hwcaps;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3429 cmd = spi_nor_hwcaps_read2cmd(rd->hwcaps);
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3430 read = ¶ms->reads[cmd];
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3431 half = bfpt.dwords[rd->settings_dword] >> rd->settings_shift;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3432 spi_nor_set_read_settings_from_bfpt(read, half, rd->proto);
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3433 }
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3434
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3435 /*
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3436 * Sector Erase settings. Reinitialize the uniform erase map using the
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3437 * Erase Types defined in the bfpt table.
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3438 */
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3439 erase_mask = 0;
c46872170a54c902 drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2019-08-23 3440 memset(¶ms->erase_map, 0, sizeof(params->erase_map));
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3441 for (i = 0; i < ARRAY_SIZE(sfdp_bfpt_erases); i++) {
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3442 const struct sfdp_bfpt_erase *er = &sfdp_bfpt_erases[i];
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3443 u32 erasesize;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3444 u8 opcode;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3445
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3446 half = bfpt.dwords[er->dword] >> er->shift;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3447 erasesize = half & 0xff;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3448
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3449 /* erasesize == 0 means this Erase Type is not supported. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3450 if (!erasesize)
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3451 continue;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3452
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3453 erasesize = 1U << erasesize;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3454 opcode = (half >> 8) & 0xff;
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3455 erase_mask |= BIT(i);
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3456 spi_nor_set_erase_settings_from_bfpt(&erase_type[i], erasesize,
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3457 opcode, i);
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3458 }
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3459 spi_nor_init_uniform_erase_map(map, erase_mask, params->size);
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3460 /*
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3461 * Sort all the map's Erase Types in ascending order with the smallest
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3462 * erase size being the first member in the erase_type array.
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3463 */
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3464 sort(erase_type, SNOR_ERASE_TYPE_MAX, sizeof(erase_type[0]),
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3465 spi_nor_map_cmp_erase_type, NULL);
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3466 /*
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3467 * Sort the erase types in the uniform region in order to update the
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3468 * uniform_erase_type bitmask. The bitmask will be used later on when
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3469 * selecting the uniform erase.
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3470 */
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3471 spi_nor_regions_sort_erase_types(map);
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3472 map->uniform_erase_type = map->uniform_region.offset &
5390a8df769ec9ba drivers/mtd/spi-nor/spi-nor.c Tudor Ambarus 2018-09-11 3473 SNOR_ERASE_TYPE_MASK;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3474
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3475 /* Stop here if not JESD216 rev A or later. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3476 if (bfpt_header->length < BFPT_DWORD_MAX)
2aaa5f7e0c07a0f1 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2018-12-06 3477 return spi_nor_post_bfpt_fixups(nor, bfpt_header, &bfpt,
2aaa5f7e0c07a0f1 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2018-12-06 3478 params);
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3479
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3480 /* Page size: this field specifies 'N' so the page size = 2^N bytes. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3481 params->page_size = bfpt.dwords[BFPT_DWORD(11)];
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3482 params->page_size &= BFPT_DWORD11_PAGE_SIZE_MASK;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3483 params->page_size >>= BFPT_DWORD11_PAGE_SIZE_SHIFT;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3484 params->page_size = 1U << params->page_size;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3485
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3486 /* Quad Enable Requirements. */
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3487 switch (bfpt.dwords[BFPT_DWORD(15)] & BFPT_DWORD15_QER_MASK) {
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3488 case BFPT_DWORD15_QER_NONE:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3489 params->quad_enable = NULL;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3490 break;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3491
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3492 case BFPT_DWORD15_QER_SR2_BIT1_BUGGY:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3493 case BFPT_DWORD15_QER_SR2_BIT1_NO_RD:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3494 params->quad_enable = spansion_no_read_cr_quad_enable;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3495 break;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3496
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3497 case BFPT_DWORD15_QER_SR1_BIT6:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3498 params->quad_enable = macronix_quad_enable;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3499 break;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3500
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3501 case BFPT_DWORD15_QER_SR2_BIT7:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3502 params->quad_enable = sr2_bit7_quad_enable;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3503 break;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3504
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3505 case BFPT_DWORD15_QER_SR2_BIT1:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3506 params->quad_enable = spansion_read_cr_quad_enable;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3507 break;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3508
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3509 default:
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3510 return -EINVAL;
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3511 }
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3512
2aaa5f7e0c07a0f1 drivers/mtd/spi-nor/spi-nor.c Boris Brezillon 2018-12-06 3513 return spi_nor_post_bfpt_fixups(nor, bfpt_header, &bfpt, params);
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3514 }
f384b352cbf0310f drivers/mtd/spi-nor/spi-nor.c Cyrille Pitchen 2017-06-26 3515
:::::: The code at line 3383 was first introduced by commit
:::::: f384b352cbf0310fd20c379c4710408c70e769b6 mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables
:::::: TO: Cyrille Pitchen <cyrille.pitchen(a)microchip.com>
:::::: CC: Cyrille Pitchen <cyrille.pitchen(a)wedev4u.fr>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
[freescale-fslc:5.4-2.3.x-imx 15240/16543] drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:14280:5: warning: no previous prototype for 'woal_priv_dot11mc_unassoc_ftm_cfg'
by kernel test robot
tree: https://github.com/Freescale/linux-fslc 5.4-2.3.x-imx
head: a8a2b9ee4bec0b29d031324160b7f11af42a563a
commit: 04b2fa2cd5d3365fe469ac2adcdabd783ee2bd2d [15240/16543] MLK-25013 net: wireless: nxp: mxm_wifiex: upgrade to mxm5x16210 release
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/Freescale/linux-fslc/commit/04b2fa2cd5d3365fe469ac2adc...
git remote add freescale-fslc https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc 5.4-2.3.x-imx
git checkout 04b2fa2cd5d3365fe469ac2adcdabd783ee2bd2d
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:3673:18: warning: variable 'data_length' set but not used [-Wunused-but-set-variable]
3673 | int header = 0, data_length = 0;
| ^~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c: At top level:
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:3729:5: warning: no previous prototype for 'woal_priv_setgettcpackenh' [-Wmissing-prototypes]
3729 | int woal_priv_setgettcpackenh(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:3793:5: warning: no previous prototype for 'woal_priv_assocessid' [-Wmissing-prototypes]
3793 | int woal_priv_assocessid(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen,
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:3929:5: warning: no previous prototype for 'woal_priv_getwakeupreason' [-Wmissing-prototypes]
3929 | int woal_priv_getwakeupreason(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:3987:5: warning: no previous prototype for 'woal_priv_set_get_listeninterval' [-Wmissing-prototypes]
3987 | int woal_priv_set_get_listeninterval(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:4068:5: warning: no previous prototype for 'woal_priv_set_get_drvdbg' [-Wmissing-prototypes]
4068 | int woal_priv_set_get_drvdbg(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:4166:5: warning: no previous prototype for 'woal_priv_mgmt_filter' [-Wmissing-prototypes]
4166 | int woal_priv_mgmt_filter(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:4243:5: warning: no previous prototype for 'woal_priv_hscfg' [-Wmissing-prototypes]
4243 | int woal_priv_hscfg(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen,
| ^~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:4447:5: warning: no previous prototype for 'woal_priv_hssetpara' [-Wmissing-prototypes]
4447 | int woal_priv_hssetpara(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:4495:5: warning: no previous prototype for 'woal_priv_set_get_scancfg' [-Wmissing-prototypes]
4495 | int woal_priv_set_get_scancfg(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:4608:5: warning: no previous prototype for 'woal_priv_getnlnum' [-Wmissing-prototypes]
4608 | int woal_priv_getnlnum(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:4640:5: warning: no previous prototype for 'woal_priv_set_get_aggrctrl' [-Wmissing-prototypes]
4640 | int woal_priv_set_get_aggrctrl(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:6554:5: warning: no previous prototype for 'woal_priv_set_get_auto_arp' [-Wmissing-prototypes]
6554 | int woal_priv_set_get_auto_arp(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:7068:5: warning: no previous prototype for 'woal_priv_hotspotcfg' [-Wmissing-prototypes]
7068 | int woal_priv_hotspotcfg(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:7135:5: warning: no previous prototype for 'woal_priv_mgmt_frame_passthru_ctrl' [-Wmissing-prototypes]
7135 | int woal_priv_mgmt_frame_passthru_ctrl(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:7575:5: warning: no previous prototype for 'woal_priv_macctrl' [-Wmissing-prototypes]
7575 | int woal_priv_macctrl(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:7643:5: warning: no previous prototype for 'woal_priv_getwap' [-Wmissing-prototypes]
7643 | int woal_priv_getwap(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:7692:5: warning: no previous prototype for 'woal_priv_region_code' [-Wmissing-prototypes]
7692 | int woal_priv_region_code(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:7841:5: warning: no previous prototype for 'woal_priv_fwmacaddr' [-Wmissing-prototypes]
7841 | int woal_priv_fwmacaddr(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:7907:5: warning: no previous prototype for 'woal_priv_offchannel' [-Wmissing-prototypes]
7907 | int woal_priv_offchannel(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:8062:5: warning: no previous prototype for 'woal_priv_set_get_dscp_map' [-Wmissing-prototypes]
8062 | int woal_priv_set_get_dscp_map(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:8097:5: warning: no previous prototype for 'woal_priv_get_driver_verext' [-Wmissing-prototypes]
8097 | int woal_priv_get_driver_verext(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c: In function 'woal_priv_get_signal':
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:9169:6: warning: variable 'buflen' set but not used [-Wunused-but-set-variable]
9169 | int buflen = 0;
| ^~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c: At top level:
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:9721:5: warning: no previous prototype for 'woal_priv_set_get_pmfcfg' [-Wmissing-prototypes]
9721 | int woal_priv_set_get_pmfcfg(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:10509:6: warning: no previous prototype for 'woal_get_center_freq_idx' [-Wmissing-prototypes]
10509 | t_u8 woal_get_center_freq_idx(moal_private *priv, t_u8 band, t_u32 pri_chan,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c: In function 'woal_priv_associate_ssid_bssid':
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:11579:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
11579 | int ret = 0, copy_len = 0;
| ^~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c: In function 'woal_priv_cmd53rdwr':
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:11967:11: warning: variable 'func' set but not used [-Wunused-but-set-variable]
11967 | t_u8 rw, func, mode;
| ^~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c: In function 'woal_priv_11axcfg_cmd':
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:12506:23: warning: variable 'data_ptr' set but not used [-Wunused-but-set-variable]
12506 | mlan_ds_11ax_he_cfg *data_ptr = NULL;
| ^~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c: At top level:
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:13035:5: warning: no previous prototype for 'woal_set_scan_chan_gap' [-Wmissing-prototypes]
13035 | int woal_set_scan_chan_gap(moal_private *priv, t_u8 *respbuf, int respbuflen)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:14100:5: warning: no previous prototype for 'woal_priv_rx_abort_cfg' [-Wmissing-prototypes]
14100 | int woal_priv_rx_abort_cfg(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:14183:5: warning: no previous prototype for 'woal_priv_rx_abort_cfg_ext' [-Wmissing-prototypes]
14183 | int woal_priv_rx_abort_cfg_ext(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:14280:5: warning: no previous prototype for 'woal_priv_dot11mc_unassoc_ftm_cfg' [-Wmissing-prototypes]
14280 | int woal_priv_dot11mc_unassoc_ftm_cfg(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:14360:5: warning: no previous prototype for 'woal_priv_tx_ampdu_prot_mode' [-Wmissing-prototypes]
14360 | int woal_priv_tx_ampdu_prot_mode(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:14440:5: warning: no previous prototype for 'woal_priv_rate_adapt_cfg' [-Wmissing-prototypes]
14440 | int woal_priv_rate_adapt_cfg(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:14546:5: warning: no previous prototype for 'woal_priv_cck_desense_cfg' [-Wmissing-prototypes]
14546 | int woal_priv_cck_desense_cfg(moal_private *priv, t_u8 *respbuf,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:14758:5: warning: no previous prototype for 'woal_priv_arbcfg' [-Wmissing-prototypes]
14758 | int woal_priv_arbcfg(moal_private *priv, t_u8 *respbuf, t_u32 respbuflen)
| ^~~~~~~~~~~~~~~~
In file included from drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_main.h:130,
from drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c:28:
drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_priv.h:282:34: warning: 'woal_private_args' defined but not used [-Wunused-const-variable=]
282 | static const struct iw_priv_args woal_private_args[] = {
| ^~~~~~~~~~~~~~~~~
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for GPIO_MXC
Depends on GPIOLIB && HAS_IOMEM && ARCH_MXC
Selected by
- GPIO_MXC_PAD_WAKEUP && GPIOLIB && HAS_IOMEM && IMX_SCU
vim +/woal_priv_dot11mc_unassoc_ftm_cfg +14280 drivers/net/wireless/nxp/mxm_wifiex/wlan_src/mlinux/moal_eth_ioctl.c
14270
14271 /**
14272 * @brief Enable/Disable Un-associated Dot11mc FTM Frame exchanges
14273 *
14274 * @param priv A pointer to moal_private structure
14275 * @param respbuf A pointer to response buffer
14276 * @param respbuflen Available length of response buffer
14277 *
14278 * @return Number of bytes written, negative for failure.
14279 */
14280 int woal_priv_dot11mc_unassoc_ftm_cfg(moal_private *priv, t_u8 *respbuf,
14281 t_u32 respbuflen)
14282 {
14283 mlan_ioctl_req *req = NULL;
14284 mlan_ds_misc_cfg *misc = NULL;
14285 int ret = 0;
14286 int data[1] = {0};
14287 int header_len = 0, user_data_len = 0;
14288 mlan_status status = MLAN_STATUS_SUCCESS;
14289
14290 ENTER();
14291
14292 if (!respbuf) {
14293 PRINTM(MERROR, "response buffer is not available!\n");
14294 ret = -EINVAL;
14295 goto done;
14296 }
14297 header_len = strlen(CMD_NXP) + strlen(PRIV_CMD_DOT11MC_UNASSOC_FTM_CFG);
14298 user_data_len = strlen(respbuf) - header_len;
14299
14300 /* Allocate an IOCTL request buffer */
14301 req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
14302 if (req == NULL) {
14303 ret = -ENOMEM;
14304 goto done;
14305 }
14306
14307 /* Fill request buffer */
14308 misc = (mlan_ds_misc_cfg *)req->pbuf;
14309 misc->sub_command = MLAN_OID_MISC_DOT11MC_UNASSOC_FTM_CFG;
14310 req->req_id = MLAN_IOCTL_MISC_CFG;
14311 if (strlen(respbuf) == header_len) {
14312 /* GET operation */
14313 user_data_len = 0;
14314 req->action = MLAN_ACT_GET;
14315 } else {
14316 /* SET operation */
14317 parse_arguments(respbuf + header_len, data, ARRAY_SIZE(data),
14318 &user_data_len);
14319 if (user_data_len > 1) {
14320 PRINTM(MERROR, "Invalid number of args!\n");
14321 ret = -EINVAL;
14322 goto done;
14323 }
14324 if ((data[0] != MTRUE) && (data[0] != MFALSE)) {
14325 PRINTM(MERROR, "Invalid state for unassoc ftm\n");
14326 ret = -EINVAL;
14327 goto done;
14328 }
14329 misc->param.dot11mc_unassoc_ftm_cfg.state = (t_u16)data[0];
14330 req->action = MLAN_ACT_SET;
14331 }
14332 /* Send IOCTL request to MLAN */
14333 status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
14334 if (status != MLAN_STATUS_SUCCESS) {
14335 ret = -EFAULT;
14336 goto done;
14337 }
14338
14339 data[0] = misc->param.dot11mc_unassoc_ftm_cfg.state;
14340 moal_memcpy_ext(priv->phandle, respbuf, (t_u8 *)data, sizeof(data),
14341 respbuflen);
14342 ret = sizeof(data);
14343 done:
14344 if (status != MLAN_STATUS_PENDING)
14345 kfree(req);
14346
14347 LEAVE();
14348 return ret;
14349 }
14350
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
[f2fs-stable:linux-4.19.y 482/754] include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'blkcnt_t' {aka 'long long unsigned int'}
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git linux-4.19.y
head: 010b090e4e64913748f16c28168be674a4139e14
commit: 0f87f20d0536ae21524ce1c25335aec991229114 [482/754] f2fs: fix to check i_compr_blocks correctly
config: microblaze-randconfig-r011-20210113 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git/c...
git remote add f2fs-stable https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git
git fetch --no-tags f2fs-stable linux-4.19.y
git checkout 0f87f20d0536ae21524ce1c25335aec991229114
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from fs/f2fs/inode.c:14:
fs/f2fs/f2fs.h: In function 'blkaddr_in_node':
fs/f2fs/f2fs.h:2377:30: warning: taking address of packed member of 'struct f2fs_inode' may result in an unaligned pointer value [-Waddress-of-packed-member]
2377 | return RAW_IS_INODE(node) ? node->i.i_addr : node->dn.addr;
| ^~~~
fs/f2fs/f2fs.h:2377:47: warning: taking address of packed member of 'struct direct_node' may result in an unaligned pointer value [-Waddress-of-packed-member]
2377 | return RAW_IS_INODE(node) ? node->i.i_addr : node->dn.addr;
| ^~~~
In file included from include/linux/printk.h:7,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/f2fs/inode.c:8:
fs/f2fs/inode.c: In function 'sanity_check_inode':
>> include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'blkcnt_t' {aka 'long long unsigned int'} [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
12 | #define KERN_WARNING KERN_SOH "4" /* warning conditions */
| ^~~~~~~~
fs/f2fs/f2fs.h:1949:19: note: in expansion of macro 'KERN_WARNING'
1949 | f2fs_printk(sbi, KERN_WARNING fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~
fs/f2fs/inode.c:303:4: note: in expansion of macro 'f2fs_warn'
303 | f2fs_warn(sbi, "%s: inode (ino=%lx) has inconsistent "
| ^~~~~~~~~
fs/f2fs/inode.c:304:38: note: format string is defined here
304 | "i_compr_blocks:%llu, i_blocks:%lu, run fsck to fix",
| ~~^
| |
| long unsigned int
| %llu
vim +5 include/linux/kern_levels.h
314ba3520e513a78 Joe Perches 2012-07-30 4
04d2c8c83d0e3ac5 Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */
04d2c8c83d0e3ac5 Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'
04d2c8c83d0e3ac5 Joe Perches 2012-07-30 7
:::::: The code at line 5 was first introduced by commit
:::::: 04d2c8c83d0e3ac5f78aeede51babb3236200112 printk: convert the format for KERN_<LEVEL> to a 2 byte pattern
:::::: TO: Joe Perches <joe(a)perches.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
drivers/mmc/host/dw_mmc.c:602:29: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
Hi Mike,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 65f0d2414b7079556fbbcc070b3d1c9f9587606d
commit: 3ed6751bb8fa89c3014399bb0414348499ee202a mips: fix build when "48 bits virtual memory" is enabled
date: 1 year, 2 months ago
config: mips-randconfig-s032-20210114 (attached as .config)
compiler: mips64el-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.3-208-g46a52ca4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 3ed6751bb8fa89c3014399bb0414348499ee202a
# 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=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
>> drivers/mmc/host/dw_mmc.c:602:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *mem @@ got unsigned int * @@
drivers/mmc/host/dw_mmc.c:602:29: sparse: expected void const volatile [noderef] <asn:2> *mem
drivers/mmc/host/dw_mmc.c:602:29: sparse: got unsigned int *
>> drivers/mmc/host/dw_mmc.c:602:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *mem @@ got unsigned int * @@
drivers/mmc/host/dw_mmc.c:602:29: sparse: expected void const volatile [noderef] <asn:2> *mem
drivers/mmc/host/dw_mmc.c:602:29: sparse: got unsigned int *
drivers/mmc/host/dw_mmc.c:615:25: sparse: sparse: restricted __le32 degrades to integer
drivers/mmc/host/dw_mmc.c:615:25: sparse: sparse: restricted __le32 degrades to integer
>> drivers/mmc/host/dw_mmc.c:674:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *mem @@ got restricted __le32 * @@
drivers/mmc/host/dw_mmc.c:674:29: sparse: expected void const volatile [noderef] <asn:2> *mem
drivers/mmc/host/dw_mmc.c:674:29: sparse: got restricted __le32 *
drivers/mmc/host/dw_mmc.c:674:29: sparse: sparse: restricted __le32 degrades to integer
>> drivers/mmc/host/dw_mmc.c:674:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *mem @@ got restricted __le32 * @@
drivers/mmc/host/dw_mmc.c:674:29: sparse: expected void const volatile [noderef] <asn:2> *mem
drivers/mmc/host/dw_mmc.c:674:29: sparse: got restricted __le32 *
drivers/mmc/host/dw_mmc.c:674:29: sparse: sparse: restricted __le32 degrades to integer
--
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
>> drivers/tty/serial/zs.c:988:26: sparse: sparse: Using plain integer as NULL pointer
>> drivers/tty/serial/zs.c:218:9: sparse: sparse: context imbalance in 'zs_spin_lock_cond_irq' - wrong count at exit
drivers/tty/serial/zs.c:227:32: sparse: sparse: context imbalance in 'zs_spin_unlock_cond_irq' - unexpected unlock
--
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
>> drivers/watchdog/mtx-1_wdt.c:185:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@ expected long ( *write )( ... ) @@ got long ( * )( ... ) @@
drivers/watchdog/mtx-1_wdt.c:185:27: sparse: expected long ( *write )( ... )
drivers/watchdog/mtx-1_wdt.c:185:27: sparse: got long ( * )( ... )
--
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
drivers/watchdog/ar7_wdt.c:193:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const [noderef] <asn:1> *__gu_ptr @@ got char const * @@
drivers/watchdog/ar7_wdt.c:193:29: sparse: expected char const [noderef] <asn:1> *__gu_ptr
drivers/watchdog/ar7_wdt.c:193:29: sparse: got char const *
drivers/watchdog/ar7_wdt.c:216:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] <asn:1> *to @@ got struct watchdog_info * @@
drivers/watchdog/ar7_wdt.c:216:35: sparse: expected void [noderef] <asn:1> *to
drivers/watchdog/ar7_wdt.c:216:35: sparse: got struct watchdog_info *
drivers/watchdog/ar7_wdt.c:222:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int [noderef] <asn:1> *__pu_addr @@ got int * @@
drivers/watchdog/ar7_wdt.c:222:21: sparse: expected int [noderef] <asn:1> *__pu_addr
drivers/watchdog/ar7_wdt.c:222:21: sparse: got int *
drivers/watchdog/ar7_wdt.c:229:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int const [noderef] <asn:1> *__gu_ptr @@ got int * @@
drivers/watchdog/ar7_wdt.c:229:21: sparse: expected int const [noderef] <asn:1> *__gu_ptr
drivers/watchdog/ar7_wdt.c:229:21: sparse: got int *
drivers/watchdog/ar7_wdt.c:241:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected int [noderef] <asn:1> *__pu_addr @@ got int * @@
drivers/watchdog/ar7_wdt.c:241:21: sparse: expected int [noderef] <asn:1> *__pu_addr
drivers/watchdog/ar7_wdt.c:241:21: sparse: got int *
>> drivers/watchdog/ar7_wdt.c:251:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@ expected long ( *write )( ... ) @@ got long ( * )( ... ) @@
drivers/watchdog/ar7_wdt.c:251:27: sparse: expected long ( *write )( ... )
drivers/watchdog/ar7_wdt.c:251:27: sparse: got long ( * )( ... )
drivers/watchdog/ar7_wdt.c:270:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct ar7_wdt *static [toplevel] ar7_wdt @@ got void [noderef] <asn:2> * @@
drivers/watchdog/ar7_wdt.c:270:17: sparse: expected struct ar7_wdt *static [toplevel] ar7_wdt
drivers/watchdog/ar7_wdt.c:270:17: sparse: got void [noderef] <asn:2> *
--
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
>> drivers/video/fbdev/pmag-aa-fb.c:110:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt431_regs *regs @@ got struct bt431_regs [noderef] <asn:2> *bt431 @@
drivers/video/fbdev/pmag-aa-fb.c:110:39: sparse: expected struct bt431_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:110:39: sparse: got struct bt431_regs [noderef] <asn:2> *bt431
drivers/video/fbdev/pmag-aa-fb.c:115:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt431_regs *regs @@ got struct bt431_regs [noderef] <asn:2> *bt431 @@
drivers/video/fbdev/pmag-aa-fb.c:115:39: sparse: expected struct bt431_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:115:39: sparse: got struct bt431_regs [noderef] <asn:2> *bt431
drivers/video/fbdev/pmag-aa-fb.c:118:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt431_regs *regs @@ got struct bt431_regs [noderef] <asn:2> *bt431 @@
drivers/video/fbdev/pmag-aa-fb.c:118:42: sparse: expected struct bt431_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:118:42: sparse: got struct bt431_regs [noderef] <asn:2> *bt431
>> drivers/video/fbdev/pmag-aa-fb.c:124:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt455_regs *regs @@ got struct bt455_regs [noderef] <asn:2> *bt455 @@
drivers/video/fbdev/pmag-aa-fb.c:124:43: sparse: expected struct bt455_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:124:43: sparse: got struct bt455_regs [noderef] <asn:2> *bt455
drivers/video/fbdev/pmag-aa-fb.c:125:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt455_regs *regs @@ got struct bt455_regs [noderef] <asn:2> *bt455 @@
drivers/video/fbdev/pmag-aa-fb.c:125:42: sparse: expected struct bt455_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:125:42: sparse: got struct bt455_regs [noderef] <asn:2> *bt455
drivers/video/fbdev/pmag-aa-fb.c:126:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt455_regs *regs @@ got struct bt455_regs [noderef] <asn:2> *bt455 @@
drivers/video/fbdev/pmag-aa-fb.c:126:42: sparse: expected struct bt455_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:126:42: sparse: got struct bt455_regs [noderef] <asn:2> *bt455
drivers/video/fbdev/pmag-aa-fb.c:129:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt431_regs *regs @@ got struct bt431_regs [noderef] <asn:2> *bt431 @@
drivers/video/fbdev/pmag-aa-fb.c:129:37: sparse: expected struct bt431_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:129:37: sparse: got struct bt431_regs [noderef] <asn:2> *bt431
drivers/video/fbdev/pmag-aa-fb.c:134:40: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt431_regs *regs @@ got struct bt431_regs [noderef] <asn:2> *bt431 @@
drivers/video/fbdev/pmag-aa-fb.c:134:40: sparse: expected struct bt431_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:134:40: sparse: got struct bt431_regs [noderef] <asn:2> *bt431
drivers/video/fbdev/pmag-aa-fb.c:146:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt455_regs *regs @@ got struct bt455_regs [noderef] <asn:2> *bt455 @@
drivers/video/fbdev/pmag-aa-fb.c:146:35: sparse: expected struct bt455_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:146:35: sparse: got struct bt455_regs [noderef] <asn:2> *bt455
drivers/video/fbdev/pmag-aa-fb.c:212:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt455_regs *regs @@ got struct bt455_regs [noderef] <asn:2> *bt455 @@
drivers/video/fbdev/pmag-aa-fb.c:212:35: sparse: expected struct bt455_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:212:35: sparse: got struct bt455_regs [noderef] <asn:2> *bt455
drivers/video/fbdev/pmag-aa-fb.c:213:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt455_regs *regs @@ got struct bt455_regs [noderef] <asn:2> *bt455 @@
drivers/video/fbdev/pmag-aa-fb.c:213:34: sparse: expected struct bt455_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:213:34: sparse: got struct bt455_regs [noderef] <asn:2> *bt455
drivers/video/fbdev/pmag-aa-fb.c:216:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt431_regs *regs @@ got struct bt431_regs [noderef] <asn:2> *bt431 @@
drivers/video/fbdev/pmag-aa-fb.c:216:31: sparse: expected struct bt431_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:216:31: sparse: got struct bt431_regs [noderef] <asn:2> *bt431
drivers/video/fbdev/pmag-aa-fb.c:217:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct bt431_regs *regs @@ got struct bt431_regs [noderef] <asn:2> *bt431 @@
drivers/video/fbdev/pmag-aa-fb.c:217:30: sparse: expected struct bt431_regs *regs
drivers/video/fbdev/pmag-aa-fb.c:217:30: sparse: got struct bt431_regs [noderef] <asn:2> *bt431
--
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
>> arch/mips/dec/kn01-berr.c:104:34: sparse: sparse: cast removes address space '<asn:1>' of expression
--
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
>> arch/mips/dec/tc.c:32:16: sparse: sparse: cast removes address space '<asn:2>' of expression
>> arch/mips/dec/tc.c:32:16: sparse: sparse: cast removes address space '<asn:2>' of expression
>> arch/mips/dec/tc.c:32:16: sparse: sparse: cast removes address space '<asn:2>' of expression
>> arch/mips/dec/tc.c:32:16: sparse: sparse: cast removes address space '<asn:2>' of expression
--
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
arch/mips/kernel/kgdb.c:147:56: sparse: sparse: no member 'fpu' in struct thread_struct
>> arch/mips/kernel/kgdb.c:147:33: sparse: sparse: cast from unknown type
arch/mips/kernel/kgdb.c:155:48: sparse: sparse: no member 'fpu' in struct thread_struct
arch/mips/kernel/kgdb.c:155:25: sparse: sparse: cast from unknown type
arch/mips/kernel/kgdb.c:182:61: sparse: sparse: no member 'fpu' in struct thread_struct
arch/mips/kernel/kgdb.c:182:38: sparse: sparse: cast from unknown type
arch/mips/kernel/kgdb.c:191:53: sparse: sparse: no member 'fpu' in struct thread_struct
arch/mips/kernel/kgdb.c:191:30: sparse: sparse: cast from unknown type
vim +602 drivers/mmc/host/dw_mmc.c
3b2a067b98b45f7a Shawn Lin 2016-09-02 573
3b2a067b98b45f7a Shawn Lin 2016-09-02 574 static inline int dw_mci_prepare_desc64(struct dw_mci *host,
ec0baaa6b33932a2 Shawn Lin 2016-09-02 575 struct mmc_data *data,
f95f3850f7a9e1d4 Will Newton 2011-01-02 576 unsigned int sg_len)
f95f3850f7a9e1d4 Will Newton 2011-01-02 577 {
5959b32e3636f9bf Alexey Brodkin 2015-06-25 578 unsigned int desc_len;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 579 struct idmac_desc_64addr *desc_first, *desc_last, *desc;
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 580 u32 val;
ec0baaa6b33932a2 Shawn Lin 2016-09-02 581 int i;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 582
5959b32e3636f9bf Alexey Brodkin 2015-06-25 583 desc_first = desc_last = desc = host->sg_cpu;
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 584
5959b32e3636f9bf Alexey Brodkin 2015-06-25 585 for (i = 0; i < sg_len; i++) {
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 586 unsigned int length = sg_dma_len(&data->sg[i]);
0e3a22c044478b61 Shawn Lin 2015-08-03 587
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 588 u64 mem_addr = sg_dma_address(&data->sg[i]);
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 589
5959b32e3636f9bf Alexey Brodkin 2015-06-25 590 for ( ; length ; desc++) {
5959b32e3636f9bf Alexey Brodkin 2015-06-25 591 desc_len = (length <= DW_MCI_DESC_DATA_LENGTH) ?
5959b32e3636f9bf Alexey Brodkin 2015-06-25 592 length : DW_MCI_DESC_DATA_LENGTH;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 593
5959b32e3636f9bf Alexey Brodkin 2015-06-25 594 length -= desc_len;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 595
3b2a067b98b45f7a Shawn Lin 2016-09-02 596 /*
3b2a067b98b45f7a Shawn Lin 2016-09-02 597 * Wait for the former clear OWN bit operation
3b2a067b98b45f7a Shawn Lin 2016-09-02 598 * of IDMAC to make sure that this descriptor
3b2a067b98b45f7a Shawn Lin 2016-09-02 599 * isn't still owned by IDMAC as IDMAC's write
3b2a067b98b45f7a Shawn Lin 2016-09-02 600 * ops and CPU's read ops are asynchronous.
3b2a067b98b45f7a Shawn Lin 2016-09-02 601 */
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 @602 if (readl_poll_timeout_atomic(&desc->des0, val,
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 603 !(val & IDMAC_DES0_OWN),
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 604 10, 100 * USEC_PER_MSEC))
3b2a067b98b45f7a Shawn Lin 2016-09-02 605 goto err_own_bit;
3b2a067b98b45f7a Shawn Lin 2016-09-02 606
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 607 /*
5959b32e3636f9bf Alexey Brodkin 2015-06-25 608 * Set the OWN bit and disable interrupts
5959b32e3636f9bf Alexey Brodkin 2015-06-25 609 * for this descriptor
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 610 */
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 611 desc->des0 = IDMAC_DES0_OWN | IDMAC_DES0_DIC |
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 612 IDMAC_DES0_CH;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 613
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 614 /* Buffer length */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 615 IDMAC_64ADDR_SET_BUFFER1_SIZE(desc, desc_len);
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 616
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 617 /* Physical address to DMA to/from */
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 618 desc->des4 = mem_addr & 0xffffffff;
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 619 desc->des5 = mem_addr >> 32;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 620
5959b32e3636f9bf Alexey Brodkin 2015-06-25 621 /* Update physical address for the next desc */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 622 mem_addr += desc_len;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 623
5959b32e3636f9bf Alexey Brodkin 2015-06-25 624 /* Save pointer to the last descriptor */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 625 desc_last = desc;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 626 }
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 627 }
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 628
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 629 /* Set first descriptor */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 630 desc_first->des0 |= IDMAC_DES0_FD;
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 631
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 632 /* Set last descriptor */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 633 desc_last->des0 &= ~(IDMAC_DES0_CH | IDMAC_DES0_DIC);
5959b32e3636f9bf Alexey Brodkin 2015-06-25 634 desc_last->des0 |= IDMAC_DES0_LD;
3b2a067b98b45f7a Shawn Lin 2016-09-02 635
3b2a067b98b45f7a Shawn Lin 2016-09-02 636 return 0;
3b2a067b98b45f7a Shawn Lin 2016-09-02 637 err_own_bit:
3b2a067b98b45f7a Shawn Lin 2016-09-02 638 /* restore the descriptor chain as it's polluted */
26be9d705f44521d Colin Ian King 2016-11-16 639 dev_dbg(host->dev, "descriptor is still owned by IDMAC.\n");
cc190d4c6499b1b3 Shawn Lin 2016-09-02 640 memset(host->sg_cpu, 0, DESC_RING_BUF_SZ);
3b2a067b98b45f7a Shawn Lin 2016-09-02 641 dw_mci_idmac_init(host);
3b2a067b98b45f7a Shawn Lin 2016-09-02 642 return -EINVAL;
ec0baaa6b33932a2 Shawn Lin 2016-09-02 643 }
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 644
ec0baaa6b33932a2 Shawn Lin 2016-09-02 645
3b2a067b98b45f7a Shawn Lin 2016-09-02 646 static inline int dw_mci_prepare_desc32(struct dw_mci *host,
ec0baaa6b33932a2 Shawn Lin 2016-09-02 647 struct mmc_data *data,
ec0baaa6b33932a2 Shawn Lin 2016-09-02 648 unsigned int sg_len)
ec0baaa6b33932a2 Shawn Lin 2016-09-02 649 {
ec0baaa6b33932a2 Shawn Lin 2016-09-02 650 unsigned int desc_len;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 651 struct idmac_desc *desc_first, *desc_last, *desc;
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 652 u32 val;
ec0baaa6b33932a2 Shawn Lin 2016-09-02 653 int i;
f95f3850f7a9e1d4 Will Newton 2011-01-02 654
5959b32e3636f9bf Alexey Brodkin 2015-06-25 655 desc_first = desc_last = desc = host->sg_cpu;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 656
5959b32e3636f9bf Alexey Brodkin 2015-06-25 657 for (i = 0; i < sg_len; i++) {
f95f3850f7a9e1d4 Will Newton 2011-01-02 658 unsigned int length = sg_dma_len(&data->sg[i]);
0e3a22c044478b61 Shawn Lin 2015-08-03 659
f95f3850f7a9e1d4 Will Newton 2011-01-02 660 u32 mem_addr = sg_dma_address(&data->sg[i]);
f95f3850f7a9e1d4 Will Newton 2011-01-02 661
5959b32e3636f9bf Alexey Brodkin 2015-06-25 662 for ( ; length ; desc++) {
5959b32e3636f9bf Alexey Brodkin 2015-06-25 663 desc_len = (length <= DW_MCI_DESC_DATA_LENGTH) ?
5959b32e3636f9bf Alexey Brodkin 2015-06-25 664 length : DW_MCI_DESC_DATA_LENGTH;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 665
5959b32e3636f9bf Alexey Brodkin 2015-06-25 666 length -= desc_len;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 667
3b2a067b98b45f7a Shawn Lin 2016-09-02 668 /*
3b2a067b98b45f7a Shawn Lin 2016-09-02 669 * Wait for the former clear OWN bit operation
3b2a067b98b45f7a Shawn Lin 2016-09-02 670 * of IDMAC to make sure that this descriptor
3b2a067b98b45f7a Shawn Lin 2016-09-02 671 * isn't still owned by IDMAC as IDMAC's write
3b2a067b98b45f7a Shawn Lin 2016-09-02 672 * ops and CPU's read ops are asynchronous.
3b2a067b98b45f7a Shawn Lin 2016-09-02 673 */
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 @674 if (readl_poll_timeout_atomic(&desc->des0, val,
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 675 IDMAC_OWN_CLR64(val),
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 676 10,
b6d2d81c5c2de6b3 Shawn Lin 2017-02-17 677 100 * USEC_PER_MSEC))
3b2a067b98b45f7a Shawn Lin 2016-09-02 678 goto err_own_bit;
3b2a067b98b45f7a Shawn Lin 2016-09-02 679
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 680 /*
5959b32e3636f9bf Alexey Brodkin 2015-06-25 681 * Set the OWN bit and disable interrupts
5959b32e3636f9bf Alexey Brodkin 2015-06-25 682 * for this descriptor
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 683 */
6687c42fa71acd6a Ben Dooks 2015-03-25 684 desc->des0 = cpu_to_le32(IDMAC_DES0_OWN |
5959b32e3636f9bf Alexey Brodkin 2015-06-25 685 IDMAC_DES0_DIC |
5959b32e3636f9bf Alexey Brodkin 2015-06-25 686 IDMAC_DES0_CH);
5959b32e3636f9bf Alexey Brodkin 2015-06-25 687
f95f3850f7a9e1d4 Will Newton 2011-01-02 688 /* Buffer length */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 689 IDMAC_SET_BUFFER1_SIZE(desc, desc_len);
f95f3850f7a9e1d4 Will Newton 2011-01-02 690
f95f3850f7a9e1d4 Will Newton 2011-01-02 691 /* Physical address to DMA to/from */
6687c42fa71acd6a Ben Dooks 2015-03-25 692 desc->des2 = cpu_to_le32(mem_addr);
5959b32e3636f9bf Alexey Brodkin 2015-06-25 693
5959b32e3636f9bf Alexey Brodkin 2015-06-25 694 /* Update physical address for the next desc */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 695 mem_addr += desc_len;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 696
5959b32e3636f9bf Alexey Brodkin 2015-06-25 697 /* Save pointer to the last descriptor */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 698 desc_last = desc;
5959b32e3636f9bf Alexey Brodkin 2015-06-25 699 }
f95f3850f7a9e1d4 Will Newton 2011-01-02 700 }
f95f3850f7a9e1d4 Will Newton 2011-01-02 701
f95f3850f7a9e1d4 Will Newton 2011-01-02 702 /* Set first descriptor */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 703 desc_first->des0 |= cpu_to_le32(IDMAC_DES0_FD);
f95f3850f7a9e1d4 Will Newton 2011-01-02 704
f95f3850f7a9e1d4 Will Newton 2011-01-02 705 /* Set last descriptor */
5959b32e3636f9bf Alexey Brodkin 2015-06-25 706 desc_last->des0 &= cpu_to_le32(~(IDMAC_DES0_CH |
5959b32e3636f9bf Alexey Brodkin 2015-06-25 707 IDMAC_DES0_DIC));
5959b32e3636f9bf Alexey Brodkin 2015-06-25 708 desc_last->des0 |= cpu_to_le32(IDMAC_DES0_LD);
3b2a067b98b45f7a Shawn Lin 2016-09-02 709
3b2a067b98b45f7a Shawn Lin 2016-09-02 710 return 0;
3b2a067b98b45f7a Shawn Lin 2016-09-02 711 err_own_bit:
3b2a067b98b45f7a Shawn Lin 2016-09-02 712 /* restore the descriptor chain as it's polluted */
26be9d705f44521d Colin Ian King 2016-11-16 713 dev_dbg(host->dev, "descriptor is still owned by IDMAC.\n");
cc190d4c6499b1b3 Shawn Lin 2016-09-02 714 memset(host->sg_cpu, 0, DESC_RING_BUF_SZ);
3b2a067b98b45f7a Shawn Lin 2016-09-02 715 dw_mci_idmac_init(host);
3b2a067b98b45f7a Shawn Lin 2016-09-02 716 return -EINVAL;
69d99fdcfd7815df Prabu Thangamuthu 2014-10-20 717 }
f95f3850f7a9e1d4 Will Newton 2011-01-02 718
:::::: The code at line 602 was first introduced by commit
:::::: b6d2d81c5c2de6b3c69da3be9b2044dd008dbe45 mmc: dw_mmc: improve the timeout polling code
:::::: TO: Shawn Lin <shawn.lin(a)rock-chips.com>
:::::: CC: Ulf Hansson <ulf.hansson(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months