From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org,
linux-ide@vger.kernel.org, jeff@garzik.org
Subject: Re: [PATCH] pata_hpt37x: Fix 2.6.22 clock PLL regression
Date: Tue, 24 Jul 2007 19:04:43 +0400 [thread overview]
Message-ID: <46A6150B.2030809@ru.mvista.com> (raw)
In-Reply-To: <20070724151748.7e99f4f0@the-village.bc.nu>
Hello.
Alan Cox wrote:
> Just one version of Linux ago
> The PLL code broke - oh no!
> But set the right mode
> And fix up the code
> Makes the PLL timing sync go
/me applauds :-)
> Closes-bug: #8791
> Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
However, I found it strange that HPT374 against which was that bug report
works with 66 MHz DPLL clock -- while I've recently forbidden that clock in
the IDE driver because it was causing DMA timeouts.
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.23rc1/drivers/ata/pata_hpt37x.c linux-2.6.23rc1/drivers/ata/pata_hpt37x.c
> --- linux.vanilla-2.6.23rc1/drivers/ata/pata_hpt37x.c 2007-07-23 12:56:11.000000000 +0100
> +++ linux-2.6.23rc1/drivers/ata/pata_hpt37x.c 2007-07-23 14:44:39.000000000 +0100
> @@ -26,7 +26,7 @@
> #include <linux/libata.h>
>
> #define DRV_NAME "pata_hpt37x"
> -#define DRV_VERSION "0.6.6"
> +#define DRV_VERSION "0.6.7"
>
> struct hpt_clock {
> u8 xfer_speed;
> @@ -1103,17 +1103,17 @@
>
> /* Select the DPLL clock. */
> pci_write_config_byte(dev, 0x5b, 0x21);
> - pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
> + pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100);
Heh, was quite a silly mistake. :-)
> for(adjust = 0; adjust < 8; adjust++) {
> if (hpt37x_calibrate_dpll(dev))
> break;
> /* See if it'll settle at a fractionally different clock */
> - if ((adjust & 3) == 3) {
> - f_low --;
> - f_high ++;
> - }
> - pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
> + if (adjust & 1)
> + f_low -= adjust >> 1;
> + else
> + f_high += adjust >> 1;
> + pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100);
OK, I'm seeing that the "oldie but goodie" calibration algrithm has
finally found its way to the libata driver too. :-)
MBR, Sergei
next prev parent reply other threads:[~2007-07-24 15:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 14:17 [PATCH] pata_hpt37x: Fix 2.6.22 clock PLL regression Alan Cox
2007-07-24 15:04 ` Sergei Shtylyov [this message]
2007-07-24 20:56 ` Jeff Garzik
2007-07-24 23:07 ` Linus Torvalds
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=46A6150B.2030809@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.