Re: [ PATCH 3/3 ] tests in mpt_config().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux