Skip to content

Commit

Permalink
Merge branch 'sh-latest' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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.
  • Loading branch information
Linus Torvalds committed Mar 24, 2011
2 parents b4a41ed + b15ed69 commit 4d4fcae
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 197 deletions.
3 changes: 1 addition & 2 deletions arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ config SUPERH
select HAVE_SPARSE_IRQ
select RTC_LIB
select GENERIC_ATOMIC64
# Support the deprecated APIs until MFD and GPIOLIB catch up.
select GENERIC_HARDIRQS_NO_DEPRECATED if !MFD_SUPPORT && !GPIOLIB
select GENERIC_HARDIRQS_NO_DEPRECATED
select GENERIC_IRQ_SHOW
help
The SuperH is a RISC processor targeted for use in embedded systems
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/board-edosk7760.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static struct mtd_partition edosk7760_nor_flash_partitions[] = {
}, {
.name = "fs",
.offset = MTDPART_OFS_APPEND,
.size = SZ_26M,
.size = (26 << 20),
}, {
.name = "other",
.offset = MTDPART_OFS_APPEND,
Expand Down
63 changes: 1 addition & 62 deletions arch/sh/include/asm/sizes.h
Original file line number Diff line number Diff line change
@@ -1,62 +1 @@
/*
* 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 */
#include <asm-generic/sizes.h>
3 changes: 2 additions & 1 deletion arch/sh/include/asm/unistd_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,9 @@
#define __NR_name_to_handle_at 359
#define __NR_open_by_handle_at 360
#define __NR_clock_adjtime 361
#define __NR_syncfs 362

#define NR_syscalls 362
#define NR_syscalls 363

#ifdef __KERNEL__

Expand Down
3 changes: 2 additions & 1 deletion arch/sh/include/asm/unistd_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,11 @@
#define __NR_name_to_handle_at 370
#define __NR_open_by_handle_at 371
#define __NR_clock_adjtime 372
#define __NR_syncfs 373

#ifdef __KERNEL__

#define NR_syscalls 373
#define NR_syscalls 374

#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void free_thread_xstate(struct task_struct *tsk)
#if THREAD_SHIFT < PAGE_SHIFT
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;
#ifdef CONFIG_DEBUG_STACK_USAGE
Expand All @@ -57,7 +57,7 @@ void thread_info_cache_init(void)
THREAD_SIZE, SLAB_PANIC, NULL);
}
#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
gfp_t mask = GFP_KERNEL | __GFP_ZERO;
Expand Down
8 changes: 8 additions & 0 deletions arch/sh/kernel/ptrace_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ static int set_single_step(struct task_struct *tsk, unsigned long addr)

attr = bp->attr;
attr.bp_addr = addr;
/* reenable breakpoint */
attr.disabled = false;
err = modify_user_hw_breakpoint(bp, &attr);
if (unlikely(err))
return err;
Expand Down Expand Up @@ -392,6 +394,9 @@ long arch_ptrace(struct task_struct *child, long request,
tmp = 0;
} else {
unsigned long index;
ret = init_fpu(child);
if (ret)
break;
index = addr - offsetof(struct user, fpu);
tmp = ((unsigned long *)child->thread.xstate)
[index >> 2];
Expand Down Expand Up @@ -423,6 +428,9 @@ long arch_ptrace(struct task_struct *child, long request,
else if (addr >= offsetof(struct user, fpu) &&
addr < offsetof(struct user, u_fpvalid)) {
unsigned long index;
ret = init_fpu(child);
if (ret)
break;
index = addr - offsetof(struct user, fpu);
set_stopped_child_used_math(child);
((unsigned long *)child->thread.xstate)
Expand Down
6 changes: 6 additions & 0 deletions arch/sh/kernel/ptrace_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ long arch_ptrace(struct task_struct *child, long request,
else if ((addr >= offsetof(struct user, fpu)) &&
(addr < offsetof(struct user, u_fpvalid))) {
unsigned long index;
ret = init_fpu(child);
if (ret)
break;
index = addr - offsetof(struct user, fpu);
tmp = get_fpu_long(child, index);
} else if (addr == offsetof(struct user, u_fpvalid)) {
Expand Down Expand Up @@ -442,6 +445,9 @@ long arch_ptrace(struct task_struct *child, long request,
else if ((addr >= offsetof(struct user, fpu)) &&
(addr < offsetof(struct user, u_fpvalid))) {
unsigned long index;
ret = init_fpu(child);
if (ret)
break;
index = addr - offsetof(struct user, fpu);
ret = put_fpu_long(child, index, data);
}
Expand Down
1 change: 1 addition & 0 deletions arch/sh/kernel/syscalls_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,4 @@ ENTRY(sys_call_table)
.long sys_name_to_handle_at
.long sys_open_by_handle_at /* 360 */
.long sys_clock_adjtime
.long sys_syncfs
1 change: 1 addition & 0 deletions arch/sh/kernel/syscalls_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,4 @@ sys_call_table:
.long sys_name_to_handle_at /* 370 */
.long sys_open_by_handle_at
.long sys_clock_adjtime
.long sys_syncfs
43 changes: 14 additions & 29 deletions arch/sh/mm/pmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Privileged Space Mapping Buffer (PMB) Support.
*
* Copyright (C) 2005 - 2010 Paul Mundt
* Copyright (C) 2005 - 2011 Paul Mundt
* Copyright (C) 2010 Matt Fleming
*
* This file is subject to the terms and conditions of the GNU General Public
Expand All @@ -12,7 +12,7 @@
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sysdev.h>
#include <linux/syscore_ops.h>
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/bitops.h>
Expand Down Expand Up @@ -874,46 +874,31 @@ static int __init pmb_debugfs_init(void)
subsys_initcall(pmb_debugfs_init);

#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;

/* Restore the PMB after a resume from hibernation */
if (state.event == PM_EVENT_ON &&
prev_state.event == PM_EVENT_FREEZE) {
struct pmb_entry *pmbe;

read_lock(&pmb_rwlock);
read_lock(&pmb_rwlock);

for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
if (test_bit(i, pmb_map)) {
pmbe = &pmb_entry_list[i];
set_pmb_entry(pmbe);
}
for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
if (test_bit(i, pmb_map)) {
pmbe = &pmb_entry_list[i];
set_pmb_entry(pmbe);
}

read_unlock(&pmb_rwlock);
}

prev_state = state;

return 0;
}

static int pmb_sysdev_resume(struct sys_device *dev)
{
return pmb_sysdev_suspend(dev, PMSG_ON);
read_unlock(&pmb_rwlock);
}

static struct sysdev_driver pmb_sysdev_driver = {
.suspend = pmb_sysdev_suspend,
.resume = pmb_sysdev_resume,
static struct syscore_ops pmb_syscore_ops = {
.resume = pmb_syscore_resume,
};

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);
#endif
68 changes: 18 additions & 50 deletions drivers/sh/clk/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/sysdev.h>
#include <linux/syscore_ops.h>
#include <linux/seq_file.h>
#include <linux/err.h>
#include <linux/io.h>
Expand Down Expand Up @@ -630,68 +630,36 @@ long clk_round_parent(struct clk *clk, unsigned long target,
EXPORT_SYMBOL_GPL(clk_round_parent);

#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;

switch (state.event) {
case PM_EVENT_ON:
/* Resumeing from hibernation */
if (prev_state.event != PM_EVENT_FREEZE)
break;

list_for_each_entry(clkp, &clock_list, node) {
if (likely(clkp->ops)) {
unsigned long rate = clkp->rate;

if (likely(clkp->ops->set_parent))
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);
}
list_for_each_entry(clkp, &clock_list, node) {
if (likely(clkp->ops)) {
unsigned long rate = clkp->rate;

if (likely(clkp->ops->set_parent))
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 = {
.name = "clks",
};

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 struct syscore_ops clks_syscore_ops = {
.resume = clks_core_resume,
};

static int __init clk_sysdev_init(void)
static int __init clk_syscore_init(void)
{
sysdev_class_register(&clks_sysdev_class);
sysdev_driver_register(&clks_sysdev_class, &clks_sysdev_driver);
sysdev_register(&clks_sysdev_dev);
register_syscore_ops(&clks_syscore_ops);

return 0;
}
subsys_initcall(clk_sysdev_init);
subsys_initcall(clk_syscore_init);
#endif

/*
Expand Down
Loading

0 comments on commit 4d4fcae

Please sign in to comment.