aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 061d7bbcd34a..673628790f10 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -210,10 +210,12 @@ static void ide_cd_complete_failed_rq(ide_drive_t *drive, struct request *rq)
210{ 210{
211 /* 211 /*
212 * For REQ_TYPE_SENSE, "rq->special" points to the original 212 * For REQ_TYPE_SENSE, "rq->special" points to the original
213 * failed request 213 * failed request. Also, the sense data should be read
214 * directly from rq which might be different from the original
215 * sense buffer if it got copied during mapping.
214 */ 216 */
215 struct request *failed = (struct request *)rq->special; 217 struct request *failed = (struct request *)rq->special;
216 struct request_sense *sense = &drive->sense_data; 218 void *sense = bio_data(rq->bio);
217 219
218 if (failed) { 220 if (failed) {
219 if (failed->sense) { 221 if (failed->sense) {
@@ -398,7 +400,7 @@ static int cdrom_decode_status(ide_drive_t *drive, u8 stat)
398 400
399 /* if we got a CHECK_CONDITION status, queue a request sense command */ 401 /* if we got a CHECK_CONDITION status, queue a request sense command */
400 if (stat & ATA_ERR) 402 if (stat & ATA_ERR)
401 ide_queue_sense_rq(drive, NULL); 403 return ide_queue_sense_rq(drive, NULL) ? 2 : 1;
402 return 1; 404 return 1;
403 405
404end_request: 406end_request:
@@ -412,8 +414,7 @@ end_request:
412 414
413 hwif->rq = NULL; 415 hwif->rq = NULL;
414 416
415 ide_queue_sense_rq(drive, rq); 417 return ide_queue_sense_rq(drive, rq) ? 2 : 1;
416 return 1;
417 } else 418 } else
418 return 2; 419 return 2;
419} 420}
@@ -507,8 +508,12 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
507 rq->cmd_flags |= cmd_flags; 508 rq->cmd_flags |= cmd_flags;
508 rq->timeout = timeout; 509 rq->timeout = timeout;
509 if (buffer) { 510 if (buffer) {
510 rq->data = buffer; 511 error = blk_rq_map_kern(drive->queue, rq, buffer,
511 rq->data_len = *bufflen; 512 *bufflen, GFP_NOIO);
513 if (error) {
514 blk_put_request(rq);
515 return error;
516 }
512 } 517 }
513 518
514 error = blk_execute_rq(drive->queue, info->disk, rq, 0); 519 error = blk_execute_rq(drive->queue, info->disk, rq, 0);
@@ -802,15 +807,10 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
802 drive->dma = 0; 807 drive->dma = 0;
803 808
804 /* sg request */ 809 /* sg request */
805 if (rq->bio || ((rq->cmd_type == REQ_TYPE_ATA_PC) && rq->data_len)) { 810 if (rq->bio) {
806 struct request_queue *q = drive->queue; 811 struct request_queue *q = drive->queue;
812 char *buf = bio_data(rq->bio);
807 unsigned int alignment; 813 unsigned int alignment;
808 char *buf;
809
810 if (rq->bio)
811 buf = bio_data(rq->bio);
812 else
813 buf = rq->data;
814 814
815 drive->dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA); 815 drive->dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA);
816 816