From e8206381f5842269691f3164ec0d79b7059bd710 Mon Sep 17 00:00:00 2001 From: Eric Moore Date: Sat, 29 Sep 2007 10:16:53 -0600 Subject: [SCSI] mpt fusion: lock down ScsiLookup ScsiLookup is an array of pending scmd pointers that the scsi lld maintains. This array is touched from queuecommand, eh threads, and interrupt context. This array should put under locks, hence this patch to synchronize its access. I've added some nice little function wrappers for this, and moved the ScsiLookup array over to MPT_ADAPTER struct. Signed-off-by: Eric Moore Signed-off-by: James Bottomley --- drivers/message/fusion/mptsas.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/message/fusion/mptsas.c') diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 4c641c6f98a6..ba4f5e7fcbc7 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -3221,15 +3221,16 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) /* SCSI needs scsi_cmnd lookup table! * (with size equal to req_depth*PtrSz!) */ - hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); - if (!hd->ScsiLookup) { + ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); + if (!ioc->ScsiLookup) { error = -ENOMEM; spin_unlock_irqrestore(&ioc->FreeQlock, flags); goto out_mptsas_probe; } + spin_lock_init(&ioc->scsi_lookup_lock); dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ScsiLookup @ %p\n", - ioc->name, hd->ScsiLookup)); + ioc->name, ioc->ScsiLookup)); /* Clear the TM flags */ -- cgit v1.2.2