diff options
Diffstat (limited to 'drivers/scsi/scsi_error.c')
| -rw-r--r-- | drivers/scsi/scsi_error.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index c60cffbefa3c..2bf98469dc4c 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
| @@ -1775,6 +1775,14 @@ int scsi_error_handler(void *data) | |||
| 1775 | * what we need to do to get it up and online again (if we can). | 1775 | * what we need to do to get it up and online again (if we can). |
| 1776 | * If we fail, we end up taking the thing offline. | 1776 | * If we fail, we end up taking the thing offline. |
| 1777 | */ | 1777 | */ |
| 1778 | if (scsi_autopm_get_host(shost) != 0) { | ||
| 1779 | SCSI_LOG_ERROR_RECOVERY(1, | ||
| 1780 | printk(KERN_ERR "Error handler scsi_eh_%d " | ||
| 1781 | "unable to autoresume\n", | ||
| 1782 | shost->host_no)); | ||
| 1783 | continue; | ||
| 1784 | } | ||
| 1785 | |||
| 1778 | if (shost->transportt->eh_strategy_handler) | 1786 | if (shost->transportt->eh_strategy_handler) |
| 1779 | shost->transportt->eh_strategy_handler(shost); | 1787 | shost->transportt->eh_strategy_handler(shost); |
| 1780 | else | 1788 | else |
| @@ -1788,6 +1796,7 @@ int scsi_error_handler(void *data) | |||
| 1788 | * which are still online. | 1796 | * which are still online. |
| 1789 | */ | 1797 | */ |
| 1790 | scsi_restart_operations(shost); | 1798 | scsi_restart_operations(shost); |
| 1799 | scsi_autopm_put_host(shost); | ||
| 1791 | set_current_state(TASK_INTERRUPTIBLE); | 1800 | set_current_state(TASK_INTERRUPTIBLE); |
| 1792 | } | 1801 | } |
| 1793 | __set_current_state(TASK_RUNNING); | 1802 | __set_current_state(TASK_RUNNING); |
| @@ -1885,12 +1894,16 @@ scsi_reset_provider_done_command(struct scsi_cmnd *scmd) | |||
| 1885 | int | 1894 | int |
| 1886 | scsi_reset_provider(struct scsi_device *dev, int flag) | 1895 | scsi_reset_provider(struct scsi_device *dev, int flag) |
| 1887 | { | 1896 | { |
| 1888 | struct scsi_cmnd *scmd = scsi_get_command(dev, GFP_KERNEL); | 1897 | struct scsi_cmnd *scmd; |
| 1889 | struct Scsi_Host *shost = dev->host; | 1898 | struct Scsi_Host *shost = dev->host; |
| 1890 | struct request req; | 1899 | struct request req; |
| 1891 | unsigned long flags; | 1900 | unsigned long flags; |
| 1892 | int rtn; | 1901 | int rtn; |
| 1893 | 1902 | ||
| 1903 | if (scsi_autopm_get_host(shost) < 0) | ||
| 1904 | return FAILED; | ||
| 1905 | |||
| 1906 | scmd = scsi_get_command(dev, GFP_KERNEL); | ||
| 1894 | blk_rq_init(NULL, &req); | 1907 | blk_rq_init(NULL, &req); |
| 1895 | scmd->request = &req; | 1908 | scmd->request = &req; |
| 1896 | 1909 | ||
| @@ -1947,6 +1960,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag) | |||
| 1947 | scsi_run_host_queues(shost); | 1960 | scsi_run_host_queues(shost); |
| 1948 | 1961 | ||
| 1949 | scsi_next_command(scmd); | 1962 | scsi_next_command(scmd); |
| 1963 | scsi_autopm_put_host(shost); | ||
| 1950 | return rtn; | 1964 | return rtn; |
| 1951 | } | 1965 | } |
| 1952 | EXPORT_SYMBOL(scsi_reset_provider); | 1966 | EXPORT_SYMBOL(scsi_reset_provider); |
