From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, mlord@pobox.com,
albertcc@tw.ibm.com, uchang@tw.ibm.com, forrest.zhao@intel.com,
brking@us.ibm.com, linux-ide@vger.kernel.org, htejun@gmail.com
Subject: [PATCHSET] libata: implement new initialization model w/ iomap support, take 2
Date: Sat, 19 Aug 2006 17:57:04 +0900 [thread overview]
Message-ID: <11559778241753-git-send-email-htejun@gmail.com> (raw)
In-Reply-To:
Hello, all.
This is the second take of new-init-model patchset. This patchset
implements new init model for libata LLDs. Changes from the last
take[L] are...
* Adapted to drivers/ata relocation, SAS update and pending grand
renaming.
* legacy / pci helpers made modular and lives in their own file
libata-legacy.c and libata-pci.c respectively.
* IRQ helpers made modular.
* MSIX IRQ helpers added.
* Static legacy ports table removed as Alan pointed out.
Legacy handling is moularized into libata-legacy.c and PCI helpers use
the module. If other bus helpers wanna use it, it just has to select
CONFIG_ATA_LEGACY and call helpers as PCI does.
Instead of subclassing ata_host and make ata_legacy_host and/or
ata_pci_host, I simply added two needed fields - legacy_flags and
pci_flags. Rationale: that's all that's needed && with further
modularization, we'll probably need some form of multiple-inheritence
which can't be done with C-style wrapping-up subclassing. IMHO,
waiting and seeing how things develop and updating basic data
structure organization accordingly is the way to go. So, the minimal
approach on this patchset.
Now that it's merged after such a long wait, I really didn't want to
break SAS support and kept probe_ent and ata_port_init() for SAS
helpers, so there's a bit of duality there ATM.
Brian, can you please take a look at how LLDs use new init functions
and see if SAS can use the same approach? If you pass NULL as @sht to
ata_host_alloc(), it won't associate ports as part of Scsi_Host just
as ata_sas_port_alloc() does and ata_host_free() will do the right
thing when freeing a host allocated that way.
sata_sil24.c is a pretty straight-forward example. If you can't
determine the number of ports when allocating host, please take a look
at how ahci.c initializes its host.
The intention was to allow SAS to use all the regular init/deinit
functions just as other LLDs. If something doesn't seem to be right,
please let me know.
Jeff, I privately did PATA support on sata_promise.c and it looks good
and works well (tested with PDC20375). If this patchset gets ACKed,
I'll post that patch against sata_promise.c.
The new init model has the following benefits.
* Consistency across different LLDs
Provide helpers such that common codes live in one place and init
sequence doesn't have to be creative.
* Flexibility and easy code sharing with suspend/resume
Instead of using probe_ent, allocate host_set and initialize it
directly. This removes many restrictions of probe_ent and allows
LLDs to share init/remove codes with suspend/resume easily as they
use the same target data structure.
IRQ management is also moved out of libata-core into libata-pci
helpers which LLDs can use or override at will.
* More bookkeeping in libata-core, less in LLDDs
Acquired resources are tracked by libata-core and helpers. e.g. LLD
doesn't have to remember which resources it has acquired, it can
simply tell libata to release all resources on error path and driver
detachments. This simplies LLDs and fixes several dangling resource
and double-free bugs.
* Support for iomap
As with all other PCI resources, both PIO and mmio areas are managed
by libata PCI helpers. iomaps are automatically created on IO
resource acqusition and destroyed on release. LLDs can simply
request which BARs it intends to use. The rest is handled by
libata PCI helpers.
This patchset has been tested on
* ata_piix : ICH7R, most combinations and w/ induced resource
allocation errors
* ahci : ICH7R
* sata_sil : sil3112, sil3114
* sata_sil24 : sil3124, sil3132
* sata_via : vt6420 (via C3)
* pdc_adma : as broken as previous
* sata_promise : PDC20375, tested w/ PATA port too (PATA bits not
included in this post)
If you have any controller which use one of the following drivers,
please test and report.
* sata_svw
* sata_sx4
* sata_uli
* sata_vsc
* sata_sis
* sata_qstor
* sata_nv (I can do this later)
* sata_mv
If this patchset is agreed upon, I'll update #pata-drivers
accordingly.
This patchset is against
[U] upstream
[1] + grand-renaming patch
[2] + pci-quirks-CONFIG_ATA-fixup patch
This patchset is avaliable in the following git tree.
http://htj.dyndns.org/git/?p=libata-tj.git;a=shortlog;h=new-init
git://htj.dyndns.org/libata-tj new-init
Thanks.
--
tejun
[L] http://article.gmane.org/gmane.linux.ide/12437
[U] 421b20b9c44b3fcdc07d6af875dad5ae86fad014
[1] http://htj.dyndns.org/git/?p=libata-tj.git;a=commit;h=a8e3784a8a479e3cf82a17cb25419b05f916d53f
[2] http://article.gmane.org/gmane.linux.ide/12733
next reply other threads:[~2006-08-19 8:57 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-19 8:57 Tejun Heo [this message]
2006-08-19 8:59 ` [PATCH 1/20] libata: kill ata_host_stop() Tejun Heo
2006-08-19 14:51 ` Jeff Garzik
2006-08-19 15:29 ` Tejun Heo
2006-09-19 4:46 ` Jeff Garzik
2006-09-19 4:50 ` Tejun Heo
2006-08-19 8:59 ` [PATCH 2/20] libata: implement ata_host_start/stop() Tejun Heo
2006-08-19 8:59 ` [PATCH 4/20] libata: separate out ata_host_alloc() and ata_host_attach() Tejun Heo
2006-09-19 5:08 ` Jeff Garzik
2006-09-19 5:48 ` Tejun Heo
2006-08-19 8:59 ` [PATCH 7/20] libata: implement PCI ATA init helpers Tejun Heo
2006-09-19 5:29 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 6/20] libata: implement legacy " Tejun Heo
2006-09-19 5:26 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 5/20] libata: implement several LLD " Tejun Heo
2006-08-22 22:11 ` Brian King
2006-08-27 9:52 ` Tejun Heo
2006-08-30 21:16 ` Brian King
2006-09-19 5:16 ` Jeff Garzik
2006-09-19 5:57 ` Tejun Heo
2006-08-19 8:59 ` [PATCH 3/20] libata: implement ata_host_detach() and ata_host_free() Tejun Heo
2006-09-19 4:59 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 12/20] libata: kill old init helpers Tejun Heo
2006-08-19 8:59 ` [PATCH 8/20] libata: reimplement ata_pci_init_one() using new " Tejun Heo
2006-09-19 5:32 ` Jeff Garzik
2006-09-19 6:04 ` Tejun Heo
2006-09-19 6:09 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 11/20] libata: use remove_one() for deinit instead of ->host_stop() Tejun Heo
2006-09-19 5:42 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 10/20] libata: reimplement ata_pci_remove_one() using new PCI init helpers Tejun Heo
2006-08-19 8:59 ` [PATCH 13/20] libata: kill unused ->host_stop() operation and related functions Tejun Heo
2006-09-19 5:42 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 17/20] libata: make ata_pci_acquire_resources() handle iomap Tejun Heo
2006-09-19 5:47 ` Jeff Garzik
2006-09-19 6:27 ` Tejun Heo
2006-09-19 6:32 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 14/20] libata: use LLD name where possible Tejun Heo
2006-09-19 5:43 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 15/20] libata: move ->irq_handler from port_ops to port_info Tejun Heo
2006-09-19 5:43 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 16/20] libata: make ata_host_alloc() take care of hpriv alloc/free Tejun Heo
2006-09-19 5:45 ` Jeff Garzik
2006-08-19 8:59 ` [PATCH 19/20] libata: kill unused ATA_FLAG_MMIO Tejun Heo
2006-08-19 8:59 ` [PATCH 20/20] libata: move scattered PCI ATA functions into liata-pci.c Tejun Heo
2006-09-19 5:50 ` Jeff Garzik
2006-08-22 22:10 ` [PATCHSET] libata: implement new initialization model w/ iomap support, take 2 Brian King
2006-08-27 10:12 ` Tejun Heo
2006-08-30 20:58 ` Brian King
2006-09-01 13:45 ` Tejun Heo
2006-09-07 13:22 ` Brian King
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=11559778241753-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertcc@tw.ibm.com \
--cc=brking@us.ibm.com \
--cc=forrest.zhao@intel.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=mlord@pobox.com \
--cc=uchang@tw.ibm.com \
/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).