Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14379209rwb; Sun, 27 Nov 2022 23:30:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf7+XAY+OA+556cm1JYPKUohIn03fQTQMJ2y7iXG60NzgrunbkVE/KbkKWjzox9u9oqHvSH7 X-Received: by 2002:a05:6402:5513:b0:467:7026:515e with SMTP id fi19-20020a056402551300b004677026515emr46590858edb.26.1669620620808; Sun, 27 Nov 2022 23:30:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669620620; cv=none; d=google.com; s=arc-20160816; b=M/vOGV9WLDrw7MkyhZahbCPDJt8TeacHoZbJNoTOqM0Qj4xrq9hd0HSU5HYIVJhqW3 PXrNnQDHjXXEDvVraI8ihclaLE+TBLApWf5seJT3Tl0tOsRfF8176ByxW4fi/hYwRcz0 z/dTtiYsVkX5RCAfEzjXm+Nl4km04lRgb0plHuhpViHTmIu8IMv0imFgdl6MqZI9bns3 dF+fSDS57KRFWRsgtB/p1VpSbHjP772kzVdCzAIprO+U20zHDSsgIS+hG812cSzE0AOa UPaR3/wOS+xGKDNEcs0RV68Pxm6QFYklOcTtvuXdblbFEHA/1Be/5t6/p4Z/J7TZ4+qW 8rIg== 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; bh=8KZwQAUPKgi8qTMqGgo/J9jcMWEq6rx1PENww6u3DM8=; b=qdTpaiVYqR4E14PQT586bzB431viPB1qIGwAjJTsLvqObO71jGjvZXAkYxyOXHkeP1 rd6y+Vj9E0aeI1ohzbsLWcrh3liVne4KwFd2SGGfxcJTlGqpxIyByWc8+7kJiUg/dfDQ ggbV7i6xl8HdJTFVRiHxQo1Qv0L1KuDk2EZGsb1H57cuzctQsyEC4bHohdQfgpdqEI47 3L8ICHXdtxYkyAPtf2PZoI8CrQqo/th6UMjpyzbgtzCrh9EJu3T3udECxV9noVO2VERK z/uizNbY5mCp5rQBBEGWR//xZvVEtH82UKXyE047ICv+QNavYIC8I0lWMcQRTxQHjxvC qSkQ== 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 si2-20020a170906cec200b007bff09aec4bsi1288469ejb.599.2022.11.27.23.30.00; Sun, 27 Nov 2022 23:30:20 -0800 (PST) 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 S229716AbiK1GpP (ORCPT + 84 others); Mon, 28 Nov 2022 01:45:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbiK1GpM (ORCPT ); Mon, 28 Nov 2022 01:45:12 -0500 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 83F0E60DF; Sun, 27 Nov 2022 22:45:11 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 7D82280C1; Mon, 28 Nov 2022 06:45:10 +0000 (UTC) Date: Mon, 28 Nov 2022 08:45:09 +0200 From: Tony Lindgren To: Ilpo =?utf-8?B?SsOkcnZpbmVu?= Cc: Greg Kroah-Hartman , Andy Shevchenko , Jiri Slaby , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-serial , linux-omap@vger.kernel.org, LKML Subject: Re: [PATCH v3 1/2] serial: core: Start managing serial controllers to enable runtime PM Message-ID: References: <20221123082825.32820-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: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Hi, * Ilpo Järvinen [221125 14:02]: > On Wed, 23 Nov 2022, Tony Lindgren wrote: > > + /* > > + * Keep the port device enabled unless autosuspend is supported. > > + * Released on port shutdown. > > + */ > > + if (!controller->supports_autosuspend) { > > + ret = pm_runtime_resume_and_get(dev); > > Should this be done regardless of autosuspend if the port is console? Well hopefully no need to check anything here for the console unless enabled state needs to be inherited from the early console. Note that with what Jiri is proposing, we can just unconditionally do the pm_runtime_resume_and_get() here on the generic serial port controller struct device. We can also leave out the tinkering of the serial port hardware struct device. The hardware serial port controller drivers that do support autosuspend can just decrement the runtime PM usage count for the generic serial port controller child device as needed to enable aggressive PM. > There's a problem in the current place where this being called from > though, uart_console_enabled() doesn't return the correct value with at > least some devices this early: > > https://lore.kernel.org/linux-serial/AS8PR04MB84047F39CD10C00CEE29213F92219@AS8PR04MB8404.eurprd04.prod.outlook.com/ OK. Seems the issues with the boot console and early serial port struct device or whatever might be missing are there even without runtime PM. Regards, Tony