Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Mahesh Rajashekhara and committed by
James Bottomley
2c10cd43 162cca5e

+31 -3
+5 -1
drivers/scsi/aacraid/aacraid.h
··· 12 12 *----------------------------------------------------------------------------*/ 13 13 14 14 #ifndef AAC_DRIVER_BUILD 15 - # define AAC_DRIVER_BUILD 30000 15 + # define AAC_DRIVER_BUILD 30200 16 16 # define AAC_DRIVER_BRANCH "-ms" 17 17 #endif 18 18 #define MAXIMUM_NUM_CONTAINERS 32 ··· 1918 1918 #define MONITOR_PANIC 0x00000020 1919 1919 #define KERNEL_UP_AND_RUNNING 0x00000080 1920 1920 #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) 1921 1925 1922 1926 /* 1923 1927 * Doorbell bit defines
+1 -1
drivers/scsi/aacraid/comminit.c
··· 214 214 cmd = (struct aac_close *) fib_data(fibctx); 215 215 216 216 cmd->command = cpu_to_le32(VM_CloseAll); 217 - cmd->cid = cpu_to_le32(0xffffffff); 217 + cmd->cid = cpu_to_le32(0xfffffffe); 218 218 219 219 status = aac_fib_send(ContainerCommand, 220 220 fibctx,
+25 -1
drivers/scsi/aacraid/src.c
··· 703 703 !aac_src_restart_adapter(dev, 0)) 704 704 ++restart; 705 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 + } 727 + /* 706 728 * Check to see if the board panic'd while booting. 707 729 */ 708 730 status = src_readl(dev, MUnit.OMR); ··· 752 730 /* 753 731 * Wait for the adapter to be up and running. Wait up to 3 minutes 754 732 */ 755 - while (!((status = src_readl(dev, MUnit.OMR)) & KERNEL_UP_AND_RUNNING)) { 733 + while (!((status = src_readl(dev, MUnit.OMR)) & 734 + KERNEL_UP_AND_RUNNING) || 735 + status == 0xffffffff) { 756 736 if ((restart && 757 737 (status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC))) || 758 738 time_after(jiffies, start+HZ*startup_timeout)) {