Re: 2.4.4-ac4 - oops on unload "cdrom" module

2001-05-04 Thread Jens Axboe

On Fri, May 04 2001, Pavel Roskin wrote:
> > The following patch fixes unloading of cdrom module when no cdrom driver
> > loaded (2.4.5-pre, 2.4.4-ac):
> 
> It works for me. Thank you! You have even managed to find out that I had
> my CD-ROM disconnected :-)
> 
> By the way, shouldn't we register sysctl, /proc/sys/dev/cdrom/ and
> /dev/cdrom/ always when the cdrom driver is loaded/initialized, not when a
> cdrom unit is found?
> 
> I don't know what's the official "policy" is, but wouldn't it be logical
> to have some control over the drivers that handle no devices in the
> moment?

We should, the -ac tree has the first cut of the cdrom updates and they
didn't have the linking right. The right init sequence fixes the issue
as well, not just initing after the first cdrom driver registers.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: 2.4.4-ac4 - oops on unload "cdrom" module

2001-05-04 Thread Jens Axboe

On Fri, May 04 2001, Andrzej Krzysztofowicz wrote:
> > This oops happens when I run "rmmod cdrom" on a 2.4.4-ac4 kernel with
> > CONFIG_SYSCTL enabled. It doesn't happen if CONFIG_SYSCTL is disabled.
> > 
> > sr_mod isn't loaded at this point. Reference to sd_mod looks weird. After
> > this oops the "cdrom" module remains in memory in the "deleted" state.
> 
> > Unable to handle kernel NULL pointer dereference at virtual address 0008
> [...]
> > >>EIP; c0118051<=
> 
> The following patch fixes unloading of cdrom module when no cdrom driver
> loaded (2.4.5-pre, 2.4.4-ac):
> 
> --- drivers/cdrom/cdrom.c.old Fri May  4 22:44:31 2001
> +++ drivers/cdrom/cdrom.c Fri May  4 22:54:36 2001
> @@ -2698,7 +2698,8 @@
>  
>  static void cdrom_sysctl_unregister(void)
>  {
> - unregister_sysctl_table(cdrom_sysctl_header);
> + if (cdrom_sysctl_header)
> + unregister_sysctl_table(cdrom_sysctl_header);
>  }
>  
>  #endif /* CONFIG_SYSCTL */

Thanks applied.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: 2.4.4-ac4 - oops on unload "cdrom" module

2001-05-04 Thread Pavel Roskin

Hi, Andrzej!

> The following patch fixes unloading of cdrom module when no cdrom driver
> loaded (2.4.5-pre, 2.4.4-ac):

It works for me. Thank you! You have even managed to find out that I had
my CD-ROM disconnected :-)

By the way, shouldn't we register sysctl, /proc/sys/dev/cdrom/ and
/dev/cdrom/ always when the cdrom driver is loaded/initialized, not when a
cdrom unit is found?

I don't know what's the official "policy" is, but wouldn't it be logical
to have some control over the drivers that handle no devices in the
moment?

Actually, the scsi module behaves differently. Right now I have empty
/dev/scsi and /proc/scsi/scsi contains "Attached devices: none"

Anyway, the patch is small, straightforward and consistent with the
current behavior of the driver. And it works.

-- 
Regards,
Pavel Roskin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: 2.4.4-ac4 - oops on unload "cdrom" module

2001-05-04 Thread Andrzej Krzysztofowicz


> This oops happens when I run "rmmod cdrom" on a 2.4.4-ac4 kernel with
> CONFIG_SYSCTL enabled. It doesn't happen if CONFIG_SYSCTL is disabled.
> 
> sr_mod isn't loaded at this point. Reference to sd_mod looks weird. After
> this oops the "cdrom" module remains in memory in the "deleted" state.

> Unable to handle kernel NULL pointer dereference at virtual address 0008
[...]
> >>EIP; c0118051<=

The following patch fixes unloading of cdrom module when no cdrom driver
loaded (2.4.5-pre, 2.4.4-ac):

--- drivers/cdrom/cdrom.c.old   Fri May  4 22:44:31 2001
+++ drivers/cdrom/cdrom.c   Fri May  4 22:54:36 2001
@@ -2698,7 +2698,8 @@
 
 static void cdrom_sysctl_unregister(void)
 {
-   unregister_sysctl_table(cdrom_sysctl_header);
+   if (cdrom_sysctl_header)
+   unregister_sysctl_table(cdrom_sysctl_header);
 }
 
 #endif /* CONFIG_SYSCTL */


Andrzej


-- 
===
  Andrzej M. Krzysztofowicz   [EMAIL PROTECTED]
  tel.  (0-58) 347 14 61
Wydz.Fizyki Technicznej i Matematyki Stosowanej Politechniki Gdanskiej
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



2.4.4-ac4 - oops on unload "cdrom" module

2001-05-04 Thread Pavel Roskin

Hello!

This oops happens when I run "rmmod cdrom" on a 2.4.4-ac4 kernel with
CONFIG_SYSCTL enabled. It doesn't happen if CONFIG_SYSCTL is disabled.

Full .config is here:
http://www.red-bean.com/~proski/linux/config

sr_mod isn't loaded at this point. Reference to sd_mod looks weird. After
this oops the "cdrom" module remains in memory in the "deleted" state.

$ /sbin/lsmod
Module  Size  Used by
hid11760   0 (unused)
keybdev 1632   0 (unused)
mga85312   1
agpgart13136   3
mousedev3936   1 (autoclean)
input   3296   0 (autoclean) [hid keybdev mousedev]
nfsd   67504   8 (autoclean)
lockd  48752   1 (autoclean) [nfsd]
sunrpc 56800   1 (autoclean) [nfsd lockd]
3c59x  24320   1 (autoclean)
ipx14496   1 (autoclean)
ramfs   3728   1 (autoclean)
cdrom  28864   0 (deleted)

ksymoops 2.3.4 on i686 2.4.4-ac4.  Options used
 -v vmlinux (specified)
 -k /proc/ksyms (default)
 -l /proc/modules (default)
 -o /lib/modules/2.4.4-ac4/ (default)
 -m System.map (specified)

Unable to handle kernel NULL pointer dereference at virtual address 0008
c0118051
Oops: 
CPU:0
EIP:0010:[]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010246
eax:    ebx:    ecx: d08c9000   edx: 
esi: d08c9000   edi:    ebp: bfffe968   esp: c181bf80
ds: 0018   es: 0018   ss: 0018
Process rmmod (pid: 11303, stackpage=c181b000)
Stack: d08c9000 d08cd92f  d08cd97a  d08cf5c0 c01157eb d08c9000
   fff0 c62dc000 c0114c87 d08c9000  c181a000 bb47 0001
   c0106af7 bb47 0805eee8 0100 bb47 0001 bfffe968 0081
Call Trace: [] [] [] [] []
   [] [] [] []
Code: 8b 53 08 8b 43 04 89 50 04 89 02 a1 a0 46 27 c0 50 8b 03 50

>>EIP; c0118051<=
Trace; d08c9000 <[sd_mod]__module_using_checksums+18cb/192b>
Trace; d08cd92f <[cdrom]cdrom_sysctl_unregister+b/10>
Trace; d08cd97a <[cdrom]cdrom_exit+1a/28>
Trace; d08cf5c0 <[cdrom].rodata.start+1a00/1a22>
Trace; c01157eb 
Trace; d08c9000 <[sd_mod]__module_using_checksums+18cb/192b>
Trace; c0114c87 
Trace; d08c9000 <[sd_mod]__module_using_checksums+18cb/192b>
Trace; c0106af7 
Code;  c0118051 
 <_EIP>:
Code;  c0118051<=
   0:   8b 53 08  mov0x8(%ebx),%edx   <=
Code;  c0118054 
   3:   8b 43 04  mov0x4(%ebx),%eax
Code;  c0118057 
   6:   89 50 04  mov%edx,0x4(%eax)
Code;  c011805a 
   9:   89 02 mov%eax,(%edx)
Code;  c011805c 
   b:   a1 a0 46 27 c0mov0xc02746a0,%eax
Code;  c0118061 
  10:   50push   %eax
Code;  c0118062 
  11:   8b 03 mov(%ebx),%eax
Code;  c0118064 
  13:   50push   %eax


-- 
Regards,
Pavel Roskin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/