From patchwork Wed Apr 21 09:54:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2CFDC433B4 for ; Wed, 21 Apr 2021 09:55:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E27E6008E for ; Wed, 21 Apr 2021 09:55:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238694AbhDUJ4M (ORCPT ); Wed, 21 Apr 2021 05:56:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:52426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238576AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1FB8F61453; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=pa2npGgbk/pUlI/g0K19S40FBZbfELBPNGkOpCb7nns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PkqDH4cXM8jKE+FmS4H6DcmciIQcs7HSmin9B1+JcHhLv8gf4KuwK5XNl8uxmULh1 vubx8ib1+3apmsiQ/lRAstEttPaoo1YNbeWx7O56RTfmMp352GLwTvusEqjT1yi0TP GhJI9742bjTh8WJEtN8RnXwNg9YAiblWgWoJMdCFc5u0YQRRCN4gNS9/JJJ6Yme818 95xNXVf6de2PNZ3eba90xNqDDoaZohPtmADb06TE3nJGW0mO4cWbsauFbhlywICKa6 oeTjdMy74c0JK1vBt7BuxFGu3UN0o8mjh7nBfJfsAjmvnVLBXABLxyNMUF+/dP6VLW XE8u4ca8wOV0A== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a6-0000oN-Pg; Wed, 21 Apr 2021 11:55:38 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 01/26] tty: mxser: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:44 +0200 Message-Id: <20210421095509.3024-2-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 67d2bc58afdd ("Char: mxser_new, fix recursive locking") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/lkml/3018694794025219@wsc.cz/T/#m06b04c640a7b6f41afb3d34a4cf29b1df4935d3a Signed-off-by: Johan Hovold Reviewed-by: Jiri Slaby --- drivers/tty/mxser.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 2d8e76263a25..16a852ecbe8a 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -2155,14 +2155,7 @@ static void mxser_receive_chars(struct tty_struct *tty, port->mon_data.rxcnt += cnt; port->mon_data.up_rxcnt += cnt; - /* - * We are called from an interrupt context with &port->slock - * being held. Drop it temporarily in order to prevent - * recursive locking. - */ - spin_unlock(&port->slock); tty_flip_buffer_push(&port->port); - spin_lock(&port->slock); } static void mxser_transmit_chars(struct tty_struct *tty, struct mxser_port *port) From patchwork Wed Apr 21 09:54:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E73ACC43460 for ; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B230F61584 for ; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238607AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:52292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236658AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0863E61449; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=VDY8bT7ZtIVa5rbi0AREGhMpOoStmEZTySzaL8SpSY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lgfOiJEApY8BJ52tzHEsOO1DppxksDEmgge+mDEgf6Lugl28WGiubjIeC6rsKo6qr iS/j4ebgcKcO30vg1eLgW/e4rPSg9MJJoXD87Wm885FhMMvGpEyhV21W29KZ1uUU18 vyHxZ0s8u6X+JsfXP6fNfitDJJrgWxe4m7G8QP1soLC2s0Tr5Bm86t53dX9xm/3iLv bD7ny5z5xe62ig+ya87DosOPKMxha2OqnV6Ubp9j55UIgla6xwPPQOz0OfA91ukWTE OJUYlsJvjE2820BqVsuI1bHp65/TTUjHrNWN+99yxWGYtEMSaHU1D8hLi2EDKBI8Vf AIp/hPVRXiQ1w== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a6-0000oP-SG; Wed, 21 Apr 2021 11:55:38 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Tobias Klauser Subject: [PATCH 02/26] serial: altera_jtaguart: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:45 +0200 Message-Id: <20210421095509.3024-3-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 53dd0ba7a6f4 ("tty: serial: altera_jtag: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Cc: Tobias Klauser Signed-off-by: Johan Hovold --- drivers/tty/serial/altera_jtaguart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index d0ca9cf29b62..23c4e0e79694 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -131,9 +131,7 @@ static void altera_jtaguart_rx_chars(struct altera_jtaguart *pp) uart_insert_char(port, 0, 0, ch, flag); } - spin_unlock(&port->lock); tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } static void altera_jtaguart_tx_chars(struct altera_jtaguart *pp) From patchwork Wed Apr 21 09:54:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 873BBC43600 for ; Wed, 21 Apr 2021 09:55:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5664E61449 for ; Wed, 21 Apr 2021 09:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238681AbhDUJ4L (ORCPT ); Wed, 21 Apr 2021 05:56:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:52328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238572AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 19EF861451; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=cURs5qeivDO5gSpr3eXq9wzmT4dyWiefnPZY7i1667s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U+KYjIEvH9GgdfxZNZcO1DDWyZcnv8ddmk5RhHUdm6aSSIfNCEl9dSMUcPLgOageL 6IOlDbO0Qd3zBKHrDwQJYvUu5bULwmIazEH5oifM0WTISWEhcuS2gqAly+kY4yotZ7 L/j0ldBynmpxM7dLkvcnmk00bZdfonccanPiLEyEOgndL7/ZGNz0Sg7b0V3TtpxEZm 3JlcMmovw/f+I1Lk1rs0rIAtY1v7tRNZgwVp122u4n8vKuRfUoIsEjavj0ycmhXtFP HxXrzm4W1+j25Lu+qkvIh+XEBCBgIFyCdpPJHrnnPp8LYl5wEtL842xx7jHKSiTNfg MZi7rk96MtPlA== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a6-0000oR-Uu; Wed, 21 Apr 2021 11:55:38 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Tobias Klauser Subject: [PATCH 03/26] serial: altera_uart: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:46 +0200 Message-Id: <20210421095509.3024-4-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit dd085ed8ef6c ("tty: serial: altera: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Cc: Tobias Klauser Signed-off-by: Johan Hovold --- drivers/tty/serial/altera_uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index 0e487ce091ac..7c5f4e966b59 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c @@ -243,9 +243,7 @@ static void altera_uart_rx_chars(struct altera_uart *pp) flag); } - spin_unlock(&port->lock); tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } static void altera_uart_tx_chars(struct altera_uart *pp) From patchwork Wed Apr 21 09:54:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425688 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3583C43470 for ; Wed, 21 Apr 2021 09:55:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 874DE61451 for ; Wed, 21 Apr 2021 09:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238679AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:52306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238564AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 100E46144E; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=nhn87CK4iJ6zTd1Da+AXyC2e1yQ842t5WMdzZhpMx58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nXC1quQIu4wfT/xbPUu7Ld+vnlbrcxuc+y/c9XSH5P9ItoR0uWWuc1PBiRNVYb3ms 8QAmnr2JEhr6X4Stt7kRiJksavMY+foLiVwe95NtIPuvmQBydI2iNkHPbIE8q79/i7 uc+GqjTZKc5jM6Q5gil3xO0qd26pcUDieoRgISN0tZuo+PvnKlrzU8mmpbro75ccZe QnTGmBttchBoQMIBxSHK/R9mwLmv/m7gXTdOH7NpYAX7R0M0ckFlfeUFyQkKZ4fR88 dN9OAzBCLVaPPEXXxhBCQHcr8w4CZBZofuSjzieKyx1FluhPKitoFESmCd+DIlo1KP /jL2/75gDF3dQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000oV-1V; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Russell King Subject: [PATCH 04/26] serial: amba-pl010: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:47 +0200 Message-Id: <20210421095509.3024-5-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 2389b272168c ("[ARM] 4417/1: Serial: Fix AMBA drivers locking") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Cc: Russell King Signed-off-by: Johan Hovold --- drivers/tty/serial/amba-pl010.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c index 3f96edfe569c..e744b953ca34 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -159,9 +159,7 @@ static void pl010_rx_chars(struct uart_amba_port *uap) ignore_char: status = readb(uap->port.membase + UART01x_FR); } - spin_unlock(&uap->port.lock); tty_flip_buffer_push(&uap->port.state->port); - spin_lock(&uap->port.lock); } static void pl010_tx_chars(struct uart_amba_port *uap) From patchwork Wed Apr 21 09:54:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ED9DC43462 for ; Wed, 21 Apr 2021 09:55:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E262861440 for ; Wed, 21 Apr 2021 09:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238664AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:52302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238561AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D66F6144D; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=lvwBKD97+NUIwzp6iuTX9dyTCtZuijRxUhqW74+TeWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzZU18GKmzQGtWSiF3u7PXq+tZoDUEEPqjdSlVbN0TinJZHKKp/3KqZbc7UX7kVX2 S5IGXt6Eji0dk7Z25gxtwdZ/3EmQLeHjs0mibXxFSvaGjXc8Nw9qTTdKbicR3ZY/Mp YZgEsZBsCwGZMuoQ0dUd1K5opQ3QwmndGphFj2g2bPygKcEmNq4k6LBhsRpHGssE29 /Jv0CoHWOpO2HpxnvsH9DeBN9A9buVwzo1UMhy7ft+FYU+JfXv6yU6YJWCNcGva7j9 8qAENV+wQaxpFVpxrSZA45oC9WCtwRCW36WJd5M6rHdih/+rlLU0Ro36OEU0LMiB8S gkAKTkKYe9okw== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000oY-4S; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Linus Walleij , Russell King Subject: [PATCH 05/26] serial: amba-pl011: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:48 +0200 Message-Id: <20210421095509.3024-6-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit ead76f329f77 ("ARM: 6763/1: pl011: add optional RX DMA to PL011 v2") added RX DMA support and also reproduced the workaround for the infamous low_latency behaviour of tty_flip_buffer_push() by dropping and reacquiring the port lock during receive processing. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Note that the port lock is also dropped in the PIO path (see pl011_rx_chars), but it is not clear whether this is still needed by the DMA code added by the aforementioned commit. Cc: Linus Walleij Cc: Russell King Signed-off-by: Johan Hovold Reviewed-by: Linus Walleij --- drivers/tty/serial/amba-pl011.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 4ead0c9048a8..78682c12156a 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -937,12 +937,10 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap, fifotaken = pl011_fifo_to_tty(uap); } - spin_unlock(&uap->port.lock); dev_vdbg(uap->port.dev, "Took %d chars from DMA buffer and %d chars from the FIFO\n", dma_count, fifotaken); tty_flip_buffer_push(port); - spin_lock(&uap->port.lock); } static void pl011_dma_rx_irq(struct uart_amba_port *uap) From patchwork Wed Apr 21 09:54:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3B4DC43616 for ; Wed, 21 Apr 2021 09:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 985676008E for ; Wed, 21 Apr 2021 09:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238700AbhDUJ4O (ORCPT ); Wed, 21 Apr 2021 05:56:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:52428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238595AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1749361450; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=//83zS1ZBhRXsUePF94O/LAAvE4gdmM6NVLpqE0AkyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=trZ3ds7ezLkR0FwnVus7VJD54aK3VeejKJg7SLDa6DmE+vKFah6CDg2kKCsy1AhTj la+Nrl/xQqdpOZ/a2ZZ1U3Ahc4eRWBI6LYauernDB2hJQk5wu0xukCyCDOnmx3JXZq Zk0UhvZlUQAbwMiGu4gWv9iwnnsrisNv7IZY+q2jiFe638UAZ5BjYOOo0NWb92yXUW lV+rbrWx2EeVhk3Z+5WioiWCHXlX2qcP2ru5zCVwhYdEYoadvZ45dNj0O5gHgHqfi3 4R4eAhO7YRaUhthQ4SKaSrk/dfoRIKkb+itzKKANIDKapE0yfC7V9be7MFkD1TwWUH bwOPWsGFDaiKQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000ob-7O; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 06/26] serial: apbuart: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:49 +0200 Message-Id: <20210421095509.3024-7-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 78d34d75c84d ("tty: serial: apbuart: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Signed-off-by: Johan Hovold --- drivers/tty/serial/apbuart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c index e8d56e899ec7..d8c937bdf3f9 100644 --- a/drivers/tty/serial/apbuart.c +++ b/drivers/tty/serial/apbuart.c @@ -117,9 +117,7 @@ static void apbuart_rx_chars(struct uart_port *port) status = UART_GET_STATUS(port); } - spin_unlock(&port->lock); tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } static void apbuart_tx_chars(struct uart_port *port) From patchwork Wed Apr 21 09:54:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B527C43617 for ; Wed, 21 Apr 2021 09:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2419D61448 for ; Wed, 21 Apr 2021 09:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238698AbhDUJ4N (ORCPT ); Wed, 21 Apr 2021 05:56:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:52430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238583AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1CB6A6144F; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=dLdHsb0G5vHHwinxbCFbMP5LZuwkh8IRJ8RB0D4Yqzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5riJqE6OIsWtN/+3NKWPNr9jKi1Gj43LxlGFNQN1T60or2LGD0HiUSQAfVi6v3CE YV45JGK2dsRqBu6zQsyS+gxfILfis/j9uNH0f1yfX2z2654qob8uMaeRAT6Tc/l0MR ogh/wI97yp5WlaVBcvUsfgZIBfgD+mYevx2IqUXTOQTLy7sA5bTTsX6neaL++ZaSIW c/G+pjsugHpFs7ZZKAI5+K4zYyzvpfBGKR+3Z1/jPWQ7vcz47fGNUcuHWzMeTp+4Ub 8Ep6tP+GOgjxLLG5TU4U++OqmGYV3219MYPxUDOn3e/9GtT1iHbs/4g9a7phDVHWWP 3OFScldzFMxUA== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000oe-9s; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 07/26] serial: ar933x: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:50 +0200 Message-Id: <20210421095509.3024-8-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit b16c8e3eed12 ("tty: serial: ar933x: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Signed-off-by: Johan Hovold --- drivers/tty/serial/ar933x_uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index c2be7cf91399..4379ca4842ae 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -385,9 +385,7 @@ static void ar933x_uart_rx_chars(struct ar933x_uart_port *up) tty_insert_flip_char(port, ch, TTY_NORMAL); } while (max_count-- > 0); - spin_unlock(&up->port.lock); tty_flip_buffer_push(port); - spin_lock(&up->port.lock); } static void ar933x_uart_tx_chars(struct ar933x_uart_port *up) From patchwork Wed Apr 21 09:54:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39676C43470 for ; Wed, 21 Apr 2021 09:55:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 079836008E for ; Wed, 21 Apr 2021 09:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236658AbhDUJ4O (ORCPT ); Wed, 21 Apr 2021 05:56:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:52442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238601AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2834D61440; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=aru/Ih0Av7GxzcZcazb+Ui9kYy6sVxdsNzB3eD0DMVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=StWhLcMAqMUJ8fHHL5DcwDmNGq/ksYveAqWKnvBEj9MPYPPVHXBWvL3Q2VeLOcGTv CMd++XaVrW1qbZP8AXHuZkqEsOuBTTYj8oqMpx4fYjbbaKMamn2Mror9+FTViL040f PTN72rr8dqZR9gs+8xjDd7bhJRT+YNoUJTBwUXFtsU/u0Ryzxp/HOSm8h4P+3dJILj sYdx5NVU0q6rKGeq3c21pJuFMzOZbJVsW2y5Fo+xZxJ0BruFiVLZSwraZTA1xy8nsn 11aMZvByRtOrkMABdHzgRUlYQiVxSsq9TNyV6sJZwQDxIF1NYAkKaUEgGjONtzUv1G z8n8eCqfLJ0Ew== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000oh-Ca; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Vineet Gupta Subject: [PATCH 08/26] serial: arc_uart: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:51 +0200 Message-Id: <20210421095509.3024-9-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 3fa1200851c7 ("tty: serial: arc: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Cc: Vineet Gupta Signed-off-by: Johan Hovold --- drivers/tty/serial/arc_uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index 17c3fc398fc6..1a9444b6b57e 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c @@ -236,9 +236,7 @@ static void arc_serial_rx_chars(struct uart_port *port, unsigned int status) if (!(uart_handle_sysrq_char(port, ch))) uart_insert_char(port, status, RXOERR, ch, flg); - spin_unlock(&port->lock); tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } while (!((status = UART_GET_STATUS(port)) & RXEMPTY)); } From patchwork Wed Apr 21 09:54:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426127 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D14CC4360C for ; Wed, 21 Apr 2021 09:55:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A75F61449 for ; Wed, 21 Apr 2021 09:55:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238687AbhDUJ4M (ORCPT ); Wed, 21 Apr 2021 05:56:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:52432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238597AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2C43161457; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=i9atm7wmPJeQwTfhi8Aqvj/HCbBa43kwL5SDOxWMer0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k4I+IO5bhSqd9MtqHtgdL4fswqpXZuYFI6Yxe9t04apuJc0MJ7nbNw4Zq1SqqRM2E lklwSKlJMYkVw/a/u8P4S6Kj+HSLH+sN20lmaP4F/TkNrXDyFk23blzISUzH50fPqu DqAnfnIT9/K3+Y8C2YDLcaaRP4ia3SP5H5fefz6VxBFQJT1s1WWdtubGVu31vRzXZF qMKZSJc1bDC/wAlkqpAlLJUslu9N458JwvqjDvs5kpMOrfQQRgBXSKBaHMEnZb0t+l LHaMFZp+5xQgG77H9kfjri26rj7sWG6NtFraZ4T0eJFSYeSZTS2hbqvI3Uii53KxMe OiYTqWvJ53sug== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000ok-FL; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Richard Genoud Subject: [PATCH 09/26] serial: atmel_serial: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:52 +0200 Message-Id: <20210421095509.3024-10-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 1ecc26bd2789 ("atmel_serial: split the interrupt handler") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by dropping and reacquiring the port lock in the tasklet callback. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Cc: Richard Genoud Signed-off-by: Johan Hovold --- drivers/tty/serial/atmel_serial.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index a24e5c2b30bc..058886d9045b 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1178,13 +1178,7 @@ static void atmel_rx_from_dma(struct uart_port *port) 1, DMA_FROM_DEVICE); - /* - * Drop the lock here since it might end up calling - * uart_start(), which takes the lock. - */ - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); atmel_uart_writel(port, ATMEL_US_IER, ATMEL_US_TIMEOUT); } @@ -1576,13 +1570,7 @@ static void atmel_rx_from_ring(struct uart_port *port) uart_insert_char(port, status, ATMEL_US_OVRE, c.ch, flg); } - /* - * Drop the lock here since it might end up calling - * uart_start(), which takes the lock. - */ - spin_unlock(&port->lock); tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } static void atmel_release_rx_pdc(struct uart_port *port) @@ -1667,13 +1655,7 @@ static void atmel_rx_from_pdc(struct uart_port *port) } } while (head >= pdc->dma_size); - /* - * Drop the lock here since it might end up calling - * uart_start(), which takes the lock. - */ - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); atmel_uart_writel(port, ATMEL_US_IER, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT); From patchwork Wed Apr 21 09:54:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3E42C433B4 for ; Wed, 21 Apr 2021 09:55:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67F4361456 for ; Wed, 21 Apr 2021 09:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238774AbhDUJ4T (ORCPT ); Wed, 21 Apr 2021 05:56:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:52430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238644AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1925C61582; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=Ksv9YjFjtrxObzx24ubHLCHYQzR97rDs6O9O5M32Y9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xo+gdLo0wZl88+ZIU9ETD9DQj6nAHMGqRZR2vfMBWax16YBxqPkVI5VMNVSWs4qnK Zd4TWxWiHjicP+wl+WqBseoTfB4K21KLh3erQaiCWT/opq0Ek42jQzGJ9C2ipNBZ4x mSImIylqi+06i72GoMQ74cmWFMJLCP/Jlxyv5bz0qpboJvHV67JhAQW3w6eQPKYShW t99UXt06Pdfx3CcuXE5kzQlSvJkCZsA4Jv1n+PEJR5a/cqXgJ18FPaOHZif8jZhNdV 05T6y+XIcK+EA9GMTMDaaJhbaI5ZIEYxWTOnQtOqKMi6KAajDBNdKlYJz5j3VEoI3K cxsKw49p2AxRQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000on-Hf; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 10/26] serial: bcm63xx: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:53 +0200 Message-Id: <20210421095509.3024-11-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit b4d499241c34 ("tty: serial: bcm63xx: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Signed-off-by: Johan Hovold --- drivers/tty/serial/bcm63xx_uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c index 5674da2b76f0..5fb0e84f7fd1 100644 --- a/drivers/tty/serial/bcm63xx_uart.c +++ b/drivers/tty/serial/bcm63xx_uart.c @@ -294,9 +294,7 @@ static void bcm_uart_do_rx(struct uart_port *port) } while (--max_count); - spin_unlock(&port->lock); tty_flip_buffer_push(tty_port); - spin_lock(&port->lock); } /* From patchwork Wed Apr 21 09:54:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426124 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A24B7C43618 for ; Wed, 21 Apr 2021 09:55:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 730AF6008E for ; Wed, 21 Apr 2021 09:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238712AbhDUJ4P (ORCPT ); Wed, 21 Apr 2021 05:56:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:52444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238604AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6752561469; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=M3Pf9wAJy/8y/JxadSNZvlF/wHl5gLPyQbG2/y5Chec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=olJS+bQfx2QIzM5dhDM39QJZztvW69JcgeMS5+Cx19JjvKZ8/vqJxjQGNt5AZxPkY EMIRfpnRkKBYPwnn3lv4aqQSveQ3pym8K0+TgrVC5byJXTS1MyPOMA5/I26iT8qiZ4 VQO9eBJdYLcV1pMgZFgSBWSTtuNSW4xrgaWLi35JHEFQRlHWt3Nh9cojg6g/lWxTnT Au3gBm0et0ZTEz1wousLmibJ8AmP75le25aMwuDkkfptkWKPB8QSj1wM5huAR7SGRl nTfQL3rmqeOSH91UjEWQMez6hnMAir4+HDTuE6XqGI9yRFYdWjV6A0cpAwiLSfTOit +/tZc8gkAdtIA== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000or-KZ; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 11/26] serial: icom: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:54 +0200 Message-Id: <20210421095509.3024-12-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 5faf75d7fed2 ("tty: serial: icom: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Signed-off-by: Johan Hovold --- drivers/tty/serial/icom.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c index 94af7a5ea497..9e9abfc4824a 100644 --- a/drivers/tty/serial/icom.c +++ b/drivers/tty/serial/icom.c @@ -829,9 +829,7 @@ static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port) } icom_port->next_rcv = rcv_buff; - spin_unlock(&icom_port->uart_port.lock); tty_flip_buffer_push(port); - spin_lock(&icom_port->uart_port.lock); } static void process_interrupt(u16 port_int_reg, From patchwork Wed Apr 21 09:54:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27B69C43619 for ; Wed, 21 Apr 2021 09:55:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F11AC61440 for ; Wed, 21 Apr 2021 09:55:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238716AbhDUJ4P (ORCPT ); Wed, 21 Apr 2021 05:56:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:52466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238605AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 734816143D; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=Xai30bPlo7ZkE9R0WT11XxAtQnG6hlhEwzXdh169xmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ILjwThCJse63WRaNAKPK8maYE2RXBUt7zxNsB7XX6+MuCXQos3rHyG9EyROja2VYh 9dwWDP7v8jQLk0qcUbJTILB3oklyVh+OfUUkLHue3LWjhSdio0d9j2HACkkR4D6i2p 6ObE9g2/Z+fRyH91xmRufDB+aHLeGCr3Pj8hbu3pdDtiYHyR2put4WuDV+ZIhaS1WV DOG42B8Nz0EX0ndAJn8jgBpjVsVTwpCmXHYb2ruOytEuGAwRPAB65V/Npx+WL1mfle 36ueGzsN6i5hH7mPk8yjAGO8zhlPqVsTDV+Wj4cmSD9MNTqGoa73/m4TTTGPAyqoUy 4Qq0HiU1scpDg== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000ou-Nd; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 12/26] serial: lpc32xx_hs: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:55 +0200 Message-Id: <20210421095509.3024-13-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit ec128510905c ("tty: serial: lpc32xx_hs: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Signed-off-by: Johan Hovold --- drivers/tty/serial/lpc32xx_hs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index 1fa098d7aec4..b199d7859961 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -273,9 +273,7 @@ static void __serial_lpc32xx_rx(struct uart_port *port) tmp = readl(LPC32XX_HSUART_FIFO(port->membase)); } - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); } static void __serial_lpc32xx_tx(struct uart_port *port) From patchwork Wed Apr 21 09:54:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D5CAC433ED for ; Wed, 21 Apr 2021 09:55:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48E2C61440 for ; Wed, 21 Apr 2021 09:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238751AbhDUJ4R (ORCPT ); Wed, 21 Apr 2021 05:56:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:52468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238606AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8891061476; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=DCcpn8+8l2aLtK9AKW5k1cue+Hn6i+5BhnYqOqX865Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y/Uqxr/3XQIK7l6SZGxOoi2Qz3BjbMM1tBBk3ygqwkm5ZCvVKQfCv0shfVEIGy97P 5BAxBQY7xCiJ5U4urr3md0qK0LIc3KbZ31wemq31TTqUbqiF21YJq+im5WUXeG+AaM J6eeaeOiIfeJxExebHoY3pwDtONJLjoh+tul9eg1c9Bug+fdRCOhBCLsOG+0rgminC qgus81vH9TcC5A1qeOp3Zs63c2O3RyB66NRTPoRRVS11lHTfnhDMwo53sEtVHVYBqT SKX1+Ibozc1EbfFMA8geFqkLJXddJAdxZUShLAkrmcauV0QxP8uMKR3aLx7GXnfNDz vxTBEtY60gJSg== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000ox-Qf; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 13/26] serial: mcf: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:56 +0200 Message-Id: <20210421095509.3024-14-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 5275ad70fed3 ("tty: serial: mcf: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Signed-off-by: Johan Hovold --- drivers/tty/serial/mcf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c index 09c88c48fb7b..c7cec7d03620 100644 --- a/drivers/tty/serial/mcf.c +++ b/drivers/tty/serial/mcf.c @@ -319,9 +319,7 @@ static void mcf_rx_chars(struct mcf_uart *pp) uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag); } - spin_unlock(&port->lock); tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } /****************************************************************************/ From patchwork Wed Apr 21 09:54:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 480B8C43600 for ; Wed, 21 Apr 2021 09:55:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FD3061446 for ; Wed, 21 Apr 2021 09:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238746AbhDUJ4R (ORCPT ); Wed, 21 Apr 2021 05:56:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:52558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238613AbhDUJ4J (ORCPT ); Wed, 21 Apr 2021 05:56:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 97A7961474; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=GXf9JQz9uOBMOtADoys8RVhTcC0zBy8R1BiZtPKj/QE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eb8U4/U+lXEfqJlwcjFlu4nRlW5tFdfcJvzR+BR0yl+TA3j2MbzfDromZLLje9MAg /OBZ+CJSBjz3SBtsns3CdprESQ8qFHPBXHfZ5/wyOk/OqtiaUvRDbYvkbhSWDWsScG +3Xt2tW156AAq+b253Cu+pp08TvCq2+K0LPaCAhAkB7wJof9xIG7KYnIpnxaA6BlVp dEDnV3DoIemIJ1ZJCjJBMjN6yOvmW1HLYasnaes0BnQ7k43+C+9sUJIvD+xMNrQCgz fv3h9MEj3KNDx3swaTJADMicvq+hZmVEMfP3S4C69wXlXnf8LmiM/JMfVhn4JqlmN5 uLw1qftp+/wWA== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a7-0000p1-TY; Wed, 21 Apr 2021 11:55:39 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 14/26] serial: meson: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:57 +0200 Message-Id: <20210421095509.3024-15-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The meson driver has always carried an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push(), which had already been removed by the time the driver was added by commit ff7693d079e5 ("ARM: meson: serial: add MesonX SoC on-chip uart driver"). Specifically, since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Signed-off-by: Johan Hovold --- drivers/tty/serial/meson_uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index 69eeef9edfa5..529cd0289056 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -226,9 +226,7 @@ static void meson_receive_chars(struct uart_port *port) } while (!(readl(port->membase + AML_UART_STATUS) & AML_UART_RX_EMPTY)); - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); } static irqreturn_t meson_uart_interrupt(int irq, void *dev_id) From patchwork Wed Apr 21 09:54:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44F57C4361A for ; Wed, 21 Apr 2021 09:55:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 090A261449 for ; Wed, 21 Apr 2021 09:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238761AbhDUJ4S (ORCPT ); Wed, 21 Apr 2021 05:56:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:52570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238620AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6E206145B; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=rpTrUwy38tMF4LXHWp5J+Jv1V+4HlHiORTormNkoodU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lvWf0IoKfhZ+hNZQ24jntnjzzoOv1G8xte4bMStk7WAmXLPCb1DUIEXzAOZizz7Xf HVeofCpUtWdDiyYjhJP1hCYhx0a6ncoXIcLMof4XT3s6aCEkmcsUShg1BUY9Q1XH5M cx12uy7NX5R9d3cnrdlTRVm5gdbjy4KgGJZIp16FLE/XuKc4fshO8nTBJTLkXVxX4O w6hu7yLNCiLyd0Ax4AW4KjJIg7WPxKbMHUUR34h7lpMB5gXCzDP0CdQh2N4J0rCJ8L HexyA08lOb/K+w3K0qJC2bu+XJx9uhy9nh2jXGTMyhs1fl8uuuM4abLXemSdtMwgJb o1O89ga9ZjXRw== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000p3-0B; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 15/26] serial: mpc52xx_uart: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:58 +0200 Message-Id: <20210421095509.3024-16-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit fbe543b412ce ("Fix a potential issue in mpc52xx uart driver") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Signed-off-by: Johan Hovold --- drivers/tty/serial/mpc52xx_uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index af1700445251..2704dc988e4a 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c @@ -1421,9 +1421,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port) } } - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); return psc_ops->raw_rx_rdy(port); } From patchwork Wed Apr 21 09:54:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426122 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A303C43462 for ; Wed, 21 Apr 2021 09:55:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2DB961440 for ; Wed, 21 Apr 2021 09:55:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238732AbhDUJ4Q (ORCPT ); Wed, 21 Apr 2021 05:56:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:52426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238621AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D21FC61455; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=CKii/rpne4//E7v8yfodmMiYaYJL3AIV3vZJ95mp1Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BLw891L4tzuFVP0z+EKiE8m9R5X1YQYi0+CbJC83Um0feHv2Fc1VkQweZFE4WmijL KUwkZm9G6HkTTVlnBvnUlcsW+b6ueTaS1W5Il0ztXXzVSmP961/fX84/nt5uPfpSEw K+OIOHDuQPcl7p3o/nw/xsVE9OYZ9J5CvErRHo+fx5KZ+OHJsaqiUuZnkQgyynrbQq OPFDoto0GSicvoeo2ot2jFPK6TRSPn2X5hWNzxYgg4KVl5Xl7ydOqJWguQFyLBJrG7 6PHaXaPJoE+g4Fewx8o7orCmPsRXfagkCDy1Ked32Yzlx0p/uo8YuW6yJoOjiwKi05 GJ6ldV69/KW4A== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000p6-2w; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Andy Gross , Bjorn Andersson Subject: [PATCH 16/26] serial: msm_serial: drop low-latency workaround Date: Wed, 21 Apr 2021 11:54:59 +0200 Message-Id: <20210421095509.3024-17-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit f77232dab25b ("tty: serial: msm: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Cc: Andy Gross Cc: Bjorn Andersson Signed-off-by: Johan Hovold --- drivers/tty/serial/msm_serial.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index 770c182e2208..fcef7a961430 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -757,9 +757,7 @@ static void msm_handle_rx_dm(struct uart_port *port, unsigned int misr) count -= r_count; } - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); if (misr & (UART_IMR_RXSTALE)) msm_write(port, UART_CR_CMD_RESET_STALE_INT, UART_CR); @@ -819,9 +817,7 @@ static void msm_handle_rx(struct uart_port *port) tty_insert_flip_char(tport, c, flag); } - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); } static void msm_handle_tx_pio(struct uart_port *port, unsigned int tx_count) From patchwork Wed Apr 21 09:55:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6083C43461 for ; Wed, 21 Apr 2021 09:55:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83FF86145E for ; Wed, 21 Apr 2021 09:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238727AbhDUJ4Q (ORCPT ); Wed, 21 Apr 2021 05:56:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:52432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238623AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D31FE614A7; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998936; bh=jAhal48nUBkxNr/OI/8m0GEk9l4t0uKOfM2maeSP+18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QXoUqifiL8XidX2+Gpm10yapgoL5Y8Otb7iHgWgPT8LAPwMQnIJ99vP9laCo0pcnq qQqFQ+gk47TCo7XDebjao+7YBBB9tgeCY6E8YbF+YOKmzkCZAB2wdOe1b3VJGLZPxL impnXFIzgZLlpo1fjO5KxebuAHbPJVygQykZzzItDCjq7jjycKFXNK/AHuFRyDFAUX a41X5Y3utiEJSSA/4FrkqNo+32q7kiroaT+caFGorHTyn4rKq6JJukWsvg/uyuqZh2 OBuAtDiHv+EonKEQ5TSKJiJIOyhUR/lEiQBVcaC8BWutrn0qW08K//PjWjuzdCXsDS 3X6Wo5XRp7aug== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pA-5R; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 17/26] serial: owl: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:00 +0200 Message-Id: <20210421095509.3024-18-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The owl driver has always carried an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push(), which had been removed years before the driver was added by commit fc60a8b675bd ("tty: serial: owl: Implement console driver"). Specifically, since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Signed-off-by: Johan Hovold --- drivers/tty/serial/owl-uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c index abc6042f0378..91f1eb0058d7 100644 --- a/drivers/tty/serial/owl-uart.c +++ b/drivers/tty/serial/owl-uart.c @@ -247,9 +247,7 @@ static void owl_uart_receive_chars(struct uart_port *port) stat = owl_uart_read(port, OWL_UART_STAT); } - spin_unlock(&port->lock); tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } static irqreturn_t owl_uart_irq(int irq, void *dev_id) From patchwork Wed Apr 21 09:55:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CE2FC43603 for ; Wed, 21 Apr 2021 09:55:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 435986143D for ; Wed, 21 Apr 2021 09:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238770AbhDUJ4S (ORCPT ); Wed, 21 Apr 2021 05:56:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:52600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238635AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EC0706144B; Wed, 21 Apr 2021 09:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=GVPfk0mAo7vQ7QjS+H2k7vwU1xfsL+gPVDRgR1gJDKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VAFyDP98w31evAM3oupoz3JbyFfMn6JwJEySs4Jx6/UCDv41LBRcki3To9QyXtjSt E2AzZTrw5x40Nz7iYQIbe8b450tJg2Bv4Pkk5l8+iaQbzHhnqvQ+gP2qSG1md1VdUt 3JSLDQUY32gQ04g+rKtPhsq5XHyeUP+afa0aVoFRizMjyuv81vhoNGSC16eqm50hFO hNUAJbRdCE15F4wsheh+abpYJR5Wf5eD6TNGWW1Yw7s/THJIoB0elNEzGQm6NLJxre Y1Q3LqNeztvqZnC+6IUJNK38mYs/kcXI5QdTiyxzBLlPyC3PWqsOWP0VFor5pUrdrQ qd314QtYqjp+A== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pC-7x; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 18/26] serial: rda: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:01 +0200 Message-Id: <20210421095509.3024-19-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The rda driver has always carried an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push(), which had been removed years before the driver was added by commit c10b13325ced ("tty: serial: Add RDA8810PL UART driver"). Specifically, since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Signed-off-by: Johan Hovold --- drivers/tty/serial/rda-uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c index 85366e059258..d550d8fa2fab 100644 --- a/drivers/tty/serial/rda-uart.c +++ b/drivers/tty/serial/rda-uart.c @@ -398,9 +398,7 @@ static void rda_uart_receive_chars(struct uart_port *port) status = rda_uart_read(port, RDA_UART_STATUS); } - spin_unlock(&port->lock); tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } static irqreturn_t rda_interrupt(int irq, void *dev_id) From patchwork Wed Apr 21 09:55:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5025C4363C for ; Wed, 21 Apr 2021 09:55:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A774E61440 for ; Wed, 21 Apr 2021 09:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238777AbhDUJ4T (ORCPT ); Wed, 21 Apr 2021 05:56:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:52604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238640AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 11FCF61581; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=YKMnP0+4p6GKexVrNEN7sv2xmhyZgFqSF1QOLT/GVgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uL9yfpCPXLBNkbfnvYL+7d8+lEQIo7kRyvRKzPgiiZmsKe50beZDA5i7+HfVzpdtV 72ziLDAsCe1eiJAPNFGVjwdyvAhv2wO0F8dRRerOdJi4Lrtu07rftNPOj2YC+7+nfo u8rI8UZeXZavmpnGq/hDcv1goSXtL+zyiZWd+fhTgDJohsEHRd28rKynVhIQ8LYcKb mIy3gV8es3gb1s70+ZG63dwgXdxZJV3DsdftXM3GRZAU7sXhYJez/NOvwJ8fi86yUf AH7Z1B3pQULBUxph/CoSdS4QDjCn0GlvCdi+VWdfYl5BXgh4F4pmLiNyWD6KVzIfUL u5319UUw4TwPQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pF-AW; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Kevin Cernekee Subject: [PATCH 19/26] serial: rp2: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:02 +0200 Message-Id: <20210421095509.3024-20-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit de7053c77123 ("tty: serial: rp2: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Cc: Kevin Cernekee Signed-off-by: Johan Hovold --- drivers/tty/serial/rp2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/rp2.c b/drivers/tty/serial/rp2.c index 5690c09cc041..d60abffab70e 100644 --- a/drivers/tty/serial/rp2.c +++ b/drivers/tty/serial/rp2.c @@ -424,9 +424,7 @@ static void rp2_rx_chars(struct rp2_uart_port *up) up->port.icount.rx++; } - spin_unlock(&up->port.lock); tty_flip_buffer_push(port); - spin_lock(&up->port.lock); } static void rp2_tx_chars(struct rp2_uart_port *up) From patchwork Wed Apr 21 09:55:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39C3AC4361B for ; Wed, 21 Apr 2021 09:55:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 065DD6143D for ; Wed, 21 Apr 2021 09:55:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238780AbhDUJ4T (ORCPT ); Wed, 21 Apr 2021 05:56:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:52654 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238647AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18EE961452; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=Iu7STYqQoU25QYwNxiMypzgo5dwXaP/UJ6w1NJlXkQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PLJO3cVFkPvKUo0Jduizeba4+6ayZsxmcc/n50l4xFf3AU88OHclO6VGmscdSBlqW huksUBwxPuBAknROGVI+CIfCAFChiwPD5C/CwOFyONQbL55n1R8pnUzhNdrYjqpeUK kDtbfWhPNgqnN7N2S6RcRvycthE8hkRPY/L8VgswDSye9LXrLCi/T8DQVocLez8Tkl 1Xh9Fmf1R7p3iQt7dM6+IcfKlxSPEOPK5P0PkWmDkaUV1R8TY+gHSoAThOLn+W+tuC uWPbsGWVm2AQIZv255y0rg877JWullgu6BQJ15WNrncZYplar1Z1uHwM6DFSLLv2cV HnX1eg1Ph2jlw== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pI-D1; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 20/26] serial: sa1100: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:03 +0200 Message-Id: <20210421095509.3024-21-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit 53e0e6706c76 ("tty: serial: sa1100: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Signed-off-by: Johan Hovold --- drivers/tty/serial/sa1100.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index f5fab1dd96bc..697b6a002a16 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c @@ -223,9 +223,7 @@ sa1100_rx_chars(struct sa1100_port *sport) UTSR0_TO_SM(UART_GET_UTSR0(sport)); } - spin_unlock(&sport->port.lock); tty_flip_buffer_push(&sport->port.state->port); - spin_lock(&sport->port.lock); } static void sa1100_tx_chars(struct sa1100_port *sport) From patchwork Wed Apr 21 09:55:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426121 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8723BC43616 for ; Wed, 21 Apr 2021 09:55:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53EF861447 for ; Wed, 21 Apr 2021 09:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238797AbhDUJ4U (ORCPT ); Wed, 21 Apr 2021 05:56:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238650AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2FA486145D; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=0Q1FSWChHoIk65q7u9cztH7Ba1e7MUq1Gmq6C+qJeQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gslRcaUTlMXXSXBT67LcwgbOYA3e3JeucmhBE7LKEJ43J5nHoFWCsVHgk1mdYv1/P Cbx1IQA2wTPhdKxh6aXHAn899Jy7h0v11n8lnlbqS9AB/bBQWLhY8r/TLYqyiWq8UT WPZd2GmjfukEODldBORvNOz+C4ZJC1fhl2uBXUYeXCk/SMjbopC3bsU5ilHcKoEqKd nYvdYg1AohvvSSs3kqcXq+PXArCvGA5Cv/gLqCyf9wtS0fc+AsSjm6v173c/tO3k/7 w8PnVS2P0WzfLY6fgfWTRzM+EpInK4ElZZ3VbehXl2WeKMHpt59EZIVpvdN0guGf76 LWIPosk/bsQUQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pL-FX; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 21/26] serial: txx9: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:04 +0200 Message-Id: <20210421095509.3024-22-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit f5ee56cc184e ("[PATCH] txx9 serial update") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Signed-off-by: Johan Hovold --- drivers/tty/serial/serial_txx9.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c index 7a07e7272de1..0a7e5b74bc1d 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -330,9 +330,9 @@ receive_chars(struct uart_txx9_port *up, unsigned int *status) up->port.ignore_status_mask = next_ignore_status_mask; disr = sio_in(up, TXX9_SIDISR); } while (!(disr & TXX9_SIDISR_UVALID) && (max_count-- > 0)); - spin_unlock(&up->port.lock); + tty_flip_buffer_push(&up->port.state->port); - spin_lock(&up->port.lock); + *status = disr; } From patchwork Wed Apr 21 09:55:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426120 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 132B6C43617 for ; Wed, 21 Apr 2021 09:55:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D23DD6008E for ; Wed, 21 Apr 2021 09:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238739AbhDUJ4V (ORCPT ); Wed, 21 Apr 2021 05:56:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:52442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238663AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4B97161613; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=1jlF9+4H5/Lv5qATsCWA0lXWpY9nHr3MIYq7en1RpuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oFks3IXPSQIidHyslveYyyzvfx5bu+7MVSo27S8ajayrr9lyGN09BzNp0A4iXrQDf /iA1YgUXUqwsPa22y6zOY9CdPyjsUokIxr+AiQLnNLZhyOUoDlUNJP4qEPUTzR59FR s7vvWYava9QeWANPJtWXYppiqHcb5FTdxBt9NxXcP/JCqBrG5clu+FtsGzEKy5Id0k jE3W+/aUurU8e//25CMCLCeLQzdBn4xvpHA8cuz2hVt5zG2buv4Kk7cQ4I9asIL2E/ 3IMQtQZdoWs8rYWFea3Lh8PEXiKQgC2ccpDlHAQbrrdaeyBMsv6L82aNVgruyKkfnq f0JSxkDH21JZg== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pO-Hx; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Palmer Dabbelt , Paul Walmsley Subject: [PATCH 22/26] serial: sifive: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:05 +0200 Message-Id: <20210421095509.3024-23-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The sifive driver has always carried an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push() which had been removed years before the driver was added by commit 45c054d0815b ("tty: serial: add driver for the SiFive UART"). Specifically, since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Cc: Palmer Dabbelt Cc: Paul Walmsley Signed-off-by: Johan Hovold --- drivers/tty/serial/sifive.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c index 328d5a78792f..0ac0371f943b 100644 --- a/drivers/tty/serial/sifive.c +++ b/drivers/tty/serial/sifive.c @@ -448,9 +448,7 @@ static void __ssp_receive_chars(struct sifive_serial_port *ssp) uart_insert_char(&ssp->port, 0, 0, ch, TTY_NORMAL); } - spin_unlock(&ssp->port.lock); tty_flip_buffer_push(&ssp->port.state->port); - spin_lock(&ssp->port.lock); } /** From patchwork Wed Apr 21 09:55:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 994D7C4363E for ; Wed, 21 Apr 2021 09:55:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6680C6143D for ; Wed, 21 Apr 2021 09:55:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238791AbhDUJ4U (ORCPT ); Wed, 21 Apr 2021 05:56:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:52444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238651AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5DD9A61461; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=SK9ZenkpY1lkk5Kanf0WI01JeFJUJ3TcM9Wfil0ofYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xsig+VeM6WlC47I1hWI9BUuIoJI0/zMnvSTvn90rMOi8Lrqry1pPJa/5oGcc+buC0 jzZIbQYo0fPHksIZYB/jxDKjXb0rfpKWZ7tFSvFV5+Bax+qk50R29dyZnYBarhV1Jo EYWzcEscQxe79WlL/rXOqHKT1FWnnP85vg2jDOLMekz9fWE380FrAgZLZkqIXfyWNp xvdvZXL7g4zhQuW1cWA0w8Aqw02FOcBDzmz8buMF52JDWgfJeKYAbXrsrzq2I7lML5 407YLQkkGbZ6N7XpnW6TBRczYJ+CJWY2CYJZ4CHhZMZb7T9nxv4jjEOcHAivs8riiR oYOxm5HursiuQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pR-KF; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , "David S. Miller" Subject: [PATCH 23/26] serial: sunsu: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:06 +0200 Message-Id: <20210421095509.3024-24-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The sunsu driver has been carrying a workaround for the infamous low_latency behaviour of tty_flip_buffer_push() by dropping and reacquiring the port lock in the interrupt handler since 2004. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Cc: "David S. Miller" Signed-off-by: Johan Hovold --- drivers/tty/serial/sunsu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c index 319e5ceb6130..12c2468f2b0e 100644 --- a/drivers/tty/serial/sunsu.c +++ b/drivers/tty/serial/sunsu.c @@ -466,12 +466,8 @@ static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id) if (status & UART_LSR_THRE) transmit_chars(up); - spin_unlock_irqrestore(&up->port.lock, flags); - tty_flip_buffer_push(&up->port.state->port); - spin_lock_irqsave(&up->port.lock, flags); - } while (!(serial_in(up, UART_IIR) & UART_IIR_NO_INT)); spin_unlock_irqrestore(&up->port.lock, flags); From patchwork Wed Apr 21 09:55:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC73BC43460 for ; Wed, 21 Apr 2021 09:55:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 794386008E for ; Wed, 21 Apr 2021 09:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238740AbhDUJ4W (ORCPT ); Wed, 21 Apr 2021 05:56:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:52668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238665AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6AFEB6161C; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=VTQug4KonkCW3AtuCnbEYUMWwraNNce3xB7n0+oAyhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udsJI+UgqYUfPS3I+ydvP3wM+AqHKo7F+Th1saDcsH30IVwi4fCWmtss0SJfj/tV+ LYtpsU35Y8Mve6d1+kLI7nYZm20xTSK2qXFb2kL/WDf1xLn1xyWDL2VjKFTMTJAF4i 400buwGelYIjQP1cSVASbqJhCFBNiwAAk6d7wrQsmBeUCar6ZsETh/tWLHF9oqOWPA xNB0jneS6TkWws+g/HAq6P0H7494dm/4GV3RqHsWY7q+U89SpZlZ0ILwjGMfdIq0X4 KwNNPAfWu3UknHONaO+wVgy24bIjaZABB3jaGdizwKth/BlxZQEmYlRN0aaN9uyUjS j1n+oex+fPCfQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pV-NK; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 24/26] serial: timbuart: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:07 +0200 Message-Id: <20210421095509.3024-25-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The timbuart driver has always carried a workaround for the infamous low_latency behaviour of tty_flip_buffer_push() which required not holding the port lock when the low_latency flag was set. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Signed-off-by: Johan Hovold --- drivers/tty/serial/timbuart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index 2126e6e6dfd1..08941eabe7b1 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c @@ -87,9 +87,7 @@ static void timbuart_rx_chars(struct uart_port *port) tty_insert_flip_char(tport, ch, TTY_NORMAL); } - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); dev_dbg(port->dev, "%s - total read %d bytes\n", __func__, port->icount.rx); From patchwork Wed Apr 21 09:55:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 425675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7532C43618 for ; Wed, 21 Apr 2021 09:55:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C1CE56143D for ; Wed, 21 Apr 2021 09:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238804AbhDUJ4W (ORCPT ); Wed, 21 Apr 2021 05:56:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:52670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238675AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8930E61462; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=JTOTZI6bMv68wR3qvzPPxYqwOcSxCiswzBee2Px7PgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DReJHcPysNeVifagY895TiF+h/2Zp6ioz4yTvg9tBr83wvF8cSx6hd4+zhbIQeaAb gWcaooTTNPRx1clPm1BZpluTZvUJtkNmhzzHm/6fXdMydcb2VRq3O9sMMtLBhKJhGU Mkb7myXJ/k7xuIksaV0msXrI9yrUyUJVxvdkUZJltZi7kNLuedrTIM0DfD44nvNtS6 oQJ02b4Cpc9BOqQ7vjdONUwS0Y5697+gM9TpJawkiz6inH4pH+v6b1/dsEMDLGntDU BnzlZgtPc4GJmDUX6+Gr+a3OKighfOCkXkphNu8z6OBauc2RK590cO8guaTukzM29D xpheRL5qWFzMw== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000ph-Pe; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Tony Prisk Subject: [PATCH 25/26] serial: vt8500: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:08 +0200 Message-Id: <20210421095509.3024-26-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit de49df58366f ("tty: serial: vt8500: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author. Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever. The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue. Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Link: https://lore.kernel.org/linux-serial/cover.1376923198.git.viresh.kumar@linaro.org/ Cc: Tony Prisk Signed-off-by: Johan Hovold --- drivers/tty/serial/vt8500_serial.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index 764e992438b2..c5edd56ff830 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c @@ -184,9 +184,7 @@ static void handle_rx(struct uart_port *port) tty_insert_flip_char(tport, c, flag); } - spin_unlock(&port->lock); tty_flip_buffer_push(tport); - spin_lock(&port->lock); } static void handle_tx(struct uart_port *port) From patchwork Wed Apr 21 09:55:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 426118 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 569FDC43461 for ; Wed, 21 Apr 2021 09:55:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20EA66008E for ; Wed, 21 Apr 2021 09:55:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238809AbhDUJ4X (ORCPT ); Wed, 21 Apr 2021 05:56:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:52674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238677AbhDUJ4K (ORCPT ); Wed, 21 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A921061450; Wed, 21 Apr 2021 09:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618998937; bh=8rsXg0JIL9WIWG+sWtMdopUQAIhyepLhKLIESm5IaBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dVPBGZ7YsqqEZZI3xvTkFdi+qvoVlDEv47x01iGH+yeApKs/mdCRT4QwWUmIu+AFD 57Uda2l7vGOKb3alsqwY9/GSvIOwo1eJQxk6km5XZ7n7FdpAWoGHuFkSn9NHNgenU/ MVpQZN/jr4M02n0Vp0zfc1IGIzGSf6QNvihHYwsW3s7+3/vqukT2rb+rZ/MupOO8sK auIo/KFqLZVUX+bOAkS6kwTX1DmoEt6kvyzNQWt9lRcTLvBIL0S4V16T1GQRwIul7l K1cIkXIdicK6BFeRNbwJS1P/zhWlAWsoVq9G+VDuhwbNz+PEBeKXwSKycNMHfZjB0d S0qxmWIwTTLwg== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lZ9a8-0000pk-Sa; Wed, 21 Apr 2021 11:55:40 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Michal Simek Subject: [PATCH 26/26] serial: xilinx_uartps: drop low-latency workaround Date: Wed, 21 Apr 2021 11:55:09 +0200 Message-Id: <20210421095509.3024-27-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210421095509.3024-1-johan@kernel.org> References: <20210421095509.3024-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Commit c8dbdc842d30 ("serial: xuartps: Rewrite the interrupt handling logic") reworked the driver interrupt processing but also, without comment, added an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push() which had been removed years before. Specifically, since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"), tty_flip_buffer_push() always schedules a work item to push data to the line discipline and there's no need to keep any low_latency hacks around. Cc: Michal Simek Signed-off-by: Johan Hovold --- drivers/tty/serial/xilinx_uartps.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index a14c5d996473..67a2db621e2b 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -301,9 +301,8 @@ static void cdns_uart_handle_rx(void *dev_id, unsigned int isrstatus) tty_insert_flip_char(&port->state->port, data, status); isrstatus = 0; } - spin_unlock(&port->lock); + tty_flip_buffer_push(&port->state->port); - spin_lock(&port->lock); } /**