From: "yiyang (D)" <yiyang13@huawei.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: <gregkh@linuxfoundation.org>, <jirislaby@kernel.org>,
<jonathanh@nvidia.com>, <kyarlagadda@nvidia.com>,
<ldewangan@nvidia.com>, <linux-kernel@vger.kernel.org>,
<linux-serial@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<thierry.reding@gmail.com>
Subject: Re: [PATCH] serial: tegra: Add missing clk_disable_unprepare() in tegra_uart_hw_init()
Date: Sat, 26 Nov 2022 10:24:32 +0800 [thread overview]
Message-ID: <61a1607c-78df-db03-0df5-34f108c6f554@huawei.com> (raw)
In-Reply-To: <43480917-dbe8-2b0c-3806-00f142d417d4@wanadoo.fr>
On 2022/11/25 19:19, Christophe JAILLET wrote:
> Le 25/11/2022 à 11:11, Yi Yang a écrit :
>> Add the missing clk_disable_unprepare() before return from
>> tegra_uart_hw_init() in the error handling path.
>>
>> Fixes: cc9ca4d95846 ("serial: tegra: Only print FIFO error message
>> when an error occurs")
>> Fixes: d781ec21bae6 ("serial: tegra: report clk rate errors")
>> Signed-off-by: Yi Yang <yiyang13-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>> ---
>> drivers/tty/serial/serial-tegra.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>
> Hi,
>
> I think that it is also missing in tegra_uart_startup() if an error
> occurs after a successful tegra_uart_hw_init() call.
>
> Or maybe (based on function mane) tegra_uart_hw_deinit() should called
> there.
>
> Just my 2c.
>
> CJ
>
Thanks! I will fix it in v2 patch.
>
>> diff --git a/drivers/tty/serial/serial-tegra.c
>> b/drivers/tty/serial/serial-tegra.c
>> index e5b9773db5e3..abc5039eb273 100644
>> --- a/drivers/tty/serial/serial-tegra.c
>> +++ b/drivers/tty/serial/serial-tegra.c
>> @@ -1046,6 +1046,7 @@ static int tegra_uart_hw_init(struct
>> tegra_uart_port *tup)
>> if (tup->cdata->fifo_mode_enable_status) {
>> ret = tegra_uart_wait_fifo_mode_enabled(tup);
>> if (ret < 0) {
>> + clk_disable_unprepare(tup->uart_clk);
>> dev_err(tup->uport.dev,
>> "Failed to enable FIFO mode: %d\n", ret);
>> return ret;
>> @@ -1067,6 +1068,7 @@ static int tegra_uart_hw_init(struct
>> tegra_uart_port *tup)
>> */
>> ret = tegra_set_baudrate(tup, TEGRA_UART_DEFAULT_BAUD);
>> if (ret < 0) {
>> + clk_disable_unprepare(tup->uart_clk);
>> dev_err(tup->uport.dev, "Failed to set baud rate\n");
>> return ret;
>> }
>
> .
prev parent reply other threads:[~2022-11-26 2:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-25 10:11 Yi Yang
2022-11-25 11:19 ` Christophe JAILLET
2022-11-26 2:24 ` yiyang (D) [this message]
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=61a1607c-78df-db03-0df5-34f108c6f554@huawei.com \
--to=yiyang13@huawei.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kyarlagadda@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/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®