Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1986810pxa; Mon, 3 Aug 2020 04:40:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSho7VF4zU1TGt0wAsjec9l195J4UQAd9AtB1wkzM8CQWZXUkIrhiIN2XOz3MeYjlmbbUs X-Received: by 2002:a05:6402:1b1c:: with SMTP id by28mr15784994edb.89.1596454854986; Mon, 03 Aug 2020 04:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596454854; cv=none; d=google.com; s=arc-20160816; b=W4CTqDZ99DGOQoM7zvhKRNU5xlmf5zWIVZ02LyPKGcfd8CyLtRxAJnEqw+DCzpQaCV iTTeaB2VUHqXcpYc1PJ+F4QJxE6WGoXYz6WiyYw5OLHi77iXWOYG4OGaQx5OOtYrOpET vuUu32lZLui3z/Wzn0EJ/v9g3oz57nhS6miFSuVpKP+k5ujtUCb8ZwVqbbJBKNaVJrAt S67AQmcv9Lp2ZQqXXLDPJMT8cT8G8Yfcf+tDgwdLdvQaYwnRYqX4AvrypBL5GIp8UYhs huwRaojNIclpfFHhz+csxsvRSZwdCRlvree7t/rYh965gqZ8jmE/+8xje4402VNC2eSz u04Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=3nvENeSXjDTJ1ixr/A+p7Tzhs+JxqY29ttHHyb6V5/s=; b=nSh6SHjFlj7XzcdA+NqtLUv2PksQxk3D0k7pLe94lc/bQz4YpfYyQ1qzHawrFZWbve oEMWZv28GJ5zYmmrcOSxkPgqxBa4Q0cC4L+/GYWHLDXiH9PZHVIen/M2JiheOmbVb7nA 2nMGpNVQx/Q6nn8o+1+jPkgJv+YqxB8EhdjD+QtIj9caG7GM6nq5RiIMACNLwNYfLnnk LlzlEqDpYvCdnAYmzrIKPSY2f7D+kHl60jDkbVplQmgiOpYvYguCnYyQFU/UwyiPwMCA TxnONOufZ+i8VCALip2Sl7fc2oXnl7zwSZO1YSFDIxxTrD8uxkaT4Z1hAV7N5NLXTumH rI2A== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gl25si10133103ejb.424.2020.08.03.04.40.32; Mon, 03 Aug 2020 04:40:54 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbgHCLjp (ORCPT + 99 others); Mon, 3 Aug 2020 07:39:45 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:38286 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726007AbgHCLhI (ORCPT ); Mon, 3 Aug 2020 07:37:08 -0400 Received: by mail-ot1-f67.google.com with SMTP id q9so11986557oth.5; Mon, 03 Aug 2020 04:37:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3nvENeSXjDTJ1ixr/A+p7Tzhs+JxqY29ttHHyb6V5/s=; b=FPJuum4OWRZgLhZRynw0z1KUthlLL13OLiMocHS6aazW2wRCxa4/S+M6/0QbJ1jMw5 B920uDc7Oow+eunxOk+mVBGdnFHcMJ9nKIY1jHwFK5Eez03qHKEfcZOgQyVnnuLS04kN C1dyRgy8usiYijwF9Z4nN0M5vcKKNWESm7yvpbS+l3NwkLBWZNFoHZRcU7gzPM2eNe58 D8Ddvr1D74tGedf2bI84rpq8xdElpjkLmvLuldPU8lGXUXLO3R9mptPgSuDYVt+kA4ul EKagE9bWonI9uBG1y9b4+myGUXkLVhFR49VofCacrimaCSi8KyAFvDO9qxVngjPK6nZM U+Kw== X-Gm-Message-State: AOAM533EWNJWcOYzPEMmop+xif6B6E05XTTLTCqMeMtxEQpbqpvpP1bB IofGyIcQQAHw/DSb6Gq6tav0oyqDyEfZ5iTY94WVG5cq X-Received: by 2002:a05:6830:1c74:: with SMTP id s20mr12674907otg.167.1596454627644; Mon, 03 Aug 2020 04:37:07 -0700 (PDT) MIME-Version: 1.0 References: <2672940.cHDmkauF2A@kreacher> <20200803085347.GV13316@paasikivi.fi.intel.com> In-Reply-To: <20200803085347.GV13316@paasikivi.fi.intel.com> From: "Rafael J. Wysocki" Date: Mon, 3 Aug 2020 13:36:52 +0200 Message-ID: Subject: Re: [PATCH] PM: runtime: Add kerneldoc comments to multiple helpers To: Sakari Ailus Cc: "Rafael J. Wysocki" , Linux PM , LKML , Alan Stern , Ulf Hansson , Wolfram Sang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, On Mon, Aug 3, 2020 at 10:53 AM Sakari Ailus wrote: > > Hi Rafael, > > Thanks for the patch. > > On Fri, Jul 31, 2020 at 07:03:26PM +0200, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Add kerneldoc comments to multiple PM-runtime helper functions > > defined as static inline wrappers around lower-level routines to > > provide quick reference decumentation of their behavior. > > > Some of them are similar to each other with subtle differences only > > and the behavior of some of them may appear as counter-intuitive, so > > clarify all that to avoid confusion. > > > > Signed-off-by: Rafael J. Wysocki > > --- > > include/linux/pm_runtime.h | 246 +++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 246 insertions(+) > > > > Index: linux-pm/include/linux/pm_runtime.h > > =================================================================== > > --- linux-pm.orig/include/linux/pm_runtime.h > > +++ linux-pm/include/linux/pm_runtime.h > > @@ -60,58 +60,151 @@ extern void pm_runtime_put_suppliers(str > > extern void pm_runtime_new_link(struct device *dev); > > extern void pm_runtime_drop_link(struct device *dev); > > > > +/** > > + * pm_runtime_get_if_in_use - Conditionally bump up runtime PM usage counter. > > + * @dev: Target device. > > + * > > + * Increment the runtime PM usage counter of @dev if its runtime PM status is > > + * %RPM_ACTIVE and its runtime PM usage counter is greater than 0. > > The implementation of the non-runtime PM variants (used when CONFIG_PM is > disabled) isn't here but I think it'd be nice if their behaviour was also > documented here. pm_runtime_get_if_in_use() returns -EINVAL if CONFIG_PM is > disabled, for instance. These kerneldoc comments cover the CONFIG_PM case only. The behavior for !CONFIG_PM needs to be figured out from the code, if it matters. I'm not sure why it would matter for pm_runtime_get_if_in_use(), in particular? > pm_runtime_disable() is defined here but the documentation in corresponding > pm_runtime_enable() in drivers/base/power/runtime.c is rather terse. It'd > be nice to improve that now (or separately). Yes, separately. Thanks!