include/linux/spinlock.h:346:2: error: invalid type argument of unary (have 'spinlock_t' {aka 'struct spinlock'})
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fc4f28bb3daf3265d6bc5f73b497306985bb23ab
commit: de8f5e4f2dc1f032b46afda0a78cab5456974f89 lockdep: Introduce wait-type checks
date: 6 months ago
config: mips-randconfig-r011-20200916 (attached as .config)
compiler: mipsel-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
git checkout de8f5e4f2dc1f032b46afda0a78cab5456974f89
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
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 >>):
In file included from drivers/pcmcia/vrc4173_cardu.c:41:
drivers/pcmcia/vrc4173_cardu.h:239:2: error: unknown type name 'socket_cap_t'
239 | socket_cap_t cap;
| ^~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:51:30: error: conflicting types for 'pcmcia_register_socket'
51 | extern struct socket_info_t *pcmcia_register_socket (int slot,
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/pcmcia/vrc4173_cardu.c:39:
include/pcmcia/ss.h:259:12: note: previous declaration of 'pcmcia_register_socket' was here
259 | extern int pcmcia_register_socket(struct pcmcia_socket *socket);
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:54:13: error: conflicting types for 'pcmcia_unregister_socket'
54 | extern void pcmcia_unregister_socket(struct socket_info_t *s);
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/pcmcia/vrc4173_cardu.c:39:
include/pcmcia/ss.h:260:13: note: previous declaration of 'pcmcia_unregister_socket' was here
260 | extern void pcmcia_unregister_socket(struct pcmcia_socket *socket);
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c: In function 'cardu_init':
drivers/pcmcia/vrc4173_cardu.c:131:13: error: request for member 'features' in something not a structure or union
131 | socket->cap.features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS;
| ^
drivers/pcmcia/vrc4173_cardu.c:132:13: error: request for member 'irq_mask' in something not a structure or union
132 | socket->cap.irq_mask = 0;
| ^
drivers/pcmcia/vrc4173_cardu.c:133:13: error: request for member 'map_size' in something not a structure or union
133 | socket->cap.map_size = 0x1000;
| ^
drivers/pcmcia/vrc4173_cardu.c:134:13: error: request for member 'pci_irq' in something not a structure or union
134 | socket->cap.pci_irq = socket->dev->irq;
| ^
In file included from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/pcmcia/vrc4173_cardu.c:32:
drivers/pcmcia/vrc4173_cardu.c:136:23: error: incompatible type for argument 1 of 'spinlock_check'
136 | spin_lock_init(socket->event_lock);
| ~~~~~~^~~~~~~~~~~~
| |
| spinlock_t {aka struct spinlock}
include/linux/spinlock.h:345:17: note: in definition of macro 'spin_lock_init'
345 | spinlock_check(_lock); \
| ^~~~~
include/linux/spinlock.h:326:67: note: expected 'spinlock_t *' {aka 'struct spinlock *'} but argument is of type 'spinlock_t' {aka 'struct spinlock'}
326 | static __always_inline raw_spinlock_t *spinlock_check(spinlock_t *lock)
| ~~~~~~~~~~~~^~~~
>> include/linux/spinlock.h:346:2: error: invalid type argument of unary '*' (have 'spinlock_t' {aka 'struct spinlock'})
346 | *(_lock) = __SPIN_LOCK_UNLOCKED(_lock); \
| ^~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:136:2: note: in expansion of macro 'spin_lock_init'
136 | spin_lock_init(socket->event_lock);
| ^~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c: At top level:
drivers/pcmcia/vrc4173_cardu.c:156:52: error: unknown type name 'socket_cap_t'; did you mean 'socket_state_t'?
156 | static int cardu_inquire_socket(unsigned int sock, socket_cap_t *cap)
| ^~~~~~~~~~~~
| socket_state_t
drivers/pcmcia/vrc4173_cardu.c: In function 'cardu_get_mem_map':
drivers/pcmcia/vrc4173_cardu.c:333:5: error: 'struct pccard_mem_map' has no member named 'sys_start'
333 | mem->sys_start = start + page;
| ^~
drivers/pcmcia/vrc4173_cardu.c:334:5: error: 'struct pccard_mem_map' has no member named 'sys_stop'
334 | mem->sys_stop = start + page;
| ^~
drivers/pcmcia/vrc4173_cardu.c: In function 'cardu_set_mem_map':
drivers/pcmcia/vrc4173_cardu.c:348:17: error: 'struct pccard_mem_map' has no member named 'sys_start'
348 | sys_start = mem->sys_start;
| ^~
drivers/pcmcia/vrc4173_cardu.c:349:16: error: 'struct pccard_mem_map' has no member named 'sys_stop'
349 | sys_stop = mem->sys_stop;
| ^~
drivers/pcmcia/vrc4173_cardu.c: At top level:
drivers/pcmcia/vrc4173_cardu.c:388:12: error: initialization of 'int (*)(struct pcmcia_socket *)' from incompatible pointer type 'int (*)(unsigned int)' [-Werror=incompatible-pointer-types]
388 | .init = cardu_init,
| ^~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:388:12: note: (near initialization for 'cardu_operations.init')
drivers/pcmcia/vrc4173_cardu.c:389:3: error: 'struct pccard_operations' has no member named 'register_callback'
389 | .register_callback = cardu_register_callback,
| ^~~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:389:23: error: initialization of 'int (*)(struct pcmcia_socket *)' from incompatible pointer type 'int (*)(unsigned int, void (*)(void *, unsigned int), void *)' [-Werror=incompatible-pointer-types]
389 | .register_callback = cardu_register_callback,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:389:23: note: (near initialization for 'cardu_operations.suspend')
drivers/pcmcia/vrc4173_cardu.c:390:3: error: 'struct pccard_operations' has no member named 'inquire_socket'
390 | .inquire_socket = cardu_inquire_socket,
| ^~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:390:21: error: 'cardu_inquire_socket' undeclared here (not in a function); did you mean 'cardu_set_socket'?
390 | .inquire_socket = cardu_inquire_socket,
| ^~~~~~~~~~~~~~~~~~~~
| cardu_set_socket
drivers/pcmcia/vrc4173_cardu.c:391:17: error: initialization of 'int (*)(struct pcmcia_socket *, u_int *)' {aka 'int (*)(struct pcmcia_socket *, unsigned int *)'} from incompatible pointer type 'int (*)(unsigned int, u_int *)' {aka 'int (*)(unsigned int, unsigned int *)'} [-Werror=incompatible-pointer-types]
391 | .get_status = cardu_get_status,
| ^~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:391:17: note: (near initialization for 'cardu_operations.get_status')
drivers/pcmcia/vrc4173_cardu.c:392:17: error: initialization of 'int (*)(struct pcmcia_socket *, socket_state_t *)' {aka 'int (*)(struct pcmcia_socket *, struct socket_state_t *)'} from incompatible pointer type 'int (*)(unsigned int, socket_state_t *)' {aka 'int (*)(unsigned int, struct socket_state_t *)'} [-Werror=incompatible-pointer-types]
392 | .set_socket = cardu_set_socket,
| ^~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:392:17: note: (near initialization for 'cardu_operations.set_socket')
drivers/pcmcia/vrc4173_cardu.c:393:3: error: 'struct pccard_operations' has no member named 'get_io_map'; did you mean 'set_io_map'?
393 | .get_io_map = cardu_get_io_map,
| ^~~~~~~~~~
| set_io_map
drivers/pcmcia/vrc4173_cardu.c:393:17: error: initialization of 'int (*)(struct pcmcia_socket *, struct pccard_io_map *)' from incompatible pointer type 'int (*)(unsigned int, struct pccard_io_map *)' [-Werror=incompatible-pointer-types]
393 | .get_io_map = cardu_get_io_map,
| ^~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:393:17: note: (near initialization for 'cardu_operations.set_io_map')
drivers/pcmcia/vrc4173_cardu.c:394:17: error: initialization of 'int (*)(struct pcmcia_socket *, struct pccard_io_map *)' from incompatible pointer type 'int (*)(unsigned int, struct pccard_io_map *)' [-Werror=incompatible-pointer-types]
394 | .set_io_map = cardu_set_io_map,
| ^~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:394:17: note: (near initialization for 'cardu_operations.set_io_map')
drivers/pcmcia/vrc4173_cardu.c:394:17: warning: initialized field overwritten [-Woverride-init]
drivers/pcmcia/vrc4173_cardu.c:394:17: note: (near initialization for 'cardu_operations.set_io_map')
drivers/pcmcia/vrc4173_cardu.c:395:3: error: 'struct pccard_operations' has no member named 'get_mem_map'; did you mean 'set_mem_map'?
395 | .get_mem_map = cardu_get_mem_map,
| ^~~~~~~~~~~
| set_mem_map
drivers/pcmcia/vrc4173_cardu.c:395:18: error: initialization of 'int (*)(struct pcmcia_socket *, struct pccard_mem_map *)' from incompatible pointer type 'int (*)(unsigned int, struct pccard_mem_map *)' [-Werror=incompatible-pointer-types]
395 | .get_mem_map = cardu_get_mem_map,
| ^~~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:395:18: note: (near initialization for 'cardu_operations.set_mem_map')
drivers/pcmcia/vrc4173_cardu.c:396:18: error: initialization of 'int (*)(struct pcmcia_socket *, struct pccard_mem_map *)' from incompatible pointer type 'int (*)(unsigned int, struct pccard_mem_map *)' [-Werror=incompatible-pointer-types]
396 | .set_mem_map = cardu_set_mem_map,
| ^~~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:396:18: note: (near initialization for 'cardu_operations.set_mem_map')
drivers/pcmcia/vrc4173_cardu.c:396:18: warning: initialized field overwritten [-Woverride-init]
drivers/pcmcia/vrc4173_cardu.c:396:18: note: (near initialization for 'cardu_operations.set_mem_map')
drivers/pcmcia/vrc4173_cardu.c:397:3: error: 'struct pccard_operations' has no member named 'proc_setup'
397 | .proc_setup = cardu_proc_setup,
| ^~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:397:17: warning: excess elements in struct initializer
397 | .proc_setup = cardu_proc_setup,
| ^~~~~~~~~~~~~~~~
drivers/pcmcia/vrc4173_cardu.c:397:17: note: (near initialization for 'cardu_operations')
drivers/pcmcia/vrc4173_cardu.c: In function 'cardu_interrupt':
drivers/pcmcia/vrc4173_cardu.c:448:46: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
448 | INIT_WORK(&socket->tq_work, cardu_bh, socket);
| ^
In file included from include/linux/mm_types.h:16,
from include/linux/mmzone.h:21,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:16,
from drivers/pcmcia/vrc4173_cardu.c:32:
include/linux/workqueue.h:249: note: macro "INIT_WORK" defined here
249 | #define INIT_WORK(_work, _func) \
|
# 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 de8f5e4f2dc1f032b46afda0a78cab5456974f89
vim +346 include/linux/spinlock.h
342
343 # define spin_lock_init(_lock) \
344 do { \
345 spinlock_check(_lock); \
> 346 *(_lock) = __SPIN_LOCK_UNLOCKED(_lock); \
347 } while (0)
348
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 5 months
Re: [PATCH v6 2/6] drivers: mfd: Add a driver for iEi WT61P803 PUZZLE MCU
by kernel test robot
Hi Luka,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on hwmon/hwmon-next]
[also build test WARNING on v5.9]
[cannot apply to pavel-linux-leds/for-next lee-mfd/for-mfd-next next-20201016]
[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/Luka-Kovacic/Add-support-for-the...
base: https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: ia64-randconfig-r002-20201020 (attached as .config)
compiler: ia64-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://github.com/0day-ci/linux/commit/855e7cca9db335136d09555f9983d7245...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Luka-Kovacic/Add-support-for-the-iEi-WT61P803-PUZZLE-MCU/20201020-062048
git checkout 855e7cca9db335136d09555f9983d7245fca1f4b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
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/mfd/iei-wt61p803-puzzle.c:311:5: warning: no previous prototype for 'iei_wt61p803_puzzle_buzzer' [-Wmissing-prototypes]
311 | int iei_wt61p803_puzzle_buzzer(struct iei_wt61p803_puzzle *mcu, bool long_beep)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/iei_wt61p803_puzzle_buzzer +311 drivers/mfd/iei-wt61p803-puzzle.c
310
> 311 int iei_wt61p803_puzzle_buzzer(struct iei_wt61p803_puzzle *mcu, bool long_beep)
312 {
313 unsigned char *resp_buf = mcu->response_buffer;
314 unsigned char buzzer_cmd[4] = {};
315 size_t reply_size = 0;
316 int ret;
317
318 buzzer_cmd[0] = IEI_WT61P803_PUZZLE_CMD_HEADER_START;
319 buzzer_cmd[1] = IEI_WT61P803_PUZZLE_CMD_FUNCTION_SINGLE;
320 buzzer_cmd[2] = long_beep ? '3' : '2'; /* Buzzer 1.5 / 0.5 second beep */
321
322 mutex_lock(&mcu->lock);
323 ret = iei_wt61p803_puzzle_write_command(mcu, buzzer_cmd, sizeof(buzzer_cmd),
324 resp_buf, &reply_size);
325 if (ret)
326 goto exit;
327
328 if (reply_size != 3) {
329 ret = -EIO;
330 goto exit;
331 }
332
333 if (!(resp_buf[0] == IEI_WT61P803_PUZZLE_CMD_HEADER_START &&
334 resp_buf[1] == IEI_WT61P803_PUZZLE_CMD_RESPONSE_OK &&
335 resp_buf[2] == IEI_WT61P803_PUZZLE_CHECKSUM_RESPONSE_OK)) {
336 ret = -EPROTO;
337 goto exit;
338 }
339 exit:
340 mutex_unlock(&mcu->lock);
341 return ret;
342 }
343
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
arch/powerpc/lib/sstep.c:1172:21: error: variable 'suffix' set but not used
by kernel test robot
Hi Jordan,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c2dc4c073fb71b50904493657a7622b481b346e3
commit: 650b55b707fdfa764e9f2b81314d3eb4216fb962 powerpc: Add prefixed instructions to instruction data type
date: 6 months ago
config: powerpc-allnoconfig (attached as .config)
compiler: powerpc-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/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 650b55b707fdfa764e9f2b81314d3eb4216fb962
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>):
arch/powerpc/lib/sstep.c: In function 'analyse_instr':
>> arch/powerpc/lib/sstep.c:1172:21: error: variable 'suffix' set but not used [-Werror=unused-but-set-variable]
1172 | unsigned int word, suffix;
| ^~~~~~
arch/powerpc/lib/sstep.c:1168:31: error: variable 'rc' set but not used [-Werror=unused-but-set-variable]
1168 | unsigned int opcode, ra, rb, rc, rd, spr, u;
| ^~
cc1: all warnings being treated as errors
vim +/suffix +1172 arch/powerpc/lib/sstep.c
1153
1154 /*
1155 * Decode an instruction, and return information about it in *op
1156 * without changing *regs.
1157 * Integer arithmetic and logical instructions, branches, and barrier
1158 * instructions can be emulated just using the information in *op.
1159 *
1160 * Return value is 1 if the instruction can be emulated just by
1161 * updating *regs with the information in *op, -1 if we need the
1162 * GPRs but *regs doesn't contain the full register set, or 0
1163 * otherwise.
1164 */
1165 int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
1166 struct ppc_inst instr)
1167 {
1168 unsigned int opcode, ra, rb, rc, rd, spr, u;
1169 unsigned long int imm;
1170 unsigned long int val, val2;
1171 unsigned int mb, me, sh;
> 1172 unsigned int word, suffix;
1173 long ival;
1174
1175 word = ppc_inst_val(instr);
1176 suffix = ppc_inst_suffix(instr);
1177
1178 op->type = COMPUTE;
1179
1180 opcode = ppc_inst_primary_opcode(instr);
1181 switch (opcode) {
1182 case 16: /* bc */
1183 op->type = BRANCH;
1184 imm = (signed short)(word & 0xfffc);
1185 if ((word & 2) == 0)
1186 imm += regs->nip;
1187 op->val = truncate_if_32bit(regs->msr, imm);
1188 if (word & 1)
1189 op->type |= SETLK;
1190 if (branch_taken(word, regs, op))
1191 op->type |= BRTAKEN;
1192 return 1;
1193 #ifdef CONFIG_PPC64
1194 case 17: /* sc */
1195 if ((word & 0xfe2) == 2)
1196 op->type = SYSCALL;
1197 else
1198 op->type = UNKNOWN;
1199 return 0;
1200 #endif
1201 case 18: /* b */
1202 op->type = BRANCH | BRTAKEN;
1203 imm = word & 0x03fffffc;
1204 if (imm & 0x02000000)
1205 imm -= 0x04000000;
1206 if ((word & 2) == 0)
1207 imm += regs->nip;
1208 op->val = truncate_if_32bit(regs->msr, imm);
1209 if (word & 1)
1210 op->type |= SETLK;
1211 return 1;
1212 case 19:
1213 switch ((word >> 1) & 0x3ff) {
1214 case 0: /* mcrf */
1215 op->type = COMPUTE + SETCC;
1216 rd = 7 - ((word >> 23) & 0x7);
1217 ra = 7 - ((word >> 18) & 0x7);
1218 rd *= 4;
1219 ra *= 4;
1220 val = (regs->ccr >> ra) & 0xf;
1221 op->ccval = (regs->ccr & ~(0xfUL << rd)) | (val << rd);
1222 return 1;
1223
1224 case 16: /* bclr */
1225 case 528: /* bcctr */
1226 op->type = BRANCH;
1227 imm = (word & 0x400)? regs->ctr: regs->link;
1228 op->val = truncate_if_32bit(regs->msr, imm);
1229 if (word & 1)
1230 op->type |= SETLK;
1231 if (branch_taken(word, regs, op))
1232 op->type |= BRTAKEN;
1233 return 1;
1234
1235 case 18: /* rfid, scary */
1236 if (regs->msr & MSR_PR)
1237 goto priv;
1238 op->type = RFI;
1239 return 0;
1240
1241 case 150: /* isync */
1242 op->type = BARRIER | BARRIER_ISYNC;
1243 return 1;
1244
1245 case 33: /* crnor */
1246 case 129: /* crandc */
1247 case 193: /* crxor */
1248 case 225: /* crnand */
1249 case 257: /* crand */
1250 case 289: /* creqv */
1251 case 417: /* crorc */
1252 case 449: /* cror */
1253 op->type = COMPUTE + SETCC;
1254 ra = (word >> 16) & 0x1f;
1255 rb = (word >> 11) & 0x1f;
1256 rd = (word >> 21) & 0x1f;
1257 ra = (regs->ccr >> (31 - ra)) & 1;
1258 rb = (regs->ccr >> (31 - rb)) & 1;
1259 val = (word >> (6 + ra * 2 + rb)) & 1;
1260 op->ccval = (regs->ccr & ~(1UL << (31 - rd))) |
1261 (val << (31 - rd));
1262 return 1;
1263 }
1264 break;
1265 case 31:
1266 switch ((word >> 1) & 0x3ff) {
1267 case 598: /* sync */
1268 op->type = BARRIER + BARRIER_SYNC;
1269 #ifdef __powerpc64__
1270 switch ((word >> 21) & 3) {
1271 case 1: /* lwsync */
1272 op->type = BARRIER + BARRIER_LWSYNC;
1273 break;
1274 case 2: /* ptesync */
1275 op->type = BARRIER + BARRIER_PTESYNC;
1276 break;
1277 }
1278 #endif
1279 return 1;
1280
1281 case 854: /* eieio */
1282 op->type = BARRIER + BARRIER_EIEIO;
1283 return 1;
1284 }
1285 break;
1286 }
1287
1288 /* Following cases refer to regs->gpr[], so we need all regs */
1289 if (!FULL_REGS(regs))
1290 return -1;
1291
1292 rd = (word >> 21) & 0x1f;
1293 ra = (word >> 16) & 0x1f;
1294 rb = (word >> 11) & 0x1f;
1295 rc = (word >> 6) & 0x1f;
1296
1297 switch (opcode) {
1298 #ifdef __powerpc64__
1299 case 2: /* tdi */
1300 if (rd & trap_compare(regs->gpr[ra], (short) word))
1301 goto trap;
1302 return 1;
1303 #endif
1304 case 3: /* twi */
1305 if (rd & trap_compare((int)regs->gpr[ra], (short) word))
1306 goto trap;
1307 return 1;
1308
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[RFC PATCH] bpf: bpf_get_current_task_btf_proto can be static
by kernel test robot
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
bpf_trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 7b48aa1c695ab8..e4515b0f62a8d3 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -1029,7 +1029,7 @@ BPF_CALL_0(bpf_get_current_task_btf)
BTF_ID_LIST_SINGLE(bpf_get_current_btf_ids, struct, task_struct)
-const struct bpf_func_proto bpf_get_current_task_btf_proto = {
+static const struct bpf_func_proto bpf_get_current_task_btf_proto = {
.func = bpf_get_current_task_btf,
.gpl_only = true,
.ret_type = RET_PTR_TO_BTF_ID,
1 year, 6 months
[linux-platform-drivers-x86:for-next 2/7] drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used
by kernel test robot
tree: git://git.infradead.org/linux-platform-drivers-x86 for-next
head: e8a60aa7404bfef37705da5607c97737073ac38d
commit: f23027ca3d48b6f93c5994069fb25b73539fdf34 [2/7] platform/surface: Move Surface 3 WMI driver to platform/surface
config: i386-randconfig-r004-20201031 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git remote add linux-platform-drivers-x86 git://git.infradead.org/linux-platform-drivers-x86
git fetch --no-tags linux-platform-drivers-x86 for-next
git checkout f23027ca3d48b6f93c5994069fb25b73539fdf34
# 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/platform/surface/surface3-wmi.c: In function 's3_wmi_query_block':
>> drivers/platform/surface/surface3-wmi.c:60:14: warning: variable 'status' set but not used [-Wunused-but-set-variable]
60 | acpi_status status;
| ^~~~~~
vim +/status +60 drivers/platform/surface/surface3-wmi.c
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 56
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 57 static int s3_wmi_query_block(const char *guid, int instance, int *ret)
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 58 {
83da6b59919a71a drivers/platform/x86/surface3-wmi.c Andy Shevchenko 2016-12-15 59 struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 @60 acpi_status status;
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 61 union acpi_object *obj;
83da6b59919a71a drivers/platform/x86/surface3-wmi.c Andy Shevchenko 2016-12-15 62 int error = 0;
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 63
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 64 mutex_lock(&s3_wmi_lock);
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 65 status = wmi_query_block(guid, instance, &output);
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 66
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 67 obj = output.pointer;
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 68
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 69 if (!obj || obj->type != ACPI_TYPE_INTEGER) {
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 70 if (obj) {
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 71 pr_err("query block returned object type: %d - buffer length:%d\n",
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 72 obj->type,
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 73 obj->type == ACPI_TYPE_BUFFER ?
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 74 obj->buffer.length : 0);
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 75 }
83da6b59919a71a drivers/platform/x86/surface3-wmi.c Andy Shevchenko 2016-12-15 76 error = -EINVAL;
83da6b59919a71a drivers/platform/x86/surface3-wmi.c Andy Shevchenko 2016-12-15 77 goto out_free_unlock;
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 78 }
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 79 *ret = obj->integer.value;
83da6b59919a71a drivers/platform/x86/surface3-wmi.c Andy Shevchenko 2016-12-15 80 out_free_unlock:
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 81 kfree(obj);
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 82 mutex_unlock(&s3_wmi_lock);
83da6b59919a71a drivers/platform/x86/surface3-wmi.c Andy Shevchenko 2016-12-15 83 return error;
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 84 }
3dda3b3798f96d2 drivers/platform/x86/surface3-wmi.c Benjamin Tissoires 2016-11-25 85
:::::: The code at line 60 was first introduced by commit
:::::: 3dda3b3798f96d2974b5f60811142d3e25547807 platform/x86: Add custom surface3 platform device for controlling LID
:::::: TO: Benjamin Tissoires <benjamin.tissoires(a)redhat.com>
:::::: CC: Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[linux-next:master 2035/2472] include/asm-generic/barrier.h:78:18: error: implicit declaration of function 'barrier'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 4e78c578cb987725eef1cec7d11b6437109e9a49
commit: b9de06783f01100a2d2fb2864e6f2a802b7bc57f [2035/2472] compiler.h: fix barrier_data() on clang
config: alpha-defconfig (attached as .config)
compiler: alpha-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/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 b9de06783f01100a2d2fb2864e6f2a802b7bc57f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
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 >>):
In file included from arch/alpha/include/asm/barrier.h:21,
from arch/alpha/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/dcache.h:5,
from fs/nfs/export.c:7:
arch/alpha/include/asm/atomic.h: In function 'atomic_add_return_relaxed':
>> include/asm-generic/barrier.h:78:18: error: implicit declaration of function 'barrier' [-Werror=implicit-function-declaration]
78 | #define smp_mb() barrier()
| ^~~~~~~
arch/alpha/include/asm/atomic.h:72:2: note: in expansion of macro 'smp_mb'
72 | smp_mb(); \
| ^~~~~~
arch/alpha/include/asm/atomic.h:149:2: note: in expansion of macro 'ATOMIC_OP_RETURN'
149 | ATOMIC_OP_RETURN(op, op##l) \
| ^~~~~~~~~~~~~~~~
arch/alpha/include/asm/atomic.h:155:1: note: in expansion of macro 'ATOMIC_OPS'
155 | ATOMIC_OPS(add)
| ^~~~~~~~~~
cc1: some warnings being treated as errors
vim +/barrier +78 include/asm-generic/barrier.h
0890a264794f33d Linus Torvalds 2015-07-01 76
470c27e4695add2 Vineet Gupta 2015-03-11 77 #ifndef smp_mb
885df91ca3571af David Howells 2012-03-28 @78 #define smp_mb() barrier()
470c27e4695add2 Vineet Gupta 2015-03-11 79 #endif
470c27e4695add2 Vineet Gupta 2015-03-11 80
:::::: The code at line 78 was first introduced by commit
:::::: 885df91ca3571afd4b3f50f3391329bbf3c9e262 Create asm-generic/barrier.h
:::::: TO: David Howells <dhowells(a)redhat.com>
:::::: CC: David Howells <dhowells(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[trace:ftrace/core 15/17] ERROR: modpost: "ftrace_record_recursion" undefined!
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git ftrace/core
head: f0279affc4bc1999205f517ebfda328c45d295f3
commit: 9cbc281de34f27eb98b86616b8c27f5596572e22 [15/17] ftrace: Add recording of functions that caused recursion
config: sh-allmodconfig (attached as .config)
compiler: sh4-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/rostedt/linux-trace.git/c...
git remote add trace https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
git fetch --no-tags trace ftrace/core
git checkout 9cbc281de34f27eb98b86616b8c27f5596572e22
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
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 >>, old ones prefixed by <<):
ERROR: modpost: "clk_set_min_rate" [sound/soc/atmel/snd-soc-mchp-spdifrx.ko] undefined!
ERROR: modpost: "scp_get_venc_hw_capa" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "scp_ipi_send" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "scp_put" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "scp_get" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "scp_get_vdec_hw_capa" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "scp_ipi_register" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "scp_mapping_dm_addr" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "scp_get_rproc" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "rproc_boot" [drivers/media/platform/mtk-vcodec/mtk-vcodec-common.ko] undefined!
ERROR: modpost: "__delay" [drivers/net/mdio/mdio-cavium.ko] undefined!
>> ERROR: modpost: "ftrace_record_recursion" [fs/pstore/pstore.ko] undefined!
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[linux-rt-devel:linux-5.10.y-rt-rebase 57/209] kernel/printk/printk.c:2677:50: error: 'prb' undeclared
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.10.y-rt-rebase
head: 87b7b3d2cb296950a0e3005406899ccfbbc9da7c
commit: ca4fcaa60de914c0ef6864983a8488bf5ab6cafb [57/209] printk: move console printing to kthreads
config: ia64-allnoconfig (attached as .config)
compiler: ia64-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/rt/linux-rt-devel.git/com...
git remote add linux-rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
git fetch --no-tags linux-rt-devel linux-5.10.y-rt-rebase
git checkout ca4fcaa60de914c0ef6864983a8488bf5ab6cafb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
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 >>):
In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/pgtable.h:6,
from include/linux/mm.h:33,
from kernel/printk/printk.c:23:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
137 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
In file included from kernel/printk/printk.c:63:
kernel/printk/internal.h: At top level:
kernel/printk/internal.h:56:20: warning: no previous prototype for 'vprintk_func' [-Wmissing-prototypes]
56 | __printf(1, 0) int vprintk_func(const char *fmt, va_list args) { return 0; }
| ^~~~~~~~~~~~
kernel/printk/printk.c:180:5: warning: no previous prototype for 'devkmsg_sysctl_set_loglvl' [-Wmissing-prototypes]
180 | int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./arch/ia64/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:232,
from include/linux/kernel.h:11,
from kernel/printk/printk.c:22:
kernel/printk/printk.c: In function 'register_console':
>> kernel/printk/printk.c:2677:50: error: 'prb' undeclared (first use in this function)
2677 | atomic64_set(&newcon->printk_seq, prb_next_seq(prb));
| ^~~
include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
arch/ia64/include/asm/atomic.h:28:27: note: in expansion of macro 'WRITE_ONCE'
28 | #define atomic64_set(v,i) WRITE_ONCE(((v)->counter), (i))
| ^~~~~~~~~~
kernel/printk/printk.c:2677:3: note: in expansion of macro 'atomic64_set'
2677 | atomic64_set(&newcon->printk_seq, prb_next_seq(prb));
| ^~~~~~~~~~~~
kernel/printk/printk.c:2677:50: note: each undeclared identifier is reported only once for each function it appears in
2677 | atomic64_set(&newcon->printk_seq, prb_next_seq(prb));
| ^~~
include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE'
55 | *(volatile typeof(x) *)&(x) = (val); \
| ^~~
arch/ia64/include/asm/atomic.h:28:27: note: in expansion of macro 'WRITE_ONCE'
28 | #define atomic64_set(v,i) WRITE_ONCE(((v)->counter), (i))
| ^~~~~~~~~~
kernel/printk/printk.c:2677:3: note: in expansion of macro 'atomic64_set'
2677 | atomic64_set(&newcon->printk_seq, prb_next_seq(prb));
| ^~~~~~~~~~~~
In file included from include/linux/mmzone.h:10,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from kernel/printk/printk.c:23:
kernel/printk/printk.c: In function 'printk_kthread_func':
>> kernel/printk/printk.c:2836:36: error: 'log_wait' undeclared (first use in this function); did you mean 'poll_wait'?
2836 | error = wait_event_interruptible(log_wait,
| ^~~~~~~~
include/linux/wait.h:272:39: note: in definition of macro '___wait_event'
272 | long __int = prepare_to_wait_event(&wq_head, &__wq_entry, state);\
| ^~~~~~~
include/linux/wait.h:465:11: note: in expansion of macro '__wait_event_interruptible'
465 | __ret = __wait_event_interruptible(wq_head, condition); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/printk/printk.c:2836:11: note: in expansion of macro 'wait_event_interruptible'
2836 | error = wait_event_interruptible(log_wait,
| ^~~~~~~~~~~~~~~~~~~~~~~~
kernel/printk/printk.c:2877:7: error: implicit declaration of function 'kernel_sync_mode' [-Werror=implicit-function-declaration]
2877 | if (kernel_sync_mode() && con->write_atomic) {
| ^~~~~~~~~~~~~~~~
>> kernel/printk/printk.c:2889:4: error: implicit declaration of function 'printk_delay'; did you mean 'print_dev_t'? [-Werror=implicit-function-declaration]
2889 | printk_delay(r.info->level);
| ^~~~~~~~~~~~
| print_dev_t
kernel/printk/printk.c: In function 'console_try_thread':
>> kernel/printk/printk.c:2938:8: error: implicit declaration of function 'get_sprint_buf' [-Werror=implicit-function-declaration]
2938 | buf = get_sprint_buf(&sprint_id, &irqflags);
| ^~~~~~~~~~~~~~
kernel/printk/printk.c:2938:6: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2938 | buf = get_sprint_buf(&sprint_id, &irqflags);
| ^
>> kernel/printk/printk.c:2942:2: error: implicit declaration of function 'print_sync_until' [-Werror=implicit-function-declaration]
2942 | print_sync_until(prb_next_seq(prb), con, buf, PREFIX_MAX + LOG_LINE_MAX);
| ^~~~~~~~~~~~~~~~
kernel/printk/printk.c:2942:32: error: 'prb' undeclared (first use in this function)
2942 | print_sync_until(prb_next_seq(prb), con, buf, PREFIX_MAX + LOG_LINE_MAX);
| ^~~
>> kernel/printk/printk.c:2944:2: error: implicit declaration of function 'put_sprint_buf' [-Werror=implicit-function-declaration]
2944 | put_sprint_buf(sprint_id, irqflags);
| ^~~~~~~~~~~~~~
kernel/printk/printk.c: At top level:
kernel/printk/printk.c:3483:6: warning: no previous prototype for 'prb_lock' [-Wmissing-prototypes]
3483 | void prb_lock(struct prb_cpulock *cpu_lock, unsigned int *cpu_store)
| ^~~~~~~~
kernel/printk/printk.c:3501:6: warning: no previous prototype for 'prb_unlock' [-Wmissing-prototypes]
3501 | void prb_unlock(struct prb_cpulock *cpu_lock, unsigned int cpu_store)
| ^~~~~~~~~~
kernel/printk/printk.c:2094:13: warning: 'call_console_drivers' defined but not used [-Wunused-function]
2094 | static void call_console_drivers(const char *ext_text, size_t ext_len,
| ^~~~~~~~~~~~~~~~~~~~
kernel/printk/printk.c:2079:12: warning: 'syslog_seq' defined but not used [-Wunused-variable]
2079 | static u64 syslog_seq;
| ^~~~~~~~~~
kernel/printk/printk.c:84:13: warning: 'sync_mode' defined but not used [-Wunused-variable]
84 | static bool sync_mode;
| ^~~~~~~~~
cc1: some warnings being treated as errors
vim +/prb +2677 kernel/printk/printk.c
2563
2564 /*
2565 * The console driver calls this routine during kernel initialization
2566 * to register the console printing procedure with printk() and to
2567 * print any messages that were printed by the kernel before the
2568 * console driver was initialized.
2569 *
2570 * This can happen pretty early during the boot process (because of
2571 * early_printk) - sometimes before setup_arch() completes - be careful
2572 * of what kernel features are used - they may not be initialised yet.
2573 *
2574 * There are two types of consoles - bootconsoles (early_printk) and
2575 * "real" consoles (everything which is not a bootconsole) which are
2576 * handled differently.
2577 * - Any number of bootconsoles can be registered at any time.
2578 * - As soon as a "real" console is registered, all bootconsoles
2579 * will be unregistered automatically.
2580 * - Once a "real" console is registered, any attempt to register a
2581 * bootconsoles will be rejected
2582 */
2583 void register_console(struct console *newcon)
2584 {
2585 struct console *bcon = NULL;
2586 int err;
2587
2588 for_each_console(bcon) {
2589 if (WARN(bcon == newcon, "console '%s%d' already registered\n",
2590 bcon->name, bcon->index))
2591 return;
2592 }
2593
2594 /*
2595 * before we register a new CON_BOOT console, make sure we don't
2596 * already have a valid console
2597 */
2598 if (newcon->flags & CON_BOOT) {
2599 for_each_console(bcon) {
2600 if (!(bcon->flags & CON_BOOT)) {
2601 pr_info("Too late to register bootconsole %s%d\n",
2602 newcon->name, newcon->index);
2603 return;
2604 }
2605 }
2606 }
2607
2608 newcon->thread = NULL;
2609
2610 if (console_drivers && console_drivers->flags & CON_BOOT)
2611 bcon = console_drivers;
2612
2613 if (!has_preferred_console || bcon || !console_drivers)
2614 has_preferred_console = preferred_console >= 0;
2615
2616 /*
2617 * See if we want to use this console driver. If we
2618 * didn't select a console we take the first one
2619 * that registers here.
2620 */
2621 if (!has_preferred_console) {
2622 if (newcon->index < 0)
2623 newcon->index = 0;
2624 if (newcon->setup == NULL ||
2625 newcon->setup(newcon, NULL) == 0) {
2626 newcon->flags |= CON_ENABLED;
2627 if (newcon->device) {
2628 newcon->flags |= CON_CONSDEV;
2629 has_preferred_console = true;
2630 }
2631 }
2632 }
2633
2634 /* See if this console matches one we selected on the command line */
2635 err = try_enable_new_console(newcon, true);
2636
2637 /* If not, try to match against the platform default(s) */
2638 if (err == -ENOENT)
2639 err = try_enable_new_console(newcon, false);
2640
2641 /* printk() messages are not printed to the Braille console. */
2642 if (err || newcon->flags & CON_BRL)
2643 return;
2644
2645 /*
2646 * If we have a bootconsole, and are switching to a real console,
2647 * don't print everything out again, since when the boot console, and
2648 * the real console are the same physical device, it's annoying to
2649 * see the beginning boot messages twice
2650 */
2651 if (bcon && ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV))
2652 newcon->flags &= ~CON_PRINTBUFFER;
2653
2654 /*
2655 * Put this console in the list - keep the
2656 * preferred driver at the head of the list.
2657 */
2658 console_lock();
2659 if ((newcon->flags & CON_CONSDEV) || console_drivers == NULL) {
2660 newcon->next = console_drivers;
2661 console_drivers = newcon;
2662 if (newcon->next)
2663 newcon->next->flags &= ~CON_CONSDEV;
2664 /* Ensure this flag is always set for the head of the list */
2665 newcon->flags |= CON_CONSDEV;
2666 } else {
2667 newcon->next = console_drivers->next;
2668 console_drivers->next = newcon;
2669 }
2670
2671 if (newcon->flags & CON_EXTENDED)
2672 nr_ext_console_drivers++;
2673
2674 if (newcon->flags & CON_PRINTBUFFER)
2675 atomic64_set(&newcon->printk_seq, 0);
2676 else
> 2677 atomic64_set(&newcon->printk_seq, prb_next_seq(prb));
2678
2679 console_try_thread(newcon);
2680 console_unlock();
2681 console_sysfs_notify();
2682
2683 /*
2684 * By unregistering the bootconsoles after we enable the real console
2685 * we get the "console xxx enabled" message on all the consoles -
2686 * boot consoles, real consoles, etc - this is to ensure that end
2687 * users know there might be something in the kernel's log buffer that
2688 * went to the bootconsole (that they do not see on the real console)
2689 */
2690 pr_info("%sconsole [%s%d] enabled\n",
2691 (newcon->flags & CON_BOOT) ? "boot" : "" ,
2692 newcon->name, newcon->index);
2693 if (bcon &&
2694 ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV) &&
2695 !keep_bootcon) {
2696 /* We need to iterate through all boot consoles, to make
2697 * sure we print everything out, before we unregister them.
2698 */
2699 for_each_console(bcon)
2700 if (bcon->flags & CON_BOOT)
2701 unregister_console(bcon);
2702 }
2703 }
2704 EXPORT_SYMBOL(register_console);
2705
2706 int unregister_console(struct console *console)
2707 {
2708 struct console *con;
2709 int res;
2710
2711 pr_info("%sconsole [%s%d] disabled\n",
2712 (console->flags & CON_BOOT) ? "boot" : "" ,
2713 console->name, console->index);
2714
2715 res = _braille_unregister_console(console);
2716 if (res < 0)
2717 return res;
2718 if (res > 0)
2719 return 0;
2720
2721 res = -ENODEV;
2722 console_lock();
2723 if (console_drivers == console) {
2724 console_drivers=console->next;
2725 res = 0;
2726 } else {
2727 for_each_console(con) {
2728 if (con->next == console) {
2729 con->next = console->next;
2730 res = 0;
2731 break;
2732 }
2733 }
2734 }
2735
2736 if (res)
2737 goto out_disable_unlock;
2738
2739 if (console->flags & CON_EXTENDED)
2740 nr_ext_console_drivers--;
2741
2742 /*
2743 * If this isn't the last console and it has CON_CONSDEV set, we
2744 * need to set it on the next preferred console.
2745 */
2746 if (console_drivers != NULL && console->flags & CON_CONSDEV)
2747 console_drivers->flags |= CON_CONSDEV;
2748
2749 console->flags &= ~CON_ENABLED;
2750 console_unlock();
2751 console_sysfs_notify();
2752
2753 if (console->thread && !IS_ERR(console->thread))
2754 kthread_stop(console->thread);
2755
2756 if (console->exit)
2757 res = console->exit(console);
2758
2759 return res;
2760
2761 out_disable_unlock:
2762 console->flags &= ~CON_ENABLED;
2763 console_unlock();
2764
2765 return res;
2766 }
2767 EXPORT_SYMBOL(unregister_console);
2768
2769 /*
2770 * Initialize the console device. This is called *early*, so
2771 * we can't necessarily depend on lots of kernel help here.
2772 * Just do some early initializations, and do the complex setup
2773 * later.
2774 */
2775 void __init console_init(void)
2776 {
2777 int ret;
2778 initcall_t call;
2779 initcall_entry_t *ce;
2780
2781 /* Setup the default TTY line discipline. */
2782 n_tty_init();
2783
2784 /*
2785 * set up the console device so that later boot sequences can
2786 * inform about problems etc..
2787 */
2788 ce = __con_initcall_start;
2789 trace_initcall_level("console");
2790 while (ce < __con_initcall_end) {
2791 call = initcall_from_entry(ce);
2792 trace_initcall_start(call);
2793 ret = call();
2794 trace_initcall_finish(call, ret);
2795 ce++;
2796 }
2797 }
2798
2799 static int printk_kthread_func(void *data)
2800 {
2801 struct console *con = data;
2802 unsigned long dropped = 0;
2803 struct printk_info info;
2804 struct printk_record r;
2805 char *ext_text = NULL;
2806 size_t dropped_len;
2807 char *dropped_text;
2808 int ret = -ENOMEM;
2809 char *write_text;
2810 u64 printk_seq;
2811 size_t len;
2812 char *text;
2813 int error;
2814 u64 seq;
2815
2816 if (con->flags & CON_EXTENDED) {
2817 ext_text = kmalloc(CONSOLE_EXT_LOG_MAX, GFP_KERNEL);
2818 if (!ext_text)
2819 return ret;
2820 }
2821 text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL);
2822 dropped_text = kmalloc(64, GFP_KERNEL);
2823 if (!text || !dropped_text)
2824 goto out;
2825
2826 if (con->flags & CON_EXTENDED)
2827 write_text = ext_text;
2828 else
2829 write_text = text;
2830
2831 seq = atomic64_read(&con->printk_seq);
2832
2833 prb_rec_init_rd(&r, &info, text, LOG_LINE_MAX + PREFIX_MAX);
2834
2835 for (;;) {
> 2836 error = wait_event_interruptible(log_wait,
2837 prb_read_valid(prb, seq, &r) || kthread_should_stop());
2838
2839 if (kthread_should_stop())
2840 break;
2841
2842 if (error)
2843 continue;
2844
2845 if (seq != r.info->seq) {
2846 dropped += r.info->seq - seq;
2847 seq = r.info->seq;
2848 }
2849
2850 seq++;
2851
2852 if (!(con->flags & CON_ENABLED))
2853 continue;
2854
2855 if (suppress_message_printing(r.info->level))
2856 continue;
2857
2858 if (con->flags & CON_EXTENDED) {
2859 len = info_print_ext_header(ext_text,
2860 CONSOLE_EXT_LOG_MAX,
2861 r.info);
2862 len += msg_print_ext_body(ext_text + len,
2863 CONSOLE_EXT_LOG_MAX - len,
2864 &r.text_buf[0], r.info->text_len,
2865 &r.info->dev_info);
2866 } else {
2867 len = record_print_text(&r,
2868 console_msg_format & MSG_FORMAT_SYSLOG,
2869 printk_time);
2870 }
2871
2872 printk_seq = atomic64_read(&con->printk_seq);
2873
2874 console_lock();
2875 console_may_schedule = 0;
2876
2877 if (kernel_sync_mode() && con->write_atomic) {
2878 console_unlock();
2879 break;
2880 }
2881
2882 if (!(con->flags & CON_EXTENDED) && dropped) {
2883 dropped_len = snprintf(dropped_text, 64,
2884 "** %lu printk messages dropped **\n",
2885 dropped);
2886 dropped = 0;
2887
2888 con->write(con, dropped_text, dropped_len);
2889 printk_delay(r.info->level);
2890 }
2891
2892 con->write(con, write_text, len);
2893 if (len)
2894 printk_delay(r.info->level);
2895
2896 atomic64_cmpxchg_relaxed(&con->printk_seq, printk_seq, seq);
2897
2898 console_unlock();
2899 }
2900 out:
2901 kfree(dropped_text);
2902 kfree(text);
2903 kfree(ext_text);
2904 pr_info("%sconsole [%s%d]: printing thread stopped\n",
2905 (con->flags & CON_BOOT) ? "boot" : "" ,
2906 con->name, con->index);
2907 return ret;
2908 }
2909
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months