From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@HansenPartnership.com, dab@hp.com,
mikem@beardog.cce.hp.com
Subject: [PATCH 17/24] hpsa: factor out hpsa_wait_for_mode_change_ack
Date: Thu, 27 May 2010 15:14:08 -0500 [thread overview]
Message-ID: <20100527201408.3116.98563.stgit@beardog.cce.hp.com> (raw)
In-Reply-To: <20100527200301.3116.78973.stgit@beardog.cce.hp.com>
From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
hpsa: factor out hpsa_wait_for_mode_change_ack
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
drivers/scsi/hpsa.c | 40 +++++++++++++++++-----------------------
1 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index a43f3cb..052f0a4 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3418,19 +3418,9 @@ static inline void hpsa_p600_dma_prefetch_quirk(struct ctlr_info *h)
writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG);
}
-static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h)
+static void __devinit hpsa_wait_for_mode_change_ack(struct ctlr_info *h)
{
int i;
- u32 trans_support;
-
- trans_support = readl(&(h->cfgtable->TransportSupport));
- if (!(trans_support & SIMPLE_MODE))
- return -ENOTSUPP;
-
- h->max_commands = readl(&(h->cfgtable->CmdsOutMax));
- /* Update the field, and then ring the doorbell */
- writel(CFGTBL_Trans_Simple, &(h->cfgtable->HostWrite.TransportRequest));
- writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL);
/* under certain very rare conditions, this can take awhile.
* (e.g.: hot replace a failed 144GB drive in a RAID 5 set right
@@ -3442,6 +3432,21 @@ static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h)
/* delay and try again */
msleep(10);
}
+}
+
+static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h)
+{
+ u32 trans_support;
+
+ trans_support = readl(&(h->cfgtable->TransportSupport));
+ if (!(trans_support & SIMPLE_MODE))
+ return -ENOTSUPP;
+
+ h->max_commands = readl(&(h->cfgtable->CmdsOutMax));
+ /* Update the field, and then ring the doorbell */
+ writel(CFGTBL_Trans_Simple, &(h->cfgtable->HostWrite.TransportRequest));
+ writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL);
+ hpsa_wait_for_mode_change_ack(h);
print_cfg_table(&h->pdev->dev, h->cfgtable);
if (!(readl(&(h->cfgtable->TransportActive)) & CFGTBL_Trans_Simple)) {
dev_warn(&h->pdev->dev,
@@ -3822,7 +3827,6 @@ static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
*/
int bft[8] = {5, 6, 8, 10, 12, 20, 28, 35}; /* for scatter/gathers */
int i = 0;
- int l = 0;
unsigned long register_value;
trans_support = readl(&(h->cfgtable->TransportSupport));
@@ -3866,17 +3870,7 @@ static __devinit void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
writel(CFGTBL_Trans_Performant,
&(h->cfgtable->HostWrite.TransportRequest));
writel(CFGTBL_ChangeReq, h->vaddr + SA5_DOORBELL);
- /* under certain very rare conditions, this can take awhile.
- * (e.g.: hot replace a failed 144GB drive in a RAID 5 set right
- * as we enter this code.) */
- for (l = 0; l < MAX_CONFIG_WAIT; l++) {
- register_value = readl(h->vaddr + SA5_DOORBELL);
- if (!(register_value & CFGTBL_ChangeReq))
- break;
- /* delay and try again */
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(10);
- }
+ hpsa_wait_for_mode_change_ack(h);
register_value = readl(&(h->cfgtable->TransportActive));
if (!(register_value & CFGTBL_Trans_Performant)) {
dev_warn(&h->pdev->dev, "unable to get board into"
next prev parent reply other threads:[~2010-05-27 20:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 20:12 [PATCH 00/24] hpsa updates for May 2010 Stephen M. Cameron
2010-05-27 20:12 ` [PATCH 01/24] hpsa: save pdev pointer in per hba structure early to avoid passing it around so much Stephen M. Cameron
2010-05-27 20:12 ` [PATCH 02/24] hpsa: factor out hpsa_lookup_board_id Stephen M. Cameron
2010-05-27 20:12 ` [PATCH 03/24] hpsa: factor out hpsa_board_disabled Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 04/24] hpsa: remove redundant board_id parameter from hpsa_interrupt_mode Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 05/24] hpsa: factor out hpsa_find_memory_BAR Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 06/24] hpsa: factor out hpsa_wait_for_board_ready Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 07/24] hpsa: factor out hpsa_find_cfgtables Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 08/24] hpsa: fix leak of ioremapped memory Stephen M. Cameron
2010-05-28 19:12 ` Rolf Eike Beer
2010-06-01 12:55 ` scameron
2010-05-27 20:13 ` [PATCH 09/24] hpsa: hpsa factor out hpsa_find_board_params Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 10/24] hpsa: factor out hpsa-CISS-signature-present Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 11/24] hpsa: factor out hpsa_enable_scsi_prefetch Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 12/24] hpsa: factor out hpsa_p600_dma_prefetch_quirk Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 13/24] hpsa: factor out hpsa_enter_simple_mode Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 14/24] hpsa: check that simple mode is supported Stephen M. Cameron
2010-05-27 20:13 ` [PATCH 15/24] hpsa: clean up debug ifdefs Stephen M. Cameron
2010-05-27 20:14 ` [PATCH 16/24] hpsa: mark hpsa_mark_hpsa_put_ctlr_into_performant_mode as __devinit Stephen M. Cameron
2010-05-27 20:14 ` Stephen M. Cameron [this message]
2010-05-27 20:14 ` [PATCH 18/24] hpsa: remove unused variable trans_offset Stephen M. Cameron
2010-05-27 20:14 ` [PATCH 19/24] hpsa: factor out hpsa_enter_performant_mode Stephen M. Cameron
2010-05-27 20:14 ` [PATCH 20/24] hpsa: remove unused firm_ver member of the per-hba structure Stephen M. Cameron
2010-05-27 20:14 ` [PATCH 21/24] hpsa: Add hpsa.txt to Documentation/scsi Stephen M. Cameron
2010-05-27 20:14 ` [PATCH 22/24] hpsa: expose controller firmware revision via /sys Stephen M. Cameron
2010-05-27 20:14 ` [PATCH 23/24] hpsa: fix block fetch table problem Stephen M. Cameron
2010-05-27 20:14 ` [PATCH 24/24] hpsa: add entry to MAINTAINERS Stephen M. Cameron
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=20100527201408.3116.98563.stgit@beardog.cce.hp.com \
--to=scameron@beardog.cce.hp.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=dab@hp.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mikem@beardog.cce.hp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).