Skip to contentSkip to conversation

80 wire cable detection patch

DISCUSSION George Kibardin 2 participants 3 messages Jan 6, 2008 – Jan 10, 2008 2 messages not in the archive libata

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 renamed from ide/ide-iops.c.orig 2008-01-03 18:35:23.000000000 +0300 +3 -3
@@ -612,12 +612,12 @@
              printk(KERN_DEBUG "%s: skipping word 93 validity check\n",
                                drive->name);
 
-       if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
-               goto no_80w;
-
      if (ide_dev_is_sata(id) && !ivb)
              return 1;
 
+       if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
+               goto no_80w;
+
      /*
       * FIXME:
       * - change master/slave IDENTIFY order

Best,
George

Quoted 56 lines

Hi,

Quoted 5 lines · George Kibardin

Hi Bartlomiej,

I hope that you are the right person to look at my proposal.
I use 2.6.23-gentoo-r3 kernel on VIA Epia EX motherboard with WD SATA HDD connected to it. (I don't understand exactly why, but kernel thinks that this is not SATA HDD. It assigns name hda to it, there is no words SATA in logs, loading via_sata modules doesn't change situation, via82cxxx module detect this chipset correctly, there is no word SATA in BIOS etc.). During boot I get:

There is probably PATA->SATA bridge on the motherboard.

Quoted 5 lines

host side 80-wire cable detection failed, limiting max speed to UDMA33

(of course it is true - I don't have even 40 wires :-)
Digging the code I've figured out that for some reason checking that there is 80 wire cable connected happens before checking that drive is SATA. I've changed the order and this fixed my problem. Unfortunately, I have not enough hardware to test this. The only thing I'm wondering - is this bug or feature? Maybe you know the reason why sata check should go almost last?

Your fix looks fine and is similar to how libata handles PATA->SATA bridges.

Please add "Signed-off-by:" line,

ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 line 617

Quoted 12 lines
ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 renamed from ide/ide-iops.c.orig 2008-01-03 18:35:23.000000000 +0300 +0 -3
@@ -612,12 +612,12 @@
                printk(KERN_DEBUG "%s: skipping word 93 validity check\n",
                                  drive->name);
 
-       if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
-               goto no_80w;
-
        if (ide_dev_is_sata(id))
                return 1;
 

change it to 'if (ide_dev_is_sata(id) && !ivb)' (some ATAPI devices needing IVB quirk like to identify themselves like SATA ones, but they aren't),

ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 line 623

Quoted 8 lines
ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 renamed from ide/ide-iops.c.orig 2008-01-03 18:35:23.000000000 +0300 +3 -0
+       if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
+               goto no_80w;
+
        /*
         * FIXME:
         * - change master/slave IDENTIFY order

and resubmit (cc:ing [email protected] mailing list).

Thanks,
Bart

#3 lore raw

Hi,

ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 line 616

Quoted 13 lines · George Kibardin
ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 renamed from ide/ide-iops.c.orig 2008-01-03 18:35:23.000000000 +0300 +0 -3
@@ -612,12 +612,12 @@
               printk(KERN_DEBUG "%s: skipping word 93 validity check\n",
                                 drive->name);
 
-       if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
-               goto no_80w;
-
       if (ide_dev_is_sata(id) && !ivb)
               return 1;

Ehm, this was not changed in the code before generating patch but in the patch itself so the patch won't apply... :(

ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 line 623

Quoted 6 lines
ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 renamed from ide/ide-iops.c.orig 2008-01-03 18:35:23.000000000 +0300 +3 -0
+       if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
+               goto no_80w;
+
       /*
        * FIXME:
        * - change master/slave IDENTIFY order

This time I just applied fix by hand and added missing patch summary ("ide: fix cable detection for SATA bridges") but in the future please make sure that the patch applies and has a meaningful description.

Thanks,
Bart

#4 lore raw

I'm sorry, I should have guessed !!
(I applied those little change to my code manually and then to the patch :)

Thanks,
George

-----Original Message-----
From: Bartlomiej Zolnierkiewicz [mailto:[email protected]]
Sent: Thursday, January 10, 2008 2:26 AM
To: George Kibardin
Cc: [email protected]
Subject: Re: 80 wire cable detection patch

Hi,

ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 line 616

Quoted 13 lines · George Kibardin
ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 renamed from ide/ide-iops.c.orig 2008-01-03 18:35:23.000000000 +0300 +0 -3
@@ -612,12 +612,12 @@
               printk(KERN_DEBUG "%s: skipping word 93 validity check\n",
                                 drive->name);
 
-       if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
-               goto no_80w;
-
       if (ide_dev_is_sata(id) && !ivb)
               return 1;

Ehm, this was not changed in the code before generating patch but in the patch itself so the patch won't apply... :(

ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 line 623

Quoted 6 lines
ide/ide-iops.c 2008-01-03 18:12:29.000000000 +0300 renamed from ide/ide-iops.c.orig 2008-01-03 18:35:23.000000000 +0300 +3 -0
+       if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
+               goto no_80w;
+
       /*
        * FIXME:
        * - change master/slave IDENTIFY order

This time I just applied fix by hand and added missing patch summary ("ide: fix cable detection for SATA bridges") but in the future please make sure that the patch applies and has a meaningful description.

Thanks,
Bart