]> git.pld-linux.org Git - packages/kernel.git/blame - 2.2.16combo
- added description of djurban's branch
[packages/kernel.git] / 2.2.16combo
CommitLineData
b7af2ba5
AF
1diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/arch/alpha/mm/fault.c linux.17p1/arch/alpha/mm/fault.c
2--- linux.vanilla/arch/alpha/mm/fault.c Sun Jun 11 21:44:09 2000
3+++ linux.17p1/arch/alpha/mm/fault.c Sun Jun 11 21:54:08 2000
4@@ -150,8 +150,8 @@
5 if ((fixup = search_exception_table(regs->pc, regs->gp)) != 0) {
6 unsigned long newpc;
7 newpc = fixup_exception(dpf_reg, fixup, regs->pc);
8-#if 1
9- printk("%s: Exception at [<%lx>] (%lx) handled successfully.\n",
10+#if 0
11+ printk("%s: Exception at [<%lx>] (%lx)\n",
12 current->comm, regs->pc, newpc);
13 #endif
14 regs->pc = newpc;
15diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla/drivers/block/ide-cd.c linux.17p1/drivers/block/ide-cd.c
16--- linux.vanilla/drivers/block/ide-cd.c Sun Jun 11 21:44:11 2000
17+++ linux.17p1/drivers/block/ide-cd.c Sun Jun 11 22:05:48 2000
18@@ -1,8 +1,9 @@
19 /*
20- * linux/drivers/block/ide-cd.c
21+ * linux/drivers/ide/ide-cd.c
22+ *
23 * Copyright (C) 1994, 1995, 1996 scott snyder <snyder@fnald0.fnal.gov>
24 * Copyright (C) 1996-1998 Erik Andersen <andersee@debian.org>
25- * Copyright (C) 1998-2000 Jens Axboe <axboe@suse.de>
26+ * Copyright (C) 1998-2000 Jens Axboe <axboe@suse.de>
27 *
28 * May be copied or modified under the terms of the GNU General Public
29 * License. See linux/COPYING for more information.
30@@ -271,15 +272,18 @@
31 * - Fixed a problem with WPI CDS-32X drive - it
32 * failed the capabilities
33 *
34- * 4.57 never happened
35- *
36- * 4.58 May 1, 2000 - Fixed possible oops in ide_cdrom_get_last_session()
37+ * 4.57 Apr 7, 2000 - Fixed sense reporting.
38+ * - Fixed possible oops in ide_cdrom_get_last_session()
39 * - Fix locking mania and make ide_cdrom_reset relock
40 * - Stop spewing errors to log when magicdev polls with
41 * TEST_UNIT_READY on some drives.
42- * - Cleanup ACER50 stuff.
43- * - Integrate the ide_cdrom_packet from 2.3 to
44- * support DVD CSS ioctls.
45+ * - Various fixes from Tobias Ringstrom:
46+ * tray if it was locked prior to the reset.
47+ * - cdrom_read_capacity returns one frame too little.
48+ * - Fix real capacity reporting.
49+ *
50+ * 4.58 May 1, 2000 - Clean up ACER50 stuff.
51+ * - Fix small problem with ide_cdrom_capacity
52 *
53 *************************************************************************/
54
55@@ -309,7 +313,6 @@
56 * Generic packet command support and error handling routines.
57 */
58
59-
60 /* Mark that we've seen a media change, and invalidate our internal
61 buffers. */
62 static void cdrom_saw_media_change (ide_drive_t *drive)
63@@ -323,8 +326,9 @@
64
65
66 static
67-void cdrom_analyze_sense_data (ide_drive_t *drive, struct packet_command *pc,
68- struct request_sense *sense)
69+void cdrom_analyze_sense_data(ide_drive_t *drive,
70+ struct packet_command *failed_command,
71+ struct request_sense *sense)
72 {
73 if (sense->sense_key == NOT_READY ||
74 sense->sense_key == UNIT_ATTENTION) {
75@@ -338,13 +342,12 @@
76 READ_SUBCHANNEL. Workman (and probably other programs)
77 uses this command to poll the drive, and we don't want
78 to fill the syslog with useless errors. */
79- if (pc && (pc->c[0] == GPCMD_READ_SUBCHANNEL))
80+ if (failed_command &&
81+ (failed_command->c[0] == GPCMD_READ_SUBCHANNEL ||
82+ failed_command->c[0] == GPCMD_TEST_UNIT_READY))
83 return;
84 }
85
86- if (pc && (pc->c[0] == GPCMD_TEST_UNIT_READY))
87- return;
88-
89 if (sense->error_code == 0x70 && sense->sense_key == 0x02
90 && ((sense->asc == 0x3a && sense->ascq == 0x00) ||
91 (sense->asc == 0x04 && sense->ascq == 0x01)))
92@@ -364,9 +367,9 @@
93 char buf[80];
94
95 printk ("ATAPI device %s:\n", drive->name);
96- if (sense->error_code == 0x70)
97+ if (sense->error_code==0x70)
98 printk(" Error: ");
99- else if (sense->error_code == 0x71)
100+ else if (sense->error_code==0x71)
101 printk(" Deferred Error: ");
102 else if (sense->error_code == 0x7f)
103 printk(" Vendor-specific Error: ");
104@@ -378,17 +381,17 @@
105 else
106 s = "bad sense key!";
107
108- printk ("%s -- (Sense key=0x%02x)\n", s, sense->sense_key);
109+ printk("%s -- (Sense key=0x%02x)\n", s, sense->sense_key);
110
111 if (sense->asc == 0x40) {
112- sprintf (buf, "Diagnostic failure on component 0x%02x",
113+ sprintf(buf, "Diagnostic failure on component 0x%02x",
114 sense->ascq);
115 s = buf;
116 } else {
117- int lo=0, mid, hi=ARY_LEN (sense_data_texts);
118+ int lo = 0, mid, hi = ARY_LEN(sense_data_texts);
119 unsigned long key = (sense->sense_key << 16);
120 key |= (sense->asc << 8);
121- if ( ! (sense->ascq >= 0x80 && sense->ascq <= 0xdd) )
122+ if (!(sense->ascq >= 0x80 && sense->ascq <= 0xdd))
123 key |= sense->ascq;
124 s = NULL;
125
126@@ -413,30 +416,32 @@
127 s = "(reserved error code)";
128 }
129
130- printk (" %s -- (asc=0x%02x, ascq=0x%02x)\n",
131+ printk(" %s -- (asc=0x%02x, ascq=0x%02x)\n",
132 s, sense->asc, sense->ascq);
133
134- if (pc != NULL) {
135+ if (failed_command != NULL) {
136
137 int lo=0, mid, hi= ARY_LEN (packet_command_texts);
138 s = NULL;
139
140 while (hi > lo) {
141 mid = (lo + hi) / 2;
142- if (packet_command_texts[mid].packet_command == pc->c[0]) {
143+ if (packet_command_texts[mid].packet_command ==
144+ failed_command->c[0]) {
145 s = packet_command_texts[mid].text;
146 break;
147 }
148- else if (packet_command_texts[mid].packet_command > pc->c[0])
149+ if (packet_command_texts[mid].packet_command >
150+ failed_command->c[0])
151 hi = mid;
152 else
153 lo = mid+1;
154 }
155
156 printk (" The failed \"%s\" packet command was: \n \"", s);
157- for (i = 0; i < sizeof(pc->c); i++)
158- printk("%02x ", pc->c[i]);
159- printk("\"\n");
160+ for (i=0; i<sizeof (failed_command->c); i++)
161+ printk ("%02x ", failed_command->c[i]);
162+ printk ("\"\n");
163 }
164
165 /* The SKSV bit specifies validity of the sense_key_specific
166@@ -452,7 +457,7 @@
167
168 if (sense->sense_key == ILLEGAL_REQUEST &&
169 (sense->sks[0] & 0x80) != 0) {
170- printk (" Error in %s byte %d",
171+ printk(" Error in %s byte %d",
172 (sense->sks[0] & 0x40) != 0 ?
173 "command packet" : "command data",
174 (sense->sks[1] << 8) + sense->sks[2]);
175@@ -460,7 +465,7 @@
176 if ((sense->sks[0] & 0x40) != 0)
177 printk (" bit %d", sense->sks[0] & 0x07);
178
179- printk("\n");
180+ printk ("\n");
181 }
182 }
183
184@@ -475,15 +480,16 @@
185 return;
186
187 printk("%s: error code: 0x%02x sense_key: 0x%02x asc: 0x%02x ascq: 0x%02x\n",
188- drive->name, sense->error_code, sense->sense_key,
189+ drive->name,
190+ sense->error_code, sense->sense_key,
191 sense->asc, sense->ascq);
192 #endif /* not VERBOSE_IDE_CD_ERRORS */
193 }
194
195-static void cdrom_queue_request_sense(ide_drive_t *drive,
196+static void cdrom_queue_request_sense(ide_drive_t *drive,
197 struct semaphore *sem,
198 struct request_sense *sense,
199- struct packet_command *failed_cmd)
200+ struct packet_command *failed_command)
201 {
202 struct cdrom_info *info = drive->driver_data;
203 struct request *rq;
204@@ -496,7 +502,7 @@
205 pc->c[0] = GPCMD_REQUEST_SENSE;
206 pc->c[4] = pc->buflen = 18;
207 pc->buffer = (char *) sense;
208- pc->sense = (struct request_sense *) failed_cmd;
209+ pc->sense = (struct request_sense *) failed_command;
210
211 /* stuff the sense request in front of our current request */
212 rq = &info->request_sense_request;
213@@ -507,15 +513,16 @@
214 (void) ide_do_drive_cmd(drive, rq, ide_preempt);
215 }
216
217+
218 static void cdrom_end_request (int uptodate, ide_drive_t *drive)
219 {
220 struct request *rq = HWGROUP(drive)->rq;
221
222 if (rq->cmd == REQUEST_SENSE_COMMAND && uptodate) {
223 struct packet_command *pc = (struct packet_command *)rq->buffer;
224- cdrom_analyze_sense_data (drive,
225+ cdrom_analyze_sense_data(drive,
226 (struct packet_command *) pc->sense,
227- (struct request_sense *) pc->buffer - pc->c[4]);
228+ (struct request_sense *) (pc->buffer - pc->c[4]));
229 }
230 if (rq->cmd == READ && !rq->current_nr_sectors)
231 uptodate = 1;
232@@ -654,6 +661,9 @@
233 struct packet_command *pc = (struct packet_command *) rq->buffer;
234 unsigned long wait = 0;
235
236+ /* blank and format can take an extremly long time to
237+ * complete, if the IMMED bit was not set.
238+ */
239 if (pc->c[0] == GPCMD_BLANK || pc->c[0] == GPCMD_FORMAT_UNIT)
240 wait = 60*60*HZ;
241
242@@ -1066,15 +1076,15 @@
243 (65534 / CD_FRAMESIZE) : 65535);
244
245 /* Set up the command */
246- memset(&pc.c, 0, sizeof(pc.c));
247+ memset (&pc.c, 0, sizeof (pc.c));
248 pc.c[0] = GPCMD_READ_10;
249 pc.c[7] = (nframes >> 8);
250 pc.c[8] = (nframes & 0xff);
251 put_unaligned(cpu_to_be32(frame), (unsigned int *) &pc.c[2]);
252
253 /* Send the command to the drive and return. */
254- return cdrom_transfer_packet_command(drive, pc.c, sizeof (pc.c),
255- &cdrom_read_intr);
256+ return cdrom_transfer_packet_command(drive, pc.c, sizeof(pc.c),
257+ &cdrom_read_intr);
258 }
259
260
261@@ -1190,20 +1200,20 @@
262 struct request_sense *sense);
263
264 /* Interrupt routine for packet command completion. */
265-static ide_startstop_t cdrom_pc_intr(ide_drive_t *drive)
266+static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
267 {
268 int ireason, len, stat, thislen;
269 struct request *rq = HWGROUP(drive)->rq;
270- struct packet_command *pc = (struct packet_command *) rq->buffer;
271+ struct packet_command *pc = (struct packet_command *)rq->buffer;
272 ide_startstop_t startstop;
273
274 /* Check for errors. */
275- if (cdrom_decode_status(&startstop, drive, 0, &stat))
276+ if (cdrom_decode_status (&startstop, drive, 0, &stat))
277 return startstop;
278
279 /* Read the interrupt reason and the transfer length. */
280- ireason = IN_BYTE(IDE_NSECTOR_REG);
281- len = IN_BYTE(IDE_LCYL_REG) + 256 * IN_BYTE (IDE_HCYL_REG);
282+ ireason = IN_BYTE (IDE_NSECTOR_REG);
283+ len = IN_BYTE (IDE_LCYL_REG) + 256 * IN_BYTE (IDE_HCYL_REG);
284
285 /* If DRQ is clear, the command has completed.
286 Complain if we still have data left to transfer. */
287@@ -1242,14 +1252,14 @@
288 /* The drive wants to be written to. */
289 if ((ireason & 3) == 0) {
290 /* Transfer the data. */
291- atapi_output_bytes(drive, pc->buffer, thislen);
292+ atapi_output_bytes (drive, pc->buffer, thislen);
293
294 /* If we haven't moved enough data to satisfy the drive,
295 add some padding. */
296 while (len > thislen) {
297 int dum = 0;
298- atapi_output_bytes(drive, &dum, sizeof (dum));
299- len -= sizeof(dum);
300+ atapi_output_bytes (drive, &dum, sizeof (dum));
301+ len -= sizeof (dum);
302 }
303
304 /* Keep count of how much data we've moved. */
305@@ -1261,28 +1271,28 @@
306 else if ((ireason & 3) == 2) {
307
308 /* Transfer the data. */
309- atapi_input_bytes(drive, pc->buffer, thislen);
310+ atapi_input_bytes (drive, pc->buffer, thislen);
311
312 /* If we haven't moved enough data to satisfy the drive,
313 add some padding. */
314 while (len > thislen) {
315 int dum = 0;
316- atapi_input_bytes(drive, &dum, sizeof (dum));
317- len -= sizeof(dum);
318+ atapi_input_bytes (drive, &dum, sizeof (dum));
319+ len -= sizeof (dum);
320 }
321
322 /* Keep count of how much data we've moved. */
323 pc->buffer += thislen;
324 pc->buflen -= thislen;
325 } else {
326- printk("%s: cdrom_pc_intr: The drive "
327+ printk ("%s: cdrom_pc_intr: The drive "
328 "appears confused (ireason = 0x%2x)\n",
329 drive->name, ireason);
330 pc->stat = 1;
331 }
332
333 /* Now we wait for another interrupt. */
334- ide_set_handler(drive, &cdrom_pc_intr, WAIT_CMD, cdrom_timer_expiry);
335+ ide_set_handler (drive, &cdrom_pc_intr, WAIT_CMD, cdrom_timer_expiry);
336 return ide_started;
337 }
338
339@@ -1326,9 +1336,9 @@
340 static
341 int cdrom_queue_packet_command(ide_drive_t *drive, struct packet_command *pc)
342 {
343- int retries = 10;
344 struct request_sense sense;
345 struct request req;
346+ int retries = 10;
347
348 if (pc->sense == NULL)
349 pc->sense = &sense;
350@@ -1483,9 +1493,10 @@
351 struct cdrom_device_info *cdi = &info->devinfo;
352
353 memset(&pc, 0, sizeof(pc));
354- pc.c[0] = GPCMD_TEST_UNIT_READY;
355 pc.sense = sense;
356
357+ pc.c[0] = GPCMD_TEST_UNIT_READY;
358+
359 #if ! STANDARD_ATAPI
360 /* the Sanyo 3 CD changer uses byte 7 of TEST_UNIT_READY to
361 switch CDs instead of supporting the LOAD_UNLOAD opcode */
362@@ -1509,13 +1520,13 @@
363 sense = &my_sense;
364
365 /* If the drive cannot lock the door, just pretend. */
366- if (CDROM_CONFIG_FLAGS (drive)->no_doorlock)
367+ if (CDROM_CONFIG_FLAGS(drive)->no_doorlock) {
368 stat = 0;
369- else {
370+ } else {
371 memset(&pc, 0, sizeof(pc));
372- pc.c[0] = GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL;
373- pc.c[4] = (lockflag != 0);
374 pc.sense = sense;
375+ pc.c[0] = GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL;
376+ pc.c[4] = lockflag ? 1 : 0;
377 stat = cdrom_queue_packet_command (drive, &pc);
378 }
379
380@@ -1544,7 +1555,7 @@
381 /* Eject the disk if EJECTFLAG is 0.
382 If EJECTFLAG is 1, try to reload the disk. */
383 static int cdrom_eject(ide_drive_t *drive, int ejectflag,
384- struct request_sense *sense)
385+ struct request_sense *sense)
386 {
387 struct packet_command pc;
388
389@@ -1556,14 +1567,15 @@
390 return 0;
391
392 memset(&pc, 0, sizeof (pc));
393+ pc.sense = sense;
394+
395 pc.c[0] = GPCMD_START_STOP_UNIT;
396 pc.c[4] = 0x02 + (ejectflag != 0);
397- pc.sense = sense;
398 return cdrom_queue_packet_command (drive, &pc);
399 }
400
401 static int cdrom_read_capacity(ide_drive_t *drive, unsigned *capacity,
402- struct request_sense *sense)
403+ struct request_sense *sense)
404 {
405 struct {
406 __u32 lba;
407@@ -1573,16 +1585,16 @@
408 int stat;
409 struct packet_command pc;
410
411- memset(&pc, 0, sizeof (pc));
412+ memset(&pc, 0, sizeof(pc));
413+ pc.sense = sense;
414
415 pc.c[0] = GPCMD_READ_CDVD_CAPACITY;
416 pc.buffer = (char *)&capbuf;
417 pc.buflen = sizeof(capbuf);
418- pc.sense = sense;
419
420 stat = cdrom_queue_packet_command(drive, &pc);
421 if (stat == 0)
422- *capacity = be32_to_cpu(capbuf.lba) + 1;
423+ *capacity = 1 + be32_to_cpu(capbuf.lba);
424
425 return stat;
426 }
427@@ -1614,10 +1626,10 @@
428 /* Try to read the entire TOC for the disk into our internal buffer. */
429 static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense)
430 {
431- int stat, ntracks, i;
432+ int minor, stat, ntracks, i;
433+ kdev_t dev;
434 struct cdrom_info *info = drive->driver_data;
435 struct atapi_toc *toc = info->toc;
436- int minor = drive->select.b.unit << PARTN_BITS;
437 struct {
438 struct atapi_toc_header hdr;
439 struct atapi_toc_entry ent;
440@@ -1625,7 +1637,7 @@
441
442 if (toc == NULL) {
443 /* Try to allocate space. */
444- toc = (struct atapi_toc *) kmalloc(sizeof(struct atapi_toc),
445+ toc = (struct atapi_toc *) kmalloc (sizeof (struct atapi_toc),
446 GFP_KERNEL);
447 info->toc = toc;
448 if (toc == NULL) {
449@@ -1642,7 +1654,7 @@
450 if (CDROM_STATE_FLAGS (drive)->toc_valid) return 0;
451
452 /* First read just the header, so we know how long the TOC is. */
453- stat = cdrom_read_tocentry (drive, 0, 1, 0, (char *)&toc->hdr,
454+ stat = cdrom_read_tocentry(drive, 0, 1, 0, (char *) &toc->hdr,
455 sizeof(struct atapi_toc_header), sense);
456 if (stat) return stat;
457
458@@ -1654,14 +1666,17 @@
459 #endif /* not STANDARD_ATAPI */
460
461 ntracks = toc->hdr.last_track - toc->hdr.first_track + 1;
462- if (ntracks <= 0) return -EIO;
463- if (ntracks > MAX_TRACKS) ntracks = MAX_TRACKS;
464+ if (ntracks <= 0)
465+ return -EIO;
466+ if (ntracks > MAX_TRACKS)
467+ ntracks = MAX_TRACKS;
468
469 /* Now read the whole schmeer. */
470- stat = cdrom_read_tocentry (drive, toc->hdr.first_track, 1, 0, (char *)&toc->hdr,
471- sizeof (struct atapi_toc_header) +
472- (ntracks + 1) *
473- sizeof (struct atapi_toc_entry), sense);
474+ stat = cdrom_read_tocentry(drive, toc->hdr.first_track, 1, 0,
475+ (char *)&toc->hdr,
476+ sizeof(struct atapi_toc_header) +
477+ (ntracks + 1) *
478+ sizeof(struct atapi_toc_entry), sense);
479
480 if (stat && toc->hdr.first_track > 1) {
481 /* Cds with CDI tracks only don't have any TOC entries,
482@@ -1674,12 +1689,12 @@
483 the readable TOC is empty (CDI tracks are not included)
484