* [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?
@ 2021-08-05 15:51 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-08-05 15:51 UTC (permalink / raw)
To: kbuild, Eran Ben Elisha; +Cc: lkp, kbuild-all, linux-kernel, Saeed Mahameed
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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-05 15:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 15:51 [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? Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).