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: <20091003141807.1dc27e4e@lxorguk.ukuu.org.uk>
Date:	Sat, 3 Oct 2009 14:18:07 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Johan Hovold <jhovold@...il.com>
Cc:	Johan Hovold <jhovold@...il.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Michael Trimarchi <trimarchi@...dalf.sssup.it>,
	Oliver Neukum <oliver@...kum.org>, linux-usb@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] USB: ftdi_sio: Remove tty->low_latency.

On Sat, 3 Oct 2009 13:42:29 +0200
Johan Hovold <jhovold@...il.com> wrote:

> On Fri, Oct 02, 2009 at 05:33:08PM +0100, Alan Cox wrote:
> > For upstream how does this look as a tidy up
> 
> I found a couple of issues: 
> 
>  - The patch breaks unthrottling, as it checks THROTTLE before resubmitting
>    urb whereas unthrottle checks ACTUALLY_UNTROTTLED which is never set.
> 
>  - The countread stuff should also be removed from
>    ftdi_read_bulk_callback as they where only used for updating
>    rx_bytes,
> 
> And, obviously, this doesn't solve the problem of tty_flip_buffer_push
> being called from interrupt context (but I assume that was never the
> intention).

Calling tty_flip_buffer_push from an interrupt is perfectly acceptable
providing tty->low_latency isn't set: which it isn't.
 
> I've actually been working on cleaning up ftdi_sio inspired by the
> generic driver. I also threw out the work queue, but had not noticed the
> unused rx_byte yet. I also used the generic drivers scheme of not
> pushing to tty until unthrottled, but as you point out this is not really
> needed anymore.

The generic driver is a very bad example to follow in some areas but
this looks a big improvement. There are some patches reworking the
generic code to use kfifo on the output side which make it vastly better.
Not sure where the relevant google submissions went ?

> -	spin_lock_irqsave(&priv->rx_lock, flags);
> -	priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED);
> -	spin_unlock_irqrestore(&priv->rx_lock, flags);
> +	spin_lock_irqsave(&port->lock, flags);
> +	port->throttled = 0;
> +	spin_unlock_irqrestore(&port->lock, flags);

If you only have a single bit use the set_bit/clear_bit/test_and_xxx_bit
stuff as it's faster on most boxes

> +	 * The per character mucking around with sysrq path it too slow, so
> +	 * shortcircuit it in the 99.9999999% of cases where the USB serial is
> +	 * not a console anyway.
> +	 */
> +	ch = packet + 2;
> +	len -= 2;
> +	if (!port->console || !port->sysrq)

You need && flag == TTY_NORMAL ?

Definitely a move in the right direction
--
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