diff options
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 6415a2e2ba87..41d804065d38 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -248,14 +248,7 @@ void ide_map_sg(ide_drive_t *drive, struct ide_cmd *cmd) | |||
248 | struct scatterlist *sg = hwif->sg_table; | 248 | struct scatterlist *sg = hwif->sg_table; |
249 | struct request *rq = cmd->rq; | 249 | struct request *rq = cmd->rq; |
250 | 250 | ||
251 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { | 251 | cmd->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); |
252 | sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE); | ||
253 | cmd->sg_nents = 1; | ||
254 | } else if (!rq->bio) { | ||
255 | sg_init_one(sg, rq->data, rq->data_len); | ||
256 | cmd->sg_nents = 1; | ||
257 | } else | ||
258 | cmd->sg_nents = blk_rq_map_sg(drive->queue, rq, sg); | ||
259 | } | 252 | } |
260 | EXPORT_SYMBOL_GPL(ide_map_sg); | 253 | EXPORT_SYMBOL_GPL(ide_map_sg); |
261 | 254 | ||
@@ -371,7 +364,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) | |||
371 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) | 364 | if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) |
372 | return execute_drive_cmd(drive, rq); | 365 | return execute_drive_cmd(drive, rq); |
373 | else if (blk_pm_request(rq)) { | 366 | else if (blk_pm_request(rq)) { |
374 | struct request_pm_state *pm = rq->data; | 367 | struct request_pm_state *pm = rq->special; |
375 | #ifdef DEBUG_PM | 368 | #ifdef DEBUG_PM |
376 | printk("%s: start_power_step(step: %d)\n", | 369 | printk("%s: start_power_step(step: %d)\n", |
377 | drive->name, pm->pm_step); | 370 | drive->name, pm->pm_step); |
@@ -484,6 +477,9 @@ void do_ide_request(struct request_queue *q) | |||
484 | 477 | ||
485 | spin_unlock_irq(q->queue_lock); | 478 | spin_unlock_irq(q->queue_lock); |
486 | 479 | ||
480 | /* HLD do_request() callback might sleep, make sure it's okay */ | ||
481 | might_sleep(); | ||
482 | |||
487 | if (ide_lock_host(host, hwif)) | 483 | if (ide_lock_host(host, hwif)) |
488 | goto plug_device_2; | 484 | goto plug_device_2; |
489 | 485 | ||