linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Eran Ben Elisha <eranbe@mellanox.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>
Subject: [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?
Date: Thu, 5 Aug 2021 18:51:24 +0300	[thread overview]
Message-ID: <202108052103.hfxfjDe3-lkp@intel.com> (raw)

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


                 reply	other threads:[~2021-08-05 15:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202108052103.hfxfjDe3-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=eranbe@mellanox.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).