On Wed, 2011-03-16 at 17:18 -0400, Chris Knadle wrote:
> On Wednesday, March 16, 2011 15:38:47 Allen Weiner wrote:
> > Linux (both Fedora 14 and Ubuntu 10.10) is limiting my UDMA/133 PATA HDD
> > (my main system drive) to UDMA/33:
> >
> > 1.861688] ata7.00: ATA-7: Maxtor 6Y080L0, YAR41BW0, max UDMA/133
> > [ 1.861928] ata7.00: 156250000 sectors, multi 0: LBA
> > [ 1.862181] ata7.00: limited to UDMA/33 due to 40-wire cable
> > [ 1.868673] ata7.00: configured for UDMA/33
> >
> > My IDE cable is an 80-wire cable (it has blue and black end-connectors
> > and a gray center-connector). The cable is connected with the correct
> > orientation (blue end-connector connected to motherboard, black
> > end-connector is connected to HDD). There is nothing connected to the
> > center connector. The HDD is jumpered for CS (cable-select).
>
> Using cable select is typical, but is less reliable than using "single mode"
> for when a hard disk is alone on a cable. It's interesting that Linux is
> reporting that you're using a 40-pin cable when you're using an 80-pin cable.
>
> The 80-pin cable is doing ground/signal/ground, by the way -- so only 40 pins
> of that 80-pin cable are actually used for ATA transmission.
>
> > The BIOS recognizes the HDD as UDMA/133. On bootup the BIOS displays a
> > screen which lists the HDD as UDMA mode 6 (which is UDMA/133).
> > Initially, I attached the IDE cable with the backward orientation, and
> > the BIOS recognized the HDD as UDMA mode 2 (UDMA/33).
> >
> > The HDD is a Maxtor DiamondMax Plus 9 6Y080L0 80 GB PATA. The
> > motherboard IDE controller is VIA VT6330.
> >
> > 04:00.1 IDE interface: VIA Technologies, Inc. PATA IDE Host Controller
> > (rev a0) (prog-if 85 [Master SecO PriO])
> > Subsystem: VIA Technologies, Inc. PATA IDE Host Controller
> > Flags: bus master, fast devsel, latency 0, IRQ 16
> > I/O ports at e800 [size=8]
> > I/O ports at e400 [size=4]
> > I/O ports at e000 [size=8]
> > I/O ports at d800 [size=4]
> > I/O ports at d400 [size=16]
> > Expansion ROM at fe9f0000 [disabled] [size=64K]
> > Capabilities: [50] Power Management version 3
> > Capabilities: [70] MSI: Enable- Count=1/1 Maskable+ 64bit+
> > Capabilities: [90] Express Legacy Endpoint, MSI 00
> > Capabilities: [100] Advanced Error Reporting
> > Capabilities: [130] Device Serial Number 00-30-67-ff-ff-83-f3-23
> > Kernel driver in use: pata_via
> > Kernel modules: pata_via
> >
> >
> > A Google search shows that there are a number of bug reports for this
> > type of problem, but they are not recent:
> >
> > 1. Red Hat Bugzilla – Bug 429774
> > pata_via 40-wire cable wrong detection
> > Last modified: 2008-11-26 12:37:12 EST
> >
> > 2.Kernel Bug Tracker – Bug 10179
> > pata_amd libata: Erroneous "limited to UDMA/33 due to 40-wire cable"
> > from PX-130A
> > Last modified: 2008-06-18 03:28:03
> >
> > 3.Kernel Bug Tracker – Bug 8164
> > pata_via: wrong cable detection on PATA controller
> > Last modified: 2007-03-21 13:11:17
> >
> > Questions:
> > ---------
> >
> > Q1: Is this a user error (something I'm overlooking in my hardware
> > setup) or a Linux bug?
>
> I believe Linux by default uses UDMA/33 for compatibility reasons, but I'm
> not
> exactly sure how the speed decision is decided at boot time.
>
> Have a look at the 'hdparm' package, which allows you to manually set hard
> disk parameters like the ATA speed as well as 32-bit access mode. 'hdparm'
> is
> only useful for ATA/IDE hard disk access, by the way -- it won't work for
> SATA
> or SCSI if I remember correctly.
>
> > Q2: If this is a Linux bug, should I try to reopen RedHat Bug 429774 or
> > submit a kernel bug report to kernel.org? (the bug occurs on Fedora 14
> > and Ubuntu 10.10)
>
> Maybe. It depends on why Linux is defaulting to using UDMA/33 mode in this
> case. It might be because of a known ATA controller quirk. Donno. Might be
> worth investigating the reason.
>
Chris, thanks for your reply. This Maxtor HDD doesn't have the option of
being configured for "single mode".
I posted this problem to the mailing list "linux-ide" at kernel.org. I
was surprised to learn that in addition to the
"linux-kernel-mailing-list", kernel.org sponsors several dozen
special-topic mailing lists such as linux-ide, linux-scsi, linux-acpi.
I got this reply from the maintainer of module pata-via:
=========================================================================================================
>
> My 133 MB/s PATA HDD is being configured for 33 MB/s due to incorrect
detection of a 40-wire cable.
You can force this (See Documentation)
> Q1: Is this problem most likely a faulty cable (I don't currently have
a second cable to try a substitution), a BIOS bug, or a Linux bug?
It's probably some weird combination of things. The board seems to have
a
real mix of devices and it's possible that in the case of a VIA PATA add
on chip on an ATI chipset the rules are different somewhere.
> Q2: What additional steps can I take to debug this problem?
Adding debug to drivers/ata/pata_via:via_cable_detect to see which path
it takes might be instructive. (I assume the disk is on the VIA
controller).
Cable clearly is ok as the BIOS detects both states properly.
================================================================================================================================
I would like to follow-up on his recommendation to my Q2, ie. add debug
to drivers/ata/pata_via:via_cable_detect. It is slightly beyond my
capabilities, but with help from this list, it is doable.
My guess is that I should add some printk statements to
via_cable_detect. (This outputs to /var/log/messages?). Where do I get a
makefile? Here is the source for via_cable_detect:
/**
* via_cable_detect - cable detection
* @ap: ATA port
*
* Perform cable detection. Actually for the VIA case the BIOS
* already did this for us. We read the values provided by the
* BIOS. If you are using an 8235 in a non-PC configuration you
* may need to update this code.
*
* Hotplug also impacts on this.
*/
static int via_cable_detect(struct ata_port *ap) {
const struct via_isa_bridge *config = ap->host->private_data;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u32 ata66;
if (via_cable_override(pdev))
return ATA_CBL_PATA40_SHORT;
if ((config->flags & VIA_SATA_PATA) && ap->port_no == 0)
return ATA_CBL_SATA;
/* Early chips are 40 wire */
if (config->udma_mask < ATA_UDMA4)
return ATA_CBL_PATA40;
/* UDMA 66 chips have only drive side logic */
else if (config->udma_mask < ATA_UDMA5)
return ATA_CBL_PATA_UNK;
/* UDMA 100 or later */
pci_read_config_dword(pdev, 0x50, &ata66);
/* Check both the drive cable reporting bits, we might not have
two drives */
if (ata66 & (0x10100000 >> (16 * ap->port_no)))
return ATA_CBL_PATA80;
/* Check with ACPI so we can spot BIOS reported SATA bridges */
if (ata_acpi_init_gtm(ap) &&
ata_acpi_cbl_80wire(ap, ata_acpi_init_gtm(ap)))
return ATA_CBL_PATA80;
return ATA_CBL_PATA40;
_______________________________________________
Mid-Hudson Valley Linux Users Group http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
Upcoming Meetings (6pm - 8pm) MHVLS Auditorium
Apr 6 - Introduction to IPv6
May 4 - Inkscape
Jun 1 - Zimbra