Skip to contentSkip to conversation

ide-scsi oops

DISCUSSION Luben Tuikov 3 participants 3 messages Dec 23, 2002 SCSI

lore
Share & tools
lore
#0 lore raw

kernel 2.5.52 + Willem's patch, at boot:
----------------------------------------

scsi2 : SCSI host adapter emulation for IDE ATAPI devices
Vendor: SONY Model: CDU5211 Rev: YYS2
Type: CD-ROM ANSI SCSI revision: 02
ide-scsi: abort called for 40

Unable to handle kernel NULL pointer dereference at virtual address 00000030
 printing eip:
c02ae831
*pde = 00000000
Oops: 0000
CPU:    1
EIP:    0060:[<c02ae831>]    Not tainted
EFLAGS: 00010086

EIP is at idescsi_abort+0x61/0xc0
eax: 00000028 ebx: 00000082 ecx: f7d4b600 edx: 00000000
esi: 00000007 edi: f7fc85e0 ebp: c04d6068 esp: f7cabf60
ds: 0068 es: 0068 ss: 0068
Process scsi_eh_2 (pid: 15, threadinfo=f7caa000 task=f7cc20a0)

Stack: c0395b00 00000028 00000206 f7d4b600 f7caa000 00000000 c0290a84 f7d4b600
       f7d4b600 f7dbb740 c0290be8 f7d4b600 f7dbb740 f7dbb740 f7cabfc4 c0291645
       f7d4b600 f7dbb740 c010a173 f7d4b600 f7dbb740 c02917c8 f7dbb740 c03a3d1a
Call Trace:
 [<c0290a84>] scsi_try_to_abort_cmd+0x64/0x80
 [<c0290be8>] scsi_eh_abort_cmd+0x48/0x90
 [<c0291645>] scsi_unjam_host+0xa5/0xf0
 [<c010a173>] __down_failed_interruptible+0x7/0xc
 [<c02917c8>] scsi_error_handler+0x138/0x1d0
 [<c0291690>] scsi_error_handler+0x0/0x1d0
 [<c0108ffd>] kernel_thread_helper+0x5/0x18

Code: 39 42 30 74 42 89 2c 24 e8 92 94 fa ff 85 c0 75 26 c6 05 80
Signature · 1 line
Luben
#1 lore raw
Quoted 8 lines · On 2002.12.23 15:24 Luben Tuikov wrote:

kernel 2.5.52 + Willem's patch, at boot:
----------------------------------------

scsi2 : SCSI host adapter emulation for IDE ATAPI devices
Vendor: SONY Model: CDU5211 Rev: YYS2
Type: CD-ROM ANSI SCSI revision: 02
ide-scsi: abort called for 40

Unable to handle kernel NULL pointer dereference at virtual address 00000030

The only place I can think of that might do that is:

ide-scsi.c renamed from ide-scsi.c-rev.1 +3 -1
@@ -289,6 +289,7 @@
 	pc->timeout = jiffies + WAIT_READY;
 	/* NOTE! Save the failed packet command in "rq->buffer" */
 	rq->buffer = (void *) failed_command->special;
+	pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd;
 	if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) {
 		printk ("ide-scsi: %s: queue cmd = ", drive->name);
 		hexdump(pc->c, 6);
@@ -876,7 +877,8 @@
 			/* is cmd active?
 			 *  need to lock so this stuff doesn't change under us */
 			spin_lock_irqsave(&ide_lock, flags);
-			if (scsi->pc && scsi->pc->scsi_cmd->serial_number == cmd->serial_number) {
+			if (scsi->pc && scsi->pc->scsi_cmd && 
+					scsi->pc->scsi_cmd->serial_number == cmd->serial_number) {
 				/* yep - let's give it some more time - 
 				 * we can do that, we're in _our_ error kernel thread */
 				spin_unlock_irqrestore(&ide_lock, flags);

Thanks for testing. Willem Riede.

ide-scsi.c renamed from ide-scsi.c-rev.1 +3 -1
@@ -289,6 +289,7 @@
 	pc->timeout = jiffies + WAIT_READY;
 	/* NOTE! Save the failed packet command in "rq->buffer" */
 	rq->buffer = (void *) failed_command->special;
+	pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd;
 	if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) {
 		printk ("ide-scsi: %s: queue cmd = ", drive->name);
 		hexdump(pc->c, 6);
@@ -876,7 +877,8 @@
 			/* is cmd active?
 			 *  need to lock so this stuff doesn't change under us */
 			spin_lock_irqsave(&ide_lock, flags);
-			if (scsi->pc && scsi->pc->scsi_cmd->serial_number == cmd->serial_number) {
+			if (scsi->pc && scsi->pc->scsi_cmd && 
+					scsi->pc->scsi_cmd->serial_number == cmd->serial_number) {
 				/* yep - let's give it some more time - 
 				 * we can do that, we're in _our_ error kernel thread */
 				spin_unlock_irqrestore(&ide_lock, flags);
#2 lore raw
Quoted 25 lines · Willem Riede
Quoted 8 lines · On 2002.12.23 15:24 Luben Tuikov wrote:

kernel 2.5.52 + Willem's patch, at boot:
----------------------------------------

scsi2 : SCSI host adapter emulation for IDE ATAPI devices
Vendor: SONY Model: CDU5211 Rev: YYS2
Type: CD-ROM ANSI SCSI revision: 02
ide-scsi: abort called for 40

Unable to handle kernel NULL pointer dereference at virtual address 00000030

The only place I can think of that might do that is:

ide-scsi.c renamed from ide-scsi.c-rev.1 +1 -0
@@ -289,6 +289,7 @@
 	pc->timeout = jiffies + WAIT_READY;
 	/* NOTE! Save the failed packet command in "rq->buffer" */
 	rq->buffer = (void *) failed_command->special;
+	pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd;
 	if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) {
 		printk ("ide-scsi: %s: queue cmd = ", drive->name);
 		hexdump(pc->c, 6);

ide-scsi.c line 884

Quoted 9 lines
ide-scsi.c renamed from ide-scsi.c-rev.1 +2 -1
@@ -876,7 +877,8 @@
 			/* is cmd active?
 			 *  need to lock so this stuff doesn't change under us */
 			spin_lock_irqsave(&ide_lock, flags);
-			if (scsi->pc && scsi->pc->scsi_cmd->serial_number == cmd->serial_number) {
+			if (scsi->pc && scsi->pc->scsi_cmd && 
+					scsi->pc->scsi_cmd->serial_number == cmd->serial_number) {
 				/* yep - let's give it some more time - 
 				 * we can do that, we're in _our_ error kernel thread */
 				spin_unlock_irqrestore(&ide_lock, flags);

Willem,
I used sg_reset (in sg3_utils, see www.torque.net/sg) to do a device reset on my ATAPI cdrom with your above patch applied (and after my hack to scsi_error.c).

It seemed to work but there was a bit of noise from the ide subsystem. Perhaps it was assuming that a stuck command was the cause of the device reset.

$ sg_reset -d /dev/sg1
sg_reset: starting device reset
ide-scsi: reset called for 0
sg_reset: completed device reset
[root@frig root]# hdd: ide_timer_expiry: hwgroup->busy was 0 ??
hdd: ATAPI reset complete

My "scsi" devices:

$ lsscsi
[0:0:8:0]    disk    FUJITSU  MAM3184MP        0105  /dev/sda
[2:0:0:0]    CDROM   CREATIVE CD5233E          1.00  /dev/sr0

BTW Perhaps /sys/block (i.e. sysfs) should use "scd" rather than "sr" for SCSI cdroms.

Doug Gilbert