Commit ac9a4090 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 422ce075 424f727b
...@@ -3351,6 +3351,16 @@ static void ipr_worker_thread(struct work_struct *work) ...@@ -3351,6 +3351,16 @@ static void ipr_worker_thread(struct work_struct *work)
return; return;
} }
if (ioa_cfg->scsi_unblock) {
ioa_cfg->scsi_unblock = 0;
ioa_cfg->scsi_blocked = 0;
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
scsi_unblock_requests(ioa_cfg->host);
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
if (ioa_cfg->scsi_blocked)
scsi_block_requests(ioa_cfg->host);
}
if (!ioa_cfg->scan_enabled) { if (!ioa_cfg->scan_enabled) {
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
return; return;
...@@ -7211,9 +7221,8 @@ static int ipr_ioa_bringdown_done(struct ipr_cmnd *ipr_cmd) ...@@ -7211,9 +7221,8 @@ static int ipr_ioa_bringdown_done(struct ipr_cmnd *ipr_cmd)
ENTER; ENTER;
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) { if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
ipr_trace; ipr_trace;
spin_unlock_irq(ioa_cfg->host->host_lock); ioa_cfg->scsi_unblock = 1;
scsi_unblock_requests(ioa_cfg->host); schedule_work(&ioa_cfg->work_q);
spin_lock_irq(ioa_cfg->host->host_lock);
} }
ioa_cfg->in_reset_reload = 0; ioa_cfg->in_reset_reload = 0;
...@@ -7287,13 +7296,7 @@ static int ipr_ioa_reset_done(struct ipr_cmnd *ipr_cmd) ...@@ -7287,13 +7296,7 @@ static int ipr_ioa_reset_done(struct ipr_cmnd *ipr_cmd)
list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
wake_up_all(&ioa_cfg->reset_wait_q); wake_up_all(&ioa_cfg->reset_wait_q);
spin_unlock(ioa_cfg->host->host_lock); ioa_cfg->scsi_unblock = 1;
scsi_unblock_requests(ioa_cfg->host);
spin_lock(ioa_cfg->host->host_lock);
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].allow_cmds)
scsi_block_requests(ioa_cfg->host);
schedule_work(&ioa_cfg->work_q); schedule_work(&ioa_cfg->work_q);
LEAVE; LEAVE;
return IPR_RC_JOB_RETURN; return IPR_RC_JOB_RETURN;
...@@ -9249,8 +9252,11 @@ static void _ipr_initiate_ioa_reset(struct ipr_ioa_cfg *ioa_cfg, ...@@ -9249,8 +9252,11 @@ static void _ipr_initiate_ioa_reset(struct ipr_ioa_cfg *ioa_cfg,
spin_unlock(&ioa_cfg->hrrq[i]._lock); spin_unlock(&ioa_cfg->hrrq[i]._lock);
} }
wmb(); wmb();
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
ioa_cfg->scsi_unblock = 0;
ioa_cfg->scsi_blocked = 1;
scsi_block_requests(ioa_cfg->host); scsi_block_requests(ioa_cfg->host);
}
ipr_cmd = ipr_get_free_ipr_cmnd(ioa_cfg); ipr_cmd = ipr_get_free_ipr_cmnd(ioa_cfg);
ioa_cfg->reset_cmd = ipr_cmd; ioa_cfg->reset_cmd = ipr_cmd;
...@@ -9306,9 +9312,8 @@ static void ipr_initiate_ioa_reset(struct ipr_ioa_cfg *ioa_cfg, ...@@ -9306,9 +9312,8 @@ static void ipr_initiate_ioa_reset(struct ipr_ioa_cfg *ioa_cfg,
wake_up_all(&ioa_cfg->reset_wait_q); wake_up_all(&ioa_cfg->reset_wait_q);
if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) { if (!ioa_cfg->hrrq[IPR_INIT_HRRQ].removing_ioa) {
spin_unlock_irq(ioa_cfg->host->host_lock); ioa_cfg->scsi_unblock = 1;
scsi_unblock_requests(ioa_cfg->host); schedule_work(&ioa_cfg->work_q);
spin_lock_irq(ioa_cfg->host->host_lock);
} }
return; return;
} else { } else {
......
...@@ -1488,6 +1488,8 @@ struct ipr_ioa_cfg { ...@@ -1488,6 +1488,8 @@ struct ipr_ioa_cfg {
u8 cfg_locked:1; u8 cfg_locked:1;
u8 clear_isr:1; u8 clear_isr:1;
u8 probe_done:1; u8 probe_done:1;
u8 scsi_unblock:1;
u8 scsi_blocked:1;
u8 revid; u8 revid;
......
...@@ -401,9 +401,6 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha, ...@@ -401,9 +401,6 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
for (i = 0; i < vha->hw->max_req_queues; i++) { for (i = 0; i < vha->hw->max_req_queues; i++) {
struct req_que *req = vha->hw->req_q_map[i]; struct req_que *req = vha->hw->req_q_map[i];
if (!test_bit(i, vha->hw->req_qid_map))
continue;
if (req || !buf) { if (req || !buf) {
length = req ? length = req ?
req->length : REQUEST_ENTRY_CNT_24XX; req->length : REQUEST_ENTRY_CNT_24XX;
...@@ -418,9 +415,6 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha, ...@@ -418,9 +415,6 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
for (i = 0; i < vha->hw->max_rsp_queues; i++) { for (i = 0; i < vha->hw->max_rsp_queues; i++) {
struct rsp_que *rsp = vha->hw->rsp_q_map[i]; struct rsp_que *rsp = vha->hw->rsp_q_map[i];
if (!test_bit(i, vha->hw->rsp_qid_map))
continue;
if (rsp || !buf) { if (rsp || !buf) {
length = rsp ? length = rsp ?
rsp->length : RESPONSE_ENTRY_CNT_MQ; rsp->length : RESPONSE_ENTRY_CNT_MQ;
...@@ -660,9 +654,6 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha, ...@@ -660,9 +654,6 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
for (i = 0; i < vha->hw->max_req_queues; i++) { for (i = 0; i < vha->hw->max_req_queues; i++) {
struct req_que *req = vha->hw->req_q_map[i]; struct req_que *req = vha->hw->req_q_map[i];
if (!test_bit(i, vha->hw->req_qid_map))
continue;
if (req || !buf) { if (req || !buf) {
qla27xx_insert16(i, buf, len); qla27xx_insert16(i, buf, len);
qla27xx_insert16(1, buf, len); qla27xx_insert16(1, buf, len);
...@@ -675,9 +666,6 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha, ...@@ -675,9 +666,6 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
for (i = 0; i < vha->hw->max_rsp_queues; i++) { for (i = 0; i < vha->hw->max_rsp_queues; i++) {
struct rsp_que *rsp = vha->hw->rsp_q_map[i]; struct rsp_que *rsp = vha->hw->rsp_q_map[i];
if (!test_bit(i, vha->hw->rsp_qid_map))
continue;
if (rsp || !buf) { if (rsp || !buf) {
qla27xx_insert16(i, buf, len); qla27xx_insert16(i, buf, len);
qla27xx_insert16(1, buf, len); qla27xx_insert16(1, buf, len);
......
...@@ -99,7 +99,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code, ...@@ -99,7 +99,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,
ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen, ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen,
NULL, SES_TIMEOUT, SES_RETRIES, NULL); NULL, SES_TIMEOUT, SES_RETRIES, NULL);
if (unlikely(!ret)) if (unlikely(ret))
return ret; return ret;
recv_page_code = ((unsigned char *)buf)[0]; recv_page_code = ((unsigned char *)buf)[0];
......
...@@ -4299,11 +4299,11 @@ static int st_probe(struct device *dev) ...@@ -4299,11 +4299,11 @@ static int st_probe(struct device *dev)
kref_init(&tpnt->kref); kref_init(&tpnt->kref);
tpnt->disk = disk; tpnt->disk = disk;
disk->private_data = &tpnt->driver; disk->private_data = &tpnt->driver;
disk->queue = SDp->request_queue;
/* SCSI tape doesn't register this gendisk via add_disk(). Manually /* SCSI tape doesn't register this gendisk via add_disk(). Manually
* take queue reference that release_disk() expects. */ * take queue reference that release_disk() expects. */
if (!blk_get_queue(disk->queue)) if (!blk_get_queue(SDp->request_queue))
goto out_put_disk; goto out_put_disk;
disk->queue = SDp->request_queue;
tpnt->driver = &st_template; tpnt->driver = &st_template;
tpnt->device = SDp; tpnt->device = SDp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment