From: Duncan Laurie <void@sun.com>
To: linux-kernel@vger.kernel.org
Cc: Oliver Feiler <kiza@gmxpro.net>, Andre Hedrick <andre@linuxdiskcert.org>
Subject: Re: HPT370 controller set wrong udma mode
Date: Sat, 12 Jan 2002 21:47:05 -0800 [thread overview]
Message-ID: <20020113054705.GA2160@sun.com> (raw)
On Thu, Jan 10 2002, Oliver Feiler wrote:
>
> Alan Cox wrote:
> > Make sure you use the Andre Hedrick ide patches with the HPT 370. That fixed
> > all my problems with them at least
> > (http://www.linux-ide.org)
>
> Didn't solve my problem unfortunately.
>
> With the patch applied, the kernel still says it uses UDMA(66) on boot
> and hdparm also says the drive is in udma4 mode. Writing data to it results in
> BadCRC.
>
> However, /proc/ide/hpt366 with the patch applied shows ATA-33 mode.
> Something's wrong here.
>
> CC'ing this to Andre Hedrick. Maybe he knows what's wrong?
>
Try this patch... apply it after the latest patch from Andre becuase that
includes several other crucial highpoint fixes. It looks like the cable
detect pins are also used as address lines and so must be configured as
inputs to read valid cable detect state.
-duncan
--- linux/drivers/ide/hpt366.c~ Thu Jan 10 17:08:01 2002
+++ linux/drivers/ide/hpt366.c Thu Jan 10 17:10:17 2002
@@ -1140,7 +1140,21 @@
byte ata66 = 0;
byte regmask = (hwif->channel) ? 0x01 : 0x02;
- pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66);
+ if (pci_rev_check_hpt3xx(hwif->pci_dev)) {
+ byte scr2;
+ /*
+ * The HPT370 uses the CBLID pin outputs as MA15/MA16
+ * address lines to access an external eeprom. To
+ * read cable detect state the pins must be enabled
+ * as inputs by clearing bit 0 of reg 0x5b.
+ */
+ pci_read_config_byte(hwif->pci_dev, 0x5b, &scr2);
+ pci_write_config_byte(hwif->pci_dev, 0x5b, scr2 & ~1);
+ pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66);
+ pci_write_config_byte(hwif->pci_dev, 0x5b, scr2 | 1);
+ } else {
+ pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66);
+ }
#ifdef DEBUG
printk("HPT366: reg5ah=0x%02x ATA-%s Cable Port%d\n",
ata66, (ata66 & regmask) ? "33" : "66",
next reply other threads:[~2002-01-13 5:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-13 5:47 Duncan Laurie [this message]
2002-01-13 12:23 ` HPT370 controller set wrong udma mode Oliver Feiler
-- strict thread matches above, loose matches on Subject: below --
2002-01-10 15:07 Oliver Feiler
2002-01-10 15:12 ` Rik van Riel
2002-01-10 15:51 ` Alan Cox
2002-01-10 17:48 ` Oliver Feiler
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=20020113054705.GA2160@sun.com \
--to=void@sun.com \
--cc=andre@linuxdiskcert.org \
--cc=kiza@gmxpro.net \
--cc=linux-kernel@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