Re: [PATCH V1 1/2] usb: serial: f81534: fix hang-up on overrun
From: Johan Hovold
Date: Tue Oct 31 2017 - 04:56:33 EST
On Fri, Oct 13, 2017 at 10:21:34AM +0800, Ji-Ze Hong (Peter Hong) wrote:
> The F81532/534 without this patch will hang-up on data overrun.
>
> It's caused by enable LSR interrupt in IER by default and occur data
> overrun, the chip will busy for process LSR interrupt but not read LSR
> internally. It will not responed for USB control endpoint0 and we can't
> read LSR from driver in this situration.
>
> So we'll disable the LSR interrupt in probe() and submit the LSR worker to
> clear LSR state when reported LSR error bit with bulk-in data in
> f81534_process_per_serial_block().
>
> Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@xxxxxxxxx>
> +static void f81534_lsr_worker(struct work_struct *work)
> +{
> + struct f81534_port_private *port_priv =
> + container_of(work, struct f81534_port_private,
> + lsr_work);
> + struct usb_serial_port *port = port_priv->port;
I separated declaration from initialisation here to avoid the line
breaks.
> + int status;
> + u8 tmp;
> +
> + status = f81534_get_port_register(port, F81534_LINE_STATUS_REG, &tmp);
> + if (status)
> + dev_warn(&port->dev, "read LSR failed: %x\n", status);
And I changed this to %d before applying as you're printing a negative
errno here.
> +}
> +
Now applied for -next.
Thanks,
Johan