Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82124
b: refs/heads/master
c: bbb89e3
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Feb 1, 2008
1 parent 2a4326f commit de57912
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d6f7e3a1845165b81adab3fc5fd13916f22aa61
refs/heads/master: bbb89e3d7a7da7a4bac535c42da05143b2db5d71
50 changes: 24 additions & 26 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)

} else if (blk_pc_request(rq) || rq->cmd_type == REQ_TYPE_ATA_PC) {
/* All other functions, except for READ. */
unsigned long flags;

/*
* if we have an error, pass back CHECK_CONDITION as the
Expand Down Expand Up @@ -370,15 +369,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
* remove failed request completely and end it when the
* request sense has completed
*/
if (stat & ERR_STAT) {
spin_lock_irqsave(&ide_lock, flags);
blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL;
spin_unlock_irqrestore(&ide_lock, flags);

cdrom_queue_request_sense(drive, rq->sense, rq);
} else
cdrom_end_request(drive, 0);
goto end_request;

} else if (blk_fs_request(rq)) {
int do_end_request = 0;
Expand Down Expand Up @@ -458,30 +449,37 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
sense data. We need this in order to perform end of media
processing */

if (do_end_request) {
if (stat & ERR_STAT) {
unsigned long flags;
spin_lock_irqsave(&ide_lock, flags);
blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL;
spin_unlock_irqrestore(&ide_lock, flags);
if (do_end_request)
goto end_request;

cdrom_queue_request_sense(drive, rq->sense, rq);
} else
cdrom_end_request(drive, 0);
} else {
/* If we got a CHECK_CONDITION status,
queue a request sense command. */
if (stat & ERR_STAT)
cdrom_queue_request_sense(drive, NULL, NULL);
}
/*
* If we got a CHECK_CONDITION status,
* queue a request sense command.
*/
if (stat & ERR_STAT)
cdrom_queue_request_sense(drive, NULL, NULL);
} else {
blk_dump_rq_flags(rq, "ide-cd: bad rq");
cdrom_end_request(drive, 0);
}

/* Retry, or handle the next request. */
return 1;

end_request:
if (stat & ERR_STAT) {
unsigned long flags;

spin_lock_irqsave(&ide_lock, flags);
blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL;
spin_unlock_irqrestore(&ide_lock, flags);

cdrom_queue_request_sense(drive, rq->sense, rq);
} else
cdrom_end_request(drive, 0);

return 1;
}

static int cdrom_timer_expiry(ide_drive_t *drive)
Expand Down

0 comments on commit de57912

Please sign in to comment.