linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jeff Garzik <jeff@garzik.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: [PATCH 3/3] pata_amd: fix and improve cable detection
Date: Sat, 03 Nov 2007 09:35:03 +0900	[thread overview]
Message-ID: <472BC237.8040008@gmail.com> (raw)
In-Reply-To: <20071103001018.5a71bfd3@the-village.bc.nu>

Alan Cox wrote:
>> all we can use is how the BIOS configured it.  I suppose BIOS does it by
>> issuing trial commands which I don't think adding to libata is a good idea.
> 
> The BIOS does it by asking the hardware somehow. I traced one or two
> BIOSes that far. The info is there but its not documented in the
> slightest so only ACPI makes it visible via the BIOS.

OIC, gawdddddddd... What was so long with just following what those
AMD chips did?

>> Can you please lemme know what you don't like about the current
>> implementation or what other approach you have in mind?  I don't like
>> Nvidia PATA either but there are a lot of people using it out there.
> 
> We seem to be able to trust the drives and BIOS ACPI data for Nvidia (at
> least what I have seen), so I guess we should simply declare the cable
> type unknown, 80 wire if ACPI says it is and then do the drive detect
> side ?

There are machines with broken BIOSen so actually the most reliable
source is the UDMA timing register.  On ASUS A8N-E, ACPI and UDMA
timing register always concur.  I think it's best to look at both not
so much for accuracy but for debugging, so the following printk in the
patch.

+	if (ap->pflags & ATA_PFLAG_INIT_GTM_VALID)
+		snprintf(acpi_str, sizeof(acpi_str), " (%u:%u:0x%x)",
+			 ap->acpi_init_gtm.drive[0].dma,
+			 ap->acpi_init_gtm.drive[1].dma,
+			 ap->acpi_init_gtm.flags);
+
+	ata_port_printk(ap, KERN_DEBUG, "nv_cable_detect: native=%d (0x%x) "
+			"BIOS=%d (0x%x) ACPI=%d%s verdict=%d\n",
+			native_cbl, ata66, bios_cbl, saved_udma, acpi_cbl,
+			acpi_str, verdict);

When cable detection goes wrong, we'll at least know what all those
different sources are telling.

Thanks.

-- 
tejun

  reply	other threads:[~2007-11-03  0:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-02 15:20 [PATCH 1/3] libata: implement dev->acpi_init_gtm Tejun Heo
2007-11-02 15:21 ` [PATCH 2/3] libata: extend ata_acpi_cbl_80wire() and fix cable detection in pata_via and pata_amd Tejun Heo
2007-11-02 15:22   ` [PATCH 3/3] pata_amd: fix and improve cable detection Tejun Heo
2007-11-02 15:44     ` Alan Cox
2007-11-02 22:22       ` Tejun Heo
2007-11-03  0:10         ` Alan Cox
2007-11-03  0:35           ` Tejun Heo [this message]
2007-11-03  0:42           ` Tejun Heo
2007-11-02 15:42   ` [PATCH 2/3] libata: extend ata_acpi_cbl_80wire() and fix cable detection in pata_via and pata_amd Alan Cox
2007-11-02 22:18     ` Tejun Heo
2007-11-02 23:45       ` Alan Cox
2007-11-03  0:46         ` Tejun Heo
2007-11-03  1:12           ` Alan Cox
2007-11-03  1:16             ` Tejun Heo
2007-11-03  1:23               ` Alan Cox
2007-11-03  7:03                 ` Tejun Heo
2007-11-03  0:57     ` Bartlomiej Zolnierkiewicz
2007-11-03  1:12       ` Bartlomiej Zolnierkiewicz
2007-11-02 15:36 ` [PATCH 1/3] libata: implement dev->acpi_init_gtm Jeff Garzik
2007-11-02 22:12   ` Tejun Heo
2007-11-03  7:10     ` Tejun Heo
2007-11-03 12:33       ` Jeff Garzik
2007-11-02 15:44 ` Alan Cox
2007-11-02 22:08   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=472BC237.8040008@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).