Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3385725pxb; Mon, 17 Jan 2022 19:16:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9zp94sTtTXdzFE1pLG4s8ODQjnYJdNZPKy2kv2T1y+FGY+NUf9s4Eg54QwBSIreLGQyS3 X-Received: by 2002:a65:68cc:: with SMTP id k12mr19101181pgt.147.1642475803567; Mon, 17 Jan 2022 19:16:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642475803; cv=none; d=google.com; s=arc-20160816; b=Sx380OxZbdEd5OSYXClF0OlfaCWk2L9BsE+HZoWnpsfUGNSr+gf1CXwlxMKjn0wRRc 0M+XbE4z46X70Hkejqh/jNfbxhGCh9Mp9ih8eB3qLa0kS/NLGFGgIjnANoHIKOiuHFv/ Ve++mQn56e52MEX/squU3rgPvGddI3lLDVfj6wEKXvb2UIVfqgMEUtzkmosDZBfDRue9 pL84fY7Zw+W/4SyiFYjOOQNg3Fg3NY/M2WbAMcQYPuIIKkQJVC6WlB1d/kKMbFvhRSzq AA85GeulTpyJyGy/CbeE/4/VAtWd2zkm+scwDqGZNymnXQ2l08qk98fHpEeR1t/g+rNs Z+oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2Lp76LA8ElGHJeKGudcsDVtqjB9NM7xxIj163cjdm8g=; b=CQkZT/2rIedV0Ff7a4u+UATHWhFk4QwtpAPO5QnVZWiTCKQdG9xvs2PFmGNeFAGRRY Rq8A3tqpXGIx+pngKSG41CrWawJITP4YsGMxVnakTbiA2w7ov0yyOH+aDcNlTGO1XjdF jT8b7KppyQUKfLznfkmmsUqg1COBEhKx4Y4NVBgkB7ZeAh92MhsePRHip1wpioWh31z2 iTOUEEsSzQ+dpeMxzpYymcrnGK3JE51s/c/fH2Mmf140CADof3dDRLGkLCxiZoxsFKCa X0LXXdSTfPa/Fbp8NsgRF2hkQzEN0NpfM2+SeyQcCu/R/S8xV7uNY9OVz8aMabgXvD9w Dulw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RWsFXEZC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q13si17935084pfj.320.2022.01.17.19.16.32; Mon, 17 Jan 2022 19:16:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RWsFXEZC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245555AbiARC0r (ORCPT + 99 others); Mon, 17 Jan 2022 21:26:47 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:37778 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245276AbiARCX1 (ORCPT ); Mon, 17 Jan 2022 21:23:27 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F0EB1B81247; Tue, 18 Jan 2022 02:23:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8E76C36AE3; Tue, 18 Jan 2022 02:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472604; bh=iJWsnEH3EqlFoyUdRdRa/2WUrAEJb4H3pNL5VUzpUbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RWsFXEZCMdZw3YBq0Jh02BqE7vF3uwtO5M5GkrYvdQ4B0NNN+EXhlT+/g/nJdD992 ad4qcPUmotWIo1rzd4tzd+LmxVdgTAd6BtkeU3hvq+PC/rK8zDVpQU6Z3pQjwh7U8F OkUFQi4J/Pp5Txl+jTs4j5V+xBupfzJRRi/wy/QVFBSuog7iANghTUm8K32tXl+ssX ynVV2GY/A7f5Wd53IhFsRf6ZYtNp4o16OEFJBTfxRt65/OcllS5kwMk/USNFGnPOB7 /vEBx4d0OqoyUZRny/DqXckvrvux73XklhYniejwXst7K3O4QKFzE/znV9IAZQ56GG GnLwp6hH7WcGQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jiri Slaby , Greg Kroah-Hartman , Sasha Levin , jirislaby@kernel.org, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.16 068/217] mxser: increase buf_overrun if tty_insert_flip_char() fails Date: Mon, 17 Jan 2022 21:17:11 -0500 Message-Id: <20220118021940.1942199-68-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Slaby [ Upstream commit eb68ac0462bffc2ceb63b3a76737d6c9f186e6de ] mxser doesn't increase port->icount.buf_overrun at all. Do so if overrun happens, so that it can be read from the stats. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-17-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/mxser.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 3b5d193b7f245..39458b42df7b0 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -1536,7 +1536,8 @@ static bool mxser_receive_chars_new(struct tty_struct *tty, while (gdl--) { u8 ch = inb(port->ioaddr + UART_RX); - tty_insert_flip_char(&port->port, ch, 0); + if (!tty_insert_flip_char(&port->port, ch, 0)) + port->icount.buf_overrun++; } return true; @@ -1582,8 +1583,10 @@ static u8 mxser_receive_chars_old(struct tty_struct *tty, port->icount.overrun++; } } - if (!tty_insert_flip_char(&port->port, ch, flag)) + if (!tty_insert_flip_char(&port->port, ch, flag)) { + port->icount.buf_overrun++; break; + } } if (hwid) -- 2.34.1