diff options
author | Hannes Reinecke <hare@suse.de> | 2013-10-23 04:51:15 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-10-25 06:36:26 -0400 |
commit | 1f8c88c3b52ffd424ca76f80d1ed78639c532aef (patch) | |
tree | 5b626167353af4ebb4ffb32375d8d90250bc8278 | |
parent | 999ece0af91cdf15e7e0687567914721b4499860 (diff) |
[SCSI] dpt_i2o: Remove DPTI_STATE_IOCTL
scsi_block_host/scsi_unlock_host provides the required
functionality.
[jejb: checkpatch fixes]
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 30 | ||||
-rw-r--r-- | drivers/scsi/dpti.h | 1 |
2 files changed, 12 insertions, 19 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 19e1b422260a..d13517dd0c19 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -448,15 +448,7 @@ 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 | ||
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; | 452 | pHba->host->last_reset = jiffies; |
461 | pHba->host->resetting = 1; | 453 | pHba->host->resetting = 1; |
462 | return 1; | 454 | return 1; |
@@ -1811,21 +1803,23 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg) | |||
1811 | } | 1803 | } |
1812 | 1804 | ||
1813 | do { | 1805 | do { |
1814 | if(pHba->host) | 1806 | /* |
1807 | * Stop any new commands from enterring the | ||
1808 | * controller while processing the ioctl | ||
1809 | */ | ||
1810 | if (pHba->host) { | ||
1811 | scsi_block_requests(pHba->host); | ||
1815 | spin_lock_irqsave(pHba->host->host_lock, flags); | 1812 | spin_lock_irqsave(pHba->host->host_lock, flags); |
1816 | // This state stops any new commands from enterring the | 1813 | } |
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); | 1814 | rcode = adpt_i2o_post_wait(pHba, msg, size, FOREVER); |
1822 | if (rcode != 0) | 1815 | if (rcode != 0) |
1823 | printk("adpt_i2o_passthru: post wait failed %d %p\n", | 1816 | printk("adpt_i2o_passthru: post wait failed %d %p\n", |
1824 | rcode, reply); | 1817 | rcode, reply); |
1825 | // pHba->state &= ~DPTI_STATE_IOCTL; | 1818 | if (pHba->host) { |
1826 | if(pHba->host) | ||
1827 | spin_unlock_irqrestore(pHba->host->host_lock, flags); | 1819 | spin_unlock_irqrestore(pHba->host->host_lock, flags); |
1828 | } while(rcode == -ETIMEDOUT); | 1820 | scsi_unblock_requests(pHba->host); |
1821 | } | ||
1822 | } while (rcode == -ETIMEDOUT); | ||
1829 | 1823 | ||
1830 | if(rcode){ | 1824 | if(rcode){ |
1831 | goto cleanup; | 1825 | goto cleanup; |
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h index beded716f93f..aeb046186c84 100644 --- a/drivers/scsi/dpti.h +++ b/drivers/scsi/dpti.h | |||
@@ -202,7 +202,6 @@ struct adpt_channel { | |||
202 | 202 | ||
203 | // HBA state flags | 203 | // HBA state flags |
204 | #define DPTI_STATE_RESET (0x01) | 204 | #define DPTI_STATE_RESET (0x01) |
205 | #define DPTI_STATE_IOCTL (0x02) | ||
206 | 205 | ||
207 | typedef struct _adpt_hba { | 206 | typedef struct _adpt_hba { |
208 | struct _adpt_hba *next; | 207 | struct _adpt_hba *next; |