Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp22652pxb; Tue, 12 Apr 2022 15:41:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhxNa6PvwHqwfzPQHQe6727wSsNsh6BgfjTeA/KCcFA6x9RoBEaqKi/kErRFK/EIu82zmD X-Received: by 2002:a17:903:11d0:b0:156:6c35:9588 with SMTP id q16-20020a17090311d000b001566c359588mr39054276plh.50.1649803305511; Tue, 12 Apr 2022 15:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649803305; cv=none; d=google.com; s=arc-20160816; b=B+xa8gFip2hxJIX1esjPbvRL5GZ6rxaatgO56XXVEXN7YRlG+qvr3qfOtijGodGcoP WZOXXgPPBHwLnFvtvrJPUc3dfnEfs0ZepPqqmq3PHoshlkxPPK2JuUjKw4u5U+3Jj2eI 9VKX1x/HMHzTYMUnjyteUeOMeTLOamageaVwxeW7UpatAaAK6TV5FxH5UD1MHJLoqDJ7 TFgKeMJawxxw49UUePjEGbtCw7WVctGPDnoAA2kETFNb7PGrCm4XzFjZAuv1TeZWxvuo f+Zi4dJp/289bXIT6wsYQFUmiXKYXnMbQceN2E5F4BsP+g0yFqtIGCO69jsE9/Hv1/Dj NTtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=byh3r594JnpzfYMNRC533vvJEbn38us3A7SXdSlht98=; b=jD4oVUgw6V8pLvHgTv5YYn26HCJA1xZWrcT+H1rvg0TfE/FEynPE1giDAFJoikYanG yhhRWjEz5t9sn7LFfpEUwx4Zf6KnABsTUz/9I9GKQryyyALVLG7IKyHxKx8mId8HRkbx UA7xoKR2NA++OMjwWzalyBvdYwk+SA41JyMhBOX/Iiz6UnLzAt8LnWRqjUXdZhnFvAY6 oS7ii9dL3j4gPLnamwFhSp3+eSExQM8pWt0hJyCK18mBnERCBOcJzqCN50YdXIxTATeM 3LgNnHGjE56Ab6S9wZSp/y50VeCGS9JjgGdGGTozui+GPwQPP1FCrM5oPszVK4y5cI6w aNtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qehk1AnZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j70-20020a638b49000000b0039daee8bd52si468055pge.502.2022.04.12.15.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:41:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qehk1AnZ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7163234B84; Tue, 12 Apr 2022 14:20:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344919AbiDKJ7r (ORCPT + 99 others); Mon, 11 Apr 2022 05:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344940AbiDKJ7g (ORCPT ); Mon, 11 Apr 2022 05:59:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAB88419AC; Mon, 11 Apr 2022 02:57:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 56FDDB811A6; Mon, 11 Apr 2022 09:57:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA839C385A4; Mon, 11 Apr 2022 09:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649671039; bh=XzgoCOpDFPeXrNAPZ9n2pn/IKCFb6l3nipun5dFyDyM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qehk1AnZjxsI1bTVdtNm6FoAFTYc9s6SC81gzZzZ9XQpHKl3pdty27Pou50Gy47Hd Ib/+Ci9lmxlDlxIXQWBdNPsRjz9seUH+heHR/qvgWTxbt0fYLbp6O5pzXShWQ2AVSx kfdCgC3VqJ5wSeb7GOrfA8qBckqIIPunxrKlj+C1dezGCv/o2OKaZ21C78lDq31L2O ou4ucjIKEjrjn8Te/midQyF4KMj9XItdnSiFOOiiaWdQLxbBJoUYkaEqzI/q1NjX8y k08yzPZ0q0NxH0xn4lZHhWyP5dyKkztA8meuUZVXLAJ6uKGTC40eaKHs/6IBqA4+yh YWp+p8RIp9Q0g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ndqnI-0003if-V8; Mon, 11 Apr 2022 11:57:13 +0200 Date: Mon, 11 Apr 2022 11:57:12 +0200 From: Johan Hovold To: Tony Lindgren Cc: Greg Kroah-Hartman , Andy Shevchenko , Jiri Slaby , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, "Matwey V . Kornilov" , Steffen Trumtrar , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Subject: Re: [PATCH 1/2] serial: 8250: Fix runtime PM for start_tx() for RS485 Message-ID: References: <20220411094805.45696-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220411094805.45696-1-tony@atomide.com> X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On Mon, Apr 11, 2022 at 12:48:04PM +0300, Tony Lindgren wrote: > The early return from serial8250_start_tx() added by commit e490c9144cfa > ("tty: Add software emulated RS485 support for 8250") failed to call > serial8250_rpm_put_tx() that normally gets called on __stop_tx(). > > Likely this is a harmless issue as the RS485 using folks probably are not > using runtime PM for the serial ports. > > Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") > Cc: Matwey V. Kornilov > 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 > @@ -1681,8 +1681,10 @@ static void serial8250_start_tx(struct uart_port *port) > return; > > if (em485 && > - em485->active_timer == &em485->start_tx_timer) > + em485->active_timer == &em485->start_tx_timer) { > + serial8250_rpm_put_tx(up); > return; > + } I was just taking a quick look at your report about this and also noticed this return statement. The runtime PM implementation is a bit of mess as we've discussed elsewhere, but the change you propose here doesn't look right. start_tx() can be deferred in the rs485 case, but that doesn't mean you should suspend the device here. In fact, that look like it would just break runtime PM (the parts that may work to some extent). > > if (em485) > start_tx_rs485(port); Johan