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]
Date:	Sat, 3 Oct 2009 14:11:40 +0200
From:	Oliver Neukum <oliver@...kum.org>
To:	Johan Hovold <jhovold@...il.com>
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	"Greg Kroah-Hartman" <gregkh@...e.de>,
	Michael Trimarchi <trimarchi@...dalf.sssup.it>,
	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.

Am Samstag, 3. Oktober 2009 13:42:29 schrieb Johan Hovold:
> +       spin_lock_irqsave(&port->lock, flags);
> +       if (!port->throttled) {
> +               spin_unlock_irqrestore(&port->lock, flags);
> +               ftdi_submit_read_urb(port, GFP_ATOMIC);
> +       } else
> +               spin_unlock_irqrestore(&port->lock, flags);
> +}
>  
>  static void ftdi_break_ctl(struct tty_struct *tty, int break_state)
>  {
> @@ -2605,33 +2467,30 @@ static int ftdi_ioctl(struct tty_struct *tty,
> struct file *file, static void ftdi_throttle(struct tty_struct *tty)
[..]
> +       spin_lock_irqsave(&port->lock, flags);
> +       port->throttled = 1;
> +       spin_unlock_irqrestore(&port->lock, flags);
>  }
>  
> -
> -static void ftdi_unthrottle(struct tty_struct *tty)
> +void ftdi_unthrottle(struct tty_struct *tty)
[..]
> +       spin_lock_irqsave(&port->lock, flags);
> +       was_throttled = port->throttled;
> +       port->throttled = 0;
> +       spin_unlock_irqrestore(&port->lock, flags);
>  
> -       if (actually_throttled)
> -               schedule_delayed_work(&priv->rx_work, 0);
> +       if (was_throttled && !test_bit(ASYNCB_CLOSING, &port->port.flags))
> +               ftdi_submit_read_urb(port, GFP_KERNEL);
>  }

This unfortunately is incorrect. If an unthrottling happens before the read
callback runs you submit a running URB.

	Regards
		Oliver
 

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