diff options
author | Prakash, Sathya <sathya.prakash@lsi.com> | 2008-02-08 06:05:40 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-02-11 11:20:53 -0500 |
commit | 07df8afa0dd54b8b89ad8aa93994c0d55a4a5921 (patch) | |
tree | a6542ea7c87147d21d8e65cacd8d7feb6e2a6941 /drivers | |
parent | 90a95af85f22c82f87e5fb714bac7ee06673b0ff (diff) |
[SCSI] mpt fusion: Avoid racing when mptsas and mptcl module are loaded in parallel
This patch sets the IOC pointer in drvrdata of pcidev before adding
the IOC into the list of IOCs. Without this patch the driver oops when
the mptsas and mptctl modules are loaded in parallel.
Signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 425f60c21fdd..d381c38ccbaf 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1658,6 +1658,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1658 | ioc->active = 0; | 1658 | ioc->active = 0; |
1659 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); | 1659 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); |
1660 | 1660 | ||
1661 | /* Set IOC ptr in the pcidev's driver data. */ | ||
1662 | pci_set_drvdata(ioc->pcidev, ioc); | ||
1663 | |||
1661 | /* Set lookup ptr. */ | 1664 | /* Set lookup ptr. */ |
1662 | list_add_tail(&ioc->list, &ioc_list); | 1665 | list_add_tail(&ioc->list, &ioc_list); |
1663 | 1666 | ||
@@ -1999,7 +2002,6 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1999 | irq_allocated = 1; | 2002 | irq_allocated = 1; |
2000 | ioc->pci_irq = ioc->pcidev->irq; | 2003 | ioc->pci_irq = ioc->pcidev->irq; |
2001 | pci_set_master(ioc->pcidev); /* ?? */ | 2004 | pci_set_master(ioc->pcidev); /* ?? */ |
2002 | pci_set_drvdata(ioc->pcidev, ioc); | ||
2003 | dprintk(ioc, printk(MYIOC_s_INFO_FMT "installed at interrupt " | 2005 | dprintk(ioc, printk(MYIOC_s_INFO_FMT "installed at interrupt " |
2004 | "%d\n", ioc->name, ioc->pcidev->irq)); | 2006 | "%d\n", ioc->name, ioc->pcidev->irq)); |
2005 | } | 2007 | } |