Commit 4d4fcae1 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Fix build alloc_thread_info_node function
  sh: Fix ptrace hw_breakpoint handling
  sh: Fix ptrace fpu state initialisation
  sh: Re-enable GENERIC_HARDIRQS_NO_DEPRECATED.
  sh: pmb: Use struct syscore_ops instead of sysdevs
  sh: Use struct syscore_ops instead of sysdevs
  sh: Conver to asm-generic/sizes.h.
  sh: wire up sys_syncfs.
parents b4a41ed2 b15ed691
...@@ -23,8 +23,7 @@ config SUPERH ...@@ -23,8 +23,7 @@ config SUPERH
select HAVE_SPARSE_IRQ select HAVE_SPARSE_IRQ
select RTC_LIB select RTC_LIB
select GENERIC_ATOMIC64 select GENERIC_ATOMIC64
# Support the deprecated APIs until MFD and GPIOLIB catch up. select GENERIC_HARDIRQS_NO_DEPRECATED
select GENERIC_HARDIRQS_NO_DEPRECATED if !MFD_SUPPORT && !GPIOLIB
select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW
help help
The SuperH is a RISC processor targeted for use in embedded systems The SuperH is a RISC processor targeted for use in embedded systems
......
...@@ -56,7 +56,7 @@ static struct mtd_partition edosk7760_nor_flash_partitions[] = { ...@@ -56,7 +56,7 @@ static struct mtd_partition edosk7760_nor_flash_partitions[] = {
}, { }, {
.name = "fs", .name = "fs",
.offset = MTDPART_OFS_APPEND, .offset = MTDPART_OFS_APPEND,
.size = SZ_26M, .size = (26 << 20),
}, { }, {
.name = "other", .name = "other",
.offset = MTDPART_OFS_APPEND, .offset = MTDPART_OFS_APPEND,
......
/* #include <asm-generic/sizes.h>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* DO NOT EDIT!! - this file automatically generated
* from .s file by awk -f s2h.awk
*/
/* Size definitions
* Copyright (C) ARM Limited 1998. All rights reserved.
*/
#ifndef __sizes_h
#define __sizes_h 1
/* handy sizes */
#define SZ_16 0x00000010
#define SZ_32 0x00000020
#define SZ_64 0x00000040
#define SZ_128 0x00000080
#define SZ_256 0x00000100
#define SZ_512 0x00000200
#define SZ_1K 0x00000400
#define SZ_2K 0x00000800
#define SZ_4K 0x00001000
#define SZ_8K 0x00002000
#define SZ_16K 0x00004000
#define SZ_32K 0x00008000
#define SZ_64K 0x00010000
#define SZ_128K 0x00020000
#define SZ_256K 0x00040000
#define SZ_512K 0x00080000
#define SZ_1M 0x00100000
#define SZ_2M 0x00200000
#define SZ_4M 0x00400000
#define SZ_8M 0x00800000
#define SZ_16M 0x01000000
#define SZ_26M 0x01a00000
#define SZ_32M 0x02000000
#define SZ_64M 0x04000000
#define SZ_128M 0x08000000
#define SZ_256M 0x10000000
#define SZ_512M 0x20000000
#define SZ_1G 0x40000000
#define SZ_2G 0x80000000
#endif
/* END */
...@@ -372,8 +372,9 @@ ...@@ -372,8 +372,9 @@
#define __NR_name_to_handle_at 359 #define __NR_name_to_handle_at 359
#define __NR_open_by_handle_at 360 #define __NR_open_by_handle_at 360
#define __NR_clock_adjtime 361 #define __NR_clock_adjtime 361
#define __NR_syncfs 362
#define NR_syscalls 362 #define NR_syscalls 363
#ifdef __KERNEL__ #ifdef __KERNEL__
......
...@@ -393,10 +393,11 @@ ...@@ -393,10 +393,11 @@
#define __NR_name_to_handle_at 370 #define __NR_name_to_handle_at 370
#define __NR_open_by_handle_at 371 #define __NR_open_by_handle_at 371
#define __NR_clock_adjtime 372 #define __NR_clock_adjtime 372
#define __NR_syncfs 373
#ifdef __KERNEL__ #ifdef __KERNEL__
#define NR_syscalls 373 #define NR_syscalls 374
#define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
......
...@@ -32,7 +32,7 @@ void free_thread_xstate(struct task_struct *tsk) ...@@ -32,7 +32,7 @@ void free_thread_xstate(struct task_struct *tsk)
#if THREAD_SHIFT < PAGE_SHIFT #if THREAD_SHIFT < PAGE_SHIFT
static struct kmem_cache *thread_info_cache; static struct kmem_cache *thread_info_cache;
struct thread_info *alloc_thread_info(struct task_struct *tsk, int node) struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
{ {
struct thread_info *ti; struct thread_info *ti;
#ifdef CONFIG_DEBUG_STACK_USAGE #ifdef CONFIG_DEBUG_STACK_USAGE
...@@ -57,7 +57,7 @@ void thread_info_cache_init(void) ...@@ -57,7 +57,7 @@ void thread_info_cache_init(void)
THREAD_SIZE, SLAB_PANIC, NULL); THREAD_SIZE, SLAB_PANIC, NULL);
} }
#else #else
struct thread_info *alloc_thread_info(struct task_struct *tsk) struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
{ {
#ifdef CONFIG_DEBUG_STACK_USAGE #ifdef CONFIG_DEBUG_STACK_USAGE
gfp_t mask = GFP_KERNEL | __GFP_ZERO; gfp_t mask = GFP_KERNEL | __GFP_ZERO;
......
...@@ -101,6 +101,8 @@ static int set_single_step(struct task_struct *tsk, unsigned long addr) ...@@ -101,6 +101,8 @@ static int set_single_step(struct task_struct *tsk, unsigned long addr)
attr = bp->attr; attr = bp->attr;
attr.bp_addr = addr; attr.bp_addr = addr;
/* reenable breakpoint */
attr.disabled = false;
err = modify_user_hw_breakpoint(bp, &attr); err = modify_user_hw_breakpoint(bp, &attr);
if (unlikely(err)) if (unlikely(err))
return err; return err;
...@@ -392,6 +394,9 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -392,6 +394,9 @@ long arch_ptrace(struct task_struct *child, long request,
tmp = 0; tmp = 0;
} else { } else {
unsigned long index; unsigned long index;
ret = init_fpu(child);
if (ret)
break;
index = addr - offsetof(struct user, fpu); index = addr - offsetof(struct user, fpu);
tmp = ((unsigned long *)child->thread.xstate) tmp = ((unsigned long *)child->thread.xstate)
[index >> 2]; [index >> 2];
...@@ -423,6 +428,9 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -423,6 +428,9 @@ long arch_ptrace(struct task_struct *child, long request,
else if (addr >= offsetof(struct user, fpu) && else if (addr >= offsetof(struct user, fpu) &&
addr < offsetof(struct user, u_fpvalid)) { addr < offsetof(struct user, u_fpvalid)) {
unsigned long index; unsigned long index;
ret = init_fpu(child);
if (ret)
break;
index = addr - offsetof(struct user, fpu); index = addr - offsetof(struct user, fpu);
set_stopped_child_used_math(child); set_stopped_child_used_math(child);
((unsigned long *)child->thread.xstate) ((unsigned long *)child->thread.xstate)
......
...@@ -403,6 +403,9 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -403,6 +403,9 @@ long arch_ptrace(struct task_struct *child, long request,
else if ((addr >= offsetof(struct user, fpu)) && else if ((addr >= offsetof(struct user, fpu)) &&
(addr < offsetof(struct user, u_fpvalid))) { (addr < offsetof(struct user, u_fpvalid))) {
unsigned long index; unsigned long index;
ret = init_fpu(child);
if (ret)
break;
index = addr - offsetof(struct user, fpu); index = addr - offsetof(struct user, fpu);
tmp = get_fpu_long(child, index); tmp = get_fpu_long(child, index);
} else if (addr == offsetof(struct user, u_fpvalid)) { } else if (addr == offsetof(struct user, u_fpvalid)) {
...@@ -442,6 +445,9 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -442,6 +445,9 @@ long arch_ptrace(struct task_struct *child, long request,
else if ((addr >= offsetof(struct user, fpu)) && else if ((addr >= offsetof(struct user, fpu)) &&
(addr < offsetof(struct user, u_fpvalid))) { (addr < offsetof(struct user, u_fpvalid))) {
unsigned long index; unsigned long index;
ret = init_fpu(child);
if (ret)
break;
index = addr - offsetof(struct user, fpu); index = addr - offsetof(struct user, fpu);
ret = put_fpu_long(child, index, data); ret = put_fpu_long(child, index, data);
} }
......
...@@ -379,3 +379,4 @@ ENTRY(sys_call_table) ...@@ -379,3 +379,4 @@ ENTRY(sys_call_table)
.long sys_name_to_handle_at .long sys_name_to_handle_at
.long sys_open_by_handle_at /* 360 */ .long sys_open_by_handle_at /* 360 */
.long sys_clock_adjtime .long sys_clock_adjtime
.long sys_syncfs
...@@ -399,3 +399,4 @@ sys_call_table: ...@@ -399,3 +399,4 @@ sys_call_table:
.long sys_name_to_handle_at /* 370 */ .long sys_name_to_handle_at /* 370 */
.long sys_open_by_handle_at .long sys_open_by_handle_at
.long sys_clock_adjtime .long sys_clock_adjtime
.long sys_syncfs
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Privileged Space Mapping Buffer (PMB) Support. * Privileged Space Mapping Buffer (PMB) Support.
* *
* Copyright (C) 2005 - 2010 Paul Mundt * Copyright (C) 2005 - 2011 Paul Mundt
* Copyright (C) 2010 Matt Fleming * Copyright (C) 2010 Matt Fleming
* *
* This file is subject to the terms and conditions of the GNU General Public * This file is subject to the terms and conditions of the GNU General Public
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
*/ */
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sysdev.h> #include <linux/syscore_ops.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/bitops.h> #include <linux/bitops.h>
...@@ -874,46 +874,31 @@ static int __init pmb_debugfs_init(void) ...@@ -874,46 +874,31 @@ static int __init pmb_debugfs_init(void)
subsys_initcall(pmb_debugfs_init); subsys_initcall(pmb_debugfs_init);
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int pmb_sysdev_suspend(struct sys_device *dev, pm_message_t state) static void pmb_syscore_resume(void)
{ {
static pm_message_t prev_state; struct pmb_entry *pmbe;
int i; int i;
/* Restore the PMB after a resume from hibernation */ read_lock(&pmb_rwlock);
if (state.event == PM_EVENT_ON &&
prev_state.event == PM_EVENT_FREEZE) {
struct pmb_entry *pmbe;
read_lock(&pmb_rwlock);
for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) { for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
if (test_bit(i, pmb_map)) { if (test_bit(i, pmb_map)) {
pmbe = &pmb_entry_list[i]; pmbe = &pmb_entry_list[i];
set_pmb_entry(pmbe); set_pmb_entry(pmbe);
}
} }
read_unlock(&pmb_rwlock);
} }
prev_state = state; read_unlock(&pmb_rwlock);
return 0;
}
static int pmb_sysdev_resume(struct sys_device *dev)
{
return pmb_sysdev_suspend(dev, PMSG_ON);
} }
static struct sysdev_driver pmb_sysdev_driver = { static struct syscore_ops pmb_syscore_ops = {
.suspend = pmb_sysdev_suspend, .resume = pmb_syscore_resume,
.resume = pmb_sysdev_resume,
}; };
static int __init pmb_sysdev_init(void) static int __init pmb_sysdev_init(void)
{ {
return sysdev_driver_register(&cpu_sysdev_class, &pmb_sysdev_driver); register_syscore_ops(&pmb_syscore_ops);
return 0;
} }
subsys_initcall(pmb_sysdev_init); subsys_initcall(pmb_sysdev_init);
#endif #endif
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/sysdev.h> #include <linux/syscore_ops.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -630,68 +630,36 @@ long clk_round_parent(struct clk *clk, unsigned long target, ...@@ -630,68 +630,36 @@ long clk_round_parent(struct clk *clk, unsigned long target,
EXPORT_SYMBOL_GPL(clk_round_parent); EXPORT_SYMBOL_GPL(clk_round_parent);
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state) static void clks_core_resume(void)
{ {
static pm_message_t prev_state;
struct clk *clkp; struct clk *clkp;
switch (state.event) { list_for_each_entry(clkp, &clock_list, node) {
case PM_EVENT_ON: if (likely(clkp->ops)) {
/* Resumeing from hibernation */ unsigned long rate = clkp->rate;
if (prev_state.event != PM_EVENT_FREEZE)
break; if (likely(clkp->ops->set_parent))
clkp->ops->set_parent(clkp,
list_for_each_entry(clkp, &clock_list, node) { clkp->parent);
if (likely(clkp->ops)) { if (likely(clkp->ops->set_rate))
unsigned long rate = clkp->rate; clkp->ops->set_rate(clkp, rate);
else if (likely(clkp->ops->recalc))
if (likely(clkp->ops->set_parent)) clkp->rate = clkp->ops->recalc(clkp);
clkp->ops->set_parent(clkp,
clkp->parent);
if (likely(clkp->ops->set_rate))
clkp->ops->set_rate(clkp, rate);
else if (likely(clkp->ops->recalc))
clkp->rate = clkp->ops->recalc(clkp);
}
} }
break;
case PM_EVENT_FREEZE:
break;
case PM_EVENT_SUSPEND:
break;
} }
prev_state = state;
return 0;
}
static int clks_sysdev_resume(struct sys_device *dev)
{
return clks_sysdev_suspend(dev, PMSG_ON);
} }
static struct sysdev_class clks_sysdev_class = { static struct syscore_ops clks_syscore_ops = {
.name = "clks", .resume = clks_core_resume,
};
static struct sysdev_driver clks_sysdev_driver = {
.suspend = clks_sysdev_suspend,
.resume = clks_sysdev_resume,
};
static struct sys_device clks_sysdev_dev = {
.cls = &clks_sysdev_class,
}; };
static int __init clk_sysdev_init(void) static int __init clk_syscore_init(void)
{ {
sysdev_class_register(&clks_sysdev_class); register_syscore_ops(&clks_syscore_ops);
sysdev_driver_register(&clks_sysdev_class, &clks_sysdev_driver);
sysdev_register(&clks_sysdev_dev);
return 0; return 0;
} }
subsys_initcall(clk_sysdev_init); subsys_initcall(clk_syscore_init);
#endif #endif
/* /*
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include <linux/sysdev.h> #include <linux/sysdev.h>
#include <linux/syscore_ops.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/radix-tree.h> #include <linux/radix-tree.h>
...@@ -376,91 +377,89 @@ int __init register_intc_controller(struct intc_desc *desc) ...@@ -376,91 +377,89 @@ int __init register_intc_controller(struct intc_desc *desc)
return -ENOMEM; return -ENOMEM;
} }
static ssize_t static int intc_suspend(void)
show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf)
{ {
struct intc_desc_int *d; struct intc_desc_int *d;
d = container_of(dev, struct intc_desc_int, sysdev); list_for_each_entry(d, &intc_list, list) {
int irq;
return sprintf(buf, "%s\n", d->chip.name); /* enable wakeup irqs belonging to this intc controller */
} for_each_active_irq(irq) {
struct irq_data *data;
struct irq_desc *desc;
struct irq_chip *chip;
static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL); data = irq_get_irq_data(irq);
chip = irq_data_get_irq_chip(data);
if (chip != &d->chip)
continue;
desc = irq_to_desc(irq);
if ((desc->status & IRQ_WAKEUP))
chip->irq_enable(data);
}
}
return 0;
}
static int intc_suspend(struct sys_device *dev, pm_message_t state) static void intc_resume(void)
{ {
struct intc_desc_int *d; struct intc_desc_int *d;
struct irq_data *data;
struct irq_desc *desc;
struct irq_chip *chip;
int irq;
/* get intc controller associated with this sysdev */
d = container_of(dev, struct intc_desc_int, sysdev);
switch (state.event) { list_for_each_entry(d, &intc_list, list) {
case PM_EVENT_ON: int irq;
if (d->state.event != PM_EVENT_FREEZE)
break;
for_each_active_irq(irq) { for_each_active_irq(irq) {
desc = irq_to_desc(irq); struct irq_data *data;
struct irq_desc *desc;
struct irq_chip *chip;
data = irq_get_irq_data(irq); data = irq_get_irq_data(irq);
chip = irq_data_get_irq_chip(data); chip = irq_data_get_irq_chip(data);
/* /*
* This will catch the redirect and VIRQ cases * This will catch the redirect and VIRQ cases
* due to the dummy_irq_chip being inserted. * due to the dummy_irq_chip being inserted.
*/ */
if (chip != &d->chip) if (chip != &d->chip)
continue; continue;
desc = irq_to_desc(irq);
if (desc->status & IRQ_DISABLED) if (desc->status & IRQ_DISABLED)
chip->irq_disable(data); chip->irq_disable(data);
else else
chip->irq_enable(data); chip->irq_enable(data);
} }
break;
case PM_EVENT_FREEZE:
/* nothing has to be done */
break;
case PM_EVENT_SUSPEND:
/* enable wakeup irqs belonging to this intc controller */
for_each_active_irq(irq) {
desc = irq_to_desc(irq);
data = irq_get_irq_data(irq);
chip = irq_data_get_irq_chip(data);
if (chip != &d->chip)
continue;
if ((desc->status & IRQ_WAKEUP))
chip->irq_enable(data);
}
break;
} }
d->state = state;
return 0;
} }
static int intc_resume(struct sys_device *dev) struct syscore_ops intc_syscore_ops = {
{ .suspend = intc_suspend,
return intc_suspend(dev, PMSG_ON); .resume = intc_resume,
} };
struct sysdev_class intc_sysdev_class = { struct sysdev_class intc_sysdev_class = {
.name = "intc", .name = "intc",
.suspend = intc_suspend,
.resume = intc_resume,
}; };
/* register this intc as sysdev to allow suspend/resume */ static ssize_t
show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf)
{
struct intc_desc_int *d;
d = container_of(dev, struct intc_desc_int, sysdev);
return sprintf(buf, "%s\n", d->chip.name);
}
static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL);
static int __init register_intc_sysdevs(void) static int __init register_intc_sysdevs(void)
{ {
struct intc_desc_int *d; struct intc_desc_int *d;
int error; int error;
register_syscore_ops(&intc_syscore_ops);
error = sysdev_class_register(&intc_sysdev_class); error = sysdev_class_register(&intc_sysdev_class);
if (!error) { if (!error) {
list_for_each_entry(d, &intc_list, list) { list_for_each_entry(d, &intc_list, list) {
......
...@@ -53,7 +53,6 @@ struct intc_desc_int { ...@@ -53,7 +53,6 @@ struct intc_desc_int {
struct list_head list; struct list_head list;
struct sys_device sysdev; struct sys_device sysdev;
struct radix_tree_root tree; struct radix_tree_root tree;
pm_message_t state;
raw_spinlock_t lock; raw_spinlock_t lock;
unsigned int index; unsigned int index;
unsigned long *reg; unsigned long *reg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment