libata force parameter

I need to force 80 pin cable detect on my cdrom. According to the kernel-parameters.txt file you can do this by using libata.force=(port).(device) 80c

Here is the actual explanation from the kernel file:
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.

My question is where do you find the proper port.device numbers? I’m guessing it’s lspci but I’d rather be sure before I do something silly…>:) An actual working line for a cdrw as master on the first ide channel would be excellent. BTW my cdrw is detected as sr0 so the normal “ide” boot params won’t work…

I need to force 80 pin cable detect on my cdrom. According to the kernel-parameters.txt file you can do this by using libata.force=(port).(device) 80c
Pardon my ignorance here dartefi, but I was not aware there was some sort of detection able to determine when you are using 40 or 80 conductor cables for optical drives. As far as I knew, half of the 80 conductors are there to prevent crosstalk at higher speeds and only 40 are really used for data. In the old days, you used 40 conductor cables for your CDROM drives and 80 conductor cables for your hard drives. More recently, I just used 80 conductor cables for everything, but not sure there is a port check for this. Of course, new hard drives these days are SATA.

Also, what kind of problem are you trying to solve through such a detection should it exist? If you only have one CDROM drive, it is most likely called /dev/sr0 in the present openSUSE versions. It may also be called /dev/dvd if it plays DVD’s, /dev/cdrom if it plays anything, /dev/cdrw & /dev/dvdrw if it can write to any disks.

Thank You,

No problem jdmcdaniel3…the problem is this from the boot messages:

ata1.00: ATAPI: ATAPI DVD A DH20A4P, 9P59, max UDMA/66
ata1: nv_mode_filter: 0x1f39f&0x1f07f->0x1f01f, BIOS=0x1f000 (0xc5000000) ACPI=0x0
ata1.00: limited to UDMA/33 due to 40-wire cable
ata1.00: configured for UDMA/33

The thing is I do have a udma 66 cdrom (unless it’s lying to me like my WDC raptors did) and I do have a 80 wire cable, 3 as a matter of fact, none of which will detect properly. Add to this flaky cd reading capabilities and I just want to get this sorted out.

Here is a hdparm:

Windeath:/home/dart # hdparm --Istdout /dev/sr0

/dev/sr0:
85c0 0000 0000 0000 0000 0000 0000 0000
0000 0000 2020 2020 2020 2020 2020 2020
2020 2020 2020 2020 0000 0000 0000 3950
3539 2020 2020 4154 4150 4920 2020 4456
4420 4120 2044 4832 3041 3450 2020 2020
2020 2020 2020 2020 2020 2020 2020 0000
0000 0b00 4000 0000 0000 0006 0000 0000
0000 0000 0000 0000 0000 0000 079f 0007
0003 0078 0078 00f0 0078 0000 0000 0000
0000 0004 0009 0000 0000 0000 0000 0000
00f0 0000 0210 5000 4000 0210 1000 4000
041f 0000 0000 0000 0000 4101 0000 0000

As you can see word 93 is supposed to be 0x4000 and mine is 0x4101
Normally I wouldn’t worry too much except for the fact I have a lot of problem mounting cd’s with these sorts of errors:

sr 0:0:0:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK
sr 0:0:0:0: [sr0] Sense Key : Medium Error [current]
sr 0:0:0:0: [sr0] Add. Sense: L-EC uncorrectable error
end_request: I/O error, dev sr0, sector 0
Buffer I/O error on device sr0, logical block 0
cdrom: This disc doesn’t have any tracks I recognize!

They change depending on the modules I load or the programs I use, or the kernel parameters I load but the upshot is I can load one cd/dvd after a reboot and then I’m pretty much screwed. I’d just like to try the libata.force param so I can continue with my troubleshooting…

I’ve managed to improve somewhat and I’m zeroing in…just could use a bit of help to eliminate that last little problem of cable detection…I would really appreciate an example of a proper libata.force command…

This is what I’m looking for: Linux Kernel Documentation :: kernel-parameters.txt

I don’t think you could even use 40 pin cables for IDE CDROM drives nowadays. Last time I did (couple years ago), I got nothing but I/O errors. The IDE controller requires 80 pin cable for ATA66/100/133. With 40 pin cable, you cannot do more than ATA33/ultra DMA 2 … as far as I remember.

@dartefi, what does 80 pin cable have to do with IDE PORT and DEVICE numbers? Are you sure you didn’t misunderstand something?

It’s unlikely that all 3 cables are bad. Maybe your IDE controller (on board?) is broken?. Can you not try some cheap PCI Promise IDE controller? It might solve the problem and save you a lot of time.

So dartefi, you are really trying to force a udma trasfer mode with your CDROM drive from 33 to 66, right? I found some interesting stuff here you could look at:

The Linux Ultra-DMA Mini-Howto

Now, the problem you are having is read errors and slow speed and you think this is due to the low dma speed detection you are getting?

You did not specify how long you have had this optical drive, but they get dirty and they go bad. In fact I have determined that optical drives go bad more often than do hard drives, perhaps twice as often. The most likely culprit is dust and dirt and the second is installing one above a heat source such as a hard drive. CDROM drives are unable to handle this high heat as well as hard drives seem able to dish out the heat to everything around them.

So you could have already done so, but before I went over board trying to fix this problem, I would surely buy a new DVD-DL burner and see if it works any better. I tell you this because I have wasted untold time trying to fix something that I can buy for under $50 at most discount electronic shops. It seems kind of silly when the device costs so little. But this is my opinion and not everyone can afford to buy hardware when they just suspect something might be wrong.

Thank You,

Ok…my kernel: Linux Windeath 2.6.27.48-0.3-default #1 SMP 2010-09-20 11:03:26 -0400 x86_64 x86_64 x86_64 GNU/Linux
misdetects my cdrom cable as a 40 pin when it is NOT…I want to force a proper detection to see if that solves any problems

libata.force= will force the proper detection and eliminate that variable from my troubleshooting…no misunderstanding…

Thank you for your input jdmcdaniel3 but this sort of thing with cdroms has been an ongoing problem with me since 96 and I’m tired of it. Just do a search on Google and you will see a lot of people with cdrom problems in linux that work fine if they boot windows. Do you have a libata.force command for me or not?

P.S. Please don’t call me silly…I’m not a newbie no matter what my forum rating says…:wink: No offense intended…

I still use the word “newbie” instead of n00b and “lose” instead of loose…that should tell ya something…heh…

If anyone could point me to a properly formatted libata.force= command I would appreciate it…:stuck_out_tongue:

I just want to eliminate this one variable…then maybe I’ll chase down why it’s not being detected properly…

Here is what I found using a simple internet search:

libata: implement libata.force module parameter
    
    This patch implements libata.force module parameter which can
    selectively override ATA port, link and device configurations
    including cable type, SATA PHY SPD limit, transfer mode and NCQ.
    
    For example, you can say "use 1.5Gbps for all fan-out ports attached
    to the second port but allow 3.0Gbps for the PMP device itself, oh,
    the device attached to the third fan-out port chokes on NCQ and
    shouldn't go over UDMA4" by the following.
    
     **libata.force=2:1.5g,2.15:3.0g,2.03:noncq,udma4**
    
    Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 Documentation/kernel-parameters.txt |   35 ++++
 drivers/ata/libata-core.c           |  380 ++++++++++++++++++++++++++++++++++-
 drivers/ata/libata-eh.c             |    8 +-
 drivers/ata/libata.h                |    1 +
 4 files changed, 420 insertions(+), 4 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index 7278295..9a5b665 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -950,6 +950,41 @@ and is between 256 and 4096 characters. It is defined in 
the file
                        when set.
                        Format: <int>
 
+       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.
+
+                       * SATA link speed limit: 1.5Gbps or 3.0Gbps.
+
+                       * Transfer mode: pio[0-7], mwdma[0-4] and udma[0-7].
+                         udma/][16,25,33,44,66,100,133] notation is also
+                         allowed.
+
+                       * [no]ncq: Turn on or off NCQ.
+
+                       If there are multiple matching configurations changing
+                       the same attribute, the last one is used.
+
        load_ramdisk=   [RAM] List of ramdisks to load from floppy
                        See Documentation/ramdisk.txt.

URL: libata: implement libata.force module parameter

Good luck with your issues.

Thank You,

Yup…found that a long time ago but I still don’t quite understand the exact format…which is what I’m asking for…how do I find the proper port.device? LSPCI? And how do I put that into a command? I know where to put it…just not quite how…scroll up, you’ll see I posted the exact same thing…

I already have a cheap Promise controller and you are right…all 3 cables are not bad…the detection is bad…I just installed the sources for my kernel…I’m almost willing to bet if I was a programmer of any sort I could enter my word 93 in the proper file and get this detected properly. Even tho I’m not I’ll give it a try…

****…now all I gotta figure out is how to extract a .config from a precompiled kernel…like I said…NOT a programmer…still looking for that libata.force= command…

Starting another thread about the config…if anyone has a clue about the libata.force command I’d love to hear from ya…

Well I don’t have any more information about this command and really I have not had any need to use it so far. For what it is worth, I got my first computer in 1979 and I have had more than one ever since. I have worked on, rebuilt and built anew untold numbers of computers including a contract once to rebuild 500 computers for Exxon when I used to live in Houston. I have had bad motherboards, bad controllers, bad cables and bad optical drives and once you git rid of what is bad, I have NOT had need to force the UDMA mode for any optical drive.

As I said before, I do hope you find the solution that you are looking for.

Thank You,

On 2010-10-17 07:06, dartefi wrote:
>
> Yup…found that a long time ago but I still don’t quite understand the
> exact format…which is what I’m asking for…how do I find the proper
> port.device?

I think the data will be in the boot log, lines pertaining to the cdrom:

<6> 0.998557] ata8.00: ATAPI: HL-DT-ST DVDRAM GH22LS50, TL01, max UDMA/100

That would be ata8.00, I guess (mine is SATA, yours is PATA)

However, I think that your problem will be hardware: board, cable, drive. But of course, try to
force that parameter, it is a read unit, no damage should come. I think! I have never done what you
are attempting, so I wish you luck.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)