Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp835970pxb; Tue, 12 Apr 2022 14:50:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5bi1j2C0wGQjEH+T6ow9u1/03iBjzgPZ4rM0vNf96xpRvL5C08x9ezkCxEKtgd2KySJcD X-Received: by 2002:a17:903:2283:b0:156:3e9b:282b with SMTP id b3-20020a170903228300b001563e9b282bmr39944939plh.94.1649800212189; Tue, 12 Apr 2022 14:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649800212; cv=none; d=google.com; s=arc-20160816; b=F2eD8DGwPt4ktLbyzrwP47bg1nUKwaTl+KReteq4rje9M3mNAgzaS83Ig2VZpV6MRS +mFsY013n7rJILz9iT/+waqjRWsO8aS155UOIeDOXGdtiWJJX6bgydzsbW0Q7EPrgdCq z8VFa6iKIjgBuSrPVIMjIY9Ol9sQJetn23KSLg23nm+R5Vpfk0NZ4o5PO9V21bczLj8g d0IQaXGoHPeV1A0216BkCys7d+83CZdjvZF11vT/jTJzpFa4AJH/D8gsXaPZwPCWvyhA JBcAlVxXRTyENxUI35CnynuA9DsteYCkqz8kR54ooHaKP/ha1U2LCfzotvG+1RuU9zcS nhiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yEy6ugsLScDSKo3Ot4QkhjVimNuX73VO73TboUGDeMY=; b=BeF7aukzaLwHzg8G5h8Kw/4mwIgdeFhiiQHmoz3/oSx3g392iPY+2iROdD9zr1G6XD aWpHK0bMLITs4vKWvWb1KPaaPn7phkQFMbC0CTlzQKqyBveRUDAKjr3sRPInXJ9r31kU Wly+WZYvVsR1E43N+vT6MUO0K3UNy7BmlgfPGroASLsrpMErTuyJcdWQIShpWIomlSgI 2bEpRmhAdW1zBm64dqHs/1A2moNKvdj5WxXct0ErUZLsNuhdob55I35zbi7Se5ciocPl Rdw8JYQ5/vns9PfvpmsXmKzYPV1Qtob0Hbkqf62Yvoe77PZx6zKIudP1QMJbym7Aozud APVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b8-20020a056a000a8800b004e1a25384f6si13598174pfl.3.2022.04.12.14.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:50:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DB4F17CDE2; Tue, 12 Apr 2022 13:47:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344693AbiDKJva (ORCPT + 99 others); Mon, 11 Apr 2022 05:51:30 -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=20Kleine-K=C3=B6nig?= , "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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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) { -- 2.35.1