diff options
author | Salyzyn, Mark <mark_salyzyn@adaptec.com> | 2007-06-12 09:33:54 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-06-17 16:00:47 -0400 |
commit | 29c976844d0bef07d97babc8db60fa6c46788133 (patch) | |
tree | 9543cef49748d0fe7ac08a5a1780c213e0fc37bd /drivers/scsi/aacraid/rx.c | |
parent | 1a655040c24ebf3954ad5cf8848391cb420b1ffb (diff) |
[SCSI] aacraid: add user initiated reset
Add the ability for an application to issue a hardware reset to the
adapter via sysfs. Typical uses include restarting the adapter after it
has been flashed. Bumped revision number for the driver and added a
feature to periodically check the adapter's health (check_interval),
update the adapter's concept of time (update_interval) and block
checking/resetting of the adapter (check_reset).
Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/rx.c')
-rw-r--r-- | drivers/scsi/aacraid/rx.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c index ae978a373c56..ebc65b9fea92 100644 --- a/drivers/scsi/aacraid/rx.c +++ b/drivers/scsi/aacraid/rx.c | |||
@@ -464,21 +464,24 @@ static int aac_rx_restart_adapter(struct aac_dev *dev, int bled) | |||
464 | { | 464 | { |
465 | u32 var; | 465 | u32 var; |
466 | 466 | ||
467 | if (bled) | 467 | if (!(dev->supplement_adapter_info.SupportedOptions2 & |
468 | printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n", | 468 | le32_to_cpu(AAC_OPTION_MU_RESET)) || (bled >= 0) || (bled == -2)) { |
469 | dev->name, dev->id, bled); | 469 | if (bled) |
470 | else { | 470 | printk(KERN_ERR "%s%d: adapter kernel panic'd %x.\n", |
471 | bled = aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS, | 471 | dev->name, dev->id, bled); |
472 | 0, 0, 0, 0, 0, 0, &var, NULL, NULL, NULL, NULL); | 472 | else { |
473 | if (!bled && (var != 0x00000001)) | 473 | bled = aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS, |
474 | bled = -EINVAL; | 474 | 0, 0, 0, 0, 0, 0, &var, NULL, NULL, NULL, NULL); |
475 | } | 475 | if (!bled && (var != 0x00000001)) |
476 | if (bled && (bled != -ETIMEDOUT)) | 476 | bled = -EINVAL; |
477 | bled = aac_adapter_sync_cmd(dev, IOP_RESET, | 477 | } |
478 | 0, 0, 0, 0, 0, 0, &var, NULL, NULL, NULL, NULL); | 478 | if (bled && (bled != -ETIMEDOUT)) |
479 | bled = aac_adapter_sync_cmd(dev, IOP_RESET, | ||
480 | 0, 0, 0, 0, 0, 0, &var, NULL, NULL, NULL, NULL); | ||
479 | 481 | ||
480 | if (bled && (bled != -ETIMEDOUT)) | 482 | if (bled && (bled != -ETIMEDOUT)) |
481 | return -EINVAL; | 483 | return -EINVAL; |
484 | } | ||
482 | if (bled || (var == 0x3803000F)) { /* USE_OTHER_METHOD */ | 485 | if (bled || (var == 0x3803000F)) { /* USE_OTHER_METHOD */ |
483 | rx_writel(dev, MUnit.reserved2, 3); | 486 | rx_writel(dev, MUnit.reserved2, 3); |
484 | msleep(5000); /* Delay 5 seconds */ | 487 | msleep(5000); /* Delay 5 seconds */ |
@@ -596,7 +599,7 @@ int _aac_rx_init(struct aac_dev *dev) | |||
596 | } | 599 | } |
597 | msleep(1); | 600 | msleep(1); |
598 | } | 601 | } |
599 | if (restart) | 602 | if (restart && aac_commit) |
600 | aac_commit = 1; | 603 | aac_commit = 1; |
601 | /* | 604 | /* |
602 | * Fill in the common function dispatch table. | 605 | * Fill in the common function dispatch table. |