Skip to contentSkip to conversation

libata: provide the ability to disable a disk via the params.

PATCH In review Robin H. Johnson 3 participants 8 messages Dec 12, 2013 – Dec 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata: provide the ability to disable a disk via the params.

This was posted by a user on StackExchange, who has 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 that way.

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

X-URL: http://unix.stackexchange.com/questions/102648/how-to-tell-linux-kernel-3-0-to-completely-ignore-a-failing-disk
X-URL: http://askubuntu.com/questions/352836/how-can-i-tell-linux-kernel-to-completely-ignore-a-disk-as-if-it-was-not-even-co
X-URL: http://superuser.com/questions/599333/how-to-disable-kernel-probing-for-drive

---
 Documentation/kernel-parameters.txt | 2 ++
 drivers/ata/libata-core.c           | 2 ++
 2 files changed, 4 insertions(+)
Documentation/kernel-parameters.txt +2 -0
index 50680a5..40bf5ff 100644
@@ -1529,6 +1529,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
 			* atapi_dmadir: Enable ATAPI DMADIR bridge support
 
+			* [no]disable: Enable or disable this device.
+
 			If there are multiple matching configurations changing
 			the same attribute, the last one is used.
 
drivers/ata/libata-core.c +2 -0
index 75b9367..5069a96 100644
@@ -6519,6 +6519,8 @@ static int __init ata_parse_force_one(char **cur,
 		{ "norst",	.lflags		= ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
 		{ "rstonce",	.lflags		= ATA_LFLAG_RST_ONCE },
 		{ "atapi_dmadir", .horkage_on	= ATA_HORKAGE_ATAPI_DMADIR },
+		{ "disable",	.horkage_on	= ATA_HORKAGE_DISABLE },
+		{ "nodisable",	.horkage_off	= ATA_HORKAGE_DISABLE },
 	};
 	char *start = *cur, *p = *cur;
 	char *id, *val, *endp;
Signature · 1 line
1.8.4.3
#1 lore raw

Hello, Robin.

drivers/ata/libata-core.c static int __init ata_parse_force_one(char **cur, · line 6523

Quoted 2 lines · Robin H. Johnson
drivers/ata/libata-core.c +2 -0
+		{ "disable",	.horkage_on	= ATA_HORKAGE_DISABLE },
+		{ "nodisable",	.horkage_off	= ATA_HORKAGE_DISABLE },

Given the current usage of ATA_HORKAGE_DISABLE, I don't think we need "nodisable". Let's just add "disable" for now. Can you please update the patch and resend?

Thanks.

Signature · 1 line
tejun
#2 lore raw
Quoted 8 lines · Tejun Heo

Hello, Robin.

drivers/ata/libata-core.c static int __init ata_parse_force_one(char **cur, · line 6523

Quoted 2 lines · Robin H. Johnson
drivers/ata/libata-core.c +2 -0
+		{ "disable",	.horkage_on	= ATA_HORKAGE_DISABLE },
+		{ "nodisable",	.horkage_off	= ATA_HORKAGE_DISABLE },

Given the current usage of ATA_HORKAGE_DISABLE, I don't think we need "nodisable". Let's just add "disable" for now. Can you please update the patch and resend?

Before I do so, I have two questions:
1.
Countering your nodisable comment, would it be valid to do:
libata.force=2:disable libata.force=2.02:nodisable To disable all of port 2 except device 2?

2. One of my friends wondered if it would be worthwhile to add force keywords for other HORKAGE bits, and if so, should the ata_lflag/ata_link force bits also be presented?

There are only 3 HORKAGE bits presently available in libata.force:
ATA_HORKAGE_NONCQ
ATA_HORKAGE_DUMP_ID
ATA_HORKAGE_ATAPI_DMADIR

And 3 ata_link flags:
ATA_LFLAG_NO_HRST
ATA_LFLAG_NO_SRST
ATA_LFLAG_RST_ONCE

Signature · 4 lines
Robin Hugh Johnson
Gentoo Linux: Developer, Infrastructure Lead
E-Mail     : [email protected]
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
#3 lore raw

Hi, Robin.

2013-12-12 21:22, Robin H. Johnson:

Quoted 9 lines · Tejun Heo
Quoted 8 lines

Hello, Robin.

drivers/ata/libata-core.c static int __init ata_parse_force_one(char **cur, · line 6523

Quoted 2 lines · Robin H. Johnson
drivers/ata/libata-core.c +2 -0
+		{ "disable",	.horkage_on	= ATA_HORKAGE_DISABLE },
+		{ "nodisable",	.horkage_off	= ATA_HORKAGE_DISABLE },

Given the current usage of ATA_HORKAGE_DISABLE, I don't think we need "nodisable". Let's just add "disable" for now. Can you please update the patch and resend?

Quoted 5 lines

Before I do so, I have two questions:
1.
Countering your nodisable comment, would it be valid to do:
libata.force=2:disable libata.force=2.02:nodisable To disable all of port 2 except device 2?

I think that makes sense and I support having 'nodisable'.

Quoted 4 lines

2. One of my friends wondered if it would be worthwhile to add force keywords for other HORKAGE bits, and if so, should the ata_lflag/ata_link force bits also be presented?

I don't think so. Most of the other HORKAGEs are automatically recognized and applied by the code. I think the only ones which can cause trouble if not detected at first are the ones that are currently in the list.

Signature · 2 lines
Regards,
Levente Kurusa
#4 lore raw
Quoted 7 lines · Levente Kurusa
Quoted 3 lines

2. One of my friends wondered if it would be worthwhile to add force keywords for other HORKAGE bits, and if so, should the ata_lflag/ata_link force bits also be presented?

I don't think so. Most of the other HORKAGEs are automatically recognized and applied by the code. I think the only ones which can cause trouble if not detected at first are the ones that are currently in the list.

His logic was thinking that it will aid debugging/testing on new buggy devices if the options are available at boot.

I'd think of the following as candidates for that:
ATA_HORKAGE_NODMA
ATA_HORKAGE_MAX_SEC_128
ATA_HORKAGE_DIAGNOSTIC
ATA_HORKAGE_BROKEN_HPA
ATA_HORKAGE_DISABLE
ATA_HORKAGE_HPA_SIZE
ATA_HORKAGE_IVB
ATA_HORKAGE_STUCK_ERR (only set by code presently, not by blacklist) ATA_HORKAGE_BRIDGE_OK
ATA_HORKAGE_ATAPI_MOD16_DMA
ATA_HORKAGE_NOSETXFER
ATA_HORKAGE_MAX_SEC_LBA48

Signature · 4 lines
Robin Hugh Johnson
Gentoo Linux: Developer, Infrastructure Lead
E-Mail     : [email protected]
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
#5 lore raw
In reply to Levente Kurusa
Quoted 6 lines · Levente Kurusa
Quoted 4 lines

1.
Countering your nodisable comment, would it be valid to do:
libata.force=2:disable libata.force=2.02:nodisable To disable all of port 2 except device 2?

I think that makes sense and I support having 'nodisable'.

I really don't want to. Let's please add whatever is necessary for fringe use cases but no more. It's not like this thing is generally useful.

Quoted 8 lines
Quoted 3 lines

2. One of my friends wondered if it would be worthwhile to add force keywords for other HORKAGE bits, and if so, should the ata_lflag/ata_link force bits also be presented?

I don't think so. Most of the other HORKAGEs are automatically recognized and applied by the code. I think the only ones which can cause trouble if not detected at first are the ones that are currently in the list.

Again, just whatever is immediately necessary, please.

Thanks.

Signature · 1 line
tejun
#6 lore raw

PATCH v2 1/1 libata: disable a disk via libata.force params

In reply to Robin H. Johnson

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]

X-URL: http://unix.stackexchange.com/questions/102648/how-to-tell-linux-kernel-3-0-to-completely-ignore-a-failing-disk
X-URL: http://askubuntu.com/questions/352836/how-can-i-tell-linux-kernel-to-completely-ignore-a-disk-as-if-it-was-not-even-co
X-URL: http://superuser.com/questions/599333/how-to-disable-kernel-probing-for-drive

---
 Documentation/kernel-parameters.txt | 2 ++
 drivers/ata/libata-core.c           | 1 +
 2 files changed, 3 insertions(+)
Documentation/kernel-parameters.txt +2 -0
index 50680a5..b9e9bd8 100644
@@ -1529,6 +1529,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
 			* atapi_dmadir: Enable ATAPI DMADIR bridge support
 
+			* disable: Disable this device.
+
 			If there are multiple matching configurations changing
 			the same attribute, the last one is used.
 
drivers/ata/libata-core.c +1 -0
index 75b9367..70529b8 100644
@@ -6519,6 +6519,7 @@ static int __init ata_parse_force_one(char **cur,
 		{ "norst",	.lflags		= ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
 		{ "rstonce",	.lflags		= ATA_LFLAG_RST_ONCE },
 		{ "atapi_dmadir", .horkage_on	= ATA_HORKAGE_ATAPI_DMADIR },
+		{ "disable",	.horkage_on	= ATA_HORKAGE_DISABLE },
 	};
 	char *start = *cur, *p = *cur;
 	char *id, *val, *endp;
Signature · 1 line
1.8.4.3
Applied
#7 lore raw

Re: [PATCH v2] libata: disable a disk via libata.force params

Quoted 11 lines · Robin H. Johnson

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

Quoted 6 lines

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

X-URL: http://unix.stackexchange.com/questions/102648/how-to-tell-linux-kernel-3-0-to-completely-ignore-a-failing-disk
X-URL: http://askubuntu.com/questions/352836/how-can-i-tell-linux-kernel-to-completely-ignore-a-disk-as-if-it-was-not-even-co
X-URL: http://superuser.com/questions/599333/how-to-disable-kernel-probing-for-drive

Applied to libata/for-3.13-fixes w/ stable cc'd and minor description edits.

Thanks.

Signature · 1 line
tejun