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: albertcc@tw.ibm.com, linux-ide@vger.kernel.org
Subject: Re: [PATCH 7/7] libata: reorganize ata_bus_probe()
Date: Mon, 20 Feb 2006 05:43:19 -0500	[thread overview]
Message-ID: <43F99D47.4060603@pobox.com> (raw)
In-Reply-To: <113999544950-git-send-email-htejun@gmail.com>

Tejun Heo wrote:
> Now that reset and configure are converted such that they don't modify
> or disable libata core data structures, reorganize ata_bus_probe() to
> reflect this change.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> 
> ---
> 
>  drivers/scsi/libata-core.c |   46 ++++++++++++++++++++++++--------------------
>  1 files changed, 25 insertions(+), 21 deletions(-)
> 
> 04a9356ddbbfafba7ec9b6b71db30ccad2190e02
> diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
> index 761186d..8c0d48f 100644
> --- a/drivers/scsi/libata-core.c
> +++ b/drivers/scsi/libata-core.c
> @@ -1207,35 +1207,40 @@ err_out_nosup:
>  
>  static int ata_bus_probe(struct ata_port *ap)
>  {
> -	unsigned int i, found = 0;
> +	unsigned int classes[ATA_MAX_DEVICES];
> +	unsigned int i, rc, found = 0;
>  
> -	if (ap->ops->probe_reset) {
> -		unsigned int classes[ATA_MAX_DEVICES];
> -		int rc;
> -
> -		ata_port_probe(ap);
> +	ata_port_probe(ap);
>  
> +	/* reset */
> +	if (ap->ops->probe_reset) {
>  		rc = ap->ops->probe_reset(ap, classes);
> -		if (rc == 0) {
> -			for (i = 0; i < ATA_MAX_DEVICES; i++) {
> -				if (classes[i] == ATA_DEV_UNKNOWN)
> -					classes[i] = ATA_DEV_NONE;
> -				ap->device[i].class = classes[i];
> -			}
> -		} else {
> -			printk(KERN_ERR "ata%u: probe reset failed, "
> -			       "disabling port\n", ap->id);
> -			ata_port_disable(ap);
> +		if (rc) {
> +			printk("ata%u: reset failed (errno=%d)\n", ap->id, rc);
> +			return rc;
>  		}
> -	} else
> +
> +		for (i = 0; i < ATA_MAX_DEVICES; i++)
> +			if (classes[i] == ATA_DEV_UNKNOWN)
> +				classes[i] = ATA_DEV_NONE;
> +	} else {
>  		ap->ops->phy_reset(ap);
>  
> -	if (ap->flags & ATA_FLAG_PORT_DISABLED)
> -		goto err_out;
> +		for (i = 0; i < ATA_MAX_DEVICES; i++) {
> +			if (!(ap->flags & ATA_FLAG_PORT_DISABLED))
> +				classes[i] = ap->device[i].class;
> +			else
> +				ap->device[i].class = ATA_DEV_UNKNOWN;
> +		}
> +		ata_port_probe(ap);
> +	}

the legacy phy_reset code path appears to call ata_port_probe() a second 
time.  otherwise, seems OK.

	Jeff




  reply	other threads:[~2006-02-20 10:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-15  9:24 [PATCHSET] libata: reorganize ata_dev_identify() Tejun Heo
2006-02-15  9:24 ` [PATCH 6/7] libata: fold ata_dev_config() into ata_dev_configure() Tejun Heo
2006-02-20 10:41   ` Jeff Garzik
2006-02-15  9:24 ` [PATCH 2/7] libata: convert dev->id to pointer Tejun Heo
2006-02-15  9:24 ` [PATCH 7/7] libata: reorganize ata_bus_probe() Tejun Heo
2006-02-20 10:43   ` Jeff Garzik [this message]
2006-02-20 15:16     ` Tejun Heo
2006-02-15  9:24 ` [PATCH 4/7] libata: kill ata_dev_reread_id() Tejun Heo
2006-02-20 10:35   ` Jeff Garzik
2006-02-15  9:24 ` [PATCH 5/7] libata: separate out ata_dev_configure() Tejun Heo
2006-02-20 10:37   ` Jeff Garzik

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=43F99D47.4060603@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=albertcc@tw.ibm.com \
    --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).