diff options
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 19e1b422260a..c0ae8fa57a3b 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -448,19 +448,8 @@ static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd | |||
448 | } | 448 | } |
449 | 449 | ||
450 | rmb(); | 450 | rmb(); |
451 | /* | 451 | if ((pHba->state) & DPTI_STATE_RESET) |
452 | * TODO: I need to block here if I am processing ioctl cmds | 452 | return SCSI_MLQUEUE_HOST_BUSY; |
453 | * but if the outstanding cmds all finish before the ioctl, | ||
454 | * the scsi-core will not know to start sending cmds to me again. | ||
455 | * I need to a way to restart the scsi-cores queues or should I block | ||
456 | * calling scsi_done on the outstanding cmds instead | ||
457 | * for now we don't set the IOCTL state | ||
458 | */ | ||
459 | if(((pHba->state) & DPTI_STATE_IOCTL) || ((pHba->state) & DPTI_STATE_RESET)) { | ||
460 | pHba->host->last_reset = jiffies; | ||
461 | pHba->host->resetting = 1; | ||
462 | return 1; | ||
463 | } | ||
464 | 453 | ||
465 | // TODO if the cmd->device if offline then I may need to issue a bus rescan | 454 | // TODO if the cmd->device if offline then I may need to issue a bus rescan |
466 | // followed by a get_lct to see if the device is there anymore | 455 | // followed by a get_lct to see if the device is there anymore |
@@ -1811,21 +1800,23 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg) | |||
1811 | } | 1800 | } |
1812 | 1801 | ||
1813 | do { | 1802 | do { |
1814 | if(pHba->host) | 1803 | /* |
1804 | * Stop any new commands from enterring the | ||
1805 | * controller while processing the ioctl | ||
1806 | */ | ||
1807 | if (pHba->host) { | ||
1808 | scsi_block_requests(pHba->host); | ||
1815 | spin_lock_irqsave(pHba->host->host_lock, flags); | 1809 | spin_lock_irqsave(pHba->host->host_lock, flags); |
1816 | // This state stops any new commands from enterring the | 1810 | } |
1817 | // controller while processing the ioctl | ||
1818 | // pHba->state |= DPTI_STATE_IOCTL; | ||
1819 | // We can't set this now - The scsi subsystem sets host_blocked and | ||
1820 | // the queue empties and stops. We need a way to restart the queue | ||
1821 | rcode = adpt_i2o_post_wait(pHba, msg, size, FOREVER); | 1811 | rcode = adpt_i2o_post_wait(pHba, msg, size, FOREVER); |
1822 | if (rcode != 0) | 1812 | if (rcode != 0) |
1823 | printk("adpt_i2o_passthru: post wait failed %d %p\n", | 1813 | printk("adpt_i2o_passthru: post wait failed %d %p\n", |
1824 | rcode, reply); | 1814 | rcode, reply); |
1825 | // pHba->state &= ~DPTI_STATE_IOCTL; | 1815 | if (pHba->host) { |
1826 | if(pHba->host) | ||
1827 | spin_unlock_irqrestore(pHba->host->host_lock, flags); | 1816 | spin_unlock_irqrestore(pHba->host->host_lock, flags); |
1828 | } while(rcode == -ETIMEDOUT); | 1817 | scsi_unblock_requests(pHba->host); |
1818 | } | ||
1819 | } while (rcode == -ETIMEDOUT); | ||
1829 | 1820 | ||
1830 | if(rcode){ | 1821 | if(rcode){ |
1831 | goto cleanup; | 1822 | goto cleanup; |