* Kernel oops in 2.6.1 when loading aha152x_cs.ko
@ 2004-01-09 20:14 Larry W. Finger
2004-01-10 1:37 ` Eric Kerin
0 siblings, 1 reply; 9+ messages in thread
From: Larry W. Finger @ 2004-01-09 20:14 UTC (permalink / raw)
To: linux-scsi; +Cc: linux-kernel
When loading module aha152x_cs with kernel 2.6.1 and cardmgr 3.2.5, I get a
kernel oops. This problem has existed at least since 2.5.63, which is when
I started trying the new version. I am reporting this problem now because
since 2.6.0-rc1, the driver now works except for this problem. What I
believe to be the pertinent sections of the output of dmesg are listed below:
===================================================================
Linux version 2.6.1 (root@lwflap) (gcc version 3.3.1) #1 Fri Jan 9 09:56:28
MST 2004
...snip...
Linux Kernel Card Services
options: [pci] [cardbus] [pm]
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 10
..snip..
Yenta: CardBus bridge found at 0000:00:0a.0 [103c:0022]
Yenta: ISA IRQ mask 0x00b8, PCI irq 11
Socket status: 30000007
..snip..
cs: IO port probe 0x0100-0x04ff: excluding 0x2c8-0x2cf 0x378-0x37f
0x3c0-0x3df 0x4d0-0x4d7
cs: IO port probe 0x0800-0x08ff: clean.
cs: IO port probe 0x0c00-0x0cff: clean.
cs: memory probe 0x60000000-0x60ffffff: clean.
Unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip:
c02b5f60
*pde = 00000000
Oops: 0002 [#1]
CPU: 0
EIP: 0060:[<c02b5f60>] Not tainted
EFLAGS: 00010282
EIP is at scsi_register+0x40/0x70
eax: c7bf1a10 ebx: c7bf17f8 ecx: 00000000 edx: cf986cf4
esi: cf986c80 edi: c8a2fa24 ebp: c8a2f7b0 esp: c8a2f7a0
ds: 007b es: 007b ss: 0068
Process cardmgr (pid: 1088, threadinfo=c8a2e000 task=ca31d960)
Stack: cf986c80 00000350 00000000 c8a2f9fc c8a2f7fc cf97ca30 cf986c80 00000350
c73ab180 c8a2f7fc 00000282 cefef080 c73abe90 0000006b c8a2f7fc
073abe90
cf97c42e c73abe90 cefe5ef8 00000282 00000000 c8a2f9fc c8a2fa24
c8a2fa38
Call Trace:
[<cf97ca30>] aha152x_probe_one+0x20/0x460 [aha152x_cs]
[<cf97c42e>] aha152x_config_cs+0x25e/0x360 [aha152x_cs]
[<cf97c48c>] aha152x_config_cs+0x2bc/0x360 [aha152x_cs]
[<c0120150>] scheduler_tick+0x2d0/0x5b0
[<c0119e3d>] mark_offset_tsc+0x3ad/0x560
[<c0132596>] update_process_times+0x46/0x50
[<c013240d>] update_wall_time+0xd/0x40
[<c01328c3>] run_timer_softirq+0x303/0x430
[<c010c75e>] apic_timer_interrupt+0x1a/0x20
[<c02e5652>] yenta_set_mem_map+0x1f2/0x250
[<c02e4ba3>] exca_writew+0x63/0x80
[<c02e5652>] yenta_set_mem_map+0x1f2/0x250
[<c02e4ba3>] exca_writew+0x63/0x80
[<c02e0052>] socket_detect_change+0x32/0x80
[<c01531e9>] check_poison_obj+0x29/0x1a0
[<c02da67e>] set_cis_map+0x3e/0x110
[<c01531e9>] check_poison_obj+0x29/0x1a0
[<c0267a1b>] unblank_screen+0xfb/0x100
[<cf97c62d>] aha152x_event+0x6d/0x140 [aha152x_cs]
[<c021bd04>] __delay+0x14/0x20
[<c02b11c7>] __ide_dma_begin+0x37/0x50
[<c02b1375>] __ide_dma_count+0x15/0x20
[<c02b10b5>] __ide_dma_read+0xc5/0xd0
[<c02b0810>] ide_dma_intr+0x0/0xb0
[<c02b0d30>] dma_timer_expiry+0x0/0x80
[<c02a038b>] do_rw_taskfile+0x1bb/0x2b0
[<c011f498>] kernel_map_pages+0x28/0x90
[<c02db0b2>] pcmcia_get_first_tuple+0x92/0x130
[<c02dc9c8>] read_tuple+0x98/0xb0
[<c01531e9>] check_poison_obj+0x29/0x1a0
[<c02e1876>] pcmcia_register_client+0x1c6/0x2b0
[<c01559cc>] __kmalloc+0x19c/0x250
[<c02e1904>] pcmcia_register_client+0x254/0x2b0
[<cf97c020>] aha152x_attach+0x20/0x140 [aha152x_cs]
[<c011f498>] kernel_map_pages+0x28/0x90
[<c02e2d5a>] CardServices+0x19a/0x346
[<c0155780>] kmem_cache_alloc+0x170/0x220
[<cf97c0f4>] aha152x_attach+0xf4/0x140 [aha152x_cs]
[<cf97c5c0>] aha152x_event+0x0/0x140 [aha152x_cs]
[<c0155780>] kmem_cache_alloc+0x170/0x220
[<c02e3ac4>] bind_request+0x114/0x240
[<c02df6e4>] pcmcia_get_socket_by_nr+0x24/0xb0
[<c02e46a9>] ds_ioctl+0x539/0x680
[<c014f442>] buffered_rmqueue+0xd2/0x270
[<c014f8fe>] __alloc_pages+0x31e/0x380
[<c011f498>] kernel_map_pages+0x28/0x90
[<c01268a6>] __mmdrop+0x36/0x45
[<c01268a6>] __mmdrop+0x36/0x45
[<c011f498>] kernel_map_pages+0x28/0x90
[<c015df3e>] zap_pmd_range+0x4e/0x70
[<c015dfa1>] unmap_page_range+0x41/0x70
[<c015e0c0>] unmap_vmas+0xf0/0x330
[<c01634af>] unmap_vma_list+0x1f/0x30
[<c01634af>] unmap_vma_list+0x1f/0x30
[<c0163ad0>] do_munmap+0x1d0/0x290
[<c018ee15>] sys_ioctl+0x205/0x3f0
[<c010bdcf>] syscall_call+0x7/0xb
Code: 89 01 89 48 04 89 d8 8b 75 fc 8b 5d f8 c9 c3 8b 46 04 c7 04
===================================================================
My kernel debugging skills are minimal; however, I tracked this error to
drivers/scsi/hosts.c where a call is made to list_add_tail with the
sht->legacy_hosts list_head == NULL. The problem is fixed by the patch that
follows. I am aware that this patch fixes the symptom rather than the cause
and this driver should never hit this code. However, the current version
uses scsi_register rather than scsi_host_alloc and has a problem. In
defense of the patch, (1) the driver works with it installed, and (2) the
modified code is only invoked when this particular case occurs.
===================================================================
--- a/drivers/scsi/hosts.c.orig 2004-01-08 09:13:39.374648400 -0700
+++ linux-2.6.1/drivers/scsi/hosts.c 2004-01-08 09:13:45.958647480 -0700
@@ -300,8 +300,13 @@
dump_stack();
}
- if (shost)
+ if (shost) {
+ if (sht->legacy_hosts.next == NULL) {
+ printk(KERN_INFO "sht->legacy_hosts list_head is NULL!\n");
+ INIT_LIST_HEAD(&sht->legacy_hosts);
+ }
list_add_tail(&shost->sht_legacy_list, &sht->legacy_hosts);
+ }
return shost;
}
===================================================================
Larry Finger
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel oops in 2.6.1 when loading aha152x_cs.ko
2004-01-09 20:14 Kernel oops in 2.6.1 when loading aha152x_cs.ko Larry W. Finger
@ 2004-01-10 1:37 ` Eric Kerin
2004-01-10 5:27 ` Larry W. Finger
0 siblings, 1 reply; 9+ messages in thread
From: Eric Kerin @ 2004-01-10 1:37 UTC (permalink / raw)
To: Larry W. Finger; +Cc: linux-scsi
On Fri, 2004-01-09 at 15:14, Larry W. Finger wrote:
> + INIT_LIST_HEAD(&sht->legacy_hosts);
Under the non-pcmcia version of that driver, the above code is handled
by the module_init function (which is included from scsi_module.c), but
since that routine isn't used for the PCMCIA version, that list never
get's initialized.
The below patch handles it in the aha152x driver itself for PCMCIA(which
is the part that is technically broken). Instead of handling it in
hosts.c file.
Give this a try, it should work the same, but I don't have the hardware
to test it on.
Eric
-- linux-2.6.1/drivers/scsi/aha152x.c 2003-12-31 11:04:14.000000000
-0500
+++ linux-2.6.1/drivers/scsi/aha152x.c.listfix 2004-01-09
16:21:03.977748000 -0500
@@ -965,6 +965,12 @@ struct Scsi_Host *aha152x_probe_one(stru
{
struct Scsi_Host *shpnt;
+#ifdef PCMCIA
+ if(!&aha152x_driver_template->legacy_hosts){
+ INIT_LIST_HEAD(&aha152x_driver_template->legacy_hosts);
+ }
+#endif
+
shpnt = scsi_register(&aha152x_driver_template, sizeof(struct
aha152x_hostdata));
if (!shpnt) {
printk(KERN_ERR "aha152x: scsi_register failed\n");
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel oops in 2.6.1 when loading aha152x_cs.ko
2004-01-10 1:37 ` Eric Kerin
@ 2004-01-10 5:27 ` Larry W. Finger
2004-01-10 6:38 ` Eric Kerin
0 siblings, 1 reply; 9+ messages in thread
From: Larry W. Finger @ 2004-01-10 5:27 UTC (permalink / raw)
To: Eric Kerin; +Cc: linux-scsi
At 06:37 PM 1/9/2004, Eric Kerin wrote:
>On Fri, 2004-01-09 at 15:14, Larry W. Finger wrote:
> > + INIT_LIST_HEAD(&sht->legacy_hosts);
>
>Under the non-pcmcia version of that driver, the above code is handled
>by the module_init function (which is included from scsi_module.c), but
>since that routine isn't used for the PCMCIA version, that list never
>get's initialized.
>
>The below patch handles it in the aha152x driver itself for PCMCIA(which
>is the part that is technically broken). Instead of handling it in
>hosts.c file.
>
>Give this a try, it should work the same, but I don't have the hardware
>to test it on.
>
>Eric
>
>
>-- linux-2.6.1/drivers/scsi/aha152x.c 2003-12-31 11:04:14.000000000
>-0500
>+++ linux-2.6.1/drivers/scsi/aha152x.c.listfix 2004-01-09
>16:21:03.977748000 -0500
>@@ -965,6 +965,12 @@ struct Scsi_Host *aha152x_probe_one(stru
>{
> struct Scsi_Host *shpnt;
>
>+#ifdef PCMCIA
>+ if(!&aha152x_driver_template->legacy_hosts){
>+ INIT_LIST_HEAD(&aha152x_driver_template->legacy_hosts);
>+ }
>+#endif
>+
> shpnt = scsi_register(&aha152x_driver_template, sizeof(struct
>aha152x_hostdata));
> if (!shpnt) {
> printk(KERN_ERR "aha152x: scsi_register failed\n");
Unfortunately, this patch doesn't work. When I compile with it, I get the
following errors:
make[1]: `arch/i386/kernel/asm-offsets.s' is up to date.
CHK include/linux/compile.h
CC [M] drivers/scsi/pcmcia/aha152x_core.o
In file included from drivers/scsi/pcmcia/aha152x_core.c:3:
drivers/scsi/aha152x.c: In function `aha152x_probe_one':
drivers/scsi/aha152x.c:976: error: invalid type argument of `->'
drivers/scsi/aha152x.c:978: error: invalid type argument of `->'
drivers/scsi/aha152x.c:978: error: invalid type argument of `->'
drivers/scsi/aha152x.c:978: error: invalid type argument of `->'
drivers/scsi/aha152x.c:978: error: invalid type argument of `->'
make[3]: *** [drivers/scsi/pcmcia/aha152x_core.o] Error 1
make[2]: *** [drivers/scsi/pcmcia] Error 2
make[1]: *** [drivers/scsi] Error 2
make: *** [drivers] Error 2
If I change the "->" to ".", the routine will compile but the tested
location is non-zero, so the list_head is never initialized and the module
loading fails.
Larry Finger
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel oops in 2.6.1 when loading aha152x_cs.ko
2004-01-10 5:27 ` Larry W. Finger
@ 2004-01-10 6:38 ` Eric Kerin
2004-01-10 15:03 ` James Bottomley
0 siblings, 1 reply; 9+ messages in thread
From: Eric Kerin @ 2004-01-10 6:38 UTC (permalink / raw)
To: Larry W. Finger; +Cc: linux-scsi
On Sat, 2004-01-10 at 00:27, Larry W. Finger wrote:
> Unfortunately, this patch doesn't work. When I compile with it, I get the
> following errors:
<snip>
No idea what I was thinking when I wrote that fix, oh well.
Let's try this again, with the proper check. This one even compiles!
Sorry about that first patch,
Eric
--- drivers/scsi/aha152x.c.orig 2003-12-31 11:04:14.000000000 -0500
+++ drivers/scsi/aha152x.c 2004-01-10 01:23:31.568684000 -0500
@@ -965,6 +965,12 @@ struct Scsi_Host *aha152x_probe_one(stru
{
struct Scsi_Host *shpnt;
+#ifdef PCMCIA
+ if(!aha152x_driver_template.legacy_hosts.next){
+ INIT_LIST_HEAD(&aha152x_driver_template.legacy_hosts);
+ }
+#endif
+
shpnt = scsi_register(&aha152x_driver_template, sizeof(struct
aha152x_hostdata));
if (!shpnt) {
printk(KERN_ERR "aha152x: scsi_register failed\n");
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel oops in 2.6.1 when loading aha152x_cs.ko
2004-01-10 6:38 ` Eric Kerin
@ 2004-01-10 15:03 ` James Bottomley
2004-01-10 17:09 ` Larry W. Finger
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: James Bottomley @ 2004-01-10 15:03 UTC (permalink / raw)
To: Eric Kerin; +Cc: Larry W. Finger, SCSI Mailing List
[-- Attachment #1: Type: text/plain, Size: 316 bytes --]
On Sat, 2004-01-10 at 01:38, Eric Kerin wrote:
> Let's try this again, with the proper check. This one even compiles!
Actually, you're still on slightly the wrong track. The quick fix, as I
told Russell on this list is in aha152x_stub.c.
If you want to code that up as a patch and test it, I'll apply it.
James
[-- Attachment #2: Type: message/rfc822, Size: 3193 bytes --]
From: James Bottomley <James.Bottomley@steeleye.com>
To: Russell King <rmk@arm.linux.org.uk>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: Fwd: Kernel Oops with Adaptec 1460D (PCMCIA SCSI-Controller) and Kernel 2.6.0
Date: 08 Jan 2004 13:05:40 -0500
Message-ID: <1073585142.2915.31.camel@mulgrave>
On Thu, 2004-01-08 at 06:29, Russell King wrote:
> Could someone look into this - it seems that it's more of a scsi
> bug than a pcmcia bug.
The problem seems to be this code in aha152x.c:
#ifndef PCMCIA
#define driver_template aha152x_driver_template
#include "scsi_module.c"
#endif
Since it's still behaving as a legacy driver (by calling
register_scsi()), it needs the aha152x_driver_template.legacy_hosts list
initialised (which is done in scsi_module.c).
The true fix would be to convert aha152x to the new API. However, a
quick fix is probably to add
INIT_LIST_HEAD(&s.legacy_hosts);
just before the call to aha152x_probe_one() in aha152x_stub.c
James
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel oops in 2.6.1 when loading aha152x_cs.ko
2004-01-10 15:03 ` James Bottomley
@ 2004-01-10 17:09 ` Larry W. Finger
2004-01-10 17:35 ` Juergen E. Fischer
2004-01-10 19:11 ` Eric Kerin
2 siblings, 0 replies; 9+ messages in thread
From: Larry W. Finger @ 2004-01-10 17:09 UTC (permalink / raw)
To: James Bottomley; +Cc: SCSI Mailing List, eric, turbo-desktop-environment
At 08:03 AM 1/10/2004, James Bottomley wrote:
>The problem seems to be this code in aha152x.c:
>
>#ifndef PCMCIA
>#define driver_template aha152x_driver_template
>#include "scsi_module.c"
>#endif
>
>Since it's still behaving as a legacy driver (by calling
>register_scsi()), it needs the aha152x_driver_template.legacy_hosts list
>initialised (which is done in scsi_module.c).
>
>The true fix would be to convert aha152x to the new API. However, a
>quick fix is probably to add
>
> INIT_LIST_HEAD(&s.legacy_hosts);
>
>just before the call to aha152x_probe_one() in aha152x_stub.c
>
>James
This doesn't compile. The structure 's' has no member named 'legacy_hosts'.
On the other hand, the patch from Eric Kerin fixes the problem. Although
this sample may be mangled by my mailer, it is as follows:
--- drivers/scsi/aha152x.c.orig 2003-12-31 11:04:14.000000000 -0500
+++ drivers/scsi/aha152x.c 2004-01-10 01:23:31.568684000 -0500
@@ -965,6 +965,12 @@ struct Scsi_Host *aha152x_probe_one(stru
{
struct Scsi_Host *shpnt;
+#ifdef PCMCIA
+ if(!aha152x_driver_template.legacy_hosts.next){
+ INIT_LIST_HEAD(&aha152x_driver_template.legacy_hosts);
+ }
+#endif
+
shpnt = scsi_register(&aha152x_driver_template, sizeof(struct
aha152x_hostdata));
if (!shpnt) {
printk(KERN_ERR "aha152x: scsi_register failed\n");
Larry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel oops in 2.6.1 when loading aha152x_cs.ko
2004-01-10 15:03 ` James Bottomley
2004-01-10 17:09 ` Larry W. Finger
@ 2004-01-10 17:35 ` Juergen E. Fischer
2004-01-10 19:11 ` Eric Kerin
2 siblings, 0 replies; 9+ messages in thread
From: Juergen E. Fischer @ 2004-01-10 17:35 UTC (permalink / raw)
To: SCSI Mailing List
[-- Attachment #1: Type: text/plain, Size: 611 bytes --]
Hi James,
On Sat, Jan 10, 2004 at 10:03:20 -0500, James Bottomley wrote:
> On Sat, 2004-01-10 at 01:38, Eric Kerin wrote:
> > Let's try this again, with the proper check. This one even compiles!
>
> Actually, you're still on slightly the wrong track. The quick fix, as I
> told Russell on this list is in aha152x_stub.c.
>
> If you want to code that up as a patch and test it, I'll apply it.
Attached patch removed the references to the legacy stuff from the
driver.
I'm not sure if that is all that needs to be done though, and I could
only test it for the non-pcmcia case, but that works here.
Jürgen
[-- Attachment #2: aha152x.diff --]
[-- Type: text/plain, Size: 3968 bytes --]
--- orig/linux-2.6.0/drivers/scsi/aha152x.c 2004-01-10 18:25:53.000000000 +0100
+++ linux-2.6.0/drivers/scsi/aha152x.c 2004-01-10 18:28:30.000000000 +0100
@@ -860,9 +860,6 @@
{
int i;
- if (check_region(io_port, IO_RANGE))
- return 0;
-
SETPORT(io_port + O_DMACNTRL1, 0); /* reset stack pointer */
for (i = 0; i < 16; i++)
SETPORT(io_port + O_STACK, i);
@@ -878,9 +875,6 @@
{
int i;
- if (check_region(io_port, IO_RANGE))
- return 0;
-
SETPORT(io_port + O_TC_DMACNTRL1, 0); /* reset stack pointer */
for (i = 0; i < 16; i++)
SETPORT(io_port + O_STACK, i);
@@ -903,13 +897,20 @@
if (i == ARRAY_SIZE(ports))
return 0;
#endif
+ if (!request_region(setup->io_port, IO_RANGE, "aha152x"))
+ return 0;
if(aha152x_porttest(setup->io_port)) {
- setup->tc1550=0;
+ setup->tc1550=0;
} else if(tc1550_porttest(setup->io_port)) {
- setup->tc1550=1;
- } else
- return 0;
+ setup->tc1550=1;
+ } else {
+ release_region(setup->io_port, IO_RANGE);
+ return 0;
+ }
+
+ release_region(setup->io_port, IO_RANGE);
+
if ((setup->irq < IRQ_MIN) || (setup->irq > IRQ_MAX))
return 0;
@@ -965,7 +966,7 @@
{
struct Scsi_Host *shpnt;
- shpnt = scsi_register(&aha152x_driver_template, sizeof(struct aha152x_hostdata));
+ shpnt = scsi_host_alloc(&aha152x_driver_template, sizeof(struct aha152x_hostdata));
if (!shpnt) {
printk(KERN_ERR "aha152x: scsi_register failed\n");
return NULL;
@@ -1080,6 +1081,9 @@
printk(KERN_ERR "aha152x%d: failed to reassign interrupt.\n", shpnt->host_no);
goto out_unregister_host;
}
+
+ scsi_add_host(shpnt, 0);
+ scsi_scan_host(shpnt);
return shpnt; /* the pcmcia stub needs the return value; */
out_unregister_host:
@@ -1087,11 +1091,11 @@
out_release_region:
release_region(shpnt->io_port, IO_RANGE);
out_unregister:
- scsi_unregister(shpnt);
+ scsi_host_put(shpnt);
return NULL;
}
-static int aha152x_detect(Scsi_Host_Template * tpnt)
+static int __init aha152x_init(void)
{
int i, j, ok;
#if defined(AUTOCONF)
@@ -1360,7 +1364,6 @@
return registered_count>0;
}
-
static int aha152x_release(struct Scsi_Host *shpnt)
{
if (shpnt->irq)
@@ -1374,11 +1377,25 @@
pnp_device_detach(HOSTDATA(shpnt)->pnpdev);
#endif
- scsi_unregister(shpnt);
+ scsi_host_put(shpnt);
return 0;
}
+static void __exit aha152x_exit(void)
+{
+ int i;
+
+ for(i=0; i<ARRAY_SIZE(setup); i++) {
+ if(aha152x_host[i]) {
+ scsi_remove_host(aha152x_host[i]);
+ aha152x_release(aha152x_host[i]);
+ aha152x_host[i]=0;
+ }
+ }
+}
+
+
/*
* setup controller to generate interrupts depending
* on current state (lock has to be acquired)
@@ -3880,26 +3897,22 @@
}
static Scsi_Host_Template aha152x_driver_template = {
- .module = THIS_MODULE,
- .name = AHA152X_REVID,
- .proc_name = "aha152x",
- .proc_info = aha152x_proc_info,
- .detect = aha152x_detect,
- .queuecommand = aha152x_queue,
- .eh_abort_handler = aha152x_abort,
- .eh_device_reset_handler = aha152x_device_reset,
- .eh_bus_reset_handler = aha152x_bus_reset,
- .eh_host_reset_handler = aha152x_host_reset,
- .release = aha152x_release,
- .bios_param = aha152x_biosparam,
- .can_queue = 1,
- .this_id = 7,
- .sg_tablesize = SG_ALL,
- .cmd_per_lun = 1,
- .use_clustering = DISABLE_CLUSTERING,
+ .module = THIS_MODULE,
+ .name = AHA152X_REVID,
+ .proc_name = "aha152x",
+ .proc_info = aha152x_proc_info,
+ .queuecommand = aha152x_queue,
+ .eh_abort_handler = aha152x_abort,
+ .eh_device_reset_handler = aha152x_device_reset,
+ .eh_bus_reset_handler = aha152x_bus_reset,
+ .eh_host_reset_handler = aha152x_host_reset,
+ .bios_param = aha152x_biosparam,
+ .can_queue = 1,
+ .this_id = 7,
+ .sg_tablesize = SG_ALL,
+ .cmd_per_lun = 1,
+ .use_clustering = DISABLE_CLUSTERING,
};
-#ifndef PCMCIA
-#define driver_template aha152x_driver_template
-#include "scsi_module.c"
-#endif
+module_init(aha152x_init);
+module_exit(aha152x_exit);
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel oops in 2.6.1 when loading aha152x_cs.ko
2004-01-10 15:03 ` James Bottomley
2004-01-10 17:09 ` Larry W. Finger
2004-01-10 17:35 ` Juergen E. Fischer
@ 2004-01-10 19:11 ` Eric Kerin
2004-01-10 20:43 ` James Bottomley
2 siblings, 1 reply; 9+ messages in thread
From: Eric Kerin @ 2004-01-10 19:11 UTC (permalink / raw)
To: James Bottomley; +Cc: Larry W. Finger, SCSI Mailing List
Yes, I agree the best place to put that block of code would have been
aha152x_stub.c, but I couldn't find an existing way to reference the
driver template from that file. The "s" struct is a aha152x_setup, not a
aha152x_driver_template. That's why I put it in aha152x.c with an ifdef
I could setup aha152x_driver_template as an extern, but since I'm still
somewhat new around here, wasn't sure if that was a good way to handle
it. If an extern is fine with you, I'll code it up that way. Although
in that case, it would be best to put the INIT_LIST_HEAD in module_init.
That's where it would normally be done, and we would have a reference at
that point.
Eric
On Sat, 2004-01-10 at 10:03, James Bottomley wrote:
> On Sat, 2004-01-10 at 01:38, Eric Kerin wrote:
> > Let's try this again, with the proper check. This one even compiles!
>
> Actually, you're still on slightly the wrong track. The quick fix, as I
> told Russell on this list is in aha152x_stub.c.
>
> If you want to code that up as a patch and test it, I'll apply it.
>
> James
>
>
> ______________________________________________________________________
> From: James Bottomley <James.Bottomley@steeleye.com>
> To: Russell King <rmk@arm.linux.org.uk>
> Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
> Subject: Re: Fwd: Kernel Oops with Adaptec 1460D (PCMCIA SCSI-Controller) and Kernel 2.6.0
> Date: Thu, 08 Jan 2004 13:05:40 -0500
>
> On Thu, 2004-01-08 at 06:29, Russell King wrote:
> > Could someone look into this - it seems that it's more of a scsi
> > bug than a pcmcia bug.
>
> The problem seems to be this code in aha152x.c:
>
> #ifndef PCMCIA
> #define driver_template aha152x_driver_template
> #include "scsi_module.c"
> #endif
>
> Since it's still behaving as a legacy driver (by calling
> register_scsi()), it needs the aha152x_driver_template.legacy_hosts list
> initialised (which is done in scsi_module.c).
>
> The true fix would be to convert aha152x to the new API. However, a
> quick fix is probably to add
>
> INIT_LIST_HEAD(&s.legacy_hosts);
>
> just before the call to aha152x_probe_one() in aha152x_stub.c
>
> James
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel oops in 2.6.1 when loading aha152x_cs.ko
2004-01-10 19:11 ` Eric Kerin
@ 2004-01-10 20:43 ` James Bottomley
0 siblings, 0 replies; 9+ messages in thread
From: James Bottomley @ 2004-01-10 20:43 UTC (permalink / raw)
To: Eric Kerin; +Cc: Larry W. Finger, SCSI Mailing List
On Sat, 2004-01-10 at 14:11, Eric Kerin wrote:
> Yes, I agree the best place to put that block of code would have been
> aha152x_stub.c, but I couldn't find an existing way to reference the
> driver template from that file. The "s" struct is a aha152x_setup, not a
> aha152x_driver_template. That's why I put it in aha152x.c with an ifdef
>
> I could setup aha152x_driver_template as an extern, but since I'm still
> somewhat new around here, wasn't sure if that was a good way to handle
> it. If an extern is fine with you, I'll code it up that way. Although
> in that case, it would be best to put the INIT_LIST_HEAD in module_init.
> That's where it would normally be done, and we would have a reference at
> that point.
Yes, I see the problem, that's what I get for suggesting something
without trying it.
However, could you try Juergen Fischer's patch, please...that's really
done the way I wanted.
James
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-01-10 20:43 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-09 20:14 Kernel oops in 2.6.1 when loading aha152x_cs.ko Larry W. Finger
2004-01-10 1:37 ` Eric Kerin
2004-01-10 5:27 ` Larry W. Finger
2004-01-10 6:38 ` Eric Kerin
2004-01-10 15:03 ` James Bottomley
2004-01-10 17:09 ` Larry W. Finger
2004-01-10 17:35 ` Juergen E. Fischer
2004-01-10 19:11 ` Eric Kerin
2004-01-10 20:43 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).