Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: rjw@rjwysocki.net (Rafael J. Wysocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] PM / runtime: Drop usage count for suppliers at device link removal
Date: Tue, 29 May 2018 10:40:51 +0200	[thread overview]
Message-ID: <2305835.OJaHNvgZnB@aspire.rjw.lan> (raw)
In-Reply-To: <CAJZ5v0gGLvKS6yDuBokJzm2gAhM=VMSaz5frvWq=eRPkAD-z6g@mail.gmail.com>

On Sunday, May 27, 2018 12:18:05 PM CEST Rafael J. Wysocki wrote:
> On Thu, May 24, 2018 at 10:33 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> > In the case consumer device is runtime resumed, while the link to the
> > supplier is removed, the earlier call to pm_runtime_get_sync() made from
> > rpm_get_suppliers() does not get properly balanced with a corresponding
> > call to pm_runtime_put(). This leads to that suppliers remains to be
> > runtime resumed forever, while they don't need to.
> >
> > Let's fix the behaviour by calling rpm_put_suppliers() when dropping a
> > device link. Not that, since rpm_put_suppliers() checks the
> > link->rpm_active flag, we can correctly avoid to call pm_runtime_put() in
> > cases when we shouldn't.
> >
> > Reported-by: Todor Tomov <todor.tomov@linaro.org>
> > Fixes: 21d5c57b3726 ("PM / runtime: Use device links")
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > ---
> >
> > Rafael, I am not sure if this is safe from locking point of view. The device
> > link write lock has been taken when pm_runtime_drop_link() is called, hence I
> > assume calling rpm_put_suppliers() should be fine!? If not, can you please
> > advise how to change?
> 
> Holding the lock should be sufficient for the list to be stable, so
> AFAICS it is OK.

So the patch has been applied, thanks!

      reply	other threads:[~2018-05-29  8:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24  8:33 [PATCH] PM / runtime: Drop usage count for suppliers at device link removal Ulf Hansson
2018-05-27 10:18 ` Rafael J. Wysocki
2018-05-29  8:40   ` Rafael J. Wysocki [this message]

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=2305835.OJaHNvgZnB@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox