* [ PATCH ] mptsas: Fix oops for insmod during kexec
@ 2007-03-09 21:07 Judith Lebzelter
2007-03-09 21:22 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Judith Lebzelter @ 2007-03-09 21:07 UTC (permalink / raw)
To: linux-scsi; +Cc: mpt_linux_developer, Eric.Moore, James.Bottomley
Hello,
This patch is to fix an oops on insmod for mptsas during kexec.
This applies to 2.6.21-rc3.
Signed-off-by: Judith Lebzelter <judith@osdl.org
---
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))
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [ PATCH ] mptsas: Fix oops for insmod during kexec
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
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2007-03-09 21:22 UTC (permalink / raw)
To: Judith Lebzelter
Cc: linux-scsi, mpt_linux_developer, Eric.Moore, James.Bottomley
On Fri, Mar 09, 2007 at 01:07:44PM -0800, Judith Lebzelter wrote:
> Hello,
>
> This patch is to fix an oops on insmod for mptsas during kexec.
> This applies to 2.6.21-rc3.
>
> Signed-off-by: Judith Lebzelter <judith@osdl.org
>
> ---
>
>
> 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)
This needs a much better explanation. Please show the codepath
leading to this.
^ permalink raw reply [flat|nested] 5+ messages in thread* RE: [ PATCH ] mptsas: Fix oops for insmod during kexec
2007-03-09 21:22 ` Christoph Hellwig
@ 2007-03-09 22:22 ` Moore, Eric
2007-03-10 9:26 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Moore, Eric @ 2007-03-09 22:22 UTC (permalink / raw)
To: Christoph Hellwig, Judith Lebzelter; +Cc: linux-scsi, James.Bottomley
On Friday, March 09, 2007 2:23 PM, Christoph Hellwig wrote:
> This needs a much better explanation. Please show the codepath
> leading to this.
>
>
I was working with Judith on this patch earlier this week, so this is
approved by LSI,,, ACK.
This fix's 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. So where I'm getting to, is mptsas_ioc_reset is
getting called before scsi_host_alloc is called, and the pointer ioc->sh
is NULL.,,, as well as the hostdata.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ PATCH ] mptsas: Fix oops for insmod during kexec
2007-03-09 22:22 ` Moore, Eric
@ 2007-03-10 9:26 ` Christoph Hellwig
2007-03-12 22:14 ` [ PATCH ] mptsas: Fix oops during driver load time(rev 2) Judith Lebzelter
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2007-03-10 9:26 UTC (permalink / raw)
To: Moore, Eric
Cc: Christoph Hellwig, Judith Lebzelter, linux-scsi, James.Bottomley
On Fri, Mar 09, 2007 at 03:22:13PM -0700, Moore, Eric wrote:
> On Friday, March 09, 2007 2:23 PM, Christoph Hellwig wrote:
>
>
> > This needs a much better explanation. Please show the codepath
> > leading to this.
> >
> >
>
> I was working with Judith on this patch earlier this week, so this is
> approved by LSI,,, ACK.
>
> This fix's 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. So where I'm getting to, is mptsas_ioc_reset is
> getting called before scsi_host_alloc is called, and the pointer ioc->sh
> is NULL.,,, as well as the hostdata.
Ok. Please put a reformulated version of the above statement as a comment
above the checks, so that people don't rip it out again.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ PATCH ] mptsas: Fix oops during driver load time(rev 2)
2007-03-10 9:26 ` Christoph Hellwig
@ 2007-03-12 22:14 ` Judith Lebzelter
0 siblings, 0 replies; 5+ messages in thread
From: Judith Lebzelter @ 2007-03-12 22:14 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi, Eric.Moore, James.Bottomley
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))
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-03-12 22:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [ PATCH ] mptsas: Fix oops during driver load time(rev 2) Judith Lebzelter
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.