Lijun, I thought you already sent a sparse cleanup for this driver? It certainly looks wrong to bitshit and mask a le marked value. I think you'll need to resend this series with the sparse warnings fixed. Thanks, Jason On Tue, Jul 03, 2018 at 06:52:39PM +0800, kbuild test robot wrote: > Hi Lijun, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on rdma/for-next] > [also build test WARNING on v4.18-rc3 next-20180702] > [cannot apply to linus/master linux-sof-driver/master] > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > url: https://github.com/0day-ci/linux/commits/Lijun-Ou/Four-cmd-queues-support-for-hip08/20180703-104144 > base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next > reproduce: > # apt-get install sparse > make ARCH=x86_64 allmodconfig > make C=1 CF=-D__CHECK_ENDIAN__ > > > sparse warnings: (new ones prefixed by >>) > > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:522:37: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 [usertype] *val @@ got restricted __be32 [usertype] *val @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:522:37: expected restricted __be32 [usertype] *val > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:522:37: got restricted __le32 [usertype] *<noident> > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:843:18: sparse: restricted __le16 degrades to integer > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:860:34: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [unsigned] [usertype] desc_ret @@ got short [unsigned] [usertype] desc_ret @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:860:34: expected unsigned short [unsigned] [usertype] desc_ret > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:860:34: got restricted __le16 [usertype] retval > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:899:26: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:899:26: sparse: cast from restricted __le16 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:900:29: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:900:29: sparse: cast from restricted __le16 > >> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1272:44: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] base_addr_l @@ got __le32 [usertype] base_addr_l @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1272:44: expected restricted __le32 [usertype] base_addr_l > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1272:44: got unsigned long long > >> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1273:44: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] base_addr_h @@ got __le32 [usertype] base_addr_h @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1273:44: expected restricted __le32 [usertype] base_addr_h > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1273:44: got unsigned long long > >> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1283:42: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] head_ba_l @@ got unsignrestricted __le32 [usertype] head_ba_l @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1283:42: expected restricted __le32 [usertype] head_ba_l > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1283:42: got unsigned int [unsigned] [usertype] blk_ba0 > >> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1284:49: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] head_ba_h_nxtptr @@ got unsignrestricted __le32 [usertype] head_ba_h_nxtptr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1284:49: expected restricted __le32 [usertype] head_ba_h_nxtptr > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1284:49: got unsigned int [unsigned] [usertype] blk_ba1_nxt_ptr > >> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1289:42: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] tail_ba_l @@ got unsignrestricted __le32 [usertype] tail_ba_l @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1289:42: expected restricted __le32 [usertype] tail_ba_l > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1289:42: got unsigned int [unsigned] [usertype] blk_ba0 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1335:18: sparse: expression using sizeof(void) > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1335:18: sparse: expression using sizeof(void) > include/linux/slab.h:631:13: sparse: undefined identifier '__builtin_mul_overflow' > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1465:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1465:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1467:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1467:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1469:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1469:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1471:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1471:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1551:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1551:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1572:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1572:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1604:39: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1618:39: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1624:36: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1641:38: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1667:36: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1679:38: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1726:33: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1833:38: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1838:38: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] cqe_cur_blk_addr @@ got unsignrestricted __le32 [usertype] cqe_cur_blk_addr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1840:33: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1842:9: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1851:38: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] cqe_nxt_blk_addr @@ got unsignrestricted __le32 [usertype] cqe_nxt_blk_addr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1852:9: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1865:28: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] cqe_ba @@ got unsignrestricted __le32 [usertype] cqe_ba @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1878:36: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] db_record_addr @@ got __le32 [usertype] db_record_addr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1906:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1906:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1908:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1908:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1910:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1910:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1913:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1913:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1915:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1915:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1918:28: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 [usertype] *val @@ got 2 [usertype] *val @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1942:24: sparse: expression using sizeof(void) > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1942:24: sparse: expression using sizeof(void) > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2513:36: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] qkey_xrcd @@ got unsigned intrestricted __le32 [usertype] qkey_xrcd @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2532:36: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] rq_db_record_addr @@ got __le32 [usertype] rq_db_record_addr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2845:36: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] qkey_xrcd @@ got unsigned intrestricted __le32 [usertype] qkey_xrcd @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2920:29: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] wqe_sge_ba @@ got unsignrestricted __le32 [usertype] wqe_sge_ba @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2983:34: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] rq_cur_blk_addr @@ got unsignrestricted __le32 [usertype] rq_cur_blk_addr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2996:34: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] rq_nxt_blk_addr @@ got unsignrestricted __le32 [usertype] rq_nxt_blk_addr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3020:26: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] trrl_ba @@ got unsignrestricted __le32 [usertype] trrl_ba @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3028:26: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] irrl_ba @@ got unsignrestricted __le32 [usertype] irrl_ba @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3039:9: sparse: cast from restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3207:34: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] sq_cur_blk_addr @@ got unsignrestricted __le32 [usertype] sq_cur_blk_addr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3218:38: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] sq_cur_sge_blk_addr @@ got [usertype] sq_cur_sge_blk_addr @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3233:37: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] rx_sq_cur_blk_addr @@ got unsignrestricted __le32 [usertype] rx_sq_cur_blk_addr @@ > include/linux/slab.h:631:13: sparse: not a function <noident> > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3634:28: sparse: incorrect type in assignment (different base types) @@ expected unsigned char [unsigned] [usertype] rnr_retry @@ got d char [unsigned] [usertype] rnr_retry @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3634:28: expected unsigned char [unsigned] [usertype] rnr_retry > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3634:28: got restricted __le32 [usertype] rq_rnr_timer > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3793:17: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3793:17: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3793:17: right side has type restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3793:17: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3793:17: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3793:17: right side has type restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3799:17: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3799:17: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3799:17: right side has type restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3799:17: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3799:17: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3799:17: right side has type restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3802:17: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3802:17: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3802:17: right side has type restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3802:17: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3802:17: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3802:17: right side has type restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3809:9: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3809:9: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3809:9: right side has type restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3809:9: sparse: invalid assignment: |= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3809:9: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3809:9: right side has type restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3813:28: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 [usertype] *val @@ got 2 [usertype] *val @@ > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3813:28: expected restricted __be32 [usertype] *val > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3813:28: got unsigned int *<noident> > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3824:20: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3855:20: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3892:15: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3926:15: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3982:17: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4001:30: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4100:20: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4119:23: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4167:13: sparse: cast to restricted __le32 > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4170:17: sparse: invalid assignment: &= > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4170:17: left side has type unsigned int > drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4170:17: right side has type restricted __le32 > > vim +1272 drivers/infiniband/hw/hns/hns_roce_hw_v2.c > > 1233 > 1234 static int hns_roce_config_link_table(struct hns_roce_dev *hr_dev, > 1235 enum hns_roce_link_table_type type) > 1236 { > 1237 struct hns_roce_cmq_desc desc[2]; > 1238 struct hns_roce_cfg_llm_a *req_a = > 1239 (struct hns_roce_cfg_llm_a *)desc[0].data; > 1240 struct hns_roce_cfg_llm_b *req_b = > 1241 (struct hns_roce_cfg_llm_b *)desc[1].data; > 1242 struct hns_roce_v2_priv *priv = hr_dev->priv; > 1243 struct hns_roce_link_table *link_tbl; > 1244 struct hns_roce_link_table_entry *entry; > 1245 enum hns_roce_opcode_type opcode; > 1246 u32 page_num; > 1247 int i; > 1248 > 1249 switch (type) { > 1250 case TSQ_LINK_TABLE: > 1251 link_tbl = &priv->tsq; > 1252 opcode = HNS_ROCE_OPC_CFG_EXT_LLM; > 1253 break; > 1254 default: > 1255 return -EINVAL; > 1256 } > 1257 > 1258 page_num = link_tbl->npages; > 1259 entry = link_tbl->table.buf; > 1260 memset(req_a, 0, sizeof(*req_a)); > 1261 memset(req_b, 0, sizeof(*req_b)); > 1262 > 1263 for (i = 0; i < 2; i++) { > 1264 hns_roce_cmq_setup_basic_desc(&desc[i], opcode, false); > 1265 > 1266 if (i == 0) > 1267 desc[i].flag |= cpu_to_le16(HNS_ROCE_CMD_FLAG_NEXT); > 1268 else > 1269 desc[i].flag &= ~cpu_to_le16(HNS_ROCE_CMD_FLAG_NEXT); > 1270 > 1271 if (i == 0) { > > 1272 req_a->base_addr_l = link_tbl->table.map & 0xffffffff; > > 1273 req_a->base_addr_h = (link_tbl->table.map >> 32) & > 1274 0xffffffff; > 1275 roce_set_field(req_a->depth_pgsz_init_en, > 1276 CFG_LLM_QUE_DEPTH_M, > 1277 CFG_LLM_QUE_DEPTH_S, > 1278 link_tbl->npages); > 1279 roce_set_field(req_a->depth_pgsz_init_en, > 1280 CFG_LLM_QUE_PGSZ_M, > 1281 CFG_LLM_QUE_PGSZ_S, > 1282 link_tbl->pg_sz); > > 1283 req_a->head_ba_l = entry[0].blk_ba0; > > 1284 req_a->head_ba_h_nxtptr = entry[0].blk_ba1_nxt_ptr; > 1285 roce_set_field(req_a->head_ptr, > 1286 CFG_LLM_HEAD_PTR_M, > 1287 CFG_LLM_HEAD_PTR_S, 0); > 1288 } else { > > 1289 req_b->tail_ba_l = entry[page_num - 1].blk_ba0; > 1290 roce_set_field(req_b->tail_ba_h, > 1291 CFG_LLM_TAIL_BA_H_M, > 1292 CFG_LLM_TAIL_BA_H_S, > 1293 entry[page_num - 1].blk_ba1_nxt_ptr & > 1294 HNS_ROCE_LINK_TABLE_BA1_M); > 1295 roce_set_field(req_b->tail_ptr, > 1296 CFG_LLM_TAIL_PTR_M, > 1297 CFG_LLM_TAIL_PTR_S, > 1298 (entry[page_num - 2].blk_ba1_nxt_ptr & > 1299 HNS_ROCE_LINK_TABLE_NXT_PTR_M) >> > 1300 HNS_ROCE_LINK_TABLE_NXT_PTR_S); > 1301 } > 1302 } > 1303 roce_set_field(req_a->depth_pgsz_init_en, > 1304 CFG_LLM_INIT_EN_M, CFG_LLM_INIT_EN_S, 1); > 1305 > 1306 return hns_roce_cmq_send(hr_dev, desc, 2); > 1307 } > 1308 > > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html