]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/scsi/scsi_error.c
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[linux-beck.git] / drivers / scsi / scsi_error.c
index f17aa7aa78796e7f6d358b8cd5f68fd43cfee4d4..cbe38e5e79553f66128f5daca2879fa6d1170f5f 100644 (file)
@@ -1029,6 +1029,7 @@ retry:
                rtn = NEEDS_RETRY;
        } else {
                timeleft = wait_for_completion_timeout(&done, timeout);
+               rtn = SUCCESS;
        }
 
        shost->eh_action = NULL;
@@ -1951,6 +1952,8 @@ static void scsi_eh_lock_door(struct scsi_device *sdev)
         */
        req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL);
 
+       blk_rq_set_block_pc(req);
+
        req->cmd[0] = ALLOW_MEDIUM_REMOVAL;
        req->cmd[1] = 0;
        req->cmd[2] = 0;
@@ -1960,7 +1963,6 @@ static void scsi_eh_lock_door(struct scsi_device *sdev)
 
        req->cmd_len = COMMAND_SIZE(req->cmd[0]);
 
-       req->cmd_type = REQ_TYPE_BLOCK_PC;
        req->cmd_flags |= REQ_QUIET;
        req->timeout = 10 * HZ;
        req->retries = 5;
@@ -2306,6 +2308,12 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
        }
 
        scmd = scsi_get_command(dev, GFP_KERNEL);
+       if (!scmd) {
+               rtn = FAILED;
+               put_device(&dev->sdev_gendev);
+               goto out_put_autopm_host;
+       }
+
        blk_rq_init(NULL, &req);
        scmd->request = &req;