diff options
author | Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com> | 2013-03-19 11:07:26 +0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-04-10 22:55:52 +0400 |
commit | 2c10cd43ac0b618be1f2e394bef4cbb2aa8bad34 (patch) | |
tree | 7bdfe559606cc5b8f8a129349116de491bd81023 /drivers/scsi/aacraid/src.c | |
parent | 162cca5ed9c28d5d0923179c2b5d6be0c4d4d72e (diff) | |
download | linux-2c10cd43ac0b618be1f2e394bef4cbb2aa8bad34.tar.xz |
[SCSI] aacraid: Dual firmware image support
This patch adds dual flash firmware support for Series 7 and above controllers.
[thenzl: used ssleep(10) instead udelay]
Signed-off-by: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/aacraid/src.c')
-rw-r--r-- | drivers/scsi/aacraid/src.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c index e2e349204e7d..0f56d8d7524f 100644 --- a/drivers/scsi/aacraid/src.c +++ b/drivers/scsi/aacraid/src.c @@ -703,6 +703,28 @@ int aac_srcv_init(struct aac_dev *dev) !aac_src_restart_adapter(dev, 0)) ++restart; /* + * Check to see if flash update is running. + * Wait for the adapter to be up and running. Wait up to 5 minutes + */ + status = src_readl(dev, MUnit.OMR); + if (status & FLASH_UPD_PENDING) { + start = jiffies; + do { + status = src_readl(dev, MUnit.OMR); + if (time_after(jiffies, start+HZ*FWUPD_TIMEOUT)) { + printk(KERN_ERR "%s%d: adapter flash update failed.\n", + dev->name, instance); + goto error_iounmap; + } + } while (!(status & FLASH_UPD_SUCCESS) && + !(status & FLASH_UPD_FAILED)); + /* Delay 10 seconds. + * Because right now FW is doing a soft reset, + * do not read scratch pad register at this time + */ + ssleep(10); + } + /* * Check to see if the board panic'd while booting. */ status = src_readl(dev, MUnit.OMR); @@ -730,7 +752,9 @@ int aac_srcv_init(struct aac_dev *dev) /* * Wait for the adapter to be up and running. Wait up to 3 minutes */ - while (!((status = src_readl(dev, MUnit.OMR)) & KERNEL_UP_AND_RUNNING)) { + while (!((status = src_readl(dev, MUnit.OMR)) & + KERNEL_UP_AND_RUNNING) || + status == 0xffffffff) { if ((restart && (status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC))) || time_after(jiffies, start+HZ*startup_timeout)) { |