From 4c6f458dfb2eb6a2304cba3a31f67e16862c38a1 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 25 Jul 2007 00:29:53 -0500 Subject: [PATCH] --- yaml --- r: 63030 b: refs/heads/master c: 7659c038d3d0a635b5aeff04aed523d7b6c1dde8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Makefile | 2 +- trunk/arch/i386/boot/apm.c | 7 +- trunk/arch/i386/boot/main.c | 16 +- trunk/arch/i386/kernel/acpi/Makefile | 2 +- trunk/arch/i386/kernel/setup.c | 2 +- trunk/arch/i386/mm/init.c | 2 +- trunk/arch/ia64/ia32/ia32_support.c | 8 +- trunk/arch/ia64/ia32/ia32priv.h | 12 +- trunk/arch/ia64/ia32/sys_ia32.c | 81 +++++---- trunk/arch/ia64/kernel/acpi.c | 19 -- trunk/arch/ia64/kernel/head.S | 4 +- trunk/arch/ia64/kernel/irq_ia64.c | 26 +-- trunk/arch/ia64/kernel/machvec.c | 27 +-- trunk/arch/ia64/kernel/process.c | 7 +- trunk/arch/ia64/kernel/setup.c | 11 +- trunk/arch/ia64/kernel/smp.c | 2 +- trunk/arch/ia64/kernel/smpboot.c | 6 +- trunk/arch/ia64/kernel/vmlinux.lds.S | 2 - trunk/arch/ia64/pci/pci.c | 2 +- trunk/arch/m68knommu/Kconfig | 24 --- trunk/arch/m68knommu/Makefile | 2 - trunk/arch/m68knommu/kernel/dma.c | 1 - trunk/arch/m68knommu/kernel/setup.c | 5 - trunk/arch/m68knommu/platform/5206/config.c | 8 + trunk/arch/m68knommu/platform/5206e/config.c | 7 +- trunk/arch/m68knommu/platform/520x/config.c | 7 + trunk/arch/m68knommu/platform/523x/config.c | 8 + trunk/arch/m68knommu/platform/5249/config.c | 8 + trunk/arch/m68knommu/platform/5272/config.c | 7 +- trunk/arch/m68knommu/platform/527x/config.c | 8 + trunk/arch/m68knommu/platform/528x/config.c | 8 + trunk/arch/m68knommu/platform/5307/config.c | 7 +- trunk/arch/m68knommu/platform/5307/entry.S | 11 +- trunk/arch/m68knommu/platform/532x/config.c | 5 +- trunk/arch/m68knommu/platform/5407/config.c | 7 + .../arch/m68knommu/platform/68VZ328/config.c | 7 + trunk/arch/powerpc/boot/dts/kuroboxHD.dts | 18 +- trunk/arch/powerpc/boot/dts/kuroboxHG.dts | 19 +- trunk/arch/powerpc/kernel/head_64.S | 7 +- trunk/arch/powerpc/kernel/iomap.c | 8 +- trunk/arch/powerpc/kernel/pci-common.c | 23 --- trunk/arch/powerpc/kernel/prom_parse.c | 2 +- trunk/arch/powerpc/kernel/setup-common.c | 4 - trunk/arch/powerpc/mm/lmb.c | 4 +- .../powerpc/platforms/cell/spufs/context.c | 3 +- trunk/arch/powerpc/platforms/cell/spufs/run.c | 4 - .../arch/powerpc/platforms/cell/spufs/sched.c | 4 + .../arch/powerpc/platforms/iseries/lpevents.c | 2 +- trunk/arch/powerpc/platforms/maple/pci.c | 3 - trunk/arch/powerpc/sysdev/fsl_pci.c | 2 +- trunk/arch/powerpc/sysdev/fsl_soc.c | 61 ------- trunk/arch/powerpc/sysdev/indirect_pci.c | 1 + trunk/arch/x86_64/kernel/acpi/Makefile | 2 +- trunk/arch/x86_64/kernel/acpi/sleep.c | 4 + trunk/arch/x86_64/kernel/head.S | 2 +- trunk/arch/x86_64/kernel/setup.c | 2 +- trunk/drivers/acpi/Kconfig | 64 ++++--- trunk/drivers/acpi/ac.c | 9 +- trunk/drivers/acpi/acpi_memhotplug.c | 8 +- trunk/drivers/acpi/asus_acpi.c | 11 +- trunk/drivers/acpi/battery.c | 9 +- trunk/drivers/acpi/button.c | 12 +- trunk/drivers/acpi/container.c | 10 +- trunk/drivers/acpi/ec.c | 8 +- trunk/drivers/acpi/events/evrgnini.c | 2 +- trunk/drivers/acpi/fan.c | 8 +- trunk/drivers/acpi/namespace/nsxfeval.c | 2 +- trunk/drivers/acpi/pci_link.c | 9 +- trunk/drivers/acpi/pci_root.c | 9 +- trunk/drivers/acpi/power.c | 8 +- trunk/drivers/acpi/processor_core.c | 8 +- trunk/drivers/acpi/processor_throttling.c | 59 ++----- trunk/drivers/acpi/sbs.c | 10 +- trunk/drivers/acpi/scan.c | 156 +++++------------ trunk/drivers/acpi/sleep/Makefile | 4 +- trunk/drivers/acpi/sleep/main.c | 162 ++++-------------- trunk/drivers/acpi/sleep/poweroff.c | 2 + trunk/drivers/acpi/sleep/proc.c | 20 +-- trunk/drivers/acpi/sleep/wakeup.c | 2 + trunk/drivers/acpi/thermal.c | 8 +- trunk/drivers/acpi/utilities/uteval.c | 4 +- trunk/drivers/acpi/video.c | 8 +- trunk/drivers/char/hpet.c | 8 +- trunk/drivers/input/misc/atlas_btns.c | 9 +- trunk/drivers/kvm/kvm_main.c | 44 ++--- trunk/drivers/kvm/x86_emulate.c | 2 - trunk/drivers/misc/asus-laptop.c | 9 +- trunk/drivers/misc/sony-laptop.c | 21 +-- trunk/drivers/misc/thinkpad_acpi.c | 20 +-- trunk/drivers/misc/thinkpad_acpi.h | 2 +- trunk/drivers/pci/pci-acpi.c | 28 +-- trunk/drivers/pci/pci.c | 8 +- trunk/drivers/pci/pci.h | 2 +- trunk/drivers/pnp/driver.c | 5 - trunk/drivers/pnp/pnpacpi/core.c | 33 +--- trunk/drivers/rtc/class.c | 5 +- trunk/drivers/s390/net/ctcmain.c | 6 +- trunk/drivers/s390/net/netiucv.c | 4 +- trunk/drivers/serial/68328serial.c | 71 +++++++- trunk/include/acpi/acpi_bus.h | 7 +- trunk/include/acpi/acpi_drivers.h | 25 ++- trunk/include/acpi/actypes.h | 6 +- trunk/include/acpi/acutils.h | 4 +- trunk/include/asm-i386/acpi.h | 23 ++- trunk/include/asm-i386/bootparam.h | 9 +- trunk/include/asm-i386/ist.h | 10 +- trunk/include/asm-i386/suspend.h | 2 +- trunk/include/asm-ia64/acpi.h | 5 - trunk/include/asm-ia64/ia32.h | 9 +- trunk/include/asm-ia64/machvec.h | 1 - trunk/include/asm-ia64/processor.h | 4 +- trunk/include/asm-ia64/smp.h | 1 + trunk/include/asm-m68knommu/hw_irq.h | 4 - trunk/include/asm-m68knommu/mcfdma.h | 2 +- trunk/include/asm-m68knommu/system.h | 4 +- trunk/include/asm-m68knommu/timex.h | 24 +-- trunk/include/asm-powerpc/pci-bridge.h | 20 --- trunk/include/asm-powerpc/ppc_asm.h | 12 -- trunk/include/asm-powerpc/vio.h | 5 - trunk/include/asm-x86_64/acpi.h | 22 ++- trunk/include/asm-x86_64/ist.h | 1 - trunk/include/asm-x86_64/suspend.h | 2 + trunk/include/linux/acpi.h | 1 - trunk/include/linux/apm_bios.h | 20 +-- trunk/include/linux/mod_devicetable.h | 6 - trunk/include/linux/pnp.h | 4 - trunk/include/linux/time.h | 8 +- trunk/kernel/acct.c | 2 +- trunk/kernel/hrtimer.c | 6 +- trunk/kernel/sysctl.c | 2 +- trunk/kernel/time.c | 16 ++ trunk/kernel/time/timekeeping.c | 38 +--- trunk/kernel/tsacct.c | 2 +- trunk/net/rxrpc/af_rxrpc.c | 2 +- trunk/net/rxrpc/ar-connection.c | 4 +- trunk/net/rxrpc/ar-transport.c | 4 +- trunk/net/rxrpc/rxkad.c | 2 +- trunk/scripts/Makefile.build | 2 +- trunk/scripts/Makefile.modpost | 21 ++- trunk/scripts/kconfig/conf.c | 31 ++-- trunk/scripts/kconfig/expr.h | 4 +- trunk/scripts/kconfig/gconf.c | 10 +- trunk/scripts/kconfig/kxgettext.c | 4 +- trunk/scripts/kconfig/lkc_proto.h | 2 - trunk/scripts/kconfig/mconf.c | 4 +- trunk/scripts/kconfig/menu.c | 12 -- trunk/scripts/kconfig/qconf.cc | 2 +- trunk/scripts/kconfig/zconf.tab.c_shipped | 12 +- trunk/scripts/kconfig/zconf.y | 12 +- trunk/scripts/mod/file2alias.c | 12 -- trunk/scripts/mod/modpost.c | 159 ++++++++--------- trunk/scripts/ver_linux | 4 +- trunk/security/selinux/xfrm.c | 3 +- 154 files changed, 758 insertions(+), 1289 deletions(-) delete mode 100644 trunk/include/asm-m68knommu/hw_irq.h delete mode 100644 trunk/include/asm-x86_64/ist.h diff --git a/[refs] b/[refs] index 1d059079bbc5..a2669960bea9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9d78592ed72dbff1d8825207f8def07858a49768 +refs/heads/master: 7659c038d3d0a635b5aeff04aed523d7b6c1dde8 diff --git a/trunk/Makefile b/trunk/Makefile index dfe3d1610a7b..23f81c9f698e 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -299,7 +299,7 @@ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise $(C MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS) -LDFLAGS_MODULE = +LDFLAGS_MODULE = -r CFLAGS_KERNEL = AFLAGS_KERNEL = diff --git a/trunk/arch/i386/boot/apm.c b/trunk/arch/i386/boot/apm.c index eab50c55a3a5..a34087c370c0 100644 --- a/trunk/arch/i386/boot/apm.c +++ b/trunk/arch/i386/boot/apm.c @@ -40,15 +40,14 @@ int query_apm_bios(void) if (bx != 0x504d) /* "PM" signature */ return -1; - if (!(cx & 0x02)) /* 32 bits supported? */ + if (cx & 0x02) /* 32 bits supported? */ return -1; /* Disconnect first, just in case */ ax = 0x5304; - bx = 0; asm volatile("pushl %%ebp ; int $0x15 ; popl %%ebp" - : "+a" (ax), "+b" (bx) - : : "ecx", "edx", "esi", "edi"); + : "+a" (ax) + : : "ebx", "ecx", "edx", "esi", "edi"); /* Paranoia */ ebx = esi = 0; diff --git a/trunk/arch/i386/boot/main.c b/trunk/arch/i386/boot/main.c index 0eeef3989a17..7f01f96c4fb8 100644 --- a/trunk/arch/i386/boot/main.c +++ b/trunk/arch/i386/boot/main.c @@ -73,15 +73,15 @@ static void keyboard_set_repeat(void) } /* - * Get Intel SpeedStep (IST) information. + * Get Intel SpeedStep IST information. */ -static void query_ist(void) +static void query_speedstep_ist(void) { asm("int $0x15" - : "=a" (boot_params.ist_info.signature), - "=b" (boot_params.ist_info.command), - "=c" (boot_params.ist_info.event), - "=d" (boot_params.ist_info.perf_level) + : "=a" (boot_params.speedstep_info[0]), + "=b" (boot_params.speedstep_info[1]), + "=c" (boot_params.speedstep_info[2]), + "=d" (boot_params.speedstep_info[3]) : "a" (0x0000e980), /* IST Support */ "d" (0x47534943)); /* Request value */ } @@ -144,8 +144,8 @@ void main(void) query_voyager(); #endif - /* Query Intel SpeedStep (IST) information */ - query_ist(); + /* Query SpeedStep IST information */ + query_speedstep_ist(); /* Query APM information */ #if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) diff --git a/trunk/arch/i386/kernel/acpi/Makefile b/trunk/arch/i386/kernel/acpi/Makefile index 223f58fc9f46..7f7be01f44e6 100644 --- a/trunk/arch/i386/kernel/acpi/Makefile +++ b/trunk/arch/i386/kernel/acpi/Makefile @@ -2,7 +2,7 @@ obj-$(CONFIG_ACPI) += boot.o ifneq ($(CONFIG_PCI),) obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o endif -obj-$(CONFIG_ACPI) += sleep.o wakeup.o +obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o ifneq ($(CONFIG_ACPI_PROCESSOR),) obj-y += cstate.o processor.o diff --git a/trunk/arch/i386/kernel/setup.c b/trunk/arch/i386/kernel/setup.c index 7fe5da3c932e..d474cd639bcb 100644 --- a/trunk/arch/i386/kernel/setup.c +++ b/trunk/arch/i386/kernel/setup.c @@ -422,7 +422,7 @@ void __init setup_bootmem_allocator(void) */ reserve_bootmem(PAGE_SIZE, PAGE_SIZE); #endif -#ifdef CONFIG_ACPI +#ifdef CONFIG_ACPI_SLEEP /* * Reserve low memory region for sleep support. */ diff --git a/trunk/arch/i386/mm/init.c b/trunk/arch/i386/mm/init.c index 1b1a1e66d099..c3b9905af2d5 100644 --- a/trunk/arch/i386/mm/init.c +++ b/trunk/arch/i386/mm/init.c @@ -432,7 +432,7 @@ static void __init pagetable_init (void) paravirt_pagetable_setup_done(pgd_base); } -#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI) +#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI_SLEEP) /* * Swap suspend & friends need this for resume because things like the intel-agp * driver might have split up a kernel 4MB mapping. diff --git a/trunk/arch/ia64/ia32/ia32_support.c b/trunk/arch/ia64/ia32/ia32_support.c index d1d50cd1c38a..e13a1a1db4b5 100644 --- a/trunk/arch/ia64/ia32/ia32_support.c +++ b/trunk/arch/ia64/ia32/ia32_support.c @@ -249,11 +249,11 @@ ia32_init (void) #if PAGE_SHIFT > IA32_PAGE_SHIFT { - extern struct kmem_cache *ia64_partial_page_cachep; + extern struct kmem_cache *partial_page_cachep; - ia64_partial_page_cachep = kmem_cache_create("ia64_partial_page_cache", - sizeof(struct ia64_partial_page), - 0, SLAB_PANIC, NULL); + partial_page_cachep = kmem_cache_create("partial_page_cache", + sizeof(struct partial_page), + 0, SLAB_PANIC, NULL); } #endif return 0; diff --git a/trunk/arch/ia64/ia32/ia32priv.h b/trunk/arch/ia64/ia32/ia32priv.h index 466bbcb138b2..cfa0bc0026b5 100644 --- a/trunk/arch/ia64/ia32/ia32priv.h +++ b/trunk/arch/ia64/ia32/ia32priv.h @@ -25,8 +25,8 @@ * partially mapped pages provide precise accounting of which 4k sub pages * are mapped and which ones are not, thereby improving IA-32 compatibility. */ -struct ia64_partial_page { - struct ia64_partial_page *next; /* linked list, sorted by address */ +struct partial_page { + struct partial_page *next; /* linked list, sorted by address */ struct rb_node pp_rb; /* 64K is the largest "normal" page supported by ia64 ABI. So 4K*64 * should suffice.*/ @@ -34,17 +34,17 @@ struct ia64_partial_page { unsigned int base; }; -struct ia64_partial_page_list { - struct ia64_partial_page *pp_head; /* list head, points to the lowest +struct partial_page_list { + struct partial_page *pp_head; /* list head, points to the lowest * addressed partial page */ struct rb_root ppl_rb; - struct ia64_partial_page *pp_hint; /* pp_hint->next is the last + struct partial_page *pp_hint; /* pp_hint->next is the last * accessed partial page */ atomic_t pp_count; /* reference count */ }; #if PAGE_SHIFT > IA32_PAGE_SHIFT -struct ia64_partial_page_list* ia32_init_pp_list (void); +struct partial_page_list* ia32_init_pp_list (void); #else # define ia32_init_pp_list() 0 #endif diff --git a/trunk/arch/ia64/ia32/sys_ia32.c b/trunk/arch/ia64/ia32/sys_ia32.c index af10462d44d4..0afb4fe7c35b 100644 --- a/trunk/arch/ia64/ia32/sys_ia32.c +++ b/trunk/arch/ia64/ia32/sys_ia32.c @@ -253,17 +253,17 @@ mmap_subpage (struct file *file, unsigned long start, unsigned long end, int pro return ret; } -/* SLAB cache for ia64_partial_page structures */ -struct kmem_cache *ia64_partial_page_cachep; +/* SLAB cache for partial_page structures */ +struct kmem_cache *partial_page_cachep; /* - * init ia64_partial_page_list. + * init partial_page_list. * return 0 means kmalloc fail. */ -struct ia64_partial_page_list* +struct partial_page_list* ia32_init_pp_list(void) { - struct ia64_partial_page_list *p; + struct partial_page_list *p; if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL) return p; @@ -280,12 +280,12 @@ ia32_init_pp_list(void) * Else, return 0 and provide @pprev, @rb_link, @rb_parent to * be used by later __ia32_insert_pp(). */ -static struct ia64_partial_page * -__ia32_find_pp(struct ia64_partial_page_list *ppl, unsigned int start, - struct ia64_partial_page **pprev, struct rb_node ***rb_link, +static struct partial_page * +__ia32_find_pp(struct partial_page_list *ppl, unsigned int start, + struct partial_page **pprev, struct rb_node ***rb_link, struct rb_node **rb_parent) { - struct ia64_partial_page *pp; + struct partial_page *pp; struct rb_node **__rb_link, *__rb_parent, *rb_prev; pp = ppl->pp_hint; @@ -297,7 +297,7 @@ __ia32_find_pp(struct ia64_partial_page_list *ppl, unsigned int start, while (*__rb_link) { __rb_parent = *__rb_link; - pp = rb_entry(__rb_parent, struct ia64_partial_page, pp_rb); + pp = rb_entry(__rb_parent, struct partial_page, pp_rb); if (pp->base == start) { ppl->pp_hint = pp; @@ -314,7 +314,7 @@ __ia32_find_pp(struct ia64_partial_page_list *ppl, unsigned int start, *rb_parent = __rb_parent; *pprev = NULL; if (rb_prev) - *pprev = rb_entry(rb_prev, struct ia64_partial_page, pp_rb); + *pprev = rb_entry(rb_prev, struct partial_page, pp_rb); return NULL; } @@ -322,9 +322,9 @@ __ia32_find_pp(struct ia64_partial_page_list *ppl, unsigned int start, * insert @pp into @ppl. */ static void -__ia32_insert_pp(struct ia64_partial_page_list *ppl, - struct ia64_partial_page *pp, struct ia64_partial_page *prev, - struct rb_node **rb_link, struct rb_node *rb_parent) +__ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp, + struct partial_page *prev, struct rb_node **rb_link, + struct rb_node *rb_parent) { /* link list */ if (prev) { @@ -334,7 +334,7 @@ __ia32_insert_pp(struct ia64_partial_page_list *ppl, ppl->pp_head = pp; if (rb_parent) pp->next = rb_entry(rb_parent, - struct ia64_partial_page, pp_rb); + struct partial_page, pp_rb); else pp->next = NULL; } @@ -350,8 +350,8 @@ __ia32_insert_pp(struct ia64_partial_page_list *ppl, * delete @pp from partial page list @ppl. */ static void -__ia32_delete_pp(struct ia64_partial_page_list *ppl, - struct ia64_partial_page *pp, struct ia64_partial_page *prev) +__ia32_delete_pp(struct partial_page_list *ppl, struct partial_page *pp, + struct partial_page *prev) { if (prev) { prev->next = pp->next; @@ -363,15 +363,15 @@ __ia32_delete_pp(struct ia64_partial_page_list *ppl, ppl->pp_hint = pp->next; } rb_erase(&pp->pp_rb, &ppl->ppl_rb); - kmem_cache_free(ia64_partial_page_cachep, pp); + kmem_cache_free(partial_page_cachep, pp); } -static struct ia64_partial_page * -__pp_prev(struct ia64_partial_page *pp) +static struct partial_page * +__pp_prev(struct partial_page *pp) { struct rb_node *prev = rb_prev(&pp->pp_rb); if (prev) - return rb_entry(prev, struct ia64_partial_page, pp_rb); + return rb_entry(prev, struct partial_page, pp_rb); else return NULL; } @@ -383,7 +383,7 @@ __pp_prev(struct ia64_partial_page *pp) static void __ia32_delete_pp_range(unsigned int start, unsigned int end) { - struct ia64_partial_page *pp, *prev; + struct partial_page *pp, *prev; struct rb_node **rb_link, *rb_parent; if (start >= end) @@ -401,7 +401,7 @@ __ia32_delete_pp_range(unsigned int start, unsigned int end) } while (pp && pp->base < end) { - struct ia64_partial_page *tmp = pp->next; + struct partial_page *tmp = pp->next; __ia32_delete_pp(current->thread.ppl, pp, prev); pp = tmp; } @@ -414,7 +414,7 @@ __ia32_delete_pp_range(unsigned int start, unsigned int end) static int __ia32_set_pp(unsigned int start, unsigned int end, int flags) { - struct ia64_partial_page *pp, *prev; + struct partial_page *pp, *prev; struct rb_node ** rb_link, *rb_parent; unsigned int pstart, start_bit, end_bit, i; @@ -450,8 +450,8 @@ __ia32_set_pp(unsigned int start, unsigned int end, int flags) return 0; } - /* new a ia64_partial_page */ - pp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL); + /* new a partial_page */ + pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); if (!pp) return -ENOMEM; pp->base = pstart; @@ -504,7 +504,7 @@ ia32_set_pp(unsigned int start, unsigned int end, int flags) static int __ia32_unset_pp(unsigned int start, unsigned int end) { - struct ia64_partial_page *pp, *prev; + struct partial_page *pp, *prev; struct rb_node ** rb_link, *rb_parent; unsigned int pstart, start_bit, end_bit, i; struct vm_area_struct *vma; @@ -532,8 +532,8 @@ __ia32_unset_pp(unsigned int start, unsigned int end) return -ENOMEM; } - /* new a ia64_partial_page */ - pp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL); + /* new a partial_page */ + pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); if (!pp) return -ENOMEM; pp->base = pstart; @@ -605,7 +605,7 @@ ia32_unset_pp(unsigned int *startp, unsigned int *endp) static int __ia32_compare_pp(unsigned int start, unsigned int end) { - struct ia64_partial_page *pp, *prev; + struct partial_page *pp, *prev; struct rb_node ** rb_link, *rb_parent; unsigned int pstart, start_bit, end_bit, size; unsigned int first_bit, next_zero_bit; /* the first range in bitmap */ @@ -682,13 +682,13 @@ ia32_compare_pp(unsigned int *startp, unsigned int *endp) } static void -__ia32_drop_pp_list(struct ia64_partial_page_list *ppl) +__ia32_drop_pp_list(struct partial_page_list *ppl) { - struct ia64_partial_page *pp = ppl->pp_head; + struct partial_page *pp = ppl->pp_head; while (pp) { - struct ia64_partial_page *next = pp->next; - kmem_cache_free(ia64_partial_page_cachep, pp); + struct partial_page *next = pp->next; + kmem_cache_free(partial_page_cachep, pp); pp = next; } @@ -696,9 +696,9 @@ __ia32_drop_pp_list(struct ia64_partial_page_list *ppl) } void -ia32_drop_ia64_partial_page_list(struct task_struct *task) +ia32_drop_partial_page_list(struct task_struct *task) { - struct ia64_partial_page_list* ppl = task->thread.ppl; + struct partial_page_list* ppl = task->thread.ppl; if (ppl && atomic_dec_and_test(&ppl->pp_count)) __ia32_drop_pp_list(ppl); @@ -708,9 +708,9 @@ ia32_drop_ia64_partial_page_list(struct task_struct *task) * Copy current->thread.ppl to ppl (already initialized). */ static int -__ia32_copy_pp_list(struct ia64_partial_page_list *ppl) +__ia32_copy_pp_list(struct partial_page_list *ppl) { - struct ia64_partial_page *pp, *tmp, *prev; + struct partial_page *pp, *tmp, *prev; struct rb_node **rb_link, *rb_parent; ppl->pp_head = NULL; @@ -721,7 +721,7 @@ __ia32_copy_pp_list(struct ia64_partial_page_list *ppl) prev = NULL; for (pp = current->thread.ppl->pp_head; pp; pp = pp->next) { - tmp = kmem_cache_alloc(ia64_partial_page_cachep, GFP_KERNEL); + tmp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL); if (!tmp) return -ENOMEM; *tmp = *pp; @@ -734,8 +734,7 @@ __ia32_copy_pp_list(struct ia64_partial_page_list *ppl) } int -ia32_copy_ia64_partial_page_list(struct task_struct *p, - unsigned long clone_flags) +ia32_copy_partial_page_list(struct task_struct *p, unsigned long clone_flags) { int retval = 0; diff --git a/trunk/arch/ia64/kernel/acpi.c b/trunk/arch/ia64/kernel/acpi.c index c6ede8780ded..103dd8edda71 100644 --- a/trunk/arch/ia64/kernel/acpi.c +++ b/trunk/arch/ia64/kernel/acpi.c @@ -67,8 +67,6 @@ EXPORT_SYMBOL(pm_power_off); unsigned int acpi_cpei_override; unsigned int acpi_cpei_phys_cpuid; -unsigned long acpi_wakeup_address = 0; - const char __init * acpi_get_sysname(void) { @@ -988,21 +986,4 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) EXPORT_SYMBOL(acpi_unregister_ioapic); -/* - * acpi_save_state_mem() - save kernel state - * - * TBD when when IA64 starts to support suspend... - */ -int acpi_save_state_mem(void) { return 0; } - -/* - * acpi_restore_state() - */ -void acpi_restore_state_mem(void) {} - -/* - * do_suspend_lowlevel() - */ -void do_suspend_lowlevel(void) {} - #endif /* CONFIG_ACPI */ diff --git a/trunk/arch/ia64/kernel/head.S b/trunk/arch/ia64/kernel/head.S index 4e5e27540e27..44d540efa6d1 100644 --- a/trunk/arch/ia64/kernel/head.S +++ b/trunk/arch/ia64/kernel/head.S @@ -178,7 +178,7 @@ swapper_pg_dir: halt_msg: stringz "Halting kernel\n" - .section .text.head,"ax" + .text .global start_ap @@ -392,8 +392,6 @@ self: hint @pause br.sptk.many self // endless loop END(_start) - .text - GLOBAL_ENTRY(ia64_save_debug_regs) alloc r16=ar.pfs,1,0,0,0 mov r20=ar.lc // preserve ar.lc diff --git a/trunk/arch/ia64/kernel/irq_ia64.c b/trunk/arch/ia64/kernel/irq_ia64.c index fcb77338cc09..91797c111162 100644 --- a/trunk/arch/ia64/kernel/irq_ia64.c +++ b/trunk/arch/ia64/kernel/irq_ia64.c @@ -85,8 +85,8 @@ DEFINE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq) = { [0 ... IA64_NUM_VECTORS - 1] = IA64_SPURIOUS_INT_VECTOR }; -static cpumask_t vector_table[IA64_NUM_VECTORS] = { - [0 ... IA64_NUM_VECTORS - 1] = CPU_MASK_NONE +static cpumask_t vector_table[IA64_MAX_DEVICE_VECTORS] = { + [0 ... IA64_MAX_DEVICE_VECTORS - 1] = CPU_MASK_NONE }; static int irq_status[NR_IRQS] = { @@ -123,18 +123,17 @@ static inline int find_unassigned_irq(void) static inline int find_unassigned_vector(cpumask_t domain) { cpumask_t mask; - int pos, vector; + int pos; cpus_and(mask, domain, cpu_online_map); if (cpus_empty(mask)) return -EINVAL; for (pos = 0; pos < IA64_NUM_DEVICE_VECTORS; pos++) { - vector = IA64_FIRST_DEVICE_VECTOR + pos; - cpus_and(mask, domain, vector_table[vector]); + cpus_and(mask, domain, vector_table[pos]); if (!cpus_empty(mask)) continue; - return vector; + return IA64_FIRST_DEVICE_VECTOR + pos; } return -ENOSPC; } @@ -142,7 +141,7 @@ static inline int find_unassigned_vector(cpumask_t domain) static int __bind_irq_vector(int irq, int vector, cpumask_t domain) { cpumask_t mask; - int cpu; + int cpu, pos; struct irq_cfg *cfg = &irq_cfg[irq]; cpus_and(mask, domain, cpu_online_map); @@ -157,7 +156,8 @@ static int __bind_irq_vector(int irq, int vector, cpumask_t domain) cfg->vector = vector; cfg->domain = domain; irq_status[irq] = IRQ_USED; - cpus_or(vector_table[vector], vector_table[vector], domain); + pos = vector - IA64_FIRST_DEVICE_VECTOR; + cpus_or(vector_table[pos], vector_table[pos], domain); return 0; } @@ -174,7 +174,7 @@ int bind_irq_vector(int irq, int vector, cpumask_t domain) static void __clear_irq_vector(int irq) { - int vector, cpu; + int vector, cpu, pos; cpumask_t mask; cpumask_t domain; struct irq_cfg *cfg = &irq_cfg[irq]; @@ -189,7 +189,8 @@ static void __clear_irq_vector(int irq) cfg->vector = IRQ_VECTOR_UNASSIGNED; cfg->domain = CPU_MASK_NONE; irq_status[irq] = IRQ_UNUSED; - cpus_andnot(vector_table[vector], vector_table[vector], domain); + pos = vector - IA64_FIRST_DEVICE_VECTOR; + cpus_andnot(vector_table[pos], vector_table[pos], domain); } static void clear_irq_vector(int irq) @@ -211,6 +212,9 @@ assign_irq_vector (int irq) vector = -ENOSPC; spin_lock_irqsave(&vector_lock, flags); + if (irq < 0) { + goto out; + } for_each_online_cpu(cpu) { domain = vector_allocation_domain(cpu); vector = find_unassigned_vector(domain); @@ -219,8 +223,6 @@ assign_irq_vector (int irq) } if (vector < 0) goto out; - if (irq == AUTO_ASSIGN) - irq = vector; BUG_ON(__bind_irq_vector(irq, vector, domain)); out: spin_unlock_irqrestore(&vector_lock, flags); diff --git a/trunk/arch/ia64/kernel/machvec.c b/trunk/arch/ia64/kernel/machvec.c index 7ccb228ceedc..13df337508e7 100644 --- a/trunk/arch/ia64/kernel/machvec.c +++ b/trunk/arch/ia64/kernel/machvec.c @@ -13,6 +13,14 @@ struct ia64_machine_vector ia64_mv; EXPORT_SYMBOL(ia64_mv); +static __initdata const char *mvec_name; +static __init int setup_mvec(char *s) +{ + mvec_name = s; + return 0; +} +early_param("machvec", setup_mvec); + static struct ia64_machine_vector * __init lookup_machvec (const char *name) { @@ -33,7 +41,7 @@ machvec_init (const char *name) struct ia64_machine_vector *mv; if (!name) - name = acpi_get_sysname(); + name = mvec_name ? mvec_name : acpi_get_sysname(); mv = lookup_machvec(name); if (!mv) panic("generic kernel failed to find machine vector for" @@ -43,23 +51,6 @@ machvec_init (const char *name) printk(KERN_INFO "booting generic kernel on platform %s\n", name); } -void __init -machvec_init_from_cmdline(const char *cmdline) -{ - char str[64]; - const char *start; - char *end; - - if (! (start = strstr(cmdline, "machvec=")) ) - return machvec_init(NULL); - - strlcpy(str, start + strlen("machvec="), sizeof(str)); - if ( (end = strchr(str, ' ')) ) - *end = '\0'; - - return machvec_init(str); -} - #endif /* CONFIG_IA64_GENERIC */ void diff --git a/trunk/arch/ia64/kernel/process.c b/trunk/arch/ia64/kernel/process.c index 4158906c45aa..fa40cba43350 100644 --- a/trunk/arch/ia64/kernel/process.c +++ b/trunk/arch/ia64/kernel/process.c @@ -499,8 +499,7 @@ copy_thread (int nr, unsigned long clone_flags, /* Copy partially mapped page list */ if (!retval) - retval = ia32_copy_ia64_partial_page_list(p, - clone_flags); + retval = ia32_copy_partial_page_list(p, clone_flags); } #endif @@ -729,7 +728,7 @@ flush_thread (void) ia64_drop_fpu(current); #ifdef CONFIG_IA32_SUPPORT if (IS_IA32_PROCESS(task_pt_regs(current))) { - ia32_drop_ia64_partial_page_list(current); + ia32_drop_partial_page_list(current); current->thread.task_size = IA32_PAGE_OFFSET; set_fs(USER_DS); } @@ -755,7 +754,7 @@ exit_thread (void) pfm_release_debug_registers(current); #endif if (IS_IA32_PROCESS(task_pt_regs(current))) - ia32_drop_ia64_partial_page_list(current); + ia32_drop_partial_page_list(current); } unsigned long diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c index 7cecd2964200..cf06fe799041 100644 --- a/trunk/arch/ia64/kernel/setup.c +++ b/trunk/arch/ia64/kernel/setup.c @@ -491,17 +491,12 @@ setup_arch (char **cmdline_p) efi_init(); io_port_init(); + parse_early_param(); + #ifdef CONFIG_IA64_GENERIC - /* machvec needs to be parsed from the command line - * before parse_early_param() is called to ensure - * that ia64_mv is initialised before any command line - * settings may cause console setup to occur - */ - machvec_init_from_cmdline(*cmdline_p); + machvec_init(NULL); #endif - parse_early_param(); - if (early_console_setup(*cmdline_p) == 0) mark_bsp_online(); diff --git a/trunk/arch/ia64/kernel/smp.c b/trunk/arch/ia64/kernel/smp.c index 0982882bfb80..9f72838db26e 100644 --- a/trunk/arch/ia64/kernel/smp.c +++ b/trunk/arch/ia64/kernel/smp.c @@ -468,7 +468,7 @@ smp_send_stop (void) send_IPI_allbutself(IPI_CPU_STOP); } -int +int __init setup_profiling_timer (unsigned int multiplier) { return -EINVAL; diff --git a/trunk/arch/ia64/kernel/smpboot.c b/trunk/arch/ia64/kernel/smpboot.c index 62209dcf06d3..9f5c90b594b9 100644 --- a/trunk/arch/ia64/kernel/smpboot.c +++ b/trunk/arch/ia64/kernel/smpboot.c @@ -487,7 +487,7 @@ struct create_idle { int cpu; }; -void __cpuinit +void do_fork_idle(struct work_struct *work) { struct create_idle *c_idle = @@ -497,7 +497,7 @@ do_fork_idle(struct work_struct *work) complete(&c_idle->done); } -static int __cpuinit +static int __devinit do_boot_cpu (int sapicid, int cpu) { int timeout; @@ -808,7 +808,7 @@ set_cpu_sibling_map(int cpu) } } -int __cpuinit +int __devinit __cpu_up (unsigned int cpu) { int ret; diff --git a/trunk/arch/ia64/kernel/vmlinux.lds.S b/trunk/arch/ia64/kernel/vmlinux.lds.S index 83e80677de70..860f251d2fc2 100644 --- a/trunk/arch/ia64/kernel/vmlinux.lds.S +++ b/trunk/arch/ia64/kernel/vmlinux.lds.S @@ -50,8 +50,6 @@ SECTIONS KPROBES_TEXT *(.gnu.linkonce.t*) } - .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) - { *(.text.head) } .text2 : AT(ADDR(.text2) - LOAD_OFFSET) { *(.text2) } #ifdef CONFIG_SMP diff --git a/trunk/arch/ia64/pci/pci.c b/trunk/arch/ia64/pci/pci.c index 488e48a5deea..07d0e92742c8 100644 --- a/trunk/arch/ia64/pci/pci.c +++ b/trunk/arch/ia64/pci/pci.c @@ -581,7 +581,7 @@ pcibios_align_resource (void *data, struct resource *res, /* * PCI BIOS setup, always defaults to SAL interface */ -char * __devinit +char * __init pcibios_setup (char *str) { return str; diff --git a/trunk/arch/m68knommu/Kconfig b/trunk/arch/m68knommu/Kconfig index 185906b54cb0..1175ceff8b2a 100644 --- a/trunk/arch/m68knommu/Kconfig +++ b/trunk/arch/m68knommu/Kconfig @@ -216,18 +216,6 @@ config XCOPILOT_BUGS help Support the bugs of Xcopilot. -config UC5272 - bool 'Arcturus Networks uC5272 dimm board support' - depends on M5272 - help - Support for the Arcturus Networks uC5272 dimm board. - -config UC5282 - bool "Arcturus Networks uC5282 board support" - depends on M528x - help - Support for the Arcturus Networks uC5282 dimm board. - config UCSIMM bool "uCsimm module support" depends on M68EZ328 @@ -354,18 +342,6 @@ config SOM5282EM depends on M528x help Support for the EMAC.Inc SOM5282EM module. - -config WILDFIRE - bool "Intec Automation Inc. WildFire board support" - depends on M528x - help - Support for the Intec Automation Inc. WildFire. - -config WILDFIREMOD - bool "Intec Automation Inc. WildFire module support" - depends on M528x - help - Support for the Intec Automation Inc. WildFire module. config ARN5307 bool "Arnewsh 5307 board support" diff --git a/trunk/arch/m68knommu/Makefile b/trunk/arch/m68knommu/Makefile index 1305cc980023..8951793fd8d4 100644 --- a/trunk/arch/m68knommu/Makefile +++ b/trunk/arch/m68knommu/Makefile @@ -26,8 +26,6 @@ platform-$(CONFIG_M5407) := 5407 PLATFORM := $(platform-y) board-$(CONFIG_PILOT) := pilot -board-$(CONFIG_UC5272) := UC5272 -board-$(CONFIG_UC5282) := UC5282 board-$(CONFIG_UCSIMM) := ucsimm board-$(CONFIG_UCDIMM) := ucdimm board-$(CONFIG_UCQUICC) := uCquicc diff --git a/trunk/arch/m68knommu/kernel/dma.c b/trunk/arch/m68knommu/kernel/dma.c index e10eafc52789..0a25874a2aae 100644 --- a/trunk/arch/m68knommu/kernel/dma.c +++ b/trunk/arch/m68knommu/kernel/dma.c @@ -8,7 +8,6 @@ #include #include #include -#include #include void *dma_alloc_coherent(struct device *dev, size_t size, diff --git a/trunk/arch/m68knommu/kernel/setup.c b/trunk/arch/m68knommu/kernel/setup.c index a5ac0d40fbec..2203f694f26b 100644 --- a/trunk/arch/m68knommu/kernel/setup.c +++ b/trunk/arch/m68knommu/kernel/setup.c @@ -132,11 +132,6 @@ void setup_arch(char **cmdline_p) config_BSP(&command_line[0], sizeof(command_line)); -#if defined(CONFIG_BOOTPARAM) - strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line)); - command_line[sizeof(command_line) - 1] = 0; -#endif - printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n"); #ifdef CONFIG_UCDIMM diff --git a/trunk/arch/m68knommu/platform/5206/config.c b/trunk/arch/m68knommu/platform/5206/config.c index d265ed4e5afc..3343830aad10 100644 --- a/trunk/arch/m68knommu/platform/5206/config.c +++ b/trunk/arch/m68knommu/platform/5206/config.c @@ -98,6 +98,14 @@ int mcf_timerirqpending(int timer) void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); + +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_timer_init; mach_tick = coldfire_tick; mach_gettimeoffset = coldfire_timer_offset; diff --git a/trunk/arch/m68knommu/platform/5206e/config.c b/trunk/arch/m68knommu/platform/5206e/config.c index 7fa5e8254c31..0f67320b4031 100644 --- a/trunk/arch/m68knommu/platform/5206e/config.c +++ b/trunk/arch/m68knommu/platform/5206e/config.c @@ -98,10 +98,15 @@ void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); -#if defined(CONFIG_NETtel) +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#elif defined(CONFIG_NETtel) /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0xf0004000, size); commandp[size-1] = 0; +#else + memset(commandp, 0, size); #endif /* CONFIG_NETtel */ mach_sched_init = coldfire_timer_init; diff --git a/trunk/arch/m68knommu/platform/520x/config.c b/trunk/arch/m68knommu/platform/520x/config.c index 85830f9882f3..58b2878deb61 100644 --- a/trunk/arch/m68knommu/platform/520x/config.c +++ b/trunk/arch/m68knommu/platform/520x/config.c @@ -48,6 +48,13 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { +#ifdef CONFIG_BOOTPARAM + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_pit_init; mach_tick = coldfire_pit_tick; mach_gettimeoffset = coldfire_pit_offset; diff --git a/trunk/arch/m68knommu/platform/523x/config.c b/trunk/arch/m68knommu/platform/523x/config.c index c0157e110035..9b054e6caee2 100644 --- a/trunk/arch/m68knommu/platform/523x/config.c +++ b/trunk/arch/m68knommu/platform/523x/config.c @@ -63,6 +63,14 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); + +#ifdef CONFIG_BOOTPARAM + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_pit_init; mach_tick = coldfire_pit_tick; mach_gettimeoffset = coldfire_pit_offset; diff --git a/trunk/arch/m68knommu/platform/5249/config.c b/trunk/arch/m68knommu/platform/5249/config.c index 4cdeb719512d..d6706079d64a 100644 --- a/trunk/arch/m68knommu/platform/5249/config.c +++ b/trunk/arch/m68knommu/platform/5249/config.c @@ -96,6 +96,14 @@ int mcf_timerirqpending(int timer) void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); + +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_timer_init; mach_tick = coldfire_tick; mach_gettimeoffset = coldfire_timer_offset; diff --git a/trunk/arch/m68knommu/platform/5272/config.c b/trunk/arch/m68knommu/platform/5272/config.c index 609b10e4b9b9..6b437cc97776 100644 --- a/trunk/arch/m68knommu/platform/5272/config.c +++ b/trunk/arch/m68knommu/platform/5272/config.c @@ -113,7 +113,10 @@ void config_BSP(char *commandp, int size) mcf_disableall(); -#if defined(CONFIG_NETtel) || defined(CONFIG_SCALES) +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#elif defined(CONFIG_NETtel) || defined(CONFIG_SCALES) /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0xf0004000, size); commandp[size-1] = 0; @@ -125,6 +128,8 @@ void config_BSP(char *commandp, int size) /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0xf0010000, size); commandp[size-1] = 0; +#else + memset(commandp, 0, size); #endif mcf_timervector = 69; diff --git a/trunk/arch/m68knommu/platform/527x/config.c b/trunk/arch/m68knommu/platform/527x/config.c index 126dac066482..28e7d964eef1 100644 --- a/trunk/arch/m68knommu/platform/527x/config.c +++ b/trunk/arch/m68knommu/platform/527x/config.c @@ -63,6 +63,14 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); + +#ifdef CONFIG_BOOTPARAM + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_pit_init; mach_tick = coldfire_pit_tick; mach_gettimeoffset = coldfire_pit_offset; diff --git a/trunk/arch/m68knommu/platform/528x/config.c b/trunk/arch/m68knommu/platform/528x/config.c index aab1ef0c1f78..805b4f74ff19 100644 --- a/trunk/arch/m68knommu/platform/528x/config.c +++ b/trunk/arch/m68knommu/platform/528x/config.c @@ -63,6 +63,14 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); + +#ifdef CONFIG_BOOTPARAM + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + mach_sched_init = coldfire_pit_init; mach_tick = coldfire_pit_tick; mach_gettimeoffset = coldfire_pit_offset; diff --git a/trunk/arch/m68knommu/platform/5307/config.c b/trunk/arch/m68knommu/platform/5307/config.c index 1f10e941b87c..e04b84deb57d 100644 --- a/trunk/arch/m68knommu/platform/5307/config.c +++ b/trunk/arch/m68knommu/platform/5307/config.c @@ -111,7 +111,10 @@ void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); -#if defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || \ defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || \ defined(CONFIG_CLEOPATRA) /* Copy command line from FLASH to local buffer... */ @@ -121,6 +124,8 @@ void config_BSP(char *commandp, int size) mcf_timervector = 30; mcf_profilevector = 31; mcf_timerlevel = 6; +#else + memset(commandp, 0, size); #endif mach_sched_init = coldfire_timer_init; diff --git a/trunk/arch/m68knommu/platform/5307/entry.S b/trunk/arch/m68knommu/platform/5307/entry.S index a8cd867805ca..c358aebe0af3 100644 --- a/trunk/arch/m68knommu/platform/5307/entry.S +++ b/trunk/arch/m68knommu/platform/5307/entry.S @@ -213,12 +213,16 @@ ENTRY(ret_from_interrupt) * Beware - when entering resume, prev (the current task) is * in a0, next (the new task) is in a1,so don't change these * registers until their contents are no longer needed. - * This is always called in supervisor mode, so don't bother to save - * and restore sr; user's process sr is actually in the stack. */ ENTRY(resume) movel %a0, %d1 /* get prev thread in d1 */ + movew %sr,%d0 /* save thread status reg */ + movew %d0,%a0@(TASK_THREAD+THREAD_SR) + + oril #0x700,%d0 /* disable interrupts */ + move %d0,%sr + movel sw_usp,%d0 /* save usp */ movel %d0,%a0@(TASK_THREAD+THREAD_USP) @@ -229,4 +233,7 @@ ENTRY(resume) movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */ movel %a0, sw_usp + + movew %a1@(TASK_THREAD+THREAD_SR),%d0 /* restore thread status reg */ + movew %d0, %sr rts diff --git a/trunk/arch/m68knommu/platform/532x/config.c b/trunk/arch/m68knommu/platform/532x/config.c index dc39c466e33f..664c3a12b0c1 100644 --- a/trunk/arch/m68knommu/platform/532x/config.c +++ b/trunk/arch/m68knommu/platform/532x/config.c @@ -92,7 +92,10 @@ void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); -#if !defined(CONFIG_BOOTPARAM) +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else /* Copy command line from FLASH to local buffer... */ memcpy(commandp, (char *) 0x4000, 4); if(strncmp(commandp, "kcl ", 4) == 0){ diff --git a/trunk/arch/m68knommu/platform/5407/config.c b/trunk/arch/m68knommu/platform/5407/config.c index fde417fdd650..036f62876241 100644 --- a/trunk/arch/m68knommu/platform/5407/config.c +++ b/trunk/arch/m68knommu/platform/5407/config.c @@ -102,6 +102,13 @@ void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); +#if defined(CONFIG_BOOTPARAM) + strncpy(commandp, CONFIG_BOOTPARAM_STRING, size); + commandp[size-1] = 0; +#else + memset(commandp, 0, size); +#endif + #if defined(CONFIG_CLEOPATRA) /* Different timer setup - to prevent device clash */ mcf_timervector = 30; diff --git a/trunk/arch/m68knommu/platform/68VZ328/config.c b/trunk/arch/m68knommu/platform/68VZ328/config.c index 79dced929c97..8abe0f6e7235 100644 --- a/trunk/arch/m68knommu/platform/68VZ328/config.c +++ b/trunk/arch/m68knommu/platform/68VZ328/config.c @@ -191,6 +191,13 @@ void config_BSP(char *command, int size) { printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n"); +#if defined(CONFIG_BOOTPARAM) + strncpy(command, CONFIG_BOOTPARAM_STRING, size); + command[size-1] = 0; +#else + memset(command, 0, size); +#endif + init_hardware(command, size); mach_sched_init = (void *) m68328_timer_init; diff --git a/trunk/arch/powerpc/boot/dts/kuroboxHD.dts b/trunk/arch/powerpc/boot/dts/kuroboxHD.dts index 122537419d9f..a983680c3263 100644 --- a/trunk/arch/powerpc/boot/dts/kuroboxHD.dts +++ b/trunk/arch/powerpc/boot/dts/kuroboxHD.dts @@ -33,10 +33,12 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts" PowerPC,603e { /* Really 8241 */ device_type = "cpu"; reg = <0>; - clock-frequency = ; /* Fixed by bootloader */ - timebase-frequency = <1743000>; /* Fixed by bootloader */ - bus-frequency = <0>; /* Fixed by bootloader */ + clock-frequency = ; /* Fixed by bootwrapper */ + timebase-frequency = <1743000>; /* Fixed by bootwrapper */ + bus-frequency = <0>; /* From bootloader */ /* Following required by dtc but not used */ + i-cache-line-size = <0>; + d-cache-line-size = <0>; i-cache-size = <4000>; d-cache-size = <4000>; }; @@ -62,19 +64,11 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts" fef00000 fef00000 00100000>; /* pci iack */ i2c@80003000 { - #address-cells = <1>; - #size-cells = <0>; device_type = "i2c"; compatible = "fsl-i2c"; reg = <80003000 1000>; interrupts = <5 2>; interrupt-parent = <&mpic>; - - rtc@32 { - device_type = "rtc"; - compatible = "ricoh,rs5c372b"; - reg = <32>; - }; }; serial@80004500 { @@ -97,7 +91,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts" interrupt-parent = <&mpic>; }; - mpic: interrupt-controller@80040000 { + mpic: pic@80040000 { #interrupt-cells = <2>; #address-cells = <0>; device_type = "open-pic"; diff --git a/trunk/arch/powerpc/boot/dts/kuroboxHG.dts b/trunk/arch/powerpc/boot/dts/kuroboxHG.dts index 579aa8b967d9..5cf42dc022df 100644 --- a/trunk/arch/powerpc/boot/dts/kuroboxHG.dts +++ b/trunk/arch/powerpc/boot/dts/kuroboxHG.dts @@ -33,10 +33,12 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts" PowerPC,603e { /* Really 8241 */ device_type = "cpu"; reg = <0>; - clock-frequency = ; /* Fixed by bootloader */ - timebase-frequency = <1F04000>; /* Fixed by bootloader */ - bus-frequency = <0>; /* Fixed by bootloader */ + clock-frequency = ; /* Fixed by bootwrapper */ + timebase-frequency = <1F04000>; /* Fixed by bootwrapper */ + bus-frequency = <0>; /* From bootloader */ /* Following required by dtc but not used */ + i-cache-line-size = <0>; + d-cache-line-size = <0>; i-cache-size = <4000>; d-cache-size = <4000>; }; @@ -62,19 +64,11 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts" fef00000 fef00000 00100000>; /* pci iack */ i2c@80003000 { - #address-cells = <1>; - #size-cells = <0>; device_type = "i2c"; compatible = "fsl-i2c"; reg = <80003000 1000>; interrupts = <5 2>; interrupt-parent = <&mpic>; - - rtc@32 { - device_type = "rtc"; - compatible = "ricoh,rs5c372b"; - reg = <32>; - }; }; serial@80004500 { @@ -97,7 +91,8 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts" interrupt-parent = <&mpic>; }; - mpic: interrupt-controller@80040000 { + mpic: pic@80040000 { + interrupt-parent = <&mpic>; #interrupt-cells = <2>; #address-cells = <0>; device_type = "open-pic"; diff --git a/trunk/arch/powerpc/kernel/head_64.S b/trunk/arch/powerpc/kernel/head_64.S index 1448af92c6a9..8cdd48ea4391 100644 --- a/trunk/arch/powerpc/kernel/head_64.S +++ b/trunk/arch/powerpc/kernel/head_64.S @@ -809,9 +809,8 @@ system_reset_iSeries: mtmsrd r24 /* RI on */ lhz r24,PACAPACAINDEX(r13) /* Get processor # */ cmpwi 0,r24,0 /* Are we processor 0? */ - bne 1f - b .__start_initialization_iSeries /* Start up the first processor */ -1: mfspr r4,SPRN_CTRLF + beq .__start_initialization_iSeries /* Start up the first processor */ + mfspr r4,SPRN_CTRLF li r5,CTRL_RUNLATCH /* Turn off the run light */ andc r4,r4,r5 mtspr SPRN_CTRLT,r4 @@ -1612,7 +1611,7 @@ _GLOBAL(generic_secondary_smp_init) #endif #ifdef CONFIG_PPC_ISERIES -_INIT_STATIC(__start_initialization_iSeries) +_STATIC(__start_initialization_iSeries) /* Clear out the BSS */ LOAD_REG_IMMEDIATE(r11,__bss_stop) LOAD_REG_IMMEDIATE(r8,__bss_start) diff --git a/trunk/arch/powerpc/kernel/iomap.c b/trunk/arch/powerpc/kernel/iomap.c index 2a5cf8680370..601ef79a5916 100644 --- a/trunk/arch/powerpc/kernel/iomap.c +++ b/trunk/arch/powerpc/kernel/iomap.c @@ -7,7 +7,6 @@ #include #include #include -#include /* * Here comes the ppc64 implementation of the IOMAP @@ -137,12 +136,7 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) void pci_iounmap(struct pci_dev *dev, void __iomem *addr) { - if (isa_vaddr_is_ioport(addr)) - return; - if (pcibios_vaddr_is_ioport(addr)) - return; - iounmap(addr); + /* Nothing to do */ } - EXPORT_SYMBOL(pci_iomap); EXPORT_SYMBOL(pci_iounmap); diff --git a/trunk/arch/powerpc/kernel/pci-common.c b/trunk/arch/powerpc/kernel/pci-common.c index 74a8fd450f67..fe7d1255e11e 100644 --- a/trunk/arch/powerpc/kernel/pci-common.c +++ b/trunk/arch/powerpc/kernel/pci-common.c @@ -101,29 +101,6 @@ void pcibios_free_controller(struct pci_controller *phb) kfree(phb); } -int pcibios_vaddr_is_ioport(void __iomem *address) -{ - int ret = 0; - struct pci_controller *hose; - unsigned long size; - - spin_lock(&hose_spinlock); - list_for_each_entry(hose, &hose_list, list_node) { -#ifdef CONFIG_PPC64 - size = hose->pci_io_size; -#else - size = hose->io_resource.end - hose->io_resource.start + 1; -#endif - if (address >= hose->io_base_virt && - address < (hose->io_base_virt + size)) { - ret = 1; - break; - } - } - spin_unlock(&hose_spinlock); - return ret; -} - /* * Return the domain number for this bus. */ diff --git a/trunk/arch/powerpc/kernel/prom_parse.c b/trunk/arch/powerpc/kernel/prom_parse.c index b5c96af955c6..3786dcc8a7b6 100644 --- a/trunk/arch/powerpc/kernel/prom_parse.c +++ b/trunk/arch/powerpc/kernel/prom_parse.c @@ -24,7 +24,7 @@ /* Max address size we deal with */ #define OF_MAX_ADDR_CELLS 4 #define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ - (ns) > 0) + (ns) >= 0) static struct of_bus *of_match_bus(struct device_node *np); static int __of_address_to_resource(struct device_node *dev, diff --git a/trunk/arch/powerpc/kernel/setup-common.c b/trunk/arch/powerpc/kernel/setup-common.c index 50ef38cffdbf..4924c48cb1ff 100644 --- a/trunk/arch/powerpc/kernel/setup-common.c +++ b/trunk/arch/powerpc/kernel/setup-common.c @@ -496,10 +496,6 @@ int check_legacy_ioport(unsigned long base_port) break; } np = of_find_node_by_type(NULL, "8042"); - /* Pegasos has no device_type on its 8042 node, look for the - * name instead */ - if (!np) - np = of_find_node_by_name(NULL, "8042"); break; case FDC_BASE: /* FDC1 */ np = of_find_node_by_type(NULL, "fdc"); diff --git a/trunk/arch/powerpc/mm/lmb.c b/trunk/arch/powerpc/mm/lmb.c index 8f4d2dc4cafb..e3a1e8dc536a 100644 --- a/trunk/arch/powerpc/mm/lmb.c +++ b/trunk/arch/powerpc/mm/lmb.c @@ -138,8 +138,8 @@ void __init lmb_analyze(void) static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base, unsigned long size) { - unsigned long coalesced = 0; - long adjacent, i; + unsigned long i, coalesced = 0; + long adjacent; /* First try and coalesce this LMB with another. */ for (i=0; i < rgn->cnt; i++) { diff --git a/trunk/arch/powerpc/platforms/cell/spufs/context.c b/trunk/arch/powerpc/platforms/cell/spufs/context.c index 9cb081c26e71..6694f86d7000 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/context.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/context.c @@ -59,8 +59,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) INIT_LIST_HEAD(&ctx->aff_list); if (gang) spu_gang_add_ctx(gang, ctx); - - __spu_update_sched_info(ctx); + ctx->cpus_allowed = current->cpus_allowed; spu_set_timeslice(ctx); ctx->stats.util_state = SPU_UTIL_IDLE_LOADED; diff --git a/trunk/arch/powerpc/platforms/cell/spufs/run.c b/trunk/arch/powerpc/platforms/cell/spufs/run.c index 6abdd8fe2098..0b50fa5cb39d 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/run.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/run.c @@ -312,7 +312,6 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event) spu_acquire(ctx); if (ctx->state == SPU_STATE_SAVED) { __spu_update_sched_info(ctx); - spu_set_timeslice(ctx); ret = spu_activate(ctx, 0); if (ret) { @@ -323,9 +322,6 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event) /* * We have to update the scheduling priority under active_mutex * to protect against find_victim(). - * - * No need to update the timeslice ASAP, it will get updated - * once the current one has expired. */ spu_update_sched_info(ctx); } diff --git a/trunk/arch/powerpc/platforms/cell/spufs/sched.c b/trunk/arch/powerpc/platforms/cell/spufs/sched.c index 758a80ac080a..227968b4779d 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/sched.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/sched.c @@ -927,6 +927,10 @@ int __init spu_sched_init(void) INIT_LIST_HEAD(&spu_prio->runq[i]); __clear_bit(i, spu_prio->bitmap); } + for (i = 0; i < MAX_NUMNODES; i++) { + mutex_init(&cbe_spu_info[i].list_mutex); + INIT_LIST_HEAD(&cbe_spu_info[i].spus); + } spin_lock_init(&spu_prio->runq_lock); setup_timer(&spusched_timer, spusched_wake, 0); diff --git a/trunk/arch/powerpc/platforms/iseries/lpevents.c b/trunk/arch/powerpc/platforms/iseries/lpevents.c index 34bdbbe3ce59..91df52a1899a 100644 --- a/trunk/arch/powerpc/platforms/iseries/lpevents.c +++ b/trunk/arch/powerpc/platforms/iseries/lpevents.c @@ -182,7 +182,7 @@ static int set_spread_lpevents(char *str) } __setup("spread_lpevents=", set_spread_lpevents); -void __init setup_hvlpevent_queue(void) +void setup_hvlpevent_queue(void) { void *eventStack; diff --git a/trunk/arch/powerpc/platforms/maple/pci.c b/trunk/arch/powerpc/platforms/maple/pci.c index 2542403288f9..fceaae40fe70 100644 --- a/trunk/arch/powerpc/platforms/maple/pci.c +++ b/trunk/arch/powerpc/platforms/maple/pci.c @@ -490,9 +490,6 @@ static int __init maple_add_bridge(struct device_node *dev) /* Fixup "bus-range" OF property */ fixup_bus_range(dev); - /* Check for legacy IOs */ - isa_bridge_find_early(hose); - return 0; } diff --git a/trunk/arch/powerpc/sysdev/fsl_pci.c b/trunk/arch/powerpc/sysdev/fsl_pci.c index 51c223385feb..87122275c9b4 100644 --- a/trunk/arch/powerpc/sysdev/fsl_pci.c +++ b/trunk/arch/powerpc/sysdev/fsl_pci.c @@ -216,7 +216,7 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary) /* check PCI express link status */ if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) { - hose->indirect_type = PPC_INDIRECT_TYPE_EXT_REG | + hose->indirect_type |= PPC_INDIRECT_TYPE_EXT_REG | PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS; if (fsl_pcie_check_link(hose)) hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK; diff --git a/trunk/arch/powerpc/sysdev/fsl_soc.c b/trunk/arch/powerpc/sysdev/fsl_soc.c index 727453d3e8b9..3289fab01e92 100644 --- a/trunk/arch/powerpc/sysdev/fsl_soc.c +++ b/trunk/arch/powerpc/sysdev/fsl_soc.c @@ -305,64 +305,6 @@ static int __init gfar_of_init(void) arch_initcall(gfar_of_init); -#ifdef CONFIG_I2C_BOARDINFO -#include -struct i2c_driver_device { - char *of_device; - char *i2c_driver; - char *i2c_type; -}; - -static struct i2c_driver_device i2c_devices[] __initdata = { - {"ricoh,rs5c372a", "rtc-rs5c372", "rs5c372a",}, - {"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",}, - {"ricoh,rv5c386", "rtc-rs5c372", "rv5c386",}, - {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",}, -}; - -static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info) -{ - int i; - - for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) { - if (!of_device_is_compatible(node, i2c_devices[i].of_device)) - continue; - strncpy(info->driver_name, i2c_devices[i].i2c_driver, KOBJ_NAME_LEN); - strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE); - return 0; - } - return -ENODEV; -} - -static void __init of_register_i2c_devices(struct device_node *adap_node, int bus_num) -{ - struct device_node *node = NULL; - - while ((node = of_get_next_child(adap_node, node))) { - struct i2c_board_info info; - const u32 *addr; - int len; - - addr = of_get_property(node, "reg", &len); - if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) { - printk(KERN_WARNING "fsl_ioc.c: invalid i2c device entry\n"); - continue; - } - - info.irq = irq_of_parse_and_map(node, 0); - if (info.irq == NO_IRQ) - info.irq = -1; - - if (of_find_i2c_driver(node, &info) < 0) - continue; - - info.platform_data = NULL; - info.addr = *addr; - - i2c_register_board_info(bus_num, &info, 1); - } -} - static int __init fsl_i2c_of_init(void) { struct device_node *np; @@ -407,8 +349,6 @@ static int __init fsl_i2c_of_init(void) fsl_i2c_platform_data)); if (ret) goto unreg; - - of_register_i2c_devices(np, i); } return 0; @@ -420,7 +360,6 @@ static int __init fsl_i2c_of_init(void) } arch_initcall(fsl_i2c_of_init); -#endif #ifdef CONFIG_PPC_83xx static int __init mpc83xx_wdt_init(void) diff --git a/trunk/arch/powerpc/sysdev/indirect_pci.c b/trunk/arch/powerpc/sysdev/indirect_pci.c index a8ac2dfdd3d4..5294560c7b00 100644 --- a/trunk/arch/powerpc/sysdev/indirect_pci.c +++ b/trunk/arch/powerpc/sysdev/indirect_pci.c @@ -160,4 +160,5 @@ setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data, u32 mbase = ioremap(cfg_data & PAGE_MASK, PAGE_SIZE); hose->cfg_data = mbase + (cfg_data & ~PAGE_MASK); hose->ops = &indirect_pci_ops; + hose->indirect_type = flags; } diff --git a/trunk/arch/x86_64/kernel/acpi/Makefile b/trunk/arch/x86_64/kernel/acpi/Makefile index 17595d23fee7..080b9963f1bc 100644 --- a/trunk/arch/x86_64/kernel/acpi/Makefile +++ b/trunk/arch/x86_64/kernel/acpi/Makefile @@ -1,6 +1,6 @@ obj-y := boot.o boot-y := ../../../i386/kernel/acpi/boot.o -obj-y += sleep.o wakeup.o +obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o ifneq ($(CONFIG_ACPI_PROCESSOR),) obj-y += processor.o diff --git a/trunk/arch/x86_64/kernel/acpi/sleep.c b/trunk/arch/x86_64/kernel/acpi/sleep.c index 79475d237071..4277f2b27e6d 100644 --- a/trunk/arch/x86_64/kernel/acpi/sleep.c +++ b/trunk/arch/x86_64/kernel/acpi/sleep.c @@ -51,6 +51,8 @@ Low-Level Sleep Support -------------------------------------------------------------------------- */ +#ifdef CONFIG_ACPI_SLEEP + /* address in low memory of the wakeup routine. */ unsigned long acpi_wakeup_address = 0; unsigned long acpi_realmode_flags; @@ -115,6 +117,8 @@ static int __init acpi_sleep_setup(char *str) __setup("acpi_sleep=", acpi_sleep_setup); +#endif /*CONFIG_ACPI_SLEEP */ + void acpi_pci_link_exit(void) { } diff --git a/trunk/arch/x86_64/kernel/head.S b/trunk/arch/x86_64/kernel/head.S index 3a16e417dd8d..e89abcdbdde8 100644 --- a/trunk/arch/x86_64/kernel/head.S +++ b/trunk/arch/x86_64/kernel/head.S @@ -120,7 +120,7 @@ ident_complete: addq %rbp, trampoline_level4_pgt + 0(%rip) addq %rbp, trampoline_level4_pgt + (511*8)(%rip) #endif -#ifdef CONFIG_ACPI +#ifdef CONFIG_ACPI_SLEEP addq %rbp, wakeup_level4_pgt + 0(%rip) addq %rbp, wakeup_level4_pgt + (511*8)(%rip) #endif diff --git a/trunk/arch/x86_64/kernel/setup.c b/trunk/arch/x86_64/kernel/setup.c index 0f400f3c4694..af838f6b0b7f 100644 --- a/trunk/arch/x86_64/kernel/setup.c +++ b/trunk/arch/x86_64/kernel/setup.c @@ -333,7 +333,7 @@ void __init setup_arch(char **cmdline_p) reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, 2*PAGE_SIZE); #endif -#ifdef CONFIG_ACPI +#ifdef CONFIG_ACPI_SLEEP /* * Reserve low memory region for sleep support. */ diff --git a/trunk/drivers/acpi/Kconfig b/trunk/drivers/acpi/Kconfig index 251344cb29ae..408b45168aba 100644 --- a/trunk/drivers/acpi/Kconfig +++ b/trunk/drivers/acpi/Kconfig @@ -11,9 +11,6 @@ menuconfig ACPI depends on PCI depends on PM select PNP - # for sleep - select HOTPLUG_CPU if X86 && SMP - select SUSPEND_SMP if X86 && SMP default y ---help--- Advanced Configuration and Power Interface (ACPI) support for @@ -45,26 +42,51 @@ menuconfig ACPI if ACPI +config ACPI_SLEEP + bool "Sleep States" + depends on X86 && (!SMP || SUSPEND_SMP) + default y + ---help--- + This option adds support for ACPI suspend states. + + With this option, you will be able to put the system "to sleep". + Sleep states are low power states for the system and devices. All + of the system operating state is saved to either memory or disk + (depending on the state), to allow the system to resume operation + quickly at your request. + + Although this option sounds really nifty, barely any of the device + drivers have been converted to the new driver model and hence few + have proper power management support. + + This option is not recommended for anyone except those doing driver + power management development. + +config ACPI_SLEEP_PROC_FS + bool + depends on ACPI_SLEEP && PROC_FS + default y + +config ACPI_SLEEP_PROC_SLEEP + bool "/proc/acpi/sleep (deprecated)" + depends on ACPI_SLEEP_PROC_FS + default n + ---help--- + Create /proc/acpi/sleep + Deprecated by /sys/power/state + config ACPI_PROCFS - bool "Deprecated /proc/acpi files" - depends on PROC_FS + bool "Procfs interface (deprecated)" + default y ---help--- - For backwards compatibility, this option allows - depricated /proc/acpi/ files to exist, even when - they have been replaced by functions in /sys. - The deprecated files (and their replacements) include: - - /proc/acpi/sleep (/sys/power/state) - /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) - /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) - /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) - /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) - /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) - - This option has no effect on /proc/acpi/ files - and functions which do not yet exist in /sys. - - Say N to delete /proc/acpi/ files that have moved to /sys/ + The Procfs interface for ACPI is made optional for backward compatibility. + As the same functions are duplicated in the sysfs interface + and this proc interface will be removed some time later, + it's marked as deprecated. + ( /proc/acpi/debug_layer && debug_level are deprecated by + /sys/module/acpi/parameters/debug_layer && debug_level. + /proc/acpi/info is deprecated by + /sys/module/acpi/parameters/acpica_version ) config ACPI_AC tristate "AC Adapter" diff --git a/trunk/drivers/acpi/ac.c b/trunk/drivers/acpi/ac.c index d8b35093527a..37c7dc4f9fe5 100644 --- a/trunk/drivers/acpi/ac.c +++ b/trunk/drivers/acpi/ac.c @@ -34,6 +34,7 @@ #define ACPI_AC_COMPONENT 0x00020000 #define ACPI_AC_CLASS "ac_adapter" +#define ACPI_AC_HID "ACPI0003" #define ACPI_AC_DEVICE_NAME "AC Adapter" #define ACPI_AC_FILE_STATE "state" #define ACPI_AC_NOTIFY_STATUS 0x80 @@ -55,16 +56,10 @@ static int acpi_ac_add(struct acpi_device *device); static int acpi_ac_remove(struct acpi_device *device, int type); static int acpi_ac_open_fs(struct inode *inode, struct file *file); -const static struct acpi_device_id ac_device_ids[] = { - {"ACPI0003", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, ac_device_ids); - static struct acpi_driver acpi_ac_driver = { .name = "ac", .class = ACPI_AC_CLASS, - .ids = ac_device_ids, + .ids = ACPI_AC_HID, .ops = { .add = acpi_ac_add, .remove = acpi_ac_remove, diff --git a/trunk/drivers/acpi/acpi_memhotplug.c b/trunk/drivers/acpi/acpi_memhotplug.c index 5f1127ad5a95..e65628a03085 100644 --- a/trunk/drivers/acpi/acpi_memhotplug.c +++ b/trunk/drivers/acpi/acpi_memhotplug.c @@ -53,16 +53,10 @@ static int acpi_memory_device_add(struct acpi_device *device); static int acpi_memory_device_remove(struct acpi_device *device, int type); static int acpi_memory_device_start(struct acpi_device *device); -static const struct acpi_device_id memory_device_ids[] = { - {ACPI_MEMORY_DEVICE_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, memory_device_ids); - static struct acpi_driver acpi_memory_device_driver = { .name = "acpi_memhotplug", .class = ACPI_MEMORY_DEVICE_CLASS, - .ids = memory_device_ids, + .ids = ACPI_MEMORY_DEVICE_HID, .ops = { .add = acpi_memory_device_add, .remove = acpi_memory_device_remove, diff --git a/trunk/drivers/acpi/asus_acpi.c b/trunk/drivers/acpi/asus_acpi.c index 9c4bd220c44f..3cd79caad70c 100644 --- a/trunk/drivers/acpi/asus_acpi.c +++ b/trunk/drivers/acpi/asus_acpi.c @@ -56,6 +56,7 @@ #define ACPI_HOTK_NAME "Asus Laptop ACPI Extras Driver" #define ACPI_HOTK_CLASS "hotkey" #define ACPI_HOTK_DEVICE_NAME "Hotkey" +#define ACPI_HOTK_HID "ATK0100" /* * Some events we use, same for all Asus @@ -425,20 +426,14 @@ static struct acpi_table_header *asus_info; static struct asus_hotk *hotk; /* - * The hotkey driver and autoloading declaration + * The hotkey driver declaration */ static int asus_hotk_add(struct acpi_device *device); static int asus_hotk_remove(struct acpi_device *device, int type); -static const struct acpi_device_id asus_device_ids[] = { - {"ATK0100", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, asus_device_ids); - static struct acpi_driver asus_hotk_driver = { .name = "asus_acpi", .class = ACPI_HOTK_CLASS, - .ids = asus_device_ids, + .ids = ACPI_HOTK_HID, .ops = { .add = asus_hotk_add, .remove = asus_hotk_remove, diff --git a/trunk/drivers/acpi/battery.c b/trunk/drivers/acpi/battery.c index 81651032791b..cad932de383d 100644 --- a/trunk/drivers/acpi/battery.c +++ b/trunk/drivers/acpi/battery.c @@ -41,6 +41,7 @@ #define ACPI_BATTERY_COMPONENT 0x00040000 #define ACPI_BATTERY_CLASS "battery" +#define ACPI_BATTERY_HID "PNP0C0A" #define ACPI_BATTERY_DEVICE_NAME "Battery" #define ACPI_BATTERY_NOTIFY_STATUS 0x80 #define ACPI_BATTERY_NOTIFY_INFO 0x81 @@ -73,16 +74,10 @@ static int acpi_battery_add(struct acpi_device *device); static int acpi_battery_remove(struct acpi_device *device, int type); static int acpi_battery_resume(struct acpi_device *device); -static const struct acpi_device_id battery_device_ids[] = { - {"PNP0C0A", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, battery_device_ids); - static struct acpi_driver acpi_battery_driver = { .name = "battery", .class = ACPI_BATTERY_CLASS, - .ids = battery_device_ids, + .ids = ACPI_BATTERY_HID, .ops = { .add = acpi_battery_add, .resume = acpi_battery_resume, diff --git a/trunk/drivers/acpi/button.c b/trunk/drivers/acpi/button.c index 540581338ef5..cb4110b50cd0 100644 --- a/trunk/drivers/acpi/button.c +++ b/trunk/drivers/acpi/button.c @@ -66,16 +66,6 @@ MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI Button Driver"); MODULE_LICENSE("GPL"); -static const struct acpi_device_id button_device_ids[] = { - {ACPI_BUTTON_HID_LID, 0}, - {ACPI_BUTTON_HID_SLEEP, 0}, - {ACPI_BUTTON_HID_SLEEPF, 0}, - {ACPI_BUTTON_HID_POWER, 0}, - {ACPI_BUTTON_HID_POWERF, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, button_device_ids); - static int acpi_button_add(struct acpi_device *device); static int acpi_button_remove(struct acpi_device *device, int type); static int acpi_button_info_open_fs(struct inode *inode, struct file *file); @@ -84,7 +74,7 @@ static int acpi_button_state_open_fs(struct inode *inode, struct file *file); static struct acpi_driver acpi_button_driver = { .name = "button", .class = ACPI_BUTTON_CLASS, - .ids = button_device_ids, + .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E", .ops = { .add = acpi_button_add, .remove = acpi_button_remove, diff --git a/trunk/drivers/acpi/container.c b/trunk/drivers/acpi/container.c index 3c25ec7a1871..0dd3bf7c0ed1 100644 --- a/trunk/drivers/acpi/container.c +++ b/trunk/drivers/acpi/container.c @@ -52,18 +52,10 @@ MODULE_LICENSE("GPL"); static int acpi_container_add(struct acpi_device *device); static int acpi_container_remove(struct acpi_device *device, int type); -static const struct acpi_device_id container_device_ids[] = { - {"ACPI0004", 0}, - {"PNP0A05", 0}, - {"PNP0A06", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, container_device_ids); - static struct acpi_driver acpi_container_driver = { .name = "container", .class = ACPI_CONTAINER_CLASS, - .ids = container_device_ids, + .ids = "ACPI0004,PNP0A05,PNP0A06", .ops = { .add = acpi_container_add, .remove = acpi_container_remove, diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index 469f3f57f881..10e851021eca 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -41,6 +41,7 @@ #include #define ACPI_EC_CLASS "embedded_controller" +#define ACPI_EC_HID "PNP0C09" #define ACPI_EC_DEVICE_NAME "Embedded Controller" #define ACPI_EC_FILE_INFO "info" @@ -81,15 +82,10 @@ static int acpi_ec_start(struct acpi_device *device); static int acpi_ec_stop(struct acpi_device *device, int type); static int acpi_ec_add(struct acpi_device *device); -static const struct acpi_device_id ec_device_ids[] = { - {"PNP0C09", 0}, - {"", 0}, -}; - static struct acpi_driver acpi_ec_driver = { .name = "ec", .class = ACPI_EC_CLASS, - .ids = ec_device_ids, + .ids = ACPI_EC_HID, .ops = { .add = acpi_ec_add, .remove = acpi_ec_remove, diff --git a/trunk/drivers/acpi/events/evrgnini.c b/trunk/drivers/acpi/events/evrgnini.c index b1aaa0e84588..23ee7bc4a705 100644 --- a/trunk/drivers/acpi/events/evrgnini.c +++ b/trunk/drivers/acpi/events/evrgnini.c @@ -378,7 +378,7 @@ static u8 acpi_ev_match_pci_root_bridge(char *id) static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) { acpi_status status; - struct acpica_device_id hid; + struct acpi_device_id hid; struct acpi_compatible_id_list *cid; acpi_native_uint i; diff --git a/trunk/drivers/acpi/fan.c b/trunk/drivers/acpi/fan.c index c81f6bdb68b8..ec655c539492 100644 --- a/trunk/drivers/acpi/fan.c +++ b/trunk/drivers/acpi/fan.c @@ -50,16 +50,10 @@ static int acpi_fan_remove(struct acpi_device *device, int type); static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state); static int acpi_fan_resume(struct acpi_device *device); -static const struct acpi_device_id fan_device_ids[] = { - {"PNP0C0B", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, fan_device_ids); - static struct acpi_driver acpi_fan_driver = { .name = "fan", .class = ACPI_FAN_CLASS, - .ids = fan_device_ids, + .ids = "PNP0C0B", .ops = { .add = acpi_fan_add, .remove = acpi_fan_remove, diff --git a/trunk/drivers/acpi/namespace/nsxfeval.c b/trunk/drivers/acpi/namespace/nsxfeval.c index ab65b2c2560e..be4f2899de74 100644 --- a/trunk/drivers/acpi/namespace/nsxfeval.c +++ b/trunk/drivers/acpi/namespace/nsxfeval.c @@ -440,7 +440,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, acpi_status status; struct acpi_namespace_node *node; u32 flags; - struct acpica_device_id hid; + struct acpi_device_id hid; struct acpi_compatible_id_list *cid; acpi_native_uint i; diff --git a/trunk/drivers/acpi/pci_link.c b/trunk/drivers/acpi/pci_link.c index c9f526e55392..3448edd61dc4 100644 --- a/trunk/drivers/acpi/pci_link.c +++ b/trunk/drivers/acpi/pci_link.c @@ -46,6 +46,7 @@ #define _COMPONENT ACPI_PCI_COMPONENT ACPI_MODULE_NAME("pci_link"); #define ACPI_PCI_LINK_CLASS "pci_irq_routing" +#define ACPI_PCI_LINK_HID "PNP0C0F" #define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link" #define ACPI_PCI_LINK_FILE_INFO "info" #define ACPI_PCI_LINK_FILE_STATUS "state" @@ -53,16 +54,10 @@ ACPI_MODULE_NAME("pci_link"); static int acpi_pci_link_add(struct acpi_device *device); static int acpi_pci_link_remove(struct acpi_device *device, int type); -static struct acpi_device_id link_device_ids[] = { - {"PNP0C0F", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, link_device_ids); - static struct acpi_driver acpi_pci_link_driver = { .name = "pci_link", .class = ACPI_PCI_LINK_CLASS, - .ids = link_device_ids, + .ids = ACPI_PCI_LINK_HID, .ops = { .add = acpi_pci_link_add, .remove = acpi_pci_link_remove, diff --git a/trunk/drivers/acpi/pci_root.c b/trunk/drivers/acpi/pci_root.c index f14ff1ffab29..ad4145a37786 100644 --- a/trunk/drivers/acpi/pci_root.c +++ b/trunk/drivers/acpi/pci_root.c @@ -38,21 +38,16 @@ #define _COMPONENT ACPI_PCI_COMPONENT ACPI_MODULE_NAME("pci_root"); #define ACPI_PCI_ROOT_CLASS "pci_bridge" +#define ACPI_PCI_ROOT_HID "PNP0A03" #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" static int acpi_pci_root_add(struct acpi_device *device); static int acpi_pci_root_remove(struct acpi_device *device, int type); static int acpi_pci_root_start(struct acpi_device *device); -static struct acpi_device_id root_device_ids[] = { - {"PNP0A03", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, root_device_ids); - static struct acpi_driver acpi_pci_root_driver = { .name = "pci_root", .class = ACPI_PCI_ROOT_CLASS, - .ids = root_device_ids, + .ids = ACPI_PCI_ROOT_HID, .ops = { .add = acpi_pci_root_add, .remove = acpi_pci_root_remove, diff --git a/trunk/drivers/acpi/power.c b/trunk/drivers/acpi/power.c index 57b9a2998fd0..4ffecd179702 100644 --- a/trunk/drivers/acpi/power.c +++ b/trunk/drivers/acpi/power.c @@ -59,16 +59,10 @@ static int acpi_power_remove(struct acpi_device *device, int type); static int acpi_power_resume(struct acpi_device *device); static int acpi_power_open_fs(struct inode *inode, struct file *file); -static struct acpi_device_id power_device_ids[] = { - {ACPI_POWER_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, power_device_ids); - static struct acpi_driver acpi_power_driver = { .name = "power", .class = ACPI_POWER_CLASS, - .ids = power_device_ids, + .ids = ACPI_POWER_HID, .ops = { .add = acpi_power_add, .remove = acpi_power_remove, diff --git a/trunk/drivers/acpi/processor_core.c b/trunk/drivers/acpi/processor_core.c index 498422343f38..81aceb5da7c7 100644 --- a/trunk/drivers/acpi/processor_core.c +++ b/trunk/drivers/acpi/processor_core.c @@ -88,16 +88,10 @@ static int acpi_processor_handle_eject(struct acpi_processor *pr); extern int acpi_processor_tstate_has_changed(struct acpi_processor *pr); -static const struct acpi_device_id processor_device_ids[] = { - {ACPI_PROCESSOR_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, processor_device_ids); - static struct acpi_driver acpi_processor_driver = { .name = "processor", .class = ACPI_PROCESSOR_CLASS, - .ids = processor_device_ids, + .ids = ACPI_PROCESSOR_HID, .ops = { .add = acpi_processor_add, .remove = acpi_processor_remove, diff --git a/trunk/drivers/acpi/processor_throttling.c b/trunk/drivers/acpi/processor_throttling.c index 0b8204e7082a..3f55d1f90c11 100644 --- a/trunk/drivers/acpi/processor_throttling.c +++ b/trunk/drivers/acpi/processor_throttling.c @@ -47,9 +47,6 @@ ACPI_MODULE_NAME("processor_throttling"); static int acpi_processor_get_throttling(struct acpi_processor *pr); int acpi_processor_set_throttling(struct acpi_processor *pr, int state); -/* - * _TPC - Throttling Present Capabilities - */ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) { acpi_status status = 0; @@ -58,10 +55,8 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) if (!pr) return -EINVAL; status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); - if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); - } + if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { + ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC")); return -ENODEV; } pr->throttling_platform_limit = (int)tpc; @@ -73,9 +68,9 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr) return acpi_processor_get_platform_limit(pr); } -/* - * _PTC - Processor Throttling Control (and status) register location - */ +/* -------------------------------------------------------------------------- + _PTC, _TSS, _TSD support + -------------------------------------------------------------------------- */ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) { int result = 0; @@ -86,9 +81,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); - } + ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC")); return -ENODEV; } @@ -139,10 +132,6 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr) return result; } - -/* - * _TSS - Throttling Supported States - */ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) { int result = 0; @@ -155,9 +144,7 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); - } + ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS")); return -ENODEV; } @@ -214,10 +201,6 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) return result; } - -/* - * _TSD - T-State Dependencies - */ static int acpi_processor_get_tsd(struct acpi_processor *pr) { int result = 0; @@ -230,9 +213,6 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer); if (ACPI_FAILURE(status)) { - if (status != AE_NOT_FOUND) { - ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD")); - } return -ENODEV; } @@ -545,6 +525,9 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) int result = 0; int step = 0; int i = 0; + int no_ptc = 0; + int no_tss = 0; + int no_tsd = 0; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", @@ -555,14 +538,12 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) if (!pr) return -EINVAL; - /* - * Evaluate _PTC, _TSS and _TPC - * They must all be present or none of them can be used. - */ - if (acpi_processor_get_throttling_control(pr) || - acpi_processor_get_throttling_states(pr) || - acpi_processor_get_platform_limit(pr)) - { + /* TBD: Support ACPI 2.0 objects */ + no_ptc = acpi_processor_get_throttling_control(pr); + no_tss = acpi_processor_get_throttling_states(pr); + no_tsd = acpi_processor_get_tsd(pr); + + if (no_ptc || no_tss) { pr->throttling.acpi_processor_get_throttling = &acpi_processor_get_throttling_fadt; pr->throttling.acpi_processor_set_throttling = @@ -574,8 +555,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) &acpi_processor_set_throttling_ptc; } - acpi_processor_get_tsd(pr); - if (!pr->throttling.address) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n")); return 0; @@ -679,20 +658,18 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq, pr->throttling.state_count - 1); seq_puts(seq, "states:\n"); - if (pr->throttling.acpi_processor_get_throttling == - acpi_processor_get_throttling_fadt) { + if (acpi_processor_get_throttling == acpi_processor_get_throttling_fadt) for (i = 0; i < pr->throttling.state_count; i++) seq_printf(seq, " %cT%d: %02d%%\n", (i == pr->throttling.state ? '*' : ' '), i, (pr->throttling.states[i].performance ? pr-> throttling.states[i].performance / 10 : 0)); - } else { + else for (i = 0; i < pr->throttling.state_count; i++) seq_printf(seq, " %cT%d: %02d%%\n", (i == pr->throttling.state ? '*' : ' '), i, (int)pr->throttling.states_tss[i]. freqpercentage); - } end: return 0; diff --git a/trunk/drivers/acpi/sbs.c b/trunk/drivers/acpi/sbs.c index 7d8e78ea13a5..974d00ccfe84 100644 --- a/trunk/drivers/acpi/sbs.c +++ b/trunk/drivers/acpi/sbs.c @@ -38,6 +38,7 @@ #define ACPI_SBS_CLASS "sbs" #define ACPI_AC_CLASS "ac_adapter" #define ACPI_BATTERY_CLASS "battery" +#define ACPI_SBS_HID "ACPI0002" #define ACPI_SBS_DEVICE_NAME "Smart Battery System" #define ACPI_SBS_FILE_INFO "info" #define ACPI_SBS_FILE_STATE "state" @@ -123,17 +124,10 @@ static int acpi_sbs_add(struct acpi_device *device); static int acpi_sbs_remove(struct acpi_device *device, int type); static int acpi_sbs_resume(struct acpi_device *device); -static const struct acpi_device_id sbs_device_ids[] = { - {"ACPI0001", 0}, - {"ACPI0005", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, sbs_device_ids); - static struct acpi_driver acpi_sbs_driver = { .name = "sbs", .class = ACPI_SBS_CLASS, - .ids = sbs_device_ids, + .ids = "ACPI0001,ACPI0005", .ops = { .add = acpi_sbs_add, .remove = acpi_sbs_remove, diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c index be74347d1354..6b3b8a522476 100644 --- a/trunk/drivers/acpi/scan.c +++ b/trunk/drivers/acpi/scan.c @@ -16,7 +16,7 @@ ACPI_MODULE_NAME("scan"); extern struct acpi_device *acpi_root; #define ACPI_BUS_CLASS "system_bus" -#define ACPI_BUS_HID "LNXSYBUS" +#define ACPI_BUS_HID "ACPI_BUS" #define ACPI_BUS_DEVICE_NAME "System Bus" static LIST_HEAD(acpi_device_list); @@ -29,62 +29,6 @@ struct acpi_device_bus_id{ unsigned int instance_no; struct list_head node; }; - -/* - * Creates hid/cid(s) string needed for modalias and uevent - * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get: - * char *modalias: "acpi:IBM0001:ACPI0001" -*/ -int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size){ - - int len; - - if (!acpi_dev->flags.hardware_id) - return -ENODEV; - - len = snprintf(modalias, size, "acpi:%s:", - acpi_dev->pnp.hardware_id); - if (len < 0 || len >= size) - return -EINVAL; - size -= len; - - if (acpi_dev->flags.compatible_ids) { - struct acpi_compatible_id_list *cid_list; - int i; - int count; - - cid_list = acpi_dev->pnp.cid_list; - for (i = 0; i < cid_list->count; i++) { - count = snprintf(&modalias[len], size, "%s:", - cid_list->id[i].value); - if (count < 0 || count >= size) { - printk(KERN_ERR "acpi: %s cid[%i] exceeds event buffer size", - acpi_dev->pnp.device_name, i); - break; - } - len += count; - size -= count; - } - } - - modalias[len] = '\0'; - return len; -} - -static ssize_t -acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct acpi_device *acpi_dev = to_acpi_device(dev); - int len; - - /* Device has no HID and no CID or string is >1024 */ - len = create_modalias(acpi_dev, buf, 1024); - if (len <= 0) - return 0; - buf[len++] = '\n'; - return len; -} -static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL); - static int acpi_eject_operation(acpi_handle handle, int lockable) { struct acpi_object_list arg_list; @@ -210,12 +154,6 @@ static int acpi_device_setup_files(struct acpi_device *dev) goto end; } - if (dev->flags.hardware_id || dev->flags.compatible_ids){ - result = device_create_file(&dev->dev, &dev_attr_modalias); - if(result) - goto end; - } - /* * If device has _EJ0, 'eject' file is created that is used to trigger * hot-removal function from userland. @@ -240,9 +178,6 @@ static void acpi_device_remove_files(struct acpi_device *dev) if (ACPI_SUCCESS(status)) device_remove_file(&dev->dev, &dev_attr_eject); - if (dev->flags.hardware_id || dev->flags.compatible_ids) - device_remove_file(&dev->dev, &dev_attr_modalias); - if(dev->flags.hardware_id) device_remove_file(&dev->dev, &dev_attr_hid); if(dev->handle) @@ -251,37 +186,6 @@ static void acpi_device_remove_files(struct acpi_device *dev) /* -------------------------------------------------------------------------- ACPI Bus operations -------------------------------------------------------------------------- */ - -int acpi_match_device_ids(struct acpi_device *device, - const struct acpi_device_id *ids) -{ - const struct acpi_device_id *id; - - if (device->flags.hardware_id) { - for (id = ids; id->id[0]; id++) { - if (!strcmp((char*)id->id, device->pnp.hardware_id)) - return 0; - } - } - - if (device->flags.compatible_ids) { - struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; - int i; - - for (id = ids; id->id[0]; id++) { - /* compare multiple _CID entries against driver ids */ - for (i = 0; i < cid_list->count; i++) { - if (!strcmp((char*)id->id, - cid_list->id[i].value)) - return 0; - } - } - } - - return -ENOENT; -} -EXPORT_SYMBOL(acpi_match_device_ids); - static void acpi_device_release(struct device *dev) { struct acpi_device *acpi_dev = to_acpi_device(dev); @@ -315,19 +219,37 @@ static int acpi_bus_match(struct device *dev, struct device_driver *drv) struct acpi_device *acpi_dev = to_acpi_device(dev); struct acpi_driver *acpi_drv = to_acpi_driver(drv); - return !acpi_match_device_ids(acpi_dev, acpi_drv->ids); + return !acpi_match_ids(acpi_dev, acpi_drv->ids); } static int acpi_device_uevent(struct device *dev, char **envp, int num_envp, - char *buffer, int buffer_size) + char *buffer, int buffer_size) { struct acpi_device *acpi_dev = to_acpi_device(dev); + int i = 0, length = 0, ret = 0; + + if (acpi_dev->flags.hardware_id) + ret = add_uevent_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "HWID=%s", acpi_dev->pnp.hardware_id); + if (ret) + return -ENOMEM; + if (acpi_dev->flags.compatible_ids) { + int j; + struct acpi_compatible_id_list *cid_list; - strcpy(buffer, "MODALIAS="); - if (create_modalias(acpi_dev, buffer + 9, buffer_size - 9) > 0) { - envp[0] = buffer; - envp[1] = NULL; + cid_list = acpi_dev->pnp.cid_list; + + for (j = 0; j < cid_list->count; j++) { + ret = add_uevent_var(envp, num_envp, &i, buffer, + buffer_size, &length, "COMPTID=%s", + cid_list->id[j].value); + if (ret) + return -ENOMEM; + } } + + envp[i] = NULL; return 0; } @@ -621,6 +543,25 @@ void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context) return; } +int acpi_match_ids(struct acpi_device *device, char *ids) +{ + if (device->flags.hardware_id) + if (strstr(ids, device->pnp.hardware_id)) + return 0; + + if (device->flags.compatible_ids) { + struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; + int i; + + /* compare multiple _CID entries against driver ids */ + for (i = 0; i < cid_list->count; i++) { + if (strstr(ids, cid_list->id[i].value)) + return 0; + } + } + return -ENOENT; +} + static int acpi_bus_get_perf_flags(struct acpi_device *device) { device->performance.state = ACPI_STATE_UNKNOWN; @@ -683,13 +624,6 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; union acpi_object *package = NULL; - struct acpi_device_id button_device_ids[] = { - {"PNP0C0D", 0}, - {"PNP0C0C", 0}, - {"PNP0C0E", 0}, - {"", 0}, - }; - /* _PRW */ status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); @@ -709,7 +643,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) device->wakeup.flags.valid = 1; /* Power button, Lid switch always enable wakeup */ - if (!acpi_match_device_ids(device, button_device_ids)) + if (!acpi_match_ids(device, "PNP0C0D,PNP0C0C,PNP0C0E")) device->wakeup.flags.run_wake = 1; end: diff --git a/trunk/drivers/acpi/sleep/Makefile b/trunk/drivers/acpi/sleep/Makefile index 01a993a1d086..d6c017709c85 100644 --- a/trunk/drivers/acpi/sleep/Makefile +++ b/trunk/drivers/acpi/sleep/Makefile @@ -1,5 +1,5 @@ obj-y := poweroff.o wakeup.o -obj-y += main.o -obj-$(CONFIG_X86) += proc.o +obj-$(CONFIG_ACPI_SLEEP) += main.o +obj-$(CONFIG_ACPI_SLEEP_PROC_FS) += proc.o EXTRA_CFLAGS += $(ACPI_CFLAGS) diff --git a/trunk/drivers/acpi/sleep/main.c b/trunk/drivers/acpi/sleep/main.c index ab21357c5c7b..3279e72a94f8 100644 --- a/trunk/drivers/acpi/sleep/main.c +++ b/trunk/drivers/acpi/sleep/main.c @@ -34,55 +34,35 @@ static u32 acpi_suspend_states[] = { static int init_8259A_after_S1; -extern int acpi_sleep_prepare(u32 acpi_state); -extern void acpi_power_off(void); - -static u32 acpi_target_sleep_state = ACPI_STATE_S0; - -/** - * acpi_pm_set_target - Set the target system sleep state to the state - * associated with given @pm_state, if supported. - */ - -static int acpi_pm_set_target(suspend_state_t pm_state) -{ - u32 acpi_state = acpi_suspend_states[pm_state]; - int error = 0; - - if (sleep_states[acpi_state]) { - acpi_target_sleep_state = acpi_state; - } else { - printk(KERN_ERR "ACPI does not support this state: %d\n", - pm_state); - error = -ENOSYS; - } - return error; -} - /** * acpi_pm_prepare - Do preliminary suspend work. - * @pm_state: ignored + * @pm_state: suspend state we're entering. * - * If necessary, set the firmware waking vector and do arch-specific - * nastiness to get the wakeup code to the waking vector. + * Make sure we support the state. If we do, and we need it, set the + * firmware waking vector and do arch-specific nastiness to get the + * wakeup code to the waking vector. */ +extern int acpi_sleep_prepare(u32 acpi_state); +extern void acpi_power_off(void); + static int acpi_pm_prepare(suspend_state_t pm_state) { - int error = acpi_sleep_prepare(acpi_target_sleep_state); - - if (error) - acpi_target_sleep_state = ACPI_STATE_S0; + u32 acpi_state = acpi_suspend_states[pm_state]; - return error; + if (!sleep_states[acpi_state]) { + printk("acpi_pm_prepare does not support %d \n", pm_state); + return -EPERM; + } + return acpi_sleep_prepare(acpi_state); } /** * acpi_pm_enter - Actually enter a sleep state. - * @pm_state: ignored + * @pm_state: State we're entering. * - * Flush caches and go to sleep. For STR we have to call arch-specific - * assembly, which in turn call acpi_enter_sleep_state(). + * Flush caches and go to sleep. For STR or STD, we have to call + * arch-specific assembly, which in turn call acpi_enter_sleep_state(). * It's unfortunate, but it works. Please fix if you're feeling frisky. */ @@ -90,31 +70,31 @@ static int acpi_pm_enter(suspend_state_t pm_state) { acpi_status status = AE_OK; unsigned long flags = 0; - u32 acpi_state = acpi_target_sleep_state; + u32 acpi_state = acpi_suspend_states[pm_state]; ACPI_FLUSH_CPU_CACHE(); /* Do arch specific saving of state. */ - if (acpi_state == ACPI_STATE_S3) { + if (pm_state > PM_SUSPEND_STANDBY) { int error = acpi_save_state_mem(); - - if (error) { - acpi_target_sleep_state = ACPI_STATE_S0; + if (error) return error; - } } local_irq_save(flags); acpi_enable_wakeup_device(acpi_state); - switch (acpi_state) { - case ACPI_STATE_S1: + switch (pm_state) { + case PM_SUSPEND_STANDBY: barrier(); status = acpi_enter_sleep_state(acpi_state); break; - case ACPI_STATE_S3: + case PM_SUSPEND_MEM: do_suspend_lowlevel(); break; + + default: + return -EINVAL; } /* ACPI 3.0 specs (P62) says that it's the responsabilty @@ -127,8 +107,12 @@ static int acpi_pm_enter(suspend_state_t pm_state) local_irq_restore(flags); printk(KERN_DEBUG "Back to C!\n"); - /* restore processor state */ - if (acpi_state == ACPI_STATE_S3) + /* restore processor state + * We should only be here if we're coming back from STR or STD. + * And, in the case of the latter, the memory image should have already + * been loaded from disk. + */ + if (pm_state > PM_SUSPEND_STANDBY) acpi_restore_state_mem(); return ACPI_SUCCESS(status) ? 0 : -EFAULT; @@ -136,7 +120,7 @@ static int acpi_pm_enter(suspend_state_t pm_state) /** * acpi_pm_finish - Finish up suspend sequence. - * @pm_state: ignored + * @pm_state: State we're coming out of. * * This is called after we wake back up (or if entering the sleep state * failed). @@ -144,7 +128,7 @@ static int acpi_pm_enter(suspend_state_t pm_state) static int acpi_pm_finish(suspend_state_t pm_state) { - u32 acpi_state = acpi_target_sleep_state; + u32 acpi_state = acpi_suspend_states[pm_state]; acpi_leave_sleep_state(acpi_state); acpi_disable_wakeup_device(acpi_state); @@ -152,14 +136,10 @@ static int acpi_pm_finish(suspend_state_t pm_state) /* reset firmware waking vector */ acpi_set_firmware_waking_vector((acpi_physical_address) 0); - acpi_target_sleep_state = ACPI_STATE_S0; - -#ifdef CONFIG_X86 if (init_8259A_after_S1) { printk("Broken toshiba laptop -> kicking interrupts\n"); init_8259A(0); } -#endif return 0; } @@ -196,7 +176,6 @@ static int acpi_pm_state_valid(suspend_state_t pm_state) static struct pm_ops acpi_pm_ops = { .valid = acpi_pm_state_valid, - .set_target = acpi_pm_set_target, .prepare = acpi_pm_prepare, .enter = acpi_pm_enter, .finish = acpi_pm_finish, @@ -256,81 +235,6 @@ static struct hibernation_ops acpi_hibernation_ops = { }; #endif /* CONFIG_SOFTWARE_SUSPEND */ -/** - * acpi_pm_device_sleep_state - return preferred power state of ACPI device - * in the system sleep state given by %acpi_target_sleep_state - * @dev: device to examine - * @wake: if set, the device should be able to wake up the system - * @d_min_p: used to store the upper limit of allowed states range - * Return value: preferred power state of the device on success, -ENODEV on - * failure (ie. if there's no 'struct acpi_device' for @dev) - * - * Find the lowest power (highest number) ACPI device power state that - * device @dev can be in while the system is in the sleep state represented - * by %acpi_target_sleep_state. If @wake is nonzero, the device should be - * able to wake up the system from this sleep state. If @d_min_p is set, - * the highest power (lowest number) device power state of @dev allowed - * in this system sleep state is stored at the location pointed to by it. - * - * The caller must ensure that @dev is valid before using this function. - * The caller is also responsible for figuring out if the device is - * supposed to be able to wake up the system and passing this information - * via @wake. - */ - -int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) -{ - acpi_handle handle = DEVICE_ACPI_HANDLE(dev); - struct acpi_device *adev; - char acpi_method[] = "_SxD"; - unsigned long d_min, d_max; - - if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { - printk(KERN_ERR "ACPI handle has no context!\n"); - return -ENODEV; - } - - acpi_method[2] = '0' + acpi_target_sleep_state; - /* - * If the sleep state is S0, we will return D3, but if the device has - * _S0W, we will use the value from _S0W - */ - d_min = ACPI_STATE_D0; - d_max = ACPI_STATE_D3; - - /* - * If present, _SxD methods return the minimum D-state (highest power - * state) we can use for the corresponding S-states. Otherwise, the - * minimum D-state is D0 (ACPI 3.x). - * - * NOTE: We rely on acpi_evaluate_integer() not clobbering the integer - * provided -- that's our fault recovery, we ignore retval. - */ - if (acpi_target_sleep_state > ACPI_STATE_S0) - acpi_evaluate_integer(handle, acpi_method, NULL, &d_min); - - /* - * If _PRW says we can wake up the system from the target sleep state, - * the D-state returned by _SxD is sufficient for that (we assume a - * wakeup-aware driver if wake is set). Still, if _SxW exists - * (ACPI 3.x), it should return the maximum (lowest power) D-state that - * can wake the system. _S0W may be valid, too. - */ - if (acpi_target_sleep_state == ACPI_STATE_S0 || - (wake && adev->wakeup.state.enabled && - adev->wakeup.sleep_state <= acpi_target_sleep_state)) { - acpi_method[3] = 'W'; - acpi_evaluate_integer(handle, acpi_method, NULL, &d_max); - /* Sanity check */ - if (d_max < d_min) - d_min = d_max; - } - - if (d_min_p) - *d_min_p = d_min; - return d_max; -} - /* * Toshiba fails to preserve interrupts over S1, reinitialization * of 8259 is needed after S1 resume. diff --git a/trunk/drivers/acpi/sleep/poweroff.c b/trunk/drivers/acpi/sleep/poweroff.c index b3f68ef0669e..39e40d56b034 100644 --- a/trunk/drivers/acpi/sleep/poweroff.c +++ b/trunk/drivers/acpi/sleep/poweroff.c @@ -18,6 +18,7 @@ int acpi_sleep_prepare(u32 acpi_state) { +#ifdef CONFIG_ACPI_SLEEP /* do we have a wakeup address for S2 and S3? */ if (acpi_state == ACPI_STATE_S3) { if (!acpi_wakeup_address) { @@ -30,6 +31,7 @@ int acpi_sleep_prepare(u32 acpi_state) } ACPI_FLUSH_CPU_CACHE(); acpi_enable_wakeup_device_prep(acpi_state); +#endif acpi_gpe_sleep_prepare(acpi_state); acpi_enter_sleep_state_prep(acpi_state); return 0; diff --git a/trunk/drivers/acpi/sleep/proc.c b/trunk/drivers/acpi/sleep/proc.c index ed58e1168aed..61f1822cc350 100644 --- a/trunk/drivers/acpi/sleep/proc.c +++ b/trunk/drivers/acpi/sleep/proc.c @@ -14,16 +14,8 @@ #include "sleep.h" #define _COMPONENT ACPI_SYSTEM_COMPONENT - -/* - * this file provides support for: - * /proc/acpi/sleep - * /proc/acpi/alarm - * /proc/acpi/wakeup - */ - ACPI_MODULE_NAME("sleep") -#ifdef CONFIG_ACPI_PROCFS +#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP static int acpi_system_sleep_seq_show(struct seq_file *seq, void *offset) { int i; @@ -76,7 +68,7 @@ acpi_system_write_sleep(struct file *file, Done: return error ? error : count; } -#endif /* CONFIG_ACPI_PROCFS */ +#endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) /* use /sys/class/rtc/rtcX/wakealarm instead; it's not ACPI-specific */ @@ -471,7 +463,7 @@ static const struct file_operations acpi_system_wakeup_device_fops = { .release = single_release, }; -#ifdef CONFIG_ACPI_PROCFS +#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP static const struct file_operations acpi_system_sleep_fops = { .open = acpi_system_sleep_open_fs, .read = seq_read, @@ -479,7 +471,7 @@ static const struct file_operations acpi_system_sleep_fops = { .llseek = seq_lseek, .release = single_release, }; -#endif /* CONFIG_ACPI_PROCFS */ +#endif /* CONFIG_ACPI_SLEEP_PROC_SLEEP */ #ifdef HAVE_ACPI_LEGACY_ALARM static const struct file_operations acpi_system_alarm_fops = { @@ -506,14 +498,14 @@ static int __init acpi_sleep_proc_init(void) if (acpi_disabled) return 0; -#ifdef CONFIG_ACPI_PROCFS +#ifdef CONFIG_ACPI_SLEEP_PROC_SLEEP /* 'sleep' [R/W] */ entry = create_proc_entry("sleep", S_IFREG | S_IRUGO | S_IWUSR, acpi_root_dir); if (entry) entry->proc_fops = &acpi_system_sleep_fops; -#endif /* CONFIG_ACPI_PROCFS */ +#endif #ifdef HAVE_ACPI_LEGACY_ALARM /* 'alarm' [R/W] */ diff --git a/trunk/drivers/acpi/sleep/wakeup.c b/trunk/drivers/acpi/sleep/wakeup.c index 97c27ddb144d..fab8f2694f03 100644 --- a/trunk/drivers/acpi/sleep/wakeup.c +++ b/trunk/drivers/acpi/sleep/wakeup.c @@ -17,6 +17,7 @@ ACPI_MODULE_NAME("wakeup_devices") extern struct list_head acpi_wakeup_device_list; extern spinlock_t acpi_device_lock; +#ifdef CONFIG_ACPI_SLEEP /** * acpi_enable_wakeup_device_prep - prepare wakeup devices * @sleep_state: ACPI state @@ -179,6 +180,7 @@ static int __init acpi_wakeup_device_init(void) } late_initcall(acpi_wakeup_device_init); +#endif /* * Disable all wakeup GPEs before entering requested sleep state. diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 5a62de1b7f2a..58f1338981bc 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -92,16 +92,10 @@ static int acpi_thermal_polling_open_fs(struct inode *inode, struct file *file); static ssize_t acpi_thermal_write_polling(struct file *, const char __user *, size_t, loff_t *); -static const struct acpi_device_id thermal_device_ids[] = { - {ACPI_THERMAL_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, thermal_device_ids); - static struct acpi_driver acpi_thermal_driver = { .name = "thermal", .class = ACPI_THERMAL_CLASS, - .ids = thermal_device_ids, + .ids = ACPI_THERMAL_HID, .ops = { .add = acpi_thermal_add, .remove = acpi_thermal_remove, diff --git a/trunk/drivers/acpi/utilities/uteval.c b/trunk/drivers/acpi/utilities/uteval.c index 0042b7e78b26..f112af433e36 100644 --- a/trunk/drivers/acpi/utilities/uteval.c +++ b/trunk/drivers/acpi/utilities/uteval.c @@ -407,7 +407,7 @@ acpi_ut_copy_id_string(char *destination, char *source, acpi_size max_length) acpi_status acpi_ut_execute_HID(struct acpi_namespace_node *device_node, - struct acpica_device_id *hid) + struct acpi_device_id *hid) { union acpi_operand_object *obj_desc; acpi_status status; @@ -609,7 +609,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node, acpi_status acpi_ut_execute_UID(struct acpi_namespace_node *device_node, - struct acpica_device_id *uid) + struct acpi_device_id *uid) { union acpi_operand_object *obj_desc; acpi_status status; diff --git a/trunk/drivers/acpi/video.c b/trunk/drivers/acpi/video.c index d98701941981..04ea697f72bf 100644 --- a/trunk/drivers/acpi/video.c +++ b/trunk/drivers/acpi/video.c @@ -74,16 +74,10 @@ MODULE_LICENSE("GPL"); static int acpi_video_bus_add(struct acpi_device *device); static int acpi_video_bus_remove(struct acpi_device *device, int type); -static const struct acpi_device_id video_device_ids[] = { - {ACPI_VIDEO_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, video_device_ids); - static struct acpi_driver acpi_video_bus = { .name = "video", .class = ACPI_VIDEO_CLASS, - .ids = video_device_ids, + .ids = ACPI_VIDEO_HID, .ops = { .add = acpi_video_bus_add, .remove = acpi_video_bus_remove, diff --git a/trunk/drivers/char/hpet.c b/trunk/drivers/char/hpet.c index 9a2694e5f8b9..ba0e74ad74bb 100644 --- a/trunk/drivers/char/hpet.c +++ b/trunk/drivers/char/hpet.c @@ -1007,15 +1007,9 @@ static int hpet_acpi_remove(struct acpi_device *device, int type) return -EINVAL; } -static const struct acpi_device_id hpet_device_ids[] = { - {"PNP0103", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, hpet_device_ids); - static struct acpi_driver hpet_acpi_driver = { .name = "hpet", - .ids = hpet_device_ids, + .ids = "PNP0103", .ops = { .add = hpet_acpi_add, .remove = hpet_acpi_remove, diff --git a/trunk/drivers/input/misc/atlas_btns.c b/trunk/drivers/input/misc/atlas_btns.c index e43e92fd9e23..0acc3a123604 100644 --- a/trunk/drivers/input/misc/atlas_btns.c +++ b/trunk/drivers/input/misc/atlas_btns.c @@ -31,6 +31,7 @@ #define ACPI_ATLAS_NAME "Atlas ACPI" #define ACPI_ATLAS_CLASS "Atlas" +#define ACPI_ATLAS_BUTTON_HID "ASIM0000" static struct input_dev *input_dev; @@ -129,16 +130,10 @@ static int atlas_acpi_button_remove(struct acpi_device *device, int type) return status; } -static const struct acpi_device_id atlas_device_ids[] = { - {"ASIM0000", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, atlas_device_ids); - static struct acpi_driver atlas_acpi_driver = { .name = ACPI_ATLAS_NAME, .class = ACPI_ATLAS_CLASS, - .ids = atlas_device_ids, + .ids = ACPI_ATLAS_BUTTON_HID, .ops = { .add = atlas_acpi_button_add, .remove = atlas_acpi_button_remove, diff --git a/trunk/drivers/kvm/kvm_main.c b/trunk/drivers/kvm/kvm_main.c index 96856097d15b..bcbe6835beb4 100644 --- a/trunk/drivers/kvm/kvm_main.c +++ b/trunk/drivers/kvm/kvm_main.c @@ -297,6 +297,9 @@ static struct kvm *kvm_create_vm(void) kvm_io_bus_init(&kvm->pio_bus); spin_lock_init(&kvm->lock); INIT_LIST_HEAD(&kvm->active_mmu_pages); + spin_lock(&kvm_lock); + list_add(&kvm->vm_list, &vm_list); + spin_unlock(&kvm_lock); kvm_io_bus_init(&kvm->mmio_bus); for (i = 0; i < KVM_MAX_VCPUS; ++i) { struct kvm_vcpu *vcpu = &kvm->vcpus[i]; @@ -306,9 +309,6 @@ static struct kvm *kvm_create_vm(void) vcpu->kvm = kvm; vcpu->mmu.root_hpa = INVALID_PAGE; } - spin_lock(&kvm_lock); - list_add(&kvm->vm_list, &vm_list); - spin_unlock(&kvm_lock); return kvm; } @@ -1070,16 +1070,18 @@ static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa, return 0; mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT); virt = kmap_atomic(page, KM_USER0); - kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes); - memcpy(virt + offset_in_page(gpa), val, bytes); + if (memcmp(virt + offset_in_page(gpa), val, bytes)) { + kvm_mmu_pte_write(vcpu, gpa, virt + offset, val, bytes); + memcpy(virt + offset_in_page(gpa), val, bytes); + } kunmap_atomic(virt, KM_USER0); return 1; } -static int emulator_write_emulated_onepage(unsigned long addr, - const void *val, - unsigned int bytes, - struct x86_emulate_ctxt *ctxt) +static int emulator_write_emulated(unsigned long addr, + const void *val, + unsigned int bytes, + struct x86_emulate_ctxt *ctxt) { struct kvm_vcpu *vcpu = ctxt->vcpu; struct kvm_io_device *mmio_dev; @@ -1111,26 +1113,6 @@ static int emulator_write_emulated_onepage(unsigned long addr, return X86EMUL_CONTINUE; } -static int emulator_write_emulated(unsigned long addr, - const void *val, - unsigned int bytes, - struct x86_emulate_ctxt *ctxt) -{ - /* Crossing a page boundary? */ - if (((addr + bytes - 1) ^ addr) & PAGE_MASK) { - int rc, now; - - now = -addr & ~PAGE_MASK; - rc = emulator_write_emulated_onepage(addr, val, now, ctxt); - if (rc != X86EMUL_CONTINUE) - return rc; - addr += now; - val += now; - bytes -= now; - } - return emulator_write_emulated_onepage(addr, val, bytes, ctxt); -} - static int emulator_cmpxchg_emulated(unsigned long addr, const void *old, const void *new, @@ -2432,9 +2414,9 @@ static void cpuid_fix_nx_cap(struct kvm_vcpu *vcpu) break; } } - if (entry && (entry->edx & (1 << 20)) && !(efer & EFER_NX)) { + if (entry && (entry->edx & EFER_NX) && !(efer & EFER_NX)) { entry->edx &= ~(1 << 20); - printk(KERN_INFO "kvm: guest NX capability removed\n"); + printk(KERN_INFO ": guest NX capability removed\n"); } } diff --git a/trunk/drivers/kvm/x86_emulate.c b/trunk/drivers/kvm/x86_emulate.c index 1f979cb0df31..1b800fc00342 100644 --- a/trunk/drivers/kvm/x86_emulate.c +++ b/trunk/drivers/kvm/x86_emulate.c @@ -1178,8 +1178,6 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) twobyte_insn: switch (b) { case 0x01: /* lgdt, lidt, lmsw */ - /* Disable writeback. */ - no_wb = 1; switch (modrm_reg) { u16 size; unsigned long address; diff --git a/trunk/drivers/misc/asus-laptop.c b/trunk/drivers/misc/asus-laptop.c index d0fc4fd212e6..6b89854bd3ff 100644 --- a/trunk/drivers/misc/asus-laptop.c +++ b/trunk/drivers/misc/asus-laptop.c @@ -53,6 +53,7 @@ #define ASUS_HOTK_NAME "Asus Laptop Support" #define ASUS_HOTK_CLASS "hotkey" #define ASUS_HOTK_DEVICE_NAME "Hotkey" +#define ASUS_HOTK_HID "ATK0100" #define ASUS_HOTK_FILE "asus-laptop" #define ASUS_HOTK_PREFIX "\\_SB.ATKD." @@ -196,18 +197,12 @@ static struct asus_hotk *hotk; /* * The hotkey driver declaration */ -static const struct acpi_device_id asus_device_ids[] = { - {"ATK0100", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, asus_device_ids); - static int asus_hotk_add(struct acpi_device *device); static int asus_hotk_remove(struct acpi_device *device, int type); static struct acpi_driver asus_hotk_driver = { .name = ASUS_HOTK_NAME, .class = ASUS_HOTK_CLASS, - .ids = asus_device_ids, + .ids = ASUS_HOTK_HID, .ops = { .add = asus_hotk_add, .remove = asus_hotk_remove, diff --git a/trunk/drivers/misc/sony-laptop.c b/trunk/drivers/misc/sony-laptop.c index 14ee06c8f127..303e48ca0e8a 100644 --- a/trunk/drivers/misc/sony-laptop.c +++ b/trunk/drivers/misc/sony-laptop.c @@ -1124,22 +1124,10 @@ static int sony_nc_remove(struct acpi_device *device, int type) return 0; } -static const struct acpi_device_id sony_device_ids[] = { - {SONY_NC_HID, 0}, - {SONY_PIC_HID, 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, sony_device_ids); - -static const struct acpi_device_id sony_nc_device_ids[] = { - {SONY_NC_HID, 0}, - {"", 0}, -}; - static struct acpi_driver sony_nc_driver = { .name = SONY_NC_DRIVER_NAME, .class = SONY_NC_CLASS, - .ids = sony_nc_device_ids, + .ids = SONY_NC_HID, .owner = THIS_MODULE, .ops = { .add = sony_nc_add, @@ -2482,15 +2470,10 @@ static int sony_pic_resume(struct acpi_device *device) return 0; } -static const struct acpi_device_id sony_pic_device_ids[] = { - {SONY_PIC_HID, 0}, - {"", 0}, -}; - static struct acpi_driver sony_pic_driver = { .name = SONY_PIC_DRIVER_NAME, .class = SONY_PIC_CLASS, - .ids = sony_pic_device_ids, + .ids = SONY_PIC_HID, .owner = THIS_MODULE, .ops = { .add = sony_pic_add, diff --git a/trunk/drivers/misc/thinkpad_acpi.c b/trunk/drivers/misc/thinkpad_acpi.c index fa80f355e522..f15a58f7403f 100644 --- a/trunk/drivers/misc/thinkpad_acpi.c +++ b/trunk/drivers/misc/thinkpad_acpi.c @@ -411,13 +411,12 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) sprintf(ibm->acpi->driver->name, "%s_%s", IBM_NAME, ibm->name); ibm->acpi->driver->ids = ibm->acpi->hid; - ibm->acpi->driver->ops.add = &tpacpi_device_add; rc = acpi_bus_register_driver(ibm->acpi->driver); if (rc < 0) { printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n", - ibm->name, rc); + ibm->acpi->hid, rc); kfree(ibm->acpi->driver); ibm->acpi->driver = NULL; } else if (!rc) @@ -1317,13 +1316,8 @@ static int hotkey_write(char *buf) return res; } -static const struct acpi_device_id ibm_htk_device_ids[] = { - {IBM_HKEY_HID, 0}, - {"", 0}, -}; - static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = { - .hid = ibm_htk_device_ids, + .hid = IBM_HKEY_HID, .notify = hotkey_notify, .handle = &hkey_handle, .type = ACPI_DEVICE_NOTIFY, @@ -2086,11 +2080,6 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ /* don't list other alternatives as we install a notify handler on the 570 */ IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ -static const struct acpi_device_id ibm_pci_device_ids[] = { - {PCI_ROOT_HID_STRING, 0}, - {"", 0}, -}; - static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { { .notify = dock_notify, @@ -2101,7 +2090,7 @@ static struct tp_acpi_drv_struct ibm_dock_acpidriver[2] = { /* THIS ONE MUST NEVER BE USED FOR DRIVER AUTOLOADING. * We just use it to get notifications of dock hotplug * in very old thinkpads */ - .hid = ibm_pci_device_ids, + .hid = PCI_ROOT_HID_STRING, .notify = dock_notify, .handle = &pci_handle, .type = ACPI_SYSTEM_NOTIFY, @@ -2160,8 +2149,7 @@ static int __init dock_init2(struct ibm_init_struct *iibm) static void dock_notify(struct ibm_struct *ibm, u32 event) { int docked = dock_docked(); - int pci = ibm->acpi->hid && ibm->acpi->device && - acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids); + int pci = ibm->acpi->hid && strstr(ibm->acpi->hid, PCI_ROOT_HID_STRING); if (event == 1 && !pci) /* 570 */ acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ diff --git a/trunk/drivers/misc/thinkpad_acpi.h b/trunk/drivers/misc/thinkpad_acpi.h index 88af089d6494..b7a4a888cc8b 100644 --- a/trunk/drivers/misc/thinkpad_acpi.h +++ b/trunk/drivers/misc/thinkpad_acpi.h @@ -193,7 +193,7 @@ static void thinkpad_acpi_module_exit(void); struct ibm_struct; struct tp_acpi_drv_struct { - const struct acpi_device_id *hid; + char *hid; struct acpi_driver *driver; void (*notify) (struct ibm_struct *, u32); diff --git a/trunk/drivers/pci/pci-acpi.c b/trunk/drivers/pci/pci-acpi.c index 67c63d1f1582..c8062494009f 100644 --- a/trunk/drivers/pci/pci-acpi.c +++ b/trunk/drivers/pci/pci-acpi.c @@ -245,33 +245,16 @@ EXPORT_SYMBOL(pci_osc_control_set); * currently we simply return _SxD, if present. */ -static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev, - pm_message_t state) +static int acpi_pci_choose_state(struct pci_dev *pdev, pm_message_t state) { - int acpi_state; - - acpi_state = acpi_pm_device_sleep_state(&pdev->dev, - device_may_wakeup(&pdev->dev), NULL); - if (acpi_state < 0) - return PCI_POWER_ERROR; - - switch (acpi_state) { - case ACPI_STATE_D0: - return PCI_D0; - case ACPI_STATE_D1: - return PCI_D1; - case ACPI_STATE_D2: - return PCI_D2; - case ACPI_STATE_D3: - return PCI_D3hot; - } - return PCI_POWER_ERROR; + /* TBD */ + + return -ENODEV; } static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) { acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); - acpi_handle tmp; static int state_conv[] = { [0] = 0, [1] = 1, @@ -283,9 +266,6 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) if (!handle) return -ENODEV; - /* If the ACPI device has _EJ0, ignore the device */ - if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp))) - return 0; return acpi_bus_set_power(handle, acpi_state); } diff --git a/trunk/drivers/pci/pci.c b/trunk/drivers/pci/pci.c index fba319d6fcc8..c95485398687 100644 --- a/trunk/drivers/pci/pci.c +++ b/trunk/drivers/pci/pci.c @@ -499,7 +499,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) return 0; } -pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); +int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); /** * pci_choose_state - Choose the power state of a PCI device @@ -513,15 +513,15 @@ pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) { - pci_power_t ret; + int ret; if (!pci_find_capability(dev, PCI_CAP_ID_PM)) return PCI_D0; if (platform_pci_choose_state) { ret = platform_pci_choose_state(dev, state); - if (ret != PCI_POWER_ERROR) - return ret; + if (ret >= 0) + state.event = ret; } switch (state.event) { diff --git a/trunk/drivers/pci/pci.h b/trunk/drivers/pci/pci.h index c6e132d7c0f7..7b696cd66dc5 100644 --- a/trunk/drivers/pci/pci.h +++ b/trunk/drivers/pci/pci.h @@ -12,7 +12,7 @@ extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, resource_size_t, resource_size_t), void *alignf_data); /* Firmware callbacks */ -extern pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); +extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state); extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); diff --git a/trunk/drivers/pnp/driver.c b/trunk/drivers/pnp/driver.c index 1432806451cd..e161423b4300 100644 --- a/trunk/drivers/pnp/driver.c +++ b/trunk/drivers/pnp/driver.c @@ -167,8 +167,6 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state) return error; } - if (pnp_dev->protocol && pnp_dev->protocol->suspend) - pnp_dev->protocol->suspend(pnp_dev, state); return 0; } @@ -181,9 +179,6 @@ static int pnp_bus_resume(struct device *dev) if (!pnp_drv) return 0; - if (pnp_dev->protocol && pnp_dev->protocol->resume) - pnp_dev->protocol->resume(pnp_dev); - if (!(pnp_drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) { error = pnp_start_dev(pnp_dev); if (error) diff --git a/trunk/drivers/pnp/pnpacpi/core.c b/trunk/drivers/pnp/pnpacpi/core.c index fcd32ac575c3..a00548799e98 100644 --- a/trunk/drivers/pnp/pnpacpi/core.c +++ b/trunk/drivers/pnp/pnpacpi/core.c @@ -21,10 +21,7 @@ #include #include -#include #include -#include - #include "pnpacpi.h" static int num = 0; @@ -36,17 +33,15 @@ static int num = 0; * have irqs (PIC, Timer) because we call acpi_register_gsi. * Finaly only devices that have a CRS method need to be in this list. */ -static __initdata struct acpi_device_id excluded_id_list[] ={ - {"PNP0C09", 0}, /* EC */ - {"PNP0C0F", 0}, /* Link device */ - {"PNP0000", 0}, /* PIC */ - {"PNP0100", 0}, /* Timer */ - {"", 0}, -}; - +static char __initdata excluded_id_list[] = + "PNP0C09," /* EC */ + "PNP0C0F," /* Link device */ + "PNP0000," /* PIC */ + "PNP0100," /* Timer */ + ; static inline int is_exclusive_device(struct acpi_device *dev) { - return (!acpi_match_device_ids(dev, excluded_id_list)); + return (!acpi_match_ids(dev, excluded_id_list)); } /* @@ -124,25 +119,11 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) return ACPI_FAILURE(status) ? -ENODEV : 0; } -static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) -{ - return acpi_bus_set_power((acpi_handle)dev->data, - acpi_pm_device_sleep_state(&dev->dev, - device_may_wakeup(&dev->dev), NULL)); -} - -static int pnpacpi_resume(struct pnp_dev *dev) -{ - return acpi_bus_set_power((acpi_handle)dev->data, ACPI_STATE_D0); -} - static struct pnp_protocol pnpacpi_protocol = { .name = "Plug and Play ACPI", .get = pnpacpi_get_resources, .set = pnpacpi_set_resources, .disable = pnpacpi_disable_resources, - .suspend = pnpacpi_suspend, - .resume = pnpacpi_resume, }; static int __init pnpacpi_add_device(struct acpi_device *device) diff --git a/trunk/drivers/rtc/class.c b/trunk/drivers/rtc/class.c index 10ab3b71ffc6..8b3cd31d6a61 100644 --- a/trunk/drivers/rtc/class.c +++ b/trunk/drivers/rtc/class.c @@ -46,7 +46,6 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) { struct rtc_device *rtc = to_rtc_device(dev); struct rtc_time tm; - struct timespec ts = current_kernel_time(); if (strncmp(rtc->dev.bus_id, CONFIG_RTC_HCTOSYS_DEVICE, @@ -58,8 +57,8 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ set_normalized_timespec(&delta, - ts.tv_sec - oldtime, - ts.tv_nsec - (NSEC_PER_SEC >> 1)); + xtime.tv_sec - oldtime, + xtime.tv_nsec - (NSEC_PER_SEC >> 1)); return 0; } diff --git a/trunk/drivers/s390/net/ctcmain.c b/trunk/drivers/s390/net/ctcmain.c index 92e8a37b5022..b20fd0681733 100644 --- a/trunk/drivers/s390/net/ctcmain.c +++ b/trunk/drivers/s390/net/ctcmain.c @@ -674,7 +674,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) int first = 1; int i; unsigned long duration; - struct timespec done_stamp = current_kernel_time(); + struct timespec done_stamp = xtime; DBF_TEXT(trace, 4, __FUNCTION__); @@ -730,7 +730,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) spin_unlock(&ch->collect_lock); ch->ccw[1].count = ch->trans_skb->len; fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); - ch->prof.send_stamp = current_kernel_time(); + ch->prof.send_stamp = xtime; rc = ccw_device_start(ch->cdev, &ch->ccw[0], (unsigned long) ch, 0xff, 0); ch->prof.doios_multi++; @@ -2281,7 +2281,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb) fsm_newstate(ch->fsm, CH_STATE_TX); fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); - ch->prof.send_stamp = current_kernel_time(); + ch->prof.send_stamp = xtime; rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx], (unsigned long) ch, 0xff, 0); spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); diff --git a/trunk/drivers/s390/net/netiucv.c b/trunk/drivers/s390/net/netiucv.c index 268889474339..3d28e1a5bf79 100644 --- a/trunk/drivers/s390/net/netiucv.c +++ b/trunk/drivers/s390/net/netiucv.c @@ -753,7 +753,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg) header.next = 0; memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); - conn->prof.send_stamp = current_kernel_time(); + conn->prof.send_stamp = xtime; txmsg.class = 0; txmsg.tag = 0; rc = iucv_message_send(conn->path, &txmsg, 0, 0, @@ -1185,7 +1185,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn, memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); fsm_newstate(conn->fsm, CONN_STATE_TX); - conn->prof.send_stamp = current_kernel_time(); + conn->prof.send_stamp = xtime; msg.tag = 1; msg.class = 0; diff --git a/trunk/drivers/serial/68328serial.c b/trunk/drivers/serial/68328serial.c index aad4012bbb30..cad426c9711e 100644 --- a/trunk/drivers/serial/68328serial.c +++ b/trunk/drivers/serial/68328serial.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -400,9 +401,9 @@ irqreturn_t rs_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static void do_softint(struct work_struct *work) +static void do_softint(void *private) { - struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); + struct m68k_serial *info = (struct m68k_serial *) private; struct tty_struct *tty; tty = info->tty; @@ -424,9 +425,9 @@ static void do_softint(struct work_struct *work) * do_serial_hangup() -> tty->hangup() -> rs_hangup() * */ -static void do_serial_hangup(struct work_struct *work) +static void do_serial_hangup(void *private) { - struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); + struct m68k_serial *info = (struct m68k_serial *) private; struct tty_struct *tty; tty = info->tty; @@ -1323,6 +1324,59 @@ static void show_serial_version(void) printk("MC68328 serial driver version 1.00\n"); } +#ifdef CONFIG_PM_LEGACY +/* Serial Power management + * The console (currently fixed at line 0) is a special case for power + * management because the kernel is so chatty. The console will be + * explicitly disabled my our power manager as the last minute, so we won't + * mess with it here. + */ +static struct pm_dev *serial_pm[NR_PORTS]; + +static int serial_pm_callback(struct pm_dev *dev, pm_request_t request, void *data) +{ + struct m68k_serial *info = (struct m68k_serial *)dev->data; + + if(info == NULL) + return -1; + + /* special case for line 0 - pm restores it */ + if(info->line == 0) + return 0; + + switch (request) { + case PM_SUSPEND: + shutdown(info); + break; + + case PM_RESUME: + startup(info); + break; + } + return 0; +} + +void shutdown_console(void) +{ + struct m68k_serial *info = &m68k_soft[0]; + + /* HACK: wait a bit for any pending printk's to be dumped */ + { + int i = 10000; + while(i--); + } + + shutdown(info); +} + +void startup_console(void) +{ + struct m68k_serial *info = &m68k_soft[0]; + startup(info); +} +#endif /* CONFIG_PM_LEGACY */ + + static const struct tty_operations rs_ops = { .open = rs_open, .close = rs_close, @@ -1390,8 +1444,8 @@ rs68328_init(void) info->event = 0; info->count = 0; info->blocked_open = 0; - INIT_WORK(&info->tqueue, do_softint); - INIT_WORK(&info->tqueue_hangup, do_serial_hangup); + INIT_WORK(&info->tqueue, do_softint, info); + INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); init_waitqueue_head(&info->open_wait); init_waitqueue_head(&info->close_wait); info->line = i; @@ -1413,6 +1467,11 @@ rs68328_init(void) IRQ_FLG_STD, "M68328_UART", NULL)) panic("Unable to attach 68328 serial interrupt\n"); +#ifdef CONFIG_PM_LEGACY + serial_pm[i] = pm_register(PM_SYS_DEV, PM_SYS_COM, serial_pm_callback); + if (serial_pm[i]) + serial_pm[i]->data = info; +#endif } local_irq_restore(flags); return 0; diff --git a/trunk/include/acpi/acpi_bus.h b/trunk/include/acpi/acpi_bus.h index 533ef40f7ccf..5e3dcf3299bf 100644 --- a/trunk/include/acpi/acpi_bus.h +++ b/trunk/include/acpi/acpi_bus.h @@ -131,7 +131,7 @@ struct acpi_device_ops { struct acpi_driver { char name[80]; char class[80]; - const struct acpi_device_id *ids; /* Supported Hardware IDs */ + char *ids; /* Supported Hardware IDs */ struct acpi_device_ops ops; struct device_driver drv; struct module *owner; @@ -341,8 +341,7 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, int acpi_bus_trim(struct acpi_device *start, int rmdevice); int acpi_bus_start(struct acpi_device *device); acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); -int acpi_match_device_ids(struct acpi_device *device, - const struct acpi_device_id *ids); +int acpi_match_ids(struct acpi_device *device, char *ids); int acpi_create_dir(struct acpi_device *); void acpi_remove_dir(struct acpi_device *); @@ -366,8 +365,6 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer); acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) -int acpi_pm_device_sleep_state(struct device *, int, int *); - #endif /* CONFIG_ACPI */ #endif /*__ACPI_BUS_H__*/ diff --git a/trunk/include/acpi/acpi_drivers.h b/trunk/include/acpi/acpi_drivers.h index f85f77a538aa..553515912c0b 100644 --- a/trunk/include/acpi/acpi_drivers.h +++ b/trunk/include/acpi/acpi_drivers.h @@ -34,21 +34,16 @@ #define ACPI_BUS_COMPONENT 0x00010000 #define ACPI_SYSTEM_COMPONENT 0x02000000 -/* - * _HID definitions - * HIDs must conform to ACPI spec(6.1.4) - * Linux specific HIDs do not apply to this and begin with LNX: - */ +/* _HID definitions */ -#define ACPI_POWER_HID "LNXPOWER" +#define ACPI_POWER_HID "power_resource" #define ACPI_PROCESSOR_HID "ACPI0007" -#define ACPI_SYSTEM_HID "LNXSYSTM" -#define ACPI_THERMAL_HID "LNXTHERM" -#define ACPI_BUTTON_HID_POWERF "LNXPWRBN" -#define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN" -#define ACPI_VIDEO_HID "LNXVIDEO" -#define ACPI_BAY_HID "LNXIOBAY" - +#define ACPI_SYSTEM_HID "acpi_system" +#define ACPI_THERMAL_HID "thermal" +#define ACPI_BUTTON_HID_POWERF "button_power" +#define ACPI_BUTTON_HID_SLEEPF "button_sleep" +#define ACPI_VIDEO_HID "video" +#define ACPI_BAY_HID "bay" /* -------------------------------------------------------------------------- PCI -------------------------------------------------------------------------- */ @@ -147,6 +142,10 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle) /*-------------------------------------------------------------------------- Suspend/Resume -------------------------------------------------------------------------- */ +#ifdef CONFIG_ACPI_SLEEP extern int acpi_sleep_init(void); +#else +#define acpi_sleep_init() do {} while (0) +#endif #endif /*__ACPI_DRIVERS_H__*/ diff --git a/trunk/include/acpi/actypes.h b/trunk/include/acpi/actypes.h index e73a38939120..fe8abc276437 100644 --- a/trunk/include/acpi/actypes.h +++ b/trunk/include/acpi/actypes.h @@ -809,7 +809,7 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle, /* Common string version of device HIDs and UIDs */ -struct acpica_device_id { +struct acpi_device_id { char value[ACPI_DEVICE_ID_LENGTH]; }; @@ -859,8 +859,8 @@ struct acpi_device_info { u32 valid; /* Indicates which fields below are valid */ u32 current_status; /* _STA value */ acpi_integer address; /* _ADR value if any */ - struct acpica_device_id hardware_id; /* _HID value if any */ - struct acpica_device_id unique_id; /* _UID value if any */ + struct acpi_device_id hardware_id; /* _HID value if any */ + struct acpi_device_id unique_id; /* _UID value if any */ u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ }; diff --git a/trunk/include/acpi/acutils.h b/trunk/include/acpi/acutils.h index a2918547c73f..a87ef1c8d46b 100644 --- a/trunk/include/acpi/acutils.h +++ b/trunk/include/acpi/acutils.h @@ -354,7 +354,7 @@ acpi_ut_evaluate_numeric_object(char *object_name, acpi_status acpi_ut_execute_HID(struct acpi_namespace_node *device_node, - struct acpica_device_id *hid); + struct acpi_device_id *hid); acpi_status acpi_ut_execute_CID(struct acpi_namespace_node *device_node, @@ -366,7 +366,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node, acpi_status acpi_ut_execute_UID(struct acpi_namespace_node *device_node, - struct acpica_device_id *uid); + struct acpi_device_id *uid); acpi_status acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); diff --git a/trunk/include/asm-i386/acpi.h b/trunk/include/asm-i386/acpi.h index 125179adf044..449f3f272e07 100644 --- a/trunk/include/asm-i386/acpi.h +++ b/trunk/include/asm-i386/acpi.h @@ -121,15 +121,6 @@ static inline void acpi_disable_pci(void) } extern int acpi_irq_balance_set(char *str); -/* routines for saving/restoring kernel state */ -extern int acpi_save_state_mem(void); -extern void acpi_restore_state_mem(void); - -extern unsigned long acpi_wakeup_address; - -/* early initialization routine */ -extern void acpi_reserve_bootmem(void); - #else /* !CONFIG_ACPI */ #define acpi_lapic 0 @@ -140,6 +131,20 @@ static inline void disable_acpi(void) { } #endif /* !CONFIG_ACPI */ + +#ifdef CONFIG_ACPI_SLEEP + +/* routines for saving/restoring kernel state */ +extern int acpi_save_state_mem(void); +extern void acpi_restore_state_mem(void); + +extern unsigned long acpi_wakeup_address; + +/* early initialization routine */ +extern void acpi_reserve_bootmem(void); + +#endif /*CONFIG_ACPI_SLEEP*/ + #define ARCH_HAS_POWER_INIT 1 #endif /*__KERNEL__*/ diff --git a/trunk/include/asm-i386/bootparam.h b/trunk/include/asm-i386/bootparam.h index b91b01783e4b..427d8652bfde 100644 --- a/trunk/include/asm-i386/bootparam.h +++ b/trunk/include/asm-i386/bootparam.h @@ -4,9 +4,8 @@ #include #include #include -#include #include -#include +#include #include