diff options
Diffstat (limited to 'arch')
32 files changed, 164 insertions, 53 deletions
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c index db8309161408..780bbf7cb26f 100644 --- a/arch/arm/common/sharpsl_pm.c +++ b/arch/arm/common/sharpsl_pm.c | |||
@@ -54,11 +54,13 @@ | |||
54 | /* | 54 | /* |
55 | * Prototypes | 55 | * Prototypes |
56 | */ | 56 | */ |
57 | #ifdef CONFIG_PM | ||
57 | static int sharpsl_off_charge_battery(void); | 58 | static int sharpsl_off_charge_battery(void); |
58 | static int sharpsl_check_battery_temp(void); | ||
59 | static int sharpsl_check_battery_voltage(void); | 59 | static int sharpsl_check_battery_voltage(void); |
60 | static int sharpsl_ac_check(void); | ||
61 | static int sharpsl_fatal_check(void); | 60 | static int sharpsl_fatal_check(void); |
61 | #endif | ||
62 | static int sharpsl_check_battery_temp(void); | ||
63 | static int sharpsl_ac_check(void); | ||
62 | static int sharpsl_average_value(int ad); | 64 | static int sharpsl_average_value(int ad); |
63 | static void sharpsl_average_clear(void); | 65 | static void sharpsl_average_clear(void); |
64 | static void sharpsl_charge_toggle(struct work_struct *private_); | 66 | static void sharpsl_charge_toggle(struct work_struct *private_); |
@@ -424,6 +426,7 @@ static int sharpsl_check_battery_temp(void) | |||
424 | return 0; | 426 | return 0; |
425 | } | 427 | } |
426 | 428 | ||
429 | #ifdef CONFIG_PM | ||
427 | static int sharpsl_check_battery_voltage(void) | 430 | static int sharpsl_check_battery_voltage(void) |
428 | { | 431 | { |
429 | int val, i, buff[5]; | 432 | int val, i, buff[5]; |
@@ -455,6 +458,7 @@ static int sharpsl_check_battery_voltage(void) | |||
455 | 458 | ||
456 | return 0; | 459 | return 0; |
457 | } | 460 | } |
461 | #endif | ||
458 | 462 | ||
459 | static int sharpsl_ac_check(void) | 463 | static int sharpsl_ac_check(void) |
460 | { | 464 | { |
@@ -586,8 +590,6 @@ static int corgi_pxa_pm_enter(suspend_state_t state) | |||
586 | 590 | ||
587 | return 0; | 591 | return 0; |
588 | } | 592 | } |
589 | #endif | ||
590 | |||
591 | 593 | ||
592 | /* | 594 | /* |
593 | * Check for fatal battery errors | 595 | * Check for fatal battery errors |
@@ -738,7 +740,10 @@ static int sharpsl_off_charge_battery(void) | |||
738 | } | 740 | } |
739 | } | 741 | } |
740 | } | 742 | } |
741 | 743 | #else | |
744 | #define sharpsl_pm_suspend NULL | ||
745 | #define sharpsl_pm_resume NULL | ||
746 | #endif | ||
742 | 747 | ||
743 | static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf) | 748 | static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf) |
744 | { | 749 | { |
@@ -768,10 +773,12 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info) | |||
768 | info->battery_life = sharpsl_pm.battstat.mainbat_percent; | 773 | info->battery_life = sharpsl_pm.battstat.mainbat_percent; |
769 | } | 774 | } |
770 | 775 | ||
776 | #ifdef CONFIG_PM | ||
771 | static struct platform_suspend_ops sharpsl_pm_ops = { | 777 | static struct platform_suspend_ops sharpsl_pm_ops = { |
772 | .enter = corgi_pxa_pm_enter, | 778 | .enter = corgi_pxa_pm_enter, |
773 | .valid = suspend_valid_only_mem, | 779 | .valid = suspend_valid_only_mem, |
774 | }; | 780 | }; |
781 | #endif | ||
775 | 782 | ||
776 | static int __init sharpsl_pm_probe(struct platform_device *pdev) | 783 | static int __init sharpsl_pm_probe(struct platform_device *pdev) |
777 | { | 784 | { |
@@ -802,7 +809,9 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev) | |||
802 | 809 | ||
803 | apm_get_power_status = sharpsl_apm_get_power_status; | 810 | apm_get_power_status = sharpsl_apm_get_power_status; |
804 | 811 | ||
812 | #ifdef CONFIG_PM | ||
805 | suspend_set_ops(&sharpsl_pm_ops); | 813 | suspend_set_ops(&sharpsl_pm_ops); |
814 | #endif | ||
806 | 815 | ||
807 | mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250)); | 816 | mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250)); |
808 | 817 | ||
diff --git a/arch/arm/mach-at91/board-afeb-9260v1.c b/arch/arm/mach-at91/board-afeb-9260v1.c index 9c040c78889a..e263fda3e2d1 100644 --- a/arch/arm/mach-at91/board-afeb-9260v1.c +++ b/arch/arm/mach-at91/board-afeb-9260v1.c | |||
@@ -165,6 +165,7 @@ static struct at91_mmc_data __initdata afeb9260_mmc_data = { | |||
165 | static struct i2c_board_info __initdata afeb9260_i2c_devices[] = { | 165 | static struct i2c_board_info __initdata afeb9260_i2c_devices[] = { |
166 | { | 166 | { |
167 | I2C_BOARD_INFO("fm3130", 0x68), | 167 | I2C_BOARD_INFO("fm3130", 0x68), |
168 | }, { | ||
168 | I2C_BOARD_INFO("24c64", 0x50), | 169 | I2C_BOARD_INFO("24c64", 0x50), |
169 | }, | 170 | }, |
170 | }; | 171 | }; |
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h index 76d76e2fa69e..bffa6741a751 100644 --- a/arch/arm/mach-at91/include/mach/gpio.h +++ b/arch/arm/mach-at91/include/mach/gpio.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifndef __ASM_ARCH_AT91RM9200_GPIO_H | 13 | #ifndef __ASM_ARCH_AT91RM9200_GPIO_H |
14 | #define __ASM_ARCH_AT91RM9200_GPIO_H | 14 | #define __ASM_ARCH_AT91RM9200_GPIO_H |
15 | 15 | ||
16 | #include <linux/kernel.h> | ||
16 | #include <asm/irq.h> | 17 | #include <asm/irq.h> |
17 | 18 | ||
18 | #define PIN_BASE NR_AIC_IRQS | 19 | #define PIN_BASE NR_AIC_IRQS |
@@ -220,6 +221,7 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
220 | 221 | ||
221 | static inline void gpio_free(unsigned gpio) | 222 | static inline void gpio_free(unsigned gpio) |
222 | { | 223 | { |
224 | might_sleep(); | ||
223 | } | 225 | } |
224 | 226 | ||
225 | extern int gpio_direction_input(unsigned gpio); | 227 | extern int gpio_direction_input(unsigned gpio); |
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index de53f0be71b9..48345fb34613 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/serial_core.h> | 26 | #include <linux/serial_core.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/dma-mapping.h> | ||
29 | #include <linux/time.h> | 30 | #include <linux/time.h> |
30 | #include <linux/timex.h> | 31 | #include <linux/timex.h> |
31 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
@@ -449,12 +450,13 @@ static struct resource ep93xx_ohci_resources[] = { | |||
449 | }, | 450 | }, |
450 | }; | 451 | }; |
451 | 452 | ||
453 | |||
452 | static struct platform_device ep93xx_ohci_device = { | 454 | static struct platform_device ep93xx_ohci_device = { |
453 | .name = "ep93xx-ohci", | 455 | .name = "ep93xx-ohci", |
454 | .id = -1, | 456 | .id = -1, |
455 | .dev = { | 457 | .dev = { |
456 | .dma_mask = (void *)0xffffffff, | 458 | .dma_mask = &ep93xx_ohci_device.dev.coherent_dma_mask, |
457 | .coherent_dma_mask = 0xffffffff, | 459 | .coherent_dma_mask = DMA_BIT_MASK(32), |
458 | }, | 460 | }, |
459 | .num_resources = ARRAY_SIZE(ep93xx_ohci_resources), | 461 | .num_resources = ARRAY_SIZE(ep93xx_ohci_resources), |
460 | .resource = ep93xx_ohci_resources, | 462 | .resource = ep93xx_ohci_resources, |
diff --git a/arch/arm/mach-imx/include/mach/gpio.h b/arch/arm/mach-imx/include/mach/gpio.h index 6e3d795f2264..502d5aa2c093 100644 --- a/arch/arm/mach-imx/include/mach/gpio.h +++ b/arch/arm/mach-imx/include/mach/gpio.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #ifndef _IMX_GPIO_H | 1 | #ifndef _IMX_GPIO_H |
2 | 2 | ||
3 | #include <linux/kernel.h> | ||
3 | #include <mach/imx-regs.h> | 4 | #include <mach/imx-regs.h> |
4 | 5 | ||
5 | #define IMX_GPIO_ALLOC_MODE_NORMAL 0 | 6 | #define IMX_GPIO_ALLOC_MODE_NORMAL 0 |
@@ -63,6 +64,8 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
63 | 64 | ||
64 | static inline void gpio_free(unsigned gpio) | 65 | static inline void gpio_free(unsigned gpio) |
65 | { | 66 | { |
67 | might_sleep(); | ||
68 | |||
66 | imx_gpio_free(gpio); | 69 | imx_gpio_free(gpio); |
67 | } | 70 | } |
68 | 71 | ||
diff --git a/arch/arm/mach-ixp4xx/include/mach/gpio.h b/arch/arm/mach-ixp4xx/include/mach/gpio.h index 9fbde177920f..cd5aec26c072 100644 --- a/arch/arm/mach-ixp4xx/include/mach/gpio.h +++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #ifndef __ASM_ARCH_IXP4XX_GPIO_H | 25 | #ifndef __ASM_ARCH_IXP4XX_GPIO_H |
26 | #define __ASM_ARCH_IXP4XX_GPIO_H | 26 | #define __ASM_ARCH_IXP4XX_GPIO_H |
27 | 27 | ||
28 | #include <linux/kernel.h> | ||
28 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
29 | 30 | ||
30 | static inline int gpio_request(unsigned gpio, const char *label) | 31 | static inline int gpio_request(unsigned gpio, const char *label) |
@@ -34,6 +35,8 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
34 | 35 | ||
35 | static inline void gpio_free(unsigned gpio) | 36 | static inline void gpio_free(unsigned gpio) |
36 | { | 37 | { |
38 | might_sleep(); | ||
39 | |||
37 | return; | 40 | return; |
38 | } | 41 | } |
39 | 42 | ||
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index 73c84168761c..d4af5c335f16 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARCH_GPIO_H_ | 11 | #ifndef __ASM_ARCH_GPIO_H_ |
12 | #define __ASM_ARCH_GPIO_H_ | 12 | #define __ASM_ARCH_GPIO_H_ |
13 | 13 | ||
14 | #include <linux/kernel.h> | ||
15 | |||
14 | #define KS8695_GPIO_0 0 | 16 | #define KS8695_GPIO_0 0 |
15 | #define KS8695_GPIO_1 1 | 17 | #define KS8695_GPIO_1 1 |
16 | #define KS8695_GPIO_2 2 | 18 | #define KS8695_GPIO_2 2 |
@@ -74,6 +76,7 @@ static inline int gpio_request(unsigned int pin, const char *label) | |||
74 | 76 | ||
75 | static inline void gpio_free(unsigned int pin) | 77 | static inline void gpio_free(unsigned int pin) |
76 | { | 78 | { |
79 | might_sleep(); | ||
77 | } | 80 | } |
78 | 81 | ||
79 | #endif | 82 | #endif |
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mx31ads.c index 1be4a390c63f..f902a7c37c31 100644 --- a/arch/arm/mach-mx3/mx31ads.c +++ b/arch/arm/mach-mx3/mx31ads.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include <mach/imx-uart.h> | 35 | #include <mach/imx-uart.h> |
36 | #include <mach/iomux-mx3.h> | 36 | #include <mach/iomux-mx3.h> |
37 | 37 | ||
38 | #include "devices.h" | ||
39 | |||
38 | /*! | 40 | /*! |
39 | * @file mx31ads.c | 41 | * @file mx31ads.c |
40 | * | 42 | * |
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c index 11fda95c86a5..843f68c8ead1 100644 --- a/arch/arm/mach-mx3/pcm037.c +++ b/arch/arm/mach-mx3/pcm037.c | |||
@@ -91,12 +91,12 @@ static struct map_desc pcm037_io_desc[] __initdata = { | |||
91 | .virtual = AIPS1_BASE_ADDR_VIRT, | 91 | .virtual = AIPS1_BASE_ADDR_VIRT, |
92 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), | 92 | .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), |
93 | .length = AIPS1_SIZE, | 93 | .length = AIPS1_SIZE, |
94 | .type = MT_DEVICE | 94 | .type = MT_DEVICE_NONSHARED |
95 | }, { | 95 | }, { |
96 | .virtual = AIPS2_BASE_ADDR_VIRT, | 96 | .virtual = AIPS2_BASE_ADDR_VIRT, |
97 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), | 97 | .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), |
98 | .length = AIPS2_SIZE, | 98 | .length = AIPS2_SIZE, |
99 | .type = MT_DEVICE | 99 | .type = MT_DEVICE_NONSHARED |
100 | }, | 100 | }, |
101 | }; | 101 | }; |
102 | 102 | ||
diff --git a/arch/arm/mach-ns9xxx/gpio.c b/arch/arm/mach-ns9xxx/gpio.c index 5241e6a286cc..5503ca09c4ae 100644 --- a/arch/arm/mach-ns9xxx/gpio.c +++ b/arch/arm/mach-ns9xxx/gpio.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * under the terms of the GNU General Public License version 2 as published by | 8 | * under the terms of the GNU General Public License version 2 as published by |
9 | * the Free Software Foundation. | 9 | * the Free Software Foundation. |
10 | */ | 10 | */ |
11 | #include <linux/kernel.h> | ||
11 | #include <linux/compiler.h> | 12 | #include <linux/compiler.h> |
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
13 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
@@ -63,6 +64,7 @@ EXPORT_SYMBOL(gpio_request); | |||
63 | 64 | ||
64 | void gpio_free(unsigned gpio) | 65 | void gpio_free(unsigned gpio) |
65 | { | 66 | { |
67 | might_sleep(); | ||
66 | clear_bit(gpio, gpiores); | 68 | clear_bit(gpio, gpiores); |
67 | return; | 69 | return; |
68 | } | 70 | } |
diff --git a/arch/arm/mach-orion5x/gpio.c b/arch/arm/mach-orion5x/gpio.c index fc419868e39f..f99d08811e5a 100644 --- a/arch/arm/mach-orion5x/gpio.c +++ b/arch/arm/mach-orion5x/gpio.c | |||
@@ -165,6 +165,8 @@ EXPORT_SYMBOL(gpio_request); | |||
165 | 165 | ||
166 | void gpio_free(unsigned pin) | 166 | void gpio_free(unsigned pin) |
167 | { | 167 | { |
168 | might_sleep(); | ||
169 | |||
168 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { | 170 | if (pin >= GPIO_MAX || !test_bit(pin, gpio_valid)) { |
169 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); | 171 | pr_debug("%s: invalid GPIO %d\n", __func__, pin); |
170 | return; | 172 | return; |
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c index eb7d6c94aa42..e35259032813 100644 --- a/arch/arm/mach-pxa/corgi_pm.c +++ b/arch/arm/mach-pxa/corgi_pm.c | |||
@@ -204,7 +204,9 @@ static struct sharpsl_charger_machinfo corgi_pm_machinfo = { | |||
204 | .read_devdata = corgipm_read_devdata, | 204 | .read_devdata = corgipm_read_devdata, |
205 | .charger_wakeup = corgi_charger_wakeup, | 205 | .charger_wakeup = corgi_charger_wakeup, |
206 | .should_wakeup = corgi_should_wakeup, | 206 | .should_wakeup = corgi_should_wakeup, |
207 | #ifdef CONFIG_BACKLIGHT_CORGI | 207 | #if defined(CONFIG_LCD_CORGI) |
208 | .backlight_limit = corgi_lcd_limit_intensity, | ||
209 | #elif defined(CONFIG_BACKLIGHT_CORGI) | ||
208 | .backlight_limit = corgibl_limit_intensity, | 210 | .backlight_limit = corgibl_limit_intensity, |
209 | #endif | 211 | #endif |
210 | .charge_on_volt = SHARPSL_CHARGE_ON_VOLT, | 212 | .charge_on_volt = SHARPSL_CHARGE_ON_VOLT, |
diff --git a/arch/arm/mach-pxa/include/mach/sharpsl.h b/arch/arm/mach-pxa/include/mach/sharpsl.h index 3b1d4a72d4d1..8242e14a44fa 100644 --- a/arch/arm/mach-pxa/include/mach/sharpsl.h +++ b/arch/arm/mach-pxa/include/mach/sharpsl.h | |||
@@ -26,6 +26,7 @@ struct corgits_machinfo { | |||
26 | * SharpSL Backlight | 26 | * SharpSL Backlight |
27 | */ | 27 | */ |
28 | extern void corgibl_limit_intensity(int limit); | 28 | extern void corgibl_limit_intensity(int limit); |
29 | extern void corgi_lcd_limit_intensity(int limit); | ||
29 | 30 | ||
30 | 31 | ||
31 | /* | 32 | /* |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 524f656dc56d..f0a5bbae0b45 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -385,6 +385,16 @@ static void __init spitz_init_spi(void) | |||
385 | if (err) | 385 | if (err) |
386 | goto err_free_2; | 386 | goto err_free_2; |
387 | 387 | ||
388 | err = gpio_direction_output(SPITZ_GPIO_ADS7846_CS, 1); | ||
389 | if (err) | ||
390 | goto err_free_3; | ||
391 | err = gpio_direction_output(SPITZ_GPIO_LCDCON_CS, 1); | ||
392 | if (err) | ||
393 | goto err_free_3; | ||
394 | err = gpio_direction_output(SPITZ_GPIO_MAX1111_CS, 1); | ||
395 | if (err) | ||
396 | goto err_free_3; | ||
397 | |||
388 | if (machine_is_akita()) { | 398 | if (machine_is_akita()) { |
389 | spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; | 399 | spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; |
390 | spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; | 400 | spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; |
@@ -394,6 +404,8 @@ static void __init spitz_init_spi(void) | |||
394 | spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); | 404 | spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); |
395 | return; | 405 | return; |
396 | 406 | ||
407 | err_free_3: | ||
408 | gpio_free(SPITZ_GPIO_MAX1111_CS); | ||
397 | err_free_2: | 409 | err_free_2: |
398 | gpio_free(SPITZ_GPIO_LCDCON_CS); | 410 | gpio_free(SPITZ_GPIO_LCDCON_CS); |
399 | err_free_1: | 411 | err_free_1: |
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index 53018db106ac..072e77cfe5a3 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c | |||
@@ -198,7 +198,9 @@ struct sharpsl_charger_machinfo spitz_pm_machinfo = { | |||
198 | .read_devdata = spitzpm_read_devdata, | 198 | .read_devdata = spitzpm_read_devdata, |
199 | .charger_wakeup = spitz_charger_wakeup, | 199 | .charger_wakeup = spitz_charger_wakeup, |
200 | .should_wakeup = spitz_should_wakeup, | 200 | .should_wakeup = spitz_should_wakeup, |
201 | #ifdef CONFIG_BACKLIGHT_CORGI | 201 | #if defined(CONFIG_LCD_CORGI) |
202 | .backlight_limit = corgi_lcd_limit_intensity, | ||
203 | #elif defined(CONFIG_BACKLIGHT_CORGI) | ||
202 | .backlight_limit = corgibl_limit_intensity, | 204 | .backlight_limit = corgibl_limit_intensity, |
203 | #endif | 205 | #endif |
204 | .charge_on_volt = SHARPSL_CHARGE_ON_VOLT, | 206 | .charge_on_volt = SHARPSL_CHARGE_ON_VOLT, |
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S index 04dc8b65401b..8f6cf56c11c0 100644 --- a/arch/arm/mm/proc-xsc3.S +++ b/arch/arm/mm/proc-xsc3.S | |||
@@ -349,7 +349,7 @@ ENTRY(cpu_xsc3_switch_mm) | |||
349 | cpu_xsc3_mt_table: | 349 | cpu_xsc3_mt_table: |
350 | .long 0x00 @ L_PTE_MT_UNCACHED | 350 | .long 0x00 @ L_PTE_MT_UNCACHED |
351 | .long PTE_EXT_TEX(1) @ L_PTE_MT_BUFFERABLE | 351 | .long PTE_EXT_TEX(1) @ L_PTE_MT_BUFFERABLE |
352 | .long PTE_CACHEABLE @ L_PTE_MT_WRITETHROUGH | 352 | .long PTE_EXT_TEX(5) | PTE_CACHEABLE @ L_PTE_MT_WRITETHROUGH |
353 | .long PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_WRITEBACK | 353 | .long PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_WRITEBACK |
354 | .long PTE_EXT_TEX(1) | PTE_BUFFERABLE @ L_PTE_MT_DEV_SHARED | 354 | .long PTE_EXT_TEX(1) | PTE_BUFFERABLE @ L_PTE_MT_DEV_SHARED |
355 | .long 0x00 @ unused | 355 | .long 0x00 @ unused |
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c index 733e0acac916..de5c4747453f 100644 --- a/arch/arm/plat-mxc/gpio.c +++ b/arch/arm/plat-mxc/gpio.c | |||
@@ -188,7 +188,7 @@ static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset) | |||
188 | struct mxc_gpio_port *port = | 188 | struct mxc_gpio_port *port = |
189 | container_of(chip, struct mxc_gpio_port, chip); | 189 | container_of(chip, struct mxc_gpio_port, chip); |
190 | 190 | ||
191 | return (__raw_readl(port->base + GPIO_DR) >> offset) & 1; | 191 | return (__raw_readl(port->base + GPIO_PSR) >> offset) & 1; |
192 | } | 192 | } |
193 | 193 | ||
194 | static int mxc_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 194 | static int mxc_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
diff --git a/arch/arm/plat-mxc/include/mach/io.h b/arch/arm/plat-mxc/include/mach/io.h index 65b6810124c1..5d4cb1196441 100644 --- a/arch/arm/plat-mxc/include/mach/io.h +++ b/arch/arm/plat-mxc/include/mach/io.h | |||
@@ -14,6 +14,26 @@ | |||
14 | /* Allow IO space to be anywhere in the memory */ | 14 | /* Allow IO space to be anywhere in the memory */ |
15 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
16 | 16 | ||
17 | #ifdef CONFIG_ARCH_MX3 | ||
18 | #define __arch_ioremap __mx3_ioremap | ||
19 | #define __arch_iounmap __iounmap | ||
20 | |||
21 | static inline void __iomem * | ||
22 | __mx3_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) | ||
23 | { | ||
24 | if (mtype == MT_DEVICE) { | ||
25 | /* Access all peripherals below 0x80000000 as nonshared device | ||
26 | * but leave l2cc alone. | ||
27 | */ | ||
28 | if ((phys_addr < 0x80000000) && ((phys_addr < L2CC_BASE_ADDR) || | ||
29 | (phys_addr >= L2CC_BASE_ADDR + L2CC_SIZE))) | ||
30 | mtype = MT_DEVICE_NONSHARED; | ||
31 | } | ||
32 | |||
33 | return __arm_ioremap(phys_addr, size, mtype); | ||
34 | } | ||
35 | #endif | ||
36 | |||
17 | /* io address mapping macro */ | 37 | /* io address mapping macro */ |
18 | #define __io(a) ((void __iomem *)(a)) | 38 | #define __io(a) ((void __iomem *)(a)) |
19 | 39 | ||
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index d11d7b513191..6f20718d3156 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -231,6 +231,10 @@ config SMP | |||
231 | 231 | ||
232 | If you don't know what to do here, say N. | 232 | If you don't know what to do here, say N. |
233 | 233 | ||
234 | config X86_HAS_BOOT_CPU_ID | ||
235 | def_bool y | ||
236 | depends on X86_VOYAGER | ||
237 | |||
234 | config X86_FIND_SMP_CONFIG | 238 | config X86_FIND_SMP_CONFIG |
235 | def_bool y | 239 | def_bool y |
236 | depends on X86_MPPARSE || X86_VOYAGER | 240 | depends on X86_MPPARSE || X86_VOYAGER |
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 5618a103f395..ac2abc88cd95 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h | |||
@@ -82,9 +82,9 @@ extern void __iomem *ioremap_wc(unsigned long offset, unsigned long size); | |||
82 | extern void early_ioremap_init(void); | 82 | extern void early_ioremap_init(void); |
83 | extern void early_ioremap_clear(void); | 83 | extern void early_ioremap_clear(void); |
84 | extern void early_ioremap_reset(void); | 84 | extern void early_ioremap_reset(void); |
85 | extern void *early_ioremap(unsigned long offset, unsigned long size); | 85 | extern void __iomem *early_ioremap(unsigned long offset, unsigned long size); |
86 | extern void *early_memremap(unsigned long offset, unsigned long size); | 86 | extern void __iomem *early_memremap(unsigned long offset, unsigned long size); |
87 | extern void early_iounmap(void *addr, unsigned long size); | 87 | extern void early_iounmap(void __iomem *addr, unsigned long size); |
88 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | 88 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); |
89 | 89 | ||
90 | 90 | ||
diff --git a/arch/x86/include/asm/pgtable-3level.h b/arch/x86/include/asm/pgtable-3level.h index fb16cec702e4..52597aeadfff 100644 --- a/arch/x86/include/asm/pgtable-3level.h +++ b/arch/x86/include/asm/pgtable-3level.h | |||
@@ -120,13 +120,13 @@ static inline void pud_clear(pud_t *pudp) | |||
120 | write_cr3(pgd); | 120 | write_cr3(pgd); |
121 | } | 121 | } |
122 | 122 | ||
123 | #define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_PFN_MASK)) | 123 | #define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT) |
124 | 124 | ||
125 | #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK)) | 125 | #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK)) |
126 | 126 | ||
127 | 127 | ||
128 | /* Find an entry in the second-level page table.. */ | 128 | /* Find an entry in the second-level page table.. */ |
129 | #define pmd_offset(pud, address) ((pmd_t *)pud_page(*(pud)) + \ | 129 | #define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) + \ |
130 | pmd_index(address)) | 130 | pmd_index(address)) |
131 | 131 | ||
132 | #ifdef CONFIG_SMP | 132 | #ifdef CONFIG_SMP |
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 2766021aef80..d12811ce51d9 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -225,5 +225,11 @@ static inline int hard_smp_processor_id(void) | |||
225 | 225 | ||
226 | #endif /* CONFIG_X86_LOCAL_APIC */ | 226 | #endif /* CONFIG_X86_LOCAL_APIC */ |
227 | 227 | ||
228 | #ifdef CONFIG_X86_HAS_BOOT_CPU_ID | ||
229 | extern unsigned char boot_cpu_id; | ||
230 | #else | ||
231 | #define boot_cpu_id 0 | ||
232 | #endif | ||
233 | |||
228 | #endif /* __ASSEMBLY__ */ | 234 | #endif /* __ASSEMBLY__ */ |
229 | #endif /* _ASM_X86_SMP_H */ | 235 | #endif /* _ASM_X86_SMP_H */ |
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index c6ad93e315c8..7a5782610b2b 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/numa.h> | 14 | #include <linux/numa.h> |
15 | #include <linux/percpu.h> | 15 | #include <linux/percpu.h> |
16 | #include <linux/timer.h> | ||
16 | #include <asm/types.h> | 17 | #include <asm/types.h> |
17 | #include <asm/percpu.h> | 18 | #include <asm/percpu.h> |
18 | 19 | ||
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c index 0d9c993aa93e..ef8f831af823 100644 --- a/arch/x86/kernel/cpu/addon_cpuid_features.c +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c | |||
@@ -69,7 +69,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) | |||
69 | */ | 69 | */ |
70 | void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) | 70 | void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) |
71 | { | 71 | { |
72 | #ifdef CONFIG_SMP | 72 | #ifdef CONFIG_X86_SMP |
73 | unsigned int eax, ebx, ecx, edx, sub_index; | 73 | unsigned int eax, ebx, ecx, edx, sub_index; |
74 | unsigned int ht_mask_width, core_plus_mask_width; | 74 | unsigned int ht_mask_width, core_plus_mask_width; |
75 | unsigned int core_select_mask, core_level_siblings; | 75 | unsigned int core_select_mask, core_level_siblings; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 25581dcb280e..003a65395bd5 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -549,6 +549,10 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) | |||
549 | this_cpu->c_early_init(c); | 549 | this_cpu->c_early_init(c); |
550 | 550 | ||
551 | validate_pat_support(c); | 551 | validate_pat_support(c); |
552 | |||
553 | #ifdef CONFIG_SMP | ||
554 | c->cpu_index = boot_cpu_id; | ||
555 | #endif | ||
552 | } | 556 | } |
553 | 557 | ||
554 | void __init early_cpu_init(void) | 558 | void __init early_cpu_init(void) |
@@ -1134,7 +1138,7 @@ void __cpuinit cpu_init(void) | |||
1134 | /* | 1138 | /* |
1135 | * Boot processor to setup the FP and extended state context info. | 1139 | * Boot processor to setup the FP and extended state context info. |
1136 | */ | 1140 | */ |
1137 | if (!smp_processor_id()) | 1141 | if (smp_processor_id() == boot_cpu_id) |
1138 | init_thread_xstate(); | 1142 | init_thread_xstate(); |
1139 | 1143 | ||
1140 | xsave_init(); | 1144 | xsave_init(); |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 161bb850fc47..62348e4fd8d1 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -759,7 +759,7 @@ __cpuinit int unsynchronized_tsc(void) | |||
759 | if (!cpu_has_tsc || tsc_unstable) | 759 | if (!cpu_has_tsc || tsc_unstable) |
760 | return 1; | 760 | return 1; |
761 | 761 | ||
762 | #ifdef CONFIG_SMP | 762 | #ifdef CONFIG_X86_SMP |
763 | if (apic_is_clustered_box()) | 763 | if (apic_is_clustered_box()) |
764 | return 1; | 764 | return 1; |
765 | #endif | 765 | #endif |
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 7766d36983fc..a688f3bfaec2 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c | |||
@@ -78,7 +78,7 @@ static unsigned __init_or_module vsmp_patch(u8 type, u16 clobbers, void *ibuf, | |||
78 | 78 | ||
79 | static void __init set_vsmp_pv_ops(void) | 79 | static void __init set_vsmp_pv_ops(void) |
80 | { | 80 | { |
81 | void *address; | 81 | void __iomem *address; |
82 | unsigned int cap, ctl, cfg; | 82 | unsigned int cap, ctl, cfg; |
83 | 83 | ||
84 | /* set vSMP magic bits to indicate vSMP capable kernel */ | 84 | /* set vSMP magic bits to indicate vSMP capable kernel */ |
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 0f6e8a6523ae..7f4c6af14351 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c | |||
@@ -90,6 +90,7 @@ static void ack_vic_irq(unsigned int irq); | |||
90 | static void vic_enable_cpi(void); | 90 | static void vic_enable_cpi(void); |
91 | static void do_boot_cpu(__u8 cpuid); | 91 | static void do_boot_cpu(__u8 cpuid); |
92 | static void do_quad_bootstrap(void); | 92 | static void do_quad_bootstrap(void); |
93 | static void initialize_secondary(void); | ||
93 | 94 | ||
94 | int hard_smp_processor_id(void); | 95 | int hard_smp_processor_id(void); |
95 | int safe_smp_processor_id(void); | 96 | int safe_smp_processor_id(void); |
@@ -344,6 +345,12 @@ static void do_quad_bootstrap(void) | |||
344 | } | 345 | } |
345 | } | 346 | } |
346 | 347 | ||
348 | void prefill_possible_map(void) | ||
349 | { | ||
350 | /* This is empty on voyager because we need a much | ||
351 | * earlier detection which is done in find_smp_config */ | ||
352 | } | ||
353 | |||
347 | /* Set up all the basic stuff: read the SMP config and make all the | 354 | /* Set up all the basic stuff: read the SMP config and make all the |
348 | * SMP information reflect only the boot cpu. All others will be | 355 | * SMP information reflect only the boot cpu. All others will be |
349 | * brought on-line later. */ | 356 | * brought on-line later. */ |
@@ -413,6 +420,7 @@ void __init smp_store_cpu_info(int id) | |||
413 | struct cpuinfo_x86 *c = &cpu_data(id); | 420 | struct cpuinfo_x86 *c = &cpu_data(id); |
414 | 421 | ||
415 | *c = boot_cpu_data; | 422 | *c = boot_cpu_data; |
423 | c->cpu_index = id; | ||
416 | 424 | ||
417 | identify_secondary_cpu(c); | 425 | identify_secondary_cpu(c); |
418 | } | 426 | } |
@@ -650,6 +658,8 @@ void __init smp_boot_cpus(void) | |||
650 | smp_tune_scheduling(); | 658 | smp_tune_scheduling(); |
651 | */ | 659 | */ |
652 | smp_store_cpu_info(boot_cpu_id); | 660 | smp_store_cpu_info(boot_cpu_id); |
661 | /* setup the jump vector */ | ||
662 | initial_code = (unsigned long)initialize_secondary; | ||
653 | printk("CPU%d: ", boot_cpu_id); | 663 | printk("CPU%d: ", boot_cpu_id); |
654 | print_cpu_info(&cpu_data(boot_cpu_id)); | 664 | print_cpu_info(&cpu_data(boot_cpu_id)); |
655 | 665 | ||
@@ -702,7 +712,7 @@ void __init smp_boot_cpus(void) | |||
702 | 712 | ||
703 | /* Reload the secondary CPUs task structure (this function does not | 713 | /* Reload the secondary CPUs task structure (this function does not |
704 | * return ) */ | 714 | * return ) */ |
705 | void __init initialize_secondary(void) | 715 | static void __init initialize_secondary(void) |
706 | { | 716 | { |
707 | #if 0 | 717 | #if 0 |
708 | // AC kernels only | 718 | // AC kernels only |
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index 4ba373c5b8c8..be54176e9eb2 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c | |||
@@ -233,7 +233,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
233 | len = (unsigned long) nr_pages << PAGE_SHIFT; | 233 | len = (unsigned long) nr_pages << PAGE_SHIFT; |
234 | end = start + len; | 234 | end = start + len; |
235 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, | 235 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, |
236 | start, len))) | 236 | (void __user *)start, len))) |
237 | goto slow_irqon; | 237 | goto slow_irqon; |
238 | 238 | ||
239 | /* | 239 | /* |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index ad38648bddbd..9db01db6e3cd 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -671,12 +671,13 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
671 | unsigned long last_map_addr = 0; | 671 | unsigned long last_map_addr = 0; |
672 | unsigned long page_size_mask = 0; | 672 | unsigned long page_size_mask = 0; |
673 | unsigned long start_pfn, end_pfn; | 673 | unsigned long start_pfn, end_pfn; |
674 | unsigned long pos; | ||
674 | 675 | ||
675 | struct map_range mr[NR_RANGE_MR]; | 676 | struct map_range mr[NR_RANGE_MR]; |
676 | int nr_range, i; | 677 | int nr_range, i; |
677 | int use_pse, use_gbpages; | 678 | int use_pse, use_gbpages; |
678 | 679 | ||
679 | printk(KERN_INFO "init_memory_mapping\n"); | 680 | printk(KERN_INFO "init_memory_mapping: %016lx-%016lx\n", start, end); |
680 | 681 | ||
681 | /* | 682 | /* |
682 | * Find space for the kernel direct mapping tables. | 683 | * Find space for the kernel direct mapping tables. |
@@ -710,35 +711,50 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
710 | 711 | ||
711 | /* head if not big page alignment ?*/ | 712 | /* head if not big page alignment ?*/ |
712 | start_pfn = start >> PAGE_SHIFT; | 713 | start_pfn = start >> PAGE_SHIFT; |
713 | end_pfn = ((start + (PMD_SIZE - 1)) >> PMD_SHIFT) | 714 | pos = start_pfn << PAGE_SHIFT; |
715 | end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) | ||
714 | << (PMD_SHIFT - PAGE_SHIFT); | 716 | << (PMD_SHIFT - PAGE_SHIFT); |
715 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | 717 | if (start_pfn < end_pfn) { |
718 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | ||
719 | pos = end_pfn << PAGE_SHIFT; | ||
720 | } | ||
716 | 721 | ||
717 | /* big page (2M) range*/ | 722 | /* big page (2M) range*/ |
718 | start_pfn = ((start + (PMD_SIZE - 1))>>PMD_SHIFT) | 723 | start_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT) |
719 | << (PMD_SHIFT - PAGE_SHIFT); | 724 | << (PMD_SHIFT - PAGE_SHIFT); |
720 | end_pfn = ((start + (PUD_SIZE - 1))>>PUD_SHIFT) | 725 | end_pfn = ((pos + (PUD_SIZE - 1))>>PUD_SHIFT) |
721 | << (PUD_SHIFT - PAGE_SHIFT); | 726 | << (PUD_SHIFT - PAGE_SHIFT); |
722 | if (end_pfn > ((end>>PUD_SHIFT)<<(PUD_SHIFT - PAGE_SHIFT))) | 727 | if (end_pfn > ((end>>PMD_SHIFT)<<(PMD_SHIFT - PAGE_SHIFT))) |
723 | end_pfn = ((end>>PUD_SHIFT)<<(PUD_SHIFT - PAGE_SHIFT)); | 728 | end_pfn = ((end>>PMD_SHIFT)<<(PMD_SHIFT - PAGE_SHIFT)); |
724 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | 729 | if (start_pfn < end_pfn) { |
725 | page_size_mask & (1<<PG_LEVEL_2M)); | 730 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, |
731 | page_size_mask & (1<<PG_LEVEL_2M)); | ||
732 | pos = end_pfn << PAGE_SHIFT; | ||
733 | } | ||
726 | 734 | ||
727 | /* big page (1G) range */ | 735 | /* big page (1G) range */ |
728 | start_pfn = end_pfn; | 736 | start_pfn = ((pos + (PUD_SIZE - 1))>>PUD_SHIFT) |
729 | end_pfn = (end>>PUD_SHIFT) << (PUD_SHIFT - PAGE_SHIFT); | 737 | << (PUD_SHIFT - PAGE_SHIFT); |
730 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | 738 | end_pfn = (end >> PUD_SHIFT) << (PUD_SHIFT - PAGE_SHIFT); |
739 | if (start_pfn < end_pfn) { | ||
740 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | ||
731 | page_size_mask & | 741 | page_size_mask & |
732 | ((1<<PG_LEVEL_2M)|(1<<PG_LEVEL_1G))); | 742 | ((1<<PG_LEVEL_2M)|(1<<PG_LEVEL_1G))); |
743 | pos = end_pfn << PAGE_SHIFT; | ||
744 | } | ||
733 | 745 | ||
734 | /* tail is not big page (1G) alignment */ | 746 | /* tail is not big page (1G) alignment */ |
735 | start_pfn = end_pfn; | 747 | start_pfn = ((pos + (PMD_SIZE - 1))>>PMD_SHIFT) |
736 | end_pfn = (end>>PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT); | 748 | << (PMD_SHIFT - PAGE_SHIFT); |
737 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | 749 | end_pfn = (end >> PMD_SHIFT) << (PMD_SHIFT - PAGE_SHIFT); |
738 | page_size_mask & (1<<PG_LEVEL_2M)); | 750 | if (start_pfn < end_pfn) { |
751 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, | ||
752 | page_size_mask & (1<<PG_LEVEL_2M)); | ||
753 | pos = end_pfn << PAGE_SHIFT; | ||
754 | } | ||
739 | 755 | ||
740 | /* tail is not big page (2M) alignment */ | 756 | /* tail is not big page (2M) alignment */ |
741 | start_pfn = end_pfn; | 757 | start_pfn = pos>>PAGE_SHIFT; |
742 | end_pfn = end>>PAGE_SHIFT; | 758 | end_pfn = end>>PAGE_SHIFT; |
743 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | 759 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); |
744 | 760 | ||
@@ -842,7 +858,7 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
842 | max_pfn_mapped = last_mapped_pfn; | 858 | max_pfn_mapped = last_mapped_pfn; |
843 | 859 | ||
844 | ret = __add_pages(zone, start_pfn, nr_pages); | 860 | ret = __add_pages(zone, start_pfn, nr_pages); |
845 | WARN_ON(1); | 861 | WARN_ON_ONCE(ret); |
846 | 862 | ||
847 | return ret; | 863 | return ret; |
848 | } | 864 | } |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index ae71e11eb3e5..d4c4307ff3e0 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -387,7 +387,7 @@ static void __iomem *ioremap_default(resource_size_t phys_addr, | |||
387 | unsigned long size) | 387 | unsigned long size) |
388 | { | 388 | { |
389 | unsigned long flags; | 389 | unsigned long flags; |
390 | void *ret; | 390 | void __iomem *ret; |
391 | int err; | 391 | int err; |
392 | 392 | ||
393 | /* | 393 | /* |
@@ -399,11 +399,11 @@ static void __iomem *ioremap_default(resource_size_t phys_addr, | |||
399 | if (err < 0) | 399 | if (err < 0) |
400 | return NULL; | 400 | return NULL; |
401 | 401 | ||
402 | ret = (void *) __ioremap_caller(phys_addr, size, flags, | 402 | ret = __ioremap_caller(phys_addr, size, flags, |
403 | __builtin_return_address(0)); | 403 | __builtin_return_address(0)); |
404 | 404 | ||
405 | free_memtype(phys_addr, phys_addr + size); | 405 | free_memtype(phys_addr, phys_addr + size); |
406 | return (void __iomem *)ret; | 406 | return ret; |
407 | } | 407 | } |
408 | 408 | ||
409 | void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size, | 409 | void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size, |
@@ -622,7 +622,7 @@ static inline void __init early_clear_fixmap(enum fixed_addresses idx) | |||
622 | __early_set_fixmap(idx, 0, __pgprot(0)); | 622 | __early_set_fixmap(idx, 0, __pgprot(0)); |
623 | } | 623 | } |
624 | 624 | ||
625 | static void *prev_map[FIX_BTMAPS_SLOTS] __initdata; | 625 | static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata; |
626 | static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata; | 626 | static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata; |
627 | static int __init check_early_ioremap_leak(void) | 627 | static int __init check_early_ioremap_leak(void) |
628 | { | 628 | { |
@@ -645,7 +645,7 @@ static int __init check_early_ioremap_leak(void) | |||
645 | } | 645 | } |
646 | late_initcall(check_early_ioremap_leak); | 646 | late_initcall(check_early_ioremap_leak); |
647 | 647 | ||
648 | static void __init *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) | 648 | static void __init __iomem *__early_ioremap(unsigned long phys_addr, unsigned long size, pgprot_t prot) |
649 | { | 649 | { |
650 | unsigned long offset, last_addr; | 650 | unsigned long offset, last_addr; |
651 | unsigned int nrpages; | 651 | unsigned int nrpages; |
@@ -713,23 +713,23 @@ static void __init *__early_ioremap(unsigned long phys_addr, unsigned long size, | |||
713 | if (early_ioremap_debug) | 713 | if (early_ioremap_debug) |
714 | printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0)); | 714 | printk(KERN_CONT "%08lx + %08lx\n", offset, fix_to_virt(idx0)); |
715 | 715 | ||
716 | prev_map[slot] = (void *) (offset + fix_to_virt(idx0)); | 716 | prev_map[slot] = (void __iomem *)(offset + fix_to_virt(idx0)); |
717 | return prev_map[slot]; | 717 | return prev_map[slot]; |
718 | } | 718 | } |
719 | 719 | ||
720 | /* Remap an IO device */ | 720 | /* Remap an IO device */ |
721 | void __init *early_ioremap(unsigned long phys_addr, unsigned long size) | 721 | void __init __iomem *early_ioremap(unsigned long phys_addr, unsigned long size) |
722 | { | 722 | { |
723 | return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO); | 723 | return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO); |
724 | } | 724 | } |
725 | 725 | ||
726 | /* Remap memory */ | 726 | /* Remap memory */ |
727 | void __init *early_memremap(unsigned long phys_addr, unsigned long size) | 727 | void __init __iomem *early_memremap(unsigned long phys_addr, unsigned long size) |
728 | { | 728 | { |
729 | return __early_ioremap(phys_addr, size, PAGE_KERNEL); | 729 | return __early_ioremap(phys_addr, size, PAGE_KERNEL); |
730 | } | 730 | } |
731 | 731 | ||
732 | void __init early_iounmap(void *addr, unsigned long size) | 732 | void __init early_iounmap(void __iomem *addr, unsigned long size) |
733 | { | 733 | { |
734 | unsigned long virt_addr; | 734 | unsigned long virt_addr; |
735 | unsigned long offset; | 735 | unsigned long offset; |
@@ -779,7 +779,7 @@ void __init early_iounmap(void *addr, unsigned long size) | |||
779 | --idx; | 779 | --idx; |
780 | --nrpages; | 780 | --nrpages; |
781 | } | 781 | } |
782 | prev_map[slot] = 0; | 782 | prev_map[slot] = NULL; |
783 | } | 783 | } |
784 | 784 | ||
785 | void __this_fixmap_does_not_exist(void) | 785 | void __this_fixmap_does_not_exist(void) |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 738fd0f24958..eb1bf000d12e 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -481,12 +481,16 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size) | |||
481 | return 1; | 481 | return 1; |
482 | } | 482 | } |
483 | #else | 483 | #else |
484 | /* This check is needed to avoid cache aliasing when PAT is enabled */ | ||
484 | static inline int range_is_allowed(unsigned long pfn, unsigned long size) | 485 | static inline int range_is_allowed(unsigned long pfn, unsigned long size) |
485 | { | 486 | { |
486 | u64 from = ((u64)pfn) << PAGE_SHIFT; | 487 | u64 from = ((u64)pfn) << PAGE_SHIFT; |
487 | u64 to = from + size; | 488 | u64 to = from + size; |
488 | u64 cursor = from; | 489 | u64 cursor = from; |
489 | 490 | ||
491 | if (!pat_enabled) | ||
492 | return 1; | ||
493 | |||
490 | while (cursor < to) { | 494 | while (cursor < to) { |
491 | if (!devmem_is_allowed(pfn)) { | 495 | if (!devmem_is_allowed(pfn)) { |
492 | printk(KERN_INFO | 496 | printk(KERN_INFO |