mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
	Patch Tracking <patches@linaro.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lan Tianyu <tianyu.lan@intel.com>, Nishanth Menon <nm@ti.com>,
	jinchoi@broadcom.com,
	Sebastian Capella <sebastian.capella@linaro.org>,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Subject: Re: [PATCH] cpufreq: suspend/resume governors with PM notifiers
Date: Mon, 25 Nov 2013 12:35:44 +0100	[thread overview]
Message-ID: <2123322.DfAe1RTUPo@vostro.rjw.lan> (raw)
In-Reply-To: <CAKohponZEpk52rOcx-XxfUp75rZMUN8tqR=DJHnutO9Ga3fJ-Q@mail.gmail.com>

On Monday, November 25, 2013 09:55:19 AM Viresh Kumar wrote:
> On 22 November 2013 14:41, viresh kumar <viresh.kumar@linaro.org> wrote:
> > So, what about something like this ?
> >
> > diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> > index f48370d..523c0bc 100644
> > --- a/drivers/base/cpu.c
> > +++ b/drivers/base/cpu.c
> > @@ -120,6 +120,45 @@ static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_store);
> >  #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
> >  #endif /* CONFIG_HOTPLUG_CPU */
> >
> > +int cpu_subsys_suspend_noirq(struct device *dev)
> > +{
> > +       struct bus_type *bus = dev->bus;
> > +       struct subsys_interface *sif;
> > +       int ret = 0;
> > +
> > +       list_for_each_entry(sif, &bus->p->interfaces, node) {
> > +               if (sif->pm && sif->pm->suspend_noirq) {
> > +                       ret = sif->suspend_noirq(dev);
> > +                       if (ret)
> > +                               break;
> > +               }
> > +       }
> > +
> > +       return ret;
> > +}
> > +
> > +int cpu_subsys_resume_noirq(struct device *dev)
> > +{
> > +       struct bus_type *bus = dev->bus;
> > +       struct subsys_interface *sif;
> > +       int ret = 0;
> > +
> > +       list_for_each_entry(sif, &bus->p->interfaces, node) {
> > +               if (sif->pm && sif->pm->resume_noirq) {
> > +                       ret = sif->resume_noirq(dev);
> > +                       if (ret)
> > +                               break;
> > +               }
> > +       }
> > +
> > +       return ret;
> > +}
> > +
> > +static const struct dev_pm_ops cpu_subsys_pm_ops = {
> > +       .suspend_noirq = cpu_subsys_suspend_noirq,
> > +       .resume_noirq = cpu_subsys_resume_noirq,
> > +};
> > +
> >  struct bus_type cpu_subsys = {
> >         .name = "cpu",
> >         .dev_name = "cpu",
> > @@ -128,6 +167,7 @@ struct bus_type cpu_subsys = {
> >         .online = cpu_subsys_online,
> >         .offline = cpu_subsys_offline,
> >  #endif
> > +       .pm = &cpu_subsys_pm_ops,
> >  };
> >  EXPORT_SYMBOL_GPL(cpu_subsys);
> >
> > diff --git a/include/linux/device.h b/include/linux/device.h
> > index b025925..fa01273 100644
> > --- a/include/linux/device.h
> > +++ b/include/linux/device.h
> > @@ -298,11 +298,16 @@ struct device *driver_find_device(struct device_driver *drv,
> >   * @node:       the list of functions registered at the subsystem
> >   * @add_dev:    device hookup to device function handler
> >   * @remove_dev: device hookup to device function handler
> > + * @pm: Power management operations of this interface.
> >   *
> >   * Simple interfaces attached to a subsystem. Multiple interfaces can
> >   * attach to a subsystem and its devices. Unlike drivers, they do not
> >   * exclusively claim or control devices. Interfaces usually represent
> >   * a specific functionality of a subsystem/class of devices.
> > + *
> > + * PM callbacks are called from individual subsystems instead of PM core. And
> > + * hence might not be available for all subsystems. Currently present for:
> > + * cpu_subsys.
> >   */
> >  struct subsys_interface {
> >         const char *name;
> > @@ -310,6 +315,7 @@ struct subsys_interface {
> >         struct list_head node;
> >         int (*add_dev)(struct device *dev, struct subsys_interface *sif);
> >         int (*remove_dev)(struct device *dev, struct subsys_interface *sif);
> > +       const struct dev_pm_ops *pm;
> >  };
> >
> >  int subsys_interface_register(struct subsys_interface *sif);
> 
> Any inputs?

Please give me some more time, this suretly is not urgent?

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2013-11-25 11:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 10:12 Viresh Kumar
2013-11-15 13:48 ` Nishanth Menon
2013-11-15 15:34   ` Viresh Kumar
2013-11-16  0:24 ` Rafael J. Wysocki
2013-11-16  4:31   ` viresh kumar
2013-11-16 14:29     ` Rafael J. Wysocki
2013-11-16 15:17       ` Viresh Kumar
2013-11-17  1:08         ` Rafael J. Wysocki
2013-11-17  8:22           ` viresh kumar
2013-11-17 15:09             ` Rafael J. Wysocki
2013-11-17 16:57               ` Viresh Kumar
2013-11-17 21:37                 ` Rafael J. Wysocki
2013-11-18  5:39                   ` viresh kumar
2013-11-18 10:57                     ` Lan Tianyu
2013-11-18 11:01                       ` Viresh Kumar
2013-11-18 13:37                         ` Lan Tianyu
2013-11-18 15:32                           ` Viresh Kumar
2013-11-21 14:39                           ` Rafael J. Wysocki
2013-11-20  5:34                     ` Viresh Kumar
2013-11-21  1:07                       ` Rafael J. Wysocki
2013-11-21 14:38                       ` Rafael J. Wysocki
2013-11-21 16:17                         ` Viresh Kumar
2013-11-21 22:14                           ` Rafael J. Wysocki
2013-11-22  9:11                             ` viresh kumar
2013-11-25  4:25                               ` Viresh Kumar
2013-11-25 11:35                                 ` Rafael J. Wysocki [this message]
2013-12-25 22:39           ` Pavel Machek
2013-12-26  0:56             ` Rafael J. Wysocki
2013-11-16  5:56 ` Lan Tianyu

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=2123322.DfAe1RTUPo@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=cpufreq@vger.kernel.org \
    --cc=jinchoi@broadcom.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=patches@linaro.org \
    --cc=sebastian.capella@linaro.org \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tianyu.lan@intel.com \
    --cc=viresh.kumar@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

all inboxes | Powered by JetHome®