Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Eleven fixes, mostly in drivers or minor fixes in driver related
infrastructure libraries (target, libfc and libsas).

Most of the bugs fixed only show up under rare circumstances, the
exception being the endianness problem in qla2xxx which is used as a
device on some sparc systems"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: mpt3sas: Don't call disable_irq from IRQ poll handler
scsi: megaraid_sas: Don't call disable_irq from process IRQ poll
scsi: target: iscsi: Fix hang in iscsit_access_np() when getting tpg->np_login_sem
scsi: libsas: Set data_dir as DMA_NONE if libata marks qc as NODATA
scsi: target: iscsi: Fix data digest calculation
scsi: lpfc: Update lpfc version to 12.8.0.4
scsi: lpfc: Extend the RDF FPIN Registration descriptor for additional events
scsi: lpfc: Fix FLOGI/PLOGI receive race condition in pt2pt discovery
scsi: lpfc: Fix setting IRQ affinity with an empty CPU mask
scsi: qla2xxx: Fix regression on sparc64
scsi: libfc: Fix for double free()
scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort

+39 -23
-2
drivers/scsi/libfc/fc_disc.c
··· 634 634 fc_frame_free(fp); 635 635 out: 636 636 kref_put(&rdata->kref, fc_rport_destroy); 637 - if (!IS_ERR(fp)) 638 - fc_frame_free(fp); 639 637 } 640 638 641 639 /**
+4 -1
drivers/scsi/libsas/sas_ata.c
··· 209 209 task->num_scatter = si; 210 210 } 211 211 212 - task->data_dir = qc->dma_dir; 212 + if (qc->tf.protocol == ATA_PROT_NODATA) 213 + task->data_dir = DMA_NONE; 214 + else 215 + task->data_dir = qc->dma_dir; 213 216 task->scatter = qc->sg; 214 217 task->ata_task.retry_count = 1; 215 218 task->task_state_flags = SAS_TASK_STATE_PENDING;
+6 -1
drivers/scsi/lpfc/lpfc_els.c
··· 3517 3517 FC_TLV_DESC_LENGTH_FROM_SZ(prdf->reg_d1)); 3518 3518 prdf->reg_d1.reg_desc.count = cpu_to_be32(ELS_RDF_REG_TAG_CNT); 3519 3519 prdf->reg_d1.desc_tags[0] = cpu_to_be32(ELS_DTAG_LNK_INTEGRITY); 3520 + prdf->reg_d1.desc_tags[1] = cpu_to_be32(ELS_DTAG_DELIVERY); 3521 + prdf->reg_d1.desc_tags[2] = cpu_to_be32(ELS_DTAG_PEER_CONGEST); 3522 + prdf->reg_d1.desc_tags[3] = cpu_to_be32(ELS_DTAG_CONGESTION); 3520 3523 3521 3524 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, 3522 3525 "Issue RDF: did:x%x", ··· 4659 4656 out: 4660 4657 if (ndlp && NLP_CHK_NODE_ACT(ndlp) && shost) { 4661 4658 spin_lock_irq(shost->host_lock); 4662 - ndlp->nlp_flag &= ~(NLP_ACC_REGLOGIN | NLP_RM_DFLT_RPI); 4659 + if (mbox) 4660 + ndlp->nlp_flag &= ~NLP_ACC_REGLOGIN; 4661 + ndlp->nlp_flag &= ~NLP_RM_DFLT_RPI; 4663 4662 spin_unlock_irq(shost->host_lock); 4664 4663 4665 4664 /* If the node is not being used by another discovery thread,
+1 -1
drivers/scsi/lpfc/lpfc_hw4.h
··· 4800 4800 uint32_t fc_hdr_wd5; /* word 15 */ 4801 4801 }; 4802 4802 4803 - #define ELS_RDF_REG_TAG_CNT 1 4803 + #define ELS_RDF_REG_TAG_CNT 4 4804 4804 struct lpfc_els_rdf_reg_desc { 4805 4805 struct fc_df_desc_fpin_reg reg_desc; /* descriptor header */ 4806 4806 __be32 desc_tags[ELS_RDF_REG_TAG_CNT];
-1
drivers/scsi/lpfc/lpfc_init.c
··· 11376 11376 { 11377 11377 cpumask_clear(&eqhdl->aff_mask); 11378 11378 irq_clear_status_flags(eqhdl->irq, IRQ_NO_BALANCING); 11379 - irq_set_affinity_hint(eqhdl->irq, &eqhdl->aff_mask); 11380 11379 } 11381 11380 11382 11381 /**
+1 -1
drivers/scsi/lpfc/lpfc_version.h
··· 20 20 * included with this package. * 21 21 *******************************************************************/ 22 22 23 - #define LPFC_DRIVER_VERSION "12.8.0.3" 23 + #define LPFC_DRIVER_VERSION "12.8.0.4" 24 24 #define LPFC_DRIVER_NAME "lpfc" 25 25 26 26 /* Used for SLI 2/3 */
+1 -1
drivers/scsi/megaraid/megaraid_sas_fusion.c
··· 3689 3689 instance = irq_ctx->instance; 3690 3690 3691 3691 if (irq_ctx->irq_line_enable) { 3692 - disable_irq(irq_ctx->os_irq); 3692 + disable_irq_nosync(irq_ctx->os_irq); 3693 3693 irq_ctx->irq_line_enable = false; 3694 3694 } 3695 3695
+1 -1
drivers/scsi/mpt3sas/mpt3sas_base.c
··· 1733 1733 reply_q = container_of(irqpoll, struct adapter_reply_queue, 1734 1734 irqpoll); 1735 1735 if (reply_q->irq_line_enable) { 1736 - disable_irq(reply_q->os_irq); 1736 + disable_irq_nosync(reply_q->os_irq); 1737 1737 reply_q->irq_line_enable = false; 1738 1738 } 1739 1739 num_entries = _base_process_reply_queue(reply_q);
+1 -1
drivers/scsi/pm8001/pm8001_sas.c
··· 818 818 819 819 res = pm8001_tag_alloc(pm8001_ha, &ccb_tag); 820 820 if (res) 821 - return res; 821 + goto ex_err; 822 822 ccb = &pm8001_ha->ccb_info[ccb_tag]; 823 823 ccb->device = pm8001_dev; 824 824 ccb->ccb_tag = ccb_tag;
+1 -1
drivers/scsi/qla2xxx/qla_def.h
··· 1626 1626 */ 1627 1627 uint8_t firmware_options[2]; 1628 1628 1629 - uint16_t frame_payload_size; 1629 + __le16 frame_payload_size; 1630 1630 __le16 max_iocb_allocation; 1631 1631 __le16 execution_throttle; 1632 1632 uint8_t retry_count;
+3 -3
drivers/scsi/qla2xxx/qla_init.c
··· 4603 4603 nv->firmware_options[1] = BIT_7 | BIT_5; 4604 4604 nv->add_firmware_options[0] = BIT_5; 4605 4605 nv->add_firmware_options[1] = BIT_5 | BIT_4; 4606 - nv->frame_payload_size = 2048; 4606 + nv->frame_payload_size = cpu_to_le16(2048); 4607 4607 nv->special_options[1] = BIT_7; 4608 4608 } else if (IS_QLA2200(ha)) { 4609 4609 nv->firmware_options[0] = BIT_2 | BIT_1; 4610 4610 nv->firmware_options[1] = BIT_7 | BIT_5; 4611 4611 nv->add_firmware_options[0] = BIT_5; 4612 4612 nv->add_firmware_options[1] = BIT_5 | BIT_4; 4613 - nv->frame_payload_size = 1024; 4613 + nv->frame_payload_size = cpu_to_le16(1024); 4614 4614 } else if (IS_QLA2100(ha)) { 4615 4615 nv->firmware_options[0] = BIT_3 | BIT_1; 4616 4616 nv->firmware_options[1] = BIT_5; 4617 - nv->frame_payload_size = 1024; 4617 + nv->frame_payload_size = cpu_to_le16(1024); 4618 4618 } 4619 4619 4620 4620 nv->max_iocb_allocation = cpu_to_le16(256);
+15 -2
drivers/target/iscsi/iscsi_target.c
··· 1389 1389 sg = cmd->first_data_sg; 1390 1390 page_off = cmd->first_data_sg_off; 1391 1391 1392 + if (data_length && page_off) { 1393 + struct scatterlist first_sg; 1394 + u32 len = min_t(u32, data_length, sg->length - page_off); 1395 + 1396 + sg_init_table(&first_sg, 1); 1397 + sg_set_page(&first_sg, sg_page(sg), len, sg->offset + page_off); 1398 + 1399 + ahash_request_set_crypt(hash, &first_sg, NULL, len); 1400 + crypto_ahash_update(hash); 1401 + 1402 + data_length -= len; 1403 + sg = sg_next(sg); 1404 + } 1405 + 1392 1406 while (data_length) { 1393 - u32 cur_len = min_t(u32, data_length, (sg->length - page_off)); 1407 + u32 cur_len = min_t(u32, data_length, sg->length); 1394 1408 1395 1409 ahash_request_set_crypt(hash, sg, NULL, cur_len); 1396 1410 crypto_ahash_update(hash); 1397 1411 1398 1412 data_length -= cur_len; 1399 - page_off = 0; 1400 1413 /* iscsit_map_iovec has already checked for invalid sg pointers */ 1401 1414 sg = sg_next(sg); 1402 1415 }
+3 -3
drivers/target/iscsi/iscsi_target_login.c
··· 1149 1149 } 1150 1150 1151 1151 void iscsi_target_login_sess_out(struct iscsi_conn *conn, 1152 - struct iscsi_np *np, bool zero_tsih, bool new_sess) 1152 + bool zero_tsih, bool new_sess) 1153 1153 { 1154 1154 if (!new_sess) 1155 1155 goto old_sess_out; ··· 1167 1167 conn->sess = NULL; 1168 1168 1169 1169 old_sess_out: 1170 - iscsi_stop_login_thread_timer(np); 1171 1170 /* 1172 1171 * If login negotiation fails check if the Time2Retain timer 1173 1172 * needs to be restarted. ··· 1406 1407 new_sess_out: 1407 1408 new_sess = true; 1408 1409 old_sess_out: 1410 + iscsi_stop_login_thread_timer(np); 1409 1411 tpg_np = conn->tpg_np; 1410 - iscsi_target_login_sess_out(conn, np, zero_tsih, new_sess); 1412 + iscsi_target_login_sess_out(conn, zero_tsih, new_sess); 1411 1413 new_sess = false; 1412 1414 1413 1415 if (tpg) {
+1 -2
drivers/target/iscsi/iscsi_target_login.h
··· 22 22 extern void iscsit_free_conn(struct iscsi_conn *); 23 23 extern int iscsit_start_kthreads(struct iscsi_conn *); 24 24 extern void iscsi_post_login_handler(struct iscsi_np *, struct iscsi_conn *, u8); 25 - extern void iscsi_target_login_sess_out(struct iscsi_conn *, struct iscsi_np *, 26 - bool, bool); 25 + extern void iscsi_target_login_sess_out(struct iscsi_conn *, bool, bool); 27 26 extern int iscsi_target_login_thread(void *); 28 27 extern void iscsi_handle_login_thread_timeout(struct timer_list *t); 29 28
+1 -2
drivers/target/iscsi/iscsi_target_nego.c
··· 535 535 536 536 static void iscsi_target_login_drop(struct iscsi_conn *conn, struct iscsi_login *login) 537 537 { 538 - struct iscsi_np *np = login->np; 539 538 bool zero_tsih = login->zero_tsih; 540 539 541 540 iscsi_remove_failed_auth_entry(conn); 542 541 iscsi_target_nego_release(conn); 543 - iscsi_target_login_sess_out(conn, np, zero_tsih, true); 542 + iscsi_target_login_sess_out(conn, zero_tsih, true); 544 543 } 545 544 546 545 struct conn_timeout {