[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1516615597.7580.7.camel@suse.com>
Date: Mon, 22 Jan 2018 11:06:37 +0100
From: Oliver Neukum <oneukum@...e.com>
To: "Ji-Ze Hong (Peter Hong)" <hpeter@...il.com>, johan@...nel.org
Cc: peter_hong@...tek.com.tw,
"Ji-Ze Hong (Peter Hong)" <hpeter+linux_kernel@...il.com>,
gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH 1/5] USB: serial: f81232: clear overrun flag
Am Montag, den 22.01.2018, 15:58 +0800 schrieb Ji-Ze Hong (Peter Hong)
:
> The F81232 will report data and LSR with bulk like following format:
> bulk-in data: [LSR(1Byte)+DATA(1Byte)][LSR(1Byte)+DATA(1Byte)]...
>
> LSR will auto clear frame/parity/break error flag when reading by H/W,
> but overrrun will only cleared when reading LSR. So this patch add a
> worker to read LSR when OE.
>
> Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@...il.com>
[..]
> +static void f81232_lsr_worker(struct work_struct *work)
> +{
> + struct f81232_private *priv;
> + struct usb_serial_port *port;
> + int status;
> + u8 tmp;
> +
> + priv = container_of(work, struct f81232_private, lsr_work);
> + port = priv->port;
> +
> + status = f81232_get_register(port, LINE_STATUS_REGISTER, &tmp);
> + if (status)
> + dev_warn(&port->dev, "read LSR failed: %d\n", status);
> +}
Hi,
I am afraid this is incomplete. You are scheduling a work that does IO.
Hence you must cancel that work when the driver is unbound from the
interface. You must also not do IO like this while the system is suspending.
Regards
Oliver
Powered by blists - more mailing lists