Commit d6be06c8 authored by Michael Reed's avatar Michael Reed Committed by James Bottomley

[SCSI] mptfc: abort of board reset leaves port dead requiring reboot

The driver uses msleep_interruptible() in the code path responsible
for resetting the card's ports via the lsiutil command.  If a
<ctrl-c> is received during the reset it can leave a port in such
a state that the only way to regain its use is to reboot the system.
Changing from msleep_interruptible() to msleep() corrects the problem.
Signed-off-by: default avatarMichael Reed <mdr@sgi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 419835e2
...@@ -2291,7 +2291,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag) ...@@ -2291,7 +2291,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
} }
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible(1); msleep(1);
} else { } else {
mdelay (1); /* 1 msec delay */ mdelay (1); /* 1 msec delay */
} }
...@@ -2679,7 +2679,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag) ...@@ -2679,7 +2679,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
state = mpt_GetIocState(ioc, 1); state = mpt_GetIocState(ioc, 1);
while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) { while (state != MPI_IOC_STATE_OPERATIONAL && --cntdn) {
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible(1); msleep(1);
} else { } else {
mdelay(1); mdelay(1);
} }
...@@ -2931,7 +2931,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag) ...@@ -2931,7 +2931,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag)
/* wait 1 msec */ /* wait 1 msec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible(1); msleep(1);
} else { } else {
mdelay (1); mdelay (1);
} }
...@@ -2948,7 +2948,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag) ...@@ -2948,7 +2948,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag)
} }
/* wait .1 sec */ /* wait .1 sec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (100); msleep (100);
} else { } else {
mdelay (100); mdelay (100);
} }
...@@ -3038,7 +3038,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag) ...@@ -3038,7 +3038,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag)
/* wait 1 msec */ /* wait 1 msec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (1); msleep (1);
} else { } else {
mdelay (1); mdelay (1);
} }
...@@ -3086,7 +3086,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag) ...@@ -3086,7 +3086,7 @@ mpt_downloadboot(MPT_ADAPTER *ioc, MpiFwHeader_t *pFwHeader, int sleepFlag)
return 0; return 0;
} }
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (10); msleep (10);
} else { } else {
mdelay (10); mdelay (10);
} }
...@@ -3137,7 +3137,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) ...@@ -3137,7 +3137,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag); SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag);
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (1000); msleep (1000);
} else { } else {
mdelay (1000); mdelay (1000);
} }
...@@ -3159,7 +3159,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag) ...@@ -3159,7 +3159,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
return hard_reset_done; return hard_reset_done;
} }
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (10); msleep (10);
} else { } else {
mdelay (10); mdelay (10);
} }
...@@ -3230,7 +3230,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3230,7 +3230,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* wait 100 msec */ /* wait 100 msec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (100); msleep (100);
} else { } else {
mdelay (100); mdelay (100);
} }
...@@ -3309,7 +3309,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3309,7 +3309,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* wait 1 sec */ /* wait 1 sec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (1000); msleep (1000);
} else { } else {
mdelay (1000); mdelay (1000);
} }
...@@ -3337,7 +3337,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3337,7 +3337,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* wait 1 sec */ /* wait 1 sec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (1000); msleep (1000);
} else { } else {
mdelay (1000); mdelay (1000);
} }
...@@ -3371,7 +3371,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag) ...@@ -3371,7 +3371,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
/* wait 100 msec */ /* wait 100 msec */
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible (100); msleep (100);
} else { } else {
mdelay (100); mdelay (100);
} }
...@@ -3465,7 +3465,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag) ...@@ -3465,7 +3465,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag)
} }
if (sleepFlag == CAN_SLEEP) { if (sleepFlag == CAN_SLEEP) {
msleep_interruptible(1); msleep(1);
} else { } else {
mdelay (1); /* 1 msec delay */ mdelay (1); /* 1 msec delay */
} }
...@@ -3905,7 +3905,7 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag) ...@@ -3905,7 +3905,7 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
intstat = CHIPREG_READ32(&ioc->chip->IntStatus); intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS)) if (! (intstat & MPI_HIS_IOP_DOORBELL_STATUS))
break; break;
msleep_interruptible (1); msleep (1);
count++; count++;
} }
} else { } else {
...@@ -3954,7 +3954,7 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag) ...@@ -3954,7 +3954,7 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
intstat = CHIPREG_READ32(&ioc->chip->IntStatus); intstat = CHIPREG_READ32(&ioc->chip->IntStatus);
if (intstat & MPI_HIS_DOORBELL_INTERRUPT) if (intstat & MPI_HIS_DOORBELL_INTERRUPT)
break; break;
msleep_interruptible(1); msleep(1);
count++; count++;
} }
} else { } else {
......
...@@ -678,7 +678,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) ...@@ -678,7 +678,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
*/ */
if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) { if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
if (count-- > 0) { if (count-- > 0) {
msleep_interruptible(100); msleep(100);
goto try_again; goto try_again;
} }
printk(MYIOC_s_INFO_FMT "Firmware discovery not" printk(MYIOC_s_INFO_FMT "Firmware discovery not"
......
...@@ -1922,7 +1922,7 @@ mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout ) ...@@ -1922,7 +1922,7 @@ mptscsih_tm_wait_for_completion(MPT_SCSI_HOST * hd, ulong timeout )
break; break;
} }
spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags); spin_unlock_irqrestore(&hd->ioc->FreeQlock, flags);
msleep_interruptible(250); msleep(250);
} while (--loop_count); } while (--loop_count);
return status; return status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment