All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
To: linux-scsi@vger.kernel.org
Cc: martin.petersen@oracle.com, thenzl@redhat.com,
	jejb@linux.vnet.ibm.com, kashyap.desai@broadcom.com,
	sumit.saxena@broadcom.com, hare@suse.com,
	Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Subject: [PATCH v3 34/39] megaraid_sas: Use synchronize_irq to wait for IRQs to complete
Date: Fri, 10 Feb 2017 00:59:34 -0800	[thread overview]
Message-ID: <1486717179-23320-35-git-send-email-shivasharan.srikanteshwara@broadcom.com> (raw)
In-Reply-To: <1486717179-23320-1-git-send-email-shivasharan.srikanteshwara@broadcom.com>

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>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index bafaf03..d8bfb87 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)
 }
 
 /**
+ * megasas_sync_irqs -	Synchronizes all IRQs owned by adapter
+ * @instance:			Adapter soft state
+ */
+void megasas_sync_irqs(unsigned long instance_addr)
+{
+	u32 count, i;
+	struct megasas_instance *instance =
+		(struct megasas_instance *)instance_addr;
+
+	count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
+
+	for (i = 0; i < count; i++)
+		synchronize_irq(pci_irq_vector(instance->pdev, i));
+}
+
+/**
  * megasas_complete_cmd_dpc_fusion -	Completes command
  * @instance:			Adapter soft state
  *
@@ -3820,7 +3836,7 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle,
 			break;
 		else {
 			instance->instancet->disable_intr(instance);
-			msleep(1000);
+			megasas_sync_irqs((unsigned long)instance);
 			megasas_complete_cmd_dpc_fusion
 					((unsigned long)instance);
 			instance->instancet->enable_intr(instance);
@@ -4174,7 +4190,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason)
 	set_bit(MEGASAS_FUSION_IN_RESET, &instance->reset_flags);
 	atomic_set(&instance->adprecovery, MEGASAS_ADPRESET_SM_POLLING);
 	instance->instancet->disable_intr(instance);
-	msleep(1000);
+	megasas_sync_irqs((unsigned long)instance);
 
 	/* First try waiting for commands to complete */
 	if (megasas_wait_for_outstanding_fusion(instance, reason,
-- 
2.8.3

  parent reply	other threads:[~2017-02-10 10:09 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10  8:59 [PATCH v3 00/39] megaraid_sas: Updates for scsi-next Shivasharan S
2017-02-10  8:59 ` [PATCH v3 01/39] Revert "scsi: megaraid_sas: Enable or Disable Fast path based on the PCI Threshold Bandwidth" Shivasharan S
2017-02-10  8:59 ` [PATCH v3 02/39] megaraid_sas: cpu select rework Shivasharan S
2017-02-10  8:59 ` [PATCH v3 03/39] megaraid_sas: raid 1 fast path code optimize Shivasharan S
2017-02-10  8:59 ` [PATCH v3 04/39] megaraid_sas: 32 bit descriptor fire cmd optimization Shivasharan S
2017-02-10  8:59 ` [PATCH v3 05/39] megaraid_sas: Refactor MEGASAS_IS_LOGICAL macro using sdev Shivasharan S
2017-02-10  8:59 ` [PATCH v3 06/39] megaraid_sas: RAID map is accessed for SYS PDs when use_seqnum_jbod_fp is not set Shivasharan S
2017-02-10  8:59 ` [PATCH v3 07/39] megaraid_sas: Use DID_REQUEUE Shivasharan S
2017-02-10  8:59 ` [PATCH v3 08/39] megaraid_sas: megasas_get_request_descriptor always return valid desc Shivasharan S
2017-02-10  8:59 ` [PATCH v3 09/39] megaraid_sas: change issue_dcmd to return void from int Shivasharan S
2017-02-10  8:59 ` [PATCH v3 10/39] megaraid_sas: NVME Interface detection and prop settings Shivasharan S
2017-02-10  8:59 ` [PATCH v3 11/39] megaraid_sas: NVME interface target prop added Shivasharan S
2017-02-10  8:59 ` [PATCH v3 12/39] megaraid_sas: NVME fast path io support Shivasharan S
2017-02-10  8:59 ` [PATCH v3 13/39] megaraid_sas: raid 1 write performance for large io Shivasharan S
2017-02-10  8:59 ` [PATCH v3 14/39] megaraid_sas: set residual bytes count during IO completion Shivasharan S
2017-02-10  8:59 ` [PATCH v3 15/39] megaraid_sas: enhance debug logs in OCR context Shivasharan S
2017-02-10  8:59 ` [PATCH v3 16/39] megaraid_sas: add print in device removal path Shivasharan S
2017-02-10  8:59 ` [PATCH v3 17/39] megaraid_sas: reduce size of fusion_context and use vmalloc if kmalloc fails Shivasharan S
2017-02-10  8:59 ` [PATCH v3 18/39] megaraid_sas: In validate raid map, raid capability is not converted to cpu format for all lds Shivasharan S
2017-02-10  8:59 ` [PATCH v3 19/39] megaraid_sas: MR_TargetIdToLdGet u8 to u16 and avoid invalid raid-map access Shivasharan S
2017-02-10 11:34   ` Hannes Reinecke
2017-02-10 12:04     ` Shivasharan Srikanteshwara
2017-02-10 13:46   ` Tomas Henzl
2017-02-10  8:59 ` [PATCH v3 20/39] megaraid_sas: Big endian RDPQ mode fix Shivasharan S
2017-02-10  8:59 ` [PATCH v3 21/39] megaraid_sas: big endian support changes Shivasharan S
2017-02-10  8:59 ` [PATCH v3 22/39] megaraid_sas: avoid unaligned access in ioctl path Shivasharan S
2017-02-10  8:59 ` [PATCH v3 23/39] megaraid_sas: latest controller OCR capability from FW before sending shutdown DCMD Shivasharan S
2017-02-10  8:59 ` [PATCH v3 24/39] megaraid_sas: set pd_after_lb from MR_BuildRaidContext and initialize pDevHandle to MR_DEVHANDLE_INVALID Shivasharan S
2017-02-10  8:59 ` [PATCH v3 25/39] megaraid_sas: Change max_cmd from u32 to u16 in all functions Shivasharan S
2017-02-10  8:59 ` [PATCH v3 26/39] megaraid_sas: update can_queue only if the new value is less Shivasharan S
2017-02-10  8:59 ` [PATCH v3 27/39] megaraid_sas: max_fw_cmds are decremented twice, remove duplicate Shivasharan S
2017-02-10  8:59 ` [PATCH v3 28/39] megaraid_sas: megasas_return_cmd does not memset IO frame to zero Shivasharan S
2017-02-10  8:59 ` [PATCH v3 29/39] megaraid_sas: Remove unused pd_index from megasas_build_ld_nonrw_fusion Shivasharan S
2017-02-10  8:59 ` [PATCH v3 30/39] megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool Shivasharan S
2017-02-10  8:59 ` [PATCH v3 31/39] megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR Shivasharan S
2017-02-10  8:59 ` [PATCH v3 32/39] megaraid_sas: Change build_mpt_mfi_pass_thru to return void Shivasharan S
2017-02-10  8:59 ` [PATCH v3 33/39] megaraid_sas: Bail out the driver load if ld_list_query fails Shivasharan S
2017-02-10  8:59 ` Shivasharan S [this message]
2017-02-10  8:59 ` [PATCH v3 35/39] megaraid_sas: Increase internal command pool Shivasharan S
2017-02-10  8:59 ` [PATCH v3 36/39] megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints Shivasharan S
2017-02-10  8:59 ` [PATCH v3 37/39] megaraid_sas: Indentation and smatch warning fixes Shivasharan S
2017-02-10  8:59 ` [PATCH v3 38/39] megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2 Shivasharan S
2017-02-10  8:59 ` [PATCH v3 39/39] megaraid_sas: driver version upgrade Shivasharan S
2017-02-13 12:28 ` [PATCH v3 00/39] megaraid_sas: Updates for scsi-next Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486717179-23320-35-git-send-email-shivasharan.srikanteshwara@broadcom.com \
    --to=shivasharan.srikanteshwara@broadcom.com \
    --cc=hare@suse.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sumit.saxena@broadcom.com \
    --cc=thenzl@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.