Re: [PATCH] Revert "tty: serial: imx.c: Reset UART before activating interrupts"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 27 Jul 2015 15:15:59 -0300
Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx> wrote:

> This reverts commit e95044ba4fee93f5ea8a1a24b2d921e148503833.
> 
> Commit e95044ba4fee93 ("tty: serial: imx.c: Reset UART before activating
> interrupts") terribly messes up with the console on mx6 boards, so
> let's revert it.

IMHO Spewing out a few corrupt characters during startup (which curiously also
appear sometimes due to other reasons), is a lot less of a problem that a
hanging system!
Please don't revert this patch without providing a fix for the crash!

> Reported-by: kernelci.org bot <bot@xxxxxxxxxxxx>
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> ---
>  drivers/tty/serial/imx.c | 32 +++++++++-----------------------
>  1 file changed, 9 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index e705149..cf594ce 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -1098,23 +1098,10 @@ static void imx_disable_dma(struct imx_port *sport)
>  /* half the RX buffer size */
>  #define CTSTL 16
>  
> -static inline void imx_reset(struct imx_port *sport)
> -{
> -	int i = 100;
> -	unsigned long temp;
> -
> -	temp = readl(sport->port.membase + UCR2);
> -	temp &= ~UCR2_SRST;
> -	writel(temp, sport->port.membase + UCR2);
> -
> -	while (!(readl(sport->port.membase + UCR2) & UCR2_SRST) && (--i >
> 0))
> -		udelay(1);
> -}
> -
>  static int imx_startup(struct uart_port *port)
>  {
>  	struct imx_port *sport = (struct imx_port *)port;
> -	int retval;
> +	int retval, i;
>  	unsigned long flags, temp;
>  
>  	retval = clk_prepare_enable(sport->clk_per);
> @@ -1141,7 +1128,14 @@ static int imx_startup(struct uart_port *port)
>  
>  	spin_lock_irqsave(&sport->port.lock, flags);
>  	/* Reset fifo's and state machines */
> -	imx_reset(sport);
> +	i = 100;
> +
> +	temp = readl(sport->port.membase + UCR2);
> +	temp &= ~UCR2_SRST;
> +	writel(temp, sport->port.membase + UCR2);
> +
> +	while (!(readl(sport->port.membase + UCR2) & UCR2_SRST) && (--i >
> 0))
> +		udelay(1);
>  
>  	/*
>  	 * Finally, clear and enable interrupts
> @@ -1981,14 +1975,6 @@ static int serial_imx_probe(struct platform_device
> *pdev) clk_disable_unprepare(sport->clk_ipg);
>  
>  	/*
> -	 * Perform a complete reset of the UART device. Needed if we don't
> -	 * come straight out of reset.
> -	 */
> -	writel(0, sport->port.membase + UCR2);
> -	writel(0, sport->port.membase + UCR1);
> -	imx_reset(sport);
> -
> -	/*
>  	 * Allocate the IRQ(s) i.MX1 has three interrupts whereas later
>  	 * chips only have one interrupt.
>  	 */



-- 
David Jander
Protonic Holland.
tel.: +31 (0) 229 212928
fax.: +31 (0) 229 210930
Factorij 36 / 1689 AL Zwaag
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux