diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-12 10:53:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-12 10:53:06 -0400 |
| commit | 75c0b3b466388f2fad60fda57b6ca2c4fabbcaf7 (patch) | |
| tree | 11de004529d01abded73a9392715baebab2e2a6d | |
| parent | 3568bd9720b4a775f28a718fcbb462ce2f386988 (diff) | |
| parent | a904f5f9eb7a55baacb2f4c1423cac8a8eb78a3a (diff) | |
Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm:
ARM: 6870/1: The mandatory barrier rmb() must be a dsb() in for device accesses
ARM: 6892/1: handle ptrace requests to change PC during interrupted system calls
ARM: 6890/1: memmap: only free allocated memmap entries when using SPARSEMEM
ARM: zImage: the page table memory must be considered before relocation
ARM: zImage: make sure not to relocate on top of the relocation code
ARM: zImage: Fix bad SP address after relocating kernel
ARM: zImage: make sure the stack is 64-bit aligned
ARM: RiscPC: acornfb: fix section mismatches
ARM: RiscPC: etherh: fix section mismatches
| -rw-r--r-- | arch/arm/boot/compressed/Makefile | 2 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/head.S | 35 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/vmlinux.lds.in | 1 | ||||
| -rw-r--r-- | arch/arm/include/asm/system.h | 2 | ||||
| -rw-r--r-- | arch/arm/kernel/signal.c | 90 | ||||
| -rw-r--r-- | arch/arm/mach-realview/include/mach/barriers.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/include/mach/barriers.h | 2 | ||||
| -rw-r--r-- | arch/arm/mm/init.c | 16 | ||||
| -rw-r--r-- | drivers/net/arm/etherh.c | 4 | ||||
| -rw-r--r-- | drivers/video/acornfb.c | 26 |
10 files changed, 109 insertions, 71 deletions
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 8ebbb511c783..0c6852d93506 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
| @@ -74,7 +74,7 @@ ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT) | |||
| 74 | ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS) | 74 | ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS) |
| 75 | else | 75 | else |
| 76 | ZTEXTADDR := 0 | 76 | ZTEXTADDR := 0 |
| 77 | ZBSSADDR := ALIGN(4) | 77 | ZBSSADDR := ALIGN(8) |
| 78 | endif | 78 | endif |
| 79 | 79 | ||
| 80 | SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ | 80 | SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ |
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index adf583cd0c35..49f5b2eaaa87 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
| @@ -179,15 +179,14 @@ not_angel: | |||
| 179 | bl cache_on | 179 | bl cache_on |
| 180 | 180 | ||
| 181 | restart: adr r0, LC0 | 181 | restart: adr r0, LC0 |
| 182 | ldmia r0, {r1, r2, r3, r5, r6, r9, r11, r12} | 182 | ldmia r0, {r1, r2, r3, r6, r9, r11, r12} |
| 183 | ldr sp, [r0, #32] | 183 | ldr sp, [r0, #28] |
| 184 | 184 | ||
| 185 | /* | 185 | /* |
| 186 | * We might be running at a different address. We need | 186 | * We might be running at a different address. We need |
| 187 | * to fix up various pointers. | 187 | * to fix up various pointers. |
| 188 | */ | 188 | */ |
| 189 | sub r0, r0, r1 @ calculate the delta offset | 189 | sub r0, r0, r1 @ calculate the delta offset |
| 190 | add r5, r5, r0 @ _start | ||
| 191 | add r6, r6, r0 @ _edata | 190 | add r6, r6, r0 @ _edata |
| 192 | 191 | ||
| 193 | #ifndef CONFIG_ZBOOT_ROM | 192 | #ifndef CONFIG_ZBOOT_ROM |
| @@ -206,31 +205,40 @@ restart: adr r0, LC0 | |||
| 206 | /* | 205 | /* |
| 207 | * Check to see if we will overwrite ourselves. | 206 | * Check to see if we will overwrite ourselves. |
| 208 | * r4 = final kernel address | 207 | * r4 = final kernel address |
| 209 | * r5 = start of this image | ||
| 210 | * r9 = size of decompressed image | 208 | * r9 = size of decompressed image |
| 211 | * r10 = end of this image, including bss/stack/malloc space if non XIP | 209 | * r10 = end of this image, including bss/stack/malloc space if non XIP |
| 212 | * We basically want: | 210 | * We basically want: |
| 213 | * r4 >= r10 -> OK | 211 | * r4 - 16k page directory >= r10 -> OK |
| 214 | * r4 + image length <= r5 -> OK | 212 | * r4 + image length <= current position (pc) -> OK |
| 215 | */ | 213 | */ |
| 214 | add r10, r10, #16384 | ||
| 216 | cmp r4, r10 | 215 | cmp r4, r10 |
| 217 | bhs wont_overwrite | 216 | bhs wont_overwrite |
| 218 | add r10, r4, r9 | 217 | add r10, r4, r9 |
| 219 | cmp r10, r5 | 218 | ARM( cmp r10, pc ) |
| 219 | THUMB( mov lr, pc ) | ||
| 220 | THUMB( cmp r10, lr ) | ||
| 220 | bls wont_overwrite | 221 | bls wont_overwrite |
| 221 | 222 | ||
| 222 | /* | 223 | /* |
| 223 | * Relocate ourselves past the end of the decompressed kernel. | 224 | * Relocate ourselves past the end of the decompressed kernel. |
| 224 | * r5 = start of this image | ||
| 225 | * r6 = _edata | 225 | * r6 = _edata |
| 226 | * r10 = end of the decompressed kernel | 226 | * r10 = end of the decompressed kernel |
| 227 | * Because we always copy ahead, we need to do it from the end and go | 227 | * Because we always copy ahead, we need to do it from the end and go |
| 228 | * backward in case the source and destination overlap. | 228 | * backward in case the source and destination overlap. |
| 229 | */ | 229 | */ |
| 230 | /* Round up to next 256-byte boundary. */ | 230 | /* |
| 231 | add r10, r10, #256 | 231 | * Bump to the next 256-byte boundary with the size of |
| 232 | * the relocation code added. This avoids overwriting | ||
| 233 | * ourself when the offset is small. | ||
| 234 | */ | ||
| 235 | add r10, r10, #((reloc_code_end - restart + 256) & ~255) | ||
| 232 | bic r10, r10, #255 | 236 | bic r10, r10, #255 |
| 233 | 237 | ||
| 238 | /* Get start of code we want to copy and align it down. */ | ||
| 239 | adr r5, restart | ||
| 240 | bic r5, r5, #31 | ||
| 241 | |||
| 234 | sub r9, r6, r5 @ size to copy | 242 | sub r9, r6, r5 @ size to copy |
| 235 | add r9, r9, #31 @ rounded up to a multiple | 243 | add r9, r9, #31 @ rounded up to a multiple |
| 236 | bic r9, r9, #31 @ ... of 32 bytes | 244 | bic r9, r9, #31 @ ... of 32 bytes |
| @@ -245,6 +253,11 @@ restart: adr r0, LC0 | |||
| 245 | /* Preserve offset to relocated code. */ | 253 | /* Preserve offset to relocated code. */ |
| 246 | sub r6, r9, r6 | 254 | sub r6, r9, r6 |
| 247 | 255 | ||
| 256 | #ifndef CONFIG_ZBOOT_ROM | ||
| 257 | /* cache_clean_flush may use the stack, so relocate it */ | ||
| 258 | add sp, sp, r6 | ||
| 259 | #endif | ||
| 260 | |||
| 248 | bl cache_clean_flush | 261 | bl cache_clean_flush |
| 249 | 262 | ||
| 250 | adr r0, BSYM(restart) | 263 | adr r0, BSYM(restart) |
| @@ -333,7 +346,6 @@ not_relocated: mov r0, #0 | |||
| 333 | LC0: .word LC0 @ r1 | 346 | LC0: .word LC0 @ r1 |
| 334 | .word __bss_start @ r2 | 347 | .word __bss_start @ r2 |
| 335 | .word _end @ r3 | 348 | .word _end @ r3 |
| 336 | .word _start @ r5 | ||
| 337 | .word _edata @ r6 | 349 | .word _edata @ r6 |
| 338 | .word _image_size @ r9 | 350 | .word _image_size @ r9 |
| 339 | .word _got_start @ r11 | 351 | .word _got_start @ r11 |
| @@ -1062,6 +1074,7 @@ memdump: mov r12, r0 | |||
| 1062 | #endif | 1074 | #endif |
| 1063 | 1075 | ||
| 1064 | .ltorg | 1076 | .ltorg |
| 1077 | reloc_code_end: | ||
| 1065 | 1078 | ||
| 1066 | .align | 1079 | .align |
| 1067 | .section ".stack", "aw", %nobits | 1080 | .section ".stack", "aw", %nobits |
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in index 5309909d7282..ea80abe78844 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.in +++ b/arch/arm/boot/compressed/vmlinux.lds.in | |||
| @@ -54,6 +54,7 @@ SECTIONS | |||
| 54 | .bss : { *(.bss) } | 54 | .bss : { *(.bss) } |
| 55 | _end = .; | 55 | _end = .; |
| 56 | 56 | ||
| 57 | . = ALIGN(8); /* the stack must be 64-bit aligned */ | ||
| 57 | .stack : { *(.stack) } | 58 | .stack : { *(.stack) } |
| 58 | 59 | ||
| 59 | .stab 0 : { *(.stab) } | 60 | .stab 0 : { *(.stab) } |
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 885be097769d..832888d0c20c 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
| @@ -159,7 +159,7 @@ extern unsigned int user_debug; | |||
| 159 | #include <mach/barriers.h> | 159 | #include <mach/barriers.h> |
| 160 | #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) | 160 | #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) |
| 161 | #define mb() do { dsb(); outer_sync(); } while (0) | 161 | #define mb() do { dsb(); outer_sync(); } while (0) |
| 162 | #define rmb() dmb() | 162 | #define rmb() dsb() |
| 163 | #define wmb() mb() | 163 | #define wmb() mb() |
| 164 | #else | 164 | #else |
| 165 | #include <asm/memory.h> | 165 | #include <asm/memory.h> |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index cb8398317644..0340224cf73c 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
| @@ -597,19 +597,13 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
| 597 | return err; | 597 | return err; |
| 598 | } | 598 | } |
| 599 | 599 | ||
| 600 | static inline void setup_syscall_restart(struct pt_regs *regs) | ||
| 601 | { | ||
| 602 | regs->ARM_r0 = regs->ARM_ORIG_r0; | ||
| 603 | regs->ARM_pc -= thumb_mode(regs) ? 2 : 4; | ||
| 604 | } | ||
| 605 | |||
| 606 | /* | 600 | /* |
| 607 | * OK, we're invoking a handler | 601 | * OK, we're invoking a handler |
| 608 | */ | 602 | */ |
| 609 | static int | 603 | static int |
| 610 | handle_signal(unsigned long sig, struct k_sigaction *ka, | 604 | handle_signal(unsigned long sig, struct k_sigaction *ka, |
| 611 | siginfo_t *info, sigset_t *oldset, | 605 | siginfo_t *info, sigset_t *oldset, |
| 612 | struct pt_regs * regs, int syscall) | 606 | struct pt_regs * regs) |
| 613 | { | 607 | { |
| 614 | struct thread_info *thread = current_thread_info(); | 608 | struct thread_info *thread = current_thread_info(); |
| 615 | struct task_struct *tsk = current; | 609 | struct task_struct *tsk = current; |
| @@ -617,26 +611,6 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, | |||
| 617 | int ret; | 611 | int ret; |
| 618 | 612 | ||
| 619 | /* | 613 | /* |
| 620 | * If we were from a system call, check for system call restarting... | ||
| 621 | */ | ||
| 622 | if (syscall) { | ||
| 623 | switch (regs->ARM_r0) { | ||
| 624 | case -ERESTART_RESTARTBLOCK: | ||
| 625 | case -ERESTARTNOHAND: | ||
| 626 | regs->ARM_r0 = -EINTR; | ||
| 627 | break; | ||
| 628 | case -ERESTARTSYS: | ||
| 629 | if (!(ka->sa.sa_flags & SA_RESTART)) { | ||
| 630 | regs->ARM_r0 = -EINTR; | ||
| 631 | break; | ||
| 632 | } | ||
| 633 | /* fallthrough */ | ||
| 634 | case -ERESTARTNOINTR: | ||
| 635 | setup_syscall_restart(regs); | ||
| 636 | } | ||
| 637 | } | ||
| 638 | |||
| 639 | /* | ||
| 640 | * translate the signal | 614 | * translate the signal |
| 641 | */ | 615 | */ |
| 642 | if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap) | 616 | if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap) |
| @@ -685,6 +659,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, | |||
| 685 | */ | 659 | */ |
| 686 | static void do_signal(struct pt_regs *regs, int syscall) | 660 | static void do_signal(struct pt_regs *regs, int syscall) |
| 687 | { | 661 | { |
| 662 | unsigned int retval = 0, continue_addr = 0, restart_addr = 0; | ||
| 688 | struct k_sigaction ka; | 663 | struct k_sigaction ka; |
| 689 | siginfo_t info; | 664 | siginfo_t info; |
| 690 | int signr; | 665 | int signr; |
| @@ -698,18 +673,61 @@ static void do_signal(struct pt_regs *regs, int syscall) | |||
| 698 | if (!user_mode(regs)) | 673 | if (!user_mode(regs)) |
| 699 | return; | 674 | return; |
| 700 | 675 | ||
| 676 | /* | ||
| 677 | * If we were from a system call, check for system call restarting... | ||
| 678 | */ | ||
| 679 | if (syscall) { | ||
| 680 | continue_addr = regs->ARM_pc; | ||
| 681 | restart_addr = continue_addr - (thumb_mode(regs) ? 2 : 4); | ||
| 682 | retval = regs->ARM_r0; | ||
| 683 | |||
| 684 | /* | ||
| 685 | * Prepare for system call restart. We do this here so that a | ||
| 686 | * debugger will see the already changed PSW. | ||
| 687 | */ | ||
| 688 | switch (retval) { | ||
| 689 | case -ERESTARTNOHAND: | ||
| 690 | case -ERESTARTSYS: | ||
| 691 | case -ERESTARTNOINTR: | ||
| 692 | regs->ARM_r0 = regs->ARM_ORIG_r0; | ||
| 693 | regs->ARM_pc = restart_addr; | ||
| 694 | break; | ||
| 695 | case -ERESTART_RESTARTBLOCK: | ||
| 696 | regs->ARM_r0 = -EINTR; | ||
| 697 | break; | ||
| 698 | } | ||
| 699 | } | ||
| 700 | |||
| 701 | if (try_to_freeze()) | 701 | if (try_to_freeze()) |
| 702 | goto no_signal; | 702 | goto no_signal; |
| 703 | 703 | ||
| 704 | /* | ||
| 705 | * Get the signal to deliver. When running under ptrace, at this | ||
| 706 | * point the debugger may change all our registers ... | ||
| 707 | */ | ||
| 704 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 708 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
| 705 | if (signr > 0) { | 709 | if (signr > 0) { |
| 706 | sigset_t *oldset; | 710 | sigset_t *oldset; |
| 707 | 711 | ||
| 712 | /* | ||
| 713 | * Depending on the signal settings we may need to revert the | ||
| 714 | * decision to restart the system call. But skip this if a | ||
| 715 | * debugger has chosen to restart at a different PC. | ||
| 716 | */ | ||
| 717 | if (regs->ARM_pc == restart_addr) { | ||
| 718 | if (retval == -ERESTARTNOHAND | ||
| 719 | || (retval == -ERESTARTSYS | ||
| 720 | && !(ka.sa.sa_flags & SA_RESTART))) { | ||
| 721 | regs->ARM_r0 = -EINTR; | ||
| 722 | regs->ARM_pc = continue_addr; | ||
| 723 | } | ||
| 724 | } | ||
| 725 | |||
| 708 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 726 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
| 709 | oldset = ¤t->saved_sigmask; | 727 | oldset = ¤t->saved_sigmask; |
| 710 | else | 728 | else |
| 711 | oldset = ¤t->blocked; | 729 | oldset = ¤t->blocked; |
| 712 | if (handle_signal(signr, &ka, &info, oldset, regs, syscall) == 0) { | 730 | if (handle_signal(signr, &ka, &info, oldset, regs) == 0) { |
| 713 | /* | 731 | /* |
| 714 | * A signal was successfully delivered; the saved | 732 | * A signal was successfully delivered; the saved |
| 715 | * sigmask will have been stored in the signal frame, | 733 | * sigmask will have been stored in the signal frame, |
| @@ -723,11 +741,14 @@ static void do_signal(struct pt_regs *regs, int syscall) | |||
| 723 | } | 741 | } |
| 724 | 742 | ||
| 725 | no_signal: | 743 | no_signal: |
| 726 | /* | ||
| 727 | * No signal to deliver to the process - restart the syscall. | ||
| 728 | */ | ||
| 729 | if (syscall) { | 744 | if (syscall) { |
| 730 | if (regs->ARM_r0 == -ERESTART_RESTARTBLOCK) { | 745 | /* |
| 746 | * Handle restarting a different system call. As above, | ||
| 747 | * if a debugger has chosen to restart at a different PC, | ||
| 748 | * ignore the restart. | ||
| 749 | */ | ||
| 750 | if (retval == -ERESTART_RESTARTBLOCK | ||
| 751 | && regs->ARM_pc == continue_addr) { | ||
| 731 | if (thumb_mode(regs)) { | 752 | if (thumb_mode(regs)) { |
| 732 | regs->ARM_r7 = __NR_restart_syscall - __NR_SYSCALL_BASE; | 753 | regs->ARM_r7 = __NR_restart_syscall - __NR_SYSCALL_BASE; |
| 733 | regs->ARM_pc -= 2; | 754 | regs->ARM_pc -= 2; |
| @@ -750,11 +771,6 @@ static void do_signal(struct pt_regs *regs, int syscall) | |||
| 750 | #endif | 771 | #endif |
| 751 | } | 772 | } |
| 752 | } | 773 | } |
| 753 | if (regs->ARM_r0 == -ERESTARTNOHAND || | ||
| 754 | regs->ARM_r0 == -ERESTARTSYS || | ||
| 755 | regs->ARM_r0 == -ERESTARTNOINTR) { | ||
| 756 | setup_syscall_restart(regs); | ||
| 757 | } | ||
| 758 | 774 | ||
| 759 | /* If there's no signal to deliver, we just put the saved sigmask | 775 | /* If there's no signal to deliver, we just put the saved sigmask |
| 760 | * back. | 776 | * back. |
diff --git a/arch/arm/mach-realview/include/mach/barriers.h b/arch/arm/mach-realview/include/mach/barriers.h index 0c5d749d7b5f..9a732195aa1c 100644 --- a/arch/arm/mach-realview/include/mach/barriers.h +++ b/arch/arm/mach-realview/include/mach/barriers.h | |||
| @@ -4,5 +4,5 @@ | |||
| 4 | * operation to deadlock the system. | 4 | * operation to deadlock the system. |
| 5 | */ | 5 | */ |
| 6 | #define mb() dsb() | 6 | #define mb() dsb() |
| 7 | #define rmb() dmb() | 7 | #define rmb() dsb() |
| 8 | #define wmb() mb() | 8 | #define wmb() mb() |
diff --git a/arch/arm/mach-tegra/include/mach/barriers.h b/arch/arm/mach-tegra/include/mach/barriers.h index cc115174899b..425b42e91ef6 100644 --- a/arch/arm/mach-tegra/include/mach/barriers.h +++ b/arch/arm/mach-tegra/include/mach/barriers.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #include <asm/outercache.h> | 24 | #include <asm/outercache.h> |
| 25 | 25 | ||
| 26 | #define rmb() dmb() | 26 | #define rmb() dsb() |
| 27 | #define wmb() do { dsb(); outer_sync(); } while (0) | 27 | #define wmb() do { dsb(); outer_sync(); } while (0) |
| 28 | #define mb() wmb() | 28 | #define mb() wmb() |
| 29 | 29 | ||
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index e5f6fc428348..e591513bb53e 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
| @@ -392,7 +392,7 @@ free_memmap(unsigned long start_pfn, unsigned long end_pfn) | |||
| 392 | * Convert start_pfn/end_pfn to a struct page pointer. | 392 | * Convert start_pfn/end_pfn to a struct page pointer. |
| 393 | */ | 393 | */ |
| 394 | start_pg = pfn_to_page(start_pfn - 1) + 1; | 394 | start_pg = pfn_to_page(start_pfn - 1) + 1; |
| 395 | end_pg = pfn_to_page(end_pfn); | 395 | end_pg = pfn_to_page(end_pfn - 1) + 1; |
| 396 | 396 | ||
| 397 | /* | 397 | /* |
| 398 | * Convert to physical addresses, and | 398 | * Convert to physical addresses, and |
| @@ -426,6 +426,14 @@ static void __init free_unused_memmap(struct meminfo *mi) | |||
| 426 | 426 | ||
| 427 | bank_start = bank_pfn_start(bank); | 427 | bank_start = bank_pfn_start(bank); |
| 428 | 428 | ||
| 429 | #ifdef CONFIG_SPARSEMEM | ||
| 430 | /* | ||
| 431 | * Take care not to free memmap entries that don't exist | ||
| 432 | * due to SPARSEMEM sections which aren't present. | ||
| 433 | */ | ||
| 434 | bank_start = min(bank_start, | ||
| 435 | ALIGN(prev_bank_end, PAGES_PER_SECTION)); | ||
| 436 | #endif | ||
| 429 | /* | 437 | /* |
| 430 | * If we had a previous bank, and there is a space | 438 | * If we had a previous bank, and there is a space |
| 431 | * between the current bank and the previous, free it. | 439 | * between the current bank and the previous, free it. |
| @@ -440,6 +448,12 @@ static void __init free_unused_memmap(struct meminfo *mi) | |||
| 440 | */ | 448 | */ |
| 441 | prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES); | 449 | prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES); |
| 442 | } | 450 | } |
| 451 | |||
| 452 | #ifdef CONFIG_SPARSEMEM | ||
| 453 | if (!IS_ALIGNED(prev_bank_end, PAGES_PER_SECTION)) | ||
| 454 | free_memmap(prev_bank_end, | ||
| 455 | ALIGN(prev_bank_end, PAGES_PER_SECTION)); | ||
| 456 | #endif | ||
| 443 | } | 457 | } |
| 444 | 458 | ||
| 445 | static void __init free_highpages(void) | 459 | static void __init free_highpages(void) |
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c index 4af235d41fda..fbfb5b47c506 100644 --- a/drivers/net/arm/etherh.c +++ b/drivers/net/arm/etherh.c | |||
| @@ -527,7 +527,7 @@ static void __init etherh_banner(void) | |||
| 527 | * Read the ethernet address string from the on board rom. | 527 | * Read the ethernet address string from the on board rom. |
| 528 | * This is an ascii string... | 528 | * This is an ascii string... |
| 529 | */ | 529 | */ |
| 530 | static int __init etherh_addr(char *addr, struct expansion_card *ec) | 530 | static int __devinit etherh_addr(char *addr, struct expansion_card *ec) |
| 531 | { | 531 | { |
| 532 | struct in_chunk_dir cd; | 532 | struct in_chunk_dir cd; |
| 533 | char *s; | 533 | char *s; |
| @@ -655,7 +655,7 @@ static const struct net_device_ops etherh_netdev_ops = { | |||
| 655 | static u32 etherh_regoffsets[16]; | 655 | static u32 etherh_regoffsets[16]; |
| 656 | static u32 etherm_regoffsets[16]; | 656 | static u32 etherm_regoffsets[16]; |
| 657 | 657 | ||
| 658 | static int __init | 658 | static int __devinit |
| 659 | etherh_probe(struct expansion_card *ec, const struct ecard_id *id) | 659 | etherh_probe(struct expansion_card *ec, const struct ecard_id *id) |
| 660 | { | 660 | { |
| 661 | const struct etherh_data *data = id->data; | 661 | const struct etherh_data *data = id->data; |
diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c index 82acb8dc4aa1..6183a57eb69d 100644 --- a/drivers/video/acornfb.c +++ b/drivers/video/acornfb.c | |||
| @@ -66,7 +66,7 @@ | |||
| 66 | * have. Allow 1% either way on the nominal for TVs. | 66 | * have. Allow 1% either way on the nominal for TVs. |
| 67 | */ | 67 | */ |
| 68 | #define NR_MONTYPES 6 | 68 | #define NR_MONTYPES 6 |
| 69 | static struct fb_monspecs monspecs[NR_MONTYPES] __initdata = { | 69 | static struct fb_monspecs monspecs[NR_MONTYPES] __devinitdata = { |
| 70 | { /* TV */ | 70 | { /* TV */ |
| 71 | .hfmin = 15469, | 71 | .hfmin = 15469, |
| 72 | .hfmax = 15781, | 72 | .hfmax = 15781, |
| @@ -873,7 +873,7 @@ static struct fb_ops acornfb_ops = { | |||
| 873 | /* | 873 | /* |
| 874 | * Everything after here is initialisation!!! | 874 | * Everything after here is initialisation!!! |
| 875 | */ | 875 | */ |
| 876 | static struct fb_videomode modedb[] __initdata = { | 876 | static struct fb_videomode modedb[] __devinitdata = { |
| 877 | { /* 320x256 @ 50Hz */ | 877 | { /* 320x256 @ 50Hz */ |
| 878 | NULL, 50, 320, 256, 125000, 92, 62, 35, 19, 38, 2, | 878 | NULL, 50, 320, 256, 125000, 92, 62, 35, 19, 38, 2, |
| 879 | FB_SYNC_COMP_HIGH_ACT, | 879 | FB_SYNC_COMP_HIGH_ACT, |
| @@ -925,8 +925,7 @@ static struct fb_videomode modedb[] __initdata = { | |||
| 925 | } | 925 | } |
| 926 | }; | 926 | }; |
| 927 | 927 | ||
| 928 | static struct fb_videomode __initdata | 928 | static struct fb_videomode acornfb_default_mode __devinitdata = { |
| 929 | acornfb_default_mode = { | ||
| 930 | .name = NULL, | 929 | .name = NULL, |
| 931 | .refresh = 60, | 930 | .refresh = 60, |
| 932 | .xres = 640, | 931 | .xres = 640, |
| @@ -942,7 +941,7 @@ acornfb_default_mode = { | |||
| 942 | .vmode = FB_VMODE_NONINTERLACED | 941 | .vmode = FB_VMODE_NONINTERLACED |
| 943 | }; | 942 | }; |
| 944 | 943 | ||
| 945 | static void __init acornfb_init_fbinfo(void) | 944 | static void __devinit acornfb_init_fbinfo(void) |
| 946 | { | 945 | { |
| 947 | static int first = 1; | 946 | static int first = 1; |
| 948 | 947 | ||
| @@ -1018,8 +1017,7 @@ static void __init acornfb_init_fbinfo(void) | |||
| 1018 | * size can optionally be followed by 'M' or 'K' for | 1017 | * size can optionally be followed by 'M' or 'K' for |
| 1019 | * MB or KB respectively. | 1018 | * MB or KB respectively. |
| 1020 | */ | 1019 | */ |
| 1021 | static void __init | 1020 | static void __devinit acornfb_parse_mon(char *opt) |
| 1022 | acornfb_parse_mon(char *opt) | ||
| 1023 | { | 1021 | { |
| 1024 | char *p = opt; | 1022 | char *p = opt; |
| 1025 | 1023 | ||
| @@ -1066,8 +1064,7 @@ bad: | |||
| 1066 | current_par.montype = -1; | 1064 | current_par.montype = -1; |
| 1067 | } | 1065 | } |
| 1068 | 1066 | ||
| 1069 | static void __init | 1067 | static void __devinit acornfb_parse_montype(char *opt) |
| 1070 | acornfb_parse_montype(char *opt) | ||
| 1071 | { | 1068 | { |
| 1072 | current_par.montype = -2; | 1069 | current_par.montype = -2; |
| 1073 | 1070 | ||
| @@ -1108,8 +1105,7 @@ acornfb_parse_montype(char *opt) | |||
| 1108 | } | 1105 | } |
| 1109 | } | 1106 | } |
| 1110 | 1107 | ||
| 1111 | static void __init | 1108 | static void __devinit acornfb_parse_dram(char *opt) |
| 1112 | acornfb_parse_dram(char *opt) | ||
| 1113 | { | 1109 | { |
| 1114 | unsigned int size; | 1110 | unsigned int size; |
| 1115 | 1111 | ||
| @@ -1134,15 +1130,14 @@ acornfb_parse_dram(char *opt) | |||
| 1134 | static struct options { | 1130 | static struct options { |
| 1135 | char *name; | 1131 | char *name; |
| 1136 | void (*parse)(char *opt); | 1132 | void (*parse)(char *opt); |
| 1137 | } opt_table[] __initdata = { | 1133 | } opt_table[] __devinitdata = { |
| 1138 | { "mon", acornfb_parse_mon }, | 1134 | { "mon", acornfb_parse_mon }, |
| 1139 | { "montype", acornfb_parse_montype }, | 1135 | { "montype", acornfb_parse_montype }, |
| 1140 | { "dram", acornfb_parse_dram }, | 1136 | { "dram", acornfb_parse_dram }, |
| 1141 | { NULL, NULL } | 1137 | { NULL, NULL } |
| 1142 | }; | 1138 | }; |
| 1143 | 1139 | ||
| 1144 | int __init | 1140 | static int __devinit acornfb_setup(char *options) |
| 1145 | acornfb_setup(char *options) | ||
| 1146 | { | 1141 | { |
| 1147 | struct options *optp; | 1142 | struct options *optp; |
| 1148 | char *opt; | 1143 | char *opt; |
| @@ -1179,8 +1174,7 @@ acornfb_setup(char *options) | |||
| 1179 | * Detect type of monitor connected | 1174 | * Detect type of monitor connected |
| 1180 | * For now, we just assume SVGA | 1175 | * For now, we just assume SVGA |
| 1181 | */ | 1176 | */ |
| 1182 | static int __init | 1177 | static int __devinit acornfb_detect_monitortype(void) |
| 1183 | acornfb_detect_monitortype(void) | ||
| 1184 | { | 1178 | { |
| 1185 | return 4; | 1179 | return 4; |
| 1186 | } | 1180 | } |
