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: <200803131318.56769.david-b@pacbell.net>
Date:	Thu, 13 Mar 2008 12:18:56 -0800
From:	David Brownell <david-b@...bell.net>
To:	Haavard Skinnemoen <hskinnemoen@...el.com>
Cc:	kernel@...32linux.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/10] macb: Basic suspend/resume support

On Thursday 13 March 2008, Haavard Skinnemoen wrote:
> ---
>  drivers/net/macb.c |   37 +++++++++++++++++++++++++++++++++++++
>  1 files changed, 37 insertions(+), 0 deletions(-)

Shouldn't this look more like the suspend/resume support
in drivers/net/arm/at91_ether.c ?  I don't see calls to
netif_stop_queue()/netif_start_queue(), among other things.

The fact that this driver leaves the peripheral clocked
when it's not open is a minor PM goof; ditto not using
the PHY irq to track connect/disconnect.  But that's just
general PM stuff, not specific to suspend/resume support.

- Dave


> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 1d210ed..94bf2ba 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -1275,8 +1275,45 @@ static int __exit macb_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_PM
> +static int macb_suspend(struct platform_device *pdev, pm_message_t state)
> +{
> +	struct net_device *netdev = platform_get_drvdata(pdev);
> +	struct macb *bp = netdev_priv(netdev);
> +
> +	netif_device_detach(netdev);
> +
> +#ifndef CONFIG_ARCH_AT91
> +	clk_disable(bp->hclk);
> +#endif
> +	clk_disable(bp->pclk);
> +
> +	return 0;
> +}
> +
> +static int macb_resume(struct platform_device *pdev)
> +{
> +	struct net_device *netdev = platform_get_drvdata(pdev);
> +	struct macb *bp = netdev_priv(netdev);
> +
> +	clk_enable(bp->pclk);
> +#ifndef CONFIG_ARCH_AT91
> +	clk_enable(bp->hclk);
> +#endif
> +
> +	netif_device_attach(netdev);
> +
> +	return 0;
> +}
> +#else
> +#define macb_suspend	NULL
> +#define macb_resume	NULL
> +#endif
> +
>  static struct platform_driver macb_driver = {
>  	.remove		= __exit_p(macb_remove),
> +	.suspend	= macb_suspend,
> +	.resume		= macb_resume,
>  	.driver		= {
>  		.name		= "macb",
>  	},
> -- 
> 1.5.4.3
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ