Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1392490imm; Sun, 15 Jul 2018 06:43:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcDhXK3HMjxz5//pGkuM/A4AfBjdGPAezyfr4pYSDtT6e0O0BBKX5V1cxIDNaS7oUhC3WkR X-Received: by 2002:a17:902:d24:: with SMTP id 33-v6mr13479112plu.22.1531662204173; Sun, 15 Jul 2018 06:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531662204; cv=none; d=google.com; s=arc-20160816; b=A43MVUImVLGGIJ0i1fzXbCks0vMZIQKJ7kGYqAAlUJYXok8kWO3tf9qx68OwMq9dJu TyBYOvSZu/MUhkK+Gh09OxKaI1KmnAdg688xKiq2tSravudcLqDvzU9JJGO4P/0maVLG jOF870TOLrbK2a5BQhS3QXekH13f9pLFfUcJylzAyG6HZ6Ui6zxQnwcdODyhCycwyIYd +0DvfYw2C5PqtppIRiUSSyaujyxnm8aoDodKvGB/5e8RkoY06hy6+9rhwO7sYrZ2VfB9 /yGAMz0N5LaozylEtRg7iCFRGJxy52z6YVfefLiSE/w9CPjZNCZtSXMNrgdPBl0RM3hF cMMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=w3//MMegry/Mr6ueBbLz58daQRq7pq3d3GyFX/maU5A=; b=O13eA+1hQiE4qkSE24477Y0aQFZJCk9w+85nUi6KH+qNjzGeKsl6DqqLIZG47B6HkI UQKB9wObJjXeS/5LfobObPlBJ5S5FyvJTcvN9bXC8/tDCqhHqAFKbfy4T1nWVdc51LXj cujc3eEchr570Rn8wKFD6/GYEGAPzQ5QKviK/iQBgCLgqfqhpJ9PygED5vIcY41V3yJR JaDdkFD75e/CrKWe2dW37zen9jAdIryXoU5tv4Gliitv1tXlCrfcUrQx4dP9PKb2yJaA MG7iThXwaAaGPKccXCmdLhDX8+wzd3YLK+Z16EkbnjzOGXIfk91K2gQ4gGAhrGL2hDkU 84Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=HMsYDVyG; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3-v6si4924276pgc.388.2018.07.15.06.43.09; Sun, 15 Jul 2018 06:43:24 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=HMsYDVyG; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbeGOOEv (ORCPT + 99 others); Sun, 15 Jul 2018 10:04:51 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:33481 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbeGOOEm (ORCPT ); Sun, 15 Jul 2018 10:04:42 -0400 Received: by mail-lj1-f193.google.com with SMTP id t21-v6so27769641lji.0 for ; Sun, 15 Jul 2018 06:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=w3//MMegry/Mr6ueBbLz58daQRq7pq3d3GyFX/maU5A=; b=HMsYDVyGVqGaljWu5fCYI/iEVYQkforAo/aYnsJHVXT+uDynt5+kQFwwuiAfJXf8lW nBMT3LXDahWPg2mbfBcTF+RXgoGrAeCn5isoD43Pp1DjBfaMlZF55DSTUzQ4vSwbhFfb RLSas3AKJMkXMviWAMfjfIUfPhfw0bqGc2BGTAvlnynUR+92CakogxmES5vkht5DOHTM Z7/hs6v9dn5WeO6e220QSSVdFJbzmAT20dazFl8IdkrV+SdzXiUFgAfzCDcL9aj2qlA3 zSTBzAwTA6Tg9GdRZF94THdQNDBhOA7T3xQMZwyrOfJTYRHaiDmNbNfJdO3GVaE3R388 p4NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=w3//MMegry/Mr6ueBbLz58daQRq7pq3d3GyFX/maU5A=; b=fahGFi0v+cixjj4CiFVVet7xOim2g89UgwJyibRmTP6zo1JbgMIB/TeMT48jREQe2L bimMAuQmGrcVWXwZcJzuHcGJmR0zutWqPuqhtHiUVPJ9fi8Dpkfq3kN7Qn1/1g4FWgy9 oIJLUMFcZVYQN+u9xlx7e3IjgSNEsJdgrRR5IIaGMcuHdv4/K3cbcSnKKFK9P73GkgMY z6M+lYwUloA7dB9KvDaaLnlfgLHkYCe8VT5/gwoCTj8fkjrznaGq/yzC5VMmJkcj/+fI +OYneQYGCzEK4LlVD9tRjCFppv4bP5+xnwhaN2Rn+MsvY2XRPuAEkSFnloHRAQPTTXL7 fmkg== X-Gm-Message-State: AOUpUlHZ5nCOvtRcMQipeA1Mtbf9WwgTFyaH+pvZHX42Gv9ZAg7Z7Akg 0hKeO5nI+Lur22tKRRxh0ONbTDhP X-Received: by 2002:a2e:4357:: with SMTP id q84-v6mr7525441lja.13.1531662100986; Sun, 15 Jul 2018 06:41:40 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id 97-v6sm4699525lfw.13.2018.07.15.06.41.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Jul 2018 06:41:40 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1fehHI-0006WK-Uv; Sun, 15 Jul 2018 15:41:32 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , Alan Cox , linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 1/3] tty: fix termios input-speed encoding Date: Sun, 15 Jul 2018 15:39:33 +0200 Message-Id: <20180715133935.24964-2-johan@kernel.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180715133935.24964-1-johan@kernel.org> References: <20180715133935.24964-1-johan@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make sure to clear the CIBAUD bits before OR-ing the new mask when encoding the termios input baud rate. This could otherwise lead to an incorrect input rate being reported back and incidentally set on subsequent termios updates. Fixes: edc6afc54968 ("[PATCH] tty: switch to ktermios and new framework") Signed-off-by: Johan Hovold --- drivers/tty/tty_baudrate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c index 6ff8cdfc9d2a..a7a438f54e69 100644 --- a/drivers/tty/tty_baudrate.c +++ b/drivers/tty/tty_baudrate.c @@ -169,6 +169,9 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, ibinput = 1; /* An input speed was specified */ #endif termios->c_cflag &= ~CBAUD; +#ifdef IBSHIFT + termios->c_cflag &= ~(CBAUD << IBSHIFT); +#endif /* * Our goal is to find a close match to the standard baud rate -- 2.18.0