diff options
162 files changed, 2061 insertions, 796 deletions
| @@ -23,6 +23,7 @@ Andy Adamson <andros@citi.umich.edu> | |||
| 23 | Arnaud Patard <arnaud.patard@rtp-net.org> | 23 | Arnaud Patard <arnaud.patard@rtp-net.org> |
| 24 | Arnd Bergmann <arnd@arndb.de> | 24 | Arnd Bergmann <arnd@arndb.de> |
| 25 | Axel Dyks <xl@xlsigned.net> | 25 | Axel Dyks <xl@xlsigned.net> |
| 26 | Axel Lin <axel.lin@gmail.com> | ||
| 26 | Ben Gardner <bgardner@wabtec.com> | 27 | Ben Gardner <bgardner@wabtec.com> |
| 27 | Ben M Cahill <ben.m.cahill@intel.com> | 28 | Ben M Cahill <ben.m.cahill@intel.com> |
| 28 | Björn Steinbrink <B.Steinbrink@gmx.de> | 29 | Björn Steinbrink <B.Steinbrink@gmx.de> |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index b72e071a3e5..89835a4766a 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -43,11 +43,11 @@ parameter is applicable: | |||
| 43 | AVR32 AVR32 architecture is enabled. | 43 | AVR32 AVR32 architecture is enabled. |
| 44 | AX25 Appropriate AX.25 support is enabled. | 44 | AX25 Appropriate AX.25 support is enabled. |
| 45 | BLACKFIN Blackfin architecture is enabled. | 45 | BLACKFIN Blackfin architecture is enabled. |
| 46 | DRM Direct Rendering Management support is enabled. | ||
| 47 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime | ||
| 46 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled | 48 | EDD BIOS Enhanced Disk Drive Services (EDD) is enabled |
| 47 | EFI EFI Partitioning (GPT) is enabled | 49 | EFI EFI Partitioning (GPT) is enabled |
| 48 | EIDE EIDE/ATAPI support is enabled. | 50 | EIDE EIDE/ATAPI support is enabled. |
| 49 | DRM Direct Rendering Management support is enabled. | ||
| 50 | DYNAMIC_DEBUG Build in debug messages and enable them at runtime | ||
| 51 | FB The frame buffer device is enabled. | 51 | FB The frame buffer device is enabled. |
| 52 | GCOV GCOV profiling is enabled. | 52 | GCOV GCOV profiling is enabled. |
| 53 | HW Appropriate hardware is enabled. | 53 | HW Appropriate hardware is enabled. |
diff --git a/arch/arm/include/asm/hardware/sp810.h b/arch/arm/include/asm/hardware/sp810.h index a101f10bb5b..721847dc68a 100644 --- a/arch/arm/include/asm/hardware/sp810.h +++ b/arch/arm/include/asm/hardware/sp810.h | |||
| @@ -50,6 +50,12 @@ | |||
| 50 | #define SCPCELLID2 0xFF8 | 50 | #define SCPCELLID2 0xFF8 |
| 51 | #define SCPCELLID3 0xFFC | 51 | #define SCPCELLID3 0xFFC |
| 52 | 52 | ||
| 53 | #define SCCTRL_TIMEREN0SEL_REFCLK (0 << 15) | ||
| 54 | #define SCCTRL_TIMEREN0SEL_TIMCLK (1 << 15) | ||
| 55 | |||
| 56 | #define SCCTRL_TIMEREN1SEL_REFCLK (0 << 17) | ||
| 57 | #define SCCTRL_TIMEREN1SEL_TIMCLK (1 << 17) | ||
| 58 | |||
| 53 | static inline void sysctl_soft_reset(void __iomem *base) | 59 | static inline void sysctl_soft_reset(void __iomem *base) |
| 54 | { | 60 | { |
| 55 | /* writing any value to SCSYSSTAT reg will reset system */ | 61 | /* writing any value to SCSYSSTAT reg will reset system */ |
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 23c2e8e5c0f..d0ee74b7cf8 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
| @@ -188,7 +188,7 @@ | |||
| 188 | * translation for translating DMA addresses. Use the driver | 188 | * translation for translating DMA addresses. Use the driver |
| 189 | * DMA support - see dma-mapping.h. | 189 | * DMA support - see dma-mapping.h. |
| 190 | */ | 190 | */ |
| 191 | static inline unsigned long virt_to_phys(void *x) | 191 | static inline unsigned long virt_to_phys(const volatile void *x) |
| 192 | { | 192 | { |
| 193 | return __virt_to_phys((unsigned long)(x)); | 193 | return __virt_to_phys((unsigned long)(x)); |
| 194 | } | 194 | } |
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index fd9156698ab..60636f499cb 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
| @@ -36,6 +36,7 @@ static void twd_set_mode(enum clock_event_mode mode, | |||
| 36 | /* timer load already set up */ | 36 | /* timer load already set up */ |
| 37 | ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE | 37 | ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE |
| 38 | | TWD_TIMER_CONTROL_PERIODIC; | 38 | | TWD_TIMER_CONTROL_PERIODIC; |
| 39 | __raw_writel(twd_timer_rate / HZ, twd_base + TWD_TIMER_LOAD); | ||
| 39 | break; | 40 | break; |
| 40 | case CLOCK_EVT_MODE_ONESHOT: | 41 | case CLOCK_EVT_MODE_ONESHOT: |
| 41 | /* period set, and timer enabled in 'next_event' hook */ | 42 | /* period set, and timer enabled in 'next_event' hook */ |
| @@ -81,7 +82,7 @@ int twd_timer_ack(void) | |||
| 81 | 82 | ||
| 82 | static void __cpuinit twd_calibrate_rate(void) | 83 | static void __cpuinit twd_calibrate_rate(void) |
| 83 | { | 84 | { |
| 84 | unsigned long load, count; | 85 | unsigned long count; |
| 85 | u64 waitjiffies; | 86 | u64 waitjiffies; |
| 86 | 87 | ||
| 87 | /* | 88 | /* |
| @@ -116,10 +117,6 @@ static void __cpuinit twd_calibrate_rate(void) | |||
| 116 | printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000, | 117 | printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000, |
| 117 | (twd_timer_rate / 1000000) % 100); | 118 | (twd_timer_rate / 1000000) % 100); |
| 118 | } | 119 | } |
| 119 | |||
| 120 | load = twd_timer_rate / HZ; | ||
| 121 | |||
| 122 | __raw_writel(load, twd_base + TWD_TIMER_LOAD); | ||
| 123 | } | 120 | } |
| 124 | 121 | ||
| 125 | /* | 122 | /* |
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c index f3dc76fdcea..bec34b83495 100644 --- a/arch/arm/mach-ep93xx/gpio.c +++ b/arch/arm/mach-ep93xx/gpio.c | |||
| @@ -427,6 +427,13 @@ void __init ep93xx_gpio_init(void) | |||
| 427 | { | 427 | { |
| 428 | int i; | 428 | int i; |
| 429 | 429 | ||
| 430 | /* Set Ports C, D, E, G, and H for GPIO use */ | ||
| 431 | ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_KEYS | | ||
| 432 | EP93XX_SYSCON_DEVCFG_GONK | | ||
| 433 | EP93XX_SYSCON_DEVCFG_EONIDE | | ||
| 434 | EP93XX_SYSCON_DEVCFG_GONIDE | | ||
| 435 | EP93XX_SYSCON_DEVCFG_HONIDE); | ||
| 436 | |||
| 430 | for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++) | 437 | for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++) |
| 431 | gpiochip_add(&ep93xx_gpio_banks[i].chip); | 438 | gpiochip_add(&ep93xx_gpio_banks[i].chip); |
| 432 | } | 439 | } |
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 9e5dc8ed51e..97feb3ab6a6 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
| @@ -134,7 +134,7 @@ static void omap2_enter_full_retention(void) | |||
| 134 | 134 | ||
| 135 | /* Block console output in case it is on one of the OMAP UARTs */ | 135 | /* Block console output in case it is on one of the OMAP UARTs */ |
| 136 | if (!is_suspending()) | 136 | if (!is_suspending()) |
| 137 | if (try_acquire_console_sem()) | 137 | if (!console_trylock()) |
| 138 | goto no_sleep; | 138 | goto no_sleep; |
| 139 | 139 | ||
| 140 | omap_uart_prepare_idle(0); | 140 | omap_uart_prepare_idle(0); |
| @@ -151,7 +151,7 @@ static void omap2_enter_full_retention(void) | |||
| 151 | omap_uart_resume_idle(0); | 151 | omap_uart_resume_idle(0); |
| 152 | 152 | ||
| 153 | if (!is_suspending()) | 153 | if (!is_suspending()) |
| 154 | release_console_sem(); | 154 | console_unlock(); |
| 155 | 155 | ||
| 156 | no_sleep: | 156 | no_sleep: |
| 157 | if (omap2_pm_debug) { | 157 | if (omap2_pm_debug) { |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 8cbbeade4b8..a4aa1920a75 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
| @@ -398,7 +398,7 @@ void omap_sram_idle(void) | |||
| 398 | if (!is_suspending()) | 398 | if (!is_suspending()) |
| 399 | if (per_next_state < PWRDM_POWER_ON || | 399 | if (per_next_state < PWRDM_POWER_ON || |
| 400 | core_next_state < PWRDM_POWER_ON) | 400 | core_next_state < PWRDM_POWER_ON) |
| 401 | if (try_acquire_console_sem()) | 401 | if (!console_trylock()) |
| 402 | goto console_still_active; | 402 | goto console_still_active; |
| 403 | 403 | ||
| 404 | /* PER */ | 404 | /* PER */ |
| @@ -481,7 +481,7 @@ void omap_sram_idle(void) | |||
| 481 | } | 481 | } |
| 482 | 482 | ||
| 483 | if (!is_suspending()) | 483 | if (!is_suspending()) |
| 484 | release_console_sem(); | 484 | console_unlock(); |
| 485 | 485 | ||
| 486 | console_still_active: | 486 | console_still_active: |
| 487 | /* Disable IO-PAD and IO-CHAIN wakeup */ | 487 | /* Disable IO-PAD and IO-CHAIN wakeup */ |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 302da7403a1..32e91a9c8b6 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
| @@ -812,7 +812,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata) | |||
| 812 | 812 | ||
| 813 | oh->dev_attr = uart; | 813 | oh->dev_attr = uart; |
| 814 | 814 | ||
| 815 | acquire_console_sem(); /* in case the earlycon is on the UART */ | 815 | console_lock(); /* in case the earlycon is on the UART */ |
| 816 | 816 | ||
| 817 | /* | 817 | /* |
| 818 | * Because of early UART probing, UART did not get idled | 818 | * Because of early UART probing, UART did not get idled |
| @@ -838,7 +838,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata) | |||
| 838 | omap_uart_block_sleep(uart); | 838 | omap_uart_block_sleep(uart); |
| 839 | uart->timeout = DEFAULT_TIMEOUT; | 839 | uart->timeout = DEFAULT_TIMEOUT; |
| 840 | 840 | ||
| 841 | release_console_sem(); | 841 | console_unlock(); |
| 842 | 842 | ||
| 843 | if ((cpu_is_omap34xx() && uart->padconf) || | 843 | if ((cpu_is_omap34xx() && uart->padconf) || |
| 844 | (uart->wk_en && uart->wk_mask)) { | 844 | (uart->wk_en && uart->wk_mask)) { |
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig index b4575ae9648..7ca138a943a 100644 --- a/arch/arm/mach-realview/Kconfig +++ b/arch/arm/mach-realview/Kconfig | |||
| @@ -2,52 +2,56 @@ menu "RealView platform type" | |||
| 2 | depends on ARCH_REALVIEW | 2 | depends on ARCH_REALVIEW |
| 3 | 3 | ||
| 4 | config MACH_REALVIEW_EB | 4 | config MACH_REALVIEW_EB |
| 5 | bool "Support RealView/EB platform" | 5 | bool "Support RealView(R) Emulation Baseboard" |
| 6 | select ARM_GIC | 6 | select ARM_GIC |
| 7 | help | 7 | help |
| 8 | Include support for the ARM(R) RealView Emulation Baseboard platform. | 8 | Include support for the ARM(R) RealView(R) Emulation Baseboard |
| 9 | platform. | ||
| 9 | 10 | ||
| 10 | config REALVIEW_EB_A9MP | 11 | config REALVIEW_EB_A9MP |
| 11 | bool "Support Multicore Cortex-A9" | 12 | bool "Support Multicore Cortex-A9 Tile" |
| 12 | depends on MACH_REALVIEW_EB | 13 | depends on MACH_REALVIEW_EB |
| 13 | select CPU_V7 | 14 | select CPU_V7 |
| 14 | help | 15 | help |
| 15 | Enable support for the Cortex-A9MPCore tile on the Realview platform. | 16 | Enable support for the Cortex-A9MPCore tile fitted to the |
| 17 | Realview(R) Emulation Baseboard platform. | ||
| 16 | 18 | ||
| 17 | config REALVIEW_EB_ARM11MP | 19 | config REALVIEW_EB_ARM11MP |
| 18 | bool "Support ARM11MPCore tile" | 20 | bool "Support ARM11MPCore Tile" |
| 19 | depends on MACH_REALVIEW_EB | 21 | depends on MACH_REALVIEW_EB |
| 20 | select CPU_V6 | 22 | select CPU_V6 |
| 21 | select ARCH_HAS_BARRIERS if SMP | 23 | select ARCH_HAS_BARRIERS if SMP |
| 22 | help | 24 | help |
| 23 | Enable support for the ARM11MPCore tile on the Realview platform. | 25 | Enable support for the ARM11MPCore tile fitted to the Realview(R) |
| 26 | Emulation Baseboard platform. | ||
| 24 | 27 | ||
| 25 | config REALVIEW_EB_ARM11MP_REVB | 28 | config REALVIEW_EB_ARM11MP_REVB |
| 26 | bool "Support ARM11MPCore RevB tile" | 29 | bool "Support ARM11MPCore RevB Tile" |
| 27 | depends on REALVIEW_EB_ARM11MP | 30 | depends on REALVIEW_EB_ARM11MP |
| 28 | help | 31 | help |
| 29 | Enable support for the ARM11MPCore RevB tile on the Realview | 32 | Enable support for the ARM11MPCore Revision B tile on the |
| 30 | platform. Since there are device address differences, a | 33 | Realview(R) Emulation Baseboard platform. Since there are device |
| 31 | kernel built with this option enabled is not compatible with | 34 | address differences, a kernel built with this option enabled is |
| 32 | other revisions of the ARM11MPCore tile. | 35 | not compatible with other revisions of the ARM11MPCore tile. |
| 33 | 36 | ||
| 34 | config MACH_REALVIEW_PB11MP | 37 | config MACH_REALVIEW_PB11MP |
| 35 | bool "Support RealView/PB11MPCore platform" | 38 | bool "Support RealView(R) Platform Baseboard for ARM11MPCore" |
| 36 | select CPU_V6 | 39 | select CPU_V6 |
| 37 | select ARM_GIC | 40 | select ARM_GIC |
| 38 | select HAVE_PATA_PLATFORM | 41 | select HAVE_PATA_PLATFORM |
| 39 | select ARCH_HAS_BARRIERS if SMP | 42 | select ARCH_HAS_BARRIERS if SMP |
| 40 | help | 43 | help |
| 41 | Include support for the ARM(R) RealView MPCore Platform Baseboard. | 44 | Include support for the ARM(R) RealView(R) Platform Baseboard for |
| 42 | PB11MPCore is a platform with an on-board ARM11MPCore and has | 45 | the ARM11MPCore. This platform has an on-board ARM11MPCore and has |
| 43 | support for PCI-E and Compact Flash. | 46 | support for PCI-E and Compact Flash. |
| 44 | 47 | ||
| 45 | config MACH_REALVIEW_PB1176 | 48 | config MACH_REALVIEW_PB1176 |
| 46 | bool "Support RealView/PB1176 platform" | 49 | bool "Support RealView(R) Platform Baseboard for ARM1176JZF-S" |
| 47 | select CPU_V6 | 50 | select CPU_V6 |
| 48 | select ARM_GIC | 51 | select ARM_GIC |
| 49 | help | 52 | help |
| 50 | Include support for the ARM(R) RealView ARM1176 Platform Baseboard. | 53 | Include support for the ARM(R) RealView(R) Platform Baseboard for |
| 54 | ARM1176JZF-S. | ||
| 51 | 55 | ||
| 52 | config REALVIEW_PB1176_SECURE_FLASH | 56 | config REALVIEW_PB1176_SECURE_FLASH |
| 53 | bool "Allow access to the secure flash memory block" | 57 | bool "Allow access to the secure flash memory block" |
| @@ -59,23 +63,24 @@ config REALVIEW_PB1176_SECURE_FLASH | |||
| 59 | block (64MB @ 0x3c000000) is required. | 63 | block (64MB @ 0x3c000000) is required. |
| 60 | 64 | ||
| 61 | config MACH_REALVIEW_PBA8 | 65 | config MACH_REALVIEW_PBA8 |
| 62 | bool "Support RealView/PB-A8 platform" | 66 | bool "Support RealView(R) Platform Baseboard for Cortex(tm)-A8 platform" |
| 63 | select CPU_V7 | 67 | select CPU_V7 |
| 64 | select ARM_GIC | 68 | select ARM_GIC |
| 65 | select HAVE_PATA_PLATFORM | 69 | select HAVE_PATA_PLATFORM |
| 66 | help | 70 | help |
| 67 | Include support for the ARM(R) RealView Cortex-A8 Platform Baseboard. | 71 | Include support for the ARM(R) RealView Platform Baseboard for |
| 68 | PB-A8 is a platform with an on-board Cortex-A8 and has support for | 72 | Cortex(tm)-A8. This platform has an on-board Cortex-A8 and has |
| 69 | PCI-E and Compact Flash. | 73 | support for PCI-E and Compact Flash. |
| 70 | 74 | ||
| 71 | config MACH_REALVIEW_PBX | 75 | config MACH_REALVIEW_PBX |
| 72 | bool "Support RealView/PBX platform" | 76 | bool "Support RealView(R) Platform Baseboard Explore" |
| 73 | select ARM_GIC | 77 | select ARM_GIC |
| 74 | select HAVE_PATA_PLATFORM | 78 | select HAVE_PATA_PLATFORM |
| 75 | select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET | 79 | select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET |
| 76 | select ZONE_DMA if SPARSEMEM | 80 | select ZONE_DMA if SPARSEMEM |
| 77 | help | 81 | help |
| 78 | Include support for the ARM(R) RealView PBX platform. | 82 | Include support for the ARM(R) RealView(R) Platform Baseboard |
| 83 | Explore. | ||
| 79 | 84 | ||
| 80 | config REALVIEW_HIGH_PHYS_OFFSET | 85 | config REALVIEW_HIGH_PHYS_OFFSET |
| 81 | bool "High physical base address for the RealView platform" | 86 | bool "High physical base address for the RealView platform" |
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c index a22bf67f2f7..6959d13d908 100644 --- a/arch/arm/mach-realview/platsmp.c +++ b/arch/arm/mach-realview/platsmp.c | |||
| @@ -41,7 +41,7 @@ volatile int __cpuinitdata pen_release = -1; | |||
| 41 | * observers, irrespective of whether they're taking part in coherency | 41 | * observers, irrespective of whether they're taking part in coherency |
| 42 | * or not. This is necessary for the hotplug code to work reliably. | 42 | * or not. This is necessary for the hotplug code to work reliably. |
| 43 | */ | 43 | */ |
| 44 | static void write_pen_release(int val) | 44 | static void __cpuinit write_pen_release(int val) |
| 45 | { | 45 | { |
| 46 | pen_release = val; | 46 | pen_release = val; |
| 47 | smp_wmb(); | 47 | smp_wmb(); |
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 4d1b4c5c938..0c8f6cf3e94 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
| @@ -60,6 +60,8 @@ endchoice | |||
| 60 | 60 | ||
| 61 | config MACH_AG5EVM | 61 | config MACH_AG5EVM |
| 62 | bool "AG5EVM board" | 62 | bool "AG5EVM board" |
| 63 | select ARCH_REQUIRE_GPIOLIB | ||
| 64 | select SH_LCD_MIPI_DSI | ||
| 63 | depends on ARCH_SH73A0 | 65 | depends on ARCH_SH73A0 |
| 64 | 66 | ||
| 65 | config MACH_MACKEREL | 67 | config MACH_MACKEREL |
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c index c18a740a415..2123b96b563 100644 --- a/arch/arm/mach-shmobile/board-ag5evm.c +++ b/arch/arm/mach-shmobile/board-ag5evm.c | |||
| @@ -34,9 +34,10 @@ | |||
| 34 | #include <linux/input/sh_keysc.h> | 34 | #include <linux/input/sh_keysc.h> |
| 35 | #include <linux/mmc/host.h> | 35 | #include <linux/mmc/host.h> |
| 36 | #include <linux/mmc/sh_mmcif.h> | 36 | #include <linux/mmc/sh_mmcif.h> |
| 37 | 37 | #include <linux/sh_clk.h> | |
| 38 | #include <video/sh_mobile_lcdc.h> | ||
| 39 | #include <video/sh_mipi_dsi.h> | ||
| 38 | #include <sound/sh_fsi.h> | 40 | #include <sound/sh_fsi.h> |
| 39 | |||
| 40 | #include <mach/hardware.h> | 41 | #include <mach/hardware.h> |
| 41 | #include <mach/sh73a0.h> | 42 | #include <mach/sh73a0.h> |
| 42 | #include <mach/common.h> | 43 | #include <mach/common.h> |
| @@ -183,11 +184,165 @@ static struct platform_device mmc_device = { | |||
| 183 | .resource = sh_mmcif_resources, | 184 | .resource = sh_mmcif_resources, |
| 184 | }; | 185 | }; |
| 185 | 186 | ||
| 187 | /* IrDA */ | ||
| 188 | static struct resource irda_resources[] = { | ||
| 189 | [0] = { | ||
| 190 | .start = 0xE6D00000, | ||
| 191 | .end = 0xE6D01FD4 - 1, | ||
| 192 | .flags = IORESOURCE_MEM, | ||
| 193 | }, | ||
| 194 | [1] = { | ||
| 195 | .start = gic_spi(95), | ||
| 196 | .flags = IORESOURCE_IRQ, | ||
| 197 | }, | ||
| 198 | }; | ||
| 199 | |||
| 200 | static struct platform_device irda_device = { | ||
| 201 | .name = "sh_irda", | ||
| 202 | .id = 0, | ||
| 203 | .resource = irda_resources, | ||
| 204 | .num_resources = ARRAY_SIZE(irda_resources), | ||
| 205 | }; | ||
| 206 | |||
| 207 | static unsigned char lcd_backlight_seq[3][2] = { | ||
| 208 | { 0x04, 0x07 }, | ||
| 209 | { 0x23, 0x80 }, | ||
| 210 | { 0x03, 0x01 }, | ||
| 211 | }; | ||
| 212 | |||
| 213 | static void lcd_backlight_on(void) | ||
| 214 | { | ||
| 215 | struct i2c_adapter *a; | ||
| 216 | struct i2c_msg msg; | ||
| 217 | int k; | ||
| 218 | |||
| 219 | a = i2c_get_adapter(1); | ||
| 220 | for (k = 0; a && k < 3; k++) { | ||
| 221 | msg.addr = 0x6d; | ||
| 222 | msg.buf = &lcd_backlight_seq[k][0]; | ||
| 223 | msg.len = 2; | ||
| 224 | msg.flags = 0; | ||
| 225 | if (i2c_transfer(a, &msg, 1) != 1) | ||
| 226 | break; | ||
| 227 | } | ||
| 228 | } | ||
| 229 | |||
| 230 | static void lcd_backlight_reset(void) | ||
| 231 | { | ||
| 232 | gpio_set_value(GPIO_PORT235, 0); | ||
| 233 | mdelay(24); | ||
| 234 | gpio_set_value(GPIO_PORT235, 1); | ||
| 235 | } | ||
| 236 | |||
| 237 | static void lcd_on(void *board_data, struct fb_info *info) | ||
| 238 | { | ||
| 239 | lcd_backlight_on(); | ||
| 240 | } | ||
| 241 | |||
| 242 | static void lcd_off(void *board_data) | ||
| 243 | { | ||
| 244 | lcd_backlight_reset(); | ||
| 245 | } | ||
| 246 | |||
| 247 | /* LCDC0 */ | ||
| 248 | static const struct fb_videomode lcdc0_modes[] = { | ||
| 249 | { | ||
| 250 | .name = "R63302(QHD)", | ||
| 251 | .xres = 544, | ||
| 252 | .yres = 961, | ||
| 253 | .left_margin = 72, | ||
| 254 | .right_margin = 600, | ||
| 255 | .hsync_len = 16, | ||
| 256 | .upper_margin = 8, | ||
| 257 | .lower_margin = 8, | ||
| 258 | .vsync_len = 2, | ||
| 259 | .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, | ||
| 260 | }, | ||
| 261 | }; | ||
| 262 | |||
| 263 | static struct sh_mobile_lcdc_info lcdc0_info = { | ||
| 264 | .clock_source = LCDC_CLK_PERIPHERAL, | ||
| 265 | .ch[0] = { | ||
| 266 | .chan = LCDC_CHAN_MAINLCD, | ||
| 267 | .interface_type = RGB24, | ||
| 268 | .clock_divider = 1, | ||
| 269 | .flags = LCDC_FLAGS_DWPOL, | ||
| 270 | .lcd_size_cfg.width = 44, | ||
| 271 | .lcd_size_cfg.height = 79, | ||
| 272 | .bpp = 16, | ||
| 273 | .lcd_cfg = lcdc0_modes, | ||
| 274 | .num_cfg = ARRAY_SIZE(lcdc0_modes), | ||
| 275 | .board_cfg = { | ||
| 276 | .display_on = lcd_on, | ||
| 277 | .display_off = lcd_off, | ||
| 278 | }, | ||
| 279 | } | ||
| 280 | }; | ||
| 281 | |||
| 282 | static struct resource lcdc0_resources[] = { | ||
| 283 | [0] = { | ||
| 284 | .name = "LCDC0", | ||
| 285 | .start = 0xfe940000, /* P4-only space */ | ||
| 286 | .end = 0xfe943fff, | ||
| 287 | .flags = IORESOURCE_MEM, | ||
| 288 | }, | ||
| 289 | [1] = { | ||
| 290 | .start = intcs_evt2irq(0x580), | ||
| 291 | .flags = IORESOURCE_IRQ, | ||
| 292 | }, | ||
| 293 | }; | ||
| 294 | |||
| 295 | static struct platform_device lcdc0_device = { | ||
| 296 | .name = "sh_mobile_lcdc_fb", | ||
| 297 | .num_resources = ARRAY_SIZE(lcdc0_resources), | ||
| 298 | .resource = lcdc0_resources, | ||
| 299 | .id = 0, | ||
| 300 | .dev = { | ||
| 301 | .platform_data = &lcdc0_info, | ||
| 302 | .coherent_dma_mask = ~0, | ||
| 303 | }, | ||
| 304 | }; | ||
| 305 | |||
| 306 | /* MIPI-DSI */ | ||
| 307 | static struct resource mipidsi0_resources[] = { | ||
| 308 | [0] = { | ||
| 309 | .start = 0xfeab0000, | ||
| 310 | .end = 0xfeab3fff, | ||
| 311 | .flags = IORESOURCE_MEM, | ||
| 312 | }, | ||
| 313 | [1] = { | ||
| 314 | .start = 0xfeab4000, | ||
| 315 | .end = 0xfeab7fff, | ||
| 316 | .flags = IORESOURCE_MEM, | ||
| 317 | }, | ||
| 318 | }; | ||
| 319 | |||
| 320 | static struct sh_mipi_dsi_info mipidsi0_info = { | ||
| 321 | .data_format = MIPI_RGB888, | ||
| 322 | .lcd_chan = &lcdc0_info.ch[0], | ||
| 323 | .vsynw_offset = 20, | ||
| 324 | .clksrc = 1, | ||
| 325 | .flags = SH_MIPI_DSI_HSABM, | ||
| 326 | }; | ||
| 327 | |||
| 328 | static struct platform_device mipidsi0_device = { | ||
| 329 | .name = "sh-mipi-dsi", | ||
| 330 | .num_resources = ARRAY_SIZE(mipidsi0_resources), | ||
| 331 | .resource = mipidsi0_resources, | ||
| 332 | .id = 0, | ||
| 333 | .dev = { | ||
| 334 | .platform_data = &mipidsi0_info, | ||
| 335 | }, | ||
| 336 | }; | ||
| 337 | |||
| 186 | static struct platform_device *ag5evm_devices[] __initdata = { | 338 | static struct platform_device *ag5evm_devices[] __initdata = { |
| 187 | ð_device, | 339 | ð_device, |
| 188 | &keysc_device, | 340 | &keysc_device, |
| 189 | &fsi_device, | 341 | &fsi_device, |
| 190 | &mmc_device, | 342 | &mmc_device, |
| 343 | &irda_device, | ||
| 344 | &lcdc0_device, | ||
| 345 | &mipidsi0_device, | ||
| 191 | }; | 346 | }; |
| 192 | 347 | ||
| 193 | static struct map_desc ag5evm_io_desc[] __initdata = { | 348 | static struct map_desc ag5evm_io_desc[] __initdata = { |
| @@ -224,6 +379,8 @@ void __init ag5evm_init_irq(void) | |||
| 224 | __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A); | 379 | __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A); |
| 225 | } | 380 | } |
| 226 | 381 | ||
| 382 | #define DSI0PHYCR 0xe615006c | ||
| 383 | |||
| 227 | static void __init ag5evm_init(void) | 384 | static void __init ag5evm_init(void) |
| 228 | { | 385 | { |
| 229 | sh73a0_pinmux_init(); | 386 | sh73a0_pinmux_init(); |
| @@ -287,6 +444,25 @@ static void __init ag5evm_init(void) | |||
| 287 | gpio_request(GPIO_FN_FSIAISLD, NULL); | 444 | gpio_request(GPIO_FN_FSIAISLD, NULL); |
| 288 | gpio_request(GPIO_FN_FSIAOSLD, NULL); | 445 | gpio_request(GPIO_FN_FSIAOSLD, NULL); |
| 289 | 446 | ||
| 447 | /* IrDA */ | ||
| 448 | gpio_request(GPIO_FN_PORT241_IRDA_OUT, NULL); | ||
| 449 | gpio_request(GPIO_FN_PORT242_IRDA_IN, NULL); | ||
| 450 | gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL); | ||
| 451 | |||
| 452 | /* LCD panel */ | ||
| 453 | gpio_request(GPIO_PORT217, NULL); /* RESET */ | ||
| 454 | gpio_direction_output(GPIO_PORT217, 0); | ||
| 455 | mdelay(1); | ||
| 456 | gpio_set_value(GPIO_PORT217, 1); | ||
| 457 | |||
| 458 | /* LCD backlight controller */ | ||
| 459 | gpio_request(GPIO_PORT235, NULL); /* RESET */ | ||
| 460 | gpio_direction_output(GPIO_PORT235, 0); | ||
| 461 | lcd_backlight_reset(); | ||
| 462 | |||
| 463 | /* MIPI-DSI clock setup */ | ||
| 464 | __raw_writel(0x2a809010, DSI0PHYCR); | ||
| 465 | |||
| 290 | #ifdef CONFIG_CACHE_L2X0 | 466 | #ifdef CONFIG_CACHE_L2X0 |
| 291 | /* Shared attribute override enable, 64K*8way */ | 467 | /* Shared attribute override enable, 64K*8way */ |
| 292 | l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff); | 468 | l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff); |
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c index 686b304a770..ef4613b993a 100644 --- a/arch/arm/mach-shmobile/board-g3evm.c +++ b/arch/arm/mach-shmobile/board-g3evm.c | |||
| @@ -347,7 +347,6 @@ static void __init g3evm_init(void) | |||
| 347 | gpio_request(GPIO_FN_IRDA_OUT, NULL); | 347 | gpio_request(GPIO_FN_IRDA_OUT, NULL); |
| 348 | gpio_request(GPIO_FN_IRDA_IN, NULL); | 348 | gpio_request(GPIO_FN_IRDA_IN, NULL); |
| 349 | gpio_request(GPIO_FN_IRDA_FIRSEL, NULL); | 349 | gpio_request(GPIO_FN_IRDA_FIRSEL, NULL); |
| 350 | set_irq_type(evt2irq(0x480), IRQ_TYPE_LEVEL_LOW); | ||
| 351 | 350 | ||
| 352 | sh7367_add_standard_devices(); | 351 | sh7367_add_standard_devices(); |
| 353 | 352 | ||
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 7b15d21f0f6..fb4213a4e15 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
| @@ -169,9 +169,8 @@ | |||
| 169 | * SW1 | SW33 | 169 | * SW1 | SW33 |
| 170 | * | bit1 | bit2 | bit3 | bit4 | 170 | * | bit1 | bit2 | bit3 | bit4 |
| 171 | * -------------+------+------+------+------- | 171 | * -------------+------+------+------+------- |
| 172 | * MMC0 OFF | OFF | ON | ON | X | 172 | * MMC0 OFF | OFF | X | ON | X (Use MMCIF) |
| 173 | * MMC1 ON | OFF | ON | X | ON | 173 | * SDHI1 OFF | ON | X | OFF | X (Use MFD_SH_MOBILE_SDHI) |
| 174 | * SDHI1 OFF | ON | X | OFF | ON | ||
| 175 | * | 174 | * |
| 176 | */ | 175 | */ |
| 177 | 176 | ||
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index 9aa8d68d1a9..e9731b5a73e 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
| @@ -234,7 +234,9 @@ static int pllc2_set_rate(struct clk *clk, unsigned long rate) | |||
| 234 | 234 | ||
| 235 | value = __raw_readl(PLLC2CR) & ~(0x3f << 24); | 235 | value = __raw_readl(PLLC2CR) & ~(0x3f << 24); |
| 236 | 236 | ||
| 237 | __raw_writel((value & ~0x80000000) | ((idx + 19) << 24), PLLC2CR); | 237 | __raw_writel(value | ((idx + 19) << 24), PLLC2CR); |
| 238 | |||
| 239 | clk->rate = clk->freq_table[idx].frequency; | ||
| 238 | 240 | ||
| 239 | return 0; | 241 | return 0; |
| 240 | } | 242 | } |
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 720a71433be..ddd4a1b775f 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
| @@ -118,8 +118,16 @@ static unsigned long pll_recalc(struct clk *clk) | |||
| 118 | { | 118 | { |
| 119 | unsigned long mult = 1; | 119 | unsigned long mult = 1; |
| 120 | 120 | ||
| 121 | if (__raw_readl(PLLECR) & (1 << clk->enable_bit)) | 121 | if (__raw_readl(PLLECR) & (1 << clk->enable_bit)) { |
| 122 | mult = (((__raw_readl(clk->enable_reg) >> 24) & 0x3f) + 1); | 122 | mult = (((__raw_readl(clk->enable_reg) >> 24) & 0x3f) + 1); |
| 123 | /* handle CFG bit for PLL1 and PLL2 */ | ||
| 124 | switch (clk->enable_bit) { | ||
| 125 | case 1: | ||
| 126 | case 2: | ||
| 127 | if (__raw_readl(clk->enable_reg) & (1 << 20)) | ||
| 128 | mult *= 2; | ||
| 129 | } | ||
| 130 | } | ||
| 123 | 131 | ||
| 124 | return clk->parent->rate * mult; | 132 | return clk->parent->rate * mult; |
| 125 | } | 133 | } |
| @@ -212,7 +220,7 @@ enum { DIV4_I, DIV4_ZG, DIV4_M3, DIV4_B, DIV4_M1, DIV4_M2, | |||
| 212 | static struct clk div4_clks[DIV4_NR] = { | 220 | static struct clk div4_clks[DIV4_NR] = { |
| 213 | [DIV4_I] = DIV4(FRQCRA, 20, 0xfff, CLK_ENABLE_ON_INIT), | 221 | [DIV4_I] = DIV4(FRQCRA, 20, 0xfff, CLK_ENABLE_ON_INIT), |
| 214 | [DIV4_ZG] = DIV4(FRQCRA, 16, 0xbff, CLK_ENABLE_ON_INIT), | 222 | [DIV4_ZG] = DIV4(FRQCRA, 16, 0xbff, CLK_ENABLE_ON_INIT), |
| 215 | [DIV4_M3] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT), | 223 | [DIV4_M3] = DIV4(FRQCRA, 12, 0xfff, CLK_ENABLE_ON_INIT), |
| 216 | [DIV4_B] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT), | 224 | [DIV4_B] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT), |
| 217 | [DIV4_M1] = DIV4(FRQCRA, 4, 0xfff, 0), | 225 | [DIV4_M1] = DIV4(FRQCRA, 4, 0xfff, 0), |
| 218 | [DIV4_M2] = DIV4(FRQCRA, 0, 0xfff, 0), | 226 | [DIV4_M2] = DIV4(FRQCRA, 0, 0xfff, 0), |
| @@ -255,10 +263,10 @@ static struct clk div6_clks[DIV6_NR] = { | |||
| 255 | }; | 263 | }; |
| 256 | 264 | ||
| 257 | enum { MSTP001, | 265 | enum { MSTP001, |
| 258 | MSTP125, MSTP116, | 266 | MSTP125, MSTP118, MSTP116, MSTP100, |
| 259 | MSTP219, | 267 | MSTP219, |
| 260 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, | 268 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, |
| 261 | MSTP331, MSTP329, MSTP323, MSTP312, | 269 | MSTP331, MSTP329, MSTP325, MSTP323, MSTP312, |
| 262 | MSTP411, MSTP410, MSTP403, | 270 | MSTP411, MSTP410, MSTP403, |
| 263 | MSTP_NR }; | 271 | MSTP_NR }; |
| 264 | 272 | ||
| @@ -268,7 +276,9 @@ enum { MSTP001, | |||
| 268 | static struct clk mstp_clks[MSTP_NR] = { | 276 | static struct clk mstp_clks[MSTP_NR] = { |
| 269 | [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */ | 277 | [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */ |
| 270 | [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ | 278 | [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ |
| 279 | [MSTP118] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 18, 0), /* DSITX0 */ | ||
| 271 | [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */ | 280 | [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */ |
| 281 | [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */ | ||
| 272 | [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ | 282 | [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ |
| 273 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ | 283 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ |
| 274 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ | 284 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ |
| @@ -279,6 +289,7 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
| 279 | [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ | 289 | [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ |
| 280 | [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */ | 290 | [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */ |
| 281 | [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ | 291 | [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ |
| 292 | [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */ | ||
| 282 | [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ | 293 | [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ |
| 283 | [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ | 294 | [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ |
| 284 | [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ | 295 | [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ |
| @@ -288,16 +299,25 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
| 288 | 299 | ||
| 289 | #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } | 300 | #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } |
| 290 | #define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk } | 301 | #define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk } |
| 302 | #define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk } | ||
| 291 | 303 | ||
| 292 | static struct clk_lookup lookups[] = { | 304 | static struct clk_lookup lookups[] = { |
| 293 | /* main clocks */ | 305 | /* main clocks */ |
| 294 | CLKDEV_CON_ID("r_clk", &r_clk), | 306 | CLKDEV_CON_ID("r_clk", &r_clk), |
| 295 | 307 | ||
| 308 | /* DIV6 clocks */ | ||
| 309 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), | ||
| 310 | CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), | ||
| 311 | CLKDEV_ICK_ID("dsi0p_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), | ||
| 312 | CLKDEV_ICK_ID("dsi1p_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), | ||
| 313 | |||
| 296 | /* MSTP32 clocks */ | 314 | /* MSTP32 clocks */ |
| 297 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ | 315 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ |
| 316 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ | ||
| 298 | CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */ | 317 | CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */ |
| 299 | CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */ | 318 | CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */ |
| 300 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ | 319 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ |
| 320 | CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */ | ||
| 301 | CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ | 321 | CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ |
| 302 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ | 322 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ |
| 303 | CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ | 323 | CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ |
| @@ -308,6 +328,7 @@ static struct clk_lookup lookups[] = { | |||
| 308 | CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ | 328 | CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ |
| 309 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ | 329 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ |
| 310 | CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ | 330 | CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ |
| 331 | CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ | ||
| 311 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ | 332 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ |
| 312 | CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ | 333 | CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ |
| 313 | CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ | 334 | CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ |
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index f78a1ead71a..ca5f9d17b39 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c | |||
| @@ -365,6 +365,7 @@ static struct intc_desc intca_desc __initdata = { | |||
| 365 | 365 | ||
| 366 | enum { | 366 | enum { |
| 367 | UNUSED_INTCS = 0, | 367 | UNUSED_INTCS = 0, |
| 368 | ENABLED_INTCS, | ||
| 368 | 369 | ||
| 369 | INTCS, | 370 | INTCS, |
| 370 | 371 | ||
| @@ -413,7 +414,7 @@ enum { | |||
| 413 | CMT4, | 414 | CMT4, |
| 414 | DSITX1_DSITX1_0, | 415 | DSITX1_DSITX1_0, |
| 415 | DSITX1_DSITX1_1, | 416 | DSITX1_DSITX1_1, |
| 416 | /* MFIS2 */ | 417 | MFIS2_INTCS, /* Priority always enabled using ENABLED_INTCS */ |
| 417 | CPORTS2R, | 418 | CPORTS2R, |
| 418 | /* CEC */ | 419 | /* CEC */ |
| 419 | JPU6E, | 420 | JPU6E, |
| @@ -477,7 +478,7 @@ static struct intc_vect intcs_vectors[] = { | |||
| 477 | INTCS_VECT(CMT4, 0x1980), | 478 | INTCS_VECT(CMT4, 0x1980), |
| 478 | INTCS_VECT(DSITX1_DSITX1_0, 0x19a0), | 479 | INTCS_VECT(DSITX1_DSITX1_0, 0x19a0), |
| 479 | INTCS_VECT(DSITX1_DSITX1_1, 0x19c0), | 480 | INTCS_VECT(DSITX1_DSITX1_1, 0x19c0), |
| 480 | /* MFIS2 */ | 481 | INTCS_VECT(MFIS2_INTCS, 0x1a00), |
| 481 | INTCS_VECT(CPORTS2R, 0x1a20), | 482 | INTCS_VECT(CPORTS2R, 0x1a20), |
| 482 | /* CEC */ | 483 | /* CEC */ |
| 483 | INTCS_VECT(JPU6E, 0x1a80), | 484 | INTCS_VECT(JPU6E, 0x1a80), |
| @@ -543,7 +544,7 @@ static struct intc_mask_reg intcs_mask_registers[] = { | |||
| 543 | { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0, | 544 | { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0, |
| 544 | CMT4, DSITX1_DSITX1_0, DSITX1_DSITX1_1, 0 } }, | 545 | CMT4, DSITX1_DSITX1_0, DSITX1_DSITX1_1, 0 } }, |
| 545 | { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */ | 546 | { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */ |
| 546 | { 0, CPORTS2R, 0, 0, | 547 | { MFIS2_INTCS, CPORTS2R, 0, 0, |
| 547 | JPU6E, 0, 0, 0 } }, | 548 | JPU6E, 0, 0, 0 } }, |
| 548 | { 0xffd20104, 0, 16, /* INTAMASK */ | 549 | { 0xffd20104, 0, 16, /* INTAMASK */ |
| 549 | { 0, 0, 0, 0, 0, 0, 0, 0, | 550 | { 0, 0, 0, 0, 0, 0, 0, 0, |
| @@ -571,7 +572,8 @@ static struct intc_prio_reg intcs_prio_registers[] = { | |||
| 571 | { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, 0 } }, | 572 | { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, 0 } }, |
| 572 | { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, DSITX1_DSITX1_0, | 573 | { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, DSITX1_DSITX1_0, |
| 573 | DSITX1_DSITX1_1, 0 } }, | 574 | DSITX1_DSITX1_1, 0 } }, |
| 574 | { 0xffd50038, 0, 16, 4, /* IPROS3 */ { 0, CPORTS2R, 0, 0 } }, | 575 | { 0xffd50038, 0, 16, 4, /* IPROS3 */ { ENABLED_INTCS, CPORTS2R, |
| 576 | 0, 0 } }, | ||
| 575 | { 0xffd5003c, 0, 16, 4, /* IPRPS3 */ { JPU6E, 0, 0, 0 } }, | 577 | { 0xffd5003c, 0, 16, 4, /* IPRPS3 */ { JPU6E, 0, 0, 0 } }, |
| 576 | }; | 578 | }; |
| 577 | 579 | ||
| @@ -590,6 +592,7 @@ static struct resource intcs_resources[] __initdata = { | |||
| 590 | 592 | ||
| 591 | static struct intc_desc intcs_desc __initdata = { | 593 | static struct intc_desc intcs_desc __initdata = { |
| 592 | .name = "sh7372-intcs", | 594 | .name = "sh7372-intcs", |
| 595 | .force_enable = ENABLED_INTCS, | ||
| 593 | .resource = intcs_resources, | 596 | .resource = intcs_resources, |
| 594 | .num_resources = ARRAY_SIZE(intcs_resources), | 597 | .num_resources = ARRAY_SIZE(intcs_resources), |
| 595 | .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers, | 598 | .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers, |
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c index 322d8d57cbc..5d0e1503ece 100644 --- a/arch/arm/mach-shmobile/intc-sh73a0.c +++ b/arch/arm/mach-shmobile/intc-sh73a0.c | |||
| @@ -252,10 +252,11 @@ static irqreturn_t sh73a0_intcs_demux(int irq, void *dev_id) | |||
| 252 | 252 | ||
| 253 | void __init sh73a0_init_irq(void) | 253 | void __init sh73a0_init_irq(void) |
| 254 | { | 254 | { |
| 255 | void __iomem *gic_base = __io(0xf0001000); | 255 | void __iomem *gic_dist_base = __io(0xf0001000); |
| 256 | void __iomem *gic_cpu_base = __io(0xf0000100); | ||
| 256 | void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE); | 257 | void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE); |
| 257 | 258 | ||
| 258 | gic_init(0, 29, gic_base, gic_base); | 259 | gic_init(0, 29, gic_dist_base, gic_cpu_base); |
| 259 | 260 | ||
| 260 | register_intc_controller(&intcs_desc); | 261 | register_intc_controller(&intcs_desc); |
| 261 | 262 | ||
diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h new file mode 100644 index 00000000000..66ad2760c62 --- /dev/null +++ b/arch/arm/mach-tegra/include/mach/kbc.h | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* | ||
| 2 | * Platform definitions for tegra-kbc keyboard input driver | ||
| 3 | * | ||
| 4 | * Copyright (c) 2010-2011, NVIDIA Corporation. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 14 | * more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License along | ||
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef ASMARM_ARCH_TEGRA_KBC_H | ||
| 22 | #define ASMARM_ARCH_TEGRA_KBC_H | ||
| 23 | |||
| 24 | #include <linux/types.h> | ||
| 25 | #include <linux/input/matrix_keypad.h> | ||
| 26 | |||
| 27 | #ifdef CONFIG_ARCH_TEGRA_2x_SOC | ||
| 28 | #define KBC_MAX_GPIO 24 | ||
| 29 | #define KBC_MAX_KPENT 8 | ||
| 30 | #else | ||
| 31 | #define KBC_MAX_GPIO 20 | ||
| 32 | #define KBC_MAX_KPENT 7 | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #define KBC_MAX_ROW 16 | ||
| 36 | #define KBC_MAX_COL 8 | ||
| 37 | #define KBC_MAX_KEY (KBC_MAX_ROW * KBC_MAX_COL) | ||
| 38 | |||
| 39 | struct tegra_kbc_pin_cfg { | ||
| 40 | bool is_row; | ||
| 41 | unsigned char num; | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct tegra_kbc_wake_key { | ||
| 45 | u8 row:4; | ||
| 46 | u8 col:4; | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct tegra_kbc_platform_data { | ||
| 50 | unsigned int debounce_cnt; | ||
| 51 | unsigned int repeat_cnt; | ||
| 52 | |||
| 53 | unsigned int wake_cnt; /* 0:wake on any key >1:wake on wake_cfg */ | ||
| 54 | const struct tegra_kbc_wake_key *wake_cfg; | ||
| 55 | |||
| 56 | struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO]; | ||
| 57 | const struct matrix_keymap_data *keymap_data; | ||
| 58 | |||
| 59 | bool wakeup; | ||
| 60 | }; | ||
| 61 | #endif | ||
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig index 3f7b5e9d83c..9cdec5aa04a 100644 --- a/arch/arm/mach-versatile/Kconfig +++ b/arch/arm/mach-versatile/Kconfig | |||
| @@ -2,17 +2,19 @@ menu "Versatile platform type" | |||
| 2 | depends on ARCH_VERSATILE | 2 | depends on ARCH_VERSATILE |
| 3 | 3 | ||
| 4 | config ARCH_VERSATILE_PB | 4 | config ARCH_VERSATILE_PB |
| 5 | bool "Support Versatile/PB platform" | 5 | bool "Support Versatile Platform Baseboard for ARM926EJ-S" |
| 6 | select CPU_ARM926T | 6 | select CPU_ARM926T |
| 7 | select MIGHT_HAVE_PCI | 7 | select MIGHT_HAVE_PCI |
| 8 | default y | 8 | default y |
| 9 | help | 9 | help |
| 10 | Include support for the ARM(R) Versatile/PB platform. | 10 | Include support for the ARM(R) Versatile Platform Baseboard |
| 11 | for the ARM926EJ-S. | ||
| 11 | 12 | ||
| 12 | config MACH_VERSATILE_AB | 13 | config MACH_VERSATILE_AB |
| 13 | bool "Support Versatile/AB platform" | 14 | bool "Support Versatile Application Baseboard for ARM926EJ-S" |
| 14 | select CPU_ARM926T | 15 | select CPU_ARM926T |
| 15 | help | 16 | help |
| 16 | Include support for the ARM(R) Versatile/AP platform. | 17 | Include support for the ARM(R) Versatile Application Baseboard |
| 18 | for the ARM926EJ-S. | ||
| 17 | 19 | ||
| 18 | endmenu | 20 | endmenu |
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c index b1687b6abe6..634bf1d3a31 100644 --- a/arch/arm/mach-vexpress/platsmp.c +++ b/arch/arm/mach-vexpress/platsmp.c | |||
| @@ -39,7 +39,7 @@ volatile int __cpuinitdata pen_release = -1; | |||
| 39 | * observers, irrespective of whether they're taking part in coherency | 39 | * observers, irrespective of whether they're taking part in coherency |
| 40 | * or not. This is necessary for the hotplug code to work reliably. | 40 | * or not. This is necessary for the hotplug code to work reliably. |
| 41 | */ | 41 | */ |
| 42 | static void write_pen_release(int val) | 42 | static void __cpuinit write_pen_release(int val) |
| 43 | { | 43 | { |
| 44 | pen_release = val; | 44 | pen_release = val; |
| 45 | smp_wmb(); | 45 | smp_wmb(); |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index a9ed3428a2f..1edae65a0e7 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <asm/mach/time.h> | 19 | #include <asm/mach/time.h> |
| 20 | #include <asm/hardware/arm_timer.h> | 20 | #include <asm/hardware/arm_timer.h> |
| 21 | #include <asm/hardware/timer-sp.h> | 21 | #include <asm/hardware/timer-sp.h> |
| 22 | #include <asm/hardware/sp810.h> | ||
| 22 | 23 | ||
| 23 | #include <mach/motherboard.h> | 24 | #include <mach/motherboard.h> |
| 24 | 25 | ||
| @@ -50,8 +51,16 @@ void __init v2m_map_io(struct map_desc *tile, size_t num) | |||
| 50 | 51 | ||
| 51 | static void __init v2m_timer_init(void) | 52 | static void __init v2m_timer_init(void) |
| 52 | { | 53 | { |
| 54 | u32 scctrl; | ||
| 55 | |||
| 53 | versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); | 56 | versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); |
| 54 | 57 | ||
| 58 | /* Select 1MHz TIMCLK as the reference clock for SP804 timers */ | ||
| 59 | scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL)); | ||
| 60 | scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK; | ||
| 61 | scctrl |= SCCTRL_TIMEREN1SEL_TIMCLK; | ||
| 62 | writel(scctrl, MMIO_P2V(V2M_SYSCTL + SCCTRL)); | ||
| 63 | |||
| 55 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); | 64 | writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); |
| 56 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); | 65 | writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); |
| 57 | 66 | ||
diff --git a/arch/avr32/include/asm/pgalloc.h b/arch/avr32/include/asm/pgalloc.h index 92ecd8446ef..bc7e8ae479e 100644 --- a/arch/avr32/include/asm/pgalloc.h +++ b/arch/avr32/include/asm/pgalloc.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #ifndef __ASM_AVR32_PGALLOC_H | 8 | #ifndef __ASM_AVR32_PGALLOC_H |
| 9 | #define __ASM_AVR32_PGALLOC_H | 9 | #define __ASM_AVR32_PGALLOC_H |
| 10 | 10 | ||
| 11 | #include <linux/mm.h> | ||
| 11 | #include <linux/quicklist.h> | 12 | #include <linux/quicklist.h> |
| 12 | #include <asm/page.h> | 13 | #include <asm/page.h> |
| 13 | #include <asm/pgtable.h> | 14 | #include <asm/pgtable.h> |
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index b1577f741fa..82a4bb51d5d 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c | |||
| @@ -610,17 +610,17 @@ static void amiga_mem_console_write(struct console *co, const char *s, | |||
| 610 | 610 | ||
| 611 | static int __init amiga_savekmsg_setup(char *arg) | 611 | static int __init amiga_savekmsg_setup(char *arg) |
| 612 | { | 612 | { |
| 613 | static struct resource debug_res = { .name = "Debug" }; | ||
| 614 | |||
| 615 | if (!MACH_IS_AMIGA || strcmp(arg, "mem")) | 613 | if (!MACH_IS_AMIGA || strcmp(arg, "mem")) |
| 616 | goto done; | 614 | return 0; |
| 617 | 615 | ||
| 618 | if (!AMIGAHW_PRESENT(CHIP_RAM)) { | 616 | if (amiga_chip_size < SAVEKMSG_MAXMEM) { |
| 619 | printk("Warning: no chipram present for debugging\n"); | 617 | pr_err("Not enough chipram for debugging\n"); |
| 620 | goto done; | 618 | return -ENOMEM; |
| 621 | } | 619 | } |
| 622 | 620 | ||
| 623 | savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res); | 621 | /* Just steal the block, the chipram allocator isn't functional yet */ |
| 622 | amiga_chip_size -= SAVEKMSG_MAXMEM; | ||
| 623 | savekmsg = (void *)ZTWO_VADDR(CHIP_PHYSADDR + amiga_chip_size); | ||
| 624 | savekmsg->magic1 = SAVEKMSG_MAGIC1; | 624 | savekmsg->magic1 = SAVEKMSG_MAGIC1; |
| 625 | savekmsg->magic2 = SAVEKMSG_MAGIC2; | 625 | savekmsg->magic2 = SAVEKMSG_MAGIC2; |
| 626 | savekmsg->magicptr = ZTWO_PADDR(savekmsg); | 626 | savekmsg->magicptr = ZTWO_PADDR(savekmsg); |
| @@ -628,8 +628,6 @@ static int __init amiga_savekmsg_setup(char *arg) | |||
| 628 | 628 | ||
| 629 | amiga_console_driver.write = amiga_mem_console_write; | 629 | amiga_console_driver.write = amiga_mem_console_write; |
| 630 | register_console(&amiga_console_driver); | 630 | register_console(&amiga_console_driver); |
| 631 | |||
| 632 | done: | ||
| 633 | return 0; | 631 | return 0; |
| 634 | } | 632 | } |
| 635 | 633 | ||
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 39478dd08e6..26a804e67bc 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c | |||
| @@ -388,9 +388,9 @@ void __init atari_init_IRQ(void) | |||
| 388 | } | 388 | } |
| 389 | 389 | ||
| 390 | if (ATARIHW_PRESENT(SCC) && !atari_SCC_reset_done) { | 390 | if (ATARIHW_PRESENT(SCC) && !atari_SCC_reset_done) { |
| 391 | scc.cha_a_ctrl = 9; | 391 | atari_scc.cha_a_ctrl = 9; |
| 392 | MFPDELAY(); | 392 | MFPDELAY(); |
| 393 | scc.cha_a_ctrl = (char) 0xc0; /* hardware reset */ | 393 | atari_scc.cha_a_ctrl = (char) 0xc0; /* hardware reset */ |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | if (ATARIHW_PRESENT(SCU)) { | 396 | if (ATARIHW_PRESENT(SCU)) { |
diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index ae2d96e5d61..4203d101363 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c | |||
| @@ -315,7 +315,7 @@ void __init config_atari(void) | |||
| 315 | ATARIHW_SET(SCC_DMA); | 315 | ATARIHW_SET(SCC_DMA); |
| 316 | printk("SCC_DMA "); | 316 | printk("SCC_DMA "); |
| 317 | } | 317 | } |
| 318 | if (scc_test(&scc.cha_a_ctrl)) { | 318 | if (scc_test(&atari_scc.cha_a_ctrl)) { |
| 319 | ATARIHW_SET(SCC); | 319 | ATARIHW_SET(SCC); |
| 320 | printk("SCC "); | 320 | printk("SCC "); |
| 321 | } | 321 | } |
diff --git a/arch/m68k/atari/debug.c b/arch/m68k/atari/debug.c index 28efdc33c1a..5a484247e49 100644 --- a/arch/m68k/atari/debug.c +++ b/arch/m68k/atari/debug.c | |||
| @@ -53,9 +53,9 @@ static inline void ata_scc_out(char c) | |||
| 53 | { | 53 | { |
| 54 | do { | 54 | do { |
| 55 | MFPDELAY(); | 55 | MFPDELAY(); |
| 56 | } while (!(scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ | 56 | } while (!(atari_scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ |
| 57 | MFPDELAY(); | 57 | MFPDELAY(); |
| 58 | scc.cha_b_data = c; | 58 | atari_scc.cha_b_data = c; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | static void atari_scc_console_write(struct console *co, const char *str, | 61 | static void atari_scc_console_write(struct console *co, const char *str, |
| @@ -140,9 +140,9 @@ int atari_scc_console_wait_key(struct console *co) | |||
| 140 | { | 140 | { |
| 141 | do { | 141 | do { |
| 142 | MFPDELAY(); | 142 | MFPDELAY(); |
| 143 | } while (!(scc.cha_b_ctrl & 0x01)); /* wait for rx buf filled */ | 143 | } while (!(atari_scc.cha_b_ctrl & 0x01)); /* wait for rx buf filled */ |
| 144 | MFPDELAY(); | 144 | MFPDELAY(); |
| 145 | return scc.cha_b_data; | 145 | return atari_scc.cha_b_data; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | int atari_midi_console_wait_key(struct console *co) | 148 | int atari_midi_console_wait_key(struct console *co) |
| @@ -185,9 +185,9 @@ static void __init atari_init_mfp_port(int cflag) | |||
| 185 | 185 | ||
| 186 | #define SCC_WRITE(reg, val) \ | 186 | #define SCC_WRITE(reg, val) \ |
| 187 | do { \ | 187 | do { \ |
| 188 | scc.cha_b_ctrl = (reg); \ | 188 | atari_scc.cha_b_ctrl = (reg); \ |
| 189 | MFPDELAY(); \ | 189 | MFPDELAY(); \ |
| 190 | scc.cha_b_ctrl = (val); \ | 190 | atari_scc.cha_b_ctrl = (val); \ |
| 191 | MFPDELAY(); \ | 191 | MFPDELAY(); \ |
| 192 | } while (0) | 192 | } while (0) |
| 193 | 193 | ||
| @@ -240,7 +240,7 @@ static void __init atari_init_scc_port(int cflag) | |||
| 240 | reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40; | 240 | reg3 = (cflag & CSIZE) == CS8 ? 0xc0 : 0x40; |
| 241 | reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */; | 241 | reg5 = (cflag & CSIZE) == CS8 ? 0x60 : 0x20 | 0x82 /* assert DTR/RTS */; |
| 242 | 242 | ||
| 243 | (void)scc.cha_b_ctrl; /* reset reg pointer */ | 243 | (void)atari_scc.cha_b_ctrl; /* reset reg pointer */ |
| 244 | SCC_WRITE(9, 0xc0); /* reset */ | 244 | SCC_WRITE(9, 0xc0); /* reset */ |
| 245 | LONG_DELAY(); /* extra delay after WR9 access */ | 245 | LONG_DELAY(); /* extra delay after WR9 access */ |
| 246 | SCC_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) | 246 | SCC_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) |
diff --git a/arch/m68k/include/asm/atarihw.h b/arch/m68k/include/asm/atarihw.h index a714e1aa072..f51f709bbf3 100644 --- a/arch/m68k/include/asm/atarihw.h +++ b/arch/m68k/include/asm/atarihw.h | |||
| @@ -449,7 +449,7 @@ struct SCC | |||
| 449 | u_char char_dummy3; | 449 | u_char char_dummy3; |
| 450 | u_char cha_b_data; | 450 | u_char cha_b_data; |
| 451 | }; | 451 | }; |
| 452 | # define scc ((*(volatile struct SCC*)SCC_BAS)) | 452 | # define atari_scc ((*(volatile struct SCC*)SCC_BAS)) |
| 453 | 453 | ||
| 454 | /* The ESCC (Z85230) in an Atari ST. The channels are reversed! */ | 454 | /* The ESCC (Z85230) in an Atari ST. The channels are reversed! */ |
| 455 | # define st_escc ((*(volatile struct SCC*)0xfffffa31)) | 455 | # define st_escc ((*(volatile struct SCC*)0xfffffa31)) |
diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h index 2936dda938d..65b13128283 100644 --- a/arch/m68k/include/asm/string.h +++ b/arch/m68k/include/asm/string.h | |||
| @@ -81,18 +81,6 @@ static inline char *strncpy(char *dest, const char *src, size_t n) | |||
| 81 | strcpy(__d + strlen(__d), (s)); \ | 81 | strcpy(__d + strlen(__d), (s)); \ |
| 82 | }) | 82 | }) |
| 83 | 83 | ||
| 84 | #define __HAVE_ARCH_STRCHR | ||
| 85 | static inline char *strchr(const char *s, int c) | ||
| 86 | { | ||
| 87 | char sc, ch = c; | ||
| 88 | |||
| 89 | for (; (sc = *s++) != ch; ) { | ||
| 90 | if (!sc) | ||
| 91 | return NULL; | ||
| 92 | } | ||
| 93 | return (char *)s - 1; | ||
| 94 | } | ||
| 95 | |||
| 96 | #ifndef CONFIG_COLDFIRE | 84 | #ifndef CONFIG_COLDFIRE |
| 97 | #define __HAVE_ARCH_STRCMP | 85 | #define __HAVE_ARCH_STRCMP |
| 98 | static inline int strcmp(const char *cs, const char *ct) | 86 | static inline int strcmp(const char *cs, const char *ct) |
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c index 11bdd68e576..fc770be465f 100644 --- a/arch/parisc/kernel/pdc_cons.c +++ b/arch/parisc/kernel/pdc_cons.c | |||
| @@ -169,11 +169,11 @@ static int __init pdc_console_tty_driver_init(void) | |||
| 169 | 169 | ||
| 170 | struct console *tmp; | 170 | struct console *tmp; |
| 171 | 171 | ||
| 172 | acquire_console_sem(); | 172 | console_lock(); |
| 173 | for_each_console(tmp) | 173 | for_each_console(tmp) |
| 174 | if (tmp == &pdc_cons) | 174 | if (tmp == &pdc_cons) |
| 175 | break; | 175 | break; |
| 176 | release_console_sem(); | 176 | console_unlock(); |
| 177 | 177 | ||
| 178 | if (!tmp) { | 178 | if (!tmp) { |
| 179 | printk(KERN_INFO "PDC console driver not registered anymore, not creating %s\n", pdc_cons.name); | 179 | printk(KERN_INFO "PDC console driver not registered anymore, not creating %s\n", pdc_cons.name); |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index ae555569823..8a9011dced1 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
| @@ -15,6 +15,7 @@ config SUPERH | |||
| 15 | select HAVE_KERNEL_GZIP | 15 | select HAVE_KERNEL_GZIP |
| 16 | select HAVE_KERNEL_BZIP2 | 16 | select HAVE_KERNEL_BZIP2 |
| 17 | select HAVE_KERNEL_LZMA | 17 | select HAVE_KERNEL_LZMA |
| 18 | select HAVE_KERNEL_XZ | ||
| 18 | select HAVE_KERNEL_LZO | 19 | select HAVE_KERNEL_LZO |
| 19 | select HAVE_SYSCALL_TRACEPOINTS | 20 | select HAVE_SYSCALL_TRACEPOINTS |
| 20 | select HAVE_REGS_AND_STACK_ACCESS_API | 21 | select HAVE_REGS_AND_STACK_ACCESS_API |
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 9c8c6e1a2a1..e3d8170ad00 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
| @@ -200,7 +200,7 @@ endif | |||
| 200 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) | 200 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) |
| 201 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) | 201 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) |
| 202 | 202 | ||
| 203 | BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.lzo \ | 203 | BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \ |
| 204 | uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \ | 204 | uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \ |
| 205 | romImage | 205 | romImage |
| 206 | PHONY += $(BOOT_TARGETS) | 206 | PHONY += $(BOOT_TARGETS) |
| @@ -230,5 +230,6 @@ define archhelp | |||
| 230 | @echo '* uImage.gz - Kernel-only image for U-Boot (gzip)' | 230 | @echo '* uImage.gz - Kernel-only image for U-Boot (gzip)' |
| 231 | @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' | 231 | @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' |
| 232 | @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' | 232 | @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' |
| 233 | @echo ' uImage.xz - Kernel-only image for U-Boot (xz)' | ||
| 233 | @echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)' | 234 | @echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)' |
| 234 | endef | 235 | endef |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 33b662999fc..701667acfd8 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
| @@ -1294,6 +1294,7 @@ static int __init arch_setup(void) | |||
| 1294 | i2c_register_board_info(1, i2c1_devices, | 1294 | i2c_register_board_info(1, i2c1_devices, |
| 1295 | ARRAY_SIZE(i2c1_devices)); | 1295 | ARRAY_SIZE(i2c1_devices)); |
| 1296 | 1296 | ||
| 1297 | #if defined(CONFIG_VIDEO_SH_VOU) || defined(CONFIG_VIDEO_SH_VOU_MODULE) | ||
| 1297 | /* VOU */ | 1298 | /* VOU */ |
| 1298 | gpio_request(GPIO_FN_DV_D15, NULL); | 1299 | gpio_request(GPIO_FN_DV_D15, NULL); |
| 1299 | gpio_request(GPIO_FN_DV_D14, NULL); | 1300 | gpio_request(GPIO_FN_DV_D14, NULL); |
| @@ -1325,6 +1326,7 @@ static int __init arch_setup(void) | |||
| 1325 | 1326 | ||
| 1326 | /* Remove reset */ | 1327 | /* Remove reset */ |
| 1327 | gpio_set_value(GPIO_PTG4, 1); | 1328 | gpio_set_value(GPIO_PTG4, 1); |
| 1329 | #endif | ||
| 1328 | 1330 | ||
| 1329 | return platform_add_devices(ecovec_devices, | 1331 | return platform_add_devices(ecovec_devices, |
| 1330 | ARRAY_SIZE(ecovec_devices)); | 1332 | ARRAY_SIZE(ecovec_devices)); |
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile index 1ce63624c9b..ba515d80024 100644 --- a/arch/sh/boot/Makefile +++ b/arch/sh/boot/Makefile | |||
| @@ -24,12 +24,13 @@ suffix-y := bin | |||
| 24 | suffix-$(CONFIG_KERNEL_GZIP) := gz | 24 | suffix-$(CONFIG_KERNEL_GZIP) := gz |
| 25 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 | 25 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 |
| 26 | suffix-$(CONFIG_KERNEL_LZMA) := lzma | 26 | suffix-$(CONFIG_KERNEL_LZMA) := lzma |
| 27 | suffix-$(CONFIG_KERNEL_XZ) := xz | ||
| 27 | suffix-$(CONFIG_KERNEL_LZO) := lzo | 28 | suffix-$(CONFIG_KERNEL_LZO) := lzo |
| 28 | 29 | ||
| 29 | targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \ | 30 | targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \ |
| 30 | uImage.bz2 uImage.lzma uImage.lzo uImage.bin | 31 | uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin |
| 31 | extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \ | 32 | extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \ |
| 32 | vmlinux.bin.lzo | 33 | vmlinux.bin.xz vmlinux.bin.lzo |
| 33 | subdir- := compressed romimage | 34 | subdir- := compressed romimage |
| 34 | 35 | ||
| 35 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | 36 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
| @@ -76,6 +77,9 @@ $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE | |||
| 76 | $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE | 77 | $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE |
| 77 | $(call if_changed,lzma) | 78 | $(call if_changed,lzma) |
| 78 | 79 | ||
| 80 | $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE | ||
| 81 | $(call if_changed,xzkern) | ||
| 82 | |||
| 79 | $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE | 83 | $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE |
| 80 | $(call if_changed,lzo) | 84 | $(call if_changed,lzo) |
| 81 | 85 | ||
| @@ -88,6 +92,9 @@ $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz | |||
| 88 | $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma | 92 | $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma |
| 89 | $(call if_changed,uimage,lzma) | 93 | $(call if_changed,uimage,lzma) |
| 90 | 94 | ||
| 95 | $(obj)/uImage.xz: $(obj)/vmlinux.bin.xz | ||
| 96 | $(call if_changed,uimage,xz) | ||
| 97 | |||
| 91 | $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo | 98 | $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo |
| 92 | $(call if_changed,uimage,lzo) | 99 | $(call if_changed,uimage,lzo) |
| 93 | 100 | ||
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index cfa5a087a88..e0b0293bae6 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz \ | 7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz \ |
| 8 | vmlinux.bin.bz2 vmlinux.bin.lzma \ | 8 | vmlinux.bin.bz2 vmlinux.bin.lzma \ |
| 9 | vmlinux.bin.lzo \ | 9 | vmlinux.bin.xz vmlinux.bin.lzo \ |
| 10 | head_$(BITS).o misc.o piggy.o | 10 | head_$(BITS).o misc.o piggy.o |
| 11 | 11 | ||
| 12 | OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o | 12 | OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o |
| @@ -50,6 +50,8 @@ $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE | |||
| 50 | $(call if_changed,bzip2) | 50 | $(call if_changed,bzip2) |
| 51 | $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE | 51 | $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE |
| 52 | $(call if_changed,lzma) | 52 | $(call if_changed,lzma) |
| 53 | $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE | ||
| 54 | $(call if_changed,xzkern) | ||
| 53 | $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE | 55 | $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE |
| 54 | $(call if_changed,lzo) | 56 | $(call if_changed,lzo) |
| 55 | 57 | ||
diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc.c index 27140a6b365..95470a472d2 100644 --- a/arch/sh/boot/compressed/misc.c +++ b/arch/sh/boot/compressed/misc.c | |||
| @@ -61,6 +61,10 @@ static unsigned long free_mem_end_ptr; | |||
| 61 | #include "../../../../lib/decompress_unlzma.c" | 61 | #include "../../../../lib/decompress_unlzma.c" |
| 62 | #endif | 62 | #endif |
| 63 | 63 | ||
| 64 | #ifdef CONFIG_KERNEL_XZ | ||
| 65 | #include "../../../../lib/decompress_unxz.c" | ||
| 66 | #endif | ||
| 67 | |||
| 64 | #ifdef CONFIG_KERNEL_LZO | 68 | #ifdef CONFIG_KERNEL_LZO |
| 65 | #include "../../../../lib/decompress_unlzo.c" | 69 | #include "../../../../lib/decompress_unlzo.c" |
| 66 | #endif | 70 | #endif |
diff --git a/arch/sh/include/asm/pgtable.h b/arch/sh/include/asm/pgtable.h index 083ea068e81..db85916b9e9 100644 --- a/arch/sh/include/asm/pgtable.h +++ b/arch/sh/include/asm/pgtable.h | |||
| @@ -134,6 +134,7 @@ typedef pte_t *pte_addr_t; | |||
| 134 | extern void pgtable_cache_init(void); | 134 | extern void pgtable_cache_init(void); |
| 135 | 135 | ||
| 136 | struct vm_area_struct; | 136 | struct vm_area_struct; |
| 137 | struct mm_struct; | ||
| 137 | 138 | ||
| 138 | extern void __update_cache(struct vm_area_struct *vma, | 139 | extern void __update_cache(struct vm_area_struct *vma, |
| 139 | unsigned long address, pte_t pte); | 140 | unsigned long address, pte_t pte); |
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c index c2b0aaaedca..672944f5b19 100644 --- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c | |||
| @@ -230,10 +230,10 @@ static struct platform_device *sh7750_devices[] __initdata = { | |||
| 230 | static int __init sh7750_devices_setup(void) | 230 | static int __init sh7750_devices_setup(void) |
| 231 | { | 231 | { |
| 232 | if (mach_is_rts7751r2d()) { | 232 | if (mach_is_rts7751r2d()) { |
| 233 | platform_register_device(&scif_device); | 233 | platform_device_register(&scif_device); |
| 234 | } else { | 234 | } else { |
| 235 | platform_register_device(&sci_device); | 235 | platform_device_register(&sci_device); |
| 236 | platform_register_device(&scif_device); | 236 | platform_device_register(&scif_device); |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | return platform_add_devices(sh7750_devices, | 239 | return platform_add_devices(sh7750_devices, |
diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c index 948fdb65693..38e862852dd 100644 --- a/arch/sh/kernel/topology.c +++ b/arch/sh/kernel/topology.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | static DEFINE_PER_CPU(struct cpu, cpu_devices); | 17 | static DEFINE_PER_CPU(struct cpu, cpu_devices); |
| 18 | 18 | ||
| 19 | cpumask_t cpu_core_map[NR_CPUS]; | 19 | cpumask_t cpu_core_map[NR_CPUS]; |
| 20 | EXPORT_SYMBOL(cpu_core_map); | ||
| 20 | 21 | ||
| 21 | static cpumask_t cpu_coregroup_map(unsigned int cpu) | 22 | static cpumask_t cpu_coregroup_map(unsigned int cpu) |
| 22 | { | 23 | { |
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 2071a8b2b32..ebbc4d8ab17 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
| @@ -558,13 +558,12 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
| 558 | static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, | 558 | static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, |
| 559 | pmd_t *pmdp, pmd_t pmd) | 559 | pmd_t *pmdp, pmd_t pmd) |
| 560 | { | 560 | { |
| 561 | #if PAGETABLE_LEVELS >= 3 | ||
| 562 | if (sizeof(pmdval_t) > sizeof(long)) | 561 | if (sizeof(pmdval_t) > sizeof(long)) |
| 563 | /* 5 arg words */ | 562 | /* 5 arg words */ |
| 564 | pv_mmu_ops.set_pmd_at(mm, addr, pmdp, pmd); | 563 | pv_mmu_ops.set_pmd_at(mm, addr, pmdp, pmd); |
| 565 | else | 564 | else |
| 566 | PVOP_VCALL4(pv_mmu_ops.set_pmd_at, mm, addr, pmdp, pmd.pmd); | 565 | PVOP_VCALL4(pv_mmu_ops.set_pmd_at, mm, addr, pmdp, |
| 567 | #endif | 566 | native_pmd_val(pmd)); |
| 568 | } | 567 | } |
| 569 | #endif | 568 | #endif |
| 570 | 569 | ||
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 656493a5e07..42615b419df 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c | |||
| @@ -407,12 +407,15 @@ static int rpm_suspend(struct device *dev, int rpmflags) | |||
| 407 | goto out; | 407 | goto out; |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | /* Maybe the parent is now able to suspend. */ | ||
| 410 | if (parent && !parent->power.ignore_children && !dev->power.irq_safe) { | 411 | if (parent && !parent->power.ignore_children && !dev->power.irq_safe) { |
| 411 | spin_unlock_irq(&dev->power.lock); | 412 | spin_unlock(&dev->power.lock); |
| 412 | 413 | ||
| 413 | pm_request_idle(parent); | 414 | spin_lock(&parent->power.lock); |
| 415 | rpm_idle(parent, RPM_ASYNC); | ||
| 416 | spin_unlock(&parent->power.lock); | ||
| 414 | 417 | ||
| 415 | spin_lock_irq(&dev->power.lock); | 418 | spin_lock(&dev->power.lock); |
| 416 | } | 419 | } |
| 417 | 420 | ||
| 418 | out: | 421 | out: |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 826ab0939a1..fab3d3265ad 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
| @@ -68,6 +68,7 @@ static struct _intel_private { | |||
| 68 | phys_addr_t gma_bus_addr; | 68 | phys_addr_t gma_bus_addr; |
| 69 | u32 PGETBL_save; | 69 | u32 PGETBL_save; |
| 70 | u32 __iomem *gtt; /* I915G */ | 70 | u32 __iomem *gtt; /* I915G */ |
| 71 | bool clear_fake_agp; /* on first access via agp, fill with scratch */ | ||
| 71 | int num_dcache_entries; | 72 | int num_dcache_entries; |
| 72 | union { | 73 | union { |
| 73 | void __iomem *i9xx_flush_page; | 74 | void __iomem *i9xx_flush_page; |
| @@ -869,21 +870,12 @@ static int intel_fake_agp_free_gatt_table(struct agp_bridge_data *bridge) | |||
| 869 | 870 | ||
| 870 | static int intel_fake_agp_configure(void) | 871 | static int intel_fake_agp_configure(void) |
| 871 | { | 872 | { |
| 872 | int i; | ||
| 873 | |||
| 874 | if (!intel_enable_gtt()) | 873 | if (!intel_enable_gtt()) |
| 875 | return -EIO; | 874 | return -EIO; |
| 876 | 875 | ||
| 876 | intel_private.clear_fake_agp = true; | ||
| 877 | agp_bridge->gart_bus_addr = intel_private.gma_bus_addr; | 877 | agp_bridge->gart_bus_addr = intel_private.gma_bus_addr; |
| 878 | 878 | ||
| 879 | for (i = 0; i < intel_private.base.gtt_total_entries; i++) { | ||
| 880 | intel_private.driver->write_entry(intel_private.scratch_page_dma, | ||
| 881 | i, 0); | ||
| 882 | } | ||
| 883 | readl(intel_private.gtt+i-1); /* PCI Posting. */ | ||
| 884 | |||
| 885 | global_cache_flush(); | ||
| 886 | |||
| 887 | return 0; | 879 | return 0; |
| 888 | } | 880 | } |
| 889 | 881 | ||
| @@ -945,6 +937,13 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem, | |||
| 945 | { | 937 | { |
| 946 | int ret = -EINVAL; | 938 | int ret = -EINVAL; |
| 947 | 939 | ||
| 940 | if (intel_private.clear_fake_agp) { | ||
| 941 | int start = intel_private.base.stolen_size / PAGE_SIZE; | ||
| 942 | int end = intel_private.base.gtt_mappable_entries; | ||
| 943 | intel_gtt_clear_range(start, end - start); | ||
| 944 | intel_private.clear_fake_agp = false; | ||
| 945 | } | ||
| 946 | |||
| 948 | if (INTEL_GTT_GEN == 1 && type == AGP_DCACHE_MEMORY) | 947 | if (INTEL_GTT_GEN == 1 && type == AGP_DCACHE_MEMORY) |
| 949 | return i810_insert_dcache_entries(mem, pg_start, type); | 948 | return i810_insert_dcache_entries(mem, pg_start, type); |
| 950 | 949 | ||
diff --git a/drivers/char/bfin_jtag_comm.c b/drivers/char/bfin_jtag_comm.c index e397df3ad98..16402445f2b 100644 --- a/drivers/char/bfin_jtag_comm.c +++ b/drivers/char/bfin_jtag_comm.c | |||
| @@ -183,16 +183,16 @@ bfin_jc_circ_write(const unsigned char *buf, int count) | |||
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | #ifndef CONFIG_BFIN_JTAG_COMM_CONSOLE | 185 | #ifndef CONFIG_BFIN_JTAG_COMM_CONSOLE |
| 186 | # define acquire_console_sem() | 186 | # define console_lock() |
| 187 | # define release_console_sem() | 187 | # define console_unlock() |
| 188 | #endif | 188 | #endif |
| 189 | static int | 189 | static int |
| 190 | bfin_jc_write(struct tty_struct *tty, const unsigned char *buf, int count) | 190 | bfin_jc_write(struct tty_struct *tty, const unsigned char *buf, int count) |
| 191 | { | 191 | { |
| 192 | int i; | 192 | int i; |
| 193 | acquire_console_sem(); | 193 | console_lock(); |
| 194 | i = bfin_jc_circ_write(buf, count); | 194 | i = bfin_jc_circ_write(buf, count); |
| 195 | release_console_sem(); | 195 | console_unlock(); |
| 196 | wake_up_process(bfin_jc_kthread); | 196 | wake_up_process(bfin_jc_kthread); |
| 197 | return i; | 197 | return i; |
| 198 | } | 198 | } |
diff --git a/drivers/clocksource/tcb_clksrc.c b/drivers/clocksource/tcb_clksrc.c index 01b886e6882..79c47e88d5d 100644 --- a/drivers/clocksource/tcb_clksrc.c +++ b/drivers/clocksource/tcb_clksrc.c | |||
| @@ -196,9 +196,9 @@ static void __init setup_clkevents(struct atmel_tc *tc, int clk32k_divisor_idx) | |||
| 196 | clkevt.clkevt.min_delta_ns = clockevent_delta2ns(1, &clkevt.clkevt) + 1; | 196 | clkevt.clkevt.min_delta_ns = clockevent_delta2ns(1, &clkevt.clkevt) + 1; |
| 197 | clkevt.clkevt.cpumask = cpumask_of(0); | 197 | clkevt.clkevt.cpumask = cpumask_of(0); |
| 198 | 198 | ||
| 199 | setup_irq(irq, &tc_irqaction); | ||
| 200 | |||
| 201 | clockevents_register_device(&clkevt.clkevt); | 199 | clockevents_register_device(&clkevt.clkevt); |
| 200 | |||
| 201 | setup_irq(irq, &tc_irqaction); | ||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | #else /* !CONFIG_GENERIC_CLOCKEVENTS */ | 204 | #else /* !CONFIG_GENERIC_CLOCKEVENTS */ |
diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c index d81cc748e77..54d70a47afc 100644 --- a/drivers/gpio/langwell_gpio.c +++ b/drivers/gpio/langwell_gpio.c | |||
| @@ -187,7 +187,7 @@ MODULE_DEVICE_TABLE(pci, lnw_gpio_ids); | |||
| 187 | 187 | ||
| 188 | static void lnw_irq_handler(unsigned irq, struct irq_desc *desc) | 188 | static void lnw_irq_handler(unsigned irq, struct irq_desc *desc) |
| 189 | { | 189 | { |
| 190 | struct lnw_gpio *lnw = (struct lnw_gpio *)get_irq_data(irq); | 190 | struct lnw_gpio *lnw = get_irq_data(irq); |
| 191 | u32 base, gpio; | 191 | u32 base, gpio; |
| 192 | void __iomem *gedr; | 192 | void __iomem *gedr; |
| 193 | u32 gedr_v; | 193 | u32 gedr_v; |
| @@ -206,7 +206,12 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc) | |||
| 206 | /* clear the edge detect status bit */ | 206 | /* clear the edge detect status bit */ |
| 207 | writel(gedr_v, gedr); | 207 | writel(gedr_v, gedr); |
| 208 | } | 208 | } |
| 209 | desc->chip->eoi(irq); | 209 | |
| 210 | if (desc->chip->irq_eoi) | ||
| 211 | desc->chip->irq_eoi(irq_get_irq_data(irq)); | ||
| 212 | else | ||
| 213 | dev_warn(lnw->chip.dev, "missing EOI handler for irq %d\n", irq); | ||
| 214 | |||
| 210 | } | 215 | } |
| 211 | 216 | ||
| 212 | static int __devinit lnw_gpio_probe(struct pci_dev *pdev, | 217 | static int __devinit lnw_gpio_probe(struct pci_dev *pdev, |
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index bea966f8ac8..0902d446003 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig | |||
| @@ -100,7 +100,10 @@ config DRM_I830 | |||
| 100 | config DRM_I915 | 100 | config DRM_I915 |
| 101 | tristate "i915 driver" | 101 | tristate "i915 driver" |
| 102 | depends on AGP_INTEL | 102 | depends on AGP_INTEL |
| 103 | # we need shmfs for the swappable backing store, and in particular | ||
| 104 | # the shmem_readpage() which depends upon tmpfs | ||
| 103 | select SHMEM | 105 | select SHMEM |
| 106 | select TMPFS | ||
| 104 | select DRM_KMS_HELPER | 107 | select DRM_KMS_HELPER |
| 105 | select FB_CFB_FILLRECT | 108 | select FB_CFB_FILLRECT |
| 106 | select FB_CFB_COPYAREA | 109 | select FB_CFB_COPYAREA |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 844f3c972b0..17bd766f208 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -152,7 +152,7 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init) | |||
| 152 | { | 152 | { |
| 153 | drm_i915_private_t *dev_priv = dev->dev_private; | 153 | drm_i915_private_t *dev_priv = dev->dev_private; |
| 154 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; | 154 | struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv; |
| 155 | struct intel_ring_buffer *ring = LP_RING(dev_priv); | 155 | int ret; |
| 156 | 156 | ||
| 157 | master_priv->sarea = drm_getsarea(dev); | 157 | master_priv->sarea = drm_getsarea(dev); |
| 158 | if (master_priv->sarea) { | 158 | if (master_priv->sarea) { |
| @@ -163,33 +163,22 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init) | |||
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | if (init->ring_size != 0) { | 165 | if (init->ring_size != 0) { |
| 166 | if (ring->obj != NULL) { | 166 | if (LP_RING(dev_priv)->obj != NULL) { |
| 167 | i915_dma_cleanup(dev); | 167 | i915_dma_cleanup(dev); |
| 168 | DRM_ERROR("Client tried to initialize ringbuffer in " | 168 | DRM_ERROR("Client tried to initialize ringbuffer in " |
| 169 | "GEM mode\n"); | 169 | "GEM mode\n"); |
| 170 | return -EINVAL; | 170 | return -EINVAL; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | ring->size = init->ring_size; | 173 | ret = intel_render_ring_init_dri(dev, |
| 174 | 174 | init->ring_start, | |
| 175 | ring->map.offset = init->ring_start; | 175 | init->ring_size); |
| 176 | ring->map.size = init->ring_size; | 176 | if (ret) { |
| 177 | ring->map.type = 0; | ||
| 178 | ring->map.flags = 0; | ||
| 179 | ring->map.mtrr = 0; | ||
| 180 | |||
| 181 | drm_core_ioremap_wc(&ring->map, dev); | ||
| 182 | |||
| 183 | if (ring->map.handle == NULL) { | ||
| 184 | i915_dma_cleanup(dev); | 177 | i915_dma_cleanup(dev); |
| 185 | DRM_ERROR("can not ioremap virtual address for" | 178 | return ret; |
| 186 | " ring buffer\n"); | ||
| 187 | return -ENOMEM; | ||
| 188 | } | 179 | } |
| 189 | } | 180 | } |
| 190 | 181 | ||
| 191 | ring->virtual_start = ring->map.handle; | ||
| 192 | |||
| 193 | dev_priv->cpp = init->cpp; | 182 | dev_priv->cpp = init->cpp; |
| 194 | dev_priv->back_offset = init->back_offset; | 183 | dev_priv->back_offset = init->back_offset; |
| 195 | dev_priv->front_offset = init->front_offset; | 184 | dev_priv->front_offset = init->front_offset; |
| @@ -1226,9 +1215,15 @@ static int i915_load_modeset_init(struct drm_device *dev) | |||
| 1226 | if (ret) | 1215 | if (ret) |
| 1227 | DRM_INFO("failed to find VBIOS tables\n"); | 1216 | DRM_INFO("failed to find VBIOS tables\n"); |
| 1228 | 1217 | ||
| 1229 | /* if we have > 1 VGA cards, then disable the radeon VGA resources */ | 1218 | /* If we have > 1 VGA cards, then we need to arbitrate access |
| 1219 | * to the common VGA resources. | ||
| 1220 | * | ||
| 1221 | * If we are a secondary display controller (!PCI_DISPLAY_CLASS_VGA), | ||
| 1222 | * then we do not take part in VGA arbitration and the | ||
| 1223 | * vga_client_register() fails with -ENODEV. | ||
| 1224 | */ | ||
| 1230 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); | 1225 | ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); |
| 1231 | if (ret) | 1226 | if (ret && ret != -ENODEV) |
| 1232 | goto cleanup_ringbuffer; | 1227 | goto cleanup_ringbuffer; |
| 1233 | 1228 | ||
| 1234 | intel_register_dsm_handler(); | 1229 | intel_register_dsm_handler(); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 72fea2bcfc4..66796bb82d3 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
| @@ -60,7 +60,7 @@ extern int intel_agp_enabled; | |||
| 60 | 60 | ||
| 61 | #define INTEL_VGA_DEVICE(id, info) { \ | 61 | #define INTEL_VGA_DEVICE(id, info) { \ |
| 62 | .class = PCI_CLASS_DISPLAY_VGA << 8, \ | 62 | .class = PCI_CLASS_DISPLAY_VGA << 8, \ |
| 63 | .class_mask = 0xffff00, \ | 63 | .class_mask = 0xff0000, \ |
| 64 | .vendor = 0x8086, \ | 64 | .vendor = 0x8086, \ |
| 65 | .device = id, \ | 65 | .device = id, \ |
| 66 | .subvendor = PCI_ANY_ID, \ | 66 | .subvendor = PCI_ANY_ID, \ |
| @@ -752,6 +752,9 @@ static int __init i915_init(void) | |||
| 752 | driver.driver_features &= ~DRIVER_MODESET; | 752 | driver.driver_features &= ~DRIVER_MODESET; |
| 753 | #endif | 753 | #endif |
| 754 | 754 | ||
| 755 | if (!(driver.driver_features & DRIVER_MODESET)) | ||
| 756 | driver.get_vblank_timestamp = NULL; | ||
| 757 | |||
| 755 | return drm_init(&driver); | 758 | return drm_init(&driver); |
| 756 | } | 759 | } |
| 757 | 760 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5969f46ac2d..a0149c619cd 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
| @@ -543,8 +543,11 @@ typedef struct drm_i915_private { | |||
| 543 | /** List of all objects in gtt_space. Used to restore gtt | 543 | /** List of all objects in gtt_space. Used to restore gtt |
| 544 | * mappings on resume */ | 544 | * mappings on resume */ |
| 545 | struct list_head gtt_list; | 545 | struct list_head gtt_list; |
| 546 | /** End of mappable part of GTT */ | 546 | |
| 547 | /** Usable portion of the GTT for GEM */ | ||
| 548 | unsigned long gtt_start; | ||
| 547 | unsigned long gtt_mappable_end; | 549 | unsigned long gtt_mappable_end; |
| 550 | unsigned long gtt_end; | ||
| 548 | 551 | ||
| 549 | struct io_mapping *gtt_mapping; | 552 | struct io_mapping *gtt_mapping; |
| 550 | int gtt_mtrr; | 553 | int gtt_mtrr; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 3dfc848ff75..cf4f74c7c6f 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -140,12 +140,16 @@ void i915_gem_do_init(struct drm_device *dev, | |||
| 140 | { | 140 | { |
| 141 | drm_i915_private_t *dev_priv = dev->dev_private; | 141 | drm_i915_private_t *dev_priv = dev->dev_private; |
| 142 | 142 | ||
| 143 | drm_mm_init(&dev_priv->mm.gtt_space, start, | 143 | drm_mm_init(&dev_priv->mm.gtt_space, start, end - start); |
| 144 | end - start); | ||
| 145 | 144 | ||
| 145 | dev_priv->mm.gtt_start = start; | ||
| 146 | dev_priv->mm.gtt_mappable_end = mappable_end; | ||
| 147 | dev_priv->mm.gtt_end = end; | ||
| 146 | dev_priv->mm.gtt_total = end - start; | 148 | dev_priv->mm.gtt_total = end - start; |
| 147 | dev_priv->mm.mappable_gtt_total = min(end, mappable_end) - start; | 149 | dev_priv->mm.mappable_gtt_total = min(end, mappable_end) - start; |
| 148 | dev_priv->mm.gtt_mappable_end = mappable_end; | 150 | |
| 151 | /* Take over this portion of the GTT */ | ||
| 152 | intel_gtt_clear_range(start / PAGE_SIZE, (end-start) / PAGE_SIZE); | ||
| 149 | } | 153 | } |
| 150 | 154 | ||
| 151 | int | 155 | int |
| @@ -1857,7 +1861,7 @@ i915_gem_retire_requests_ring(struct drm_device *dev, | |||
| 1857 | 1861 | ||
| 1858 | seqno = ring->get_seqno(ring); | 1862 | seqno = ring->get_seqno(ring); |
| 1859 | 1863 | ||
| 1860 | for (i = 0; i < I915_NUM_RINGS; i++) | 1864 | for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++) |
| 1861 | if (seqno >= ring->sync_seqno[i]) | 1865 | if (seqno >= ring->sync_seqno[i]) |
| 1862 | ring->sync_seqno[i] = 0; | 1866 | ring->sync_seqno[i] = 0; |
| 1863 | 1867 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index dcfdf4151b6..d2f445e825f 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
| @@ -1175,7 +1175,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
| 1175 | goto err; | 1175 | goto err; |
| 1176 | 1176 | ||
| 1177 | seqno = i915_gem_next_request_seqno(dev, ring); | 1177 | seqno = i915_gem_next_request_seqno(dev, ring); |
| 1178 | for (i = 0; i < I915_NUM_RINGS-1; i++) { | 1178 | for (i = 0; i < ARRAY_SIZE(ring->sync_seqno); i++) { |
| 1179 | if (seqno < ring->sync_seqno[i]) { | 1179 | if (seqno < ring->sync_seqno[i]) { |
| 1180 | /* The GPU can not handle its semaphore value wrapping, | 1180 | /* The GPU can not handle its semaphore value wrapping, |
| 1181 | * so every billion or so execbuffers, we need to stall | 1181 | * so every billion or so execbuffers, we need to stall |
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 70433ae50ac..b0abdc64aa9 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
| @@ -34,6 +34,10 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev) | |||
| 34 | struct drm_i915_private *dev_priv = dev->dev_private; | 34 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 35 | struct drm_i915_gem_object *obj; | 35 | struct drm_i915_gem_object *obj; |
| 36 | 36 | ||
| 37 | /* First fill our portion of the GTT with scratch pages */ | ||
| 38 | intel_gtt_clear_range(dev_priv->mm.gtt_start / PAGE_SIZE, | ||
| 39 | (dev_priv->mm.gtt_end - dev_priv->mm.gtt_start) / PAGE_SIZE); | ||
| 40 | |||
| 37 | list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) { | 41 | list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) { |
| 38 | i915_gem_clflush_object(obj); | 42 | i915_gem_clflush_object(obj); |
| 39 | 43 | ||
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index b8e509ae065..062f353497e 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
| @@ -274,24 +274,35 @@ int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | |||
| 274 | return ret; | 274 | return ret; |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | int i915_get_vblank_timestamp(struct drm_device *dev, int crtc, | 277 | int i915_get_vblank_timestamp(struct drm_device *dev, int pipe, |
| 278 | int *max_error, | 278 | int *max_error, |
| 279 | struct timeval *vblank_time, | 279 | struct timeval *vblank_time, |
| 280 | unsigned flags) | 280 | unsigned flags) |
| 281 | { | 281 | { |
| 282 | struct drm_crtc *drmcrtc; | 282 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 283 | struct drm_crtc *crtc; | ||
| 283 | 284 | ||
| 284 | if (crtc < 0 || crtc >= dev->num_crtcs) { | 285 | if (pipe < 0 || pipe >= dev_priv->num_pipe) { |
| 285 | DRM_ERROR("Invalid crtc %d\n", crtc); | 286 | DRM_ERROR("Invalid crtc %d\n", pipe); |
| 286 | return -EINVAL; | 287 | return -EINVAL; |
| 287 | } | 288 | } |
| 288 | 289 | ||
| 289 | /* Get drm_crtc to timestamp: */ | 290 | /* Get drm_crtc to timestamp: */ |
| 290 | drmcrtc = intel_get_crtc_for_pipe(dev, crtc); | 291 | crtc = intel_get_crtc_for_pipe(dev, pipe); |
| 292 | if (crtc == NULL) { | ||
| 293 | DRM_ERROR("Invalid crtc %d\n", pipe); | ||
| 294 | return -EINVAL; | ||
| 295 | } | ||
| 296 | |||
| 297 | if (!crtc->enabled) { | ||
| 298 | DRM_DEBUG_KMS("crtc %d is disabled\n", pipe); | ||
| 299 | return -EBUSY; | ||
| 300 | } | ||
| 291 | 301 | ||
| 292 | /* Helper routine in DRM core does all the work: */ | 302 | /* Helper routine in DRM core does all the work: */ |
| 293 | return drm_calc_vbltimestamp_from_scanoutpos(dev, crtc, max_error, | 303 | return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error, |
| 294 | vblank_time, flags, drmcrtc); | 304 | vblank_time, flags, |
| 305 | crtc); | ||
| 295 | } | 306 | } |
| 296 | 307 | ||
| 297 | /* | 308 | /* |
| @@ -348,8 +359,12 @@ static void notify_ring(struct drm_device *dev, | |||
| 348 | struct intel_ring_buffer *ring) | 359 | struct intel_ring_buffer *ring) |
| 349 | { | 360 | { |
| 350 | struct drm_i915_private *dev_priv = dev->dev_private; | 361 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 351 | u32 seqno = ring->get_seqno(ring); | 362 | u32 seqno; |
| 352 | 363 | ||
| 364 | if (ring->obj == NULL) | ||
| 365 | return; | ||
| 366 | |||
| 367 | seqno = ring->get_seqno(ring); | ||
| 353 | trace_i915_gem_request_complete(dev, seqno); | 368 | trace_i915_gem_request_complete(dev, seqno); |
| 354 | 369 | ||
| 355 | ring->irq_seqno = seqno; | 370 | ring->irq_seqno = seqno; |
| @@ -831,6 +846,8 @@ static void i915_capture_error_state(struct drm_device *dev) | |||
| 831 | i++; | 846 | i++; |
| 832 | error->pinned_bo_count = i - error->active_bo_count; | 847 | error->pinned_bo_count = i - error->active_bo_count; |
| 833 | 848 | ||
| 849 | error->active_bo = NULL; | ||
| 850 | error->pinned_bo = NULL; | ||
| 834 | if (i) { | 851 | if (i) { |
| 835 | error->active_bo = kmalloc(sizeof(*error->active_bo)*i, | 852 | error->active_bo = kmalloc(sizeof(*error->active_bo)*i, |
| 836 | GFP_ATOMIC); | 853 | GFP_ATOMIC); |
| @@ -1278,12 +1295,12 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr) | |||
| 1278 | if (master_priv->sarea_priv) | 1295 | if (master_priv->sarea_priv) |
| 1279 | master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; | 1296 | master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT; |
| 1280 | 1297 | ||
| 1281 | ret = -ENODEV; | ||
| 1282 | if (ring->irq_get(ring)) { | 1298 | if (ring->irq_get(ring)) { |
| 1283 | DRM_WAIT_ON(ret, ring->irq_queue, 3 * DRM_HZ, | 1299 | DRM_WAIT_ON(ret, ring->irq_queue, 3 * DRM_HZ, |
| 1284 | READ_BREADCRUMB(dev_priv) >= irq_nr); | 1300 | READ_BREADCRUMB(dev_priv) >= irq_nr); |
| 1285 | ring->irq_put(ring); | 1301 | ring->irq_put(ring); |
| 1286 | } | 1302 | } else if (wait_for(READ_BREADCRUMB(dev_priv) >= irq_nr, 3000)) |
| 1303 | ret = -EBUSY; | ||
| 1287 | 1304 | ||
| 1288 | if (ret == -EBUSY) { | 1305 | if (ret == -EBUSY) { |
| 1289 | DRM_ERROR("EBUSY -- rec: %d emitted: %d\n", | 1306 | DRM_ERROR("EBUSY -- rec: %d emitted: %d\n", |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 40a407f41f6..5cfc68940f1 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -513,6 +513,10 @@ | |||
| 513 | #define GEN6_BLITTER_SYNC_STATUS (1 << 24) | 513 | #define GEN6_BLITTER_SYNC_STATUS (1 << 24) |
| 514 | #define GEN6_BLITTER_USER_INTERRUPT (1 << 22) | 514 | #define GEN6_BLITTER_USER_INTERRUPT (1 << 22) |
| 515 | 515 | ||
| 516 | #define GEN6_BLITTER_ECOSKPD 0x221d0 | ||
| 517 | #define GEN6_BLITTER_LOCK_SHIFT 16 | ||
| 518 | #define GEN6_BLITTER_FBC_NOTIFY (1<<3) | ||
| 519 | |||
| 516 | #define GEN6_BSD_SLEEP_PSMI_CONTROL 0x12050 | 520 | #define GEN6_BSD_SLEEP_PSMI_CONTROL 0x12050 |
| 517 | #define GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_MODIFY_MASK (1 << 16) | 521 | #define GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_MODIFY_MASK (1 << 16) |
| 518 | #define GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_DISABLE (1 << 0) | 522 | #define GEN6_BSD_SLEEP_PSMI_CONTROL_RC_ILDL_MESSAGE_DISABLE (1 << 0) |
| @@ -2626,6 +2630,8 @@ | |||
| 2626 | #define DISPLAY_PORT_PLL_BIOS_2 0x46014 | 2630 | #define DISPLAY_PORT_PLL_BIOS_2 0x46014 |
| 2627 | 2631 | ||
| 2628 | #define PCH_DSPCLK_GATE_D 0x42020 | 2632 | #define PCH_DSPCLK_GATE_D 0x42020 |
| 2633 | # define DPFCUNIT_CLOCK_GATE_DISABLE (1 << 9) | ||
| 2634 | # define DPFCRUNIT_CLOCK_GATE_DISABLE (1 << 8) | ||
| 2629 | # define DPFDUNIT_CLOCK_GATE_DISABLE (1 << 7) | 2635 | # define DPFDUNIT_CLOCK_GATE_DISABLE (1 << 7) |
| 2630 | # define DPARBUNIT_CLOCK_GATE_DISABLE (1 << 5) | 2636 | # define DPARBUNIT_CLOCK_GATE_DISABLE (1 << 5) |
| 2631 | 2637 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 98967f3b772..d7f237deaaf 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -1213,6 +1213,26 @@ static bool g4x_fbc_enabled(struct drm_device *dev) | |||
| 1213 | return I915_READ(DPFC_CONTROL) & DPFC_CTL_EN; | 1213 | return I915_READ(DPFC_CONTROL) & DPFC_CTL_EN; |
| 1214 | } | 1214 | } |
| 1215 | 1215 | ||
| 1216 | static void sandybridge_blit_fbc_update(struct drm_device *dev) | ||
| 1217 | { | ||
| 1218 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1219 | u32 blt_ecoskpd; | ||
| 1220 | |||
| 1221 | /* Make sure blitter notifies FBC of writes */ | ||
| 1222 | __gen6_force_wake_get(dev_priv); | ||
| 1223 | blt_ecoskpd = I915_READ(GEN6_BLITTER_ECOSKPD); | ||
| 1224 | blt_ecoskpd |= GEN6_BLITTER_FBC_NOTIFY << | ||
| 1225 | GEN6_BLITTER_LOCK_SHIFT; | ||
| 1226 | I915_WRITE(GEN6_BLITTER_ECOSKPD, blt_ecoskpd); | ||
| 1227 | blt_ecoskpd |= GEN6_BLITTER_FBC_NOTIFY; | ||
| 1228 | I915_WRITE(GEN6_BLITTER_ECOSKPD, blt_ecoskpd); | ||
| 1229 | blt_ecoskpd &= ~(GEN6_BLITTER_FBC_NOTIFY << | ||
| 1230 | GEN6_BLITTER_LOCK_SHIFT); | ||
| 1231 | I915_WRITE(GEN6_BLITTER_ECOSKPD, blt_ecoskpd); | ||
| 1232 | POSTING_READ(GEN6_BLITTER_ECOSKPD); | ||
| 1233 | __gen6_force_wake_put(dev_priv); | ||
| 1234 | } | ||
| 1235 | |||
| 1216 | static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval) | 1236 | static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval) |
| 1217 | { | 1237 | { |
| 1218 | struct drm_device *dev = crtc->dev; | 1238 | struct drm_device *dev = crtc->dev; |
| @@ -1266,6 +1286,7 @@ static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval) | |||
| 1266 | I915_WRITE(SNB_DPFC_CTL_SA, | 1286 | I915_WRITE(SNB_DPFC_CTL_SA, |
| 1267 | SNB_CPU_FENCE_ENABLE | dev_priv->cfb_fence); | 1287 | SNB_CPU_FENCE_ENABLE | dev_priv->cfb_fence); |
| 1268 | I915_WRITE(DPFC_CPU_FENCE_OFFSET, crtc->y); | 1288 | I915_WRITE(DPFC_CPU_FENCE_OFFSET, crtc->y); |
| 1289 | sandybridge_blit_fbc_update(dev); | ||
| 1269 | } | 1290 | } |
| 1270 | 1291 | ||
| 1271 | DRM_DEBUG_KMS("enabled fbc on plane %d\n", intel_crtc->plane); | 1292 | DRM_DEBUG_KMS("enabled fbc on plane %d\n", intel_crtc->plane); |
| @@ -6286,7 +6307,9 @@ void intel_enable_clock_gating(struct drm_device *dev) | |||
| 6286 | 6307 | ||
| 6287 | if (IS_GEN5(dev)) { | 6308 | if (IS_GEN5(dev)) { |
| 6288 | /* Required for FBC */ | 6309 | /* Required for FBC */ |
| 6289 | dspclk_gate |= DPFDUNIT_CLOCK_GATE_DISABLE; | 6310 | dspclk_gate |= DPFCUNIT_CLOCK_GATE_DISABLE | |
| 6311 | DPFCRUNIT_CLOCK_GATE_DISABLE | | ||
| 6312 | DPFDUNIT_CLOCK_GATE_DISABLE; | ||
| 6290 | /* Required for CxSR */ | 6313 | /* Required for CxSR */ |
| 6291 | dspclk_gate |= DPARBUNIT_CLOCK_GATE_DISABLE; | 6314 | dspclk_gate |= DPARBUNIT_CLOCK_GATE_DISABLE; |
| 6292 | 6315 | ||
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index f295a7aaadf..64fd64443ca 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #include <linux/acpi.h> | 28 | #include <linux/acpi.h> |
| 29 | #include <linux/acpi_io.h> | ||
| 29 | #include <acpi/video.h> | 30 | #include <acpi/video.h> |
| 30 | 31 | ||
| 31 | #include "drmP.h" | 32 | #include "drmP.h" |
| @@ -476,7 +477,7 @@ int intel_opregion_setup(struct drm_device *dev) | |||
| 476 | return -ENOTSUPP; | 477 | return -ENOTSUPP; |
| 477 | } | 478 | } |
| 478 | 479 | ||
| 479 | base = ioremap(asls, OPREGION_SIZE); | 480 | base = acpi_os_ioremap(asls, OPREGION_SIZE); |
| 480 | if (!base) | 481 | if (!base) |
| 481 | return -ENOMEM; | 482 | return -ENOMEM; |
| 482 | 483 | ||
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index f6b9baa6a63..6218fa97aa1 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
| @@ -34,6 +34,14 @@ | |||
| 34 | #include "i915_trace.h" | 34 | #include "i915_trace.h" |
| 35 | #include "intel_drv.h" | 35 | #include "intel_drv.h" |
| 36 | 36 | ||
| 37 | static inline int ring_space(struct intel_ring_buffer *ring) | ||
| 38 | { | ||
| 39 | int space = (ring->head & HEAD_ADDR) - (ring->tail + 8); | ||
| 40 | if (space < 0) | ||
| 41 | space += ring->size; | ||
| 42 | return space; | ||
| 43 | } | ||
| 44 | |||
| 37 | static u32 i915_gem_get_seqno(struct drm_device *dev) | 45 | static u32 i915_gem_get_seqno(struct drm_device *dev) |
| 38 | { | 46 | { |
| 39 | drm_i915_private_t *dev_priv = dev->dev_private; | 47 | drm_i915_private_t *dev_priv = dev->dev_private; |
| @@ -204,11 +212,9 @@ static int init_ring_common(struct intel_ring_buffer *ring) | |||
| 204 | if (!drm_core_check_feature(ring->dev, DRIVER_MODESET)) | 212 | if (!drm_core_check_feature(ring->dev, DRIVER_MODESET)) |
| 205 | i915_kernel_lost_context(ring->dev); | 213 | i915_kernel_lost_context(ring->dev); |
| 206 | else { | 214 | else { |
| 207 | ring->head = I915_READ_HEAD(ring) & HEAD_ADDR; | 215 | ring->head = I915_READ_HEAD(ring); |
| 208 | ring->tail = I915_READ_TAIL(ring) & TAIL_ADDR; | 216 | ring->tail = I915_READ_TAIL(ring) & TAIL_ADDR; |
| 209 | ring->space = ring->head - (ring->tail + 8); | 217 | ring->space = ring_space(ring); |
| 210 | if (ring->space < 0) | ||
| 211 | ring->space += ring->size; | ||
| 212 | } | 218 | } |
| 213 | 219 | ||
| 214 | return 0; | 220 | return 0; |
| @@ -921,32 +927,34 @@ static int intel_wrap_ring_buffer(struct intel_ring_buffer *ring) | |||
| 921 | } | 927 | } |
| 922 | 928 | ||
| 923 | ring->tail = 0; | 929 | ring->tail = 0; |
| 924 | ring->space = ring->head - 8; | 930 | ring->space = ring_space(ring); |
| 925 | 931 | ||
| 926 | return 0; | 932 | return 0; |
| 927 | } | 933 | } |
| 928 | 934 | ||
| 929 | int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n) | 935 | int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n) |
| 930 | { | 936 | { |
| 931 | int reread = 0; | ||
| 932 | struct drm_device *dev = ring->dev; | 937 | struct drm_device *dev = ring->dev; |
| 933 | struct drm_i915_private *dev_priv = dev->dev_private; | 938 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 934 | unsigned long end; | 939 | unsigned long end; |
| 935 | u32 head; | 940 | u32 head; |
| 936 | 941 | ||
| 942 | /* If the reported head position has wrapped or hasn't advanced, | ||
| 943 | * fallback to the slow and accurate path. | ||
| 944 | */ | ||
| 945 | head = intel_read_status_page(ring, 4); | ||
| 946 | if (head > ring->head) { | ||
| 947 | ring->head = head; | ||
| 948 | ring->space = ring_space(ring); | ||
| 949 | if (ring->space >= n) | ||
| 950 | return 0; | ||
| 951 | } | ||
| 952 | |||
| 937 | trace_i915_ring_wait_begin (dev); | 953 | trace_i915_ring_wait_begin (dev); |
| 938 | end = jiffies + 3 * HZ; | 954 | end = jiffies + 3 * HZ; |
| 939 | do { | 955 | do { |
| 940 | /* If the reported head position has wrapped or hasn't advanced, | 956 | ring->head = I915_READ_HEAD(ring); |
| 941 | * fallback to the slow and accurate path. | 957 | ring->space = ring_space(ring); |
| 942 | */ | ||
| 943 | head = intel_read_status_page(ring, 4); | ||
| 944 | if (reread) | ||
| 945 | head = I915_READ_HEAD(ring); | ||
| 946 | ring->head = head & HEAD_ADDR; | ||
| 947 | ring->space = ring->head - (ring->tail + 8); | ||
| 948 | if (ring->space < 0) | ||
| 949 | ring->space += ring->size; | ||
| 950 | if (ring->space >= n) { | 958 | if (ring->space >= n) { |
| 951 | trace_i915_ring_wait_end(dev); | 959 | trace_i915_ring_wait_end(dev); |
| 952 | return 0; | 960 | return 0; |
| @@ -961,7 +969,6 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n) | |||
| 961 | msleep(1); | 969 | msleep(1); |
| 962 | if (atomic_read(&dev_priv->mm.wedged)) | 970 | if (atomic_read(&dev_priv->mm.wedged)) |
| 963 | return -EAGAIN; | 971 | return -EAGAIN; |
| 964 | reread = 1; | ||
| 965 | } while (!time_after(jiffies, end)); | 972 | } while (!time_after(jiffies, end)); |
| 966 | trace_i915_ring_wait_end (dev); | 973 | trace_i915_ring_wait_end (dev); |
| 967 | return -EBUSY; | 974 | return -EBUSY; |
| @@ -1292,6 +1299,48 @@ int intel_init_render_ring_buffer(struct drm_device *dev) | |||
| 1292 | return intel_init_ring_buffer(dev, ring); | 1299 | return intel_init_ring_buffer(dev, ring); |
| 1293 | } | 1300 | } |
| 1294 | 1301 | ||
| 1302 | int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size) | ||
| 1303 | { | ||
| 1304 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
| 1305 | struct intel_ring_buffer *ring = &dev_priv->ring[RCS]; | ||
| 1306 | |||
| 1307 | *ring = render_ring; | ||
| 1308 | if (INTEL_INFO(dev)->gen >= 6) { | ||
| 1309 | ring->add_request = gen6_add_request; | ||
| 1310 | ring->irq_get = gen6_render_ring_get_irq; | ||
| 1311 | ring->irq_put = gen6_render_ring_put_irq; | ||
| 1312 | } else if (IS_GEN5(dev)) { | ||
| 1313 | ring->add_request = pc_render_add_request; | ||
| 1314 | ring->get_seqno = pc_render_get_seqno; | ||
| 1315 | } | ||
| 1316 | |||
| 1317 | ring->dev = dev; | ||
| 1318 | INIT_LIST_HEAD(&ring->active_list); | ||
| 1319 | INIT_LIST_HEAD(&ring->request_list); | ||
| 1320 | INIT_LIST_HEAD(&ring->gpu_write_list); | ||
| 1321 | |||
| 1322 | ring->size = size; | ||
| 1323 | ring->effective_size = ring->size; | ||
| 1324 | if (IS_I830(ring->dev)) | ||
| 1325 | ring->effective_size -= 128; | ||
| 1326 | |||
| 1327 | ring->map.offset = start; | ||
| 1328 | ring->map.size = size; | ||
| 1329 | ring->map.type = 0; | ||
| 1330 | ring->map.flags = 0; | ||
| 1331 | ring->map.mtrr = 0; | ||
| 1332 | |||
| 1333 | drm_core_ioremap_wc(&ring->map, dev); | ||
| 1334 | if (ring->map.handle == NULL) { | ||
| 1335 | DRM_ERROR("can not ioremap virtual address for" | ||
| 1336 | " ring buffer\n"); | ||
| 1337 | return -ENOMEM; | ||
| 1338 | } | ||
| 1339 | |||
| 1340 | ring->virtual_start = (void __force __iomem *)ring->map.handle; | ||
| 1341 | return 0; | ||
| 1342 | } | ||
| 1343 | |||
| 1295 | int intel_init_bsd_ring_buffer(struct drm_device *dev) | 1344 | int intel_init_bsd_ring_buffer(struct drm_device *dev) |
| 1296 | { | 1345 | { |
| 1297 | drm_i915_private_t *dev_priv = dev->dev_private; | 1346 | drm_i915_private_t *dev_priv = dev->dev_private; |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 5b0abfa881f..6d6fde85a63 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
| @@ -166,4 +166,7 @@ int intel_init_blt_ring_buffer(struct drm_device *dev); | |||
| 166 | u32 intel_ring_get_active_head(struct intel_ring_buffer *ring); | 166 | u32 intel_ring_get_active_head(struct intel_ring_buffer *ring); |
| 167 | void intel_ring_setup_status_page(struct intel_ring_buffer *ring); | 167 | void intel_ring_setup_status_page(struct intel_ring_buffer *ring); |
| 168 | 168 | ||
| 169 | /* DRI warts */ | ||
| 170 | int intel_render_ring_init_dri(struct drm_device *dev, u64 start, u32 size); | ||
| 171 | |||
| 169 | #endif /* _INTEL_RINGBUFFER_H_ */ | 172 | #endif /* _INTEL_RINGBUFFER_H_ */ |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c index 13bb672a16f..f658a04eecf 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.c +++ b/drivers/gpu/drm/nouveau/nouveau_drv.c | |||
| @@ -234,9 +234,9 @@ nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state) | |||
| 234 | pci_set_power_state(pdev, PCI_D3hot); | 234 | pci_set_power_state(pdev, PCI_D3hot); |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | acquire_console_sem(); | 237 | console_lock(); |
| 238 | nouveau_fbcon_set_suspend(dev, 1); | 238 | nouveau_fbcon_set_suspend(dev, 1); |
| 239 | release_console_sem(); | 239 | console_unlock(); |
| 240 | nouveau_fbcon_restore_accel(dev); | 240 | nouveau_fbcon_restore_accel(dev); |
| 241 | return 0; | 241 | return 0; |
| 242 | 242 | ||
| @@ -359,9 +359,9 @@ nouveau_pci_resume(struct pci_dev *pdev) | |||
| 359 | nv_crtc->lut.depth = 0; | 359 | nv_crtc->lut.depth = 0; |
| 360 | } | 360 | } |
| 361 | 361 | ||
| 362 | acquire_console_sem(); | 362 | console_lock(); |
| 363 | nouveau_fbcon_set_suspend(dev, 0); | 363 | nouveau_fbcon_set_suspend(dev, 0); |
| 364 | release_console_sem(); | 364 | console_unlock(); |
| 365 | 365 | ||
| 366 | nouveau_fbcon_zfill_all(dev); | 366 | nouveau_fbcon_zfill_all(dev); |
| 367 | 367 | ||
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index b0ab185b86f..d3ca17080df 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -606,14 +606,9 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 606 | args.v1.usPixelClock = cpu_to_le16(mode->clock / 10); | 606 | args.v1.usPixelClock = cpu_to_le16(mode->clock / 10); |
| 607 | args.v1.ucTransmitterID = radeon_encoder->encoder_id; | 607 | args.v1.ucTransmitterID = radeon_encoder->encoder_id; |
| 608 | args.v1.ucEncodeMode = encoder_mode; | 608 | args.v1.ucEncodeMode = encoder_mode; |
| 609 | if (encoder_mode == ATOM_ENCODER_MODE_DP) { | 609 | if (ss_enabled) |
| 610 | if (ss_enabled) | ||
| 611 | args.v1.ucConfig |= | ||
| 612 | ADJUST_DISPLAY_CONFIG_SS_ENABLE; | ||
| 613 | } else if (encoder_mode == ATOM_ENCODER_MODE_LVDS) { | ||
| 614 | args.v1.ucConfig |= | 610 | args.v1.ucConfig |= |
| 615 | ADJUST_DISPLAY_CONFIG_SS_ENABLE; | 611 | ADJUST_DISPLAY_CONFIG_SS_ENABLE; |
| 616 | } | ||
| 617 | 612 | ||
| 618 | atom_execute_table(rdev->mode_info.atom_context, | 613 | atom_execute_table(rdev->mode_info.atom_context, |
| 619 | index, (uint32_t *)&args); | 614 | index, (uint32_t *)&args); |
| @@ -624,12 +619,12 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 624 | args.v3.sInput.ucTransmitterID = radeon_encoder->encoder_id; | 619 | args.v3.sInput.ucTransmitterID = radeon_encoder->encoder_id; |
| 625 | args.v3.sInput.ucEncodeMode = encoder_mode; | 620 | args.v3.sInput.ucEncodeMode = encoder_mode; |
| 626 | args.v3.sInput.ucDispPllConfig = 0; | 621 | args.v3.sInput.ucDispPllConfig = 0; |
| 622 | if (ss_enabled) | ||
| 623 | args.v3.sInput.ucDispPllConfig |= | ||
| 624 | DISPPLL_CONFIG_SS_ENABLE; | ||
| 627 | if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) { | 625 | if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) { |
| 628 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 626 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
| 629 | if (encoder_mode == ATOM_ENCODER_MODE_DP) { | 627 | if (encoder_mode == ATOM_ENCODER_MODE_DP) { |
| 630 | if (ss_enabled) | ||
| 631 | args.v3.sInput.ucDispPllConfig |= | ||
| 632 | DISPPLL_CONFIG_SS_ENABLE; | ||
| 633 | args.v3.sInput.ucDispPllConfig |= | 628 | args.v3.sInput.ucDispPllConfig |= |
| 634 | DISPPLL_CONFIG_COHERENT_MODE; | 629 | DISPPLL_CONFIG_COHERENT_MODE; |
| 635 | /* 16200 or 27000 */ | 630 | /* 16200 or 27000 */ |
| @@ -649,18 +644,11 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 649 | } | 644 | } |
| 650 | } else if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { | 645 | } else if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
| 651 | if (encoder_mode == ATOM_ENCODER_MODE_DP) { | 646 | if (encoder_mode == ATOM_ENCODER_MODE_DP) { |
| 652 | if (ss_enabled) | ||
| 653 | args.v3.sInput.ucDispPllConfig |= | ||
| 654 | DISPPLL_CONFIG_SS_ENABLE; | ||
| 655 | args.v3.sInput.ucDispPllConfig |= | 647 | args.v3.sInput.ucDispPllConfig |= |
| 656 | DISPPLL_CONFIG_COHERENT_MODE; | 648 | DISPPLL_CONFIG_COHERENT_MODE; |
| 657 | /* 16200 or 27000 */ | 649 | /* 16200 or 27000 */ |
| 658 | args.v3.sInput.usPixelClock = cpu_to_le16(dp_clock / 10); | 650 | args.v3.sInput.usPixelClock = cpu_to_le16(dp_clock / 10); |
| 659 | } else if (encoder_mode == ATOM_ENCODER_MODE_LVDS) { | 651 | } else if (encoder_mode != ATOM_ENCODER_MODE_LVDS) { |
| 660 | if (ss_enabled) | ||
| 661 | args.v3.sInput.ucDispPllConfig |= | ||
| 662 | DISPPLL_CONFIG_SS_ENABLE; | ||
| 663 | } else { | ||
| 664 | if (mode->clock > 165000) | 652 | if (mode->clock > 165000) |
| 665 | args.v3.sInput.ucDispPllConfig |= | 653 | args.v3.sInput.ucDispPllConfig |= |
| 666 | DISPPLL_CONFIG_DUAL_LINK; | 654 | DISPPLL_CONFIG_DUAL_LINK; |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index a8973acb398..677af91b555 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -2201,6 +2201,9 @@ static int evergreen_gpu_soft_reset(struct radeon_device *rdev) | |||
| 2201 | struct evergreen_mc_save save; | 2201 | struct evergreen_mc_save save; |
| 2202 | u32 grbm_reset = 0; | 2202 | u32 grbm_reset = 0; |
| 2203 | 2203 | ||
| 2204 | if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE)) | ||
| 2205 | return 0; | ||
| 2206 | |||
| 2204 | dev_info(rdev->dev, "GPU softreset \n"); | 2207 | dev_info(rdev->dev, "GPU softreset \n"); |
| 2205 | dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n", | 2208 | dev_info(rdev->dev, " GRBM_STATUS=0x%08X\n", |
| 2206 | RREG32(GRBM_STATUS)); | 2209 | RREG32(GRBM_STATUS)); |
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 46da5142b13..5968dde243e 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
| @@ -3522,7 +3522,7 @@ int r100_ring_test(struct radeon_device *rdev) | |||
| 3522 | if (i < rdev->usec_timeout) { | 3522 | if (i < rdev->usec_timeout) { |
| 3523 | DRM_INFO("ring test succeeded in %d usecs\n", i); | 3523 | DRM_INFO("ring test succeeded in %d usecs\n", i); |
| 3524 | } else { | 3524 | } else { |
| 3525 | DRM_ERROR("radeon: ring test failed (sracth(0x%04X)=0x%08X)\n", | 3525 | DRM_ERROR("radeon: ring test failed (scratch(0x%04X)=0x%08X)\n", |
| 3526 | scratch, tmp); | 3526 | scratch, tmp); |
| 3527 | r = -EINVAL; | 3527 | r = -EINVAL; |
| 3528 | } | 3528 | } |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index aca2236268f..1e10e3e2ba2 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -1287,6 +1287,9 @@ int r600_gpu_soft_reset(struct radeon_device *rdev) | |||
| 1287 | S_008014_CB2_BUSY(1) | S_008014_CB3_BUSY(1); | 1287 | S_008014_CB2_BUSY(1) | S_008014_CB3_BUSY(1); |
| 1288 | u32 tmp; | 1288 | u32 tmp; |
| 1289 | 1289 | ||
| 1290 | if (!(RREG32(GRBM_STATUS) & GUI_ACTIVE)) | ||
| 1291 | return 0; | ||
| 1292 | |||
| 1290 | dev_info(rdev->dev, "GPU softreset \n"); | 1293 | dev_info(rdev->dev, "GPU softreset \n"); |
| 1291 | dev_info(rdev->dev, " R_008010_GRBM_STATUS=0x%08X\n", | 1294 | dev_info(rdev->dev, " R_008010_GRBM_STATUS=0x%08X\n", |
| 1292 | RREG32(R_008010_GRBM_STATUS)); | 1295 | RREG32(R_008010_GRBM_STATUS)); |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 1573202a641..52777902bbc 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -387,15 +387,11 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, | |||
| 387 | *line_mux = 0x90; | 387 | *line_mux = 0x90; |
| 388 | } | 388 | } |
| 389 | 389 | ||
| 390 | /* mac rv630 */ | 390 | /* mac rv630, rv730, others */ |
| 391 | if ((dev->pdev->device == 0x9588) && | 391 | if ((supported_device == ATOM_DEVICE_TV1_SUPPORT) && |
| 392 | (dev->pdev->subsystem_vendor == 0x106b) && | 392 | (*connector_type == DRM_MODE_CONNECTOR_DVII)) { |
| 393 | (dev->pdev->subsystem_device == 0x00a6)) { | 393 | *connector_type = DRM_MODE_CONNECTOR_9PinDIN; |
| 394 | if ((supported_device == ATOM_DEVICE_TV1_SUPPORT) && | 394 | *line_mux = CONNECTOR_7PIN_DIN_ENUM_ID1; |
| 395 | (*connector_type == DRM_MODE_CONNECTOR_DVII)) { | ||
| 396 | *connector_type = DRM_MODE_CONNECTOR_9PinDIN; | ||
| 397 | *line_mux = CONNECTOR_7PIN_DIN_ENUM_ID1; | ||
| 398 | } | ||
| 399 | } | 395 | } |
| 400 | 396 | ||
| 401 | /* ASUS HD 3600 XT board lists the DVI port as HDMI */ | 397 | /* ASUS HD 3600 XT board lists the DVI port as HDMI */ |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 26091d602b8..0d478932b1a 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
| @@ -891,9 +891,9 @@ int radeon_suspend_kms(struct drm_device *dev, pm_message_t state) | |||
| 891 | pci_disable_device(dev->pdev); | 891 | pci_disable_device(dev->pdev); |
| 892 | pci_set_power_state(dev->pdev, PCI_D3hot); | 892 | pci_set_power_state(dev->pdev, PCI_D3hot); |
| 893 | } | 893 | } |
| 894 | acquire_console_sem(); | 894 | console_lock(); |
| 895 | radeon_fbdev_set_suspend(rdev, 1); | 895 | radeon_fbdev_set_suspend(rdev, 1); |
| 896 | release_console_sem(); | 896 | console_unlock(); |
| 897 | return 0; | 897 | return 0; |
| 898 | } | 898 | } |
| 899 | 899 | ||
| @@ -905,11 +905,11 @@ int radeon_resume_kms(struct drm_device *dev) | |||
| 905 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) | 905 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) |
| 906 | return 0; | 906 | return 0; |
| 907 | 907 | ||
| 908 | acquire_console_sem(); | 908 | console_lock(); |
| 909 | pci_set_power_state(dev->pdev, PCI_D0); | 909 | pci_set_power_state(dev->pdev, PCI_D0); |
| 910 | pci_restore_state(dev->pdev); | 910 | pci_restore_state(dev->pdev); |
| 911 | if (pci_enable_device(dev->pdev)) { | 911 | if (pci_enable_device(dev->pdev)) { |
| 912 | release_console_sem(); | 912 | console_unlock(); |
| 913 | return -1; | 913 | return -1; |
| 914 | } | 914 | } |
| 915 | pci_set_master(dev->pdev); | 915 | pci_set_master(dev->pdev); |
| @@ -920,7 +920,7 @@ int radeon_resume_kms(struct drm_device *dev) | |||
| 920 | radeon_restore_bios_scratch_regs(rdev); | 920 | radeon_restore_bios_scratch_regs(rdev); |
| 921 | 921 | ||
| 922 | radeon_fbdev_set_suspend(rdev, 0); | 922 | radeon_fbdev_set_suspend(rdev, 0); |
| 923 | release_console_sem(); | 923 | console_unlock(); |
| 924 | 924 | ||
| 925 | /* reset hpd state */ | 925 | /* reset hpd state */ |
| 926 | radeon_hpd_init(rdev); | 926 | radeon_hpd_init(rdev); |
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index d5680a0c87a..275b26a708d 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen | 48 | * - 2.5.0 - add get accel 2 to work around ddx breakage for evergreen |
| 49 | * - 2.6.0 - add tiling config query (r6xx+), add initial HiZ support (r300->r500) | 49 | * - 2.6.0 - add tiling config query (r6xx+), add initial HiZ support (r300->r500) |
| 50 | * 2.7.0 - fixups for r600 2D tiling support. (no external ABI change), add eg dyn gpr regs | 50 | * 2.7.0 - fixups for r600 2D tiling support. (no external ABI change), add eg dyn gpr regs |
| 51 | * 2.8.0 - pageflip support, r500 US_FORMAT regs. r500 ARGB2101010 colorbuf, r300->r500 CMASK | 51 | * 2.8.0 - pageflip support, r500 US_FORMAT regs. r500 ARGB2101010 colorbuf, r300->r500 CMASK, clock crystal query |
| 52 | */ | 52 | */ |
| 53 | #define KMS_DRIVER_MAJOR 2 | 53 | #define KMS_DRIVER_MAJOR 2 |
| 54 | #define KMS_DRIVER_MINOR 8 | 54 | #define KMS_DRIVER_MINOR 8 |
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index a289646e8aa..9ec830c77af 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c | |||
| @@ -110,11 +110,14 @@ void radeon_driver_irq_uninstall_kms(struct drm_device *dev) | |||
| 110 | 110 | ||
| 111 | int radeon_irq_kms_init(struct radeon_device *rdev) | 111 | int radeon_irq_kms_init(struct radeon_device *rdev) |
| 112 | { | 112 | { |
| 113 | int i; | ||
| 113 | int r = 0; | 114 | int r = 0; |
| 114 | 115 | ||
| 115 | INIT_WORK(&rdev->hotplug_work, radeon_hotplug_work_func); | 116 | INIT_WORK(&rdev->hotplug_work, radeon_hotplug_work_func); |
| 116 | 117 | ||
| 117 | spin_lock_init(&rdev->irq.sw_lock); | 118 | spin_lock_init(&rdev->irq.sw_lock); |
| 119 | for (i = 0; i < rdev->num_crtc; i++) | ||
| 120 | spin_lock_init(&rdev->irq.pflip_lock[i]); | ||
| 118 | r = drm_vblank_init(rdev->ddev, rdev->num_crtc); | 121 | r = drm_vblank_init(rdev->ddev, rdev->num_crtc); |
| 119 | if (r) { | 122 | if (r) { |
| 120 | return r; | 123 | return r; |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 28a53e4a925..98321298cff 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
| @@ -201,6 +201,10 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) | |||
| 201 | } | 201 | } |
| 202 | radeon_set_filp_rights(dev, &rdev->cmask_filp, filp, &value); | 202 | radeon_set_filp_rights(dev, &rdev->cmask_filp, filp, &value); |
| 203 | break; | 203 | break; |
| 204 | case RADEON_INFO_CLOCK_CRYSTAL_FREQ: | ||
| 205 | /* return clock value in KHz */ | ||
| 206 | value = rdev->clock.spll.reference_freq * 10; | ||
| 207 | break; | ||
| 204 | default: | 208 | default: |
| 205 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); | 209 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); |
| 206 | return -EINVAL; | 210 | return -EINVAL; |
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index c380c65da41..ace2b1623b2 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c | |||
| @@ -636,7 +636,7 @@ int vga_client_register(struct pci_dev *pdev, void *cookie, | |||
| 636 | void (*irq_set_state)(void *cookie, bool state), | 636 | void (*irq_set_state)(void *cookie, bool state), |
| 637 | unsigned int (*set_vga_decode)(void *cookie, bool decode)) | 637 | unsigned int (*set_vga_decode)(void *cookie, bool decode)) |
| 638 | { | 638 | { |
| 639 | int ret = -1; | 639 | int ret = -ENODEV; |
| 640 | struct vga_device *vgadev; | 640 | struct vga_device *vgadev; |
| 641 | unsigned long flags; | 641 | unsigned long flags; |
| 642 | 642 | ||
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index ce0372f0615..4c0743660e9 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
| @@ -1072,6 +1072,7 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num) | |||
| 1072 | node->sda.dev_attr.show = grp->show; | 1072 | node->sda.dev_attr.show = grp->show; |
| 1073 | node->sda.dev_attr.store = grp->store; | 1073 | node->sda.dev_attr.store = grp->store; |
| 1074 | attr = &node->sda.dev_attr.attr; | 1074 | attr = &node->sda.dev_attr.attr; |
| 1075 | sysfs_attr_init(attr); | ||
| 1075 | attr->name = node->name; | 1076 | attr->name = node->name; |
| 1076 | attr->mode = S_IRUGO | (grp->store ? S_IWUSR : 0); | 1077 | attr->mode = S_IRUGO | (grp->store ? S_IWUSR : 0); |
| 1077 | ret = sysfs_create_file(&pdev->dev.kobj, attr); | 1078 | ret = sysfs_create_file(&pdev->dev.kobj, attr); |
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index 2d68cf3c223..b5e892017e0 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/list.h> | 13 | #include <linux/list.h> |
| 14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
| 16 | #include <linux/dmi.h> | ||
| 16 | 17 | ||
| 17 | #include <acpi/acpi.h> | 18 | #include <acpi/acpi.h> |
| 18 | #include <acpi/acpixf.h> | 19 | #include <acpi/acpixf.h> |
| @@ -22,6 +23,21 @@ | |||
| 22 | 23 | ||
| 23 | #define ATK_HID "ATK0110" | 24 | #define ATK_HID "ATK0110" |
| 24 | 25 | ||
| 26 | static bool new_if; | ||
| 27 | module_param(new_if, bool, 0); | ||
| 28 | MODULE_PARM_DESC(new_if, "Override detection heuristic and force the use of the new ATK0110 interface"); | ||
| 29 | |||
| 30 | static const struct dmi_system_id __initconst atk_force_new_if[] = { | ||
| 31 | { | ||
| 32 | /* Old interface has broken MCH temp monitoring */ | ||
| 33 | .ident = "Asus Sabertooth X58", | ||
| 34 | .matches = { | ||
| 35 | DMI_MATCH(DMI_BOARD_NAME, "SABERTOOTH X58") | ||
| 36 | } | ||
| 37 | }, | ||
| 38 | { } | ||
| 39 | }; | ||
| 40 | |||
| 25 | /* Minimum time between readings, enforced in order to avoid | 41 | /* Minimum time between readings, enforced in order to avoid |
| 26 | * hogging the CPU. | 42 | * hogging the CPU. |
| 27 | */ | 43 | */ |
| @@ -1302,7 +1318,9 @@ static int atk_probe_if(struct atk_data *data) | |||
| 1302 | * analysis of multiple DSDTs indicates that when both interfaces | 1318 | * analysis of multiple DSDTs indicates that when both interfaces |
| 1303 | * are present the new one (GGRP/GITM) is not functional. | 1319 | * are present the new one (GGRP/GITM) is not functional. |
| 1304 | */ | 1320 | */ |
| 1305 | if (data->rtmp_handle && data->rvlt_handle && data->rfan_handle) | 1321 | if (new_if) |
| 1322 | dev_info(dev, "Overriding interface detection\n"); | ||
| 1323 | if (data->rtmp_handle && data->rvlt_handle && data->rfan_handle && !new_if) | ||
| 1306 | data->old_interface = true; | 1324 | data->old_interface = true; |
| 1307 | else if (data->enumerate_handle && data->read_handle && | 1325 | else if (data->enumerate_handle && data->read_handle && |
| 1308 | data->write_handle) | 1326 | data->write_handle) |
| @@ -1420,6 +1438,9 @@ static int __init atk0110_init(void) | |||
| 1420 | return -EBUSY; | 1438 | return -EBUSY; |
| 1421 | } | 1439 | } |
| 1422 | 1440 | ||
| 1441 | if (dmi_check_system(atk_force_new_if)) | ||
| 1442 | new_if = true; | ||
| 1443 | |||
| 1423 | ret = acpi_bus_register_driver(&atk_driver); | 1444 | ret = acpi_bus_register_driver(&atk_driver); |
| 1424 | if (ret) | 1445 | if (ret) |
| 1425 | pr_info("acpi_bus_register_driver failed: %d\n", ret); | 1446 | pr_info("acpi_bus_register_driver failed: %d\n", ret); |
diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c index 1b674b7d458..d805e8e5796 100644 --- a/drivers/hwmon/lis3lv02d.c +++ b/drivers/hwmon/lis3lv02d.c | |||
| @@ -957,7 +957,7 @@ int lis3lv02d_init_device(struct lis3lv02d *dev) | |||
| 957 | 957 | ||
| 958 | /* bail if we did not get an IRQ from the bus layer */ | 958 | /* bail if we did not get an IRQ from the bus layer */ |
| 959 | if (!dev->irq) { | 959 | if (!dev->irq) { |
| 960 | pr_err("No IRQ. Disabling /dev/freefall\n"); | 960 | pr_debug("No IRQ. Disabling /dev/freefall\n"); |
| 961 | goto out; | 961 | goto out; |
| 962 | } | 962 | } |
| 963 | 963 | ||
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 417507348ba..c7a92028f45 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
| @@ -343,6 +343,16 @@ config KEYBOARD_NOMADIK | |||
| 343 | To compile this driver as a module, choose M here: the | 343 | To compile this driver as a module, choose M here: the |
| 344 | module will be called nmk-ske-keypad. | 344 | module will be called nmk-ske-keypad. |
| 345 | 345 | ||
| 346 | config KEYBOARD_TEGRA | ||
| 347 | tristate "NVIDIA Tegra internal matrix keyboard controller support" | ||
| 348 | depends on ARCH_TEGRA | ||
| 349 | help | ||
| 350 | Say Y here if you want to use a matrix keyboard connected directly | ||
| 351 | to the internal keyboard controller on Tegra SoCs. | ||
| 352 | |||
| 353 | To compile this driver as a module, choose M here: the | ||
| 354 | module will be called tegra-kbc. | ||
| 355 | |||
| 346 | config KEYBOARD_OPENCORES | 356 | config KEYBOARD_OPENCORES |
| 347 | tristate "OpenCores Keyboard Controller" | 357 | tristate "OpenCores Keyboard Controller" |
| 348 | help | 358 | help |
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index 4e5571b72cd..468c627a284 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile | |||
| @@ -42,6 +42,7 @@ obj-$(CONFIG_KEYBOARD_STMPE) += stmpe-keypad.o | |||
| 42 | obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o | 42 | obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o |
| 43 | obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o | 43 | obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o |
| 44 | obj-$(CONFIG_KEYBOARD_TC3589X) += tc3589x-keypad.o | 44 | obj-$(CONFIG_KEYBOARD_TC3589X) += tc3589x-keypad.o |
| 45 | obj-$(CONFIG_KEYBOARD_TEGRA) += tegra-kbc.o | ||
| 45 | obj-$(CONFIG_KEYBOARD_TNETV107X) += tnetv107x-keypad.o | 46 | obj-$(CONFIG_KEYBOARD_TNETV107X) += tnetv107x-keypad.o |
| 46 | obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o | 47 | obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o |
| 47 | obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o | 48 | obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o |
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 6069abe31e4..eb3006361ee 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
| @@ -322,7 +322,7 @@ static void gpio_keys_report_event(struct gpio_button_data *bdata) | |||
| 322 | struct gpio_keys_button *button = bdata->button; | 322 | struct gpio_keys_button *button = bdata->button; |
| 323 | struct input_dev *input = bdata->input; | 323 | struct input_dev *input = bdata->input; |
| 324 | unsigned int type = button->type ?: EV_KEY; | 324 | unsigned int type = button->type ?: EV_KEY; |
| 325 | int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low; | 325 | int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low; |
| 326 | 326 | ||
| 327 | input_event(input, type, button->code, !!state); | 327 | input_event(input, type, button->code, !!state); |
| 328 | input_sync(input); | 328 | input_sync(input); |
| @@ -410,8 +410,8 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev, | |||
| 410 | if (!button->can_disable) | 410 | if (!button->can_disable) |
| 411 | irqflags |= IRQF_SHARED; | 411 | irqflags |= IRQF_SHARED; |
| 412 | 412 | ||
| 413 | error = request_irq(irq, gpio_keys_isr, irqflags, desc, bdata); | 413 | error = request_any_context_irq(irq, gpio_keys_isr, irqflags, desc, bdata); |
| 414 | if (error) { | 414 | if (error < 0) { |
| 415 | dev_err(dev, "Unable to claim irq %d; error %d\n", | 415 | dev_err(dev, "Unable to claim irq %d; error %d\n", |
| 416 | irq, error); | 416 | irq, error); |
| 417 | goto fail3; | 417 | goto fail3; |
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c new file mode 100644 index 00000000000..939476659ad --- /dev/null +++ b/drivers/input/keyboard/tegra-kbc.c | |||
| @@ -0,0 +1,727 @@ | |||
| 1 | /* | ||
| 2 | * Keyboard class input driver for the NVIDIA Tegra SoC internal matrix | ||
| 3 | * keyboard controller | ||
| 4 | * | ||
| 5 | * Copyright (c) 2009-2011, NVIDIA Corporation. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 15 | * more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/module.h> | ||
| 23 | #include <linux/input.h> | ||
| 24 | #include <linux/platform_device.h> | ||
| 25 | #include <linux/delay.h> | ||
| 26 | #include <linux/io.h> | ||
| 27 | #include <linux/interrupt.h> | ||
| 28 | #include <linux/clk.h> | ||
| 29 | #include <linux/slab.h> | ||
| 30 | #include <mach/clk.h> | ||
| 31 | #include <mach/kbc.h> | ||
| 32 | |||
| 33 | #define KBC_MAX_DEBOUNCE_CNT 0x3ffu | ||
| 34 | |||
| 35 | /* KBC row scan time and delay for beginning the row scan. */ | ||
| 36 | #define KBC_ROW_SCAN_TIME 16 | ||
| 37 | #define KBC_ROW_SCAN_DLY 5 | ||
| 38 | |||
| 39 | /* KBC uses a 32KHz clock so a cycle = 1/32Khz */ | ||
| 40 | #define KBC_CYCLE_USEC 32 | ||
| 41 | |||
| 42 | /* KBC Registers */ | ||
| 43 | |||
| 44 | /* KBC Control Register */ | ||
| 45 | #define KBC_CONTROL_0 0x0 | ||
| 46 | #define KBC_FIFO_TH_CNT_SHIFT(cnt) (cnt << 14) | ||
| 47 | #define KBC_DEBOUNCE_CNT_SHIFT(cnt) (cnt << 4) | ||
| 48 | #define KBC_CONTROL_FIFO_CNT_INT_EN (1 << 3) | ||
| 49 | #define KBC_CONTROL_KBC_EN (1 << 0) | ||
| 50 | |||
| 51 | /* KBC Interrupt Register */ | ||
| 52 | #define KBC_INT_0 0x4 | ||
| 53 | #define KBC_INT_FIFO_CNT_INT_STATUS (1 << 2) | ||
| 54 | |||
| 55 | #define KBC_ROW_CFG0_0 0x8 | ||
| 56 | #define KBC_COL_CFG0_0 0x18 | ||
| 57 | #define KBC_INIT_DLY_0 0x28 | ||
| 58 | #define KBC_RPT_DLY_0 0x2c | ||
| 59 | #define KBC_KP_ENT0_0 0x30 | ||
| 60 | #define KBC_KP_ENT1_0 0x34 | ||
| 61 | #define KBC_ROW0_MASK_0 0x38 | ||
| 62 | |||
| 63 | #define KBC_ROW_SHIFT 3 | ||
| 64 | |||
| 65 | struct tegra_kbc { | ||
| 66 | void __iomem *mmio; | ||
| 67 | struct input_dev *idev; | ||
| 68 | unsigned int irq; | ||
| 69 | unsigned int wake_enable_rows; | ||
| 70 | unsigned int wake_enable_cols; | ||
| 71 | spinlock_t lock; | ||
| 72 | unsigned int repoll_dly; | ||
| 73 | unsigned long cp_dly_jiffies; | ||
| 74 | const struct tegra_kbc_platform_data *pdata; | ||
| 75 | unsigned short keycode[KBC_MAX_KEY]; | ||
| 76 | unsigned short current_keys[KBC_MAX_KPENT]; | ||
| 77 | unsigned int num_pressed_keys; | ||
| 78 | struct timer_list timer; | ||
| 79 | struct clk *clk; | ||
| 80 | }; | ||
| 81 | |||
| 82 | static const u32 tegra_kbc_default_keymap[] = { | ||
| 83 | KEY(0, 2, KEY_W), | ||
| 84 | KEY(0, 3, KEY_S), | ||
| 85 | KEY(0, 4, KEY_A), | ||
| 86 | KEY(0, 5, KEY_Z), | ||
| 87 | KEY(0, 7, KEY_FN), | ||
| 88 | |||
| 89 | KEY(1, 7, KEY_MENU), | ||
| 90 | |||
| 91 | KEY(2, 6, KEY_RIGHTALT), | ||
| 92 | KEY(2, 7, KEY_LEFTALT), | ||
| 93 | |||
| 94 | KEY(3, 0, KEY_5), | ||
| 95 | KEY(3, 1, KEY_4), | ||
| 96 | KEY(3, 2, KEY_R), | ||
| 97 | KEY(3, 3, KEY_E), | ||
| 98 | KEY(3, 4, KEY_F), | ||
| 99 | KEY(3, 5, KEY_D), | ||
| 100 | KEY(3, 6, KEY_X), | ||
| 101 | |||
| 102 | KEY(4, 0, KEY_7), | ||
| 103 | KEY(4, 1, KEY_6), | ||
| 104 | KEY(4, 2, KEY_T), | ||
| 105 | KEY(4, 3, KEY_H), | ||
| 106 | KEY(4, 4, KEY_G), | ||
| 107 | KEY(4, 5, KEY_V), | ||
| 108 | KEY(4, 6, KEY_C), | ||
| 109 | KEY(4, 7, KEY_SPACE), | ||
| 110 | |||
| 111 | KEY(5, 0, KEY_9), | ||
| 112 | KEY(5, 1, KEY_8), | ||
| 113 | KEY(5, 2, KEY_U), | ||
| 114 | KEY(5, 3, KEY_Y), | ||
| 115 | KEY(5, 4, KEY_J), | ||
| 116 | KEY(5, 5, KEY_N), | ||
| 117 | KEY(5, 6, KEY_B), | ||
| 118 | KEY(5, 7, KEY_BACKSLASH), | ||
| 119 | |||
| 120 | KEY(6, 0, KEY_MINUS), | ||
| 121 | KEY(6, 1, KEY_0), | ||
| 122 | KEY(6, 2, KEY_O), | ||
| 123 | KEY(6, 3, KEY_I), | ||
| 124 | KEY(6, 4, KEY_L), | ||
| 125 | KEY(6, 5, KEY_K), | ||
| 126 | KEY(6, 6, KEY_COMMA), | ||
| 127 | KEY(6, 7, KEY_M), | ||
| 128 | |||
| 129 | KEY(7, 1, KEY_EQUAL), | ||
| 130 | KEY(7, 2, KEY_RIGHTBRACE), | ||
| 131 | KEY(7, 3, KEY_ENTER), | ||
| 132 | KEY(7, 7, KEY_MENU), | ||
| 133 | |||
| 134 | KEY(8, 4, KEY_RIGHTSHIFT), | ||
| 135 | KEY(8, 5, KEY_LEFTSHIFT), | ||
| 136 | |||
| 137 | KEY(9, 5, KEY_RIGHTCTRL), | ||
| 138 | KEY(9, 7, KEY_LEFTCTRL), | ||
| 139 | |||
| 140 | KEY(11, 0, KEY_LEFTBRACE), | ||
| 141 | KEY(11, 1, KEY_P), | ||
| 142 | KEY(11, 2, KEY_APOSTROPHE), | ||
| 143 | KEY(11, 3, KEY_SEMICOLON), | ||
| 144 | KEY(11, 4, KEY_SLASH), | ||
| 145 | KEY(11, 5, KEY_DOT), | ||
| 146 | |||
| 147 | KEY(12, 0, KEY_F10), | ||
| 148 | KEY(12, 1, KEY_F9), | ||
| 149 | KEY(12, 2, KEY_BACKSPACE), | ||
| 150 | KEY(12, 3, KEY_3), | ||
| 151 | KEY(12, 4, KEY_2), | ||
| 152 | KEY(12, 5, KEY_UP), | ||
| 153 | KEY(12, 6, KEY_PRINT), | ||
| 154 | KEY(12, 7, KEY_PAUSE), | ||
| 155 | |||
| 156 | KEY(13, 0, KEY_INSERT), | ||
| 157 | KEY(13, 1, KEY_DELETE), | ||
| 158 | KEY(13, 3, KEY_PAGEUP), | ||
| 159 | KEY(13, 4, KEY_PAGEDOWN), | ||
| 160 | KEY(13, 5, KEY_RIGHT), | ||
| 161 | KEY(13, 6, KEY_DOWN), | ||
| 162 | KEY(13, 7, KEY_LEFT), | ||
| 163 | |||
| 164 | KEY(14, 0, KEY_F11), | ||
| 165 | KEY(14, 1, KEY_F12), | ||
| 166 | KEY(14, 2, KEY_F8), | ||
| 167 | KEY(14, 3, KEY_Q), | ||
| 168 | KEY(14, 4, KEY_F4), | ||
| 169 | KEY(14, 5, KEY_F3), | ||
| 170 | KEY(14, 6, KEY_1), | ||
| 171 | KEY(14, 7, KEY_F7), | ||
| 172 | |||
| 173 | KEY(15, 0, KEY_ESC), | ||
| 174 | KEY(15, 1, KEY_GRAVE), | ||
| 175 | KEY(15, 2, KEY_F5), | ||
| 176 | KEY(15, 3, KEY_TAB), | ||
| 177 | KEY(15, 4, KEY_F1), | ||
| 178 | KEY(15, 5, KEY_F2), | ||
| 179 | KEY(15, 6, KEY_CAPSLOCK), | ||
| 180 | KEY(15, 7, KEY_F6), | ||
| 181 | }; | ||
| 182 | |||
| 183 | static const struct matrix_keymap_data tegra_kbc_default_keymap_data = { | ||
| 184 | .keymap = tegra_kbc_default_keymap, | ||
| 185 | .keymap_size = ARRAY_SIZE(tegra_kbc_default_keymap), | ||
| 186 | }; | ||
| 187 | |||
| 188 | static void tegra_kbc_report_released_keys(struct input_dev *input, | ||
| 189 | unsigned short old_keycodes[], | ||
| 190 | unsigned int old_num_keys, | ||
| 191 | unsigned short new_keycodes[], | ||
| 192 | unsigned int new_num_keys) | ||
| 193 | { | ||
| 194 | unsigned int i, j; | ||
| 195 | |||
| 196 | for (i = 0; i < old_num_keys; i++) { | ||
| 197 | for (j = 0; j < new_num_keys; j++) | ||
| 198 | if (old_keycodes[i] == new_keycodes[j]) | ||
| 199 | break; | ||
| 200 | |||
| 201 | if (j == new_num_keys) | ||
| 202 | input_report_key(input, old_keycodes[i], 0); | ||
| 203 | } | ||
| 204 | } | ||
| 205 | |||
| 206 | static void tegra_kbc_report_pressed_keys(struct input_dev *input, | ||
| 207 | unsigned char scancodes[], | ||
| 208 | unsigned short keycodes[], | ||
| 209 | unsigned int num_pressed_keys) | ||
| 210 | { | ||
| 211 | unsigned int i; | ||
| 212 | |||
| 213 | for (i = 0; i < num_pressed_keys; i++) { | ||
| 214 | input_event(input, EV_MSC, MSC_SCAN, scancodes[i]); | ||
| 215 | input_report_key(input, keycodes[i], 1); | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 219 | static void tegra_kbc_report_keys(struct tegra_kbc *kbc) | ||
| 220 | { | ||
| 221 | unsigned char scancodes[KBC_MAX_KPENT]; | ||
| 222 | unsigned short keycodes[KBC_MAX_KPENT]; | ||
| 223 | u32 val = 0; | ||
| 224 | unsigned int i; | ||
| 225 | unsigned int num_down = 0; | ||
| 226 | unsigned long flags; | ||
| 227 | |||
| 228 | spin_lock_irqsave(&kbc->lock, flags); | ||
| 229 | for (i = 0; i < KBC_MAX_KPENT; i++) { | ||
| 230 | if ((i % 4) == 0) | ||
| 231 | val = readl(kbc->mmio + KBC_KP_ENT0_0 + i); | ||
| 232 | |||
| 233 | if (val & 0x80) { | ||
| 234 | unsigned int col = val & 0x07; | ||
| 235 | unsigned int row = (val >> 3) & 0x0f; | ||
| 236 | unsigned char scancode = | ||
| 237 | MATRIX_SCAN_CODE(row, col, KBC_ROW_SHIFT); | ||
| 238 | |||
| 239 | scancodes[num_down] = scancode; | ||
| 240 | keycodes[num_down++] = kbc->keycode[scancode]; | ||
| 241 | } | ||
| 242 | |||
| 243 | val >>= 8; | ||
| 244 | } | ||
| 245 | spin_unlock_irqrestore(&kbc->lock, flags); | ||
| 246 | |||
| 247 | tegra_kbc_report_released_keys(kbc->idev, | ||
| 248 | kbc->current_keys, kbc->num_pressed_keys, | ||
| 249 | keycodes, num_down); | ||
| 250 | tegra_kbc_report_pressed_keys(kbc->idev, scancodes, keycodes, num_down); | ||
| 251 | input_sync(kbc->idev); | ||
| 252 | |||
| 253 | memcpy(kbc->current_keys, keycodes, sizeof(kbc->current_keys)); | ||
| 254 | kbc->num_pressed_keys = num_down; | ||
| 255 | } | ||
| 256 | |||
| 257 | static void tegra_kbc_keypress_timer(unsigned long data) | ||
| 258 | { | ||
| 259 | struct tegra_kbc *kbc = (struct tegra_kbc *)data; | ||
| 260 | unsigned long flags; | ||
| 261 | u32 val; | ||
| 262 | unsigned int i; | ||
| 263 | |||
| 264 | val = (readl(kbc->mmio + KBC_INT_0) >> 4) & 0xf; | ||
| 265 | if (val) { | ||
| 266 | unsigned long dly; | ||
| 267 | |||
| 268 | tegra_kbc_report_keys(kbc); | ||
| 269 | |||
| 270 | /* | ||
| 271 | * If more than one keys are pressed we need not wait | ||
| 272 | * for the repoll delay. | ||
| 273 | */ | ||
| 274 | dly = (val == 1) ? kbc->repoll_dly : 1; | ||
| 275 | mod_timer(&kbc->timer, jiffies + msecs_to_jiffies(dly)); | ||
| 276 | } else { | ||
| 277 | /* Release any pressed keys and exit the polling loop */ | ||
| 278 | for (i = 0; i < kbc->num_pressed_keys; i++) | ||
| 279 | input_report_key(kbc->idev, kbc->current_keys[i], 0); | ||
| 280 | input_sync(kbc->idev); | ||
| 281 | |||
| 282 | kbc->num_pressed_keys = 0; | ||
| 283 | |||
| 284 | /* All keys are released so enable the keypress interrupt */ | ||
| 285 | spin_lock_irqsave(&kbc->lock, flags); | ||
| 286 | val = readl(kbc->mmio + KBC_CONTROL_0); | ||
| 287 | val |= KBC_CONTROL_FIFO_CNT_INT_EN; | ||
| 288 | writel(val, kbc->mmio + KBC_CONTROL_0); | ||
| 289 | spin_unlock_irqrestore(&kbc->lock, flags); | ||
| 290 | } | ||
| 291 | } | ||
| 292 | |||
| 293 | static irqreturn_t tegra_kbc_isr(int irq, void *args) | ||
| 294 | { | ||
| 295 | struct tegra_kbc *kbc = args; | ||
| 296 | u32 val, ctl; | ||
| 297 | |||
| 298 | /* | ||
| 299 | * Until all keys are released, defer further processing to | ||
| 300 | * the polling loop in tegra_kbc_keypress_timer | ||
| 301 | */ | ||
| 302 | ctl = readl(kbc->mmio + KBC_CONTROL_0); | ||
| 303 | ctl &= ~KBC_CONTROL_FIFO_CNT_INT_EN; | ||
| 304 | writel(ctl, kbc->mmio + KBC_CONTROL_0); | ||
| 305 | |||
| 306 | /* | ||
| 307 | * Quickly bail out & reenable interrupts if the fifo threshold | ||
| 308 | * count interrupt wasn't the interrupt source | ||
| 309 | */ | ||
| 310 | val = readl(kbc->mmio + KBC_INT_0); | ||
| 311 | writel(val, kbc->mmio + KBC_INT_0); | ||
| 312 | |||
| 313 | if (val & KBC_INT_FIFO_CNT_INT_STATUS) { | ||
| 314 | /* | ||
| 315 | * Schedule timer to run when hardware is in continuous | ||
| 316 | * polling mode. | ||
| 317 | */ | ||
| 318 | mod_timer(&kbc->timer, jiffies + kbc->cp_dly_jiffies); | ||
| 319 | } else { | ||
| 320 | ctl |= KBC_CONTROL_FIFO_CNT_INT_EN; | ||
| 321 | writel(ctl, kbc->mmio + KBC_CONTROL_0); | ||
| 322 | } | ||
| 323 | |||
| 324 | return IRQ_HANDLED; | ||
| 325 | } | ||
| 326 | |||
| 327 | static void tegra_kbc_setup_wakekeys(struct tegra_kbc *kbc, bool filter) | ||
| 328 | { | ||
| 329 | const struct tegra_kbc_platform_data *pdata = kbc->pdata; | ||
| 330 | int i; | ||
| 331 | unsigned int rst_val; | ||
| 332 | |||
| 333 | BUG_ON(pdata->wake_cnt > KBC_MAX_KEY); | ||
| 334 | rst_val = (filter && pdata->wake_cnt) ? ~0 : 0; | ||
| 335 | |||
| 336 | for (i = 0; i < KBC_MAX_ROW; i++) | ||
| 337 | writel(rst_val, kbc->mmio + KBC_ROW0_MASK_0 + i * 4); | ||
| 338 | |||
| 339 | if (filter) { | ||
| 340 | for (i = 0; i < pdata->wake_cnt; i++) { | ||
| 341 | u32 val, addr; | ||
| 342 | addr = pdata->wake_cfg[i].row * 4 + KBC_ROW0_MASK_0; | ||
| 343 | val = readl(kbc->mmio + addr); | ||
| 344 | val &= ~(1 << pdata->wake_cfg[i].col); | ||
| 345 | writel(val, kbc->mmio + addr); | ||
| 346 | } | ||
| 347 | } | ||
| 348 | } | ||
| 349 | |||
| 350 | static void tegra_kbc_config_pins(struct tegra_kbc *kbc) | ||
| 351 | { | ||
| 352 | const struct tegra_kbc_platform_data *pdata = kbc->pdata; | ||
| 353 | int i; | ||
| 354 | |||
| 355 | for (i = 0; i < KBC_MAX_GPIO; i++) { | ||
| 356 | u32 r_shft = 5 * (i % 6); | ||
| 357 | u32 c_shft = 4 * (i % 8); | ||
| 358 | u32 r_mask = 0x1f << r_shift; | ||
| 359 | u32 c_mask = 0x0f << c_shift; | ||
| 360 | u32 r_offs = (i / 6) * 4 + KBC_ROW_CFG0_0; | ||
| 361 | u32 c_offs = (i / 8) * 4 + KBC_COL_CFG0_0; | ||
| 362 | u32 row_cfg = readl(kbc->mmio + r_offs); | ||
| 363 | u32 col_cfg = readl(kbc->mmio + c_offs); | ||
| 364 | |||
| 365 | row_cfg &= ~r_mask; | ||
| 366 | col_cfg &= ~c_mask; | ||
| 367 | |||
| 368 | if (pdata->pin_cfg[i].is_row) | ||
| 369 | row_cfg |= ((pdata->pin_cfg[i].num << 1) | 1) << r_shft; | ||
| 370 | else | ||
| 371 | col_cfg |= ((pdata->pin_cfg[i].num << 1) | 1) << c_shft; | ||
| 372 | |||
| 373 | writel(row_cfg, kbc->mmio + r_offs); | ||
| 374 | writel(col_cfg, kbc->mmio + c_offs); | ||
| 375 | } | ||
| 376 | } | ||
| 377 | |||
| 378 | static int tegra_kbc_start(struct tegra_kbc *kbc) | ||
| 379 | { | ||
| 380 | const struct tegra_kbc_platform_data *pdata = kbc->pdata; | ||
| 381 | unsigned long flags; | ||
| 382 | unsigned int debounce_cnt; | ||
| 383 | u32 val = 0; | ||
| 384 | |||
| 385 | clk_enable(kbc->clk); | ||
| 386 | |||
| 387 | /* Reset the KBC controller to clear all previous status.*/ | ||
| 388 | tegra_periph_reset_assert(kbc->clk); | ||
| 389 | udelay(100); | ||
| 390 | tegra_periph_reset_deassert(kbc->clk); | ||
| 391 | udelay(100); | ||
| 392 | |||
| 393 | tegra_kbc_config_pins(kbc); | ||
| 394 | tegra_kbc_setup_wakekeys(kbc, false); | ||
| 395 | |||
| 396 | writel(pdata->repeat_cnt, kbc->mmio + KBC_RPT_DLY_0); | ||
| 397 | |||
| 398 | /* Keyboard debounce count is maximum of 12 bits. */ | ||
| 399 | debounce_cnt = min(pdata->debounce_cnt, KBC_MAX_DEBOUNCE_CNT); | ||
| 400 | val = KBC_DEBOUNCE_CNT_SHIFT(debounce_cnt); | ||
| 401 | val |= KBC_FIFO_TH_CNT_SHIFT(1); /* set fifo interrupt threshold to 1 */ | ||
| 402 | val |= KBC_CONTROL_FIFO_CNT_INT_EN; /* interrupt on FIFO threshold */ | ||
| 403 | val |= KBC_CONTROL_KBC_EN; /* enable */ | ||
| 404 | writel(val, kbc->mmio + KBC_CONTROL_0); | ||
| 405 | |||
| 406 | /* | ||
| 407 | * Compute the delay(ns) from interrupt mode to continuous polling | ||
| 408 | * mode so the timer routine is scheduled appropriately. | ||
| 409 | */ | ||
| 410 | val = readl(kbc->mmio + KBC_INIT_DLY_0); | ||
| 411 | kbc->cp_dly_jiffies = usecs_to_jiffies((val & 0xfffff) * 32); | ||
| 412 | |||
| 413 | kbc->num_pressed_keys = 0; | ||
| 414 | |||
| 415 | /* | ||
| 416 | * Atomically clear out any remaining entries in the key FIFO | ||
| 417 | * and enable keyboard interrupts. | ||
| 418 | */ | ||
| 419 | spin_lock_irqsave(&kbc->lock, flags); | ||
| 420 | while (1) { | ||
| 421 | val = readl(kbc->mmio + KBC_INT_0); | ||
| 422 | val >>= 4; | ||
| 423 | if (!val) | ||
| 424 | break; | ||
| 425 | |||
| 426 | val = readl(kbc->mmio + KBC_KP_ENT0_0); | ||
| 427 | val = readl(kbc->mmio + KBC_KP_ENT1_0); | ||
| 428 | } | ||
| 429 | writel(0x7, kbc->mmio + KBC_INT_0); | ||
| 430 | spin_unlock_irqrestore(&kbc->lock, flags); | ||
| 431 | |||
| 432 | enable_irq(kbc->irq); | ||
| 433 | |||
| 434 | return 0; | ||
| 435 | } | ||
| 436 | |||
| 437 | static void tegra_kbc_stop(struct tegra_kbc *kbc) | ||
| 438 | { | ||
| 439 | unsigned long flags; | ||
| 440 | u32 val; | ||
| 441 | |||
| 442 | spin_lock_irqsave(&kbc->lock, flags); | ||
| 443 | val = readl(kbc->mmio + KBC_CONTROL_0); | ||
| 444 | val &= ~1; | ||
| 445 | writel(val, kbc->mmio + KBC_CONTROL_0); | ||
| 446 | spin_unlock_irqrestore(&kbc->lock, flags); | ||
| 447 | |||
| 448 | disable_irq(kbc->irq); | ||
| 449 | del_timer_sync(&kbc->timer); | ||
| 450 | |||
| 451 | clk_disable(kbc->clk); | ||
| 452 | } | ||
| 453 | |||
| 454 | static int tegra_kbc_open(struct input_dev *dev) | ||
| 455 | { | ||
| 456 | struct tegra_kbc *kbc = input_get_drvdata(dev); | ||
| 457 | |||
| 458 | return tegra_kbc_start(kbc); | ||
| 459 | } | ||
| 460 | |||
| 461 | static void tegra_kbc_close(struct input_dev *dev) | ||
| 462 | { | ||
| 463 | struct tegra_kbc *kbc = input_get_drvdata(dev); | ||
| 464 | |||
| 465 | return tegra_kbc_stop(kbc); | ||
| 466 | } | ||
| 467 | |||
| 468 | static bool __devinit | ||
| 469 | tegra_kbc_check_pin_cfg(const struct tegra_kbc_platform_data *pdata, | ||
| 470 | struct device *dev, unsigned int *num_rows) | ||
| 471 | { | ||
| 472 | int i; | ||
| 473 | |||
| 474 | *num_rows = 0; | ||
| 475 | |||
| 476 | for (i = 0; i < KBC_MAX_GPIO; i++) { | ||
| 477 | const struct tegra_kbc_pin_cfg *pin_cfg = &pdata->pin_cfg[i]; | ||
| 478 | |||
| 479 | if (pin_cfg->is_row) { | ||
| 480 | if (pin_cfg->num >= KBC_MAX_ROW) { | ||
| 481 | dev_err(dev, | ||
| 482 | "pin_cfg[%d]: invalid row number %d\n", | ||
| 483 | i, pin_cfg->num); | ||
| 484 | return false; | ||
| 485 | } | ||
| 486 | (*num_rows)++; | ||
| 487 | } else { | ||
| 488 | if (pin_cfg->num >= KBC_MAX_COL) { | ||
| 489 | dev_err(dev, | ||
| 490 | "pin_cfg[%d]: invalid column number %d\n", | ||
| 491 | i, pin_cfg->num); | ||
| 492 | return false; | ||
| 493 | } | ||
| 494 | } | ||
| 495 | } | ||
| 496 | |||
| 497 | return true; | ||
| 498 | } | ||
| 499 | |||
| 500 | static int __devinit tegra_kbc_probe(struct platform_device *pdev) | ||
| 501 | { | ||
| 502 | const struct tegra_kbc_platform_data *pdata = pdev->dev.platform_data; | ||
| 503 | const struct matrix_keymap_data *keymap_data; | ||
| 504 | struct tegra_kbc *kbc; | ||
| 505 | struct input_dev *input_dev; | ||
| 506 | struct resource *res; | ||
| 507 | int irq; | ||
| 508 | int err; | ||
| 509 | int i; | ||
| 510 | int num_rows = 0; | ||
| 511 | unsigned int debounce_cnt; | ||
| 512 | unsigned int scan_time_rows; | ||
| 513 | |||
| 514 | if (!pdata) | ||
| 515 | return -EINVAL; | ||
| 516 | |||
| 517 | if (!tegra_kbc_check_pin_cfg(pdata, &pdev->dev, &num_rows)) | ||
| 518 | return -EINVAL; | ||
| 519 | |||
| 520 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 521 | if (!res) { | ||
| 522 | dev_err(&pdev->dev, "failed to get I/O memory\n"); | ||
| 523 | return -ENXIO; | ||
| 524 | } | ||
| 525 | |||
| 526 | irq = platform_get_irq(pdev, 0); | ||
| 527 | if (irq < 0) { | ||
| 528 | dev_err(&pdev->dev, "failed to get keyboard IRQ\n"); | ||
| 529 | return -ENXIO; | ||
| 530 | } | ||
| 531 | |||
| 532 | kbc = kzalloc(sizeof(*kbc), GFP_KERNEL); | ||
| 533 | input_dev = input_allocate_device(); | ||
| 534 | if (!kbc || !input_dev) { | ||
| 535 | err = -ENOMEM; | ||
| 536 | goto err_free_mem; | ||
| 537 | } | ||
| 538 | |||
| 539 | kbc->pdata = pdata; | ||
| 540 | kbc->idev = input_dev; | ||
| 541 | kbc->irq = irq; | ||
| 542 | spin_lock_init(&kbc->lock); | ||
| 543 | setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc); | ||
| 544 | |||
| 545 | res = request_mem_region(res->start, resource_size(res), pdev->name); | ||
| 546 | if (!res) { | ||
| 547 | dev_err(&pdev->dev, "failed to request I/O memory\n"); | ||
| 548 | err = -EBUSY; | ||
| 549 | goto err_free_mem; | ||
| 550 | } | ||
| 551 | |||
| 552 | kbc->mmio = ioremap(res->start, resource_size(res)); | ||
| 553 | if (!kbc->mmio) { | ||
| 554 | dev_err(&pdev->dev, "failed to remap I/O memory\n"); | ||
| 555 | err = -ENXIO; | ||
| 556 | goto err_free_mem_region; | ||
| 557 | } | ||
| 558 | |||
| 559 | kbc->clk = clk_get(&pdev->dev, NULL); | ||
| 560 | if (IS_ERR(kbc->clk)) { | ||
| 561 | dev_err(&pdev->dev, "failed to get keyboard clock\n"); | ||
| 562 | err = PTR_ERR(kbc->clk); | ||
| 563 | goto err_iounmap; | ||
| 564 | } | ||
| 565 | |||
| 566 | kbc->wake_enable_rows = 0; | ||
| 567 | kbc->wake_enable_cols = 0; | ||
| 568 | for (i = 0; i < pdata->wake_cnt; i++) { | ||
| 569 | kbc->wake_enable_rows |= (1 << pdata->wake_cfg[i].row); | ||
| 570 | kbc->wake_enable_cols |= (1 << pdata->wake_cfg[i].col); | ||
| 571 | } | ||
| 572 | |||
| 573 | /* | ||
| 574 | * The time delay between two consecutive reads of the FIFO is | ||
| 575 | * the sum of the repeat time and the time taken for scanning | ||
| 576 | * the rows. There is an additional delay before the row scanning | ||
| 577 | * starts. The repoll delay is computed in milliseconds. | ||
| 578 | */ | ||
| 579 | debounce_cnt = min(pdata->debounce_cnt, KBC_MAX_DEBOUNCE_CNT); | ||
| 580 | scan_time_rows = (KBC_ROW_SCAN_TIME + debounce_cnt) * num_rows; | ||
| 581 | kbc->repoll_dly = KBC_ROW_SCAN_DLY + scan_time_rows + pdata->repeat_cnt; | ||
| 582 | kbc->repoll_dly = ((kbc->repoll_dly * KBC_CYCLE_USEC) + 999) / 1000; | ||
| 583 | |||
| 584 | input_dev->name = pdev->name; | ||
| 585 | input_dev->id.bustype = BUS_HOST; | ||
| 586 | input_dev->dev.parent = &pdev->dev; | ||
| 587 | input_dev->open = tegra_kbc_open; | ||
| 588 | input_dev->close = tegra_kbc_close; | ||
| 589 | |||
| 590 | input_set_drvdata(input_dev, kbc); | ||
| 591 | |||
| 592 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | ||
| 593 | input_set_capability(input_dev, EV_MSC, MSC_SCAN); | ||
| 594 | |||
| 595 | input_dev->keycode = kbc->keycode; | ||
| 596 | input_dev->keycodesize = sizeof(kbc->keycode[0]); | ||
| 597 | input_dev->keycodemax = ARRAY_SIZE(kbc->keycode); | ||
| 598 | |||
| 599 | keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data; | ||
| 600 | matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT, | ||
| 601 | input_dev->keycode, input_dev->keybit); | ||
| 602 | |||
| 603 | err = request_irq(kbc->irq, tegra_kbc_isr, IRQF_TRIGGER_HIGH, | ||
| 604 | pdev->name, kbc); | ||
| 605 | if (err) { | ||
| 606 | dev_err(&pdev->dev, "failed to request keyboard IRQ\n"); | ||
| 607 | goto err_put_clk; | ||
| 608 | } | ||
| 609 | |||
| 610 | disable_irq(kbc->irq); | ||
| 611 | |||
| 612 | err = input_register_device(kbc->idev); | ||
| 613 | if (err) { | ||
| 614 | dev_err(&pdev->dev, "failed to register input device\n"); | ||
| 615 | goto err_free_irq; | ||
| 616 | } | ||
| 617 | |||
| 618 | platform_set_drvdata(pdev, kbc); | ||
| 619 | device_init_wakeup(&pdev->dev, pdata->wakeup); | ||
| 620 | |||
| 621 | return 0; | ||
| 622 | |||
| 623 | err_free_irq: | ||
| 624 | free_irq(kbc->irq, pdev); | ||
| 625 | err_put_clk: | ||
| 626 | clk_put(kbc->clk); | ||
| 627 | err_iounmap: | ||
| 628 | iounmap(kbc->mmio); | ||
| 629 | err_free_mem_region: | ||
| 630 | release_mem_region(res->start, resource_size(res)); | ||
| 631 | err_free_mem: | ||
| 632 | input_free_device(kbc->idev); | ||
| 633 | kfree(kbc); | ||
| 634 | |||
| 635 | return err; | ||
| 636 | } | ||
| 637 | |||
| 638 | static int __devexit tegra_kbc_remove(struct platform_device *pdev) | ||
| 639 | { | ||
| 640 | struct tegra_kbc *kbc = platform_get_drvdata(pdev); | ||
| 641 | struct resource *res; | ||
| 642 | |||
| 643 | free_irq(kbc->irq, pdev); | ||
| 644 | clk_put(kbc->clk); | ||
| 645 | |||
| 646 | input_unregister_device(kbc->idev); | ||
| 647 | iounmap(kbc->mmio); | ||
| 648 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 649 | release_mem_region(res->start, resource_size(res)); | ||
| 650 | |||
| 651 | kfree(kbc); | ||
| 652 | |||
| 653 | platform_set_drvdata(pdev, NULL); | ||
| 654 | |||
| 655 | return 0; | ||
| 656 | } | ||
| 657 | |||
| 658 | #ifdef CONFIG_PM_SLEEP | ||
| 659 | static int tegra_kbc_suspend(struct device *dev) | ||
| 660 | { | ||
| 661 | struct platform_device *pdev = to_platform_device(dev); | ||
| 662 | struct tegra_kbc *kbc = platform_get_drvdata(pdev); | ||
| 663 | |||
| 664 | if (device_may_wakeup(&pdev->dev)) { | ||
| 665 | tegra_kbc_setup_wakekeys(kbc, true); | ||
| 666 | enable_irq_wake(kbc->irq); | ||
| 667 | /* Forcefully clear the interrupt status */ | ||
| 668 | writel(0x7, kbc->mmio + KBC_INT_0); | ||
| 669 | msleep(30); | ||
| 670 | } else { | ||
| 671 | mutex_lock(&kbc->idev->mutex); | ||
| 672 | if (kbc->idev->users) | ||
| 673 | tegra_kbc_stop(kbc); | ||
| 674 | mutex_unlock(&kbc->idev->mutex); | ||
| 675 | } | ||
| 676 | |||
| 677 | return 0; | ||
| 678 | } | ||
| 679 | |||
| 680 | static int tegra_kbc_resume(struct device *dev) | ||
| 681 | { | ||
| 682 | struct platform_device *pdev = to_platform_device(dev); | ||
| 683 | struct tegra_kbc *kbc = platform_get_drvdata(pdev); | ||
| 684 | int err = 0; | ||
| 685 | |||
| 686 | if (device_may_wakeup(&pdev->dev)) { | ||
| 687 | disable_irq_wake(kbc->irq); | ||
| 688 | tegra_kbc_setup_wakekeys(kbc, false); | ||
| 689 | } else { | ||
| 690 | mutex_lock(&kbc->idev->mutex); | ||
| 691 | if (kbc->idev->users) | ||
| 692 | err = tegra_kbc_start(kbc); | ||
| 693 | mutex_unlock(&kbc->idev->mutex); | ||
| 694 | } | ||
| 695 | |||
| 696 | return err; | ||
| 697 | } | ||
| 698 | #endif | ||
| 699 | |||
| 700 | static SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops, tegra_kbc_suspend, tegra_kbc_resume); | ||
| 701 | |||
| 702 | static struct platform_driver tegra_kbc_driver = { | ||
| 703 | .probe = tegra_kbc_probe, | ||
| 704 | .remove = __devexit_p(tegra_kbc_remove), | ||
| 705 | .driver = { | ||
| 706 | .name = "tegra-kbc", | ||
| 707 | .owner = THIS_MODULE, | ||
| 708 | .pm = &tegra_kbc_pm_ops, | ||
| 709 | }, | ||
| 710 | }; | ||
| 711 | |||
| 712 | static void __exit tegra_kbc_exit(void) | ||
| 713 | { | ||
| 714 | platform_driver_unregister(&tegra_kbc_driver); | ||
| 715 | } | ||
| 716 | module_exit(tegra_kbc_exit); | ||
| 717 | |||
| 718 | static int __init tegra_kbc_init(void) | ||
| 719 | { | ||
| 720 | return platform_driver_register(&tegra_kbc_driver); | ||
| 721 | } | ||
| 722 | module_init(tegra_kbc_init); | ||
| 723 | |||
| 724 | MODULE_LICENSE("GPL"); | ||
| 725 | MODULE_AUTHOR("Rakesh Iyer <riyer@nvidia.com>"); | ||
| 726 | MODULE_DESCRIPTION("Tegra matrix keyboard controller driver"); | ||
| 727 | MODULE_ALIAS("platform:tegra-kbc"); | ||
diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c index b4a81ebfab9..c8f097a15d8 100644 --- a/drivers/input/keyboard/tnetv107x-keypad.c +++ b/drivers/input/keyboard/tnetv107x-keypad.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/err.h> | ||
| 17 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
| 18 | #include <linux/input.h> | 19 | #include <linux/input.h> |
| 19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
| @@ -219,9 +220,9 @@ static int __devinit keypad_probe(struct platform_device *pdev) | |||
| 219 | } | 220 | } |
| 220 | 221 | ||
| 221 | kp->clk = clk_get(dev, NULL); | 222 | kp->clk = clk_get(dev, NULL); |
| 222 | if (!kp->clk) { | 223 | if (IS_ERR(kp->clk)) { |
| 223 | dev_err(dev, "cannot claim device clock\n"); | 224 | dev_err(dev, "cannot claim device clock\n"); |
| 224 | error = -EINVAL; | 225 | error = PTR_ERR(kp->clk); |
| 225 | goto error_clk; | 226 | goto error_clk; |
| 226 | } | 227 | } |
| 227 | 228 | ||
diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c index 448c7724beb..85281656724 100644 --- a/drivers/input/serio/ct82c710.c +++ b/drivers/input/serio/ct82c710.c | |||
| @@ -111,9 +111,11 @@ static void ct82c710_close(struct serio *serio) | |||
| 111 | static int ct82c710_open(struct serio *serio) | 111 | static int ct82c710_open(struct serio *serio) |
| 112 | { | 112 | { |
| 113 | unsigned char status; | 113 | unsigned char status; |
| 114 | int err; | ||
| 114 | 115 | ||
| 115 | if (request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL)) | 116 | err = request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL); |
| 116 | return -1; | 117 | if (err) |
| 118 | return err; | ||
| 117 | 119 | ||
| 118 | status = inb_p(CT82C710_STATUS); | 120 | status = inb_p(CT82C710_STATUS); |
| 119 | 121 | ||
| @@ -131,7 +133,7 @@ static int ct82c710_open(struct serio *serio) | |||
| 131 | status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON); | 133 | status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON); |
| 132 | outb_p(status, CT82C710_STATUS); | 134 | outb_p(status, CT82C710_STATUS); |
| 133 | free_irq(CT82C710_IRQ, NULL); | 135 | free_irq(CT82C710_IRQ, NULL); |
| 134 | return -1; | 136 | return -EBUSY; |
| 135 | } | 137 | } |
| 136 | 138 | ||
| 137 | return 0; | 139 | return 0; |
diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c index 6e362de3f41..8755f5f3ad3 100644 --- a/drivers/input/serio/serport.c +++ b/drivers/input/serio/serport.c | |||
| @@ -116,14 +116,15 @@ static void serport_ldisc_close(struct tty_struct *tty) | |||
| 116 | 116 | ||
| 117 | /* | 117 | /* |
| 118 | * serport_ldisc_receive() is called by the low level tty driver when characters | 118 | * serport_ldisc_receive() is called by the low level tty driver when characters |
| 119 | * are ready for us. We forward the characters, one by one to the 'interrupt' | 119 | * are ready for us. We forward the characters and flags, one by one to the |
| 120 | * routine. | 120 | * 'interrupt' routine. |
| 121 | */ | 121 | */ |
| 122 | 122 | ||
| 123 | static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) | 123 | static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) |
| 124 | { | 124 | { |
| 125 | struct serport *serport = (struct serport*) tty->disc_data; | 125 | struct serport *serport = (struct serport*) tty->disc_data; |
| 126 | unsigned long flags; | 126 | unsigned long flags; |
| 127 | unsigned int ch_flags; | ||
| 127 | int i; | 128 | int i; |
| 128 | 129 | ||
| 129 | spin_lock_irqsave(&serport->lock, flags); | 130 | spin_lock_irqsave(&serport->lock, flags); |
| @@ -131,8 +132,23 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c | |||
| 131 | if (!test_bit(SERPORT_ACTIVE, &serport->flags)) | 132 | if (!test_bit(SERPORT_ACTIVE, &serport->flags)) |
| 132 | goto out; | 133 | goto out; |
| 133 | 134 | ||
| 134 | for (i = 0; i < count; i++) | 135 | for (i = 0; i < count; i++) { |
| 135 | serio_interrupt(serport->serio, cp[i], 0); | 136 | switch (fp[i]) { |
| 137 | case TTY_FRAME: | ||
| 138 | ch_flags = SERIO_FRAME; | ||
| 139 | break; | ||
| 140 | |||
| 141 | case TTY_PARITY: | ||
| 142 | ch_flags = SERIO_PARITY; | ||
| 143 | break; | ||
| 144 | |||
| 145 | default: | ||
| 146 | ch_flags = 0; | ||
| 147 | break; | ||
| 148 | } | ||
| 149 | |||
| 150 | serio_interrupt(serport->serio, cp[i], ch_flags); | ||
| 151 | } | ||
| 136 | 152 | ||
| 137 | out: | 153 | out: |
| 138 | spin_unlock_irqrestore(&serport->lock, flags); | 154 | spin_unlock_irqrestore(&serport->lock, flags); |
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c index a29a7812bd4..7729e547ba6 100644 --- a/drivers/input/sparse-keymap.c +++ b/drivers/input/sparse-keymap.c | |||
| @@ -201,6 +201,7 @@ int sparse_keymap_setup(struct input_dev *dev, | |||
| 201 | break; | 201 | break; |
| 202 | 202 | ||
| 203 | case KE_SW: | 203 | case KE_SW: |
| 204 | case KE_VSW: | ||
| 204 | __set_bit(EV_SW, dev->evbit); | 205 | __set_bit(EV_SW, dev->evbit); |
| 205 | __set_bit(entry->sw.code, dev->swbit); | 206 | __set_bit(entry->sw.code, dev->swbit); |
| 206 | break; | 207 | break; |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 518782999fe..367fa82a607 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -1101,6 +1101,13 @@ void wacom_setup_device_quirks(struct wacom_features *features) | |||
| 1101 | } | 1101 | } |
| 1102 | } | 1102 | } |
| 1103 | 1103 | ||
| 1104 | static unsigned int wacom_calculate_touch_res(unsigned int logical_max, | ||
| 1105 | unsigned int physical_max) | ||
| 1106 | { | ||
| 1107 | /* Touch physical dimensions are in 100th of mm */ | ||
| 1108 | return (logical_max * 100) / physical_max; | ||
| 1109 | } | ||
| 1110 | |||
| 1104 | void wacom_setup_input_capabilities(struct input_dev *input_dev, | 1111 | void wacom_setup_input_capabilities(struct input_dev *input_dev, |
| 1105 | struct wacom_wac *wacom_wac) | 1112 | struct wacom_wac *wacom_wac) |
| 1106 | { | 1113 | { |
| @@ -1228,8 +1235,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
| 1228 | case TABLETPC: | 1235 | case TABLETPC: |
| 1229 | if (features->device_type == BTN_TOOL_DOUBLETAP || | 1236 | if (features->device_type == BTN_TOOL_DOUBLETAP || |
| 1230 | features->device_type == BTN_TOOL_TRIPLETAP) { | 1237 | features->device_type == BTN_TOOL_TRIPLETAP) { |
| 1231 | input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0); | 1238 | input_abs_set_res(input_dev, ABS_X, |
| 1232 | input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0); | 1239 | wacom_calculate_touch_res(features->x_max, |
| 1240 | features->x_phy)); | ||
| 1241 | input_abs_set_res(input_dev, ABS_Y, | ||
| 1242 | wacom_calculate_touch_res(features->y_max, | ||
| 1243 | features->y_phy)); | ||
| 1233 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); | 1244 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); |
| 1234 | } | 1245 | } |
| 1235 | 1246 | ||
| @@ -1272,6 +1283,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
| 1272 | input_set_abs_params(input_dev, ABS_MT_PRESSURE, | 1283 | input_set_abs_params(input_dev, ABS_MT_PRESSURE, |
| 1273 | 0, features->pressure_max, | 1284 | 0, features->pressure_max, |
| 1274 | features->pressure_fuzz, 0); | 1285 | features->pressure_fuzz, 0); |
| 1286 | input_abs_set_res(input_dev, ABS_X, | ||
| 1287 | wacom_calculate_touch_res(features->x_max, | ||
| 1288 | features->x_phy)); | ||
| 1289 | input_abs_set_res(input_dev, ABS_Y, | ||
| 1290 | wacom_calculate_touch_res(features->y_max, | ||
| 1291 | features->y_phy)); | ||
| 1275 | } else if (features->device_type == BTN_TOOL_PEN) { | 1292 | } else if (features->device_type == BTN_TOOL_PEN) { |
| 1276 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); | 1293 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 1277 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); | 1294 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
| @@ -1426,6 +1443,10 @@ static struct wacom_features wacom_features_0xD3 = | |||
| 1426 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; | 1443 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; |
| 1427 | static const struct wacom_features wacom_features_0xD4 = | 1444 | static const struct wacom_features wacom_features_0xD4 = |
| 1428 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255, 63, BAMBOO_PT }; | 1445 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255, 63, BAMBOO_PT }; |
| 1446 | static struct wacom_features wacom_features_0xD6 = | ||
| 1447 | { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; | ||
| 1448 | static struct wacom_features wacom_features_0xD7 = | ||
| 1449 | { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; | ||
| 1429 | static struct wacom_features wacom_features_0xD8 = | 1450 | static struct wacom_features wacom_features_0xD8 = |
| 1430 | { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; | 1451 | { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; |
| 1431 | static struct wacom_features wacom_features_0xDA = | 1452 | static struct wacom_features wacom_features_0xDA = |
| @@ -1507,6 +1528,8 @@ const struct usb_device_id wacom_ids[] = { | |||
| 1507 | { USB_DEVICE_WACOM(0xD2) }, | 1528 | { USB_DEVICE_WACOM(0xD2) }, |
| 1508 | { USB_DEVICE_WACOM(0xD3) }, | 1529 | { USB_DEVICE_WACOM(0xD3) }, |
| 1509 | { USB_DEVICE_WACOM(0xD4) }, | 1530 | { USB_DEVICE_WACOM(0xD4) }, |
| 1531 | { USB_DEVICE_WACOM(0xD6) }, | ||
| 1532 | { USB_DEVICE_WACOM(0xD7) }, | ||
| 1510 | { USB_DEVICE_WACOM(0xD8) }, | 1533 | { USB_DEVICE_WACOM(0xD8) }, |
| 1511 | { USB_DEVICE_WACOM(0xDA) }, | 1534 | { USB_DEVICE_WACOM(0xDA) }, |
| 1512 | { USB_DEVICE_WACOM(0xDB) }, | 1535 | { USB_DEVICE_WACOM(0xDB) }, |
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index f7fa9ef4cd6..1507ce108d5 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
| 13 | #include <linux/input/bu21013.h> | 13 | #include <linux/input/bu21013.h> |
| 14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
| 15 | #include <linux/regulator/consumer.h> | ||
| 15 | 16 | ||
| 16 | #define PEN_DOWN_INTR 0 | 17 | #define PEN_DOWN_INTR 0 |
| 17 | #define MAX_FINGERS 2 | 18 | #define MAX_FINGERS 2 |
| @@ -139,6 +140,7 @@ | |||
| 139 | * @chip: pointer to the touch panel controller | 140 | * @chip: pointer to the touch panel controller |
| 140 | * @in_dev: pointer to the input device structure | 141 | * @in_dev: pointer to the input device structure |
| 141 | * @intr_pin: interrupt pin value | 142 | * @intr_pin: interrupt pin value |
| 143 | * @regulator: pointer to the Regulator used for touch screen | ||
| 142 | * | 144 | * |
| 143 | * Touch panel device data structure | 145 | * Touch panel device data structure |
| 144 | */ | 146 | */ |
| @@ -149,6 +151,7 @@ struct bu21013_ts_data { | |||
| 149 | const struct bu21013_platform_device *chip; | 151 | const struct bu21013_platform_device *chip; |
| 150 | struct input_dev *in_dev; | 152 | struct input_dev *in_dev; |
| 151 | unsigned int intr_pin; | 153 | unsigned int intr_pin; |
| 154 | struct regulator *regulator; | ||
| 152 | }; | 155 | }; |
| 153 | 156 | ||
| 154 | /** | 157 | /** |
| @@ -456,6 +459,20 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
| 456 | bu21013_data->in_dev = in_dev; | 459 | bu21013_data->in_dev = in_dev; |
| 457 | bu21013_data->chip = pdata; | 460 | bu21013_data->chip = pdata; |
| 458 | bu21013_data->client = client; | 461 | bu21013_data->client = client; |
| 462 | |||
| 463 | bu21013_data->regulator = regulator_get(&client->dev, "V-TOUCH"); | ||
| 464 | if (IS_ERR(bu21013_data->regulator)) { | ||
| 465 | dev_err(&client->dev, "regulator_get failed\n"); | ||
| 466 | error = PTR_ERR(bu21013_data->regulator); | ||
| 467 | goto err_free_mem; | ||
| 468 | } | ||
| 469 | |||
| 470 | error = regulator_enable(bu21013_data->regulator); | ||
| 471 | if (error < 0) { | ||
| 472 | dev_err(&client->dev, "regulator enable failed\n"); | ||
| 473 | goto err_put_regulator; | ||
| 474 | } | ||
| 475 | |||
| 459 | bu21013_data->touch_stopped = false; | 476 | bu21013_data->touch_stopped = false; |
| 460 | init_waitqueue_head(&bu21013_data->wait); | 477 | init_waitqueue_head(&bu21013_data->wait); |
| 461 | 478 | ||
| @@ -464,7 +481,7 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
| 464 | error = pdata->cs_en(pdata->cs_pin); | 481 | error = pdata->cs_en(pdata->cs_pin); |
| 465 | if (error < 0) { | 482 | if (error < 0) { |
| 466 | dev_err(&client->dev, "chip init failed\n"); | 483 | dev_err(&client->dev, "chip init failed\n"); |
| 467 | goto err_free_mem; | 484 | goto err_disable_regulator; |
| 468 | } | 485 | } |
| 469 | } | 486 | } |
| 470 | 487 | ||
| @@ -485,9 +502,9 @@ static int __devinit bu21013_probe(struct i2c_client *client, | |||
| 485 | __set_bit(EV_ABS, in_dev->evbit); | 502 | __set_bit(EV_ABS, in_dev->evbit); |
| 486 | 503 | ||
| 487 | input_set_abs_params(in_dev, ABS_MT_POSITION_X, 0, | 504 | input_set_abs_params(in_dev, ABS_MT_POSITION_X, 0, |
| 488 | pdata->x_max_res, 0, 0); | 505 | pdata->touch_x_max, 0, 0); |
| 489 | input_set_abs_params(in_dev, ABS_MT_POSITION_Y, 0, | 506 | input_set_abs_params(in_dev, ABS_MT_POSITION_Y, 0, |
| 490 | pdata->y_max_res, 0, 0); | 507 | pdata->touch_y_max, 0, 0); |
| 491 | input_set_drvdata(in_dev, bu21013_data); | 508 | input_set_drvdata(in_dev, bu21013_data); |
| 492 | 509 | ||
| 493 | error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, | 510 | error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, |
| @@ -513,6 +530,10 @@ err_free_irq: | |||
| 513 | bu21013_free_irq(bu21013_data); | 530 | bu21013_free_irq(bu21013_data); |
| 514 | err_cs_disable: | 531 | err_cs_disable: |
| 515 | pdata->cs_dis(pdata->cs_pin); | 532 | pdata->cs_dis(pdata->cs_pin); |
| 533 | err_disable_regulator: | ||
| 534 | regulator_disable(bu21013_data->regulator); | ||
| 535 | err_put_regulator: | ||
| 536 | regulator_put(bu21013_data->regulator); | ||
| 516 | err_free_mem: | 537 | err_free_mem: |
| 517 | input_free_device(in_dev); | 538 | input_free_device(in_dev); |
| 518 | kfree(bu21013_data); | 539 | kfree(bu21013_data); |
| @@ -535,6 +556,10 @@ static int __devexit bu21013_remove(struct i2c_client *client) | |||
| 535 | bu21013_data->chip->cs_dis(bu21013_data->chip->cs_pin); | 556 | bu21013_data->chip->cs_dis(bu21013_data->chip->cs_pin); |
| 536 | 557 | ||
| 537 | input_unregister_device(bu21013_data->in_dev); | 558 | input_unregister_device(bu21013_data->in_dev); |
| 559 | |||
| 560 | regulator_disable(bu21013_data->regulator); | ||
| 561 | regulator_put(bu21013_data->regulator); | ||
| 562 | |||
| 538 | kfree(bu21013_data); | 563 | kfree(bu21013_data); |
| 539 | 564 | ||
| 540 | device_init_wakeup(&client->dev, false); | 565 | device_init_wakeup(&client->dev, false); |
| @@ -561,6 +586,8 @@ static int bu21013_suspend(struct device *dev) | |||
| 561 | else | 586 | else |
| 562 | disable_irq(bu21013_data->chip->irq); | 587 | disable_irq(bu21013_data->chip->irq); |
| 563 | 588 | ||
| 589 | regulator_disable(bu21013_data->regulator); | ||
| 590 | |||
| 564 | return 0; | 591 | return 0; |
| 565 | } | 592 | } |
| 566 | 593 | ||
| @@ -577,6 +604,12 @@ static int bu21013_resume(struct device *dev) | |||
| 577 | struct i2c_client *client = bu21013_data->client; | 604 | struct i2c_client *client = bu21013_data->client; |
| 578 | int retval; | 605 | int retval; |
| 579 | 606 | ||
| 607 | retval = regulator_enable(bu21013_data->regulator); | ||
| 608 | if (retval < 0) { | ||
| 609 | dev_err(&client->dev, "bu21013 regulator enable failed\n"); | ||
| 610 | return retval; | ||
| 611 | } | ||
| 612 | |||
| 580 | retval = bu21013_init_chip(bu21013_data); | 613 | retval = bu21013_init_chip(bu21013_data); |
| 581 | if (retval < 0) { | 614 | if (retval < 0) { |
| 582 | dev_err(&client->dev, "bu21013 controller config failed\n"); | 615 | dev_err(&client->dev, "bu21013 controller config failed\n"); |
diff --git a/drivers/input/touchscreen/tnetv107x-ts.c b/drivers/input/touchscreen/tnetv107x-ts.c index cf1dba2e267..22a3411e93c 100644 --- a/drivers/input/touchscreen/tnetv107x-ts.c +++ b/drivers/input/touchscreen/tnetv107x-ts.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/err.h> | ||
| 17 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
| 18 | #include <linux/input.h> | 19 | #include <linux/input.h> |
| 19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
| @@ -289,9 +290,9 @@ static int __devinit tsc_probe(struct platform_device *pdev) | |||
| 289 | } | 290 | } |
| 290 | 291 | ||
| 291 | ts->clk = clk_get(dev, NULL); | 292 | ts->clk = clk_get(dev, NULL); |
| 292 | if (!ts->clk) { | 293 | if (IS_ERR(ts->clk)) { |
| 293 | dev_err(dev, "cannot claim device clock\n"); | 294 | dev_err(dev, "cannot claim device clock\n"); |
| 294 | error = -EINVAL; | 295 | error = PTR_ERR(ts->clk); |
| 295 | goto error_clk; | 296 | goto error_clk; |
| 296 | } | 297 | } |
| 297 | 298 | ||
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index da3fa8dcdf5..666daf77872 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c | |||
| @@ -69,6 +69,7 @@ static int led_pwm_probe(struct platform_device *pdev) | |||
| 69 | led_dat->pwm = pwm_request(cur_led->pwm_id, | 69 | led_dat->pwm = pwm_request(cur_led->pwm_id, |
| 70 | cur_led->name); | 70 | cur_led->name); |
| 71 | if (IS_ERR(led_dat->pwm)) { | 71 | if (IS_ERR(led_dat->pwm)) { |
| 72 | ret = PTR_ERR(led_dat->pwm); | ||
| 72 | dev_err(&pdev->dev, "unable to request PWM %d\n", | 73 | dev_err(&pdev->dev, "unable to request PWM %d\n", |
| 73 | cur_led->pwm_id); | 74 | cur_led->pwm_id); |
| 74 | goto err; | 75 | goto err; |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 56302282566..2de12fe155d 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
| @@ -46,10 +46,6 @@ static unsigned int fmax = 515633; | |||
| 46 | * is asserted (likewise for RX) | 46 | * is asserted (likewise for RX) |
| 47 | * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY | 47 | * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY |
| 48 | * is asserted (likewise for RX) | 48 | * is asserted (likewise for RX) |
| 49 | * @broken_blockend: the MCI_DATABLOCKEND is broken on the hardware | ||
| 50 | * and will not work at all. | ||
| 51 | * @broken_blockend_dma: the MCI_DATABLOCKEND is broken on the hardware when | ||
| 52 | * using DMA. | ||
| 53 | * @sdio: variant supports SDIO | 49 | * @sdio: variant supports SDIO |
| 54 | * @st_clkdiv: true if using a ST-specific clock divider algorithm | 50 | * @st_clkdiv: true if using a ST-specific clock divider algorithm |
| 55 | */ | 51 | */ |
| @@ -59,8 +55,6 @@ struct variant_data { | |||
| 59 | unsigned int datalength_bits; | 55 | unsigned int datalength_bits; |
| 60 | unsigned int fifosize; | 56 | unsigned int fifosize; |
| 61 | unsigned int fifohalfsize; | 57 | unsigned int fifohalfsize; |
| 62 | bool broken_blockend; | ||
| 63 | bool broken_blockend_dma; | ||
| 64 | bool sdio; | 58 | bool sdio; |
| 65 | bool st_clkdiv; | 59 | bool st_clkdiv; |
| 66 | }; | 60 | }; |
| @@ -76,7 +70,6 @@ static struct variant_data variant_u300 = { | |||
| 76 | .fifohalfsize = 8 * 4, | 70 | .fifohalfsize = 8 * 4, |
| 77 | .clkreg_enable = 1 << 13, /* HWFCEN */ | 71 | .clkreg_enable = 1 << 13, /* HWFCEN */ |
| 78 | .datalength_bits = 16, | 72 | .datalength_bits = 16, |
| 79 | .broken_blockend_dma = true, | ||
| 80 | .sdio = true, | 73 | .sdio = true, |
| 81 | }; | 74 | }; |
| 82 | 75 | ||
| @@ -86,7 +79,6 @@ static struct variant_data variant_ux500 = { | |||
| 86 | .clkreg = MCI_CLK_ENABLE, | 79 | .clkreg = MCI_CLK_ENABLE, |
| 87 | .clkreg_enable = 1 << 14, /* HWFCEN */ | 80 | .clkreg_enable = 1 << 14, /* HWFCEN */ |
| 88 | .datalength_bits = 24, | 81 | .datalength_bits = 24, |
| 89 | .broken_blockend = true, | ||
| 90 | .sdio = true, | 82 | .sdio = true, |
| 91 | .st_clkdiv = true, | 83 | .st_clkdiv = true, |
| 92 | }; | 84 | }; |
| @@ -210,8 +202,6 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) | |||
| 210 | host->data = data; | 202 | host->data = data; |
| 211 | host->size = data->blksz * data->blocks; | 203 | host->size = data->blksz * data->blocks; |
| 212 | host->data_xfered = 0; | 204 | host->data_xfered = 0; |
| 213 | host->blockend = false; | ||
| 214 | host->dataend = false; | ||
| 215 | 205 | ||
| 216 | mmci_init_sg(host, data); | 206 | mmci_init_sg(host, data); |
| 217 | 207 | ||
| @@ -288,21 +278,26 @@ static void | |||
| 288 | mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | 278 | mmci_data_irq(struct mmci_host *host, struct mmc_data *data, |
| 289 | unsigned int status) | 279 | unsigned int status) |
| 290 | { | 280 | { |
| 291 | struct variant_data *variant = host->variant; | ||
| 292 | |||
| 293 | /* First check for errors */ | 281 | /* First check for errors */ |
| 294 | if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) { | 282 | if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) { |
| 283 | u32 remain, success; | ||
| 284 | |||
| 285 | /* Calculate how far we are into the transfer */ | ||
| 286 | remain = readl(host->base + MMCIDATACNT) << 2; | ||
| 287 | success = data->blksz * data->blocks - remain; | ||
| 288 | |||
| 295 | dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status); | 289 | dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ (status %08x)\n", status); |
| 296 | if (status & MCI_DATACRCFAIL) | 290 | if (status & MCI_DATACRCFAIL) { |
| 291 | /* Last block was not successful */ | ||
| 292 | host->data_xfered = ((success / data->blksz) - 1 * data->blksz); | ||
| 297 | data->error = -EILSEQ; | 293 | data->error = -EILSEQ; |
| 298 | else if (status & MCI_DATATIMEOUT) | 294 | } else if (status & MCI_DATATIMEOUT) { |
| 295 | host->data_xfered = success; | ||
| 299 | data->error = -ETIMEDOUT; | 296 | data->error = -ETIMEDOUT; |
| 300 | else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN)) | 297 | } else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN)) { |
| 298 | host->data_xfered = success; | ||
| 301 | data->error = -EIO; | 299 | data->error = -EIO; |
| 302 | 300 | } | |
| 303 | /* Force-complete the transaction */ | ||
| 304 | host->blockend = true; | ||
| 305 | host->dataend = true; | ||
| 306 | 301 | ||
| 307 | /* | 302 | /* |
| 308 | * We hit an error condition. Ensure that any data | 303 | * We hit an error condition. Ensure that any data |
| @@ -321,61 +316,14 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data, | |||
| 321 | } | 316 | } |
| 322 | } | 317 | } |
| 323 | 318 | ||
| 324 | /* | 319 | if (status & MCI_DATABLOCKEND) |
| 325 | * On ARM variants in PIO mode, MCI_DATABLOCKEND | 320 | dev_err(mmc_dev(host->mmc), "stray MCI_DATABLOCKEND interrupt\n"); |
| 326 | * is always sent first, and we increase the | ||
| 327 | * transfered number of bytes for that IRQ. Then | ||
| 328 | * MCI_DATAEND follows and we conclude the transaction. | ||
| 329 | * | ||
| 330 | * On the Ux500 single-IRQ variant MCI_DATABLOCKEND | ||
| 331 | * doesn't seem to immediately clear from the status, | ||
| 332 | * so we can't use it keep count when only one irq is | ||
| 333 | * used because the irq will hit for other reasons, and | ||
| 334 | * then the flag is still up. So we use the MCI_DATAEND | ||
| 335 | * IRQ at the end of the entire transfer because | ||
| 336 | * MCI_DATABLOCKEND is broken. | ||
| 337 | * | ||
| 338 | * In the U300, the IRQs can arrive out-of-order, | ||
| 339 | * e.g. MCI_DATABLOCKEND sometimes arrives after MCI_DATAEND, | ||
| 340 | * so for this case we use the flags "blockend" and | ||
| 341 | * "dataend" to make sure both IRQs have arrived before | ||
| 342 | * concluding the transaction. (This does not apply | ||
| 343 | * to the Ux500 which doesn't fire MCI_DATABLOCKEND | ||
| 344 | * at all.) In DMA mode it suffers from the same problem | ||
| 345 | * as the Ux500. | ||
| 346 | */ | ||
| 347 | if (status & MCI_DATABLOCKEND) { | ||
| 348 | /* | ||
| 349 | * Just being a little over-cautious, we do not | ||
| 350 | * use this progressive update if the hardware blockend | ||
| 351 | * flag is unreliable: since it can stay high between | ||
| 352 | * IRQs it will corrupt the transfer counter. | ||
| 353 | */ | ||
| 354 | if (!variant->broken_blockend) | ||
| 355 | host->data_xfered += data->blksz; | ||
| 356 | host->blockend = true; | ||
| 357 | } | ||
| 358 | |||
| 359 | if (status & MCI_DATAEND) | ||
| 360 | host->dataend = true; | ||
| 361 | 321 | ||
| 362 | /* | 322 | if (status & MCI_DATAEND) { |
| 363 | * On variants with broken blockend we shall only wait for dataend, | ||
| 364 | * on others we must sync with the blockend signal since they can | ||
| 365 | * appear out-of-order. | ||
| 366 | */ | ||
| 367 | if (host->dataend && (host->blockend || variant->broken_blockend)) { | ||
| 368 | mmci_stop_data(host); | 323 | mmci_stop_data(host); |
| 369 | 324 | ||
| 370 | /* Reset these flags */ | 325 | if (!data->error) |
| 371 | host->blockend = false; | 326 | /* The error clause is handled above, success! */ |
| 372 | host->dataend = false; | ||
| 373 | |||
| 374 | /* | ||
| 375 | * Variants with broken blockend flags need to handle the | ||
| 376 | * end of the entire transfer here. | ||
| 377 | */ | ||
| 378 | if (variant->broken_blockend && !data->error) | ||
| 379 | host->data_xfered += data->blksz * data->blocks; | 327 | host->data_xfered += data->blksz * data->blocks; |
| 380 | 328 | ||
| 381 | if (!data->stop) { | 329 | if (!data->stop) { |
| @@ -770,7 +718,6 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
| 770 | struct variant_data *variant = id->data; | 718 | struct variant_data *variant = id->data; |
| 771 | struct mmci_host *host; | 719 | struct mmci_host *host; |
| 772 | struct mmc_host *mmc; | 720 | struct mmc_host *mmc; |
| 773 | unsigned int mask; | ||
| 774 | int ret; | 721 | int ret; |
| 775 | 722 | ||
| 776 | /* must have platform data */ | 723 | /* must have platform data */ |
| @@ -951,12 +898,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
| 951 | goto irq0_free; | 898 | goto irq0_free; |
| 952 | } | 899 | } |
| 953 | 900 | ||
| 954 | mask = MCI_IRQENABLE; | 901 | writel(MCI_IRQENABLE, host->base + MMCIMASK0); |
| 955 | /* Don't use the datablockend flag if it's broken */ | ||
| 956 | if (variant->broken_blockend) | ||
| 957 | mask &= ~MCI_DATABLOCKEND; | ||
| 958 | |||
| 959 | writel(mask, host->base + MMCIMASK0); | ||
| 960 | 902 | ||
| 961 | amba_set_drvdata(dev, mmc); | 903 | amba_set_drvdata(dev, mmc); |
| 962 | 904 | ||
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index df06f01aac8..c1df7b82d36 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
| @@ -137,7 +137,7 @@ | |||
| 137 | #define MCI_IRQENABLE \ | 137 | #define MCI_IRQENABLE \ |
| 138 | (MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK| \ | 138 | (MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK| \ |
| 139 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ | 139 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ |
| 140 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATABLOCKENDMASK) | 140 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK) |
| 141 | 141 | ||
| 142 | /* These interrupts are directed to IRQ1 when two IRQ lines are available */ | 142 | /* These interrupts are directed to IRQ1 when two IRQ lines are available */ |
| 143 | #define MCI_IRQ1MASK \ | 143 | #define MCI_IRQ1MASK \ |
| @@ -177,9 +177,6 @@ struct mmci_host { | |||
| 177 | struct timer_list timer; | 177 | struct timer_list timer; |
| 178 | unsigned int oldstat; | 178 | unsigned int oldstat; |
| 179 | 179 | ||
| 180 | bool blockend; | ||
| 181 | bool dataend; | ||
| 182 | |||
| 183 | /* pio stuff */ | 180 | /* pio stuff */ |
| 184 | struct sg_mapping_iter sg_miter; | 181 | struct sg_mapping_iter sg_miter; |
| 185 | unsigned int size; | 182 | unsigned int size; |
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c index 5decfd0bd61..153ab977a01 100644 --- a/drivers/mmc/host/msm_sdcc.c +++ b/drivers/mmc/host/msm_sdcc.c | |||
| @@ -383,14 +383,30 @@ static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data) | |||
| 383 | host->curr.user_pages = 0; | 383 | host->curr.user_pages = 0; |
| 384 | 384 | ||
| 385 | box = &nc->cmd[0]; | 385 | box = &nc->cmd[0]; |
| 386 | for (i = 0; i < host->dma.num_ents; i++) { | ||
| 387 | box->cmd = CMD_MODE_BOX; | ||
| 388 | 386 | ||
| 389 | /* Initialize sg dma address */ | 387 | /* location of command block must be 64 bit aligned */ |
| 390 | sg->dma_address = page_to_dma(mmc_dev(host->mmc), sg_page(sg)) | 388 | BUG_ON(host->dma.cmd_busaddr & 0x07); |
| 391 | + sg->offset; | ||
| 392 | 389 | ||
| 393 | if (i == (host->dma.num_ents - 1)) | 390 | nc->cmdptr = (host->dma.cmd_busaddr >> 3) | CMD_PTR_LP; |
| 391 | host->dma.hdr.cmdptr = DMOV_CMD_PTR_LIST | | ||
| 392 | DMOV_CMD_ADDR(host->dma.cmdptr_busaddr); | ||
| 393 | host->dma.hdr.complete_func = msmsdcc_dma_complete_func; | ||
| 394 | |||
| 395 | n = dma_map_sg(mmc_dev(host->mmc), host->dma.sg, | ||
| 396 | host->dma.num_ents, host->dma.dir); | ||
| 397 | if (n == 0) { | ||
| 398 | printk(KERN_ERR "%s: Unable to map in all sg elements\n", | ||
| 399 | mmc_hostname(host->mmc)); | ||
| 400 | host->dma.sg = NULL; | ||
| 401 | host->dma.num_ents = 0; | ||
| 402 | return -ENOMEM; | ||
| 403 | } | ||
| 404 | |||
| 405 | for_each_sg(host->dma.sg, sg, n, i) { | ||
| 406 | |||
| 407 | box->cmd = CMD_MODE_BOX; | ||
| 408 | |||
| 409 | if (i == n - 1) | ||
| 394 | box->cmd |= CMD_LC; | 410 | box->cmd |= CMD_LC; |
| 395 | rows = (sg_dma_len(sg) % MCI_FIFOSIZE) ? | 411 | rows = (sg_dma_len(sg) % MCI_FIFOSIZE) ? |
| 396 | (sg_dma_len(sg) / MCI_FIFOSIZE) + 1 : | 412 | (sg_dma_len(sg) / MCI_FIFOSIZE) + 1 : |
| @@ -418,27 +434,6 @@ static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data) | |||
| 418 | box->cmd |= CMD_DST_CRCI(crci); | 434 | box->cmd |= CMD_DST_CRCI(crci); |
| 419 | } | 435 | } |
| 420 | box++; | 436 | box++; |
| 421 | sg++; | ||
| 422 | } | ||
| 423 | |||
| 424 | /* location of command block must be 64 bit aligned */ | ||
| 425 | BUG_ON(host->dma.cmd_busaddr & 0x07); | ||
| 426 | |||
| 427 | nc->cmdptr = (host->dma.cmd_busaddr >> 3) | CMD_PTR_LP; | ||
| 428 | host->dma.hdr.cmdptr = DMOV_CMD_PTR_LIST | | ||
| 429 | DMOV_CMD_ADDR(host->dma.cmdptr_busaddr); | ||
| 430 | host->dma.hdr.complete_func = msmsdcc_dma_complete_func; | ||
| 431 | |||
| 432 | n = dma_map_sg(mmc_dev(host->mmc), host->dma.sg, | ||
| 433 | host->dma.num_ents, host->dma.dir); | ||
| 434 | /* dsb inside dma_map_sg will write nc out to mem as well */ | ||
| 435 | |||
| 436 | if (n != host->dma.num_ents) { | ||
| 437 | printk(KERN_ERR "%s: Unable to map in all sg elements\n", | ||
| 438 | mmc_hostname(host->mmc)); | ||
| 439 | host->dma.sg = NULL; | ||
| 440 | host->dma.num_ents = 0; | ||
| 441 | return -ENOMEM; | ||
| 442 | } | 437 | } |
| 443 | 438 | ||
| 444 | return 0; | 439 | return 0; |
| @@ -1331,9 +1326,6 @@ msmsdcc_probe(struct platform_device *pdev) | |||
| 1331 | if (host->timer.function) | 1326 | if (host->timer.function) |
| 1332 | pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc)); | 1327 | pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc)); |
| 1333 | 1328 | ||
| 1334 | #if BUSCLK_PWRSAVE | ||
| 1335 | msmsdcc_disable_clocks(host, 1); | ||
| 1336 | #endif | ||
| 1337 | return 0; | 1329 | return 0; |
| 1338 | cmd_irq_free: | 1330 | cmd_irq_free: |
| 1339 | free_irq(cmd_irqres->start, host); | 1331 | free_irq(cmd_irqres->start, host); |
diff --git a/drivers/parport/share.c b/drivers/parport/share.c index a2d9d1e5926..a848e02e6be 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c | |||
| @@ -678,7 +678,7 @@ void parport_unregister_device(struct pardevice *dev) | |||
| 678 | 678 | ||
| 679 | /* Make sure we haven't left any pointers around in the wait | 679 | /* Make sure we haven't left any pointers around in the wait |
| 680 | * list. */ | 680 | * list. */ |
| 681 | spin_lock (&port->waitlist_lock); | 681 | spin_lock_irq(&port->waitlist_lock); |
| 682 | if (dev->waitprev || dev->waitnext || port->waithead == dev) { | 682 | if (dev->waitprev || dev->waitnext || port->waithead == dev) { |
| 683 | if (dev->waitprev) | 683 | if (dev->waitprev) |
| 684 | dev->waitprev->waitnext = dev->waitnext; | 684 | dev->waitprev->waitnext = dev->waitnext; |
| @@ -689,7 +689,7 @@ void parport_unregister_device(struct pardevice *dev) | |||
| 689 | else | 689 | else |
| 690 | port->waittail = dev->waitprev; | 690 | port->waittail = dev->waitprev; |
| 691 | } | 691 | } |
| 692 | spin_unlock (&port->waitlist_lock); | 692 | spin_unlock_irq(&port->waitlist_lock); |
| 693 | 693 | ||
| 694 | kfree(dev->state); | 694 | kfree(dev->state); |
| 695 | kfree(dev); | 695 | kfree(dev); |
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 1752ef006d2..f374c5961b3 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
| @@ -161,7 +161,7 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) | |||
| 161 | { | 161 | { |
| 162 | int i, nc, bytes, d; | 162 | int i, nc, bytes, d; |
| 163 | u32 offset = 0; | 163 | u32 offset = 0; |
| 164 | u32 err = 0; | 164 | int err; |
| 165 | u8 cbuf[IPC_WWBUF_SIZE] = { }; | 165 | u8 cbuf[IPC_WWBUF_SIZE] = { }; |
| 166 | u32 *wbuf = (u32 *)&cbuf; | 166 | u32 *wbuf = (u32 *)&cbuf; |
| 167 | 167 | ||
| @@ -404,7 +404,7 @@ EXPORT_SYMBOL(intel_scu_ipc_update_register); | |||
| 404 | */ | 404 | */ |
| 405 | int intel_scu_ipc_simple_command(int cmd, int sub) | 405 | int intel_scu_ipc_simple_command(int cmd, int sub) |
| 406 | { | 406 | { |
| 407 | u32 err = 0; | 407 | int err; |
| 408 | 408 | ||
| 409 | mutex_lock(&ipclock); | 409 | mutex_lock(&ipclock); |
| 410 | if (ipcdev.pdev == NULL) { | 410 | if (ipcdev.pdev == NULL) { |
| @@ -434,8 +434,7 @@ EXPORT_SYMBOL(intel_scu_ipc_simple_command); | |||
| 434 | int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, | 434 | int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, |
| 435 | u32 *out, int outlen) | 435 | u32 *out, int outlen) |
| 436 | { | 436 | { |
| 437 | u32 err = 0; | 437 | int i, err; |
| 438 | int i = 0; | ||
| 439 | 438 | ||
| 440 | mutex_lock(&ipclock); | 439 | mutex_lock(&ipclock); |
| 441 | if (ipcdev.pdev == NULL) { | 440 | if (ipcdev.pdev == NULL) { |
diff --git a/drivers/platform/x86/intel_scu_ipcutil.c b/drivers/platform/x86/intel_scu_ipcutil.c index ba3231d0819..b93a03259c1 100644 --- a/drivers/platform/x86/intel_scu_ipcutil.c +++ b/drivers/platform/x86/intel_scu_ipcutil.c | |||
| @@ -128,6 +128,6 @@ static void __exit ipc_module_exit(void) | |||
| 128 | module_init(ipc_module_init); | 128 | module_init(ipc_module_init); |
| 129 | module_exit(ipc_module_exit); | 129 | module_exit(ipc_module_exit); |
| 130 | 130 | ||
| 131 | MODULE_LICENSE("GPL V2"); | 131 | MODULE_LICENSE("GPL v2"); |
| 132 | MODULE_DESCRIPTION("Utility driver for intel scu ipc"); | 132 | MODULE_DESCRIPTION("Utility driver for intel scu ipc"); |
| 133 | MODULE_AUTHOR("Sreedhara <sreedhara.ds@intel.com>"); | 133 | MODULE_AUTHOR("Sreedhara <sreedhara.ds@intel.com>"); |
diff --git a/drivers/pps/clients/pps-ktimer.c b/drivers/pps/clients/pps-ktimer.c index 2728469d388..82583b0ff82 100644 --- a/drivers/pps/clients/pps-ktimer.c +++ b/drivers/pps/clients/pps-ktimer.c | |||
| @@ -46,8 +46,6 @@ static void pps_ktimer_event(unsigned long ptr) | |||
| 46 | /* First of all we get the time stamp... */ | 46 | /* First of all we get the time stamp... */ |
| 47 | pps_get_ts(&ts); | 47 | pps_get_ts(&ts); |
| 48 | 48 | ||
| 49 | dev_info(pps->dev, "PPS event at %lu\n", jiffies); | ||
| 50 | |||
| 51 | pps_event(pps, &ts, PPS_CAPTUREASSERT, NULL); | 49 | pps_event(pps, &ts, PPS_CAPTUREASSERT, NULL); |
| 52 | 50 | ||
| 53 | mod_timer(&ktimer, jiffies + HZ); | 51 | mod_timer(&ktimer, jiffies + HZ); |
diff --git a/drivers/pps/clients/pps_parport.c b/drivers/pps/clients/pps_parport.c index 32221efd9ca..c571d6dd8f6 100644 --- a/drivers/pps/clients/pps_parport.c +++ b/drivers/pps/clients/pps_parport.c | |||
| @@ -163,7 +163,7 @@ static void parport_attach(struct parport *port) | |||
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | device->pardev = parport_register_device(port, KBUILD_MODNAME, | 165 | device->pardev = parport_register_device(port, KBUILD_MODNAME, |
| 166 | NULL, NULL, parport_irq, 0, device); | 166 | NULL, NULL, parport_irq, PARPORT_FLAG_EXCL, device); |
| 167 | if (!device->pardev) { | 167 | if (!device->pardev) { |
| 168 | pr_err("couldn't register with %s\n", port->name); | 168 | pr_err("couldn't register with %s\n", port->name); |
| 169 | goto err_free; | 169 | goto err_free; |
diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c index 5c32f8dacf5..b93af3ebb5b 100644 --- a/drivers/pps/generators/pps_gen_parport.c +++ b/drivers/pps/generators/pps_gen_parport.c | |||
| @@ -198,7 +198,7 @@ static void parport_attach(struct parport *port) | |||
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | device.pardev = parport_register_device(port, KBUILD_MODNAME, | 200 | device.pardev = parport_register_device(port, KBUILD_MODNAME, |
| 201 | NULL, NULL, NULL, 0, &device); | 201 | NULL, NULL, NULL, PARPORT_FLAG_EXCL, &device); |
| 202 | if (!device.pardev) { | 202 | if (!device.pardev) { |
| 203 | pr_err("couldn't register with %s\n", port->name); | 203 | pr_err("couldn't register with %s\n", port->name); |
| 204 | return; | 204 | return; |
diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c index de885a0f917..f33e2dd9793 100644 --- a/drivers/sh/intc/chip.c +++ b/drivers/sh/intc/chip.c | |||
| @@ -173,7 +173,8 @@ int intc_set_priority(unsigned int irq, unsigned int prio) | |||
| 173 | return 0; | 173 | return 0; |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | #define VALID(x) (x | 0x80) | 176 | #define SENSE_VALID_FLAG 0x80 |
| 177 | #define VALID(x) (x | SENSE_VALID_FLAG) | ||
| 177 | 178 | ||
| 178 | static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = { | 179 | static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = { |
| 179 | [IRQ_TYPE_EDGE_FALLING] = VALID(0), | 180 | [IRQ_TYPE_EDGE_FALLING] = VALID(0), |
| @@ -201,7 +202,8 @@ static int intc_set_type(struct irq_data *data, unsigned int type) | |||
| 201 | ihp = intc_find_irq(d->sense, d->nr_sense, irq); | 202 | ihp = intc_find_irq(d->sense, d->nr_sense, irq); |
| 202 | if (ihp) { | 203 | if (ihp) { |
| 203 | addr = INTC_REG(d, _INTC_ADDR_E(ihp->handle), 0); | 204 | addr = INTC_REG(d, _INTC_ADDR_E(ihp->handle), 0); |
| 204 | intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, value); | 205 | intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, |
| 206 | value & ~SENSE_VALID_FLAG); | ||
| 205 | } | 207 | } |
| 206 | 208 | ||
| 207 | return 0; | 209 | return 0; |
diff --git a/drivers/staging/msm/msm_fb.c b/drivers/staging/msm/msm_fb.c index 23fa049b51f..a2f29d46405 100644 --- a/drivers/staging/msm/msm_fb.c +++ b/drivers/staging/msm/msm_fb.c | |||
| @@ -347,7 +347,7 @@ static int msm_fb_suspend(struct platform_device *pdev, pm_message_t state) | |||
| 347 | if ((!mfd) || (mfd->key != MFD_KEY)) | 347 | if ((!mfd) || (mfd->key != MFD_KEY)) |
| 348 | return 0; | 348 | return 0; |
| 349 | 349 | ||
| 350 | acquire_console_sem(); | 350 | console_lock(); |
| 351 | fb_set_suspend(mfd->fbi, 1); | 351 | fb_set_suspend(mfd->fbi, 1); |
| 352 | 352 | ||
| 353 | ret = msm_fb_suspend_sub(mfd); | 353 | ret = msm_fb_suspend_sub(mfd); |
| @@ -358,7 +358,7 @@ static int msm_fb_suspend(struct platform_device *pdev, pm_message_t state) | |||
| 358 | pdev->dev.power.power_state = state; | 358 | pdev->dev.power.power_state = state; |
| 359 | } | 359 | } |
| 360 | 360 | ||
| 361 | release_console_sem(); | 361 | console_unlock(); |
| 362 | return ret; | 362 | return ret; |
| 363 | } | 363 | } |
| 364 | #else | 364 | #else |
| @@ -431,11 +431,11 @@ static int msm_fb_resume(struct platform_device *pdev) | |||
| 431 | if ((!mfd) || (mfd->key != MFD_KEY)) | 431 | if ((!mfd) || (mfd->key != MFD_KEY)) |
| 432 | return 0; | 432 | return 0; |
| 433 | 433 | ||
| 434 | acquire_console_sem(); | 434 | console_lock(); |
| 435 | ret = msm_fb_resume_sub(mfd); | 435 | ret = msm_fb_resume_sub(mfd); |
| 436 | pdev->dev.power.power_state = PMSG_ON; | 436 | pdev->dev.power.power_state = PMSG_ON; |
| 437 | fb_set_suspend(mfd->fbi, 1); | 437 | fb_set_suspend(mfd->fbi, 1); |
| 438 | release_console_sem(); | 438 | console_unlock(); |
| 439 | 439 | ||
| 440 | return ret; | 440 | return ret; |
| 441 | } | 441 | } |
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c index 9f26dc9408b..56a283d1a74 100644 --- a/drivers/staging/olpc_dcon/olpc_dcon.c +++ b/drivers/staging/olpc_dcon/olpc_dcon.c | |||
| @@ -373,17 +373,17 @@ static void dcon_source_switch(struct work_struct *work) | |||
| 373 | * | 373 | * |
| 374 | * For now, we just hope.. | 374 | * For now, we just hope.. |
| 375 | */ | 375 | */ |
| 376 | acquire_console_sem(); | 376 | console_lock(); |
| 377 | ignore_fb_events = 1; | 377 | ignore_fb_events = 1; |
| 378 | if (fb_blank(fbinfo, FB_BLANK_UNBLANK)) { | 378 | if (fb_blank(fbinfo, FB_BLANK_UNBLANK)) { |
| 379 | ignore_fb_events = 0; | 379 | ignore_fb_events = 0; |
| 380 | release_console_sem(); | 380 | console_unlock(); |
| 381 | printk(KERN_ERR "olpc-dcon: Failed to enter CPU mode\n"); | 381 | printk(KERN_ERR "olpc-dcon: Failed to enter CPU mode\n"); |
| 382 | dcon_pending = DCON_SOURCE_DCON; | 382 | dcon_pending = DCON_SOURCE_DCON; |
| 383 | return; | 383 | return; |
| 384 | } | 384 | } |
| 385 | ignore_fb_events = 0; | 385 | ignore_fb_events = 0; |
| 386 | release_console_sem(); | 386 | console_unlock(); |
| 387 | 387 | ||
| 388 | /* And turn off the DCON */ | 388 | /* And turn off the DCON */ |
| 389 | pdata->set_dconload(1); | 389 | pdata->set_dconload(1); |
| @@ -435,12 +435,12 @@ static void dcon_source_switch(struct work_struct *work) | |||
| 435 | } | 435 | } |
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | acquire_console_sem(); | 438 | console_lock(); |
| 439 | ignore_fb_events = 1; | 439 | ignore_fb_events = 1; |
| 440 | if (fb_blank(fbinfo, FB_BLANK_POWERDOWN)) | 440 | if (fb_blank(fbinfo, FB_BLANK_POWERDOWN)) |
| 441 | printk(KERN_ERR "olpc-dcon: couldn't blank fb!\n"); | 441 | printk(KERN_ERR "olpc-dcon: couldn't blank fb!\n"); |
| 442 | ignore_fb_events = 0; | 442 | ignore_fb_events = 0; |
| 443 | release_console_sem(); | 443 | console_unlock(); |
| 444 | 444 | ||
| 445 | printk(KERN_INFO "olpc-dcon: The DCON has control\n"); | 445 | printk(KERN_INFO "olpc-dcon: The DCON has control\n"); |
| 446 | break; | 446 | break; |
diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c index 0bc113c44d3..d007e4a12c1 100644 --- a/drivers/staging/sm7xx/smtcfb.c +++ b/drivers/staging/sm7xx/smtcfb.c | |||
| @@ -1044,9 +1044,9 @@ static int __maybe_unused smtcfb_suspend(struct pci_dev *pdev, pm_message_t msg) | |||
| 1044 | 1044 | ||
| 1045 | /* when doing suspend, call fb apis and pci apis */ | 1045 | /* when doing suspend, call fb apis and pci apis */ |
| 1046 | if (msg.event == PM_EVENT_SUSPEND) { | 1046 | if (msg.event == PM_EVENT_SUSPEND) { |
| 1047 | acquire_console_sem(); | 1047 | console_lock(); |
| 1048 | fb_set_suspend(&sfb->fb, 1); | 1048 | fb_set_suspend(&sfb->fb, 1); |
| 1049 | release_console_sem(); | 1049 | console_unlock(); |
| 1050 | retv = pci_save_state(pdev); | 1050 | retv = pci_save_state(pdev); |
| 1051 | pci_disable_device(pdev); | 1051 | pci_disable_device(pdev); |
| 1052 | retv = pci_choose_state(pdev, msg); | 1052 | retv = pci_choose_state(pdev, msg); |
| @@ -1105,9 +1105,9 @@ static int __maybe_unused smtcfb_resume(struct pci_dev *pdev) | |||
| 1105 | 1105 | ||
| 1106 | smtcfb_setmode(sfb); | 1106 | smtcfb_setmode(sfb); |
| 1107 | 1107 | ||
| 1108 | acquire_console_sem(); | 1108 | console_lock(); |
| 1109 | fb_set_suspend(&sfb->fb, 0); | 1109 | fb_set_suspend(&sfb->fb, 0); |
| 1110 | release_console_sem(); | 1110 | console_unlock(); |
| 1111 | 1111 | ||
| 1112 | return 0; | 1112 | return 0; |
| 1113 | } | 1113 | } |
diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index a2f2b325449..602d9845c52 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c | |||
| @@ -829,7 +829,7 @@ static void __init sbd_probe_duarts(void) | |||
| 829 | #ifdef CONFIG_SERIAL_SB1250_DUART_CONSOLE | 829 | #ifdef CONFIG_SERIAL_SB1250_DUART_CONSOLE |
| 830 | /* | 830 | /* |
| 831 | * Serial console stuff. Very basic, polling driver for doing serial | 831 | * Serial console stuff. Very basic, polling driver for doing serial |
| 832 | * console output. The console_sem is held by the caller, so we | 832 | * console output. The console_lock is held by the caller, so we |
| 833 | * shouldn't be interrupted for more console activity. | 833 | * shouldn't be interrupted for more console activity. |
| 834 | */ | 834 | */ |
| 835 | static void sbd_console_putchar(struct uart_port *uport, int ch) | 835 | static void sbd_console_putchar(struct uart_port *uport, int ch) |
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index c556ed9db13..8e0dd254eb1 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | #include <asm/irq_regs.h> | 46 | #include <asm/irq_regs.h> |
| 47 | 47 | ||
| 48 | /* Whether we react on sysrq keys or just ignore them */ | 48 | /* Whether we react on sysrq keys or just ignore them */ |
| 49 | static int __read_mostly sysrq_enabled = 1; | 49 | static int __read_mostly sysrq_enabled = SYSRQ_DEFAULT_ENABLE; |
| 50 | static bool __read_mostly sysrq_always_enabled; | 50 | static bool __read_mostly sysrq_always_enabled; |
| 51 | 51 | ||
| 52 | static bool sysrq_on(void) | 52 | static bool sysrq_on(void) |
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 464d09d9787..6158eae0f64 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
| @@ -3256,7 +3256,7 @@ static ssize_t show_cons_active(struct device *dev, | |||
| 3256 | struct console *c; | 3256 | struct console *c; |
| 3257 | ssize_t count = 0; | 3257 | ssize_t count = 0; |
| 3258 | 3258 | ||
| 3259 | acquire_console_sem(); | 3259 | console_lock(); |
| 3260 | for (c = console_drivers; c; c = c->next) { | 3260 | for (c = console_drivers; c; c = c->next) { |
| 3261 | if (!c->device) | 3261 | if (!c->device) |
| 3262 | continue; | 3262 | continue; |
| @@ -3271,7 +3271,7 @@ static ssize_t show_cons_active(struct device *dev, | |||
| 3271 | while (i--) | 3271 | while (i--) |
| 3272 | count += sprintf(buf + count, "%s%d%c", | 3272 | count += sprintf(buf + count, "%s%d%c", |
| 3273 | cs[i]->name, cs[i]->index, i ? ' ':'\n'); | 3273 | cs[i]->name, cs[i]->index, i ? ' ':'\n'); |
| 3274 | release_console_sem(); | 3274 | console_unlock(); |
| 3275 | 3275 | ||
| 3276 | return count; | 3276 | return count; |
| 3277 | } | 3277 | } |
diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c index ebae344ce91..c956ed6c83a 100644 --- a/drivers/tty/vt/selection.c +++ b/drivers/tty/vt/selection.c | |||
| @@ -316,9 +316,9 @@ int paste_selection(struct tty_struct *tty) | |||
| 316 | /* always called with BTM from vt_ioctl */ | 316 | /* always called with BTM from vt_ioctl */ |
| 317 | WARN_ON(!tty_locked()); | 317 | WARN_ON(!tty_locked()); |
| 318 | 318 | ||
| 319 | acquire_console_sem(); | 319 | console_lock(); |
| 320 | poke_blanked_console(); | 320 | poke_blanked_console(); |
| 321 | release_console_sem(); | 321 | console_unlock(); |
| 322 | 322 | ||
| 323 | ld = tty_ldisc_ref(tty); | 323 | ld = tty_ldisc_ref(tty); |
| 324 | if (!ld) { | 324 | if (!ld) { |
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index eab3a1ff99e..a672ed192d3 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c | |||
| @@ -202,7 +202,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
| 202 | /* Select the proper current console and verify | 202 | /* Select the proper current console and verify |
| 203 | * sanity of the situation under the console lock. | 203 | * sanity of the situation under the console lock. |
| 204 | */ | 204 | */ |
| 205 | acquire_console_sem(); | 205 | console_lock(); |
| 206 | 206 | ||
| 207 | attr = (currcons & 128); | 207 | attr = (currcons & 128); |
| 208 | currcons = (currcons & 127); | 208 | currcons = (currcons & 127); |
| @@ -336,9 +336,9 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
| 336 | * the pagefault handling code may want to call printk(). | 336 | * the pagefault handling code may want to call printk(). |
| 337 | */ | 337 | */ |
| 338 | 338 | ||
| 339 | release_console_sem(); | 339 | console_unlock(); |
| 340 | ret = copy_to_user(buf, con_buf_start, orig_count); | 340 | ret = copy_to_user(buf, con_buf_start, orig_count); |
| 341 | acquire_console_sem(); | 341 | console_lock(); |
| 342 | 342 | ||
| 343 | if (ret) { | 343 | if (ret) { |
| 344 | read += (orig_count - ret); | 344 | read += (orig_count - ret); |
| @@ -354,7 +354,7 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
| 354 | if (read) | 354 | if (read) |
| 355 | ret = read; | 355 | ret = read; |
| 356 | unlock_out: | 356 | unlock_out: |
| 357 | release_console_sem(); | 357 | console_unlock(); |
| 358 | mutex_unlock(&con_buf_mtx); | 358 | mutex_unlock(&con_buf_mtx); |
| 359 | return ret; | 359 | return ret; |
| 360 | } | 360 | } |
| @@ -379,7 +379,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) | |||
| 379 | /* Select the proper current console and verify | 379 | /* Select the proper current console and verify |
| 380 | * sanity of the situation under the console lock. | 380 | * sanity of the situation under the console lock. |
| 381 | */ | 381 | */ |
| 382 | acquire_console_sem(); | 382 | console_lock(); |
| 383 | 383 | ||
| 384 | attr = (currcons & 128); | 384 | attr = (currcons & 128); |
| 385 | currcons = (currcons & 127); | 385 | currcons = (currcons & 127); |
| @@ -414,9 +414,9 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) | |||
| 414 | /* Temporarily drop the console lock so that we can read | 414 | /* Temporarily drop the console lock so that we can read |
| 415 | * in the write data from userspace safely. | 415 | * in the write data from userspace safely. |
| 416 | */ | 416 | */ |
| 417 | release_console_sem(); | 417 | console_unlock(); |
| 418 | ret = copy_from_user(con_buf, buf, this_round); | 418 | ret = copy_from_user(con_buf, buf, this_round); |
| 419 | acquire_console_sem(); | 419 | console_lock(); |
| 420 | 420 | ||
| 421 | if (ret) { | 421 | if (ret) { |
| 422 | this_round -= ret; | 422 | this_round -= ret; |
| @@ -542,7 +542,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) | |||
| 542 | vcs_scr_updated(vc); | 542 | vcs_scr_updated(vc); |
| 543 | 543 | ||
| 544 | unlock_out: | 544 | unlock_out: |
| 545 | release_console_sem(); | 545 | console_unlock(); |
| 546 | 546 | ||
| 547 | mutex_unlock(&con_buf_mtx); | 547 | mutex_unlock(&con_buf_mtx); |
| 548 | 548 | ||
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 76407eca9ab..b230bd3f056 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
| @@ -1003,9 +1003,9 @@ static int vt_resize(struct tty_struct *tty, struct winsize *ws) | |||
| 1003 | struct vc_data *vc = tty->driver_data; | 1003 | struct vc_data *vc = tty->driver_data; |
| 1004 | int ret; | 1004 | int ret; |
| 1005 | 1005 | ||
| 1006 | acquire_console_sem(); | 1006 | console_lock(); |
| 1007 | ret = vc_do_resize(tty, vc, ws->ws_col, ws->ws_row); | 1007 | ret = vc_do_resize(tty, vc, ws->ws_col, ws->ws_row); |
| 1008 | release_console_sem(); | 1008 | console_unlock(); |
| 1009 | return ret; | 1009 | return ret; |
| 1010 | } | 1010 | } |
| 1011 | 1011 | ||
| @@ -1271,7 +1271,7 @@ static void default_attr(struct vc_data *vc) | |||
| 1271 | vc->vc_color = vc->vc_def_color; | 1271 | vc->vc_color = vc->vc_def_color; |
| 1272 | } | 1272 | } |
| 1273 | 1273 | ||
| 1274 | /* console_sem is held */ | 1274 | /* console_lock is held */ |
| 1275 | static void csi_m(struct vc_data *vc) | 1275 | static void csi_m(struct vc_data *vc) |
| 1276 | { | 1276 | { |
| 1277 | int i; | 1277 | int i; |
| @@ -1415,7 +1415,7 @@ int mouse_reporting(void) | |||
| 1415 | return vc_cons[fg_console].d->vc_report_mouse; | 1415 | return vc_cons[fg_console].d->vc_report_mouse; |
| 1416 | } | 1416 | } |
| 1417 | 1417 | ||
| 1418 | /* console_sem is held */ | 1418 | /* console_lock is held */ |
| 1419 | static void set_mode(struct vc_data *vc, int on_off) | 1419 | static void set_mode(struct vc_data *vc, int on_off) |
| 1420 | { | 1420 | { |
| 1421 | int i; | 1421 | int i; |
| @@ -1485,7 +1485,7 @@ static void set_mode(struct vc_data *vc, int on_off) | |||
| 1485 | } | 1485 | } |
| 1486 | } | 1486 | } |
| 1487 | 1487 | ||
| 1488 | /* console_sem is held */ | 1488 | /* console_lock is held */ |
| 1489 | static void setterm_command(struct vc_data *vc) | 1489 | static void setterm_command(struct vc_data *vc) |
| 1490 | { | 1490 | { |
| 1491 | switch(vc->vc_par[0]) { | 1491 | switch(vc->vc_par[0]) { |
| @@ -1545,7 +1545,7 @@ static void setterm_command(struct vc_data *vc) | |||
| 1545 | } | 1545 | } |
| 1546 | } | 1546 | } |
| 1547 | 1547 | ||
| 1548 | /* console_sem is held */ | 1548 | /* console_lock is held */ |
| 1549 | static void csi_at(struct vc_data *vc, unsigned int nr) | 1549 | static void csi_at(struct vc_data *vc, unsigned int nr) |
| 1550 | { | 1550 | { |
| 1551 | if (nr > vc->vc_cols - vc->vc_x) | 1551 | if (nr > vc->vc_cols - vc->vc_x) |
| @@ -1555,7 +1555,7 @@ static void csi_at(struct vc_data *vc, unsigned int nr) | |||
| 1555 | insert_char(vc, nr); | 1555 | insert_char(vc, nr); |
| 1556 | } | 1556 | } |
| 1557 | 1557 | ||
| 1558 | /* console_sem is held */ | 1558 | /* console_lock is held */ |
| 1559 | static void csi_L(struct vc_data *vc, unsigned int nr) | 1559 | static void csi_L(struct vc_data *vc, unsigned int nr) |
| 1560 | { | 1560 | { |
| 1561 | if (nr > vc->vc_rows - vc->vc_y) | 1561 | if (nr > vc->vc_rows - vc->vc_y) |
| @@ -1566,7 +1566,7 @@ static void csi_L(struct vc_data *vc, unsigned int nr) | |||
| 1566 | vc->vc_need_wrap = 0; | 1566 | vc->vc_need_wrap = 0; |
| 1567 | } | 1567 | } |
| 1568 | 1568 | ||
| 1569 | /* console_sem is held */ | 1569 | /* console_lock is held */ |
| 1570 | static void csi_P(struct vc_data *vc, unsigned int nr) | 1570 | static void csi_P(struct vc_data *vc, unsigned int nr) |
| 1571 | { | 1571 | { |
| 1572 | if (nr > vc->vc_cols - vc->vc_x) | 1572 | if (nr > vc->vc_cols - vc->vc_x) |
| @@ -1576,7 +1576,7 @@ static void csi_P(struct vc_data *vc, unsigned int nr) | |||
| 1576 | delete_char(vc, nr); | 1576 | delete_char(vc, nr); |
| 1577 | } | 1577 | } |
| 1578 | 1578 | ||
| 1579 | /* console_sem is held */ | 1579 | /* console_lock is held */ |
| 1580 | static void csi_M(struct vc_data *vc, unsigned int nr) | 1580 | static void csi_M(struct vc_data *vc, unsigned int nr) |
| 1581 | { | 1581 | { |
| 1582 | if (nr > vc->vc_rows - vc->vc_y) | 1582 | if (nr > vc->vc_rows - vc->vc_y) |
| @@ -1587,7 +1587,7 @@ static void csi_M(struct vc_data *vc, unsigned int nr) | |||
| 1587 | vc->vc_need_wrap = 0; | 1587 | vc->vc_need_wrap = 0; |
| 1588 | } | 1588 | } |
| 1589 | 1589 | ||
| 1590 | /* console_sem is held (except via vc_init->reset_terminal */ | 1590 | /* console_lock is held (except via vc_init->reset_terminal */ |
| 1591 | static void save_cur(struct vc_data *vc) | 1591 | static void save_cur(struct vc_data *vc) |
| 1592 | { | 1592 | { |
| 1593 | vc->vc_saved_x = vc->vc_x; | 1593 | vc->vc_saved_x = vc->vc_x; |
| @@ -1603,7 +1603,7 @@ static void save_cur(struct vc_data *vc) | |||
| 1603 | vc->vc_saved_G1 = vc->vc_G1_charset; | 1603 | vc->vc_saved_G1 = vc->vc_G1_charset; |
| 1604 | } | 1604 | } |
| 1605 | 1605 | ||
| 1606 | /* console_sem is held */ | 1606 | /* console_lock is held */ |
| 1607 | static void restore_cur(struct vc_data *vc) | 1607 | static void restore_cur(struct vc_data *vc) |
| 1608 | { | 1608 | { |
| 1609 | gotoxy(vc, vc->vc_saved_x, vc->vc_saved_y); | 1609 | gotoxy(vc, vc->vc_saved_x, vc->vc_saved_y); |
| @@ -1625,7 +1625,7 @@ enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey, | |||
| 1625 | EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd, | 1625 | EShash, ESsetG0, ESsetG1, ESpercent, ESignore, ESnonstd, |
| 1626 | ESpalette }; | 1626 | ESpalette }; |
| 1627 | 1627 | ||
| 1628 | /* console_sem is held (except via vc_init()) */ | 1628 | /* console_lock is held (except via vc_init()) */ |
| 1629 | static void reset_terminal(struct vc_data *vc, int do_clear) | 1629 | static void reset_terminal(struct vc_data *vc, int do_clear) |
| 1630 | { | 1630 | { |
| 1631 | vc->vc_top = 0; | 1631 | vc->vc_top = 0; |
| @@ -1685,7 +1685,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear) | |||
| 1685 | csi_J(vc, 2); | 1685 | csi_J(vc, 2); |
| 1686 | } | 1686 | } |
| 1687 | 1687 | ||
| 1688 | /* console_sem is held */ | 1688 | /* console_lock is held */ |
| 1689 | static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) | 1689 | static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) |
| 1690 | { | 1690 | { |
| 1691 | /* | 1691 | /* |
| @@ -2119,7 +2119,7 @@ static int is_double_width(uint32_t ucs) | |||
| 2119 | return bisearch(ucs, double_width, ARRAY_SIZE(double_width) - 1); | 2119 | return bisearch(ucs, double_width, ARRAY_SIZE(double_width) - 1); |
| 2120 | } | 2120 | } |
| 2121 | 2121 | ||
| 2122 | /* acquires console_sem */ | 2122 | /* acquires console_lock */ |
| 2123 | static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int count) | 2123 | static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int count) |
| 2124 | { | 2124 | { |
| 2125 | #ifdef VT_BUF_VRAM_ONLY | 2125 | #ifdef VT_BUF_VRAM_ONLY |
| @@ -2147,11 +2147,11 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co | |||
| 2147 | 2147 | ||
| 2148 | might_sleep(); | 2148 | might_sleep(); |
| 2149 | 2149 | ||
| 2150 | acquire_console_sem(); | 2150 | console_lock(); |
| 2151 | vc = tty->driver_data; | 2151 | vc = tty->driver_data; |
| 2152 | if (vc == NULL) { | 2152 | if (vc == NULL) { |
| 2153 | printk(KERN_ERR "vt: argh, driver_data is NULL !\n"); | 2153 | printk(KERN_ERR "vt: argh, driver_data is NULL !\n"); |
| 2154 | release_console_sem(); | 2154 | console_unlock(); |
| 2155 | return 0; | 2155 | return 0; |
| 2156 | } | 2156 | } |
| 2157 | 2157 | ||
| @@ -2159,7 +2159,7 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co | |||
| 2159 | if (!vc_cons_allocated(currcons)) { | 2159 | if (!vc_cons_allocated(currcons)) { |
| 2160 | /* could this happen? */ | 2160 | /* could this happen? */ |
| 2161 | printk_once("con_write: tty %d not allocated\n", currcons+1); | 2161 | printk_once("con_write: tty %d not allocated\n", currcons+1); |
| 2162 | release_console_sem(); | 2162 | console_unlock(); |
| 2163 | return 0; | 2163 | return 0; |
| 2164 | } | 2164 | } |
| 2165 | 2165 | ||
| @@ -2375,7 +2375,7 @@ rescan_last_byte: | |||
| 2375 | } | 2375 | } |
| 2376 | FLUSH | 2376 | FLUSH |
| 2377 | console_conditional_schedule(); | 2377 | console_conditional_schedule(); |
| 2378 | release_console_sem(); | 2378 | console_unlock(); |
| 2379 | notify_update(vc); | 2379 | notify_update(vc); |
| 2380 | return n; | 2380 | return n; |
| 2381 | #undef FLUSH | 2381 | #undef FLUSH |
| @@ -2388,11 +2388,11 @@ rescan_last_byte: | |||
| 2388 | * us to do the switches asynchronously (needed when we want | 2388 | * us to do the switches asynchronously (needed when we want |
| 2389 | * to switch due to a keyboard interrupt). Synchronization | 2389 | * to switch due to a keyboard interrupt). Synchronization |
| 2390 | * with other console code and prevention of re-entrancy is | 2390 | * with other console code and prevention of re-entrancy is |
| 2391 | * ensured with console_sem. | 2391 | * ensured with console_lock. |
| 2392 | */ | 2392 | */ |
| 2393 | static void console_callback(struct work_struct *ignored) | 2393 | static void console_callback(struct work_struct *ignored) |
| 2394 | { | 2394 | { |
| 2395 | acquire_console_sem(); | 2395 | console_lock(); |
| 2396 | 2396 | ||
| 2397 | if (want_console >= 0) { | 2397 | if (want_console >= 0) { |
| 2398 | if (want_console != fg_console && | 2398 | if (want_console != fg_console && |
| @@ -2422,7 +2422,7 @@ static void console_callback(struct work_struct *ignored) | |||
| 2422 | } | 2422 | } |
| 2423 | notify_update(vc_cons[fg_console].d); | 2423 | notify_update(vc_cons[fg_console].d); |
| 2424 | 2424 | ||
| 2425 | release_console_sem(); | 2425 | console_unlock(); |
| 2426 | } | 2426 | } |
| 2427 | 2427 | ||
| 2428 | int set_console(int nr) | 2428 | int set_console(int nr) |
| @@ -2603,7 +2603,7 @@ static struct console vt_console_driver = { | |||
| 2603 | */ | 2603 | */ |
| 2604 | 2604 | ||
| 2605 | /* | 2605 | /* |
| 2606 | * Generally a bit racy with respect to console_sem(). | 2606 | * Generally a bit racy with respect to console_lock();. |
| 2607 | * | 2607 | * |
| 2608 | * There are some functions which don't need it. | 2608 | * There are some functions which don't need it. |
| 2609 | * | 2609 | * |
| @@ -2629,17 +2629,17 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) | |||
| 2629 | switch (type) | 2629 | switch (type) |
| 2630 | { | 2630 | { |
| 2631 | case TIOCL_SETSEL: | 2631 | case TIOCL_SETSEL: |
| 2632 | acquire_console_sem(); | 2632 | console_lock(); |
| 2633 | ret = set_selection((struct tiocl_selection __user *)(p+1), tty); | 2633 | ret = set_selection((struct tiocl_selection __user *)(p+1), tty); |
| 2634 | release_console_sem(); | 2634 | console_unlock(); |
| 2635 | break; | 2635 | break; |
| 2636 | case TIOCL_PASTESEL: | 2636 | case TIOCL_PASTESEL: |
| 2637 | ret = paste_selection(tty); | 2637 | ret = paste_selection(tty); |
| 2638 | break; | 2638 | break; |
| 2639 | case TIOCL_UNBLANKSCREEN: | 2639 | case TIOCL_UNBLANKSCREEN: |
| 2640 | acquire_console_sem(); | 2640 | console_lock(); |
| 2641 | unblank_screen(); | 2641 | unblank_screen(); |
| 2642 | release_console_sem(); | 2642 | console_unlock(); |
| 2643 | break; | 2643 | break; |
| 2644 | case TIOCL_SELLOADLUT: | 2644 | case TIOCL_SELLOADLUT: |
| 2645 | ret = sel_loadlut(p); | 2645 | ret = sel_loadlut(p); |
| @@ -2688,10 +2688,10 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) | |||
| 2688 | } | 2688 | } |
| 2689 | break; | 2689 | break; |
| 2690 | case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */ | 2690 | case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */ |
| 2691 | acquire_console_sem(); | 2691 | console_lock(); |
| 2692 | ignore_poke = 1; | 2692 | ignore_poke = 1; |
| 2693 | do_blank_screen(0); | 2693 | do_blank_screen(0); |
| 2694 | release_console_sem(); | 2694 | console_unlock(); |
| 2695 | break; | 2695 | break; |
| 2696 | case TIOCL_BLANKEDSCREEN: | 2696 | case TIOCL_BLANKEDSCREEN: |
| 2697 | ret = console_blanked; | 2697 | ret = console_blanked; |
| @@ -2790,11 +2790,11 @@ static void con_flush_chars(struct tty_struct *tty) | |||
| 2790 | return; | 2790 | return; |
| 2791 | 2791 | ||
| 2792 | /* if we race with con_close(), vt may be null */ | 2792 | /* if we race with con_close(), vt may be null */ |
| 2793 | acquire_console_sem(); | 2793 | console_lock(); |
| 2794 | vc = tty->driver_data; | 2794 | vc = tty->driver_data; |
| 2795 | if (vc) | 2795 | if (vc) |
| 2796 | set_cursor(vc); | 2796 | set_cursor(vc); |
| 2797 | release_console_sem(); | 2797 | console_unlock(); |
| 2798 | } | 2798 | } |
| 2799 | 2799 | ||
| 2800 | /* | 2800 | /* |
| @@ -2805,7 +2805,7 @@ static int con_open(struct tty_struct *tty, struct file *filp) | |||
| 2805 | unsigned int currcons = tty->index; | 2805 | unsigned int currcons = tty->index; |
| 2806 | int ret = 0; | 2806 | int ret = 0; |
| 2807 | 2807 | ||
| 2808 | acquire_console_sem(); | 2808 | console_lock(); |
| 2809 | if (tty->driver_data == NULL) { | 2809 | if (tty->driver_data == NULL) { |
| 2810 | ret = vc_allocate(currcons); | 2810 | ret = vc_allocate(currcons); |
| 2811 | if (ret == 0) { | 2811 | if (ret == 0) { |
| @@ -2813,7 +2813,7 @@ static int con_open(struct tty_struct *tty, struct file *filp) | |||
| 2813 | 2813 | ||
| 2814 | /* Still being freed */ | 2814 | /* Still being freed */ |
| 2815 | if (vc->port.tty) { | 2815 | if (vc->port.tty) { |
| 2816 | release_console_sem(); | 2816 | console_unlock(); |
| 2817 | return -ERESTARTSYS; | 2817 | return -ERESTARTSYS; |
| 2818 | } | 2818 | } |
| 2819 | tty->driver_data = vc; | 2819 | tty->driver_data = vc; |
| @@ -2827,11 +2827,11 @@ static int con_open(struct tty_struct *tty, struct file *filp) | |||
| 2827 | tty->termios->c_iflag |= IUTF8; | 2827 | tty->termios->c_iflag |= IUTF8; |
| 2828 | else | 2828 | else |
| 2829 | tty->termios->c_iflag &= ~IUTF8; | 2829 | tty->termios->c_iflag &= ~IUTF8; |
| 2830 | release_console_sem(); | 2830 | console_unlock(); |
| 2831 | return ret; | 2831 | return ret; |
| 2832 | } | 2832 | } |
| 2833 | } | 2833 | } |
| 2834 | release_console_sem(); | 2834 | console_unlock(); |
| 2835 | return ret; | 2835 | return ret; |
| 2836 | } | 2836 | } |
| 2837 | 2837 | ||
| @@ -2844,9 +2844,9 @@ static void con_shutdown(struct tty_struct *tty) | |||
| 2844 | { | 2844 | { |
| 2845 | struct vc_data *vc = tty->driver_data; | 2845 | struct vc_data *vc = tty->driver_data; |
| 2846 | BUG_ON(vc == NULL); | 2846 | BUG_ON(vc == NULL); |
| 2847 | acquire_console_sem(); | 2847 | console_lock(); |
| 2848 | vc->port.tty = NULL; | 2848 | vc->port.tty = NULL; |
| 2849 | release_console_sem(); | 2849 | console_unlock(); |
| 2850 | tty_shutdown(tty); | 2850 | tty_shutdown(tty); |
| 2851 | } | 2851 | } |
| 2852 | 2852 | ||
| @@ -2893,13 +2893,13 @@ static int __init con_init(void) | |||
| 2893 | struct vc_data *vc; | 2893 | struct vc_data *vc; |
| 2894 | unsigned int currcons = 0, i; | 2894 | unsigned int currcons = 0, i; |
| 2895 | 2895 | ||
| 2896 | acquire_console_sem(); | 2896 | console_lock(); |
| 2897 | 2897 | ||
| 2898 | if (conswitchp) | 2898 | if (conswitchp) |
| 2899 | display_desc = conswitchp->con_startup(); | 2899 | display_desc = conswitchp->con_startup(); |
| 2900 | if (!display_desc) { | 2900 | if (!display_desc) { |
| 2901 | fg_console = 0; | 2901 | fg_console = 0; |
| 2902 | release_console_sem(); | 2902 | console_unlock(); |
| 2903 | return 0; | 2903 | return 0; |
| 2904 | } | 2904 | } |
| 2905 | 2905 | ||
| @@ -2946,7 +2946,7 @@ static int __init con_init(void) | |||
| 2946 | printable = 1; | 2946 | printable = 1; |
| 2947 | printk("\n"); | 2947 | printk("\n"); |
| 2948 | 2948 | ||
| 2949 | release_console_sem(); | 2949 | console_unlock(); |
| 2950 | 2950 | ||
| 2951 | #ifdef CONFIG_VT_CONSOLE | 2951 | #ifdef CONFIG_VT_CONSOLE |
| 2952 | register_console(&vt_console_driver); | 2952 | register_console(&vt_console_driver); |
| @@ -3037,7 +3037,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last, | |||
| 3037 | if (!try_module_get(owner)) | 3037 | if (!try_module_get(owner)) |
| 3038 | return -ENODEV; | 3038 | return -ENODEV; |
| 3039 | 3039 | ||
| 3040 | acquire_console_sem(); | 3040 | console_lock(); |
| 3041 | 3041 | ||
| 3042 | /* check if driver is registered */ | 3042 | /* check if driver is registered */ |
| 3043 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { | 3043 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { |
| @@ -3122,7 +3122,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last, | |||
| 3122 | 3122 | ||
| 3123 | retval = 0; | 3123 | retval = 0; |
| 3124 | err: | 3124 | err: |
| 3125 | release_console_sem(); | 3125 | console_unlock(); |
| 3126 | module_put(owner); | 3126 | module_put(owner); |
| 3127 | return retval; | 3127 | return retval; |
| 3128 | }; | 3128 | }; |
| @@ -3171,7 +3171,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) | |||
| 3171 | if (!try_module_get(owner)) | 3171 | if (!try_module_get(owner)) |
| 3172 | return -ENODEV; | 3172 | return -ENODEV; |
| 3173 | 3173 | ||
| 3174 | acquire_console_sem(); | 3174 | console_lock(); |
| 3175 | 3175 | ||
| 3176 | /* check if driver is registered and if it is unbindable */ | 3176 | /* check if driver is registered and if it is unbindable */ |
| 3177 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { | 3177 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { |
| @@ -3185,7 +3185,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) | |||
| 3185 | } | 3185 | } |
| 3186 | 3186 | ||
| 3187 | if (retval) { | 3187 | if (retval) { |
| 3188 | release_console_sem(); | 3188 | console_unlock(); |
| 3189 | goto err; | 3189 | goto err; |
| 3190 | } | 3190 | } |
| 3191 | 3191 | ||
| @@ -3204,12 +3204,12 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) | |||
| 3204 | } | 3204 | } |
| 3205 | 3205 | ||
| 3206 | if (retval) { | 3206 | if (retval) { |
| 3207 | release_console_sem(); | 3207 | console_unlock(); |
| 3208 | goto err; | 3208 | goto err; |
| 3209 | } | 3209 | } |
| 3210 | 3210 | ||
| 3211 | if (!con_is_bound(csw)) { | 3211 | if (!con_is_bound(csw)) { |
| 3212 | release_console_sem(); | 3212 | console_unlock(); |
| 3213 | goto err; | 3213 | goto err; |
| 3214 | } | 3214 | } |
| 3215 | 3215 | ||
| @@ -3238,7 +3238,7 @@ int unbind_con_driver(const struct consw *csw, int first, int last, int deflt) | |||
| 3238 | if (!con_is_bound(csw)) | 3238 | if (!con_is_bound(csw)) |
| 3239 | con_driver->flag &= ~CON_DRIVER_FLAG_INIT; | 3239 | con_driver->flag &= ~CON_DRIVER_FLAG_INIT; |
| 3240 | 3240 | ||
| 3241 | release_console_sem(); | 3241 | console_unlock(); |
| 3242 | /* ignore return value, binding should not fail */ | 3242 | /* ignore return value, binding should not fail */ |
| 3243 | bind_con_driver(defcsw, first, last, deflt); | 3243 | bind_con_driver(defcsw, first, last, deflt); |
| 3244 | err: | 3244 | err: |
| @@ -3538,7 +3538,7 @@ int register_con_driver(const struct consw *csw, int first, int last) | |||
| 3538 | if (!try_module_get(owner)) | 3538 | if (!try_module_get(owner)) |
| 3539 | return -ENODEV; | 3539 | return -ENODEV; |
| 3540 | 3540 | ||
| 3541 | acquire_console_sem(); | 3541 | console_lock(); |
| 3542 | 3542 | ||
| 3543 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { | 3543 | for (i = 0; i < MAX_NR_CON_DRIVER; i++) { |
| 3544 | con_driver = ®istered_con_driver[i]; | 3544 | con_driver = ®istered_con_driver[i]; |
| @@ -3592,7 +3592,7 @@ int register_con_driver(const struct consw *csw, int first, int last) | |||
| 3592 | } | 3592 | } |
| 3593 | 3593 | ||
| 3594 | err: | 3594 | err: |
| 3595 | release_console_sem(); | 3595 | console_unlock(); |
| 3596 | module_put(owner); | 3596 | module_put(owner); |
| 3597 | return retval; | 3597 | return retval; |
| 3598 | } | 3598 | } |
| @@ -3613,7 +3613,7 @@ int unregister_con_driver(const struct consw *csw) | |||
| 3613 | { | 3613 | { |
| 3614 | int i, retval = -ENODEV; | 3614 | int i, retval = -ENODEV; |
| 3615 | 3615 | ||
| 3616 | acquire_console_sem(); | 3616 | console_lock(); |
| 3617 | 3617 | ||
| 3618 | /* cannot unregister a bound driver */ | 3618 | /* cannot unregister a bound driver */ |
| 3619 | if (con_is_bound(csw)) | 3619 | if (con_is_bound(csw)) |
| @@ -3639,7 +3639,7 @@ int unregister_con_driver(const struct consw *csw) | |||
| 3639 | } | 3639 | } |
| 3640 | } | 3640 | } |
| 3641 | err: | 3641 | err: |
| 3642 | release_console_sem(); | 3642 | console_unlock(); |
| 3643 | return retval; | 3643 | return retval; |
| 3644 | } | 3644 | } |
| 3645 | EXPORT_SYMBOL(unregister_con_driver); | 3645 | EXPORT_SYMBOL(unregister_con_driver); |
| @@ -3934,9 +3934,9 @@ int con_set_cmap(unsigned char __user *arg) | |||
| 3934 | { | 3934 | { |
| 3935 | int rc; | 3935 | int rc; |
| 3936 | 3936 | ||
| 3937 | acquire_console_sem(); | 3937 | console_lock(); |
| 3938 | rc = set_get_cmap (arg,1); | 3938 | rc = set_get_cmap (arg,1); |
| 3939 | release_console_sem(); | 3939 | console_unlock(); |
| 3940 | 3940 | ||
| 3941 | return rc; | 3941 | return rc; |
| 3942 | } | 3942 | } |
| @@ -3945,9 +3945,9 @@ int con_get_cmap(unsigned char __user *arg) | |||
| 3945 | { | 3945 | { |
| 3946 | int rc; | 3946 | int rc; |
| 3947 | 3947 | ||
| 3948 | acquire_console_sem(); | 3948 | console_lock(); |
| 3949 | rc = set_get_cmap (arg,0); | 3949 | rc = set_get_cmap (arg,0); |
| 3950 | release_console_sem(); | 3950 | console_unlock(); |
| 3951 | 3951 | ||
| 3952 | return rc; | 3952 | return rc; |
| 3953 | } | 3953 | } |
| @@ -3994,12 +3994,12 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op) | |||
| 3994 | } else | 3994 | } else |
| 3995 | font.data = NULL; | 3995 | font.data = NULL; |
| 3996 | 3996 | ||
| 3997 | acquire_console_sem(); | 3997 | console_lock(); |
| 3998 | if (vc->vc_sw->con_font_get) | 3998 | if (vc->vc_sw->con_font_get) |
| 3999 | rc = vc->vc_sw->con_font_get(vc, &font); | 3999 | rc = vc->vc_sw->con_font_get(vc, &font); |
| 4000 | else | 4000 | else |
| 4001 | rc = -ENOSYS; | 4001 | rc = -ENOSYS; |
| 4002 | release_console_sem(); | 4002 | console_unlock(); |
| 4003 | 4003 | ||
| 4004 | if (rc) | 4004 | if (rc) |
| 4005 | goto out; | 4005 | goto out; |
| @@ -4076,12 +4076,12 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op) | |||
| 4076 | font.data = memdup_user(op->data, size); | 4076 | font.data = memdup_user(op->data, size); |
| 4077 | if (IS_ERR(font.data)) | 4077 | if (IS_ERR(font.data)) |
| 4078 | return PTR_ERR(font.data); | 4078 | return PTR_ERR(font.data); |
| 4079 | acquire_console_sem(); | 4079 | console_lock(); |
| 4080 | if (vc->vc_sw->con_font_set) | 4080 | if (vc->vc_sw->con_font_set) |
| 4081 | rc = vc->vc_sw->con_font_set(vc, &font, op->flags); | 4081 | rc = vc->vc_sw->con_font_set(vc, &font, op->flags); |
| 4082 | else | 4082 | else |
| 4083 | rc = -ENOSYS; | 4083 | rc = -ENOSYS; |
| 4084 | release_console_sem(); | 4084 | console_unlock(); |
| 4085 | kfree(font.data); | 4085 | kfree(font.data); |
| 4086 | return rc; | 4086 | return rc; |
| 4087 | } | 4087 | } |
| @@ -4103,12 +4103,12 @@ static int con_font_default(struct vc_data *vc, struct console_font_op *op) | |||
| 4103 | else | 4103 | else |
| 4104 | name[MAX_FONT_NAME - 1] = 0; | 4104 | name[MAX_FONT_NAME - 1] = 0; |
| 4105 | 4105 | ||
| 4106 | acquire_console_sem(); | 4106 | console_lock(); |
| 4107 | if (vc->vc_sw->con_font_default) | 4107 | if (vc->vc_sw->con_font_default) |
| 4108 | rc = vc->vc_sw->con_font_default(vc, &font, s); | 4108 | rc = vc->vc_sw->con_font_default(vc, &font, s); |
| 4109 | else | 4109 | else |
| 4110 | rc = -ENOSYS; | 4110 | rc = -ENOSYS; |
| 4111 | release_console_sem(); | 4111 | console_unlock(); |
| 4112 | if (!rc) { | 4112 | if (!rc) { |
| 4113 | op->width = font.width; | 4113 | op->width = font.width; |
| 4114 | op->height = font.height; | 4114 | op->height = font.height; |
| @@ -4124,7 +4124,7 @@ static int con_font_copy(struct vc_data *vc, struct console_font_op *op) | |||
| 4124 | if (vc->vc_mode != KD_TEXT) | 4124 | if (vc->vc_mode != KD_TEXT) |
| 4125 | return -EINVAL; | 4125 | return -EINVAL; |
| 4126 | 4126 | ||
| 4127 | acquire_console_sem(); | 4127 | console_lock(); |
| 4128 | if (!vc->vc_sw->con_font_copy) | 4128 | if (!vc->vc_sw->con_font_copy) |
| 4129 | rc = -ENOSYS; | 4129 | rc = -ENOSYS; |
| 4130 | else if (con < 0 || !vc_cons_allocated(con)) | 4130 | else if (con < 0 || !vc_cons_allocated(con)) |
| @@ -4133,7 +4133,7 @@ static int con_font_copy(struct vc_data *vc, struct console_font_op *op) | |||
| 4133 | rc = 0; | 4133 | rc = 0; |
| 4134 | else | 4134 | else |
| 4135 | rc = vc->vc_sw->con_font_copy(vc, con); | 4135 | rc = vc->vc_sw->con_font_copy(vc, con); |
| 4136 | release_console_sem(); | 4136 | console_unlock(); |
| 4137 | return rc; | 4137 | return rc; |
| 4138 | } | 4138 | } |
| 4139 | 4139 | ||
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c index 6b68a0fb461..1235ebda6e1 100644 --- a/drivers/tty/vt/vt_ioctl.c +++ b/drivers/tty/vt/vt_ioctl.c | |||
| @@ -649,12 +649,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 649 | /* | 649 | /* |
| 650 | * explicitly blank/unblank the screen if switching modes | 650 | * explicitly blank/unblank the screen if switching modes |
| 651 | */ | 651 | */ |
| 652 | acquire_console_sem(); | 652 | console_lock(); |
| 653 | if (arg == KD_TEXT) | 653 | if (arg == KD_TEXT) |
| 654 | do_unblank_screen(1); | 654 | do_unblank_screen(1); |
| 655 | else | 655 | else |
| 656 | do_blank_screen(1); | 656 | do_blank_screen(1); |
| 657 | release_console_sem(); | 657 | console_unlock(); |
| 658 | break; | 658 | break; |
| 659 | 659 | ||
| 660 | case KDGETMODE: | 660 | case KDGETMODE: |
| @@ -893,7 +893,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 893 | ret = -EINVAL; | 893 | ret = -EINVAL; |
| 894 | goto out; | 894 | goto out; |
| 895 | } | 895 | } |
| 896 | acquire_console_sem(); | 896 | console_lock(); |
| 897 | vc->vt_mode = tmp; | 897 | vc->vt_mode = tmp; |
| 898 | /* the frsig is ignored, so we set it to 0 */ | 898 | /* the frsig is ignored, so we set it to 0 */ |
| 899 | vc->vt_mode.frsig = 0; | 899 | vc->vt_mode.frsig = 0; |
| @@ -901,7 +901,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 901 | vc->vt_pid = get_pid(task_pid(current)); | 901 | vc->vt_pid = get_pid(task_pid(current)); |
| 902 | /* no switch is required -- saw@shade.msu.ru */ | 902 | /* no switch is required -- saw@shade.msu.ru */ |
| 903 | vc->vt_newvt = -1; | 903 | vc->vt_newvt = -1; |
| 904 | release_console_sem(); | 904 | console_unlock(); |
| 905 | break; | 905 | break; |
| 906 | } | 906 | } |
| 907 | 907 | ||
| @@ -910,9 +910,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 910 | struct vt_mode tmp; | 910 | struct vt_mode tmp; |
| 911 | int rc; | 911 | int rc; |
| 912 | 912 | ||
| 913 | acquire_console_sem(); | 913 | console_lock(); |
| 914 | memcpy(&tmp, &vc->vt_mode, sizeof(struct vt_mode)); | 914 | memcpy(&tmp, &vc->vt_mode, sizeof(struct vt_mode)); |
| 915 | release_console_sem(); | 915 | console_unlock(); |
| 916 | 916 | ||
| 917 | rc = copy_to_user(up, &tmp, sizeof(struct vt_mode)); | 917 | rc = copy_to_user(up, &tmp, sizeof(struct vt_mode)); |
| 918 | if (rc) | 918 | if (rc) |
| @@ -965,9 +965,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 965 | ret = -ENXIO; | 965 | ret = -ENXIO; |
| 966 | else { | 966 | else { |
| 967 | arg--; | 967 | arg--; |
| 968 | acquire_console_sem(); | 968 | console_lock(); |
| 969 | ret = vc_allocate(arg); | 969 | ret = vc_allocate(arg); |
| 970 | release_console_sem(); | 970 | console_unlock(); |
| 971 | if (ret) | 971 | if (ret) |
| 972 | break; | 972 | break; |
| 973 | set_console(arg); | 973 | set_console(arg); |
| @@ -990,7 +990,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 990 | ret = -ENXIO; | 990 | ret = -ENXIO; |
| 991 | else { | 991 | else { |
| 992 | vsa.console--; | 992 | vsa.console--; |
| 993 | acquire_console_sem(); | 993 | console_lock(); |
| 994 | ret = vc_allocate(vsa.console); | 994 | ret = vc_allocate(vsa.console); |
| 995 | if (ret == 0) { | 995 | if (ret == 0) { |
| 996 | struct vc_data *nvc; | 996 | struct vc_data *nvc; |
| @@ -1003,7 +1003,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 1003 | put_pid(nvc->vt_pid); | 1003 | put_pid(nvc->vt_pid); |
| 1004 | nvc->vt_pid = get_pid(task_pid(current)); | 1004 | nvc->vt_pid = get_pid(task_pid(current)); |
| 1005 | } | 1005 | } |
| 1006 | release_console_sem(); | 1006 | console_unlock(); |
| 1007 | if (ret) | 1007 | if (ret) |
| 1008 | break; | 1008 | break; |
| 1009 | /* Commence switch and lock */ | 1009 | /* Commence switch and lock */ |
| @@ -1044,7 +1044,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 1044 | /* | 1044 | /* |
| 1045 | * Switching-from response | 1045 | * Switching-from response |
| 1046 | */ | 1046 | */ |
| 1047 | acquire_console_sem(); | 1047 | console_lock(); |
| 1048 | if (vc->vt_newvt >= 0) { | 1048 | if (vc->vt_newvt >= 0) { |
| 1049 | if (arg == 0) | 1049 | if (arg == 0) |
| 1050 | /* | 1050 | /* |
| @@ -1063,7 +1063,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 1063 | vc->vt_newvt = -1; | 1063 | vc->vt_newvt = -1; |
| 1064 | ret = vc_allocate(newvt); | 1064 | ret = vc_allocate(newvt); |
| 1065 | if (ret) { | 1065 | if (ret) { |
| 1066 | release_console_sem(); | 1066 | console_unlock(); |
| 1067 | break; | 1067 | break; |
| 1068 | } | 1068 | } |
| 1069 | /* | 1069 | /* |
| @@ -1083,7 +1083,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 1083 | if (arg != VT_ACKACQ) | 1083 | if (arg != VT_ACKACQ) |
| 1084 | ret = -EINVAL; | 1084 | ret = -EINVAL; |
| 1085 | } | 1085 | } |
| 1086 | release_console_sem(); | 1086 | console_unlock(); |
| 1087 | break; | 1087 | break; |
| 1088 | 1088 | ||
| 1089 | /* | 1089 | /* |
| @@ -1096,20 +1096,20 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 1096 | } | 1096 | } |
| 1097 | if (arg == 0) { | 1097 | if (arg == 0) { |
| 1098 | /* deallocate all unused consoles, but leave 0 */ | 1098 | /* deallocate all unused consoles, but leave 0 */ |
| 1099 | acquire_console_sem(); | 1099 | console_lock(); |
| 1100 | for (i=1; i<MAX_NR_CONSOLES; i++) | 1100 | for (i=1; i<MAX_NR_CONSOLES; i++) |
| 1101 | if (! VT_BUSY(i)) | 1101 | if (! VT_BUSY(i)) |
| 1102 | vc_deallocate(i); | 1102 | vc_deallocate(i); |
| 1103 | release_console_sem(); | 1103 | console_unlock(); |
| 1104 | } else { | 1104 | } else { |
| 1105 | /* deallocate a single console, if possible */ | 1105 | /* deallocate a single console, if possible */ |
| 1106 | arg--; | 1106 | arg--; |
| 1107 | if (VT_BUSY(arg)) | 1107 | if (VT_BUSY(arg)) |
| 1108 | ret = -EBUSY; | 1108 | ret = -EBUSY; |
| 1109 | else if (arg) { /* leave 0 */ | 1109 | else if (arg) { /* leave 0 */ |
| 1110 | acquire_console_sem(); | 1110 | console_lock(); |
| 1111 | vc_deallocate(arg); | 1111 | vc_deallocate(arg); |
| 1112 | release_console_sem(); | 1112 | console_unlock(); |
| 1113 | } | 1113 | } |
| 1114 | } | 1114 | } |
| 1115 | break; | 1115 | break; |
| @@ -1126,7 +1126,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 1126 | get_user(cc, &vtsizes->v_cols)) | 1126 | get_user(cc, &vtsizes->v_cols)) |
| 1127 | ret = -EFAULT; | 1127 | ret = -EFAULT; |
| 1128 | else { | 1128 | else { |
| 1129 | acquire_console_sem(); | 1129 | console_lock(); |
| 1130 | for (i = 0; i < MAX_NR_CONSOLES; i++) { | 1130 | for (i = 0; i < MAX_NR_CONSOLES; i++) { |
| 1131 | vc = vc_cons[i].d; | 1131 | vc = vc_cons[i].d; |
| 1132 | 1132 | ||
| @@ -1135,7 +1135,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 1135 | vc_resize(vc_cons[i].d, cc, ll); | 1135 | vc_resize(vc_cons[i].d, cc, ll); |
| 1136 | } | 1136 | } |
| 1137 | } | 1137 | } |
| 1138 | release_console_sem(); | 1138 | console_unlock(); |
| 1139 | } | 1139 | } |
| 1140 | break; | 1140 | break; |
| 1141 | } | 1141 | } |
| @@ -1187,14 +1187,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 1187 | for (i = 0; i < MAX_NR_CONSOLES; i++) { | 1187 | for (i = 0; i < MAX_NR_CONSOLES; i++) { |
| 1188 | if (!vc_cons[i].d) | 1188 | if (!vc_cons[i].d) |
| 1189 | continue; | 1189 | continue; |
| 1190 | acquire_console_sem(); | 1190 | console_lock(); |
| 1191 | if (vlin) | 1191 | if (vlin) |
| 1192 | vc_cons[i].d->vc_scan_lines = vlin; | 1192 | vc_cons[i].d->vc_scan_lines = vlin; |
| 1193 | if (clin) | 1193 | if (clin) |
| 1194 | vc_cons[i].d->vc_font.height = clin; | 1194 | vc_cons[i].d->vc_font.height = clin; |
| 1195 | vc_cons[i].d->vc_resize_user = 1; | 1195 | vc_cons[i].d->vc_resize_user = 1; |
| 1196 | vc_resize(vc_cons[i].d, cc, ll); | 1196 | vc_resize(vc_cons[i].d, cc, ll); |
| 1197 | release_console_sem(); | 1197 | console_unlock(); |
| 1198 | } | 1198 | } |
| 1199 | break; | 1199 | break; |
| 1200 | } | 1200 | } |
| @@ -1367,7 +1367,7 @@ void vc_SAK(struct work_struct *work) | |||
| 1367 | struct vc_data *vc; | 1367 | struct vc_data *vc; |
| 1368 | struct tty_struct *tty; | 1368 | struct tty_struct *tty; |
| 1369 | 1369 | ||
| 1370 | acquire_console_sem(); | 1370 | console_lock(); |
| 1371 | vc = vc_con->d; | 1371 | vc = vc_con->d; |
| 1372 | if (vc) { | 1372 | if (vc) { |
| 1373 | tty = vc->port.tty; | 1373 | tty = vc->port.tty; |
| @@ -1379,7 +1379,7 @@ void vc_SAK(struct work_struct *work) | |||
| 1379 | __do_SAK(tty); | 1379 | __do_SAK(tty); |
| 1380 | reset_vc(vc); | 1380 | reset_vc(vc); |
| 1381 | } | 1381 | } |
| 1382 | release_console_sem(); | 1382 | console_unlock(); |
| 1383 | } | 1383 | } |
| 1384 | 1384 | ||
| 1385 | #ifdef CONFIG_COMPAT | 1385 | #ifdef CONFIG_COMPAT |
| @@ -1737,10 +1737,10 @@ int vt_move_to_console(unsigned int vt, int alloc) | |||
| 1737 | { | 1737 | { |
| 1738 | int prev; | 1738 | int prev; |
| 1739 | 1739 | ||
| 1740 | acquire_console_sem(); | 1740 | console_lock(); |
| 1741 | /* Graphics mode - up to X */ | 1741 | /* Graphics mode - up to X */ |
| 1742 | if (disable_vt_switch) { | 1742 | if (disable_vt_switch) { |
| 1743 | release_console_sem(); | 1743 | console_unlock(); |
| 1744 | return 0; | 1744 | return 0; |
| 1745 | } | 1745 | } |
| 1746 | prev = fg_console; | 1746 | prev = fg_console; |
| @@ -1748,7 +1748,7 @@ int vt_move_to_console(unsigned int vt, int alloc) | |||
| 1748 | if (alloc && vc_allocate(vt)) { | 1748 | if (alloc && vc_allocate(vt)) { |
| 1749 | /* we can't have a free VC for now. Too bad, | 1749 | /* we can't have a free VC for now. Too bad, |
| 1750 | * we don't want to mess the screen for now. */ | 1750 | * we don't want to mess the screen for now. */ |
| 1751 | release_console_sem(); | 1751 | console_unlock(); |
| 1752 | return -ENOSPC; | 1752 | return -ENOSPC; |
| 1753 | } | 1753 | } |
| 1754 | 1754 | ||
| @@ -1758,10 +1758,10 @@ int vt_move_to_console(unsigned int vt, int alloc) | |||
| 1758 | * Let the calling function know so it can decide | 1758 | * Let the calling function know so it can decide |
| 1759 | * what to do. | 1759 | * what to do. |
| 1760 | */ | 1760 | */ |
| 1761 | release_console_sem(); | 1761 | console_unlock(); |
| 1762 | return -EIO; | 1762 | return -EIO; |
| 1763 | } | 1763 | } |
| 1764 | release_console_sem(); | 1764 | console_unlock(); |
| 1765 | tty_lock(); | 1765 | tty_lock(); |
| 1766 | if (vt_waitactive(vt + 1)) { | 1766 | if (vt_waitactive(vt + 1)) { |
| 1767 | pr_debug("Suspend: Can't switch VCs."); | 1767 | pr_debug("Suspend: Can't switch VCs."); |
| @@ -1781,8 +1781,8 @@ int vt_move_to_console(unsigned int vt, int alloc) | |||
| 1781 | */ | 1781 | */ |
| 1782 | void pm_set_vt_switch(int do_switch) | 1782 | void pm_set_vt_switch(int do_switch) |
| 1783 | { | 1783 | { |
| 1784 | acquire_console_sem(); | 1784 | console_lock(); |
| 1785 | disable_vt_switch = !do_switch; | 1785 | disable_vt_switch = !do_switch; |
| 1786 | release_console_sem(); | 1786 | console_unlock(); |
| 1787 | } | 1787 | } |
| 1788 | EXPORT_SYMBOL(pm_set_vt_switch); | 1788 | EXPORT_SYMBOL(pm_set_vt_switch); |
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c index d583bea608f..391ac939f01 100644 --- a/drivers/video/arkfb.c +++ b/drivers/video/arkfb.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #include <linux/svga.h> | 23 | #include <linux/svga.h> |
| 24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
| 25 | #include <linux/pci.h> | 25 | #include <linux/pci.h> |
| 26 | #include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */ | 26 | #include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */ |
| 27 | #include <video/vga.h> | 27 | #include <video/vga.h> |
| 28 | 28 | ||
| 29 | #ifdef CONFIG_MTRR | 29 | #ifdef CONFIG_MTRR |
| @@ -1091,12 +1091,12 @@ static int ark_pci_suspend (struct pci_dev* dev, pm_message_t state) | |||
| 1091 | 1091 | ||
| 1092 | dev_info(info->device, "suspend\n"); | 1092 | dev_info(info->device, "suspend\n"); |
| 1093 | 1093 | ||
| 1094 | acquire_console_sem(); | 1094 | console_lock(); |
| 1095 | mutex_lock(&(par->open_lock)); | 1095 | mutex_lock(&(par->open_lock)); |
| 1096 | 1096 | ||
| 1097 | if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { | 1097 | if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { |
| 1098 | mutex_unlock(&(par->open_lock)); | 1098 | mutex_unlock(&(par->open_lock)); |
| 1099 | release_console_sem(); | 1099 | console_unlock(); |
| 1100 | return 0; | 1100 | return 0; |
| 1101 | } | 1101 | } |
| 1102 | 1102 | ||
| @@ -1107,7 +1107,7 @@ static int ark_pci_suspend (struct pci_dev* dev, pm_message_t state) | |||
| 1107 | pci_set_power_state(dev, pci_choose_state(dev, state)); | 1107 | pci_set_power_state(dev, pci_choose_state(dev, state)); |
| 1108 | 1108 | ||
| 1109 | mutex_unlock(&(par->open_lock)); | 1109 | mutex_unlock(&(par->open_lock)); |
| 1110 | release_console_sem(); | 1110 | console_unlock(); |
| 1111 | 1111 | ||
| 1112 | return 0; | 1112 | return 0; |
| 1113 | } | 1113 | } |
| @@ -1122,7 +1122,7 @@ static int ark_pci_resume (struct pci_dev* dev) | |||
| 1122 | 1122 | ||
| 1123 | dev_info(info->device, "resume\n"); | 1123 | dev_info(info->device, "resume\n"); |
| 1124 | 1124 | ||
| 1125 | acquire_console_sem(); | 1125 | console_lock(); |
| 1126 | mutex_lock(&(par->open_lock)); | 1126 | mutex_lock(&(par->open_lock)); |
| 1127 | 1127 | ||
| 1128 | if (par->ref_count == 0) | 1128 | if (par->ref_count == 0) |
| @@ -1141,7 +1141,7 @@ static int ark_pci_resume (struct pci_dev* dev) | |||
| 1141 | 1141 | ||
| 1142 | fail: | 1142 | fail: |
| 1143 | mutex_unlock(&(par->open_lock)); | 1143 | mutex_unlock(&(par->open_lock)); |
| 1144 | release_console_sem(); | 1144 | console_unlock(); |
| 1145 | return 0; | 1145 | return 0; |
| 1146 | } | 1146 | } |
| 1147 | #else | 1147 | #else |
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index dd9de2e8058..4cb6a576c56 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
| @@ -1860,11 +1860,11 @@ static void aty128_early_resume(void *data) | |||
| 1860 | { | 1860 | { |
| 1861 | struct aty128fb_par *par = data; | 1861 | struct aty128fb_par *par = data; |
| 1862 | 1862 | ||
| 1863 | if (try_acquire_console_sem()) | 1863 | if (!console_trylock()) |
| 1864 | return; | 1864 | return; |
| 1865 | pci_restore_state(par->pdev); | 1865 | pci_restore_state(par->pdev); |
| 1866 | aty128_do_resume(par->pdev); | 1866 | aty128_do_resume(par->pdev); |
| 1867 | release_console_sem(); | 1867 | console_unlock(); |
| 1868 | } | 1868 | } |
| 1869 | #endif /* CONFIG_PPC_PMAC */ | 1869 | #endif /* CONFIG_PPC_PMAC */ |
| 1870 | 1870 | ||
| @@ -2438,7 +2438,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 2438 | 2438 | ||
| 2439 | printk(KERN_DEBUG "aty128fb: suspending...\n"); | 2439 | printk(KERN_DEBUG "aty128fb: suspending...\n"); |
| 2440 | 2440 | ||
| 2441 | acquire_console_sem(); | 2441 | console_lock(); |
| 2442 | 2442 | ||
| 2443 | fb_set_suspend(info, 1); | 2443 | fb_set_suspend(info, 1); |
| 2444 | 2444 | ||
| @@ -2470,7 +2470,7 @@ static int aty128_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 2470 | if (state.event != PM_EVENT_ON) | 2470 | if (state.event != PM_EVENT_ON) |
| 2471 | aty128_set_suspend(par, 1); | 2471 | aty128_set_suspend(par, 1); |
| 2472 | 2472 | ||
| 2473 | release_console_sem(); | 2473 | console_unlock(); |
| 2474 | 2474 | ||
| 2475 | pdev->dev.power.power_state = state; | 2475 | pdev->dev.power.power_state = state; |
| 2476 | 2476 | ||
| @@ -2527,9 +2527,9 @@ static int aty128_pci_resume(struct pci_dev *pdev) | |||
| 2527 | { | 2527 | { |
| 2528 | int rc; | 2528 | int rc; |
| 2529 | 2529 | ||
| 2530 | acquire_console_sem(); | 2530 | console_lock(); |
| 2531 | rc = aty128_do_resume(pdev); | 2531 | rc = aty128_do_resume(pdev); |
| 2532 | release_console_sem(); | 2532 | console_unlock(); |
| 2533 | 2533 | ||
| 2534 | return rc; | 2534 | return rc; |
| 2535 | } | 2535 | } |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 767ab4fb1a0..94e293fce1d 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
| @@ -2069,7 +2069,7 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 2069 | if (state.event == pdev->dev.power.power_state.event) | 2069 | if (state.event == pdev->dev.power.power_state.event) |
| 2070 | return 0; | 2070 | return 0; |
| 2071 | 2071 | ||
| 2072 | acquire_console_sem(); | 2072 | console_lock(); |
| 2073 | 2073 | ||
| 2074 | fb_set_suspend(info, 1); | 2074 | fb_set_suspend(info, 1); |
| 2075 | 2075 | ||
| @@ -2097,14 +2097,14 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 2097 | par->lock_blank = 0; | 2097 | par->lock_blank = 0; |
| 2098 | atyfb_blank(FB_BLANK_UNBLANK, info); | 2098 | atyfb_blank(FB_BLANK_UNBLANK, info); |
| 2099 | fb_set_suspend(info, 0); | 2099 | fb_set_suspend(info, 0); |
| 2100 | release_console_sem(); | 2100 | console_unlock(); |
| 2101 | return -EIO; | 2101 | return -EIO; |
| 2102 | } | 2102 | } |
| 2103 | #else | 2103 | #else |
| 2104 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 2104 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
| 2105 | #endif | 2105 | #endif |
| 2106 | 2106 | ||
| 2107 | release_console_sem(); | 2107 | console_unlock(); |
| 2108 | 2108 | ||
| 2109 | pdev->dev.power.power_state = state; | 2109 | pdev->dev.power.power_state = state; |
| 2110 | 2110 | ||
| @@ -2133,7 +2133,7 @@ static int atyfb_pci_resume(struct pci_dev *pdev) | |||
| 2133 | if (pdev->dev.power.power_state.event == PM_EVENT_ON) | 2133 | if (pdev->dev.power.power_state.event == PM_EVENT_ON) |
| 2134 | return 0; | 2134 | return 0; |
| 2135 | 2135 | ||
| 2136 | acquire_console_sem(); | 2136 | console_lock(); |
| 2137 | 2137 | ||
| 2138 | /* | 2138 | /* |
| 2139 | * PCI state will have been restored by the core, so | 2139 | * PCI state will have been restored by the core, so |
| @@ -2161,7 +2161,7 @@ static int atyfb_pci_resume(struct pci_dev *pdev) | |||
| 2161 | par->lock_blank = 0; | 2161 | par->lock_blank = 0; |
| 2162 | atyfb_blank(FB_BLANK_UNBLANK, info); | 2162 | atyfb_blank(FB_BLANK_UNBLANK, info); |
| 2163 | 2163 | ||
| 2164 | release_console_sem(); | 2164 | console_unlock(); |
| 2165 | 2165 | ||
| 2166 | pdev->dev.power.power_state = PMSG_ON; | 2166 | pdev->dev.power.power_state = PMSG_ON; |
| 2167 | 2167 | ||
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index c4e17642d9c..92bda584851 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c | |||
| @@ -2626,7 +2626,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
| 2626 | goto done; | 2626 | goto done; |
| 2627 | } | 2627 | } |
| 2628 | 2628 | ||
| 2629 | acquire_console_sem(); | 2629 | console_lock(); |
| 2630 | 2630 | ||
| 2631 | fb_set_suspend(info, 1); | 2631 | fb_set_suspend(info, 1); |
| 2632 | 2632 | ||
| @@ -2690,7 +2690,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg) | |||
| 2690 | if (rinfo->pm_mode & radeon_pm_d2) | 2690 | if (rinfo->pm_mode & radeon_pm_d2) |
| 2691 | radeon_set_suspend(rinfo, 1); | 2691 | radeon_set_suspend(rinfo, 1); |
| 2692 | 2692 | ||
| 2693 | release_console_sem(); | 2693 | console_unlock(); |
| 2694 | 2694 | ||
| 2695 | done: | 2695 | done: |
| 2696 | pdev->dev.power.power_state = mesg; | 2696 | pdev->dev.power.power_state = mesg; |
| @@ -2715,10 +2715,10 @@ int radeonfb_pci_resume(struct pci_dev *pdev) | |||
| 2715 | return 0; | 2715 | return 0; |
| 2716 | 2716 | ||
| 2717 | if (rinfo->no_schedule) { | 2717 | if (rinfo->no_schedule) { |
| 2718 | if (try_acquire_console_sem()) | 2718 | if (!console_trylock()) |
| 2719 | return 0; | 2719 | return 0; |
| 2720 | } else | 2720 | } else |
| 2721 | acquire_console_sem(); | 2721 | console_lock(); |
| 2722 | 2722 | ||
| 2723 | printk(KERN_DEBUG "radeonfb (%s): resuming from state: %d...\n", | 2723 | printk(KERN_DEBUG "radeonfb (%s): resuming from state: %d...\n", |
| 2724 | pci_name(pdev), pdev->dev.power.power_state.event); | 2724 | pci_name(pdev), pdev->dev.power.power_state.event); |
| @@ -2783,7 +2783,7 @@ int radeonfb_pci_resume(struct pci_dev *pdev) | |||
| 2783 | pdev->dev.power.power_state = PMSG_ON; | 2783 | pdev->dev.power.power_state = PMSG_ON; |
| 2784 | 2784 | ||
| 2785 | bail: | 2785 | bail: |
| 2786 | release_console_sem(); | 2786 | console_unlock(); |
| 2787 | 2787 | ||
| 2788 | return rc; | 2788 | return rc; |
| 2789 | } | 2789 | } |
diff --git a/drivers/video/bf537-lq035.c b/drivers/video/bf537-lq035.c index 18c507874ff..47c21fb2c82 100644 --- a/drivers/video/bf537-lq035.c +++ b/drivers/video/bf537-lq035.c | |||
| @@ -696,6 +696,7 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev) | |||
| 696 | { | 696 | { |
| 697 | struct backlight_properties props; | 697 | struct backlight_properties props; |
| 698 | dma_addr_t dma_handle; | 698 | dma_addr_t dma_handle; |
| 699 | int ret; | ||
| 699 | 700 | ||
| 700 | if (request_dma(CH_PPI, KBUILD_MODNAME)) { | 701 | if (request_dma(CH_PPI, KBUILD_MODNAME)) { |
| 701 | pr_err("couldn't request PPI DMA\n"); | 702 | pr_err("couldn't request PPI DMA\n"); |
| @@ -704,17 +705,16 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev) | |||
| 704 | 705 | ||
| 705 | if (request_ports()) { | 706 | if (request_ports()) { |
| 706 | pr_err("couldn't request gpio port\n"); | 707 | pr_err("couldn't request gpio port\n"); |
| 707 | free_dma(CH_PPI); | 708 | ret = -EFAULT; |
| 708 | return -EFAULT; | 709 | goto out_ports; |
| 709 | } | 710 | } |
| 710 | 711 | ||
| 711 | fb_buffer = dma_alloc_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, | 712 | fb_buffer = dma_alloc_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, |
| 712 | &dma_handle, GFP_KERNEL); | 713 | &dma_handle, GFP_KERNEL); |
| 713 | if (fb_buffer == NULL) { | 714 | if (fb_buffer == NULL) { |
| 714 | pr_err("couldn't allocate dma buffer\n"); | 715 | pr_err("couldn't allocate dma buffer\n"); |
| 715 | free_dma(CH_PPI); | 716 | ret = -ENOMEM; |
| 716 | free_ports(); | 717 | goto out_dma_coherent; |
| 717 | return -ENOMEM; | ||
| 718 | } | 718 | } |
| 719 | 719 | ||
| 720 | if (L1_DATA_A_LENGTH) | 720 | if (L1_DATA_A_LENGTH) |
| @@ -725,10 +725,8 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev) | |||
| 725 | 725 | ||
| 726 | if (dma_desc_table == NULL) { | 726 | if (dma_desc_table == NULL) { |
| 727 | pr_err("couldn't allocate dma descriptor\n"); | 727 | pr_err("couldn't allocate dma descriptor\n"); |
| 728 | free_dma(CH_PPI); | 728 | ret = -ENOMEM; |
| 729 | free_ports(); | 729 | goto out_table; |
| 730 | dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0); | ||
| 731 | return -ENOMEM; | ||
| 732 | } | 730 | } |
| 733 | 731 | ||
| 734 | bfin_lq035_fb.screen_base = (void *)fb_buffer; | 732 | bfin_lq035_fb.screen_base = (void *)fb_buffer; |
| @@ -771,31 +769,21 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev) | |||
| 771 | bfin_lq035_fb.pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL); | 769 | bfin_lq035_fb.pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL); |
| 772 | if (bfin_lq035_fb.pseudo_palette == NULL) { | 770 | if (bfin_lq035_fb.pseudo_palette == NULL) { |
| 773 | pr_err("failed to allocate pseudo_palette\n"); | 771 | pr_err("failed to allocate pseudo_palette\n"); |
| 774 | free_dma(CH_PPI); | 772 | ret = -ENOMEM; |
| 775 | free_ports(); | 773 | goto out_palette; |
| 776 | dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0); | ||
| 777 | return -ENOMEM; | ||
| 778 | } | 774 | } |
| 779 | 775 | ||
| 780 | if (fb_alloc_cmap(&bfin_lq035_fb.cmap, NBR_PALETTE, 0) < 0) { | 776 | if (fb_alloc_cmap(&bfin_lq035_fb.cmap, NBR_PALETTE, 0) < 0) { |
| 781 | pr_err("failed to allocate colormap (%d entries)\n", | 777 | pr_err("failed to allocate colormap (%d entries)\n", |
| 782 | NBR_PALETTE); | 778 | NBR_PALETTE); |
| 783 | free_dma(CH_PPI); | 779 | ret = -EFAULT; |
| 784 | free_ports(); | 780 | goto out_cmap; |
| 785 | dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0); | ||
| 786 | kfree(bfin_lq035_fb.pseudo_palette); | ||
| 787 | return -EFAULT; | ||
| 788 | } | 781 | } |
| 789 | 782 | ||
| 790 | if (register_framebuffer(&bfin_lq035_fb) < 0) { | 783 | if (register_framebuffer(&bfin_lq035_fb) < 0) { |
| 791 | pr_err("unable to register framebuffer\n"); | 784 | pr_err("unable to register framebuffer\n"); |
| 792 | free_dma(CH_PPI); | 785 | ret = -EINVAL; |
| 793 | free_ports(); | 786 | goto out_reg; |
| 794 | dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0); | ||
| 795 | fb_buffer = NULL; | ||
| 796 | kfree(bfin_lq035_fb.pseudo_palette); | ||
| 797 | fb_dealloc_cmap(&bfin_lq035_fb.cmap); | ||
| 798 | return -EINVAL; | ||
| 799 | } | 787 | } |
| 800 | 788 | ||
| 801 | i2c_add_driver(&ad5280_driver); | 789 | i2c_add_driver(&ad5280_driver); |
| @@ -807,11 +795,31 @@ static int __devinit bfin_lq035_probe(struct platform_device *pdev) | |||
| 807 | 795 | ||
| 808 | lcd_dev = lcd_device_register(KBUILD_MODNAME, &pdev->dev, NULL, | 796 | lcd_dev = lcd_device_register(KBUILD_MODNAME, &pdev->dev, NULL, |
| 809 | &bfin_lcd_ops); | 797 | &bfin_lcd_ops); |
| 798 | if (IS_ERR(lcd_dev)) { | ||
| 799 | pr_err("unable to register lcd\n"); | ||
| 800 | ret = PTR_ERR(lcd_dev); | ||
| 801 | goto out_lcd; | ||
| 802 | } | ||
| 810 | lcd_dev->props.max_contrast = 255, | 803 | lcd_dev->props.max_contrast = 255, |
| 811 | 804 | ||
| 812 | pr_info("initialized"); | 805 | pr_info("initialized"); |
| 813 | 806 | ||
| 814 | return 0; | 807 | return 0; |
| 808 | out_lcd: | ||
| 809 | unregister_framebuffer(&bfin_lq035_fb); | ||
| 810 | out_reg: | ||
| 811 | fb_dealloc_cmap(&bfin_lq035_fb.cmap); | ||
| 812 | out_cmap: | ||
| 813 | kfree(bfin_lq035_fb.pseudo_palette); | ||
| 814 | out_palette: | ||
| 815 | out_table: | ||
| 816 | dma_free_coherent(NULL, TOTAL_VIDEO_MEM_SIZE, fb_buffer, 0); | ||
| 817 | fb_buffer = NULL; | ||
| 818 | out_dma_coherent: | ||
| 819 | free_ports(); | ||
| 820 | out_ports: | ||
| 821 | free_dma(CH_PPI); | ||
| 822 | return ret; | ||
| 815 | } | 823 | } |
| 816 | 824 | ||
| 817 | static int __devexit bfin_lq035_remove(struct platform_device *pdev) | 825 | static int __devexit bfin_lq035_remove(struct platform_device *pdev) |
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c index d637e1f5317..cff742abdc5 100644 --- a/drivers/video/chipsfb.c +++ b/drivers/video/chipsfb.c | |||
| @@ -460,10 +460,10 @@ static int chipsfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 460 | if (!(state.event & PM_EVENT_SLEEP)) | 460 | if (!(state.event & PM_EVENT_SLEEP)) |
| 461 | goto done; | 461 | goto done; |
| 462 | 462 | ||
| 463 | acquire_console_sem(); | 463 | console_lock(); |
| 464 | chipsfb_blank(1, p); | 464 | chipsfb_blank(1, p); |
| 465 | fb_set_suspend(p, 1); | 465 | fb_set_suspend(p, 1); |
| 466 | release_console_sem(); | 466 | console_unlock(); |
| 467 | done: | 467 | done: |
| 468 | pdev->dev.power.power_state = state; | 468 | pdev->dev.power.power_state = state; |
| 469 | return 0; | 469 | return 0; |
| @@ -473,10 +473,10 @@ static int chipsfb_pci_resume(struct pci_dev *pdev) | |||
| 473 | { | 473 | { |
| 474 | struct fb_info *p = pci_get_drvdata(pdev); | 474 | struct fb_info *p = pci_get_drvdata(pdev); |
| 475 | 475 | ||
| 476 | acquire_console_sem(); | 476 | console_lock(); |
| 477 | fb_set_suspend(p, 0); | 477 | fb_set_suspend(p, 0); |
| 478 | chipsfb_blank(0, p); | 478 | chipsfb_blank(0, p); |
| 479 | release_console_sem(); | 479 | console_unlock(); |
| 480 | 480 | ||
| 481 | pdev->dev.power.power_state = PMSG_ON; | 481 | pdev->dev.power.power_state = PMSG_ON; |
| 482 | return 0; | 482 | return 0; |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 7ccc967831f..9c092b8d64e 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
| @@ -375,14 +375,14 @@ static void fb_flashcursor(struct work_struct *work) | |||
| 375 | int c; | 375 | int c; |
| 376 | int mode; | 376 | int mode; |
| 377 | 377 | ||
| 378 | acquire_console_sem(); | 378 | console_lock(); |
| 379 | if (ops && ops->currcon != -1) | 379 | if (ops && ops->currcon != -1) |
| 380 | vc = vc_cons[ops->currcon].d; | 380 | vc = vc_cons[ops->currcon].d; |
| 381 | 381 | ||
| 382 | if (!vc || !CON_IS_VISIBLE(vc) || | 382 | if (!vc || !CON_IS_VISIBLE(vc) || |
| 383 | registered_fb[con2fb_map[vc->vc_num]] != info || | 383 | registered_fb[con2fb_map[vc->vc_num]] != info || |
| 384 | vc->vc_deccm != 1) { | 384 | vc->vc_deccm != 1) { |
| 385 | release_console_sem(); | 385 | console_unlock(); |
| 386 | return; | 386 | return; |
| 387 | } | 387 | } |
| 388 | 388 | ||
| @@ -392,7 +392,7 @@ static void fb_flashcursor(struct work_struct *work) | |||
| 392 | CM_ERASE : CM_DRAW; | 392 | CM_ERASE : CM_DRAW; |
| 393 | ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), | 393 | ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), |
| 394 | get_color(vc, info, c, 0)); | 394 | get_color(vc, info, c, 0)); |
| 395 | release_console_sem(); | 395 | console_unlock(); |
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | static void cursor_timer_handler(unsigned long dev_addr) | 398 | static void cursor_timer_handler(unsigned long dev_addr) |
| @@ -836,7 +836,7 @@ static int set_con2fb_map(int unit, int newidx, int user) | |||
| 836 | 836 | ||
| 837 | found = search_fb_in_map(newidx); | 837 | found = search_fb_in_map(newidx); |
| 838 | 838 | ||
| 839 | acquire_console_sem(); | 839 | console_lock(); |
| 840 | con2fb_map[unit] = newidx; | 840 | con2fb_map[unit] = newidx; |
| 841 | if (!err && !found) | 841 | if (!err && !found) |
| 842 | err = con2fb_acquire_newinfo(vc, info, unit, oldidx); | 842 | err = con2fb_acquire_newinfo(vc, info, unit, oldidx); |
| @@ -863,7 +863,7 @@ static int set_con2fb_map(int unit, int newidx, int user) | |||
| 863 | if (!search_fb_in_map(info_idx)) | 863 | if (!search_fb_in_map(info_idx)) |
| 864 | info_idx = newidx; | 864 | info_idx = newidx; |
| 865 | 865 | ||
| 866 | release_console_sem(); | 866 | console_unlock(); |
| 867 | return err; | 867 | return err; |
| 868 | } | 868 | } |
| 869 | 869 | ||
| @@ -3321,7 +3321,7 @@ static ssize_t store_rotate(struct device *device, | |||
| 3321 | if (fbcon_has_exited) | 3321 | if (fbcon_has_exited) |
| 3322 | return count; | 3322 | return count; |
| 3323 | 3323 | ||
| 3324 | acquire_console_sem(); | 3324 | console_lock(); |
| 3325 | idx = con2fb_map[fg_console]; | 3325 | idx = con2fb_map[fg_console]; |
| 3326 | 3326 | ||
| 3327 | if (idx == -1 || registered_fb[idx] == NULL) | 3327 | if (idx == -1 || registered_fb[idx] == NULL) |
| @@ -3331,7 +3331,7 @@ static ssize_t store_rotate(struct device *device, | |||
| 3331 | rotate = simple_strtoul(buf, last, 0); | 3331 | rotate = simple_strtoul(buf, last, 0); |
| 3332 | fbcon_rotate(info, rotate); | 3332 | fbcon_rotate(info, rotate); |
| 3333 | err: | 3333 | err: |
| 3334 | release_console_sem(); | 3334 | console_unlock(); |
| 3335 | return count; | 3335 | return count; |
| 3336 | } | 3336 | } |
| 3337 | 3337 | ||
| @@ -3346,7 +3346,7 @@ static ssize_t store_rotate_all(struct device *device, | |||
| 3346 | if (fbcon_has_exited) | 3346 | if (fbcon_has_exited) |
| 3347 | return count; | 3347 | return count; |
| 3348 | 3348 | ||
| 3349 | acquire_console_sem(); | 3349 | console_lock(); |
| 3350 | idx = con2fb_map[fg_console]; | 3350 | idx = con2fb_map[fg_console]; |
| 3351 | 3351 | ||
| 3352 | if (idx == -1 || registered_fb[idx] == NULL) | 3352 | if (idx == -1 || registered_fb[idx] == NULL) |
| @@ -3356,7 +3356,7 @@ static ssize_t store_rotate_all(struct device *device, | |||
| 3356 | rotate = simple_strtoul(buf, last, 0); | 3356 | rotate = simple_strtoul(buf, last, 0); |
| 3357 | fbcon_rotate_all(info, rotate); | 3357 | fbcon_rotate_all(info, rotate); |
| 3358 | err: | 3358 | err: |
| 3359 | release_console_sem(); | 3359 | console_unlock(); |
| 3360 | return count; | 3360 | return count; |
| 3361 | } | 3361 | } |
| 3362 | 3362 | ||
| @@ -3369,7 +3369,7 @@ static ssize_t show_rotate(struct device *device, | |||
| 3369 | if (fbcon_has_exited) | 3369 | if (fbcon_has_exited) |
| 3370 | return 0; | 3370 | return 0; |
| 3371 | 3371 | ||
| 3372 | acquire_console_sem(); | 3372 | console_lock(); |
| 3373 | idx = con2fb_map[fg_console]; | 3373 | idx = con2fb_map[fg_console]; |
| 3374 | 3374 | ||
| 3375 | if (idx == -1 || registered_fb[idx] == NULL) | 3375 | if (idx == -1 || registered_fb[idx] == NULL) |
| @@ -3378,7 +3378,7 @@ static ssize_t show_rotate(struct device *device, | |||
| 3378 | info = registered_fb[idx]; | 3378 | info = registered_fb[idx]; |
| 3379 | rotate = fbcon_get_rotate(info); | 3379 | rotate = fbcon_get_rotate(info); |
| 3380 | err: | 3380 | err: |
| 3381 | release_console_sem(); | 3381 | console_unlock(); |
| 3382 | return snprintf(buf, PAGE_SIZE, "%d\n", rotate); | 3382 | return snprintf(buf, PAGE_SIZE, "%d\n", rotate); |
| 3383 | } | 3383 | } |
| 3384 | 3384 | ||
| @@ -3392,7 +3392,7 @@ static ssize_t show_cursor_blink(struct device *device, | |||
| 3392 | if (fbcon_has_exited) | 3392 | if (fbcon_has_exited) |
| 3393 | return 0; | 3393 | return 0; |
| 3394 | 3394 | ||
| 3395 | acquire_console_sem(); | 3395 | console_lock(); |
| 3396 | idx = con2fb_map[fg_console]; | 3396 | idx = con2fb_map[fg_console]; |
| 3397 | 3397 | ||
| 3398 | if (idx == -1 || registered_fb[idx] == NULL) | 3398 | if (idx == -1 || registered_fb[idx] == NULL) |
| @@ -3406,7 +3406,7 @@ static ssize_t show_cursor_blink(struct device *device, | |||
| 3406 | 3406 | ||
| 3407 | blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0; | 3407 | blink = (ops->flags & FBCON_FLAGS_CURSOR_TIMER) ? 1 : 0; |
| 3408 | err: | 3408 | err: |
| 3409 | release_console_sem(); | 3409 | console_unlock(); |
| 3410 | return snprintf(buf, PAGE_SIZE, "%d\n", blink); | 3410 | return snprintf(buf, PAGE_SIZE, "%d\n", blink); |
| 3411 | } | 3411 | } |
| 3412 | 3412 | ||
| @@ -3421,7 +3421,7 @@ static ssize_t store_cursor_blink(struct device *device, | |||
| 3421 | if (fbcon_has_exited) | 3421 | if (fbcon_has_exited) |
| 3422 | return count; | 3422 | return count; |
| 3423 | 3423 | ||
| 3424 | acquire_console_sem(); | 3424 | console_lock(); |
| 3425 | idx = con2fb_map[fg_console]; | 3425 | idx = con2fb_map[fg_console]; |
| 3426 | 3426 | ||
| 3427 | if (idx == -1 || registered_fb[idx] == NULL) | 3427 | if (idx == -1 || registered_fb[idx] == NULL) |
| @@ -3443,7 +3443,7 @@ static ssize_t store_cursor_blink(struct device *device, | |||
| 3443 | } | 3443 | } |
| 3444 | 3444 | ||
| 3445 | err: | 3445 | err: |
| 3446 | release_console_sem(); | 3446 | console_unlock(); |
| 3447 | return count; | 3447 | return count; |
| 3448 | } | 3448 | } |
| 3449 | 3449 | ||
| @@ -3482,7 +3482,7 @@ static void fbcon_start(void) | |||
| 3482 | if (num_registered_fb) { | 3482 | if (num_registered_fb) { |
| 3483 | int i; | 3483 | int i; |
| 3484 | 3484 | ||
| 3485 | acquire_console_sem(); | 3485 | console_lock(); |
| 3486 | 3486 | ||
| 3487 | for (i = 0; i < FB_MAX; i++) { | 3487 | for (i = 0; i < FB_MAX; i++) { |
| 3488 | if (registered_fb[i] != NULL) { | 3488 | if (registered_fb[i] != NULL) { |
| @@ -3491,7 +3491,7 @@ static void fbcon_start(void) | |||
| 3491 | } | 3491 | } |
| 3492 | } | 3492 | } |
| 3493 | 3493 | ||
| 3494 | release_console_sem(); | 3494 | console_unlock(); |
| 3495 | fbcon_takeover(0); | 3495 | fbcon_takeover(0); |
| 3496 | } | 3496 | } |
| 3497 | } | 3497 | } |
| @@ -3552,7 +3552,7 @@ static int __init fb_console_init(void) | |||
| 3552 | { | 3552 | { |
| 3553 | int i; | 3553 | int i; |
| 3554 | 3554 | ||
| 3555 | acquire_console_sem(); | 3555 | console_lock(); |
| 3556 | fb_register_client(&fbcon_event_notifier); | 3556 | fb_register_client(&fbcon_event_notifier); |
| 3557 | fbcon_device = device_create(fb_class, NULL, MKDEV(0, 0), NULL, | 3557 | fbcon_device = device_create(fb_class, NULL, MKDEV(0, 0), NULL, |
| 3558 | "fbcon"); | 3558 | "fbcon"); |
| @@ -3568,7 +3568,7 @@ static int __init fb_console_init(void) | |||
| 3568 | for (i = 0; i < MAX_NR_CONSOLES; i++) | 3568 | for (i = 0; i < MAX_NR_CONSOLES; i++) |
| 3569 | con2fb_map[i] = -1; | 3569 | con2fb_map[i] = -1; |
| 3570 | 3570 | ||
| 3571 | release_console_sem(); | 3571 | console_unlock(); |
| 3572 | fbcon_start(); | 3572 | fbcon_start(); |
| 3573 | return 0; | 3573 | return 0; |
| 3574 | } | 3574 | } |
| @@ -3591,12 +3591,12 @@ static void __exit fbcon_deinit_device(void) | |||
| 3591 | 3591 | ||
| 3592 | static void __exit fb_console_exit(void) | 3592 | static void __exit fb_console_exit(void) |
| 3593 | { | 3593 | { |
| 3594 | acquire_console_sem(); | 3594 | console_lock(); |
| 3595 | fb_unregister_client(&fbcon_event_notifier); | 3595 | fb_unregister_client(&fbcon_event_notifier); |
| 3596 | fbcon_deinit_device(); | 3596 | fbcon_deinit_device(); |
| 3597 | device_destroy(fb_class, MKDEV(0, 0)); | 3597 | device_destroy(fb_class, MKDEV(0, 0)); |
| 3598 | fbcon_exit(); | 3598 | fbcon_exit(); |
| 3599 | release_console_sem(); | 3599 | console_unlock(); |
| 3600 | unregister_con_driver(&fb_con); | 3600 | unregister_con_driver(&fb_con); |
| 3601 | } | 3601 | } |
| 3602 | 3602 | ||
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index c97491b8b39..915fd74da7a 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
| @@ -202,11 +202,7 @@ static void vgacon_scrollback_init(int pitch) | |||
| 202 | } | 202 | } |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | /* | 205 | static void vgacon_scrollback_startup(void) |
| 206 | * Called only duing init so call of alloc_bootmen is ok. | ||
| 207 | * Marked __init_refok to silence modpost. | ||
| 208 | */ | ||
| 209 | static void __init_refok vgacon_scrollback_startup(void) | ||
| 210 | { | 206 | { |
| 211 | vgacon_scrollback = kcalloc(CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, 1024, GFP_NOWAIT); | 207 | vgacon_scrollback = kcalloc(CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, 1024, GFP_NOWAIT); |
| 212 | vgacon_scrollback_init(vga_video_num_columns * 2); | 208 | vgacon_scrollback_init(vga_video_num_columns * 2); |
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index c265aed09e0..8d61ef96eed 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c | |||
| @@ -1092,9 +1092,10 @@ static int __init fb_probe(struct platform_device *device) | |||
| 1092 | 1092 | ||
| 1093 | irq_freq: | 1093 | irq_freq: |
| 1094 | #ifdef CONFIG_CPU_FREQ | 1094 | #ifdef CONFIG_CPU_FREQ |
| 1095 | lcd_da8xx_cpufreq_deregister(par); | ||
| 1096 | #endif | ||
| 1095 | err_cpu_freq: | 1097 | err_cpu_freq: |
| 1096 | unregister_framebuffer(da8xx_fb_info); | 1098 | unregister_framebuffer(da8xx_fb_info); |
| 1097 | #endif | ||
| 1098 | 1099 | ||
| 1099 | err_dealloc_cmap: | 1100 | err_dealloc_cmap: |
| 1100 | fb_dealloc_cmap(&da8xx_fb_info->cmap); | 1101 | fb_dealloc_cmap(&da8xx_fb_info->cmap); |
| @@ -1130,14 +1131,14 @@ static int fb_suspend(struct platform_device *dev, pm_message_t state) | |||
| 1130 | struct fb_info *info = platform_get_drvdata(dev); | 1131 | struct fb_info *info = platform_get_drvdata(dev); |
| 1131 | struct da8xx_fb_par *par = info->par; | 1132 | struct da8xx_fb_par *par = info->par; |
| 1132 | 1133 | ||
| 1133 | acquire_console_sem(); | 1134 | console_lock(); |
| 1134 | if (par->panel_power_ctrl) | 1135 | if (par->panel_power_ctrl) |
| 1135 | par->panel_power_ctrl(0); | 1136 | par->panel_power_ctrl(0); |
| 1136 | 1137 | ||
| 1137 | fb_set_suspend(info, 1); | 1138 | fb_set_suspend(info, 1); |
| 1138 | lcd_disable_raster(); | 1139 | lcd_disable_raster(); |
| 1139 | clk_disable(par->lcdc_clk); | 1140 | clk_disable(par->lcdc_clk); |
| 1140 | release_console_sem(); | 1141 | console_unlock(); |
| 1141 | 1142 | ||
| 1142 | return 0; | 1143 | return 0; |
| 1143 | } | 1144 | } |
| @@ -1146,14 +1147,14 @@ static int fb_resume(struct platform_device *dev) | |||
| 1146 | struct fb_info *info = platform_get_drvdata(dev); | 1147 | struct fb_info *info = platform_get_drvdata(dev); |
| 1147 | struct da8xx_fb_par *par = info->par; | 1148 | struct da8xx_fb_par *par = info->par; |
| 1148 | 1149 | ||
| 1149 | acquire_console_sem(); | 1150 | console_lock(); |
| 1150 | if (par->panel_power_ctrl) | 1151 | if (par->panel_power_ctrl) |
| 1151 | par->panel_power_ctrl(1); | 1152 | par->panel_power_ctrl(1); |
| 1152 | 1153 | ||
| 1153 | clk_enable(par->lcdc_clk); | 1154 | clk_enable(par->lcdc_clk); |
| 1154 | lcd_enable_raster(); | 1155 | lcd_enable_raster(); |
| 1155 | fb_set_suspend(info, 0); | 1156 | fb_set_suspend(info, 0); |
| 1156 | release_console_sem(); | 1157 | console_unlock(); |
| 1157 | 1158 | ||
| 1158 | return 0; | 1159 | return 0; |
| 1159 | } | 1160 | } |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 4ac1201ad6c..e2bf95370e4 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
| @@ -1036,11 +1036,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, | |||
| 1036 | return -EFAULT; | 1036 | return -EFAULT; |
| 1037 | if (!lock_fb_info(info)) | 1037 | if (!lock_fb_info(info)) |
| 1038 | return -ENODEV; | 1038 | return -ENODEV; |
| 1039 | acquire_console_sem(); | 1039 | console_lock(); |
| 1040 | info->flags |= FBINFO_MISC_USEREVENT; | 1040 | info->flags |= FBINFO_MISC_USEREVENT; |
| 1041 | ret = fb_set_var(info, &var); | 1041 | ret = fb_set_var(info, &var); |
| 1042 | info->flags &= ~FBINFO_MISC_USEREVENT; | 1042 | info->flags &= ~FBINFO_MISC_USEREVENT; |
| 1043 | release_console_sem(); | 1043 | console_unlock(); |
| 1044 | unlock_fb_info(info); | 1044 | unlock_fb_info(info); |
| 1045 | if (!ret && copy_to_user(argp, &var, sizeof(var))) | 1045 | if (!ret && copy_to_user(argp, &var, sizeof(var))) |
| 1046 | ret = -EFAULT; | 1046 | ret = -EFAULT; |
| @@ -1072,9 +1072,9 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, | |||
| 1072 | return -EFAULT; | 1072 | return -EFAULT; |
| 1073 | if (!lock_fb_info(info)) | 1073 | if (!lock_fb_info(info)) |
| 1074 | return -ENODEV; | 1074 | return -ENODEV; |
| 1075 | acquire_console_sem(); | 1075 | console_lock(); |
| 1076 | ret = fb_pan_display(info, &var); | 1076 | ret = fb_pan_display(info, &var); |
| 1077 | release_console_sem(); | 1077 | console_unlock(); |
| 1078 | unlock_fb_info(info); | 1078 | unlock_fb_info(info); |
| 1079 | if (ret == 0 && copy_to_user(argp, &var, sizeof(var))) | 1079 | if (ret == 0 && copy_to_user(argp, &var, sizeof(var))) |
| 1080 | return -EFAULT; | 1080 | return -EFAULT; |
| @@ -1119,11 +1119,11 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, | |||
| 1119 | case FBIOBLANK: | 1119 | case FBIOBLANK: |
| 1120 | if (!lock_fb_info(info)) | 1120 | if (!lock_fb_info(info)) |
| 1121 | return -ENODEV; | 1121 | return -ENODEV; |
| 1122 | acquire_console_sem(); | 1122 | console_lock(); |
| 1123 | info->flags |= FBINFO_MISC_USEREVENT; | 1123 | info->flags |= FBINFO_MISC_USEREVENT; |
| 1124 | ret = fb_blank(info, arg); | 1124 | ret = fb_blank(info, arg); |
| 1125 | info->flags &= ~FBINFO_MISC_USEREVENT; | 1125 | info->flags &= ~FBINFO_MISC_USEREVENT; |
| 1126 | release_console_sem(); | 1126 | console_unlock(); |
| 1127 | unlock_fb_info(info); | 1127 | unlock_fb_info(info); |
| 1128 | break; | 1128 | break; |
| 1129 | default: | 1129 | default: |
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index 0a08f134122..f4a32779168 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c | |||
| @@ -90,11 +90,11 @@ static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var) | |||
| 90 | int err; | 90 | int err; |
| 91 | 91 | ||
| 92 | var->activate |= FB_ACTIVATE_FORCE; | 92 | var->activate |= FB_ACTIVATE_FORCE; |
| 93 | acquire_console_sem(); | 93 | console_lock(); |
| 94 | fb_info->flags |= FBINFO_MISC_USEREVENT; | 94 | fb_info->flags |= FBINFO_MISC_USEREVENT; |
| 95 | err = fb_set_var(fb_info, var); | 95 | err = fb_set_var(fb_info, var); |
| 96 | fb_info->flags &= ~FBINFO_MISC_USEREVENT; | 96 | fb_info->flags &= ~FBINFO_MISC_USEREVENT; |
| 97 | release_console_sem(); | 97 | console_unlock(); |
| 98 | if (err) | 98 | if (err) |
| 99 | return err; | 99 | return err; |
| 100 | return 0; | 100 | return 0; |
| @@ -175,7 +175,7 @@ static ssize_t store_modes(struct device *device, | |||
| 175 | if (i * sizeof(struct fb_videomode) != count) | 175 | if (i * sizeof(struct fb_videomode) != count) |
| 176 | return -EINVAL; | 176 | return -EINVAL; |
| 177 | 177 | ||
| 178 | acquire_console_sem(); | 178 | console_lock(); |
| 179 | list_splice(&fb_info->modelist, &old_list); | 179 | list_splice(&fb_info->modelist, &old_list); |
| 180 | fb_videomode_to_modelist((const struct fb_videomode *)buf, i, | 180 | fb_videomode_to_modelist((const struct fb_videomode *)buf, i, |
| 181 | &fb_info->modelist); | 181 | &fb_info->modelist); |
| @@ -185,7 +185,7 @@ static ssize_t store_modes(struct device *device, | |||
| 185 | } else | 185 | } else |
| 186 | fb_destroy_modelist(&old_list); | 186 | fb_destroy_modelist(&old_list); |
| 187 | 187 | ||
| 188 | release_console_sem(); | 188 | console_unlock(); |
| 189 | 189 | ||
| 190 | return 0; | 190 | return 0; |
| 191 | } | 191 | } |
| @@ -301,11 +301,11 @@ static ssize_t store_blank(struct device *device, | |||
| 301 | char *last = NULL; | 301 | char *last = NULL; |
| 302 | int err; | 302 | int err; |
| 303 | 303 | ||
| 304 | acquire_console_sem(); | 304 | console_lock(); |
| 305 | fb_info->flags |= FBINFO_MISC_USEREVENT; | 305 | fb_info->flags |= FBINFO_MISC_USEREVENT; |
| 306 | err = fb_blank(fb_info, simple_strtoul(buf, &last, 0)); | 306 | err = fb_blank(fb_info, simple_strtoul(buf, &last, 0)); |
| 307 | fb_info->flags &= ~FBINFO_MISC_USEREVENT; | 307 | fb_info->flags &= ~FBINFO_MISC_USEREVENT; |
| 308 | release_console_sem(); | 308 | console_unlock(); |
| 309 | if (err < 0) | 309 | if (err < 0) |
| 310 | return err; | 310 | return err; |
| 311 | return count; | 311 | return count; |
| @@ -364,9 +364,9 @@ static ssize_t store_pan(struct device *device, | |||
| 364 | return -EINVAL; | 364 | return -EINVAL; |
| 365 | var.yoffset = simple_strtoul(last, &last, 0); | 365 | var.yoffset = simple_strtoul(last, &last, 0); |
| 366 | 366 | ||
| 367 | acquire_console_sem(); | 367 | console_lock(); |
| 368 | err = fb_pan_display(fb_info, &var); | 368 | err = fb_pan_display(fb_info, &var); |
| 369 | release_console_sem(); | 369 | console_unlock(); |
| 370 | 370 | ||
| 371 | if (err < 0) | 371 | if (err < 0) |
| 372 | return err; | 372 | return err; |
| @@ -399,9 +399,9 @@ static ssize_t store_fbstate(struct device *device, | |||
| 399 | 399 | ||
| 400 | state = simple_strtoul(buf, &last, 0); | 400 | state = simple_strtoul(buf, &last, 0); |
| 401 | 401 | ||
| 402 | acquire_console_sem(); | 402 | console_lock(); |
| 403 | fb_set_suspend(fb_info, (int)state); | 403 | fb_set_suspend(fb_info, (int)state); |
| 404 | release_console_sem(); | 404 | console_unlock(); |
| 405 | 405 | ||
| 406 | return count; | 406 | return count; |
| 407 | } | 407 | } |
diff --git a/drivers/video/geode/gxfb_core.c b/drivers/video/geode/gxfb_core.c index 70b1d9d51c9..b4f19db9bb5 100644 --- a/drivers/video/geode/gxfb_core.c +++ b/drivers/video/geode/gxfb_core.c | |||
| @@ -344,10 +344,10 @@ static int gxfb_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 344 | struct fb_info *info = pci_get_drvdata(pdev); | 344 | struct fb_info *info = pci_get_drvdata(pdev); |
| 345 | 345 | ||
| 346 | if (state.event == PM_EVENT_SUSPEND) { | 346 | if (state.event == PM_EVENT_SUSPEND) { |
| 347 | acquire_console_sem(); | 347 | console_lock(); |
| 348 | gx_powerdown(info); | 348 | gx_powerdown(info); |
| 349 | fb_set_suspend(info, 1); | 349 | fb_set_suspend(info, 1); |
| 350 | release_console_sem(); | 350 | console_unlock(); |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | /* there's no point in setting PCI states; we emulate PCI, so | 353 | /* there's no point in setting PCI states; we emulate PCI, so |
| @@ -361,7 +361,7 @@ static int gxfb_resume(struct pci_dev *pdev) | |||
| 361 | struct fb_info *info = pci_get_drvdata(pdev); | 361 | struct fb_info *info = pci_get_drvdata(pdev); |
| 362 | int ret; | 362 | int ret; |
| 363 | 363 | ||
| 364 | acquire_console_sem(); | 364 | console_lock(); |
| 365 | ret = gx_powerup(info); | 365 | ret = gx_powerup(info); |
| 366 | if (ret) { | 366 | if (ret) { |
| 367 | printk(KERN_ERR "gxfb: power up failed!\n"); | 367 | printk(KERN_ERR "gxfb: power up failed!\n"); |
| @@ -369,7 +369,7 @@ static int gxfb_resume(struct pci_dev *pdev) | |||
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | fb_set_suspend(info, 0); | 371 | fb_set_suspend(info, 0); |
| 372 | release_console_sem(); | 372 | console_unlock(); |
| 373 | return 0; | 373 | return 0; |
| 374 | } | 374 | } |
| 375 | #endif | 375 | #endif |
diff --git a/drivers/video/geode/lxfb_core.c b/drivers/video/geode/lxfb_core.c index 39bdbedf43b..416851ca875 100644 --- a/drivers/video/geode/lxfb_core.c +++ b/drivers/video/geode/lxfb_core.c | |||
| @@ -465,10 +465,10 @@ static int lxfb_suspend(struct pci_dev *pdev, pm_message_t state) | |||
| 465 | struct fb_info *info = pci_get_drvdata(pdev); | 465 | struct fb_info *info = pci_get_drvdata(pdev); |
| 466 | 466 | ||
| 467 | if (state.event == PM_EVENT_SUSPEND) { | 467 | if (state.event == PM_EVENT_SUSPEND) { |
| 468 | acquire_console_sem(); | 468 | console_lock(); |
| 469 | lx_powerdown(info); | 469 | lx_powerdown(info); |
| 470 | fb_set_suspend(info, 1); | 470 | fb_set_suspend(info, 1); |
| 471 | release_console_sem(); | 471 | console_unlock(); |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | /* there's no point in setting PCI states; we emulate PCI, so | 474 | /* there's no point in setting PCI states; we emulate PCI, so |
| @@ -482,7 +482,7 @@ static int lxfb_resume(struct pci_dev *pdev) | |||
| 482 | struct fb_info *info = pci_get_drvdata(pdev); | 482 | struct fb_info *info = pci_get_drvdata(pdev); |
| 483 | int ret; | 483 | int ret; |
| 484 | 484 | ||
| 485 | acquire_console_sem(); | 485 | console_lock(); |
| 486 | ret = lx_powerup(info); | 486 | ret = lx_powerup(info); |
| 487 | if (ret) { | 487 | if (ret) { |
| 488 | printk(KERN_ERR "lxfb: power up failed!\n"); | 488 | printk(KERN_ERR "lxfb: power up failed!\n"); |
| @@ -490,7 +490,7 @@ static int lxfb_resume(struct pci_dev *pdev) | |||
| 490 | } | 490 | } |
| 491 | 491 | ||
| 492 | fb_set_suspend(info, 0); | 492 | fb_set_suspend(info, 0); |
| 493 | release_console_sem(); | 493 | console_unlock(); |
| 494 | return 0; | 494 | return 0; |
| 495 | } | 495 | } |
| 496 | #else | 496 | #else |
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 5743ea25e81..318f6fb895b 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
| @@ -1574,7 +1574,7 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t mesg) | |||
| 1574 | return 0; | 1574 | return 0; |
| 1575 | } | 1575 | } |
| 1576 | 1576 | ||
| 1577 | acquire_console_sem(); | 1577 | console_lock(); |
| 1578 | fb_set_suspend(info, 1); | 1578 | fb_set_suspend(info, 1); |
| 1579 | 1579 | ||
| 1580 | if (info->fbops->fb_sync) | 1580 | if (info->fbops->fb_sync) |
| @@ -1587,7 +1587,7 @@ static int i810fb_suspend(struct pci_dev *dev, pm_message_t mesg) | |||
| 1587 | pci_save_state(dev); | 1587 | pci_save_state(dev); |
| 1588 | pci_disable_device(dev); | 1588 | pci_disable_device(dev); |
| 1589 | pci_set_power_state(dev, pci_choose_state(dev, mesg)); | 1589 | pci_set_power_state(dev, pci_choose_state(dev, mesg)); |
| 1590 | release_console_sem(); | 1590 | console_unlock(); |
| 1591 | 1591 | ||
| 1592 | return 0; | 1592 | return 0; |
| 1593 | } | 1593 | } |
| @@ -1605,7 +1605,7 @@ static int i810fb_resume(struct pci_dev *dev) | |||
| 1605 | return 0; | 1605 | return 0; |
| 1606 | } | 1606 | } |
| 1607 | 1607 | ||
| 1608 | acquire_console_sem(); | 1608 | console_lock(); |
| 1609 | pci_set_power_state(dev, PCI_D0); | 1609 | pci_set_power_state(dev, PCI_D0); |
| 1610 | pci_restore_state(dev); | 1610 | pci_restore_state(dev); |
| 1611 | 1611 | ||
| @@ -1621,7 +1621,7 @@ static int i810fb_resume(struct pci_dev *dev) | |||
| 1621 | fb_set_suspend (info, 0); | 1621 | fb_set_suspend (info, 0); |
| 1622 | info->fbops->fb_blank(VESA_NO_BLANKING, info); | 1622 | info->fbops->fb_blank(VESA_NO_BLANKING, info); |
| 1623 | fail: | 1623 | fail: |
| 1624 | release_console_sem(); | 1624 | console_unlock(); |
| 1625 | return 0; | 1625 | return 0; |
| 1626 | } | 1626 | } |
| 1627 | /*********************************************************************** | 1627 | /*********************************************************************** |
diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c index 670ecaa0385..de366937c93 100644 --- a/drivers/video/jz4740_fb.c +++ b/drivers/video/jz4740_fb.c | |||
| @@ -778,9 +778,9 @@ static int jzfb_suspend(struct device *dev) | |||
| 778 | { | 778 | { |
| 779 | struct jzfb *jzfb = dev_get_drvdata(dev); | 779 | struct jzfb *jzfb = dev_get_drvdata(dev); |
| 780 | 780 | ||
| 781 | acquire_console_sem(); | 781 | console_lock(); |
| 782 | fb_set_suspend(jzfb->fb, 1); | 782 | fb_set_suspend(jzfb->fb, 1); |
| 783 | release_console_sem(); | 783 | console_unlock(); |
| 784 | 784 | ||
| 785 | mutex_lock(&jzfb->lock); | 785 | mutex_lock(&jzfb->lock); |
| 786 | if (jzfb->is_enabled) | 786 | if (jzfb->is_enabled) |
| @@ -800,9 +800,9 @@ static int jzfb_resume(struct device *dev) | |||
| 800 | jzfb_enable(jzfb); | 800 | jzfb_enable(jzfb); |
| 801 | mutex_unlock(&jzfb->lock); | 801 | mutex_unlock(&jzfb->lock); |
| 802 | 802 | ||
| 803 | acquire_console_sem(); | 803 | console_lock(); |
| 804 | fb_set_suspend(jzfb->fb, 0); | 804 | fb_set_suspend(jzfb->fb, 0); |
| 805 | release_console_sem(); | 805 | console_unlock(); |
| 806 | 806 | ||
| 807 | return 0; | 807 | return 0; |
| 808 | } | 808 | } |
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index cb013919e9c..7e3a490e8d7 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c | |||
| @@ -1177,9 +1177,9 @@ static int mx3fb_suspend(struct platform_device *pdev, pm_message_t state) | |||
| 1177 | struct mx3fb_data *mx3fb = platform_get_drvdata(pdev); | 1177 | struct mx3fb_data *mx3fb = platform_get_drvdata(pdev); |
| 1178 | struct mx3fb_info *mx3_fbi = mx3fb->fbi->par; | 1178 | struct mx3fb_info *mx3_fbi = mx3fb->fbi->par; |
| 1179 | 1179 | ||
| 1180 | acquire_console_sem(); | 1180 | console_lock(); |
| 1181 | fb_set_suspend(mx3fb->fbi, 1); | 1181 | fb_set_suspend(mx3fb->fbi, 1); |
| 1182 | release_console_sem(); | 1182 | console_unlock(); |
| 1183 | 1183 | ||
| 1184 | if (mx3_fbi->blank == FB_BLANK_UNBLANK) { | 1184 | if (mx3_fbi->blank == FB_BLANK_UNBLANK) { |
| 1185 | sdc_disable_channel(mx3_fbi); | 1185 | sdc_disable_channel(mx3_fbi); |
| @@ -1202,9 +1202,9 @@ static int mx3fb_resume(struct platform_device *pdev) | |||
| 1202 | sdc_set_brightness(mx3fb, mx3fb->backlight_level); | 1202 | sdc_set_brightness(mx3fb, mx3fb->backlight_level); |
| 1203 | } | 1203 | } |
| 1204 | 1204 | ||
| 1205 | acquire_console_sem(); | 1205 | console_lock(); |
| 1206 | fb_set_suspend(mx3fb->fbi, 0); | 1206 | fb_set_suspend(mx3fb->fbi, 0); |
| 1207 | release_console_sem(); | 1207 | console_unlock(); |
| 1208 | 1208 | ||
| 1209 | return 0; | 1209 | return 0; |
| 1210 | } | 1210 | } |
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c index 62498bd662f..f838d9e277f 100644 --- a/drivers/video/nuc900fb.c +++ b/drivers/video/nuc900fb.c | |||
| @@ -696,6 +696,8 @@ static int nuc900fb_remove(struct platform_device *pdev) | |||
| 696 | nuc900fb_stop_lcd(fbinfo); | 696 | nuc900fb_stop_lcd(fbinfo); |
| 697 | msleep(1); | 697 | msleep(1); |
| 698 | 698 | ||
| 699 | unregister_framebuffer(fbinfo); | ||
| 700 | nuc900fb_cpufreq_deregister(fbi); | ||
| 699 | nuc900fb_unmap_video_memory(fbinfo); | 701 | nuc900fb_unmap_video_memory(fbinfo); |
| 700 | 702 | ||
| 701 | iounmap(fbi->io); | 703 | iounmap(fbi->io); |
| @@ -723,7 +725,7 @@ static int nuc900fb_suspend(struct platform_device *dev, pm_message_t state) | |||
| 723 | struct fb_info *fbinfo = platform_get_drvdata(dev); | 725 | struct fb_info *fbinfo = platform_get_drvdata(dev); |
| 724 | struct nuc900fb_info *info = fbinfo->par; | 726 | struct nuc900fb_info *info = fbinfo->par; |
| 725 | 727 | ||
| 726 | nuc900fb_stop_lcd(); | 728 | nuc900fb_stop_lcd(fbinfo); |
| 727 | msleep(1); | 729 | msleep(1); |
| 728 | clk_disable(info->clk); | 730 | clk_disable(info->clk); |
| 729 | return 0; | 731 | return 0; |
| @@ -740,7 +742,7 @@ static int nuc900fb_resume(struct platform_device *dev) | |||
| 740 | msleep(1); | 742 | msleep(1); |
| 741 | 743 | ||
| 742 | nuc900fb_init_registers(fbinfo); | 744 | nuc900fb_init_registers(fbinfo); |
| 743 | nuc900fb_activate_var(bfinfo); | 745 | nuc900fb_activate_var(fbinfo); |
| 744 | 746 | ||
| 745 | return 0; | 747 | return 0; |
| 746 | } | 748 | } |
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index efe10ff86d6..081dc474527 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c | |||
| @@ -1057,7 +1057,7 @@ static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t mesg) | |||
| 1057 | 1057 | ||
| 1058 | if (mesg.event == PM_EVENT_PRETHAW) | 1058 | if (mesg.event == PM_EVENT_PRETHAW) |
| 1059 | mesg.event = PM_EVENT_FREEZE; | 1059 | mesg.event = PM_EVENT_FREEZE; |
| 1060 | acquire_console_sem(); | 1060 | console_lock(); |
| 1061 | par->pm_state = mesg.event; | 1061 | par->pm_state = mesg.event; |
| 1062 | 1062 | ||
| 1063 | if (mesg.event & PM_EVENT_SLEEP) { | 1063 | if (mesg.event & PM_EVENT_SLEEP) { |
| @@ -1070,7 +1070,7 @@ static int nvidiafb_suspend(struct pci_dev *dev, pm_message_t mesg) | |||
| 1070 | } | 1070 | } |
| 1071 | dev->dev.power.power_state = mesg; | 1071 | dev->dev.power.power_state = mesg; |
| 1072 | 1072 | ||
| 1073 | release_console_sem(); | 1073 | console_unlock(); |
| 1074 | return 0; | 1074 | return 0; |
| 1075 | } | 1075 | } |
| 1076 | 1076 | ||
| @@ -1079,7 +1079,7 @@ static int nvidiafb_resume(struct pci_dev *dev) | |||
| 1079 | struct fb_info *info = pci_get_drvdata(dev); | 1079 | struct fb_info *info = pci_get_drvdata(dev); |
| 1080 | struct nvidia_par *par = info->par; | 1080 | struct nvidia_par *par = info->par; |
| 1081 | 1081 | ||
| 1082 | acquire_console_sem(); | 1082 | console_lock(); |
| 1083 | pci_set_power_state(dev, PCI_D0); | 1083 | pci_set_power_state(dev, PCI_D0); |
| 1084 | 1084 | ||
| 1085 | if (par->pm_state != PM_EVENT_FREEZE) { | 1085 | if (par->pm_state != PM_EVENT_FREEZE) { |
| @@ -1097,7 +1097,7 @@ static int nvidiafb_resume(struct pci_dev *dev) | |||
| 1097 | nvidiafb_blank(FB_BLANK_UNBLANK, info); | 1097 | nvidiafb_blank(FB_BLANK_UNBLANK, info); |
| 1098 | 1098 | ||
| 1099 | fail: | 1099 | fail: |
| 1100 | release_console_sem(); | 1100 | console_unlock(); |
| 1101 | return 0; | 1101 | return 0; |
| 1102 | } | 1102 | } |
| 1103 | #else | 1103 | #else |
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index 9c0144ee7ae..65560a1a043 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c | |||
| @@ -513,9 +513,9 @@ static int ps3fb_release(struct fb_info *info, int user) | |||
| 513 | if (atomic_dec_and_test(&ps3fb.f_count)) { | 513 | if (atomic_dec_and_test(&ps3fb.f_count)) { |
| 514 | if (atomic_read(&ps3fb.ext_flip)) { | 514 | if (atomic_read(&ps3fb.ext_flip)) { |
| 515 | atomic_set(&ps3fb.ext_flip, 0); | 515 | atomic_set(&ps3fb.ext_flip, 0); |
| 516 | if (!try_acquire_console_sem()) { | 516 | if (console_trylock()) { |
| 517 | ps3fb_sync(info, 0); /* single buffer */ | 517 | ps3fb_sync(info, 0); /* single buffer */ |
| 518 | release_console_sem(); | 518 | console_unlock(); |
| 519 | } | 519 | } |
| 520 | } | 520 | } |
| 521 | } | 521 | } |
| @@ -830,14 +830,14 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd, | |||
| 830 | if (vmode) { | 830 | if (vmode) { |
| 831 | var = info->var; | 831 | var = info->var; |
| 832 | fb_videomode_to_var(&var, vmode); | 832 | fb_videomode_to_var(&var, vmode); |
| 833 | acquire_console_sem(); | 833 | console_lock(); |
| 834 | info->flags |= FBINFO_MISC_USEREVENT; | 834 | info->flags |= FBINFO_MISC_USEREVENT; |
| 835 | /* Force, in case only special bits changed */ | 835 | /* Force, in case only special bits changed */ |
| 836 | var.activate |= FB_ACTIVATE_FORCE; | 836 | var.activate |= FB_ACTIVATE_FORCE; |
| 837 | par->new_mode_id = val; | 837 | par->new_mode_id = val; |
| 838 | retval = fb_set_var(info, &var); | 838 | retval = fb_set_var(info, &var); |
| 839 | info->flags &= ~FBINFO_MISC_USEREVENT; | 839 | info->flags &= ~FBINFO_MISC_USEREVENT; |
| 840 | release_console_sem(); | 840 | console_unlock(); |
| 841 | } | 841 | } |
| 842 | break; | 842 | break; |
| 843 | } | 843 | } |
| @@ -881,9 +881,9 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd, | |||
| 881 | break; | 881 | break; |
| 882 | 882 | ||
| 883 | dev_dbg(info->device, "PS3FB_IOCTL_FSEL:%d\n", val); | 883 | dev_dbg(info->device, "PS3FB_IOCTL_FSEL:%d\n", val); |
| 884 | acquire_console_sem(); | 884 | console_lock(); |
| 885 | retval = ps3fb_sync(info, val); | 885 | retval = ps3fb_sync(info, val); |
| 886 | release_console_sem(); | 886 | console_unlock(); |
| 887 | break; | 887 | break; |
| 888 | 888 | ||
| 889 | default: | 889 | default: |
| @@ -903,9 +903,9 @@ static int ps3fbd(void *arg) | |||
| 903 | set_current_state(TASK_INTERRUPTIBLE); | 903 | set_current_state(TASK_INTERRUPTIBLE); |
| 904 | if (ps3fb.is_kicked) { | 904 | if (ps3fb.is_kicked) { |
| 905 | ps3fb.is_kicked = 0; | 905 | ps3fb.is_kicked = 0; |
| 906 | acquire_console_sem(); | 906 | console_lock(); |
| 907 | ps3fb_sync(info, 0); /* single buffer */ | 907 | ps3fb_sync(info, 0); /* single buffer */ |
| 908 | release_console_sem(); | 908 | console_unlock(); |
| 909 | } | 909 | } |
| 910 | schedule(); | 910 | schedule(); |
| 911 | } | 911 | } |
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index cea6403ae71..35f61dd0cb3 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c | |||
| @@ -701,16 +701,12 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev) | |||
| 701 | */ | 701 | */ |
| 702 | pxa168fb_init_mode(info, mi); | 702 | pxa168fb_init_mode(info, mi); |
| 703 | 703 | ||
| 704 | ret = pxa168fb_check_var(&info->var, info); | ||
| 705 | if (ret) | ||
| 706 | goto failed_free_fbmem; | ||
| 707 | |||
| 708 | /* | 704 | /* |
| 709 | * Fill in sane defaults. | 705 | * Fill in sane defaults. |
| 710 | */ | 706 | */ |
| 711 | ret = pxa168fb_check_var(&info->var, info); | 707 | ret = pxa168fb_check_var(&info->var, info); |
| 712 | if (ret) | 708 | if (ret) |
| 713 | goto failed; | 709 | goto failed_free_fbmem; |
| 714 | 710 | ||
| 715 | /* | 711 | /* |
| 716 | * enable controller clock | 712 | * enable controller clock |
diff --git a/drivers/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c index b81168df253..cf4beb9dc9b 100644 --- a/drivers/video/pxa3xx-gcu.c +++ b/drivers/video/pxa3xx-gcu.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * pxa3xx-gc.c - Linux kernel module for PXA3xx graphics controllers | 2 | * pxa3xx-gcu.c - Linux kernel module for PXA3xx graphics controllers |
| 3 | * | 3 | * |
| 4 | * This driver needs a DirectFB counterpart in user space, communication | 4 | * This driver needs a DirectFB counterpart in user space, communication |
| 5 | * is handled via mmap()ed memory areas and an ioctl. | 5 | * is handled via mmap()ed memory areas and an ioctl. |
| @@ -421,7 +421,7 @@ pxa3xx_gcu_misc_write(struct file *filp, const char *buff, | |||
| 421 | buffer->next = priv->free; | 421 | buffer->next = priv->free; |
| 422 | priv->free = buffer; | 422 | priv->free = buffer; |
| 423 | spin_unlock_irqrestore(&priv->spinlock, flags); | 423 | spin_unlock_irqrestore(&priv->spinlock, flags); |
| 424 | return ret; | 424 | return -EFAULT; |
| 425 | } | 425 | } |
| 426 | 426 | ||
| 427 | buffer->length = words; | 427 | buffer->length = words; |
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index dce8c97b433..75738a92861 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | #include <linux/svga.h> | 22 | #include <linux/svga.h> |
| 23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 24 | #include <linux/pci.h> | 24 | #include <linux/pci.h> |
| 25 | #include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */ | 25 | #include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */ |
| 26 | #include <video/vga.h> | 26 | #include <video/vga.h> |
| 27 | 27 | ||
| 28 | #ifdef CONFIG_MTRR | 28 | #ifdef CONFIG_MTRR |
| @@ -1113,12 +1113,12 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state) | |||
| 1113 | 1113 | ||
| 1114 | dev_info(info->device, "suspend\n"); | 1114 | dev_info(info->device, "suspend\n"); |
| 1115 | 1115 | ||
| 1116 | acquire_console_sem(); | 1116 | console_lock(); |
| 1117 | mutex_lock(&(par->open_lock)); | 1117 | mutex_lock(&(par->open_lock)); |
| 1118 | 1118 | ||
| 1119 | if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { | 1119 | if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { |
| 1120 | mutex_unlock(&(par->open_lock)); | 1120 | mutex_unlock(&(par->open_lock)); |
| 1121 | release_console_sem(); | 1121 | console_unlock(); |
| 1122 | return 0; | 1122 | return 0; |
| 1123 | } | 1123 | } |
| 1124 | 1124 | ||
| @@ -1129,7 +1129,7 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state) | |||
| 1129 | pci_set_power_state(dev, pci_choose_state(dev, state)); | 1129 | pci_set_power_state(dev, pci_choose_state(dev, state)); |
| 1130 | 1130 | ||
| 1131 | mutex_unlock(&(par->open_lock)); | 1131 | mutex_unlock(&(par->open_lock)); |
| 1132 | release_console_sem(); | 1132 | console_unlock(); |
| 1133 | 1133 | ||
| 1134 | return 0; | 1134 | return 0; |
| 1135 | } | 1135 | } |
| @@ -1145,12 +1145,12 @@ static int s3_pci_resume(struct pci_dev* dev) | |||
| 1145 | 1145 | ||
| 1146 | dev_info(info->device, "resume\n"); | 1146 | dev_info(info->device, "resume\n"); |
| 1147 | 1147 | ||
| 1148 | acquire_console_sem(); | 1148 | console_lock(); |
| 1149 | mutex_lock(&(par->open_lock)); | 1149 | mutex_lock(&(par->open_lock)); |
| 1150 | 1150 | ||
| 1151 | if (par->ref_count == 0) { | 1151 | if (par->ref_count == 0) { |
| 1152 | mutex_unlock(&(par->open_lock)); | 1152 | mutex_unlock(&(par->open_lock)); |
| 1153 | release_console_sem(); | 1153 | console_unlock(); |
| 1154 | return 0; | 1154 | return 0; |
| 1155 | } | 1155 | } |
| 1156 | 1156 | ||
| @@ -1159,7 +1159,7 @@ static int s3_pci_resume(struct pci_dev* dev) | |||
| 1159 | err = pci_enable_device(dev); | 1159 | err = pci_enable_device(dev); |
| 1160 | if (err) { | 1160 | if (err) { |
| 1161 | mutex_unlock(&(par->open_lock)); | 1161 | mutex_unlock(&(par->open_lock)); |
| 1162 | release_console_sem(); | 1162 | console_unlock(); |
| 1163 | dev_err(info->device, "error %d enabling device for resume\n", err); | 1163 | dev_err(info->device, "error %d enabling device for resume\n", err); |
| 1164 | return err; | 1164 | return err; |
| 1165 | } | 1165 | } |
| @@ -1169,7 +1169,7 @@ static int s3_pci_resume(struct pci_dev* dev) | |||
| 1169 | fb_set_suspend(info, 0); | 1169 | fb_set_suspend(info, 0); |
| 1170 | 1170 | ||
| 1171 | mutex_unlock(&(par->open_lock)); | 1171 | mutex_unlock(&(par->open_lock)); |
| 1172 | release_console_sem(); | 1172 | console_unlock(); |
| 1173 | 1173 | ||
| 1174 | return 0; | 1174 | return 0; |
| 1175 | } | 1175 | } |
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 842d157e102..487911e2926 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
| @@ -2373,7 +2373,7 @@ static int savagefb_suspend(struct pci_dev *dev, pm_message_t mesg) | |||
| 2373 | if (mesg.event == PM_EVENT_FREEZE) | 2373 | if (mesg.event == PM_EVENT_FREEZE) |
| 2374 | return 0; | 2374 | return 0; |
| 2375 | 2375 | ||
| 2376 | acquire_console_sem(); | 2376 | console_lock(); |
| 2377 | fb_set_suspend(info, 1); | 2377 | fb_set_suspend(info, 1); |
| 2378 | 2378 | ||
| 2379 | if (info->fbops->fb_sync) | 2379 | if (info->fbops->fb_sync) |
| @@ -2385,7 +2385,7 @@ static int savagefb_suspend(struct pci_dev *dev, pm_message_t mesg) | |||
| 2385 | pci_save_state(dev); | 2385 | pci_save_state(dev); |
| 2386 | pci_disable_device(dev); | 2386 | pci_disable_device(dev); |
| 2387 | pci_set_power_state(dev, pci_choose_state(dev, mesg)); | 2387 | pci_set_power_state(dev, pci_choose_state(dev, mesg)); |
| 2388 | release_console_sem(); | 2388 | console_unlock(); |
| 2389 | 2389 | ||
| 2390 | return 0; | 2390 | return 0; |
| 2391 | } | 2391 | } |
| @@ -2409,7 +2409,7 @@ static int savagefb_resume(struct pci_dev* dev) | |||
| 2409 | return 0; | 2409 | return 0; |
| 2410 | } | 2410 | } |
| 2411 | 2411 | ||
| 2412 | acquire_console_sem(); | 2412 | console_lock(); |
| 2413 | 2413 | ||
| 2414 | pci_set_power_state(dev, PCI_D0); | 2414 | pci_set_power_state(dev, PCI_D0); |
| 2415 | pci_restore_state(dev); | 2415 | pci_restore_state(dev); |
| @@ -2423,7 +2423,7 @@ static int savagefb_resume(struct pci_dev* dev) | |||
| 2423 | savagefb_set_par(info); | 2423 | savagefb_set_par(info); |
| 2424 | fb_set_suspend(info, 0); | 2424 | fb_set_suspend(info, 0); |
| 2425 | savagefb_blank(FB_BLANK_UNBLANK, info); | 2425 | savagefb_blank(FB_BLANK_UNBLANK, info); |
| 2426 | release_console_sem(); | 2426 | console_unlock(); |
| 2427 | 2427 | ||
| 2428 | return 0; | 2428 | return 0; |
| 2429 | } | 2429 | } |
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 74d9f546a2e..2b9e56a6bde 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
| @@ -1151,7 +1151,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
| 1151 | 1151 | ||
| 1152 | ch = info->par; | 1152 | ch = info->par; |
| 1153 | 1153 | ||
| 1154 | acquire_console_sem(); | 1154 | console_lock(); |
| 1155 | 1155 | ||
| 1156 | /* HDMI plug in */ | 1156 | /* HDMI plug in */ |
| 1157 | if (!sh_hdmi_must_reconfigure(hdmi) && | 1157 | if (!sh_hdmi_must_reconfigure(hdmi) && |
| @@ -1171,7 +1171,7 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
| 1171 | fb_set_suspend(info, 0); | 1171 | fb_set_suspend(info, 0); |
| 1172 | } | 1172 | } |
| 1173 | 1173 | ||
| 1174 | release_console_sem(); | 1174 | console_unlock(); |
| 1175 | } else { | 1175 | } else { |
| 1176 | ret = 0; | 1176 | ret = 0; |
| 1177 | if (!hdmi->info) | 1177 | if (!hdmi->info) |
| @@ -1181,12 +1181,12 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) | |||
| 1181 | fb_destroy_modedb(hdmi->monspec.modedb); | 1181 | fb_destroy_modedb(hdmi->monspec.modedb); |
| 1182 | hdmi->monspec.modedb = NULL; | 1182 | hdmi->monspec.modedb = NULL; |
| 1183 | 1183 | ||
| 1184 | acquire_console_sem(); | 1184 | console_lock(); |
| 1185 | 1185 | ||
| 1186 | /* HDMI disconnect */ | 1186 | /* HDMI disconnect */ |
| 1187 | fb_set_suspend(hdmi->info, 1); | 1187 | fb_set_suspend(hdmi->info, 1); |
| 1188 | 1188 | ||
| 1189 | release_console_sem(); | 1189 | console_unlock(); |
| 1190 | pm_runtime_put(hdmi->dev); | 1190 | pm_runtime_put(hdmi->dev); |
| 1191 | } | 1191 | } |
| 1192 | 1192 | ||
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index bd4840a8a6b..bf12e53aed5 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
| @@ -912,9 +912,9 @@ static int sh_mobile_release(struct fb_info *info, int user) | |||
| 912 | 912 | ||
| 913 | /* Nothing to reconfigure, when called from fbcon */ | 913 | /* Nothing to reconfigure, when called from fbcon */ |
| 914 | if (user) { | 914 | if (user) { |
| 915 | acquire_console_sem(); | 915 | console_lock(); |
| 916 | sh_mobile_fb_reconfig(info); | 916 | sh_mobile_fb_reconfig(info); |
| 917 | release_console_sem(); | 917 | console_unlock(); |
| 918 | } | 918 | } |
| 919 | 919 | ||
| 920 | mutex_unlock(&ch->open_lock); | 920 | mutex_unlock(&ch->open_lock); |
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index b7dc1800efa..bcb44a594eb 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c | |||
| @@ -2010,9 +2010,9 @@ static int sm501fb_suspend_fb(struct sm501fb_info *info, | |||
| 2010 | 2010 | ||
| 2011 | /* tell console/fb driver we are suspending */ | 2011 | /* tell console/fb driver we are suspending */ |
| 2012 | 2012 | ||
| 2013 | acquire_console_sem(); | 2013 | console_lock(); |
| 2014 | fb_set_suspend(fbi, 1); | 2014 | fb_set_suspend(fbi, 1); |
| 2015 | release_console_sem(); | 2015 | console_unlock(); |
| 2016 | 2016 | ||
| 2017 | /* backup copies in case chip is powered down over suspend */ | 2017 | /* backup copies in case chip is powered down over suspend */ |
| 2018 | 2018 | ||
| @@ -2069,9 +2069,9 @@ static void sm501fb_resume_fb(struct sm501fb_info *info, | |||
| 2069 | memcpy_toio(par->cursor.k_addr, par->store_cursor, | 2069 | memcpy_toio(par->cursor.k_addr, par->store_cursor, |
| 2070 | par->cursor.size); | 2070 | par->cursor.size); |
| 2071 | 2071 | ||
| 2072 | acquire_console_sem(); | 2072 | console_lock(); |
| 2073 | fb_set_suspend(fbi, 0); | 2073 | fb_set_suspend(fbi, 0); |
| 2074 | release_console_sem(); | 2074 | console_unlock(); |
| 2075 | 2075 | ||
| 2076 | vfree(par->store_fb); | 2076 | vfree(par->store_fb); |
| 2077 | vfree(par->store_cursor); | 2077 | vfree(par->store_cursor); |
diff --git a/drivers/video/tmiofb.c b/drivers/video/tmiofb.c index 6913fe168c2..dfef88c803d 100644 --- a/drivers/video/tmiofb.c +++ b/drivers/video/tmiofb.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | #include <linux/fb.h> | 25 | #include <linux/fb.h> |
| 26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
| 27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
| 28 | /* Why should fb driver call console functions? because acquire_console_sem() */ | 28 | /* Why should fb driver call console functions? because console_lock() */ |
| 29 | #include <linux/console.h> | 29 | #include <linux/console.h> |
| 30 | #include <linux/mfd/core.h> | 30 | #include <linux/mfd/core.h> |
| 31 | #include <linux/mfd/tmio.h> | 31 | #include <linux/mfd/tmio.h> |
| @@ -944,7 +944,7 @@ static int tmiofb_suspend(struct platform_device *dev, pm_message_t state) | |||
| 944 | struct mfd_cell *cell = dev->dev.platform_data; | 944 | struct mfd_cell *cell = dev->dev.platform_data; |
| 945 | int retval = 0; | 945 | int retval = 0; |
| 946 | 946 | ||
| 947 | acquire_console_sem(); | 947 | console_lock(); |
| 948 | 948 | ||
| 949 | fb_set_suspend(info, 1); | 949 | fb_set_suspend(info, 1); |
| 950 | 950 | ||
| @@ -965,7 +965,7 @@ static int tmiofb_suspend(struct platform_device *dev, pm_message_t state) | |||
| 965 | if (cell->suspend) | 965 | if (cell->suspend) |
| 966 | retval = cell->suspend(dev); | 966 | retval = cell->suspend(dev); |
| 967 | 967 | ||
| 968 | release_console_sem(); | 968 | console_unlock(); |
| 969 | 969 | ||
| 970 | return retval; | 970 | return retval; |
| 971 | } | 971 | } |
| @@ -976,7 +976,7 @@ static int tmiofb_resume(struct platform_device *dev) | |||
| 976 | struct mfd_cell *cell = dev->dev.platform_data; | 976 | struct mfd_cell *cell = dev->dev.platform_data; |
| 977 | int retval = 0; | 977 | int retval = 0; |
| 978 | 978 | ||
| 979 | acquire_console_sem(); | 979 | console_lock(); |
| 980 | 980 | ||
| 981 | if (cell->resume) { | 981 | if (cell->resume) { |
| 982 | retval = cell->resume(dev); | 982 | retval = cell->resume(dev); |
| @@ -992,7 +992,7 @@ static int tmiofb_resume(struct platform_device *dev) | |||
| 992 | 992 | ||
| 993 | fb_set_suspend(info, 0); | 993 | fb_set_suspend(info, 0); |
| 994 | out: | 994 | out: |
| 995 | release_console_sem(); | 995 | console_unlock(); |
| 996 | return retval; | 996 | return retval; |
| 997 | } | 997 | } |
| 998 | #else | 998 | #else |
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 289edd51952..4e66349e436 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
| @@ -1674,17 +1674,17 @@ static int parse_mode(const char *str, u32 *xres, u32 *yres) | |||
| 1674 | #ifdef CONFIG_PM | 1674 | #ifdef CONFIG_PM |
| 1675 | static int viafb_suspend(void *unused) | 1675 | static int viafb_suspend(void *unused) |
| 1676 | { | 1676 | { |
| 1677 | acquire_console_sem(); | 1677 | console_lock(); |
| 1678 | fb_set_suspend(viafbinfo, 1); | 1678 | fb_set_suspend(viafbinfo, 1); |
| 1679 | viafb_sync(viafbinfo); | 1679 | viafb_sync(viafbinfo); |
| 1680 | release_console_sem(); | 1680 | console_unlock(); |
| 1681 | 1681 | ||
| 1682 | return 0; | 1682 | return 0; |
| 1683 | } | 1683 | } |
| 1684 | 1684 | ||
| 1685 | static int viafb_resume(void *unused) | 1685 | static int viafb_resume(void *unused) |
| 1686 | { | 1686 | { |
| 1687 | acquire_console_sem(); | 1687 | console_lock(); |
| 1688 | if (viaparinfo->shared->vdev->engine_mmio) | 1688 | if (viaparinfo->shared->vdev->engine_mmio) |
| 1689 | viafb_reset_engine(viaparinfo); | 1689 | viafb_reset_engine(viaparinfo); |
| 1690 | viafb_set_par(viafbinfo); | 1690 | viafb_set_par(viafbinfo); |
| @@ -1692,7 +1692,7 @@ static int viafb_resume(void *unused) | |||
| 1692 | viafb_set_par(viafbinfo1); | 1692 | viafb_set_par(viafbinfo1); |
| 1693 | fb_set_suspend(viafbinfo, 0); | 1693 | fb_set_suspend(viafbinfo, 0); |
| 1694 | 1694 | ||
| 1695 | release_console_sem(); | 1695 | console_unlock(); |
| 1696 | return 0; | 1696 | return 0; |
| 1697 | } | 1697 | } |
| 1698 | 1698 | ||
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c index 85d76ec4c63..a2965ab92cf 100644 --- a/drivers/video/vt8623fb.c +++ b/drivers/video/vt8623fb.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #include <linux/svga.h> | 23 | #include <linux/svga.h> |
| 24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
| 25 | #include <linux/pci.h> | 25 | #include <linux/pci.h> |
| 26 | #include <linux/console.h> /* Why should fb driver call console functions? because acquire_console_sem() */ | 26 | #include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */ |
| 27 | #include <video/vga.h> | 27 | #include <video/vga.h> |
| 28 | 28 | ||
| 29 | #ifdef CONFIG_MTRR | 29 | #ifdef CONFIG_MTRR |
| @@ -819,12 +819,12 @@ static int vt8623_pci_suspend(struct pci_dev* dev, pm_message_t state) | |||
| 819 | 819 | ||
| 820 | dev_info(info->device, "suspend\n"); | 820 | dev_info(info->device, "suspend\n"); |
| 821 | 821 | ||
| 822 | acquire_console_sem(); | 822 | console_lock(); |
| 823 | mutex_lock(&(par->open_lock)); | 823 | mutex_lock(&(par->open_lock)); |
| 824 | 824 | ||
| 825 | if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { | 825 | if ((state.event == PM_EVENT_FREEZE) || (par->ref_count == 0)) { |
| 826 | mutex_unlock(&(par->open_lock)); | 826 | mutex_unlock(&(par->open_lock)); |
| 827 | release_console_sem(); | 827 | console_unlock(); |
| 828 | return 0; | 828 | return 0; |
| 829 | } | 829 | } |
| 830 | 830 | ||
| @@ -835,7 +835,7 @@ static int vt8623_pci_suspend(struct pci_dev* dev, pm_message_t state) | |||
| 835 | pci_set_power_state(dev, pci_choose_state(dev, state)); | 835 | pci_set_power_state(dev, pci_choose_state(dev, state)); |
| 836 | 836 | ||
| 837 | mutex_unlock(&(par->open_lock)); | 837 | mutex_unlock(&(par->open_lock)); |
| 838 | release_console_sem(); | 838 | console_unlock(); |
| 839 | 839 | ||
| 840 | return 0; | 840 | return 0; |
| 841 | } | 841 | } |
| @@ -850,7 +850,7 @@ static int vt8623_pci_resume(struct pci_dev* dev) | |||
| 850 | 850 | ||
| 851 | dev_info(info->device, "resume\n"); | 851 | dev_info(info->device, "resume\n"); |
| 852 | 852 | ||
| 853 | acquire_console_sem(); | 853 | console_lock(); |
| 854 | mutex_lock(&(par->open_lock)); | 854 | mutex_lock(&(par->open_lock)); |
| 855 | 855 | ||
| 856 | if (par->ref_count == 0) | 856 | if (par->ref_count == 0) |
| @@ -869,7 +869,7 @@ static int vt8623_pci_resume(struct pci_dev* dev) | |||
| 869 | 869 | ||
| 870 | fail: | 870 | fail: |
| 871 | mutex_unlock(&(par->open_lock)); | 871 | mutex_unlock(&(par->open_lock)); |
| 872 | release_console_sem(); | 872 | console_unlock(); |
| 873 | 873 | ||
| 874 | return 0; | 874 | return 0; |
| 875 | } | 875 | } |
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index 3e6934d4bea..a20218c2fda 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
| @@ -491,12 +491,12 @@ xenfb_make_preferred_console(void) | |||
| 491 | if (console_set_on_cmdline) | 491 | if (console_set_on_cmdline) |
| 492 | return; | 492 | return; |
| 493 | 493 | ||
| 494 | acquire_console_sem(); | 494 | console_lock(); |
| 495 | for_each_console(c) { | 495 | for_each_console(c) { |
| 496 | if (!strcmp(c->name, "tty") && c->index == 0) | 496 | if (!strcmp(c->name, "tty") && c->index == 0) |
| 497 | break; | 497 | break; |
| 498 | } | 498 | } |
| 499 | release_console_sem(); | 499 | console_unlock(); |
| 500 | if (c) { | 500 | if (c) { |
| 501 | unregister_console(c); | 501 | unregister_console(c); |
| 502 | c->flags |= CON_CONSDEV; | 502 | c->flags |= CON_CONSDEV; |
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index 7ed36536e75..f1c68629f27 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c | |||
| @@ -297,7 +297,6 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) | |||
| 297 | 297 | ||
| 298 | cifs_sb = CIFS_SB(mntpt->d_inode->i_sb); | 298 | cifs_sb = CIFS_SB(mntpt->d_inode->i_sb); |
| 299 | tlink = cifs_sb_tlink(cifs_sb); | 299 | tlink = cifs_sb_tlink(cifs_sb); |
| 300 | mnt = ERR_PTR(-EINVAL); | ||
| 301 | if (IS_ERR(tlink)) { | 300 | if (IS_ERR(tlink)) { |
| 302 | mnt = ERR_CAST(tlink); | 301 | mnt = ERR_CAST(tlink); |
| 303 | goto free_full_path; | 302 | goto free_full_path; |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 5bfb75346cb..edd5b29b53c 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
| @@ -166,6 +166,9 @@ struct TCP_Server_Info { | |||
| 166 | struct socket *ssocket; | 166 | struct socket *ssocket; |
| 167 | struct sockaddr_storage dstaddr; | 167 | struct sockaddr_storage dstaddr; |
| 168 | struct sockaddr_storage srcaddr; /* locally bind to this IP */ | 168 | struct sockaddr_storage srcaddr; /* locally bind to this IP */ |
| 169 | #ifdef CONFIG_NET_NS | ||
| 170 | struct net *net; | ||
| 171 | #endif | ||
| 169 | wait_queue_head_t response_q; | 172 | wait_queue_head_t response_q; |
| 170 | wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/ | 173 | wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/ |
| 171 | struct list_head pending_mid_q; | 174 | struct list_head pending_mid_q; |
| @@ -217,6 +220,36 @@ struct TCP_Server_Info { | |||
| 217 | }; | 220 | }; |
| 218 | 221 | ||
| 219 | /* | 222 | /* |
| 223 | * Macros to allow the TCP_Server_Info->net field and related code to drop out | ||
| 224 | * when CONFIG_NET_NS isn't set. | ||
| 225 | */ | ||
| 226 | |||
| 227 | #ifdef CONFIG_NET_NS | ||
| 228 | |||
| 229 | static inline struct net *cifs_net_ns(struct TCP_Server_Info *srv) | ||
| 230 | { | ||
| 231 | return srv->net; | ||
| 232 | } | ||
| 233 | |||
| 234 | static inline void cifs_set_net_ns(struct TCP_Server_Info *srv, struct net *net) | ||
| 235 | { | ||
| 236 | srv->net = net; | ||
| 237 | } | ||
| 238 | |||
| 239 | #else | ||
| 240 | |||
| 241 | static inline struct net *cifs_net_ns(struct TCP_Server_Info *srv) | ||
| 242 | { | ||
| 243 | return &init_net; | ||
| 244 | } | ||
| 245 | |||
| 246 | static inline void cifs_set_net_ns(struct TCP_Server_Info *srv, struct net *net) | ||
| 247 | { | ||
| 248 | } | ||
| 249 | |||
| 250 | #endif | ||
| 251 | |||
| 252 | /* | ||
| 220 | * Session structure. One of these for each uid session with a particular host | 253 | * Session structure. One of these for each uid session with a particular host |
| 221 | */ | 254 | */ |
| 222 | struct cifsSesInfo { | 255 | struct cifsSesInfo { |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 18d3c7724d6..0cc3b81c2e8 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -1568,6 +1568,9 @@ cifs_find_tcp_session(struct sockaddr *addr, struct smb_vol *vol) | |||
| 1568 | 1568 | ||
| 1569 | spin_lock(&cifs_tcp_ses_lock); | 1569 | spin_lock(&cifs_tcp_ses_lock); |
| 1570 | list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) { | 1570 | list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) { |
| 1571 | if (!net_eq(cifs_net_ns(server), current->nsproxy->net_ns)) | ||
| 1572 | continue; | ||
| 1573 | |||
| 1571 | if (!match_address(server, addr, | 1574 | if (!match_address(server, addr, |
| 1572 | (struct sockaddr *)&vol->srcaddr)) | 1575 | (struct sockaddr *)&vol->srcaddr)) |
| 1573 | continue; | 1576 | continue; |
| @@ -1598,6 +1601,8 @@ cifs_put_tcp_session(struct TCP_Server_Info *server) | |||
| 1598 | return; | 1601 | return; |
| 1599 | } | 1602 | } |
| 1600 | 1603 | ||
| 1604 | put_net(cifs_net_ns(server)); | ||
| 1605 | |||
| 1601 | list_del_init(&server->tcp_ses_list); | 1606 | list_del_init(&server->tcp_ses_list); |
| 1602 | spin_unlock(&cifs_tcp_ses_lock); | 1607 | spin_unlock(&cifs_tcp_ses_lock); |
| 1603 | 1608 | ||
| @@ -1672,6 +1677,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info) | |||
| 1672 | goto out_err; | 1677 | goto out_err; |
| 1673 | } | 1678 | } |
| 1674 | 1679 | ||
| 1680 | cifs_set_net_ns(tcp_ses, get_net(current->nsproxy->net_ns)); | ||
| 1675 | tcp_ses->hostname = extract_hostname(volume_info->UNC); | 1681 | tcp_ses->hostname = extract_hostname(volume_info->UNC); |
| 1676 | if (IS_ERR(tcp_ses->hostname)) { | 1682 | if (IS_ERR(tcp_ses->hostname)) { |
| 1677 | rc = PTR_ERR(tcp_ses->hostname); | 1683 | rc = PTR_ERR(tcp_ses->hostname); |
| @@ -1752,6 +1758,8 @@ cifs_get_tcp_session(struct smb_vol *volume_info) | |||
| 1752 | out_err_crypto_release: | 1758 | out_err_crypto_release: |
| 1753 | cifs_crypto_shash_release(tcp_ses); | 1759 | cifs_crypto_shash_release(tcp_ses); |
| 1754 | 1760 | ||
| 1761 | put_net(cifs_net_ns(tcp_ses)); | ||
| 1762 | |||
| 1755 | out_err: | 1763 | out_err: |
| 1756 | if (tcp_ses) { | 1764 | if (tcp_ses) { |
| 1757 | if (!IS_ERR(tcp_ses->hostname)) | 1765 | if (!IS_ERR(tcp_ses->hostname)) |
| @@ -2263,8 +2271,8 @@ generic_ip_connect(struct TCP_Server_Info *server) | |||
| 2263 | } | 2271 | } |
| 2264 | 2272 | ||
| 2265 | if (socket == NULL) { | 2273 | if (socket == NULL) { |
| 2266 | rc = sock_create_kern(sfamily, SOCK_STREAM, | 2274 | rc = __sock_create(cifs_net_ns(server), sfamily, SOCK_STREAM, |
| 2267 | IPPROTO_TCP, &socket); | 2275 | IPPROTO_TCP, &socket, 1); |
| 2268 | if (rc < 0) { | 2276 | if (rc < 0) { |
| 2269 | cERROR(1, "Error %d creating socket", rc); | 2277 | cERROR(1, "Error %d creating socket", rc); |
| 2270 | server->ssocket = NULL; | 2278 | server->ssocket = NULL; |
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 0994f6a76c0..58fd707174e 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
| @@ -704,7 +704,8 @@ skip_mount_setup: | |||
| 704 | sbp[0]->s_state = | 704 | sbp[0]->s_state = |
| 705 | cpu_to_le16(le16_to_cpu(sbp[0]->s_state) & ~NILFS_VALID_FS); | 705 | cpu_to_le16(le16_to_cpu(sbp[0]->s_state) & ~NILFS_VALID_FS); |
| 706 | /* synchronize sbp[1] with sbp[0] */ | 706 | /* synchronize sbp[1] with sbp[0] */ |
| 707 | memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); | 707 | if (sbp[1]) |
| 708 | memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); | ||
| 708 | return nilfs_commit_super(sbi, NILFS_SB_COMMIT_ALL); | 709 | return nilfs_commit_super(sbi, NILFS_SB_COMMIT_ALL); |
| 709 | } | 710 | } |
| 710 | 711 | ||
diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c index eafc22ab1fd..b701eaa482b 100644 --- a/fs/proc/consoles.c +++ b/fs/proc/consoles.c | |||
| @@ -67,7 +67,7 @@ static void *c_start(struct seq_file *m, loff_t *pos) | |||
| 67 | struct console *con; | 67 | struct console *con; |
| 68 | loff_t off = 0; | 68 | loff_t off = 0; |
| 69 | 69 | ||
| 70 | acquire_console_sem(); | 70 | console_lock(); |
| 71 | for_each_console(con) | 71 | for_each_console(con) |
| 72 | if (off++ == *pos) | 72 | if (off++ == *pos) |
| 73 | break; | 73 | break; |
| @@ -84,7 +84,7 @@ static void *c_next(struct seq_file *m, void *v, loff_t *pos) | |||
| 84 | 84 | ||
| 85 | static void c_stop(struct seq_file *m, void *v) | 85 | static void c_stop(struct seq_file *m, void *v) |
| 86 | { | 86 | { |
| 87 | release_console_sem(); | 87 | console_unlock(); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | static const struct seq_operations consoles_op = { | 90 | static const struct seq_operations consoles_op = { |
diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index 2fb2882f0fa..8ab48bc2fa7 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c | |||
| @@ -63,6 +63,14 @@ static struct buffer_head *get_block_length(struct super_block *sb, | |||
| 63 | *length = (unsigned char) bh->b_data[*offset] | | 63 | *length = (unsigned char) bh->b_data[*offset] | |
| 64 | (unsigned char) bh->b_data[*offset + 1] << 8; | 64 | (unsigned char) bh->b_data[*offset + 1] << 8; |
| 65 | *offset += 2; | 65 | *offset += 2; |
| 66 | |||
| 67 | if (*offset == msblk->devblksize) { | ||
| 68 | put_bh(bh); | ||
| 69 | bh = sb_bread(sb, ++(*cur_index)); | ||
| 70 | if (bh == NULL) | ||
| 71 | return NULL; | ||
| 72 | *offset = 0; | ||
| 73 | } | ||
| 66 | } | 74 | } |
| 67 | 75 | ||
| 68 | return bh; | 76 | return bh; |
diff --git a/fs/squashfs/xz_wrapper.c b/fs/squashfs/xz_wrapper.c index 856756ca5ee..c4eb4001825 100644 --- a/fs/squashfs/xz_wrapper.c +++ b/fs/squashfs/xz_wrapper.c | |||
| @@ -95,12 +95,6 @@ static int squashfs_xz_uncompress(struct squashfs_sb_info *msblk, void **buffer, | |||
| 95 | if (!buffer_uptodate(bh[k])) | 95 | if (!buffer_uptodate(bh[k])) |
| 96 | goto release_mutex; | 96 | goto release_mutex; |
| 97 | 97 | ||
| 98 | if (avail == 0) { | ||
| 99 | offset = 0; | ||
| 100 | put_bh(bh[k++]); | ||
| 101 | continue; | ||
| 102 | } | ||
| 103 | |||
| 104 | stream->buf.in = bh[k]->b_data + offset; | 98 | stream->buf.in = bh[k]->b_data + offset; |
| 105 | stream->buf.in_size = avail; | 99 | stream->buf.in_size = avail; |
| 106 | stream->buf.in_pos = 0; | 100 | stream->buf.in_pos = 0; |
diff --git a/fs/squashfs/zlib_wrapper.c b/fs/squashfs/zlib_wrapper.c index 818a5e063fa..4661ae2b1ce 100644 --- a/fs/squashfs/zlib_wrapper.c +++ b/fs/squashfs/zlib_wrapper.c | |||
| @@ -82,12 +82,6 @@ static int zlib_uncompress(struct squashfs_sb_info *msblk, void **buffer, | |||
| 82 | if (!buffer_uptodate(bh[k])) | 82 | if (!buffer_uptodate(bh[k])) |
| 83 | goto release_mutex; | 83 | goto release_mutex; |
| 84 | 84 | ||
| 85 | if (avail == 0) { | ||
| 86 | offset = 0; | ||
| 87 | put_bh(bh[k++]); | ||
| 88 | continue; | ||
| 89 | } | ||
| 90 | |||
| 91 | stream->next_in = bh[k]->b_data + offset; | 85 | stream->next_in = bh[k]->b_data + offset; |
| 92 | stream->avail_in = avail; | 86 | stream->avail_in = avail; |
| 93 | offset = 0; | 87 | offset = 0; |
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index e95a86b8b68..e5c607a02d5 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
| @@ -907,6 +907,7 @@ struct drm_radeon_cs { | |||
| 907 | #define RADEON_INFO_TILING_CONFIG 0x06 | 907 | #define RADEON_INFO_TILING_CONFIG 0x06 |
| 908 | #define RADEON_INFO_WANT_HYPERZ 0x07 | 908 | #define RADEON_INFO_WANT_HYPERZ 0x07 |
| 909 | #define RADEON_INFO_WANT_CMASK 0x08 /* get access to CMASK on r300 */ | 909 | #define RADEON_INFO_WANT_CMASK 0x08 /* get access to CMASK on r300 */ |
| 910 | #define RADEON_INFO_CLOCK_CRYSTAL_FREQ 0x09 /* clock crystal frequency */ | ||
| 910 | 911 | ||
| 911 | struct drm_radeon_info { | 912 | struct drm_radeon_info { |
| 912 | uint32_t request; | 913 | uint32_t request; |
diff --git a/include/linux/console.h b/include/linux/console.h index 9774fe6a1a9..7453cfd593c 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -139,9 +139,9 @@ extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_n | |||
| 139 | extern void register_console(struct console *); | 139 | extern void register_console(struct console *); |
| 140 | extern int unregister_console(struct console *); | 140 | extern int unregister_console(struct console *); |
| 141 | extern struct console *console_drivers; | 141 | extern struct console *console_drivers; |
| 142 | extern void acquire_console_sem(void); | 142 | extern void console_lock(void); |
| 143 | extern int try_acquire_console_sem(void); | 143 | extern int console_trylock(void); |
| 144 | extern void release_console_sem(void); | 144 | extern void console_unlock(void); |
| 145 | extern void console_conditional_schedule(void); | 145 | extern void console_conditional_schedule(void); |
| 146 | extern void console_unblank(void); | 146 | extern void console_unblank(void); |
| 147 | extern struct tty_driver *console_device(int *); | 147 | extern struct tty_driver *console_device(int *); |
diff --git a/include/linux/input/bu21013.h b/include/linux/input/bu21013.h index e470d387dd4..05e03284b92 100644 --- a/include/linux/input/bu21013.h +++ b/include/linux/input/bu21013.h | |||
| @@ -12,8 +12,6 @@ | |||
| 12 | * @cs_en: pointer to the cs enable function | 12 | * @cs_en: pointer to the cs enable function |
| 13 | * @cs_dis: pointer to the cs disable function | 13 | * @cs_dis: pointer to the cs disable function |
| 14 | * @irq_read_val: pointer to read the pen irq value function | 14 | * @irq_read_val: pointer to read the pen irq value function |
| 15 | * @x_max_res: xmax resolution | ||
| 16 | * @y_max_res: ymax resolution | ||
| 17 | * @touch_x_max: touch x max | 15 | * @touch_x_max: touch x max |
| 18 | * @touch_y_max: touch y max | 16 | * @touch_y_max: touch y max |
| 19 | * @cs_pin: chip select pin | 17 | * @cs_pin: chip select pin |
| @@ -29,8 +27,6 @@ struct bu21013_platform_device { | |||
| 29 | int (*cs_en)(int reset_pin); | 27 | int (*cs_en)(int reset_pin); |
| 30 | int (*cs_dis)(int reset_pin); | 28 | int (*cs_dis)(int reset_pin); |
| 31 | int (*irq_read_val)(void); | 29 | int (*irq_read_val)(void); |
| 32 | int x_max_res; | ||
| 33 | int y_max_res; | ||
| 34 | int touch_x_max; | 30 | int touch_x_max; |
| 35 | int touch_y_max; | 31 | int touch_y_max; |
| 36 | unsigned int cs_pin; | 32 | unsigned int cs_pin; |
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index bf173502d74..38d39309281 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
| @@ -94,12 +94,12 @@ struct sh_mmcif_plat_data { | |||
| 94 | 94 | ||
| 95 | static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) | 95 | static inline u32 sh_mmcif_readl(void __iomem *addr, int reg) |
| 96 | { | 96 | { |
| 97 | return readl(addr + reg); | 97 | return __raw_readl(addr + reg); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) | 100 | static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) |
| 101 | { | 101 | { |
| 102 | writel(val, addr + reg); | 102 | __raw_writel(val, addr + reg); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | #define SH_MMCIF_BBS 512 /* boot block size */ | 105 | #define SH_MMCIF_BBS 512 /* boot block size */ |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 387fa7d05c9..7faf933cced 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
| @@ -17,6 +17,9 @@ | |||
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | 19 | ||
| 20 | /* Enable/disable SYSRQ support by default (0==no, 1==yes). */ | ||
| 21 | #define SYSRQ_DEFAULT_ENABLE 1 | ||
| 22 | |||
| 20 | /* Possible values of bitmask for enabling sysrq functions */ | 23 | /* Possible values of bitmask for enabling sysrq functions */ |
| 21 | /* 0x0001 is reserved for enable everything */ | 24 | /* 0x0001 is reserved for enable everything */ |
| 22 | #define SYSRQ_ENABLE_LOG 0x0002 | 25 | #define SYSRQ_ENABLE_LOG 0x0002 |
diff --git a/kernel/printk.c b/kernel/printk.c index 53d9a9ec88e..2ddbdc73aad 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
| @@ -97,7 +97,7 @@ static int console_locked, console_suspended; | |||
| 97 | /* | 97 | /* |
| 98 | * logbuf_lock protects log_buf, log_start, log_end, con_start and logged_chars | 98 | * logbuf_lock protects log_buf, log_start, log_end, con_start and logged_chars |
| 99 | * It is also used in interesting ways to provide interlocking in | 99 | * It is also used in interesting ways to provide interlocking in |
| 100 | * release_console_sem(). | 100 | * console_unlock();. |
| 101 | */ | 101 | */ |
| 102 | static DEFINE_SPINLOCK(logbuf_lock); | 102 | static DEFINE_SPINLOCK(logbuf_lock); |
| 103 | 103 | ||
| @@ -501,7 +501,7 @@ static void _call_console_drivers(unsigned start, | |||
| 501 | /* | 501 | /* |
| 502 | * Call the console drivers, asking them to write out | 502 | * Call the console drivers, asking them to write out |
| 503 | * log_buf[start] to log_buf[end - 1]. | 503 | * log_buf[start] to log_buf[end - 1]. |
| 504 | * The console_sem must be held. | 504 | * The console_lock must be held. |
| 505 | */ | 505 | */ |
| 506 | static void call_console_drivers(unsigned start, unsigned end) | 506 | static void call_console_drivers(unsigned start, unsigned end) |
| 507 | { | 507 | { |
| @@ -604,11 +604,11 @@ static int have_callable_console(void) | |||
| 604 | * | 604 | * |
| 605 | * This is printk(). It can be called from any context. We want it to work. | 605 | * This is printk(). It can be called from any context. We want it to work. |
| 606 | * | 606 | * |
| 607 | * We try to grab the console_sem. If we succeed, it's easy - we log the output and | 607 | * We try to grab the console_lock. If we succeed, it's easy - we log the output and |
| 608 | * call the console drivers. If we fail to get the semaphore we place the output | 608 | * call the console drivers. If we fail to get the semaphore we place the output |
| 609 | * into the log buffer and return. The current holder of the console_sem will | 609 | * into the log buffer and return. The current holder of the console_sem will |
| 610 | * notice the new output in release_console_sem() and will send it to the | 610 | * notice the new output in console_unlock(); and will send it to the |
| 611 | * consoles before releasing the semaphore. | 611 | * consoles before releasing the lock. |
| 612 | * | 612 | * |
| 613 | * One effect of this deferred printing is that code which calls printk() and | 613 | * One effect of this deferred printing is that code which calls printk() and |
| 614 | * then changes console_loglevel may break. This is because console_loglevel | 614 | * then changes console_loglevel may break. This is because console_loglevel |
| @@ -659,19 +659,19 @@ static inline int can_use_console(unsigned int cpu) | |||
| 659 | /* | 659 | /* |
| 660 | * Try to get console ownership to actually show the kernel | 660 | * Try to get console ownership to actually show the kernel |
| 661 | * messages from a 'printk'. Return true (and with the | 661 | * messages from a 'printk'. Return true (and with the |
| 662 | * console_semaphore held, and 'console_locked' set) if it | 662 | * console_lock held, and 'console_locked' set) if it |
| 663 | * is successful, false otherwise. | 663 | * is successful, false otherwise. |
| 664 | * | 664 | * |
| 665 | * This gets called with the 'logbuf_lock' spinlock held and | 665 | * This gets called with the 'logbuf_lock' spinlock held and |
| 666 | * interrupts disabled. It should return with 'lockbuf_lock' | 666 | * interrupts disabled. It should return with 'lockbuf_lock' |
| 667 | * released but interrupts still disabled. | 667 | * released but interrupts still disabled. |
| 668 | */ | 668 | */ |
| 669 | static int acquire_console_semaphore_for_printk(unsigned int cpu) | 669 | static int console_trylock_for_printk(unsigned int cpu) |
| 670 | __releases(&logbuf_lock) | 670 | __releases(&logbuf_lock) |
| 671 | { | 671 | { |
| 672 | int retval = 0; | 672 | int retval = 0; |
| 673 | 673 | ||
| 674 | if (!try_acquire_console_sem()) { | 674 | if (console_trylock()) { |
| 675 | retval = 1; | 675 | retval = 1; |
| 676 | 676 | ||
| 677 | /* | 677 | /* |
| @@ -827,12 +827,12 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
| 827 | * actual magic (print out buffers, wake up klogd, | 827 | * actual magic (print out buffers, wake up klogd, |
| 828 | * etc). | 828 | * etc). |
| 829 | * | 829 | * |
| 830 | * The acquire_console_semaphore_for_printk() function | 830 | * The console_trylock_for_printk() function |
| 831 | * will release 'logbuf_lock' regardless of whether it | 831 | * will release 'logbuf_lock' regardless of whether it |
| 832 | * actually gets the semaphore or not. | 832 | * actually gets the semaphore or not. |
| 833 | */ | 833 | */ |
| 834 | if (acquire_console_semaphore_for_printk(this_cpu)) | 834 | if (console_trylock_for_printk(this_cpu)) |
| 835 | release_console_sem(); | 835 | console_unlock(); |
| 836 | 836 | ||
| 837 | lockdep_on(); | 837 | lockdep_on(); |
| 838 | out_restore_irqs: | 838 | out_restore_irqs: |
| @@ -993,7 +993,7 @@ void suspend_console(void) | |||
| 993 | if (!console_suspend_enabled) | 993 | if (!console_suspend_enabled) |
| 994 | return; | 994 | return; |
| 995 | printk("Suspending console(s) (use no_console_suspend to debug)\n"); | 995 | printk("Suspending console(s) (use no_console_suspend to debug)\n"); |
| 996 | acquire_console_sem(); | 996 | console_lock(); |
| 997 | console_suspended = 1; | 997 | console_suspended = 1; |
| 998 | up(&console_sem); | 998 | up(&console_sem); |
| 999 | } | 999 | } |
| @@ -1004,7 +1004,7 @@ void resume_console(void) | |||
| 1004 | return; | 1004 | return; |
| 1005 | down(&console_sem); | 1005 | down(&console_sem); |
| 1006 | console_suspended = 0; | 1006 | console_suspended = 0; |
| 1007 | release_console_sem(); | 1007 | console_unlock(); |
| 1008 | } | 1008 | } |
| 1009 | 1009 | ||
| 1010 | /** | 1010 | /** |
| @@ -1027,21 +1027,21 @@ static int __cpuinit console_cpu_notify(struct notifier_block *self, | |||
| 1027 | case CPU_DYING: | 1027 | case CPU_DYING: |
| 1028 | case CPU_DOWN_FAILED: | 1028 | case CPU_DOWN_FAILED: |
| 1029 | case CPU_UP_CANCELED: | 1029 | case CPU_UP_CANCELED: |
| 1030 | acquire_console_sem(); | 1030 | console_lock(); |
| 1031 | release_console_sem(); | 1031 | console_unlock(); |
| 1032 | } | 1032 | } |
| 1033 | return NOTIFY_OK; | 1033 | return NOTIFY_OK; |
| 1034 | } | 1034 | } |
| 1035 | 1035 | ||
| 1036 | /** | 1036 | /** |
| 1037 | * acquire_console_sem - lock the console system for exclusive use. | 1037 | * console_lock - lock the console system for exclusive use. |
| 1038 | * | 1038 | * |
| 1039 | * Acquires a semaphore which guarantees that the caller has | 1039 | * Acquires a lock which guarantees that the caller has |
| 1040 | * exclusive access to the console system and the console_drivers list. | 1040 | * exclusive access to the console system and the console_drivers list. |
| 1041 | * | 1041 | * |
| 1042 | * Can sleep, returns nothing. | 1042 | * Can sleep, returns nothing. |
| 1043 | */ | 1043 | */ |
| 1044 | void acquire_console_sem(void) | 1044 | void console_lock(void) |
| 1045 | { | 1045 | { |
| 1046 | BUG_ON(in_interrupt()); | 1046 | BUG_ON(in_interrupt()); |
| 1047 | down(&console_sem); | 1047 | down(&console_sem); |
| @@ -1050,21 +1050,29 @@ void acquire_console_sem(void) | |||
| 1050 | console_locked = 1; | 1050 | console_locked = 1; |
| 1051 | console_may_schedule = 1; | 1051 | console_may_schedule = 1; |
| 1052 | } | 1052 | } |
| 1053 | EXPORT_SYMBOL(acquire_console_sem); | 1053 | EXPORT_SYMBOL(console_lock); |
| 1054 | 1054 | ||
| 1055 | int try_acquire_console_sem(void) | 1055 | /** |
| 1056 | * console_trylock - try to lock the console system for exclusive use. | ||
| 1057 | * | ||
| 1058 | * Tried to acquire a lock which guarantees that the caller has | ||
| 1059 | * exclusive access to the console system and the console_drivers list. | ||
| 1060 | * | ||
| 1061 | * returns 1 on success, and 0 on failure to acquire the lock. | ||
| 1062 | */ | ||
| 1063 | int console_trylock(void) | ||
| 1056 | { | 1064 | { |
| 1057 | if (down_trylock(&console_sem)) | 1065 | if (down_trylock(&console_sem)) |
| 1058 | return -1; | 1066 | return 0; |
| 1059 | if (console_suspended) { | 1067 | if (console_suspended) { |
| 1060 | up(&console_sem); | 1068 | up(&console_sem); |
| 1061 | return -1; | 1069 | return 0; |
| 1062 | } | 1070 | } |
| 1063 | console_locked = 1; | 1071 | console_locked = 1; |
| 1064 | console_may_schedule = 0; | 1072 | console_may_schedule = 0; |
| 1065 | return 0; | 1073 | return 1; |
| 1066 | } | 1074 | } |
| 1067 | EXPORT_SYMBOL(try_acquire_console_sem); | 1075 | EXPORT_SYMBOL(console_trylock); |
| 1068 | 1076 | ||
| 1069 | int is_console_locked(void) | 1077 | int is_console_locked(void) |
| 1070 | { | 1078 | { |
| @@ -1095,20 +1103,20 @@ void wake_up_klogd(void) | |||
| 1095 | } | 1103 | } |
| 1096 | 1104 | ||
| 1097 | /** | 1105 | /** |
| 1098 | * release_console_sem - unlock the console system | 1106 | * console_unlock - unlock the console system |
| 1099 | * | 1107 | * |
| 1100 | * Releases the semaphore which the caller holds on the console system | 1108 | * Releases the console_lock which the caller holds on the console system |
| 1101 | * and the console driver list. | 1109 | * and the console driver list. |
| 1102 | * | 1110 | * |
| 1103 | * While the semaphore was held, console output may have been buffered | 1111 | * While the console_lock was held, console output may have been buffered |
| 1104 | * by printk(). If this is the case, release_console_sem() emits | 1112 | * by printk(). If this is the case, console_unlock(); emits |
| 1105 | * the output prior to releasing the semaphore. | 1113 | * the output prior to releasing the lock. |
| 1106 | * | 1114 | * |
| 1107 | * If there is output waiting for klogd, we wake it up. | 1115 | * If there is output waiting for klogd, we wake it up. |
| 1108 | * | 1116 | * |
| 1109 | * release_console_sem() may be called from any context. | 1117 | * console_unlock(); may be called from any context. |
| 1110 | */ | 1118 | */ |
| 1111 | void release_console_sem(void) | 1119 | void console_unlock(void) |
| 1112 | { | 1120 | { |
| 1113 | unsigned long flags; | 1121 | unsigned long flags; |
| 1114 | unsigned _con_start, _log_end; | 1122 | unsigned _con_start, _log_end; |
| @@ -1141,7 +1149,7 @@ void release_console_sem(void) | |||
| 1141 | if (wake_klogd) | 1149 | if (wake_klogd) |
| 1142 | wake_up_klogd(); | 1150 | wake_up_klogd(); |
| 1143 | } | 1151 | } |
| 1144 | EXPORT_SYMBOL(release_console_sem); | 1152 | EXPORT_SYMBOL(console_unlock); |
| 1145 | 1153 | ||
| 1146 | /** | 1154 | /** |
| 1147 | * console_conditional_schedule - yield the CPU if required | 1155 | * console_conditional_schedule - yield the CPU if required |
| @@ -1150,7 +1158,7 @@ EXPORT_SYMBOL(release_console_sem); | |||
| 1150 | * if this CPU should yield the CPU to another task, do | 1158 | * if this CPU should yield the CPU to another task, do |
| 1151 | * so here. | 1159 | * so here. |
| 1152 | * | 1160 | * |
| 1153 | * Must be called within acquire_console_sem(). | 1161 | * Must be called within console_lock();. |
| 1154 | */ | 1162 | */ |
| 1155 | void __sched console_conditional_schedule(void) | 1163 | void __sched console_conditional_schedule(void) |
| 1156 | { | 1164 | { |
| @@ -1171,14 +1179,14 @@ void console_unblank(void) | |||
| 1171 | if (down_trylock(&console_sem) != 0) | 1179 | if (down_trylock(&console_sem) != 0) |
| 1172 | return; | 1180 | return; |
| 1173 | } else | 1181 | } else |
| 1174 | acquire_console_sem(); | 1182 | console_lock(); |
| 1175 | 1183 | ||
| 1176 | console_locked = 1; | 1184 | console_locked = 1; |
| 1177 | console_may_schedule = 0; | 1185 | console_may_schedule = 0; |
| 1178 | for_each_console(c) | 1186 | for_each_console(c) |
| 1179 | if ((c->flags & CON_ENABLED) && c->unblank) | 1187 | if ((c->flags & CON_ENABLED) && c->unblank) |
| 1180 | c->unblank(); | 1188 | c->unblank(); |
| 1181 | release_console_sem(); | 1189 | console_unlock(); |
| 1182 | } | 1190 | } |
| 1183 | 1191 | ||
| 1184 | /* | 1192 | /* |
| @@ -1189,7 +1197,7 @@ struct tty_driver *console_device(int *index) | |||
| 1189 | struct console *c; | 1197 | struct console *c; |
| 1190 | struct tty_driver *driver = NULL; | 1198 | struct tty_driver *driver = NULL; |
| 1191 | 1199 | ||
| 1192 | acquire_console_sem(); | 1200 | console_lock(); |
| 1193 | for_each_console(c) { | 1201 | for_each_console(c) { |
| 1194 | if (!c->device) | 1202 | if (!c->device) |
| 1195 | continue; | 1203 | continue; |
| @@ -1197,7 +1205,7 @@ struct tty_driver *console_device(int *index) | |||
| 1197 | if (driver) | 1205 | if (driver) |
| 1198 | break; | 1206 | break; |
| 1199 | } | 1207 | } |
| 1200 | release_console_sem(); | 1208 | console_unlock(); |
| 1201 | return driver; | 1209 | return driver; |
| 1202 | } | 1210 | } |
| 1203 | 1211 | ||
| @@ -1208,17 +1216,17 @@ struct tty_driver *console_device(int *index) | |||
| 1208 | */ | 1216 | */ |
| 1209 | void console_stop(struct console *console) | 1217 | void console_stop(struct console *console) |
| 1210 | { | 1218 | { |
| 1211 | acquire_console_sem(); | 1219 | console_lock(); |
| 1212 | console->flags &= ~CON_ENABLED; | 1220 | console->flags &= ~CON_ENABLED; |
| 1213 | release_console_sem(); | 1221 | console_unlock(); |
| 1214 | } | 1222 | } |
| 1215 | EXPORT_SYMBOL(console_stop); | 1223 | EXPORT_SYMBOL(console_stop); |
| 1216 | 1224 | ||
| 1217 | void console_start(struct console *console) | 1225 | void console_start(struct console *console) |
| 1218 | { | 1226 | { |
| 1219 | acquire_console_sem(); | 1227 | console_lock(); |
| 1220 | console->flags |= CON_ENABLED; | 1228 | console->flags |= CON_ENABLED; |
| 1221 | release_console_sem(); | 1229 | console_unlock(); |
| 1222 | } | 1230 | } |
| 1223 | EXPORT_SYMBOL(console_start); | 1231 | EXPORT_SYMBOL(console_start); |
| 1224 | 1232 | ||
| @@ -1340,7 +1348,7 @@ void register_console(struct console *newcon) | |||
| 1340 | * Put this console in the list - keep the | 1348 | * Put this console in the list - keep the |
| 1341 | * preferred driver at the head of the list. | 1349 | * preferred driver at the head of the list. |
| 1342 | */ | 1350 | */ |
| 1343 | acquire_console_sem(); | 1351 | console_lock(); |
| 1344 | if ((newcon->flags & CON_CONSDEV) || console_drivers == NULL) { | 1352 | if ((newcon->flags & CON_CONSDEV) || console_drivers == NULL) { |
| 1345 | newcon->next = console_drivers; | 1353 | newcon->next = console_drivers; |
| 1346 | console_drivers = newcon; | 1354 | console_drivers = newcon; |
| @@ -1352,14 +1360,14 @@ void register_console(struct console *newcon) | |||
| 1352 | } | 1360 | } |
| 1353 | if (newcon->flags & CON_PRINTBUFFER) { | 1361 | if (newcon->flags & CON_PRINTBUFFER) { |
| 1354 | /* | 1362 | /* |
| 1355 | * release_console_sem() will print out the buffered messages | 1363 | * console_unlock(); will print out the buffered messages |
| 1356 | * for us. | 1364 | * for us. |
| 1357 | */ | 1365 | */ |
| 1358 | spin_lock_irqsave(&logbuf_lock, flags); | 1366 | spin_lock_irqsave(&logbuf_lock, flags); |
| 1359 | con_start = log_start; | 1367 | con_start = log_start; |
| 1360 | spin_unlock_irqrestore(&logbuf_lock, flags); | 1368 | spin_unlock_irqrestore(&logbuf_lock, flags); |
| 1361 | } | 1369 | } |
| 1362 | release_console_sem(); | 1370 | console_unlock(); |
| 1363 | console_sysfs_notify(); | 1371 | console_sysfs_notify(); |
| 1364 | 1372 | ||
| 1365 | /* | 1373 | /* |
| @@ -1396,7 +1404,7 @@ int unregister_console(struct console *console) | |||
| 1396 | return braille_unregister_console(console); | 1404 | return braille_unregister_console(console); |
| 1397 | #endif | 1405 | #endif |
| 1398 | 1406 | ||
| 1399 | acquire_console_sem(); | 1407 | console_lock(); |
| 1400 | if (console_drivers == console) { | 1408 | if (console_drivers == console) { |
| 1401 | console_drivers=console->next; | 1409 | console_drivers=console->next; |
| 1402 | res = 0; | 1410 | res = 0; |
| @@ -1418,7 +1426,7 @@ int unregister_console(struct console *console) | |||
| 1418 | if (console_drivers != NULL && console->flags & CON_CONSDEV) | 1426 | if (console_drivers != NULL && console->flags & CON_CONSDEV) |
| 1419 | console_drivers->flags |= CON_CONSDEV; | 1427 | console_drivers->flags |= CON_CONSDEV; |
| 1420 | 1428 | ||
| 1421 | release_console_sem(); | 1429 | console_unlock(); |
| 1422 | console_sysfs_notify(); | 1430 | console_sysfs_notify(); |
| 1423 | return res; | 1431 | return res; |
| 1424 | } | 1432 | } |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index bc86bb32e12..0f1bd83db98 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -170,7 +170,8 @@ static int proc_taint(struct ctl_table *table, int write, | |||
| 170 | #endif | 170 | #endif |
| 171 | 171 | ||
| 172 | #ifdef CONFIG_MAGIC_SYSRQ | 172 | #ifdef CONFIG_MAGIC_SYSRQ |
| 173 | static int __sysrq_enabled; /* Note: sysrq code ises it's own private copy */ | 173 | /* Note: sysrq code uses it's own private copy */ |
| 174 | static int __sysrq_enabled = SYSRQ_DEFAULT_ENABLE; | ||
| 174 | 175 | ||
| 175 | static int sysrq_sysctl_handler(ctl_table *table, int write, | 176 | static int sysrq_sysctl_handler(ctl_table *table, int write, |
| 176 | void __user *buffer, size_t *lenp, | 177 | void __user *buffer, size_t *lenp, |
diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 5086bb962b4..7ea2e033d71 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c | |||
| @@ -736,10 +736,11 @@ next: | |||
| 736 | } | 736 | } |
| 737 | } | 737 | } |
| 738 | /* | 738 | /* |
| 739 | * The iftag must have been set somewhere because otherwise | 739 | * We need not to tag the root tag if there is no tag which is set with |
| 740 | * we would return immediated at the beginning of the function | 740 | * settag within the range from *first_indexp to last_index. |
| 741 | */ | 741 | */ |
| 742 | root_tag_set(root, settag); | 742 | if (tagged > 0) |
| 743 | root_tag_set(root, settag); | ||
| 743 | *first_indexp = index; | 744 | *first_indexp = index; |
| 744 | 745 | ||
| 745 | return tagged; | 746 | return tagged; |
diff --git a/mm/Kconfig b/mm/Kconfig index 3ad483bdf50..e9c0c61f2dd 100644 --- a/mm/Kconfig +++ b/mm/Kconfig | |||
| @@ -179,7 +179,7 @@ config SPLIT_PTLOCK_CPUS | |||
| 179 | config COMPACTION | 179 | config COMPACTION |
| 180 | bool "Allow for memory compaction" | 180 | bool "Allow for memory compaction" |
| 181 | select MIGRATION | 181 | select MIGRATION |
| 182 | depends on EXPERIMENTAL && HUGETLB_PAGE && MMU | 182 | depends on MMU |
| 183 | help | 183 | help |
| 184 | Allows the compaction of memory for the allocation of huge pages. | 184 | Allows the compaction of memory for the allocation of huge pages. |
| 185 | 185 | ||
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index db76ef72629..3878cfe399d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
| @@ -1832,6 +1832,7 @@ static int __mem_cgroup_do_charge(struct mem_cgroup *mem, gfp_t gfp_mask, | |||
| 1832 | if (likely(!ret)) | 1832 | if (likely(!ret)) |
| 1833 | return CHARGE_OK; | 1833 | return CHARGE_OK; |
| 1834 | 1834 | ||
| 1835 | res_counter_uncharge(&mem->res, csize); | ||
| 1835 | mem_over_limit = mem_cgroup_from_res_counter(fail_res, memsw); | 1836 | mem_over_limit = mem_cgroup_from_res_counter(fail_res, memsw); |
| 1836 | flags |= MEM_CGROUP_RECLAIM_NOSWAP; | 1837 | flags |= MEM_CGROUP_RECLAIM_NOSWAP; |
| 1837 | } else | 1838 | } else |
| @@ -2144,6 +2145,8 @@ void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail) | |||
| 2144 | struct page_cgroup *tail_pc = lookup_page_cgroup(tail); | 2145 | struct page_cgroup *tail_pc = lookup_page_cgroup(tail); |
| 2145 | unsigned long flags; | 2146 | unsigned long flags; |
| 2146 | 2147 | ||
| 2148 | if (mem_cgroup_disabled()) | ||
| 2149 | return; | ||
| 2147 | /* | 2150 | /* |
| 2148 | * We have no races with charge/uncharge but will have races with | 2151 | * We have no races with charge/uncharge but will have races with |
| 2149 | * page state accounting. | 2152 | * page state accounting. |
| @@ -2233,7 +2236,12 @@ static int mem_cgroup_move_account(struct page_cgroup *pc, | |||
| 2233 | { | 2236 | { |
| 2234 | int ret = -EINVAL; | 2237 | int ret = -EINVAL; |
| 2235 | unsigned long flags; | 2238 | unsigned long flags; |
| 2236 | 2239 | /* | |
| 2240 | * The page is isolated from LRU. So, collapse function | ||
| 2241 | * will not handle this page. But page splitting can happen. | ||
| 2242 | * Do this check under compound_page_lock(). The caller should | ||
| 2243 | * hold it. | ||
| 2244 | */ | ||
| 2237 | if ((charge_size > PAGE_SIZE) && !PageTransHuge(pc->page)) | 2245 | if ((charge_size > PAGE_SIZE) && !PageTransHuge(pc->page)) |
| 2238 | return -EBUSY; | 2246 | return -EBUSY; |
| 2239 | 2247 | ||
| @@ -2265,7 +2273,7 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc, | |||
| 2265 | struct cgroup *cg = child->css.cgroup; | 2273 | struct cgroup *cg = child->css.cgroup; |
| 2266 | struct cgroup *pcg = cg->parent; | 2274 | struct cgroup *pcg = cg->parent; |
| 2267 | struct mem_cgroup *parent; | 2275 | struct mem_cgroup *parent; |
| 2268 | int charge = PAGE_SIZE; | 2276 | int page_size = PAGE_SIZE; |
| 2269 | unsigned long flags; | 2277 | unsigned long flags; |
| 2270 | int ret; | 2278 | int ret; |
| 2271 | 2279 | ||
| @@ -2278,23 +2286,26 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc, | |||
| 2278 | goto out; | 2286 | goto out; |
| 2279 | if (isolate_lru_page(page)) | 2287 | if (isolate_lru_page(page)) |
| 2280 | goto put; | 2288 | goto put; |
| 2281 | /* The page is isolated from LRU and we have no race with splitting */ | 2289 | |
| 2282 | charge = PAGE_SIZE << compound_order(page); | 2290 | if (PageTransHuge(page)) |
| 2291 | page_size = HPAGE_SIZE; | ||
| 2283 | 2292 | ||
| 2284 | parent = mem_cgroup_from_cont(pcg); | 2293 | parent = mem_cgroup_from_cont(pcg); |
| 2285 | ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false, charge); | 2294 | ret = __mem_cgroup_try_charge(NULL, gfp_mask, |
| 2295 | &parent, false, page_size); | ||
| 2286 | if (ret || !parent) | 2296 | if (ret || !parent) |
| 2287 | goto put_back; | 2297 | goto put_back; |
| 2288 | 2298 | ||
| 2289 | if (charge > PAGE_SIZE) | 2299 | if (page_size > PAGE_SIZE) |
| 2290 | flags = compound_lock_irqsave(page); | 2300 | flags = compound_lock_irqsave(page); |
| 2291 | 2301 | ||
| 2292 | ret = mem_cgroup_move_account(pc, child, parent, true, charge); | 2302 | ret = mem_cgroup_move_account(pc, child, parent, true, page_size); |
| 2293 | if (ret) | 2303 | if (ret) |
| 2294 | mem_cgroup_cancel_charge(parent, charge); | 2304 | mem_cgroup_cancel_charge(parent, page_size); |
| 2295 | put_back: | 2305 | |
| 2296 | if (charge > PAGE_SIZE) | 2306 | if (page_size > PAGE_SIZE) |
| 2297 | compound_unlock_irqrestore(page, flags); | 2307 | compound_unlock_irqrestore(page, flags); |
| 2308 | put_back: | ||
| 2298 | putback_lru_page(page); | 2309 | putback_lru_page(page); |
| 2299 | put: | 2310 | put: |
| 2300 | put_page(page); | 2311 | put_page(page); |
diff --git a/mm/migrate.c b/mm/migrate.c index 46fe8cc13d6..9f29a3b7aac 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
| @@ -888,7 +888,7 @@ out: | |||
| 888 | * are movable anymore because to has become empty | 888 | * are movable anymore because to has become empty |
| 889 | * or no retryable pages exist anymore. | 889 | * or no retryable pages exist anymore. |
| 890 | * Caller should call putback_lru_pages to return pages to the LRU | 890 | * Caller should call putback_lru_pages to return pages to the LRU |
| 891 | * or free list. | 891 | * or free list only if ret != 0. |
| 892 | * | 892 | * |
| 893 | * Return: Number of pages not migrated or error code. | 893 | * Return: Number of pages not migrated or error code. |
| 894 | */ | 894 | */ |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 90c1439549f..a873e61e312 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -1088,8 +1088,10 @@ static void drain_pages(unsigned int cpu) | |||
| 1088 | pset = per_cpu_ptr(zone->pageset, cpu); | 1088 | pset = per_cpu_ptr(zone->pageset, cpu); |
| 1089 | 1089 | ||
| 1090 | pcp = &pset->pcp; | 1090 | pcp = &pset->pcp; |
| 1091 | free_pcppages_bulk(zone, pcp->count, pcp); | 1091 | if (pcp->count) { |
| 1092 | pcp->count = 0; | 1092 | free_pcppages_bulk(zone, pcp->count, pcp); |
| 1093 | pcp->count = 0; | ||
| 1094 | } | ||
| 1093 | local_irq_restore(flags); | 1095 | local_irq_restore(flags); |
| 1094 | } | 1096 | } |
| 1095 | } | 1097 | } |
| @@ -2034,6 +2036,14 @@ restart: | |||
| 2034 | */ | 2036 | */ |
| 2035 | alloc_flags = gfp_to_alloc_flags(gfp_mask); | 2037 | alloc_flags = gfp_to_alloc_flags(gfp_mask); |
| 2036 | 2038 | ||
| 2039 | /* | ||
| 2040 | * Find the true preferred zone if the allocation is unconstrained by | ||
| 2041 | * cpusets. | ||
| 2042 | */ | ||
| 2043 | if (!(alloc_flags & ALLOC_CPUSET) && !nodemask) | ||
| 2044 | first_zones_zonelist(zonelist, high_zoneidx, NULL, | ||
| 2045 | &preferred_zone); | ||
| 2046 | |||
| 2037 | /* This is the last chance, in general, before the goto nopage. */ | 2047 | /* This is the last chance, in general, before the goto nopage. */ |
| 2038 | page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist, | 2048 | page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist, |
| 2039 | high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS, | 2049 | high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS, |
| @@ -2192,7 +2202,9 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | |||
| 2192 | 2202 | ||
| 2193 | get_mems_allowed(); | 2203 | get_mems_allowed(); |
| 2194 | /* The preferred zone is used for statistics later */ | 2204 | /* The preferred zone is used for statistics later */ |
| 2195 | first_zones_zonelist(zonelist, high_zoneidx, nodemask, &preferred_zone); | 2205 | first_zones_zonelist(zonelist, high_zoneidx, |
| 2206 | nodemask ? : &cpuset_current_mems_allowed, | ||
| 2207 | &preferred_zone); | ||
| 2196 | if (!preferred_zone) { | 2208 | if (!preferred_zone) { |
| 2197 | put_mems_allowed(); | 2209 | put_mems_allowed(); |
| 2198 | return NULL; | 2210 | return NULL; |
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 0369f5b3ba1..eb663fb533e 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | * Copyright (C) 2010 Linus Torvalds | 6 | * Copyright (C) 2010 Linus Torvalds |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/pagemap.h> | ||
| 9 | #include <asm/tlb.h> | 10 | #include <asm/tlb.h> |
| 10 | #include <asm-generic/pgtable.h> | 11 | #include <asm-generic/pgtable.h> |
| 11 | 12 | ||
diff --git a/mm/vmscan.c b/mm/vmscan.c index f5d90dedebb..148c6e630df 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
| @@ -2083,7 +2083,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
| 2083 | struct zone *preferred_zone; | 2083 | struct zone *preferred_zone; |
| 2084 | 2084 | ||
| 2085 | first_zones_zonelist(zonelist, gfp_zone(sc->gfp_mask), | 2085 | first_zones_zonelist(zonelist, gfp_zone(sc->gfp_mask), |
| 2086 | NULL, &preferred_zone); | 2086 | &cpuset_current_mems_allowed, |
| 2087 | &preferred_zone); | ||
| 2087 | wait_iff_congested(preferred_zone, BLK_RW_ASYNC, HZ/10); | 2088 | wait_iff_congested(preferred_zone, BLK_RW_ASYNC, HZ/10); |
| 2088 | } | 2089 | } |
| 2089 | } | 2090 | } |
diff --git a/security/keys/internal.h b/security/keys/internal.h index edfa50dbd6f..a52aa7c88b4 100644 --- a/security/keys/internal.h +++ b/security/keys/internal.h | |||
| @@ -87,13 +87,13 @@ extern void key_type_put(struct key_type *ktype); | |||
| 87 | extern int __key_link_begin(struct key *keyring, | 87 | extern int __key_link_begin(struct key *keyring, |
| 88 | const struct key_type *type, | 88 | const struct key_type *type, |
| 89 | const char *description, | 89 | const char *description, |
| 90 | struct keyring_list **_prealloc); | 90 | unsigned long *_prealloc); |
| 91 | extern int __key_link_check_live_key(struct key *keyring, struct key *key); | 91 | extern int __key_link_check_live_key(struct key *keyring, struct key *key); |
| 92 | extern void __key_link(struct key *keyring, struct key *key, | 92 | extern void __key_link(struct key *keyring, struct key *key, |
| 93 | struct keyring_list **_prealloc); | 93 | unsigned long *_prealloc); |
| 94 | extern void __key_link_end(struct key *keyring, | 94 | extern void __key_link_end(struct key *keyring, |
| 95 | struct key_type *type, | 95 | struct key_type *type, |
| 96 | struct keyring_list *prealloc); | 96 | unsigned long prealloc); |
| 97 | 97 | ||
| 98 | extern key_ref_t __keyring_search_one(key_ref_t keyring_ref, | 98 | extern key_ref_t __keyring_search_one(key_ref_t keyring_ref, |
| 99 | const struct key_type *type, | 99 | const struct key_type *type, |
diff --git a/security/keys/key.c b/security/keys/key.c index 84d4eb568b0..1c2d43dc510 100644 --- a/security/keys/key.c +++ b/security/keys/key.c | |||
| @@ -415,7 +415,7 @@ static int __key_instantiate_and_link(struct key *key, | |||
| 415 | size_t datalen, | 415 | size_t datalen, |
| 416 | struct key *keyring, | 416 | struct key *keyring, |
| 417 | struct key *authkey, | 417 | struct key *authkey, |
| 418 | struct keyring_list **_prealloc) | 418 | unsigned long *_prealloc) |
| 419 | { | 419 | { |
| 420 | int ret, awaken; | 420 | int ret, awaken; |
| 421 | 421 | ||
| @@ -481,7 +481,7 @@ int key_instantiate_and_link(struct key *key, | |||
| 481 | struct key *keyring, | 481 | struct key *keyring, |
| 482 | struct key *authkey) | 482 | struct key *authkey) |
| 483 | { | 483 | { |
| 484 | struct keyring_list *prealloc; | 484 | unsigned long prealloc; |
| 485 | int ret; | 485 | int ret; |
| 486 | 486 | ||
| 487 | if (keyring) { | 487 | if (keyring) { |
| @@ -526,7 +526,7 @@ int key_negate_and_link(struct key *key, | |||
| 526 | struct key *keyring, | 526 | struct key *keyring, |
| 527 | struct key *authkey) | 527 | struct key *authkey) |
| 528 | { | 528 | { |
| 529 | struct keyring_list *prealloc; | 529 | unsigned long prealloc; |
| 530 | struct timespec now; | 530 | struct timespec now; |
| 531 | int ret, awaken, link_ret = 0; | 531 | int ret, awaken, link_ret = 0; |
| 532 | 532 | ||
| @@ -814,7 +814,7 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref, | |||
| 814 | key_perm_t perm, | 814 | key_perm_t perm, |
| 815 | unsigned long flags) | 815 | unsigned long flags) |
| 816 | { | 816 | { |
| 817 | struct keyring_list *prealloc; | 817 | unsigned long prealloc; |
| 818 | const struct cred *cred = current_cred(); | 818 | const struct cred *cred = current_cred(); |
| 819 | struct key_type *ktype; | 819 | struct key_type *ktype; |
| 820 | struct key *keyring, *key = NULL; | 820 | struct key *keyring, *key = NULL; |
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 92024ed12e0..5620f084ded 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | (keyring)->payload.subscriptions, \ | 25 | (keyring)->payload.subscriptions, \ |
| 26 | rwsem_is_locked((struct rw_semaphore *)&(keyring)->sem))) | 26 | rwsem_is_locked((struct rw_semaphore *)&(keyring)->sem))) |
| 27 | 27 | ||
| 28 | #define KEY_LINK_FIXQUOTA 1UL | ||
| 29 | |||
| 28 | /* | 30 | /* |
| 29 | * When plumbing the depths of the key tree, this sets a hard limit | 31 | * When plumbing the depths of the key tree, this sets a hard limit |
| 30 | * set on how deep we're willing to go. | 32 | * set on how deep we're willing to go. |
| @@ -699,11 +701,11 @@ static void keyring_unlink_rcu_disposal(struct rcu_head *rcu) | |||
| 699 | * Preallocate memory so that a key can be linked into to a keyring. | 701 | * Preallocate memory so that a key can be linked into to a keyring. |
| 700 | */ | 702 | */ |
| 701 | int __key_link_begin(struct key *keyring, const struct key_type *type, | 703 | int __key_link_begin(struct key *keyring, const struct key_type *type, |
| 702 | const char *description, | 704 | const char *description, unsigned long *_prealloc) |
| 703 | struct keyring_list **_prealloc) | ||
| 704 | __acquires(&keyring->sem) | 705 | __acquires(&keyring->sem) |
| 705 | { | 706 | { |
| 706 | struct keyring_list *klist, *nklist; | 707 | struct keyring_list *klist, *nklist; |
| 708 | unsigned long prealloc; | ||
| 707 | unsigned max; | 709 | unsigned max; |
| 708 | size_t size; | 710 | size_t size; |
| 709 | int loop, ret; | 711 | int loop, ret; |
| @@ -746,6 +748,7 @@ int __key_link_begin(struct key *keyring, const struct key_type *type, | |||
| 746 | 748 | ||
| 747 | /* note replacement slot */ | 749 | /* note replacement slot */ |
| 748 | klist->delkey = nklist->delkey = loop; | 750 | klist->delkey = nklist->delkey = loop; |
| 751 | prealloc = (unsigned long)nklist; | ||
| 749 | goto done; | 752 | goto done; |
| 750 | } | 753 | } |
| 751 | } | 754 | } |
| @@ -760,6 +763,7 @@ int __key_link_begin(struct key *keyring, const struct key_type *type, | |||
| 760 | if (klist && klist->nkeys < klist->maxkeys) { | 763 | if (klist && klist->nkeys < klist->maxkeys) { |
| 761 | /* there's sufficient slack space to append directly */ | 764 | /* there's sufficient slack space to append directly */ |
| 762 | nklist = NULL; | 765 | nklist = NULL; |
| 766 | prealloc = KEY_LINK_FIXQUOTA; | ||
| 763 | } else { | 767 | } else { |
| 764 | /* grow the key list */ | 768 | /* grow the key list */ |
| 765 | max = 4; | 769 | max = 4; |
| @@ -794,8 +798,9 @@ int __key_link_begin(struct key *keyring, const struct key_type *type, | |||
| 794 | nklist->keys[nklist->delkey] = NULL; | 798 | nklist->keys[nklist->delkey] = NULL; |
| 795 | } | 799 | } |
| 796 | 800 | ||
| 801 | prealloc = (unsigned long)nklist | KEY_LINK_FIXQUOTA; | ||
| 797 | done: | 802 | done: |
| 798 | *_prealloc = nklist; | 803 | *_prealloc = prealloc; |
| 799 | kleave(" = 0"); | 804 | kleave(" = 0"); |
| 800 | return 0; | 805 | return 0; |
| 801 | 806 | ||
| @@ -836,12 +841,12 @@ int __key_link_check_live_key(struct key *keyring, struct key *key) | |||
| 836 | * combination. | 841 | * combination. |
| 837 | */ | 842 | */ |
| 838 | void __key_link(struct key *keyring, struct key *key, | 843 | void __key_link(struct key *keyring, struct key *key, |
| 839 | struct keyring_list **_prealloc) | 844 | unsigned long *_prealloc) |
| 840 | { | 845 | { |
| 841 | struct keyring_list *klist, *nklist; | 846 | struct keyring_list *klist, *nklist; |
| 842 | 847 | ||
| 843 | nklist = *_prealloc; | 848 | nklist = (struct keyring_list *)(*_prealloc & ~KEY_LINK_FIXQUOTA); |
| 844 | *_prealloc = NULL; | 849 | *_prealloc = 0; |
| 845 | 850 | ||
| 846 | kenter("%d,%d,%p", keyring->serial, key->serial, nklist); | 851 | kenter("%d,%d,%p", keyring->serial, key->serial, nklist); |
| 847 | 852 | ||
| @@ -881,20 +886,22 @@ void __key_link(struct key *keyring, struct key *key, | |||
| 881 | * Must be called with __key_link_begin() having being called. | 886 | * Must be called with __key_link_begin() having being called. |
| 882 | */ | 887 | */ |
| 883 | void __key_link_end(struct key *keyring, struct key_type *type, | 888 | void __key_link_end(struct key *keyring, struct key_type *type, |
| 884 | struct keyring_list *prealloc) | 889 | unsigned long prealloc) |
| 885 | __releases(&keyring->sem) | 890 | __releases(&keyring->sem) |
| 886 | { | 891 | { |
| 887 | BUG_ON(type == NULL); | 892 | BUG_ON(type == NULL); |
| 888 | BUG_ON(type->name == NULL); | 893 | BUG_ON(type->name == NULL); |
| 889 | kenter("%d,%s,%p", keyring->serial, type->name, prealloc); | 894 | kenter("%d,%s,%lx", keyring->serial, type->name, prealloc); |
| 890 | 895 | ||
| 891 | if (type == &key_type_keyring) | 896 | if (type == &key_type_keyring) |
| 892 | up_write(&keyring_serialise_link_sem); | 897 | up_write(&keyring_serialise_link_sem); |
| 893 | 898 | ||
| 894 | if (prealloc) { | 899 | if (prealloc) { |
| 895 | kfree(prealloc); | 900 | if (prealloc & KEY_LINK_FIXQUOTA) |
| 896 | key_payload_reserve(keyring, | 901 | key_payload_reserve(keyring, |
| 897 | keyring->datalen - KEYQUOTA_LINK_BYTES); | 902 | keyring->datalen - |
| 903 | KEYQUOTA_LINK_BYTES); | ||
| 904 | kfree((struct keyring_list *)(prealloc & ~KEY_LINK_FIXQUOTA)); | ||
| 898 | } | 905 | } |
| 899 | up_write(&keyring->sem); | 906 | up_write(&keyring->sem); |
| 900 | } | 907 | } |
| @@ -921,7 +928,7 @@ void __key_link_end(struct key *keyring, struct key_type *type, | |||
| 921 | */ | 928 | */ |
| 922 | int key_link(struct key *keyring, struct key *key) | 929 | int key_link(struct key *keyring, struct key *key) |
| 923 | { | 930 | { |
| 924 | struct keyring_list *prealloc; | 931 | unsigned long prealloc; |
| 925 | int ret; | 932 | int ret; |
| 926 | 933 | ||
| 927 | key_check(keyring); | 934 | key_check(keyring); |
diff --git a/security/keys/request_key.c b/security/keys/request_key.c index 9a7fb3914b2..a3dc0d460de 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c | |||
| @@ -352,8 +352,8 @@ static int construct_alloc_key(struct key_type *type, | |||
| 352 | struct key_user *user, | 352 | struct key_user *user, |
| 353 | struct key **_key) | 353 | struct key **_key) |
| 354 | { | 354 | { |
| 355 | struct keyring_list *prealloc; | ||
| 356 | const struct cred *cred = current_cred(); | 355 | const struct cred *cred = current_cred(); |
| 356 | unsigned long prealloc; | ||
| 357 | struct key *key; | 357 | struct key *key; |
| 358 | key_ref_t key_ref; | 358 | key_ref_t key_ref; |
| 359 | int ret; | 359 | int ret; |
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 91acc9a243e..24d3013c023 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | 30 | ||
| 31 | #define DRIVER_NAME "aaci-pl041" | 31 | #define DRIVER_NAME "aaci-pl041" |
| 32 | 32 | ||
| 33 | #define FRAME_PERIOD_US 21 | ||
| 34 | |||
| 33 | /* | 35 | /* |
| 34 | * PM support is not complete. Turn it off. | 36 | * PM support is not complete. Turn it off. |
| 35 | */ | 37 | */ |
| @@ -64,8 +66,8 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
| 64 | unsigned short val) | 66 | unsigned short val) |
| 65 | { | 67 | { |
| 66 | struct aaci *aaci = ac97->private_data; | 68 | struct aaci *aaci = ac97->private_data; |
| 69 | int timeout; | ||
| 67 | u32 v; | 70 | u32 v; |
| 68 | int timeout = 5000; | ||
| 69 | 71 | ||
| 70 | if (ac97->num >= 4) | 72 | if (ac97->num >= 4) |
| 71 | return; | 73 | return; |
| @@ -81,14 +83,17 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
| 81 | writel(val << 4, aaci->base + AACI_SL2TX); | 83 | writel(val << 4, aaci->base + AACI_SL2TX); |
| 82 | writel(reg << 12, aaci->base + AACI_SL1TX); | 84 | writel(reg << 12, aaci->base + AACI_SL1TX); |
| 83 | 85 | ||
| 84 | /* | 86 | /* Initially, wait one frame period */ |
| 85 | * Wait for the transmission of both slots to complete. | 87 | udelay(FRAME_PERIOD_US); |
| 86 | */ | 88 | |
| 89 | /* And then wait an additional eight frame periods for it to be sent */ | ||
| 90 | timeout = FRAME_PERIOD_US * 8; | ||
| 87 | do { | 91 | do { |
| 92 | udelay(1); | ||
| 88 | v = readl(aaci->base + AACI_SLFR); | 93 | v = readl(aaci->base + AACI_SLFR); |
| 89 | } while ((v & (SLFR_1TXB|SLFR_2TXB)) && --timeout); | 94 | } while ((v & (SLFR_1TXB|SLFR_2TXB)) && --timeout); |
| 90 | 95 | ||
| 91 | if (!timeout) | 96 | if (v & (SLFR_1TXB|SLFR_2TXB)) |
| 92 | dev_err(&aaci->dev->dev, | 97 | dev_err(&aaci->dev->dev, |
| 93 | "timeout waiting for write to complete\n"); | 98 | "timeout waiting for write to complete\n"); |
| 94 | 99 | ||
| @@ -101,9 +106,8 @@ static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
| 101 | static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg) | 106 | static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg) |
| 102 | { | 107 | { |
| 103 | struct aaci *aaci = ac97->private_data; | 108 | struct aaci *aaci = ac97->private_data; |
| 109 | int timeout, retries = 10; | ||
| 104 | u32 v; | 110 | u32 v; |
| 105 | int timeout = 5000; | ||
| 106 | int retries = 10; | ||
| 107 | 111 | ||
| 108 | if (ac97->num >= 4) | 112 | if (ac97->num >= 4) |
| 109 | return ~0; | 113 | return ~0; |
| @@ -117,35 +121,34 @@ static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg) | |||
| 117 | */ | 121 | */ |
| 118 | writel((reg << 12) | (1 << 19), aaci->base + AACI_SL1TX); | 122 | writel((reg << 12) | (1 << 19), aaci->base + AACI_SL1TX); |
| 119 | 123 | ||
| 120 | /* | 124 | /* Initially, wait one frame period */ |
| 121 | * Wait for the transmission to complete. | 125 | udelay(FRAME_PERIOD_US); |
| 122 | */ | 126 | |
| 127 | /* And then wait an additional eight frame periods for it to be sent */ | ||
| 128 | timeout = FRAME_PERIOD_US * 8; | ||
| 123 | do { | 129 | do { |
| 130 | udelay(1); | ||
| 124 | v = readl(aaci->base + AACI_SLFR); | 131 | v = readl(aaci->base + AACI_SLFR); |
| 125 | } while ((v & SLFR_1TXB) && --timeout); | 132 | } while ((v & SLFR_1TXB) && --timeout); |
| 126 | 133 | ||
| 127 | if (!timeout) { | 134 | if (v & SLFR_1TXB) { |
| 128 | dev_err(&aaci->dev->dev, "timeout on slot 1 TX busy\n"); | 135 | dev_err(&aaci->dev->dev, "timeout on slot 1 TX busy\n"); |
| 129 | v = ~0; | 136 | v = ~0; |
| 130 | goto out; | 137 | goto out; |
| 131 | } | 138 | } |
| 132 | 139 | ||
| 133 | /* | 140 | /* Now wait for the response frame */ |
| 134 | * Give the AC'97 codec more than enough time | 141 | udelay(FRAME_PERIOD_US); |
| 135 | * to respond. (42us = ~2 frames at 48kHz.) | ||
| 136 | */ | ||
| 137 | udelay(42); | ||
| 138 | 142 | ||
| 139 | /* | 143 | /* And then wait an additional eight frame periods for data */ |
| 140 | * Wait for slot 2 to indicate data. | 144 | timeout = FRAME_PERIOD_US * 8; |
| 141 | */ | ||
| 142 | timeout = 5000; | ||
| 143 | do { | 145 | do { |
| 146 | udelay(1); | ||
| 144 | cond_resched(); | 147 | cond_resched(); |
| 145 | v = readl(aaci->base + AACI_SLFR) & (SLFR_1RXV|SLFR_2RXV); | 148 | v = readl(aaci->base + AACI_SLFR) & (SLFR_1RXV|SLFR_2RXV); |
| 146 | } while ((v != (SLFR_1RXV|SLFR_2RXV)) && --timeout); | 149 | } while ((v != (SLFR_1RXV|SLFR_2RXV)) && --timeout); |
| 147 | 150 | ||
| 148 | if (!timeout) { | 151 | if (v != (SLFR_1RXV|SLFR_2RXV)) { |
| 149 | dev_err(&aaci->dev->dev, "timeout on RX valid\n"); | 152 | dev_err(&aaci->dev->dev, "timeout on RX valid\n"); |
| 150 | v = ~0; | 153 | v = ~0; |
| 151 | goto out; | 154 | goto out; |
| @@ -179,6 +182,7 @@ aaci_chan_wait_ready(struct aaci_runtime *aacirun, unsigned long mask) | |||
| 179 | int timeout = 5000; | 182 | int timeout = 5000; |
| 180 | 183 | ||
| 181 | do { | 184 | do { |
| 185 | udelay(1); | ||
| 182 | val = readl(aacirun->base + AACI_SR); | 186 | val = readl(aacirun->base + AACI_SR); |
| 183 | } while (val & mask && timeout--); | 187 | } while (val & mask && timeout--); |
| 184 | } | 188 | } |
| @@ -874,7 +878,7 @@ static int __devinit aaci_probe_ac97(struct aaci *aaci) | |||
| 874 | * Give the AC'97 codec more than enough time | 878 | * Give the AC'97 codec more than enough time |
| 875 | * to wake up. (42us = ~2 frames at 48kHz.) | 879 | * to wake up. (42us = ~2 frames at 48kHz.) |
| 876 | */ | 880 | */ |
| 877 | udelay(42); | 881 | udelay(FRAME_PERIOD_US * 2); |
| 878 | 882 | ||
| 879 | ret = snd_ac97_bus(aaci->card, 0, &aaci_bus_ops, aaci, &ac97_bus); | 883 | ret = snd_ac97_bus(aaci->card, 0, &aaci_bus_ops, aaci, &ac97_bus); |
| 880 | if (ret) | 884 | if (ret) |
