Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp220396pxb; Mon, 11 Apr 2022 23:39:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNhIKQdf/RK33MZaZ3MUhwRhK8G3fmYZnI92NNFMuBRIQ6WnIwDduKf5MaGdgV2+DnecGf X-Received: by 2002:aa7:88ca:0:b0:505:d092:16c8 with SMTP id k10-20020aa788ca000000b00505d09216c8mr5983175pff.22.1649745590382; Mon, 11 Apr 2022 23:39:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649745590; cv=none; d=google.com; s=arc-20160816; b=pKIgnAFUp48HI+szUvt72D9d6MUuJQd1qk8ryIvkWWeUURum9/+mi1744UPXXeVLHf /0XgBOImyBygGzoPnNWrGmA071p3moVpR5XM5/HywA1FqnTTlnApW3cGIb5hC5RErevy /X0avUG9gnjElL+NHv0aRBzhvn8Z9qunOfzb3+XXlCrI5NafjaMpnxtEArOC8NbmI071 sp0FzDjrRP2YPd8yBHmRilqPjb5fEP2l+Ht5zw1B5+WOkt506mDuM/JIR4WSDxmbVosk AXWFc8jqkNnQA4DjasQF+XPsOIIDlg16Wn71Dcpfu4tomr/t96uXYbLXQUJwcw2tSoc3 eyDw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rIHDXl/n6Dne1KJslz8zbQY3FJLeghNAe5loJMaiScg=; b=zRzXFJ4dVm37zsG08RhzkepTgLhOCZil71LJVxkC1jJaUBccnwvPGlm/g24xfD3VQm 5r/FpcphN0xK5w+YGQF3IDq8RMXztWU7Zc5hM2JpOx3eGuG6L+UOiUVwBiall5ljTXkZ LCUIHAsfQZkaSouxtSERJcuSlhBMfJ/X89rIIqfinjvZ/2hPNczTQU3t6vr9gU1zK+mO AKdzW1GDxD+dNXqAlWu6b+VOmZgBPKaNLLsfGL+NHyjHjf41PPC3cAXxNDqfDnyN0/34 uuaRfHbsSO6CM4s59K++Ub2D524RnxfP+Kc6lMXNJbx2C2K/sib/JKS3AAwRT5aAVYe4 kjag== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a655307000000b003816043ef0dsi1906749pgq.258.2022.04.11.23.39.38; Mon, 11 Apr 2022 23:39:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345142AbiDKKNX (ORCPT + 99 others); Mon, 11 Apr 2022 06:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345215AbiDKKMt (ORCPT ); Mon, 11 Apr 2022 06:12:49 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 57A493A711; Mon, 11 Apr 2022 03:10:36 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id EF152809F; Mon, 11 Apr 2022 10:08:04 +0000 (UTC) Date: Mon, 11 Apr 2022 13:10:34 +0300 From: Tony Lindgren To: Johan Hovold 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=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 * Johan Hovold [220411 09:54]: > On Mon, Apr 11, 2022 at 12:48:04PM +0300, Tony Lindgren wrote: > > 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. Frankly "a bit of mess" applies "a bit more" than just the serial runtime PM :) > 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). AFAIK there's currently nothing paired with the serial8250_rpm_get_tx(up) call at the beginning of serial8250_start_tx() for the early exit cases if start_tx_rs485() or __start_tx() won't get called. Care to clarify a bit more what you have in mind? Regards, Tony