Re: [RFC PATCH net-next v4 1/6] gtp: Allow to create GTP device without FDs
by kernel test robot
Hi Marcin,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Marcin-Szycik/ice-GTP-support-in...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 41414c9bdbb87cc5fbeee7dfc33137a96710fcac
config: arm64-randconfig-s032-20220208 (https://download.01.org/0day-ci/archive/20220209/202202091756.K9IQ7bnX-lk...)
compiler: aarch64-linux-gcc (GCC) 11.2.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.4-dirty
# https://github.com/0day-ci/linux/commit/926dc9532fd0b964087f8d72f0331efe7...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Marcin-Szycik/ice-GTP-support-in-switchdev/20220205-005556
git checkout 926dc9532fd0b964087f8d72f0331efe70cd25bc
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/net/
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/net/gtp.c:868:43: sparse: sparse: cast to restricted __be16
>> drivers/net/gtp.c:868:41: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] local_udp_port @@ got unsigned short [usertype] @@
drivers/net/gtp.c:868:41: sparse: expected restricted __be16 [usertype] local_udp_port
drivers/net/gtp.c:868:41: sparse: got unsigned short [usertype]
drivers/net/gtp.c:870:43: sparse: sparse: cast to restricted __be16
drivers/net/gtp.c:870:41: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] local_udp_port @@ got unsigned short [usertype] @@
drivers/net/gtp.c:870:41: sparse: expected restricted __be16 [usertype] local_udp_port
drivers/net/gtp.c:870:41: sparse: got unsigned short [usertype]
vim +868 drivers/net/gtp.c
855
856 static struct sock *gtp_encap_create_sock(int type, struct gtp_dev *gtp)
857 {
858 struct udp_tunnel_sock_cfg tuncfg = {};
859 struct udp_port_cfg udp_conf = {
860 .local_ip.s_addr = htonl(INADDR_ANY),
861 .family = AF_INET,
862 };
863 struct net *net = gtp->net;
864 struct socket *sock;
865 int err;
866
867 if (type == UDP_ENCAP_GTP0)
> 868 udp_conf.local_udp_port = ntohs(GTP0_PORT);
869 else if (type == UDP_ENCAP_GTP1U)
870 udp_conf.local_udp_port = ntohs(GTP1U_PORT);
871 else
872 return ERR_PTR(-EINVAL);
873
874 err = udp_sock_create(net, &udp_conf, &sock);
875 if (err)
876 return ERR_PTR(err);
877
878 tuncfg.sk_user_data = gtp;
879 tuncfg.encap_type = type;
880 tuncfg.encap_rcv = gtp_encap_recv;
881 tuncfg.encap_destroy = NULL;
882
883 setup_udp_tunnel_sock(net, sock, &tuncfg);
884
885 return sock->sk;
886 }
887
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [PATCH v6 08/12] ACPI: add perf low power callback
by kernel test robot
Hi Stephane,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/perf/core]
[also build test ERROR on rafael-pm/linux-next v5.17-rc3 next-20220209]
[cannot apply to tip/x86/core]
[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/Stephane-Eranian/perf-x86-amd-Ad...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git ee28855a54493ce83bc2a3fbe30210be61b57bc7
config: x86_64-randconfig-a003 (https://download.01.org/0day-ci/archive/20220209/202202091736.pYZciCGD-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project e8bff9ae54a55b4dbfeb6ba55f723abbd81bf494)
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://github.com/0day-ci/linux/commit/90b2d6c8c171189602e01f8c00301f770...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Stephane-Eranian/perf-x86-amd-Add-AMD-Fam19h-Branch-Sampling-support/20220209-064255
git checkout 90b2d6c8c171189602e01f8c00301f7705e5d16a
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/acpi/
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 >>):
>> drivers/acpi/acpi_pad.c:168:4: error: implicit declaration of function 'perf_lopwr_cb' [-Werror,-Wimplicit-function-declaration]
perf_lopwr_cb(true);
^
1 error generated.
vim +/perf_lopwr_cb +168 drivers/acpi/acpi_pad.c
135
136 static unsigned int idle_pct = 5; /* percentage */
137 static unsigned int round_robin_time = 1; /* second */
138 static int power_saving_thread(void *data)
139 {
140 int do_sleep;
141 unsigned int tsk_index = (unsigned long)data;
142 u64 last_jiffies = 0;
143
144 sched_set_fifo_low(current);
145
146 while (!kthread_should_stop()) {
147 unsigned long expire_time;
148
149 /* round robin to cpus */
150 expire_time = last_jiffies + round_robin_time * HZ;
151 if (time_before(expire_time, jiffies)) {
152 last_jiffies = jiffies;
153 round_robin_cpu(tsk_index);
154 }
155
156 do_sleep = 0;
157
158 expire_time = jiffies + HZ * (100 - idle_pct) / 100;
159
160 while (!need_resched()) {
161 if (tsc_detected_unstable && !tsc_marked_unstable) {
162 /* TSC could halt in idle, so notify users */
163 mark_tsc_unstable("TSC halts in idle");
164 tsc_marked_unstable = 1;
165 }
166 local_irq_disable();
167
> 168 perf_lopwr_cb(true);
169
170 tick_broadcast_enable();
171 tick_broadcast_enter();
172 stop_critical_timings();
173
174 mwait_idle_with_hints(power_saving_mwait_eax, 1);
175
176 start_critical_timings();
177 tick_broadcast_exit();
178
179 perf_lopwr_cb(false);
180
181 local_irq_enable();
182
183 if (time_before(expire_time, jiffies)) {
184 do_sleep = 1;
185 break;
186 }
187 }
188
189 /*
190 * current sched_rt has threshold for rt task running time.
191 * When a rt task uses 95% CPU time, the rt thread will be
192 * scheduled out for 5% CPU time to not starve other tasks. But
193 * the mechanism only works when all CPUs have RT task running,
194 * as if one CPU hasn't RT task, RT task from other CPUs will
195 * borrow CPU time from this CPU and cause RT task use > 95%
196 * CPU time. To make 'avoid starvation' work, takes a nap here.
197 */
198 if (unlikely(do_sleep))
199 schedule_timeout_killable(HZ * idle_pct / 100);
200
201 /* If an external event has set the need_resched flag, then
202 * we need to deal with it, or this loop will continue to
203 * spin without calling __mwait().
204 */
205 if (unlikely(need_resched()))
206 schedule();
207 }
208
209 exit_round_robin(tsk_index);
210 return 0;
211 }
212
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
arch/arc/kernel/smp.c:279:18: sparse: sparse: dereference of noderef expression
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e6251ab4551f51fa4cee03523e08051898c3ce82
commit: e188f3330a13df904d77003846eafd3edf99009d ARC: cmpxchg/xchg: rewrite as macros to make type safe
date: 6 months ago
config: arc-randconfig-s032-20220209 (https://download.01.org/0day-ci/archive/20220209/202202091740.HWwIjRT0-lk...)
compiler: arc-elf-gcc (GCC) 11.2.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.4-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 e188f3330a13df904d77003846eafd3edf99009d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash arch/arc/kernel/
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 >>)
arch/arc/kernel/smp.c:264:48: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long [noderef] __percpu *ipi_data_ptr @@ got unsigned long * @@
arch/arc/kernel/smp.c:264:48: sparse: expected unsigned long [noderef] __percpu *ipi_data_ptr
arch/arc/kernel/smp.c:264:48: sparse: got unsigned long *
arch/arc/kernel/smp.c:279:18: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile *v @@ got unsigned long [noderef] __percpu *__ai_ptr @@
arch/arc/kernel/smp.c:279:18: sparse: expected void const volatile *v
arch/arc/kernel/smp.c:279:18: sparse: got unsigned long [noderef] __percpu *__ai_ptr
arch/arc/kernel/smp.c:277:29: sparse: sparse: cast removes address space '__percpu' of expression
arch/arc/kernel/smp.c:413:72: sparse: sparse: incorrect type in argument 4 (different address spaces) @@ expected void [noderef] __percpu *percpu_dev_id @@ got int *dev @@
arch/arc/kernel/smp.c:413:72: sparse: expected void [noderef] __percpu *percpu_dev_id
arch/arc/kernel/smp.c:413:72: sparse: got int *dev
>> arch/arc/kernel/smp.c:279:18: sparse: sparse: dereference of noderef expression
>> arch/arc/kernel/smp.c:279:18: sparse: sparse: dereference of noderef expression
vim +279 arch/arc/kernel/smp.c
41195d236e8445 Vineet Gupta 2013-01-18 261
ddf84433f411b6 Vineet Gupta 2013-11-25 262 static void ipi_send_msg_one(int cpu, enum ipi_msg_type msg)
41195d236e8445 Vineet Gupta 2013-01-18 263 {
f2a4aa5646687f Vineet Gupta 2013-11-26 264 unsigned long __percpu *ipi_data_ptr = per_cpu_ptr(&ipi_data, cpu);
d8e8c7dda11f5d Vineet Gupta 2013-11-28 265 unsigned long old, new;
41195d236e8445 Vineet Gupta 2013-01-18 266 unsigned long flags;
41195d236e8445 Vineet Gupta 2013-01-18 267
f2a4aa5646687f Vineet Gupta 2013-11-26 268 pr_debug("%d Sending msg [%d] to %d\n", smp_processor_id(), msg, cpu);
f2a4aa5646687f Vineet Gupta 2013-11-26 269
41195d236e8445 Vineet Gupta 2013-01-18 270 local_irq_save(flags);
41195d236e8445 Vineet Gupta 2013-01-18 271
d8e8c7dda11f5d Vineet Gupta 2013-11-28 272 /*
d8e8c7dda11f5d Vineet Gupta 2013-11-28 273 * Atomically write new msg bit (in case others are writing too),
d8e8c7dda11f5d Vineet Gupta 2013-11-28 274 * and read back old value
d8e8c7dda11f5d Vineet Gupta 2013-11-28 275 */
d8e8c7dda11f5d Vineet Gupta 2013-11-28 276 do {
6aa7de059173a9 Mark Rutland 2017-10-23 277 new = old = READ_ONCE(*ipi_data_ptr);
d8e8c7dda11f5d Vineet Gupta 2013-11-28 278 new |= 1U << msg;
d8e8c7dda11f5d Vineet Gupta 2013-11-28 @279 } while (cmpxchg(ipi_data_ptr, old, new) != old);
41195d236e8445 Vineet Gupta 2013-01-18 280
d8e8c7dda11f5d Vineet Gupta 2013-11-28 281 /*
d8e8c7dda11f5d Vineet Gupta 2013-11-28 282 * Call the platform specific IPI kick function, but avoid if possible:
d8e8c7dda11f5d Vineet Gupta 2013-11-28 283 * Only do so if there's no pending msg from other concurrent sender(s).
82a423053eb3cf Changcheng Deng 2021-08-14 284 * Otherwise, receiver will see this msg as well when it takes the
d8e8c7dda11f5d Vineet Gupta 2013-11-28 285 * IPI corresponding to that msg. This is true, even if it is already in
d8e8c7dda11f5d Vineet Gupta 2013-11-28 286 * IPI handler, because !@old means it has not yet dequeued the msg(s)
d8e8c7dda11f5d Vineet Gupta 2013-11-28 287 * so @new msg can be a free-loader
d8e8c7dda11f5d Vineet Gupta 2013-11-28 288 */
d8e8c7dda11f5d Vineet Gupta 2013-11-28 289 if (plat_smp_ops.ipi_send && !old)
ddf84433f411b6 Vineet Gupta 2013-11-25 290 plat_smp_ops.ipi_send(cpu);
41195d236e8445 Vineet Gupta 2013-01-18 291
41195d236e8445 Vineet Gupta 2013-01-18 292 local_irq_restore(flags);
41195d236e8445 Vineet Gupta 2013-01-18 293 }
41195d236e8445 Vineet Gupta 2013-01-18 294
:::::: The code at line 279 was first introduced by commit
:::::: d8e8c7dda11f5d5cf90495f2e89d917a83509bc0 ARC: [SMP] optimize IPI send and receive
:::::: TO: Vineet Gupta <vgupta(a)synopsys.com>
:::::: CC: Vineet Gupta <vgupta(a)synopsys.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[linux-next:master 2876/4656] arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 10207e3a840b47b5eae573486a88fb6e29884f77
commit: f982d9b7c628388dae73b723cc2302cbd091cab5 [2876/4656] arc: remove set_fs()
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220209/202202091707.w4yhaEQx-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.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.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout f982d9b7c628388dae73b723cc2302cbd091cab5
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash drivers/tty/ipwireless/
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/tty/ipwireless/tty.c: note: in included file (through include/linux/uaccess.h, include/linux/sched/task.h, include/linux/sched/signal.h, ...):
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
--
drivers/tty/ipwireless/network.c: note: in included file (through include/linux/uaccess.h, include/linux/sched/task.h, include/linux/sched/signal.h, ...):
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
>> arch/arc/include/asm/uaccess.h:42:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned long addr @@
arch/arc/include/asm/uaccess.h:42:24: sparse: expected void const volatile [noderef] __user *ptr
arch/arc/include/asm/uaccess.h:42:24: sparse: got unsigned long addr
vim +42 arch/arc/include/asm/uaccess.h
25
26 /*
27 * Algorithmically, for __access_ok() we want do:
28 * (start < TASK_SIZE) && (start+len < TASK_SIZE)
29 *
30 * This can however be rewritten as follows:
31 * (len <= TASK_SIZE) && (start+len < TASK_SIZE)
32 *
33 * Because it essentially checks if buffer end is within limit and @len is
34 * non-ngeative, which implies that buffer start will be within limit too.
35 *
36 * The reason for rewriting being, for majority of cases, @len is generally
37 * compile time constant, causing first sub-expression to be compile time
38 * subsumed.
39 */
40 static inline int __access_ok(unsigned long addr, unsigned long size)
41 {
> 42 __chk_user_ptr(addr);
43 return size <= TASK_SIZE && addr <= TASK_SIZE - size;
44 }
45
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[mtd:spi-mem-ecc 14/29] drivers/mtd/nand/ecc-mxic.c:548 mxic_ecc_prepare_io_req_external() error: uninitialized symbol 'ret'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-mem-ecc
head: d6986e74ec6ee6a48ce9ee1d8051b2988d747558
commit: cfe5cf69e97267e9d1de65cc894b7a2310644a15 [14/29] mtd: nand: mxic-ecc: Add Macronix external ECC engine support
config: x86_64-randconfig-m001-20220207 (https://download.01.org/0day-ci/archive/20220209/202202090415.SS8TwwHj-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/mtd/nand/ecc-mxic.c:548 mxic_ecc_prepare_io_req_external() error: uninitialized symbol 'ret'.
vim +/ret +548 drivers/mtd/nand/ecc-mxic.c
cfe5cf69e97267 Miquel Raynal 2021-12-16 494 static int mxic_ecc_prepare_io_req_external(struct nand_device *nand,
cfe5cf69e97267 Miquel Raynal 2021-12-16 495 struct nand_page_io_req *req)
cfe5cf69e97267 Miquel Raynal 2021-12-16 496 {
cfe5cf69e97267 Miquel Raynal 2021-12-16 497 struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
cfe5cf69e97267 Miquel Raynal 2021-12-16 498 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
cfe5cf69e97267 Miquel Raynal 2021-12-16 499 struct mtd_info *mtd = nanddev_to_mtd(nand);
cfe5cf69e97267 Miquel Raynal 2021-12-16 500 int offset, nents, step, ret;
cfe5cf69e97267 Miquel Raynal 2021-12-16 501
cfe5cf69e97267 Miquel Raynal 2021-12-16 502 if (req->mode == MTD_OPS_RAW)
cfe5cf69e97267 Miquel Raynal 2021-12-16 503 return 0;
cfe5cf69e97267 Miquel Raynal 2021-12-16 504
cfe5cf69e97267 Miquel Raynal 2021-12-16 505 nand_ecc_tweak_req(&ctx->req_ctx, req);
cfe5cf69e97267 Miquel Raynal 2021-12-16 506 ctx->req = req;
cfe5cf69e97267 Miquel Raynal 2021-12-16 507
cfe5cf69e97267 Miquel Raynal 2021-12-16 508 if (req->type == NAND_PAGE_READ)
cfe5cf69e97267 Miquel Raynal 2021-12-16 509 return 0;
cfe5cf69e97267 Miquel Raynal 2021-12-16 510
cfe5cf69e97267 Miquel Raynal 2021-12-16 511 mxic_ecc_add_room_in_oobbuf(ctx, ctx->oobwithstat,
cfe5cf69e97267 Miquel Raynal 2021-12-16 512 ctx->req->oobbuf.out);
cfe5cf69e97267 Miquel Raynal 2021-12-16 513
cfe5cf69e97267 Miquel Raynal 2021-12-16 514 sg_set_buf(&ctx->sg[0], req->databuf.out, req->datalen);
cfe5cf69e97267 Miquel Raynal 2021-12-16 515 sg_set_buf(&ctx->sg[1], ctx->oobwithstat,
cfe5cf69e97267 Miquel Raynal 2021-12-16 516 req->ooblen + (ctx->steps * STAT_BYTES));
cfe5cf69e97267 Miquel Raynal 2021-12-16 517
cfe5cf69e97267 Miquel Raynal 2021-12-16 518 nents = dma_map_sg(mxic->dev, ctx->sg, 2, DMA_BIDIRECTIONAL);
cfe5cf69e97267 Miquel Raynal 2021-12-16 519 if (!nents)
cfe5cf69e97267 Miquel Raynal 2021-12-16 520 return -EINVAL;
cfe5cf69e97267 Miquel Raynal 2021-12-16 521
cfe5cf69e97267 Miquel Raynal 2021-12-16 522 mutex_lock(&mxic->lock);
cfe5cf69e97267 Miquel Raynal 2021-12-16 523
cfe5cf69e97267 Miquel Raynal 2021-12-16 524 for (step = 0; step < ctx->steps; step++) {
cfe5cf69e97267 Miquel Raynal 2021-12-16 525 writel(sg_dma_address(&ctx->sg[0]) + (step * ctx->data_step_sz),
cfe5cf69e97267 Miquel Raynal 2021-12-16 526 mxic->regs + SDMA_MAIN_ADDR);
cfe5cf69e97267 Miquel Raynal 2021-12-16 527 writel(sg_dma_address(&ctx->sg[1]) + (step * (ctx->oob_step_sz + STAT_BYTES)),
cfe5cf69e97267 Miquel Raynal 2021-12-16 528 mxic->regs + SDMA_SPARE_ADDR);
cfe5cf69e97267 Miquel Raynal 2021-12-16 529 ret = mxic_ecc_process_data(mxic, ctx->req->type);
cfe5cf69e97267 Miquel Raynal 2021-12-16 530 if (ret)
cfe5cf69e97267 Miquel Raynal 2021-12-16 531 break;
cfe5cf69e97267 Miquel Raynal 2021-12-16 532 }
cfe5cf69e97267 Miquel Raynal 2021-12-16 533
cfe5cf69e97267 Miquel Raynal 2021-12-16 534 mutex_unlock(&mxic->lock);
cfe5cf69e97267 Miquel Raynal 2021-12-16 535
cfe5cf69e97267 Miquel Raynal 2021-12-16 536 dma_unmap_sg(mxic->dev, ctx->sg, 2, DMA_BIDIRECTIONAL);
cfe5cf69e97267 Miquel Raynal 2021-12-16 537
Smatch is complaining that ctx->steps might be zero. I should probably
try to silence that kind of warning if the cross function DB has not
been built. It tends to have false positives.
But shouldn't we have an if (ret) return ret; after this dma_unmap_sg()?
Can we really retrieve the calculated ECC bytes when processing the data
failed?
cfe5cf69e97267 Miquel Raynal 2021-12-16 538 /* Retrieve the calculated ECC bytes */
cfe5cf69e97267 Miquel Raynal 2021-12-16 539 for (step = 0; step < ctx->steps; step++) {
cfe5cf69e97267 Miquel Raynal 2021-12-16 540 offset = ctx->meta_sz + (step * ctx->oob_step_sz);
cfe5cf69e97267 Miquel Raynal 2021-12-16 541 mtd_ooblayout_get_eccbytes(mtd,
cfe5cf69e97267 Miquel Raynal 2021-12-16 542 (u8 *)ctx->req->oobbuf.out + offset,
cfe5cf69e97267 Miquel Raynal 2021-12-16 543 ctx->oobwithstat + (step * STAT_BYTES),
cfe5cf69e97267 Miquel Raynal 2021-12-16 544 step * ctx->parity_sz,
cfe5cf69e97267 Miquel Raynal 2021-12-16 545 ctx->parity_sz);
cfe5cf69e97267 Miquel Raynal 2021-12-16 546 }
cfe5cf69e97267 Miquel Raynal 2021-12-16 547
cfe5cf69e97267 Miquel Raynal 2021-12-16 @548 return ret;
cfe5cf69e97267 Miquel Raynal 2021-12-16 549 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week