From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:16:06
Hi,
The following series of patches fixes bugs related to the introduction
of struct syscore_ops later in this cycle, replaces sysdev suspend/resume
operations in all of the architectures still using them with struct
syscore_ops-based PM callbacks and finally removes the suspend/resume
and shutdown operations from struct sysdev_class and struct sysdev_driver.
Patches [1/14] and [2/14] are important bug fixes targeted at 2.6.39.
The remaining patches are regareded as 2.6.40 material, but I'd like to
put them into linux-next shortly, if there are no objections, to catch
problems that they may introduce before they hit the mainline. Again,
if there are no objections I'd like to merge these patches through the
suspend-2.6 tree.
[1/14] - Fix error code paths executed after failing syscore_suspend()
[2/14] - Add missing syscore_suspend() and syscore_resume() calls to
subsystems that should use them in addition to sysdev calls.
[3/14] - Use struct syscore_ops for core PM (instead of sysdevs) in the
common ARM code.
[4/14] - Use struct syscore_ops for core PM (instead of sysdevs) in ARM OMAP
code.
[5/14] - Use struct syscore_ops for core PM (instead of sysdevs) in ARM
Integrator code.
[6/14] - Use struct syscore_ops for core PM (instead of sysdevs) in ARM SA1100
code.
[7/14] - Use struct syscore_ops for core PM (instead of sysdevs) in ARM PXA
code.
[8/14] - Use struct syscore_ops for core PM (instead of sysdevs) in ARM Samsung
code.
[9/14] - Use struct syscore_ops for core PM (instead of sysdevs) in Blackfin
arch code.
[10/14] - Use struct syscore_ops for core PM (instead of sysdevs) in MIPS
arch code.
[11/14] - Use struct syscore_ops for core PM (instead of sysdevs) in AVR32
arch code.
[12/14] - Use struct syscore_ops for core PM (instead of sysdevs) in Unicore32
arch code.
[13/14] - Use struct syscore_ops for core PM (instead of sysdevs) in PowerPC
arch code.
[14/14] - Remove sysdev suspend/resume and shutdown operations.
Thanks,
Rafael
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:16:31
From: Rafael J. Wysocki <redacted>
If syscore_suspend() fails in suspend_enter(), create_image() or
resume_target_kernel(), it is necessary to call sysdev_resume(),
because sysdev_suspend() has been called already and succeeded
and we are going to abort the transition.
Signed-off-by: Rafael J. Wysocki <redacted>
---
kernel/power/hibernate.c | 10 ++++++++--
kernel/power/suspend.c | 5 ++++-
2 files changed, 12 insertions(+), 3 deletions(-)
Index: linux-2.6/kernel/power/suspend.c
===================================================================
@@ -273,8 +273,11 @@ static int create_image(int platform_modlocal_irq_disable();error=sysdev_suspend(PMSG_FREEZE);-if(!error)+if(!error){error=syscore_suspend();+if(error)+sysdev_resume();+}if(error){printk(KERN_ERR"PM: Some system devices failed to power down, ""aborting hibernation\n");
@@ -407,8 +410,11 @@ static int resume_target_kernel(bool plalocal_irq_disable();error=sysdev_suspend(PMSG_QUIESCE);-if(!error)+if(!error){error=syscore_suspend();+if(error)+sysdev_resume();+}if(error)gotoEnable_irqs;
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:16:43
From: Rafael J. Wysocki <redacted>
Device suspend/resume infrastructure is used not only by the suspend
and hibernate code in kernel/power, but also by , APM, Xen and the
kexec jump feature. However, commit 40dc166cb5dddbd36aa4ad11c03915ea
(PM / Core: Introduce struct syscore_ops for core subsystems PM)
failed to add syscore_suspend() and syscore_resume() calls to that
code, which generally leads to breakage when the features in question
are used.
To fix this problem, add the missing syscore_suspend() and
syscore_resume() calls to arch/x86/kernel/apm_32.c, kernel/kexec.c
and drivers/xen/manage.c.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/x86/kernel/apm_32.c | 5 +++++
drivers/xen/manage.c | 9 ++++++++-
kernel/kexec.c | 7 +++++++
3 files changed, 20 insertions(+), 1 deletion(-)
Index: linux-2.6/kernel/kexec.c
===================================================================
@@ -1532,6 +1533,11 @@ int kernel_kexec(void)local_irq_disable();/* Suspend system devices */error=sysdev_suspend(PMSG_FREEZE);+if(!error){+error=syscore_suspend();+if(error)+sysdev_resume();+}if(error)gotoEnable_irqs;}else
@@ -1546,6 +1552,7 @@ int kernel_kexec(void)#ifdef CONFIG_KEXEC_JUMPif(kexec_image->preserve_context){+syscore_resume();sysdev_resume();Enable_irqs:local_irq_enable();
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:16:48
From: Rafael J. Wysocki <redacted>
Replace the sysdev class and struct sys_device used for power
management in the OMAP's GPIO code with a struct syscore_ops object
which is simpler.
Signed-off-by: Rafael J. Wysocki <redacted>
Acked-by: Kevin Hilman <redacted>
---
arch/arm/plat-omap/gpio.c | 35 +++++++++--------------------------
1 file changed, 9 insertions(+), 26 deletions(-)
Index: linux-2.6/arch/arm/plat-omap/gpio.c
===================================================================
@@ -1372,9 +1372,7 @@ static const struct dev_pm_ops omap_mpui.resume_noirq=omap_mpuio_resume_noirq,};-/* use platform_driver for this, now that there's no longer any-*pointtosys_device(otherthannotdisturbingoldcode).-*/+/* use platform_driver for this. */staticstructplatform_driveromap_mpuio_driver={.driver={.name="mpuio",
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:16:56
From: Rafael J. Wysocki <redacted>
Convert some ARM architecture's common code to using
struct syscore_ops objects for power management instead of sysdev
classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/arm/common/vic.c | 69 ++++++++++++++-------------------------
arch/arm/include/asm/mach/time.h | 1
arch/arm/kernel/leds.c | 28 +++++++++------
arch/arm/kernel/time.c | 35 ++++++-------------
arch/arm/vfp/vfpmodule.c | 19 ++--------
5 files changed, 58 insertions(+), 94 deletions(-)
Index: linux-2.6/arch/arm/kernel/time.c
===================================================================
@@ -420,34 +420,25 @@ static int vfp_pm_suspend(struct sys_devreturn0;}-staticintvfp_pm_resume(structsys_device*dev)+staticvoidvfp_pm_resume(void){/* ensure we have access to the vfp */vfp_enable(NULL);/* and disable it to ensure the next usage restores the state */fmxr(FPEXC,fmrx(FPEXC)&~FPEXC_EN);--return0;}-staticstructsysdev_classvfp_pm_sysclass={-.name="vfp",+staticstructsyscore_opsvfp_pm_syscore_ops={.suspend=vfp_pm_suspend,.resume=vfp_pm_resume,};-staticstructsys_devicevfp_pm_sysdev={-.cls=&vfp_pm_sysclass,-};-staticvoidvfp_pm_init(void){-sysdev_class_register(&vfp_pm_sysclass);-sysdev_register(&vfp_pm_sysdev);+register_syscore_ops(&vfp_pm_syscore_ops);}-#elsestaticinlinevoidvfp_pm_init(void){}#endif /* CONFIG_PM */
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:17:05
From: Rafael J. Wysocki <redacted>
Replace the sysdev class and struct sys_device used for power
management by the Integrator interrupt-handling code with a
struct syscore_ops object which is simpler.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/arm/mach-integrator/integrator_ap.c | 26 +++++++++-----------------
1 file changed, 9 insertions(+), 17 deletions(-)
Index: linux-2.6/arch/arm/mach-integrator/integrator_ap.c
===================================================================
@@ -576,9 +551,7 @@ static int __init bootstrap_init(void)staticvoidbootstrap_exit(void){kfree(save_buffer);-sysdev_driver_unregister(&mioa701_sysclass,&driver_bootstrap);-sysdev_unregister(&sysdev_bootstrap);-sysdev_class_unregister(&mioa701_sysclass);+unregister_syscore_ops(&mioa701_syscore_ops);printk(KERN_CRIT"Unregistering mioa701 suspend will hang next""resume !!!\n");
@@ -130,20 +131,19 @@ static u8 viper_hw_version(void)returnv1;}-/* CPU sysdev */-staticintviper_cpu_suspend(structsys_device*sysdev,pm_message_tstate)+/* CPU system core operations. */+staticintviper_cpu_suspend(void){viper_icr_set_bit(VIPER_ICR_R_DIS);return0;}-staticintviper_cpu_resume(structsys_device*sysdev)+staticvoidviper_cpu_resume(void){viper_icr_clear_bit(VIPER_ICR_R_DIS);-return0;}-staticstructsysdev_driverviper_cpu_sysdev_driver={+staticstructsyscore_opsviper_cpu_syscore_ops={.suspend=viper_cpu_suspend,.resume=viper_cpu_resume,};
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:17:21
From: Rafael J. Wysocki <redacted>
Make some UNICORE32 architecture's code use struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/unicore32/kernel/irq.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
Index: linux-2.6/arch/unicore32/kernel/irq.c
===================================================================
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:17:39
From: Rafael J. Wysocki <redacted>
Convert some MIPS architecture's code to using struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/mips/alchemy/common/dbdma.c | 92 +++++++++++----------------------------
arch/mips/alchemy/common/irq.c | 62 +++++++++-----------------
arch/mips/jz4740/gpio.c | 52 +++++++++-------------
arch/mips/kernel/i8259.c | 26 +++--------
4 files changed, 80 insertions(+), 152 deletions(-)
Index: linux-2.6/arch/mips/alchemy/common/irq.c
===================================================================
@@ -957,37 +957,30 @@ u32 au1xxx_dbdma_put_dscr(u32 chanid, aureturnnbytes;}+staticu32alchemy_dbdma_pm_regs[NUM_DBDMA_CHANS+1][6];-structalchemy_dbdma_sysdev{-structsys_devicesysdev;-u32pm_regs[NUM_DBDMA_CHANS+1][6];-};--staticintalchemy_dbdma_suspend(structsys_device*dev,-pm_message_tstate)+staticintalchemy_dbdma_suspend(void){-structalchemy_dbdma_sysdev*sdev=-container_of(dev,structalchemy_dbdma_sysdev,sysdev);inti;u32addr;addr=DDMA_GLOBAL_BASE;-sdev->pm_regs[0][0]=au_readl(addr+0x00);-sdev->pm_regs[0][1]=au_readl(addr+0x04);-sdev->pm_regs[0][2]=au_readl(addr+0x08);-sdev->pm_regs[0][3]=au_readl(addr+0x0c);+alchemy_dbdma_pm_regs[0][0]=au_readl(addr+0x00);+alchemy_dbdma_pm_regs[0][1]=au_readl(addr+0x04);+alchemy_dbdma_pm_regs[0][2]=au_readl(addr+0x08);+alchemy_dbdma_pm_regs[0][3]=au_readl(addr+0x0c);/* save channel configurations */for(i=1,addr=DDMA_CHANNEL_BASE;i<=NUM_DBDMA_CHANS;i++){-sdev->pm_regs[i][0]=au_readl(addr+0x00);-sdev->pm_regs[i][1]=au_readl(addr+0x04);-sdev->pm_regs[i][2]=au_readl(addr+0x08);-sdev->pm_regs[i][3]=au_readl(addr+0x0c);-sdev->pm_regs[i][4]=au_readl(addr+0x10);-sdev->pm_regs[i][5]=au_readl(addr+0x14);+alchemy_dbdma_pm_regs[i][0]=au_readl(addr+0x00);+alchemy_dbdma_pm_regs[i][1]=au_readl(addr+0x04);+alchemy_dbdma_pm_regs[i][2]=au_readl(addr+0x08);+alchemy_dbdma_pm_regs[i][3]=au_readl(addr+0x0c);+alchemy_dbdma_pm_regs[i][4]=au_readl(addr+0x10);+alchemy_dbdma_pm_regs[i][5]=au_readl(addr+0x14);/* halt channel */-au_writel(sdev->pm_regs[i][0]&~1,addr+0x00);+au_writel(alchemy_dbdma_pm_regs[i][0]&~1,addr+0x00);au_sync();while(!(au_readl(addr+0x14)&1))au_sync();
@@ -1001,62 +994,35 @@ static int alchemy_dbdma_suspend(structreturn0;}-staticintalchemy_dbdma_resume(structsys_device*dev)+staticvoidalchemy_dbdma_resume(void){-structalchemy_dbdma_sysdev*sdev=-container_of(dev,structalchemy_dbdma_sysdev,sysdev);inti;u32addr;addr=DDMA_GLOBAL_BASE;-au_writel(sdev->pm_regs[0][0],addr+0x00);-au_writel(sdev->pm_regs[0][1],addr+0x04);-au_writel(sdev->pm_regs[0][2],addr+0x08);-au_writel(sdev->pm_regs[0][3],addr+0x0c);+au_writel(alchemy_dbdma_pm_regs[0][0],addr+0x00);+au_writel(alchemy_dbdma_pm_regs[0][1],addr+0x04);+au_writel(alchemy_dbdma_pm_regs[0][2],addr+0x08);+au_writel(alchemy_dbdma_pm_regs[0][3],addr+0x0c);/* restore channel configurations */for(i=1,addr=DDMA_CHANNEL_BASE;i<=NUM_DBDMA_CHANS;i++){-au_writel(sdev->pm_regs[i][0],addr+0x00);-au_writel(sdev->pm_regs[i][1],addr+0x04);-au_writel(sdev->pm_regs[i][2],addr+0x08);-au_writel(sdev->pm_regs[i][3],addr+0x0c);-au_writel(sdev->pm_regs[i][4],addr+0x10);-au_writel(sdev->pm_regs[i][5],addr+0x14);+au_writel(alchemy_dbdma_pm_regs[i][0],addr+0x00);+au_writel(alchemy_dbdma_pm_regs[i][1],addr+0x04);+au_writel(alchemy_dbdma_pm_regs[i][2],addr+0x08);+au_writel(alchemy_dbdma_pm_regs[i][3],addr+0x0c);+au_writel(alchemy_dbdma_pm_regs[i][4],addr+0x10);+au_writel(alchemy_dbdma_pm_regs[i][5],addr+0x14);au_sync();addr+=0x100;/* next channel base */}--return0;}-staticstructsysdev_classalchemy_dbdma_sysdev_class={-.name="dbdma",+staticstructsyscore_opsalchemy_dbdma_syscore_ops={.suspend=alchemy_dbdma_suspend,.resume=alchemy_dbdma_resume,};-staticint__initalchemy_dbdma_sysdev_init(void)-{-structalchemy_dbdma_sysdev*sdev;-intret;--ret=sysdev_class_register(&alchemy_dbdma_sysdev_class);-if(ret)-returnret;--sdev=kzalloc(sizeof(structalchemy_dbdma_sysdev),GFP_KERNEL);-if(!sdev)-return-ENOMEM;--sdev->sysdev.id=-1;-sdev->sysdev.cls=&alchemy_dbdma_sysdev_class;-ret=sysdev_register(&sdev->sysdev);-if(ret)-kfree(sdev);--returnret;-}-staticint__initau1xxx_dbdma_init(void){intirq_nr,ret;
@@ -215,14 +215,13 @@ spurious_8259A_irq:}}-staticinti8259A_resume(structsys_device*dev)+staticvoidi8259A_resume(void){if(i8259A_auto_eoi>=0)init_8259A(i8259A_auto_eoi);-return0;}-staticinti8259A_shutdown(structsys_device*dev)+staticvoidi8259A_shutdown(void){/* Put the i8259A into a quiescent state that*thekernelinitializationcodecangetit
@@ -232,29 +231,20 @@ static int i8259A_shutdown(struct sys_deoutb(0xff,PIC_MASTER_IMR);/* mask all of 8259A-1 */outb(0xff,PIC_SLAVE_IMR);/* mask all of 8259A-1 */}-return0;}-staticstructsysdev_classi8259_sysdev_class={-.name="i8259",+staticstructsyscore_opsi8259_syscore_ops={.resume=i8259A_resume,.shutdown=i8259A_shutdown,};-staticstructsys_devicedevice_i8259A={-.id=0,-.cls=&i8259_sysdev_class,-};--staticint__initi8259A_init_sysfs(void)+staticint__initi8259A_init_syscore(void){-interror=sysdev_class_register(&i8259_sysdev_class);-if(!error)-error=sysdev_register(&device_i8259A);-returnerror;+register_syscore_ops(&i8259_syscore_ops);+return0;}-device_initcall(i8259A_init_sysfs);+device_initcall(i8259A_init_syscore);staticvoidinit_8259A(intauto_eoi){
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:17:46
From: Rafael J. Wysocki <redacted>
Convert some Blackfin architecture's code to using struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/blackfin/kernel/nmi.c | 30 +++++++++---------------------
1 file changed, 9 insertions(+), 21 deletions(-)
Index: linux-2.6/arch/blackfin/kernel/nmi.c
===================================================================
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:17:55
From: Rafael J. Wysocki <redacted>
Since suspend, resume and shutdown operations in struct sysdev_class
and struct sysdev_driver are not used any more, remove them. Also
drop sysdev_suspend(), sysdev_resume() and sysdev_shutdown() used
for executing those operations and modify all of their users
accordingly. This reduces kernel code size quite a bit and reduces
its complexity.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/sh/Kconfig | 1
arch/x86/Kconfig | 1
arch/x86/kernel/apm_32.c | 4
drivers/base/Kconfig | 7 -
drivers/base/base.h | 2
drivers/base/sys.c | 202 -----------------------------------------------
drivers/xen/manage.c | 8 -
include/linux/device.h | 7 -
include/linux/pm.h | 8 -
include/linux/sysdev.h | 11 --
kernel/kexec.c | 9 --
kernel/power/hibernate.c | 18 ----
kernel/power/suspend.c | 8 -
kernel/sys.c | 3
14 files changed, 7 insertions(+), 282 deletions(-)
Index: linux-2.6/drivers/base/sys.c
===================================================================
@@ -328,203 +328,8 @@ void sysdev_unregister(struct sys_devicekobject_put(&sysdev->kobj);}--#ifndef CONFIG_ARCH_NO_SYSDEV_OPS-/**-*sysdev_shutdown-Shutdownallsystemdevices.-*-*Loopovereachclassofsystemdevices,andthedevicesineach-*ofthoseclasses.Foreachdevice,wecalltheshutdownmethodfor-*eachdriverregisteredforthedevice-theauxiliaries,-*andtheclassdriver.-*-*Note:Thelistisiteratedinreverseorder,sothatweshutdown-*childdevicesbeforeweshutdowntheirparents.Thelistordering-*isguaranteedbyvirtueofthefactthatchilddevicesareregistered-*aftertheirparents.-*/-voidsysdev_shutdown(void)-{-structsysdev_class*cls;--pr_debug("Shutting Down System Devices\n");--mutex_lock(&sysdev_drivers_lock);-list_for_each_entry_reverse(cls,&system_kset->list,kset.kobj.entry){-structsys_device*sysdev;--pr_debug("Shutting down type '%s':\n",-kobject_name(&cls->kset.kobj));--list_for_each_entry(sysdev,&cls->kset.list,kobj.entry){-structsysdev_driver*drv;-pr_debug(" %s\n",kobject_name(&sysdev->kobj));--/* Call auxiliary drivers first */-list_for_each_entry(drv,&cls->drivers,entry){-if(drv->shutdown)-drv->shutdown(sysdev);-}--/* Now call the generic one */-if(cls->shutdown)-cls->shutdown(sysdev);-}-}-mutex_unlock(&sysdev_drivers_lock);-}--staticvoid__sysdev_resume(structsys_device*dev)-{-structsysdev_class*cls=dev->cls;-structsysdev_driver*drv;--/* First, call the class-specific one */-if(cls->resume)-cls->resume(dev);-WARN_ONCE(!irqs_disabled(),-"Interrupts enabled after %pF\n",cls->resume);--/* Call auxiliary drivers next. */-list_for_each_entry(drv,&cls->drivers,entry){-if(drv->resume)-drv->resume(dev);-WARN_ONCE(!irqs_disabled(),-"Interrupts enabled after %pF\n",drv->resume);-}-}--/**-*sysdev_suspend-Suspendallsystemdevices.-*@state:Powerstatetoenter.-*-*Weperformanalmostidenticaloperationassysdev_shutdown()-*above,thoughcalling->suspend()instead.Interruptsaredisabled-*whenthiscalled.Devicesareresponsibleforbothsavingstateand-*quiescingorpoweringdownthedevice.-*-*ThisisonlycalledbythedevicePMcore,soweletthemhandle-*allsynchronization.-*/-intsysdev_suspend(pm_message_tstate)-{-structsysdev_class*cls;-structsys_device*sysdev,*err_dev;-structsysdev_driver*drv,*err_drv;-intret;--pr_debug("Checking wake-up interrupts\n");--/* Return error code if there are any wake-up interrupts pending */-ret=check_wakeup_irqs();-if(ret)-returnret;--WARN_ONCE(!irqs_disabled(),-"Interrupts enabled while suspending system devices\n");--pr_debug("Suspending System Devices\n");--list_for_each_entry_reverse(cls,&system_kset->list,kset.kobj.entry){-pr_debug("Suspending type '%s':\n",-kobject_name(&cls->kset.kobj));--list_for_each_entry(sysdev,&cls->kset.list,kobj.entry){-pr_debug(" %s\n",kobject_name(&sysdev->kobj));--/* Call auxiliary drivers first */-list_for_each_entry(drv,&cls->drivers,entry){-if(drv->suspend){-ret=drv->suspend(sysdev,state);-if(ret)-gotoaux_driver;-}-WARN_ONCE(!irqs_disabled(),-"Interrupts enabled after %pF\n",-drv->suspend);-}--/* Now call the generic one */-if(cls->suspend){-ret=cls->suspend(sysdev,state);-if(ret)-gotocls_driver;-WARN_ONCE(!irqs_disabled(),-"Interrupts enabled after %pF\n",-cls->suspend);-}-}-}-return0;-/* resume current sysdev */-cls_driver:-drv=NULL;-printk(KERN_ERR"Class suspend failed for %s: %d\n",-kobject_name(&sysdev->kobj),ret);--aux_driver:-if(drv)-printk(KERN_ERR"Class driver suspend failed for %s: %d\n",-kobject_name(&sysdev->kobj),ret);-list_for_each_entry(err_drv,&cls->drivers,entry){-if(err_drv==drv)-break;-if(err_drv->resume)-err_drv->resume(sysdev);-}--/* resume other sysdevs in current class */-list_for_each_entry(err_dev,&cls->kset.list,kobj.entry){-if(err_dev==sysdev)-break;-pr_debug(" %s\n",kobject_name(&err_dev->kobj));-__sysdev_resume(err_dev);-}--/* resume other classes */-list_for_each_entry_continue(cls,&system_kset->list,kset.kobj.entry){-list_for_each_entry(err_dev,&cls->kset.list,kobj.entry){-pr_debug(" %s\n",kobject_name(&err_dev->kobj));-__sysdev_resume(err_dev);-}-}-returnret;-}-EXPORT_SYMBOL_GPL(sysdev_suspend);--/**-*sysdev_resume-Bringsystemdevicesbacktolife.-*-*Similartosysdev_suspend(),butweiteratethelistforwards-*toguaranteethatparentdevicesareresumedbeforetheirchildren.-*-*Note:Interruptsaredisabledwhencalled.-*/-intsysdev_resume(void)-{-structsysdev_class*cls;--WARN_ONCE(!irqs_disabled(),-"Interrupts enabled while resuming system devices\n");--pr_debug("Resuming System Devices\n");--list_for_each_entry(cls,&system_kset->list,kset.kobj.entry){-structsys_device*sysdev;--pr_debug("Resuming type '%s':\n",-kobject_name(&cls->kset.kobj));--list_for_each_entry(sysdev,&cls->kset.list,kobj.entry){-pr_debug(" %s\n",kobject_name(&sysdev->kobj));--__sysdev_resume(sysdev);-}-}-return0;-}-EXPORT_SYMBOL_GPL(sysdev_resume);-#endif /* CONFIG_ARCH_NO_SYSDEV_OPS */+EXPORT_SYMBOL_GPL(sysdev_register);+EXPORT_SYMBOL_GPL(sysdev_unregister);int__initsystem_bus_init(void){
@@ -272,12 +272,7 @@ static int create_image(int platform_modlocal_irq_disable();-error=sysdev_suspend(PMSG_FREEZE);-if(!error){-error=syscore_suspend();-if(error)-sysdev_resume();-}+error=syscore_suspend();if(error){printk(KERN_ERR"PM: Some system devices failed to power down, ""aborting hibernation\n");
@@ -302,7 +297,6 @@ static int create_image(int platform_modPower_up:syscore_resume();-sysdev_resume();/* NOTE: dpm_resume_noirq() is just a resume() for devices*thatsuspendedwithirqsoff...nooverallpowerup.*/
@@ -409,12 +403,7 @@ static int resume_target_kernel(bool plalocal_irq_disable();-error=sysdev_suspend(PMSG_QUIESCE);-if(!error){-error=syscore_suspend();-if(error)-sysdev_resume();-}+error=syscore_suspend();if(error)gotoEnable_irqs;
@@ -442,7 +431,6 @@ static int resume_target_kernel(bool platouch_softlockup_watchdog();syscore_resume();-sysdev_resume();Enable_irqs:local_irq_enable();
@@ -528,7 +516,6 @@ int hibernation_platform_enter(void)gotoPlatform_finish;local_irq_disable();-sysdev_suspend(PMSG_HIBERNATE);syscore_suspend();if(pm_wakeup_pending()){error=-EAGAIN;
@@ -541,7 +528,6 @@ int hibernation_platform_enter(void)Power_up:syscore_resume();-sysdev_resume();local_irq_enable();enable_nonboot_cpus();
@@ -1531,13 +1531,7 @@ int kernel_kexec(void)if(error)gotoEnable_cpus;local_irq_disable();-/* Suspend system devices */-error=sysdev_suspend(PMSG_FREEZE);-if(!error){-error=syscore_suspend();-if(error)-sysdev_resume();-}+error=syscore_suspend();if(error)gotoEnable_irqs;}else
@@ -1553,7 +1547,6 @@ int kernel_kexec(void)#ifdef CONFIG_KEXEC_JUMPif(kexec_image->preserve_context){syscore_resume();-sysdev_resume();Enable_irqs:local_irq_enable();Enable_cpus:
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:18:03
From: Rafael J. Wysocki <redacted>
Make some PowerPC architecture's code use struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/powerpc/include/asm/mpic.h | 3 --
arch/powerpc/platforms/cell/spu_base.c | 28 ++++++++++++-------
arch/powerpc/platforms/powermac/pic.c | 42 +++++++---------------------
arch/powerpc/sysdev/ipic.c | 36 ++++++------------------
arch/powerpc/sysdev/mpic.c | 48 +++++++++++++++++----------------
5 files changed, 64 insertions(+), 93 deletions(-)
Index: linux-2.6/arch/powerpc/platforms/powermac/pic.c
===================================================================
@@ -1713,13 +1713,22 @@ static int mpic_suspend(struct sys_devicmpic->save_data[i].dest=mpic_irq_read(i,MPIC_INFO(IRQ_DESTINATION));}+}++staticintmpic_suspend(void)+{+structmpic*mpic=mpics;++while(mpic){+mpic_suspend_one(mpic);+mpic=mpic->next;+}return0;}-staticintmpic_resume(structsys_device*dev)+staticvoidmpic_resume_one(structmpic*mpic){-structmpic*mpic=container_of(dev,structmpic,sysdev);inti;for(i=0;i<mpic->num_sources;i++){
@@ -1746,33 +1755,28 @@ static int mpic_resume(struct sys_device}#endif}/* end for loop */+}-return0;+staticvoidmpic_resume(void)+{+structmpic*mpic=mpics;++while(mpic){+mpic_resume_one(mpic);+mpic=mpic->next;+}}-#endif-staticstructsysdev_classmpic_sysclass={-#ifdef CONFIG_PM+staticstructsyscore_opsmpic_syscore_ops={.resume=mpic_resume,.suspend=mpic_suspend,-#endif-.name="mpic",};staticintmpic_init_sys(void){-structmpic*mpic=mpics;-interror,id=0;--error=sysdev_class_register(&mpic_sysclass);--while(mpic&&!error){-mpic->sysdev.cls=&mpic_sysclass;-mpic->sysdev.id=id++;-error=sysdev_register(&mpic->sysdev);-mpic=mpic->next;-}-returnerror;+register_syscore_ops(&mpic_syscore_ops);+return0;}device_initcall(mpic_init_sys);+#endif
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:18:41
From: Rafael J. Wysocki <redacted>
Convert some AVR32 architecture's code to using struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/avr32/mach-at32ap/intc.c | 38 ++++++++++++--------------------------
1 file changed, 12 insertions(+), 26 deletions(-)
Index: linux-2.6/arch/avr32/mach-at32ap/intc.c
===================================================================
From: Rafael J. Wysocki <hidden> Date: 2011-04-17 21:19:03
From: Rafael J. Wysocki <redacted>
Replace the sysdev class and struct sys_device used for power
management by the SA1100 interrupt-handling code with a
struct syscore_ops object which is simpler.
Signed-off-by: Rafael J. Wysocki <redacted>
---
arch/arm/mach-sa1100/irq.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
Index: linux-2.6/arch/arm/mach-sa1100/irq.c
===================================================================
@@ -134,45 +135,14 @@ void __init s3c244x_init_clocks(int xtals3c2410_baseclk_add();}-#ifdef CONFIG_PM--staticstructsleep_saves3c244x_sleep[]={-SAVE_ITEM(S3C2440_DSC0),-SAVE_ITEM(S3C2440_DSC1),-SAVE_ITEM(S3C2440_GPJDAT),-SAVE_ITEM(S3C2440_GPJCON),-SAVE_ITEM(S3C2440_GPJUP)-};--staticints3c244x_suspend(structsys_device*dev,pm_message_tstate)-{-s3c_pm_do_save(s3c244x_sleep,ARRAY_SIZE(s3c244x_sleep));-return0;-}--staticints3c244x_resume(structsys_device*dev)-{-s3c_pm_do_restore(s3c244x_sleep,ARRAY_SIZE(s3c244x_sleep));-return0;-}--#else-#define s3c244x_suspend NULL-#define s3c244x_resume NULL-#endif-/* Since the S3C2442 and S3C2440 share items, put both sysclasses here */structsysdev_classs3c2440_sysclass={.name="s3c2440-core",-.suspend=s3c244x_suspend,-.resume=s3c244x_resume};structsysdev_classs3c2442_sysclass={.name="s3c2442-core",-.suspend=s3c244x_suspend,-.resume=s3c244x_resume};/* need to register class before we actually register the device, and
@@ -214,17 +214,16 @@ static struct s3c2410_uartcfg bast_uartc/* NAND Flash on BAST board */#ifdef CONFIG_PM-staticintbast_pm_suspend(structsys_device*sd,pm_message_tstate)+staticintbast_pm_suspend(void){/* ensure that an nRESET is not generated on resume. */gpio_direction_output(S3C2410_GPA(21),1);return0;}-staticintbast_pm_resume(structsys_device*sd)+staticvoidbast_pm_resume(void){s3c_gpio_cfgpin(S3C2410_GPA(21),S3C2410_GPA21_nRSTOUT);-return0;}#else
@@ -232,16 +231,11 @@ static int bast_pm_resume(struct sys_dev#define bast_pm_resume NULL#endif-staticstructsysdev_classbast_pm_sysclass={-.name="mach-bast",+staticstructsyscore_opsbast_pm_syscore_ops={.suspend=bast_pm_suspend,.resume=bast_pm_resume,};-staticstructsys_devicebast_pm_sysdev={-.cls=&bast_pm_sysclass,-};-staticintsmartmedia_map[]={0};staticintchip0_map[]={1};staticintchip1_map[]={2};
@@ -1195,19 +1195,12 @@ int s3c2410_dma_getposition(unsigned intEXPORT_SYMBOL(s3c2410_dma_getposition);-staticinlinestructs3c2410_dma_chan*to_dma_chan(structsys_device*dev)-{-returncontainer_of(dev,structs3c2410_dma_chan,dev);-}--/* system device class */+/* system core operations */#ifdef CONFIG_PM-staticints3c2410_dma_suspend(structsys_device*dev,pm_message_tstate)+staticvoids3c2410_dma_suspend_chan(s3c2410_dma_chan*cp){-structs3c2410_dma_chan*cp=to_dma_chan(dev);-printk(KERN_DEBUG"suspending dma channel %d\n",cp->number);if(dma_rdreg(cp,S3C2410_DMA_DMASKTRIG)&S3C2410_DMASKTRIG_ON){
@@ -304,7 +304,7 @@ static int osiris_pm_suspend(struct sys_return0;}-staticintosiris_pm_resume(structsys_device*sd)+staticvoidosiris_pm_resume(void){if(pm_osiris_ctrl0&OSIRIS_CTRL0_FIX8)__raw_writeb(OSIRIS_CTRL1_FIX8,OSIRIS_VA_CTRL1);
@@ -312,8 +312,6 @@ static int osiris_pm_resume(struct sys_d__raw_writeb(pm_osiris_ctrl0,OSIRIS_VA_CTRL0);s3c_gpio_cfgpin(S3C2410_GPA(21),S3C2410_GPA21_nRSTOUT);--return0;}#else
@@ -321,16 +319,11 @@ static int osiris_pm_resume(struct sys_d#define osiris_pm_resume NULL#endif-staticstructsysdev_classosiris_pm_sysclass={-.name="mach-osiris",+staticstructsyscore_opsosiris_pm_syscore_ops={.suspend=osiris_pm_suspend,.resume=osiris_pm_resume,};-staticstructsys_deviceosiris_pm_sysdev={-.cls=&osiris_pm_sysclass,-};-/* Link for DVS driver to TPS65011 */staticvoidosiris_tps_release(structdevice*dev)
@@ -486,7 +486,7 @@ static struct s3c2410_udc_mach_info jive/* Jive power management device */#ifdef CONFIG_PM-staticintjive_pm_suspend(structsys_device*sd,pm_message_tstate)+staticintjive_pm_suspend(void){/* Write the magic value u-boot uses to check for resume into*theINFORM0register,andensureINFORM1issettothe
@@ -498,10 +498,9 @@ static int jive_pm_suspend(struct sys_dereturn0;}-staticintjive_pm_resume(structsys_device*sd)+staticvoidjive_pm_resume(void){__raw_writel(0x0,S3C2412_INFORM0);-return0;}#else
@@ -509,16 +508,11 @@ static int jive_pm_resume(struct sys_dev#define jive_pm_resume NULL#endif-staticstructsysdev_classjive_pm_sysclass={-.name="jive-pm",+staticstructsyscore_opsjive_pm_syscore_ops={.suspend=jive_pm_suspend,.resume=jive_pm_resume,};-staticstructsys_devicejive_pm_sysdev={-.cls=&jive_pm_sysclass,-};-staticvoid__initjive_map_io(void){s3c24xx_init_io(jive_iodesc,ARRAY_SIZE(jive_iodesc));
@@ -536,10 +530,9 @@ static void jive_power_off(void)staticvoid__initjive_machine_init(void){-/* register system devices for managing low level suspend */+/* register system core operations for managing low level suspend */-sysdev_class_register(&jive_pm_sysclass);-sysdev_register(&jive_pm_sysdev);+register_syscore_ops(&jive_pm_syscore_ops);/* write our sleep configurations for the IO. Pull down all unused*IO,ensurethatwehaveturnedoffallperipheralswedonot
From: Kukjin Kim <hidden> Date: 2011-04-17 21:49:40
Rafael J. Wysocki wrote:
From: Rafael J. Wysocki <redacted>
Replace sysdev classes and struct sys_device objects used for "core"
power management by Samsung platforms with struct syscore_ops objects
that are simpler.
This generally reduces the code size and the kernel memory footprint.
It also is necessary for removing sysdevs entirely from the kernel in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
From: Mike Frysinger <hidden> Date: 2011-04-18 02:34:48
On Sun, Apr 17, 2011 at 17:11, Rafael J. Wysocki wrote:
Convert some Blackfin architecture's code to using struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
looks straight forward enough ...
Acked-by: Mike Frysinger <redacted>
On Sun, Apr 17, 2011 at 11:01:53PM +0200, Rafael J. Wysocki wrote:
Hi,
The following series of patches fixes bugs related to the introduction
of struct syscore_ops later in this cycle, replaces sysdev suspend/resume
operations in all of the architectures still using them with struct
syscore_ops-based PM callbacks and finally removes the suspend/resume
and shutdown operations from struct sysdev_class and struct sysdev_driver.
Patches [1/14] and [2/14] are important bug fixes targeted at 2.6.39.
The remaining patches are regareded as 2.6.40 material, but I'd like to
put them into linux-next shortly, if there are no objections, to catch
problems that they may introduce before they hit the mainline. Again,
if there are no objections I'd like to merge these patches through the
suspend-2.6 tree.
No objection from me at all, thanks for doing this they look great.
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
From: Ian Campbell <hidden> Date: 2011-04-18 08:51:53
On Sun, 2011-04-17 at 23:06 +0200, Rafael J. Wysocki wrote:
From: Rafael J. Wysocki <redacted>
Device suspend/resume infrastructure is used not only by the suspend
and hibernate code in kernel/power, but also by , APM, Xen and the
kexec jump feature. However, commit 40dc166cb5dddbd36aa4ad11c03915ea
(PM / Core: Introduce struct syscore_ops for core subsystems PM)
failed to add syscore_suspend() and syscore_resume() calls to that
code, which generally leads to breakage when the features in question
are used.
To fix this problem, add the missing syscore_suspend() and
syscore_resume() calls to arch/x86/kernel/apm_32.c, kernel/kexec.c
and drivers/xen/manage.c.
Xen bit looks ok to me:
Acked-by: Ian Campbell <redacted>
@@ -1532,6 +1533,11 @@ int kernel_kexec(void)local_irq_disable();/* Suspend system devices */error=sysdev_suspend(PMSG_FREEZE);+if(!error){+error=syscore_suspend();+if(error)+sysdev_resume();+}if(error)gotoEnable_irqs;}else
@@ -1546,6 +1552,7 @@ int kernel_kexec(void)#ifdef CONFIG_KEXEC_JUMPif(kexec_image->preserve_context){+syscore_resume();sysdev_resume();Enable_irqs:local_irq_enable();
This patch breaks the Alchemy kernel compile; below patch on top of it fixes
that again.
Signed-off-by: Ralf Baechle <redacted>
---
arch/mips/alchemy/common/irq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-mips/arch/mips/alchemy/common/irq.c
===================================================================
From: Rafael J. Wysocki <hidden> Date: 2011-04-18 21:43:22
On Monday, April 18, 2011, Mike Frysinger wrote:
On Sun, Apr 17, 2011 at 17:11, Rafael J. Wysocki wrote:
quoted
Convert some Blackfin architecture's code to using struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
looks straight forward enough ...
Acked-by: Mike Frysinger <redacted>
Well, that would trigger a compiler warning from register_syscore_ops().
However, I'm going to make that change change everywhere at once when all of
the conversions have been made, since it looks like we're only going to have
static syscore_ops.
Thanks,
Rafael
From: Rafael J. Wysocki <redacted>
Convert some MIPS architecture's code to using struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
For the jz4740 part:
Acked-and-tested-by: Lars-Peter Clausen [off-list ref]
@@ -957,37 +957,30 @@ u32 au1xxx_dbdma_put_dscr(u32 chanid, aureturnnbytes;}+staticu32alchemy_dbdma_pm_regs[NUM_DBDMA_CHANS+1][6];-structalchemy_dbdma_sysdev{-structsys_devicesysdev;-u32pm_regs[NUM_DBDMA_CHANS+1][6];-};--staticintalchemy_dbdma_suspend(structsys_device*dev,-pm_message_tstate)+staticintalchemy_dbdma_suspend(void){-structalchemy_dbdma_sysdev*sdev=-container_of(dev,structalchemy_dbdma_sysdev,sysdev);inti;u32addr;addr=DDMA_GLOBAL_BASE;-sdev->pm_regs[0][0]=au_readl(addr+0x00);-sdev->pm_regs[0][1]=au_readl(addr+0x04);-sdev->pm_regs[0][2]=au_readl(addr+0x08);-sdev->pm_regs[0][3]=au_readl(addr+0x0c);+alchemy_dbdma_pm_regs[0][0]=au_readl(addr+0x00);+alchemy_dbdma_pm_regs[0][1]=au_readl(addr+0x04);+alchemy_dbdma_pm_regs[0][2]=au_readl(addr+0x08);+alchemy_dbdma_pm_regs[0][3]=au_readl(addr+0x0c);/* save channel configurations */for(i=1,addr=DDMA_CHANNEL_BASE;i<=NUM_DBDMA_CHANS;i++){-sdev->pm_regs[i][0]=au_readl(addr+0x00);-sdev->pm_regs[i][1]=au_readl(addr+0x04);-sdev->pm_regs[i][2]=au_readl(addr+0x08);-sdev->pm_regs[i][3]=au_readl(addr+0x0c);-sdev->pm_regs[i][4]=au_readl(addr+0x10);-sdev->pm_regs[i][5]=au_readl(addr+0x14);+alchemy_dbdma_pm_regs[i][0]=au_readl(addr+0x00);+alchemy_dbdma_pm_regs[i][1]=au_readl(addr+0x04);+alchemy_dbdma_pm_regs[i][2]=au_readl(addr+0x08);+alchemy_dbdma_pm_regs[i][3]=au_readl(addr+0x0c);+alchemy_dbdma_pm_regs[i][4]=au_readl(addr+0x10);+alchemy_dbdma_pm_regs[i][5]=au_readl(addr+0x14);/* halt channel */-au_writel(sdev->pm_regs[i][0]&~1,addr+0x00);+au_writel(alchemy_dbdma_pm_regs[i][0]&~1,addr+0x00);au_sync();while(!(au_readl(addr+0x14)&1))au_sync();
@@ -1001,62 +994,35 @@ static int alchemy_dbdma_suspend(structreturn0;}-staticintalchemy_dbdma_resume(structsys_device*dev)+staticvoidalchemy_dbdma_resume(void){-structalchemy_dbdma_sysdev*sdev=-container_of(dev,structalchemy_dbdma_sysdev,sysdev);inti;u32addr;addr=DDMA_GLOBAL_BASE;-au_writel(sdev->pm_regs[0][0],addr+0x00);-au_writel(sdev->pm_regs[0][1],addr+0x04);-au_writel(sdev->pm_regs[0][2],addr+0x08);-au_writel(sdev->pm_regs[0][3],addr+0x0c);+au_writel(alchemy_dbdma_pm_regs[0][0],addr+0x00);+au_writel(alchemy_dbdma_pm_regs[0][1],addr+0x04);+au_writel(alchemy_dbdma_pm_regs[0][2],addr+0x08);+au_writel(alchemy_dbdma_pm_regs[0][3],addr+0x0c);/* restore channel configurations */for(i=1,addr=DDMA_CHANNEL_BASE;i<=NUM_DBDMA_CHANS;i++){-au_writel(sdev->pm_regs[i][0],addr+0x00);-au_writel(sdev->pm_regs[i][1],addr+0x04);-au_writel(sdev->pm_regs[i][2],addr+0x08);-au_writel(sdev->pm_regs[i][3],addr+0x0c);-au_writel(sdev->pm_regs[i][4],addr+0x10);-au_writel(sdev->pm_regs[i][5],addr+0x14);+au_writel(alchemy_dbdma_pm_regs[i][0],addr+0x00);+au_writel(alchemy_dbdma_pm_regs[i][1],addr+0x04);+au_writel(alchemy_dbdma_pm_regs[i][2],addr+0x08);+au_writel(alchemy_dbdma_pm_regs[i][3],addr+0x0c);+au_writel(alchemy_dbdma_pm_regs[i][4],addr+0x10);+au_writel(alchemy_dbdma_pm_regs[i][5],addr+0x14);au_sync();addr+=0x100;/* next channel base */}--return0;}-staticstructsysdev_classalchemy_dbdma_sysdev_class={-.name="dbdma",+staticstructsyscore_opsalchemy_dbdma_syscore_ops={.suspend=alchemy_dbdma_suspend,.resume=alchemy_dbdma_resume,};-staticint__initalchemy_dbdma_sysdev_init(void)-{-structalchemy_dbdma_sysdev*sdev;-intret;--ret=sysdev_class_register(&alchemy_dbdma_sysdev_class);-if(ret)-returnret;--sdev=kzalloc(sizeof(structalchemy_dbdma_sysdev),GFP_KERNEL);-if(!sdev)-return-ENOMEM;--sdev->sysdev.id=-1;-sdev->sysdev.cls=&alchemy_dbdma_sysdev_class;-ret=sysdev_register(&sdev->sysdev);-if(ret)-kfree(sdev);--returnret;-}-staticint__initau1xxx_dbdma_init(void){intirq_nr,ret;
@@ -215,14 +215,13 @@ spurious_8259A_irq:}}-staticinti8259A_resume(structsys_device*dev)+staticvoidi8259A_resume(void){if(i8259A_auto_eoi>=0)init_8259A(i8259A_auto_eoi);-return0;}-staticinti8259A_shutdown(structsys_device*dev)+staticvoidi8259A_shutdown(void){/* Put the i8259A into a quiescent state that*thekernelinitializationcodecangetit
@@ -232,29 +231,20 @@ static int i8259A_shutdown(struct sys_deoutb(0xff,PIC_MASTER_IMR);/* mask all of 8259A-1 */outb(0xff,PIC_SLAVE_IMR);/* mask all of 8259A-1 */}-return0;}-staticstructsysdev_classi8259_sysdev_class={-.name="i8259",+staticstructsyscore_opsi8259_syscore_ops={.resume=i8259A_resume,.shutdown=i8259A_shutdown,};-staticstructsys_devicedevice_i8259A={-.id=0,-.cls=&i8259_sysdev_class,-};--staticint__initi8259A_init_sysfs(void)+staticint__initi8259A_init_syscore(void){-interror=sysdev_class_register(&i8259_sysdev_class);-if(!error)-error=sysdev_register(&device_i8259A);-returnerror;+register_syscore_ops(&i8259_syscore_ops);+return0;}-device_initcall(i8259A_init_sysfs);+device_initcall(i8259A_init_syscore);staticvoidinit_8259A(intauto_eoi){--
-----Original Message-----
From: Rafael J. Wysocki [mailto:rjw@sisk.pl]
Sent: Monday, April 18, 2011 5:14 AM
To: LKML
Cc: Greg KH; Kay Sievers; Linux PM mailing list; Russell King; linux-omap@vger.kernel.org; Kevin Hilman; linux-arm-
kernel@lists.infradead.org; Ben Dooks; Mike Frysinger; Ralf Baechle; Hans-Christian Egtvedt; Guan Xuetao; Benjamin Herrenschmidt;
linuxppc-dev@lists.ozlabs.org; Jiri Kosina; Konrad Rzeszutek Wilk; Jeremy Fitzhardinge
Subject: [PATCH 12/14] PM / UNICORE32: Use struct syscore_ops instead of sysdevs for PM
From: Rafael J. Wysocki <redacted>
Make some UNICORE32 architecture's code use struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
On Sun, 2011-04-17 at 23:13 +0200, Rafael J. Wysocki wrote:
From: Rafael J. Wysocki <redacted>
Convert some AVR32 architecture's code to using struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
Acked-by: Hans-Christian Egtvedt <redacted>
Thanks, nice work. Tested and run on hardware.
<snipp>
--
Hans-Christian Egtvedt
From: Rafael J. Wysocki <hidden> Date: 2011-04-26 17:13:48
On Tuesday, April 26, 2011, Hans-Christian Egtvedt wrote:
On Sun, 2011-04-17 at 23:13 +0200, Rafael J. Wysocki wrote:
quoted
From: Rafael J. Wysocki <redacted>
Convert some AVR32 architecture's code to using struct syscore_ops
objects for power management instead of sysdev classes and sysdevs.
This simplifies the code and reduces the kernel's memory footprint.
It also is necessary for removing sysdevs from the kernel entirely in
the future.
Signed-off-by: Rafael J. Wysocki <redacted>
Acked-by: Hans-Christian Egtvedt <redacted>
Thanks, nice work. Tested and run on hardware.