Commit ca6d43b051b5a061b33c43303b6b4c93b46a34b5

Authored by Dan Williams
Committed by James Bottomley
1 parent d9875690d9

[SCSI] libata: reset once

Hotplug testing with libsas currently encounters a 55 second wait for
link recovery to give up.  In the case where the user trusts the
response time of their devices permit the recovery attempts to be
limited to one.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

Showing 4 changed files with 7 additions and 0 deletions Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -1350,6 +1350,9 @@
1350 1350 * nohrst, nosrst, norst: suppress hard, soft
1351 1351 and both resets.
1352 1352  
  1353 + * rstonce: only attempt one reset during
  1354 + hot-unplug link recovery
  1355 +
1353 1356 * dump_id: dump IDENTIFY data.
1354 1357  
1355 1358 If there are multiple matching configurations changing
drivers/ata/libata-core.c
... ... @@ -6387,6 +6387,7 @@
6387 6387 { "nohrst", .lflags = ATA_LFLAG_NO_HRST },
6388 6388 { "nosrst", .lflags = ATA_LFLAG_NO_SRST },
6389 6389 { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
  6390 + { "rstonce", .lflags = ATA_LFLAG_RST_ONCE },
6390 6391 };
6391 6392 char *start = *cur, *p = *cur;
6392 6393 char *id, *val, *endp;
drivers/ata/libata-eh.c
... ... @@ -2623,6 +2623,8 @@
2623 2623 */
2624 2624 while (ata_eh_reset_timeouts[max_tries] != ULONG_MAX)
2625 2625 max_tries++;
  2626 + if (link->flags & ATA_LFLAG_RST_ONCE)
  2627 + max_tries = 1;
2626 2628 if (link->flags & ATA_LFLAG_NO_HRST)
2627 2629 hardreset = NULL;
2628 2630 if (link->flags & ATA_LFLAG_NO_SRST)
include/linux/libata.h
... ... @@ -184,6 +184,7 @@
184 184 ATA_LFLAG_DISABLED = (1 << 6), /* link is disabled */
185 185 ATA_LFLAG_SW_ACTIVITY = (1 << 7), /* keep activity stats */
186 186 ATA_LFLAG_NO_LPM = (1 << 8), /* disable LPM on this link */
  187 + ATA_LFLAG_RST_ONCE = (1 << 9), /* limit recovery to one reset */
187 188  
188 189 /* struct ata_port flags */
189 190 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */