lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111116203422.GA29581@legolas.emea.dhcp.ti.com>
Date:	Wed, 16 Nov 2011 22:34:24 +0200
From:	Felipe Balbi <balbi@...com>
To:	Brian Norris <computersforpeace@...il.com>
Cc:	Jeff Garzik <jgarzik@...ox.com>, linux-ide@...r.kernel.org,
	Tejun Heo <tj@...nel.org>, Kevin Cernekee <cernekee@...il.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	Anton Vorontsov <avorontsov@...mvista.com>
Subject: Re: [PATCH] ahci: platform support for suspend/resume

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@...il.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

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ