aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aacraid/rx.c')
-rw-r--r--drivers/scsi/aacraid/rx.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index d242e2611d67..00e3cba9d8ef 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -460,22 +460,31 @@ static int aac_rx_ioremap(struct aac_dev * dev, u32 size)
460 return 0; 460 return 0;
461} 461}
462 462
463static int aac_rx_restart_adapter(struct aac_dev *dev) 463static int aac_rx_restart_adapter(struct aac_dev *dev, int bled)
464{ 464{
465 u32 var; 465 u32 var;
466 466
467 printk(KERN_ERR "%s%d: adapter kernel panic'd.\n", 467 if (bled)
468 dev->name, dev->id); 468 printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n",
469 469 dev->name, dev->id, bled);
470 if (aac_rx_check_health(dev) <= 0) 470 else
471 return 1; 471 bled = aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS,
472 if (rx_sync_cmd(dev, IOP_RESET, 0, 0, 0, 0, 0, 0, 472 0, 0, 0, 0, 0, 0, &var, NULL, NULL, NULL, NULL);
473 &var, NULL, NULL, NULL, NULL)) 473 if (bled)
474 return 1; 474 bled = aac_adapter_sync_cmd(dev, IOP_RESET,
475 0, 0, 0, 0, 0, 0, &var, NULL, NULL, NULL, NULL);
476
477 if (bled)
478 return -EINVAL;
479 if (var == 0x3803000F) { /* USE_OTHER_METHOD */
480 rx_writel(dev, MUnit.reserved2, 3);
481 msleep(5000); /* Delay 5 seconds */
482 var = 0x00000001;
483 }
475 if (var != 0x00000001) 484 if (var != 0x00000001)
476 return 1; 485 return -EINVAL;
477 if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) 486 if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC)
478 return 1; 487 return -ENODEV;
479 return 0; 488 return 0;
480} 489}
481 490
@@ -532,9 +541,12 @@ int _aac_rx_init(struct aac_dev *dev)
532 * Check to see if the board panic'd while booting. 541 * Check to see if the board panic'd while booting.
533 */ 542 */
534 status = rx_readl(dev, MUnit.OMRx[0]); 543 status = rx_readl(dev, MUnit.OMRx[0]);
535 if (status & KERNEL_PANIC) 544 if (status & KERNEL_PANIC) {
536 if (aac_rx_restart_adapter(dev)) 545 if ((status = aac_rx_check_health(dev)) <= 0)
537 goto error_iounmap; 546 goto error_iounmap;
547 if (aac_rx_restart_adapter(dev, status))
548 goto error_iounmap;
549 }
538 /* 550 /*
539 * Check to see if the board failed any self tests. 551 * Check to see if the board failed any self tests.
540 */ 552 */
@@ -572,6 +584,7 @@ int _aac_rx_init(struct aac_dev *dev)
572 dev->a_ops.adapter_notify = aac_rx_notify_adapter; 584 dev->a_ops.adapter_notify = aac_rx_notify_adapter;
573 dev->a_ops.adapter_sync_cmd = rx_sync_cmd; 585 dev->a_ops.adapter_sync_cmd = rx_sync_cmd;
574 dev->a_ops.adapter_check_health = aac_rx_check_health; 586 dev->a_ops.adapter_check_health = aac_rx_check_health;
587 dev->a_ops.adapter_restart = aac_rx_restart_adapter;
575 588
576 /* 589 /*
577 * First clear out all interrupts. Then enable the one's that we 590 * First clear out all interrupts. Then enable the one's that we