Skip to content

Commit

Permalink
[SCSI] mptsas: Fix oops for insmod during kexec
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Judith Lebzelter authored and James Bottomley committed Mar 11, 2007
1 parent 5daa49e commit ba76ef2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
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;

Expand All @@ -827,7 +827,10 @@ mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
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))
Expand Down

0 comments on commit ba76ef2

Please sign in to comment.