From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Alan <alan@lxorguk.ukuu.org.uk>
Cc: Linux IDE <linux-ide@vger.kernel.org>
Subject: Re: hwif->rw_disk() method
Date: Thu, 11 Jan 2007 16:38:55 +0300 [thread overview]
Message-ID: <45A63DEF.3010604@ru.mvista.com> (raw)
In-Reply-To: <20070110171015.5320fa17@localhost.localdomain>
Hello.
Alan wrote:
>> Alan/Bart/anybody, could you enlighten me why hwif->rw_disk() method came
>>into being at all?
> When you needed to wrap entire disk operations. The ->dma_ methods only
> wrap DMA commands.
BTW, I've looked at the clock turnaround code both in drivers/ide/hpt366.c
and drivers/ata/pata_hpt3x2n.c and compared it to the HighPoint driver and I'm
dazed and confused (again?): contrary to what HighPoint does (I'm not sure
they're still doing it at all due to confused nature of their drivers :-),
Linux uses DPLL on reads and PCI clock on writes. The libata driver seem to
have an explicit contradiction:
static int hpt3x2n_use_dpll(struct ata_port *ap, int reading)
{
long flags = (long)ap->host->private_data;
/* See if we should use the DPLL */
if (reading == 0)
return USE_DPLL; /* Needed for write */
if (flags & PCI66)
return USE_DPLL; /* Needed at 66Mhz */
return 0;
}
static unsigned int hpt3x2n_qc_issue_prot(struct ata_queued_cmd *qc)
{
struct ata_taskfile *tf = &qc->tf;
struct ata_port *ap = qc->ap;
int flags = (long)ap->host->private_data;
if (hpt3x2n_pair_idle(ap)) {
int dpll = hpt3x2n_use_dpll(ap, (tf->flags & ATA_TFLAG_WRITE));
if ((flags & USE_DPLL) != dpll) {
if (dpll == 1)
hpt3x2n_set_clock(ap, 0x21);
else
hpt3x2n_set_clock(ap, 0x23);
}
}
return ata_qc_issue_prot(qc);
}
ATA_TFLAG_WRITE indicates a write transfer (host-to-device) while
hpt3x2n_use_dpll() contrarywise expects the read transfer indication. Comments?
WBR, Sergei
next prev parent reply other threads:[~2007-01-11 13:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-10 16:30 hwif->rw_disk() method Sergei Shtylyov
2007-01-10 17:10 ` Alan
2007-01-10 17:05 ` Sergei Shtylyov
2007-01-10 21:47 ` Bartlomiej Zolnierkiewicz
2007-01-11 13:38 ` Sergei Shtylyov [this message]
2007-01-12 10:27 ` Alan
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=45A63DEF.3010604@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--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 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.