Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86408
b: refs/heads/master
c: 9f10d9e
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Feb 26, 2008
1 parent 182d004 commit a76651d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 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: 788d669736dd3d15195fea07bf97ec5a2e9f15e7
refs/heads/master: 9f10d9ee0ac6d79d7bc8b9a158bf4a29322d84d3
24 changes: 10 additions & 14 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ static void cdrom_buffer_sectors (ide_drive_t *drive, unsigned long sector,
* and attempt to recover if there are problems. Returns 0 if everything's
* ok; nonzero if the request has been terminated.
*/
static
int ide_cd_check_ireason(ide_drive_t *drive, int len, int ireason, int rw)
static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq,
int len, int ireason, int rw)
{
/*
* ireason == 0: the drive wants to receive data from us
Expand Down Expand Up @@ -701,6 +701,9 @@ int ide_cd_check_ireason(ide_drive_t *drive, int len, int ireason, int rw)
drive->name, __FUNCTION__, ireason);
}

if (rq->cmd_type == REQ_TYPE_ATA_PC)
rq->cmd_flags |= REQ_FAILED;

cdrom_end_request(drive, 0);
return -1;
}
Expand Down Expand Up @@ -1071,11 +1074,11 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
/*
* check which way to transfer data
*/
if (blk_fs_request(rq) || blk_pc_request(rq)) {
if (ide_cd_check_ireason(drive, len, ireason, write))
return ide_stopped;
if (ide_cd_check_ireason(drive, rq, len, ireason, write))
return ide_stopped;

if (blk_fs_request(rq) && write == 0) {
if (blk_fs_request(rq)) {
if (write == 0) {
int nskip;

if (ide_cd_check_transfer_size(drive, len)) {
Expand All @@ -1101,16 +1104,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
if (ireason == 0) {
write = 1;
xferfunc = HWIF(drive)->atapi_output_bytes;
} else if (ireason == 2 || (ireason == 1 &&
(blk_fs_request(rq) || blk_pc_request(rq)))) {
} else {
write = 0;
xferfunc = HWIF(drive)->atapi_input_bytes;
} else {
printk(KERN_ERR "%s: %s: The drive "
"appears confused (ireason = 0x%02x). "
"Trying to recover by ending request.\n",
drive->name, __FUNCTION__, ireason);
goto end_request;
}

/*
Expand Down

0 comments on commit a76651d

Please sign in to comment.