[kbuild] drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1036 wait_func_handle_exec_timeout() warn: should '1 << ent->idx' be a 64 bit type?
From: Dan Carpenter
Date: Thu Aug 05 2021 - 11:51:56 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 251a1524293d0a90c4d5060f65f42a3016280049
commit: 1d5558b1f0de81f54ddee05f3793acc5260d107f net/mlx5: poll cmd EQ in case of command timeout
config: i386-randconfig-m021-20210804 (attached as .config)
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@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1036 wait_func_handle_exec_timeout() warn: should '1 << ent->idx' be a 64 bit type?
Old smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/cmd.c:868 cb_timeout_handler() warn: should '1 << ent->idx' be a 64 bit type?
drivers/net/ethernet/mellanox/mlx5/core/cmd.c:962 cmd_work_handler() warn: should '1 << ent->idx' be a 64 bit type?
drivers/net/ethernet/mellanox/mlx5/core/cmd.c:976 cmd_work_handler() warn: should '1 << ent->idx' be a 64 bit type?
drivers/net/ethernet/mellanox/mlx5/core/cmd.c:976 cmd_work_handler() warn: inconsistent returns 'sem'.
(It's hard to see where the semaphore is released in cmd_work_handler(). Add comments?)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1417 outlen_write() warn: sscanf doesn't return error codes
vim +1036 drivers/net/ethernet/mellanox/mlx5/core/cmd.c
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1014 static void wait_func_handle_exec_timeout(struct mlx5_core_dev *dev,
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1015 struct mlx5_cmd_work_ent *ent)
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1016 {
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1017 unsigned long timeout = msecs_to_jiffies(MLX5_CMD_TIMEOUT_RECOVER_MSEC);
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1018
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1019 mlx5_cmd_eq_recover(dev);
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1020
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1021 /* Re-wait on the ent->done after executing the recovery flow. If the
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1022 * recovery flow (or any other recovery flow running simultaneously)
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1023 * has recovered an EQE, it should cause the entry to be completed by
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1024 * the command interface.
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1025 */
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1026 if (wait_for_completion_timeout(&ent->done, timeout)) {
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1027 mlx5_core_warn(dev, "cmd[%d]: %s(0x%x) recovered after timeout\n", ent->idx,
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1028 mlx5_command_str(msg_to_opcode(ent->in)), msg_to_opcode(ent->in));
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1029 return;
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1030 }
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1031
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1032 mlx5_core_warn(dev, "cmd[%d]: %s(0x%x) No done completion\n", ent->idx,
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1033 mlx5_command_str(msg_to_opcode(ent->in)), msg_to_opcode(ent->in));
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1034
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1035 ent->ret = -ETIMEDOUT;
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 @1036 mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true);
^^^^^^^^^^^^^^^
This should be "1ULL << ent->idx".
1d5558b1f0de81 Eran Ben Elisha 2020-07-21 1037 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
_______________________________________________
kbuild mailing list -- kbuild@xxxxxxxxxxxx
To unsubscribe send an email to kbuild-leave@xxxxxxxxxxxx