Skip to content

Commit 138f371

Browse files
committed
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
2 parents a78f7cd + 1eb9151 commit 138f371

File tree

12 files changed

+36
-32
lines changed

12 files changed

+36
-32
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8764,6 +8764,7 @@ ISCSI
87648764
M: Lee Duncan <[email protected]>
87658765
M: Chris Leech <[email protected]>
87668766
8767+
87678768
W: www.open-iscsi.com
87688769
S: Maintained
87698770
F: drivers/scsi/*iscsi*

drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,6 @@ static long ibmvscsis_srp_i_logout(struct scsi_info *vscsi,
23542354
{
23552355
struct iu_entry *iue = cmd->iue;
23562356
struct srp_i_logout *log_out = &vio_iu(iue)->srp.i_logout;
2357-
long rc = ADAPT_SUCCESS;
23582357

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

2373-
return rc;
2372+
return ADAPT_SUCCESS;
23742373
}
23752374

23762375
/* Called with intr lock held */

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6460,7 +6460,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
64606460
u32 if_fam;
64616461

64626462
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;
64646464
phba->sli4_hba.curr_disp_cpu = 0;
64656465
lpfc_cpumask_of_node_init(phba);
64666466

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static bool support_nvme_encapsulation;
199199
static bool support_pci_lane_margining;
200200

201201
/* define lock for aen poll */
202-
spinlock_t poll_aen_lock;
202+
static spinlock_t poll_aen_lock;
203203

204204
extern struct dentry *megasas_debugfs_root;
205205
extern void megasas_init_debugfs(void);

drivers/scsi/pm8001/pm80xx_hwi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
* POSSIBILITY OF SUCH DAMAGES.
3838
*
3939
*/
40-
#include <linux/version.h>
4140
#include <linux/slab.h>
4241
#include "pm8001_sas.h"
4342
#include "pm80xx_hwi.h"
@@ -348,7 +347,7 @@ ssize_t pm80xx_get_fatal_dump(struct device *cdev,
348347
do {
349348
reg_val = pm8001_mr32(fatal_table_address,
350349
MPI_FATAL_EDUMP_TABLE_STATUS);
351-
} while (((reg_val != 2) || (reg_val != 3)) &&
350+
} while (((reg_val != 2) && (reg_val != 3)) &&
352351
time_before(jiffies, start));
353352

354353
if (reg_val < 2) {

drivers/scsi/qla2xxx/qla_gs.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3587,12 +3587,23 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
35873587
if (vha->scan.scan_retry < MAX_SCAN_RETRIES) {
35883588
set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
35893589
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
3590+
goto out;
35903591
} else {
3591-
ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff,
3592+
ql_dbg(ql_dbg_disc, vha, 0xffff,
35923593
"%s: Fabric scan failed for %d retries.\n",
35933594
__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;
35943606
}
3595-
goto out;
35963607
}
35973608
vha->scan.scan_retry = 0;
35983609

@@ -3670,6 +3681,7 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
36703681
dup_cnt);
36713682
}
36723683

3684+
login_logout:
36733685
/*
36743686
* Logout all previous fabric dev marked lost, except FCP2 devices.
36753687
*/

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5898,8 +5898,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
58985898
if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
58995899
break;
59005900

5901-
if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 ||
5902-
(fcport->flags & FCF_LOGIN_NEEDED) == 0)
5901+
if ((fcport->flags & FCF_FABRIC_DEVICE) == 0)
59035902
continue;
59045903

59055904
if (fcport->scan_state == QLA_FCPORT_SCAN) {
@@ -5922,7 +5921,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
59225921
}
59235922
}
59245923

5925-
if (fcport->scan_state == QLA_FCPORT_FOUND)
5924+
if (fcport->scan_state == QLA_FCPORT_FOUND &&
5925+
(fcport->flags & FCF_LOGIN_NEEDED) != 0)
59265926
qla24xx_fcport_handle_login(vha, fcport);
59275927
}
59285928
return (rval);

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3650,21 +3650,21 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
36503650
skip_msix:
36513651

36523652
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);
36543654

36553655
if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) &&
36563656
!IS_QLA8001(ha) && !IS_P3P_TYPE(ha) && !IS_QLAFX00(ha) &&
36573657
!IS_QLA27XX(ha) && !IS_QLA28XX(ha))
36583658
goto skip_msi;
36593659

36603660
ret = pci_alloc_irq_vectors(ha->pdev, 1, 1, PCI_IRQ_MSI);
3661-
if (!ret) {
3661+
if (ret > 0) {
36623662
ql_dbg(ql_dbg_init, vha, 0x0038,
36633663
"MSI: Enabled.\n");
36643664
ha->flags.msi_enabled = 1;
36653665
} else
36663666
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);
36683668
skip_msi:
36693669

36703670
/* Skip INTx on ISP82xx. */

drivers/scsi/scsi_transport_sas.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,9 +1391,6 @@ static void sas_expander_release(struct device *dev)
13911391
struct sas_rphy *rphy = dev_to_rphy(dev);
13921392
struct sas_expander_device *edev = rphy_to_expander_device(rphy);
13931393

1394-
if (rphy->q)
1395-
blk_cleanup_queue(rphy->q);
1396-
13971394
put_device(dev->parent);
13981395
kfree(edev);
13991396
}
@@ -1403,9 +1400,6 @@ static void sas_end_device_release(struct device *dev)
14031400
struct sas_rphy *rphy = dev_to_rphy(dev);
14041401
struct sas_end_device *edev = rphy_to_end_device(rphy);
14051402

1406-
if (rphy->q)
1407-
blk_cleanup_queue(rphy->q);
1408-
14091403
put_device(dev->parent);
14101404
kfree(edev);
14111405
}
@@ -1634,8 +1628,7 @@ sas_rphy_remove(struct sas_rphy *rphy)
16341628
}
16351629

16361630
sas_rphy_unlink(rphy);
1637-
if (rphy->q)
1638-
bsg_unregister_queue(rphy->q);
1631+
bsg_remove_queue(rphy->q);
16391632
transport_remove_device(dev);
16401633
device_del(dev);
16411634
}

drivers/scsi/sd.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ static void sd_eh_reset(struct scsi_cmnd *);
122122
static int sd_eh_action(struct scsi_cmnd *, int);
123123
static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
124124
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);
127125

128126
static DEFINE_IDA(sd_index_ida);
129127

@@ -3726,15 +3724,13 @@ static void __exit exit_sd(void)
37263724
module_init(init_sd);
37273725
module_exit(exit_sd);
37283726

3729-
static void sd_print_sense_hdr(struct scsi_disk *sdkp,
3730-
struct scsi_sense_hdr *sshdr)
3727+
void sd_print_sense_hdr(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr)
37313728
{
37323729
scsi_print_sense_hdr(sdkp->device,
37333730
sdkp->disk ? sdkp->disk->disk_name : NULL, sshdr);
37343731
}
37353732

3736-
static void sd_print_result(const struct scsi_disk *sdkp, const char *msg,
3737-
int result)
3733+
void sd_print_result(const struct scsi_disk *sdkp, const char *msg, int result)
37383734
{
37393735
const char *hb_string = scsi_hostbyte_string(result);
37403736
const char *db_string = scsi_driverbyte_string(result);
@@ -3749,4 +3745,3 @@ static void sd_print_result(const struct scsi_disk *sdkp, const char *msg,
37493745
"%s: Result: hostbyte=0x%02x driverbyte=0x%02x\n",
37503746
msg, host_byte(result), driver_byte(result));
37513747
}
3752-

drivers/scsi/sd.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,7 @@ static inline void sd_zbc_complete(struct scsi_cmnd *cmd,
241241

242242
#endif /* CONFIG_BLK_DEV_ZONED */
243243

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+
244247
#endif /* _SCSI_DISK_H */

drivers/scsi/sd_zbc.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf,
8080
timeout, SD_MAX_RETRIES, NULL);
8181
if (result) {
8282
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);
8688
return -EIO;
8789
}
8890

0 commit comments

Comments
 (0)