Skip to content

Commit a763d5a

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: "Four fixes, all in drivers. Three are small and obvious, the qedi one is a bit larger but also pretty obvious" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: qla2xxx: Format log strings only if needed scsi: scsi_debug: Fix buffer size of REPORT ZONES command scsi: qedi: Fix cmd_cleanup_cmpl counter mismatch issue scsi: pm80xx: Do not call scsi_remove_host() in pm8001_alloc()
2 parents e034d9c + 69002c8 commit a763d5a

File tree

6 files changed

+23
-29
lines changed

6 files changed

+23
-29
lines changed

drivers/scsi/pm8001/pm8001_init.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,12 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
282282
if (rc) {
283283
pm8001_dbg(pm8001_ha, FAIL,
284284
"pm8001_setup_irq failed [ret: %d]\n", rc);
285-
goto err_out_shost;
285+
goto err_out;
286286
}
287287
/* Request Interrupt */
288288
rc = pm8001_request_irq(pm8001_ha);
289289
if (rc)
290-
goto err_out_shost;
290+
goto err_out;
291291

292292
count = pm8001_ha->max_q_num;
293293
/* Queues are chosen based on the number of cores/msix availability */
@@ -423,8 +423,6 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
423423
pm8001_tag_init(pm8001_ha);
424424
return 0;
425425

426-
err_out_shost:
427-
scsi_remove_host(pm8001_ha->shost);
428426
err_out_nodev:
429427
for (i = 0; i < pm8001_ha->max_memcnt; i++) {
430428
if (pm8001_ha->memoryMap.region[i].virt_ptr != NULL) {

drivers/scsi/qedi/qedi_fw.c

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,6 @@ static void qedi_process_cmd_cleanup_resp(struct qedi_ctx *qedi,
732732
{
733733
struct qedi_work_map *work, *work_tmp;
734734
u32 proto_itt = cqe->itid;
735-
itt_t protoitt = 0;
736735
int found = 0;
737736
struct qedi_cmd *qedi_cmd = NULL;
738737
u32 iscsi_cid;
@@ -812,16 +811,12 @@ static void qedi_process_cmd_cleanup_resp(struct qedi_ctx *qedi,
812811
return;
813812

814813
check_cleanup_reqs:
815-
if (qedi_conn->cmd_cleanup_req > 0) {
816-
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_TID,
814+
if (atomic_inc_return(&qedi_conn->cmd_cleanup_cmpl) ==
815+
qedi_conn->cmd_cleanup_req) {
816+
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_SCSI_TM,
817817
"Freeing tid=0x%x for cid=0x%x\n",
818818
cqe->itid, qedi_conn->iscsi_conn_id);
819-
qedi_conn->cmd_cleanup_cmpl++;
820819
wake_up(&qedi_conn->wait_queue);
821-
} else {
822-
QEDI_ERR(&qedi->dbg_ctx,
823-
"Delayed or untracked cleanup response, itt=0x%x, tid=0x%x, cid=0x%x\n",
824-
protoitt, cqe->itid, qedi_conn->iscsi_conn_id);
825820
}
826821
}
827822

@@ -1163,7 +1158,7 @@ int qedi_cleanup_all_io(struct qedi_ctx *qedi, struct qedi_conn *qedi_conn,
11631158
}
11641159

11651160
qedi_conn->cmd_cleanup_req = 0;
1166-
qedi_conn->cmd_cleanup_cmpl = 0;
1161+
atomic_set(&qedi_conn->cmd_cleanup_cmpl, 0);
11671162

11681163
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_SCSI_TM,
11691164
"active_cmd_count=%d, cid=0x%x, in_recovery=%d, lun_reset=%d\n",
@@ -1215,16 +1210,15 @@ int qedi_cleanup_all_io(struct qedi_ctx *qedi, struct qedi_conn *qedi_conn,
12151210
qedi_conn->iscsi_conn_id);
12161211

12171212
rval = wait_event_interruptible_timeout(qedi_conn->wait_queue,
1218-
((qedi_conn->cmd_cleanup_req ==
1219-
qedi_conn->cmd_cleanup_cmpl) ||
1220-
test_bit(QEDI_IN_RECOVERY,
1221-
&qedi->flags)),
1222-
5 * HZ);
1213+
(qedi_conn->cmd_cleanup_req ==
1214+
atomic_read(&qedi_conn->cmd_cleanup_cmpl)) ||
1215+
test_bit(QEDI_IN_RECOVERY, &qedi->flags),
1216+
5 * HZ);
12231217
if (rval) {
12241218
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_SCSI_TM,
12251219
"i/o cmd_cleanup_req=%d, equal to cmd_cleanup_cmpl=%d, cid=0x%x\n",
12261220
qedi_conn->cmd_cleanup_req,
1227-
qedi_conn->cmd_cleanup_cmpl,
1221+
atomic_read(&qedi_conn->cmd_cleanup_cmpl),
12281222
qedi_conn->iscsi_conn_id);
12291223

12301224
return 0;
@@ -1233,7 +1227,7 @@ int qedi_cleanup_all_io(struct qedi_ctx *qedi, struct qedi_conn *qedi_conn,
12331227
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_SCSI_TM,
12341228
"i/o cmd_cleanup_req=%d, not equal to cmd_cleanup_cmpl=%d, cid=0x%x\n",
12351229
qedi_conn->cmd_cleanup_req,
1236-
qedi_conn->cmd_cleanup_cmpl,
1230+
atomic_read(&qedi_conn->cmd_cleanup_cmpl),
12371231
qedi_conn->iscsi_conn_id);
12381232

12391233
iscsi_host_for_each_session(qedi->shost,
@@ -1242,11 +1236,10 @@ int qedi_cleanup_all_io(struct qedi_ctx *qedi, struct qedi_conn *qedi_conn,
12421236

12431237
/* Enable IOs for all other sessions except current.*/
12441238
if (!wait_event_interruptible_timeout(qedi_conn->wait_queue,
1245-
(qedi_conn->cmd_cleanup_req ==
1246-
qedi_conn->cmd_cleanup_cmpl) ||
1247-
test_bit(QEDI_IN_RECOVERY,
1248-
&qedi->flags),
1249-
5 * HZ)) {
1239+
(qedi_conn->cmd_cleanup_req ==
1240+
atomic_read(&qedi_conn->cmd_cleanup_cmpl)) ||
1241+
test_bit(QEDI_IN_RECOVERY, &qedi->flags),
1242+
5 * HZ)) {
12501243
iscsi_host_for_each_session(qedi->shost,
12511244
qedi_mark_device_available);
12521245
return -1;
@@ -1266,7 +1259,7 @@ void qedi_clearsq(struct qedi_ctx *qedi, struct qedi_conn *qedi_conn,
12661259

12671260
qedi_ep = qedi_conn->ep;
12681261
qedi_conn->cmd_cleanup_req = 0;
1269-
qedi_conn->cmd_cleanup_cmpl = 0;
1262+
atomic_set(&qedi_conn->cmd_cleanup_cmpl, 0);
12701263

12711264
if (!qedi_ep) {
12721265
QEDI_WARN(&qedi->dbg_ctx,

drivers/scsi/qedi/qedi_iscsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static int qedi_conn_bind(struct iscsi_cls_session *cls_session,
412412
qedi_conn->iscsi_conn_id = qedi_ep->iscsi_cid;
413413
qedi_conn->fw_cid = qedi_ep->fw_cid;
414414
qedi_conn->cmd_cleanup_req = 0;
415-
qedi_conn->cmd_cleanup_cmpl = 0;
415+
atomic_set(&qedi_conn->cmd_cleanup_cmpl, 0);
416416

417417
if (qedi_bind_conn_to_iscsi_cid(qedi, qedi_conn)) {
418418
rc = -EINVAL;

drivers/scsi/qedi/qedi_iscsi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ struct qedi_conn {
155155
spinlock_t list_lock; /* internal conn lock */
156156
u32 active_cmd_count;
157157
u32 cmd_cleanup_req;
158-
u32 cmd_cleanup_cmpl;
158+
atomic_t cmd_cleanup_cmpl;
159159

160160
u32 iscsi_conn_id;
161161
int itt;

drivers/scsi/qla2xxx/qla_dbg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,6 +2491,9 @@ ql_dbg(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...)
24912491
struct va_format vaf;
24922492
char pbuf[64];
24932493

2494+
if (!ql_mask_match(level) && !trace_ql_dbg_log_enabled())
2495+
return;
2496+
24942497
va_start(va, fmt);
24952498

24962499
vaf.fmt = fmt;

drivers/scsi/scsi_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4342,7 +4342,7 @@ static int resp_report_zones(struct scsi_cmnd *scp,
43424342
rep_max_zones = min((alloc_len - 64) >> ilog2(RZONES_DESC_HD),
43434343
max_zones);
43444344

4345-
arr = kcalloc(RZONES_DESC_HD, alloc_len, GFP_ATOMIC);
4345+
arr = kzalloc(alloc_len, GFP_ATOMIC);
43464346
if (!arr) {
43474347
mk_sense_buffer(scp, ILLEGAL_REQUEST, INSUFF_RES_ASC,
43484348
INSUFF_RES_ASCQ);

0 commit comments

Comments
 (0)