From: nicolas.ferre@atmel•com (Nicolas Ferre)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 2/5] tty/serial: at91: enable peripheral clock before accessing I/O registers
Date: Fri, 9 Jan 2015 16:12:47 +0100 [thread overview]
Message-ID: <54AFEFEF.90407@atmel.com> (raw)
In-Reply-To: <01544ce7fecbc7323106666f91fdeffe35eef33a.1418131298.git.cyrille.pitchen@atmel.com>
Le 09/12/2014 14:31, Cyrille Pitchen a ?crit :
> 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
> disabled.
>
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel•com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel•com>
and you can add also:
Cc: <stable@vger•kernel.org> # 3.12+
> ---
> 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 756f567..c6621dc 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -2596,6 +2596,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 (rs485_enabled) {
> UART_PUT_MR(&port->uart, ATMEL_US_USMODE_NORMAL);
> UART_PUT_CR(&port->uart, ATMEL_US_RTSEN);
> @@ -2606,6 +2612,12 @@ static int atmel_serial_probe(struct platform_device *pdev)
> */
> atmel_get_ip_name(&port->uart);
>
> + /*
> + * The peripheral clock can now safely be disabled till the port
> + * is used
> + */
> + clk_disable_unprepare(port->clk);
> +
> return 0;
>
> err_add_port:
>
--
Nicolas Ferre
next prev parent reply other threads:[~2015-01-09 15:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 13:31 [PATCH 0/5] tty/serial: at91: fix atmel_serial_probe(), dma_sync_* and the Hardware Handshaking support Cyrille Pitchen
2014-12-09 13:31 ` [PATCH 1/5] tty/serial: at91: use correct type for dma_sync_*_for_cpu() and dma_sync_*_for_device() Cyrille Pitchen
2015-01-09 15:13 ` Nicolas Ferre
2015-01-09 22:19 ` Greg KH
2014-12-09 13:31 ` [PATCH 2/5] tty/serial: at91: enable peripheral clock before accessing I/O registers Cyrille Pitchen
2015-01-09 15:12 ` Nicolas Ferre [this message]
2014-12-09 13:31 ` [PATCH 3/5] tty/serial: at91: fix error handling in atmel_serial_probe() Cyrille Pitchen
2015-01-09 15:28 ` Nicolas Ferre
2014-12-09 13:31 ` [PATCH 4/5] tty/serial: at91: fix RTS line management when hardware handshake is enabled Cyrille Pitchen
2015-01-09 15:40 ` Nicolas Ferre
2014-12-09 13:31 ` [PATCH 5/5] tty/serial: at91: fix typo and indentation Cyrille Pitchen
2015-01-09 15:41 ` Nicolas Ferre
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=54AFEFEF.90407@atmel.com \
--to=nicolas.ferre@atmel$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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