All of lore.kernel.org
 help / color / mirror / Atom feed
* My fixes to ide-tape in 2.4.20-ac2
@ 2002-12-14  3:44 Pete Zaitcev
  2002-12-17  0:49 ` Marcelo Tosatti
  0 siblings, 1 reply; 4+ messages in thread
From: Pete Zaitcev @ 2002-12-14  3:44 UTC (permalink / raw)
  To: alan; +Cc: stern, zaitcev, linux-kernel

Hi:

I checked that my fixes were not corrected by Alan Stern,
and re-diffed them against 2.4.20-ac2. I think it would
be right if Alan (Cox :-) applied this patch to -ac3 or something.
Marcelo agreed to take it many times but forgot to actually apply.

-- Pete

BugID Synopsys
----- -------------------------------
36628 I/O error reading HP Colorado 5GB tape drive
62267 Segfault when insmod'in the ide-tape driver
I6809 ***** B5: divide error: 0000

36628:
Removes extra buffer flush from read_position(), which confuses
all versions of the HP Colorado.
Also touches up on insane logging.

62267:
ide-tape: Model: Seagate STT3401A
ide-tape: Firmware Revision: 308A
....
ide-tape: Maximum supported speed in KBps - 4000
ide-tape: Continuous transfer limits in blocks - 0     <===== HUH?!
ide-tape: Current speed in KBps - 755

I6809:
ide-tape: Model: Seagate STT3401A
ide-tape: Firmware Revision: 309C
....
ide-tape: Adjusted block size - 0		<===== Seagate strikes back
divide error: 0000

--- linux-2.4.20-ac2/drivers/ide/ide-tape.c	Fri Dec 13 16:55:13 2002
+++ linux-2.4.20-ac2-pb/drivers/ide/ide-tape.c	Fri Dec 13 18:12:20 2002
@@ -450,8 +450,6 @@
 #include <asm/bitops.h>
 
 
-#define NO_LONGER_REQUIRED	(1)
-
 /*
  *	OnStream support
  */
@@ -3486,29 +3482,10 @@
 		printk (KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__);
 #endif /* IDETAPE_DEBUG_LOG */
 
-#ifdef NO_LONGER_REQUIRED
-	idetape_flush_tape_buffers(drive);
-#endif
 	idetape_create_read_position_cmd(&pc);
 	if (idetape_queue_pc_tail(drive, &pc))
 		return -1;
 	position = tape->first_frame_position;
-#ifdef NO_LONGER_REQUIRED
-	if (tape->onstream) {
-		if ((position != tape->last_frame_position - tape->blocks_in_buffer) &&
-		    (position != tape->last_frame_position + tape->blocks_in_buffer)) {
-			if (tape->blocks_in_buffer == 0) {
-				printk("ide-tape: %s: correcting read "
-					"position %d, %d, %d\n",
-					tape->name, position,
-					tape->last_frame_position,
-					tape->blocks_in_buffer);
-				position = tape->last_frame_position;
-				tape->first_frame_position = position;
-			}
-		}
-	}
-#endif
 	return position;
 }
 
@@ -6195,6 +6172,10 @@
 		printk(KERN_INFO "ide-tape: %s: overriding capabilities->max_speed (assuming 650KB/sec)\n", drive->name);
 		capabilities->max_speed = 650;
 	}
+	if (!capabilities->ctl) {
+		printk(KERN_INFO "ide-tape: %s: overriding capabilities->ctl (assuming 26KB)\n", drive->name);
+		capabilities->ctl = 52;
+	}
 
 	tape->capabilities = *capabilities;		/* Save us a copy */
 	if (capabilities->blk512)
@@ -6250,10 +6231,6 @@
 	idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR);
 	if (idetape_queue_pc_tail(drive, &pc)) {
 		printk(KERN_ERR "ide-tape: Can't get block descriptor\n");
-		if (tape->tape_block_size == 0) {
-			printk(KERN_WARNING "ide-tape: Cannot deal with zero block size, assume 32k\n");
-			tape->tape_block_size =  32768;
-		}
 		return;
 	}
 	header = (idetape_mode_parameter_header_t *) pc.buffer;
@@ -6350,6 +6327,10 @@
 	idetape_get_inquiry_results(drive);
 	idetape_get_mode_sense_results(drive);
 	idetape_get_blocksize_from_block_descriptor(drive);
+	if (tape->tape_block_size == 0) {
+		printk(KERN_WARNING "ide-tape: Zero block size, using 512\n");
+		tape->tape_block_size = 512;
+	}
 	if (tape->onstream) {
 		idetape_onstream_mode_sense_tape_parameter_page(drive, 1);
 		idetape_configure_onstream(drive);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-17 19:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-14  3:44 My fixes to ide-tape in 2.4.20-ac2 Pete Zaitcev
2002-12-17  0:49 ` Marcelo Tosatti
2002-12-17 19:22   ` Pete Zaitcev
2002-12-17 16:28     ` Marcelo Tosatti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.