linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] mpt fusion: Fix for module load error when mptctl and mptsas are loaded in parallel
@ 2008-01-11  9:16 Prakash, Sathya
  2008-01-11 18:26 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: Prakash, Sathya @ 2008-01-11  9:16 UTC (permalink / raw)
  To: linux-scsi; +Cc: eric.moore

This patch fixes a panic at mptctl_probe -> mutex_init if the mptsas and mptcl module are loaded in parallel, this is because IOC is NULL, the fix is in mpt_device_register to call probe only with non-zero IOC pointer.

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
---

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index d733438..042bc86 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -729,6 +729,8 @@ mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, u8 cb_idx)
 
 	/* call per pci device probe entry point */
 	list_for_each_entry(ioc, &ioc_list, list) {
+		if (!pci_get_drvdata(ioc->pcidev))
+			continue;
 		id = ioc->pcidev->driver ?
 		    ioc->pcidev->driver->id_table : NULL;
 		if (dd_cbfunc->probe)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] mpt fusion: Fix for module load error when mptctl and mptsas are loaded in parallel
  2008-01-11  9:16 [PATCH 3/3] mpt fusion: Fix for module load error when mptctl and mptsas are loaded in parallel Prakash, Sathya
@ 2008-01-11 18:26 ` James Bottomley
  0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2008-01-11 18:26 UTC (permalink / raw)
  To: Prakash, Sathya; +Cc: linux-scsi, eric.moore


On Fri, 2008-01-11 at 14:46 +0530, Prakash, Sathya wrote:
> This patch fixes a panic at mptctl_probe -> mutex_init if the mptsas and mptcl module are loaded in parallel, this is because IOC is NULL, the fix is in mpt_device_register to call probe only with non-zero IOC pointer.
> 
> signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
> ---
> 
> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
> index d733438..042bc86 100644
> --- a/drivers/message/fusion/mptbase.c
> +++ b/drivers/message/fusion/mptbase.c
> @@ -729,6 +729,8 @@ mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, u8 cb_idx)
>  
>  	/* call per pci device probe entry point */
>  	list_for_each_entry(ioc, &ioc_list, list) {
> +		if (!pci_get_drvdata(ioc->pcidev))
> +			continue;

This looks rather dubious ... it doesn't fix the race, it just manifests
differently (and non fatally) by apparently not attaching the mptctl.

Isn't a better fix to set the drvdata earlier in the process, say in
mpt_attach *before* you add the ioc to the ioc_list?  That way the race
can never occur in the first place.

James



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-11 18:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-11  9:16 [PATCH 3/3] mpt fusion: Fix for module load error when mptctl and mptsas are loaded in parallel Prakash, Sathya
2008-01-11 18:26 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).