From: Kashyap, Desai Date: Fri, 29 May 2009 11:23:14 +0000 (+0530) Subject: [SCSI] mpt fusion: Put IOC into ready state if it not already in ready state X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=71278192a887d7da3e768809c6fe9979d172ff23;p=linux-beck.git [SCSI] mpt fusion: Put IOC into ready state if it not already in ready state Signed-off-by: Kashyap Desai Signed-off-by: James Bottomley --- diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 8f04d37fb359..9f6b315624aa 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -2667,6 +2667,22 @@ mpt_adapter_disable(MPT_ADAPTER *ioc) } } + /* + * Put the controller into ready state (if its not already) + */ + if (mpt_GetIocState(ioc, 1) != MPI_IOC_STATE_READY) { + if (!SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, + CAN_SLEEP)) { + if (mpt_GetIocState(ioc, 1) != MPI_IOC_STATE_READY) + printk(MYIOC_s_ERR_FMT "%s: IOC msg unit " + "reset failed to put ioc in ready state!\n", + ioc->name, __func__); + } else + printk(MYIOC_s_ERR_FMT "%s: IOC msg unit reset " + "failed!\n", ioc->name, __func__); + } + + /* Disable adapter interrupts! */ synchronize_irq(ioc->pcidev->irq); CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);