diff options
71 files changed, 511 insertions, 288 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 736d4560288..e7848a0d99e 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -199,6 +199,10 @@ and is between 256 and 4096 characters. It is defined in the file | |||
| 199 | acpi_display_output=video | 199 | acpi_display_output=video |
| 200 | See above. | 200 | See above. |
| 201 | 201 | ||
| 202 | acpi_early_pdc_eval [HW,ACPI] Evaluate processor _PDC methods | ||
| 203 | early. Needed on some platforms to properly | ||
| 204 | initialize the EC. | ||
| 205 | |||
| 202 | acpi_irq_balance [HW,ACPI] | 206 | acpi_irq_balance [HW,ACPI] |
| 203 | ACPI will balance active IRQs | 207 | ACPI will balance active IRQs |
| 204 | default in APIC mode | 208 | default in APIC mode |
| @@ -311,6 +315,11 @@ and is between 256 and 4096 characters. It is defined in the file | |||
| 311 | aic79xx= [HW,SCSI] | 315 | aic79xx= [HW,SCSI] |
| 312 | See Documentation/scsi/aic79xx.txt. | 316 | See Documentation/scsi/aic79xx.txt. |
| 313 | 317 | ||
| 318 | alignment= [KNL,ARM] | ||
| 319 | Allow the default userspace alignment fault handler | ||
| 320 | behaviour to be specified. Bit 0 enables warnings, | ||
| 321 | bit 1 enables fixups, and bit 2 sends a segfault. | ||
| 322 | |||
| 314 | amd_iommu= [HW,X86-84] | 323 | amd_iommu= [HW,X86-84] |
| 315 | Pass parameters to the AMD IOMMU driver in the system. | 324 | Pass parameters to the AMD IOMMU driver in the system. |
| 316 | Possible values are: | 325 | Possible values are: |
diff --git a/MAINTAINERS b/MAINTAINERS index 412eff60c33..c95f727236e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -616,10 +616,10 @@ M: Richard Purdie <rpurdie@rpsys.net> | |||
| 616 | S: Maintained | 616 | S: Maintained |
| 617 | 617 | ||
| 618 | ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE | 618 | ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE |
| 619 | M: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 619 | M: Paulius Zaleckas <paulius.zaleckas@gmail.com> |
| 620 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 620 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 621 | T: git git://gitorious.org/linux-gemini/mainline.git | 621 | T: git git://gitorious.org/linux-gemini/mainline.git |
| 622 | S: Maintained | 622 | S: Odd Fixes |
| 623 | F: arch/arm/mach-gemini/ | 623 | F: arch/arm/mach-gemini/ |
| 624 | 624 | ||
| 625 | ARM/EBSA110 MACHINE SUPPORT | 625 | ARM/EBSA110 MACHINE SUPPORT |
| @@ -641,9 +641,9 @@ T: topgit git://git.openezx.org/openezx.git | |||
| 641 | F: arch/arm/mach-pxa/ezx.c | 641 | F: arch/arm/mach-pxa/ezx.c |
| 642 | 642 | ||
| 643 | ARM/FARADAY FA526 PORT | 643 | ARM/FARADAY FA526 PORT |
| 644 | M: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 644 | M: Paulius Zaleckas <paulius.zaleckas@gmail.com> |
| 645 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 645 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 646 | S: Maintained | 646 | S: Odd Fixes |
| 647 | F: arch/arm/mm/*-fa* | 647 | F: arch/arm/mm/*-fa* |
| 648 | 648 | ||
| 649 | ARM/FOOTBRIDGE ARCHITECTURE | 649 | ARM/FOOTBRIDGE ARCHITECTURE |
| @@ -1733,10 +1733,9 @@ F: include/linux/tfrc.h | |||
| 1733 | F: net/dccp/ | 1733 | F: net/dccp/ |
| 1734 | 1734 | ||
| 1735 | DECnet NETWORK LAYER | 1735 | DECnet NETWORK LAYER |
| 1736 | M: Christine Caulfield <christine.caulfield@googlemail.com> | ||
| 1737 | W: http://linux-decnet.sourceforge.net | 1736 | W: http://linux-decnet.sourceforge.net |
| 1738 | L: linux-decnet-user@lists.sourceforge.net | 1737 | L: linux-decnet-user@lists.sourceforge.net |
| 1739 | S: Maintained | 1738 | S: Orphan |
| 1740 | F: Documentation/networking/decnet.txt | 1739 | F: Documentation/networking/decnet.txt |
| 1741 | F: net/decnet/ | 1740 | F: net/decnet/ |
| 1742 | 1741 | ||
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index c77d2fa1f6e..8113bb5fb66 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h | |||
| @@ -42,7 +42,8 @@ | |||
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | #if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \ | 44 | #if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \ |
| 45 | defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) | 45 | defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \ |
| 46 | defined(CONFIG_CPU_ARM1026) | ||
| 46 | # define MULTI_CACHE 1 | 47 | # define MULTI_CACHE 1 |
| 47 | #endif | 48 | #endif |
| 48 | 49 | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index c6c57b640b6..621acad8ea4 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
| @@ -102,6 +102,7 @@ struct cpu_cache_fns cpu_cache; | |||
| 102 | #endif | 102 | #endif |
| 103 | #ifdef CONFIG_OUTER_CACHE | 103 | #ifdef CONFIG_OUTER_CACHE |
| 104 | struct outer_cache_fns outer_cache; | 104 | struct outer_cache_fns outer_cache; |
| 105 | EXPORT_SYMBOL(outer_cache); | ||
| 105 | #endif | 106 | #endif |
| 106 | 107 | ||
| 107 | struct stack { | 108 | struct stack { |
diff --git a/arch/arm/mach-gemini/gpio.c b/arch/arm/mach-gemini/gpio.c index e7263854bc7..fe3bd5ac8b1 100644 --- a/arch/arm/mach-gemini/gpio.c +++ b/arch/arm/mach-gemini/gpio.c | |||
| @@ -86,7 +86,7 @@ static int gpio_set_irq_type(unsigned int irq, unsigned int type) | |||
| 86 | unsigned int reg_both, reg_level, reg_type; | 86 | unsigned int reg_both, reg_level, reg_type; |
| 87 | 87 | ||
| 88 | reg_type = __raw_readl(base + GPIO_INT_TYPE); | 88 | reg_type = __raw_readl(base + GPIO_INT_TYPE); |
| 89 | reg_level = __raw_readl(base + GPIO_INT_BOTH_EDGE); | 89 | reg_level = __raw_readl(base + GPIO_INT_LEVEL); |
| 90 | reg_both = __raw_readl(base + GPIO_INT_BOTH_EDGE); | 90 | reg_both = __raw_readl(base + GPIO_INT_BOTH_EDGE); |
| 91 | 91 | ||
| 92 | switch (type) { | 92 | switch (type) { |
| @@ -117,7 +117,7 @@ static int gpio_set_irq_type(unsigned int irq, unsigned int type) | |||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | __raw_writel(reg_type, base + GPIO_INT_TYPE); | 119 | __raw_writel(reg_type, base + GPIO_INT_TYPE); |
| 120 | __raw_writel(reg_level, base + GPIO_INT_BOTH_EDGE); | 120 | __raw_writel(reg_level, base + GPIO_INT_LEVEL); |
| 121 | __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE); | 121 | __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE); |
| 122 | 122 | ||
| 123 | gpio_ack_irq(irq); | 123 | gpio_ack_irq(irq); |
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 5fedc50c58e..5fef73f4743 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
| @@ -961,16 +961,14 @@ static void __init omap_mux_init_list(struct omap_mux *superset) | |||
| 961 | while (superset->reg_offset != OMAP_MUX_TERMINATOR) { | 961 | while (superset->reg_offset != OMAP_MUX_TERMINATOR) { |
| 962 | struct omap_mux *entry; | 962 | struct omap_mux *entry; |
| 963 | 963 | ||
| 964 | #ifndef CONFIG_OMAP_MUX | 964 | #ifdef CONFIG_OMAP_MUX |
| 965 | /* Skip pins that are not muxed as GPIO by bootloader */ | 965 | if (!superset->muxnames || !superset->muxnames[0]) { |
| 966 | if (!OMAP_MODE_GPIO(omap_mux_read(superset->reg_offset))) { | ||
| 967 | superset++; | 966 | superset++; |
| 968 | continue; | 967 | continue; |
| 969 | } | 968 | } |
| 970 | #endif | 969 | #else |
| 971 | 970 | /* Skip pins that are not muxed as GPIO by bootloader */ | |
| 972 | #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_DEBUG_FS) | 971 | if (!OMAP_MODE_GPIO(omap_mux_read(superset->reg_offset))) { |
| 973 | if (!superset->muxnames || !superset->muxnames[0]) { | ||
| 974 | superset++; | 972 | superset++; |
| 975 | continue; | 973 | continue; |
| 976 | } | 974 | } |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index b270d6228fe..62820eda84d 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | * it under the terms of the GNU General Public License version 2 as | 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
| 13 | */ | 13 | */ |
| 14 | #include <linux/moduleparam.h> | ||
| 14 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
| 15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 16 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| @@ -77,6 +78,8 @@ static unsigned long ai_dword; | |||
| 77 | static unsigned long ai_multi; | 78 | static unsigned long ai_multi; |
| 78 | static int ai_usermode; | 79 | static int ai_usermode; |
| 79 | 80 | ||
| 81 | core_param(alignment, ai_usermode, int, 0600); | ||
| 82 | |||
| 80 | #define UM_WARN (1 << 0) | 83 | #define UM_WARN (1 << 0) |
| 81 | #define UM_FIXUP (1 << 1) | 84 | #define UM_FIXUP (1 << 1) |
| 82 | #define UM_SIGNAL (1 << 2) | 85 | #define UM_SIGNAL (1 << 2) |
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 5a79fc6ee81..31c2f4c30a9 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | # | 12 | # |
| 13 | # http://www.arm.linux.org.uk/developer/machines/?action=new | 13 | # http://www.arm.linux.org.uk/developer/machines/?action=new |
| 14 | # | 14 | # |
| 15 | # Last update: Thu Jan 28 22:15:54 2010 | 15 | # Last update: Sat Feb 20 14:16:15 2010 |
| 16 | # | 16 | # |
| 17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number | 17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number |
| 18 | # | 18 | # |
| @@ -2257,7 +2257,7 @@ oratisalog MACH_ORATISALOG ORATISALOG 2268 | |||
| 2257 | oratismadi MACH_ORATISMADI ORATISMADI 2269 | 2257 | oratismadi MACH_ORATISMADI ORATISMADI 2269 |
| 2258 | oratisot16 MACH_ORATISOT16 ORATISOT16 2270 | 2258 | oratisot16 MACH_ORATISOT16 ORATISOT16 2270 |
| 2259 | oratisdesk MACH_ORATISDESK ORATISDESK 2271 | 2259 | oratisdesk MACH_ORATISDESK ORATISDESK 2271 |
| 2260 | v2_ca9 MACH_V2P_CA9 V2P_CA9 2272 | 2260 | vexpress MACH_VEXPRESS VEXPRESS 2272 |
| 2261 | sintexo MACH_SINTEXO SINTEXO 2273 | 2261 | sintexo MACH_SINTEXO SINTEXO 2273 |
| 2262 | cm3389 MACH_CM3389 CM3389 2274 | 2262 | cm3389 MACH_CM3389 CM3389 2274 |
| 2263 | omap3_cio MACH_OMAP3_CIO OMAP3_CIO 2275 | 2263 | omap3_cio MACH_OMAP3_CIO OMAP3_CIO 2275 |
| @@ -2636,3 +2636,45 @@ hw90240 MACH_HW90240 HW90240 2648 | |||
| 2636 | dm365_leopard MACH_DM365_LEOPARD DM365_LEOPARD 2649 | 2636 | dm365_leopard MACH_DM365_LEOPARD DM365_LEOPARD 2649 |
| 2637 | mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650 | 2637 | mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650 |
| 2638 | scat110 MACH_SCAT110 SCAT110 2651 | 2638 | scat110 MACH_SCAT110 SCAT110 2651 |
| 2639 | acer_a1 MACH_ACER_A1 ACER_A1 2652 | ||
| 2640 | cmcontrol MACH_CMCONTROL CMCONTROL 2653 | ||
| 2641 | pelco_lamar MACH_PELCO_LAMAR PELCO_LAMAR 2654 | ||
| 2642 | rfp43 MACH_RFP43 RFP43 2655 | ||
| 2643 | sk86r0301 MACH_SK86R0301 SK86R0301 2656 | ||
| 2644 | ctpxa MACH_CTPXA CTPXA 2657 | ||
| 2645 | epb_arm9_a MACH_EPB_ARM9_A EPB_ARM9_A 2658 | ||
| 2646 | guruplug MACH_GURUPLUG GURUPLUG 2659 | ||
| 2647 | spear310 MACH_SPEAR310 SPEAR310 2660 | ||
| 2648 | spear320 MACH_SPEAR320 SPEAR320 2661 | ||
| 2649 | robotx MACH_ROBOTX ROBOTX 2662 | ||
| 2650 | lsxhl MACH_LSXHL LSXHL 2663 | ||
| 2651 | smartlite MACH_SMARTLITE SMARTLITE 2664 | ||
| 2652 | cws2 MACH_CWS2 CWS2 2665 | ||
| 2653 | m619 MACH_M619 M619 2666 | ||
| 2654 | smartview MACH_SMARTVIEW SMARTVIEW 2667 | ||
| 2655 | lsa_salsa MACH_LSA_SALSA LSA_SALSA 2668 | ||
| 2656 | kizbox MACH_KIZBOX KIZBOX 2669 | ||
| 2657 | htccharmer MACH_HTCCHARMER HTCCHARMER 2670 | ||
| 2658 | guf_neso_lt MACH_GUF_NESO_LT GUF_NESO_LT 2671 | ||
| 2659 | pm9g45 MACH_PM9G45 PM9G45 2672 | ||
| 2660 | htcpanther MACH_HTCPANTHER HTCPANTHER 2673 | ||
| 2661 | htcpanther_cdma MACH_HTCPANTHER_CDMA HTCPANTHER_CDMA 2674 | ||
| 2662 | reb01 MACH_REB01 REB01 2675 | ||
| 2663 | aquila MACH_AQUILA AQUILA 2676 | ||
| 2664 | spark_sls_hw2 MACH_SPARK_SLS_HW2 SPARK_SLS_HW2 2677 | ||
| 2665 | sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678 | ||
| 2666 | surf7x30 MACH_SURF7X30 SURF7X30 2679 | ||
| 2667 | micro2440 MACH_MICRO2440 MICRO2440 2680 | ||
| 2668 | am2440 MACH_AM2440 AM2440 2681 | ||
| 2669 | tq2440 MACH_TQ2440 TQ2440 2682 | ||
| 2670 | lpc2478oem MACH_LPC2478OEM LPC2478OEM 2683 | ||
| 2671 | ak880x MACH_AK880X AK880X 2684 | ||
| 2672 | cobra3530 MACH_COBRA3530 COBRA3530 2685 | ||
| 2673 | pmppb MACH_PMPPB PMPPB 2686 | ||
| 2674 | u6715 MACH_U6715 U6715 2687 | ||
| 2675 | axar1500_sender MACH_AXAR1500_SENDER AXAR1500_SENDER 2688 | ||
| 2676 | g30_dvb MACH_G30_DVB G30_DVB 2689 | ||
| 2677 | vc088x MACH_VC088X VC088X 2690 | ||
| 2678 | mioa702 MACH_MIOA702 MIOA702 2691 | ||
| 2679 | hpmin MACH_HPMIN HPMIN 2692 | ||
| 2680 | ak880xak MACH_AK880XAK AK880XAK 2693 | ||
diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h index 7ae58892ba8..e97b255d97b 100644 --- a/arch/ia64/include/asm/acpi.h +++ b/arch/ia64/include/asm/acpi.h | |||
| @@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned int *lock) | |||
| 94 | #define acpi_noirq 0 /* ACPI always enabled on IA64 */ | 94 | #define acpi_noirq 0 /* ACPI always enabled on IA64 */ |
| 95 | #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ | 95 | #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ |
| 96 | #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */ | 96 | #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */ |
| 97 | #define acpi_ht 0 /* no HT-only mode on IA64 */ | ||
| 97 | #endif | 98 | #endif |
| 98 | #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */ | 99 | #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */ |
| 99 | static inline void disable_acpi(void) { } | 100 | static inline void disable_acpi(void) { } |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 21f61b8c445..cc29c0f5300 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
| @@ -338,7 +338,8 @@ static void __init mpc85xx_mds_pic_init(void) | |||
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | mpic = mpic_alloc(np, r.start, | 340 | mpic = mpic_alloc(np, r.start, |
| 341 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN, | 341 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
| 342 | MPIC_BROKEN_FRR_NIRQS, | ||
| 342 | 0, 256, " OpenPIC "); | 343 | 0, 256, " OpenPIC "); |
| 343 | BUG_ON(mpic == NULL); | 344 | BUG_ON(mpic == NULL); |
| 344 | of_node_put(np); | 345 | of_node_put(np); |
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 04160a4cc69..a15f582300d 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c | |||
| @@ -46,6 +46,7 @@ smp_85xx_kick_cpu(int nr) | |||
| 46 | __iomem u32 *bptr_vaddr; | 46 | __iomem u32 *bptr_vaddr; |
| 47 | struct device_node *np; | 47 | struct device_node *np; |
| 48 | int n = 0; | 48 | int n = 0; |
| 49 | int ioremappable; | ||
| 49 | 50 | ||
| 50 | WARN_ON (nr < 0 || nr >= NR_CPUS); | 51 | WARN_ON (nr < 0 || nr >= NR_CPUS); |
| 51 | 52 | ||
| @@ -59,21 +60,37 @@ smp_85xx_kick_cpu(int nr) | |||
| 59 | return; | 60 | return; |
| 60 | } | 61 | } |
| 61 | 62 | ||
| 63 | /* | ||
| 64 | * A secondary core could be in a spinloop in the bootpage | ||
| 65 | * (0xfffff000), somewhere in highmem, or somewhere in lowmem. | ||
| 66 | * The bootpage and highmem can be accessed via ioremap(), but | ||
| 67 | * we need to directly access the spinloop if its in lowmem. | ||
| 68 | */ | ||
| 69 | ioremappable = *cpu_rel_addr > virt_to_phys(high_memory); | ||
| 70 | |||
| 62 | /* Map the spin table */ | 71 | /* Map the spin table */ |
| 63 | bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY); | 72 | if (ioremappable) |
| 73 | bptr_vaddr = ioremap(*cpu_rel_addr, SIZE_BOOT_ENTRY); | ||
| 74 | else | ||
| 75 | bptr_vaddr = phys_to_virt(*cpu_rel_addr); | ||
| 64 | 76 | ||
| 65 | local_irq_save(flags); | 77 | local_irq_save(flags); |
| 66 | 78 | ||
| 67 | out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr); | 79 | out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr); |
| 68 | out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start)); | 80 | out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start)); |
| 69 | 81 | ||
| 82 | if (!ioremappable) | ||
| 83 | flush_dcache_range((ulong)bptr_vaddr, | ||
| 84 | (ulong)(bptr_vaddr + SIZE_BOOT_ENTRY)); | ||
| 85 | |||
| 70 | /* Wait a bit for the CPU to ack. */ | 86 | /* Wait a bit for the CPU to ack. */ |
| 71 | while ((__secondary_hold_acknowledge != nr) && (++n < 1000)) | 87 | while ((__secondary_hold_acknowledge != nr) && (++n < 1000)) |
| 72 | mdelay(1); | 88 | mdelay(1); |
| 73 | 89 | ||
| 74 | local_irq_restore(flags); | 90 | local_irq_restore(flags); |
| 75 | 91 | ||
| 76 | iounmap(bptr_vaddr); | 92 | if (ioremappable) |
| 93 | iounmap(bptr_vaddr); | ||
| 77 | 94 | ||
| 78 | pr_debug("waited %d msecs for CPU #%d.\n", n, nr); | 95 | pr_debug("waited %d msecs for CPU #%d.\n", n, nr); |
| 79 | } | 96 | } |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 0acbcdfa5ca..af1c5833ff2 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -1344,14 +1344,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { | |||
| 1344 | }, | 1344 | }, |
| 1345 | { | 1345 | { |
| 1346 | .callback = force_acpi_ht, | 1346 | .callback = force_acpi_ht, |
| 1347 | .ident = "ASUS P2B-DS", | ||
| 1348 | .matches = { | ||
| 1349 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | ||
| 1350 | DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"), | ||
| 1351 | }, | ||
| 1352 | }, | ||
| 1353 | { | ||
| 1354 | .callback = force_acpi_ht, | ||
| 1355 | .ident = "ASUS CUR-DLS", | 1347 | .ident = "ASUS CUR-DLS", |
| 1356 | .matches = { | 1348 | .matches = { |
| 1357 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | 1349 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index bbc2c1315c4..b2586f57e1f 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
| @@ -935,6 +935,7 @@ static int dock_add(acpi_handle handle) | |||
| 935 | struct platform_device *dd; | 935 | struct platform_device *dd; |
| 936 | 936 | ||
| 937 | id = dock_station_count; | 937 | id = dock_station_count; |
| 938 | memset(&ds, 0, sizeof(ds)); | ||
| 938 | dd = platform_device_register_data(NULL, "dock", id, &ds, sizeof(ds)); | 939 | dd = platform_device_register_data(NULL, "dock", id, &ds, sizeof(ds)); |
| 939 | if (IS_ERR(dd)) | 940 | if (IS_ERR(dd)) |
| 940 | return PTR_ERR(dd); | 941 | return PTR_ERR(dd); |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 7c0441f63b3..e88e8ae04fd 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
| @@ -110,6 +110,14 @@ static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = { | |||
| 110 | DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), | 110 | DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), |
| 111 | DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")}, | 111 | DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")}, |
| 112 | (void *)2}, | 112 | (void *)2}, |
| 113 | { set_max_cstate, "Pavilion zv5000", { | ||
| 114 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
| 115 | DMI_MATCH(DMI_PRODUCT_NAME,"Pavilion zv5000 (DS502A#ABA)")}, | ||
| 116 | (void *)1}, | ||
| 117 | { set_max_cstate, "Asus L8400B", { | ||
| 118 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."), | ||
| 119 | DMI_MATCH(DMI_PRODUCT_NAME,"L8400B series Notebook PC")}, | ||
| 120 | (void *)1}, | ||
| 113 | {}, | 121 | {}, |
| 114 | }; | 122 | }; |
| 115 | 123 | ||
diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c index 7247819dbd8..e306ba9aa34 100644 --- a/drivers/acpi/processor_pdc.c +++ b/drivers/acpi/processor_pdc.c | |||
| @@ -125,6 +125,8 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) | |||
| 125 | return status; | 125 | return status; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | static int early_pdc_done; | ||
| 129 | |||
| 128 | void acpi_processor_set_pdc(acpi_handle handle) | 130 | void acpi_processor_set_pdc(acpi_handle handle) |
| 129 | { | 131 | { |
| 130 | struct acpi_object_list *obj_list; | 132 | struct acpi_object_list *obj_list; |
| @@ -132,6 +134,9 @@ void acpi_processor_set_pdc(acpi_handle handle) | |||
| 132 | if (arch_has_acpi_pdc() == false) | 134 | if (arch_has_acpi_pdc() == false) |
| 133 | return; | 135 | return; |
| 134 | 136 | ||
| 137 | if (early_pdc_done) | ||
| 138 | return; | ||
| 139 | |||
| 135 | obj_list = acpi_processor_alloc_pdc(); | 140 | obj_list = acpi_processor_alloc_pdc(); |
| 136 | if (!obj_list) | 141 | if (!obj_list) |
| 137 | return; | 142 | return; |
| @@ -151,6 +156,13 @@ static int set_early_pdc_optin(const struct dmi_system_id *id) | |||
| 151 | return 0; | 156 | return 0; |
| 152 | } | 157 | } |
| 153 | 158 | ||
| 159 | static int param_early_pdc_optin(char *s) | ||
| 160 | { | ||
| 161 | early_pdc_optin = 1; | ||
| 162 | return 1; | ||
| 163 | } | ||
| 164 | __setup("acpi_early_pdc_eval", param_early_pdc_optin); | ||
| 165 | |||
| 154 | static struct dmi_system_id __cpuinitdata early_pdc_optin_table[] = { | 166 | static struct dmi_system_id __cpuinitdata early_pdc_optin_table[] = { |
| 155 | { | 167 | { |
| 156 | set_early_pdc_optin, "HP Envy", { | 168 | set_early_pdc_optin, "HP Envy", { |
| @@ -192,4 +204,6 @@ void __init acpi_early_processor_set_pdc(void) | |||
| 192 | acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, | 204 | acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, |
| 193 | ACPI_UINT32_MAX, | 205 | ACPI_UINT32_MAX, |
| 194 | early_init_pdc, NULL, NULL, NULL); | 206 | early_init_pdc, NULL, NULL, NULL); |
| 207 | |||
| 208 | early_pdc_done = 1; | ||
| 195 | } | 209 | } |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index ff9f6226085..3e009674f33 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -1336,9 +1336,25 @@ static int acpi_bus_scan(acpi_handle handle, struct acpi_bus_ops *ops, | |||
| 1336 | 1336 | ||
| 1337 | if (child) | 1337 | if (child) |
| 1338 | *child = device; | 1338 | *child = device; |
| 1339 | return 0; | 1339 | |
| 1340 | if (device) | ||
| 1341 | return 0; | ||
| 1342 | else | ||
| 1343 | return -ENODEV; | ||
| 1340 | } | 1344 | } |
| 1341 | 1345 | ||
| 1346 | /* | ||
| 1347 | * acpi_bus_add and acpi_bus_start | ||
| 1348 | * | ||
| 1349 | * scan a given ACPI tree and (probably recently hot-plugged) | ||
| 1350 | * create and add or starts found devices. | ||
| 1351 | * | ||
| 1352 | * If no devices were found -ENODEV is returned which does not | ||
| 1353 | * mean that this is a real error, there just have been no suitable | ||
| 1354 | * ACPI objects in the table trunk from which the kernel could create | ||
| 1355 | * a device and add/start an appropriate driver. | ||
| 1356 | */ | ||
| 1357 | |||
| 1342 | int | 1358 | int |
| 1343 | acpi_bus_add(struct acpi_device **child, | 1359 | acpi_bus_add(struct acpi_device **child, |
| 1344 | struct acpi_device *parent, acpi_handle handle, int type) | 1360 | struct acpi_device *parent, acpi_handle handle, int type) |
| @@ -1348,8 +1364,7 @@ acpi_bus_add(struct acpi_device **child, | |||
| 1348 | memset(&ops, 0, sizeof(ops)); | 1364 | memset(&ops, 0, sizeof(ops)); |
| 1349 | ops.acpi_op_add = 1; | 1365 | ops.acpi_op_add = 1; |
| 1350 | 1366 | ||
| 1351 | acpi_bus_scan(handle, &ops, child); | 1367 | return acpi_bus_scan(handle, &ops, child); |
| 1352 | return 0; | ||
| 1353 | } | 1368 | } |
| 1354 | EXPORT_SYMBOL(acpi_bus_add); | 1369 | EXPORT_SYMBOL(acpi_bus_add); |
| 1355 | 1370 | ||
| @@ -1357,11 +1372,13 @@ int acpi_bus_start(struct acpi_device *device) | |||
| 1357 | { | 1372 | { |
| 1358 | struct acpi_bus_ops ops; | 1373 | struct acpi_bus_ops ops; |
| 1359 | 1374 | ||
| 1375 | if (!device) | ||
| 1376 | return -EINVAL; | ||
| 1377 | |||
| 1360 | memset(&ops, 0, sizeof(ops)); | 1378 | memset(&ops, 0, sizeof(ops)); |
| 1361 | ops.acpi_op_start = 1; | 1379 | ops.acpi_op_start = 1; |
| 1362 | 1380 | ||
| 1363 | acpi_bus_scan(device->handle, &ops, NULL); | 1381 | return acpi_bus_scan(device->handle, &ops, NULL); |
| 1364 | return 0; | ||
| 1365 | } | 1382 | } |
| 1366 | EXPORT_SYMBOL(acpi_bus_start); | 1383 | EXPORT_SYMBOL(acpi_bus_start); |
| 1367 | 1384 | ||
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index f336bca7c45..8a0ed2800e6 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
| @@ -213,7 +213,7 @@ acpi_table_parse_entries(char *id, | |||
| 213 | unsigned long table_end; | 213 | unsigned long table_end; |
| 214 | acpi_size tbl_size; | 214 | acpi_size tbl_size; |
| 215 | 215 | ||
| 216 | if (acpi_disabled) | 216 | if (acpi_disabled && !acpi_ht) |
| 217 | return -ENODEV; | 217 | return -ENODEV; |
| 218 | 218 | ||
| 219 | if (!handler) | 219 | if (!handler) |
| @@ -280,7 +280,7 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) | |||
| 280 | struct acpi_table_header *table = NULL; | 280 | struct acpi_table_header *table = NULL; |
| 281 | acpi_size tbl_size; | 281 | acpi_size tbl_size; |
| 282 | 282 | ||
| 283 | if (acpi_disabled) | 283 | if (acpi_disabled && !acpi_ht) |
| 284 | return -ENODEV; | 284 | return -ENODEV; |
| 285 | 285 | ||
| 286 | if (!handler) | 286 | if (!handler) |
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index f665b05592f..ab6c9733041 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
| @@ -598,6 +598,50 @@ struct drm_display_mode *drm_mode_std(struct drm_device *dev, | |||
| 598 | return mode; | 598 | return mode; |
| 599 | } | 599 | } |
| 600 | 600 | ||
| 601 | /* | ||
| 602 | * EDID is delightfully ambiguous about how interlaced modes are to be | ||
| 603 | * encoded. Our internal representation is of frame height, but some | ||
| 604 | * HDTV detailed timings are encoded as field height. | ||
| 605 | * | ||
| 606 | * The format list here is from CEA, in frame size. Technically we | ||
| 607 | * should be checking refresh rate too. Whatever. | ||
| 608 | */ | ||
| 609 | static void | ||
| 610 | drm_mode_do_interlace_quirk(struct drm_display_mode *mode, | ||
| 611 | struct detailed_pixel_timing *pt) | ||
| 612 | { | ||
| 613 | int i; | ||
| 614 | static const struct { | ||
| 615 | int w, h; | ||
| 616 | } cea_interlaced[] = { | ||
| 617 | { 1920, 1080 }, | ||
| 618 | { 720, 480 }, | ||
| 619 | { 1440, 480 }, | ||
| 620 | { 2880, 480 }, | ||
| 621 | { 720, 576 }, | ||
| 622 | { 1440, 576 }, | ||
| 623 | { 2880, 576 }, | ||
| 624 | }; | ||
| 625 | static const int n_sizes = | ||
| 626 | sizeof(cea_interlaced)/sizeof(cea_interlaced[0]); | ||
| 627 | |||
| 628 | if (!(pt->misc & DRM_EDID_PT_INTERLACED)) | ||
| 629 | return; | ||
| 630 | |||
| 631 | for (i = 0; i < n_sizes; i++) { | ||
| 632 | if ((mode->hdisplay == cea_interlaced[i].w) && | ||
| 633 | (mode->vdisplay == cea_interlaced[i].h / 2)) { | ||
| 634 | mode->vdisplay *= 2; | ||
| 635 | mode->vsync_start *= 2; | ||
| 636 | mode->vsync_end *= 2; | ||
| 637 | mode->vtotal *= 2; | ||
| 638 | mode->vtotal |= 1; | ||
| 639 | } | ||
| 640 | } | ||
| 641 | |||
| 642 | mode->flags |= DRM_MODE_FLAG_INTERLACE; | ||
| 643 | } | ||
| 644 | |||
| 601 | /** | 645 | /** |
| 602 | * drm_mode_detailed - create a new mode from an EDID detailed timing section | 646 | * drm_mode_detailed - create a new mode from an EDID detailed timing section |
| 603 | * @dev: DRM device (needed to create new mode) | 647 | * @dev: DRM device (needed to create new mode) |
| @@ -680,8 +724,7 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev, | |||
| 680 | 724 | ||
| 681 | drm_mode_set_name(mode); | 725 | drm_mode_set_name(mode); |
| 682 | 726 | ||
| 683 | if (pt->misc & DRM_EDID_PT_INTERLACED) | 727 | drm_mode_do_interlace_quirk(mode, pt); |
| 684 | mode->flags |= DRM_MODE_FLAG_INTERLACE; | ||
| 685 | 728 | ||
| 686 | if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) { | 729 | if (quirks & EDID_QUIRK_DETAILED_SYNC_PP) { |
| 687 | pt->misc |= DRM_EDID_PT_HSYNC_POSITIVE | DRM_EDID_PT_VSYNC_POSITIVE; | 730 | pt->misc |= DRM_EDID_PT_HSYNC_POSITIVE | DRM_EDID_PT_VSYNC_POSITIVE; |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index b1d0acbae4e..c2e8a45780d 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
| @@ -636,6 +636,13 @@ static const struct dmi_system_id bad_lid_status[] = { | |||
| 636 | DMI_MATCH(DMI_PRODUCT_NAME, "PC-81005"), | 636 | DMI_MATCH(DMI_PRODUCT_NAME, "PC-81005"), |
| 637 | }, | 637 | }, |
| 638 | }, | 638 | }, |
| 639 | { | ||
| 640 | .ident = "Clevo M5x0N", | ||
| 641 | .matches = { | ||
| 642 | DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."), | ||
| 643 | DMI_MATCH(DMI_BOARD_NAME, "M5x0N"), | ||
| 644 | }, | ||
| 645 | }, | ||
| 639 | { } | 646 | { } |
| 640 | }; | 647 | }; |
| 641 | 648 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 2cd0fad17da..0e9cd1d4913 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
| @@ -5861,13 +5861,12 @@ nouveau_bios_run_init_table(struct drm_device *dev, uint16_t table, | |||
| 5861 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 5861 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
| 5862 | struct nvbios *bios = &dev_priv->VBIOS; | 5862 | struct nvbios *bios = &dev_priv->VBIOS; |
| 5863 | struct init_exec iexec = { true, false }; | 5863 | struct init_exec iexec = { true, false }; |
| 5864 | unsigned long flags; | ||
| 5865 | 5864 | ||
| 5866 | spin_lock_irqsave(&bios->lock, flags); | 5865 | mutex_lock(&bios->lock); |
| 5867 | bios->display.output = dcbent; | 5866 | bios->display.output = dcbent; |
| 5868 | parse_init_table(bios, table, &iexec); | 5867 | parse_init_table(bios, table, &iexec); |
| 5869 | bios->display.output = NULL; | 5868 | bios->display.output = NULL; |
| 5870 | spin_unlock_irqrestore(&bios->lock, flags); | 5869 | mutex_unlock(&bios->lock); |
| 5871 | } | 5870 | } |
| 5872 | 5871 | ||
| 5873 | static bool NVInitVBIOS(struct drm_device *dev) | 5872 | static bool NVInitVBIOS(struct drm_device *dev) |
| @@ -5876,7 +5875,7 @@ static bool NVInitVBIOS(struct drm_device *dev) | |||
| 5876 | struct nvbios *bios = &dev_priv->VBIOS; | 5875 | struct nvbios *bios = &dev_priv->VBIOS; |
| 5877 | 5876 | ||
| 5878 | memset(bios, 0, sizeof(struct nvbios)); | 5877 | memset(bios, 0, sizeof(struct nvbios)); |
| 5879 | spin_lock_init(&bios->lock); | 5878 | mutex_init(&bios->lock); |
| 5880 | bios->dev = dev; | 5879 | bios->dev = dev; |
| 5881 | 5880 | ||
| 5882 | if (!NVShadowVBIOS(dev, bios->data)) | 5881 | if (!NVShadowVBIOS(dev, bios->data)) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h index 68446fd4146..fd94bd6dc26 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.h +++ b/drivers/gpu/drm/nouveau/nouveau_bios.h | |||
| @@ -205,7 +205,7 @@ struct nvbios { | |||
| 205 | struct drm_device *dev; | 205 | struct drm_device *dev; |
| 206 | struct nouveau_bios_info pub; | 206 | struct nouveau_bios_info pub; |
| 207 | 207 | ||
| 208 | spinlock_t lock; | 208 | struct mutex lock; |
| 209 | 209 | ||
| 210 | uint8_t data[NV_PROM_SIZE]; | 210 | uint8_t data[NV_PROM_SIZE]; |
| 211 | unsigned int length; | 211 | unsigned int length; |
diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c b/drivers/gpu/drm/nouveau/nv17_tv.c index 58b917c3341..21ac6e49b6e 100644 --- a/drivers/gpu/drm/nouveau/nv17_tv.c +++ b/drivers/gpu/drm/nouveau/nv17_tv.c | |||
| @@ -579,6 +579,8 @@ static void nv17_tv_restore(struct drm_encoder *encoder) | |||
| 579 | nouveau_encoder(encoder)->restore.output); | 579 | nouveau_encoder(encoder)->restore.output); |
| 580 | 580 | ||
| 581 | nv17_tv_state_load(dev, &to_tv_enc(encoder)->saved_state); | 581 | nv17_tv_state_load(dev, &to_tv_enc(encoder)->saved_state); |
| 582 | |||
| 583 | nouveau_encoder(encoder)->last_dpms = NV_DPMS_CLEARED; | ||
| 582 | } | 584 | } |
| 583 | 585 | ||
| 584 | static int nv17_tv_create_resources(struct drm_encoder *encoder, | 586 | static int nv17_tv_create_resources(struct drm_encoder *encoder, |
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 2a3df5599ab..7f152f66f19 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
| @@ -643,7 +643,7 @@ static void atom_op_delay(atom_exec_context *ctx, int *ptr, int arg) | |||
| 643 | uint8_t count = U8((*ptr)++); | 643 | uint8_t count = U8((*ptr)++); |
| 644 | SDEBUG(" count: %d\n", count); | 644 | SDEBUG(" count: %d\n", count); |
| 645 | if (arg == ATOM_UNIT_MICROSEC) | 645 | if (arg == ATOM_UNIT_MICROSEC) |
| 646 | schedule_timeout_uninterruptible(usecs_to_jiffies(count)); | 646 | udelay(count); |
| 647 | else | 647 | else |
| 648 | schedule_timeout_uninterruptible(msecs_to_jiffies(count)); | 648 | schedule_timeout_uninterruptible(msecs_to_jiffies(count)); |
| 649 | } | 649 | } |
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index af1c3ca8a4c..446b765ac72 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c | |||
| @@ -543,9 +543,6 @@ int r600_vb_ib_get(struct radeon_device *rdev) | |||
| 543 | void r600_vb_ib_put(struct radeon_device *rdev) | 543 | void r600_vb_ib_put(struct radeon_device *rdev) |
| 544 | { | 544 | { |
| 545 | radeon_fence_emit(rdev, rdev->r600_blit.vb_ib->fence); | 545 | radeon_fence_emit(rdev, rdev->r600_blit.vb_ib->fence); |
| 546 | mutex_lock(&rdev->ib_pool.mutex); | ||
| 547 | list_add_tail(&rdev->r600_blit.vb_ib->list, &rdev->ib_pool.scheduled_ibs); | ||
| 548 | mutex_unlock(&rdev->ib_pool.mutex); | ||
| 549 | radeon_ib_free(rdev, &rdev->r600_blit.vb_ib); | 546 | radeon_ib_free(rdev, &rdev->r600_blit.vb_ib); |
| 550 | } | 547 | } |
| 551 | 548 | ||
diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c index 6d5a711c2e9..75bcf35a093 100644 --- a/drivers/gpu/drm/radeon/r600_cp.c +++ b/drivers/gpu/drm/radeon/r600_cp.c | |||
| @@ -1428,9 +1428,12 @@ static void r700_gfx_init(struct drm_device *dev, | |||
| 1428 | 1428 | ||
| 1429 | gb_tiling_config |= R600_BANK_SWAPS(1); | 1429 | gb_tiling_config |= R600_BANK_SWAPS(1); |
| 1430 | 1430 | ||
| 1431 | backend_map = r700_get_tile_pipe_to_backend_map(dev_priv->r600_max_tile_pipes, | 1431 | if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV740) |
| 1432 | dev_priv->r600_max_backends, | 1432 | backend_map = 0x28; |
| 1433 | (0xff << dev_priv->r600_max_backends) & 0xff); | 1433 | else |
| 1434 | backend_map = r700_get_tile_pipe_to_backend_map(dev_priv->r600_max_tile_pipes, | ||
| 1435 | dev_priv->r600_max_backends, | ||
| 1436 | (0xff << dev_priv->r600_max_backends) & 0xff); | ||
| 1434 | gb_tiling_config |= R600_BACKEND_MAP(backend_map); | 1437 | gb_tiling_config |= R600_BACKEND_MAP(backend_map); |
| 1435 | 1438 | ||
| 1436 | cc_gc_shader_pipe_config = | 1439 | cc_gc_shader_pipe_config = |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index f57480ba135..c0356bb193e 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
| @@ -96,6 +96,7 @@ extern int radeon_audio; | |||
| 96 | * symbol; | 96 | * symbol; |
| 97 | */ | 97 | */ |
| 98 | #define RADEON_MAX_USEC_TIMEOUT 100000 /* 100 ms */ | 98 | #define RADEON_MAX_USEC_TIMEOUT 100000 /* 100 ms */ |
| 99 | /* RADEON_IB_POOL_SIZE must be a power of 2 */ | ||
| 99 | #define RADEON_IB_POOL_SIZE 16 | 100 | #define RADEON_IB_POOL_SIZE 16 |
| 100 | #define RADEON_DEBUGFS_MAX_NUM_FILES 32 | 101 | #define RADEON_DEBUGFS_MAX_NUM_FILES 32 |
| 101 | #define RADEONFB_CONN_LIMIT 4 | 102 | #define RADEONFB_CONN_LIMIT 4 |
| @@ -363,11 +364,12 @@ void radeon_irq_kms_sw_irq_put(struct radeon_device *rdev); | |||
| 363 | */ | 364 | */ |
| 364 | struct radeon_ib { | 365 | struct radeon_ib { |
| 365 | struct list_head list; | 366 | struct list_head list; |
| 366 | unsigned long idx; | 367 | unsigned idx; |
| 367 | uint64_t gpu_addr; | 368 | uint64_t gpu_addr; |
| 368 | struct radeon_fence *fence; | 369 | struct radeon_fence *fence; |
| 369 | uint32_t *ptr; | 370 | uint32_t *ptr; |
| 370 | uint32_t length_dw; | 371 | uint32_t length_dw; |
| 372 | bool free; | ||
| 371 | }; | 373 | }; |
| 372 | 374 | ||
| 373 | /* | 375 | /* |
| @@ -377,10 +379,9 @@ struct radeon_ib { | |||
| 377 | struct radeon_ib_pool { | 379 | struct radeon_ib_pool { |
| 378 | struct mutex mutex; | 380 | struct mutex mutex; |
| 379 | struct radeon_bo *robj; | 381 | struct radeon_bo *robj; |
| 380 | struct list_head scheduled_ibs; | ||
| 381 | struct radeon_ib ibs[RADEON_IB_POOL_SIZE]; | 382 | struct radeon_ib ibs[RADEON_IB_POOL_SIZE]; |
| 382 | bool ready; | 383 | bool ready; |
| 383 | DECLARE_BITMAP(alloc_bm, RADEON_IB_POOL_SIZE); | 384 | unsigned head_id; |
| 384 | }; | 385 | }; |
| 385 | 386 | ||
| 386 | struct radeon_cp { | 387 | struct radeon_cp { |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 2dcda611587..4d8831548a5 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -206,6 +206,15 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, | |||
| 206 | *connector_type = DRM_MODE_CONNECTOR_DVID; | 206 | *connector_type = DRM_MODE_CONNECTOR_DVID; |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | /* Asrock RS600 board lists the DVI port as HDMI */ | ||
| 210 | if ((dev->pdev->device == 0x7941) && | ||
| 211 | (dev->pdev->subsystem_vendor == 0x1849) && | ||
| 212 | (dev->pdev->subsystem_device == 0x7941)) { | ||
| 213 | if ((*connector_type == DRM_MODE_CONNECTOR_HDMIA) && | ||
| 214 | (supported_device == ATOM_DEVICE_DFP3_SUPPORT)) | ||
| 215 | *connector_type = DRM_MODE_CONNECTOR_DVID; | ||
| 216 | } | ||
| 217 | |||
| 209 | /* a-bit f-i90hd - ciaranm on #radeonhd - this board has no DVI */ | 218 | /* a-bit f-i90hd - ciaranm on #radeonhd - this board has no DVI */ |
| 210 | if ((dev->pdev->device == 0x7941) && | 219 | if ((dev->pdev->device == 0x7941) && |
| 211 | (dev->pdev->subsystem_vendor == 0x147b) && | 220 | (dev->pdev->subsystem_vendor == 0x147b) && |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 23818854001..65f81942f39 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -780,7 +780,7 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect | |||
| 780 | * connected and the DVI port disconnected. If the edid doesn't | 780 | * connected and the DVI port disconnected. If the edid doesn't |
| 781 | * say HDMI, vice versa. | 781 | * say HDMI, vice versa. |
| 782 | */ | 782 | */ |
| 783 | if (radeon_connector->shared_ddc && connector_status_connected) { | 783 | if (radeon_connector->shared_ddc && (ret == connector_status_connected)) { |
| 784 | struct drm_device *dev = connector->dev; | 784 | struct drm_device *dev = connector->dev; |
| 785 | struct drm_connector *list_connector; | 785 | struct drm_connector *list_connector; |
| 786 | struct radeon_connector *list_radeon_connector; | 786 | struct radeon_connector *list_radeon_connector; |
| @@ -1060,8 +1060,7 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1060 | return; | 1060 | return; |
| 1061 | } | 1061 | } |
| 1062 | if (radeon_connector->ddc_bus && i2c_bus->valid) { | 1062 | if (radeon_connector->ddc_bus && i2c_bus->valid) { |
| 1063 | if (memcmp(&radeon_connector->ddc_bus->rec, i2c_bus, | 1063 | if (radeon_connector->ddc_bus->rec.i2c_id == i2c_bus->i2c_id) { |
| 1064 | sizeof(struct radeon_i2c_bus_rec)) == 0) { | ||
| 1065 | radeon_connector->shared_ddc = true; | 1064 | radeon_connector->shared_ddc = true; |
| 1066 | shared_ddc = true; | 1065 | shared_ddc = true; |
| 1067 | } | 1066 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 1190148cf5e..e9d085021c1 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
| @@ -86,7 +86,7 @@ int radeon_cs_parser_relocs(struct radeon_cs_parser *p) | |||
| 86 | &p->validated); | 86 | &p->validated); |
| 87 | } | 87 | } |
| 88 | } | 88 | } |
| 89 | return radeon_bo_list_validate(&p->validated, p->ib->fence); | 89 | return radeon_bo_list_validate(&p->validated); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) | 92 | int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) |
| @@ -189,12 +189,10 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error) | |||
| 189 | { | 189 | { |
| 190 | unsigned i; | 190 | unsigned i; |
| 191 | 191 | ||
| 192 | if (error && parser->ib) { | 192 | if (!error && parser->ib) { |
| 193 | radeon_bo_list_unvalidate(&parser->validated, | 193 | radeon_bo_list_fence(&parser->validated, parser->ib->fence); |
| 194 | parser->ib->fence); | ||
| 195 | } else { | ||
| 196 | radeon_bo_list_unreserve(&parser->validated); | ||
| 197 | } | 194 | } |
| 195 | radeon_bo_list_unreserve(&parser->validated); | ||
| 198 | for (i = 0; i < parser->nrelocs; i++) { | 196 | for (i = 0; i < parser->nrelocs; i++) { |
| 199 | if (parser->relocs[i].gobj) { | 197 | if (parser->relocs[i].gobj) { |
| 200 | mutex_lock(&parser->rdev->ddev->struct_mutex); | 198 | mutex_lock(&parser->rdev->ddev->struct_mutex); |
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h index e13785282a8..c57ad606504 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.h +++ b/drivers/gpu/drm/radeon/radeon_drv.h | |||
| @@ -106,9 +106,10 @@ | |||
| 106 | * 1.29- R500 3D cmd buffer support | 106 | * 1.29- R500 3D cmd buffer support |
| 107 | * 1.30- Add support for occlusion queries | 107 | * 1.30- Add support for occlusion queries |
| 108 | * 1.31- Add support for num Z pipes from GET_PARAM | 108 | * 1.31- Add support for num Z pipes from GET_PARAM |
| 109 | * 1.32- fixes for rv740 setup | ||
| 109 | */ | 110 | */ |
| 110 | #define DRIVER_MAJOR 1 | 111 | #define DRIVER_MAJOR 1 |
| 111 | #define DRIVER_MINOR 31 | 112 | #define DRIVER_MINOR 32 |
| 112 | #define DRIVER_PATCHLEVEL 0 | 113 | #define DRIVER_PATCHLEVEL 0 |
| 113 | 114 | ||
| 114 | enum radeon_cp_microcode_version { | 115 | enum radeon_cp_microcode_version { |
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index d72a71bff21..f1da370928e 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c | |||
| @@ -306,11 +306,10 @@ void radeon_bo_list_unreserve(struct list_head *head) | |||
| 306 | } | 306 | } |
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | int radeon_bo_list_validate(struct list_head *head, void *fence) | 309 | int radeon_bo_list_validate(struct list_head *head) |
| 310 | { | 310 | { |
| 311 | struct radeon_bo_list *lobj; | 311 | struct radeon_bo_list *lobj; |
| 312 | struct radeon_bo *bo; | 312 | struct radeon_bo *bo; |
| 313 | struct radeon_fence *old_fence = NULL; | ||
| 314 | int r; | 313 | int r; |
| 315 | 314 | ||
| 316 | r = radeon_bo_list_reserve(head); | 315 | r = radeon_bo_list_reserve(head); |
| @@ -334,32 +333,27 @@ int radeon_bo_list_validate(struct list_head *head, void *fence) | |||
| 334 | } | 333 | } |
| 335 | lobj->gpu_offset = radeon_bo_gpu_offset(bo); | 334 | lobj->gpu_offset = radeon_bo_gpu_offset(bo); |
| 336 | lobj->tiling_flags = bo->tiling_flags; | 335 | lobj->tiling_flags = bo->tiling_flags; |
| 337 | if (fence) { | ||
| 338 | old_fence = (struct radeon_fence *)bo->tbo.sync_obj; | ||
| 339 | bo->tbo.sync_obj = radeon_fence_ref(fence); | ||
| 340 | bo->tbo.sync_obj_arg = NULL; | ||
| 341 | } | ||
| 342 | if (old_fence) { | ||
| 343 | radeon_fence_unref(&old_fence); | ||
| 344 | } | ||
| 345 | } | 336 | } |
| 346 | return 0; | 337 | return 0; |
| 347 | } | 338 | } |
| 348 | 339 | ||
| 349 | void radeon_bo_list_unvalidate(struct list_head *head, void *fence) | 340 | void radeon_bo_list_fence(struct list_head *head, void *fence) |
| 350 | { | 341 | { |
| 351 | struct radeon_bo_list *lobj; | 342 | struct radeon_bo_list *lobj; |
| 352 | struct radeon_fence *old_fence; | 343 | struct radeon_bo *bo; |
| 353 | 344 | struct radeon_fence *old_fence = NULL; | |
| 354 | if (fence) | 345 | |
| 355 | list_for_each_entry(lobj, head, list) { | 346 | list_for_each_entry(lobj, head, list) { |
| 356 | old_fence = to_radeon_fence(lobj->bo->tbo.sync_obj); | 347 | bo = lobj->bo; |
| 357 | if (old_fence == fence) { | 348 | spin_lock(&bo->tbo.lock); |
| 358 | lobj->bo->tbo.sync_obj = NULL; | 349 | old_fence = (struct radeon_fence *)bo->tbo.sync_obj; |
| 359 | radeon_fence_unref(&old_fence); | 350 | bo->tbo.sync_obj = radeon_fence_ref(fence); |
| 360 | } | 351 | bo->tbo.sync_obj_arg = NULL; |
| 352 | spin_unlock(&bo->tbo.lock); | ||
| 353 | if (old_fence) { | ||
| 354 | radeon_fence_unref(&old_fence); | ||
| 361 | } | 355 | } |
| 362 | radeon_bo_list_unreserve(head); | 356 | } |
| 363 | } | 357 | } |
| 364 | 358 | ||
| 365 | int radeon_bo_fbdev_mmap(struct radeon_bo *bo, | 359 | int radeon_bo_fbdev_mmap(struct radeon_bo *bo, |
diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h index a02f18011ad..7ab43de1e24 100644 --- a/drivers/gpu/drm/radeon/radeon_object.h +++ b/drivers/gpu/drm/radeon/radeon_object.h | |||
| @@ -156,8 +156,8 @@ extern void radeon_bo_list_add_object(struct radeon_bo_list *lobj, | |||
| 156 | struct list_head *head); | 156 | struct list_head *head); |
| 157 | extern int radeon_bo_list_reserve(struct list_head *head); | 157 | extern int radeon_bo_list_reserve(struct list_head *head); |
| 158 | extern void radeon_bo_list_unreserve(struct list_head *head); | 158 | extern void radeon_bo_list_unreserve(struct list_head *head); |
| 159 | extern int radeon_bo_list_validate(struct list_head *head, void *fence); | 159 | extern int radeon_bo_list_validate(struct list_head *head); |
| 160 | extern void radeon_bo_list_unvalidate(struct list_head *head, void *fence); | 160 | extern void radeon_bo_list_fence(struct list_head *head, void *fence); |
| 161 | extern int radeon_bo_fbdev_mmap(struct radeon_bo *bo, | 161 | extern int radeon_bo_fbdev_mmap(struct radeon_bo *bo, |
| 162 | struct vm_area_struct *vma); | 162 | struct vm_area_struct *vma); |
| 163 | extern int radeon_bo_set_tiling_flags(struct radeon_bo *bo, | 163 | extern int radeon_bo_set_tiling_flags(struct radeon_bo *bo, |
diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c index 4d12b2d17b4..6579eb4c1f2 100644 --- a/drivers/gpu/drm/radeon/radeon_ring.c +++ b/drivers/gpu/drm/radeon/radeon_ring.c | |||
| @@ -41,68 +41,55 @@ int radeon_ib_get(struct radeon_device *rdev, struct radeon_ib **ib) | |||
| 41 | { | 41 | { |
| 42 | struct radeon_fence *fence; | 42 | struct radeon_fence *fence; |
| 43 | struct radeon_ib *nib; | 43 | struct radeon_ib *nib; |
| 44 | unsigned long i; | 44 | int r = 0, i, c; |
| 45 | int r = 0; | ||
| 46 | 45 | ||
| 47 | *ib = NULL; | 46 | *ib = NULL; |
| 48 | r = radeon_fence_create(rdev, &fence); | 47 | r = radeon_fence_create(rdev, &fence); |
| 49 | if (r) { | 48 | if (r) { |
| 50 | DRM_ERROR("failed to create fence for new IB\n"); | 49 | dev_err(rdev->dev, "failed to create fence for new IB\n"); |
| 51 | return r; | 50 | return r; |
| 52 | } | 51 | } |
| 53 | mutex_lock(&rdev->ib_pool.mutex); | 52 | mutex_lock(&rdev->ib_pool.mutex); |
| 54 | i = find_first_zero_bit(rdev->ib_pool.alloc_bm, RADEON_IB_POOL_SIZE); | 53 | for (i = rdev->ib_pool.head_id, c = 0, nib = NULL; c < RADEON_IB_POOL_SIZE; c++, i++) { |
| 55 | if (i < RADEON_IB_POOL_SIZE) { | 54 | i &= (RADEON_IB_POOL_SIZE - 1); |
| 56 | set_bit(i, rdev->ib_pool.alloc_bm); | 55 | if (rdev->ib_pool.ibs[i].free) { |
| 57 | rdev->ib_pool.ibs[i].length_dw = 0; | 56 | nib = &rdev->ib_pool.ibs[i]; |
| 58 | *ib = &rdev->ib_pool.ibs[i]; | 57 | break; |
| 59 | mutex_unlock(&rdev->ib_pool.mutex); | 58 | } |
| 60 | goto out; | ||
| 61 | } | 59 | } |
| 62 | if (list_empty(&rdev->ib_pool.scheduled_ibs)) { | 60 | if (nib == NULL) { |
| 63 | /* we go do nothings here */ | 61 | /* This should never happen, it means we allocated all |
| 62 | * IB and haven't scheduled one yet, return EBUSY to | ||
| 63 | * userspace hoping that on ioctl recall we get better | ||
| 64 | * luck | ||
| 65 | */ | ||
| 66 | dev_err(rdev->dev, "no free indirect buffer !\n"); | ||
| 64 | mutex_unlock(&rdev->ib_pool.mutex); | 67 | mutex_unlock(&rdev->ib_pool.mutex); |
| 65 | DRM_ERROR("all IB allocated none scheduled.\n"); | 68 | radeon_fence_unref(&fence); |
| 66 | r = -EINVAL; | 69 | return -EBUSY; |
| 67 | goto out; | ||
| 68 | } | 70 | } |
| 69 | /* get the first ib on the scheduled list */ | 71 | rdev->ib_pool.head_id = (nib->idx + 1) & (RADEON_IB_POOL_SIZE - 1); |
| 70 | nib = list_entry(rdev->ib_pool.scheduled_ibs.next, | 72 | nib->free = false; |
| 71 | struct radeon_ib, list); | 73 | if (nib->fence) { |
| 72 | if (nib->fence == NULL) { | ||
| 73 | /* we go do nothings here */ | ||
| 74 | mutex_unlock(&rdev->ib_pool.mutex); | 74 | mutex_unlock(&rdev->ib_pool.mutex); |
| 75 | DRM_ERROR("IB %lu scheduled without a fence.\n", nib->idx); | 75 | r = radeon_fence_wait(nib->fence, false); |
| 76 | r = -EINVAL; | 76 | if (r) { |
| 77 | goto out; | 77 | dev_err(rdev->dev, "error waiting fence of IB(%u:0x%016lX:%u)\n", |
| 78 | } | 78 | nib->idx, (unsigned long)nib->gpu_addr, nib->length_dw); |
| 79 | mutex_unlock(&rdev->ib_pool.mutex); | 79 | mutex_lock(&rdev->ib_pool.mutex); |
| 80 | 80 | nib->free = true; | |
| 81 | r = radeon_fence_wait(nib->fence, false); | 81 | mutex_unlock(&rdev->ib_pool.mutex); |
| 82 | if (r) { | 82 | radeon_fence_unref(&fence); |
| 83 | DRM_ERROR("radeon: IB(%lu:0x%016lX:%u)\n", nib->idx, | 83 | return r; |
| 84 | (unsigned long)nib->gpu_addr, nib->length_dw); | 84 | } |
| 85 | DRM_ERROR("radeon: GPU lockup detected, fail to get a IB\n"); | 85 | mutex_lock(&rdev->ib_pool.mutex); |
| 86 | goto out; | ||
| 87 | } | 86 | } |
| 88 | radeon_fence_unref(&nib->fence); | 87 | radeon_fence_unref(&nib->fence); |
| 89 | 88 | nib->fence = fence; | |
| 90 | nib->length_dw = 0; | 89 | nib->length_dw = 0; |
| 91 | |||
| 92 | /* scheduled list is accessed here */ | ||
| 93 | mutex_lock(&rdev->ib_pool.mutex); | ||
| 94 | list_del(&nib->list); | ||
| 95 | INIT_LIST_HEAD(&nib->list); | ||
| 96 | mutex_unlock(&rdev->ib_pool.mutex); | 90 | mutex_unlock(&rdev->ib_pool.mutex); |
| 97 | |||
| 98 | *ib = nib; | 91 | *ib = nib; |
| 99 | out: | 92 | return 0; |
| 100 | if (r) { | ||
| 101 | radeon_fence_unref(&fence); | ||
| 102 | } else { | ||
| 103 | (*ib)->fence = fence; | ||
| 104 | } | ||
| 105 | return r; | ||
| 106 | } | 93 | } |
| 107 | 94 | ||
| 108 | void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib **ib) | 95 | void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib **ib) |
| @@ -113,19 +100,10 @@ void radeon_ib_free(struct radeon_device *rdev, struct radeon_ib **ib) | |||
| 113 | if (tmp == NULL) { | 100 | if (tmp == NULL) { |
| 114 | return; | 101 | return; |
| 115 | } | 102 | } |
| 116 | mutex_lock(&rdev->ib_pool.mutex); | 103 | if (!tmp->fence->emited) |
| 117 | if (!list_empty(&tmp->list) && !radeon_fence_signaled(tmp->fence)) { | ||
| 118 | /* IB is scheduled & not signaled don't do anythings */ | ||
| 119 | mutex_unlock(&rdev->ib_pool.mutex); | ||
| 120 | return; | ||
| 121 | } | ||
| 122 | list_del(&tmp->list); | ||
| 123 | INIT_LIST_HEAD(&tmp->list); | ||
| 124 | if (tmp->fence) | ||
| 125 | radeon_fence_unref(&tmp->fence); | 104 | radeon_fence_unref(&tmp->fence); |
| 126 | 105 | mutex_lock(&rdev->ib_pool.mutex); | |
| 127 | tmp->length_dw = 0; | 106 | tmp->free = true; |
| 128 | clear_bit(tmp->idx, rdev->ib_pool.alloc_bm); | ||
| 129 | mutex_unlock(&rdev->ib_pool.mutex); | 107 | mutex_unlock(&rdev->ib_pool.mutex); |
| 130 | } | 108 | } |
| 131 | 109 | ||
| @@ -135,7 +113,7 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib) | |||
| 135 | 113 | ||
| 136 | if (!ib->length_dw || !rdev->cp.ready) { | 114 | if (!ib->length_dw || !rdev->cp.ready) { |
| 137 | /* TODO: Nothings in the ib we should report. */ | 115 | /* TODO: Nothings in the ib we should report. */ |
| 138 | DRM_ERROR("radeon: couldn't schedule IB(%lu).\n", ib->idx); | 116 | DRM_ERROR("radeon: couldn't schedule IB(%u).\n", ib->idx); |
| 139 | return -EINVAL; | 117 | return -EINVAL; |
| 140 | } | 118 | } |
| 141 | 119 | ||
| @@ -148,7 +126,8 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib) | |||
| 148 | radeon_ring_ib_execute(rdev, ib); | 126 | radeon_ring_ib_execute(rdev, ib); |
| 149 | radeon_fence_emit(rdev, ib->fence); | 127 | radeon_fence_emit(rdev, ib->fence); |
| 150 | mutex_lock(&rdev->ib_pool.mutex); | 128 | mutex_lock(&rdev->ib_pool.mutex); |
| 151 | list_add_tail(&ib->list, &rdev->ib_pool.scheduled_ibs); | 129 | /* once scheduled IB is considered free and protected by the fence */ |
| 130 | ib->free = true; | ||
| 152 | mutex_unlock(&rdev->ib_pool.mutex); | 131 | mutex_unlock(&rdev->ib_pool.mutex); |
| 153 | radeon_ring_unlock_commit(rdev); | 132 | radeon_ring_unlock_commit(rdev); |
| 154 | return 0; | 133 | return 0; |
| @@ -164,7 +143,6 @@ int radeon_ib_pool_init(struct radeon_device *rdev) | |||
| 164 | if (rdev->ib_pool.robj) | 143 | if (rdev->ib_pool.robj) |
| 165 | return 0; | 144 | return 0; |
| 166 | /* Allocate 1M object buffer */ | 145 | /* Allocate 1M object buffer */ |
| 167 | INIT_LIST_HEAD(&rdev->ib_pool.scheduled_ibs); | ||
| 168 | r = radeon_bo_create(rdev, NULL, RADEON_IB_POOL_SIZE*64*1024, | 146 | r = radeon_bo_create(rdev, NULL, RADEON_IB_POOL_SIZE*64*1024, |
| 169 | true, RADEON_GEM_DOMAIN_GTT, | 147 | true, RADEON_GEM_DOMAIN_GTT, |
| 170 | &rdev->ib_pool.robj); | 148 | &rdev->ib_pool.robj); |
| @@ -195,9 +173,9 @@ int radeon_ib_pool_init(struct radeon_device *rdev) | |||
| 195 | rdev->ib_pool.ibs[i].ptr = ptr + offset; | 173 | rdev->ib_pool.ibs[i].ptr = ptr + offset; |
| 196 | rdev->ib_pool.ibs[i].idx = i; | 174 | rdev->ib_pool.ibs[i].idx = i; |
| 197 | rdev->ib_pool.ibs[i].length_dw = 0; | 175 | rdev->ib_pool.ibs[i].length_dw = 0; |
| 198 | INIT_LIST_HEAD(&rdev->ib_pool.ibs[i].list); | 176 | rdev->ib_pool.ibs[i].free = true; |
| 199 | } | 177 | } |
| 200 | bitmap_zero(rdev->ib_pool.alloc_bm, RADEON_IB_POOL_SIZE); | 178 | rdev->ib_pool.head_id = 0; |
| 201 | rdev->ib_pool.ready = true; | 179 | rdev->ib_pool.ready = true; |
| 202 | DRM_INFO("radeon: ib pool ready.\n"); | 180 | DRM_INFO("radeon: ib pool ready.\n"); |
| 203 | if (radeon_debugfs_ib_init(rdev)) { | 181 | if (radeon_debugfs_ib_init(rdev)) { |
| @@ -214,7 +192,6 @@ void radeon_ib_pool_fini(struct radeon_device *rdev) | |||
| 214 | return; | 192 | return; |
| 215 | } | 193 | } |
| 216 | mutex_lock(&rdev->ib_pool.mutex); | 194 | mutex_lock(&rdev->ib_pool.mutex); |
| 217 | bitmap_zero(rdev->ib_pool.alloc_bm, RADEON_IB_POOL_SIZE); | ||
| 218 | if (rdev->ib_pool.robj) { | 195 | if (rdev->ib_pool.robj) { |
| 219 | r = radeon_bo_reserve(rdev->ib_pool.robj, false); | 196 | r = radeon_bo_reserve(rdev->ib_pool.robj, false); |
| 220 | if (likely(r == 0)) { | 197 | if (likely(r == 0)) { |
| @@ -363,7 +340,7 @@ static int radeon_debugfs_ib_info(struct seq_file *m, void *data) | |||
| 363 | if (ib == NULL) { | 340 | if (ib == NULL) { |
| 364 | return 0; | 341 | return 0; |
| 365 | } | 342 | } |
| 366 | seq_printf(m, "IB %04lu\n", ib->idx); | 343 | seq_printf(m, "IB %04u\n", ib->idx); |
| 367 | seq_printf(m, "IB fence %p\n", ib->fence); | 344 | seq_printf(m, "IB fence %p\n", ib->fence); |
| 368 | seq_printf(m, "IB size %05u dwords\n", ib->length_dw); | 345 | seq_printf(m, "IB size %05u dwords\n", ib->length_dw); |
| 369 | for (i = 0; i < ib->length_dw; i++) { | 346 | for (i = 0; i < ib->length_dw; i++) { |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 5943d561fd1..03021674d09 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
| @@ -549,9 +549,12 @@ static void rv770_gpu_init(struct radeon_device *rdev) | |||
| 549 | 549 | ||
| 550 | gb_tiling_config |= BANK_SWAPS(1); | 550 | gb_tiling_config |= BANK_SWAPS(1); |
| 551 | 551 | ||
| 552 | backend_map = r700_get_tile_pipe_to_backend_map(rdev->config.rv770.max_tile_pipes, | 552 | if (rdev->family == CHIP_RV740) |
| 553 | rdev->config.rv770.max_backends, | 553 | backend_map = 0x28; |
| 554 | (0xff << rdev->config.rv770.max_backends) & 0xff); | 554 | else |
| 555 | backend_map = r700_get_tile_pipe_to_backend_map(rdev->config.rv770.max_tile_pipes, | ||
| 556 | rdev->config.rv770.max_backends, | ||
| 557 | (0xff << rdev->config.rv770.max_backends) & 0xff); | ||
| 555 | gb_tiling_config |= BACKEND_MAP(backend_map); | 558 | gb_tiling_config |= BACKEND_MAP(backend_map); |
| 556 | 559 | ||
| 557 | cc_gc_shader_pipe_config = | 560 | cc_gc_shader_pipe_config = |
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index e2123af7775..3d47a2c1232 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c | |||
| @@ -196,14 +196,15 @@ EXPORT_SYMBOL(ttm_tt_populate); | |||
| 196 | 196 | ||
| 197 | #ifdef CONFIG_X86 | 197 | #ifdef CONFIG_X86 |
| 198 | static inline int ttm_tt_set_page_caching(struct page *p, | 198 | static inline int ttm_tt_set_page_caching(struct page *p, |
| 199 | enum ttm_caching_state c_state) | 199 | enum ttm_caching_state c_old, |
| 200 | enum ttm_caching_state c_new) | ||
| 200 | { | 201 | { |
| 201 | int ret = 0; | 202 | int ret = 0; |
| 202 | 203 | ||
| 203 | if (PageHighMem(p)) | 204 | if (PageHighMem(p)) |
| 204 | return 0; | 205 | return 0; |
| 205 | 206 | ||
| 206 | if (get_page_memtype(p) != -1) { | 207 | if (c_old != tt_cached) { |
| 207 | /* p isn't in the default caching state, set it to | 208 | /* p isn't in the default caching state, set it to |
| 208 | * writeback first to free its current memtype. */ | 209 | * writeback first to free its current memtype. */ |
| 209 | 210 | ||
| @@ -212,16 +213,17 @@ static inline int ttm_tt_set_page_caching(struct page *p, | |||
| 212 | return ret; | 213 | return ret; |
| 213 | } | 214 | } |
| 214 | 215 | ||
| 215 | if (c_state == tt_wc) | 216 | if (c_new == tt_wc) |
| 216 | ret = set_memory_wc((unsigned long) page_address(p), 1); | 217 | ret = set_memory_wc((unsigned long) page_address(p), 1); |
| 217 | else if (c_state == tt_uncached) | 218 | else if (c_new == tt_uncached) |
| 218 | ret = set_pages_uc(p, 1); | 219 | ret = set_pages_uc(p, 1); |
| 219 | 220 | ||
| 220 | return ret; | 221 | return ret; |
| 221 | } | 222 | } |
| 222 | #else /* CONFIG_X86 */ | 223 | #else /* CONFIG_X86 */ |
| 223 | static inline int ttm_tt_set_page_caching(struct page *p, | 224 | static inline int ttm_tt_set_page_caching(struct page *p, |
| 224 | enum ttm_caching_state c_state) | 225 | enum ttm_caching_state c_old, |
| 226 | enum ttm_caching_state c_new) | ||
| 225 | { | 227 | { |
| 226 | return 0; | 228 | return 0; |
| 227 | } | 229 | } |
| @@ -254,7 +256,9 @@ static int ttm_tt_set_caching(struct ttm_tt *ttm, | |||
| 254 | for (i = 0; i < ttm->num_pages; ++i) { | 256 | for (i = 0; i < ttm->num_pages; ++i) { |
| 255 | cur_page = ttm->pages[i]; | 257 | cur_page = ttm->pages[i]; |
| 256 | if (likely(cur_page != NULL)) { | 258 | if (likely(cur_page != NULL)) { |
| 257 | ret = ttm_tt_set_page_caching(cur_page, c_state); | 259 | ret = ttm_tt_set_page_caching(cur_page, |
| 260 | ttm->caching_state, | ||
| 261 | c_state); | ||
| 258 | if (unlikely(ret != 0)) | 262 | if (unlikely(ret != 0)) |
| 259 | goto out_err; | 263 | goto out_err; |
| 260 | } | 264 | } |
| @@ -268,7 +272,7 @@ out_err: | |||
| 268 | for (j = 0; j < i; ++j) { | 272 | for (j = 0; j < i; ++j) { |
| 269 | cur_page = ttm->pages[j]; | 273 | cur_page = ttm->pages[j]; |
| 270 | if (likely(cur_page != NULL)) { | 274 | if (likely(cur_page != NULL)) { |
| 271 | (void)ttm_tt_set_page_caching(cur_page, | 275 | (void)ttm_tt_set_page_caching(cur_page, c_state, |
| 272 | ttm->caching_state); | 276 | ttm->caching_state); |
| 273 | } | 277 | } |
| 274 | } | 278 | } |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index a6e8f687fa6..0c9c0811f42 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |||
| @@ -348,22 +348,19 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | |||
| 348 | */ | 348 | */ |
| 349 | 349 | ||
| 350 | DRM_INFO("It appears like vesafb is loaded. " | 350 | DRM_INFO("It appears like vesafb is loaded. " |
| 351 | "Ignore above error if any. Entering stealth mode.\n"); | 351 | "Ignore above error if any.\n"); |
| 352 | ret = pci_request_region(dev->pdev, 2, "vmwgfx stealth probe"); | 352 | ret = pci_request_region(dev->pdev, 2, "vmwgfx stealth probe"); |
| 353 | if (unlikely(ret != 0)) { | 353 | if (unlikely(ret != 0)) { |
| 354 | DRM_ERROR("Failed reserving the SVGA MMIO resource.\n"); | 354 | DRM_ERROR("Failed reserving the SVGA MMIO resource.\n"); |
| 355 | goto out_no_device; | 355 | goto out_no_device; |
| 356 | } | 356 | } |
| 357 | vmw_kms_init(dev_priv); | ||
| 358 | vmw_overlay_init(dev_priv); | ||
| 359 | } else { | ||
| 360 | ret = vmw_request_device(dev_priv); | ||
| 361 | if (unlikely(ret != 0)) | ||
| 362 | goto out_no_device; | ||
| 363 | vmw_kms_init(dev_priv); | ||
| 364 | vmw_overlay_init(dev_priv); | ||
| 365 | vmw_fb_init(dev_priv); | ||
| 366 | } | 357 | } |
| 358 | ret = vmw_request_device(dev_priv); | ||
| 359 | if (unlikely(ret != 0)) | ||
| 360 | goto out_no_device; | ||
| 361 | vmw_kms_init(dev_priv); | ||
| 362 | vmw_overlay_init(dev_priv); | ||
| 363 | vmw_fb_init(dev_priv); | ||
| 367 | 364 | ||
| 368 | dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier; | 365 | dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier; |
| 369 | register_pm_notifier(&dev_priv->pm_nb); | 366 | register_pm_notifier(&dev_priv->pm_nb); |
| @@ -406,17 +403,15 @@ static int vmw_driver_unload(struct drm_device *dev) | |||
| 406 | 403 | ||
| 407 | unregister_pm_notifier(&dev_priv->pm_nb); | 404 | unregister_pm_notifier(&dev_priv->pm_nb); |
| 408 | 405 | ||
| 409 | if (!dev_priv->stealth) { | 406 | vmw_fb_close(dev_priv); |
| 410 | vmw_fb_close(dev_priv); | 407 | vmw_kms_close(dev_priv); |
| 411 | vmw_kms_close(dev_priv); | 408 | vmw_overlay_close(dev_priv); |
| 412 | vmw_overlay_close(dev_priv); | 409 | vmw_release_device(dev_priv); |
| 413 | vmw_release_device(dev_priv); | 410 | if (dev_priv->stealth) |
| 414 | pci_release_regions(dev->pdev); | ||
| 415 | } else { | ||
| 416 | vmw_kms_close(dev_priv); | ||
| 417 | vmw_overlay_close(dev_priv); | ||
| 418 | pci_release_region(dev->pdev, 2); | 411 | pci_release_region(dev->pdev, 2); |
| 419 | } | 412 | else |
| 413 | pci_release_regions(dev->pdev); | ||
| 414 | |||
| 420 | if (dev_priv->capabilities & SVGA_CAP_IRQMASK) | 415 | if (dev_priv->capabilities & SVGA_CAP_IRQMASK) |
| 421 | drm_irq_uninstall(dev_priv->dev); | 416 | drm_irq_uninstall(dev_priv->dev); |
| 422 | if (dev->devname == vmw_devname) | 417 | if (dev->devname == vmw_devname) |
| @@ -585,11 +580,6 @@ static int vmw_master_set(struct drm_device *dev, | |||
| 585 | int ret = 0; | 580 | int ret = 0; |
| 586 | 581 | ||
| 587 | DRM_INFO("Master set.\n"); | 582 | DRM_INFO("Master set.\n"); |
| 588 | if (dev_priv->stealth) { | ||
| 589 | ret = vmw_request_device(dev_priv); | ||
| 590 | if (unlikely(ret != 0)) | ||
| 591 | return ret; | ||
| 592 | } | ||
| 593 | 583 | ||
| 594 | if (active) { | 584 | if (active) { |
| 595 | BUG_ON(active != &dev_priv->fbdev_master); | 585 | BUG_ON(active != &dev_priv->fbdev_master); |
| @@ -649,18 +639,11 @@ static void vmw_master_drop(struct drm_device *dev, | |||
| 649 | 639 | ||
| 650 | ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); | 640 | ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); |
| 651 | 641 | ||
| 652 | if (dev_priv->stealth) { | ||
| 653 | ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM); | ||
| 654 | if (unlikely(ret != 0)) | ||
| 655 | DRM_ERROR("Unable to clean VRAM on master drop.\n"); | ||
| 656 | vmw_release_device(dev_priv); | ||
| 657 | } | ||
| 658 | dev_priv->active_master = &dev_priv->fbdev_master; | 642 | dev_priv->active_master = &dev_priv->fbdev_master; |
| 659 | ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM); | 643 | ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM); |
| 660 | ttm_vt_unlock(&dev_priv->fbdev_master.lock); | 644 | ttm_vt_unlock(&dev_priv->fbdev_master.lock); |
| 661 | 645 | ||
| 662 | if (!dev_priv->stealth) | 646 | vmw_fb_on(dev_priv); |
| 663 | vmw_fb_on(dev_priv); | ||
| 664 | } | 647 | } |
| 665 | 648 | ||
| 666 | 649 | ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 4f4f6432be8..a93367041cd 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | |||
| @@ -559,6 +559,9 @@ int vmw_fb_init(struct vmw_private *vmw_priv) | |||
| 559 | info->pixmap.scan_align = 1; | 559 | info->pixmap.scan_align = 1; |
| 560 | #endif | 560 | #endif |
| 561 | 561 | ||
| 562 | info->aperture_base = vmw_priv->vram_start; | ||
| 563 | info->aperture_size = vmw_priv->vram_size; | ||
| 564 | |||
| 562 | /* | 565 | /* |
| 563 | * Dirty & Deferred IO | 566 | * Dirty & Deferred IO |
| 564 | */ | 567 | */ |
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 24b56dc5459..2f6cf69ecb3 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c | |||
| @@ -961,7 +961,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf, | |||
| 961 | remaining -= 7; | 961 | remaining -= 7; |
| 962 | pr_devel("client 0x%p called 'target'\n", priv); | 962 | pr_devel("client 0x%p called 'target'\n", priv); |
| 963 | /* if target is default */ | 963 | /* if target is default */ |
| 964 | if (!strncmp(kbuf, "default", 7)) | 964 | if (!strncmp(curr_pos, "default", 7)) |
| 965 | pdev = pci_dev_get(vga_default_device()); | 965 | pdev = pci_dev_get(vga_default_device()); |
| 966 | else { | 966 | else { |
| 967 | if (!vga_pci_str_to_vars(curr_pos, remaining, | 967 | if (!vga_pci_str_to_vars(curr_pos, remaining, |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index d84a36e545f..b54aee7cd9e 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
| @@ -1161,9 +1161,17 @@ static int i8042_pm_restore(struct device *dev) | |||
| 1161 | return 0; | 1161 | return 0; |
| 1162 | } | 1162 | } |
| 1163 | 1163 | ||
| 1164 | static int i8042_pm_thaw(struct device *dev) | ||
| 1165 | { | ||
| 1166 | i8042_interrupt(0, NULL); | ||
| 1167 | |||
| 1168 | return 0; | ||
| 1169 | } | ||
| 1170 | |||
| 1164 | static const struct dev_pm_ops i8042_pm_ops = { | 1171 | static const struct dev_pm_ops i8042_pm_ops = { |
| 1165 | .suspend = i8042_pm_reset, | 1172 | .suspend = i8042_pm_reset, |
| 1166 | .resume = i8042_pm_restore, | 1173 | .resume = i8042_pm_restore, |
| 1174 | .thaw = i8042_pm_thaw, | ||
| 1167 | .poweroff = i8042_pm_reset, | 1175 | .poweroff = i8042_pm_reset, |
| 1168 | .restore = i8042_pm_restore, | 1176 | .restore = i8042_pm_restore, |
| 1169 | }; | 1177 | }; |
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index 1b249897c9f..465295b1d14 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
| @@ -112,11 +112,13 @@ config DVB_USB_CXUSB | |||
| 112 | select DVB_MT352 if !DVB_FE_CUSTOMISE | 112 | select DVB_MT352 if !DVB_FE_CUSTOMISE |
| 113 | select DVB_ZL10353 if !DVB_FE_CUSTOMISE | 113 | select DVB_ZL10353 if !DVB_FE_CUSTOMISE |
| 114 | select DVB_DIB7000P if !DVB_FE_CUSTOMISE | 114 | select DVB_DIB7000P if !DVB_FE_CUSTOMISE |
| 115 | select DVB_LGS8GL5 if !DVB_FE_CUSTOMISE | ||
| 116 | select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE | 115 | select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE |
| 116 | select DVB_ATBM8830 if !DVB_FE_CUSTOMISE | ||
| 117 | select DVB_LGS8GXX if !DVB_FE_CUSTOMISE | ||
| 117 | select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE | 118 | select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE |
| 118 | select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE | 119 | select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE |
| 119 | select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMISE | 120 | select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMISE |
| 121 | select MEDIA_TUNER_MAX2165 if !MEDIA_TUNER_CUSTOMISE | ||
| 120 | help | 122 | help |
| 121 | Say Y here to support the Conexant USB2.0 hybrid reference design. | 123 | Say Y here to support the Conexant USB2.0 hybrid reference design. |
| 122 | Currently, only DVB and ATSC modes are supported, analog mode | 124 | Currently, only DVB and ATSC modes are supported, analog mode |
diff --git a/drivers/media/dvb/frontends/l64781.c b/drivers/media/dvb/frontends/l64781.c index 3051b64aa17..445fa106806 100644 --- a/drivers/media/dvb/frontends/l64781.c +++ b/drivers/media/dvb/frontends/l64781.c | |||
| @@ -192,8 +192,8 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa | |||
| 192 | spi_bias *= qam_tab[p->constellation]; | 192 | spi_bias *= qam_tab[p->constellation]; |
| 193 | spi_bias /= p->code_rate_HP + 1; | 193 | spi_bias /= p->code_rate_HP + 1; |
| 194 | spi_bias /= (guard_tab[p->guard_interval] + 32); | 194 | spi_bias /= (guard_tab[p->guard_interval] + 32); |
| 195 | spi_bias *= 1000ULL; | 195 | spi_bias *= 1000; |
| 196 | spi_bias /= 1000ULL + ppm/1000; | 196 | spi_bias /= 1000 + ppm/1000; |
| 197 | spi_bias *= p->code_rate_HP; | 197 | spi_bias *= p->code_rate_HP; |
| 198 | 198 | ||
| 199 | val0x04 = (p->transmission_mode << 2) | p->guard_interval; | 199 | val0x04 = (p->transmission_mode << 2) | p->guard_interval; |
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 3182a406bdd..ae08b077fd0 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
| @@ -4461,6 +4461,7 @@ static int __devinit bttv_probe(struct pci_dev *dev, | |||
| 4461 | request_modules(btv); | 4461 | request_modules(btv); |
| 4462 | } | 4462 | } |
| 4463 | 4463 | ||
| 4464 | init_bttv_i2c_ir(btv); | ||
| 4464 | bttv_input_init(btv); | 4465 | bttv_input_init(btv); |
| 4465 | 4466 | ||
| 4466 | /* everything is fine */ | 4467 | /* everything is fine */ |
diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c index 63aa31a041e..407fa61e4cd 100644 --- a/drivers/media/video/bt8xx/bttv-i2c.c +++ b/drivers/media/video/bt8xx/bttv-i2c.c | |||
| @@ -388,7 +388,12 @@ int __devinit init_bttv_i2c(struct bttv *btv) | |||
| 388 | if (0 == btv->i2c_rc && i2c_scan) | 388 | if (0 == btv->i2c_rc && i2c_scan) |
| 389 | do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client); | 389 | do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client); |
| 390 | 390 | ||
| 391 | /* Instantiate the IR receiver device, if present */ | 391 | return btv->i2c_rc; |
| 392 | } | ||
| 393 | |||
| 394 | /* Instantiate the I2C IR receiver device, if present */ | ||
| 395 | void __devinit init_bttv_i2c_ir(struct bttv *btv) | ||
| 396 | { | ||
| 392 | if (0 == btv->i2c_rc) { | 397 | if (0 == btv->i2c_rc) { |
| 393 | struct i2c_board_info info; | 398 | struct i2c_board_info info; |
| 394 | /* The external IR receiver is at i2c address 0x34 (0x35 for | 399 | /* The external IR receiver is at i2c address 0x34 (0x35 for |
| @@ -408,7 +413,6 @@ int __devinit init_bttv_i2c(struct bttv *btv) | |||
| 408 | strlcpy(info.type, "ir_video", I2C_NAME_SIZE); | 413 | strlcpy(info.type, "ir_video", I2C_NAME_SIZE); |
| 409 | i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list); | 414 | i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list); |
| 410 | } | 415 | } |
| 411 | return btv->i2c_rc; | ||
| 412 | } | 416 | } |
| 413 | 417 | ||
| 414 | int __devexit fini_bttv_i2c(struct bttv *btv) | 418 | int __devexit fini_bttv_i2c(struct bttv *btv) |
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index a1d0e9c9f28..6cccc2a17ee 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h | |||
| @@ -279,6 +279,7 @@ extern unsigned int bttv_debug; | |||
| 279 | extern unsigned int bttv_gpio; | 279 | extern unsigned int bttv_gpio; |
| 280 | extern void bttv_gpio_tracking(struct bttv *btv, char *comment); | 280 | extern void bttv_gpio_tracking(struct bttv *btv, char *comment); |
| 281 | extern int init_bttv_i2c(struct bttv *btv); | 281 | extern int init_bttv_i2c(struct bttv *btv); |
| 282 | extern void init_bttv_i2c_ir(struct bttv *btv); | ||
| 282 | extern int fini_bttv_i2c(struct bttv *btv); | 283 | extern int fini_bttv_i2c(struct bttv *btv); |
| 283 | 284 | ||
| 284 | #define bttv_printk if (bttv_verbose) printk | 285 | #define bttv_printk if (bttv_verbose) printk |
diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c index fc4dd604572..7438f8d775b 100644 --- a/drivers/media/video/mt9t112.c +++ b/drivers/media/video/mt9t112.c | |||
| @@ -514,7 +514,7 @@ static int mt9t112_init_pll(const struct i2c_client *client) | |||
| 514 | /* poll to verify out of standby. Must Poll this bit */ | 514 | /* poll to verify out of standby. Must Poll this bit */ |
| 515 | for (i = 0; i < 100; i++) { | 515 | for (i = 0; i < 100; i++) { |
| 516 | mt9t112_reg_read(data, client, 0x0018); | 516 | mt9t112_reg_read(data, client, 0x0018); |
| 517 | if (0x4000 & data) | 517 | if (!(0x4000 & data)) |
| 518 | break; | 518 | break; |
| 519 | 519 | ||
| 520 | mdelay(10); | 520 | mdelay(10); |
diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c index 50b415e07ed..f7f7e04cf48 100644 --- a/drivers/media/video/pwc/pwc-ctrl.c +++ b/drivers/media/video/pwc/pwc-ctrl.c | |||
| @@ -753,7 +753,7 @@ int pwc_set_shutter_speed(struct pwc_device *pdev, int mode, int value) | |||
| 753 | buf[0] = 0xff; /* fixed */ | 753 | buf[0] = 0xff; /* fixed */ |
| 754 | 754 | ||
| 755 | ret = send_control_msg(pdev, | 755 | ret = send_control_msg(pdev, |
| 756 | SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, sizeof(buf)); | 756 | SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, 1); |
| 757 | 757 | ||
| 758 | if (!mode && ret >= 0) { | 758 | if (!mode && ret >= 0) { |
| 759 | if (value < 0) | 759 | if (value < 0) |
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c index bf0b96af533..5712fddd72f 100644 --- a/drivers/net/sfc/falcon_boards.c +++ b/drivers/net/sfc/falcon_boards.c | |||
| @@ -29,6 +29,15 @@ | |||
| 29 | #define FALCON_BOARD_SFN4111T 0x51 | 29 | #define FALCON_BOARD_SFN4111T 0x51 |
| 30 | #define FALCON_BOARD_SFN4112F 0x52 | 30 | #define FALCON_BOARD_SFN4112F 0x52 |
| 31 | 31 | ||
| 32 | /* Board temperature is about 15°C above ambient when air flow is | ||
| 33 | * limited. */ | ||
| 34 | #define FALCON_BOARD_TEMP_BIAS 15 | ||
| 35 | |||
| 36 | /* SFC4000 datasheet says: 'The maximum permitted junction temperature | ||
| 37 | * is 125°C; the thermal design of the environment for the SFC4000 | ||
| 38 | * should aim to keep this well below 100°C.' */ | ||
| 39 | #define FALCON_JUNC_TEMP_MAX 90 | ||
| 40 | |||
| 32 | /***************************************************************************** | 41 | /***************************************************************************** |
| 33 | * Support for LM87 sensor chip used on several boards | 42 | * Support for LM87 sensor chip used on several boards |
| 34 | */ | 43 | */ |
| @@ -548,16 +557,16 @@ fail_hwmon: | |||
| 548 | static u8 sfe4002_lm87_channel = 0x03; /* use AIN not FAN inputs */ | 557 | static u8 sfe4002_lm87_channel = 0x03; /* use AIN not FAN inputs */ |
| 549 | 558 | ||
| 550 | static const u8 sfe4002_lm87_regs[] = { | 559 | static const u8 sfe4002_lm87_regs[] = { |
| 551 | LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */ | 560 | LM87_IN_LIMITS(0, 0x7c, 0x99), /* 2.5V: 1.8V +/- 10% */ |
| 552 | LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */ | 561 | LM87_IN_LIMITS(1, 0x4c, 0x5e), /* Vccp1: 1.2V +/- 10% */ |
| 553 | LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */ | 562 | LM87_IN_LIMITS(2, 0xac, 0xd4), /* 3.3V: 3.3V +/- 10% */ |
| 554 | LM87_IN_LIMITS(3, 0xb0, 0xc9), /* 5V: 4.6-5.2V */ | 563 | LM87_IN_LIMITS(3, 0xac, 0xd4), /* 5V: 5.0V +/- 10% */ |
| 555 | LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */ | 564 | LM87_IN_LIMITS(4, 0xac, 0xe0), /* 12V: 10.8-14V */ |
| 556 | LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */ | 565 | LM87_IN_LIMITS(5, 0x3f, 0x4f), /* Vccp2: 1.0V +/- 10% */ |
| 557 | LM87_AIN_LIMITS(0, 0xa0, 0xb2), /* AIN1: 1.66V +/- 5% */ | 566 | LM87_AIN_LIMITS(0, 0x98, 0xbb), /* AIN1: 1.66V +/- 10% */ |
| 558 | LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */ | 567 | LM87_AIN_LIMITS(1, 0x8a, 0xa9), /* AIN2: 1.5V +/- 10% */ |
| 559 | LM87_TEMP_INT_LIMITS(10, 60), /* board */ | 568 | LM87_TEMP_INT_LIMITS(0, 80 + FALCON_BOARD_TEMP_BIAS), |
| 560 | LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */ | 569 | LM87_TEMP_EXT1_LIMITS(0, FALCON_JUNC_TEMP_MAX), |
| 561 | 0 | 570 | 0 |
| 562 | }; | 571 | }; |
| 563 | 572 | ||
| @@ -619,14 +628,14 @@ static int sfe4002_init(struct efx_nic *efx) | |||
| 619 | static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */ | 628 | static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */ |
| 620 | 629 | ||
| 621 | static const u8 sfn4112f_lm87_regs[] = { | 630 | static const u8 sfn4112f_lm87_regs[] = { |
| 622 | LM87_IN_LIMITS(0, 0x83, 0x91), /* 2.5V: 1.8V +/- 5% */ | 631 | LM87_IN_LIMITS(0, 0x7c, 0x99), /* 2.5V: 1.8V +/- 10% */ |
| 623 | LM87_IN_LIMITS(1, 0x51, 0x5a), /* Vccp1: 1.2V +/- 5% */ | 632 | LM87_IN_LIMITS(1, 0x4c, 0x5e), /* Vccp1: 1.2V +/- 10% */ |
| 624 | LM87_IN_LIMITS(2, 0xb6, 0xca), /* 3.3V: 3.3V +/- 5% */ | 633 | LM87_IN_LIMITS(2, 0xac, 0xd4), /* 3.3V: 3.3V +/- 10% */ |
| 625 | LM87_IN_LIMITS(4, 0xb0, 0xe0), /* 12V: 11-14V */ | 634 | LM87_IN_LIMITS(4, 0xac, 0xe0), /* 12V: 10.8-14V */ |
| 626 | LM87_IN_LIMITS(5, 0x44, 0x4b), /* Vccp2: 1.0V +/- 5% */ | 635 | LM87_IN_LIMITS(5, 0x3f, 0x4f), /* Vccp2: 1.0V +/- 10% */ |
| 627 | LM87_AIN_LIMITS(1, 0x91, 0xa1), /* AIN2: 1.5V +/- 5% */ | 636 | LM87_AIN_LIMITS(1, 0x8a, 0xa9), /* AIN2: 1.5V +/- 10% */ |
| 628 | LM87_TEMP_INT_LIMITS(10, 60), /* board */ | 637 | LM87_TEMP_INT_LIMITS(0, 60 + FALCON_BOARD_TEMP_BIAS), |
| 629 | LM87_TEMP_EXT1_LIMITS(10, 70), /* Falcon */ | 638 | LM87_TEMP_EXT1_LIMITS(0, FALCON_JUNC_TEMP_MAX), |
| 630 | 0 | 639 | 0 |
| 631 | }; | 640 | }; |
| 632 | 641 | ||
diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c index 9f035b9f035..f66b3da6ddf 100644 --- a/drivers/net/sfc/mcdi.c +++ b/drivers/net/sfc/mcdi.c | |||
| @@ -127,7 +127,7 @@ static int efx_mcdi_poll(struct efx_nic *efx) | |||
| 127 | efx_dword_t reg; | 127 | efx_dword_t reg; |
| 128 | 128 | ||
| 129 | /* Check for a reboot atomically with respect to efx_mcdi_copyout() */ | 129 | /* Check for a reboot atomically with respect to efx_mcdi_copyout() */ |
| 130 | rc = efx_mcdi_poll_reboot(efx); | 130 | rc = -efx_mcdi_poll_reboot(efx); |
| 131 | if (rc) | 131 | if (rc) |
| 132 | goto out; | 132 | goto out; |
| 133 | 133 | ||
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 8e952fdab76..cb2fd01edda 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
| @@ -720,12 +720,6 @@ static int acpiphp_bus_add(struct acpiphp_func *func) | |||
| 720 | -ret_val); | 720 | -ret_val); |
| 721 | goto acpiphp_bus_add_out; | 721 | goto acpiphp_bus_add_out; |
| 722 | } | 722 | } |
| 723 | /* | ||
| 724 | * try to start anyway. We could have failed to add | ||
| 725 | * simply because this bus had previously been added | ||
| 726 | * on another add. Don't bother with the return value | ||
| 727 | * we just keep going. | ||
| 728 | */ | ||
| 729 | ret_val = acpi_bus_start(device); | 723 | ret_val = acpi_bus_start(device); |
| 730 | 724 | ||
| 731 | acpiphp_bus_add_out: | 725 | acpiphp_bus_add_out: |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index e67e4feb35c..eb603f1d55c 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
| @@ -5771,7 +5771,7 @@ static void thermal_exit(void) | |||
| 5771 | case TPACPI_THERMAL_ACPI_TMP07: | 5771 | case TPACPI_THERMAL_ACPI_TMP07: |
| 5772 | case TPACPI_THERMAL_ACPI_UPDT: | 5772 | case TPACPI_THERMAL_ACPI_UPDT: |
| 5773 | sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj, | 5773 | sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj, |
| 5774 | &thermal_temp_input16_group); | 5774 | &thermal_temp_input8_group); |
| 5775 | break; | 5775 | break; |
| 5776 | case TPACPI_THERMAL_NONE: | 5776 | case TPACPI_THERMAL_NONE: |
| 5777 | default: | 5777 | default: |
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index 47754260228..9e71ac61114 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c | |||
| @@ -2516,7 +2516,7 @@ int fas216_eh_device_reset(struct scsi_cmnd *SCpnt) | |||
| 2516 | if (info->scsi.phase == PHASE_IDLE) | 2516 | if (info->scsi.phase == PHASE_IDLE) |
| 2517 | fas216_kick(info); | 2517 | fas216_kick(info); |
| 2518 | 2518 | ||
| 2519 | mod_timer(&info->eh_timer, 30 * HZ); | 2519 | mod_timer(&info->eh_timer, jiffies + 30 * HZ); |
| 2520 | spin_unlock_irqrestore(&info->host_lock, flags); | 2520 | spin_unlock_irqrestore(&info->host_lock, flags); |
| 2521 | 2521 | ||
| 2522 | /* | 2522 | /* |
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 10be9f36a4c..2f47ae7cce9 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
| @@ -2009,6 +2009,8 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp) | |||
| 2009 | fcoe_interface_cleanup(fcoe); | 2009 | fcoe_interface_cleanup(fcoe); |
| 2010 | rtnl_unlock(); | 2010 | rtnl_unlock(); |
| 2011 | fcoe_if_destroy(fcoe->ctlr.lp); | 2011 | fcoe_if_destroy(fcoe->ctlr.lp); |
| 2012 | module_put(THIS_MODULE); | ||
| 2013 | |||
| 2012 | out_putdev: | 2014 | out_putdev: |
| 2013 | dev_put(netdev); | 2015 | dev_put(netdev); |
| 2014 | out_nodev: | 2016 | out_nodev: |
| @@ -2059,6 +2061,11 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp) | |||
| 2059 | } | 2061 | } |
| 2060 | #endif | 2062 | #endif |
| 2061 | 2063 | ||
| 2064 | if (!try_module_get(THIS_MODULE)) { | ||
| 2065 | rc = -EINVAL; | ||
| 2066 | goto out_nomod; | ||
| 2067 | } | ||
| 2068 | |||
| 2062 | rtnl_lock(); | 2069 | rtnl_lock(); |
| 2063 | netdev = fcoe_if_to_netdev(buffer); | 2070 | netdev = fcoe_if_to_netdev(buffer); |
| 2064 | if (!netdev) { | 2071 | if (!netdev) { |
| @@ -2099,17 +2106,24 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp) | |||
| 2099 | if (!fcoe_link_ok(lport)) | 2106 | if (!fcoe_link_ok(lport)) |
| 2100 | fcoe_ctlr_link_up(&fcoe->ctlr); | 2107 | fcoe_ctlr_link_up(&fcoe->ctlr); |
| 2101 | 2108 | ||
| 2102 | rc = 0; | ||
| 2103 | out_free: | ||
| 2104 | /* | 2109 | /* |
| 2105 | * Release from init in fcoe_interface_create(), on success lport | 2110 | * Release from init in fcoe_interface_create(), on success lport |
| 2106 | * should be holding a reference taken in fcoe_if_create(). | 2111 | * should be holding a reference taken in fcoe_if_create(). |
| 2107 | */ | 2112 | */ |
| 2108 | fcoe_interface_put(fcoe); | 2113 | fcoe_interface_put(fcoe); |
| 2114 | dev_put(netdev); | ||
| 2115 | rtnl_unlock(); | ||
| 2116 | mutex_unlock(&fcoe_config_mutex); | ||
| 2117 | |||
| 2118 | return 0; | ||
| 2119 | out_free: | ||
| 2120 | fcoe_interface_put(fcoe); | ||
| 2109 | out_putdev: | 2121 | out_putdev: |
| 2110 | dev_put(netdev); | 2122 | dev_put(netdev); |
| 2111 | out_nodev: | 2123 | out_nodev: |
| 2112 | rtnl_unlock(); | 2124 | rtnl_unlock(); |
| 2125 | module_put(THIS_MODULE); | ||
| 2126 | out_nomod: | ||
| 2113 | mutex_unlock(&fcoe_config_mutex); | 2127 | mutex_unlock(&fcoe_config_mutex); |
| 2114 | return rc; | 2128 | return rc; |
| 2115 | } | 2129 | } |
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c index 9823291395a..511cb6b371e 100644 --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c | |||
| @@ -1187,7 +1187,7 @@ static void fcoe_ctlr_timeout(unsigned long arg) | |||
| 1187 | next_timer = fip->ctlr_ka_time; | 1187 | next_timer = fip->ctlr_ka_time; |
| 1188 | 1188 | ||
| 1189 | if (time_after_eq(jiffies, fip->port_ka_time)) { | 1189 | if (time_after_eq(jiffies, fip->port_ka_time)) { |
| 1190 | fip->port_ka_time += jiffies + | 1190 | fip->port_ka_time = jiffies + |
| 1191 | msecs_to_jiffies(FIP_VN_KA_PERIOD); | 1191 | msecs_to_jiffies(FIP_VN_KA_PERIOD); |
| 1192 | fip->send_port_ka = 1; | 1192 | fip->send_port_ka = 1; |
| 1193 | } | 1193 | } |
diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c index 19d711cb938..7f4364770e4 100644 --- a/drivers/scsi/libfc/fc_exch.c +++ b/drivers/scsi/libfc/fc_exch.c | |||
| @@ -1890,7 +1890,7 @@ static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport, | |||
| 1890 | fc_exch_setup_hdr(ep, fp, ep->f_ctl); | 1890 | fc_exch_setup_hdr(ep, fp, ep->f_ctl); |
| 1891 | sp->cnt++; | 1891 | sp->cnt++; |
| 1892 | 1892 | ||
| 1893 | if (ep->xid <= lport->lro_xid) | 1893 | if (ep->xid <= lport->lro_xid && fh->fh_r_ctl == FC_RCTL_DD_UNSOL_CMD) |
| 1894 | fc_fcp_ddp_setup(fr_fsp(fp), ep->xid); | 1894 | fc_fcp_ddp_setup(fr_fsp(fp), ep->xid); |
| 1895 | 1895 | ||
| 1896 | if (unlikely(lport->tt.frame_send(lport, fp))) | 1896 | if (unlikely(lport->tt.frame_send(lport, fp))) |
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 881d5dfe8c7..6fde2fabfd9 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
| @@ -298,9 +298,6 @@ void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid) | |||
| 298 | { | 298 | { |
| 299 | struct fc_lport *lport; | 299 | struct fc_lport *lport; |
| 300 | 300 | ||
| 301 | if (!fsp) | ||
| 302 | return; | ||
| 303 | |||
| 304 | lport = fsp->lp; | 301 | lport = fsp->lp; |
| 305 | if ((fsp->req_flags & FC_SRB_READ) && | 302 | if ((fsp->req_flags & FC_SRB_READ) && |
| 306 | (lport->lro_enabled) && (lport->tt.ddp_setup)) { | 303 | (lport->lro_enabled) && (lport->tt.ddp_setup)) { |
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 0b165024a21..7ec8ce75007 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c | |||
| @@ -1800,7 +1800,8 @@ int fc_lport_bsg_request(struct fc_bsg_job *job) | |||
| 1800 | u32 did; | 1800 | u32 did; |
| 1801 | 1801 | ||
| 1802 | job->reply->reply_payload_rcv_len = 0; | 1802 | job->reply->reply_payload_rcv_len = 0; |
| 1803 | rsp->resid_len = job->reply_payload.payload_len; | 1803 | if (rsp) |
| 1804 | rsp->resid_len = job->reply_payload.payload_len; | ||
| 1804 | 1805 | ||
| 1805 | mutex_lock(&lport->lp_mutex); | 1806 | mutex_lock(&lport->lp_mutex); |
| 1806 | 1807 | ||
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index 02300523b23..97923bb0776 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c | |||
| @@ -623,7 +623,7 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
| 623 | 623 | ||
| 624 | tov = ntohl(plp->fl_csp.sp_e_d_tov); | 624 | tov = ntohl(plp->fl_csp.sp_e_d_tov); |
| 625 | if (ntohs(plp->fl_csp.sp_features) & FC_SP_FT_EDTR) | 625 | if (ntohs(plp->fl_csp.sp_features) & FC_SP_FT_EDTR) |
| 626 | tov /= 1000; | 626 | tov /= 1000000; |
| 627 | if (tov > rdata->e_d_tov) | 627 | if (tov > rdata->e_d_tov) |
| 628 | rdata->e_d_tov = tov; | 628 | rdata->e_d_tov = tov; |
| 629 | csp_seq = ntohs(plp->fl_csp.sp_tot_seq); | 629 | csp_seq = ntohs(plp->fl_csp.sp_tot_seq); |
diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c index db6856c138f..4ad87fd74dd 100644 --- a/drivers/scsi/libiscsi_tcp.c +++ b/drivers/scsi/libiscsi_tcp.c | |||
| @@ -992,12 +992,10 @@ static struct iscsi_r2t_info *iscsi_tcp_get_curr_r2t(struct iscsi_task *task) | |||
| 992 | if (r2t == NULL) { | 992 | if (r2t == NULL) { |
| 993 | if (kfifo_out(&tcp_task->r2tqueue, | 993 | if (kfifo_out(&tcp_task->r2tqueue, |
| 994 | (void *)&tcp_task->r2t, sizeof(void *)) != | 994 | (void *)&tcp_task->r2t, sizeof(void *)) != |
| 995 | sizeof(void *)) { | 995 | sizeof(void *)) |
| 996 | WARN_ONCE(1, "unexpected fifo state"); | ||
| 997 | r2t = NULL; | 996 | r2t = NULL; |
| 998 | } | 997 | else |
| 999 | 998 | r2t = tcp_task->r2t; | |
| 1000 | r2t = tcp_task->r2t; | ||
| 1001 | } | 999 | } |
| 1002 | spin_unlock_bh(&session->lock); | 1000 | spin_unlock_bh(&session->lock); |
| 1003 | } | 1001 | } |
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 708ea3157b6..d9b8ca5116b 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
| @@ -3781,6 +3781,7 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg) | |||
| 3781 | compat_alloc_user_space(sizeof(struct megasas_iocpacket)); | 3781 | compat_alloc_user_space(sizeof(struct megasas_iocpacket)); |
| 3782 | int i; | 3782 | int i; |
| 3783 | int error = 0; | 3783 | int error = 0; |
| 3784 | compat_uptr_t ptr; | ||
| 3784 | 3785 | ||
| 3785 | if (clear_user(ioc, sizeof(*ioc))) | 3786 | if (clear_user(ioc, sizeof(*ioc))) |
| 3786 | return -EFAULT; | 3787 | return -EFAULT; |
| @@ -3793,9 +3794,22 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg) | |||
| 3793 | copy_in_user(&ioc->sge_count, &cioc->sge_count, sizeof(u32))) | 3794 | copy_in_user(&ioc->sge_count, &cioc->sge_count, sizeof(u32))) |
| 3794 | return -EFAULT; | 3795 | return -EFAULT; |
| 3795 | 3796 | ||
| 3796 | for (i = 0; i < MAX_IOCTL_SGE; i++) { | 3797 | /* |
| 3797 | compat_uptr_t ptr; | 3798 | * The sense_ptr is used in megasas_mgmt_fw_ioctl only when |
| 3799 | * sense_len is not null, so prepare the 64bit value under | ||
| 3800 | * the same condition. | ||
| 3801 | */ | ||
| 3802 | if (ioc->sense_len) { | ||
| 3803 | void __user **sense_ioc_ptr = | ||
| 3804 | (void __user **)(ioc->frame.raw + ioc->sense_off); | ||
| 3805 | compat_uptr_t *sense_cioc_ptr = | ||
| 3806 | (compat_uptr_t *)(cioc->frame.raw + cioc->sense_off); | ||
| 3807 | if (get_user(ptr, sense_cioc_ptr) || | ||
| 3808 | put_user(compat_ptr(ptr), sense_ioc_ptr)) | ||
| 3809 | return -EFAULT; | ||
| 3810 | } | ||
| 3798 | 3811 | ||
| 3812 | for (i = 0; i < MAX_IOCTL_SGE; i++) { | ||
| 3799 | if (get_user(ptr, &cioc->sgl[i].iov_base) || | 3813 | if (get_user(ptr, &cioc->sgl[i].iov_base) || |
| 3800 | put_user(compat_ptr(ptr), &ioc->sgl[i].iov_base) || | 3814 | put_user(compat_ptr(ptr), &ioc->sgl[i].iov_base) || |
| 3801 | copy_in_user(&ioc->sgl[i].iov_len, | 3815 | copy_in_user(&ioc->sgl[i].iov_len, |
diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c index c7b3f9df231..2159e668751 100644 --- a/drivers/watchdog/bfin_wdt.c +++ b/drivers/watchdog/bfin_wdt.c | |||
| @@ -1,9 +1,8 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Blackfin On-Chip Watchdog Driver | 2 | * Blackfin On-Chip Watchdog Driver |
| 3 | * Supports BF53[123]/BF53[467]/BF54[2489]/BF561 | ||
| 4 | * | 3 | * |
| 5 | * Originally based on softdog.c | 4 | * Originally based on softdog.c |
| 6 | * Copyright 2006-2007 Analog Devices Inc. | 5 | * Copyright 2006-2010 Analog Devices Inc. |
| 7 | * Copyright 2006-2007 Michele d'Amico | 6 | * Copyright 2006-2007 Michele d'Amico |
| 8 | * Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk> | 7 | * Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk> |
| 9 | * | 8 | * |
| @@ -137,13 +136,15 @@ static int bfin_wdt_running(void) | |||
| 137 | */ | 136 | */ |
| 138 | static int bfin_wdt_set_timeout(unsigned long t) | 137 | static int bfin_wdt_set_timeout(unsigned long t) |
| 139 | { | 138 | { |
| 140 | u32 cnt; | 139 | u32 cnt, max_t, sclk; |
| 141 | unsigned long flags; | 140 | unsigned long flags; |
| 142 | 141 | ||
| 143 | stampit(); | 142 | sclk = get_sclk(); |
| 143 | max_t = -1 / sclk; | ||
| 144 | cnt = t * sclk; | ||
| 145 | stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt); | ||
| 144 | 146 | ||
| 145 | cnt = t * get_sclk(); | 147 | if (t > max_t) { |
| 146 | if (cnt < get_sclk()) { | ||
| 147 | printk(KERN_WARNING PFX "timeout value is too large\n"); | 148 | printk(KERN_WARNING PFX "timeout value is too large\n"); |
| 148 | return -EINVAL; | 149 | return -EINVAL; |
| 149 | } | 150 | } |
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c index 14ac4806e29..eeb4986ea7d 100644 --- a/fs/cachefiles/namei.c +++ b/fs/cachefiles/namei.c | |||
| @@ -348,7 +348,17 @@ int cachefiles_delete_object(struct cachefiles_cache *cache, | |||
| 348 | dir = dget_parent(object->dentry); | 348 | dir = dget_parent(object->dentry); |
| 349 | 349 | ||
| 350 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); | 350 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); |
| 351 | ret = cachefiles_bury_object(cache, dir, object->dentry); | 351 | |
| 352 | /* we need to check that our parent is _still_ our parent - it may have | ||
| 353 | * been renamed */ | ||
| 354 | if (dir == object->dentry->d_parent) { | ||
| 355 | ret = cachefiles_bury_object(cache, dir, object->dentry); | ||
| 356 | } else { | ||
| 357 | /* it got moved, presumably by cachefilesd culling it, so it's | ||
| 358 | * no longer in the key path and we can ignore it */ | ||
| 359 | mutex_unlock(&dir->d_inode->i_mutex); | ||
| 360 | ret = 0; | ||
| 361 | } | ||
| 352 | 362 | ||
| 353 | dput(dir); | 363 | dput(dir); |
| 354 | _leave(" = %d", ret); | 364 | _leave(" = %d", ret); |
diff --git a/fs/namei.c b/fs/namei.c index d62fdc875f2..a4855af776a 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
| @@ -823,6 +823,17 @@ fail: | |||
| 823 | } | 823 | } |
| 824 | 824 | ||
| 825 | /* | 825 | /* |
| 826 | * This is a temporary kludge to deal with "automount" symlinks; proper | ||
| 827 | * solution is to trigger them on follow_mount(), so that do_lookup() | ||
| 828 | * would DTRT. To be killed before 2.6.34-final. | ||
| 829 | */ | ||
| 830 | static inline int follow_on_final(struct inode *inode, unsigned lookup_flags) | ||
| 831 | { | ||
| 832 | return inode && unlikely(inode->i_op->follow_link) && | ||
| 833 | ((lookup_flags & LOOKUP_FOLLOW) || S_ISDIR(inode->i_mode)); | ||
| 834 | } | ||
| 835 | |||
| 836 | /* | ||
| 826 | * Name resolution. | 837 | * Name resolution. |
| 827 | * This is the basic name resolution function, turning a pathname into | 838 | * This is the basic name resolution function, turning a pathname into |
| 828 | * the final dentry. We expect 'base' to be positive and a directory. | 839 | * the final dentry. We expect 'base' to be positive and a directory. |
| @@ -942,8 +953,7 @@ last_component: | |||
| 942 | if (err) | 953 | if (err) |
| 943 | break; | 954 | break; |
| 944 | inode = next.dentry->d_inode; | 955 | inode = next.dentry->d_inode; |
| 945 | if ((lookup_flags & LOOKUP_FOLLOW) | 956 | if (follow_on_final(inode, lookup_flags)) { |
| 946 | && inode && inode->i_op->follow_link) { | ||
| 947 | err = do_follow_link(&next, nd); | 957 | err = do_follow_link(&next, nd); |
| 948 | if (err) | 958 | if (err) |
| 949 | goto return_err; | 959 | goto return_err; |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 97d79eff6b7..8715d194561 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
| @@ -752,7 +752,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
| 752 | flags, current_cred()); | 752 | flags, current_cred()); |
| 753 | if (IS_ERR(*filp)) | 753 | if (IS_ERR(*filp)) |
| 754 | host_err = PTR_ERR(*filp); | 754 | host_err = PTR_ERR(*filp); |
| 755 | host_err = ima_file_check(*filp, access); | 755 | else |
| 756 | host_err = ima_file_check(*filp, access); | ||
| 756 | out_nfserr: | 757 | out_nfserr: |
| 757 | err = nfserrno(host_err); | 758 | err = nfserrno(host_err); |
| 758 | out: | 759 | out: |
diff --git a/fs/proc/base.c b/fs/proc/base.c index e42bbd843ed..58324c29916 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -2369,16 +2369,30 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
| 2369 | { | 2369 | { |
| 2370 | struct pid_namespace *ns = dentry->d_sb->s_fs_info; | 2370 | struct pid_namespace *ns = dentry->d_sb->s_fs_info; |
| 2371 | pid_t tgid = task_tgid_nr_ns(current, ns); | 2371 | pid_t tgid = task_tgid_nr_ns(current, ns); |
| 2372 | char tmp[PROC_NUMBUF]; | 2372 | char *name = ERR_PTR(-ENOENT); |
| 2373 | if (!tgid) | 2373 | if (tgid) { |
| 2374 | return ERR_PTR(-ENOENT); | 2374 | name = __getname(); |
| 2375 | sprintf(tmp, "%d", task_tgid_nr_ns(current, ns)); | 2375 | if (!name) |
| 2376 | return ERR_PTR(vfs_follow_link(nd,tmp)); | 2376 | name = ERR_PTR(-ENOMEM); |
| 2377 | else | ||
| 2378 | sprintf(name, "%d", tgid); | ||
| 2379 | } | ||
| 2380 | nd_set_link(nd, name); | ||
| 2381 | return NULL; | ||
| 2382 | } | ||
| 2383 | |||
| 2384 | static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd, | ||
| 2385 | void *cookie) | ||
| 2386 | { | ||
| 2387 | char *s = nd_get_link(nd); | ||
| 2388 | if (!IS_ERR(s)) | ||
| 2389 | __putname(s); | ||
| 2377 | } | 2390 | } |
| 2378 | 2391 | ||
| 2379 | static const struct inode_operations proc_self_inode_operations = { | 2392 | static const struct inode_operations proc_self_inode_operations = { |
| 2380 | .readlink = proc_self_readlink, | 2393 | .readlink = proc_self_readlink, |
| 2381 | .follow_link = proc_self_follow_link, | 2394 | .follow_link = proc_self_follow_link, |
| 2395 | .put_link = proc_self_put_link, | ||
| 2382 | }; | 2396 | }; |
| 2383 | 2397 | ||
| 2384 | /* | 2398 | /* |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index ab94335b4bb..6816be6c3f7 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/include/asm-arm/hardware/amba.h | 2 | * linux/include/amba/bus.h |
| 3 | * | ||
| 4 | * This device type deals with ARM PrimeCells and anything else that | ||
| 5 | * presents a proper CID (0xB105F00D) at the end of the I/O register | ||
| 6 | * region or that is derived from a PrimeCell. | ||
| 3 | * | 7 | * |
| 4 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. | 8 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. |
| 5 | * | 9 | * |
diff --git a/include/linux/fs.h b/include/linux/fs.h index b1bcb275b59..ebb1cd5bc24 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -729,6 +729,7 @@ struct inode { | |||
| 729 | uid_t i_uid; | 729 | uid_t i_uid; |
| 730 | gid_t i_gid; | 730 | gid_t i_gid; |
| 731 | dev_t i_rdev; | 731 | dev_t i_rdev; |
| 732 | unsigned int i_blkbits; | ||
| 732 | u64 i_version; | 733 | u64 i_version; |
| 733 | loff_t i_size; | 734 | loff_t i_size; |
| 734 | #ifdef __NEED_I_SIZE_ORDERED | 735 | #ifdef __NEED_I_SIZE_ORDERED |
| @@ -738,7 +739,6 @@ struct inode { | |||
| 738 | struct timespec i_mtime; | 739 | struct timespec i_mtime; |
| 739 | struct timespec i_ctime; | 740 | struct timespec i_ctime; |
| 740 | blkcnt_t i_blocks; | 741 | blkcnt_t i_blocks; |
| 741 | unsigned int i_blkbits; | ||
| 742 | unsigned short i_bytes; | 742 | unsigned short i_bytes; |
| 743 | umode_t i_mode; | 743 | umode_t i_mode; |
| 744 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 744 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
diff --git a/include/linux/input.h b/include/linux/input.h index 735ceaf1bc2..663208afb64 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -376,6 +376,7 @@ struct input_absinfo { | |||
| 376 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ | 376 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ |
| 377 | 377 | ||
| 378 | #define KEY_WIMAX 246 | 378 | #define KEY_WIMAX 246 |
| 379 | #define KEY_RFKILL 247 /* Key that controls all radios */ | ||
| 379 | 380 | ||
| 380 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ | 381 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ |
| 381 | 382 | ||
diff --git a/mm/migrate.c b/mm/migrate.c index 9a0db5bbabe..880bd592d38 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
| @@ -1002,33 +1002,27 @@ static int do_pages_stat(struct mm_struct *mm, unsigned long nr_pages, | |||
| 1002 | #define DO_PAGES_STAT_CHUNK_NR 16 | 1002 | #define DO_PAGES_STAT_CHUNK_NR 16 |
| 1003 | const void __user *chunk_pages[DO_PAGES_STAT_CHUNK_NR]; | 1003 | const void __user *chunk_pages[DO_PAGES_STAT_CHUNK_NR]; |
| 1004 | int chunk_status[DO_PAGES_STAT_CHUNK_NR]; | 1004 | int chunk_status[DO_PAGES_STAT_CHUNK_NR]; |
| 1005 | unsigned long i, chunk_nr = DO_PAGES_STAT_CHUNK_NR; | ||
| 1006 | int err; | ||
| 1007 | 1005 | ||
| 1008 | for (i = 0; i < nr_pages; i += chunk_nr) { | 1006 | while (nr_pages) { |
| 1009 | if (chunk_nr > nr_pages - i) | 1007 | unsigned long chunk_nr; |
| 1010 | chunk_nr = nr_pages - i; | ||
| 1011 | 1008 | ||
| 1012 | err = copy_from_user(chunk_pages, &pages[i], | 1009 | chunk_nr = nr_pages; |
| 1013 | chunk_nr * sizeof(*chunk_pages)); | 1010 | if (chunk_nr > DO_PAGES_STAT_CHUNK_NR) |
| 1014 | if (err) { | 1011 | chunk_nr = DO_PAGES_STAT_CHUNK_NR; |
| 1015 | err = -EFAULT; | 1012 | |
| 1016 | goto out; | 1013 | if (copy_from_user(chunk_pages, pages, chunk_nr * sizeof(*chunk_pages))) |
| 1017 | } | 1014 | break; |
| 1018 | 1015 | ||
| 1019 | do_pages_stat_array(mm, chunk_nr, chunk_pages, chunk_status); | 1016 | do_pages_stat_array(mm, chunk_nr, chunk_pages, chunk_status); |
| 1020 | 1017 | ||
| 1021 | err = copy_to_user(&status[i], chunk_status, | 1018 | if (copy_to_user(status, chunk_status, chunk_nr * sizeof(*status))) |
| 1022 | chunk_nr * sizeof(*chunk_status)); | 1019 | break; |
| 1023 | if (err) { | ||
| 1024 | err = -EFAULT; | ||
| 1025 | goto out; | ||
| 1026 | } | ||
| 1027 | } | ||
| 1028 | err = 0; | ||
| 1029 | 1020 | ||
| 1030 | out: | 1021 | pages += chunk_nr; |
| 1031 | return err; | 1022 | status += chunk_nr; |
| 1023 | nr_pages -= chunk_nr; | ||
| 1024 | } | ||
| 1025 | return nr_pages ? -EFAULT : 0; | ||
| 1032 | } | 1026 | } |
| 1033 | 1027 | ||
| 1034 | /* | 1028 | /* |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index fbc1c7472c5..099c753c421 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
| @@ -410,7 +410,8 @@ static ssize_t wireless_show(struct device *d, char *buf, | |||
| 410 | const struct iw_statistics *iw; | 410 | const struct iw_statistics *iw; |
| 411 | ssize_t ret = -EINVAL; | 411 | ssize_t ret = -EINVAL; |
| 412 | 412 | ||
| 413 | rtnl_lock(); | 413 | if (!rtnl_trylock()) |
| 414 | return restart_syscall(); | ||
| 414 | if (dev_isalive(dev)) { | 415 | if (dev_isalive(dev)) { |
| 415 | iw = get_wireless_stats(dev); | 416 | iw = get_wireless_stats(dev); |
| 416 | if (iw) | 417 | if (iw) |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 040c4f05b65..26dec2be961 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
| @@ -1317,14 +1317,19 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write, | |||
| 1317 | { | 1317 | { |
| 1318 | int *valp = ctl->data; | 1318 | int *valp = ctl->data; |
| 1319 | int val = *valp; | 1319 | int val = *valp; |
| 1320 | loff_t pos = *ppos; | ||
| 1320 | int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); | 1321 | int ret = proc_dointvec(ctl, write, buffer, lenp, ppos); |
| 1321 | 1322 | ||
| 1322 | if (write && *valp != val) { | 1323 | if (write && *valp != val) { |
| 1323 | struct net *net = ctl->extra2; | 1324 | struct net *net = ctl->extra2; |
| 1324 | 1325 | ||
| 1325 | if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) { | 1326 | if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) { |
| 1326 | if (!rtnl_trylock()) | 1327 | if (!rtnl_trylock()) { |
| 1328 | /* Restore the original values before restarting */ | ||
| 1329 | *valp = val; | ||
| 1330 | *ppos = pos; | ||
| 1327 | return restart_syscall(); | 1331 | return restart_syscall(); |
| 1332 | } | ||
| 1328 | if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) { | 1333 | if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) { |
| 1329 | inet_forward_change(net); | 1334 | inet_forward_change(net); |
| 1330 | } else if (*valp) { | 1335 | } else if (*valp) { |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index de7a194a64a..143791da062 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
| @@ -502,8 +502,11 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old) | |||
| 502 | if (p == &net->ipv6.devconf_dflt->forwarding) | 502 | if (p == &net->ipv6.devconf_dflt->forwarding) |
| 503 | return 0; | 503 | return 0; |
| 504 | 504 | ||
| 505 | if (!rtnl_trylock()) | 505 | if (!rtnl_trylock()) { |
| 506 | /* Restore the original values before restarting */ | ||
| 507 | *p = old; | ||
| 506 | return restart_syscall(); | 508 | return restart_syscall(); |
| 509 | } | ||
| 507 | 510 | ||
| 508 | if (p == &net->ipv6.devconf_all->forwarding) { | 511 | if (p == &net->ipv6.devconf_all->forwarding) { |
| 509 | __s32 newf = net->ipv6.devconf_all->forwarding; | 512 | __s32 newf = net->ipv6.devconf_all->forwarding; |
| @@ -4028,12 +4031,15 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, | |||
| 4028 | { | 4031 | { |
| 4029 | int *valp = ctl->data; | 4032 | int *valp = ctl->data; |
| 4030 | int val = *valp; | 4033 | int val = *valp; |
| 4034 | loff_t pos = *ppos; | ||
| 4031 | int ret; | 4035 | int ret; |
| 4032 | 4036 | ||
| 4033 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); | 4037 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); |
| 4034 | 4038 | ||
| 4035 | if (write) | 4039 | if (write) |
| 4036 | ret = addrconf_fixup_forwarding(ctl, valp, val); | 4040 | ret = addrconf_fixup_forwarding(ctl, valp, val); |
| 4041 | if (ret) | ||
| 4042 | *ppos = pos; | ||
| 4037 | return ret; | 4043 | return ret; |
| 4038 | } | 4044 | } |
| 4039 | 4045 | ||
| @@ -4075,8 +4081,11 @@ static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int old) | |||
| 4075 | if (p == &net->ipv6.devconf_dflt->disable_ipv6) | 4081 | if (p == &net->ipv6.devconf_dflt->disable_ipv6) |
| 4076 | return 0; | 4082 | return 0; |
| 4077 | 4083 | ||
| 4078 | if (!rtnl_trylock()) | 4084 | if (!rtnl_trylock()) { |
| 4085 | /* Restore the original values before restarting */ | ||
| 4086 | *p = old; | ||
| 4079 | return restart_syscall(); | 4087 | return restart_syscall(); |
| 4088 | } | ||
| 4080 | 4089 | ||
| 4081 | if (p == &net->ipv6.devconf_all->disable_ipv6) { | 4090 | if (p == &net->ipv6.devconf_all->disable_ipv6) { |
| 4082 | __s32 newf = net->ipv6.devconf_all->disable_ipv6; | 4091 | __s32 newf = net->ipv6.devconf_all->disable_ipv6; |
| @@ -4095,12 +4104,15 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write, | |||
| 4095 | { | 4104 | { |
| 4096 | int *valp = ctl->data; | 4105 | int *valp = ctl->data; |
| 4097 | int val = *valp; | 4106 | int val = *valp; |
| 4107 | loff_t pos = *ppos; | ||
| 4098 | int ret; | 4108 | int ret; |
| 4099 | 4109 | ||
| 4100 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); | 4110 | ret = proc_dointvec(ctl, write, buffer, lenp, ppos); |
| 4101 | 4111 | ||
| 4102 | if (write) | 4112 | if (write) |
| 4103 | ret = addrconf_disable_ipv6(ctl, valp, val); | 4113 | ret = addrconf_disable_ipv6(ctl, valp, val); |
| 4114 | if (ret) | ||
| 4115 | *ppos = pos; | ||
| 4104 | return ret; | 4116 | return ret; |
| 4105 | } | 4117 | } |
| 4106 | 4118 | ||
