From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752174AbdJaI43 (ORCPT ); Tue, 31 Oct 2017 04:56:29 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:49414 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbdJaI40 (ORCPT ); Tue, 31 Oct 2017 04:56:26 -0400 X-Google-Smtp-Source: ABhQp+SS5PB0GypWzO1Gu7pZprD5v48k1dft5Jx1Hnnne8uVk8d+Baw5bHoF/h47gzzwaP/9ZGb+9A== Date: Tue, 31 Oct 2017 09:56:24 +0100 From: Johan Hovold To: "Ji-Ze Hong (Peter Hong)" Cc: johan@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, hpeter+linux_kernel@gmail.com, peter_hong@fintek.com.tw Subject: Re: [PATCH V1 1/2] usb: serial: f81534: fix hang-up on overrun Message-ID: <20171031085624.GN7223@localhost> References: <1507861295-10071-1-git-send-email-hpeter+linux_kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1507861295-10071-1-git-send-email-hpeter+linux_kernel@gmail.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) > +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