Skip to content

Commit

Permalink
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/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
  • Loading branch information
Linus Torvalds committed Dec 8, 2019
2 parents a78f7cd + 1eb9151 commit 138f371
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 32 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8764,6 +8764,7 @@ ISCSI
M: Lee Duncan <lduncan@suse.com>
M: Chris Leech <cleech@redhat.com>
L: open-iscsi@googlegroups.com
L: linux-scsi@vger.kernel.org
W: www.open-iscsi.com
S: Maintained
F: drivers/scsi/*iscsi*
Expand Down
3 changes: 1 addition & 2 deletions drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,6 @@ static long ibmvscsis_srp_i_logout(struct scsi_info *vscsi,
{
struct iu_entry *iue = cmd->iue;
struct srp_i_logout *log_out = &vio_iu(iue)->srp.i_logout;
long rc = ADAPT_SUCCESS;

if ((vscsi->debit > 0) || !list_empty(&vscsi->schedule_q) ||
!list_empty(&vscsi->waiting_rsp)) {
Expand All @@ -2370,7 +2369,7 @@ static long ibmvscsis_srp_i_logout(struct scsi_info *vscsi,
ibmvscsis_post_disconnect(vscsi, WAIT_IDLE, 0);
}

return rc;
return ADAPT_SUCCESS;
}

/* Called with intr lock held */
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -6460,7 +6460,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
u32 if_fam;

phba->sli4_hba.num_present_cpu = lpfc_present_cpu;
phba->sli4_hba.num_possible_cpu = num_possible_cpus();
phba->sli4_hba.num_possible_cpu = cpumask_last(cpu_possible_mask) + 1;
phba->sli4_hba.curr_disp_cpu = 0;
lpfc_cpumask_of_node_init(phba);

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/megaraid/megaraid_sas_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static bool support_nvme_encapsulation;
static bool support_pci_lane_margining;

/* define lock for aen poll */
spinlock_t poll_aen_lock;
static spinlock_t poll_aen_lock;

extern struct dentry *megasas_debugfs_root;
extern void megasas_init_debugfs(void);
Expand Down
3 changes: 1 addition & 2 deletions drivers/scsi/pm8001/pm80xx_hwi.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*
*/
#include <linux/version.h>
#include <linux/slab.h>
#include "pm8001_sas.h"
#include "pm80xx_hwi.h"
Expand Down Expand Up @@ -348,7 +347,7 @@ ssize_t pm80xx_get_fatal_dump(struct device *cdev,
do {
reg_val = pm8001_mr32(fatal_table_address,
MPI_FATAL_EDUMP_TABLE_STATUS);
} while (((reg_val != 2) || (reg_val != 3)) &&
} while (((reg_val != 2) && (reg_val != 3)) &&
time_before(jiffies, start));

if (reg_val < 2) {
Expand Down
16 changes: 14 additions & 2 deletions drivers/scsi/qla2xxx/qla_gs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3587,12 +3587,23 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
if (vha->scan.scan_retry < MAX_SCAN_RETRIES) {
set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
goto out;
} else {
ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff,
ql_dbg(ql_dbg_disc, vha, 0xffff,
"%s: Fabric scan failed for %d retries.\n",
__func__, vha->scan.scan_retry);
/*
* Unable to scan any rports. logout loop below
* will unregister all sessions.
*/
list_for_each_entry(fcport, &vha->vp_fcports, list) {
if ((fcport->flags & FCF_FABRIC_DEVICE) != 0) {
fcport->scan_state = QLA_FCPORT_SCAN;
fcport->logout_on_delete = 0;
}
}
goto login_logout;
}
goto out;
}
vha->scan.scan_retry = 0;

Expand Down Expand Up @@ -3670,6 +3681,7 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
dup_cnt);
}

login_logout:
/*
* Logout all previous fabric dev marked lost, except FCP2 devices.
*/
Expand Down
6 changes: 3 additions & 3 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -5898,8 +5898,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
break;

if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 ||
(fcport->flags & FCF_LOGIN_NEEDED) == 0)
if ((fcport->flags & FCF_FABRIC_DEVICE) == 0)
continue;

if (fcport->scan_state == QLA_FCPORT_SCAN) {
Expand All @@ -5922,7 +5921,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
}
}

if (fcport->scan_state == QLA_FCPORT_FOUND)
if (fcport->scan_state == QLA_FCPORT_FOUND &&
(fcport->flags & FCF_LOGIN_NEEDED) != 0)
qla24xx_fcport_handle_login(vha, fcport);
}
return (rval);
Expand Down
6 changes: 3 additions & 3 deletions drivers/scsi/qla2xxx/qla_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3650,21 +3650,21 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
skip_msix:

ql_log(ql_log_info, vha, 0x0037,
"Falling back-to MSI mode -%d.\n", ret);
"Falling back-to MSI mode -- ret=%d.\n", ret);

if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) &&
!IS_QLA8001(ha) && !IS_P3P_TYPE(ha) && !IS_QLAFX00(ha) &&
!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
goto skip_msi;

ret = pci_alloc_irq_vectors(ha->pdev, 1, 1, PCI_IRQ_MSI);
if (!ret) {
if (ret > 0) {
ql_dbg(ql_dbg_init, vha, 0x0038,
"MSI: Enabled.\n");
ha->flags.msi_enabled = 1;
} else
ql_log(ql_log_warn, vha, 0x0039,
"Falling back-to INTa mode -- %d.\n", ret);
"Falling back-to INTa mode -- ret=%d.\n", ret);
skip_msi:

/* Skip INTx on ISP82xx. */
Expand Down
9 changes: 1 addition & 8 deletions drivers/scsi/scsi_transport_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -1391,9 +1391,6 @@ static void sas_expander_release(struct device *dev)
struct sas_rphy *rphy = dev_to_rphy(dev);
struct sas_expander_device *edev = rphy_to_expander_device(rphy);

if (rphy->q)
blk_cleanup_queue(rphy->q);

put_device(dev->parent);
kfree(edev);
}
Expand All @@ -1403,9 +1400,6 @@ static void sas_end_device_release(struct device *dev)
struct sas_rphy *rphy = dev_to_rphy(dev);
struct sas_end_device *edev = rphy_to_end_device(rphy);

if (rphy->q)
blk_cleanup_queue(rphy->q);

put_device(dev->parent);
kfree(edev);
}
Expand Down Expand Up @@ -1634,8 +1628,7 @@ sas_rphy_remove(struct sas_rphy *rphy)
}

sas_rphy_unlink(rphy);
if (rphy->q)
bsg_unregister_queue(rphy->q);
bsg_remove_queue(rphy->q);
transport_remove_device(dev);
device_del(dev);
}
Expand Down
9 changes: 2 additions & 7 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ static void sd_eh_reset(struct scsi_cmnd *);
static int sd_eh_action(struct scsi_cmnd *, int);
static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
static void scsi_disk_release(struct device *cdev);
static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
static void sd_print_result(const struct scsi_disk *, const char *, int);

static DEFINE_IDA(sd_index_ida);

Expand Down Expand Up @@ -3726,15 +3724,13 @@ static void __exit exit_sd(void)
module_init(init_sd);
module_exit(exit_sd);

static void sd_print_sense_hdr(struct scsi_disk *sdkp,
struct scsi_sense_hdr *sshdr)
void sd_print_sense_hdr(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)
{
scsi_print_sense_hdr(sdkp->device,
sdkp->disk ? sdkp->disk->disk_name : NULL, sshdr);
}

static void sd_print_result(const struct scsi_disk *sdkp, const char *msg,
int result)
void sd_print_result(const struct scsi_disk *sdkp, const char *msg, int result)
{
const char *hb_string = scsi_hostbyte_string(result);
const char *db_string = scsi_driverbyte_string(result);
Expand All @@ -3749,4 +3745,3 @@ static void sd_print_result(const struct scsi_disk *sdkp, const char *msg,
"%s: Result: hostbyte=0x%02x driverbyte=0x%02x\n",
msg, host_byte(result), driver_byte(result));
}

3 changes: 3 additions & 0 deletions drivers/scsi/sd.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,7 @@ static inline void sd_zbc_complete(struct scsi_cmnd *cmd,

#endif /* CONFIG_BLK_DEV_ZONED */

void sd_print_sense_hdr(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr);
void sd_print_result(const struct scsi_disk *sdkp, const char *msg, int result);

#endif /* _SCSI_DISK_H */
8 changes: 5 additions & 3 deletions drivers/scsi/sd_zbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf,
timeout, SD_MAX_RETRIES, NULL);
if (result) {
sd_printk(KERN_ERR, sdkp,
"REPORT ZONES lba %llu failed with %d/%d\n",
(unsigned long long)lba,
host_byte(result), driver_byte(result));
"REPORT ZONES start lba %llu failed\n", lba);
sd_print_result(sdkp, "REPORT ZONES", result);
if (driver_byte(result) == DRIVER_SENSE &&
scsi_sense_valid(&sshdr))
sd_print_sense_hdr(sdkp, &sshdr);
return -EIO;
}

Expand Down

0 comments on commit 138f371

Please sign in to comment.