Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2493601rdb; Wed, 4 Oct 2023 03:01:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvap5IpiknjNr0l/J0Br+w56z4fOy91sYrMpcJP09AlObpowgrllDZyIGNQxR7kTtGm09Y X-Received: by 2002:a05:6a20:1398:b0:15e:bbcb:fb71 with SMTP id hn24-20020a056a20139800b0015ebbcbfb71mr1750962pzc.61.1696413714328; Wed, 04 Oct 2023 03:01:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696413714; cv=none; d=google.com; s=arc-20160816; b=JHsaQNObQ8aazyBFsBLDVM67lgzo3PyXgu2NS3qjnbJxYYYbO8AUQHeUqEJ/rgdnoa mAtUAXT4rahkAe4lc5f0bb0Xdeyuj4TCWIoVXGSPxtYHRLVX/0l4EKcSz9NB9MfXkzDl GPlbuywuWU/637Cm75gMx1uHdvMQNDIkw4bquXoT7RUVrFBSwZ+EC/u0/G2YWdw/ZOiJ l00dMSXbrHy8gxHKvWOSGMV9g/Oo3MyimbitetUFD/SWu+RtQ47xbG/MkxKH81hMnwKi xoSl04Y2TZ6uaA+dZtn2uz+gfQBXRd5QevfLOrxYfYpRFKzcbDRbanHMN8v3dqwA6Ckj WP5g== 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=zrcQm9bFtjKs76dEQIBxL9wqqLvknb+chs8Zm0M6Nh0=; fh=YSZ7z0nrZIqeN+Ea6jkkDMjIHnBhXRe2jf/1ECc0i54=; b=ESAvw8LVcgxvuFKskD2k12ij/9u5W0YNTkq4KlC0EZ4cW4vomVM2iagwPRtgLhZKTZ t+5eqyqtYnsjbVSauMHDtFFxm1I3nJmx3XOtGcFIbUKjytgV6XidLR8Pi3mkX4Gwzw0j k7OmXUvMZ9bhKihxvK5jAMk8kGbuZlI0qw7wvgmBOh+qdt5HOT4Ud+3PwCx8cuJ6IjU8 4+HFCFgVyMsZCYeWM0gmKmd99d69EdO0OD9emBbyRH23opsFVItPq9+Th2O7iUQykHam 76yYzyCUnKKSbdn/0iQfgPnLegDS4xNGh++v1JteTKZ2ieaTF6wePUxhof8La7kPYbkZ /9GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m16-20020a056a00081000b0068ff659af62si3618771pfk.106.2023.10.04.03.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 03:01:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BAC53802D3C5; Wed, 4 Oct 2023 03:01:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232984AbjJDKBb (ORCPT + 99 others); Wed, 4 Oct 2023 06:01:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241950AbjJDKB3 (ORCPT ); Wed, 4 Oct 2023 06:01:29 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 11C929E; Wed, 4 Oct 2023 03:01:26 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 4819E80BD; Wed, 4 Oct 2023 10:01:25 +0000 (UTC) Date: Wed, 4 Oct 2023 13:01:23 +0300 From: Tony Lindgren To: Johan Hovold Cc: Maximilian Luz , Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , Dhruva Gole , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , John Ogness , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-omap@vger.kernel.org, Andy Shevchenko , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v12 1/1] serial: core: Start managing serial controllers to enable runtime PM Message-ID: <20231004100123.GH34982@atomide.com> References: <20230525113034.46880-1-tony@atomide.com> <62d3678a-a23d-4619-95de-145026629ba8@gmail.com> <20231003121455.GB34982@atomide.com> <20231003122137.GC34982@atomide.com> <20231004061708.GD34982@atomide.com> <20231004090320.GE34982@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, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 03:01:37 -0700 (PDT) * Johan Hovold [231004 09:14]: > On Wed, Oct 04, 2023 at 12:03:20PM +0300, Tony Lindgren wrote: > > The serial port device and serdev device are siblings of the physical > > serial port controller device as seen in the hierarcy printed out by > > Maximilian. > > Yeah, and that's precisely the broken part. Keeping the serdev > controller active is supposed to keep the serial controller active. Your > serial core rework appears to have broken just that. Hmm OK good point, tx can currently have an extra delay if a serdev device is active, and the serial port controller device is not active. So we can check for active port->dev instead of &port_dev->dev though to know when when start_tx() is safe to do as below. Thanks. Tony 8< ----------------- diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 6207f0051f23d..defecc5b04422 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -156,7 +156,7 @@ static void __uart_start(struct uart_state *state) * enabled, serial_port_runtime_resume() calls start_tx() again * after enabling the device. */ - if (pm_runtime_active(&port_dev->dev)) + if (!pm_runtime_enabled(port->dev) || pm_runtime_active(port->dev)) port->ops->start_tx(port); pm_runtime_mark_last_busy(&port_dev->dev); pm_runtime_put_autosuspend(&port_dev->dev);