Skip to content

Commit 2c10cd4

Browse files
Mahesh RajashekharaJames Bottomley
authored andcommitted
[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>
1 parent 162cca5 commit 2c10cd4

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

‎drivers/scsi/aacraid/aacraid.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*----------------------------------------------------------------------------*/
1313

1414
#ifndef AAC_DRIVER_BUILD
15-
# define AAC_DRIVER_BUILD 30000
15+
# define AAC_DRIVER_BUILD 30200
1616
# define AAC_DRIVER_BRANCH "-ms"
1717
#endif
1818
#define MAXIMUM_NUM_CONTAINERS 32
@@ -1918,6 +1918,10 @@ extern struct aac_common aac_config;
19181918
#define MONITOR_PANIC 0x00000020
19191919
#define KERNEL_UP_AND_RUNNING 0x00000080
19201920
#define KERNEL_PANIC 0x00000100
1921+
#define FLASH_UPD_PENDING 0x00002000
1922+
#define FLASH_UPD_SUCCESS 0x00004000
1923+
#define FLASH_UPD_FAILED 0x00008000
1924+
#define FWUPD_TIMEOUT (5 * 60)
19211925

19221926
/*
19231927
* Doorbell bit defines

‎drivers/scsi/aacraid/comminit.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ int aac_send_shutdown(struct aac_dev * dev)
214214
cmd = (struct aac_close *) fib_data(fibctx);
215215

216216
cmd->command = cpu_to_le32(VM_CloseAll);
217-
cmd->cid = cpu_to_le32(0xffffffff);
217+
cmd->cid = cpu_to_le32(0xfffffffe);
218218

219219
status = aac_fib_send(ContainerCommand,
220220
fibctx,

‎drivers/scsi/aacraid/src.c‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,28 @@ int aac_srcv_init(struct aac_dev *dev)
702702
if ((aac_reset_devices || reset_devices) &&
703703
!aac_src_restart_adapter(dev, 0))
704704
++restart;
705+
/*
706+
* Check to see if flash update is running.
707+
* Wait for the adapter to be up and running. Wait up to 5 minutes
708+
*/
709+
status = src_readl(dev, MUnit.OMR);
710+
if (status & FLASH_UPD_PENDING) {
711+
start = jiffies;
712+
do {
713+
status = src_readl(dev, MUnit.OMR);
714+
if (time_after(jiffies, start+HZ*FWUPD_TIMEOUT)) {
715+
printk(KERN_ERR "%s%d: adapter flash update failed.\n",
716+
dev->name, instance);
717+
goto error_iounmap;
718+
}
719+
} while (!(status & FLASH_UPD_SUCCESS) &&
720+
!(status & FLASH_UPD_FAILED));
721+
/* Delay 10 seconds.
722+
* Because right now FW is doing a soft reset,
723+
* do not read scratch pad register at this time
724+
*/
725+
ssleep(10);
726+
}
705727
/*
706728
* Check to see if the board panic'd while booting.
707729
*/
@@ -730,7 +752,9 @@ int aac_srcv_init(struct aac_dev *dev)
730752
/*
731753
* Wait for the adapter to be up and running. Wait up to 3 minutes
732754
*/
733-
while (!((status = src_readl(dev, MUnit.OMR)) & KERNEL_UP_AND_RUNNING)) {
755+
while (!((status = src_readl(dev, MUnit.OMR)) &
756+
KERNEL_UP_AND_RUNNING) ||
757+
status == 0xffffffff) {
734758
if ((restart &&
735759
(status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC))) ||
736760
time_after(jiffies, start+HZ*startup_timeout)) {

0 commit comments

Comments
 (0)