All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Nishanth Menon <nm@ti.com>
Cc: Phil Carmody <ext-phil.2.carmody@nokia.com>,
	linux-doc <linux-doc@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Madhusudhan Chikkature Rajashekar <madhu.cr@ti.com>,
	Sergio Alberto Aguirre Rodriguez <saaguirre@ti.com>,
	Andi Kleen <ak@linux.intel.com>,
	linux-pm <linux-pm@lists.linux-foundation.org>,
	Matthew Garrett <mjg@redhat.com>, Len Brown <len.brown@intel.com>,
	Eduardo Valentin <eduardo.valentin@nokia.com>,
	linux-omap <linux-omap@vger.kernel.org>,
	Thara Gopinath <thara@ti.com>,
	linux-arm <linux-arm-kernel@lists.infradead.org>,
	Roberto Granados Dorado <x0095451@ti.com>,
	Linus Walleij <linus.walleij@stericsson.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Romit Dasgupta <ro.mit@ti.com>,
	Tero Kristo <Tero.Kristo@nokia.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sanjeev
Subject: Re: [linux-pm] [PATCH] opp: introduce library for device-specific OPPs
Date: Fri, 17 Sep 2010 16:36:43 +0100	[thread overview]
Message-ID: <20100917153643.GC29739@sirena.org.uk> (raw)
In-Reply-To: <1284686973-13993-1-git-send-email-nm@ti.com>

On Thu, Sep 16, 2010 at 08:29:33PM -0500, Nishanth Menon wrote:

> +struct opp_def {
> +	unsigned long freq;
> +	unsigned long u_volt;
> +
> +	bool enabled;
> +};

It might be clearer to use some term other than enabled in the code -
when reading I wasn't immediately sure if enabled meant that it was
available to be selected or if it was the active operating point.  How
about 'allowed' (though I'm not 100% happy with that)?

> +static inline int opp_add(struct device *dev, const struct opp_def *opp_def)
> +{
> +	return ERR_PTR(-EINVAL);
> +}

Mismatch with the return type and value here.

> +/**
> + * opp_enable() - Enable a specific OPP
> + * @opp:	Pointer to opp
> + *
> + * Enables a provided opp. If the operation is valid, this returns 0, else the
> + * corresponding error value.
> + *
> + * OPP used here is from the the opp_is_valid/opp_has_freq or other search
> + * functions
> + */
> +int opp_enable(struct opp *opp)
> +{
> +	if (unlikely(!opp || IS_ERR(opp))) {
> +		pr_err("%s: Invalid parameters being passed\n", __func__);
> +		return -EINVAL;
> +	}
> +
> +	if (!opp->enabled && opp->dev_opp)
> +		opp->dev_opp->enabled_opp_count++;
> +
> +	opp->enabled = true;
> +
> +	return 0;
> +}

When reading the description I'd expected to see some facility to
trigger selection of an active operating point in the library (possibly
as a separate call since you might have a bunch of operating points
being updated in quick succession) but it looks like that needs to be
supplied externally at the minute?

WARNING: multiple messages have this Message-ID (diff)
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-pm] [PATCH] opp: introduce library for device-specific OPPs
Date: Fri, 17 Sep 2010 16:36:43 +0100	[thread overview]
Message-ID: <20100917153643.GC29739@sirena.org.uk> (raw)
In-Reply-To: <1284686973-13993-1-git-send-email-nm@ti.com>

On Thu, Sep 16, 2010 at 08:29:33PM -0500, Nishanth Menon wrote:

> +struct opp_def {
> +	unsigned long freq;
> +	unsigned long u_volt;
> +
> +	bool enabled;
> +};

It might be clearer to use some term other than enabled in the code -
when reading I wasn't immediately sure if enabled meant that it was
available to be selected or if it was the active operating point.  How
about 'allowed' (though I'm not 100% happy with that)?

> +static inline int opp_add(struct device *dev, const struct opp_def *opp_def)
> +{
> +	return ERR_PTR(-EINVAL);
> +}

Mismatch with the return type and value here.

> +/**
> + * opp_enable() - Enable a specific OPP
> + * @opp:	Pointer to opp
> + *
> + * Enables a provided opp. If the operation is valid, this returns 0, else the
> + * corresponding error value.
> + *
> + * OPP used here is from the the opp_is_valid/opp_has_freq or other search
> + * functions
> + */
> +int opp_enable(struct opp *opp)
> +{
> +	if (unlikely(!opp || IS_ERR(opp))) {
> +		pr_err("%s: Invalid parameters being passed\n", __func__);
> +		return -EINVAL;
> +	}
> +
> +	if (!opp->enabled && opp->dev_opp)
> +		opp->dev_opp->enabled_opp_count++;
> +
> +	opp->enabled = true;
> +
> +	return 0;
> +}

When reading the description I'd expected to see some facility to
trigger selection of an active operating point in the library (possibly
as a separate call since you might have a bunch of operating points
being updated in quick succession) but it looks like that needs to be
supplied externally at the minute?

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Nishanth Menon <nm@ti.com>
Cc: linux-arm <linux-arm-kernel@lists.infradead.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Phil Carmody <ext-phil.2.carmody@nokia.com>,
	linux-doc <linux-doc@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Madhusudhan Chikkature Rajashekar <madhu.cr@ti.com>,
	Sergio Alberto Aguirre Rodriguez <saaguirre@ti.com>,
	Andi Kleen <ak@linux.intel.com>,
	linux-pm <linux-pm@lists.linux-foundation.org>,
	Matthew Garrett <mjg@redhat.com>, Len Brown <len.brown@intel.com>,
	Eduardo Valentin <eduardo.valentin@nokia.com>,
	linux-omap <linux-omap@vger.kernel.org>,
	Thara Gopinath <thara@ti.com>,
	Linus Walleij <linus.walleij@stericsson.com>,
	Roberto Granados Dorado <x0095451@ti.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Romit Dasgupta <ro.mit@ti.com>,
	Tero Kristo <Tero.Kristo@nokia.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Sanjeev Premi <premi@ti.com>
Subject: Re: [linux-pm] [PATCH] opp: introduce library for device-specific OPPs
Date: Fri, 17 Sep 2010 16:36:43 +0100	[thread overview]
Message-ID: <20100917153643.GC29739@sirena.org.uk> (raw)
In-Reply-To: <1284686973-13993-1-git-send-email-nm@ti.com>

On Thu, Sep 16, 2010 at 08:29:33PM -0500, Nishanth Menon wrote:

> +struct opp_def {
> +	unsigned long freq;
> +	unsigned long u_volt;
> +
> +	bool enabled;
> +};

It might be clearer to use some term other than enabled in the code -
when reading I wasn't immediately sure if enabled meant that it was
available to be selected or if it was the active operating point.  How
about 'allowed' (though I'm not 100% happy with that)?

> +static inline int opp_add(struct device *dev, const struct opp_def *opp_def)
> +{
> +	return ERR_PTR(-EINVAL);
> +}

Mismatch with the return type and value here.

> +/**
> + * opp_enable() - Enable a specific OPP
> + * @opp:	Pointer to opp
> + *
> + * Enables a provided opp. If the operation is valid, this returns 0, else the
> + * corresponding error value.
> + *
> + * OPP used here is from the the opp_is_valid/opp_has_freq or other search
> + * functions
> + */
> +int opp_enable(struct opp *opp)
> +{
> +	if (unlikely(!opp || IS_ERR(opp))) {
> +		pr_err("%s: Invalid parameters being passed\n", __func__);
> +		return -EINVAL;
> +	}
> +
> +	if (!opp->enabled && opp->dev_opp)
> +		opp->dev_opp->enabled_opp_count++;
> +
> +	opp->enabled = true;
> +
> +	return 0;
> +}

When reading the description I'd expected to see some facility to
trigger selection of an active operating point in the library (possibly
as a separate call since you might have a bunch of operating points
being updated in quick succession) but it looks like that needs to be
supplied externally at the minute?

  parent reply	other threads:[~2010-09-17 15:36 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <[PATCH 1/4] OMAP: introduce OPP layer for device-specific OPPs>
2010-09-17  1:29 ` [PATCH] opp: introduce library for device-specific OPPs Nishanth Menon
2010-09-17  1:29 ` Nishanth Menon
2010-09-17  1:29   ` Nishanth Menon
2010-09-17 13:41   ` Linus Walleij
2010-09-17 13:41     ` Linus Walleij
2010-09-17 15:05     ` Nishanth Menon
2010-09-17 15:05     ` Nishanth Menon
2010-09-17 15:05       ` Nishanth Menon
2010-09-17 15:59       ` Nishanth Menon
2010-09-17 15:59         ` Nishanth Menon
2010-09-17 22:45         ` Rafael J. Wysocki
2010-09-17 22:45           ` Rafael J. Wysocki
2010-09-17 23:19           ` Nishanth Menon
2010-09-17 23:19             ` Nishanth Menon
2010-09-18 19:11             ` Rafael J. Wysocki
2010-09-18 19:11             ` Rafael J. Wysocki
2010-09-18 19:11             ` Rafael J. Wysocki
2010-09-18 19:11               ` Rafael J. Wysocki
2010-09-17 15:59       ` Nishanth Menon
2010-09-17 14:09   ` Aguirre, Sergio
2010-09-17 14:09     ` Aguirre, Sergio
2010-09-17 15:30     ` Nishanth Menon
2010-09-17 15:30       ` Nishanth Menon
2010-09-17 16:11       ` Aguirre, Sergio
2010-09-17 16:11       ` Aguirre, Sergio
2010-09-17 16:11         ` Aguirre, Sergio
2010-09-17 16:15       ` Aguirre, Sergio
2010-09-17 16:15       ` Aguirre, Sergio
2010-09-17 16:15         ` Aguirre, Sergio
2010-09-17 16:20         ` Nishanth Menon
2010-09-17 16:20         ` Nishanth Menon
2010-09-17 16:20           ` Nishanth Menon
2010-09-17 15:30     ` Nishanth Menon
2010-09-17 14:09   ` Aguirre, Sergio
2010-09-17 15:36   ` Mark Brown [this message]
2010-09-17 15:36     ` [linux-pm] " Mark Brown
2010-09-17 15:36     ` Mark Brown
2010-09-17 15:53     ` Nishanth Menon
2010-09-17 15:53       ` Nishanth Menon
2010-09-17 15:53       ` Nishanth Menon
2010-09-17 15:59       ` Mark Brown
2010-09-17 15:59         ` Mark Brown
2010-09-17 15:59         ` Mark Brown
2010-09-18  0:37         ` Kevin Hilman
2010-09-18  0:37           ` Kevin Hilman
2010-09-18 10:04           ` Mark Brown
2010-09-18 10:04           ` [linux-pm] " Mark Brown
2010-09-18 10:04             ` Mark Brown
2010-09-18  0:37         ` Kevin Hilman
2010-09-17 15:59       ` Mark Brown
2010-09-17 22:22       ` [linux-pm] " Rafael J. Wysocki
2010-09-17 22:22         ` Rafael J. Wysocki
2010-09-17 22:22         ` Rafael J. Wysocki
2010-09-17 22:26         ` Nishanth Menon
2010-09-17 22:26         ` [linux-pm] " Nishanth Menon
2010-09-17 22:26           ` Nishanth Menon
2010-09-17 22:26           ` Nishanth Menon
2010-09-17 22:52           ` Rafael J. Wysocki
2010-09-17 22:52           ` [linux-pm] " Rafael J. Wysocki
2010-09-17 22:52             ` Rafael J. Wysocki
2010-09-17 22:52             ` Rafael J. Wysocki
2010-09-17 22:22       ` Rafael J. Wysocki
2010-09-17 15:53     ` Nishanth Menon
2010-09-17 16:45     ` Phil Carmody
2010-09-17 16:45     ` [linux-pm] " Phil Carmody
2010-09-17 16:45       ` Phil Carmody
2010-09-17 16:45       ` Phil Carmody
2010-09-18 10:08       ` Mark Brown
2010-09-18 10:08       ` [linux-pm] " Mark Brown
2010-09-18 10:08         ` Mark Brown
2010-09-18 10:08         ` Mark Brown
2010-09-17 15:36   ` Mark Brown
2010-09-17 19:19   ` Andrew Morton
2010-09-17 19:19   ` Andrew Morton
2010-09-17 19:19     ` Andrew Morton
2010-09-17 21:23     ` Nishanth Menon
2010-09-17 21:23     ` Nishanth Menon
2010-09-17 21:23       ` Nishanth Menon
2010-09-17 22:51       ` Kevin Hilman
2010-09-17 22:51         ` Kevin Hilman
2010-09-17 23:07       ` Rafael J. Wysocki
2010-09-17 23:07         ` Rafael J. Wysocki
2010-09-17 23:33         ` Nishanth Menon
2010-09-17 23:33           ` Nishanth Menon
2010-09-18 18:41           ` Rafael J. Wysocki
2010-09-18 18:41           ` Rafael J. Wysocki
2010-09-18 18:41             ` Rafael J. Wysocki
2010-09-18 18:41             ` Rafael J. Wysocki
2010-09-20 15:26             ` Kevin Hilman
2010-09-20 15:26               ` Kevin Hilman
2010-09-20 15:26               ` Kevin Hilman
2010-09-20 16:38               ` Rafael J. Wysocki
2010-09-20 16:38                 ` Rafael J. Wysocki
2010-09-20 17:21                 ` Kevin Hilman
2010-09-20 17:21                   ` Kevin Hilman
2010-09-20 17:35                   ` Rafael J. Wysocki
2010-09-20 17:35                     ` Rafael J. Wysocki
2010-09-20 17:35                   ` Rafael J. Wysocki
2010-09-20 17:21                 ` Kevin Hilman
2010-09-20 16:38               ` Rafael J. Wysocki
2010-09-20 15:26             ` Kevin Hilman
2010-09-19 19:46         ` Mark Brown
2010-09-19 19:46           ` Mark Brown
2010-09-17 22:07     ` Rafael J. Wysocki
2010-09-17 22:07       ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100917153643.GC29739@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=Tero.Kristo@nokia.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=eduardo.valentin@nokia.com \
    --cc=ext-phil.2.carmody@nokia.com \
    --cc=hpa@zytor.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=len.brown@intel.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=madhu.cr@ti.com \
    --cc=martin.petersen@oracle.com \
    --cc=mjg@redhat.com \
    --cc=nm@ti.com \
    --cc=ro.mit@ti.com \
    --cc=saaguirre@ti.com \
    --cc=thara@ti.com \
    --cc=x0095451@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.