All of lore.kernel.org
 help / color / mirror / Atom feed
* 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; 3+ messages in thread
From: kernel test robot @ 2021-08-05 13:53 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3999 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Eran Ben Elisha <eranbe@mellanox.com>
CC: Saeed Mahameed <saeedm@nvidia.com>

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
date:   10 months ago
:::::: branch date: 18 hours ago
:::::: commit date: 10 months ago
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'.
drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1297 mlx5_alloc_cmd_msg() warn: passing a valid pointer to 'PTR_ERR'
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  1013  
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);
1d5558b1f0de81 Eran Ben Elisha 2020-07-21  1037  }
1d5558b1f0de81 Eran Ben Elisha 2020-07-21  1038  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36048 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [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; 3+ messages 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] 3+ messages in thread

* [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; 3+ messages in thread
From: Dan Carpenter @ 2021-08-05 15:51 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3928 bytes --]

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(a)lists.01.org 

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-05 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 13:53 drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1036 wait_func_handle_exec_timeout() warn: should '1 << ent->idx' be a 64 bit type? kernel test robot
2021-08-05 15:51 ` [kbuild] " Dan Carpenter
2021-08-05 15:51 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.