All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernd Schubert <bs@q-leap.de>
To: "Prakash, Sathya" <Sathya.Prakash@lsi.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Desai, Kashyap" <Kashyap.Desai@lsi.com>,
	"Moore, Eric" <Eric.Moore@lsi.com>,
	"James.Bottomley@hansenpartnership.com"
	<James.Bottomley@hansenpartnership.com>,
	DL-MPT Fusion Linux <DL-MPTFusionLinux@lsi.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [ PATCH 3/3 ] tests in mpt_config().
Date: Fri, 6 Feb 2009 14:23:31 +0100	[thread overview]
Message-ID: <200902061423.32797.bs@q-leap.de> (raw)
In-Reply-To: <200902061408.46652.bs@q-leap.de>

Add basic checks to mpt_config(). This is a backport from the mpt fusion 4.17 driver.

Signed-off-by: Bernd Schubert <bs@q-leap.de>

---
 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

  parent reply	other threads:[~2009-02-06 13:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06 13:08 [ PATCH 0/3 ] mpt fusion enhancements Bernd Schubert
2009-02-06 13:18 ` [ PATCH 1/3 ] rename diagPending to ioc_reset_in_progress Bernd Schubert
2009-02-06 13:20 ` [ PATCH 2/3 v4 ] introduce soft reset handler Bernd Schubert
2009-02-06 13:23 ` Bernd Schubert [this message]
2012-06-21 21:20 ` [ PATCH 0/3 ] mpt fusion enhancements Ron Eisler
2012-06-22  9:30   ` Bernd Schubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200902061423.32797.bs@q-leap.de \
    --to=bs@q-leap.de \
    --cc=DL-MPTFusionLinux@lsi.com \
    --cc=Eric.Moore@lsi.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=Kashyap.Desai@lsi.com \
    --cc=Sathya.Prakash@lsi.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.