libata: disable a disk via libata.force params
authorRobin H. Johnson <robbat2@gentoo.org>
Mon, 16 Dec 2013 17:31:19 +0000 (09:31 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 15 Feb 2014 19:20:13 +0000 (19:20 +0000)
commit b8bd6dc36186fe99afa7b73e9e2d9a98ad5c4865 upstream.

A user on StackExchange had a failing SSD that's soldered directly
onto the motherboard of his system. The BIOS does not give any option
to disable it at all, so he can't just hide it from the OS via the
BIOS.

The old IDE layer had hdX=noprobe override for situations like this,
but that was never ported to the libata layer.

This patch implements a disable flag for libata.force.

Example use:

 libata.force=2.0:disable

[v2 of the patch, removed the nodisable flag per Tejun Heo]

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Link: http://unix.stackexchange.com/questions/102648/how-to-tell-linux-kernel-3-0-to-completely-ignore-a-failing-disk
Link: http://askubuntu.com/questions/352836/how-can-i-tell-linux-kernel-to-completely-ignore-a-disk-as-if-it-was-not-even-co
Link: http://superuser.com/questions/599333/how-to-disable-kernel-probing-for-drive
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Documentation/kernel-parameters.txt
drivers/ata/libata-core.c

index 2ba8272..1b196ea 100644 (file)
@@ -1305,6 +1305,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
                        * dump_id: dump IDENTIFY data.
 
 
                        * dump_id: dump IDENTIFY data.
 
+                       * disable: Disable this device.
+
                        If there are multiple matching configurations changing
                        the same attribute, the last one is used.
 
                        If there are multiple matching configurations changing
                        the same attribute, the last one is used.
 
index c581b6b..72bbb5e 100644 (file)
@@ -6331,6 +6331,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 },
                { "nohrst",     .lflags         = ATA_LFLAG_NO_HRST },
                { "nosrst",     .lflags         = ATA_LFLAG_NO_SRST },
                { "norst",      .lflags         = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
+               { "disable",    .horkage_on     = ATA_HORKAGE_DISABLE },
        };
        char *start = *cur, *p = *cur;
        char *id, *val, *endp;
        };
        char *start = *cur, *p = *cur;
        char *id, *val, *endp;