diff options
Diffstat (limited to 'arch')
37 files changed, 247 insertions, 67 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c5f9ae5dbd1..2f88d8d9770 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -6,7 +6,7 @@ config ARM | |||
6 | select HAVE_DMA_API_DEBUG | 6 | select HAVE_DMA_API_DEBUG |
7 | select HAVE_IDE if PCI || ISA || PCMCIA | 7 | select HAVE_IDE if PCI || ISA || PCMCIA |
8 | select HAVE_DMA_ATTRS | 8 | select HAVE_DMA_ATTRS |
9 | select HAVE_DMA_CONTIGUOUS if (CPU_V6 || CPU_V6K || CPU_V7) | 9 | select HAVE_DMA_CONTIGUOUS if MMU |
10 | select HAVE_MEMBLOCK | 10 | select HAVE_MEMBLOCK |
11 | select RTC_LIB | 11 | select RTC_LIB |
12 | select SYS_SUPPORTS_APM_EMULATION | 12 | select SYS_SUPPORTS_APM_EMULATION |
diff --git a/arch/arm/boot/dts/at91sam9g25ek.dts b/arch/arm/boot/dts/at91sam9g25ek.dts index 7829a4d0cb2..96514c134e5 100644 --- a/arch/arm/boot/dts/at91sam9g25ek.dts +++ b/arch/arm/boot/dts/at91sam9g25ek.dts | |||
@@ -15,7 +15,7 @@ | |||
15 | compatible = "atmel,at91sam9g25ek", "atmel,at91sam9x5ek", "atmel,at91sam9x5", "atmel,at91sam9"; | 15 | compatible = "atmel,at91sam9g25ek", "atmel,at91sam9x5ek", "atmel,at91sam9x5", "atmel,at91sam9"; |
16 | 16 | ||
17 | chosen { | 17 | chosen { |
18 | bootargs = "128M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs"; | 18 | bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs"; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | ahb { | 21 | ahb { |
diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig index 7d8718468e0..90610c7030f 100644 --- a/arch/arm/configs/armadillo800eva_defconfig +++ b/arch/arm/configs/armadillo800eva_defconfig | |||
@@ -33,7 +33,7 @@ CONFIG_AEABI=y | |||
33 | CONFIG_FORCE_MAX_ZONEORDER=13 | 33 | CONFIG_FORCE_MAX_ZONEORDER=13 |
34 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 34 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
35 | CONFIG_ZBOOT_ROM_BSS=0x0 | 35 | CONFIG_ZBOOT_ROM_BSS=0x0 |
36 | CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096" | 36 | CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096 rw" |
37 | CONFIG_CMDLINE_FORCE=y | 37 | CONFIG_CMDLINE_FORCE=y |
38 | CONFIG_KEXEC=y | 38 | CONFIG_KEXEC=y |
39 | CONFIG_VFP=y | 39 | CONFIG_VFP=y |
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 2ae842df455..5c44dcb0987 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -203,6 +203,13 @@ static inline void dma_free_writecombine(struct device *dev, size_t size, | |||
203 | } | 203 | } |
204 | 204 | ||
205 | /* | 205 | /* |
206 | * This can be called during early boot to increase the size of the atomic | ||
207 | * coherent DMA pool above the default value of 256KiB. It must be called | ||
208 | * before postcore_initcall. | ||
209 | */ | ||
210 | extern void __init init_dma_coherent_pool_size(unsigned long size); | ||
211 | |||
212 | /* | ||
206 | * This can be called during boot to increase the size of the consistent | 213 | * This can be called during boot to increase the size of the consistent |
207 | * DMA region above it's default value of 2MB. It must be called before the | 214 | * DMA region above it's default value of 2MB. It must be called before the |
208 | * memory allocator is initialised, i.e. before any core_initcall. | 215 | * memory allocator is initialised, i.e. before any core_initcall. |
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index 104ca40d8d1..aaa443b48c9 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c | |||
@@ -197,7 +197,7 @@ void __init at91rm9200_timer_init(void) | |||
197 | at91_st_read(AT91_ST_SR); | 197 | at91_st_read(AT91_ST_SR); |
198 | 198 | ||
199 | /* Make IRQs happen for the system timer */ | 199 | /* Make IRQs happen for the system timer */ |
200 | setup_irq(AT91_ID_SYS, &at91rm9200_timer_irq); | 200 | setup_irq(NR_IRQS_LEGACY + AT91_ID_SYS, &at91rm9200_timer_irq); |
201 | 201 | ||
202 | /* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used | 202 | /* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used |
203 | * directly for the clocksource and all clockevents, after adjusting | 203 | * directly for the clocksource and all clockevents, after adjusting |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 7b9c2ba396e..bce572a530e 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -726,6 +726,8 @@ static struct resource rtt_resources[] = { | |||
726 | .flags = IORESOURCE_MEM, | 726 | .flags = IORESOURCE_MEM, |
727 | }, { | 727 | }, { |
728 | .flags = IORESOURCE_MEM, | 728 | .flags = IORESOURCE_MEM, |
729 | }, { | ||
730 | .flags = IORESOURCE_IRQ, | ||
729 | }, | 731 | }, |
730 | }; | 732 | }; |
731 | 733 | ||
@@ -744,10 +746,12 @@ static void __init at91_add_device_rtt_rtc(void) | |||
744 | * The second resource is needed: | 746 | * The second resource is needed: |
745 | * GPBR will serve as the storage for RTC time offset | 747 | * GPBR will serve as the storage for RTC time offset |
746 | */ | 748 | */ |
747 | at91sam9260_rtt_device.num_resources = 2; | 749 | at91sam9260_rtt_device.num_resources = 3; |
748 | rtt_resources[1].start = AT91SAM9260_BASE_GPBR + | 750 | rtt_resources[1].start = AT91SAM9260_BASE_GPBR + |
749 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; | 751 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; |
750 | rtt_resources[1].end = rtt_resources[1].start + 3; | 752 | rtt_resources[1].end = rtt_resources[1].start + 3; |
753 | rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
754 | rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
751 | } | 755 | } |
752 | #else | 756 | #else |
753 | static void __init at91_add_device_rtt_rtc(void) | 757 | static void __init at91_add_device_rtt_rtc(void) |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 8df5c1bdff9..bc2590d712d 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -609,6 +609,8 @@ static struct resource rtt_resources[] = { | |||
609 | .flags = IORESOURCE_MEM, | 609 | .flags = IORESOURCE_MEM, |
610 | }, { | 610 | }, { |
611 | .flags = IORESOURCE_MEM, | 611 | .flags = IORESOURCE_MEM, |
612 | }, { | ||
613 | .flags = IORESOURCE_IRQ, | ||
612 | } | 614 | } |
613 | }; | 615 | }; |
614 | 616 | ||
@@ -626,10 +628,12 @@ static void __init at91_add_device_rtt_rtc(void) | |||
626 | * The second resource is needed: | 628 | * The second resource is needed: |
627 | * GPBR will serve as the storage for RTC time offset | 629 | * GPBR will serve as the storage for RTC time offset |
628 | */ | 630 | */ |
629 | at91sam9261_rtt_device.num_resources = 2; | 631 | at91sam9261_rtt_device.num_resources = 3; |
630 | rtt_resources[1].start = AT91SAM9261_BASE_GPBR + | 632 | rtt_resources[1].start = AT91SAM9261_BASE_GPBR + |
631 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; | 633 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; |
632 | rtt_resources[1].end = rtt_resources[1].start + 3; | 634 | rtt_resources[1].end = rtt_resources[1].start + 3; |
635 | rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
636 | rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
633 | } | 637 | } |
634 | #else | 638 | #else |
635 | static void __init at91_add_device_rtt_rtc(void) | 639 | static void __init at91_add_device_rtt_rtc(void) |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index eb6bbf86fb9..9b6ca734f1a 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -990,6 +990,8 @@ static struct resource rtt0_resources[] = { | |||
990 | .flags = IORESOURCE_MEM, | 990 | .flags = IORESOURCE_MEM, |
991 | }, { | 991 | }, { |
992 | .flags = IORESOURCE_MEM, | 992 | .flags = IORESOURCE_MEM, |
993 | }, { | ||
994 | .flags = IORESOURCE_IRQ, | ||
993 | } | 995 | } |
994 | }; | 996 | }; |
995 | 997 | ||
@@ -1006,6 +1008,8 @@ static struct resource rtt1_resources[] = { | |||
1006 | .flags = IORESOURCE_MEM, | 1008 | .flags = IORESOURCE_MEM, |
1007 | }, { | 1009 | }, { |
1008 | .flags = IORESOURCE_MEM, | 1010 | .flags = IORESOURCE_MEM, |
1011 | }, { | ||
1012 | .flags = IORESOURCE_IRQ, | ||
1009 | } | 1013 | } |
1010 | }; | 1014 | }; |
1011 | 1015 | ||
@@ -1027,14 +1031,14 @@ static void __init at91_add_device_rtt_rtc(void) | |||
1027 | * The second resource is needed only for the chosen RTT: | 1031 | * The second resource is needed only for the chosen RTT: |
1028 | * GPBR will serve as the storage for RTC time offset | 1032 | * GPBR will serve as the storage for RTC time offset |
1029 | */ | 1033 | */ |
1030 | at91sam9263_rtt0_device.num_resources = 2; | 1034 | at91sam9263_rtt0_device.num_resources = 3; |
1031 | at91sam9263_rtt1_device.num_resources = 1; | 1035 | at91sam9263_rtt1_device.num_resources = 1; |
1032 | pdev = &at91sam9263_rtt0_device; | 1036 | pdev = &at91sam9263_rtt0_device; |
1033 | r = rtt0_resources; | 1037 | r = rtt0_resources; |
1034 | break; | 1038 | break; |
1035 | case 1: | 1039 | case 1: |
1036 | at91sam9263_rtt0_device.num_resources = 1; | 1040 | at91sam9263_rtt0_device.num_resources = 1; |
1037 | at91sam9263_rtt1_device.num_resources = 2; | 1041 | at91sam9263_rtt1_device.num_resources = 3; |
1038 | pdev = &at91sam9263_rtt1_device; | 1042 | pdev = &at91sam9263_rtt1_device; |
1039 | r = rtt1_resources; | 1043 | r = rtt1_resources; |
1040 | break; | 1044 | break; |
@@ -1047,6 +1051,8 @@ static void __init at91_add_device_rtt_rtc(void) | |||
1047 | pdev->name = "rtc-at91sam9"; | 1051 | pdev->name = "rtc-at91sam9"; |
1048 | r[1].start = AT91SAM9263_BASE_GPBR + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; | 1052 | r[1].start = AT91SAM9263_BASE_GPBR + 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; |
1049 | r[1].end = r[1].start + 3; | 1053 | r[1].end = r[1].start + 3; |
1054 | r[2].start = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
1055 | r[2].end = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
1050 | } | 1056 | } |
1051 | #else | 1057 | #else |
1052 | static void __init at91_add_device_rtt_rtc(void) | 1058 | static void __init at91_add_device_rtt_rtc(void) |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 06073996a38..1b47319ca00 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -1293,6 +1293,8 @@ static struct resource rtt_resources[] = { | |||
1293 | .flags = IORESOURCE_MEM, | 1293 | .flags = IORESOURCE_MEM, |
1294 | }, { | 1294 | }, { |
1295 | .flags = IORESOURCE_MEM, | 1295 | .flags = IORESOURCE_MEM, |
1296 | }, { | ||
1297 | .flags = IORESOURCE_IRQ, | ||
1296 | } | 1298 | } |
1297 | }; | 1299 | }; |
1298 | 1300 | ||
@@ -1310,10 +1312,12 @@ static void __init at91_add_device_rtt_rtc(void) | |||
1310 | * The second resource is needed: | 1312 | * The second resource is needed: |
1311 | * GPBR will serve as the storage for RTC time offset | 1313 | * GPBR will serve as the storage for RTC time offset |
1312 | */ | 1314 | */ |
1313 | at91sam9g45_rtt_device.num_resources = 2; | 1315 | at91sam9g45_rtt_device.num_resources = 3; |
1314 | rtt_resources[1].start = AT91SAM9G45_BASE_GPBR + | 1316 | rtt_resources[1].start = AT91SAM9G45_BASE_GPBR + |
1315 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; | 1317 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; |
1316 | rtt_resources[1].end = rtt_resources[1].start + 3; | 1318 | rtt_resources[1].end = rtt_resources[1].start + 3; |
1319 | rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
1320 | rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
1317 | } | 1321 | } |
1318 | #else | 1322 | #else |
1319 | static void __init at91_add_device_rtt_rtc(void) | 1323 | static void __init at91_add_device_rtt_rtc(void) |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index f09fff93217..b3d365dadef 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -688,6 +688,8 @@ static struct resource rtt_resources[] = { | |||
688 | .flags = IORESOURCE_MEM, | 688 | .flags = IORESOURCE_MEM, |
689 | }, { | 689 | }, { |
690 | .flags = IORESOURCE_MEM, | 690 | .flags = IORESOURCE_MEM, |
691 | }, { | ||
692 | .flags = IORESOURCE_IRQ, | ||
691 | } | 693 | } |
692 | }; | 694 | }; |
693 | 695 | ||
@@ -705,10 +707,12 @@ static void __init at91_add_device_rtt_rtc(void) | |||
705 | * The second resource is needed: | 707 | * The second resource is needed: |
706 | * GPBR will serve as the storage for RTC time offset | 708 | * GPBR will serve as the storage for RTC time offset |
707 | */ | 709 | */ |
708 | at91sam9rl_rtt_device.num_resources = 2; | 710 | at91sam9rl_rtt_device.num_resources = 3; |
709 | rtt_resources[1].start = AT91SAM9RL_BASE_GPBR + | 711 | rtt_resources[1].start = AT91SAM9RL_BASE_GPBR + |
710 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; | 712 | 4 * CONFIG_RTC_DRV_AT91SAM9_GPBR; |
711 | rtt_resources[1].end = rtt_resources[1].start + 3; | 713 | rtt_resources[1].end = rtt_resources[1].start + 3; |
714 | rtt_resources[2].start = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
715 | rtt_resources[2].end = NR_IRQS_LEGACY + AT91_ID_SYS; | ||
712 | } | 716 | } |
713 | #else | 717 | #else |
714 | static void __init at91_add_device_rtt_rtc(void) | 718 | static void __init at91_add_device_rtt_rtc(void) |
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index de2ec6b8fea..188c82971eb 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c | |||
@@ -63,6 +63,12 @@ EXPORT_SYMBOL_GPL(at91_pmc_base); | |||
63 | 63 | ||
64 | #define cpu_has_300M_plla() (cpu_is_at91sam9g10()) | 64 | #define cpu_has_300M_plla() (cpu_is_at91sam9g10()) |
65 | 65 | ||
66 | #define cpu_has_240M_plla() (cpu_is_at91sam9261() \ | ||
67 | || cpu_is_at91sam9263() \ | ||
68 | || cpu_is_at91sam9rl()) | ||
69 | |||
70 | #define cpu_has_210M_plla() (cpu_is_at91sam9260()) | ||
71 | |||
66 | #define cpu_has_pllb() (!(cpu_is_at91sam9rl() \ | 72 | #define cpu_has_pllb() (!(cpu_is_at91sam9rl() \ |
67 | || cpu_is_at91sam9g45() \ | 73 | || cpu_is_at91sam9g45() \ |
68 | || cpu_is_at91sam9x5() \ | 74 | || cpu_is_at91sam9x5() \ |
@@ -706,6 +712,12 @@ static int __init at91_pmc_init(unsigned long main_clock) | |||
706 | } else if (cpu_has_800M_plla()) { | 712 | } else if (cpu_has_800M_plla()) { |
707 | if (plla.rate_hz > 800000000) | 713 | if (plla.rate_hz > 800000000) |
708 | pll_overclock = true; | 714 | pll_overclock = true; |
715 | } else if (cpu_has_240M_plla()) { | ||
716 | if (plla.rate_hz > 240000000) | ||
717 | pll_overclock = true; | ||
718 | } else if (cpu_has_210M_plla()) { | ||
719 | if (plla.rate_hz > 210000000) | ||
720 | pll_overclock = true; | ||
709 | } else { | 721 | } else { |
710 | if (plla.rate_hz > 209000000) | 722 | if (plla.rate_hz > 209000000) |
711 | pll_overclock = true; | 723 | pll_overclock = true; |
diff --git a/arch/arm/mach-gemini/irq.c b/arch/arm/mach-gemini/irq.c index ca70e5fcc7a..020852d3bdd 100644 --- a/arch/arm/mach-gemini/irq.c +++ b/arch/arm/mach-gemini/irq.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
18 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
19 | #include <asm/mach/irq.h> | 19 | #include <asm/mach/irq.h> |
20 | #include <asm/system_misc.h> | ||
20 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
21 | 22 | ||
22 | #define IRQ_SOURCE(base_addr) (base_addr + 0x00) | 23 | #define IRQ_SOURCE(base_addr) (base_addr + 0x00) |
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 3226077735b..1201191d7f1 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -517,6 +517,13 @@ void __init kirkwood_wdt_init(void) | |||
517 | void __init kirkwood_init_early(void) | 517 | void __init kirkwood_init_early(void) |
518 | { | 518 | { |
519 | orion_time_set_base(TIMER_VIRT_BASE); | 519 | orion_time_set_base(TIMER_VIRT_BASE); |
520 | |||
521 | /* | ||
522 | * Some Kirkwood devices allocate their coherent buffers from atomic | ||
523 | * context. Increase size of atomic coherent pool to make sure such | ||
524 | * the allocations won't fail. | ||
525 | */ | ||
526 | init_dma_coherent_pool_size(SZ_1M); | ||
520 | } | 527 | } |
521 | 528 | ||
522 | int kirkwood_tclk; | 529 | int kirkwood_tclk; |
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c index d9335937959..be90b7d0e10 100644 --- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c +++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/sizes.h> | ||
13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
14 | #include <linux/mtd/partitions.h> | 15 | #include <linux/mtd/partitions.h> |
15 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index cf10f92856d..453a6e50db8 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -520,13 +520,14 @@ static struct platform_device hdmi_lcdc_device = { | |||
520 | }; | 520 | }; |
521 | 521 | ||
522 | /* GPIO KEY */ | 522 | /* GPIO KEY */ |
523 | #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 } | 523 | #define GPIO_KEY(c, g, d, ...) \ |
524 | { .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ } | ||
524 | 525 | ||
525 | static struct gpio_keys_button gpio_buttons[] = { | 526 | static struct gpio_keys_button gpio_buttons[] = { |
526 | GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW1"), | 527 | GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW3", .wakeup = 1), |
527 | GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW2"), | 528 | GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW4"), |
528 | GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW3"), | 529 | GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW5"), |
529 | GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW4"), | 530 | GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW6"), |
530 | }; | 531 | }; |
531 | 532 | ||
532 | static struct gpio_keys_platform_data gpio_key_info = { | 533 | static struct gpio_keys_platform_data gpio_key_info = { |
@@ -901,8 +902,8 @@ static struct platform_device *eva_devices[] __initdata = { | |||
901 | &camera_device, | 902 | &camera_device, |
902 | &ceu0_device, | 903 | &ceu0_device, |
903 | &fsi_device, | 904 | &fsi_device, |
904 | &fsi_hdmi_device, | ||
905 | &fsi_wm8978_device, | 905 | &fsi_wm8978_device, |
906 | &fsi_hdmi_device, | ||
906 | }; | 907 | }; |
907 | 908 | ||
908 | static void __init eva_clock_init(void) | 909 | static void __init eva_clock_init(void) |
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 7ea2b31e319..c129542f6ae 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -695,6 +695,7 @@ static struct platform_device usbhs0_device = { | |||
695 | * - J30 "open" | 695 | * - J30 "open" |
696 | * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET | 696 | * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET |
697 | * - add .get_vbus = usbhs_get_vbus in usbhs1_private | 697 | * - add .get_vbus = usbhs_get_vbus in usbhs1_private |
698 | * - check usbhs0_device(pio)/usbhs1_device(irq) order in mackerel_devices. | ||
698 | */ | 699 | */ |
699 | #define IRQ8 evt2irq(0x0300) | 700 | #define IRQ8 evt2irq(0x0300) |
700 | #define USB_PHY_MODE (1 << 4) | 701 | #define USB_PHY_MODE (1 << 4) |
@@ -1325,8 +1326,8 @@ static struct platform_device *mackerel_devices[] __initdata = { | |||
1325 | &nor_flash_device, | 1326 | &nor_flash_device, |
1326 | &smc911x_device, | 1327 | &smc911x_device, |
1327 | &lcdc_device, | 1328 | &lcdc_device, |
1328 | &usbhs1_device, | ||
1329 | &usbhs0_device, | 1329 | &usbhs0_device, |
1330 | &usbhs1_device, | ||
1330 | &leds_device, | 1331 | &leds_device, |
1331 | &fsi_device, | 1332 | &fsi_device, |
1332 | &fsi_ak4643_device, | 1333 | &fsi_ak4643_device, |
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index 3a528cf4366..fcf5a47f477 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c | |||
@@ -67,7 +67,7 @@ static struct smsc911x_platform_config smsc911x_platdata = { | |||
67 | 67 | ||
68 | static struct platform_device eth_device = { | 68 | static struct platform_device eth_device = { |
69 | .name = "smsc911x", | 69 | .name = "smsc911x", |
70 | .id = 0, | 70 | .id = -1, |
71 | .dev = { | 71 | .dev = { |
72 | .platform_data = &smsc911x_platdata, | 72 | .platform_data = &smsc911x_platdata, |
73 | }, | 73 | }, |
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c index ee447404c85..588555a67d9 100644 --- a/arch/arm/mach-shmobile/intc-sh73a0.c +++ b/arch/arm/mach-shmobile/intc-sh73a0.c | |||
@@ -259,9 +259,9 @@ static int sh73a0_set_wake(struct irq_data *data, unsigned int on) | |||
259 | return 0; /* always allow wakeup */ | 259 | return 0; /* always allow wakeup */ |
260 | } | 260 | } |
261 | 261 | ||
262 | #define RELOC_BASE 0x1000 | 262 | #define RELOC_BASE 0x1200 |
263 | 263 | ||
264 | /* INTCA IRQ pins at INTCS + 0x1000 to make space for GIC+INTC handling */ | 264 | /* INTCA IRQ pins at INTCS + RELOC_BASE to make space for GIC+INTC handling */ |
265 | #define INTCS_VECT_RELOC(n, vect) INTCS_VECT((n), (vect) + RELOC_BASE) | 265 | #define INTCS_VECT_RELOC(n, vect) INTCS_VECT((n), (vect) + RELOC_BASE) |
266 | 266 | ||
267 | INTC_IRQ_PINS_32(intca_irq_pins, 0xe6900000, | 267 | INTC_IRQ_PINS_32(intca_irq_pins, 0xe6900000, |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 4e7d1182e8a..051204fc461 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -267,17 +267,19 @@ static void __dma_free_remap(void *cpu_addr, size_t size) | |||
267 | vunmap(cpu_addr); | 267 | vunmap(cpu_addr); |
268 | } | 268 | } |
269 | 269 | ||
270 | #define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K | ||
271 | |||
270 | struct dma_pool { | 272 | struct dma_pool { |
271 | size_t size; | 273 | size_t size; |
272 | spinlock_t lock; | 274 | spinlock_t lock; |
273 | unsigned long *bitmap; | 275 | unsigned long *bitmap; |
274 | unsigned long nr_pages; | 276 | unsigned long nr_pages; |
275 | void *vaddr; | 277 | void *vaddr; |
276 | struct page *page; | 278 | struct page **pages; |
277 | }; | 279 | }; |
278 | 280 | ||
279 | static struct dma_pool atomic_pool = { | 281 | static struct dma_pool atomic_pool = { |
280 | .size = SZ_256K, | 282 | .size = DEFAULT_DMA_COHERENT_POOL_SIZE, |
281 | }; | 283 | }; |
282 | 284 | ||
283 | static int __init early_coherent_pool(char *p) | 285 | static int __init early_coherent_pool(char *p) |
@@ -287,6 +289,21 @@ static int __init early_coherent_pool(char *p) | |||
287 | } | 289 | } |
288 | early_param("coherent_pool", early_coherent_pool); | 290 | early_param("coherent_pool", early_coherent_pool); |
289 | 291 | ||
292 | void __init init_dma_coherent_pool_size(unsigned long size) | ||
293 | { | ||
294 | /* | ||
295 | * Catch any attempt to set the pool size too late. | ||
296 | */ | ||
297 | BUG_ON(atomic_pool.vaddr); | ||
298 | |||
299 | /* | ||
300 | * Set architecture specific coherent pool size only if | ||
301 | * it has not been changed by kernel command line parameter. | ||
302 | */ | ||
303 | if (atomic_pool.size == DEFAULT_DMA_COHERENT_POOL_SIZE) | ||
304 | atomic_pool.size = size; | ||
305 | } | ||
306 | |||
290 | /* | 307 | /* |
291 | * Initialise the coherent pool for atomic allocations. | 308 | * Initialise the coherent pool for atomic allocations. |
292 | */ | 309 | */ |
@@ -297,6 +314,7 @@ static int __init atomic_pool_init(void) | |||
297 | unsigned long nr_pages = pool->size >> PAGE_SHIFT; | 314 | unsigned long nr_pages = pool->size >> PAGE_SHIFT; |
298 | unsigned long *bitmap; | 315 | unsigned long *bitmap; |
299 | struct page *page; | 316 | struct page *page; |
317 | struct page **pages; | ||
300 | void *ptr; | 318 | void *ptr; |
301 | int bitmap_size = BITS_TO_LONGS(nr_pages) * sizeof(long); | 319 | int bitmap_size = BITS_TO_LONGS(nr_pages) * sizeof(long); |
302 | 320 | ||
@@ -304,21 +322,31 @@ static int __init atomic_pool_init(void) | |||
304 | if (!bitmap) | 322 | if (!bitmap) |
305 | goto no_bitmap; | 323 | goto no_bitmap; |
306 | 324 | ||
325 | pages = kzalloc(nr_pages * sizeof(struct page *), GFP_KERNEL); | ||
326 | if (!pages) | ||
327 | goto no_pages; | ||
328 | |||
307 | if (IS_ENABLED(CONFIG_CMA)) | 329 | if (IS_ENABLED(CONFIG_CMA)) |
308 | ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page); | 330 | ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page); |
309 | else | 331 | else |
310 | ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot, | 332 | ptr = __alloc_remap_buffer(NULL, pool->size, GFP_KERNEL, prot, |
311 | &page, NULL); | 333 | &page, NULL); |
312 | if (ptr) { | 334 | if (ptr) { |
335 | int i; | ||
336 | |||
337 | for (i = 0; i < nr_pages; i++) | ||
338 | pages[i] = page + i; | ||
339 | |||
313 | spin_lock_init(&pool->lock); | 340 | spin_lock_init(&pool->lock); |
314 | pool->vaddr = ptr; | 341 | pool->vaddr = ptr; |
315 | pool->page = page; | 342 | pool->pages = pages; |
316 | pool->bitmap = bitmap; | 343 | pool->bitmap = bitmap; |
317 | pool->nr_pages = nr_pages; | 344 | pool->nr_pages = nr_pages; |
318 | pr_info("DMA: preallocated %u KiB pool for atomic coherent allocations\n", | 345 | pr_info("DMA: preallocated %u KiB pool for atomic coherent allocations\n", |
319 | (unsigned)pool->size / 1024); | 346 | (unsigned)pool->size / 1024); |
320 | return 0; | 347 | return 0; |
321 | } | 348 | } |
349 | no_pages: | ||
322 | kfree(bitmap); | 350 | kfree(bitmap); |
323 | no_bitmap: | 351 | no_bitmap: |
324 | pr_err("DMA: failed to allocate %u KiB pool for atomic coherent allocation\n", | 352 | pr_err("DMA: failed to allocate %u KiB pool for atomic coherent allocation\n", |
@@ -443,27 +471,45 @@ static void *__alloc_from_pool(size_t size, struct page **ret_page) | |||
443 | if (pageno < pool->nr_pages) { | 471 | if (pageno < pool->nr_pages) { |
444 | bitmap_set(pool->bitmap, pageno, count); | 472 | bitmap_set(pool->bitmap, pageno, count); |
445 | ptr = pool->vaddr + PAGE_SIZE * pageno; | 473 | ptr = pool->vaddr + PAGE_SIZE * pageno; |
446 | *ret_page = pool->page + pageno; | 474 | *ret_page = pool->pages[pageno]; |
475 | } else { | ||
476 | pr_err_once("ERROR: %u KiB atomic DMA coherent pool is too small!\n" | ||
477 | "Please increase it with coherent_pool= kernel parameter!\n", | ||
478 | (unsigned)pool->size / 1024); | ||
447 | } | 479 | } |
448 | spin_unlock_irqrestore(&pool->lock, flags); | 480 | spin_unlock_irqrestore(&pool->lock, flags); |
449 | 481 | ||
450 | return ptr; | 482 | return ptr; |
451 | } | 483 | } |
452 | 484 | ||
485 | static bool __in_atomic_pool(void *start, size_t size) | ||
486 | { | ||
487 | struct dma_pool *pool = &atomic_pool; | ||
488 | void *end = start + size; | ||
489 | void *pool_start = pool->vaddr; | ||
490 | void *pool_end = pool->vaddr + pool->size; | ||
491 | |||
492 | if (start < pool_start || start > pool_end) | ||
493 | return false; | ||
494 | |||
495 | if (end <= pool_end) | ||
496 | return true; | ||
497 | |||
498 | WARN(1, "Wrong coherent size(%p-%p) from atomic pool(%p-%p)\n", | ||
499 | start, end - 1, pool_start, pool_end - 1); | ||
500 | |||
501 | return false; | ||
502 | } | ||
503 | |||
453 | static int __free_from_pool(void *start, size_t size) | 504 | static int __free_from_pool(void *start, size_t size) |
454 | { | 505 | { |
455 | struct dma_pool *pool = &atomic_pool; | 506 | struct dma_pool *pool = &atomic_pool; |
456 | unsigned long pageno, count; | 507 | unsigned long pageno, count; |
457 | unsigned long flags; | 508 | unsigned long flags; |
458 | 509 | ||
459 | if (start < pool->vaddr || start > pool->vaddr + pool->size) | 510 | if (!__in_atomic_pool(start, size)) |
460 | return 0; | 511 | return 0; |
461 | 512 | ||
462 | if (start + size > pool->vaddr + pool->size) { | ||
463 | WARN(1, "freeing wrong coherent size from pool\n"); | ||
464 | return 0; | ||
465 | } | ||
466 | |||
467 | pageno = (start - pool->vaddr) >> PAGE_SHIFT; | 513 | pageno = (start - pool->vaddr) >> PAGE_SHIFT; |
468 | count = size >> PAGE_SHIFT; | 514 | count = size >> PAGE_SHIFT; |
469 | 515 | ||
@@ -1090,10 +1136,22 @@ static int __iommu_remove_mapping(struct device *dev, dma_addr_t iova, size_t si | |||
1090 | return 0; | 1136 | return 0; |
1091 | } | 1137 | } |
1092 | 1138 | ||
1139 | static struct page **__atomic_get_pages(void *addr) | ||
1140 | { | ||
1141 | struct dma_pool *pool = &atomic_pool; | ||
1142 | struct page **pages = pool->pages; | ||
1143 | int offs = (addr - pool->vaddr) >> PAGE_SHIFT; | ||
1144 | |||
1145 | return pages + offs; | ||
1146 | } | ||
1147 | |||
1093 | static struct page **__iommu_get_pages(void *cpu_addr, struct dma_attrs *attrs) | 1148 | static struct page **__iommu_get_pages(void *cpu_addr, struct dma_attrs *attrs) |
1094 | { | 1149 | { |
1095 | struct vm_struct *area; | 1150 | struct vm_struct *area; |
1096 | 1151 | ||
1152 | if (__in_atomic_pool(cpu_addr, PAGE_SIZE)) | ||
1153 | return __atomic_get_pages(cpu_addr); | ||
1154 | |||
1097 | if (dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, attrs)) | 1155 | if (dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, attrs)) |
1098 | return cpu_addr; | 1156 | return cpu_addr; |
1099 | 1157 | ||
@@ -1103,6 +1161,34 @@ static struct page **__iommu_get_pages(void *cpu_addr, struct dma_attrs *attrs) | |||
1103 | return NULL; | 1161 | return NULL; |
1104 | } | 1162 | } |
1105 | 1163 | ||
1164 | static void *__iommu_alloc_atomic(struct device *dev, size_t size, | ||
1165 | dma_addr_t *handle) | ||
1166 | { | ||
1167 | struct page *page; | ||
1168 | void *addr; | ||
1169 | |||
1170 | addr = __alloc_from_pool(size, &page); | ||
1171 | if (!addr) | ||
1172 | return NULL; | ||
1173 | |||
1174 | *handle = __iommu_create_mapping(dev, &page, size); | ||
1175 | if (*handle == DMA_ERROR_CODE) | ||
1176 | goto err_mapping; | ||
1177 | |||
1178 | return addr; | ||
1179 | |||
1180 | err_mapping: | ||
1181 | __free_from_pool(addr, size); | ||
1182 | return NULL; | ||
1183 | } | ||
1184 | |||
1185 | static void __iommu_free_atomic(struct device *dev, struct page **pages, | ||
1186 | dma_addr_t handle, size_t size) | ||
1187 | { | ||
1188 | __iommu_remove_mapping(dev, handle, size); | ||
1189 | __free_from_pool(page_address(pages[0]), size); | ||
1190 | } | ||
1191 | |||
1106 | static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, | 1192 | static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, |
1107 | dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs) | 1193 | dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs) |
1108 | { | 1194 | { |
@@ -1113,6 +1199,9 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, | |||
1113 | *handle = DMA_ERROR_CODE; | 1199 | *handle = DMA_ERROR_CODE; |
1114 | size = PAGE_ALIGN(size); | 1200 | size = PAGE_ALIGN(size); |
1115 | 1201 | ||
1202 | if (gfp & GFP_ATOMIC) | ||
1203 | return __iommu_alloc_atomic(dev, size, handle); | ||
1204 | |||
1116 | pages = __iommu_alloc_buffer(dev, size, gfp); | 1205 | pages = __iommu_alloc_buffer(dev, size, gfp); |
1117 | if (!pages) | 1206 | if (!pages) |
1118 | return NULL; | 1207 | return NULL; |
@@ -1179,6 +1268,11 @@ void arm_iommu_free_attrs(struct device *dev, size_t size, void *cpu_addr, | |||
1179 | return; | 1268 | return; |
1180 | } | 1269 | } |
1181 | 1270 | ||
1271 | if (__in_atomic_pool(cpu_addr, size)) { | ||
1272 | __iommu_free_atomic(dev, pages, handle, size); | ||
1273 | return; | ||
1274 | } | ||
1275 | |||
1182 | if (!dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, attrs)) { | 1276 | if (!dma_get_attr(DMA_ATTR_NO_KERNEL_MAPPING, attrs)) { |
1183 | unmap_kernel_range((unsigned long)cpu_addr, size); | 1277 | unmap_kernel_range((unsigned long)cpu_addr, size); |
1184 | vunmap(cpu_addr); | 1278 | vunmap(cpu_addr); |
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index 53b6dfa8334..54b73a28c20 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h | |||
@@ -386,6 +386,7 @@ extern unsigned long cpuidle_disable; | |||
386 | enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; | 386 | enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; |
387 | 387 | ||
388 | extern int powersave_nap; /* set if nap mode can be used in idle loop */ | 388 | extern int powersave_nap; /* set if nap mode can be used in idle loop */ |
389 | extern void power7_nap(void); | ||
389 | 390 | ||
390 | #ifdef CONFIG_PSERIES_IDLE | 391 | #ifdef CONFIG_PSERIES_IDLE |
391 | extern void update_smt_snooze_delay(int snooze); | 392 | extern void update_smt_snooze_delay(int snooze); |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 85b05c463fa..e8995727b1c 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -76,6 +76,7 @@ int main(void) | |||
76 | DEFINE(SIGSEGV, SIGSEGV); | 76 | DEFINE(SIGSEGV, SIGSEGV); |
77 | DEFINE(NMI_MASK, NMI_MASK); | 77 | DEFINE(NMI_MASK, NMI_MASK); |
78 | DEFINE(THREAD_DSCR, offsetof(struct thread_struct, dscr)); | 78 | DEFINE(THREAD_DSCR, offsetof(struct thread_struct, dscr)); |
79 | DEFINE(THREAD_DSCR_INHERIT, offsetof(struct thread_struct, dscr_inherit)); | ||
79 | #else | 80 | #else |
80 | DEFINE(THREAD_INFO, offsetof(struct task_struct, stack)); | 81 | DEFINE(THREAD_INFO, offsetof(struct task_struct, stack)); |
81 | #endif /* CONFIG_PPC64 */ | 82 | #endif /* CONFIG_PPC64 */ |
diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c index 5b25c8060fd..a892680668d 100644 --- a/arch/powerpc/kernel/dbell.c +++ b/arch/powerpc/kernel/dbell.c | |||
@@ -28,6 +28,8 @@ void doorbell_setup_this_cpu(void) | |||
28 | 28 | ||
29 | void doorbell_cause_ipi(int cpu, unsigned long data) | 29 | void doorbell_cause_ipi(int cpu, unsigned long data) |
30 | { | 30 | { |
31 | /* Order previous accesses vs. msgsnd, which is treated as a store */ | ||
32 | mb(); | ||
31 | ppc_msgsnd(PPC_DBELL, 0, data); | 33 | ppc_msgsnd(PPC_DBELL, 0, data); |
32 | } | 34 | } |
33 | 35 | ||
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 4b01a25e29e..b40e0b4815b 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -370,6 +370,12 @@ _GLOBAL(ret_from_fork) | |||
370 | li r3,0 | 370 | li r3,0 |
371 | b syscall_exit | 371 | b syscall_exit |
372 | 372 | ||
373 | .section ".toc","aw" | ||
374 | DSCR_DEFAULT: | ||
375 | .tc dscr_default[TC],dscr_default | ||
376 | |||
377 | .section ".text" | ||
378 | |||
373 | /* | 379 | /* |
374 | * This routine switches between two different tasks. The process | 380 | * This routine switches between two different tasks. The process |
375 | * state of one is saved on its kernel stack. Then the state | 381 | * state of one is saved on its kernel stack. Then the state |
@@ -509,9 +515,6 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT) | |||
509 | mr r1,r8 /* start using new stack pointer */ | 515 | mr r1,r8 /* start using new stack pointer */ |
510 | std r7,PACAKSAVE(r13) | 516 | std r7,PACAKSAVE(r13) |
511 | 517 | ||
512 | ld r6,_CCR(r1) | ||
513 | mtcrf 0xFF,r6 | ||
514 | |||
515 | #ifdef CONFIG_ALTIVEC | 518 | #ifdef CONFIG_ALTIVEC |
516 | BEGIN_FTR_SECTION | 519 | BEGIN_FTR_SECTION |
517 | ld r0,THREAD_VRSAVE(r4) | 520 | ld r0,THREAD_VRSAVE(r4) |
@@ -520,14 +523,22 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | |||
520 | #endif /* CONFIG_ALTIVEC */ | 523 | #endif /* CONFIG_ALTIVEC */ |
521 | #ifdef CONFIG_PPC64 | 524 | #ifdef CONFIG_PPC64 |
522 | BEGIN_FTR_SECTION | 525 | BEGIN_FTR_SECTION |
526 | lwz r6,THREAD_DSCR_INHERIT(r4) | ||
527 | ld r7,DSCR_DEFAULT@toc(2) | ||
523 | ld r0,THREAD_DSCR(r4) | 528 | ld r0,THREAD_DSCR(r4) |
524 | cmpd r0,r25 | 529 | cmpwi r6,0 |
525 | beq 1f | 530 | bne 1f |
531 | ld r0,0(r7) | ||
532 | 1: cmpd r0,r25 | ||
533 | beq 2f | ||
526 | mtspr SPRN_DSCR,r0 | 534 | mtspr SPRN_DSCR,r0 |
527 | 1: | 535 | 2: |
528 | END_FTR_SECTION_IFSET(CPU_FTR_DSCR) | 536 | END_FTR_SECTION_IFSET(CPU_FTR_DSCR) |
529 | #endif | 537 | #endif |
530 | 538 | ||
539 | ld r6,_CCR(r1) | ||
540 | mtcrf 0xFF,r6 | ||
541 | |||
531 | /* r3-r13 are destroyed -- Cort */ | 542 | /* r3-r13 are destroyed -- Cort */ |
532 | REST_8GPRS(14, r1) | 543 | REST_8GPRS(14, r1) |
533 | REST_10GPRS(22, r1) | 544 | REST_10GPRS(22, r1) |
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index e894515e77b..39aa97d3ff8 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -186,7 +186,7 @@ hardware_interrupt_hv: | |||
186 | KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800) | 186 | KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0x800) |
187 | 187 | ||
188 | MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer) | 188 | MASKABLE_EXCEPTION_PSERIES(0x900, 0x900, decrementer) |
189 | MASKABLE_EXCEPTION_HV(0x980, 0x982, decrementer) | 189 | STD_EXCEPTION_HV(0x980, 0x982, hdecrementer) |
190 | 190 | ||
191 | STD_EXCEPTION_PSERIES(0xa00, 0xa00, trap_0a) | 191 | STD_EXCEPTION_PSERIES(0xa00, 0xa00, trap_0a) |
192 | KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xa00) | 192 | KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xa00) |
@@ -486,6 +486,7 @@ machine_check_common: | |||
486 | 486 | ||
487 | STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ) | 487 | STD_EXCEPTION_COMMON_ASYNC(0x500, hardware_interrupt, do_IRQ) |
488 | STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt) | 488 | STD_EXCEPTION_COMMON_ASYNC(0x900, decrementer, .timer_interrupt) |
489 | STD_EXCEPTION_COMMON(0x980, hdecrementer, .hdec_interrupt) | ||
489 | STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception) | 490 | STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception) |
490 | STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) | 491 | STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) |
491 | STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) | 492 | STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) |
diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S index 7140d838339..e11863f4e59 100644 --- a/arch/powerpc/kernel/idle_power7.S +++ b/arch/powerpc/kernel/idle_power7.S | |||
@@ -28,7 +28,9 @@ _GLOBAL(power7_idle) | |||
28 | lwz r4,ADDROFF(powersave_nap)(r3) | 28 | lwz r4,ADDROFF(powersave_nap)(r3) |
29 | cmpwi 0,r4,0 | 29 | cmpwi 0,r4,0 |
30 | beqlr | 30 | beqlr |
31 | /* fall through */ | ||
31 | 32 | ||
33 | _GLOBAL(power7_nap) | ||
32 | /* NAP is a state loss, we create a regs frame on the | 34 | /* NAP is a state loss, we create a regs frame on the |
33 | * stack, fill it up with the state we care about and | 35 | * stack, fill it up with the state we care about and |
34 | * stick a pointer to it in PACAR1. We really only | 36 | * stick a pointer to it in PACAR1. We really only |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 710f400476d..1a1f2ddfb58 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -802,16 +802,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
802 | #endif /* CONFIG_PPC_STD_MMU_64 */ | 802 | #endif /* CONFIG_PPC_STD_MMU_64 */ |
803 | #ifdef CONFIG_PPC64 | 803 | #ifdef CONFIG_PPC64 |
804 | if (cpu_has_feature(CPU_FTR_DSCR)) { | 804 | if (cpu_has_feature(CPU_FTR_DSCR)) { |
805 | if (current->thread.dscr_inherit) { | 805 | p->thread.dscr_inherit = current->thread.dscr_inherit; |
806 | p->thread.dscr_inherit = 1; | 806 | p->thread.dscr = current->thread.dscr; |
807 | p->thread.dscr = current->thread.dscr; | ||
808 | } else if (0 != dscr_default) { | ||
809 | p->thread.dscr_inherit = 1; | ||
810 | p->thread.dscr = dscr_default; | ||
811 | } else { | ||
812 | p->thread.dscr_inherit = 0; | ||
813 | p->thread.dscr = 0; | ||
814 | } | ||
815 | } | 807 | } |
816 | #endif | 808 | #endif |
817 | 809 | ||
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 0321007086f..8d4214afc21 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -198,8 +198,15 @@ void smp_muxed_ipi_message_pass(int cpu, int msg) | |||
198 | struct cpu_messages *info = &per_cpu(ipi_message, cpu); | 198 | struct cpu_messages *info = &per_cpu(ipi_message, cpu); |
199 | char *message = (char *)&info->messages; | 199 | char *message = (char *)&info->messages; |
200 | 200 | ||
201 | /* | ||
202 | * Order previous accesses before accesses in the IPI handler. | ||
203 | */ | ||
204 | smp_mb(); | ||
201 | message[msg] = 1; | 205 | message[msg] = 1; |
202 | mb(); | 206 | /* |
207 | * cause_ipi functions are required to include a full barrier | ||
208 | * before doing whatever causes the IPI. | ||
209 | */ | ||
203 | smp_ops->cause_ipi(cpu, info->data); | 210 | smp_ops->cause_ipi(cpu, info->data); |
204 | } | 211 | } |
205 | 212 | ||
@@ -211,7 +218,7 @@ irqreturn_t smp_ipi_demux(void) | |||
211 | mb(); /* order any irq clear */ | 218 | mb(); /* order any irq clear */ |
212 | 219 | ||
213 | do { | 220 | do { |
214 | all = xchg_local(&info->messages, 0); | 221 | all = xchg(&info->messages, 0); |
215 | 222 | ||
216 | #ifdef __BIG_ENDIAN | 223 | #ifdef __BIG_ENDIAN |
217 | if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNCTION))) | 224 | if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNCTION))) |
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 3529446c2ab..8302af64921 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -194,6 +194,14 @@ static ssize_t show_dscr_default(struct device *dev, | |||
194 | return sprintf(buf, "%lx\n", dscr_default); | 194 | return sprintf(buf, "%lx\n", dscr_default); |
195 | } | 195 | } |
196 | 196 | ||
197 | static void update_dscr(void *dummy) | ||
198 | { | ||
199 | if (!current->thread.dscr_inherit) { | ||
200 | current->thread.dscr = dscr_default; | ||
201 | mtspr(SPRN_DSCR, dscr_default); | ||
202 | } | ||
203 | } | ||
204 | |||
197 | static ssize_t __used store_dscr_default(struct device *dev, | 205 | static ssize_t __used store_dscr_default(struct device *dev, |
198 | struct device_attribute *attr, const char *buf, | 206 | struct device_attribute *attr, const char *buf, |
199 | size_t count) | 207 | size_t count) |
@@ -206,6 +214,8 @@ static ssize_t __used store_dscr_default(struct device *dev, | |||
206 | return -EINVAL; | 214 | return -EINVAL; |
207 | dscr_default = val; | 215 | dscr_default = val; |
208 | 216 | ||
217 | on_each_cpu(update_dscr, NULL, 1); | ||
218 | |||
209 | return count; | 219 | return count; |
210 | } | 220 | } |
211 | 221 | ||
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index be171ee73bf..e49e93191b6 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -535,6 +535,15 @@ void timer_interrupt(struct pt_regs * regs) | |||
535 | trace_timer_interrupt_exit(regs); | 535 | trace_timer_interrupt_exit(regs); |
536 | } | 536 | } |
537 | 537 | ||
538 | /* | ||
539 | * Hypervisor decrementer interrupts shouldn't occur but are sometimes | ||
540 | * left pending on exit from a KVM guest. We don't need to do anything | ||
541 | * to clear them, as they are edge-triggered. | ||
542 | */ | ||
543 | void hdec_interrupt(struct pt_regs *regs) | ||
544 | { | ||
545 | } | ||
546 | |||
538 | #ifdef CONFIG_SUSPEND | 547 | #ifdef CONFIG_SUSPEND |
539 | static void generic_suspend_disable_irqs(void) | 548 | static void generic_suspend_disable_irqs(void) |
540 | { | 549 | { |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 158972341a2..ae0843fa7a6 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -972,8 +972,9 @@ static int emulate_instruction(struct pt_regs *regs) | |||
972 | cpu_has_feature(CPU_FTR_DSCR)) { | 972 | cpu_has_feature(CPU_FTR_DSCR)) { |
973 | PPC_WARN_EMULATED(mtdscr, regs); | 973 | PPC_WARN_EMULATED(mtdscr, regs); |
974 | rd = (instword >> 21) & 0x1f; | 974 | rd = (instword >> 21) & 0x1f; |
975 | mtspr(SPRN_DSCR, regs->gpr[rd]); | 975 | current->thread.dscr = regs->gpr[rd]; |
976 | current->thread.dscr_inherit = 1; | 976 | current->thread.dscr_inherit = 1; |
977 | mtspr(SPRN_DSCR, current->thread.dscr); | ||
977 | return 0; | 978 | return 0; |
978 | } | 979 | } |
979 | #endif | 980 | #endif |
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index dd223b3eb33..17e5b236431 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c | |||
@@ -20,7 +20,7 @@ int patch_instruction(unsigned int *addr, unsigned int instr) | |||
20 | { | 20 | { |
21 | int err; | 21 | int err; |
22 | 22 | ||
23 | err = __put_user(instr, addr); | 23 | __put_user_size(instr, addr, 4, err); |
24 | if (err) | 24 | if (err) |
25 | return err; | 25 | return err; |
26 | asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); | 26 | asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 39b159751c3..59213cfaeca 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -1436,11 +1436,11 @@ static long vphn_get_associativity(unsigned long cpu, | |||
1436 | 1436 | ||
1437 | /* | 1437 | /* |
1438 | * Update the node maps and sysfs entries for each cpu whose home node | 1438 | * Update the node maps and sysfs entries for each cpu whose home node |
1439 | * has changed. | 1439 | * has changed. Returns 1 when the topology has changed, and 0 otherwise. |
1440 | */ | 1440 | */ |
1441 | int arch_update_cpu_topology(void) | 1441 | int arch_update_cpu_topology(void) |
1442 | { | 1442 | { |
1443 | int cpu, nid, old_nid; | 1443 | int cpu, nid, old_nid, changed = 0; |
1444 | unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0}; | 1444 | unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0}; |
1445 | struct device *dev; | 1445 | struct device *dev; |
1446 | 1446 | ||
@@ -1466,9 +1466,10 @@ int arch_update_cpu_topology(void) | |||
1466 | dev = get_cpu_device(cpu); | 1466 | dev = get_cpu_device(cpu); |
1467 | if (dev) | 1467 | if (dev) |
1468 | kobject_uevent(&dev->kobj, KOBJ_CHANGE); | 1468 | kobject_uevent(&dev->kobj, KOBJ_CHANGE); |
1469 | changed = 1; | ||
1469 | } | 1470 | } |
1470 | 1471 | ||
1471 | return 1; | 1472 | return changed; |
1472 | } | 1473 | } |
1473 | 1474 | ||
1474 | static void topology_work_fn(struct work_struct *work) | 1475 | static void topology_work_fn(struct work_struct *work) |
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c index 3ef46254c35..7698b6e13c5 100644 --- a/arch/powerpc/platforms/powernv/smp.c +++ b/arch/powerpc/platforms/powernv/smp.c | |||
@@ -106,14 +106,6 @@ static void pnv_smp_cpu_kill_self(void) | |||
106 | { | 106 | { |
107 | unsigned int cpu; | 107 | unsigned int cpu; |
108 | 108 | ||
109 | /* If powersave_nap is enabled, use NAP mode, else just | ||
110 | * spin aimlessly | ||
111 | */ | ||
112 | if (!powersave_nap) { | ||
113 | generic_mach_cpu_die(); | ||
114 | return; | ||
115 | } | ||
116 | |||
117 | /* Standard hot unplug procedure */ | 109 | /* Standard hot unplug procedure */ |
118 | local_irq_disable(); | 110 | local_irq_disable(); |
119 | idle_task_exit(); | 111 | idle_task_exit(); |
@@ -128,7 +120,7 @@ static void pnv_smp_cpu_kill_self(void) | |||
128 | */ | 120 | */ |
129 | mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); | 121 | mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); |
130 | while (!generic_check_cpu_restart(cpu)) { | 122 | while (!generic_check_cpu_restart(cpu)) { |
131 | power7_idle(); | 123 | power7_nap(); |
132 | if (!generic_check_cpu_restart(cpu)) { | 124 | if (!generic_check_cpu_restart(cpu)) { |
133 | DBG("CPU%d Unexpected exit while offline !\n", cpu); | 125 | DBG("CPU%d Unexpected exit while offline !\n", cpu); |
134 | /* We may be getting an IPI, so we re-enable | 126 | /* We may be getting an IPI, so we re-enable |
diff --git a/arch/powerpc/sysdev/xics/icp-hv.c b/arch/powerpc/sysdev/xics/icp-hv.c index 14469cf9df6..df0fc582146 100644 --- a/arch/powerpc/sysdev/xics/icp-hv.c +++ b/arch/powerpc/sysdev/xics/icp-hv.c | |||
@@ -65,7 +65,11 @@ static inline void icp_hv_set_xirr(unsigned int value) | |||
65 | static inline void icp_hv_set_qirr(int n_cpu , u8 value) | 65 | static inline void icp_hv_set_qirr(int n_cpu , u8 value) |
66 | { | 66 | { |
67 | int hw_cpu = get_hard_smp_processor_id(n_cpu); | 67 | int hw_cpu = get_hard_smp_processor_id(n_cpu); |
68 | long rc = plpar_hcall_norets(H_IPI, hw_cpu, value); | 68 | long rc; |
69 | |||
70 | /* Make sure all previous accesses are ordered before IPI sending */ | ||
71 | mb(); | ||
72 | rc = plpar_hcall_norets(H_IPI, hw_cpu, value); | ||
69 | if (rc != H_SUCCESS) { | 73 | if (rc != H_SUCCESS) { |
70 | pr_err("%s: bad return code qirr cpu=%d hw_cpu=%d mfrr=0x%x " | 74 | pr_err("%s: bad return code qirr cpu=%d hw_cpu=%d mfrr=0x%x " |
71 | "returned %ld\n", __func__, n_cpu, hw_cpu, value, rc); | 75 | "returned %ld\n", __func__, n_cpu, hw_cpu, value, rc); |
diff --git a/arch/um/os-Linux/time.c b/arch/um/os-Linux/time.c index f60238559af..0748fe0c8a7 100644 --- a/arch/um/os-Linux/time.c +++ b/arch/um/os-Linux/time.c | |||
@@ -114,7 +114,7 @@ static void deliver_alarm(void) | |||
114 | skew += this_tick - last_tick; | 114 | skew += this_tick - last_tick; |
115 | 115 | ||
116 | while (skew >= one_tick) { | 116 | while (skew >= one_tick) { |
117 | alarm_handler(SIGVTALRM, NULL); | 117 | alarm_handler(SIGVTALRM, NULL, NULL); |
118 | skew -= one_tick; | 118 | skew -= one_tick; |
119 | } | 119 | } |
120 | 120 | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index b65a76133f4..5141d808e75 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1283,7 +1283,7 @@ static void xen_flush_tlb_others(const struct cpumask *cpus, | |||
1283 | cpumask_clear_cpu(smp_processor_id(), to_cpumask(args->mask)); | 1283 | cpumask_clear_cpu(smp_processor_id(), to_cpumask(args->mask)); |
1284 | 1284 | ||
1285 | args->op.cmd = MMUEXT_TLB_FLUSH_MULTI; | 1285 | args->op.cmd = MMUEXT_TLB_FLUSH_MULTI; |
1286 | if (start != TLB_FLUSH_ALL && (end - start) <= PAGE_SIZE) { | 1286 | if (end != TLB_FLUSH_ALL && (end - start) <= PAGE_SIZE) { |
1287 | args->op.cmd = MMUEXT_INVLPG_MULTI; | 1287 | args->op.cmd = MMUEXT_INVLPG_MULTI; |
1288 | args->op.arg1.linear_addr = start; | 1288 | args->op.arg1.linear_addr = start; |
1289 | } | 1289 | } |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index d4b25546325..76ba0e97e53 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -599,7 +599,7 @@ bool __init early_can_reuse_p2m_middle(unsigned long set_pfn, unsigned long set_ | |||
599 | if (p2m_index(set_pfn)) | 599 | if (p2m_index(set_pfn)) |
600 | return false; | 600 | return false; |
601 | 601 | ||
602 | for (pfn = 0; pfn <= MAX_DOMAIN_PAGES; pfn += P2M_PER_PAGE) { | 602 | for (pfn = 0; pfn < MAX_DOMAIN_PAGES; pfn += P2M_PER_PAGE) { |
603 | topidx = p2m_top_index(pfn); | 603 | topidx = p2m_top_index(pfn); |
604 | 604 | ||
605 | if (!p2m_top[topidx]) | 605 | if (!p2m_top[topidx]) |