Skip to contentSkip to conversation

2.6.24-rc1 oops

DISCUSSION Sid Boyce 3 participants 5 messages Oct 25, 2007 Block layer

lore
Share & tools
lore

Sid Boyce

author
#0 lore raw

x86_64 dual, gcc version 4.2.2 (SUSE Linux).

------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:50!
invalid opcode: 0000 [1] SMP
CPU 1
Modules linked in: ub crc_itu_t hwmon cdrom soundcore v4l1_compat videobuf_core btcx_risc ff_memless floppy sg forcedeth ehci_hcd ohci_hcd sd_mod usbcore jfs edd ext3 mbcache jbd fan pata_jmicron ahci sata_nv pata_amd libata scsi_mod thermal processor
Pid: 0, comm: swapper Not tainted 2.6.24-rc1-smp #1
RIP: 0010:[<ffffffff881f3d27>]  [<ffffffff881f3d27>] :ub:ub_state_sense+0x9a/0x169
RSP: 0018:ffff810100697e60  EFLAGS: 00010093
RAX: 0000000087654321 RBX: ffff810105d55000 RCX: ffff81011f975540
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff81011f975540
RBP: ffff810105d51000 R08: 0000000000000000 R09: ffff810105d55098
R10: ffff810001c319b8 R11: 0000000000000286 R12: ffff810105d55098
R13: ffff810105d55260 R14: ffff810105d55278 R15: ffff810105d55298
FS:  00002afb8597c6f0(0000) GS:ffff810100001800(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00002afb8548200f CR3: 000000010615b000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffff810100690000, task ffff810100689160)
Stack:  0000000000000001 ffff810105d55000 ffff810105d51000 0000000000000000
 ffff810105d55260 ffffffff881f4d43 ffff810105919998 ffff810105d553a0
 ffff810105d553af ffff810105d55348 0000000000000286 ffff810105d55058
Call Trace:
 <IRQ>  [<ffffffff881f4d43>] :ub:ub_scsi_action+0x1e3/0x214
 [<ffffffff8023a34e>] tasklet_action+0x54/0x97
 [<ffffffff8023a261>] __do_softirq+0x65/0xce
 [<ffffffff8020d0bc>] call_softirq+0x1c/0x28
 [<ffffffff8020e634>] do_softirq+0x2c/0x7d
 [<ffffffff8023a1b7>] irq_exit+0x3f/0x84
 [<ffffffff8020e7c3>] do_IRQ+0x13e/0x15f
 [<ffffffff8020afa0>] default_idle+0x0/0x3d
 [<ffffffff8020afa0>] default_idle+0x0/0x3d
 [<ffffffff8020c441>] ret_from_intr+0x0/0xa
 <EOI>  [<ffffffff8020afc9>] default_idle+0x29/0x3d
 [<ffffffff8020b070>] cpu_idle+0x93/0xbb


Code: 0f 0b eb fe 83 e2 03 44 89 e8 c7 83 f4 00 00 00 12 00 00 00
RIP  [<ffffffff881f3d27>] :ub:ub_state_sense+0x9a/0x169
 RSP <ffff810100697e60>
Kernel panic - not syncing: Aiee, killing interrupt handler!
Unable to handle kernel paging request at ffff810100697b20 RIP:
 [<ffff810100697b20>]
PGD 8063 PUD d063 PMD 80000001006001e3
Oops: 0011 [2] SMP
CPU 1
Modules linked in: ub crc_itu_t hwmon cdrom soundcore v4l1_compat videobuf_core btcx_risc ff_memless floppy sg forcedeth ehci_hcd ohci_hcd sd_mod usbcore jfs edd ext3 mbcache jbd fan pata_jmicron ahci sata_nv pata_amd libata scsi_mod thermal processor
Pid: 0, comm: swapper Tainted: G      D 2.6.24-rc1-smp #1
RIP: 0010:[<ffff810100697b20>]  [<ffff810100697b20>]
RSP: 0018:ffff810100697af0  EFLAGS: 00010046
RAX: ffff810001042590 RBX: 0000000000000000 RCX: 0000000000000001
RDX: ffff810100001800 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff810100697b20 R08: 0000000000000000 R09: 0000000000000000
R10: ffff810100689160 R11: 0000000000006e7d R12: ffff810100697b20
R13: 0000000000689160 R14: ffff810105d55278 R15: ffff810105d55298
FS:  00002afb8597c6f0(0000) GS:ffff810100001800(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: ffff810100697b20 CR3: 000000010615b000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffff810100690000, task ffff810100689160)
Stack:  ffffffff8021b9f1 ffffffff804dc7d3 0000000000000046 ffffffff804d70f6
 ffffffff8020ca86 ffff810100697b20 0000000000000000 0000000000006e7e
 ffff810100689160 0000000000000000 0000000000000000 ffffffff8038c5ee
Call Trace:
 <IRQ>  [<ffffffff8021b9f1>] smp_call_function_interrupt+0x40/0x67
 [<ffffffff8020ca86>] call_function_interrupt+0x66/0x70
 [<ffffffff8038c5ee>] i8042_panic_blink+0x0/0x13a
 [<ffffffff80235033>] panic+0x11c/0x13e
 [<ffffffff80234fc0>] panic+0xa9/0x13e
 [<ffffffff8020d69b>] printk_address+0xb1/0xba
 [<ffffffff80238234>] do_exit+0x86/0x7fb
 [<ffffffff8036b8b7>] do_unblank_screen+0x1b/0x12f
 [<ffffffff8020d6f7>] kernel_math_error+0x0/0x71
 [<ffffffff8020db1d>] do_invalid_op+0x85/0x8f
 [<ffffffff881f3d27>] :ub:ub_state_sense+0x9a/0x169
 [<ffffffff804192fb>] _spin_lock_irqsave+0x9/0xe
 [<ffffffff881f30f3>] :ub:ub_complete+0x16/0x28
 [<ffffffff804192fb>] _spin_lock_irqsave+0x9/0xe
 [<ffffffff80419459>] error_exit+0x0/0x51
 [<ffffffff881f3d27>] :ub:ub_state_sense+0x9a/0x169
 [<ffffffff881f4d43>] :ub:ub_scsi_action+0x1e3/0x214
 [<ffffffff8023a34e>] tasklet_action+0x54/0x97
 [<ffffffff8023a261>] __do_softirq+0x65/0xce
 [<ffffffff8020d0bc>] call_softirq+0x1c/0x28
 [<ffffffff8020e634>] do_softirq+0x2c/0x7d
 [<ffffffff8023a1b7>] irq_exit+0x3f/0x84
 [<ffffffff8020e7c3>] do_IRQ+0x13e/0x15f
 [<ffffffff8020afa0>] default_idle+0x0/0x3d
 [<ffffffff8020afa0>] default_idle+0x0/0x3d
 [<ffffffff8020c441>] ret_from_intr+0x0/0xa
 <EOI>  [<ffffffff8020afc9>] default_idle+0x29/0x3d
 [<ffffffff8020b070>] cpu_idle+0x93/0xbb


Code: 00 00 00 00 00 00 00 00 7e 6e 00 00 00 00 00 00 60 91 68 00
RIP  [<ffff810100697b20>]
 RSP <ffff810100697af0>
CR2: ffff810100697b20
Kernel panic - not syncing: Aiee, killing interrupt handler!

Regards
Sid.

Signature · 3 lines
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#1 lore raw
Quoted 32 lines · On Thu, 25 Oct 2007 01:40:00 +0100 Sid Boyce <[email protected]> wrote:

x86_64 dual, gcc version 4.2.2 (SUSE Linux).

------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:50!
invalid opcode: 0000 [1] SMP
CPU 1
Modules linked in: ub crc_itu_t hwmon cdrom soundcore v4l1_compat 

videobuf_core btcx_risc ff_memless floppy sg forcedeth ehci_hcd ohci_hcd sd_mod usbcore jfs edd ext3 mbcache jbd fan pata_jmicron ahci sata_nv pata_amd libata scsi_mod thermal processor
Pid: 0, comm: swapper Not tainted 2.6.24-rc1-smp #1

RIP: 0010:[<ffffffff881f3d27>]  [<ffffffff881f3d27>] 
:ub:ub_state_sense+0x9a/0x169
RSP: 0018:ffff810100697e60  EFLAGS: 00010093
RAX: 0000000087654321 RBX: ffff810105d55000 RCX: ffff81011f975540
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff81011f975540
RBP: ffff810105d51000 R08: 0000000000000000 R09: ffff810105d55098
R10: ffff810001c319b8 R11: 0000000000000286 R12: ffff810105d55098
R13: ffff810105d55260 R14: ffff810105d55278 R15: ffff810105d55298
FS:  00002afb8597c6f0(0000) GS:ffff810100001800(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00002afb8548200f CR3: 000000010615b000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffff810100690000, task ffff810100689160)
Stack:  0000000000000001 ffff810105d55000 ffff810105d51000 0000000000000000
  ffff810105d55260 ffffffff881f4d43 ffff810105919998 ffff810105d553a0
  ffff810105d553af ffff810105d55348 0000000000000286 ffff810105d55058
Call Trace:
  <IRQ>  [<ffffffff881f4d43>] :ub:ub_scsi_action+0x1e3/0x214
  [<ffffffff8023a34e>] tasklet_action+0x54/0x97
  [<ffffffff8023a261>] __do_softirq+0x65/0xce
  [<ffffffff8020d0bc>] call_softirq+0x1c/0x28
Quoted 8 lines
  [<ffffffff8020e634>] do_softirq+0x2c/0x7d
  [<ffffffff8023a1b7>] irq_exit+0x3f/0x84
  [<ffffffff8020e7c3>] do_IRQ+0x13e/0x15f
  [<ffffffff8020afa0>] default_idle+0x0/0x3d
  [<ffffffff8020afa0>] default_idle+0x0/0x3d
  [<ffffffff8020c441>] ret_from_intr+0x0/0xa
  <EOI>  [<ffffffff8020afc9>] default_idle+0x29/0x3d
  [<ffffffff8020b070>] cpu_idle+0x93/0xbb

Can you try this?

Thanks,

drivers/block/ub.c +2 -0
index 14143f2..78f158f 100644
@@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
 	scmd->state = UB_CMDST_INIT;
 	scmd->nsg = 1;
 	sg = &scmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(sc->top_sense));
 	sg->offset = (unsigned long)sc->top_sense & (PAGE_SIZE-1);
 	sg->length = UB_SENSE_SIZE;
@@ -1864,6 +1865,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
 	cmd->state = UB_CMDST_INIT;
 	cmd->nsg = 1;
 	sg = &cmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(p));
 	sg->offset = (unsigned long)p & (PAGE_SIZE-1);
 	sg->length = 8;
#2 lore raw

Jens, I should have CC'ed to you.

Quoted 61 lines · On Thu, 25 Oct 2007 10:22:02 +0900 FUJITA Tomonori…
Quoted 32 lines · On Thu, 25 Oct 2007 01:40:00 +0100 Sid Boyce <[email protected]> wrote:

x86_64 dual, gcc version 4.2.2 (SUSE Linux).

------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:50!
invalid opcode: 0000 [1] SMP
CPU 1
Modules linked in: ub crc_itu_t hwmon cdrom soundcore v4l1_compat 

videobuf_core btcx_risc ff_memless floppy sg forcedeth ehci_hcd ohci_hcd sd_mod usbcore jfs edd ext3 mbcache jbd fan pata_jmicron ahci sata_nv pata_amd libata scsi_mod thermal processor
Pid: 0, comm: swapper Not tainted 2.6.24-rc1-smp #1

RIP: 0010:[<ffffffff881f3d27>]  [<ffffffff881f3d27>] 
:ub:ub_state_sense+0x9a/0x169
RSP: 0018:ffff810100697e60  EFLAGS: 00010093
RAX: 0000000087654321 RBX: ffff810105d55000 RCX: ffff81011f975540
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff81011f975540
RBP: ffff810105d51000 R08: 0000000000000000 R09: ffff810105d55098
R10: ffff810001c319b8 R11: 0000000000000286 R12: ffff810105d55098
R13: ffff810105d55260 R14: ffff810105d55278 R15: ffff810105d55298
FS:  00002afb8597c6f0(0000) GS:ffff810100001800(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00002afb8548200f CR3: 000000010615b000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffff810100690000, task ffff810100689160)
Stack:  0000000000000001 ffff810105d55000 ffff810105d51000 0000000000000000
  ffff810105d55260 ffffffff881f4d43 ffff810105919998 ffff810105d553a0
  ffff810105d553af ffff810105d55348 0000000000000286 ffff810105d55058
Call Trace:
  <IRQ>  [<ffffffff881f4d43>] :ub:ub_scsi_action+0x1e3/0x214
  [<ffffffff8023a34e>] tasklet_action+0x54/0x97
  [<ffffffff8023a261>] __do_softirq+0x65/0xce
  [<ffffffff8020d0bc>] call_softirq+0x1c/0x28
Quoted 8 lines
  [<ffffffff8020e634>] do_softirq+0x2c/0x7d
  [<ffffffff8023a1b7>] irq_exit+0x3f/0x84
  [<ffffffff8020e7c3>] do_IRQ+0x13e/0x15f
  [<ffffffff8020afa0>] default_idle+0x0/0x3d
  [<ffffffff8020afa0>] default_idle+0x0/0x3d
  [<ffffffff8020c441>] ret_from_intr+0x0/0xa
  <EOI>  [<ffffffff8020afc9>] default_idle+0x29/0x3d
  [<ffffffff8020b070>] cpu_idle+0x93/0xbb

Can you try this?

Thanks,

drivers/block/ub.c +1 -0
index 14143f2..78f158f 100644
@@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
 	scmd->state = UB_CMDST_INIT;
 	scmd->nsg = 1;
 	sg = &scmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(sc->top_sense));
 	sg->offset = (unsigned long)sc->top_sense & (PAGE_SIZE-1);
 	sg->length = UB_SENSE_SIZE;

drivers/block/ub.c static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun, · line 1871

Quoted 7 lines
drivers/block/ub.c +1 -0
@@ -1864,6 +1865,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
 	cmd->state = UB_CMDST_INIT;
 	cmd->nsg = 1;
 	sg = &cmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(p));
 	sg->offset = (unsigned long)p & (PAGE_SIZE-1);
 	sg->length = 8;

Here's a modified version for your sg branch (for sg_set_page API changes).

-
From: FUJITA Tomonori <[email protected]>
Subject: [PATCH] ub: add sg_init_table for sense and read capacity commands

---
 drivers/block/ub.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/block/ub.c +2 -0
index 5e740e1..08e909d 100644
@@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
 	scmd->state = UB_CMDST_INIT;
 	scmd->nsg = 1;
 	sg = &scmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(sc->top_sense), UB_SENSE_SIZE,
 			(unsigned long)sc->top_sense & (PAGE_SIZE-1));
 	scmd->len = UB_SENSE_SIZE;
@@ -1863,6 +1864,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
 	cmd->state = UB_CMDST_INIT;
 	cmd->nsg = 1;
 	sg = &cmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(p), 8, (unsigned long)p & (PAGE_SIZE-1));
 	cmd->len = 8;
 	cmd->lun = lun;
Signature · 1 line
1.5.2.4
#3 lore raw
Quoted 109 lines · FUJITA Tomonori

Jens, I should have CC'ed to you.

Quoted 61 lines · On Thu, 25 Oct 2007 10:22:02 +0900 FUJITA Tomonori…
Quoted 32 lines · On Thu, 25 Oct 2007 01:40:00 +0100 Sid Boyce <[email protected]> wrote:

x86_64 dual, gcc version 4.2.2 (SUSE Linux).

------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:50!
invalid opcode: 0000 [1] SMP
CPU 1
Modules linked in: ub crc_itu_t hwmon cdrom soundcore v4l1_compat 

videobuf_core btcx_risc ff_memless floppy sg forcedeth ehci_hcd ohci_hcd sd_mod usbcore jfs edd ext3 mbcache jbd fan pata_jmicron ahci sata_nv pata_amd libata scsi_mod thermal processor
Pid: 0, comm: swapper Not tainted 2.6.24-rc1-smp #1

RIP: 0010:[<ffffffff881f3d27>]  [<ffffffff881f3d27>] 
:ub:ub_state_sense+0x9a/0x169
RSP: 0018:ffff810100697e60  EFLAGS: 00010093
RAX: 0000000087654321 RBX: ffff810105d55000 RCX: ffff81011f975540
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff81011f975540
RBP: ffff810105d51000 R08: 0000000000000000 R09: ffff810105d55098
R10: ffff810001c319b8 R11: 0000000000000286 R12: ffff810105d55098
R13: ffff810105d55260 R14: ffff810105d55278 R15: ffff810105d55298
FS:  00002afb8597c6f0(0000) GS:ffff810100001800(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00002afb8548200f CR3: 000000010615b000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffff810100690000, task ffff810100689160)
Stack:  0000000000000001 ffff810105d55000 ffff810105d51000 0000000000000000
  ffff810105d55260 ffffffff881f4d43 ffff810105919998 ffff810105d553a0
  ffff810105d553af ffff810105d55348 0000000000000286 ffff810105d55058
Call Trace:
  <IRQ>  [<ffffffff881f4d43>] :ub:ub_scsi_action+0x1e3/0x214
  [<ffffffff8023a34e>] tasklet_action+0x54/0x97
  [<ffffffff8023a261>] __do_softirq+0x65/0xce
  [<ffffffff8020d0bc>] call_softirq+0x1c/0x28
Quoted 8 lines
  [<ffffffff8020e634>] do_softirq+0x2c/0x7d
  [<ffffffff8023a1b7>] irq_exit+0x3f/0x84
  [<ffffffff8020e7c3>] do_IRQ+0x13e/0x15f
  [<ffffffff8020afa0>] default_idle+0x0/0x3d
  [<ffffffff8020afa0>] default_idle+0x0/0x3d
  [<ffffffff8020c441>] ret_from_intr+0x0/0xa
  <EOI>  [<ffffffff8020afc9>] default_idle+0x29/0x3d
  [<ffffffff8020b070>] cpu_idle+0x93/0xbb

Can you try this?

Thanks,

drivers/block/ub.c +1 -0
index 14143f2..78f158f 100644
@@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
 	scmd->state = UB_CMDST_INIT;
 	scmd->nsg = 1;
 	sg = &scmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(sc->top_sense));
 	sg->offset = (unsigned long)sc->top_sense & (PAGE_SIZE-1);
 	sg->length = UB_SENSE_SIZE;

drivers/block/ub.c static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun, · line 1871

Quoted 7 lines
drivers/block/ub.c +1 -0
@@ -1864,6 +1865,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
 	cmd->state = UB_CMDST_INIT;
 	cmd->nsg = 1;
 	sg = &cmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(p));
 	sg->offset = (unsigned long)p & (PAGE_SIZE-1);
 	sg->length = 8;

Here's a modified version for your sg branch (for sg_set_page API changes).

-
From: FUJITA Tomonori <[email protected]>
Subject: [PATCH] ub: add sg_init_table for sense and read capacity commands

---
 drivers/block/ub.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/block/ub.c +2 -0
index 5e740e1..08e909d 100644
@@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
 	scmd->state = UB_CMDST_INIT;
 	scmd->nsg = 1;
 	sg = &scmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(sc->top_sense), UB_SENSE_SIZE,
 			(unsigned long)sc->top_sense & (PAGE_SIZE-1));
 	scmd->len = UB_SENSE_SIZE;
@@ -1863,6 +1864,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
 	cmd->state = UB_CMDST_INIT;
 	cmd->nsg = 1;
 	sg = &cmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(p), 8, (unsigned long)p & (PAGE_SIZE-1));
 	cmd->len = 8;
 	cmd->lun = lun;
Signature · 1 line
1.5.2.4

Yep looks good, thanks Tomo!

Signature · 1 line
Jens Axboe
author
#4 lore raw
In reply to FUJITA Tomonori
Quoted 94 lines · FUJITA Tomonori

Jens, I should have CC'ed to you.

Quoted 56 lines · On Thu, 25 Oct 2007 10:22:02 +0900 FUJITA Tomonori…
Quoted 28 lines · On Thu, 25 Oct 2007 01:40:00 +0100 Sid Boyce <[email protected]> wrote:

x86_64 dual, gcc version 4.2.2 (SUSE Linux).

------------[ cut here ]------------
kernel BUG at include/linux/scatterlist.h:50!
invalid opcode: 0000 [1] SMP
CPU 1
Modules linked in: ub crc_itu_t hwmon cdrom soundcore v4l1_compat videobuf_core btcx_risc ff_memless floppy sg forcedeth ehci_hcd ohci_hcd sd_mod usbcore jfs edd ext3 mbcache jbd fan pata_jmicron ahci sata_nv pata_amd libata scsi_mod thermal processor
Pid: 0, comm: swapper Not tainted 2.6.24-rc1-smp #1
RIP: 0010:[<ffffffff881f3d27>]  [<ffffffff881f3d27>] :ub:ub_state_sense+0x9a/0x169
RSP: 0018:ffff810100697e60  EFLAGS: 00010093
RAX: 0000000087654321 RBX: ffff810105d55000 RCX: ffff81011f975540
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff81011f975540
RBP: ffff810105d51000 R08: 0000000000000000 R09: ffff810105d55098
R10: ffff810001c319b8 R11: 0000000000000286 R12: ffff810105d55098
R13: ffff810105d55260 R14: ffff810105d55278 R15: ffff810105d55298
FS:  00002afb8597c6f0(0000) GS:ffff810100001800(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 00002afb8548200f CR3: 000000010615b000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process swapper (pid: 0, threadinfo ffff810100690000, task ffff810100689160)
Stack:  0000000000000001 ffff810105d55000 ffff810105d51000 0000000000000000
  ffff810105d55260 ffffffff881f4d43 ffff810105919998 ffff810105d553a0
  ffff810105d553af ffff810105d55348 0000000000000286 ffff810105d55058
Call Trace:
  <IRQ>  [<ffffffff881f4d43>] :ub:ub_scsi_action+0x1e3/0x214
  [<ffffffff8023a34e>] tasklet_action+0x54/0x97
  [<ffffffff8023a261>] __do_softirq+0x65/0xce
  [<ffffffff8020d0bc>] call_softirq+0x1c/0x28
Quoted 8 lines
  [<ffffffff8020e634>] do_softirq+0x2c/0x7d
  [<ffffffff8023a1b7>] irq_exit+0x3f/0x84
  [<ffffffff8020e7c3>] do_IRQ+0x13e/0x15f
  [<ffffffff8020afa0>] default_idle+0x0/0x3d
  [<ffffffff8020afa0>] default_idle+0x0/0x3d
  [<ffffffff8020c441>] ret_from_intr+0x0/0xa
  <EOI>  [<ffffffff8020afc9>] default_idle+0x29/0x3d
  [<ffffffff8020b070>] cpu_idle+0x93/0xbb

Can you try this?

Thanks,

drivers/block/ub.c +1 -0
index 14143f2..78f158f 100644
@@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
 	scmd->state = UB_CMDST_INIT;
 	scmd->nsg = 1;
 	sg = &scmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(sc->top_sense));
 	sg->offset = (unsigned long)sc->top_sense & (PAGE_SIZE-1);
 	sg->length = UB_SENSE_SIZE;

drivers/block/ub.c static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun, · line 1871

Quoted 7 lines
drivers/block/ub.c +1 -0
@@ -1864,6 +1865,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
 	cmd->state = UB_CMDST_INIT;
 	cmd->nsg = 1;
 	sg = &cmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(p));
 	sg->offset = (unsigned long)p & (PAGE_SIZE-1);
 	sg->length = 8;

Here's a modified version for your sg branch (for sg_set_page API changes).

-
From: FUJITA Tomonori <[email protected]>
Subject: [PATCH] ub: add sg_init_table for sense and read capacity commands

---
 drivers/block/ub.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/block/ub.c +1 -0
index 5e740e1..08e909d 100644
@@ -1428,6 +1428,7 @@ static void ub_state_sense(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
 	scmd->state = UB_CMDST_INIT;
 	scmd->nsg = 1;
 	sg = &scmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(sc->top_sense), UB_SENSE_SIZE,
 			(unsigned long)sc->top_sense & (PAGE_SIZE-1));
 	scmd->len = UB_SENSE_SIZE;

drivers/block/ub.c static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun, · line 1870

Quoted 7 lines
drivers/block/ub.c +1 -0
@@ -1863,6 +1864,7 @@ static int ub_sync_read_cap(struct ub_dev *sc, struct ub_lun *lun,
 	cmd->state = UB_CMDST_INIT;
 	cmd->nsg = 1;
 	sg = &cmd->sgv[0];
+	sg_init_table(sg, UB_MAX_REQ_SG);
 	sg_set_page(sg, virt_to_page(p), 8, (unsigned long)p & (PAGE_SIZE-1));
 	cmd->len = 8;
 	cmd->lun = lun;

Boots OK, but oopses with depmod on Virtualbox and other proprietary modules. I assume these modules are out of step with 2.6.24-rc1 and not a kernel problem. Regards
Sid.

Signature · 3 lines
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks