From: Tejun Heo <htejun@gmail.com>
To: jeff@garzik.org, linux-ide@vger.kernel.org
Cc: liml@rtr.ca, Tejun Heo <htejun@gmail.com>
Subject: [PATCH 4/5] libata: use ULONG_MAX to terminate reset timeout table
Date: Tue, 20 May 2008 02:17:53 +0900 [thread overview]
Message-ID: <12112174752587-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <12112174741373-git-send-email-htejun@gmail.com>
This doesn't introduce any functional changes. This is to make reset
timeout table consistent with to-be-added command timeout tables.
Signed-off-by: Tejun Heo <htejun@gmail.com>
---
drivers/ata/libata-eh.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 5b5ae63..83d1451 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -90,7 +90,7 @@ static const unsigned long ata_eh_reset_timeouts[] = {
10000, /* > 99% working drives spin up before 20sec */
35000, /* give > 30 secs of idleness for retarded devices */
5000, /* and sweet one last chance */
- /* > 1 min has elapsed, give up */
+ ULONG_MAX, /* > 1 min has elapsed, give up */
};
static void __ata_port_freeze(struct ata_port *ap);
@@ -2077,13 +2077,12 @@ int ata_eh_reset(struct ata_link *link, int classify,
ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
ata_reset_fn_t hardreset, ata_postreset_fn_t postreset)
{
- const int max_tries = ARRAY_SIZE(ata_eh_reset_timeouts);
struct ata_port *ap = link->ap;
struct ata_eh_context *ehc = &link->eh_context;
unsigned int *classes = ehc->classes;
unsigned int lflags = link->flags;
int verbose = !(ehc->i.flags & ATA_EHI_QUIET);
- int try = 0;
+ int max_tries = 0, try = 0;
struct ata_device *dev;
unsigned long deadline, now;
ata_reset_fn_t reset;
@@ -2094,6 +2093,9 @@ int ata_eh_reset(struct ata_link *link, int classify,
/*
* Prepare to reset
*/
+ while (ata_eh_reset_timeouts[max_tries] != ULONG_MAX)
+ max_tries++;
+
now = jiffies;
deadline = ata_deadline(ehc->last_reset, ATA_EH_RESET_COOL_DOWN);
if (time_before(now, deadline))
--
1.5.2.4
next prev parent reply other threads:[~2008-05-19 17:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-19 17:17 [PATCHSET #upstream] libata: improve timeout handling for EH commands Tejun Heo
2008-05-19 17:17 ` [PATCH 1/5] libata: kill unused constants Tejun Heo
2008-06-04 10:29 ` Jeff Garzik
2008-05-19 17:17 ` [PATCH 2/5] libata: consistently use msecs for time durations Tejun Heo
2008-05-19 22:35 ` Elias Oltmanns
2008-05-20 4:03 ` Tejun Heo
2008-06-13 6:55 ` Jeff Garzik
2008-05-19 17:17 ` [PATCH 3/5] libata: improve EH retry delay handling Tejun Heo
2008-05-19 18:33 ` Alan Cox
2008-05-20 4:02 ` Tejun Heo
2008-05-19 17:17 ` Tejun Heo [this message]
2008-05-19 17:17 ` [PATCH 5/5] libata: improve EH internal command timeout handling Tejun Heo
2008-05-19 18:35 ` Alan Cox
2008-05-19 18:51 ` Jeff Garzik
2008-05-20 4:05 ` Tejun Heo
2008-05-29 1:59 ` [PATCHSET #upstream] libata: improve timeout handling for EH commands Tejun Heo
2008-06-03 18:06 ` Jeff Garzik
2008-06-04 5:02 ` Tejun Heo
2008-11-10 16:32 ` saeed bishara
2008-11-11 2:27 ` Tejun Heo
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=12112174752587-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=jeff@garzik.org \
--cc=liml@rtr.ca \
--cc=linux-ide@vger.kernel.org \
/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).