diff options
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 09e3df42a402..5ba5c2a9e8e9 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -664,7 +664,7 @@ static void sd_unprep_fn(struct request_queue *q, struct request *rq) | |||
664 | } | 664 | } |
665 | 665 | ||
666 | /** | 666 | /** |
667 | * sd_init_command - build a scsi (read or write) command from | 667 | * sd_prep_fn - build a scsi (read or write) command from |
668 | * information in the request structure. | 668 | * information in the request structure. |
669 | * @SCpnt: pointer to mid-level's per scsi command structure that | 669 | * @SCpnt: pointer to mid-level's per scsi command structure that |
670 | * contains request and into which the scsi command is written | 670 | * contains request and into which the scsi command is written |
@@ -711,7 +711,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
711 | ret = BLKPREP_KILL; | 711 | ret = BLKPREP_KILL; |
712 | 712 | ||
713 | SCSI_LOG_HLQUEUE(1, scmd_printk(KERN_INFO, SCpnt, | 713 | SCSI_LOG_HLQUEUE(1, scmd_printk(KERN_INFO, SCpnt, |
714 | "sd_init_command: block=%llu, " | 714 | "sd_prep_fn: block=%llu, " |
715 | "count=%d\n", | 715 | "count=%d\n", |
716 | (unsigned long long)block, | 716 | (unsigned long long)block, |
717 | this_count)); | 717 | this_count)); |
@@ -1212,9 +1212,14 @@ static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing) | |||
1212 | retval = -ENODEV; | 1212 | retval = -ENODEV; |
1213 | 1213 | ||
1214 | if (scsi_block_when_processing_errors(sdp)) { | 1214 | if (scsi_block_when_processing_errors(sdp)) { |
1215 | retval = scsi_autopm_get_device(sdp); | ||
1216 | if (retval) | ||
1217 | goto out; | ||
1218 | |||
1215 | sshdr = kzalloc(sizeof(*sshdr), GFP_KERNEL); | 1219 | sshdr = kzalloc(sizeof(*sshdr), GFP_KERNEL); |
1216 | retval = scsi_test_unit_ready(sdp, SD_TIMEOUT, SD_MAX_RETRIES, | 1220 | retval = scsi_test_unit_ready(sdp, SD_TIMEOUT, SD_MAX_RETRIES, |
1217 | sshdr); | 1221 | sshdr); |
1222 | scsi_autopm_put_device(sdp); | ||
1218 | } | 1223 | } |
1219 | 1224 | ||
1220 | /* failed to execute TUR, assume media not present */ | 1225 | /* failed to execute TUR, assume media not present */ |
@@ -2644,8 +2649,8 @@ static void sd_probe_async(void *data, async_cookie_t cookie) | |||
2644 | * (e.g. /dev/sda). More precisely it is the block device major | 2649 | * (e.g. /dev/sda). More precisely it is the block device major |
2645 | * and minor number that is chosen here. | 2650 | * and minor number that is chosen here. |
2646 | * | 2651 | * |
2647 | * Assume sd_attach is not re-entrant (for time being) | 2652 | * Assume sd_probe is not re-entrant (for time being) |
2648 | * Also think about sd_attach() and sd_remove() running coincidentally. | 2653 | * Also think about sd_probe() and sd_remove() running coincidentally. |
2649 | **/ | 2654 | **/ |
2650 | static int sd_probe(struct device *dev) | 2655 | static int sd_probe(struct device *dev) |
2651 | { | 2656 | { |
@@ -2660,7 +2665,7 @@ static int sd_probe(struct device *dev) | |||
2660 | goto out; | 2665 | goto out; |
2661 | 2666 | ||
2662 | SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp, | 2667 | SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp, |
2663 | "sd_attach\n")); | 2668 | "sd_probe\n")); |
2664 | 2669 | ||
2665 | error = -ENOMEM; | 2670 | error = -ENOMEM; |
2666 | sdkp = kzalloc(sizeof(*sdkp), GFP_KERNEL); | 2671 | sdkp = kzalloc(sizeof(*sdkp), GFP_KERNEL); |