Skip to content

Commit 9e574b7

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "23 fixes in 5 drivers (qla2xxx, ufs, scsi_debug, fcoe, zfcp). The bulk of the changes are in qla2xxx and ufs and all are mostly small and definitely don't impact the core" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (23 commits) Revert "scsi: qla2xxx: Disable T10-DIF feature with FC-NVMe during probe" Revert "scsi: qla2xxx: Fix crash on qla2x00_mailbox_command" scsi: qla2xxx: Fix null pointer access during disconnect from subsystem scsi: qla2xxx: Check if FW supports MQ before enabling scsi: qla2xxx: Fix WARN_ON in qla_nvme_register_hba scsi: qla2xxx: Allow ql2xextended_error_logging special value 1 to be set anytime scsi: qla2xxx: Reduce noisy debug message scsi: qla2xxx: Fix login timeout scsi: qla2xxx: Indicate correct supported speeds for Mezz card scsi: qla2xxx: Flush I/O on zone disable scsi: qla2xxx: Flush all sessions on zone disable scsi: qla2xxx: Use MBX_TOV_SECONDS for mailbox command timeout values scsi: scsi_debug: Fix scp is NULL errors scsi: zfcp: Fix use-after-free in request timeout handlers scsi: ufs: No need to send Abort Task if the task in DB was cleared scsi: ufs: Clean up completed request without interrupt notification scsi: ufs: Improve interrupt handling for shared interrupts scsi: ufs: Fix interrupt error message for shared interrupts scsi: ufs-pci: Add quirk for broken auto-hibernate for Intel EHL scsi: ufs-mediatek: Fix incorrect time to wait link status ...
2 parents d6af633 + dca9323 commit 9e574b7

File tree

16 files changed

+119
-52
lines changed

16 files changed

+119
-52
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid,
193193
}
194194

195195
/* alloc the udl from per cpu ddp pool */
196-
ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_KERNEL, &ddp->udp);
196+
ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_ATOMIC, &ddp->udp);
197197
if (!ddp->udl) {
198198
e_err(drv, "failed allocated ddp context\n");
199199
goto out_noddp_unmap;

drivers/s390/scsi/zfcp_fsf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ static void zfcp_fsf_req_complete(struct zfcp_fsf_req *req)
434434
return;
435435
}
436436

437-
del_timer(&req->timer);
437+
del_timer_sync(&req->timer);
438438
zfcp_fsf_protstatus_eval(req);
439439
zfcp_fsf_fsfstatus_eval(req);
440440
req->handler(req);
@@ -867,7 +867,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
867867
req->qdio_req.qdio_outb_usage = atomic_read(&qdio->req_q_free);
868868
req->issued = get_tod_clock();
869869
if (zfcp_qdio_send(qdio, &req->qdio_req)) {
870-
del_timer(&req->timer);
870+
del_timer_sync(&req->timer);
871871
/* lookup request again, list might have changed */
872872
zfcp_reqlist_find_rm(adapter->req_list, req_id);
873873
zfcp_erp_adapter_reopen(adapter, 0, "fsrs__1");

drivers/scsi/qla2xxx/qla_dbg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,5 +380,8 @@ extern int qla24xx_soft_reset(struct qla_hw_data *);
380380
static inline int
381381
ql_mask_match(uint level)
382382
{
383+
if (ql2xextended_error_logging == 1)
384+
ql2xextended_error_logging = QL_DBG_DEFAULT1_MASK;
385+
383386
return (level & ql2xextended_error_logging) == level;
384387
}

drivers/scsi/qla2xxx/qla_def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3880,6 +3880,7 @@ struct qla_hw_data {
38803880
uint32_t scm_supported_f:1;
38813881
/* Enabled in Driver */
38823882
uint32_t scm_enabled:1;
3883+
uint32_t max_req_queue_warned:1;
38833884
} flags;
38843885

38853886
uint16_t max_exchg;

drivers/scsi/qla2xxx/qla_gs.c

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,11 +1505,11 @@ qla2x00_prep_ct_fdmi_req(struct ct_sns_pkt *p, uint16_t cmd,
15051505
static uint
15061506
qla25xx_fdmi_port_speed_capability(struct qla_hw_data *ha)
15071507
{
1508+
uint speeds = 0;
1509+
15081510
if (IS_CNA_CAPABLE(ha))
15091511
return FDMI_PORT_SPEED_10GB;
15101512
if (IS_QLA28XX(ha) || IS_QLA27XX(ha)) {
1511-
uint speeds = 0;
1512-
15131513
if (ha->max_supported_speed == 2) {
15141514
if (ha->min_supported_speed <= 6)
15151515
speeds |= FDMI_PORT_SPEED_64GB;
@@ -1536,9 +1536,16 @@ qla25xx_fdmi_port_speed_capability(struct qla_hw_data *ha)
15361536
}
15371537
return speeds;
15381538
}
1539-
if (IS_QLA2031(ha))
1540-
return FDMI_PORT_SPEED_16GB|FDMI_PORT_SPEED_8GB|
1541-
FDMI_PORT_SPEED_4GB;
1539+
if (IS_QLA2031(ha)) {
1540+
if ((ha->pdev->subsystem_vendor == 0x103C) &&
1541+
(ha->pdev->subsystem_device == 0x8002)) {
1542+
speeds = FDMI_PORT_SPEED_16GB;
1543+
} else {
1544+
speeds = FDMI_PORT_SPEED_16GB|FDMI_PORT_SPEED_8GB|
1545+
FDMI_PORT_SPEED_4GB;
1546+
}
1547+
return speeds;
1548+
}
15421549
if (IS_QLA25XX(ha))
15431550
return FDMI_PORT_SPEED_8GB|FDMI_PORT_SPEED_4GB|
15441551
FDMI_PORT_SPEED_2GB|FDMI_PORT_SPEED_1GB;
@@ -3436,7 +3443,6 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
34363443
list_for_each_entry(fcport, &vha->vp_fcports, list) {
34373444
if ((fcport->flags & FCF_FABRIC_DEVICE) != 0) {
34383445
fcport->scan_state = QLA_FCPORT_SCAN;
3439-
fcport->logout_on_delete = 0;
34403446
}
34413447
}
34423448
goto login_logout;
@@ -3532,10 +3538,22 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
35323538
}
35333539

35343540
if (fcport->scan_state != QLA_FCPORT_FOUND) {
3541+
bool do_delete = false;
3542+
3543+
if (fcport->scan_needed &&
3544+
fcport->disc_state == DSC_LOGIN_PEND) {
3545+
/* Cable got disconnected after we sent
3546+
* a login. Do delete to prevent timeout.
3547+
*/
3548+
fcport->logout_on_delete = 1;
3549+
do_delete = true;
3550+
}
3551+
35353552
fcport->scan_needed = 0;
3536-
if ((qla_dual_mode_enabled(vha) ||
3537-
qla_ini_mode_enabled(vha)) &&
3538-
atomic_read(&fcport->state) == FCS_ONLINE) {
3553+
if (((qla_dual_mode_enabled(vha) ||
3554+
qla_ini_mode_enabled(vha)) &&
3555+
atomic_read(&fcport->state) == FCS_ONLINE) ||
3556+
do_delete) {
35393557
if (fcport->loop_id != FC_NO_LOOP_ID) {
35403558
if (fcport->flags & FCF_FCP2_DEVICE)
35413559
fcport->logout_on_delete = 0;
@@ -3736,6 +3754,18 @@ static void qla2x00_async_gpnft_gnnft_sp_done(srb_t *sp, int res)
37363754
unsigned long flags;
37373755
const char *name = sp->name;
37383756

3757+
if (res == QLA_OS_TIMER_EXPIRED) {
3758+
/* switch is ignoring all commands.
3759+
* This might be a zone disable behavior.
3760+
* This means we hit 64s timeout.
3761+
* 22s GPNFT + 44s Abort = 64s
3762+
*/
3763+
ql_dbg(ql_dbg_disc, vha, 0xffff,
3764+
"%s: Switch Zone check please .\n",
3765+
name);
3766+
qla2x00_mark_all_devices_lost(vha);
3767+
}
3768+
37393769
/*
37403770
* We are in an Interrupt context, queue up this
37413771
* sp for GNNFT_DONE work. This will allow all

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,8 +2024,8 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
20242024
res = DID_ERROR << 16;
20252025
}
20262026
}
2027-
ql_dbg(ql_dbg_user, vha, 0x503f,
2028-
"ELS IOCB Done -%s error hdl=%x comp_status=0x%x error subcode 1=0x%x error subcode 2=0x%x total_byte=0x%x\n",
2027+
ql_dbg(ql_dbg_disc, vha, 0x503f,
2028+
"ELS IOCB Done -%s hdl=%x comp_status=0x%x error subcode 1=0x%x error subcode 2=0x%x total_byte=0x%x\n",
20292029
type, sp->handle, comp_status, fw_status[1], fw_status[2],
20302030
le32_to_cpu(ese->total_byte_count));
20312031
goto els_ct_done;

drivers/scsi/qla2xxx/qla_mbx.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
334334
if (time_after(jiffies, wait_time))
335335
break;
336336

337-
/*
338-
* Check if it's UNLOADING, cause we cannot poll in
339-
* this case, or else a NULL pointer dereference
340-
* is triggered.
341-
*/
342-
if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags)))
343-
return QLA_FUNCTION_TIMEOUT;
344-
345337
/* Check for pending interrupts. */
346338
qla2x00_poll(ha->rsp_q_map[0]);
347339

@@ -5240,7 +5232,7 @@ qla2x00_read_ram_word(scsi_qla_host_t *vha, uint32_t risc_addr, uint32_t *data)
52405232
mcp->mb[8] = MSW(risc_addr);
52415233
mcp->out_mb = MBX_8|MBX_1|MBX_0;
52425234
mcp->in_mb = MBX_3|MBX_2|MBX_0;
5243-
mcp->tov = 30;
5235+
mcp->tov = MBX_TOV_SECONDS;
52445236
mcp->flags = 0;
52455237
rval = qla2x00_mailbox_command(vha, mcp);
52465238
if (rval != QLA_SUCCESS) {
@@ -5428,7 +5420,7 @@ qla2x00_write_ram_word(scsi_qla_host_t *vha, uint32_t risc_addr, uint32_t data)
54285420
mcp->mb[8] = MSW(risc_addr);
54295421
mcp->out_mb = MBX_8|MBX_3|MBX_2|MBX_1|MBX_0;
54305422
mcp->in_mb = MBX_1|MBX_0;
5431-
mcp->tov = 30;
5423+
mcp->tov = MBX_TOV_SECONDS;
54325424
mcp->flags = 0;
54335425
rval = qla2x00_mailbox_command(vha, mcp);
54345426
if (rval != QLA_SUCCESS) {
@@ -5700,7 +5692,7 @@ qla24xx_set_fcp_prio(scsi_qla_host_t *vha, uint16_t loop_id, uint16_t priority,
57005692
mcp->mb[9] = vha->vp_idx;
57015693
mcp->out_mb = MBX_9|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
57025694
mcp->in_mb = MBX_4|MBX_3|MBX_1|MBX_0;
5703-
mcp->tov = 30;
5695+
mcp->tov = MBX_TOV_SECONDS;
57045696
mcp->flags = 0;
57055697
rval = qla2x00_mailbox_command(vha, mcp);
57065698
if (mb != NULL) {
@@ -5787,7 +5779,7 @@ qla82xx_mbx_intr_enable(scsi_qla_host_t *vha)
57875779

57885780
mcp->out_mb = MBX_1|MBX_0;
57895781
mcp->in_mb = MBX_0;
5790-
mcp->tov = 30;
5782+
mcp->tov = MBX_TOV_SECONDS;
57915783
mcp->flags = 0;
57925784

57935785
rval = qla2x00_mailbox_command(vha, mcp);
@@ -5822,7 +5814,7 @@ qla82xx_mbx_intr_disable(scsi_qla_host_t *vha)
58225814

58235815
mcp->out_mb = MBX_1|MBX_0;
58245816
mcp->in_mb = MBX_0;
5825-
mcp->tov = 30;
5817+
mcp->tov = MBX_TOV_SECONDS;
58265818
mcp->flags = 0;
58275819

58285820
rval = qla2x00_mailbox_command(vha, mcp);
@@ -6014,7 +6006,7 @@ qla81xx_set_led_config(scsi_qla_host_t *vha, uint16_t *led_cfg)
60146006
if (IS_QLA8031(ha))
60156007
mcp->out_mb |= MBX_6|MBX_5|MBX_4|MBX_3;
60166008
mcp->in_mb = MBX_0;
6017-
mcp->tov = 30;
6009+
mcp->tov = MBX_TOV_SECONDS;
60186010
mcp->flags = 0;
60196011

60206012
rval = qla2x00_mailbox_command(vha, mcp);
@@ -6050,7 +6042,7 @@ qla81xx_get_led_config(scsi_qla_host_t *vha, uint16_t *led_cfg)
60506042
mcp->in_mb = MBX_2|MBX_1|MBX_0;
60516043
if (IS_QLA8031(ha))
60526044
mcp->in_mb |= MBX_6|MBX_5|MBX_4|MBX_3;
6053-
mcp->tov = 30;
6045+
mcp->tov = MBX_TOV_SECONDS;
60546046
mcp->flags = 0;
60556047

60566048
rval = qla2x00_mailbox_command(vha, mcp);

drivers/scsi/qla2xxx/qla_nvme.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,11 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
536536
struct nvme_private *priv = fd->private;
537537
struct qla_nvme_rport *qla_rport = rport->private;
538538

539+
if (!priv) {
540+
/* nvme association has been torn down */
541+
return rval;
542+
}
543+
539544
fcport = qla_rport->fcport;
540545

541546
if (!qpair || !fcport || (qpair && !qpair->fw_started) ||
@@ -687,7 +692,15 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
687692
tmpl = &qla_nvme_fc_transport;
688693

689694
WARN_ON(vha->nvme_local_port);
690-
WARN_ON(ha->max_req_queues < 3);
695+
696+
if (ha->max_req_queues < 3) {
697+
if (!ha->flags.max_req_queue_warned)
698+
ql_log(ql_log_info, vha, 0x2120,
699+
"%s: Disabling FC-NVME due to lack of free queue pairs (%d).\n",
700+
__func__, ha->max_req_queues);
701+
ha->flags.max_req_queue_warned = 1;
702+
return ret;
703+
}
691704

692705
qla_nvme_fc_transport.max_hw_queues =
693706
min((uint8_t)(qla_nvme_fc_transport.max_hw_queues),

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,6 +2017,11 @@ qla2x00_iospace_config(struct qla_hw_data *ha)
20172017
/* Determine queue resources */
20182018
ha->max_req_queues = ha->max_rsp_queues = 1;
20192019
ha->msix_count = QLA_BASE_VECTORS;
2020+
2021+
/* Check if FW supports MQ or not */
2022+
if (!(ha->fw_attributes & BIT_6))
2023+
goto mqiobase_exit;
2024+
20202025
if (!ql2xmqsupport || !ql2xnvmeenable ||
20212026
(!IS_QLA25XX(ha) && !IS_QLA81XX(ha)))
20222027
goto mqiobase_exit;
@@ -2829,10 +2834,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
28292834
/* This may fail but that's ok */
28302835
pci_enable_pcie_error_reporting(pdev);
28312836

2832-
/* Turn off T10-DIF when FC-NVMe is enabled */
2833-
if (ql2xnvmeenable)
2834-
ql2xenabledif = 0;
2835-
28362837
ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL);
28372838
if (!ha) {
28382839
ql_log_pci(ql_log_fatal, pdev, 0x0009,

drivers/scsi/qla2xxx/qla_target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess)
12701270

12711271
qla24xx_chk_fcp_state(sess);
12721272

1273-
ql_dbg(ql_dbg_tgt, sess->vha, 0xe001,
1273+
ql_dbg(ql_dbg_disc, sess->vha, 0xe001,
12741274
"Scheduling sess %p for deletion %8phC\n",
12751275
sess, sess->port_name);
12761276

0 commit comments

Comments
 (0)