Hi Darren, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on scsi/for-next] [also build test WARNING on next-20190212] [cannot apply to v5.0-rc4] [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/Himanshu-Madhani/qla2xxx-Misc-bug-fixes-for-the-driver/20190213-094944 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' All warnings (new ones prefixed by >>): drivers/scsi/qla2xxx/qla_nvme.c:361:40: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:361:40: sparse: expected unsigned short [usertype] control_flags drivers/scsi/qla2xxx/qla_nvme.c:361:40: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:366:40: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:366:40: sparse: expected unsigned short [usertype] control_flags drivers/scsi/qla2xxx/qla_nvme.c:366:40: sparse: got restricted __le16 [usertype] >> drivers/scsi/qla2xxx/qla_nvme.c:374:56: sparse: warning: invalid assignment: |= drivers/scsi/qla2xxx/qla_nvme.c:374:56: sparse: left side has type unsigned short drivers/scsi/qla2xxx/qla_nvme.c:374:56: sparse: right side has type restricted __le16 drivers/scsi/qla2xxx/qla_nvme.c:384:31: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:384:31: sparse: expected unsigned short [usertype] nport_handle drivers/scsi/qla2xxx/qla_nvme.c:384:31: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:391:35: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:391:35: sparse: expected unsigned short [usertype] nvme_rsp_dsd_len drivers/scsi/qla2xxx/qla_nvme.c:391:35: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:392:43: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:392:43: sparse: expected unsigned int drivers/scsi/qla2xxx/qla_nvme.c:392:43: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:393:43: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:393:43: sparse: expected unsigned int drivers/scsi/qla2xxx/qla_nvme.c:393:43: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:396:37: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:396:37: sparse: expected unsigned short [usertype] nvme_cmnd_dseg_len drivers/scsi/qla2xxx/qla_nvme.c:396:37: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:397:44: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:397:44: sparse: expected unsigned int drivers/scsi/qla2xxx/qla_nvme.c:397:44: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:398:44: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:398:44: sparse: expected unsigned int drivers/scsi/qla2xxx/qla_nvme.c:398:44: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:400:29: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:400:29: sparse: expected unsigned short [usertype] dseg_count drivers/scsi/qla2xxx/qla_nvme.c:400:29: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:401:29: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:401:29: sparse: expected unsigned int [usertype] byte_count drivers/scsi/qla2xxx/qla_nvme.c:401:29: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:429:64: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:429:64: sparse: expected unsigned int [usertype] drivers/scsi/qla2xxx/qla_nvme.c:429:64: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:437:28: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:437:28: sparse: expected unsigned int [usertype] drivers/scsi/qla2xxx/qla_nvme.c:437:28: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:438:28: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:438:28: sparse: expected unsigned int [usertype] drivers/scsi/qla2xxx/qla_nvme.c:438:28: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:439:28: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:439:28: sparse: expected unsigned int [usertype] drivers/scsi/qla2xxx/qla_nvme.c:439:28: sparse: got restricted __le32 [usertype] sparse warnings: (new ones prefixed by >>) drivers/scsi/qla2xxx/qla_nvme.c:361:40: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:361:40: sparse: expected unsigned short [usertype] control_flags drivers/scsi/qla2xxx/qla_nvme.c:361:40: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:366:40: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:366:40: sparse: expected unsigned short [usertype] control_flags drivers/scsi/qla2xxx/qla_nvme.c:366:40: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:374:56: sparse: warning: invalid assignment: |= >> drivers/scsi/qla2xxx/qla_nvme.c:374:56: sparse: left side has type unsigned short >> drivers/scsi/qla2xxx/qla_nvme.c:374:56: sparse: right side has type restricted __le16 drivers/scsi/qla2xxx/qla_nvme.c:384:31: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:384:31: sparse: expected unsigned short [usertype] nport_handle drivers/scsi/qla2xxx/qla_nvme.c:384:31: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:391:35: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:391:35: sparse: expected unsigned short [usertype] nvme_rsp_dsd_len drivers/scsi/qla2xxx/qla_nvme.c:391:35: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:392:43: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:392:43: sparse: expected unsigned int drivers/scsi/qla2xxx/qla_nvme.c:392:43: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:393:43: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:393:43: sparse: expected unsigned int drivers/scsi/qla2xxx/qla_nvme.c:393:43: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:396:37: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:396:37: sparse: expected unsigned short [usertype] nvme_cmnd_dseg_len drivers/scsi/qla2xxx/qla_nvme.c:396:37: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:397:44: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:397:44: sparse: expected unsigned int drivers/scsi/qla2xxx/qla_nvme.c:397:44: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:398:44: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:398:44: sparse: expected unsigned int drivers/scsi/qla2xxx/qla_nvme.c:398:44: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:400:29: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:400:29: sparse: expected unsigned short [usertype] dseg_count drivers/scsi/qla2xxx/qla_nvme.c:400:29: sparse: got restricted __le16 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:401:29: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:401:29: sparse: expected unsigned int [usertype] byte_count drivers/scsi/qla2xxx/qla_nvme.c:401:29: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:429:64: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:429:64: sparse: expected unsigned int [usertype] drivers/scsi/qla2xxx/qla_nvme.c:429:64: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:437:28: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:437:28: sparse: expected unsigned int [usertype] drivers/scsi/qla2xxx/qla_nvme.c:437:28: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:438:28: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:438:28: sparse: expected unsigned int [usertype] drivers/scsi/qla2xxx/qla_nvme.c:438:28: sparse: got restricted __le32 [usertype] drivers/scsi/qla2xxx/qla_nvme.c:439:28: sparse: warning: incorrect type in assignment (different base types) drivers/scsi/qla2xxx/qla_nvme.c:439:28: sparse: expected unsigned int [usertype] drivers/scsi/qla2xxx/qla_nvme.c:439:28: sparse: got restricted __le32 [usertype] vim +374 drivers/scsi/qla2xxx/qla_nvme.c 274 275 static inline int qla2x00_start_nvme_mq(srb_t *sp) 276 { 277 unsigned long flags; 278 uint32_t *clr_ptr; 279 uint32_t index; 280 uint32_t handle; 281 struct cmd_nvme *cmd_pkt; 282 uint16_t cnt, i; 283 uint16_t req_cnt; 284 uint16_t tot_dsds; 285 uint16_t avail_dsds; 286 uint32_t *cur_dsd; 287 struct req_que *req = NULL; 288 struct scsi_qla_host *vha = sp->fcport->vha; 289 struct qla_hw_data *ha = vha->hw; 290 struct qla_qpair *qpair = sp->qpair; 291 struct srb_iocb *nvme = &sp->u.iocb_cmd; 292 struct scatterlist *sgl, *sg; 293 struct nvmefc_fcp_req *fd = nvme->u.nvme.desc; 294 uint32_t rval = QLA_SUCCESS; 295 296 /* Setup qpair pointers */ 297 req = qpair->req; 298 tot_dsds = fd->sg_cnt; 299 300 /* Acquire qpair specific lock */ 301 spin_lock_irqsave(&qpair->qp_lock, flags); 302 303 /* Check for room in outstanding command list. */ 304 handle = req->current_outstanding_cmd; 305 for (index = 1; index < req->num_outstanding_cmds; index++) { 306 handle++; 307 if (handle == req->num_outstanding_cmds) 308 handle = 1; 309 if (!req->outstanding_cmds[handle]) 310 break; 311 } 312 313 if (index == req->num_outstanding_cmds) { 314 rval = -EBUSY; 315 goto queuing_error; 316 } 317 req_cnt = qla24xx_calc_iocbs(vha, tot_dsds); 318 if (req->cnt < (req_cnt + 2)) { 319 cnt = IS_SHADOW_REG_CAPABLE(ha) ? *req->out_ptr : 320 RD_REG_DWORD_RELAXED(req->req_q_out); 321 322 if (req->ring_index < cnt) 323 req->cnt = cnt - req->ring_index; 324 else 325 req->cnt = req->length - (req->ring_index - cnt); 326 327 if (req->cnt < (req_cnt + 2)){ 328 rval = -EBUSY; 329 goto queuing_error; 330 } 331 } 332 333 if (unlikely(!fd->sqid)) { 334 struct nvme_fc_cmd_iu *cmd = fd->cmdaddr; 335 if (cmd->sqe.common.opcode == nvme_admin_async_event) { 336 nvme->u.nvme.aen_op = 1; 337 atomic_inc(&ha->nvme_active_aen_cnt); 338 } 339 } 340 341 /* Build command packet. */ 342 req->current_outstanding_cmd = handle; 343 req->outstanding_cmds[handle] = sp; 344 sp->handle = handle; 345 req->cnt -= req_cnt; 346 347 cmd_pkt = (struct cmd_nvme *)req->ring_ptr; 348 cmd_pkt->handle = MAKE_HANDLE(req->id, handle); 349 350 /* Zero out remaining portion of packet. */ 351 clr_ptr = (uint32_t *)cmd_pkt + 2; 352 memset(clr_ptr, 0, REQUEST_ENTRY_SIZE - 8); 353 354 cmd_pkt->entry_status = 0; 355 356 /* Update entry type to indicate Command NVME IOCB */ 357 cmd_pkt->entry_type = COMMAND_NVME; 358 359 /* No data transfer how do we check buffer len == 0?? */ 360 if (fd->io_dir == NVMEFC_FCP_READ) { > 361 cmd_pkt->control_flags = 362 cpu_to_le16(CF_READ_DATA); 363 vha->qla_stats.input_bytes += fd->payload_length; 364 vha->qla_stats.input_requests++; 365 } else if (fd->io_dir == NVMEFC_FCP_WRITE) { 366 cmd_pkt->control_flags = 367 cpu_to_le16(CF_WRITE_DATA); 368 if ((vha->flags.nvme_first_burst) && 369 (sp->fcport->nvme_prli_service_param & 370 NVME_PRLI_SP_FIRST_BURST)) { 371 if ((fd->payload_length <= 372 sp->fcport->nvme_first_burst_size) || 373 (sp->fcport->nvme_first_burst_size == 0)) > 374 cmd_pkt->control_flags |= 375 cpu_to_le16(CF_NVME_FIRST_BURST_ENABLE); 376 } 377 vha->qla_stats.output_bytes += fd->payload_length; 378 vha->qla_stats.output_requests++; 379 } else if (fd->io_dir == 0) { 380 cmd_pkt->control_flags = 0; 381 } 382 383 /* Set NPORT-ID */ 384 cmd_pkt->nport_handle = cpu_to_le16(sp->fcport->loop_id); 385 cmd_pkt->port_id[0] = sp->fcport->d_id.b.al_pa; 386 cmd_pkt->port_id[1] = sp->fcport->d_id.b.area; 387 cmd_pkt->port_id[2] = sp->fcport->d_id.b.domain; 388 cmd_pkt->vp_index = sp->fcport->vha->vp_idx; 389 390 /* NVME RSP IU */ 391 cmd_pkt->nvme_rsp_dsd_len = cpu_to_le16(fd->rsplen); 392 cmd_pkt->nvme_rsp_dseg_address[0] = cpu_to_le32(LSD(fd->rspdma)); 393 cmd_pkt->nvme_rsp_dseg_address[1] = cpu_to_le32(MSD(fd->rspdma)); 394 395 /* NVME CNMD IU */ 396 cmd_pkt->nvme_cmnd_dseg_len = cpu_to_le16(fd->cmdlen); 397 cmd_pkt->nvme_cmnd_dseg_address[0] = cpu_to_le32(LSD(fd->cmddma)); 398 cmd_pkt->nvme_cmnd_dseg_address[1] = cpu_to_le32(MSD(fd->cmddma)); 399 400 cmd_pkt->dseg_count = cpu_to_le16(tot_dsds); 401 cmd_pkt->byte_count = cpu_to_le32(fd->payload_length); 402 403 /* One DSD is available in the Command Type NVME IOCB */ 404 avail_dsds = 1; 405 cur_dsd = (uint32_t *)&cmd_pkt->nvme_data_dseg_address[0]; 406 sgl = fd->first_sgl; 407 408 /* Load data segments */ 409 for_each_sg(sgl, sg, tot_dsds, i) { 410 dma_addr_t sle_dma; 411 cont_a64_entry_t *cont_pkt; 412 413 /* Allocate additional continuation packets? */ 414 if (avail_dsds == 0) { 415 /* 416 * Five DSDs are available in the Continuation 417 * Type 1 IOCB. 418 */ 419 420 /* Adjust ring index */ 421 req->ring_index++; 422 if (req->ring_index == req->length) { 423 req->ring_index = 0; 424 req->ring_ptr = req->ring; 425 } else { 426 req->ring_ptr++; 427 } 428 cont_pkt = (cont_a64_entry_t *)req->ring_ptr; 429 *((uint32_t *)(&cont_pkt->entry_type)) = 430 cpu_to_le32(CONTINUE_A64_TYPE); 431 432 cur_dsd = (uint32_t *)cont_pkt->dseg_0_address; 433 avail_dsds = 5; 434 } 435 436 sle_dma = sg_dma_address(sg); 437 *cur_dsd++ = cpu_to_le32(LSD(sle_dma)); 438 *cur_dsd++ = cpu_to_le32(MSD(sle_dma)); 439 *cur_dsd++ = cpu_to_le32(sg_dma_len(sg)); 440 avail_dsds--; 441 } 442 443 /* Set total entry count. */ 444 cmd_pkt->entry_count = (uint8_t)req_cnt; 445 wmb(); 446 447 /* Adjust ring index. */ 448 req->ring_index++; 449 if (req->ring_index == req->length) { 450 req->ring_index = 0; 451 req->ring_ptr = req->ring; 452 } else { 453 req->ring_ptr++; 454 } 455 456 /* Set chip new ring index. */ 457 WRT_REG_DWORD(req->req_q_in, req->ring_index); 458 459 queuing_error: 460 spin_unlock_irqrestore(&qpair->qp_lock, flags); 461 return rval; 462 } 463 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip