From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E465C4743D for ; Tue, 8 Jun 2021 14:25:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49E426135A for ; Tue, 8 Jun 2021 14:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233349AbhFHO0x (ORCPT ); Tue, 8 Jun 2021 10:26:53 -0400 Received: from netrider.rowland.org ([192.131.102.5]:47261 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S233326AbhFHO0w (ORCPT ); Tue, 8 Jun 2021 10:26:52 -0400 Received: (qmail 1805405 invoked by uid 1000); 8 Jun 2021 10:24:58 -0400 Date: Tue, 8 Jun 2021 10:24:58 -0400 From: Alan Stern To: Ulf Hansson Cc: "Rafael J . Wysocki" , linux-pm@vger.kernel.org, Saravana Kannan , Adrian Hunter , Tony Lindgren , Kevin Hilman , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] PM: runtime: Update behaviour for no callbacks Message-ID: <20210608142458.GD1804083@rowland.harvard.edu> References: <20210608090250.85256-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210608090250.85256-1-ulf.hansson@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 08, 2021 at 11:02:47AM +0200, Ulf Hansson wrote: > While reviewing a patch on the mmc-list, I ended up inspecting the behaviour of > how we deal with the no callback case for runtime PM. > > A couple of observations: > > *) When pm_runtime_no_callbacks() have been called, it allows the PM core to > takes a quicker path, but at the same time, consumer/supplier device links are > being skipped in rpm_resume|suspend(). > > **) Calling pm_runtime_no_callbacks() to avoid boiler plate code (assigning > empty functions to ->runtime_suspend|resume()), doesn't work if there could be > consumer/supplier device link being used or a platform dependent PM domain that > could get attached to the device. > > Therefore, this series suggests to change the behaviour in the PM core, to > allow the ->runtime_suspend|resume() callbacks to be unassigned. This is already > supported for ->runtime_idle() callbacks, so it would also move things into a > more consistent behaviour. > > I have looked at various error paths, in the kernel of callers of > pm_runtime_get_sync(). I couldn't find anyone that made sense, that looked for > the special error code, -ENOSYS, which is the error code getting returned when a > callback is missing. Whether that is sufficient proof that these changes are > 100% safe, I can't guarantee, but I think it would be worth a try as the > benefits of avoiding boilerplate code and the corresponding additional code > paths are quite nice, if you ask me. In principle I have no objection to these changes. It's likely that if any problems do crop up, we'll be able to fix them pretty easily. For patches 1 and 2: Acked-by: Alan Stern Alan Stern From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB088C47082 for ; Tue, 8 Jun 2021 14:31:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD8A661287 for ; Tue, 8 Jun 2021 14:31:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD8A661287 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5eDfQ1BlcJiNt7RBeeGpdsthi7cA4hiy3mBgHgNyMQA=; b=ShID0FSjQQTy7s 3GNU7mqj04cvFdWaUMV5AGh6a90okQ4dVxKzNs8/dug+DCYfVUl9tQxtfvO7JblHF5U5u98NLXgMB L1QbEdEKRg+X4uvE2uKHtqLBu3p1U480ORcADEVCBhH+Se9bnZyZelrC0I/GJ/FZr0ZiFTvPGg+rg wbfhovUkDaWsEvPs6FdndBW6UgVhwgrOXzAhq7eM3PVRTGf3hEasUX0fZXygHLORLCRpXukqu0/CY YAg/njA6na9yAG3I/a9Q5z3dNsSgGwfnPEprjB66z9T0fYekBTlqP9dnmNuKoHrNmosA/vlVdfLt0 nATavoJNcAtJIgvPShGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqcj3-008umM-AK; Tue, 08 Jun 2021 14:29:06 +0000 Received: from netrider.rowland.org ([192.131.102.5]) by bombadil.infradead.org with smtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqcf5-008tU4-Gu for linux-arm-kernel@lists.infradead.org; Tue, 08 Jun 2021 14:25:01 +0000 Received: (qmail 1805405 invoked by uid 1000); 8 Jun 2021 10:24:58 -0400 Date: Tue, 8 Jun 2021 10:24:58 -0400 From: Alan Stern To: Ulf Hansson Cc: "Rafael J . Wysocki" , linux-pm@vger.kernel.org, Saravana Kannan , Adrian Hunter , Tony Lindgren , Kevin Hilman , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] PM: runtime: Update behaviour for no callbacks Message-ID: <20210608142458.GD1804083@rowland.harvard.edu> References: <20210608090250.85256-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210608090250.85256-1-ulf.hansson@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210608_072459_756206_F63E1EB8 X-CRM114-Status: GOOD ( 23.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 08, 2021 at 11:02:47AM +0200, Ulf Hansson wrote: > While reviewing a patch on the mmc-list, I ended up inspecting the behaviour of > how we deal with the no callback case for runtime PM. > > A couple of observations: > > *) When pm_runtime_no_callbacks() have been called, it allows the PM core to > takes a quicker path, but at the same time, consumer/supplier device links are > being skipped in rpm_resume|suspend(). > > **) Calling pm_runtime_no_callbacks() to avoid boiler plate code (assigning > empty functions to ->runtime_suspend|resume()), doesn't work if there could be > consumer/supplier device link being used or a platform dependent PM domain that > could get attached to the device. > > Therefore, this series suggests to change the behaviour in the PM core, to > allow the ->runtime_suspend|resume() callbacks to be unassigned. This is already > supported for ->runtime_idle() callbacks, so it would also move things into a > more consistent behaviour. > > I have looked at various error paths, in the kernel of callers of > pm_runtime_get_sync(). I couldn't find anyone that made sense, that looked for > the special error code, -ENOSYS, which is the error code getting returned when a > callback is missing. Whether that is sufficient proof that these changes are > 100% safe, I can't guarantee, but I think it would be worth a try as the > benefits of avoiding boilerplate code and the corresponding additional code > paths are quite nice, if you ask me. In principle I have no objection to these changes. It's likely that if any problems do crop up, we'll be able to fix them pretty easily. For patches 1 and 2: Acked-by: Alan Stern Alan Stern _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel