linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Gustav Wiklander <gustavwi@axis.com>
Cc: Gustav Wiklander <Gustav.Wiklander@axis.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"khilman@kernel.org" <khilman@kernel.org>,
	"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
	"len.brown@intel.com" <len.brown@intel.com>,
	"pavel@ucw.cz" <pavel@ucw.cz>, kernel <kernel@axis.com>
Subject: Re: [PATCH] PM / Domains: Add module ref count for each consumer
Date: Sun, 5 Jul 2020 11:37:08 +0200	[thread overview]
Message-ID: <20200705093708.GA559523@kroah.com> (raw)
In-Reply-To: <a6f1fbad-b753-db30-bf95-c314e9eea508@axis.com>

On Wed, Jun 10, 2020 at 07:24:02PM +0200, Gustav Wiklander wrote:
> On 6/10/20 4:52 PM, Greg KH wrote:
> > On Wed, Jun 10, 2020 at 04:39:43PM +0200, Gustav Wiklander wrote:
> > > From: Gustav Wiklander <gustavwi@axis.com>
> > > 
> > > Currently a pm_domain can be unloaded without regard for consumers.
> > > This patch adds a module dependecy for every registered consumer.
> > > Now a power domain driver can only be unloaded if no consumers are
> > > registered.
> > 
> > What is the problem with doing this?  Shouldn't when a power domain is
> > unregistered, the consumers are properly torn down?  Some subsystems
> > allow you to unload a module at any point in time, and properly clean
> > things up.  What is the problem today that you are trying to solve with
> > this (remember, removing modules only happens by developers, no
> > real-world system ever automatically onloads a module.)
> > 
> > 
> Hi Greg and Rafael,
> 
> Thanks for the quick reply.
> 
> PM domains shall call pm_genpd_remove at removal. As described in the
> definition pm_genpd_remove will fail if any device is still associated to
> it. *However*, at module removal the kernel ignores device removal failure
> and still unloads the powerdomain module.

So shouldn't the driver that controls that device be fixed up to
properly remove the association first?

Is there any in-kernel code that has this problem today?  Adding module
reference logic for an operation that has to be initiated by a developer
only, seems like it's not really needed.

thanks,

greg k-h

  reply	other threads:[~2020-07-05  9:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 14:39 [PATCH] PM / Domains: Add module ref count for each consumer Gustav Wiklander
2020-06-10 14:52 ` Greg KH
2020-06-10 17:24   ` Gustav Wiklander
2020-07-05  9:37     ` Greg KH [this message]
2020-06-10 14:57 ` 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=20200705093708.GA559523@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Gustav.Wiklander@axis.com \
    --cc=gustavwi@axis.com \
    --cc=kernel@axis.com \
    --cc=khilman@kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@linaro.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;
as well as URLs for NNTP newsgroup(s).