forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/scsi/bnx2i/bnx2i_hwi.c
....@@ -181,7 +181,7 @@
181181
182182 /**
183183 * bnx2i_get_rq_buf - copy RQ buffer contents to driver buffer
184
- * @conn: iscsi connection on which RQ event occurred
184
+ * @bnx2i_conn: iscsi connection on which RQ event occurred
185185 * @ptr: driver buffer to which RQ buffer contents is to
186186 * be copied
187187 * @len: length of valid data inside RQ buf
....@@ -223,7 +223,7 @@
223223
224224 /**
225225 * bnx2i_put_rq_buf - Replenish RQ buffer, if required ring on chip doorbell
226
- * @conn: iscsi connection on which event to post
226
+ * @bnx2i_conn: iscsi connection on which event to post
227227 * @count: number of RQ buffer being posted to chip
228228 *
229229 * No need to ring hardware doorbell for 57710 family of devices
....@@ -253,13 +253,12 @@
253253 writew(ep->qp.rq_prod_idx,
254254 ep->qp.ctx_base + CNIC_RECV_DOORBELL);
255255 }
256
- mmiowb();
257256 }
258257
259258
260259 /**
261260 * bnx2i_ring_sq_dbell - Ring SQ doorbell to wake-up the processing engine
262
- * @conn: iscsi connection to which new SQ entries belong
261
+ * @bnx2i_conn: iscsi connection to which new SQ entries belong
263262 * @count: number of SQ WQEs to post
264263 *
265264 * SQ DB is updated in host memory and TX Doorbell is rung for 57710 family
....@@ -279,14 +278,12 @@
279278 bnx2i_ring_577xx_doorbell(bnx2i_conn);
280279 } else
281280 writew(count, ep->qp.ctx_base + CNIC_SEND_DOORBELL);
282
-
283
- mmiowb(); /* flush posted PCI writes */
284281 }
285282
286283
287284 /**
288285 * bnx2i_ring_dbell_update_sq_params - update SQ driver parameters
289
- * @conn: iscsi connection to which new SQ entries belong
286
+ * @bnx2i_conn: iscsi connection to which new SQ entries belong
290287 * @count: number of SQ WQEs to post
291288 *
292289 * this routine will update SQ driver parameters and ring the doorbell
....@@ -323,9 +320,9 @@
323320
324321 /**
325322 * bnx2i_send_iscsi_login - post iSCSI login request MP WQE to hardware
326
- * @conn: iscsi connection
327
- * @cmd: driver command structure which is requesting
328
- * a WQE to sent to chip for further processing
323
+ * @bnx2i_conn: iscsi connection
324
+ * @task: transport layer's command structure pointer which is requesting
325
+ * a WQE to sent to chip for further processing
329326 *
330327 * prepare and post an iSCSI Login request WQE to CNIC firmware
331328 */
....@@ -376,7 +373,7 @@
376373
377374 /**
378375 * bnx2i_send_iscsi_tmf - post iSCSI task management request MP WQE to hardware
379
- * @conn: iscsi connection
376
+ * @bnx2i_conn: iscsi connection
380377 * @mtask: driver command structure which is requesting
381378 * a WQE to sent to chip for further processing
382379 *
....@@ -450,7 +447,7 @@
450447
451448 /**
452449 * bnx2i_send_iscsi_text - post iSCSI text WQE to hardware
453
- * @conn: iscsi connection
450
+ * @bnx2i_conn: iscsi connection
454451 * @mtask: driver command structure which is requesting
455452 * a WQE to sent to chip for further processing
456453 *
....@@ -498,7 +495,7 @@
498495
499496 /**
500497 * bnx2i_send_iscsi_scsicmd - post iSCSI scsicmd request WQE to hardware
501
- * @conn: iscsi connection
498
+ * @bnx2i_conn: iscsi connection
502499 * @cmd: driver command structure which is requesting
503500 * a WQE to sent to chip for further processing
504501 *
....@@ -520,9 +517,9 @@
520517
521518 /**
522519 * bnx2i_send_iscsi_nopout - post iSCSI NOPOUT request WQE to hardware
523
- * @conn: iscsi connection
524
- * @cmd: driver command structure which is requesting
525
- * a WQE to sent to chip for further processing
520
+ * @bnx2i_conn: iscsi connection
521
+ * @task: transport layer's command structure pointer which is
522
+ * requesting a WQE to sent to chip for further processing
526523 * @datap: payload buffer pointer
527524 * @data_len: payload data length
528525 * @unsol: indicated whether nopout pdu is unsolicited pdu or
....@@ -582,9 +579,9 @@
582579
583580 /**
584581 * bnx2i_send_iscsi_logout - post iSCSI logout request WQE to hardware
585
- * @conn: iscsi connection
586
- * @cmd: driver command structure which is requesting
587
- * a WQE to sent to chip for further processing
582
+ * @bnx2i_conn: iscsi connection
583
+ * @task: transport layer's command structure pointer which is
584
+ * requesting a WQE to sent to chip for further processing
588585 *
589586 * prepare and post logout request WQE to CNIC firmware
590587 */
....@@ -681,7 +678,8 @@
681678
682679 /**
683680 * bnx2i_ep_ofld_timer - post iSCSI logout request WQE to hardware
684
- * @data: endpoint (transport handle) structure pointer
681
+ * @t: timer context used to fetch the endpoint (transport
682
+ * handle) structure pointer
685683 *
686684 * routine to handle connection offload/destroy request timeout
687685 */
....@@ -1070,8 +1068,8 @@
10701068
10711069 /* Allocate memory area for actual SQ element */
10721070 ep->qp.sq_virt =
1073
- dma_zalloc_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size,
1074
- &ep->qp.sq_phys, GFP_KERNEL);
1071
+ dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size,
1072
+ &ep->qp.sq_phys, GFP_KERNEL);
10751073 if (!ep->qp.sq_virt) {
10761074 printk(KERN_ALERT "bnx2i: unable to alloc SQ BD memory %d\n",
10771075 ep->qp.sq_mem_size);
....@@ -1106,8 +1104,8 @@
11061104
11071105 /* Allocate memory area for actual CQ element */
11081106 ep->qp.cq_virt =
1109
- dma_zalloc_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size,
1110
- &ep->qp.cq_phys, GFP_KERNEL);
1107
+ dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size,
1108
+ &ep->qp.cq_phys, GFP_KERNEL);
11111109 if (!ep->qp.cq_virt) {
11121110 printk(KERN_ALERT "bnx2i: unable to alloc CQ BD memory %d\n",
11131111 ep->qp.cq_mem_size);
....@@ -1665,7 +1663,7 @@
16651663
16661664 /**
16671665 * bnx2i_unsol_pdu_adjust_rq - makes adjustments to RQ after unsol pdu is recvd
1668
- * @conn: iscsi connection
1666
+ * @bnx2i_conn: iscsi connection
16691667 *
16701668 * Firmware advances RQ producer index for every unsolicited PDU even if
16711669 * payload data length is '0'. This function makes corresponding
....@@ -1888,7 +1886,9 @@
18881886
18891887 /**
18901888 * bnx2i_queue_scsi_cmd_resp - queue cmd completion to the percpu thread
1889
+ * @session: iscsi session
18911890 * @bnx2i_conn: bnx2i connection
1891
+ * @cqe: pointer to newly DMA'ed CQE entry for processing
18921892 *
18931893 * this function is called by generic KCQ handler to queue all pending cmd
18941894 * completion CQEs
....@@ -1906,7 +1906,6 @@
19061906 struct iscsi_task *task;
19071907 struct scsi_cmnd *sc;
19081908 int rc = 0;
1909
- int cpu;
19101909
19111910 spin_lock(&session->back_lock);
19121911 task = iscsi_itt_to_task(bnx2i_conn->cls_conn->dd_data,
....@@ -1917,14 +1916,9 @@
19171916 }
19181917 sc = task->sc;
19191918
1920
- if (!blk_rq_cpu_valid(sc->request))
1921
- cpu = smp_processor_id();
1922
- else
1923
- cpu = sc->request->cpu;
1924
-
19251919 spin_unlock(&session->back_lock);
19261920
1927
- p = &per_cpu(bnx2i_percpu, cpu);
1921
+ p = &per_cpu(bnx2i_percpu, blk_mq_rq_cpu(sc->request));
19281922 spin_lock(&p->p_work_lock);
19291923 if (unlikely(!p->iothread)) {
19301924 rc = -EINVAL;
....@@ -2433,7 +2427,6 @@
24332427 {
24342428 u32 cid_addr;
24352429 struct bnx2i_endpoint *ep;
2436
- u32 cid_num;
24372430
24382431 ep = bnx2i_find_ep_in_ofld_list(hba, ofld_kcqe->iscsi_conn_id);
24392432 if (!ep) {
....@@ -2468,7 +2461,6 @@
24682461 } else {
24692462 ep->state = EP_STATE_OFLD_COMPL;
24702463 cid_addr = ofld_kcqe->iscsi_conn_context_id;
2471
- cid_num = bnx2i_get_cid_num(ep);
24722464 ep->ep_cid = cid_addr;
24732465 ep->qp.ctx_base = NULL;
24742466 }
....@@ -2477,8 +2469,9 @@
24772469
24782470 /**
24792471 * bnx2i_indicate_kcqe - process iscsi conn update completion KCQE
2480
- * @hba: adapter structure pointer
2481
- * @update_kcqe: kcqe pointer
2472
+ * @context: adapter structure pointer
2473
+ * @kcqe: kcqe pointer
2474
+ * @num_cqe: number of kcqes to process
24822475 *
24832476 * Generic KCQ event handler/dispatcher
24842477 */
....@@ -2625,8 +2618,7 @@
26252618
26262619 /**
26272620 * bnx2i_cm_remote_close - process received TCP FIN
2628
- * @hba: adapter structure pointer
2629
- * @update_kcqe: kcqe pointer
2621
+ * @cm_sk: cnic sock structure pointer
26302622 *
26312623 * function callback exported via bnx2i - cnic driver interface to indicate
26322624 * async TCP events such as FIN
....@@ -2642,8 +2634,7 @@
26422634
26432635 /**
26442636 * bnx2i_cm_remote_abort - process TCP RST and start conn cleanup
2645
- * @hba: adapter structure pointer
2646
- * @update_kcqe: kcqe pointer
2637
+ * @cm_sk: cnic sock structure pointer
26472638 *
26482639 * function callback exported via bnx2i - cnic driver interface to
26492640 * indicate async TCP events (RST) sent by the peer.
....@@ -2680,10 +2671,9 @@
26802671 }
26812672
26822673
2683
-/**
2674
+/*
26842675 * bnx2i_cnic_cb - global template of bnx2i - cnic driver interface structure
26852676 * carrying callback function pointers
2686
- *
26872677 */
26882678 struct cnic_ulp_ops bnx2i_cnic_cb = {
26892679 .cnic_init = bnx2i_ulp_init,
....@@ -2726,7 +2716,7 @@
27262716 reg_base = pci_resource_start(ep->hba->pcidev,
27272717 BNX2X_DOORBELL_PCI_BAR);
27282718 reg_off = (1 << BNX2X_DB_SHIFT) * (cid_num & 0x1FFFF);
2729
- ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4);
2719
+ ep->qp.ctx_base = ioremap(reg_base + reg_off, 4);
27302720 if (!ep->qp.ctx_base)
27312721 return -ENOMEM;
27322722 goto arm_cq;
....@@ -2747,7 +2737,7 @@
27472737 /* 5709 device in normal node and 5706/5708 devices */
27482738 reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num);
27492739
2750
- ep->qp.ctx_base = ioremap_nocache(ep->hba->reg_base + reg_off,
2740
+ ep->qp.ctx_base = ioremap(ep->hba->reg_base + reg_off,
27512741 MB_KERNEL_CTX_SIZE);
27522742 if (!ep->qp.ctx_base)
27532743 return -ENOMEM;