LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   how to force libata to ignore 40 wire IDE cable limitation (in laptop) (http://www.linuxquestions.org/questions/debian-26/how-to-force-libata-to-ignore-40-wire-ide-cable-limitation-in-laptop-741950/)

neonsignal 07-22-2009 09:32 AM

how to force libata to ignore 40 wire IDE cable limitation (in laptop)
 
I'm running Debian Lenny (kernel 2.6.26-2-686) on a Toshiba Portege 3500 laptop. The IDE interface is controlled by an ALi Corporation M5229 IDE.

The kernel fails to detect an 80 wire cable to the hard disk, and so it falls back to using UDMA/33 on the drive (fair enough), which slows things down quite a bit.

The kernel-params.txt document tells me that libata can take a 'force' parameter, with options such as 80c (force to 80 wire) or short40c (assume a short or nonexistent cable).

I have attempted to set this parameter (details below), but with no joy.

If I patch the kernel code (changing ide-iops.c so that the short40c state is assumed), the UMDA/66 mode is successfully selected. But I'd prefer to do this without modifying the stock kernel if possible.

I have tried using the parameter in the following ways, but I think I must be doing it wrong:

* adding it to the kernel line in grub
libata.force=short40c
(kernel reports "Unknown boot option")

* adding it to /etc/modprobe.d/options
options libata force=short40c
and then rebuilding initrd
update-initramfs -u

Neither of these methods had any effect that I could see. I tried in a few other places too (such as /etc/modules.conf, and in /etc/modutils), but didn't really know what I was doing :).

So my questions are:
1) Is this parameter working in the current Lenny kernel (I can see code that uses the flags, but I don't know enough about how parameters get passed in)?
2) Am I setting the right parameter, or are there others that might be relevant (eg ide_core.ignore_cable)?
3) Is there a difference between passing in options via grub or via the modprobe.d files?
4) In which file would parameter options normally be put (or are any files inside modprobe.d used)?

GrapefruiTgirl 08-14-2009 10:08 PM

Code:

From: Kernel Documentation file: kernel-parameters.txt



libata.force=        [LIBATA] Force configurations.  The format is comma
                        separated list of "[ID:]VAL" where ID is
                        PORT[:DEVICE].  PORT and DEVICE are decimal numbers
                        matching port, link or device.  Basically, it matches
                        the ATA ID string printed on console by libata.  If
                        the whole ID part is omitted, the last PORT and DEVICE
                        values are used.  If ID hasn't been specified yet, the
                        configuration applies to all ports, links and devices.


                        If only DEVICE is omitted, the parameter applies to
                        the port and all links and devices behind it.  DEVICE
                        number of 0 either selects the first device or the
                        first fan-out link behind PMP device.  It does not
                        select the host link.  DEVICE number of 15 selects the
                        host link and device attached to it.

                        The VAL specifies the configuration to force.  As long
                        as there's no ambiguity shortcut notation is allowed.
                        For example, both 1.5 and 1.5G would work for 1.5Gbps.
                        The following configurations can be forced.

                        * Cable type: 40c, 80c, short40c, unk, ign or sata.
                          Any ID with matching PORT is used.

From the looks of things, I believe you're going about it the correct way; adding it to the GRUB kernel line should be OK, and is correct.
You might want to try giving the full parameter, instead of omitting the [ID] section (see bold text above) and see if that helps?

It is *possible* too that the option is no longer supported (even though the supporting code IS still in the libata code). The parameters.txt file is not necessarily 100% up to date, nor necessarily 100% complete.


Sasha

jschiwal 08-14-2009 10:23 PM

You can also use modinfo to find which options your kernel module takes.
Does UDMA/66 exceed the capabilities of your drive or controller? Is there a limiting jumper on the drive?

neonsignal 08-15-2009 06:10 AM

Thanks for the feedback, it encouraged me to take another look at this.

modinfo did show that libata had a 'force' parameter. But after having a closer look at the kernel driver source, I realized I was working on the wrong module. The ide_core module also has a parameter to force the 40 wire cable type to be ignored (which is presumably the one being checked in ide-iops.c).

So the fix is this:

edit /etc/modprobe.d/options, adding the line
Code:

options ide_core ignore_cable=0
The parameter to ignore_cable is the drive id (I messed up the syntax at first, and ended up with a non-bootable initrd, which was a bit tricky :o).

Then rebuild the initrd image
Code:

update-initramfs -u
And now the drive gets set to UDMA66 (it is a reasonably new drive, so this works fine, and I am not getting any drive errors). The drive can handle higher speeds, so I assume my limitation now is the controller.

I still don't seem to be able to get it to work by passing the option in through grub, but I can live with that.


All times are GMT -5. The time now is 05:06 AM.