aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>2017-02-10 03:59:34 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2017-02-13 07:26:23 -0500
commit29206da1490a7065e8a03ec43f6de60c5c978cae (patch)
tree33aef0c148a07069adb906c5e424f6193672df56
parent72bff2d1d0c9cb8923a2ffdeaafa40deaed0f671 (diff)
scsi: megaraid_sas: Use synchronize_irq to wait for IRQs to complete
FIX - Do not use random delay to synchronize with IRQ. Use kernel API. Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index bafaf0376d51..d8bfb87f456c 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3145,6 +3145,22 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex)
3145} 3145}
3146 3146
3147/** 3147/**
3148 * megasas_sync_irqs - Synchronizes all IRQs owned by adapter
3149 * @instance: Adapter soft state
3150 */
3151void megasas_sync_irqs(unsigned long instance_addr)
3152{
3153 u32 count, i;
3154 struct megasas_instance *instance =
3155 (struct megasas_instance *)instance_addr;
3156
3157 count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
3158
3159 for (i = 0; i < count; i++)
3160 synchronize_irq(pci_irq_vector(instance->pdev, i));
3161}
3162
3163/**
3148 * megasas_complete_cmd_dpc_fusion - Completes command 3164 * megasas_complete_cmd_dpc_fusion - Completes command
3149 * @instance: Adapter soft state 3165 * @instance: Adapter soft state
3150 * 3166 *
@@ -3820,7 +3836,7 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle,
3820 break; 3836 break;
3821 else { 3837 else {
3822 instance->instancet->disable_intr(instance); 3838 instance->instancet->disable_intr(instance);
3823 msleep(1000); 3839 megasas_sync_irqs((unsigned long)instance);
3824 megasas_complete_cmd_dpc_fusion 3840 megasas_complete_cmd_dpc_fusion
3825 ((unsigned long)instance); 3841 ((unsigned long)instance);
3826 instance->instancet->enable_intr(instance); 3842 instance->instancet->enable_intr(instance);
@@ -4174,7 +4190,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
4174 set_bit(MEGASAS_FUSION_IN_RESET, &instance->reset_flags); 4190 set_bit(MEGASAS_FUSION_IN_RESET, &instance->reset_flags);
4175 atomic_set(&instance->adprecovery, MEGASAS_ADPRESET_SM_POLLING); 4191 atomic_set(&instance->adprecovery, MEGASAS_ADPRESET_SM_POLLING);
4176 instance->instancet->disable_intr(instance); 4192 instance->instancet->disable_intr(instance);
4177 msleep(1000); 4193 megasas_sync_irqs((unsigned long)instance);
4178 4194
4179 /* First try waiting for commands to complete */ 4195 /* First try waiting for commands to complete */
4180 if (megasas_wait_for_outstanding_fusion(instance, reason, 4196 if (megasas_wait_for_outstanding_fusion(instance, reason,