lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20101025155410.f960fcd5.akpm@linux-foundation.org>
Date:	Mon, 25 Oct 2010 15:54:10 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Claudio Scordino <claudio@...dence.eu.com>
Cc:	Nicolas Ferre <nicolas.ferre@...el.com>,
	Arkadiusz BubaƂa 
	<arkadiusz.bubala@...il.com>, linux@...im.org.za,
	linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
	Greg KH <greg@...ah.com>
Subject: Re: atmel_serial: fix RTS high after initialization in RS485 mode

On Sun, 24 Oct 2010 12:48:29 +0200
Claudio Scordino <claudio@...dence.eu.com> wrote:

> Hi Nicolas,
> 
> 	when working in RS485 mode, the atmel_serial driver keeps RTS
> high after the initialization of the serial port. It goes low only after
> the first character has been sent. 
> 
> This patch fixes this behavior. It has been already tested by Arkadiusz (CC:-ed).
> 
> Best regards,
> 
> 	Claudio
> 
> 
> atmel_serial: RTS line low after initialization of the serial port
> 
> Signed-off-by: Claudio Scordino <claudio@...dence.eu.com>
> Signed-off-by: Arkadiusz Bubala <arkadiusz.bubala@...il.com>
> ---
>  drivers/serial/atmel_serial.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
> index 3892666..85aa66f 100644
> --- a/drivers/serial/atmel_serial.c
> +++ b/drivers/serial/atmel_serial.c
> @@ -1732,6 +1732,15 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
>  	device_init_wakeup(&pdev->dev, 1);
>  	platform_set_drvdata(pdev, port);
>  
> +	if (port->rs485.flags & SER_RS485_ENABLED) {
> +		unsigned int control = 0;
> +		unsigned int mode = 0;
> +		control |= ATMEL_US_RTSEN;
> +		mode |= ATMEL_US_USMODE_NORMAL;
> +		UART_PUT_MR(&port->uart, mode);
> +		UART_PUT_CR(&port->uart, control);
> +	}
> +
>  	return 0;
>  

That was a lot of code!  How about just this?

	if (port->rs485.flags & SER_RS485_ENABLED) {
		UART_PUT_MR(&port->uart, ATMEL_US_USMODE_NORMAL);
		UART_PUT_CR(&port->uart, ATMEL_US_RTSEN);
	}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ