aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-08-16 20:21:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-08-16 20:21:20 -0400
commitac9a40905a610fb02086a37b11ff4bf046825a88 (patch)
treeb08dfbd233483126fa1cd8aa5559564105d00c02
parent422ce075f969ffd650e371faa5a02586d0c0b2e6 (diff)
parent424f727b94132a4193af401dd823c44612d1d59f (diff)
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "A couple of minor fixes (st, ses) and some bigger driver fixes for qla2xxx (crash triggered by fw dump) and ipr (lockdep problems with mq)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ses: Fix wrong page error scsi: ipr: Fix scsi-mq lockdep issue scsi: st: fix blk_get_queue usage scsi: qla2xxx: Fix system crash while triggering FW dump
-rw-r--r--drivers/scsi/ipr.c33
-rw-r--r--drivers/scsi/ipr.h2
-rw-r--r--drivers/scsi/qla2xxx/qla_tmpl.c12
-rw-r--r--drivers/scsi/ses.c2
-rw-r--r--drivers/scsi/st.c4
5 files changed, 24 insertions, 29 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index b0c68d24db01..da5bdbdcce52 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3351,6 +3351,16 @@ static void ipr_worker_thread(struct work_struct *work)
3351 return; 3351 return;
3352 } 3352 }
3353 3353
3354 if (ioa_cfg->scsi_unblock) {
3355 ioa_cfg->scsi_unblock = 0;
3356 ioa_cfg->scsi_blocked = 0;
3357 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
3358 scsi_unblock_requests(ioa_cfg->host);
3359 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
3360 if (ioa_cfg->scsi_blocked)
3361 scsi_block_requests(ioa_cfg->host);
3362 }
3363
3354 if (!ioa_cfg->scan_enabled) { 3364 if (!ioa_cfg->scan_enabled) {
3355 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 3365 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
3356 return; 3366 return;
@@ -7211,9 +7221,8 @@ static int ipr_ioa_bringdown_done(struct ipr_cmnd *ipr_cmd)
7211 ENTER; 7221 ENTER;
7212 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) { 7222 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
7213 ipr_trace; 7223 ipr_trace;
7214 spin_unlock_irq(ioa_cfg->host->host_lock); 7224 ioa_cfg->scsi_unblock = 1;
7215 scsi_unblock_requests(ioa_cfg->host); 7225 schedule_work(&ioa_cfg->work_q);
7216 spin_lock_irq(ioa_cfg->host->host_lock);
7217 } 7226 }
7218 7227
7219 ioa_cfg->in_reset_reload = 0; 7228 ioa_cfg->in_reset_reload = 0;
@@ -7287,13 +7296,7 @@ static int ipr_ioa_reset_done(struct ipr_cmnd *ipr_cmd)
7287 list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); 7296 list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
7288 wake_up_all(&ioa_cfg->reset_wait_q); 7297 wake_up_all(&ioa_cfg->reset_wait_q);
7289 7298
7290 spin_unlock(ioa_cfg->host->host_lock); 7299 ioa_cfg->scsi_unblock = 1;
7291 scsi_unblock_requests(ioa_cfg->host);
7292 spin_lock(ioa_cfg->host->host_lock);
7293
7294 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].allow_cmds)
7295 scsi_block_requests(ioa_cfg->host);
7296
7297 schedule_work(&ioa_cfg->work_q); 7300 schedule_work(&ioa_cfg->work_q);
7298 LEAVE; 7301 LEAVE;
7299 return IPR_RC_JOB_RETURN; 7302 return IPR_RC_JOB_RETURN;
@@ -9249,8 +9252,11 @@ static void _ipr_initiate_ioa_reset(struct ipr_ioa_cfg *ioa_cfg,
9249 spin_unlock(&ioa_cfg->hrrq[i]._lock); 9252 spin_unlock(&ioa_cfg->hrrq[i]._lock);
9250 } 9253 }
9251 wmb(); 9254 wmb();
9252 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) 9255 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
9256 ioa_cfg->scsi_unblock = 0;
9257 ioa_cfg->scsi_blocked = 1;
9253 scsi_block_requests(ioa_cfg->host); 9258 scsi_block_requests(ioa_cfg->host);
9259 }
9254 9260
9255 ipr_cmd = ipr_get_free_ipr_cmnd(ioa_cfg); 9261 ipr_cmd = ipr_get_free_ipr_cmnd(ioa_cfg);
9256 ioa_cfg->reset_cmd = ipr_cmd; 9262 ioa_cfg->reset_cmd = ipr_cmd;
@@ -9306,9 +9312,8 @@ static void ipr_initiate_ioa_reset(struct ipr_ioa_cfg *ioa_cfg,
9306 wake_up_all(&ioa_cfg->reset_wait_q); 9312 wake_up_all(&ioa_cfg->reset_wait_q);
9307 9313
9308 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) { 9314 if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
9309 spin_unlock_irq(ioa_cfg->host->host_lock); 9315 ioa_cfg->scsi_unblock = 1;
9310 scsi_unblock_requests(ioa_cfg->host); 9316 schedule_work(&ioa_cfg->work_q);
9311 spin_lock_irq(ioa_cfg->host->host_lock);
9312 } 9317 }
9313 return; 9318 return;
9314 } else { 9319 } else {
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index e98a87a65335..c7f0e9e3cd7d 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1488,6 +1488,8 @@ struct ipr_ioa_cfg {
1488 u8 cfg_locked:1; 1488 u8 cfg_locked:1;
1489 u8 clear_isr:1; 1489 u8 clear_isr:1;
1490 u8 probe_done:1; 1490 u8 probe_done:1;
1491 u8 scsi_unblock:1;
1492 u8 scsi_blocked:1;
1491 1493
1492 u8 revid; 1494 u8 revid;
1493 1495
diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c
index 33142610882f..b18646d6057f 100644
--- a/drivers/scsi/qla2xxx/qla_tmpl.c
+++ b/drivers/scsi/qla2xxx/qla_tmpl.c
@@ -401,9 +401,6 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
401 for (i = 0; i < vha->hw->max_req_queues; i++) { 401 for (i = 0; i < vha->hw->max_req_queues; i++) {
402 struct req_que *req = vha->hw->req_q_map[i]; 402 struct req_que *req = vha->hw->req_q_map[i];
403 403
404 if (!test_bit(i, vha->hw->req_qid_map))
405 continue;
406
407 if (req || !buf) { 404 if (req || !buf) {
408 length = req ? 405 length = req ?
409 req->length : REQUEST_ENTRY_CNT_24XX; 406 req->length : REQUEST_ENTRY_CNT_24XX;
@@ -418,9 +415,6 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
418 for (i = 0; i < vha->hw->max_rsp_queues; i++) { 415 for (i = 0; i < vha->hw->max_rsp_queues; i++) {
419 struct rsp_que *rsp = vha->hw->rsp_q_map[i]; 416 struct rsp_que *rsp = vha->hw->rsp_q_map[i];
420 417
421 if (!test_bit(i, vha->hw->rsp_qid_map))
422 continue;
423
424 if (rsp || !buf) { 418 if (rsp || !buf) {
425 length = rsp ? 419 length = rsp ?
426 rsp->length : RESPONSE_ENTRY_CNT_MQ; 420 rsp->length : RESPONSE_ENTRY_CNT_MQ;
@@ -660,9 +654,6 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
660 for (i = 0; i < vha->hw->max_req_queues; i++) { 654 for (i = 0; i < vha->hw->max_req_queues; i++) {
661 struct req_que *req = vha->hw->req_q_map[i]; 655 struct req_que *req = vha->hw->req_q_map[i];
662 656
663 if (!test_bit(i, vha->hw->req_qid_map))
664 continue;
665
666 if (req || !buf) { 657 if (req || !buf) {
667 qla27xx_insert16(i, buf, len); 658 qla27xx_insert16(i, buf, len);
668 qla27xx_insert16(1, buf, len); 659 qla27xx_insert16(1, buf, len);
@@ -675,9 +666,6 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
675 for (i = 0; i < vha->hw->max_rsp_queues; i++) { 666 for (i = 0; i < vha->hw->max_rsp_queues; i++) {
676 struct rsp_que *rsp = vha->hw->rsp_q_map[i]; 667 struct rsp_que *rsp = vha->hw->rsp_q_map[i];
677 668
678 if (!test_bit(i, vha->hw->rsp_qid_map))
679 continue;
680
681 if (rsp || !buf) { 669 if (rsp || !buf) {
682 qla27xx_insert16(i, buf, len); 670 qla27xx_insert16(i, buf, len);
683 qla27xx_insert16(1, buf, len); 671 qla27xx_insert16(1, buf, len);
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index f1cdf32d7514..8927f9f54ad9 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -99,7 +99,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,
99 99
100 ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen, 100 ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen,
101 NULL, SES_TIMEOUT, SES_RETRIES, NULL); 101 NULL, SES_TIMEOUT, SES_RETRIES, NULL);
102 if (unlikely(!ret)) 102 if (unlikely(ret))
103 return ret; 103 return ret;
104 104
105 recv_page_code = ((unsigned char *)buf)[0]; 105 recv_page_code = ((unsigned char *)buf)[0];
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 8e5013d9cad4..94e402ed30f6 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4299,11 +4299,11 @@ static int st_probe(struct device *dev)
4299 kref_init(&tpnt->kref); 4299 kref_init(&tpnt->kref);
4300 tpnt->disk = disk; 4300 tpnt->disk = disk;
4301 disk->private_data = &tpnt->driver; 4301 disk->private_data = &tpnt->driver;
4302 disk->queue = SDp->request_queue;
4303 /* SCSI tape doesn't register this gendisk via add_disk(). Manually 4302 /* SCSI tape doesn't register this gendisk via add_disk(). Manually
4304 * take queue reference that release_disk() expects. */ 4303 * take queue reference that release_disk() expects. */
4305 if (!blk_get_queue(disk->queue)) 4304 if (!blk_get_queue(SDp->request_queue))
4306 goto out_put_disk; 4305 goto out_put_disk;
4306 disk->queue = SDp->request_queue;
4307 tpnt->driver = &st_template; 4307 tpnt->driver = &st_template;
4308 4308
4309 tpnt->device = SDp; 4309 tpnt->device = SDp;