forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/csiostor/csio_scsi.c
....@@ -933,14 +933,14 @@
933933 * abort for that I/O by the FW crossed each other.
934934 * The FW returned FW_EINVAL. The original I/O would have
935935 * returned with FW_SUCCESS or any other SCSI error.
936
- * 3. The FW couldnt sent the abort out on the wire, as there
936
+ * 3. The FW couldn't sent the abort out on the wire, as there
937937 * was an I-T nexus loss (link down, remote device logged
938938 * out etc). FW sent back an appropriate IT nexus loss status
939939 * for the abort.
940940 * 4. FW sent an abort, but abort timed out (remote device
941941 * didnt respond). FW replied back with
942942 * FW_SCSI_ABORT_TIMEDOUT.
943
- * 5. FW couldnt genuinely abort the request for some reason,
943
+ * 5. FW couldn't genuinely abort the request for some reason,
944944 * and sent us an error.
945945 *
946946 * The first 3 scenarios are treated as succesful abort
....@@ -1783,16 +1783,10 @@
17831783 int nsge = 0;
17841784 int rv = SCSI_MLQUEUE_HOST_BUSY, nr;
17851785 int retval;
1786
- int cpu;
17871786 struct csio_scsi_qset *sqset;
17881787 struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
17891788
1790
- if (!blk_rq_cpu_valid(cmnd->request))
1791
- cpu = smp_processor_id();
1792
- else
1793
- cpu = cmnd->request->cpu;
1794
-
1795
- sqset = &hw->sqset[ln->portid][cpu];
1789
+ sqset = &hw->sqset[ln->portid][blk_mq_rq_cpu(cmnd->request)];
17961790
17971791 nr = fc_remote_port_chkready(rport);
17981792 if (nr) {
....@@ -1865,7 +1859,7 @@
18651859 spin_unlock_irqrestore(&hw->lock, flags);
18661860
18671861 if (retval != 0) {
1868
- csio_err(hw, "ioreq: %p couldnt be started, status:%d\n",
1862
+ csio_err(hw, "ioreq: %p couldn't be started, status:%d\n",
18691863 ioreq, retval);
18701864 CSIO_INC_STATS(scsim, n_busy_error);
18711865 goto err_put_req;
....@@ -1993,15 +1987,15 @@
19931987 /* FW successfully aborted the request */
19941988 if (host_byte(cmnd->result) == DID_REQUEUE) {
19951989 csio_info(hw,
1996
- "Aborted SCSI command to (%d:%llu) serial#:0x%lx\n",
1990
+ "Aborted SCSI command to (%d:%llu) tag %u\n",
19971991 cmnd->device->id, cmnd->device->lun,
1998
- cmnd->serial_number);
1992
+ cmnd->request->tag);
19991993 return SUCCESS;
20001994 } else {
20011995 csio_info(hw,
2002
- "Failed to abort SCSI command, (%d:%llu) serial#:0x%lx\n",
1996
+ "Failed to abort SCSI command, (%d:%llu) tag %u\n",
20031997 cmnd->device->id, cmnd->device->lun,
2004
- cmnd->serial_number);
1998
+ cmnd->request->tag);
20051999 return FAILED;
20062000 }
20072001 }
....@@ -2283,7 +2277,6 @@
22832277 .this_id = -1,
22842278 .sg_tablesize = CSIO_SCSI_MAX_SGE,
22852279 .cmd_per_lun = CSIO_MAX_CMD_PER_LUN,
2286
- .use_clustering = ENABLE_CLUSTERING,
22872280 .shost_attrs = csio_fcoe_lport_attrs,
22882281 .max_sectors = CSIO_MAX_SECTOR_SIZE,
22892282 };
....@@ -2303,7 +2296,6 @@
23032296 .this_id = -1,
23042297 .sg_tablesize = CSIO_SCSI_MAX_SGE,
23052298 .cmd_per_lun = CSIO_MAX_CMD_PER_LUN,
2306
- .use_clustering = ENABLE_CLUSTERING,
23072299 .shost_attrs = csio_fcoe_vport_attrs,
23082300 .max_sectors = CSIO_MAX_SECTOR_SIZE,
23092301 };
....@@ -2352,8 +2344,8 @@
23522344 }
23532345
23542346 /* Allocate Dma buffers for DDP */
2355
- ddp_desc->vaddr = pci_alloc_consistent(hw->pdev, unit_size,
2356
- &ddp_desc->paddr);
2347
+ ddp_desc->vaddr = dma_alloc_coherent(&hw->pdev->dev, unit_size,
2348
+ &ddp_desc->paddr, GFP_KERNEL);
23572349 if (!ddp_desc->vaddr) {
23582350 csio_err(hw,
23592351 "SCSI response DMA buffer (ddp) allocation"
....@@ -2375,8 +2367,8 @@
23752367 list_for_each(tmp, &scm->ddp_freelist) {
23762368 ddp_desc = (struct csio_dma_buf *) tmp;
23772369 tmp = csio_list_prev(tmp);
2378
- pci_free_consistent(hw->pdev, ddp_desc->len, ddp_desc->vaddr,
2379
- ddp_desc->paddr);
2370
+ dma_free_coherent(&hw->pdev->dev, ddp_desc->len,
2371
+ ddp_desc->vaddr, ddp_desc->paddr);
23802372 list_del_init(&ddp_desc->list);
23812373 kfree(ddp_desc);
23822374 }
....@@ -2402,8 +2394,8 @@
24022394 list_for_each(tmp, &scm->ddp_freelist) {
24032395 ddp_desc = (struct csio_dma_buf *) tmp;
24042396 tmp = csio_list_prev(tmp);
2405
- pci_free_consistent(hw->pdev, ddp_desc->len, ddp_desc->vaddr,
2406
- ddp_desc->paddr);
2397
+ dma_free_coherent(&hw->pdev->dev, ddp_desc->len,
2398
+ ddp_desc->vaddr, ddp_desc->paddr);
24072399 list_del_init(&ddp_desc->list);
24082400 kfree(ddp_desc);
24092401 }