diff options
Diffstat (limited to 'arch')
74 files changed, 798 insertions, 491 deletions
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S index ecf4d488333d..003ef4c02585 100644 --- a/arch/alpha/kernel/vmlinux.lds.S +++ b/arch/alpha/kernel/vmlinux.lds.S | |||
@@ -1,7 +1,6 @@ | |||
1 | #include <asm-generic/vmlinux.lds.h> | 1 | #include <asm-generic/vmlinux.lds.h> |
2 | #include <asm/thread_info.h> | 2 | #include <asm/thread_info.h> |
3 | #include <asm/page.h> | 3 | #include <asm/page.h> |
4 | #include <asm/thread_info.h> | ||
5 | 4 | ||
6 | OUTPUT_FORMAT("elf64-alpha") | 5 | OUTPUT_FORMAT("elf64-alpha") |
7 | OUTPUT_ARCH(alpha) | 6 | OUTPUT_ARCH(alpha) |
diff --git a/arch/arm/mach-ns9xxx/clock.c b/arch/arm/mach-ns9xxx/clock.c index 44ed20d4a388..cf81cbc57544 100644 --- a/arch/arm/mach-ns9xxx/clock.c +++ b/arch/arm/mach-ns9xxx/clock.c | |||
@@ -195,7 +195,7 @@ static int clk_debugfs_open(struct inode *inode, struct file *file) | |||
195 | return single_open(file, clk_debugfs_show, NULL); | 195 | return single_open(file, clk_debugfs_show, NULL); |
196 | } | 196 | } |
197 | 197 | ||
198 | static struct file_operations clk_debugfs_operations = { | 198 | static const struct file_operations clk_debugfs_operations = { |
199 | .open = clk_debugfs_open, | 199 | .open = clk_debugfs_open, |
200 | .read = seq_read, | 200 | .read = seq_read, |
201 | .llseek = seq_lseek, | 201 | .llseek = seq_lseek, |
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c index 4ef26faf083e..e5dcdf764c91 100644 --- a/arch/arm/mach-omap1/id.c +++ b/arch/arm/mach-omap1/id.c | |||
@@ -38,7 +38,7 @@ static struct omap_id omap_ids[] __initdata = { | |||
38 | { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000}, | 38 | { .jtag_id = 0xb574, .die_rev = 0x2, .omap_id = 0x03310315, .type = 0x03100000}, |
39 | { .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300100}, | 39 | { .jtag_id = 0x355f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300100}, |
40 | { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300300}, | 40 | { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x07300300}, |
41 | { .jtag_id = 0xb55f, .die_rev = 0x0, .omap_id = 0x03320500, .type = 0x08500000}, | 41 | { .jtag_id = 0xb62c, .die_rev = 0x1, .omap_id = 0x03320500, .type = 0x08500000}, |
42 | { .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type = 0x15100000}, | 42 | { .jtag_id = 0xb470, .die_rev = 0x0, .omap_id = 0x03310100, .type = 0x15100000}, |
43 | { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x16100000}, | 43 | { .jtag_id = 0xb576, .die_rev = 0x0, .omap_id = 0x03320000, .type = 0x16100000}, |
44 | { .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type = 0x16110000}, | 44 | { .jtag_id = 0xb576, .die_rev = 0x2, .omap_id = 0x03320100, .type = 0x16110000}, |
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index bd57ec76dc5e..efaf053eba85 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -54,7 +54,7 @@ | |||
54 | 54 | ||
55 | #define TWL4030_MSECURE_GPIO 22 | 55 | #define TWL4030_MSECURE_GPIO 22 |
56 | 56 | ||
57 | static int sdp3430_keymap[] = { | 57 | static int board_keymap[] = { |
58 | KEY(0, 0, KEY_LEFT), | 58 | KEY(0, 0, KEY_LEFT), |
59 | KEY(0, 1, KEY_RIGHT), | 59 | KEY(0, 1, KEY_RIGHT), |
60 | KEY(0, 2, KEY_A), | 60 | KEY(0, 2, KEY_A), |
@@ -88,11 +88,15 @@ static int sdp3430_keymap[] = { | |||
88 | 0 | 88 | 0 |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static struct matrix_keymap_data board_map_data = { | ||
92 | .keymap = board_keymap, | ||
93 | .keymap_size = ARRAY_SIZE(board_keymap), | ||
94 | }; | ||
95 | |||
91 | static struct twl4030_keypad_data sdp3430_kp_data = { | 96 | static struct twl4030_keypad_data sdp3430_kp_data = { |
97 | .keymap_data = &board_map_data, | ||
92 | .rows = 5, | 98 | .rows = 5, |
93 | .cols = 6, | 99 | .cols = 6, |
94 | .keymap = sdp3430_keymap, | ||
95 | .keymapsize = ARRAY_SIZE(sdp3430_keymap), | ||
96 | .rep = 1, | 100 | .rep = 1, |
97 | }; | 101 | }; |
98 | 102 | ||
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index ec6854cbdd9f..d110a7fdfbd8 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -80,7 +80,7 @@ static struct platform_device ldp_smsc911x_device = { | |||
80 | }, | 80 | }, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static int ldp_twl4030_keymap[] = { | 83 | static int board_keymap[] = { |
84 | KEY(0, 0, KEY_1), | 84 | KEY(0, 0, KEY_1), |
85 | KEY(1, 0, KEY_2), | 85 | KEY(1, 0, KEY_2), |
86 | KEY(2, 0, KEY_3), | 86 | KEY(2, 0, KEY_3), |
@@ -101,11 +101,15 @@ static int ldp_twl4030_keymap[] = { | |||
101 | 0 | 101 | 0 |
102 | }; | 102 | }; |
103 | 103 | ||
104 | static struct matrix_keymap_data board_map_data = { | ||
105 | .keymap = board_keymap, | ||
106 | .keymap_size = ARRAY_SIZE(board_keymap), | ||
107 | }; | ||
108 | |||
104 | static struct twl4030_keypad_data ldp_kp_twl4030_data = { | 109 | static struct twl4030_keypad_data ldp_kp_twl4030_data = { |
110 | .keymap_data = &board_map_data, | ||
105 | .rows = 6, | 111 | .rows = 6, |
106 | .cols = 6, | 112 | .cols = 6, |
107 | .keymap = ldp_twl4030_keymap, | ||
108 | .keymapsize = ARRAY_SIZE(ldp_twl4030_keymap), | ||
109 | .rep = 1, | 113 | .rep = 1, |
110 | }; | 114 | }; |
111 | 115 | ||
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 500c9956876d..70df6b4dbcd4 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -139,8 +139,13 @@ static struct gpio_led gpio_leds[]; | |||
139 | static int beagle_twl_gpio_setup(struct device *dev, | 139 | static int beagle_twl_gpio_setup(struct device *dev, |
140 | unsigned gpio, unsigned ngpio) | 140 | unsigned gpio, unsigned ngpio) |
141 | { | 141 | { |
142 | if (system_rev >= 0x20 && system_rev <= 0x34301000) { | ||
143 | omap_cfg_reg(AG9_34XX_GPIO23); | ||
144 | mmc[0].gpio_wp = 23; | ||
145 | } else { | ||
146 | omap_cfg_reg(AH8_34XX_GPIO29); | ||
147 | } | ||
142 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 148 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
143 | omap_cfg_reg(AH8_34XX_GPIO29); | ||
144 | mmc[0].gpio_cd = gpio + 0; | 149 | mmc[0].gpio_cd = gpio + 0; |
145 | twl4030_mmc_init(mmc); | 150 | twl4030_mmc_init(mmc); |
146 | 151 | ||
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index d50b9be90580..e4ec0c591216 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -159,7 +159,7 @@ static struct twl4030_usb_data omap3evm_usb_data = { | |||
159 | .usb_mode = T2_USB_MODE_ULPI, | 159 | .usb_mode = T2_USB_MODE_ULPI, |
160 | }; | 160 | }; |
161 | 161 | ||
162 | static int omap3evm_keymap[] = { | 162 | static int board_keymap[] = { |
163 | KEY(0, 0, KEY_LEFT), | 163 | KEY(0, 0, KEY_LEFT), |
164 | KEY(0, 1, KEY_RIGHT), | 164 | KEY(0, 1, KEY_RIGHT), |
165 | KEY(0, 2, KEY_A), | 165 | KEY(0, 2, KEY_A), |
@@ -178,11 +178,15 @@ static int omap3evm_keymap[] = { | |||
178 | KEY(3, 3, KEY_P) | 178 | KEY(3, 3, KEY_P) |
179 | }; | 179 | }; |
180 | 180 | ||
181 | static struct matrix_keymap_data board_map_data = { | ||
182 | .keymap = board_keymap, | ||
183 | .keymap_size = ARRAY_SIZE(board_keymap), | ||
184 | }; | ||
185 | |||
181 | static struct twl4030_keypad_data omap3evm_kp_data = { | 186 | static struct twl4030_keypad_data omap3evm_kp_data = { |
187 | .keymap_data = &board_map_data, | ||
182 | .rows = 4, | 188 | .rows = 4, |
183 | .cols = 4, | 189 | .cols = 4, |
184 | .keymap = omap3evm_keymap, | ||
185 | .keymapsize = ARRAY_SIZE(omap3evm_keymap), | ||
186 | .rep = 1, | 190 | .rep = 1, |
187 | }; | 191 | }; |
188 | 192 | ||
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index b43f6e36b6d9..7f6bf8772af7 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -133,7 +133,7 @@ static void __init pandora_keys_gpio_init(void) | |||
133 | omap_set_gpio_debounce_time(32 * 5, GPIO_DEBOUNCE_TIME); | 133 | omap_set_gpio_debounce_time(32 * 5, GPIO_DEBOUNCE_TIME); |
134 | } | 134 | } |
135 | 135 | ||
136 | static int pandora_keypad_map[] = { | 136 | static int board_keymap[] = { |
137 | /* col, row, code */ | 137 | /* col, row, code */ |
138 | KEY(0, 0, KEY_9), | 138 | KEY(0, 0, KEY_9), |
139 | KEY(0, 1, KEY_0), | 139 | KEY(0, 1, KEY_0), |
@@ -180,11 +180,15 @@ static int pandora_keypad_map[] = { | |||
180 | KEY(5, 2, KEY_FN), | 180 | KEY(5, 2, KEY_FN), |
181 | }; | 181 | }; |
182 | 182 | ||
183 | static struct matrix_keymap_data board_map_data = { | ||
184 | .keymap = board_keymap, | ||
185 | .keymap_size = ARRAY_SIZE(board_keymap), | ||
186 | }; | ||
187 | |||
183 | static struct twl4030_keypad_data pandora_kp_data = { | 188 | static struct twl4030_keypad_data pandora_kp_data = { |
189 | .keymap_data = &board_map_data, | ||
184 | .rows = 8, | 190 | .rows = 8, |
185 | .cols = 6, | 191 | .cols = 6, |
186 | .keymap = pandora_keypad_map, | ||
187 | .keymapsize = ARRAY_SIZE(pandora_keypad_map), | ||
188 | .rep = 1, | 192 | .rep = 1, |
189 | }; | 193 | }; |
190 | 194 | ||
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index e6e8290b7828..b45ad312c587 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #define SYSTEM_REV_B_USES_VAUX3 0x1699 | 36 | #define SYSTEM_REV_B_USES_VAUX3 0x1699 |
37 | #define SYSTEM_REV_S_USES_VAUX3 0x8 | 37 | #define SYSTEM_REV_S_USES_VAUX3 0x8 |
38 | 38 | ||
39 | static int rx51_keymap[] = { | 39 | static int board_keymap[] = { |
40 | KEY(0, 0, KEY_Q), | 40 | KEY(0, 0, KEY_Q), |
41 | KEY(0, 1, KEY_W), | 41 | KEY(0, 1, KEY_W), |
42 | KEY(0, 2, KEY_E), | 42 | KEY(0, 2, KEY_E), |
@@ -83,11 +83,15 @@ static int rx51_keymap[] = { | |||
83 | KEY(0xff, 5, KEY_F10), | 83 | KEY(0xff, 5, KEY_F10), |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static struct matrix_keymap_data board_map_data = { | ||
87 | .keymap = board_keymap, | ||
88 | .keymap_size = ARRAY_SIZE(board_keymap), | ||
89 | }; | ||
90 | |||
86 | static struct twl4030_keypad_data rx51_kp_data = { | 91 | static struct twl4030_keypad_data rx51_kp_data = { |
92 | .keymap_data = &board_map_data, | ||
87 | .rows = 8, | 93 | .rows = 8, |
88 | .cols = 8, | 94 | .cols = 8, |
89 | .keymap = rx51_keymap, | ||
90 | .keymapsize = ARRAY_SIZE(rx51_keymap), | ||
91 | .rep = 1, | 95 | .rep = 1, |
92 | }; | 96 | }; |
93 | 97 | ||
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c index 324009edbd53..b7b32208ced7 100644 --- a/arch/arm/mach-omap2/board-zoom2.c +++ b/arch/arm/mach-omap2/board-zoom2.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "mmc-twl4030.h" | 27 | #include "mmc-twl4030.h" |
28 | 28 | ||
29 | /* Zoom2 has Qwerty keyboard*/ | 29 | /* Zoom2 has Qwerty keyboard*/ |
30 | static int zoom2_twl4030_keymap[] = { | 30 | static int board_keymap[] = { |
31 | KEY(0, 0, KEY_E), | 31 | KEY(0, 0, KEY_E), |
32 | KEY(1, 0, KEY_R), | 32 | KEY(1, 0, KEY_R), |
33 | KEY(2, 0, KEY_T), | 33 | KEY(2, 0, KEY_T), |
@@ -82,11 +82,15 @@ static int zoom2_twl4030_keymap[] = { | |||
82 | 0 | 82 | 0 |
83 | }; | 83 | }; |
84 | 84 | ||
85 | static struct matrix_keymap_data board_map_data = { | ||
86 | .keymap = board_keymap, | ||
87 | .keymap_size = ARRAY_SIZE(board_keymap), | ||
88 | }; | ||
89 | |||
85 | static struct twl4030_keypad_data zoom2_kp_twl4030_data = { | 90 | static struct twl4030_keypad_data zoom2_kp_twl4030_data = { |
91 | .keymap_data = &board_map_data, | ||
86 | .rows = 8, | 92 | .rows = 8, |
87 | .cols = 8, | 93 | .cols = 8, |
88 | .keymap = zoom2_twl4030_keymap, | ||
89 | .keymapsize = ARRAY_SIZE(zoom2_twl4030_keymap), | ||
90 | .rep = 1, | 94 | .rep = 1, |
91 | }; | 95 | }; |
92 | 96 | ||
diff --git a/arch/arm/mach-omap2/cm4xxx.c b/arch/arm/mach-omap2/cm4xxx.c index e4ebd6d53135..4af76bb1003a 100644 --- a/arch/arm/mach-omap2/cm4xxx.c +++ b/arch/arm/mach-omap2/cm4xxx.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <asm/atomic.h> | 22 | #include <asm/atomic.h> |
23 | 23 | ||
24 | #include "cm.h" | 24 | #include "cm.h" |
25 | #include "cm-regbits-4xxx.h" | ||
26 | 25 | ||
27 | /* XXX move this to cm.h */ | 26 | /* XXX move this to cm.h */ |
28 | /* MAX_MODULE_READY_TIME: max milliseconds for module to leave idle */ | 27 | /* MAX_MODULE_READY_TIME: max milliseconds for module to leave idle */ |
@@ -50,19 +49,7 @@ | |||
50 | */ | 49 | */ |
51 | int omap4_cm_wait_idlest_ready(u32 prcm_mod, u8 prcm_dev_offs) | 50 | int omap4_cm_wait_idlest_ready(u32 prcm_mod, u8 prcm_dev_offs) |
52 | { | 51 | { |
53 | int i = 0; | 52 | /* FIXME: Add clock manager related code */ |
54 | u8 cm_id; | 53 | return 0; |
55 | u16 prcm_mod_offs; | ||
56 | u32 mask = OMAP4_PRCM_CM_CLKCTRL_IDLEST_MASK; | ||
57 | |||
58 | cm_id = prcm_mod >> OMAP4_PRCM_MOD_CM_ID_SHIFT; | ||
59 | prcm_mod_offs = prcm_mod & OMAP4_PRCM_MOD_OFFS_MASK; | ||
60 | |||
61 | while (((omap4_cm_read_mod_reg(cm_id, prcm_mod_offs, prcm_dev_offs, | ||
62 | OMAP4_CM_CLKCTRL_DREG) & mask) != 0) && | ||
63 | (i++ < MAX_MODULE_READY_TIME)) | ||
64 | udelay(1); | ||
65 | |||
66 | return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY; | ||
67 | } | 54 | } |
68 | 55 | ||
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index bcfcfc7fdb9b..faf7a1e0c525 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -355,29 +355,60 @@ static struct platform_device omap2_mcspi4 = { | |||
355 | }; | 355 | }; |
356 | #endif | 356 | #endif |
357 | 357 | ||
358 | static void omap_init_mcspi(void) | 358 | #ifdef CONFIG_ARCH_OMAP4 |
359 | static inline void omap4_mcspi_fixup(void) | ||
359 | { | 360 | { |
360 | if (cpu_is_omap44xx()) { | 361 | omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; |
361 | omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; | 362 | omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; |
362 | omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; | 363 | omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; |
363 | omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; | 364 | omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; |
364 | omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; | 365 | omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; |
365 | omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; | 366 | omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; |
366 | omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; | 367 | omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; |
367 | omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; | 368 | omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; |
368 | omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; | 369 | } |
369 | } | 370 | #else |
370 | platform_device_register(&omap2_mcspi1); | 371 | static inline void omap4_mcspi_fixup(void) |
371 | platform_device_register(&omap2_mcspi2); | 372 | { |
373 | } | ||
374 | #endif | ||
375 | |||
372 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ | 376 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ |
373 | defined(CONFIG_ARCH_OMAP4) | 377 | defined(CONFIG_ARCH_OMAP4) |
374 | if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx()) | 378 | static inline void omap2_mcspi3_init(void) |
375 | platform_device_register(&omap2_mcspi3); | 379 | { |
380 | platform_device_register(&omap2_mcspi3); | ||
381 | } | ||
382 | #else | ||
383 | static inline void omap2_mcspi3_init(void) | ||
384 | { | ||
385 | } | ||
376 | #endif | 386 | #endif |
387 | |||
377 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | 388 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
378 | if (cpu_is_omap343x() || cpu_is_omap44xx()) | 389 | static inline void omap2_mcspi4_init(void) |
379 | platform_device_register(&omap2_mcspi4); | 390 | { |
391 | platform_device_register(&omap2_mcspi4); | ||
392 | } | ||
393 | #else | ||
394 | static inline void omap2_mcspi4_init(void) | ||
395 | { | ||
396 | } | ||
380 | #endif | 397 | #endif |
398 | |||
399 | static void omap_init_mcspi(void) | ||
400 | { | ||
401 | if (cpu_is_omap44xx()) | ||
402 | omap4_mcspi_fixup(); | ||
403 | |||
404 | platform_device_register(&omap2_mcspi1); | ||
405 | platform_device_register(&omap2_mcspi2); | ||
406 | |||
407 | if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx()) | ||
408 | omap2_mcspi3_init(); | ||
409 | |||
410 | if (cpu_is_omap343x() || cpu_is_omap44xx()) | ||
411 | omap2_mcspi4_init(); | ||
381 | } | 412 | } |
382 | 413 | ||
383 | #else | 414 | #else |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 7574b6f20e8e..e3a3bad1d84f 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -294,10 +294,10 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | |||
294 | else if (cpu_is_omap34xx()) | 294 | else if (cpu_is_omap34xx()) |
295 | hwmods = omap34xx_hwmods; | 295 | hwmods = omap34xx_hwmods; |
296 | 296 | ||
297 | omap_hwmod_init(hwmods); | ||
298 | omap2_mux_init(); | ||
299 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ | 297 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ |
300 | /* The OPP tables have to be registered before a clk init */ | 298 | /* The OPP tables have to be registered before a clk init */ |
299 | omap_hwmod_init(hwmods); | ||
300 | omap2_mux_init(); | ||
301 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); | 301 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); |
302 | pwrdm_init(powerdomains_omap); | 302 | pwrdm_init(powerdomains_omap); |
303 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); | 303 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); |
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index 2d9b5cc981cd..4a0e1cd5c1f4 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c | |||
@@ -79,7 +79,7 @@ static int omap2_iommu_enable(struct iommu *obj) | |||
79 | l = iommu_read_reg(obj, MMU_SYSSTATUS); | 79 | l = iommu_read_reg(obj, MMU_SYSSTATUS); |
80 | if (l & MMU_SYS_RESETDONE) | 80 | if (l & MMU_SYS_RESETDONE) |
81 | break; | 81 | break; |
82 | } while (time_after(jiffies, timeout)); | 82 | } while (!time_after(jiffies, timeout)); |
83 | 83 | ||
84 | if (!(l & MMU_SYS_RESETDONE)) { | 84 | if (!(l & MMU_SYS_RESETDONE)) { |
85 | dev_err(obj->dev, "can't take mmu out of reset\n"); | 85 | dev_err(obj->dev, "can't take mmu out of reset\n"); |
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 6f71f3730c97..c035ad3426d0 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c | |||
@@ -30,6 +30,14 @@ | |||
30 | #define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) | 30 | #define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) |
31 | #define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) | 31 | #define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) |
32 | 32 | ||
33 | /* SYSCONFIG: register bit definition */ | ||
34 | #define AUTOIDLE (1 << 0) | ||
35 | #define SOFTRESET (1 << 1) | ||
36 | #define SMARTIDLE (2 << 3) | ||
37 | |||
38 | /* SYSSTATUS: register bit definition */ | ||
39 | #define RESETDONE (1 << 0) | ||
40 | |||
33 | #define MBOX_REG_SIZE 0x120 | 41 | #define MBOX_REG_SIZE 0x120 |
34 | #define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32)) | 42 | #define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32)) |
35 | 43 | ||
@@ -69,21 +77,33 @@ static inline void mbox_write_reg(u32 val, size_t ofs) | |||
69 | /* Mailbox H/W preparations */ | 77 | /* Mailbox H/W preparations */ |
70 | static int omap2_mbox_startup(struct omap_mbox *mbox) | 78 | static int omap2_mbox_startup(struct omap_mbox *mbox) |
71 | { | 79 | { |
72 | unsigned int l; | 80 | u32 l; |
81 | unsigned long timeout; | ||
73 | 82 | ||
74 | mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); | 83 | mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); |
75 | if (IS_ERR(mbox_ick_handle)) { | 84 | if (IS_ERR(mbox_ick_handle)) { |
76 | printk("Could not get mailboxes_ick\n"); | 85 | pr_err("Can't get mailboxes_ick\n"); |
77 | return -ENODEV; | 86 | return -ENODEV; |
78 | } | 87 | } |
79 | clk_enable(mbox_ick_handle); | 88 | clk_enable(mbox_ick_handle); |
80 | 89 | ||
90 | mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG); | ||
91 | timeout = jiffies + msecs_to_jiffies(20); | ||
92 | do { | ||
93 | l = mbox_read_reg(MAILBOX_SYSSTATUS); | ||
94 | if (l & RESETDONE) | ||
95 | break; | ||
96 | } while (!time_after(jiffies, timeout)); | ||
97 | |||
98 | if (!(l & RESETDONE)) { | ||
99 | pr_err("Can't take mmu out of reset\n"); | ||
100 | return -ENODEV; | ||
101 | } | ||
102 | |||
81 | l = mbox_read_reg(MAILBOX_REVISION); | 103 | l = mbox_read_reg(MAILBOX_REVISION); |
82 | pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); | 104 | pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); |
83 | 105 | ||
84 | /* set smart-idle & autoidle */ | 106 | l = SMARTIDLE | AUTOIDLE; |
85 | l = mbox_read_reg(MAILBOX_SYSCONFIG); | ||
86 | l |= 0x00000011; | ||
87 | mbox_write_reg(l, MAILBOX_SYSCONFIG); | 107 | mbox_write_reg(l, MAILBOX_SYSCONFIG); |
88 | 108 | ||
89 | omap2_mbox_enable_irq(mbox, IRQ_RX); | 109 | omap2_mbox_enable_irq(mbox, IRQ_RX); |
@@ -156,6 +176,9 @@ static void omap2_mbox_ack_irq(struct omap_mbox *mbox, | |||
156 | u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; | 176 | u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; |
157 | 177 | ||
158 | mbox_write_reg(bit, p->irqstatus); | 178 | mbox_write_reg(bit, p->irqstatus); |
179 | |||
180 | /* Flush posted write for irq status to avoid spurious interrupts */ | ||
181 | mbox_read_reg(p->irqstatus); | ||
159 | } | 182 | } |
160 | 183 | ||
161 | static int omap2_mbox_is_irq(struct omap_mbox *mbox, | 184 | static int omap2_mbox_is_irq(struct omap_mbox *mbox, |
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 2daa595aaff4..b5fac32aae70 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
@@ -460,6 +460,8 @@ MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0, | |||
460 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) | 460 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) |
461 | MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18, | 461 | MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18, |
462 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) | 462 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) |
463 | MUX_CFG_34XX("AG9_34XX_GPIO23", 0x5ee, | ||
464 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) | ||
463 | MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa, | 465 | MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa, |
464 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) | 466 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) |
465 | MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4, | 467 | MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4, |
@@ -472,6 +474,8 @@ MUX_CFG_34XX("G25_34XX_GPIO86_OUT", 0x0fc, | |||
472 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) | 474 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) |
473 | MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160, | 475 | MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160, |
474 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) | 476 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) |
477 | MUX_CFG_34XX("AF4_34XX_GPIO135_OUT", 0x162, | ||
478 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) | ||
475 | MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164, | 479 | MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164, |
476 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) | 480 | OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) |
477 | MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c, | 481 | MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c, |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 3a529c77daa8..ae2186892c85 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -110,7 +110,7 @@ static struct plat_serial8250_port serial_platform_data2[] = { | |||
110 | .uartclk = OMAP24XX_BASE_BAUD * 16, | 110 | .uartclk = OMAP24XX_BASE_BAUD * 16, |
111 | }, { | 111 | }, { |
112 | #ifdef CONFIG_ARCH_OMAP4 | 112 | #ifdef CONFIG_ARCH_OMAP4 |
113 | .membase = IO_ADDRESS(OMAP_UART4_BASE), | 113 | .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE), |
114 | .mapbase = OMAP_UART4_BASE, | 114 | .mapbase = OMAP_UART4_BASE, |
115 | .irq = 70, | 115 | .irq = 70, |
116 | .flags = UPF_BOOT_AUTOCONF, | 116 | .flags = UPF_BOOT_AUTOCONF, |
@@ -126,7 +126,7 @@ static struct plat_serial8250_port serial_platform_data2[] = { | |||
126 | #ifdef CONFIG_ARCH_OMAP4 | 126 | #ifdef CONFIG_ARCH_OMAP4 |
127 | static struct plat_serial8250_port serial_platform_data3[] = { | 127 | static struct plat_serial8250_port serial_platform_data3[] = { |
128 | { | 128 | { |
129 | .membase = IO_ADDRESS(OMAP_UART4_BASE), | 129 | .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE), |
130 | .mapbase = OMAP_UART4_BASE, | 130 | .mapbase = OMAP_UART4_BASE, |
131 | .irq = 70, | 131 | .irq = 70, |
132 | .flags = UPF_BOOT_AUTOCONF, | 132 | .flags = UPF_BOOT_AUTOCONF, |
@@ -579,7 +579,7 @@ static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = { | |||
579 | { | 579 | { |
580 | .pdev = { | 580 | .pdev = { |
581 | .name = "serial8250", | 581 | .name = "serial8250", |
582 | .id = 3 | 582 | .id = 3, |
583 | .dev = { | 583 | .dev = { |
584 | .platform_data = serial_platform_data3, | 584 | .platform_data = serial_platform_data3, |
585 | }, | 585 | }, |
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 693839c89ad0..71ebd7fcfea1 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -250,7 +250,7 @@ static struct gpio_bank gpio_bank_730[7] = { | |||
250 | 250 | ||
251 | #ifdef CONFIG_ARCH_OMAP850 | 251 | #ifdef CONFIG_ARCH_OMAP850 |
252 | static struct gpio_bank gpio_bank_850[7] = { | 252 | static struct gpio_bank gpio_bank_850[7] = { |
253 | { OMAP1_MPUIO_BASE, INT_850_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, | 253 | { OMAP1_MPUIO_VBASE, INT_850_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO }, |
254 | { OMAP850_GPIO1_BASE, INT_850_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_850 }, | 254 | { OMAP850_GPIO1_BASE, INT_850_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_850 }, |
255 | { OMAP850_GPIO2_BASE, INT_850_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_850 }, | 255 | { OMAP850_GPIO2_BASE, INT_850_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_850 }, |
256 | { OMAP850_GPIO3_BASE, INT_850_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_850 }, | 256 | { OMAP850_GPIO3_BASE, INT_850_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_850 }, |
diff --git a/arch/arm/plat-omap/include/mach/keypad.h b/arch/arm/plat-omap/include/mach/keypad.h index 45ea3ae3c995..d91b9be334ff 100644 --- a/arch/arm/plat-omap/include/mach/keypad.h +++ b/arch/arm/plat-omap/include/mach/keypad.h | |||
@@ -10,6 +10,8 @@ | |||
10 | #ifndef ASMARM_ARCH_KEYPAD_H | 10 | #ifndef ASMARM_ARCH_KEYPAD_H |
11 | #define ASMARM_ARCH_KEYPAD_H | 11 | #define ASMARM_ARCH_KEYPAD_H |
12 | 12 | ||
13 | #include <linux/input/matrix_keypad.h> | ||
14 | |||
13 | struct omap_kp_platform_data { | 15 | struct omap_kp_platform_data { |
14 | int rows; | 16 | int rows; |
15 | int cols; | 17 | int cols; |
@@ -35,9 +37,6 @@ struct omap_kp_platform_data { | |||
35 | 37 | ||
36 | #define KEY_PERSISTENT 0x00800000 | 38 | #define KEY_PERSISTENT 0x00800000 |
37 | #define KEYNUM_MASK 0x00EFFFFF | 39 | #define KEYNUM_MASK 0x00EFFFFF |
38 | #define KEY(col, row, val) (((col) << 28) | ((row) << 24) | (val)) | ||
39 | #define PERSISTENT_KEY(col, row) (((col) << 28) | ((row) << 24) | \ | ||
40 | KEY_PERSISTENT) | ||
41 | 40 | ||
42 | #endif | 41 | #endif |
43 | 42 | ||
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h index 98dfab651dfc..0f49d2d563d9 100644 --- a/arch/arm/plat-omap/include/mach/mux.h +++ b/arch/arm/plat-omap/include/mach/mux.h | |||
@@ -840,12 +840,14 @@ enum omap34xx_index { | |||
840 | */ | 840 | */ |
841 | AF26_34XX_GPIO0, | 841 | AF26_34XX_GPIO0, |
842 | AF22_34XX_GPIO9, | 842 | AF22_34XX_GPIO9, |
843 | AG9_34XX_GPIO23, | ||
843 | AH8_34XX_GPIO29, | 844 | AH8_34XX_GPIO29, |
844 | U8_34XX_GPIO54_OUT, | 845 | U8_34XX_GPIO54_OUT, |
845 | U8_34XX_GPIO54_DOWN, | 846 | U8_34XX_GPIO54_DOWN, |
846 | L8_34XX_GPIO63, | 847 | L8_34XX_GPIO63, |
847 | G25_34XX_GPIO86_OUT, | 848 | G25_34XX_GPIO86_OUT, |
848 | AG4_34XX_GPIO134_OUT, | 849 | AG4_34XX_GPIO134_OUT, |
850 | AF4_34XX_GPIO135_OUT, | ||
849 | AE4_34XX_GPIO136_OUT, | 851 | AE4_34XX_GPIO136_OUT, |
850 | AF6_34XX_GPIO140_UP, | 852 | AF6_34XX_GPIO140_UP, |
851 | AE6_34XX_GPIO141, | 853 | AE6_34XX_GPIO141, |
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index 6fc52fcbdc03..57f7122a0919 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c | |||
@@ -199,7 +199,8 @@ static void *vmap_sg(const struct sg_table *sgt) | |||
199 | va += bytes; | 199 | va += bytes; |
200 | } | 200 | } |
201 | 201 | ||
202 | flush_cache_vmap(new->addr, new->addr + total); | 202 | flush_cache_vmap((unsigned long)new->addr, |
203 | (unsigned long)(new->addr + total)); | ||
203 | return new->addr; | 204 | return new->addr; |
204 | 205 | ||
205 | err_out: | 206 | err_out: |
@@ -390,7 +391,7 @@ static void sgtable_fill_vmalloc(struct sg_table *sgt, void *_va) | |||
390 | } | 391 | } |
391 | 392 | ||
392 | va_end = _va + PAGE_SIZE * i; | 393 | va_end = _va + PAGE_SIZE * i; |
393 | flush_cache_vmap(_va, va_end); | 394 | flush_cache_vmap((unsigned long)_va, (unsigned long)va_end); |
394 | } | 395 | } |
395 | 396 | ||
396 | static inline void sgtable_drain_vmalloc(struct sg_table *sgt) | 397 | static inline void sgtable_drain_vmalloc(struct sg_table *sgt) |
diff --git a/arch/arm/plat-s3c24xx/include/plat/mci.h b/arch/arm/plat-s3c24xx/include/plat/mci.h index 2d0852ac3b27..c2cef6139683 100644 --- a/arch/arm/plat-s3c24xx/include/plat/mci.h +++ b/arch/arm/plat-s3c24xx/include/plat/mci.h | |||
@@ -2,8 +2,11 @@ | |||
2 | #define _ARCH_MCI_H | 2 | #define _ARCH_MCI_H |
3 | 3 | ||
4 | struct s3c24xx_mci_pdata { | 4 | struct s3c24xx_mci_pdata { |
5 | unsigned int no_wprotect : 1; | ||
6 | unsigned int no_detect : 1; | ||
5 | unsigned int wprotect_invert : 1; | 7 | unsigned int wprotect_invert : 1; |
6 | unsigned int detect_invert : 1; /* set => detect active high. */ | 8 | unsigned int detect_invert : 1; /* set => detect active high. */ |
9 | unsigned int use_dma : 1; | ||
7 | 10 | ||
8 | unsigned int gpio_detect; | 11 | unsigned int gpio_detect; |
9 | unsigned int gpio_wprotect; | 12 | unsigned int gpio_wprotect; |
diff --git a/arch/blackfin/mach-bf561/coreb.c b/arch/blackfin/mach-bf561/coreb.c index 93635a766f9c..1e60a92dd602 100644 --- a/arch/blackfin/mach-bf561/coreb.c +++ b/arch/blackfin/mach-bf561/coreb.c | |||
@@ -48,7 +48,7 @@ coreb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned l | |||
48 | return ret; | 48 | return ret; |
49 | } | 49 | } |
50 | 50 | ||
51 | static struct file_operations coreb_fops = { | 51 | static const struct file_operations coreb_fops = { |
52 | .owner = THIS_MODULE, | 52 | .owner = THIS_MODULE, |
53 | .ioctl = coreb_ioctl, | 53 | .ioctl = coreb_ioctl, |
54 | }; | 54 | }; |
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index 6cc1a0319a5d..562b9a7feae7 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c | |||
@@ -244,7 +244,7 @@ static unsigned sync_serial_prescale_shadow; | |||
244 | 244 | ||
245 | #define NUMBER_OF_PORTS 2 | 245 | #define NUMBER_OF_PORTS 2 |
246 | 246 | ||
247 | static struct file_operations sync_serial_fops = { | 247 | static const struct file_operations sync_serial_fops = { |
248 | .owner = THIS_MODULE, | 248 | .owner = THIS_MODULE, |
249 | .write = sync_serial_write, | 249 | .write = sync_serial_write, |
250 | .read = sync_serial_read, | 250 | .read = sync_serial_read, |
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index fe1fde893887..d89ab80498ed 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -855,7 +855,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) | |||
855 | return 0; | 855 | return 0; |
856 | } | 856 | } |
857 | 857 | ||
858 | struct file_operations gpio_fops = { | 858 | static const struct file_operations gpio_fops = { |
859 | .owner = THIS_MODULE, | 859 | .owner = THIS_MODULE, |
860 | .poll = gpio_poll, | 860 | .poll = gpio_poll, |
861 | .ioctl = gpio_ioctl, | 861 | .ioctl = gpio_ioctl, |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 6851e52ed5a2..1ee596cd942f 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -60,9 +60,7 @@ config IOMMU_HELPER | |||
60 | bool | 60 | bool |
61 | 61 | ||
62 | config GENERIC_LOCKBREAK | 62 | config GENERIC_LOCKBREAK |
63 | bool | 63 | def_bool n |
64 | default y | ||
65 | depends on SMP && PREEMPT | ||
66 | 64 | ||
67 | config RWSEM_XCHGADD_ALGORITHM | 65 | config RWSEM_XCHGADD_ALGORITHM |
68 | bool | 66 | bool |
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c index f92bdaac8976..c69552bf893e 100644 --- a/arch/ia64/ia32/binfmt_elf32.c +++ b/arch/ia64/ia32/binfmt_elf32.c | |||
@@ -69,11 +69,11 @@ ia32_install_gate_page (struct vm_area_struct *vma, struct vm_fault *vmf) | |||
69 | } | 69 | } |
70 | 70 | ||
71 | 71 | ||
72 | static struct vm_operations_struct ia32_shared_page_vm_ops = { | 72 | static const struct vm_operations_struct ia32_shared_page_vm_ops = { |
73 | .fault = ia32_install_shared_page | 73 | .fault = ia32_install_shared_page |
74 | }; | 74 | }; |
75 | 75 | ||
76 | static struct vm_operations_struct ia32_gate_page_vm_ops = { | 76 | static const struct vm_operations_struct ia32_gate_page_vm_ops = { |
77 | .fault = ia32_install_gate_page | 77 | .fault = ia32_install_gate_page |
78 | }; | 78 | }; |
79 | 79 | ||
diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h index 0f82cc2934e1..91df9686a0da 100644 --- a/arch/ia64/include/asm/acpi.h +++ b/arch/ia64/include/asm/acpi.h | |||
@@ -89,10 +89,12 @@ ia64_acpi_release_global_lock (unsigned int *lock) | |||
89 | #define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ | 89 | #define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ |
90 | ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) | 90 | ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) |
91 | 91 | ||
92 | #ifdef CONFIG_ACPI | ||
92 | #define acpi_disabled 0 /* ACPI always enabled on IA64 */ | 93 | #define acpi_disabled 0 /* ACPI always enabled on IA64 */ |
93 | #define acpi_noirq 0 /* ACPI always enabled on IA64 */ | 94 | #define acpi_noirq 0 /* ACPI always enabled on IA64 */ |
94 | #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ | 95 | #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ |
95 | #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */ | 96 | #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */ |
97 | #endif | ||
96 | #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */ | 98 | #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */ |
97 | static inline void disable_acpi(void) { } | 99 | static inline void disable_acpi(void) { } |
98 | 100 | ||
diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h index 13ab71576bc7..30bb930e1111 100644 --- a/arch/ia64/include/asm/spinlock.h +++ b/arch/ia64/include/asm/spinlock.h | |||
@@ -19,103 +19,106 @@ | |||
19 | 19 | ||
20 | #define __raw_spin_lock_init(x) ((x)->lock = 0) | 20 | #define __raw_spin_lock_init(x) ((x)->lock = 0) |
21 | 21 | ||
22 | #ifdef ASM_SUPPORTED | ||
23 | /* | 22 | /* |
24 | * Try to get the lock. If we fail to get the lock, make a non-standard call to | 23 | * Ticket locks are conceptually two parts, one indicating the current head of |
25 | * ia64_spinlock_contention(). We do not use a normal call because that would force all | 24 | * the queue, and the other indicating the current tail. The lock is acquired |
26 | * callers of __raw_spin_lock() to be non-leaf routines. Instead, ia64_spinlock_contention() is | 25 | * by atomically noting the tail and incrementing it by one (thus adding |
27 | * carefully coded to touch only those registers that __raw_spin_lock() marks "clobbered". | 26 | * ourself to the queue and noting our position), then waiting until the head |
27 | * becomes equal to the the initial value of the tail. | ||
28 | * | ||
29 | * 63 32 31 0 | ||
30 | * +----------------------------------------------------+ | ||
31 | * | next_ticket_number | now_serving | | ||
32 | * +----------------------------------------------------+ | ||
28 | */ | 33 | */ |
29 | 34 | ||
30 | #define IA64_SPINLOCK_CLOBBERS "ar.ccv", "ar.pfs", "p14", "p15", "r27", "r28", "r29", "r30", "b6", "memory" | 35 | #define TICKET_SHIFT 32 |
31 | 36 | ||
32 | static inline void | 37 | static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock) |
33 | __raw_spin_lock_flags (raw_spinlock_t *lock, unsigned long flags) | ||
34 | { | 38 | { |
35 | register volatile unsigned int *ptr asm ("r31") = &lock->lock; | 39 | int *p = (int *)&lock->lock, turn, now_serving; |
36 | 40 | ||
37 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | 41 | now_serving = *p; |
38 | # ifdef CONFIG_ITANIUM | 42 | turn = ia64_fetchadd(1, p+1, acq); |
39 | /* don't use brl on Itanium... */ | 43 | |
40 | asm volatile ("{\n\t" | 44 | if (turn == now_serving) |
41 | " mov ar.ccv = r0\n\t" | 45 | return; |
42 | " mov r28 = ip\n\t" | 46 | |
43 | " mov r30 = 1;;\n\t" | 47 | do { |
44 | "}\n\t" | 48 | cpu_relax(); |
45 | "cmpxchg4.acq r30 = [%1], r30, ar.ccv\n\t" | 49 | } while (ACCESS_ONCE(*p) != turn); |
46 | "movl r29 = ia64_spinlock_contention_pre3_4;;\n\t" | ||
47 | "cmp4.ne p14, p0 = r30, r0\n\t" | ||
48 | "mov b6 = r29;;\n\t" | ||
49 | "mov r27=%2\n\t" | ||
50 | "(p14) br.cond.spnt.many b6" | ||
51 | : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS); | ||
52 | # else | ||
53 | asm volatile ("{\n\t" | ||
54 | " mov ar.ccv = r0\n\t" | ||
55 | " mov r28 = ip\n\t" | ||
56 | " mov r30 = 1;;\n\t" | ||
57 | "}\n\t" | ||
58 | "cmpxchg4.acq r30 = [%1], r30, ar.ccv;;\n\t" | ||
59 | "cmp4.ne p14, p0 = r30, r0\n\t" | ||
60 | "mov r27=%2\n\t" | ||
61 | "(p14) brl.cond.spnt.many ia64_spinlock_contention_pre3_4;;" | ||
62 | : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS); | ||
63 | # endif /* CONFIG_MCKINLEY */ | ||
64 | #else | ||
65 | # ifdef CONFIG_ITANIUM | ||
66 | /* don't use brl on Itanium... */ | ||
67 | /* mis-declare, so we get the entry-point, not it's function descriptor: */ | ||
68 | asm volatile ("mov r30 = 1\n\t" | ||
69 | "mov r27=%2\n\t" | ||
70 | "mov ar.ccv = r0;;\n\t" | ||
71 | "cmpxchg4.acq r30 = [%0], r30, ar.ccv\n\t" | ||
72 | "movl r29 = ia64_spinlock_contention;;\n\t" | ||
73 | "cmp4.ne p14, p0 = r30, r0\n\t" | ||
74 | "mov b6 = r29;;\n\t" | ||
75 | "(p14) br.call.spnt.many b6 = b6" | ||
76 | : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS); | ||
77 | # else | ||
78 | asm volatile ("mov r30 = 1\n\t" | ||
79 | "mov r27=%2\n\t" | ||
80 | "mov ar.ccv = r0;;\n\t" | ||
81 | "cmpxchg4.acq r30 = [%0], r30, ar.ccv;;\n\t" | ||
82 | "cmp4.ne p14, p0 = r30, r0\n\t" | ||
83 | "(p14) brl.call.spnt.many b6=ia64_spinlock_contention;;" | ||
84 | : "=r"(ptr) : "r"(ptr), "r" (flags) : IA64_SPINLOCK_CLOBBERS); | ||
85 | # endif /* CONFIG_MCKINLEY */ | ||
86 | #endif | ||
87 | } | 50 | } |
88 | 51 | ||
89 | #define __raw_spin_lock(lock) __raw_spin_lock_flags(lock, 0) | 52 | static __always_inline int __ticket_spin_trylock(raw_spinlock_t *lock) |
53 | { | ||
54 | long tmp = ACCESS_ONCE(lock->lock), try; | ||
90 | 55 | ||
91 | /* Unlock by doing an ordered store and releasing the cacheline with nta */ | 56 | if (!(((tmp >> TICKET_SHIFT) ^ tmp) & ((1L << TICKET_SHIFT) - 1))) { |
92 | static inline void __raw_spin_unlock(raw_spinlock_t *x) { | 57 | try = tmp + (1L << TICKET_SHIFT); |
93 | barrier(); | 58 | |
94 | asm volatile ("st4.rel.nta [%0] = r0\n\t" :: "r"(x)); | 59 | return ia64_cmpxchg(acq, &lock->lock, tmp, try, sizeof (tmp)) == tmp; |
60 | } | ||
61 | return 0; | ||
95 | } | 62 | } |
96 | 63 | ||
97 | #else /* !ASM_SUPPORTED */ | 64 | static __always_inline void __ticket_spin_unlock(raw_spinlock_t *lock) |
98 | #define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock) | 65 | { |
99 | # define __raw_spin_lock(x) \ | 66 | int *p = (int *)&lock->lock; |
100 | do { \ | 67 | |
101 | __u32 *ia64_spinlock_ptr = (__u32 *) (x); \ | 68 | (void)ia64_fetchadd(1, p, rel); |
102 | __u64 ia64_spinlock_val; \ | 69 | } |
103 | ia64_spinlock_val = ia64_cmpxchg4_acq(ia64_spinlock_ptr, 1, 0); \ | 70 | |
104 | if (unlikely(ia64_spinlock_val)) { \ | 71 | static inline int __ticket_spin_is_locked(raw_spinlock_t *lock) |
105 | do { \ | 72 | { |
106 | while (*ia64_spinlock_ptr) \ | 73 | long tmp = ACCESS_ONCE(lock->lock); |
107 | ia64_barrier(); \ | 74 | |
108 | ia64_spinlock_val = ia64_cmpxchg4_acq(ia64_spinlock_ptr, 1, 0); \ | 75 | return !!(((tmp >> TICKET_SHIFT) ^ tmp) & ((1L << TICKET_SHIFT) - 1)); |
109 | } while (ia64_spinlock_val); \ | 76 | } |
110 | } \ | 77 | |
111 | } while (0) | 78 | static inline int __ticket_spin_is_contended(raw_spinlock_t *lock) |
112 | #define __raw_spin_unlock(x) do { barrier(); ((raw_spinlock_t *) x)->lock = 0; } while (0) | 79 | { |
113 | #endif /* !ASM_SUPPORTED */ | 80 | long tmp = ACCESS_ONCE(lock->lock); |
114 | 81 | ||
115 | #define __raw_spin_is_locked(x) ((x)->lock != 0) | 82 | return (((tmp >> TICKET_SHIFT) - tmp) & ((1L << TICKET_SHIFT) - 1)) > 1; |
116 | #define __raw_spin_trylock(x) (cmpxchg_acq(&(x)->lock, 0, 1) == 0) | 83 | } |
117 | #define __raw_spin_unlock_wait(lock) \ | 84 | |
118 | do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0) | 85 | static inline int __raw_spin_is_locked(raw_spinlock_t *lock) |
86 | { | ||
87 | return __ticket_spin_is_locked(lock); | ||
88 | } | ||
89 | |||
90 | static inline int __raw_spin_is_contended(raw_spinlock_t *lock) | ||
91 | { | ||
92 | return __ticket_spin_is_contended(lock); | ||
93 | } | ||
94 | #define __raw_spin_is_contended __raw_spin_is_contended | ||
95 | |||
96 | static __always_inline void __raw_spin_lock(raw_spinlock_t *lock) | ||
97 | { | ||
98 | __ticket_spin_lock(lock); | ||
99 | } | ||
100 | |||
101 | static __always_inline int __raw_spin_trylock(raw_spinlock_t *lock) | ||
102 | { | ||
103 | return __ticket_spin_trylock(lock); | ||
104 | } | ||
105 | |||
106 | static __always_inline void __raw_spin_unlock(raw_spinlock_t *lock) | ||
107 | { | ||
108 | __ticket_spin_unlock(lock); | ||
109 | } | ||
110 | |||
111 | static __always_inline void __raw_spin_lock_flags(raw_spinlock_t *lock, | ||
112 | unsigned long flags) | ||
113 | { | ||
114 | __raw_spin_lock(lock); | ||
115 | } | ||
116 | |||
117 | static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock) | ||
118 | { | ||
119 | while (__raw_spin_is_locked(lock)) | ||
120 | cpu_relax(); | ||
121 | } | ||
119 | 122 | ||
120 | #define __raw_read_can_lock(rw) (*(volatile int *)(rw) >= 0) | 123 | #define __raw_read_can_lock(rw) (*(volatile int *)(rw) >= 0) |
121 | #define __raw_write_can_lock(rw) (*(volatile int *)(rw) == 0) | 124 | #define __raw_write_can_lock(rw) (*(volatile int *)(rw) == 0) |
diff --git a/arch/ia64/include/asm/spinlock_types.h b/arch/ia64/include/asm/spinlock_types.h index 474e46f1ab4a..b61d136d9bc2 100644 --- a/arch/ia64/include/asm/spinlock_types.h +++ b/arch/ia64/include/asm/spinlock_types.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | typedef struct { | 8 | typedef struct { |
9 | volatile unsigned int lock; | 9 | volatile unsigned long lock; |
10 | } raw_spinlock_t; | 10 | } raw_spinlock_t; |
11 | 11 | ||
12 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } | 12 | #define __RAW_SPIN_LOCK_UNLOCKED { 0 } |
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S index 1a6e44515eb4..696eff28a0c4 100644 --- a/arch/ia64/kernel/head.S +++ b/arch/ia64/kernel/head.S | |||
@@ -1130,95 +1130,6 @@ SET_REG(b5); | |||
1130 | #endif /* CONFIG_IA64_BRL_EMU */ | 1130 | #endif /* CONFIG_IA64_BRL_EMU */ |
1131 | 1131 | ||
1132 | #ifdef CONFIG_SMP | 1132 | #ifdef CONFIG_SMP |
1133 | /* | ||
1134 | * This routine handles spinlock contention. It uses a non-standard calling | ||
1135 | * convention to avoid converting leaf routines into interior routines. Because | ||
1136 | * of this special convention, there are several restrictions: | ||
1137 | * | ||
1138 | * - do not use gp relative variables, this code is called from the kernel | ||
1139 | * and from modules, r1 is undefined. | ||
1140 | * - do not use stacked registers, the caller owns them. | ||
1141 | * - do not use the scratch stack space, the caller owns it. | ||
1142 | * - do not use any registers other than the ones listed below | ||
1143 | * | ||
1144 | * Inputs: | ||
1145 | * ar.pfs - saved CFM of caller | ||
1146 | * ar.ccv - 0 (and available for use) | ||
1147 | * r27 - flags from spin_lock_irqsave or 0. Must be preserved. | ||
1148 | * r28 - available for use. | ||
1149 | * r29 - available for use. | ||
1150 | * r30 - available for use. | ||
1151 | * r31 - address of lock, available for use. | ||
1152 | * b6 - return address | ||
1153 | * p14 - available for use. | ||
1154 | * p15 - used to track flag status. | ||
1155 | * | ||
1156 | * If you patch this code to use more registers, do not forget to update | ||
1157 | * the clobber lists for spin_lock() in arch/ia64/include/asm/spinlock.h. | ||
1158 | */ | ||
1159 | |||
1160 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | ||
1161 | |||
1162 | GLOBAL_ENTRY(ia64_spinlock_contention_pre3_4) | ||
1163 | .prologue | ||
1164 | .save ar.pfs, r0 // this code effectively has a zero frame size | ||
1165 | .save rp, r28 | ||
1166 | .body | ||
1167 | nop 0 | ||
1168 | tbit.nz p15,p0=r27,IA64_PSR_I_BIT | ||
1169 | .restore sp // pop existing prologue after next insn | ||
1170 | mov b6 = r28 | ||
1171 | .prologue | ||
1172 | .save ar.pfs, r0 | ||
1173 | .altrp b6 | ||
1174 | .body | ||
1175 | ;; | ||
1176 | (p15) ssm psr.i // reenable interrupts if they were on | ||
1177 | // DavidM says that srlz.d is slow and is not required in this case | ||
1178 | .wait: | ||
1179 | // exponential backoff, kdb, lockmeter etc. go in here | ||
1180 | hint @pause | ||
1181 | ld4 r30=[r31] // don't use ld4.bias; if it's contended, we won't write the word | ||
1182 | nop 0 | ||
1183 | ;; | ||
1184 | cmp4.ne p14,p0=r30,r0 | ||
1185 | (p14) br.cond.sptk.few .wait | ||
1186 | (p15) rsm psr.i // disable interrupts if we reenabled them | ||
1187 | br.cond.sptk.few b6 // lock is now free, try to acquire | ||
1188 | .global ia64_spinlock_contention_pre3_4_end // for kernprof | ||
1189 | ia64_spinlock_contention_pre3_4_end: | ||
1190 | END(ia64_spinlock_contention_pre3_4) | ||
1191 | |||
1192 | #else | ||
1193 | |||
1194 | GLOBAL_ENTRY(ia64_spinlock_contention) | ||
1195 | .prologue | ||
1196 | .altrp b6 | ||
1197 | .body | ||
1198 | tbit.nz p15,p0=r27,IA64_PSR_I_BIT | ||
1199 | ;; | ||
1200 | .wait: | ||
1201 | (p15) ssm psr.i // reenable interrupts if they were on | ||
1202 | // DavidM says that srlz.d is slow and is not required in this case | ||
1203 | .wait2: | ||
1204 | // exponential backoff, kdb, lockmeter etc. go in here | ||
1205 | hint @pause | ||
1206 | ld4 r30=[r31] // don't use ld4.bias; if it's contended, we won't write the word | ||
1207 | ;; | ||
1208 | cmp4.ne p14,p0=r30,r0 | ||
1209 | mov r30 = 1 | ||
1210 | (p14) br.cond.sptk.few .wait2 | ||
1211 | (p15) rsm psr.i // disable interrupts if we reenabled them | ||
1212 | ;; | ||
1213 | cmpxchg4.acq r30=[r31], r30, ar.ccv | ||
1214 | ;; | ||
1215 | cmp4.ne p14,p0=r0,r30 | ||
1216 | (p14) br.cond.sptk.few .wait | ||
1217 | |||
1218 | br.ret.sptk.many b6 // lock is now taken | ||
1219 | END(ia64_spinlock_contention) | ||
1220 | |||
1221 | #endif | ||
1222 | 1133 | ||
1223 | #ifdef CONFIG_HOTPLUG_CPU | 1134 | #ifdef CONFIG_HOTPLUG_CPU |
1224 | GLOBAL_ENTRY(ia64_jump_to_sal) | 1135 | GLOBAL_ENTRY(ia64_jump_to_sal) |
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c index 8ebccb589e1c..14d39e300627 100644 --- a/arch/ia64/kernel/ia64_ksyms.c +++ b/arch/ia64/kernel/ia64_ksyms.c | |||
@@ -84,26 +84,6 @@ EXPORT_SYMBOL(ia64_save_scratch_fpregs); | |||
84 | #include <asm/unwind.h> | 84 | #include <asm/unwind.h> |
85 | EXPORT_SYMBOL(unw_init_running); | 85 | EXPORT_SYMBOL(unw_init_running); |
86 | 86 | ||
87 | #ifdef ASM_SUPPORTED | ||
88 | # ifdef CONFIG_SMP | ||
89 | # if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | ||
90 | /* | ||
91 | * This is not a normal routine and we don't want a function descriptor for it, so we use | ||
92 | * a fake declaration here. | ||
93 | */ | ||
94 | extern char ia64_spinlock_contention_pre3_4; | ||
95 | EXPORT_SYMBOL(ia64_spinlock_contention_pre3_4); | ||
96 | # else | ||
97 | /* | ||
98 | * This is not a normal routine and we don't want a function descriptor for it, so we use | ||
99 | * a fake declaration here. | ||
100 | */ | ||
101 | extern char ia64_spinlock_contention; | ||
102 | EXPORT_SYMBOL(ia64_spinlock_contention); | ||
103 | # endif | ||
104 | # endif | ||
105 | #endif | ||
106 | |||
107 | #if defined(CONFIG_IA64_ESI) || defined(CONFIG_IA64_ESI_MODULE) | 87 | #if defined(CONFIG_IA64_ESI) || defined(CONFIG_IA64_ESI_MODULE) |
108 | extern void esi_call_phys (void); | 88 | extern void esi_call_phys (void); |
109 | EXPORT_SYMBOL_GPL(esi_call_phys); | 89 | EXPORT_SYMBOL_GPL(esi_call_phys); |
diff --git a/arch/ia64/oprofile/backtrace.c b/arch/ia64/oprofile/backtrace.c index adb01566bd57..5cdd7e4a597c 100644 --- a/arch/ia64/oprofile/backtrace.c +++ b/arch/ia64/oprofile/backtrace.c | |||
@@ -32,24 +32,6 @@ typedef struct | |||
32 | u64 *prev_pfs_loc; /* state for WAR for old spinlock ool code */ | 32 | u64 *prev_pfs_loc; /* state for WAR for old spinlock ool code */ |
33 | } ia64_backtrace_t; | 33 | } ia64_backtrace_t; |
34 | 34 | ||
35 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | ||
36 | /* | ||
37 | * Returns non-zero if the PC is in the spinlock contention out-of-line code | ||
38 | * with non-standard calling sequence (on older compilers). | ||
39 | */ | ||
40 | static __inline__ int in_old_ool_spinlock_code(unsigned long pc) | ||
41 | { | ||
42 | extern const char ia64_spinlock_contention_pre3_4[] __attribute__ ((weak)); | ||
43 | extern const char ia64_spinlock_contention_pre3_4_end[] __attribute__ ((weak)); | ||
44 | unsigned long sc_start = (unsigned long)ia64_spinlock_contention_pre3_4; | ||
45 | unsigned long sc_end = (unsigned long)ia64_spinlock_contention_pre3_4_end; | ||
46 | return (sc_start && sc_end && pc >= sc_start && pc < sc_end); | ||
47 | } | ||
48 | #else | ||
49 | /* Newer spinlock code does a proper br.call and works fine with the unwinder */ | ||
50 | #define in_old_ool_spinlock_code(pc) 0 | ||
51 | #endif | ||
52 | |||
53 | /* Returns non-zero if the PC is in the Interrupt Vector Table */ | 35 | /* Returns non-zero if the PC is in the Interrupt Vector Table */ |
54 | static __inline__ int in_ivt_code(unsigned long pc) | 36 | static __inline__ int in_ivt_code(unsigned long pc) |
55 | { | 37 | { |
@@ -80,7 +62,7 @@ static __inline__ int next_frame(ia64_backtrace_t *bt) | |||
80 | */ | 62 | */ |
81 | if (bt->prev_pfs_loc && bt->regs && bt->frame.pfs_loc == bt->prev_pfs_loc) | 63 | if (bt->prev_pfs_loc && bt->regs && bt->frame.pfs_loc == bt->prev_pfs_loc) |
82 | bt->frame.pfs_loc = &bt->regs->ar_pfs; | 64 | bt->frame.pfs_loc = &bt->regs->ar_pfs; |
83 | bt->prev_pfs_loc = (in_old_ool_spinlock_code(bt->frame.ip) ? bt->frame.pfs_loc : NULL); | 65 | bt->prev_pfs_loc = NULL; |
84 | 66 | ||
85 | return unw_unwind(&bt->frame) == 0; | 67 | return unw_unwind(&bt->frame) == 0; |
86 | } | 68 | } |
diff --git a/arch/m68k/include/asm/hardirq_mm.h b/arch/m68k/include/asm/hardirq_mm.h index 554f65b6cd3b..394ee946015c 100644 --- a/arch/m68k/include/asm/hardirq_mm.h +++ b/arch/m68k/include/asm/hardirq_mm.h | |||
@@ -1,8 +1,16 @@ | |||
1 | #ifndef __M68K_HARDIRQ_H | 1 | #ifndef __M68K_HARDIRQ_H |
2 | #define __M68K_HARDIRQ_H | 2 | #define __M68K_HARDIRQ_H |
3 | 3 | ||
4 | #define HARDIRQ_BITS 8 | 4 | #include <linux/threads.h> |
5 | #include <linux/cache.h> | ||
6 | |||
7 | /* entry.S is sensitive to the offsets of these fields */ | ||
8 | typedef struct { | ||
9 | unsigned int __softirq_pending; | ||
10 | } ____cacheline_aligned irq_cpustat_t; | ||
5 | 11 | ||
6 | #include <asm-generic/hardirq.h> | 12 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
13 | |||
14 | #define HARDIRQ_BITS 8 | ||
7 | 15 | ||
8 | #endif | 16 | #endif |
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c index 3ab6d80d150d..19c1c82849ff 100644 --- a/arch/mips/alchemy/common/dbdma.c +++ b/arch/mips/alchemy/common/dbdma.c | |||
@@ -175,7 +175,7 @@ static dbdev_tab_t dbdev_tab[] = { | |||
175 | #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) | 175 | #define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) |
176 | 176 | ||
177 | #ifdef CONFIG_PM | 177 | #ifdef CONFIG_PM |
178 | static u32 au1xxx_dbdma_pm_regs[NUM_DBDMA_CHANS + 1][8]; | 178 | static u32 au1xxx_dbdma_pm_regs[NUM_DBDMA_CHANS + 1][6]; |
179 | #endif | 179 | #endif |
180 | 180 | ||
181 | 181 | ||
@@ -993,14 +993,13 @@ void au1xxx_dbdma_suspend(void) | |||
993 | au1xxx_dbdma_pm_regs[0][3] = au_readl(addr + 0x0c); | 993 | au1xxx_dbdma_pm_regs[0][3] = au_readl(addr + 0x0c); |
994 | 994 | ||
995 | /* save channel configurations */ | 995 | /* save channel configurations */ |
996 | for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) { | 996 | for (i = 1, addr = DDMA_CHANNEL_BASE; i <= NUM_DBDMA_CHANS; i++) { |
997 | au1xxx_dbdma_pm_regs[i][0] = au_readl(addr + 0x00); | 997 | au1xxx_dbdma_pm_regs[i][0] = au_readl(addr + 0x00); |
998 | au1xxx_dbdma_pm_regs[i][1] = au_readl(addr + 0x04); | 998 | au1xxx_dbdma_pm_regs[i][1] = au_readl(addr + 0x04); |
999 | au1xxx_dbdma_pm_regs[i][2] = au_readl(addr + 0x08); | 999 | au1xxx_dbdma_pm_regs[i][2] = au_readl(addr + 0x08); |
1000 | au1xxx_dbdma_pm_regs[i][3] = au_readl(addr + 0x0c); | 1000 | au1xxx_dbdma_pm_regs[i][3] = au_readl(addr + 0x0c); |
1001 | au1xxx_dbdma_pm_regs[i][4] = au_readl(addr + 0x10); | 1001 | au1xxx_dbdma_pm_regs[i][4] = au_readl(addr + 0x10); |
1002 | au1xxx_dbdma_pm_regs[i][5] = au_readl(addr + 0x14); | 1002 | au1xxx_dbdma_pm_regs[i][5] = au_readl(addr + 0x14); |
1003 | au1xxx_dbdma_pm_regs[i][6] = au_readl(addr + 0x18); | ||
1004 | 1003 | ||
1005 | /* halt channel */ | 1004 | /* halt channel */ |
1006 | au_writel(au1xxx_dbdma_pm_regs[i][0] & ~1, addr + 0x00); | 1005 | au_writel(au1xxx_dbdma_pm_regs[i][0] & ~1, addr + 0x00); |
@@ -1027,14 +1026,13 @@ void au1xxx_dbdma_resume(void) | |||
1027 | au_writel(au1xxx_dbdma_pm_regs[0][3], addr + 0x0c); | 1026 | au_writel(au1xxx_dbdma_pm_regs[0][3], addr + 0x0c); |
1028 | 1027 | ||
1029 | /* restore channel configurations */ | 1028 | /* restore channel configurations */ |
1030 | for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) { | 1029 | for (i = 1, addr = DDMA_CHANNEL_BASE; i <= NUM_DBDMA_CHANS; i++) { |
1031 | au_writel(au1xxx_dbdma_pm_regs[i][0], addr + 0x00); | 1030 | au_writel(au1xxx_dbdma_pm_regs[i][0], addr + 0x00); |
1032 | au_writel(au1xxx_dbdma_pm_regs[i][1], addr + 0x04); | 1031 | au_writel(au1xxx_dbdma_pm_regs[i][1], addr + 0x04); |
1033 | au_writel(au1xxx_dbdma_pm_regs[i][2], addr + 0x08); | 1032 | au_writel(au1xxx_dbdma_pm_regs[i][2], addr + 0x08); |
1034 | au_writel(au1xxx_dbdma_pm_regs[i][3], addr + 0x0c); | 1033 | au_writel(au1xxx_dbdma_pm_regs[i][3], addr + 0x0c); |
1035 | au_writel(au1xxx_dbdma_pm_regs[i][4], addr + 0x10); | 1034 | au_writel(au1xxx_dbdma_pm_regs[i][4], addr + 0x10); |
1036 | au_writel(au1xxx_dbdma_pm_regs[i][5], addr + 0x14); | 1035 | au_writel(au1xxx_dbdma_pm_regs[i][5], addr + 0x14); |
1037 | au_writel(au1xxx_dbdma_pm_regs[i][6], addr + 0x18); | ||
1038 | au_sync(); | 1036 | au_sync(); |
1039 | addr += 0x100; /* next channel base */ | 1037 | addr += 0x100; /* next channel base */ |
1040 | } | 1038 | } |
diff --git a/arch/mips/basler/excite/excite_iodev.c b/arch/mips/basler/excite/excite_iodev.c index dfbfd7e2ac08..938b1d0b7652 100644 --- a/arch/mips/basler/excite/excite_iodev.c +++ b/arch/mips/basler/excite/excite_iodev.c | |||
@@ -112,10 +112,8 @@ static int iodev_open(struct inode *i, struct file *f) | |||
112 | { | 112 | { |
113 | int ret; | 113 | int ret; |
114 | 114 | ||
115 | lock_kernel(); | ||
116 | ret = request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED, | 115 | ret = request_irq(iodev_irq, iodev_irqhdl, IRQF_DISABLED, |
117 | iodev_name, &miscdev); | 116 | iodev_name, &miscdev); |
118 | unlock_kernel(); | ||
119 | 117 | ||
120 | return ret; | 118 | return ret; |
121 | } | 119 | } |
diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile index aaa585cf26e3..c146d1ededed 100644 --- a/arch/mips/bcm63xx/Makefile +++ b/arch/mips/bcm63xx/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \ | 1 | obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \ |
2 | dev-dsp.o dev-enet.o | 2 | dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o |
3 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 3 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
4 | 4 | ||
5 | obj-y += boards/ | 5 | obj-y += boards/ |
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c index fd77f548207a..78e155d21be6 100644 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c | |||
@@ -20,10 +20,11 @@ | |||
20 | #include <bcm63xx_cpu.h> | 20 | #include <bcm63xx_cpu.h> |
21 | #include <bcm63xx_regs.h> | 21 | #include <bcm63xx_regs.h> |
22 | #include <bcm63xx_io.h> | 22 | #include <bcm63xx_io.h> |
23 | #include <bcm63xx_board.h> | ||
24 | #include <bcm63xx_dev_pci.h> | 23 | #include <bcm63xx_dev_pci.h> |
25 | #include <bcm63xx_dev_enet.h> | 24 | #include <bcm63xx_dev_enet.h> |
26 | #include <bcm63xx_dev_dsp.h> | 25 | #include <bcm63xx_dev_dsp.h> |
26 | #include <bcm63xx_dev_pcmcia.h> | ||
27 | #include <bcm63xx_dev_uart.h> | ||
27 | #include <board_bcm963xx.h> | 28 | #include <board_bcm963xx.h> |
28 | 29 | ||
29 | #define PFX "board_bcm963xx: " | 30 | #define PFX "board_bcm963xx: " |
@@ -793,6 +794,11 @@ int __init board_register_devices(void) | |||
793 | { | 794 | { |
794 | u32 val; | 795 | u32 val; |
795 | 796 | ||
797 | bcm63xx_uart_register(); | ||
798 | |||
799 | if (board.has_pccard) | ||
800 | bcm63xx_pcmcia_register(); | ||
801 | |||
796 | if (board.has_enet0 && | 802 | if (board.has_enet0 && |
797 | !board_get_mac_address(board.enet0.mac_addr)) | 803 | !board_get_mac_address(board.enet0.mac_addr)) |
798 | bcm63xx_enet_register(0, &board.enet0); | 804 | bcm63xx_enet_register(0, &board.enet0); |
diff --git a/arch/mips/bcm63xx/dev-pcmcia.c b/arch/mips/bcm63xx/dev-pcmcia.c new file mode 100644 index 000000000000..de4d917fd54d --- /dev/null +++ b/arch/mips/bcm63xx/dev-pcmcia.c | |||
@@ -0,0 +1,144 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr> | ||
7 | */ | ||
8 | |||
9 | #include <linux/init.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <asm/bootinfo.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | #include <bcm63xx_cs.h> | ||
14 | #include <bcm63xx_cpu.h> | ||
15 | #include <bcm63xx_dev_pcmcia.h> | ||
16 | #include <bcm63xx_io.h> | ||
17 | #include <bcm63xx_regs.h> | ||
18 | |||
19 | static struct resource pcmcia_resources[] = { | ||
20 | /* pcmcia registers */ | ||
21 | { | ||
22 | /* start & end filled at runtime */ | ||
23 | .flags = IORESOURCE_MEM, | ||
24 | }, | ||
25 | |||
26 | /* pcmcia memory zone resources */ | ||
27 | { | ||
28 | .start = BCM_PCMCIA_COMMON_BASE_PA, | ||
29 | .end = BCM_PCMCIA_COMMON_END_PA, | ||
30 | .flags = IORESOURCE_MEM, | ||
31 | }, | ||
32 | { | ||
33 | .start = BCM_PCMCIA_ATTR_BASE_PA, | ||
34 | .end = BCM_PCMCIA_ATTR_END_PA, | ||
35 | .flags = IORESOURCE_MEM, | ||
36 | }, | ||
37 | { | ||
38 | .start = BCM_PCMCIA_IO_BASE_PA, | ||
39 | .end = BCM_PCMCIA_IO_END_PA, | ||
40 | .flags = IORESOURCE_MEM, | ||
41 | }, | ||
42 | |||
43 | /* PCMCIA irq */ | ||
44 | { | ||
45 | /* start filled at runtime */ | ||
46 | .flags = IORESOURCE_IRQ, | ||
47 | }, | ||
48 | |||
49 | /* declare PCMCIA IO resource also */ | ||
50 | { | ||
51 | .start = BCM_PCMCIA_IO_BASE_PA, | ||
52 | .end = BCM_PCMCIA_IO_END_PA, | ||
53 | .flags = IORESOURCE_IO, | ||
54 | }, | ||
55 | }; | ||
56 | |||
57 | static struct bcm63xx_pcmcia_platform_data pd; | ||
58 | |||
59 | static struct platform_device bcm63xx_pcmcia_device = { | ||
60 | .name = "bcm63xx_pcmcia", | ||
61 | .id = 0, | ||
62 | .num_resources = ARRAY_SIZE(pcmcia_resources), | ||
63 | .resource = pcmcia_resources, | ||
64 | .dev = { | ||
65 | .platform_data = &pd, | ||
66 | }, | ||
67 | }; | ||
68 | |||
69 | static int __init config_pcmcia_cs(unsigned int cs, | ||
70 | u32 base, unsigned int size) | ||
71 | { | ||
72 | int ret; | ||
73 | |||
74 | ret = bcm63xx_set_cs_status(cs, 0); | ||
75 | if (!ret) | ||
76 | ret = bcm63xx_set_cs_base(cs, base, size); | ||
77 | if (!ret) | ||
78 | ret = bcm63xx_set_cs_status(cs, 1); | ||
79 | return ret; | ||
80 | } | ||
81 | |||
82 | static const __initdata struct { | ||
83 | unsigned int cs; | ||
84 | unsigned int base; | ||
85 | unsigned int size; | ||
86 | } pcmcia_cs[3] = { | ||
87 | { | ||
88 | .cs = MPI_CS_PCMCIA_COMMON, | ||
89 | .base = BCM_PCMCIA_COMMON_BASE_PA, | ||
90 | .size = BCM_PCMCIA_COMMON_SIZE | ||
91 | }, | ||
92 | { | ||
93 | .cs = MPI_CS_PCMCIA_ATTR, | ||
94 | .base = BCM_PCMCIA_ATTR_BASE_PA, | ||
95 | .size = BCM_PCMCIA_ATTR_SIZE | ||
96 | }, | ||
97 | { | ||
98 | .cs = MPI_CS_PCMCIA_IO, | ||
99 | .base = BCM_PCMCIA_IO_BASE_PA, | ||
100 | .size = BCM_PCMCIA_IO_SIZE | ||
101 | }, | ||
102 | }; | ||
103 | |||
104 | int __init bcm63xx_pcmcia_register(void) | ||
105 | { | ||
106 | int ret, i; | ||
107 | |||
108 | if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358()) | ||
109 | return 0; | ||
110 | |||
111 | /* use correct pcmcia ready gpio depending on processor */ | ||
112 | switch (bcm63xx_get_cpu_id()) { | ||
113 | case BCM6348_CPU_ID: | ||
114 | pd.ready_gpio = 22; | ||
115 | break; | ||
116 | |||
117 | case BCM6358_CPU_ID: | ||
118 | pd.ready_gpio = 18; | ||
119 | break; | ||
120 | |||
121 | default: | ||
122 | return -ENODEV; | ||
123 | } | ||
124 | |||
125 | pcmcia_resources[0].start = bcm63xx_regset_address(RSET_PCMCIA); | ||
126 | pcmcia_resources[0].end = pcmcia_resources[0].start + | ||
127 | RSET_PCMCIA_SIZE - 1; | ||
128 | pcmcia_resources[4].start = bcm63xx_get_irq_number(IRQ_PCMCIA); | ||
129 | |||
130 | /* configure pcmcia chip selects */ | ||
131 | for (i = 0; i < 3; i++) { | ||
132 | ret = config_pcmcia_cs(pcmcia_cs[i].cs, | ||
133 | pcmcia_cs[i].base, | ||
134 | pcmcia_cs[i].size); | ||
135 | if (ret) | ||
136 | goto out_err; | ||
137 | } | ||
138 | |||
139 | return platform_device_register(&bcm63xx_pcmcia_device); | ||
140 | |||
141 | out_err: | ||
142 | printk(KERN_ERR "unable to set pcmcia chip select\n"); | ||
143 | return ret; | ||
144 | } | ||
diff --git a/arch/mips/bcm63xx/dev-uart.c b/arch/mips/bcm63xx/dev-uart.c new file mode 100644 index 000000000000..5f3d89c4a988 --- /dev/null +++ b/arch/mips/bcm63xx/dev-uart.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr> | ||
7 | */ | ||
8 | |||
9 | #include <linux/init.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <bcm63xx_cpu.h> | ||
13 | #include <bcm63xx_dev_uart.h> | ||
14 | |||
15 | static struct resource uart_resources[] = { | ||
16 | { | ||
17 | .start = -1, /* filled at runtime */ | ||
18 | .end = -1, /* filled at runtime */ | ||
19 | .flags = IORESOURCE_MEM, | ||
20 | }, | ||
21 | { | ||
22 | .start = -1, /* filled at runtime */ | ||
23 | .flags = IORESOURCE_IRQ, | ||
24 | }, | ||
25 | }; | ||
26 | |||
27 | static struct platform_device bcm63xx_uart_device = { | ||
28 | .name = "bcm63xx_uart", | ||
29 | .id = 0, | ||
30 | .num_resources = ARRAY_SIZE(uart_resources), | ||
31 | .resource = uart_resources, | ||
32 | }; | ||
33 | |||
34 | int __init bcm63xx_uart_register(void) | ||
35 | { | ||
36 | uart_resources[0].start = bcm63xx_regset_address(RSET_UART0); | ||
37 | uart_resources[0].end = uart_resources[0].start; | ||
38 | uart_resources[0].end += RSET_UART_SIZE - 1; | ||
39 | uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); | ||
40 | return platform_device_register(&bcm63xx_uart_device); | ||
41 | } | ||
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pcmcia.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pcmcia.h new file mode 100644 index 000000000000..2beb3969ce3b --- /dev/null +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_pcmcia.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef BCM63XX_DEV_PCMCIA_H_ | ||
2 | #define BCM63XX_DEV_PCMCIA_H_ | ||
3 | |||
4 | /* | ||
5 | * PCMCIA driver platform data | ||
6 | */ | ||
7 | struct bcm63xx_pcmcia_platform_data { | ||
8 | unsigned int ready_gpio; | ||
9 | }; | ||
10 | |||
11 | int bcm63xx_pcmcia_register(void); | ||
12 | |||
13 | #endif /* BCM63XX_DEV_PCMCIA_H_ */ | ||
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h new file mode 100644 index 000000000000..bf348f573bbc --- /dev/null +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef BCM63XX_DEV_UART_H_ | ||
2 | #define BCM63XX_DEV_UART_H_ | ||
3 | |||
4 | int bcm63xx_uart_register(void); | ||
5 | |||
6 | #endif /* BCM63XX_DEV_UART_H_ */ | ||
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h index e15f11a09311..af42385245d5 100644 --- a/arch/mips/include/asm/smp.h +++ b/arch/mips/include/asm/smp.h | |||
@@ -77,7 +77,18 @@ extern void play_dead(void); | |||
77 | 77 | ||
78 | extern asmlinkage void smp_call_function_interrupt(void); | 78 | extern asmlinkage void smp_call_function_interrupt(void); |
79 | 79 | ||
80 | extern void arch_send_call_function_single_ipi(int cpu); | 80 | static inline void arch_send_call_function_single_ipi(int cpu) |
81 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | 81 | { |
82 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
83 | |||
84 | mp_ops->send_ipi_mask(&cpumask_of_cpu(cpu), SMP_CALL_FUNCTION); | ||
85 | } | ||
86 | |||
87 | static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask) | ||
88 | { | ||
89 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
90 | |||
91 | mp_ops->send_ipi_mask(mask, SMP_CALL_FUNCTION); | ||
92 | } | ||
82 | 93 | ||
83 | #endif /* __ASM_SMP_H */ | 94 | #endif /* __ASM_SMP_H */ |
diff --git a/arch/mips/include/asm/unaligned.h b/arch/mips/include/asm/unaligned.h index 792404948571..42f66c311473 100644 --- a/arch/mips/include/asm/unaligned.h +++ b/arch/mips/include/asm/unaligned.h | |||
@@ -12,17 +12,17 @@ | |||
12 | #if defined(__MIPSEB__) | 12 | #if defined(__MIPSEB__) |
13 | # include <linux/unaligned/be_struct.h> | 13 | # include <linux/unaligned/be_struct.h> |
14 | # include <linux/unaligned/le_byteshift.h> | 14 | # include <linux/unaligned/le_byteshift.h> |
15 | # include <linux/unaligned/generic.h> | ||
16 | # define get_unaligned __get_unaligned_be | 15 | # define get_unaligned __get_unaligned_be |
17 | # define put_unaligned __put_unaligned_be | 16 | # define put_unaligned __put_unaligned_be |
18 | #elif defined(__MIPSEL__) | 17 | #elif defined(__MIPSEL__) |
19 | # include <linux/unaligned/le_struct.h> | 18 | # include <linux/unaligned/le_struct.h> |
20 | # include <linux/unaligned/be_byteshift.h> | 19 | # include <linux/unaligned/be_byteshift.h> |
21 | # include <linux/unaligned/generic.h> | ||
22 | # define get_unaligned __get_unaligned_le | 20 | # define get_unaligned __get_unaligned_le |
23 | # define put_unaligned __put_unaligned_le | 21 | # define put_unaligned __put_unaligned_le |
24 | #else | 22 | #else |
25 | # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" | 23 | # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" |
26 | #endif | 24 | #endif |
27 | 25 | ||
26 | # include <linux/unaligned/generic.h> | ||
27 | |||
28 | #endif /* _ASM_MIPS_UNALIGNED_H */ | 28 | #endif /* _ASM_MIPS_UNALIGNED_H */ |
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c index f2397f00db43..ad4e017ed2f3 100644 --- a/arch/mips/kernel/kspd.c +++ b/arch/mips/kernel/kspd.c | |||
@@ -172,13 +172,20 @@ static unsigned int translate_open_flags(int flags) | |||
172 | } | 172 | } |
173 | 173 | ||
174 | 174 | ||
175 | static void sp_setfsuidgid( uid_t uid, gid_t gid) | 175 | static int sp_setfsuidgid(uid_t uid, gid_t gid) |
176 | { | 176 | { |
177 | current->cred->fsuid = uid; | 177 | struct cred *new; |
178 | current->cred->fsgid = gid; | ||
179 | 178 | ||
180 | key_fsuid_changed(current); | 179 | new = prepare_creds(); |
181 | key_fsgid_changed(current); | 180 | if (!new) |
181 | return -ENOMEM; | ||
182 | |||
183 | new->fsuid = uid; | ||
184 | new->fsgid = gid; | ||
185 | |||
186 | commit_creds(new); | ||
187 | |||
188 | return 0; | ||
182 | } | 189 | } |
183 | 190 | ||
184 | /* | 191 | /* |
@@ -196,7 +203,7 @@ void sp_work_handle_request(void) | |||
196 | mm_segment_t old_fs; | 203 | mm_segment_t old_fs; |
197 | struct timeval tv; | 204 | struct timeval tv; |
198 | struct timezone tz; | 205 | struct timezone tz; |
199 | int cmd; | 206 | int err, cmd; |
200 | 207 | ||
201 | char *vcwd; | 208 | char *vcwd; |
202 | int size; | 209 | int size; |
@@ -225,8 +232,11 @@ void sp_work_handle_request(void) | |||
225 | /* Run the syscall at the privilege of the user who loaded the | 232 | /* Run the syscall at the privilege of the user who loaded the |
226 | SP program */ | 233 | SP program */ |
227 | 234 | ||
228 | if (vpe_getuid(tclimit)) | 235 | if (vpe_getuid(tclimit)) { |
229 | sp_setfsuidgid(vpe_getuid(tclimit), vpe_getgid(tclimit)); | 236 | err = sp_setfsuidgid(vpe_getuid(tclimit), vpe_getgid(tclimit)); |
237 | if (!err) | ||
238 | pr_err("Change of creds failed\n"); | ||
239 | } | ||
230 | 240 | ||
231 | switch (sc.cmd) { | 241 | switch (sc.cmd) { |
232 | /* needs the flags argument translating from SDE kit to | 242 | /* needs the flags argument translating from SDE kit to |
@@ -283,8 +293,11 @@ void sp_work_handle_request(void) | |||
283 | break; | 293 | break; |
284 | } /* switch */ | 294 | } /* switch */ |
285 | 295 | ||
286 | if (vpe_getuid(tclimit)) | 296 | if (vpe_getuid(tclimit)) { |
287 | sp_setfsuidgid( 0, 0); | 297 | err = sp_setfsuidgid(0, 0); |
298 | if (!err) | ||
299 | pr_err("restoring old creds failed\n"); | ||
300 | } | ||
288 | 301 | ||
289 | old_fs = get_fs(); | 302 | old_fs = get_fs(); |
290 | set_fs(KERNEL_DS); | 303 | set_fs(KERNEL_DS); |
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index a10ebfdc28ae..364f066cb497 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -72,8 +72,9 @@ static void rtlx_dispatch(void) | |||
72 | */ | 72 | */ |
73 | static irqreturn_t rtlx_interrupt(int irq, void *dev_id) | 73 | static irqreturn_t rtlx_interrupt(int irq, void *dev_id) |
74 | { | 74 | { |
75 | unsigned int vpeflags; | ||
76 | unsigned long flags; | ||
75 | int i; | 77 | int i; |
76 | unsigned int flags, vpeflags; | ||
77 | 78 | ||
78 | /* Ought not to be strictly necessary for SMTC builds */ | 79 | /* Ought not to be strictly necessary for SMTC builds */ |
79 | local_irq_save(flags); | 80 | local_irq_save(flags); |
@@ -392,20 +393,12 @@ out: | |||
392 | 393 | ||
393 | static int file_open(struct inode *inode, struct file *filp) | 394 | static int file_open(struct inode *inode, struct file *filp) |
394 | { | 395 | { |
395 | int minor = iminor(inode); | 396 | return rtlx_open(iminor(inode), (filp->f_flags & O_NONBLOCK) ? 0 : 1); |
396 | int err; | ||
397 | |||
398 | lock_kernel(); | ||
399 | err = rtlx_open(minor, (filp->f_flags & O_NONBLOCK) ? 0 : 1); | ||
400 | unlock_kernel(); | ||
401 | return err; | ||
402 | } | 397 | } |
403 | 398 | ||
404 | static int file_release(struct inode *inode, struct file *filp) | 399 | static int file_release(struct inode *inode, struct file *filp) |
405 | { | 400 | { |
406 | int minor = iminor(inode); | 401 | return rtlx_release(iminor(inode)); |
407 | |||
408 | return rtlx_release(minor); | ||
409 | } | 402 | } |
410 | 403 | ||
411 | static unsigned int file_poll(struct file *file, poll_table * wait) | 404 | static unsigned int file_poll(struct file *file, poll_table * wait) |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 4eb106c6a3ec..e72e6844d134 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/cpumask.h> | 32 | #include <linux/cpumask.h> |
33 | #include <linux/cpu.h> | 33 | #include <linux/cpu.h> |
34 | #include <linux/err.h> | 34 | #include <linux/err.h> |
35 | #include <linux/smp.h> | ||
36 | 35 | ||
37 | #include <asm/atomic.h> | 36 | #include <asm/atomic.h> |
38 | #include <asm/cpu.h> | 37 | #include <asm/cpu.h> |
@@ -128,19 +127,6 @@ asmlinkage __cpuinit void start_secondary(void) | |||
128 | cpu_idle(); | 127 | cpu_idle(); |
129 | } | 128 | } |
130 | 129 | ||
131 | void arch_send_call_function_ipi_mask(const struct cpumask *mask) | ||
132 | { | ||
133 | mp_ops->send_ipi_mask(mask, SMP_CALL_FUNCTION); | ||
134 | } | ||
135 | |||
136 | /* | ||
137 | * We reuse the same vector for the single IPI | ||
138 | */ | ||
139 | void arch_send_call_function_single_ipi(int cpu) | ||
140 | { | ||
141 | mp_ops->send_ipi_mask(cpumask_of_cpu(cpu), SMP_CALL_FUNCTION); | ||
142 | } | ||
143 | |||
144 | /* | 130 | /* |
145 | * Call into both interrupt handlers, as we share the IPI for them | 131 | * Call into both interrupt handlers, as we share the IPI for them |
146 | */ | 132 | */ |
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 67153a0dc267..4d181df44a40 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
@@ -1098,9 +1098,8 @@ static void ipi_irq_dispatch(void) | |||
1098 | 1098 | ||
1099 | static struct irqaction irq_ipi = { | 1099 | static struct irqaction irq_ipi = { |
1100 | .handler = ipi_interrupt, | 1100 | .handler = ipi_interrupt, |
1101 | .flags = IRQF_DISABLED, | 1101 | .flags = IRQF_DISABLED | IRQF_PERCPU, |
1102 | .name = "SMTC_IPI", | 1102 | .name = "SMTC_IPI" |
1103 | .flags = IRQF_PERCPU | ||
1104 | }; | 1103 | }; |
1105 | 1104 | ||
1106 | static void setup_cross_vpe_interrupts(unsigned int nvpe) | 1105 | static void setup_cross_vpe_interrupts(unsigned int nvpe) |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index eb6c4c5b7fbe..03092ab2a296 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -144,14 +144,15 @@ struct tc { | |||
144 | }; | 144 | }; |
145 | 145 | ||
146 | struct { | 146 | struct { |
147 | /* Virtual processing elements */ | 147 | spinlock_t vpe_list_lock; |
148 | struct list_head vpe_list; | 148 | struct list_head vpe_list; /* Virtual processing elements */ |
149 | 149 | spinlock_t tc_list_lock; | |
150 | /* Thread contexts */ | 150 | struct list_head tc_list; /* Thread contexts */ |
151 | struct list_head tc_list; | ||
152 | } vpecontrol = { | 151 | } vpecontrol = { |
153 | .vpe_list = LIST_HEAD_INIT(vpecontrol.vpe_list), | 152 | .vpe_list_lock = SPIN_LOCK_UNLOCKED, |
154 | .tc_list = LIST_HEAD_INIT(vpecontrol.tc_list) | 153 | .vpe_list = LIST_HEAD_INIT(vpecontrol.vpe_list), |
154 | .tc_list_lock = SPIN_LOCK_UNLOCKED, | ||
155 | .tc_list = LIST_HEAD_INIT(vpecontrol.tc_list) | ||
155 | }; | 156 | }; |
156 | 157 | ||
157 | static void release_progmem(void *ptr); | 158 | static void release_progmem(void *ptr); |
@@ -159,28 +160,38 @@ static void release_progmem(void *ptr); | |||
159 | /* get the vpe associated with this minor */ | 160 | /* get the vpe associated with this minor */ |
160 | static struct vpe *get_vpe(int minor) | 161 | static struct vpe *get_vpe(int minor) |
161 | { | 162 | { |
162 | struct vpe *v; | 163 | struct vpe *res, *v; |
163 | 164 | ||
164 | if (!cpu_has_mipsmt) | 165 | if (!cpu_has_mipsmt) |
165 | return NULL; | 166 | return NULL; |
166 | 167 | ||
168 | res = NULL; | ||
169 | spin_lock(&vpecontrol.vpe_list_lock); | ||
167 | list_for_each_entry(v, &vpecontrol.vpe_list, list) { | 170 | list_for_each_entry(v, &vpecontrol.vpe_list, list) { |
168 | if (v->minor == minor) | 171 | if (v->minor == minor) { |
169 | return v; | 172 | res = v; |
173 | break; | ||
174 | } | ||
170 | } | 175 | } |
176 | spin_unlock(&vpecontrol.vpe_list_lock); | ||
171 | 177 | ||
172 | return NULL; | 178 | return res; |
173 | } | 179 | } |
174 | 180 | ||
175 | /* get the vpe associated with this minor */ | 181 | /* get the vpe associated with this minor */ |
176 | static struct tc *get_tc(int index) | 182 | static struct tc *get_tc(int index) |
177 | { | 183 | { |
178 | struct tc *t; | 184 | struct tc *res, *t; |
179 | 185 | ||
186 | res = NULL; | ||
187 | spin_lock(&vpecontrol.tc_list_lock); | ||
180 | list_for_each_entry(t, &vpecontrol.tc_list, list) { | 188 | list_for_each_entry(t, &vpecontrol.tc_list, list) { |
181 | if (t->index == index) | 189 | if (t->index == index) { |
182 | return t; | 190 | res = t; |
191 | break; | ||
192 | } | ||
183 | } | 193 | } |
194 | spin_unlock(&vpecontrol.tc_list_lock); | ||
184 | 195 | ||
185 | return NULL; | 196 | return NULL; |
186 | } | 197 | } |
@@ -190,15 +201,17 @@ static struct vpe *alloc_vpe(int minor) | |||
190 | { | 201 | { |
191 | struct vpe *v; | 202 | struct vpe *v; |
192 | 203 | ||
193 | if ((v = kzalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) { | 204 | if ((v = kzalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) |
194 | return NULL; | 205 | return NULL; |
195 | } | ||
196 | 206 | ||
197 | INIT_LIST_HEAD(&v->tc); | 207 | INIT_LIST_HEAD(&v->tc); |
208 | spin_lock(&vpecontrol.vpe_list_lock); | ||
198 | list_add_tail(&v->list, &vpecontrol.vpe_list); | 209 | list_add_tail(&v->list, &vpecontrol.vpe_list); |
210 | spin_unlock(&vpecontrol.vpe_list_lock); | ||
199 | 211 | ||
200 | INIT_LIST_HEAD(&v->notify); | 212 | INIT_LIST_HEAD(&v->notify); |
201 | v->minor = minor; | 213 | v->minor = minor; |
214 | |||
202 | return v; | 215 | return v; |
203 | } | 216 | } |
204 | 217 | ||
@@ -212,7 +225,10 @@ static struct tc *alloc_tc(int index) | |||
212 | 225 | ||
213 | INIT_LIST_HEAD(&tc->tc); | 226 | INIT_LIST_HEAD(&tc->tc); |
214 | tc->index = index; | 227 | tc->index = index; |
228 | |||
229 | spin_lock(&vpecontrol.tc_list_lock); | ||
215 | list_add_tail(&tc->list, &vpecontrol.tc_list); | 230 | list_add_tail(&tc->list, &vpecontrol.tc_list); |
231 | spin_unlock(&vpecontrol.tc_list_lock); | ||
216 | 232 | ||
217 | out: | 233 | out: |
218 | return tc; | 234 | return tc; |
@@ -227,7 +243,7 @@ static void release_vpe(struct vpe *v) | |||
227 | kfree(v); | 243 | kfree(v); |
228 | } | 244 | } |
229 | 245 | ||
230 | static void dump_mtregs(void) | 246 | static void __maybe_unused dump_mtregs(void) |
231 | { | 247 | { |
232 | unsigned long val; | 248 | unsigned long val; |
233 | 249 | ||
@@ -1048,20 +1064,19 @@ static int vpe_open(struct inode *inode, struct file *filp) | |||
1048 | enum vpe_state state; | 1064 | enum vpe_state state; |
1049 | struct vpe_notifications *not; | 1065 | struct vpe_notifications *not; |
1050 | struct vpe *v; | 1066 | struct vpe *v; |
1051 | int ret, err = 0; | 1067 | int ret; |
1052 | 1068 | ||
1053 | lock_kernel(); | ||
1054 | if (minor != iminor(inode)) { | 1069 | if (minor != iminor(inode)) { |
1055 | /* assume only 1 device at the moment. */ | 1070 | /* assume only 1 device at the moment. */ |
1056 | printk(KERN_WARNING "VPE loader: only vpe1 is supported\n"); | 1071 | pr_warning("VPE loader: only vpe1 is supported\n"); |
1057 | err = -ENODEV; | 1072 | |
1058 | goto out; | 1073 | return -ENODEV; |
1059 | } | 1074 | } |
1060 | 1075 | ||
1061 | if ((v = get_vpe(tclimit)) == NULL) { | 1076 | if ((v = get_vpe(tclimit)) == NULL) { |
1062 | printk(KERN_WARNING "VPE loader: unable to get vpe\n"); | 1077 | pr_warning("VPE loader: unable to get vpe\n"); |
1063 | err = -ENODEV; | 1078 | |
1064 | goto out; | 1079 | return -ENODEV; |
1065 | } | 1080 | } |
1066 | 1081 | ||
1067 | state = xchg(&v->state, VPE_STATE_INUSE); | 1082 | state = xchg(&v->state, VPE_STATE_INUSE); |
@@ -1101,8 +1116,8 @@ static int vpe_open(struct inode *inode, struct file *filp) | |||
1101 | v->shared_ptr = NULL; | 1116 | v->shared_ptr = NULL; |
1102 | v->__start = 0; | 1117 | v->__start = 0; |
1103 | 1118 | ||
1104 | out: | ||
1105 | unlock_kernel(); | 1119 | unlock_kernel(); |
1120 | |||
1106 | return 0; | 1121 | return 0; |
1107 | } | 1122 | } |
1108 | 1123 | ||
@@ -1594,14 +1609,14 @@ static void __exit vpe_module_exit(void) | |||
1594 | { | 1609 | { |
1595 | struct vpe *v, *n; | 1610 | struct vpe *v, *n; |
1596 | 1611 | ||
1612 | device_del(&vpe_device); | ||
1613 | unregister_chrdev(major, module_name); | ||
1614 | |||
1615 | /* No locking needed here */ | ||
1597 | list_for_each_entry_safe(v, n, &vpecontrol.vpe_list, list) { | 1616 | list_for_each_entry_safe(v, n, &vpecontrol.vpe_list, list) { |
1598 | if (v->state != VPE_STATE_UNUSED) { | 1617 | if (v->state != VPE_STATE_UNUSED) |
1599 | release_vpe(v); | 1618 | release_vpe(v); |
1600 | } | ||
1601 | } | 1619 | } |
1602 | |||
1603 | device_del(&vpe_device); | ||
1604 | unregister_chrdev(major, module_name); | ||
1605 | } | 1620 | } |
1606 | 1621 | ||
1607 | module_init(vpe_module_init); | 1622 | module_init(vpe_module_init); |
diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c index b55c2d1b998f..5ab5fa8c1d82 100644 --- a/arch/mips/mm/sc-mips.c +++ b/arch/mips/mm/sc-mips.c | |||
@@ -32,6 +32,11 @@ static void mips_sc_wback_inv(unsigned long addr, unsigned long size) | |||
32 | */ | 32 | */ |
33 | static void mips_sc_inv(unsigned long addr, unsigned long size) | 33 | static void mips_sc_inv(unsigned long addr, unsigned long size) |
34 | { | 34 | { |
35 | unsigned long lsize = cpu_scache_line_size(); | ||
36 | unsigned long almask = ~(lsize - 1); | ||
37 | |||
38 | cache_op(Hit_Writeback_Inv_SD, addr & almask); | ||
39 | cache_op(Hit_Writeback_Inv_SD, (addr + size - 1) & almask); | ||
35 | blast_inv_scache_range(addr, addr + size); | 40 | blast_inv_scache_range(addr, addr + size); |
36 | } | 41 | } |
37 | 42 | ||
diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c index 655cb8dec340..deed1d5d4982 100644 --- a/arch/mips/oprofile/op_model_loongson2.c +++ b/arch/mips/oprofile/op_model_loongson2.c | |||
@@ -44,7 +44,7 @@ static struct loongson2_register_config { | |||
44 | unsigned int ctrl; | 44 | unsigned int ctrl; |
45 | unsigned long long reset_counter1; | 45 | unsigned long long reset_counter1; |
46 | unsigned long long reset_counter2; | 46 | unsigned long long reset_counter2; |
47 | int cnt1_enalbed, cnt2_enalbed; | 47 | int cnt1_enabled, cnt2_enabled; |
48 | } reg; | 48 | } reg; |
49 | 49 | ||
50 | DEFINE_SPINLOCK(sample_lock); | 50 | DEFINE_SPINLOCK(sample_lock); |
@@ -81,8 +81,8 @@ static void loongson2_reg_setup(struct op_counter_config *cfg) | |||
81 | 81 | ||
82 | reg.ctrl = ctrl; | 82 | reg.ctrl = ctrl; |
83 | 83 | ||
84 | reg.cnt1_enalbed = cfg[0].enabled; | 84 | reg.cnt1_enabled = cfg[0].enabled; |
85 | reg.cnt2_enalbed = cfg[1].enabled; | 85 | reg.cnt2_enabled = cfg[1].enabled; |
86 | 86 | ||
87 | } | 87 | } |
88 | 88 | ||
@@ -99,7 +99,7 @@ static void loongson2_cpu_setup(void *args) | |||
99 | static void loongson2_cpu_start(void *args) | 99 | static void loongson2_cpu_start(void *args) |
100 | { | 100 | { |
101 | /* Start all counters on current CPU */ | 101 | /* Start all counters on current CPU */ |
102 | if (reg.cnt1_enalbed || reg.cnt2_enalbed) | 102 | if (reg.cnt1_enabled || reg.cnt2_enabled) |
103 | write_c0_perfctrl(reg.ctrl); | 103 | write_c0_perfctrl(reg.ctrl); |
104 | } | 104 | } |
105 | 105 | ||
@@ -125,7 +125,7 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id) | |||
125 | */ | 125 | */ |
126 | 126 | ||
127 | /* Check whether the irq belongs to me */ | 127 | /* Check whether the irq belongs to me */ |
128 | enabled = reg.cnt1_enalbed | reg.cnt2_enalbed; | 128 | enabled = reg.cnt1_enabled | reg.cnt2_enabled; |
129 | if (!enabled) | 129 | if (!enabled) |
130 | return IRQ_NONE; | 130 | return IRQ_NONE; |
131 | 131 | ||
@@ -136,12 +136,12 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id) | |||
136 | spin_lock_irqsave(&sample_lock, flags); | 136 | spin_lock_irqsave(&sample_lock, flags); |
137 | 137 | ||
138 | if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) { | 138 | if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) { |
139 | if (reg.cnt1_enalbed) | 139 | if (reg.cnt1_enabled) |
140 | oprofile_add_sample(regs, 0); | 140 | oprofile_add_sample(regs, 0); |
141 | counter1 = reg.reset_counter1; | 141 | counter1 = reg.reset_counter1; |
142 | } | 142 | } |
143 | if (counter2 & LOONGSON2_PERFCNT_OVERFLOW) { | 143 | if (counter2 & LOONGSON2_PERFCNT_OVERFLOW) { |
144 | if (reg.cnt2_enalbed) | 144 | if (reg.cnt2_enabled) |
145 | oprofile_add_sample(regs, 1); | 145 | oprofile_add_sample(regs, 1); |
146 | counter2 = reg.reset_counter2; | 146 | counter2 = reg.reset_counter2; |
147 | } | 147 | } |
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c index 109c95ca698b..32548b5d68d6 100644 --- a/arch/mips/pci/ops-pmcmsp.c +++ b/arch/mips/pci/ops-pmcmsp.c | |||
@@ -385,6 +385,7 @@ int msp_pcibios_config_access(unsigned char access_type, | |||
385 | unsigned long intr; | 385 | unsigned long intr; |
386 | unsigned long value; | 386 | unsigned long value; |
387 | static char pciirqflag; | 387 | static char pciirqflag; |
388 | int ret; | ||
388 | #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL) | 389 | #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL) |
389 | unsigned int vpe_status; | 390 | unsigned int vpe_status; |
390 | #endif | 391 | #endif |
@@ -402,11 +403,13 @@ int msp_pcibios_config_access(unsigned char access_type, | |||
402 | * allocation assigns an interrupt handler to the interrupt. | 403 | * allocation assigns an interrupt handler to the interrupt. |
403 | */ | 404 | */ |
404 | if (pciirqflag == 0) { | 405 | if (pciirqflag == 0) { |
405 | request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */ | 406 | ret = request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */ |
406 | bpci_interrupt, | 407 | bpci_interrupt, |
407 | IRQF_SHARED | IRQF_DISABLED, | 408 | IRQF_SHARED | IRQF_DISABLED, |
408 | "PMC MSP PCI Host", | 409 | "PMC MSP PCI Host", |
409 | preg); | 410 | preg); |
411 | if (ret != 0) | ||
412 | return ret; | ||
410 | pciirqflag = ~0; | 413 | pciirqflag = ~0; |
411 | } | 414 | } |
412 | 415 | ||
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c index 9aa8f2951df6..c6851df9ab74 100644 --- a/arch/mips/sgi-ip27/ip27-smp.c +++ b/arch/mips/sgi-ip27/ip27-smp.c | |||
@@ -165,7 +165,7 @@ static void ip27_send_ipi_single(int destid, unsigned int action) | |||
165 | REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cpu_to_node(destid)), irq); | 165 | REMOTE_HUB_SEND_INTR(COMPACT_TO_NASID_NODEID(cpu_to_node(destid)), irq); |
166 | } | 166 | } |
167 | 167 | ||
168 | static void ip27_send_ipi(const struct cpumask *mask, unsigned int action) | 168 | static void ip27_send_ipi_mask(const struct cpumask *mask, unsigned int action) |
169 | { | 169 | { |
170 | unsigned int i; | 170 | unsigned int i; |
171 | 171 | ||
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index ba59839a021e..4070268aa769 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c | |||
@@ -117,10 +117,6 @@ static int bcm1480_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
117 | unsigned long flags; | 117 | unsigned long flags; |
118 | unsigned int irq_dirty; | 118 | unsigned int irq_dirty; |
119 | 119 | ||
120 | if (cpumask_weight(mask) != 1) { | ||
121 | printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq); | ||
122 | return -1; | ||
123 | } | ||
124 | i = cpumask_first(mask); | 120 | i = cpumask_first(mask); |
125 | 121 | ||
126 | /* Convert logical CPU to physical CPU */ | 122 | /* Convert logical CPU to physical CPU */ |
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c index 637a194e5cd5..15ea778b5e66 100644 --- a/arch/mips/sibyte/common/sb_tbprof.c +++ b/arch/mips/sibyte/common/sb_tbprof.c | |||
@@ -403,36 +403,31 @@ static int sbprof_zbprof_stop(void) | |||
403 | static int sbprof_tb_open(struct inode *inode, struct file *filp) | 403 | static int sbprof_tb_open(struct inode *inode, struct file *filp) |
404 | { | 404 | { |
405 | int minor; | 405 | int minor; |
406 | int err = 0; | ||
407 | 406 | ||
408 | lock_kernel(); | ||
409 | minor = iminor(inode); | 407 | minor = iminor(inode); |
410 | if (minor != 0) { | 408 | if (minor != 0) |
411 | err = -ENODEV; | 409 | return -ENODEV; |
412 | goto out; | ||
413 | } | ||
414 | 410 | ||
415 | if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED) { | 411 | if (xchg(&sbp.open, SB_OPENING) != SB_CLOSED) |
416 | err = -EBUSY; | 412 | return -EBUSY; |
417 | goto out; | ||
418 | } | ||
419 | 413 | ||
420 | memset(&sbp, 0, sizeof(struct sbprof_tb)); | 414 | memset(&sbp, 0, sizeof(struct sbprof_tb)); |
421 | sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES); | 415 | sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES); |
422 | if (!sbp.sbprof_tbbuf) { | 416 | if (!sbp.sbprof_tbbuf) { |
423 | err = -ENOMEM; | 417 | sbp.open = SB_CLOSED; |
424 | goto out; | 418 | wmb(); |
419 | return -ENOMEM; | ||
425 | } | 420 | } |
421 | |||
426 | memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES); | 422 | memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES); |
427 | init_waitqueue_head(&sbp.tb_sync); | 423 | init_waitqueue_head(&sbp.tb_sync); |
428 | init_waitqueue_head(&sbp.tb_read); | 424 | init_waitqueue_head(&sbp.tb_read); |
429 | mutex_init(&sbp.lock); | 425 | mutex_init(&sbp.lock); |
430 | 426 | ||
431 | sbp.open = SB_OPEN; | 427 | sbp.open = SB_OPEN; |
428 | wmb(); | ||
432 | 429 | ||
433 | out: | 430 | return 0; |
434 | unlock_kernel(); | ||
435 | return err; | ||
436 | } | 431 | } |
437 | 432 | ||
438 | static int sbprof_tb_release(struct inode *inode, struct file *filp) | 433 | static int sbprof_tb_release(struct inode *inode, struct file *filp) |
@@ -440,7 +435,7 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp) | |||
440 | int minor; | 435 | int minor; |
441 | 436 | ||
442 | minor = iminor(inode); | 437 | minor = iminor(inode); |
443 | if (minor != 0 || !sbp.open) | 438 | if (minor != 0 || sbp.open != SB_CLOSED) |
444 | return -ENODEV; | 439 | return -ENODEV; |
445 | 440 | ||
446 | mutex_lock(&sbp.lock); | 441 | mutex_lock(&sbp.lock); |
@@ -449,7 +444,8 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp) | |||
449 | sbprof_zbprof_stop(); | 444 | sbprof_zbprof_stop(); |
450 | 445 | ||
451 | vfree(sbp.sbprof_tbbuf); | 446 | vfree(sbp.sbprof_tbbuf); |
452 | sbp.open = 0; | 447 | sbp.open = SB_CLOSED; |
448 | wmb(); | ||
453 | 449 | ||
454 | mutex_unlock(&sbp.lock); | 450 | mutex_unlock(&sbp.lock); |
455 | 451 | ||
@@ -583,7 +579,8 @@ static int __init sbprof_tb_init(void) | |||
583 | } | 579 | } |
584 | tb_dev = dev; | 580 | tb_dev = dev; |
585 | 581 | ||
586 | sbp.open = 0; | 582 | sbp.open = SB_CLOSED; |
583 | wmb(); | ||
587 | tb_period = zbbus_mhz * 10000LL; | 584 | tb_period = zbbus_mhz * 10000LL; |
588 | pr_info(DEVNAME ": initialized - tb_period = %lld\n", | 585 | pr_info(DEVNAME ": initialized - tb_period = %lld\n", |
589 | (long long) tb_period); | 586 | (long long) tb_period); |
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c index 623ffc933c4c..5277aac96b0f 100644 --- a/arch/mips/sibyte/swarm/setup.c +++ b/arch/mips/sibyte/swarm/setup.c | |||
@@ -106,7 +106,7 @@ void read_persistent_clock(struct timespec *ts) | |||
106 | break; | 106 | break; |
107 | } | 107 | } |
108 | ts->tv_sec = sec; | 108 | ts->tv_sec = sec; |
109 | tv->tv_nsec = 0; | 109 | ts->tv_nsec = 0; |
110 | } | 110 | } |
111 | 111 | ||
112 | int rtc_mips_set_time(unsigned long sec) | 112 | int rtc_mips_set_time(unsigned long sec) |
diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h index 8a3a4dd55763..167e10ff06d9 100644 --- a/arch/mn10300/include/asm/uaccess.h +++ b/arch/mn10300/include/asm/uaccess.h | |||
@@ -129,42 +129,47 @@ extern int fixup_exception(struct pt_regs *regs); | |||
129 | struct __large_struct { unsigned long buf[100]; }; | 129 | struct __large_struct { unsigned long buf[100]; }; |
130 | #define __m(x) (*(struct __large_struct *)(x)) | 130 | #define __m(x) (*(struct __large_struct *)(x)) |
131 | 131 | ||
132 | #define __get_user_nocheck(x, ptr, size) \ | 132 | #define __get_user_nocheck(x, ptr, size) \ |
133 | ({ \ | 133 | ({ \ |
134 | __typeof(*(ptr)) __gu_val; \ | 134 | unsigned long __gu_addr; \ |
135 | unsigned long __gu_addr; \ | 135 | int __gu_err; \ |
136 | int __gu_err; \ | 136 | __gu_addr = (unsigned long) (ptr); \ |
137 | __gu_addr = (unsigned long) (ptr); \ | 137 | switch (size) { \ |
138 | switch (size) { \ | 138 | case 1: { \ |
139 | case 1: __get_user_asm("bu"); break; \ | 139 | unsigned char __gu_val; \ |
140 | case 2: __get_user_asm("hu"); break; \ | 140 | __get_user_asm("bu"); \ |
141 | case 4: __get_user_asm("" ); break; \ | 141 | (x) = *(__force __typeof__(*(ptr))*) &__gu_val; \ |
142 | default: __get_user_unknown(); break; \ | 142 | break; \ |
143 | } \ | 143 | } \ |
144 | x = (__typeof__(*(ptr))) __gu_val; \ | 144 | case 2: { \ |
145 | __gu_err; \ | 145 | unsigned short __gu_val; \ |
146 | __get_user_asm("hu"); \ | ||
147 | (x) = *(__force __typeof__(*(ptr))*) &__gu_val; \ | ||
148 | break; \ | ||
149 | } \ | ||
150 | case 4: { \ | ||
151 | unsigned int __gu_val; \ | ||
152 | __get_user_asm(""); \ | ||
153 | (x) = *(__force __typeof__(*(ptr))*) &__gu_val; \ | ||
154 | break; \ | ||
155 | } \ | ||
156 | default: \ | ||
157 | __get_user_unknown(); \ | ||
158 | break; \ | ||
159 | } \ | ||
160 | __gu_err; \ | ||
146 | }) | 161 | }) |
147 | 162 | ||
148 | #define __get_user_check(x, ptr, size) \ | 163 | #define __get_user_check(x, ptr, size) \ |
149 | ({ \ | 164 | ({ \ |
150 | __typeof__(*(ptr)) __gu_val; \ | 165 | int _e; \ |
151 | unsigned long __gu_addr; \ | 166 | if (likely(__access_ok((unsigned long) (ptr), (size)))) \ |
152 | int __gu_err; \ | 167 | _e = __get_user_nocheck((x), (ptr), (size)); \ |
153 | __gu_addr = (unsigned long) (ptr); \ | 168 | else { \ |
154 | if (likely(__access_ok(__gu_addr,size))) { \ | 169 | _e = -EFAULT; \ |
155 | switch (size) { \ | 170 | (x) = (__typeof__(x))0; \ |
156 | case 1: __get_user_asm("bu"); break; \ | 171 | } \ |
157 | case 2: __get_user_asm("hu"); break; \ | 172 | _e; \ |
158 | case 4: __get_user_asm("" ); break; \ | ||
159 | default: __get_user_unknown(); break; \ | ||
160 | } \ | ||
161 | } \ | ||
162 | else { \ | ||
163 | __gu_err = -EFAULT; \ | ||
164 | __gu_val = 0; \ | ||
165 | } \ | ||
166 | x = (__typeof__(*(ptr))) __gu_val; \ | ||
167 | __gu_err; \ | ||
168 | }) | 173 | }) |
169 | 174 | ||
170 | #define __get_user_asm(INSN) \ | 175 | #define __get_user_asm(INSN) \ |
diff --git a/arch/mn10300/unit-asb2303/include/unit/clock.h b/arch/mn10300/unit-asb2303/include/unit/clock.h index 8b450e920af1..2a0bf79ab968 100644 --- a/arch/mn10300/unit-asb2303/include/unit/clock.h +++ b/arch/mn10300/unit-asb2303/include/unit/clock.h | |||
@@ -20,9 +20,9 @@ extern unsigned long mn10300_ioclk; /* IOCLK (crystal speed) in HZ */ | |||
20 | extern unsigned long mn10300_iobclk; | 20 | extern unsigned long mn10300_iobclk; |
21 | extern unsigned long mn10300_tsc_per_HZ; | 21 | extern unsigned long mn10300_tsc_per_HZ; |
22 | 22 | ||
23 | #define MN10300_IOCLK ((unsigned long)mn10300_ioclk) | 23 | #define MN10300_IOCLK mn10300_ioclk |
24 | /* If this processors has a another clock, uncomment the below. */ | 24 | /* If this processors has a another clock, uncomment the below. */ |
25 | /* #define MN10300_IOBCLK ((unsigned long)mn10300_iobclk) */ | 25 | /* #define MN10300_IOBCLK mn10300_iobclk */ |
26 | 26 | ||
27 | #else /* !CONFIG_MN10300_RTC */ | 27 | #else /* !CONFIG_MN10300_RTC */ |
28 | 28 | ||
@@ -35,7 +35,7 @@ extern unsigned long mn10300_tsc_per_HZ; | |||
35 | #define MN10300_TSCCLK MN10300_IOCLK | 35 | #define MN10300_TSCCLK MN10300_IOCLK |
36 | 36 | ||
37 | #ifdef CONFIG_MN10300_RTC | 37 | #ifdef CONFIG_MN10300_RTC |
38 | #define MN10300_TSC_PER_HZ ((unsigned long)mn10300_tsc_per_HZ) | 38 | #define MN10300_TSC_PER_HZ mn10300_tsc_per_HZ |
39 | #else /* !CONFIG_MN10300_RTC */ | 39 | #else /* !CONFIG_MN10300_RTC */ |
40 | #define MN10300_TSC_PER_HZ (MN10300_TSCCLK/HZ) | 40 | #define MN10300_TSC_PER_HZ (MN10300_TSCCLK/HZ) |
41 | #endif /* !CONFIG_MN10300_RTC */ | 41 | #endif /* !CONFIG_MN10300_RTC */ |
diff --git a/arch/mn10300/unit-asb2305/include/unit/clock.h b/arch/mn10300/unit-asb2305/include/unit/clock.h index 7d514841ffda..67be3f2eb18e 100644 --- a/arch/mn10300/unit-asb2305/include/unit/clock.h +++ b/arch/mn10300/unit-asb2305/include/unit/clock.h | |||
@@ -20,9 +20,9 @@ extern unsigned long mn10300_ioclk; /* IOCLK (crystal speed) in HZ */ | |||
20 | extern unsigned long mn10300_iobclk; | 20 | extern unsigned long mn10300_iobclk; |
21 | extern unsigned long mn10300_tsc_per_HZ; | 21 | extern unsigned long mn10300_tsc_per_HZ; |
22 | 22 | ||
23 | #define MN10300_IOCLK ((unsigned long)mn10300_ioclk) | 23 | #define MN10300_IOCLK mn10300_ioclk |
24 | /* If this processors has a another clock, uncomment the below. */ | 24 | /* If this processors has a another clock, uncomment the below. */ |
25 | /* #define MN10300_IOBCLK ((unsigned long)mn10300_iobclk) */ | 25 | /* #define MN10300_IOBCLK mn10300_iobclk */ |
26 | 26 | ||
27 | #else /* !CONFIG_MN10300_RTC */ | 27 | #else /* !CONFIG_MN10300_RTC */ |
28 | 28 | ||
@@ -35,7 +35,7 @@ extern unsigned long mn10300_tsc_per_HZ; | |||
35 | #define MN10300_TSCCLK MN10300_IOCLK | 35 | #define MN10300_TSCCLK MN10300_IOCLK |
36 | 36 | ||
37 | #ifdef CONFIG_MN10300_RTC | 37 | #ifdef CONFIG_MN10300_RTC |
38 | #define MN10300_TSC_PER_HZ ((unsigned long)mn10300_tsc_per_HZ) | 38 | #define MN10300_TSC_PER_HZ mn10300_tsc_per_HZ |
39 | #else /* !CONFIG_MN10300_RTC */ | 39 | #else /* !CONFIG_MN10300_RTC */ |
40 | #define MN10300_TSC_PER_HZ (MN10300_TSCCLK/HZ) | 40 | #define MN10300_TSC_PER_HZ (MN10300_TSCCLK/HZ) |
41 | #endif /* !CONFIG_MN10300_RTC */ | 41 | #endif /* !CONFIG_MN10300_RTC */ |
diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c index 47ee603f558e..2aa371e30079 100644 --- a/arch/powerpc/kvm/timing.c +++ b/arch/powerpc/kvm/timing.c | |||
@@ -201,7 +201,7 @@ static int kvmppc_exit_timing_open(struct inode *inode, struct file *file) | |||
201 | return single_open(file, kvmppc_exit_timing_show, inode->i_private); | 201 | return single_open(file, kvmppc_exit_timing_show, inode->i_private); |
202 | } | 202 | } |
203 | 203 | ||
204 | static struct file_operations kvmppc_exit_timing_fops = { | 204 | static const struct file_operations kvmppc_exit_timing_fops = { |
205 | .owner = THIS_MODULE, | 205 | .owner = THIS_MODULE, |
206 | .open = kvmppc_exit_timing_open, | 206 | .open = kvmppc_exit_timing_open, |
207 | .read = seq_read, | 207 | .read = seq_read, |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 8f079b865ad0..884e8bcec499 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -147,7 +147,7 @@ static int __fops ## _open(struct inode *inode, struct file *file) \ | |||
147 | __simple_attr_check_format(__fmt, 0ull); \ | 147 | __simple_attr_check_format(__fmt, 0ull); \ |
148 | return spufs_attr_open(inode, file, __get, __set, __fmt); \ | 148 | return spufs_attr_open(inode, file, __get, __set, __fmt); \ |
149 | } \ | 149 | } \ |
150 | static struct file_operations __fops = { \ | 150 | static const struct file_operations __fops = { \ |
151 | .owner = THIS_MODULE, \ | 151 | .owner = THIS_MODULE, \ |
152 | .open = __fops ## _open, \ | 152 | .open = __fops ## _open, \ |
153 | .release = spufs_attr_release, \ | 153 | .release = spufs_attr_release, \ |
@@ -309,7 +309,7 @@ static int spufs_mem_mmap_access(struct vm_area_struct *vma, | |||
309 | return len; | 309 | return len; |
310 | } | 310 | } |
311 | 311 | ||
312 | static struct vm_operations_struct spufs_mem_mmap_vmops = { | 312 | static const struct vm_operations_struct spufs_mem_mmap_vmops = { |
313 | .fault = spufs_mem_mmap_fault, | 313 | .fault = spufs_mem_mmap_fault, |
314 | .access = spufs_mem_mmap_access, | 314 | .access = spufs_mem_mmap_access, |
315 | }; | 315 | }; |
@@ -436,7 +436,7 @@ static int spufs_cntl_mmap_fault(struct vm_area_struct *vma, | |||
436 | return spufs_ps_fault(vma, vmf, 0x4000, SPUFS_CNTL_MAP_SIZE); | 436 | return spufs_ps_fault(vma, vmf, 0x4000, SPUFS_CNTL_MAP_SIZE); |
437 | } | 437 | } |
438 | 438 | ||
439 | static struct vm_operations_struct spufs_cntl_mmap_vmops = { | 439 | static const struct vm_operations_struct spufs_cntl_mmap_vmops = { |
440 | .fault = spufs_cntl_mmap_fault, | 440 | .fault = spufs_cntl_mmap_fault, |
441 | }; | 441 | }; |
442 | 442 | ||
@@ -1143,7 +1143,7 @@ spufs_signal1_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1143 | #endif | 1143 | #endif |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | static struct vm_operations_struct spufs_signal1_mmap_vmops = { | 1146 | static const struct vm_operations_struct spufs_signal1_mmap_vmops = { |
1147 | .fault = spufs_signal1_mmap_fault, | 1147 | .fault = spufs_signal1_mmap_fault, |
1148 | }; | 1148 | }; |
1149 | 1149 | ||
@@ -1279,7 +1279,7 @@ spufs_signal2_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1279 | #endif | 1279 | #endif |
1280 | } | 1280 | } |
1281 | 1281 | ||
1282 | static struct vm_operations_struct spufs_signal2_mmap_vmops = { | 1282 | static const struct vm_operations_struct spufs_signal2_mmap_vmops = { |
1283 | .fault = spufs_signal2_mmap_fault, | 1283 | .fault = spufs_signal2_mmap_fault, |
1284 | }; | 1284 | }; |
1285 | 1285 | ||
@@ -1397,7 +1397,7 @@ spufs_mss_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1397 | return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_MSS_MAP_SIZE); | 1397 | return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_MSS_MAP_SIZE); |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | static struct vm_operations_struct spufs_mss_mmap_vmops = { | 1400 | static const struct vm_operations_struct spufs_mss_mmap_vmops = { |
1401 | .fault = spufs_mss_mmap_fault, | 1401 | .fault = spufs_mss_mmap_fault, |
1402 | }; | 1402 | }; |
1403 | 1403 | ||
@@ -1458,7 +1458,7 @@ spufs_psmap_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1458 | return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_PS_MAP_SIZE); | 1458 | return spufs_ps_fault(vma, vmf, 0x0000, SPUFS_PS_MAP_SIZE); |
1459 | } | 1459 | } |
1460 | 1460 | ||
1461 | static struct vm_operations_struct spufs_psmap_mmap_vmops = { | 1461 | static const struct vm_operations_struct spufs_psmap_mmap_vmops = { |
1462 | .fault = spufs_psmap_mmap_fault, | 1462 | .fault = spufs_psmap_mmap_fault, |
1463 | }; | 1463 | }; |
1464 | 1464 | ||
@@ -1517,7 +1517,7 @@ spufs_mfc_mmap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
1517 | return spufs_ps_fault(vma, vmf, 0x3000, SPUFS_MFC_MAP_SIZE); | 1517 | return spufs_ps_fault(vma, vmf, 0x3000, SPUFS_MFC_MAP_SIZE); |
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | static struct vm_operations_struct spufs_mfc_mmap_vmops = { | 1520 | static const struct vm_operations_struct spufs_mfc_mmap_vmops = { |
1521 | .fault = spufs_mfc_mmap_fault, | 1521 | .fault = spufs_mfc_mmap_fault, |
1522 | }; | 1522 | }; |
1523 | 1523 | ||
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c index ab69925d579b..937a544a236d 100644 --- a/arch/powerpc/platforms/pseries/dtl.c +++ b/arch/powerpc/platforms/pseries/dtl.c | |||
@@ -209,7 +209,7 @@ static ssize_t dtl_file_read(struct file *filp, char __user *buf, size_t len, | |||
209 | return n_read * sizeof(struct dtl_entry); | 209 | return n_read * sizeof(struct dtl_entry); |
210 | } | 210 | } |
211 | 211 | ||
212 | static struct file_operations dtl_fops = { | 212 | static const struct file_operations dtl_fops = { |
213 | .open = dtl_file_open, | 213 | .open = dtl_file_open, |
214 | .release = dtl_file_release, | 214 | .release = dtl_file_release, |
215 | .read = dtl_file_read, | 215 | .read = dtl_file_read, |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 97fca4695e0b..ac45aab741a5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -102,6 +102,9 @@ config HAVE_SETUP_PER_CPU_AREA | |||
102 | config NEED_PER_CPU_EMBED_FIRST_CHUNK | 102 | config NEED_PER_CPU_EMBED_FIRST_CHUNK |
103 | def_bool y if SPARC64 | 103 | def_bool y if SPARC64 |
104 | 104 | ||
105 | config NEED_PER_CPU_PAGE_FIRST_CHUNK | ||
106 | def_bool y if SPARC64 | ||
107 | |||
105 | config GENERIC_HARDIRQS_NO__DO_IRQ | 108 | config GENERIC_HARDIRQS_NO__DO_IRQ |
106 | bool | 109 | bool |
107 | def_bool y if SPARC64 | 110 | def_bool y if SPARC64 |
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index ff68373ce6d6..aa36223497b9 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
@@ -1420,7 +1420,7 @@ static void __init pcpu_free_bootmem(void *ptr, size_t size) | |||
1420 | free_bootmem(__pa(ptr), size); | 1420 | free_bootmem(__pa(ptr), size); |
1421 | } | 1421 | } |
1422 | 1422 | ||
1423 | static int pcpu_cpu_distance(unsigned int from, unsigned int to) | 1423 | static int __init pcpu_cpu_distance(unsigned int from, unsigned int to) |
1424 | { | 1424 | { |
1425 | if (cpu_to_node(from) == cpu_to_node(to)) | 1425 | if (cpu_to_node(from) == cpu_to_node(to)) |
1426 | return LOCAL_DISTANCE; | 1426 | return LOCAL_DISTANCE; |
@@ -1428,18 +1428,53 @@ static int pcpu_cpu_distance(unsigned int from, unsigned int to) | |||
1428 | return REMOTE_DISTANCE; | 1428 | return REMOTE_DISTANCE; |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | static void __init pcpu_populate_pte(unsigned long addr) | ||
1432 | { | ||
1433 | pgd_t *pgd = pgd_offset_k(addr); | ||
1434 | pud_t *pud; | ||
1435 | pmd_t *pmd; | ||
1436 | |||
1437 | pud = pud_offset(pgd, addr); | ||
1438 | if (pud_none(*pud)) { | ||
1439 | pmd_t *new; | ||
1440 | |||
1441 | new = __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE); | ||
1442 | pud_populate(&init_mm, pud, new); | ||
1443 | } | ||
1444 | |||
1445 | pmd = pmd_offset(pud, addr); | ||
1446 | if (!pmd_present(*pmd)) { | ||
1447 | pte_t *new; | ||
1448 | |||
1449 | new = __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE); | ||
1450 | pmd_populate_kernel(&init_mm, pmd, new); | ||
1451 | } | ||
1452 | } | ||
1453 | |||
1431 | void __init setup_per_cpu_areas(void) | 1454 | void __init setup_per_cpu_areas(void) |
1432 | { | 1455 | { |
1433 | unsigned long delta; | 1456 | unsigned long delta; |
1434 | unsigned int cpu; | 1457 | unsigned int cpu; |
1435 | int rc; | 1458 | int rc = -EINVAL; |
1436 | 1459 | ||
1437 | rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE, | 1460 | if (pcpu_chosen_fc != PCPU_FC_PAGE) { |
1438 | PERCPU_DYNAMIC_RESERVE, 4 << 20, | 1461 | rc = pcpu_embed_first_chunk(PERCPU_MODULE_RESERVE, |
1439 | pcpu_cpu_distance, pcpu_alloc_bootmem, | 1462 | PERCPU_DYNAMIC_RESERVE, 4 << 20, |
1440 | pcpu_free_bootmem); | 1463 | pcpu_cpu_distance, |
1441 | if (rc) | 1464 | pcpu_alloc_bootmem, |
1442 | panic("failed to initialize first chunk (%d)", rc); | 1465 | pcpu_free_bootmem); |
1466 | if (rc) | ||
1467 | pr_warning("PERCPU: %s allocator failed (%d), " | ||
1468 | "falling back to page size\n", | ||
1469 | pcpu_fc_names[pcpu_chosen_fc], rc); | ||
1470 | } | ||
1471 | if (rc < 0) | ||
1472 | rc = pcpu_page_first_chunk(PERCPU_MODULE_RESERVE, | ||
1473 | pcpu_alloc_bootmem, | ||
1474 | pcpu_free_bootmem, | ||
1475 | pcpu_populate_pte); | ||
1476 | if (rc < 0) | ||
1477 | panic("cannot initialize percpu area (err=%d)", rc); | ||
1443 | 1478 | ||
1444 | delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start; | 1479 | delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start; |
1445 | for_each_possible_cpu(cpu) | 1480 | for_each_possible_cpu(cpu) |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 93698794aa3a..8da93745c087 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -432,6 +432,17 @@ config X86_NUMAQ | |||
432 | of Flat Logical. You will need a new lynxer.elf file to flash your | 432 | of Flat Logical. You will need a new lynxer.elf file to flash your |
433 | firmware with - send email to <Martin.Bligh@us.ibm.com>. | 433 | firmware with - send email to <Martin.Bligh@us.ibm.com>. |
434 | 434 | ||
435 | config X86_SUPPORTS_MEMORY_FAILURE | ||
436 | bool | ||
437 | # MCE code calls memory_failure(): | ||
438 | depends on X86_MCE | ||
439 | # On 32-bit this adds too big of NODES_SHIFT and we run out of page flags: | ||
440 | depends on !X86_NUMAQ | ||
441 | # On 32-bit SPARSEMEM adds too big of SECTIONS_WIDTH: | ||
442 | depends on X86_64 || !SPARSEMEM | ||
443 | select ARCH_SUPPORTS_MEMORY_FAILURE | ||
444 | default y | ||
445 | |||
435 | config X86_VISWS | 446 | config X86_VISWS |
436 | bool "SGI 320/540 (Visual Workstation)" | 447 | bool "SGI 320/540 (Visual Workstation)" |
437 | depends on X86_32 && PCI && X86_MPPARSE && PCI_GODIRECT | 448 | depends on X86_32 && PCI && X86_MPPARSE && PCI_GODIRECT |
diff --git a/arch/x86/include/asm/checksum_32.h b/arch/x86/include/asm/checksum_32.h index 7c5ef8b14d92..46fc474fd819 100644 --- a/arch/x86/include/asm/checksum_32.h +++ b/arch/x86/include/asm/checksum_32.h | |||
@@ -161,7 +161,8 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
161 | "adcl $0, %0 ;\n" | 161 | "adcl $0, %0 ;\n" |
162 | : "=&r" (sum) | 162 | : "=&r" (sum) |
163 | : "r" (saddr), "r" (daddr), | 163 | : "r" (saddr), "r" (daddr), |
164 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum)); | 164 | "r" (htonl(len)), "r" (htonl(proto)), "0" (sum) |
165 | : "memory"); | ||
165 | 166 | ||
166 | return csum_fold(sum); | 167 | return csum_fold(sum); |
167 | } | 168 | } |
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h index 82ceb788a981..ee1931be6593 100644 --- a/arch/x86/include/asm/cmpxchg_32.h +++ b/arch/x86/include/asm/cmpxchg_32.h | |||
@@ -312,19 +312,23 @@ static inline unsigned long cmpxchg_386(volatile void *ptr, unsigned long old, | |||
312 | 312 | ||
313 | extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64); | 313 | extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64); |
314 | 314 | ||
315 | #define cmpxchg64(ptr, o, n) \ | 315 | #define cmpxchg64(ptr, o, n) \ |
316 | ({ \ | 316 | ({ \ |
317 | __typeof__(*(ptr)) __ret; \ | 317 | __typeof__(*(ptr)) __ret; \ |
318 | if (likely(boot_cpu_data.x86 > 4)) \ | 318 | __typeof__(*(ptr)) __old = (o); \ |
319 | __ret = (__typeof__(*(ptr)))__cmpxchg64((ptr), \ | 319 | __typeof__(*(ptr)) __new = (n); \ |
320 | (unsigned long long)(o), \ | 320 | alternative_io("call cmpxchg8b_emu", \ |
321 | (unsigned long long)(n)); \ | 321 | "lock; cmpxchg8b (%%esi)" , \ |
322 | else \ | 322 | X86_FEATURE_CX8, \ |
323 | __ret = (__typeof__(*(ptr)))cmpxchg_486_u64((ptr), \ | 323 | "=A" (__ret), \ |
324 | (unsigned long long)(o), \ | 324 | "S" ((ptr)), "0" (__old), \ |
325 | (unsigned long long)(n)); \ | 325 | "b" ((unsigned int)__new), \ |
326 | __ret; \ | 326 | "c" ((unsigned int)(__new>>32)) \ |
327 | }) | 327 | : "memory"); \ |
328 | __ret; }) | ||
329 | |||
330 | |||
331 | |||
328 | #define cmpxchg64_local(ptr, o, n) \ | 332 | #define cmpxchg64_local(ptr, o, n) \ |
329 | ({ \ | 333 | ({ \ |
330 | __typeof__(*(ptr)) __ret; \ | 334 | __typeof__(*(ptr)) __ret; \ |
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 8c44c232efcb..59cdfa4686b2 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
@@ -48,7 +48,7 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, | |||
48 | * P4, Core and beyond CPUs | 48 | * P4, Core and beyond CPUs |
49 | */ | 49 | */ |
50 | if (c->x86_vendor == X86_VENDOR_INTEL && | 50 | if (c->x86_vendor == X86_VENDOR_INTEL && |
51 | (c->x86 > 0x6 || (c->x86 == 6 && c->x86_model >= 14))) | 51 | (c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 14))) |
52 | flags->bm_control = 0; | 52 | flags->bm_control = 0; |
53 | } | 53 | } |
54 | EXPORT_SYMBOL(acpi_processor_power_init_bm_check); | 54 | EXPORT_SYMBOL(acpi_processor_power_init_bm_check); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 4b2af86e3e8d..183c3457d2f4 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -204,10 +204,7 @@ static void print_mce_head(void) | |||
204 | static void print_mce_tail(void) | 204 | static void print_mce_tail(void) |
205 | { | 205 | { |
206 | printk(KERN_EMERG "This is not a software problem!\n" | 206 | printk(KERN_EMERG "This is not a software problem!\n" |
207 | #if (!defined(CONFIG_EDAC) || !defined(CONFIG_CPU_SUP_AMD)) | 207 | "Run through mcelog --ascii to decode and contact your hardware vendor\n"); |
208 | "Run through mcelog --ascii to decode and contact your hardware vendor\n" | ||
209 | #endif | ||
210 | ); | ||
211 | } | 208 | } |
212 | 209 | ||
213 | #define PANIC_TIMEOUT 5 /* 5 seconds */ | 210 | #define PANIC_TIMEOUT 5 /* 5 seconds */ |
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c index 43cec6bdda63..1736c5a725aa 100644 --- a/arch/x86/kernel/i386_ksyms_32.c +++ b/arch/x86/kernel/i386_ksyms_32.c | |||
@@ -10,6 +10,14 @@ | |||
10 | EXPORT_SYMBOL(mcount); | 10 | EXPORT_SYMBOL(mcount); |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | /* | ||
14 | * Note, this is a prototype to get at the symbol for | ||
15 | * the export, but dont use it from C code, it is used | ||
16 | * by assembly code and is not using C calling convention! | ||
17 | */ | ||
18 | extern void cmpxchg8b_emu(void); | ||
19 | EXPORT_SYMBOL(cmpxchg8b_emu); | ||
20 | |||
13 | /* Networking helper routines. */ | 21 | /* Networking helper routines. */ |
14 | EXPORT_SYMBOL(csum_partial_copy_generic); | 22 | EXPORT_SYMBOL(csum_partial_copy_generic); |
15 | 23 | ||
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 9e609206fac9..3e549b8ec8c9 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile | |||
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_X86_32),y) | |||
15 | obj-y += atomic64_32.o | 15 | obj-y += atomic64_32.o |
16 | lib-y += checksum_32.o | 16 | lib-y += checksum_32.o |
17 | lib-y += strstr_32.o | 17 | lib-y += strstr_32.o |
18 | lib-y += semaphore_32.o string_32.o | 18 | lib-y += semaphore_32.o string_32.o cmpxchg8b_emu.o |
19 | 19 | ||
20 | lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o | 20 | lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o |
21 | else | 21 | else |
diff --git a/arch/x86/lib/cmpxchg8b_emu.S b/arch/x86/lib/cmpxchg8b_emu.S new file mode 100644 index 000000000000..828cb710dec2 --- /dev/null +++ b/arch/x86/lib/cmpxchg8b_emu.S | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or | ||
3 | * modify it under the terms of the GNU General Public License | ||
4 | * as published by the Free Software Foundation; version 2 | ||
5 | * of the License. | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #include <linux/linkage.h> | ||
10 | #include <asm/alternative-asm.h> | ||
11 | #include <asm/frame.h> | ||
12 | #include <asm/dwarf2.h> | ||
13 | |||
14 | |||
15 | .text | ||
16 | |||
17 | /* | ||
18 | * Inputs: | ||
19 | * %esi : memory location to compare | ||
20 | * %eax : low 32 bits of old value | ||
21 | * %edx : high 32 bits of old value | ||
22 | * %ebx : low 32 bits of new value | ||
23 | * %ecx : high 32 bits of new value | ||
24 | */ | ||
25 | ENTRY(cmpxchg8b_emu) | ||
26 | CFI_STARTPROC | ||
27 | |||
28 | # | ||
29 | # Emulate 'cmpxchg8b (%esi)' on UP except we don't | ||
30 | # set the whole ZF thing (caller will just compare | ||
31 | # eax:edx with the expected value) | ||
32 | # | ||
33 | cmpxchg8b_emu: | ||
34 | pushfl | ||
35 | cli | ||
36 | |||
37 | cmpl (%esi), %eax | ||
38 | jne not_same | ||
39 | cmpl 4(%esi), %edx | ||
40 | jne half_same | ||
41 | |||
42 | movl %ebx, (%esi) | ||
43 | movl %ecx, 4(%esi) | ||
44 | |||
45 | popfl | ||
46 | ret | ||
47 | |||
48 | not_same: | ||
49 | movl (%esi), %eax | ||
50 | half_same: | ||
51 | movl 4(%esi), %edx | ||
52 | |||
53 | popfl | ||
54 | ret | ||
55 | |||
56 | CFI_ENDPROC | ||
57 | ENDPROC(cmpxchg8b_emu) | ||
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 52e62e57fedd..b22d13b0c71d 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -266,7 +266,7 @@ void pcibios_set_master(struct pci_dev *dev) | |||
266 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); | 266 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); |
267 | } | 267 | } |
268 | 268 | ||
269 | static struct vm_operations_struct pci_mmap_ops = { | 269 | static const struct vm_operations_struct pci_mmap_ops = { |
270 | .access = generic_access_phys, | 270 | .access = generic_access_phys, |
271 | }; | 271 | }; |
272 | 272 | ||
diff --git a/arch/x86/xen/debugfs.c b/arch/x86/xen/debugfs.c index b53225d2cac3..e133ce25e290 100644 --- a/arch/x86/xen/debugfs.c +++ b/arch/x86/xen/debugfs.c | |||
@@ -100,7 +100,7 @@ static int xen_array_release(struct inode *inode, struct file *file) | |||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
102 | 102 | ||
103 | static struct file_operations u32_array_fops = { | 103 | static const struct file_operations u32_array_fops = { |
104 | .owner = THIS_MODULE, | 104 | .owner = THIS_MODULE, |
105 | .open = u32_array_open, | 105 | .open = u32_array_open, |
106 | .release= xen_array_release, | 106 | .release= xen_array_release, |