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.

+125 -218
+1 -2
arch/sh/Kconfig
··· 23 23 select HAVE_SPARSE_IRQ 24 24 select RTC_LIB 25 25 select GENERIC_ATOMIC64 26 - # Support the deprecated APIs until MFD and GPIOLIB catch up. 27 - select GENERIC_HARDIRQS_NO_DEPRECATED if !MFD_SUPPORT && !GPIOLIB 26 + select GENERIC_HARDIRQS_NO_DEPRECATED 28 27 select GENERIC_IRQ_SHOW 29 28 help 30 29 The SuperH is a RISC processor targeted for use in embedded systems
+1 -1
arch/sh/boards/board-edosk7760.c
··· 56 56 }, { 57 57 .name = "fs", 58 58 .offset = MTDPART_OFS_APPEND, 59 - .size = SZ_26M, 59 + .size = (26 << 20), 60 60 }, { 61 61 .name = "other", 62 62 .offset = MTDPART_OFS_APPEND,
+1 -62
arch/sh/include/asm/sizes.h
··· 1 - /* 2 - * This program is free software; you can redistribute it and/or modify 3 - * it under the terms of the GNU General Public License as published by 4 - * the Free Software Foundation; either version 2 of the License, or 5 - * (at your option) any later version. 6 - * 7 - * This program is distributed in the hope that it will be useful, 8 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 - * GNU General Public License for more details. 11 - * 12 - * You should have received a copy of the GNU General Public License 13 - * along with this program; if not, write to the Free Software 14 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 - */ 16 - /* DO NOT EDIT!! - this file automatically generated 17 - * from .s file by awk -f s2h.awk 18 - */ 19 - /* Size definitions 20 - * Copyright (C) ARM Limited 1998. All rights reserved. 21 - */ 22 - 23 - #ifndef __sizes_h 24 - #define __sizes_h 1 25 - 26 - /* handy sizes */ 27 - #define SZ_16 0x00000010 28 - #define SZ_32 0x00000020 29 - #define SZ_64 0x00000040 30 - #define SZ_128 0x00000080 31 - #define SZ_256 0x00000100 32 - #define SZ_512 0x00000200 33 - 34 - #define SZ_1K 0x00000400 35 - #define SZ_2K 0x00000800 36 - #define SZ_4K 0x00001000 37 - #define SZ_8K 0x00002000 38 - #define SZ_16K 0x00004000 39 - #define SZ_32K 0x00008000 40 - #define SZ_64K 0x00010000 41 - #define SZ_128K 0x00020000 42 - #define SZ_256K 0x00040000 43 - #define SZ_512K 0x00080000 44 - 45 - #define SZ_1M 0x00100000 46 - #define SZ_2M 0x00200000 47 - #define SZ_4M 0x00400000 48 - #define SZ_8M 0x00800000 49 - #define SZ_16M 0x01000000 50 - #define SZ_26M 0x01a00000 51 - #define SZ_32M 0x02000000 52 - #define SZ_64M 0x04000000 53 - #define SZ_128M 0x08000000 54 - #define SZ_256M 0x10000000 55 - #define SZ_512M 0x20000000 56 - 57 - #define SZ_1G 0x40000000 58 - #define SZ_2G 0x80000000 59 - 60 - #endif 61 - 62 - /* END */ 1 + #include <asm-generic/sizes.h>
+2 -1
arch/sh/include/asm/unistd_32.h
··· 372 372 #define __NR_name_to_handle_at 359 373 373 #define __NR_open_by_handle_at 360 374 374 #define __NR_clock_adjtime 361 375 + #define __NR_syncfs 362 375 376 376 - #define NR_syscalls 362 377 + #define NR_syscalls 363 377 378 378 379 #ifdef __KERNEL__ 379 380
+2 -1
arch/sh/include/asm/unistd_64.h
··· 393 393 #define __NR_name_to_handle_at 370 394 394 #define __NR_open_by_handle_at 371 395 395 #define __NR_clock_adjtime 372 396 + #define __NR_syncfs 373 396 397 397 398 #ifdef __KERNEL__ 398 399 399 - #define NR_syscalls 373 400 + #define NR_syscalls 374 400 401 401 402 #define __ARCH_WANT_IPC_PARSE_VERSION 402 403 #define __ARCH_WANT_OLD_READDIR
+2 -2
arch/sh/kernel/process.c
··· 32 32 #if THREAD_SHIFT < PAGE_SHIFT 33 33 static struct kmem_cache *thread_info_cache; 34 34 35 - struct thread_info *alloc_thread_info(struct task_struct *tsk, int node) 35 + struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node) 36 36 { 37 37 struct thread_info *ti; 38 38 #ifdef CONFIG_DEBUG_STACK_USAGE ··· 57 57 THREAD_SIZE, SLAB_PANIC, NULL); 58 58 } 59 59 #else 60 - struct thread_info *alloc_thread_info(struct task_struct *tsk) 60 + struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node) 61 61 { 62 62 #ifdef CONFIG_DEBUG_STACK_USAGE 63 63 gfp_t mask = GFP_KERNEL | __GFP_ZERO;
+8
arch/sh/kernel/ptrace_32.c
··· 101 101 102 102 attr = bp->attr; 103 103 attr.bp_addr = addr; 104 + /* reenable breakpoint */ 105 + attr.disabled = false; 104 106 err = modify_user_hw_breakpoint(bp, &attr); 105 107 if (unlikely(err)) 106 108 return err; ··· 394 392 tmp = 0; 395 393 } else { 396 394 unsigned long index; 395 + ret = init_fpu(child); 396 + if (ret) 397 + break; 397 398 index = addr - offsetof(struct user, fpu); 398 399 tmp = ((unsigned long *)child->thread.xstate) 399 400 [index >> 2]; ··· 428 423 else if (addr >= offsetof(struct user, fpu) && 429 424 addr < offsetof(struct user, u_fpvalid)) { 430 425 unsigned long index; 426 + ret = init_fpu(child); 427 + if (ret) 428 + break; 431 429 index = addr - offsetof(struct user, fpu); 432 430 set_stopped_child_used_math(child); 433 431 ((unsigned long *)child->thread.xstate)
+6
arch/sh/kernel/ptrace_64.c
··· 403 403 else if ((addr >= offsetof(struct user, fpu)) && 404 404 (addr < offsetof(struct user, u_fpvalid))) { 405 405 unsigned long index; 406 + ret = init_fpu(child); 407 + if (ret) 408 + break; 406 409 index = addr - offsetof(struct user, fpu); 407 410 tmp = get_fpu_long(child, index); 408 411 } else if (addr == offsetof(struct user, u_fpvalid)) { ··· 445 442 else if ((addr >= offsetof(struct user, fpu)) && 446 443 (addr < offsetof(struct user, u_fpvalid))) { 447 444 unsigned long index; 445 + ret = init_fpu(child); 446 + if (ret) 447 + break; 448 448 index = addr - offsetof(struct user, fpu); 449 449 ret = put_fpu_long(child, index, data); 450 450 }
+1
arch/sh/kernel/syscalls_32.S
··· 379 379 .long sys_name_to_handle_at 380 380 .long sys_open_by_handle_at /* 360 */ 381 381 .long sys_clock_adjtime 382 + .long sys_syncfs
+1
arch/sh/kernel/syscalls_64.S
··· 399 399 .long sys_name_to_handle_at /* 370 */ 400 400 .long sys_open_by_handle_at 401 401 .long sys_clock_adjtime 402 + .long sys_syncfs
+14 -29
arch/sh/mm/pmb.c
··· 3 3 * 4 4 * Privileged Space Mapping Buffer (PMB) Support. 5 5 * 6 - * Copyright (C) 2005 - 2010 Paul Mundt 6 + * Copyright (C) 2005 - 2011 Paul Mundt 7 7 * Copyright (C) 2010 Matt Fleming 8 8 * 9 9 * This file is subject to the terms and conditions of the GNU General Public ··· 12 12 */ 13 13 #include <linux/init.h> 14 14 #include <linux/kernel.h> 15 - #include <linux/sysdev.h> 15 + #include <linux/syscore_ops.h> 16 16 #include <linux/cpu.h> 17 17 #include <linux/module.h> 18 18 #include <linux/bitops.h> ··· 874 874 subsys_initcall(pmb_debugfs_init); 875 875 876 876 #ifdef CONFIG_PM 877 - static int pmb_sysdev_suspend(struct sys_device *dev, pm_message_t state) 877 + static void pmb_syscore_resume(void) 878 878 { 879 - static pm_message_t prev_state; 879 + struct pmb_entry *pmbe; 880 880 int i; 881 881 882 - /* Restore the PMB after a resume from hibernation */ 883 - if (state.event == PM_EVENT_ON && 884 - prev_state.event == PM_EVENT_FREEZE) { 885 - struct pmb_entry *pmbe; 882 + read_lock(&pmb_rwlock); 886 883 887 - read_lock(&pmb_rwlock); 888 - 889 - for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) { 890 - if (test_bit(i, pmb_map)) { 891 - pmbe = &pmb_entry_list[i]; 892 - set_pmb_entry(pmbe); 893 - } 884 + for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) { 885 + if (test_bit(i, pmb_map)) { 886 + pmbe = &pmb_entry_list[i]; 887 + set_pmb_entry(pmbe); 894 888 } 895 - 896 - read_unlock(&pmb_rwlock); 897 889 } 898 890 899 - prev_state = state; 900 - 901 - return 0; 891 + read_unlock(&pmb_rwlock); 902 892 } 903 893 904 - static int pmb_sysdev_resume(struct sys_device *dev) 905 - { 906 - return pmb_sysdev_suspend(dev, PMSG_ON); 907 - } 908 - 909 - static struct sysdev_driver pmb_sysdev_driver = { 910 - .suspend = pmb_sysdev_suspend, 911 - .resume = pmb_sysdev_resume, 894 + static struct syscore_ops pmb_syscore_ops = { 895 + .resume = pmb_syscore_resume, 912 896 }; 913 897 914 898 static int __init pmb_sysdev_init(void) 915 899 { 916 - return sysdev_driver_register(&cpu_sysdev_class, &pmb_sysdev_driver); 900 + register_syscore_ops(&pmb_syscore_ops); 901 + return 0; 917 902 } 918 903 subsys_initcall(pmb_sysdev_init); 919 904 #endif
+19 -51
drivers/sh/clk/core.c
··· 21 21 #include <linux/module.h> 22 22 #include <linux/mutex.h> 23 23 #include <linux/list.h> 24 - #include <linux/sysdev.h> 24 + #include <linux/syscore_ops.h> 25 25 #include <linux/seq_file.h> 26 26 #include <linux/err.h> 27 27 #include <linux/io.h> ··· 630 630 EXPORT_SYMBOL_GPL(clk_round_parent); 631 631 632 632 #ifdef CONFIG_PM 633 - static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state) 633 + static void clks_core_resume(void) 634 634 { 635 - static pm_message_t prev_state; 636 635 struct clk *clkp; 637 636 638 - switch (state.event) { 639 - case PM_EVENT_ON: 640 - /* Resumeing from hibernation */ 641 - if (prev_state.event != PM_EVENT_FREEZE) 642 - break; 637 + list_for_each_entry(clkp, &clock_list, node) { 638 + if (likely(clkp->ops)) { 639 + unsigned long rate = clkp->rate; 643 640 644 - list_for_each_entry(clkp, &clock_list, node) { 645 - if (likely(clkp->ops)) { 646 - unsigned long rate = clkp->rate; 647 - 648 - if (likely(clkp->ops->set_parent)) 649 - clkp->ops->set_parent(clkp, 650 - clkp->parent); 651 - if (likely(clkp->ops->set_rate)) 652 - clkp->ops->set_rate(clkp, rate); 653 - else if (likely(clkp->ops->recalc)) 654 - clkp->rate = clkp->ops->recalc(clkp); 655 - } 641 + if (likely(clkp->ops->set_parent)) 642 + clkp->ops->set_parent(clkp, 643 + clkp->parent); 644 + if (likely(clkp->ops->set_rate)) 645 + clkp->ops->set_rate(clkp, rate); 646 + else if (likely(clkp->ops->recalc)) 647 + clkp->rate = clkp->ops->recalc(clkp); 656 648 } 657 - break; 658 - case PM_EVENT_FREEZE: 659 - break; 660 - case PM_EVENT_SUSPEND: 661 - break; 662 649 } 663 - 664 - prev_state = state; 665 - return 0; 666 650 } 667 651 668 - static int clks_sysdev_resume(struct sys_device *dev) 652 + static struct syscore_ops clks_syscore_ops = { 653 + .resume = clks_core_resume, 654 + }; 655 + 656 + static int __init clk_syscore_init(void) 669 657 { 670 - return clks_sysdev_suspend(dev, PMSG_ON); 671 - } 672 - 673 - static struct sysdev_class clks_sysdev_class = { 674 - .name = "clks", 675 - }; 676 - 677 - static struct sysdev_driver clks_sysdev_driver = { 678 - .suspend = clks_sysdev_suspend, 679 - .resume = clks_sysdev_resume, 680 - }; 681 - 682 - static struct sys_device clks_sysdev_dev = { 683 - .cls = &clks_sysdev_class, 684 - }; 685 - 686 - static int __init clk_sysdev_init(void) 687 - { 688 - sysdev_class_register(&clks_sysdev_class); 689 - sysdev_driver_register(&clks_sysdev_class, &clks_sysdev_driver); 690 - sysdev_register(&clks_sysdev_dev); 658 + register_syscore_ops(&clks_syscore_ops); 691 659 692 660 return 0; 693 661 } 694 - subsys_initcall(clk_sysdev_init); 662 + subsys_initcall(clk_syscore_init); 695 663 #endif 696 664 697 665 /*
+67 -68
drivers/sh/intc/core.c
··· 25 25 #include <linux/interrupt.h> 26 26 #include <linux/sh_intc.h> 27 27 #include <linux/sysdev.h> 28 + #include <linux/syscore_ops.h> 28 29 #include <linux/list.h> 29 30 #include <linux/spinlock.h> 30 31 #include <linux/radix-tree.h> ··· 377 376 return -ENOMEM; 378 377 } 379 378 379 + static int intc_suspend(void) 380 + { 381 + struct intc_desc_int *d; 382 + 383 + list_for_each_entry(d, &intc_list, list) { 384 + int irq; 385 + 386 + /* enable wakeup irqs belonging to this intc controller */ 387 + for_each_active_irq(irq) { 388 + struct irq_data *data; 389 + struct irq_desc *desc; 390 + struct irq_chip *chip; 391 + 392 + data = irq_get_irq_data(irq); 393 + chip = irq_data_get_irq_chip(data); 394 + if (chip != &d->chip) 395 + continue; 396 + desc = irq_to_desc(irq); 397 + if ((desc->status & IRQ_WAKEUP)) 398 + chip->irq_enable(data); 399 + } 400 + } 401 + 402 + return 0; 403 + } 404 + 405 + static void intc_resume(void) 406 + { 407 + struct intc_desc_int *d; 408 + 409 + list_for_each_entry(d, &intc_list, list) { 410 + int irq; 411 + 412 + for_each_active_irq(irq) { 413 + struct irq_data *data; 414 + struct irq_desc *desc; 415 + struct irq_chip *chip; 416 + 417 + data = irq_get_irq_data(irq); 418 + chip = irq_data_get_irq_chip(data); 419 + /* 420 + * This will catch the redirect and VIRQ cases 421 + * due to the dummy_irq_chip being inserted. 422 + */ 423 + if (chip != &d->chip) 424 + continue; 425 + desc = irq_to_desc(irq); 426 + if (desc->status & IRQ_DISABLED) 427 + chip->irq_disable(data); 428 + else 429 + chip->irq_enable(data); 430 + } 431 + } 432 + } 433 + 434 + struct syscore_ops intc_syscore_ops = { 435 + .suspend = intc_suspend, 436 + .resume = intc_resume, 437 + }; 438 + 439 + struct sysdev_class intc_sysdev_class = { 440 + .name = "intc", 441 + }; 442 + 380 443 static ssize_t 381 444 show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf) 382 445 { ··· 453 388 454 389 static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL); 455 390 456 - static int intc_suspend(struct sys_device *dev, pm_message_t state) 457 - { 458 - struct intc_desc_int *d; 459 - struct irq_data *data; 460 - struct irq_desc *desc; 461 - struct irq_chip *chip; 462 - int irq; 463 - 464 - /* get intc controller associated with this sysdev */ 465 - d = container_of(dev, struct intc_desc_int, sysdev); 466 - 467 - switch (state.event) { 468 - case PM_EVENT_ON: 469 - if (d->state.event != PM_EVENT_FREEZE) 470 - break; 471 - 472 - for_each_active_irq(irq) { 473 - desc = irq_to_desc(irq); 474 - data = irq_get_irq_data(irq); 475 - chip = irq_data_get_irq_chip(data); 476 - 477 - /* 478 - * This will catch the redirect and VIRQ cases 479 - * due to the dummy_irq_chip being inserted. 480 - */ 481 - if (chip != &d->chip) 482 - continue; 483 - if (desc->status & IRQ_DISABLED) 484 - chip->irq_disable(data); 485 - else 486 - chip->irq_enable(data); 487 - } 488 - break; 489 - case PM_EVENT_FREEZE: 490 - /* nothing has to be done */ 491 - break; 492 - case PM_EVENT_SUSPEND: 493 - /* enable wakeup irqs belonging to this intc controller */ 494 - for_each_active_irq(irq) { 495 - desc = irq_to_desc(irq); 496 - data = irq_get_irq_data(irq); 497 - chip = irq_data_get_irq_chip(data); 498 - 499 - if (chip != &d->chip) 500 - continue; 501 - if ((desc->status & IRQ_WAKEUP)) 502 - chip->irq_enable(data); 503 - } 504 - break; 505 - } 506 - 507 - d->state = state; 508 - 509 - return 0; 510 - } 511 - 512 - static int intc_resume(struct sys_device *dev) 513 - { 514 - return intc_suspend(dev, PMSG_ON); 515 - } 516 - 517 - struct sysdev_class intc_sysdev_class = { 518 - .name = "intc", 519 - .suspend = intc_suspend, 520 - .resume = intc_resume, 521 - }; 522 - 523 - /* register this intc as sysdev to allow suspend/resume */ 524 391 static int __init register_intc_sysdevs(void) 525 392 { 526 393 struct intc_desc_int *d; 527 394 int error; 395 + 396 + register_syscore_ops(&intc_syscore_ops); 528 397 529 398 error = sysdev_class_register(&intc_sysdev_class); 530 399 if (!error) {
-1
drivers/sh/intc/internals.h
··· 53 53 struct list_head list; 54 54 struct sys_device sysdev; 55 55 struct radix_tree_root tree; 56 - pm_message_t state; 57 56 raw_spinlock_t lock; 58 57 unsigned int index; 59 58 unsigned long *reg;