Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbcCYIO0 (ORCPT ); Fri, 25 Mar 2016 04:14:26 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:19059 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046AbcCYIOV (ORCPT ); Fri, 25 Mar 2016 04:14:21 -0400 MIME-version: 1.0 Content-type: text/plain; charset=utf-8; format=flowed X-AuditID: cbfec7f4-f796c6d000001486-e2-56f4f358e084 Content-transfer-encoding: 8BIT Subject: Re: [PATCH] serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios() To: Chanwoo Choi , gregkh@linuxfoundation.org, jslaby@suse.com References: <1457916065-27418-1-git-send-email-cw00.choi@samsung.com> <56F481E8.1000602@samsung.com> Cc: k.kozlowski@samsung.com, kgene@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, "Robert Baldyga (SRPOL)" From: Marek Szyprowski Message-id: <56F4F357.2060407@samsung.com> Date: Fri, 25 Mar 2016 09:14:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 In-reply-to: <56F481E8.1000602@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t/xa7oRn7+EGay5qmtx/ctzVovmxevZ LKZs+MBk8fqFoUX/49fMFpd3zWGzmHF+H5PFmcW97BYPDu9kd+D02LSqk81j/9w17B59W1Yx eqzfcpXF4/MmuQDWKC6blNSczLLUIn27BK6MW91nmArW8FXcf3GKvYFxG3cXIyeHhICJxKxX T5ggbDGJC/fWs3UxcnEICSxllHj7fhEzSIJXQFDix+R7LF2MHBzMAvISRy5lg4SZBcwkvrw8 zApR/5xRYtepJewgCWGBEonP/0+D2SIC4RL3p50Cs4UE0iTefL/HDtLALHCIUWLx/sdsIAk2 AUOJrrddbBDLtCTO9KxiBbFZBFQl+vf2gdmiAjESbVsWgV3KKaAtMff8QuYJjAKzkNw3C+G+ WUjuW8DIvIpRNLU0uaA4KT3XUK84Mbe4NC9dLzk/dxMjJOy/7GBcfMzqEKMAB6MSD6+D+5cw IdbEsuLKXKAjOZiVRHgbtgCFeFMSK6tSi/Lji0pzUosPMUpzsCiJ887d9T5ESCA9sSQ1OzW1 ILUIJsvEwSnVwBirbcv24pHG/YbADHnG632r852FIl1nez1kb53LaTM/8lry5TX8Wzbdy88U Sztld2O/z2+j5y+uRj5+EiAXGaLGVHFv/rK7hjpn3M7ppKRfsJX2S8sX+fVM6bTTzBW/WVNY Vu3coVOX/iSKsX2JmdvRf56uvZWyifNbRAWOcU65pXy2MOrLZCWW4oxEQy3mouJEAKcMDe13 AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1776 Lines: 58 Dear Chanwoo, On 2016-03-25 01:10, Chanwoo Choi wrote: > Hi Robert, > > I send following patch to fix the broken serial log of Exynos SoC. > As I knew, you also knew this issue. > If possible, could you review or test this patch? Robert no longer works for Samsung, so I'm afraid that he won't be able to test this patch. > Best Regards, > Chanwoo Choi > > On 2016년 03월 14일 09:41, Chanwoo Choi wrote: >> This patch fixes the broken serial log when changing the clock source >> of uart device. Before disabling the original clock source, this patch >> enables the new clock source to protect the clock off state for a split second. >> >> Signed-off-by: Chanwoo Choi >> --- >> drivers/tty/serial/samsung.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c >> index d72cd736bdc6..80d59dbfebba 100644 >> --- a/drivers/tty/serial/samsung.c >> +++ b/drivers/tty/serial/samsung.c >> @@ -1265,13 +1265,13 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, >> if (ourport->baudclk != clk) { >> s3c24xx_serial_setsource(port, clk_sel); >> >> + clk_prepare_enable(clk); >> + IMHO clk_prepare_enable() should be moved before s3c24xx_serial_setsource() to be really sure that there will be no period of hw operating with disabled baud clock. Could you check if it works for you? >> if (!IS_ERR(ourport->baudclk)) { >> clk_disable_unprepare(ourport->baudclk); >> ourport->baudclk = ERR_PTR(-EINVAL); >> } >> >> - clk_prepare_enable(clk); >> - >> ourport->baudclk = clk; >> ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0; >> } Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland