History

Merge commit 'v2.6.36-rc7' into perf/core

Conflicts: arch/x86/kernel/module.c Merge reason: Resolve the conflict, pick up fixes.

Ingo Molnar committed 16 years ago

Commit 7cd25412 parents c62f981 cb655d0359 files · +2601 −1390Browse files

Unified · Split

359 files
  1. CREDITS +4 −4
  2. MAINTAINERS +27 −11
  3. Makefile +1 −1
  4. arch/alpha/kernel/entry.S +7 −13
  5. arch/alpha/kernel/process.c +1 −1
  6. arch/alpha/kernel/signal.c +15 −41
  7. arch/alpha/kernel/systbls.S +1 −1
  8. arch/arm/Kconfig +26 −1
  9. arch/arm/boot/compressed/Makefile +1 −1
  10. arch/arm/common/it8152.c +8 −0
  11. arch/arm/include/asm/pgtable.h +4 −0
  12. arch/arm/kernel/entry-common.S +2 −0
  13. arch/arm/mach-at91/at91sam9g45_devices.c +2 −2
  14. arch/arm/mach-davinci/dm355.c +1 −2
  15. arch/arm/mach-davinci/dm365.c +1 −2
  16. arch/arm/mach-davinci/dm644x.c +1 −2
  17. arch/arm/mach-davinci/dm646x.c +1 −2
  18. arch/arm/mach-dove/include/mach/io.h +3 −3
  19. arch/arm/mach-ixp4xx/common-pci.c +8 −0
  20. arch/arm/mach-ixp4xx/include/mach/hardware.h +2 −0
  21. arch/arm/mach-kirkwood/include/mach/kirkwood.h +1 −1
  22. arch/arm/mach-kirkwood/pcie.c +2 −2
  23. arch/arm/mach-mmp/include/mach/system.h +6 −1
  24. arch/arm/mach-pxa/cpufreq-pxa2xx.c +1 −2
  25. arch/arm/mach-pxa/include/mach/hardware.h +13 −1
  26. arch/arm/mach-pxa/include/mach/io.h +2 −0
  27. arch/arm/mach-pxa/palm27x.c +5 −1
  28. arch/arm/mach-pxa/vpac270.c +1 −0
  29. arch/arm/mach-u300/include/mach/gpio.h +3 −0
  30. arch/arm/mach-vexpress/ct-ca9x4.c +7 −1
  31. arch/arm/mm/alignment.c +17 −2
  32. arch/arm/mm/mmu.c +29 −2
  33. arch/arm/mm/proc-v7.S +56 −6
  34. arch/arm/plat-nomadik/timer.c +12 −21
  35. arch/arm/plat-omap/Kconfig +1 −1
  36. arch/arm/plat-omap/mcbsp.c +1 −1
  37. arch/arm/plat-omap/sram.c +5 −20
  38. arch/avr32/kernel/module.c +1 −2
  39. arch/h8300/kernel/module.c +1 −2
  40. arch/m32r/include/asm/signal.h +0 −1
  41. arch/m32r/include/asm/unistd.h +1 −0
  42. arch/m32r/kernel/entry.S +2 −3
  43. arch/m32r/kernel/ptrace.c +4 −3
  44. arch/m32r/kernel/signal.c +41 −64
  45. arch/m68k/mac/macboing.c +3 −3
  46. arch/mips/Kconfig +19 −2
  47. arch/mips/alchemy/common/prom.c +2 −3
  48. arch/mips/boot/compressed/Makefile +1 −1
  49. arch/mips/cavium-octeon/Kconfig +4 −0
  50. arch/mips/cavium-octeon/cpu.c +1 −1
  51. arch/mips/cavium-octeon/executive/Makefile +1 −1
  52. arch/mips/include/asm/atomic.h +4 −0
  53. arch/mips/include/asm/cop2.h +1 −1
  54. arch/mips/include/asm/gic.h +1 −0
  55. arch/mips/include/asm/mach-tx49xx/kmalloc.h +1 −1
  56. arch/mips/include/asm/mips-boards/maltaint.h +0 −3
  57. arch/mips/include/asm/page.h +14 −0
  58. arch/mips/include/asm/thread_info.h +2 −1
  59. arch/mips/include/asm/unistd.h +15 −6
  60. arch/mips/kernel/irq-gic.c +2 −3
  61. arch/mips/kernel/kgdb.c +1 −1
  62. arch/mips/kernel/kspd.c +1 −1
  63. arch/mips/kernel/linux32.c +7 −0
  64. arch/mips/kernel/scall32-o32.S +4 −1
  65. arch/mips/kernel/scall64-64.S +5 −2
  66. arch/mips/kernel/scall64-n32.S +4 −1
  67. arch/mips/kernel/scall64-o32.S +4 −1
  68. arch/mips/mm/dma-default.c +20 −8
  69. arch/mips/mm/sc-rm7k.c +1 −1
  70. arch/mips/mti-malta/malta-int.c +3 −0
  71. arch/mips/pci/pci-rc32434.c +1 −1
  72. arch/mips/pnx8550/common/reset.c +5 −15
  73. arch/mips/pnx8550/common/setup.c +1 −2
  74. arch/mn10300/Kconfig +0 −1
  75. arch/mn10300/Kconfig.debug +1 −1
  76. arch/mn10300/include/asm/bitops.h +2 −2
  77. arch/mn10300/include/asm/signal.h +1 −1
  78. arch/mn10300/kernel/module.c +1 −2
  79. arch/mn10300/kernel/signal.c +20 −15
  80. arch/mn10300/mm/Makefile +6 −8
  81. arch/mn10300/mm/cache-disabled.c +21 −0
  82. arch/mn10300/mm/cache.c +19 −1
  83. arch/parisc/kernel/module.c +1 −2
  84. arch/powerpc/kernel/module.c +0 −6
  85. arch/powerpc/platforms/512x/clock.c +1 −1
  86. arch/powerpc/platforms/52xx/efika.c +6 −3
  87. arch/powerpc/platforms/52xx/mpc52xx_common.c +6 −2
  88. arch/s390/kernel/module.c +1 −2
  89. arch/sh/kernel/module.c +0 −2
  90. arch/tile/kernel/intvec_32.S +0 −7
  91. arch/um/drivers/net_kern.c +3 −14
  92. arch/um/kernel/exec.c +3 −3
  93. arch/um/kernel/internal.h +1 −1
  94. arch/um/kernel/syscall.c +2 −2
  95. arch/x86/boot/early_serial_console.c +13 −1
  96. arch/x86/include/asm/amd_iommu_proto.h +6 −0
  97. arch/x86/include/asm/amd_iommu_types.h +12 −0
  98. arch/x86/include/asm/bitops.h +1 −1
  99. arch/x86/include/asm/cpufeature.h +1 −0
  100. arch/x86/kernel/acpi/cstate.c +1 −1
  101. arch/x86/kernel/amd_iommu.c +3 −1
  102. arch/x86/kernel/amd_iommu_init.c +45 −22
  103. arch/x86/kernel/apic/io_apic.c +8 −3
  104. arch/x86/kernel/cpu/common.c +1 −1
  105. arch/x86/kernel/cpu/cpu.h +1 −0
  106. arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +12 −6
  107. arch/x86/kernel/cpu/intel.c +1 −0
  108. arch/x86/kernel/cpu/scattered.c +1 −0
  109. arch/x86/kernel/hpet.c +1 −1
  110. arch/x86/kernel/module.c +1 −2
  111. arch/x86/xen/time.c +3 −2
  112. block/blk-merge.c +12 −0
  113. drivers/acpi/Kconfig +1 −1
  114. drivers/acpi/acpi_pad.c +18 −16
  115. drivers/acpi/acpica/aclocal.h +1 −0
  116. drivers/acpi/acpica/exutils.c +1 −1
  117. drivers/acpi/acpica/rsutils.c +1 −1
  118. drivers/acpi/apei/Kconfig +1 −1
  119. drivers/acpi/apei/apei-base.c +16 −5
  120. drivers/acpi/apei/einj.c +3 −1
  121. drivers/acpi/apei/erst-dbg.c +11 −7
  122. drivers/acpi/apei/erst.c +24 −5
  123. drivers/acpi/apei/ghes.c +1 −1
  124. drivers/acpi/apei/hest.c +7 −4
  125. drivers/acpi/atomicio.c +1 −1
  126. drivers/acpi/battery.c +0 −1
  127. drivers/acpi/blacklist.c +18 −0
  128. drivers/acpi/bus.c +5 −13
  129. drivers/acpi/fan.c +2 −0
  130. drivers/acpi/processor_core.c +0 −6
  131. drivers/acpi/processor_driver.c +1 −1
  132. drivers/acpi/processor_perflib.c +2 −2
  133. drivers/acpi/sleep.c +22 −0
  134. drivers/acpi/sysfs.c +14 −6
  135. drivers/acpi/video_detect.c +2 −2
  136. drivers/ata/ahci.c +4 −0
  137. drivers/ata/ahci.h +11 −1
  138. drivers/ata/ahci_platform.c +5 −1
  139. drivers/ata/libahci.c +4 −12
  140. drivers/block/pktcdvd.c +1 −1
  141. drivers/char/ipmi/ipmi_si_intf.c +11 −6
  142. drivers/cpuidle/governors/menu.c +1 −1
  143. drivers/dma/mv_xor.c +1 −1
  144. drivers/dma/shdma.c +2 −1
  145. drivers/edac/edac_mc.c +3 −0
  146. drivers/edac/i7core_edac.c +1 −0
  147. drivers/gpu/drm/drm_buffer.c +3 −3
  148. drivers/gpu/drm/drm_gem.c +10 −29
  149. drivers/gpu/drm/drm_info.c +1 −1
  150. drivers/gpu/drm/drm_vm.c +18 −10
  151. drivers/gpu/drm/i810/i810_dma.c +1 −1
  152. drivers/gpu/drm/i830/i830_dma.c +1 −1
  153. drivers/gpu/drm/i915/i915_dma.c +3 −3
  154. drivers/gpu/drm/i915/i915_gem.c +29 −25
  155. drivers/gpu/drm/i915/i915_gem_evict.c +20 −25
  156. drivers/gpu/drm/i915/intel_display.c +38 −24
  157. drivers/gpu/drm/i915/intel_dp.c +9 −10
  158. drivers/gpu/drm/i915/intel_drv.h +0 −1
  159. drivers/gpu/drm/i915/intel_fb.c +3 −1
  160. drivers/gpu/drm/i915/intel_sdvo.c +6 −9
  161. drivers/gpu/drm/nouveau/nouveau_connector.c +4 −2
  162. drivers/gpu/drm/nouveau/nouveau_fbcon.c +1 −0
  163. drivers/gpu/drm/nouveau/nouveau_gem.c +2 −4
  164. drivers/gpu/drm/nouveau/nouveau_notifier.c +1 −0
  165. drivers/gpu/drm/radeon/atombios.h +1 −1
  166. drivers/gpu/drm/radeon/r600.c +3 −2
  167. drivers/gpu/drm/radeon/radeon_atombios.c +9 −0
  168. drivers/gpu/drm/radeon/radeon_display.c +4 −1
  169. drivers/gpu/drm/radeon/radeon_fb.c +4 −10
  170. drivers/gpu/drm/radeon/radeon_gem.c +2 −2
  171. drivers/gpu/drm/radeon/radeon_kms.c +4 −0
  172. drivers/gpu/drm/ttm/ttm_bo_util.c +1 −0
  173. drivers/gpu/drm/ttm/ttm_page_alloc.c +4 −4
  174. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +110 −35
  175. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +8 −0
  176. drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +5 −0
  177. drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +3 −0
  178. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +17 −0
  179. drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +17 −10
  180. drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +4 −0
  181. drivers/gpu/vga/vgaarb.c +1 −1
  182. drivers/hwmon/Kconfig +1 −1
  183. drivers/hwmon/coretemp.c +33 −24
  184. drivers/hwmon/f71882fg.c +19 −13
  185. drivers/hwmon/lis3lv02d.c +2 −2
  186. drivers/hwmon/pkgtemp.c +11 −12
  187. drivers/i2c/busses/i2c-davinci.c +3 −3
  188. drivers/i2c/busses/i2c-octeon.c +1 −1
  189. drivers/i2c/busses/i2c-s3c2410.c +2 −2
  190. drivers/idle/intel_idle.c +15 −5
  191. drivers/infiniband/hw/cxgb3/iwch_cm.c +4 −2
  192. drivers/leds/leds-ns2.c +5 −4
  193. drivers/mfd/max8925-core.c +7 −6
  194. drivers/mfd/wm831x-irq.c +7 −2
  195. drivers/misc/Kconfig +1 −1
  196. drivers/misc/Makefile +1 −1
  197. drivers/misc/vmw_balloon.c +0 −0
  198. drivers/mmc/host/sdhci-s3c.c +8 −4
  199. drivers/mtd/nand/omap2.c +1 −1
  200. drivers/net/3c59x.c +10 −0
  201. drivers/net/atlx/atl1.c +9 −2
  202. drivers/net/e1000e/hw.h +1 −0
  203. drivers/net/e1000e/ich8lan.c +164 −33
  204. drivers/net/e1000e/netdev.c +19 −10
  205. drivers/net/ibm_newemac/core.c +2 −2
  206. drivers/net/netxen/netxen_nic_init.c +0 −3
  207. drivers/net/qlcnic/qlcnic_init.c +1 −6
  208. drivers/net/rionet.c +1 −1
  209. drivers/net/sgiseeq.c +1 −1
  210. drivers/net/smsc911x.c +1 −0
  211. drivers/net/tulip/de2104x.c +38 −5
  212. drivers/net/wireless/iwlwifi/iwl-agn-lib.c +1 −1
  213. drivers/net/wireless/iwlwifi/iwl-core.c +5 −0
  214. drivers/net/wireless/iwlwifi/iwl3945-base.c +1 −1
  215. drivers/pci/intel-iommu.c +70 −47
  216. drivers/pci/iov.c +1 −1
  217. drivers/pci/pci.h +3 −2
  218. drivers/pci/quirks.c +20 −0
  219. drivers/pcmcia/pcmcia_resource.c +6 −0
  220. drivers/pcmcia/pd6729.c +1 −1
  221. drivers/platform/x86/thinkpad_acpi.c +3 −2
  222. drivers/regulator/core.c +4 −2
  223. drivers/regulator/max8649.c +1 −1
  224. drivers/rtc/rtc-ab3100.c +2 −0
  225. drivers/rtc/rtc-s3c.c +8 −5
  226. drivers/s390/net/ctcm_main.c +2 −2
  227. drivers/serial/mfd.c +1 −0
  228. drivers/serial/mrst_max3110.c +1 −0
  229. drivers/spi/spi.c +5 −0
  230. drivers/spi/spi_gpio.c +1 −1
  231. drivers/spi/spi_mpc8xxx.c +8 −2
  232. drivers/staging/ti-st/st.h +0 −1
  233. drivers/staging/ti-st/st_core.c +4 −5
  234. drivers/staging/ti-st/st_core.h +1 −1
  235. drivers/staging/ti-st/st_kim.c +19 −3
  236. drivers/usb/core/Kconfig +3 −3
  237. drivers/usb/core/file.c +16 −19
  238. drivers/usb/core/message.c +1 −0
  239. drivers/usb/musb/cppi_dma.c +1 −0
  240. drivers/usb/musb/musb_gadget.c +39 −36
  241. drivers/usb/musb/musb_gadget.h +2 −0
  242. drivers/usb/musb/musb_gadget_ep0.c +9 −0
  243. drivers/usb/musb/musb_host.c +6 −0
  244. drivers/vhost/net.c +1 −1
  245. drivers/vhost/vhost.c +4 −3
  246. drivers/video/console/fbcon.c +3 −2
  247. drivers/video/efifb.c +91 −12
  248. drivers/video/pxa168fb.c +2 −2
  249. drivers/video/sis/sis_main.c +3 −0
  250. drivers/xen/xenbus/xenbus_probe.c +6 −3
  251. fs/aio.c +9 −1
  252. fs/cifs/cifssmb.c +33 −16
  253. fs/cifs/inode.c +2 −0
  254. fs/compat.c +1 −1
  255. fs/fs-writeback.c +4 −15
  256. fs/fuse/dev.c +1 −1
  257. fs/ocfs2/acl.c +3 −0
  258. fs/ocfs2/cluster/tcp.c +1 −1
  259. fs/ocfs2/dir.c +16 −8
  260. fs/ocfs2/dlm/dlmcommon.h +1 −0
  261. fs/ocfs2/dlm/dlmdebug.c +8 −1
  262. fs/ocfs2/dlm/dlmdomain.c +1 −0
  263. fs/ocfs2/dlm/dlmmaster.c +40 −0
  264. fs/ocfs2/dlmglue.h +1 −0
  265. fs/ocfs2/ocfs2_fs.h +25 −12
  266. fs/ocfs2/ocfs2_ioctl.h +4 −4
  267. fs/ocfs2/refcounttree.c +3 −2
  268. fs/ocfs2/reservations.c +10 −12
  269. fs/ocfs2/suballoc.c +2 −2
  270. fs/ocfs2/symlink.c +1 −1
  271. fs/ocfs2/xattr.c +2 −2
  272. fs/proc/base.c +2 −2
  273. fs/proc/task_mmu.c +2 −2
  274. fs/proc/vmcore.c +1 −1
  275. fs/reiserfs/ioctl.c +4 −3
  276. fs/xfs/xfs_log_cil.c +9 −3
  277. fs/xfs/xfs_log_priv.h +21 −16
  278. include/acpi/acpixf.h +1 −1
  279. include/drm/drmP.h +20 −9
  280. include/drm/drm_pciids.h +1 −1
  281. include/linux/cpuidle.h +1 −0
  282. include/linux/dma-mapping.h +4 −0
  283. include/linux/dmaengine.h +1 −1
  284. include/linux/module.h +2 −3
  285. include/linux/netlink.h +2 −2
  286. include/linux/pci_ids.h +3 −0
  287. include/linux/rcupdate.h +1 −1
  288. include/linux/socket.h +1 −1
  289. include/linux/wait.h +1 −0
  290. include/net/addrconf.h +1 −0
  291. include/net/dst.h +1 −0
  292. include/net/route.h +2 −0
  293. include/net/xfrm.h +2 −2
  294. ipc/sem.c +2 −0
  295. kernel/fork.c +1 −1
  296. kernel/kfifo.c +0 −2
  297. kernel/module.c +4 −0
  298. kernel/smp.c +14 −3
  299. lib/bug.c +2 −4
  300. lib/list_sort.c +1 −1
  301. mm/fremap.c +5 −2
  302. mm/hugetlb.c +13 −11
  303. mm/ksm.c +4 −2
  304. mm/mmap.c +1 −0
  305. mm/oom_kill.c +26 −23
  306. mm/percpu.c +1 −1
  307. mm/rmap.c +16 −7
  308. mm/vmscan.c +35 −8
  309. net/8021q/vlan_core.c +10 −4
  310. net/9p/trans_rdma.c +18 −11
  311. net/9p/trans_virtio.c +2 −1
  312. net/atm/br2684.c +2 −10
  313. net/core/iovec.c +3 −2
  314. net/core/sock.c +4 −4
  315. net/ipv4/Kconfig +1 −0
  316. net/ipv4/ip_gre.c +4 −4
  317. net/ipv4/ip_output.c +13 −6
  318. net/ipv4/netfilter/ipt_REJECT.c +1 −0
  319. net/ipv4/netfilter/nf_defrag_ipv4.c +3 −1
  320. net/ipv4/netfilter/nf_nat_snmp_basic.c +4 −2
  321. net/ipv4/route.c +1 −1
  322. net/ipv4/tcp.c +6 −3
  323. net/ipv4/tcp_input.c +4 −1
  324. net/ipv4/tcp_timer.c +14 −10
  325. net/ipv4/xfrm4_policy.c +1 −1
  326. net/ipv4/xfrm4_state.c +19 −14
  327. net/ipv6/addrconf.c +8 −3
  328. net/ipv6/addrlabel.c +5 −0
  329. net/ipv6/ip6_output.c +13 −5
  330. net/ipv6/route.c +1 −1
  331. net/ipv6/xfrm6_state.c +19 −14
  332. net/mac80211/rx.c +0 −4
  333. net/netfilter/nf_conntrack_extend.c +3 −1
  334. net/netfilter/nf_conntrack_sip.c +1 −1
  335. net/netfilter/nf_tproxy_core.c +5 −1
  336. net/phonet/pep.c +2 −1
  337. net/rds/tcp_connect.c +2 −2
  338. net/rds/tcp_listen.c +2 −2
  339. net/rds/tcp_recv.c +2 −2
  340. net/rds/tcp_send.c +2 −2
  341. net/rose/af_rose.c +2 −2
  342. net/sunrpc/xprtsock.c +14 −14
  343. net/wireless/wext-priv.c +1 −1
  344. net/xfrm/xfrm_policy.c +2 −3
  345. net/xfrm/xfrm_state.c +27 −18
  346. samples/kfifo/dma-example.c +9 −8
  347. security/tomoyo/common.c +5 −1
  348. security/tomoyo/common.h +0 −3
  349. sound/core/control.c +5 −0
  350. sound/i2c/other/ak4xxx-adda.c +1 −1
  351. sound/pci/hda/patch_analog.c +1 −0
  352. sound/pci/hda/patch_realtek.c +16 −6
  353. sound/pci/oxygen/oxygen.c +4 −0
  354. sound/pci/rme9652/hdsp.c +1 −0
  355. sound/pci/rme9652/hdspm.c +1 −0
  356. sound/soc/sh/migor.c +13 −2
  357. sound/soc/soc-cache.c +3 −2
  358. virt/kvm/eventfd.c +2 −1
  359. virt/kvm/kvm_main.c +3 −1
CREDITS+4−4
@@ -3554,12 +3554,12 @@ E: cvance@nai.com · 3553 unmodified lines
35543554 D: portions of the Linux Security Module (LSM) framework and security modules
35553555
35563556 N: Petr Vandrovec
3557−E: vandrove@vc.cvut.cz
3557+E: petr@vandrovec.name
35583558 D: Small contributions to ncpfs
35593559 D: Matrox framebuffer driver
3560−S: Chudenicka 8
3561−S: 10200 Prague 10, Hostivar
3562−S: Czech Republic
3560+S: 21513 Conradia Ct
3561+S: Cupertino, CA 95014
3562+S: USA
35633563
35643564 N: Thibaut Varene
35653565 E: T-Bone@parisc-linux.org
MAINTAINERS+27−11
@@ -962,6 +962,13 @@ W: http://www.fluff.org/ben/linux/ · 961 unmodified lines
962962 S: Maintained
963963 F: arch/arm/mach-s3c6410/
964964
965+ARM/S5P ARM ARCHITECTURES
966+M: Kukjin Kim <kgene.kim@samsung.com>
967+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
968+L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
969+S: Maintained
970+F: arch/arm/mach-s5p*/
971+
965972 ARM/SHMOBILE ARM ARCHITECTURE
966973 M: Paul Mundt <lethal@linux-sh.org>
967974 M: Magnus Damm <magnus.damm@gmail.com>
@@ -1220,7 +1227,7 @@ F: drivers/auxdisplay/ · 252 unmodified lines
12201227 F: include/linux/cfag12864b.h
12211228
12221229 AVR32 ARCHITECTURE
1223−M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1230+M: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
12241231 W: http://www.atmel.com/products/AVR32/
12251232 W: http://avr32linux.org/
12261233 W: http://avrfreaks.net/
@@ -1228,7 +1235,7 @@ S: Supported · 1 unmodified line
12281235 F: arch/avr32/
12291236
12301237 AVR32/AT32AP MACHINE SUPPORT
1231−M: Haavard Skinnemoen <hskinnemoen@atmel.com>
1238+M: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
12321239 S: Supported
12331240 F: arch/avr32/mach-at32ap/
12341241
@@ -2199,6 +2206,12 @@ W: http://acpi4asus.sf.net · 964 unmodified lines
21992206 S: Maintained
22002207 F: drivers/platform/x86/eeepc-laptop.c
22012208
2209+EFIFB FRAMEBUFFER DRIVER
2210+L: linux-fbdev@vger.kernel.org
2211+M: Peter Jones <pjones@redhat.com>
2212+S: Maintained
2213+F: drivers/video/efifb.c
2214+
22022215 EFS FILESYSTEM
22032216 W: http://aeschi.ch.eu.org/efs/
22042217 S: Orphan
@@ -2662,6 +2675,8 @@ M: Guenter Roeck <guenter.roeck@ericsson.com> · 457 unmodified lines
26622675 L: lm-sensors@lm-sensors.org
26632676 W: http://www.lm-sensors.org/
26642677 T: quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/
2678+T: quilt kernel.org/pub/linux/kernel/people/groeck/linux-staging/
2679+T: git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
26652680 S: Maintained
26662681 F: Documentation/hwmon/
26672682 F: drivers/hwmon/
@@ -3773,9 +3788,8 @@ W: http://www.syskonnect.com · 1105 unmodified lines
37733788 S: Supported
37743789
37753790 MATROX FRAMEBUFFER DRIVER
3776−M: Petr Vandrovec <vandrove@vc.cvut.cz>
37773791 L: linux-fbdev@vger.kernel.org
3778−S: Maintained
3792+S: Orphan
37793793 F: drivers/video/matrox/matroxfb_*
37803794 F: include/linux/matroxfb.h
37813795
@@ -3899,10 +3913,8 @@ F: Documentation/serial/moxa-smartio · 117 unmodified lines
38993913 F: drivers/char/mxser.*
39003914
39013915 MSI LAPTOP SUPPORT
3902−M: Lennart Poettering <mzxreary@0pointer.de>
3916+M: Lee, Chun-Yi <jlee@novell.com>
39033917 L: platform-driver-x86@vger.kernel.org
3904−W: https://tango.0pointer.de/mailman/listinfo/s270-linux
3905−W: http://0pointer.de/lennart/tchibo.html
39063918 S: Maintained
39073919 F: drivers/platform/x86/msi-laptop.c
39083920
@@ -3919,8 +3931,10 @@ S: Supported · 10 unmodified lines
39193931 F: drivers/mfd/
39203932
39213933 MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
3922−S: Orphan
3934+M: Chris Ball <cjb@laptop.org>
39233935 L: linux-mmc@vger.kernel.org
3936+T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
3937+S: Maintained
39243938 F: drivers/mmc/
39253939 F: include/linux/mmc/
39263940
@@ -3962,8 +3976,8 @@ S: Maintained · 35 unmodified lines
39623976 F: drivers/net/natsemi.c
39633977
39643978 NCP FILESYSTEM
3965−M: Petr Vandrovec <vandrove@vc.cvut.cz>
3966−S: Maintained
3979+M: Petr Vandrovec <petr@vandrovec.name>
3980+S: Odd Fixes
39673981 F: fs/ncpfs/
39683982
39693983 NCR DUAL 700 SCSI DRIVER (MICROCHANNEL)
@@ -5091,8 +5105,10 @@ S: Maintained · 1121 unmodified lines
50915105 F: drivers/mmc/host/sdricoh_cs.c
50925106
50935107 SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
5094−S: Orphan
5108+M: Chris Ball <cjb@laptop.org>
50955109 L: linux-mmc@vger.kernel.org
5110+T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
5111+S: Maintained
50965112 F: drivers/mmc/host/sdhci.*
50975113
50985114 SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF)
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 2
22 PATCHLEVEL = 6
33 SUBLEVEL = 36
4−EXTRAVERSION = -rc5
4+EXTRAVERSION = -rc7
55 NAME = Sheep on Meth
66
77 # *DOCUMENTATION*
arch/alpha/kernel/entry.S+7−13
@@ -73,8 +73,6 @@ · 72 unmodified lines
7373 ldq $20, HAE_REG($19); \
7474 stq $21, HAE_CACHE($19); \
7575 stq $21, 0($20); \
76− ldq $0, 0($sp); \
77− ldq $1, 8($sp); \
7876 99:; \
7977 ldq $19, 72($sp); \
8078 ldq $20, 80($sp); \
@@ -316,7 +314,7 @@ ret_from_sys_call: · 235 unmodified lines
316314 cmovne $26, 0, $19 /* $19 = 0 => non-restartable */
317315 ldq $0, SP_OFF($sp)
318316 and $0, 8, $0
319− beq $0, restore_all
317+ beq $0, ret_to_kernel
320318 ret_to_user:
321319 /* Make sure need_resched and sigpending don't change between
322320 sampling and the rti. */
@@ -329,6 +327,11 @@ restore_all: · 6 unmodified lines
329327 RESTORE_ALL
330328 call_pal PAL_rti
331329
330+ret_to_kernel:
331+ lda $16, 7
332+ call_pal PAL_swpipl
333+ br restore_all
334+
332335 .align 3
333336 $syscall_error:
334337 /*
@@ -657,7 +660,7 @@ kernel_thread: · 322 unmodified lines
657660 /* We don't actually care for a3 success widgetry in the kernel.
658661 Not for positive errno values. */
659662 stq $0, 0($sp) /* $0 */
660− br restore_all
663+ br ret_to_kernel
661664 .end kernel_thread
662665
663666 /*
@@ -911,15 +914,6 @@ sys_execve: · 247 unmodified lines
911914 jmp $31, do_sys_execve
912915 .end sys_execve
913916
914− .align 4
915− .globl osf_sigprocmask
916− .ent osf_sigprocmask
917−osf_sigprocmask:
918− .prologue 0
919− mov $sp, $18
920− jmp $31, sys_osf_sigprocmask
921−.end osf_sigprocmask
922−
923917 .align 4
924918 .globl alpha_ni_syscall
925919 .ent alpha_ni_syscall
arch/alpha/kernel/process.c+1−1
@@ -356,7 +356,7 @@ dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt, struct thread_info *ti) · 355 unmodified lines
356356 dest[27] = pt->r27;
357357 dest[28] = pt->r28;
358358 dest[29] = pt->gp;
359− dest[30] = rdusp();
359+ dest[30] = ti == current_thread_info() ? rdusp() : ti->pcb.usp;
360360 dest[31] = pt->pc;
361361
362362 /* Once upon a time this was the PS value. Which is stupid
arch/alpha/kernel/signal.c+15−41
@@ -41,46 +41,20 @@ static void do_signal(struct pt_regs *, struct switch_stack *, · 40 unmodified lines
4141 /*
4242 * The OSF/1 sigprocmask calling sequence is different from the
4343 * C sigprocmask() sequence..
44− *
45− * how:
46− * 1 - SIG_BLOCK
47− * 2 - SIG_UNBLOCK
48− * 3 - SIG_SETMASK
49− *
50− * We change the range to -1 .. 1 in order to let gcc easily
51− * use the conditional move instructions.
52− *
53− * Note that we don't need to acquire the kernel lock for SMP
54− * operation, as all of this is local to this thread.
5544 */
56−SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask,
57− struct pt_regs *, regs)
45+SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask)
5846 {
59− unsigned long oldmask = -EINVAL;
60−
61− if ((unsigned long)how-1 <= 2) {
62− long sign = how-2; /* -1 .. 1 */
63− unsigned long block, unblock;
64−
65− newmask &= _BLOCKABLE;
66− spin_lock_irq(&current->sighand->siglock);
67− oldmask = current->blocked.sig[0];
68−
69− unblock = oldmask & ~newmask;
70− block = oldmask | newmask;
71− if (!sign)
72− block = unblock;
73− if (sign <= 0)
74− newmask = block;
75− if (_NSIG_WORDS > 1 && sign > 0)
76− sigemptyset(&current->blocked);
77− current->blocked.sig[0] = newmask;
78− recalc_sigpending();
79− spin_unlock_irq(&current->sighand->siglock);
80−
81− regs->r0 = 0; /* special no error return */
47+ sigset_t oldmask;
48+ sigset_t mask;
49+ unsigned long res;
50+
51+ siginitset(&mask, newmask & _BLOCKABLE);
52+ res = sigprocmask(how, &mask, &oldmask);
53+ if (!res) {
54+ force_successful_syscall_return();
55+ res = oldmask.sig[0];
8256 }
83− return oldmask;
57+ return res;
8458 }
8559
8660 SYSCALL_DEFINE3(osf_sigaction, int, sig,
@@ -94,9 +68,9 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, · 7 unmodified lines
9468 old_sigset_t mask;
9569 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
9670 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
97− __get_user(new_ka.sa.sa_flags, &act->sa_flags))
71+ __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
72+ __get_user(mask, &act->sa_mask))
9873 return -EFAULT;
99− __get_user(mask, &act->sa_mask);
10074 siginitset(&new_ka.sa.sa_mask, mask);
10175 new_ka.ka_restorer = NULL;
10276 }
@@ -106,9 +80,9 @@ SYSCALL_DEFINE3(osf_sigaction, int, sig, · 3 unmodified lines
10680 if (!ret && oact) {
10781 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
10882 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
109− __put_user(old_ka.sa.sa_flags, &oact->sa_flags))
83+ __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
84+ __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
11085 return -EFAULT;
111− __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
11286 }
11387
11488 return ret;
arch/alpha/kernel/systbls.S+1−1
@@ -58,7 +58,7 @@ sys_call_table: · 57 unmodified lines
5858 .quad sys_open /* 45 */
5959 .quad alpha_ni_syscall
6060 .quad sys_getxgid
61− .quad osf_sigprocmask
61+ .quad sys_osf_sigprocmask
6262 .quad alpha_ni_syscall
6363 .quad alpha_ni_syscall /* 50 */
6464 .quad sys_acct
arch/arm/Kconfig+26−1
@@ -271,7 +271,6 @@ config ARCH_AT91 · 270 unmodified lines
271271 bool "Atmel AT91"
272272 select ARCH_REQUIRE_GPIOLIB
273273 select HAVE_CLK
274− select ARCH_USES_GETTIMEOFFSET
275274 help
276275 This enables support for systems based on the Atmel AT91RM9200,
277276 AT91SAM9 and AT91CAP9 processors.
@@ -1051,6 +1050,32 @@ config ARM_ERRATA_460075 · 773 unmodified lines
10511050 ACTLR register. Note that setting specific bits in the ACTLR register
10521051 may not be available in non-secure mode.
10531052
1053+config ARM_ERRATA_742230
1054+ bool "ARM errata: DMB operation may be faulty"
1055+ depends on CPU_V7 && SMP
1056+ help
1057+ This option enables the workaround for the 742230 Cortex-A9
1058+ (r1p0..r2p2) erratum. Under rare circumstances, a DMB instruction
1059+ between two write operations may not ensure the correct visibility
1060+ ordering of the two writes. This workaround sets a specific bit in
1061+ the diagnostic register of the Cortex-A9 which causes the DMB
1062+ instruction to behave as a DSB, ensuring the correct behaviour of
1063+ the two writes.
1064+
1065+config ARM_ERRATA_742231
1066+ bool "ARM errata: Incorrect hazard handling in the SCU may lead to data corruption"
1067+ depends on CPU_V7 && SMP
1068+ help
1069+ This option enables the workaround for the 742231 Cortex-A9
1070+ (r2p0..r2p2) erratum. Under certain conditions, specific to the
1071+ Cortex-A9 MPCore micro-architecture, two CPUs working in SMP mode,
1072+ accessing some data located in the same cache line, may get corrupted
1073+ data due to bad handling of the address hazard when the line gets
1074+ replaced from one of the CPUs at the same time as another CPU is
1075+ accessing it. This workaround sets specific bits in the diagnostic
1076+ register of the Cortex-A9 which reduces the linefill issuing
1077+ capabilities of the processor.
1078+
10541079 config PL310_ERRATA_588369
10551080 bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
10561081 depends on CACHE_L2X0 && ARCH_OMAP4
arch/arm/boot/compressed/Makefile+1−1
@@ -116,5 +116,5 @@ CFLAGS_font.o := -Dstatic= · 115 unmodified lines
116116 $(obj)/font.c: $(FONTC)
117117 $(call cmd,shipped)
118118
119−$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
119+$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG)
120120 @sed "$(SEDFLAGS)" < $< > $@
arch/arm/common/it8152.c+8−0
@@ -271,6 +271,14 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) · 270 unmodified lines
271271 ((dma_addr + size - PHYS_OFFSET) >= SZ_64M);
272272 }
273273
274+int dma_set_coherent_mask(struct device *dev, u64 mask)
275+{
276+ if (mask >= PHYS_OFFSET + SZ_64M - 1)
277+ return 0;
278+
279+ return -EIO;
280+}
281+
274282 int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
275283 {
276284 it8152_io.start = IT8152_IO_BASE + 0x12000;
arch/arm/include/asm/pgtable.h+4−0
@@ -317,6 +317,10 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } · 316 unmodified lines
317317 #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
318318 #define pgprot_dmacoherent(prot) \
319319 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE)
320+#define __HAVE_PHYS_MEM_ACCESS_PROT
321+struct file;
322+extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
323+ unsigned long size, pgprot_t vma_prot);
320324 #else
321325 #define pgprot_dmacoherent(prot) \
322326 __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_UNCACHED)
arch/arm/kernel/entry-common.S+2−0
@@ -48,6 +48,8 @@ work_pending: · 47 unmodified lines
4848 beq no_work_pending
4949 mov r0, sp @ 'regs'
5050 mov r2, why @ 'syscall'
51+ tst r1, #_TIF_SIGPENDING @ delivering a signal?
52+ movne why, #0 @ prevent further restarts
5153 bl do_notify_resume
5254 b ret_slow_syscall @ Check work again
5355
arch/arm/mach-at91/at91sam9g45_devices.c+2−2
@@ -426,7 +426,7 @@ static struct i2c_gpio_platform_data pdata_i2c0 = { · 425 unmodified lines
426426 .sda_is_open_drain = 1,
427427 .scl_pin = AT91_PIN_PA21,
428428 .scl_is_open_drain = 1,
429− .udelay = 2, /* ~100 kHz */
429+ .udelay = 5, /* ~100 kHz */
430430 };
431431
432432 static struct platform_device at91sam9g45_twi0_device = {
@@ -440,7 +440,7 @@ static struct i2c_gpio_platform_data pdata_i2c1 = { · 7 unmodified lines
440440 .sda_is_open_drain = 1,
441441 .scl_pin = AT91_PIN_PB11,
442442 .scl_is_open_drain = 1,
443− .udelay = 2, /* ~100 kHz */
443+ .udelay = 5, /* ~100 kHz */
444444 };
445445
446446 static struct platform_device at91sam9g45_twi1_device = {
arch/arm/mach-davinci/dm355.c+1−2
@@ -769,8 +769,7 @@ static struct map_desc dm355_io_desc[] = { · 768 unmodified lines
769769 .virtual = SRAM_VIRT,
770770 .pfn = __phys_to_pfn(0x00010000),
771771 .length = SZ_32K,
772− /* MT_MEMORY_NONCACHED requires supersection alignment */
773− .type = MT_DEVICE,
772+ .type = MT_MEMORY_NONCACHED,
774773 },
775774 };
776775
arch/arm/mach-davinci/dm365.c+1−2
@@ -969,8 +969,7 @@ static struct map_desc dm365_io_desc[] = { · 968 unmodified lines
969969 .virtual = SRAM_VIRT,
970970 .pfn = __phys_to_pfn(0x00010000),
971971 .length = SZ_32K,
972− /* MT_MEMORY_NONCACHED requires supersection alignment */
973− .type = MT_DEVICE,
972+ .type = MT_MEMORY_NONCACHED,
974973 },
975974 };
976975
arch/arm/mach-davinci/dm644x.c+1−2
@@ -653,8 +653,7 @@ static struct map_desc dm644x_io_desc[] = { · 652 unmodified lines
653653 .virtual = SRAM_VIRT,
654654 .pfn = __phys_to_pfn(0x00008000),
655655 .length = SZ_16K,
656− /* MT_MEMORY_NONCACHED requires supersection alignment */
657− .type = MT_DEVICE,
656+ .type = MT_MEMORY_NONCACHED,
658657 },
659658 };
660659
arch/arm/mach-davinci/dm646x.c+1−2
@@ -737,8 +737,7 @@ static struct map_desc dm646x_io_desc[] = { · 736 unmodified lines
737737 .virtual = SRAM_VIRT,
738738 .pfn = __phys_to_pfn(0x00010000),
739739 .length = SZ_32K,
740− /* MT_MEMORY_NONCACHED requires supersection alignment */
741− .type = MT_DEVICE,
740+ .type = MT_MEMORY_NONCACHED,
742741 },
743742 };
744743
arch/arm/mach-dove/include/mach/io.h+3−3
@@ -13,8 +13,8 @@ · 12 unmodified lines
1313
1414 #define IO_SPACE_LIMIT 0xffffffff
1515
16−#define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\
17− DOVE_PCIE0_IO_VIRT_BASE))
18−#define __mem_pci(a) (a)
16+#define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \
17+ DOVE_PCIE0_IO_VIRT_BASE))
18+#define __mem_pci(a) (a)
1919
2020 #endif
arch/arm/mach-ixp4xx/common-pci.c+8−0
@@ -503,6 +503,14 @@ struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys) · 502 unmodified lines
503503 return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys);
504504 }
505505
506+int dma_set_coherent_mask(struct device *dev, u64 mask)
507+{
508+ if (mask >= SZ_64M - 1)
509+ return 0;
510+
511+ return -EIO;
512+}
513+
506514 EXPORT_SYMBOL(ixp4xx_pci_read);
507515 EXPORT_SYMBOL(ixp4xx_pci_write);
508516
arch/arm/mach-ixp4xx/include/mach/hardware.h+2−0
@@ -26,6 +26,8 @@ · 25 unmodified lines
2626 #define PCIBIOS_MAX_MEM 0x4BFFFFFF
2727 #endif
2828
29+#define ARCH_HAS_DMA_SET_COHERENT_MASK
30+
2931 #define pcibios_assign_all_busses() 1
3032
3133 /* Register locations and bits */
arch/arm/mach-kirkwood/include/mach/kirkwood.h+1−1
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838
3939 #define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000
4040 #define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000
41−#define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00000000
41+#define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000
4242 #define KIRKWOOD_PCIE1_IO_SIZE SZ_1M
4343
4444 #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000
arch/arm/mach-kirkwood/pcie.c+2−2
@@ -117,7 +117,7 @@ static void __init pcie0_ioresources_init(struct pcie_port *pp) · 116 unmodified lines
117117 * IORESOURCE_IO
118118 */
119119 pp->res[0].name = "PCIe 0 I/O Space";
120− pp->res[0].start = KIRKWOOD_PCIE_IO_PHYS_BASE;
120+ pp->res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE;
121121 pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1;
122122 pp->res[0].flags = IORESOURCE_IO;
123123
@@ -139,7 +139,7 @@ static void __init pcie1_ioresources_init(struct pcie_port *pp) · 15 unmodified lines
139139 * IORESOURCE_IO
140140 */
141141 pp->res[0].name = "PCIe 1 I/O Space";
142− pp->res[0].start = KIRKWOOD_PCIE1_IO_PHYS_BASE;
142+ pp->res[0].start = KIRKWOOD_PCIE1_IO_BUS_BASE;
143143 pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1;
144144 pp->res[0].flags = IORESOURCE_IO;
145145
arch/arm/mach-mmp/include/mach/system.h+6−1
@@ -9,6 +9,8 @@ · 8 unmodified lines
99 #ifndef __ASM_MACH_SYSTEM_H
1010 #define __ASM_MACH_SYSTEM_H
1111
12+#include <mach/cputype.h>
13+
1214 static inline void arch_idle(void)
1315 {
1416 cpu_do_idle();
@@ -16,6 +18,9 @@ static inline void arch_idle(void) · 1 unmodified line
1618
1719 static inline void arch_reset(char mode, const char *cmd)
1820 {
19− cpu_reset(0);
21+ if (cpu_is_pxa168())
22+ cpu_reset(0xffff0000);
23+ else
24+ cpu_reset(0);
2025 }
2126 #endif /* __ASM_MACH_SYSTEM_H */
arch/arm/mach-pxa/cpufreq-pxa2xx.c+1−2
@@ -312,8 +312,7 @@ static int pxa_set_target(struct cpufreq_policy *policy, · 311 unmodified lines
312312 freqs.cpu = policy->cpu;
313313
314314 if (freq_debug)
315− pr_debug(KERN_INFO "Changing CPU frequency to %d Mhz, "
316− "(SDRAM %d Mhz)\n",
315+ pr_debug("Changing CPU frequency to %d Mhz, (SDRAM %d Mhz)\n",
317316 freqs.new / 1000, (pxa_freq_settings[idx].div2) ?
318317 (new_freq_mem / 2000) : (new_freq_mem / 1000));
319318
arch/arm/mach-pxa/include/mach/hardware.h+13−1
@@ -264,23 +264,35 @@ · 263 unmodified lines
264264 * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x
265265 * == 0x3 for pxa300/pxa310/pxa320
266266 */
267+#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
267268 #define __cpu_is_pxa2xx(id) \
268269 ({ \
269270 unsigned int _id = (id) >> 13 & 0x7; \
270271 _id <= 0x2; \
271272 })
273+#else
274+#define __cpu_is_pxa2xx(id) (0)
275+#endif
272276
277+#ifdef CONFIG_PXA3xx
273278 #define __cpu_is_pxa3xx(id) \
274279 ({ \
275280 unsigned int _id = (id) >> 13 & 0x7; \
276281 _id == 0x3; \
277282 })
283+#else
284+#define __cpu_is_pxa3xx(id) (0)
285+#endif
278286
287+#if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935)
279288 #define __cpu_is_pxa93x(id) \
280289 ({ \
281290 unsigned int _id = (id) >> 4 & 0xfff; \
282291 _id == 0x683 || _id == 0x693; \
283292 })
293+#else
294+#define __cpu_is_pxa93x(id) (0)
295+#endif
284296
285297 #define cpu_is_pxa2xx() \
286298 ({ \
@@ -309,7 +321,7 @@ extern unsigned long get_clock_tick_rate(void); · 22 unmodified lines
309321 #define PCIBIOS_MIN_IO 0
310322 #define PCIBIOS_MIN_MEM 0
311323 #define pcibios_assign_all_busses() 1
324+#define ARCH_HAS_DMA_SET_COHERENT_MASK
312325 #endif
313326
314−
315327 #endif /* _ASM_ARCH_HARDWARE_H */
arch/arm/mach-pxa/include/mach/io.h+2−0
@@ -6,6 +6,8 @@ · 5 unmodified lines
66 #ifndef __ASM_ARM_ARCH_IO_H
77 #define __ASM_ARM_ARCH_IO_H
88
9+#include <mach/hardware.h>
10+
911 #define IO_SPACE_LIMIT 0xffffffff
1012
1113 /*
arch/arm/mach-pxa/palm27x.c+5−1
@@ -469,9 +469,13 @@ static struct i2c_board_info __initdata palm27x_pi2c_board_info[] = { · 468 unmodified lines
469469 },
470470 };
471471
472+static struct i2c_pxa_platform_data palm27x_i2c_power_info = {
473+ .use_pio = 1,
474+};
475+
472476 void __init palm27x_pmic_init(void)
473477 {
474478 i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info));
475− pxa27x_set_i2c_power_info(NULL);
479+ pxa27x_set_i2c_power_info(&palm27x_i2c_power_info);
476480 }
477481 #endif
arch/arm/mach-pxa/vpac270.c+1−0
@@ -240,6 +240,7 @@ static void __init vpac270_onenand_init(void) {} · 239 unmodified lines
240240 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
241241 static struct pxamci_platform_data vpac270_mci_platform_data = {
242242 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
243+ .gpio_power = -1,
243244 .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N,
244245 .gpio_card_ro = GPIO52_VPAC270_SD_READONLY,
245246 .detect_delay_ms = 200,
arch/arm/mach-u300/include/mach/gpio.h+3−0
@@ -273,6 +273,9 @@ extern void gpio_pullup(unsigned gpio, int value); · 272 unmodified lines
273273 extern int gpio_get_value(unsigned gpio);
274274 extern void gpio_set_value(unsigned gpio, int value);
275275
276+#define gpio_get_value_cansleep gpio_get_value
277+#define gpio_set_value_cansleep gpio_set_value
278+
276279 /* wrappers to sleep-enable the previous two functions */
277280 static inline unsigned gpio_to_irq(unsigned gpio)
278281 {
arch/arm/mach-vexpress/ct-ca9x4.c+7−1
@@ -227,7 +227,13 @@ static void ct_ca9x4_init(void) · 226 unmodified lines
227227 int i;
228228
229229 #ifdef CONFIG_CACHE_L2X0
230− l2x0_init(MMIO_P2V(CT_CA9X4_L2CC), 0x00000000, 0xfe0fffff);
230+ void __iomem *l2x0_base = MMIO_P2V(CT_CA9X4_L2CC);
231+
232+ /* set RAM latencies to 1 cycle for this core tile. */
233+ writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL);
234+ writel(0, l2x0_base + L2X0_DATA_LATENCY_CTRL);
235+
236+ l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff);
231237 #endif
232238
233239 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
arch/arm/mm/alignment.c+17−2
@@ -885,8 +885,23 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) · 884 unmodified lines
885885
886886 if (ai_usermode & UM_SIGNAL)
887887 force_sig(SIGBUS, current);
888− else
889− set_cr(cr_no_alignment);
888+ else {
889+ /*
890+ * We're about to disable the alignment trap and return to
891+ * user space. But if an interrupt occurs before actually
892+ * reaching user space, then the IRQ vector entry code will
893+ * notice that we were still in kernel space and therefore
894+ * the alignment trap won't be re-enabled in that case as it
895+ * is presumed to be always on from kernel space.
896+ * Let's prevent that race by disabling interrupts here (they
897+ * are disabled on the way back to user space anyway in
898+ * entry-common.S) and disable the alignment trap only if
899+ * there is no work pending for this thread.
900+ */
901+ raw_local_irq_disable();
902+ if (!(current_thread_info()->flags & _TIF_WORK_MASK))
903+ set_cr(cr_no_alignment);
904+ }
890905
891906 return 0;
892907 }
arch/arm/mm/mmu.c+29−2
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/nodemask.h>
1616 #include <linux/memblock.h>
1717 #include <linux/sort.h>
18+#include <linux/fs.h>
1819
1920 #include <asm/cputype.h>
2021 #include <asm/sections.h>
@@ -246,6 +247,9 @@ static struct mem_type mem_types[] = { · 225 unmodified lines
246247 .domain = DOMAIN_USER,
247248 },
248249 [MT_MEMORY] = {
250+ .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
251+ L_PTE_USER | L_PTE_EXEC,
252+ .prot_l1 = PMD_TYPE_TABLE,
249253 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
250254 .domain = DOMAIN_KERNEL,
251255 },
@@ -254,6 +258,9 @@ static struct mem_type mem_types[] = { · 2 unmodified lines
254258 .domain = DOMAIN_KERNEL,
255259 },
256260 [MT_MEMORY_NONCACHED] = {
261+ .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
262+ L_PTE_USER | L_PTE_EXEC | L_PTE_MT_BUFFERABLE,
263+ .prot_l1 = PMD_TYPE_TABLE,
257264 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
258265 .domain = DOMAIN_KERNEL,
259266 },
@@ -411,9 +418,12 @@ static void __init build_mem_type_table(void) · 151 unmodified lines
411418 * Enable CPU-specific coherency if supported.
412419 * (Only available on XSC3 at the moment.)
413420 */
414− if (arch_is_coherent() && cpu_is_xsc3())
421+ if (arch_is_coherent() && cpu_is_xsc3()) {
415422 mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
416−
423+ mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED;
424+ mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
425+ mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED;
426+ }
417427 /*
418428 * ARMv6 and above have extended page tables.
419429 */
@@ -438,7 +448,9 @@ static void __init build_mem_type_table(void) · 18 unmodified lines
438448 mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
439449 mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED;
440450 mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
451+ mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED;
441452 mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
453+ mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED;
442454 #endif
443455 }
444456
@@ -475,6 +487,8 @@ static void __init build_mem_type_table(void) · 30 unmodified lines
475487 mem_types[MT_LOW_VECTORS].prot_l1 |= ecc_mask;
476488 mem_types[MT_HIGH_VECTORS].prot_l1 |= ecc_mask;
477489 mem_types[MT_MEMORY].prot_sect |= ecc_mask | cp->pmd;
490+ mem_types[MT_MEMORY].prot_pte |= kern_pgprot;
491+ mem_types[MT_MEMORY_NONCACHED].prot_sect |= ecc_mask;
478492 mem_types[MT_ROM].prot_sect |= cp->pmd;
479493
480494 switch (cp->pmd) {
@@ -498,6 +512,19 @@ static void __init build_mem_type_table(void) · 17 unmodified lines
498512 }
499513 }
500514
515+#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
516+pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
517+ unsigned long size, pgprot_t vma_prot)
518+{
519+ if (!pfn_valid(pfn))
520+ return pgprot_noncached(vma_prot);
521+ else if (file->f_flags & O_SYNC)
522+ return pgprot_writecombine(vma_prot);
523+ return vma_prot;
524+}
525+EXPORT_SYMBOL(phys_mem_access_prot);
526+#endif
527+
501528 #define vectors_base() (vectors_high() ? 0xffff0000 : 0)
502529
503530 static void __init *early_alloc(unsigned long sz)
arch/arm/mm/proc-v7.S+56−6
@@ -186,13 +186,14 @@ cpu_v7_name: · 185 unmodified lines
186186 * It is assumed that:
187187 * - cache type register is implemented
188188 */
189−__v7_setup:
189+__v7_ca9mp_setup:
190190 #ifdef CONFIG_SMP
191191 mrc p15, 0, r0, c1, c0, 1
192192 tst r0, #(1 << 6) @ SMP/nAMP mode enabled?
193193 orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and
194194 mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting
195195 #endif
196+__v7_setup:
196197 adr r12, __v7_setup_stack @ the local stack
197198 stmia r12, {r0-r5, r7, r9, r11, lr}
198199 bl v7_flush_dcache_all
@@ -201,11 +202,16 @@ __v7_setup: · 2 unmodified lines
201202 mrc p15, 0, r0, c0, c0, 0 @ read main ID register
202203 and r10, r0, #0xff000000 @ ARM?
203204 teq r10, #0x41000000
204− bne 2f
205+ bne 3f
205206 and r5, r0, #0x00f00000 @ variant
206207 and r6, r0, #0x0000000f @ revision
207− orr r0, r6, r5, lsr #20-4 @ combine variant and revision
208+ orr r6, r6, r5, lsr #20-4 @ combine variant and revision
209+ ubfx r0, r0, #4, #12 @ primary part number
208210
211+ /* Cortex-A8 Errata */
212+ ldr r10, =0x00000c08 @ Cortex-A8 primary part number
213+ teq r0, r10
214+ bne 2f
209215 #ifdef CONFIG_ARM_ERRATA_430973
210216 teq r5, #0x00100000 @ only present in r1p*
211217 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register
@@ -213,21 +219,42 @@ __v7_setup: · 1 unmodified line
213219 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register
214220 #endif
215221 #ifdef CONFIG_ARM_ERRATA_458693
216− teq r0, #0x20 @ only present in r2p0
222+ teq r6, #0x20 @ only present in r2p0
217223 mrceq p15, 0, r10, c1, c0, 1 @ read aux control register
218224 orreq r10, r10, #(1 << 5) @ set L1NEON to 1
219225 orreq r10, r10, #(1 << 9) @ set PLDNOP to 1
220226 mcreq p15, 0, r10, c1, c0, 1 @ write aux control register
221227 #endif
222228 #ifdef CONFIG_ARM_ERRATA_460075
223− teq r0, #0x20 @ only present in r2p0
229+ teq r6, #0x20 @ only present in r2p0
224230 mrceq p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register
225231 tsteq r10, #1 << 22
226232 orreq r10, r10, #(1 << 22) @ set the Write Allocate disable bit
227233 mcreq p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register
228234 #endif
235+ b 3f
236+
237+ /* Cortex-A9 Errata */
238+2: ldr r10, =0x00000c09 @ Cortex-A9 primary part number
239+ teq r0, r10
240+ bne 3f
241+#ifdef CONFIG_ARM_ERRATA_742230
242+ cmp r6, #0x22 @ only present up to r2p2
243+ mrcle p15, 0, r10, c15, c0, 1 @ read diagnostic register
244+ orrle r10, r10, #1 << 4 @ set bit #4
245+ mcrle p15, 0, r10, c15, c0, 1 @ write diagnostic register
246+#endif
247+#ifdef CONFIG_ARM_ERRATA_742231
248+ teq r6, #0x20 @ present in r2p0
249+ teqne r6, #0x21 @ present in r2p1
250+ teqne r6, #0x22 @ present in r2p2
251+ mrceq p15, 0, r10, c15, c0, 1 @ read diagnostic register
252+ orreq r10, r10, #1 << 12 @ set bit #12
253+ orreq r10, r10, #1 << 22 @ set bit #22
254+ mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register
255+#endif
229256
230−2: mov r10, #0
257+3: mov r10, #0
231258 #ifdef HARVARD_CACHE
232259 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate
233260 #endif
@@ -323,6 +350,29 @@ cpu_elf_name: · 89 unmodified lines
323350
324351 .section ".proc.info.init", #alloc, #execinstr
325352
353+ .type __v7_ca9mp_proc_info, #object
354+__v7_ca9mp_proc_info:
355+ .long 0x410fc090 @ Required ID value
356+ .long 0xff0ffff0 @ Mask for ID
357+ .long PMD_TYPE_SECT | \
358+ PMD_SECT_AP_WRITE | \
359+ PMD_SECT_AP_READ | \
360+ PMD_FLAGS
361+ .long PMD_TYPE_SECT | \
362+ PMD_SECT_XN | \
363+ PMD_SECT_AP_WRITE | \
364+ PMD_SECT_AP_READ
365+ b __v7_ca9mp_setup
366+ .long cpu_arch_name
367+ .long cpu_elf_name
368+ .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
369+ .long cpu_v7_name
370+ .long v7_processor_functions
371+ .long v7wbi_tlb_fns
372+ .long v6_user_fns
373+ .long v7_cache_fns
374+ .size __v7_ca9mp_proc_info, . - __v7_ca9mp_proc_info
375+
326376 /*
327377 * Match any ARMv7 processor core.
328378 */
arch/arm/plat-nomadik/timer.c+12−21
@@ -1,5 +1,5 @@
11 /*
2− * linux/arch/arm/mach-nomadik/timer.c
2+ * linux/arch/arm/plat-nomadik/timer.c
33 *
44 * Copyright (C) 2008 STMicroelectronics
55 * Copyright (C) 2010 Alessandro Rubini
@@ -75,7 +75,7 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode, · 69 unmodified lines
7575 cr = readl(mtu_base + MTU_CR(1));
7676 writel(0, mtu_base + MTU_LR(1));
7777 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1));
78− writel(0x2, mtu_base + MTU_IMSC);
78+ writel(1 << 1, mtu_base + MTU_IMSC);
7979 break;
8080 case CLOCK_EVT_MODE_SHUTDOWN:
8181 case CLOCK_EVT_MODE_UNUSED:
@@ -131,25 +131,23 @@ void __init nmdk_timer_init(void) · 49 unmodified lines
131131 {
132132 unsigned long rate;
133133 struct clk *clk0;
134− struct clk *clk1;
135− u32 cr;
134+ u32 cr = MTU_CRn_32BITS;
136135
137136 clk0 = clk_get_sys("mtu0", NULL);
138137 BUG_ON(IS_ERR(clk0));
139138
140− clk1 = clk_get_sys("mtu1", NULL);
141− BUG_ON(IS_ERR(clk1));
142−
143139 clk_enable(clk0);
144− clk_enable(clk1);
145140
146141 /*
147− * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500:
148− * use a divide-by-16 counter if it's more than 16MHz
142+ * Tick rate is 2.4MHz for Nomadik and 2.4Mhz, 100MHz or 133 MHz
143+ * for ux500.
144+ * Use a divide-by-16 counter if the tick rate is more than 32MHz.
145+ * At 32 MHz, the timer (with 32 bit counter) can be programmed
146+ * to wake-up at a max 127s a head in time. Dividing a 2.4 MHz timer
147+ * with 16 gives too low timer resolution.
149148 */
150− cr = MTU_CRn_32BITS;;
151149 rate = clk_get_rate(clk0);
152− if (rate > 16 << 20) {
150+ if (rate > 32000000) {
153151 rate /= 16;
154152 cr |= MTU_CRn_PRESCALE_16;
155153 } else {
@@ -170,15 +168,8 @@ void __init nmdk_timer_init(void) · 14 unmodified lines
170168 pr_err("timer: failed to initialize clock source %s\n",
171169 nmdk_clksrc.name);
172170
173− /* Timer 1 is used for events, fix according to rate */
174− cr = MTU_CRn_32BITS;
175− rate = clk_get_rate(clk1);
176− if (rate > 16 << 20) {
177− rate /= 16;
178− cr |= MTU_CRn_PRESCALE_16;
179− } else {
180− cr |= MTU_CRn_PRESCALE_1;
181− }
171+ /* Timer 1 is used for events */
172+
182173 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);
183174
184175 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
arch/arm/plat-omap/Kconfig+1−1
@@ -33,7 +33,7 @@ config OMAP_DEBUG_DEVICES · 32 unmodified lines
3333 config OMAP_DEBUG_LEDS
3434 bool
3535 depends on OMAP_DEBUG_DEVICES
36− default y if LEDS
36+ default y if LEDS_CLASS
3737
3838 config OMAP_RESET_CLOCKS
3939 bool "Reset unused clocks during boot"
arch/arm/plat-omap/mcbsp.c+1−1
@@ -156,7 +156,7 @@ static irqreturn_t omap_mcbsp_rx_irq_handler(int irq, void *dev_id) · 155 unmodified lines
156156 /* Writing zero to RSYNC_ERR clears the IRQ */
157157 MCBSP_WRITE(mcbsp_rx, SPCR1, MCBSP_READ_CACHE(mcbsp_rx, SPCR1));
158158 } else {
159− complete(&mcbsp_rx->tx_irq_completion);
159+ complete(&mcbsp_rx->rx_irq_completion);
160160 }
161161
162162 return IRQ_HANDLED;
arch/arm/plat-omap/sram.c+5−20
@@ -220,20 +220,7 @@ void __init omap_map_sram(void) · 219 unmodified lines
220220 if (omap_sram_size == 0)
221221 return;
222222
223− if (cpu_is_omap24xx()) {
224− omap_sram_io_desc[0].virtual = OMAP2_SRAM_VA;
225−
226− base = OMAP2_SRAM_PA;
227− base = ROUND_DOWN(base, PAGE_SIZE);
228− omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
229− }
230−
231223 if (cpu_is_omap34xx()) {
232− omap_sram_io_desc[0].virtual = OMAP3_SRAM_VA;
233− base = OMAP3_SRAM_PA;
234− base = ROUND_DOWN(base, PAGE_SIZE);
235− omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
236−
237224 /*
238225 * SRAM must be marked as non-cached on OMAP3 since the
239226 * CORE DPLL M2 divider change code (in SRAM) runs with the
@@ -244,13 +231,11 @@ void __init omap_map_sram(void) · 4 unmodified lines
244231 omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED;
245232 }
246233
247− if (cpu_is_omap44xx()) {
248− omap_sram_io_desc[0].virtual = OMAP4_SRAM_VA;
249− base = OMAP4_SRAM_PA;
250− base = ROUND_DOWN(base, PAGE_SIZE);
251− omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
252− }
253− omap_sram_io_desc[0].length = 1024 * 1024; /* Use section desc */
234+ omap_sram_io_desc[0].virtual = omap_sram_base;
235+ base = omap_sram_start;
236+ base = ROUND_DOWN(base, PAGE_SIZE);
237+ omap_sram_io_desc[0].pfn = __phys_to_pfn(base);
238+ omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE);
254239 iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc));
255240
256241 printk(KERN_INFO "SRAM: Mapped pa 0x%08lx to va 0x%08lx size: 0x%lx\n",
arch/avr32/kernel/module.c+1−2
@@ -314,10 +314,9 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, · 313 unmodified lines
314314 vfree(module->arch.syminfo);
315315 module->arch.syminfo = NULL;
316316
317− return module_bug_finalize(hdr, sechdrs, module);
317+ return 0;
318318 }
319319
320320 void module_arch_cleanup(struct module *module)
321321 {
322− module_bug_cleanup(module);
323322 }
arch/h8300/kernel/module.c+1−2
@@ -112,10 +112,9 @@ int module_finalize(const Elf_Ehdr *hdr, · 111 unmodified lines
112112 const Elf_Shdr *sechdrs,
113113 struct module *me)
114114 {
115− return module_bug_finalize(hdr, sechdrs, me);
115+ return 0;
116116 }
117117
118118 void module_arch_cleanup(struct module *mod)
119119 {
120− module_bug_cleanup(mod);
121120 }
arch/m32r/include/asm/signal.h+0−1
@@ -157,7 +157,6 @@ typedef struct sigaltstack { · 156 unmodified lines
157157 #undef __HAVE_ARCH_SIG_BITOPS
158158
159159 struct pt_regs;
160−extern int do_signal(struct pt_regs *regs, sigset_t *oldset);
161160
162161 #define ptrace_signal_deliver(regs, cookie) do { } while (0)
163162
arch/m32r/include/asm/unistd.h+1−0
@@ -351,6 +351,7 @@ · 350 unmodified lines
351351 #define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/
352352 #define __ARCH_WANT_SYS_OLDUMOUNT
353353 #define __ARCH_WANT_SYS_RT_SIGACTION
354+#define __ARCH_WANT_SYS_RT_SIGSUSPEND
354355
355356 #define __IGNORE_lchown
356357 #define __IGNORE_setuid
arch/m32r/kernel/entry.S+2−3
@@ -235,10 +235,9 @@ work_resched: · 234 unmodified lines
235235 work_notifysig: ; deal with pending signals and
236236 ; notify-resume requests
237237 mv r0, sp ; arg1 : struct pt_regs *regs
238− ldi r1, #0 ; arg2 : sigset_t *oldset
239− mv r2, r9 ; arg3 : __u32 thread_info_flags
238+ mv r1, r9 ; arg2 : __u32 thread_info_flags
240239 bl do_notify_resume
241− bra restore_all
240+ bra resume_userspace
242241
243242 ; perform syscall exit tracing
244243 ALIGN
arch/m32r/kernel/ptrace.c+4−3
@@ -592,16 +592,17 @@ void user_enable_single_step(struct task_struct *child) · 591 unmodified lines
592592
593593 if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0)
594594 != sizeof(insn))
595− break;
595+ return -EIO;
596596
597597 compute_next_pc(insn, pc, &next_pc, child);
598598 if (next_pc & 0x80000000)
599− break;
599+ return -EIO;
600600
601601 if (embed_debug_trap(child, next_pc))
602− break;
602+ return -EIO;
603603
604604 invalidate_cache();
605+ return 0;
605606 }
606607
607608 void user_disable_single_step(struct task_struct *child)
arch/m32r/kernel/signal.c+41−64
@@ -28,37 +28,6 @@ · 27 unmodified lines
2828
2929 #define DEBUG_SIG 0
3030
31−#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
32−
33−int do_signal(struct pt_regs *, sigset_t *);
34−
35−asmlinkage int
36−sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
37− unsigned long r2, unsigned long r3, unsigned long r4,
38− unsigned long r5, unsigned long r6, struct pt_regs *regs)
39−{
40− sigset_t newset;
41−
42− /* XXX: Don't preclude handling different sized sigset_t's. */
43− if (sigsetsize != sizeof(sigset_t))
44− return -EINVAL;
45−
46− if (copy_from_user(&newset, unewset, sizeof(newset)))
47− return -EFAULT;
48− sigdelsetmask(&newset, sigmask(SIGKILL)|sigmask(SIGSTOP));
49−
50− spin_lock_irq(&current->sighand->siglock);
51− current->saved_sigmask = current->blocked;
52− current->blocked = newset;
53− recalc_sigpending();
54− spin_unlock_irq(&current->sighand->siglock);
55−
56− current->state = TASK_INTERRUPTIBLE;
57− schedule();
58− set_thread_flag(TIF_RESTORE_SIGMASK);
59− return -ERESTARTNOHAND;
60−}
61−
6231 asmlinkage int
6332 sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
6433 unsigned long r2, unsigned long r3, unsigned long r4,
@@ -218,7 +187,7 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) · 153 unmodified lines
218187 return (void __user *)((sp - frame_size) & -8ul);
219188 }
220189
221−static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
190+static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
222191 sigset_t *set, struct pt_regs *regs)
223192 {
224193 struct rt_sigframe __user *frame;
@@ -275,22 +244,34 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, · 50 unmodified lines
275244 current->comm, current->pid, frame, regs->pc);
276245 #endif
277246
278− return;
247+ return 0;
279248
280249 give_sigsegv:
281250 force_sigsegv(sig, current);
251+ return -EFAULT;
252+}
253+
254+static int prev_insn(struct pt_regs *regs)
255+{
256+ u16 inst;
257+ if (get_user(&inst, (u16 __user *)(regs->bpc - 2)))
258+ return -EFAULT;
259+ if ((inst & 0xfff0) == 0x10f0) /* trap ? */
260+ regs->bpc -= 2;
261+ else
262+ regs->bpc -= 4;
263+ regs->syscall_nr = -1;
264+ return 0;
282265 }
283266
284267 /*
285268 * OK, we're invoking a handler
286269 */
287270
288−static void
271+static int
289272 handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
290273 sigset_t *oldset, struct pt_regs *regs)
291274 {
292− unsigned short inst;
293−
294275 /* Are we from a system call? */
295276 if (regs->syscall_nr >= 0) {
296277 /* If so, check system call restarting.. */
@@ -308,16 +289,14 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, · 11 unmodified lines
308289 /* fallthrough */
309290 case -ERESTARTNOINTR:
310291 regs->r0 = regs->orig_r0;
311− inst = *(unsigned short *)(regs->bpc - 2);
312− if ((inst & 0xfff0) == 0x10f0) /* trap ? */
313− regs->bpc -= 2;
314− else
315− regs->bpc -= 4;
292+ if (prev_insn(regs) < 0)
293+ return -EFAULT;
316294 }
317295 }
318296
319297 /* Set up the stack frame */
320− setup_rt_frame(sig, ka, info, oldset, regs);
298+ if (setup_rt_frame(sig, ka, info, oldset, regs))
299+ return -EFAULT;
321300
322301 spin_lock_irq(&current->sighand->siglock);
323302 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
@@ -325,6 +304,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, · 1 unmodified line
325304 sigaddset(&current->blocked,sig);
326305 recalc_sigpending();
327306 spin_unlock_irq(&current->sighand->siglock);
307+ return 0;
328308 }
329309
330310 /*
@@ -332,12 +312,12 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, · 1 unmodified line
332312 * want to handle. Thus you cannot kill init even with a SIGKILL even by
333313 * mistake.
334314 */
335−int do_signal(struct pt_regs *regs, sigset_t *oldset)
315+static void do_signal(struct pt_regs *regs)
336316 {
337317 siginfo_t info;
338318 int signr;
339319 struct k_sigaction ka;
340− unsigned short inst;
320+ sigset_t *oldset;
341321
342322 /*
343323 * We want the common case to go fast, which
@@ -346,12 +326,14 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) · 2 unmodified lines
346326 * if so.
347327 */
348328 if (!user_mode(regs))
349− return 1;
329+ return;
350330
351331 if (try_to_freeze())
352332 goto no_signal;
353333
354− if (!oldset)
334+ if (test_thread_flag(TIF_RESTORE_SIGMASK))
335+ oldset = &current->saved_sigmask;
336+ else
355337 oldset = &current->blocked;
356338
357339 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
@@ -363,8 +345,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) · 5 unmodified lines
363345 */
364346
365347 /* Whee! Actually deliver the signal. */
366− handle_signal(signr, &ka, &info, oldset, regs);
367− return 1;
348+ if (handle_signal(signr, &ka, &info, oldset, regs) == 0)
349+ clear_thread_flag(TIF_RESTORE_SIGMASK);
350+
351+ return;
368352 }
369353
370354 no_signal:
@@ -375,31 +359,24 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) · 4 unmodified lines
375359 regs->r0 == -ERESTARTSYS ||
376360 regs->r0 == -ERESTARTNOINTR) {
377361 regs->r0 = regs->orig_r0;
378− inst = *(unsigned short *)(regs->bpc - 2);
379− if ((inst & 0xfff0) == 0x10f0) /* trap ? */
380− regs->bpc -= 2;
381− else
382− regs->bpc -= 4;
383− }
384− if (regs->r0 == -ERESTART_RESTARTBLOCK){
362+ prev_insn(regs);
363+ } else if (regs->r0 == -ERESTART_RESTARTBLOCK){
385364 regs->r0 = regs->orig_r0;
386365 regs->r7 = __NR_restart_syscall;
387− inst = *(unsigned short *)(regs->bpc - 2);
388− if ((inst & 0xfff0) == 0x10f0) /* trap ? */
389− regs->bpc -= 2;
390− else
391− regs->bpc -= 4;
366+ prev_insn(regs);
392367 }
393368 }
394− return 0;
369+ if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
370+ clear_thread_flag(TIF_RESTORE_SIGMASK);
371+ sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
372+ }
395373 }
396374
397375 /*
398376 * notification of userspace execution resumption
399377 * - triggered by current->work.notify_resume
400378 */
401−void do_notify_resume(struct pt_regs *regs, sigset_t *oldset,
402− __u32 thread_info_flags)
379+void do_notify_resume(struct pt_regs *regs, __u32 thread_info_flags)
403380 {
404381 /* Pending single-step? */
405382 if (thread_info_flags & _TIF_SINGLESTEP)
@@ -407,7 +384,7 @@ void do_notify_resume(struct pt_regs *regs, sigset_t *oldset, · 1 unmodified line
407384
408385 /* deal with pending signal delivery */
409386 if (thread_info_flags & _TIF_SIGPENDING)
410− do_signal(regs,oldset);
387+ do_signal(regs);
411388
412389 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
413390 clear_thread_flag(TIF_NOTIFY_RESUME);
arch/m68k/mac/macboing.c+3−3
@@ -162,7 +162,7 @@ static void mac_init_asc( void ) · 161 unmodified lines
162162 void mac_mksound( unsigned int freq, unsigned int length )
163163 {
164164 __u32 cfreq = ( freq << 5 ) / 468;
165− __u32 flags;
165+ unsigned long flags;
166166 int i;
167167
168168 if ( mac_special_bell == NULL )
@@ -224,7 +224,7 @@ static void mac_nosound( unsigned long ignored ) · 55 unmodified lines
224224 */
225225 static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsigned int volume )
226226 {
227− __u32 flags;
227+ unsigned long flags;
228228
229229 /* if the bell is already ringing, ring longer */
230230 if ( mac_bell_duration > 0 )
@@ -271,7 +271,7 @@ static void mac_quadra_start_bell( unsigned int freq, unsigned int length, unsig · 40 unmodified lines
271271 static void mac_quadra_ring_bell( unsigned long ignored )
272272 {
273273 int i, count = mac_asc_samplespersec / HZ;
274− __u32 flags;
274+ unsigned long flags;
275275
276276 /*
277277 * we neither want a sound buffer overflow nor underflow, so we need to match
arch/mips/Kconfig+19−2
@@ -13,6 +13,7 @@ config MIPS · 12 unmodified lines
1313 select HAVE_KPROBES
1414 select HAVE_KRETPROBES
1515 select RTC_LIB if !MACH_LOONGSON
16+ select GENERIC_ATOMIC64 if !64BIT
1617
1718 mainmenu "Linux/MIPS Kernel Configuration"
1819
@@ -1646,8 +1647,16 @@ config MIPS_MT_SMP · 1627 unmodified lines
16461647 select SYS_SUPPORTS_SMP
16471648 select SMP_UP
16481649 help
1649− This is a kernel model which is also known a VSMP or lately
1650− has been marketesed into SMVP.
1650+ This is a kernel model which is known a VSMP but lately has been
1651+ marketesed into SMVP.
1652+ Virtual SMP uses the processor's VPEs to implement virtual
1653+ processors. In currently available configuration of the 34K processor
1654+ this allows for a dual processor. Both processors will share the same
1655+ primary caches; each will obtain the half of the TLB for it's own
1656+ exclusive use. For a layman this model can be described as similar to
1657+ what Intel calls Hyperthreading.
1658+
1659+ For further information see http://www.linux-mips.org/wiki/34K#VSMP
16511660
16521661 config MIPS_MT_SMTC
16531662 bool "SMTC: Use all TCs on all VPEs for SMP"
@@ -1664,6 +1673,14 @@ config MIPS_MT_SMTC · 10 unmodified lines
16641673 help
16651674 This is a kernel model which is known a SMTC or lately has been
16661675 marketesed into SMVP.
1676+ is presenting the available TC's of the core as processors to Linux.
1677+ On currently available 34K processors this means a Linux system will
1678+ see up to 5 processors. The implementation of the SMTC kernel differs
1679+ significantly from VSMP and cannot efficiently coexist in the same
1680+ kernel binary so the choice between VSMP and SMTC is a compile time
1681+ decision.
1682+
1683+ For further information see http://www.linux-mips.org/wiki/34K#SMTC
16671684
16681685 endchoice
16691686
arch/mips/alchemy/common/prom.c+2−3
@@ -43,7 +43,7 @@ int prom_argc; · 42 unmodified lines
4343 char **prom_argv;
4444 char **prom_envp;
4545
46−void prom_init_cmdline(void)
46+void __init prom_init_cmdline(void)
4747 {
4848 int i;
4949
@@ -104,7 +104,7 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str) · 54 unmodified lines
104104 }
105105 }
106106
107−int prom_get_ethernet_addr(char *ethernet_addr)
107+int __init prom_get_ethernet_addr(char *ethernet_addr)
108108 {
109109 char *ethaddr_str;
110110
@@ -123,7 +123,6 @@ int prom_get_ethernet_addr(char *ethernet_addr) · 12 unmodified lines
123123
124124 return 0;
125125 }
126−EXPORT_SYMBOL(prom_get_ethernet_addr);
127126
128127 void __init prom_free_prom_memory(void)
129128 {
arch/mips/boot/compressed/Makefile+1−1
@@ -59,7 +59,7 @@ $(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE · 58 unmodified lines
5959 hostprogs-y := calc_vmlinuz_load_addr
6060
6161 VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \
62− $(objtree)/$(KBUILD_IMAGE) $(VMLINUX_LOAD_ADDRESS))
62+ $(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS))
6363
6464 vmlinuzobjs-y += $(obj)/piggy.o
6565
arch/mips/cavium-octeon/Kconfig+4−0
@@ -83,3 +83,7 @@ config ARCH_SPARSEMEM_ENABLE · 82 unmodified lines
8383 def_bool y
8484 select SPARSEMEM_STATIC
8585 depends on CPU_CAVIUM_OCTEON
86+
87+config CAVIUM_OCTEON_HELPER
88+ def_bool y
89+ depends on OCTEON_ETHERNET || PCI
arch/mips/cavium-octeon/cpu.c+1−1
@@ -41,7 +41,7 @@ static int cnmips_cu2_call(struct notifier_block *nfb, unsigned long action, · 40 unmodified lines
4141 return NOTIFY_OK; /* Let default notifier send signals */
4242 }
4343
44−static int cnmips_cu2_setup(void)
44+static int __init cnmips_cu2_setup(void)
4545 {
4646 return cu2_notifier(cnmips_cu2_call, 0);
4747 }
arch/mips/cavium-octeon/executive/Makefile+1−1
@@ -11,4 +11,4 @@ · 10 unmodified lines
1111
1212 obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o
1313
14−obj-$(CONFIG_PCI) += cvmx-helper-errata.o cvmx-helper-jtag.o
14+obj-$(CONFIG_CAVIUM_OCTEON_HELPER) += cvmx-helper-errata.o cvmx-helper-jtag.o
arch/mips/include/asm/atomic.h+4−0
@@ -782,6 +782,10 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) · 781 unmodified lines
782782 */
783783 #define atomic64_add_negative(i, v) (atomic64_add_return(i, (v)) < 0)
784784
785+#else /* !CONFIG_64BIT */
786+
787+#include <asm-generic/atomic64.h>
788+
785789 #endif /* CONFIG_64BIT */
786790
787791 /*
arch/mips/include/asm/cop2.h+1−1
@@ -24,7 +24,7 @@ extern int cu2_notifier_call_chain(unsigned long val, void *v); · 23 unmodified lines
2424
2525 #define cu2_notifier(fn, pri) \
2626 ({ \
27− static struct notifier_block fn##_nb __cpuinitdata = { \
27+ static struct notifier_block fn##_nb = { \
2828 .notifier_call = fn, \
2929 .priority = pri \
3030 }; \
arch/mips/include/asm/gic.h+1−0
@@ -321,6 +321,7 @@ struct gic_intrmask_regs { · 320 unmodified lines
321321 */
322322 struct gic_intr_map {
323323 unsigned int cpunum; /* Directed to this CPU */
324+#define GIC_UNUSED 0xdead /* Dummy data */
324325 unsigned int pin; /* Directed to this Pin */
325326 unsigned int polarity; /* Polarity : +/- */
326327 unsigned int trigtype; /* Trigger : Edge/Levl */
arch/mips/include/asm/mach-tx49xx/kmalloc.h+1−1
@@ -1,6 +1,6 @@
11 #ifndef __ASM_MACH_TX49XX_KMALLOC_H
22 #define __ASM_MACH_TX49XX_KMALLOC_H
33
4−#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
4+#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
55
66 #endif /* __ASM_MACH_TX49XX_KMALLOC_H */
arch/mips/include/asm/mips-boards/maltaint.h+0−3
@@ -88,9 +88,6 @@ · 87 unmodified lines
8888
8989 #define GIC_EXT_INTR(x) x
9090
91−/* Dummy data */
92−#define X 0xdead
93−
9491 /* External Interrupts used for IPI */
9592 #define GIC_IPI_EXT_INTR_RESCHED_VPE0 16
9693 #define GIC_IPI_EXT_INTR_CALLFNC_VPE0 17
arch/mips/include/asm/page.h+14−0
@@ -150,6 +150,20 @@ typedef struct { unsigned long pgprot; } pgprot_t; · 149 unmodified lines
150150 ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)
151151 #endif
152152 #define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
153+
154+/*
155+ * RELOC_HIDE was originally added by 6007b903dfe5f1d13e0c711ac2894bdd4a61b1ad
156+ * (lmo) rsp. 8431fd094d625b94d364fe393076ccef88e6ce18 (kernel.org). The
157+ * discussion can be found in lkml posting
158+ * <a2ebde260608230500o3407b108hc03debb9da6e62c@mail.gmail.com> which is
159+ * archived at http://lists.linuxcoding.com/kernel/2006-q3/msg17360.html
160+ *
161+ * It is unclear if the misscompilations mentioned in
162+ * http://lkml.org/lkml/2010/8/8/138 also affect MIPS so we keep this one
163+ * until GCC 3.x has been retired before we can apply
164+ * https://patchwork.linux-mips.org/patch/1541/
165+ */
166+
153167 #define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))
154168
155169 #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
arch/mips/include/asm/thread_info.h+2−1
@@ -146,7 +146,8 @@ register struct thread_info *__current_thread_info __asm__("$28"); · 145 unmodified lines
146146 #define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH)
147147
148148 /* work to do on interrupt/exception return */
149−#define _TIF_WORK_MASK (0x0000ffef & ~_TIF_SECCOMP)
149+#define _TIF_WORK_MASK (0x0000ffef & \
150+ ~(_TIF_SECCOMP | _TIF_SYSCALL_AUDIT))
150151 /* work to do on any return to u-space */
151152 #define _TIF_ALLWORK_MASK (0x8000ffff & ~_TIF_SECCOMP)
152153
arch/mips/include/asm/unistd.h+15−6
@@ -356,16 +356,19 @@ · 355 unmodified lines
356356 #define __NR_perf_event_open (__NR_Linux + 333)
357357 #define __NR_accept4 (__NR_Linux + 334)
358358 #define __NR_recvmmsg (__NR_Linux + 335)
359+#define __NR_fanotify_init (__NR_Linux + 336)
360+#define __NR_fanotify_mark (__NR_Linux + 337)
361+#define __NR_prlimit64 (__NR_Linux + 338)
359362
360363 /*
361364 * Offset of the last Linux o32 flavoured syscall
362365 */
363−#define __NR_Linux_syscalls 335
366+#define __NR_Linux_syscalls 338
364367
365368 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
366369
367370 #define __NR_O32_Linux 4000
368−#define __NR_O32_Linux_syscalls 335
371+#define __NR_O32_Linux_syscalls 338
369372
370373 #if _MIPS_SIM == _MIPS_SIM_ABI64
371374
@@ -668,16 +671,19 @@ · 296 unmodified lines
668671 #define __NR_perf_event_open (__NR_Linux + 292)
669672 #define __NR_accept4 (__NR_Linux + 293)
670673 #define __NR_recvmmsg (__NR_Linux + 294)
674+#define __NR_fanotify_init (__NR_Linux + 295)
675+#define __NR_fanotify_mark (__NR_Linux + 296)
676+#define __NR_prlimit64 (__NR_Linux + 297)
671677
672678 /*
673679 * Offset of the last Linux 64-bit flavoured syscall
674680 */
675−#define __NR_Linux_syscalls 294
681+#define __NR_Linux_syscalls 297
676682
677683 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
678684
679685 #define __NR_64_Linux 5000
680−#define __NR_64_Linux_syscalls 294
686+#define __NR_64_Linux_syscalls 297
681687
682688 #if _MIPS_SIM == _MIPS_SIM_NABI32
683689
@@ -985,16 +991,19 @@ · 301 unmodified lines
985991 #define __NR_accept4 (__NR_Linux + 297)
986992 #define __NR_recvmmsg (__NR_Linux + 298)
987993 #define __NR_getdents64 (__NR_Linux + 299)
994+#define __NR_fanotify_init (__NR_Linux + 300)
995+#define __NR_fanotify_mark (__NR_Linux + 301)
996+#define __NR_prlimit64 (__NR_Linux + 302)
988997
989998 /*
990999 * Offset of the last N32 flavoured syscall
9911000 */
992−#define __NR_Linux_syscalls 299
1001+#define __NR_Linux_syscalls 302
9931002
9941003 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
9951004
9961005 #define __NR_N32_Linux 6000
997−#define __NR_N32_Linux_syscalls 299
1006+#define __NR_N32_Linux_syscalls 302
9981007
9991008 #ifdef __KERNEL__
10001009
arch/mips/kernel/irq-gic.c+2−3
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 #include <asm/io.h>
88 #include <asm/gic.h>
99 #include <asm/gcmpregs.h>
10−#include <asm/mips-boards/maltaint.h>
1110 #include <asm/irq.h>
1211 #include <linux/hardirq.h>
1312 #include <asm-generic/bitops/find.h>
@@ -131,7 +130,7 @@ static int gic_set_affinity(unsigned int irq, const struct cpumask *cpumask) · 117 unmodified lines
131130 int i;
132131
133132 irq -= _irqbase;
134− pr_debug(KERN_DEBUG "%s(%d) called\n", __func__, irq);
133+ pr_debug("%s(%d) called\n", __func__, irq);
135134 cpumask_and(&tmp, cpumask, cpu_online_mask);
136135 if (cpus_empty(tmp))
137136 return -1;
@@ -222,7 +221,7 @@ static void __init gic_basic_init(int numintrs, int numvpes, · 84 unmodified lines
222221 /* Setup specifics */
223222 for (i = 0; i < mapsize; i++) {
224223 cpu = intrmap[i].cpunum;
225− if (cpu == X)
224+ if (cpu == GIC_UNUSED)
226225 continue;
227226 if (cpu == 0 && i != 0 && intrmap[i].flags == 0)
228227 continue;
arch/mips/kernel/kgdb.c+1−1
@@ -283,7 +283,7 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd, · 282 unmodified lines
283283 struct pt_regs *regs = args->regs;
284284 int trap = (regs->cp0_cause & 0x7c) >> 2;
285285
286− /* Userpace events, ignore. */
286+ /* Userspace events, ignore. */
287287 if (user_mode(regs))
288288 return NOTIFY_DONE;
289289
arch/mips/kernel/kspd.c+1−1
@@ -251,7 +251,7 @@ void sp_work_handle_request(void) · 250 unmodified lines
251251 memset(&tz, 0, sizeof(tz));
252252 if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv,
253253 (int)&tz, 0, 0)) == 0)
254− ret.retval = tv.tv_sec;
254+ ret.retval = tv.tv_sec;
255255 break;
256256
257257 case MTSP_SYSCALL_EXIT:
arch/mips/kernel/linux32.c+7−0
@@ -341,3 +341,10 @@ asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf, · 340 unmodified lines
341341 {
342342 return sys_lookup_dcookie(merge_64(a0, a1), buf, len);
343343 }
344+
345+SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags,
346+ u64, a3, u64, a4, int, dfd, const char __user *, pathname)
347+{
348+ return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4),
349+ dfd, pathname);
350+}
arch/mips/kernel/scall32-o32.S+4−1
@@ -583,7 +583,10 @@ einval: li v0, -ENOSYS · 582 unmodified lines
583583 sys sys_rt_tgsigqueueinfo 4
584584 sys sys_perf_event_open 5
585585 sys sys_accept4 4
586− sys sys_recvmmsg 5
586+ sys sys_recvmmsg 5 /* 4335 */
587+ sys sys_fanotify_init 2
588+ sys sys_fanotify_mark 6
589+ sys sys_prlimit64 4
587590 .endm
588591
589592 /* We pre-compute the number of _instruction_ bytes needed to
arch/mips/kernel/scall64-64.S+5−2
@@ -416,9 +416,12 @@ sys_call_table: · 415 unmodified lines
416416 PTR sys_pipe2
417417 PTR sys_inotify_init1
418418 PTR sys_preadv
419− PTR sys_pwritev /* 5390 */
419+ PTR sys_pwritev /* 5290 */
420420 PTR sys_rt_tgsigqueueinfo
421421 PTR sys_perf_event_open
422422 PTR sys_accept4
423− PTR sys_recvmmsg
423+ PTR sys_recvmmsg
424+ PTR sys_fanotify_init /* 5295 */
425+ PTR sys_fanotify_mark
426+ PTR sys_prlimit64
424427 .size sys_call_table,.-sys_call_table
arch/mips/kernel/scall64-n32.S+4−1
@@ -419,5 +419,8 @@ EXPORT(sysn32_call_table) · 418 unmodified lines
419419 PTR sys_perf_event_open
420420 PTR sys_accept4
421421 PTR compat_sys_recvmmsg
422− PTR sys_getdents
422+ PTR sys_getdents64
423+ PTR sys_fanotify_init /* 6300 */
424+ PTR sys_fanotify_mark
425+ PTR sys_prlimit64
423426 .size sysn32_call_table,.-sysn32_call_table
arch/mips/kernel/scall64-o32.S+4−1
@@ -538,5 +538,8 @@ sys_call_table: · 537 unmodified lines
538538 PTR compat_sys_rt_tgsigqueueinfo
539539 PTR sys_perf_event_open
540540 PTR sys_accept4
541− PTR compat_sys_recvmmsg
541+ PTR compat_sys_recvmmsg /* 4335 */
542+ PTR sys_fanotify_init
543+ PTR sys_32_fanotify_mark
544+ PTR sys_prlimit64
542545 .size sys_call_table,.-sys_call_table
arch/mips/mm/dma-default.c+20−8
@@ -44,27 +44,39 @@ static inline int cpu_is_noncoherent_r10000(struct device *dev) · 43 unmodified lines
4444
4545 static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
4646 {
47+ gfp_t dma_flag;
48+
4749 /* ignore region specifiers */
4850 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
4951
50−#ifdef CONFIG_ZONE_DMA
52+#ifdef CONFIG_ISA
5153 if (dev == NULL)
52− gfp |= __GFP_DMA;
53− else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
54− gfp |= __GFP_DMA;
54+ dma_flag = __GFP_DMA;
5555 else
5656 #endif
57−#ifdef CONFIG_ZONE_DMA32
57+#if defined(CONFIG_ZONE_DMA32) && defined(CONFIG_ZONE_DMA)
5858 if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
59− gfp |= __GFP_DMA32;
59+ dma_flag = __GFP_DMA;
60+ else if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
61+ dma_flag = __GFP_DMA32;
62+ else
63+#endif
64+#if defined(CONFIG_ZONE_DMA32) && !defined(CONFIG_ZONE_DMA)
65+ if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
66+ dma_flag = __GFP_DMA32;
67+ else
68+#endif
69+#if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32)
70+ if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
71+ dma_flag = __GFP_DMA;
6072 else
6173 #endif
62− ;
74+ dma_flag = 0;
6375
6476 /* Don't invoke OOM killer */
6577 gfp |= __GFP_NORETRY;
6678
67− return gfp;
79+ return gfp | dma_flag;
6880 }
6981
7082 void *dma_alloc_noncoherent(struct device *dev, size_t size,
arch/mips/mm/sc-rm7k.c+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #define tc_lsize 32
3131
3232 extern unsigned long icache_way_size, dcache_way_size;
33−unsigned long tcache_size;
33+static unsigned long tcache_size;
3434
3535 #include <asm/r4kcache.h>
3636
arch/mips/mti-malta/malta-int.c+3−0
@@ -385,6 +385,8 @@ static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap); · 384 unmodified lines
385385 */
386386
387387 #define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK
388+#define X GIC_UNUSED
389+
388390 static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
389391 { X, X, X, X, 0 },
390392 { X, X, X, X, 0 },
@@ -404,6 +406,7 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { · 13 unmodified lines
404406 { X, X, X, X, 0 },
405407 /* The remainder of this table is initialised by fill_ipi_map */
406408 };
409+#undef X
407410
408411 /*
409412 * GCMP needs to be detected before any SMP initialisation
arch/mips/pci/pci-rc32434.c+1−1
@@ -118,7 +118,7 @@ static int __init rc32434_pcibridge_init(void) · 117 unmodified lines
118118 if (!((pcicvalue == PCIM_H_EA) ||
119119 (pcicvalue == PCIM_H_IA_FIX) ||
120120 (pcicvalue == PCIM_H_IA_RR))) {
121− pr_err(KERN_ERR "PCI init error!!!\n");
121+ pr_err("PCI init error!!!\n");
122122 /* Not in Host Mode, return ERROR */
123123 return -1;
124124 }
arch/mips/pnx8550/common/reset.c+5−15
@@ -22,29 +22,19 @@ · 21 unmodified lines
2222 */
2323 #include <linux/kernel.h>
2424
25+#include <asm/processor.h>
2526 #include <asm/reboot.h>
2627 #include <glb.h>
2728
2829 void pnx8550_machine_restart(char *command)
2930 {
30− char head[] = "************* Machine restart *************";
31− char foot[] = "*******************************************";
32−
33− printk("\n\n");
34− printk("%s\n", head);
35− if (command != NULL)
36− printk("* %s\n", command);
37− printk("%s\n", foot);
38−
3931 PNX8550_RST_CTL = PNX8550_RST_DO_SW_RST;
4032 }
4133
4234 void pnx8550_machine_halt(void)
4335 {
44− printk("*** Machine halt. (Not implemented) ***\n");
45−}
46−
47−void pnx8550_machine_power_off(void)
48−{
49− printk("*** Machine power off. (Not implemented) ***\n");
36+ while (1) {
37+ if (cpu_wait)
38+ cpu_wait();
39+ }
5040 }
arch/mips/pnx8550/common/setup.c+1−2
@@ -44,7 +44,6 @@ · 43 unmodified lines
4444 extern void __init board_setup(void);
4545 extern void pnx8550_machine_restart(char *);
4646 extern void pnx8550_machine_halt(void);
47−extern void pnx8550_machine_power_off(void);
4847 extern struct resource ioport_resource;
4948 extern struct resource iomem_resource;
5049 extern char *prom_getcmdline(void);
@@ -100,7 +99,7 @@ void __init plat_mem_setup(void) · 49 unmodified lines
10099
101100 _machine_restart = pnx8550_machine_restart;
102101 _machine_halt = pnx8550_machine_halt;
103− pm_power_off = pnx8550_machine_power_off;
102+ pm_power_off = pnx8550_machine_halt;
104103
105104 /* Clear the Global 2 Register, PCI Inta Output Enable Registers
106105 Bit 1:Enable DAC Powerdown
arch/mn10300/Kconfig+0−1
@@ -8,7 +8,6 @@ mainmenu "Linux Kernel Configuration" · 7 unmodified lines
88 config MN10300
99 def_bool y
1010 select HAVE_OPROFILE
11− select HAVE_ARCH_TRACEHOOK
1211
1312 config AM33
1413 def_bool y
arch/mn10300/Kconfig.debug+1−1
@@ -101,7 +101,7 @@ config GDBSTUB_DEBUG_BREAKPOINT · 100 unmodified lines
101101
102102 choice
103103 prompt "GDB stub port"
104− default GDBSTUB_TTYSM0
104+ default GDBSTUB_ON_TTYSM0
105105 depends on GDBSTUB
106106 help
107107 Select the serial port used for GDB-stub.
arch/mn10300/include/asm/bitops.h+2−2
@@ -229,9 +229,9 @@ int ffs(int x) · 228 unmodified lines
229229 #include <asm-generic/bitops/hweight.h>
230230
231231 #define ext2_set_bit_atomic(lock, nr, addr) \
232− test_and_set_bit((nr) ^ 0x18, (addr))
232+ test_and_set_bit((nr), (addr))
233233 #define ext2_clear_bit_atomic(lock, nr, addr) \
234− test_and_clear_bit((nr) ^ 0x18, (addr))
234+ test_and_clear_bit((nr), (addr))
235235
236236 #include <asm-generic/bitops/ext2-non-atomic.h>
237237 #include <asm-generic/bitops/minix-le.h>
arch/mn10300/include/asm/signal.h+1−1
@@ -78,7 +78,7 @@ typedef unsigned long sigset_t; · 77 unmodified lines
7878
7979 /* These should not be considered constants from userland. */
8080 #define SIGRTMIN 32
81−#define SIGRTMAX (_NSIG-1)
81+#define SIGRTMAX _NSIG
8282
8383 /*
8484 * SA_FLAGS values:
arch/mn10300/kernel/module.c+1−2
@@ -206,7 +206,7 @@ int module_finalize(const Elf_Ehdr *hdr, · 205 unmodified lines
206206 const Elf_Shdr *sechdrs,
207207 struct module *me)
208208 {
209− return module_bug_finalize(hdr, sechdrs, me);
209+ return 0;
210210 }
211211
212212 /*
@@ -214,5 +214,4 @@ int module_finalize(const Elf_Ehdr *hdr, · 1 unmodified line
214214 */
215215 void module_arch_cleanup(struct module *mod)
216216 {
217− module_bug_cleanup(mod);
218217 }
arch/mn10300/kernel/signal.c+20−15
@@ -65,10 +65,10 @@ asmlinkage long sys_sigaction(int sig, · 64 unmodified lines
6565 old_sigset_t mask;
6666 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
6767 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
68− __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
68+ __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
69+ __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
70+ __get_user(mask, &act->sa_mask))
6971 return -EFAULT;
70− __get_user(new_ka.sa.sa_flags, &act->sa_flags);
71− __get_user(mask, &act->sa_mask);
7272 siginitset(&new_ka.sa.sa_mask, mask);
7373 }
7474
@@ -77,10 +77,10 @@ asmlinkage long sys_sigaction(int sig, · 2 unmodified lines
7777 if (!ret && oact) {
7878 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
7979 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
80− __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
80+ __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
81+ __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
82+ __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
8183 return -EFAULT;
82− __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
83− __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
8484 }
8585
8686 return ret;
@@ -102,6 +102,9 @@ static int restore_sigcontext(struct pt_regs *regs, · 15 unmodified lines
102102 {
103103 unsigned int err = 0;
104104
105+ /* Always make any pending restarted system calls return -EINTR */
106+ current_thread_info()->restart_block.fn = do_no_restart_syscall;
107+
105108 if (is_using_fpu(current))
106109 fpu_kill_state(current);
107110
@@ -330,8 +333,6 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, · 222 unmodified lines
330333 regs->d0 = sig;
331334 regs->d1 = (unsigned long) &frame->sc;
332335
333− set_fs(USER_DS);
334−
335336 /* the tracer may want to single-step inside the handler */
336337 if (test_thread_flag(TIF_SINGLESTEP))
337338 ptrace_notify(SIGTRAP);
@@ -345,7 +346,7 @@ static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, · 7 unmodified lines
345346 return 0;
346347
347348 give_sigsegv:
348− force_sig(SIGSEGV, current);
349+ force_sigsegv(sig, current);
349350 return -EFAULT;
350351 }
351352
@@ -413,8 +414,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, · 61 unmodified lines
413414 regs->d0 = sig;
414415 regs->d1 = (long) &frame->info;
415416
416− set_fs(USER_DS);
417−
418417 /* the tracer may want to single-step inside the handler */
419418 if (test_thread_flag(TIF_SINGLESTEP))
420419 ptrace_notify(SIGTRAP);
@@ -428,10 +427,16 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, · 7 unmodified lines
428427 return 0;
429428
430429 give_sigsegv:
431− force_sig(SIGSEGV, current);
430+ force_sigsegv(sig, current);
432431 return -EFAULT;
433432 }
434433
434+static inline void stepback(struct pt_regs *regs)
435+{
436+ regs->pc -= 2;
437+ regs->orig_d0 = -1;
438+}
439+
435440 /*
436441 * handle the actual delivery of a signal to userspace
437442 */
@@ -459,7 +464,7 @@ static int handle_signal(int sig, · 21 unmodified lines
459464 /* fallthrough */
460465 case -ERESTARTNOINTR:
461466 regs->d0 = regs->orig_d0;
462− regs->pc -= 2;
467+ stepback(regs);
463468 }
464469 }
465470
@@ -527,12 +532,12 @@ static void do_signal(struct pt_regs *regs) · 61 unmodified lines
527532 case -ERESTARTSYS:
528533 case -ERESTARTNOINTR:
529534 regs->d0 = regs->orig_d0;
530− regs->pc -= 2;
535+ stepback(regs);
531536 break;
532537
533538 case -ERESTART_RESTARTBLOCK:
534539 regs->d0 = __NR_restart_syscall;
535− regs->pc -= 2;
540+ stepback(regs);
536541 break;
537542 }
538543 }
arch/mn10300/mm/Makefile+6−8
@@ -2,13 +2,11 @@ · 1 unmodified line
22 # Makefile for the MN10300-specific memory management code
33 #
44
5+cacheflush-y := cache.o cache-mn10300.o
6+cacheflush-$(CONFIG_MN10300_CACHE_WBACK) += cache-flush-mn10300.o
7+
8+cacheflush-$(CONFIG_MN10300_CACHE_DISABLED) := cache-disabled.o
9+
510 obj-y := \
611 init.o fault.o pgtable.o extable.o tlb-mn10300.o mmu-context.o \
7− misalignment.o dma-alloc.o
8−
9−ifneq ($(CONFIG_MN10300_CACHE_DISABLED),y)
10−obj-y += cache.o cache-mn10300.o
11−ifeq ($(CONFIG_MN10300_CACHE_WBACK),y)
12−obj-y += cache-flush-mn10300.o
13−endif
14−endif
12+ misalignment.o dma-alloc.o $(cacheflush-y)
arch/mn10300/mm/cache-disabled.c+21−0
@@ -0,0 +1,21 @@
1+/* Handle the cache being disabled
2+ *
3+ * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved.
4+ * Written by David Howells (dhowells@redhat.com)
5+ *
6+ * This program is free software; you can redistribute it and/or
7+ * modify it under the terms of the GNU General Public Licence
8+ * as published by the Free Software Foundation; either version
9+ * 2 of the Licence, or (at your option) any later version.
10+ */
11+#include <linux/mm.h>
12+
13+/*
14+ * allow userspace to flush the instruction cache
15+ */
16+asmlinkage long sys_cacheflush(unsigned long start, unsigned long end)
17+{
18+ if (end < start)
19+ return -EINVAL;
20+ return 0;
21+}
arch/mn10300/mm/cache.c+19−1
@@ -54,13 +54,30 @@ EXPORT_SYMBOL(flush_icache_page); · 53 unmodified lines
5454 void flush_icache_range(unsigned long start, unsigned long end)
5555 {
5656 #ifdef CONFIG_MN10300_CACHE_WBACK
57− unsigned long addr, size, off;
57+ unsigned long addr, size, base, off;
5858 struct page *page;
5959 pgd_t *pgd;
6060 pud_t *pud;
6161 pmd_t *pmd;
6262 pte_t *ppte, pte;
6363
64+ if (end > 0x80000000UL) {
65+ /* addresses above 0xa0000000 do not go through the cache */
66+ if (end > 0xa0000000UL) {
67+ end = 0xa0000000UL;
68+ if (start >= end)
69+ return;
70+ }
71+
72+ /* kernel addresses between 0x80000000 and 0x9fffffff do not
73+ * require page tables, so we just map such addresses directly */
74+ base = (start >= 0x80000000UL) ? start : 0x80000000UL;
75+ mn10300_dcache_flush_range(base, end);
76+ if (base == start)
77+ goto invalidate;
78+ end = base;
79+ }
80+
6481 for (; start < end; start += size) {
6582 /* work out how much of the page to flush */
6683 off = start & (PAGE_SIZE - 1);
@@ -104,6 +121,7 @@ void flush_icache_range(unsigned long start, unsigned long end) · 37 unmodified lines
104121 }
105122 #endif
106123
124+invalidate:
107125 mn10300_icache_inv();
108126 }
109127 EXPORT_SYMBOL(flush_icache_range);
arch/parisc/kernel/module.c+1−2
@@ -941,11 +941,10 @@ int module_finalize(const Elf_Ehdr *hdr, · 940 unmodified lines
941941 nsyms = newptr - (Elf_Sym *)symhdr->sh_addr;
942942 DEBUGP("NEW num_symtab %lu\n", nsyms);
943943 symhdr->sh_size = nsyms * sizeof(Elf_Sym);
944− return module_bug_finalize(hdr, sechdrs, me);
944+ return 0;
945945 }
946946
947947 void module_arch_cleanup(struct module *mod)
948948 {
949949 deregister_unwind_table(mod);
950− module_bug_cleanup(mod);
951950 }
arch/powerpc/kernel/module.c+0−6
@@ -63,11 +63,6 @@ int module_finalize(const Elf_Ehdr *hdr, · 62 unmodified lines
6363 const Elf_Shdr *sechdrs, struct module *me)
6464 {
6565 const Elf_Shdr *sect;
66− int err;
67−
68− err = module_bug_finalize(hdr, sechdrs, me);
69− if (err)
70− return err;
7166
7267 /* Apply feature fixups */
7368 sect = find_section(hdr, sechdrs, "__ftr_fixup");
@@ -101,5 +96,4 @@ int module_finalize(const Elf_Ehdr *hdr, · 27 unmodified lines
10196
10297 void module_arch_cleanup(struct module *mod)
10398 {
104− module_bug_cleanup(mod);
10599 }
arch/powerpc/platforms/512x/clock.c+1−1
@@ -57,7 +57,7 @@ static struct clk *mpc5121_clk_get(struct device *dev, const char *id) · 56 unmodified lines
5757 int id_match = 0;
5858
5959 if (dev == NULL || id == NULL)
60− return NULL;
60+ return clk;
6161
6262 mutex_lock(&clocks_mutex);
6363 list_for_each_entry(p, &clocks, node) {
arch/powerpc/platforms/52xx/efika.c+6−3
@@ -99,7 +99,7 @@ static void __init efika_pcisetup(void) · 98 unmodified lines
9999 if (bus_range == NULL || len < 2 * sizeof(int)) {
100100 printk(KERN_WARNING EFIKA_PLATFORM_NAME
101101 ": Can't get bus-range for %s\n", pcictrl->full_name);
102− return;
102+ goto out_put;
103103 }
104104
105105 if (bus_range[1] == bus_range[0])
@@ -111,12 +111,12 @@ static void __init efika_pcisetup(void) · 5 unmodified lines
111111 printk(" controlled by %s\n", pcictrl->full_name);
112112 printk("\n");
113113
114− hose = pcibios_alloc_controller(of_node_get(pcictrl));
114+ hose = pcibios_alloc_controller(pcictrl);
115115 if (!hose) {
116116 printk(KERN_WARNING EFIKA_PLATFORM_NAME
117117 ": Can't allocate PCI controller structure for %s\n",
118118 pcictrl->full_name);
119− return;
119+ goto out_put;
120120 }
121121
122122 hose->first_busno = bus_range[0];
@@ -124,6 +124,9 @@ static void __init efika_pcisetup(void) · 1 unmodified line
124124 hose->ops = &rtas_pci_ops;
125125
126126 pci_process_bridge_OF_ranges(hose, pcictrl, 0);
127+ return;
128+out_put:
129+ of_node_put(pcictrl);
127130 }
128131
129132 #else
arch/powerpc/platforms/52xx/mpc52xx_common.c+6−2
@@ -325,12 +325,16 @@ int mpc5200_psc_ac97_gpio_reset(int psc_number) · 324 unmodified lines
325325 clrbits32(&simple_gpio->simple_dvo, sync | out);
326326 clrbits8(&wkup_gpio->wkup_dvo, reset);
327327
328− /* wait at lease 1 us */
329− udelay(2);
328+ /* wait for 1 us */
329+ udelay(1);
330330
331331 /* Deassert reset */
332332 setbits8(&wkup_gpio->wkup_dvo, reset);
333333
334+ /* wait at least 200ns */
335+ /* 7 ~= (200ns * timebase) / ns2sec */
336+ __delay(7);
337+
334338 /* Restore pin-muxing */
335339 out_be32(&simple_gpio->port_config, mux);
336340
arch/s390/kernel/module.c+1−2
@@ -407,10 +407,9 @@ int module_finalize(const Elf_Ehdr *hdr, · 406 unmodified lines
407407 {
408408 vfree(me->arch.syminfo);
409409 me->arch.syminfo = NULL;
410− return module_bug_finalize(hdr, sechdrs, me);
410+ return 0;
411411 }
412412
413413 void module_arch_cleanup(struct module *mod)
414414 {
415− module_bug_cleanup(mod);
416415 }
arch/sh/kernel/module.c+0−2
@@ -149,13 +149,11 @@ int module_finalize(const Elf_Ehdr *hdr, · 148 unmodified lines
149149 int ret = 0;
150150
151151 ret |= module_dwarf_finalize(hdr, sechdrs, me);
152− ret |= module_bug_finalize(hdr, sechdrs, me);
153152
154153 return ret;
155154 }
156155
157156 void module_arch_cleanup(struct module *mod)
158157 {
159− module_bug_cleanup(mod);
160158 module_dwarf_cleanup(mod);
161159 }
arch/tile/kernel/intvec_32.S+0−7
@@ -1506,13 +1506,6 @@ handle_ill: · 1505 unmodified lines
15061506 }
15071507 STD_ENDPROC(handle_ill)
15081508
1509− .pushsection .rodata, "a"
1510− .align 8
1511−bpt_code:
1512− bpt
1513− ENDPROC(bpt_code)
1514− .popsection
1515−
15161509 /* Various stub interrupt handlers and syscall handlers */
15171510
15181511 STD_ENTRY_LOCAL(_kernel_double_fault)
arch/um/drivers/net_kern.c+3−14
@@ -255,18 +255,6 @@ static void uml_net_tx_timeout(struct net_device *dev) · 254 unmodified lines
255255 netif_wake_queue(dev);
256256 }
257257
258−static int uml_net_set_mac(struct net_device *dev, void *addr)
259−{
260− struct uml_net_private *lp = netdev_priv(dev);
261− struct sockaddr *hwaddr = addr;
262−
263− spin_lock_irq(&lp->lock);
264− eth_mac_addr(dev, hwaddr->sa_data);
265− spin_unlock_irq(&lp->lock);
266−
267− return 0;
268−}
269−
270258 static int uml_net_change_mtu(struct net_device *dev, int new_mtu)
271259 {
272260 dev->mtu = new_mtu;
@@ -373,7 +361,7 @@ static const struct net_device_ops uml_netdev_ops = { · 100 unmodified lines
373361 .ndo_start_xmit = uml_net_start_xmit,
374362 .ndo_set_multicast_list = uml_net_set_multicast_list,
375363 .ndo_tx_timeout = uml_net_tx_timeout,
376− .ndo_set_mac_address = uml_net_set_mac,
364+ .ndo_set_mac_address = eth_mac_addr,
377365 .ndo_change_mtu = uml_net_change_mtu,
378366 .ndo_validate_addr = eth_validate_addr,
379367 };
@@ -472,7 +460,8 @@ static void eth_configure(int n, void *init, char *mac, · 92 unmodified lines
472460 ((*transport->user->init)(&lp->user, dev) != 0))
473461 goto out_unregister;
474462
475− eth_mac_addr(dev, device->mac);
463+ /* don't use eth_mac_addr, it will not work here */
464+ memcpy(dev->dev_addr, device->mac, ETH_ALEN);
476465 dev->mtu = transport->user->mtu;
477466 dev->netdev_ops = &uml_netdev_ops;
478467 dev->ethtool_ops = &uml_net_ethtool_ops;
arch/um/kernel/exec.c+3−3
@@ -62,7 +62,7 @@ static long execve1(const char *file, · 61 unmodified lines
6262 return error;
6363 }
6464
65−long um_execve(const char *file, char __user *__user *argv, char __user *__user *env)
65+long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env)
6666 {
6767 long err;
6868
@@ -72,8 +72,8 @@ long um_execve(const char *file, char __user *__user *argv, char __user *__user · 3 unmodified lines
7272 return err;
7373 }
7474
75−long sys_execve(const char __user *file, char __user *__user *argv,
76− char __user *__user *env)
75+long sys_execve(const char __user *file, const char __user *const __user *argv,
76+ const char __user *const __user *env)
7777 {
7878 long error;
7979 char *filename;
arch/um/kernel/internal.h+1−1
@@ -1 +1 @@
1−extern long um_execve(const char *file, char __user *__user *argv, char __user *__user *env);
1+extern long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env);
arch/um/kernel/syscall.c+2−2
@@ -60,8 +60,8 @@ int kernel_execve(const char *filename, · 59 unmodified lines
6060
6161 fs = get_fs();
6262 set_fs(KERNEL_DS);
63− ret = um_execve(filename, (char __user *__user *)argv,
64− (char __user *__user *) envp);
63+ ret = um_execve(filename, (const char __user *const __user *)argv,
64+ (const char __user *const __user *) envp);
6565 set_fs(fs);
6666
6767 return ret;
arch/x86/boot/early_serial_console.c+13−1
@@ -58,7 +58,19 @@ static void parse_earlyprintk(void) · 57 unmodified lines
5858 if (arg[pos] == ',')
5959 pos++;
6060
61− if (!strncmp(arg, "ttyS", 4)) {
61+ /*
62+ * make sure we have
63+ * "serial,0x3f8,115200"
64+ * "serial,ttyS0,115200"
65+ * "ttyS0,115200"
66+ */
67+ if (pos == 7 && !strncmp(arg + pos, "0x", 2)) {
68+ port = simple_strtoull(arg + pos, &e, 16);
69+ if (port == 0 || arg + pos == e)
70+ port = DEFAULT_SERIAL_PORT;
71+ else
72+ pos = e - arg;
73+ } else if (!strncmp(arg + pos, "ttyS", 4)) {
6274 static const int bases[] = { 0x3f8, 0x2f8 };
6375 int idx = 0;
6476
arch/x86/include/asm/amd_iommu_proto.h+6−0
@@ -38,4 +38,10 @@ static inline void amd_iommu_stats_init(void) { } · 37 unmodified lines
3838
3939 #endif /* !CONFIG_AMD_IOMMU_STATS */
4040
41+static inline bool is_rd890_iommu(struct pci_dev *pdev)
42+{
43+ return (pdev->vendor == PCI_VENDOR_ID_ATI) &&
44+ (pdev->device == PCI_DEVICE_ID_RD890_IOMMU);
45+}
46+
4147 #endif /* _ASM_X86_AMD_IOMMU_PROTO_H */
arch/x86/include/asm/amd_iommu_types.h+12−0
@@ -368,6 +368,9 @@ struct amd_iommu { · 367 unmodified lines
368368 /* capabilities of that IOMMU read from ACPI */
369369 u32 cap;
370370
371+ /* flags read from acpi table */
372+ u8 acpi_flags;
373+
371374 /*
372375 * Capability pointer. There could be more than one IOMMU per PCI
373376 * device function if there are more than one AMD IOMMU capability
@@ -411,6 +414,15 @@ struct amd_iommu { · 37 unmodified lines
411414
412415 /* default dma_ops domain for that IOMMU */
413416 struct dma_ops_domain *default_dom;
417+
418+ /*
419+ * This array is required to work around a potential BIOS bug.
420+ * The BIOS may miss to restore parts of the PCI configuration
421+ * space when the system resumes from S3. The result is that the
422+ * IOMMU does not execute commands anymore which leads to system
423+ * failure.
424+ */
425+ u32 cache_cfg[4];
414426 };
415427
416428 /*
arch/x86/include/asm/bitops.h+1−1
@@ -309,7 +309,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr) · 308 unmodified lines
309309 static __always_inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr)
310310 {
311311 return ((1UL << (nr % BITS_PER_LONG)) &
312− (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;
312+ (addr[nr / BITS_PER_LONG])) != 0;
313313 }
314314
315315 static inline int variable_test_bit(int nr, volatile const unsigned long *addr)
arch/x86/include/asm/cpufeature.h+1−0
@@ -168,6 +168,7 @@ · 167 unmodified lines
168168 #define X86_FEATURE_XSAVEOPT (7*32+ 4) /* Optimized Xsave */
169169 #define X86_FEATURE_PLN (7*32+ 5) /* Intel Power Limit Notification */
170170 #define X86_FEATURE_PTS (7*32+ 6) /* Intel Package Thermal Status */
171+#define X86_FEATURE_DTS (7*32+ 7) /* Digital Thermal Sensor */
171172
172173 /* Virtualization flags: Linux defined, word 8 */
173174 #define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */
arch/x86/kernel/acpi/cstate.c+1−1
@@ -61,7 +61,7 @@ struct cstate_entry { · 60 unmodified lines
6161 unsigned int ecx;
6262 } states[ACPI_PROCESSOR_MAX_POWER];
6363 };
64−static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */
64+static struct cstate_entry __percpu *cpu_cstate_entry; /* per CPU ptr */
6565
6666 static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];
6767
arch/x86/kernel/amd_iommu.c+3−1
@@ -1953,6 +1953,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, · 1952 unmodified lines
19531953 size_t size,
19541954 int dir)
19551955 {
1956+ dma_addr_t flush_addr;
19561957 dma_addr_t i, start;
19571958 unsigned int pages;
19581959
@@ -1960,6 +1961,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, · 1 unmodified line
19601961 (dma_addr + size > dma_dom->aperture_size))
19611962 return;
19621963
1964+ flush_addr = dma_addr;
19631965 pages = iommu_num_pages(dma_addr, size, PAGE_SIZE);
19641966 dma_addr &= PAGE_MASK;
19651967 start = dma_addr;
@@ -1974,7 +1976,7 @@ static void __unmap_single(struct dma_ops_domain *dma_dom, · 8 unmodified lines
19741976 dma_ops_free_addresses(dma_dom, dma_addr, pages);
19751977
19761978 if (amd_iommu_unmap_flush || dma_dom->need_flush) {
1977− iommu_flush_pages(&dma_dom->domain, dma_addr, size);
1979+ iommu_flush_pages(&dma_dom->domain, flush_addr, size);
19781980 dma_dom->need_flush = false;
19791981 }
19801982 }
arch/x86/kernel/amd_iommu_init.c+45−22
@@ -632,6 +632,13 @@ static void __init init_iommu_from_pci(struct amd_iommu *iommu) · 631 unmodified lines
632632 iommu->last_device = calc_devid(MMIO_GET_BUS(range),
633633 MMIO_GET_LD(range));
634634 iommu->evt_msi_num = MMIO_MSI_NUM(misc);
635+
636+ if (is_rd890_iommu(iommu->dev)) {
637+ pci_read_config_dword(iommu->dev, 0xf0, &iommu->cache_cfg[0]);
638+ pci_read_config_dword(iommu->dev, 0xf4, &iommu->cache_cfg[1]);
639+ pci_read_config_dword(iommu->dev, 0xf8, &iommu->cache_cfg[2]);
640+ pci_read_config_dword(iommu->dev, 0xfc, &iommu->cache_cfg[3]);
641+ }
635642 }
636643
637644 /*
@@ -649,29 +656,9 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, · 11 unmodified lines
649656 struct ivhd_entry *e;
650657
651658 /*
652− * First set the recommended feature enable bits from ACPI
653− * into the IOMMU control registers
659+ * First save the recommended feature enable bits from ACPI
654660 */
655− h->flags & IVHD_FLAG_HT_TUN_EN_MASK ?
656− iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) :
657− iommu_feature_disable(iommu, CONTROL_HT_TUN_EN);
658−
659− h->flags & IVHD_FLAG_PASSPW_EN_MASK ?
660− iommu_feature_enable(iommu, CONTROL_PASSPW_EN) :
661− iommu_feature_disable(iommu, CONTROL_PASSPW_EN);
662−
663− h->flags & IVHD_FLAG_RESPASSPW_EN_MASK ?
664− iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) :
665− iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN);
666−
667− h->flags & IVHD_FLAG_ISOC_EN_MASK ?
668− iommu_feature_enable(iommu, CONTROL_ISOC_EN) :
669− iommu_feature_disable(iommu, CONTROL_ISOC_EN);
670−
671− /*
672− * make IOMMU memory accesses cache coherent
673− */
674− iommu_feature_enable(iommu, CONTROL_COHERENT_EN);
661+ iommu->acpi_flags = h->flags;
675662
676663 /*
677664 * Done. Now parse the device entries
@@ -1116,6 +1103,40 @@ static void init_device_table(void) · 438 unmodified lines
11161103 }
11171104 }
11181105
1106+static void iommu_init_flags(struct amd_iommu *iommu)
1107+{
1108+ iommu->acpi_flags & IVHD_FLAG_HT_TUN_EN_MASK ?
1109+ iommu_feature_enable(iommu, CONTROL_HT_TUN_EN) :
1110+ iommu_feature_disable(iommu, CONTROL_HT_TUN_EN);
1111+
1112+ iommu->acpi_flags & IVHD_FLAG_PASSPW_EN_MASK ?
1113+ iommu_feature_enable(iommu, CONTROL_PASSPW_EN) :
1114+ iommu_feature_disable(iommu, CONTROL_PASSPW_EN);
1115+
1116+ iommu->acpi_flags & IVHD_FLAG_RESPASSPW_EN_MASK ?
1117+ iommu_feature_enable(iommu, CONTROL_RESPASSPW_EN) :
1118+ iommu_feature_disable(iommu, CONTROL_RESPASSPW_EN);
1119+
1120+ iommu->acpi_flags & IVHD_FLAG_ISOC_EN_MASK ?
1121+ iommu_feature_enable(iommu, CONTROL_ISOC_EN) :
1122+ iommu_feature_disable(iommu, CONTROL_ISOC_EN);
1123+
1124+ /*
1125+ * make IOMMU memory accesses cache coherent
1126+ */
1127+ iommu_feature_enable(iommu, CONTROL_COHERENT_EN);
1128+}
1129+
1130+static void iommu_apply_quirks(struct amd_iommu *iommu)
1131+{
1132+ if (is_rd890_iommu(iommu->dev)) {
1133+ pci_write_config_dword(iommu->dev, 0xf0, iommu->cache_cfg[0]);
1134+ pci_write_config_dword(iommu->dev, 0xf4, iommu->cache_cfg[1]);
1135+ pci_write_config_dword(iommu->dev, 0xf8, iommu->cache_cfg[2]);
1136+ pci_write_config_dword(iommu->dev, 0xfc, iommu->cache_cfg[3]);
1137+ }
1138+}
1139+
11191140 /*
11201141 * This function finally enables all IOMMUs found in the system after
11211142 * they have been initialized
@@ -1126,6 +1147,8 @@ static void enable_iommus(void) · 4 unmodified lines
11261147
11271148 for_each_iommu(iommu) {
11281149 iommu_disable(iommu);
1150+ iommu_apply_quirks(iommu);
1151+ iommu_init_flags(iommu);
11291152 iommu_set_device_table(iommu);
11301153 iommu_enable_command_buffer(iommu);
11311154 iommu_enable_event_buffer(iommu);
arch/x86/kernel/apic/io_apic.c+8−3
@@ -306,14 +306,19 @@ void arch_init_copy_chip_data(struct irq_desc *old_desc, · 305 unmodified lines
306306
307307 old_cfg = old_desc->chip_data;
308308
309− memcpy(cfg, old_cfg, sizeof(struct irq_cfg));
309+ cfg->vector = old_cfg->vector;
310+ cfg->move_in_progress = old_cfg->move_in_progress;
311+ cpumask_copy(cfg->domain, old_cfg->domain);
312+ cpumask_copy(cfg->old_domain, old_cfg->old_domain);
310313
311314 init_copy_irq_2_pin(old_cfg, cfg, node);
312315 }
313316
314−static void free_irq_cfg(struct irq_cfg *old_cfg)
317+static void free_irq_cfg(struct irq_cfg *cfg)
315318 {
316− kfree(old_cfg);
319+ free_cpumask_var(cfg->domain);
320+ free_cpumask_var(cfg->old_domain);
321+ kfree(cfg);
317322 }
318323
319324 void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
arch/x86/kernel/cpu/common.c+1−1
@@ -545,7 +545,7 @@ void __cpuinit cpu_detect(struct cpuinfo_x86 *c) · 544 unmodified lines
545545 }
546546 }
547547
548−static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
548+void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
549549 {
550550 u32 tfms, xlvl;
551551 u32 ebx;
arch/x86/kernel/cpu/cpu.h+1−0
@@ -33,5 +33,6 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[], · 32 unmodified lines
3333 *const __x86_cpu_dev_end[];
3434
3535 extern void cpu_detect_cache_sizes(struct cpuinfo_x86 *c);
36+extern void get_cpu_cap(struct cpuinfo_x86 *c);
3637
3738 #endif
arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c+12−6
@@ -368,16 +368,22 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handle) · 367 unmodified lines
368368 return -ENODEV;
369369
370370 out_obj = output.pointer;
371− if (out_obj->type != ACPI_TYPE_BUFFER)
372− return -ENODEV;
371+ if (out_obj->type != ACPI_TYPE_BUFFER) {
372+ ret = -ENODEV;
373+ goto out_free;
374+ }
373375
374376 errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
375− if (errors)
376− return -ENODEV;
377+ if (errors) {
378+ ret = -ENODEV;
379+ goto out_free;
380+ }
377381
378382 supported = *((u32 *)(out_obj->buffer.pointer + 4));
379− if (!(supported & 0x1))
380− return -ENODEV;
383+ if (!(supported & 0x1)) {
384+ ret = -ENODEV;
385+ goto out_free;
386+ }
381387
382388 out_free:
383389 kfree(output.pointer);
arch/x86/kernel/cpu/intel.c+1−0
@@ -39,6 +39,7 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) · 38 unmodified lines
3939 misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID;
4040 wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
4141 c->cpuid_level = cpuid_eax(0);
42+ get_cpu_cap(c);
4243 }
4344 }
4445
arch/x86/kernel/cpu/scattered.c+1−0
@@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) · 30 unmodified lines
3131 const struct cpuid_bit *cb;
3232
3333 static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
34+ { X86_FEATURE_DTS, CR_EAX, 0, 0x00000006, 0 },
3435 { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006, 0 },
3536 { X86_FEATURE_ARAT, CR_EAX, 2, 0x00000006, 0 },
3637 { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 },
arch/x86/kernel/hpet.c+1−1
@@ -506,7 +506,7 @@ static int hpet_assign_irq(struct hpet_dev *dev) · 505 unmodified lines
506506 {
507507 unsigned int irq;
508508
509− irq = create_irq();
509+ irq = create_irq_nr(0, -1);
510510 if (!irq)
511511 return -EINVAL;
512512
arch/x86/kernel/module.c+1−2
@@ -242,11 +242,10 @@ int module_finalize(const Elf_Ehdr *hdr, · 241 unmodified lines
242242 /* make jump label nops */
243243 jump_label_apply_nops(me);
244244
245− return module_bug_finalize(hdr, sechdrs, me);
245+ return 0;
246246 }
247247
248248 void module_arch_cleanup(struct module *mod)
249249 {
250250 alternatives_smp_module_del(mod);
251− module_bug_cleanup(mod);
252251 }
arch/x86/xen/time.c+3−2
@@ -489,8 +489,9 @@ static void xen_hvm_setup_cpu_clockevents(void) · 488 unmodified lines
489489 __init void xen_hvm_init_time_ops(void)
490490 {
491491 /* vector callback is needed otherwise we cannot receive interrupts
492− * on cpu > 0 */
493− if (!xen_have_vector_callback && num_present_cpus() > 1)
492+ * on cpu > 0 and at this point we don't know how many cpus are
493+ * available */
494+ if (!xen_have_vector_callback)
494495 return;
495496 if (!xen_feature(XENFEAT_hvm_safe_pvclock)) {
496497 printk(KERN_INFO "Xen doesn't support pvclock on HVM,"
block/blk-merge.c+12−0
@@ -361,6 +361,18 @@ static int attempt_merge(struct request_queue *q, struct request *req, · 360 unmodified lines
361361 if (!rq_mergeable(req) || !rq_mergeable(next))
362362 return 0;
363363
364+ /*
365+ * Don't merge file system requests and discard requests
366+ */
367+ if ((req->cmd_flags & REQ_DISCARD) != (next->cmd_flags & REQ_DISCARD))
368+ return 0;
369+
370+ /*
371+ * Don't merge discard requests and secure discard requests
372+ */
373+ if ((req->cmd_flags & REQ_SECURE) != (next->cmd_flags & REQ_SECURE))
374+ return 0;
375+
364376 /*
365377 * not contiguous
366378 */
drivers/acpi/Kconfig+1−1
@@ -105,7 +105,7 @@ config ACPI_EC_DEBUGFS · 104 unmodified lines
105105
106106 Be aware that using this interface can confuse your Embedded
107107 Controller in a way that a normal reboot is not enough. You then
108− have to power of your system, and remove the laptop battery for
108+ have to power off your system, and remove the laptop battery for
109109 some seconds.
110110 An Embedded Controller typically is available on laptops and reads
111111 sensor values like battery state and temperature.
drivers/acpi/acpi_pad.c+18−16
@@ -382,31 +382,32 @@ static void acpi_pad_remove_sysfs(struct acpi_device *device) · 381 unmodified lines
382382 device_remove_file(&device->dev, &dev_attr_rrtime);
383383 }
384384
385−/* Query firmware how many CPUs should be idle */
386−static int acpi_pad_pur(acpi_handle handle, int *num_cpus)
385+/*
386+ * Query firmware how many CPUs should be idle
387+ * return -1 on failure
388+ */
389+static int acpi_pad_pur(acpi_handle handle)
387390 {
388391 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
389392 union acpi_object *package;
390− int rev, num, ret = -EINVAL;
393+ int num = -1;
391394
392395 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
393− return -EINVAL;
396+ return num;
394397
395398 if (!buffer.length || !buffer.pointer)
396− return -EINVAL;
399+ return num;
397400
398401 package = buffer.pointer;
399− if (package->type != ACPI_TYPE_PACKAGE || package->package.count != 2)
400− goto out;
401− rev = package->package.elements[0].integer.value;
402− num = package->package.elements[1].integer.value;
403− if (rev != 1 || num < 0)
404− goto out;
405− *num_cpus = num;
406− ret = 0;
407−out:
402+
403+ if (package->type == ACPI_TYPE_PACKAGE &&
404+ package->package.count == 2 &&
405+ package->package.elements[0].integer.value == 1) /* rev 1 */
406+
407+ num = package->package.elements[1].integer.value;
408+
408409 kfree(buffer.pointer);
409− return ret;
410+ return num;
410411 }
411412
412413 /* Notify firmware how many CPUs are idle */
@@ -433,7 +434,8 @@ static void acpi_pad_handle_notify(acpi_handle handle) · 20 unmodified lines
433434 uint32_t idle_cpus;
434435
435436 mutex_lock(&isolated_cpus_lock);
436− if (acpi_pad_pur(handle, &num_cpus)) {
437+ num_cpus = acpi_pad_pur(handle);
438+ if (num_cpus < 0) {
437439 mutex_unlock(&isolated_cpus_lock);
438440 return;
439441 }
drivers/acpi/acpica/aclocal.h+1−0
@@ -854,6 +854,7 @@ struct acpi_bit_register_info { · 853 unmodified lines
854854 ACPI_BITMASK_POWER_BUTTON_STATUS | \
855855 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
856856 ACPI_BITMASK_RT_CLOCK_STATUS | \
857+ ACPI_BITMASK_PCIEXP_WAKE_DISABLE | \
857858 ACPI_BITMASK_WAKE_STATUS)
858859
859860 #define ACPI_BITMASK_TIMER_ENABLE 0x0001
drivers/acpi/acpica/exutils.c+1−1
@@ -109,7 +109,7 @@ void acpi_ex_enter_interpreter(void) · 108 unmodified lines
109109 *
110110 * DESCRIPTION: Reacquire the interpreter execution region from within the
111111 * interpreter code. Failure to enter the interpreter region is a
112− * fatal system error. Used in conjuction with
112+ * fatal system error. Used in conjunction with
113113 * relinquish_interpreter
114114 *
115115 ******************************************************************************/
drivers/acpi/acpica/rsutils.c+1−1
@@ -149,7 +149,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type) · 148 unmodified lines
149149
150150 /*
151151 * 16-, 32-, and 64-bit cases must use the move macros that perform
152− * endian conversion and/or accomodate hardware that cannot perform
152+ * endian conversion and/or accommodate hardware that cannot perform
153153 * misaligned memory transfers
154154 */
155155 case ACPI_RSC_MOVE16:
drivers/acpi/apei/Kconfig+1−1
@@ -34,6 +34,6 @@ config ACPI_APEI_ERST_DEBUG · 33 unmodified lines
3434 depends on ACPI_APEI
3535 help
3636 ERST is a way provided by APEI to save and retrieve hardware
37− error infomation to and from a persistent store. Enable this
37+ error information to and from a persistent store. Enable this
3838 if you want to debugging and testing the ERST kernel support
3939 and firmware implementation.
drivers/acpi/apei/apei-base.c+16−5
@@ -445,11 +445,15 @@ EXPORT_SYMBOL_GPL(apei_resources_sub); · 444 unmodified lines
445445 int apei_resources_request(struct apei_resources *resources,
446446 const char *desc)
447447 {
448− struct apei_res *res, *res_bak;
448+ struct apei_res *res, *res_bak = NULL;
449449 struct resource *r;
450+ int rc;
450451
451− apei_resources_sub(resources, &apei_resources_all);
452+ rc = apei_resources_sub(resources, &apei_resources_all);
453+ if (rc)
454+ return rc;
452455
456+ rc = -EINVAL;
453457 list_for_each_entry(res, &resources->iomem, list) {
454458 r = request_mem_region(res->start, res->end - res->start,
455459 desc);
@@ -475,7 +479,11 @@ int apei_resources_request(struct apei_resources *resources, · 19 unmodified lines
475479 }
476480 }
477481
478− apei_resources_merge(&apei_resources_all, resources);
482+ rc = apei_resources_merge(&apei_resources_all, resources);
483+ if (rc) {
484+ pr_err(APEI_PFX "Fail to merge resources!\n");
485+ goto err_unmap_ioport;
486+ }
479487
480488 return 0;
481489 err_unmap_ioport:
@@ -491,12 +499,13 @@ err_unmap_iomem: · 9 unmodified lines
491499 break;
492500 release_mem_region(res->start, res->end - res->start);
493501 }
494− return -EINVAL;
502+ return rc;
495503 }
496504 EXPORT_SYMBOL_GPL(apei_resources_request);
497505
498506 void apei_resources_release(struct apei_resources *resources)
499507 {
508+ int rc;
500509 struct apei_res *res;
501510
502511 list_for_each_entry(res, &resources->iomem, list)
@@ -504,7 +513,9 @@ void apei_resources_release(struct apei_resources *resources) · 1 unmodified line
504513 list_for_each_entry(res, &resources->ioport, list)
505514 release_region(res->start, res->end - res->start);
506515
507− apei_resources_sub(&apei_resources_all, resources);
516+ rc = apei_resources_sub(&apei_resources_all, resources);
517+ if (rc)
518+ pr_err(APEI_PFX "Fail to sub resources!\n");
508519 }
509520 EXPORT_SYMBOL_GPL(apei_resources_release);
510521
drivers/acpi/apei/einj.c+3−1
@@ -426,7 +426,9 @@ DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL, · 425 unmodified lines
426426
427427 static int einj_check_table(struct acpi_table_einj *einj_tab)
428428 {
429− if (einj_tab->header_length != sizeof(struct acpi_table_einj))
429+ if ((einj_tab->header_length !=
430+ (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header)))
431+ && (einj_tab->header_length != sizeof(struct acpi_table_einj)))
430432 return -EINVAL;
431433 if (einj_tab->header.length < sizeof(struct acpi_table_einj))
432434 return -EINVAL;
drivers/acpi/apei/erst-dbg.c+11−7
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * APEI Error Record Serialization Table debug support
33 *
44 * ERST is a way provided by APEI to save and retrieve hardware error
5− * infomation to and from a persistent store. This file provide the
5+ * information to and from a persistent store. This file provide the
66 * debugging/testing support for ERST kernel support and firmware
77 * implementation.
88 *
@@ -111,11 +111,13 @@ retry: · 102 unmodified lines
111111 goto out;
112112 }
113113 if (len > erst_dbg_buf_len) {
114− kfree(erst_dbg_buf);
114+ void *p;
115115 rc = -ENOMEM;
116− erst_dbg_buf = kmalloc(len, GFP_KERNEL);
117− if (!erst_dbg_buf)
116+ p = kmalloc(len, GFP_KERNEL);
117+ if (!p)
118118 goto out;
119+ kfree(erst_dbg_buf);
120+ erst_dbg_buf = p;
119121 erst_dbg_buf_len = len;
120122 goto retry;
121123 }
@@ -150,11 +152,13 @@ static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf, · 28 unmodified lines
150152 if (mutex_lock_interruptible(&erst_dbg_mutex))
151153 return -EINTR;
152154 if (usize > erst_dbg_buf_len) {
153− kfree(erst_dbg_buf);
155+ void *p;
154156 rc = -ENOMEM;
155− erst_dbg_buf = kmalloc(usize, GFP_KERNEL);
156− if (!erst_dbg_buf)
157+ p = kmalloc(usize, GFP_KERNEL);
158+ if (!p)
157159 goto out;
160+ kfree(erst_dbg_buf);
161+ erst_dbg_buf = p;
158162 erst_dbg_buf_len = usize;
159163 }
160164 rc = copy_from_user(erst_dbg_buf, ubuf, usize);
drivers/acpi/apei/erst.c+24−5
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * APEI Error Record Serialization Table support
33 *
44 * ERST is a way provided by APEI to save and retrieve hardware error
5− * infomation to and from a persistent store.
5+ * information to and from a persistent store.
66 *
77 * For more information about ERST, please refer to ACPI Specification
88 * version 4.0, section 17.4.
@@ -266,13 +266,30 @@ static int erst_exec_move_data(struct apei_exec_context *ctx, · 257 unmodified lines
266266 {
267267 int rc;
268268 u64 offset;
269+ void *src, *dst;
270+
271+ /* ioremap does not work in interrupt context */
272+ if (in_interrupt()) {
273+ pr_warning(ERST_PFX
274+ "MOVE_DATA can not be used in interrupt context");
275+ return -EBUSY;
276+ }
269277
270278 rc = __apei_exec_read_register(entry, &offset);
271279 if (rc)
272280 return rc;
273− memmove((void *)ctx->dst_base + offset,
274− (void *)ctx->src_base + offset,
275− ctx->var2);
281+
282+ src = ioremap(ctx->src_base + offset, ctx->var2);
283+ if (!src)
284+ return -ENOMEM;
285+ dst = ioremap(ctx->dst_base + offset, ctx->var2);
286+ if (!dst)
287+ return -ENOMEM;
288+
289+ memmove(dst, src, ctx->var2);
290+
291+ iounmap(src);
292+ iounmap(dst);
276293
277294 return 0;
278295 }
@@ -750,7 +767,9 @@ __setup("erst_disable", setup_erst_disable); · 471 unmodified lines
750767
751768 static int erst_check_table(struct acpi_table_erst *erst_tab)
752769 {
753− if (erst_tab->header_length != sizeof(struct acpi_table_erst))
770+ if ((erst_tab->header_length !=
771+ (sizeof(struct acpi_table_erst) - sizeof(erst_tab->header)))
772+ && (erst_tab->header_length != sizeof(struct acpi_table_einj)))
754773 return -EINVAL;
755774 if (erst_tab->header.length < sizeof(struct acpi_table_erst))
756775 return -EINVAL;
drivers/acpi/apei/ghes.c+1−1
@@ -302,7 +302,7 @@ static int __devinit ghes_probe(struct platform_device *ghes_dev) · 301 unmodified lines
302302 struct ghes *ghes = NULL;
303303 int rc = -EINVAL;
304304
305− generic = ghes_dev->dev.platform_data;
305+ generic = *(struct acpi_hest_generic **)ghes_dev->dev.platform_data;
306306 if (!generic->enabled)
307307 return -ENODEV;
308308
drivers/acpi/apei/hest.c+7−4
@@ -137,20 +137,23 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data) · 136 unmodified lines
137137
138138 static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
139139 {
140− struct acpi_hest_generic *generic;
141140 struct platform_device *ghes_dev;
142141 struct ghes_arr *ghes_arr = data;
143142 int rc;
144143
145144 if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR)
146145 return 0;
147− generic = (struct acpi_hest_generic *)hest_hdr;
148− if (!generic->enabled)
146+
147+ if (!((struct acpi_hest_generic *)hest_hdr)->enabled)
149148 return 0;
150149 ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);
151150 if (!ghes_dev)
152151 return -ENOMEM;
153− ghes_dev->dev.platform_data = generic;
152+
153+ rc = platform_device_add_data(ghes_dev, &hest_hdr, sizeof(void *));
154+ if (rc)
155+ goto err;
156+
154157 rc = platform_device_add(ghes_dev);
155158 if (rc)
156159 goto err;
drivers/acpi/atomicio.c+1−1
@@ -142,7 +142,7 @@ static void __iomem *acpi_pre_map(phys_addr_t paddr, · 141 unmodified lines
142142 list_add_tail_rcu(&map->list, &acpi_iomaps);
143143 spin_unlock_irqrestore(&acpi_iomaps_lock, flags);
144144
145− return vaddr + (paddr - pg_off);
145+ return map->vaddr + (paddr - map->paddr);
146146 err_unmap:
147147 iounmap(vaddr);
148148 return NULL;
drivers/acpi/battery.c+0−1
@@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = { · 272 unmodified lines
273273 POWER_SUPPLY_PROP_CYCLE_COUNT,
274274 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
275275 POWER_SUPPLY_PROP_VOLTAGE_NOW,
276− POWER_SUPPLY_PROP_CURRENT_NOW,
277276 POWER_SUPPLY_PROP_POWER_NOW,
278277 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
279278 POWER_SUPPLY_PROP_ENERGY_FULL,
drivers/acpi/blacklist.c+18−0
@@ -183,6 +183,8 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d) · 182 unmodified lines
183183 {
184184 printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
185185 acpi_osi_setup("!Windows 2006");
186+ acpi_osi_setup("!Windows 2006 SP1");
187+ acpi_osi_setup("!Windows 2006 SP2");
186188 return 0;
187189 }
188190 static int __init dmi_disable_osi_win7(const struct dmi_system_id *d)
@@ -226,6 +228,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { · 37 unmodified lines
226228 },
227229 },
228230 {
231+ .callback = dmi_disable_osi_vista,
232+ .ident = "Toshiba Satellite L355",
233+ .matches = {
234+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
235+ DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"),
236+ },
237+ },
238+ {
229239 .callback = dmi_disable_osi_win7,
230240 .ident = "ASUS K50IJ",
231241 .matches = {
@@ -233,6 +243,14 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { · 1 unmodified line
233243 DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"),
234244 },
235245 },
246+ {
247+ .callback = dmi_disable_osi_vista,
248+ .ident = "Toshiba P305D",
249+ .matches = {
250+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
251+ DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"),
252+ },
253+ },
236254
237255 /*
238256 * BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
drivers/acpi/bus.c+5−13
@@ -55,7 +55,7 @@ EXPORT_SYMBOL(acpi_root_dir); · 54 unmodified lines
5555 static int set_power_nocheck(const struct dmi_system_id *id)
5656 {
5757 printk(KERN_NOTICE PREFIX "%s detected - "
58− "disable power check in power transistion\n", id->ident);
58+ "disable power check in power transition\n", id->ident);
5959 acpi_power_nocheck = 1;
6060 return 0;
6161 }
@@ -80,23 +80,15 @@ static int set_copy_dsdt(const struct dmi_system_id *id) · 18 unmodified lines
8080
8181 static struct dmi_system_id dsdt_dmi_table[] __initdata = {
8282 /*
83− * Insyde BIOS on some TOSHIBA machines corrupt the DSDT.
83+ * Invoke DSDT corruption work-around on all Toshiba Satellite.
8484 * https://bugzilla.kernel.org/show_bug.cgi?id=14679
8585 */
8686 {
8787 .callback = set_copy_dsdt,
88− .ident = "TOSHIBA Satellite A505",
88+ .ident = "TOSHIBA Satellite",
8989 .matches = {
9090 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
91− DMI_MATCH(DMI_PRODUCT_NAME, "Satellite A505"),
92− },
93− },
94− {
95− .callback = set_copy_dsdt,
96− .ident = "TOSHIBA Satellite L505D",
97− .matches = {
98− DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
99− DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L505D"),
91+ DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),
10092 },
10193 },
10294 {}
@@ -1027,7 +1019,7 @@ static int __init acpi_init(void) · 924 unmodified lines
10271019
10281020 /*
10291021 * If the laptop falls into the DMI check table, the power state check
1030− * will be disabled in the course of device power transistion.
1022+ * will be disabled in the course of device power transition.
10311023 */
10321024 dmi_check_system(power_nocheck_dmi_table);
10331025
drivers/acpi/fan.c+2−0
@@ -369,7 +369,9 @@ static void __exit acpi_fan_exit(void) · 368 unmodified lines
369369
370370 acpi_bus_unregister_driver(&acpi_fan_driver);
371371
372+#ifdef CONFIG_ACPI_PROCFS
372373 remove_proc_entry(ACPI_FAN_CLASS, acpi_root_dir);
374+#endif
373375
374376 return;
375377 }
drivers/acpi/processor_core.c+0−6
@@ -28,12 +28,6 @@ static int set_no_mwait(const struct dmi_system_id *id) · 27 unmodified lines
2828 }
2929
3030 static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = {
31− {
32− set_no_mwait, "IFL91 board", {
33− DMI_MATCH(DMI_BIOS_VENDOR, "COMPAL"),
34− DMI_MATCH(DMI_SYS_VENDOR, "ZEPTO"),
35− DMI_MATCH(DMI_PRODUCT_VERSION, "3215W"),
36− DMI_MATCH(DMI_BOARD_NAME, "IFL91") }, NULL},
3731 {
3832 set_no_mwait, "Extensa 5220", {
3933 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
drivers/acpi/processor_driver.c+1−1
@@ -850,7 +850,7 @@ static int __init acpi_processor_init(void) · 849 unmodified lines
850850 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
851851 acpi_idle_driver.name);
852852 } else {
853− printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s",
853+ printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n",
854854 cpuidle_get_driver()->name);
855855 }
856856
drivers/acpi/processor_perflib.c+2−2
@@ -447,8 +447,8 @@ int acpi_processor_notify_smm(struct module *calling_module) · 446 unmodified lines
447447 if (!try_module_get(calling_module))
448448 return -EINVAL;
449449
450− /* is_done is set to negative if an error occured,
451− * and to postitive if _no_ error occured, but SMM
450+ /* is_done is set to negative if an error occurred,
451+ * and to postitive if _no_ error occurred, but SMM
452452 * was already notified. This avoids double notification
453453 * which might lead to unexpected results...
454454 */
drivers/acpi/sleep.c+22−0
@@ -363,6 +363,12 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d) · 362 unmodified lines
363363 return 0;
364364 }
365365
366+static int __init init_nvs_nosave(const struct dmi_system_id *d)
367+{
368+ acpi_nvs_nosave();
369+ return 0;
370+}
371+
366372 static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
367373 {
368374 .callback = init_old_suspend_ordering,
@@ -397,6 +403,22 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { · 28 unmodified lines
397403 DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
398404 },
399405 },
406+ {
407+ .callback = init_nvs_nosave,
408+ .ident = "Sony Vaio VGN-SR11M",
409+ .matches = {
410+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
411+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"),
412+ },
413+ },
414+ {
415+ .callback = init_nvs_nosave,
416+ .ident = "Everex StepNote Series",
417+ .matches = {
418+ DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."),
419+ DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
420+ },
421+ },
400422 {},
401423 };
402424 #endif /* CONFIG_SUSPEND */
drivers/acpi/sysfs.c+14−6
@@ -100,7 +100,7 @@ static const struct acpi_dlevel acpi_debug_levels[] = { · 99 unmodified lines
100100 ACPI_DEBUG_INIT(ACPI_LV_EVENTS),
101101 };
102102
103−static int param_get_debug_layer(char *buffer, struct kernel_param *kp)
103+static int param_get_debug_layer(char *buffer, const struct kernel_param *kp)
104104 {
105105 int result = 0;
106106 int i;
@@ -128,7 +128,7 @@ static int param_get_debug_layer(char *buffer, struct kernel_param *kp) · 21 unmodified lines
128128 return result;
129129 }
130130
131−static int param_get_debug_level(char *buffer, struct kernel_param *kp)
131+static int param_get_debug_level(char *buffer, const struct kernel_param *kp)
132132 {
133133 int result = 0;
134134 int i;
@@ -149,10 +149,18 @@ static int param_get_debug_level(char *buffer, struct kernel_param *kp) · 14 unmodified lines
149149 return result;
150150 }
151151
152−module_param_call(debug_layer, param_set_uint, param_get_debug_layer,
153− &acpi_dbg_layer, 0644);
154−module_param_call(debug_level, param_set_uint, param_get_debug_level,
155− &acpi_dbg_level, 0644);
152+static struct kernel_param_ops param_ops_debug_layer = {
153+ .set = param_set_uint,
154+ .get = param_get_debug_layer,
155+};
156+
157+static struct kernel_param_ops param_ops_debug_level = {
158+ .set = param_set_uint,
159+ .get = param_get_debug_level,
160+};
161+
162+module_param_cb(debug_layer, &param_ops_debug_layer, &acpi_dbg_layer, 0644);
163+module_param_cb(debug_level, &param_ops_debug_level, &acpi_dbg_level, 0644);
156164
157165 static char trace_method_name[6];
158166 module_param_string(trace_method_name, trace_method_name, 6, 0644);
drivers/acpi/video_detect.c+2−2
@@ -59,8 +59,8 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, · 58 unmodified lines
5959 "support\n"));
6060 *cap |= ACPI_VIDEO_BACKLIGHT;
6161 if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy)))
62− printk(KERN_WARNING FW_BUG PREFIX "ACPI brightness "
63− "control misses _BQC function\n");
62+ printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, "
63+ "cannot determine initial brightness\n");
6464 /* We have backlight support, no need to scan further */
6565 return AE_CTRL_TERMINATE;
6666 }
drivers/ata/ahci.c+4−0
@@ -90,6 +90,10 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); · 89 unmodified lines
9090 static int ahci_pci_device_resume(struct pci_dev *pdev);
9191 #endif
9292
93+static struct scsi_host_template ahci_sht = {
94+ AHCI_SHT("ahci"),
95+};
96+
9397 static struct ata_port_operations ahci_vt8251_ops = {
9498 .inherits = &ahci_ops,
9599 .hardreset = ahci_vt8251_hardreset,
drivers/ata/ahci.h+11−1
@@ -298,7 +298,17 @@ struct ahci_host_priv { · 297 unmodified lines
298298
299299 extern int ahci_ignore_sss;
300300
301−extern struct scsi_host_template ahci_sht;
301+extern struct device_attribute *ahci_shost_attrs[];
302+extern struct device_attribute *ahci_sdev_attrs[];
303+
304+#define AHCI_SHT(drv_name) \
305+ ATA_NCQ_SHT(drv_name), \
306+ .can_queue = AHCI_MAX_CMDS - 1, \
307+ .sg_tablesize = AHCI_MAX_SG, \
308+ .dma_boundary = AHCI_DMA_BOUNDARY, \
309+ .shost_attrs = ahci_shost_attrs, \
310+ .sdev_attrs = ahci_sdev_attrs
311+
302312 extern struct ata_port_operations ahci_ops;
303313
304314 void ahci_save_initial_config(struct device *dev,
drivers/ata/ahci_platform.c+5−1
@@ -23,6 +23,10 @@ · 22 unmodified lines
2323 #include <linux/ahci_platform.h>
2424 #include "ahci.h"
2525
26+static struct scsi_host_template ahci_platform_sht = {
27+ AHCI_SHT("ahci_platform"),
28+};
29+
2630 static int __init ahci_probe(struct platform_device *pdev)
2731 {
2832 struct device *dev = &pdev->dev;
@@ -145,7 +149,7 @@ static int __init ahci_probe(struct platform_device *pdev) · 116 unmodified lines
145149 ahci_print_info(host, "platform");
146150
147151 rc = ata_host_activate(host, irq, ahci_interrupt, IRQF_SHARED,
148− &ahci_sht);
152+ &ahci_platform_sht);
149153 if (rc)
150154 goto err0;
151155
drivers/ata/libahci.c+4−12
@@ -121,7 +121,7 @@ static DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL); · 120 unmodified lines
121121 static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO,
122122 ahci_read_em_buffer, ahci_store_em_buffer);
123123
124−static struct device_attribute *ahci_shost_attrs[] = {
124+struct device_attribute *ahci_shost_attrs[] = {
125125 &dev_attr_link_power_management_policy,
126126 &dev_attr_em_message_type,
127127 &dev_attr_em_message,
@@ -132,22 +132,14 @@ static struct device_attribute *ahci_shost_attrs[] = { · 4 unmodified lines
132132 &dev_attr_em_buffer,
133133 NULL
134134 };
135+EXPORT_SYMBOL_GPL(ahci_shost_attrs);
135136
136−static struct device_attribute *ahci_sdev_attrs[] = {
137+struct device_attribute *ahci_sdev_attrs[] = {
137138 &dev_attr_sw_activity,
138139 &dev_attr_unload_heads,
139140 NULL
140141 };
141−
142−struct scsi_host_template ahci_sht = {
143− ATA_NCQ_SHT("ahci"),
144− .can_queue = AHCI_MAX_CMDS - 1,
145− .sg_tablesize = AHCI_MAX_SG,
146− .dma_boundary = AHCI_DMA_BOUNDARY,
147− .shost_attrs = ahci_shost_attrs,
148− .sdev_attrs = ahci_sdev_attrs,
149−};
150−EXPORT_SYMBOL_GPL(ahci_sht);
142+EXPORT_SYMBOL_GPL(ahci_sdev_attrs);
151143
152144 struct ata_port_operations ahci_ops = {
153145 .inherits = &sata_pmp_port_ops,
drivers/block/pktcdvd.c+1−1
@@ -2369,7 +2369,7 @@ static void pkt_release_dev(struct pktcdvd_device *pd, int flush) · 2368 unmodified lines
23692369 pkt_shrink_pktlist(pd);
23702370 }
23712371
2372−static struct pktcdvd_device *pkt_find_dev_from_minor(int dev_minor)
2372+static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor)
23732373 {
23742374 if (dev_minor >= MAX_WRITERS)
23752375 return NULL;
drivers/char/ipmi/ipmi_si_intf.c+11−6
@@ -305,6 +305,9 @@ static int num_force_kipmid; · 304 unmodified lines
305305 #ifdef CONFIG_PCI
306306 static int pci_registered;
307307 #endif
308+#ifdef CONFIG_ACPI
309+static int pnp_registered;
310+#endif
308311 #ifdef CONFIG_PPC_OF
309312 static int of_registered;
310313 #endif
@@ -2126,7 +2129,7 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev, · 1815 unmodified lines
21262129 {
21272130 struct acpi_device *acpi_dev;
21282131 struct smi_info *info;
2129− struct resource *res;
2132+ struct resource *res, *res_second;
21302133 acpi_handle handle;
21312134 acpi_status status;
21322135 unsigned long long tmp;
@@ -2182,13 +2185,13 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev, · 49 unmodified lines
21822185 info->io.addr_data = res->start;
21832186
21842187 info->io.regspacing = DEFAULT_REGSPACING;
2185− res = pnp_get_resource(dev,
2188+ res_second = pnp_get_resource(dev,
21862189 (info->io.addr_type == IPMI_IO_ADDR_SPACE) ?
21872190 IORESOURCE_IO : IORESOURCE_MEM,
21882191 1);
2189− if (res) {
2190− if (res->start > info->io.addr_data)
2191− info->io.regspacing = res->start - info->io.addr_data;
2192+ if (res_second) {
2193+ if (res_second->start > info->io.addr_data)
2194+ info->io.regspacing = res_second->start - info->io.addr_data;
21922195 }
21932196 info->io.regsize = DEFAULT_REGSPACING;
21942197 info->io.regshift = 0;
@@ -3359,6 +3362,7 @@ static __devinit int init_ipmi_si(void) · 1164 unmodified lines
33593362
33603363 #ifdef CONFIG_ACPI
33613364 pnp_register_driver(&ipmi_pnp_driver);
3365+ pnp_registered = 1;
33623366 #endif
33633367
33643368 #ifdef CONFIG_DMI
@@ -3526,7 +3530,8 @@ static __exit void cleanup_ipmi_si(void) · 161 unmodified lines
35263530 pci_unregister_driver(&ipmi_pci_driver);
35273531 #endif
35283532 #ifdef CONFIG_ACPI
3529− pnp_unregister_driver(&ipmi_pnp_driver);
3533+ if (pnp_registered)
3534+ pnp_unregister_driver(&ipmi_pnp_driver);
35303535 #endif
35313536
35323537 #ifdef CONFIG_PPC_OF
drivers/cpuidle/governors/menu.c+1−1
@@ -80,7 +80,7 @@ · 79 unmodified lines
8080 * Limiting Performance Impact
8181 * ---------------------------
8282 * C states, especially those with large exit latencies, can have a real
83− * noticable impact on workloads, which is not acceptable for most sysadmins,
83+ * noticeable impact on workloads, which is not acceptable for most sysadmins,
8484 * and in addition, less performance has a power price of its own.
8585 *
8686 * As a general rule of thumb, menu assumes that the following heuristic
drivers/dma/mv_xor.c+1−1
@@ -162,7 +162,7 @@ static int mv_is_err_intr(u32 intr_cause) · 161 unmodified lines
162162
163163 static void mv_xor_device_clear_eoc_cause(struct mv_xor_chan *chan)
164164 {
165− u32 val = (1 << (1 + (chan->idx * 16)));
165+ u32 val = ~(1 << (chan->idx * 16));
166166 dev_dbg(chan->device->common.dev, "%s, val 0x%08x\n", __func__, val);
167167 __raw_writel(val, XOR_INTR_CAUSE(chan));
168168 }
drivers/dma/shdma.c+2−1
@@ -580,7 +580,6 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg( · 579 unmodified lines
580580
581581 sh_chan = to_sh_chan(chan);
582582 param = chan->private;
583− slave_addr = param->config->addr;
584583
585584 /* Someone calling slave DMA on a public channel? */
586585 if (!param || !sg_len) {
@@ -589,6 +588,8 @@ static struct dma_async_tx_descriptor *sh_dmae_prep_slave_sg( · 2 unmodified lines
589588 return NULL;
590589 }
591590
591+ slave_addr = param->config->addr;
592+
592593 /*
593594 * if (param != NULL), this is a successfully requested slave channel,
594595 * therefore param->config != NULL too.
drivers/edac/edac_mc.c+3−0
@@ -339,6 +339,9 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci) · 338 unmodified lines
339339 {
340340 int status;
341341
342+ if (mci->op_state != OP_RUNNING_POLL)
343+ return;
344+
342345 status = cancel_delayed_work(&mci->work);
343346 if (status == 0) {
344347 debugf0("%s() not canceled, flush the queue\n",
drivers/edac/i7core_edac.c+1−0
@@ -1140,6 +1140,7 @@ static struct mcidev_sysfs_attribute i7core_udimm_counters_attrs[] = { · 1139 unmodified lines
11401140 ATTR_COUNTER(0),
11411141 ATTR_COUNTER(1),
11421142 ATTR_COUNTER(2),
1143+ { .attr = { .name = NULL } }
11431144 };
11441145
11451146 static struct mcidev_sysfs_group i7core_udimm_counters = {
drivers/gpu/drm/drm_buffer.c+3−3
@@ -98,8 +98,8 @@ EXPORT_SYMBOL(drm_buffer_alloc); · 97 unmodified lines
9898 * user_data: A pointer the data that is copied to the buffer.
9999 * size: The Number of bytes to copy.
100100 */
101−extern int drm_buffer_copy_from_user(struct drm_buffer *buf,
102− void __user *user_data, int size)
101+int drm_buffer_copy_from_user(struct drm_buffer *buf,
102+ void __user *user_data, int size)
103103 {
104104 int nr_pages = size / PAGE_SIZE + 1;
105105 int idx;
@@ -163,7 +163,7 @@ void *drm_buffer_read_object(struct drm_buffer *buf, · 57 unmodified lines
163163 {
164164 int idx = drm_buffer_index(buf);
165165 int page = drm_buffer_page(buf);
166− void *obj = 0;
166+ void *obj = NULL;
167167
168168 if (idx + objsize <= PAGE_SIZE) {
169169 obj = &buf->data[page][idx];
drivers/gpu/drm/drm_gem.c+10−29
@@ -148,7 +148,7 @@ int drm_gem_object_init(struct drm_device *dev, · 147 unmodified lines
148148 return -ENOMEM;
149149
150150 kref_init(&obj->refcount);
151− kref_init(&obj->handlecount);
151+ atomic_set(&obj->handle_count, 0);
152152 obj->size = size;
153153
154154 atomic_inc(&dev->object_count);
@@ -462,28 +462,6 @@ drm_gem_object_free(struct kref *kref) · 307 unmodified lines
462462 }
463463 EXPORT_SYMBOL(drm_gem_object_free);
464464
465−/**
466− * Called after the last reference to the object has been lost.
467− * Must be called without holding struct_mutex
468− *
469− * Frees the object
470− */
471−void
472−drm_gem_object_free_unlocked(struct kref *kref)
473−{
474− struct drm_gem_object *obj = (struct drm_gem_object *) kref;
475− struct drm_device *dev = obj->dev;
476−
477− if (dev->driver->gem_free_object_unlocked != NULL)
478− dev->driver->gem_free_object_unlocked(obj);
479− else if (dev->driver->gem_free_object != NULL) {
480− mutex_lock(&dev->struct_mutex);
481− dev->driver->gem_free_object(obj);
482− mutex_unlock(&dev->struct_mutex);
483− }
484−}
485−EXPORT_SYMBOL(drm_gem_object_free_unlocked);
486−
487465 static void drm_gem_object_ref_bug(struct kref *list_kref)
488466 {
489467 BUG();
@@ -496,12 +474,8 @@ static void drm_gem_object_ref_bug(struct kref *list_kref) · 6 unmodified lines
496474 * called before drm_gem_object_free or we'll be touching
497475 * freed memory
498476 */
499−void
500−drm_gem_object_handle_free(struct kref *kref)
477+void drm_gem_object_handle_free(struct drm_gem_object *obj)
501478 {
502− struct drm_gem_object *obj = container_of(kref,
503− struct drm_gem_object,
504− handlecount);
505479 struct drm_device *dev = obj->dev;
506480
507481 /* Remove any name for this object */
@@ -528,6 +502,10 @@ void drm_gem_vm_open(struct vm_area_struct *vma) · 20 unmodified lines
528502 struct drm_gem_object *obj = vma->vm_private_data;
529503
530504 drm_gem_object_reference(obj);
505+
506+ mutex_lock(&obj->dev->struct_mutex);
507+ drm_vm_open_locked(vma);
508+ mutex_unlock(&obj->dev->struct_mutex);
531509 }
532510 EXPORT_SYMBOL(drm_gem_vm_open);
533511
@@ -535,7 +513,10 @@ void drm_gem_vm_close(struct vm_area_struct *vma) · 1 unmodified line
535513 {
536514 struct drm_gem_object *obj = vma->vm_private_data;
537515
538− drm_gem_object_unreference_unlocked(obj);
516+ mutex_lock(&obj->dev->struct_mutex);
517+ drm_vm_close_locked(vma);
518+ drm_gem_object_unreference(obj);
519+ mutex_unlock(&obj->dev->struct_mutex);
539520 }
540521 EXPORT_SYMBOL(drm_gem_vm_close);
541522
drivers/gpu/drm/drm_info.c+1−1
@@ -255,7 +255,7 @@ int drm_gem_one_name_info(int id, void *ptr, void *data) · 254 unmodified lines
255255
256256 seq_printf(m, "%6d %8zd %7d %8d\n",
257257 obj->name, obj->size,
258− atomic_read(&obj->handlecount.refcount),
258+ atomic_read(&obj->handle_count),
259259 atomic_read(&obj->refcount.refcount));
260260 return 0;
261261 }
drivers/gpu/drm/drm_vm.c+18−10
@@ -433,15 +433,7 @@ static void drm_vm_open(struct vm_area_struct *vma) · 432 unmodified lines
433433 mutex_unlock(&dev->struct_mutex);
434434 }
435435
436−/**
437− * \c close method for all virtual memory types.
438− *
439− * \param vma virtual memory area.
440− *
441− * Search the \p vma private data entry in drm_device::vmalist, unlink it, and
442− * free it.
443− */
444−static void drm_vm_close(struct vm_area_struct *vma)
436+void drm_vm_close_locked(struct vm_area_struct *vma)
445437 {
446438 struct drm_file *priv = vma->vm_file->private_data;
447439 struct drm_device *dev = priv->minor->dev;
@@ -451,7 +443,6 @@ static void drm_vm_close(struct vm_area_struct *vma) · 3 unmodified lines
451443 vma->vm_start, vma->vm_end - vma->vm_start);
452444 atomic_dec(&dev->vma_count);
453445
454− mutex_lock(&dev->struct_mutex);
455446 list_for_each_entry_safe(pt, temp, &dev->vmalist, head) {
456447 if (pt->vma == vma) {
457448 list_del(&pt->head);
@@ -459,6 +450,23 @@ static void drm_vm_close(struct vm_area_struct *vma) · 1 unmodified line
459450 break;
460451 }
461452 }
453+}
454+
455+/**
456+ * \c close method for all virtual memory types.
457+ *
458+ * \param vma virtual memory area.
459+ *
460+ * Search the \p vma private data entry in drm_device::vmalist, unlink it, and
461+ * free it.
462+ */
463+static void drm_vm_close(struct vm_area_struct *vma)
464+{
465+ struct drm_file *priv = vma->vm_file->private_data;
466+ struct drm_device *dev = priv->minor->dev;
467+
468+ mutex_lock(&dev->struct_mutex);
469+ drm_vm_close_locked(vma);
462470 mutex_unlock(&dev->struct_mutex);
463471 }
464472
drivers/gpu/drm/i810/i810_dma.c+1−1
@@ -116,7 +116,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) · 115 unmodified lines
116116 static const struct file_operations i810_buffer_fops = {
117117 .open = drm_open,
118118 .release = drm_release,
119− .unlocked_ioctl = drm_ioctl,
119+ .unlocked_ioctl = i810_ioctl,
120120 .mmap = i810_mmap_buffers,
121121 .fasync = drm_fasync,
122122 };
drivers/gpu/drm/i830/i830_dma.c+1−1
@@ -118,7 +118,7 @@ static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) · 117 unmodified lines
118118 static const struct file_operations i830_buffer_fops = {
119119 .open = drm_open,
120120 .release = drm_release,
121− .unlocked_ioctl = drm_ioctl,
121+ .unlocked_ioctl = i830_ioctl,
122122 .mmap = i830_mmap_buffers,
123123 .fasync = drm_fasync,
124124 };
drivers/gpu/drm/i915/i915_dma.c+3−3
@@ -1787,9 +1787,9 @@ unsigned long i915_chipset_val(struct drm_i915_private *dev_priv) · 1786 unmodified lines
17871787 }
17881788 }
17891789
1790− div_u64(diff, diff1);
1790+ diff = div_u64(diff, diff1);
17911791 ret = ((m * diff) + c);
1792− div_u64(ret, 10);
1792+ ret = div_u64(ret, 10);
17931793
17941794 dev_priv->last_count1 = total_count;
17951795 dev_priv->last_time1 = now;
@@ -1858,7 +1858,7 @@ void i915_update_gfx_val(struct drm_i915_private *dev_priv) · 62 unmodified lines
18581858
18591859 /* More magic constants... */
18601860 diff = diff * 1181;
1861− div_u64(diff, diffms * 10);
1861+ diff = div_u64(diff, diffms * 10);
18621862 dev_priv->gfx_power = diff;
18631863 }
18641864
drivers/gpu/drm/i915/i915_gem.c+29−25
@@ -136,14 +136,12 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data, · 135 unmodified lines
136136 return -ENOMEM;
137137
138138 ret = drm_gem_handle_create(file_priv, obj, &handle);
139+ /* drop reference from allocate - handle holds it now */
140+ drm_gem_object_unreference_unlocked(obj);
139141 if (ret) {
140− drm_gem_object_unreference_unlocked(obj);
141142 return ret;
142143 }
143144
144− /* Sink the floating reference from kref_init(handlecount) */
145− drm_gem_object_handle_unreference_unlocked(obj);
146−
147145 args->handle = handle;
148146 return 0;
149147 }
@@ -471,14 +469,17 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data, · 321 unmodified lines
471469 return -ENOENT;
472470 obj_priv = to_intel_bo(obj);
473471
474− /* Bounds check source.
475− *
476− * XXX: This could use review for overflow issues...
477− */
478− if (args->offset > obj->size || args->size > obj->size ||
479− args->offset + args->size > obj->size) {
480− drm_gem_object_unreference_unlocked(obj);
481− return -EINVAL;
472+ /* Bounds check source. */
473+ if (args->offset > obj->size || args->size > obj->size - args->offset) {
474+ ret = -EINVAL;
475+ goto err;
476+ }
477+
478+ if (!access_ok(VERIFY_WRITE,
479+ (char __user *)(uintptr_t)args->data_ptr,
480+ args->size)) {
481+ ret = -EFAULT;
482+ goto err;
482483 }
483484
484485 if (i915_gem_object_needs_bit17_swizzle(obj)) {
@@ -490,8 +491,8 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data, · 5 unmodified lines
490491 file_priv);
491492 }
492493
494+err:
493495 drm_gem_object_unreference_unlocked(obj);
494−
495496 return ret;
496497 }
497498
@@ -580,8 +581,6 @@ i915_gem_gtt_pwrite_fast(struct drm_device *dev, struct drm_gem_object *obj, · 82 unmodified lines
580581
581582 user_data = (char __user *) (uintptr_t) args->data_ptr;
582583 remain = args->size;
583− if (!access_ok(VERIFY_READ, user_data, remain))
584− return -EFAULT;
585584
586585
587586 mutex_lock(&dev->struct_mutex);
@@ -934,14 +933,17 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, · 346 unmodified lines
934933 return -ENOENT;
935934 obj_priv = to_intel_bo(obj);
936935
937− /* Bounds check destination.
938− *
939− * XXX: This could use review for overflow issues...
940− */
941− if (args->offset > obj->size || args->size > obj->size ||
942− args->offset + args->size > obj->size) {
943− drm_gem_object_unreference_unlocked(obj);
944− return -EINVAL;
936+ /* Bounds check destination. */
937+ if (args->offset > obj->size || args->size > obj->size - args->offset) {
938+ ret = -EINVAL;
939+ goto err;
940+ }
941+
942+ if (!access_ok(VERIFY_READ,
943+ (char __user *)(uintptr_t)args->data_ptr,
944+ args->size)) {
945+ ret = -EFAULT;
946+ goto err;
945947 }
946948
947949 /* We can only do the GTT pwrite on untiled buffers, as otherwise
@@ -975,8 +977,8 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, · 27 unmodified lines
975977 DRM_INFO("pwrite failed %d\n", ret);
976978 #endif
977979
980+err:
978981 drm_gem_object_unreference_unlocked(obj);
979−
980982 return ret;
981983 }
982984
@@ -2400,7 +2402,7 @@ i915_gem_clear_fence_reg(struct drm_gem_object *obj) · 1417 unmodified lines
24002402 I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0);
24012403 break;
24022404 case 3:
2403− if (obj_priv->fence_reg > 8)
2405+ if (obj_priv->fence_reg >= 8)
24042406 fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg - 8) * 4;
24052407 else
24062408 case 2:
@@ -3258,6 +3260,8 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, · 851 unmodified lines
32583260 (int) reloc->offset,
32593261 reloc->read_domains,
32603262 reloc->write_domain);
3263+ drm_gem_object_unreference(target_obj);
3264+ i915_gem_object_unpin(obj);
32613265 return -EINVAL;
32623266 }
32633267 if (reloc->write_domain & I915_GEM_DOMAIN_CPU ||
drivers/gpu/drm/i915/i915_gem_evict.c+20−25
@@ -93,7 +93,7 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen · 92 unmodified lines
9393 {
9494 drm_i915_private_t *dev_priv = dev->dev_private;
9595 struct list_head eviction_list, unwind_list;
96− struct drm_i915_gem_object *obj_priv, *tmp_obj_priv;
96+ struct drm_i915_gem_object *obj_priv;
9797 struct list_head *render_iter, *bsd_iter;
9898 int ret = 0;
9999
@@ -175,39 +175,34 @@ i915_gem_evict_something(struct drm_device *dev, int min_size, unsigned alignmen · 75 unmodified lines
175175 return -ENOSPC;
176176
177177 found:
178+ /* drm_mm doesn't allow any other other operations while
179+ * scanning, therefore store to be evicted objects on a
180+ * temporary list. */
178181 INIT_LIST_HEAD(&eviction_list);
179− list_for_each_entry_safe(obj_priv, tmp_obj_priv,
180− &unwind_list, evict_list) {
182+ while (!list_empty(&unwind_list)) {
183+ obj_priv = list_first_entry(&unwind_list,
184+ struct drm_i915_gem_object,
185+ evict_list);
181186 if (drm_mm_scan_remove_block(obj_priv->gtt_space)) {
182− /* drm_mm doesn't allow any other other operations while
183− * scanning, therefore store to be evicted objects on a
184− * temporary list. */
185187 list_move(&obj_priv->evict_list, &eviction_list);
186− } else
187− drm_gem_object_unreference(&obj_priv->base);
188+ continue;
189+ }
190+ list_del(&obj_priv->evict_list);
191+ drm_gem_object_unreference(&obj_priv->base);
188192 }
189193
190194 /* Unbinding will emit any required flushes */
191− list_for_each_entry_safe(obj_priv, tmp_obj_priv,
192− &eviction_list, evict_list) {
193−#if WATCH_LRU
194− DRM_INFO("%s: evicting %p\n", __func__, &obj_priv->base);
195−#endif
196− ret = i915_gem_object_unbind(&obj_priv->base);
197− if (ret)
198− return ret;
199−
195+ while (!list_empty(&eviction_list)) {
196+ obj_priv = list_first_entry(&eviction_list,
197+ struct drm_i915_gem_object,
198+ evict_list);
199+ if (ret == 0)
200+ ret = i915_gem_object_unbind(&obj_priv->base);
201+ list_del(&obj_priv->evict_list);
200202 drm_gem_object_unreference(&obj_priv->base);
201203 }
202204
203− /* The just created free hole should be on the top of the free stack
204− * maintained by drm_mm, so this BUG_ON actually executes in O(1).
205− * Furthermore all accessed data has just recently been used, so it
206− * should be really fast, too. */
207− BUG_ON(!drm_mm_search_free(&dev_priv->mm.gtt_space, min_size,
208− alignment, 0));
209−
210− return 0;
205+ return ret;
211206 }
212207
213208 int
drivers/gpu/drm/i915/intel_display.c+38−24
@@ -1013,8 +1013,8 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe) · 1012 unmodified lines
10131013 DRM_DEBUG_KMS("vblank wait timed out\n");
10141014 }
10151015
1016−/**
1017− * intel_wait_for_vblank_off - wait for vblank after disabling a pipe
1016+/*
1017+ * intel_wait_for_pipe_off - wait for pipe to turn off
10181018 * @dev: drm device
10191019 * @pipe: pipe to wait for
10201020 *
@@ -1022,25 +1022,39 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe) · 1 unmodified line
10221022 * spinning on the vblank interrupt status bit, since we won't actually
10231023 * see an interrupt when the pipe is disabled.
10241024 *
1025− * So this function waits for the display line value to settle (it
1026− * usually ends up stopping at the start of the next frame).
1025+ * On Gen4 and above:
1026+ * wait for the pipe register state bit to turn off
1027+ *
1028+ * Otherwise:
1029+ * wait for the display line value to settle (it usually
1030+ * ends up stopping at the start of the next frame).
1031+ *
10271032 */
1028−void intel_wait_for_vblank_off(struct drm_device *dev, int pipe)
1033+static void intel_wait_for_pipe_off(struct drm_device *dev, int pipe)
10291034 {
10301035 struct drm_i915_private *dev_priv = dev->dev_private;
1031− int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL);
1032− unsigned long timeout = jiffies + msecs_to_jiffies(100);
1033− u32 last_line;
1034−
1035− /* Wait for the display line to settle */
1036− do {
1037− last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK;
1038− mdelay(5);
1039− } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) &&
1040− time_after(timeout, jiffies));
1041−
1042− if (time_after(jiffies, timeout))
1043− DRM_DEBUG_KMS("vblank wait timed out\n");
1036+
1037+ if (INTEL_INFO(dev)->gen >= 4) {
1038+ int pipeconf_reg = (pipe == 0 ? PIPEACONF : PIPEBCONF);
1039+
1040+ /* Wait for the Pipe State to go off */
1041+ if (wait_for((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) == 0,
1042+ 100, 0))
1043+ DRM_DEBUG_KMS("pipe_off wait timed out\n");
1044+ } else {
1045+ u32 last_line;
1046+ int pipedsl_reg = (pipe == 0 ? PIPEADSL : PIPEBDSL);
1047+ unsigned long timeout = jiffies + msecs_to_jiffies(100);
1048+
1049+ /* Wait for the display line to settle */
1050+ do {
1051+ last_line = I915_READ(pipedsl_reg) & DSL_LINEMASK;
1052+ mdelay(5);
1053+ } while (((I915_READ(pipedsl_reg) & DSL_LINEMASK) != last_line) &&
1054+ time_after(timeout, jiffies));
1055+ if (time_after(jiffies, timeout))
1056+ DRM_DEBUG_KMS("pipe_off wait timed out\n");
1057+ }
10441058 }
10451059
10461060 /* Parameters have changed, update FBC info */
@@ -2328,13 +2342,13 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) · 1281 unmodified lines
23282342 I915_READ(dspbase_reg);
23292343 }
23302344
2331− /* Wait for vblank for the disable to take effect */
2332− intel_wait_for_vblank_off(dev, pipe);
2333−
23342345 /* Don't disable pipe A or pipe A PLLs if needed */
23352346 if (pipeconf_reg == PIPEACONF &&
2336− (dev_priv->quirks & QUIRK_PIPEA_FORCE))
2347+ (dev_priv->quirks & QUIRK_PIPEA_FORCE)) {
2348+ /* Wait for vblank for the disable to take effect */
2349+ intel_wait_for_vblank(dev, pipe);
23372350 goto skip_pipe_off;
2351+ }
23382352
23392353 /* Next, disable display pipes */
23402354 temp = I915_READ(pipeconf_reg);
@@ -2343,8 +2357,8 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) · 2 unmodified lines
23432357 I915_READ(pipeconf_reg);
23442358 }
23452359
2346− /* Wait for vblank for the disable to take effect. */
2347− intel_wait_for_vblank_off(dev, pipe);
2360+ /* Wait for the pipe to turn off */
2361+ intel_wait_for_pipe_off(dev, pipe);
23482362
23492363 temp = I915_READ(dpll_reg);
23502364 if ((temp & DPLL_VCO_ENABLE) != 0) {
drivers/gpu/drm/i915/intel_dp.c+9−10
@@ -1138,18 +1138,14 @@ static bool · 1137 unmodified lines
11381138 intel_dp_set_link_train(struct intel_dp *intel_dp,
11391139 uint32_t dp_reg_value,
11401140 uint8_t dp_train_pat,
1141− uint8_t train_set[4],
1142− bool first)
1141+ uint8_t train_set[4])
11431142 {
11441143 struct drm_device *dev = intel_dp->base.enc.dev;
11451144 struct drm_i915_private *dev_priv = dev->dev_private;
1146− struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc);
11471145 int ret;
11481146
11491147 I915_WRITE(intel_dp->output_reg, dp_reg_value);
11501148 POSTING_READ(intel_dp->output_reg);
1151− if (first)
1152− intel_wait_for_vblank(dev, intel_crtc->pipe);
11531149
11541150 intel_dp_aux_native_write_1(intel_dp,
11551151 DP_TRAINING_PATTERN_SET,
@@ -1174,10 +1170,15 @@ intel_dp_link_train(struct intel_dp *intel_dp) · 18 unmodified lines
11741170 uint8_t voltage;
11751171 bool clock_recovery = false;
11761172 bool channel_eq = false;
1177− bool first = true;
11781173 int tries;
11791174 u32 reg;
11801175 uint32_t DP = intel_dp->DP;
1176+ struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.enc.crtc);
1177+
1178+ /* Enable output, wait for it to become active */
1179+ I915_WRITE(intel_dp->output_reg, intel_dp->DP);
1180+ POSTING_READ(intel_dp->output_reg);
1181+ intel_wait_for_vblank(dev, intel_crtc->pipe);
11811182
11821183 /* Write the link configuration data */
11831184 intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET,
@@ -1210,9 +1211,8 @@ intel_dp_link_train(struct intel_dp *intel_dp) · 26 unmodified lines
12101211 reg = DP | DP_LINK_TRAIN_PAT_1;
12111212
12121213 if (!intel_dp_set_link_train(intel_dp, reg,
1213− DP_TRAINING_PATTERN_1, train_set, first))
1214+ DP_TRAINING_PATTERN_1, train_set))
12141215 break;
1215− first = false;
12161216 /* Set training pattern 1 */
12171217
12181218 udelay(100);
@@ -1266,8 +1266,7 @@ intel_dp_link_train(struct intel_dp *intel_dp) · 47 unmodified lines
12661266
12671267 /* channel eq pattern */
12681268 if (!intel_dp_set_link_train(intel_dp, reg,
1269− DP_TRAINING_PATTERN_2, train_set,
1270− false))
1269+ DP_TRAINING_PATTERN_2, train_set))
12711270 break;
12721271
12731272 udelay(400);
drivers/gpu/drm/i915/intel_drv.h+0−1
@@ -229,7 +229,6 @@ extern struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev, · 228 unmodified lines
229229 struct drm_crtc *crtc);
230230 int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
231231 struct drm_file *file_priv);
232−extern void intel_wait_for_vblank_off(struct drm_device *dev, int pipe);
233232 extern void intel_wait_for_vblank(struct drm_device *dev, int pipe);
234233 extern struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe);
235234 extern struct drm_crtc *intel_get_load_detect_pipe(struct intel_encoder *intel_encoder,
drivers/gpu/drm/i915/intel_fb.c+3−1
@@ -237,8 +237,10 @@ int intel_fbdev_destroy(struct drm_device *dev, · 236 unmodified lines
237237 drm_fb_helper_fini(&ifbdev->helper);
238238
239239 drm_framebuffer_cleanup(&ifb->base);
240− if (ifb->obj)
240+ if (ifb->obj) {
241+ drm_gem_object_handle_unreference(ifb->obj);
241242 drm_gem_object_unreference(ifb->obj);
243+ }
242244
243245 return 0;
244246 }
drivers/gpu/drm/i915/intel_sdvo.c+6−9
@@ -2170,8 +2170,7 @@ intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) · 2169 unmodified lines
21702170 return true;
21712171
21722172 err:
2173− intel_sdvo_destroy_enhance_property(connector);
2174− kfree(intel_sdvo_connector);
2173+ intel_sdvo_destroy(connector);
21752174 return false;
21762175 }
21772176
@@ -2243,8 +2242,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) · 65 unmodified lines
22432242 return true;
22442243
22452244 err:
2246− intel_sdvo_destroy_enhance_property(connector);
2247− kfree(intel_sdvo_connector);
2245+ intel_sdvo_destroy(connector);
22482246 return false;
22492247 }
22502248
@@ -2522,11 +2520,10 @@ static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo, · 271 unmodified lines
25222520 uint16_t response;
25232521 } enhancements;
25242522
2525− if (!intel_sdvo_get_value(intel_sdvo,
2526− SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS,
2527− &enhancements, sizeof(enhancements)))
2528− return false;
2529−
2523+ enhancements.response = 0;
2524+ intel_sdvo_get_value(intel_sdvo,
2525+ SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS,
2526+ &enhancements, sizeof(enhancements));
25302527 if (enhancements.response == 0) {
25312528 DRM_DEBUG_KMS("No enhancement is supported\n");
25322529 return true;
drivers/gpu/drm/nouveau/nouveau_connector.c+4−2
@@ -558,8 +558,10 @@ nouveau_connector_get_modes(struct drm_connector *connector) · 557 unmodified lines
558558 if (nv_encoder->dcb->type == OUTPUT_LVDS &&
559559 (nv_encoder->dcb->lvdsconf.use_straps_for_mode ||
560560 dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) {
561− nv_connector->native_mode = drm_mode_create(dev);
562− nouveau_bios_fp_mode(dev, nv_connector->native_mode);
561+ struct drm_display_mode mode;
562+
563+ nouveau_bios_fp_mode(dev, &mode);
564+ nv_connector->native_mode = drm_mode_duplicate(dev, &mode);
563565 }
564566
565567 /* Find the native mode if this is a digital panel, if we didn't
drivers/gpu/drm/nouveau/nouveau_fbcon.c+1−0
@@ -352,6 +352,7 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *nfbdev) · 351 unmodified lines
352352
353353 if (nouveau_fb->nvbo) {
354354 nouveau_bo_unmap(nouveau_fb->nvbo);
355+ drm_gem_object_handle_unreference_unlocked(nouveau_fb->nvbo->gem);
355356 drm_gem_object_unreference_unlocked(nouveau_fb->nvbo->gem);
356357 nouveau_fb->nvbo = NULL;
357358 }
drivers/gpu/drm/nouveau/nouveau_gem.c+2−4
@@ -167,11 +167,9 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, · 166 unmodified lines
167167 goto out;
168168
169169 ret = drm_gem_handle_create(file_priv, nvbo->gem, &req->info.handle);
170+ /* drop reference from allocate - handle holds it now */
171+ drm_gem_object_unreference_unlocked(nvbo->gem);
170172 out:
171− drm_gem_object_handle_unreference_unlocked(nvbo->gem);
172−
173− if (ret)
174− drm_gem_object_unreference_unlocked(nvbo->gem);
175173 return ret;
176174 }
177175
drivers/gpu/drm/nouveau/nouveau_notifier.c+1−0
@@ -79,6 +79,7 @@ nouveau_notifier_takedown_channel(struct nouveau_channel *chan) · 78 unmodified lines
7979 mutex_lock(&dev->struct_mutex);
8080 nouveau_bo_unpin(chan->notifier_bo);
8181 mutex_unlock(&dev->struct_mutex);
82+ drm_gem_object_handle_unreference_unlocked(chan->notifier_bo->gem);
8283 drm_gem_object_unreference_unlocked(chan->notifier_bo->gem);
8384 drm_mm_takedown(&chan->notifier_heap);
8485 }
drivers/gpu/drm/radeon/atombios.h+1−1
@@ -4999,7 +4999,7 @@ typedef struct _SW_I2C_IO_DATA_PARAMETERS · 4998 unmodified lines
49994999 #define SW_I2C_CNTL_WRITE1BIT 6
50005000
50015001 //==============================VESA definition Portion===============================
5002−#define VESA_OEM_PRODUCT_REV '01.00'
5002+#define VESA_OEM_PRODUCT_REV "01.00"
50035003 #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT 0xBB //refer to VBE spec p.32, no TTY support
50045004 #define VESA_MODE_WIN_ATTRIBUTE 7
50055005 #define VESA_WIN_SIZE 64
drivers/gpu/drm/radeon/r600.c+3−2
@@ -2729,7 +2729,7 @@ int r600_ib_test(struct radeon_device *rdev) · 2728 unmodified lines
27292729 if (i < rdev->usec_timeout) {
27302730 DRM_INFO("ib test succeeded in %u usecs\n", i);
27312731 } else {
2732− DRM_ERROR("radeon: ib test failed (sracth(0x%04X)=0x%08X)\n",
2732+ DRM_ERROR("radeon: ib test failed (scratch(0x%04X)=0x%08X)\n",
27332733 scratch, tmp);
27342734 r = -EINVAL;
27352735 }
@@ -3528,7 +3528,8 @@ void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo) · 792 unmodified lines
35283528 /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read
35293529 * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL
35303530 */
3531− if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740)) {
3531+ if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) &&
3532+ rdev->vram_scratch.ptr) {
35323533 void __iomem *ptr = (void *)rdev->vram_scratch.ptr;
35333534 u32 tmp;
35343535
drivers/gpu/drm/radeon/radeon_atombios.c+9−0
@@ -317,6 +317,15 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, · 316 unmodified lines
317317 *connector_type = DRM_MODE_CONNECTOR_DVID;
318318 }
319319
320+ /* MSI K9A2GM V2/V3 board has no HDMI or DVI */
321+ if ((dev->pdev->device == 0x796e) &&
322+ (dev->pdev->subsystem_vendor == 0x1462) &&
323+ (dev->pdev->subsystem_device == 0x7302)) {
324+ if ((supported_device == ATOM_DEVICE_DFP2_SUPPORT) ||
325+ (supported_device == ATOM_DEVICE_DFP3_SUPPORT))
326+ return false;
327+ }
328+
320329 /* a-bit f-i90hd - ciaranm on #radeonhd - this board has no DVI */
321330 if ((dev->pdev->device == 0x7941) &&
322331 (dev->pdev->subsystem_vendor == 0x147b) &&
drivers/gpu/drm/radeon/radeon_display.c+4−1
@@ -349,6 +349,8 @@ static void radeon_print_display_setup(struct drm_device *dev) · 348 unmodified lines
349349 DRM_INFO(" DFP4: %s\n", encoder_names[radeon_encoder->encoder_id]);
350350 if (devices & ATOM_DEVICE_DFP5_SUPPORT)
351351 DRM_INFO(" DFP5: %s\n", encoder_names[radeon_encoder->encoder_id]);
352+ if (devices & ATOM_DEVICE_DFP6_SUPPORT)
353+ DRM_INFO(" DFP6: %s\n", encoder_names[radeon_encoder->encoder_id]);
352354 if (devices & ATOM_DEVICE_TV1_SUPPORT)
353355 DRM_INFO(" TV1: %s\n", encoder_names[radeon_encoder->encoder_id]);
354356 if (devices & ATOM_DEVICE_CV_SUPPORT)
@@ -841,8 +843,9 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb) · 486 unmodified lines
841843 {
842844 struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb);
843845
844− if (radeon_fb->obj)
846+ if (radeon_fb->obj) {
845847 drm_gem_object_unreference_unlocked(radeon_fb->obj);
848+ }
846849 drm_framebuffer_cleanup(fb);
847850 kfree(radeon_fb);
848851 }
drivers/gpu/drm/radeon/radeon_fb.c+4−10
@@ -94,8 +94,10 @@ static void radeonfb_destroy_pinned_object(struct drm_gem_object *gobj) · 93 unmodified lines
9494 ret = radeon_bo_reserve(rbo, false);
9595 if (likely(ret == 0)) {
9696 radeon_bo_kunmap(rbo);
97+ radeon_bo_unpin(rbo);
9798 radeon_bo_unreserve(rbo);
9899 }
100+ drm_gem_object_handle_unreference(gobj);
99101 drm_gem_object_unreference_unlocked(gobj);
100102 }
101103
@@ -325,8 +327,6 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb · 223 unmodified lines
325327 {
326328 struct fb_info *info;
327329 struct radeon_framebuffer *rfb = &rfbdev->rfb;
328− struct radeon_bo *rbo;
329− int r;
330330
331331 if (rfbdev->helper.fbdev) {
332332 info = rfbdev->helper.fbdev;
@@ -338,14 +338,8 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb · 5 unmodified lines
338338 }
339339
340340 if (rfb->obj) {
341− rbo = rfb->obj->driver_private;
342− r = radeon_bo_reserve(rbo, false);
343− if (likely(r == 0)) {
344− radeon_bo_kunmap(rbo);
345− radeon_bo_unpin(rbo);
346− radeon_bo_unreserve(rbo);
347− }
348− drm_gem_object_unreference_unlocked(rfb->obj);
341+ radeonfb_destroy_pinned_object(rfb->obj);
342+ rfb->obj = NULL;
349343 }
350344 drm_fb_helper_fini(&rfbdev->helper);
351345 drm_framebuffer_cleanup(&rfb->base);
drivers/gpu/drm/radeon/radeon_gem.c+2−2
@@ -201,11 +201,11 @@ int radeon_gem_create_ioctl(struct drm_device *dev, void *data, · 200 unmodified lines
201201 return r;
202202 }
203203 r = drm_gem_handle_create(filp, gobj, &handle);
204+ /* drop reference from allocate - handle holds it now */
205+ drm_gem_object_unreference_unlocked(gobj);
204206 if (r) {
205− drm_gem_object_unreference_unlocked(gobj);
206207 return r;
207208 }
208− drm_gem_object_handle_unreference_unlocked(gobj);
209209 args->handle = handle;
210210 return 0;
211211 }
drivers/gpu/drm/radeon/radeon_kms.c+4−0
@@ -203,6 +203,10 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 202 unmodified lines
203203 */
204204 int radeon_driver_firstopen_kms(struct drm_device *dev)
205205 {
206+ struct radeon_device *rdev = dev->dev_private;
207+
208+ if (rdev->powered_down)
209+ return -EINVAL;
206210 return 0;
207211 }
208212
drivers/gpu/drm/ttm/ttm_bo_util.c+1−0
@@ -351,6 +351,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, · 350 unmodified lines
351351 INIT_LIST_HEAD(&fbo->lru);
352352 INIT_LIST_HEAD(&fbo->swap);
353353 fbo->vm_node = NULL;
354+ atomic_set(&fbo->cpu_writers, 0);
354355
355356 fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj);
356357 kref_init(&fbo->list_kref);
drivers/gpu/drm/ttm/ttm_page_alloc.c+4−4
@@ -69,7 +69,7 @@ struct ttm_page_pool { · 68 unmodified lines
6969 spinlock_t lock;
7070 bool fill_lock;
7171 struct list_head list;
72− int gfp_flags;
72+ gfp_t gfp_flags;
7373 unsigned npages;
7474 char *name;
7575 unsigned long nfrees;
@@ -475,7 +475,7 @@ static void ttm_handle_caching_state_failure(struct list_head *pages, · 399 unmodified lines
475475 * This function is reentrant if caller updates count depending on number of
476476 * pages returned in pages array.
477477 */
478−static int ttm_alloc_new_pages(struct list_head *pages, int gfp_flags,
478+static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,
479479 int ttm_flags, enum ttm_caching_state cstate, unsigned count)
480480 {
481481 struct page **caching_array;
@@ -666,7 +666,7 @@ int ttm_get_pages(struct list_head *pages, int flags, · 184 unmodified lines
666666 {
667667 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
668668 struct page *p = NULL;
669− int gfp_flags = GFP_USER;
669+ gfp_t gfp_flags = GFP_USER;
670670 int r;
671671
672672 /* set zero flag for page allocation if required */
@@ -818,7 +818,7 @@ int ttm_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) · 145 unmodified lines
818818 return 0;
819819 }
820820
821−void ttm_page_alloc_fini()
821+void ttm_page_alloc_fini(void)
822822 {
823823 int i;
824824
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+110−35
@@ -148,13 +148,16 @@ static struct pci_device_id vmw_pci_id_list[] = { · 147 unmodified lines
148148 {0, 0, 0}
149149 };
150150
151−static char *vmw_devname = "vmwgfx";
151+static int enable_fbdev;
152152
153153 static int vmw_probe(struct pci_dev *, const struct pci_device_id *);
154154 static void vmw_master_init(struct vmw_master *);
155155 static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val,
156156 void *ptr);
157157
158+MODULE_PARM_DESC(enable_fbdev, "Enable vmwgfx fbdev");
159+module_param_named(enable_fbdev, enable_fbdev, int, 0600);
160+
158161 static void vmw_print_capabilities(uint32_t capabilities)
159162 {
160163 DRM_INFO("Capabilities:\n");
@@ -192,8 +195,6 @@ static int vmw_request_device(struct vmw_private *dev_priv) · 31 unmodified lines
192195 {
193196 int ret;
194197
195− vmw_kms_save_vga(dev_priv);
196−
197198 ret = vmw_fifo_init(dev_priv, &dev_priv->fifo);
198199 if (unlikely(ret != 0)) {
199200 DRM_ERROR("Unable to initialize FIFO.\n");
@@ -206,9 +207,35 @@ static int vmw_request_device(struct vmw_private *dev_priv) · 6 unmodified lines
206207 static void vmw_release_device(struct vmw_private *dev_priv)
207208 {
208209 vmw_fifo_release(dev_priv, &dev_priv->fifo);
209− vmw_kms_restore_vga(dev_priv);
210210 }
211211
212+int vmw_3d_resource_inc(struct vmw_private *dev_priv)
213+{
214+ int ret = 0;
215+
216+ mutex_lock(&dev_priv->release_mutex);
217+ if (unlikely(dev_priv->num_3d_resources++ == 0)) {
218+ ret = vmw_request_device(dev_priv);
219+ if (unlikely(ret != 0))
220+ --dev_priv->num_3d_resources;
221+ }
222+ mutex_unlock(&dev_priv->release_mutex);
223+ return ret;
224+}
225+
226+
227+void vmw_3d_resource_dec(struct vmw_private *dev_priv)
228+{
229+ int32_t n3d;
230+
231+ mutex_lock(&dev_priv->release_mutex);
232+ if (unlikely(--dev_priv->num_3d_resources == 0))
233+ vmw_release_device(dev_priv);
234+ n3d = (int32_t) dev_priv->num_3d_resources;
235+ mutex_unlock(&dev_priv->release_mutex);
236+
237+ BUG_ON(n3d < 0);
238+}
212239
213240 static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
214241 {
@@ -228,6 +255,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) · 13 unmodified lines
228255 dev_priv->last_read_sequence = (uint32_t) -100;
229256 mutex_init(&dev_priv->hw_mutex);
230257 mutex_init(&dev_priv->cmdbuf_mutex);
258+ mutex_init(&dev_priv->release_mutex);
231259 rwlock_init(&dev_priv->resource_lock);
232260 idr_init(&dev_priv->context_idr);
233261 idr_init(&dev_priv->surface_idr);
@@ -244,6 +272,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) · 10 unmodified lines
244272 dev_priv->vram_start = pci_resource_start(dev->pdev, 1);
245273 dev_priv->mmio_start = pci_resource_start(dev->pdev, 2);
246274
275+ dev_priv->enable_fb = enable_fbdev;
276+
247277 mutex_lock(&dev_priv->hw_mutex);
248278
249279 vmw_write(dev_priv, SVGA_REG_ID, SVGA_ID_2);
@@ -343,17 +373,6 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) · 93 unmodified lines
343373
344374 dev->dev_private = dev_priv;
345375
346− if (!dev->devname)
347− dev->devname = vmw_devname;
348−
349− if (dev_priv->capabilities & SVGA_CAP_IRQMASK) {
350− ret = drm_irq_install(dev);
351− if (unlikely(ret != 0)) {
352− DRM_ERROR("Failed installing irq: %d\n", ret);
353− goto out_no_irq;
354− }
355− }
356−
357376 ret = pci_request_regions(dev->pdev, "vmwgfx probe");
358377 dev_priv->stealth = (ret != 0);
359378 if (dev_priv->stealth) {
@@ -369,26 +388,52 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) · 9 unmodified lines
369388 goto out_no_device;
370389 }
371390 }
372− ret = vmw_request_device(dev_priv);
391+ ret = vmw_kms_init(dev_priv);
373392 if (unlikely(ret != 0))
374− goto out_no_device;
375− vmw_kms_init(dev_priv);
393+ goto out_no_kms;
376394 vmw_overlay_init(dev_priv);
377− vmw_fb_init(dev_priv);
395+ if (dev_priv->enable_fb) {
396+ ret = vmw_3d_resource_inc(dev_priv);
397+ if (unlikely(ret != 0))
398+ goto out_no_fifo;
399+ vmw_kms_save_vga(dev_priv);
400+ vmw_fb_init(dev_priv);
401+ DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ?
402+ "Detected device 3D availability.\n" :
403+ "Detected no device 3D availability.\n");
404+ } else {
405+ DRM_INFO("Delayed 3D detection since we're not "
406+ "running the device in SVGA mode yet.\n");
407+ }
408+
409+ if (dev_priv->capabilities & SVGA_CAP_IRQMASK) {
410+ ret = drm_irq_install(dev);
411+ if (unlikely(ret != 0)) {
412+ DRM_ERROR("Failed installing irq: %d\n", ret);
413+ goto out_no_irq;
414+ }
415+ }
378416
379417 dev_priv->pm_nb.notifier_call = vmwgfx_pm_notifier;
380418 register_pm_notifier(&dev_priv->pm_nb);
381419
382− DRM_INFO("%s", vmw_fifo_have_3d(dev_priv) ? "Have 3D\n" : "No 3D\n");
383−
384420 return 0;
385421
386−out_no_device:
387− if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
388− drm_irq_uninstall(dev_priv->dev);
389− if (dev->devname == vmw_devname)
390− dev->devname = NULL;
391422 out_no_irq:
423+ if (dev_priv->enable_fb) {
424+ vmw_fb_close(dev_priv);
425+ vmw_kms_restore_vga(dev_priv);
426+ vmw_3d_resource_dec(dev_priv);
427+ }
428+out_no_fifo:
429+ vmw_overlay_close(dev_priv);
430+ vmw_kms_close(dev_priv);
431+out_no_kms:
432+ if (dev_priv->stealth)
433+ pci_release_region(dev->pdev, 2);
434+ else
435+ pci_release_regions(dev->pdev);
436+out_no_device:
392437 ttm_object_device_release(&dev_priv->tdev);
393438 out_err4:
394439 iounmap(dev_priv->mmio_virt);
@@ -415,19 +460,20 @@ static int vmw_driver_unload(struct drm_device *dev) · 20 unmodified lines
415460
416461 unregister_pm_notifier(&dev_priv->pm_nb);
417462
418− vmw_fb_close(dev_priv);
463+ if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
464+ drm_irq_uninstall(dev_priv->dev);
465+ if (dev_priv->enable_fb) {
466+ vmw_fb_close(dev_priv);
467+ vmw_kms_restore_vga(dev_priv);
468+ vmw_3d_resource_dec(dev_priv);
469+ }
419470 vmw_kms_close(dev_priv);
420471 vmw_overlay_close(dev_priv);
421− vmw_release_device(dev_priv);
422472 if (dev_priv->stealth)
423473 pci_release_region(dev->pdev, 2);
424474 else
425475 pci_release_regions(dev->pdev);
426476
427− if (dev_priv->capabilities & SVGA_CAP_IRQMASK)
428− drm_irq_uninstall(dev_priv->dev);
429− if (dev->devname == vmw_devname)
430− dev->devname = NULL;
431477 ttm_object_device_release(&dev_priv->tdev);
432478 iounmap(dev_priv->mmio_virt);
433479 drm_mtrr_del(dev_priv->mmio_mtrr, dev_priv->mmio_start,
@@ -500,7 +546,7 @@ static long vmw_unlocked_ioctl(struct file *filp, unsigned int cmd, · 66 unmodified lines
500546 struct drm_ioctl_desc *ioctl =
501547 &vmw_ioctls[nr - DRM_COMMAND_BASE];
502548
503− if (unlikely(ioctl->cmd != cmd)) {
549+ if (unlikely(ioctl->cmd_drv != cmd)) {
504550 DRM_ERROR("Invalid command format, ioctl %d\n",
505551 nr - DRM_COMMAND_BASE);
506552 return -EINVAL;
@@ -589,6 +635,16 @@ static int vmw_master_set(struct drm_device *dev, · 82 unmodified lines
589635 struct vmw_master *vmaster = vmw_master(file_priv->master);
590636 int ret = 0;
591637
638+ if (!dev_priv->enable_fb) {
639+ ret = vmw_3d_resource_inc(dev_priv);
640+ if (unlikely(ret != 0))
641+ return ret;
642+ vmw_kms_save_vga(dev_priv);
643+ mutex_lock(&dev_priv->hw_mutex);
644+ vmw_write(dev_priv, SVGA_REG_TRACES, 0);
645+ mutex_unlock(&dev_priv->hw_mutex);
646+ }
647+
592648 if (active) {
593649 BUG_ON(active != &dev_priv->fbdev_master);
594650 ret = ttm_vt_lock(&active->lock, false, vmw_fp->tfile);
@@ -617,7 +673,13 @@ static int vmw_master_set(struct drm_device *dev, · 22 unmodified lines
617673 return 0;
618674
619675 out_no_active_lock:
620− vmw_release_device(dev_priv);
676+ if (!dev_priv->enable_fb) {
677+ mutex_lock(&dev_priv->hw_mutex);
678+ vmw_write(dev_priv, SVGA_REG_TRACES, 1);
679+ mutex_unlock(&dev_priv->hw_mutex);
680+ vmw_kms_restore_vga(dev_priv);
681+ vmw_3d_resource_dec(dev_priv);
682+ }
621683 return ret;
622684 }
623685
@@ -645,11 +707,23 @@ static void vmw_master_drop(struct drm_device *dev, · 21 unmodified lines
645707
646708 ttm_lock_set_kill(&vmaster->lock, true, SIGTERM);
647709
710+ if (!dev_priv->enable_fb) {
711+ ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM);
712+ if (unlikely(ret != 0))
713+ DRM_ERROR("Unable to clean VRAM on master drop.\n");
714+ mutex_lock(&dev_priv->hw_mutex);
715+ vmw_write(dev_priv, SVGA_REG_TRACES, 1);
716+ mutex_unlock(&dev_priv->hw_mutex);
717+ vmw_kms_restore_vga(dev_priv);
718+ vmw_3d_resource_dec(dev_priv);
719+ }
720+
648721 dev_priv->active_master = &dev_priv->fbdev_master;
649722 ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM);
650723 ttm_vt_unlock(&dev_priv->fbdev_master.lock);
651724
652− vmw_fb_on(dev_priv);
725+ if (dev_priv->enable_fb)
726+ vmw_fb_on(dev_priv);
653727 }
654728
655729
@@ -722,6 +796,7 @@ static struct drm_driver driver = { · 66 unmodified lines
722796 .irq_postinstall = vmw_irq_postinstall,
723797 .irq_uninstall = vmw_irq_uninstall,
724798 .irq_handler = vmw_irq_handler,
799+ .get_vblank_counter = vmw_get_vblank_counter,
725800 .reclaim_buffers_locked = NULL,
726801 .get_map_ofs = drm_core_get_map_ofs,
727802 .get_reg_ofs = drm_core_get_reg_ofs,
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h+8−0
@@ -277,6 +277,7 @@ struct vmw_private { · 276 unmodified lines
277277
278278 bool stealth;
279279 bool is_opened;
280+ bool enable_fb;
280281
281282 /**
282283 * Master management.
@@ -285,6 +286,9 @@ struct vmw_private { · 2 unmodified lines
285286 struct vmw_master *active_master;
286287 struct vmw_master fbdev_master;
287288 struct notifier_block pm_nb;
289+
290+ struct mutex release_mutex;
291+ uint32_t num_3d_resources;
288292 };
289293
290294 static inline struct vmw_private *vmw_priv(struct drm_device *dev)
@@ -319,6 +323,9 @@ static inline uint32_t vmw_read(struct vmw_private *dev_priv, · 28 unmodified lines
319323 return val;
320324 }
321325
326+int vmw_3d_resource_inc(struct vmw_private *dev_priv);
327+void vmw_3d_resource_dec(struct vmw_private *dev_priv);
328+
322329 /**
323330 * GMR utilities - vmwgfx_gmr.c
324331 */
@@ -511,6 +518,7 @@ void vmw_kms_write_svga(struct vmw_private *vmw_priv, · 186 unmodified lines
511518 unsigned bbp, unsigned depth);
512519 int vmw_kms_update_layout_ioctl(struct drm_device *dev, void *data,
513520 struct drm_file *file_priv);
521+u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc);
514522
515523 /**
516524 * Overlay control - vmwgfx_overlay.c
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c+5−0
@@ -615,6 +615,11 @@ int vmw_dmabuf_to_start_of_vram(struct vmw_private *vmw_priv, · 614 unmodified lines
615615 if (unlikely(ret != 0))
616616 goto err_unlock;
617617
618+ if (bo->mem.mem_type == TTM_PL_VRAM &&
619+ bo->mem.mm_node->start < bo->num_pages)
620+ (void) ttm_bo_validate(bo, &vmw_sys_placement, false,
621+ false, false);
622+
618623 ret = ttm_bo_validate(bo, &ne_placement, false, false, false);
619624
620625 /* Could probably bug on */
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c+3−0
@@ -106,6 +106,7 @@ int vmw_fifo_init(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo) · 105 unmodified lines
106106 mutex_lock(&dev_priv->hw_mutex);
107107 dev_priv->enable_state = vmw_read(dev_priv, SVGA_REG_ENABLE);
108108 dev_priv->config_done_state = vmw_read(dev_priv, SVGA_REG_CONFIG_DONE);
109+ dev_priv->traces_state = vmw_read(dev_priv, SVGA_REG_TRACES);
109110 vmw_write(dev_priv, SVGA_REG_ENABLE, 1);
110111
111112 min = 4;
@@ -175,6 +176,8 @@ void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo) · 63 unmodified lines
175176 dev_priv->config_done_state);
176177 vmw_write(dev_priv, SVGA_REG_ENABLE,
177178 dev_priv->enable_state);
179+ vmw_write(dev_priv, SVGA_REG_TRACES,
180+ dev_priv->traces_state);
178181
179182 mutex_unlock(&dev_priv->hw_mutex);
180183 vmw_fence_queue_takedown(&fifo->fence_queue);
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+17−0
@@ -898,7 +898,19 @@ int vmw_kms_save_vga(struct vmw_private *vmw_priv) · 897 unmodified lines
898898 save->width = vmw_read(vmw_priv, SVGA_REG_DISPLAY_WIDTH);
899899 save->height = vmw_read(vmw_priv, SVGA_REG_DISPLAY_HEIGHT);
900900 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID);
901+ if (i == 0 && vmw_priv->num_displays == 1 &&
902+ save->width == 0 && save->height == 0) {
903+
904+ /*
905+ * It should be fairly safe to assume that these
906+ * values are uninitialized.
907+ */
908+
909+ save->width = vmw_priv->vga_width - save->pos_x;
910+ save->height = vmw_priv->vga_height - save->pos_y;
911+ }
901912 }
913+
902914 return 0;
903915 }
904916
@@ -984,3 +996,8 @@ out_unlock: · 79 unmodified lines
984996 ttm_read_unlock(&vmaster->lock);
985997 return ret;
986998 }
999+
1000+u32 vmw_get_vblank_counter(struct drm_device *dev, int crtc)
1001+{
1002+ return 0;
1003+}
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c+17−10
@@ -27,6 +27,8 @@ · 26 unmodified lines
2727
2828 #include "vmwgfx_kms.h"
2929
30+#define VMWGFX_LDU_NUM_DU 8
31+
3032 #define vmw_crtc_to_ldu(x) \
3133 container_of(x, struct vmw_legacy_display_unit, base.crtc)
3234 #define vmw_encoder_to_ldu(x) \
@@ -536,6 +538,10 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) · 503 unmodified lines
536538
537539 int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv)
538540 {
541+ struct drm_device *dev = dev_priv->dev;
542+ int i;
543+ int ret;
544+
539545 if (dev_priv->ldu_priv) {
540546 DRM_INFO("ldu system already on\n");
541547 return -EINVAL;
@@ -553,23 +559,24 @@ int vmw_kms_init_legacy_display_system(struct vmw_private *dev_priv) · 11 unmodified lines
553559
554560 drm_mode_create_dirty_info_property(dev_priv->dev);
555561
556− vmw_ldu_init(dev_priv, 0);
557− /* for old hardware without multimon only enable one display */
558562 if (dev_priv->capabilities & SVGA_CAP_MULTIMON) {
559− vmw_ldu_init(dev_priv, 1);
560− vmw_ldu_init(dev_priv, 2);
561− vmw_ldu_init(dev_priv, 3);
562− vmw_ldu_init(dev_priv, 4);
563− vmw_ldu_init(dev_priv, 5);
564− vmw_ldu_init(dev_priv, 6);
565− vmw_ldu_init(dev_priv, 7);
563+ for (i = 0; i < VMWGFX_LDU_NUM_DU; ++i)
564+ vmw_ldu_init(dev_priv, i);
565+ ret = drm_vblank_init(dev, VMWGFX_LDU_NUM_DU);
566+ } else {
567+ /* for old hardware without multimon only enable one display */
568+ vmw_ldu_init(dev_priv, 0);
569+ ret = drm_vblank_init(dev, 1);
566570 }
567571
568− return 0;
572+ return ret;
569573 }
570574
571575 int vmw_kms_close_legacy_display_system(struct vmw_private *dev_priv)
572576 {
577+ struct drm_device *dev = dev_priv->dev;
578+
579+ drm_vblank_cleanup(dev);
573580 if (!dev_priv->ldu_priv)
574581 return -ENOSYS;
575582
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c+4−0
@@ -211,6 +211,7 @@ static void vmw_hw_context_destroy(struct vmw_resource *res) · 210 unmodified lines
211211 cmd->body.cid = cpu_to_le32(res->id);
212212
213213 vmw_fifo_commit(dev_priv, sizeof(*cmd));
214+ vmw_3d_resource_dec(dev_priv);
214215 }
215216
216217 static int vmw_context_init(struct vmw_private *dev_priv,
@@ -247,6 +248,7 @@ static int vmw_context_init(struct vmw_private *dev_priv, · 30 unmodified lines
247248 cmd->body.cid = cpu_to_le32(res->id);
248249
249250 vmw_fifo_commit(dev_priv, sizeof(*cmd));
251+ (void) vmw_3d_resource_inc(dev_priv);
250252 vmw_resource_activate(res, vmw_hw_context_destroy);
251253 return 0;
252254 }
@@ -406,6 +408,7 @@ static void vmw_hw_surface_destroy(struct vmw_resource *res) · 153 unmodified lines
406408 cmd->body.sid = cpu_to_le32(res->id);
407409
408410 vmw_fifo_commit(dev_priv, sizeof(*cmd));
411+ vmw_3d_resource_dec(dev_priv);
409412 }
410413
411414 void vmw_surface_res_free(struct vmw_resource *res)
@@ -473,6 +476,7 @@ int vmw_surface_init(struct vmw_private *dev_priv, · 61 unmodified lines
473476 }
474477
475478 vmw_fifo_commit(dev_priv, submit_size);
479+ (void) vmw_3d_resource_inc(dev_priv);
476480 vmw_resource_activate(res, vmw_hw_surface_destroy);
477481 return 0;
478482 }
drivers/gpu/vga/vgaarb.c+1−1
@@ -598,7 +598,7 @@ static inline void vga_update_device_decodes(struct vga_device *vgadev, · 597 unmodified lines
598598 pr_debug("vgaarb: decoding count now is: %d\n", vga_decode_count);
599599 }
600600
601−void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace)
601+static void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace)
602602 {
603603 struct vga_device *vgadev;
604604 unsigned long flags;
drivers/hwmon/Kconfig+1−1
@@ -409,7 +409,7 @@ config SENSORS_CORETEMP · 408 unmodified lines
409409
410410 config SENSORS_PKGTEMP
411411 tristate "Intel processor package temperature sensor"
412− depends on X86 && PCI && EXPERIMENTAL
412+ depends on X86 && EXPERIMENTAL
413413 help
414414 If you say yes here you get support for the package level temperature
415415 sensor inside your CPU. Check documentation/driver for details.
drivers/hwmon/coretemp.c+33−24
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include <linux/pci.h>
3737 #include <asm/msr.h>
3838 #include <asm/processor.h>
39+#include <asm/smp.h>
3940
4041 #define DRVNAME "coretemp"
4142
@@ -423,9 +424,18 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) · 381 unmodified lines
423424 int err;
424425 struct platform_device *pdev;
425426 struct pdev_entry *pdev_entry;
426−#ifdef CONFIG_SMP
427427 struct cpuinfo_x86 *c = &cpu_data(cpu);
428−#endif
428+
429+ /*
430+ * CPUID.06H.EAX[0] indicates whether the CPU has thermal
431+ * sensors. We check this bit only, all the early CPUs
432+ * without thermal sensors will be filtered out.
433+ */
434+ if (!cpu_has(c, X86_FEATURE_DTS)) {
435+ printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"
436+ " has no thermal sensor.\n", c->x86_model);
437+ return 0;
438+ }
429439
430440 mutex_lock(&pdev_list_mutex);
431441
@@ -482,14 +492,22 @@ exit: · 50 unmodified lines
482492
483493 static void coretemp_device_remove(unsigned int cpu)
484494 {
485− struct pdev_entry *p, *n;
495+ struct pdev_entry *p;
496+ unsigned int i;
497+
486498 mutex_lock(&pdev_list_mutex);
487− list_for_each_entry_safe(p, n, &pdev_list, list) {
488− if (p->cpu == cpu) {
489− platform_device_unregister(p->pdev);
490− list_del(&p->list);
491− kfree(p);
492− }
499+ list_for_each_entry(p, &pdev_list, list) {
500+ if (p->cpu != cpu)
501+ continue;
502+
503+ platform_device_unregister(p->pdev);
504+ list_del(&p->list);
505+ mutex_unlock(&pdev_list_mutex);
506+ kfree(p);
507+ for_each_cpu(i, cpu_sibling_mask(cpu))
508+ if (i != cpu && !coretemp_device_add(i))
509+ break;
510+ return;
493511 }
494512 mutex_unlock(&pdev_list_mutex);
495513 }
@@ -527,30 +545,21 @@ static int __init coretemp_init(void) · 31 unmodified lines
527545 if (err)
528546 goto exit;
529547
530− for_each_online_cpu(i) {
531− struct cpuinfo_x86 *c = &cpu_data(i);
532− /*
533− * CPUID.06H.EAX[0] indicates whether the CPU has thermal
534− * sensors. We check this bit only, all the early CPUs
535− * without thermal sensors will be filtered out.
536− */
537− if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01))
538− coretemp_device_add(i);
539− else {
540− printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"
541− " has no thermal sensor.\n", c->x86_model);
542− }
543− }
548+ for_each_online_cpu(i)
549+ coretemp_device_add(i);
550+
551+#ifndef CONFIG_HOTPLUG_CPU
544552 if (list_empty(&pdev_list)) {
545553 err = -ENODEV;
546554 goto exit_driver_unreg;
547555 }
556+#endif
548557
549558 register_hotcpu_notifier(&coretemp_cpu_notifier);
550559 return 0;
551560
552−exit_driver_unreg:
553561 #ifndef CONFIG_HOTPLUG_CPU
562+exit_driver_unreg:
554563 platform_driver_unregister(&coretemp_driver);
555564 #endif
556565 exit:
drivers/hwmon/f71882fg.c+19−13
@@ -111,7 +111,7 @@ static struct platform_device *f71882fg_pdev; · 110 unmodified lines
111111 /* Super-I/O Function prototypes */
112112 static inline int superio_inb(int base, int reg);
113113 static inline int superio_inw(int base, int reg);
114−static inline void superio_enter(int base);
114+static inline int superio_enter(int base);
115115 static inline void superio_select(int base, int ld);
116116 static inline void superio_exit(int base);
117117
@@ -861,11 +861,20 @@ static int superio_inw(int base, int reg) · 743 unmodified lines
861861 return val;
862862 }
863863
864−static inline void superio_enter(int base)
864+static inline int superio_enter(int base)
865865 {
866+ /* Don't step on other drivers' I/O space by accident */
867+ if (!request_muxed_region(base, 2, DRVNAME)) {
868+ printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",
869+ base);
870+ return -EBUSY;
871+ }
872+
866873 /* according to the datasheet the key must be send twice! */
867874 outb(SIO_UNLOCK_KEY, base);
868875 outb(SIO_UNLOCK_KEY, base);
876+
877+ return 0;
869878 }
870879
871880 static inline void superio_select(int base, int ld)
@@ -877,6 +886,7 @@ static inline void superio_select(int base, int ld) · 5 unmodified lines
877886 static inline void superio_exit(int base)
878887 {
879888 outb(SIO_LOCK_KEY, base);
889+ release_region(base, 2);
880890 }
881891
882892 static inline int fan_from_reg(u16 reg)
@@ -2175,21 +2185,15 @@ static int f71882fg_remove(struct platform_device *pdev) · 1292 unmodified lines
21752185 static int __init f71882fg_find(int sioaddr, unsigned short *address,
21762186 struct f71882fg_sio_data *sio_data)
21772187 {
2178− int err = -ENODEV;
21792188 u16 devid;
2180−
2181− /* Don't step on other drivers' I/O space by accident */
2182− if (!request_region(sioaddr, 2, DRVNAME)) {
2183− printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",
2184− (int)sioaddr);
2185− return -EBUSY;
2186− }
2187−
2188− superio_enter(sioaddr);
2189+ int err = superio_enter(sioaddr);
2190+ if (err)
2191+ return err;
21892192
21902193 devid = superio_inw(sioaddr, SIO_REG_MANID);
21912194 if (devid != SIO_FINTEK_ID) {
21922195 pr_debug(DRVNAME ": Not a Fintek device\n");
2196+ err = -ENODEV;
21932197 goto exit;
21942198 }
21952199
@@ -2213,6 +2217,7 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, · 17 unmodified lines
22132217 default:
22142218 printk(KERN_INFO DRVNAME ": Unsupported Fintek device: %04x\n",
22152219 (unsigned int)devid);
2220+ err = -ENODEV;
22162221 goto exit;
22172222 }
22182223
@@ -2223,12 +2228,14 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, · 4 unmodified lines
22232228
22242229 if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) {
22252230 printk(KERN_WARNING DRVNAME ": Device not activated\n");
2231+ err = -ENODEV;
22262232 goto exit;
22272233 }
22282234
22292235 *address = superio_inw(sioaddr, SIO_REG_ADDR);
22302236 if (*address == 0) {
22312237 printk(KERN_WARNING DRVNAME ": Base address not set\n");
2238+ err = -ENODEV;
22322239 goto exit;
22332240 }
22342241 *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */
@@ -2239,7 +2246,6 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, · 4 unmodified lines
22392246 (int)superio_inb(sioaddr, SIO_REG_DEVREV));
22402247 exit:
22412248 superio_exit(sioaddr);
2242− release_region(sioaddr, 2);
22432249 return err;
22442250 }
22452251
drivers/hwmon/lis3lv02d.c+2−2
@@ -277,7 +277,7 @@ static irqreturn_t lis302dl_interrupt(int irq, void *dummy) · 276 unmodified lines
277277 wake_up_interruptible(&lis3_dev.misc_wait);
278278 kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN);
279279 out:
280− if (lis3_dev.whoami == WAI_8B && lis3_dev.idev &&
280+ if (lis3_dev.pdata && lis3_dev.whoami == WAI_8B && lis3_dev.idev &&
281281 lis3_dev.idev->input->users)
282282 return IRQ_WAKE_THREAD;
283283 return IRQ_HANDLED;
@@ -718,7 +718,7 @@ int lis3lv02d_init_device(struct lis3lv02d *dev) · 434 unmodified lines
718718 * io-apic is not configurable (and generates a warning) but I keep it
719719 * in case of support for other hardware.
720720 */
721− if (dev->whoami == WAI_8B)
721+ if (dev->pdata && dev->whoami == WAI_8B)
722722 thread_fn = lis302dl_interrupt_thread1_8b;
723723 else
724724 thread_fn = NULL;
drivers/hwmon/pkgtemp.c+11−12
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #include <linux/list.h>
3434 #include <linux/platform_device.h>
3535 #include <linux/cpu.h>
36−#include <linux/pci.h>
3736 #include <asm/msr.h>
3837 #include <asm/processor.h>
3938
@@ -224,7 +223,7 @@ static int __devinit pkgtemp_probe(struct platform_device *pdev) · 184 unmodified lines
224223
225224 err = sysfs_create_group(&pdev->dev.kobj, &pkgtemp_group);
226225 if (err)
227− goto exit_free;
226+ goto exit_dev;
228227
229228 data->hwmon_dev = hwmon_device_register(&pdev->dev);
230229 if (IS_ERR(data->hwmon_dev)) {
@@ -238,6 +237,8 @@ static int __devinit pkgtemp_probe(struct platform_device *pdev) · 7 unmodified lines
238237
239238 exit_class:
240239 sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group);
240+exit_dev:
241+ device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr);
241242 exit_free:
242243 kfree(data);
243244 exit:
@@ -250,6 +251,7 @@ static int __devexit pkgtemp_remove(struct platform_device *pdev) · 6 unmodified lines
250251
251252 hwmon_device_unregister(data->hwmon_dev);
252253 sysfs_remove_group(&pdev->dev.kobj, &pkgtemp_group);
254+ device_remove_file(&pdev->dev, &sensor_dev_attr_temp1_max.dev_attr);
253255 platform_set_drvdata(pdev, NULL);
254256 kfree(data);
255257 return 0;
@@ -281,9 +283,10 @@ static int __cpuinit pkgtemp_device_add(unsigned int cpu) · 25 unmodified lines
281283 int err;
282284 struct platform_device *pdev;
283285 struct pdev_entry *pdev_entry;
284−#ifdef CONFIG_SMP
285286 struct cpuinfo_x86 *c = &cpu_data(cpu);
286−#endif
287+
288+ if (!cpu_has(c, X86_FEATURE_PTS))
289+ return 0;
287290
288291 mutex_lock(&pdev_list_mutex);
289292
@@ -339,17 +342,18 @@ exit: · 49 unmodified lines
339342 #ifdef CONFIG_HOTPLUG_CPU
340343 static void pkgtemp_device_remove(unsigned int cpu)
341344 {
342− struct pdev_entry *p, *n;
345+ struct pdev_entry *p;
343346 unsigned int i;
344347 int err;
345348
346349 mutex_lock(&pdev_list_mutex);
347− list_for_each_entry_safe(p, n, &pdev_list, list) {
350+ list_for_each_entry(p, &pdev_list, list) {
348351 if (p->cpu != cpu)
349352 continue;
350353
351354 platform_device_unregister(p->pdev);
352355 list_del(&p->list);
356+ mutex_unlock(&pdev_list_mutex);
353357 kfree(p);
354358 for_each_cpu(i, cpu_core_mask(cpu)) {
355359 if (i != cpu) {
@@ -358,7 +362,7 @@ static void pkgtemp_device_remove(unsigned int cpu) · 2 unmodified lines
358362 break;
359363 }
360364 }
361− break;
365+ return;
362366 }
363367 mutex_unlock(&pdev_list_mutex);
364368 }
@@ -399,11 +403,6 @@ static int __init pkgtemp_init(void) · 34 unmodified lines
399403 goto exit;
400404
401405 for_each_online_cpu(i) {
402− struct cpuinfo_x86 *c = &cpu_data(i);
403−
404− if (!cpu_has(c, X86_FEATURE_PTS))
405− continue;
406−
407406 err = pkgtemp_device_add(i);
408407 if (err)
409408 goto exit_devices_unreg;
drivers/i2c/busses/i2c-davinci.c+3−3
@@ -357,9 +357,6 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) · 356 unmodified lines
357357
358358 dev->terminate = 0;
359359
360− /* write the data into mode register */
361− davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);
362−
363360 /*
364361 * First byte should be set here, not after interrupt,
365362 * because transmit-data-ready interrupt can come before
@@ -371,6 +368,9 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) · 5 unmodified lines
371368 dev->buf_len--;
372369 }
373370
371+ /* write the data into mode register; start transmitting */
372+ davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag);
373+
374374 r = wait_for_completion_interruptible_timeout(&dev->cmd_complete,
375375 dev->adapter.timeout);
376376 if (r == 0) {
drivers/i2c/busses/i2c-octeon.c+1−1
@@ -218,7 +218,7 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c) · 217 unmodified lines
218218 return result;
219219 } else if (result == 0) {
220220 dev_dbg(i2c->dev, "%s: timeout\n", __func__);
221− result = -ETIMEDOUT;
221+ return -ETIMEDOUT;
222222 }
223223
224224 return 0;
drivers/i2c/busses/i2c-s3c2410.c+2−2
@@ -662,8 +662,8 @@ static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got) · 661 unmodified lines
662662 unsigned long sda_delay;
663663
664664 if (pdata->sda_delay) {
665− sda_delay = (freq / 1000) * pdata->sda_delay;
666− sda_delay /= 1000000;
665+ sda_delay = clkin * pdata->sda_delay;
666+ sda_delay = DIV_ROUND_UP(sda_delay, 1000000);
667667 sda_delay = DIV_ROUND_UP(sda_delay, 5);
668668 if (sda_delay > 3)
669669 sda_delay = 3;
drivers/idle/intel_idle.c+15−5
@@ -83,7 +83,7 @@ static unsigned int mwait_substates; · 82 unmodified lines
8383 /* Reliable LAPIC Timer States, bit 1 for C1 etc. */
8484 static unsigned int lapic_timer_reliable_states;
8585
86−static struct cpuidle_device *intel_idle_cpuidle_devices;
86+static struct cpuidle_device __percpu *intel_idle_cpuidle_devices;
8787 static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state);
8888
8989 static struct cpuidle_state *cpuidle_state_table;
@@ -108,7 +108,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { · 18 unmodified lines
108108 .name = "NHM-C3",
109109 .desc = "MWAIT 0x10",
110110 .driver_data = (void *) 0x10,
111− .flags = CPUIDLE_FLAG_TIME_VALID,
111+ .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
112112 .exit_latency = 20,
113113 .power_usage = 500,
114114 .target_residency = 80,
@@ -117,7 +117,7 @@ static struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = { · 2 unmodified lines
117117 .name = "NHM-C6",
118118 .desc = "MWAIT 0x20",
119119 .driver_data = (void *) 0x20,
120− .flags = CPUIDLE_FLAG_TIME_VALID,
120+ .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
121121 .exit_latency = 200,
122122 .power_usage = 350,
123123 .target_residency = 800,
@@ -149,7 +149,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { · 25 unmodified lines
149149 .name = "ATM-C4",
150150 .desc = "MWAIT 0x30",
151151 .driver_data = (void *) 0x30,
152− .flags = CPUIDLE_FLAG_TIME_VALID,
152+ .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
153153 .exit_latency = 100,
154154 .power_usage = 250,
155155 .target_residency = 400,
@@ -159,7 +159,7 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { · 3 unmodified lines
159159 .name = "ATM-C6",
160160 .desc = "MWAIT 0x40",
161161 .driver_data = (void *) 0x40,
162− .flags = CPUIDLE_FLAG_TIME_VALID,
162+ .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_TLB_FLUSHED,
163163 .exit_latency = 200,
164164 .power_usage = 150,
165165 .target_residency = 800,
@@ -185,6 +185,16 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state) · 19 unmodified lines
185185
186186 local_irq_disable();
187187
188+ /*
189+ * If the state flag indicates that the TLB will be flushed or if this
190+ * is the deepest c-state supported, do a voluntary leave mm to avoid
191+ * costly and mostly unnecessary wakeups for flushing the user TLB's
192+ * associated with the active mm.
193+ */
194+ if (state->flags & CPUIDLE_FLAG_TLB_FLUSHED ||
195+ (&dev->states[dev->state_count - 1] == state))
196+ leave_mm(cpu);
197+
188198 if (!(lapic_timer_reliable_states & (1 << (cstate))))
189199 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
190200
drivers/infiniband/hw/cxgb3/iwch_cm.c+4−2
@@ -463,7 +463,8 @@ static int send_connect(struct iwch_ep *ep) · 462 unmodified lines
463463 V_MSS_IDX(mtu_idx) |
464464 V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx);
465465 opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10);
466− opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor);
466+ opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) |
467+ V_CONG_CONTROL_FLAVOR(cong_flavor);
467468 skb->priority = CPL_PRIORITY_SETUP;
468469 set_arp_failure_handler(skb, act_open_req_arp_failure);
469470
@@ -1280,7 +1281,8 @@ static void accept_cr(struct iwch_ep *ep, __be32 peer_ip, struct sk_buff *skb) · 810 unmodified lines
12801281 V_MSS_IDX(mtu_idx) |
12811282 V_L2T_IDX(ep->l2t->idx) | V_TX_CHANNEL(ep->l2t->smt_idx);
12821283 opt0l = V_TOS((ep->tos >> 2) & M_TOS) | V_RCV_BUFSIZ(rcv_win>>10);
1283− opt2 = V_FLAVORS_VALID(1) | V_CONG_CONTROL_FLAVOR(cong_flavor);
1284+ opt2 = F_RX_COALESCE_VALID | V_RX_COALESCE(0) | V_FLAVORS_VALID(1) |
1285+ V_CONG_CONTROL_FLAVOR(cong_flavor);
12841286
12851287 rpl = cplhdr(skb);
12861288 rpl->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
drivers/leds/leds-ns2.c+5−4
@@ -81,7 +81,7 @@ static int ns2_led_get_mode(struct ns2_led_data *led_dat, · 80 unmodified lines
8181 int cmd_level;
8282 int slow_level;
8383
84− read_lock(&led_dat->rw_lock);
84+ read_lock_irq(&led_dat->rw_lock);
8585
8686 cmd_level = gpio_get_value(led_dat->cmd);
8787 slow_level = gpio_get_value(led_dat->slow);
@@ -95,7 +95,7 @@ static int ns2_led_get_mode(struct ns2_led_data *led_dat, · 7 unmodified lines
9595 }
9696 }
9797
98− read_unlock(&led_dat->rw_lock);
98+ read_unlock_irq(&led_dat->rw_lock);
9999
100100 return ret;
101101 }
@@ -104,8 +104,9 @@ static void ns2_led_set_mode(struct ns2_led_data *led_dat, · 2 unmodified lines
104104 enum ns2_led_modes mode)
105105 {
106106 int i;
107+ unsigned long flags;
107108
108− write_lock(&led_dat->rw_lock);
109+ write_lock_irqsave(&led_dat->rw_lock, flags);
109110
110111 for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) {
111112 if (mode == ns2_led_modval[i].mode) {
@@ -116,7 +117,7 @@ static void ns2_led_set_mode(struct ns2_led_data *led_dat, · 4 unmodified lines
116117 }
117118 }
118119
119− write_unlock(&led_dat->rw_lock);
120+ write_unlock_irqrestore(&led_dat->rw_lock, flags);
120121 }
121122
122123 static void ns2_led_set(struct led_classdev *led_cdev,
drivers/mfd/max8925-core.c+7−6
@@ -429,24 +429,25 @@ static void max8925_irq_sync_unlock(unsigned int irq) · 428 unmodified lines
429429 irq_tsc = cache_tsc;
430430 for (i = 0; i < ARRAY_SIZE(max8925_irqs); i++) {
431431 irq_data = &max8925_irqs[i];
432+ /* 1 -- disable, 0 -- enable */
432433 switch (irq_data->mask_reg) {
433434 case MAX8925_CHG_IRQ1_MASK:
434− irq_chg[0] &= irq_data->enable;
435+ irq_chg[0] &= ~irq_data->enable;
435436 break;
436437 case MAX8925_CHG_IRQ2_MASK:
437− irq_chg[1] &= irq_data->enable;
438+ irq_chg[1] &= ~irq_data->enable;
438439 break;
439440 case MAX8925_ON_OFF_IRQ1_MASK:
440− irq_on[0] &= irq_data->enable;
441+ irq_on[0] &= ~irq_data->enable;
441442 break;
442443 case MAX8925_ON_OFF_IRQ2_MASK:
443− irq_on[1] &= irq_data->enable;
444+ irq_on[1] &= ~irq_data->enable;
444445 break;
445446 case MAX8925_RTC_IRQ_MASK:
446− irq_rtc &= irq_data->enable;
447+ irq_rtc &= ~irq_data->enable;
447448 break;
448449 case MAX8925_TSC_IRQ_MASK:
449− irq_tsc &= irq_data->enable;
450+ irq_tsc &= ~irq_data->enable;
450451 break;
451452 default:
452453 dev_err(chip->dev, "wrong IRQ\n");
drivers/mfd/wm831x-irq.c+7−2
@@ -394,8 +394,13 @@ static int wm831x_irq_set_type(unsigned int irq, unsigned int type) · 393 unmodified lines
394394
395395 irq = irq - wm831x->irq_base;
396396
397− if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11)
398− return -EINVAL;
397+ if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) {
398+ /* Ignore internal-only IRQs */
399+ if (irq >= 0 && irq < WM831X_NUM_IRQS)
400+ return 0;
401+ else
402+ return -EINVAL;
403+ }
399404
400405 switch (type) {
401406 case IRQ_TYPE_EDGE_BOTH:
drivers/misc/Kconfig+1−1
@@ -368,7 +368,7 @@ config VMWARE_BALLOON · 367 unmodified lines
368368 If unsure, say N.
369369
370370 To compile this driver as a module, choose M here: the
371− module will be called vmware_balloon.
371+ module will be called vmw_balloon.
372372
373373 config ARM_CHARLCD
374374 bool "ARM Ltd. Character LCD Driver"
drivers/misc/Makefile+1−1
@@ -33,5 +33,5 @@ obj-$(CONFIG_IWMC3200TOP) += iwmc3200top/ · 32 unmodified lines
3333 obj-$(CONFIG_HMC6352) += hmc6352.o
3434 obj-y += eeprom/
3535 obj-y += cb710/
36−obj-$(CONFIG_VMWARE_BALLOON) += vmware_balloon.o
36+obj-$(CONFIG_VMWARE_BALLOON) += vmw_balloon.o
3737 obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o
drivers/misc/vmw_balloon.crenamed from drivers/misc/vmware_balloon.c+0−0

File renamed without changes.

drivers/mmc/host/sdhci-s3c.c+8−4
@@ -241,8 +241,10 @@ static struct sdhci_ops sdhci_s3c_ops = { · 240 unmodified lines
241241 static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
242242 {
243243 struct sdhci_host *host = platform_get_drvdata(dev);
244+ unsigned long flags;
245+
244246 if (host) {
245− spin_lock(&host->lock);
247+ spin_lock_irqsave(&host->lock, flags);
246248 if (state) {
247249 dev_dbg(&dev->dev, "card inserted.\n");
248250 host->flags &= ~SDHCI_DEVICE_DEAD;
@@ -253,7 +255,7 @@ static void sdhci_s3c_notify_change(struct platform_device *dev, int state) · 4 unmodified lines
253255 host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
254256 }
255257 tasklet_schedule(&host->card_tasklet);
256− spin_unlock(&host->lock);
258+ spin_unlock_irqrestore(&host->lock, flags);
257259 }
258260 }
259261
@@ -481,8 +483,10 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) · 221 unmodified lines
481483 sdhci_remove_host(host, 1);
482484
483485 for (ptr = 0; ptr < 3; ptr++) {
484− clk_disable(sc->clk_bus[ptr]);
485− clk_put(sc->clk_bus[ptr]);
486+ if (sc->clk_bus[ptr]) {
487+ clk_disable(sc->clk_bus[ptr]);
488+ clk_put(sc->clk_bus[ptr]);
489+ }
486490 }
487491 clk_disable(sc->clk_io);
488492 clk_put(sc->clk_io);
drivers/mtd/nand/omap2.c+1−1
@@ -413,7 +413,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, · 412 unmodified lines
413413 prefetch_status = gpmc_read_status(GPMC_PREFETCH_COUNT);
414414 } while (prefetch_status);
415415 /* disable and stop the PFPW engine */
416− gpmc_prefetch_reset();
416+ gpmc_prefetch_reset(info->gpmc_cs);
417417
418418 dma_unmap_single(&info->pdev->dev, dma_addr, len, dir);
419419 return 0;
drivers/net/3c59x.c+10−0
@@ -2942,6 +2942,9 @@ static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) · 2941 unmodified lines
29422942 {
29432943 struct vortex_private *vp = netdev_priv(dev);
29442944
2945+ if (!VORTEX_PCI(vp))
2946+ return;
2947+
29452948 wol->supported = WAKE_MAGIC;
29462949
29472950 wol->wolopts = 0;
@@ -2952,6 +2955,10 @@ static void vortex_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) · 4 unmodified lines
29522955 static int vortex_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
29532956 {
29542957 struct vortex_private *vp = netdev_priv(dev);
2958+
2959+ if (!VORTEX_PCI(vp))
2960+ return -EOPNOTSUPP;
2961+
29552962 if (wol->wolopts & ~WAKE_MAGIC)
29562963 return -EINVAL;
29572964
@@ -3201,6 +3208,9 @@ static void acpi_set_WOL(struct net_device *dev) · 243 unmodified lines
32013208 return;
32023209 }
32033210
3211+ if (VORTEX_PCI(vp)->current_state < PCI_D3hot)
3212+ return;
3213+
32043214 /* Change the power state to D3; RxEnable doesn't take effect. */
32053215 pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
32063216 }
drivers/net/atlx/atl1.c+9−2
@@ -1251,6 +1251,12 @@ static void atl1_free_ring_resources(struct atl1_adapter *adapter) · 1250 unmodified lines
12511251
12521252 rrd_ring->desc = NULL;
12531253 rrd_ring->dma = 0;
1254+
1255+ adapter->cmb.dma = 0;
1256+ adapter->cmb.cmb = NULL;
1257+
1258+ adapter->smb.dma = 0;
1259+ adapter->smb.smb = NULL;
12541260 }
12551261
12561262 static void atl1_setup_mac_ctrl(struct atl1_adapter *adapter)
@@ -2847,10 +2853,11 @@ static int atl1_resume(struct pci_dev *pdev) · 1590 unmodified lines
28472853 pci_enable_wake(pdev, PCI_D3cold, 0);
28482854
28492855 atl1_reset_hw(&adapter->hw);
2850− adapter->cmb.cmb->int_stats = 0;
28512856
2852− if (netif_running(netdev))
2857+ if (netif_running(netdev)) {
2858+ adapter->cmb.cmb->int_stats = 0;
28532859 atl1_up(adapter);
2860+ }
28542861 netif_device_attach(netdev);
28552862
28562863 return 0;
drivers/net/e1000e/hw.h+1−0
@@ -57,6 +57,7 @@ enum e1e_registers { · 56 unmodified lines
5757 E1000_SCTL = 0x00024, /* SerDes Control - RW */
5858 E1000_FCAL = 0x00028, /* Flow Control Address Low - RW */
5959 E1000_FCAH = 0x0002C, /* Flow Control Address High -RW */
60+ E1000_FEXTNVM4 = 0x00024, /* Future Extended NVM 4 - RW */
6061 E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */
6162 E1000_FCT = 0x00030, /* Flow Control Type - RW */
6263 E1000_VET = 0x00038, /* VLAN Ether Type - RW */
drivers/net/e1000e/ich8lan.c+164−33
@@ -105,6 +105,10 @@ · 104 unmodified lines
105105 #define E1000_FEXTNVM_SW_CONFIG 1
106106 #define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */
107107
108+#define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7
109+#define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7
110+#define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3
111+
108112 #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL
109113
110114 #define E1000_ICH_RAR_ENTRIES 7
@@ -125,6 +129,7 @@ · 14 unmodified lines
125129
126130 /* SMBus Address Phy Register */
127131 #define HV_SMB_ADDR PHY_REG(768, 26)
132+#define HV_SMB_ADDR_MASK 0x007F
128133 #define HV_SMB_ADDR_PEC_EN 0x0200
129134 #define HV_SMB_ADDR_VALID 0x0080
130135
@@ -237,6 +242,8 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); · 106 unmodified lines
237242 static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw);
238243 static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw);
239244 static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw);
245+static s32 e1000_k1_workaround_lv(struct e1000_hw *hw);
246+static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate);
240247
241248 static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
242249 {
@@ -272,7 +279,7 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val) · 29 unmodified lines
272279 static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
273280 {
274281 struct e1000_phy_info *phy = &hw->phy;
275− u32 ctrl;
282+ u32 ctrl, fwsm;
276283 s32 ret_val = 0;
277284
278285 phy->addr = 1;
@@ -294,7 +301,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) · 15 unmodified lines
294301 * disabled, then toggle the LANPHYPC Value bit to force
295302 * the interconnect to PCIe mode.
296303 */
297− if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
304+ fwsm = er32(FWSM);
305+ if (!(fwsm & E1000_ICH_FWSM_FW_VALID)) {
298306 ctrl = er32(CTRL);
299307 ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE;
300308 ctrl &= ~E1000_CTRL_LANPHYPC_VALUE;
@@ -303,6 +311,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) · 2 unmodified lines
303311 ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
304312 ew32(CTRL, ctrl);
305313 msleep(50);
314+
315+ /*
316+ * Gate automatic PHY configuration by hardware on
317+ * non-managed 82579
318+ */
319+ if (hw->mac.type == e1000_pch2lan)
320+ e1000_gate_hw_phy_config_ich8lan(hw, true);
306321 }
307322
308323 /*
@@ -315,6 +330,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) · 6 unmodified lines
315330 if (ret_val)
316331 goto out;
317332
333+ /* Ungate automatic PHY configuration on non-managed 82579 */
334+ if ((hw->mac.type == e1000_pch2lan) &&
335+ !(fwsm & E1000_ICH_FWSM_FW_VALID)) {
336+ msleep(10);
337+ e1000_gate_hw_phy_config_ich8lan(hw, false);
338+ }
339+
318340 phy->id = e1000_phy_unknown;
319341 ret_val = e1000e_get_phy_id(hw);
320342 if (ret_val)
@@ -561,13 +583,10 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) · 240 unmodified lines
561583 if (mac->type == e1000_ich8lan)
562584 e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true);
563585
564− /* Disable PHY configuration by hardware, config by software */
565− if (mac->type == e1000_pch2lan) {
566− u32 extcnf_ctrl = er32(EXTCNF_CTRL);
567−
568− extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;
569− ew32(EXTCNF_CTRL, extcnf_ctrl);
570− }
586+ /* Gate automatic PHY configuration by hardware on managed 82579 */
587+ if ((mac->type == e1000_pch2lan) &&
588+ (er32(FWSM) & E1000_ICH_FWSM_FW_VALID))
589+ e1000_gate_hw_phy_config_ich8lan(hw, true);
571590
572591 return 0;
573592 }
@@ -652,6 +671,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) · 78 unmodified lines
652671 goto out;
653672 }
654673
674+ if (hw->mac.type == e1000_pch2lan) {
675+ ret_val = e1000_k1_workaround_lv(hw);
676+ if (ret_val)
677+ goto out;
678+ }
679+
655680 /*
656681 * Check if there was DownShift, must be checked
657682 * immediately after link-up
@@ -894,6 +919,34 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) · 236 unmodified lines
894919 return (fwsm & E1000_ICH_FWSM_RSPCIPHY) ? 0 : E1000_BLK_PHY_RESET;
895920 }
896921
922+/**
923+ * e1000_write_smbus_addr - Write SMBus address to PHY needed during Sx states
924+ * @hw: pointer to the HW structure
925+ *
926+ * Assumes semaphore already acquired.
927+ *
928+ **/
929+static s32 e1000_write_smbus_addr(struct e1000_hw *hw)
930+{
931+ u16 phy_data;
932+ u32 strap = er32(STRAP);
933+ s32 ret_val = 0;
934+
935+ strap &= E1000_STRAP_SMBUS_ADDRESS_MASK;
936+
937+ ret_val = e1000_read_phy_reg_hv_locked(hw, HV_SMB_ADDR, &phy_data);
938+ if (ret_val)
939+ goto out;
940+
941+ phy_data &= ~HV_SMB_ADDR_MASK;
942+ phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT);
943+ phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;
944+ ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data);
945+
946+out:
947+ return ret_val;
948+}
949+
897950 /**
898951 * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration
899952 * @hw: pointer to the HW structure
@@ -903,7 +956,6 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) · 3 unmodified lines
903956 **/
904957 static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
905958 {
906− struct e1000_adapter *adapter = hw->adapter;
907959 struct e1000_phy_info *phy = &hw->phy;
908960 u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask;
909961 s32 ret_val = 0;
@@ -921,7 +973,8 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) · 11 unmodified lines
921973 if (phy->type != e1000_phy_igp_3)
922974 return ret_val;
923975
924− if (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) {
976+ if ((hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_AMT) ||
977+ (hw->adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_C)) {
925978 sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
926979 break;
927980 }
@@ -961,21 +1014,16 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) · 33 unmodified lines
9611014 cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
9621015 cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
9631016
964− if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&
965− ((hw->mac.type == e1000_pchlan) ||
966− (hw->mac.type == e1000_pch2lan))) {
1017+ if ((!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&
1018+ (hw->mac.type == e1000_pchlan)) ||
1019+ (hw->mac.type == e1000_pch2lan)) {
9671020 /*
9681021 * HW configures the SMBus address and LEDs when the
9691022 * OEM and LCD Write Enable bits are set in the NVM.
9701023 * When both NVM bits are cleared, SW will configure
9711024 * them instead.
9721025 */
973− data = er32(STRAP);
974− data &= E1000_STRAP_SMBUS_ADDRESS_MASK;
975− reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT;
976− reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;
977− ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR,
978− reg_data);
1026+ ret_val = e1000_write_smbus_addr(hw);
9791027 if (ret_val)
9801028 goto out;
9811029
@@ -1440,10 +1488,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) · 458 unmodified lines
14401488 goto out;
14411489
14421490 /* Enable jumbo frame workaround in the PHY */
1443− e1e_rphy(hw, PHY_REG(769, 20), &data);
1444− ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));
1445− if (ret_val)
1446− goto out;
14471491 e1e_rphy(hw, PHY_REG(769, 23), &data);
14481492 data &= ~(0x7F << 5);
14491493 data |= (0x37 << 5);
@@ -1452,7 +1496,6 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) · 2 unmodified lines
14521496 goto out;
14531497 e1e_rphy(hw, PHY_REG(769, 16), &data);
14541498 data &= ~(1 << 13);
1455− data |= (1 << 12);
14561499 ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);
14571500 if (ret_val)
14581501 goto out;
@@ -1477,7 +1520,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) · 18 unmodified lines
14771520
14781521 mac_reg = er32(RCTL);
14791522 mac_reg &= ~E1000_RCTL_SECRC;
1480− ew32(FFLT_DBG, mac_reg);
1523+ ew32(RCTL, mac_reg);
14811524
14821525 ret_val = e1000e_read_kmrn_reg(hw,
14831526 E1000_KMRNCTRLSTA_CTRL_OFFSET,
@@ -1503,17 +1546,12 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) · 19 unmodified lines
15031546 goto out;
15041547
15051548 /* Write PHY register values back to h/w defaults */
1506− e1e_rphy(hw, PHY_REG(769, 20), &data);
1507− ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14));
1508− if (ret_val)
1509− goto out;
15101549 e1e_rphy(hw, PHY_REG(769, 23), &data);
15111550 data &= ~(0x7F << 5);
15121551 ret_val = e1e_wphy(hw, PHY_REG(769, 23), data);
15131552 if (ret_val)
15141553 goto out;
15151554 e1e_rphy(hw, PHY_REG(769, 16), &data);
1516− data &= ~(1 << 12);
15171555 data |= (1 << 13);
15181556 ret_val = e1e_wphy(hw, PHY_REG(769, 16), data);
15191557 if (ret_val)
@@ -1558,6 +1596,69 @@ out: · 38 unmodified lines
15581596 return ret_val;
15591597 }
15601598
1599+/**
1600+ * e1000_k1_gig_workaround_lv - K1 Si workaround
1601+ * @hw: pointer to the HW structure
1602+ *
1603+ * Workaround to set the K1 beacon duration for 82579 parts
1604+ **/
1605+static s32 e1000_k1_workaround_lv(struct e1000_hw *hw)
1606+{
1607+ s32 ret_val = 0;
1608+ u16 status_reg = 0;
1609+ u32 mac_reg;
1610+
1611+ if (hw->mac.type != e1000_pch2lan)
1612+ goto out;
1613+
1614+ /* Set K1 beacon duration based on 1Gbps speed or otherwise */
1615+ ret_val = e1e_rphy(hw, HV_M_STATUS, &status_reg);
1616+ if (ret_val)
1617+ goto out;
1618+
1619+ if ((status_reg & (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE))
1620+ == (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE)) {
1621+ mac_reg = er32(FEXTNVM4);
1622+ mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK;
1623+
1624+ if (status_reg & HV_M_STATUS_SPEED_1000)
1625+ mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC;
1626+ else
1627+ mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_16USEC;
1628+
1629+ ew32(FEXTNVM4, mac_reg);
1630+ }
1631+
1632+out:
1633+ return ret_val;
1634+}
1635+
1636+/**
1637+ * e1000_gate_hw_phy_config_ich8lan - disable PHY config via hardware
1638+ * @hw: pointer to the HW structure
1639+ * @gate: boolean set to true to gate, false to ungate
1640+ *
1641+ * Gate/ungate the automatic PHY configuration via hardware; perform
1642+ * the configuration via software instead.
1643+ **/
1644+static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate)
1645+{
1646+ u32 extcnf_ctrl;
1647+
1648+ if (hw->mac.type != e1000_pch2lan)
1649+ return;
1650+
1651+ extcnf_ctrl = er32(EXTCNF_CTRL);
1652+
1653+ if (gate)
1654+ extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;
1655+ else
1656+ extcnf_ctrl &= ~E1000_EXTCNF_CTRL_GATE_PHY_CFG;
1657+
1658+ ew32(EXTCNF_CTRL, extcnf_ctrl);
1659+ return;
1660+}
1661+
15611662 /**
15621663 * e1000_lan_init_done_ich8lan - Check for PHY config completion
15631664 * @hw: pointer to the HW structure
@@ -1602,6 +1703,9 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) · 38 unmodified lines
16021703 if (e1000_check_reset_block(hw))
16031704 goto out;
16041705
1706+ /* Allow time for h/w to get to quiescent state after reset */
1707+ msleep(10);
1708+
16051709 /* Perform any necessary post-reset workarounds */
16061710 switch (hw->mac.type) {
16071711 case e1000_pchlan:
@@ -1630,6 +1734,13 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) · 22 unmodified lines
16301734 /* Configure the LCD with the OEM bits in NVM */
16311735 ret_val = e1000_oem_bits_config_ich8lan(hw, true);
16321736
1737+ /* Ungate automatic PHY configuration on non-managed 82579 */
1738+ if ((hw->mac.type == e1000_pch2lan) &&
1739+ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) {
1740+ msleep(10);
1741+ e1000_gate_hw_phy_config_ich8lan(hw, false);
1742+ }
1743+
16331744 out:
16341745 return ret_val;
16351746 }
@@ -1646,6 +1757,11 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) · 10 unmodified lines
16461757 {
16471758 s32 ret_val = 0;
16481759
1760+ /* Gate automatic PHY configuration by hardware on non-managed 82579 */
1761+ if ((hw->mac.type == e1000_pch2lan) &&
1762+ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID))
1763+ e1000_gate_hw_phy_config_ich8lan(hw, true);
1764+
16491765 ret_val = e1000e_phy_hw_reset_generic(hw);
16501766 if (ret_val)
16511767 goto out;
@@ -2910,6 +3026,14 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) · 1258 unmodified lines
29103026 * external PHY is reset.
29113027 */
29123028 ctrl |= E1000_CTRL_PHY_RST;
3029+
3030+ /*
3031+ * Gate automatic PHY configuration by hardware on
3032+ * non-managed 82579
3033+ */
3034+ if ((hw->mac.type == e1000_pch2lan) &&
3035+ !(er32(FWSM) & E1000_ICH_FWSM_FW_VALID))
3036+ e1000_gate_hw_phy_config_ich8lan(hw, true);
29133037 }
29143038 ret_val = e1000_acquire_swflag_ich8lan(hw);
29153039 e_dbg("Issuing a global reset to ich8lan\n");
@@ -3460,13 +3584,20 @@ void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) · 544 unmodified lines
34603584 void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw)
34613585 {
34623586 u32 phy_ctrl;
3587+ s32 ret_val;
34633588
34643589 phy_ctrl = er32(PHY_CTRL);
34653590 phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | E1000_PHY_CTRL_GBE_DISABLE;
34663591 ew32(PHY_CTRL, phy_ctrl);
34673592
3468− if (hw->mac.type >= e1000_pchlan)
3469− e1000_phy_hw_reset_ich8lan(hw);
3593+ if (hw->mac.type >= e1000_pchlan) {
3594+ e1000_oem_bits_config_ich8lan(hw, true);
3595+ ret_val = hw->phy.ops.acquire(hw);
3596+ if (ret_val)
3597+ return;
3598+ e1000_write_smbus_addr(hw);
3599+ hw->phy.ops.release(hw);
3600+ }
34703601 }
34713602
34723603 /**
drivers/net/e1000e/netdev.c+19−10
@@ -2704,6 +2704,16 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) · 2703 unmodified lines
27042704 u32 psrctl = 0;
27052705 u32 pages = 0;
27062706
2707+ /* Workaround Si errata on 82579 - configure jumbo frame flow */
2708+ if (hw->mac.type == e1000_pch2lan) {
2709+ s32 ret_val;
2710+
2711+ if (adapter->netdev->mtu > ETH_DATA_LEN)
2712+ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
2713+ else
2714+ ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
2715+ }
2716+
27072717 /* Program MC offset vector base */
27082718 rctl = er32(RCTL);
27092719 rctl &= ~(3 << E1000_RCTL_MO_SHIFT);
@@ -2744,16 +2754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) · 34 unmodified lines
27442754 e1e_wphy(hw, 22, phy_data);
27452755 }
27462756
2747− /* Workaround Si errata on 82579 - configure jumbo frame flow */
2748− if (hw->mac.type == e1000_pch2lan) {
2749− s32 ret_val;
2750−
2751− if (rctl & E1000_RCTL_LPE)
2752− ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true);
2753− else
2754− ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false);
2755− }
2756−
27572757 /* Setup buffer sizes */
27582758 rctl &= ~E1000_RCTL_SZ_4096;
27592759 rctl |= E1000_RCTL_BSEX;
@@ -4833,6 +4833,15 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) · 2073 unmodified lines
48334833 return -EINVAL;
48344834 }
48354835
4836+ /* Jumbo frame workaround on 82579 requires CRC be stripped */
4837+ if ((adapter->hw.mac.type == e1000_pch2lan) &&
4838+ !(adapter->flags2 & FLAG2_CRC_STRIPPING) &&
4839+ (new_mtu > ETH_DATA_LEN)) {
4840+ e_err("Jumbo Frames not supported on 82579 when CRC "
4841+ "stripping is disabled.\n");
4842+ return -EINVAL;
4843+ }
4844+
48364845 /* 82573 Errata 17 */
48374846 if (((adapter->hw.mac.type == e1000_82573) ||
48384847 (adapter->hw.mac.type == e1000_82574)) &&
drivers/net/ibm_newemac/core.c+2−2
@@ -2928,7 +2928,7 @@ static int __devinit emac_probe(struct platform_device *ofdev, · 2927 unmodified lines
29282928 if (dev->emac_irq != NO_IRQ)
29292929 irq_dispose_mapping(dev->emac_irq);
29302930 err_free:
2931− kfree(ndev);
2931+ free_netdev(ndev);
29322932 err_gone:
29332933 /* if we were on the bootlist, remove us as we won't show up and
29342934 * wake up all waiters to notify them in case they were waiting
@@ -2971,7 +2971,7 @@ static int __devexit emac_remove(struct platform_device *ofdev) · 36 unmodified lines
29712971 if (dev->emac_irq != NO_IRQ)
29722972 irq_dispose_mapping(dev->emac_irq);
29732973
2974− kfree(dev->ndev);
2974+ free_netdev(dev->ndev);
29752975
29762976 return 0;
29772977 }
drivers/net/netxen/netxen_nic_init.c+0−3
@@ -1540,7 +1540,6 @@ netxen_process_rcv(struct netxen_adapter *adapter, · 1539 unmodified lines
15401540 if (pkt_offset)
15411541 skb_pull(skb, pkt_offset);
15421542
1543− skb->truesize = skb->len + sizeof(struct sk_buff);
15441543 skb->protocol = eth_type_trans(skb, netdev);
15451544
15461545 napi_gro_receive(&sds_ring->napi, skb);
@@ -1602,8 +1601,6 @@ netxen_process_lro(struct netxen_adapter *adapter, · 55 unmodified lines
16021601
16031602 skb_put(skb, lro_length + data_offset);
16041603
1605− skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb);
1606−
16071604 skb_pull(skb, l2_hdr_offset);
16081605 skb->protocol = eth_type_trans(skb, netdev);
16091606
drivers/net/qlcnic/qlcnic_init.c+1−6
@@ -1316,7 +1316,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, · 1315 unmodified lines
13161316 return -ENOMEM;
13171317 }
13181318
1319− skb_reserve(skb, 2);
1319+ skb_reserve(skb, NET_IP_ALIGN);
13201320
13211321 dma = pci_map_single(pdev, skb->data,
13221322 rds_ring->dma_size, PCI_DMA_FROMDEVICE);
@@ -1404,7 +1404,6 @@ qlcnic_process_rcv(struct qlcnic_adapter *adapter, · 81 unmodified lines
14041404 if (pkt_offset)
14051405 skb_pull(skb, pkt_offset);
14061406
1407− skb->truesize = skb->len + sizeof(struct sk_buff);
14081407 skb->protocol = eth_type_trans(skb, netdev);
14091408
14101409 napi_gro_receive(&sds_ring->napi, skb);
@@ -1466,8 +1465,6 @@ qlcnic_process_lro(struct qlcnic_adapter *adapter, · 55 unmodified lines
14661465
14671466 skb_put(skb, lro_length + data_offset);
14681467
1469− skb->truesize = skb->len + sizeof(struct sk_buff) + skb_headroom(skb);
1470−
14711468 skb_pull(skb, l2_hdr_offset);
14721469 skb->protocol = eth_type_trans(skb, netdev);
14731470
@@ -1700,8 +1697,6 @@ qlcnic_process_rcv_diag(struct qlcnic_adapter *adapter, · 226 unmodified lines
17001697 if (pkt_offset)
17011698 skb_pull(skb, pkt_offset);
17021699
1703− skb->truesize = skb->len + sizeof(struct sk_buff);
1704−
17051700 if (!qlcnic_check_loopback_buff(skb->data))
17061701 adapter->diag_cnt++;
17071702
drivers/net/rionet.c+1−1
@@ -384,7 +384,7 @@ static void rionet_remove(struct rio_dev *rdev) · 383 unmodified lines
384384 free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ?
385385 __ilog2(sizeof(void *)) + 4 : 0);
386386 unregister_netdev(ndev);
387− kfree(ndev);
387+ free_netdev(ndev);
388388
389389 list_for_each_entry_safe(peer, tmp, &rionet_peers, node) {
390390 list_del(&peer->node);
drivers/net/sgiseeq.c+1−1
@@ -804,7 +804,7 @@ static int __devinit sgiseeq_probe(struct platform_device *pdev) · 803 unmodified lines
804804 err_out_free_page:
805805 free_page((unsigned long) sp->srings);
806806 err_out_free_dev:
807− kfree(dev);
807+ free_netdev(dev);
808808
809809 err_out:
810810 return err;
drivers/net/smsc911x.c+1−0
@@ -58,6 +58,7 @@ · 57 unmodified lines
5858
5959 MODULE_LICENSE("GPL");
6060 MODULE_VERSION(SMSC_DRV_VERSION);
61+MODULE_ALIAS("platform:smsc911x");
6162
6263 #if USE_DEBUG > 0
6364 static int debug = 16;
drivers/net/tulip/de2104x.c+38−5
@@ -243,6 +243,7 @@ enum { · 242 unmodified lines
243243 NWayState = (1 << 14) | (1 << 13) | (1 << 12),
244244 NWayRestart = (1 << 12),
245245 NonselPortActive = (1 << 9),
246+ SelPortActive = (1 << 8),
246247 LinkFailStatus = (1 << 2),
247248 NetCxnErr = (1 << 1),
248249 };
@@ -363,7 +364,9 @@ static u16 t21040_csr15[] = { 0, 0, 0x0006, 0x0000, 0x0000, }; · 114 unmodified lines
363364
364365 /* 21041 transceiver register settings: TP AUTO, BNC, AUI, TP, TP FD*/
365366 static u16 t21041_csr13[] = { 0xEF01, 0xEF09, 0xEF09, 0xEF01, 0xEF09, };
366−static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x6F3F, 0x6F3D, };
367+static u16 t21041_csr14[] = { 0xFFFF, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, };
368+/* If on-chip autonegotiation is broken, use half-duplex (FF3F) instead */
369+static u16 t21041_csr14_brk[] = { 0xFF3F, 0xF7FD, 0xF7FD, 0x7F3F, 0x7F3D, };
367370 static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };
368371
369372
@@ -1064,6 +1067,9 @@ static void de21041_media_timer (unsigned long data) · 694 unmodified lines
10641067 unsigned int carrier;
10651068 unsigned long flags;
10661069
1070+ /* clear port active bits */
1071+ dw32(SIAStatus, NonselPortActive | SelPortActive);
1072+
10671073 carrier = (status & NetCxnErr) ? 0 : 1;
10681074
10691075 if (carrier) {
@@ -1158,14 +1164,29 @@ no_link_yet: · 88 unmodified lines
11581164 static void de_media_interrupt (struct de_private *de, u32 status)
11591165 {
11601166 if (status & LinkPass) {
1167+ /* Ignore if current media is AUI or BNC and we can't use TP */
1168+ if ((de->media_type == DE_MEDIA_AUI ||
1169+ de->media_type == DE_MEDIA_BNC) &&
1170+ (de->media_lock ||
1171+ !de_ok_to_advertise(de, DE_MEDIA_TP_AUTO)))
1172+ return;
1173+ /* If current media is not TP, change it to TP */
1174+ if ((de->media_type == DE_MEDIA_AUI ||
1175+ de->media_type == DE_MEDIA_BNC)) {
1176+ de->media_type = DE_MEDIA_TP_AUTO;
1177+ de_stop_rxtx(de);
1178+ de_set_media(de);
1179+ de_start_rxtx(de);
1180+ }
11611181 de_link_up(de);
11621182 mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK);
11631183 return;
11641184 }
11651185
11661186 BUG_ON(!(status & LinkFail));
1167−
1168− if (netif_carrier_ok(de->dev)) {
1187+ /* Mark the link as down only if current media is TP */
1188+ if (netif_carrier_ok(de->dev) && de->media_type != DE_MEDIA_AUI &&
1189+ de->media_type != DE_MEDIA_BNC) {
11691190 de_link_down(de);
11701191 mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK);
11711192 }
@@ -1229,6 +1250,7 @@ static void de_adapter_sleep (struct de_private *de) · 57 unmodified lines
12291250 if (de->de21040)
12301251 return;
12311252
1253+ dw32(CSR13, 0); /* Reset phy */
12321254 pci_read_config_dword(de->pdev, PCIPM, &pmctl);
12331255 pmctl |= PM_Sleep;
12341256 pci_write_config_dword(de->pdev, PCIPM, pmctl);
@@ -1574,12 +1596,15 @@ static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd) · 339 unmodified lines
15741596 return 0; /* nothing to change */
15751597
15761598 de_link_down(de);
1599+ mod_timer(&de->media_timer, jiffies + DE_TIMER_NO_LINK);
15771600 de_stop_rxtx(de);
15781601
15791602 de->media_type = new_media;
15801603 de->media_lock = media_lock;
15811604 de->media_advertise = ecmd->advertising;
15821605 de_set_media(de);
1606+ if (netif_running(de->dev))
1607+ de_start_rxtx(de);
15831608
15841609 return 0;
15851610 }
@@ -1911,8 +1936,14 @@ fill_defaults: · 325 unmodified lines
19111936 for (i = 0; i < DE_MAX_MEDIA; i++) {
19121937 if (de->media[i].csr13 == 0xffff)
19131938 de->media[i].csr13 = t21041_csr13[i];
1914− if (de->media[i].csr14 == 0xffff)
1915− de->media[i].csr14 = t21041_csr14[i];
1939+ if (de->media[i].csr14 == 0xffff) {
1940+ /* autonegotiation is broken at least on some chip
1941+ revisions - rev. 0x21 works, 0x11 does not */
1942+ if (de->pdev->revision < 0x20)
1943+ de->media[i].csr14 = t21041_csr14_brk[i];
1944+ else
1945+ de->media[i].csr14 = t21041_csr14[i];
1946+ }
19161947 if (de->media[i].csr15 == 0xffff)
19171948 de->media[i].csr15 = t21041_csr15[i];
19181949 }
@@ -2158,6 +2189,8 @@ static int de_resume (struct pci_dev *pdev) · 239 unmodified lines
21582189 dev_err(&dev->dev, "pci_enable_device failed in resume\n");
21592190 goto out;
21602191 }
2192+ pci_set_master(pdev);
2193+ de_init_rings(de);
21612194 de_init_hw(de);
21622195 out_attach:
21632196 netif_device_attach(dev);
drivers/net/wireless/iwlwifi/iwl-agn-lib.c+1−1
@@ -1411,7 +1411,7 @@ void iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) · 1410 unmodified lines
14111411 clear_bit(STATUS_SCAN_HW, &priv->status);
14121412 clear_bit(STATUS_SCANNING, &priv->status);
14131413 /* inform mac80211 scan aborted */
1414− queue_work(priv->workqueue, &priv->scan_completed);
1414+ queue_work(priv->workqueue, &priv->abort_scan);
14151415 }
14161416
14171417 int iwlagn_manage_ibss_station(struct iwl_priv *priv,
drivers/net/wireless/iwlwifi/iwl-core.c+5−0
@@ -2613,6 +2613,11 @@ int iwl_force_reset(struct iwl_priv *priv, int mode, bool external) · 2612 unmodified lines
26132613 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
26142614 return -EINVAL;
26152615
2616+ if (test_bit(STATUS_SCANNING, &priv->status)) {
2617+ IWL_DEBUG_INFO(priv, "scan in progress.\n");
2618+ return -EINVAL;
2619+ }
2620+
26162621 if (mode >= IWL_MAX_FORCE_RESET) {
26172622 IWL_DEBUG_INFO(priv, "invalid reset request.\n");
26182623 return -EINVAL;
drivers/net/wireless/iwlwifi/iwl3945-base.c+1−1
@@ -3018,7 +3018,7 @@ void iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) · 3017 unmodified lines
30183018 clear_bit(STATUS_SCANNING, &priv->status);
30193019
30203020 /* inform mac80211 scan aborted */
3021− queue_work(priv->workqueue, &priv->scan_completed);
3021+ queue_work(priv->workqueue, &priv->abort_scan);
30223022 }
30233023
30243024 static void iwl3945_bg_restart(struct work_struct *data)
drivers/pci/intel-iommu.c+70−47
@@ -71,6 +71,49 @@ · 70 unmodified lines
7171 #define DMA_32BIT_PFN IOVA_PFN(DMA_BIT_MASK(32))
7272 #define DMA_64BIT_PFN IOVA_PFN(DMA_BIT_MASK(64))
7373
74+/* page table handling */
75+#define LEVEL_STRIDE (9)
76+#define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1)
77+
78+static inline int agaw_to_level(int agaw)
79+{
80+ return agaw + 2;
81+}
82+
83+static inline int agaw_to_width(int agaw)
84+{
85+ return 30 + agaw * LEVEL_STRIDE;
86+}
87+
88+static inline int width_to_agaw(int width)
89+{
90+ return (width - 30) / LEVEL_STRIDE;
91+}
92+
93+static inline unsigned int level_to_offset_bits(int level)
94+{
95+ return (level - 1) * LEVEL_STRIDE;
96+}
97+
98+static inline int pfn_level_offset(unsigned long pfn, int level)
99+{
100+ return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK;
101+}
102+
103+static inline unsigned long level_mask(int level)
104+{
105+ return -1UL << level_to_offset_bits(level);
106+}
107+
108+static inline unsigned long level_size(int level)
109+{
110+ return 1UL << level_to_offset_bits(level);
111+}
112+
113+static inline unsigned long align_to_level(unsigned long pfn, int level)
114+{
115+ return (pfn + level_size(level) - 1) & level_mask(level);
116+}
74117
75118 /* VT-d pages must always be _smaller_ than MM pages. Otherwise things
76119 are never going to work. */
@@ -434,8 +477,6 @@ void free_iova_mem(struct iova *iova) · 357 unmodified lines
434477 }
435478
436479
437−static inline int width_to_agaw(int width);
438−
439480 static int __iommu_calculate_agaw(struct intel_iommu *iommu, int max_gaw)
440481 {
441482 unsigned long sagaw;
@@ -646,51 +687,6 @@ out: · 204 unmodified lines
646687 spin_unlock_irqrestore(&iommu->lock, flags);
647688 }
648689
649−/* page table handling */
650−#define LEVEL_STRIDE (9)
651−#define LEVEL_MASK (((u64)1 << LEVEL_STRIDE) - 1)
652−
653−static inline int agaw_to_level(int agaw)
654−{
655− return agaw + 2;
656−}
657−
658−static inline int agaw_to_width(int agaw)
659−{
660− return 30 + agaw * LEVEL_STRIDE;
661−
662−}
663−
664−static inline int width_to_agaw(int width)
665−{
666− return (width - 30) / LEVEL_STRIDE;
667−}
668−
669−static inline unsigned int level_to_offset_bits(int level)
670−{
671− return (level - 1) * LEVEL_STRIDE;
672−}
673−
674−static inline int pfn_level_offset(unsigned long pfn, int level)
675−{
676− return (pfn >> level_to_offset_bits(level)) & LEVEL_MASK;
677−}
678−
679−static inline unsigned long level_mask(int level)
680−{
681− return -1UL << level_to_offset_bits(level);
682−}
683−
684−static inline unsigned long level_size(int level)
685−{
686− return 1UL << level_to_offset_bits(level);
687−}
688−
689−static inline unsigned long align_to_level(unsigned long pfn, int level)
690−{
691− return (pfn + level_size(level) - 1) & level_mask(level);
692−}
693−
694690 static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
695691 unsigned long pfn)
696692 {
@@ -3761,6 +3757,33 @@ static void __devinit quirk_iommu_rwbf(struct pci_dev *dev) · 3064 unmodified lines
37613757
37623758 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);
37633759
3760+#define GGC 0x52
3761+#define GGC_MEMORY_SIZE_MASK (0xf << 8)
3762+#define GGC_MEMORY_SIZE_NONE (0x0 << 8)
3763+#define GGC_MEMORY_SIZE_1M (0x1 << 8)
3764+#define GGC_MEMORY_SIZE_2M (0x3 << 8)
3765+#define GGC_MEMORY_VT_ENABLED (0x8 << 8)
3766+#define GGC_MEMORY_SIZE_2M_VT (0x9 << 8)
3767+#define GGC_MEMORY_SIZE_3M_VT (0xa << 8)
3768+#define GGC_MEMORY_SIZE_4M_VT (0xb << 8)
3769+
3770+static void __devinit quirk_calpella_no_shadow_gtt(struct pci_dev *dev)
3771+{
3772+ unsigned short ggc;
3773+
3774+ if (pci_read_config_word(dev, GGC, &ggc))
3775+ return;
3776+
3777+ if (!(ggc & GGC_MEMORY_VT_ENABLED)) {
3778+ printk(KERN_INFO "DMAR: BIOS has allocated no shadow GTT; disabling IOMMU for graphics\n");
3779+ dmar_map_gfx = 0;
3780+ }
3781+}
3782+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt);
3783+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt);
3784+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt);
3785+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt);
3786+
37643787 /* On Tylersburg chipsets, some BIOSes have been known to enable the
37653788 ISOCH DMAR unit for the Azalia sound device, but not give it any
37663789 TLB entries, which causes it to deadlock. Check for that. We do
drivers/pci/iov.c+1−1
@@ -608,7 +608,7 @@ int pci_iov_resource_bar(struct pci_dev *dev, int resno, · 607 unmodified lines
608608 * the VF BAR size multiplied by the number of VFs. The alignment
609609 * is just the VF BAR size.
610610 */
611−int pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
611+resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
612612 {
613613 struct resource tmp;
614614 enum pci_bar_type type;
drivers/pci/pci.h+3−2
@@ -264,7 +264,8 @@ extern int pci_iov_init(struct pci_dev *dev); · 263 unmodified lines
264264 extern void pci_iov_release(struct pci_dev *dev);
265265 extern int pci_iov_resource_bar(struct pci_dev *dev, int resno,
266266 enum pci_bar_type *type);
267−extern int pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
267+extern resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev,
268+ int resno);
268269 extern void pci_restore_iov_state(struct pci_dev *dev);
269270 extern int pci_iov_bus_range(struct pci_bus *bus);
270271
@@ -320,7 +321,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev) · 49 unmodified lines
320321 }
321322 #endif /* CONFIG_PCI_IOV */
322323
323−static inline int pci_resource_alignment(struct pci_dev *dev,
324+static inline resource_size_t pci_resource_alignment(struct pci_dev *dev,
324325 struct resource *res)
325326 {
326327 #ifdef CONFIG_PCI_IOV
drivers/pci/quirks.c+20−0
@@ -162,6 +162,26 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_1, quirk_isa_d · 161 unmodified lines
162162 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_dma_hangs);
163163 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs);
164164
165+/*
166+ * Intel NM10 "TigerPoint" LPC PM1a_STS.BM_STS must be clear
167+ * for some HT machines to use C4 w/o hanging.
168+ */
169+static void __devinit quirk_tigerpoint_bm_sts(struct pci_dev *dev)
170+{
171+ u32 pmbase;
172+ u16 pm1a;
173+
174+ pci_read_config_dword(dev, 0x40, &pmbase);
175+ pmbase = pmbase & 0xff80;
176+ pm1a = inw(pmbase);
177+
178+ if (pm1a & 0x10) {
179+ dev_info(&dev->dev, FW_BUG "TigerPoint LPC.BM_STS cleared\n");
180+ outw(0x10, pmbase);
181+ }
182+}
183+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TGP_LPC, quirk_tigerpoint_bm_sts);
184+
165185 /*
166186 * Chipsets where PCI->PCI transfers vanish or hang
167187 */
drivers/pcmcia/pcmcia_resource.c+6−0
@@ -595,7 +595,13 @@ int pcmcia_request_io(struct pcmcia_device *p_dev) · 594 unmodified lines
595595 if (c->io[1].end) {
596596 ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);
597597 if (ret) {
598+ struct resource tmp = c->io[0];
599+ /* release the previously allocated resource */
598600 release_io_space(s, &c->io[0]);
601+ /* but preserve the settings, for they worked... */
602+ c->io[0].end = resource_size(&tmp);
603+ c->io[0].start = tmp.start;
604+ c->io[0].flags = tmp.flags;
599605 goto out;
600606 }
601607 } else
drivers/pcmcia/pd6729.c+1−1
@@ -646,7 +646,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev, · 645 unmodified lines
646646 if (!pci_resource_start(dev, 0)) {
647647 dev_warn(&dev->dev, "refusing to load the driver as the "
648648 "io_base is NULL.\n");
649− goto err_out_free_mem;
649+ goto err_out_disable;
650650 }
651651
652652 dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx "
drivers/platform/x86/thinkpad_acpi.c+3−2
@@ -3093,7 +3093,8 @@ static const struct tpacpi_quirk tpacpi_hotkey_qtable[] __initconst = { · 3092 unmodified lines
30933093 TPACPI_Q_IBM('1', 'D', TPACPI_HK_Q_INIMASK), /* X22, X23, X24 */
30943094 };
30953095
3096−typedef u16 tpacpi_keymap_t[TPACPI_HOTKEY_MAP_LEN];
3096+typedef u16 tpacpi_keymap_entry_t;
3097+typedef tpacpi_keymap_entry_t tpacpi_keymap_t[TPACPI_HOTKEY_MAP_LEN];
30973098
30983099 static int __init hotkey_init(struct ibm_init_struct *iibm)
30993100 {
@@ -3230,7 +3231,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) · 130 unmodified lines
32303231 };
32313232
32323233 #define TPACPI_HOTKEY_MAP_SIZE sizeof(tpacpi_keymap_t)
3233−#define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_t[0])
3234+#define TPACPI_HOTKEY_MAP_TYPESIZE sizeof(tpacpi_keymap_entry_t)
32343235
32353236 int res, i;
32363237 int status;
drivers/regulator/core.c+4−2
@@ -700,7 +700,7 @@ static void print_constraints(struct regulator_dev *rdev) · 699 unmodified lines
700700 constraints->min_uA != constraints->max_uA) {
701701 ret = _regulator_get_current_limit(rdev);
702702 if (ret > 0)
703− count += sprintf(buf + count, "at %d uA ", ret / 1000);
703+ count += sprintf(buf + count, "at %d mA ", ret / 1000);
704704 }
705705
706706 if (constraints->valid_modes_mask & REGULATOR_MODE_FAST)
@@ -2302,8 +2302,10 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, · 1595 unmodified lines
23022302 dev_set_name(&rdev->dev, "regulator.%d",
23032303 atomic_inc_return(&regulator_no) - 1);
23042304 ret = device_register(&rdev->dev);
2305− if (ret != 0)
2305+ if (ret != 0) {
2306+ put_device(&rdev->dev);
23062307 goto clean;
2308+ }
23072309
23082310 dev_set_drvdata(&rdev->dev, rdev);
23092311
drivers/regulator/max8649.c+1−1
@@ -330,7 +330,7 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client, · 329 unmodified lines
330330 /* set external clock frequency */
331331 info->extclk_freq = pdata->extclk_freq;
332332 max8649_set_bits(info->i2c, MAX8649_SYNC, MAX8649_EXT_MASK,
333− info->extclk_freq);
333+ info->extclk_freq << 6);
334334 }
335335
336336 if (pdata->ramp_timing) {
drivers/rtc/rtc-ab3100.c+2−0
@@ -235,6 +235,7 @@ static int __init ab3100_rtc_probe(struct platform_device *pdev) · 234 unmodified lines
235235 err = PTR_ERR(rtc);
236236 return err;
237237 }
238+ platform_set_drvdata(pdev, rtc);
238239
239240 return 0;
240241 }
@@ -244,6 +245,7 @@ static int __exit ab3100_rtc_remove(struct platform_device *pdev) · 3 unmodified lines
244245 struct rtc_device *rtc = platform_get_drvdata(pdev);
245246
246247 rtc_device_unregister(rtc);
248+ platform_set_drvdata(pdev, NULL);
247249 return 0;
248250 }
249251
drivers/rtc/rtc-s3c.c+8−5
@@ -310,11 +310,6 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) · 309 unmodified lines
310310
311311 s3c_rtc_setaie(alrm->enabled);
312312
313− if (alrm->enabled)
314− enable_irq_wake(s3c_rtc_alarmno);
315− else
316− disable_irq_wake(s3c_rtc_alarmno);
317−
318313 return 0;
319314 }
320315
@@ -587,6 +582,10 @@ static int s3c_rtc_suspend(struct platform_device *pdev, pm_message_t state) · 266 unmodified lines
587582 ticnt_en_save &= S3C64XX_RTCCON_TICEN;
588583 }
589584 s3c_rtc_enable(pdev, 0);
585+
586+ if (device_may_wakeup(&pdev->dev))
587+ enable_irq_wake(s3c_rtc_alarmno);
588+
590589 return 0;
591590 }
592591
@@ -600,6 +599,10 @@ static int s3c_rtc_resume(struct platform_device *pdev) · 7 unmodified lines
600599 tmp = readb(s3c_rtc_base + S3C2410_RTCCON);
601600 writeb(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON);
602601 }
602+
603+ if (device_may_wakeup(&pdev->dev))
604+ disable_irq_wake(s3c_rtc_alarmno);
605+
603606 return 0;
604607 }
605608 #else
drivers/s390/net/ctcm_main.c+2−2
@@ -1154,7 +1154,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) · 1153 unmodified lines
11541154 dev_fsm, dev_fsm_len, GFP_KERNEL);
11551155 if (priv->fsm == NULL) {
11561156 CTCMY_DBF_DEV(SETUP, dev, "init_fsm error");
1157− kfree(dev);
1157+ free_netdev(dev);
11581158 return NULL;
11591159 }
11601160 fsm_newstate(priv->fsm, DEV_STATE_STOPPED);
@@ -1165,7 +1165,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) · 4 unmodified lines
11651165 grp = ctcmpc_init_mpc_group(priv);
11661166 if (grp == NULL) {
11671167 MPC_DBF_DEV(SETUP, dev, "init_mpc_group error");
1168− kfree(dev);
1168+ free_netdev(dev);
11691169 return NULL;
11701170 }
11711171 tasklet_init(&grp->mpc_tasklet2,
drivers/serial/mfd.c+1−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <linux/init.h>
2828 #include <linux/console.h>
2929 #include <linux/sysrq.h>
30+#include <linux/slab.h>
3031 #include <linux/serial_reg.h>
3132 #include <linux/circ_buf.h>
3233 #include <linux/delay.h>
drivers/serial/mrst_max3110.c+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929
3030 #include <linux/module.h>
3131 #include <linux/ioport.h>
32+#include <linux/irq.h>
3233 #include <linux/init.h>
3334 #include <linux/console.h>
3435 #include <linux/sysrq.h>
drivers/spi/spi.c+5−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/init.h>
2424 #include <linux/cache.h>
2525 #include <linux/mutex.h>
26+#include <linux/of_device.h>
2627 #include <linux/slab.h>
2728 #include <linux/mod_devicetable.h>
2829 #include <linux/spi/spi.h>
@@ -86,6 +87,10 @@ static int spi_match_device(struct device *dev, struct device_driver *drv) · 57 unmodified lines
8687 const struct spi_device *spi = to_spi_device(dev);
8788 const struct spi_driver *sdrv = to_spi_driver(drv);
8889
90+ /* Attempt an OF style match */
91+ if (of_driver_match_device(dev, drv))
92+ return 1;
93+
8994 if (sdrv->id_table)
9095 return !!spi_match_id(sdrv->id_table, spi);
9196
drivers/spi/spi_gpio.c+1−1
@@ -350,7 +350,7 @@ static int __init spi_gpio_probe(struct platform_device *pdev) · 349 unmodified lines
350350 spi_gpio->bitbang.master = spi_master_get(master);
351351 spi_gpio->bitbang.chipselect = spi_gpio_chipselect;
352352
353− if ((master_flags & (SPI_MASTER_NO_RX | SPI_MASTER_NO_RX)) == 0) {
353+ if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) {
354354 spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0;
355355 spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1;
356356 spi_gpio->bitbang.txrx_word[SPI_MODE_2] = spi_gpio_txrx_word_mode2;
drivers/spi/spi_mpc8xxx.c+8−2
@@ -408,11 +408,17 @@ static void mpc8xxx_spi_cpm_bufs_start(struct mpc8xxx_spi *mspi) · 407 unmodified lines
408408
409409 xfer_ofs = mspi->xfer_in_progress->len - mspi->count;
410410
411− out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs);
411+ if (mspi->rx_dma == mspi->dma_dummy_rx)
412+ out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma);
413+ else
414+ out_be32(&rx_bd->cbd_bufaddr, mspi->rx_dma + xfer_ofs);
412415 out_be16(&rx_bd->cbd_datlen, 0);
413416 out_be16(&rx_bd->cbd_sc, BD_SC_EMPTY | BD_SC_INTRPT | BD_SC_WRAP);
414417
415− out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs);
418+ if (mspi->tx_dma == mspi->dma_dummy_tx)
419+ out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma);
420+ else
421+ out_be32(&tx_bd->cbd_bufaddr, mspi->tx_dma + xfer_ofs);
416422 out_be16(&tx_bd->cbd_datlen, xfer_len);
417423 out_be16(&tx_bd->cbd_sc, BD_SC_READY | BD_SC_INTRPT | BD_SC_WRAP |
418424 BD_SC_LAST);
drivers/staging/ti-st/st.h+0−1
@@ -80,5 +80,4 @@ struct st_proto_s { · 79 unmodified lines
8080 extern long st_register(struct st_proto_s *);
8181 extern long st_unregister(enum proto_type);
8282
83−extern struct platform_device *st_get_plat_device(void);
8483 #endif /* ST_H */
drivers/staging/ti-st/st_core.c+4−5
@@ -38,7 +38,6 @@ · 37 unmodified lines
3838 #include "st_ll.h"
3939 #include "st.h"
4040
41−#define VERBOSE
4241 /* strings to be used for rfkill entries and by
4342 * ST Core to be used for sysfs debug entry
4443 */
@@ -581,7 +580,7 @@ long st_register(struct st_proto_s *new_proto) · 536 unmodified lines
581580 long err = 0;
582581 unsigned long flags = 0;
583582
584− st_kim_ref(&st_gdata);
583+ st_kim_ref(&st_gdata, 0);
585584 pr_info("%s(%d) ", __func__, new_proto->type);
586585 if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL
587586 || new_proto->reg_complete_cb == NULL) {
@@ -713,7 +712,7 @@ long st_unregister(enum proto_type type) · 125 unmodified lines
713712
714713 pr_debug("%s: %d ", __func__, type);
715714
716− st_kim_ref(&st_gdata);
715+ st_kim_ref(&st_gdata, 0);
717716 if (type < ST_BT || type >= ST_MAX) {
718717 pr_err(" protocol %d not supported", type);
719718 return -EPROTONOSUPPORT;
@@ -767,7 +766,7 @@ long st_write(struct sk_buff *skb) · 47 unmodified lines
767766 #endif
768767 long len;
769768
770− st_kim_ref(&st_gdata);
769+ st_kim_ref(&st_gdata, 0);
771770 if (unlikely(skb == NULL || st_gdata == NULL
772771 || st_gdata->tty == NULL)) {
773772 pr_err("data/tty unavailable to perform write");
@@ -818,7 +817,7 @@ static int st_tty_open(struct tty_struct *tty) · 44 unmodified lines
818817 struct st_data_s *st_gdata;
819818 pr_info("%s ", __func__);
820819
821− st_kim_ref(&st_gdata);
820+ st_kim_ref(&st_gdata, 0);
822821 st_gdata->tty = tty;
823822 tty->disc_data = st_gdata;
824823
drivers/staging/ti-st/st_core.h+1−1
@@ -117,7 +117,7 @@ int st_core_init(struct st_data_s **); · 116 unmodified lines
117117 void st_core_exit(struct st_data_s *);
118118
119119 /* ask for reference from KIM */
120−void st_kim_ref(struct st_data_s **);
120+void st_kim_ref(struct st_data_s **, int);
121121
122122 #define GPS_STUB_TEST
123123 #ifdef GPS_STUB_TEST
drivers/staging/ti-st/st_kim.c+19−3
@@ -72,10 +72,25 @@ const unsigned char *protocol_names[] = { · 71 unmodified lines
7272 PROTO_ENTRY(ST_GPS, "GPS"),
7373 };
7474
75+#define MAX_ST_DEVICES 3 /* Imagine 1 on each UART for now */
76+struct platform_device *st_kim_devices[MAX_ST_DEVICES];
7577
7678 /**********************************************************************/
7779 /* internal functions */
7880
81+/**
82+ * st_get_plat_device -
83+ * function which returns the reference to the platform device
84+ * requested by id. As of now only 1 such device exists (id=0)
85+ * the context requesting for reference can get the id to be
86+ * requested by a. The protocol driver which is registering or
87+ * b. the tty device which is opened.
88+ */
89+static struct platform_device *st_get_plat_device(int id)
90+{
91+ return st_kim_devices[id];
92+}
93+
7994 /**
8095 * validate_firmware_response -
8196 * function to return whether the firmware response was proper
@@ -353,7 +368,7 @@ void st_kim_chip_toggle(enum proto_type type, enum kim_gpio_state state) · 271 unmodified lines
353368 struct kim_data_s *kim_gdata;
354369 pr_info(" %s ", __func__);
355370
356− kim_pdev = st_get_plat_device();
371+ kim_pdev = st_get_plat_device(0);
357372 kim_gdata = dev_get_drvdata(&kim_pdev->dev);
358373
359374 if (kim_gdata->gpios[type] == -1) {
@@ -574,12 +589,12 @@ static int kim_toggle_radio(void *data, bool blocked) · 214 unmodified lines
574589 * This would enable multiple such platform devices to exist
575590 * on a given platform
576591 */
577−void st_kim_ref(struct st_data_s **core_data)
592+void st_kim_ref(struct st_data_s **core_data, int id)
578593 {
579594 struct platform_device *pdev;
580595 struct kim_data_s *kim_gdata;
581596 /* get kim_gdata reference from platform device */
582− pdev = st_get_plat_device();
597+ pdev = st_get_plat_device(id);
583598 kim_gdata = dev_get_drvdata(&pdev->dev);
584599 *core_data = kim_gdata->core_data;
585600 }
@@ -623,6 +638,7 @@ static int kim_probe(struct platform_device *pdev) · 37 unmodified lines
623638 long *gpios = pdev->dev.platform_data;
624639 struct kim_data_s *kim_gdata;
625640
641+ st_kim_devices[pdev->id] = pdev;
626642 kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_ATOMIC);
627643 if (!kim_gdata) {
628644 pr_err("no mem to allocate");
drivers/usb/core/Kconfig+3−3
@@ -91,12 +91,12 @@ config USB_DYNAMIC_MINORS · 90 unmodified lines
9191 If you are unsure about this, say N here.
9292
9393 config USB_SUSPEND
94− bool "USB runtime power management (suspend/resume and wakeup)"
94+ bool "USB runtime power management (autosuspend) and wakeup"
9595 depends on USB && PM_RUNTIME
9696 help
9797 If you say Y here, you can use driver calls or the sysfs
98− "power/level" file to suspend or resume individual USB
99− peripherals and to enable or disable autosuspend (see
98+ "power/control" file to enable or disable autosuspend for
99+ individual USB peripherals (see
100100 Documentation/usb/power-management.txt for more details).
101101
102102 Also, USB "remote wakeup" signaling is supported, whereby some
drivers/usb/core/file.c+16−19
@@ -159,9 +159,9 @@ void usb_major_cleanup(void) · 158 unmodified lines
159159 int usb_register_dev(struct usb_interface *intf,
160160 struct usb_class_driver *class_driver)
161161 {
162− int retval = -EINVAL;
162+ int retval;
163163 int minor_base = class_driver->minor_base;
164− int minor = 0;
164+ int minor;
165165 char name[20];
166166 char *temp;
167167
@@ -173,12 +173,17 @@ int usb_register_dev(struct usb_interface *intf, · 5 unmodified lines
173173 */
174174 minor_base = 0;
175175 #endif
176− intf->minor = -1;
177−
178− dbg ("looking for a minor, starting at %d", minor_base);
179176
180177 if (class_driver->fops == NULL)
181− goto exit;
178+ return -EINVAL;
179+ if (intf->minor >= 0)
180+ return -EADDRINUSE;
181+
182+ retval = init_usb_class();
183+ if (retval)
184+ return retval;
185+
186+ dev_dbg(&intf->dev, "looking for a minor, starting at %d", minor_base);
182187
183188 down_write(&minor_rwsem);
184189 for (minor = minor_base; minor < MAX_USB_MINORS; ++minor) {
@@ -186,20 +191,12 @@ int usb_register_dev(struct usb_interface *intf, · 1 unmodified line
186191 continue;
187192
188193 usb_minors[minor] = class_driver->fops;
189−
190− retval = 0;
194+ intf->minor = minor;
191195 break;
192196 }
193197 up_write(&minor_rwsem);
194−
195− if (retval)
196− goto exit;
197−
198− retval = init_usb_class();
199− if (retval)
200− goto exit;
201−
202− intf->minor = minor;
198+ if (intf->minor < 0)
199+ return -EXFULL;
203200
204201 /* create a usb class device for this usb interface */
205202 snprintf(name, sizeof(name), class_driver->name, minor - minor_base);
@@ -213,11 +210,11 @@ int usb_register_dev(struct usb_interface *intf, · 7 unmodified lines
213210 "%s", temp);
214211 if (IS_ERR(intf->usb_dev)) {
215212 down_write(&minor_rwsem);
216− usb_minors[intf->minor] = NULL;
213+ usb_minors[minor] = NULL;
214+ intf->minor = -1;
217215 up_write(&minor_rwsem);
218216 retval = PTR_ERR(intf->usb_dev);
219217 }
220−exit:
221218 return retval;
222219 }
223220 EXPORT_SYMBOL_GPL(usb_register_dev);
drivers/usb/core/message.c+1−0
@@ -1802,6 +1802,7 @@ free_interfaces: · 1801 unmodified lines
18021802 intf->dev.groups = usb_interface_groups;
18031803 intf->dev.dma_mask = dev->dev.dma_mask;
18041804 INIT_WORK(&intf->reset_ws, __usb_queue_reset_device);
1805+ intf->minor = -1;
18051806 device_initialize(&intf->dev);
18061807 dev_set_name(&intf->dev, "%d-%s:%d.%d",
18071808 dev->bus->busnum, dev->devpath,
drivers/usb/musb/cppi_dma.c+1−0
@@ -322,6 +322,7 @@ cppi_channel_allocate(struct dma_controller *c, · 321 unmodified lines
322322 index, transmit ? 'T' : 'R', cppi_ch);
323323 cppi_ch->hw_ep = ep;
324324 cppi_ch->channel.status = MUSB_DMA_STATUS_FREE;
325+ cppi_ch->channel.max_len = 0x7fffffff;
325326
326327 DBG(4, "Allocate CPPI%d %cX\n", index, transmit ? 'T' : 'R');
327328 return &cppi_ch->channel;
drivers/usb/musb/musb_gadget.c+39−36
@@ -300,6 +300,11 @@ static void txstate(struct musb *musb, struct musb_request *req) · 299 unmodified lines
300300 #ifndef CONFIG_MUSB_PIO_ONLY
301301 if (is_dma_capable() && musb_ep->dma) {
302302 struct dma_controller *c = musb->dma_controller;
303+ size_t request_size;
304+
305+ /* setup DMA, then program endpoint CSR */
306+ request_size = min_t(size_t, request->length - request->actual,
307+ musb_ep->dma->max_len);
303308
304309 use_dma = (request->dma != DMA_ADDR_INVALID);
305310
@@ -307,11 +312,6 @@ static void txstate(struct musb *musb, struct musb_request *req) · 1 unmodified line
307312
308313 #ifdef CONFIG_USB_INVENTRA_DMA
309314 {
310− size_t request_size;
311−
312− /* setup DMA, then program endpoint CSR */
313− request_size = min_t(size_t, request->length,
314− musb_ep->dma->max_len);
315315 if (request_size < musb_ep->packet_sz)
316316 musb_ep->dma->desired_mode = 0;
317317 else
@@ -373,8 +373,8 @@ static void txstate(struct musb *musb, struct musb_request *req) · 55 unmodified lines
373373 use_dma = use_dma && c->channel_program(
374374 musb_ep->dma, musb_ep->packet_sz,
375375 0,
376− request->dma,
377− request->length);
376+ request->dma + request->actual,
377+ request_size);
378378 if (!use_dma) {
379379 c->channel_release(musb_ep->dma);
380380 musb_ep->dma = NULL;
@@ -386,8 +386,8 @@ static void txstate(struct musb *musb, struct musb_request *req) · 5 unmodified lines
386386 use_dma = use_dma && c->channel_program(
387387 musb_ep->dma, musb_ep->packet_sz,
388388 request->zero,
389− request->dma,
390− request->length);
389+ request->dma + request->actual,
390+ request_size);
391391 #endif
392392 }
393393 #endif
@@ -501,26 +501,14 @@ void musb_g_tx(struct musb *musb, u8 epnum) · 107 unmodified lines
501501 request->zero = 0;
502502 }
503503
504− /* ... or if not, then complete it. */
505− musb_g_giveback(musb_ep, request, 0);
506−
507− /*
508− * Kickstart next transfer if appropriate;
509− * the packet that just completed might not
510− * be transmitted for hours or days.
511− * REVISIT for double buffering...
512− * FIXME revisit for stalls too...
513− */
514− musb_ep_select(mbase, epnum);
515− csr = musb_readw(epio, MUSB_TXCSR);
516− if (csr & MUSB_TXCSR_FIFONOTEMPTY)
517− return;
518−
519− request = musb_ep->desc ? next_request(musb_ep) : NULL;
520− if (!request) {
521− DBG(4, "%s idle now\n",
522− musb_ep->end_point.name);
523− return;
504+ if (request->actual == request->length) {
505+ musb_g_giveback(musb_ep, request, 0);
506+ request = musb_ep->desc ? next_request(musb_ep) : NULL;
507+ if (!request) {
508+ DBG(4, "%s idle now\n",
509+ musb_ep->end_point.name);
510+ return;
511+ }
524512 }
525513 }
526514
@@ -568,11 +556,19 @@ static void rxstate(struct musb *musb, struct musb_request *req) · 41 unmodified lines
568556 {
569557 const u8 epnum = req->epnum;
570558 struct usb_request *request = &req->request;
571− struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
559+ struct musb_ep *musb_ep;
572560 void __iomem *epio = musb->endpoints[epnum].regs;
573561 unsigned fifo_count = 0;
574− u16 len = musb_ep->packet_sz;
562+ u16 len;
575563 u16 csr = musb_readw(epio, MUSB_RXCSR);
564+ struct musb_hw_ep *hw_ep = &musb->endpoints[epnum];
565+
566+ if (hw_ep->is_shared_fifo)
567+ musb_ep = &hw_ep->ep_in;
568+ else
569+ musb_ep = &hw_ep->ep_out;
570+
571+ len = musb_ep->packet_sz;
576572
577573 /* We shouldn't get here while DMA is active, but we do... */
578574 if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) {
@@ -647,8 +643,8 @@ static void rxstate(struct musb *musb, struct musb_request *req) · 68 unmodified lines
647643 */
648644
649645 csr |= MUSB_RXCSR_DMAENAB;
650−#ifdef USE_MODE1
651646 csr |= MUSB_RXCSR_AUTOCLEAR;
647+#ifdef USE_MODE1
652648 /* csr |= MUSB_RXCSR_DMAMODE; */
653649
654650 /* this special sequence (enabling and then
@@ -663,10 +659,11 @@ static void rxstate(struct musb *musb, struct musb_request *req) · 8 unmodified lines
663659 if (request->actual < request->length) {
664660 int transfer_size = 0;
665661 #ifdef USE_MODE1
666− transfer_size = min(request->length,
662+ transfer_size = min(request->length - request->actual,
667663 channel->max_len);
668664 #else
669− transfer_size = len;
665+ transfer_size = min(request->length - request->actual,
666+ (unsigned)len);
670667 #endif
671668 if (transfer_size <= musb_ep->packet_sz)
672669 musb_ep->dma->desired_mode = 0;
@@ -740,9 +737,15 @@ void musb_g_rx(struct musb *musb, u8 epnum) · 67 unmodified lines
740737 u16 csr;
741738 struct usb_request *request;
742739 void __iomem *mbase = musb->mregs;
743− struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
740+ struct musb_ep *musb_ep;
744741 void __iomem *epio = musb->endpoints[epnum].regs;
745742 struct dma_channel *dma;
743+ struct musb_hw_ep *hw_ep = &musb->endpoints[epnum];
744+
745+ if (hw_ep->is_shared_fifo)
746+ musb_ep = &hw_ep->ep_in;
747+ else
748+ musb_ep = &hw_ep->ep_out;
746749
747750 musb_ep_select(mbase, epnum);
748751
@@ -1081,7 +1084,7 @@ struct free_record { · 332 unmodified lines
10811084 /*
10821085 * Context: controller locked, IRQs blocked.
10831086 */
1084−static void musb_ep_restart(struct musb *musb, struct musb_request *req)
1087+void musb_ep_restart(struct musb *musb, struct musb_request *req)
10851088 {
10861089 DBG(3, "<== %s request %p len %u on hw_ep%d\n",
10871090 req->tx ? "TX/IN" : "RX/OUT",
drivers/usb/musb/musb_gadget.h+2−0
@@ -105,4 +105,6 @@ extern void musb_gadget_cleanup(struct musb *); · 104 unmodified lines
105105
106106 extern void musb_g_giveback(struct musb_ep *, struct usb_request *, int);
107107
108+extern void musb_ep_restart(struct musb *, struct musb_request *);
109+
108110 #endif /* __MUSB_GADGET_H */
drivers/usb/musb/musb_gadget_ep0.c+9−0
@@ -261,6 +261,7 @@ __acquires(musb->lock) · 260 unmodified lines
261261 ctrlrequest->wIndex & 0x0f;
262262 struct musb_ep *musb_ep;
263263 struct musb_hw_ep *ep;
264+ struct musb_request *request;
264265 void __iomem *regs;
265266 int is_in;
266267 u16 csr;
@@ -302,6 +303,14 @@ __acquires(musb->lock) · 35 unmodified lines
302303 musb_writew(regs, MUSB_RXCSR, csr);
303304 }
304305
306+ /* Maybe start the first request in the queue */
307+ request = to_musb_request(
308+ next_request(musb_ep));
309+ if (!musb_ep->busy && request) {
310+ DBG(3, "restarting the request\n");
311+ musb_ep_restart(musb, request);
312+ }
313+
305314 /* select ep0 again */
306315 musb_ep_select(mbase, 0);
307316 } break;
drivers/usb/musb/musb_host.c+6−0
@@ -660,6 +660,12 @@ static bool musb_tx_dma_program(struct dma_controller *dma, · 659 unmodified lines
660660
661661 qh->segsize = length;
662662
663+ /*
664+ * Ensure the data reaches to main memory before starting
665+ * DMA transfer
666+ */
667+ wmb();
668+
663669 if (!dma->channel_program(channel, pkt_size, mode,
664670 urb->transfer_dma + offset, length)) {
665671 dma->channel_release(channel);
drivers/vhost/net.c+1−1
@@ -243,7 +243,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, · 242 unmodified lines
243243 int r, nlogs = 0;
244244
245245 while (datalen > 0) {
246− if (unlikely(headcount >= VHOST_NET_MAX_SG)) {
246+ if (unlikely(seg >= VHOST_NET_MAX_SG)) {
247247 r = -ENOBUFS;
248248 goto err;
249249 }
drivers/vhost/vhost.c+4−3
@@ -858,11 +858,12 @@ int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, · 857 unmodified lines
858858 if (r < 0)
859859 return r;
860860 len -= l;
861− if (!len)
861+ if (!len) {
862+ if (vq->log_ctx)
863+ eventfd_signal(vq->log_ctx, 1);
862864 return 0;
865+ }
863866 }
864− if (vq->log_ctx)
865− eventfd_signal(vq->log_ctx, 1);
866867 /* Length written exceeds what we have stored. This is a bug. */
867868 BUG();
868869 return 0;
drivers/video/console/fbcon.c+3−2
@@ -3508,7 +3508,7 @@ static void fbcon_exit(void) · 3507 unmodified lines
35083508 softback_buf = 0UL;
35093509
35103510 for (i = 0; i < FB_MAX; i++) {
3511− int pending;
3511+ int pending = 0;
35123512
35133513 mapped = 0;
35143514 info = registered_fb[i];
@@ -3516,7 +3516,8 @@ static void fbcon_exit(void) · 1 unmodified line
35163516 if (info == NULL)
35173517 continue;
35183518
3519− pending = cancel_work_sync(&info->queue);
3519+ if (info->queue.func)
3520+ pending = cancel_work_sync(&info->queue);
35203521 DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" :
35213522 "no"));
35223523
drivers/video/efifb.c+91−12
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include <linux/platform_device.h>
1414 #include <linux/screen_info.h>
1515 #include <linux/dmi.h>
16−
16+#include <linux/pci.h>
1717 #include <video/vga.h>
1818
1919 static struct fb_var_screeninfo efifb_defined __devinitdata = {
@@ -39,17 +39,31 @@ enum { · 19 unmodified lines
3939 M_I20, /* 20-Inch iMac */
4040 M_I20_SR, /* 20-Inch iMac (Santa Rosa) */
4141 M_I24, /* 24-Inch iMac */
42+ M_I24_8_1, /* 24-Inch iMac, 8,1th gen */
43+ M_I24_10_1, /* 24-Inch iMac, 10,1th gen */
44+ M_I27_11_1, /* 27-Inch iMac, 11,1th gen */
4245 M_MINI, /* Mac Mini */
46+ M_MINI_3_1, /* Mac Mini, 3,1th gen */
47+ M_MINI_4_1, /* Mac Mini, 4,1th gen */
4348 M_MB, /* MacBook */
4449 M_MB_2, /* MacBook, 2nd rev. */
4550 M_MB_3, /* MacBook, 3rd rev. */
51+ M_MB_5_1, /* MacBook, 5th rev. */
52+ M_MB_6_1, /* MacBook, 6th rev. */
53+ M_MB_7_1, /* MacBook, 7th rev. */
4654 M_MB_SR, /* MacBook, 2nd gen, (Santa Rosa) */
4755 M_MBA, /* MacBook Air */
4856 M_MBP, /* MacBook Pro */
4957 M_MBP_2, /* MacBook Pro 2nd gen */
58+ M_MBP_2_2, /* MacBook Pro 2,2nd gen */
5059 M_MBP_SR, /* MacBook Pro (Santa Rosa) */
5160 M_MBP_4, /* MacBook Pro, 4th gen */
5261 M_MBP_5_1, /* MacBook Pro, 5,1th gen */
62+ M_MBP_5_2, /* MacBook Pro, 5,2th gen */
63+ M_MBP_5_3, /* MacBook Pro, 5,3rd gen */
64+ M_MBP_6_1, /* MacBook Pro, 6,1th gen */
65+ M_MBP_6_2, /* MacBook Pro, 6,2th gen */
66+ M_MBP_7_1, /* MacBook Pro, 7,1th gen */
5367 M_UNKNOWN /* placeholder */
5468 };
5569
@@ -64,14 +78,28 @@ static struct efifb_dmi_info { · 8 unmodified lines
6478 [M_I20] = { "i20", 0x80010000, 1728 * 4, 1680, 1050 }, /* guess */
6579 [M_I20_SR] = { "imac7", 0x40010000, 1728 * 4, 1680, 1050 },
6680 [M_I24] = { "i24", 0x80010000, 2048 * 4, 1920, 1200 }, /* guess */
81+ [M_I24_8_1] = { "imac8", 0xc0060000, 2048 * 4, 1920, 1200 },
82+ [M_I24_10_1] = { "imac10", 0xc0010000, 2048 * 4, 1920, 1080 },
83+ [M_I27_11_1] = { "imac11", 0xc0010000, 2560 * 4, 2560, 1440 },
6784 [M_MINI]= { "mini", 0x80000000, 2048 * 4, 1024, 768 },
85+ [M_MINI_3_1] = { "mini31", 0x40010000, 1024 * 4, 1024, 768 },
86+ [M_MINI_4_1] = { "mini41", 0xc0010000, 2048 * 4, 1920, 1200 },
6887 [M_MB] = { "macbook", 0x80000000, 2048 * 4, 1280, 800 },
88+ [M_MB_5_1] = { "macbook51", 0x80010000, 2048 * 4, 1280, 800 },
89+ [M_MB_6_1] = { "macbook61", 0x80010000, 2048 * 4, 1280, 800 },
90+ [M_MB_7_1] = { "macbook71", 0x80010000, 2048 * 4, 1280, 800 },
6991 [M_MBA] = { "mba", 0x80000000, 2048 * 4, 1280, 800 },
7092 [M_MBP] = { "mbp", 0x80010000, 1472 * 4, 1440, 900 },
7193 [M_MBP_2] = { "mbp2", 0, 0, 0, 0 }, /* placeholder */
94+ [M_MBP_2_2] = { "mbp22", 0x80010000, 1472 * 4, 1440, 900 },
7295 [M_MBP_SR] = { "mbp3", 0x80030000, 2048 * 4, 1440, 900 },
7396 [M_MBP_4] = { "mbp4", 0xc0060000, 2048 * 4, 1920, 1200 },
7497 [M_MBP_5_1] = { "mbp51", 0xc0010000, 2048 * 4, 1440, 900 },
98+ [M_MBP_5_2] = { "mbp52", 0xc0010000, 2048 * 4, 1920, 1200 },
99+ [M_MBP_5_3] = { "mbp53", 0xd0010000, 2048 * 4, 1440, 900 },
100+ [M_MBP_6_1] = { "mbp61", 0x90030000, 2048 * 4, 1920, 1200 },
101+ [M_MBP_6_2] = { "mbp62", 0x90030000, 2048 * 4, 1680, 1050 },
102+ [M_MBP_7_1] = { "mbp71", 0xc0010000, 2048 * 4, 1280, 800 },
75103 [M_UNKNOWN] = { NULL, 0, 0, 0, 0 }
76104 };
77105
@@ -92,7 +120,12 @@ static const struct dmi_system_id dmi_system_table[] __initconst = { · 14 unmodified lines
92120 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac6,1", M_I24),
93121 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac6,1", M_I24),
94122 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac7,1", M_I20_SR),
123+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac8,1", M_I24_8_1),
124+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac10,1", M_I24_10_1),
125+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "iMac11,1", M_I27_11_1),
95126 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "Macmini1,1", M_MINI),
127+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "Macmini3,1", M_MINI_3_1),
128+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "Macmini4,1", M_MINI_4_1),
96129 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook1,1", M_MB),
97130 /* At least one of these two will be right; maybe both? */
98131 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook2,1", M_MB),
@@ -101,14 +134,23 @@ static const struct dmi_system_id dmi_system_table[] __initconst = { · 2 unmodified lines
101134 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBook3,1", M_MB),
102135 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook3,1", M_MB),
103136 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook4,1", M_MB),
137+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook5,1", M_MB_5_1),
138+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook6,1", M_MB_6_1),
139+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBook7,1", M_MB_7_1),
104140 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookAir1,1", M_MBA),
105141 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro1,1", M_MBP),
106142 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,1", M_MBP_2),
143+ EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro2,2", M_MBP_2_2),
107144 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro2,1", M_MBP_2),
108145 EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "MacBookPro3,1", M_MBP_SR),
109146 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro3,1", M_MBP_SR),
110147 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro4,1", M_MBP_4),
111148 EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,1", M_MBP_5_1),
149+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,2", M_MBP_5_2),
150+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro5,3", M_MBP_5_3),
151+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro6,1", M_MBP_6_1),
152+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro6,2", M_MBP_6_2),
153+ EFIFB_DMI_SYSTEM_ID("Apple Inc.", "MacBookPro7,1", M_MBP_7_1),
112154 {},
113155 };
114156
@@ -116,7 +158,7 @@ static int set_system(const struct dmi_system_id *id) · 1 unmodified line
116158 {
117159 struct efifb_dmi_info *info = id->driver_data;
118160 if (info->base == 0)
119− return -ENODEV;
161+ return 0;
120162
121163 printk(KERN_INFO "efifb: dmi detected %s - framebuffer at %p "
122164 "(%dx%d, stride %d)\n", id->ident,
@@ -124,18 +166,55 @@ static int set_system(const struct dmi_system_id *id) · 1 unmodified line
124166 info->stride);
125167
126168 /* Trust the bootloader over the DMI tables */
127− if (screen_info.lfb_base == 0)
169+ if (screen_info.lfb_base == 0) {
170+#if defined(CONFIG_PCI)
171+ struct pci_dev *dev = NULL;
172+ int found_bar = 0;
173+#endif
128174 screen_info.lfb_base = info->base;
129− if (screen_info.lfb_linelength == 0)
130− screen_info.lfb_linelength = info->stride;
131− if (screen_info.lfb_width == 0)
132− screen_info.lfb_width = info->width;
133− if (screen_info.lfb_height == 0)
134− screen_info.lfb_height = info->height;
135− if (screen_info.orig_video_isVGA == 0)
136− screen_info.orig_video_isVGA = VIDEO_TYPE_EFI;
137175
138− return 0;
176+#if defined(CONFIG_PCI)
177+ /* make sure that the address in the table is actually on a
178+ * VGA device's PCI BAR */
179+
180+ for_each_pci_dev(dev) {
181+ int i;
182+ if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
183+ continue;
184+ for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
185+ resource_size_t start, end;
186+
187+ start = pci_resource_start(dev, i);
188+ if (start == 0)
189+ break;
190+ end = pci_resource_end(dev, i);
191+ if (screen_info.lfb_base >= start &&
192+ screen_info.lfb_base < end) {
193+ found_bar = 1;
194+ }
195+ }
196+ }
197+ if (!found_bar)
198+ screen_info.lfb_base = 0;
199+#endif
200+ }
201+ if (screen_info.lfb_base) {
202+ if (screen_info.lfb_linelength == 0)
203+ screen_info.lfb_linelength = info->stride;
204+ if (screen_info.lfb_width == 0)
205+ screen_info.lfb_width = info->width;
206+ if (screen_info.lfb_height == 0)
207+ screen_info.lfb_height = info->height;
208+ if (screen_info.orig_video_isVGA == 0)
209+ screen_info.orig_video_isVGA = VIDEO_TYPE_EFI;
210+ } else {
211+ screen_info.lfb_linelength = 0;
212+ screen_info.lfb_width = 0;
213+ screen_info.lfb_height = 0;
214+ screen_info.orig_video_isVGA = 0;
215+ return 0;
216+ }
217+ return 1;
139218 }
140219
141220 static int efifb_setcolreg(unsigned regno, unsigned red, unsigned green,
drivers/video/pxa168fb.c+2−2
@@ -298,8 +298,8 @@ static void set_dma_control0(struct pxa168fb_info *fbi) · 297 unmodified lines
298298 * Set bit to enable graphics DMA.
299299 */
300300 x = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0);
301− x |= fbi->active ? 0x00000100 : 0;
302− fbi->active = 0;
301+ x &= ~CFG_GRA_ENA_MASK;
302+ x |= fbi->active ? CFG_GRA_ENA(1) : CFG_GRA_ENA(0);
303303
304304 /*
305305 * If we are in a pseudo-color mode, we need to enable
drivers/video/sis/sis_main.c+3−0
@@ -1701,6 +1701,9 @@ static int sisfb_ioctl(struct fb_info *info, unsigned int cmd, · 1700 unmodified lines
17011701 break;
17021702
17031703 case FBIOGET_VBLANK:
1704+
1705+ memset(&sisvbblank, 0, sizeof(struct fb_vblank));
1706+
17041707 sisvbblank.count = 0;
17051708 sisvbblank.flags = sisfb_setupvbblankflags(ivideo, &sisvbblank.vcount, &sisvbblank.hcount);
17061709
drivers/xen/xenbus/xenbus_probe.c+6−3
@@ -755,7 +755,10 @@ int register_xenstore_notifier(struct notifier_block *nb) · 754 unmodified lines
755755 {
756756 int ret = 0;
757757
758− blocking_notifier_chain_register(&xenstore_chain, nb);
758+ if (xenstored_ready > 0)
759+ ret = nb->notifier_call(nb, 0, NULL);
760+ else
761+ blocking_notifier_chain_register(&xenstore_chain, nb);
759762
760763 return ret;
761764 }
@@ -769,7 +772,7 @@ EXPORT_SYMBOL_GPL(unregister_xenstore_notifier); · 7 unmodified lines
769772
770773 void xenbus_probe(struct work_struct *unused)
771774 {
772− BUG_ON((xenstored_ready <= 0));
775+ xenstored_ready = 1;
773776
774777 /* Enumerate devices in xenstore and watch for changes. */
775778 xenbus_probe_devices(&xenbus_frontend);
@@ -835,8 +838,8 @@ static int __init xenbus_init(void) · 59 unmodified lines
835838 xen_store_evtchn = xen_start_info->store_evtchn;
836839 xen_store_mfn = xen_start_info->store_mfn;
837840 xen_store_interface = mfn_to_virt(xen_store_mfn);
841+ xenstored_ready = 1;
838842 }
839− xenstored_ready = 1;
840843 }
841844
842845 /* Initialize the interface to xenstore. */
fs/aio.c+9−1
@@ -712,8 +712,16 @@ static ssize_t aio_run_iocb(struct kiocb *iocb) · 711 unmodified lines
712712 */
713713 ret = retry(iocb);
714714
715− if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED)
715+ if (ret != -EIOCBRETRY && ret != -EIOCBQUEUED) {
716+ /*
717+ * There's no easy way to restart the syscall since other AIO's
718+ * may be already running. Just fail this IO with EINTR.
719+ */
720+ if (unlikely(ret == -ERESTARTSYS || ret == -ERESTARTNOINTR ||
721+ ret == -ERESTARTNOHAND || ret == -ERESTART_RESTARTBLOCK))
722+ ret = -EINTR;
716723 aio_complete(iocb, ret, 0);
724+ }
717725 out:
718726 spin_lock_irq(&ctx->ctx_lock);
719727
fs/cifs/cifssmb.c+33−16
@@ -232,7 +232,7 @@ static int · 231 unmodified lines
232232 small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
233233 void **request_buf)
234234 {
235− int rc = 0;
235+ int rc;
236236
237237 rc = cifs_reconnect_tcon(tcon, smb_command);
238238 if (rc)
@@ -250,7 +250,7 @@ small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, · 11 unmodified lines
250250 if (tcon != NULL)
251251 cifs_stats_inc(&tcon->num_smbs_sent);
252252
253− return rc;
253+ return 0;
254254 }
255255
256256 int
@@ -281,16 +281,9 @@ small_smb_init_no_tc(const int smb_command, const int wct, · 24 unmodified lines
281281
282282 /* If the return code is zero, this function must fill in request_buf pointer */
283283 static int
284−smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
285− void **request_buf /* returned */ ,
286− void **response_buf /* returned */ )
284+__smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
285+ void **request_buf, void **response_buf)
287286 {
288− int rc = 0;
289−
290− rc = cifs_reconnect_tcon(tcon, smb_command);
291− if (rc)
292− return rc;
293−
294287 *request_buf = cifs_buf_get();
295288 if (*request_buf == NULL) {
296289 /* BB should we add a retry in here if not a writepage? */
@@ -309,7 +302,31 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon, · 12 unmodified lines
309302 if (tcon != NULL)
310303 cifs_stats_inc(&tcon->num_smbs_sent);
311304
312− return rc;
305+ return 0;
306+}
307+
308+/* If the return code is zero, this function must fill in request_buf pointer */
309+static int
310+smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
311+ void **request_buf, void **response_buf)
312+{
313+ int rc;
314+
315+ rc = cifs_reconnect_tcon(tcon, smb_command);
316+ if (rc)
317+ return rc;
318+
319+ return __smb_init(smb_command, wct, tcon, request_buf, response_buf);
320+}
321+
322+static int
323+smb_init_no_reconnect(int smb_command, int wct, struct cifsTconInfo *tcon,
324+ void **request_buf, void **response_buf)
325+{
326+ if (tcon->ses->need_reconnect || tcon->need_reconnect)
327+ return -EHOSTDOWN;
328+
329+ return __smb_init(smb_command, wct, tcon, request_buf, response_buf);
313330 }
314331
315332 static int validate_t2(struct smb_t2_rsp *pSMB)
@@ -4534,8 +4551,8 @@ CIFSSMBQFSUnixInfo(const int xid, struct cifsTconInfo *tcon) · 4218 unmodified lines
45344551
45354552 cFYI(1, "In QFSUnixInfo");
45364553 QFSUnixRetry:
4537− rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4538− (void **) &pSMBr);
4554+ rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,
4555+ (void **) &pSMB, (void **) &pSMBr);
45394556 if (rc)
45404557 return rc;
45414558
@@ -4604,8 +4621,8 @@ CIFSSMBSetFSUnixInfo(const int xid, struct cifsTconInfo *tcon, __u64 cap) · 62 unmodified lines
46044621 cFYI(1, "In SETFSUnixInfo");
46054622 SETFSUnixRetry:
46064623 /* BB switch to small buf init to save memory */
4607− rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4608− (void **) &pSMBr);
4624+ rc = smb_init_no_reconnect(SMB_COM_TRANSACTION2, 15, tcon,
4625+ (void **) &pSMB, (void **) &pSMBr);
46094626 if (rc)
46104627 return rc;
46114628
fs/cifs/inode.c+2−0
@@ -801,6 +801,8 @@ retry_iget5_locked: · 800 unmodified lines
801801 inode->i_flags |= S_NOATIME | S_NOCMTIME;
802802 if (inode->i_state & I_NEW) {
803803 inode->i_ino = hash;
804+ if (S_ISREG(inode->i_mode))
805+ inode->i_data.backing_dev_info = sb->s_bdi;
804806 #ifdef CONFIG_CIFS_FSCACHE
805807 /* initialize per-inode cache cookie pointer */
806808 CIFS_I(inode)->fscache = NULL;
fs/compat.c+1−1
@@ -1153,7 +1153,7 @@ static ssize_t compat_do_readv_writev(int type, struct file *file, · 1152 unmodified lines
11531153 {
11541154 compat_ssize_t tot_len;
11551155 struct iovec iovstack[UIO_FASTIOV];
1156− struct iovec *iov;
1156+ struct iovec *iov = iovstack;
11571157 ssize_t ret;
11581158 io_fn_t fn;
11591159 iov_fn_t fnv;
fs/fs-writeback.c+4−15
@@ -72,22 +72,11 @@ int writeback_in_progress(struct backing_dev_info *bdi) · 71 unmodified lines
7272 static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
7373 {
7474 struct super_block *sb = inode->i_sb;
75− struct backing_dev_info *bdi = inode->i_mapping->backing_dev_info;
7675
77− /*
78− * For inodes on standard filesystems, we use superblock's bdi. For
79− * inodes on virtual filesystems, we want to use inode mapping's bdi
80− * because they can possibly point to something useful (think about
81− * block_dev filesystem).
82− */
83− if (sb->s_bdi && sb->s_bdi != &noop_backing_dev_info) {
84− /* Some device inodes could play dirty tricks. Catch them... */
85− WARN(bdi != sb->s_bdi && bdi_cap_writeback_dirty(bdi),
86− "Dirtiable inode bdi %s != sb bdi %s\n",
87− bdi->name, sb->s_bdi->name);
88− return sb->s_bdi;
89− }
90− return bdi;
76+ if (strcmp(sb->s_type->name, "bdev") == 0)
77+ return inode->i_mapping->backing_dev_info;
78+
79+ return sb->s_bdi;
9180 }
9281
9382 static void bdi_queue_work(struct backing_dev_info *bdi,
fs/fuse/dev.c+1−1
@@ -1354,7 +1354,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode, · 1353 unmodified lines
13541354 loff_t file_size;
13551355 unsigned int num;
13561356 unsigned int offset;
1357− size_t total_len;
1357+ size_t total_len = 0;
13581358
13591359 req = fuse_get_req(fc);
13601360 if (IS_ERR(req))
fs/ocfs2/acl.c+3−0
@@ -209,7 +209,10 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, · 208 unmodified lines
209209 }
210210
211211 inode->i_mode = new_mode;
212+ inode->i_ctime = CURRENT_TIME;
212213 di->i_mode = cpu_to_le16(inode->i_mode);
214+ di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
215+ di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec);
213216
214217 ocfs2_journal_dirty(handle, di_bh);
215218
fs/ocfs2/cluster/tcp.c+1−1
@@ -977,7 +977,7 @@ static int o2net_tx_can_proceed(struct o2net_node *nn, · 976 unmodified lines
977977 int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *caller_vec,
978978 size_t caller_veclen, u8 target_node, int *status)
979979 {
980− int ret;
980+ int ret = 0;
981981 struct o2net_msg *msg = NULL;
982982 size_t veclen, caller_bytes = 0;
983983 struct kvec *vec = NULL;
fs/ocfs2/dir.c+16−8
@@ -3931,6 +3931,15 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, · 3930 unmodified lines
39313931 goto out_commit;
39323932 }
39333933
3934+ cpos = split_hash;
3935+ ret = ocfs2_dx_dir_new_cluster(dir, &et, cpos, handle,
3936+ data_ac, meta_ac, new_dx_leaves,
3937+ num_dx_leaves);
3938+ if (ret) {
3939+ mlog_errno(ret);
3940+ goto out_commit;
3941+ }
3942+
39343943 for (i = 0; i < num_dx_leaves; i++) {
39353944 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir),
39363945 orig_dx_leaves[i],
@@ -3939,15 +3948,14 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, · 2 unmodified lines
39393948 mlog_errno(ret);
39403949 goto out_commit;
39413950 }
3942− }
39433951
3944− cpos = split_hash;
3945− ret = ocfs2_dx_dir_new_cluster(dir, &et, cpos, handle,
3946− data_ac, meta_ac, new_dx_leaves,
3947− num_dx_leaves);
3948− if (ret) {
3949− mlog_errno(ret);
3950− goto out_commit;
3952+ ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir),
3953+ new_dx_leaves[i],
3954+ OCFS2_JOURNAL_ACCESS_WRITE);
3955+ if (ret) {
3956+ mlog_errno(ret);
3957+ goto out_commit;
3958+ }
39513959 }
39523960
39533961 ocfs2_dx_dir_transfer_leaf(dir, split_hash, handle, tmp_dx_leaf,
fs/ocfs2/dlm/dlmcommon.h+1−0
@@ -1030,6 +1030,7 @@ int dlm_drop_lockres_ref(struct dlm_ctxt *dlm, · 1029 unmodified lines
10301030 struct dlm_lock_resource *res);
10311031 void dlm_clean_master_list(struct dlm_ctxt *dlm,
10321032 u8 dead_node);
1033+void dlm_force_free_mles(struct dlm_ctxt *dlm);
10331034 int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock);
10341035 int __dlm_lockres_has_locks(struct dlm_lock_resource *res);
10351036 int __dlm_lockres_unused(struct dlm_lock_resource *res);
fs/ocfs2/dlm/dlmdebug.c+8−1
@@ -636,8 +636,14 @@ static void *lockres_seq_start(struct seq_file *m, loff_t *pos) · 635 unmodified lines
636636 spin_lock(&dlm->track_lock);
637637 if (oldres)
638638 track_list = &oldres->tracking;
639− else
639+ else {
640640 track_list = &dlm->tracking_list;
641+ if (list_empty(track_list)) {
642+ dl = NULL;
643+ spin_unlock(&dlm->track_lock);
644+ goto bail;
645+ }
646+ }
641647
642648 list_for_each_entry(res, track_list, tracking) {
643649 if (&res->tracking == &dlm->tracking_list)
@@ -660,6 +666,7 @@ static void *lockres_seq_start(struct seq_file *m, loff_t *pos) · 16 unmodified lines
660666 } else
661667 dl = NULL;
662668
669+bail:
663670 /* passed to seq_show */
664671 return dl;
665672 }
fs/ocfs2/dlm/dlmdomain.c+1−0
@@ -693,6 +693,7 @@ void dlm_unregister_domain(struct dlm_ctxt *dlm) · 692 unmodified lines
693693
694694 dlm_mark_domain_leaving(dlm);
695695 dlm_leave_domain(dlm);
696+ dlm_force_free_mles(dlm);
696697 dlm_complete_dlm_shutdown(dlm);
697698 }
698699 dlm_put(dlm);
fs/ocfs2/dlm/dlmmaster.c+40−0
@@ -3433,3 +3433,43 @@ void dlm_lockres_release_ast(struct dlm_ctxt *dlm, · 3432 unmodified lines
34333433 wake_up(&res->wq);
34343434 wake_up(&dlm->migration_wq);
34353435 }
3436+
3437+void dlm_force_free_mles(struct dlm_ctxt *dlm)
3438+{
3439+ int i;
3440+ struct hlist_head *bucket;
3441+ struct dlm_master_list_entry *mle;
3442+ struct hlist_node *tmp, *list;
3443+
3444+ /*
3445+ * We notified all other nodes that we are exiting the domain and
3446+ * marked the dlm state to DLM_CTXT_LEAVING. If any mles are still
3447+ * around we force free them and wake any processes that are waiting
3448+ * on the mles
3449+ */
3450+ spin_lock(&dlm->spinlock);
3451+ spin_lock(&dlm->master_lock);
3452+
3453+ BUG_ON(dlm->dlm_state != DLM_CTXT_LEAVING);
3454+ BUG_ON((find_next_bit(dlm->domain_map, O2NM_MAX_NODES, 0) < O2NM_MAX_NODES));
3455+
3456+ for (i = 0; i < DLM_HASH_BUCKETS; i++) {
3457+ bucket = dlm_master_hash(dlm, i);
3458+ hlist_for_each_safe(list, tmp, bucket) {
3459+ mle = hlist_entry(list, struct dlm_master_list_entry,
3460+ master_hash_node);
3461+ if (mle->type != DLM_MLE_BLOCK) {
3462+ mlog(ML_ERROR, "bad mle: %p\n", mle);
3463+ dlm_print_one_mle(mle);
3464+ }
3465+ atomic_set(&mle->woken, 1);
3466+ wake_up(&mle->wq);
3467+
3468+ __dlm_unlink_mle(dlm, mle);
3469+ __dlm_mle_detach_hb_events(dlm, mle);
3470+ __dlm_put_mle(mle);
3471+ }
3472+ }
3473+ spin_unlock(&dlm->master_lock);
3474+ spin_unlock(&dlm->spinlock);
3475+}
fs/ocfs2/dlmglue.h+1−0
@@ -84,6 +84,7 @@ enum { · 83 unmodified lines
8484 OI_LS_PARENT,
8585 OI_LS_RENAME1,
8686 OI_LS_RENAME2,
87+ OI_LS_REFLINK_TARGET,
8788 };
8889
8990 int ocfs2_dlm_init(struct ocfs2_super *osb);
fs/ocfs2/ocfs2_fs.h+25−12
@@ -235,18 +235,31 @@ · 234 unmodified lines
235235 #define OCFS2_HAS_REFCOUNT_FL (0x0010)
236236
237237 /* Inode attributes, keep in sync with EXT2 */
238−#define OCFS2_SECRM_FL (0x00000001) /* Secure deletion */
239−#define OCFS2_UNRM_FL (0x00000002) /* Undelete */
240−#define OCFS2_COMPR_FL (0x00000004) /* Compress file */
241−#define OCFS2_SYNC_FL (0x00000008) /* Synchronous updates */
242−#define OCFS2_IMMUTABLE_FL (0x00000010) /* Immutable file */
243−#define OCFS2_APPEND_FL (0x00000020) /* writes to file may only append */
244−#define OCFS2_NODUMP_FL (0x00000040) /* do not dump file */
245−#define OCFS2_NOATIME_FL (0x00000080) /* do not update atime */
246−#define OCFS2_DIRSYNC_FL (0x00010000) /* dirsync behaviour (directories only) */
247−
248−#define OCFS2_FL_VISIBLE (0x000100FF) /* User visible flags */
249−#define OCFS2_FL_MODIFIABLE (0x000100FF) /* User modifiable flags */
238+#define OCFS2_SECRM_FL FS_SECRM_FL /* Secure deletion */
239+#define OCFS2_UNRM_FL FS_UNRM_FL /* Undelete */
240+#define OCFS2_COMPR_FL FS_COMPR_FL /* Compress file */
241+#define OCFS2_SYNC_FL FS_SYNC_FL /* Synchronous updates */
242+#define OCFS2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */
243+#define OCFS2_APPEND_FL FS_APPEND_FL /* writes to file may only append */
244+#define OCFS2_NODUMP_FL FS_NODUMP_FL /* do not dump file */
245+#define OCFS2_NOATIME_FL FS_NOATIME_FL /* do not update atime */
246+/* Reserved for compression usage... */
247+#define OCFS2_DIRTY_FL FS_DIRTY_FL
248+#define OCFS2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */
249+#define OCFS2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */
250+#define OCFS2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */
251+/* End compression flags --- maybe not all used */
252+#define OCFS2_BTREE_FL FS_BTREE_FL /* btree format dir */
253+#define OCFS2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */
254+#define OCFS2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */
255+#define OCFS2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */
256+#define OCFS2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */
257+#define OCFS2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */
258+#define OCFS2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/
259+#define OCFS2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */
260+
261+#define OCFS2_FL_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */
262+#define OCFS2_FL_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */
250263
251264 /*
252265 * Extent record flags (e_node.leaf.flags)
fs/ocfs2/ocfs2_ioctl.h+4−4
@@ -23,10 +23,10 @@ · 22 unmodified lines
2323 /*
2424 * ioctl commands
2525 */
26−#define OCFS2_IOC_GETFLAGS _IOR('f', 1, long)
27−#define OCFS2_IOC_SETFLAGS _IOW('f', 2, long)
28−#define OCFS2_IOC32_GETFLAGS _IOR('f', 1, int)
29−#define OCFS2_IOC32_SETFLAGS _IOW('f', 2, int)
26+#define OCFS2_IOC_GETFLAGS FS_IOC_GETFLAGS
27+#define OCFS2_IOC_SETFLAGS FS_IOC_SETFLAGS
28+#define OCFS2_IOC32_GETFLAGS FS_IOC32_GETFLAGS
29+#define OCFS2_IOC32_SETFLAGS FS_IOC32_SETFLAGS
3030
3131 /*
3232 * Space reservation / allocation / free ioctls and argument structure
fs/ocfs2/refcounttree.c+3−2
@@ -4201,8 +4201,9 @@ static int __ocfs2_reflink(struct dentry *old_dentry, · 4200 unmodified lines
42014201 goto out;
42024202 }
42034203
4204− mutex_lock(&new_inode->i_mutex);
4205− ret = ocfs2_inode_lock(new_inode, &new_bh, 1);
4204+ mutex_lock_nested(&new_inode->i_mutex, I_MUTEX_CHILD);
4205+ ret = ocfs2_inode_lock_nested(new_inode, &new_bh, 1,
4206+ OI_LS_REFLINK_TARGET);
42064207 if (ret) {
42074208 mlog_errno(ret);
42084209 goto out_unlock;
fs/ocfs2/reservations.c+10−12
@@ -732,25 +732,23 @@ int ocfs2_resmap_resv_bits(struct ocfs2_reservation_map *resmap, · 731 unmodified lines
732732 struct ocfs2_alloc_reservation *resv,
733733 int *cstart, int *clen)
734734 {
735− unsigned int wanted = *clen;
736−
737735 if (resv == NULL || ocfs2_resmap_disabled(resmap))
738736 return -ENOSPC;
739737
740738 spin_lock(&resv_lock);
741739
742− /*
743− * We don't want to over-allocate for temporary
744− * windows. Otherwise, we run the risk of fragmenting the
745− * allocation space.
746− */
747− wanted = ocfs2_resv_window_bits(resmap, resv);
748− if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen)
749− wanted = *clen;
750−
751740 if (ocfs2_resv_empty(resv)) {
752− mlog(0, "empty reservation, find new window\n");
741+ /*
742+ * We don't want to over-allocate for temporary
743+ * windows. Otherwise, we run the risk of fragmenting the
744+ * allocation space.
745+ */
746+ unsigned int wanted = ocfs2_resv_window_bits(resmap, resv);
753747
748+ if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen)
749+ wanted = *clen;
750+
751+ mlog(0, "empty reservation, find new window\n");
754752 /*
755753 * Try to get a window here. If it works, we must fall
756754 * through and test the bitmap . This avoids some
fs/ocfs2/suballoc.c+2−2
@@ -357,7 +357,7 @@ out: · 356 unmodified lines
357357 static void ocfs2_bg_discontig_add_extent(struct ocfs2_super *osb,
358358 struct ocfs2_group_desc *bg,
359359 struct ocfs2_chain_list *cl,
360− u64 p_blkno, u32 clusters)
360+ u64 p_blkno, unsigned int clusters)
361361 {
362362 struct ocfs2_extent_list *el = &bg->bg_list;
363363 struct ocfs2_extent_rec *rec;
@@ -369,7 +369,7 @@ static void ocfs2_bg_discontig_add_extent(struct ocfs2_super *osb, · 5 unmodified lines
369369 rec->e_blkno = cpu_to_le64(p_blkno);
370370 rec->e_cpos = cpu_to_le32(le16_to_cpu(bg->bg_bits) /
371371 le16_to_cpu(cl->cl_bpc));
372− rec->e_leaf_clusters = cpu_to_le32(clusters);
372+ rec->e_leaf_clusters = cpu_to_le16(clusters);
373373 le16_add_cpu(&bg->bg_bits, clusters * le16_to_cpu(cl->cl_bpc));
374374 le16_add_cpu(&bg->bg_free_bits_count,
375375 clusters * le16_to_cpu(cl->cl_bpc));
fs/ocfs2/symlink.c+1−1
@@ -128,7 +128,7 @@ static void *ocfs2_fast_follow_link(struct dentry *dentry, · 127 unmodified lines
128128 }
129129
130130 /* Fast symlinks can't be large */
131− len = strlen(target);
131+ len = strnlen(target, ocfs2_fast_symlink_chars(inode->i_sb));
132132 link = kzalloc(len + 1, GFP_NOFS);
133133 if (!link) {
134134 status = -ENOMEM;
fs/ocfs2/xattr.c+2−2
@@ -1286,13 +1286,11 @@ int ocfs2_xattr_get_nolock(struct inode *inode, · 1285 unmodified lines
12861286 xis.inode_bh = xbs.inode_bh = di_bh;
12871287 di = (struct ocfs2_dinode *)di_bh->b_data;
12881288
1289− down_read(&oi->ip_xattr_sem);
12901289 ret = ocfs2_xattr_ibody_get(inode, name_index, name, buffer,
12911290 buffer_size, &xis);
12921291 if (ret == -ENODATA && di->i_xattr_loc)
12931292 ret = ocfs2_xattr_block_get(inode, name_index, name, buffer,
12941293 buffer_size, &xbs);
1295− up_read(&oi->ip_xattr_sem);
12961294
12971295 return ret;
12981296 }
@@ -1316,8 +1314,10 @@ static int ocfs2_xattr_get(struct inode *inode, · 17 unmodified lines
13161314 mlog_errno(ret);
13171315 return ret;
13181316 }
1317+ down_read(&OCFS2_I(inode)->ip_xattr_sem);
13191318 ret = ocfs2_xattr_get_nolock(inode, di_bh, name_index,
13201319 name, buffer, buffer_size);
1320+ up_read(&OCFS2_I(inode)->ip_xattr_sem);
13211321
13221322 ocfs2_inode_unlock(inode, 0);
13231323
fs/proc/base.c+2−2
@@ -2675,7 +2675,7 @@ static const struct pid_entry tgid_base_stuff[] = { · 2674 unmodified lines
26752675 INF("auxv", S_IRUSR, proc_pid_auxv),
26762676 ONE("status", S_IRUGO, proc_pid_status),
26772677 ONE("personality", S_IRUSR, proc_pid_personality),
2678− INF("limits", S_IRUSR, proc_pid_limits),
2678+ INF("limits", S_IRUGO, proc_pid_limits),
26792679 #ifdef CONFIG_SCHED_DEBUG
26802680 REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations),
26812681 #endif
@@ -3011,7 +3011,7 @@ static const struct pid_entry tid_base_stuff[] = { · 329 unmodified lines
30113011 INF("auxv", S_IRUSR, proc_pid_auxv),
30123012 ONE("status", S_IRUGO, proc_pid_status),
30133013 ONE("personality", S_IRUSR, proc_pid_personality),
3014− INF("limits", S_IRUSR, proc_pid_limits),
3014+ INF("limits", S_IRUGO, proc_pid_limits),
30153015 #ifdef CONFIG_SCHED_DEBUG
30163016 REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations),
30173017 #endif
fs/proc/task_mmu.c+2−2
@@ -363,13 +363,13 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, · 362 unmodified lines
363363 mss->referenced += PAGE_SIZE;
364364 mapcount = page_mapcount(page);
365365 if (mapcount >= 2) {
366− if (pte_dirty(ptent))
366+ if (pte_dirty(ptent) || PageDirty(page))
367367 mss->shared_dirty += PAGE_SIZE;
368368 else
369369 mss->shared_clean += PAGE_SIZE;
370370 mss->pss += (PAGE_SIZE << PSS_SHIFT) / mapcount;
371371 } else {
372− if (pte_dirty(ptent))
372+ if (pte_dirty(ptent) || PageDirty(page))
373373 mss->private_dirty += PAGE_SIZE;
374374 else
375375 mss->private_clean += PAGE_SIZE;
fs/proc/vmcore.c+1−1
@@ -163,7 +163,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer, · 162 unmodified lines
163163
164164 static const struct file_operations proc_vmcore_operations = {
165165 .read = read_vmcore,
166− .llseek = generic_file_llseek,
166+ .llseek = default_llseek,
167167 };
168168
169169 static struct vmcore* __init get_new_element(void)
fs/reiserfs/ioctl.c+4−3
@@ -170,6 +170,7 @@ int reiserfs_prepare_write(struct file *f, struct page *page, · 169 unmodified lines
170170 int reiserfs_unpack(struct inode *inode, struct file *filp)
171171 {
172172 int retval = 0;
173+ int depth;
173174 int index;
174175 struct page *page;
175176 struct address_space *mapping;
@@ -188,8 +189,8 @@ int reiserfs_unpack(struct inode *inode, struct file *filp) · 12 unmodified lines
188189 /* we need to make sure nobody is changing the file size beneath
189190 ** us
190191 */
191− mutex_lock(&inode->i_mutex);
192− reiserfs_write_lock(inode->i_sb);
192+ reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb);
193+ depth = reiserfs_write_lock_once(inode->i_sb);
193194
194195 write_from = inode->i_size & (blocksize - 1);
195196 /* if we are on a block boundary, we are already unpacked. */
@@ -224,6 +225,6 @@ int reiserfs_unpack(struct inode *inode, struct file *filp) · 28 unmodified lines
224225
225226 out:
226227 mutex_unlock(&inode->i_mutex);
227− reiserfs_write_unlock(inode->i_sb);
228+ reiserfs_write_unlock_once(inode->i_sb, depth);
228229 return retval;
229230 }
fs/xfs/xfs_log_cil.c+9−3
@@ -405,9 +405,15 @@ xlog_cil_push( · 404 unmodified lines
405405 new_ctx = kmem_zalloc(sizeof(*new_ctx), KM_SLEEP|KM_NOFS);
406406 new_ctx->ticket = xlog_cil_ticket_alloc(log);
407407
408− /* lock out transaction commit, but don't block on background push */
408+ /*
409+ * Lock out transaction commit, but don't block for background pushes
410+ * unless we are well over the CIL space limit. See the definition of
411+ * XLOG_CIL_HARD_SPACE_LIMIT() for the full explanation of the logic
412+ * used here.
413+ */
409414 if (!down_write_trylock(&cil->xc_ctx_lock)) {
410− if (!push_seq)
415+ if (!push_seq &&
416+ cil->xc_ctx->space_used < XLOG_CIL_HARD_SPACE_LIMIT(log))
411417 goto out_free_ticket;
412418 down_write(&cil->xc_ctx_lock);
413419 }
@@ -422,7 +428,7 @@ xlog_cil_push( · 8 unmodified lines
422428 goto out_skip;
423429
424430 /* check for a previously pushed seqeunce */
425− if (push_seq < cil->xc_ctx->sequence)
431+ if (push_seq && push_seq < cil->xc_ctx->sequence)
426432 goto out_skip;
427433
428434 /*
fs/xfs/xfs_log_priv.h+21−16
@@ -426,13 +426,13 @@ struct xfs_cil { · 425 unmodified lines
426426 };
427427
428428 /*
429− * The amount of log space we should the CIL to aggregate is difficult to size.
430− * Whatever we chose we have to make we can get a reservation for the log space
431− * effectively, that it is large enough to capture sufficient relogging to
432− * reduce log buffer IO significantly, but it is not too large for the log or
433− * induces too much latency when writing out through the iclogs. We track both
434− * space consumed and the number of vectors in the checkpoint context, so we
435− * need to decide which to use for limiting.
429+ * The amount of log space we allow the CIL to aggregate is difficult to size.
430+ * Whatever we choose, we have to make sure we can get a reservation for the
431+ * log space effectively, that it is large enough to capture sufficient
432+ * relogging to reduce log buffer IO significantly, but it is not too large for
433+ * the log or induces too much latency when writing out through the iclogs. We
434+ * track both space consumed and the number of vectors in the checkpoint
435+ * context, so we need to decide which to use for limiting.
436436 *
437437 * Every log buffer we write out during a push needs a header reserved, which
438438 * is at least one sector and more for v2 logs. Hence we need a reservation of
@@ -459,16 +459,21 @@ struct xfs_cil { · 20 unmodified lines
459459 * checkpoint transaction ticket is specific to the checkpoint context, rather
460460 * than the CIL itself.
461461 *
462− * With dynamic reservations, we can basically make up arbitrary limits for the
463− * checkpoint size so long as they don't violate any other size rules. Hence
464− * the initial maximum size for the checkpoint transaction will be set to a
465− * quarter of the log or 8MB, which ever is smaller. 8MB is an arbitrary limit
466− * right now based on the latency of writing out a large amount of data through
467− * the circular iclog buffers.
462+ * With dynamic reservations, we can effectively make up arbitrary limits for
463+ * the checkpoint size so long as they don't violate any other size rules.
464+ * Recovery imposes a rule that no transaction exceed half the log, so we are
465+ * limited by that. Furthermore, the log transaction reservation subsystem
466+ * tries to keep 25% of the log free, so we need to keep below that limit or we
467+ * risk running out of free log space to start any new transactions.
468+ *
469+ * In order to keep background CIL push efficient, we will set a lower
470+ * threshold at which background pushing is attempted without blocking current
471+ * transaction commits. A separate, higher bound defines when CIL pushes are
472+ * enforced to ensure we stay within our maximum checkpoint size bounds.
473+ * threshold, yet give us plenty of space for aggregation on large logs.
468474 */
469−
470−#define XLOG_CIL_SPACE_LIMIT(log) \
471− (min((log->l_logsize >> 2), (8 * 1024 * 1024)))
475+#define XLOG_CIL_SPACE_LIMIT(log) (log->l_logsize >> 3)
476+#define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4))
472477
473478 /*
474479 * The reservation head lsn is not made up of a cycle number and block number.
include/acpi/acpixf.h+1−1
@@ -55,7 +55,7 @@ · 54 unmodified lines
5555 extern u8 acpi_gbl_permanent_mmap;
5656
5757 /*
58− * Globals that are publically available, allowing for
58+ * Globals that are publicly available, allowing for
5959 * run time configuration
6060 */
6161 extern u32 acpi_dbg_level;
include/drm/drmP.h+20−9
@@ -612,7 +612,7 @@ struct drm_gem_object { · 611 unmodified lines
612612 struct kref refcount;
613613
614614 /** Handle count of this object. Each handle also holds a reference */
615− struct kref handlecount;
615+ atomic_t handle_count; /* number of handles on this object */
616616
617617 /** Related drm device */
618618 struct drm_device *dev;
@@ -808,7 +808,6 @@ struct drm_driver { · 189 unmodified lines
808808 */
809809 int (*gem_init_object) (struct drm_gem_object *obj);
810810 void (*gem_free_object) (struct drm_gem_object *obj);
811− void (*gem_free_object_unlocked) (struct drm_gem_object *obj);
812811
813812 /* vga arb irq handler */
814813 void (*vgaarb_irq)(struct drm_device *dev, bool state);
@@ -1175,6 +1174,7 @@ extern int drm_release(struct inode *inode, struct file *filp); · 360 unmodified lines
11751174 extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
11761175 extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma);
11771176 extern void drm_vm_open_locked(struct vm_area_struct *vma);
1177+extern void drm_vm_close_locked(struct vm_area_struct *vma);
11781178 extern resource_size_t drm_core_get_map_ofs(struct drm_local_map * map);
11791179 extern resource_size_t drm_core_get_reg_ofs(struct drm_device *dev);
11801180 extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
@@ -1455,12 +1455,11 @@ int drm_gem_init(struct drm_device *dev); · 274 unmodified lines
14551455 void drm_gem_destroy(struct drm_device *dev);
14561456 void drm_gem_object_release(struct drm_gem_object *obj);
14571457 void drm_gem_object_free(struct kref *kref);
1458−void drm_gem_object_free_unlocked(struct kref *kref);
14591458 struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
14601459 size_t size);
14611460 int drm_gem_object_init(struct drm_device *dev,
14621461 struct drm_gem_object *obj, size_t size);
1463−void drm_gem_object_handle_free(struct kref *kref);
1462+void drm_gem_object_handle_free(struct drm_gem_object *obj);
14641463 void drm_gem_vm_open(struct vm_area_struct *vma);
14651464 void drm_gem_vm_close(struct vm_area_struct *vma);
14661465 int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
@@ -1483,8 +1482,12 @@ drm_gem_object_unreference(struct drm_gem_object *obj) · 16 unmodified lines
14831482 static inline void
14841483 drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
14851484 {
1486− if (obj != NULL)
1487− kref_put(&obj->refcount, drm_gem_object_free_unlocked);
1485+ if (obj != NULL) {
1486+ struct drm_device *dev = obj->dev;
1487+ mutex_lock(&dev->struct_mutex);
1488+ kref_put(&obj->refcount, drm_gem_object_free);
1489+ mutex_unlock(&dev->struct_mutex);
1490+ }
14881491 }
14891492
14901493 int drm_gem_handle_create(struct drm_file *file_priv,
@@ -1495,7 +1498,7 @@ static inline void · 4 unmodified lines
14951498 drm_gem_object_handle_reference(struct drm_gem_object *obj)
14961499 {
14971500 drm_gem_object_reference(obj);
1498− kref_get(&obj->handlecount);
1501+ atomic_inc(&obj->handle_count);
14991502 }
15001503
15011504 static inline void
@@ -1504,12 +1507,15 @@ drm_gem_object_handle_unreference(struct drm_gem_object *obj) · 2 unmodified lines
15041507 if (obj == NULL)
15051508 return;
15061509
1510+ if (atomic_read(&obj->handle_count) == 0)
1511+ return;
15071512 /*
15081513 * Must bump handle count first as this may be the last
15091514 * ref, in which case the object would disappear before we
15101515 * checked for a name
15111516 */
1512− kref_put(&obj->handlecount, drm_gem_object_handle_free);
1517+ if (atomic_dec_and_test(&obj->handle_count))
1518+ drm_gem_object_handle_free(obj);
15131519 drm_gem_object_unreference(obj);
15141520 }
15151521
@@ -1519,12 +1525,17 @@ drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj) · 3 unmodified lines
15191525 if (obj == NULL)
15201526 return;
15211527
1528+ if (atomic_read(&obj->handle_count) == 0)
1529+ return;
1530+
15221531 /*
15231532 * Must bump handle count first as this may be the last
15241533 * ref, in which case the object would disappear before we
15251534 * checked for a name
15261535 */
1527− kref_put(&obj->handlecount, drm_gem_object_handle_free);
1536+
1537+ if (atomic_dec_and_test(&obj->handle_count))
1538+ drm_gem_object_handle_free(obj);
15281539 drm_gem_object_unreference_unlocked(obj);
15291540 }
15301541
include/drm/drm_pciids.h+1−1
@@ -85,7 +85,6 @@ · 84 unmodified lines
8585 {0x1002, 0x5460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
8686 {0x1002, 0x5462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
8787 {0x1002, 0x5464, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
88− {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
8988 {0x1002, 0x5548, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
9089 {0x1002, 0x5549, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
9190 {0x1002, 0x554A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R423|RADEON_NEW_MEMMAP}, \
@@ -103,6 +102,7 @@ · 11 unmodified lines
103102 {0x1002, 0x564F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
104103 {0x1002, 0x5652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
105104 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
105+ {0x1002, 0x5657, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
106106 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \
107107 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \
108108 {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS480|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
include/linux/cpuidle.h+1−0
@@ -53,6 +53,7 @@ struct cpuidle_state { · 52 unmodified lines
5353 #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */
5454 #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */
5555 #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */
56+#define CPUIDLE_FLAG_TLB_FLUSHED (0x200) /* tlb will be flushed */
5657
5758 #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
5859
include/linux/dma-mapping.h+4−0
@@ -102,6 +102,9 @@ static inline u64 dma_get_mask(struct device *dev) · 101 unmodified lines
102102 return DMA_BIT_MASK(32);
103103 }
104104
105+#ifdef ARCH_HAS_DMA_SET_COHERENT_MASK
106+int dma_set_coherent_mask(struct device *dev, u64 mask);
107+#else
105108 static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
106109 {
107110 if (!dma_supported(dev, mask))
@@ -109,6 +112,7 @@ static inline int dma_set_coherent_mask(struct device *dev, u64 mask) · 1 unmodified line
109112 dev->coherent_dma_mask = mask;
110113 return 0;
111114 }
115+#endif
112116
113117 extern u64 dma_get_required_mask(struct device *dev);
114118
include/linux/dmaengine.h+1−1
@@ -548,7 +548,7 @@ static inline bool dma_dev_has_pq_continue(struct dma_device *dma) · 547 unmodified lines
548548 return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE;
549549 }
550550
551−static unsigned short dma_dev_to_maxpq(struct dma_device *dma)
551+static inline unsigned short dma_dev_to_maxpq(struct dma_device *dma)
552552 {
553553 return dma->max_pq & ~DMA_HAS_PQ_CONTINUE;
554554 }
include/linux/module.h+2−3
@@ -689,17 +689,16 @@ extern int module_sysfs_initialized; · 688 unmodified lines
689689
690690
691691 #ifdef CONFIG_GENERIC_BUG
692−int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
692+void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
693693 struct module *);
694694 void module_bug_cleanup(struct module *);
695695
696696 #else /* !CONFIG_GENERIC_BUG */
697697
698−static inline int module_bug_finalize(const Elf_Ehdr *hdr,
698+static inline void module_bug_finalize(const Elf_Ehdr *hdr,
699699 const Elf_Shdr *sechdrs,
700700 struct module *mod)
701701 {
702− return 0;
703702 }
704703 static inline void module_bug_cleanup(struct module *mod) {}
705704 #endif /* CONFIG_GENERIC_BUG */
include/linux/netlink.h+2−2
@@ -27,8 +27,6 @@ · 26 unmodified lines
2727
2828 #define MAX_LINKS 32
2929
30−struct net;
31−
3230 struct sockaddr_nl {
3331 sa_family_t nl_family; /* AF_NETLINK */
3432 unsigned short nl_pad; /* zero */
@@ -151,6 +149,8 @@ struct nlattr { · 116 unmodified lines
151149 #include <linux/capability.h>
152150 #include <linux/skbuff.h>
153151
152+struct net;
153+
154154 static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
155155 {
156156 return (struct nlmsghdr *)skb->data;
include/linux/pci_ids.h+3−0
@@ -393,6 +393,9 @@ · 392 unmodified lines
393393 #define PCI_DEVICE_ID_VLSI_82C147 0x0105
394394 #define PCI_DEVICE_ID_VLSI_VAS96011 0x0702
395395
396+/* AMD RD890 Chipset */
397+#define PCI_DEVICE_ID_RD890_IOMMU 0x5a23
398+
396399 #define PCI_VENDOR_ID_ADL 0x1005
397400 #define PCI_DEVICE_ID_ADL_2301 0x2301
398401
include/linux/rcupdate.h+1−1
@@ -454,7 +454,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) · 453 unmodified lines
454454 * Makes rcu_dereference_check() do the dirty work.
455455 */
456456 #define rcu_dereference_bh(p) \
457− rcu_dereference_check(p, rcu_read_lock_bh_held())
457+ rcu_dereference_check(p, rcu_read_lock_bh_held() || irqs_disabled())
458458
459459 /**
460460 * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched
include/linux/socket.h+1−1
@@ -322,7 +322,7 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, · 321 unmodified lines
322322 int offset,
323323 unsigned int len, __wsum *csump);
324324
325−extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);
325+extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode);
326326 extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
327327 extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
328328 int offset, int len);
include/linux/wait.h+1−0
@@ -614,6 +614,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); · 613 unmodified lines
614614 (wait)->private = current; \
615615 (wait)->func = autoremove_wake_function; \
616616 INIT_LIST_HEAD(&(wait)->task_list); \
617+ (wait)->flags = 0; \
617618 } while (0)
618619
619620 /**
include/net/addrconf.h+1−0
@@ -121,6 +121,7 @@ static inline int addrconf_finite_timeout(unsigned long timeout) · 120 unmodified lines
121121 * IPv6 Address Label subsystem (addrlabel.c)
122122 */
123123 extern int ipv6_addr_label_init(void);
124+extern void ipv6_addr_label_cleanup(void);
124125 extern void ipv6_addr_label_rtnl_register(void);
125126 extern u32 ipv6_addr_label(struct net *net,
126127 const struct in6_addr *addr,
include/net/dst.h+1−0
@@ -242,6 +242,7 @@ static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) · 241 unmodified lines
242242 dev->stats.rx_packets++;
243243 dev->stats.rx_bytes += skb->len;
244244 skb->rxhash = 0;
245+ skb_set_queue_mapping(skb, 0);
245246 skb_dst_drop(skb);
246247 nf_reset(skb);
247248 }
include/net/route.h+2−0
@@ -199,6 +199,8 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol, · 198 unmodified lines
199199 fl.fl_ip_sport = sport;
200200 fl.fl_ip_dport = dport;
201201 fl.proto = protocol;
202+ if (inet_sk(sk)->transparent)
203+ fl.flags |= FLOWI_FLAG_ANYSRC;
202204 ip_rt_put(*rp);
203205 *rp = NULL;
204206 security_sk_classify_flow(sk, &fl);
include/net/xfrm.h+2−2
@@ -298,8 +298,8 @@ struct xfrm_state_afinfo { · 297 unmodified lines
298298 const struct xfrm_type *type_map[IPPROTO_MAX];
299299 struct xfrm_mode *mode_map[XFRM_MODE_MAX];
300300 int (*init_flags)(struct xfrm_state *x);
301− void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl,
302− struct xfrm_tmpl *tmpl,
301+ void (*init_tempsel)(struct xfrm_selector *sel, struct flowi *fl);
302+ void (*init_temprop)(struct xfrm_state *x, struct xfrm_tmpl *tmpl,
303303 xfrm_address_t *daddr, xfrm_address_t *saddr);
304304 int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n);
305305 int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n);
ipc/sem.c+2−0
@@ -743,6 +743,8 @@ static unsigned long copy_semid_to_user(void __user *buf, struct semid64_ds *in, · 742 unmodified lines
743743 {
744744 struct semid_ds out;
745745
746+ memset(&out, 0, sizeof(out));
747+
746748 ipc64_perm_to_ipc_perm(&in->sem_perm, &out.sem_perm);
747749
748750 out.sem_otime = in->sem_otime;
kernel/fork.c+1−1
@@ -356,10 +356,10 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) · 355 unmodified lines
356356 if (IS_ERR(pol))
357357 goto fail_nomem_policy;
358358 vma_set_policy(tmp, pol);
359+ tmp->vm_mm = mm;
359360 if (anon_vma_fork(tmp, mpnt))
360361 goto fail_nomem_anon_vma_fork;
361362 tmp->vm_flags &= ~VM_LOCKED;
362− tmp->vm_mm = mm;
363363 tmp->vm_next = tmp->vm_prev = NULL;
364364 file = tmp->vm_file;
365365 if (file) {
kernel/kfifo.c+0−2
@@ -365,8 +365,6 @@ static unsigned int setup_sgl(struct __kfifo *fifo, struct scatterlist *sgl, · 364 unmodified lines
365365 n = setup_sgl_buf(sgl, fifo->data + off, nents, l);
366366 n += setup_sgl_buf(sgl + n, fifo->data, nents - n, len - l);
367367
368− if (n)
369− sg_mark_end(sgl + n - 1);
370368 return n;
371369 }
372370
kernel/module.c+4−0
@@ -1538,6 +1538,7 @@ static int __unlink_module(void *_mod) · 1537 unmodified lines
15381538 {
15391539 struct module *mod = _mod;
15401540 list_del(&mod->list);
1541+ module_bug_cleanup(mod);
15411542 return 0;
15421543 }
15431544
@@ -2631,6 +2632,7 @@ static struct module *load_module(void __user *umod, · 1087 unmodified lines
26312632 if (err < 0)
26322633 goto ddebug;
26332634
2635+ module_bug_finalize(info.hdr, info.sechdrs, mod);
26342636 list_add_rcu(&mod->list, &modules);
26352637 mutex_unlock(&module_mutex);
26362638
@@ -2656,6 +2658,8 @@ static struct module *load_module(void __user *umod, · 19 unmodified lines
26562658 mutex_lock(&module_mutex);
26572659 /* Unlink carefully: kallsyms could be walking list. */
26582660 list_del_rcu(&mod->list);
2661+ module_bug_cleanup(mod);
2662+
26592663 ddebug:
26602664 if (!mod->taints)
26612665 dynamic_debug_remove(info.debug);
kernel/smp.c+14−3
@@ -365,9 +365,10 @@ call: · 364 unmodified lines
365365 EXPORT_SYMBOL_GPL(smp_call_function_any);
366366
367367 /**
368− * __smp_call_function_single(): Run a function on another CPU
368+ * __smp_call_function_single(): Run a function on a specific CPU
369369 * @cpu: The CPU to run on.
370370 * @data: Pre-allocated and setup data structure
371+ * @wait: If true, wait until function has completed on specified CPU.
371372 *
372373 * Like smp_call_function_single(), but allow caller to pass in a
373374 * pre-allocated data structure. Useful for embedding @data inside
@@ -376,8 +377,10 @@ EXPORT_SYMBOL_GPL(smp_call_function_any); · 2 unmodified lines
376377 void __smp_call_function_single(int cpu, struct call_single_data *data,
377378 int wait)
378379 {
379− csd_lock(data);
380+ unsigned int this_cpu;
381+ unsigned long flags;
380382
383+ this_cpu = get_cpu();
381384 /*
382385 * Can deadlock when called with interrupts disabled.
383386 * We allow cpu's that are not yet online though, as no one else can
@@ -387,7 +390,15 @@ void __smp_call_function_single(int cpu, struct call_single_data *data, · 3 unmodified lines
387390 WARN_ON_ONCE(cpu_online(smp_processor_id()) && wait && irqs_disabled()
388391 && !oops_in_progress);
389392
390− generic_exec_single(cpu, data, wait);
393+ if (cpu == this_cpu) {
394+ local_irq_save(flags);
395+ data->func(data->info);
396+ local_irq_restore(flags);
397+ } else {
398+ csd_lock(data);
399+ generic_exec_single(cpu, data, wait);
400+ }
401+ put_cpu();
391402 }
392403
393404 /**
lib/bug.c+2−4
@@ -72,8 +72,8 @@ static const struct bug_entry *module_find_bug(unsigned long bugaddr) · 71 unmodified lines
7272 return NULL;
7373 }
7474
75−int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
76− struct module *mod)
75+void module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs,
76+ struct module *mod)
7777 {
7878 char *secstrings;
7979 unsigned int i;
@@ -97,8 +97,6 @@ int module_bug_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, · 17 unmodified lines
9797 * could potentially lead to deadlock and thus be counter-productive.
9898 */
9999 list_add(&mod->bug_list, &module_bug_list);
100−
101− return 0;
102100 }
103101
104102 void module_bug_cleanup(struct module *mod)
lib/list_sort.c+1−1
@@ -70,7 +70,7 @@ static void merge_and_restore_back_links(void *priv, · 69 unmodified lines
7070 * element comparison is needed, so the client's cmp()
7171 * routine can invoke cond_resched() periodically.
7272 */
73− (*cmp)(priv, tail, tail);
73+ (*cmp)(priv, tail->next, tail->next);
7474
7575 tail->next->prev = tail;
7676 tail = tail->next;
mm/fremap.c+5−2
@@ -125,7 +125,6 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, · 124 unmodified lines
125125 {
126126 struct mm_struct *mm = current->mm;
127127 struct address_space *mapping;
128− unsigned long end = start + size;
129128 struct vm_area_struct *vma;
130129 int err = -EINVAL;
131130 int has_write_lock = 0;
@@ -142,6 +141,10 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, · 10 unmodified lines
142141 if (start + size <= start)
143142 return err;
144143
144+ /* Does pgoff wrap? */
145+ if (pgoff + (size >> PAGE_SHIFT) < pgoff)
146+ return err;
147+
145148 /* Can we represent this offset inside this architecture's pte's? */
146149 #if PTE_FILE_MAX_BITS < BITS_PER_LONG
147150 if (pgoff + (size >> PAGE_SHIFT) >= (1UL << PTE_FILE_MAX_BITS))
@@ -168,7 +171,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size, · 20 unmodified lines
168171 if (!(vma->vm_flags & VM_CAN_NONLINEAR))
169172 goto out;
170173
171− if (end <= start || start < vma->vm_start || end > vma->vm_end)
174+ if (start < vma->vm_start || start + size > vma->vm_end)
172175 goto out;
173176
174177 /* Must set VM_NONLINEAR before any pages are populated. */
mm/hugetlb.c+13−11
@@ -2324,11 +2324,8 @@ retry_avoidcopy: · 2323 unmodified lines
23242324 * and just make the page writable */
23252325 avoidcopy = (page_mapcount(old_page) == 1);
23262326 if (avoidcopy) {
2327− if (!trylock_page(old_page)) {
2328− if (PageAnon(old_page))
2329− page_move_anon_rmap(old_page, vma, address);
2330− } else
2331− unlock_page(old_page);
2327+ if (PageAnon(old_page))
2328+ page_move_anon_rmap(old_page, vma, address);
23322329 set_huge_ptep_writable(vma, address, ptep);
23332330 return 0;
23342331 }
@@ -2404,7 +2401,7 @@ retry_avoidcopy: · 69 unmodified lines
24042401 set_huge_pte_at(mm, address, ptep,
24052402 make_huge_pte(vma, new_page, 1));
24062403 page_remove_rmap(old_page);
2407− hugepage_add_anon_rmap(new_page, vma, address);
2404+ hugepage_add_new_anon_rmap(new_page, vma, address);
24082405 /* Make the old page be freed below */
24092406 new_page = old_page;
24102407 mmu_notifier_invalidate_range_end(mm,
@@ -2631,10 +2628,16 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, · 220 unmodified lines
26312628 vma, address);
26322629 }
26332630
2634− if (!pagecache_page) {
2635− page = pte_page(entry);
2631+ /*
2632+ * hugetlb_cow() requires page locks of pte_page(entry) and
2633+ * pagecache_page, so here we need take the former one
2634+ * when page != pagecache_page or !pagecache_page.
2635+ * Note that locking order is always pagecache_page -> page,
2636+ * so no worry about deadlock.
2637+ */
2638+ page = pte_page(entry);
2639+ if (page != pagecache_page)
26362640 lock_page(page);
2637− }
26382641
26392642 spin_lock(&mm->page_table_lock);
26402643 /* Check for a racing update before calling hugetlb_cow */
@@ -2661,9 +2664,8 @@ out_page_table_lock: · 20 unmodified lines
26612664 if (pagecache_page) {
26622665 unlock_page(pagecache_page);
26632666 put_page(pagecache_page);
2664− } else {
2665− unlock_page(page);
26662667 }
2668+ unlock_page(page);
26672669
26682670 out_mutex:
26692671 mutex_unlock(&hugetlb_instantiation_mutex);
mm/ksm.c+4−2
@@ -712,7 +712,7 @@ static int write_protect_page(struct vm_area_struct *vma, struct page *page, · 711 unmodified lines
712712 if (!ptep)
713713 goto out;
714714
715− if (pte_write(*ptep)) {
715+ if (pte_write(*ptep) || pte_dirty(*ptep)) {
716716 pte_t entry;
717717
718718 swapped = PageSwapCache(page);
@@ -735,7 +735,9 @@ static int write_protect_page(struct vm_area_struct *vma, struct page *page, · 16 unmodified lines
735735 set_pte_at(mm, addr, ptep, entry);
736736 goto out_unlock;
737737 }
738− entry = pte_wrprotect(entry);
738+ if (pte_dirty(entry))
739+ set_page_dirty(page);
740+ entry = pte_mkclean(pte_wrprotect(entry));
739741 set_pte_at_notify(mm, addr, ptep, entry);
740742 }
741743 *orig_pte = *ptep;
mm/mmap.c+1−0
@@ -2009,6 +2009,7 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, · 2008 unmodified lines
20092009 removed_exe_file_vma(mm);
20102010 fput(new->vm_file);
20112011 }
2012+ unlink_anon_vmas(new);
20122013 out_free_mpol:
20132014 mpol_put(pol);
20142015 out_free_vma:
mm/oom_kill.c+26−23
@@ -121,8 +121,8 @@ struct task_struct *find_lock_task_mm(struct task_struct *p) · 120 unmodified lines
121121 }
122122
123123 /* return true if the task is not adequate as candidate victim task. */
124−static bool oom_unkillable_task(struct task_struct *p, struct mem_cgroup *mem,
125− const nodemask_t *nodemask)
124+static bool oom_unkillable_task(struct task_struct *p,
125+ const struct mem_cgroup *mem, const nodemask_t *nodemask)
126126 {
127127 if (is_global_init(p))
128128 return true;
@@ -208,8 +208,13 @@ unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, · 79 unmodified lines
208208 */
209209 points += p->signal->oom_score_adj;
210210
211− if (points < 0)
212− return 0;
211+ /*
212+ * Never return 0 for an eligible task that may be killed since it's
213+ * possible that no single user task uses more than 0.1% of memory and
214+ * no single admin tasks uses more than 3.0%.
215+ */
216+ if (points <= 0)
217+ return 1;
213218 return (points < 1000) ? points : 1000;
214219 }
215220
@@ -339,26 +344,24 @@ static struct task_struct *select_bad_process(unsigned int *ppoints, · 123 unmodified lines
339344 /**
340345 * dump_tasks - dump current memory state of all system tasks
341346 * @mem: current's memory controller, if constrained
347+ * @nodemask: nodemask passed to page allocator for mempolicy ooms
342348 *
343− * Dumps the current memory state of all system tasks, excluding kernel threads.
349+ * Dumps the current memory state of all eligible tasks. Tasks not in the same
350+ * memcg, not in the same cpuset, or bound to a disjoint set of mempolicy nodes
351+ * are not shown.
344352 * State information includes task's pid, uid, tgid, vm size, rss, cpu, oom_adj
345353 * value, oom_score_adj value, and name.
346354 *
347− * If the actual is non-NULL, only tasks that are a member of the mem_cgroup are
348− * shown.
349− *
350355 * Call with tasklist_lock read-locked.
351356 */
352−static void dump_tasks(const struct mem_cgroup *mem)
357+static void dump_tasks(const struct mem_cgroup *mem, const nodemask_t *nodemask)
353358 {
354359 struct task_struct *p;
355360 struct task_struct *task;
356361
357362 pr_info("[ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name\n");
358363 for_each_process(p) {
359− if (p->flags & PF_KTHREAD)
360− continue;
361− if (mem && !task_in_mem_cgroup(p, mem))
364+ if (oom_unkillable_task(p, mem, nodemask))
362365 continue;
363366
364367 task = find_lock_task_mm(p);
@@ -381,7 +384,7 @@ static void dump_tasks(const struct mem_cgroup *mem) · 16 unmodified lines
381384 }
382385
383386 static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order,
384− struct mem_cgroup *mem)
387+ struct mem_cgroup *mem, const nodemask_t *nodemask)
385388 {
386389 task_lock(current);
387390 pr_warning("%s invoked oom-killer: gfp_mask=0x%x, order=%d, "
@@ -394,7 +397,7 @@ static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order, · 6 unmodified lines
394397 mem_cgroup_print_oom_info(mem, p);
395398 show_mem();
396399 if (sysctl_oom_dump_tasks)
397− dump_tasks(mem);
400+ dump_tasks(mem, nodemask);
398401 }
399402
400403 #define K(x) ((x) << (PAGE_SHIFT-10))
@@ -436,7 +439,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, · 35 unmodified lines
436439 unsigned int victim_points = 0;
437440
438441 if (printk_ratelimit())
439− dump_header(p, gfp_mask, order, mem);
442+ dump_header(p, gfp_mask, order, mem, nodemask);
440443
441444 /*
442445 * If the task is already exiting, don't alarm the sysadmin or kill
@@ -482,7 +485,7 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, · 39 unmodified lines
482485 * Determines whether the kernel must panic because of the panic_on_oom sysctl.
483486 */
484487 static void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask,
485− int order)
488+ int order, const nodemask_t *nodemask)
486489 {
487490 if (likely(!sysctl_panic_on_oom))
488491 return;
@@ -496,7 +499,7 @@ static void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask, · 7 unmodified lines
496499 return;
497500 }
498501 read_lock(&tasklist_lock);
499− dump_header(NULL, gfp_mask, order, NULL);
502+ dump_header(NULL, gfp_mask, order, NULL, nodemask);
500503 read_unlock(&tasklist_lock);
501504 panic("Out of memory: %s panic_on_oom is enabled\n",
502505 sysctl_panic_on_oom == 2 ? "compulsory" : "system-wide");
@@ -509,7 +512,7 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask) · 6 unmodified lines
509512 unsigned int points = 0;
510513 struct task_struct *p;
511514
512− check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0);
515+ check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, 0, NULL);
513516 limit = mem_cgroup_get_limit(mem) >> PAGE_SHIFT;
514517 read_lock(&tasklist_lock);
515518 retry:
@@ -641,6 +644,7 @@ static void clear_system_oom(void) · 125 unmodified lines
641644 void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
642645 int order, nodemask_t *nodemask)
643646 {
647+ const nodemask_t *mpol_mask;
644648 struct task_struct *p;
645649 unsigned long totalpages;
646650 unsigned long freed = 0;
@@ -670,7 +674,8 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, · 23 unmodified lines
670674 */
671675 constraint = constrained_alloc(zonelist, gfp_mask, nodemask,
672676 &totalpages);
673− check_panic_on_oom(constraint, gfp_mask, order);
677+ mpol_mask = (constraint == CONSTRAINT_MEMORY_POLICY) ? nodemask : NULL;
678+ check_panic_on_oom(constraint, gfp_mask, order, mpol_mask);
674679
675680 read_lock(&tasklist_lock);
676681 if (sysctl_oom_kill_allocating_task &&
@@ -688,15 +693,13 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, · 11 unmodified lines
688693 }
689694
690695 retry:
691− p = select_bad_process(&points, totalpages, NULL,
692− constraint == CONSTRAINT_MEMORY_POLICY ? nodemask :
693− NULL);
696+ p = select_bad_process(&points, totalpages, NULL, mpol_mask);
694697 if (PTR_ERR(p) == -1UL)
695698 goto out;
696699
697700 /* Found nothing?!?! Either we hang forever, or we panic. */
698701 if (!p) {
699− dump_header(NULL, gfp_mask, order, NULL);
702+ dump_header(NULL, gfp_mask, order, NULL, mpol_mask);
700703 read_unlock(&tasklist_lock);
701704 panic("Out of memory and no killable processes...\n");
702705 }
mm/percpu.c+1−1
@@ -1401,9 +1401,9 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, · 1400 unmodified lines
14011401
14021402 if (pcpu_first_unit_cpu == NR_CPUS)
14031403 pcpu_first_unit_cpu = cpu;
1404+ pcpu_last_unit_cpu = cpu;
14041405 }
14051406 }
1406− pcpu_last_unit_cpu = cpu;
14071407 pcpu_nr_units = unit;
14081408
14091409 for_each_possible_cpu(cpu)
mm/rmap.c+16−7
@@ -381,7 +381,13 @@ vma_address(struct page *page, struct vm_area_struct *vma) · 380 unmodified lines
381381 unsigned long page_address_in_vma(struct page *page, struct vm_area_struct *vma)
382382 {
383383 if (PageAnon(page)) {
384− if (vma->anon_vma->root != page_anon_vma(page)->root)
384+ struct anon_vma *page__anon_vma = page_anon_vma(page);
385+ /*
386+ * Note: swapoff's unuse_vma() is more efficient with this
387+ * check, and needs it to match anon_vma when KSM is active.
388+ */
389+ if (!vma->anon_vma || !page__anon_vma ||
390+ vma->anon_vma->root != page__anon_vma->root)
385391 return -EFAULT;
386392 } else if (page->mapping && !(vma->vm_flags & VM_NONLINEAR)) {
387393 if (!vma->vm_file ||
@@ -1564,13 +1570,14 @@ static void __hugepage_set_anon_rmap(struct page *page, · 1176 unmodified lines
15641570 struct vm_area_struct *vma, unsigned long address, int exclusive)
15651571 {
15661572 struct anon_vma *anon_vma = vma->anon_vma;
1573+
15671574 BUG_ON(!anon_vma);
1568− if (!exclusive) {
1569− struct anon_vma_chain *avc;
1570− avc = list_entry(vma->anon_vma_chain.prev,
1571− struct anon_vma_chain, same_vma);
1572− anon_vma = avc->anon_vma;
1573− }
1575+
1576+ if (PageAnon(page))
1577+ return;
1578+ if (!exclusive)
1579+ anon_vma = anon_vma->root;
1580+
15741581 anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
15751582 page->mapping = (struct address_space *) anon_vma;
15761583 page->index = linear_page_index(vma, address);
@@ -1581,6 +1588,8 @@ void hugepage_add_anon_rmap(struct page *page, · 4 unmodified lines
15811588 {
15821589 struct anon_vma *anon_vma = vma->anon_vma;
15831590 int first;
1591+
1592+ BUG_ON(!PageLocked(page));
15841593 BUG_ON(!anon_vma);
15851594 BUG_ON(address < vma->vm_start || address >= vma->vm_end);
15861595 first = atomic_inc_and_test(&page->_mapcount);
mm/vmscan.c+35−8
@@ -1804,12 +1804,11 @@ static void shrink_zone(int priority, struct zone *zone, · 1803 unmodified lines
18041804 * If a zone is deemed to be full of pinned pages then just give it a light
18051805 * scan then give up on it.
18061806 */
1807−static bool shrink_zones(int priority, struct zonelist *zonelist,
1807+static void shrink_zones(int priority, struct zonelist *zonelist,
18081808 struct scan_control *sc)
18091809 {
18101810 struct zoneref *z;
18111811 struct zone *zone;
1812− bool all_unreclaimable = true;
18131812
18141813 for_each_zone_zonelist_nodemask(zone, z, zonelist,
18151814 gfp_zone(sc->gfp_mask), sc->nodemask) {
@@ -1827,8 +1826,38 @@ static bool shrink_zones(int priority, struct zonelist *zonelist, · 11 unmodified lines
18271826 }
18281827
18291828 shrink_zone(priority, zone, sc);
1830− all_unreclaimable = false;
18311829 }
1830+}
1831+
1832+static bool zone_reclaimable(struct zone *zone)
1833+{
1834+ return zone->pages_scanned < zone_reclaimable_pages(zone) * 6;
1835+}
1836+
1837+/*
1838+ * As hibernation is going on, kswapd is freezed so that it can't mark
1839+ * the zone into all_unreclaimable. It can't handle OOM during hibernation.
1840+ * So let's check zone's unreclaimable in direct reclaim as well as kswapd.
1841+ */
1842+static bool all_unreclaimable(struct zonelist *zonelist,
1843+ struct scan_control *sc)
1844+{
1845+ struct zoneref *z;
1846+ struct zone *zone;
1847+ bool all_unreclaimable = true;
1848+
1849+ for_each_zone_zonelist_nodemask(zone, z, zonelist,
1850+ gfp_zone(sc->gfp_mask), sc->nodemask) {
1851+ if (!populated_zone(zone))
1852+ continue;
1853+ if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
1854+ continue;
1855+ if (zone_reclaimable(zone)) {
1856+ all_unreclaimable = false;
1857+ break;
1858+ }
1859+ }
1860+
18321861 return all_unreclaimable;
18331862 }
18341863
@@ -1852,7 +1881,6 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, · 17 unmodified lines
18521881 struct scan_control *sc)
18531882 {
18541883 int priority;
1855− bool all_unreclaimable;
18561884 unsigned long total_scanned = 0;
18571885 struct reclaim_state *reclaim_state = current->reclaim_state;
18581886 struct zoneref *z;
@@ -1869,7 +1897,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, · 10 unmodified lines
18691897 sc->nr_scanned = 0;
18701898 if (!priority)
18711899 disable_swap_token();
1872− all_unreclaimable = shrink_zones(priority, zonelist, sc);
1900+ shrink_zones(priority, zonelist, sc);
18731901 /*
18741902 * Don't shrink slabs when reclaiming memory from
18751903 * over limit cgroups
@@ -1931,7 +1959,7 @@ out: · 55 unmodified lines
19311959 return sc->nr_reclaimed;
19321960
19331961 /* top priority shrink_zones still had more to do? don't OOM, then */
1934− if (scanning_global_lru(sc) && !all_unreclaimable)
1962+ if (scanning_global_lru(sc) && !all_unreclaimable(zonelist, sc))
19351963 return 1;
19361964
19371965 return 0;
@@ -2197,8 +2225,7 @@ loop_again: · 259 unmodified lines
21972225 total_scanned += sc.nr_scanned;
21982226 if (zone->all_unreclaimable)
21992227 continue;
2200− if (nr_slab == 0 &&
2201− zone->pages_scanned >= (zone_reclaimable_pages(zone) * 6))
2228+ if (nr_slab == 0 && !zone_reclaimable(zone))
22022229 zone->all_unreclaimable = 1;
22032230 /*
22042231 * If we've done a decent amount of scanning and
net/8021q/vlan_core.c+10−4
@@ -24,8 +24,11 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, · 23 unmodified lines
2424
2525 if (vlan_dev)
2626 skb->dev = vlan_dev;
27− else if (vlan_id)
28− goto drop;
27+ else if (vlan_id) {
28+ if (!(skb->dev->flags & IFF_PROMISC))
29+ goto drop;
30+ skb->pkt_type = PACKET_OTHERHOST;
31+ }
2932
3033 return (polling ? netif_receive_skb(skb) : netif_rx(skb));
3134
@@ -102,8 +105,11 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, · 70 unmodified lines
102105
103106 if (vlan_dev)
104107 skb->dev = vlan_dev;
105− else if (vlan_id)
106− goto drop;
108+ else if (vlan_id) {
109+ if (!(skb->dev->flags & IFF_PROMISC))
110+ goto drop;
111+ skb->pkt_type = PACKET_OTHERHOST;
112+ }
107113
108114 for (p = napi->gro_list; p; p = p->next) {
109115 NAPI_GRO_CB(p)->same_flow =
net/9p/trans_rdma.c+18−11
@@ -426,8 +426,10 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) · 425 unmodified lines
426426
427427 /* Allocate an fcall for the reply */
428428 rpl_context = kmalloc(sizeof *rpl_context, GFP_KERNEL);
429− if (!rpl_context)
429+ if (!rpl_context) {
430+ err = -ENOMEM;
430431 goto err_close;
432+ }
431433
432434 /*
433435 * If the request has a buffer, steal it, otherwise
@@ -445,8 +447,8 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) · 11 unmodified lines
445447 }
446448 rpl_context->rc = req->rc;
447449 if (!rpl_context->rc) {
448− kfree(rpl_context);
449− goto err_close;
450+ err = -ENOMEM;
451+ goto err_free2;
450452 }
451453
452454 /*
@@ -458,11 +460,8 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) · 5 unmodified lines
458460 */
459461 if (atomic_inc_return(&rdma->rq_count) <= rdma->rq_depth) {
460462 err = post_recv(client, rpl_context);
461− if (err) {
462− kfree(rpl_context->rc);
463− kfree(rpl_context);
464− goto err_close;
465− }
463+ if (err)
464+ goto err_free1;
466465 } else
467466 atomic_dec(&rdma->rq_count);
468467
@@ -471,8 +470,10 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) · 2 unmodified lines
471470
472471 /* Post the request */
473472 c = kmalloc(sizeof *c, GFP_KERNEL);
474− if (!c)
475− goto err_close;
473+ if (!c) {
474+ err = -ENOMEM;
475+ goto err_free1;
476+ }
476477 c->req = req;
477478
478479 c->busa = ib_dma_map_single(rdma->cm_id->device,
@@ -499,9 +500,15 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) · 20 unmodified lines
499500 return ib_post_send(rdma->qp, &wr, &bad_wr);
500501
501502 error:
503+ kfree(c);
504+ kfree(rpl_context->rc);
505+ kfree(rpl_context);
502506 P9_DPRINTK(P9_DEBUG_ERROR, "EIO\n");
503507 return -EIO;
504−
508+ err_free1:
509+ kfree(rpl_context->rc);
510+ err_free2:
511+ kfree(rpl_context);
505512 err_close:
506513 spin_lock_irqsave(&rdma->req_lock, flags);
507514 if (rdma->state < P9_RDMA_CLOSING) {
net/9p/trans_virtio.c+2−1
@@ -329,7 +329,8 @@ p9_virtio_create(struct p9_client *client, const char *devname, char *args) · 328 unmodified lines
329329
330330 mutex_lock(&virtio_9p_lock);
331331 list_for_each_entry(chan, &virtio_chan_list, chan_list) {
332− if (!strncmp(devname, chan->tag, chan->tag_len)) {
332+ if (!strncmp(devname, chan->tag, chan->tag_len) &&
333+ strlen(devname) == chan->tag_len) {
333334 if (!chan->inuse) {
334335 chan->inuse = true;
335336 found = 1;
net/atm/br2684.c+2−10
@@ -399,12 +399,6 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb) · 398 unmodified lines
399399 unregister_netdev(net_dev);
400400 free_netdev(net_dev);
401401 }
402− read_lock_irq(&devs_lock);
403− if (list_empty(&br2684_devs)) {
404− /* last br2684 device */
405− unregister_atmdevice_notifier(&atm_dev_notifier);
406− }
407− read_unlock_irq(&devs_lock);
408402 return;
409403 }
410404
@@ -675,7 +669,6 @@ static int br2684_create(void __user *arg) · 264 unmodified lines
675669
676670 if (list_empty(&br2684_devs)) {
677671 /* 1st br2684 device */
678− register_atmdevice_notifier(&atm_dev_notifier);
679672 brdev->number = 1;
680673 } else
681674 brdev->number = BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1;
@@ -815,6 +808,7 @@ static int __init br2684_init(void) · 133 unmodified lines
815808 return -ENOMEM;
816809 #endif
817810 register_atm_ioctl(&br2684_ioctl_ops);
811+ register_atmdevice_notifier(&atm_dev_notifier);
818812 return 0;
819813 }
820814
@@ -830,9 +824,7 @@ static void __exit br2684_exit(void) · 9 unmodified lines
830824 #endif
831825
832826
833− /* if not already empty */
834− if (!list_empty(&br2684_devs))
835− unregister_atmdevice_notifier(&atm_dev_notifier);
827+ unregister_atmdevice_notifier(&atm_dev_notifier);
836828
837829 while (!list_empty(&br2684_devs)) {
838830 net_dev = list_entry_brdev(br2684_devs.next);
net/core/iovec.c+3−2
@@ -35,9 +35,10 @@ · 34 unmodified lines
3535 * in any case.
3636 */
3737
38−int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)
38+long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode)
3939 {
40− int size, err, ct;
40+ int size, ct;
41+ long err;
4142
4243 if (m->msg_namelen) {
4344 if (mode == VERIFY_READ) {
net/core/sock.c+4−4
@@ -1351,9 +1351,9 @@ int sock_i_uid(struct sock *sk) · 1350 unmodified lines
13511351 {
13521352 int uid;
13531353
1354− read_lock(&sk->sk_callback_lock);
1354+ read_lock_bh(&sk->sk_callback_lock);
13551355 uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0;
1356− read_unlock(&sk->sk_callback_lock);
1356+ read_unlock_bh(&sk->sk_callback_lock);
13571357 return uid;
13581358 }
13591359 EXPORT_SYMBOL(sock_i_uid);
@@ -1362,9 +1362,9 @@ unsigned long sock_i_ino(struct sock *sk) · 2 unmodified lines
13621362 {
13631363 unsigned long ino;
13641364
1365− read_lock(&sk->sk_callback_lock);
1365+ read_lock_bh(&sk->sk_callback_lock);
13661366 ino = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_ino : 0;
1367− read_unlock(&sk->sk_callback_lock);
1367+ read_unlock_bh(&sk->sk_callback_lock);
13681368 return ino;
13691369 }
13701370 EXPORT_SYMBOL(sock_i_ino);
net/ipv4/Kconfig+1−0
@@ -217,6 +217,7 @@ config NET_IPIP · 216 unmodified lines
217217
218218 config NET_IPGRE
219219 tristate "IP: GRE tunnels over IP"
220+ depends on IPV6 || IPV6=n
220221 help
221222 Tunneling means encapsulating data of one protocol type within
222223 another protocol and sending it over a channel that understands the
net/ipv4/ip_gre.c+4−4
@@ -45,7 +45,7 @@ · 44 unmodified lines
4545 #include <net/netns/generic.h>
4646 #include <net/rtnetlink.h>
4747
48−#ifdef CONFIG_IPV6
48+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
4949 #include <net/ipv6.h>
5050 #include <net/ip6_fib.h>
5151 #include <net/ip6_route.h>
@@ -699,7 +699,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev · 647 unmodified lines
699699 if ((dst = rt->rt_gateway) == 0)
700700 goto tx_error_icmp;
701701 }
702−#ifdef CONFIG_IPV6
702+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
703703 else if (skb->protocol == htons(ETH_P_IPV6)) {
704704 struct in6_addr *addr6;
705705 int addr_type;
@@ -774,7 +774,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev · 68 unmodified lines
774774 goto tx_error;
775775 }
776776 }
777−#ifdef CONFIG_IPV6
777+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
778778 else if (skb->protocol == htons(ETH_P_IPV6)) {
779779 struct rt6_info *rt6 = (struct rt6_info *)skb_dst(skb);
780780
@@ -850,7 +850,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev · 69 unmodified lines
850850 if ((iph->ttl = tiph->ttl) == 0) {
851851 if (skb->protocol == htons(ETH_P_IP))
852852 iph->ttl = old_iph->ttl;
853−#ifdef CONFIG_IPV6
853+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
854854 else if (skb->protocol == htons(ETH_P_IPV6))
855855 iph->ttl = ((struct ipv6hdr *)old_iph)->hop_limit;
856856 #endif
net/ipv4/ip_output.c+13−6
@@ -488,9 +488,8 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) · 487 unmodified lines
488488 * we can switch to copy when see the first bad fragment.
489489 */
490490 if (skb_has_frags(skb)) {
491− struct sk_buff *frag;
491+ struct sk_buff *frag, *frag2;
492492 int first_len = skb_pagelen(skb);
493− int truesizes = 0;
494493
495494 if (first_len - hlen > mtu ||
496495 ((first_len - hlen) & 7) ||
@@ -503,18 +502,18 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) · 6 unmodified lines
503502 if (frag->len > mtu ||
504503 ((frag->len & 7) && frag->next) ||
505504 skb_headroom(frag) < hlen)
506− goto slow_path;
505+ goto slow_path_clean;
507506
508507 /* Partially cloned skb? */
509508 if (skb_shared(frag))
510− goto slow_path;
509+ goto slow_path_clean;
511510
512511 BUG_ON(frag->sk);
513512 if (skb->sk) {
514513 frag->sk = skb->sk;
515514 frag->destructor = sock_wfree;
516515 }
517− truesizes += frag->truesize;
516+ skb->truesize -= frag->truesize;
518517 }
519518
520519 /* Everything is OK. Generate! */
@@ -524,7 +523,6 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) · 3 unmodified lines
524523 frag = skb_shinfo(skb)->frag_list;
525524 skb_frag_list_init(skb);
526525 skb->data_len = first_len - skb_headlen(skb);
527− skb->truesize -= truesizes;
528526 skb->len = first_len;
529527 iph->tot_len = htons(first_len);
530528 iph->frag_off = htons(IP_MF);
@@ -576,6 +574,15 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) · 45 unmodified lines
576574 }
577575 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
578576 return err;
577+
578+slow_path_clean:
579+ skb_walk_frags(skb, frag2) {
580+ if (frag2 == frag)
581+ break;
582+ frag2->sk = NULL;
583+ frag2->destructor = NULL;
584+ skb->truesize += frag2->truesize;
585+ }
579586 }
580587
581588 slow_path:
net/ipv4/netfilter/ipt_REJECT.c+1−0
@@ -112,6 +112,7 @@ static void send_reset(struct sk_buff *oldskb, int hook) · 111 unmodified lines
112112 /* ip_route_me_harder expects skb->dst to be set */
113113 skb_dst_set_noref(nskb, skb_dst(oldskb));
114114
115+ nskb->protocol = htons(ETH_P_IP);
115116 if (ip_route_me_harder(nskb, addr_type))
116117 goto free_nskb;
117118
net/ipv4/netfilter/nf_defrag_ipv4.c+3−1
@@ -66,9 +66,11 @@ static unsigned int ipv4_conntrack_defrag(unsigned int hooknum, · 65 unmodified lines
6666 const struct net_device *out,
6767 int (*okfn)(struct sk_buff *))
6868 {
69+ struct sock *sk = skb->sk;
6970 struct inet_sock *inet = inet_sk(skb->sk);
7071
71− if (inet && inet->nodefrag)
72+ if (sk && (sk->sk_family == PF_INET) &&
73+ inet->nodefrag)
7274 return NF_ACCEPT;
7375
7476 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
net/ipv4/netfilter/nf_nat_snmp_basic.c+4−2
@@ -893,13 +893,15 @@ static void fast_csum(__sum16 *csum, · 892 unmodified lines
893893 unsigned char s[4];
894894
895895 if (offset & 1) {
896− s[0] = s[2] = 0;
896+ s[0] = ~0;
897897 s[1] = ~*optr;
898+ s[2] = 0;
898899 s[3] = *nptr;
899900 } else {
900− s[1] = s[3] = 0;
901901 s[0] = ~*optr;
902+ s[1] = ~0;
902903 s[2] = *nptr;
904+ s[3] = 0;
903905 }
904906
905907 *csum = csum_fold(csum_partial(s, 4, ~csum_unfold(*csum)));
net/ipv4/route.c+1−1
@@ -1231,7 +1231,7 @@ restart: · 1230 unmodified lines
12311231 }
12321232
12331233 if (net_ratelimit())
1234− printk(KERN_WARNING "Neighbour table overflow.\n");
1234+ printk(KERN_WARNING "ipv4: Neighbour table overflow.\n");
12351235 rt_drop(rt);
12361236 return -ENOBUFS;
12371237 }
net/ipv4/tcp.c+6−3
@@ -386,8 +386,6 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) · 385 unmodified lines
386386 */
387387
388388 mask = 0;
389− if (sk->sk_err)
390− mask = POLLERR;
391389
392390 /*
393391 * POLLHUP is certainly not done right. But poll() doesn't
@@ -457,6 +455,11 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) · 63 unmodified lines
457455 if (tp->urg_data & TCP_URG_VALID)
458456 mask |= POLLPRI;
459457 }
458+ /* This barrier is coupled with smp_wmb() in tcp_reset() */
459+ smp_rmb();
460+ if (sk->sk_err)
461+ mask |= POLLERR;
462+
460463 return mask;
461464 }
462465 EXPORT_SYMBOL(tcp_poll);
@@ -940,7 +943,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, · 477 unmodified lines
940943 sg = sk->sk_route_caps & NETIF_F_SG;
941944
942945 while (--iovlen >= 0) {
943− int seglen = iov->iov_len;
946+ size_t seglen = iov->iov_len;
944947 unsigned char __user *from = iov->iov_base;
945948
946949 iov++;
net/ipv4/tcp_input.c+4−1
@@ -2545,7 +2545,8 @@ static void tcp_mark_head_lost(struct sock *sk, int packets) · 2544 unmodified lines
25452545 cnt += tcp_skb_pcount(skb);
25462546
25472547 if (cnt > packets) {
2548− if (tcp_is_sack(tp) || (oldcnt >= packets))
2548+ if ((tcp_is_sack(tp) && !tcp_is_fack(tp)) ||
2549+ (oldcnt >= packets))
25492550 break;
25502551
25512552 mss = skb_shinfo(skb)->gso_size;
@@ -4048,6 +4049,8 @@ static void tcp_reset(struct sock *sk) · 1496 unmodified lines
40484049 default:
40494050 sk->sk_err = ECONNRESET;
40504051 }
4052+ /* This barrier is coupled with smp_rmb() in tcp_poll() */
4053+ smp_wmb();
40514054
40524055 if (!sock_flag(sk, SOCK_DEAD))
40534056 sk->sk_error_report(sk);
net/ipv4/tcp_timer.c+14−10
@@ -135,13 +135,16 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) · 134 unmodified lines
135135
136136 /* This function calculates a "timeout" which is equivalent to the timeout of a
137137 * TCP connection after "boundary" unsuccessful, exponentially backed-off
138− * retransmissions with an initial RTO of TCP_RTO_MIN.
138+ * retransmissions with an initial RTO of TCP_RTO_MIN or TCP_TIMEOUT_INIT if
139+ * syn_set flag is set.
139140 */
140141 static bool retransmits_timed_out(struct sock *sk,
141− unsigned int boundary)
142+ unsigned int boundary,
143+ bool syn_set)
142144 {
143145 unsigned int timeout, linear_backoff_thresh;
144146 unsigned int start_ts;
147+ unsigned int rto_base = syn_set ? TCP_TIMEOUT_INIT : TCP_RTO_MIN;
145148
146149 if (!inet_csk(sk)->icsk_retransmits)
147150 return false;
@@ -151,12 +154,12 @@ static bool retransmits_timed_out(struct sock *sk, · 3 unmodified lines
151154 else
152155 start_ts = tcp_sk(sk)->retrans_stamp;
153156
154− linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN);
157+ linear_backoff_thresh = ilog2(TCP_RTO_MAX/rto_base);
155158
156159 if (boundary <= linear_backoff_thresh)
157− timeout = ((2 << boundary) - 1) * TCP_RTO_MIN;
160+ timeout = ((2 << boundary) - 1) * rto_base;
158161 else
159− timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN +
162+ timeout = ((2 << linear_backoff_thresh) - 1) * rto_base +
160163 (boundary - linear_backoff_thresh) * TCP_RTO_MAX;
161164
162165 return (tcp_time_stamp - start_ts) >= timeout;
@@ -167,14 +170,15 @@ static int tcp_write_timeout(struct sock *sk) · 4 unmodified lines
167170 {
168171 struct inet_connection_sock *icsk = inet_csk(sk);
169172 int retry_until;
170− bool do_reset;
173+ bool do_reset, syn_set = 0;
171174
172175 if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) {
173176 if (icsk->icsk_retransmits)
174177 dst_negative_advice(sk);
175178 retry_until = icsk->icsk_syn_retries ? : sysctl_tcp_syn_retries;
179+ syn_set = 1;
176180 } else {
177− if (retransmits_timed_out(sk, sysctl_tcp_retries1)) {
181+ if (retransmits_timed_out(sk, sysctl_tcp_retries1, 0)) {
178182 /* Black hole detection */
179183 tcp_mtu_probing(icsk, sk);
180184
@@ -187,14 +191,14 @@ static int tcp_write_timeout(struct sock *sk) · 6 unmodified lines
187191
188192 retry_until = tcp_orphan_retries(sk, alive);
189193 do_reset = alive ||
190− !retransmits_timed_out(sk, retry_until);
194+ !retransmits_timed_out(sk, retry_until, 0);
191195
192196 if (tcp_out_of_resources(sk, do_reset))
193197 return 1;
194198 }
195199 }
196200
197− if (retransmits_timed_out(sk, retry_until)) {
201+ if (retransmits_timed_out(sk, retry_until, syn_set)) {
198202 /* Has it gone just too far? */
199203 tcp_write_err(sk);
200204 return 1;
@@ -436,7 +440,7 @@ out_reset_timer: · 235 unmodified lines
436440 icsk->icsk_rto = min(icsk->icsk_rto << 1, TCP_RTO_MAX);
437441 }
438442 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX);
439− if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1))
443+ if (retransmits_timed_out(sk, sysctl_tcp_retries1 + 1, 0))
440444 __sk_dst_reset(sk);
441445
442446 out:;
net/ipv4/xfrm4_policy.c+1−1
@@ -61,7 +61,7 @@ static int xfrm4_get_saddr(struct net *net, · 60 unmodified lines
6161
6262 static int xfrm4_get_tos(struct flowi *fl)
6363 {
64− return fl->fl4_tos;
64+ return IPTOS_RT_MASK & fl->fl4_tos; /* Strip ECN bits */
6565 }
6666
6767 static int xfrm4_init_path(struct xfrm_dst *path, struct dst_entry *dst,
net/ipv4/xfrm4_state.c+19−14
@@ -21,21 +21,25 @@ static int xfrm4_init_flags(struct xfrm_state *x) · 20 unmodified lines
2121 }
2222
2323 static void
24−__xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl,
25− struct xfrm_tmpl *tmpl,
26− xfrm_address_t *daddr, xfrm_address_t *saddr)
24+__xfrm4_init_tempsel(struct xfrm_selector *sel, struct flowi *fl)
25+{
26+ sel->daddr.a4 = fl->fl4_dst;
27+ sel->saddr.a4 = fl->fl4_src;
28+ sel->dport = xfrm_flowi_dport(fl);
29+ sel->dport_mask = htons(0xffff);
30+ sel->sport = xfrm_flowi_sport(fl);
31+ sel->sport_mask = htons(0xffff);
32+ sel->family = AF_INET;
33+ sel->prefixlen_d = 32;
34+ sel->prefixlen_s = 32;
35+ sel->proto = fl->proto;
36+ sel->ifindex = fl->oif;
37+}
38+
39+static void
40+xfrm4_init_temprop(struct xfrm_state *x, struct xfrm_tmpl *tmpl,
41+ xfrm_address_t *daddr, xfrm_address_t *saddr)
2742 {
28− x->sel.daddr.a4 = fl->fl4_dst;
29− x->sel.saddr.a4 = fl->fl4_src;
30− x->sel.dport = xfrm_flowi_dport(fl);
31− x->sel.dport_mask = htons(0xffff);
32− x->sel.sport = xfrm_flowi_sport(fl);
33− x->sel.sport_mask = htons(0xffff);
34− x->sel.family = AF_INET;
35− x->sel.prefixlen_d = 32;
36− x->sel.prefixlen_s = 32;
37− x->sel.proto = fl->proto;
38− x->sel.ifindex = fl->oif;
3943 x->id = tmpl->id;
4044 if (x->id.daddr.a4 == 0)
4145 x->id.daddr.a4 = daddr->a4;
@@ -70,6 +74,7 @@ static struct xfrm_state_afinfo xfrm4_state_afinfo = { · 28 unmodified lines
7074 .owner = THIS_MODULE,
7175 .init_flags = xfrm4_init_flags,
7276 .init_tempsel = __xfrm4_init_tempsel,
77+ .init_temprop = xfrm4_init_temprop,
7378 .output = xfrm4_output,
7479 .extract_input = xfrm4_extract_input,
7580 .extract_output = xfrm4_extract_output,
net/ipv6/addrconf.c+8−3
@@ -4637,10 +4637,12 @@ int __init addrconf_init(void) · 4636 unmodified lines
46374637 if (err < 0) {
46384638 printk(KERN_CRIT "IPv6 Addrconf:"
46394639 " cannot initialize default policy table: %d.\n", err);
4640− return err;
4640+ goto out;
46414641 }
46424642
4643− register_pernet_subsys(&addrconf_ops);
4643+ err = register_pernet_subsys(&addrconf_ops);
4644+ if (err < 0)
4645+ goto out_addrlabel;
46444646
46454647 /* The addrconf netdev notifier requires that loopback_dev
46464648 * has it's ipv6 private information allocated and setup
@@ -4692,7 +4694,9 @@ errout: · 45 unmodified lines
46924694 unregister_netdevice_notifier(&ipv6_dev_notf);
46934695 errlo:
46944696 unregister_pernet_subsys(&addrconf_ops);
4695−
4697+out_addrlabel:
4698+ ipv6_addr_label_cleanup();
4699+out:
46964700 return err;
46974701 }
46984702
@@ -4703,6 +4707,7 @@ void addrconf_cleanup(void) · 4 unmodified lines
47034707
47044708 unregister_netdevice_notifier(&ipv6_dev_notf);
47054709 unregister_pernet_subsys(&addrconf_ops);
4710+ ipv6_addr_label_cleanup();
47064711
47074712 rtnl_lock();
47084713
net/ipv6/addrlabel.c+5−0
@@ -393,6 +393,11 @@ int __init ipv6_addr_label_init(void) · 392 unmodified lines
393393 return register_pernet_subsys(&ipv6_addr_label_ops);
394394 }
395395
396+void ipv6_addr_label_cleanup(void)
397+{
398+ unregister_pernet_subsys(&ipv6_addr_label_ops);
399+}
400+
396401 static const struct nla_policy ifal_policy[IFAL_MAX+1] = {
397402 [IFAL_ADDRESS] = { .len = sizeof(struct in6_addr), },
398403 [IFAL_LABEL] = { .len = sizeof(u32), },
net/ipv6/ip6_output.c+13−5
@@ -639,7 +639,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) · 638 unmodified lines
639639
640640 if (skb_has_frags(skb)) {
641641 int first_len = skb_pagelen(skb);
642− int truesizes = 0;
642+ struct sk_buff *frag2;
643643
644644 if (first_len - hlen > mtu ||
645645 ((first_len - hlen) & 7) ||
@@ -651,18 +651,18 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) · 5 unmodified lines
651651 if (frag->len > mtu ||
652652 ((frag->len & 7) && frag->next) ||
653653 skb_headroom(frag) < hlen)
654− goto slow_path;
654+ goto slow_path_clean;
655655
656656 /* Partially cloned skb? */
657657 if (skb_shared(frag))
658− goto slow_path;
658+ goto slow_path_clean;
659659
660660 BUG_ON(frag->sk);
661661 if (skb->sk) {
662662 frag->sk = skb->sk;
663663 frag->destructor = sock_wfree;
664− truesizes += frag->truesize;
665664 }
665+ skb->truesize -= frag->truesize;
666666 }
667667
668668 err = 0;
@@ -693,7 +693,6 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) · 24 unmodified lines
693693
694694 first_len = skb_pagelen(skb);
695695 skb->data_len = first_len - skb_headlen(skb);
696− skb->truesize -= truesizes;
697696 skb->len = first_len;
698697 ipv6_hdr(skb)->payload_len = htons(first_len -
699698 sizeof(struct ipv6hdr));
@@ -756,6 +755,15 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) · 56 unmodified lines
756755 IPSTATS_MIB_FRAGFAILS);
757756 dst_release(&rt->dst);
758757 return err;
758+
759+slow_path_clean:
760+ skb_walk_frags(skb, frag2) {
761+ if (frag2 == frag)
762+ break;
763+ frag2->sk = NULL;
764+ frag2->destructor = NULL;
765+ skb->truesize += frag2->truesize;
766+ }
759767 }
760768
761769 slow_path:
net/ipv6/route.c+1−1
@@ -670,7 +670,7 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort, struct in6_addr *dad · 669 unmodified lines
670670
671671 if (net_ratelimit())
672672 printk(KERN_WARNING
673− "Neighbour table overflow.\n");
673+ "ipv6: Neighbour table overflow.\n");
674674 dst_free(&rt->dst);
675675 return NULL;
676676 }
net/ipv6/xfrm6_state.c+19−14
@@ -20,23 +20,27 @@ · 19 unmodified lines
2020 #include <net/addrconf.h>
2121
2222 static void
23−__xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl,
24− struct xfrm_tmpl *tmpl,
25− xfrm_address_t *daddr, xfrm_address_t *saddr)
23+__xfrm6_init_tempsel(struct xfrm_selector *sel, struct flowi *fl)
2624 {
2725 /* Initialize temporary selector matching only
2826 * to current session. */
29− ipv6_addr_copy((struct in6_addr *)&x->sel.daddr, &fl->fl6_dst);
30− ipv6_addr_copy((struct in6_addr *)&x->sel.saddr, &fl->fl6_src);
31− x->sel.dport = xfrm_flowi_dport(fl);
32− x->sel.dport_mask = htons(0xffff);
33− x->sel.sport = xfrm_flowi_sport(fl);
34− x->sel.sport_mask = htons(0xffff);
35− x->sel.family = AF_INET6;
36− x->sel.prefixlen_d = 128;
37− x->sel.prefixlen_s = 128;
38− x->sel.proto = fl->proto;
39− x->sel.ifindex = fl->oif;
27+ ipv6_addr_copy((struct in6_addr *)&sel->daddr, &fl->fl6_dst);
28+ ipv6_addr_copy((struct in6_addr *)&sel->saddr, &fl->fl6_src);
29+ sel->dport = xfrm_flowi_dport(fl);
30+ sel->dport_mask = htons(0xffff);
31+ sel->sport = xfrm_flowi_sport(fl);
32+ sel->sport_mask = htons(0xffff);
33+ sel->family = AF_INET6;
34+ sel->prefixlen_d = 128;
35+ sel->prefixlen_s = 128;
36+ sel->proto = fl->proto;
37+ sel->ifindex = fl->oif;
38+}
39+
40+static void
41+xfrm6_init_temprop(struct xfrm_state *x, struct xfrm_tmpl *tmpl,
42+ xfrm_address_t *daddr, xfrm_address_t *saddr)
43+{
4044 x->id = tmpl->id;
4145 if (ipv6_addr_any((struct in6_addr*)&x->id.daddr))
4246 memcpy(&x->id.daddr, daddr, sizeof(x->sel.daddr));
@@ -168,6 +172,7 @@ static struct xfrm_state_afinfo xfrm6_state_afinfo = { · 125 unmodified lines
168172 .eth_proto = htons(ETH_P_IPV6),
169173 .owner = THIS_MODULE,
170174 .init_tempsel = __xfrm6_init_tempsel,
175+ .init_temprop = xfrm6_init_temprop,
171176 .tmpl_sort = __xfrm6_tmpl_sort,
172177 .state_sort = __xfrm6_state_sort,
173178 .output = xfrm6_output,
net/mac80211/rx.c+0−4
@@ -2199,9 +2199,6 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, · 2198 unmodified lines
21992199 struct net_device *prev_dev = NULL;
22002200 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
22012201
2202− if (status->flag & RX_FLAG_INTERNAL_CMTR)
2203− goto out_free_skb;
2204−
22052202 if (skb_headroom(skb) < sizeof(*rthdr) &&
22062203 pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC))
22072204 goto out_free_skb;
@@ -2260,7 +2257,6 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, · 52 unmodified lines
22602257 } else
22612258 goto out_free_skb;
22622259
2263− status->flag |= RX_FLAG_INTERNAL_CMTR;
22642260 return;
22652261
22662262 out_free_skb:
net/netfilter/nf_conntrack_extend.c+3−1
@@ -48,15 +48,17 @@ nf_ct_ext_create(struct nf_ct_ext **ext, enum nf_ct_ext_id id, gfp_t gfp) · 47 unmodified lines
4848 {
4949 unsigned int off, len;
5050 struct nf_ct_ext_type *t;
51+ size_t alloc_size;
5152
5253 rcu_read_lock();
5354 t = rcu_dereference(nf_ct_ext_types[id]);
5455 BUG_ON(t == NULL);
5556 off = ALIGN(sizeof(struct nf_ct_ext), t->align);
5657 len = off + t->len;
58+ alloc_size = t->alloc_size;
5759 rcu_read_unlock();
5860
59− *ext = kzalloc(t->alloc_size, gfp);
61+ *ext = kzalloc(alloc_size, gfp);
6062 if (!*ext)
6163 return NULL;
6264
net/netfilter/nf_conntrack_sip.c+1−1
@@ -1376,7 +1376,7 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff, · 1375 unmodified lines
13761376 unsigned int msglen, origlen;
13771377 const char *dptr, *end;
13781378 s16 diff, tdiff = 0;
1379− int ret;
1379+ int ret = NF_ACCEPT;
13801380 typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust;
13811381
13821382 if (ctinfo != IP_CT_ESTABLISHED &&
net/netfilter/nf_tproxy_core.c+5−1
@@ -70,7 +70,11 @@ nf_tproxy_destructor(struct sk_buff *skb) · 69 unmodified lines
7070 int
7171 nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk)
7272 {
73− if (inet_sk(sk)->transparent) {
73+ bool transparent = (sk->sk_state == TCP_TIME_WAIT) ?
74+ inet_twsk(sk)->tw_transparent :
75+ inet_sk(sk)->transparent;
76+
77+ if (transparent) {
7478 skb_orphan(skb);
7579 skb->sk = sk;
7680 skb->destructor = nf_tproxy_destructor;
net/phonet/pep.c+2−1
@@ -225,12 +225,13 @@ static void pipe_grant_credits(struct sock *sk) · 224 unmodified lines
225225 static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb)
226226 {
227227 struct pep_sock *pn = pep_sk(sk);
228− struct pnpipehdr *hdr = pnp_hdr(skb);
228+ struct pnpipehdr *hdr;
229229 int wake = 0;
230230
231231 if (!pskb_may_pull(skb, sizeof(*hdr) + 4))
232232 return -EINVAL;
233233
234+ hdr = pnp_hdr(skb);
234235 if (hdr->data[0] != PN_PEP_TYPE_COMMON) {
235236 LIMIT_NETDEBUG(KERN_DEBUG"Phonet unknown PEP type: %u\n",
236237 (unsigned)hdr->data[0]);
net/rds/tcp_connect.c+2−2
@@ -43,7 +43,7 @@ void rds_tcp_state_change(struct sock *sk) · 42 unmodified lines
4343 struct rds_connection *conn;
4444 struct rds_tcp_connection *tc;
4545
46− read_lock(&sk->sk_callback_lock);
46+ read_lock_bh(&sk->sk_callback_lock);
4747 conn = sk->sk_user_data;
4848 if (conn == NULL) {
4949 state_change = sk->sk_state_change;
@@ -68,7 +68,7 @@ void rds_tcp_state_change(struct sock *sk) · 18 unmodified lines
6868 break;
6969 }
7070 out:
71− read_unlock(&sk->sk_callback_lock);
71+ read_unlock_bh(&sk->sk_callback_lock);
7272 state_change(sk);
7373 }
7474
net/rds/tcp_listen.c+2−2
@@ -114,7 +114,7 @@ void rds_tcp_listen_data_ready(struct sock *sk, int bytes) · 113 unmodified lines
114114
115115 rdsdebug("listen data ready sk %p\n", sk);
116116
117− read_lock(&sk->sk_callback_lock);
117+ read_lock_bh(&sk->sk_callback_lock);
118118 ready = sk->sk_user_data;
119119 if (ready == NULL) { /* check for teardown race */
120120 ready = sk->sk_data_ready;
@@ -131,7 +131,7 @@ void rds_tcp_listen_data_ready(struct sock *sk, int bytes) · 10 unmodified lines
131131 queue_work(rds_wq, &rds_tcp_listen_work);
132132
133133 out:
134− read_unlock(&sk->sk_callback_lock);
134+ read_unlock_bh(&sk->sk_callback_lock);
135135 ready(sk, bytes);
136136 }
137137
net/rds/tcp_recv.c+2−2
@@ -324,7 +324,7 @@ void rds_tcp_data_ready(struct sock *sk, int bytes) · 323 unmodified lines
324324
325325 rdsdebug("data ready sk %p bytes %d\n", sk, bytes);
326326
327− read_lock(&sk->sk_callback_lock);
327+ read_lock_bh(&sk->sk_callback_lock);
328328 conn = sk->sk_user_data;
329329 if (conn == NULL) { /* check for teardown race */
330330 ready = sk->sk_data_ready;
@@ -338,7 +338,7 @@ void rds_tcp_data_ready(struct sock *sk, int bytes) · 7 unmodified lines
338338 if (rds_tcp_read_sock(conn, GFP_ATOMIC, KM_SOFTIRQ0) == -ENOMEM)
339339 queue_delayed_work(rds_wq, &conn->c_recv_w, 0);
340340 out:
341− read_unlock(&sk->sk_callback_lock);
341+ read_unlock_bh(&sk->sk_callback_lock);
342342 ready(sk, bytes);
343343 }
344344
net/rds/tcp_send.c+2−2
@@ -224,7 +224,7 @@ void rds_tcp_write_space(struct sock *sk) · 223 unmodified lines
224224 struct rds_connection *conn;
225225 struct rds_tcp_connection *tc;
226226
227− read_lock(&sk->sk_callback_lock);
227+ read_lock_bh(&sk->sk_callback_lock);
228228 conn = sk->sk_user_data;
229229 if (conn == NULL) {
230230 write_space = sk->sk_write_space;
@@ -244,7 +244,7 @@ void rds_tcp_write_space(struct sock *sk) · 13 unmodified lines
244244 queue_delayed_work(rds_wq, &conn->c_send_w, 0);
245245
246246 out:
247− read_unlock(&sk->sk_callback_lock);
247+ read_unlock_bh(&sk->sk_callback_lock);
248248
249249 /*
250250 * write_space is only called when data leaves tcp's send queue if
net/rose/af_rose.c+2−2
@@ -679,7 +679,7 @@ static int rose_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) · 678 unmodified lines
679679 if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1)
680680 return -EINVAL;
681681
682− if (addr->srose_ndigis > ROSE_MAX_DIGIS)
682+ if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS)
683683 return -EINVAL;
684684
685685 if ((dev = rose_dev_get(&addr->srose_addr)) == NULL) {
@@ -739,7 +739,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le · 53 unmodified lines
739739 if (addr_len == sizeof(struct sockaddr_rose) && addr->srose_ndigis > 1)
740740 return -EINVAL;
741741
742− if (addr->srose_ndigis > ROSE_MAX_DIGIS)
742+ if ((unsigned int) addr->srose_ndigis > ROSE_MAX_DIGIS)
743743 return -EINVAL;
744744
745745 /* Source + Destination digis should not exceed ROSE_MAX_DIGIS */
net/sunrpc/xprtsock.c+14−14
@@ -800,7 +800,7 @@ static void xs_udp_data_ready(struct sock *sk, int len) · 799 unmodified lines
800800 u32 _xid;
801801 __be32 *xp;
802802
803− read_lock(&sk->sk_callback_lock);
803+ read_lock_bh(&sk->sk_callback_lock);
804804 dprintk("RPC: xs_udp_data_ready...\n");
805805 if (!(xprt = xprt_from_sock(sk)))
806806 goto out;
@@ -852,7 +852,7 @@ static void xs_udp_data_ready(struct sock *sk, int len) · 45 unmodified lines
852852 dropit:
853853 skb_free_datagram(sk, skb);
854854 out:
855− read_unlock(&sk->sk_callback_lock);
855+ read_unlock_bh(&sk->sk_callback_lock);
856856 }
857857
858858 static inline void xs_tcp_read_fraghdr(struct rpc_xprt *xprt, struct xdr_skb_reader *desc)
@@ -1229,7 +1229,7 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes) · 370 unmodified lines
12291229
12301230 dprintk("RPC: xs_tcp_data_ready...\n");
12311231
1232− read_lock(&sk->sk_callback_lock);
1232+ read_lock_bh(&sk->sk_callback_lock);
12331233 if (!(xprt = xprt_from_sock(sk)))
12341234 goto out;
12351235 if (xprt->shutdown)
@@ -1248,7 +1248,7 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes) · 12 unmodified lines
12481248 read = tcp_read_sock(sk, &rd_desc, xs_tcp_data_recv);
12491249 } while (read > 0);
12501250 out:
1251− read_unlock(&sk->sk_callback_lock);
1251+ read_unlock_bh(&sk->sk_callback_lock);
12521252 }
12531253
12541254 /*
@@ -1301,7 +1301,7 @@ static void xs_tcp_state_change(struct sock *sk) · 46 unmodified lines
13011301 {
13021302 struct rpc_xprt *xprt;
13031303
1304− read_lock(&sk->sk_callback_lock);
1304+ read_lock_bh(&sk->sk_callback_lock);
13051305 if (!(xprt = xprt_from_sock(sk)))
13061306 goto out;
13071307 dprintk("RPC: xs_tcp_state_change client %p...\n", xprt);
@@ -1313,7 +1313,7 @@ static void xs_tcp_state_change(struct sock *sk) · 5 unmodified lines
13131313
13141314 switch (sk->sk_state) {
13151315 case TCP_ESTABLISHED:
1316− spin_lock_bh(&xprt->transport_lock);
1316+ spin_lock(&xprt->transport_lock);
13171317 if (!xprt_test_and_set_connected(xprt)) {
13181318 struct sock_xprt *transport = container_of(xprt,
13191319 struct sock_xprt, xprt);
@@ -1327,7 +1327,7 @@ static void xs_tcp_state_change(struct sock *sk) · 7 unmodified lines
13271327
13281328 xprt_wake_pending_tasks(xprt, -EAGAIN);
13291329 }
1330− spin_unlock_bh(&xprt->transport_lock);
1330+ spin_unlock(&xprt->transport_lock);
13311331 break;
13321332 case TCP_FIN_WAIT1:
13331333 /* The client initiated a shutdown of the socket */
@@ -1365,7 +1365,7 @@ static void xs_tcp_state_change(struct sock *sk) · 31 unmodified lines
13651365 xs_sock_mark_closed(xprt);
13661366 }
13671367 out:
1368− read_unlock(&sk->sk_callback_lock);
1368+ read_unlock_bh(&sk->sk_callback_lock);
13691369 }
13701370
13711371 /**
@@ -1376,7 +1376,7 @@ static void xs_error_report(struct sock *sk) · 4 unmodified lines
13761376 {
13771377 struct rpc_xprt *xprt;
13781378
1379− read_lock(&sk->sk_callback_lock);
1379+ read_lock_bh(&sk->sk_callback_lock);
13801380 if (!(xprt = xprt_from_sock(sk)))
13811381 goto out;
13821382 dprintk("RPC: %s client %p...\n"
@@ -1384,7 +1384,7 @@ static void xs_error_report(struct sock *sk) · 1 unmodified line
13841384 __func__, xprt, sk->sk_err);
13851385 xprt_wake_pending_tasks(xprt, -EAGAIN);
13861386 out:
1387− read_unlock(&sk->sk_callback_lock);
1387+ read_unlock_bh(&sk->sk_callback_lock);
13881388 }
13891389
13901390 static void xs_write_space(struct sock *sk)
@@ -1416,13 +1416,13 @@ static void xs_write_space(struct sock *sk) · 25 unmodified lines
14161416 */
14171417 static void xs_udp_write_space(struct sock *sk)
14181418 {
1419− read_lock(&sk->sk_callback_lock);
1419+ read_lock_bh(&sk->sk_callback_lock);
14201420
14211421 /* from net/core/sock.c:sock_def_write_space */
14221422 if (sock_writeable(sk))
14231423 xs_write_space(sk);
14241424
1425− read_unlock(&sk->sk_callback_lock);
1425+ read_unlock_bh(&sk->sk_callback_lock);
14261426 }
14271427
14281428 /**
@@ -1437,13 +1437,13 @@ static void xs_udp_write_space(struct sock *sk) · 8 unmodified lines
14371437 */
14381438 static void xs_tcp_write_space(struct sock *sk)
14391439 {
1440− read_lock(&sk->sk_callback_lock);
1440+ read_lock_bh(&sk->sk_callback_lock);
14411441
14421442 /* from net/core/stream.c:sk_stream_write_space */
14431443 if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk))
14441444 xs_write_space(sk);
14451445
1446− read_unlock(&sk->sk_callback_lock);
1446+ read_unlock_bh(&sk->sk_callback_lock);
14471447 }
14481448
14491449 static void xs_udp_do_set_buffer_size(struct rpc_xprt *xprt)
net/wireless/wext-priv.c+1−1
@@ -152,7 +152,7 @@ static int ioctl_private_iw_point(struct iw_point *iwp, unsigned int cmd, · 151 unmodified lines
152152 } else if (!iwp->pointer)
153153 return -EFAULT;
154154
155− extra = kmalloc(extra_size, GFP_KERNEL);
155+ extra = kzalloc(extra_size, GFP_KERNEL);
156156 if (!extra)
157157 return -ENOMEM;
158158
net/xfrm/xfrm_policy.c+2−3
@@ -1175,9 +1175,8 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, struct flowi *fl, · 1174 unmodified lines
11751175 tmpl->mode == XFRM_MODE_BEET) {
11761176 remote = &tmpl->id.daddr;
11771177 local = &tmpl->saddr;
1178− family = tmpl->encap_family;
1179− if (xfrm_addr_any(local, family)) {
1180− error = xfrm_get_saddr(net, &tmp, remote, family);
1178+ if (xfrm_addr_any(local, tmpl->encap_family)) {
1179+ error = xfrm_get_saddr(net, &tmp, remote, tmpl->encap_family);
11811180 if (error)
11821181 goto fail;
11831182 local = &tmp;
net/xfrm/xfrm_state.c+27−18
@@ -656,15 +656,23 @@ void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si) · 655 unmodified lines
656656 EXPORT_SYMBOL(xfrm_sad_getinfo);
657657
658658 static int
659−xfrm_init_tempsel(struct xfrm_state *x, struct flowi *fl,
660− struct xfrm_tmpl *tmpl,
661− xfrm_address_t *daddr, xfrm_address_t *saddr,
662− unsigned short family)
659+xfrm_init_tempstate(struct xfrm_state *x, struct flowi *fl,
660+ struct xfrm_tmpl *tmpl,
661+ xfrm_address_t *daddr, xfrm_address_t *saddr,
662+ unsigned short family)
663663 {
664664 struct xfrm_state_afinfo *afinfo = xfrm_state_get_afinfo(family);
665665 if (!afinfo)
666666 return -1;
667− afinfo->init_tempsel(x, fl, tmpl, daddr, saddr);
667+ afinfo->init_tempsel(&x->sel, fl);
668+
669+ if (family != tmpl->encap_family) {
670+ xfrm_state_put_afinfo(afinfo);
671+ afinfo = xfrm_state_get_afinfo(tmpl->encap_family);
672+ if (!afinfo)
673+ return -1;
674+ }
675+ afinfo->init_temprop(x, tmpl, daddr, saddr);
668676 xfrm_state_put_afinfo(afinfo);
669677 return 0;
670678 }
@@ -790,37 +798,38 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, · 119 unmodified lines
790798 int error = 0;
791799 struct xfrm_state *best = NULL;
792800 u32 mark = pol->mark.v & pol->mark.m;
801+ unsigned short encap_family = tmpl->encap_family;
793802
794803 to_put = NULL;
795804
796805 spin_lock_bh(&xfrm_state_lock);
797− h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, family);
806+ h = xfrm_dst_hash(net, daddr, saddr, tmpl->reqid, encap_family);
798807 hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h, bydst) {
799− if (x->props.family == family &&
808+ if (x->props.family == encap_family &&
800809 x->props.reqid == tmpl->reqid &&
801810 (mark & x->mark.m) == x->mark.v &&
802811 !(x->props.flags & XFRM_STATE_WILDRECV) &&
803− xfrm_state_addr_check(x, daddr, saddr, family) &&
812+ xfrm_state_addr_check(x, daddr, saddr, encap_family) &&
804813 tmpl->mode == x->props.mode &&
805814 tmpl->id.proto == x->id.proto &&
806815 (tmpl->id.spi == x->id.spi || !tmpl->id.spi))
807− xfrm_state_look_at(pol, x, fl, family, daddr, saddr,
816+ xfrm_state_look_at(pol, x, fl, encap_family, daddr, saddr,
808817 &best, &acquire_in_progress, &error);
809818 }
810819 if (best)
811820 goto found;
812821
813− h_wildcard = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, family);
822+ h_wildcard = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, encap_family);
814823 hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h_wildcard, bydst) {
815− if (x->props.family == family &&
824+ if (x->props.family == encap_family &&
816825 x->props.reqid == tmpl->reqid &&
817826 (mark & x->mark.m) == x->mark.v &&
818827 !(x->props.flags & XFRM_STATE_WILDRECV) &&
819− xfrm_state_addr_check(x, daddr, saddr, family) &&
828+ xfrm_state_addr_check(x, daddr, saddr, encap_family) &&
820829 tmpl->mode == x->props.mode &&
821830 tmpl->id.proto == x->id.proto &&
822831 (tmpl->id.spi == x->id.spi || !tmpl->id.spi))
823− xfrm_state_look_at(pol, x, fl, family, daddr, saddr,
832+ xfrm_state_look_at(pol, x, fl, encap_family, daddr, saddr,
824833 &best, &acquire_in_progress, &error);
825834 }
826835
@@ -829,7 +838,7 @@ found: · 2 unmodified lines
829838 if (!x && !error && !acquire_in_progress) {
830839 if (tmpl->id.spi &&
831840 (x0 = __xfrm_state_lookup(net, mark, daddr, tmpl->id.spi,
832− tmpl->id.proto, family)) != NULL) {
841+ tmpl->id.proto, encap_family)) != NULL) {
833842 to_put = x0;
834843 error = -EEXIST;
835844 goto out;
@@ -839,9 +848,9 @@ found: · 3 unmodified lines
839848 error = -ENOMEM;
840849 goto out;
841850 }
842− /* Initialize temporary selector matching only
851+ /* Initialize temporary state matching only
843852 * to current session. */
844− xfrm_init_tempsel(x, fl, tmpl, daddr, saddr, family);
853+ xfrm_init_tempstate(x, fl, tmpl, daddr, saddr, family);
845854 memcpy(&x->mark, &pol->mark, sizeof(x->mark));
846855
847856 error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid);
@@ -856,10 +865,10 @@ found: · 8 unmodified lines
856865 x->km.state = XFRM_STATE_ACQ;
857866 list_add(&x->km.all, &net->xfrm.state_all);
858867 hlist_add_head(&x->bydst, net->xfrm.state_bydst+h);
859− h = xfrm_src_hash(net, daddr, saddr, family);
868+ h = xfrm_src_hash(net, daddr, saddr, encap_family);
860869 hlist_add_head(&x->bysrc, net->xfrm.state_bysrc+h);
861870 if (x->id.spi) {
862− h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, family);
871+ h = xfrm_spi_hash(net, &x->id.daddr, x->id.spi, x->id.proto, encap_family);
863872 hlist_add_head(&x->byspi, net->xfrm.state_byspi+h);
864873 }
865874 x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires;
samples/kfifo/dma-example.c+9−8
@@ -24,6 +24,7 @@ static int __init example_init(void) · 23 unmodified lines
2424 {
2525 int i;
2626 unsigned int ret;
27+ unsigned int nents;
2728 struct scatterlist sg[10];
2829
2930 printk(KERN_INFO "DMA fifo test start\n");
@@ -61,9 +62,9 @@ static int __init example_init(void) · 31 unmodified lines
6162 * byte at the beginning, after the kfifo_skip().
6263 */
6364 sg_init_table(sg, ARRAY_SIZE(sg));
64− ret = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE);
65− printk(KERN_INFO "DMA sgl entries: %d\n", ret);
66− if (!ret) {
65+ nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE);
66+ printk(KERN_INFO "DMA sgl entries: %d\n", nents);
67+ if (!nents) {
6768 /* fifo is full and no sgl was created */
6869 printk(KERN_WARNING "error kfifo_dma_in_prepare\n");
6970 return -EIO;
@@ -71,7 +72,7 @@ static int __init example_init(void) · 1 unmodified line
7172
7273 /* receive data */
7374 printk(KERN_INFO "scatterlist for receive:\n");
74− for (i = 0; i < ARRAY_SIZE(sg); i++) {
75+ for (i = 0; i < nents; i++) {
7576 printk(KERN_INFO
7677 "sg[%d] -> "
7778 "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n",
@@ -91,16 +92,16 @@ static int __init example_init(void) · 13 unmodified lines
9192 kfifo_dma_in_finish(&fifo, ret);
9293
9394 /* Prepare to transmit data, example: 8 bytes */
94− ret = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8);
95− printk(KERN_INFO "DMA sgl entries: %d\n", ret);
96− if (!ret) {
95+ nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8);
96+ printk(KERN_INFO "DMA sgl entries: %d\n", nents);
97+ if (!nents) {
9798 /* no data was available and no sgl was created */
9899 printk(KERN_WARNING "error kfifo_dma_out_prepare\n");
99100 return -EIO;
100101 }
101102
102103 printk(KERN_INFO "scatterlist for transmit:\n");
103− for (i = 0; i < ARRAY_SIZE(sg); i++) {
104+ for (i = 0; i < nents; i++) {
104105 printk(KERN_INFO
105106 "sg[%d] -> "
106107 "page_link 0x%.8lx offset 0x%.8x length 0x%.8x\n",
security/tomoyo/common.c+5−1
@@ -1416,15 +1416,19 @@ static char *tomoyo_print_header(struct tomoyo_request_info *r) · 1415 unmodified lines
14161416 const pid_t gpid = task_pid_nr(current);
14171417 static const int tomoyo_buffer_len = 4096;
14181418 char *buffer = kmalloc(tomoyo_buffer_len, GFP_NOFS);
1419+ pid_t ppid;
14191420 if (!buffer)
14201421 return NULL;
14211422 do_gettimeofday(&tv);
1423+ rcu_read_lock();
1424+ ppid = task_tgid_vnr(current->real_parent);
1425+ rcu_read_unlock();
14221426 snprintf(buffer, tomoyo_buffer_len - 1,
14231427 "#timestamp=%lu profile=%u mode=%s (global-pid=%u)"
14241428 " task={ pid=%u ppid=%u uid=%u gid=%u euid=%u"
14251429 " egid=%u suid=%u sgid=%u fsuid=%u fsgid=%u }",
14261430 tv.tv_sec, r->profile, tomoyo_mode[r->mode], gpid,
1427− (pid_t) sys_getpid(), (pid_t) sys_getppid(),
1431+ task_tgid_vnr(current), ppid,
14281432 current_uid(), current_gid(), current_euid(),
14291433 current_egid(), current_suid(), current_sgid(),
14301434 current_fsuid(), current_fsgid());
security/tomoyo/common.h+0−3
@@ -689,9 +689,6 @@ struct tomoyo_profile { · 688 unmodified lines
689689
690690 /********** Function prototypes. **********/
691691
692−extern asmlinkage long sys_getpid(void);
693−extern asmlinkage long sys_getppid(void);
694−
695692 /* Check whether the given string starts with the given keyword. */
696693 bool tomoyo_str_starts(char **src, const char *find);
697694 /* Get tomoyo_realpath() of current process. */
sound/core/control.c+5−0
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131
3232 /* max number of user-defined controls */
3333 #define MAX_USER_CONTROLS 32
34+#define MAX_CONTROL_COUNT 1028
3435
3536 struct snd_kctl_ioctl {
3637 struct list_head list; /* list of all ioctls */
@@ -195,6 +196,10 @@ static struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, · 158 unmodified lines
195196
196197 if (snd_BUG_ON(!control || !control->count))
197198 return NULL;
199+
200+ if (control->count > MAX_CONTROL_COUNT)
201+ return NULL;
202+
198203 kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL);
199204 if (kctl == NULL) {
200205 snd_printk(KERN_ERR "Cannot allocate control instance\n");
sound/i2c/other/ak4xxx-adda.c+1−1
@@ -900,7 +900,7 @@ static int proc_init(struct snd_akm4xxx *ak) · 899 unmodified lines
900900 return 0;
901901 }
902902 #else /* !CONFIG_PROC_FS */
903−static int proc_init(struct snd_akm4xxx *ak) {}
903+static int proc_init(struct snd_akm4xxx *ak) { return 0; }
904904 #endif
905905
906906 int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak)
sound/pci/hda/patch_analog.c+1−0
@@ -3641,6 +3641,7 @@ static struct snd_pci_quirk ad1984_cfg_tbl[] = { · 3640 unmodified lines
36413641 /* Lenovo Thinkpad T61/X61 */
36423642 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo Thinkpad", AD1984_THINKPAD),
36433643 SND_PCI_QUIRK(0x1028, 0x0214, "Dell T3400", AD1984_DELL_DESKTOP),
3644+ SND_PCI_QUIRK(0x1028, 0x0233, "Dell Latitude E6400", AD1984_DELL_DESKTOP),
36443645 {}
36453646 };
36463647
sound/pci/hda/patch_realtek.c+16−6
@@ -1594,12 +1594,22 @@ static void alc_auto_parse_digital(struct hda_codec *codec) · 1593 unmodified lines
15941594 }
15951595
15961596 if (spec->autocfg.dig_in_pin) {
1597− hda_nid_t dig_nid;
1598− err = snd_hda_get_connections(codec,
1599− spec->autocfg.dig_in_pin,
1600− &dig_nid, 1);
1601− if (err > 0)
1602− spec->dig_in_nid = dig_nid;
1597+ dig_nid = codec->start_nid;
1598+ for (i = 0; i < codec->num_nodes; i++, dig_nid++) {
1599+ unsigned int wcaps = get_wcaps(codec, dig_nid);
1600+ if (get_wcaps_type(wcaps) != AC_WID_AUD_IN)
1601+ continue;
1602+ if (!(wcaps & AC_WCAP_DIGITAL))
1603+ continue;
1604+ if (!(wcaps & AC_WCAP_CONN_LIST))
1605+ continue;
1606+ err = get_connection_index(codec, dig_nid,
1607+ spec->autocfg.dig_in_pin);
1608+ if (err >= 0) {
1609+ spec->dig_in_nid = dig_nid;
1610+ break;
1611+ }
1612+ }
16031613 }
16041614 }
16051615
sound/pci/oxygen/oxygen.c+4−0
@@ -543,6 +543,10 @@ static int __devinit get_oxygen_model(struct oxygen *chip, · 542 unmodified lines
543543 chip->model.suspend = claro_suspend;
544544 chip->model.resume = claro_resume;
545545 chip->model.set_adc_params = set_ak5385_params;
546+ chip->model.device_config = PLAYBACK_0_TO_I2S |
547+ PLAYBACK_1_TO_SPDIF |
548+ CAPTURE_0_FROM_I2S_2 |
549+ CAPTURE_1_FROM_SPDIF;
546550 break;
547551 }
548552 if (id->driver_data == MODEL_MERIDIAN ||
sound/pci/rme9652/hdsp.c+1−0
@@ -4609,6 +4609,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne · 4608 unmodified lines
46094609 if (err < 0)
46104610 return err;
46114611
4612+ memset(&info, 0, sizeof(info));
46124613 spin_lock_irqsave(&hdsp->lock, flags);
46134614 info.pref_sync_ref = (unsigned char)hdsp_pref_sync_ref(hdsp);
46144615 info.wordclock_sync_check = (unsigned char)hdsp_wc_sync_check(hdsp);
sound/pci/rme9652/hdspm.c+1−0
@@ -4127,6 +4127,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file, · 4126 unmodified lines
41274127
41284128 case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO:
41294129
4130+ memset(&info, 0, sizeof(info));
41304131 spin_lock_irq(&hdspm->lock);
41314132 info.pref_sync_ref = hdspm_pref_sync_ref(hdspm);
41324133 info.wordclock_sync_check = hdspm_wc_sync_check(hdspm);
sound/soc/sh/migor.c+13−2
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/firmware.h>
1313 #include <linux/module.h>
1414
15+#include <asm/clkdev.h>
1516 #include <asm/clock.h>
1617
1718 #include <cpu/sh7722.h>
@@ -40,12 +41,12 @@ static struct clk_ops siumckb_clk_ops = { · 22 unmodified lines
4041 };
4142
4243 static struct clk siumckb_clk = {
43− .name = "siumckb_clk",
44− .id = -1,
4544 .ops = &siumckb_clk_ops,
4645 .rate = 0, /* initialised at run-time */
4746 };
4847
48+static struct clk_lookup *siumckb_lookup;
49+
4950 static int migor_hw_params(struct snd_pcm_substream *substream,
5051 struct snd_pcm_hw_params *params)
5152 {
@@ -180,6 +181,13 @@ static int __init migor_init(void) · 128 unmodified lines
180181 if (ret < 0)
181182 return ret;
182183
184+ siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL);
185+ if (!siumckb_lookup) {
186+ ret = -ENOMEM;
187+ goto eclkdevalloc;
188+ }
189+ clkdev_add(siumckb_lookup);
190+
183191 /* Port number used on this machine: port B */
184192 migor_snd_device = platform_device_alloc("soc-audio", 1);
185193 if (!migor_snd_device) {
@@ -200,12 +208,15 @@ static int __init migor_init(void) · 14 unmodified lines
200208 epdevadd:
201209 platform_device_put(migor_snd_device);
202210 epdevalloc:
211+ clkdev_drop(siumckb_lookup);
212+eclkdevalloc:
203213 clk_unregister(&siumckb_clk);
204214 return ret;
205215 }
206216
207217 static void __exit migor_exit(void)
208218 {
219+ clkdev_drop(siumckb_lookup);
209220 clk_unregister(&siumckb_clk);
210221 platform_device_unregister(migor_snd_device);
211222 }
sound/soc/soc-cache.c+3−2
@@ -203,8 +203,9 @@ static int snd_soc_8_16_write(struct snd_soc_codec *codec, unsigned int reg, · 202 unmodified lines
203203 data[1] = (value >> 8) & 0xff;
204204 data[2] = value & 0xff;
205205
206− if (!snd_soc_codec_volatile_register(codec, reg))
207− reg_cache[reg] = value;
206+ if (!snd_soc_codec_volatile_register(codec, reg)
207+ && reg < codec->reg_cache_size)
208+ reg_cache[reg] = value;
208209
209210 if (codec->cache_only) {
210211 codec->cache_sync = 1;
virt/kvm/eventfd.c+2−1
@@ -218,7 +218,6 @@ kvm_irqfd_assign(struct kvm *kvm, int fd, int gsi) · 217 unmodified lines
218218 events = file->f_op->poll(file, &irqfd->pt);
219219
220220 list_add_tail(&irqfd->list, &kvm->irqfds.items);
221− spin_unlock_irq(&kvm->irqfds.lock);
222221
223222 /*
224223 * Check if there was an event already pending on the eventfd
@@ -227,6 +226,8 @@ kvm_irqfd_assign(struct kvm *kvm, int fd, int gsi) · 2 unmodified lines
227226 if (events & POLLIN)
228227 schedule_work(&irqfd->inject);
229228
229+ spin_unlock_irq(&kvm->irqfds.lock);
230+
230231 /*
231232 * do not drop the file until the irqfd is fully initialized, otherwise
232233 * we might race against the POLLHUP
virt/kvm/kvm_main.c+3−1
@@ -1970,10 +1970,12 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, · 1969 unmodified lines
19701970
19711971 asmlinkage void kvm_handle_fault_on_reboot(void)
19721972 {
1973− if (kvm_rebooting)
1973+ if (kvm_rebooting) {
19741974 /* spin while reset goes on */
1975+ local_irq_enable();
19751976 while (true)
19761977 ;
1978+ }
19771979 /* Fault while not rebooting. We want the trace. */
19781980 BUG();
19791981 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t