2005-12-31 21:44:37

by Grant Coady

[permalink] [raw]
Subject: 2.6.14.5: segfault / oops with ide-scsi

Hi there,

Got this, trying to mount CDROM on a troublesome box I've not had
for long, Intel ICH 801 / 810 -- this with "hdc=ide-scsi":

root@niner:~# mount /dev/sr0 /mnt/cdrom/
mount: you must specify the filesystem type
root@niner:~# mount -t iso9660 /dev/sr0 /mnt/cdrom/
mount: /dev/sr0 is not a valid block device
root@niner:~# mount -t iso9660 /dev/sg0 /mnt/cdrom/
mount: /dev/sg0 is not a block device
root@niner:~# mount -t iso9660 /dev/hdc /mnt/cdrom/
Segmentation fault

Even if this be finger trouble, it should not oops?

Jan 1 08:29:15 niner kernel: ide-scsi is deprecated for cd burning! Use ide-cd and give dev=/dev/hdX as device
Jan 1 08:30:02 niner kernel: ide-scsi: unsup command: dev hdc: flags = REQ_CMD REQ_STARTED
Jan 1 08:30:02 niner kernel: sector 64, nr/cnr 2/2
Jan 1 08:30:02 niner kernel: bio c9e095e0, biotail c9e095e0, buffer c7feb000, data 00000000, len 0
Jan 1 08:30:02 niner kernel: end_request: I/O error, dev hdc, sector 64
Jan 1 08:30:02 niner kernel: isofs_fill_super: bread failed, dev=hdc, iso_blknum=16, block=32
Jan 1 08:30:02 niner kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000000
Jan 1 08:30:02 niner kernel: printing eip:
Jan 1 08:30:02 niner kernel: c01d9206
Jan 1 08:30:02 niner kernel: *pde = 00000000
Jan 1 08:30:02 niner kernel: Oops: 0000 [#1]
Jan 1 08:30:02 niner kernel: Modules linked in: isofs zlib_inflate ide_scsi e100 3c59x
Jan 1 08:30:02 niner kernel: CPU: 0
Jan 1 08:30:02 niner kernel: EIP: 0060:[<c01d9206>] Not tainted VLI
Jan 1 08:30:02 niner kernel: EFLAGS: 00010246 (2.6.14.5a)
Jan 1 08:30:02 niner kernel: EIP is at get_kobj_path_length+0x26/0x40
Jan 1 08:30:02 niner kernel: eax: 00000000 ebx: 00000000 ecx: ffffffff edx: c91a826c
Jan 1 08:30:02 niner kernel: esi: 00000001 edi: 00000000 ebp: ffffffff esp: c7f9fdcc
Jan 1 08:30:02 niner kernel: ds: 007b es: 007b ss: 0068
Jan 1 08:30:02 niner kernel: Process mount (pid: 547, threadinfo=c7f9f000 task=c8fe2090)
Jan 1 08:30:02 niner kernel: Stack: c117c520 c927c200 ffffffea c91a826c c01d929f c91a826c 00000282 c7f65e14
Jan 1 08:30:02 niner kernel: 00000000 c117c520 c927c200 ffffffea 00000000 c01d9be8 c91a826c 000000d0
Jan 1 08:30:02 niner kernel: 00000020 00000064 fffffff4 c117c520 c927c200 ffffffea c7fd1000 c01d9cf8
Jan 1 08:30:02 niner kernel: Call Trace:
Jan 1 08:30:02 niner kernel: [<c01d929f>] kobject_get_path+0x1f/0x80
Jan 1 08:30:02 niner kernel: [<c01d9be8>] do_kobject_uevent+0x28/0x110
Jan 1 08:30:02 niner kernel: [<c01d9cf8>] kobject_uevent+0x28/0x30
Jan 1 08:30:02 niner kernel: [<c0158f0e>] bdev_uevent+0x2e/0x50
Jan 1 08:30:02 niner kernel: [<c01590a6>] kill_block_super+0x26/0x50
Jan 1 08:30:02 niner kernel: [<c01584a6>] deactivate_super+0x56/0x70
Jan 1 08:30:02 niner kernel: [<c0159051>] get_sb_bdev+0x121/0x150
Jan 1 08:30:02 niner kernel: [<c0168cd3>] dput+0x33/0x180
Jan 1 08:30:02 niner kernel: [<ca926fe0>] isofs_get_sb+0x30/0x40 [isofs]
Jan 1 08:30:02 niner kernel: [<ca925cd0>] isofs_fill_super+0x0/0x6e0 [isofs]
Jan 1 08:30:02 niner kernel: [<c015928f>] do_kern_mount+0x5f/0xe0
Jan 1 08:30:02 niner kernel: [<c016de6c>] do_new_mount+0x9c/0xe0
Jan 1 08:30:02 niner kernel: [<c016e457>] do_mount+0x157/0x1b0
Jan 1 08:30:02 niner kernel: [<c016e2a3>] copy_mount_options+0x63/0xc0
Jan 1 08:30:02 niner kernel: [<c016e84a>] sys_mount+0x9a/0xe0
Jan 1 08:30:02 niner kernel: [<c0102fd9>] syscall_call+0x7/0xb
Jan 1 08:30:02 niner kernel: Code: 90 8d 74 26 00 55 bd ff ff ff ff 57 56 be 01 00 00 00 53 8b 54 24 14 31 db 8d b6 00 00 00 00 8d bf 00 00 00 00 8b 3a 89 e9 89 d8 <f2> ae f7 d1 49 8b 52 24 8d 74 31 01 85 d2 75 ea 5b 89 f0 5e 5f

Box info" http://bugsplatter.mine.nu/test/boxen/niner/

Prior to adding the "hdc=ide-scsi" to lilo, the box is able to
boot from cdrom, then cannot read the cdrom. Trying to mount it
results in many of these in syslog:

Jan 1 08:14:12 niner kernel: hdc: attached ide-cdrom driver.
Jan 1 08:15:25 niner kernel: hdc: command error: status=0x51 { DriveReady SeekComplete Error }
Jan 1 08:15:25 niner kernel: hdc: command error: error=0x52
Jan 1 08:15:25 niner kernel: end_request: I/O error, dev 16:00 (hdc), sector 0
Jan 1 08:15:25 niner kernel: hdc: command error: status=0x51 { DriveReady SeekComplete Error }
Jan 1 08:15:25 niner kernel: hdc: command error: error=0x52
Jan 1 08:15:25 niner kernel: end_request: I/O error, dev 16:00 (hdc), sector 4
Jan 1 08:15:25 niner kernel: hdc: command error: status=0x51 { DriveReady SeekComplete Error }
Jan 1 08:15:25 niner kernel: hdc: command error: error=0x52
Jan 1 08:15:25 niner kernel: end_request: I/O error, dev 16:00 (hdc), sector 0

What next?

Thanks,
Grant.


2006-01-01 00:04:18

by Jiri Slaby

[permalink] [raw]
Subject: Re: 2.6.14.5: segfault / oops with ide-scsi

Grant Coady wrote:
>Hi there,
>
>Got this, trying to mount CDROM on a troublesome box I've not had
>for long, Intel ICH 801 / 810 -- this with "hdc=ide-scsi":
>
>root@niner:~# mount /dev/sr0 /mnt/cdrom/
>mount: you must specify the filesystem type
>root@niner:~# mount -t iso9660 /dev/sr0 /mnt/cdrom/
>mount: /dev/sr0 is not a valid block device
>root@niner:~# mount -t iso9660 /dev/sg0 /mnt/cdrom/
>mount: /dev/sg0 is not a block device
>root@niner:~# mount -t iso9660 /dev/hdc /mnt/cdrom/
>Segmentation fault
>
>Even if this be finger trouble, it should not oops?
Could you try the patch below, what does it tell us? Somebody is not setting a
name of a kobject up.

regards, Jiri Slaby.
--
diff --git a/lib/kobject.c b/lib/kobject.c
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -72,6 +72,12 @@ static int get_kobj_path_length(struct k
* Add 1 to strlen for leading '/' of each level.
*/
do {
+ printf(KERN_INFO "THIS:");
+ if (parent->name)
+ printf("%s:", parent->name);
+ if (kobject_name(parent))
+ printf("%s", kobject_name(parent));
+ printf("\n");
length += strlen(kobject_name(parent)) + 1;
parent = parent->parent;
} while (parent);

2006-01-01 00:09:44

by Jiri Slaby

[permalink] [raw]
Subject: Re: 2.6.14.5: segfault / oops with ide-scsi

Grant Coady wrote:
>Hi there,
>
>Got this, trying to mount CDROM on a troublesome box I've not had
>for long, Intel ICH 801 / 810 -- this with "hdc=ide-scsi":
>
>root@niner:~# mount /dev/sr0 /mnt/cdrom/
>mount: you must specify the filesystem type
>root@niner:~# mount -t iso9660 /dev/sr0 /mnt/cdrom/
>mount: /dev/sr0 is not a valid block device
>root@niner:~# mount -t iso9660 /dev/sg0 /mnt/cdrom/
>mount: /dev/sg0 is not a block device
>root@niner:~# mount -t iso9660 /dev/hdc /mnt/cdrom/
>Segmentation fault
>
>Even if this be finger trouble, it should not oops?
Could you try the patch below, what does it tell us? Somebody is not setting a
name of a kobject up.

regards, Jiri Slaby.
--
diff --git a/lib/kobject.c b/lib/kobject.c
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -72,6 +72,12 @@ static int get_kobj_path_length(struct k
* Add 1 to strlen for leading '/' of each level.
*/
do {
+ printf(KERN_INFO "THIS:");
+ if (parent->name)
+ printf("%s:", parent->name);
+ if (kobject_name(parent))
+ printf("%s", kobject_name(parent));
+ printf("\n");
length += strlen(kobject_name(parent)) + 1;
parent = parent->parent;
} while (parent);

2006-01-01 03:43:42

by Grant Coady

[permalink] [raw]
Subject: Re: 2.6.14.5: segfault / oops with ide-scsi

On Sun, 1 Jan 2006 01:04:17 +0100, "Jiri Slaby" <[email protected]> wrote:

>Grant Coady wrote:
>>Hi there,
>>
>>Got this, trying to mount CDROM on a troublesome box I've not had
>>for long, Intel ICH 801 / 810 -- this with "hdc=ide-scsi":
>>
>>root@niner:~# mount /dev/sr0 /mnt/cdrom/
>>mount: you must specify the filesystem type
>>root@niner:~# mount -t iso9660 /dev/sr0 /mnt/cdrom/
>>mount: /dev/sr0 is not a valid block device
>>root@niner:~# mount -t iso9660 /dev/sg0 /mnt/cdrom/
>>mount: /dev/sg0 is not a block device
>>root@niner:~# mount -t iso9660 /dev/hdc /mnt/cdrom/
>>Segmentation fault
>>
>>Even if this be finger trouble, it should not oops?
>Could you try the patch below, what does it tell us? Somebody is not setting a
>name of a kobject up.

The patch didn't apply cleanly to 2.6.14.5, so I checked alternatives.

Updating firmware on CDROM seems to have done the trick :o) Still
testing, but I've seen it mount a CD now, not done that before (not
a dual-boot box so cannot get second opinion from win).

Thanks,
Grant.

2006-01-10 00:59:00

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH] happy-meal-pci-probing

against 2.6.15-mm2

happy-meal-pci-probing

Pci probing functions added, some functions were rewritten.
Use PCI_DEVICE macro.

Signed-off-by: Jiri Slaby <[email protected]>

---
commit eb724d05644c4a6fa80fc7f4beaeabfcd7a19905
tree a75be76af0e6a59f2f1526c7cce188403cff63cf
parent 43aabaed0719318490527bd09bc0b0872953c518
author <ku@bellona.(none)> Tue, 10 Jan 2006 01:52:57 +0100
committer <ku@bellona.(none)> Tue, 10 Jan 2006 01:52:57 +0100

drivers/net/sunhme.c | 79 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 55 insertions(+), 24 deletions(-)

diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -3013,7 +3013,7 @@ static void get_hme_mac_nonsparc(struct
}
#endif /* !(__sparc__) */

-static int __init happy_meal_pci_init(struct pci_dev *pdev)
+static int __devinit happy_meal_pci_init(struct pci_dev *pdev)
{
struct quattro *qp = NULL;
#ifdef __sparc__
@@ -3073,6 +3073,7 @@ static int __init happy_meal_pci_init(st
memset(hp, 0, sizeof(*hp));

hp->happy_dev = pdev;
+ pci_dev_get(pdev);

spin_lock_init(&hp->happy_lock);

@@ -3260,6 +3261,7 @@ err_out_free_res:
pci_release_regions(pdev);

err_out_clear_quattro:
+ pci_dev_put(pdev);
if (qp != NULL)
qp->happy_meals[qfe_slot] = NULL;

@@ -3304,21 +3306,58 @@ static int __init happy_meal_sbus_probe(
#endif

#ifdef CONFIG_PCI
-static int __init happy_meal_pci_probe(void)
+static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
+ const struct pci_device_id *id)
{
- struct pci_dev *pdev = NULL;
- int cards = 0;
+ int retval;
+
+ retval = pci_enable_device(pdev);
+ if (retval < 0)
+ goto err;
+
+ pci_set_master(pdev);
+ happy_meal_pci_init(pdev);
+
+ return 0;
+err:
+ return retval;
+}

- while ((pdev = pci_find_device(PCI_VENDOR_ID_SUN,
- PCI_DEVICE_ID_SUN_HAPPYMEAL, pdev)) != NULL) {
- if (pci_enable_device(pdev))
- continue;
- pci_set_master(pdev);
- cards++;
- happy_meal_pci_init(pdev);
+static void __devexit happy_meal_pci_remove(struct pci_dev *pdev)
+{
+ struct quattro *tmp, *qp = qfe_pci_list;
+ struct pci_dev *bdev = pdev->bus->self;
+
+ if (qp->quattro_dev == bdev) { /* is it the 1st one? */
+ qfe_pci_list = qp->next;
+ kfree(qp);
+ goto end;
}
- return cards;
+
+ for (; qp->next != NULL; qp = qp->next) /* some further? */
+ if (qp->next->quattro_dev == bdev)
+ break;
+
+ tmp = qp->next; /* kill it, but preserve list */
+ qp->next = qp->next->next;
+ kfree(tmp);
+end:
+ pci_dev_put(pdev);
}
+
+static struct pci_device_id happy_meal_pci_tbl[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_HAPPYMEAL) },
+ { 0 }
+};
+MODULE_DEVICE_TABLE(pci, happy_meal_pci_tbl);
+
+static struct pci_driver happy_meal_pci_driver = {
+ .name = "happy_meal_pci",
+ .id_table = happy_meal_pci_tbl,
+ .probe = happy_meal_pci_probe,
+ .remove = __devexit_p(happy_meal_pci_remove)
+};
+
#endif

static int __init happy_meal_probe(void)
@@ -3337,11 +3376,10 @@ static int __init happy_meal_probe(void)
cards += happy_meal_sbus_probe();
#endif
#ifdef CONFIG_PCI
- cards += happy_meal_pci_probe();
+ return pci_register_driver(&happy_meal_pci_driver);
+#else
+ return cards ? 0 : -ENODEV;
#endif
- if (!cards)
- return -ENODEV;
- return 0;
}


@@ -3408,14 +3446,7 @@ static void __exit happy_meal_cleanup_mo
}
#endif
#ifdef CONFIG_PCI
- while (qfe_pci_list) {
- struct quattro *qfe = qfe_pci_list;
- struct quattro *next = qfe->next;
-
- kfree(qfe);
-
- qfe_pci_list = next;
- }
+ pci_unregister_driver(&happy_meal_pci_driver);
#endif
}