Re: [PATCH] serial: imx: Only wakeup via RTSDEN bit if the system has RTS/CTS

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

 



Hi Fabio,

Thus wrote Fabio Estevam (festevam@xxxxxxxxx):

> From: Fabio Estevam <fabio.estevam@xxxxxxx>

> The wakeup mechanism via RTSDEN bit relies on the system using the RTS/CTS
> lines, so only allow such wakeup method when the system actually has
> RTS/CTS support. 

I tested the patch on uart ports without rts/cts. Suspend+resume are
still working ok.

> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index c2b29fd..7143da3 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -2225,12 +2225,14 @@ static void serial_imx_enable_wakeup(struct imx_port *sport, bool on)
>  		val &= ~UCR3_AWAKEN;
>  	writel(val, sport->port.membase + UCR3);

> -	val = readl(sport->port.membase + UCR1);
> -	if (on)
> -		val |= UCR1_RTSDEN;
> -	else
> -		val &= ~UCR1_RTSDEN;
> -	writel(val, sport->port.membase + UCR1);
> +	if (sport->have_rtscts) {
> +		val = readl(sport->port.membase + UCR1);
> +		if (on)
> +			val |= UCR1_RTSDEN;
> +		else
> +			val &= ~UCR1_RTSDEN;
> +		writel(val, sport->port.membase + UCR1);
> +	}

Would it make sense to clear UCR1_RTSDEN explicitly if
sport->have_rtscts is false?

Best regards,

   Martin
--
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