Linux Power Management development
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] r8169: Enable WOL from Magic Packet by default
From: Sameer Nanda @ 2012-02-16 20:47 UTC (permalink / raw)
  To: David Miller; +Cc: romieu, rjw, hayeswang, netdev, linux-pm
In-Reply-To: <20120214.223746.419009242484406948.davem@davemloft.net>

On Tue, Feb 14, 2012 at 7:37 PM, David Miller <davem@davemloft.net> wrote:
> From: Sameer Nanda <snanda@chromium.org>
> Date: Tue, 14 Feb 2012 17:00:04 -0800
>
>> On Tue, Feb 14, 2012 at 4:13 PM, Francois Romieu <romieu@fr.zoreil.com> wrote:
>>> Sameer Nanda <snanda@chromium.org> :
>>>> Set the WOL config registers to only enable WOL from magic packet by
>>>> default. Without this change in place, the WOL config register
>>>> settings on warm reboot come up in an inconsistent state since these
>>>> registers don't get reset on a warm reboot.
>>>
>>> I am not completely convinced, especially as the change of behavior
>>> could be noticed.
>>
>> Agreed that this change could be noticed.  Maybe a module parameter
>> might be a better way to handle this?
>
> Please no random module parameters, something ethtool based is
> what you should shoot for.

With the existing code, WOL from PHY, unicast, multicast and broadcast
packets may get accidentally enabled.  The probability of seeing such
packets/events in the wild is quite high and this can cause unintended
wakes from S3 or reboots.

The probability of seeing matching MagicPackets in the wild is
vanishingly small.  Therefore, setting MagicPacket as the only default
WOL mechanism seems like the safer option.

Since ethtool already supports setting of WOL options from userland, I
guess we don't need a new module parameter as the user can set WOL
options according to his own desires.

-- 
Sameer

^ permalink raw reply

* Re: Corrupted files after suspend to disk
From: Dave Jones @ 2012-02-16 16:30 UTC (permalink / raw)
  To: richard -rw- weinberger; +Cc: linux-pm, LKML, esandeen
In-Reply-To: <CAFLxGvzzHDRma_Y_XEpOD+fY+vonbkoR1mvQp4Vb4c3M6fTsPA@mail.gmail.com>

On Thu, Feb 16, 2012 at 11:52:27AM +0100, richard -rw- weinberger wrote:
 
 > >> >> Of course, please test the above separately. :-)
 > >> >
 > >> > Ok, I'll test this when I'm at home.
 > >> >
 > >> > BTW: dropping the caches helps, when some files seem corrupted.
 > >> > Today /usr/bin/okular was broken.
 > >> > After setting vm.drop_caches=1 it worked again.
 > >>
 > >> On Linux 2.6.38 I'm unable to reproduce the issue.
 > >> Only 2.6.37 seems to be affected.
 > >> So, I'm moving over to 2.6.38. :)
 > >
 > Bad news:
 > I saw the issue on 3.x too but thought it's because my IdeaPad s10 is crap.
 > Now with my shiny new Lenovo x121e I have the same issue! :-(
 > 
 > OpenSUSE 12.1, kernel 3.2.7.
 > After a few suspend2disk iterations random files are corrupted.
 > But only cached files. A reboot solves the problem.
 
FWIW, we've been seeing a number of hard to diagnose failures
with suspend to disk for the last few releases in Fedora.
Eric Sandeen has been chasing https://bugzilla.redhat.com/show_bug.cgi?id=744275
for a while, but there's no smoking gun that really explains what's
getting into these states. Further complicating things, is that it
doesn't seem to be 100% reproducable.

	Dave

^ permalink raw reply

* Re: Query: When will drv->poweroff() called
From: viresh kumar @ 2012-02-16 15:16 UTC (permalink / raw)
  To: amit.kucheria, linux-pm@lists.linux-foundation.org
  Cc: Viresh Kumar, Rafael J. Wysocki, len.brown@intel.com,
	Vipul Kumar SAMAR, Bhupesh SHARMA, Pratyush ANAND,
	Armando VISCONTI, Mirko GARDI, linux-kernel@vger.kernel.org,
	Vipin KUMAR, Shiraz HASHIM, Amit VIRDI, Rajeev KUMAR,
	pavel@ucw.cz, Deepak SIKRI, linux-arm-kernel@lists.infradead.org,
	Vincenzo FRASCINO
In-Reply-To: <4F30A668.8010407@st.com>

[Sorry for mailing again, earlier mail bounced on linux-pm list,
as i wasn't subscribed to it]

Hi Amit,

Can you please clear my doubt regarding calling of
hibernation_set_ops() for ARM SoC's?

--
viresh

On Mon, Feb 6, 2012 at 8:19 PM, Viresh Kumar <viresh.kumar@st.com> wrote:
> On 2/6/2012 5:37 PM, Rafael J. Wysocki wrote:
>> On Monday, February 06, 2012, Viresh Kumar wrote:
>>> >
>>> > Hi Guys,
>>> >
>>> > Sorry for asking this silly question, but i couldn't locate much
>>> > help for it in documentation, so asking it.
>>> >
>>> > We were testing hibernation for SPEAr13xx SoC family, based on
>>> > ARM Cortex a9.
>>> >
>>> > I observed that poweroff() callback of individual drivers are not
>>> > getting called at all, while we test hibernate.
>> They should be called in the last phase of hibernation, after the image
>> has been created and the system is going for "power off" (hance the
>> callback name).
>>
>>> > I tried to go through the code to see what happened. It looked like
>>> > there should be call to hibernation_set_ops() for platforms that are
>>> > willing to get a call to poweroff() for their drivers.
>> That's correct.  The ->poweroff() callbacks are only executed if
>> hibernation_mode is equal to HIBERNATION_PLATFORM, which is not the
>> default.
>>
>>> > Otherwise shutdown of the busses gets called, which is a completely
>>> > different path.
>>> >
>>> > There are many drivers today, that are registering poweroff() from dev_pm_ops
>>> > but are not doing bus specific shutdown stuff.
>>> >
>>> > Even i tried to look for hibernation_set_ops() in kernel, and only acpi
>>> > code is calling it.
>> That's correct too.
>>
>>> > I didn't understood how other ARM Sub-Arch's are handling this.
>> Well, they are supposed to call hibernation_set_ops() and set the operations
>> appropriately.  Those operations may be empty routines if they don't need
>> to do anything, but they have to be defined.
>
> Hi Amit,
>
> Can you give some input on why none of the ARM platforms are calling
> this routine currently.

^ permalink raw reply

* Re: Corrupted files after suspend to disk
From: richard -rw- weinberger @ 2012-02-16 10:52 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-pm, LKML
In-Reply-To: <201103242330.14416.rjw@sisk.pl>

On Thu, Mar 24, 2011 at 11:30 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Thursday, March 24, 2011, richard -rw- weinberger wrote:
>> On Thu, Mar 24, 2011 at 11:16 AM, richard -rw- weinberger
>> <richard.weinberger@gmail.com> wrote:
>> > On Thu, Mar 24, 2011 at 12:00 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> >> On Wednesday, March 23, 2011, richard -rw- weinberger wrote:
>> >>> On Wed, Mar 23, 2011 at 11:22 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> >>> > On Wednesday, March 23, 2011, richard -rw- weinberger wrote:
>> >>> >> On Wed, Mar 23, 2011 at 11:11 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> >>> >> > On Wednesday, March 23, 2011, richard -rw- weinberger wrote:
>> >>> >> >> 2011/3/23 Rafael J. Wysocki <rjw@sisk.pl>:
>> >>> >> >> > On Wednesday, March 23, 2011, richard -rw- weinberger wrote:
>> >>> >> >> >> Hi,
>> >>> >> >> >>
>> >>> >> >> >> I'm facing a very strange problem on my netbook (Lenovo Ideapad S10)
>> >>> >> >> >> running Linux 2.6.37.4.
>> >>> >> >> >> After resuming from s2disk some files are corrupted.
>> >>> >> >> >> But when I reboot my netbook everything seems good again.
>> >>> >> >> >>
>> >>> >> >> >> When I saw the problem the first time the ls command segfaulted always.
>> >>> >> >> >> I did a reboot and it worked again.
>> >>> >> >> >>
>> >>> >> >> >> A few days later zypper crashed. After a reboot it worked again.
>> >>> >> >> >> And today ssh crashed. I looked a bit closer and saw it crashed
>> >>> >> >> >> somewhere within libcrypto.
>> >>> >> >> >> So I made copy libcrypto and rebooted.
>> >>> >> >> >> After the reboot ssh worked again but libcrypto and the copy of it hat
>> >>> >> >> >> a different sha1 sum!
>> >>> >> >> >> WTF?!
>> >>> >> >> >>
>> >>> >> >> >> Is this a known issue?
>> >>> >> >> >
>> >>> >> >> > No.
>> >>> >> >> >
>> >>> >> >> >> dmesgs and config are attached.
>> >>> >> >> >>
>> >>> >> >> >> The used distribution is openSUSE 11.4 with suspend-0.80.20100129-7.1
>> >>> >> >> >> (default from suse).
>> >>> >> >> >> I'm using ext3 as root filesystem.
>> >>> >> >> >> What else do you need?
>> >>> >> >> >
>> >>> >> >> > Whatever you can do to narrow down the problem.  At the moment I only know
>> >>> >> >> > that it's there.
>> >>> >> >>
>> >>> >> >> I can reproduce the problem now.
>> >>> >> >> After ~20 suspend and resume iterations aide finds corrupted files in /lib/.
>> >>> >> >> It's always a very basic lib like libcrypto, libglib which is used all
>> >>> >> >> the time on my system.
>> >>> >> >
>> >>> >> > Those files are never intentionally modified, right?
>> >>> >> >
>> >>> >> >> Maybe it's an issue like this one?
>> >>> >> >> https://lkml.org/lkml/2010/12/2/339
>> >>> >> >
>> >>> >> > It might have if that patch hadn't been merged before 2.6.37.
>> >>> >> >
>> >>> >> > Is the system 32-bit or 64-bit?
>> >>> >>
>> >>> >> It's a 32-bit system.
>> >>> >> cmp shows that the corrupted files differ in many bytes (not scattered).
>> >>> >> The corrupted bytes are always 0 or 252.
>> >>> >
>> >>> > Do I understand correctly that the files apparently corrupted after resume
>> >>> > are not corrupted any more when you reboot?
>> >>>
>> >>> Yes.
>> >>> Seems like a cache issue.
>> >>
>> >> There's a couple things you can check before we start asking other people for
>> >> help.
>> >>
>> >> First, it would be good to know if things change when you save the image
>> >> into a swap file instead of the swap partition you've been using so far
>> >> (I believe it's documented quite well how to do that).
>> >>
>> >> Second, please verify if using the built-in save/load hibernate code leads
>> >> to the same issue (you can hibernate by doing "echo disk > /sys/power/state"
>> >> to verify that).
>> >>
>> >> Of course, please test the above separately. :-)
>> >
>> > Ok, I'll test this when I'm at home.
>> >
>> > BTW: dropping the caches helps, when some files seem corrupted.
>> > Today /usr/bin/okular was broken.
>> > After setting vm.drop_caches=1 it worked again.
>> >
>> >> Thanks,
>> >> Rafael
>> >> --
>> >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> >> the body of a message to majordomo@vger.kernel.org
>> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> >> Please read the FAQ at  http://www.tux.org/lkml/
>> >>
>> >
>> > --
>> > Thanks,
>> > //richard
>> >
>>
>> On Linux 2.6.38 I'm unable to reproduce the issue.
>> Only 2.6.37 seems to be affected.
>> So, I'm moving over to 2.6.38. :)
>
> OK, thanks for the report. :-)
>
> Rafael

Bad news:
I saw the issue on 3.x too but thought it's because my IdeaPad s10 is crap.
Now with my shiny new Lenovo x121e I have the same issue! :-(

OpenSUSE 12.1, kernel 3.2.7.
After a few suspend2disk iterations random files are corrupted.
But only cached files. A reboot solves the problem.

-- 
Thanks,
//richard

^ permalink raw reply

* Re: [linux-pm] [PATCH 0/2] RFC: CPU frequency max as PM QoS param
From: Kevin Hilman @ 2012-02-16  1:06 UTC (permalink / raw)
  To: Antti P Miettinen
  Cc: davej, pavel, rjw, len.brown, j-pihet, markgross, cpufreq,
	linux-pm
In-Reply-To: <1326976559-4009-1-git-send-email-amiettinen@nvidia.com>

Hello,

Antti P Miettinen <amiettinen@nvidia.com> writes:

> This is a continuation to "RFC: CPU frequency min as PM QoS param"
> patchset. This patchset adds CPU frequency maximum as a PM QoS
> parameter and modifies CPU frequncy core to enforce the limit. CPU
> frequency ceiling can be used to improve the energy efficiency of
> workloads that would cause the cpufreq governors to enforce an
> unnecessarily high operating point. In other words, CPU frequency
> maximum can act as an energy efficiency level request.
>
> Tested on Dell E6420 with the ACPI cpufreq driver against Ubuntu
> 3.2. Patches are against linux-next, compile tested.

I know there were some earlier discussions about the usefulness of a max
frequency QoS parameter, so I wanted to throw in a reason to include max
as well as min frequency parameters.

IMO, having a max frequency QoS parameter would be very useful from a
thermal perspective.  

There are some ongoing projects in the PM working group at Linaro that
are exploring plugins to the thermal framework that implment a "cooling
device" by capping CPU frequency.  Having a QoS parameter do do this
would be the logical interface.

I also agree with some earlier requests that these should probably be
per-CPU instead of global.  That would make it simple to cap frequency
of one cluster while leaving another alone.

Kevin

^ permalink raw reply

* Re: [PATCH 2/2] PM / QoS: unconditionally build the per-device constraints feature
From: mark gross @ 2012-02-15 15:33 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Venkatesh Pallipadi, markgross, linux-kernel,
	Linux PM mailing list, Jean Pihet
In-Reply-To: <201202122227.39949.rjw@sisk.pl>

On Sun, Feb 12, 2012 at 10:27:39PM +0100, Rafael J. Wysocki wrote:
> On Sunday, February 12, 2012, mark gross wrote:
> > why are these two patches?
> > 
> > I think you could squash them into one and it would be just fine.
> 
> Well, what sense does _device_ PM QoS make without CONFIG_PM?

I forgot about device pm qos.  

your right.

--mark

> Rafael
> 
> 
> > On Tue, Feb 07, 2012 at 09:34:06AM +0100, Jean Pihet wrote:
> > > The per-device PM QoS feature depends on CONFIG_PM which depends
> > > on PM_SLEEP || PM_RUNTIME. This breaks CPU C-states with kernels
> > > not having these CONFIGs.
> > > 
> > > This patch allows the feature in all cases.
> > > 
> > > Signed-off-by: Jean Pihet <j-pihet@ti.com>
> > > Cc: Rafael J. Wysocki <rjw@sisk.pl>
> > > Cc: Mark Gross <markgross@thegnar.org>
> > > ---
> > >  drivers/base/power/Makefile |    3 ++-
> > >  include/linux/pm_qos.h      |   39 ---------------------------------------
> > >  2 files changed, 2 insertions(+), 40 deletions(-)
> > > 
> > > diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
> > > index 2e58ebb..312eb65 100644
> > > --- a/drivers/base/power/Makefile
> > > +++ b/drivers/base/power/Makefile
> > > @@ -1,4 +1,5 @@
> > > -obj-$(CONFIG_PM)	+= sysfs.o generic_ops.o common.o qos.o
> > > +obj-y			+= qos.o
> > > +obj-$(CONFIG_PM)	+= sysfs.o generic_ops.o common.o
> > >  obj-$(CONFIG_PM_SLEEP)	+= main.o wakeup.o
> > >  obj-$(CONFIG_PM_RUNTIME)	+= runtime.o
> > >  obj-$(CONFIG_PM_TRACE_RTC)	+= trace.o
> > > diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
> > > index 105be69..37b017a 100644
> > > --- a/include/linux/pm_qos.h
> > > +++ b/include/linux/pm_qos.h
> > > @@ -77,7 +77,6 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
> > >  int pm_qos_request_active(struct pm_qos_request *req);
> > >  s32 pm_qos_read_value(struct pm_qos_constraints *c);
> > >  
> > > -#ifdef CONFIG_PM
> > >  s32 __dev_pm_qos_read_value(struct device *dev);
> > >  s32 dev_pm_qos_read_value(struct device *dev);
> > >  int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
> > > @@ -94,43 +93,5 @@ void dev_pm_qos_constraints_init(struct device *dev);
> > >  void dev_pm_qos_constraints_destroy(struct device *dev);
> > >  int dev_pm_qos_add_ancestor_request(struct device *dev,
> > >  				    struct dev_pm_qos_request *req, s32 value);
> > > -#else
> > > -static inline s32 __dev_pm_qos_read_value(struct device *dev)
> > > -			{ return 0; }
> > > -static inline s32 dev_pm_qos_read_value(struct device *dev)
> > > -			{ return 0; }
> > > -static inline int dev_pm_qos_add_request(struct device *dev,
> > > -					 struct dev_pm_qos_request *req,
> > > -					 s32 value)
> > > -			{ return 0; }
> > > -static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
> > > -					    s32 new_value)
> > > -			{ return 0; }
> > > -static inline int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
> > > -			{ return 0; }
> > > -static inline int dev_pm_qos_add_notifier(struct device *dev,
> > > -					  struct notifier_block *notifier)
> > > -			{ return 0; }
> > > -static inline int dev_pm_qos_remove_notifier(struct device *dev,
> > > -					     struct notifier_block *notifier)
> > > -			{ return 0; }
> > > -static inline int dev_pm_qos_add_global_notifier(
> > > -					struct notifier_block *notifier)
> > > -			{ return 0; }
> > > -static inline int dev_pm_qos_remove_global_notifier(
> > > -					struct notifier_block *notifier)
> > > -			{ return 0; }
> > > -static inline void dev_pm_qos_constraints_init(struct device *dev)
> > > -{
> > > -	dev->power.power_state = PMSG_ON;
> > > -}
> > > -static inline void dev_pm_qos_constraints_destroy(struct device *dev)
> > > -{
> > > -	dev->power.power_state = PMSG_INVALID;
> > > -}
> > > -static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
> > > -				    struct dev_pm_qos_request *req, s32 value)
> > > -			{ return 0; }
> > > -#endif
> > >  
> > >  #endif
> > 
> > 
> 

^ permalink raw reply

* Re: [PATCH 1/2] r8169: Enable WOL from Magic Packet by default
From: David Miller @ 2012-02-15  3:37 UTC (permalink / raw)
  To: snanda; +Cc: netdev, linux-pm, hayeswang, romieu
In-Reply-To: <CANMivWax5jGNJLkjZWi2F5iaM+bnK0Ti1qZzQx4CGgkzeQqt7Q@mail.gmail.com>

From: Sameer Nanda <snanda@chromium.org>
Date: Tue, 14 Feb 2012 17:00:04 -0800

> On Tue, Feb 14, 2012 at 4:13 PM, Francois Romieu <romieu@fr.zoreil.com> wrote:
>> Sameer Nanda <snanda@chromium.org> :
>>> Set the WOL config registers to only enable WOL from magic packet by
>>> default. Without this change in place, the WOL config register
>>> settings on warm reboot come up in an inconsistent state since these
>>> registers don't get reset on a warm reboot.
>>
>> I am not completely convinced, especially as the change of behavior
>> could be noticed.
> 
> Agreed that this change could be noticed.  Maybe a module parameter
> might be a better way to handle this?

Please no random module parameters, something ethtool based is
what you should shoot for.

^ permalink raw reply

* Re: [PATCH 1/2] r8169: Enable WOL from Magic Packet by default
From: Sameer Nanda @ 2012-02-15  1:00 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev, linux-pm, hayeswang
In-Reply-To: <20120215001342.GA11453@electric-eye.fr.zoreil.com>

On Tue, Feb 14, 2012 at 4:13 PM, Francois Romieu <romieu@fr.zoreil.com> wrote:
> Sameer Nanda <snanda@chromium.org> :
>> Set the WOL config registers to only enable WOL from magic packet by
>> default. Without this change in place, the WOL config register
>> settings on warm reboot come up in an inconsistent state since these
>> registers don't get reset on a warm reboot.
>
> I am not completely convinced, especially as the change of behavior
> could be noticed.

Agreed that this change could be noticed.  Maybe a module parameter
might be a better way to handle this?

>
> Can you elaborate why the previous WoL settings should be ignored ?

With runtime PM, the "previous" settings may not be what the user had
set up since runtime PM mucks around with WOL settings.  Therefore,
the user could see inconsistent WOL settings upon booting up.

My second patch in this series mitigates this to a large extent by
restoring the saved WOL options in rtl_shutdown.  One case it doesn't
handle is non-graceful shutdown since rtl_shutdown may not be invoked.

The issue we ran into is this: disconnect network cable, reboot
system.  This will cause WOL on PHY to be enabled on next boot.  If
you connect the cable and then transition the system to S3 state or
halt the system, the system wakes right back up since the PHY state
changes.  Not good.

>
> --
> Ueimor



-- 
Sameer

^ permalink raw reply

* Re: [PATCH 2/2] r8169: transition to D0 state at shutdown
From: Francois Romieu @ 2012-02-15  0:14 UTC (permalink / raw)
  To: Sameer Nanda; +Cc: netdev, linux-pm, hayeswang
In-Reply-To: <1329244275-28130-1-git-send-email-snanda@chromium.org>

Sameer Nanda <snanda@chromium.org> :
> With runtime PM, if the ethernet cable is disconnected, the device is
> transitioned to D3 state to conserve energy. If the system is shutdown
> in this state, any register accesses in rtl_shutdown are dropped on
> the floor.
> 
> This patch transitions the device back to D0 state in rtl_shutdown if
> the device was runtime PM suspended. In addition, since runtiome PM
> also mucks around with WOL options, the saved WOL options are also
> restored in rtl_shutdown.

Ok.

I'll leave Rafael choose if he prefers the runtime pm layer to handle it
or not.

-- 
Ueimor

^ permalink raw reply

* Re: [PATCH 1/2] r8169: Enable WOL from Magic Packet by default
From: Francois Romieu @ 2012-02-15  0:13 UTC (permalink / raw)
  To: Sameer Nanda; +Cc: netdev, linux-pm, hayeswang
In-Reply-To: <1329244079-27842-1-git-send-email-snanda@chromium.org>

Sameer Nanda <snanda@chromium.org> :
> Set the WOL config registers to only enable WOL from magic packet by
> default. Without this change in place, the WOL config register
> settings on warm reboot come up in an inconsistent state since these
> registers don't get reset on a warm reboot.

I am not completely convinced, especially as the change of behavior
could be noticed.

Can you elaborate why the previous WoL settings should be ignored ?

-- 
Ueimor

^ permalink raw reply

* Re: [PATCH 1/2] r8169: Enable WOL from Magic Packet by default
From: Sameer Nanda @ 2012-02-14 18:38 UTC (permalink / raw)
  To: romieu, Rafael J. Wysocki, hayeswang; +Cc: netdev, linux-pm, Sameer Nanda
In-Reply-To: <CANMivWZ9OsEVpqUHCG=GYz82rv6f31Ppkh_-f7+Uf_BKU4rwgA@mail.gmail.com>

Fixed Rafael's email address.  Sorry about the dupe emails.

On Tue, Feb 14, 2012 at 10:33 AM, Sameer Nanda <snanda@chromium.org> wrote:
> Fixed Francois Romieu email address.
>
> On Tue, Feb 14, 2012 at 10:27 AM, Sameer Nanda <snanda@chromium.org> wrote:
>>
>> Set the WOL config registers to only enable WOL from magic packet by
>> default. Without this change in place, the WOL config register
>> settings on warm reboot come up in an inconsistent state since these
>> registers don't get reset on a warm reboot.
>>
>> Signed-off-by: Sameer Nanda <snanda@chromium.org>
>> ---
>>  drivers/net/ethernet/realtek/r8169.c |   11 ++++++-----
>>  1 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
>> index 7a0c800..a6921b7 100644
>> --- a/drivers/net/ethernet/realtek/r8169.c
>> +++ b/drivers/net/ethernet/realtek/r8169.c
>> @@ -4073,12 +4073,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>>        tp->txd_version = rtl_chip_infos[chipset].txd_version;
>>
>>        RTL_W8(Cfg9346, Cfg9346_Unlock);
>> +
>> +       /* Enable WOL from Magic Packet by default */
>>        RTL_W8(Config1, RTL_R8(Config1) | PMEnable);
>> -       RTL_W8(Config5, RTL_R8(Config5) & PMEStatus);
>> -       if ((RTL_R8(Config3) & (LinkUp | MagicPacket)) != 0)
>> -               tp->features |= RTL_FEATURE_WOL;
>> -       if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0)
>> -               tp->features |= RTL_FEATURE_WOL;
>> +       RTL_W8(Config3, MagicPacket);
>> +       RTL_W8(Config5, PMEStatus);
>> +       tp->features |= RTL_FEATURE_WOL;
>> +
>>        tp->features |= rtl_try_msi(tp, cfg);
>>        RTL_W8(Cfg9346, Cfg9346_Lock);
>>
>> --
>> 1.7.7.3
>>
>
>
>
> --
> Sameer



-- 
Sameer
_______________________________________________
linux-pm mailing list
linux-pm@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-pm

^ permalink raw reply

* Re: [PATCH 2/2] r8169: transition to D0 state at shutdown
From: Sameer Nanda @ 2012-02-14 18:37 UTC (permalink / raw)
  To: romieu, Rafael J. Wysocki, hayeswang; +Cc: netdev, linux-pm, Sameer Nanda
In-Reply-To: <CANMivWZqSNmh8BiZLi7bVw475-P-XkxPTx_eT3Lb5i87N3Krog@mail.gmail.com>

Fixed Rafael's email address.  Sorry about the dupe emails.

On Tue, Feb 14, 2012 at 10:33 AM, Sameer Nanda <snanda@chromium.org> wrote:
> Fixed Francois Romieu's email address.
>
> On Tue, Feb 14, 2012 at 10:31 AM, Sameer Nanda <snanda@chromium.org> wrote:
>> With runtime PM, if the ethernet cable is disconnected, the device is
>> transitioned to D3 state to conserve energy. If the system is shutdown
>> in this state, any register accesses in rtl_shutdown are dropped on
>> the floor.
>>
>> This patch transitions the device back to D0 state in rtl_shutdown if
>> the device was runtime PM suspended. In addition, since runtiome PM
>> also mucks around with WOL options, the saved WOL options are also
>> restored in rtl_shutdown.
>>
>> Signed-off-by: Sameer Nanda <snanda@chromium.org>
>> ---
>>  drivers/net/ethernet/realtek/r8169.c |   12 ++++++++++++
>>  1 files changed, 12 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
>> index a6921b7..4a894e6 100644
>> --- a/drivers/net/ethernet/realtek/r8169.c
>> +++ b/drivers/net/ethernet/realtek/r8169.c
>> @@ -691,6 +691,7 @@ struct rtl8169_private {
>>        u16 intr_event;
>>        u16 napi_event;
>>        u16 intr_mask;
>> +       bool runtime_suspended;
>>
>>        struct mdio_ops {
>>                void (*write)(void __iomem *, int, int);
>> @@ -4308,6 +4309,7 @@ static int rtl8169_open(struct net_device *dev)
>>        rtl_hw_start(dev);
>>
>>        tp->saved_wolopts = 0;
>> +       tp->runtime_suspended = false;
>>        pm_runtime_put_noidle(&pdev->dev);
>>
>>        rtl8169_check_link_status(dev, tp, ioaddr);
>> @@ -6106,6 +6108,7 @@ static int rtl8169_runtime_suspend(struct device *device)
>>        spin_lock_irq(&tp->lock);
>>        tp->saved_wolopts = __rtl8169_get_wol(tp);
>>        __rtl8169_set_wol(tp, WAKE_ANY);
>> +       tp->runtime_suspended = true;
>>        spin_unlock_irq(&tp->lock);
>>
>>        rtl8169_net_suspend(dev);
>> @@ -6125,6 +6128,7 @@ static int rtl8169_runtime_resume(struct device *device)
>>        spin_lock_irq(&tp->lock);
>>        __rtl8169_set_wol(tp, tp->saved_wolopts);
>>        tp->saved_wolopts = 0;
>> +       tp->runtime_suspended = false;
>>        spin_unlock_irq(&tp->lock);
>>
>>        rtl8169_init_phy(dev, tp);
>> @@ -6188,6 +6192,10 @@ static void rtl_shutdown(struct pci_dev *pdev)
>>        struct net_device *dev = pci_get_drvdata(pdev);
>>        struct rtl8169_private *tp = netdev_priv(dev);
>>
>> +       /* Get the device back to D0 state if it was runtime suspended. */
>> +       if (tp->runtime_suspended)
>> +               pci_set_power_state(pdev, PCI_D0);
>> +
>>        rtl8169_net_suspend(dev);
>>
>>        /* Restore original MAC address */
>> @@ -6195,6 +6203,10 @@ static void rtl_shutdown(struct pci_dev *pdev)
>>
>>        spin_lock_irq(&tp->lock);
>>
>> +       /* Restore WOL flags if they were messed around with. */
>> +       if (tp->saved_wolopts)
>> +               __rtl8169_set_wol(tp, tp->saved_wolopts);
>> +
>>        rtl8169_hw_reset(tp);
>>
>>        spin_unlock_irq(&tp->lock);
>> --
>> 1.7.7.3
>>
>
>
>
> --
> Sameer



-- 
Sameer

^ permalink raw reply

* Re: [PATCH 2/2] r8169: transition to D0 state at shutdown
From: Sameer Nanda @ 2012-02-14 18:33 UTC (permalink / raw)
  To: romieu, jw, hayeswang; +Cc: netdev, linux-pm, Sameer Nanda
In-Reply-To: <1329244275-28130-1-git-send-email-snanda@chromium.org>

Fixed Francois Romieu's email address.

On Tue, Feb 14, 2012 at 10:31 AM, Sameer Nanda <snanda@chromium.org> wrote:
> With runtime PM, if the ethernet cable is disconnected, the device is
> transitioned to D3 state to conserve energy. If the system is shutdown
> in this state, any register accesses in rtl_shutdown are dropped on
> the floor.
>
> This patch transitions the device back to D0 state in rtl_shutdown if
> the device was runtime PM suspended. In addition, since runtiome PM
> also mucks around with WOL options, the saved WOL options are also
> restored in rtl_shutdown.
>
> Signed-off-by: Sameer Nanda <snanda@chromium.org>
> ---
>  drivers/net/ethernet/realtek/r8169.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index a6921b7..4a894e6 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -691,6 +691,7 @@ struct rtl8169_private {
>        u16 intr_event;
>        u16 napi_event;
>        u16 intr_mask;
> +       bool runtime_suspended;
>
>        struct mdio_ops {
>                void (*write)(void __iomem *, int, int);
> @@ -4308,6 +4309,7 @@ static int rtl8169_open(struct net_device *dev)
>        rtl_hw_start(dev);
>
>        tp->saved_wolopts = 0;
> +       tp->runtime_suspended = false;
>        pm_runtime_put_noidle(&pdev->dev);
>
>        rtl8169_check_link_status(dev, tp, ioaddr);
> @@ -6106,6 +6108,7 @@ static int rtl8169_runtime_suspend(struct device *device)
>        spin_lock_irq(&tp->lock);
>        tp->saved_wolopts = __rtl8169_get_wol(tp);
>        __rtl8169_set_wol(tp, WAKE_ANY);
> +       tp->runtime_suspended = true;
>        spin_unlock_irq(&tp->lock);
>
>        rtl8169_net_suspend(dev);
> @@ -6125,6 +6128,7 @@ static int rtl8169_runtime_resume(struct device *device)
>        spin_lock_irq(&tp->lock);
>        __rtl8169_set_wol(tp, tp->saved_wolopts);
>        tp->saved_wolopts = 0;
> +       tp->runtime_suspended = false;
>        spin_unlock_irq(&tp->lock);
>
>        rtl8169_init_phy(dev, tp);
> @@ -6188,6 +6192,10 @@ static void rtl_shutdown(struct pci_dev *pdev)
>        struct net_device *dev = pci_get_drvdata(pdev);
>        struct rtl8169_private *tp = netdev_priv(dev);
>
> +       /* Get the device back to D0 state if it was runtime suspended. */
> +       if (tp->runtime_suspended)
> +               pci_set_power_state(pdev, PCI_D0);
> +
>        rtl8169_net_suspend(dev);
>
>        /* Restore original MAC address */
> @@ -6195,6 +6203,10 @@ static void rtl_shutdown(struct pci_dev *pdev)
>
>        spin_lock_irq(&tp->lock);
>
> +       /* Restore WOL flags if they were messed around with. */
> +       if (tp->saved_wolopts)
> +               __rtl8169_set_wol(tp, tp->saved_wolopts);
> +
>        rtl8169_hw_reset(tp);
>
>        spin_unlock_irq(&tp->lock);
> --
> 1.7.7.3
>



-- 
Sameer
_______________________________________________
linux-pm mailing list
linux-pm@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-pm

^ permalink raw reply

* Re: [PATCH 1/2] r8169: Enable WOL from Magic Packet by default
From: Sameer Nanda @ 2012-02-14 18:33 UTC (permalink / raw)
  To: romieu, jw, hayeswang; +Cc: netdev, linux-pm, Sameer Nanda
In-Reply-To: <1329244079-27842-1-git-send-email-snanda@chromium.org>

Fixed Francois Romieu email address.

On Tue, Feb 14, 2012 at 10:27 AM, Sameer Nanda <snanda@chromium.org> wrote:
>
> Set the WOL config registers to only enable WOL from magic packet by
> default. Without this change in place, the WOL config register
> settings on warm reboot come up in an inconsistent state since these
> registers don't get reset on a warm reboot.
>
> Signed-off-by: Sameer Nanda <snanda@chromium.org>
> ---
>  drivers/net/ethernet/realtek/r8169.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 7a0c800..a6921b7 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -4073,12 +4073,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>        tp->txd_version = rtl_chip_infos[chipset].txd_version;
>
>        RTL_W8(Cfg9346, Cfg9346_Unlock);
> +
> +       /* Enable WOL from Magic Packet by default */
>        RTL_W8(Config1, RTL_R8(Config1) | PMEnable);
> -       RTL_W8(Config5, RTL_R8(Config5) & PMEStatus);
> -       if ((RTL_R8(Config3) & (LinkUp | MagicPacket)) != 0)
> -               tp->features |= RTL_FEATURE_WOL;
> -       if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0)
> -               tp->features |= RTL_FEATURE_WOL;
> +       RTL_W8(Config3, MagicPacket);
> +       RTL_W8(Config5, PMEStatus);
> +       tp->features |= RTL_FEATURE_WOL;
> +
>        tp->features |= rtl_try_msi(tp, cfg);
>        RTL_W8(Cfg9346, Cfg9346_Lock);
>
> --
> 1.7.7.3
>



--
Sameer

^ permalink raw reply

* [PATCH 2/2] r8169: transition to D0 state at shutdown
From: Sameer Nanda @ 2012-02-14 18:31 UTC (permalink / raw)
  To: omieu, jw, hayeswang; +Cc: netdev, linux-pm, Sameer Nanda

With runtime PM, if the ethernet cable is disconnected, the device is
transitioned to D3 state to conserve energy. If the system is shutdown
in this state, any register accesses in rtl_shutdown are dropped on
the floor.

This patch transitions the device back to D0 state in rtl_shutdown if
the device was runtime PM suspended. In addition, since runtiome PM
also mucks around with WOL options, the saved WOL options are also
restored in rtl_shutdown.

Signed-off-by: Sameer Nanda <snanda@chromium.org>
---
 drivers/net/ethernet/realtek/r8169.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index a6921b7..4a894e6 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -691,6 +691,7 @@ struct rtl8169_private {
 	u16 intr_event;
 	u16 napi_event;
 	u16 intr_mask;
+	bool runtime_suspended;
 
 	struct mdio_ops {
 		void (*write)(void __iomem *, int, int);
@@ -4308,6 +4309,7 @@ static int rtl8169_open(struct net_device *dev)
 	rtl_hw_start(dev);
 
 	tp->saved_wolopts = 0;
+	tp->runtime_suspended = false;
 	pm_runtime_put_noidle(&pdev->dev);
 
 	rtl8169_check_link_status(dev, tp, ioaddr);
@@ -6106,6 +6108,7 @@ static int rtl8169_runtime_suspend(struct device *device)
 	spin_lock_irq(&tp->lock);
 	tp->saved_wolopts = __rtl8169_get_wol(tp);
 	__rtl8169_set_wol(tp, WAKE_ANY);
+	tp->runtime_suspended = true;
 	spin_unlock_irq(&tp->lock);
 
 	rtl8169_net_suspend(dev);
@@ -6125,6 +6128,7 @@ static int rtl8169_runtime_resume(struct device *device)
 	spin_lock_irq(&tp->lock);
 	__rtl8169_set_wol(tp, tp->saved_wolopts);
 	tp->saved_wolopts = 0;
+	tp->runtime_suspended = false;
 	spin_unlock_irq(&tp->lock);
 
 	rtl8169_init_phy(dev, tp);
@@ -6188,6 +6192,10 @@ static void rtl_shutdown(struct pci_dev *pdev)
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct rtl8169_private *tp = netdev_priv(dev);
 
+	/* Get the device back to D0 state if it was runtime suspended. */
+	if (tp->runtime_suspended)
+		pci_set_power_state(pdev, PCI_D0);
+
 	rtl8169_net_suspend(dev);
 
 	/* Restore original MAC address */
@@ -6195,6 +6203,10 @@ static void rtl_shutdown(struct pci_dev *pdev)
 
 	spin_lock_irq(&tp->lock);
 
+	/* Restore WOL flags if they were messed around with. */
+	if (tp->saved_wolopts)
+		__rtl8169_set_wol(tp, tp->saved_wolopts);
+
 	rtl8169_hw_reset(tp);
 
 	spin_unlock_irq(&tp->lock);
-- 
1.7.7.3

^ permalink raw reply related

* [PATCH 1/2] r8169: Enable WOL from Magic Packet by default
From: Sameer Nanda @ 2012-02-14 18:27 UTC (permalink / raw)
  To: omieu, jw, hayeswang; +Cc: netdev, linux-pm, Sameer Nanda

Set the WOL config registers to only enable WOL from magic packet by
default. Without this change in place, the WOL config register
settings on warm reboot come up in an inconsistent state since these
registers don't get reset on a warm reboot.

Signed-off-by: Sameer Nanda <snanda@chromium.org>
---
 drivers/net/ethernet/realtek/r8169.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 7a0c800..a6921b7 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4073,12 +4073,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	tp->txd_version = rtl_chip_infos[chipset].txd_version;
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
+
+	/* Enable WOL from Magic Packet by default */
 	RTL_W8(Config1, RTL_R8(Config1) | PMEnable);
-	RTL_W8(Config5, RTL_R8(Config5) & PMEStatus);
-	if ((RTL_R8(Config3) & (LinkUp | MagicPacket)) != 0)
-		tp->features |= RTL_FEATURE_WOL;
-	if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0)
-		tp->features |= RTL_FEATURE_WOL;
+	RTL_W8(Config3, MagicPacket);
+	RTL_W8(Config5, PMEStatus);
+	tp->features |= RTL_FEATURE_WOL;
+
 	tp->features |= rtl_try_msi(tp, cfg);
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 
-- 
1.7.7.3

^ permalink raw reply related

* Re: [PATCH] i2c-s3c2410: Add stub runtime power management
From: Mark Brown @ 2012-02-14  0:37 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Sylwester Nawrocki, Bill Gatliff, Wolfram Sang, Ben Dooks,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
In-Reply-To: <20120213233139.GJ2999-RazCHl0VsYgkUSuvROHNpA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1102 bytes --]

On Mon, Feb 13, 2012 at 11:31:39PM +0000, Ben Dooks wrote:
> On Sun, Jan 22, 2012 at 09:39:53PM +0000, Mark Brown wrote:

> > TBH I think most of the devices for which people are running these days
> > will be able to get some win from the system wide stuff - the WFI modes
> > aren't exactly the latest thing in hardware terms, it's just been a long
> > road to getting them supported.  Infrastructure like Mark's PM QoS work
> > and Raphael's PM domains work has really helped a lot here.

> The WFI stuff's been around for ages, and is generally just the core that
> is affected. The deep sleep options might be useful, so I don't see any
> reason not to do this. I also approve that it might allow people to shut
> down I2C units they're not using at the time to save power.

On the more recent devices they've got wider effects if you configure
the device to enter one of the lower power states on WFI - things will
break quite badly if you enter even SLEEP mode on s3c64xx right now for
example as we don't make sure things like the UARTs are quiesced enough.
The power savings are nice, though.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH] i2c-s3c2410: Add stub runtime power management
From: Ben Dooks @ 2012-02-13 23:31 UTC (permalink / raw)
  To: Mark Brown
  Cc: Sylwester Nawrocki, Bill Gatliff, Wolfram Sang, Ben Dooks,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
In-Reply-To: <20120122213952.GA29022-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>

On Sun, Jan 22, 2012 at 09:39:53PM +0000, Mark Brown wrote:
> On Sun, Jan 22, 2012 at 06:48:36PM +0100, Sylwester Nawrocki wrote:
> > On 01/22/2012 06:27 PM, Bill Gatliff wrote:
> 
> > > I for one would rather see in-kernel drivers that require it, and then
> 
> > In fact we have to deal with the opposite now, as some existing drivers
> > have been used for multiple generations of SoC, where almost unchanged
> > device IPs are deployed. Those drivers were originally written for the
> > simplest SoCs.
> 
> TBH I think most of the devices for which people are running these days
> will be able to get some win from the system wide stuff - the WFI modes
> aren't exactly the latest thing in hardware terms, it's just been a long
> road to getting them supported.  Infrastructure like Mark's PM QoS work
> and Raphael's PM domains work has really helped a lot here.

The WFI stuff's been around for ages, and is generally just the core that
is affected. The deep sleep options might be useful, so I don't see any
reason not to do this. I also approve that it might allow people to shut
down I2C units they're not using at the time to save power.

-- 
Ben

^ permalink raw reply

* Re: [PATCH] PM / QoS: unconditionally build the feature
From: Rafael J. Wysocki @ 2012-02-13 15:41 UTC (permalink / raw)
  To: Jean Pihet
  Cc: Venkatesh Pallipadi, Linux PM mailing list, Jean Pihet,
	linux-kernel, Mark Gross
In-Reply-To: <1329141059-16554-1-git-send-email-j-pihet@ti.com>

On Monday, February 13, 2012, Jean Pihet wrote:
> The PM QoS feature depends on CONFIG_PM which depends on
> PM_SLEEP || PM_RUNTIME. This breaks CPU C-states with kernels
> not having these CONFIGs.
> 
> This patch allows the feature in all cases.
> 
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> Reported-by: Venkatesh Pallipadi <venki@google.com>
> Cc: Rafael J. Wysocki <rjw@sisk.pl>
> Cc: Mark Gross <markgross@thegnar.org>

Applied, but I modified the changelog (please have a look at the
linux-pm/pm-qos branch for details).

Thanks,
Rafael


> ---
>  include/linux/pm_qos.h |   41 +----------------------------------------
>  kernel/power/Makefile  |    3 ++-
>  2 files changed, 3 insertions(+), 41 deletions(-)
> 
> diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
> index 4d99e4e..105be69 100644
> --- a/include/linux/pm_qos.h
> +++ b/include/linux/pm_qos.h
> @@ -63,7 +63,6 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
>  	return req->dev != 0;
>  }
>  
> -#ifdef CONFIG_PM
>  int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
>  			 enum pm_qos_req_action action, int value);
>  void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
> @@ -78,6 +77,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
>  int pm_qos_request_active(struct pm_qos_request *req);
>  s32 pm_qos_read_value(struct pm_qos_constraints *c);
>  
> +#ifdef CONFIG_PM
>  s32 __dev_pm_qos_read_value(struct device *dev);
>  s32 dev_pm_qos_read_value(struct device *dev);
>  int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
> @@ -95,45 +95,6 @@ void dev_pm_qos_constraints_destroy(struct device *dev);
>  int dev_pm_qos_add_ancestor_request(struct device *dev,
>  				    struct dev_pm_qos_request *req, s32 value);
>  #else
> -static inline int pm_qos_update_target(struct pm_qos_constraints *c,
> -				       struct plist_node *node,
> -				       enum pm_qos_req_action action,
> -				       int value)
> -			{ return 0; }
> -static inline void pm_qos_add_request(struct pm_qos_request *req,
> -				      int pm_qos_class, s32 value)
> -			{ return; }
> -static inline void pm_qos_update_request(struct pm_qos_request *req,
> -					 s32 new_value)
> -			{ return; }
> -static inline void pm_qos_remove_request(struct pm_qos_request *req)
> -			{ return; }
> -
> -static inline int pm_qos_request(int pm_qos_class)
> -{
> -	switch (pm_qos_class) {
> -	case PM_QOS_CPU_DMA_LATENCY:
> -		return PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE;
> -	case PM_QOS_NETWORK_LATENCY:
> -		return PM_QOS_NETWORK_LAT_DEFAULT_VALUE;
> -	case PM_QOS_NETWORK_THROUGHPUT:
> -		return PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE;
> -	default:
> -		return PM_QOS_DEFAULT_VALUE;
> -	}
> -}
> -
> -static inline int pm_qos_add_notifier(int pm_qos_class,
> -				      struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int pm_qos_remove_notifier(int pm_qos_class,
> -					 struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int pm_qos_request_active(struct pm_qos_request *req)
> -			{ return 0; }
> -static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
> -			{ return 0; }
> -
>  static inline s32 __dev_pm_qos_read_value(struct device *dev)
>  			{ return 0; }
>  static inline s32 dev_pm_qos_read_value(struct device *dev)
> diff --git a/kernel/power/Makefile b/kernel/power/Makefile
> index 07e0e28..66d808e 100644
> --- a/kernel/power/Makefile
> +++ b/kernel/power/Makefile
> @@ -1,7 +1,8 @@
>  
>  ccflags-$(CONFIG_PM_DEBUG)	:= -DDEBUG
>  
> -obj-$(CONFIG_PM)		+= main.o qos.o
> +obj-y				+= qos.o
> +obj-$(CONFIG_PM)		+= main.o
>  obj-$(CONFIG_VT_CONSOLE_SLEEP)	+= console.o
>  obj-$(CONFIG_FREEZER)		+= process.o
>  obj-$(CONFIG_SUSPEND)		+= suspend.o
> 

^ permalink raw reply

* Re: [PATCH] PM / QoS: unconditionally build the feature
From: Jean Pihet @ 2012-02-13 15:40 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Venkatesh Pallipadi, Linux PM mailing list, Jean Pihet,
	linux-kernel, Mark Gross
In-Reply-To: <201202131641.10535.rjw@sisk.pl>

Hi Rafael,

2012/2/13 Rafael J. Wysocki <rjw@sisk.pl>:
> On Monday, February 13, 2012, Jean Pihet wrote:
>> The PM QoS feature depends on CONFIG_PM which depends on
>> PM_SLEEP || PM_RUNTIME. This breaks CPU C-states with kernels
>> not having these CONFIGs.
>>
>> This patch allows the feature in all cases.
>>
>> Signed-off-by: Jean Pihet <j-pihet@ti.com>
>> Reported-by: Venkatesh Pallipadi <venki@google.com>
>> Cc: Rafael J. Wysocki <rjw@sisk.pl>
>> Cc: Mark Gross <markgross@thegnar.org>
>
> Applied, but I modified the changelog (please have a look at the
> linux-pm/pm-qos branch for details).
Ok thanks! Will look at it as soon as the changes are propagated to linux-pm.

>
> Thanks,
> Rafael
>

Jean

>
>> ---
>>  include/linux/pm_qos.h |   41 +----------------------------------------
>>  kernel/power/Makefile  |    3 ++-
>>  2 files changed, 3 insertions(+), 41 deletions(-)
>>
>> diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
>> index 4d99e4e..105be69 100644
>> --- a/include/linux/pm_qos.h
>> +++ b/include/linux/pm_qos.h
>> @@ -63,7 +63,6 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
>>       return req->dev != 0;
>>  }
>>
>> -#ifdef CONFIG_PM
>>  int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
>>                        enum pm_qos_req_action action, int value);
>>  void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
>> @@ -78,6 +77,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
>>  int pm_qos_request_active(struct pm_qos_request *req);
>>  s32 pm_qos_read_value(struct pm_qos_constraints *c);
>>
>> +#ifdef CONFIG_PM
>>  s32 __dev_pm_qos_read_value(struct device *dev);
>>  s32 dev_pm_qos_read_value(struct device *dev);
>>  int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
>> @@ -95,45 +95,6 @@ void dev_pm_qos_constraints_destroy(struct device *dev);
>>  int dev_pm_qos_add_ancestor_request(struct device *dev,
>>                                   struct dev_pm_qos_request *req, s32 value);
>>  #else
>> -static inline int pm_qos_update_target(struct pm_qos_constraints *c,
>> -                                    struct plist_node *node,
>> -                                    enum pm_qos_req_action action,
>> -                                    int value)
>> -                     { return 0; }
>> -static inline void pm_qos_add_request(struct pm_qos_request *req,
>> -                                   int pm_qos_class, s32 value)
>> -                     { return; }
>> -static inline void pm_qos_update_request(struct pm_qos_request *req,
>> -                                      s32 new_value)
>> -                     { return; }
>> -static inline void pm_qos_remove_request(struct pm_qos_request *req)
>> -                     { return; }
>> -
>> -static inline int pm_qos_request(int pm_qos_class)
>> -{
>> -     switch (pm_qos_class) {
>> -     case PM_QOS_CPU_DMA_LATENCY:
>> -             return PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE;
>> -     case PM_QOS_NETWORK_LATENCY:
>> -             return PM_QOS_NETWORK_LAT_DEFAULT_VALUE;
>> -     case PM_QOS_NETWORK_THROUGHPUT:
>> -             return PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE;
>> -     default:
>> -             return PM_QOS_DEFAULT_VALUE;
>> -     }
>> -}
>> -
>> -static inline int pm_qos_add_notifier(int pm_qos_class,
>> -                                   struct notifier_block *notifier)
>> -                     { return 0; }
>> -static inline int pm_qos_remove_notifier(int pm_qos_class,
>> -                                      struct notifier_block *notifier)
>> -                     { return 0; }
>> -static inline int pm_qos_request_active(struct pm_qos_request *req)
>> -                     { return 0; }
>> -static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
>> -                     { return 0; }
>> -
>>  static inline s32 __dev_pm_qos_read_value(struct device *dev)
>>                       { return 0; }
>>  static inline s32 dev_pm_qos_read_value(struct device *dev)
>> diff --git a/kernel/power/Makefile b/kernel/power/Makefile
>> index 07e0e28..66d808e 100644
>> --- a/kernel/power/Makefile
>> +++ b/kernel/power/Makefile
>> @@ -1,7 +1,8 @@
>>
>>  ccflags-$(CONFIG_PM_DEBUG)   := -DDEBUG
>>
>> -obj-$(CONFIG_PM)             += main.o qos.o
>> +obj-y                                += qos.o
>> +obj-$(CONFIG_PM)             += main.o
>>  obj-$(CONFIG_VT_CONSOLE_SLEEP)       += console.o
>>  obj-$(CONFIG_FREEZER)                += process.o
>>  obj-$(CONFIG_SUSPEND)                += suspend.o
>>
>

^ permalink raw reply

* [PATCH] PM / QoS: unconditionally build the feature
From: Jean Pihet @ 2012-02-13 13:50 UTC (permalink / raw)
  To: Linux PM mailing list, linux-kernel, Rafael J. Wysocki,
	Mark Gross, Venkatesh Pallipadi
  Cc: Jean Pihet
In-Reply-To: <1328603646-2714-2-git-send-email-j-pihet@ti.com>

The PM QoS feature depends on CONFIG_PM which depends on
PM_SLEEP || PM_RUNTIME. This breaks CPU C-states with kernels
not having these CONFIGs.

This patch allows the feature in all cases.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reported-by: Venkatesh Pallipadi <venki@google.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Mark Gross <markgross@thegnar.org>
---
 include/linux/pm_qos.h |   41 +----------------------------------------
 kernel/power/Makefile  |    3 ++-
 2 files changed, 3 insertions(+), 41 deletions(-)

diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index 4d99e4e..105be69 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -63,7 +63,6 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
 	return req->dev != 0;
 }
 
-#ifdef CONFIG_PM
 int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
 			 enum pm_qos_req_action action, int value);
 void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
@@ -78,6 +77,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
 int pm_qos_request_active(struct pm_qos_request *req);
 s32 pm_qos_read_value(struct pm_qos_constraints *c);
 
+#ifdef CONFIG_PM
 s32 __dev_pm_qos_read_value(struct device *dev);
 s32 dev_pm_qos_read_value(struct device *dev);
 int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
@@ -95,45 +95,6 @@ void dev_pm_qos_constraints_destroy(struct device *dev);
 int dev_pm_qos_add_ancestor_request(struct device *dev,
 				    struct dev_pm_qos_request *req, s32 value);
 #else
-static inline int pm_qos_update_target(struct pm_qos_constraints *c,
-				       struct plist_node *node,
-				       enum pm_qos_req_action action,
-				       int value)
-			{ return 0; }
-static inline void pm_qos_add_request(struct pm_qos_request *req,
-				      int pm_qos_class, s32 value)
-			{ return; }
-static inline void pm_qos_update_request(struct pm_qos_request *req,
-					 s32 new_value)
-			{ return; }
-static inline void pm_qos_remove_request(struct pm_qos_request *req)
-			{ return; }
-
-static inline int pm_qos_request(int pm_qos_class)
-{
-	switch (pm_qos_class) {
-	case PM_QOS_CPU_DMA_LATENCY:
-		return PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE;
-	case PM_QOS_NETWORK_LATENCY:
-		return PM_QOS_NETWORK_LAT_DEFAULT_VALUE;
-	case PM_QOS_NETWORK_THROUGHPUT:
-		return PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE;
-	default:
-		return PM_QOS_DEFAULT_VALUE;
-	}
-}
-
-static inline int pm_qos_add_notifier(int pm_qos_class,
-				      struct notifier_block *notifier)
-			{ return 0; }
-static inline int pm_qos_remove_notifier(int pm_qos_class,
-					 struct notifier_block *notifier)
-			{ return 0; }
-static inline int pm_qos_request_active(struct pm_qos_request *req)
-			{ return 0; }
-static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
-			{ return 0; }
-
 static inline s32 __dev_pm_qos_read_value(struct device *dev)
 			{ return 0; }
 static inline s32 dev_pm_qos_read_value(struct device *dev)
diff --git a/kernel/power/Makefile b/kernel/power/Makefile
index 07e0e28..66d808e 100644
--- a/kernel/power/Makefile
+++ b/kernel/power/Makefile
@@ -1,7 +1,8 @@
 
 ccflags-$(CONFIG_PM_DEBUG)	:= -DDEBUG
 
-obj-$(CONFIG_PM)		+= main.o qos.o
+obj-y				+= qos.o
+obj-$(CONFIG_PM)		+= main.o
 obj-$(CONFIG_VT_CONSOLE_SLEEP)	+= console.o
 obj-$(CONFIG_FREEZER)		+= process.o
 obj-$(CONFIG_SUSPEND)		+= suspend.o
-- 
1.7.5.4

^ permalink raw reply related

* Re: [PATCH 1/2] PM / QoS: unconditionally build the feature
From: Rafael J. Wysocki @ 2012-02-12 21:37 UTC (permalink / raw)
  To: Jean Pihet
  Cc: Venkatesh Pallipadi, Linux PM mailing list, Jean Pihet,
	linux-kernel, Mark Gross
In-Reply-To: <1328603646-2714-2-git-send-email-j-pihet@ti.com>

On Tuesday, February 07, 2012, Jean Pihet wrote:
> The PM QoS feature depends on CONFIG_PM which depends on
> PM_SLEEP || PM_RUNTIME. This breaks CPU C-states with kernels
> not having these CONFIGs.
> 
> This patch allows the feature in all cases.

Since the Venki's patch has been merged in the meantime, can you please
rebase this on top of the current Linus' tree?

Rafael


> Reported-by: Venkatesh Pallipadi <venki@google.com>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> Cc: Rafael J. Wysocki <rjw@sisk.pl>
> Cc: Mark Gross <markgross@thegnar.org>
> ---
>  include/linux/pm_qos.h |   29 +----------------------------
>  kernel/power/Makefile  |    3 ++-
>  2 files changed, 3 insertions(+), 29 deletions(-)
> 
> diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
> index e5bbcba..105be69 100644
> --- a/include/linux/pm_qos.h
> +++ b/include/linux/pm_qos.h
> @@ -63,7 +63,6 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
>  	return req->dev != 0;
>  }
>  
> -#ifdef CONFIG_PM
>  int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
>  			 enum pm_qos_req_action action, int value);
>  void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
> @@ -78,6 +77,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
>  int pm_qos_request_active(struct pm_qos_request *req);
>  s32 pm_qos_read_value(struct pm_qos_constraints *c);
>  
> +#ifdef CONFIG_PM
>  s32 __dev_pm_qos_read_value(struct device *dev);
>  s32 dev_pm_qos_read_value(struct device *dev);
>  int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
> @@ -95,33 +95,6 @@ void dev_pm_qos_constraints_destroy(struct device *dev);
>  int dev_pm_qos_add_ancestor_request(struct device *dev,
>  				    struct dev_pm_qos_request *req, s32 value);
>  #else
> -static inline int pm_qos_update_target(struct pm_qos_constraints *c,
> -				       struct plist_node *node,
> -				       enum pm_qos_req_action action,
> -				       int value)
> -			{ return 0; }
> -static inline void pm_qos_add_request(struct pm_qos_request *req,
> -				      int pm_qos_class, s32 value)
> -			{ return; }
> -static inline void pm_qos_update_request(struct pm_qos_request *req,
> -					 s32 new_value)
> -			{ return; }
> -static inline void pm_qos_remove_request(struct pm_qos_request *req)
> -			{ return; }
> -
> -static inline int pm_qos_request(int pm_qos_class)
> -			{ return 0; }
> -static inline int pm_qos_add_notifier(int pm_qos_class,
> -				      struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int pm_qos_remove_notifier(int pm_qos_class,
> -					 struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int pm_qos_request_active(struct pm_qos_request *req)
> -			{ return 0; }
> -static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
> -			{ return 0; }
> -
>  static inline s32 __dev_pm_qos_read_value(struct device *dev)
>  			{ return 0; }
>  static inline s32 dev_pm_qos_read_value(struct device *dev)
> diff --git a/kernel/power/Makefile b/kernel/power/Makefile
> index 07e0e28..66d808e 100644
> --- a/kernel/power/Makefile
> +++ b/kernel/power/Makefile
> @@ -1,7 +1,8 @@
>  
>  ccflags-$(CONFIG_PM_DEBUG)	:= -DDEBUG
>  
> -obj-$(CONFIG_PM)		+= main.o qos.o
> +obj-y				+= qos.o
> +obj-$(CONFIG_PM)		+= main.o
>  obj-$(CONFIG_VT_CONSOLE_SLEEP)	+= console.o
>  obj-$(CONFIG_FREEZER)		+= process.o
>  obj-$(CONFIG_SUSPEND)		+= suspend.o
> 

^ permalink raw reply

* Re: [PATCH 2/2] PM / QoS: unconditionally build the per-device constraints feature
From: Rafael J. Wysocki @ 2012-02-12 21:27 UTC (permalink / raw)
  To: markgross
  Cc: Venkatesh Pallipadi, Linux PM mailing list, Jean Pihet,
	linux-kernel
In-Reply-To: <20120212020757.GF18742@gs62>

On Sunday, February 12, 2012, mark gross wrote:
> why are these two patches?
> 
> I think you could squash them into one and it would be just fine.

Well, what sense does _device_ PM QoS make without CONFIG_PM?

Rafael


> On Tue, Feb 07, 2012 at 09:34:06AM +0100, Jean Pihet wrote:
> > The per-device PM QoS feature depends on CONFIG_PM which depends
> > on PM_SLEEP || PM_RUNTIME. This breaks CPU C-states with kernels
> > not having these CONFIGs.
> > 
> > This patch allows the feature in all cases.
> > 
> > Signed-off-by: Jean Pihet <j-pihet@ti.com>
> > Cc: Rafael J. Wysocki <rjw@sisk.pl>
> > Cc: Mark Gross <markgross@thegnar.org>
> > ---
> >  drivers/base/power/Makefile |    3 ++-
> >  include/linux/pm_qos.h      |   39 ---------------------------------------
> >  2 files changed, 2 insertions(+), 40 deletions(-)
> > 
> > diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
> > index 2e58ebb..312eb65 100644
> > --- a/drivers/base/power/Makefile
> > +++ b/drivers/base/power/Makefile
> > @@ -1,4 +1,5 @@
> > -obj-$(CONFIG_PM)	+= sysfs.o generic_ops.o common.o qos.o
> > +obj-y			+= qos.o
> > +obj-$(CONFIG_PM)	+= sysfs.o generic_ops.o common.o
> >  obj-$(CONFIG_PM_SLEEP)	+= main.o wakeup.o
> >  obj-$(CONFIG_PM_RUNTIME)	+= runtime.o
> >  obj-$(CONFIG_PM_TRACE_RTC)	+= trace.o
> > diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
> > index 105be69..37b017a 100644
> > --- a/include/linux/pm_qos.h
> > +++ b/include/linux/pm_qos.h
> > @@ -77,7 +77,6 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
> >  int pm_qos_request_active(struct pm_qos_request *req);
> >  s32 pm_qos_read_value(struct pm_qos_constraints *c);
> >  
> > -#ifdef CONFIG_PM
> >  s32 __dev_pm_qos_read_value(struct device *dev);
> >  s32 dev_pm_qos_read_value(struct device *dev);
> >  int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
> > @@ -94,43 +93,5 @@ void dev_pm_qos_constraints_init(struct device *dev);
> >  void dev_pm_qos_constraints_destroy(struct device *dev);
> >  int dev_pm_qos_add_ancestor_request(struct device *dev,
> >  				    struct dev_pm_qos_request *req, s32 value);
> > -#else
> > -static inline s32 __dev_pm_qos_read_value(struct device *dev)
> > -			{ return 0; }
> > -static inline s32 dev_pm_qos_read_value(struct device *dev)
> > -			{ return 0; }
> > -static inline int dev_pm_qos_add_request(struct device *dev,
> > -					 struct dev_pm_qos_request *req,
> > -					 s32 value)
> > -			{ return 0; }
> > -static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
> > -					    s32 new_value)
> > -			{ return 0; }
> > -static inline int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
> > -			{ return 0; }
> > -static inline int dev_pm_qos_add_notifier(struct device *dev,
> > -					  struct notifier_block *notifier)
> > -			{ return 0; }
> > -static inline int dev_pm_qos_remove_notifier(struct device *dev,
> > -					     struct notifier_block *notifier)
> > -			{ return 0; }
> > -static inline int dev_pm_qos_add_global_notifier(
> > -					struct notifier_block *notifier)
> > -			{ return 0; }
> > -static inline int dev_pm_qos_remove_global_notifier(
> > -					struct notifier_block *notifier)
> > -			{ return 0; }
> > -static inline void dev_pm_qos_constraints_init(struct device *dev)
> > -{
> > -	dev->power.power_state = PMSG_ON;
> > -}
> > -static inline void dev_pm_qos_constraints_destroy(struct device *dev)
> > -{
> > -	dev->power.power_state = PMSG_INVALID;
> > -}
> > -static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
> > -				    struct dev_pm_qos_request *req, s32 value)
> > -			{ return 0; }
> > -#endif
> >  
> >  #endif
> 
> 

^ permalink raw reply

* Re: [PATCH 2/2] PM / QoS: unconditionally build the per-device constraints feature
From: mark gross @ 2012-02-12  2:07 UTC (permalink / raw)
  To: Jean Pihet
  Cc: Venkatesh Pallipadi, Mark Gross, linux-kernel,
	Linux PM mailing list, Jean Pihet
In-Reply-To: <1328603646-2714-3-git-send-email-j-pihet@ti.com>

why are these two patches?

I think you could squash them into one and it would be just fine.

--mark

On Tue, Feb 07, 2012 at 09:34:06AM +0100, Jean Pihet wrote:
> The per-device PM QoS feature depends on CONFIG_PM which depends
> on PM_SLEEP || PM_RUNTIME. This breaks CPU C-states with kernels
> not having these CONFIGs.
> 
> This patch allows the feature in all cases.
> 
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> Cc: Rafael J. Wysocki <rjw@sisk.pl>
> Cc: Mark Gross <markgross@thegnar.org>
> ---
>  drivers/base/power/Makefile |    3 ++-
>  include/linux/pm_qos.h      |   39 ---------------------------------------
>  2 files changed, 2 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/base/power/Makefile b/drivers/base/power/Makefile
> index 2e58ebb..312eb65 100644
> --- a/drivers/base/power/Makefile
> +++ b/drivers/base/power/Makefile
> @@ -1,4 +1,5 @@
> -obj-$(CONFIG_PM)	+= sysfs.o generic_ops.o common.o qos.o
> +obj-y			+= qos.o
> +obj-$(CONFIG_PM)	+= sysfs.o generic_ops.o common.o
>  obj-$(CONFIG_PM_SLEEP)	+= main.o wakeup.o
>  obj-$(CONFIG_PM_RUNTIME)	+= runtime.o
>  obj-$(CONFIG_PM_TRACE_RTC)	+= trace.o
> diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
> index 105be69..37b017a 100644
> --- a/include/linux/pm_qos.h
> +++ b/include/linux/pm_qos.h
> @@ -77,7 +77,6 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
>  int pm_qos_request_active(struct pm_qos_request *req);
>  s32 pm_qos_read_value(struct pm_qos_constraints *c);
>  
> -#ifdef CONFIG_PM
>  s32 __dev_pm_qos_read_value(struct device *dev);
>  s32 dev_pm_qos_read_value(struct device *dev);
>  int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
> @@ -94,43 +93,5 @@ void dev_pm_qos_constraints_init(struct device *dev);
>  void dev_pm_qos_constraints_destroy(struct device *dev);
>  int dev_pm_qos_add_ancestor_request(struct device *dev,
>  				    struct dev_pm_qos_request *req, s32 value);
> -#else
> -static inline s32 __dev_pm_qos_read_value(struct device *dev)
> -			{ return 0; }
> -static inline s32 dev_pm_qos_read_value(struct device *dev)
> -			{ return 0; }
> -static inline int dev_pm_qos_add_request(struct device *dev,
> -					 struct dev_pm_qos_request *req,
> -					 s32 value)
> -			{ return 0; }
> -static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
> -					    s32 new_value)
> -			{ return 0; }
> -static inline int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
> -			{ return 0; }
> -static inline int dev_pm_qos_add_notifier(struct device *dev,
> -					  struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int dev_pm_qos_remove_notifier(struct device *dev,
> -					     struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int dev_pm_qos_add_global_notifier(
> -					struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int dev_pm_qos_remove_global_notifier(
> -					struct notifier_block *notifier)
> -			{ return 0; }
> -static inline void dev_pm_qos_constraints_init(struct device *dev)
> -{
> -	dev->power.power_state = PMSG_ON;
> -}
> -static inline void dev_pm_qos_constraints_destroy(struct device *dev)
> -{
> -	dev->power.power_state = PMSG_INVALID;
> -}
> -static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
> -				    struct dev_pm_qos_request *req, s32 value)
> -			{ return 0; }
> -#endif
>  
>  #endif
> -- 
> 1.7.5.4
> 

^ permalink raw reply

* Re: [PATCH 1/2] PM / QoS: unconditionally build the feature
From: mark gross @ 2012-02-12  2:06 UTC (permalink / raw)
  To: Jean Pihet
  Cc: Venkatesh Pallipadi, Mark Gross, linux-kernel,
	Linux PM mailing list, Jean Pihet
In-Reply-To: <1328603646-2714-2-git-send-email-j-pihet@ti.com>

acked-by <markgross@thegnar.org>

On Tue, Feb 07, 2012 at 09:34:05AM +0100, Jean Pihet wrote:
> The PM QoS feature depends on CONFIG_PM which depends on
> PM_SLEEP || PM_RUNTIME. This breaks CPU C-states with kernels
> not having these CONFIGs.
> 
> This patch allows the feature in all cases.
> 
> Reported-by: Venkatesh Pallipadi <venki@google.com>
> Signed-off-by: Jean Pihet <j-pihet@ti.com>
> Cc: Rafael J. Wysocki <rjw@sisk.pl>
> Cc: Mark Gross <markgross@thegnar.org>
> ---
>  include/linux/pm_qos.h |   29 +----------------------------
>  kernel/power/Makefile  |    3 ++-
>  2 files changed, 3 insertions(+), 29 deletions(-)
> 
> diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
> index e5bbcba..105be69 100644
> --- a/include/linux/pm_qos.h
> +++ b/include/linux/pm_qos.h
> @@ -63,7 +63,6 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
>  	return req->dev != 0;
>  }
>  
> -#ifdef CONFIG_PM
>  int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
>  			 enum pm_qos_req_action action, int value);
>  void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
> @@ -78,6 +77,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
>  int pm_qos_request_active(struct pm_qos_request *req);
>  s32 pm_qos_read_value(struct pm_qos_constraints *c);
>  
> +#ifdef CONFIG_PM
>  s32 __dev_pm_qos_read_value(struct device *dev);
>  s32 dev_pm_qos_read_value(struct device *dev);
>  int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
> @@ -95,33 +95,6 @@ void dev_pm_qos_constraints_destroy(struct device *dev);
>  int dev_pm_qos_add_ancestor_request(struct device *dev,
>  				    struct dev_pm_qos_request *req, s32 value);
>  #else
> -static inline int pm_qos_update_target(struct pm_qos_constraints *c,
> -				       struct plist_node *node,
> -				       enum pm_qos_req_action action,
> -				       int value)
> -			{ return 0; }
> -static inline void pm_qos_add_request(struct pm_qos_request *req,
> -				      int pm_qos_class, s32 value)
> -			{ return; }
> -static inline void pm_qos_update_request(struct pm_qos_request *req,
> -					 s32 new_value)
> -			{ return; }
> -static inline void pm_qos_remove_request(struct pm_qos_request *req)
> -			{ return; }
> -
> -static inline int pm_qos_request(int pm_qos_class)
> -			{ return 0; }
> -static inline int pm_qos_add_notifier(int pm_qos_class,
> -				      struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int pm_qos_remove_notifier(int pm_qos_class,
> -					 struct notifier_block *notifier)
> -			{ return 0; }
> -static inline int pm_qos_request_active(struct pm_qos_request *req)
> -			{ return 0; }
> -static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
> -			{ return 0; }
> -
>  static inline s32 __dev_pm_qos_read_value(struct device *dev)
>  			{ return 0; }
>  static inline s32 dev_pm_qos_read_value(struct device *dev)
> diff --git a/kernel/power/Makefile b/kernel/power/Makefile
> index 07e0e28..66d808e 100644
> --- a/kernel/power/Makefile
> +++ b/kernel/power/Makefile
> @@ -1,7 +1,8 @@
>  
>  ccflags-$(CONFIG_PM_DEBUG)	:= -DDEBUG
>  
> -obj-$(CONFIG_PM)		+= main.o qos.o
> +obj-y				+= qos.o
> +obj-$(CONFIG_PM)		+= main.o
>  obj-$(CONFIG_VT_CONSOLE_SLEEP)	+= console.o
>  obj-$(CONFIG_FREEZER)		+= process.o
>  obj-$(CONFIG_SUSPEND)		+= suspend.o
> -- 
> 1.7.5.4
> 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox