aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
authorJudith Lebzelter <judith@linux-foundation.org>2007-03-09 16:07:44 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-03-11 11:44:16 -0400
commitba76ef246090601b783c1e6190e22b8b149a105f (patch)
tree9d9b6177cbe919a0400e804b972ea7db55e242e7 /drivers/message/fusion/mptsas.c
parent5daa49ef05c44ce94bed0bab0f9ba4a9e952863b (diff)
[SCSI] mptsas: Fix oops for insmod during kexec
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. Signed-off-by: Judith Lebzelter <judith@osdl.org> Acked-by: "Moore, Eric" <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 404c014db1bd..1d2d03f77894 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -815,7 +815,7 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
815static int 815static int
816mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) 816mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
817{ 817{
818 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)ioc->sh->hostdata; 818 MPT_SCSI_HOST *hd;
819 struct mptsas_target_reset_event *target_reset_list, *n; 819 struct mptsas_target_reset_event *target_reset_list, *n;
820 int rc; 820 int rc;
821 821
@@ -827,7 +827,10 @@ mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
827 if (reset_phase != MPT_IOC_POST_RESET) 827 if (reset_phase != MPT_IOC_POST_RESET)
828 goto out; 828 goto out;
829 829
830 if (!hd || !hd->ioc) 830 if (!ioc->sh || !ioc->sh->hostdata)
831 goto out;
832 hd = (MPT_SCSI_HOST *)ioc->sh->hostdata;
833 if (!hd->ioc)
831 goto out; 834 goto out;
832 835
833 if (list_empty(&hd->target_reset_list)) 836 if (list_empty(&hd->target_reset_list))