aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@gmail.com>2009-04-23 02:30:29 -0400
committerBorislav Petkov <petkovbb@gmail.com>2009-05-15 00:44:41 -0400
commit239f7e25346e22c4a94bde004d845e7397947c01 (patch)
tree3670d9d9093803e6d21955ffd6d0f89440f86737 /drivers/ide/ide-cd.c
parent19f52a784f7ecb5b51cd73cc4514614b600b995a (diff)
ide-cd: use whole request_sense buffer in EH
Now that we use a static request_sense buffer, use it instead of the first 18 bytes only. Also, remove sense-arg to cdrom_analyze_sense_data and cdrom_log_sense since we can access it through drive->sense_data now. Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 4c7792fd5f93..dca41ae0d048 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -92,16 +92,16 @@ static void cdrom_saw_media_change(ide_drive_t *drive)
92 drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID; 92 drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID;
93} 93}
94 94
95static int cdrom_log_sense(ide_drive_t *drive, struct request *rq, 95static int cdrom_log_sense(ide_drive_t *drive, struct request *rq)
96 struct request_sense *sense)
97{ 96{
97 struct request_sense *sense = &drive->sense_data;
98 int log = 0; 98 int log = 0;
99 99
100 ide_debug_log(IDE_DBG_SENSE, "sense_key: 0x%x", sense->sense_key);
101
102 if (!sense || !rq || (rq->cmd_flags & REQ_QUIET)) 100 if (!sense || !rq || (rq->cmd_flags & REQ_QUIET))
103 return 0; 101 return 0;
104 102
103 ide_debug_log(IDE_DBG_SENSE, "sense_key: 0x%x", sense->sense_key);
104
105 switch (sense->sense_key) { 105 switch (sense->sense_key) {
106 case NO_SENSE: 106 case NO_SENSE:
107 case RECOVERED_ERROR: 107 case RECOVERED_ERROR:
@@ -140,12 +140,12 @@ static int cdrom_log_sense(ide_drive_t *drive, struct request *rq,
140} 140}
141 141
142static void cdrom_analyze_sense_data(ide_drive_t *drive, 142static void cdrom_analyze_sense_data(ide_drive_t *drive,
143 struct request *failed_command, 143 struct request *failed_command)
144 struct request_sense *sense)
145{ 144{
145 struct request_sense *sense = &drive->sense_data;
146 struct cdrom_info *info = drive->driver_data;
146 unsigned long sector; 147 unsigned long sector;
147 unsigned long bio_sectors; 148 unsigned long bio_sectors;
148 struct cdrom_info *info = drive->driver_data;
149 149
150 ide_debug_log(IDE_DBG_SENSE, "error_code: 0x%x, sense_key: 0x%x", 150 ide_debug_log(IDE_DBG_SENSE, "error_code: 0x%x, sense_key: 0x%x",
151 sense->error_code, sense->sense_key); 151 sense->error_code, sense->sense_key);
@@ -154,7 +154,7 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive,
154 ide_debug_log(IDE_DBG_SENSE, "failed cmd: 0x%x", 154 ide_debug_log(IDE_DBG_SENSE, "failed cmd: 0x%x",
155 failed_command->cmd[0]); 155 failed_command->cmd[0]);
156 156
157 if (!cdrom_log_sense(drive, failed_command, sense)) 157 if (!cdrom_log_sense(drive, failed_command))
158 return; 158 return;
159 159
160 /* 160 /*
@@ -225,15 +225,14 @@ static void ide_cd_complete_failed_rq(ide_drive_t *drive, struct request *rq)
225 * sense pointer set. 225 * sense pointer set.
226 */ 226 */
227 memcpy(failed->sense, sense, 18); 227 memcpy(failed->sense, sense, 18);
228 sense = failed->sense;
229 failed->sense_len = rq->sense_len; 228 failed->sense_len = rq->sense_len;
230 } 229 }
231 cdrom_analyze_sense_data(drive, failed, sense); 230 cdrom_analyze_sense_data(drive, failed);
232 231
233 if (ide_end_rq(drive, failed, -EIO, blk_rq_bytes(failed))) 232 if (ide_end_rq(drive, failed, -EIO, blk_rq_bytes(failed)))
234 BUG(); 233 BUG();
235 } else 234 } else
236 cdrom_analyze_sense_data(drive, NULL, sense); 235 cdrom_analyze_sense_data(drive, NULL);
237} 236}
238 237
239 238