Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101329
b: refs/heads/master
c: d8af0eb
h: refs/heads/master
i:
  101327: ee9fb78
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jul 14, 2008
1 parent 0b0da63 commit f8db9aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a2c0f56159999e20015241d3b8fa89b1ab14309
refs/heads/master: d8af0eb6046c56e7238171ca420622541db24926
8 changes: 5 additions & 3 deletions trunk/drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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))
Expand Down

0 comments on commit f8db9aa

Please sign in to comment.