From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22081C433F5 for ; Mon, 11 Apr 2022 17:49:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232952AbiDKRvO (ORCPT ); Mon, 11 Apr 2022 13:51:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348988AbiDKRvN (ORCPT ); Mon, 11 Apr 2022 13:51:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4CF9F30563 for ; Mon, 11 Apr 2022 10:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649699338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UXGTLOLxPKH1dXoFSUyD0fwtbtBqRvFEJetBpSUAEP4=; b=LeDuKrKHghqLcVkanFuTeFFk/bp+3qmr37Ihjk+Tr7NTE65/nNRGrcTNkWit5cd+ZEPJd+ mTDhoPzrLpJeb7eVoAuvsAPLHgirowrRkuQ1zrTh9RG3NpSk3+g0Z6orBSNg91d+DCgpqj 7PHN8EkBAHPZ++BTwVfSL+bIZh+Mv3E= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-277-iCY_hqHFMlKSArpmE8Z_zA-1; Mon, 11 Apr 2022 13:48:53 -0400 X-MC-Unique: iCY_hqHFMlKSArpmE8Z_zA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44AFB80159B; Mon, 11 Apr 2022 17:48:52 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.33.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id B203640BAE6; Mon, 11 Apr 2022 17:48:48 +0000 (UTC) From: Wander Lairson Costa To: Greg Kroah-Hartman , Jiri Slaby , Johan Hovold , "Maciej W. Rozycki" , Andy Shevchenko , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Lukas Wunner , Wander Lairson Costa , =?UTF-8?q?Pali=20Roh=C3=A1r?= , linux-serial@vger.kernel.org (open list:SERIAL DRIVERS), linux-kernel@vger.kernel.org (open list) Cc: ilpo.jarvinen@linux.intel.com, rostedt@goodmis.org, senozhatsky@chromium.org, andre.goddard@gmail.com, sudipm.mukherjee@gmail.com, andy.shevchenko@gmail.com, David.Laight@aculab.com, jonathanh@nvidia.com, phil@raspberrypi.com Subject: [PATCH v6 0/1] serial/8250: Use fifo in 8250 console driver Date: Mon, 11 Apr 2022 14:48:38 -0300 Message-Id: <20220411174841.34936-1-wander@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This is v7 of the serial fifo patch. In relation to the previous reverted patch, I describe the main changes in the "What changed from v3" section. What changed from v6 -------------------- * Add a comment on why we are using tx_loadsz instead of fifosize. What changed from v5 -------------------- * Fixed a typo in patch patch "port-state" becomes "port->state". What changed from v4 -------------------- * It squashes all the patches in a single patch * It adds `port-state &&` check in the `use_fifo` condition as a * preventive measure. What changed from v3 -------------------- * Reads the FCR value from the port struct. The earlier patch erroneously read the value from the controller, but FCR is a write-only register. Thanks to Jiri Slaby for point this out. * Use tx_loadsz as the transmitter fifo size. We previously used the port->fifosize field, which caused data loss in some controllers. Thanks Jon Hunter for the bug report. * Exclude the BCM283x from fifo write. This is based on Phil Elwell's original patch [1]. * Check if the port is initialized before write through fifo. The serial driver set the value of uart_8250_port.fcr in the function serial8250_config_port, but only writes the value to the controller register later in the initalization code. That opens a small window in which is not safe to use the fifo for console write. Unfortunately, I lost track of who originally reported the issue. If s/he is reading this, please speak up so I can give you the due credit. [1] https://lore.kernel.org/all/20220126141124.4086065-1-phil@raspberrypi.com/ Wander Lairson Costa (1): serial/8250: Use fifo in 8250 console driver drivers/tty/serial/8250/8250_port.c | 68 ++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 6 deletions(-) -- 2.35.1