public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Greg KH <gregkh@suse.de>, Jesse Barnes <jbarnes@virtuousgeek.org>,
	mingo@redhat.com, Avi Kivity <avi@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Kay Sievers <kay.sievers@suse.de>,
	Linux PM mailing list <linux-pm@lists.linux-foundation.org>,
	tglx@linutronix.de
Subject: [PATCH 0/8] Allow subsystems to avoid using sysdevs for defining "core" PM callbacks
Date: Sat, 12 Mar 2011 22:12:40 +0100	[thread overview]
Message-ID: <201103122212.40828.rjw@sisk.pl> (raw)
In-Reply-To: <201103100131.58206.rjw@sisk.pl>

Hi,

On Thursday, March 10, 2011, Rafael J. Wysocki wrote:
> There are multiple problems with sysdevs, or struct sys_device objects to
> be precise, that are so annoying that some people have started to think
> of removind them entirely from the kernel.  To me, personally, the most
> obvious issue is the way sysdevs are used for defining suspend/resume
> callbacks to be executed with one CPU on-line and interrupts disabled.
> Greg and Kay may tell you more about the other problems with sysdevs. :-)
> 
> Some subsystems need to carry out certain operations during suspend after
> we've disabled non-boot CPUs and interrupts have been switched off on the
> only on-line one.  Currently, the only way to achieve that is to define
> sysdev suspend/resume callbacks, but this is cumbersome and inefficient.
> Namely, to do that, one has to define a sysdev class providing the callbacks
> and a sysdev actually using them, which is excessively complicated.  Moreover,
> the sysdev suspend/resume callbacks take arguments that are not really used
> by the majority of subsystems defining sysdev suspend/resume callbacks
> (or even if they are used, they don't really _need_ to be used, so they
> are simply unnecessary).  Of course, if a sysdev is only defined to provide
> suspend/resume (and maybe shutdown) callbacks, there's no real reason why
> it should show up in sysfs.
> 
> For this reason, I thought it would be a good idea to provide a simpler
> interface for subsystems to define "very late" suspend callbacks and
> "very early" resume callbacks (and "very late" shutdown callbacks as well)
> without the entire bloat related to sysdevs.  The interface is introduced
> by the first of the following patches, while the second patch converts some
> sysdev users related to the x86 architecture to using the new interface.
> 
> I believe that call sysdev users who need to define suspend/resume/shutdown
> callbacks may be converted to using the interface provided by the first patch,
> which in turn should allow us to convert the remaining sysdev functionality
> into "normal" struct device interfaces.  Still, even if that turns out to be
> too complicated, the bloat reduction resulting from the second patch kind of
> shows that moving at least some sysdev users to a simpler interface (like in
> the first patch) is a good idea anyway.
> 
> This is a proof of concept, so the patches have not been tested.  Please be
> extrememly careful, because they touch sensitive code, so to speak.  In the
> majority of cases the changes are rather straightforward, but there are some
> more interesting cases as well (io_apic.c most importantly).

Since Greg likes the idea and there haven't been any objections so far, here's
the official submission.  The patches have been tested on HP nx6325 and
Toshiba Portege R500.

Patch [1/8] is regareded as 2.6.38 material, following Greg's advice.  The
other patches in the set are regarded as 2.6.39 material.  The last one
obviously depends on all of the previous ones.

[1/8] - Introduce struct syscore_ops for registering operations to be run on
        one CPU during suspend/resume/shutdown.

[2/8] - Convert sysdev users in arch/x86 to using struct syscore_ops.

[3/8] - Make ACPI use struct syscore_ops for irqrouter_resume().

[4/8] - Make timekeeping use struct syscore_ops for suspend/resume.

[5/8] - Make Intel IOMMU use struct syscore_ops for suspend/resume.

[6/8] - Make KVM use struct syscore_ops for suspend/resume.

[7/8] - Make cpufreq use struct syscore_ops for boot CPU suspend/resume.

[8/8] - Introduce config switch allowing architectures to skip sysdev
        suspend/resume/shutdown code.

If there are no objectsions, I'd like to push these patches through the suspend
tree.

Thanks,
Rafael

  parent reply	other threads:[~2011-03-12 21:12 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201103100131.58206.rjw@sisk.pl>
2011-03-10  0:33 ` [RFC][PATCH 1/2] Introduce struct syscore_ops and related functionality Rafael J. Wysocki
2011-03-10  0:34 ` [RFC][PATCH 2/2] Convert several sysdev users to using struct syscore_ops Rafael J. Wysocki
2011-03-10 13:05 ` [RFC][PATCH 0/2] Allow subsystems to avoid using sysdevs for defining "core" PM callbacks Kay Sievers
     [not found] ` <1299762315.1875.14.camel@zag>
2011-03-10 19:04   ` Rafael J. Wysocki
     [not found] ` <201103100134.02675.rjw@sisk.pl>
2011-03-11 17:12   ` [RFC][PATCH 2/2] Convert several sysdev users to using struct syscore_ops Greg KH
     [not found]   ` <20110311171231.GB10437@suse.de>
2011-03-11 20:29     ` Rafael J. Wysocki
     [not found]     ` <201103112129.24876.rjw@sisk.pl>
2011-03-11 20:33       ` Greg KH
     [not found]       ` <20110311203305.GA21045@suse.de>
2011-03-11 20:45         ` Rafael J. Wysocki
2011-03-12 21:12 ` Rafael J. Wysocki [this message]
2011-03-12 21:13   ` [PATCH 1/8] PM / Core: Introcude " Rafael J. Wysocki
2011-03-12 21:15   ` [PATCH 2/8] x86: Use syscore_ops instead of sysdev classes and sysdevs Rafael J. Wysocki
2011-03-12 21:16   ` [PATCH 3/8] ACPI: Use syscore_ops instead of sysdev class and sysdev Rafael J. Wysocki
2011-03-12 21:17   ` [PATCH 4/8] timekeeping: " Rafael J. Wysocki
2011-03-12 21:18   ` [PATCH 5/8] PCI / Intel IOMMU: " Rafael J. Wysocki
2011-03-12 21:18   ` [PATCH 6/8] KVM: " Rafael J. Wysocki
2011-03-12 21:20   ` [PATCH 7/8] cpufreq: Use syscore_ops for boot CPU suspend/resume Rafael J. Wysocki
2011-03-12 21:21   ` [PATCH 8/8] Introduce ARCH_NO_SYSDEV_OPS config option Rafael J. Wysocki
2011-03-13 13:02   ` [PATCH 9-10/10] Allow subsystems to avoid using sysdevs for defining "core" PM callbacks Rafael J. Wysocki
     [not found]   ` <201103131402.48129.rjw@sisk.pl>
2011-03-13 13:03     ` [PATCH 9/10] sh: Use struct syscore_ops instead of sysdev class and sysdev R. J. Wysocki
2011-03-13 13:04     ` [PATCH 10/10] ARM: Use struct syscore_ops instead of sysdevs for PM in timer and leds Rafael J. Wysocki
     [not found]     ` <201103131404.33311.rjw@sisk.pl>
2011-03-14  9:06       ` Stephen Boyd
     [not found]       ` <4D7DDA9C.9020700@codeaurora.org>
2011-03-14 19:54         ` [Update] " Rafael J. Wysocki
     [not found]     ` <201103131403.49561.rwys@fuw.edu.pl>
2011-03-17  8:20       ` [PATCH 9/10] sh: Use struct syscore_ops instead of sysdev class and sysdev Paul Mundt
     [not found]       ` <20110317082016.GB13315@linux-sh.org>
2011-03-19  0:47         ` Rafael J. Wysocki
     [not found]         ` <201103190147.28001.rjw@sisk.pl>
2011-03-22 14:04           ` Paul Mundt
     [not found]           ` <20110322140420.GA24004@linux-sh.org>
2011-03-22 14:19             ` Kay Sievers
2011-03-22 20:19             ` Rafael J. Wysocki
     [not found]             ` <1300803596.1456.10.camel@zag>
2011-03-22 20:30               ` Rafael J. Wysocki
     [not found]               ` <201103222130.46603.rjw@sisk.pl>
2011-03-22 20:39                 ` Kay Sievers
     [not found]                 ` <1300826390.1815.5.camel@zag>
2011-03-22 21:00                   ` Rafael J. Wysocki
     [not found]                   ` <201103222200.52131.rjw@sisk.pl>
2011-03-22 21:12                     ` Kay Sievers
     [not found]                     ` <1300828356.1815.15.camel@zag>
2011-03-22 21:49                       ` Paul Mundt
     [not found]                       ` <20110322214922.GA7503@linux-sh.org>
2011-03-22 22:00                         ` Kay Sievers
     [not found]                         ` <1300831256.1815.22.camel@zag>
2011-03-22 22:23                           ` Rafael J. Wysocki
2011-03-22 22:23                           ` Paul Mundt
     [not found]                           ` <201103222323.42627.rjw@sisk.pl>
2011-03-22 22:44                             ` Kay Sievers
     [not found]                             ` <1300833843.1815.53.camel@zag>
2011-03-22 23:32                               ` Rafael J. Wysocki
     [not found]                               ` <201103230032.37417.rjw@sisk.pl>
2011-03-22 23:46                                 ` Kay Sievers
     [not found]                                 ` <1300837589.1424.10.camel@zag>
2011-03-22 23:50                                   ` Rafael J. Wysocki
2011-03-23  9:45                               ` Russell King - ARM Linux
     [not found]                           ` <20110322222347.GA3978@linux-sh.org>
2011-03-23 11:12                             ` Mark Brown
     [not found]                             ` <20110323111220.GB27671@sirena.org.uk>
2011-03-23 11:28                               ` Paul Mundt
2011-03-22 22:05                       ` Rafael J. Wysocki
     [not found]                       ` <201103222305.01808.rjw@sisk.pl>
2011-03-22 22:20                         ` Kay Sievers
     [not found]                         ` <1300832411.1815.35.camel@zag>
2011-03-22 22:42                           ` Rafael J. Wysocki
     [not found]                           ` <201103222342.20526.rjw@sisk.pl>
2011-03-22 22:56                             ` Kay Sievers
2011-03-22 23:05                         ` Kay Sievers
     [not found]                         ` <1300835111.1815.69.camel@zag>
2011-03-22 23:47                           ` Rafael J. Wysocki
     [not found]             ` <201103222119.28328.rjw@sisk.pl>
2011-03-23  9:59               ` Paul Mundt
     [not found]               ` <20110323095920.GA6008@linux-sh.org>
2011-03-23 20:39                 ` Rafael J. Wysocki
     [not found]   ` <201103122221.37295.rjw@sisk.pl>
2011-03-13 13:55     ` [PATCH 8/8] Introduce ARCH_NO_SYSDEV_OPS config option Thomas Gleixner
2011-03-13 15:30       ` [Update] " Rafael J. Wysocki
     [not found]   ` <201103122217.34004.rjw@sisk.pl>
2011-03-13 13:56     ` [PATCH 4/8] timekeeping: Use syscore_ops instead of sysdev class and sysdev Thomas Gleixner
     [not found]     ` <alpine.LFD.2.00.1103131455320.2787@localhost6.localdomain6>
2011-03-13 15:08       ` Rafael J. Wysocki
     [not found]   ` <201103122215.48206.rjw@sisk.pl>
2011-03-13 14:23     ` [PATCH 2/8] x86: Use syscore_ops instead of sysdev classes and sysdevs Thomas Gleixner
     [not found]     ` <alpine.LFD.2.00.1103131500340.2787@localhost6.localdomain6>
2011-03-13 15:07       ` Rafael J. Wysocki
     [not found]   ` <201103122220.30173.rjw@sisk.pl>
2011-03-15 21:43     ` [Update, v2] Re: [PATCH 7/8] cpufreq: Use syscore_ops for boot CPU suspend/resume Rafael J. Wysocki
     [not found]   ` <201103122216.51858.rjw@sisk.pl>
2011-03-18 21:38     ` [PATCH 3/8] ACPI: Use syscore_ops instead of sysdev class and sysdev Len Brown
2011-03-21 23:31   ` [PATCH 0/6] Do not use sysdevs for implementing "core" PM operations on x86 Rafael J. Wysocki
     [not found]   ` <201103220031.22729.rjw@sisk.pl>
2011-03-21 23:34     ` [PATCH 1/6] x86: Use syscore_ops instead of sysdev classes and sysdevs Rafael J. Wysocki
2011-03-21 23:35     ` [PATCH 2/6] timekeeping: Use syscore_ops instead of sysdev class and sysdev Rafael J. Wysocki
2011-03-21 23:36     ` [PATCH 3/6] PCI / Intel IOMMU: " Rafael J. Wysocki
2011-03-21 23:37     ` [PATCH 4/6] KVM: " Rafael J. Wysocki
2011-03-21 23:38     ` [PATCH 5/6] cpufreq: Use syscore_ops for boot CPU suspend/resume (v2) Rafael J. Wysocki
2011-03-21 23:38     ` [PATCH 6/6] Introduce ARCH_NO_SYSDEV_OPS config option (v2) Rafael J. Wysocki
     [not found]     ` <201103220037.06465.rjw@sisk.pl>
2011-03-22  9:18       ` [PATCH 4/6] KVM: Use syscore_ops instead of sysdev class and sysdev Avi Kivity
2011-03-22 10:32     ` [PATCH 0/6] Do not use sysdevs for implementing "core" PM operations on x86 Ingo Molnar
     [not found]     ` <201103220036.17824.rjw@sisk.pl>
2011-03-22 10:57       ` [PATCH 3/6] PCI / Intel IOMMU: Use syscore_ops instead of sysdev class and sysdev Joerg Roedel
     [not found]       ` <20110322105738.GC20444@amd.com>
2011-03-22 22:07         ` Rafael J. Wysocki
     [not found]         ` <201103222307.21983.rjw@sisk.pl>
2011-03-23  7:48           ` Roedel, Joerg
     [not found]     ` <20110322103258.GC4448@elte.hu>
2011-03-22 20:33       ` [PATCH 0/6] Do not use sysdevs for implementing "core" PM operations on x86 Rafael J. Wysocki
     [not found]       ` <201103222133.14054.rjw@sisk.pl>
2011-03-25 22:51         ` [GIT PULL] More power management updates for 2.6.39 Rafael J. Wysocki
     [not found]   ` <201103122218.14832.rjw@sisk.pl>
2011-06-02 17:30     ` [PATCH 5/8] PCI / Intel IOMMU: Use syscore_ops instead of sysdev class and sysdev Tony Luck
     [not found]     ` <BANLkTi=xhg7_0O-aVC8s1Uyo4Wkz5OTCdg@mail.gmail.com>
2011-06-06 17:57       ` Rafael J. Wysocki
     [not found]       ` <201106061957.35413.rjw@sisk.pl>
2011-06-06 17:58         ` Luck, Tony

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=201103122212.40828.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=avi@redhat.com \
    --cc=gregkh@suse.de \
    --cc=hpa@zytor.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kay.sievers@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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