All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org
Cc: David.Carroll@microsemi.com, Gana.Sridaran@microsemi.com,
	Scott.Benesh@microsemi.com, Prasad.Munirathnam@microsemi.com,
	RaghavaAditya.Renukunta@microsemi.com
Subject: [PATCH 16/19] aacraid: Enable ctrl reset for both hba and arc
Date: Sun, 7 May 2017 04:27:01 -0700	[thread overview]
Message-ID: <20170507112704.21940-17-RaghavaAditya.Renukunta@microsemi.com> (raw)
In-Reply-To: <20170507112704.21940-1-RaghavaAditya.Renukunta@microsemi.com>

Make sure that IOP and SOFT reset are enabled for both for both
arc and hba1000 controllers.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
---
 drivers/scsi/aacraid/linit.c | 77 +++++++++++++++++++++++---------------------
 1 file changed, 40 insertions(+), 37 deletions(-)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 3dea438..d933d2f 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -828,6 +828,11 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
 	u32 bus, cid;
 	int ret = FAILED;
 	int status = 0;
+	__le32 supported_options2 = 0;
+	bool is_mu_reset;
+	bool is_ignore_reset;
+	bool is_doorbell_reset;
+
 
 	bus = aac_logical_to_phys(scmd_channel(cmd));
 	cid = scmd_id(cmd);
@@ -900,9 +905,9 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
 			msleep(1000);
 		}
 
-		if (ret != SUCCESS)
-			pr_err("%s: Host adapter reset request timed out\n",
-			AAC_DRIVERNAME);
+		if (ret == SUCCESS)
+			goto out;
+
 	} else {
 
 		/* Mark the assoc. FIB to not complete, eh handler does this */
@@ -918,44 +923,42 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
 				cmd->SCp.phase = AAC_OWNER_ERROR_HANDLER;
 			}
 		}
+	}
 
-		pr_err("%s: Host adapter reset request. SCSI hang ?\n",
-					AAC_DRIVERNAME);
+	pr_err("%s: Host adapter reset request. SCSI hang ?\n", AAC_DRIVERNAME);
+
+	/*
+	 * Check the health of the controller
+	 */
+	status = aac_adapter_check_health(aac);
+	if (status)
+		dev_err(&aac->pdev->dev, "Adapter health - %d\n", status);
+
+	count = get_num_of_incomplete_fibs(aac);
+	if (count == 0)
+		return SUCCESS;
 
-		/*
-		 * Check the health of the controller
-		 */
-		status = aac_adapter_check_health(aac);
-		if (status)
-			dev_err(&aac->pdev->dev, "Adapter health - %d\n",
-									status);
-
-		count = get_num_of_incomplete_fibs(aac);
-		if (count == 0)
-			return SUCCESS;
-
-		/*
-		 * This adapter needs a blind reset, only do so for
-		 * Adapters that support a register, instead of a commanded,
-		 * reset.
-		 */
-		if (((aac->supplement_adapter_info.supported_options2 &
-			  AAC_OPTION_MU_RESET) ||
-			  (aac->supplement_adapter_info.supported_options2 &
-			  AAC_OPTION_DOORBELL_RESET)) &&
-			  aac_check_reset &&
-			  ((aac_check_reset != 1) ||
-			   !(aac->supplement_adapter_info.supported_options2 &
-			    AAC_OPTION_IGNORE_RESET))) {
-			/* Bypass wait for command quiesce */
-			aac_reset_adapter(aac, 2, IOP_HWSOFT_RESET);
-		}
-		ret = SUCCESS;
-	}
 	/*
-	 * Cause an immediate retry of the command with a ten second delay
-	 * after successful tur
+	 * Check if reset is supported by the firmware
 	 */
+	supported_options2 = aac->supplement_adapter_info.supported_options2;
+	is_mu_reset = supported_options2 & AAC_OPTION_MU_RESET;
+	is_doorbell_reset = supported_options2 & AAC_OPTION_DOORBELL_RESET;
+	is_ignore_reset = supported_options2 & AAC_OPTION_IGNORE_RESET;
+	/*
+	 * This adapter needs a blind reset, only do so for
+	 * Adapters that support a register, instead of a commanded,
+	 * reset.
+	 */
+	if ((is_mu_reset || is_doorbell_reset)
+	 && aac_check_reset
+	 && (aac_check_reset != -1 || !is_ignore_reset)) {
+		/* Bypass wait for command quiesce */
+		aac_reset_adapter(aac, 2, IOP_HWSOFT_RESET);
+	}
+	ret = SUCCESS;
+
+out:
 	return ret;
 }
 
-- 
2.7.4

  parent reply	other threads:[~2017-05-07 21:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 11:26 [PATCH 00/19] aacraid: Patchset with reset rework and misc fixes Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 01/19] aacraid: Remove GFP_DMA for raw srb memory Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 02/19] aacraid: Fix DMAR issues with iommu=pt Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 03/19] aacraid: Added 32 and 64 queue depth for arc natives Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 04/19] aacraid: Set correct Queue Depth for HBA1000 RAW disks Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 05/19] aacraid: Remove reset support from check_health Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 06/19] aacraid: Change wait time for fib completion Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 07/19] aacraid: Log count info of scsi cmds before reset Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 08/19] aacraid: Print ctrl status before eh reset Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 09/19] aacraid: Using single reset mask for IOP reset Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 10/19] aacraid: Rework " Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 11/19] aacraid: Add periodic checks to see IOP reset status Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 12/19] aacraid: Rework SOFT reset code Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 13/19] aacraid: Rework aac_src_restart Raghava Aditya Renukunta
2017-05-07 11:26 ` [PATCH 14/19] aacraid: Use correct function to get ctrl health Raghava Aditya Renukunta
2017-05-07 11:27 ` [PATCH 15/19] aacraid: Make sure ioctl returns on controller reset Raghava Aditya Renukunta
2017-05-07 11:27 ` Raghava Aditya Renukunta [this message]
2017-05-07 11:27 ` [PATCH 17/19] aacraid : Add reset debugging statements Raghava Aditya Renukunta
2017-05-07 11:27 ` [PATCH 18/19] aacraid: Remove reference to Series-9 Raghava Aditya Renukunta
2017-05-07 11:27 ` [PATCH 19/19] aacraid: Update driver version to 50834 Raghava Aditya Renukunta
  -- strict thread matches above, loose matches on Subject: below --
2017-05-07 13:34 [PATCH 00/19] aacraid: Patchset with reset rework and misc fixes Raghava Aditya Renukunta
2017-05-07 13:34 ` [PATCH 16/19] aacraid: Enable ctrl reset for both hba and arc Raghava Aditya Renukunta

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=20170507112704.21940-17-RaghavaAditya.Renukunta@microsemi.com \
    --to=raghavaaditya.renukunta@microsemi.com \
    --cc=David.Carroll@microsemi.com \
    --cc=Gana.Sridaran@microsemi.com \
    --cc=Prasad.Munirathnam@microsemi.com \
    --cc=Scott.Benesh@microsemi.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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.