Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4583525pxj; Tue, 8 Jun 2021 18:46:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMc6f+wd5JRp4+itazY7FKOR7uwiwuehwAHq99FK38to7HbO6JzRRFhgm7a9zMxkG2Bx5O X-Received: by 2002:a17:906:c010:: with SMTP id e16mr26544970ejz.214.1623203165892; Tue, 08 Jun 2021 18:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623203165; cv=none; d=google.com; s=arc-20160816; b=WMsZOc2nTSFdrxbveQ/LMeMaJ88C5o7a0yt9QzykXFAQD0vFhRp3F0i7gkh1vtzNAD 9UO4RHxPXHtrGBKOkJm8BmpE+IFx4nr0jdahfPqFqt8AeLUqLU5Kdv2NBhq8YpKUrYnR Tosy9TnXyLcrmwncJDDMyObtl7WbsBPhUtfaNbtTGvpd94IfWthdwFGRAutbBQv7CUvf 7WyVYHcF/Er1vipggY3zpLkjJ9XSB+VwV4bSqzQ5tU5b2iOoTxJeSSexa3G2nPPeNWcv e9dp27yNFgoc28TcxQavCU6Nu4KbQjamZiQQ77qKNtmZuTGTPO6wMfE0PhHJnac/CQlu nVbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=+9pdQJzo1lnyvKJkMPdHZhKJfro6yseqqK6B1O8Ecs0=; b=TiwN33SB9neGxaWrZSMx1g6z+wLaDwO5P0btFEvj6GpTKnmJMBtnHNUcu2hzHIoNLW pQhYPoRkDMK2UUuwW6yvJVrvTshF3quW/q/lzYV5YxpA15/Y6qAJP8uM/WV2PRXn1/Nu ZK1/Vee7jncIO5QbQ6lRCNXECxO2Bnqm5vp0Ay5g6RluffjTsgBB8i8awrZYsfVbfsr1 BF0i0n5x5xWxdUttX9bembkLnBnLvje4hpmqN8JJKb+IVtgLZRANue/A3pHA1IV5axQH 6gG976jHiB0+DeKxDy1uSzv5vY1VGaqdAFP5Uf3hU4zaZIFU/8Fh1kdTCE0qSruEAyIy XMJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h3si1210504edq.233.2021.06.08.18.45.42; Tue, 08 Jun 2021 18:46:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233289AbhFHOZT (ORCPT + 99 others); Tue, 8 Jun 2021 10:25:19 -0400 Received: from netrider.rowland.org ([192.131.102.5]:33043 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S233291AbhFHOZT (ORCPT ); Tue, 8 Jun 2021 10:25:19 -0400 Received: (qmail 1805348 invoked by uid 1000); 8 Jun 2021 10:23:25 -0400 Date: Tue, 8 Jun 2021 10:23:25 -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 3/3] PM: runtime: Clarify documentation when callbacks are unassigned Message-ID: <20210608142325.GC1804083@rowland.harvard.edu> References: <20210608090250.85256-1-ulf.hansson@linaro.org> <20210608090250.85256-4-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210608090250.85256-4-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:50AM +0200, Ulf Hansson wrote: > Recent changes to the PM core allows ->runtime_suspend|resume callbacks to > be unassigned. > > In the earlier behaviour the PM core would return -ENOSYS, when trying to > runtime resume a device, for example. Let's update the documentation to > clarify this. > > Signed-off-by: Ulf Hansson > --- > > Changes in v2: > - Added a new patch for the updating the docs, as pointed out by Alan. > > --- > Documentation/power/runtime_pm.rst | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/power/runtime_pm.rst b/Documentation/power/runtime_pm.rst > index 18ae21bf7f92..3d09c9fd450d 100644 > --- a/Documentation/power/runtime_pm.rst > +++ b/Documentation/power/runtime_pm.rst > @@ -827,6 +827,14 @@ or driver about runtime power changes. Instead, the driver for the device's > parent must take responsibility for telling the device's driver when the > parent's power state changes. > > +Note that, in some cases it may not be desirable for subsystems/drivers to call > +pm_runtime_no_callbacks() for their devices. This could be because a subset of > +the runtime PM callbacks needs to be implemented, a platform dependent PM > +domain could get attached to the device or that the device is power manged > +through a supplier device link. For these reasons and to avoid boilerplate code > +in subsystems/drivers, the PM core allows runtime PM callbacks to be > +unassigned. > + You should also mention that if a callback pointer is NULL, the runtime PM core will act as though there was a callback and it returned 0. That's an important consideration. Also, notice that this file was carefully edited to make sure that none of the lines exceed 80 characters. Your new addition should be the same. Alan Stern