Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'parisc-4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc updates from Helge Deller:
"Major changes include:

- Full support of the firmware Page Deallocation Table with
MADV_HWPOISON and MADV_SOFT_OFFLINE. A kernel thread scans
regularily for new bad memory pages.

- Full support for self-extracting kernel.

- Added UBSAN support.

- Lots of section mismatch fixes across all parisc drivers.

- Added examples for %pF and %pS usage in printk-formats.txt"

* 'parisc-4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: (28 commits)
printk-formats.txt: Add examples for %pF and %pS usage
parisc: Fix up devices below a PCI-PCI MegaRAID controller bridge
parisc/core: Fix section mismatches
parisc/ipmi_si_intf: Fix section mismatches on parisc platform
parisc/input/hilkbd: Fix section mismatches
parisc/net/lasi_82596: Fix section mismatches
parisc/serio: Fix section mismatches in gscps2 and hp_sdc drivers
parisc: Fix section mismatches in parisc core drivers
parisc/parport_gsc: Fix section mismatches
parisc/scsi/lasi700: Fix section mismatches
parisc/scsi/zalon: Fix section mismatches
parisc/8250_gsc: Fix section mismatches
parisc/mux: Fix section mismatches
parisc/sticore: Fix section mismatches
parisc/harmony: Fix section mismatches
parisc: Wire up support for self-extracting kernel
parisc: Make existing core files reuseable for bootloader
parisc: Add core code for self-extracting kernel
parisc: Enable UBSAN support
parisc/random: Add machine specific randomness
...

+1184 -159
+10
Documentation/printk-formats.txt
··· 75 75 consideration the effect of compiler optimisations which may occur 76 76 when tail-call``s are used and marked with the noreturn GCC attribute. 77 77 78 + Examples:: 79 + 80 + printk("Going to call: %pF\n", gettimeofday); 81 + printk("Going to call: %pF\n", p->func); 82 + printk("%s: called from %pS\n", __func__, (void *)_RET_IP_); 83 + printk("%s: called from %pS\n", __func__, 84 + (void *)__builtin_return_address(0)); 85 + printk("Faulted at %pS\n", (void *)regs->ip); 86 + printk(" %s%pB\n", (reliable ? "" : "? "), (void *)*stack); 87 + 78 88 79 89 Kernel Pointers 80 90 ===============
+9
arch/parisc/Kconfig
··· 9 9 select ARCH_WANT_FRAME_POINTERS 10 10 select ARCH_HAS_ELF_RANDOMIZE 11 11 select ARCH_HAS_STRICT_KERNEL_RWX 12 + select ARCH_HAS_UBSAN_SANITIZE_ALL 13 + select ARCH_WANTS_UBSAN_NO_NULL 14 + select ARCH_SUPPORTS_MEMORY_FAILURE 12 15 select RTC_CLASS 13 16 select RTC_DRV_GENERIC 14 17 select INIT_ALL_POSSIBLE ··· 20 17 select BUG 21 18 select BUILDTIME_EXTABLE_SORT 22 19 select HAVE_PERF_EVENTS 20 + select HAVE_KERNEL_BZIP2 21 + select HAVE_KERNEL_GZIP 22 + select HAVE_KERNEL_LZ4 23 + select HAVE_KERNEL_LZMA 24 + select HAVE_KERNEL_LZO 25 + select HAVE_KERNEL_XZ 23 26 select GENERIC_ATOMIC64 if !64BIT 24 27 select GENERIC_IRQ_PROBE 25 28 select GENERIC_PCI_IOMAP
+13 -3
arch/parisc/Makefile
··· 24 24 NM = sh $(srctree)/arch/parisc/nm 25 25 CHECKFLAGS += -D__hppa__=1 26 26 LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 27 + export LIBGCC 27 28 28 29 ifdef CONFIG_64BIT 29 30 UTS_MACHINE := parisc64 30 31 CHECKFLAGS += -D__LP64__=1 -m64 31 32 CC_ARCHES = hppa64 33 + LD_BFD := elf64-hppa-linux 32 34 else # 32-bit 33 35 CC_ARCHES = hppa hppa2.0 hppa1.1 36 + LD_BFD := elf32-hppa-linux 34 37 endif 38 + 39 + export LD_BFD 35 40 36 41 ifneq ($(SUBARCH),$(UTS_MACHINE)) 37 42 ifeq ($(CROSS_COMPILE),) ··· 93 88 94 89 drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/ 95 90 91 + boot := arch/parisc/boot 92 + 96 93 PALO := $(shell if (which palo 2>&1); then : ; \ 97 94 elif [ -x /sbin/palo ]; then echo /sbin/palo; \ 98 95 fi) ··· 123 116 124 117 PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS) 125 118 126 - bzImage zImage: vmlinuz 119 + zImage: vmlinuz 127 120 Image: vmlinux 128 121 129 - vmlinuz: vmlinux 130 - @gzip -cf -9 $< > $@ 122 + bzImage: vmlinux 123 + $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 124 + 125 + vmlinuz: bzImage 126 + $(OBJCOPY) $(boot)/bzImage $@ 131 127 132 128 install: 133 129 $(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
+2
arch/parisc/boot/.gitignore
··· 1 + image 2 + bzImage
+26
arch/parisc/boot/Makefile
··· 1 + # 2 + # Makefile for the linux parisc-specific parts of the boot image creator. 3 + # 4 + 5 + COMPILE_VERSION := __linux_compile_version_id__`hostname | \ 6 + tr -c '[0-9A-Za-z]' '_'`__`date | \ 7 + tr -c '[0-9A-Za-z]' '_'`_t 8 + 9 + ccflags-y := -DCOMPILE_VERSION=$(COMPILE_VERSION) -gstabs -I. 10 + 11 + targets := image 12 + targets += bzImage 13 + subdir- := compressed 14 + 15 + $(obj)/image: vmlinux FORCE 16 + $(call if_changed,objcopy) 17 + 18 + $(obj)/bzImage: $(obj)/compressed/vmlinux FORCE 19 + $(call if_changed,objcopy) 20 + 21 + $(obj)/compressed/vmlinux: FORCE 22 + $(Q)$(MAKE) $(build)=$(obj)/compressed $@ 23 + 24 + install: $(CONFIGURE) $(obj)/bzImage 25 + sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ 26 + System.map "$(INSTALL_PATH)"
+3
arch/parisc/boot/compressed/.gitignore
··· 1 + sizes.h 2 + vmlinux 3 + vmlinux.lds
+86
arch/parisc/boot/compressed/Makefile
··· 1 + # 2 + # linux/arch/parisc/boot/compressed/Makefile 3 + # 4 + # create a compressed self-extracting vmlinux image from the original vmlinux 5 + # 6 + 7 + KCOV_INSTRUMENT := n 8 + GCOV_PROFILE := n 9 + UBSAN_SANITIZE := n 10 + 11 + targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 12 + targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4 13 + targets += misc.o piggy.o sizes.h head.o real2.o firmware.o 14 + 15 + KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER 16 + KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING 17 + KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks 18 + KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs 19 + ifndef CONFIG_64BIT 20 + KBUILD_CFLAGS += -mfast-indirect-calls 21 + endif 22 + 23 + OBJECTS += $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o $(obj)/piggy.o 24 + 25 + # LDFLAGS_vmlinux := -X --whole-archive -e startup -T 26 + LDFLAGS_vmlinux := -X -e startup --as-needed -T 27 + $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(LIBGCC) 28 + $(call if_changed,ld) 29 + 30 + sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p' 31 + 32 + quiet_cmd_sizes = GEN $@ 33 + cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@ 34 + 35 + $(obj)/sizes.h: vmlinux 36 + $(call if_changed,sizes) 37 + 38 + AFLAGS_head.o += -I$(objtree)/$(obj) -DBOOTLOADER 39 + $(obj)/head.o: $(obj)/sizes.h 40 + 41 + CFLAGS_misc.o += -I$(objtree)/$(obj) 42 + $(obj)/misc.o: $(obj)/sizes.h 43 + 44 + $(obj)/firmware.o: $(obj)/firmware.c 45 + $(obj)/firmware.c: $(srctree)/arch/$(SRCARCH)/kernel/firmware.c 46 + $(call cmd,shipped) 47 + 48 + AFLAGS_real2.o += -DBOOTLOADER 49 + $(obj)/real2.o: $(obj)/real2.S 50 + $(obj)/real2.S: $(srctree)/arch/$(SRCARCH)/kernel/real2.S 51 + $(call cmd,shipped) 52 + 53 + $(obj)/misc.o: $(obj)/sizes.h 54 + 55 + CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER 56 + $(obj)/vmlinux.lds: $(obj)/sizes.h 57 + 58 + OBJCOPYFLAGS_vmlinux.bin := -O binary -R .comment -S 59 + $(obj)/vmlinux.bin: vmlinux 60 + $(call if_changed,objcopy) 61 + 62 + vmlinux.bin.all-y := $(obj)/vmlinux.bin 63 + 64 + suffix-$(CONFIG_KERNEL_GZIP) := gz 65 + suffix-$(CONFIG_KERNEL_BZIP2) := bz2 66 + suffix-$(CONFIG_KERNEL_LZ4) := lz4 67 + suffix-$(CONFIG_KERNEL_LZMA) := lzma 68 + suffix-$(CONFIG_KERNEL_LZO) := lzo 69 + suffix-$(CONFIG_KERNEL_XZ) := xz 70 + 71 + $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) 72 + $(call if_changed,gzip) 73 + $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) 74 + $(call if_changed,bzip2) 75 + $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) 76 + $(call if_changed,lz4) 77 + $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) 78 + $(call if_changed,lzma) 79 + $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) 80 + $(call if_changed,lzo) 81 + $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) 82 + $(call if_changed,xzkern) 83 + 84 + LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T 85 + $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) 86 + $(call if_changed,ld)
+85
arch/parisc/boot/compressed/head.S
··· 1 + /* 2 + * Startup glue code to uncompress the kernel 3 + * 4 + * (C) 2017 Helge Deller <deller@gmx.de> 5 + */ 6 + 7 + #include <linux/init.h> 8 + #include <linux/linkage.h> 9 + #include <asm/asm-offsets.h> 10 + #include <asm/page.h> 11 + #include <asm/psw.h> 12 + #include <asm/pdc.h> 13 + #include <asm/assembly.h> 14 + #include "sizes.h" 15 + 16 + #define BOOTADDR(x) (x) 17 + 18 + #ifndef CONFIG_64BIT 19 + .import $global$ /* forward declaration */ 20 + #endif /*!CONFIG_64BIT*/ 21 + 22 + __HEAD 23 + 24 + ENTRY(startup) 25 + .level LEVEL 26 + 27 + #define PSW_W_SM 0x200 28 + #define PSW_W_BIT 36 29 + 30 + ;! nuke the W bit, saving original value 31 + .level 2.0 32 + rsm PSW_W_SM, %r1 33 + 34 + .level 1.1 35 + extrw,u %r1, PSW_W_BIT-32, 1, %r1 36 + copy %r1, %arg0 37 + 38 + /* Make sure sr4-sr7 are set to zero for the kernel address space */ 39 + mtsp %r0,%sr4 40 + mtsp %r0,%sr5 41 + mtsp %r0,%sr6 42 + mtsp %r0,%sr7 43 + 44 + /* Clear BSS */ 45 + 46 + .import _bss,data 47 + .import _ebss,data 48 + 49 + load32 BOOTADDR(_bss),%r3 50 + load32 BOOTADDR(_ebss),%r4 51 + ldo FRAME_SIZE(%r4),%sp /* stack at end of bss */ 52 + $bss_loop: 53 + cmpb,<<,n %r3,%r4,$bss_loop 54 + stw,ma %r0,4(%r3) 55 + 56 + /* Initialize the global data pointer */ 57 + loadgp 58 + 59 + /* arg0..arg4 were set by palo. */ 60 + copy %arg1, %r6 /* command line */ 61 + copy %arg2, %r7 /* rd-start */ 62 + copy %arg3, %r8 /* rd-end */ 63 + load32 BOOTADDR(decompress_kernel),%r3 64 + 65 + #ifdef CONFIG_64BIT 66 + .level LEVEL 67 + ssm PSW_W_SM, %r0 /* set W-bit */ 68 + depdi 0, 31, 32, %r3 69 + #endif 70 + load32 BOOTADDR(startup_continue), %r2 71 + bv,n 0(%r3) 72 + 73 + startup_continue: 74 + #ifdef CONFIG_64BIT 75 + .level LEVEL 76 + rsm PSW_W_SM, %r0 /* clear W-bit */ 77 + #endif 78 + 79 + load32 KERNEL_BINARY_TEXT_START, %arg0 /* free mem */ 80 + copy %r6, %arg1 /* command line */ 81 + copy %r7, %arg2 /* rd-start */ 82 + copy %r8, %arg3 /* rd-end */ 83 + 84 + bv,n 0(%ret0) 85 + END(startup)
+301
arch/parisc/boot/compressed/misc.c
··· 1 + /* 2 + * Definitions and wrapper functions for kernel decompressor 3 + * 4 + * (C) 2017 Helge Deller <deller@gmx.de> 5 + */ 6 + 7 + #include <linux/uaccess.h> 8 + #include <asm/unaligned.h> 9 + #include <asm/page.h> 10 + #include "sizes.h" 11 + 12 + /* 13 + * gzip declarations 14 + */ 15 + #define STATIC static 16 + 17 + #undef memmove 18 + #define memmove memmove 19 + #define memzero(s, n) memset((s), 0, (n)) 20 + 21 + #define malloc malloc_gzip 22 + #define free free_gzip 23 + 24 + /* Symbols defined by linker scripts */ 25 + extern char input_data[]; 26 + extern int input_len; 27 + extern __le32 output_len; /* at unaligned address, little-endian */ 28 + extern char _text, _end; 29 + extern char _bss, _ebss; 30 + extern char _startcode_end; 31 + extern void startup_continue(void *entry, unsigned long cmdline, 32 + unsigned long rd_start, unsigned long rd_end) __noreturn; 33 + 34 + void error(char *m) __noreturn; 35 + 36 + static unsigned long free_mem_ptr; 37 + static unsigned long free_mem_end_ptr; 38 + 39 + #ifdef CONFIG_KERNEL_GZIP 40 + #include "../../../../lib/decompress_inflate.c" 41 + #endif 42 + 43 + #ifdef CONFIG_KERNEL_BZIP2 44 + #include "../../../../lib/decompress_bunzip2.c" 45 + #endif 46 + 47 + #ifdef CONFIG_KERNEL_LZ4 48 + #include "../../../../lib/decompress_unlz4.c" 49 + #endif 50 + 51 + #ifdef CONFIG_KERNEL_LZMA 52 + #include "../../../../lib/decompress_unlzma.c" 53 + #endif 54 + 55 + #ifdef CONFIG_KERNEL_LZO 56 + #include "../../../../lib/decompress_unlzo.c" 57 + #endif 58 + 59 + #ifdef CONFIG_KERNEL_XZ 60 + #include "../../../../lib/decompress_unxz.c" 61 + #endif 62 + 63 + void *memmove(void *dest, const void *src, size_t n) 64 + { 65 + const char *s = src; 66 + char *d = dest; 67 + 68 + if (d <= s) { 69 + while (n--) 70 + *d++ = *s++; 71 + } else { 72 + d += n; 73 + s += n; 74 + while (n--) 75 + *--d = *--s; 76 + } 77 + return dest; 78 + } 79 + 80 + void *memset(void *s, int c, size_t count) 81 + { 82 + char *xs = (char *)s; 83 + 84 + while (count--) 85 + *xs++ = c; 86 + return s; 87 + } 88 + 89 + void *memcpy(void *d, const void *s, size_t len) 90 + { 91 + char *dest = (char *)d; 92 + const char *source = (const char *)s; 93 + 94 + while (len--) 95 + *dest++ = *source++; 96 + return d; 97 + } 98 + 99 + size_t strlen(const char *s) 100 + { 101 + const char *sc; 102 + 103 + for (sc = s; *sc != '\0'; ++sc) 104 + ; 105 + return sc - s; 106 + } 107 + 108 + char *strchr(const char *s, int c) 109 + { 110 + while (*s) { 111 + if (*s == (char)c) 112 + return (char *)s; 113 + ++s; 114 + } 115 + return NULL; 116 + } 117 + 118 + int puts(const char *s) 119 + { 120 + const char *nuline = s; 121 + 122 + while ((nuline = strchr(s, '\n')) != NULL) { 123 + if (nuline != s) 124 + pdc_iodc_print(s, nuline - s); 125 + pdc_iodc_print("\r\n", 2); 126 + s = nuline + 1; 127 + } 128 + if (*s != '\0') 129 + pdc_iodc_print(s, strlen(s)); 130 + 131 + return 0; 132 + } 133 + 134 + static int putchar(int c) 135 + { 136 + char buf[2]; 137 + 138 + buf[0] = c; 139 + buf[1] = '\0'; 140 + puts(buf); 141 + return c; 142 + } 143 + 144 + void __noreturn error(char *x) 145 + { 146 + puts("\n\n"); 147 + puts(x); 148 + puts("\n\n -- System halted"); 149 + while (1) /* wait forever */ 150 + ; 151 + } 152 + 153 + static int print_hex(unsigned long num) 154 + { 155 + const char hex[] = "0123456789abcdef"; 156 + char str[40]; 157 + int i = sizeof(str)-1; 158 + 159 + str[i--] = '\0'; 160 + do { 161 + str[i--] = hex[num & 0x0f]; 162 + num >>= 4; 163 + } while (num); 164 + 165 + str[i--] = 'x'; 166 + str[i] = '0'; 167 + puts(&str[i]); 168 + 169 + return 0; 170 + } 171 + 172 + int printf(const char *fmt, ...) 173 + { 174 + va_list args; 175 + int i = 0; 176 + 177 + va_start(args, fmt); 178 + 179 + while (fmt[i]) { 180 + if (fmt[i] != '%') { 181 + put: 182 + putchar(fmt[i++]); 183 + continue; 184 + } 185 + 186 + if (fmt[++i] == '%') 187 + goto put; 188 + ++i; 189 + print_hex(va_arg(args, unsigned long)); 190 + } 191 + 192 + va_end(args); 193 + return 0; 194 + } 195 + 196 + /* helper functions for libgcc */ 197 + void abort(void) 198 + { 199 + error("aborted."); 200 + } 201 + 202 + #undef malloc 203 + void *malloc(size_t size) 204 + { 205 + return malloc_gzip(size); 206 + } 207 + 208 + #undef free 209 + void free(void *ptr) 210 + { 211 + return free_gzip(ptr); 212 + } 213 + 214 + 215 + static void flush_data_cache(char *start, unsigned long length) 216 + { 217 + char *end = start + length; 218 + 219 + do { 220 + asm volatile("fdc 0(%0)" : : "r" (start)); 221 + asm volatile("fic 0(%%sr0,%0)" : : "r" (start)); 222 + start += 16; 223 + } while (start < end); 224 + asm volatile("fdc 0(%0)" : : "r" (end)); 225 + 226 + asm ("sync"); 227 + } 228 + 229 + unsigned long decompress_kernel(unsigned int started_wide, 230 + unsigned int command_line, 231 + const unsigned int rd_start, 232 + const unsigned int rd_end) 233 + { 234 + char *output; 235 + unsigned long len, len_all; 236 + 237 + #ifdef CONFIG_64BIT 238 + parisc_narrow_firmware = 0; 239 + #endif 240 + 241 + set_firmware_width_unlocked(); 242 + 243 + putchar('U'); /* if you get this p and no more, string storage */ 244 + /* in $GLOBAL$ is wrong or %dp is wrong */ 245 + puts("ncompressing ...\n"); 246 + 247 + output = (char *) KERNEL_BINARY_TEXT_START; 248 + len_all = __pa(SZ_end) - __pa(SZparisc_kernel_start); 249 + 250 + if ((unsigned long) &_startcode_end > (unsigned long) output) 251 + error("Bootcode overlaps kernel code"); 252 + 253 + len = get_unaligned_le32(&output_len); 254 + if (len > len_all) 255 + error("Output len too big."); 256 + else 257 + memset(&output[len], 0, len_all - len); 258 + 259 + /* 260 + * Initialize free_mem_ptr and free_mem_end_ptr. 261 + */ 262 + free_mem_ptr = (unsigned long) &_ebss; 263 + free_mem_ptr += 2*1024*1024; /* leave 2 MB for stack */ 264 + 265 + /* Limit memory for bootoader to 1GB */ 266 + #define ARTIFICIAL_LIMIT (1*1024*1024*1024) 267 + free_mem_end_ptr = PAGE0->imm_max_mem; 268 + if (free_mem_end_ptr > ARTIFICIAL_LIMIT) 269 + free_mem_end_ptr = ARTIFICIAL_LIMIT; 270 + 271 + #ifdef CONFIG_BLK_DEV_INITRD 272 + /* if we have ramdisk this is at end of memory */ 273 + if (rd_start && rd_start < free_mem_end_ptr) 274 + free_mem_end_ptr = rd_start; 275 + #endif 276 + 277 + #ifdef DEBUG 278 + printf("startcode_end = %x\n", &_startcode_end); 279 + printf("commandline = %x\n", command_line); 280 + printf("rd_start = %x\n", rd_start); 281 + printf("rd_end = %x\n", rd_end); 282 + 283 + printf("free_ptr = %x\n", free_mem_ptr); 284 + printf("free_ptr_end = %x\n", free_mem_end_ptr); 285 + 286 + printf("input_data = %x\n", input_data); 287 + printf("input_len = %x\n", input_len); 288 + printf("output = %x\n", output); 289 + printf("output_len = %x\n", len); 290 + printf("output_max = %x\n", len_all); 291 + #endif 292 + 293 + __decompress(input_data, input_len, NULL, NULL, 294 + output, 0, NULL, error); 295 + 296 + flush_data_cache(output, len); 297 + 298 + printf("Booting kernel ...\n\n"); 299 + 300 + return (unsigned long) output; 301 + }
+101
arch/parisc/boot/compressed/vmlinux.lds.S
··· 1 + #include <asm-generic/vmlinux.lds.h> 2 + #include <asm/page.h> 3 + #include "sizes.h" 4 + 5 + #ifndef CONFIG_64BIT 6 + OUTPUT_FORMAT("elf32-hppa-linux") 7 + OUTPUT_ARCH(hppa) 8 + #else 9 + OUTPUT_FORMAT("elf64-hppa-linux") 10 + OUTPUT_ARCH(hppa:hppa2.0w) 11 + #endif 12 + 13 + ENTRY(startup) 14 + 15 + SECTIONS 16 + { 17 + /* palo loads at 0x60000 */ 18 + /* loaded kernel will move to 0x10000 */ 19 + . = 0xe0000; /* should not overwrite palo code */ 20 + 21 + .head.text : { 22 + _head = . ; 23 + HEAD_TEXT 24 + _ehead = . ; 25 + } 26 + 27 + /* keep __gp below 0x1000000 */ 28 + #ifdef CONFIG_64BIT 29 + . = ALIGN(16); 30 + /* Linkage tables */ 31 + .opd : { 32 + *(.opd) 33 + } PROVIDE (__gp = .); 34 + .plt : { 35 + *(.plt) 36 + } 37 + .dlt : { 38 + *(.dlt) 39 + } 40 + #endif 41 + _startcode_end = .; 42 + 43 + /* bootloader code and data starts behind area of extracted kernel */ 44 + . = (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START); 45 + 46 + /* align on next page boundary */ 47 + . = ALIGN(4096); 48 + .text : { 49 + _text = .; /* Text */ 50 + *(.text) 51 + *(.text.*) 52 + _etext = . ; 53 + } 54 + . = ALIGN(8); 55 + .data : { 56 + _data = . ; 57 + *(.data) 58 + *(.data.*) 59 + _edata = . ; 60 + } 61 + . = ALIGN(8); 62 + .rodata : { 63 + _rodata = . ; 64 + *(.rodata) /* read-only data */ 65 + *(.rodata.*) 66 + _erodata = . ; 67 + } 68 + . = ALIGN(8); 69 + .rodata.compressed : { 70 + *(.rodata.compressed) 71 + } 72 + . = ALIGN(8); 73 + .bss : { 74 + _bss = . ; 75 + *(.bss) 76 + *(.bss.*) 77 + *(COMMON) 78 + . = ALIGN(4096); 79 + _ebss = .; 80 + } 81 + 82 + STABS_DEBUG 83 + .note 0 : { *(.note) } 84 + 85 + /* Sections to be discarded */ 86 + DISCARDS 87 + /DISCARD/ : { 88 + #ifdef CONFIG_64BIT 89 + /* temporary hack until binutils is fixed to not emit these 90 + * for static binaries 91 + */ 92 + *(.PARISC.unwind) /* no unwind data */ 93 + *(.interp) 94 + *(.dynsym) 95 + *(.dynstr) 96 + *(.dynamic) 97 + *(.hash) 98 + *(.gnu.hash) 99 + #endif 100 + } 101 + }
+10
arch/parisc/boot/compressed/vmlinux.scr
··· 1 + SECTIONS 2 + { 3 + .rodata.compressed : { 4 + input_len = .; 5 + LONG(input_data_end - input_data) input_data = .; 6 + *(.data) 7 + output_len = . - 4; /* can be at unaligned address */ 8 + input_data_end = .; 9 + } 10 + }
+65
arch/parisc/boot/install.sh
··· 1 + #!/bin/sh 2 + # 3 + # arch/parisc/install.sh, derived from arch/i386/boot/install.sh 4 + # 5 + # This file is subject to the terms and conditions of the GNU General Public 6 + # License. See the file "COPYING" in the main directory of this archive 7 + # for more details. 8 + # 9 + # Copyright (C) 1995 by Linus Torvalds 10 + # 11 + # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin 12 + # 13 + # "make install" script for i386 architecture 14 + # 15 + # Arguments: 16 + # $1 - kernel version 17 + # $2 - kernel image file 18 + # $3 - kernel map file 19 + # $4 - default install path (blank if root directory) 20 + # 21 + 22 + verify () { 23 + if [ ! -f "$1" ]; then 24 + echo "" 1>&2 25 + echo " *** Missing file: $1" 1>&2 26 + echo ' *** You need to run "make" before "make install".' 1>&2 27 + echo "" 1>&2 28 + exit 1 29 + fi 30 + } 31 + 32 + # Make sure the files actually exist 33 + 34 + verify "$2" 35 + verify "$3" 36 + 37 + # User may have a custom install script 38 + 39 + if [ -n "${INSTALLKERNEL}" ]; then 40 + if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi 41 + if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi 42 + fi 43 + 44 + # Default install 45 + 46 + if [ "$(basename $2)" = "zImage" ]; then 47 + # Compressed install 48 + echo "Installing compressed kernel" 49 + base=vmlinuz 50 + else 51 + # Normal install 52 + echo "Installing normal kernel" 53 + base=vmlinux 54 + fi 55 + 56 + if [ -f $4/$base-$1 ]; then 57 + mv $4/$base-$1 $4/$base-$1.old 58 + fi 59 + cat $2 > $4/$base-$1 60 + 61 + # Install system map file 62 + if [ -f $4/System.map-$1 ]; then 63 + mv $4/System.map-$1 $4/System.map-$1.old 64 + fi 65 + cp $3 $4/System.map-$1
+3
arch/parisc/include/asm/mmu_context.h
··· 63 63 { 64 64 unsigned long flags; 65 65 66 + if (prev == next) 67 + return; 68 + 66 69 local_irq_save(flags); 67 70 switch_mm_irqs_off(prev, next, tsk); 68 71 local_irq_restore(flags);
+4
arch/parisc/include/asm/page.h
··· 116 116 /* This governs the relationship between virtual and physical addresses. 117 117 * If you alter it, make sure to take care of our various fixed mapping 118 118 * segments in fixmap.h */ 119 + #if defined(BOOTLOADER) 120 + #define __PAGE_OFFSET (0) /* bootloader uses physical addresses */ 121 + #else 119 122 #ifdef CONFIG_64BIT 120 123 #define __PAGE_OFFSET (0x40000000) /* 1GB */ 121 124 #else 122 125 #define __PAGE_OFFSET (0x10000000) /* 256MB */ 123 126 #endif 127 + #endif /* BOOTLOADER */ 124 128 125 129 #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) 126 130
+2
arch/parisc/include/asm/pdc.h
··· 5 5 6 6 #if !defined(__ASSEMBLY__) 7 7 8 + extern int parisc_narrow_firmware; 9 + 8 10 extern int pdc_type; 9 11 extern unsigned long parisc_cell_num; /* cell number the CPU runs on (PAT) */ 10 12 extern unsigned long parisc_cell_loc; /* cell location of CPU (PAT) */
+14
arch/parisc/include/asm/pdcpat.h
··· 223 223 unsigned long clear_time; /* last PDT clear time (since Jan 1970) */ 224 224 }; 225 225 226 + struct pdc_pat_mem_cell_pdt_retinfo { /* PDC_PAT_MEM/PDC_PAT_MEM_CELL_INFO */ 227 + u64 reserved:32; 228 + u64 cs:1; /* clear status: cleared since the last call? */ 229 + u64 current_pdt_entries:15; 230 + u64 ic:1; /* interleaving had to be changed ? */ 231 + u64 max_pdt_entries:15; 232 + unsigned long good_mem; 233 + unsigned long first_dbe_loc; /* first location of double bit error */ 234 + unsigned long clear_time; /* last PDT clear time (since Jan 1970) */ 235 + }; 236 + 237 + 226 238 struct pdc_pat_mem_read_pd_retinfo { /* PDC_PAT_MEM/PDC_PAT_MEM_PD_READ */ 227 239 unsigned long actual_count_bytes; 228 240 unsigned long pdt_entries; ··· 337 325 extern int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val); 338 326 339 327 extern int pdc_pat_mem_pdt_info(struct pdc_pat_mem_retinfo *rinfo); 328 + extern int pdc_pat_mem_pdt_cell_info(struct pdc_pat_mem_cell_pdt_retinfo *rinfo, 329 + unsigned long cell); 340 330 extern int pdc_pat_mem_read_cell_pdt(struct pdc_pat_mem_read_pd_retinfo *pret, 341 331 unsigned long *pdt_entries_ptr, unsigned long max_entries); 342 332 extern int pdc_pat_mem_read_pd_pdt(struct pdc_pat_mem_read_pd_retinfo *pret,
+3 -3
arch/parisc/include/uapi/asm/mman.h
··· 40 40 #define MADV_SEQUENTIAL 2 /* expect sequential page references */ 41 41 #define MADV_WILLNEED 3 /* will need these pages */ 42 42 #define MADV_DONTNEED 4 /* don't need these pages */ 43 - #define MADV_SPACEAVAIL 5 /* insure that resources are reserved */ 44 - #define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */ 45 - #define MADV_VPS_INHERIT 7 /* Inherit parents page size */ 46 43 47 44 /* common/generic parameters */ 48 45 #define MADV_FREE 8 /* free pages only if memory pressure */ ··· 56 59 #define MADV_DONTDUMP 69 /* Explicity exclude from the core dump, 57 60 overrides the coredump filter bits */ 58 61 #define MADV_DODUMP 70 /* Clear the MADV_NODUMP flag */ 62 + 63 + #define MADV_HWPOISON 100 /* poison a page for testing */ 64 + #define MADV_SOFT_OFFLINE 101 /* soft offline page for testing */ 59 65 60 66 /* compatibility flags */ 61 67 #define MAP_FILE 0
+53 -9
arch/parisc/kernel/firmware.c
··· 69 69 #include <asm/pdcpat.h> 70 70 #include <asm/processor.h> /* for boot_cpu_data */ 71 71 72 + #if defined(BOOTLOADER) 73 + # undef spin_lock_irqsave 74 + # define spin_lock_irqsave(a, b) { b = 1; } 75 + # undef spin_unlock_irqrestore 76 + # define spin_unlock_irqrestore(a, b) 77 + #else 72 78 static DEFINE_SPINLOCK(pdc_lock); 79 + #endif 80 + 73 81 extern unsigned long pdc_result[NUM_PDC_RESULT]; 74 82 extern unsigned long pdc_result2[NUM_PDC_RESULT]; 75 83 ··· 150 142 int i; 151 143 unsigned int *p = (unsigned int *)addr; 152 144 153 - if(unlikely(parisc_narrow_firmware)) { 154 - for(i = 31; i >= 0; --i) 145 + if (unlikely(parisc_narrow_firmware)) { 146 + for (i = (NUM_PDC_RESULT-1); i >= 0; --i) 155 147 addr[i] = p[i]; 156 148 } 157 149 #endif ··· 194 186 } 195 187 #endif /*CONFIG_64BIT*/ 196 188 189 + 190 + #if !defined(BOOTLOADER) 197 191 /** 198 192 * pdc_emergency_unlock - Unlock the linux pdc lock 199 193 * ··· 989 979 990 980 spin_lock_irqsave(&pdc_lock, flags); 991 981 retval = mem_pdc_call(PDC_MEM, PDC_MEM_READ_PDT, __pa(pdc_result), 992 - __pa(pdc_result2)); 982 + __pa(pdt_entries_ptr)); 993 983 if (retval == PDC_OK) { 994 984 convert_to_wide(pdc_result); 995 985 memcpy(pret, pdc_result, sizeof(*pret)); 996 - convert_to_wide(pdc_result2); 997 - memcpy(pdt_entries_ptr, pdc_result2, 998 - pret->pdt_entries * sizeof(*pdt_entries_ptr)); 999 986 } 1000 987 spin_unlock_irqrestore(&pdc_lock, flags); 988 + 989 + #ifdef CONFIG_64BIT 990 + /* 991 + * 64-bit kernels should not call this PDT function in narrow mode. 992 + * The pdt_entries_ptr array above will now contain 32-bit values 993 + */ 994 + if (WARN_ON_ONCE((retval == PDC_OK) && parisc_narrow_firmware)) 995 + return PDC_ERROR; 996 + #endif 1001 997 1002 998 return retval; 1003 999 } ··· 1159 1143 spin_unlock_irqrestore(&pdc_lock, flags); 1160 1144 } 1161 1145 1146 + #endif /* defined(BOOTLOADER) */ 1147 + 1162 1148 /* locked by pdc_console_lock */ 1163 1149 static int __attribute__((aligned(8))) iodc_retbuf[32]; 1164 1150 static char __attribute__((aligned(64))) iodc_dbuf[4096]; ··· 1205 1187 return i; 1206 1188 } 1207 1189 1190 + #if !defined(BOOTLOADER) 1208 1191 /** 1209 1192 * pdc_iodc_getc - Read a character (non-blocking) from the PDC console. 1210 1193 * ··· 1459 1440 } 1460 1441 1461 1442 /** 1443 + * pdc_pat_mem_pdt_cell_info - Retrieve information about page deallocation 1444 + * table of a cell 1445 + * @rinfo: memory pdt information 1446 + * @cell: cell number 1447 + * 1448 + */ 1449 + int pdc_pat_mem_pdt_cell_info(struct pdc_pat_mem_cell_pdt_retinfo *rinfo, 1450 + unsigned long cell) 1451 + { 1452 + int retval; 1453 + unsigned long flags; 1454 + 1455 + spin_lock_irqsave(&pdc_lock, flags); 1456 + retval = mem_pdc_call(PDC_PAT_MEM, PDC_PAT_MEM_CELL_INFO, 1457 + __pa(&pdc_result), cell); 1458 + if (retval == PDC_OK) 1459 + memcpy(rinfo, &pdc_result, sizeof(*rinfo)); 1460 + spin_unlock_irqrestore(&pdc_lock, flags); 1461 + 1462 + return retval; 1463 + } 1464 + 1465 + /** 1462 1466 * pdc_pat_mem_read_cell_pdt - Read PDT entries from (old) PAT firmware 1463 1467 * @pret: array of PDT entries 1464 1468 * @pdt_entries_ptr: ptr to hold number of PDT entries ··· 1497 1455 spin_lock_irqsave(&pdc_lock, flags); 1498 1456 /* PDC_PAT_MEM_CELL_READ is available on early PAT machines only */ 1499 1457 retval = mem_pdc_call(PDC_PAT_MEM, PDC_PAT_MEM_CELL_READ, 1500 - __pa(&pdc_result), parisc_cell_num, __pa(&pdc_result2)); 1458 + __pa(&pdc_result), parisc_cell_num, 1459 + __pa(pdt_entries_ptr)); 1501 1460 1502 1461 if (retval == PDC_OK) { 1503 1462 /* build up return value as for PDC_PAT_MEM_PD_READ */ 1504 1463 entries = min(pdc_result[0], max_entries); 1505 1464 pret->pdt_entries = entries; 1506 1465 pret->actual_count_bytes = entries * sizeof(unsigned long); 1507 - memcpy(pdt_entries_ptr, &pdc_result2, pret->actual_count_bytes); 1508 1466 } 1509 1467 1510 1468 spin_unlock_irqrestore(&pdc_lock, flags); ··· 1516 1474 * pdc_pat_mem_read_pd_pdt - Read PDT entries from (newer) PAT firmware 1517 1475 * @pret: array of PDT entries 1518 1476 * @pdt_entries_ptr: ptr to hold number of PDT entries 1477 + * @count: number of bytes to read 1478 + * @offset: offset to start (in bytes) 1519 1479 * 1520 1480 */ 1521 1481 int pdc_pat_mem_read_pd_pdt(struct pdc_pat_mem_read_pd_retinfo *pret, ··· 1568 1524 return retval; 1569 1525 } 1570 1526 #endif /* CONFIG_64BIT */ 1527 + #endif /* defined(BOOTLOADER) */ 1571 1528 1572 1529 1573 1530 /***************** 32-bit real-mode calls ***********/ ··· 1678 1633 } 1679 1634 1680 1635 #endif /* CONFIG_64BIT */ 1681 -
+1 -2
arch/parisc/kernel/pci-dma.c
··· 41 41 static unsigned long pcxl_used_pages __read_mostly = 0; 42 42 43 43 extern unsigned long pcxl_dma_start; /* Start of pcxl dma mapping area */ 44 - static spinlock_t pcxl_res_lock; 44 + static DEFINE_SPINLOCK(pcxl_res_lock); 45 45 static char *pcxl_res_map; 46 46 static int pcxl_res_hint; 47 47 static int pcxl_res_size; ··· 390 390 if (pcxl_dma_start == 0) 391 391 return 0; 392 392 393 - spin_lock_init(&pcxl_res_lock); 394 393 pcxl_res_size = PCXL_DMA_MAP_SIZE >> (PAGE_SHIFT + 3); 395 394 pcxl_res_hint = 0; 396 395 pcxl_res_map = (char *)__get_free_pages(GFP_KERNEL,
+241 -43
arch/parisc/kernel/pdt.c
··· 1 1 /* 2 2 * Page Deallocation Table (PDT) support 3 3 * 4 - * The Page Deallocation Table (PDT) holds a table with pointers to bad 5 - * memory (broken RAM modules) which is maintained by firmware. 4 + * The Page Deallocation Table (PDT) is maintained by firmware and holds a 5 + * list of memory addresses in which memory errors were detected. 6 + * The list contains both single-bit (correctable) and double-bit 7 + * (uncorrectable) errors. 6 8 * 7 9 * Copyright 2017 by Helge Deller <deller@gmx.de> 8 10 * 9 - * TODO: 10 - * - check regularily for new bad memory 11 - * - add userspace interface with procfs or sysfs 12 - * - increase number of PDT entries dynamically 11 + * possible future enhancements: 12 + * - add userspace interface via procfs or sysfs to clear PDT 13 13 */ 14 14 15 15 #include <linux/memblock.h> 16 16 #include <linux/seq_file.h> 17 + #include <linux/kthread.h> 17 18 18 19 #include <asm/pdc.h> 19 20 #include <asm/pdcpat.h> ··· 25 24 PDT_NONE, 26 25 PDT_PDC, 27 26 PDT_PAT_NEW, 28 - PDT_PAT_OLD 27 + PDT_PAT_CELL 29 28 }; 30 29 31 30 static enum pdt_access_type pdt_type; 31 + 32 + /* PDT poll interval: 1 minute if errors, 5 minutes if everything OK. */ 33 + #define PDT_POLL_INTERVAL_DEFAULT (5*60*HZ) 34 + #define PDT_POLL_INTERVAL_SHORT (1*60*HZ) 35 + static unsigned long pdt_poll_interval = PDT_POLL_INTERVAL_DEFAULT; 32 36 33 37 /* global PDT status information */ 34 38 static struct pdc_mem_retinfo pdt_status; ··· 42 36 #define MAX_PDT_ENTRIES (MAX_PDT_TABLE_SIZE / sizeof(unsigned long)) 43 37 static unsigned long pdt_entry[MAX_PDT_ENTRIES] __page_aligned_bss; 44 38 39 + /* 40 + * Constants for the pdt_entry format: 41 + * A pdt_entry holds the physical address in bits 0-57, bits 58-61 are 42 + * reserved, bit 62 is the perm bit and bit 63 is the error_type bit. 43 + * The perm bit indicates whether the error have been verified as a permanent 44 + * error (value of 1) or has not been verified, and may be transient (value 45 + * of 0). The error_type bit indicates whether the error is a single bit error 46 + * (value of 1) or a multiple bit error. 47 + * On non-PAT machines phys_addr is encoded in bits 0-59 and error_type in bit 48 + * 63. Those machines don't provide the perm bit. 49 + */ 50 + 51 + #define PDT_ADDR_PHYS_MASK (pdt_type != PDT_PDC ? ~0x3f : ~0x0f) 52 + #define PDT_ADDR_PERM_ERR (pdt_type != PDT_PDC ? 2UL : 0UL) 53 + #define PDT_ADDR_SINGLE_ERR 1UL 45 54 46 55 /* report PDT entries via /proc/meminfo */ 47 56 void arch_report_meminfo(struct seq_file *m) ··· 69 48 seq_printf(m, "PDT_cur_entries: %7lu\n", 70 49 pdt_status.pdt_entries); 71 50 } 51 + 52 + static int get_info_pat_new(void) 53 + { 54 + struct pdc_pat_mem_retinfo pat_rinfo; 55 + int ret; 56 + 57 + /* newer PAT machines like C8000 report info for all cells */ 58 + if (is_pdc_pat()) 59 + ret = pdc_pat_mem_pdt_info(&pat_rinfo); 60 + else 61 + return PDC_BAD_PROC; 62 + 63 + pdt_status.pdt_size = pat_rinfo.max_pdt_entries; 64 + pdt_status.pdt_entries = pat_rinfo.current_pdt_entries; 65 + pdt_status.pdt_status = 0; 66 + pdt_status.first_dbe_loc = pat_rinfo.first_dbe_loc; 67 + pdt_status.good_mem = pat_rinfo.good_mem; 68 + 69 + return ret; 70 + } 71 + 72 + static int get_info_pat_cell(void) 73 + { 74 + struct pdc_pat_mem_cell_pdt_retinfo cell_rinfo; 75 + int ret; 76 + 77 + /* older PAT machines like rp5470 report cell info only */ 78 + if (is_pdc_pat()) 79 + ret = pdc_pat_mem_pdt_cell_info(&cell_rinfo, parisc_cell_num); 80 + else 81 + return PDC_BAD_PROC; 82 + 83 + pdt_status.pdt_size = cell_rinfo.max_pdt_entries; 84 + pdt_status.pdt_entries = cell_rinfo.current_pdt_entries; 85 + pdt_status.pdt_status = 0; 86 + pdt_status.first_dbe_loc = cell_rinfo.first_dbe_loc; 87 + pdt_status.good_mem = cell_rinfo.good_mem; 88 + 89 + return ret; 90 + } 91 + 92 + static void report_mem_err(unsigned long pde) 93 + { 94 + struct pdc_pat_mem_phys_mem_location loc; 95 + unsigned long addr; 96 + char dimm_txt[32]; 97 + 98 + addr = pde & PDT_ADDR_PHYS_MASK; 99 + 100 + /* show DIMM slot description on PAT machines */ 101 + if (is_pdc_pat()) { 102 + pdc_pat_mem_get_dimm_phys_location(&loc, addr); 103 + sprintf(dimm_txt, "DIMM slot %02x, ", loc.dimm_slot); 104 + } else 105 + dimm_txt[0] = 0; 106 + 107 + pr_warn("PDT: BAD MEMORY at 0x%08lx, %s%s%s-bit error.\n", 108 + addr, dimm_txt, 109 + pde & PDT_ADDR_PERM_ERR ? "permanent ":"", 110 + pde & PDT_ADDR_SINGLE_ERR ? "single":"multi"); 111 + } 112 + 72 113 73 114 /* 74 115 * pdc_pdt_init() ··· 146 63 unsigned long entries; 147 64 struct pdc_mem_read_pdt pdt_read_ret; 148 65 149 - if (is_pdc_pat()) { 150 - struct pdc_pat_mem_retinfo pat_rinfo; 66 + pdt_type = PDT_PAT_NEW; 67 + ret = get_info_pat_new(); 151 68 152 - pdt_type = PDT_PAT_NEW; 153 - ret = pdc_pat_mem_pdt_info(&pat_rinfo); 154 - pdt_status.pdt_size = pat_rinfo.max_pdt_entries; 155 - pdt_status.pdt_entries = pat_rinfo.current_pdt_entries; 156 - pdt_status.pdt_status = 0; 157 - pdt_status.first_dbe_loc = pat_rinfo.first_dbe_loc; 158 - pdt_status.good_mem = pat_rinfo.good_mem; 159 - } else { 69 + if (ret != PDC_OK) { 70 + pdt_type = PDT_PAT_CELL; 71 + ret = get_info_pat_cell(); 72 + } 73 + 74 + if (ret != PDC_OK) { 160 75 pdt_type = PDT_PDC; 76 + /* non-PAT machines provide the standard PDC call */ 161 77 ret = pdc_mem_pdt_info(&pdt_status); 162 78 } 163 79 ··· 168 86 } 169 87 170 88 entries = pdt_status.pdt_entries; 171 - WARN_ON(entries > MAX_PDT_ENTRIES); 89 + if (WARN_ON(entries > MAX_PDT_ENTRIES)) 90 + entries = pdt_status.pdt_entries = MAX_PDT_ENTRIES; 172 91 173 - pr_info("PDT: size %lu, entries %lu, status %lu, dbe_loc 0x%lx," 174 - " good_mem %lu\n", 92 + pr_info("PDT: type %s, size %lu, entries %lu, status %lu, dbe_loc 0x%lx," 93 + " good_mem %lu MB\n", 94 + pdt_type == PDT_PDC ? __stringify(PDT_PDC) : 95 + pdt_type == PDT_PAT_CELL ? __stringify(PDT_PAT_CELL) 96 + : __stringify(PDT_PAT_NEW), 175 97 pdt_status.pdt_size, pdt_status.pdt_entries, 176 98 pdt_status.pdt_status, pdt_status.first_dbe_loc, 177 - pdt_status.good_mem); 99 + pdt_status.good_mem / 1024 / 1024); 178 100 179 101 if (entries == 0) { 180 102 pr_info("PDT: Firmware reports all memory OK.\n"); ··· 198 112 #ifdef CONFIG_64BIT 199 113 struct pdc_pat_mem_read_pd_retinfo pat_pret; 200 114 201 - /* try old obsolete PAT firmware function first */ 202 - pdt_type = PDT_PAT_OLD; 203 - ret = pdc_pat_mem_read_cell_pdt(&pat_pret, pdt_entry, 204 - MAX_PDT_ENTRIES); 205 - if (ret != PDC_OK) { 206 - pdt_type = PDT_PAT_NEW; 115 + if (pdt_type == PDT_PAT_CELL) 116 + ret = pdc_pat_mem_read_cell_pdt(&pat_pret, pdt_entry, 117 + MAX_PDT_ENTRIES); 118 + else 207 119 ret = pdc_pat_mem_read_pd_pdt(&pat_pret, pdt_entry, 208 120 MAX_PDT_TABLE_SIZE, 0); 209 - } 210 121 #else 211 122 ret = PDC_BAD_PROC; 212 123 #endif ··· 211 128 212 129 if (ret != PDC_OK) { 213 130 pdt_type = PDT_NONE; 214 - pr_debug("PDT type %d, retval = %d\n", pdt_type, ret); 131 + pr_warn("PDT: Get PDT entries failed with %d\n", ret); 215 132 return; 216 133 } 217 134 218 135 for (i = 0; i < pdt_status.pdt_entries; i++) { 219 - struct pdc_pat_mem_phys_mem_location loc; 220 - 221 - /* get DIMM slot number */ 222 - loc.dimm_slot = 0xff; 223 - #ifdef CONFIG_64BIT 224 - pdc_pat_mem_get_dimm_phys_location(&loc, pdt_entry[i]); 225 - #endif 226 - 227 - pr_warn("PDT: BAD PAGE #%d at 0x%08lx, " 228 - "DIMM slot %02x (error_type = %lu)\n", 229 - i, 230 - pdt_entry[i] & PAGE_MASK, 231 - loc.dimm_slot, 232 - pdt_entry[i] & 1); 136 + report_mem_err(pdt_entry[i]); 233 137 234 138 /* mark memory page bad */ 235 139 memblock_reserve(pdt_entry[i] & PAGE_MASK, PAGE_SIZE); 236 140 } 237 141 } 142 + 143 + 144 + /* 145 + * This is the PDT kernel thread main loop. 146 + */ 147 + 148 + static int pdt_mainloop(void *unused) 149 + { 150 + struct pdc_mem_read_pdt pdt_read_ret; 151 + struct pdc_pat_mem_read_pd_retinfo pat_pret __maybe_unused; 152 + unsigned long old_num_entries; 153 + unsigned long *bad_mem_ptr; 154 + int num, ret; 155 + 156 + for (;;) { 157 + set_current_state(TASK_INTERRUPTIBLE); 158 + 159 + old_num_entries = pdt_status.pdt_entries; 160 + 161 + schedule_timeout(pdt_poll_interval); 162 + if (kthread_should_stop()) 163 + break; 164 + 165 + /* Do we have new PDT entries? */ 166 + switch (pdt_type) { 167 + case PDT_PAT_NEW: 168 + ret = get_info_pat_new(); 169 + break; 170 + case PDT_PAT_CELL: 171 + ret = get_info_pat_cell(); 172 + break; 173 + default: 174 + ret = pdc_mem_pdt_info(&pdt_status); 175 + break; 176 + } 177 + 178 + if (ret != PDC_OK) { 179 + pr_warn("PDT: unexpected failure %d\n", ret); 180 + return -EINVAL; 181 + } 182 + 183 + /* if no new PDT entries, just wait again */ 184 + num = pdt_status.pdt_entries - old_num_entries; 185 + if (num <= 0) 186 + continue; 187 + 188 + /* decrease poll interval in case we found memory errors */ 189 + if (pdt_status.pdt_entries && 190 + pdt_poll_interval == PDT_POLL_INTERVAL_DEFAULT) 191 + pdt_poll_interval = PDT_POLL_INTERVAL_SHORT; 192 + 193 + /* limit entries to get */ 194 + if (num > MAX_PDT_ENTRIES) { 195 + num = MAX_PDT_ENTRIES; 196 + pdt_status.pdt_entries = old_num_entries + num; 197 + } 198 + 199 + /* get new entries */ 200 + switch (pdt_type) { 201 + #ifdef CONFIG_64BIT 202 + case PDT_PAT_CELL: 203 + if (pdt_status.pdt_entries > MAX_PDT_ENTRIES) { 204 + pr_crit("PDT: too many entries.\n"); 205 + return -ENOMEM; 206 + } 207 + ret = pdc_pat_mem_read_cell_pdt(&pat_pret, pdt_entry, 208 + MAX_PDT_ENTRIES); 209 + bad_mem_ptr = &pdt_entry[old_num_entries]; 210 + break; 211 + case PDT_PAT_NEW: 212 + ret = pdc_pat_mem_read_pd_pdt(&pat_pret, 213 + pdt_entry, 214 + num * sizeof(unsigned long), 215 + old_num_entries * sizeof(unsigned long)); 216 + bad_mem_ptr = &pdt_entry[0]; 217 + break; 218 + #endif 219 + default: 220 + ret = pdc_mem_pdt_read_entries(&pdt_read_ret, 221 + pdt_entry); 222 + bad_mem_ptr = &pdt_entry[old_num_entries]; 223 + break; 224 + } 225 + 226 + /* report and mark memory broken */ 227 + while (num--) { 228 + unsigned long pde = *bad_mem_ptr++; 229 + 230 + report_mem_err(pde); 231 + 232 + #ifdef CONFIG_MEMORY_FAILURE 233 + if ((pde & PDT_ADDR_PERM_ERR) || 234 + ((pde & PDT_ADDR_SINGLE_ERR) == 0)) 235 + memory_failure(pde >> PAGE_SHIFT, 0, 0); 236 + else 237 + soft_offline_page( 238 + pfn_to_page(pde >> PAGE_SHIFT), 0); 239 + #else 240 + pr_crit("PDT: memory error at 0x%lx ignored.\n" 241 + "Rebuild kernel with CONFIG_MEMORY_FAILURE=y " 242 + "for real handling.\n", 243 + pde & PDT_ADDR_PHYS_MASK); 244 + #endif 245 + 246 + } 247 + } 248 + 249 + return 0; 250 + } 251 + 252 + 253 + static int __init pdt_initcall(void) 254 + { 255 + struct task_struct *kpdtd_task; 256 + 257 + if (pdt_type == PDT_NONE) 258 + return -ENODEV; 259 + 260 + kpdtd_task = kthread_create(pdt_mainloop, NULL, "kpdtd"); 261 + if (IS_ERR(kpdtd_task)) 262 + return PTR_ERR(kpdtd_task); 263 + 264 + wake_up_process(kpdtd_task); 265 + 266 + return 0; 267 + } 268 + 269 + late_initcall(pdt_initcall);
+1 -3
arch/parisc/kernel/perf.c
··· 69 69 70 70 static int perf_processor_interface __read_mostly = UNKNOWN_INTF; 71 71 static int perf_enabled __read_mostly; 72 - static spinlock_t perf_lock; 72 + static DEFINE_SPINLOCK(perf_lock); 73 73 struct parisc_device *cpu_device __read_mostly; 74 74 75 75 /* RDRs to write for PCX-W */ ··· 532 532 533 533 /* Patch the images to match the system */ 534 534 perf_patch_images(); 535 - 536 - spin_lock_init(&perf_lock); 537 535 538 536 /* TODO: this only lets us access the first cpu.. what to do for SMP? */ 539 537 cpu_device = per_cpu(cpu_data, 0).dev;
+24 -6
arch/parisc/kernel/processor.c
··· 30 30 #include <linux/mm.h> 31 31 #include <linux/module.h> 32 32 #include <linux/seq_file.h> 33 + #include <linux/random.h> 33 34 #include <linux/slab.h> 34 35 #include <linux/cpu.h> 35 36 #include <asm/param.h> ··· 90 89 * (return 1). If so, initialize the chip and tell other partners in crime 91 90 * they have work to do. 92 91 */ 93 - static int processor_probe(struct parisc_device *dev) 92 + static int __init processor_probe(struct parisc_device *dev) 94 93 { 95 94 unsigned long txn_addr; 96 95 unsigned long cpuid; ··· 238 237 */ 239 238 void __init collect_boot_cpu_data(void) 240 239 { 240 + unsigned long cr16_seed; 241 + 241 242 memset(&boot_cpu_data, 0, sizeof(boot_cpu_data)); 243 + 244 + cr16_seed = get_cycles(); 245 + add_device_randomness(&cr16_seed, sizeof(cr16_seed)); 242 246 243 247 boot_cpu_data.cpu_hz = 100 * PAGE0->mem_10msec; /* Hz of this PARISC */ 244 248 245 249 /* get CPU-Model Information... */ 246 250 #define p ((unsigned long *)&boot_cpu_data.pdc.model) 247 - if (pdc_model_info(&boot_cpu_data.pdc.model) == PDC_OK) 251 + if (pdc_model_info(&boot_cpu_data.pdc.model) == PDC_OK) { 248 252 printk(KERN_INFO 249 253 "model %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", 250 254 p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8]); 255 + 256 + add_device_randomness(&boot_cpu_data.pdc.model, 257 + sizeof(boot_cpu_data.pdc.model)); 258 + } 251 259 #undef p 252 260 253 - if (pdc_model_versions(&boot_cpu_data.pdc.versions, 0) == PDC_OK) 261 + if (pdc_model_versions(&boot_cpu_data.pdc.versions, 0) == PDC_OK) { 254 262 printk(KERN_INFO "vers %08lx\n", 255 263 boot_cpu_data.pdc.versions); 256 264 257 - if (pdc_model_cpuid(&boot_cpu_data.pdc.cpuid) == PDC_OK) 265 + add_device_randomness(&boot_cpu_data.pdc.versions, 266 + sizeof(boot_cpu_data.pdc.versions)); 267 + } 268 + 269 + if (pdc_model_cpuid(&boot_cpu_data.pdc.cpuid) == PDC_OK) { 258 270 printk(KERN_INFO "CPUID vers %ld rev %ld (0x%08lx)\n", 259 271 (boot_cpu_data.pdc.cpuid >> 5) & 127, 260 272 boot_cpu_data.pdc.cpuid & 31, 261 273 boot_cpu_data.pdc.cpuid); 274 + 275 + add_device_randomness(&boot_cpu_data.pdc.cpuid, 276 + sizeof(boot_cpu_data.pdc.cpuid)); 277 + } 262 278 263 279 if (pdc_model_capabilities(&boot_cpu_data.pdc.capabilities) == PDC_OK) 264 280 printk(KERN_INFO "capabilities 0x%lx\n", ··· 432 414 return 0; 433 415 } 434 416 435 - static const struct parisc_device_id processor_tbl[] = { 417 + static const struct parisc_device_id processor_tbl[] __initconst = { 436 418 { HPHW_NPROC, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, SVERSION_ANY_ID }, 437 419 { 0, } 438 420 }; 439 421 440 - static struct parisc_driver cpu_driver = { 422 + static struct parisc_driver cpu_driver __refdata = { 441 423 .name = "CPU", 442 424 .id_table = processor_tbl, 443 425 .probe = processor_probe
+4
arch/parisc/kernel/real2.S
··· 162 162 .text 163 163 .align 128 164 164 ENTRY_CFI(rfi_virt2real) 165 + #if !defined(BOOTLOADER) 165 166 /* switch to real mode... */ 166 167 rsm PSW_SM_I,%r0 167 168 load32 PA(rfi_v2r_1), %r1 ··· 192 191 nop 193 192 rfi_v2r_1: 194 193 tophys_r1 %r2 194 + #endif /* defined(BOOTLOADER) */ 195 195 bv 0(%r2) 196 196 nop 197 197 ENDPROC_CFI(rfi_virt2real) ··· 200 198 .text 201 199 .align 128 202 200 ENTRY_CFI(rfi_real2virt) 201 + #if !defined(BOOTLOADER) 203 202 rsm PSW_SM_I,%r0 204 203 load32 (rfi_r2v_1), %r1 205 204 nop ··· 229 226 nop 230 227 rfi_r2v_1: 231 228 tovirt_r1 %r2 229 + #endif /* defined(BOOTLOADER) */ 232 230 bv 0(%r2) 233 231 nop 234 232 ENDPROC_CFI(rfi_real2virt)
+1 -3
arch/parisc/kernel/unwind.c
··· 34 34 extern struct unwind_table_entry __start___unwind[]; 35 35 extern struct unwind_table_entry __stop___unwind[]; 36 36 37 - static spinlock_t unwind_lock; 37 + static DEFINE_SPINLOCK(unwind_lock); 38 38 /* 39 39 * the kernel unwind block is not dynamically allocated so that 40 40 * we can call unwind_init as early in the bootup process as ··· 180 180 181 181 start = (long)&__start___unwind[0]; 182 182 stop = (long)&__stop___unwind[0]; 183 - 184 - spin_lock_init(&unwind_lock); 185 183 186 184 printk("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n", 187 185 start, stop,
-2
arch/parisc/lib/memcpy.c
··· 27 27 #include <linux/compiler.h> 28 28 #include <linux/uaccess.h> 29 29 30 - DECLARE_PER_CPU(struct exception_data, exception_data); 31 - 32 30 #define get_user_space() (uaccess_kernel() ? 0 : mfsp(3)) 33 31 #define get_kernel_space() (0) 34 32
+7 -5
drivers/char/ipmi/ipmi_si_intf.c
··· 2812 2812 }; 2813 2813 2814 2814 #ifdef CONFIG_PARISC 2815 - static int ipmi_parisc_probe(struct parisc_device *dev) 2815 + static int __init ipmi_parisc_probe(struct parisc_device *dev) 2816 2816 { 2817 2817 struct smi_info *info; 2818 2818 int rv; ··· 2850 2850 return 0; 2851 2851 } 2852 2852 2853 - static int ipmi_parisc_remove(struct parisc_device *dev) 2853 + static int __exit ipmi_parisc_remove(struct parisc_device *dev) 2854 2854 { 2855 2855 cleanup_one_si(dev_get_drvdata(&dev->dev)); 2856 2856 return 0; 2857 2857 } 2858 2858 2859 - static const struct parisc_device_id ipmi_parisc_tbl[] = { 2859 + static const struct parisc_device_id ipmi_parisc_tbl[] __initconst = { 2860 2860 { HPHW_MC, HVERSION_REV_ANY_ID, 0x004, 0xC0 }, 2861 2861 { 0, } 2862 2862 }; 2863 2863 2864 - static struct parisc_driver ipmi_parisc_driver = { 2864 + MODULE_DEVICE_TABLE(parisc, ipmi_parisc_tbl); 2865 + 2866 + static struct parisc_driver ipmi_parisc_driver __refdata = { 2865 2867 .name = "ipmi", 2866 2868 .id_table = ipmi_parisc_tbl, 2867 2869 .probe = ipmi_parisc_probe, 2868 - .remove = ipmi_parisc_remove, 2870 + .remove = __exit_p(ipmi_parisc_remove), 2869 2871 }; 2870 2872 #endif /* CONFIG_PARISC */ 2871 2873
+5 -5
drivers/input/keyboard/hilkbd.c
··· 299 299 } 300 300 301 301 #if defined(CONFIG_PARISC) 302 - static int hil_probe_chip(struct parisc_device *dev) 302 + static int __init hil_probe_chip(struct parisc_device *dev) 303 303 { 304 304 /* Only allow one HIL keyboard */ 305 305 if (hil_dev.dev) ··· 320 320 return hil_keyb_init(); 321 321 } 322 322 323 - static int hil_remove_chip(struct parisc_device *dev) 323 + static int __exit hil_remove_chip(struct parisc_device *dev) 324 324 { 325 325 hil_keyb_exit(); 326 326 327 327 return 0; 328 328 } 329 329 330 - static struct parisc_device_id hil_tbl[] = { 330 + static const struct parisc_device_id hil_tbl[] __initconst = { 331 331 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00073 }, 332 332 { 0, } 333 333 }; ··· 337 337 MODULE_DEVICE_TABLE(parisc, hil_tbl); 338 338 #endif 339 339 340 - static struct parisc_driver hil_driver = { 340 + static struct parisc_driver hil_driver __refdata = { 341 341 .name = "hil", 342 342 .id_table = hil_tbl, 343 343 .probe = hil_probe_chip, 344 - .remove = hil_remove_chip, 344 + .remove = __exit_p(hil_remove_chip), 345 345 }; 346 346 347 347 static int __init hil_init(void)
+5 -5
drivers/input/serio/gscps2.c
··· 325 325 * @return: success/error report 326 326 */ 327 327 328 - static int gscps2_probe(struct parisc_device *dev) 328 + static int __init gscps2_probe(struct parisc_device *dev) 329 329 { 330 330 struct gscps2port *ps2port; 331 331 struct serio *serio; ··· 412 412 * @return: success/error report 413 413 */ 414 414 415 - static int gscps2_remove(struct parisc_device *dev) 415 + static int __exit gscps2_remove(struct parisc_device *dev) 416 416 { 417 417 struct gscps2port *ps2port = dev_get_drvdata(&dev->dev); 418 418 ··· 430 430 } 431 431 432 432 433 - static struct parisc_device_id gscps2_device_tbl[] = { 433 + static const struct parisc_device_id gscps2_device_tbl[] __initconst = { 434 434 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00084 }, /* LASI PS/2 */ 435 435 #ifdef DINO_TESTED 436 436 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00096 }, /* DINO PS/2 */ ··· 439 439 }; 440 440 MODULE_DEVICE_TABLE(parisc, gscps2_device_tbl); 441 441 442 - static struct parisc_driver parisc_ps2_driver = { 442 + static struct parisc_driver parisc_ps2_driver __refdata = { 443 443 .name = "gsc_ps2", 444 444 .id_table = gscps2_device_tbl, 445 445 .probe = gscps2_probe, 446 - .remove = gscps2_remove, 446 + .remove = __exit_p(gscps2_remove), 447 447 }; 448 448 449 449 static int __init gscps2_init(void)
+2 -2
drivers/input/serio/hp_sdc.c
··· 805 805 806 806 #if defined(__hppa__) 807 807 808 - static const struct parisc_device_id hp_sdc_tbl[] = { 808 + static const struct parisc_device_id hp_sdc_tbl[] __initconst = { 809 809 { 810 810 .hw_type = HPHW_FIO, 811 811 .hversion_rev = HVERSION_REV_ANY_ID, ··· 820 820 static int __init hp_sdc_init_hppa(struct parisc_device *d); 821 821 static struct delayed_work moduleloader_work; 822 822 823 - static struct parisc_driver hp_sdc_driver = { 823 + static struct parisc_driver hp_sdc_driver __refdata = { 824 824 .name = "hp_sdc", 825 825 .id_table = hp_sdc_tbl, 826 826 .probe = hp_sdc_init_hppa,
+5 -5
drivers/net/ethernet/i825xx/lasi_82596.c
··· 149 149 150 150 #define LAN_PROM_ADDR 0xF0810000 151 151 152 - static int 152 + static int __init 153 153 lan_init_chip(struct parisc_device *dev) 154 154 { 155 155 struct net_device *netdevice; ··· 194 194 return retval; 195 195 } 196 196 197 - static int lan_remove_chip(struct parisc_device *pdev) 197 + static int __exit lan_remove_chip(struct parisc_device *pdev) 198 198 { 199 199 struct net_device *dev = parisc_get_drvdata(pdev); 200 200 struct i596_private *lp = netdev_priv(dev); ··· 206 206 return 0; 207 207 } 208 208 209 - static struct parisc_device_id lan_tbl[] = { 209 + static const struct parisc_device_id lan_tbl[] __initconst = { 210 210 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008a }, 211 211 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00072 }, 212 212 { 0, } ··· 214 214 215 215 MODULE_DEVICE_TABLE(parisc, lan_tbl); 216 216 217 - static struct parisc_driver lan_driver = { 217 + static struct parisc_driver lan_driver __refdata = { 218 218 .name = "lasi_82596", 219 219 .id_table = lan_tbl, 220 220 .probe = lan_init_chip, 221 - .remove = lan_remove_chip, 221 + .remove = __exit_p(lan_remove_chip), 222 222 }; 223 223 224 224 static int lasi_82596_init(void)
+2 -2
drivers/parisc/asp.c
··· 118 118 return ret; 119 119 } 120 120 121 - static struct parisc_device_id asp_tbl[] = { 121 + static const struct parisc_device_id asp_tbl[] __initconst = { 122 122 { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00070 }, 123 123 { 0, } 124 124 }; 125 125 126 - struct parisc_driver asp_driver = { 126 + struct parisc_driver asp_driver __refdata = { 127 127 .name = "asp", 128 128 .id_table = asp_tbl, 129 129 .probe = asp_init_chip,
+2 -2
drivers/parisc/ccio-dma.c
··· 1241 1241 #endif /* 0 */ 1242 1242 1243 1243 /* We *can't* support JAVA (T600). Venture there at your own risk. */ 1244 - static const struct parisc_device_id ccio_tbl[] = { 1244 + static const struct parisc_device_id ccio_tbl[] __initconst = { 1245 1245 { HPHW_IOA, HVERSION_REV_ANY_ID, U2_IOA_RUNWAY, 0xb }, /* U2 */ 1246 1246 { HPHW_IOA, HVERSION_REV_ANY_ID, UTURN_IOA_RUNWAY, 0xb }, /* UTurn */ 1247 1247 { 0, } ··· 1249 1249 1250 1250 static int ccio_probe(struct parisc_device *dev); 1251 1251 1252 - static struct parisc_driver ccio_driver = { 1252 + static struct parisc_driver ccio_driver __refdata = { 1253 1253 .name = "ccio", 1254 1254 .id_table = ccio_tbl, 1255 1255 .probe = ccio_probe,
+3 -3
drivers/parisc/ccio-rm-dma.c
··· 163 163 ** If so, initialize the chip and tell other partners in crime they 164 164 ** have work to do. 165 165 */ 166 - static int 166 + static int __init 167 167 ccio_probe(struct parisc_device *dev) 168 168 { 169 169 printk(KERN_INFO "%s found %s at 0x%lx\n", MODULE_NAME, ··· 184 184 return 0; 185 185 } 186 186 187 - static struct parisc_device_id ccio_tbl[] = { 187 + static const struct parisc_device_id ccio_tbl[] __initconst = { 188 188 { HPHW_BCPORT, HVERSION_REV_ANY_ID, U2_BC_GSC, 0xc }, 189 189 { HPHW_BCPORT, HVERSION_REV_ANY_ID, UTURN_BC_GSC, 0xc }, 190 190 { 0, } 191 191 }; 192 192 193 - static struct parisc_driver ccio_driver = { 193 + static struct parisc_driver ccio_driver __refdata = { 194 194 .name = "U2/Uturn", 195 195 .id_table = ccio_tbl, 196 196 .probe = ccio_probe,
+2 -2
drivers/parisc/dino.c
··· 1022 1022 * and 725 firmware misreport it as 0x08080 for no adequately explained 1023 1023 * reason. 1024 1024 */ 1025 - static struct parisc_device_id dino_tbl[] = { 1025 + static const struct parisc_device_id dino_tbl[] __initconst = { 1026 1026 { HPHW_A_DMA, HVERSION_REV_ANY_ID, 0x004, 0x0009D },/* Card-mode Dino */ 1027 1027 { HPHW_A_DMA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x08080 }, /* XXX */ 1028 1028 { HPHW_BRIDGE, HVERSION_REV_ANY_ID, 0x680, 0xa }, /* Bridge-mode Dino */ ··· 1031 1031 { 0, } 1032 1032 }; 1033 1033 1034 - static struct parisc_driver dino_driver = { 1034 + static struct parisc_driver dino_driver __refdata = { 1035 1035 .name = "dino", 1036 1036 .id_table = dino_tbl, 1037 1037 .probe = dino_probe,
+2 -2
drivers/parisc/eisa.c
··· 393 393 return result; 394 394 } 395 395 396 - static const struct parisc_device_id eisa_tbl[] = { 396 + static const struct parisc_device_id eisa_tbl[] __initconst = { 397 397 { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00076 }, /* Mongoose */ 398 398 { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00090 }, /* Wax EISA */ 399 399 { 0, } ··· 401 401 402 402 MODULE_DEVICE_TABLE(parisc, eisa_tbl); 403 403 404 - static struct parisc_driver eisa_driver = { 404 + static struct parisc_driver eisa_driver __refdata = { 405 405 .name = "eisa_ba", 406 406 .id_table = eisa_tbl, 407 407 .probe = eisa_probe,
+3 -3
drivers/parisc/hppb.c
··· 45 45 * (return 1). If so, initialize the chip and tell other partners in crime 46 46 * they have work to do. 47 47 */ 48 - static int hppb_probe(struct parisc_device *dev) 48 + static int __init hppb_probe(struct parisc_device *dev) 49 49 { 50 50 int status; 51 51 struct hppb_card *card = &hppb_card_head; ··· 81 81 return 0; 82 82 } 83 83 84 - static struct parisc_device_id hppb_tbl[] = { 84 + static const struct parisc_device_id hppb_tbl[] __initconst = { 85 85 { HPHW_BCPORT, HVERSION_REV_ANY_ID, 0x500, 0xc }, /* E25 and K */ 86 86 { HPHW_BCPORT, 0x0, 0x501, 0xc }, /* E35 */ 87 87 { HPHW_BCPORT, 0x0, 0x502, 0xc }, /* E45 */ ··· 89 89 { 0, } 90 90 }; 91 91 92 - static struct parisc_driver hppb_driver = { 92 + static struct parisc_driver hppb_driver __refdata = { 93 93 .name = "gecko_boa", 94 94 .id_table = hppb_tbl, 95 95 .probe = hppb_probe,
+2 -2
drivers/parisc/lasi.c
··· 227 227 return ret; 228 228 } 229 229 230 - static struct parisc_device_id lasi_tbl[] = { 230 + static struct parisc_device_id lasi_tbl[] __initdata = { 231 231 { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00081 }, 232 232 { 0, } 233 233 }; 234 234 235 - struct parisc_driver lasi_driver = { 235 + struct parisc_driver lasi_driver __refdata = { 236 236 .name = "lasi", 237 237 .id_table = lasi_tbl, 238 238 .probe = lasi_init_chip,
+41 -5
drivers/parisc/lba_pci.c
··· 667 667 #define truncate_pat_collision(r,n) (0) 668 668 #endif 669 669 670 + static void pcibios_allocate_bridge_resources(struct pci_dev *dev) 671 + { 672 + int idx; 673 + struct resource *r; 674 + 675 + for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { 676 + r = &dev->resource[idx]; 677 + if (!r->flags) 678 + continue; 679 + if (r->parent) /* Already allocated */ 680 + continue; 681 + if (!r->start || pci_claim_bridge_resource(dev, idx) < 0) { 682 + /* 683 + * Something is wrong with the region. 684 + * Invalidate the resource to prevent 685 + * child resource allocations in this 686 + * range. 687 + */ 688 + r->start = r->end = 0; 689 + r->flags = 0; 690 + } 691 + } 692 + } 693 + 694 + static void pcibios_allocate_bus_resources(struct pci_bus *bus) 695 + { 696 + struct pci_bus *child; 697 + 698 + /* Depth-First Search on bus tree */ 699 + if (bus->self) 700 + pcibios_allocate_bridge_resources(bus->self); 701 + list_for_each_entry(child, &bus->children, node) 702 + pcibios_allocate_bus_resources(child); 703 + } 704 + 705 + 670 706 /* 671 707 ** The algorithm is generic code. 672 708 ** But it needs to access local data structures to get the IRQ base. ··· 729 693 ** pci_alloc_primary_bus() mangles this. 730 694 */ 731 695 if (bus->parent) { 732 - int i; 733 696 /* PCI-PCI Bridge */ 734 697 pci_read_bridge_bases(bus); 735 - for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) 736 - pci_claim_bridge_resource(bus->self, i); 698 + 699 + /* check and allocate bridge resources */ 700 + pcibios_allocate_bus_resources(bus); 737 701 } else { 738 702 /* Host-PCI Bridge */ 739 703 int err; ··· 1649 1613 return 0; 1650 1614 } 1651 1615 1652 - static struct parisc_device_id lba_tbl[] = { 1616 + static const struct parisc_device_id lba_tbl[] __initconst = { 1653 1617 { HPHW_BRIDGE, HVERSION_REV_ANY_ID, ELROY_HVERS, 0xa }, 1654 1618 { HPHW_BRIDGE, HVERSION_REV_ANY_ID, MERCURY_HVERS, 0xa }, 1655 1619 { HPHW_BRIDGE, HVERSION_REV_ANY_ID, QUICKSILVER_HVERS, 0xa }, 1656 1620 { 0, } 1657 1621 }; 1658 1622 1659 - static struct parisc_driver lba_driver = { 1623 + static struct parisc_driver lba_driver __refdata = { 1660 1624 .name = MODULE_NAME, 1661 1625 .id_table = lba_tbl, 1662 1626 .probe = lba_driver_probe,
+3 -3
drivers/parisc/sba_iommu.c
··· 1905 1905 }; 1906 1906 #endif /* CONFIG_PROC_FS */ 1907 1907 1908 - static struct parisc_device_id sba_tbl[] = { 1908 + static const struct parisc_device_id sba_tbl[] __initconst = { 1909 1909 { HPHW_IOA, HVERSION_REV_ANY_ID, ASTRO_RUNWAY_PORT, 0xb }, 1910 1910 { HPHW_BCPORT, HVERSION_REV_ANY_ID, IKE_MERCED_PORT, 0xc }, 1911 1911 { HPHW_BCPORT, HVERSION_REV_ANY_ID, REO_MERCED_PORT, 0xc }, ··· 1916 1916 1917 1917 static int sba_driver_callback(struct parisc_device *); 1918 1918 1919 - static struct parisc_driver sba_driver = { 1919 + static struct parisc_driver sba_driver __refdata = { 1920 1920 .name = MODULE_NAME, 1921 1921 .id_table = sba_tbl, 1922 1922 .probe = sba_driver_callback, ··· 1927 1927 ** If so, initialize the chip and tell other partners in crime they 1928 1928 ** have work to do. 1929 1929 */ 1930 - static int sba_driver_callback(struct parisc_device *dev) 1930 + static int __init sba_driver_callback(struct parisc_device *dev) 1931 1931 { 1932 1932 struct sba_device *sba_dev; 1933 1933 u32 func_class;
+2 -2
drivers/parisc/superio.c
··· 482 482 return -ENODEV; 483 483 } 484 484 485 - static const struct pci_device_id superio_tbl[] = { 485 + static const struct pci_device_id superio_tbl[] __initconst = { 486 486 { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO) }, 487 487 { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_USB) }, 488 488 { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415) }, 489 489 { 0, } 490 490 }; 491 491 492 - static struct pci_driver superio_driver = { 492 + static struct pci_driver superio_driver __refdata = { 493 493 .name = SUPERIO, 494 494 .id_table = superio_tbl, 495 495 .probe = superio_probe,
+2 -2
drivers/parisc/wax.c
··· 125 125 return ret; 126 126 } 127 127 128 - static struct parisc_device_id wax_tbl[] = { 128 + static const struct parisc_device_id wax_tbl[] __initconst = { 129 129 { HPHW_BA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008e }, 130 130 { 0, } 131 131 }; 132 132 133 133 MODULE_DEVICE_TABLE(parisc, wax_tbl); 134 134 135 - struct parisc_driver wax_driver = { 135 + struct parisc_driver wax_driver __refdata = { 136 136 .name = "wax", 137 137 .id_table = wax_tbl, 138 138 .probe = wax_init_chip,
+5 -5
drivers/parport/parport_gsc.c
··· 346 346 347 347 static int parport_count; 348 348 349 - static int parport_init_chip(struct parisc_device *dev) 349 + static int __init parport_init_chip(struct parisc_device *dev) 350 350 { 351 351 struct parport *p; 352 352 unsigned long port; ··· 381 381 return 0; 382 382 } 383 383 384 - static int parport_remove_chip(struct parisc_device *dev) 384 + static int __exit parport_remove_chip(struct parisc_device *dev) 385 385 { 386 386 struct parport *p = dev_get_drvdata(&dev->dev); 387 387 if (p) { ··· 403 403 return 0; 404 404 } 405 405 406 - static struct parisc_device_id parport_tbl[] = { 406 + static const struct parisc_device_id parport_tbl[] __initconst = { 407 407 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x74 }, 408 408 { 0, } 409 409 }; 410 410 411 411 MODULE_DEVICE_TABLE(parisc, parport_tbl); 412 412 413 - static struct parisc_driver parport_driver = { 413 + static struct parisc_driver parport_driver __refdata = { 414 414 .name = "Parallel", 415 415 .id_table = parport_tbl, 416 416 .probe = parport_init_chip, 417 - .remove = parport_remove_chip, 417 + .remove = __exit_p(parport_remove_chip), 418 418 }; 419 419 420 420 int parport_gsc_init(void)
+3 -3
drivers/scsi/lasi700.c
··· 81 81 #define LASI710_CLOCK 40 82 82 #define LASI_SCSI_CORE_OFFSET 0x100 83 83 84 - static struct parisc_device_id lasi700_ids[] = { 84 + static const struct parisc_device_id lasi700_ids[] __initconst = { 85 85 LASI700_ID_TABLE, 86 86 LASI710_ID_TABLE, 87 87 { 0 } ··· 164 164 return 0; 165 165 } 166 166 167 - static struct parisc_driver lasi700_driver = { 167 + static struct parisc_driver lasi700_driver __refdata = { 168 168 .name = "lasi_scsi", 169 169 .id_table = lasi700_ids, 170 170 .probe = lasi700_probe, 171 - .remove = lasi700_driver_remove, 171 + .remove = __exit_p(lasi700_driver_remove), 172 172 }; 173 173 174 174 static int __init
+4 -4
drivers/scsi/zalon.c
··· 160 160 return error; 161 161 } 162 162 163 - static struct parisc_device_id zalon_tbl[] = { 163 + static const struct parisc_device_id zalon_tbl[] __initconst = { 164 164 { HPHW_A_DMA, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00089 }, 165 165 { 0, } 166 166 }; 167 167 168 168 MODULE_DEVICE_TABLE(parisc, zalon_tbl); 169 169 170 - static int zalon_remove(struct parisc_device *dev) 170 + static int __exit zalon_remove(struct parisc_device *dev) 171 171 { 172 172 struct Scsi_Host *host = dev_get_drvdata(&dev->dev); 173 173 ··· 178 178 return 0; 179 179 } 180 180 181 - static struct parisc_driver zalon_driver = { 181 + static struct parisc_driver zalon_driver __refdata = { 182 182 .name = "zalon", 183 183 .id_table = zalon_tbl, 184 184 .probe = zalon_probe, 185 - .remove = zalon_remove, 185 + .remove = __exit_p(zalon_remove), 186 186 }; 187 187 188 188 static int __init zalon7xx_init(void)
+4 -4
drivers/tty/serial/8250/8250_gsc.c
··· 80 80 return 0; 81 81 } 82 82 83 - static struct parisc_device_id serial_tbl[] = { 83 + static const struct parisc_device_id serial_tbl[] __initconst = { 84 84 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00075 }, 85 85 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008c }, 86 86 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008d }, ··· 94 94 * which only knows about Lasi and then a second which will find all the 95 95 * other serial ports. HPUX ignores this problem. 96 96 */ 97 - static struct parisc_device_id lasi_tbl[] = { 97 + static const struct parisc_device_id lasi_tbl[] __initconst = { 98 98 { HPHW_FIO, HVERSION_REV_ANY_ID, 0x03B, 0x0008C }, /* C1xx/C1xxL */ 99 99 { HPHW_FIO, HVERSION_REV_ANY_ID, 0x03C, 0x0008C }, /* B132L */ 100 100 { HPHW_FIO, HVERSION_REV_ANY_ID, 0x03D, 0x0008C }, /* B160L */ ··· 110 110 111 111 MODULE_DEVICE_TABLE(parisc, serial_tbl); 112 112 113 - static struct parisc_driver lasi_driver = { 113 + static struct parisc_driver lasi_driver __refdata = { 114 114 .name = "serial_1", 115 115 .id_table = lasi_tbl, 116 116 .probe = serial_init_chip, 117 117 }; 118 118 119 - static struct parisc_driver serial_driver = { 119 + static struct parisc_driver serial_driver __refdata = { 120 120 .name = "serial", 121 121 .id_table = serial_tbl, 122 122 .probe = serial_init_chip,
+7 -7
drivers/tty/serial/mux.c
··· 503 503 return 0; 504 504 } 505 505 506 - static int mux_remove(struct parisc_device *dev) 506 + static int __exit mux_remove(struct parisc_device *dev) 507 507 { 508 508 int i, j; 509 509 int port_count = (long)dev_get_drvdata(&dev->dev); ··· 536 536 * This table only contains the parisc_device_id of known builtin mux 537 537 * devices. All other mux cards will be detected by the generic mux_tbl. 538 538 */ 539 - static struct parisc_device_id builtin_mux_tbl[] = { 539 + static const struct parisc_device_id builtin_mux_tbl[] __initconst = { 540 540 { HPHW_A_DIRECT, HVERSION_REV_ANY_ID, 0x15, 0x0000D }, /* All K-class */ 541 541 { HPHW_A_DIRECT, HVERSION_REV_ANY_ID, 0x44, 0x0000D }, /* E35, E45, and E55 */ 542 542 { 0, } 543 543 }; 544 544 545 - static struct parisc_device_id mux_tbl[] = { 545 + static const struct parisc_device_id mux_tbl[] __initconst = { 546 546 { HPHW_A_DIRECT, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0000D }, 547 547 { 0, } 548 548 }; ··· 550 550 MODULE_DEVICE_TABLE(parisc, builtin_mux_tbl); 551 551 MODULE_DEVICE_TABLE(parisc, mux_tbl); 552 552 553 - static struct parisc_driver builtin_serial_mux_driver = { 553 + static struct parisc_driver builtin_serial_mux_driver __refdata = { 554 554 .name = "builtin_serial_mux", 555 555 .id_table = builtin_mux_tbl, 556 556 .probe = mux_probe, 557 - .remove = mux_remove, 557 + .remove = __exit_p(mux_remove), 558 558 }; 559 559 560 - static struct parisc_driver serial_mux_driver = { 560 + static struct parisc_driver serial_mux_driver __refdata = { 561 561 .name = "serial_mux", 562 562 .id_table = mux_tbl, 563 563 .probe = mux_probe, 564 - .remove = mux_remove, 564 + .remove = __exit_p(mux_remove), 565 565 }; 566 566 567 567 /**
+6 -5
drivers/video/console/sticore.c
··· 281 281 static char default_sti_path[21] __read_mostly; 282 282 283 283 #ifndef MODULE 284 - static int sti_setup(char *str) 284 + static int __init sti_setup(char *str) 285 285 { 286 286 if (str) 287 287 strlcpy (default_sti_path, str, sizeof (default_sti_path)); ··· 941 941 * in the additional address field addr[1] while on 942 942 * older Systems the PDC stores it in page0->proc_sti 943 943 */ 944 - static int sticore_pa_init(struct parisc_device *dev) 944 + static int __init sticore_pa_init(struct parisc_device *dev) 945 945 { 946 946 char pa_path[21]; 947 947 struct sti_struct *sti = NULL; ··· 1009 1009 } 1010 1010 1011 1011 1012 - static void sticore_pci_remove(struct pci_dev *pd) 1012 + static void __exit sticore_pci_remove(struct pci_dev *pd) 1013 1013 { 1014 1014 BUG(); 1015 1015 } ··· 1029 1029 .name = "sti", 1030 1030 .id_table = sti_pci_tbl, 1031 1031 .probe = sticore_pci_init, 1032 - .remove = sticore_pci_remove, 1032 + .remove = __exit_p(sticore_pci_remove), 1033 1033 }; 1034 1034 1035 1035 static struct parisc_device_id sti_pa_tbl[] = { ··· 1037 1037 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00085 }, 1038 1038 { 0, } 1039 1039 }; 1040 + MODULE_DEVICE_TABLE(parisc, sti_pa_tbl); 1040 1041 1041 - static struct parisc_driver pa_sti_driver = { 1042 + static struct parisc_driver pa_sti_driver __refdata = { 1042 1043 .name = "sti", 1043 1044 .id_table = sti_pa_tbl, 1044 1045 .probe = sticore_pa_init,
+5 -5
sound/parisc/harmony.c
··· 66 66 MODULE_PARM_DESC(id, "ID string for Harmony driver."); 67 67 68 68 69 - static struct parisc_device_id snd_harmony_devtable[] = { 69 + static const struct parisc_device_id snd_harmony_devtable[] __initconst = { 70 70 /* bushmaster / flounder */ 71 71 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0007A }, 72 72 /* 712 / 715 */ ··· 960 960 return err; 961 961 } 962 962 963 - static int 963 + static int __init 964 964 snd_harmony_probe(struct parisc_device *padev) 965 965 { 966 966 int err; ··· 1000 1000 return err; 1001 1001 } 1002 1002 1003 - static int 1003 + static int __exit 1004 1004 snd_harmony_remove(struct parisc_device *padev) 1005 1005 { 1006 1006 snd_card_free(parisc_get_drvdata(padev)); 1007 1007 return 0; 1008 1008 } 1009 1009 1010 - static struct parisc_driver snd_harmony_driver = { 1010 + static struct parisc_driver snd_harmony_driver __refdata = { 1011 1011 .name = "harmony", 1012 1012 .id_table = snd_harmony_devtable, 1013 1013 .probe = snd_harmony_probe, 1014 - .remove = snd_harmony_remove, 1014 + .remove = __exit_p(snd_harmony_remove), 1015 1015 }; 1016 1016 1017 1017 static int __init
-2
tools/arch/parisc/include/uapi/asm/mman.h
··· 36 36 #define PROT_READ 0x1 37 37 #define PROT_SEM 0x8 38 38 #define PROT_WRITE 0x2 39 - /* MADV_HWPOISON is undefined on parisc, fix it for perf */ 40 39 #define MADV_HWPOISON 100 41 - /* MADV_SOFT_OFFLINE is undefined on parisc, fix it for perf */ 42 40 #define MADV_SOFT_OFFLINE 101 43 41 /* MAP_32BIT is undefined on parisc, fix it for perf */ 44 42 #define MAP_32BIT 0