Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-tcc into devel-stable

+3268 -1564
+1
.gitignore
··· 28 28 *.gz 29 29 *.bz2 30 30 *.lzma 31 + *.xz 31 32 *.lzo 32 33 *.patch 33 34 *.gcno
-6
Documentation/networking/00-INDEX
··· 40 40 - info on using the DECnet networking layer in Linux. 41 41 depca.txt 42 42 - the Digital DEPCA/EtherWORKS DE1?? and DE2?? LANCE Ethernet driver 43 - dgrs.txt 44 - - the Digi International RightSwitch SE-X Ethernet driver 45 43 dmfe.txt 46 44 - info on the Davicom DM9102(A)/DM9132/DM9801 fast ethernet driver. 47 45 e100.txt ··· 48 50 - info on Intel's E1000 line of gigabit ethernet boards 49 51 eql.txt 50 52 - serial IP load balancing 51 - ethertap.txt 52 - - the Ethertap user space packet reception and transmission driver 53 53 ewrk3.txt 54 54 - the Digital EtherWORKS 3 DE203/4/5 Ethernet driver 55 55 filter.txt ··· 100 104 - TUN/TAP device driver, allowing user space Rx/Tx of packets. 101 105 vortex.txt 102 106 - info on using 3Com Vortex (3c590, 3c592, 3c595, 3c597) Ethernet cards. 103 - wavelan.txt 104 - - AT&T GIS (nee NCR) WaveLAN card: An Ethernet-like radio transceiver 105 107 x25.txt 106 108 - general info on X.25 development. 107 109 x25-iface.txt
+8 -1
Documentation/networking/dns_resolver.txt
··· 61 61 create dns_resolver foo:* * /usr/sbin/dns.foo %k 62 62 63 63 64 - 65 64 ===== 66 65 USAGE 67 66 ===== ··· 101 102 102 103 If _expiry is non-NULL, the expiry time (TTL) of the result will be 103 104 returned also. 105 + 106 + 107 + =============================== 108 + READING DNS KEYS FROM USERSPACE 109 + =============================== 110 + 111 + Keys of dns_resolver type can be read from userspace using keyctl_read() or 112 + "keyctl read/print/pipe". 104 113 105 114 106 115 =========
+22 -4
MAINTAINERS
··· 1010 1010 S: Maintained 1011 1011 F: arch/arm/mach-s5p*/ 1012 1012 1013 + ARM/SAMSUNG MOBILE MACHINE SUPPORT 1014 + M: Kyungmin Park <kyungmin.park@samsung.com> 1015 + L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1016 + S: Maintained 1017 + F: arch/arm/mach-s5pv210/mach-aquila.c 1018 + F: arch/arm/mach-s5pv210/mach-goni.c 1019 + F: arch/arm/mach-exynos4/mach-universal_c210.c 1020 + F: arch/arm/mach-exynos4/mach-nuri.c 1021 + 1013 1022 ARM/SAMSUNG S5P SERIES FIMC SUPPORT 1014 1023 M: Kyungmin Park <kyungmin.park@samsung.com> 1015 1024 M: Sylwester Nawrocki <s.nawrocki@samsung.com> ··· 1476 1467 1477 1468 BONDING DRIVER 1478 1469 M: Jay Vosburgh <fubar@us.ibm.com> 1470 + M: Andy Gospodarek <andy@greyhouse.net> 1479 1471 L: netdev@vger.kernel.org 1480 1472 W: http://sourceforge.net/projects/bonding/ 1481 1473 S: Supported ··· 1701 1691 M: Andy Whitcroft <apw@canonical.com> 1702 1692 S: Supported 1703 1693 F: scripts/checkpatch.pl 1694 + 1695 + CHINESE DOCUMENTATION 1696 + M: Harry Wei <harryxiyou@gmail.com> 1697 + L: xiyoulinuxkernelgroup@googlegroups.com 1698 + L: linux-kernel@zh-kernel.org (moderated for non-subscribers) 1699 + S: Maintained 1700 + F: Documentation/zh_CN/ 1704 1701 1705 1702 CISCO VIC ETHERNET NIC DRIVER 1706 1703 M: Vasanthy Kolluri <vkolluri@cisco.com> ··· 2043 2026 F: drivers/scsi/dc395x.* 2044 2027 2045 2028 DCCP PROTOCOL 2046 - M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> 2029 + M: Gerrit Renker <gerrit@erg.abdn.ac.uk> 2047 2030 L: dccp@vger.kernel.org 2048 2031 W: http://www.linuxfoundation.org/collaborate/workgroups/networking/dccp 2049 2032 S: Maintained ··· 3529 3512 F: Documentation/hwmon/jc42 3530 3513 3531 3514 JFS FILESYSTEM 3532 - M: Dave Kleikamp <shaggy@linux.vnet.ibm.com> 3515 + M: Dave Kleikamp <shaggy@kernel.org> 3533 3516 L: jfs-discussion@lists.sourceforge.net 3534 3517 W: http://jfs.sourceforge.net/ 3535 3518 T: git git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git ··· 5181 5164 5182 5165 RAPIDIO SUBSYSTEM 5183 5166 M: Matt Porter <mporter@kernel.crashing.org> 5167 + M: Alexandre Bounine <alexandre.bounine@idt.com> 5184 5168 S: Maintained 5185 5169 F: drivers/rapidio/ 5186 5170 ··· 5284 5266 F: drivers/net/wireless/rtl818x/rtl8180/ 5285 5267 5286 5268 RTL8187 WIRELESS DRIVER 5287 - M: Herton Ronaldo Krzesinski <herton@mandriva.com.br> 5269 + M: Herton Ronaldo Krzesinski <herton@canonical.com> 5288 5270 M: Hin-Tak Leung <htl10@users.sourceforge.net> 5289 5271 M: Larry Finger <Larry.Finger@lwfinger.net> 5290 5272 L: linux-wireless@vger.kernel.org ··· 6122 6104 F: security/tomoyo/ 6123 6105 6124 6106 TOPSTAR LAPTOP EXTRAS DRIVER 6125 - M: Herton Ronaldo Krzesinski <herton@mandriva.com.br> 6107 + M: Herton Ronaldo Krzesinski <herton@canonical.com> 6126 6108 L: platform-driver-x86@vger.kernel.org 6127 6109 S: Maintained 6128 6110 F: drivers/platform/x86/topstar-laptop.c
+1 -1
Makefile
··· 1 1 VERSION = 2 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 38 4 - EXTRAVERSION = -rc6 4 + EXTRAVERSION = -rc8 5 5 NAME = Flesh-Eating Bats with Fangs 6 6 7 7 # *DOCUMENTATION*
+1
arch/alpha/Kconfig
··· 11 11 select HAVE_GENERIC_HARDIRQS 12 12 select GENERIC_IRQ_PROBE 13 13 select AUTO_IRQ_AFFINITY if SMP 14 + select GENERIC_HARDIRQS_NO_DEPRECATED 14 15 help 15 16 The Alpha is a 64-bit general-purpose processor designed and 16 17 marketed by the Digital Equipment Corporation of blessed memory,
+9 -4
arch/alpha/kernel/irq.c
··· 44 44 45 45 int irq_select_affinity(unsigned int irq) 46 46 { 47 - struct irq_desc *desc = irq_to_desc[irq]; 47 + struct irq_data *data = irq_get_irq_data(irq); 48 + struct irq_chip *chip; 48 49 static int last_cpu; 49 50 int cpu = last_cpu + 1; 50 51 51 - if (!desc || !get_irq_desc_chip(desc)->set_affinity || irq_user_affinity[irq]) 52 + if (!data) 53 + return 1; 54 + chip = irq_data_get_irq_chip(data); 55 + 56 + if (!chip->irq_set_affinity || irq_user_affinity[irq]) 52 57 return 1; 53 58 54 59 while (!cpu_possible(cpu) || ··· 61 56 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0); 62 57 last_cpu = cpu; 63 58 64 - cpumask_copy(desc->affinity, cpumask_of(cpu)); 65 - get_irq_desc_chip(desc)->set_affinity(irq, cpumask_of(cpu)); 59 + cpumask_copy(data->affinity, cpumask_of(cpu)); 60 + chip->irq_set_affinity(data, cpumask_of(cpu), false); 66 61 return 0; 67 62 } 68 63 #endif /* CONFIG_SMP */
+3 -8
arch/alpha/kernel/irq_alpha.c
··· 228 228 void __init 229 229 init_rtc_irq(void) 230 230 { 231 - struct irq_desc *desc = irq_to_desc(RTC_IRQ); 232 - 233 - if (desc) { 234 - desc->status |= IRQ_DISABLED; 235 - set_irq_chip_and_handler_name(RTC_IRQ, &no_irq_chip, 236 - handle_simple_irq, "RTC"); 237 - setup_irq(RTC_IRQ, &timer_irqaction); 238 - } 231 + set_irq_chip_and_handler_name(RTC_IRQ, &no_irq_chip, 232 + handle_simple_irq, "RTC"); 233 + setup_irq(RTC_IRQ, &timer_irqaction); 239 234 } 240 235 241 236 /* Dummy irqactions. */
+10 -8
arch/alpha/kernel/irq_i8259.c
··· 33 33 } 34 34 35 35 inline void 36 - i8259a_enable_irq(unsigned int irq) 36 + i8259a_enable_irq(struct irq_data *d) 37 37 { 38 38 spin_lock(&i8259_irq_lock); 39 - i8259_update_irq_hw(irq, cached_irq_mask &= ~(1 << irq)); 39 + i8259_update_irq_hw(d->irq, cached_irq_mask &= ~(1 << d->irq)); 40 40 spin_unlock(&i8259_irq_lock); 41 41 } 42 42 ··· 47 47 } 48 48 49 49 void 50 - i8259a_disable_irq(unsigned int irq) 50 + i8259a_disable_irq(struct irq_data *d) 51 51 { 52 52 spin_lock(&i8259_irq_lock); 53 - __i8259a_disable_irq(irq); 53 + __i8259a_disable_irq(d->irq); 54 54 spin_unlock(&i8259_irq_lock); 55 55 } 56 56 57 57 void 58 - i8259a_mask_and_ack_irq(unsigned int irq) 58 + i8259a_mask_and_ack_irq(struct irq_data *d) 59 59 { 60 + unsigned int irq = d->irq; 61 + 60 62 spin_lock(&i8259_irq_lock); 61 63 __i8259a_disable_irq(irq); 62 64 ··· 73 71 74 72 struct irq_chip i8259a_irq_type = { 75 73 .name = "XT-PIC", 76 - .unmask = i8259a_enable_irq, 77 - .mask = i8259a_disable_irq, 78 - .mask_ack = i8259a_mask_and_ack_irq, 74 + .irq_unmask = i8259a_enable_irq, 75 + .irq_mask = i8259a_disable_irq, 76 + .irq_mask_ack = i8259a_mask_and_ack_irq, 79 77 }; 80 78 81 79 void __init
+3 -5
arch/alpha/kernel/irq_impl.h
··· 31 31 32 32 extern void common_init_isa_dma(void); 33 33 34 - extern void i8259a_enable_irq(unsigned int); 35 - extern void i8259a_disable_irq(unsigned int); 36 - extern void i8259a_mask_and_ack_irq(unsigned int); 37 - extern unsigned int i8259a_startup_irq(unsigned int); 38 - extern void i8259a_end_irq(unsigned int); 34 + extern void i8259a_enable_irq(struct irq_data *d); 35 + extern void i8259a_disable_irq(struct irq_data *d); 36 + extern void i8259a_mask_and_ack_irq(struct irq_data *d); 39 37 extern struct irq_chip i8259a_irq_type; 40 38 extern void init_i8259a_irqs(void); 41 39
+10 -10
arch/alpha/kernel/irq_pyxis.c
··· 29 29 } 30 30 31 31 static inline void 32 - pyxis_enable_irq(unsigned int irq) 32 + pyxis_enable_irq(struct irq_data *d) 33 33 { 34 - pyxis_update_irq_hw(cached_irq_mask |= 1UL << (irq - 16)); 34 + pyxis_update_irq_hw(cached_irq_mask |= 1UL << (d->irq - 16)); 35 35 } 36 36 37 37 static void 38 - pyxis_disable_irq(unsigned int irq) 38 + pyxis_disable_irq(struct irq_data *d) 39 39 { 40 - pyxis_update_irq_hw(cached_irq_mask &= ~(1UL << (irq - 16))); 40 + pyxis_update_irq_hw(cached_irq_mask &= ~(1UL << (d->irq - 16))); 41 41 } 42 42 43 43 static void 44 - pyxis_mask_and_ack_irq(unsigned int irq) 44 + pyxis_mask_and_ack_irq(struct irq_data *d) 45 45 { 46 - unsigned long bit = 1UL << (irq - 16); 46 + unsigned long bit = 1UL << (d->irq - 16); 47 47 unsigned long mask = cached_irq_mask &= ~bit; 48 48 49 49 /* Disable the interrupt. */ ··· 58 58 59 59 static struct irq_chip pyxis_irq_type = { 60 60 .name = "PYXIS", 61 - .mask_ack = pyxis_mask_and_ack_irq, 62 - .mask = pyxis_disable_irq, 63 - .unmask = pyxis_enable_irq, 61 + .irq_mask_ack = pyxis_mask_and_ack_irq, 62 + .irq_mask = pyxis_disable_irq, 63 + .irq_unmask = pyxis_enable_irq, 64 64 }; 65 65 66 66 void ··· 103 103 if ((ignore_mask >> i) & 1) 104 104 continue; 105 105 set_irq_chip_and_handler(i, &pyxis_irq_type, handle_level_irq); 106 - irq_to_desc(i)->status |= IRQ_LEVEL; 106 + irq_set_status_flags(i, IRQ_LEVEL); 107 107 } 108 108 109 109 setup_irq(16+7, &isa_cascade_irqaction);
+8 -8
arch/alpha/kernel/irq_srm.c
··· 18 18 DEFINE_SPINLOCK(srm_irq_lock); 19 19 20 20 static inline void 21 - srm_enable_irq(unsigned int irq) 21 + srm_enable_irq(struct irq_data *d) 22 22 { 23 23 spin_lock(&srm_irq_lock); 24 - cserve_ena(irq - 16); 24 + cserve_ena(d->irq - 16); 25 25 spin_unlock(&srm_irq_lock); 26 26 } 27 27 28 28 static void 29 - srm_disable_irq(unsigned int irq) 29 + srm_disable_irq(struct irq_data *d) 30 30 { 31 31 spin_lock(&srm_irq_lock); 32 - cserve_dis(irq - 16); 32 + cserve_dis(d->irq - 16); 33 33 spin_unlock(&srm_irq_lock); 34 34 } 35 35 36 36 /* Handle interrupts from the SRM, assuming no additional weirdness. */ 37 37 static struct irq_chip srm_irq_type = { 38 38 .name = "SRM", 39 - .unmask = srm_enable_irq, 40 - .mask = srm_disable_irq, 41 - .mask_ack = srm_disable_irq, 39 + .irq_unmask = srm_enable_irq, 40 + .irq_mask = srm_disable_irq, 41 + .irq_mask_ack = srm_disable_irq, 42 42 }; 43 43 44 44 void __init ··· 52 52 if (i < 64 && ((ignore_mask >> i) & 1)) 53 53 continue; 54 54 set_irq_chip_and_handler(i, &srm_irq_type, handle_level_irq); 55 - irq_to_desc(i)->status |= IRQ_LEVEL; 55 + irq_set_status_flags(i, IRQ_LEVEL); 56 56 } 57 57 } 58 58
+14 -14
arch/alpha/kernel/sys_alcor.c
··· 44 44 } 45 45 46 46 static inline void 47 - alcor_enable_irq(unsigned int irq) 47 + alcor_enable_irq(struct irq_data *d) 48 48 { 49 - alcor_update_irq_hw(cached_irq_mask |= 1UL << (irq - 16)); 49 + alcor_update_irq_hw(cached_irq_mask |= 1UL << (d->irq - 16)); 50 50 } 51 51 52 52 static void 53 - alcor_disable_irq(unsigned int irq) 53 + alcor_disable_irq(struct irq_data *d) 54 54 { 55 - alcor_update_irq_hw(cached_irq_mask &= ~(1UL << (irq - 16))); 55 + alcor_update_irq_hw(cached_irq_mask &= ~(1UL << (d->irq - 16))); 56 56 } 57 57 58 58 static void 59 - alcor_mask_and_ack_irq(unsigned int irq) 59 + alcor_mask_and_ack_irq(struct irq_data *d) 60 60 { 61 - alcor_disable_irq(irq); 61 + alcor_disable_irq(d); 62 62 63 63 /* On ALCOR/XLT, need to dismiss interrupt via GRU. */ 64 - *(vuip)GRU_INT_CLEAR = 1 << (irq - 16); mb(); 64 + *(vuip)GRU_INT_CLEAR = 1 << (d->irq - 16); mb(); 65 65 *(vuip)GRU_INT_CLEAR = 0; mb(); 66 66 } 67 67 68 68 static void 69 - alcor_isa_mask_and_ack_irq(unsigned int irq) 69 + alcor_isa_mask_and_ack_irq(struct irq_data *d) 70 70 { 71 - i8259a_mask_and_ack_irq(irq); 71 + i8259a_mask_and_ack_irq(d); 72 72 73 73 /* On ALCOR/XLT, need to dismiss interrupt via GRU. */ 74 74 *(vuip)GRU_INT_CLEAR = 0x80000000; mb(); ··· 77 77 78 78 static struct irq_chip alcor_irq_type = { 79 79 .name = "ALCOR", 80 - .unmask = alcor_enable_irq, 81 - .mask = alcor_disable_irq, 82 - .mask_ack = alcor_mask_and_ack_irq, 80 + .irq_unmask = alcor_enable_irq, 81 + .irq_mask = alcor_disable_irq, 82 + .irq_mask_ack = alcor_mask_and_ack_irq, 83 83 }; 84 84 85 85 static void ··· 126 126 if (i >= 16+20 && i <= 16+30) 127 127 continue; 128 128 set_irq_chip_and_handler(i, &alcor_irq_type, handle_level_irq); 129 - irq_to_desc(i)->status |= IRQ_LEVEL; 129 + irq_set_status_flags(i, IRQ_LEVEL); 130 130 } 131 - i8259a_irq_type.ack = alcor_isa_mask_and_ack_irq; 131 + i8259a_irq_type.irq_ack = alcor_isa_mask_and_ack_irq; 132 132 133 133 init_i8259a_irqs(); 134 134 common_init_isa_dma();
+8 -8
arch/alpha/kernel/sys_cabriolet.c
··· 46 46 } 47 47 48 48 static inline void 49 - cabriolet_enable_irq(unsigned int irq) 49 + cabriolet_enable_irq(struct irq_data *d) 50 50 { 51 - cabriolet_update_irq_hw(irq, cached_irq_mask &= ~(1UL << irq)); 51 + cabriolet_update_irq_hw(d->irq, cached_irq_mask &= ~(1UL << d->irq)); 52 52 } 53 53 54 54 static void 55 - cabriolet_disable_irq(unsigned int irq) 55 + cabriolet_disable_irq(struct irq_data *d) 56 56 { 57 - cabriolet_update_irq_hw(irq, cached_irq_mask |= 1UL << irq); 57 + cabriolet_update_irq_hw(d->irq, cached_irq_mask |= 1UL << d->irq); 58 58 } 59 59 60 60 static struct irq_chip cabriolet_irq_type = { 61 61 .name = "CABRIOLET", 62 - .unmask = cabriolet_enable_irq, 63 - .mask = cabriolet_disable_irq, 64 - .mask_ack = cabriolet_disable_irq, 62 + .irq_unmask = cabriolet_enable_irq, 63 + .irq_mask = cabriolet_disable_irq, 64 + .irq_mask_ack = cabriolet_disable_irq, 65 65 }; 66 66 67 67 static void ··· 107 107 for (i = 16; i < 35; ++i) { 108 108 set_irq_chip_and_handler(i, &cabriolet_irq_type, 109 109 handle_level_irq); 110 - irq_to_desc(i)->status |= IRQ_LEVEL; 110 + irq_set_status_flags(i, IRQ_LEVEL); 111 111 } 112 112 } 113 113
+27 -25
arch/alpha/kernel/sys_dp264.c
··· 98 98 } 99 99 100 100 static void 101 - dp264_enable_irq(unsigned int irq) 101 + dp264_enable_irq(struct irq_data *d) 102 102 { 103 103 spin_lock(&dp264_irq_lock); 104 - cached_irq_mask |= 1UL << irq; 104 + cached_irq_mask |= 1UL << d->irq; 105 105 tsunami_update_irq_hw(cached_irq_mask); 106 106 spin_unlock(&dp264_irq_lock); 107 107 } 108 108 109 109 static void 110 - dp264_disable_irq(unsigned int irq) 110 + dp264_disable_irq(struct irq_data *d) 111 111 { 112 112 spin_lock(&dp264_irq_lock); 113 - cached_irq_mask &= ~(1UL << irq); 113 + cached_irq_mask &= ~(1UL << d->irq); 114 114 tsunami_update_irq_hw(cached_irq_mask); 115 115 spin_unlock(&dp264_irq_lock); 116 116 } 117 117 118 118 static void 119 - clipper_enable_irq(unsigned int irq) 119 + clipper_enable_irq(struct irq_data *d) 120 120 { 121 121 spin_lock(&dp264_irq_lock); 122 - cached_irq_mask |= 1UL << (irq - 16); 122 + cached_irq_mask |= 1UL << (d->irq - 16); 123 123 tsunami_update_irq_hw(cached_irq_mask); 124 124 spin_unlock(&dp264_irq_lock); 125 125 } 126 126 127 127 static void 128 - clipper_disable_irq(unsigned int irq) 128 + clipper_disable_irq(struct irq_data *d) 129 129 { 130 130 spin_lock(&dp264_irq_lock); 131 - cached_irq_mask &= ~(1UL << (irq - 16)); 131 + cached_irq_mask &= ~(1UL << (d->irq - 16)); 132 132 tsunami_update_irq_hw(cached_irq_mask); 133 133 spin_unlock(&dp264_irq_lock); 134 134 } ··· 149 149 } 150 150 151 151 static int 152 - dp264_set_affinity(unsigned int irq, const struct cpumask *affinity) 153 - { 152 + dp264_set_affinity(struct irq_data *d, const struct cpumask *affinity, 153 + bool force) 154 + { 154 155 spin_lock(&dp264_irq_lock); 155 - cpu_set_irq_affinity(irq, *affinity); 156 + cpu_set_irq_affinity(d->irq, *affinity); 156 157 tsunami_update_irq_hw(cached_irq_mask); 157 158 spin_unlock(&dp264_irq_lock); 158 159 ··· 161 160 } 162 161 163 162 static int 164 - clipper_set_affinity(unsigned int irq, const struct cpumask *affinity) 165 - { 163 + clipper_set_affinity(struct irq_data *d, const struct cpumask *affinity, 164 + bool force) 165 + { 166 166 spin_lock(&dp264_irq_lock); 167 - cpu_set_irq_affinity(irq - 16, *affinity); 167 + cpu_set_irq_affinity(d->irq - 16, *affinity); 168 168 tsunami_update_irq_hw(cached_irq_mask); 169 169 spin_unlock(&dp264_irq_lock); 170 170 ··· 173 171 } 174 172 175 173 static struct irq_chip dp264_irq_type = { 176 - .name = "DP264", 177 - .unmask = dp264_enable_irq, 178 - .mask = dp264_disable_irq, 179 - .mask_ack = dp264_disable_irq, 180 - .set_affinity = dp264_set_affinity, 174 + .name = "DP264", 175 + .irq_unmask = dp264_enable_irq, 176 + .irq_mask = dp264_disable_irq, 177 + .irq_mask_ack = dp264_disable_irq, 178 + .irq_set_affinity = dp264_set_affinity, 181 179 }; 182 180 183 181 static struct irq_chip clipper_irq_type = { 184 - .name = "CLIPPER", 185 - .unmask = clipper_enable_irq, 186 - .mask = clipper_disable_irq, 187 - .mask_ack = clipper_disable_irq, 188 - .set_affinity = clipper_set_affinity, 182 + .name = "CLIPPER", 183 + .irq_unmask = clipper_enable_irq, 184 + .irq_mask = clipper_disable_irq, 185 + .irq_mask_ack = clipper_disable_irq, 186 + .irq_set_affinity = clipper_set_affinity, 189 187 }; 190 188 191 189 static void ··· 270 268 { 271 269 long i; 272 270 for (i = imin; i <= imax; ++i) { 273 - irq_to_desc(i)->status |= IRQ_LEVEL; 274 271 set_irq_chip_and_handler(i, ops, handle_level_irq); 272 + irq_set_status_flags(i, IRQ_LEVEL); 275 273 } 276 274 } 277 275
+9 -9
arch/alpha/kernel/sys_eb64p.c
··· 44 44 } 45 45 46 46 static inline void 47 - eb64p_enable_irq(unsigned int irq) 47 + eb64p_enable_irq(struct irq_data *d) 48 48 { 49 - eb64p_update_irq_hw(irq, cached_irq_mask &= ~(1 << irq)); 49 + eb64p_update_irq_hw(d->irq, cached_irq_mask &= ~(1 << d->irq)); 50 50 } 51 51 52 52 static void 53 - eb64p_disable_irq(unsigned int irq) 53 + eb64p_disable_irq(struct irq_data *d) 54 54 { 55 - eb64p_update_irq_hw(irq, cached_irq_mask |= 1 << irq); 55 + eb64p_update_irq_hw(d->irq, cached_irq_mask |= 1 << d->irq); 56 56 } 57 57 58 58 static struct irq_chip eb64p_irq_type = { 59 59 .name = "EB64P", 60 - .unmask = eb64p_enable_irq, 61 - .mask = eb64p_disable_irq, 62 - .mask_ack = eb64p_disable_irq, 60 + .irq_unmask = eb64p_enable_irq, 61 + .irq_mask = eb64p_disable_irq, 62 + .irq_mask_ack = eb64p_disable_irq, 63 63 }; 64 64 65 65 static void ··· 118 118 init_i8259a_irqs(); 119 119 120 120 for (i = 16; i < 32; ++i) { 121 - irq_to_desc(i)->status |= IRQ_LEVEL; 122 121 set_irq_chip_and_handler(i, &eb64p_irq_type, handle_level_irq); 123 - } 122 + irq_set_status_flags(i, IRQ_LEVEL); 123 + } 124 124 125 125 common_init_isa_dma(); 126 126 setup_irq(16+5, &isa_cascade_irqaction);
+8 -6
arch/alpha/kernel/sys_eiger.c
··· 51 51 } 52 52 53 53 static inline void 54 - eiger_enable_irq(unsigned int irq) 54 + eiger_enable_irq(struct irq_data *d) 55 55 { 56 + unsigned int irq = d->irq; 56 57 unsigned long mask; 57 58 mask = (cached_irq_mask[irq >= 64] &= ~(1UL << (irq & 63))); 58 59 eiger_update_irq_hw(irq, mask); 59 60 } 60 61 61 62 static void 62 - eiger_disable_irq(unsigned int irq) 63 + eiger_disable_irq(struct irq_data *d) 63 64 { 65 + unsigned int irq = d->irq; 64 66 unsigned long mask; 65 67 mask = (cached_irq_mask[irq >= 64] |= 1UL << (irq & 63)); 66 68 eiger_update_irq_hw(irq, mask); ··· 70 68 71 69 static struct irq_chip eiger_irq_type = { 72 70 .name = "EIGER", 73 - .unmask = eiger_enable_irq, 74 - .mask = eiger_disable_irq, 75 - .mask_ack = eiger_disable_irq, 71 + .irq_unmask = eiger_enable_irq, 72 + .irq_mask = eiger_disable_irq, 73 + .irq_mask_ack = eiger_disable_irq, 76 74 }; 77 75 78 76 static void ··· 138 136 init_i8259a_irqs(); 139 137 140 138 for (i = 16; i < 128; ++i) { 141 - irq_to_desc(i)->status |= IRQ_LEVEL; 142 139 set_irq_chip_and_handler(i, &eiger_irq_type, handle_level_irq); 140 + irq_set_status_flags(i, IRQ_LEVEL); 143 141 } 144 142 } 145 143
+12 -12
arch/alpha/kernel/sys_jensen.c
··· 63 63 */ 64 64 65 65 static void 66 - jensen_local_enable(unsigned int irq) 66 + jensen_local_enable(struct irq_data *d) 67 67 { 68 68 /* the parport is really hw IRQ 1, silly Jensen. */ 69 - if (irq == 7) 70 - i8259a_enable_irq(1); 69 + if (d->irq == 7) 70 + i8259a_enable_irq(d); 71 71 } 72 72 73 73 static void 74 - jensen_local_disable(unsigned int irq) 74 + jensen_local_disable(struct irq_data *d) 75 75 { 76 76 /* the parport is really hw IRQ 1, silly Jensen. */ 77 - if (irq == 7) 78 - i8259a_disable_irq(1); 77 + if (d->irq == 7) 78 + i8259a_disable_irq(d); 79 79 } 80 80 81 81 static void 82 - jensen_local_mask_ack(unsigned int irq) 82 + jensen_local_mask_ack(struct irq_data *d) 83 83 { 84 84 /* the parport is really hw IRQ 1, silly Jensen. */ 85 - if (irq == 7) 86 - i8259a_mask_and_ack_irq(1); 85 + if (d->irq == 7) 86 + i8259a_mask_and_ack_irq(d); 87 87 } 88 88 89 89 static struct irq_chip jensen_local_irq_type = { 90 90 .name = "LOCAL", 91 - .unmask = jensen_local_enable, 92 - .mask = jensen_local_disable, 93 - .mask_ack = jensen_local_mask_ack, 91 + .irq_unmask = jensen_local_enable, 92 + .irq_mask = jensen_local_disable, 93 + .irq_mask_ack = jensen_local_mask_ack, 94 94 }; 95 95 96 96 static void
+19 -23
arch/alpha/kernel/sys_marvel.c
··· 104 104 } 105 105 106 106 static void 107 - io7_enable_irq(unsigned int irq) 107 + io7_enable_irq(struct irq_data *d) 108 108 { 109 109 volatile unsigned long *ctl; 110 + unsigned int irq = d->irq; 110 111 struct io7 *io7; 111 112 112 113 ctl = io7_get_irq_ctl(irq, &io7); ··· 116 115 __func__, irq); 117 116 return; 118 117 } 119 - 118 + 120 119 spin_lock(&io7->irq_lock); 121 120 *ctl |= 1UL << 24; 122 121 mb(); ··· 125 124 } 126 125 127 126 static void 128 - io7_disable_irq(unsigned int irq) 127 + io7_disable_irq(struct irq_data *d) 129 128 { 130 129 volatile unsigned long *ctl; 130 + unsigned int irq = d->irq; 131 131 struct io7 *io7; 132 132 133 133 ctl = io7_get_irq_ctl(irq, &io7); ··· 137 135 __func__, irq); 138 136 return; 139 137 } 140 - 138 + 141 139 spin_lock(&io7->irq_lock); 142 140 *ctl &= ~(1UL << 24); 143 141 mb(); ··· 146 144 } 147 145 148 146 static void 149 - marvel_irq_noop(unsigned int irq) 150 - { 151 - return; 152 - } 153 - 154 - static unsigned int 155 - marvel_irq_noop_return(unsigned int irq) 156 - { 157 - return 0; 147 + marvel_irq_noop(struct irq_data *d) 148 + { 149 + return; 158 150 } 159 151 160 152 static struct irq_chip marvel_legacy_irq_type = { 161 153 .name = "LEGACY", 162 - .mask = marvel_irq_noop, 163 - .unmask = marvel_irq_noop, 154 + .irq_mask = marvel_irq_noop, 155 + .irq_unmask = marvel_irq_noop, 164 156 }; 165 157 166 158 static struct irq_chip io7_lsi_irq_type = { 167 159 .name = "LSI", 168 - .unmask = io7_enable_irq, 169 - .mask = io7_disable_irq, 170 - .mask_ack = io7_disable_irq, 160 + .irq_unmask = io7_enable_irq, 161 + .irq_mask = io7_disable_irq, 162 + .irq_mask_ack = io7_disable_irq, 171 163 }; 172 164 173 165 static struct irq_chip io7_msi_irq_type = { 174 166 .name = "MSI", 175 - .unmask = io7_enable_irq, 176 - .mask = io7_disable_irq, 177 - .ack = marvel_irq_noop, 167 + .irq_unmask = io7_enable_irq, 168 + .irq_mask = io7_disable_irq, 169 + .irq_ack = marvel_irq_noop, 178 170 }; 179 171 180 172 static void ··· 276 280 277 281 /* Set up the lsi irqs. */ 278 282 for (i = 0; i < 128; ++i) { 279 - irq_to_desc(base + i)->status |= IRQ_LEVEL; 280 283 set_irq_chip_and_handler(base + i, lsi_ops, handle_level_irq); 284 + irq_set_status_flags(i, IRQ_LEVEL); 281 285 } 282 286 283 287 /* Disable the implemented irqs in hardware. */ ··· 290 294 291 295 /* Set up the msi irqs. */ 292 296 for (i = 128; i < (128 + 512); ++i) { 293 - irq_to_desc(base + i)->status |= IRQ_LEVEL; 294 297 set_irq_chip_and_handler(base + i, msi_ops, handle_level_irq); 298 + irq_set_status_flags(i, IRQ_LEVEL); 295 299 } 296 300 297 301 for (i = 0; i < 16; ++i)
+8 -8
arch/alpha/kernel/sys_mikasa.c
··· 43 43 } 44 44 45 45 static inline void 46 - mikasa_enable_irq(unsigned int irq) 46 + mikasa_enable_irq(struct irq_data *d) 47 47 { 48 - mikasa_update_irq_hw(cached_irq_mask |= 1 << (irq - 16)); 48 + mikasa_update_irq_hw(cached_irq_mask |= 1 << (d->irq - 16)); 49 49 } 50 50 51 51 static void 52 - mikasa_disable_irq(unsigned int irq) 52 + mikasa_disable_irq(struct irq_data *d) 53 53 { 54 - mikasa_update_irq_hw(cached_irq_mask &= ~(1 << (irq - 16))); 54 + mikasa_update_irq_hw(cached_irq_mask &= ~(1 << (d->irq - 16))); 55 55 } 56 56 57 57 static struct irq_chip mikasa_irq_type = { 58 58 .name = "MIKASA", 59 - .unmask = mikasa_enable_irq, 60 - .mask = mikasa_disable_irq, 61 - .mask_ack = mikasa_disable_irq, 59 + .irq_unmask = mikasa_enable_irq, 60 + .irq_mask = mikasa_disable_irq, 61 + .irq_mask_ack = mikasa_disable_irq, 62 62 }; 63 63 64 64 static void ··· 98 98 mikasa_update_irq_hw(0); 99 99 100 100 for (i = 16; i < 32; ++i) { 101 - irq_to_desc(i)->status |= IRQ_LEVEL; 102 101 set_irq_chip_and_handler(i, &mikasa_irq_type, handle_level_irq); 102 + irq_set_status_flags(i, IRQ_LEVEL); 103 103 } 104 104 105 105 init_i8259a_irqs();
+8 -8
arch/alpha/kernel/sys_noritake.c
··· 48 48 } 49 49 50 50 static void 51 - noritake_enable_irq(unsigned int irq) 51 + noritake_enable_irq(struct irq_data *d) 52 52 { 53 - noritake_update_irq_hw(irq, cached_irq_mask |= 1 << (irq - 16)); 53 + noritake_update_irq_hw(d->irq, cached_irq_mask |= 1 << (d->irq - 16)); 54 54 } 55 55 56 56 static void 57 - noritake_disable_irq(unsigned int irq) 57 + noritake_disable_irq(struct irq_data *d) 58 58 { 59 - noritake_update_irq_hw(irq, cached_irq_mask &= ~(1 << (irq - 16))); 59 + noritake_update_irq_hw(d->irq, cached_irq_mask &= ~(1 << (d->irq - 16))); 60 60 } 61 61 62 62 static struct irq_chip noritake_irq_type = { 63 63 .name = "NORITAKE", 64 - .unmask = noritake_enable_irq, 65 - .mask = noritake_disable_irq, 66 - .mask_ack = noritake_disable_irq, 64 + .irq_unmask = noritake_enable_irq, 65 + .irq_mask = noritake_disable_irq, 66 + .irq_mask_ack = noritake_disable_irq, 67 67 }; 68 68 69 69 static void ··· 127 127 outw(0, 0x54c); 128 128 129 129 for (i = 16; i < 48; ++i) { 130 - irq_to_desc(i)->status |= IRQ_LEVEL; 131 130 set_irq_chip_and_handler(i, &noritake_irq_type, handle_level_irq); 131 + irq_set_status_flags(i, IRQ_LEVEL); 132 132 } 133 133 134 134 init_i8259a_irqs();
+10 -7
arch/alpha/kernel/sys_rawhide.c
··· 56 56 (((h) < MCPCIA_MAX_HOSES) && (cached_irq_masks[(h)] != 0)) 57 57 58 58 static inline void 59 - rawhide_enable_irq(unsigned int irq) 59 + rawhide_enable_irq(struct irq_data *d) 60 60 { 61 61 unsigned int mask, hose; 62 + unsigned int irq = d->irq; 62 63 63 64 irq -= 16; 64 65 hose = irq / 24; ··· 77 76 } 78 77 79 78 static void 80 - rawhide_disable_irq(unsigned int irq) 79 + rawhide_disable_irq(struct irq_data *d) 81 80 { 82 81 unsigned int mask, hose; 82 + unsigned int irq = d->irq; 83 83 84 84 irq -= 16; 85 85 hose = irq / 24; ··· 98 96 } 99 97 100 98 static void 101 - rawhide_mask_and_ack_irq(unsigned int irq) 99 + rawhide_mask_and_ack_irq(struct irq_data *d) 102 100 { 103 101 unsigned int mask, mask1, hose; 102 + unsigned int irq = d->irq; 104 103 105 104 irq -= 16; 106 105 hose = irq / 24; ··· 126 123 127 124 static struct irq_chip rawhide_irq_type = { 128 125 .name = "RAWHIDE", 129 - .unmask = rawhide_enable_irq, 130 - .mask = rawhide_disable_irq, 131 - .mask_ack = rawhide_mask_and_ack_irq, 126 + .irq_unmask = rawhide_enable_irq, 127 + .irq_mask = rawhide_disable_irq, 128 + .irq_mask_ack = rawhide_mask_and_ack_irq, 132 129 }; 133 130 134 131 static void ··· 180 177 } 181 178 182 179 for (i = 16; i < 128; ++i) { 183 - irq_to_desc(i)->status |= IRQ_LEVEL; 184 180 set_irq_chip_and_handler(i, &rawhide_irq_type, handle_level_irq); 181 + irq_set_status_flags(i, IRQ_LEVEL); 185 182 } 186 183 187 184 init_i8259a_irqs();
+8 -8
arch/alpha/kernel/sys_rx164.c
··· 47 47 } 48 48 49 49 static inline void 50 - rx164_enable_irq(unsigned int irq) 50 + rx164_enable_irq(struct irq_data *d) 51 51 { 52 - rx164_update_irq_hw(cached_irq_mask |= 1UL << (irq - 16)); 52 + rx164_update_irq_hw(cached_irq_mask |= 1UL << (d->irq - 16)); 53 53 } 54 54 55 55 static void 56 - rx164_disable_irq(unsigned int irq) 56 + rx164_disable_irq(struct irq_data *d) 57 57 { 58 - rx164_update_irq_hw(cached_irq_mask &= ~(1UL << (irq - 16))); 58 + rx164_update_irq_hw(cached_irq_mask &= ~(1UL << (d->irq - 16))); 59 59 } 60 60 61 61 static struct irq_chip rx164_irq_type = { 62 62 .name = "RX164", 63 - .unmask = rx164_enable_irq, 64 - .mask = rx164_disable_irq, 65 - .mask_ack = rx164_disable_irq, 63 + .irq_unmask = rx164_enable_irq, 64 + .irq_mask = rx164_disable_irq, 65 + .irq_mask_ack = rx164_disable_irq, 66 66 }; 67 67 68 68 static void ··· 99 99 100 100 rx164_update_irq_hw(0); 101 101 for (i = 16; i < 40; ++i) { 102 - irq_to_desc(i)->status |= IRQ_LEVEL; 103 102 set_irq_chip_and_handler(i, &rx164_irq_type, handle_level_irq); 103 + irq_set_status_flags(i, IRQ_LEVEL); 104 104 } 105 105 106 106 init_i8259a_irqs();
+10 -10
arch/alpha/kernel/sys_sable.c
··· 443 443 /* GENERIC irq routines */ 444 444 445 445 static inline void 446 - sable_lynx_enable_irq(unsigned int irq) 446 + sable_lynx_enable_irq(struct irq_data *d) 447 447 { 448 448 unsigned long bit, mask; 449 449 450 - bit = sable_lynx_irq_swizzle->irq_to_mask[irq]; 450 + bit = sable_lynx_irq_swizzle->irq_to_mask[d->irq]; 451 451 spin_lock(&sable_lynx_irq_lock); 452 452 mask = sable_lynx_irq_swizzle->shadow_mask &= ~(1UL << bit); 453 453 sable_lynx_irq_swizzle->update_irq_hw(bit, mask); ··· 459 459 } 460 460 461 461 static void 462 - sable_lynx_disable_irq(unsigned int irq) 462 + sable_lynx_disable_irq(struct irq_data *d) 463 463 { 464 464 unsigned long bit, mask; 465 465 466 - bit = sable_lynx_irq_swizzle->irq_to_mask[irq]; 466 + bit = sable_lynx_irq_swizzle->irq_to_mask[d->irq]; 467 467 spin_lock(&sable_lynx_irq_lock); 468 468 mask = sable_lynx_irq_swizzle->shadow_mask |= 1UL << bit; 469 469 sable_lynx_irq_swizzle->update_irq_hw(bit, mask); ··· 475 475 } 476 476 477 477 static void 478 - sable_lynx_mask_and_ack_irq(unsigned int irq) 478 + sable_lynx_mask_and_ack_irq(struct irq_data *d) 479 479 { 480 480 unsigned long bit, mask; 481 481 482 - bit = sable_lynx_irq_swizzle->irq_to_mask[irq]; 482 + bit = sable_lynx_irq_swizzle->irq_to_mask[d->irq]; 483 483 spin_lock(&sable_lynx_irq_lock); 484 484 mask = sable_lynx_irq_swizzle->shadow_mask |= 1UL << bit; 485 485 sable_lynx_irq_swizzle->update_irq_hw(bit, mask); ··· 489 489 490 490 static struct irq_chip sable_lynx_irq_type = { 491 491 .name = "SABLE/LYNX", 492 - .unmask = sable_lynx_enable_irq, 493 - .mask = sable_lynx_disable_irq, 494 - .mask_ack = sable_lynx_mask_and_ack_irq, 492 + .irq_unmask = sable_lynx_enable_irq, 493 + .irq_mask = sable_lynx_disable_irq, 494 + .irq_mask_ack = sable_lynx_mask_and_ack_irq, 495 495 }; 496 496 497 497 static void ··· 518 518 long i; 519 519 520 520 for (i = 0; i < nr_of_irqs; ++i) { 521 - irq_to_desc(i)->status |= IRQ_LEVEL; 522 521 set_irq_chip_and_handler(i, &sable_lynx_irq_type, 523 522 handle_level_irq); 523 + irq_set_status_flags(i, IRQ_LEVEL); 524 524 } 525 525 526 526 common_init_isa_dma();
+8 -6
arch/alpha/kernel/sys_takara.c
··· 45 45 } 46 46 47 47 static inline void 48 - takara_enable_irq(unsigned int irq) 48 + takara_enable_irq(struct irq_data *d) 49 49 { 50 + unsigned int irq = d->irq; 50 51 unsigned long mask; 51 52 mask = (cached_irq_mask[irq >= 64] &= ~(1UL << (irq & 63))); 52 53 takara_update_irq_hw(irq, mask); 53 54 } 54 55 55 56 static void 56 - takara_disable_irq(unsigned int irq) 57 + takara_disable_irq(struct irq_data *d) 57 58 { 59 + unsigned int irq = d->irq; 58 60 unsigned long mask; 59 61 mask = (cached_irq_mask[irq >= 64] |= 1UL << (irq & 63)); 60 62 takara_update_irq_hw(irq, mask); ··· 64 62 65 63 static struct irq_chip takara_irq_type = { 66 64 .name = "TAKARA", 67 - .unmask = takara_enable_irq, 68 - .mask = takara_disable_irq, 69 - .mask_ack = takara_disable_irq, 65 + .irq_unmask = takara_enable_irq, 66 + .irq_mask = takara_disable_irq, 67 + .irq_mask_ack = takara_disable_irq, 70 68 }; 71 69 72 70 static void ··· 138 136 takara_update_irq_hw(i, -1); 139 137 140 138 for (i = 16; i < 128; ++i) { 141 - irq_to_desc(i)->status |= IRQ_LEVEL; 142 139 set_irq_chip_and_handler(i, &takara_irq_type, handle_level_irq); 140 + irq_set_status_flags(i, IRQ_LEVEL); 143 141 } 144 142 145 143 common_init_isa_dma();
+12 -9
arch/alpha/kernel/sys_titan.c
··· 112 112 } 113 113 114 114 static inline void 115 - titan_enable_irq(unsigned int irq) 115 + titan_enable_irq(struct irq_data *d) 116 116 { 117 + unsigned int irq = d->irq; 117 118 spin_lock(&titan_irq_lock); 118 119 titan_cached_irq_mask |= 1UL << (irq - 16); 119 120 titan_update_irq_hw(titan_cached_irq_mask); ··· 122 121 } 123 122 124 123 static inline void 125 - titan_disable_irq(unsigned int irq) 124 + titan_disable_irq(struct irq_data *d) 126 125 { 126 + unsigned int irq = d->irq; 127 127 spin_lock(&titan_irq_lock); 128 128 titan_cached_irq_mask &= ~(1UL << (irq - 16)); 129 129 titan_update_irq_hw(titan_cached_irq_mask); ··· 146 144 } 147 145 148 146 static int 149 - titan_set_irq_affinity(unsigned int irq, const struct cpumask *affinity) 147 + titan_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity, 148 + bool force) 150 149 { 151 150 spin_lock(&titan_irq_lock); 152 151 titan_cpu_set_irq_affinity(irq - 16, *affinity); ··· 178 175 { 179 176 long i; 180 177 for (i = imin; i <= imax; ++i) { 181 - irq_to_desc(i)->status |= IRQ_LEVEL; 182 178 set_irq_chip_and_handler(i, ops, handle_level_irq); 179 + irq_set_status_flags(i, IRQ_LEVEL); 183 180 } 184 181 } 185 182 186 183 static struct irq_chip titan_irq_type = { 187 - .name = "TITAN", 188 - .unmask = titan_enable_irq, 189 - .mask = titan_disable_irq, 190 - .mask_ack = titan_disable_irq, 191 - .set_affinity = titan_set_irq_affinity, 184 + .name = "TITAN", 185 + .irq_unmask = titan_enable_irq, 186 + .irq_mask = titan_disable_irq, 187 + .irq_mask_ack = titan_disable_irq, 188 + .irq_set_affinity = titan_set_irq_affinity, 192 189 }; 193 190 194 191 static irqreturn_t
+19 -13
arch/alpha/kernel/sys_wildfire.c
··· 104 104 } 105 105 106 106 static void 107 - wildfire_enable_irq(unsigned int irq) 107 + wildfire_enable_irq(struct irq_data *d) 108 108 { 109 + unsigned int irq = d->irq; 110 + 109 111 if (irq < 16) 110 - i8259a_enable_irq(irq); 112 + i8259a_enable_irq(d); 111 113 112 114 spin_lock(&wildfire_irq_lock); 113 115 set_bit(irq, &cached_irq_mask); ··· 118 116 } 119 117 120 118 static void 121 - wildfire_disable_irq(unsigned int irq) 119 + wildfire_disable_irq(struct irq_data *d) 122 120 { 121 + unsigned int irq = d->irq; 122 + 123 123 if (irq < 16) 124 - i8259a_disable_irq(irq); 124 + i8259a_disable_irq(d); 125 125 126 126 spin_lock(&wildfire_irq_lock); 127 127 clear_bit(irq, &cached_irq_mask); ··· 132 128 } 133 129 134 130 static void 135 - wildfire_mask_and_ack_irq(unsigned int irq) 131 + wildfire_mask_and_ack_irq(struct irq_data *d) 136 132 { 133 + unsigned int irq = d->irq; 134 + 137 135 if (irq < 16) 138 - i8259a_mask_and_ack_irq(irq); 136 + i8259a_mask_and_ack_irq(d); 139 137 140 138 spin_lock(&wildfire_irq_lock); 141 139 clear_bit(irq, &cached_irq_mask); ··· 147 141 148 142 static struct irq_chip wildfire_irq_type = { 149 143 .name = "WILDFIRE", 150 - .unmask = wildfire_enable_irq, 151 - .mask = wildfire_disable_irq, 152 - .mask_ack = wildfire_mask_and_ack_irq, 144 + .irq_unmask = wildfire_enable_irq, 145 + .irq_mask = wildfire_disable_irq, 146 + .irq_mask_ack = wildfire_mask_and_ack_irq, 153 147 }; 154 148 155 149 static void __init ··· 183 177 for (i = 0; i < 16; ++i) { 184 178 if (i == 2) 185 179 continue; 186 - irq_to_desc(i+irq_bias)->status |= IRQ_LEVEL; 187 180 set_irq_chip_and_handler(i+irq_bias, &wildfire_irq_type, 188 181 handle_level_irq); 182 + irq_set_status_flags(i + irq_bias, IRQ_LEVEL); 189 183 } 190 184 191 - irq_to_desc(36+irq_bias)->status |= IRQ_LEVEL; 192 185 set_irq_chip_and_handler(36+irq_bias, &wildfire_irq_type, 193 186 handle_level_irq); 187 + irq_set_status_flags(36 + irq_bias, IRQ_LEVEL); 194 188 for (i = 40; i < 64; ++i) { 195 - irq_to_desc(i+irq_bias)->status |= IRQ_LEVEL; 196 189 set_irq_chip_and_handler(i+irq_bias, &wildfire_irq_type, 197 190 handle_level_irq); 191 + irq_set_status_flags(i + irq_bias, IRQ_LEVEL); 198 192 } 199 193 200 - setup_irq(32+irq_bias, &isa_enable); 194 + setup_irq(32+irq_bias, &isa_enable); 201 195 } 202 196 203 197 static void __init
+2
arch/arm/common/Kconfig
··· 6 6 7 7 config ARM_VIC_NR 8 8 int 9 + default 4 if ARCH_S5PV210 10 + default 3 if ARCH_S5P6442 || ARCH_S5PC100 9 11 default 2 10 12 depends on ARM_VIC 11 13 help
-4
arch/arm/include/asm/mach/arch.h
··· 15 15 struct sys_timer; 16 16 17 17 struct machine_desc { 18 - /* 19 - * Note! The first two elements are used 20 - * by assembler code in head.S, head-common.S 21 - */ 22 18 unsigned int nr; /* architecture number */ 23 19 const char *name; /* architecture name */ 24 20 unsigned long boot_params; /* tagged list */
+2
arch/arm/include/asm/pgalloc.h
··· 10 10 #ifndef _ASMARM_PGALLOC_H 11 11 #define _ASMARM_PGALLOC_H 12 12 13 + #include <linux/pagemap.h> 14 + 13 15 #include <asm/domain.h> 14 16 #include <asm/pgtable-hwdef.h> 15 17 #include <asm/processor.h>
+23 -3
arch/arm/kernel/hw_breakpoint.c
··· 836 836 /* 837 837 * One-time initialisation. 838 838 */ 839 - static void reset_ctrl_regs(void *unused) 839 + static void reset_ctrl_regs(void *info) 840 840 { 841 - int i; 841 + int i, cpu = smp_processor_id(); 842 + u32 dbg_power; 843 + cpumask_t *cpumask = info; 842 844 843 845 /* 844 846 * v7 debug contains save and restore registers so that debug state ··· 851 849 * later on. 852 850 */ 853 851 if (debug_arch >= ARM_DEBUG_ARCH_V7_ECP14) { 852 + /* 853 + * Ensure sticky power-down is clear (i.e. debug logic is 854 + * powered up). 855 + */ 856 + asm volatile("mrc p14, 0, %0, c1, c5, 4" : "=r" (dbg_power)); 857 + if ((dbg_power & 0x1) == 0) { 858 + pr_warning("CPU %d debug is powered down!\n", cpu); 859 + cpumask_or(cpumask, cpumask, cpumask_of(cpu)); 860 + return; 861 + } 862 + 854 863 /* 855 864 * Unconditionally clear the lock by writing a value 856 865 * other than 0xC5ACCE55 to the access register. ··· 900 887 static int __init arch_hw_breakpoint_init(void) 901 888 { 902 889 u32 dscr; 890 + cpumask_t cpumask = { CPU_BITS_NONE }; 903 891 904 892 debug_arch = get_debug_arch(); 905 893 ··· 925 911 * Reset the breakpoint resources. We assume that a halting 926 912 * debugger will leave the world in a nice state for us. 927 913 */ 928 - on_each_cpu(reset_ctrl_regs, NULL, 1); 914 + on_each_cpu(reset_ctrl_regs, &cpumask, 1); 915 + if (!cpumask_empty(&cpumask)) { 916 + core_num_brps = 0; 917 + core_num_reserved_brps = 0; 918 + core_num_wrps = 0; 919 + return 0; 920 + } 929 921 930 922 ARM_DBG_READ(c1, 0, dscr); 931 923 if (dscr & ARM_DSCR_HDBGEN) {
+3 -3
arch/arm/kernel/ptrace.c
··· 996 996 while (!(arch_ctrl.len & 0x1)) 997 997 arch_ctrl.len >>= 1; 998 998 999 - if (idx & 0x1) 1000 - reg = encode_ctrl_reg(arch_ctrl); 1001 - else 999 + if (num & 0x1) 1002 1000 reg = bp->attr.bp_addr; 1001 + else 1002 + reg = encode_ctrl_reg(arch_ctrl); 1003 1003 } 1004 1004 1005 1005 put:
+1 -1
arch/arm/mach-davinci/cpufreq.c
··· 132 132 return ret; 133 133 } 134 134 135 - static int __init davinci_cpu_init(struct cpufreq_policy *policy) 135 + static int davinci_cpu_init(struct cpufreq_policy *policy) 136 136 { 137 137 int result = 0; 138 138 struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data;
+7
arch/arm/mach-davinci/devices-da8xx.c
··· 480 480 .resource = da850_mcasp_resources, 481 481 }; 482 482 483 + struct platform_device davinci_pcm_device = { 484 + .name = "davinci-pcm-audio", 485 + .id = -1, 486 + }; 487 + 483 488 void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata) 484 489 { 490 + platform_device_register(&davinci_pcm_device); 491 + 485 492 /* DA830/OMAP-L137 has 3 instances of McASP */ 486 493 if (cpu_is_davinci_da830() && id == 1) { 487 494 da830_mcasp1_device.dev.platform_data = pdata;
+9 -9
arch/arm/mach-davinci/gpio-tnetv107x.c
··· 58 58 59 59 spin_lock_irqsave(&ctlr->lock, flags); 60 60 61 - gpio_reg_set_bit(&regs->enable, gpio); 61 + gpio_reg_set_bit(regs->enable, gpio); 62 62 63 63 spin_unlock_irqrestore(&ctlr->lock, flags); 64 64 ··· 74 74 75 75 spin_lock_irqsave(&ctlr->lock, flags); 76 76 77 - gpio_reg_clear_bit(&regs->enable, gpio); 77 + gpio_reg_clear_bit(regs->enable, gpio); 78 78 79 79 spin_unlock_irqrestore(&ctlr->lock, flags); 80 80 } ··· 88 88 89 89 spin_lock_irqsave(&ctlr->lock, flags); 90 90 91 - gpio_reg_set_bit(&regs->direction, gpio); 91 + gpio_reg_set_bit(regs->direction, gpio); 92 92 93 93 spin_unlock_irqrestore(&ctlr->lock, flags); 94 94 ··· 106 106 spin_lock_irqsave(&ctlr->lock, flags); 107 107 108 108 if (value) 109 - gpio_reg_set_bit(&regs->data_out, gpio); 109 + gpio_reg_set_bit(regs->data_out, gpio); 110 110 else 111 - gpio_reg_clear_bit(&regs->data_out, gpio); 111 + gpio_reg_clear_bit(regs->data_out, gpio); 112 112 113 - gpio_reg_clear_bit(&regs->direction, gpio); 113 + gpio_reg_clear_bit(regs->direction, gpio); 114 114 115 115 spin_unlock_irqrestore(&ctlr->lock, flags); 116 116 ··· 124 124 unsigned gpio = chip->base + offset; 125 125 int ret; 126 126 127 - ret = gpio_reg_get_bit(&regs->data_in, gpio); 127 + ret = gpio_reg_get_bit(regs->data_in, gpio); 128 128 129 129 return ret ? 1 : 0; 130 130 } ··· 140 140 spin_lock_irqsave(&ctlr->lock, flags); 141 141 142 142 if (value) 143 - gpio_reg_set_bit(&regs->data_out, gpio); 143 + gpio_reg_set_bit(regs->data_out, gpio); 144 144 else 145 - gpio_reg_clear_bit(&regs->data_out, gpio); 145 + gpio_reg_clear_bit(regs->data_out, gpio); 146 146 147 147 spin_unlock_irqrestore(&ctlr->lock, flags); 148 148 }
+2
arch/arm/mach-davinci/include/mach/clkdev.h
··· 1 1 #ifndef __MACH_CLKDEV_H 2 2 #define __MACH_CLKDEV_H 3 3 4 + struct clk; 5 + 4 6 static inline int __clk_get(struct clk *clk) 5 7 { 6 8 return 1;
+1 -1
arch/arm/mach-omap2/clkt_dpll.c
··· 77 77 dd = clk->dpll_data; 78 78 79 79 /* DPLL divider must result in a valid jitter correction val */ 80 - fint = clk->parent->rate / (n + 1); 80 + fint = clk->parent->rate / n; 81 81 if (fint < DPLL_FINT_BAND1_MIN) { 82 82 83 83 pr_debug("rejecting n=%d due to Fint failure, "
+7 -5
arch/arm/mach-omap2/mailbox.c
··· 193 193 omap_mbox_type_t irq) 194 194 { 195 195 struct omap_mbox2_priv *p = mbox->priv; 196 - u32 l, bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; 197 - l = mbox_read_reg(p->irqdisable); 198 - l &= ~bit; 199 - mbox_write_reg(l, p->irqdisable); 196 + u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; 197 + 198 + if (!cpu_is_omap44xx()) 199 + bit = mbox_read_reg(p->irqdisable) & ~bit; 200 + 201 + mbox_write_reg(bit, p->irqdisable); 200 202 } 201 203 202 204 static void omap2_mbox_ack_irq(struct omap_mbox *mbox, ··· 336 334 .priv = &omap2_mbox_iva_priv, 337 335 }; 338 336 339 - struct omap_mbox *omap2_mboxes[] = { &mbox_iva_info, &mbox_dsp_info, NULL }; 337 + struct omap_mbox *omap2_mboxes[] = { &mbox_dsp_info, &mbox_iva_info, NULL }; 340 338 #endif 341 339 342 340 #if defined(CONFIG_ARCH_OMAP4)
+1 -1
arch/arm/mach-omap2/mux.c
··· 605 605 list_for_each_entry(e, &partition->muxmodes, node) { 606 606 struct omap_mux *m = &e->mux; 607 607 608 - (void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir, 608 + (void)debugfs_create_file(m->muxnames[0], S_IWUSR, mux_dbg_dir, 609 609 m, &omap_mux_dbg_signal_fops); 610 610 } 611 611 }
+4 -4
arch/arm/mach-omap2/pm-debug.c
··· 637 637 638 638 } 639 639 640 - (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d, 640 + (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d, 641 641 &enable_off_mode, &pm_dbg_option_fops); 642 - (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d, 642 + (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUSR, d, 643 643 &sleep_while_idle, &pm_dbg_option_fops); 644 - (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d, 644 + (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d, 645 645 &wakeup_timer_seconds, &pm_dbg_option_fops); 646 646 (void) debugfs_create_file("wakeup_timer_milliseconds", 647 - S_IRUGO | S_IWUGO, d, &wakeup_timer_milliseconds, 647 + S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds, 648 648 &pm_dbg_option_fops); 649 649 pm_dbg_init_done = 1; 650 650
+2 -2
arch/arm/mach-omap2/prcm_mpu44xx.h
··· 38 38 #define OMAP4430_PRCM_MPU_CPU1_INST 0x0800 39 39 40 40 /* PRCM_MPU clockdomain register offsets (from instance start) */ 41 - #define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0000 42 - #define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0000 41 + #define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0018 42 + #define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0018 43 43 44 44 45 45 /*
+17 -20
arch/arm/mach-omap2/smartreflex.c
··· 282 282 dev_err(&sr_info->pdev->dev, "%s: ERROR in registering" 283 283 "interrupt handler. Smartreflex will" 284 284 "not function as desired\n", __func__); 285 + kfree(name); 285 286 kfree(sr_info); 286 287 return ret; 287 288 } ··· 880 879 ret = sr_late_init(sr_info); 881 880 if (ret) { 882 881 pr_warning("%s: Error in SR late init\n", __func__); 883 - return ret; 882 + goto err_release_region; 884 883 } 885 884 } 886 885 ··· 891 890 * not try to create rest of the debugfs entries. 892 891 */ 893 892 vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); 894 - if (!vdd_dbg_dir) 895 - return -EINVAL; 893 + if (!vdd_dbg_dir) { 894 + ret = -EINVAL; 895 + goto err_release_region; 896 + } 896 897 897 898 dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); 898 899 if (IS_ERR(dbg_dir)) { 899 900 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", 900 901 __func__); 901 - return PTR_ERR(dbg_dir); 902 + ret = PTR_ERR(dbg_dir); 903 + goto err_release_region; 902 904 } 903 905 904 - (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir, 906 + (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir, 905 907 (void *)sr_info, &pm_sr_fops); 906 908 (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir, 907 909 &sr_info->err_weight); ··· 917 913 if (IS_ERR(nvalue_dir)) { 918 914 dev_err(&pdev->dev, "%s: Unable to create debugfs directory" 919 915 "for n-values\n", __func__); 920 - return PTR_ERR(nvalue_dir); 916 + ret = PTR_ERR(nvalue_dir); 917 + goto err_release_region; 921 918 } 922 919 923 920 omap_voltage_get_volttable(sr_info->voltdm, &volt_data); ··· 927 922 " corresponding vdd vdd_%s. Cannot create debugfs" 928 923 "entries for n-values\n", 929 924 __func__, sr_info->voltdm->name); 930 - return -ENODATA; 925 + ret = -ENODATA; 926 + goto err_release_region; 931 927 } 932 928 933 929 for (i = 0; i < sr_info->nvalue_count; i++) { 934 - char *name; 935 - char volt_name[32]; 930 + char name[NVALUE_NAME_LEN + 1]; 936 931 937 - name = kzalloc(NVALUE_NAME_LEN + 1, GFP_KERNEL); 938 - if (!name) { 939 - dev_err(&pdev->dev, "%s: Unable to allocate memory" 940 - " for n-value directory name\n", __func__); 941 - return -ENOMEM; 942 - } 943 - 944 - strcpy(name, "volt_"); 945 - sprintf(volt_name, "%d", volt_data[i].volt_nominal); 946 - strcat(name, volt_name); 947 - (void) debugfs_create_x32(name, S_IRUGO | S_IWUGO, nvalue_dir, 932 + snprintf(name, sizeof(name), "volt_%d", 933 + volt_data[i].volt_nominal); 934 + (void) debugfs_create_x32(name, S_IRUGO | S_IWUSR, nvalue_dir, 948 935 &(sr_info->nvalue_table[i].nvalue)); 949 936 } 950 937
+13
arch/arm/mach-omap2/timer-gp.c
··· 39 39 #include <asm/mach/time.h> 40 40 #include <plat/dmtimer.h> 41 41 #include <asm/localtimer.h> 42 + #include <asm/sched_clock.h> 42 43 43 44 #include "timer-gp.h" 44 45 ··· 191 190 /* 192 191 * clocksource 193 192 */ 193 + static DEFINE_CLOCK_DATA(cd); 194 194 static struct omap_dm_timer *gpt_clocksource; 195 195 static cycle_t clocksource_read_cycles(struct clocksource *cs) 196 196 { ··· 205 203 .mask = CLOCKSOURCE_MASK(32), 206 204 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 207 205 }; 206 + 207 + static void notrace dmtimer_update_sched_clock(void) 208 + { 209 + u32 cyc; 210 + 211 + cyc = omap_dm_timer_read_counter(gpt_clocksource); 212 + 213 + update_sched_clock(&cd, cyc, (u32)~0); 214 + } 208 215 209 216 /* Setup free-running counter for clocksource */ 210 217 static void __init omap2_gp_clocksource_init(void) ··· 234 223 tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); 235 224 236 225 omap_dm_timer_set_load_start(gpt, 1, 0); 226 + 227 + init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate); 237 228 238 229 if (clocksource_register_hz(&clocksource_gpt, tick_rate)) 239 230 printk(err2, clocksource_gpt.name);
+1
arch/arm/mach-pxa/pxa25x.c
··· 347 347 &pxa25x_device_assp, 348 348 &pxa25x_device_pwm0, 349 349 &pxa25x_device_pwm1, 350 + &pxa_device_asoc_platform, 350 351 }; 351 352 352 353 static struct sys_device pxa25x_sysdev[] = {
-2
arch/arm/mach-pxa/tosa-bt.c
··· 81 81 goto err_rfk_alloc; 82 82 } 83 83 84 - rfkill_set_led_trigger_name(rfk, "tosa-bt"); 85 - 86 84 rc = rfkill_register(rfk); 87 85 if (rc) 88 86 goto err_rfkill;
+6
arch/arm/mach-pxa/tosa.c
··· 875 875 .dev.platform_data = &sharpsl_rom_data, 876 876 }; 877 877 878 + static struct platform_device wm9712_device = { 879 + .name = "wm9712-codec", 880 + .id = -1, 881 + }; 882 + 878 883 static struct platform_device *devices[] __initdata = { 879 884 &tosascoop_device, 880 885 &tosascoop_jc_device, ··· 890 885 &tosaled_device, 891 886 &tosa_bt_device, 892 887 &sharpsl_rom_device, 888 + &wm9712_device, 893 889 }; 894 890 895 891 static void tosa_poweroff(void)
+1
arch/arm/mach-s3c2440/Kconfig
··· 99 99 select POWER_SUPPLY 100 100 select MACH_NEO1973 101 101 select S3C2410_PWM 102 + select S3C_DEV_USB_HOST 102 103 help 103 104 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone 104 105
+13 -13
arch/arm/mach-s3c2440/include/mach/gta02.h
··· 44 44 #define GTA02v3_GPIO_nUSB_FLT S3C2410_GPG(10) /* v3 + v4 only */ 45 45 #define GTA02v3_GPIO_nGSM_OC S3C2410_GPG(11) /* v3 + v4 only */ 46 46 47 - #define GTA02_GPIO_AMP_SHUT S3C2440_GPJ1 /* v2 + v3 + v4 only */ 48 - #define GTA02v1_GPIO_WLAN_GPIO10 S3C2440_GPJ2 49 - #define GTA02_GPIO_HP_IN S3C2440_GPJ2 /* v2 + v3 + v4 only */ 50 - #define GTA02_GPIO_INT0 S3C2440_GPJ3 /* v2 + v3 + v4 only */ 51 - #define GTA02_GPIO_nGSM_EN S3C2440_GPJ4 52 - #define GTA02_GPIO_3D_RESET S3C2440_GPJ5 53 - #define GTA02_GPIO_nDL_GSM S3C2440_GPJ6 /* v4 + v5 only */ 54 - #define GTA02_GPIO_WLAN_GPIO0 S3C2440_GPJ7 55 - #define GTA02v1_GPIO_BAT_ID S3C2440_GPJ8 56 - #define GTA02_GPIO_KEEPACT S3C2440_GPJ8 57 - #define GTA02v1_GPIO_HP_IN S3C2440_GPJ10 58 - #define GTA02_CHIP_PWD S3C2440_GPJ11 /* v2 + v3 + v4 only */ 59 - #define GTA02_GPIO_nWLAN_RESET S3C2440_GPJ12 /* v2 + v3 + v4 only */ 47 + #define GTA02_GPIO_AMP_SHUT S3C2410_GPJ(1) /* v2 + v3 + v4 only */ 48 + #define GTA02v1_GPIO_WLAN_GPIO10 S3C2410_GPJ(2) 49 + #define GTA02_GPIO_HP_IN S3C2410_GPJ(2) /* v2 + v3 + v4 only */ 50 + #define GTA02_GPIO_INT0 S3C2410_GPJ(3) /* v2 + v3 + v4 only */ 51 + #define GTA02_GPIO_nGSM_EN S3C2410_GPJ(4) 52 + #define GTA02_GPIO_3D_RESET S3C2410_GPJ(5) 53 + #define GTA02_GPIO_nDL_GSM S3C2410_GPJ(6) /* v4 + v5 only */ 54 + #define GTA02_GPIO_WLAN_GPIO0 S3C2410_GPJ(7) 55 + #define GTA02v1_GPIO_BAT_ID S3C2410_GPJ(8) 56 + #define GTA02_GPIO_KEEPACT S3C2410_GPJ(8) 57 + #define GTA02v1_GPIO_HP_IN S3C2410_GPJ(10) 58 + #define GTA02_CHIP_PWD S3C2410_GPJ(11) /* v2 + v3 + v4 only */ 59 + #define GTA02_GPIO_nWLAN_RESET S3C2410_GPJ(12) /* v2 + v3 + v4 only */ 60 60 61 61 #define GTA02_IRQ_GSENSOR_1 IRQ_EINT0 62 62 #define GTA02_IRQ_MODEM IRQ_EINT1
+6
arch/arm/mach-s3c64xx/clock.c
··· 151 151 .enable = s3c64xx_pclk_ctrl, 152 152 .ctrlbit = S3C_CLKCON_PCLK_IIC, 153 153 }, { 154 + .name = "i2c", 155 + .id = 1, 156 + .parent = &clk_p, 157 + .enable = s3c64xx_pclk_ctrl, 158 + .ctrlbit = S3C6410_CLKCON_PCLK_I2C1, 159 + }, { 154 160 .name = "iis", 155 161 .id = 0, 156 162 .parent = &clk_p,
+6 -5
arch/arm/mach-s3c64xx/dma.c
··· 690 690 691 691 regptr = regs + PL080_Cx_BASE(0); 692 692 693 - for (ch = 0; ch < 8; ch++, chno++, chptr++) { 694 - printk(KERN_INFO "%s: registering DMA %d (%p)\n", 695 - __func__, chno, regptr); 693 + for (ch = 0; ch < 8; ch++, chptr++) { 694 + pr_debug("%s: registering DMA %d (%p)\n", 695 + __func__, chno + ch, regptr); 696 696 697 697 chptr->bit = 1 << ch; 698 - chptr->number = chno; 698 + chptr->number = chno + ch; 699 699 chptr->dmac = dmac; 700 700 chptr->regs = regptr; 701 701 regptr += PL080_Cx_STRIDE; ··· 704 704 /* for the moment, permanently enable the controller */ 705 705 writel(PL080_CONFIG_ENABLE, regs + PL080_CONFIG); 706 706 707 - printk(KERN_INFO "PL080: IRQ %d, at %p\n", irq, regs); 707 + printk(KERN_INFO "PL080: IRQ %d, at %p, channels %d..%d\n", 708 + irq, regs, chno, chno+8); 708 709 709 710 return 0; 710 711
+2 -2
arch/arm/mach-s3c64xx/gpiolib.c
··· 72 72 .get_pull = s3c_gpio_getpull_updown, 73 73 }; 74 74 75 - int s3c64xx_gpio2int_gpm(struct gpio_chip *chip, unsigned pin) 75 + static int s3c64xx_gpio2int_gpm(struct gpio_chip *chip, unsigned pin) 76 76 { 77 77 return pin < 5 ? IRQ_EINT(23) + pin : -ENXIO; 78 78 } ··· 138 138 }, 139 139 }; 140 140 141 - int s3c64xx_gpio2int_gpl(struct gpio_chip *chip, unsigned pin) 141 + static int s3c64xx_gpio2int_gpl(struct gpio_chip *chip, unsigned pin) 142 142 { 143 143 return pin >= 8 ? IRQ_EINT(16) + pin - 8 : -ENXIO; 144 144 }
+7 -6
arch/arm/mach-s3c64xx/mach-smdk6410.c
··· 28 28 #include <linux/delay.h> 29 29 #include <linux/smsc911x.h> 30 30 #include <linux/regulator/fixed.h> 31 + #include <linux/regulator/machine.h> 31 32 32 33 #ifdef CONFIG_SMDK6410_WM1190_EV1 33 34 #include <linux/mfd/wm8350/core.h> ··· 352 351 /* VDD_UH_MMC, LDO5 on J5 */ 353 352 static struct regulator_init_data smdk6410_vdduh_mmc = { 354 353 .constraints = { 355 - .name = "PVDD_UH/PVDD_MMC", 354 + .name = "PVDD_UH+PVDD_MMC", 356 355 .always_on = 1, 357 356 }, 358 357 }; ··· 418 417 /* S3C64xx internal logic & PLL */ 419 418 static struct regulator_init_data wm8350_dcdc1_data = { 420 419 .constraints = { 421 - .name = "PVDD_INT/PVDD_PLL", 420 + .name = "PVDD_INT+PVDD_PLL", 422 421 .min_uV = 1200000, 423 422 .max_uV = 1200000, 424 423 .always_on = 1, ··· 453 452 454 453 static struct regulator_init_data wm8350_dcdc4_data = { 455 454 .constraints = { 456 - .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", 455 + .name = "PVDD_HI+PVDD_EXT+PVDD_SYS+PVCCM2MTV", 457 456 .min_uV = 3000000, 458 457 .max_uV = 3000000, 459 458 .always_on = 1, ··· 465 464 /* OTGi/1190-EV1 HPVDD & AVDD */ 466 465 static struct regulator_init_data wm8350_ldo4_data = { 467 466 .constraints = { 468 - .name = "PVDD_OTGI/HPVDD/AVDD", 467 + .name = "PVDD_OTGI+HPVDD+AVDD", 469 468 .min_uV = 1200000, 470 469 .max_uV = 1200000, 471 470 .apply_uV = 1, ··· 553 552 554 553 static struct regulator_init_data wm1192_dcdc3 = { 555 554 .constraints = { 556 - .name = "PVDD_MEM/PVDD_GPS", 555 + .name = "PVDD_MEM+PVDD_GPS", 557 556 .always_on = 1, 558 557 }, 559 558 }; ··· 564 563 565 564 static struct regulator_init_data wm1192_ldo1 = { 566 565 .constraints = { 567 - .name = "PVDD_LCD/PVDD_EXT", 566 + .name = "PVDD_LCD+PVDD_EXT", 568 567 .always_on = 1, 569 568 }, 570 569 .consumer_supplies = wm1192_ldo1_consumers,
+1 -1
arch/arm/mach-s3c64xx/setup-keypad.c
··· 17 17 void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols) 18 18 { 19 19 /* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */ 20 - s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), 8 + rows, S3C_GPIO_SFN(3)); 20 + s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), rows, S3C_GPIO_SFN(3)); 21 21 22 22 /* Set all the necessary GPL pins to special-function 3: KP_COL[x] */ 23 23 s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), cols, S3C_GPIO_SFN(3));
+1 -1
arch/arm/mach-s3c64xx/setup-sdhci.c
··· 56 56 else 57 57 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); 58 58 59 - printk(KERN_INFO "%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3); 59 + pr_debug("%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3); 60 60 writel(ctrl2, r + S3C_SDHCI_CONTROL2); 61 61 writel(ctrl3, r + S3C_SDHCI_CONTROL3); 62 62 }
+2 -2
arch/arm/mach-s5p64x0/include/mach/gpio.h
··· 23 23 #define S5P6440_GPIO_A_NR (6) 24 24 #define S5P6440_GPIO_B_NR (7) 25 25 #define S5P6440_GPIO_C_NR (8) 26 - #define S5P6440_GPIO_F_NR (2) 26 + #define S5P6440_GPIO_F_NR (16) 27 27 #define S5P6440_GPIO_G_NR (7) 28 28 #define S5P6440_GPIO_H_NR (10) 29 29 #define S5P6440_GPIO_I_NR (16) ··· 36 36 #define S5P6450_GPIO_B_NR (7) 37 37 #define S5P6450_GPIO_C_NR (8) 38 38 #define S5P6450_GPIO_D_NR (8) 39 - #define S5P6450_GPIO_F_NR (2) 39 + #define S5P6450_GPIO_F_NR (16) 40 40 #define S5P6450_GPIO_G_NR (14) 41 41 #define S5P6450_GPIO_H_NR (10) 42 42 #define S5P6450_GPIO_I_NR (16)
+1
arch/arm/mach-shmobile/board-ag5evm.c
··· 454 454 gpio_direction_output(GPIO_PORT217, 0); 455 455 mdelay(1); 456 456 gpio_set_value(GPIO_PORT217, 1); 457 + mdelay(100); 457 458 458 459 /* LCD backlight controller */ 459 460 gpio_request(GPIO_PORT235, NULL); /* RESET */
+1 -1
arch/arm/mach-shmobile/board-ap4evb.c
··· 1303 1303 1304 1304 lcdc_info.clock_source = LCDC_CLK_BUS; 1305 1305 lcdc_info.ch[0].interface_type = RGB18; 1306 - lcdc_info.ch[0].clock_divider = 2; 1306 + lcdc_info.ch[0].clock_divider = 3; 1307 1307 lcdc_info.ch[0].flags = 0; 1308 1308 lcdc_info.ch[0].lcd_size_cfg.width = 152; 1309 1309 lcdc_info.ch[0].lcd_size_cfg.height = 91;
+1 -1
arch/arm/mach-shmobile/board-mackerel.c
··· 303 303 .lcd_cfg = mackerel_lcdc_modes, 304 304 .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes), 305 305 .interface_type = RGB24, 306 - .clock_divider = 2, 306 + .clock_divider = 3, 307 307 .flags = 0, 308 308 .lcd_size_cfg.width = 152, 309 309 .lcd_size_cfg.height = 91,
+14 -3
arch/arm/mach-shmobile/clock-sh73a0.c
··· 263 263 }; 264 264 265 265 enum { MSTP001, 266 - MSTP125, MSTP118, MSTP116, MSTP100, 266 + MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100, 267 267 MSTP219, 268 268 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 269 269 MSTP331, MSTP329, MSTP325, MSTP323, MSTP312, ··· 275 275 276 276 static struct clk mstp_clks[MSTP_NR] = { 277 277 [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */ 278 + [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* CEU1 */ 279 + [MSTP128] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 28, 0), /* CSI2-RX1 */ 280 + [MSTP127] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 27, 0), /* CEU0 */ 281 + [MSTP126] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 26, 0), /* CSI2-RX0 */ 278 282 [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ 279 283 [MSTP118] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 18, 0), /* DSITX0 */ 280 284 [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */ ··· 310 306 CLKDEV_CON_ID("r_clk", &r_clk), 311 307 312 308 /* DIV6 clocks */ 309 + CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]), 310 + CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]), 311 + CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]), 313 312 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), 314 313 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), 315 314 CLKDEV_ICK_ID("dsi0p_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), ··· 320 313 321 314 /* MSTP32 clocks */ 322 315 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ 323 - CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ 316 + CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP129]), /* CEU1 */ 317 + CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */ 318 + CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */ 319 + CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2-RX0 */ 324 320 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */ 325 321 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */ 326 - CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ 327 322 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */ 323 + CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ 324 + CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ 328 325 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ 329 326 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 330 327 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */
+5 -5
arch/arm/mach-shmobile/include/mach/head-ap4evb.txt
··· 6 6 EW 0xE6020004, 0xA500 7 7 EW 0xE6030004, 0xA500 8 8 9 - DD 0x01001000, 0x01001000 10 - 11 9 LIST "GPIO Setting" 12 10 EB 0xE6051013, 0xA2 13 11 14 12 LIST "CPG" 15 - ED 0xE6150080, 0x00000180 16 13 ED 0xE61500C0, 0x00000002 17 14 18 15 WAIT 1, 0xFE40009C ··· 34 37 35 38 WAIT 1, 0xFE40009C 36 39 40 + LIST "SUB/USBClk" 41 + ED 0xE6150080, 0x00000180 42 + 37 43 LIST "BSC" 38 44 ED 0xFEC10000, 0x00E0001B 39 45 ··· 53 53 ED 0xFE40004C, 0x00110209 54 54 ED 0xFE400010, 0x00000087 55 55 56 - WAIT 10, 0xFE40009C 56 + WAIT 30, 0xFE40009C 57 57 58 58 ED 0xFE400084, 0x0000003F 59 59 EB 0xFE500000, 0x00 ··· 84 84 85 85 WAIT 1, 0xFE40009C 86 86 87 - ED 0xE6150354, 0x00000002 87 + ED 0xFE400354, 0x01AD8002 88 88 89 89 LIST "SCIF0 - Serial port for earlyprintk" 90 90 EB 0xE6053098, 0x11
+5 -5
arch/arm/mach-shmobile/include/mach/head-mackerel.txt
··· 6 6 EW 0xE6020004, 0xA500 7 7 EW 0xE6030004, 0xA500 8 8 9 - DD 0x01001000, 0x01001000 10 - 11 9 LIST "GPIO Setting" 12 10 EB 0xE6051013, 0xA2 13 11 14 12 LIST "CPG" 15 - ED 0xE6150080, 0x00000180 16 13 ED 0xE61500C0, 0x00000002 17 14 18 15 WAIT 1, 0xFE40009C ··· 34 37 35 38 WAIT 1, 0xFE40009C 36 39 40 + LIST "SUB/USBClk" 41 + ED 0xE6150080, 0x00000180 42 + 37 43 LIST "BSC" 38 44 ED 0xFEC10000, 0x00E0001B 39 45 ··· 53 53 ED 0xFE40004C, 0x00110209 54 54 ED 0xFE400010, 0x00000087 55 55 56 - WAIT 10, 0xFE40009C 56 + WAIT 30, 0xFE40009C 57 57 58 58 ED 0xFE400084, 0x0000003F 59 59 EB 0xFE500000, 0x00 ··· 84 84 85 85 WAIT 1, 0xFE40009C 86 86 87 - ED 0xE6150354, 0x00000002 87 + ED 0xFE400354, 0x01AD8002 88 88 89 89 LIST "SCIF0 - Serial port for earlyprintk" 90 90 EB 0xE6053098, 0x11
+19
arch/arm/mach-tcc8k/board-tcc8000-sdk.c
··· 6 6 * published by the Free Software Foundation. 7 7 */ 8 8 9 + #include <linux/delay.h> 9 10 #include <linux/init.h> 10 11 #include <linux/kernel.h> 11 12 #include <linux/platform_device.h> ··· 18 17 #include <asm/mach/time.h> 19 18 20 19 #include <mach/clock.h> 20 + #include <mach/tcc-nand.h> 21 + #include <mach/tcc8k-regs.h> 21 22 22 23 #include "common.h" 23 24 ··· 54 51 static void __init tcc8k_map_io(void) 55 52 { 56 53 tcc8k_map_common_io(); 54 + 55 + /* set PLL0 clock to 96MHz, adapt UART0 divisor */ 56 + __raw_writel(0x00026003, CKC_BASE + PLL0CFG_OFFS); 57 + __raw_writel(0x10000001, CKC_BASE + ACLKUART0_OFFS); 58 + 59 + /* set PLL1 clock to 192MHz */ 60 + __raw_writel(0x00016003, CKC_BASE + PLL1CFG_OFFS); 61 + 62 + /* set PLL2 clock to 48MHz */ 63 + __raw_writel(0x00036003, CKC_BASE + PLL2CFG_OFFS); 64 + 65 + /* with CPU freq higher than 150 MHz, need extra DTCM wait */ 66 + __raw_writel(0x00000001, SCFG_BASE + DTCMWAIT_OFFS); 67 + 68 + /* PLL locking time as specified */ 69 + udelay(300); 57 70 } 58 71 59 72 MACHINE_START(TCC8000_SDK, "Telechips TCC8000-SDK Demo Board")
+26 -12
arch/arm/mach-tcc8k/clock.c
··· 45 45 #define ACLKGSB1 (CKC_BASE + ACLKGSB1_OFFS) 46 46 #define ACLKGSB2 (CKC_BASE + ACLKGSB2_OFFS) 47 47 #define ACLKGSB3 (CKC_BASE + ACLKGSB3_OFFS) 48 - #define ACLKUSBH (CKC_BASE + ACLKUSBH_OFFS) 49 48 #define ACLKTCT (CKC_BASE + ACLKTCT_OFFS) 50 49 #define ACLKTCX (CKC_BASE + ACLKTCX_OFFS) 51 50 #define ACLKTCZ (CKC_BASE + ACLKTCZ_OFFS) 51 + 52 + #define ACLK_MAX_DIV (0xfff + 1) 52 53 53 54 /* Crystal frequencies */ 54 55 static unsigned long xi_rate, xti_rate; ··· 107 106 return 0; 108 107 } 109 108 110 - static int root_clk_disable(enum root_clks root_src) 109 + static int root_clk_disable(enum root_clks src) 111 110 { 112 - switch (root_src) { 111 + switch (src) { 113 112 case CLK_SRC_PLL0: return pll_enable(0, 0); 114 113 case CLK_SRC_PLL1: return pll_enable(1, 0); 115 114 case CLK_SRC_PLL2: return pll_enable(2, 0); ··· 198 197 addr = CKC_BASE + CLKDIVC1_OFFS; 199 198 reg = __raw_readl(addr); 200 199 if (reg & CLKDIVC1_P2E) 201 - div = __raw_readl(addr) & 0x3f; 200 + div = reg & 0x3f; 202 201 break; 203 202 } 204 203 return get_rate_pll(pll) / (div + 1); ··· 259 258 { 260 259 unsigned long div, src, freq, r1, r2; 261 260 261 + if (!rate) 262 + return ACLK_MAX_DIV; 263 + 262 264 src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT; 263 265 src &= CLK_SRC_MASK; 264 266 freq = root_clk_get_rate(src); 265 - div = freq / rate + 1; 267 + div = freq / rate; 268 + if (!div) 269 + return 1; 270 + if (div >= ACLK_MAX_DIV) 271 + return ACLK_MAX_DIV; 266 272 r1 = freq / div; 267 273 r2 = freq / (div + 1); 268 - if (r2 >= rate) 269 - return div + 1; 270 274 if ((rate - r2) < (r1 - rate)) 271 275 return div + 1; 272 276 ··· 293 287 u32 reg; 294 288 295 289 reg = __raw_readl(clk->aclkreg) & ~ACLK_DIV_MASK; 296 - reg |= aclk_best_div(clk, rate); 290 + reg |= aclk_best_div(clk, rate) - 1; 291 + __raw_writel(reg, clk->aclkreg); 297 292 return 0; 298 293 } 299 294 ··· 303 296 unsigned int src; 304 297 305 298 src = __raw_readl(CKC_BASE + CLKCTRL_OFFS) & CLK_SRC_MASK; 306 - return root_clk_get_rate(src); 299 + return root_clk_get_rate(src); 307 300 } 308 301 309 302 static unsigned long get_rate_bus(struct clk *clk) 310 303 { 311 - unsigned int div; 304 + unsigned int reg, sdiv, bdiv, rate; 312 305 313 - div = (__raw_readl(CKC_BASE + CLKCTRL_OFFS) >> 4) & 0xff; 314 - return get_rate_sys(clk) / (div + 1); 306 + reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS); 307 + rate = get_rate_sys(clk); 308 + sdiv = (reg >> 20) & 3; 309 + if (sdiv) 310 + rate /= sdiv + 1; 311 + bdiv = (reg >> 4) & 0xff; 312 + if (bdiv) 313 + rate /= bdiv + 1; 314 + return rate; 315 315 } 316 316 317 317 static unsigned long get_rate_cpu(struct clk *clk)
+1
arch/arm/mach-tegra/include/mach/kbc.h
··· 57 57 const struct matrix_keymap_data *keymap_data; 58 58 59 59 bool wakeup; 60 + bool use_fn_map; 60 61 }; 61 62 #endif
+7 -4
arch/arm/plat-omap/mailbox.c
··· 322 322 323 323 struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb) 324 324 { 325 - struct omap_mbox *mbox; 326 - int ret; 325 + struct omap_mbox *_mbox, *mbox = NULL; 326 + int i, ret; 327 327 328 328 if (!mboxes) 329 329 return ERR_PTR(-EINVAL); 330 330 331 - for (mbox = *mboxes; mbox; mbox++) 332 - if (!strcmp(mbox->name, name)) 331 + for (i = 0; (_mbox = mboxes[i]); i++) { 332 + if (!strcmp(_mbox->name, name)) { 333 + mbox = _mbox; 333 334 break; 335 + } 336 + } 334 337 335 338 if (!mbox) 336 339 return ERR_PTR(-ENOENT);
+2
arch/arm/plat-samsung/dev-uart.c
··· 15 15 #include <linux/kernel.h> 16 16 #include <linux/platform_device.h> 17 17 18 + #include <plat/devs.h> 19 + 18 20 /* uart devices */ 19 21 20 22 static struct platform_device s3c24xx_uart_device0 = {
+12 -4
arch/blackfin/lib/outs.S
··· 13 13 .align 2 14 14 15 15 ENTRY(_outsl) 16 + CC = R2 == 0; 17 + IF CC JUMP 1f; 16 18 P0 = R0; /* P0 = port */ 17 19 P1 = R1; /* P1 = address */ 18 20 P2 = R2; /* P2 = count */ ··· 22 20 LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2; 23 21 .Llong_loop_s: R0 = [P1++]; 24 22 .Llong_loop_e: [P0] = R0; 25 - RTS; 23 + 1: RTS; 26 24 ENDPROC(_outsl) 27 25 28 26 ENTRY(_outsw) 27 + CC = R2 == 0; 28 + IF CC JUMP 1f; 29 29 P0 = R0; /* P0 = port */ 30 30 P1 = R1; /* P1 = address */ 31 31 P2 = R2; /* P2 = count */ ··· 35 31 LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2; 36 32 .Lword_loop_s: R0 = W[P1++]; 37 33 .Lword_loop_e: W[P0] = R0; 38 - RTS; 34 + 1: RTS; 39 35 ENDPROC(_outsw) 40 36 41 37 ENTRY(_outsb) 38 + CC = R2 == 0; 39 + IF CC JUMP 1f; 42 40 P0 = R0; /* P0 = port */ 43 41 P1 = R1; /* P1 = address */ 44 42 P2 = R2; /* P2 = count */ ··· 48 42 LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2; 49 43 .Lbyte_loop_s: R0 = B[P1++]; 50 44 .Lbyte_loop_e: B[P0] = R0; 51 - RTS; 45 + 1: RTS; 52 46 ENDPROC(_outsb) 53 47 54 48 ENTRY(_outsw_8) 49 + CC = R2 == 0; 50 + IF CC JUMP 1f; 55 51 P0 = R0; /* P0 = port */ 56 52 P1 = R1; /* P1 = address */ 57 53 P2 = R2; /* P2 = count */ ··· 64 56 R0 = R0 << 8; 65 57 R0 = R0 + R1; 66 58 .Lword8_loop_e: W[P0] = R0; 67 - RTS; 59 + 1: RTS; 68 60 ENDPROC(_outsw_8)
+2
arch/blackfin/mach-common/cache.S
··· 58 58 1: 59 59 .ifeqs "\flushins", BROK_FLUSH_INST 60 60 \flushins [P0++]; 61 + nop; 62 + nop; 61 63 2: nop; 62 64 .else 63 65 2: \flushins [P0++];
-5
arch/cris/kernel/vmlinux.lds.S
··· 72 72 INIT_TEXT_SECTION(PAGE_SIZE) 73 73 .init.data : { INIT_DATA } 74 74 .init.setup : { INIT_SETUP(16) } 75 - #ifdef CONFIG_ETRAX_ARCH_V32 76 - __start___param = .; 77 - __param : { *(__param) } 78 - __stop___param = .; 79 - #endif 80 75 .initcall.init : { 81 76 INIT_CALLS 82 77 }
+6
arch/powerpc/include/asm/machdep.h
··· 240 240 * claims to support kexec. 241 241 */ 242 242 int (*machine_kexec_prepare)(struct kimage *image); 243 + 244 + /* Called to perform the _real_ kexec. 245 + * Do NOT allocate memory or fail here. We are past the point of 246 + * no return. 247 + */ 248 + void (*machine_kexec)(struct kimage *image); 243 249 #endif /* CONFIG_KEXEC */ 244 250 245 251 #ifdef CONFIG_SUSPEND
+4 -1
arch/powerpc/kernel/machine_kexec.c
··· 87 87 88 88 save_ftrace_enabled = __ftrace_enabled_save(); 89 89 90 - default_machine_kexec(image); 90 + if (ppc_md.machine_kexec) 91 + ppc_md.machine_kexec(image); 92 + else 93 + default_machine_kexec(image); 91 94 92 95 __ftrace_enabled_restore(save_ftrace_enabled); 93 96
+5 -3
arch/powerpc/kernel/process.c
··· 353 353 prime_debug_regs(new_thread); 354 354 } 355 355 #else /* !CONFIG_PPC_ADV_DEBUG_REGS */ 356 + #ifndef CONFIG_HAVE_HW_BREAKPOINT 356 357 static void set_debug_reg_defaults(struct thread_struct *thread) 357 358 { 358 359 if (thread->dabr) { ··· 361 360 set_dabr(0); 362 361 } 363 362 } 363 + #endif /* !CONFIG_HAVE_HW_BREAKPOINT */ 364 364 #endif /* CONFIG_PPC_ADV_DEBUG_REGS */ 365 365 366 366 int set_dabr(unsigned long dabr) ··· 672 670 { 673 671 discard_lazy_cpu_state(); 674 672 675 - #ifdef CONFIG_HAVE_HW_BREAKPOINTS 673 + #ifdef CONFIG_HAVE_HW_BREAKPOINT 676 674 flush_ptrace_hw_breakpoint(current); 677 - #else /* CONFIG_HAVE_HW_BREAKPOINTS */ 675 + #else /* CONFIG_HAVE_HW_BREAKPOINT */ 678 676 set_debug_reg_defaults(&current->thread); 679 - #endif /* CONFIG_HAVE_HW_BREAKPOINTS */ 677 + #endif /* CONFIG_HAVE_HW_BREAKPOINT */ 680 678 } 681 679 682 680 void
+3 -3
arch/powerpc/mm/tlb_hash64.c
··· 38 38 * neesd to be flushed. This function will either perform the flush 39 39 * immediately or will batch it up if the current CPU has an active 40 40 * batch on it. 41 - * 42 - * Must be called from within some kind of spinlock/non-preempt region... 43 41 */ 44 42 void hpte_need_flush(struct mm_struct *mm, unsigned long addr, 45 43 pte_t *ptep, unsigned long pte, int huge) 46 44 { 47 - struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 45 + struct ppc64_tlb_batch *batch = &get_cpu_var(ppc64_tlb_batch); 48 46 unsigned long vsid, vaddr; 49 47 unsigned int psize; 50 48 int ssize; ··· 97 99 */ 98 100 if (!batch->active) { 99 101 flush_hash_page(vaddr, rpte, psize, ssize, 0); 102 + put_cpu_var(ppc64_tlb_batch); 100 103 return; 101 104 } 102 105 ··· 126 127 batch->index = ++i; 127 128 if (i >= PPC64_TLB_BATCH_NR) 128 129 __flush_tlb_pending(batch); 130 + put_cpu_var(ppc64_tlb_batch); 129 131 } 130 132 131 133 /*
+1 -1
arch/sh/include/asm/sections.h
··· 3 3 4 4 #include <asm-generic/sections.h> 5 5 6 - extern void __nosave_begin, __nosave_end; 6 + extern long __nosave_begin, __nosave_end; 7 7 extern long __machvec_start, __machvec_end; 8 8 extern char __uncached_start, __uncached_end; 9 9 extern char _ebss[];
+9 -4
arch/sh/kernel/cpu/sh4/setup-sh7750.c
··· 14 14 #include <linux/io.h> 15 15 #include <linux/sh_timer.h> 16 16 #include <linux/serial_sci.h> 17 - #include <asm/machtypes.h> 17 + #include <generated/machtypes.h> 18 18 19 19 static struct resource rtc_resources[] = { 20 20 [0] = { ··· 255 255 256 256 void __init plat_early_device_setup(void) 257 257 { 258 + struct platform_device *dev[1]; 259 + 258 260 if (mach_is_rts7751r2d()) { 259 261 scif_platform_data.scscr |= SCSCR_CKE1; 260 - early_platform_add_devices(&scif_device, 1); 262 + dev[0] = &scif_device; 263 + early_platform_add_devices(dev, 1); 261 264 } else { 262 - early_platform_add_devices(&sci_device, 1); 263 - early_platform_add_devices(&scif_device, 1); 265 + dev[0] = &sci_device; 266 + early_platform_add_devices(dev, 1); 267 + dev[0] = &scif_device; 268 + early_platform_add_devices(dev, 1); 264 269 } 265 270 266 271 early_platform_add_devices(sh7750_early_devices,
+10
arch/sh/lib/delay.c
··· 10 10 void __delay(unsigned long loops) 11 11 { 12 12 __asm__ __volatile__( 13 + /* 14 + * ST40-300 appears to have an issue with this code, 15 + * normally taking two cycles each loop, as with all 16 + * other SH variants. If however the branch and the 17 + * delay slot straddle an 8 byte boundary, this increases 18 + * to 3 cycles. 19 + * This align directive ensures this doesn't occur. 20 + */ 21 + ".balign 8\n\t" 22 + 13 23 "tst %0, %0\n\t" 14 24 "1:\t" 15 25 "bf/s 1b\n\t"
+2 -1
arch/sh/mm/cache.c
··· 108 108 kunmap_atomic(vfrom, KM_USER0); 109 109 } 110 110 111 - if (pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK)) 111 + if (pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK) || 112 + (vma->vm_flags & VM_EXEC)) 112 113 __flush_purge_region(vto, PAGE_SIZE); 113 114 114 115 kunmap_atomic(vto, KM_USER1);
+1
arch/x86/include/asm/acpi.h
··· 88 88 extern int acpi_pci_disabled; 89 89 extern int acpi_skip_timer_override; 90 90 extern int acpi_use_timer_override; 91 + extern int acpi_fix_pin2_polarity; 91 92 92 93 extern u8 acpi_sci_flags; 93 94 extern int acpi_sci_override_gsi;
+5
arch/x86/include/asm/msr-index.h
··· 36 36 #define MSR_IA32_PERFCTR1 0x000000c2 37 37 #define MSR_FSB_FREQ 0x000000cd 38 38 39 + #define MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2 40 + #define NHM_C3_AUTO_DEMOTE (1UL << 25) 41 + #define NHM_C1_AUTO_DEMOTE (1UL << 26) 42 + #define ATM_LNC_C6_AUTO_DEMOTE (1UL << 25) 43 + 39 44 #define MSR_MTRRcap 0x000000fe 40 45 #define MSR_IA32_BBL_CR_CTL 0x00000119 41 46
+1
arch/x86/include/asm/perf_event_p4.h
··· 22 22 23 23 #define ARCH_P4_CNTRVAL_BITS (40) 24 24 #define ARCH_P4_CNTRVAL_MASK ((1ULL << ARCH_P4_CNTRVAL_BITS) - 1) 25 + #define ARCH_P4_UNFLAGGED_BIT ((1ULL) << (ARCH_P4_CNTRVAL_BITS - 1)) 25 26 26 27 #define P4_ESCR_EVENT_MASK 0x7e000000U 27 28 #define P4_ESCR_EVENT_SHIFT 25
+1 -1
arch/x86/include/asm/smpboot_hooks.h
··· 34 34 */ 35 35 CMOS_WRITE(0, 0xf); 36 36 37 - *((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0; 37 + *((volatile u32 *)phys_to_virt(apic->trampoline_phys_low)) = 0; 38 38 } 39 39 40 40 static inline void __init smpboot_setup_io_apic(void)
+10 -4
arch/x86/kernel/acpi/boot.c
··· 72 72 int acpi_sci_override_gsi __initdata; 73 73 int acpi_skip_timer_override __initdata; 74 74 int acpi_use_timer_override __initdata; 75 + int acpi_fix_pin2_polarity __initdata; 75 76 76 77 #ifdef CONFIG_X86_LOCAL_APIC 77 78 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; ··· 416 415 return 0; 417 416 } 418 417 419 - if (acpi_skip_timer_override && 420 - intsrc->source_irq == 0 && intsrc->global_irq == 2) { 421 - printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); 422 - return 0; 418 + if (intsrc->source_irq == 0 && intsrc->global_irq == 2) { 419 + if (acpi_skip_timer_override) { 420 + printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); 421 + return 0; 422 + } 423 + if (acpi_fix_pin2_polarity && (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) { 424 + intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK; 425 + printk(PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n"); 426 + } 423 427 } 424 428 425 429 mp_override_legacy_irq(intsrc->source_irq,
+1 -1
arch/x86/kernel/apb_timer.c
··· 284 284 memcpy(&adev->evt, &apbt_clockevent, sizeof(struct clock_event_device)); 285 285 286 286 if (mrst_timer_options == MRST_TIMER_LAPIC_APBT) { 287 - apbt_clockevent.rating = APBT_CLOCKEVENT_RATING - 100; 287 + adev->evt.rating = APBT_CLOCKEVENT_RATING - 100; 288 288 global_clock_event = &adev->evt; 289 289 printk(KERN_DEBUG "%s clockevent registered as global\n", 290 290 global_clock_event->name);
+3 -3
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
··· 158 158 { 159 159 if (c->x86 == 0x06) { 160 160 if (cpu_has(c, X86_FEATURE_EST)) 161 - printk(KERN_WARNING PFX "Warning: EST-capable CPU " 162 - "detected. The acpi-cpufreq module offers " 163 - "voltage scaling in addition of frequency " 161 + printk_once(KERN_WARNING PFX "Warning: EST-capable " 162 + "CPU detected. The acpi-cpufreq module offers " 163 + "voltage scaling in addition to frequency " 164 164 "scaling. You should use that instead of " 165 165 "p4-clockmod, if possible.\n"); 166 166 switch (c->x86_model) {
+10 -3
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
··· 1537 1537 static int __cpuinit powernowk8_init(void) 1538 1538 { 1539 1539 unsigned int i, supported_cpus = 0, cpu; 1540 + int rv; 1540 1541 1541 1542 for_each_online_cpu(i) { 1542 1543 int rc; ··· 1556 1555 1557 1556 cpb_capable = true; 1558 1557 1559 - register_cpu_notifier(&cpb_nb); 1560 - 1561 1558 msrs = msrs_alloc(); 1562 1559 if (!msrs) { 1563 1560 printk(KERN_ERR "%s: Error allocating msrs!\n", __func__); 1564 1561 return -ENOMEM; 1565 1562 } 1563 + 1564 + register_cpu_notifier(&cpb_nb); 1566 1565 1567 1566 rdmsr_on_cpus(cpu_online_mask, MSR_K7_HWCR, msrs); 1568 1567 ··· 1575 1574 (cpb_enabled ? "on" : "off")); 1576 1575 } 1577 1576 1578 - return cpufreq_register_driver(&cpufreq_amd64_driver); 1577 + rv = cpufreq_register_driver(&cpufreq_amd64_driver); 1578 + if (rv < 0 && boot_cpu_has(X86_FEATURE_CPB)) { 1579 + unregister_cpu_notifier(&cpb_nb); 1580 + msrs_free(msrs); 1581 + msrs = NULL; 1582 + } 1583 + return rv; 1579 1584 } 1580 1585 1581 1586 /* driver entry point for term */
+8 -3
arch/x86/kernel/cpu/perf_event_p4.c
··· 770 770 return 1; 771 771 } 772 772 773 - /* it might be unflagged overflow */ 774 - rdmsrl(hwc->event_base + hwc->idx, v); 775 - if (!(v & ARCH_P4_CNTRVAL_MASK)) 773 + /* 774 + * In some circumstances the overflow might issue an NMI but did 775 + * not set P4_CCCR_OVF bit. Because a counter holds a negative value 776 + * we simply check for high bit being set, if it's cleared it means 777 + * the counter has reached zero value and continued counting before 778 + * real NMI signal was received: 779 + */ 780 + if (!(v & ARCH_P4_UNFLAGGED_BIT)) 776 781 return 1; 777 782 778 783 return 0;
+7 -9
arch/x86/kernel/early-quirks.c
··· 143 143 144 144 static u32 __init ati_sbx00_rev(int num, int slot, int func) 145 145 { 146 - u32 old, d; 146 + u32 d; 147 147 148 - d = read_pci_config(num, slot, func, 0x70); 149 - old = d; 150 - d &= ~(1<<8); 151 - write_pci_config(num, slot, func, 0x70, d); 152 148 d = read_pci_config(num, slot, func, 0x8); 153 149 d &= 0xff; 154 - write_pci_config(num, slot, func, 0x70, old); 155 150 156 151 return d; 157 152 } ··· 155 160 { 156 161 u32 d, rev; 157 162 158 - if (acpi_use_timer_override) 163 + rev = ati_sbx00_rev(num, slot, func); 164 + if (rev >= 0x40) 165 + acpi_fix_pin2_polarity = 1; 166 + 167 + if (rev > 0x13) 159 168 return; 160 169 161 - rev = ati_sbx00_rev(num, slot, func); 162 - if (rev > 0x13) 170 + if (acpi_use_timer_override) 163 171 return; 164 172 165 173 /* check for IRQ0 interrupt swap */
+8
arch/x86/kernel/reboot.c
··· 285 285 DMI_MATCH(DMI_BOARD_NAME, "P4S800"), 286 286 }, 287 287 }, 288 + { /* Handle problems with rebooting on VersaLogic Menlow boards */ 289 + .callback = set_bios_reboot, 290 + .ident = "VersaLogic Menlow based board", 291 + .matches = { 292 + DMI_MATCH(DMI_BOARD_VENDOR, "VersaLogic Corporation"), 293 + DMI_MATCH(DMI_BOARD_NAME, "VersaLogic Menlow board"), 294 + }, 295 + }, 288 296 { } 289 297 }; 290 298
+2
arch/x86/kvm/svm.c
··· 2777 2777 kvm_register_write(&svm->vcpu, reg, val); 2778 2778 } 2779 2779 2780 + skip_emulated_instruction(&svm->vcpu); 2781 + 2780 2782 return 1; 2781 2783 } 2782 2784
+1 -2
arch/x86/platform/olpc/olpc_dt.c
··· 140 140 * wasted bootmem) and hand off chunks of it to callers. 141 141 */ 142 142 res = alloc_bootmem(chunk_size); 143 - if (!res) 144 - return NULL; 143 + BUG_ON(!res); 145 144 prom_early_allocated += chunk_size; 146 145 memset(res, 0, chunk_size); 147 146 free_mem = chunk_size;
+6 -12
block/blk-core.c
··· 352 352 WARN_ON(!irqs_disabled()); 353 353 354 354 queue_flag_clear(QUEUE_FLAG_STOPPED, q); 355 - __blk_run_queue(q); 355 + __blk_run_queue(q, false); 356 356 } 357 357 EXPORT_SYMBOL(blk_start_queue); 358 358 ··· 403 403 /** 404 404 * __blk_run_queue - run a single device queue 405 405 * @q: The queue to run 406 + * @force_kblockd: Don't run @q->request_fn directly. Use kblockd. 406 407 * 407 408 * Description: 408 409 * See @blk_run_queue. This variant must be called with the queue lock 409 410 * held and interrupts disabled. 410 411 * 411 412 */ 412 - void __blk_run_queue(struct request_queue *q) 413 + void __blk_run_queue(struct request_queue *q, bool force_kblockd) 413 414 { 414 415 blk_remove_plug(q); 415 416 ··· 424 423 * Only recurse once to avoid overrunning the stack, let the unplug 425 424 * handling reinvoke the handler shortly if we already got there. 426 425 */ 427 - if (!queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) { 426 + if (!force_kblockd && !queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) { 428 427 q->request_fn(q); 429 428 queue_flag_clear(QUEUE_FLAG_REENTER, q); 430 429 } else { ··· 447 446 unsigned long flags; 448 447 449 448 spin_lock_irqsave(q->queue_lock, flags); 450 - __blk_run_queue(q); 449 + __blk_run_queue(q, false); 451 450 spin_unlock_irqrestore(q->queue_lock, flags); 452 451 } 453 452 EXPORT_SYMBOL(blk_run_queue); ··· 1054 1053 1055 1054 drive_stat_acct(rq, 1); 1056 1055 __elv_add_request(q, rq, where, 0); 1057 - __blk_run_queue(q); 1056 + __blk_run_queue(q, false); 1058 1057 spin_unlock_irqrestore(q->queue_lock, flags); 1059 1058 } 1060 1059 EXPORT_SYMBOL(blk_insert_request); ··· 2610 2609 return queue_work(kblockd_workqueue, work); 2611 2610 } 2612 2611 EXPORT_SYMBOL(kblockd_schedule_work); 2613 - 2614 - int kblockd_schedule_delayed_work(struct request_queue *q, 2615 - struct delayed_work *dwork, unsigned long delay) 2616 - { 2617 - return queue_delayed_work(kblockd_workqueue, dwork, delay); 2618 - } 2619 - EXPORT_SYMBOL(kblockd_schedule_delayed_work); 2620 2612 2621 2613 int __init blk_dev_init(void) 2622 2614 {
+5 -3
block/blk-flush.c
··· 66 66 67 67 /* 68 68 * Moving a request silently to empty queue_head may stall the 69 - * queue. Kick the queue in those cases. 69 + * queue. Kick the queue in those cases. This function is called 70 + * from request completion path and calling directly into 71 + * request_fn may confuse the driver. Always use kblockd. 70 72 */ 71 73 if (was_empty && next_rq) 72 - __blk_run_queue(q); 74 + __blk_run_queue(q, true); 73 75 } 74 76 75 77 static void pre_flush_end_io(struct request *rq, int error) ··· 132 130 BUG(); 133 131 } 134 132 135 - elv_insert(q, rq, ELEVATOR_INSERT_FRONT); 133 + elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE); 136 134 return rq; 137 135 } 138 136
+1 -1
block/blk-lib.c
··· 132 132 } 133 133 134 134 /** 135 - * blkdev_issue_zeroout generate number of zero filed write bios 135 + * blkdev_issue_zeroout - generate number of zero filed write bios 136 136 * @bdev: blockdev to issue 137 137 * @sector: start sector 138 138 * @nr_sects: number of sectors to write
+18 -11
block/blk-throttle.c
··· 20 20 /* Throttling is performed over 100ms slice and after that slice is renewed */ 21 21 static unsigned long throtl_slice = HZ/10; /* 100 ms */ 22 22 23 + /* A workqueue to queue throttle related work */ 24 + static struct workqueue_struct *kthrotld_workqueue; 25 + static void throtl_schedule_delayed_work(struct throtl_data *td, 26 + unsigned long delay); 27 + 23 28 struct throtl_rb_root { 24 29 struct rb_root rb; 25 30 struct rb_node *left; ··· 350 345 update_min_dispatch_time(st); 351 346 352 347 if (time_before_eq(st->min_disptime, jiffies)) 353 - throtl_schedule_delayed_work(td->queue, 0); 348 + throtl_schedule_delayed_work(td, 0); 354 349 else 355 - throtl_schedule_delayed_work(td->queue, 356 - (st->min_disptime - jiffies)); 350 + throtl_schedule_delayed_work(td, (st->min_disptime - jiffies)); 357 351 } 358 352 359 353 static inline void ··· 819 815 } 820 816 821 817 /* Call with queue lock held */ 822 - void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay) 818 + static void 819 + throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay) 823 820 { 824 821 825 - struct throtl_data *td = q->td; 826 822 struct delayed_work *dwork = &td->throtl_work; 827 823 828 824 if (total_nr_queued(td) > 0) { ··· 831 827 * Cancel that and schedule a new one. 832 828 */ 833 829 __cancel_delayed_work(dwork); 834 - kblockd_schedule_delayed_work(q, dwork, delay); 830 + queue_delayed_work(kthrotld_workqueue, dwork, delay); 835 831 throtl_log(td, "schedule work. delay=%lu jiffies=%lu", 836 832 delay, jiffies); 837 833 } 838 834 } 839 - EXPORT_SYMBOL(throtl_schedule_delayed_work); 840 835 841 836 static void 842 837 throtl_destroy_tg(struct throtl_data *td, struct throtl_grp *tg) ··· 923 920 smp_mb__after_atomic_inc(); 924 921 925 922 /* Schedule a work now to process the limit change */ 926 - throtl_schedule_delayed_work(td->queue, 0); 923 + throtl_schedule_delayed_work(td, 0); 927 924 } 928 925 929 926 static void throtl_update_blkio_group_write_bps(void *key, ··· 937 934 smp_mb__before_atomic_inc(); 938 935 atomic_inc(&td->limits_changed); 939 936 smp_mb__after_atomic_inc(); 940 - throtl_schedule_delayed_work(td->queue, 0); 937 + throtl_schedule_delayed_work(td, 0); 941 938 } 942 939 943 940 static void throtl_update_blkio_group_read_iops(void *key, ··· 951 948 smp_mb__before_atomic_inc(); 952 949 atomic_inc(&td->limits_changed); 953 950 smp_mb__after_atomic_inc(); 954 - throtl_schedule_delayed_work(td->queue, 0); 951 + throtl_schedule_delayed_work(td, 0); 955 952 } 956 953 957 954 static void throtl_update_blkio_group_write_iops(void *key, ··· 965 962 smp_mb__before_atomic_inc(); 966 963 atomic_inc(&td->limits_changed); 967 964 smp_mb__after_atomic_inc(); 968 - throtl_schedule_delayed_work(td->queue, 0); 965 + throtl_schedule_delayed_work(td, 0); 969 966 } 970 967 971 968 void throtl_shutdown_timer_wq(struct request_queue *q) ··· 1138 1135 1139 1136 static int __init throtl_init(void) 1140 1137 { 1138 + kthrotld_workqueue = alloc_workqueue("kthrotld", WQ_MEM_RECLAIM, 0); 1139 + if (!kthrotld_workqueue) 1140 + panic("Failed to create kthrotld\n"); 1141 + 1141 1142 blkio_policy_register(&blkio_policy_throtl); 1142 1143 return 0; 1143 1144 }
+3 -3
block/cfq-iosched.c
··· 3355 3355 cfqd->busy_queues > 1) { 3356 3356 cfq_del_timer(cfqd, cfqq); 3357 3357 cfq_clear_cfqq_wait_request(cfqq); 3358 - __blk_run_queue(cfqd->queue); 3358 + __blk_run_queue(cfqd->queue, false); 3359 3359 } else { 3360 3360 cfq_blkiocg_update_idle_time_stats( 3361 3361 &cfqq->cfqg->blkg); ··· 3370 3370 * this new queue is RT and the current one is BE 3371 3371 */ 3372 3372 cfq_preempt_queue(cfqd, cfqq); 3373 - __blk_run_queue(cfqd->queue); 3373 + __blk_run_queue(cfqd->queue, false); 3374 3374 } 3375 3375 } 3376 3376 ··· 3731 3731 struct request_queue *q = cfqd->queue; 3732 3732 3733 3733 spin_lock_irq(q->queue_lock); 3734 - __blk_run_queue(cfqd->queue); 3734 + __blk_run_queue(cfqd->queue, false); 3735 3735 spin_unlock_irq(q->queue_lock); 3736 3736 } 3737 3737
+2 -2
block/elevator.c
··· 602 602 */ 603 603 elv_drain_elevator(q); 604 604 while (q->rq.elvpriv) { 605 - __blk_run_queue(q); 605 + __blk_run_queue(q, false); 606 606 spin_unlock_irq(q->queue_lock); 607 607 msleep(10); 608 608 spin_lock_irq(q->queue_lock); ··· 651 651 * with anything. There's no point in delaying queue 652 652 * processing. 653 653 */ 654 - __blk_run_queue(q); 654 + __blk_run_queue(q, false); 655 655 break; 656 656 657 657 case ELEVATOR_INSERT_SORT:
+1 -1
block/genhd.c
··· 1355 1355 struct block_device *bdev = bdget_disk(disk, partno); 1356 1356 if (bdev) { 1357 1357 fsync_bdev(bdev); 1358 - res = __invalidate_device(bdev); 1358 + res = __invalidate_device(bdev, true); 1359 1359 bdput(bdev); 1360 1360 } 1361 1361 return res;
+5 -3
block/ioctl.c
··· 294 294 return -EINVAL; 295 295 if (get_user(n, (int __user *) arg)) 296 296 return -EFAULT; 297 - if (!(mode & FMODE_EXCL) && 298 - blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0) 299 - return -EBUSY; 297 + if (!(mode & FMODE_EXCL)) { 298 + bdgrab(bdev); 299 + if (blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0) 300 + return -EBUSY; 301 + } 300 302 ret = set_blocksize(bdev, n); 301 303 if (!(mode & FMODE_EXCL)) 302 304 blkdev_put(bdev, mode | FMODE_EXCL);
+6 -1
drivers/acpi/acpica/aclocal.h
··· 416 416 u8 originally_enabled; /* True if GPE was originally enabled */ 417 417 }; 418 418 419 + struct acpi_gpe_notify_object { 420 + struct acpi_namespace_node *node; 421 + struct acpi_gpe_notify_object *next; 422 + }; 423 + 419 424 union acpi_gpe_dispatch_info { 420 425 struct acpi_namespace_node *method_node; /* Method node for this GPE level */ 421 426 struct acpi_gpe_handler_info *handler; /* Installed GPE handler */ 422 - struct acpi_namespace_node *device_node; /* Parent _PRW device for implicit notify */ 427 + struct acpi_gpe_notify_object device; /* List of _PRW devices for implicit notify */ 423 428 }; 424 429 425 430 /*
+13 -4
drivers/acpi/acpica/evgpe.c
··· 457 457 acpi_status status; 458 458 struct acpi_gpe_event_info *local_gpe_event_info; 459 459 struct acpi_evaluate_info *info; 460 + struct acpi_gpe_notify_object *notify_object; 460 461 461 462 ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); 462 463 ··· 509 508 * from this thread -- because handlers may in turn run other 510 509 * control methods. 511 510 */ 512 - status = 513 - acpi_ev_queue_notify_request(local_gpe_event_info->dispatch. 514 - device_node, 515 - ACPI_NOTIFY_DEVICE_WAKE); 511 + status = acpi_ev_queue_notify_request( 512 + local_gpe_event_info->dispatch.device.node, 513 + ACPI_NOTIFY_DEVICE_WAKE); 514 + 515 + notify_object = local_gpe_event_info->dispatch.device.next; 516 + while (ACPI_SUCCESS(status) && notify_object) { 517 + status = acpi_ev_queue_notify_request( 518 + notify_object->node, 519 + ACPI_NOTIFY_DEVICE_WAKE); 520 + notify_object = notify_object->next; 521 + } 522 + 516 523 break; 517 524 518 525 case ACPI_GPE_DISPATCH_METHOD:
+37 -13
drivers/acpi/acpica/evxfgpe.c
··· 198 198 acpi_status status = AE_BAD_PARAMETER; 199 199 struct acpi_gpe_event_info *gpe_event_info; 200 200 struct acpi_namespace_node *device_node; 201 + struct acpi_gpe_notify_object *notify_object; 201 202 acpi_cpu_flags flags; 203 + u8 gpe_dispatch_mask; 202 204 203 205 ACPI_FUNCTION_TRACE(acpi_setup_gpe_for_wake); 204 206 ··· 223 221 goto unlock_and_exit; 224 222 } 225 223 224 + if (wake_device == ACPI_ROOT_OBJECT) { 225 + goto out; 226 + } 227 + 226 228 /* 227 229 * If there is no method or handler for this GPE, then the 228 230 * wake_device will be notified whenever this GPE fires (aka 229 231 * "implicit notify") Note: The GPE is assumed to be 230 232 * level-triggered (for windows compatibility). 231 233 */ 232 - if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 233 - ACPI_GPE_DISPATCH_NONE) && (wake_device != ACPI_ROOT_OBJECT)) { 234 - 235 - /* Validate wake_device is of type Device */ 236 - 237 - device_node = ACPI_CAST_PTR(struct acpi_namespace_node, 238 - wake_device); 239 - if (device_node->type != ACPI_TYPE_DEVICE) { 240 - goto unlock_and_exit; 241 - } 242 - gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY | 243 - ACPI_GPE_LEVEL_TRIGGERED); 244 - gpe_event_info->dispatch.device_node = device_node; 234 + gpe_dispatch_mask = gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK; 235 + if (gpe_dispatch_mask != ACPI_GPE_DISPATCH_NONE 236 + && gpe_dispatch_mask != ACPI_GPE_DISPATCH_NOTIFY) { 237 + goto out; 245 238 } 246 239 240 + /* Validate wake_device is of type Device */ 241 + 242 + device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); 243 + if (device_node->type != ACPI_TYPE_DEVICE) { 244 + goto unlock_and_exit; 245 + } 246 + 247 + if (gpe_dispatch_mask == ACPI_GPE_DISPATCH_NONE) { 248 + gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY | 249 + ACPI_GPE_LEVEL_TRIGGERED); 250 + gpe_event_info->dispatch.device.node = device_node; 251 + gpe_event_info->dispatch.device.next = NULL; 252 + } else { 253 + /* There are multiple devices to notify implicitly. */ 254 + 255 + notify_object = ACPI_ALLOCATE_ZEROED(sizeof(*notify_object)); 256 + if (!notify_object) { 257 + status = AE_NO_MEMORY; 258 + goto unlock_and_exit; 259 + } 260 + 261 + notify_object->node = device_node; 262 + notify_object->next = gpe_event_info->dispatch.device.next; 263 + gpe_event_info->dispatch.device.next = notify_object; 264 + } 265 + 266 + out: 247 267 gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; 248 268 status = AE_OK; 249 269
+14 -6
drivers/acpi/debugfs.c
··· 26 26 size_t count, loff_t *ppos) 27 27 { 28 28 static char *buf; 29 - static int uncopied_bytes; 29 + static u32 max_size; 30 + static u32 uncopied_bytes; 31 + 30 32 struct acpi_table_header table; 31 33 acpi_status status; 32 34 ··· 39 37 if (copy_from_user(&table, user_buf, 40 38 sizeof(struct acpi_table_header))) 41 39 return -EFAULT; 42 - uncopied_bytes = table.length; 43 - buf = kzalloc(uncopied_bytes, GFP_KERNEL); 40 + uncopied_bytes = max_size = table.length; 41 + buf = kzalloc(max_size, GFP_KERNEL); 44 42 if (!buf) 45 43 return -ENOMEM; 46 44 } 47 45 48 - if (uncopied_bytes < count) { 49 - kfree(buf); 46 + if (buf == NULL) 50 47 return -EINVAL; 51 - } 48 + 49 + if ((*ppos > max_size) || 50 + (*ppos + count > max_size) || 51 + (*ppos + count < count) || 52 + (count > uncopied_bytes)) 53 + return -EINVAL; 52 54 53 55 if (copy_from_user(buf + (*ppos), user_buf, count)) { 54 56 kfree(buf); 57 + buf = NULL; 55 58 return -EFAULT; 56 59 } 57 60 ··· 66 59 if (!uncopied_bytes) { 67 60 status = acpi_install_method(buf); 68 61 kfree(buf); 62 + buf = NULL; 69 63 if (ACPI_FAILURE(status)) 70 64 return -EINVAL; 71 65 add_taint(TAINT_OVERRIDDEN_ACPI_TABLE);
+1 -1
drivers/block/floppy.c
··· 3281 3281 struct block_device *bdev = opened_bdev[cnt]; 3282 3282 if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) 3283 3283 continue; 3284 - __invalidate_device(bdev); 3284 + __invalidate_device(bdev, true); 3285 3285 } 3286 3286 mutex_unlock(&open_lock); 3287 3287 } else {
-5
drivers/block/loop.c
··· 78 78 79 79 #include <asm/uaccess.h> 80 80 81 - static DEFINE_MUTEX(loop_mutex); 82 81 static LIST_HEAD(loop_devices); 83 82 static DEFINE_MUTEX(loop_devices_mutex); 84 83 ··· 1500 1501 { 1501 1502 struct loop_device *lo = bdev->bd_disk->private_data; 1502 1503 1503 - mutex_lock(&loop_mutex); 1504 1504 mutex_lock(&lo->lo_ctl_mutex); 1505 1505 lo->lo_refcnt++; 1506 1506 mutex_unlock(&lo->lo_ctl_mutex); 1507 - mutex_unlock(&loop_mutex); 1508 1507 1509 1508 return 0; 1510 1509 } ··· 1512 1515 struct loop_device *lo = disk->private_data; 1513 1516 int err; 1514 1517 1515 - mutex_lock(&loop_mutex); 1516 1518 mutex_lock(&lo->lo_ctl_mutex); 1517 1519 1518 1520 if (--lo->lo_refcnt) ··· 1536 1540 out: 1537 1541 mutex_unlock(&lo->lo_ctl_mutex); 1538 1542 out_unlocked: 1539 - mutex_unlock(&loop_mutex); 1540 1543 return 0; 1541 1544 } 1542 1545
+3
drivers/bluetooth/ath3k.c
··· 41 41 42 42 /* Atheros AR9285 Malbec with sflash firmware */ 43 43 { USB_DEVICE(0x03F0, 0x311D) }, 44 + 45 + /* Atheros AR5BBU12 with sflash firmware */ 46 + { USB_DEVICE(0x0489, 0xE02C) }, 44 47 { } /* Terminating entry */ 45 48 }; 46 49
+5 -4
drivers/bluetooth/btusb.c
··· 105 105 /* Atheros AR9285 Malbec with sflash firmware */ 106 106 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, 107 107 108 + /* Atheros AR5BBU12 with sflash firmware */ 109 + { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, 110 + 108 111 /* Broadcom BCM2035 */ 109 112 { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, 110 113 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, ··· 832 829 833 830 if (hdev->conn_hash.sco_num > 0) { 834 831 if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) { 835 - err = usb_autopm_get_interface(data->isoc); 832 + err = usb_autopm_get_interface(data->isoc ? data->isoc : data->intf); 836 833 if (err < 0) { 837 834 clear_bit(BTUSB_ISOC_RUNNING, &data->flags); 838 835 usb_kill_anchored_urbs(&data->isoc_anchor); ··· 861 858 862 859 __set_isoc_interface(hdev, 0); 863 860 if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags)) 864 - usb_autopm_put_interface(data->isoc); 861 + usb_autopm_put_interface(data->isoc ? data->isoc : data->intf); 865 862 } 866 863 } 867 864 ··· 1043 1040 } 1044 1041 1045 1042 usb_set_intfdata(intf, data); 1046 - 1047 - usb_enable_autosuspend(interface_to_usbdev(intf)); 1048 1043 1049 1044 return 0; 1050 1045 }
+7 -2
drivers/char/agp/amd64-agp.c
··· 773 773 #else 774 774 printk(KERN_INFO PFX "You can boot with agp=try_unsupported\n"); 775 775 #endif 776 + pci_unregister_driver(&agp_amd64_pci_driver); 776 777 return -ENODEV; 777 778 } 778 779 779 780 /* First check that we have at least one AMD64 NB */ 780 - if (!pci_dev_present(amd_nb_misc_ids)) 781 + if (!pci_dev_present(amd_nb_misc_ids)) { 782 + pci_unregister_driver(&agp_amd64_pci_driver); 781 783 return -ENODEV; 784 + } 782 785 783 786 /* Look for any AGP bridge */ 784 787 agp_amd64_pci_driver.id_table = agp_amd64_pci_promisc_table; 785 788 err = driver_attach(&agp_amd64_pci_driver.driver); 786 - if (err == 0 && agp_bridges_found == 0) 789 + if (err == 0 && agp_bridges_found == 0) { 790 + pci_unregister_driver(&agp_amd64_pci_driver); 787 791 err = -ENODEV; 792 + } 788 793 } 789 794 return err; 790 795 }
+1
drivers/char/agp/intel-agp.h
··· 130 130 #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) 131 131 132 132 #define I915_IFPADDR 0x60 133 + #define I830_HIC 0x70 133 134 134 135 /* Intel 965G registers */ 135 136 #define I965_MSAC 0x62
+21 -35
drivers/char/agp/intel-gtt.c
··· 21 21 #include <linux/kernel.h> 22 22 #include <linux/pagemap.h> 23 23 #include <linux/agp_backend.h> 24 + #include <linux/delay.h> 24 25 #include <asm/smp.h> 25 26 #include "agp.h" 26 27 #include "intel-agp.h" ··· 71 70 u32 __iomem *gtt; /* I915G */ 72 71 bool clear_fake_agp; /* on first access via agp, fill with scratch */ 73 72 int num_dcache_entries; 74 - union { 75 - void __iomem *i9xx_flush_page; 76 - void *i8xx_flush_page; 77 - }; 73 + void __iomem *i9xx_flush_page; 78 74 char *i81x_gtt_table; 79 - struct page *i8xx_page; 80 75 struct resource ifp_resource; 81 76 int resource_valid; 82 77 struct page *scratch_page; ··· 719 722 720 723 static void i830_cleanup(void) 721 724 { 722 - if (intel_private.i8xx_flush_page) { 723 - kunmap(intel_private.i8xx_flush_page); 724 - intel_private.i8xx_flush_page = NULL; 725 - } 726 - 727 - __free_page(intel_private.i8xx_page); 728 - intel_private.i8xx_page = NULL; 729 - } 730 - 731 - static void intel_i830_setup_flush(void) 732 - { 733 - /* return if we've already set the flush mechanism up */ 734 - if (intel_private.i8xx_page) 735 - return; 736 - 737 - intel_private.i8xx_page = alloc_page(GFP_KERNEL); 738 - if (!intel_private.i8xx_page) 739 - return; 740 - 741 - intel_private.i8xx_flush_page = kmap(intel_private.i8xx_page); 742 - if (!intel_private.i8xx_flush_page) 743 - i830_cleanup(); 744 725 } 745 726 746 727 /* The chipset_flush interface needs to get data that has already been ··· 733 758 */ 734 759 static void i830_chipset_flush(void) 735 760 { 736 - unsigned int *pg = intel_private.i8xx_flush_page; 761 + unsigned long timeout = jiffies + msecs_to_jiffies(1000); 737 762 738 - memset(pg, 0, 1024); 763 + /* Forcibly evict everything from the CPU write buffers. 764 + * clflush appears to be insufficient. 765 + */ 766 + wbinvd_on_all_cpus(); 739 767 740 - if (cpu_has_clflush) 741 - clflush_cache_range(pg, 1024); 742 - else if (wbinvd_on_all_cpus() != 0) 743 - printk(KERN_ERR "Timed out waiting for cache flush.\n"); 768 + /* Now we've only seen documents for this magic bit on 855GM, 769 + * we hope it exists for the other gen2 chipsets... 770 + * 771 + * Also works as advertised on my 845G. 772 + */ 773 + writel(readl(intel_private.registers+I830_HIC) | (1<<31), 774 + intel_private.registers+I830_HIC); 775 + 776 + while (readl(intel_private.registers+I830_HIC) & (1<<31)) { 777 + if (time_after(jiffies, timeout)) 778 + break; 779 + 780 + udelay(50); 781 + } 744 782 } 745 783 746 784 static void i830_write_entry(dma_addr_t addr, unsigned int entry, ··· 836 848 return -ENOMEM; 837 849 838 850 intel_private.gtt_bus_addr = reg_addr + I810_PTE_BASE; 839 - 840 - intel_i830_setup_flush(); 841 851 842 852 return 0; 843 853 }
+1 -2
drivers/char/pcmcia/cm4000_cs.c
··· 830 830 test_bit(IS_ANY_T1, &dev->flags))) { 831 831 DEBUGP(4, dev, "Perform AUTOPPS\n"); 832 832 set_bit(IS_AUTOPPS_ACT, &dev->flags); 833 - ptsreq.protocol = ptsreq.protocol = 834 - (0x01 << dev->proto); 833 + ptsreq.protocol = (0x01 << dev->proto); 835 834 ptsreq.flags = 0x01; 836 835 ptsreq.pts1 = 0x00; 837 836 ptsreq.pts2 = 0x00;
+32 -20
drivers/char/pcmcia/ipwireless/main.c
··· 78 78 static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data) 79 79 { 80 80 struct ipw_dev *ipw = priv_data; 81 - struct resource *io_resource; 82 81 int ret; 83 82 84 83 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; ··· 91 92 if (ret) 92 93 return ret; 93 94 94 - io_resource = request_region(p_dev->resource[0]->start, 95 - resource_size(p_dev->resource[0]), 96 - IPWIRELESS_PCCARD_NAME); 95 + if (!request_region(p_dev->resource[0]->start, 96 + resource_size(p_dev->resource[0]), 97 + IPWIRELESS_PCCARD_NAME)) { 98 + ret = -EBUSY; 99 + goto exit; 100 + } 97 101 98 102 p_dev->resource[2]->flags |= 99 103 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE; ··· 107 105 108 106 ret = pcmcia_map_mem_page(p_dev, p_dev->resource[2], p_dev->card_addr); 109 107 if (ret != 0) 110 - goto exit2; 108 + goto exit1; 111 109 112 110 ipw->is_v2_card = resource_size(p_dev->resource[2]) == 0x100; 113 111 114 - ipw->attr_memory = ioremap(p_dev->resource[2]->start, 112 + ipw->common_memory = ioremap(p_dev->resource[2]->start, 115 113 resource_size(p_dev->resource[2])); 116 - request_mem_region(p_dev->resource[2]->start, 117 - resource_size(p_dev->resource[2]), 118 - IPWIRELESS_PCCARD_NAME); 114 + if (!request_mem_region(p_dev->resource[2]->start, 115 + resource_size(p_dev->resource[2]), 116 + IPWIRELESS_PCCARD_NAME)) { 117 + ret = -EBUSY; 118 + goto exit2; 119 + } 119 120 120 121 p_dev->resource[3]->flags |= WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | 121 122 WIN_ENABLE; 122 123 p_dev->resource[3]->end = 0; /* this used to be 0x1000 */ 123 124 ret = pcmcia_request_window(p_dev, p_dev->resource[3], 0); 124 125 if (ret != 0) 125 - goto exit2; 126 + goto exit3; 126 127 127 128 ret = pcmcia_map_mem_page(p_dev, p_dev->resource[3], 0); 128 129 if (ret != 0) ··· 133 128 134 129 ipw->attr_memory = ioremap(p_dev->resource[3]->start, 135 130 resource_size(p_dev->resource[3])); 136 - request_mem_region(p_dev->resource[3]->start, 137 - resource_size(p_dev->resource[3]), 138 - IPWIRELESS_PCCARD_NAME); 131 + if (!request_mem_region(p_dev->resource[3]->start, 132 + resource_size(p_dev->resource[3]), 133 + IPWIRELESS_PCCARD_NAME)) { 134 + ret = -EBUSY; 135 + goto exit4; 136 + } 139 137 140 138 return 0; 141 139 140 + exit4: 141 + iounmap(ipw->attr_memory); 142 142 exit3: 143 + release_mem_region(p_dev->resource[2]->start, 144 + resource_size(p_dev->resource[2])); 143 145 exit2: 144 - if (ipw->common_memory) { 145 - release_mem_region(p_dev->resource[2]->start, 146 - resource_size(p_dev->resource[2])); 147 - iounmap(ipw->common_memory); 148 - } 146 + iounmap(ipw->common_memory); 149 147 exit1: 150 - release_resource(io_resource); 148 + release_region(p_dev->resource[0]->start, 149 + resource_size(p_dev->resource[0])); 150 + exit: 151 151 pcmcia_disable_device(p_dev); 152 - return -1; 152 + return ret; 153 153 } 154 154 155 155 static int config_ipwireless(struct ipw_dev *ipw) ··· 229 219 230 220 static void release_ipwireless(struct ipw_dev *ipw) 231 221 { 222 + release_region(ipw->link->resource[0]->start, 223 + resource_size(ipw->link->resource[0])); 232 224 if (ipw->common_memory) { 233 225 release_mem_region(ipw->link->resource[2]->start, 234 226 resource_size(ipw->link->resource[2]));
+4 -6
drivers/char/tpm/tpm.c
··· 364 364 tpm_protected_ordinal_duration[ordinal & 365 365 TPM_PROTECTED_ORDINAL_MASK]; 366 366 367 - if (duration_idx != TPM_UNDEFINED) { 367 + if (duration_idx != TPM_UNDEFINED) 368 368 duration = chip->vendor.duration[duration_idx]; 369 - /* if duration is 0, it's because chip->vendor.duration wasn't */ 370 - /* filled yet, so we set the lowest timeout just to give enough */ 371 - /* time for tpm_get_timeouts() to succeed */ 372 - return (duration <= 0 ? HZ : duration); 373 - } else 369 + if (duration <= 0) 374 370 return 2 * 60 * HZ; 371 + else 372 + return duration; 375 373 } 376 374 EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); 377 375
+8
drivers/char/virtio_console.c
··· 388 388 unsigned int len; 389 389 int ret; 390 390 391 + if (!port->portdev) { 392 + /* Device has been unplugged. vqs are already gone. */ 393 + return; 394 + } 391 395 vq = port->in_vq; 392 396 if (port->inbuf) 393 397 buf = port->inbuf; ··· 474 470 void *buf; 475 471 unsigned int len; 476 472 473 + if (!port->portdev) { 474 + /* Device has been unplugged. vqs are already gone. */ 475 + return; 476 + } 477 477 while ((buf = virtqueue_get_buf(port->out_vq, &len))) { 478 478 kfree(buf); 479 479 port->outvq_full = false;
+15 -12
drivers/cpufreq/cpufreq.c
··· 1919 1919 1920 1920 ret = sysdev_driver_register(&cpu_sysdev_class, 1921 1921 &cpufreq_sysdev_driver); 1922 + if (ret) 1923 + goto err_null_driver; 1922 1924 1923 - if ((!ret) && !(cpufreq_driver->flags & CPUFREQ_STICKY)) { 1925 + if (!(cpufreq_driver->flags & CPUFREQ_STICKY)) { 1924 1926 int i; 1925 1927 ret = -ENODEV; 1926 1928 ··· 1937 1935 if (ret) { 1938 1936 dprintk("no CPU initialized for driver %s\n", 1939 1937 driver_data->name); 1940 - sysdev_driver_unregister(&cpu_sysdev_class, 1941 - &cpufreq_sysdev_driver); 1942 - 1943 - spin_lock_irqsave(&cpufreq_driver_lock, flags); 1944 - cpufreq_driver = NULL; 1945 - spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 1938 + goto err_sysdev_unreg; 1946 1939 } 1947 1940 } 1948 1941 1949 - if (!ret) { 1950 - register_hotcpu_notifier(&cpufreq_cpu_notifier); 1951 - dprintk("driver %s up and running\n", driver_data->name); 1952 - cpufreq_debug_enable_ratelimit(); 1953 - } 1942 + register_hotcpu_notifier(&cpufreq_cpu_notifier); 1943 + dprintk("driver %s up and running\n", driver_data->name); 1944 + cpufreq_debug_enable_ratelimit(); 1954 1945 1946 + return 0; 1947 + err_sysdev_unreg: 1948 + sysdev_driver_unregister(&cpu_sysdev_class, 1949 + &cpufreq_sysdev_driver); 1950 + err_null_driver: 1951 + spin_lock_irqsave(&cpufreq_driver_lock, flags); 1952 + cpufreq_driver = NULL; 1953 + spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 1955 1954 return ret; 1956 1955 } 1957 1956 EXPORT_SYMBOL_GPL(cpufreq_register_driver);
+2 -2
drivers/gpu/drm/drm_fb_helper.c
··· 672 672 struct drm_crtc_helper_funcs *crtc_funcs; 673 673 u16 *red, *green, *blue, *transp; 674 674 struct drm_crtc *crtc; 675 - int i, rc = 0; 675 + int i, j, rc = 0; 676 676 int start; 677 677 678 678 for (i = 0; i < fb_helper->crtc_count; i++) { ··· 685 685 transp = cmap->transp; 686 686 start = cmap->start; 687 687 688 - for (i = 0; i < cmap->len; i++) { 688 + for (j = 0; j < cmap->len; j++) { 689 689 u16 hred, hgreen, hblue, htransp = 0xffff; 690 690 691 691 hred = *red++;
+16 -13
drivers/gpu/drm/drm_irq.c
··· 164 164 * available. In that case we can't account for this and just 165 165 * hope for the best. 166 166 */ 167 - if ((vblrc > 0) && (abs(diff_ns) > 1000000)) 167 + if ((vblrc > 0) && (abs64(diff_ns) > 1000000)) { 168 168 atomic_inc(&dev->_vblank_count[crtc]); 169 + smp_mb__after_atomic_inc(); 170 + } 169 171 170 172 /* Invalidate all timestamps while vblank irq's are off. */ 171 173 clear_vblank_timestamps(dev, crtc); ··· 493 491 /* Dot clock in Hz: */ 494 492 dotclock = (u64) crtc->hwmode.clock * 1000; 495 493 494 + /* Fields of interlaced scanout modes are only halve a frame duration. 495 + * Double the dotclock to get halve the frame-/line-/pixelduration. 496 + */ 497 + if (crtc->hwmode.flags & DRM_MODE_FLAG_INTERLACE) 498 + dotclock *= 2; 499 + 496 500 /* Valid dotclock? */ 497 501 if (dotclock > 0) { 498 502 /* Convert scanline length in pixels and video dot clock to ··· 609 601 if (vtotal <= 0 || vdisplay <= 0 || framedur_ns == 0) { 610 602 DRM_DEBUG("crtc %d: Noop due to uninitialized mode.\n", crtc); 611 603 return -EAGAIN; 612 - } 613 - 614 - /* Don't know yet how to handle interlaced or 615 - * double scan modes. Just no-op for now. 616 - */ 617 - if (mode->flags & (DRM_MODE_FLAG_INTERLACE | DRM_MODE_FLAG_DBLSCAN)) { 618 - DRM_DEBUG("crtc %d: Noop due to unsupported mode.\n", crtc); 619 - return -ENOTSUPP; 620 604 } 621 605 622 606 /* Get current scanout position with system timestamp. ··· 858 858 if (rc) { 859 859 tslot = atomic_read(&dev->_vblank_count[crtc]) + diff; 860 860 vblanktimestamp(dev, crtc, tslot) = t_vblank; 861 - smp_wmb(); 862 861 } 863 862 863 + smp_mb__before_atomic_inc(); 864 864 atomic_add(diff, &dev->_vblank_count[crtc]); 865 + smp_mb__after_atomic_inc(); 865 866 } 866 867 867 868 /** ··· 1012 1011 struct drm_file *file_priv) 1013 1012 { 1014 1013 struct drm_modeset_ctl *modeset = data; 1015 - int crtc, ret = 0; 1014 + int ret = 0; 1015 + unsigned int crtc; 1016 1016 1017 1017 /* If drm_vblank_init() hasn't been called yet, just no-op */ 1018 1018 if (!dev->num_crtcs) ··· 1295 1293 * e.g., due to spurious vblank interrupts. We need to 1296 1294 * ignore those for accounting. 1297 1295 */ 1298 - if (abs(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) { 1296 + if (abs64(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) { 1299 1297 /* Store new timestamp in ringbuffer. */ 1300 1298 vblanktimestamp(dev, crtc, vblcount + 1) = tvblank; 1301 - smp_wmb(); 1302 1299 1303 1300 /* Increment cooked vblank count. This also atomically commits 1304 1301 * the timestamp computed above. 1305 1302 */ 1303 + smp_mb__before_atomic_inc(); 1306 1304 atomic_inc(&dev->_vblank_count[crtc]); 1305 + smp_mb__after_atomic_inc(); 1307 1306 } else { 1308 1307 DRM_DEBUG("crtc %d: Redundant vblirq ignored. diff_ns = %d\n", 1309 1308 crtc, (int) diff_ns);
+2 -2
drivers/gpu/drm/i915/i915_debugfs.c
··· 865 865 int max_freq; 866 866 867 867 /* RPSTAT1 is in the GT power well */ 868 - __gen6_force_wake_get(dev_priv); 868 + __gen6_gt_force_wake_get(dev_priv); 869 869 870 870 seq_printf(m, "GT_PERF_STATUS: 0x%08x\n", gt_perf_status); 871 871 seq_printf(m, "RPSTAT1: 0x%08x\n", I915_READ(GEN6_RPSTAT1)); ··· 888 888 seq_printf(m, "Max non-overclocked (RP0) frequency: %dMHz\n", 889 889 max_freq * 100); 890 890 891 - __gen6_force_wake_put(dev_priv); 891 + __gen6_gt_force_wake_put(dev_priv); 892 892 } else { 893 893 seq_printf(m, "no P-state info available\n"); 894 894 }
+11
drivers/gpu/drm/i915/i915_dma.c
··· 1895 1895 if (IS_GEN2(dev)) 1896 1896 dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(30)); 1897 1897 1898 + /* 965GM sometimes incorrectly writes to hardware status page (HWS) 1899 + * using 32bit addressing, overwriting memory if HWS is located 1900 + * above 4GB. 1901 + * 1902 + * The documentation also mentions an issue with undefined 1903 + * behaviour if any general state is accessed within a page above 4GB, 1904 + * which also needs to be handled carefully. 1905 + */ 1906 + if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) 1907 + dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(32)); 1908 + 1898 1909 mmio_bar = IS_GEN2(dev) ? 1 : 0; 1899 1910 dev_priv->regs = pci_iomap(dev->pdev, mmio_bar, 0); 1900 1911 if (!dev_priv->regs) {
+15 -2
drivers/gpu/drm/i915/i915_drv.c
··· 46 46 unsigned int i915_powersave = 1; 47 47 module_param_named(powersave, i915_powersave, int, 0600); 48 48 49 + unsigned int i915_semaphores = 0; 50 + module_param_named(semaphores, i915_semaphores, int, 0600); 51 + 49 52 unsigned int i915_enable_rc6 = 0; 50 53 module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600); 51 54 ··· 257 254 } 258 255 } 259 256 260 - void __gen6_force_wake_get(struct drm_i915_private *dev_priv) 257 + void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv) 261 258 { 262 259 int count; 263 260 ··· 273 270 udelay(10); 274 271 } 275 272 276 - void __gen6_force_wake_put(struct drm_i915_private *dev_priv) 273 + void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv) 277 274 { 278 275 I915_WRITE_NOTRACE(FORCEWAKE, 0); 279 276 POSTING_READ(FORCEWAKE); 277 + } 278 + 279 + void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv) 280 + { 281 + int loop = 500; 282 + u32 fifo = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES); 283 + while (fifo < 20 && loop--) { 284 + udelay(10); 285 + fifo = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES); 286 + } 280 287 } 281 288 282 289 static int i915_drm_freeze(struct drm_device *dev)
+19 -5
drivers/gpu/drm/i915/i915_drv.h
··· 956 956 extern int i915_max_ioctl; 957 957 extern unsigned int i915_fbpercrtc; 958 958 extern unsigned int i915_powersave; 959 + extern unsigned int i915_semaphores; 959 960 extern unsigned int i915_lvds_downclock; 960 961 extern unsigned int i915_panel_use_ssc; 961 962 extern unsigned int i915_enable_rc6; ··· 1178 1177 void i915_gem_free_all_phys_object(struct drm_device *dev); 1179 1178 void i915_gem_release(struct drm_device *dev, struct drm_file *file); 1180 1179 1180 + uint32_t 1181 + i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj); 1182 + 1181 1183 /* i915_gem_gtt.c */ 1182 1184 void i915_gem_restore_gtt_mappings(struct drm_device *dev); 1183 1185 int __must_check i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj); ··· 1357 1353 * must be set to prevent GT core from power down and stale values being 1358 1354 * returned. 1359 1355 */ 1360 - void __gen6_force_wake_get(struct drm_i915_private *dev_priv); 1361 - void __gen6_force_wake_put (struct drm_i915_private *dev_priv); 1362 - static inline u32 i915_safe_read(struct drm_i915_private *dev_priv, u32 reg) 1356 + void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv); 1357 + void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv); 1358 + void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv); 1359 + 1360 + static inline u32 i915_gt_read(struct drm_i915_private *dev_priv, u32 reg) 1363 1361 { 1364 1362 u32 val; 1365 1363 1366 1364 if (dev_priv->info->gen >= 6) { 1367 - __gen6_force_wake_get(dev_priv); 1365 + __gen6_gt_force_wake_get(dev_priv); 1368 1366 val = I915_READ(reg); 1369 - __gen6_force_wake_put(dev_priv); 1367 + __gen6_gt_force_wake_put(dev_priv); 1370 1368 } else 1371 1369 val = I915_READ(reg); 1372 1370 1373 1371 return val; 1372 + } 1373 + 1374 + static inline void i915_gt_write(struct drm_i915_private *dev_priv, 1375 + u32 reg, u32 val) 1376 + { 1377 + if (dev_priv->info->gen >= 6) 1378 + __gen6_gt_wait_for_fifo(dev_priv); 1379 + I915_WRITE(reg, val); 1374 1380 } 1375 1381 1376 1382 static inline void
+1 -1
drivers/gpu/drm/i915/i915_gem.c
··· 1398 1398 * Return the required GTT alignment for an object, only taking into account 1399 1399 * unfenced tiled surface requirements. 1400 1400 */ 1401 - static uint32_t 1401 + uint32_t 1402 1402 i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj) 1403 1403 { 1404 1404 struct drm_device *dev = obj->base.dev;
+2 -2
drivers/gpu/drm/i915/i915_gem_execbuffer.c
··· 772 772 if (from == NULL || to == from) 773 773 return 0; 774 774 775 - /* XXX gpu semaphores are currently causing hard hangs on SNB mobile */ 776 - if (INTEL_INFO(obj->base.dev)->gen < 6 || IS_MOBILE(obj->base.dev)) 775 + /* XXX gpu semaphores are implicated in various hard hangs on SNB */ 776 + if (INTEL_INFO(obj->base.dev)->gen < 6 || !i915_semaphores) 777 777 return i915_gem_object_wait_rendering(obj, true); 778 778 779 779 idx = intel_ring_sync_index(from, to);
+17 -4
drivers/gpu/drm/i915/i915_gem_tiling.c
··· 349 349 (obj->gtt_offset + obj->base.size <= dev_priv->mm.gtt_mappable_end && 350 350 i915_gem_object_fence_ok(obj, args->tiling_mode)); 351 351 352 - obj->tiling_changed = true; 353 - obj->tiling_mode = args->tiling_mode; 354 - obj->stride = args->stride; 352 + /* Rebind if we need a change of alignment */ 353 + if (!obj->map_and_fenceable) { 354 + u32 unfenced_alignment = 355 + i915_gem_get_unfenced_gtt_alignment(obj); 356 + if (obj->gtt_offset & (unfenced_alignment - 1)) 357 + ret = i915_gem_object_unbind(obj); 358 + } 359 + 360 + if (ret == 0) { 361 + obj->tiling_changed = true; 362 + obj->tiling_mode = args->tiling_mode; 363 + obj->stride = args->stride; 364 + } 355 365 } 366 + /* we have to maintain this existing ABI... */ 367 + args->stride = obj->stride; 368 + args->tiling_mode = obj->tiling_mode; 356 369 drm_gem_object_unreference(&obj->base); 357 370 mutex_unlock(&dev->struct_mutex); 358 371 359 - return 0; 372 + return ret; 360 373 } 361 374 362 375 /**
+3 -3
drivers/gpu/drm/i915/i915_irq.c
··· 316 316 struct drm_mode_config *mode_config = &dev->mode_config; 317 317 struct intel_encoder *encoder; 318 318 319 + DRM_DEBUG_KMS("running encoder hotplug functions\n"); 320 + 319 321 list_for_each_entry(encoder, &mode_config->encoder_list, base.head) 320 322 if (encoder->hot_plug) 321 323 encoder->hot_plug(encoder); ··· 1651 1649 } else { 1652 1650 hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | 1653 1651 SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG; 1654 - hotplug_mask |= SDE_AUX_MASK | SDE_FDI_MASK | SDE_TRANS_MASK; 1655 - I915_WRITE(FDI_RXA_IMR, 0); 1656 - I915_WRITE(FDI_RXB_IMR, 0); 1652 + hotplug_mask |= SDE_AUX_MASK; 1657 1653 } 1658 1654 1659 1655 dev_priv->pch_irq_mask = ~hotplug_mask;
+2
drivers/gpu/drm/i915/i915_reg.h
··· 3261 3261 #define FORCEWAKE 0xA18C 3262 3262 #define FORCEWAKE_ACK 0x130090 3263 3263 3264 + #define GT_FIFO_FREE_ENTRIES 0x120008 3265 + 3264 3266 #define GEN6_RPNSWREQ 0xA008 3265 3267 #define GEN6_TURBO_DISABLE (1<<31) 3266 3268 #define GEN6_FREQUENCY(x) ((x)<<25)
+91 -12
drivers/gpu/drm/i915/intel_display.c
··· 1219 1219 u32 blt_ecoskpd; 1220 1220 1221 1221 /* Make sure blitter notifies FBC of writes */ 1222 - __gen6_force_wake_get(dev_priv); 1222 + __gen6_gt_force_wake_get(dev_priv); 1223 1223 blt_ecoskpd = I915_READ(GEN6_BLITTER_ECOSKPD); 1224 1224 blt_ecoskpd |= GEN6_BLITTER_FBC_NOTIFY << 1225 1225 GEN6_BLITTER_LOCK_SHIFT; ··· 1230 1230 GEN6_BLITTER_LOCK_SHIFT); 1231 1231 I915_WRITE(GEN6_BLITTER_ECOSKPD, blt_ecoskpd); 1232 1232 POSTING_READ(GEN6_BLITTER_ECOSKPD); 1233 - __gen6_force_wake_put(dev_priv); 1233 + __gen6_gt_force_wake_put(dev_priv); 1234 1234 } 1235 1235 1236 1236 static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval) ··· 1630 1630 struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj; 1631 1631 1632 1632 wait_event(dev_priv->pending_flip_queue, 1633 + atomic_read(&dev_priv->mm.wedged) || 1633 1634 atomic_read(&obj->pending_flip) == 0); 1634 1635 1635 1636 /* Big Hammer, we also need to ensure that any pending 1636 1637 * MI_WAIT_FOR_EVENT inside a user batch buffer on the 1637 1638 * current scanout is retired before unpinning the old 1638 1639 * framebuffer. 1640 + * 1641 + * This should only fail upon a hung GPU, in which case we 1642 + * can safely continue. 1639 1643 */ 1640 1644 ret = i915_gem_object_flush_gpu(obj, false); 1641 - if (ret) { 1642 - i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj); 1643 - mutex_unlock(&dev->struct_mutex); 1644 - return ret; 1645 - } 1645 + (void) ret; 1646 1646 } 1647 1647 1648 1648 ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y, ··· 2045 2045 atomic_read(&obj->pending_flip) == 0); 2046 2046 } 2047 2047 2048 + static bool intel_crtc_driving_pch(struct drm_crtc *crtc) 2049 + { 2050 + struct drm_device *dev = crtc->dev; 2051 + struct drm_mode_config *mode_config = &dev->mode_config; 2052 + struct intel_encoder *encoder; 2053 + 2054 + /* 2055 + * If there's a non-PCH eDP on this crtc, it must be DP_A, and that 2056 + * must be driven by its own crtc; no sharing is possible. 2057 + */ 2058 + list_for_each_entry(encoder, &mode_config->encoder_list, base.head) { 2059 + if (encoder->base.crtc != crtc) 2060 + continue; 2061 + 2062 + switch (encoder->type) { 2063 + case INTEL_OUTPUT_EDP: 2064 + if (!intel_encoder_is_pch_edp(&encoder->base)) 2065 + return false; 2066 + continue; 2067 + } 2068 + } 2069 + 2070 + return true; 2071 + } 2072 + 2048 2073 static void ironlake_crtc_enable(struct drm_crtc *crtc) 2049 2074 { 2050 2075 struct drm_device *dev = crtc->dev; ··· 2078 2053 int pipe = intel_crtc->pipe; 2079 2054 int plane = intel_crtc->plane; 2080 2055 u32 reg, temp; 2056 + bool is_pch_port = false; 2081 2057 2082 2058 if (intel_crtc->active) 2083 2059 return; ··· 2092 2066 I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN); 2093 2067 } 2094 2068 2095 - ironlake_fdi_enable(crtc); 2069 + is_pch_port = intel_crtc_driving_pch(crtc); 2070 + 2071 + if (is_pch_port) 2072 + ironlake_fdi_enable(crtc); 2073 + else { 2074 + /* disable CPU FDI tx and PCH FDI rx */ 2075 + reg = FDI_TX_CTL(pipe); 2076 + temp = I915_READ(reg); 2077 + I915_WRITE(reg, temp & ~FDI_TX_ENABLE); 2078 + POSTING_READ(reg); 2079 + 2080 + reg = FDI_RX_CTL(pipe); 2081 + temp = I915_READ(reg); 2082 + temp &= ~(0x7 << 16); 2083 + temp |= (I915_READ(PIPECONF(pipe)) & PIPE_BPC_MASK) << 11; 2084 + I915_WRITE(reg, temp & ~FDI_RX_ENABLE); 2085 + 2086 + POSTING_READ(reg); 2087 + udelay(100); 2088 + 2089 + /* Ironlake workaround, disable clock pointer after downing FDI */ 2090 + if (HAS_PCH_IBX(dev)) 2091 + I915_WRITE(FDI_RX_CHICKEN(pipe), 2092 + I915_READ(FDI_RX_CHICKEN(pipe) & 2093 + ~FDI_RX_PHASE_SYNC_POINTER_ENABLE)); 2094 + 2095 + /* still set train pattern 1 */ 2096 + reg = FDI_TX_CTL(pipe); 2097 + temp = I915_READ(reg); 2098 + temp &= ~FDI_LINK_TRAIN_NONE; 2099 + temp |= FDI_LINK_TRAIN_PATTERN_1; 2100 + I915_WRITE(reg, temp); 2101 + 2102 + reg = FDI_RX_CTL(pipe); 2103 + temp = I915_READ(reg); 2104 + if (HAS_PCH_CPT(dev)) { 2105 + temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT; 2106 + temp |= FDI_LINK_TRAIN_PATTERN_1_CPT; 2107 + } else { 2108 + temp &= ~FDI_LINK_TRAIN_NONE; 2109 + temp |= FDI_LINK_TRAIN_PATTERN_1; 2110 + } 2111 + /* BPC in FDI rx is consistent with that in PIPECONF */ 2112 + temp &= ~(0x07 << 16); 2113 + temp |= (I915_READ(PIPECONF(pipe)) & PIPE_BPC_MASK) << 11; 2114 + I915_WRITE(reg, temp); 2115 + 2116 + POSTING_READ(reg); 2117 + udelay(100); 2118 + } 2096 2119 2097 2120 /* Enable panel fitting for LVDS */ 2098 2121 if (dev_priv->pch_pf_size && ··· 2174 2099 I915_WRITE(reg, temp | DISPLAY_PLANE_ENABLE); 2175 2100 intel_flush_display_plane(dev, plane); 2176 2101 } 2102 + 2103 + /* Skip the PCH stuff if possible */ 2104 + if (!is_pch_port) 2105 + goto done; 2177 2106 2178 2107 /* For PCH output, training FDI link */ 2179 2108 if (IS_GEN6(dev)) ··· 2263 2184 I915_WRITE(reg, temp | TRANS_ENABLE); 2264 2185 if (wait_for(I915_READ(reg) & TRANS_STATE_ENABLE, 100)) 2265 2186 DRM_ERROR("failed to enable transcoder %d\n", pipe); 2266 - 2187 + done: 2267 2188 intel_crtc_load_lut(crtc); 2268 2189 intel_update_fbc(dev); 2269 2190 intel_crtc_update_cursor(crtc, true); ··· 6282 6203 * userspace... 6283 6204 */ 6284 6205 I915_WRITE(GEN6_RC_STATE, 0); 6285 - __gen6_force_wake_get(dev_priv); 6206 + __gen6_gt_force_wake_get(dev_priv); 6286 6207 6287 6208 /* disable the counters and set deterministic thresholds */ 6288 6209 I915_WRITE(GEN6_RC_CONTROL, 0); ··· 6380 6301 /* enable all PM interrupts */ 6381 6302 I915_WRITE(GEN6_PMINTRMSK, 0); 6382 6303 6383 - __gen6_force_wake_put(dev_priv); 6304 + __gen6_gt_force_wake_put(dev_priv); 6384 6305 } 6385 6306 6386 6307 void intel_enable_clock_gating(struct drm_device *dev) ··· 6575 6496 POSTING_READ(RSTDBYCTL); 6576 6497 } 6577 6498 6578 - ironlake_disable_rc6(dev); 6499 + ironlake_teardown_rc6(dev); 6579 6500 } 6580 6501 6581 6502 static int ironlake_setup_rc6(struct drm_device *dev)
+7 -6
drivers/gpu/drm/i915/intel_ringbuffer.h
··· 14 14 struct drm_i915_gem_object *obj; 15 15 }; 16 16 17 - #define I915_RING_READ(reg) i915_safe_read(dev_priv, reg) 17 + #define I915_RING_READ(reg) i915_gt_read(dev_priv, reg) 18 + #define I915_RING_WRITE(reg, val) i915_gt_write(dev_priv, reg, val) 18 19 19 20 #define I915_READ_TAIL(ring) I915_RING_READ(RING_TAIL((ring)->mmio_base)) 20 - #define I915_WRITE_TAIL(ring, val) I915_WRITE(RING_TAIL((ring)->mmio_base), val) 21 + #define I915_WRITE_TAIL(ring, val) I915_RING_WRITE(RING_TAIL((ring)->mmio_base), val) 21 22 22 23 #define I915_READ_START(ring) I915_RING_READ(RING_START((ring)->mmio_base)) 23 - #define I915_WRITE_START(ring, val) I915_WRITE(RING_START((ring)->mmio_base), val) 24 + #define I915_WRITE_START(ring, val) I915_RING_WRITE(RING_START((ring)->mmio_base), val) 24 25 25 26 #define I915_READ_HEAD(ring) I915_RING_READ(RING_HEAD((ring)->mmio_base)) 26 - #define I915_WRITE_HEAD(ring, val) I915_WRITE(RING_HEAD((ring)->mmio_base), val) 27 + #define I915_WRITE_HEAD(ring, val) I915_RING_WRITE(RING_HEAD((ring)->mmio_base), val) 27 28 28 29 #define I915_READ_CTL(ring) I915_RING_READ(RING_CTL((ring)->mmio_base)) 29 - #define I915_WRITE_CTL(ring, val) I915_WRITE(RING_CTL((ring)->mmio_base), val) 30 + #define I915_WRITE_CTL(ring, val) I915_RING_WRITE(RING_CTL((ring)->mmio_base), val) 30 31 31 - #define I915_WRITE_IMR(ring, val) I915_WRITE(RING_IMR((ring)->mmio_base), val) 32 32 #define I915_READ_IMR(ring) I915_RING_READ(RING_IMR((ring)->mmio_base)) 33 + #define I915_WRITE_IMR(ring, val) I915_RING_WRITE(RING_IMR((ring)->mmio_base), val) 33 34 34 35 #define I915_READ_NOPID(ring) I915_RING_READ(RING_NOPID((ring)->mmio_base)) 35 36 #define I915_READ_SYNC_0(ring) I915_RING_READ(RING_SYNC_0((ring)->mmio_base))
+4 -1
drivers/gpu/drm/nouveau/nouveau_bo.c
··· 49 49 DRM_ERROR("bo %p still attached to GEM object\n", bo); 50 50 51 51 nv10_mem_put_tile_region(dev, nvbo->tile, NULL); 52 - nouveau_vm_put(&nvbo->vma); 52 + if (nvbo->vma.node) { 53 + nouveau_vm_unmap(&nvbo->vma); 54 + nouveau_vm_put(&nvbo->vma); 55 + } 53 56 kfree(nvbo); 54 57 } 55 58
+2 -1
drivers/gpu/drm/nouveau/nouveau_dma.c
··· 83 83 return ret; 84 84 85 85 /* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier object */ 86 - ret = nouveau_notifier_alloc(chan, NvNotify0, 32, &chan->m2mf_ntfy); 86 + ret = nouveau_notifier_alloc(chan, NvNotify0, 32, 0xfd0, 0x1000, 87 + &chan->m2mf_ntfy); 87 88 if (ret) 88 89 return ret; 89 90
+2 -1
drivers/gpu/drm/nouveau/nouveau_drv.h
··· 852 852 extern int nouveau_notifier_init_channel(struct nouveau_channel *); 853 853 extern void nouveau_notifier_takedown_channel(struct nouveau_channel *); 854 854 extern int nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, 855 - int cout, uint32_t *offset); 855 + int cout, uint32_t start, uint32_t end, 856 + uint32_t *offset); 856 857 extern int nouveau_notifier_offset(struct nouveau_gpuobj *, uint32_t *); 857 858 extern int nouveau_ioctl_notifier_alloc(struct drm_device *, void *data, 858 859 struct drm_file *);
+4 -2
drivers/gpu/drm/nouveau/nouveau_mem.c
··· 725 725 ret = vram->get(dev, mem->num_pages << PAGE_SHIFT, 726 726 mem->page_alignment << PAGE_SHIFT, size_nc, 727 727 (nvbo->tile_flags >> 8) & 0xff, &node); 728 - if (ret) 729 - return ret; 728 + if (ret) { 729 + mem->mm_node = NULL; 730 + return (ret == -ENOSPC) ? 0 : ret; 731 + } 730 732 731 733 node->page_shift = 12; 732 734 if (nvbo->vma.node)
+1 -1
drivers/gpu/drm/nouveau/nouveau_mm.c
··· 123 123 return 0; 124 124 } 125 125 126 - return -ENOMEM; 126 + return -ENOSPC; 127 127 } 128 128 129 129 int
+7 -4
drivers/gpu/drm/nouveau/nouveau_notifier.c
··· 96 96 97 97 int 98 98 nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, 99 - int size, uint32_t *b_offset) 99 + int size, uint32_t start, uint32_t end, 100 + uint32_t *b_offset) 100 101 { 101 102 struct drm_device *dev = chan->dev; 102 103 struct nouveau_gpuobj *nobj = NULL; ··· 105 104 uint32_t offset; 106 105 int target, ret; 107 106 108 - mem = drm_mm_search_free(&chan->notifier_heap, size, 0, 0); 107 + mem = drm_mm_search_free_in_range(&chan->notifier_heap, size, 0, 108 + start, end, 0); 109 109 if (mem) 110 - mem = drm_mm_get_block(mem, size, 0); 110 + mem = drm_mm_get_block_range(mem, size, 0, start, end); 111 111 if (!mem) { 112 112 NV_ERROR(dev, "Channel %d notifier block full\n", chan->id); 113 113 return -ENOMEM; ··· 179 177 if (IS_ERR(chan)) 180 178 return PTR_ERR(chan); 181 179 182 - ret = nouveau_notifier_alloc(chan, na->handle, na->size, &na->offset); 180 + ret = nouveau_notifier_alloc(chan, na->handle, na->size, 0, 0x1000, 181 + &na->offset); 183 182 nouveau_channel_put(&chan); 184 183 return ret; 185 184 }
+8
drivers/gpu/drm/nouveau/nv50_instmem.c
··· 403 403 void 404 404 nv50_instmem_flush(struct drm_device *dev) 405 405 { 406 + struct drm_nouveau_private *dev_priv = dev->dev_private; 407 + 408 + spin_lock(&dev_priv->ramin_lock); 406 409 nv_wr32(dev, 0x00330c, 0x00000001); 407 410 if (!nv_wait(dev, 0x00330c, 0x00000002, 0x00000000)) 408 411 NV_ERROR(dev, "PRAMIN flush timeout\n"); 412 + spin_unlock(&dev_priv->ramin_lock); 409 413 } 410 414 411 415 void 412 416 nv84_instmem_flush(struct drm_device *dev) 413 417 { 418 + struct drm_nouveau_private *dev_priv = dev->dev_private; 419 + 420 + spin_lock(&dev_priv->ramin_lock); 414 421 nv_wr32(dev, 0x070000, 0x00000001); 415 422 if (!nv_wait(dev, 0x070000, 0x00000002, 0x00000000)) 416 423 NV_ERROR(dev, "PRAMIN flush timeout\n"); 424 + spin_unlock(&dev_priv->ramin_lock); 417 425 } 418 426
+4
drivers/gpu/drm/nouveau/nv50_vm.c
··· 169 169 void 170 170 nv50_vm_flush_engine(struct drm_device *dev, int engine) 171 171 { 172 + struct drm_nouveau_private *dev_priv = dev->dev_private; 173 + 174 + spin_lock(&dev_priv->ramin_lock); 172 175 nv_wr32(dev, 0x100c80, (engine << 16) | 1); 173 176 if (!nv_wait(dev, 0x100c80, 0x00000001, 0x00000000)) 174 177 NV_ERROR(dev, "vm flush timeout: engine %d\n", engine); 178 + spin_unlock(&dev_priv->ramin_lock); 175 179 }
+1 -3
drivers/gpu/drm/radeon/r100.c
··· 3490 3490 track->num_texture = 16; 3491 3491 track->maxy = 4096; 3492 3492 track->separate_cube = 0; 3493 - track->aaresolve = true; 3493 + track->aaresolve = false; 3494 3494 track->aa.robj = NULL; 3495 3495 } 3496 3496 ··· 3801 3801 r100_mc_program(rdev); 3802 3802 /* Resume clock */ 3803 3803 r100_clock_startup(rdev); 3804 - /* Initialize GPU configuration (# pipes, ...) */ 3805 - // r100_gpu_init(rdev); 3806 3804 /* Initialize GART (initialize after TTM so we can allocate 3807 3805 * memory through TTM but finalize after TTM) */ 3808 3806 r100_enable_bm(rdev);
+1 -1
drivers/gpu/drm/radeon/radeon_display.c
··· 971 971 max_fractional_feed_div = pll->max_frac_feedback_div; 972 972 } 973 973 974 - for (post_div = min_post_div; post_div <= max_post_div; ++post_div) { 974 + for (post_div = max_post_div; post_div >= min_post_div; --post_div) { 975 975 uint32_t ref_div; 976 976 977 977 if ((pll->flags & RADEON_PLL_NO_ODD_POST_DIV) && (post_div & 1))
+4 -1
drivers/gpu/drm/radeon/radeon_fb.c
··· 113 113 u32 tiling_flags = 0; 114 114 int ret; 115 115 int aligned_size, size; 116 + int height = mode_cmd->height; 116 117 117 118 /* need to align pitch with crtc limits */ 118 119 mode_cmd->pitch = radeon_align_pitch(rdev, mode_cmd->width, mode_cmd->bpp, fb_tiled) * ((mode_cmd->bpp + 1) / 8); 119 120 120 - size = mode_cmd->pitch * mode_cmd->height; 121 + if (rdev->family >= CHIP_R600) 122 + height = ALIGN(mode_cmd->height, 8); 123 + size = mode_cmd->pitch * height; 121 124 aligned_size = ALIGN(size, PAGE_SIZE); 122 125 ret = radeon_gem_object_create(rdev, aligned_size, 0, 123 126 RADEON_GEM_DOMAIN_VRAM,
+1
drivers/hwmon/ad7414.c
··· 242 242 { "ad7414", 0 }, 243 243 {} 244 244 }; 245 + MODULE_DEVICE_TABLE(i2c, ad7414_id); 245 246 246 247 static struct i2c_driver ad7414_driver = { 247 248 .driver = {
+1
drivers/hwmon/adt7411.c
··· 334 334 { "adt7411", 0 }, 335 335 { } 336 336 }; 337 + MODULE_DEVICE_TABLE(i2c, adt7411_id); 337 338 338 339 static struct i2c_driver adt7411_driver = { 339 340 .driver = {
+34 -1
drivers/i2c/busses/i2c-omap.c
··· 847 847 dev_err(dev->dev, "Arbitration lost\n"); 848 848 err |= OMAP_I2C_STAT_AL; 849 849 } 850 + /* 851 + * ProDB0017052: Clear ARDY bit twice 852 + */ 850 853 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | 851 854 OMAP_I2C_STAT_AL)) { 852 855 omap_i2c_ack_stat(dev, stat & 853 856 (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR | 854 - OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR)); 857 + OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR | 858 + OMAP_I2C_STAT_ARDY)); 855 859 omap_i2c_complete_cmd(dev, err); 856 860 return IRQ_HANDLED; 857 861 } ··· 1141 1137 return 0; 1142 1138 } 1143 1139 1140 + #ifdef CONFIG_SUSPEND 1141 + static int omap_i2c_suspend(struct device *dev) 1142 + { 1143 + if (!pm_runtime_suspended(dev)) 1144 + if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_suspend) 1145 + dev->bus->pm->runtime_suspend(dev); 1146 + 1147 + return 0; 1148 + } 1149 + 1150 + static int omap_i2c_resume(struct device *dev) 1151 + { 1152 + if (!pm_runtime_suspended(dev)) 1153 + if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_resume) 1154 + dev->bus->pm->runtime_resume(dev); 1155 + 1156 + return 0; 1157 + } 1158 + 1159 + static struct dev_pm_ops omap_i2c_pm_ops = { 1160 + .suspend = omap_i2c_suspend, 1161 + .resume = omap_i2c_resume, 1162 + }; 1163 + #define OMAP_I2C_PM_OPS (&omap_i2c_pm_ops) 1164 + #else 1165 + #define OMAP_I2C_PM_OPS NULL 1166 + #endif 1167 + 1144 1168 static struct platform_driver omap_i2c_driver = { 1145 1169 .probe = omap_i2c_probe, 1146 1170 .remove = omap_i2c_remove, 1147 1171 .driver = { 1148 1172 .name = "omap_i2c", 1149 1173 .owner = THIS_MODULE, 1174 + .pm = OMAP_I2C_PM_OPS, 1150 1175 }, 1151 1176 }; 1152 1177
+1 -1
drivers/i2c/busses/i2c-stu300.c
··· 942 942 adap->owner = THIS_MODULE; 943 943 /* DDC class but actually often used for more generic I2C */ 944 944 adap->class = I2C_CLASS_DDC; 945 - strncpy(adap->name, "ST Microelectronics DDC I2C adapter", 945 + strlcpy(adap->name, "ST Microelectronics DDC I2C adapter", 946 946 sizeof(adap->name)); 947 947 adap->nr = bus_nr; 948 948 adap->algo = &stu300_algo;
+24
drivers/idle/intel_idle.c
··· 62 62 #include <linux/notifier.h> 63 63 #include <linux/cpu.h> 64 64 #include <asm/mwait.h> 65 + #include <asm/msr.h> 65 66 66 67 #define INTEL_IDLE_VERSION "0.4" 67 68 #define PREFIX "intel_idle: " ··· 84 83 static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state); 85 84 86 85 static struct cpuidle_state *cpuidle_state_table; 86 + 87 + /* 88 + * Hardware C-state auto-demotion may not always be optimal. 89 + * Indicate which enable bits to clear here. 90 + */ 91 + static unsigned long long auto_demotion_disable_flags; 87 92 88 93 /* 89 94 * Set this flag for states where the HW flushes the TLB for us ··· 288 281 .notifier_call = setup_broadcast_cpuhp_notify, 289 282 }; 290 283 284 + static void auto_demotion_disable(void *dummy) 285 + { 286 + unsigned long long msr_bits; 287 + 288 + rdmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits); 289 + msr_bits &= ~auto_demotion_disable_flags; 290 + wrmsrl(MSR_NHM_SNB_PKG_CST_CFG_CTL, msr_bits); 291 + } 292 + 291 293 /* 292 294 * intel_idle_probe() 293 295 */ ··· 340 324 case 0x25: /* Westmere */ 341 325 case 0x2C: /* Westmere */ 342 326 cpuidle_state_table = nehalem_cstates; 327 + auto_demotion_disable_flags = 328 + (NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE); 343 329 break; 344 330 345 331 case 0x1C: /* 28 - Atom Processor */ 332 + cpuidle_state_table = atom_cstates; 333 + break; 334 + 346 335 case 0x26: /* 38 - Lincroft Atom Processor */ 347 336 cpuidle_state_table = atom_cstates; 337 + auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE; 348 338 break; 349 339 350 340 case 0x2A: /* SNB */ ··· 458 436 return -EIO; 459 437 } 460 438 } 439 + if (auto_demotion_disable_flags) 440 + smp_call_function(auto_demotion_disable, NULL, 1); 461 441 462 442 return 0; 463 443 }
+1 -1
drivers/input/gameport/gameport.c
··· 360 360 event->owner = owner; 361 361 362 362 list_add_tail(&event->node, &gameport_event_list); 363 - schedule_work(&gameport_event_work); 363 + queue_work(system_long_wq, &gameport_event_work); 364 364 365 365 out: 366 366 spin_unlock_irqrestore(&gameport_event_lock, flags);
+59 -3
drivers/input/keyboard/tegra-kbc.c
··· 71 71 spinlock_t lock; 72 72 unsigned int repoll_dly; 73 73 unsigned long cp_dly_jiffies; 74 + bool use_fn_map; 74 75 const struct tegra_kbc_platform_data *pdata; 75 - unsigned short keycode[KBC_MAX_KEY]; 76 + unsigned short keycode[KBC_MAX_KEY * 2]; 76 77 unsigned short current_keys[KBC_MAX_KPENT]; 77 78 unsigned int num_pressed_keys; 78 79 struct timer_list timer; ··· 179 178 KEY(15, 5, KEY_F2), 180 179 KEY(15, 6, KEY_CAPSLOCK), 181 180 KEY(15, 7, KEY_F6), 181 + 182 + /* Software Handled Function Keys */ 183 + KEY(20, 0, KEY_KP7), 184 + 185 + KEY(21, 0, KEY_KP9), 186 + KEY(21, 1, KEY_KP8), 187 + KEY(21, 2, KEY_KP4), 188 + KEY(21, 4, KEY_KP1), 189 + 190 + KEY(22, 1, KEY_KPSLASH), 191 + KEY(22, 2, KEY_KP6), 192 + KEY(22, 3, KEY_KP5), 193 + KEY(22, 4, KEY_KP3), 194 + KEY(22, 5, KEY_KP2), 195 + KEY(22, 7, KEY_KP0), 196 + 197 + KEY(27, 1, KEY_KPASTERISK), 198 + KEY(27, 3, KEY_KPMINUS), 199 + KEY(27, 4, KEY_KPPLUS), 200 + KEY(27, 5, KEY_KPDOT), 201 + 202 + KEY(28, 5, KEY_VOLUMEUP), 203 + 204 + KEY(29, 3, KEY_HOME), 205 + KEY(29, 4, KEY_END), 206 + KEY(29, 5, KEY_BRIGHTNESSDOWN), 207 + KEY(29, 6, KEY_VOLUMEDOWN), 208 + KEY(29, 7, KEY_BRIGHTNESSUP), 209 + 210 + KEY(30, 0, KEY_NUMLOCK), 211 + KEY(30, 1, KEY_SCROLLLOCK), 212 + KEY(30, 2, KEY_MUTE), 213 + 214 + KEY(31, 4, KEY_HELP), 182 215 }; 183 216 184 217 static const struct matrix_keymap_data tegra_kbc_default_keymap_data = { ··· 259 224 unsigned int i; 260 225 unsigned int num_down = 0; 261 226 unsigned long flags; 227 + bool fn_keypress = false; 262 228 263 229 spin_lock_irqsave(&kbc->lock, flags); 264 230 for (i = 0; i < KBC_MAX_KPENT; i++) { ··· 273 237 MATRIX_SCAN_CODE(row, col, KBC_ROW_SHIFT); 274 238 275 239 scancodes[num_down] = scancode; 276 - keycodes[num_down++] = kbc->keycode[scancode]; 240 + keycodes[num_down] = kbc->keycode[scancode]; 241 + /* If driver uses Fn map, do not report the Fn key. */ 242 + if ((keycodes[num_down] == KEY_FN) && kbc->use_fn_map) 243 + fn_keypress = true; 244 + else 245 + num_down++; 277 246 } 278 247 279 248 val >>= 8; 280 249 } 250 + 251 + /* 252 + * If the platform uses Fn keymaps, translate keys on a Fn keypress. 253 + * Function keycodes are KBC_MAX_KEY apart from the plain keycodes. 254 + */ 255 + if (fn_keypress) { 256 + for (i = 0; i < num_down; i++) { 257 + scancodes[i] += KBC_MAX_KEY; 258 + keycodes[i] = kbc->keycode[scancodes[i]]; 259 + } 260 + } 261 + 281 262 spin_unlock_irqrestore(&kbc->lock, flags); 282 263 283 264 tegra_kbc_report_released_keys(kbc->idev, ··· 647 594 648 595 input_dev->keycode = kbc->keycode; 649 596 input_dev->keycodesize = sizeof(kbc->keycode[0]); 650 - input_dev->keycodemax = ARRAY_SIZE(kbc->keycode); 597 + input_dev->keycodemax = KBC_MAX_KEY; 598 + if (pdata->use_fn_map) 599 + input_dev->keycodemax *= 2; 651 600 601 + kbc->use_fn_map = pdata->use_fn_map; 652 602 keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data; 653 603 matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT, 654 604 input_dev->keycode, input_dev->keybit);
+23
drivers/input/mouse/synaptics.h
··· 51 51 #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) 52 52 #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) 53 53 #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) 54 + 55 + /* 56 + * The following describes response for the 0x0c query. 57 + * 58 + * byte mask name meaning 59 + * ---- ---- ------- ------------ 60 + * 1 0x01 adjustable threshold capacitive button sensitivity 61 + * can be adjusted 62 + * 1 0x02 report max query 0x0d gives max coord reported 63 + * 1 0x04 clearpad sensor is ClearPad product 64 + * 1 0x08 advanced gesture not particularly meaningful 65 + * 1 0x10 clickpad bit 0 1-button ClickPad 66 + * 1 0x60 multifinger mode identifies firmware finger counting 67 + * (not reporting!) algorithm. 68 + * Not particularly meaningful 69 + * 1 0x80 covered pad W clipped to 14, 15 == pad mostly covered 70 + * 2 0x01 clickpad bit 1 2-button ClickPad 71 + * 2 0x02 deluxe LED controls touchpad support LED commands 72 + * ala multimedia control bar 73 + * 2 0x04 reduced filtering firmware does less filtering on 74 + * position data, driver should watch 75 + * for noise. 76 + */ 54 77 #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ 55 78 #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ 56 79 #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000)
+1 -1
drivers/input/serio/serio.c
··· 299 299 event->owner = owner; 300 300 301 301 list_add_tail(&event->node, &serio_event_list); 302 - schedule_work(&serio_event_work); 302 + queue_work(system_long_wq, &serio_event_work); 303 303 304 304 out: 305 305 spin_unlock_irqrestore(&serio_event_lock, flags);
+1 -1
drivers/isdn/hardware/eicon/istream.c
··· 62 62 stream interface. 63 63 If synchronous service was requested, then function 64 64 does return amount of data written to stream. 65 - 'final' does indicate that pice of data to be written is 65 + 'final' does indicate that piece of data to be written is 66 66 final part of frame (necessary only by structured datatransfer) 67 67 return 0 if zero lengh packet was written 68 68 return -1 if stream is full
-1
drivers/md/linear.c
··· 216 216 217 217 if (md_check_no_bitmap(mddev)) 218 218 return -EINVAL; 219 - mddev->queue->queue_lock = &mddev->queue->__queue_lock; 220 219 conf = linear_conf(mddev, mddev->raid_disks); 221 220 222 221 if (!conf)
+27 -4
drivers/md/md.c
··· 553 553 { 554 554 mddev_t *mddev, *new = NULL; 555 555 556 + if (unit && MAJOR(unit) != MD_MAJOR) 557 + unit &= ~((1<<MdpMinorShift)-1); 558 + 556 559 retry: 557 560 spin_lock(&all_mddevs_lock); 558 561 ··· 4141 4138 } 4142 4139 4143 4140 mddev->array_sectors = sectors; 4144 - set_capacity(mddev->gendisk, mddev->array_sectors); 4145 - if (mddev->pers) 4141 + if (mddev->pers) { 4142 + set_capacity(mddev->gendisk, mddev->array_sectors); 4146 4143 revalidate_disk(mddev->gendisk); 4147 - 4144 + } 4148 4145 return len; 4149 4146 } 4150 4147 ··· 4627 4624 } 4628 4625 set_capacity(mddev->gendisk, mddev->array_sectors); 4629 4626 revalidate_disk(mddev->gendisk); 4627 + mddev->changed = 1; 4630 4628 kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); 4631 4629 out: 4632 4630 return err; ··· 4716 4712 mddev->sync_speed_min = mddev->sync_speed_max = 0; 4717 4713 mddev->recovery = 0; 4718 4714 mddev->in_sync = 0; 4715 + mddev->changed = 0; 4719 4716 mddev->degraded = 0; 4720 4717 mddev->safemode = 0; 4721 4718 mddev->bitmap_info.offset = 0; ··· 4832 4827 4833 4828 set_capacity(disk, 0); 4834 4829 mutex_unlock(&mddev->open_mutex); 4830 + mddev->changed = 1; 4835 4831 revalidate_disk(disk); 4836 4832 4837 4833 if (mddev->ro) ··· 6017 6011 atomic_inc(&mddev->openers); 6018 6012 mutex_unlock(&mddev->open_mutex); 6019 6013 6020 - check_disk_size_change(mddev->gendisk, bdev); 6014 + check_disk_change(bdev); 6021 6015 out: 6022 6016 return err; 6023 6017 } ··· 6032 6026 6033 6027 return 0; 6034 6028 } 6029 + 6030 + static int md_media_changed(struct gendisk *disk) 6031 + { 6032 + mddev_t *mddev = disk->private_data; 6033 + 6034 + return mddev->changed; 6035 + } 6036 + 6037 + static int md_revalidate(struct gendisk *disk) 6038 + { 6039 + mddev_t *mddev = disk->private_data; 6040 + 6041 + mddev->changed = 0; 6042 + return 0; 6043 + } 6035 6044 static const struct block_device_operations md_fops = 6036 6045 { 6037 6046 .owner = THIS_MODULE, ··· 6057 6036 .compat_ioctl = md_compat_ioctl, 6058 6037 #endif 6059 6038 .getgeo = md_getgeo, 6039 + .media_changed = md_media_changed, 6040 + .revalidate_disk= md_revalidate, 6060 6041 }; 6061 6042 6062 6043 static int md_thread(void * arg)
+2
drivers/md/md.h
··· 274 274 atomic_t active; /* general refcount */ 275 275 atomic_t openers; /* number of active opens */ 276 276 277 + int changed; /* True if we might need to 278 + * reread partition info */ 277 279 int degraded; /* whether md should consider 278 280 * adding a spare 279 281 */
-1
drivers/md/multipath.c
··· 435 435 * bookkeeping area. [whatever we allocate in multipath_run(), 436 436 * should be freed in multipath_stop()] 437 437 */ 438 - mddev->queue->queue_lock = &mddev->queue->__queue_lock; 439 438 440 439 conf = kzalloc(sizeof(multipath_conf_t), GFP_KERNEL); 441 440 mddev->private = conf;
+1 -1
drivers/md/raid0.c
··· 361 361 if (md_check_no_bitmap(mddev)) 362 362 return -EINVAL; 363 363 blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors); 364 - mddev->queue->queue_lock = &mddev->queue->__queue_lock; 365 364 366 365 /* if private is not null, we are here after takeover */ 367 366 if (mddev->private == NULL) { ··· 669 670 mddev->new_layout = 0; 670 671 mddev->new_chunk_sectors = 128; /* by default set chunk size to 64k */ 671 672 mddev->delta_disks = 1 - mddev->raid_disks; 673 + mddev->raid_disks = 1; 672 674 /* make sure it will be not marked as dirty */ 673 675 mddev->recovery_cp = MaxSector; 674 676
+4 -2
drivers/md/raid1.c
··· 593 593 if (conf->pending_bio_list.head) { 594 594 struct bio *bio; 595 595 bio = bio_list_get(&conf->pending_bio_list); 596 + /* Only take the spinlock to quiet a warning */ 597 + spin_lock(conf->mddev->queue->queue_lock); 596 598 blk_remove_plug(conf->mddev->queue); 599 + spin_unlock(conf->mddev->queue->queue_lock); 597 600 spin_unlock_irq(&conf->device_lock); 598 601 /* flush any pending bitmap writes to 599 602 * disk before proceeding w/ I/O */ ··· 962 959 atomic_inc(&r1_bio->remaining); 963 960 spin_lock_irqsave(&conf->device_lock, flags); 964 961 bio_list_add(&conf->pending_bio_list, mbio); 965 - blk_plug_device(mddev->queue); 962 + blk_plug_device_unlocked(mddev->queue); 966 963 spin_unlock_irqrestore(&conf->device_lock, flags); 967 964 } 968 965 r1_bio_write_done(r1_bio, bio->bi_vcnt, behind_pages, behind_pages != NULL); ··· 2024 2021 if (IS_ERR(conf)) 2025 2022 return PTR_ERR(conf); 2026 2023 2027 - mddev->queue->queue_lock = &conf->device_lock; 2028 2024 list_for_each_entry(rdev, &mddev->disks, same_set) { 2029 2025 disk_stack_limits(mddev->gendisk, rdev->bdev, 2030 2026 rdev->data_offset << 9);
+4 -3
drivers/md/raid10.c
··· 662 662 if (conf->pending_bio_list.head) { 663 663 struct bio *bio; 664 664 bio = bio_list_get(&conf->pending_bio_list); 665 + /* Spinlock only taken to quiet a warning */ 666 + spin_lock(conf->mddev->queue->queue_lock); 665 667 blk_remove_plug(conf->mddev->queue); 668 + spin_unlock(conf->mddev->queue->queue_lock); 666 669 spin_unlock_irq(&conf->device_lock); 667 670 /* flush any pending bitmap writes to disk 668 671 * before proceeding w/ I/O */ ··· 974 971 atomic_inc(&r10_bio->remaining); 975 972 spin_lock_irqsave(&conf->device_lock, flags); 976 973 bio_list_add(&conf->pending_bio_list, mbio); 977 - blk_plug_device(mddev->queue); 974 + blk_plug_device_unlocked(mddev->queue); 978 975 spin_unlock_irqrestore(&conf->device_lock, flags); 979 976 } 980 977 ··· 2306 2303 conf = mddev->private; 2307 2304 if (!conf) 2308 2305 goto out; 2309 - 2310 - mddev->queue->queue_lock = &conf->device_lock; 2311 2306 2312 2307 mddev->thread = conf->thread; 2313 2308 conf->thread = NULL;
-1
drivers/md/raid5.c
··· 5204 5204 5205 5205 mddev->queue->backing_dev_info.congested_data = mddev; 5206 5206 mddev->queue->backing_dev_info.congested_fn = raid5_congested; 5207 - mddev->queue->queue_lock = &conf->device_lock; 5208 5207 mddev->queue->unplug_fn = raid5_unplug_queue; 5209 5208 5210 5209 chunk_size = mddev->chunk_sectors << 9;
+2 -2
drivers/mfd/asic3.c
··· 143 143 unsigned long flags; 144 144 struct asic3 *asic; 145 145 146 - desc->chip->ack(irq); 146 + desc->irq_data.chip->irq_ack(&desc->irq_data); 147 147 148 - asic = desc->handler_data; 148 + asic = get_irq_data(irq); 149 149 150 150 for (iter = 0 ; iter < MAX_ASIC_ISR_LOOPS; iter++) { 151 151 u32 status;
+2 -2
drivers/mfd/davinci_voicecodec.c
··· 118 118 119 119 /* Voice codec interface client */ 120 120 cell = &davinci_vc->cells[DAVINCI_VC_VCIF_CELL]; 121 - cell->name = "davinci_vcif"; 121 + cell->name = "davinci-vcif"; 122 122 cell->driver_data = davinci_vc; 123 123 124 124 /* Voice codec CQ93VC client */ 125 125 cell = &davinci_vc->cells[DAVINCI_VC_CQ93VC_CELL]; 126 - cell->name = "cq93vc"; 126 + cell->name = "cq93vc-codec"; 127 127 cell->driver_data = davinci_vc; 128 128 129 129 ret = mfd_add_devices(&pdev->dev, pdev->id, davinci_vc->cells,
+5 -5
drivers/mfd/tps6586x.c
··· 150 150 static inline int __tps6586x_writes(struct i2c_client *client, int reg, 151 151 int len, uint8_t *val) 152 152 { 153 - int ret; 153 + int ret, i; 154 154 155 - ret = i2c_smbus_write_i2c_block_data(client, reg, len, val); 156 - if (ret < 0) { 157 - dev_err(&client->dev, "failed writings to 0x%02x\n", reg); 158 - return ret; 155 + for (i = 0; i < len; i++) { 156 + ret = __tps6586x_write(client, reg + i, *(val + i)); 157 + if (ret < 0) 158 + return ret; 159 159 } 160 160 161 161 return 0;
+9 -3
drivers/mfd/ucb1x00-ts.c
··· 385 385 idev->close = ucb1x00_ts_close; 386 386 387 387 __set_bit(EV_ABS, idev->evbit); 388 - __set_bit(ABS_X, idev->absbit); 389 - __set_bit(ABS_Y, idev->absbit); 390 - __set_bit(ABS_PRESSURE, idev->absbit); 391 388 392 389 input_set_drvdata(idev, ts); 390 + 391 + ucb1x00_adc_enable(ts->ucb); 392 + ts->x_res = ucb1x00_ts_read_xres(ts); 393 + ts->y_res = ucb1x00_ts_read_yres(ts); 394 + ucb1x00_adc_disable(ts->ucb); 395 + 396 + input_set_abs_params(idev, ABS_X, 0, ts->x_res, 0, 0); 397 + input_set_abs_params(idev, ABS_Y, 0, ts->y_res, 0, 0); 398 + input_set_abs_params(idev, ABS_PRESSURE, 0, 0, 0, 0); 393 399 394 400 err = input_register_device(idev); 395 401 if (err)
+18
drivers/mfd/wm8994-core.c
··· 246 246 struct wm8994 *wm8994 = dev_get_drvdata(dev); 247 247 int ret; 248 248 249 + /* Don't actually go through with the suspend if the CODEC is 250 + * still active (eg, for audio passthrough from CP. */ 251 + ret = wm8994_reg_read(wm8994, WM8994_POWER_MANAGEMENT_1); 252 + if (ret < 0) { 253 + dev_err(dev, "Failed to read power status: %d\n", ret); 254 + } else if (ret & WM8994_VMID_SEL_MASK) { 255 + dev_dbg(dev, "CODEC still active, ignoring suspend\n"); 256 + return 0; 257 + } 258 + 249 259 /* GPIO configuration state is saved here since we may be configuring 250 260 * the GPIO alternate functions even if we're not using the gpiolib 251 261 * driver for them. ··· 271 261 if (ret < 0) 272 262 dev_err(dev, "Failed to save LDO registers: %d\n", ret); 273 263 264 + wm8994->suspended = true; 265 + 274 266 ret = regulator_bulk_disable(wm8994->num_supplies, 275 267 wm8994->supplies); 276 268 if (ret != 0) { ··· 287 275 { 288 276 struct wm8994 *wm8994 = dev_get_drvdata(dev); 289 277 int ret; 278 + 279 + /* We may have lied to the PM core about suspending */ 280 + if (!wm8994->suspended) 281 + return 0; 290 282 291 283 ret = regulator_bulk_enable(wm8994->num_supplies, 292 284 wm8994->supplies); ··· 313 297 &wm8994->gpio_regs); 314 298 if (ret < 0) 315 299 dev_err(dev, "Failed to restore GPIO registers: %d\n", ret); 300 + 301 + wm8994->suspended = false; 316 302 317 303 return 0; 318 304 }
+1
drivers/misc/bmp085.c
··· 449 449 { "bmp085", 0 }, 450 450 { } 451 451 }; 452 + MODULE_DEVICE_TABLE(i2c, bmp085_id); 452 453 453 454 static struct i2c_driver bmp085_driver = { 454 455 .driver = {
+1 -2
drivers/mmc/core/sdio.c
··· 792 792 */ 793 793 mmc_release_host(host); 794 794 err = mmc_add_card(host->card); 795 - mmc_claim_host(host); 796 795 if (err) 797 796 goto remove_added; 798 797 ··· 804 805 goto remove_added; 805 806 } 806 807 808 + mmc_claim_host(host); 807 809 return 0; 808 810 809 811 810 812 remove_added: 811 813 /* Remove without lock if the device has been added. */ 812 - mmc_release_host(host); 813 814 mmc_sdio_remove(host); 814 815 mmc_claim_host(host); 815 816 remove:
+16 -12
drivers/net/bnx2x/bnx2x.h
··· 22 22 * (you will need to reboot afterwards) */ 23 23 /* #define BNX2X_STOP_ON_ERROR */ 24 24 25 - #define DRV_MODULE_VERSION "1.62.00-5" 25 + #define DRV_MODULE_VERSION "1.62.00-6" 26 26 #define DRV_MODULE_RELDATE "2011/01/30" 27 27 #define BNX2X_BC_VER 0x040200 28 28 ··· 1613 1613 #define BNX2X_BTR 4 1614 1614 #define MAX_SPQ_PENDING 8 1615 1615 1616 - 1617 - /* CMNG constants 1618 - derived from lab experiments, and not from system spec calculations !!! */ 1619 - #define DEF_MIN_RATE 100 1616 + /* CMNG constants, as derived from system spec calculations */ 1617 + /* default MIN rate in case VNIC min rate is configured to zero - 100Mbps */ 1618 + #define DEF_MIN_RATE 100 1620 1619 /* resolution of the rate shaping timer - 100 usec */ 1621 - #define RS_PERIODIC_TIMEOUT_USEC 100 1622 - /* resolution of fairness algorithm in usecs - 1623 - coefficient for calculating the actual t fair */ 1624 - #define T_FAIR_COEF 10000000 1620 + #define RS_PERIODIC_TIMEOUT_USEC 100 1625 1621 /* number of bytes in single QM arbitration cycle - 1626 - coefficient for calculating the fairness timer */ 1627 - #define QM_ARB_BYTES 40000 1628 - #define FAIR_MEM 2 1622 + * coefficient for calculating the fairness timer */ 1623 + #define QM_ARB_BYTES 160000 1624 + /* resolution of Min algorithm 1:100 */ 1625 + #define MIN_RES 100 1626 + /* how many bytes above threshold for the minimal credit of Min algorithm*/ 1627 + #define MIN_ABOVE_THRESH 32768 1628 + /* Fairness algorithm integration time coefficient - 1629 + * for calculating the actual Tfair */ 1630 + #define T_FAIR_COEF ((MIN_ABOVE_THRESH + QM_ARB_BYTES) * 8 * MIN_RES) 1631 + /* Memory of fairness algorithm . 2 cycles */ 1632 + #define FAIR_MEM 2 1629 1633 1630 1634 1631 1635 #define ATTN_NIG_FOR_FUNC (1L << 8)
+51 -14
drivers/net/bnx2x/bnx2x_cmn.c
··· 259 259 #endif 260 260 } 261 261 262 + /* Timestamp option length allowed for TPA aggregation: 263 + * 264 + * nop nop kind length echo val 265 + */ 266 + #define TPA_TSTAMP_OPT_LEN 12 267 + /** 268 + * Calculate the approximate value of the MSS for this 269 + * aggregation using the first packet of it. 270 + * 271 + * @param bp 272 + * @param parsing_flags Parsing flags from the START CQE 273 + * @param len_on_bd Total length of the first packet for the 274 + * aggregation. 275 + */ 276 + static inline u16 bnx2x_set_lro_mss(struct bnx2x *bp, u16 parsing_flags, 277 + u16 len_on_bd) 278 + { 279 + /* TPA arrgregation won't have an IP options and TCP options 280 + * other than timestamp. 281 + */ 282 + u16 hdrs_len = ETH_HLEN + sizeof(struct iphdr) + sizeof(struct tcphdr); 283 + 284 + 285 + /* Check if there was a TCP timestamp, if there is it's will 286 + * always be 12 bytes length: nop nop kind length echo val. 287 + * 288 + * Otherwise FW would close the aggregation. 289 + */ 290 + if (parsing_flags & PARSING_FLAGS_TIME_STAMP_EXIST_FLAG) 291 + hdrs_len += TPA_TSTAMP_OPT_LEN; 292 + 293 + return len_on_bd - hdrs_len; 294 + } 295 + 262 296 static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, 263 297 struct sk_buff *skb, 264 298 struct eth_fast_path_rx_cqe *fp_cqe, 265 - u16 cqe_idx) 299 + u16 cqe_idx, u16 parsing_flags) 266 300 { 267 301 struct sw_rx_page *rx_pg, old_rx_pg; 268 302 u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd); ··· 309 275 310 276 /* This is needed in order to enable forwarding support */ 311 277 if (frag_size) 312 - skb_shinfo(skb)->gso_size = min((u32)SGE_PAGE_SIZE, 313 - max(frag_size, (u32)len_on_bd)); 278 + skb_shinfo(skb)->gso_size = bnx2x_set_lro_mss(bp, parsing_flags, 279 + len_on_bd); 314 280 315 281 #ifdef BNX2X_STOP_ON_ERROR 316 282 if (pages > min_t(u32, 8, MAX_SKB_FRAGS)*SGE_PAGE_SIZE*PAGES_PER_SGE) { ··· 378 344 if (likely(new_skb)) { 379 345 /* fix ip xsum and give it to the stack */ 380 346 /* (no need to map the new skb) */ 347 + u16 parsing_flags = 348 + le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags); 381 349 382 350 prefetch(skb); 383 351 prefetch(((char *)(skb)) + L1_CACHE_BYTES); ··· 409 373 } 410 374 411 375 if (!bnx2x_fill_frag_skb(bp, fp, skb, 412 - &cqe->fast_path_cqe, cqe_idx)) { 413 - if ((le16_to_cpu(cqe->fast_path_cqe. 414 - pars_flags.flags) & PARSING_FLAGS_VLAN)) 376 + &cqe->fast_path_cqe, cqe_idx, 377 + parsing_flags)) { 378 + if (parsing_flags & PARSING_FLAGS_VLAN) 415 379 __vlan_hwaccel_put_tag(skb, 416 380 le16_to_cpu(cqe->fast_path_cqe. 417 381 vlan_tag)); ··· 739 703 { 740 704 u16 line_speed = bp->link_vars.line_speed; 741 705 if (IS_MF(bp)) { 742 - u16 maxCfg = (bp->mf_config[BP_VN(bp)] & 743 - FUNC_MF_CFG_MAX_BW_MASK) >> 744 - FUNC_MF_CFG_MAX_BW_SHIFT; 745 - /* Calculate the current MAX line speed limit for the DCC 746 - * capable devices 706 + u16 maxCfg = bnx2x_extract_max_cfg(bp, 707 + bp->mf_config[BP_VN(bp)]); 708 + 709 + /* Calculate the current MAX line speed limit for the MF 710 + * devices 747 711 */ 748 - if (IS_MF_SD(bp)) { 712 + if (IS_MF_SI(bp)) 713 + line_speed = (line_speed * maxCfg) / 100; 714 + else { /* SD mode */ 749 715 u16 vn_max_rate = maxCfg * 100; 750 716 751 717 if (vn_max_rate < line_speed) 752 718 line_speed = vn_max_rate; 753 - } else /* IS_MF_SI(bp)) */ 754 - line_speed = (line_speed * maxCfg) / 100; 719 + } 755 720 } 756 721 757 722 return line_speed;
+20
drivers/net/bnx2x/bnx2x_cmn.h
··· 1044 1044 void bnx2x_acquire_phy_lock(struct bnx2x *bp); 1045 1045 void bnx2x_release_phy_lock(struct bnx2x *bp); 1046 1046 1047 + /** 1048 + * Extracts MAX BW part from MF configuration. 1049 + * 1050 + * @param bp 1051 + * @param mf_cfg 1052 + * 1053 + * @return u16 1054 + */ 1055 + static inline u16 bnx2x_extract_max_cfg(struct bnx2x *bp, u32 mf_cfg) 1056 + { 1057 + u16 max_cfg = (mf_cfg & FUNC_MF_CFG_MAX_BW_MASK) >> 1058 + FUNC_MF_CFG_MAX_BW_SHIFT; 1059 + if (!max_cfg) { 1060 + BNX2X_ERR("Illegal configuration detected for Max BW - " 1061 + "using 100 instead\n"); 1062 + max_cfg = 100; 1063 + } 1064 + return max_cfg; 1065 + } 1066 + 1047 1067 #endif /* BNX2X_CMN_H */
+12 -13
drivers/net/bnx2x/bnx2x_ethtool.c
··· 238 238 speed |= (cmd->speed_hi << 16); 239 239 240 240 if (IS_MF_SI(bp)) { 241 - u32 param = 0; 241 + u32 param = 0, part; 242 242 u32 line_speed = bp->link_vars.line_speed; 243 243 244 244 /* use 10G if no link detected */ ··· 251 251 REQ_BC_VER_4_SET_MF_BW); 252 252 return -EINVAL; 253 253 } 254 - if (line_speed < speed) { 255 - BNX2X_DEV_INFO("New speed should be less or equal " 256 - "to actual line speed\n"); 254 + part = (speed * 100) / line_speed; 255 + if (line_speed < speed || !part) { 256 + BNX2X_DEV_INFO("Speed setting should be in a range " 257 + "from 1%% to 100%% " 258 + "of actual line speed\n"); 257 259 return -EINVAL; 258 260 } 259 261 /* load old values */ ··· 265 263 param &= FUNC_MF_CFG_MIN_BW_MASK; 266 264 267 265 /* set new MAX value */ 268 - param |= (((speed * 100) / line_speed) 269 - << FUNC_MF_CFG_MAX_BW_SHIFT) 266 + param |= (part << FUNC_MF_CFG_MAX_BW_SHIFT) 270 267 & FUNC_MF_CFG_MAX_BW_MASK; 271 268 272 269 bnx2x_fw_command(bp, DRV_MSG_CODE_SET_MF_BW, param); ··· 1782 1781 { 0x100, 0x350 }, /* manuf_info */ 1783 1782 { 0x450, 0xf0 }, /* feature_info */ 1784 1783 { 0x640, 0x64 }, /* upgrade_key_info */ 1785 - { 0x6a4, 0x64 }, 1786 1784 { 0x708, 0x70 }, /* manuf_key_info */ 1787 - { 0x778, 0x70 }, 1788 1785 { 0, 0 } 1789 1786 }; 1790 1787 __be32 buf[0x350 / 4]; ··· 1932 1933 buf[4] = 1; 1933 1934 etest->flags |= ETH_TEST_FL_FAILED; 1934 1935 } 1935 - if (bp->port.pmf) 1936 - if (bnx2x_link_test(bp, is_serdes) != 0) { 1937 - buf[5] = 1; 1938 - etest->flags |= ETH_TEST_FL_FAILED; 1939 - } 1936 + 1937 + if (bnx2x_link_test(bp, is_serdes) != 0) { 1938 + buf[5] = 1; 1939 + etest->flags |= ETH_TEST_FL_FAILED; 1940 + } 1940 1941 1941 1942 #ifdef BNX2X_EXTRA_DEBUG 1942 1943 bnx2x_panic_dump(bp);
+1 -1
drivers/net/bnx2x/bnx2x_init.h
··· 241 241 /* Block IGU, MISC, PXP and PXP2 parity errors as long as we don't 242 242 * want to handle "system kill" flow at the moment. 243 243 */ 244 - BLOCK_PRTY_INFO(PXP, 0x3ffffff, 0x3ffffff, 0x3ffffff, 0x3ffffff), 244 + BLOCK_PRTY_INFO(PXP, 0x7ffffff, 0x3ffffff, 0x3ffffff, 0x7ffffff), 245 245 BLOCK_PRTY_INFO_0(PXP2, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), 246 246 BLOCK_PRTY_INFO_1(PXP2, 0x7ff, 0x7f, 0x7f, 0x7ff), 247 247 BLOCK_PRTY_INFO(HC, 0x7, 0x7, 0x7, 0),
+14 -4
drivers/net/bnx2x/bnx2x_main.c
··· 1974 1974 vn_max_rate = 0; 1975 1975 1976 1976 } else { 1977 + u32 maxCfg = bnx2x_extract_max_cfg(bp, vn_cfg); 1978 + 1977 1979 vn_min_rate = ((vn_cfg & FUNC_MF_CFG_MIN_BW_MASK) >> 1978 1980 FUNC_MF_CFG_MIN_BW_SHIFT) * 100; 1979 - /* If min rate is zero - set it to 1 */ 1981 + /* If fairness is enabled (not all min rates are zeroes) and 1982 + if current min rate is zero - set it to 1. 1983 + This is a requirement of the algorithm. */ 1980 1984 if (bp->vn_weight_sum && (vn_min_rate == 0)) 1981 1985 vn_min_rate = DEF_MIN_RATE; 1982 - vn_max_rate = ((vn_cfg & FUNC_MF_CFG_MAX_BW_MASK) >> 1983 - FUNC_MF_CFG_MAX_BW_SHIFT) * 100; 1986 + 1987 + if (IS_MF_SI(bp)) 1988 + /* maxCfg in percents of linkspeed */ 1989 + vn_max_rate = (bp->link_vars.line_speed * maxCfg) / 100; 1990 + else 1991 + /* maxCfg is absolute in 100Mb units */ 1992 + vn_max_rate = maxCfg * 100; 1984 1993 } 1985 1994 1986 1995 DP(NETIF_MSG_IFUP, ··· 2015 2006 m_fair_vn.vn_credit_delta = 2016 2007 max_t(u32, (vn_min_rate * (T_FAIR_COEF / 2017 2008 (8 * bp->vn_weight_sum))), 2018 - (bp->cmng.fair_vars.fair_threshold * 2)); 2009 + (bp->cmng.fair_vars.fair_threshold + 2010 + MIN_ABOVE_THRESH)); 2019 2011 DP(NETIF_MSG_IFUP, "m_fair_vn.vn_credit_delta %d\n", 2020 2012 m_fair_vn.vn_credit_delta); 2021 2013 }
+2 -2
drivers/net/bnx2x/bnx2x_stats.c
··· 1239 1239 if (unlikely(bp->panic)) 1240 1240 return; 1241 1241 1242 + bnx2x_stats_stm[bp->stats_state][event].action(bp); 1243 + 1242 1244 /* Protect a state change flow */ 1243 1245 spin_lock_bh(&bp->stats_lock); 1244 1246 state = bp->stats_state; 1245 1247 bp->stats_state = bnx2x_stats_stm[state][event].next_state; 1246 1248 spin_unlock_bh(&bp->stats_lock); 1247 - 1248 - bnx2x_stats_stm[state][event].action(bp); 1249 1249 1250 1250 if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) 1251 1251 DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
+1
drivers/net/can/softing/softing_main.c
··· 633 633 }; 634 634 635 635 static const struct can_bittiming_const softing_btr_const = { 636 + .name = "softing", 636 637 .tseg1_min = 1, 637 638 .tseg1_max = 16, 638 639 .tseg2_min = 1,
+25 -8
drivers/net/cnic.c
··· 2760 2760 u32 status_idx = (u16) *cp->kcq1.status_idx_ptr; 2761 2761 int kcqe_cnt; 2762 2762 2763 + /* status block index must be read before reading other fields */ 2764 + rmb(); 2763 2765 cp->kwq_con_idx = *cp->kwq_con_idx_ptr; 2764 2766 2765 2767 while ((kcqe_cnt = cnic_get_kcqes(dev, &cp->kcq1))) { ··· 2772 2770 barrier(); 2773 2771 if (status_idx != *cp->kcq1.status_idx_ptr) { 2774 2772 status_idx = (u16) *cp->kcq1.status_idx_ptr; 2773 + /* status block index must be read first */ 2774 + rmb(); 2775 2775 cp->kwq_con_idx = *cp->kwq_con_idx_ptr; 2776 2776 } else 2777 2777 break; ··· 2892 2888 u32 last_status = *info->status_idx_ptr; 2893 2889 int kcqe_cnt; 2894 2890 2891 + /* status block index must be read before reading the KCQ */ 2892 + rmb(); 2895 2893 while ((kcqe_cnt = cnic_get_kcqes(dev, info))) { 2896 2894 2897 2895 service_kcqes(dev, kcqe_cnt); ··· 2904 2898 break; 2905 2899 2906 2900 last_status = *info->status_idx_ptr; 2901 + /* status block index must be read before reading the KCQ */ 2902 + rmb(); 2907 2903 } 2908 2904 return last_status; 2909 2905 } ··· 2914 2906 { 2915 2907 struct cnic_dev *dev = (struct cnic_dev *) data; 2916 2908 struct cnic_local *cp = dev->cnic_priv; 2917 - u32 status_idx; 2909 + u32 status_idx, new_status_idx; 2918 2910 2919 2911 if (unlikely(!test_bit(CNIC_F_CNIC_UP, &dev->flags))) 2920 2912 return; 2921 2913 2922 - status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1); 2914 + while (1) { 2915 + status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq1); 2923 2916 2924 - CNIC_WR16(dev, cp->kcq1.io_addr, cp->kcq1.sw_prod_idx + MAX_KCQ_IDX); 2917 + CNIC_WR16(dev, cp->kcq1.io_addr, 2918 + cp->kcq1.sw_prod_idx + MAX_KCQ_IDX); 2925 2919 2926 - if (BNX2X_CHIP_IS_E2(cp->chip_id)) { 2927 - status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq2); 2920 + if (!BNX2X_CHIP_IS_E2(cp->chip_id)) { 2921 + cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID, 2922 + status_idx, IGU_INT_ENABLE, 1); 2923 + break; 2924 + } 2925 + 2926 + new_status_idx = cnic_service_bnx2x_kcq(dev, &cp->kcq2); 2927 + 2928 + if (new_status_idx != status_idx) 2929 + continue; 2928 2930 2929 2931 CNIC_WR16(dev, cp->kcq2.io_addr, cp->kcq2.sw_prod_idx + 2930 2932 MAX_KCQ_IDX); 2931 2933 2932 2934 cnic_ack_igu_sb(dev, cp->bnx2x_igu_sb_id, IGU_SEG_ACCESS_DEF, 2933 2935 status_idx, IGU_INT_ENABLE, 1); 2934 - } else { 2935 - cnic_ack_bnx2x_int(dev, cp->bnx2x_igu_sb_id, USTORM_ID, 2936 - status_idx, IGU_INT_ENABLE, 1); 2936 + 2937 + break; 2937 2938 } 2938 2939 } 2939 2940
+1 -1
drivers/net/davinci_emac.c
··· 1008 1008 int ret; 1009 1009 1010 1010 /* free and bail if we are shutting down */ 1011 - if (unlikely(!netif_running(ndev))) { 1011 + if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) { 1012 1012 dev_kfree_skb_any(skb); 1013 1013 return; 1014 1014 }
+5 -4
drivers/net/dm9000.c
··· 802 802 /* Checksum mode */ 803 803 dm9000_set_rx_csum_unlocked(dev, db->rx_csum); 804 804 805 - /* GPIO0 on pre-activate PHY */ 806 - iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ 807 805 iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ 808 - iow(db, DM9000_GPR, 0); /* Enable PHY */ 809 806 810 807 ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; 811 808 ··· 849 852 unsigned long flags; 850 853 851 854 /* Save previous register address */ 852 - reg_save = readb(db->io_addr); 853 855 spin_lock_irqsave(&db->lock, flags); 856 + reg_save = readb(db->io_addr); 854 857 855 858 netif_stop_queue(dev); 856 859 dm9000_reset(db); ··· 1190 1193 1191 1194 if (request_irq(dev->irq, dm9000_interrupt, irqflags, dev->name, dev)) 1192 1195 return -EAGAIN; 1196 + 1197 + /* GPIO0 on pre-activate PHY, Reg 1F is not set by reset */ 1198 + iow(db, DM9000_GPR, 0); /* REG_1F bit0 activate phyxcer */ 1199 + mdelay(1); /* delay needs by DM9000B */ 1193 1200 1194 1201 /* Initialize DM9000 board */ 1195 1202 dm9000_reset(db);
+1 -2
drivers/net/dnet.c
··· 337 337 for (i = 0; i < PHY_MAX_ADDR; i++) 338 338 bp->mii_bus->irq[i] = PHY_POLL; 339 339 340 - platform_set_drvdata(bp->dev, bp->mii_bus); 341 - 342 340 if (mdiobus_register(bp->mii_bus)) { 343 341 err = -ENXIO; 344 342 goto err_out_free_mdio_irq; ··· 861 863 bp = netdev_priv(dev); 862 864 bp->dev = dev; 863 865 866 + platform_set_drvdata(pdev, dev); 864 867 SET_NETDEV_DEV(dev, &pdev->dev); 865 868 866 869 spin_lock_init(&bp->lock);
+2 -1
drivers/net/e1000/e1000_osdep.h
··· 42 42 #define GBE_CONFIG_RAM_BASE \ 43 43 ((unsigned int)(CONFIG_RAM_BASE + GBE_CONFIG_OFFSET)) 44 44 45 - #define GBE_CONFIG_BASE_VIRT phys_to_virt(GBE_CONFIG_RAM_BASE) 45 + #define GBE_CONFIG_BASE_VIRT \ 46 + ((void __iomem *)phys_to_virt(GBE_CONFIG_RAM_BASE)) 46 47 47 48 #define GBE_CONFIG_FLASH_WRITE(base, offset, count, data) \ 48 49 (iowrite16_rep(base + offset, data, count))
+2 -1
drivers/net/e1000e/netdev.c
··· 5967 5967 /* APME bit in EEPROM is mapped to WUC.APME */ 5968 5968 eeprom_data = er32(WUC); 5969 5969 eeprom_apme_mask = E1000_WUC_APME; 5970 - if (eeprom_data & E1000_WUC_PHY_WAKE) 5970 + if ((hw->mac.type > e1000_ich10lan) && 5971 + (eeprom_data & E1000_WUC_PHY_WAKE)) 5971 5972 adapter->flags2 |= FLAG2_HAS_PHY_WAKEUP; 5972 5973 } else if (adapter->flags & FLAG_APME_IN_CTRL3) { 5973 5974 if (adapter->flags & FLAG_APME_CHECK_PORT_B &&
+2 -1
drivers/net/fec.c
··· 74 74 }, { 75 75 .name = "imx28-fec", 76 76 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_SWAP_FRAME, 77 - } 77 + }, 78 + { } 78 79 }; 79 80 80 81 static unsigned char macaddr[ETH_ALEN];
+1 -1
drivers/net/igbvf/vf.c
··· 220 220 * The parameter rar_count will usually be hw->mac.rar_entry_count 221 221 * unless there are workarounds that change this. 222 222 **/ 223 - void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, 223 + static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, 224 224 u8 *mc_addr_list, u32 mc_addr_count, 225 225 u32 rar_used_count, u32 rar_count) 226 226 {
+1 -1
drivers/net/macb.c
··· 260 260 for (i = 0; i < PHY_MAX_ADDR; i++) 261 261 bp->mii_bus->irq[i] = PHY_POLL; 262 262 263 - platform_set_drvdata(bp->dev, bp->mii_bus); 263 + dev_set_drvdata(&bp->dev->dev, bp->mii_bus); 264 264 265 265 if (mdiobus_register(bp->mii_bus)) 266 266 goto err_out_free_mdio_irq;
+1
drivers/net/pcmcia/fmvj18x_cs.c
··· 691 691 PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0105, 0x0e0a), 692 692 PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x0e01), 693 693 PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x0a05), 694 + PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x0b05), 694 695 PCMCIA_PFC_DEVICE_MANF_CARD(0, 0x0032, 0x1101), 695 696 PCMCIA_DEVICE_NULL, 696 697 };
+29 -19
drivers/net/r8169.c
··· 25 25 #include <linux/dma-mapping.h> 26 26 #include <linux/pm_runtime.h> 27 27 #include <linux/firmware.h> 28 + #include <linux/pci-aspm.h> 28 29 29 30 #include <asm/system.h> 30 31 #include <asm/io.h> ··· 618 617 } 619 618 } 620 619 621 - static void rtl8168_oob_notify(void __iomem *ioaddr, u8 cmd) 620 + static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd) 622 621 { 622 + void __iomem *ioaddr = tp->mmio_addr; 623 623 int i; 624 624 625 625 RTL_W8(ERIDR, cmd); ··· 632 630 break; 633 631 } 634 632 635 - ocp_write(ioaddr, 0x1, 0x30, 0x00000001); 633 + ocp_write(tp, 0x1, 0x30, 0x00000001); 636 634 } 637 635 638 636 #define OOB_CMD_RESET 0x00 ··· 2870 2868 { 2871 2869 void __iomem *ioaddr = tp->mmio_addr; 2872 2870 2873 - if (tp->mac_version == RTL_GIGA_MAC_VER_27) 2871 + if (((tp->mac_version == RTL_GIGA_MAC_VER_27) || 2872 + (tp->mac_version == RTL_GIGA_MAC_VER_28)) && 2873 + (ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) { 2874 2874 return; 2875 + } 2875 2876 2876 2877 if (((tp->mac_version == RTL_GIGA_MAC_VER_23) || 2877 2878 (tp->mac_version == RTL_GIGA_MAC_VER_24)) && ··· 2896 2891 switch (tp->mac_version) { 2897 2892 case RTL_GIGA_MAC_VER_25: 2898 2893 case RTL_GIGA_MAC_VER_26: 2894 + case RTL_GIGA_MAC_VER_27: 2895 + case RTL_GIGA_MAC_VER_28: 2899 2896 RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80); 2900 2897 break; 2901 2898 } ··· 2907 2900 { 2908 2901 void __iomem *ioaddr = tp->mmio_addr; 2909 2902 2910 - if (tp->mac_version == RTL_GIGA_MAC_VER_27) 2903 + if (((tp->mac_version == RTL_GIGA_MAC_VER_27) || 2904 + (tp->mac_version == RTL_GIGA_MAC_VER_28)) && 2905 + (ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) { 2911 2906 return; 2907 + } 2912 2908 2913 2909 switch (tp->mac_version) { 2914 2910 case RTL_GIGA_MAC_VER_25: 2915 2911 case RTL_GIGA_MAC_VER_26: 2912 + case RTL_GIGA_MAC_VER_27: 2913 + case RTL_GIGA_MAC_VER_28: 2916 2914 RTL_W8(PMCH, RTL_R8(PMCH) | 0x80); 2917 2915 break; 2918 2916 } ··· 3021 3009 mii->reg_num_mask = 0x1f; 3022 3010 mii->supports_gmii = !!(cfg->features & RTL_FEATURE_GMII); 3023 3011 3012 + /* disable ASPM completely as that cause random device stop working 3013 + * problems as well as full system hangs for some PCIe devices users */ 3014 + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 | 3015 + PCIE_LINK_STATE_CLKPM); 3016 + 3024 3017 /* enable device (incl. PCI PM wakeup and hotplug setup) */ 3025 3018 rc = pci_enable_device(pdev); 3026 3019 if (rc < 0) { ··· 3059 3042 goto err_out_mwi_2; 3060 3043 } 3061 3044 3062 - tp->cp_cmd = PCIMulRW | RxChkSum; 3045 + tp->cp_cmd = RxChkSum; 3063 3046 3064 3047 if ((sizeof(dma_addr_t) > 4) && 3065 3048 !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) { ··· 3335 3318 /* Disable interrupts */ 3336 3319 rtl8169_irq_mask_and_ack(ioaddr); 3337 3320 3338 - if (tp->mac_version == RTL_GIGA_MAC_VER_28) { 3321 + if (tp->mac_version == RTL_GIGA_MAC_VER_27 || 3322 + tp->mac_version == RTL_GIGA_MAC_VER_28) { 3339 3323 while (RTL_R8(TxPoll) & NPQ) 3340 3324 udelay(20); 3341 3325 ··· 3865 3847 Cxpl_dbg_sel | \ 3866 3848 ASF | \ 3867 3849 PktCntrDisable | \ 3868 - PCIDAC | \ 3869 - PCIMulRW) 3850 + Mac_dbgo_sel) 3870 3851 3871 3852 static void rtl_hw_start_8102e_1(void __iomem *ioaddr, struct pci_dev *pdev) 3872 3853 { ··· 3895 3878 if ((cfg1 & LEDS0) && (cfg1 & LEDS1)) 3896 3879 RTL_W8(Config1, cfg1 & ~LEDS0); 3897 3880 3898 - RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK); 3899 - 3900 3881 rtl_ephy_init(ioaddr, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1)); 3901 3882 } 3902 3883 ··· 3906 3891 3907 3892 RTL_W8(Config1, MEMMAP | IOMAP | VPD | PMEnable); 3908 3893 RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en); 3909 - 3910 - RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R810X_CPCMD_QUIRK_MASK); 3911 3894 } 3912 3895 3913 3896 static void rtl_hw_start_8102e_3(void __iomem *ioaddr, struct pci_dev *pdev) ··· 3931 3918 } 3932 3919 } 3933 3920 3921 + RTL_W8(Cfg9346, Cfg9346_Unlock); 3922 + 3934 3923 switch (tp->mac_version) { 3935 3924 case RTL_GIGA_MAC_VER_07: 3936 3925 rtl_hw_start_8102e_1(ioaddr, pdev); ··· 3947 3932 break; 3948 3933 } 3949 3934 3950 - RTL_W8(Cfg9346, Cfg9346_Unlock); 3935 + RTL_W8(Cfg9346, Cfg9346_Lock); 3951 3936 3952 3937 RTL_W8(MaxTxPacketSize, TxPacketMax); 3953 3938 3954 3939 rtl_set_rx_max_size(ioaddr, rx_buf_sz); 3955 3940 3956 - tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; 3957 - 3941 + tp->cp_cmd &= ~R810X_CPCMD_QUIRK_MASK; 3958 3942 RTL_W16(CPlusCmd, tp->cp_cmd); 3959 3943 3960 3944 RTL_W16(IntrMitigate, 0x0000); ··· 3963 3949 RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); 3964 3950 rtl_set_rx_tx_config_registers(tp); 3965 3951 3966 - RTL_W8(Cfg9346, Cfg9346_Lock); 3967 - 3968 3952 RTL_R8(IntrMask); 3969 3953 3970 3954 rtl_set_rx_mode(dev); 3971 - 3972 - RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); 3973 3955 3974 3956 RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000); 3975 3957
+13 -9
drivers/net/sfc/ethtool.c
··· 569 569 struct ethtool_test *test, u64 *data) 570 570 { 571 571 struct efx_nic *efx = netdev_priv(net_dev); 572 - struct efx_self_tests efx_tests; 572 + struct efx_self_tests *efx_tests; 573 573 int already_up; 574 - int rc; 574 + int rc = -ENOMEM; 575 + 576 + efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL); 577 + if (!efx_tests) 578 + goto fail; 579 + 575 580 576 581 ASSERT_RTNL(); 577 582 if (efx->state != STATE_RUNNING) { ··· 594 589 if (rc) { 595 590 netif_err(efx, drv, efx->net_dev, 596 591 "failed opening device.\n"); 597 - goto fail2; 592 + goto fail1; 598 593 } 599 594 } 600 595 601 - memset(&efx_tests, 0, sizeof(efx_tests)); 602 - 603 - rc = efx_selftest(efx, &efx_tests, test->flags); 596 + rc = efx_selftest(efx, efx_tests, test->flags); 604 597 605 598 if (!already_up) 606 599 dev_close(efx->net_dev); ··· 607 604 rc == 0 ? "passed" : "failed", 608 605 (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on"); 609 606 610 - fail2: 611 - fail1: 607 + fail1: 612 608 /* Fill ethtool results structures */ 613 - efx_ethtool_fill_self_tests(efx, &efx_tests, NULL, data); 609 + efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data); 610 + kfree(efx_tests); 611 + fail: 614 612 if (rc) 615 613 test->flags |= ETH_TEST_FL_FAILED; 616 614 }
-3
drivers/net/skge.c
··· 3856 3856 memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port*8, ETH_ALEN); 3857 3857 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); 3858 3858 3859 - /* device is off until link detection */ 3860 - netif_carrier_off(dev); 3861 - 3862 3859 return dev; 3863 3860 } 3864 3861
+4
drivers/net/usb/dm9601.c
··· 651 651 .driver_info = (unsigned long)&dm9601_info, 652 652 }, 653 653 { 654 + USB_DEVICE(0x0fe6, 0x9700), /* DM9601 USB to Fast Ethernet Adapter */ 655 + .driver_info = (unsigned long)&dm9601_info, 656 + }, 657 + { 654 658 USB_DEVICE(0x0a46, 0x9000), /* DM9000E */ 655 659 .driver_info = (unsigned long)&dm9601_info, 656 660 },
+89 -56
drivers/net/wireless/ath/ath5k/phy.c
··· 282 282 return 0; 283 283 } 284 284 285 + /* 286 + * Wait for synth to settle 287 + */ 288 + static void ath5k_hw_wait_for_synth(struct ath5k_hw *ah, 289 + struct ieee80211_channel *channel) 290 + { 291 + /* 292 + * On 5211+ read activation -> rx delay 293 + * and use it (100ns steps). 294 + */ 295 + if (ah->ah_version != AR5K_AR5210) { 296 + u32 delay; 297 + delay = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) & 298 + AR5K_PHY_RX_DELAY_M; 299 + delay = (channel->hw_value & CHANNEL_CCK) ? 300 + ((delay << 2) / 22) : (delay / 10); 301 + if (ah->ah_bwmode == AR5K_BWMODE_10MHZ) 302 + delay = delay << 1; 303 + if (ah->ah_bwmode == AR5K_BWMODE_5MHZ) 304 + delay = delay << 2; 305 + /* XXX: /2 on turbo ? Let's be safe 306 + * for now */ 307 + udelay(100 + delay); 308 + } else { 309 + mdelay(1); 310 + } 311 + } 312 + 285 313 286 314 /**********************\ 287 315 * RF Gain optimization * ··· 1281 1253 case AR5K_RF5111: 1282 1254 ret = ath5k_hw_rf5111_channel(ah, channel); 1283 1255 break; 1256 + case AR5K_RF2317: 1284 1257 case AR5K_RF2425: 1285 1258 ret = ath5k_hw_rf2425_channel(ah, channel); 1286 1259 break; ··· 3266 3237 /* Failed */ 3267 3238 if (i >= 100) 3268 3239 return -EIO; 3240 + 3241 + /* Set channel and wait for synth */ 3242 + ret = ath5k_hw_channel(ah, channel); 3243 + if (ret) 3244 + return ret; 3245 + 3246 + ath5k_hw_wait_for_synth(ah, channel); 3269 3247 } 3270 3248 3271 3249 /* ··· 3287 3251 if (ret) 3288 3252 return ret; 3289 3253 3254 + /* Write OFDM timings on 5212*/ 3255 + if (ah->ah_version == AR5K_AR5212 && 3256 + channel->hw_value & CHANNEL_OFDM) { 3257 + 3258 + ret = ath5k_hw_write_ofdm_timings(ah, channel); 3259 + if (ret) 3260 + return ret; 3261 + 3262 + /* Spur info is available only from EEPROM versions 3263 + * greater than 5.3, but the EEPROM routines will use 3264 + * static values for older versions */ 3265 + if (ah->ah_mac_srev >= AR5K_SREV_AR5424) 3266 + ath5k_hw_set_spur_mitigation_filter(ah, 3267 + channel); 3268 + } 3269 + 3270 + /* If we used fast channel switching 3271 + * we are done, release RF bus and 3272 + * fire up NF calibration. 3273 + * 3274 + * Note: Only NF calibration due to 3275 + * channel change, not AGC calibration 3276 + * since AGC is still running ! 3277 + */ 3278 + if (fast) { 3279 + /* 3280 + * Release RF Bus grant 3281 + */ 3282 + AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_RFBUS_REQ, 3283 + AR5K_PHY_RFBUS_REQ_REQUEST); 3284 + 3285 + /* 3286 + * Start NF calibration 3287 + */ 3288 + AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL, 3289 + AR5K_PHY_AGCCTL_NF); 3290 + 3291 + return ret; 3292 + } 3293 + 3290 3294 /* 3291 3295 * For 5210 we do all initialization using 3292 3296 * initvals, so we don't have to modify 3293 3297 * any settings (5210 also only supports 3294 3298 * a/aturbo modes) 3295 3299 */ 3296 - if ((ah->ah_version != AR5K_AR5210) && !fast) { 3300 + if (ah->ah_version != AR5K_AR5210) { 3297 3301 3298 3302 /* 3299 3303 * Write initial RF gain settings ··· 3351 3275 ret = ath5k_hw_rfregs_init(ah, channel, mode); 3352 3276 if (ret) 3353 3277 return ret; 3354 - 3355 - /* Write OFDM timings on 5212*/ 3356 - if (ah->ah_version == AR5K_AR5212 && 3357 - channel->hw_value & CHANNEL_OFDM) { 3358 - 3359 - ret = ath5k_hw_write_ofdm_timings(ah, channel); 3360 - if (ret) 3361 - return ret; 3362 - 3363 - /* Spur info is available only from EEPROM versions 3364 - * greater than 5.3, but the EEPROM routines will use 3365 - * static values for older versions */ 3366 - if (ah->ah_mac_srev >= AR5K_SREV_AR5424) 3367 - ath5k_hw_set_spur_mitigation_filter(ah, 3368 - channel); 3369 - } 3370 3278 3371 3279 /*Enable/disable 802.11b mode on 5111 3372 3280 (enable 2111 frequency converter + CCK)*/ ··· 3382 3322 */ 3383 3323 ath5k_hw_reg_write(ah, AR5K_PHY_ACT_ENABLE, AR5K_PHY_ACT); 3384 3324 3385 - /* 3386 - * On 5211+ read activation -> rx delay 3387 - * and use it. 3388 - */ 3389 - if (ah->ah_version != AR5K_AR5210) { 3390 - u32 delay; 3391 - delay = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) & 3392 - AR5K_PHY_RX_DELAY_M; 3393 - delay = (channel->hw_value & CHANNEL_CCK) ? 3394 - ((delay << 2) / 22) : (delay / 10); 3395 - if (ah->ah_bwmode == AR5K_BWMODE_10MHZ) 3396 - delay = delay << 1; 3397 - if (ah->ah_bwmode == AR5K_BWMODE_5MHZ) 3398 - delay = delay << 2; 3399 - /* XXX: /2 on turbo ? Let's be safe 3400 - * for now */ 3401 - udelay(100 + delay); 3402 - } else { 3403 - mdelay(1); 3404 - } 3325 + ath5k_hw_wait_for_synth(ah, channel); 3405 3326 3406 - if (fast) 3407 - /* 3408 - * Release RF Bus grant 3409 - */ 3410 - AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_RFBUS_REQ, 3411 - AR5K_PHY_RFBUS_REQ_REQUEST); 3412 - else { 3413 - /* 3414 - * Perform ADC test to see if baseband is ready 3415 - * Set tx hold and check adc test register 3416 - */ 3417 - phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1); 3418 - ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1); 3419 - for (i = 0; i <= 20; i++) { 3420 - if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10)) 3421 - break; 3422 - udelay(200); 3423 - } 3424 - ath5k_hw_reg_write(ah, phy_tst1, AR5K_PHY_TST1); 3327 + /* 3328 + * Perform ADC test to see if baseband is ready 3329 + * Set tx hold and check adc test register 3330 + */ 3331 + phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1); 3332 + ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1); 3333 + for (i = 0; i <= 20; i++) { 3334 + if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10)) 3335 + break; 3336 + udelay(200); 3425 3337 } 3338 + ath5k_hw_reg_write(ah, phy_tst1, AR5K_PHY_TST1); 3426 3339 3427 3340 /* 3428 3341 * Start automatic gain control calibration
-6
drivers/net/wireless/ath/ath9k/ath9k.h
··· 21 21 #include <linux/device.h> 22 22 #include <linux/leds.h> 23 23 #include <linux/completion.h> 24 - #include <linux/pm_qos_params.h> 25 24 26 25 #include "debug.h" 27 26 #include "common.h" ··· 55 56 } while (0) 56 57 57 58 #define A_MAX(a, b) ((a) > (b) ? (a) : (b)) 58 - 59 - #define ATH9K_PM_QOS_DEFAULT_VALUE 55 60 59 61 60 #define TSF_TO_TU(_h,_l) \ 62 61 ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) ··· 630 633 struct ath_descdma txsdma; 631 634 632 635 struct ath_ant_comb ant_comb; 633 - 634 - struct pm_qos_request_list pm_qos_req; 635 636 }; 636 637 637 638 struct ath_wiphy { ··· 661 666 extern struct ieee80211_ops ath9k_ops; 662 667 extern int ath9k_modparam_nohwcrypt; 663 668 extern int led_blink; 664 - extern int ath9k_pm_qos_value; 665 669 extern bool is_ath9k_unloaded; 666 670 667 671 irqreturn_t ath_isr(int irq, void *dev);
+5 -4
drivers/net/wireless/ath/ath9k/hif_usb.c
··· 219 219 struct tx_buf *tx_buf = NULL; 220 220 struct sk_buff *nskb = NULL; 221 221 int ret = 0, i; 222 - u16 *hdr, tx_skb_cnt = 0; 222 + u16 tx_skb_cnt = 0; 223 223 u8 *buf; 224 + __le16 *hdr; 224 225 225 226 if (hif_dev->tx.tx_skb_cnt == 0) 226 227 return 0; ··· 246 245 247 246 buf = tx_buf->buf; 248 247 buf += tx_buf->offset; 249 - hdr = (u16 *)buf; 250 - *hdr++ = nskb->len; 251 - *hdr++ = ATH_USB_TX_STREAM_MODE_TAG; 248 + hdr = (__le16 *)buf; 249 + *hdr++ = cpu_to_le16(nskb->len); 250 + *hdr++ = cpu_to_le16(ATH_USB_TX_STREAM_MODE_TAG); 252 251 buf += 4; 253 252 memcpy(buf, nskb->data, nskb->len); 254 253 tx_buf->len = nskb->len + 4;
-8
drivers/net/wireless/ath/ath9k/init.c
··· 41 41 module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); 42 42 MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); 43 43 44 - int ath9k_pm_qos_value = ATH9K_PM_QOS_DEFAULT_VALUE; 45 - module_param_named(pmqos, ath9k_pm_qos_value, int, S_IRUSR | S_IRGRP | S_IROTH); 46 - MODULE_PARM_DESC(pmqos, "User specified PM-QOS value"); 47 - 48 44 bool is_ath9k_unloaded; 49 45 /* We use the hw_value as an index into our private channel structure */ 50 46 ··· 758 762 ath_init_leds(sc); 759 763 ath_start_rfkill_poll(sc); 760 764 761 - pm_qos_add_request(&sc->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 762 - PM_QOS_DEFAULT_VALUE); 763 - 764 765 return 0; 765 766 766 767 error_world: ··· 824 831 } 825 832 826 833 ieee80211_unregister_hw(hw); 827 - pm_qos_remove_request(&sc->pm_qos_req); 828 834 ath_rx_cleanup(sc); 829 835 ath_tx_cleanup(sc); 830 836 ath9k_deinit_softc(sc);
+3 -2
drivers/net/wireless/ath/ath9k/mac.c
··· 885 885 struct ath_common *common = ath9k_hw_common(ah); 886 886 887 887 if (!(ints & ATH9K_INT_GLOBAL)) 888 - ath9k_hw_enable_interrupts(ah); 888 + ath9k_hw_disable_interrupts(ah); 889 889 890 890 ath_dbg(common, ATH_DBG_INTERRUPT, "0x%x => 0x%x\n", omask, ints); 891 891 ··· 963 963 REG_CLR_BIT(ah, AR_IMR_S5, AR_IMR_S5_TIM_TIMER); 964 964 } 965 965 966 - ath9k_hw_enable_interrupts(ah); 966 + if (ints & ATH9K_INT_GLOBAL) 967 + ath9k_hw_enable_interrupts(ah); 967 968 968 969 return; 969 970 }
-8
drivers/net/wireless/ath/ath9k/main.c
··· 1173 1173 ath9k_btcoex_timer_resume(sc); 1174 1174 } 1175 1175 1176 - /* User has the option to provide pm-qos value as a module 1177 - * parameter rather than using the default value of 1178 - * 'ATH9K_PM_QOS_DEFAULT_VALUE'. 1179 - */ 1180 - pm_qos_update_request(&sc->pm_qos_req, ath9k_pm_qos_value); 1181 - 1182 1176 if (ah->caps.pcie_lcr_extsync_en && common->bus_ops->extn_synch_en) 1183 1177 common->bus_ops->extn_synch_en(common); 1184 1178 ··· 1338 1344 ath_radio_disable(sc, hw); 1339 1345 1340 1346 sc->sc_flags |= SC_OP_INVALID; 1341 - 1342 - pm_qos_update_request(&sc->pm_qos_req, PM_QOS_DEFAULT_VALUE); 1343 1347 1344 1348 mutex_unlock(&sc->mutex); 1345 1349
+2
drivers/net/wireless/ath/carl9170/usb.c
··· 118 118 { USB_DEVICE(0x057c, 0x8402) }, 119 119 /* Qwest/Actiontec 802AIN Wireless N USB Network Adapter */ 120 120 { USB_DEVICE(0x1668, 0x1200) }, 121 + /* Airlive X.USB a/b/g/n */ 122 + { USB_DEVICE(0x1b75, 0x9170) }, 121 123 122 124 /* terminate */ 123 125 {}
+1 -1
drivers/net/wireless/iwlwifi/iwl-5000.c
··· 51 51 #include "iwl-agn-debugfs.h" 52 52 53 53 /* Highest firmware API version supported */ 54 - #define IWL5000_UCODE_API_MAX 2 54 + #define IWL5000_UCODE_API_MAX 5 55 55 #define IWL5150_UCODE_API_MAX 2 56 56 57 57 /* Lowest firmware API version supported */
+9 -5
drivers/net/wireless/p54/p54pci.c
··· 199 199 while (i != idx) { 200 200 u16 len; 201 201 struct sk_buff *skb; 202 + dma_addr_t dma_addr; 202 203 desc = &ring[i]; 203 204 len = le16_to_cpu(desc->len); 204 205 skb = rx_buf[i]; ··· 217 216 218 217 len = priv->common.rx_mtu; 219 218 } 219 + dma_addr = le32_to_cpu(desc->host_addr); 220 + pci_dma_sync_single_for_cpu(priv->pdev, dma_addr, 221 + priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE); 220 222 skb_put(skb, len); 221 223 222 224 if (p54_rx(dev, skb)) { 223 - pci_unmap_single(priv->pdev, 224 - le32_to_cpu(desc->host_addr), 225 - priv->common.rx_mtu + 32, 226 - PCI_DMA_FROMDEVICE); 225 + pci_unmap_single(priv->pdev, dma_addr, 226 + priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE); 227 227 rx_buf[i] = NULL; 228 - desc->host_addr = 0; 228 + desc->host_addr = cpu_to_le32(0); 229 229 } else { 230 230 skb_trim(skb, 0); 231 + pci_dma_sync_single_for_device(priv->pdev, dma_addr, 232 + priv->common.rx_mtu + 32, PCI_DMA_FROMDEVICE); 231 233 desc->len = cpu_to_le16(priv->common.rx_mtu + 32); 232 234 } 233 235
+1
drivers/net/wireless/p54/p54usb.c
··· 98 98 {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */ 99 99 {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ 100 100 {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */ 101 + {USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */ 101 102 {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ 102 103 {USB_DEVICE(0x2001, 0x3705)}, /* D-Link DWL-G120 rev C1 */ 103 104 {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */
+3
drivers/net/wireless/rndis_wlan.c
··· 2597 2597 __le32 mode; 2598 2598 int ret; 2599 2599 2600 + if (priv->device_type != RNDIS_BCM4320B) 2601 + return -ENOTSUPP; 2602 + 2600 2603 netdev_dbg(usbdev->net, "%s(): %s, %d\n", __func__, 2601 2604 enabled ? "enabled" : "disabled", 2602 2605 timeout);
+8
drivers/net/wireless/rt2x00/rt2800pci.c
··· 652 652 */ 653 653 rxdesc->flags |= RX_FLAG_IV_STRIPPED; 654 654 655 + /* 656 + * The hardware has already checked the Michael Mic and has 657 + * stripped it from the frame. Signal this to mac80211. 658 + */ 659 + rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; 660 + 655 661 if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) 656 662 rxdesc->flags |= RX_FLAG_DECRYPTED; 657 663 else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) ··· 1071 1065 { PCI_DEVICE(0x1814, 0x3390), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1072 1066 #endif 1073 1067 #ifdef CONFIG_RT2800PCI_RT35XX 1068 + { PCI_DEVICE(0x1432, 0x7711), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1069 + { PCI_DEVICE(0x1432, 0x7722), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1074 1070 { PCI_DEVICE(0x1814, 0x3060), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1075 1071 { PCI_DEVICE(0x1814, 0x3062), PCI_DEVICE_DATA(&rt2800pci_ops) }, 1076 1072 { PCI_DEVICE(0x1814, 0x3562), PCI_DEVICE_DATA(&rt2800pci_ops) },
+6
drivers/net/wireless/rt2x00/rt2800usb.c
··· 486 486 */ 487 487 rxdesc->flags |= RX_FLAG_IV_STRIPPED; 488 488 489 + /* 490 + * The hardware has already checked the Michael Mic and has 491 + * stripped it from the frame. Signal this to mac80211. 492 + */ 493 + rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; 494 + 489 495 if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) 490 496 rxdesc->flags |= RX_FLAG_DECRYPTED; 491 497 else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC)
+1 -1
drivers/nfc/Kconfig
··· 3 3 # 4 4 5 5 menuconfig NFC_DEVICES 6 - bool "NFC devices" 6 + bool "Near Field Communication (NFC) devices" 7 7 default n 8 8 ---help--- 9 9 You'll have to say Y if your computer contains an NFC device that
+3 -1
drivers/nfc/pn544.c
··· 60 60 struct pn544_info { 61 61 struct miscdevice miscdev; 62 62 struct i2c_client *i2c_dev; 63 - struct regulator_bulk_data regs[2]; 63 + struct regulator_bulk_data regs[3]; 64 64 65 65 enum pn544_state state; 66 66 wait_queue_head_t read_wait; ··· 74 74 75 75 static const char reg_vdd_io[] = "Vdd_IO"; 76 76 static const char reg_vbat[] = "VBat"; 77 + static const char reg_vsim[] = "VSim"; 77 78 78 79 /* sysfs interface */ 79 80 static ssize_t pn544_test(struct device *dev, ··· 741 740 742 741 info->regs[0].supply = reg_vdd_io; 743 742 info->regs[1].supply = reg_vbat; 743 + info->regs[2].supply = reg_vsim; 744 744 r = regulator_bulk_get(&client->dev, ARRAY_SIZE(info->regs), 745 745 info->regs); 746 746 if (r < 0)
+42 -70
drivers/of/pdt.c
··· 36 36 (p)->unique_id = of_pdt_unique_id++; \ 37 37 } while (0) 38 38 39 - static inline const char *of_pdt_node_name(struct device_node *dp) 39 + static char * __init of_pdt_build_full_name(struct device_node *dp) 40 40 { 41 - return dp->path_component_name; 41 + int len, ourlen, plen; 42 + char *n; 43 + 44 + dp->path_component_name = build_path_component(dp); 45 + 46 + plen = strlen(dp->parent->full_name); 47 + ourlen = strlen(dp->path_component_name); 48 + len = ourlen + plen + 2; 49 + 50 + n = prom_early_alloc(len); 51 + strcpy(n, dp->parent->full_name); 52 + if (!of_node_is_root(dp->parent)) { 53 + strcpy(n + plen, "/"); 54 + plen++; 55 + } 56 + strcpy(n + plen, dp->path_component_name); 57 + 58 + return n; 42 59 } 43 60 44 - #else 61 + #else /* CONFIG_SPARC */ 45 62 46 63 static inline void of_pdt_incr_unique_id(void *p) { } 47 64 static inline void irq_trans_init(struct device_node *dp) { } 48 65 49 - static inline const char *of_pdt_node_name(struct device_node *dp) 66 + static char * __init of_pdt_build_full_name(struct device_node *dp) 50 67 { 51 - return dp->name; 68 + static int failsafe_id = 0; /* for generating unique names on failure */ 69 + char *buf; 70 + int len; 71 + 72 + if (of_pdt_prom_ops->pkg2path(dp->phandle, NULL, 0, &len)) 73 + goto failsafe; 74 + 75 + buf = prom_early_alloc(len + 1); 76 + if (of_pdt_prom_ops->pkg2path(dp->phandle, buf, len, &len)) 77 + goto failsafe; 78 + return buf; 79 + 80 + failsafe: 81 + buf = prom_early_alloc(strlen(dp->parent->full_name) + 82 + strlen(dp->name) + 16); 83 + sprintf(buf, "%s/%s@unknown%i", 84 + of_node_is_root(dp->parent) ? "" : dp->parent->full_name, 85 + dp->name, failsafe_id++); 86 + pr_err("%s: pkg2path failed; assigning %s\n", __func__, buf); 87 + return buf; 52 88 } 53 89 54 90 #endif /* !CONFIG_SPARC */ ··· 168 132 return buf; 169 133 } 170 134 171 - static char * __init of_pdt_try_pkg2path(phandle node) 172 - { 173 - char *res, *buf = NULL; 174 - int len; 175 - 176 - if (!of_pdt_prom_ops->pkg2path) 177 - return NULL; 178 - 179 - if (of_pdt_prom_ops->pkg2path(node, buf, 0, &len)) 180 - return NULL; 181 - buf = prom_early_alloc(len + 1); 182 - if (of_pdt_prom_ops->pkg2path(node, buf, len, &len)) { 183 - pr_err("%s: package-to-path failed\n", __func__); 184 - return NULL; 185 - } 186 - 187 - res = strrchr(buf, '/'); 188 - if (!res) { 189 - pr_err("%s: couldn't find / in %s\n", __func__, buf); 190 - return NULL; 191 - } 192 - return res+1; 193 - } 194 - 195 - /* 196 - * When fetching the node's name, first try using package-to-path; if 197 - * that fails (either because the arch hasn't supplied a PROM callback, 198 - * or some other random failure), fall back to just looking at the node's 199 - * 'name' property. 200 - */ 201 - static char * __init of_pdt_build_name(phandle node) 202 - { 203 - char *buf; 204 - 205 - buf = of_pdt_try_pkg2path(node); 206 - if (!buf) 207 - buf = of_pdt_get_one_property(node, "name"); 208 - 209 - return buf; 210 - } 211 - 212 135 static struct device_node * __init of_pdt_create_node(phandle node, 213 136 struct device_node *parent) 214 137 { ··· 182 187 183 188 kref_init(&dp->kref); 184 189 185 - dp->name = of_pdt_build_name(node); 190 + dp->name = of_pdt_get_one_property(node, "name"); 186 191 dp->type = of_pdt_get_one_property(node, "device_type"); 187 192 dp->phandle = node; 188 193 ··· 191 196 irq_trans_init(dp); 192 197 193 198 return dp; 194 - } 195 - 196 - static char * __init of_pdt_build_full_name(struct device_node *dp) 197 - { 198 - int len, ourlen, plen; 199 - char *n; 200 - 201 - plen = strlen(dp->parent->full_name); 202 - ourlen = strlen(of_pdt_node_name(dp)); 203 - len = ourlen + plen + 2; 204 - 205 - n = prom_early_alloc(len); 206 - strcpy(n, dp->parent->full_name); 207 - if (!of_node_is_root(dp->parent)) { 208 - strcpy(n + plen, "/"); 209 - plen++; 210 - } 211 - strcpy(n + plen, of_pdt_node_name(dp)); 212 - 213 - return n; 214 199 } 215 200 216 201 static struct device_node * __init of_pdt_build_tree(struct device_node *parent, ··· 215 240 *(*nextp) = dp; 216 241 *nextp = &dp->allnext; 217 242 218 - #if defined(CONFIG_SPARC) 219 - dp->path_component_name = build_path_component(dp); 220 - #endif 221 243 dp->full_name = of_pdt_build_full_name(dp); 222 244 223 245 dp->child = of_pdt_build_tree(dp,
+2
drivers/pcmcia/pcmcia_resource.c
··· 518 518 flags |= CONF_ENABLE_IOCARD; 519 519 if (flags & CONF_ENABLE_IOCARD) 520 520 s->socket.flags |= SS_IOCARD; 521 + if (flags & CONF_ENABLE_ZVCARD) 522 + s->socket.flags |= SS_ZVCARD | SS_IOCARD; 521 523 if (flags & CONF_ENABLE_SPKR) { 522 524 s->socket.flags |= SS_SPKR_ENA; 523 525 status = CCSR_AUDIO_ENA;
+1 -1
drivers/pcmcia/pxa2xx_base.c
··· 215 215 } 216 216 #endif 217 217 218 - static void pxa2xx_configure_sockets(struct device *dev) 218 + void pxa2xx_configure_sockets(struct device *dev) 219 219 { 220 220 struct pcmcia_low_level *ops = dev->platform_data; 221 221 /*
+1
drivers/pcmcia/pxa2xx_base.h
··· 1 1 int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt); 2 2 void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops); 3 + void pxa2xx_configure_sockets(struct device *dev); 3 4
+3
drivers/pcmcia/pxa2xx_colibri.c
··· 181 181 { 182 182 int ret; 183 183 184 + if (!machine_is_colibri() && !machine_is_colibri320()) 185 + return -ENODEV; 186 + 184 187 colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); 185 188 if (!colibri_pcmcia_device) 186 189 return -ENOMEM;
+1
drivers/pcmcia/pxa2xx_lubbock.c
··· 226 226 lubbock_set_misc_wr((1 << 15) | (1 << 14), 0); 227 227 228 228 pxa2xx_drv_pcmcia_ops(&lubbock_pcmcia_ops); 229 + pxa2xx_configure_sockets(&sadev->dev); 229 230 ret = sa1111_pcmcia_add(sadev, &lubbock_pcmcia_ops, 230 231 pxa2xx_drv_pcmcia_add_one); 231 232 }
+1 -1
drivers/pps/generators/Kconfig
··· 6 6 7 7 config PPS_GENERATOR_PARPORT 8 8 tristate "Parallel port PPS signal generator" 9 - depends on PARPORT 9 + depends on PARPORT && BROKEN 10 10 help 11 11 If you say yes here you get support for a PPS signal generator which 12 12 utilizes STROBE pin of a parallel port to send PPS signals. It uses
+1 -1
drivers/pps/kapi.c
··· 168 168 { 169 169 unsigned long flags; 170 170 int captured = 0; 171 - struct pps_ktime ts_real; 171 + struct pps_ktime ts_real = { .sec = 0, .nsec = 0, .flags = 0 }; 172 172 173 173 /* check event type */ 174 174 BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0);
+6 -6
drivers/rapidio/rio-sysfs.c
··· 77 77 78 78 /* Several chips lock up trying to read undefined config space */ 79 79 if (capable(CAP_SYS_ADMIN)) 80 - size = 0x200000; 80 + size = RIO_MAINT_SPACE_SZ; 81 81 82 - if (off > size) 82 + if (off >= size) 83 83 return 0; 84 84 if (off + count > size) { 85 85 size -= off; ··· 147 147 loff_t init_off = off; 148 148 u8 *data = (u8 *) buf; 149 149 150 - if (off > 0x200000) 150 + if (off >= RIO_MAINT_SPACE_SZ) 151 151 return 0; 152 - if (off + count > 0x200000) { 153 - size = 0x200000 - off; 152 + if (off + count > RIO_MAINT_SPACE_SZ) { 153 + size = RIO_MAINT_SPACE_SZ - off; 154 154 count = size; 155 155 } 156 156 ··· 200 200 .name = "config", 201 201 .mode = S_IRUGO | S_IWUSR, 202 202 }, 203 - .size = 0x200000, 203 + .size = RIO_MAINT_SPACE_SZ, 204 204 .read = rio_read_config, 205 205 .write = rio_write_config, 206 206 };
+1 -1
drivers/regulator/mc13xxx-regulator-core.c
··· 174 174 175 175 dev_dbg(rdev_get_dev(rdev), "%s id: %d val: %d\n", __func__, id, val); 176 176 177 - BUG_ON(val < 0 || val > mc13xxx_regulators[id].desc.n_voltages); 177 + BUG_ON(val > mc13xxx_regulators[id].desc.n_voltages); 178 178 179 179 return mc13xxx_regulators[id].voltages[val]; 180 180 }
+1
drivers/regulator/wm831x-dcdc.c
··· 120 120 return REGULATOR_MODE_IDLE; 121 121 default: 122 122 BUG(); 123 + return -EINVAL; 123 124 } 124 125 } 125 126
+1 -1
drivers/rtc/rtc-at91sam9.c
··· 309 309 .read_alarm = at91_rtc_readalarm, 310 310 .set_alarm = at91_rtc_setalarm, 311 311 .proc = at91_rtc_proc, 312 - .alarm_irq_enabled = at91_rtc_alarm_irq_enable, 312 + .alarm_irq_enable = at91_rtc_alarm_irq_enable, 313 313 }; 314 314 315 315 /*
+9 -5
drivers/rtc/rtc-ds3232.c
··· 1 1 /* 2 2 * RTC client/driver for the Maxim/Dallas DS3232 Real-Time Clock over I2C 3 3 * 4 - * Copyright (C) 2009-2010 Freescale Semiconductor. 4 + * Copyright (C) 2009-2011 Freescale Semiconductor. 5 5 * Author: Jack Lan <jack.lan@freescale.com> 6 6 * 7 7 * This program is free software; you can redistribute it and/or modify it ··· 141 141 time->tm_hour = bcd2bin(hour); 142 142 } 143 143 144 - time->tm_wday = bcd2bin(week); 144 + /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */ 145 + time->tm_wday = bcd2bin(week) - 1; 145 146 time->tm_mday = bcd2bin(day); 146 - time->tm_mon = bcd2bin(month & 0x7F); 147 + /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */ 148 + time->tm_mon = bcd2bin(month & 0x7F) - 1; 147 149 if (century) 148 150 add_century = 100; 149 151 ··· 164 162 buf[0] = bin2bcd(time->tm_sec); 165 163 buf[1] = bin2bcd(time->tm_min); 166 164 buf[2] = bin2bcd(time->tm_hour); 167 - buf[3] = bin2bcd(time->tm_wday); /* Day of the week */ 165 + /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */ 166 + buf[3] = bin2bcd(time->tm_wday + 1); 168 167 buf[4] = bin2bcd(time->tm_mday); /* Date */ 169 - buf[5] = bin2bcd(time->tm_mon); 168 + /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */ 169 + buf[5] = bin2bcd(time->tm_mon + 1); 170 170 if (time->tm_year >= 100) { 171 171 buf[5] |= 0x80; 172 172 buf[6] = bin2bcd(time->tm_year - 100);
+7 -5
drivers/rtc/rtc-s3c.c
··· 77 77 } 78 78 79 79 /* Update control registers */ 80 - static void s3c_rtc_setaie(int to) 80 + static int s3c_rtc_setaie(struct device *dev, unsigned int enabled) 81 81 { 82 82 unsigned int tmp; 83 83 84 - pr_debug("%s: aie=%d\n", __func__, to); 84 + pr_debug("%s: aie=%d\n", __func__, enabled); 85 85 86 86 tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN; 87 87 88 - if (to) 88 + if (enabled) 89 89 tmp |= S3C2410_RTCALM_ALMEN; 90 90 91 91 writeb(tmp, s3c_rtc_base + S3C2410_RTCALM); 92 + 93 + return 0; 92 94 } 93 95 94 96 static int s3c_rtc_setpie(struct device *dev, int enabled) ··· 310 308 311 309 writeb(alrm_en, base + S3C2410_RTCALM); 312 310 313 - s3c_rtc_setaie(alrm->enabled); 311 + s3c_rtc_setaie(dev, alrm->enabled); 314 312 315 313 return 0; 316 314 } ··· 442 440 rtc_device_unregister(rtc); 443 441 444 442 s3c_rtc_setpie(&dev->dev, 0); 445 - s3c_rtc_setaie(0); 443 + s3c_rtc_setaie(&dev->dev, 0); 446 444 447 445 clk_disable(rtc_clk); 448 446 clk_put(rtc_clk);
+2 -2
drivers/s390/block/xpram.c
··· 62 62 /* 63 63 * Parameter parsing functions. 64 64 */ 65 - static int __initdata devs = XPRAM_DEVS; 66 - static char __initdata *sizes[XPRAM_MAX_DEVS]; 65 + static int devs = XPRAM_DEVS; 66 + static char *sizes[XPRAM_MAX_DEVS]; 67 67 68 68 module_param(devs, int, 0); 69 69 module_param_array(sizes, charp, NULL, 0);
+2 -1
drivers/s390/char/keyboard.c
··· 460 460 unsigned int cmd, unsigned long arg) 461 461 { 462 462 void __user *argp; 463 - int ct, perm; 463 + unsigned int ct; 464 + int perm; 464 465 465 466 argp = (void __user *)arg; 466 467
+8
drivers/s390/char/tape.h
··· 280 280 return rc; 281 281 } 282 282 283 + static inline void 284 + tape_do_io_async_free(struct tape_device *device, struct tape_request *request) 285 + { 286 + request->callback = (void *) tape_free_request; 287 + request->callback_data = NULL; 288 + tape_do_io_async(device, request); 289 + } 290 + 283 291 extern int tape_oper_handler(int irq, int status); 284 292 extern void tape_noper_handler(int irq, int status); 285 293 extern int tape_open(struct tape_device *);
+41 -18
drivers/s390/char/tape_34xx.c
··· 53 53 * Medium sense for 34xx tapes. There is no 'real' medium sense call. 54 54 * So we just do a normal sense. 55 55 */ 56 - static int 57 - tape_34xx_medium_sense(struct tape_device *device) 56 + static void __tape_34xx_medium_sense(struct tape_request *request) 58 57 { 59 - struct tape_request *request; 60 - unsigned char *sense; 61 - int rc; 58 + struct tape_device *device = request->device; 59 + unsigned char *sense; 62 60 63 - request = tape_alloc_request(1, 32); 64 - if (IS_ERR(request)) { 65 - DBF_EXCEPTION(6, "MSEN fail\n"); 66 - return PTR_ERR(request); 67 - } 68 - 69 - request->op = TO_MSEN; 70 - tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); 71 - 72 - rc = tape_do_io_interruptible(device, request); 73 61 if (request->rc == 0) { 74 62 sense = request->cpdata; 75 63 ··· 76 88 device->tape_generic_status |= GMT_WR_PROT(~0); 77 89 else 78 90 device->tape_generic_status &= ~GMT_WR_PROT(~0); 79 - } else { 91 + } else 80 92 DBF_EVENT(4, "tape_34xx: medium sense failed with rc=%d\n", 81 93 request->rc); 82 - } 83 94 tape_free_request(request); 95 + } 84 96 97 + static int tape_34xx_medium_sense(struct tape_device *device) 98 + { 99 + struct tape_request *request; 100 + int rc; 101 + 102 + request = tape_alloc_request(1, 32); 103 + if (IS_ERR(request)) { 104 + DBF_EXCEPTION(6, "MSEN fail\n"); 105 + return PTR_ERR(request); 106 + } 107 + 108 + request->op = TO_MSEN; 109 + tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); 110 + rc = tape_do_io_interruptible(device, request); 111 + __tape_34xx_medium_sense(request); 85 112 return rc; 113 + } 114 + 115 + static void tape_34xx_medium_sense_async(struct tape_device *device) 116 + { 117 + struct tape_request *request; 118 + 119 + request = tape_alloc_request(1, 32); 120 + if (IS_ERR(request)) { 121 + DBF_EXCEPTION(6, "MSEN fail\n"); 122 + return; 123 + } 124 + 125 + request->op = TO_MSEN; 126 + tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); 127 + request->callback = (void *) __tape_34xx_medium_sense; 128 + request->callback_data = NULL; 129 + tape_do_io_async(device, request); 86 130 } 87 131 88 132 struct tape_34xx_work { ··· 129 109 * is inserted but cannot call tape_do_io* from an interrupt context. 130 110 * Maybe that's useful for other actions we want to start from the 131 111 * interrupt handler. 112 + * Note: the work handler is called by the system work queue. The tape 113 + * commands started by the handler need to be asynchrounous, otherwise 114 + * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq). 132 115 */ 133 116 static void 134 117 tape_34xx_work_handler(struct work_struct *work) ··· 142 119 143 120 switch(p->op) { 144 121 case TO_MSEN: 145 - tape_34xx_medium_sense(device); 122 + tape_34xx_medium_sense_async(device); 146 123 break; 147 124 default: 148 125 DBF_EVENT(3, "T34XX: internal error: unknown work\n");
+67 -16
drivers/s390/char/tape_3590.c
··· 329 329 /* 330 330 * Enable encryption 331 331 */ 332 - static int tape_3592_enable_crypt(struct tape_device *device) 332 + static struct tape_request *__tape_3592_enable_crypt(struct tape_device *device) 333 333 { 334 334 struct tape_request *request; 335 335 char *data; 336 336 337 337 DBF_EVENT(6, "tape_3592_enable_crypt\n"); 338 338 if (!crypt_supported(device)) 339 - return -ENOSYS; 339 + return ERR_PTR(-ENOSYS); 340 340 request = tape_alloc_request(2, 72); 341 341 if (IS_ERR(request)) 342 - return PTR_ERR(request); 342 + return request; 343 343 data = request->cpdata; 344 344 memset(data,0,72); 345 345 ··· 354 354 request->op = TO_CRYPT_ON; 355 355 tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data); 356 356 tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36); 357 + return request; 358 + } 359 + 360 + static int tape_3592_enable_crypt(struct tape_device *device) 361 + { 362 + struct tape_request *request; 363 + 364 + request = __tape_3592_enable_crypt(device); 365 + if (IS_ERR(request)) 366 + return PTR_ERR(request); 357 367 return tape_do_io_free(device, request); 368 + } 369 + 370 + static void tape_3592_enable_crypt_async(struct tape_device *device) 371 + { 372 + struct tape_request *request; 373 + 374 + request = __tape_3592_enable_crypt(device); 375 + if (!IS_ERR(request)) 376 + tape_do_io_async_free(device, request); 358 377 } 359 378 360 379 /* 361 380 * Disable encryption 362 381 */ 363 - static int tape_3592_disable_crypt(struct tape_device *device) 382 + static struct tape_request *__tape_3592_disable_crypt(struct tape_device *device) 364 383 { 365 384 struct tape_request *request; 366 385 char *data; 367 386 368 387 DBF_EVENT(6, "tape_3592_disable_crypt\n"); 369 388 if (!crypt_supported(device)) 370 - return -ENOSYS; 389 + return ERR_PTR(-ENOSYS); 371 390 request = tape_alloc_request(2, 72); 372 391 if (IS_ERR(request)) 373 - return PTR_ERR(request); 392 + return request; 374 393 data = request->cpdata; 375 394 memset(data,0,72); 376 395 ··· 402 383 tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data); 403 384 tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36); 404 385 386 + return request; 387 + } 388 + 389 + static int tape_3592_disable_crypt(struct tape_device *device) 390 + { 391 + struct tape_request *request; 392 + 393 + request = __tape_3592_disable_crypt(device); 394 + if (IS_ERR(request)) 395 + return PTR_ERR(request); 405 396 return tape_do_io_free(device, request); 397 + } 398 + 399 + static void tape_3592_disable_crypt_async(struct tape_device *device) 400 + { 401 + struct tape_request *request; 402 + 403 + request = __tape_3592_disable_crypt(device); 404 + if (!IS_ERR(request)) 405 + tape_do_io_async_free(device, request); 406 406 } 407 407 408 408 /* ··· 495 457 /* 496 458 * SENSE Medium: Get Sense data about medium state 497 459 */ 498 - static int 499 - tape_3590_sense_medium(struct tape_device *device) 460 + static int tape_3590_sense_medium(struct tape_device *device) 500 461 { 501 462 struct tape_request *request; 502 463 ··· 505 468 request->op = TO_MSEN; 506 469 tape_ccw_end(request->cpaddr, MEDIUM_SENSE, 128, request->cpdata); 507 470 return tape_do_io_free(device, request); 471 + } 472 + 473 + static void tape_3590_sense_medium_async(struct tape_device *device) 474 + { 475 + struct tape_request *request; 476 + 477 + request = tape_alloc_request(1, 128); 478 + if (IS_ERR(request)) 479 + return; 480 + request->op = TO_MSEN; 481 + tape_ccw_end(request->cpaddr, MEDIUM_SENSE, 128, request->cpdata); 482 + tape_do_io_async_free(device, request); 508 483 } 509 484 510 485 /* ··· 595 546 * 2. The attention msg is written to the "read subsystem data" buffer. 596 547 * In this case we probably should print it to the console. 597 548 */ 598 - static int 599 - tape_3590_read_attmsg(struct tape_device *device) 549 + static void tape_3590_read_attmsg_async(struct tape_device *device) 600 550 { 601 551 struct tape_request *request; 602 552 char *buf; 603 553 604 554 request = tape_alloc_request(3, 4096); 605 555 if (IS_ERR(request)) 606 - return PTR_ERR(request); 556 + return; 607 557 request->op = TO_READ_ATTMSG; 608 558 buf = request->cpdata; 609 559 buf[0] = PREP_RD_SS_DATA; ··· 610 562 tape_ccw_cc(request->cpaddr, PERFORM_SS_FUNC, 12, buf); 611 563 tape_ccw_cc(request->cpaddr + 1, READ_SS_DATA, 4096 - 12, buf + 12); 612 564 tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL); 613 - return tape_do_io_free(device, request); 565 + tape_do_io_async_free(device, request); 614 566 } 615 567 616 568 /* 617 569 * These functions are used to schedule follow-up actions from within an 618 570 * interrupt context (like unsolicited interrupts). 571 + * Note: the work handler is called by the system work queue. The tape 572 + * commands started by the handler need to be asynchrounous, otherwise 573 + * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq). 619 574 */ 620 575 struct work_handler_data { 621 576 struct tape_device *device; ··· 634 583 635 584 switch (p->op) { 636 585 case TO_MSEN: 637 - tape_3590_sense_medium(p->device); 586 + tape_3590_sense_medium_async(p->device); 638 587 break; 639 588 case TO_READ_ATTMSG: 640 - tape_3590_read_attmsg(p->device); 589 + tape_3590_read_attmsg_async(p->device); 641 590 break; 642 591 case TO_CRYPT_ON: 643 - tape_3592_enable_crypt(p->device); 592 + tape_3592_enable_crypt_async(p->device); 644 593 break; 645 594 case TO_CRYPT_OFF: 646 - tape_3592_disable_crypt(p->device); 595 + tape_3592_disable_crypt_async(p->device); 647 596 break; 648 597 default: 649 598 DBF_EVENT(3, "T3590: work handler undefined for "
+1 -1
drivers/scsi/scsi_lib.c
··· 443 443 &sdev->request_queue->queue_flags); 444 444 if (flagset) 445 445 queue_flag_set(QUEUE_FLAG_REENTER, sdev->request_queue); 446 - __blk_run_queue(sdev->request_queue); 446 + __blk_run_queue(sdev->request_queue, false); 447 447 if (flagset) 448 448 queue_flag_clear(QUEUE_FLAG_REENTER, sdev->request_queue); 449 449 spin_unlock(sdev->request_queue->queue_lock);
+1 -1
drivers/scsi/scsi_transport_fc.c
··· 3829 3829 !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags); 3830 3830 if (flagset) 3831 3831 queue_flag_set(QUEUE_FLAG_REENTER, rport->rqst_q); 3832 - __blk_run_queue(rport->rqst_q); 3832 + __blk_run_queue(rport->rqst_q, false); 3833 3833 if (flagset) 3834 3834 queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q); 3835 3835 spin_unlock_irqrestore(rport->rqst_q->queue_lock, flags);
-1
drivers/thermal/Kconfig
··· 4 4 5 5 menuconfig THERMAL 6 6 tristate "Generic Thermal sysfs driver" 7 - depends on NET 8 7 help 9 8 Generic Thermal Sysfs driver offers a generic mechanism for 10 9 thermal management. Usually it's made up of one or more thermal
+21 -19
drivers/thermal/thermal_sys.c
··· 62 62 63 63 static unsigned int thermal_event_seqnum; 64 64 65 - static struct genl_family thermal_event_genl_family = { 66 - .id = GENL_ID_GENERATE, 67 - .name = THERMAL_GENL_FAMILY_NAME, 68 - .version = THERMAL_GENL_VERSION, 69 - .maxattr = THERMAL_GENL_ATTR_MAX, 70 - }; 71 - 72 - static struct genl_multicast_group thermal_event_mcgrp = { 73 - .name = THERMAL_GENL_MCAST_GROUP_NAME, 74 - }; 75 - 76 - static int genetlink_init(void); 77 - static void genetlink_exit(void); 78 - 79 65 static int get_idr(struct idr *idr, struct mutex *lock, int *id) 80 66 { 81 67 int err; ··· 1211 1225 1212 1226 EXPORT_SYMBOL(thermal_zone_device_unregister); 1213 1227 1228 + #ifdef CONFIG_NET 1229 + static struct genl_family thermal_event_genl_family = { 1230 + .id = GENL_ID_GENERATE, 1231 + .name = THERMAL_GENL_FAMILY_NAME, 1232 + .version = THERMAL_GENL_VERSION, 1233 + .maxattr = THERMAL_GENL_ATTR_MAX, 1234 + }; 1235 + 1236 + static struct genl_multicast_group thermal_event_mcgrp = { 1237 + .name = THERMAL_GENL_MCAST_GROUP_NAME, 1238 + }; 1239 + 1214 1240 int generate_netlink_event(u32 orig, enum events event) 1215 1241 { 1216 1242 struct sk_buff *skb; ··· 1299 1301 return result; 1300 1302 } 1301 1303 1304 + static void genetlink_exit(void) 1305 + { 1306 + genl_unregister_family(&thermal_event_genl_family); 1307 + } 1308 + #else /* !CONFIG_NET */ 1309 + static inline int genetlink_init(void) { return 0; } 1310 + static inline void genetlink_exit(void) {} 1311 + #endif /* !CONFIG_NET */ 1312 + 1302 1313 static int __init thermal_init(void) 1303 1314 { 1304 1315 int result = 0; ··· 1321 1314 } 1322 1315 result = genetlink_init(); 1323 1316 return result; 1324 - } 1325 - 1326 - static void genetlink_exit(void) 1327 - { 1328 - genl_unregister_family(&thermal_event_genl_family); 1329 1317 } 1330 1318 1331 1319 static void __exit thermal_exit(void)
+1
drivers/tty/serial/serial_cs.c
··· 712 712 PCMCIA_PFC_DEVICE_PROD_ID12(1, "Xircom", "CreditCard Ethernet+Modem II", 0x2e3ee845, 0xeca401bf), 713 713 PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0e01), 714 714 PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0a05), 715 + PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x0b05), 715 716 PCMCIA_PFC_DEVICE_MANF_CARD(1, 0x0032, 0x1101), 716 717 PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0104, 0x0070), 717 718 PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0101, 0x0562),
+7 -11
drivers/usb/core/hub.c
··· 2681 2681 2682 2682 mutex_lock(&usb_address0_mutex); 2683 2683 2684 - if (!udev->config && oldspeed == USB_SPEED_SUPER) { 2685 - /* Don't reset USB 3.0 devices during an initial setup */ 2686 - usb_set_device_state(udev, USB_STATE_DEFAULT); 2687 - } else { 2688 - /* Reset the device; full speed may morph to high speed */ 2689 - /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */ 2690 - retval = hub_port_reset(hub, port1, udev, delay); 2691 - if (retval < 0) /* error or disconnect */ 2692 - goto fail; 2693 - /* success, speed is known */ 2694 - } 2684 + /* Reset the device; full speed may morph to high speed */ 2685 + /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */ 2686 + retval = hub_port_reset(hub, port1, udev, delay); 2687 + if (retval < 0) /* error or disconnect */ 2688 + goto fail; 2689 + /* success, speed is known */ 2690 + 2695 2691 retval = -ENODEV; 2696 2692 2697 2693 if (oldspeed != USB_SPEED_UNKNOWN && oldspeed != udev->speed) {
+8
drivers/usb/core/quirks.c
··· 48 48 { USB_DEVICE(0x04b4, 0x0526), .driver_info = 49 49 USB_QUIRK_CONFIG_INTF_STRINGS }, 50 50 51 + /* Samsung Android phone modem - ID conflict with SPH-I500 */ 52 + { USB_DEVICE(0x04e8, 0x6601), .driver_info = 53 + USB_QUIRK_CONFIG_INTF_STRINGS }, 54 + 51 55 /* Roland SC-8820 */ 52 56 { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, 53 57 ··· 71 67 72 68 /* M-Systems Flash Disk Pioneers */ 73 69 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, 70 + 71 + /* Keytouch QWERTY Panel keyboard */ 72 + { USB_DEVICE(0x0926, 0x3333), .driver_info = 73 + USB_QUIRK_CONFIG_INTF_STRINGS }, 74 74 75 75 /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ 76 76 { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
+10 -5
drivers/usb/gadget/f_phonet.c
··· 346 346 347 347 if (unlikely(!skb)) 348 348 break; 349 - skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, 0, 350 - req->actual); 349 + 350 + if (skb->len == 0) { /* First fragment */ 351 + skb->protocol = htons(ETH_P_PHONET); 352 + skb_reset_mac_header(skb); 353 + /* Can't use pskb_pull() on page in IRQ */ 354 + memcpy(skb_put(skb, 1), page_address(page), 1); 355 + } 356 + 357 + skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, 358 + skb->len == 0, req->actual); 351 359 page = NULL; 352 360 353 361 if (req->actual < req->length) { /* Last fragment */ 354 - skb->protocol = htons(ETH_P_PHONET); 355 - skb_reset_mac_header(skb); 356 - pskb_pull(skb, 1); 357 362 skb->dev = dev; 358 363 dev->stats.rx_packets++; 359 364 dev->stats.rx_bytes += skb->len;
+1
drivers/usb/host/ehci-xilinx-of.c
··· 29 29 30 30 #include <linux/of.h> 31 31 #include <linux/of_platform.h> 32 + #include <linux/of_address.h> 32 33 33 34 /** 34 35 * ehci_xilinx_of_setup - Initialize the device for ehci_reset()
+5 -4
drivers/usb/host/xhci-dbg.c
··· 169 169 } 170 170 } 171 171 172 - void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num) 172 + void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num) 173 173 { 174 - void *addr; 174 + struct xhci_intr_reg __iomem *ir_set = &xhci->run_regs->ir_set[set_num]; 175 + void __iomem *addr; 175 176 u32 temp; 176 177 u64 temp_64; 177 178 ··· 450 449 } 451 450 } 452 451 453 - void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx) 452 + static void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx) 454 453 { 455 454 /* Fields are 32 bits wide, DMA addresses are in bytes */ 456 455 int field_size = 32 / 8; ··· 489 488 dbg_rsvd64(xhci, (u64 *)slot_ctx, dma); 490 489 } 491 490 492 - void xhci_dbg_ep_ctx(struct xhci_hcd *xhci, 491 + static void xhci_dbg_ep_ctx(struct xhci_hcd *xhci, 493 492 struct xhci_container_ctx *ctx, 494 493 unsigned int last_ep) 495 494 {
+5 -5
drivers/usb/host/xhci-mem.c
··· 307 307 308 308 /***************** Streams structures manipulation *************************/ 309 309 310 - void xhci_free_stream_ctx(struct xhci_hcd *xhci, 310 + static void xhci_free_stream_ctx(struct xhci_hcd *xhci, 311 311 unsigned int num_stream_ctxs, 312 312 struct xhci_stream_ctx *stream_ctx, dma_addr_t dma) 313 313 { ··· 335 335 * The stream context array must be a power of 2, and can be as small as 336 336 * 64 bytes or as large as 1MB. 337 337 */ 338 - struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, 338 + static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, 339 339 unsigned int num_stream_ctxs, dma_addr_t *dma, 340 340 gfp_t mem_flags) 341 341 { ··· 1900 1900 val &= DBOFF_MASK; 1901 1901 xhci_dbg(xhci, "// Doorbell array is located at offset 0x%x" 1902 1902 " from cap regs base addr\n", val); 1903 - xhci->dba = (void *) xhci->cap_regs + val; 1903 + xhci->dba = (void __iomem *) xhci->cap_regs + val; 1904 1904 xhci_dbg_regs(xhci); 1905 1905 xhci_print_run_regs(xhci); 1906 1906 /* Set ir_set to interrupt register set 0 */ 1907 - xhci->ir_set = (void *) xhci->run_regs->ir_set; 1907 + xhci->ir_set = &xhci->run_regs->ir_set[0]; 1908 1908 1909 1909 /* 1910 1910 * Event ring setup: Allocate a normal ring, but also setup ··· 1961 1961 /* Set the event ring dequeue address */ 1962 1962 xhci_set_hc_event_deq(xhci); 1963 1963 xhci_dbg(xhci, "Wrote ERST address to ir_set 0.\n"); 1964 - xhci_print_ir_set(xhci, xhci->ir_set, 0); 1964 + xhci_print_ir_set(xhci, 0); 1965 1965 1966 1966 /* 1967 1967 * XXX: Might need to set the Interrupter Moderation Register to
+23 -17
drivers/usb/host/xhci-ring.c
··· 474 474 state->new_deq_seg = find_trb_seg(cur_td->start_seg, 475 475 dev->eps[ep_index].stopped_trb, 476 476 &state->new_cycle_state); 477 - if (!state->new_deq_seg) 478 - BUG(); 477 + if (!state->new_deq_seg) { 478 + WARN_ON(1); 479 + return; 480 + } 481 + 479 482 /* Dig out the cycle state saved by the xHC during the stop ep cmd */ 480 483 xhci_dbg(xhci, "Finding endpoint context\n"); 481 484 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); ··· 489 486 state->new_deq_seg = find_trb_seg(state->new_deq_seg, 490 487 state->new_deq_ptr, 491 488 &state->new_cycle_state); 492 - if (!state->new_deq_seg) 493 - BUG(); 489 + if (!state->new_deq_seg) { 490 + WARN_ON(1); 491 + return; 492 + } 494 493 495 494 trb = &state->new_deq_ptr->generic; 496 495 if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) && ··· 2368 2363 2369 2364 /* Scatter gather list entries may cross 64KB boundaries */ 2370 2365 running_total = TRB_MAX_BUFF_SIZE - 2371 - (sg_dma_address(sg) & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); 2366 + (sg_dma_address(sg) & (TRB_MAX_BUFF_SIZE - 1)); 2367 + running_total &= TRB_MAX_BUFF_SIZE - 1; 2372 2368 if (running_total != 0) 2373 2369 num_trbs++; 2374 2370 2375 2371 /* How many more 64KB chunks to transfer, how many more TRBs? */ 2376 - while (running_total < sg_dma_len(sg)) { 2372 + while (running_total < sg_dma_len(sg) && running_total < temp) { 2377 2373 num_trbs++; 2378 2374 running_total += TRB_MAX_BUFF_SIZE; 2379 2375 } ··· 2400 2394 static void check_trb_math(struct urb *urb, int num_trbs, int running_total) 2401 2395 { 2402 2396 if (num_trbs != 0) 2403 - dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated number of " 2397 + dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated number of " 2404 2398 "TRBs, %d left\n", __func__, 2405 2399 urb->ep->desc.bEndpointAddress, num_trbs); 2406 2400 if (running_total != urb->transfer_buffer_length) 2407 - dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, " 2401 + dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, " 2408 2402 "queued %#x (%d), asked for %#x (%d)\n", 2409 2403 __func__, 2410 2404 urb->ep->desc.bEndpointAddress, ··· 2539 2533 sg = urb->sg; 2540 2534 addr = (u64) sg_dma_address(sg); 2541 2535 this_sg_len = sg_dma_len(sg); 2542 - trb_buff_len = TRB_MAX_BUFF_SIZE - 2543 - (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); 2536 + trb_buff_len = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1)); 2544 2537 trb_buff_len = min_t(int, trb_buff_len, this_sg_len); 2545 2538 if (trb_buff_len > urb->transfer_buffer_length) 2546 2539 trb_buff_len = urb->transfer_buffer_length; ··· 2577 2572 (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), 2578 2573 (unsigned int) addr + trb_buff_len); 2579 2574 if (TRB_MAX_BUFF_SIZE - 2580 - (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)) < trb_buff_len) { 2575 + (addr & (TRB_MAX_BUFF_SIZE - 1)) < trb_buff_len) { 2581 2576 xhci_warn(xhci, "WARN: sg dma xfer crosses 64KB boundaries!\n"); 2582 2577 xhci_dbg(xhci, "Next boundary at %#x, end dma = %#x\n", 2583 2578 (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), ··· 2621 2616 } 2622 2617 2623 2618 trb_buff_len = TRB_MAX_BUFF_SIZE - 2624 - (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); 2619 + (addr & (TRB_MAX_BUFF_SIZE - 1)); 2625 2620 trb_buff_len = min_t(int, trb_buff_len, this_sg_len); 2626 2621 if (running_total + trb_buff_len > urb->transfer_buffer_length) 2627 2622 trb_buff_len = ··· 2661 2656 num_trbs = 0; 2662 2657 /* How much data is (potentially) left before the 64KB boundary? */ 2663 2658 running_total = TRB_MAX_BUFF_SIZE - 2664 - (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); 2659 + (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1)); 2660 + running_total &= TRB_MAX_BUFF_SIZE - 1; 2665 2661 2666 2662 /* If there's some data on this 64KB chunk, or we have to send a 2667 2663 * zero-length transfer, we need at least one TRB ··· 2706 2700 /* How much data is in the first TRB? */ 2707 2701 addr = (u64) urb->transfer_dma; 2708 2702 trb_buff_len = TRB_MAX_BUFF_SIZE - 2709 - (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); 2710 - if (urb->transfer_buffer_length < trb_buff_len) 2703 + (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1)); 2704 + if (trb_buff_len > urb->transfer_buffer_length) 2711 2705 trb_buff_len = urb->transfer_buffer_length; 2712 2706 2713 2707 first_trb = true; ··· 2885 2879 addr = (u64) (urb->transfer_dma + urb->iso_frame_desc[i].offset); 2886 2880 td_len = urb->iso_frame_desc[i].length; 2887 2881 2888 - running_total = TRB_MAX_BUFF_SIZE - 2889 - (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); 2882 + running_total = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1)); 2883 + running_total &= TRB_MAX_BUFF_SIZE - 1; 2890 2884 if (running_total != 0) 2891 2885 num_trbs++; 2892 2886
+7 -7
drivers/usb/host/xhci.c
··· 109 109 /* 110 110 * Set the run bit and wait for the host to be running. 111 111 */ 112 - int xhci_start(struct xhci_hcd *xhci) 112 + static int xhci_start(struct xhci_hcd *xhci) 113 113 { 114 114 u32 temp; 115 115 int ret; ··· 329 329 330 330 331 331 #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING 332 - void xhci_event_ring_work(unsigned long arg) 332 + static void xhci_event_ring_work(unsigned long arg) 333 333 { 334 334 unsigned long flags; 335 335 int temp; ··· 473 473 xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp)); 474 474 xhci_writel(xhci, ER_IRQ_ENABLE(temp), 475 475 &xhci->ir_set->irq_pending); 476 - xhci_print_ir_set(xhci, xhci->ir_set, 0); 476 + xhci_print_ir_set(xhci, 0); 477 477 478 478 if (NUM_TEST_NOOPS > 0) 479 479 doorbell = xhci_setup_one_noop(xhci); ··· 528 528 temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); 529 529 xhci_writel(xhci, ER_IRQ_DISABLE(temp), 530 530 &xhci->ir_set->irq_pending); 531 - xhci_print_ir_set(xhci, xhci->ir_set, 0); 531 + xhci_print_ir_set(xhci, 0); 532 532 533 533 xhci_dbg(xhci, "cleaning up memory\n"); 534 534 xhci_mem_cleanup(xhci); ··· 755 755 temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); 756 756 xhci_writel(xhci, ER_IRQ_DISABLE(temp), 757 757 &xhci->ir_set->irq_pending); 758 - xhci_print_ir_set(xhci, xhci->ir_set, 0); 758 + xhci_print_ir_set(xhci, 0); 759 759 760 760 xhci_dbg(xhci, "cleaning up memory\n"); 761 761 xhci_mem_cleanup(xhci); ··· 857 857 /* Returns 1 if the arguments are OK; 858 858 * returns 0 this is a root hub; returns -EINVAL for NULL pointers. 859 859 */ 860 - int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, 860 + static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, 861 861 struct usb_host_endpoint *ep, int check_ep, bool check_virt_dev, 862 862 const char *func) { 863 863 struct xhci_hcd *xhci; ··· 1693 1693 xhci_dbg_ctx(xhci, in_ctx, xhci_last_valid_endpoint(add_flags)); 1694 1694 } 1695 1695 1696 - void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, 1696 + static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, 1697 1697 unsigned int slot_id, unsigned int ep_index, 1698 1698 struct xhci_dequeue_state *deq_state) 1699 1699 {
+1 -1
drivers/usb/host/xhci.h
··· 1348 1348 } 1349 1349 1350 1350 /* xHCI debugging */ 1351 - void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num); 1351 + void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num); 1352 1352 void xhci_print_registers(struct xhci_hcd *xhci); 1353 1353 void xhci_dbg_regs(struct xhci_hcd *xhci); 1354 1354 void xhci_print_run_regs(struct xhci_hcd *xhci);
+1
drivers/usb/musb/musb_core.c
··· 1864 1864 INIT_LIST_HEAD(&musb->out_bulk); 1865 1865 1866 1866 hcd->uses_new_polling = 1; 1867 + hcd->has_tt = 1; 1867 1868 1868 1869 musb->vbuserr_retry = VBUSERR_RETRY_COUNT; 1869 1870 musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON;
+9 -8
drivers/usb/musb/musb_core.h
··· 488 488 unsigned set_address:1; 489 489 unsigned test_mode:1; 490 490 unsigned softconnect:1; 491 + 492 + u8 address; 493 + u8 test_mode_nr; 494 + u16 ackpend; /* ep0 */ 495 + enum musb_g_ep0_state ep0_state; 496 + struct usb_gadget g; /* the gadget */ 497 + struct usb_gadget_driver *gadget_driver; /* its driver */ 498 + #endif 499 + 491 500 /* 492 501 * FIXME: Remove this flag. 493 502 * ··· 509 500 * buffering until we get it working. 510 501 */ 511 502 unsigned double_buffer_not_ok:1 __deprecated; 512 - 513 - u8 address; 514 - u8 test_mode_nr; 515 - u16 ackpend; /* ep0 */ 516 - enum musb_g_ep0_state ep0_state; 517 - struct usb_gadget g; /* the gadget */ 518 - struct usb_gadget_driver *gadget_driver; /* its driver */ 519 - #endif 520 503 521 504 struct musb_hdrc_config *config; 522 505
+1
drivers/usb/musb/omap2430.c
··· 362 362 363 363 static int omap2430_musb_exit(struct musb *musb) 364 364 { 365 + del_timer_sync(&musb_idle_timer); 365 366 366 367 omap2430_low_level_exit(musb); 367 368 otg_put_transceiver(musb->xceiv);
+3
drivers/usb/serial/sierra.c
··· 301 301 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */ 302 302 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist 303 303 }, 304 + { USB_DEVICE(0x0f3d, 0x68A3), /* Airprime/Sierra Wireless Direct IP modems */ 305 + .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist 306 + }, 304 307 { USB_DEVICE(0x413C, 0x08133) }, /* Dell Computer Corp. Wireless 5720 VZW Mobile Broadband (EVDO Rev-A) Minicard GPS Port */ 305 308 306 309 { }
+9 -6
drivers/usb/serial/usb_wwan.c
··· 295 295 __func__, status, endpoint); 296 296 } else { 297 297 tty = tty_port_tty_get(&port->port); 298 - if (urb->actual_length) { 299 - tty_insert_flip_string(tty, data, urb->actual_length); 300 - tty_flip_buffer_push(tty); 301 - } else 302 - dbg("%s: empty read urb received", __func__); 303 - tty_kref_put(tty); 298 + if (tty) { 299 + if (urb->actual_length) { 300 + tty_insert_flip_string(tty, data, 301 + urb->actual_length); 302 + tty_flip_buffer_push(tty); 303 + } else 304 + dbg("%s: empty read urb received", __func__); 305 + tty_kref_put(tty); 306 + } 304 307 305 308 /* Resubmit urb so we continue receiving */ 306 309 if (status != -ESHUTDOWN) {
+12
drivers/usb/serial/visor.c
··· 27 27 #include <linux/uaccess.h> 28 28 #include <linux/usb.h> 29 29 #include <linux/usb/serial.h> 30 + #include <linux/usb/cdc.h> 30 31 #include "visor.h" 31 32 32 33 /* ··· 479 478 const struct usb_device_id *id); 480 479 481 480 dbg("%s", __func__); 481 + 482 + /* 483 + * some Samsung Android phones in modem mode have the same ID 484 + * as SPH-I500, but they are ACM devices, so dont bind to them 485 + */ 486 + if (id->idVendor == SAMSUNG_VENDOR_ID && 487 + id->idProduct == SAMSUNG_SPH_I500_ID && 488 + serial->dev->descriptor.bDeviceClass == USB_CLASS_COMM && 489 + serial->dev->descriptor.bDeviceSubClass == 490 + USB_CDC_SUBCLASS_ACM) 491 + return -ENODEV; 482 492 483 493 if (serial->dev->actconfig->desc.bConfigurationValue != 1) { 484 494 dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
+8 -1
drivers/video/backlight/ltv350qv.c
··· 239 239 lcd->spi = spi; 240 240 lcd->power = FB_BLANK_POWERDOWN; 241 241 lcd->buffer = kzalloc(8, GFP_KERNEL); 242 + if (!lcd->buffer) { 243 + ret = -ENOMEM; 244 + goto out_free_lcd; 245 + } 242 246 243 247 ld = lcd_device_register("ltv350qv", &spi->dev, lcd, &ltv_ops); 244 248 if (IS_ERR(ld)) { 245 249 ret = PTR_ERR(ld); 246 - goto out_free_lcd; 250 + goto out_free_buffer; 247 251 } 248 252 lcd->ld = ld; 249 253 ··· 261 257 262 258 out_unregister: 263 259 lcd_device_unregister(ld); 260 + out_free_buffer: 261 + kfree(lcd->buffer); 264 262 out_free_lcd: 265 263 kfree(lcd); 266 264 return ret; ··· 274 268 275 269 ltv350qv_power(lcd, FB_BLANK_POWERDOWN); 276 270 lcd_device_unregister(lcd->ld); 271 + kfree(lcd->buffer); 277 272 kfree(lcd); 278 273 279 274 return 0;
+1
fs/afs/write.c
··· 140 140 candidate->first = candidate->last = index; 141 141 candidate->offset_first = from; 142 142 candidate->to_last = to; 143 + INIT_LIST_HEAD(&candidate->link); 143 144 candidate->usage = 1; 144 145 candidate->state = AFS_WBACK_PENDING; 145 146 init_waitqueue_head(&candidate->waitq);
+41 -11
fs/aio.c
··· 239 239 call_rcu(&ctx->rcu_head, ctx_rcu_free); 240 240 } 241 241 242 - #define get_ioctx(kioctx) do { \ 243 - BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ 244 - atomic_inc(&(kioctx)->users); \ 245 - } while (0) 246 - #define put_ioctx(kioctx) do { \ 247 - BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ 248 - if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ 249 - __put_ioctx(kioctx); \ 250 - } while (0) 242 + static inline void get_ioctx(struct kioctx *kioctx) 243 + { 244 + BUG_ON(atomic_read(&kioctx->users) <= 0); 245 + atomic_inc(&kioctx->users); 246 + } 247 + 248 + static inline int try_get_ioctx(struct kioctx *kioctx) 249 + { 250 + return atomic_inc_not_zero(&kioctx->users); 251 + } 252 + 253 + static inline void put_ioctx(struct kioctx *kioctx) 254 + { 255 + BUG_ON(atomic_read(&kioctx->users) <= 0); 256 + if (unlikely(atomic_dec_and_test(&kioctx->users))) 257 + __put_ioctx(kioctx); 258 + } 251 259 252 260 /* ioctx_alloc 253 261 * Allocates and initializes an ioctx. Returns an ERR_PTR if it failed. ··· 609 601 rcu_read_lock(); 610 602 611 603 hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) { 612 - if (ctx->user_id == ctx_id && !ctx->dead) { 613 - get_ioctx(ctx); 604 + /* 605 + * RCU protects us against accessing freed memory but 606 + * we have to be careful not to get a reference when the 607 + * reference count already dropped to 0 (ctx->dead test 608 + * is unreliable because of races). 609 + */ 610 + if (ctx->user_id == ctx_id && !ctx->dead && try_get_ioctx(ctx)){ 614 611 ret = ctx; 615 612 break; 616 613 } ··· 1642 1629 goto out_put_req; 1643 1630 1644 1631 spin_lock_irq(&ctx->ctx_lock); 1632 + /* 1633 + * We could have raced with io_destroy() and are currently holding a 1634 + * reference to ctx which should be destroyed. We cannot submit IO 1635 + * since ctx gets freed as soon as io_submit() puts its reference. The 1636 + * check here is reliable: io_destroy() sets ctx->dead before waiting 1637 + * for outstanding IO and the barrier between these two is realized by 1638 + * unlock of mm->ioctx_lock and lock of ctx->ctx_lock. Analogously we 1639 + * increment ctx->reqs_active before checking for ctx->dead and the 1640 + * barrier is realized by unlock and lock of ctx->ctx_lock. Thus if we 1641 + * don't see ctx->dead set here, io_destroy() waits for our IO to 1642 + * finish. 1643 + */ 1644 + if (ctx->dead) { 1645 + spin_unlock_irq(&ctx->ctx_lock); 1646 + ret = -EINVAL; 1647 + goto out_put_req; 1648 + } 1645 1649 aio_run_iocb(req); 1646 1650 if (!list_empty(&ctx->run_list)) { 1647 1651 /* drain the run list */
+13 -6
fs/block_dev.c
··· 873 873 ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj); 874 874 if (ret) 875 875 goto out_del; 876 + /* 877 + * bdev could be deleted beneath us which would implicitly destroy 878 + * the holder directory. Hold on to it. 879 + */ 880 + kobject_get(bdev->bd_part->holder_dir); 876 881 877 882 list_add(&holder->list, &bdev->bd_holder_disks); 878 883 goto out_unlock; ··· 914 909 del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); 915 910 del_symlink(bdev->bd_part->holder_dir, 916 911 &disk_to_dev(disk)->kobj); 912 + kobject_put(bdev->bd_part->holder_dir); 917 913 list_del_init(&holder->list); 918 914 kfree(holder); 919 915 } ··· 928 922 * flush_disk - invalidates all buffer-cache entries on a disk 929 923 * 930 924 * @bdev: struct block device to be flushed 925 + * @kill_dirty: flag to guide handling of dirty inodes 931 926 * 932 927 * Invalidates all buffer-cache entries on a disk. It should be called 933 928 * when a disk has been changed -- either by a media change or online 934 929 * resize. 935 930 */ 936 - static void flush_disk(struct block_device *bdev) 931 + static void flush_disk(struct block_device *bdev, bool kill_dirty) 937 932 { 938 - if (__invalidate_device(bdev)) { 933 + if (__invalidate_device(bdev, kill_dirty)) { 939 934 char name[BDEVNAME_SIZE] = ""; 940 935 941 936 if (bdev->bd_disk) ··· 973 966 "%s: detected capacity change from %lld to %lld\n", 974 967 name, bdev_size, disk_size); 975 968 i_size_write(bdev->bd_inode, disk_size); 976 - flush_disk(bdev); 969 + flush_disk(bdev, false); 977 970 } 978 971 } 979 972 EXPORT_SYMBOL(check_disk_size_change); ··· 1026 1019 if (!(events & DISK_EVENT_MEDIA_CHANGE)) 1027 1020 return 0; 1028 1021 1029 - flush_disk(bdev); 1022 + flush_disk(bdev, true); 1030 1023 if (bdops->revalidate_disk) 1031 1024 bdops->revalidate_disk(bdev->bd_disk); 1032 1025 return 1; ··· 1607 1600 } 1608 1601 EXPORT_SYMBOL(lookup_bdev); 1609 1602 1610 - int __invalidate_device(struct block_device *bdev) 1603 + int __invalidate_device(struct block_device *bdev, bool kill_dirty) 1611 1604 { 1612 1605 struct super_block *sb = get_super(bdev); 1613 1606 int res = 0; ··· 1620 1613 * hold). 1621 1614 */ 1622 1615 shrink_dcache_sb(sb); 1623 - res = invalidate_inodes(sb); 1616 + res = invalidate_inodes(sb, kill_dirty); 1624 1617 drop_super(sb); 1625 1618 } 1626 1619 invalidate_bdev(bdev);
+3
fs/btrfs/ctree.h
··· 1254 1254 #define BTRFS_MOUNT_SPACE_CACHE (1 << 12) 1255 1255 #define BTRFS_MOUNT_CLEAR_CACHE (1 << 13) 1256 1256 #define BTRFS_MOUNT_USER_SUBVOL_RM_ALLOWED (1 << 14) 1257 + #define BTRFS_MOUNT_ENOSPC_DEBUG (1 << 15) 1257 1258 1258 1259 #define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt) 1259 1260 #define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt) ··· 2219 2218 u64 start, u64 end); 2220 2219 int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, 2221 2220 u64 num_bytes); 2221 + int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, 2222 + struct btrfs_root *root, u64 type); 2222 2223 2223 2224 /* ctree.c */ 2224 2225 int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key,
+8 -1
fs/btrfs/extent-tree.c
··· 5376 5376 num_bytes, data, 1); 5377 5377 goto again; 5378 5378 } 5379 - if (ret == -ENOSPC) { 5379 + if (ret == -ENOSPC && btrfs_test_opt(root, ENOSPC_DEBUG)) { 5380 5380 struct btrfs_space_info *sinfo; 5381 5381 5382 5382 sinfo = __find_space_info(root->fs_info, data); ··· 8063 8063 out: 8064 8064 btrfs_end_transaction(trans, root); 8065 8065 return ret; 8066 + } 8067 + 8068 + int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, 8069 + struct btrfs_root *root, u64 type) 8070 + { 8071 + u64 alloc_flags = get_alloc_profile(root, type); 8072 + return do_chunk_alloc(trans, root, 2 * 1024 * 1024, alloc_flags, 1); 8066 8073 } 8067 8074 8068 8075 /*
+99 -39
fs/btrfs/extent_io.c
··· 1433 1433 */ 1434 1434 u64 count_range_bits(struct extent_io_tree *tree, 1435 1435 u64 *start, u64 search_end, u64 max_bytes, 1436 - unsigned long bits) 1436 + unsigned long bits, int contig) 1437 1437 { 1438 1438 struct rb_node *node; 1439 1439 struct extent_state *state; 1440 1440 u64 cur_start = *start; 1441 1441 u64 total_bytes = 0; 1442 + u64 last = 0; 1442 1443 int found = 0; 1443 1444 1444 1445 if (search_end <= cur_start) { ··· 1464 1463 state = rb_entry(node, struct extent_state, rb_node); 1465 1464 if (state->start > search_end) 1466 1465 break; 1467 - if (state->end >= cur_start && (state->state & bits)) { 1466 + if (contig && found && state->start > last + 1) 1467 + break; 1468 + if (state->end >= cur_start && (state->state & bits) == bits) { 1468 1469 total_bytes += min(search_end, state->end) + 1 - 1469 1470 max(cur_start, state->start); 1470 1471 if (total_bytes >= max_bytes) ··· 1475 1472 *start = state->start; 1476 1473 found = 1; 1477 1474 } 1475 + last = state->end; 1476 + } else if (contig && found) { 1477 + break; 1478 1478 } 1479 1479 node = rb_next(node); 1480 1480 if (!node) ··· 2918 2912 return sector; 2919 2913 } 2920 2914 2915 + /* 2916 + * helper function for fiemap, which doesn't want to see any holes. 2917 + * This maps until we find something past 'last' 2918 + */ 2919 + static struct extent_map *get_extent_skip_holes(struct inode *inode, 2920 + u64 offset, 2921 + u64 last, 2922 + get_extent_t *get_extent) 2923 + { 2924 + u64 sectorsize = BTRFS_I(inode)->root->sectorsize; 2925 + struct extent_map *em; 2926 + u64 len; 2927 + 2928 + if (offset >= last) 2929 + return NULL; 2930 + 2931 + while(1) { 2932 + len = last - offset; 2933 + if (len == 0) 2934 + break; 2935 + len = (len + sectorsize - 1) & ~(sectorsize - 1); 2936 + em = get_extent(inode, NULL, 0, offset, len, 0); 2937 + if (!em || IS_ERR(em)) 2938 + return em; 2939 + 2940 + /* if this isn't a hole return it */ 2941 + if (!test_bit(EXTENT_FLAG_VACANCY, &em->flags) && 2942 + em->block_start != EXTENT_MAP_HOLE) { 2943 + return em; 2944 + } 2945 + 2946 + /* this is a hole, advance to the next extent */ 2947 + offset = extent_map_end(em); 2948 + free_extent_map(em); 2949 + if (offset >= last) 2950 + break; 2951 + } 2952 + return NULL; 2953 + } 2954 + 2921 2955 int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, 2922 2956 __u64 start, __u64 len, get_extent_t *get_extent) 2923 2957 { ··· 2967 2921 u32 flags = 0; 2968 2922 u32 found_type; 2969 2923 u64 last; 2924 + u64 last_for_get_extent = 0; 2970 2925 u64 disko = 0; 2926 + u64 isize = i_size_read(inode); 2971 2927 struct btrfs_key found_key; 2972 2928 struct extent_map *em = NULL; 2973 2929 struct extent_state *cached_state = NULL; 2974 2930 struct btrfs_path *path; 2975 2931 struct btrfs_file_extent_item *item; 2976 2932 int end = 0; 2977 - u64 em_start = 0, em_len = 0; 2933 + u64 em_start = 0; 2934 + u64 em_len = 0; 2935 + u64 em_end = 0; 2978 2936 unsigned long emflags; 2979 - int hole = 0; 2980 2937 2981 2938 if (len == 0) 2982 2939 return -EINVAL; ··· 2989 2940 return -ENOMEM; 2990 2941 path->leave_spinning = 1; 2991 2942 2943 + /* 2944 + * lookup the last file extent. We're not using i_size here 2945 + * because there might be preallocation past i_size 2946 + */ 2992 2947 ret = btrfs_lookup_file_extent(NULL, BTRFS_I(inode)->root, 2993 2948 path, inode->i_ino, -1, 0); 2994 2949 if (ret < 0) { ··· 3006 2953 btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); 3007 2954 found_type = btrfs_key_type(&found_key); 3008 2955 3009 - /* No extents, just return */ 2956 + /* No extents, but there might be delalloc bits */ 3010 2957 if (found_key.objectid != inode->i_ino || 3011 2958 found_type != BTRFS_EXTENT_DATA_KEY) { 3012 - btrfs_free_path(path); 3013 - return 0; 2959 + /* have to trust i_size as the end */ 2960 + last = (u64)-1; 2961 + last_for_get_extent = isize; 2962 + } else { 2963 + /* 2964 + * remember the start of the last extent. There are a 2965 + * bunch of different factors that go into the length of the 2966 + * extent, so its much less complex to remember where it started 2967 + */ 2968 + last = found_key.offset; 2969 + last_for_get_extent = last + 1; 3014 2970 } 3015 - last = found_key.offset; 3016 2971 btrfs_free_path(path); 2972 + 2973 + /* 2974 + * we might have some extents allocated but more delalloc past those 2975 + * extents. so, we trust isize unless the start of the last extent is 2976 + * beyond isize 2977 + */ 2978 + if (last < isize) { 2979 + last = (u64)-1; 2980 + last_for_get_extent = isize; 2981 + } 3017 2982 3018 2983 lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len, 0, 3019 2984 &cached_state, GFP_NOFS); 3020 - em = get_extent(inode, NULL, 0, off, max - off, 0); 2985 + 2986 + em = get_extent_skip_holes(inode, off, last_for_get_extent, 2987 + get_extent); 3021 2988 if (!em) 3022 2989 goto out; 3023 2990 if (IS_ERR(em)) { ··· 3046 2973 } 3047 2974 3048 2975 while (!end) { 3049 - hole = 0; 3050 - off = em->start + em->len; 2976 + off = extent_map_end(em); 3051 2977 if (off >= max) 3052 2978 end = 1; 3053 2979 3054 - if (em->block_start == EXTENT_MAP_HOLE) { 3055 - hole = 1; 3056 - goto next; 3057 - } 3058 - 3059 2980 em_start = em->start; 3060 2981 em_len = em->len; 3061 - 2982 + em_end = extent_map_end(em); 2983 + emflags = em->flags; 3062 2984 disko = 0; 3063 2985 flags = 0; 3064 2986 ··· 3072 3004 if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) 3073 3005 flags |= FIEMAP_EXTENT_ENCODED; 3074 3006 3075 - next: 3076 - emflags = em->flags; 3077 3007 free_extent_map(em); 3078 3008 em = NULL; 3079 - if (!end) { 3080 - em = get_extent(inode, NULL, 0, off, max - off, 0); 3081 - if (!em) 3082 - goto out; 3083 - if (IS_ERR(em)) { 3084 - ret = PTR_ERR(em); 3085 - goto out; 3086 - } 3087 - emflags = em->flags; 3088 - } 3089 - 3090 - if (test_bit(EXTENT_FLAG_VACANCY, &emflags)) { 3009 + if ((em_start >= last) || em_len == (u64)-1 || 3010 + (last == (u64)-1 && isize <= em_end)) { 3091 3011 flags |= FIEMAP_EXTENT_LAST; 3092 3012 end = 1; 3093 3013 } 3094 3014 3095 - if (em_start == last) { 3015 + /* now scan forward to see if this is really the last extent. */ 3016 + em = get_extent_skip_holes(inode, off, last_for_get_extent, 3017 + get_extent); 3018 + if (IS_ERR(em)) { 3019 + ret = PTR_ERR(em); 3020 + goto out; 3021 + } 3022 + if (!em) { 3096 3023 flags |= FIEMAP_EXTENT_LAST; 3097 3024 end = 1; 3098 3025 } 3099 - 3100 - if (!hole) { 3101 - ret = fiemap_fill_next_extent(fieinfo, em_start, disko, 3102 - em_len, flags); 3103 - if (ret) 3104 - goto out_free; 3105 - } 3026 + ret = fiemap_fill_next_extent(fieinfo, em_start, disko, 3027 + em_len, flags); 3028 + if (ret) 3029 + goto out_free; 3106 3030 } 3107 3031 out_free: 3108 3032 free_extent_map(em);
+1 -1
fs/btrfs/extent_io.h
··· 191 191 192 192 u64 count_range_bits(struct extent_io_tree *tree, 193 193 u64 *start, u64 search_end, 194 - u64 max_bytes, unsigned long bits); 194 + u64 max_bytes, unsigned long bits, int contig); 195 195 196 196 void free_extent_state(struct extent_state *state); 197 197 int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end,
+124 -2
fs/btrfs/inode.c
··· 1913 1913 1914 1914 private = 0; 1915 1915 if (count_range_bits(&BTRFS_I(inode)->io_failure_tree, &private, 1916 - (u64)-1, 1, EXTENT_DIRTY)) { 1916 + (u64)-1, 1, EXTENT_DIRTY, 0)) { 1917 1917 ret = get_state_private(&BTRFS_I(inode)->io_failure_tree, 1918 1918 start, &private_failure); 1919 1919 if (ret == 0) { ··· 5280 5280 return em; 5281 5281 } 5282 5282 5283 + struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page, 5284 + size_t pg_offset, u64 start, u64 len, 5285 + int create) 5286 + { 5287 + struct extent_map *em; 5288 + struct extent_map *hole_em = NULL; 5289 + u64 range_start = start; 5290 + u64 end; 5291 + u64 found; 5292 + u64 found_end; 5293 + int err = 0; 5294 + 5295 + em = btrfs_get_extent(inode, page, pg_offset, start, len, create); 5296 + if (IS_ERR(em)) 5297 + return em; 5298 + if (em) { 5299 + /* 5300 + * if our em maps to a hole, there might 5301 + * actually be delalloc bytes behind it 5302 + */ 5303 + if (em->block_start != EXTENT_MAP_HOLE) 5304 + return em; 5305 + else 5306 + hole_em = em; 5307 + } 5308 + 5309 + /* check to see if we've wrapped (len == -1 or similar) */ 5310 + end = start + len; 5311 + if (end < start) 5312 + end = (u64)-1; 5313 + else 5314 + end -= 1; 5315 + 5316 + em = NULL; 5317 + 5318 + /* ok, we didn't find anything, lets look for delalloc */ 5319 + found = count_range_bits(&BTRFS_I(inode)->io_tree, &range_start, 5320 + end, len, EXTENT_DELALLOC, 1); 5321 + found_end = range_start + found; 5322 + if (found_end < range_start) 5323 + found_end = (u64)-1; 5324 + 5325 + /* 5326 + * we didn't find anything useful, return 5327 + * the original results from get_extent() 5328 + */ 5329 + if (range_start > end || found_end <= start) { 5330 + em = hole_em; 5331 + hole_em = NULL; 5332 + goto out; 5333 + } 5334 + 5335 + /* adjust the range_start to make sure it doesn't 5336 + * go backwards from the start they passed in 5337 + */ 5338 + range_start = max(start,range_start); 5339 + found = found_end - range_start; 5340 + 5341 + if (found > 0) { 5342 + u64 hole_start = start; 5343 + u64 hole_len = len; 5344 + 5345 + em = alloc_extent_map(GFP_NOFS); 5346 + if (!em) { 5347 + err = -ENOMEM; 5348 + goto out; 5349 + } 5350 + /* 5351 + * when btrfs_get_extent can't find anything it 5352 + * returns one huge hole 5353 + * 5354 + * make sure what it found really fits our range, and 5355 + * adjust to make sure it is based on the start from 5356 + * the caller 5357 + */ 5358 + if (hole_em) { 5359 + u64 calc_end = extent_map_end(hole_em); 5360 + 5361 + if (calc_end <= start || (hole_em->start > end)) { 5362 + free_extent_map(hole_em); 5363 + hole_em = NULL; 5364 + } else { 5365 + hole_start = max(hole_em->start, start); 5366 + hole_len = calc_end - hole_start; 5367 + } 5368 + } 5369 + em->bdev = NULL; 5370 + if (hole_em && range_start > hole_start) { 5371 + /* our hole starts before our delalloc, so we 5372 + * have to return just the parts of the hole 5373 + * that go until the delalloc starts 5374 + */ 5375 + em->len = min(hole_len, 5376 + range_start - hole_start); 5377 + em->start = hole_start; 5378 + em->orig_start = hole_start; 5379 + /* 5380 + * don't adjust block start at all, 5381 + * it is fixed at EXTENT_MAP_HOLE 5382 + */ 5383 + em->block_start = hole_em->block_start; 5384 + em->block_len = hole_len; 5385 + } else { 5386 + em->start = range_start; 5387 + em->len = found; 5388 + em->orig_start = range_start; 5389 + em->block_start = EXTENT_MAP_DELALLOC; 5390 + em->block_len = found; 5391 + } 5392 + } else if (hole_em) { 5393 + return hole_em; 5394 + } 5395 + out: 5396 + 5397 + free_extent_map(hole_em); 5398 + if (err) { 5399 + free_extent_map(em); 5400 + return ERR_PTR(err); 5401 + } 5402 + return em; 5403 + } 5404 + 5283 5405 static struct extent_map *btrfs_new_extent_direct(struct inode *inode, 5284 5406 u64 start, u64 len) 5285 5407 { ··· 6224 6102 static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, 6225 6103 __u64 start, __u64 len) 6226 6104 { 6227 - return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent); 6105 + return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent_fiemap); 6228 6106 } 6229 6107 6230 6108 int btrfs_readpage(struct file *file, struct page *page)
+5 -2
fs/btrfs/ioctl.c
··· 1071 1071 if (copy_from_user(&flags, arg, sizeof(flags))) 1072 1072 return -EFAULT; 1073 1073 1074 - if (flags & ~BTRFS_SUBVOL_CREATE_ASYNC) 1074 + if (flags & BTRFS_SUBVOL_CREATE_ASYNC) 1075 1075 return -EINVAL; 1076 1076 1077 1077 if (flags & ~BTRFS_SUBVOL_RDONLY) 1078 1078 return -EOPNOTSUPP; 1079 + 1080 + if (!is_owner_or_cap(inode)) 1081 + return -EACCES; 1079 1082 1080 1083 down_write(&root->fs_info->subvol_sem); 1081 1084 ··· 1100 1097 goto out_reset; 1101 1098 } 1102 1099 1103 - ret = btrfs_update_root(trans, root, 1100 + ret = btrfs_update_root(trans, root->fs_info->tree_root, 1104 1101 &root->root_key, &root->root_item); 1105 1102 1106 1103 btrfs_commit_transaction(trans, root);
+14 -7
fs/btrfs/lzo.c
··· 280 280 unsigned long tot_out; 281 281 unsigned long tot_len; 282 282 char *buf; 283 + bool may_late_unmap, need_unmap; 283 284 284 285 data_in = kmap(pages_in[0]); 285 286 tot_len = read_compress_length(data_in); ··· 301 300 302 301 tot_in += in_len; 303 302 working_bytes = in_len; 303 + may_late_unmap = need_unmap = false; 304 304 305 305 /* fast path: avoid using the working buffer */ 306 306 if (in_page_bytes_left >= in_len) { 307 307 buf = data_in + in_offset; 308 308 bytes = in_len; 309 + may_late_unmap = true; 309 310 goto cont; 310 311 } 311 312 ··· 332 329 if (working_bytes == 0 && tot_in >= tot_len) 333 330 break; 334 331 335 - kunmap(pages_in[page_in_index]); 336 - page_in_index++; 337 - if (page_in_index >= total_pages_in) { 332 + if (page_in_index + 1 >= total_pages_in) { 338 333 ret = -1; 339 - data_in = NULL; 340 334 goto done; 341 335 } 342 - data_in = kmap(pages_in[page_in_index]); 336 + 337 + if (may_late_unmap) 338 + need_unmap = true; 339 + else 340 + kunmap(pages_in[page_in_index]); 341 + 342 + data_in = kmap(pages_in[++page_in_index]); 343 343 344 344 in_page_bytes_left = PAGE_CACHE_SIZE; 345 345 in_offset = 0; ··· 352 346 out_len = lzo1x_worst_compress(PAGE_CACHE_SIZE); 353 347 ret = lzo1x_decompress_safe(buf, in_len, workspace->buf, 354 348 &out_len); 349 + if (need_unmap) 350 + kunmap(pages_in[page_in_index - 1]); 355 351 if (ret != LZO_E_OK) { 356 352 printk(KERN_WARNING "btrfs decompress failed\n"); 357 353 ret = -1; ··· 371 363 break; 372 364 } 373 365 done: 374 - if (data_in) 375 - kunmap(pages_in[page_in_index]); 366 + kunmap(pages_in[page_in_index]); 376 367 return ret; 377 368 } 378 369
+12 -1
fs/btrfs/relocation.c
··· 3654 3654 u32 item_size; 3655 3655 int ret; 3656 3656 int err = 0; 3657 + int progress = 0; 3657 3658 3658 3659 path = btrfs_alloc_path(); 3659 3660 if (!path) ··· 3667 3666 } 3668 3667 3669 3668 while (1) { 3669 + progress++; 3670 3670 trans = btrfs_start_transaction(rc->extent_root, 0); 3671 3671 BUG_ON(IS_ERR(trans)); 3672 - 3672 + restart: 3673 3673 if (update_backref_cache(trans, &rc->backref_cache)) { 3674 3674 btrfs_end_transaction(trans, rc->extent_root); 3675 3675 continue; ··· 3781 3779 err = ret; 3782 3780 break; 3783 3781 } 3782 + } 3783 + } 3784 + if (trans && progress && err == -ENOSPC) { 3785 + ret = btrfs_force_chunk_alloc(trans, rc->extent_root, 3786 + rc->block_group->flags); 3787 + if (ret == 0) { 3788 + err = 0; 3789 + progress = 0; 3790 + goto restart; 3784 3791 } 3785 3792 } 3786 3793
+6 -1
fs/btrfs/super.c
··· 155 155 Opt_nossd, Opt_ssd_spread, Opt_thread_pool, Opt_noacl, Opt_compress, 156 156 Opt_compress_type, Opt_compress_force, Opt_compress_force_type, 157 157 Opt_notreelog, Opt_ratio, Opt_flushoncommit, Opt_discard, 158 - Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed, Opt_err, 158 + Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed, 159 + Opt_enospc_debug, Opt_err, 159 160 }; 160 161 161 162 static match_table_t tokens = { ··· 185 184 {Opt_space_cache, "space_cache"}, 186 185 {Opt_clear_cache, "clear_cache"}, 187 186 {Opt_user_subvol_rm_allowed, "user_subvol_rm_allowed"}, 187 + {Opt_enospc_debug, "enospc_debug"}, 188 188 {Opt_err, NULL}, 189 189 }; 190 190 ··· 359 357 break; 360 358 case Opt_user_subvol_rm_allowed: 361 359 btrfs_set_opt(info->mount_opt, USER_SUBVOL_RM_ALLOWED); 360 + break; 361 + case Opt_enospc_debug: 362 + btrfs_set_opt(info->mount_opt, ENOSPC_DEBUG); 362 363 break; 363 364 case Opt_err: 364 365 printk(KERN_INFO "btrfs: unrecognized mount option "
+10 -3
fs/btrfs/volumes.c
··· 1338 1338 1339 1339 ret = btrfs_shrink_device(device, 0); 1340 1340 if (ret) 1341 - goto error_brelse; 1341 + goto error_undo; 1342 1342 1343 1343 ret = btrfs_rm_dev_item(root->fs_info->chunk_root, device); 1344 1344 if (ret) 1345 - goto error_brelse; 1345 + goto error_undo; 1346 1346 1347 1347 device->in_fs_metadata = 0; 1348 1348 ··· 1416 1416 mutex_unlock(&root->fs_info->volume_mutex); 1417 1417 mutex_unlock(&uuid_mutex); 1418 1418 return ret; 1419 + error_undo: 1420 + if (device->writeable) { 1421 + list_add(&device->dev_alloc_list, 1422 + &root->fs_info->fs_devices->alloc_list); 1423 + root->fs_info->fs_devices->rw_devices++; 1424 + } 1425 + goto error_brelse; 1419 1426 } 1420 1427 1421 1428 /* ··· 1640 1633 device->dev_root = root->fs_info->dev_root; 1641 1634 device->bdev = bdev; 1642 1635 device->in_fs_metadata = 1; 1643 - device->mode = 0; 1636 + device->mode = FMODE_EXCL; 1644 1637 set_blocksize(device->bdev, 4096); 1645 1638 1646 1639 if (seeding_dev) {
+3 -25
fs/ceph/dir.c
··· 60 60 } 61 61 di->dentry = dentry; 62 62 di->lease_session = NULL; 63 - di->parent_inode = igrab(dentry->d_parent->d_inode); 64 63 dentry->d_fsdata = di; 65 64 dentry->d_time = jiffies; 66 65 ceph_dentry_lru_add(dentry); ··· 409 410 spin_lock(&inode->i_lock); 410 411 if (ci->i_release_count == fi->dir_release_count) { 411 412 dout(" marking %p complete\n", inode); 412 - ci->i_ceph_flags |= CEPH_I_COMPLETE; 413 + /* ci->i_ceph_flags |= CEPH_I_COMPLETE; */ 413 414 ci->i_max_offset = filp->f_pos; 414 415 } 415 416 spin_unlock(&inode->i_lock); ··· 496 497 497 498 /* .snap dir? */ 498 499 if (err == -ENOENT && 500 + ceph_snap(parent) == CEPH_NOSNAP && 499 501 strcmp(dentry->d_name.name, 500 502 fsc->mount_options->snapdir_name) == 0) { 501 503 struct inode *inode = ceph_get_snapdir(parent); ··· 1030 1030 static void ceph_dentry_release(struct dentry *dentry) 1031 1031 { 1032 1032 struct ceph_dentry_info *di = ceph_dentry(dentry); 1033 - struct inode *parent_inode = NULL; 1034 - u64 snapid = CEPH_NOSNAP; 1035 1033 1036 - if (!IS_ROOT(dentry)) { 1037 - parent_inode = di->parent_inode; 1038 - if (parent_inode) 1039 - snapid = ceph_snap(parent_inode); 1040 - } 1041 - dout("dentry_release %p parent %p\n", dentry, parent_inode); 1042 - if (parent_inode && snapid != CEPH_SNAPDIR) { 1043 - struct ceph_inode_info *ci = ceph_inode(parent_inode); 1044 - 1045 - spin_lock(&parent_inode->i_lock); 1046 - if (ci->i_shared_gen == di->lease_shared_gen || 1047 - snapid <= CEPH_MAXSNAP) { 1048 - dout(" clearing %p complete (d_release)\n", 1049 - parent_inode); 1050 - ci->i_ceph_flags &= ~CEPH_I_COMPLETE; 1051 - ci->i_release_count++; 1052 - } 1053 - spin_unlock(&parent_inode->i_lock); 1054 - } 1034 + dout("dentry_release %p\n", dentry); 1055 1035 if (di) { 1056 1036 ceph_dentry_lru_del(dentry); 1057 1037 if (di->lease_session) ··· 1039 1059 kmem_cache_free(ceph_dentry_cachep, di); 1040 1060 dentry->d_fsdata = NULL; 1041 1061 } 1042 - if (parent_inode) 1043 - iput(parent_inode); 1044 1062 } 1045 1063 1046 1064 static int ceph_snapdir_d_revalidate(struct dentry *dentry,
+1 -1
fs/ceph/inode.c
··· 707 707 (issued & CEPH_CAP_FILE_EXCL) == 0 && 708 708 (ci->i_ceph_flags & CEPH_I_COMPLETE) == 0) { 709 709 dout(" marking %p complete (empty)\n", inode); 710 - ci->i_ceph_flags |= CEPH_I_COMPLETE; 710 + /* ci->i_ceph_flags |= CEPH_I_COMPLETE; */ 711 711 ci->i_max_offset = 2; 712 712 } 713 713 break;
-1
fs/ceph/super.h
··· 207 207 struct dentry *dentry; 208 208 u64 time; 209 209 u64 offset; 210 - struct inode *parent_inode; 211 210 }; 212 211 213 212 struct ceph_inode_xattrs_info {
+95
fs/eventpoll.c
··· 63 63 * cleanup path and it is also acquired by eventpoll_release_file() 64 64 * if a file has been pushed inside an epoll set and it is then 65 65 * close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL). 66 + * It is also acquired when inserting an epoll fd onto another epoll 67 + * fd. We do this so that we walk the epoll tree and ensure that this 68 + * insertion does not create a cycle of epoll file descriptors, which 69 + * could lead to deadlock. We need a global mutex to prevent two 70 + * simultaneous inserts (A into B and B into A) from racing and 71 + * constructing a cycle without either insert observing that it is 72 + * going to. 66 73 * It is possible to drop the "ep->mtx" and to use the global 67 74 * mutex "epmutex" (together with "ep->lock") to have it working, 68 75 * but having "ep->mtx" will make the interface more scalable. ··· 230 223 * This mutex is used to serialize ep_free() and eventpoll_release_file(). 231 224 */ 232 225 static DEFINE_MUTEX(epmutex); 226 + 227 + /* Used to check for epoll file descriptor inclusion loops */ 228 + static struct nested_calls poll_loop_ncalls; 233 229 234 230 /* Used for safe wake up implementation */ 235 231 static struct nested_calls poll_safewake_ncalls; ··· 1208 1198 return res; 1209 1199 } 1210 1200 1201 + /** 1202 + * ep_loop_check_proc - Callback function to be passed to the @ep_call_nested() 1203 + * API, to verify that adding an epoll file inside another 1204 + * epoll structure, does not violate the constraints, in 1205 + * terms of closed loops, or too deep chains (which can 1206 + * result in excessive stack usage). 1207 + * 1208 + * @priv: Pointer to the epoll file to be currently checked. 1209 + * @cookie: Original cookie for this call. This is the top-of-the-chain epoll 1210 + * data structure pointer. 1211 + * @call_nests: Current dept of the @ep_call_nested() call stack. 1212 + * 1213 + * Returns: Returns zero if adding the epoll @file inside current epoll 1214 + * structure @ep does not violate the constraints, or -1 otherwise. 1215 + */ 1216 + static int ep_loop_check_proc(void *priv, void *cookie, int call_nests) 1217 + { 1218 + int error = 0; 1219 + struct file *file = priv; 1220 + struct eventpoll *ep = file->private_data; 1221 + struct rb_node *rbp; 1222 + struct epitem *epi; 1223 + 1224 + mutex_lock(&ep->mtx); 1225 + for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) { 1226 + epi = rb_entry(rbp, struct epitem, rbn); 1227 + if (unlikely(is_file_epoll(epi->ffd.file))) { 1228 + error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, 1229 + ep_loop_check_proc, epi->ffd.file, 1230 + epi->ffd.file->private_data, current); 1231 + if (error != 0) 1232 + break; 1233 + } 1234 + } 1235 + mutex_unlock(&ep->mtx); 1236 + 1237 + return error; 1238 + } 1239 + 1240 + /** 1241 + * ep_loop_check - Performs a check to verify that adding an epoll file (@file) 1242 + * another epoll file (represented by @ep) does not create 1243 + * closed loops or too deep chains. 1244 + * 1245 + * @ep: Pointer to the epoll private data structure. 1246 + * @file: Pointer to the epoll file to be checked. 1247 + * 1248 + * Returns: Returns zero if adding the epoll @file inside current epoll 1249 + * structure @ep does not violate the constraints, or -1 otherwise. 1250 + */ 1251 + static int ep_loop_check(struct eventpoll *ep, struct file *file) 1252 + { 1253 + return ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, 1254 + ep_loop_check_proc, file, ep, current); 1255 + } 1256 + 1211 1257 /* 1212 1258 * Open an eventpoll file descriptor. 1213 1259 */ ··· 1312 1246 struct epoll_event __user *, event) 1313 1247 { 1314 1248 int error; 1249 + int did_lock_epmutex = 0; 1315 1250 struct file *file, *tfile; 1316 1251 struct eventpoll *ep; 1317 1252 struct epitem *epi; ··· 1354 1287 */ 1355 1288 ep = file->private_data; 1356 1289 1290 + /* 1291 + * When we insert an epoll file descriptor, inside another epoll file 1292 + * descriptor, there is the change of creating closed loops, which are 1293 + * better be handled here, than in more critical paths. 1294 + * 1295 + * We hold epmutex across the loop check and the insert in this case, in 1296 + * order to prevent two separate inserts from racing and each doing the 1297 + * insert "at the same time" such that ep_loop_check passes on both 1298 + * before either one does the insert, thereby creating a cycle. 1299 + */ 1300 + if (unlikely(is_file_epoll(tfile) && op == EPOLL_CTL_ADD)) { 1301 + mutex_lock(&epmutex); 1302 + did_lock_epmutex = 1; 1303 + error = -ELOOP; 1304 + if (ep_loop_check(ep, tfile) != 0) 1305 + goto error_tgt_fput; 1306 + } 1307 + 1308 + 1357 1309 mutex_lock(&ep->mtx); 1358 1310 1359 1311 /* ··· 1408 1322 mutex_unlock(&ep->mtx); 1409 1323 1410 1324 error_tgt_fput: 1325 + if (unlikely(did_lock_epmutex)) 1326 + mutex_unlock(&epmutex); 1327 + 1411 1328 fput(tfile); 1412 1329 error_fput: 1413 1330 fput(file); ··· 1529 1440 max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) / 1530 1441 EP_ITEM_COST; 1531 1442 BUG_ON(max_user_watches < 0); 1443 + 1444 + /* 1445 + * Initialize the structure used to perform epoll file descriptor 1446 + * inclusion loops checks. 1447 + */ 1448 + ep_nested_calls_init(&poll_loop_ncalls); 1532 1449 1533 1450 /* Initialize the structure used to perform safe poll wait head wake ups */ 1534 1451 ep_nested_calls_init(&poll_safewake_ncalls);
+2 -6
fs/exofs/namei.c
··· 272 272 new_de = exofs_find_entry(new_dir, new_dentry, &new_page); 273 273 if (!new_de) 274 274 goto out_dir; 275 - inode_inc_link_count(old_inode); 276 275 err = exofs_set_link(new_dir, new_de, new_page, old_inode); 277 276 new_inode->i_ctime = CURRENT_TIME; 278 277 if (dir_de) ··· 285 286 if (new_dir->i_nlink >= EXOFS_LINK_MAX) 286 287 goto out_dir; 287 288 } 288 - inode_inc_link_count(old_inode); 289 289 err = exofs_add_link(new_dentry, old_inode); 290 - if (err) { 291 - inode_dec_link_count(old_inode); 290 + if (err) 292 291 goto out_dir; 293 - } 294 292 if (dir_de) 295 293 inode_inc_link_count(new_dir); 296 294 } ··· 295 299 old_inode->i_ctime = CURRENT_TIME; 296 300 297 301 exofs_delete_entry(old_de, old_page); 298 - inode_dec_link_count(old_inode); 302 + mark_inode_dirty(old_inode); 299 303 300 304 if (dir_de) { 301 305 err = exofs_set_link(old_inode, dir_de, dir_page, new_dir);
+2 -7
fs/ext2/namei.c
··· 344 344 new_de = ext2_find_entry (new_dir, &new_dentry->d_name, &new_page); 345 345 if (!new_de) 346 346 goto out_dir; 347 - inode_inc_link_count(old_inode); 348 347 ext2_set_link(new_dir, new_de, new_page, old_inode, 1); 349 348 new_inode->i_ctime = CURRENT_TIME_SEC; 350 349 if (dir_de) ··· 355 356 if (new_dir->i_nlink >= EXT2_LINK_MAX) 356 357 goto out_dir; 357 358 } 358 - inode_inc_link_count(old_inode); 359 359 err = ext2_add_link(new_dentry, old_inode); 360 - if (err) { 361 - inode_dec_link_count(old_inode); 360 + if (err) 362 361 goto out_dir; 363 - } 364 362 if (dir_de) 365 363 inode_inc_link_count(new_dir); 366 364 } ··· 365 369 /* 366 370 * Like most other Unix systems, set the ctime for inodes on a 367 371 * rename. 368 - * inode_dec_link_count() will mark the inode dirty. 369 372 */ 370 373 old_inode->i_ctime = CURRENT_TIME_SEC; 374 + mark_inode_dirty(old_inode); 371 375 372 376 ext2_delete_entry (old_de, old_page); 373 - inode_dec_link_count(old_inode); 374 377 375 378 if (dir_de) { 376 379 if (old_dir != new_dir)
+5 -2
fs/fuse/dir.c
··· 1283 1283 if (err) 1284 1284 return err; 1285 1285 1286 - if ((attr->ia_valid & ATTR_OPEN) && fc->atomic_o_trunc) 1287 - return 0; 1286 + if (attr->ia_valid & ATTR_OPEN) { 1287 + if (fc->atomic_o_trunc) 1288 + return 0; 1289 + file = NULL; 1290 + } 1288 1291 1289 1292 if (attr->ia_valid & ATTR_SIZE) 1290 1293 is_truncate = true;
+46 -8
fs/fuse/file.c
··· 86 86 return ff; 87 87 } 88 88 89 - static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) 89 + static void fuse_release_async(struct work_struct *work) 90 90 { 91 - path_put(&req->misc.release.path); 91 + struct fuse_req *req; 92 + struct fuse_conn *fc; 93 + struct path path; 94 + 95 + req = container_of(work, struct fuse_req, misc.release.work); 96 + path = req->misc.release.path; 97 + fc = get_fuse_conn(path.dentry->d_inode); 98 + 99 + fuse_put_request(fc, req); 100 + path_put(&path); 92 101 } 93 102 94 - static void fuse_file_put(struct fuse_file *ff) 103 + static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) 104 + { 105 + if (fc->destroy_req) { 106 + /* 107 + * If this is a fuseblk mount, then it's possible that 108 + * releasing the path will result in releasing the 109 + * super block and sending the DESTROY request. If 110 + * the server is single threaded, this would hang. 111 + * For this reason do the path_put() in a separate 112 + * thread. 113 + */ 114 + atomic_inc(&req->count); 115 + INIT_WORK(&req->misc.release.work, fuse_release_async); 116 + schedule_work(&req->misc.release.work); 117 + } else { 118 + path_put(&req->misc.release.path); 119 + } 120 + } 121 + 122 + static void fuse_file_put(struct fuse_file *ff, bool sync) 95 123 { 96 124 if (atomic_dec_and_test(&ff->count)) { 97 125 struct fuse_req *req = ff->reserved_req; 98 126 99 - req->end = fuse_release_end; 100 - fuse_request_send_background(ff->fc, req); 127 + if (sync) { 128 + fuse_request_send(ff->fc, req); 129 + path_put(&req->misc.release.path); 130 + fuse_put_request(ff->fc, req); 131 + } else { 132 + req->end = fuse_release_end; 133 + fuse_request_send_background(ff->fc, req); 134 + } 101 135 kfree(ff); 102 136 } 103 137 } ··· 253 219 * Normally this will send the RELEASE request, however if 254 220 * some asynchronous READ or WRITE requests are outstanding, 255 221 * the sending will be delayed. 222 + * 223 + * Make the release synchronous if this is a fuseblk mount, 224 + * synchronous RELEASE is allowed (and desirable) in this case 225 + * because the server can be trusted not to screw up. 256 226 */ 257 - fuse_file_put(ff); 227 + fuse_file_put(ff, ff->fc->destroy_req != NULL); 258 228 } 259 229 260 230 static int fuse_open(struct inode *inode, struct file *file) ··· 596 558 page_cache_release(page); 597 559 } 598 560 if (req->ff) 599 - fuse_file_put(req->ff); 561 + fuse_file_put(req->ff, false); 600 562 } 601 563 602 564 static void fuse_send_readpages(struct fuse_req *req, struct file *file) ··· 1175 1137 static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req) 1176 1138 { 1177 1139 __free_page(req->pages[0]); 1178 - fuse_file_put(req->ff); 1140 + fuse_file_put(req->ff, false); 1179 1141 } 1180 1142 1181 1143 static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req)
+5 -1
fs/fuse/fuse_i.h
··· 21 21 #include <linux/rwsem.h> 22 22 #include <linux/rbtree.h> 23 23 #include <linux/poll.h> 24 + #include <linux/workqueue.h> 24 25 25 26 /** Max number of pages that can be used in a single read request */ 26 27 #define FUSE_MAX_PAGES_PER_REQ 32 ··· 263 262 /** Data for asynchronous requests */ 264 263 union { 265 264 struct { 266 - struct fuse_release_in in; 265 + union { 266 + struct fuse_release_in in; 267 + struct work_struct work; 268 + }; 267 269 struct path path; 268 270 } release; 269 271 struct fuse_init_in init_in;
+1 -8
fs/gfs2/main.c
··· 59 59 struct address_space *mapping = (struct address_space *)(gl + 1); 60 60 61 61 gfs2_init_glock_once(gl); 62 - memset(mapping, 0, sizeof(*mapping)); 63 - INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); 64 - spin_lock_init(&mapping->tree_lock); 65 - spin_lock_init(&mapping->i_mmap_lock); 66 - INIT_LIST_HEAD(&mapping->private_list); 67 - spin_lock_init(&mapping->private_lock); 68 - INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); 69 - INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); 62 + address_space_init_once(mapping); 70 63 } 71 64 72 65 /**
+14 -38
fs/hfs/dir.c
··· 238 238 } 239 239 240 240 /* 241 - * hfs_unlink() 241 + * hfs_remove() 242 242 * 243 - * This is the unlink() entry in the inode_operations structure for 244 - * regular HFS directories. The purpose is to delete an existing 245 - * file, given the inode for the parent directory and the name 246 - * (and its length) of the existing file. 243 + * This serves as both unlink() and rmdir() in the inode_operations 244 + * structure for regular HFS directories. The purpose is to delete 245 + * an existing child, given the inode for the parent directory and 246 + * the name (and its length) of the existing directory. 247 + * 248 + * HFS does not have hardlinks, so both rmdir and unlink set the 249 + * link count to 0. The only difference is the emptiness check. 247 250 */ 248 - static int hfs_unlink(struct inode *dir, struct dentry *dentry) 251 + static int hfs_remove(struct inode *dir, struct dentry *dentry) 249 252 { 250 - struct inode *inode; 253 + struct inode *inode = dentry->d_inode; 251 254 int res; 252 255 253 - inode = dentry->d_inode; 254 - res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name); 255 - if (res) 256 - return res; 257 - 258 - drop_nlink(inode); 259 - hfs_delete_inode(inode); 260 - inode->i_ctime = CURRENT_TIME_SEC; 261 - mark_inode_dirty(inode); 262 - 263 - return res; 264 - } 265 - 266 - /* 267 - * hfs_rmdir() 268 - * 269 - * This is the rmdir() entry in the inode_operations structure for 270 - * regular HFS directories. The purpose is to delete an existing 271 - * directory, given the inode for the parent directory and the name 272 - * (and its length) of the existing directory. 273 - */ 274 - static int hfs_rmdir(struct inode *dir, struct dentry *dentry) 275 - { 276 - struct inode *inode; 277 - int res; 278 - 279 - inode = dentry->d_inode; 280 - if (inode->i_size != 2) 256 + if (S_ISDIR(inode->i_mode) && inode->i_size != 2) 281 257 return -ENOTEMPTY; 282 258 res = hfs_cat_delete(inode->i_ino, dir, &dentry->d_name); 283 259 if (res) ··· 283 307 284 308 /* Unlink destination if it already exists */ 285 309 if (new_dentry->d_inode) { 286 - res = hfs_unlink(new_dir, new_dentry); 310 + res = hfs_remove(new_dir, new_dentry); 287 311 if (res) 288 312 return res; 289 313 } ··· 308 332 const struct inode_operations hfs_dir_inode_operations = { 309 333 .create = hfs_create, 310 334 .lookup = hfs_lookup, 311 - .unlink = hfs_unlink, 335 + .unlink = hfs_remove, 312 336 .mkdir = hfs_mkdir, 313 - .rmdir = hfs_rmdir, 337 + .rmdir = hfs_remove, 314 338 .rename = hfs_rename, 315 339 .setattr = hfs_inode_setattr, 316 340 };
+23 -8
fs/inode.c
··· 295 295 call_rcu(&inode->i_rcu, i_callback); 296 296 } 297 297 298 + void address_space_init_once(struct address_space *mapping) 299 + { 300 + memset(mapping, 0, sizeof(*mapping)); 301 + INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); 302 + spin_lock_init(&mapping->tree_lock); 303 + spin_lock_init(&mapping->i_mmap_lock); 304 + INIT_LIST_HEAD(&mapping->private_list); 305 + spin_lock_init(&mapping->private_lock); 306 + INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); 307 + INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); 308 + mutex_init(&mapping->unmap_mutex); 309 + } 310 + EXPORT_SYMBOL(address_space_init_once); 311 + 298 312 /* 299 313 * These are initializations that only need to be done 300 314 * once, because the fields are idempotent across use ··· 322 308 INIT_LIST_HEAD(&inode->i_devices); 323 309 INIT_LIST_HEAD(&inode->i_wb_list); 324 310 INIT_LIST_HEAD(&inode->i_lru); 325 - INIT_RADIX_TREE(&inode->i_data.page_tree, GFP_ATOMIC); 326 - spin_lock_init(&inode->i_data.tree_lock); 327 - spin_lock_init(&inode->i_data.i_mmap_lock); 328 - INIT_LIST_HEAD(&inode->i_data.private_list); 329 - spin_lock_init(&inode->i_data.private_lock); 330 - INIT_RAW_PRIO_TREE_ROOT(&inode->i_data.i_mmap); 331 - INIT_LIST_HEAD(&inode->i_data.i_mmap_nonlinear); 311 + address_space_init_once(&inode->i_data); 332 312 i_size_ordered_init(inode); 333 313 #ifdef CONFIG_FSNOTIFY 334 314 INIT_HLIST_HEAD(&inode->i_fsnotify_marks); ··· 548 540 /** 549 541 * invalidate_inodes - attempt to free all inodes on a superblock 550 542 * @sb: superblock to operate on 543 + * @kill_dirty: flag to guide handling of dirty inodes 551 544 * 552 545 * Attempts to free all inodes for a given superblock. If there were any 553 546 * busy inodes return a non-zero value, else zero. 547 + * If @kill_dirty is set, discard dirty inodes too, otherwise treat 548 + * them as busy. 554 549 */ 555 - int invalidate_inodes(struct super_block *sb) 550 + int invalidate_inodes(struct super_block *sb, bool kill_dirty) 556 551 { 557 552 int busy = 0; 558 553 struct inode *inode, *next; ··· 567 556 list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { 568 557 if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) 569 558 continue; 559 + if (inode->i_state & I_DIRTY && !kill_dirty) { 560 + busy = 1; 561 + continue; 562 + } 570 563 if (atomic_read(&inode->i_count)) { 571 564 busy = 1; 572 565 continue;
+1 -1
fs/internal.h
··· 112 112 */ 113 113 extern int get_nr_dirty_inodes(void); 114 114 extern void evict_inodes(struct super_block *); 115 - extern int invalidate_inodes(struct super_block *); 115 + extern int invalidate_inodes(struct super_block *, bool);
+2 -6
fs/minix/namei.c
··· 213 213 new_de = minix_find_entry(new_dentry, &new_page); 214 214 if (!new_de) 215 215 goto out_dir; 216 - inode_inc_link_count(old_inode); 217 216 minix_set_link(new_de, new_page, old_inode); 218 217 new_inode->i_ctime = CURRENT_TIME_SEC; 219 218 if (dir_de) ··· 224 225 if (new_dir->i_nlink >= info->s_link_max) 225 226 goto out_dir; 226 227 } 227 - inode_inc_link_count(old_inode); 228 228 err = minix_add_link(new_dentry, old_inode); 229 - if (err) { 230 - inode_dec_link_count(old_inode); 229 + if (err) 231 230 goto out_dir; 232 - } 233 231 if (dir_de) 234 232 inode_inc_link_count(new_dir); 235 233 } 236 234 237 235 minix_delete_entry(old_de, old_page); 238 - inode_dec_link_count(old_inode); 236 + mark_inode_dirty(old_inode); 239 237 240 238 if (dir_de) { 241 239 minix_set_link(dir_de, dir_page, new_dir);
+1 -1
fs/namespace.c
··· 1244 1244 */ 1245 1245 br_write_lock(vfsmount_lock); 1246 1246 if (mnt_get_count(mnt) != 2) { 1247 - br_write_lock(vfsmount_lock); 1247 + br_write_unlock(vfsmount_lock); 1248 1248 return -EBUSY; 1249 1249 } 1250 1250 br_write_unlock(vfsmount_lock);
+42 -2
fs/nfs/nfs4proc.c
··· 51 51 #include <linux/sunrpc/bc_xprt.h> 52 52 #include <linux/xattr.h> 53 53 #include <linux/utsname.h> 54 + #include <linux/mm.h> 54 55 55 56 #include "nfs4_fs.h" 56 57 #include "delegation.h" ··· 3253 3252 } 3254 3253 } 3255 3254 3255 + static int buf_to_pages_noslab(const void *buf, size_t buflen, 3256 + struct page **pages, unsigned int *pgbase) 3257 + { 3258 + struct page *newpage, **spages; 3259 + int rc = 0; 3260 + size_t len; 3261 + spages = pages; 3262 + 3263 + do { 3264 + len = min(PAGE_CACHE_SIZE, buflen); 3265 + newpage = alloc_page(GFP_KERNEL); 3266 + 3267 + if (newpage == NULL) 3268 + goto unwind; 3269 + memcpy(page_address(newpage), buf, len); 3270 + buf += len; 3271 + buflen -= len; 3272 + *pages++ = newpage; 3273 + rc++; 3274 + } while (buflen != 0); 3275 + 3276 + return rc; 3277 + 3278 + unwind: 3279 + for(; rc > 0; rc--) 3280 + __free_page(spages[rc-1]); 3281 + return -ENOMEM; 3282 + } 3283 + 3256 3284 struct nfs4_cached_acl { 3257 3285 int cached; 3258 3286 size_t len; ··· 3450 3420 .rpc_argp = &arg, 3451 3421 .rpc_resp = &res, 3452 3422 }; 3453 - int ret; 3423 + int ret, i; 3454 3424 3455 3425 if (!nfs4_server_supports_acls(server)) 3456 3426 return -EOPNOTSUPP; 3427 + i = buf_to_pages_noslab(buf, buflen, arg.acl_pages, &arg.acl_pgbase); 3428 + if (i < 0) 3429 + return i; 3457 3430 nfs_inode_return_delegation(inode); 3458 - buf_to_pages(buf, buflen, arg.acl_pages, &arg.acl_pgbase); 3459 3431 ret = nfs4_call_sync(server, &msg, &arg, &res, 1); 3432 + 3433 + /* 3434 + * Free each page after tx, so the only ref left is 3435 + * held by the network stack 3436 + */ 3437 + for (; i > 0; i--) 3438 + put_page(pages[i-1]); 3439 + 3460 3440 /* 3461 3441 * Acl update can result in inode attribute update. 3462 3442 * so mark the attribute cache invalid.
-5
fs/nilfs2/btnode.c
··· 35 35 #include "btnode.h" 36 36 37 37 38 - void nilfs_btnode_cache_init_once(struct address_space *btnc) 39 - { 40 - nilfs_mapping_init_once(btnc); 41 - } 42 - 43 38 static const struct address_space_operations def_btnode_aops = { 44 39 .sync_page = block_sync_page, 45 40 };
-1
fs/nilfs2/btnode.h
··· 37 37 struct buffer_head *newbh; 38 38 }; 39 39 40 - void nilfs_btnode_cache_init_once(struct address_space *); 41 40 void nilfs_btnode_cache_init(struct address_space *, struct backing_dev_info *); 42 41 void nilfs_btnode_cache_clear(struct address_space *); 43 42 struct buffer_head *nilfs_btnode_create_block(struct address_space *btnc,
+2 -2
fs/nilfs2/mdt.c
··· 454 454 struct backing_dev_info *bdi = inode->i_sb->s_bdi; 455 455 456 456 INIT_LIST_HEAD(&shadow->frozen_buffers); 457 - nilfs_mapping_init_once(&shadow->frozen_data); 457 + address_space_init_once(&shadow->frozen_data); 458 458 nilfs_mapping_init(&shadow->frozen_data, bdi, &shadow_map_aops); 459 - nilfs_mapping_init_once(&shadow->frozen_btnodes); 459 + address_space_init_once(&shadow->frozen_btnodes); 460 460 nilfs_mapping_init(&shadow->frozen_btnodes, bdi, &shadow_map_aops); 461 461 mi->mi_shadow = shadow; 462 462 return 0;
+1 -7
fs/nilfs2/namei.c
··· 397 397 new_de = nilfs_find_entry(new_dir, &new_dentry->d_name, &new_page); 398 398 if (!new_de) 399 399 goto out_dir; 400 - inc_nlink(old_inode); 401 400 nilfs_set_link(new_dir, new_de, new_page, old_inode); 402 401 nilfs_mark_inode_dirty(new_dir); 403 402 new_inode->i_ctime = CURRENT_TIME; ··· 410 411 if (new_dir->i_nlink >= NILFS_LINK_MAX) 411 412 goto out_dir; 412 413 } 413 - inc_nlink(old_inode); 414 414 err = nilfs_add_link(new_dentry, old_inode); 415 - if (err) { 416 - drop_nlink(old_inode); 417 - nilfs_mark_inode_dirty(old_inode); 415 + if (err) 418 416 goto out_dir; 419 - } 420 417 if (dir_de) { 421 418 inc_nlink(new_dir); 422 419 nilfs_mark_inode_dirty(new_dir); ··· 426 431 old_inode->i_ctime = CURRENT_TIME; 427 432 428 433 nilfs_delete_entry(old_de, old_page); 429 - drop_nlink(old_inode); 430 434 431 435 if (dir_de) { 432 436 nilfs_set_link(old_inode, dir_de, dir_page, new_dir);
-13
fs/nilfs2/page.c
··· 492 492 return nc; 493 493 } 494 494 495 - void nilfs_mapping_init_once(struct address_space *mapping) 496 - { 497 - memset(mapping, 0, sizeof(*mapping)); 498 - INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC); 499 - spin_lock_init(&mapping->tree_lock); 500 - INIT_LIST_HEAD(&mapping->private_list); 501 - spin_lock_init(&mapping->private_lock); 502 - 503 - spin_lock_init(&mapping->i_mmap_lock); 504 - INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap); 505 - INIT_LIST_HEAD(&mapping->i_mmap_nonlinear); 506 - } 507 - 508 495 void nilfs_mapping_init(struct address_space *mapping, 509 496 struct backing_dev_info *bdi, 510 497 const struct address_space_operations *aops)
-1
fs/nilfs2/page.h
··· 61 61 int nilfs_copy_dirty_pages(struct address_space *, struct address_space *); 62 62 void nilfs_copy_back_pages(struct address_space *, struct address_space *); 63 63 void nilfs_clear_dirty_pages(struct address_space *); 64 - void nilfs_mapping_init_once(struct address_space *mapping); 65 64 void nilfs_mapping_init(struct address_space *mapping, 66 65 struct backing_dev_info *bdi, 67 66 const struct address_space_operations *aops);
+2 -1
fs/nilfs2/segment.c
··· 430 430 nilfs_segctor_map_segsum_entry( 431 431 sci, &sci->sc_binfo_ptr, sizeof(struct nilfs_finfo)); 432 432 433 - if (inode->i_sb && !test_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags)) 433 + if (NILFS_I(inode)->i_root && 434 + !test_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags)) 434 435 set_bit(NILFS_SC_HAVE_DELTA, &sci->sc_flags); 435 436 /* skip finfo */ 436 437 }
+1 -1
fs/nilfs2/super.c
··· 1279 1279 #ifdef CONFIG_NILFS_XATTR 1280 1280 init_rwsem(&ii->xattr_sem); 1281 1281 #endif 1282 - nilfs_btnode_cache_init_once(&ii->i_btnode_cache); 1282 + address_space_init_once(&ii->i_btnode_cache); 1283 1283 ii->i_bmap = &ii->i_bmap_data; 1284 1284 inode_init_once(&ii->vfs_inode); 1285 1285 }
+3 -3
fs/ocfs2/journal.h
··· 405 405 ocfs2_quota_trans_credits(sb); 406 406 } 407 407 408 - /* data block for new dir/symlink, 2 for bitmap updates (bitmap fe + 409 - * bitmap block for the new bit) dx_root update for free list */ 410 - #define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + 2 + 1) 408 + /* data block for new dir/symlink, allocation of directory block, dx_root 409 + * update for free list */ 410 + #define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + OCFS2_SUBALLOC_ALLOC + 1) 411 411 412 412 static inline int ocfs2_add_dir_index_credits(struct super_block *sb) 413 413 {
+5 -2
fs/ocfs2/refcounttree.c
··· 3228 3228 u32 num_clusters, unsigned int e_flags) 3229 3229 { 3230 3230 int ret, delete, index, credits = 0; 3231 - u32 new_bit, new_len; 3231 + u32 new_bit, new_len, orig_num_clusters; 3232 3232 unsigned int set_len; 3233 3233 struct ocfs2_super *osb = OCFS2_SB(sb); 3234 3234 handle_t *handle; ··· 3260 3260 mlog_errno(ret); 3261 3261 goto out; 3262 3262 } 3263 + 3264 + orig_num_clusters = num_clusters; 3263 3265 3264 3266 while (num_clusters) { 3265 3267 ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh, ··· 3350 3348 * in write-back mode. 3351 3349 */ 3352 3350 if (context->get_clusters == ocfs2_di_get_clusters) { 3353 - ret = ocfs2_cow_sync_writeback(sb, context, cpos, num_clusters); 3351 + ret = ocfs2_cow_sync_writeback(sb, context, cpos, 3352 + orig_num_clusters); 3354 3353 if (ret) 3355 3354 mlog_errno(ret); 3356 3355 }
+20 -8
fs/ocfs2/super.c
··· 1316 1316 struct mount_options *mopt, 1317 1317 int is_remount) 1318 1318 { 1319 - int status; 1319 + int status, user_stack = 0; 1320 1320 char *p; 1321 1321 u32 tmp; 1322 1322 ··· 1459 1459 memcpy(mopt->cluster_stack, args[0].from, 1460 1460 OCFS2_STACK_LABEL_LEN); 1461 1461 mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0'; 1462 + /* 1463 + * Open code the memcmp here as we don't have 1464 + * an osb to pass to 1465 + * ocfs2_userspace_stack(). 1466 + */ 1467 + if (memcmp(mopt->cluster_stack, 1468 + OCFS2_CLASSIC_CLUSTER_STACK, 1469 + OCFS2_STACK_LABEL_LEN)) 1470 + user_stack = 1; 1462 1471 break; 1463 1472 case Opt_inode64: 1464 1473 mopt->mount_opt |= OCFS2_MOUNT_INODE64; ··· 1523 1514 } 1524 1515 } 1525 1516 1526 - /* Ensure only one heartbeat mode */ 1527 - tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL | 1528 - OCFS2_MOUNT_HB_NONE); 1529 - if (hweight32(tmp) != 1) { 1530 - mlog(ML_ERROR, "Invalid heartbeat mount options\n"); 1531 - status = 0; 1532 - goto bail; 1517 + if (user_stack == 0) { 1518 + /* Ensure only one heartbeat mode */ 1519 + tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | 1520 + OCFS2_MOUNT_HB_GLOBAL | 1521 + OCFS2_MOUNT_HB_NONE); 1522 + if (hweight32(tmp) != 1) { 1523 + mlog(ML_ERROR, "Invalid heartbeat mount options\n"); 1524 + status = 0; 1525 + goto bail; 1526 + } 1533 1527 } 1534 1528 1535 1529 status = 1;
+5
fs/partitions/ldm.c
··· 251 251 } 252 252 253 253 vm->vblk_size = get_unaligned_be32(data + 0x08); 254 + if (vm->vblk_size == 0) { 255 + ldm_error ("Illegal VBLK size"); 256 + return false; 257 + } 258 + 254 259 vm->vblk_offset = get_unaligned_be32(data + 0x0C); 255 260 vm->last_vblk_seq = get_unaligned_be32(data + 0x04); 256 261
+1 -1
fs/proc/proc_devtree.c
··· 233 233 return; 234 234 root = of_find_node_by_path("/"); 235 235 if (root == NULL) { 236 - printk(KERN_ERR "/proc/device-tree: can't find root\n"); 236 + pr_debug("/proc/device-tree: can't find root\n"); 237 237 return; 238 238 } 239 239 proc_device_tree_add_node(root, proc_device_tree);
+1 -1
fs/reiserfs/namei.c
··· 771 771 EMPTY_DIR_SIZE_V1 : EMPTY_DIR_SIZE, 772 772 dentry, inode, &security); 773 773 if (retval) { 774 - dir->i_nlink--; 774 + DEC_DIR_INODE_NLINK(dir) 775 775 goto out_failed; 776 776 } 777 777
+2 -6
fs/sysv/namei.c
··· 245 245 new_de = sysv_find_entry(new_dentry, &new_page); 246 246 if (!new_de) 247 247 goto out_dir; 248 - inode_inc_link_count(old_inode); 249 248 sysv_set_link(new_de, new_page, old_inode); 250 249 new_inode->i_ctime = CURRENT_TIME_SEC; 251 250 if (dir_de) ··· 256 257 if (new_dir->i_nlink >= SYSV_SB(new_dir->i_sb)->s_link_max) 257 258 goto out_dir; 258 259 } 259 - inode_inc_link_count(old_inode); 260 260 err = sysv_add_link(new_dentry, old_inode); 261 - if (err) { 262 - inode_dec_link_count(old_inode); 261 + if (err) 263 262 goto out_dir; 264 - } 265 263 if (dir_de) 266 264 inode_inc_link_count(new_dir); 267 265 } 268 266 269 267 sysv_delete_entry(old_de, old_page); 270 - inode_dec_link_count(old_inode); 268 + mark_inode_dirty(old_inode); 271 269 272 270 if (dir_de) { 273 271 sysv_set_link(dir_de, dir_page, new_dir);
+5 -6
fs/udf/namei.c
··· 32 32 #include <linux/crc-itu-t.h> 33 33 #include <linux/exportfs.h> 34 34 35 + enum { UDF_MAX_LINKS = 0xffff }; 36 + 35 37 static inline int udf_match(int len1, const unsigned char *name1, int len2, 36 38 const unsigned char *name2) 37 39 { ··· 652 650 struct udf_inode_info *iinfo; 653 651 654 652 err = -EMLINK; 655 - if (dir->i_nlink >= (256 << sizeof(dir->i_nlink)) - 1) 653 + if (dir->i_nlink >= UDF_MAX_LINKS) 656 654 goto out; 657 655 658 656 err = -EIO; ··· 1036 1034 struct fileIdentDesc cfi, *fi; 1037 1035 int err; 1038 1036 1039 - if (inode->i_nlink >= (256 << sizeof(inode->i_nlink)) - 1) { 1037 + if (inode->i_nlink >= UDF_MAX_LINKS) 1040 1038 return -EMLINK; 1041 - } 1042 1039 1043 1040 fi = udf_add_entry(dir, dentry, &fibh, &cfi, &err); 1044 1041 if (!fi) { ··· 1132 1131 goto end_rename; 1133 1132 1134 1133 retval = -EMLINK; 1135 - if (!new_inode && 1136 - new_dir->i_nlink >= 1137 - (256 << sizeof(new_dir->i_nlink)) - 1) 1134 + if (!new_inode && new_dir->i_nlink >= UDF_MAX_LINKS) 1138 1135 goto end_rename; 1139 1136 } 1140 1137 if (!nfi) {
+2 -7
fs/ufs/namei.c
··· 306 306 new_de = ufs_find_entry(new_dir, &new_dentry->d_name, &new_page); 307 307 if (!new_de) 308 308 goto out_dir; 309 - inode_inc_link_count(old_inode); 310 309 ufs_set_link(new_dir, new_de, new_page, old_inode); 311 310 new_inode->i_ctime = CURRENT_TIME_SEC; 312 311 if (dir_de) ··· 317 318 if (new_dir->i_nlink >= UFS_LINK_MAX) 318 319 goto out_dir; 319 320 } 320 - inode_inc_link_count(old_inode); 321 321 err = ufs_add_link(new_dentry, old_inode); 322 - if (err) { 323 - inode_dec_link_count(old_inode); 322 + if (err) 324 323 goto out_dir; 325 - } 326 324 if (dir_de) 327 325 inode_inc_link_count(new_dir); 328 326 } ··· 327 331 /* 328 332 * Like most other Unix systems, set the ctime for inodes on a 329 333 * rename. 330 - * inode_dec_link_count() will mark the inode dirty. 331 334 */ 332 335 old_inode->i_ctime = CURRENT_TIME_SEC; 333 336 334 337 ufs_delete_entry(old_dir, old_de, old_page); 335 - inode_dec_link_count(old_inode); 338 + mark_inode_dirty(old_inode); 336 339 337 340 if (dir_de) { 338 341 ufs_set_link(old_inode, dir_de, dir_page, new_dir);
+2
fs/xfs/linux-2.6/xfs_discard.c
··· 152 152 153 153 if (!capable(CAP_SYS_ADMIN)) 154 154 return -XFS_ERROR(EPERM); 155 + if (!blk_queue_discard(q)) 156 + return -XFS_ERROR(EOPNOTSUPP); 155 157 if (copy_from_user(&range, urange, sizeof(range))) 156 158 return -XFS_ERROR(EFAULT); 157 159
+8 -3
fs/xfs/linux-2.6/xfs_ioctl.c
··· 695 695 xfs_mount_t *mp, 696 696 void __user *arg) 697 697 { 698 - xfs_fsop_geom_v1_t fsgeo; 698 + xfs_fsop_geom_t fsgeo; 699 699 int error; 700 700 701 - error = xfs_fs_geometry(mp, (xfs_fsop_geom_t *)&fsgeo, 3); 701 + error = xfs_fs_geometry(mp, &fsgeo, 3); 702 702 if (error) 703 703 return -error; 704 704 705 - if (copy_to_user(arg, &fsgeo, sizeof(fsgeo))) 705 + /* 706 + * Caller should have passed an argument of type 707 + * xfs_fsop_geom_v1_t. This is a proper subset of the 708 + * xfs_fsop_geom_t that xfs_fs_geometry() fills in. 709 + */ 710 + if (copy_to_user(arg, &fsgeo, sizeof(xfs_fsop_geom_v1_t))) 706 711 return -XFS_ERROR(EFAULT); 707 712 return 0; 708 713 }
+3
fs/xfs/xfs_fsops.c
··· 53 53 xfs_fsop_geom_t *geo, 54 54 int new_version) 55 55 { 56 + 57 + memset(geo, 0, sizeof(*geo)); 58 + 56 59 geo->blocksize = mp->m_sb.sb_blocksize; 57 60 geo->rtextsize = mp->m_sb.sb_rextsize; 58 61 geo->agblocks = mp->m_sb.sb_agblocks;
+2
include/asm-generic/pgtable.h
··· 4 4 #ifndef __ASSEMBLY__ 5 5 #ifdef CONFIG_MMU 6 6 7 + #include <linux/mm_types.h> 8 + 7 9 #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS 8 10 extern int ptep_set_access_flags(struct vm_area_struct *vma, 9 11 unsigned long address, pte_t *ptep,
+1 -1
include/drm/drmP.h
··· 1101 1101 struct platform_device *platformdev; /**< Platform device struture */ 1102 1102 1103 1103 struct drm_sg_mem *sg; /**< Scatter gather memory */ 1104 - int num_crtcs; /**< Number of CRTCs on this device */ 1104 + unsigned int num_crtcs; /**< Number of CRTCs on this device */ 1105 1105 void *dev_private; /**< device private data */ 1106 1106 void *mm_private; 1107 1107 struct address_space *dev_mapping;
-1
include/keys/rxrpc-type.h
··· 99 99 * structure of raw payloads passed to add_key() or instantiate key 100 100 */ 101 101 struct rxrpc_key_data_v1 { 102 - u32 kif_version; /* 1 */ 103 102 u16 security_index; 104 103 u16 ticket_length; 105 104 u32 expiry; /* time_t */
+1 -4
include/linux/blkdev.h
··· 699 699 extern void blk_stop_queue(struct request_queue *q); 700 700 extern void blk_sync_queue(struct request_queue *q); 701 701 extern void __blk_stop_queue(struct request_queue *q); 702 - extern void __blk_run_queue(struct request_queue *); 702 + extern void __blk_run_queue(struct request_queue *q, bool force_kblockd); 703 703 extern void blk_run_queue(struct request_queue *); 704 704 extern int blk_rq_map_user(struct request_queue *, struct request *, 705 705 struct rq_map_data *, void __user *, unsigned long, ··· 1088 1088 1089 1089 struct work_struct; 1090 1090 int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); 1091 - int kblockd_schedule_delayed_work(struct request_queue *q, struct delayed_work *dwork, unsigned long delay); 1092 1091 1093 1092 #ifdef CONFIG_BLK_CGROUP 1094 1093 /* ··· 1135 1136 extern int blk_throtl_init(struct request_queue *q); 1136 1137 extern void blk_throtl_exit(struct request_queue *q); 1137 1138 extern int blk_throtl_bio(struct request_queue *q, struct bio **bio); 1138 - extern void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay); 1139 1139 extern void throtl_shutdown_timer_wq(struct request_queue *q); 1140 1140 #else /* CONFIG_BLK_DEV_THROTTLING */ 1141 1141 static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) ··· 1144 1146 1145 1147 static inline int blk_throtl_init(struct request_queue *q) { return 0; } 1146 1148 static inline int blk_throtl_exit(struct request_queue *q) { return 0; } 1147 - static inline void throtl_schedule_delayed_work(struct request_queue *q, unsigned long delay) {} 1148 1149 static inline void throtl_shutdown_timer_wq(struct request_queue *q) {} 1149 1150 #endif /* CONFIG_BLK_DEV_THROTTLING */ 1150 1151
-1
include/linux/blktrace_api.h
··· 245 245 246 246 extern void blk_dump_cmd(char *buf, struct request *rq); 247 247 extern void blk_fill_rwbs(char *rwbs, u32 rw, int bytes); 248 - extern void blk_fill_rwbs_rq(char *rwbs, struct request *rq); 249 248 250 249 #endif /* CONFIG_EVENT_TRACING && CONFIG_BLOCK */ 251 250
+1 -1
include/linux/ceph/messenger.h
··· 123 123 #define SOCK_CLOSED 11 /* socket state changed to closed */ 124 124 #define OPENING 13 /* open connection w/ (possibly new) peer */ 125 125 #define DEAD 14 /* dead, about to kfree */ 126 + #define BACKOFF 15 126 127 127 128 /* 128 129 * A single connection with another host. ··· 161 160 struct list_head out_queue; 162 161 struct list_head out_sent; /* sending or sent but unacked */ 163 162 u64 out_seq; /* last message queued for send */ 164 - bool out_keepalive_pending; 165 163 166 164 u64 in_seq, in_seq_acked; /* last message received, acked */ 167 165
+1 -1
include/linux/dcbnl.h
··· 101 101 */ 102 102 struct dcb_app { 103 103 __u8 selector; 104 - __u32 protocol; 105 104 __u8 priority; 105 + __u16 protocol; 106 106 }; 107 107 108 108 struct dcbmsg {
+3 -1
include/linux/fs.h
··· 649 649 spinlock_t private_lock; /* for use by the address_space */ 650 650 struct list_head private_list; /* ditto */ 651 651 struct address_space *assoc_mapping; /* ditto */ 652 + struct mutex unmap_mutex; /* to protect unmapping */ 652 653 } __attribute__((aligned(sizeof(long)))); 653 654 /* 654 655 * On most architectures that alignment is already the case; but ··· 2140 2139 struct block_device *bdev); 2141 2140 extern int revalidate_disk(struct gendisk *); 2142 2141 extern int check_disk_change(struct block_device *); 2143 - extern int __invalidate_device(struct block_device *); 2142 + extern int __invalidate_device(struct block_device *, bool); 2144 2143 extern int invalidate_partition(struct gendisk *, int); 2145 2144 #endif 2146 2145 unsigned long invalidate_mapping_pages(struct address_space *mapping, ··· 2226 2225 2227 2226 extern int inode_init_always(struct super_block *, struct inode *); 2228 2227 extern void inode_init_once(struct inode *); 2228 + extern void address_space_init_once(struct address_space *mapping); 2229 2229 extern void ihold(struct inode * inode); 2230 2230 extern void iput(struct inode *); 2231 2231 extern struct inode * igrab(struct inode *);
+7 -4
include/linux/gfp.h
··· 332 332 return alloc_pages_current(gfp_mask, order); 333 333 } 334 334 extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order, 335 - struct vm_area_struct *vma, unsigned long addr); 335 + struct vm_area_struct *vma, unsigned long addr, 336 + int node); 336 337 #else 337 338 #define alloc_pages(gfp_mask, order) \ 338 339 alloc_pages_node(numa_node_id(), gfp_mask, order) 339 - #define alloc_pages_vma(gfp_mask, order, vma, addr) \ 340 + #define alloc_pages_vma(gfp_mask, order, vma, addr, node) \ 340 341 alloc_pages(gfp_mask, order) 341 342 #endif 342 343 #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) 343 - #define alloc_page_vma(gfp_mask, vma, addr) \ 344 - alloc_pages_vma(gfp_mask, 0, vma, addr) 344 + #define alloc_page_vma(gfp_mask, vma, addr) \ 345 + alloc_pages_vma(gfp_mask, 0, vma, addr, numa_node_id()) 346 + #define alloc_page_vma_node(gfp_mask, vma, addr, node) \ 347 + alloc_pages_vma(gfp_mask, 0, vma, addr, node) 345 348 346 349 extern unsigned long __get_free_pages(gfp_t gfp_mask, unsigned int order); 347 350 extern unsigned long get_zeroed_page(gfp_t gfp_mask);
+1
include/linux/mfd/wm8994/core.h
··· 71 71 u16 irq_masks_cache[WM8994_NUM_IRQ_REGS]; 72 72 73 73 /* Used over suspend/resume */ 74 + bool suspended; 74 75 u16 ldo_regs[WM8994_NUM_LDO_REGS]; 75 76 u16 gpio_regs[WM8994_NUM_GPIO_REGS]; 76 77
+2
include/linux/pm.h
··· 431 431 struct list_head entry; 432 432 struct completion completion; 433 433 struct wakeup_source *wakeup; 434 + #else 435 + unsigned int should_wakeup:1; 434 436 #endif 435 437 #ifdef CONFIG_PM_RUNTIME 436 438 struct timer_list suspend_timer;
+14 -11
include/linux/pm_wakeup.h
··· 109 109 return dev->power.can_wakeup; 110 110 } 111 111 112 - static inline bool device_may_wakeup(struct device *dev) 113 - { 114 - return false; 115 - } 116 - 117 112 static inline struct wakeup_source *wakeup_source_create(const char *name) 118 113 { 119 114 return NULL; ··· 129 134 130 135 static inline int device_wakeup_enable(struct device *dev) 131 136 { 132 - return -EINVAL; 137 + dev->power.should_wakeup = true; 138 + return 0; 133 139 } 134 140 135 141 static inline int device_wakeup_disable(struct device *dev) 136 142 { 143 + dev->power.should_wakeup = false; 144 + return 0; 145 + } 146 + 147 + static inline int device_set_wakeup_enable(struct device *dev, bool enable) 148 + { 149 + dev->power.should_wakeup = enable; 137 150 return 0; 138 151 } 139 152 140 153 static inline int device_init_wakeup(struct device *dev, bool val) 141 154 { 142 - dev->power.can_wakeup = val; 143 - return val ? -EINVAL : 0; 155 + device_set_wakeup_capable(dev, val); 156 + device_set_wakeup_enable(dev, val); 157 + return 0; 144 158 } 145 159 146 - 147 - static inline int device_set_wakeup_enable(struct device *dev, bool enable) 160 + static inline bool device_may_wakeup(struct device *dev) 148 161 { 149 - return -EINVAL; 162 + return dev->power.can_wakeup && dev->power.should_wakeup; 150 163 } 151 164 152 165 static inline void __pm_stay_awake(struct wakeup_source *ws) {}
-3
include/linux/ptrace.h
··· 102 102 103 103 extern long arch_ptrace(struct task_struct *child, long request, 104 104 unsigned long addr, unsigned long data); 105 - extern int ptrace_traceme(void); 106 105 extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 107 106 extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); 108 - extern int ptrace_attach(struct task_struct *tsk); 109 - extern int ptrace_detach(struct task_struct *, unsigned int); 110 107 extern void ptrace_disable(struct task_struct *); 111 108 extern int ptrace_check_attach(struct task_struct *task, int kill); 112 109 extern int ptrace_request(struct task_struct *child, long request,
+3 -1
include/linux/rio_regs.h
··· 14 14 #define LINUX_RIO_REGS_H 15 15 16 16 /* 17 - * In RapidIO, each device has a 2MB configuration space that is 17 + * In RapidIO, each device has a 16MB configuration space that is 18 18 * accessed via maintenance transactions. Portions of configuration 19 19 * space are standardized and/or reserved. 20 20 */ 21 + #define RIO_MAINT_SPACE_SZ 0x1000000 /* 16MB of RapidIO mainenance space */ 22 + 21 23 #define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */ 22 24 #define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */ 23 25 #define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */
+8
include/linux/thermal.h
··· 172 172 struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 173 173 const struct thermal_cooling_device_ops *); 174 174 void thermal_cooling_device_unregister(struct thermal_cooling_device *); 175 + 176 + #ifdef CONFIG_NET 175 177 extern int generate_netlink_event(u32 orig, enum events event); 178 + #else 179 + static inline int generate_netlink_event(u32 orig, enum events event) 180 + { 181 + return 0; 182 + } 183 + #endif 176 184 177 185 #endif /* __THERMAL_H__ */
+12
include/net/ipv6.h
··· 89 89 #define IPV6_ADDR_SCOPE_GLOBAL 0x0e 90 90 91 91 /* 92 + * Addr flags 93 + */ 94 + #ifdef __KERNEL__ 95 + #define IPV6_ADDR_MC_FLAG_TRANSIENT(a) \ 96 + ((a)->s6_addr[1] & 0x10) 97 + #define IPV6_ADDR_MC_FLAG_PREFIX(a) \ 98 + ((a)->s6_addr[1] & 0x20) 99 + #define IPV6_ADDR_MC_FLAG_RENDEZVOUS(a) \ 100 + ((a)->s6_addr[1] & 0x40) 101 + #endif 102 + 103 + /* 92 104 * fragmentation header 93 105 */ 94 106
+1 -11
include/net/netfilter/nf_tproxy_core.h
··· 201 201 } 202 202 #endif 203 203 204 - static inline void 205 - nf_tproxy_put_sock(struct sock *sk) 206 - { 207 - /* TIME_WAIT inet sockets have to be handled differently */ 208 - if ((sk->sk_protocol == IPPROTO_TCP) && (sk->sk_state == TCP_TIME_WAIT)) 209 - inet_twsk_put(inet_twsk(sk)); 210 - else 211 - sock_put(sk); 212 - } 213 - 214 204 /* assign a socket to the skb -- consumes sk */ 215 - int 205 + void 216 206 nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk); 217 207 218 208 #endif
+1 -1
include/net/sch_generic.h
··· 199 199 200 200 struct qdisc_skb_cb { 201 201 unsigned int pkt_len; 202 - char data[]; 202 + long data[]; 203 203 }; 204 204 205 205 static inline int qdisc_qlen(struct Qdisc *q)
+1
include/pcmcia/ds.h
··· 261 261 #define CONF_ENABLE_ESR 0x0008 262 262 #define CONF_ENABLE_IOCARD 0x0010 /* auto-enabled if IO resources or IRQ 263 263 * (CONF_ENABLE_IRQ) in use */ 264 + #define CONF_ENABLE_ZVCARD 0x0020 264 265 265 266 /* flags used by pcmcia_loop_config() autoconfiguration */ 266 267 #define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */
+3 -7
include/sound/wm8903.h
··· 17 17 /* 18 18 * R6 (0x06) - Mic Bias Control 0 19 19 */ 20 - #define WM8903_MICDET_HYST_ENA 0x0080 /* MICDET_HYST_ENA */ 21 - #define WM8903_MICDET_HYST_ENA_MASK 0x0080 /* MICDET_HYST_ENA */ 22 - #define WM8903_MICDET_HYST_ENA_SHIFT 7 /* MICDET_HYST_ENA */ 23 - #define WM8903_MICDET_HYST_ENA_WIDTH 1 /* MICDET_HYST_ENA */ 24 - #define WM8903_MICDET_THR_MASK 0x0070 /* MICDET_THR - [6:4] */ 25 - #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [6:4] */ 26 - #define WM8903_MICDET_THR_WIDTH 3 /* MICDET_THR - [6:4] */ 20 + #define WM8903_MICDET_THR_MASK 0x0030 /* MICDET_THR - [5:4] */ 21 + #define WM8903_MICDET_THR_SHIFT 4 /* MICDET_THR - [5:4] */ 22 + #define WM8903_MICDET_THR_WIDTH 2 /* MICDET_THR - [5:4] */ 27 23 #define WM8903_MICSHORT_THR_MASK 0x000C /* MICSHORT_THR - [3:2] */ 28 24 #define WM8903_MICSHORT_THR_SHIFT 2 /* MICSHORT_THR - [3:2] */ 29 25 #define WM8903_MICSHORT_THR_WIDTH 2 /* MICSHORT_THR - [3:2] */
+3 -3
include/trace/events/block.h
··· 31 31 0 : blk_rq_sectors(rq); 32 32 __entry->errors = rq->errors; 33 33 34 - blk_fill_rwbs_rq(__entry->rwbs, rq); 34 + blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); 35 35 blk_dump_cmd(__get_str(cmd), rq); 36 36 ), 37 37 ··· 118 118 __entry->bytes = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? 119 119 blk_rq_bytes(rq) : 0; 120 120 121 - blk_fill_rwbs_rq(__entry->rwbs, rq); 121 + blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); 122 122 blk_dump_cmd(__get_str(cmd), rq); 123 123 memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 124 124 ), ··· 563 563 __entry->nr_sector = blk_rq_sectors(rq); 564 564 __entry->old_dev = dev; 565 565 __entry->old_sector = from; 566 - blk_fill_rwbs_rq(__entry->rwbs, rq); 566 + blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); 567 567 ), 568 568 569 569 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
+5 -2
kernel/cpuset.c
··· 1575 1575 return -ENODEV; 1576 1576 1577 1577 trialcs = alloc_trial_cpuset(cs); 1578 - if (!trialcs) 1579 - return -ENOMEM; 1578 + if (!trialcs) { 1579 + retval = -ENOMEM; 1580 + goto out; 1581 + } 1580 1582 1581 1583 switch (cft->private) { 1582 1584 case FILE_CPULIST: ··· 1593 1591 } 1594 1592 1595 1593 free_trial_cpuset(trialcs); 1594 + out: 1596 1595 cgroup_unlock(); 1597 1596 return retval; 1598 1597 }
+6
kernel/irq/internals.h
··· 3 3 */ 4 4 #include <linux/irqdesc.h> 5 5 6 + #ifdef CONFIG_SPARSE_IRQ 7 + # define IRQ_BITMAP_BITS (NR_IRQS + 8196) 8 + #else 9 + # define IRQ_BITMAP_BITS NR_IRQS 10 + #endif 11 + 6 12 extern int noirqdebug; 7 13 8 14 #define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data)
+10 -1
kernel/irq/irqdesc.c
··· 94 94 EXPORT_SYMBOL_GPL(nr_irqs); 95 95 96 96 static DEFINE_MUTEX(sparse_irq_lock); 97 - static DECLARE_BITMAP(allocated_irqs, NR_IRQS); 97 + static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS); 98 98 99 99 #ifdef CONFIG_SPARSE_IRQ 100 100 ··· 216 216 /* Let arch update nr_irqs and return the nr of preallocated irqs */ 217 217 initcnt = arch_probe_nr_irqs(); 218 218 printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d %d\n", NR_IRQS, nr_irqs, initcnt); 219 + 220 + if (WARN_ON(nr_irqs > IRQ_BITMAP_BITS)) 221 + nr_irqs = IRQ_BITMAP_BITS; 222 + 223 + if (WARN_ON(initcnt > IRQ_BITMAP_BITS)) 224 + initcnt = IRQ_BITMAP_BITS; 225 + 226 + if (initcnt > nr_irqs) 227 + nr_irqs = initcnt; 219 228 220 229 for (i = 0; i < initcnt; i++) { 221 230 desc = alloc_desc(i, node);
+1 -1
kernel/irq/manage.c
··· 1100 1100 if (retval) 1101 1101 kfree(action); 1102 1102 1103 - #ifdef CONFIG_DEBUG_SHIRQ 1103 + #ifdef CONFIG_DEBUG_SHIRQ_FIXME 1104 1104 if (!retval && (irqflags & IRQF_SHARED)) { 1105 1105 /* 1106 1106 * It's a shared IRQ -- the driver ought to be prepared for it
+1 -1
kernel/irq/resend.c
··· 23 23 #ifdef CONFIG_HARDIRQS_SW_RESEND 24 24 25 25 /* Bitmap to handle software resend of interrupts: */ 26 - static DECLARE_BITMAP(irqs_resend, NR_IRQS); 26 + static DECLARE_BITMAP(irqs_resend, IRQ_BITMAP_BITS); 27 27 28 28 /* 29 29 * Run software resends of IRQ's
+15 -4
kernel/perf_event.c
··· 782 782 raw_spin_unlock_irq(&ctx->lock); 783 783 } 784 784 785 + #define MAX_INTERRUPTS (~0ULL) 786 + 787 + static void perf_log_throttle(struct perf_event *event, int enable); 788 + 785 789 static int 786 790 event_sched_in(struct perf_event *event, 787 791 struct perf_cpu_context *cpuctx, ··· 798 794 799 795 event->state = PERF_EVENT_STATE_ACTIVE; 800 796 event->oncpu = smp_processor_id(); 797 + 798 + /* 799 + * Unthrottle events, since we scheduled we might have missed several 800 + * ticks already, also for a heavily scheduling task there is little 801 + * guarantee it'll get a tick in a timely manner. 802 + */ 803 + if (unlikely(event->hw.interrupts == MAX_INTERRUPTS)) { 804 + perf_log_throttle(event, 1); 805 + event->hw.interrupts = 0; 806 + } 807 + 801 808 /* 802 809 * The new state must be visible before we turn it on in the hardware: 803 810 */ ··· 1610 1595 perf_event_context_sched_in(ctx); 1611 1596 } 1612 1597 } 1613 - 1614 - #define MAX_INTERRUPTS (~0ULL) 1615 - 1616 - static void perf_log_throttle(struct perf_event *event, int enable); 1617 1598 1618 1599 static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count) 1619 1600 {
+3 -3
kernel/ptrace.c
··· 163 163 return !err; 164 164 } 165 165 166 - int ptrace_attach(struct task_struct *task) 166 + static int ptrace_attach(struct task_struct *task) 167 167 { 168 168 int retval; 169 169 ··· 219 219 * Performs checks and sets PT_PTRACED. 220 220 * Should be used by all ptrace implementations for PTRACE_TRACEME. 221 221 */ 222 - int ptrace_traceme(void) 222 + static int ptrace_traceme(void) 223 223 { 224 224 int ret = -EPERM; 225 225 ··· 293 293 return false; 294 294 } 295 295 296 - int ptrace_detach(struct task_struct *child, unsigned int data) 296 + static int ptrace_detach(struct task_struct *child, unsigned int data) 297 297 { 298 298 bool dead = false; 299 299
+10
kernel/time/tick-broadcast.c
··· 600 600 return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT; 601 601 } 602 602 603 + /* 604 + * Check whether the broadcast device supports oneshot. 605 + */ 606 + bool tick_broadcast_oneshot_available(void) 607 + { 608 + struct clock_event_device *bc = tick_broadcast_device.evtdev; 609 + 610 + return bc ? bc->features & CLOCK_EVT_FEAT_ONESHOT : false; 611 + } 612 + 603 613 #endif
+5 -1
kernel/time/tick-common.c
··· 51 51 { 52 52 struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev); 53 53 54 - return dev && (dev->features & CLOCK_EVT_FEAT_ONESHOT); 54 + if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT)) 55 + return 0; 56 + if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) 57 + return 1; 58 + return tick_broadcast_oneshot_available(); 55 59 } 56 60 57 61 /*
+3
kernel/time/tick-internal.h
··· 36 36 extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); 37 37 extern int tick_broadcast_oneshot_active(void); 38 38 extern void tick_check_oneshot_broadcast(int cpu); 39 + bool tick_broadcast_oneshot_available(void); 39 40 # else /* BROADCAST */ 40 41 static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) 41 42 { ··· 47 46 static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } 48 47 static inline int tick_broadcast_oneshot_active(void) { return 0; } 49 48 static inline void tick_check_oneshot_broadcast(int cpu) { } 49 + static inline bool tick_broadcast_oneshot_available(void) { return true; } 50 50 # endif /* !BROADCAST */ 51 51 52 52 #else /* !ONESHOT */ ··· 78 76 return 0; 79 77 } 80 78 static inline int tick_broadcast_oneshot_active(void) { return 0; } 79 + static inline bool tick_broadcast_oneshot_available(void) { return false; } 81 80 #endif /* !TICK_ONESHOT */ 82 81 83 82 /*
-16
kernel/trace/blktrace.c
··· 1827 1827 rwbs[i] = '\0'; 1828 1828 } 1829 1829 1830 - void blk_fill_rwbs_rq(char *rwbs, struct request *rq) 1831 - { 1832 - int rw = rq->cmd_flags & 0x03; 1833 - int bytes; 1834 - 1835 - if (rq->cmd_flags & REQ_DISCARD) 1836 - rw |= REQ_DISCARD; 1837 - 1838 - if (rq->cmd_flags & REQ_SECURE) 1839 - rw |= REQ_SECURE; 1840 - 1841 - bytes = blk_rq_bytes(rq); 1842 - 1843 - blk_fill_rwbs(rwbs, rw, bytes); 1844 - } 1845 - 1846 1830 #endif /* CONFIG_EVENT_TRACING */ 1847 1831
+1 -1
lib/nlattr.c
··· 148 148 { 149 149 int i, len = 0; 150 150 151 - for (i = 0; i < n; i++) { 151 + for (i = 0; i < n; i++, p++) { 152 152 if (p->len) 153 153 len += nla_total_size(p->len); 154 154 else if (nla_attr_minlen[p->type])
+4 -2
lib/swiotlb.c
··· 686 686 /* 687 687 * Ensure that the address returned is DMA'ble 688 688 */ 689 - if (!dma_capable(dev, dev_addr, size)) 690 - panic("map_single: bounce buffer is not DMA'ble"); 689 + if (!dma_capable(dev, dev_addr, size)) { 690 + swiotlb_tbl_unmap_single(dev, map, size, dir); 691 + dev_addr = swiotlb_virt_to_bus(dev, io_tlb_overflow_buffer); 692 + } 691 693 692 694 return dev_addr; 693 695 }
+19 -9
mm/huge_memory.c
··· 650 650 651 651 static inline struct page *alloc_hugepage_vma(int defrag, 652 652 struct vm_area_struct *vma, 653 - unsigned long haddr) 653 + unsigned long haddr, int nd) 654 654 { 655 655 return alloc_pages_vma(alloc_hugepage_gfpmask(defrag), 656 - HPAGE_PMD_ORDER, vma, haddr); 656 + HPAGE_PMD_ORDER, vma, haddr, nd); 657 657 } 658 658 659 659 #ifndef CONFIG_NUMA ··· 678 678 if (unlikely(khugepaged_enter(vma))) 679 679 return VM_FAULT_OOM; 680 680 page = alloc_hugepage_vma(transparent_hugepage_defrag(vma), 681 - vma, haddr); 681 + vma, haddr, numa_node_id()); 682 682 if (unlikely(!page)) 683 683 goto out; 684 684 if (unlikely(mem_cgroup_newpage_charge(page, mm, GFP_KERNEL))) { ··· 799 799 } 800 800 801 801 for (i = 0; i < HPAGE_PMD_NR; i++) { 802 - pages[i] = alloc_page_vma(GFP_HIGHUSER_MOVABLE, 803 - vma, address); 802 + pages[i] = alloc_page_vma_node(GFP_HIGHUSER_MOVABLE, 803 + vma, address, page_to_nid(page)); 804 804 if (unlikely(!pages[i] || 805 805 mem_cgroup_newpage_charge(pages[i], mm, 806 806 GFP_KERNEL))) { ··· 902 902 if (transparent_hugepage_enabled(vma) && 903 903 !transparent_hugepage_debug_cow()) 904 904 new_page = alloc_hugepage_vma(transparent_hugepage_defrag(vma), 905 - vma, haddr); 905 + vma, haddr, numa_node_id()); 906 906 else 907 907 new_page = NULL; 908 908 ··· 1745 1745 static void collapse_huge_page(struct mm_struct *mm, 1746 1746 unsigned long address, 1747 1747 struct page **hpage, 1748 - struct vm_area_struct *vma) 1748 + struct vm_area_struct *vma, 1749 + int node) 1749 1750 { 1750 1751 pgd_t *pgd; 1751 1752 pud_t *pud; ··· 1774 1773 * mmap_sem in read mode is good idea also to allow greater 1775 1774 * scalability. 1776 1775 */ 1777 - new_page = alloc_hugepage_vma(khugepaged_defrag(), vma, address); 1776 + new_page = alloc_hugepage_vma(khugepaged_defrag(), vma, address, 1777 + node); 1778 1778 if (unlikely(!new_page)) { 1779 1779 up_read(&mm->mmap_sem); 1780 1780 *hpage = ERR_PTR(-ENOMEM); ··· 1921 1919 struct page *page; 1922 1920 unsigned long _address; 1923 1921 spinlock_t *ptl; 1922 + int node = -1; 1924 1923 1925 1924 VM_BUG_ON(address & ~HPAGE_PMD_MASK); 1926 1925 ··· 1952 1949 page = vm_normal_page(vma, _address, pteval); 1953 1950 if (unlikely(!page)) 1954 1951 goto out_unmap; 1952 + /* 1953 + * Chose the node of the first page. This could 1954 + * be more sophisticated and look at more pages, 1955 + * but isn't for now. 1956 + */ 1957 + if (node == -1) 1958 + node = page_to_nid(page); 1955 1959 VM_BUG_ON(PageCompound(page)); 1956 1960 if (!PageLRU(page) || PageLocked(page) || !PageAnon(page)) 1957 1961 goto out_unmap; ··· 1975 1965 pte_unmap_unlock(pte, ptl); 1976 1966 if (ret) 1977 1967 /* collapse_huge_page will return with the mmap_sem released */ 1978 - collapse_huge_page(mm, address, hpage, vma); 1968 + collapse_huge_page(mm, address, hpage, vma, node); 1979 1969 out: 1980 1970 return ret; 1981 1971 }
+2
mm/memory.c
··· 2648 2648 details.last_index = ULONG_MAX; 2649 2649 details.i_mmap_lock = &mapping->i_mmap_lock; 2650 2650 2651 + mutex_lock(&mapping->unmap_mutex); 2651 2652 spin_lock(&mapping->i_mmap_lock); 2652 2653 2653 2654 /* Protect against endless unmapping loops */ ··· 2665 2664 if (unlikely(!list_empty(&mapping->i_mmap_nonlinear))) 2666 2665 unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details); 2667 2666 spin_unlock(&mapping->i_mmap_lock); 2667 + mutex_unlock(&mapping->unmap_mutex); 2668 2668 } 2669 2669 EXPORT_SYMBOL(unmap_mapping_range); 2670 2670
+8 -8
mm/mempolicy.c
··· 1524 1524 } 1525 1525 1526 1526 /* Return a zonelist indicated by gfp for node representing a mempolicy */ 1527 - static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy) 1527 + static struct zonelist *policy_zonelist(gfp_t gfp, struct mempolicy *policy, 1528 + int nd) 1528 1529 { 1529 - int nd = numa_node_id(); 1530 - 1531 1530 switch (policy->mode) { 1532 1531 case MPOL_PREFERRED: 1533 1532 if (!(policy->flags & MPOL_F_LOCAL)) ··· 1678 1679 zl = node_zonelist(interleave_nid(*mpol, vma, addr, 1679 1680 huge_page_shift(hstate_vma(vma))), gfp_flags); 1680 1681 } else { 1681 - zl = policy_zonelist(gfp_flags, *mpol); 1682 + zl = policy_zonelist(gfp_flags, *mpol, numa_node_id()); 1682 1683 if ((*mpol)->mode == MPOL_BIND) 1683 1684 *nodemask = &(*mpol)->v.nodes; 1684 1685 } ··· 1819 1820 */ 1820 1821 struct page * 1821 1822 alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, 1822 - unsigned long addr) 1823 + unsigned long addr, int node) 1823 1824 { 1824 1825 struct mempolicy *pol = get_vma_policy(current, vma, addr); 1825 1826 struct zonelist *zl; ··· 1829 1830 if (unlikely(pol->mode == MPOL_INTERLEAVE)) { 1830 1831 unsigned nid; 1831 1832 1832 - nid = interleave_nid(pol, vma, addr, PAGE_SHIFT); 1833 + nid = interleave_nid(pol, vma, addr, PAGE_SHIFT + order); 1833 1834 mpol_cond_put(pol); 1834 1835 page = alloc_page_interleave(gfp, order, nid); 1835 1836 put_mems_allowed(); 1836 1837 return page; 1837 1838 } 1838 - zl = policy_zonelist(gfp, pol); 1839 + zl = policy_zonelist(gfp, pol, node); 1839 1840 if (unlikely(mpol_needs_cond_ref(pol))) { 1840 1841 /* 1841 1842 * slow path: ref counted shared policy ··· 1891 1892 page = alloc_page_interleave(gfp, order, interleave_nodes(pol)); 1892 1893 else 1893 1894 page = __alloc_pages_nodemask(gfp, order, 1894 - policy_zonelist(gfp, pol), policy_nodemask(gfp, pol)); 1895 + policy_zonelist(gfp, pol, numa_node_id()), 1896 + policy_nodemask(gfp, pol)); 1895 1897 put_mems_allowed(); 1896 1898 return page; 1897 1899 }
+3 -3
mm/migrate.c
··· 1287 1287 return -EPERM; 1288 1288 1289 1289 /* Find the mm_struct */ 1290 - read_lock(&tasklist_lock); 1290 + rcu_read_lock(); 1291 1291 task = pid ? find_task_by_vpid(pid) : current; 1292 1292 if (!task) { 1293 - read_unlock(&tasklist_lock); 1293 + rcu_read_unlock(); 1294 1294 return -ESRCH; 1295 1295 } 1296 1296 mm = get_task_mm(task); 1297 - read_unlock(&tasklist_lock); 1297 + rcu_read_unlock(); 1298 1298 1299 1299 if (!mm) 1300 1300 return -EINVAL;
+1 -3
mm/mremap.c
··· 94 94 */ 95 95 mapping = vma->vm_file->f_mapping; 96 96 spin_lock(&mapping->i_mmap_lock); 97 - if (new_vma->vm_truncate_count && 98 - new_vma->vm_truncate_count != vma->vm_truncate_count) 99 - new_vma->vm_truncate_count = 0; 97 + new_vma->vm_truncate_count = 0; 100 98 } 101 99 102 100 /*
+2 -3
mm/page_alloc.c
··· 5376 5376 for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) { 5377 5377 unsigned long check = pfn + iter; 5378 5378 5379 - if (!pfn_valid_within(check)) { 5380 - iter++; 5379 + if (!pfn_valid_within(check)) 5381 5380 continue; 5382 - } 5381 + 5383 5382 page = pfn_to_page(check); 5384 5383 if (!page_count(page)) { 5385 5384 if (PageBuddy(page))
+1 -1
mm/swapfile.c
··· 1940 1940 1941 1941 error = -EINVAL; 1942 1942 if (S_ISBLK(inode->i_mode)) { 1943 - bdev = I_BDEV(inode); 1943 + bdev = bdgrab(I_BDEV(inode)); 1944 1944 error = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, 1945 1945 sys_swapon); 1946 1946 if (error < 0) {
+2
mm/truncate.c
··· 225 225 next = start; 226 226 while (next <= end && 227 227 pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) { 228 + mem_cgroup_uncharge_start(); 228 229 for (i = 0; i < pagevec_count(&pvec); i++) { 229 230 struct page *page = pvec.pages[i]; 230 231 pgoff_t page_index = page->index; ··· 248 247 unlock_page(page); 249 248 } 250 249 pagevec_release(&pvec); 250 + mem_cgroup_uncharge_end(); 251 251 cond_resched(); 252 252 } 253 253
+22 -10
mm/vmscan.c
··· 1841 1841 if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION)) 1842 1842 return false; 1843 1843 1844 - /* 1845 - * If we failed to reclaim and have scanned the full list, stop. 1846 - * NOTE: Checking just nr_reclaimed would exit reclaim/compaction far 1847 - * faster but obviously would be less likely to succeed 1848 - * allocation. If this is desirable, use GFP_REPEAT to decide 1849 - * if both reclaimed and scanned should be checked or just 1850 - * reclaimed 1851 - */ 1852 - if (!nr_reclaimed && !nr_scanned) 1853 - return false; 1844 + /* Consider stopping depending on scan and reclaim activity */ 1845 + if (sc->gfp_mask & __GFP_REPEAT) { 1846 + /* 1847 + * For __GFP_REPEAT allocations, stop reclaiming if the 1848 + * full LRU list has been scanned and we are still failing 1849 + * to reclaim pages. This full LRU scan is potentially 1850 + * expensive but a __GFP_REPEAT caller really wants to succeed 1851 + */ 1852 + if (!nr_reclaimed && !nr_scanned) 1853 + return false; 1854 + } else { 1855 + /* 1856 + * For non-__GFP_REPEAT allocations which can presumably 1857 + * fail without consequence, stop if we failed to reclaim 1858 + * any pages from the last SWAP_CLUSTER_MAX number of 1859 + * pages that were scanned. This will return to the 1860 + * caller faster at the risk reclaim/compaction and 1861 + * the resulting allocation attempt fails 1862 + */ 1863 + if (!nr_reclaimed) 1864 + return false; 1865 + } 1854 1866 1855 1867 /* 1856 1868 * If we have not reclaimed enough pages for compaction and the
+2
net/bluetooth/rfcomm/tty.c
··· 727 727 break; 728 728 } 729 729 730 + tty_unlock(); 730 731 schedule(); 732 + tty_lock(); 731 733 } 732 734 set_current_state(TASK_RUNNING); 733 735 remove_wait_queue(&dev->wait, &wait);
+12 -11
net/bridge/br_multicast.c
··· 37 37 rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) 38 38 39 39 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 40 - static inline int ipv6_is_local_multicast(const struct in6_addr *addr) 40 + static inline int ipv6_is_transient_multicast(const struct in6_addr *addr) 41 41 { 42 - if (ipv6_addr_is_multicast(addr) && 43 - IPV6_ADDR_MC_SCOPE(addr) <= IPV6_ADDR_SCOPE_LINKLOCAL) 42 + if (ipv6_addr_is_multicast(addr) && IPV6_ADDR_MC_FLAG_TRANSIENT(addr)) 44 43 return 1; 45 44 return 0; 46 45 } ··· 434 435 eth = eth_hdr(skb); 435 436 436 437 memcpy(eth->h_source, br->dev->dev_addr, 6); 437 - ipv6_eth_mc_map(group, eth->h_dest); 438 438 eth->h_proto = htons(ETH_P_IPV6); 439 439 skb_put(skb, sizeof(*eth)); 440 440 ··· 445 447 ip6h->payload_len = htons(8 + sizeof(*mldq)); 446 448 ip6h->nexthdr = IPPROTO_HOPOPTS; 447 449 ip6h->hop_limit = 1; 448 - ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0); 450 + ipv6_dev_get_saddr(dev_net(br->dev), br->dev, &ip6h->daddr, 0, 451 + &ip6h->saddr); 449 452 ipv6_addr_set(&ip6h->daddr, htonl(0xff020000), 0, 0, htonl(1)); 453 + ipv6_eth_mc_map(&ip6h->daddr, eth->h_dest); 450 454 451 455 hopopt = (u8 *)(ip6h + 1); 452 456 hopopt[0] = IPPROTO_ICMPV6; /* next hdr */ ··· 780 780 { 781 781 struct br_ip br_group; 782 782 783 - if (ipv6_is_local_multicast(group)) 783 + if (!ipv6_is_transient_multicast(group)) 784 784 return 0; 785 785 786 786 ipv6_addr_copy(&br_group.u.ip6, group); 787 - br_group.proto = htons(ETH_P_IP); 787 + br_group.proto = htons(ETH_P_IPV6); 788 788 789 789 return br_multicast_add_group(br, port, &br_group); 790 790 } ··· 1013 1013 1014 1014 nsrcs = skb_header_pointer(skb, 1015 1015 len + offsetof(struct mld2_grec, 1016 - grec_mca), 1016 + grec_nsrcs), 1017 1017 sizeof(_nsrcs), &_nsrcs); 1018 1018 if (!nsrcs) 1019 1019 return -EINVAL; 1020 1020 1021 1021 if (!pskb_may_pull(skb, 1022 1022 len + sizeof(*grec) + 1023 - sizeof(struct in6_addr) * (*nsrcs))) 1023 + sizeof(struct in6_addr) * ntohs(*nsrcs))) 1024 1024 return -EINVAL; 1025 1025 1026 1026 grec = (struct mld2_grec *)(skb->data + len); 1027 - len += sizeof(*grec) + sizeof(struct in6_addr) * (*nsrcs); 1027 + len += sizeof(*grec) + 1028 + sizeof(struct in6_addr) * ntohs(*nsrcs); 1028 1029 1029 1030 /* We treat these as MLDv1 reports for now. */ 1030 1031 switch (grec->grec_type) { ··· 1341 1340 { 1342 1341 struct br_ip br_group; 1343 1342 1344 - if (ipv6_is_local_multicast(group)) 1343 + if (!ipv6_is_transient_multicast(group)) 1345 1344 return; 1346 1345 1347 1346 ipv6_addr_copy(&br_group.u.ip6, group);
+54 -17
net/ceph/messenger.c
··· 336 336 ceph_msg_put(con->out_msg); 337 337 con->out_msg = NULL; 338 338 } 339 - con->out_keepalive_pending = false; 340 339 con->in_seq = 0; 341 340 con->in_seq_acked = 0; 342 341 } ··· 1247 1248 con->auth_retry); 1248 1249 if (con->auth_retry == 2) { 1249 1250 con->error_msg = "connect authorization failure"; 1250 - reset_connection(con); 1251 - set_bit(CLOSED, &con->state); 1252 1251 return -1; 1253 1252 } 1254 1253 con->auth_retry = 1; ··· 1712 1715 1713 1716 /* open the socket first? */ 1714 1717 if (con->sock == NULL) { 1715 - /* 1716 - * if we were STANDBY and are reconnecting _this_ 1717 - * connection, bump connect_seq now. Always bump 1718 - * global_seq. 1719 - */ 1720 - if (test_and_clear_bit(STANDBY, &con->state)) 1721 - con->connect_seq++; 1722 - 1723 1718 prepare_write_banner(msgr, con); 1724 1719 prepare_write_connect(msgr, con, 1); 1725 1720 prepare_read_banner(con); ··· 1940 1951 work.work); 1941 1952 1942 1953 mutex_lock(&con->mutex); 1954 + if (test_and_clear_bit(BACKOFF, &con->state)) { 1955 + dout("con_work %p backing off\n", con); 1956 + if (queue_delayed_work(ceph_msgr_wq, &con->work, 1957 + round_jiffies_relative(con->delay))) { 1958 + dout("con_work %p backoff %lu\n", con, con->delay); 1959 + mutex_unlock(&con->mutex); 1960 + return; 1961 + } else { 1962 + con->ops->put(con); 1963 + dout("con_work %p FAILED to back off %lu\n", con, 1964 + con->delay); 1965 + } 1966 + } 1943 1967 1968 + if (test_bit(STANDBY, &con->state)) { 1969 + dout("con_work %p STANDBY\n", con); 1970 + goto done; 1971 + } 1944 1972 if (test_bit(CLOSED, &con->state)) { /* e.g. if we are replaced */ 1945 1973 dout("con_work CLOSED\n"); 1946 1974 con_close_socket(con); ··· 2014 2008 /* Requeue anything that hasn't been acked */ 2015 2009 list_splice_init(&con->out_sent, &con->out_queue); 2016 2010 2017 - /* If there are no messages in the queue, place the connection 2018 - * in a STANDBY state (i.e., don't try to reconnect just yet). */ 2019 - if (list_empty(&con->out_queue) && !con->out_keepalive_pending) { 2020 - dout("fault setting STANDBY\n"); 2011 + /* If there are no messages queued or keepalive pending, place 2012 + * the connection in a STANDBY state */ 2013 + if (list_empty(&con->out_queue) && 2014 + !test_bit(KEEPALIVE_PENDING, &con->state)) { 2015 + dout("fault %p setting STANDBY clearing WRITE_PENDING\n", con); 2016 + clear_bit(WRITE_PENDING, &con->state); 2021 2017 set_bit(STANDBY, &con->state); 2022 2018 } else { 2023 2019 /* retry after a delay. */ ··· 2027 2019 con->delay = BASE_DELAY_INTERVAL; 2028 2020 else if (con->delay < MAX_DELAY_INTERVAL) 2029 2021 con->delay *= 2; 2030 - dout("fault queueing %p delay %lu\n", con, con->delay); 2031 2022 con->ops->get(con); 2032 2023 if (queue_delayed_work(ceph_msgr_wq, &con->work, 2033 - round_jiffies_relative(con->delay)) == 0) 2024 + round_jiffies_relative(con->delay))) { 2025 + dout("fault queued %p delay %lu\n", con, con->delay); 2026 + } else { 2034 2027 con->ops->put(con); 2028 + dout("fault failed to queue %p delay %lu, backoff\n", 2029 + con, con->delay); 2030 + /* 2031 + * In many cases we see a socket state change 2032 + * while con_work is running and end up 2033 + * queuing (non-delayed) work, such that we 2034 + * can't backoff with a delay. Set a flag so 2035 + * that when con_work restarts we schedule the 2036 + * delay then. 2037 + */ 2038 + set_bit(BACKOFF, &con->state); 2039 + } 2035 2040 } 2036 2041 2037 2042 out_unlock: ··· 2115 2094 } 2116 2095 EXPORT_SYMBOL(ceph_messenger_destroy); 2117 2096 2097 + static void clear_standby(struct ceph_connection *con) 2098 + { 2099 + /* come back from STANDBY? */ 2100 + if (test_and_clear_bit(STANDBY, &con->state)) { 2101 + mutex_lock(&con->mutex); 2102 + dout("clear_standby %p and ++connect_seq\n", con); 2103 + con->connect_seq++; 2104 + WARN_ON(test_bit(WRITE_PENDING, &con->state)); 2105 + WARN_ON(test_bit(KEEPALIVE_PENDING, &con->state)); 2106 + mutex_unlock(&con->mutex); 2107 + } 2108 + } 2109 + 2118 2110 /* 2119 2111 * Queue up an outgoing message on the given connection. 2120 2112 */ ··· 2160 2126 2161 2127 /* if there wasn't anything waiting to send before, queue 2162 2128 * new work */ 2129 + clear_standby(con); 2163 2130 if (test_and_set_bit(WRITE_PENDING, &con->state) == 0) 2164 2131 queue_con(con); 2165 2132 } ··· 2226 2191 */ 2227 2192 void ceph_con_keepalive(struct ceph_connection *con) 2228 2193 { 2194 + dout("con_keepalive %p\n", con); 2195 + clear_standby(con); 2229 2196 if (test_and_set_bit(KEEPALIVE_PENDING, &con->state) == 0 && 2230 2197 test_and_set_bit(WRITE_PENDING, &con->state) == 0) 2231 2198 queue_con(con);
+13 -5
net/ceph/pagevec.c
··· 16 16 int num_pages, bool write_page) 17 17 { 18 18 struct page **pages; 19 - int rc; 19 + int got = 0; 20 + int rc = 0; 20 21 21 22 pages = kmalloc(sizeof(*pages) * num_pages, GFP_NOFS); 22 23 if (!pages) 23 24 return ERR_PTR(-ENOMEM); 24 25 25 26 down_read(&current->mm->mmap_sem); 26 - rc = get_user_pages(current, current->mm, (unsigned long)data, 27 - num_pages, write_page, 0, pages, NULL); 27 + while (got < num_pages) { 28 + rc = get_user_pages(current, current->mm, 29 + (unsigned long)data + ((unsigned long)got * PAGE_SIZE), 30 + num_pages - got, write_page, 0, pages + got, NULL); 31 + if (rc < 0) 32 + break; 33 + BUG_ON(rc == 0); 34 + got += rc; 35 + } 28 36 up_read(&current->mm->mmap_sem); 29 - if (rc < num_pages) 37 + if (rc < 0) 30 38 goto fail; 31 39 return pages; 32 40 33 41 fail: 34 - ceph_put_page_vector(pages, rc > 0 ? rc : 0, false); 42 + ceph_put_page_vector(pages, got, false); 35 43 return ERR_PTR(rc); 36 44 } 37 45 EXPORT_SYMBOL(ceph_get_direct_page_vector);
+1 -1
net/core/dev_addr_lists.c
··· 144 144 145 145 list_for_each_entry(ha, &from_list->list, list) { 146 146 type = addr_type ? addr_type : ha->type; 147 - __hw_addr_del(to_list, ha->addr, addr_len, addr_type); 147 + __hw_addr_del(to_list, ha->addr, addr_len, type); 148 148 } 149 149 } 150 150 EXPORT_SYMBOL(__hw_addr_del_multiple);
+1 -1
net/dcb/dcbnl.c
··· 1193 1193 goto err; 1194 1194 } 1195 1195 1196 - if (ieee[DCB_ATTR_IEEE_PFC] && ops->ieee_setets) { 1196 + if (ieee[DCB_ATTR_IEEE_PFC] && ops->ieee_setpfc) { 1197 1197 struct ieee_pfc *pfc = nla_data(ieee[DCB_ATTR_IEEE_PFC]); 1198 1198 err = ops->ieee_setpfc(netdev, pfc); 1199 1199 if (err)
+3 -4
net/dccp/input.c
··· 614 614 /* Caller (dccp_v4_do_rcv) will send Reset */ 615 615 dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; 616 616 return 1; 617 + } else if (sk->sk_state == DCCP_CLOSED) { 618 + dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; 619 + return 1; 617 620 } 618 621 619 622 if (sk->sk_state != DCCP_REQUESTING && sk->sk_state != DCCP_RESPOND) { ··· 671 668 } 672 669 673 670 switch (sk->sk_state) { 674 - case DCCP_CLOSED: 675 - dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; 676 - return 1; 677 - 678 671 case DCCP_REQUESTING: 679 672 queued = dccp_rcv_request_sent_state_process(sk, skb, dh, len); 680 673 if (queued >= 0)
+17 -3
net/dns_resolver/dns_key.c
··· 67 67 size_t result_len = 0; 68 68 const char *data = _data, *end, *opt; 69 69 70 - kenter("%%%d,%s,'%s',%zu", 71 - key->serial, key->description, data, datalen); 70 + kenter("%%%d,%s,'%*.*s',%zu", 71 + key->serial, key->description, 72 + (int)datalen, (int)datalen, data, datalen); 72 73 73 74 if (datalen <= 1 || !data || data[datalen - 1] != '\0') 74 75 return -EINVAL; ··· 218 217 seq_printf(m, ": %u", key->datalen); 219 218 } 220 219 220 + /* 221 + * read the DNS data 222 + * - the key's semaphore is read-locked 223 + */ 224 + static long dns_resolver_read(const struct key *key, 225 + char __user *buffer, size_t buflen) 226 + { 227 + if (key->type_data.x[0]) 228 + return key->type_data.x[0]; 229 + 230 + return user_read(key, buffer, buflen); 231 + } 232 + 221 233 struct key_type key_type_dns_resolver = { 222 234 .name = "dns_resolver", 223 235 .instantiate = dns_resolver_instantiate, ··· 238 224 .revoke = user_revoke, 239 225 .destroy = user_destroy, 240 226 .describe = dns_resolver_describe, 241 - .read = user_read, 227 + .read = dns_resolver_read, 242 228 }; 243 229 244 230 static int __init init_dns_resolver(void)
+2
net/ipv4/inet_timewait_sock.c
··· 505 505 } 506 506 507 507 rcu_read_unlock(); 508 + local_bh_disable(); 508 509 inet_twsk_deschedule(tw, twdr); 510 + local_bh_enable(); 509 511 inet_twsk_put(tw); 510 512 goto restart_rcu; 511 513 }
+3 -2
net/ipv4/tcp_input.c
··· 1222 1222 } 1223 1223 1224 1224 /* D-SACK for already forgotten data... Do dumb counting. */ 1225 - if (dup_sack && 1225 + if (dup_sack && tp->undo_marker && tp->undo_retrans && 1226 1226 !after(end_seq_0, prior_snd_una) && 1227 1227 after(end_seq_0, tp->undo_marker)) 1228 1228 tp->undo_retrans--; ··· 1299 1299 1300 1300 /* Account D-SACK for retransmitted packet. */ 1301 1301 if (dup_sack && (sacked & TCPCB_RETRANS)) { 1302 - if (after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker)) 1302 + if (tp->undo_marker && tp->undo_retrans && 1303 + after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker)) 1303 1304 tp->undo_retrans--; 1304 1305 if (sacked & TCPCB_SACKED_ACKED) 1305 1306 state->reord = min(fack_count, state->reord);
+1 -1
net/ipv4/tcp_output.c
··· 2162 2162 if (!tp->retrans_stamp) 2163 2163 tp->retrans_stamp = TCP_SKB_CB(skb)->when; 2164 2164 2165 - tp->undo_retrans++; 2165 + tp->undo_retrans += tcp_skb_pcount(skb); 2166 2166 2167 2167 /* snd_nxt is stored to detect loss of retransmitted segment, 2168 2168 * see tcp_input.c tcp_sacktag_write_queue().
+1 -1
net/ipv6/netfilter/ip6t_LOG.c
··· 410 410 if (p != NULL) { 411 411 sb_add(m, "%02x", *p++); 412 412 for (i = 1; i < len; i++) 413 - sb_add(m, ":%02x", p[i]); 413 + sb_add(m, ":%02x", *p++); 414 414 } 415 415 sb_add(m, " "); 416 416
+10 -7
net/ipv6/route.c
··· 2557 2557 int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, 2558 2558 void __user *buffer, size_t *lenp, loff_t *ppos) 2559 2559 { 2560 - struct net *net = current->nsproxy->net_ns; 2561 - int delay = net->ipv6.sysctl.flush_delay; 2562 - if (write) { 2563 - proc_dointvec(ctl, write, buffer, lenp, ppos); 2564 - fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net); 2565 - return 0; 2566 - } else 2560 + struct net *net; 2561 + int delay; 2562 + if (!write) 2567 2563 return -EINVAL; 2564 + 2565 + net = (struct net *)ctl->extra1; 2566 + delay = net->ipv6.sysctl.flush_delay; 2567 + proc_dointvec(ctl, write, buffer, lenp, ppos); 2568 + fib6_run_gc(delay <= 0 ? ~0UL : (unsigned long)delay, net); 2569 + return 0; 2568 2570 } 2569 2571 2570 2572 ctl_table ipv6_route_table_template[] = { ··· 2653 2651 2654 2652 if (table) { 2655 2653 table[0].data = &net->ipv6.sysctl.flush_delay; 2654 + table[0].extra1 = net; 2656 2655 table[1].data = &net->ipv6.ip6_dst_ops.gc_thresh; 2657 2656 table[2].data = &net->ipv6.sysctl.ip6_rt_max_size; 2658 2657 table[3].data = &net->ipv6.sysctl.ip6_rt_gc_min_interval;
+1
net/mac80211/iface.c
··· 1229 1229 } 1230 1230 mutex_unlock(&local->iflist_mtx); 1231 1231 unregister_netdevice_many(&unreg_list); 1232 + list_del(&unreg_list); 1232 1233 } 1233 1234 1234 1235 static u32 ieee80211_idle_off(struct ieee80211_local *local,
+6
net/mac80211/mlme.c
··· 1033 1033 if (is_multicast_ether_addr(hdr->addr1)) 1034 1034 return; 1035 1035 1036 + /* 1037 + * In case we receive frames after disassociation. 1038 + */ 1039 + if (!sdata->u.mgd.associated) 1040 + return; 1041 + 1036 1042 ieee80211_sta_reset_conn_monitor(sdata); 1037 1043 } 1038 1044
+2 -2
net/netfilter/ipvs/ip_vs_ctl.c
··· 808 808 dest->u_threshold = udest->u_threshold; 809 809 dest->l_threshold = udest->l_threshold; 810 810 811 - spin_lock(&dest->dst_lock); 811 + spin_lock_bh(&dest->dst_lock); 812 812 ip_vs_dst_reset(dest); 813 - spin_unlock(&dest->dst_lock); 813 + spin_unlock_bh(&dest->dst_lock); 814 814 815 815 if (add) 816 816 ip_vs_new_estimator(&dest->stats);
+4
net/netfilter/nf_log.c
··· 85 85 86 86 int nf_log_bind_pf(u_int8_t pf, const struct nf_logger *logger) 87 87 { 88 + if (pf >= ARRAY_SIZE(nf_loggers)) 89 + return -EINVAL; 88 90 mutex_lock(&nf_log_mutex); 89 91 if (__find_logger(pf, logger->name) == NULL) { 90 92 mutex_unlock(&nf_log_mutex); ··· 100 98 101 99 void nf_log_unbind_pf(u_int8_t pf) 102 100 { 101 + if (pf >= ARRAY_SIZE(nf_loggers)) 102 + return; 103 103 mutex_lock(&nf_log_mutex); 104 104 rcu_assign_pointer(nf_loggers[pf], NULL); 105 105 mutex_unlock(&nf_log_mutex);
+11 -14
net/netfilter/nf_tproxy_core.c
··· 28 28 skb->destructor = NULL; 29 29 30 30 if (sk) 31 - nf_tproxy_put_sock(sk); 31 + sock_put(sk); 32 32 } 33 33 34 34 /* consumes sk */ 35 - int 35 + void 36 36 nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) 37 37 { 38 - bool transparent = (sk->sk_state == TCP_TIME_WAIT) ? 39 - inet_twsk(sk)->tw_transparent : 40 - inet_sk(sk)->transparent; 38 + /* assigning tw sockets complicates things; most 39 + * skb->sk->X checks would have to test sk->sk_state first */ 40 + if (sk->sk_state == TCP_TIME_WAIT) { 41 + inet_twsk_put(inet_twsk(sk)); 42 + return; 43 + } 41 44 42 - if (transparent) { 43 - skb_orphan(skb); 44 - skb->sk = sk; 45 - skb->destructor = nf_tproxy_destructor; 46 - return 1; 47 - } else 48 - nf_tproxy_put_sock(sk); 49 - 50 - return 0; 45 + skb_orphan(skb); 46 + skb->sk = sk; 47 + skb->destructor = nf_tproxy_destructor; 51 48 } 52 49 EXPORT_SYMBOL_GPL(nf_tproxy_assign_sock); 53 50
+20 -2
net/netfilter/xt_TPROXY.c
··· 33 33 #include <net/netfilter/nf_tproxy_core.h> 34 34 #include <linux/netfilter/xt_TPROXY.h> 35 35 36 + static bool tproxy_sk_is_transparent(struct sock *sk) 37 + { 38 + if (sk->sk_state != TCP_TIME_WAIT) { 39 + if (inet_sk(sk)->transparent) 40 + return true; 41 + sock_put(sk); 42 + } else { 43 + if (inet_twsk(sk)->tw_transparent) 44 + return true; 45 + inet_twsk_put(inet_twsk(sk)); 46 + } 47 + return false; 48 + } 49 + 36 50 static inline __be32 37 51 tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr) 38 52 { ··· 155 141 skb->dev, NFT_LOOKUP_LISTENER); 156 142 157 143 /* NOTE: assign_sock consumes our sk reference */ 158 - if (sk && nf_tproxy_assign_sock(skb, sk)) { 144 + if (sk && tproxy_sk_is_transparent(sk)) { 159 145 /* This should be in a separate target, but we don't do multiple 160 146 targets on the same rule yet */ 161 147 skb->mark = (skb->mark & ~mark_mask) ^ mark_value; ··· 163 149 pr_debug("redirecting: proto %hhu %pI4:%hu -> %pI4:%hu, mark: %x\n", 164 150 iph->protocol, &iph->daddr, ntohs(hp->dest), 165 151 &laddr, ntohs(lport), skb->mark); 152 + 153 + nf_tproxy_assign_sock(skb, sk); 166 154 return NF_ACCEPT; 167 155 } 168 156 ··· 322 306 par->in, NFT_LOOKUP_LISTENER); 323 307 324 308 /* NOTE: assign_sock consumes our sk reference */ 325 - if (sk && nf_tproxy_assign_sock(skb, sk)) { 309 + if (sk && tproxy_sk_is_transparent(sk)) { 326 310 /* This should be in a separate target, but we don't do multiple 327 311 targets on the same rule yet */ 328 312 skb->mark = (skb->mark & ~tgi->mark_mask) ^ tgi->mark_value; ··· 330 314 pr_debug("redirecting: proto %hhu %pI6:%hu -> %pI6:%hu, mark: %x\n", 331 315 tproto, &iph->saddr, ntohs(hp->source), 332 316 laddr, ntohs(lport), skb->mark); 317 + 318 + nf_tproxy_assign_sock(skb, sk); 333 319 return NF_ACCEPT; 334 320 } 335 321
+11 -2
net/netfilter/xt_socket.c
··· 35 35 #include <net/netfilter/nf_conntrack.h> 36 36 #endif 37 37 38 + static void 39 + xt_socket_put_sk(struct sock *sk) 40 + { 41 + if (sk->sk_state == TCP_TIME_WAIT) 42 + inet_twsk_put(inet_twsk(sk)); 43 + else 44 + sock_put(sk); 45 + } 46 + 38 47 static int 39 48 extract_icmp4_fields(const struct sk_buff *skb, 40 49 u8 *protocol, ··· 173 164 (sk->sk_state == TCP_TIME_WAIT && 174 165 inet_twsk(sk)->tw_transparent)); 175 166 176 - nf_tproxy_put_sock(sk); 167 + xt_socket_put_sk(sk); 177 168 178 169 if (wildcard || !transparent) 179 170 sk = NULL; ··· 307 298 (sk->sk_state == TCP_TIME_WAIT && 308 299 inet_twsk(sk)->tw_transparent)); 309 300 310 - nf_tproxy_put_sock(sk); 301 + xt_socket_put_sk(sk); 311 302 312 303 if (wildcard || !transparent) 313 304 sk = NULL;
+14 -4
net/netlink/af_netlink.c
··· 1407 1407 int noblock = flags&MSG_DONTWAIT; 1408 1408 size_t copied; 1409 1409 struct sk_buff *skb, *data_skb; 1410 - int err; 1410 + int err, ret; 1411 1411 1412 1412 if (flags&MSG_OOB) 1413 1413 return -EOPNOTSUPP; ··· 1470 1470 1471 1471 skb_free_datagram(sk, skb); 1472 1472 1473 - if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2) 1474 - netlink_dump(sk); 1473 + if (nlk->cb && atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf / 2) { 1474 + ret = netlink_dump(sk); 1475 + if (ret) { 1476 + sk->sk_err = ret; 1477 + sk->sk_error_report(sk); 1478 + } 1479 + } 1475 1480 1476 1481 scm_recv(sock, msg, siocb->scm, flags); 1477 1482 out: ··· 1741 1736 struct netlink_callback *cb; 1742 1737 struct sock *sk; 1743 1738 struct netlink_sock *nlk; 1739 + int ret; 1744 1740 1745 1741 cb = kzalloc(sizeof(*cb), GFP_KERNEL); 1746 1742 if (cb == NULL) ··· 1770 1764 nlk->cb = cb; 1771 1765 mutex_unlock(nlk->cb_mutex); 1772 1766 1773 - netlink_dump(sk); 1767 + ret = netlink_dump(sk); 1768 + 1774 1769 sock_put(sk); 1770 + 1771 + if (ret) 1772 + return ret; 1775 1773 1776 1774 /* We successfully started a dump, by returning -EINTR we 1777 1775 * signal not to send ACK even if it was requested.
+1
net/rxrpc/ar-input.c
··· 423 423 goto protocol_error; 424 424 } 425 425 426 + case RXRPC_PACKET_TYPE_ACKALL: 426 427 case RXRPC_PACKET_TYPE_ACK: 427 428 /* ACK processing is done in process context */ 428 429 read_lock_bh(&call->state_lock);
+4 -4
net/rxrpc/ar-key.c
··· 89 89 return ret; 90 90 91 91 plen -= sizeof(*token); 92 - token = kmalloc(sizeof(*token), GFP_KERNEL); 92 + token = kzalloc(sizeof(*token), GFP_KERNEL); 93 93 if (!token) 94 94 return -ENOMEM; 95 95 96 - token->kad = kmalloc(plen, GFP_KERNEL); 96 + token->kad = kzalloc(plen, GFP_KERNEL); 97 97 if (!token->kad) { 98 98 kfree(token); 99 99 return -ENOMEM; ··· 731 731 goto error; 732 732 733 733 ret = -ENOMEM; 734 - token = kmalloc(sizeof(*token), GFP_KERNEL); 734 + token = kzalloc(sizeof(*token), GFP_KERNEL); 735 735 if (!token) 736 736 goto error; 737 - token->kad = kmalloc(plen, GFP_KERNEL); 737 + token->kad = kzalloc(plen, GFP_KERNEL); 738 738 if (!token->kad) 739 739 goto error_free; 740 740
+1
net/sched/sch_generic.c
··· 839 839 840 840 list_add(&dev->unreg_list, &single); 841 841 dev_deactivate_many(&single); 842 + list_del(&single); 842 843 } 843 844 844 845 static void dev_init_scheduler_queue(struct net_device *dev,
+5 -5
net/sctp/sm_make_chunk.c
··· 2029 2029 *errp = sctp_make_op_error_fixed(asoc, chunk); 2030 2030 2031 2031 if (*errp) { 2032 - sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM, 2033 - WORD_ROUND(ntohs(param.p->length))); 2034 - sctp_addto_chunk_fixed(*errp, 2035 - WORD_ROUND(ntohs(param.p->length)), 2036 - param.v); 2032 + if (!sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM, 2033 + WORD_ROUND(ntohs(param.p->length)))) 2034 + sctp_addto_chunk_fixed(*errp, 2035 + WORD_ROUND(ntohs(param.p->length)), 2036 + param.v); 2037 2037 } else { 2038 2038 /* If there is no memory for generating the ERROR 2039 2039 * report as specified, an ABORT will be triggered
+2 -2
net/wireless/wext-compat.c
··· 802 802 return freq; 803 803 if (freq == 0) 804 804 return -EINVAL; 805 - wdev_lock(wdev); 806 805 mutex_lock(&rdev->devlist_mtx); 806 + wdev_lock(wdev); 807 807 err = cfg80211_set_freq(rdev, wdev, freq, NL80211_CHAN_NO_HT); 808 - mutex_unlock(&rdev->devlist_mtx); 809 808 wdev_unlock(wdev); 809 + mutex_unlock(&rdev->devlist_mtx); 810 810 return err; 811 811 default: 812 812 return -EOPNOTSUPP;
+1
sound/core/jack.c
··· 141 141 142 142 fail_input: 143 143 input_free_device(jack->input_dev); 144 + kfree(jack->id); 144 145 kfree(jack); 145 146 return err; 146 147 }
+2
sound/pci/hda/patch_cirrus.c
··· 1039 1039 {0x11, AC_VERB_SET_PROC_COEF, 0x0008}, 1040 1040 {0x11, AC_VERB_SET_PROC_STATE, 0x00}, 1041 1041 1042 + #if 0 /* Don't to set to D3 as we are in power-up sequence */ 1042 1043 {0x07, AC_VERB_SET_POWER_STATE, 0x03}, /* S/PDIF Rx: D3 */ 1043 1044 {0x08, AC_VERB_SET_POWER_STATE, 0x03}, /* S/PDIF Tx: D3 */ 1044 1045 /*{0x01, AC_VERB_SET_POWER_STATE, 0x03},*/ /* AFG: D3 This is already handled */ 1046 + #endif 1045 1047 1046 1048 {} /* terminator */ 1047 1049 };
+5
sound/pci/hda/patch_conexant.c
··· 3114 3114 SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO), 3115 3115 SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), 3116 3116 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), 3117 + SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD), 3118 + SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD), 3117 3119 SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), 3118 3120 SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS), 3119 3121 SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), ··· 3939 3937 .patch = patch_cxt5066 }, 3940 3938 { .id = 0x14f15069, .name = "CX20585", 3941 3939 .patch = patch_cxt5066 }, 3940 + { .id = 0x14f1506e, .name = "CX20590", 3941 + .patch = patch_cxt5066 }, 3942 3942 { .id = 0x14f15097, .name = "CX20631", 3943 3943 .patch = patch_conexant_auto }, 3944 3944 { .id = 0x14f15098, .name = "CX20632", ··· 3967 3963 MODULE_ALIAS("snd-hda-codec-id:14f15067"); 3968 3964 MODULE_ALIAS("snd-hda-codec-id:14f15068"); 3969 3965 MODULE_ALIAS("snd-hda-codec-id:14f15069"); 3966 + MODULE_ALIAS("snd-hda-codec-id:14f1506e"); 3970 3967 MODULE_ALIAS("snd-hda-codec-id:14f15097"); 3971 3968 MODULE_ALIAS("snd-hda-codec-id:14f15098"); 3972 3969 MODULE_ALIAS("snd-hda-codec-id:14f150a1");
+5
sound/pci/hda/patch_hdmi.c
··· 1634 1634 { .id = 0x10de0012, .name = "GPU 12 HDMI/DP", .patch = patch_nvhdmi_8ch_89 }, 1635 1635 { .id = 0x10de0013, .name = "GPU 13 HDMI/DP", .patch = patch_nvhdmi_8ch_89 }, 1636 1636 { .id = 0x10de0014, .name = "GPU 14 HDMI/DP", .patch = patch_nvhdmi_8ch_89 }, 1637 + { .id = 0x10de0015, .name = "GPU 15 HDMI/DP", .patch = patch_nvhdmi_8ch_89 }, 1638 + { .id = 0x10de0016, .name = "GPU 16 HDMI/DP", .patch = patch_nvhdmi_8ch_89 }, 1639 + /* 17 is known to be absent */ 1637 1640 { .id = 0x10de0018, .name = "GPU 18 HDMI/DP", .patch = patch_nvhdmi_8ch_89 }, 1638 1641 { .id = 0x10de0019, .name = "GPU 19 HDMI/DP", .patch = patch_nvhdmi_8ch_89 }, 1639 1642 { .id = 0x10de001a, .name = "GPU 1a HDMI/DP", .patch = patch_nvhdmi_8ch_89 }, ··· 1679 1676 MODULE_ALIAS("snd-hda-codec-id:10de0012"); 1680 1677 MODULE_ALIAS("snd-hda-codec-id:10de0013"); 1681 1678 MODULE_ALIAS("snd-hda-codec-id:10de0014"); 1679 + MODULE_ALIAS("snd-hda-codec-id:10de0015"); 1680 + MODULE_ALIAS("snd-hda-codec-id:10de0016"); 1682 1681 MODULE_ALIAS("snd-hda-codec-id:10de0018"); 1683 1682 MODULE_ALIAS("snd-hda-codec-id:10de0019"); 1684 1683 MODULE_ALIAS("snd-hda-codec-id:10de001a");
+3 -6
sound/pci/hda/patch_realtek.c
··· 1133 1133 nid = spec->autocfg.hp_pins[i]; 1134 1134 if (!nid) 1135 1135 break; 1136 - if (snd_hda_jack_detect(codec, nid)) { 1137 - spec->jack_present = 1; 1138 - break; 1139 - } 1140 - alc_report_jack(codec, spec->autocfg.hp_pins[i]); 1136 + alc_report_jack(codec, nid); 1137 + spec->jack_present |= snd_hda_jack_detect(codec, nid); 1141 1138 } 1142 1139 1143 1140 mute = spec->jack_present ? HDA_AMP_MUTE : 0; ··· 15012 15015 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269VB_AMIC), 15013 15016 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269VB_AMIC), 15014 15017 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_AMIC), 15015 - SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82Jv", ALC269_AMIC), 15018 + SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269VB_AMIC), 15016 15019 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_AMIC), 15017 15020 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_AMIC), 15018 15021 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_AMIC),
+12 -3
sound/pci/hda/patch_sigmatel.c
··· 586 586 0x0f, 0x10, 0x11, 0x1f, 0x20, 587 587 }; 588 588 589 - static hda_nid_t stac92hd88xxx_pin_nids[10] = { 589 + static hda_nid_t stac92hd87xxx_pin_nids[6] = { 590 + 0x0a, 0x0b, 0x0c, 0x0d, 591 + 0x0f, 0x11, 592 + }; 593 + 594 + static hda_nid_t stac92hd88xxx_pin_nids[8] = { 590 595 0x0a, 0x0b, 0x0c, 0x0d, 591 596 0x0f, 0x11, 0x1f, 0x20, 592 597 }; ··· 5435 5430 switch (codec->vendor_id) { 5436 5431 case 0x111d76d1: 5437 5432 case 0x111d76d9: 5433 + case 0x111d76e5: 5438 5434 spec->dmic_nids = stac92hd87b_dmic_nids; 5439 5435 spec->num_dmics = stac92xx_connected_ports(codec, 5440 5436 stac92hd87b_dmic_nids, 5441 5437 STAC92HD87B_NUM_DMICS); 5442 - spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids); 5443 - spec->pin_nids = stac92hd88xxx_pin_nids; 5438 + spec->num_pins = ARRAY_SIZE(stac92hd87xxx_pin_nids); 5439 + spec->pin_nids = stac92hd87xxx_pin_nids; 5444 5440 spec->mono_nid = 0; 5445 5441 spec->num_pwrs = 0; 5446 5442 break; ··· 5449 5443 case 0x111d7667: 5450 5444 case 0x111d7668: 5451 5445 case 0x111d7669: 5446 + case 0x111d76e3: 5452 5447 spec->num_dmics = stac92xx_connected_ports(codec, 5453 5448 stac92hd88xxx_dmic_nids, 5454 5449 STAC92HD88XXX_NUM_DMICS); ··· 6394 6387 { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx }, 6395 6388 { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx }, 6396 6389 { .id = 0x111d76e0, .name = "92HD91BXX", .patch = patch_stac92hd83xxx}, 6390 + { .id = 0x111d76e3, .name = "92HD98BXX", .patch = patch_stac92hd83xxx}, 6391 + { .id = 0x111d76e5, .name = "92HD99BXX", .patch = patch_stac92hd83xxx}, 6397 6392 { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx}, 6398 6393 {} /* terminator */ 6399 6394 };
+1 -1
sound/pci/hda/patch_via.c
··· 567 567 hda_nid_t nid = cfg->inputs[i].pin; 568 568 if (spec->smart51_enabled && is_smart51_pins(spec, nid)) 569 569 ctl = PIN_OUT; 570 - else if (i == AUTO_PIN_MIC) 570 + else if (cfg->inputs[i].type == AUTO_PIN_MIC) 571 571 ctl = PIN_VREF50; 572 572 else 573 573 ctl = PIN_IN;
+1 -1
sound/soc/codecs/cx20442.c
··· 367 367 return 0; 368 368 } 369 369 370 - static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC; 370 + static const u8 cx20442_reg; 371 371 372 372 static struct snd_soc_codec_driver cx20442_codec_dev = { 373 373 .probe = cx20442_codec_probe,
+1 -1
sound/soc/codecs/wm8903.c
··· 1482 1482 WM8903_MICDET_EINT | WM8903_MICSHRT_EINT, 1483 1483 irq_mask); 1484 1484 1485 - if (det && shrt) { 1485 + if (det || shrt) { 1486 1486 /* Enable mic detection, this may not have been set through 1487 1487 * platform data (eg, if the defaults are OK). */ 1488 1488 snd_soc_update_bits(codec, WM8903_WRITE_SEQUENCER_0,
+1 -1
sound/soc/codecs/wm8903.h
··· 165 165 166 166 #define WM8903_VMID_RES_50K 2 167 167 #define WM8903_VMID_RES_250K 3 168 - #define WM8903_VMID_RES_5K 4 168 + #define WM8903_VMID_RES_5K 6 169 169 170 170 /* 171 171 * R8 (0x08) - Analogue DAC 0
+221 -20
sound/soc/codecs/wm8994.c
··· 107 107 108 108 int revision; 109 109 struct wm8994_pdata *pdata; 110 + 111 + unsigned int aif1clk_enable:1; 112 + unsigned int aif2clk_enable:1; 113 + 114 + unsigned int aif1clk_disable:1; 115 + unsigned int aif2clk_disable:1; 110 116 }; 111 117 112 118 static int wm8994_readable(unsigned int reg) ··· 1010 1004 } 1011 1005 } 1012 1006 1007 + static int late_enable_ev(struct snd_soc_dapm_widget *w, 1008 + struct snd_kcontrol *kcontrol, int event) 1009 + { 1010 + struct snd_soc_codec *codec = w->codec; 1011 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1012 + 1013 + switch (event) { 1014 + case SND_SOC_DAPM_PRE_PMU: 1015 + if (wm8994->aif1clk_enable) { 1016 + snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, 1017 + WM8994_AIF1CLK_ENA_MASK, 1018 + WM8994_AIF1CLK_ENA); 1019 + wm8994->aif1clk_enable = 0; 1020 + } 1021 + if (wm8994->aif2clk_enable) { 1022 + snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, 1023 + WM8994_AIF2CLK_ENA_MASK, 1024 + WM8994_AIF2CLK_ENA); 1025 + wm8994->aif2clk_enable = 0; 1026 + } 1027 + break; 1028 + } 1029 + 1030 + return 0; 1031 + } 1032 + 1033 + static int late_disable_ev(struct snd_soc_dapm_widget *w, 1034 + struct snd_kcontrol *kcontrol, int event) 1035 + { 1036 + struct snd_soc_codec *codec = w->codec; 1037 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1038 + 1039 + switch (event) { 1040 + case SND_SOC_DAPM_POST_PMD: 1041 + if (wm8994->aif1clk_disable) { 1042 + snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, 1043 + WM8994_AIF1CLK_ENA_MASK, 0); 1044 + wm8994->aif1clk_disable = 0; 1045 + } 1046 + if (wm8994->aif2clk_disable) { 1047 + snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, 1048 + WM8994_AIF2CLK_ENA_MASK, 0); 1049 + wm8994->aif2clk_disable = 0; 1050 + } 1051 + break; 1052 + } 1053 + 1054 + return 0; 1055 + } 1056 + 1057 + static int aif1clk_ev(struct snd_soc_dapm_widget *w, 1058 + struct snd_kcontrol *kcontrol, int event) 1059 + { 1060 + struct snd_soc_codec *codec = w->codec; 1061 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1062 + 1063 + switch (event) { 1064 + case SND_SOC_DAPM_PRE_PMU: 1065 + wm8994->aif1clk_enable = 1; 1066 + break; 1067 + case SND_SOC_DAPM_POST_PMD: 1068 + wm8994->aif1clk_disable = 1; 1069 + break; 1070 + } 1071 + 1072 + return 0; 1073 + } 1074 + 1075 + static int aif2clk_ev(struct snd_soc_dapm_widget *w, 1076 + struct snd_kcontrol *kcontrol, int event) 1077 + { 1078 + struct snd_soc_codec *codec = w->codec; 1079 + struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 1080 + 1081 + switch (event) { 1082 + case SND_SOC_DAPM_PRE_PMU: 1083 + wm8994->aif2clk_enable = 1; 1084 + break; 1085 + case SND_SOC_DAPM_POST_PMD: 1086 + wm8994->aif2clk_disable = 1; 1087 + break; 1088 + } 1089 + 1090 + return 0; 1091 + } 1092 + 1093 + static int adc_mux_ev(struct snd_soc_dapm_widget *w, 1094 + struct snd_kcontrol *kcontrol, int event) 1095 + { 1096 + late_enable_ev(w, kcontrol, event); 1097 + return 0; 1098 + } 1099 + 1100 + static int dac_ev(struct snd_soc_dapm_widget *w, 1101 + struct snd_kcontrol *kcontrol, int event) 1102 + { 1103 + struct snd_soc_codec *codec = w->codec; 1104 + unsigned int mask = 1 << w->shift; 1105 + 1106 + snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 1107 + mask, mask); 1108 + return 0; 1109 + } 1110 + 1013 1111 static const char *hp_mux_text[] = { 1014 1112 "Mixer", 1015 1113 "DAC", ··· 1382 1272 static const struct snd_kcontrol_new aif2dacr_src_mux = 1383 1273 SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum); 1384 1274 1275 + static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = { 1276 + SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_ev, 1277 + SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 1278 + SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_ev, 1279 + SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 1280 + 1281 + SND_SOC_DAPM_PGA_E("Late DAC1L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1282 + late_enable_ev, SND_SOC_DAPM_PRE_PMU), 1283 + SND_SOC_DAPM_PGA_E("Late DAC1R Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1284 + late_enable_ev, SND_SOC_DAPM_PRE_PMU), 1285 + SND_SOC_DAPM_PGA_E("Late DAC2L Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1286 + late_enable_ev, SND_SOC_DAPM_PRE_PMU), 1287 + SND_SOC_DAPM_PGA_E("Late DAC2R Enable PGA", SND_SOC_NOPM, 0, 0, NULL, 0, 1288 + late_enable_ev, SND_SOC_DAPM_PRE_PMU), 1289 + 1290 + SND_SOC_DAPM_POST("Late Disable PGA", late_disable_ev) 1291 + }; 1292 + 1293 + static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { 1294 + SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), 1295 + SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0) 1296 + }; 1297 + 1298 + static const struct snd_soc_dapm_widget wm8994_dac_revd_widgets[] = { 1299 + SND_SOC_DAPM_DAC_E("DAC2L", NULL, SND_SOC_NOPM, 3, 0, 1300 + dac_ev, SND_SOC_DAPM_PRE_PMU), 1301 + SND_SOC_DAPM_DAC_E("DAC2R", NULL, SND_SOC_NOPM, 2, 0, 1302 + dac_ev, SND_SOC_DAPM_PRE_PMU), 1303 + SND_SOC_DAPM_DAC_E("DAC1L", NULL, SND_SOC_NOPM, 1, 0, 1304 + dac_ev, SND_SOC_DAPM_PRE_PMU), 1305 + SND_SOC_DAPM_DAC_E("DAC1R", NULL, SND_SOC_NOPM, 0, 0, 1306 + dac_ev, SND_SOC_DAPM_PRE_PMU), 1307 + }; 1308 + 1309 + static const struct snd_soc_dapm_widget wm8994_dac_widgets[] = { 1310 + SND_SOC_DAPM_DAC("DAC2L", NULL, WM8994_POWER_MANAGEMENT_5, 3, 0), 1311 + SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 2, 0), 1312 + SND_SOC_DAPM_DAC("DAC1L", NULL, WM8994_POWER_MANAGEMENT_5, 1, 0), 1313 + SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0), 1314 + }; 1315 + 1316 + static const struct snd_soc_dapm_widget wm8994_adc_revd_widgets[] = { 1317 + SND_SOC_DAPM_MUX_E("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux, 1318 + adc_mux_ev, SND_SOC_DAPM_PRE_PMU), 1319 + SND_SOC_DAPM_MUX_E("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux, 1320 + adc_mux_ev, SND_SOC_DAPM_PRE_PMU), 1321 + }; 1322 + 1323 + static const struct snd_soc_dapm_widget wm8994_adc_widgets[] = { 1324 + SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), 1325 + SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), 1326 + }; 1327 + 1385 1328 static const struct snd_soc_dapm_widget wm8994_dapm_widgets[] = { 1386 1329 SND_SOC_DAPM_INPUT("DMIC1DAT"), 1387 1330 SND_SOC_DAPM_INPUT("DMIC2DAT"), ··· 1446 1283 SND_SOC_DAPM_SUPPLY("DSP1CLK", WM8994_CLOCKING_1, 3, 0, NULL, 0), 1447 1284 SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0), 1448 1285 SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0), 1449 - 1450 - SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), 1451 - SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0), 1452 1286 1453 1287 SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL, 1454 1288 0, WM8994_POWER_MANAGEMENT_4, 9, 0), ··· 1528 1368 */ 1529 1369 SND_SOC_DAPM_ADC("ADCL", NULL, SND_SOC_NOPM, 1, 0), 1530 1370 SND_SOC_DAPM_ADC("ADCR", NULL, SND_SOC_NOPM, 0, 0), 1531 - 1532 - SND_SOC_DAPM_MUX("ADCL Mux", WM8994_POWER_MANAGEMENT_4, 1, 0, &adcl_mux), 1533 - SND_SOC_DAPM_MUX("ADCR Mux", WM8994_POWER_MANAGEMENT_4, 0, 0, &adcr_mux), 1534 - 1535 - SND_SOC_DAPM_DAC("DAC2L", NULL, WM8994_POWER_MANAGEMENT_5, 3, 0), 1536 - SND_SOC_DAPM_DAC("DAC2R", NULL, WM8994_POWER_MANAGEMENT_5, 2, 0), 1537 - SND_SOC_DAPM_DAC("DAC1L", NULL, WM8994_POWER_MANAGEMENT_5, 1, 0), 1538 - SND_SOC_DAPM_DAC("DAC1R", NULL, WM8994_POWER_MANAGEMENT_5, 0, 0), 1539 1371 1540 1372 SND_SOC_DAPM_MUX("Left Headphone Mux", SND_SOC_NOPM, 0, 0, &hpl_mux), 1541 1373 SND_SOC_DAPM_MUX("Right Headphone Mux", SND_SOC_NOPM, 0, 0, &hpr_mux), ··· 1668 1516 { "AIF2ADC Mux", "AIF3DACDAT", "AIF3ADCDAT" }, 1669 1517 1670 1518 /* DAC1 inputs */ 1671 - { "DAC1L", NULL, "DAC1L Mixer" }, 1672 1519 { "DAC1L Mixer", "AIF2 Switch", "AIF2DACL" }, 1673 1520 { "DAC1L Mixer", "AIF1.2 Switch", "AIF1DAC2L" }, 1674 1521 { "DAC1L Mixer", "AIF1.1 Switch", "AIF1DAC1L" }, 1675 1522 { "DAC1L Mixer", "Left Sidetone Switch", "Left Sidetone" }, 1676 1523 { "DAC1L Mixer", "Right Sidetone Switch", "Right Sidetone" }, 1677 1524 1678 - { "DAC1R", NULL, "DAC1R Mixer" }, 1679 1525 { "DAC1R Mixer", "AIF2 Switch", "AIF2DACR" }, 1680 1526 { "DAC1R Mixer", "AIF1.2 Switch", "AIF1DAC2R" }, 1681 1527 { "DAC1R Mixer", "AIF1.1 Switch", "AIF1DAC1R" }, ··· 1682 1532 1683 1533 /* DAC2/AIF2 outputs */ 1684 1534 { "AIF2ADCL", NULL, "AIF2DAC2L Mixer" }, 1685 - { "DAC2L", NULL, "AIF2DAC2L Mixer" }, 1686 1535 { "AIF2DAC2L Mixer", "AIF2 Switch", "AIF2DACL" }, 1687 1536 { "AIF2DAC2L Mixer", "AIF1.2 Switch", "AIF1DAC2L" }, 1688 1537 { "AIF2DAC2L Mixer", "AIF1.1 Switch", "AIF1DAC1L" }, ··· 1689 1540 { "AIF2DAC2L Mixer", "Right Sidetone Switch", "Right Sidetone" }, 1690 1541 1691 1542 { "AIF2ADCR", NULL, "AIF2DAC2R Mixer" }, 1692 - { "DAC2R", NULL, "AIF2DAC2R Mixer" }, 1693 1543 { "AIF2DAC2R Mixer", "AIF2 Switch", "AIF2DACR" }, 1694 1544 { "AIF2DAC2R Mixer", "AIF1.2 Switch", "AIF1DAC2R" }, 1695 1545 { "AIF2DAC2R Mixer", "AIF1.1 Switch", "AIF1DAC1R" }, ··· 1730 1582 1731 1583 { "Left Headphone Mux", "DAC", "DAC1L" }, 1732 1584 { "Right Headphone Mux", "DAC", "DAC1R" }, 1585 + }; 1586 + 1587 + static const struct snd_soc_dapm_route wm8994_lateclk_revd_intercon[] = { 1588 + { "DAC1L", NULL, "Late DAC1L Enable PGA" }, 1589 + { "Late DAC1L Enable PGA", NULL, "DAC1L Mixer" }, 1590 + { "DAC1R", NULL, "Late DAC1R Enable PGA" }, 1591 + { "Late DAC1R Enable PGA", NULL, "DAC1R Mixer" }, 1592 + { "DAC2L", NULL, "Late DAC2L Enable PGA" }, 1593 + { "Late DAC2L Enable PGA", NULL, "AIF2DAC2L Mixer" }, 1594 + { "DAC2R", NULL, "Late DAC2R Enable PGA" }, 1595 + { "Late DAC2R Enable PGA", NULL, "AIF2DAC2R Mixer" } 1596 + }; 1597 + 1598 + static const struct snd_soc_dapm_route wm8994_lateclk_intercon[] = { 1599 + { "DAC1L", NULL, "DAC1L Mixer" }, 1600 + { "DAC1R", NULL, "DAC1R Mixer" }, 1601 + { "DAC2L", NULL, "AIF2DAC2L Mixer" }, 1602 + { "DAC2R", NULL, "AIF2DAC2R Mixer" }, 1733 1603 }; 1734 1604 1735 1605 static const struct snd_soc_dapm_route wm8994_revd_intercon[] = { ··· 2680 2514 { 2681 2515 struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 2682 2516 int i, ret; 2517 + unsigned int val, mask; 2518 + 2519 + if (wm8994->revision < 4) { 2520 + /* force a HW read */ 2521 + val = wm8994_reg_read(codec->control_data, 2522 + WM8994_POWER_MANAGEMENT_5); 2523 + 2524 + /* modify the cache only */ 2525 + codec->cache_only = 1; 2526 + mask = WM8994_DAC1R_ENA | WM8994_DAC1L_ENA | 2527 + WM8994_DAC2R_ENA | WM8994_DAC2L_ENA; 2528 + val &= mask; 2529 + snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 2530 + mask, val); 2531 + codec->cache_only = 0; 2532 + } 2683 2533 2684 2534 /* Restore the registers */ 2685 2535 ret = snd_soc_cache_sync(codec); ··· 3029 2847 report |= SND_JACK_BTN_5; 3030 2848 3031 2849 done: 3032 - snd_soc_jack_report(wm8994->micdet[0].jack, 2850 + snd_soc_jack_report(wm8994->micdet[0].jack, report, 3033 2851 SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | 3034 2852 SND_JACK_BTN_3 | SND_JACK_BTN_4 | SND_JACK_BTN_5 | 3035 - SND_JACK_MICROPHONE | SND_JACK_VIDEOOUT, 3036 - report); 2853 + SND_JACK_MICROPHONE | SND_JACK_VIDEOOUT); 3037 2854 } 3038 2855 3039 2856 /** ··· 3306 3125 case WM8994: 3307 3126 snd_soc_dapm_new_controls(dapm, wm8994_specific_dapm_widgets, 3308 3127 ARRAY_SIZE(wm8994_specific_dapm_widgets)); 3128 + if (wm8994->revision < 4) { 3129 + snd_soc_dapm_new_controls(dapm, wm8994_lateclk_revd_widgets, 3130 + ARRAY_SIZE(wm8994_lateclk_revd_widgets)); 3131 + snd_soc_dapm_new_controls(dapm, wm8994_adc_revd_widgets, 3132 + ARRAY_SIZE(wm8994_adc_revd_widgets)); 3133 + snd_soc_dapm_new_controls(dapm, wm8994_dac_revd_widgets, 3134 + ARRAY_SIZE(wm8994_dac_revd_widgets)); 3135 + } else { 3136 + snd_soc_dapm_new_controls(dapm, wm8994_lateclk_widgets, 3137 + ARRAY_SIZE(wm8994_lateclk_widgets)); 3138 + snd_soc_dapm_new_controls(dapm, wm8994_adc_widgets, 3139 + ARRAY_SIZE(wm8994_adc_widgets)); 3140 + snd_soc_dapm_new_controls(dapm, wm8994_dac_widgets, 3141 + ARRAY_SIZE(wm8994_dac_widgets)); 3142 + } 3309 3143 break; 3310 3144 case WM8958: 3311 3145 snd_soc_add_controls(codec, wm8958_snd_controls, ··· 3339 3143 snd_soc_dapm_add_routes(dapm, wm8994_intercon, 3340 3144 ARRAY_SIZE(wm8994_intercon)); 3341 3145 3342 - if (wm8994->revision < 4) 3146 + if (wm8994->revision < 4) { 3343 3147 snd_soc_dapm_add_routes(dapm, wm8994_revd_intercon, 3344 3148 ARRAY_SIZE(wm8994_revd_intercon)); 3345 - 3149 + snd_soc_dapm_add_routes(dapm, wm8994_lateclk_revd_intercon, 3150 + ARRAY_SIZE(wm8994_lateclk_revd_intercon)); 3151 + } else { 3152 + snd_soc_dapm_add_routes(dapm, wm8994_lateclk_intercon, 3153 + ARRAY_SIZE(wm8994_lateclk_intercon)); 3154 + } 3346 3155 break; 3347 3156 case WM8958: 3348 3157 snd_soc_dapm_add_routes(dapm, wm8958_intercon,
+5
sound/soc/codecs/wm9081.c
··· 15 15 #include <linux/moduleparam.h> 16 16 #include <linux/init.h> 17 17 #include <linux/delay.h> 18 + #include <linux/device.h> 18 19 #include <linux/pm.h> 19 20 #include <linux/i2c.h> 20 21 #include <linux/platform_device.h> ··· 1341 1340 i2c_set_clientdata(i2c, wm9081); 1342 1341 wm9081->control_type = SND_SOC_I2C; 1343 1342 wm9081->control_data = i2c; 1343 + 1344 + if (dev_get_platdata(&i2c->dev)) 1345 + memcpy(&wm9081->retune, dev_get_platdata(&i2c->dev), 1346 + sizeof(wm9081->retune)); 1344 1347 1345 1348 ret = snd_soc_register_codec(&i2c->dev, 1346 1349 &soc_codec_dev_wm9081, &wm9081_dai, 1);
+3
sound/soc/codecs/wm_hubs.c
··· 674 674 }; 675 675 676 676 static const struct snd_soc_dapm_route analogue_routes[] = { 677 + { "MICBIAS1", NULL, "CLK_SYS" }, 678 + { "MICBIAS2", NULL, "CLK_SYS" }, 679 + 677 680 { "IN1L PGA", "IN1LP Switch", "IN1LP" }, 678 681 { "IN1L PGA", "IN1LN Switch", "IN1LN" }, 679 682
+1 -1
sound/soc/imx/eukrea-tlv320.c
··· 79 79 .name = "tlv320aic23", 80 80 .stream_name = "TLV320AIC23", 81 81 .codec_dai_name = "tlv320aic23-hifi", 82 - .platform_name = "imx-pcm-audio.0", 82 + .platform_name = "imx-fiq-pcm-audio.0", 83 83 .codec_name = "tlv320aic23-codec.0-001a", 84 84 .cpu_dai_name = "imx-ssi.0", 85 85 .ops = &eukrea_tlv320_snd_ops,
+2 -2
sound/soc/pxa/e740_wm9705.c
··· 117 117 { 118 118 .name = "AC97", 119 119 .stream_name = "AC97 HiFi", 120 - .cpu_dai_name = "pxa-ac97.0", 120 + .cpu_dai_name = "pxa2xx-ac97", 121 121 .codec_dai_name = "wm9705-hifi", 122 122 .platform_name = "pxa-pcm-audio", 123 123 .codec_name = "wm9705-codec", ··· 126 126 { 127 127 .name = "AC97 Aux", 128 128 .stream_name = "AC97 Aux", 129 - .cpu_dai_name = "pxa-ac97.1", 129 + .cpu_dai_name = "pxa2xx-ac97-aux", 130 130 .codec_dai_name = "wm9705-aux", 131 131 .platform_name = "pxa-pcm-audio", 132 132 .codec_name = "wm9705-codec",
+2 -2
sound/soc/pxa/e750_wm9705.c
··· 99 99 { 100 100 .name = "AC97", 101 101 .stream_name = "AC97 HiFi", 102 - .cpu_dai_name = "pxa-ac97.0", 102 + .cpu_dai_name = "pxa2xx-ac97", 103 103 .codec_dai_name = "wm9705-hifi", 104 104 .platform_name = "pxa-pcm-audio", 105 105 .codec_name = "wm9705-codec", ··· 109 109 { 110 110 .name = "AC97 Aux", 111 111 .stream_name = "AC97 Aux", 112 - .cpu_dai_name = "pxa-ac97.1", 112 + .cpu_dai_name = "pxa2xx-ac97-aux", 113 113 .codec_dai_name ="wm9705-aux", 114 114 .platform_name = "pxa-pcm-audio", 115 115 .codec_name = "wm9705-codec",
+2 -2
sound/soc/pxa/e800_wm9712.c
··· 89 89 { 90 90 .name = "AC97", 91 91 .stream_name = "AC97 HiFi", 92 - .cpu_dai_name = "pxa-ac97.0", 92 + .cpu_dai_name = "pxa2xx-ac97", 93 93 .codec_dai_name = "wm9712-hifi", 94 94 .platform_name = "pxa-pcm-audio", 95 95 .codec_name = "wm9712-codec", ··· 98 98 { 99 99 .name = "AC97 Aux", 100 100 .stream_name = "AC97 Aux", 101 - .cpu_dai_name = "pxa-ac97.1", 101 + .cpu_dai_name = "pxa2xx-ac97-aux", 102 102 .codec_dai_name ="wm9712-aux", 103 103 .platform_name = "pxa-pcm-audio", 104 104 .codec_name = "wm9712-codec",
+2 -2
sound/soc/pxa/em-x270.c
··· 37 37 { 38 38 .name = "AC97", 39 39 .stream_name = "AC97 HiFi", 40 - .cpu_dai_name = "pxa-ac97.0", 40 + .cpu_dai_name = "pxa2xx-ac97", 41 41 .codec_dai_name = "wm9712-hifi", 42 42 .platform_name = "pxa-pcm-audio", 43 43 .codec_name = "wm9712-codec", ··· 45 45 { 46 46 .name = "AC97 Aux", 47 47 .stream_name = "AC97 Aux", 48 - .cpu_dai_name = "pxa-ac97.1", 48 + .cpu_dai_name = "pxa2xx-ac97-aux", 49 49 .codec_dai_name ="wm9712-aux", 50 50 .platform_name = "pxa-pcm-audio", 51 51 .codec_name = "wm9712-codec",
+2 -2
sound/soc/pxa/mioa701_wm9713.c
··· 162 162 { 163 163 .name = "AC97", 164 164 .stream_name = "AC97 HiFi", 165 - .cpu_dai_name = "pxa-ac97.0", 165 + .cpu_dai_name = "pxa2xx-ac97", 166 166 .codec_dai_name = "wm9713-hifi", 167 167 .codec_name = "wm9713-codec", 168 168 .init = mioa701_wm9713_init, ··· 172 172 { 173 173 .name = "AC97 Aux", 174 174 .stream_name = "AC97 Aux", 175 - .cpu_dai_name = "pxa-ac97.1", 175 + .cpu_dai_name = "pxa2xx-ac97-aux", 176 176 .codec_dai_name ="wm9713-aux", 177 177 .codec_name = "wm9713-codec", 178 178 .platform_name = "pxa-pcm-audio",
+2 -2
sound/soc/pxa/palm27x.c
··· 132 132 { 133 133 .name = "AC97 HiFi", 134 134 .stream_name = "AC97 HiFi", 135 - .cpu_dai_name = "pxa-ac97.0", 135 + .cpu_dai_name = "pxa2xx-ac97", 136 136 .codec_dai_name = "wm9712-hifi", 137 137 .codec_name = "wm9712-codec", 138 138 .platform_name = "pxa-pcm-audio", ··· 141 141 { 142 142 .name = "AC97 Aux", 143 143 .stream_name = "AC97 Aux", 144 - .cpu_dai_name = "pxa-ac97.1", 144 + .cpu_dai_name = "pxa2xx-ac97-aux", 145 145 .codec_dai_name = "wm9712-aux", 146 146 .codec_name = "wm9712-codec", 147 147 .platform_name = "pxa-pcm-audio",
+2 -2
sound/soc/pxa/tosa.c
··· 219 219 { 220 220 .name = "AC97", 221 221 .stream_name = "AC97 HiFi", 222 - .cpu_dai_name = "pxa-ac97.0", 222 + .cpu_dai_name = "pxa2xx-ac97", 223 223 .codec_dai_name = "wm9712-hifi", 224 224 .platform_name = "pxa-pcm-audio", 225 225 .codec_name = "wm9712-codec", ··· 229 229 { 230 230 .name = "AC97 Aux", 231 231 .stream_name = "AC97 Aux", 232 - .cpu_dai_name = "pxa-ac97.1", 232 + .cpu_dai_name = "pxa2xx-ac97-aux", 233 233 .codec_dai_name = "wm9712-aux", 234 234 .platform_name = "pxa-pcm-audio", 235 235 .codec_name = "wm9712-codec",
+2 -2
sound/soc/pxa/zylonite.c
··· 166 166 .stream_name = "AC97 HiFi", 167 167 .codec_name = "wm9713-codec", 168 168 .platform_name = "pxa-pcm-audio", 169 - .cpu_dai_name = "pxa-ac97.0", 169 + .cpu_dai_name = "pxa2xx-ac97", 170 170 .codec_name = "wm9713-hifi", 171 171 .init = zylonite_wm9713_init, 172 172 }, ··· 175 175 .stream_name = "AC97 Aux", 176 176 .codec_name = "wm9713-codec", 177 177 .platform_name = "pxa-pcm-audio", 178 - .cpu_dai_name = "pxa-ac97.1", 178 + .cpu_dai_name = "pxa2xx-ac97-aux", 179 179 .codec_name = "wm9713-aux", 180 180 }, 181 181 {
+22 -1
sound/soc/soc-dapm.c
··· 712 712 !path->connected(path->source, path->sink)) 713 713 continue; 714 714 715 - if (path->sink && path->sink->power_check && 715 + if (!path->sink) 716 + continue; 717 + 718 + if (path->sink->force) { 719 + power = 1; 720 + break; 721 + } 722 + 723 + if (path->sink->power_check && 716 724 path->sink->power_check(path->sink)) { 717 725 power = 1; 718 726 break; ··· 1635 1627 int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) 1636 1628 { 1637 1629 struct snd_soc_dapm_widget *w; 1630 + unsigned int val; 1638 1631 1639 1632 list_for_each_entry(w, &dapm->card->widgets, list) 1640 1633 { ··· 1684 1675 case snd_soc_dapm_post: 1685 1676 break; 1686 1677 } 1678 + 1679 + /* Read the initial power state from the device */ 1680 + if (w->reg >= 0) { 1681 + val = snd_soc_read(w->codec, w->reg); 1682 + val &= 1 << w->shift; 1683 + if (w->invert) 1684 + val = !val; 1685 + 1686 + if (val) 1687 + w->power = 1; 1688 + } 1689 + 1687 1690 w->new = 1; 1688 1691 } 1689 1692
+4
sound/usb/card.c
··· 323 323 return -ENOMEM; 324 324 } 325 325 326 + mutex_init(&chip->shutdown_mutex); 326 327 chip->index = idx; 327 328 chip->dev = dev; 328 329 chip->card = card; ··· 532 531 chip = ptr; 533 532 card = chip->card; 534 533 mutex_lock(&register_mutex); 534 + mutex_lock(&chip->shutdown_mutex); 535 535 chip->shutdown = 1; 536 536 chip->num_interfaces--; 537 537 if (chip->num_interfaces <= 0) { ··· 550 548 snd_usb_mixer_disconnect(p); 551 549 } 552 550 usb_chip[chip->index] = NULL; 551 + mutex_unlock(&chip->shutdown_mutex); 553 552 mutex_unlock(&register_mutex); 554 553 snd_card_free_when_closed(card); 555 554 } else { 555 + mutex_unlock(&chip->shutdown_mutex); 556 556 mutex_unlock(&register_mutex); 557 557 } 558 558 }
+5 -2
sound/usb/pcm.c
··· 361 361 } 362 362 363 363 if (changed) { 364 + mutex_lock(&subs->stream->chip->shutdown_mutex); 364 365 /* format changed */ 365 366 snd_usb_release_substream_urbs(subs, 0); 366 367 /* influenced: period_bytes, channels, rate, format, */ ··· 369 368 params_rate(hw_params), 370 369 snd_pcm_format_physical_width(params_format(hw_params)) * 371 370 params_channels(hw_params)); 371 + mutex_unlock(&subs->stream->chip->shutdown_mutex); 372 372 } 373 373 374 374 return ret; ··· 387 385 subs->cur_audiofmt = NULL; 388 386 subs->cur_rate = 0; 389 387 subs->period_bytes = 0; 390 - if (!subs->stream->chip->shutdown) 391 - snd_usb_release_substream_urbs(subs, 0); 388 + mutex_lock(&subs->stream->chip->shutdown_mutex); 389 + snd_usb_release_substream_urbs(subs, 0); 390 + mutex_unlock(&subs->stream->chip->shutdown_mutex); 392 391 return snd_pcm_lib_free_vmalloc_buffer(substream); 393 392 } 394 393
+1
sound/usb/usbaudio.h
··· 36 36 struct snd_card *card; 37 37 u32 usb_id; 38 38 int shutdown; 39 + struct mutex shutdown_mutex; 39 40 unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ 40 41 int num_interfaces; 41 42 int num_suspended_intf;
+3 -3
tools/perf/builtin-timechart.c
··· 264 264 c->start_time = start; 265 265 if (p->start_time == 0 || p->start_time > start) 266 266 p->start_time = start; 267 - 268 - if (cpu > numcpus) 269 - numcpus = cpu; 270 267 } 271 268 272 269 #define MAX_CPUS 4096 ··· 507 510 508 511 if (!event_str) 509 512 return 0; 513 + 514 + if (sample->cpu > numcpus) 515 + numcpus = sample->cpu; 510 516 511 517 if (strcmp(event_str, "power:cpu_idle") == 0) { 512 518 struct power_processor_entry *ppe = (void *)te;
+5 -2
tools/perf/util/hist.c
··· 585 585 { 586 586 struct sort_entry *se; 587 587 u64 period, total, period_sys, period_us, period_guest_sys, period_guest_us; 588 + u64 nr_events; 588 589 const char *sep = symbol_conf.field_sep; 589 590 int ret; 590 591 ··· 594 593 595 594 if (pair_hists) { 596 595 period = self->pair ? self->pair->period : 0; 596 + nr_events = self->pair ? self->pair->nr_events : 0; 597 597 total = pair_hists->stats.total_period; 598 598 period_sys = self->pair ? self->pair->period_sys : 0; 599 599 period_us = self->pair ? self->pair->period_us : 0; ··· 602 600 period_guest_us = self->pair ? self->pair->period_guest_us : 0; 603 601 } else { 604 602 period = self->period; 603 + nr_events = self->nr_events; 605 604 total = session_total; 606 605 period_sys = self->period_sys; 607 606 period_us = self->period_us; ··· 643 640 644 641 if (symbol_conf.show_nr_samples) { 645 642 if (sep) 646 - ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period); 643 + ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, nr_events); 647 644 else 648 - ret += snprintf(s + ret, size - ret, "%11" PRIu64, period); 645 + ret += snprintf(s + ret, size - ret, "%11" PRIu64, nr_events); 649 646 } 650 647 651 648 if (pair_hists) {
+3 -3
tools/perf/util/svghelper.c
··· 456 456 return; 457 457 458 458 svg_legenda_box(0, "Running", "sample"); 459 - svg_legenda_box(100, "Idle","rect.c1"); 460 - svg_legenda_box(200, "Deeper Idle", "rect.c3"); 461 - svg_legenda_box(350, "Deepest Idle", "rect.c6"); 459 + svg_legenda_box(100, "Idle","c1"); 460 + svg_legenda_box(200, "Deeper Idle", "c3"); 461 + svg_legenda_box(350, "Deepest Idle", "c6"); 462 462 svg_legenda_box(550, "Sleeping", "process2"); 463 463 svg_legenda_box(650, "Waiting for cpu", "waiting"); 464 464 svg_legenda_box(800, "Blocked on IO", "blocked");