linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: brking@us.ibm.com
Cc: jgarzik@pobox.com, 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 5/20] libata: implement several LLD init helpers
Date: Sun, 27 Aug 2006 18:52:43 +0900	[thread overview]
Message-ID: <44F16B6B.7050207@gmail.com> (raw)
In-Reply-To: <44EB8111.4090901@us.ibm.com>

Hello, Brian.

Brian King wrote:
> Tejun Heo wrote:
> 
>> +static void __ata_host_init_pinfo(struct ata_host *host,
>> +				  const struct ata_port_info **pinfo,
>> +				  int n_ports, int pi_is_ar)
>> +{
>> +	int i;
>> +
>> +	if (host->private_data == NULL)
>> +		host->private_data = pinfo[0]->private_data;
>> +	host->ops = pinfo[0]->port_ops;
>> +
>> +	for (i = 0; i < host->n_ports; i++) {
>> +		struct ata_port *ap = host->ports[i];
>> +		const struct ata_port_info *pi;
>> +
>> +		if (pi_is_ar)
>> +			pi = pinfo[i];
>> +		else
>> +			pi = pinfo[0];
>> +
> 
> 
>> +		ap->pio_mask = pi->pio_mask;
>> +		ap->mwdma_mask = pi->mwdma_mask;
>> +		ap->udma_mask = pi->udma_mask;
>> +		ap->flags |= pi->flags;
>> +		ap->ops = pi->port_ops;
> 
> Could this bit be moved into ata_port_init and possibly change the
> parameter list of ata_port_init to something like:
> 
> void ata_port_init(struct ata_port *ap, struct ata_host *host,
> 		   const struct ata_port_info *pinfo, unsigned int port_no)
> 
> Then we could get rid of the struct ata_probe_ent stuff completely.

Hmmm... ata_port_init() is still exported only to support ata_sas_* 
helpers.  Once the SAS helpers are converted to use new model, this 
function will be made static or merged into ata_host_alloc().  In the 
new init model, initialization is done by...

1. allocate the host and associated ports with ata_host_alloc().  If 
port number cannot be determined at this point.  ports can be added 
later.  The returned ata_host has only the basic fields, which assume 
the same initial values regardless of the user, initialized.

2. initialize ata_host and associated ports appropriately.  During this 
ata_host_add_ports() can be used to add ports if host has no ports yet.

3. attach the initialized ata_host using ata_host_attach().

The ata_host_alloc_pinfo[_ar]() functions are just helpers which perform 
#1 and part of #2 as ata_port_info is handy for many LLDs.

For SAS helpers, I don't think using pinfo helpers is necessary.  Just 
initializing the above fields manually in SAS helper or SAS LLD should 
do.  The pinfo helpers are specifically for this purpose and doesn't 
allow delayed port addition.

Also, note that probe_ent is still there only for SAS helpers.  If you 
take a look at normal SATA init path, no probe_ent is used.  Only 
ata_port_init() deals with it and usual SATA path calls it with null 
probe_ent.

Thanks.

-- 
tejun

  reply	other threads:[~2006-08-27  9:52 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-19  8:57 [PATCHSET] libata: implement new initialization model w/ iomap support, take 2 Tejun Heo
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 6/20] libata: implement legacy ATA init helpers Tejun Heo
2006-09-19  5:26   ` Jeff Garzik
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 5/20] libata: implement several LLD init helpers Tejun Heo
2006-08-22 22:11   ` Brian King
2006-08-27  9:52     ` Tejun Heo [this message]
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 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 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 12/20] libata: kill old init helpers Tejun Heo
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 14/20] libata: use LLD name where possible Tejun Heo
2006-09-19  5:43   ` 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 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=44F16B6B.7050207@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).