aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_base.c
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2010-06-17 04:16:13 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:02:19 -0400
commitf3eedd698ebafd0fe8a292672604a2db61c2c00a (patch)
treeabe6d22775411a19953f23608bb1dc61a32bb57d /drivers/scsi/mpt2sas/mpt2sas_base.c
parent7fbae67a3faa90abcbe949f1494769c84e51e189 (diff)
[SCSI] mpt2sas: Redesign Raid devices event handling using pd_handles per HBA
Actual problem : Driver may receiving the top level expander removal event prior to all the individual PD removal events, hence the driver is breaking down all the PDs in advanced to the actaul PD UNHIDE event. Driver sends multiple Target Resets to the same volume handle for each individual PD removal. FIX DESCRIPTION: To fix this issue, the entire PD device handshake protocal has to be moved to interrupt context so the breakdown occurs immediately after the actual UNHIDE event arrives. The driver will only issue one Target Reset to the volume handle, occurring after the FAILED or MISSING volume status event arrives from interrupt context. For the PD UNHIDE event, the driver will issue target resets to the PD handles, followed by OP_REMOVE. The driver will set the "deteleted" flag during interrupt context. A "pd_handle" bitmask was introduced so the driver has a list of known pds during entire life of the PD; this replaces the "hidden_raid_component" flag handle in the sas_device object. Each bit in the bitmask represents a device handle. The bit in the bitmask would be toggled ON/OFF when the HIDE/UNHIDE events arrive; also this pd_handle bitmask would bould be refreshed across host resets. Here we kept older behavior of sending target reset to volume when there is a single drive pull, wait for the reply, then send target resets to the PDs. We kept this behavior so the driver will behave the same for older versions of firmware. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 3774b0742b2b..bb8acf781690 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -3468,6 +3468,12 @@ _base_make_ioc_operational(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
3468 kfree(delayed_tr); 3468 kfree(delayed_tr);
3469 } 3469 }
3470 3470
3471 list_for_each_entry_safe(delayed_tr, delayed_tr_next,
3472 &ioc->delayed_tr_volume_list, list) {
3473 list_del(&delayed_tr->list);
3474 kfree(delayed_tr);
3475 }
3476
3471 /* initialize the scsi lookup free list */ 3477 /* initialize the scsi lookup free list */
3472 spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); 3478 spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
3473 INIT_LIST_HEAD(&ioc->free_list); 3479 INIT_LIST_HEAD(&ioc->free_list);
@@ -3622,6 +3628,15 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
3622 3628
3623 init_waitqueue_head(&ioc->reset_wq); 3629 init_waitqueue_head(&ioc->reset_wq);
3624 3630
3631 /* allocate memory pd handle bitmask list */
3632 ioc->pd_handles_sz = (ioc->facts.MaxDevHandle / 8);
3633 if (ioc->facts.MaxDevHandle % 8)
3634 ioc->pd_handles_sz++;
3635 ioc->pd_handles = kzalloc(ioc->pd_handles_sz,
3636 GFP_KERNEL);
3637 if (!ioc->pd_handles)
3638 goto out_free_resources;
3639
3625 ioc->fwfault_debug = mpt2sas_fwfault_debug; 3640 ioc->fwfault_debug = mpt2sas_fwfault_debug;
3626 3641
3627 /* base internal command bits */ 3642 /* base internal command bits */
@@ -3691,6 +3706,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
3691 mpt2sas_base_free_resources(ioc); 3706 mpt2sas_base_free_resources(ioc);
3692 _base_release_memory_pools(ioc); 3707 _base_release_memory_pools(ioc);
3693 pci_set_drvdata(ioc->pdev, NULL); 3708 pci_set_drvdata(ioc->pdev, NULL);
3709 kfree(ioc->pd_handles);
3694 kfree(ioc->tm_cmds.reply); 3710 kfree(ioc->tm_cmds.reply);
3695 kfree(ioc->transport_cmds.reply); 3711 kfree(ioc->transport_cmds.reply);
3696 kfree(ioc->scsih_cmds.reply); 3712 kfree(ioc->scsih_cmds.reply);
@@ -3726,6 +3742,7 @@ mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc)
3726 mpt2sas_base_free_resources(ioc); 3742 mpt2sas_base_free_resources(ioc);
3727 _base_release_memory_pools(ioc); 3743 _base_release_memory_pools(ioc);
3728 pci_set_drvdata(ioc->pdev, NULL); 3744 pci_set_drvdata(ioc->pdev, NULL);
3745 kfree(ioc->pd_handles);
3729 kfree(ioc->pfacts); 3746 kfree(ioc->pfacts);
3730 kfree(ioc->ctl_cmds.reply); 3747 kfree(ioc->ctl_cmds.reply);
3731 kfree(ioc->base_cmds.reply); 3748 kfree(ioc->base_cmds.reply);