diff options
author | Alan D. Brunelle <Alan.Brunelle@hp.com> | 2008-12-09 09:52:15 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-12-12 10:04:26 -0500 |
commit | febd7a5c131433ea128b54dd5712e260c79eb3ab (patch) | |
tree | 546e8450e05fdc1bc478a3d312d23f1518ce3b21 /drivers/scsi/device_handler | |
parent | 6c34bc2976b30dc8b56392c020e25bae1f363cab (diff) |
Commands needing to be retried require a complete re-initialization.
The test-unit-ready portion of this patch was causing boots to fail on
my test machine (as in http://lkml.org/lkml/2008/12/5/161). With this
patch in place, the system is booting reliably.
Mike Anderson found the same problem in the hp_hw_start_stop code,
and I applied the same solution in cdrom_read_cdda_bpc.
Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
Cc: Mike Anderson <andmike@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_hp_sw.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c index 9aec4ca64e56..f7da7530875e 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c | |||
@@ -107,6 +107,7 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) | |||
107 | struct request *req; | 107 | struct request *req; |
108 | int ret; | 108 | int ret; |
109 | 109 | ||
110 | retry: | ||
110 | req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO); | 111 | req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO); |
111 | if (!req) | 112 | if (!req) |
112 | return SCSI_DH_RES_TEMP_UNAVAIL; | 113 | return SCSI_DH_RES_TEMP_UNAVAIL; |
@@ -121,7 +122,6 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) | |||
121 | memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE); | 122 | memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE); |
122 | req->sense_len = 0; | 123 | req->sense_len = 0; |
123 | 124 | ||
124 | retry: | ||
125 | ret = blk_execute_rq(req->q, NULL, req, 1); | 125 | ret = blk_execute_rq(req->q, NULL, req, 1); |
126 | if (ret == -EIO) { | 126 | if (ret == -EIO) { |
127 | if (req->sense_len > 0) { | 127 | if (req->sense_len > 0) { |
@@ -136,8 +136,10 @@ retry: | |||
136 | h->path_state = HP_SW_PATH_ACTIVE; | 136 | h->path_state = HP_SW_PATH_ACTIVE; |
137 | ret = SCSI_DH_OK; | 137 | ret = SCSI_DH_OK; |
138 | } | 138 | } |
139 | if (ret == SCSI_DH_IMM_RETRY) | 139 | if (ret == SCSI_DH_IMM_RETRY) { |
140 | blk_put_request(req); | ||
140 | goto retry; | 141 | goto retry; |
142 | } | ||
141 | if (ret == SCSI_DH_DEV_OFFLINED) { | 143 | if (ret == SCSI_DH_DEV_OFFLINED) { |
142 | h->path_state = HP_SW_PATH_PASSIVE; | 144 | h->path_state = HP_SW_PATH_PASSIVE; |
143 | ret = SCSI_DH_OK; | 145 | ret = SCSI_DH_OK; |
@@ -200,6 +202,7 @@ static int hp_sw_start_stop(struct scsi_device *sdev, struct hp_sw_dh_data *h) | |||
200 | struct request *req; | 202 | struct request *req; |
201 | int ret, retry; | 203 | int ret, retry; |
202 | 204 | ||
205 | retry: | ||
203 | req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO); | 206 | req = blk_get_request(sdev->request_queue, WRITE, GFP_NOIO); |
204 | if (!req) | 207 | if (!req) |
205 | return SCSI_DH_RES_TEMP_UNAVAIL; | 208 | return SCSI_DH_RES_TEMP_UNAVAIL; |
@@ -216,7 +219,6 @@ static int hp_sw_start_stop(struct scsi_device *sdev, struct hp_sw_dh_data *h) | |||
216 | req->sense_len = 0; | 219 | req->sense_len = 0; |
217 | retry = h->retries; | 220 | retry = h->retries; |
218 | 221 | ||
219 | retry: | ||
220 | ret = blk_execute_rq(req->q, NULL, req, 1); | 222 | ret = blk_execute_rq(req->q, NULL, req, 1); |
221 | if (ret == -EIO) { | 223 | if (ret == -EIO) { |
222 | if (req->sense_len > 0) { | 224 | if (req->sense_len > 0) { |
@@ -231,8 +233,10 @@ retry: | |||
231 | ret = SCSI_DH_OK; | 233 | ret = SCSI_DH_OK; |
232 | 234 | ||
233 | if (ret == SCSI_DH_RETRY) { | 235 | if (ret == SCSI_DH_RETRY) { |
234 | if (--retry) | 236 | if (--retry) { |
237 | blk_put_request(req); | ||
235 | goto retry; | 238 | goto retry; |
239 | } | ||
236 | ret = SCSI_DH_IO; | 240 | ret = SCSI_DH_IO; |
237 | } | 241 | } |
238 | 242 | ||