linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Sealey <matt@genesi-usa.com>
To: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-ide@vger.kernel.org
Subject: Re: how to handle pata_via when controller not in fully-pci-native mode (two irqs?)
Date: Tue, 03 Jul 2007 09:11:12 +0100	[thread overview]
Message-ID: <468A04A0.1020003@genesi-usa.com> (raw)
In-Reply-To: <4689FBCB.90608@gmail.com>



Tejun Heo wrote:
> Matt Sealey wrote:
>> I'm a litle confused here.
>>
>> Page 10 (4.2.1) so I just mask off bit 0 and bit 2 of the class prog-if byte and set
>> it to "compatible" mode which will basically mean PCI mapped registers and
>> two IRQs? This corresponds with the table on Page 7 (4.2.1.1)..
>>
>> Checked the Pegasos IDE class code and in the firmware it's set to 0x1018F so, I
>> would assume the correct value is 0x1018A (knocking out the "native mode").
>>
>> Okay! Great. This looks easy. Just gotta decode PCI addresses in Forth now..
> 
> I think I wrote this in the bugzilla entry but my memory is fuzzy as
> always, so I'll repeat it here.  If you turn off the native bits,
> libata-sff will use ATA_PRIMARY_CMD and its friends to determine IO
> ports and ATA_PRIMARY_IRQ and friends to determine IRQs.  PCI BAR is
> only used to determine IO ports for BMDMA register.
> 
> ie. The legacy mode means "there's no standard way to configure the damn
> thing.  Just believe what the arch code says.  However, BMDMA is
> introduced after PCI so let's use PCI BAR for it."  So, if you're gonna
> make the controller legacy (which I think is the correct way), don't
> forget to update those arch macros.

So we actually have to fix up some platform support for it? That's not very
nice.

We can't make the controller TRULY legacy since there is not any good way
of mapping the IDE/BMDMA registers into the lower kilobyte or so of
memory - obviously PPC has no "io address space", it's all memory mapped,
so the lower kilobyte of "IO ports" is really the CPU zero page. It's not
a good idea to be poking around just there and we never intended that to work.

However the VT8231 (and probably all the Via chips) do happily operate in
"native PCI mode" with the line register reporting 14 or 10, and IRQ steering
still set to two IRQs (10/11 or 14/15 or some combination). You might
consider this an ATA specification violation or a chipset bug, but it
does in fact work.. my original patch handled it as a quirk (it is a
quirk, a very strange way of operating..) - isn't there a way we can get
the same kind of quirky fix in libata or are we being super-clean about
it?

The patch I made for the old IDE driver looks to be a clumsy version of
what some of libata-sff does in ata_pci_init_one and ata_pci_probe_ent
and maybe a little bit of ata_pci_init_native_mode.

Is it possible to perhaps replace ata_pci_init_one with a custom
function which handles this (in pata_via.c) quirky behaviour and
#ifdef it out with a Kconfig variable? CONFIG_ATA_VIA_HALFNATIVE_QUIRK
or something? I think that would be best. Everyone can ignore it
and distributions building for Pegasos can enable it.. but I think
"fixing" IDE chipset quirks by reconfiguring the chipset in some
platform support code is the wrong place. It either needs to be
set up properly in firmware (breaking ide/via82cxxx.c in the process
and therefore any old kernels anyone is running. We don't want to
impose a kernel upgrade with our firmware upgrades..) or fixed
in the IDE driver (libata and it's drivers are eminently updatable
by unloading modules, whereas platform support is a reboot job..)

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

  reply	other threads:[~2007-07-03  8:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-23  0:26 how to handle pata_via when controller not in fully-pci-native mode (two irqs?) Matt Sealey
2007-06-23  4:23 ` Jeff Garzik
2007-06-23  9:33 ` Alan Cox
2007-06-23  9:33   ` Matt Sealey
2007-06-23  9:53     ` Alan Cox
2007-06-23 10:11       ` Matt Sealey
2007-07-03  7:33         ` Tejun Heo
2007-07-03  8:11           ` Matt Sealey [this message]
2007-07-03  9:21             ` Tejun Heo
2007-07-03 12:44               ` Matt Sealey
2007-07-03 12:17             ` Alan Cox
2007-07-03 12:32               ` Matt Sealey
2007-07-03 13:38                 ` Alan Cox
2007-07-03 13:41                   ` Matt Sealey
2007-07-03 13:53                     ` Jeff Garzik
2007-07-03 14:00                       ` Matt Sealey
2007-07-03 15:08                         ` Jeff Garzik
2007-07-03 13:53                     ` Alan Cox
2007-07-03 13:54                       ` Matt Sealey
2007-07-04  8:55                         ` Tejun Heo
2007-07-04 19:08                           ` Matt Sealey
2007-07-05  2:28                             ` 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=468A04A0.1020003@genesi-usa.com \
    --to=matt@genesi-usa.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=htejun@gmail.com \
    --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).