2001-04-19 22:49:49

by J.A. Magallon

[permalink] [raw]
Subject: ac10 ide-cd oopses on boot

Hi,

Just built 2.4.3-ac10 and got an oops when booting. It tries to detect
the CD and gives the oops.

Here follows the oops both raw and decoded:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip:
c01bfc7c
pgd entry c0101000: 0000000000000000
pmd entry c0101000: 0000000000000000
.. pmd not present!
Oops: 0000
CPU: 1
EIP: 0010:[<c01bfc7c>]
EFLAGS: 00010297
eax: 0000000d ebx: ffffffff ecx: 00000000 eax: 00000000
esi: 00000000 edi: c15d84e8 ebp: c019e790 esp: c15f9ee8
ds: 0018 es: 0018 ss: 0018
Process swapper (pid: 1, stackpage=c15f9000)
Stack: c0248fbc 00000000 c01bfeac 00000001 c0239e04 c0289841 00000246 00000001
c02cdfb0 c0118af8 c02cdfb0 c0220524 00000080 c019f356 c021ff4c 00000001
00701600 00000000 0007122a 03297371 ff00c023 00008000 c15d84e8
c02cdfb0
Call Trace: [<c01bfeac>] [<c0118af8>] [<c019f356>] [<ff00c023>]
[<c019f903>] [<c019fc66>] [<c0105000>]
[<c0105028>] [<c0105000>] [<c0105516>] [<c0105000>]
Code: 8b 04 8a 83 f8 ff 75 0c 83 c6 20 eb e7 8d b4 26 00 00 00 00
<0>Kernel panic: Attempted to kill init

ksymoops 2.4.1 on i686 2.4.3-ac9. Options used
-v /usr/src/linux-2.4.3-ac10/vmlinux (specified)
-K (specified)
-L (specified)
-o /lib/modules/2.4.3-ac9/ (default)
-m /boot/System.map-2.4.3-ac10 (specified)

No modules in ksyms, skipping objects
Unable to handle kernel NULL pointer dereference at virtual address 00000000
c01bfc7c
Oops: 0000
CPU: 1
EIP: 0010:[<c01bfc7c>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010297
eax: 0000000d ebx: ffffffff ecx: 00000000 eax: 00000000
esi: 00000000 edi: c15d84e8 ebp: c019e790 esp: c15f9ee8
ds: 0018 es: 0018 ss: 0018
Process swapper (pid: 1, stackpage=c15f9000)
Stack: c0248fbc 00000000 c01bfeac 00000001 c0239e04 c0289841 00000246 00000001
c02cdfb0 c0118af8 c02cdfb0 c0220524 00000080 c019f356 c021ff4c 00000001
00701600 00000000 0007122a 03297371 ff00c023 00008000 c15d84e8
c02cdfb0
Call Trace: [<c01bfeac>] [<c0118af8>] [<c019f356>] [<ff00c023>]
[<c019f903>] [<c019fc66>] [<c0105000>]
[<c0105028>] [<c0105000>] [<c0105516>] [<c0105000>]
Code: 8b 04 8a 83 f8 ff 75 0c 83 c6 20 eb e7 8d b4 26 00 00 00 00

>>EIP; c01bfc7c <cdrom_get_entry+1c/50> <=====
Trace; c01bfeac <register_cdrom+1dc/280>
Trace; c0118af8 <printk+148/160>
Trace; c019f356 <ide_cdrom_probe_capabilities+3b6/3d0>
Trace; ff00c023 <END_OF_CODE+3ed31eb3/????>
Trace; c019f903 <ide_cdrom_setup+4a3/4e0>
Trace; c019fc66 <ide_cdrom_init+e6/180>
Trace; c0105000 <init+0/170>
Trace; c0105028 <init+28/170>
Trace; c0105000 <init+0/170>
Trace; c0105516 <kernel_thread+26/30>
Trace; c0105000 <init+0/170>
Code; c01bfc7c <cdrom_get_entry+1c/50>
00000000 <_EIP>:
Code; c01bfc7c <cdrom_get_entry+1c/50> <=====
0: 8b 04 8a mov (%edx,%ecx,4),%eax <=====
Code; c01bfc7f <cdrom_get_entry+1f/50>
3: 83 f8 ff cmp $0xffffffff,%eax
Code; c01bfc82 <cdrom_get_entry+22/50>
6: 75 0c jne 14 <_EIP+0x14> c01bfc90
<cdrom_get_entry+30/50>
Code; c01bfc84 <cdrom_get_entry+24/50>
8: 83 c6 20 add $0x20,%esi
Code; c01bfc87 <cdrom_get_entry+27/50>
b: eb e7 jmp fffffff4 <_EIP+0xfffffff4> c01bfc70
<cdrom_get_entry+10/50>
Code; c01bfc89 <cdrom_get_entry+29/50>
d: 8d b4 26 00 00 00 00 lea 0x0(%esi,1),%esi

<0>Kernel panic: Attempted to kill init


--
J.A. Magallon # Let the source
mailto:[email protected] # be with you, Luke...

Linux werewolf 2.4.3-ac9 #1 SMP Wed Apr 18 10:35:48 CEST 2001 i686


2001-04-19 23:05:46

by Alan

[permalink] [raw]
Subject: Re: ac10 ide-cd oopses on boot

> Just built 2.4.3-ac10 and got an oops when booting. It tries to detect
> the CD and gives the oops.

Can you back out the ide-cd changes Jens did and see if that fixes it ?

2001-04-19 23:34:51

by J.A. Magallon

[permalink] [raw]
Subject: Re: ac10 ide-cd oopses on boot


On 04.20 Alan Cox wrote:
> > Just built 2.4.3-ac10 and got an oops when booting. It tries to detect
> > the CD and gives the oops.
>
> Can you back out the ide-cd changes Jens did and see if that fixes it ?
>
>

Reverted the changes in ide-cd.[hc], and same result.

Bootlog from ac9:

Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
PIIX4: IDE controller on PCI bus 00 dev 39
PIIX4: chipset revision 1
PIIX4: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:pio, hdb:pio
ide1: BM-DMA at 0xffa8-0xffaf, BIOS settings: hdc:DMA, hdd:pio
hda: IOMEGA ZIP 250 ATAPI, ATAPI FLOPPY drive
hdc: CREATIVE CD5230E, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hdc: ATAPI 52X CD-ROM drive, 128kB Cache, DMA
Uniform CD-ROM driver Revision: 3.12
<<<<<<<<<<<< here, ac10 oopses >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
hda: 244736kB, 239/64/32 CHS, 4096 kBps, 512 sector size, 2941 rpm
ide-floppy: hda: I/O error, pc = 5a, key = 5, asc = 24, ascq = 0

--
J.A. Magallon # Let the source
mailto:[email protected] # be with you, Luke...

Linux werewolf 2.4.3-ac9 #1 SMP Wed Apr 18 10:35:48 CEST 2001 i686

2001-04-20 00:18:25

by Udo A. Steinberg

[permalink] [raw]
Subject: Re: ac10 ide-cd oopses on boot

Alan Cox wrote:
>
> > Just built 2.4.3-ac10 and got an oops when booting. It tries to detect
> > the CD and gives the oops.

I'm getting a similar oops with -ac10. I initially thought this might be
a result of switching to gcc-2.95.3, because -ac9 runs fine when built
with gcc-2.95.2, but if others have seen this too, it's probably the
cdrom code indeed.

> Can you back out the ide-cd changes Jens did and see if that fixes it ?

I'll try that tomorrow, too.

Regards,
Udo.

--

ksymoops 2.3.7 on i686 2.4.3-ac9. Options used
-v /usr/src/linux/vmlinux (specified)
-K (specified)
-l /proc/modules (default)
-o /lib/modules/2.4.3-ac10 (specified)
-m /boot/System.map-2.4.3-ac10 (specified)

No modules in ksyms, skipping objects
No ksyms, skipping lsmod
Unable to handle kernel NULL pointer dereference at virtual address 00000000
Oops: 0000
CPU: 0
EIP: 0010:[<c01b9bac>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010297
eax: 0000000d ebx: ffffffff ecx: 00000000 edx: 00000000
esi: 00000000 edi: c1469ae8 ebp: 00000021 ebp: cffe5ee0
ds: 0018 es: 0018 ss: 0018
Process swapper (pid: 1, stackpage=cffe5000)
Stack: c0276018 c0275fb4 c01b9dbf c1469a00 c02e31f4 c1469b18 c02e3100 00000001
00000286 00000001 00000001 c0113623 c02b5fe1 00000246 c0113574 c0244e02
c0244e9d c1469a00 c02e3100 c01b91cb c02448ec c02e3100 c1469037 c0244fc0
Call Trace: [<c01b9dbf>] [<c0113623>] [<c0113574>] [<c01b91cb>] [<c01b8d0c>]
[<c01b976a>] [<c01b9af1>] [<c0105007>] [<c0105488>]
Code: 8b 04 8a 83 f8 ff 75 0c 83 c6 20 eb e7 8d b4 26 00 00 00 00

>>EIP; c01b9bac <cdrom_get_entry+1c/50> <=====
Trace; c01b9dbf <register_cdrom+1bf/250>
Trace; c0113623 <release_console_sem+73/80>
Trace; c0113574 <printk+124/130>
Trace; c01b91cb <ide_cdrom_probe_capabilities+3eb/400>
Trace; c01b8d0c <ide_cdrom_register+13c/150>
Trace; c01b976a <ide_cdrom_setup+49a/4e0>
Trace; c01b9af1 <ide_cdrom_init+e1/180>
Trace; c0105007 <init+7/110>
Trace; c0105488 <kernel_thread+28/40>
Code; c01b9bac <cdrom_get_entry+1c/50>
00000000 <_EIP>:
Code; c01b9bac <cdrom_get_entry+1c/50> <=====
0: 8b 04 8a movl (%edx,%ecx,4),%eax <=====
Code; c01b9baf <cdrom_get_entry+1f/50>
3: 83 f8 ff cmpl $0xffffffff,%eax
Code; c01b9bb2 <cdrom_get_entry+22/50>
6: 75 0c jne 14 <_EIP+0x14> c01b9bc0 <cdrom_get_entry+30/50>
Code; c01b9bb4 <cdrom_get_entry+24/50>
8: 83 c6 20 addl $0x20,%esi
Code; c01b9bb7 <cdrom_get_entry+27/50>
b: eb e7 jmp fffffff4 <_EIP+0xfffffff4> c01b9ba0 <cdrom_get_entry+10/50>
Code; c01b9bb9 <cdrom_get_entry+29/50>
d: 8d b4 26 00 00 00 00 leal 0x0(%esi,1),%esi

<0>Kernel panic: Attempted to kill init!

2001-04-20 00:30:30

by J.A. Magallon

[permalink] [raw]
Subject: Re: ac10 ide-cd oopses on boot


On 04.20 Udo A. Steinberg wrote:
> Alan Cox wrote:
> >
> > > Just built 2.4.3-ac10 and got an oops when booting. It tries to detect
> > > the CD and gives the oops.
>
> I'm getting a similar oops with -ac10. I initially thought this might be
> a result of switching to gcc-2.95.3, because -ac9 runs fine when built
> with gcc-2.95.2, but if others have seen this too, it's probably the
> cdrom code indeed.
>

Mine is built with gcc-2.96-0.48mdk.

--
J.A. Magallon # Let the source
mailto:[email protected] # be with you, Luke...

Linux werewolf 2.4.3-ac9 #1 SMP Wed Apr 18 10:35:48 CEST 2001 i686

2001-04-20 02:40:23

by Bill Nottingham

[permalink] [raw]
Subject: Re: ac10 ide-cd oopses on boot

J . A . Magallon ([email protected]) said:
> > Can you back out the ide-cd changes Jens did and see if that fixes it ?
>
> Reverted the changes in ide-cd.[hc], and same result.

You want to back out the stuff from drivers/cdrom/cdrom.c; I backed
out the parts of the patch new there to ac10, and it worked again
for me...

Bill

2001-04-20 02:56:04

by Jordan Breeding

[permalink] [raw]
Subject: Re: ac10 ide-cd oopses on boot

--- linux_corrupt_cdrom/drivers/cdrom/cdrom.c Thu Apr 19 19:31:00 2001
+++ linux/drivers/cdrom/cdrom.c Wed Apr 18 01:49:05 2001
@@ -279,9 +279,6 @@
static int lockdoor = 1;
/* will we ever get to use this... sigh. */
static int check_media_type;
-static unsigned long *cdrom_numbers;
-static DECLARE_MUTEX(cdrom_sem);
-
MODULE_PARM(debug, "i");
MODULE_PARM(autoclose, "i");
MODULE_PARM(autoeject, "i");
@@ -343,38 +340,6 @@
check_media_change: cdrom_media_changed,
};

-/*
- * get or clear a new cdrom number, run under cdrom_sem
- */
-static int cdrom_get_entry(void)
-{
- int i, nr, foo;
-
- nr = 0;
- foo = -1;
- for (i = 0; i < CDROM_MAX_CDROMS / (sizeof(unsigned long) * 8); i++) {
- if (cdrom_numbers[i] == ~0UL) {
- nr += sizeof(unsigned long) * 8;
- continue;
- }
- foo = ffz(cdrom_numbers[i]);
- set_bit(foo, &cdrom_numbers[i]);
- nr += foo;
- break;
- }
-
- return foo == -1 ? foo : nr;
-}
-
-static void cdrom_clear_entry(struct cdrom_device_info *cdi)
-{
- int bit_nr = cdi->nr & ~(sizeof(unsigned long) * 8);
- int cd_index = cdi->nr / (sizeof(unsigned long) * 8);
-
- clear_bit(bit_nr, &cdrom_numbers[cd_index]);
-}
-
-
/* This macro makes sure we don't have to check on cdrom_device_ops
* existence in the run-time routines below. Change_capability is a
* hack to have the capability flags defined const, while we can still
@@ -389,6 +354,7 @@
struct cdrom_device_ops *cdo = cdi->ops;
int *change_capability = (int *)&cdo->capability; /* hack */
char vname[16];
+ static unsigned int cdrom_counter;

cdinfo(CD_OPEN, "entering register_cdrom\n");

@@ -429,17 +395,7 @@

if (!devfs_handle)
devfs_handle = devfs_mk_dir (NULL, "cdroms", NULL);
-
- /*
- * get new cdrom number
- */
- down(&cdrom_sem);
- cdi->nr = cdrom_get_entry();
- up(&cdrom_sem);
- if (cdi->nr == -1)
- return -ENOMEM;
-
- sprintf(vname, "cdrom%u", cdi->nr);
+ sprintf (vname, "cdrom%u", cdrom_counter++);
if (cdi->de) {
int pos;
devfs_handle_t slave;
@@ -462,13 +418,9 @@
S_IFBLK | S_IRUGO | S_IWUGO,
&cdrom_fops, NULL);
}
-
- down(&cdrom_sem);
+ cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name);
cdi->next = topCdromPtr;
topCdromPtr = cdi;
- up(&cdrom_sem);
-
- cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name);
return 0;
}
#undef ENSURE
@@ -477,14 +429,12 @@
{
struct cdrom_device_info *cdi, *prev;
int major = MAJOR(unreg->dev);
- int bit_nr, cd_index;

cdinfo(CD_OPEN, "entering unregister_cdrom\n");

if (major < 0 || major >= MAX_BLKDEV)
return -1;

- down(&cdrom_sem);
prev = NULL;
cdi = topCdromPtr;
while (cdi != NULL && cdi->dev != unreg->dev) {
@@ -492,20 +442,14 @@
cdi = cdi->next;
}

- if (cdi == NULL) {
- up(&cdrom_sem);
+ if (cdi == NULL)
return -2;
- }
-
- cdrom_clear_entry(cdi);
-
if (prev)
prev->next = cdi->next;
else
topCdromPtr = cdi->next;
- up(&cdrom_sem);
cdi->ops->n_minors--;
- devfs_unregister(cdi->de);
+ devfs_unregister (cdi->de);
cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name);
return 0;
}
@@ -514,14 +458,10 @@
{
struct cdrom_device_info *cdi;

- down(&cdrom_sem);
-
cdi = topCdromPtr;
while (cdi != NULL && cdi->dev != dev)
cdi = cdi->next;

- up(&cdrom_sem);
-
return cdi;
}

@@ -2489,8 +2429,6 @@
}

pos = sprintf(info, "CD-ROM information, " VERSION "\n");
-
- down(&cdrom_sem);

pos += sprintf(info+pos, "\ndrive name:\t");
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
@@ -2560,8 +2498,6 @@
for (cdi=topCdromPtr;cdi!=NULL;cdi=cdi->next)
pos += sprintf(info+pos, "\t%d", CDROM_CAN(CDC_DVD_RAM) != 0);

- up(&cdrom_sem);
-
strcpy(info+pos,"\n\n");

return proc_dostring(ctl, write, filp, buffer, lenp);
@@ -2708,10 +2644,6 @@

static int __init cdrom_init(void)
{
- int n_entries = CDROM_MAX_CDROMS / (sizeof(unsigned long) * 8);
-
- cdrom_numbers = kmalloc(n_entries * sizeof(unsigned long), GFP_KERNEL);
-
#ifdef CONFIG_SYSCTL
cdrom_sysctl_register();
#endif
@@ -2722,7 +2654,6 @@
static void __exit cdrom_exit(void)
{
printk(KERN_INFO "Uniform CD-ROM driver unloaded\n");
- kfree(cdrom_numbers);
#ifdef CONFIG_SYSCTL
cdrom_sysctl_unregister();
#endif


Attachments:
patch-fix-cdrom-ac10 (4.14 kB)

2001-04-20 07:32:25

by s-jaschke

[permalink] [raw]
Subject: Re: ac10 ide-cd oopses on boot

On Friday 20 April 2001 00:49, J . A . Magallon wrote:
> Hi,
>
> Just built 2.4.3-ac10 and got an oops when booting. It tries to detect
> the CD and gives the oops.
> >>EIP; c01bfc7c <cdrom_get_entry+1c/50> <=====

This appears to be a known problem. Jens Axboe sent a patch in a different
thread ("SD-W2002 DVD-RAM") that fixes this. I am including it
here for your convenience. (The patch is against 2.4.4-pre4 + Jens'
latest fixes.)

Stefan


Attachments:
cd-get-entry-1 (744.00 B)

2001-04-20 08:45:50

by Jens Axboe

[permalink] [raw]
Subject: patch: cdrom_init not called correctly (was Re: ac10 ide-cd oopses on boot)

On Fri, Apr 20 2001, Stefan Jaschke wrote:
> On Friday 20 April 2001 00:49, J . A . Magallon wrote:
> > Hi,
> >
> > Just built 2.4.3-ac10 and got an oops when booting. It tries to detect
> > the CD and gives the oops.
> > >>EIP; c01bfc7c <cdrom_get_entry+1c/50> <=====
>
> This appears to be a known problem. Jens Axboe sent a patch in a different
> thread ("SD-W2002 DVD-RAM") that fixes this. I am including it
> here for your convenience. (The patch is against 2.4.4-pre4 + Jens'
> latest fixes.)

Indeed, and it was the missing init call as suspected. The problem is
that cdrom is consequently linked after low level drivers -- this is
really the stuff that should be fixed, but instead of rewriting all of
that this quick hack should suffice.

--
Jens Axboe


Attachments:
(No filename) (770.00 B)
cd-ac10-1 (1.27 kB)
Download all attachments

2001-04-20 11:00:45

by jurriaan

[permalink] [raw]
Subject: Re: [lkml]Re: ac10 ide-cd oopses on boot

On Thu, Apr 19, 2001 at 09:55:46PM -0500, Jordan wrote:
> Bill Nottingham wrote:
> >
> > J . A . Magallon ([email protected]) said:
> > > > Can you back out the ide-cd changes Jens did and see if that fixes it ?
> > >
> > > Reverted the changes in ide-cd.[hc], and same result.
> >
> > You want to back out the stuff from drivers/cdrom/cdrom.c; I backed
> > out the parts of the patch new there to ac10, and it worked again
> > for me...
> >
> That worked here as well...here is a patch that should restore
> linux/drivers/cdrom/cdrom.c back to its working ac9 state from ac10.
>
<snip patch; can be found on lkml>

2.4.3-ac10 wouldn't boot for me without this patch.
I have only scsi cdrom(s) on an symbios 860:

Attached devices:
Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: PLEXTOR Model: CD-R PX-R412C Rev: 1.03
Type: CD-ROM ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 04 Lun: 00
Vendor: SONY Model: SDT-5000 Rev: 330B
Type: Sequential-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 05 Lun: 00
Vendor: PLEXTOR Model: CD-ROM PX-32TS Rev: 1.02
Type: CD-ROM ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 06 Lun: 00
Vendor: TOSHIBA Model: DVD-ROM SD-M1401 Rev: 1008
Type: CD-ROM ANSI SCSI revision: 02

With this patch, it boots just fine.

Good luck,
Jurriaan
--
And all the while, all the while, I still hear that call
To the land of gold and poison that beckons to us all
Do you think you're so brave just to go running to that which beckons to us all?
New Model Army - Valleys of Green and Grey
GNU/Linux 2.4.3-ac10 SMP/ReiserFS 2x1743 bogomips load av: 0.20 0.05 0.01