All of lore.kernel.org
 help / color / mirror / Atom feed
From: Todd Poynor <toddpoynor@google.com>
To: Nishanth Menon <nm@ti.com>
Cc: linux-pm <linux-pm@lists.linux-foundation.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH] PM: OPP: introduce function to free cpufreq table
Date: Mon, 23 May 2011 17:05:49 -0700	[thread overview]
Message-ID: <20110524000549.GA20225@google.com> (raw)
In-Reply-To: <1306192335-19883-1-git-send-email-nm@ti.com>

On Mon, May 23, 2011 at 06:12:15PM -0500, Nishanth Menon wrote:
> cpufreq table allocated by opp_init_cpufreq_table is better
> freed by OPP layer itself. This allows future modifications to
> the table handling to be transparent to the users.
...
> +void opp_free_cpufreq_table(struct device *dev,
> +				struct cpufreq_frequency_table **table)
> +{
> +	if (!table)
> +		return;
> +
> +	/* Pretend as if I am an updater */
> +	mutex_lock(&dev_opp_list_lock);
> +	kfree(*table);
> +	*table = NULL;
> +	mutex_unlock(&dev_opp_list_lock);
> +}

Not clear what the mutex protects here.  Currently it protects only
device opp list modifications.  opp_init_cpufreq_table holds the lock only
while looking up and walking the device opp list; the cpufreq table it
creates is not complete by the time the lock is dropped.


Todd

  parent reply	other threads:[~2011-05-24  0:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 23:12 [PATCH] PM: OPP: introduce function to free cpufreq table Nishanth Menon
2011-05-24  0:05 ` Todd Poynor
2011-05-24  0:05 ` Todd Poynor [this message]
2011-05-24  2:42   ` Menon, Nishanth
2011-05-24 18:49     ` Rafael J. Wysocki
2011-05-24 18:49     ` Rafael J. Wysocki
2011-05-24  2:42   ` Menon, Nishanth
  -- strict thread matches above, loose matches on Subject: below --
2011-05-23 23:12 Nishanth Menon

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=20110524000549.GA20225@google.com \
    --to=toddpoynor@google.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=nm@ti.com \
    --cc=rjw@sisk.pl \
    /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.