diff options
Diffstat (limited to 'arch')
50 files changed, 305 insertions, 235 deletions
diff --git a/arch/arm/mach-clps711x/include/mach/debug-macro.S b/arch/arm/mach-clps711x/include/mach/debug-macro.S index fedd8076a689..072cc6b61ba3 100644 --- a/arch/arm/mach-clps711x/include/mach/debug-macro.S +++ b/arch/arm/mach-clps711x/include/mach/debug-macro.S | |||
@@ -11,6 +11,7 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <mach/hardware.h> | ||
14 | #include <asm/hardware/clps7111.h> | 15 | #include <asm/hardware/clps7111.h> |
15 | 16 | ||
16 | .macro addruart, rx, tmp | 17 | .macro addruart, rx, tmp |
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c index e3bc3f6f6b10..88b3dd89be89 100644 --- a/arch/arm/mach-footbridge/common.c +++ b/arch/arm/mach-footbridge/common.c | |||
@@ -232,7 +232,7 @@ EXPORT_SYMBOL(__bus_to_virt); | |||
232 | 232 | ||
233 | unsigned long __pfn_to_bus(unsigned long pfn) | 233 | unsigned long __pfn_to_bus(unsigned long pfn) |
234 | { | 234 | { |
235 | return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET)); | 235 | return __pfn_to_phys(pfn) + (fb_bus_sdram_offset() - PHYS_OFFSET); |
236 | } | 236 | } |
237 | EXPORT_SYMBOL(__pfn_to_bus); | 237 | EXPORT_SYMBOL(__pfn_to_bus); |
238 | 238 | ||
diff --git a/arch/arm/mach-h720x/include/mach/debug-macro.S b/arch/arm/mach-h720x/include/mach/debug-macro.S index a9ee8f0d48b7..27cafd12f033 100644 --- a/arch/arm/mach-h720x/include/mach/debug-macro.S +++ b/arch/arm/mach-h720x/include/mach/debug-macro.S | |||
@@ -11,8 +11,10 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | .equ io_virt, IO_BASE | 14 | #include <mach/hardware.h> |
15 | .equ io_phys, IO_START | 15 | |
16 | .equ io_virt, IO_VIRT | ||
17 | .equ io_phys, IO_PHYS | ||
16 | 18 | ||
17 | .macro addruart, rx, tmp | 19 | .macro addruart, rx, tmp |
18 | mrc p15, 0, \rx, c1, c0 | 20 | mrc p15, 0, \rx, c1, c0 |
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.c b/arch/arm/mach-kirkwood/tsx1x-common.c index 7221c20b2afa..f781164e623f 100644 --- a/arch/arm/mach-kirkwood/tsx1x-common.c +++ b/arch/arm/mach-kirkwood/tsx1x-common.c | |||
@@ -77,7 +77,7 @@ struct spi_board_info __initdata qnap_tsx1x_spi_slave_info[] = { | |||
77 | }, | 77 | }, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | void qnap_tsx1x_register_flash(void) | 80 | void __init qnap_tsx1x_register_flash(void) |
81 | { | 81 | { |
82 | spi_register_board_info(qnap_tsx1x_spi_slave_info, | 82 | spi_register_board_info(qnap_tsx1x_spi_slave_info, |
83 | ARRAY_SIZE(qnap_tsx1x_spi_slave_info)); | 83 | ARRAY_SIZE(qnap_tsx1x_spi_slave_info)); |
diff --git a/arch/arm/mach-kirkwood/tsx1x-common.h b/arch/arm/mach-kirkwood/tsx1x-common.h index 9a592962a6ea..7fa037361b55 100644 --- a/arch/arm/mach-kirkwood/tsx1x-common.h +++ b/arch/arm/mach-kirkwood/tsx1x-common.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H | 1 | #ifndef __ARCH_KIRKWOOD_TSX1X_COMMON_H |
2 | #define __ARCH_KIRKWOOD_TSX1X_COMMON_H | 2 | #define __ARCH_KIRKWOOD_TSX1X_COMMON_H |
3 | 3 | ||
4 | extern void qnap_tsx1x_register_flash(void); | 4 | extern void __init qnap_tsx1x_register_flash(void); |
5 | extern void qnap_tsx1x_power_off(void); | 5 | extern void qnap_tsx1x_power_off(void); |
6 | 6 | ||
7 | #endif | 7 | #endif |
diff --git a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S index 0859336a8e6d..5c934bdb7158 100644 --- a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S +++ b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S | |||
@@ -8,6 +8,7 @@ | |||
8 | * the Free Software Foundation. | 8 | * the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <mach/hardware.h> | 10 | #include <mach/hardware.h> |
11 | #include <asm/memory.h> | ||
11 | 12 | ||
12 | #include <mach/regs-board-a9m9750dev.h> | 13 | #include <mach/regs-board-a9m9750dev.h> |
13 | 14 | ||
diff --git a/arch/arm/mach-ns9xxx/include/mach/uncompress.h b/arch/arm/mach-ns9xxx/include/mach/uncompress.h index 1b12d324b087..770a68c46e81 100644 --- a/arch/arm/mach-ns9xxx/include/mach/uncompress.h +++ b/arch/arm/mach-ns9xxx/include/mach/uncompress.h | |||
@@ -20,50 +20,49 @@ static void putc_dummy(char c, void __iomem *base) | |||
20 | /* nothing */ | 20 | /* nothing */ |
21 | } | 21 | } |
22 | 22 | ||
23 | static int timeout; | ||
24 | |||
23 | static void putc_ns9360(char c, void __iomem *base) | 25 | static void putc_ns9360(char c, void __iomem *base) |
24 | { | 26 | { |
25 | static int t = 0x10000; | ||
26 | do { | 27 | do { |
27 | if (t) | 28 | if (timeout) |
28 | --t; | 29 | --timeout; |
29 | 30 | ||
30 | if (__raw_readl(base + 8) & (1 << 3)) { | 31 | if (__raw_readl(base + 8) & (1 << 3)) { |
31 | __raw_writeb(c, base + 16); | 32 | __raw_writeb(c, base + 16); |
32 | t = 0x10000; | 33 | timeout = 0x10000; |
33 | break; | 34 | break; |
34 | } | 35 | } |
35 | } while (t); | 36 | } while (timeout); |
36 | } | 37 | } |
37 | 38 | ||
38 | static void putc_a9m9750dev(char c, void __iomem *base) | 39 | static void putc_a9m9750dev(char c, void __iomem *base) |
39 | { | 40 | { |
40 | static int t = 0x10000; | ||
41 | do { | 41 | do { |
42 | if (t) | 42 | if (timeout) |
43 | --t; | 43 | --timeout; |
44 | 44 | ||
45 | if (__raw_readb(base + 5) & (1 << 5)) { | 45 | if (__raw_readb(base + 5) & (1 << 5)) { |
46 | __raw_writeb(c, base); | 46 | __raw_writeb(c, base); |
47 | t = 0x10000; | 47 | timeout = 0x10000; |
48 | break; | 48 | break; |
49 | } | 49 | } |
50 | } while (t); | 50 | } while (timeout); |
51 | 51 | ||
52 | } | 52 | } |
53 | 53 | ||
54 | static void putc_ns921x(char c, void __iomem *base) | 54 | static void putc_ns921x(char c, void __iomem *base) |
55 | { | 55 | { |
56 | static int t = 0x10000; | ||
57 | do { | 56 | do { |
58 | if (t) | 57 | if (timeout) |
59 | --t; | 58 | --timeout; |
60 | 59 | ||
61 | if (!(__raw_readl(base) & (1 << 11))) { | 60 | if (!(__raw_readl(base) & (1 << 11))) { |
62 | __raw_writeb(c, base + 0x0028); | 61 | __raw_writeb(c, base + 0x0028); |
63 | t = 0x10000; | 62 | timeout = 0x10000; |
64 | break; | 63 | break; |
65 | } | 64 | } |
66 | } while (t); | 65 | } while (timeout); |
67 | } | 66 | } |
68 | 67 | ||
69 | #define MSCS __REG(0xA0900184) | 68 | #define MSCS __REG(0xA0900184) |
@@ -89,6 +88,7 @@ static void putc_ns921x(char c, void __iomem *base) | |||
89 | 88 | ||
90 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) | 89 | static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base) |
91 | { | 90 | { |
91 | timeout = 0x10000; | ||
92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { | 92 | if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) { |
93 | /* ns9360 or ns9750 */ | 93 | /* ns9360 or ns9750 */ |
94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { | 94 | if (NS9360_UART_ENABLED(NS9360_UARTA)) { |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index abdf321c2d41..03483920ed6e 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -175,6 +175,10 @@ static void __init rx51_add_gpio_keys(void) | |||
175 | #endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */ | 175 | #endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */ |
176 | 176 | ||
177 | static int board_keymap[] = { | 177 | static int board_keymap[] = { |
178 | /* | ||
179 | * Note that KEY(x, 8, KEY_XXX) entries represent "entrire row | ||
180 | * connected to the ground" matrix state. | ||
181 | */ | ||
178 | KEY(0, 0, KEY_Q), | 182 | KEY(0, 0, KEY_Q), |
179 | KEY(0, 1, KEY_O), | 183 | KEY(0, 1, KEY_O), |
180 | KEY(0, 2, KEY_P), | 184 | KEY(0, 2, KEY_P), |
@@ -182,6 +186,7 @@ static int board_keymap[] = { | |||
182 | KEY(0, 4, KEY_BACKSPACE), | 186 | KEY(0, 4, KEY_BACKSPACE), |
183 | KEY(0, 6, KEY_A), | 187 | KEY(0, 6, KEY_A), |
184 | KEY(0, 7, KEY_S), | 188 | KEY(0, 7, KEY_S), |
189 | |||
185 | KEY(1, 0, KEY_W), | 190 | KEY(1, 0, KEY_W), |
186 | KEY(1, 1, KEY_D), | 191 | KEY(1, 1, KEY_D), |
187 | KEY(1, 2, KEY_F), | 192 | KEY(1, 2, KEY_F), |
@@ -190,6 +195,7 @@ static int board_keymap[] = { | |||
190 | KEY(1, 5, KEY_J), | 195 | KEY(1, 5, KEY_J), |
191 | KEY(1, 6, KEY_K), | 196 | KEY(1, 6, KEY_K), |
192 | KEY(1, 7, KEY_L), | 197 | KEY(1, 7, KEY_L), |
198 | |||
193 | KEY(2, 0, KEY_E), | 199 | KEY(2, 0, KEY_E), |
194 | KEY(2, 1, KEY_DOT), | 200 | KEY(2, 1, KEY_DOT), |
195 | KEY(2, 2, KEY_UP), | 201 | KEY(2, 2, KEY_UP), |
@@ -197,6 +203,8 @@ static int board_keymap[] = { | |||
197 | KEY(2, 5, KEY_Z), | 203 | KEY(2, 5, KEY_Z), |
198 | KEY(2, 6, KEY_X), | 204 | KEY(2, 6, KEY_X), |
199 | KEY(2, 7, KEY_C), | 205 | KEY(2, 7, KEY_C), |
206 | KEY(2, 8, KEY_F9), | ||
207 | |||
200 | KEY(3, 0, KEY_R), | 208 | KEY(3, 0, KEY_R), |
201 | KEY(3, 1, KEY_V), | 209 | KEY(3, 1, KEY_V), |
202 | KEY(3, 2, KEY_B), | 210 | KEY(3, 2, KEY_B), |
@@ -205,20 +213,23 @@ static int board_keymap[] = { | |||
205 | KEY(3, 5, KEY_SPACE), | 213 | KEY(3, 5, KEY_SPACE), |
206 | KEY(3, 6, KEY_SPACE), | 214 | KEY(3, 6, KEY_SPACE), |
207 | KEY(3, 7, KEY_LEFT), | 215 | KEY(3, 7, KEY_LEFT), |
216 | |||
208 | KEY(4, 0, KEY_T), | 217 | KEY(4, 0, KEY_T), |
209 | KEY(4, 1, KEY_DOWN), | 218 | KEY(4, 1, KEY_DOWN), |
210 | KEY(4, 2, KEY_RIGHT), | 219 | KEY(4, 2, KEY_RIGHT), |
211 | KEY(4, 4, KEY_LEFTCTRL), | 220 | KEY(4, 4, KEY_LEFTCTRL), |
212 | KEY(4, 5, KEY_RIGHTALT), | 221 | KEY(4, 5, KEY_RIGHTALT), |
213 | KEY(4, 6, KEY_LEFTSHIFT), | 222 | KEY(4, 6, KEY_LEFTSHIFT), |
223 | KEY(4, 8, KEY_F10), | ||
224 | |||
214 | KEY(5, 0, KEY_Y), | 225 | KEY(5, 0, KEY_Y), |
226 | KEY(5, 8, KEY_F11), | ||
227 | |||
215 | KEY(6, 0, KEY_U), | 228 | KEY(6, 0, KEY_U), |
229 | |||
216 | KEY(7, 0, KEY_I), | 230 | KEY(7, 0, KEY_I), |
217 | KEY(7, 1, KEY_F7), | 231 | KEY(7, 1, KEY_F7), |
218 | KEY(7, 2, KEY_F8), | 232 | KEY(7, 2, KEY_F8), |
219 | KEY(0xff, 2, KEY_F9), | ||
220 | KEY(0xff, 4, KEY_F10), | ||
221 | KEY(0xff, 5, KEY_F11), | ||
222 | }; | 233 | }; |
223 | 234 | ||
224 | static struct matrix_keymap_data board_map_data = { | 235 | static struct matrix_keymap_data board_map_data = { |
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index 45c23fd6df31..40b6ac2de876 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <mach/colibri.h> | 26 | #include <mach/colibri.h> |
27 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
28 | #include <mach/pxafb.h> | 28 | #include <mach/pxafb.h> |
29 | #include <mach/audio.h> | ||
29 | 30 | ||
30 | #include "generic.h" | 31 | #include "generic.h" |
31 | #include "devices.h" | 32 | #include "devices.h" |
@@ -145,7 +146,7 @@ static void __init colibri_pxa300_init_lcd(void) | |||
145 | static inline void colibri_pxa300_init_lcd(void) {} | 146 | static inline void colibri_pxa300_init_lcd(void) {} |
146 | #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ | 147 | #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ |
147 | 148 | ||
148 | #if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE) | 149 | #if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE) |
149 | static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = { | 150 | static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = { |
150 | GPIO24_AC97_SYSCLK, | 151 | GPIO24_AC97_SYSCLK, |
151 | GPIO23_AC97_nACRESET, | 152 | GPIO23_AC97_nACRESET, |
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 3d1dcb9ac08f..51ffa6afb675 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -446,7 +446,7 @@ static struct platform_device corgiled_device = { | |||
446 | static struct pxamci_platform_data corgi_mci_platform_data = { | 446 | static struct pxamci_platform_data corgi_mci_platform_data = { |
447 | .detect_delay_ms = 250, | 447 | .detect_delay_ms = 250, |
448 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | 448 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
449 | .gpio_card_detect = -1, | 449 | .gpio_card_detect = CORGI_GPIO_nSD_DETECT, |
450 | .gpio_card_ro = CORGI_GPIO_nSD_WP, | 450 | .gpio_card_ro = CORGI_GPIO_nSD_WP, |
451 | .gpio_power = CORGI_GPIO_SD_PWR, | 451 | .gpio_power = CORGI_GPIO_SD_PWR, |
452 | }; | 452 | }; |
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 9e4d9816726a..268a9bc6be8a 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c | |||
@@ -256,13 +256,9 @@ static void init_sdram_rows(void) | |||
256 | 256 | ||
257 | static u32 mdrefr_dri(unsigned int freq) | 257 | static u32 mdrefr_dri(unsigned int freq) |
258 | { | 258 | { |
259 | u32 dri = 0; | 259 | u32 interval = freq * SDRAM_TREF / sdram_rows; |
260 | 260 | ||
261 | if (cpu_is_pxa25x()) | 261 | return (interval - (cpu_is_pxa27x() ? 31 : 0)) / 32; |
262 | dri = ((freq * SDRAM_TREF) / (sdram_rows * 32)); | ||
263 | if (cpu_is_pxa27x()) | ||
264 | dri = ((freq * SDRAM_TREF) / (sdram_rows - 31)) / 32; | ||
265 | return dri; | ||
266 | } | 262 | } |
267 | 263 | ||
268 | /* find a valid frequency point */ | 264 | /* find a valid frequency point */ |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 0af36177ff08..c059dac02b61 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -41,10 +41,10 @@ void pxa27x_clear_otgph(void) | |||
41 | EXPORT_SYMBOL(pxa27x_clear_otgph); | 41 | EXPORT_SYMBOL(pxa27x_clear_otgph); |
42 | 42 | ||
43 | static unsigned long ac97_reset_config[] = { | 43 | static unsigned long ac97_reset_config[] = { |
44 | GPIO95_AC97_nRESET, | ||
45 | GPIO95_GPIO, | ||
46 | GPIO113_AC97_nRESET, | ||
47 | GPIO113_GPIO, | 44 | GPIO113_GPIO, |
45 | GPIO113_AC97_nRESET, | ||
46 | GPIO95_GPIO, | ||
47 | GPIO95_AC97_nRESET, | ||
48 | }; | 48 | }; |
49 | 49 | ||
50 | void pxa27x_assert_ac97reset(int reset_gpio, int on) | 50 | void pxa27x_assert_ac97reset(int reset_gpio, int on) |
diff --git a/arch/arm/mach-shark/include/mach/debug-macro.S b/arch/arm/mach-shark/include/mach/debug-macro.S index 50f071c5bf4d..5ea24d4d1ba6 100644 --- a/arch/arm/mach-shark/include/mach/debug-macro.S +++ b/arch/arm/mach-shark/include/mach/debug-macro.S | |||
@@ -20,6 +20,9 @@ | |||
20 | strb \rd, [\rx] | 20 | strb \rd, [\rx] |
21 | .endm | 21 | .endm |
22 | 22 | ||
23 | .macro waituart,rd,rx | ||
24 | .endm | ||
25 | |||
23 | .macro busyuart,rd,rx | 26 | .macro busyuart,rd,rx |
24 | mov \rd, #0 | 27 | mov \rd, #0 |
25 | 1001: add \rd, \rd, #1 | 28 | 1001: add \rd, \rd, #1 |
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c index 642207e18198..83c56324a472 100644 --- a/arch/arm/mach-w90x900/cpu.c +++ b/arch/arm/mach-w90x900/cpu.c | |||
@@ -93,7 +93,7 @@ static struct clk_lookup nuc900_clkregs[] = { | |||
93 | DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), | 93 | DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), |
94 | DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), | 94 | DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), |
95 | DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), | 95 | DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), |
96 | DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL), | 96 | DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL), |
97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), | 97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), |
98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), | 98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), |
99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), | 99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), |
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S index 1670734b7e51..37fa593884ee 100644 --- a/arch/arm/plat-spear/include/plat/debug-macro.S +++ b/arch/arm/plat-spear/include/plat/debug-macro.S | |||
@@ -17,8 +17,8 @@ | |||
17 | .macro addruart, rx | 17 | .macro addruart, rx |
18 | mrc p15, 0, \rx, c1, c0 | 18 | mrc p15, 0, \rx, c1, c0 |
19 | tst \rx, #1 @ MMU enabled? | 19 | tst \rx, #1 @ MMU enabled? |
20 | moveq \rx, =SPEAR_DBG_UART_BASE @ Physical base | 20 | moveq \rx, #SPEAR_DBG_UART_BASE @ Physical base |
21 | movne \rx, =VA_SPEAR_DBG_UART_BASE @ Virtual base | 21 | movne \rx, #VA_SPEAR_DBG_UART_BASE @ Virtual base |
22 | .endm | 22 | .endm |
23 | 23 | ||
24 | .macro senduart, rd, rx | 24 | .macro senduart, rd, rx |
diff --git a/arch/avr32/include/asm/ioctls.h b/arch/avr32/include/asm/ioctls.h index 0cf2c0a4502b..e6ac0b661076 100644 --- a/arch/avr32/include/asm/ioctls.h +++ b/arch/avr32/include/asm/ioctls.h | |||
@@ -54,6 +54,9 @@ | |||
54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | 54 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ |
55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | 55 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ |
56 | 56 | ||
57 | #define TIOCGRS485 0x542E | ||
58 | #define TIOCSRS485 0x542F | ||
59 | |||
57 | #define FIONCLEX 0x5450 | 60 | #define FIONCLEX 0x5450 |
58 | #define FIOCLEX 0x5451 | 61 | #define FIOCLEX 0x5451 |
59 | #define FIOASYNC 0x5452 | 62 | #define FIOASYNC 0x5452 |
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index c7f25bb1d068..61740201b311 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #define __ASM_ARCH_BOARD_H | 5 | #define __ASM_ARCH_BOARD_H |
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/serial.h> | ||
8 | 9 | ||
9 | #define GPIO_PIN_NONE (-1) | 10 | #define GPIO_PIN_NONE (-1) |
10 | 11 | ||
@@ -35,6 +36,7 @@ struct atmel_uart_data { | |||
35 | short use_dma_tx; /* use transmit DMA? */ | 36 | short use_dma_tx; /* use transmit DMA? */ |
36 | short use_dma_rx; /* use receive DMA? */ | 37 | short use_dma_rx; /* use receive DMA? */ |
37 | void __iomem *regs; /* virtual base address, if any */ | 38 | void __iomem *regs; /* virtual base address, if any */ |
39 | struct serial_rs485 rs485; /* rs485 settings */ | ||
38 | }; | 40 | }; |
39 | void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); | 41 | void at32_map_usart(unsigned int hw_id, unsigned int line, int flags); |
40 | struct platform_device *at32_add_device_usart(unsigned int id); | 42 | struct platform_device *at32_add_device_usart(unsigned int id); |
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index 2580e77624d2..f9e5622ebc95 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c | |||
@@ -435,20 +435,21 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = { | |||
435 | static int __init au1xxx_platform_init(void) | 435 | static int __init au1xxx_platform_init(void) |
436 | { | 436 | { |
437 | unsigned int uartclk = get_au1x00_uart_baud_base() * 16; | 437 | unsigned int uartclk = get_au1x00_uart_baud_base() * 16; |
438 | int i; | 438 | int err, i; |
439 | 439 | ||
440 | /* Fill up uartclk. */ | 440 | /* Fill up uartclk. */ |
441 | for (i = 0; au1x00_uart_data[i].flags; i++) | 441 | for (i = 0; au1x00_uart_data[i].flags; i++) |
442 | au1x00_uart_data[i].uartclk = uartclk; | 442 | au1x00_uart_data[i].uartclk = uartclk; |
443 | 443 | ||
444 | err = platform_add_devices(au1xxx_platform_devices, | ||
445 | ARRAY_SIZE(au1xxx_platform_devices)); | ||
444 | #ifndef CONFIG_SOC_AU1100 | 446 | #ifndef CONFIG_SOC_AU1100 |
445 | /* Register second MAC if enabled in pinfunc */ | 447 | /* Register second MAC if enabled in pinfunc */ |
446 | if (!(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) | 448 | if (!err && !(au_readl(SYS_PINFUNC) & (u32)SYS_PF_NI2)) |
447 | platform_device_register(&au1xxx_eth1_device); | 449 | platform_device_register(&au1xxx_eth1_device); |
448 | #endif | 450 | #endif |
449 | 451 | ||
450 | return platform_add_devices(au1xxx_platform_devices, | 452 | return err; |
451 | ARRAY_SIZE(au1xxx_platform_devices)); | ||
452 | } | 453 | } |
453 | 454 | ||
454 | arch_initcall(au1xxx_platform_init); | 455 | arch_initcall(au1xxx_platform_init); |
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c index a9f0336e1f1f..52d883d37dd7 100644 --- a/arch/mips/alchemy/mtx-1/board_setup.c +++ b/arch/mips/alchemy/mtx-1/board_setup.c | |||
@@ -67,8 +67,6 @@ static void mtx1_power_off(void) | |||
67 | 67 | ||
68 | void __init board_setup(void) | 68 | void __init board_setup(void) |
69 | { | 69 | { |
70 | alchemy_gpio2_enable(); | ||
71 | |||
72 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 70 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
73 | /* Enable USB power switch */ | 71 | /* Enable USB power switch */ |
74 | alchemy_gpio_direction_output(204, 0); | 72 | alchemy_gpio_direction_output(204, 0); |
@@ -117,11 +115,11 @@ mtx1_pci_idsel(unsigned int devsel, int assert) | |||
117 | 115 | ||
118 | if (assert && devsel != 0) | 116 | if (assert && devsel != 0) |
119 | /* Suppress signal to Cardbus */ | 117 | /* Suppress signal to Cardbus */ |
120 | gpio_set_value(1, 0); /* set EXT_IO3 OFF */ | 118 | alchemy_gpio_set_value(1, 0); /* set EXT_IO3 OFF */ |
121 | else | 119 | else |
122 | gpio_set_value(1, 1); /* set EXT_IO3 ON */ | 120 | alchemy_gpio_set_value(1, 1); /* set EXT_IO3 ON */ |
123 | 121 | ||
124 | au_sync_udelay(1); | 122 | udelay(1); |
125 | return 1; | 123 | return 1; |
126 | } | 124 | } |
127 | 125 | ||
diff --git a/arch/mips/bcm63xx/dev-enet.c b/arch/mips/bcm63xx/dev-enet.c index 9f544badd0b4..39c23366c5c7 100644 --- a/arch/mips/bcm63xx/dev-enet.c +++ b/arch/mips/bcm63xx/dev-enet.c | |||
@@ -104,6 +104,9 @@ int __init bcm63xx_enet_register(int unit, | |||
104 | if (unit > 1) | 104 | if (unit > 1) |
105 | return -ENODEV; | 105 | return -ENODEV; |
106 | 106 | ||
107 | if (unit == 1 && BCMCPU_IS_6338()) | ||
108 | return -ENODEV; | ||
109 | |||
107 | if (!shared_device_registered) { | 110 | if (!shared_device_registered) { |
108 | shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); | 111 | shared_res[0].start = bcm63xx_regset_address(RSET_ENETDMA); |
109 | shared_res[0].end = shared_res[0].start; | 112 | shared_res[0].end = shared_res[0].start; |
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index 59dc0c7ef733..c63c56bfd184 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h | |||
@@ -434,7 +434,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
434 | __asm__ __volatile__( | 434 | __asm__ __volatile__( |
435 | " .set mips3 \n" | 435 | " .set mips3 \n" |
436 | "1: lld %0, %1 # atomic64_add \n" | 436 | "1: lld %0, %1 # atomic64_add \n" |
437 | " addu %0, %2 \n" | 437 | " daddu %0, %2 \n" |
438 | " scd %0, %1 \n" | 438 | " scd %0, %1 \n" |
439 | " beqzl %0, 1b \n" | 439 | " beqzl %0, 1b \n" |
440 | " .set mips0 \n" | 440 | " .set mips0 \n" |
@@ -446,7 +446,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
446 | __asm__ __volatile__( | 446 | __asm__ __volatile__( |
447 | " .set mips3 \n" | 447 | " .set mips3 \n" |
448 | "1: lld %0, %1 # atomic64_add \n" | 448 | "1: lld %0, %1 # atomic64_add \n" |
449 | " addu %0, %2 \n" | 449 | " daddu %0, %2 \n" |
450 | " scd %0, %1 \n" | 450 | " scd %0, %1 \n" |
451 | " beqz %0, 2f \n" | 451 | " beqz %0, 2f \n" |
452 | " .subsection 2 \n" | 452 | " .subsection 2 \n" |
@@ -479,7 +479,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
479 | __asm__ __volatile__( | 479 | __asm__ __volatile__( |
480 | " .set mips3 \n" | 480 | " .set mips3 \n" |
481 | "1: lld %0, %1 # atomic64_sub \n" | 481 | "1: lld %0, %1 # atomic64_sub \n" |
482 | " subu %0, %2 \n" | 482 | " dsubu %0, %2 \n" |
483 | " scd %0, %1 \n" | 483 | " scd %0, %1 \n" |
484 | " beqzl %0, 1b \n" | 484 | " beqzl %0, 1b \n" |
485 | " .set mips0 \n" | 485 | " .set mips0 \n" |
@@ -491,7 +491,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
491 | __asm__ __volatile__( | 491 | __asm__ __volatile__( |
492 | " .set mips3 \n" | 492 | " .set mips3 \n" |
493 | "1: lld %0, %1 # atomic64_sub \n" | 493 | "1: lld %0, %1 # atomic64_sub \n" |
494 | " subu %0, %2 \n" | 494 | " dsubu %0, %2 \n" |
495 | " scd %0, %1 \n" | 495 | " scd %0, %1 \n" |
496 | " beqz %0, 2f \n" | 496 | " beqz %0, 2f \n" |
497 | " .subsection 2 \n" | 497 | " .subsection 2 \n" |
@@ -524,10 +524,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
524 | __asm__ __volatile__( | 524 | __asm__ __volatile__( |
525 | " .set mips3 \n" | 525 | " .set mips3 \n" |
526 | "1: lld %1, %2 # atomic64_add_return \n" | 526 | "1: lld %1, %2 # atomic64_add_return \n" |
527 | " addu %0, %1, %3 \n" | 527 | " daddu %0, %1, %3 \n" |
528 | " scd %0, %2 \n" | 528 | " scd %0, %2 \n" |
529 | " beqzl %0, 1b \n" | 529 | " beqzl %0, 1b \n" |
530 | " addu %0, %1, %3 \n" | 530 | " daddu %0, %1, %3 \n" |
531 | " .set mips0 \n" | 531 | " .set mips0 \n" |
532 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 532 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
533 | : "Ir" (i), "m" (v->counter) | 533 | : "Ir" (i), "m" (v->counter) |
@@ -538,10 +538,10 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
538 | __asm__ __volatile__( | 538 | __asm__ __volatile__( |
539 | " .set mips3 \n" | 539 | " .set mips3 \n" |
540 | "1: lld %1, %2 # atomic64_add_return \n" | 540 | "1: lld %1, %2 # atomic64_add_return \n" |
541 | " addu %0, %1, %3 \n" | 541 | " daddu %0, %1, %3 \n" |
542 | " scd %0, %2 \n" | 542 | " scd %0, %2 \n" |
543 | " beqz %0, 2f \n" | 543 | " beqz %0, 2f \n" |
544 | " addu %0, %1, %3 \n" | 544 | " daddu %0, %1, %3 \n" |
545 | " .subsection 2 \n" | 545 | " .subsection 2 \n" |
546 | "2: b 1b \n" | 546 | "2: b 1b \n" |
547 | " .previous \n" | 547 | " .previous \n" |
@@ -576,10 +576,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
576 | __asm__ __volatile__( | 576 | __asm__ __volatile__( |
577 | " .set mips3 \n" | 577 | " .set mips3 \n" |
578 | "1: lld %1, %2 # atomic64_sub_return \n" | 578 | "1: lld %1, %2 # atomic64_sub_return \n" |
579 | " subu %0, %1, %3 \n" | 579 | " dsubu %0, %1, %3 \n" |
580 | " scd %0, %2 \n" | 580 | " scd %0, %2 \n" |
581 | " beqzl %0, 1b \n" | 581 | " beqzl %0, 1b \n" |
582 | " subu %0, %1, %3 \n" | 582 | " dsubu %0, %1, %3 \n" |
583 | " .set mips0 \n" | 583 | " .set mips0 \n" |
584 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) | 584 | : "=&r" (result), "=&r" (temp), "=m" (v->counter) |
585 | : "Ir" (i), "m" (v->counter) | 585 | : "Ir" (i), "m" (v->counter) |
@@ -590,10 +590,10 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
590 | __asm__ __volatile__( | 590 | __asm__ __volatile__( |
591 | " .set mips3 \n" | 591 | " .set mips3 \n" |
592 | "1: lld %1, %2 # atomic64_sub_return \n" | 592 | "1: lld %1, %2 # atomic64_sub_return \n" |
593 | " subu %0, %1, %3 \n" | 593 | " dsubu %0, %1, %3 \n" |
594 | " scd %0, %2 \n" | 594 | " scd %0, %2 \n" |
595 | " beqz %0, 2f \n" | 595 | " beqz %0, 2f \n" |
596 | " subu %0, %1, %3 \n" | 596 | " dsubu %0, %1, %3 \n" |
597 | " .subsection 2 \n" | 597 | " .subsection 2 \n" |
598 | "2: b 1b \n" | 598 | "2: b 1b \n" |
599 | " .previous \n" | 599 | " .previous \n" |
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 1b5a6648eb86..baa318a59c97 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
@@ -984,16 +984,17 @@ | |||
984 | #define __NR_perf_event_open (__NR_Linux + 296) | 984 | #define __NR_perf_event_open (__NR_Linux + 296) |
985 | #define __NR_accept4 (__NR_Linux + 297) | 985 | #define __NR_accept4 (__NR_Linux + 297) |
986 | #define __NR_recvmmsg (__NR_Linux + 298) | 986 | #define __NR_recvmmsg (__NR_Linux + 298) |
987 | #define __NR_getdents64 (__NR_Linux + 299) | ||
987 | 988 | ||
988 | /* | 989 | /* |
989 | * Offset of the last N32 flavoured syscall | 990 | * Offset of the last N32 flavoured syscall |
990 | */ | 991 | */ |
991 | #define __NR_Linux_syscalls 298 | 992 | #define __NR_Linux_syscalls 299 |
992 | 993 | ||
993 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 994 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
994 | 995 | ||
995 | #define __NR_N32_Linux 6000 | 996 | #define __NR_N32_Linux 6000 |
996 | #define __NR_N32_Linux_syscalls 298 | 997 | #define __NR_N32_Linux_syscalls 299 |
997 | 998 | ||
998 | #ifdef __KERNEL__ | 999 | #ifdef __KERNEL__ |
999 | 1000 | ||
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index a5297e2a353a..a4faceea9d88 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -419,4 +419,5 @@ EXPORT(sysn32_call_table) | |||
419 | PTR sys_perf_event_open | 419 | PTR sys_perf_event_open |
420 | PTR sys_accept4 | 420 | PTR sys_accept4 |
421 | PTR compat_sys_recvmmsg | 421 | PTR compat_sys_recvmmsg |
422 | PTR sys_getdents | ||
422 | .size sysn32_call_table,.-sysn32_call_table | 423 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/vdso.c b/arch/mips/kernel/vdso.c index b773c1112b14..e5cdfd603f8f 100644 --- a/arch/mips/kernel/vdso.c +++ b/arch/mips/kernel/vdso.c | |||
@@ -61,11 +61,9 @@ static int __init init_vdso(void) | |||
61 | 61 | ||
62 | vunmap(vdso); | 62 | vunmap(vdso); |
63 | 63 | ||
64 | pr_notice("init_vdso successfull\n"); | ||
65 | |||
66 | return 0; | 64 | return 0; |
67 | } | 65 | } |
68 | device_initcall(init_vdso); | 66 | subsys_initcall(init_vdso); |
69 | 67 | ||
70 | static unsigned long vdso_addr(unsigned long start) | 68 | static unsigned long vdso_addr(unsigned long start) |
71 | { | 69 | { |
diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c index 2fbfa1a8c3a9..bf80921f2f56 100644 --- a/arch/mips/mti-malta/malta-pci.c +++ b/arch/mips/mti-malta/malta-pci.c | |||
@@ -247,6 +247,8 @@ void __init mips_pcibios_init(void) | |||
247 | iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ | 247 | iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ |
248 | ioport_resource.end = controller->io_resource->end; | 248 | ioport_resource.end = controller->io_resource->end; |
249 | 249 | ||
250 | controller->io_map_base = mips_io_port_base; | ||
251 | |||
250 | register_pci_controller(controller); | 252 | register_pci_controller(controller); |
251 | } | 253 | } |
252 | 254 | ||
diff --git a/arch/mips/nxp/pnx8550/common/pci.c b/arch/mips/nxp/pnx8550/common/pci.c index eee4f3dfc410..98e86ddb86cc 100644 --- a/arch/mips/nxp/pnx8550/common/pci.c +++ b/arch/mips/nxp/pnx8550/common/pci.c | |||
@@ -44,6 +44,7 @@ extern struct pci_ops pnx8550_pci_ops; | |||
44 | 44 | ||
45 | static struct pci_controller pnx8550_controller = { | 45 | static struct pci_controller pnx8550_controller = { |
46 | .pci_ops = &pnx8550_pci_ops, | 46 | .pci_ops = &pnx8550_pci_ops, |
47 | .io_map_base = PNX8550_PORT_BASE, | ||
47 | .io_resource = &pci_io_resource, | 48 | .io_resource = &pci_io_resource, |
48 | .mem_resource = &pci_mem_resource, | 49 | .mem_resource = &pci_mem_resource, |
49 | }; | 50 | }; |
diff --git a/arch/mips/nxp/pnx8550/common/setup.c b/arch/mips/nxp/pnx8550/common/setup.c index 2aed50fef10f..64246c9c875c 100644 --- a/arch/mips/nxp/pnx8550/common/setup.c +++ b/arch/mips/nxp/pnx8550/common/setup.c | |||
@@ -113,7 +113,7 @@ void __init plat_mem_setup(void) | |||
113 | PNX8550_GLB2_ENAB_INTA_O = 0; | 113 | PNX8550_GLB2_ENAB_INTA_O = 0; |
114 | 114 | ||
115 | /* IO/MEM resources. */ | 115 | /* IO/MEM resources. */ |
116 | set_io_port_base(KSEG1); | 116 | set_io_port_base(PNX8550_PORT_BASE); |
117 | ioport_resource.start = 0; | 117 | ioport_resource.start = 0; |
118 | ioport_resource.end = ~0; | 118 | ioport_resource.end = ~0; |
119 | iomem_resource.start = 0; | 119 | iomem_resource.start = 0; |
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c index 04b31478a6d7..b7c03d80c88c 100644 --- a/arch/mips/pci/ops-pmcmsp.c +++ b/arch/mips/pci/ops-pmcmsp.c | |||
@@ -944,6 +944,7 @@ static struct pci_controller msp_pci_controller = { | |||
944 | .pci_ops = &msp_pci_ops, | 944 | .pci_ops = &msp_pci_ops, |
945 | .mem_resource = &pci_mem_resource, | 945 | .mem_resource = &pci_mem_resource, |
946 | .mem_offset = 0, | 946 | .mem_offset = 0, |
947 | .io_map_base = MSP_PCI_IOSPACE_BASE, | ||
947 | .io_resource = &pci_io_resource, | 948 | .io_resource = &pci_io_resource, |
948 | .io_offset = 0 | 949 | .io_offset = 0 |
949 | }; | 950 | }; |
diff --git a/arch/mips/pci/pci-yosemite.c b/arch/mips/pci/pci-yosemite.c index 0357946f30e6..cf5e1a25cb7d 100644 --- a/arch/mips/pci/pci-yosemite.c +++ b/arch/mips/pci/pci-yosemite.c | |||
@@ -54,6 +54,7 @@ static int __init pmc_yosemite_setup(void) | |||
54 | panic(ioremap_failed); | 54 | panic(ioremap_failed); |
55 | 55 | ||
56 | set_io_port_base(io_v_base); | 56 | set_io_port_base(io_v_base); |
57 | py_controller.io_map_base = io_v_base; | ||
57 | TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1); | 58 | TITAN_WRITE(RM9000x2_OCD_LKM7, TITAN_READ(RM9000x2_OCD_LKM7) | 1); |
58 | 59 | ||
59 | ioport_resource.end = TITAN_IO_SIZE - 1; | 60 | ioport_resource.end = TITAN_IO_SIZE - 1; |
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c index 8ee77887306a..9ec523e4dd06 100644 --- a/arch/mips/powertv/asic/asic_devices.c +++ b/arch/mips/powertv/asic/asic_devices.c | |||
@@ -472,6 +472,9 @@ void __init configure_platform(void) | |||
472 | * it*/ | 472 | * it*/ |
473 | platform_features = FFS_CAPABLE | DISPLAY_CAPABLE; | 473 | platform_features = FFS_CAPABLE | DISPLAY_CAPABLE; |
474 | 474 | ||
475 | /* Cronus and Cronus Lite have the same register map */ | ||
476 | set_register_map(CRONUS_IO_BASE, &cronus_register_map); | ||
477 | |||
475 | /* ASIC version will determine if this is a real CronusLite or | 478 | /* ASIC version will determine if this is a real CronusLite or |
476 | * Castrati(Cronus) */ | 479 | * Castrati(Cronus) */ |
477 | chipversion = asic_read(chipver3) << 24; | 480 | chipversion = asic_read(chipver3) << 24; |
@@ -484,8 +487,6 @@ void __init configure_platform(void) | |||
484 | else | 487 | else |
485 | asic = ASIC_CRONUSLITE; | 488 | asic = ASIC_CRONUSLITE; |
486 | 489 | ||
487 | /* Cronus and Cronus Lite have the same register map */ | ||
488 | set_register_map(CRONUS_IO_BASE, &cronus_register_map); | ||
489 | gp_resources = non_dvr_cronuslite_resources; | 490 | gp_resources = non_dvr_cronuslite_resources; |
490 | pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, " | 491 | pr_info("Platform: 4600 - %s, NON_DVR_CAPABLE, " |
491 | "chipversion=0x%08X\n", | 492 | "chipversion=0x%08X\n", |
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h index 2a9cd74a841e..076327f2eff7 100644 --- a/arch/powerpc/include/asm/kexec.h +++ b/arch/powerpc/include/asm/kexec.h | |||
@@ -8,9 +8,9 @@ | |||
8 | * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory | 8 | * On FSL-BookE we setup a 1:1 mapping which covers the first 2GiB of memory |
9 | * and therefore we can only deal with memory within this range | 9 | * and therefore we can only deal with memory within this range |
10 | */ | 10 | */ |
11 | #define KEXEC_SOURCE_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | 11 | #define KEXEC_SOURCE_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1) |
12 | #define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | 12 | #define KEXEC_DESTINATION_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1) |
13 | #define KEXEC_CONTROL_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL) | 13 | #define KEXEC_CONTROL_MEMORY_LIMIT (2 * 1024 * 1024 * 1024UL - 1) |
14 | 14 | ||
15 | #else | 15 | #else |
16 | 16 | ||
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h index 2102b214a87c..0e398cfee2c8 100644 --- a/arch/powerpc/include/asm/mmu-hash64.h +++ b/arch/powerpc/include/asm/mmu-hash64.h | |||
@@ -250,7 +250,9 @@ extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
250 | int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, | 250 | int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, |
251 | pte_t *ptep, unsigned long trap, int local, int ssize, | 251 | pte_t *ptep, unsigned long trap, int local, int ssize, |
252 | unsigned int shift, unsigned int mmu_psize); | 252 | unsigned int shift, unsigned int mmu_psize); |
253 | 253 | extern void hash_failure_debug(unsigned long ea, unsigned long access, | |
254 | unsigned long vsid, unsigned long trap, | ||
255 | int ssize, int psize, unsigned long pte); | ||
254 | extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | 256 | extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, |
255 | unsigned long pstart, unsigned long prot, | 257 | unsigned long pstart, unsigned long prot, |
256 | int psize, int ssize); | 258 | int psize, int ssize); |
diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c b/arch/powerpc/kernel/perf_event_fsl_emb.c index 369872f6cf78..babcceecd2ea 100644 --- a/arch/powerpc/kernel/perf_event_fsl_emb.c +++ b/arch/powerpc/kernel/perf_event_fsl_emb.c | |||
@@ -566,9 +566,9 @@ static void record_and_restart(struct perf_event *event, unsigned long val, | |||
566 | * Finally record data if requested. | 566 | * Finally record data if requested. |
567 | */ | 567 | */ |
568 | if (record) { | 568 | if (record) { |
569 | struct perf_sample_data data = { | 569 | struct perf_sample_data data; |
570 | .period = event->hw.last_period, | 570 | |
571 | }; | 571 | perf_sample_data_init(&data, 0); |
572 | 572 | ||
573 | if (perf_event_overflow(event, nmi, &data, regs)) { | 573 | if (perf_event_overflow(event, nmi, &data, regs)) { |
574 | /* | 574 | /* |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 9d3953983fb7..fed9bf6187d1 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -414,7 +414,7 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node) | |||
414 | u64 base, size, memblock_size; | 414 | u64 base, size, memblock_size; |
415 | unsigned int is_kexec_kdump = 0, rngs; | 415 | unsigned int is_kexec_kdump = 0, rngs; |
416 | 416 | ||
417 | ls = of_get_flat_dt_prop(node, "ibm,memblock-size", &l); | 417 | ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l); |
418 | if (ls == NULL || l < dt_root_size_cells * sizeof(__be32)) | 418 | if (ls == NULL || l < dt_root_size_cells * sizeof(__be32)) |
419 | return 0; | 419 | return 0; |
420 | memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls); | 420 | memblock_size = dt_mem_next_cell(dt_root_size_cells, &ls); |
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S index a719f53921a5..3079f6b44cf5 100644 --- a/arch/powerpc/mm/hash_low_64.S +++ b/arch/powerpc/mm/hash_low_64.S | |||
@@ -68,9 +68,6 @@ _GLOBAL(__hash_page_4K) | |||
68 | std r8,STK_PARM(r8)(r1) | 68 | std r8,STK_PARM(r8)(r1) |
69 | std r9,STK_PARM(r9)(r1) | 69 | std r9,STK_PARM(r9)(r1) |
70 | 70 | ||
71 | /* Add _PAGE_PRESENT to access */ | ||
72 | ori r4,r4,_PAGE_PRESENT | ||
73 | |||
74 | /* Save non-volatile registers. | 71 | /* Save non-volatile registers. |
75 | * r31 will hold "old PTE" | 72 | * r31 will hold "old PTE" |
76 | * r30 is "new PTE" | 73 | * r30 is "new PTE" |
@@ -347,9 +344,6 @@ _GLOBAL(__hash_page_4K) | |||
347 | std r8,STK_PARM(r8)(r1) | 344 | std r8,STK_PARM(r8)(r1) |
348 | std r9,STK_PARM(r9)(r1) | 345 | std r9,STK_PARM(r9)(r1) |
349 | 346 | ||
350 | /* Add _PAGE_PRESENT to access */ | ||
351 | ori r4,r4,_PAGE_PRESENT | ||
352 | |||
353 | /* Save non-volatile registers. | 347 | /* Save non-volatile registers. |
354 | * r31 will hold "old PTE" | 348 | * r31 will hold "old PTE" |
355 | * r30 is "new PTE" | 349 | * r30 is "new PTE" |
@@ -687,9 +681,6 @@ _GLOBAL(__hash_page_64K) | |||
687 | std r8,STK_PARM(r8)(r1) | 681 | std r8,STK_PARM(r8)(r1) |
688 | std r9,STK_PARM(r9)(r1) | 682 | std r9,STK_PARM(r9)(r1) |
689 | 683 | ||
690 | /* Add _PAGE_PRESENT to access */ | ||
691 | ori r4,r4,_PAGE_PRESENT | ||
692 | |||
693 | /* Save non-volatile registers. | 684 | /* Save non-volatile registers. |
694 | * r31 will hold "old PTE" | 685 | * r31 will hold "old PTE" |
695 | * r30 is "new PTE" | 686 | * r30 is "new PTE" |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 98f262de5585..09dffe6efa46 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -871,6 +871,18 @@ static inline int subpage_protection(struct mm_struct *mm, unsigned long ea) | |||
871 | } | 871 | } |
872 | #endif | 872 | #endif |
873 | 873 | ||
874 | void hash_failure_debug(unsigned long ea, unsigned long access, | ||
875 | unsigned long vsid, unsigned long trap, | ||
876 | int ssize, int psize, unsigned long pte) | ||
877 | { | ||
878 | if (!printk_ratelimit()) | ||
879 | return; | ||
880 | pr_info("mm: Hashing failure ! EA=0x%lx access=0x%lx current=%s\n", | ||
881 | ea, access, current->comm); | ||
882 | pr_info(" trap=0x%lx vsid=0x%lx ssize=%d psize=%d pte=0x%lx\n", | ||
883 | trap, vsid, ssize, psize, pte); | ||
884 | } | ||
885 | |||
874 | /* Result code is: | 886 | /* Result code is: |
875 | * 0 - handled | 887 | * 0 - handled |
876 | * 1 - normal page fault | 888 | * 1 - normal page fault |
@@ -955,6 +967,17 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
955 | return 1; | 967 | return 1; |
956 | } | 968 | } |
957 | 969 | ||
970 | /* Add _PAGE_PRESENT to the required access perm */ | ||
971 | access |= _PAGE_PRESENT; | ||
972 | |||
973 | /* Pre-check access permissions (will be re-checked atomically | ||
974 | * in __hash_page_XX but this pre-check is a fast path | ||
975 | */ | ||
976 | if (access & ~pte_val(*ptep)) { | ||
977 | DBG_LOW(" no access !\n"); | ||
978 | return 1; | ||
979 | } | ||
980 | |||
958 | #ifdef CONFIG_HUGETLB_PAGE | 981 | #ifdef CONFIG_HUGETLB_PAGE |
959 | if (hugeshift) | 982 | if (hugeshift) |
960 | return __hash_page_huge(ea, access, vsid, ptep, trap, local, | 983 | return __hash_page_huge(ea, access, vsid, ptep, trap, local, |
@@ -967,14 +990,6 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
967 | DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep), | 990 | DBG_LOW(" i-pte: %016lx %016lx\n", pte_val(*ptep), |
968 | pte_val(*(ptep + PTRS_PER_PTE))); | 991 | pte_val(*(ptep + PTRS_PER_PTE))); |
969 | #endif | 992 | #endif |
970 | /* Pre-check access permissions (will be re-checked atomically | ||
971 | * in __hash_page_XX but this pre-check is a fast path | ||
972 | */ | ||
973 | if (access & ~pte_val(*ptep)) { | ||
974 | DBG_LOW(" no access !\n"); | ||
975 | return 1; | ||
976 | } | ||
977 | |||
978 | /* Do actual hashing */ | 993 | /* Do actual hashing */ |
979 | #ifdef CONFIG_PPC_64K_PAGES | 994 | #ifdef CONFIG_PPC_64K_PAGES |
980 | /* If _PAGE_4K_PFN is set, make sure this is a 4k segment */ | 995 | /* If _PAGE_4K_PFN is set, make sure this is a 4k segment */ |
@@ -1033,6 +1048,12 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
1033 | local, ssize, spp); | 1048 | local, ssize, spp); |
1034 | } | 1049 | } |
1035 | 1050 | ||
1051 | /* Dump some info in case of hash insertion failure, they should | ||
1052 | * never happen so it is really useful to know if/when they do | ||
1053 | */ | ||
1054 | if (rc == -1) | ||
1055 | hash_failure_debug(ea, access, vsid, trap, ssize, psize, | ||
1056 | pte_val(*ptep)); | ||
1036 | #ifndef CONFIG_PPC_64K_PAGES | 1057 | #ifndef CONFIG_PPC_64K_PAGES |
1037 | DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep)); | 1058 | DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep)); |
1038 | #else | 1059 | #else |
@@ -1051,8 +1072,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, | |||
1051 | void *pgdir; | 1072 | void *pgdir; |
1052 | pte_t *ptep; | 1073 | pte_t *ptep; |
1053 | unsigned long flags; | 1074 | unsigned long flags; |
1054 | int local = 0; | 1075 | int rc, ssize, local = 0; |
1055 | int ssize; | ||
1056 | 1076 | ||
1057 | BUG_ON(REGION_ID(ea) != USER_REGION_ID); | 1077 | BUG_ON(REGION_ID(ea) != USER_REGION_ID); |
1058 | 1078 | ||
@@ -1098,11 +1118,18 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, | |||
1098 | /* Hash it in */ | 1118 | /* Hash it in */ |
1099 | #ifdef CONFIG_PPC_HAS_HASH_64K | 1119 | #ifdef CONFIG_PPC_HAS_HASH_64K |
1100 | if (mm->context.user_psize == MMU_PAGE_64K) | 1120 | if (mm->context.user_psize == MMU_PAGE_64K) |
1101 | __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize); | 1121 | rc = __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize); |
1102 | else | 1122 | else |
1103 | #endif /* CONFIG_PPC_HAS_HASH_64K */ | 1123 | #endif /* CONFIG_PPC_HAS_HASH_64K */ |
1104 | __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, | 1124 | rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize, |
1105 | subpage_protection(pgdir, ea)); | 1125 | subpage_protection(pgdir, ea)); |
1126 | |||
1127 | /* Dump some info in case of hash insertion failure, they should | ||
1128 | * never happen so it is really useful to know if/when they do | ||
1129 | */ | ||
1130 | if (rc == -1) | ||
1131 | hash_failure_debug(ea, access, vsid, trap, ssize, | ||
1132 | mm->context.user_psize, pte_val(*ptep)); | ||
1106 | 1133 | ||
1107 | local_irq_restore(flags); | 1134 | local_irq_restore(flags); |
1108 | } | 1135 | } |
diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c b/arch/powerpc/mm/hugetlbpage-hash64.c index 199539882f92..cc5c273086cf 100644 --- a/arch/powerpc/mm/hugetlbpage-hash64.c +++ b/arch/powerpc/mm/hugetlbpage-hash64.c | |||
@@ -21,21 +21,13 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, | |||
21 | unsigned long old_pte, new_pte; | 21 | unsigned long old_pte, new_pte; |
22 | unsigned long va, rflags, pa, sz; | 22 | unsigned long va, rflags, pa, sz; |
23 | long slot; | 23 | long slot; |
24 | int err = 1; | ||
25 | 24 | ||
26 | BUG_ON(shift != mmu_psize_defs[mmu_psize].shift); | 25 | BUG_ON(shift != mmu_psize_defs[mmu_psize].shift); |
27 | 26 | ||
28 | /* Search the Linux page table for a match with va */ | 27 | /* Search the Linux page table for a match with va */ |
29 | va = hpt_va(ea, vsid, ssize); | 28 | va = hpt_va(ea, vsid, ssize); |
30 | 29 | ||
31 | /* | 30 | /* At this point, we have a pte (old_pte) which can be used to build |
32 | * Check the user's access rights to the page. If access should be | ||
33 | * prevented then send the problem up to do_page_fault. | ||
34 | */ | ||
35 | if (unlikely(access & ~pte_val(*ptep))) | ||
36 | goto out; | ||
37 | /* | ||
38 | * At this point, we have a pte (old_pte) which can be used to build | ||
39 | * or update an HPTE. There are 2 cases: | 31 | * or update an HPTE. There are 2 cases: |
40 | * | 32 | * |
41 | * 1. There is a valid (present) pte with no associated HPTE (this is | 33 | * 1. There is a valid (present) pte with no associated HPTE (this is |
@@ -49,9 +41,17 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, | |||
49 | 41 | ||
50 | do { | 42 | do { |
51 | old_pte = pte_val(*ptep); | 43 | old_pte = pte_val(*ptep); |
52 | if (old_pte & _PAGE_BUSY) | 44 | /* If PTE busy, retry the access */ |
53 | goto out; | 45 | if (unlikely(old_pte & _PAGE_BUSY)) |
46 | return 0; | ||
47 | /* If PTE permissions don't match, take page fault */ | ||
48 | if (unlikely(access & ~old_pte)) | ||
49 | return 1; | ||
50 | /* Try to lock the PTE, add ACCESSED and DIRTY if it was | ||
51 | * a write access */ | ||
54 | new_pte = old_pte | _PAGE_BUSY | _PAGE_ACCESSED; | 52 | new_pte = old_pte | _PAGE_BUSY | _PAGE_ACCESSED; |
53 | if (access & _PAGE_RW) | ||
54 | new_pte |= _PAGE_DIRTY; | ||
55 | } while(old_pte != __cmpxchg_u64((unsigned long *)ptep, | 55 | } while(old_pte != __cmpxchg_u64((unsigned long *)ptep, |
56 | old_pte, new_pte)); | 56 | old_pte, new_pte)); |
57 | 57 | ||
@@ -121,8 +121,16 @@ repeat: | |||
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
124 | if (unlikely(slot == -2)) | 124 | /* |
125 | panic("hash_huge_page: pte_insert failed\n"); | 125 | * Hypervisor failure. Restore old pte and return -1 |
126 | * similar to __hash_page_* | ||
127 | */ | ||
128 | if (unlikely(slot == -2)) { | ||
129 | *ptep = __pte(old_pte); | ||
130 | hash_failure_debug(ea, access, vsid, trap, ssize, | ||
131 | mmu_psize, old_pte); | ||
132 | return -1; | ||
133 | } | ||
126 | 134 | ||
127 | new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX); | 135 | new_pte |= (slot << 12) & (_PAGE_F_SECOND | _PAGE_F_GIX); |
128 | } | 136 | } |
@@ -131,9 +139,5 @@ repeat: | |||
131 | * No need to use ldarx/stdcx here | 139 | * No need to use ldarx/stdcx here |
132 | */ | 140 | */ |
133 | *ptep = __pte(new_pte & ~_PAGE_BUSY); | 141 | *ptep = __pte(new_pte & ~_PAGE_BUSY); |
134 | 142 | return 0; | |
135 | err = 0; | ||
136 | |||
137 | out: | ||
138 | return err; | ||
139 | } | 143 | } |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index f47364585ecd..aa731af720c0 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -398,15 +398,15 @@ static int of_get_drconf_memory(struct device_node *memory, const u32 **dm) | |||
398 | } | 398 | } |
399 | 399 | ||
400 | /* | 400 | /* |
401 | * Retreive and validate the ibm,memblock-size property for drconf memory | 401 | * Retreive and validate the ibm,lmb-size property for drconf memory |
402 | * from the device tree. | 402 | * from the device tree. |
403 | */ | 403 | */ |
404 | static u64 of_get_memblock_size(struct device_node *memory) | 404 | static u64 of_get_lmb_size(struct device_node *memory) |
405 | { | 405 | { |
406 | const u32 *prop; | 406 | const u32 *prop; |
407 | u32 len; | 407 | u32 len; |
408 | 408 | ||
409 | prop = of_get_property(memory, "ibm,memblock-size", &len); | 409 | prop = of_get_property(memory, "ibm,lmb-size", &len); |
410 | if (!prop || len < sizeof(unsigned int)) | 410 | if (!prop || len < sizeof(unsigned int)) |
411 | return 0; | 411 | return 0; |
412 | 412 | ||
@@ -562,7 +562,7 @@ static unsigned long __init numa_enforce_memory_limit(unsigned long start, | |||
562 | static inline int __init read_usm_ranges(const u32 **usm) | 562 | static inline int __init read_usm_ranges(const u32 **usm) |
563 | { | 563 | { |
564 | /* | 564 | /* |
565 | * For each memblock in ibm,dynamic-memory a corresponding | 565 | * For each lmb in ibm,dynamic-memory a corresponding |
566 | * entry in linux,drconf-usable-memory property contains | 566 | * entry in linux,drconf-usable-memory property contains |
567 | * a counter followed by that many (base, size) duple. | 567 | * a counter followed by that many (base, size) duple. |
568 | * read the counter from linux,drconf-usable-memory | 568 | * read the counter from linux,drconf-usable-memory |
@@ -578,7 +578,7 @@ static void __init parse_drconf_memory(struct device_node *memory) | |||
578 | { | 578 | { |
579 | const u32 *dm, *usm; | 579 | const u32 *dm, *usm; |
580 | unsigned int n, rc, ranges, is_kexec_kdump = 0; | 580 | unsigned int n, rc, ranges, is_kexec_kdump = 0; |
581 | unsigned long memblock_size, base, size, sz; | 581 | unsigned long lmb_size, base, size, sz; |
582 | int nid; | 582 | int nid; |
583 | struct assoc_arrays aa; | 583 | struct assoc_arrays aa; |
584 | 584 | ||
@@ -586,8 +586,8 @@ static void __init parse_drconf_memory(struct device_node *memory) | |||
586 | if (!n) | 586 | if (!n) |
587 | return; | 587 | return; |
588 | 588 | ||
589 | memblock_size = of_get_memblock_size(memory); | 589 | lmb_size = of_get_lmb_size(memory); |
590 | if (!memblock_size) | 590 | if (!lmb_size) |
591 | return; | 591 | return; |
592 | 592 | ||
593 | rc = of_get_assoc_arrays(memory, &aa); | 593 | rc = of_get_assoc_arrays(memory, &aa); |
@@ -611,7 +611,7 @@ static void __init parse_drconf_memory(struct device_node *memory) | |||
611 | continue; | 611 | continue; |
612 | 612 | ||
613 | base = drmem.base_addr; | 613 | base = drmem.base_addr; |
614 | size = memblock_size; | 614 | size = lmb_size; |
615 | ranges = 1; | 615 | ranges = 1; |
616 | 616 | ||
617 | if (is_kexec_kdump) { | 617 | if (is_kexec_kdump) { |
@@ -1072,7 +1072,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory, | |||
1072 | { | 1072 | { |
1073 | const u32 *dm; | 1073 | const u32 *dm; |
1074 | unsigned int drconf_cell_cnt, rc; | 1074 | unsigned int drconf_cell_cnt, rc; |
1075 | unsigned long memblock_size; | 1075 | unsigned long lmb_size; |
1076 | struct assoc_arrays aa; | 1076 | struct assoc_arrays aa; |
1077 | int nid = -1; | 1077 | int nid = -1; |
1078 | 1078 | ||
@@ -1080,8 +1080,8 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory, | |||
1080 | if (!drconf_cell_cnt) | 1080 | if (!drconf_cell_cnt) |
1081 | return -1; | 1081 | return -1; |
1082 | 1082 | ||
1083 | memblock_size = of_get_memblock_size(memory); | 1083 | lmb_size = of_get_lmb_size(memory); |
1084 | if (!memblock_size) | 1084 | if (!lmb_size) |
1085 | return -1; | 1085 | return -1; |
1086 | 1086 | ||
1087 | rc = of_get_assoc_arrays(memory, &aa); | 1087 | rc = of_get_assoc_arrays(memory, &aa); |
@@ -1100,7 +1100,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory, | |||
1100 | continue; | 1100 | continue; |
1101 | 1101 | ||
1102 | if ((scn_addr < drmem.base_addr) | 1102 | if ((scn_addr < drmem.base_addr) |
1103 | || (scn_addr >= (drmem.base_addr + memblock_size))) | 1103 | || (scn_addr >= (drmem.base_addr + lmb_size))) |
1104 | continue; | 1104 | continue; |
1105 | 1105 | ||
1106 | nid = of_drconf_to_nid_single(&drmem, &aa); | 1106 | nid = of_drconf_to_nid_single(&drmem, &aa); |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index deab5f946090..bc8803664140 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -69,7 +69,7 @@ static int pseries_remove_memory(struct device_node *np) | |||
69 | const char *type; | 69 | const char *type; |
70 | const unsigned int *regs; | 70 | const unsigned int *regs; |
71 | unsigned long base; | 71 | unsigned long base; |
72 | unsigned int memblock_size; | 72 | unsigned int lmb_size; |
73 | int ret = -EINVAL; | 73 | int ret = -EINVAL; |
74 | 74 | ||
75 | /* | 75 | /* |
@@ -87,9 +87,9 @@ static int pseries_remove_memory(struct device_node *np) | |||
87 | return ret; | 87 | return ret; |
88 | 88 | ||
89 | base = *(unsigned long *)regs; | 89 | base = *(unsigned long *)regs; |
90 | memblock_size = regs[3]; | 90 | lmb_size = regs[3]; |
91 | 91 | ||
92 | ret = pseries_remove_memblock(base, memblock_size); | 92 | ret = pseries_remove_memblock(base, lmb_size); |
93 | return ret; | 93 | return ret; |
94 | } | 94 | } |
95 | 95 | ||
@@ -98,7 +98,7 @@ static int pseries_add_memory(struct device_node *np) | |||
98 | const char *type; | 98 | const char *type; |
99 | const unsigned int *regs; | 99 | const unsigned int *regs; |
100 | unsigned long base; | 100 | unsigned long base; |
101 | unsigned int memblock_size; | 101 | unsigned int lmb_size; |
102 | int ret = -EINVAL; | 102 | int ret = -EINVAL; |
103 | 103 | ||
104 | /* | 104 | /* |
@@ -116,36 +116,36 @@ static int pseries_add_memory(struct device_node *np) | |||
116 | return ret; | 116 | return ret; |
117 | 117 | ||
118 | base = *(unsigned long *)regs; | 118 | base = *(unsigned long *)regs; |
119 | memblock_size = regs[3]; | 119 | lmb_size = regs[3]; |
120 | 120 | ||
121 | /* | 121 | /* |
122 | * Update memory region to represent the memory add | 122 | * Update memory region to represent the memory add |
123 | */ | 123 | */ |
124 | ret = memblock_add(base, memblock_size); | 124 | ret = memblock_add(base, lmb_size); |
125 | return (ret < 0) ? -EINVAL : 0; | 125 | return (ret < 0) ? -EINVAL : 0; |
126 | } | 126 | } |
127 | 127 | ||
128 | static int pseries_drconf_memory(unsigned long *base, unsigned int action) | 128 | static int pseries_drconf_memory(unsigned long *base, unsigned int action) |
129 | { | 129 | { |
130 | struct device_node *np; | 130 | struct device_node *np; |
131 | const unsigned long *memblock_size; | 131 | const unsigned long *lmb_size; |
132 | int rc; | 132 | int rc; |
133 | 133 | ||
134 | np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); | 134 | np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); |
135 | if (!np) | 135 | if (!np) |
136 | return -EINVAL; | 136 | return -EINVAL; |
137 | 137 | ||
138 | memblock_size = of_get_property(np, "ibm,memblock-size", NULL); | 138 | lmb_size = of_get_property(np, "ibm,lmb-size", NULL); |
139 | if (!memblock_size) { | 139 | if (!lmb_size) { |
140 | of_node_put(np); | 140 | of_node_put(np); |
141 | return -EINVAL; | 141 | return -EINVAL; |
142 | } | 142 | } |
143 | 143 | ||
144 | if (action == PSERIES_DRCONF_MEM_ADD) { | 144 | if (action == PSERIES_DRCONF_MEM_ADD) { |
145 | rc = memblock_add(*base, *memblock_size); | 145 | rc = memblock_add(*base, *lmb_size); |
146 | rc = (rc < 0) ? -EINVAL : 0; | 146 | rc = (rc < 0) ? -EINVAL : 0; |
147 | } else if (action == PSERIES_DRCONF_MEM_REMOVE) { | 147 | } else if (action == PSERIES_DRCONF_MEM_REMOVE) { |
148 | rc = pseries_remove_memblock(*base, *memblock_size); | 148 | rc = pseries_remove_memblock(*base, *lmb_size); |
149 | } else { | 149 | } else { |
150 | rc = -EINVAL; | 150 | rc = -EINVAL; |
151 | } | 151 | } |
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h index 8859e12dd3cf..c1cf59d72f09 100644 --- a/arch/x86/include/asm/cmpxchg_32.h +++ b/arch/x86/include/asm/cmpxchg_32.h | |||
@@ -27,20 +27,20 @@ struct __xchg_dummy { | |||
27 | switch (size) { \ | 27 | switch (size) { \ |
28 | case 1: \ | 28 | case 1: \ |
29 | asm volatile("xchgb %b0,%1" \ | 29 | asm volatile("xchgb %b0,%1" \ |
30 | : "=q" (__x) \ | 30 | : "=q" (__x), "+m" (*__xg(ptr)) \ |
31 | : "m" (*__xg(ptr)), "0" (__x) \ | 31 | : "0" (__x) \ |
32 | : "memory"); \ | 32 | : "memory"); \ |
33 | break; \ | 33 | break; \ |
34 | case 2: \ | 34 | case 2: \ |
35 | asm volatile("xchgw %w0,%1" \ | 35 | asm volatile("xchgw %w0,%1" \ |
36 | : "=r" (__x) \ | 36 | : "=r" (__x), "+m" (*__xg(ptr)) \ |
37 | : "m" (*__xg(ptr)), "0" (__x) \ | 37 | : "0" (__x) \ |
38 | : "memory"); \ | 38 | : "memory"); \ |
39 | break; \ | 39 | break; \ |
40 | case 4: \ | 40 | case 4: \ |
41 | asm volatile("xchgl %0,%1" \ | 41 | asm volatile("xchgl %0,%1" \ |
42 | : "=r" (__x) \ | 42 | : "=r" (__x), "+m" (*__xg(ptr)) \ |
43 | : "m" (*__xg(ptr)), "0" (__x) \ | 43 | : "0" (__x) \ |
44 | : "memory"); \ | 44 | : "memory"); \ |
45 | break; \ | 45 | break; \ |
46 | default: \ | 46 | default: \ |
@@ -70,14 +70,14 @@ static inline void __set_64bit(unsigned long long *ptr, | |||
70 | unsigned int low, unsigned int high) | 70 | unsigned int low, unsigned int high) |
71 | { | 71 | { |
72 | asm volatile("\n1:\t" | 72 | asm volatile("\n1:\t" |
73 | "movl (%0), %%eax\n\t" | 73 | "movl (%1), %%eax\n\t" |
74 | "movl 4(%0), %%edx\n\t" | 74 | "movl 4(%1), %%edx\n\t" |
75 | LOCK_PREFIX "cmpxchg8b (%0)\n\t" | 75 | LOCK_PREFIX "cmpxchg8b (%1)\n\t" |
76 | "jnz 1b" | 76 | "jnz 1b" |
77 | : /* no outputs */ | 77 | : "=m" (*ptr) |
78 | : "D"(ptr), | 78 | : "D" (ptr), |
79 | "b"(low), | 79 | "b" (low), |
80 | "c"(high) | 80 | "c" (high) |
81 | : "ax", "dx", "memory"); | 81 | : "ax", "dx", "memory"); |
82 | } | 82 | } |
83 | 83 | ||
@@ -121,21 +121,21 @@ extern void __cmpxchg_wrong_size(void); | |||
121 | __typeof__(*(ptr)) __new = (new); \ | 121 | __typeof__(*(ptr)) __new = (new); \ |
122 | switch (size) { \ | 122 | switch (size) { \ |
123 | case 1: \ | 123 | case 1: \ |
124 | asm volatile(lock "cmpxchgb %b1,%2" \ | 124 | asm volatile(lock "cmpxchgb %b2,%1" \ |
125 | : "=a"(__ret) \ | 125 | : "=a" (__ret), "+m" (*__xg(ptr)) \ |
126 | : "q"(__new), "m"(*__xg(ptr)), "0"(__old) \ | 126 | : "q" (__new), "0" (__old) \ |
127 | : "memory"); \ | 127 | : "memory"); \ |
128 | break; \ | 128 | break; \ |
129 | case 2: \ | 129 | case 2: \ |
130 | asm volatile(lock "cmpxchgw %w1,%2" \ | 130 | asm volatile(lock "cmpxchgw %w2,%1" \ |
131 | : "=a"(__ret) \ | 131 | : "=a" (__ret), "+m" (*__xg(ptr)) \ |
132 | : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \ | 132 | : "r" (__new), "0" (__old) \ |
133 | : "memory"); \ | 133 | : "memory"); \ |
134 | break; \ | 134 | break; \ |
135 | case 4: \ | 135 | case 4: \ |
136 | asm volatile(lock "cmpxchgl %1,%2" \ | 136 | asm volatile(lock "cmpxchgl %2,%1" \ |
137 | : "=a"(__ret) \ | 137 | : "=a" (__ret), "+m" (*__xg(ptr)) \ |
138 | : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \ | 138 | : "r" (__new), "0" (__old) \ |
139 | : "memory"); \ | 139 | : "memory"); \ |
140 | break; \ | 140 | break; \ |
141 | default: \ | 141 | default: \ |
@@ -180,12 +180,12 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, | |||
180 | unsigned long long new) | 180 | unsigned long long new) |
181 | { | 181 | { |
182 | unsigned long long prev; | 182 | unsigned long long prev; |
183 | asm volatile(LOCK_PREFIX "cmpxchg8b %3" | 183 | asm volatile(LOCK_PREFIX "cmpxchg8b %1" |
184 | : "=A"(prev) | 184 | : "=A" (prev), |
185 | : "b"((unsigned long)new), | 185 | "+m" (*__xg(ptr)) |
186 | "c"((unsigned long)(new >> 32)), | 186 | : "b" ((unsigned long)new), |
187 | "m"(*__xg(ptr)), | 187 | "c" ((unsigned long)(new >> 32)), |
188 | "0"(old) | 188 | "0" (old) |
189 | : "memory"); | 189 | : "memory"); |
190 | return prev; | 190 | return prev; |
191 | } | 191 | } |
@@ -195,12 +195,12 @@ static inline unsigned long long __cmpxchg64_local(volatile void *ptr, | |||
195 | unsigned long long new) | 195 | unsigned long long new) |
196 | { | 196 | { |
197 | unsigned long long prev; | 197 | unsigned long long prev; |
198 | asm volatile("cmpxchg8b %3" | 198 | asm volatile("cmpxchg8b %1" |
199 | : "=A"(prev) | 199 | : "=A" (prev), |
200 | : "b"((unsigned long)new), | 200 | "+m" (*__xg(ptr)) |
201 | "c"((unsigned long)(new >> 32)), | 201 | : "b" ((unsigned long)new), |
202 | "m"(*__xg(ptr)), | 202 | "c" ((unsigned long)(new >> 32)), |
203 | "0"(old) | 203 | "0" (old) |
204 | : "memory"); | 204 | : "memory"); |
205 | return prev; | 205 | return prev; |
206 | } | 206 | } |
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h index 485ae415faec..b92f147339f3 100644 --- a/arch/x86/include/asm/cmpxchg_64.h +++ b/arch/x86/include/asm/cmpxchg_64.h | |||
@@ -26,26 +26,26 @@ extern void __cmpxchg_wrong_size(void); | |||
26 | switch (size) { \ | 26 | switch (size) { \ |
27 | case 1: \ | 27 | case 1: \ |
28 | asm volatile("xchgb %b0,%1" \ | 28 | asm volatile("xchgb %b0,%1" \ |
29 | : "=q" (__x) \ | 29 | : "=q" (__x), "+m" (*__xg(ptr)) \ |
30 | : "m" (*__xg(ptr)), "0" (__x) \ | 30 | : "0" (__x) \ |
31 | : "memory"); \ | 31 | : "memory"); \ |
32 | break; \ | 32 | break; \ |
33 | case 2: \ | 33 | case 2: \ |
34 | asm volatile("xchgw %w0,%1" \ | 34 | asm volatile("xchgw %w0,%1" \ |
35 | : "=r" (__x) \ | 35 | : "=r" (__x), "+m" (*__xg(ptr)) \ |
36 | : "m" (*__xg(ptr)), "0" (__x) \ | 36 | : "0" (__x) \ |
37 | : "memory"); \ | 37 | : "memory"); \ |
38 | break; \ | 38 | break; \ |
39 | case 4: \ | 39 | case 4: \ |
40 | asm volatile("xchgl %k0,%1" \ | 40 | asm volatile("xchgl %k0,%1" \ |
41 | : "=r" (__x) \ | 41 | : "=r" (__x), "+m" (*__xg(ptr)) \ |
42 | : "m" (*__xg(ptr)), "0" (__x) \ | 42 | : "0" (__x) \ |
43 | : "memory"); \ | 43 | : "memory"); \ |
44 | break; \ | 44 | break; \ |
45 | case 8: \ | 45 | case 8: \ |
46 | asm volatile("xchgq %0,%1" \ | 46 | asm volatile("xchgq %0,%1" \ |
47 | : "=r" (__x) \ | 47 | : "=r" (__x), "+m" (*__xg(ptr)) \ |
48 | : "m" (*__xg(ptr)), "0" (__x) \ | 48 | : "0" (__x) \ |
49 | : "memory"); \ | 49 | : "memory"); \ |
50 | break; \ | 50 | break; \ |
51 | default: \ | 51 | default: \ |
@@ -71,27 +71,27 @@ extern void __cmpxchg_wrong_size(void); | |||
71 | __typeof__(*(ptr)) __new = (new); \ | 71 | __typeof__(*(ptr)) __new = (new); \ |
72 | switch (size) { \ | 72 | switch (size) { \ |
73 | case 1: \ | 73 | case 1: \ |
74 | asm volatile(lock "cmpxchgb %b1,%2" \ | 74 | asm volatile(lock "cmpxchgb %b2,%1" \ |
75 | : "=a"(__ret) \ | 75 | : "=a" (__ret), "+m" (*__xg(ptr)) \ |
76 | : "q"(__new), "m"(*__xg(ptr)), "0"(__old) \ | 76 | : "q" (__new), "0" (__old) \ |
77 | : "memory"); \ | 77 | : "memory"); \ |
78 | break; \ | 78 | break; \ |
79 | case 2: \ | 79 | case 2: \ |
80 | asm volatile(lock "cmpxchgw %w1,%2" \ | 80 | asm volatile(lock "cmpxchgw %w2,%1" \ |
81 | : "=a"(__ret) \ | 81 | : "=a" (__ret), "+m" (*__xg(ptr)) \ |
82 | : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \ | 82 | : "r" (__new), "0" (__old) \ |
83 | : "memory"); \ | 83 | : "memory"); \ |
84 | break; \ | 84 | break; \ |
85 | case 4: \ | 85 | case 4: \ |
86 | asm volatile(lock "cmpxchgl %k1,%2" \ | 86 | asm volatile(lock "cmpxchgl %k2,%1" \ |
87 | : "=a"(__ret) \ | 87 | : "=a" (__ret), "+m" (*__xg(ptr)) \ |
88 | : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \ | 88 | : "r" (__new), "0" (__old) \ |
89 | : "memory"); \ | 89 | : "memory"); \ |
90 | break; \ | 90 | break; \ |
91 | case 8: \ | 91 | case 8: \ |
92 | asm volatile(lock "cmpxchgq %1,%2" \ | 92 | asm volatile(lock "cmpxchgq %2,%1" \ |
93 | : "=a"(__ret) \ | 93 | : "=a" (__ret), "+m" (*__xg(ptr)) \ |
94 | : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \ | 94 | : "r" (__new), "0" (__old) \ |
95 | : "memory"); \ | 95 | : "memory"); \ |
96 | break; \ | 96 | break; \ |
97 | default: \ | 97 | default: \ |
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 2e837f5080fe..fb7a5f052e2b 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, | |||
145 | percpu_entry->states[cx->index].eax = cx->address; | 145 | percpu_entry->states[cx->index].eax = cx->address; |
146 | percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; | 146 | percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; |
147 | } | 147 | } |
148 | |||
149 | /* | ||
150 | * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared, | ||
151 | * then we should skip checking BM_STS for this C-state. | ||
152 | * ref: "Intel Processor Vendor-Specific ACPI Interface Specification" | ||
153 | */ | ||
154 | if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2)) | ||
155 | cx->bm_sts_skip = 1; | ||
156 | |||
148 | return retval; | 157 | return retval; |
149 | } | 158 | } |
150 | EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); | 159 | EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); |
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 82e508677b91..fcc3c61fdecc 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -157,9 +157,14 @@ static int __init acpi_sleep_setup(char *str) | |||
157 | #ifdef CONFIG_HIBERNATION | 157 | #ifdef CONFIG_HIBERNATION |
158 | if (strncmp(str, "s4_nohwsig", 10) == 0) | 158 | if (strncmp(str, "s4_nohwsig", 10) == 0) |
159 | acpi_no_s4_hw_signature(); | 159 | acpi_no_s4_hw_signature(); |
160 | if (strncmp(str, "s4_nonvs", 8) == 0) | 160 | if (strncmp(str, "s4_nonvs", 8) == 0) { |
161 | acpi_s4_no_nvs(); | 161 | pr_warning("ACPI: acpi_sleep=s4_nonvs is deprecated, " |
162 | "please use acpi_sleep=nonvs instead"); | ||
163 | acpi_nvs_nosave(); | ||
164 | } | ||
162 | #endif | 165 | #endif |
166 | if (strncmp(str, "nonvs", 5) == 0) | ||
167 | acpi_nvs_nosave(); | ||
163 | if (strncmp(str, "old_ordering", 12) == 0) | 168 | if (strncmp(str, "old_ordering", 12) == 0) |
164 | acpi_old_suspend_ordering(); | 169 | acpi_old_suspend_ordering(); |
165 | str = strchr(str, ','); | 170 | str = strchr(str, ','); |
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index ce7cde713e71..a36de5bbb622 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c | |||
@@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle) | |||
368 | return -ENODEV; | 368 | return -ENODEV; |
369 | 369 | ||
370 | out_obj = output.pointer; | 370 | out_obj = output.pointer; |
371 | if (out_obj->type != ACPI_TYPE_BUFFER) { | 371 | if (out_obj->type != ACPI_TYPE_BUFFER) |
372 | ret = -ENODEV; | 372 | return -ENODEV; |
373 | goto out_free; | ||
374 | } | ||
375 | 373 | ||
376 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); | 374 | errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0); |
377 | if (errors) { | 375 | if (errors) |
378 | ret = -ENODEV; | 376 | return -ENODEV; |
379 | goto out_free; | ||
380 | } | ||
381 | 377 | ||
382 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); | 378 | supported = *((u32 *)(out_obj->buffer.pointer + 4)); |
383 | if (!(supported & 0x1)) { | 379 | if (!(supported & 0x1)) |
384 | ret = -ENODEV; | 380 | return -ENODEV; |
385 | goto out_free; | ||
386 | } | ||
387 | 381 | ||
388 | out_free: | 382 | out_free: |
389 | kfree(output.pointer); | 383 | kfree(output.pointer); |
@@ -397,13 +391,17 @@ static int __init pcc_cpufreq_probe(void) | |||
397 | struct pcc_memory_resource *mem_resource; | 391 | struct pcc_memory_resource *mem_resource; |
398 | struct pcc_register_resource *reg_resource; | 392 | struct pcc_register_resource *reg_resource; |
399 | union acpi_object *out_obj, *member; | 393 | union acpi_object *out_obj, *member; |
400 | acpi_handle handle, osc_handle; | 394 | acpi_handle handle, osc_handle, pcch_handle; |
401 | int ret = 0; | 395 | int ret = 0; |
402 | 396 | ||
403 | status = acpi_get_handle(NULL, "\\_SB", &handle); | 397 | status = acpi_get_handle(NULL, "\\_SB", &handle); |
404 | if (ACPI_FAILURE(status)) | 398 | if (ACPI_FAILURE(status)) |
405 | return -ENODEV; | 399 | return -ENODEV; |
406 | 400 | ||
401 | status = acpi_get_handle(handle, "PCCH", &pcch_handle); | ||
402 | if (ACPI_FAILURE(status)) | ||
403 | return -ENODEV; | ||
404 | |||
407 | status = acpi_get_handle(handle, "_OSC", &osc_handle); | 405 | status = acpi_get_handle(handle, "_OSC", &osc_handle); |
408 | if (ACPI_SUCCESS(status)) { | 406 | if (ACPI_SUCCESS(status)) { |
409 | ret = pcc_cpufreq_do_osc(&osc_handle); | 407 | ret = pcc_cpufreq_do_osc(&osc_handle); |
@@ -543,13 +541,13 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
543 | 541 | ||
544 | if (!pcch_virt_addr) { | 542 | if (!pcch_virt_addr) { |
545 | result = -1; | 543 | result = -1; |
546 | goto pcch_null; | 544 | goto out; |
547 | } | 545 | } |
548 | 546 | ||
549 | result = pcc_get_offset(cpu); | 547 | result = pcc_get_offset(cpu); |
550 | if (result) { | 548 | if (result) { |
551 | dprintk("init: PCCP evaluation failed\n"); | 549 | dprintk("init: PCCP evaluation failed\n"); |
552 | goto free; | 550 | goto out; |
553 | } | 551 | } |
554 | 552 | ||
555 | policy->max = policy->cpuinfo.max_freq = | 553 | policy->max = policy->cpuinfo.max_freq = |
@@ -558,14 +556,15 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
558 | ioread32(&pcch_hdr->minimum_frequency) * 1000; | 556 | ioread32(&pcch_hdr->minimum_frequency) * 1000; |
559 | policy->cur = pcc_get_freq(cpu); | 557 | policy->cur = pcc_get_freq(cpu); |
560 | 558 | ||
559 | if (!policy->cur) { | ||
560 | dprintk("init: Unable to get current CPU frequency\n"); | ||
561 | result = -EINVAL; | ||
562 | goto out; | ||
563 | } | ||
564 | |||
561 | dprintk("init: policy->max is %d, policy->min is %d\n", | 565 | dprintk("init: policy->max is %d, policy->min is %d\n", |
562 | policy->max, policy->min); | 566 | policy->max, policy->min); |
563 | 567 | out: | |
564 | return 0; | ||
565 | free: | ||
566 | pcc_clear_mapping(); | ||
567 | free_percpu(pcc_cpu_info); | ||
568 | pcch_null: | ||
569 | return result; | 568 | return result; |
570 | } | 569 | } |
571 | 570 | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 7ec2123838e6..3e90cce3dc8b 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -1023,13 +1023,12 @@ static int get_transition_latency(struct powernow_k8_data *data) | |||
1023 | } | 1023 | } |
1024 | if (max_latency == 0) { | 1024 | if (max_latency == 0) { |
1025 | /* | 1025 | /* |
1026 | * Fam 11h always returns 0 as transition latency. | 1026 | * Fam 11h and later may return 0 as transition latency. This |
1027 | * This is intended and means "very fast". While cpufreq core | 1027 | * is intended and means "very fast". While cpufreq core and |
1028 | * and governors currently can handle that gracefully, better | 1028 | * governors currently can handle that gracefully, better set it |
1029 | * set it to 1 to avoid problems in the future. | 1029 | * to 1 to avoid problems in the future. |
1030 | * For all others it's a BIOS bug. | ||
1031 | */ | 1030 | */ |
1032 | if (boot_cpu_data.x86 != 0x11) | 1031 | if (boot_cpu_data.x86 < 0x11) |
1033 | printk(KERN_ERR FW_WARN PFX "Invalid zero transition " | 1032 | printk(KERN_ERR FW_WARN PFX "Invalid zero transition " |
1034 | "latency\n"); | 1033 | "latency\n"); |
1035 | max_latency = 1; | 1034 | max_latency = 1; |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 0697ff139837..4db7c4d12ffa 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -571,8 +571,8 @@ auditsys: | |||
571 | * masked off. | 571 | * masked off. |
572 | */ | 572 | */ |
573 | sysret_audit: | 573 | sysret_audit: |
574 | movq %rax,%rsi /* second arg, syscall return value */ | 574 | movq RAX-ARGOFFSET(%rsp),%rsi /* second arg, syscall return value */ |
575 | cmpq $0,%rax /* is it < 0? */ | 575 | cmpq $0,%rsi /* is it < 0? */ |
576 | setl %al /* 1 if so, 0 if not */ | 576 | setl %al /* 1 if so, 0 if not */ |
577 | movzbl %al,%edi /* zero-extend that into %edi */ | 577 | movzbl %al,%edi /* zero-extend that into %edi */ |
578 | inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */ | 578 | inc %edi /* first arg, 0->1(AUDITSC_SUCCESS), 1->2(AUDITSC_FAILURE) */ |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index a198b7c87a12..ba390d731175 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -964,7 +964,7 @@ fs_initcall(hpet_late_init); | |||
964 | 964 | ||
965 | void hpet_disable(void) | 965 | void hpet_disable(void) |
966 | { | 966 | { |
967 | if (is_hpet_capable()) { | 967 | if (is_hpet_capable() && hpet_virt_address) { |
968 | unsigned int cfg = hpet_readl(HPET_CFG); | 968 | unsigned int cfg = hpet_readl(HPET_CFG); |
969 | 969 | ||
970 | if (hpet_legacy_int_enabled) { | 970 | if (hpet_legacy_int_enabled) { |
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index 7c9f02c130f3..cafa7c80ac95 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c | |||
@@ -276,16 +276,6 @@ static struct sys_device device_i8259A = { | |||
276 | .cls = &i8259_sysdev_class, | 276 | .cls = &i8259_sysdev_class, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | static int __init i8259A_init_sysfs(void) | ||
280 | { | ||
281 | int error = sysdev_class_register(&i8259_sysdev_class); | ||
282 | if (!error) | ||
283 | error = sysdev_register(&device_i8259A); | ||
284 | return error; | ||
285 | } | ||
286 | |||
287 | device_initcall(i8259A_init_sysfs); | ||
288 | |||
289 | static void mask_8259A(void) | 279 | static void mask_8259A(void) |
290 | { | 280 | { |
291 | unsigned long flags; | 281 | unsigned long flags; |
@@ -407,3 +397,18 @@ struct legacy_pic default_legacy_pic = { | |||
407 | }; | 397 | }; |
408 | 398 | ||
409 | struct legacy_pic *legacy_pic = &default_legacy_pic; | 399 | struct legacy_pic *legacy_pic = &default_legacy_pic; |
400 | |||
401 | static int __init i8259A_init_sysfs(void) | ||
402 | { | ||
403 | int error; | ||
404 | |||
405 | if (legacy_pic != &default_legacy_pic) | ||
406 | return 0; | ||
407 | |||
408 | error = sysdev_class_register(&i8259_sysdev_class); | ||
409 | if (!error) | ||
410 | error = sysdev_register(&device_i8259A); | ||
411 | return error; | ||
412 | } | ||
413 | |||
414 | device_initcall(i8259A_init_sysfs); | ||
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 89d66ca4d87c..2331bdc2b549 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -342,6 +342,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
342 | /* advance table_gfn when emulating 1gb pages with 4k */ | 342 | /* advance table_gfn when emulating 1gb pages with 4k */ |
343 | if (delta == 0) | 343 | if (delta == 0) |
344 | table_gfn += PT_INDEX(addr, level); | 344 | table_gfn += PT_INDEX(addr, level); |
345 | access &= gw->pte_access; | ||
345 | } else { | 346 | } else { |
346 | direct = 0; | 347 | direct = 0; |
347 | table_gfn = gw->table_gfn[level - 2]; | 348 | table_gfn = gw->table_gfn[level - 2]; |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6127468ebbd2..33f0a84cfd93 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1562,7 +1562,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, | |||
1562 | 1562 | ||
1563 | r = -ENOMEM; | 1563 | r = -ENOMEM; |
1564 | size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; | 1564 | size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; |
1565 | entries = vmalloc(size); | 1565 | entries = kmalloc(size, GFP_KERNEL); |
1566 | if (!entries) | 1566 | if (!entries) |
1567 | goto out; | 1567 | goto out; |
1568 | 1568 | ||
@@ -1581,7 +1581,7 @@ static int msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs __user *user_msrs, | |||
1581 | r = n; | 1581 | r = n; |
1582 | 1582 | ||
1583 | out_free: | 1583 | out_free: |
1584 | vfree(entries); | 1584 | kfree(entries); |
1585 | out: | 1585 | out: |
1586 | return r; | 1586 | return r; |
1587 | } | 1587 | } |