From: Alan <alan@lxorguk.ukuu.org.uk>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Linus Torvalds <torvalds@osdl.org>,
Alessandro Suardi <alessandro.suardi@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] libata: fix combined mode (was Re: Happy New Year (and v2.6.20-rc3 released))
Date: Wed, 3 Jan 2007 00:36:35 +0000 [thread overview]
Message-ID: <20070103003635.626cdfb3@localhost.localdomain> (raw)
In-Reply-To: <459AEE36.7080500@pobox.com>
> 1) Programmatically reserve /all/ resources associated with
> our PCI device
> 2) Manually reserve resources associated with our PCI device,
> but are not listed in struct pci_dev.
Which it doesn't actually do. You reserve 0x1F0-0x1F7 but forget the
other register. BTW on unload you forget to release 0x1F0-7 too. I've not
fixed that as its not a regression just a bug. It's just another symptom
of a pile of code trying to do things the wrong way, in the wrong place.
> But then 2.6.21 goes back to:
>
> 1) Programmatically reserve /all/ resources associated with
> our PCI device
> 2) Manually reserve resources associated with our PCI device,
> but are not listed in struct pci_dev.
Nope. You are either very confused about how PCI bus resources work or
you are trying to implement the future code in a very very peculiar way 8)
Remember with the resource tree now correct all the resources for an IDE
controller *are* in the pci_dev struct properly - the special cases are
all gone in libata and in drivers/ide.
Once combined mode is fixed not to abuse resources (and it originally
did it that way for a good reason I grant and am not criticising that) the
entire management for legacy mode, mixed mode and native mode resources
for an ATA device (including 0x170, 0x3F6 and other wacky magic) becomes
if (pci_request_regions(pdev, "libata")) ...
You'll note:
- No special cases for differing modes
- No libata knowledge of PCI legacy mapping rules and addresses
- The death of the magic ATA_PRIMARY/SECONDARY constants and their magic
numbers
- Support for platforms that map legacy space differently
- Trivial cleanup from failure unlike the current code
all in one line. This will also fix all the existing bugs where unloading
a libata driver fails to free resources as pci_release_regions() will also
now do the correct thing.
*That* is one key reason why getting the PCI resource map right is so
important. We turn fifty lines of bug ridden hard to debug code into one
line of code that actually does more than the original, and gets it
right. For free we get the leaked resources after rmmod fixed, we get the
mixed mode resources fixed, we get all this stuff for free. We get to
shoot a chunk of code in drivers/ide if we want as well.
If we want to keep a combined mode in 2.6.21 with drivers/ide (which
seems dumb as libata has progressed far beyond the need for it) then the
-mm tree has a pci_request_regions_mask() function which we can push
to .21 development and we end up with five lines not three for these
cases.
Make sense ?
Alan
next prev parent reply other threads:[~2007-01-03 0:27 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-01 1:19 Happy New Year (and v2.6.20-rc3 released) Linus Torvalds
2007-01-01 1:39 ` Gene Heskett
2007-01-01 2:40 ` Alexey Dobriyan
2007-01-01 7:22 ` Cyrill V. Gorcnov
[not found] ` <4598BC0F.6070003@vc.cvut.cz>
2007-01-01 9:41 ` Cyrill V. Gorcnov
2007-01-02 2:19 ` H. Peter Anvin
2007-01-01 11:29 ` Arkadiusz Miskiewicz
2007-01-01 13:28 ` Alessandro Suardi
2007-01-01 20:13 ` Linus Torvalds
2007-01-01 20:49 ` Jeff Garzik
2007-01-01 21:31 ` Alan
2007-01-01 23:34 ` Linus Torvalds
2007-01-02 2:32 ` Theodore Tso
2007-01-02 11:58 ` [PATCH] libata: fix combined mode (was Re: Happy New Year (and v2.6.20-rc3 released)) Alan
2007-01-02 12:07 ` Alessandro Suardi
2007-01-02 14:00 ` Alan
2007-01-02 16:12 ` Theodore Tso
2007-01-02 21:00 ` Jeff Garzik
2007-01-02 21:27 ` Alan
2007-01-02 21:29 ` Jeff Garzik
2007-01-02 21:32 ` Jeff Garzik
2007-01-02 22:48 ` Alan
2007-01-02 22:45 ` Alan
2007-01-02 23:01 ` Jeff Garzik
2007-01-02 23:27 ` Alan
2007-01-02 23:43 ` Jeff Garzik
2007-01-03 0:36 ` Alan [this message]
2007-01-03 1:02 ` Jeff Garzik
2007-01-02 23:54 ` Jeff Garzik
2007-01-03 0:39 ` Alan
2007-01-02 23:04 ` Jeff Garzik
2007-01-03 19:59 ` Steve Wise
2007-01-01 21:26 ` Happy New Year (and v2.6.20-rc3 released) Alan
2007-01-02 16:09 ` Linus Torvalds
2007-01-01 15:52 ` Olaf Hering
2007-01-02 19:16 ` 2.6.20-rc3: known unfixed regressions Adrian Bunk
2007-01-03 18:15 ` Steve Youngs
2007-01-03 20:03 ` Adrian Bunk
2007-01-02 19:24 ` 2.6.20-rc3: known regressions with patches available (part 1) Adrian Bunk
2007-01-02 19:26 ` Jens Axboe
2007-01-02 19:34 ` Adrian Bunk
2007-01-02 20:45 ` Rene Herman
2007-01-02 20:51 ` Jens Axboe
2007-01-02 19:30 ` 2.6.20-rc3: known regressions with patches available (part 2) Adrian Bunk
2007-01-03 19:06 ` [2.6.20-rc3] INFO: possible recursive locking detected (was: Happy New Year (and v2.6.20-rc3 released)) Tilman Schmidt
2007-01-03 20:59 ` 2.6.20-rc3: known unfixed regressions (v2) Adrian Bunk
2007-01-04 13:23 ` Horst H. von Brand
2007-01-03 21:04 ` 2.6.20-rc3: known regressions with patches (v2) Adrian Bunk
2007-01-03 21:30 ` Jiri Kosina
2007-01-03 21:32 ` Jiri Kosina
2007-01-04 17:46 ` 2.6.20-rc3: known unfixed regressions (v3) Adrian Bunk
2007-01-04 18:13 ` Matthew Wilcox
2007-01-05 0:25 ` Horst H. von Brand
2007-01-06 21:04 ` 2.6.20-rc3: known unfixed regressions (v4) Adrian Bunk
2007-01-06 22:06 ` Brice Goglin
2007-01-07 23:49 ` Adrian Bunk
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=20070103003635.626cdfb3@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=alessandro.suardi@gmail.com \
--cc=jgarzik@pobox.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox