From: Felipe Balbi <balbi@ti.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
linux-ide@vger.kernel.org, Tejun Heo <tj@kernel.org>,
Kevin Cernekee <cernekee@gmail.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Anton Vorontsov <avorontsov@ru.mvista.com>
Subject: Re: [PATCH] ahci: platform support for suspend/resume
Date: Wed, 16 Nov 2011 22:34:24 +0200 [thread overview]
Message-ID: <20111116203422.GA29581@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <1321475279-29930-1-git-send-email-computersforpeace@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1732 bytes --]
On Wed, Nov 16, 2011 at 12:27:59PM -0800, Brian Norris wrote:
> Add platform hooks for custom suspend() and resume() functions. The
> generic suspend/resume code in drivers/ata/ahci_platform.c is adapted
> from the PCI version in drivers/ata/ahci.c.
>
> Note that in order to suspend, we require that both suspend() and
> resume() functions be supplied.
>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> ---
> Based on:
> git://github.com/jgarzik/libata-dev.git ALL
>
> drivers/ata/ahci_platform.c | 72 +++++++++++++++++++++++++++++++++++++++++
> include/linux/ahci_platform.h | 2 +
> 2 files changed, 74 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> index ec55595..98bf5e9 100644
> --- a/drivers/ata/ahci_platform.c
> +++ b/drivers/ata/ahci_platform.c
> @@ -202,6 +202,75 @@ static int __devexit ahci_remove(struct platform_device *pdev)
> return 0;
> }
>
> +#ifdef CONFIG_PM
> +static int ahci_suspend(struct device *dev)
> +{
> + struct ahci_platform_data *pdata = dev_get_platdata(dev);
> + struct ata_host *host = dev_get_drvdata(dev);
> + struct ahci_host_priv *hpriv = host->private_data;
> + void __iomem *mmio = hpriv->mmio;
> + u32 ctl;
> + int rc;
> +
> + /* Does platform support suspend/resume? */
> + if (!pdata->suspend || !pdata->resume)
> + return -EINVAL;
should you really prevent suspend is platform doesn't provide
->suspend() ?
I mean, we could some platform where all clocks are autogated and
there's no need for platform to do anything. Would it be better to only
call pdata->suspend if it exists but still let the AHCI-specific part go
through ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2011-11-16 20:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 20:27 Brian Norris
2011-11-16 20:34 ` Felipe Balbi [this message]
2011-11-18 0:31 ` Brian Norris
2011-11-18 9:17 ` Felipe Balbi
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=20111116203422.GA29581@legolas.emea.dhcp.ti.com \
--to=balbi@ti.com \
--cc=avorontsov@ru.mvista.com \
--cc=cernekee@gmail.com \
--cc=computersforpeace@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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
all inboxes | Powered by JetHome®