Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp20043imu; Thu, 8 Nov 2018 14:02:38 -0800 (PST) X-Google-Smtp-Source: AJdET5dkoE4Bln4wycqBSFyHkBqg3dbVs92wNjovJsXtPb5iA5O8JS5TKJkhxl6S0PqL2i7RnK/6 X-Received: by 2002:a63:d818:: with SMTP id b24mr926539pgh.174.1541714558771; Thu, 08 Nov 2018 14:02:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714558; cv=none; d=google.com; s=arc-20160816; b=iqUkATlBTbtyJDHIO5Jm+vffQ9n/4Tjth+RBKHt3r6E2IlmQDlJdllg9MG2YIkvCdj hHh1aOEzX4ZH4klNfqENj/TD8kiLMwGXQ8gqjh8ZH3kfoECOh3LOsWF1+K7JfipuqWOo eNoWi0LPlnaK5+SC4KauT3us5xgGhuYz9jaF7rsynH2IxeAEfdGBqFQFRECr381jTqRQ c8X+rD0aWWUoQIYt1wcHAHWz2C+d7J0wXyR1Xa82WC9rVrHx/4j14XcV0sOcSZ4JfJ4g Fig3PMG+Oj9SrERl3zgooajF+V3r29MgmbltinKbwq1Vg+Q6JCEH0UsX7OfuHxL2qEw8 MPyg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tz+tBwrykG45nJ14poGeWkvXWXk2AnNhHqYJ5ACUqn4=; b=GA1kgQsC5nEHIreSKsvvYMKO/Od5JRb257lyqFKjKgIwWGHSHsR2Mgzp6Z3+FxDlTT COLGOeMtFTUr0jlSfKPX++ptXQ2o7/LvqmD6OB6uo8v5Eh5NtKHw4zp+ohNGBIq9P00r IKRsL+uo/7N9TCZ/1zo8FQT26QokUY4uzIdoOmxJIQN/Flycvm0c0bzXz6J8NjYqC7Ac J4TLnBoSQP6CWESCvMaxZTSoKociyFFzr2ngCLvvSFjU8ihRK4wVSFNnHl2+GnRVB81J vhTl7fkv8KbDl2n+Q7mkkeoCBrrIUBhaQQ6HK+DLRdMfd6r6sVu7Q2m8lme3/xShS3lL nhOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XF6Jlh1S; 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 z126-v6si5710945pfb.280.2018.11.08.14.02.23; Thu, 08 Nov 2018 14:02:38 -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; dkim=pass header.i=@kernel.org header.s=default header.b=XF6Jlh1S; 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 S1730888AbeKIHjA (ORCPT + 99 others); Fri, 9 Nov 2018 02:39:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:58524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728090AbeKIHi7 (ORCPT ); Fri, 9 Nov 2018 02:38:59 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E525B20989; Thu, 8 Nov 2018 22:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714490; bh=wS8wQIMy9jV83ey1Z1wplRkCmwoDaQg/zXlWOaRz2cU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XF6Jlh1SyBMR8ExdL4Z6HQ6jaCXZl3y56yuJYsD0/UO8aC4OQJZNfUXrhc8xZmfMK eFubrjfA0dglQInp7bWgcBP05w91tXRAF525ECuVDln+oWqjVMRGtRJZKCAQKmYIma OPFR7BLGYHFick/hEJTYQKeLt3cyAq7X+BFg3waM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tobias Herzog , Oliver Neukum Subject: [PATCH 4.4 108/114] cdc-acm: correct counting of UART states in serial state notification Date: Thu, 8 Nov 2018 13:52:03 -0800 Message-Id: <20181108215110.528165084@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tobias Herzog commit f976d0e5747ca65ccd0fb2a4118b193d70aa1836 upstream. The usb standard ("Universal Serial Bus Class Definitions for Communication Devices") distiguishes between "consistent signals" (DSR, DCD), and "irregular signals" (break, ring, parity error, framing error, overrun). The bits of "irregular signals" are set, if this error/event occurred on the device side and are immeadeatly unset, if the serial state notification was sent. Like other drivers of real serial ports do, just the occurence of those events should be counted in serial_icounter_struct (but no 1->0 transitions). Signed-off-by: Tobias Herzog Acked-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/cdc-acm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -332,17 +332,17 @@ static void acm_ctrl_irq(struct urb *urb if (difference & ACM_CTRL_DSR) acm->iocount.dsr++; - if (difference & ACM_CTRL_BRK) - acm->iocount.brk++; - if (difference & ACM_CTRL_RI) - acm->iocount.rng++; if (difference & ACM_CTRL_DCD) acm->iocount.dcd++; - if (difference & ACM_CTRL_FRAMING) + if (newctrl & ACM_CTRL_BRK) + acm->iocount.brk++; + if (newctrl & ACM_CTRL_RI) + acm->iocount.rng++; + if (newctrl & ACM_CTRL_FRAMING) acm->iocount.frame++; - if (difference & ACM_CTRL_PARITY) + if (newctrl & ACM_CTRL_PARITY) acm->iocount.parity++; - if (difference & ACM_CTRL_OVERRUN) + if (newctrl & ACM_CTRL_OVERRUN) acm->iocount.overrun++; spin_unlock(&acm->read_lock);