Haavard Skinnemoen | 19 Sep 17:10
Favicon

[PATCH] atmel_serial: update the powersave handler to match serial core

From: Anti Sullin <anti.sullin <at> artecdesign.ee>

This problem seems to be unnoticed so far:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3b708fa2780cd2b5d8266a8f0c3a1cab364d4d2

has changed the serial core behavior to not to suspend the port if the
device is enabled as a wakeup source. If the AT91 system goes to slow
clock mode, the port should be suspended always and the clocks should be
switched off.  The patch attached updates the atmel_serial driver to
match the changes in serial core.

Also, the interrupts are disabled when the clock is disabled. If we
disable the clock with interrupts enabled, an interrupt may get stuck.
If this is the DBGU interrupt, this blocks the OR logic at system
controller and thus all other sysc interrupts.

Signed-off-by: Anti Sullin <anti.sullin <at> artecdesign.ee>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen <at> atmel.com>
---
 drivers/serial/atmel_serial.c |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 3a6da80..eeb2ca3 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -131,7 +131,8 @@ struct atmel_uart_char {
 struct atmel_uart_port {
 	struct uart_port	uart;		/* uart */
(Continue reading)

Anti Sullin | 19 Sep 17:19

Re: [PATCH] atmel_serial: update the powersave handler to match serial core

One more bug of mine...

Haavard Skinnemoen wrote:
>  }
> @@ -1491,11 +1498,9 @@ static int atmel_serial_resume(struct platform_device *pdev)
>  	struct uart_port *port = platform_get_drvdata(pdev);
>  	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
>  
> -	if (atmel_port->suspended) {
> -		uart_resume_port(&atmel_uart, port);
> -		atmel_port->suspended = 0;
> -	} else
> -		disable_irq_wake(port->irq);
> +	device_set_wakeup_enable(&pdev->dev, atmel_port->may_wakeup);
> +
> +	uart_resume_port(&atmel_uart, port);
Just now noticed - these two lines should be switched.
>  
>  	return 0;
>  }

--

-- 
Anti Sullin
Embedded Software Engineer
Artec Design LLC
Akadeemia tee 23A, 12618, Tallinn, Estonia
http://www.artecdesign.ee 
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo <at> vger.kernel.org
(Continue reading)

Haavard Skinnemoen | 19 Sep 17:39
Favicon

[PATCH v2] atmel_serial: update the powersave handler to match serial core

From: Anti Sullin <anti.sullin <at> artecdesign.ee>

This problem seems to be unnoticed so far:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3b708fa2780cd2b5d8266a8f0c3a1cab364d4d2

has changed the serial core behavior to not to suspend the port if the
device is enabled as a wakeup source. If the AT91 system goes to slow
clock mode, the port should be suspended always and the clocks should be
switched off.  The patch attached updates the atmel_serial driver to
match the changes in serial core.

Also, the interrupts are disabled when the clock is disabled. If we
disable the clock with interrupts enabled, an interrupt may get stuck.
If this is the DBGU interrupt, this blocks the OR logic at system
controller and thus all other sysc interrupts.

Signed-off-by: Anti Sullin <anti.sullin <at> artecdesign.ee>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen <at> atmel.com>
---
Anti Sullin <anti.sullin <at> artecdesign.ee> wrote:
> > +	device_set_wakeup_enable(&pdev->dev, atmel_port->may_wakeup);
> > +
> > +	uart_resume_port(&atmel_uart, port);
> Just now noticed - these two lines should be switched.

Makes sense to me.

 drivers/serial/atmel_serial.c |   32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)
(Continue reading)


Gmane