Add basic checks to mpt_config(). This is a backport from the mpt fusion 4.17 driver. Signed-off-by: Bernd Schubert <bs@xxxxxxxxx> --- drivers/message/fusion/mptbase.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) Index: linus-git/drivers/message/fusion/mptbase.c =================================================================== --- linus-git.orig/drivers/message/fusion/mptbase.c +++ linus-git/drivers/message/fusion/mptbase.c @@ -5868,6 +5868,26 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS return -EPERM; } + /* don't send a config page during diag reset */ + spin_lock_irqsave(&ioc->diagLock, flags); + if (ioc->ioc_reset_in_progress) { + dfailprintk(ioc, printk(MYIOC_s_DEBUG_FMT + "%s: busy with host reset\n", ioc->name, __func__)); + spin_unlock_irqrestore(&ioc->diagLock, flags); + return -EBUSY; + } + spin_unlock_irqrestore(&ioc->diagLock, flags); + + /* don't send if no chance of success */ + if (!ioc->active + || mpt_GetIocState(ioc, 1) != MPI_IOC_STATE_OPERATIONAL) { + dfailprintk(ioc, printk(MYIOC_s_DEBUG_FMT + "%s: ioc not operational, %d, %xh\n", + ioc->name, __func__, ioc->active, + mpt_GetIocState(ioc, 0))); + return -EFAULT; + } + /* Get and Populate a free Frame */ if ((mf = mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) { -- Bernd Schubert Q-Leap Networks GmbH -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html