[SCSI] libata: reset once
authorDan Williams <dan.j.williams@intel.com>
Fri, 22 Jun 2012 06:41:41 +0000 (23:41 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 24 Aug 2012 09:04:08 +0000 (13:04 +0400)
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>
Documentation/kernel-parameters.txt
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
include/linux/libata.h

index ad7e2e5088c126ce48e0362d1f3296f3e8b55d2b..2cb2d81a51abe2fdc6114005a07b37398f02f9bd 100644 (file)
@@ -1350,6 +1350,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
                        * nohrst, nosrst, norst: suppress hard, soft
                           and both resets.
 
+                       * rstonce: only attempt one reset during
+                         hot-unplug link recovery
+
                        * dump_id: dump IDENTIFY data.
 
                        If there are multiple matching configurations changing
index fadd5866d40fd29b2eb70df29e3d026e2e3722db..70964aabcb8938027c02b9b12f0f6cf8d1698a3b 100644 (file)
@@ -6387,6 +6387,7 @@ static int __init ata_parse_force_one(char **cur,
                { "nohrst",     .lflags         = ATA_LFLAG_NO_HRST },
                { "nosrst",     .lflags         = ATA_LFLAG_NO_SRST },
                { "norst",      .lflags         = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
+               { "rstonce",    .lflags         = ATA_LFLAG_RST_ONCE },
        };
        char *start = *cur, *p = *cur;
        char *id, *val, *endp;
index 7d4535e989bf5580d76909c2402460898ff86062..100428dde4219527f6f61b45781a46da93f9eedc 100644 (file)
@@ -2623,6 +2623,8 @@ int ata_eh_reset(struct ata_link *link, int classify,
         */
        while (ata_eh_reset_timeouts[max_tries] != ULONG_MAX)
                max_tries++;
+       if (link->flags & ATA_LFLAG_RST_ONCE)
+               max_tries = 1;
        if (link->flags & ATA_LFLAG_NO_HRST)
                hardreset = NULL;
        if (link->flags & ATA_LFLAG_NO_SRST)
index 64f90e17e51d5a87f3aa997e664c132542ad8029..31a2853e953099f8ae440cc189421d6c8423a96d 100644 (file)
@@ -184,6 +184,7 @@ enum {
        ATA_LFLAG_DISABLED      = (1 << 6), /* link is disabled */
        ATA_LFLAG_SW_ACTIVITY   = (1 << 7), /* keep activity stats */
        ATA_LFLAG_NO_LPM        = (1 << 8), /* disable LPM on this link */
+       ATA_LFLAG_RST_ONCE      = (1 << 9), /* limit recovery to one reset */
 
        /* struct ata_port flags */
        ATA_FLAG_SLAVE_POSS     = (1 << 0), /* host supports slave dev */