[3.13.y-ckt stable] Patch "tty/serial: at91: enable peripheral clock before accessing I/O registers" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Mar 31 18:45:22 UTC 2015

This is a note to let you know that I have just added a patch titled

    tty/serial: at91: enable peripheral clock before accessing I/O registers

to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree 
which can be found at:


This patch is scheduled to be released in version 3.13.11-ckt18.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y-ckt tree, see



>From 0f241a9bd4f91b4024105e34659e36dc5fb1194a Mon Sep 17 00:00:00 2001
From: Cyrille Pitchen <cyrille.pitchen at atmel.com>
Date: Tue, 9 Dec 2014 14:31:33 +0100
Subject: tty/serial: at91: enable peripheral clock before accessing I/O

commit d4f641876a68d1961e30c202709cc2d484f69f6f upstream.

atmel_serial_probe() calls atmel_init_port(). In turn, atmel_init_port() calls
clk_disable_unprepare() to disable the peripheral clock before returning.

Later atmel_serial_probe() accesses some I/O registers such as the Mode and
Control registers for RS485 support then the Name and Version registers, through a call to
atmel_get_ip_name(), but at that moment the peripheral clock was still

Signed-off-by: Cyrille Pitchen <cyrille.pitchen at atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre at atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/tty/serial/atmel_serial.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index a49f10d..41060fb 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2421,6 +2421,12 @@ static int atmel_serial_probe(struct platform_device *pdev)
 	device_init_wakeup(&pdev->dev, 1);
 	platform_set_drvdata(pdev, port);

+	/*
+	 * The peripheral clock has been disabled by atmel_init_port():
+	 * enable it before accessing I/O registers
+	 */
+	clk_prepare_enable(port->clk);
 	if (port->rs485.flags & SER_RS485_ENABLED) {
 		UART_PUT_CR(&port->uart, ATMEL_US_RTSEN);
@@ -2431,6 +2437,12 @@ static int atmel_serial_probe(struct platform_device *pdev)

+	/*
+	 * The peripheral clock can now safely be disabled till the port
+	 * is used
+	 */
+	clk_disable_unprepare(port->clk);
 	return 0;


More information about the kernel-team mailing list