aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Moore <eric.moore@lsil.com>2006-07-11 19:33:13 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-13 09:31:23 -0400
commit0ccdb007596642dae8d7b323127d8840939b844a (patch)
tree45262779ff81234ef36e80b397ccdc350824edaf
parent3dc0b03fec73339199a995acd5a47478da0b4dc4 (diff)
[SCSI] mptfusion: firmware download boot fix's
Fix's to insure download boot could occur when either channel of 1030 is reset. Necessary in order for onboard controller in flashless environment to become operational. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/message/fusion/mptbase.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index a3f9275ebe58..af340674e1dd 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1760,9 +1760,9 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1760 * chips (mpt_adapter_disable, 1760 * chips (mpt_adapter_disable,
1761 * mpt_diag_reset) 1761 * mpt_diag_reset)
1762 */ 1762 */
1763 ioc->cached_fw = NULL;
1764 ddlprintk((MYIOC_s_INFO_FMT ": mpt_upload: alt_%s has cached_fw=%p \n", 1763 ddlprintk((MYIOC_s_INFO_FMT ": mpt_upload: alt_%s has cached_fw=%p \n",
1765 ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw)); 1764 ioc->name, ioc->alt_ioc->name, ioc->alt_ioc->cached_fw));
1765 ioc->alt_ioc->cached_fw = NULL;
1766 } 1766 }
1767 } else { 1767 } else {
1768 printk(KERN_WARNING MYNAM ": firmware upload failure!\n"); 1768 printk(KERN_WARNING MYNAM ": firmware upload failure!\n");
@@ -1883,7 +1883,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1883 /* FIXME? Examine results here? */ 1883 /* FIXME? Examine results here? */
1884 } 1884 }
1885 1885
1886out: 1886 out:
1887 if ((ret != 0) && irq_allocated) { 1887 if ((ret != 0) && irq_allocated) {
1888 free_irq(ioc->pci_irq, ioc); 1888 free_irq(ioc->pci_irq, ioc);
1889 if (mpt_msi_enable) 1889 if (mpt_msi_enable)
@@ -2735,6 +2735,8 @@ mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size)
2735 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw) { 2735 if (ioc->alt_ioc && ioc->alt_ioc->cached_fw) {
2736 ioc->cached_fw = ioc->alt_ioc->cached_fw; /* use alt_ioc's memory */ 2736 ioc->cached_fw = ioc->alt_ioc->cached_fw; /* use alt_ioc's memory */
2737 ioc->cached_fw_dma = ioc->alt_ioc->cached_fw_dma; 2737 ioc->cached_fw_dma = ioc->alt_ioc->cached_fw_dma;
2738 ioc->alloc_total += size;
2739 ioc->alt_ioc->alloc_total -= size;
2738 } else { 2740 } else {
2739 if ( (ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma) ) ) 2741 if ( (ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma) ) )
2740 ioc->alloc_total += size; 2742 ioc->alloc_total += size;
@@ -3164,6 +3166,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
3164static int 3166static int
3165mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) 3167mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3166{ 3168{
3169 MPT_ADAPTER *iocp=NULL;
3167 u32 diag0val; 3170 u32 diag0val;
3168 u32 doorbell; 3171 u32 doorbell;
3169 int hard_reset_done = 0; 3172 int hard_reset_done = 0;
@@ -3299,17 +3302,23 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3299 /* FIXME? Examine results here? */ 3302 /* FIXME? Examine results here? */
3300 } 3303 }
3301 3304
3302 if (ioc->cached_fw) { 3305 if (ioc->cached_fw)
3306 iocp = ioc;
3307 else if (ioc->alt_ioc && ioc->alt_ioc->cached_fw)
3308 iocp = ioc->alt_ioc;
3309 if (iocp) {
3303 /* If the DownloadBoot operation fails, the 3310 /* If the DownloadBoot operation fails, the
3304 * IOC will be left unusable. This is a fatal error 3311 * IOC will be left unusable. This is a fatal error
3305 * case. _diag_reset will return < 0 3312 * case. _diag_reset will return < 0
3306 */ 3313 */
3307 for (count = 0; count < 30; count ++) { 3314 for (count = 0; count < 30; count ++) {
3308 diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic); 3315 diag0val = CHIPREG_READ32(&iocp->chip->Diagnostic);
3309 if (!(diag0val & MPI_DIAG_RESET_ADAPTER)) { 3316 if (!(diag0val & MPI_DIAG_RESET_ADAPTER)) {
3310 break; 3317 break;
3311 } 3318 }
3312 3319
3320 dprintk((MYIOC_s_INFO_FMT "cached_fw: diag0val=%x count=%d\n",
3321 iocp->name, diag0val, count));
3313 /* wait 1 sec */ 3322 /* wait 1 sec */
3314 if (sleepFlag == CAN_SLEEP) { 3323 if (sleepFlag == CAN_SLEEP) {
3315 msleep (1000); 3324 msleep (1000);
@@ -3318,7 +3327,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3318 } 3327 }
3319 } 3328 }
3320 if ((count = mpt_downloadboot(ioc, 3329 if ((count = mpt_downloadboot(ioc,
3321 (MpiFwHeader_t *)ioc->cached_fw, sleepFlag)) < 0) { 3330 (MpiFwHeader_t *)iocp->cached_fw, sleepFlag)) < 0) {
3322 printk(KERN_WARNING MYNAM 3331 printk(KERN_WARNING MYNAM
3323 ": firmware downloadboot failure (%d)!\n", count); 3332 ": firmware downloadboot failure (%d)!\n", count);
3324 } 3333 }
@@ -3905,18 +3914,18 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
3905 3914
3906 if (sleepFlag == CAN_SLEEP) { 3915 if (sleepFlag == CAN_SLEEP) {
3907 while (--cntdn) { 3916 while (--cntdn) {
3917 msleep (1);
3908 intstat = CHIPREG_READ32(&ioc->chip->IntStatus); 3918 intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
3909 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) 3919 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
3910 break; 3920 break;
3911 msleep (1);
3912 count++; 3921 count++;
3913 } 3922 }
3914 } else { 3923 } else {
3915 while (--cntdn) { 3924 while (--cntdn) {
3925 mdelay (1);
3916 intstat = CHIPREG_READ32(&ioc->chip->IntStatus); 3926 intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
3917 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) 3927 if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
3918 break; 3928 break;
3919 mdelay (1);
3920 count++; 3929 count++;
3921 } 3930 }
3922 } 3931 }
@@ -4881,6 +4890,7 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc)
4881 pIoc4 = pci_alloc_consistent(ioc->pcidev, iocpage4sz, &ioc4_dma); 4890 pIoc4 = pci_alloc_consistent(ioc->pcidev, iocpage4sz, &ioc4_dma);
4882 if (!pIoc4) 4891 if (!pIoc4)
4883 return; 4892 return;
4893 ioc->alloc_total += iocpage4sz;
4884 } else { 4894 } else {
4885 ioc4_dma = ioc->spi_data.IocPg4_dma; 4895 ioc4_dma = ioc->spi_data.IocPg4_dma;
4886 iocpage4sz = ioc->spi_data.IocPg4Sz; 4896 iocpage4sz = ioc->spi_data.IocPg4Sz;
@@ -4897,6 +4907,7 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc)
4897 } else { 4907 } else {
4898 pci_free_consistent(ioc->pcidev, iocpage4sz, pIoc4, ioc4_dma); 4908 pci_free_consistent(ioc->pcidev, iocpage4sz, pIoc4, ioc4_dma);
4899 ioc->spi_data.pIocPg4 = NULL; 4909 ioc->spi_data.pIocPg4 = NULL;
4910 ioc->alloc_total -= iocpage4sz;
4900 } 4911 }
4901} 4912}
4902 4913
@@ -6404,7 +6415,6 @@ EXPORT_SYMBOL(mpt_alloc_fw_memory);
6404EXPORT_SYMBOL(mpt_free_fw_memory); 6415EXPORT_SYMBOL(mpt_free_fw_memory);
6405EXPORT_SYMBOL(mptbase_sas_persist_operation); 6416EXPORT_SYMBOL(mptbase_sas_persist_operation);
6406 6417
6407
6408/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6418/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
6409/* 6419/*
6410 * fusion_init - Fusion MPT base driver initialization routine. 6420 * fusion_init - Fusion MPT base driver initialization routine.