All of lore.kernel.org
 help / color / mirror / Atom feed
From: Judith Lebzelter <judith@linux-foundation.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org, Eric.Moore@lsi.com,
	James.Bottomley@SteelEye.com
Subject: [ PATCH ] mptsas: Fix oops during driver load time(rev 2)
Date: Mon, 12 Mar 2007 15:14:31 -0700	[thread overview]
Message-ID: <20070312221431.GA7493@shell0.pdx.osdl.net> (raw)
In-Reply-To: <20070310092643.GB22182@infradead.org>

This fixes an oops during driver load time.   

mptsas_probe calls mpt_attach(over in mptbase.c).  Inside that 
call, we read some manufacturing config pages to setup some 
defaults.  While reading the config pages, the firmware doesn't 
complete the reply in time, and we have a timeout. The timeout 
results in hardreset handler being called.  The hardreset 
handler calls all the fusion upper layer driver reset callback 
handlers.  The mptsas_ioc_reset function is the callback handler 
in mptsas.c.   In summary, mptsas_ioc_reset is getting called 
before scsi_host_alloc is called, and the pointer ioc->sh is 
NULL, as well as the hostdata.

Signed-off-by:  Judith Lebzelter <judith@osdl.org

---
Sorry I was not more descriptive.  Here is the patch with Eric's 
description as requested.

Index: linux-2.6.21-rc3/drivers/message/fusion/mptsas.c
===================================================================
--- linux-2.6.21-rc3.orig/drivers/message/fusion/mptsas.c
+++ linux-2.6.21-rc3/drivers/message/fusion/mptsas.c
@@ -815,7 +815,7 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *io
 static int
 mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
 {
-	MPT_SCSI_HOST	*hd = (MPT_SCSI_HOST *)ioc->sh->hostdata;
+	MPT_SCSI_HOST	*hd;
 	struct mptsas_target_reset_event *target_reset_list, *n;
 	int rc;
 
@@ -827,7 +827,10 @@ mptsas_ioc_reset(MPT_ADAPTER *ioc, int r
 	if (reset_phase != MPT_IOC_POST_RESET)
 		goto out;
 
-	if (!hd || !hd->ioc)
+	if (!ioc->sh || !ioc->sh->hostdata)
+		goto out;
+	hd = (MPT_SCSI_HOST *)ioc->sh->hostdata;
+	if (!hd->ioc)
 		goto out;
 
 	if (list_empty(&hd->target_reset_list))



      reply	other threads:[~2007-03-12 22:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09 21:07 [ PATCH ] mptsas: Fix oops for insmod during kexec Judith Lebzelter
2007-03-09 21:22 ` Christoph Hellwig
2007-03-09 22:22   ` Moore, Eric
2007-03-10  9:26     ` Christoph Hellwig
2007-03-12 22:14       ` Judith Lebzelter [this message]

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=20070312221431.GA7493@shell0.pdx.osdl.net \
    --to=judith@linux-foundation.org \
    --cc=Eric.Moore@lsi.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=hch@infradead.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.