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