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: <20201008152103.GK26280@localhost>
Date:   Thu, 8 Oct 2020 17:21:03 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Helge Deller <deller@....de>
Cc:     Johan Hovold <johan@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] USB: serial: ftdi_sio: Fix serial port stall after resume

On Tue, Sep 29, 2020 at 09:33:27PM +0200, Helge Deller wrote:
> With a 4-port serial USB HUB with FT232BM chips the serial ports stop
> working after a software suspend/resume cycle.
> Rewriting the latency timer during the resume phase fixes it.

Hmm. This sounds weird. Why would the latency timer make such a
difference?

> Cc: stable@...r.kernel.org
> Signed-off-by: Helge Deller <deller@....de>
> 
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index 9823bb424abd..8ee6cf6215c1 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -1092,6 +1092,7 @@ static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base);
>  static u32 ftdi_232bm_baud_to_divisor(int baud);
>  static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base);
>  static u32 ftdi_2232h_baud_to_divisor(int baud);
> +static int ftdi_reset_resume(struct usb_serial *serial);
> 
>  static struct usb_serial_driver ftdi_sio_device = {
>  	.driver = {
> @@ -1122,6 +1123,7 @@ static struct usb_serial_driver ftdi_sio_device = {
>  	.set_termios =		ftdi_set_termios,
>  	.break_ctl =		ftdi_break_ctl,
>  	.tx_empty =		ftdi_tx_empty,
> +	.reset_resume =		ftdi_reset_resume,
>  };
> 
>  static struct usb_serial_driver * const serial_drivers[] = {
> @@ -2379,6 +2381,16 @@ static int ftdi_stmclite_probe(struct usb_serial *serial)
>  	return 0;
>  }
> 
> +static int ftdi_reset_resume(struct usb_serial *serial)
> +{
> +	struct usb_serial_port *port = serial->port[0];
> +
> +	if (tty_port_initialized(&port->port))
> +		write_latency_timer(port);

Why are you only doing this for open ports?

> +
> +	return usb_serial_generic_resume(serial);
> +}

And if the device has been reset there may need to reconfigured the
termios settings for open ports.

Could you expand a bit on what the problem is here?

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ