mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: kernel@avr32linux.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/10] atmel_serial: Fix build on avr32 with CONFIG_PM enabled
Date: Thu, 13 Mar 2008 12:37:40 -0800	[thread overview]
Message-ID: <200803131337.41337.david-b@pacbell.net> (raw)
In-Reply-To: <1205419185-26395-3-git-send-email-hskinnemoen@atmel.com>

On Thursday 13 March 2008, Haavard Skinnemoen wrote:
> AVR32 doesn't have at91_suspend_entering_slow_clock(). Just assume the
> clock will keep running for now.

Well, it should acquire the clk_must_disable() or somesuch... :)

By the way, I noticed a goof in this driver's clock management.
It should leave the clock off whenever the device isn't open.
As it is, it wastes power both at runtime and during suspend.

- Dave


> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
> ---
>  drivers/serial/atmel_serial.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
> index d57bf3e..2efbdf6 100644
> --- a/drivers/serial/atmel_serial.c
> +++ b/drivers/serial/atmel_serial.c
> @@ -1428,6 +1428,15 @@ static struct uart_driver atmel_uart = {
>  };
>  
>  #ifdef CONFIG_PM
> +static bool atmel_serial_clk_will_stop(void)
> +{
> +#ifdef CONFIG_ARCH_AT91
> +	return at91_suspend_entering_slow_clock();
> +#else
> +	return false;
> +#endif
> +}
> +
>  static int atmel_serial_suspend(struct platform_device *pdev,
>  				pm_message_t state)
>  {
> @@ -1435,7 +1444,7 @@ static int atmel_serial_suspend(struct platform_device *pdev,
>  	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
>  
>  	if (device_may_wakeup(&pdev->dev)
> -	    && !at91_suspend_entering_slow_clock())
> +	    && !atmel_serial_clk_will_stop())
>  		enable_irq_wake(port->irq);
>  	else {
>  		uart_suspend_port(&atmel_uart, port);
> -- 
> 1.5.4.3
> 



  parent reply	other threads:[~2008-03-13 20:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 14:39 [PATCH 00/10] avr32: Power Management support Haavard Skinnemoen
2008-03-13 14:39 ` [PATCH 01/10] mtd: maps/physmap: fix oops in suspend/resume/shutdown ops Haavard Skinnemoen
2008-03-13 14:39   ` [PATCH 02/10] atmel_serial: Fix build on avr32 with CONFIG_PM enabled Haavard Skinnemoen
2008-03-13 14:39     ` [PATCH 03/10] avr32: Move setup_platform() into chip-specific file Haavard Skinnemoen
2008-03-13 14:39       ` [PATCH 04/10] avr32: Rename at32ap.c -> pdc.c Haavard Skinnemoen
2008-03-13 14:39         ` [PATCH 05/10] avr32: Enable SDRAMC clock at startup Haavard Skinnemoen
2008-03-13 14:39           ` [PATCH 06/10] avr32: Add simple SRAM allocator Haavard Skinnemoen
2008-03-13 14:39             ` [PATCH 07/10] macb: Basic suspend/resume support Haavard Skinnemoen
2008-03-13 14:39               ` [PATCH 08/10] avr32: Define TIF_FREEZE Haavard Skinnemoen
2008-03-13 14:39                 ` [PATCH 09/10] avr32: Add system device for the internal interrupt controller (intc) Haavard Skinnemoen
2008-03-13 14:39                   ` [PATCH 10/10] avr32: Power Management support ("standby" and "mem" modes) Haavard Skinnemoen
2008-03-13 20:18               ` [PATCH 07/10] macb: Basic suspend/resume support David Brownell
2008-03-13 20:28                 ` Haavard Skinnemoen
2008-03-13 20:37     ` David Brownell [this message]
2008-03-13 20:54       ` [PATCH 02/10] atmel_serial: Fix build on avr32 with CONFIG_PM enabled Haavard Skinnemoen
2008-03-13 19:26   ` [PATCH 01/10] mtd: maps/physmap: fix oops in suspend/resume/shutdown ops David Brownell

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=200803131337.41337.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=hskinnemoen@atmel.com \
    --cc=kernel@avr32linux.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®