All of lore.kernel.org
 help / color / mirror / Atom feed
From: "zhao, forrest" <forrest.zhao@intel.com>
To: Tejun Heo <htejun@gmail.com>
Cc: jgarzik@pobox.com, lkml@rtr.ca, axboe@suse.de,
	alan@lxorguk.ukuu.org.uk, linux-ide@vger.kernel.org
Subject: Re: [PATCH 11/15] libata: reimplement controller-wide PM
Date: Mon, 26 Jun 2006 14:36:47 +0800	[thread overview]
Message-ID: <1151303807.7132.162.camel@forrest26.sh.intel.com> (raw)
In-Reply-To: <11511486203395-git-send-email-htejun@gmail.com>

On Sat, 2006-06-24 at 20:30 +0900, Tejun Heo wrote:
>  
>  /**
> + *	ata_host_set_suspend - suspend host_set
> + *	@host_set: host_set to suspend
> + *	@mesg: PM message
> + *
> + *	Suspend @host_set.  Actual operation is performed by EH.  This
> + *	function requests EH to perform PM operations and waits for EH
> + *	to finish.
> + *
> + *	LOCKING:
> + *	Kernel thread context (may sleep).
> + *
> + *	RETURNS:
> + *	0 on success, -errno on failure.
> + */
> +int ata_host_set_suspend(struct ata_host_set *host_set, pm_message_t mesg)
> +{
> +	unsigned long flags;
> +	int i, j;
> +
> +	for (i = 0; i < host_set->n_ports; i++) {
> +		struct ata_port *ap = host_set->ports[i];
> +
> +		/* set SUSPENDED and make sure EH sees it */
> +		spin_lock_irqsave(&ap->host_set->lock, flags);
> +		ap->flags |= ATA_FLAG_SUSPENDED;
> +		spin_unlock_irqrestore(&ap->host_set->lock, flags);
> +
> +		ata_port_wait_eh(ap);
> +
> +		/* EH is quiescent now.  Fail if we have any ready
> +		 * device.  This happens if hotplug occurs between
> +		 * completion of device suspension and here.
> +		 */
> +		for (j = 0; j < ATA_MAX_DEVICES; j++) {
> +			struct ata_device *dev = &ap->device[j];
> +
> +			if (ata_dev_ready(dev)) {
> +				ata_port_printk(ap, KERN_INFO,
> +						"suspend failed, device %d "
> +						"still active\n", dev->devno);
> +				goto fail;
> +			}
> +		}
> +
> +		/* freeze, won't be thawed until resume */
> +		spin_lock_irqsave(&ap->host_set->lock, flags);
> +		ata_port_freeze(ap);
> +		spin_unlock_irqrestore(&ap->host_set->lock, flags);
> +	}
> +
> +	host_set->dev->power.power_state = mesg;
> +	return 0;
> +
> + fail:
> +	ata_host_set_resume(host_set);
> +	return -EBUSY;
> +}
> +

ata_port_schedule_eh(ap); need to be invoked in order to schedule EH,
right? But ata_port_schedule_eh(ap) is not called in
ata_host_set_suspend().

Thanks,
Forrest

  reply	other threads:[~2006-06-26  6:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-24 11:30 [PATCHSET] [PATCHSET] new Power Management for libata, take 2 Tejun Heo
2006-06-24 11:30 ` [PATCH 02/15] libata: implement and use ata_deh_dev_action() Tejun Heo
2006-06-24 11:30 ` [PATCH 01/15] libata: move ata_eh_clear_action() upward Tejun Heo
2006-06-27  1:00   ` Jeff Garzik
2006-06-24 11:30 ` [PATCH 06/15] libata: make two functions global Tejun Heo
2006-06-24 11:30 ` [PATCH 09/15] libata: reimplement per-dev PM Tejun Heo
2006-06-24 11:30 ` [PATCH 04/15] libata: move ata_do_simple_cmd() below ata_exec_internal() Tejun Heo
2006-06-24 11:30 ` [PATCH 05/15] libata: update ata_do_simple_cmd() Tejun Heo
2006-06-24 11:30 ` [PATCH 07/15] libata: implement ata_port_max_devices() Tejun Heo
2006-06-24 11:30 ` [PATCH 03/15] libata: clear EH action on device detach Tejun Heo
2006-06-24 11:30 ` [PATCH 08/15] libata: implement PM EH actions Tejun Heo
2006-06-24 11:30 ` [PATCH 11/15] libata: reimplement controller-wide PM Tejun Heo
2006-06-26  6:36   ` zhao, forrest [this message]
2006-06-26  6:53     ` Tejun Heo
2006-06-24 11:30 ` [PATCH 13/15] sata_sil: add suspend/sleep support Tejun Heo
2006-06-24 11:30 ` [PATCH 15/15] sata_sil24: " Tejun Heo
2006-06-24 11:30 ` [PATCH 14/15] sata_sil24: separate out sil24_init_controller() Tejun Heo
2006-06-24 11:30 ` [PATCH 10/15] libata: move ata_flush_cache() from libata-core.c to libata-eh.c Tejun Heo
2006-06-24 11:30 ` [PATCH 12/15] sata_sil: separate out sil_init_controller() Tejun Heo
2006-06-24 11:36 ` [git-patch] new Power Management for libata, take 2 Tejun Heo
2006-06-26  6:42 ` [PATCHSET] [PATCHSET] " zhao, forrest
2006-06-26  6:58   ` Tejun Heo
2006-06-26  6:49     ` zhao, forrest
2006-06-26  7:11       ` Tejun Heo
2006-06-26  7:09         ` zhao, forrest
2006-06-26  8:17           ` Tejun Heo
2006-06-26  7:20         ` Jeff Garzik
2006-06-26  8:15           ` Tejun Heo
2006-06-26  8:09             ` zhao, forrest

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=1151303807.7132.162.camel@forrest26.sh.intel.com \
    --to=forrest.zhao@intel.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@suse.de \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=lkml@rtr.ca \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.