From patchwork Mon Apr 11 09:48:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 559867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20033C433F5 for ; Mon, 11 Apr 2022 09:49:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344759AbiDKJv1 (ORCPT ); Mon, 11 Apr 2022 05:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344767AbiDKJvR (ORCPT ); Mon, 11 Apr 2022 05:51:17 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 23C084160B; Mon, 11 Apr 2022 02:48:38 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 3556C8191; Mon, 11 Apr 2022 09:45:42 +0000 (UTC) From: Tony Lindgren To: Greg Kroah-Hartman Cc: Andy Shevchenko , Jiri Slaby , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Steffen Trumtrar , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , "Matwey V. Kornilov" Subject: [PATCH 2/2] serial: 8250: Fix runtime PM for start_tx() for empty buffer Date: Mon, 11 Apr 2022 12:48:05 +0300 Message-Id: <20220411094805.45696-2-tony@atomide.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220411094805.45696-1-tony@atomide.com> References: <20220411094805.45696-1-tony@atomide.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Commit 932d596378b0 ("serial: 8250: Return early in .start_tx() if there are no chars to send") caused a regression where the drivers implementing runtime PM stopped idling. We need to call serial8250_rpm_put_tx() on early exit, it normally gets called later on at __stop_tx(). Fixes: 932d596378b0 ("serial: 8250: Return early in .start_tx() if there are no chars to send") Cc: Steffen Trumtrar Cc: Uwe Kleine-König Signed-off-by: Tony Lindgren --- drivers/tty/serial/8250/8250_port.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1677,8 +1677,10 @@ static void serial8250_start_tx(struct uart_port *port) serial8250_rpm_get_tx(up); - if (!port->x_char && uart_circ_empty(&port->state->xmit)) + if (!port->x_char && uart_circ_empty(&port->state->xmit)) { + serial8250_rpm_put_tx(up); return; + } if (em485 && em485->active_timer == &em485->start_tx_timer) {