diff options
Diffstat (limited to 'drivers/scsi/aacraid/rkt.c')
-rw-r--r-- | drivers/scsi/aacraid/rkt.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/scsi/aacraid/rkt.c b/drivers/scsi/aacraid/rkt.c index 458ea897fd72..f850c3a7cce9 100644 --- a/drivers/scsi/aacraid/rkt.c +++ b/drivers/scsi/aacraid/rkt.c | |||
@@ -395,6 +395,25 @@ static int aac_rkt_send(struct fib * fib) | |||
395 | return 0; | 395 | return 0; |
396 | } | 396 | } |
397 | 397 | ||
398 | static int aac_rkt_restart_adapter(struct aac_dev *dev) | ||
399 | { | ||
400 | u32 var; | ||
401 | |||
402 | printk(KERN_ERR "%s%d: adapter kernel panic'd.\n", | ||
403 | dev->name, dev->id); | ||
404 | |||
405 | if (aac_rkt_check_health(dev) <= 0) | ||
406 | return 1; | ||
407 | if (rkt_sync_cmd(dev, IOP_RESET, 0, 0, 0, 0, 0, 0, | ||
408 | &var, NULL, NULL, NULL, NULL)) | ||
409 | return 1; | ||
410 | if (var != 0x00000001) | ||
411 | return 1; | ||
412 | if (rkt_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) | ||
413 | return 1; | ||
414 | return 0; | ||
415 | } | ||
416 | |||
398 | /** | 417 | /** |
399 | * aac_rkt_init - initialize an i960 based AAC card | 418 | * aac_rkt_init - initialize an i960 based AAC card |
400 | * @dev: device to configure | 419 | * @dev: device to configure |
@@ -417,6 +436,9 @@ int aac_rkt_init(struct aac_dev *dev) | |||
417 | /* | 436 | /* |
418 | * Check to see if the board panic'd while booting. | 437 | * Check to see if the board panic'd while booting. |
419 | */ | 438 | */ |
439 | if (rkt_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) | ||
440 | if (aac_rkt_restart_adapter(dev)) | ||
441 | goto error_iounmap; | ||
420 | /* | 442 | /* |
421 | * Check to see if the board failed any self tests. | 443 | * Check to see if the board failed any self tests. |
422 | */ | 444 | */ |
@@ -431,13 +453,6 @@ int aac_rkt_init(struct aac_dev *dev) | |||
431 | printk(KERN_ERR "%s%d: adapter monitor panic.\n", dev->name, instance); | 453 | printk(KERN_ERR "%s%d: adapter monitor panic.\n", dev->name, instance); |
432 | goto error_iounmap; | 454 | goto error_iounmap; |
433 | } | 455 | } |
434 | /* | ||
435 | * Check to see if the board panic'd while booting. | ||
436 | */ | ||
437 | if (rkt_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) { | ||
438 | printk(KERN_ERR "%s%d: adapter kernel panic'd.\n", dev->name, instance); | ||
439 | goto error_iounmap; | ||
440 | } | ||
441 | start = jiffies; | 456 | start = jiffies; |
442 | /* | 457 | /* |
443 | * Wait for the adapter to be up and running. Wait up to 3 minutes | 458 | * Wait for the adapter to be up and running. Wait up to 3 minutes |