RE: AACRAID fails to initialize after an kexec operation

Salyzyn, Mark
2007-04-23T13:01:31Z

[-- Attachment #1: Type: text/plain, Size: 3702 bytes --]

2.6.21-rc6-mm1 contains an earlier kexec patch, that one needs to be
removed and this one put in it's place.

Basically the following fragment represents the update in the later
patch that deals with this specific issue.

diff -ru a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
@@ -535,6 +539,8 @@
}

/* Failure to reset here is an option ... */
+ dev->a_ops.adapter_sync_cmd = rx_sync_cmd;
+ dev->a_ops.adapter_enable_int = aac_rx_disable_interrupt;
dev->OIMR = status = rx_readb (dev, MUnit.OIMR);
if ((((status & 0xff) != 0xff) || reset_devices) &&
!aac_rx_restart_adapter(dev, 0))

Sincerely -- Mark Salyzyn

> -----Original Message-----
> From: Vivek Goyal [mailto:vgoyal@in.ibm.com]
> Sent: Monday, April 23, 2007 3:49 AM
> To: linux-scsi@vger.kernel.org; AACRAID
> Cc: Kexec Mailing List; Salyzyn, Mark
> Subject: AACRAID fails to initialize after an kexec operation
>
>
> Hi,
>
> I am trying to kexec into 2.6.21-rc6-mm1 kernel on an x86_64
> machine and
> aacraid panics in the second kernel. Following is the panic message.
>
> Any idea what's going on? Please let me know if more details
> are required.
>
> Adaptec aacraid driver (1.1-5[2437]-mh4)
> ACPI: PCI Interrupt 0000:01:02.0[A] -> GSI 25 (level, low) -> IRQ 25
> Unable to handle kernel NULL pointer dereference at
> 0000000000000000 RIP:
> [<0000000000000000>]
> PGD 0
> Oops: 0000 [1] SMP
> last sysfs file:
> CPU 4
> Modules linked in:
> Pid: 1, comm: swapper Not tainted 2.6.21-rc6-mm1 #2
> RIP: 0010:[<0000000000000000>] [<0000000000000000>]
> RSP: 0018:ffff810100c9fc78 EFLAGS: 00010246
> RAX: ffff810100c9fcc4 RBX: 0000000000000000 RCX: 0000000000000000
> RDX: 0000000000000000 RSI: 0000000000001001 RDI: ffff810100e02d30
> RBP: ffff810100e02d30 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000002 R12: ffff810100e02800
> R13: 0000000000000000 R14: ffffffff80690ee1 R15: 000000000000002d
> FS: 0000000000000000(0000) GS:ffff810100cf6440(0000)
> knlGS:0000000000000000
> CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
> CR2: 0000000000000000 CR3: 0000000000201000 CR4: 00000000000006e0
> Process swapper (pid: 1, threadinfo ffff810100c9e000, task
> ffff810100c9d450)
> Stack: ffffffff8045952f 0000000000000000 ffffffff00000000
> ffff810100c9fcc4
> 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> ffffffff80690ee1 000000000000002d ffff810100e02d30 0000000000000001
> Call Trace:
> Inexact backtrace:
> [<ffffffff8045952f>] aac_rx_restart_adapter+0x7e/0x169
> [<ffffffff80459a0a>] _aac_rx_init+0x70/0x2f6
> [<ffffffff80280ee4>] cache_alloc_refill+0xdb/0x1db
> [<ffffffff8045317f>] aac_probe_one+0x1a9/0x462
> [<ffffffff8035f3a0>] pci_device_probe+0xd1/0x138
> [<ffffffff803b3251>] driver_probe_device+0xf7/0x174
> [<ffffffff803b33e4>] __driver_attach+0x6f/0xae
> [<ffffffff803b3375>] __driver_attach+0x0/0xae
> [<ffffffff803b3375>] __driver_attach+0x0/0xae
> [<ffffffff803b261e>] bus_for_each_dev+0x43/0x6e
> [<ffffffff803b2993>] bus_add_driver+0x78/0x19a
> [<ffffffff8035f578>] __pci_register_driver+0x58/0x8d
> [<ffffffff8084a909>] aac_init+0x35/0x70
> [<ffffffff8082d8ad>] kernel_init+0x167/0x2d1
> [<ffffffff8020a998>] child_rip+0xa/0x12
> [<ffffffff8036bd60>] acpi_ds_init_one_object+0x0/0x7c
> [<ffffffff8082d746>] kernel_init+0x0/0x2d1
> [<ffffffff8020a98e>] child_rip+0x0/0x12
>
>
> Code: Bad RIP value.
> RIP [<0000000000000000>]
> RSP <ffff810100c9fc78>
> CR2: 0000000000000000
> Kernel panic - not syncing: Attempted to kill init!
>
> Thanks
> Vivek
>

[-- Attachment #2: aacraid_kexec_5.patch --]
[-- Type: application/octet-stream, Size: 2670 bytes --]

diff -ru a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
--- a/drivers/scsi/aacraid/rx.c 2007-04-03 11:31:40.288114365 -0400
+++ b/drivers/scsi/aacraid/rx.c 2007-04-03 11:34:12.560873530 -0400
@@ -467,16 +467,19 @@
if (bled)
printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n",
dev->name, dev->id, bled);
- else
+ else {
bled = aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS,
0, 0, 0, 0, 0, 0, &var, NULL, NULL, NULL, NULL);
- if (bled)
+ if (!bled && (var != 0x00000001))
+ bled = -EINVAL;
+ }
+ if (bled && (bled != -ETIMEDOUT))
bled = aac_adapter_sync_cmd(dev, IOP_RESET,
0, 0, 0, 0, 0, 0, &var, NULL, NULL, NULL, NULL);

- if (bled)
+ if (bled && (bled != -ETIMEDOUT))
return -EINVAL;
- if (var == 0x3803000F) { /* USE_OTHER_METHOD */
+ if (bled || (var == 0x3803000F)) { /* USE_OTHER_METHOD */
rx_writel(dev, MUnit.reserved2, 3);
msleep(5000); /* Delay 5 seconds */
var = 0x00000001;
@@ -526,6 +529,7 @@
{
unsigned long start;
unsigned long status;
+ int restart = 0;
int instance = dev->id;
const char * name = dev->name;

@@ -534,15 +538,21 @@
goto error_iounmap;
}

+ /* Failure to reset here is an option ... */
+ dev->a_ops.adapter_sync_cmd = rx_sync_cmd;
+ dev->a_ops.adapter_enable_int = aac_rx_disable_interrupt;
+ dev->OIMR = status = rx_readb (dev, MUnit.OIMR);
+ if ((((status & 0xff) != 0xff) || reset_devices) &&
+ !aac_rx_restart_adapter(dev, 0))
+ ++restart;
/*
* Check to see if the board panic'd while booting.
*/
status = rx_readl(dev, MUnit.OMRx[0]);
if (status & KERNEL_PANIC) {
- if ((status = aac_rx_check_health(dev)) <= 0)
- goto error_iounmap;
- if (aac_rx_restart_adapter(dev, status))
+ if (aac_rx_restart_adapter(dev, aac_rx_check_health(dev)))
goto error_iounmap;
+ ++restart;
}
/*
* Check to see if the board failed any self tests.
@@ -565,11 +575,23 @@
*/
while (!((status = rx_readl(dev, MUnit.OMRx[0])) & KERNEL_UP_AND_RUNNING))
{
- if(time_after(jiffies, start+startup_timeout*HZ)) {
+ if ((restart &&
+ (status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC))) ||
+ time_after(jiffies, start+HZ*startup_timeout)) {
printk(KERN_ERR "%s%d: adapter kernel failed to start, init status = %lx.\n",
dev->name, instance, status);
goto error_iounmap;
}
+ if (!restart &&
+ ((status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC)) ||
+ time_after(jiffies, start + HZ *
+ ((startup_timeout > 60)
+ ? (startup_timeout - 60)
+ : (startup_timeout / 2))))) {
+ if (likely(!aac_rx_restart_adapter(dev, aac_rx_check_health(dev))))
+ start = jiffies;
+ ++restart;
+ }
msleep(1);
}
/*