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

Pull more SCSI updates from James Bottomley:
"Eleven patches, all in drivers (no core changes) that are either minor
cleanups or small fixes.

They were late arriving, but still safe for -rc1"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: MAINTAINERS: Add the linux-scsi mailing list to the ISCSI entry
scsi: megaraid_sas: Make poll_aen_lock static
scsi: sd_zbc: Improve report zones error printout
scsi: qla2xxx: Fix qla2x00_request_irqs() for MSI
scsi: qla2xxx: unregister ports after GPN_FT failure
scsi: qla2xxx: fix rports not being mark as lost in sync fabric scan
scsi: pm80xx: Remove unused include of linux/version.h
scsi: pm80xx: fix logic to break out of loop when register value is 2 or 3
scsi: scsi_transport_sas: Fix memory leak when removing devices
scsi: lpfc: size cpu map by last cpu id set
scsi: ibmvscsi_tgt: Remove unneeded variable rc

+36 -32
+1
MAINTAINERS
··· 8764 8764 M: Lee Duncan <lduncan@suse.com> 8765 8765 M: Chris Leech <cleech@redhat.com> 8766 8766 L: open-iscsi@googlegroups.com 8767 + L: linux-scsi@vger.kernel.org 8767 8768 W: www.open-iscsi.com 8768 8769 S: Maintained 8769 8770 F: drivers/scsi/*iscsi*
+1 -2
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
··· 2354 2354 { 2355 2355 struct iu_entry *iue = cmd->iue; 2356 2356 struct srp_i_logout *log_out = &vio_iu(iue)->srp.i_logout; 2357 - long rc = ADAPT_SUCCESS; 2358 2357 2359 2358 if ((vscsi->debit > 0) || !list_empty(&vscsi->schedule_q) || 2360 2359 !list_empty(&vscsi->waiting_rsp)) { ··· 2369 2370 ibmvscsis_post_disconnect(vscsi, WAIT_IDLE, 0); 2370 2371 } 2371 2372 2372 - return rc; 2373 + return ADAPT_SUCCESS; 2373 2374 } 2374 2375 2375 2376 /* Called with intr lock held */
+1 -1
drivers/scsi/lpfc/lpfc_init.c
··· 6460 6460 u32 if_fam; 6461 6461 6462 6462 phba->sli4_hba.num_present_cpu = lpfc_present_cpu; 6463 - phba->sli4_hba.num_possible_cpu = num_possible_cpus(); 6463 + phba->sli4_hba.num_possible_cpu = cpumask_last(cpu_possible_mask) + 1; 6464 6464 phba->sli4_hba.curr_disp_cpu = 0; 6465 6465 lpfc_cpumask_of_node_init(phba); 6466 6466
+1 -1
drivers/scsi/megaraid/megaraid_sas_base.c
··· 199 199 static bool support_pci_lane_margining; 200 200 201 201 /* define lock for aen poll */ 202 - spinlock_t poll_aen_lock; 202 + static spinlock_t poll_aen_lock; 203 203 204 204 extern struct dentry *megasas_debugfs_root; 205 205 extern void megasas_init_debugfs(void);
+1 -2
drivers/scsi/pm8001/pm80xx_hwi.c
··· 37 37 * POSSIBILITY OF SUCH DAMAGES. 38 38 * 39 39 */ 40 - #include <linux/version.h> 41 40 #include <linux/slab.h> 42 41 #include "pm8001_sas.h" 43 42 #include "pm80xx_hwi.h" ··· 347 348 do { 348 349 reg_val = pm8001_mr32(fatal_table_address, 349 350 MPI_FATAL_EDUMP_TABLE_STATUS); 350 - } while (((reg_val != 2) || (reg_val != 3)) && 351 + } while (((reg_val != 2) && (reg_val != 3)) && 351 352 time_before(jiffies, start)); 352 353 353 354 if (reg_val < 2) {
+14 -2
drivers/scsi/qla2xxx/qla_gs.c
··· 3587 3587 if (vha->scan.scan_retry < MAX_SCAN_RETRIES) { 3588 3588 set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); 3589 3589 set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); 3590 + goto out; 3590 3591 } else { 3591 - ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff, 3592 + ql_dbg(ql_dbg_disc, vha, 0xffff, 3592 3593 "%s: Fabric scan failed for %d retries.\n", 3593 3594 __func__, vha->scan.scan_retry); 3595 + /* 3596 + * Unable to scan any rports. logout loop below 3597 + * will unregister all sessions. 3598 + */ 3599 + list_for_each_entry(fcport, &vha->vp_fcports, list) { 3600 + if ((fcport->flags & FCF_FABRIC_DEVICE) != 0) { 3601 + fcport->scan_state = QLA_FCPORT_SCAN; 3602 + fcport->logout_on_delete = 0; 3603 + } 3604 + } 3605 + goto login_logout; 3594 3606 } 3595 - goto out; 3596 3607 } 3597 3608 vha->scan.scan_retry = 0; 3598 3609 ··· 3681 3670 dup_cnt); 3682 3671 } 3683 3672 3673 + login_logout: 3684 3674 /* 3685 3675 * Logout all previous fabric dev marked lost, except FCP2 devices. 3686 3676 */
+3 -3
drivers/scsi/qla2xxx/qla_init.c
··· 5898 5898 if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) 5899 5899 break; 5900 5900 5901 - if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 || 5902 - (fcport->flags & FCF_LOGIN_NEEDED) == 0) 5901 + if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) 5903 5902 continue; 5904 5903 5905 5904 if (fcport->scan_state == QLA_FCPORT_SCAN) { ··· 5921 5922 } 5922 5923 } 5923 5924 5924 - if (fcport->scan_state == QLA_FCPORT_FOUND) 5925 + if (fcport->scan_state == QLA_FCPORT_FOUND && 5926 + (fcport->flags & FCF_LOGIN_NEEDED) != 0) 5925 5927 qla24xx_fcport_handle_login(vha, fcport); 5926 5928 } 5927 5929 return (rval);
+3 -3
drivers/scsi/qla2xxx/qla_isr.c
··· 3650 3650 skip_msix: 3651 3651 3652 3652 ql_log(ql_log_info, vha, 0x0037, 3653 - "Falling back-to MSI mode -%d.\n", ret); 3653 + "Falling back-to MSI mode -- ret=%d.\n", ret); 3654 3654 3655 3655 if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) && 3656 3656 !IS_QLA8001(ha) && !IS_P3P_TYPE(ha) && !IS_QLAFX00(ha) && ··· 3658 3658 goto skip_msi; 3659 3659 3660 3660 ret = pci_alloc_irq_vectors(ha->pdev, 1, 1, PCI_IRQ_MSI); 3661 - if (!ret) { 3661 + if (ret > 0) { 3662 3662 ql_dbg(ql_dbg_init, vha, 0x0038, 3663 3663 "MSI: Enabled.\n"); 3664 3664 ha->flags.msi_enabled = 1; 3665 3665 } else 3666 3666 ql_log(ql_log_warn, vha, 0x0039, 3667 - "Falling back-to INTa mode -- %d.\n", ret); 3667 + "Falling back-to INTa mode -- ret=%d.\n", ret); 3668 3668 skip_msi: 3669 3669 3670 3670 /* Skip INTx on ISP82xx. */
+1 -8
drivers/scsi/scsi_transport_sas.c
··· 1391 1391 struct sas_rphy *rphy = dev_to_rphy(dev); 1392 1392 struct sas_expander_device *edev = rphy_to_expander_device(rphy); 1393 1393 1394 - if (rphy->q) 1395 - blk_cleanup_queue(rphy->q); 1396 - 1397 1394 put_device(dev->parent); 1398 1395 kfree(edev); 1399 1396 } ··· 1399 1402 { 1400 1403 struct sas_rphy *rphy = dev_to_rphy(dev); 1401 1404 struct sas_end_device *edev = rphy_to_end_device(rphy); 1402 - 1403 - if (rphy->q) 1404 - blk_cleanup_queue(rphy->q); 1405 1405 1406 1406 put_device(dev->parent); 1407 1407 kfree(edev); ··· 1628 1634 } 1629 1635 1630 1636 sas_rphy_unlink(rphy); 1631 - if (rphy->q) 1632 - bsg_unregister_queue(rphy->q); 1637 + bsg_remove_queue(rphy->q); 1633 1638 transport_remove_device(dev); 1634 1639 device_del(dev); 1635 1640 }
+2 -7
drivers/scsi/sd.c
··· 122 122 static int sd_eh_action(struct scsi_cmnd *, int); 123 123 static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer); 124 124 static void scsi_disk_release(struct device *cdev); 125 - static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); 126 - static void sd_print_result(const struct scsi_disk *, const char *, int); 127 125 128 126 static DEFINE_IDA(sd_index_ida); 129 127 ··· 3724 3726 module_init(init_sd); 3725 3727 module_exit(exit_sd); 3726 3728 3727 - static void sd_print_sense_hdr(struct scsi_disk *sdkp, 3728 - struct scsi_sense_hdr *sshdr) 3729 + void sd_print_sense_hdr(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) 3729 3730 { 3730 3731 scsi_print_sense_hdr(sdkp->device, 3731 3732 sdkp->disk ? sdkp->disk->disk_name : NULL, sshdr); 3732 3733 } 3733 3734 3734 - static void sd_print_result(const struct scsi_disk *sdkp, const char *msg, 3735 - int result) 3735 + void sd_print_result(const struct scsi_disk *sdkp, const char *msg, int result) 3736 3736 { 3737 3737 const char *hb_string = scsi_hostbyte_string(result); 3738 3738 const char *db_string = scsi_driverbyte_string(result); ··· 3745 3749 "%s: Result: hostbyte=0x%02x driverbyte=0x%02x\n", 3746 3750 msg, host_byte(result), driver_byte(result)); 3747 3751 } 3748 -
+3
drivers/scsi/sd.h
··· 241 241 242 242 #endif /* CONFIG_BLK_DEV_ZONED */ 243 243 244 + void sd_print_sense_hdr(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr); 245 + void sd_print_result(const struct scsi_disk *sdkp, const char *msg, int result); 246 + 244 247 #endif /* _SCSI_DISK_H */
+5 -3
drivers/scsi/sd_zbc.c
··· 80 80 timeout, SD_MAX_RETRIES, NULL); 81 81 if (result) { 82 82 sd_printk(KERN_ERR, sdkp, 83 - "REPORT ZONES lba %llu failed with %d/%d\n", 84 - (unsigned long long)lba, 85 - host_byte(result), driver_byte(result)); 83 + "REPORT ZONES start lba %llu failed\n", lba); 84 + sd_print_result(sdkp, "REPORT ZONES", result); 85 + if (driver_byte(result) == DRIVER_SENSE && 86 + scsi_sense_valid(&sshdr)) 87 + sd_print_sense_hdr(sdkp, &sshdr); 86 88 return -EIO; 87 89 } 88 90