linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <htejun@gmail.com>
Cc: alan@lxorguk.ukuu.org.uk, mlord@pobox.com, albertcc@tw.ibm.com,
	uchang@tw.ibm.com, forrest.zhao@intel.com,
	linux-ide@vger.kernel.org
Subject: Re: [PATCH 05/17] libata: implement PCI init helpers for new LLD init model
Date: Wed, 09 Aug 2006 02:41:12 -0400	[thread overview]
Message-ID: <44D98388.8030005@pobox.com> (raw)
In-Reply-To: <44D9782A.30405@gmail.com>

Tejun Heo wrote:
> Jeff Garzik wrote:
>> This is definitely the wrong direction.
> 
> Ouch...  The whole patch?
> 
>> We don't want to keep crowding knowledge of multiple bus technologies 
>> into the same function.
> 
> Do you mean PCI-IDE (legacy/BMDMA), PCI-native and newer controllers 
> (including MSI stuff)?  Bus-wise they're all PCI.

ata_generic, ISA, VLB, and embedded controllers that use libata are not 
PCI.  libata-bmdma can drive older non-PCI controllers.

Its a bit confusing because "PCI IDE" is often used to refer to the 
legacy IDE shadow register interface.  I started to use "bmdma" to 
describe the interface, but it drives Alan crazy :)


>> ata_pci_request_irq() and other code above follows the same theme... 
>> but its an unmaintainable direction.
>>
>> This sort of stuff needs to be split up, not coalesced.
> 
> ata_pci_*() functions are PCI helpers and I wanted to move most of PCI 
> resource bookkeeping into helpers.  Less clutter in LLDs and less errors.

Putting legacy IDE resource allocation and ultra-modern (MSI) resource 
allocation in the same function is the wrong direction.

Legacy LLDDs should not be traversing code that has to worry about PCI 
MSI, and PCI MSI controllers should not be traversing code paths that 
deal with legacy IDE.

I'm looking forward to having ARM and PowerMac IDE drivers ported to 
libata soon, and we don't need to be adding special ARM/PPC bus handling 
stuff to these already-gigantic resource routines.


>> Another thing to think about:  IMO it makes sense to separate out the 
>> PCI IDE resource handling, because that set of technology is largely 
>> static.
>  >
>> Most newer controllers will only have a few resources, normally MMIO, 
>> and may even support MSI-X (multiple messages for different event 
>> types, rather than a single message for all events like MSI).
>>
>> So, I'd like to see some of this inside libata-bmdma.c to keep the 
>> core free of such nastiness.
> 
> I'm having a little bit difficult time following what you're thinking. 
> Whatever the final interface is, the goals would be similar to what's 
> listed in the head message of this patchset, and I think 
> alloc/init/attach model is a good way to achieve that thus killing 
> probe_ent.  Can you explain in more detail how the interface should look 
> like?

Killing probe_ent is a good thing, definitely.  Ideally we should have 
an interface for the LLDD like

	host_set = alloc_ata()
	[ fill in host_set ]
	rc = register_ata()
	...
	unregister_ata()
	free_ata()

Additionally, to take into account strange resource allocation stuff, 
BMDMA drivers should eventually do

	host_set = alloc_bmdma()
	[ fill in host_set ]
	rc = register_bmdma()
	...
	unregister_bmdma()
	free_bmdma()

That keeps all the legacy IDE crap out of the core completely.

Overall, your movement towards killing probe_ent and filling in host_set 
directly is a good one, as I illustrate above.  But lumping all the 
resource allocation and irq registration into a few big functions is the 
wrong direction.  Consider for example an LLDD that supports MSI-X in 
your design.  That's a good proof of concept.

	Jeff



  reply	other threads:[~2006-08-09  6:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-07  3:03 [PATCHSET] libata: implement new initialization model w/ iomap support Tejun Heo
2006-08-07  3:04 ` [PATCH 01/17] libata: implement ata_host_set_start/stop() Tejun Heo
2006-08-09  4:57   ` Jeff Garzik
2006-08-07  3:04 ` [PATCH 02/17] libata: implement ata_host_set_detach() and ata_host_set_free() Tejun Heo
2006-08-09  4:59   ` Jeff Garzik
2006-08-07  3:04 ` [PATCH 06/17] libata: reimplement ata_pci_init_one() using new init helpers Tejun Heo
2006-08-07  3:04 ` [PATCH 03/17] libata: separate out ata_host_set_alloc() and ata_host_set_attach() Tejun Heo
2006-08-09  5:00   ` Jeff Garzik
2006-08-07  3:04 ` [PATCH 04/17] libata: implement several LLD init helpers Tejun Heo
2006-08-09  5:01   ` Jeff Garzik
2006-08-09  5:08     ` Tejun Heo
2006-08-07  3:04 ` [PATCH 05/17] libata: implement PCI init helpers for new LLD init model Tejun Heo
2006-08-09  5:11   ` Jeff Garzik
2006-08-09  5:52     ` Tejun Heo
2006-08-09  6:41       ` Jeff Garzik [this message]
2006-08-09 11:00         ` Alan Cox
2006-08-10  7:12           ` Albert Lee
2006-08-10  7:27             ` Jeff Garzik
2006-08-10 12:36               ` Alan Cox
2006-08-10 12:22                 ` Tejun Heo
2006-08-09 12:54         ` Mark Lord
2006-08-09 11:02     ` Alan Cox
2006-08-09 11:13       ` Tejun Heo
2006-08-07  3:04 ` [PATCH 09/17] libata: use remove_one() for deinit instead of ->host_stop() Tejun Heo
2006-08-07  3:04 ` [PATCH 10/17] libata: kill old init helpers Tejun Heo
2006-08-07  3:04 ` [PATCH 08/17] libata: update ata_pci_remove_one() using new PCI " Tejun Heo
2006-08-07  3:04 ` [PATCH 11/17] libata: kill unused ->host_stop() operation and related functions Tejun Heo
2006-08-07  3:04 ` [PATCH 12/17] libata: use LLD name where possible Tejun Heo
2006-08-07  3:04 ` [PATCH 13/17] libata: move ->irq_handler from port_ops to port_info Tejun Heo
2006-08-07  3:04 ` [PATCH 15/17] libata: make ata_pci_acquire_resources() handle iomap Tejun Heo
2006-08-07  3:04 ` [PATCH 14/17] libata: make ata_host_set_alloc() take care of hpriv alloc/free Tejun Heo
2006-08-07  3:04 ` [PATCH 17/17] libata: kill unused ATA_FLAG_MMIO Tejun Heo
2006-08-07  3:08 ` [git-patches] libata: implement new initialization model w/ iomap support 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=44D98388.8030005@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=albertcc@tw.ibm.com \
    --cc=forrest.zhao@intel.com \
    --cc=htejun@gmail.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).