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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1DC0FF5051B91B4D88A15F21F1A27F4176AE6A@dware1013.doorway.loc>
Date:	Mon, 8 Jun 2009 10:24:51 +0200
From:	"Eirik Aanonsen" <eaa@...medical.com>
To:	"Haavard Skinnemoen" <haavard.skinnemoen@...el.com>
Cc:	<kernel@...32linux.org>, <linux-kernel@...r.kernel.org>,
	"Nicolas Ferre" <Nicolas.FERRE@...el.com>,
	"Andrew Victor" <avictor.za@...il.com>,
	"Alan Cox" <alan@...rguk.ukuu.org.uk>
Subject: RE: [PATCH] atmel_serial: Fix hang in set_termios when crtscts is enabled

> 
> Fix it by removing the busy-loop altogether.
> 
> Reported-by: Eirik Aanonsen <eaa@...medical.com>
> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@...el.com>
> ---
> I have not tested this patch yet. Eirik, can you give it a try?
> 
>  drivers/serial/atmel_serial.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/serial/atmel_serial.c
> b/drivers/serial/atmel_serial.c
> index b3497d7..338b15c 100644
> --- a/drivers/serial/atmel_serial.c
> +++ b/drivers/serial/atmel_serial.c
> @@ -1104,11 +1104,13 @@ static void atmel_set_termios(struct uart_port
> *port, struct ktermios *termios,
>  	/* update the per-port timeout */
>  	uart_update_timeout(port, termios->c_cflag, baud);
> 
> -	/* save/disable interrupts and drain transmitter */
> +	/*
> +	 * save/disable interrupts. The tty layer will ensure that the
> +	 * transmitter is empty if requested by the caller, so there's
> +	 * no need to wait for it here.
> +	 */
>  	imr = UART_GET_IMR(port);
>  	UART_PUT_IDR(port, -1);
> -	while (!(UART_GET_CSR(port) & ATMEL_US_TXEMPTY))
> -		cpu_relax();
> 
>  	/* disable receiver and transmitter */
>  	UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS);
> --
> 1.6.0.4

Works like a charm :) Thanx. I sis not use the patch but I just 
Added a 0& inside the condition to the while loop.


Regards
____________________________________________________
 
Eirik Aanonsen
SW Developer
E-mail: eaa@...medical.com 
Phone: +47 90 68 11 92
Fax: +47 37 03 56 77
____________________________________________________



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