tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 05607873db411ec3c614313b43cec60138c26a99 commit: 676df2864a908565710282838af4f392acb9ebd4 [6900/7311] net: hns3: add command queue trace for hns3 config: loongarch-randconfig-r113-20240408 (https://download.01.org/0day-ci/archive/20240409/202404090328.GBESI86e-lkp@i...) compiler: loongarch64-linux-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20240409/202404090328.GBESI86e-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202404090328.GBESI86e-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c:475:60: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned short [usertype] opcode @@ got restricted __le16 [usertype] opcode @@
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c:475:60: sparse: expected unsigned short [usertype] opcode drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c:475:60: sparse: got restricted __le16 [usertype] opcode drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/slab.h, ...): include/linux/page-flags.h:245:46: sparse: sparse: self-comparison always evaluates to false -- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, ...):
drivers/net/ethernet/hisilicon/hns3/hns3pf/./hclge_trace.h:132:1: sparse: sparse: cast to restricted __le32
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c: note: in included file (through include/trace/perf.h, include/trace/define_trace.h, drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_trace.h):
drivers/net/ethernet/hisilicon/hns3/hns3pf/./hclge_trace.h:132:1: sparse: sparse: cast to restricted __le32
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): include/linux/page-flags.h:245:46: sparse: sparse: self-comparison always evaluates to false
vim +475 drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.c
462 463 /** 464 * hclge_comm_cmd_send - send command to command queue 465 * @hw: pointer to the hw struct 466 * @desc: prefilled descriptor for describing the command 467 * @num : the number of descriptors to be sent 468 * 469 * This is the main send command for command queue, it 470 * sends the queue, cleans the queue, etc 471 **/ 472 int hclge_comm_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc, 473 int num) 474 {
475 bool is_special = hclge_comm_is_special_opcode(desc->opcode);
476 struct hclge_comm_cmq_ring *csq = &hw->cmq.csq; 477 int ret; 478 int ntc; 479 480 if (hw->cmq.ops.trace_cmd_send) 481 hw->cmq.ops.trace_cmd_send(hw, desc, num, is_special); 482 483 spin_lock_bh(&hw->cmq.csq.lock); 484 485 if (test_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hw->comm_state)) { 486 spin_unlock_bh(&hw->cmq.csq.lock); 487 return -EBUSY; 488 } 489 490 if (num > hclge_comm_ring_space(&hw->cmq.csq)) { 491 /* If CMDQ ring is full, SW HEAD and HW HEAD may be different, 492 * need update the SW HEAD pointer csq->next_to_clean 493 */ 494 csq->next_to_clean = 495 hclge_comm_read_dev(hw, HCLGE_COMM_NIC_CSQ_HEAD_REG); 496 spin_unlock_bh(&hw->cmq.csq.lock); 497 return -EBUSY; 498 } 499 500 /** 501 * Record the location of desc in the ring for this time 502 * which will be use for hardware to write back 503 */ 504 ntc = hw->cmq.csq.next_to_use; 505 506 hclge_comm_cmd_copy_desc(hw, desc, num); 507 508 /* Write to hardware */ 509 hclge_comm_write_dev(hw, HCLGE_COMM_NIC_CSQ_TAIL_REG, 510 hw->cmq.csq.next_to_use); 511 512 ret = hclge_comm_cmd_check_result(hw, desc, num, ntc); 513 514 spin_unlock_bh(&hw->cmq.csq.lock); 515 516 if (hw->cmq.ops.trace_cmd_get) 517 hw->cmq.ops.trace_cmd_get(hw, desc, num, is_special); 518 519 return ret; 520 } 521