Subject: [PATCH] IDE: fix "biostimings" and legacy chipsets' boot parameters interaction


Hi,
please apply.

I hope this time no whitespace breakage.
--
Bartlomiej

IDE: fix "biostimings" and legacy chipsets' boot parameters interaction.

"biostimings" cannot be hardcoded to -19, make it -8.
Code in ide_setup() assumes that everything <= -11 is a legacy
chipset name, so fe. "ide0=ali14xx ide0=biostimings" will fail
while "ide0=biostimings ide0=ali14xx" will be okay.

drivers/ide/ide.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)

diff -puN drivers/ide/ide.c~ideX_biostimings_fix drivers/ide/ide.c
--- linux-2.5.69-bk17/drivers/ide/ide.c~ideX_biostimings_fix Sun May 25 23:26:20 2003
+++ linux-2.5.69-bk17-root/drivers/ide/ide.c Sun May 25 23:29:32 2003
@@ -1939,13 +1939,13 @@ int __init ide_setup (char *s)
if (s[3] >= '0' && s[3] <= max_hwif) {
/*
* Be VERY CAREFUL changing this: note hardcoded indexes below
- * -8,-9,-10 : are reserved for future idex calls to ease the hardcoding.
+ * -9,-10 : are reserved for future idex calls to ease the hardcoding.
*/
const char *ide_words[] = {
"noprobe", "serialize", "autotune", "noautotune",
- "reset", "dma", "ata66", "minus8", "minus9", "minus10",
- "four", "qd65xx", "ht6560b", "cmd640_vlb", "dtc2278",
- "umc8672", "ali14xx", "dc4030", "biostimings", NULL };
+ "reset", "dma", "ata66", "biostimings", "minus9",
+ "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb",
+ "dtc2278", "umc8672", "ali14xx", "dc4030", NULL };
hw = s[3] - '0';
hwif = &ide_hwifs[hw];
i = match_parm(&s[4], ide_words, vals, 3);
@@ -1964,10 +1964,6 @@ int __init ide_setup (char *s)
}

switch (i) {
- case -19: /* "biostimings" */
- hwif->drives[0].autotune = IDE_TUNE_BIOS;
- hwif->drives[1].autotune = IDE_TUNE_BIOS;
- goto done;
#ifdef CONFIG_BLK_DEV_PDC4030
case -18: /* "dc4030" */
{
@@ -2038,8 +2034,11 @@ int __init ide_setup (char *s)
#endif /* CONFIG_BLK_DEV_4DRIVES */
case -10: /* minus10 */
case -9: /* minus9 */
- case -8: /* minus8 */
goto bad_option;
+ case -8: /* "biostimings" */
+ hwif->drives[0].autotune = IDE_TUNE_BIOS;
+ hwif->drives[1].autotune = IDE_TUNE_BIOS;
+ goto done;
case -7: /* ata66 */
#ifdef CONFIG_BLK_DEV_IDEPCI
hwif->udma_four = 1;

_


2003-05-26 18:01:07

by Alan Cox

[permalink] [raw]
Subject: Re: [PATCH] IDE: fix "biostimings" and legacy chipsets' boot parameters interaction

> IDE: fix "biostimings" and legacy chipsets' boot parameters interaction.

I have to admit I don't care since biostimings is a stupid patch Linus
forced into the tree against my wishes. Its a great way to lose all your
data if you turn it on

Subject: Re: [PATCH] IDE: fix "biostimings" and legacy chipsets' boot parameters interaction



On Mon, 26 May 2003, Alan Cox wrote:

> > IDE: fix "biostimings" and legacy chipsets' boot parameters interaction.
>
> I have to admit I don't care since biostimings is a stupid patch Linus
> forced into the tree against my wishes. Its a great way to lose all your
> data if you turn it on

You mean setting using_dma in ide_setup_dma() or comment in setup-pci.c?
If it is data risky, why not kill it? I will be very happy - one sucky
parameter less.
--
Bartlomiej

2003-05-26 23:48:40

by Alan Cox

[permalink] [raw]
Subject: Re: [PATCH] IDE: fix "biostimings" and legacy chipsets' boot parameters

> > > IDE: fix "biostimings" and legacy chipsets' boot parameters interaction.
> >
> > I have to admit I don't care since biostimings is a stupid patch Linus
> > forced into the tree against my wishes. Its a great way to lose all your
> > data if you turn it on
>
> You mean setting using_dma in ide_setup_dma() or comment in setup-pci.c?
> If it is data risky, why not kill it? I will be very happy - one sucky
> parameter less.

Very few BIOSes set up complete timings. The only ones that you can rely
on to handle this are those that do magic with bios tables such as
serverworks. In the serverworks case we implement the bios timing reading
per their NDA'd documents *regardless* of that setting.

Its only there because Linus applied the change despite my requests not to,
then refused to remove it. The sooner it dies the better