Received: by 10.223.176.46 with SMTP id f43csp2719127wra; Mon, 22 Jan 2018 02:12:51 -0800 (PST) X-Google-Smtp-Source: AH8x224XXhHBWZ3RuTa25PtxmtI5WWPrLXeIoAKEr7WW2yoq9ONodng/zl5RBYXOcNgVwKO3zunR X-Received: by 10.101.81.5 with SMTP id f5mr6654266pgq.78.1516615971561; Mon, 22 Jan 2018 02:12:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516615971; cv=none; d=google.com; s=arc-20160816; b=hyh6k0ab0LSMqG85XYCGTE6DC6WvcCbfkr1XlPRnTusczF9pUd3MpGX3doXtdKTRp/ coKr7ClSAEnLBjp37yuNQM9dr4xNYGB49wTTfOHwOfyRS/jh76Xqrs0txX6UTYyFOU3P 4okqOIo+K+aVM4h1FZ6Xv44TwKjHtGezUrxG6WRv9+4MdMzMahFEZ7hHCedVuOietOIx hFi9eE/5x3ipK49W369NC2Y4zmaq7bneGv8RcPj2jMHkd5/jFvw4rQb1Bd1h3ZvgxbfR vLDPmxfiv4BeEBMTKRQ9DaVWgSTKKVaC0e4U4yya0rW7wadvLk4Rt/i4e7x0BPZXPwbl TtxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=BQrdU5uNv4fZs3m+FieboJMNQ4C6Q0hLXIXNpw4c8Uw=; b=Bn7sw+QMZWcWjcTqr2ZhpIHroVenfqfrqZrJ4EUoxoCxhbt32X7K1qAXcM1/wPouCx 6H9CLbACowRIIr/8Pk/oFIpDbtwNbJMd5o/n+Dvz7Z46ikOv4SRk82SqKTUBIvuKs1+V UvU9L9G80xn3IvhkeIx4jefIsFWfacLcIQfFElKRWIrpLBGCAKp4EzEDD++NVZN2+FC6 SkoOg5gYUeenGsEanBUEg8+hf6rWlU558oYQOCfUMjDyC1lUHgpq8my+cufWXD4WTwDE +SRaQlDaYMyrW0PseXjRfP6aruh/lgzZkytcJbjMnujumAFrgK3HeXKrLZ6mOjJ0I8th xk6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si10306162pgo.780.2018.01.22.02.12.37; Mon, 22 Jan 2018 02:12:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751250AbeAVKLn (ORCPT + 99 others); Mon, 22 Jan 2018 05:11:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:52386 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbeAVKLm (ORCPT ); Mon, 22 Jan 2018 05:11:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 98B6DAAF1; Mon, 22 Jan 2018 10:11:40 +0000 (UTC) Message-ID: <1516615597.7580.7.camel@suse.com> Subject: Re: [PATCH 1/5] USB: serial: f81232: clear overrun flag From: Oliver Neukum To: "Ji-Ze Hong (Peter Hong)" , johan@kernel.org Cc: peter_hong@fintek.com.tw, "Ji-Ze Hong (Peter Hong)" , gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Mon, 22 Jan 2018 11:06:37 +0100 In-Reply-To: <1516607927-8887-1-git-send-email-hpeter+linux_kernel@gmail.com> References: <1516607927-8887-1-git-send-email-hpeter+linux_kernel@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) [..] > +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