Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp251588pxb; Wed, 22 Sep 2021 01:03:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySx53H4x0ROEDC7X9leBYGop47I43jSxyOqkaMFTQOq6diDZCINP14XNkdgu8Rw666Rpac X-Received: by 2002:a17:906:c2cf:: with SMTP id ch15mr39242585ejb.107.1632297806110; Wed, 22 Sep 2021 01:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632297806; cv=none; d=google.com; s=arc-20160816; b=EXo66Vk311oltBsNAnAgYRYdNAqIaD3K3BacXoD6xVvNH2fqC8/9uu7PIdU9I7jePw bXpa9oQPbdok+1TjaN/U8+HDNUWgYVt6fA4u43NO7KhWS4nlH7MZUgEgC39zgYKMBYfn G7RYKUrBt5bKGsgofLwiqKQyu/PUPWW8yIUVkRPA2O+6CWaXUkMdr4hppbP89r3tOR/x Smxno8Yq0QJtHN+h6PwUqTypFSPeNkSdvuWYfq7epxeqRd6xuzwbaFCAFAT0txlQugjs 5QDlE/ofZmp6OtFckM2wDbg2kiV3rZLPNRF7XkMufaL1lGlCJlEUn5tZW+Hi1ZaD7Ygp OHIA== 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:dkim-signature; bh=FWKicJrcp85MwAS6GIvsxnSe5JQ/IEeheZQNsIaTEME=; b=qs49D8bKlzTgrRbsUDqsdHJMB5VtLr4DdkJwAN63QSfexNdXoWZUZUM8jdoR7bFevp o9zsx7VV7drjVrhNb2000Pb3gOwadVXdroLo9w4v19ooPx+TxY81QqIaicdZFsUBfzZs pcVDYNv+YbomfT+TKqLIl0R4e07Y7IULWnMQF0BdGOG8jRC/gauo6v3rfrKu0lUTnU2e iOuYGueskzN84Za175rTxi06CZ7Ej278UhdtF4YGkqxXuAqrhDZ5CALUYGWCyBtANMYN zOWTVDZ0iBVo+J8HTzNEJcIOFPh3QB+0wVk45HePIw1CZUBsDx7Pq+y/lVfv5jqFEgGJ vU8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=1X9GecDM; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si2409445ejy.271.2021.09.22.01.03.02; Wed, 22 Sep 2021 01:03:26 -0700 (PDT) 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=@suse.cz header.s=susede2_rsa header.b=1X9GecDM; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233674AbhIVIB0 (ORCPT + 99 others); Wed, 22 Sep 2021 04:01:26 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:34570 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233427AbhIVIBK (ORCPT ); Wed, 22 Sep 2021 04:01:10 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id DE0A8201C3; Wed, 22 Sep 2021 07:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1632297579; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FWKicJrcp85MwAS6GIvsxnSe5JQ/IEeheZQNsIaTEME=; b=1X9GecDMRiasJ6/Dnd8sl0yFVlQMyp76ZJT0t+jXViFvRtFCLEeIH/brkgsL5NdXs75aOD 9qXo/1Hq/EMrxjXjqN8RMxduvOsjXtvhQUai8Cv6LK+o4ibV/G31h8RYKNagGPXnYD2kf9 eas8giVjVbqnkFrKzGEe2Ieefb7cQnc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1632297579; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FWKicJrcp85MwAS6GIvsxnSe5JQ/IEeheZQNsIaTEME=; b=6kCHZKtp8MVjJNupJqbJ9iTttLKTGOfBYjqrOWkBeglikUpAQwEfwzMMuD3NhJzsS52n01 k4vgE9I6h1A2dXDQ== Received: from localhost.localdomain (unknown [10.100.208.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B737AA3B8D; Wed, 22 Sep 2021 07:59:39 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 6/7] mxser: don't read from UART_FCR Date: Wed, 22 Sep 2021 09:59:37 +0200 Message-Id: <20210922075938.31390-6-jslaby@suse.cz> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210922075938.31390-1-jslaby@suse.cz> References: <20210922075938.31390-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The UART_FCR register is write-only. When reading it, one gets contents of (read-only) UART_IIR instead as they are shared. This mistake was performed in mxser_flush_buffer() to clear FIFOs. Actually FCR handling throughout the driver is completely broken. On many places, it respects neither mu860 settings, nor FIFO (16450 vs 16550) setting. This patch doesn't help to fix this, it actually does the same. We will introduce a mxser_port::FCR in the next patch to fix this issue. Signed-off-by: Jiri Slaby --- drivers/tty/mxser.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 6913a1caa6f0..4ce21cdb1ea5 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -859,17 +859,14 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) static void mxser_flush_buffer(struct tty_struct *tty) { struct mxser_port *info = tty->driver_data; - char fcr; unsigned long flags; spin_lock_irqsave(&info->slock, flags); info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; - fcr = inb(info->ioaddr + UART_FCR); - outb((fcr | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT), + outb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, info->ioaddr + UART_FCR); - outb(fcr, info->ioaddr + UART_FCR); spin_unlock_irqrestore(&info->slock, flags); -- 2.33.0