mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.4.21-pre1 broke the ide-tape driver
@ 2002-12-15  1:19 Mikael Pettersson
  2002-12-15  1:23 ` Marc-Christian Petersen
  0 siblings, 1 reply; 9+ messages in thread
From: Mikael Pettersson @ 2002-12-15  1:19 UTC (permalink / raw)
  To: marcelo; +Cc: linux-kernel

Kernel 2.4.21-pre1 broke the ide-tape driver: the driver
now hangs during initialisation. 2.2 kernels (with Andre's
IDE patch) and 2.4 up to 2.4.20 do not have this problem.

My box has a Seagate STT8000A ATAPI tape drive as hdd;
hdc is a Philips CD-RW, and the controller is ICH2 (i850 chipset).

dmesg log from inserting ide-tape as a module:

ide-tape: Dumping ATAPI Identify Device tape parameters
ide-tape: Protocol Type: <6>ATAPI
ide-tape: Device Type: 1 - <6>Streaming Tape Device
ide-tape: Removable: Yes
ide-tape: Command Packet DRQ Type: <6>Accelerated DRQ
ide-tape: Command Packet Size: <6>12 bytes
ide-tape: Model: Seagate STT8000A
ide-tape: Firmware Revision: 5.51
ide-tape: Serial Number: 
ide-tape: Write buffer size: 372736 bytes
ide-tape: DMA: Yes
ide-tape: LBA: Yes
ide-tape: IORDY can be disabled: Yes
ide-tape: IORDY supported: Yes
ide-tape: ATAPI overlap supported: No
ide-tape: PIO Cycle Timing Category: 2
ide-tape: DMA Cycle Timing Category: 2
ide-tape: Single Word DMA supported modes: <6>0 <6>1 <6>2 <6>
ide-tape: Multi Word DMA supported modes: <6>0 <6>1 <6>2 <6>(active) <6>
ide-tape: Enhanced PIO Modes: Mode 3
ide-tape: Minimum Multi-word DMA cycle per word: <6>120 ns
ide-tape: Manufacturer's Recommended Multi-word cycle: <6>120 ns
ide-tape: Minimum PIO cycle without IORDY: <6>120 ns
ide-tape: Minimum PIO cycle with IORDY: <6>120 ns
ide-tape: hdd <-> ht0: Seagate STT8000A rev 5.51
--- long delay here, about a minute or so
hdd: irq timeout: status=0xd0 { Busy }
hdd: DMA disabled
hdd: ATAPI reset complete
--- long delay here, about a minute or so
hdd: irq timeout: status=0xd0 { Busy }
hdd: ATAPI reset complete
--- long delay here, about a minute or so
hdd: irq timeout: status=0xd0 { Busy }
hdd: ATAPI reset complete
--- at this point I'm tired of waiting and reboot the machine

/Mikael

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

* Re: 2.4.21-pre1 broke the ide-tape driver
  2002-12-15  1:19 2.4.21-pre1 broke the ide-tape driver Mikael Pettersson
@ 2002-12-15  1:23 ` Marc-Christian Petersen
  0 siblings, 0 replies; 9+ messages in thread
From: Marc-Christian Petersen @ 2002-12-15  1:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mikael Pettersson

On Sunday 15 December 2002 02:19, Mikael Pettersson wrote:

Hi Mikael,

> Kernel 2.4.21-pre1 broke the ide-tape driver: the driver
> now hangs during initialisation. 2.2 kernels (with Andre's
> IDE patch) and 2.4 up to 2.4.20 do not have this problem.
> My box has a Seagate STT8000A ATAPI tape drive as hdd;
> hdc is a Philips CD-RW, and the controller is ICH2 (i850 chipset).
http://linux.bkbits.net:8080/linux-2.4/patch@1.828?nav=index.html|ChangeSet@-7d|cset@1.828

ciao, Marc

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

* Re: 2.4.21-pre1 broke the ide-tape driver
@ 2002-12-20 18:04 Mikael Pettersson
  0 siblings, 0 replies; 9+ messages in thread
From: Mikael Pettersson @ 2002-12-20 18:04 UTC (permalink / raw)
  To: marcelo; +Cc: alan, linux-kernel

On Thu, 19 Dec 2002 18:08:15 -0200 (BRST), Marcelo Tosatti wrote:
>> - ide-disk/ide-floppy do the test&call inside the loop rather than after,
>>   so possibly the call should be moved into the loop, and augmented
>>   to be "if (drive && drive->proc) ide_remove_proc_entries(...)".
>
>Yes... here is a patch which moves the ide_remove_proc_entries inside the
>detection loop. Without ide_remove_proc_entries inside the loop we would
>also not unregister more than one device /proc entries, too.
>
>Please test it, works for me.

Tested. Works for me too.

/Mikael

>
>--- linux-bk/drivers/ide/ide-tape.c	2002-12-19 18:05:07.000000000 -0200
>+++ linux-2.4.21/drivers/ide/ide-tape.c	2002-12-19 17:59:39.000000000 -0200
>@@ -6597,14 +6597,16 @@
>
> 	for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) {
> 		drive = idetape_chrdevs[minor].drive;
>-		if (drive != NULL && idetape_cleanup(drive))
>-			printk(KERN_ERR "ide-tape: %s: cleanup_module() "
>-				"called while still busy\n", drive->name);
>-	}
>+		if (drive) {
>+			if (idetape_cleanup(drive))
>+				printk(KERN_ERR "ide-tape: %s: cleanup_module() "
>+					"called while still busy\n", drive->name);
> #ifdef CONFIG_PROC_FS
>-	if (drive->proc)
>-		ide_remove_proc_entries(drive->proc, idetape_proc);
>+			if (drive->proc)
>+				ide_remove_proc_entries(drive->proc, idetape_proc);
> #endif
>+		}
>+	}
>
> 	ide_unregister_module(&idetape_module);
> }
>

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

* Re: 2.4.21-pre1 broke the ide-tape driver
  2002-12-16 23:27 Mikael Pettersson
@ 2002-12-19 20:08 ` Marcelo Tosatti
  0 siblings, 0 replies; 9+ messages in thread
From: Marcelo Tosatti @ 2002-12-19 20:08 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: alan, linux-kernel



On Tue, 17 Dec 2002, Mikael Pettersson wrote:

> I wrote:
> >On Sun, 15 Dec 2002 02:23:34 +0100, Marc-Christian Petersen wrote:
> >>> Kernel 2.4.21-pre1 broke the ide-tape driver: the driver
> >>> now hangs during initialisation. 2.2 kernels (with Andre's
> >>> IDE patch) and 2.4 up to 2.4.20 do not have this problem.
> >>> My box has a Seagate STT8000A ATAPI tape drive as hdd;
> >>> hdc is a Philips CD-RW, and the controller is ICH2 (i850 chipset).
> >>http://linux.bkbits.net:8080/linux-2.4/patch@1.828?nav=index.html|ChangeSet@-7d|cset@1.828
> >
> >Addendum: this patch fixes the init-time hang, and ide-tape does
> >seem to work fine, but 'rmmod ide-tape' oopses -- 2.4.20-ac2 also
> >oopses on 'rmmod ide-tape'.
>
> Solved, I think. Observe ide-tape's module_exit() procedure idetape_exit():
>
> >static void __exit idetape_exit (void)
> >{
> >	ide_drive_t *drive;
> >	int minor;
> >
> >	for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) {
> >		drive = idetape_chrdevs[minor].drive;
> >		if (drive != NULL && idetape_cleanup(drive))
> >			printk(KERN_ERR "ide-tape: %s: cleanup_module() "
> >				"called while still busy\n", drive->name);
> >	}
> >#ifdef CONFIG_PROC_FS
> >	if (drive->proc)
> >		ide_remove_proc_entries(drive->proc, idetape_proc);
> >#endif
> >
> >	ide_unregister_module(&idetape_module);
> >}
>
> In the "if (drive->proc)" line, drive==NULL when I rmmod ide-tape,
> causing the oops.
>
> I'm not sure if ide_remove_proc_entries() is needed or not,
> but the current code is obviously broken.
>
> - ide_unregister_module() removes ide-tape's proc entry
>   (/proc/ide/ideX/hdY/name) for us, at least that's what happens
>   on my box after I commented out the entire "if (drive->proc) ..."
>   statement to prevent the oops. So possibly the call should be deleted.
>
> - ide-disk/ide-floppy do the test&call inside the loop rather than after,
>   so possibly the call should be moved into the loop, and augmented
>   to be "if (drive && drive->proc) ide_remove_proc_entries(...)".

Yes... here is a patch which moves the ide_remove_proc_entries inside the
detection loop. Without ide_remove_proc_entries inside the loop we would
also not unregister more than one device /proc entries, too.

Please test it, works for me.

--- linux-bk/drivers/ide/ide-tape.c	2002-12-19 18:05:07.000000000 -0200
+++ linux-2.4.21/drivers/ide/ide-tape.c	2002-12-19 17:59:39.000000000 -0200
@@ -6597,14 +6597,16 @@

 	for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) {
 		drive = idetape_chrdevs[minor].drive;
-		if (drive != NULL && idetape_cleanup(drive))
-			printk(KERN_ERR "ide-tape: %s: cleanup_module() "
-				"called while still busy\n", drive->name);
-	}
+		if (drive) {
+			if (idetape_cleanup(drive))
+				printk(KERN_ERR "ide-tape: %s: cleanup_module() "
+					"called while still busy\n", drive->name);
 #ifdef CONFIG_PROC_FS
-	if (drive->proc)
-		ide_remove_proc_entries(drive->proc, idetape_proc);
+			if (drive->proc)
+				ide_remove_proc_entries(drive->proc, idetape_proc);
 #endif
+		}
+	}

 	ide_unregister_module(&idetape_module);
 }

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

* Re: 2.4.21-pre1 broke the ide-tape driver
@ 2002-12-16 23:27 Mikael Pettersson
  2002-12-19 20:08 ` Marcelo Tosatti
  0 siblings, 1 reply; 9+ messages in thread
From: Mikael Pettersson @ 2002-12-16 23:27 UTC (permalink / raw)
  To: alan; +Cc: linux-kernel, marcelo

I wrote:
>On Sun, 15 Dec 2002 02:23:34 +0100, Marc-Christian Petersen wrote:
>>> Kernel 2.4.21-pre1 broke the ide-tape driver: the driver
>>> now hangs during initialisation. 2.2 kernels (with Andre's
>>> IDE patch) and 2.4 up to 2.4.20 do not have this problem.
>>> My box has a Seagate STT8000A ATAPI tape drive as hdd;
>>> hdc is a Philips CD-RW, and the controller is ICH2 (i850 chipset).
>>http://linux.bkbits.net:8080/linux-2.4/patch@1.828?nav=index.html|ChangeSet@-7d|cset@1.828
>
>Addendum: this patch fixes the init-time hang, and ide-tape does
>seem to work fine, but 'rmmod ide-tape' oopses -- 2.4.20-ac2 also
>oopses on 'rmmod ide-tape'.

Solved, I think. Observe ide-tape's module_exit() procedure idetape_exit():

>static void __exit idetape_exit (void)
>{
>	ide_drive_t *drive;
>	int minor;
>
>	for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) {
>		drive = idetape_chrdevs[minor].drive;
>		if (drive != NULL && idetape_cleanup(drive))
>			printk(KERN_ERR "ide-tape: %s: cleanup_module() "
>				"called while still busy\n", drive->name);
>	}
>#ifdef CONFIG_PROC_FS
>	if (drive->proc)
>		ide_remove_proc_entries(drive->proc, idetape_proc);
>#endif
>
>	ide_unregister_module(&idetape_module);
>}

In the "if (drive->proc)" line, drive==NULL when I rmmod ide-tape,
causing the oops.

I'm not sure if ide_remove_proc_entries() is needed or not,
but the current code is obviously broken.

- ide_unregister_module() removes ide-tape's proc entry
  (/proc/ide/ideX/hdY/name) for us, at least that's what happens
  on my box after I commented out the entire "if (drive->proc) ..."
  statement to prevent the oops. So possibly the call should be deleted.

- ide-disk/ide-floppy do the test&call inside the loop rather than after,
  so possibly the call should be moved into the loop, and augmented
  to be "if (drive && drive->proc) ide_remove_proc_entries(...)".

/Mikael

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

* Re: 2.4.21-pre1 broke the ide-tape driver
@ 2002-12-16 22:18 Mikael Pettersson
  0 siblings, 0 replies; 9+ messages in thread
From: Mikael Pettersson @ 2002-12-16 22:18 UTC (permalink / raw)
  To: alan; +Cc: linux-kernel, marcelo

On 16 Dec 2002 14:53:33 +0000, Alan Cox wrote:
>On Sun, 2002-12-15 at 23:38, Mikael Pettersson wrote:
>> 
>> On Sun, 15 Dec 2002 02:23:34 +0100, Marc-Christian Petersen wrote:
>> >> Kernel 2.4.21-pre1 broke the ide-tape driver: the driver
>> >> now hangs during initialisation. 2.2 kernels (with Andre's
>> >> IDE patch) and 2.4 up to 2.4.20 do not have this problem.
>> >> My box has a Seagate STT8000A ATAPI tape drive as hdd;
>> >> hdc is a Philips CD-RW, and the controller is ICH2 (i850 chipset).
>> >http://linux.bkbits.net:8080/linux-2.4/patch@1.828?nav=index.html|ChangeSet@-7d|cset@1.828
>> 
>> Addendum: this patch fixes the init-time hang, and ide-tape does
>> seem to work fine, but 'rmmod ide-tape' oopses -- 2.4.20-ac2 also
>> oopses on 'rmmod ide-tape'.
>
>I don't unfortunately have any ide-tape devices. I'll take a look though

I can trigger the oops by a simple 'modprobe ide-tape; rmmod ide-tape'
even on boxes without ide-tape devices.

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

* Re: 2.4.21-pre1 broke the ide-tape driver
  2002-12-15 23:38 Mikael Pettersson
@ 2002-12-16 14:53 ` Alan Cox
  0 siblings, 0 replies; 9+ messages in thread
From: Alan Cox @ 2002-12-16 14:53 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: m.c.p, Linux Kernel Mailing List, Marcelo Tosatti

On Sun, 2002-12-15 at 23:38, Mikael Pettersson wrote:
> 
> On Sun, 15 Dec 2002 02:23:34 +0100, Marc-Christian Petersen wrote:
> >> Kernel 2.4.21-pre1 broke the ide-tape driver: the driver
> >> now hangs during initialisation. 2.2 kernels (with Andre's
> >> IDE patch) and 2.4 up to 2.4.20 do not have this problem.
> >> My box has a Seagate STT8000A ATAPI tape drive as hdd;
> >> hdc is a Philips CD-RW, and the controller is ICH2 (i850 chipset).
> >http://linux.bkbits.net:8080/linux-2.4/patch@1.828?nav=index.html|ChangeSet@-7d|cset@1.828
> 
> Addendum: this patch fixes the init-time hang, and ide-tape does
> seem to work fine, but 'rmmod ide-tape' oopses -- 2.4.20-ac2 also
> oopses on 'rmmod ide-tape'.

I don't unfortunately have any ide-tape devices. I'll take a look though


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

* Re: 2.4.21-pre1 broke the ide-tape driver
@ 2002-12-15 23:38 Mikael Pettersson
  2002-12-16 14:53 ` Alan Cox
  0 siblings, 1 reply; 9+ messages in thread
From: Mikael Pettersson @ 2002-12-15 23:38 UTC (permalink / raw)
  To: m.c.p; +Cc: alan, linux-kernel, marcelo


On Sun, 15 Dec 2002 02:23:34 +0100, Marc-Christian Petersen wrote:
>> Kernel 2.4.21-pre1 broke the ide-tape driver: the driver
>> now hangs during initialisation. 2.2 kernels (with Andre's
>> IDE patch) and 2.4 up to 2.4.20 do not have this problem.
>> My box has a Seagate STT8000A ATAPI tape drive as hdd;
>> hdc is a Philips CD-RW, and the controller is ICH2 (i850 chipset).
>http://linux.bkbits.net:8080/linux-2.4/patch@1.828?nav=index.html|ChangeSet@-7d|cset@1.828

Addendum: this patch fixes the init-time hang, and ide-tape does
seem to work fine, but 'rmmod ide-tape' oopses -- 2.4.20-ac2 also
oopses on 'rmmod ide-tape'.

/Mikael

Unable to handle kernel NULL pointer dereference at virtual address 000000c4
d08a8048
*pde = 00000000
Oops: 0000
CPU:    0
EIP:    0010:[<d08a8048>]    Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010202
eax: 00000000   ebx: 00000000   ecx: c0241ea0   edx: 00000128
esi: 00000014   edi: d08aa9c0   ebp: bfffeb08   esp: ce825f88
ds: 0018   es: 0018   ss: 0018
Process rmmod.old (pid: 614, stackpage=ce825000)
Stack: d08a1000 fffffff0 d08a1000 c0116a53 d08a1000 fffffff0 ce7d5000 bfffeb08 
       c0115ef7 d08a1000 00000000 ce824000 bffffc85 00000001 c0106c17 bffffc85 
       08060ac8 00000100 bffffc85 00000001 bfffeb08 00000081 0000002b 0000002b 
Call Trace:    [<c0116a53>] [<c0115ef7>] [<c0106c17>]
Code: 8b 83 c4 00 00 00 85 c0 74 0e 68 a4 a8 8a d0 50 e8 1f ce 8d 


>>EIP; d08a8048 <END_OF_CODE+8be8/????>   <=====

>>ecx; c0241ea0 <chrdevs+0/7f8>
>>edi; d08aa9c0 <END_OF_CODE+b560/????>
>>ebp; bfffeb08 Before first symbol
>>esp; ce825f88 <_end+e5c4db8/10620e90>

Trace; c0116a53 <free_module+17/98>
Trace; c0115ef7 <sys_delete_module+f3/1b0>
Trace; c0106c17 <system_call+33/38>

Code;  d08a8048 <END_OF_CODE+8be8/????>
00000000 <_EIP>:
Code;  d08a8048 <END_OF_CODE+8be8/????>   <=====
   0:   8b 83 c4 00 00 00         mov    0xc4(%ebx),%eax   <=====
Code;  d08a804e <END_OF_CODE+8bee/????>
   6:   85 c0                     test   %eax,%eax
Code;  d08a8050 <END_OF_CODE+8bf0/????>
   8:   74 0e                     je     18 <_EIP+0x18>
Code;  d08a8052 <END_OF_CODE+8bf2/????>
   a:   68 a4 a8 8a d0            push   $0xd08aa8a4
Code;  d08a8057 <END_OF_CODE+8bf7/????>
   f:   50                        push   %eax
Code;  d08a8058 <END_OF_CODE+8bf8/????>
  10:   e8 1f ce 8d 00            call   8dce34 <_EIP+0x8dce34>

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

* Re: 2.4.21-pre1 broke the ide-tape driver
@ 2002-12-15 15:37 Mikael Pettersson
  0 siblings, 0 replies; 9+ messages in thread
From: Mikael Pettersson @ 2002-12-15 15:37 UTC (permalink / raw)
  To: linux-kernel, m.c.p; +Cc: marcelo

On Sun, 15 Dec 2002 02:23:34 +0100, Marc-Christian Petersen wrote:
>> Kernel 2.4.21-pre1 broke the ide-tape driver: the driver
>> now hangs during initialisation. 2.2 kernels (with Andre's
>> IDE patch) and 2.4 up to 2.4.20 do not have this problem.
>> My box has a Seagate STT8000A ATAPI tape drive as hdd;
>> hdc is a Philips CD-RW, and the controller is ICH2 (i850 chipset).
>http://linux.bkbits.net:8080/linux-2.4/patch@1.828?nav=index.html|ChangeSet@-7d|cset@1.828

That fixed it. Thanks.

/Mikael

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-15  1:19 2.4.21-pre1 broke the ide-tape driver Mikael Pettersson
2002-12-15  1:23 ` Marc-Christian Petersen
2002-12-15 15:37 Mikael Pettersson
2002-12-15 23:38 Mikael Pettersson
2002-12-16 14:53 ` Alan Cox
2002-12-16 22:18 Mikael Pettersson
2002-12-16 23:27 Mikael Pettersson
2002-12-19 20:08 ` Marcelo Tosatti
2002-12-20 18:04 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®