diff mbox

[1/2] serial: mxs-auart: fix the wrong setting order

Message ID 1346985521-2248-1-git-send-email-shijie8@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Huang Shijie Sept. 7, 2012, 2:38 a.m. UTC
After set the AUART_CTRL0_CLKGATE, the UART will gate all the clocks off.
So the following line will not take effect.
       ................................................................
 	writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN | AUART_INTR_CTSMIEN,
 			u->membase + AUART_INTR_CLR);
       ................................................................

To fix this issue, the patch moves this gate-off line to
the end of setting registers.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
 drivers/tty/serial/mxs-auart.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Shawn Guo Sept. 7, 2012, 2:38 a.m. UTC | #1
On Thu, Sep 06, 2012 at 10:38:40PM -0400, Huang Shijie wrote:
> After set the AUART_CTRL0_CLKGATE, the UART will gate all the clocks off.
> So the following line will not take effect.
>        ................................................................
>  	writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN | AUART_INTR_CTSMIEN,
>  			u->membase + AUART_INTR_CLR);
>        ................................................................
> 
> To fix this issue, the patch moves this gate-off line to
> the end of setting registers.
> 
> Signed-off-by: Huang Shijie <shijie8@gmail.com>

Acked-by: Shawn Guo <shawn.guo@linaro.org>

Are you experiencing any user visible problem with this bug?

Regards,
Shawn

> ---
>  drivers/tty/serial/mxs-auart.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
> index dafeef2..ea5f888 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -457,11 +457,11 @@ static void mxs_auart_shutdown(struct uart_port *u)
>  
>  	writel(AUART_CTRL2_UARTEN, u->membase + AUART_CTRL2_CLR);
>  
> -	writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_SET);
> -
>  	writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN | AUART_INTR_CTSMIEN,
>  			u->membase + AUART_INTR_CLR);
>  
> +	writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_SET);
> +
>  	clk_disable_unprepare(s->clk);
>  }
>  
> -- 
> 1.7.4.4
>
Huang Shijie Sept. 7, 2012, 2:43 a.m. UTC | #2
? 2012?09?07? 10:38, Shawn Guo ??:
> On Thu, Sep 06, 2012 at 10:38:40PM -0400, Huang Shijie wrote:
>> After set the AUART_CTRL0_CLKGATE, the UART will gate all the clocks off.
>> So the following line will not take effect.
>>         ................................................................
>>   	writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN | AUART_INTR_CTSMIEN,
>>   			u->membase + AUART_INTR_CLR);
>>         ................................................................
>>
>> To fix this issue, the patch moves this gate-off line to
>> the end of setting registers.
>>
>> Signed-off-by: Huang Shijie<shijie8@gmail.com>
> Acked-by: Shawn Guo<shawn.guo@linaro.org>
>
> Are you experiencing any user visible problem with this bug?
>
I do not experience any user problem.
I found this bug when i tried to add DMA support for MXS-AUART.

Best Regards
Huang Shijie


> Regards,
> Shawn
>
>> ---
>>   drivers/tty/serial/mxs-auart.c |    4 ++--
>>   1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
>> index dafeef2..ea5f888 100644
>> --- a/drivers/tty/serial/mxs-auart.c
>> +++ b/drivers/tty/serial/mxs-auart.c
>> @@ -457,11 +457,11 @@ static void mxs_auart_shutdown(struct uart_port *u)
>>
>>   	writel(AUART_CTRL2_UARTEN, u->membase + AUART_CTRL2_CLR);
>>
>> -	writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_SET);
>> -
>>   	writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN | AUART_INTR_CTSMIEN,
>>   			u->membase + AUART_INTR_CLR);
>>
>> +	writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_SET);
>> +
>>   	clk_disable_unprepare(s->clk);
>>   }
>>
>> -- 
>> 1.7.4.4
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Lauri Hintsala Sept. 13, 2012, 5:28 a.m. UTC | #3
Hi Huang,

On 09/07/2012 05:43 AM, Huang Shijie wrote:
> I found this bug when i tried to add DMA support for MXS-AUART.

What is the status of DMA support? We could help you testing your patches.

Best regards,
Lauri Hintsala
Huang Shijie Sept. 13, 2012, 5:45 a.m. UTC | #4
? 2012?09?13? 13:28, Lauri Hintsala ??:
> Hi Huang,
>
> On 09/07/2012 05:43 AM, Huang Shijie wrote:
>> I found this bug when i tried to add DMA support for MXS-AUART.
>
> What is the status of DMA support? We could help you testing your 
> patches.
thanks.

I maybe send out the new patch set in next week. I resume this work 
recently.

BR
Huang Shijie
>
> Best regards,
> Lauri Hintsala
>
diff mbox

Patch

diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index dafeef2..ea5f888 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -457,11 +457,11 @@  static void mxs_auart_shutdown(struct uart_port *u)
 
 	writel(AUART_CTRL2_UARTEN, u->membase + AUART_CTRL2_CLR);
 
-	writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_SET);
-
 	writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN | AUART_INTR_CTSMIEN,
 			u->membase + AUART_INTR_CLR);
 
+	writel(AUART_CTRL0_CLKGATE, u->membase + AUART_CTRL0_SET);
+
 	clk_disable_unprepare(s->clk);
 }