History

Merge commit 'v2.6.39' into for-2.6.40/core

Since for-2.6.40/core was forked off the 2.6.39 devel tree, we've had churn in the core area that makes it difficult to handle patches for eg cfq or blk-throttle. Instead of requiring that they be based in older versions with bugs that have been fixed later in the rc cycle, merge in 2.6.39 final. Also fixes up conflicts in the below files. Conflicts: drivers/block/paride/pcd.c drivers/cdrom/viocd.c drivers/ide/ide-cd.c

Jens Axboe committed 15 years ago

Commit 698567f2 parents d70d071 61c4f2c802 files · +8458 −4459Browse files

Unified · Split

802 files
  1. Documentation/DocBook/media-entities.tmpl +1 −0
  2. Documentation/DocBook/v4l/media-ioc-setup-link.xml +1 −1
  3. Documentation/DocBook/v4l/pixfmt-y12.xml +79 −0
  4. Documentation/DocBook/v4l/pixfmt.xml +1 −0
  5. Documentation/DocBook/v4l/subdev-formats.xml +59 −0
  6. Documentation/cgroups/memory.txt +13 −2
  7. Documentation/flexible-arrays.txt +2 −2
  8. Documentation/hwmon/adm1021 +19 −17
  9. Documentation/hwmon/lm90 +20 −9
  10. Documentation/hwmon/max16064 +62 −0
  11. Documentation/hwmon/max34440 +79 −0
  12. Documentation/hwmon/max8688 +69 −0
  13. Documentation/hwmon/pmbus +8 −26
  14. Documentation/hwmon/smm665 +4 −4
  15. Documentation/hwmon/submitting-patches +109 −0
  16. Documentation/md.txt +10 −0
  17. Documentation/sound/alsa/SB-Live-mixer.txt +3 −3
  18. Documentation/video4linux/sh_mobile_ceu_camera.txt +3 −3
  19. Documentation/workqueue.txt +40 −0
  20. MAINTAINERS +58 −56
  21. Makefile +1 −1
  22. arch/alpha/include/asm/unistd.h +5 −1
  23. arch/alpha/kernel/systbls.S +8 −4
  24. arch/alpha/kernel/time.c +1 −2
  25. arch/arm/boot/compressed/Makefile +1 −1
  26. arch/arm/boot/compressed/head.S +24 −11
  27. arch/arm/boot/compressed/vmlinux.lds.in +1 −0
  28. arch/arm/configs/at91x40_defconfig +48 −0
  29. arch/arm/include/asm/cputype.h +1 −0
  30. arch/arm/include/asm/kprobes.h +3 −0
  31. arch/arm/include/asm/system.h +1 −1
  32. arch/arm/include/asm/unistd.h +4 −0
  33. arch/arm/kernel/calls.S +4 −0
  34. arch/arm/kernel/kprobes-decode.c +457 −320
  35. arch/arm/kernel/kprobes.c +2 −1
  36. arch/arm/kernel/perf_event.c +2 −1
  37. arch/arm/kernel/ptrace.c +8 −0
  38. arch/arm/kernel/signal.c +53 −37
  39. arch/arm/kernel/smp.c +1 −1
  40. arch/arm/kernel/sys_oabi-compat.c +1 −1
  41. arch/arm/mach-at91/Kconfig +1 −0
  42. arch/arm/mach-at91/board-eb01.c +6 −1
  43. arch/arm/mach-at91/include/mach/cpu.h +28 −0
  44. arch/arm/mach-davinci/Kconfig +6 −0
  45. arch/arm/mach-davinci/board-mityomapl138.c +2 −2
  46. arch/arm/mach-davinci/devices-da8xx.c +9 −3
  47. arch/arm/mach-davinci/dm355.c +1 −1
  48. arch/arm/mach-davinci/dm644x.c +1 −1
  49. arch/arm/mach-davinci/include/mach/debug-macro.S +8 −5
  50. arch/arm/mach-davinci/include/mach/serial.h +1 −1
  51. arch/arm/mach-mx3/mach-vpr200.c +8 −3
  52. arch/arm/mach-mx5/board-mx53_loco.c +1 −1
  53. arch/arm/mach-mxs/clock-mx28.c +6 −1
  54. arch/arm/mach-omap2/Makefile +1 −1
  55. arch/arm/mach-omap2/board-rx51.c +7 −2
  56. arch/arm/mach-omap2/clkt34xx_dpll3m2.c +1 −0
  57. arch/arm/mach-omap2/clock44xx_data.c +2 −7
  58. arch/arm/mach-omap2/cm2xxx_3xxx.c +17 −0
  59. arch/arm/mach-omap2/control.c +7 −1
  60. arch/arm/mach-omap2/omap_hwmod_2420_data.c +5 −1
  61. arch/arm/mach-omap2/omap_hwmod_2430_data.c +6 −1
  62. arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +7 −1
  63. arch/arm/mach-omap2/omap_hwmod_44xx_data.c +1 −1
  64. arch/arm/mach-omap2/omap_l3_smx.c +2 −2
  65. arch/arm/mach-omap2/pm.c +1 −0
  66. arch/arm/mach-omap2/voltage.c +0 −1
  67. arch/arm/mach-pxa/hx4700.c +1 −1
  68. arch/arm/mach-pxa/magician.c +1 −1
  69. arch/arm/mach-realview/include/mach/barriers.h +1 −1
  70. arch/arm/mach-s3c2440/mach-gta02.c +5 −0
  71. arch/arm/mach-tegra/include/mach/barriers.h +1 −1
  72. arch/arm/mach-ux500/board-mop500.c +10 −9
  73. arch/arm/mm/init.c +15 −1
  74. arch/arm/mm/proc-xscale.S +1 −1
  75. arch/arm/plat-mxc/gpio.c +7 −0
  76. arch/arm/plat-mxc/ssi-fiq.S +2 −0
  77. arch/arm/plat-omap/iommu.c +2 −0
  78. arch/m68k/mm/motorola.c +2 −0
  79. arch/mips/Kconfig +0 −5
  80. arch/mips/alchemy/devboards/db1x00/board_setup.c +33 −28
  81. arch/mips/alchemy/xxs1500/init.c +2 −3
  82. arch/mips/ar7/gpio.c +1 −3
  83. arch/mips/boot/compressed/calc_vmlinuz_load_addr.c +1 −1
  84. arch/mips/cavium-octeon/Kconfig +4 −11
  85. arch/mips/include/asm/cache.h +1 −1
  86. arch/mips/include/asm/cevt-r4k.h +3 −0
  87. arch/mips/include/asm/dma-mapping.h +2 −0
  88. arch/mips/include/asm/hugetlb.h +1 −0
  89. arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h +1 −1
  90. arch/mips/jazz/jazzdma.c +2 −3
  91. arch/mips/jz4740/dma.c +1 −3
  92. arch/mips/jz4740/time.c +1 −1
  93. arch/mips/jz4740/timer.c +2 −0
  94. arch/mips/kernel/ftrace.c +3 −2
  95. arch/mips/kernel/ptrace.c +2 −2
  96. arch/mips/kernel/scall32-o32.S +1 −1
  97. arch/mips/kernel/scall64-64.S +1 −1
  98. arch/mips/kernel/scall64-n32.S +1 −1
  99. arch/mips/kernel/scall64-o32.S +1 −1
  100. arch/mips/kernel/traps.c +2 −4
  101. arch/mips/kernel/vmlinux.lds.S +1 −0
  102. arch/mips/loongson/common/env.c +3 −2
  103. arch/mips/mm/c-r4k.c +0 −2
  104. arch/mips/mm/tlbex.c +2 −2
  105. arch/mips/mti-malta/malta-init.c +3 −11
  106. arch/mips/mti-malta/malta-int.c +1 −2
  107. arch/mips/pmc-sierra/msp71xx/msp_irq_per.c +1 −1
  108. arch/mips/power/hibernate.S +1 −1
  109. arch/mips/rb532/gpio.c +1 −1
  110. arch/mips/sgi-ip22/ip22-platform.c +2 −2
  111. arch/mips/sgi-ip22/ip22-time.c +2 −2
  112. arch/mips/sgi-ip27/ip27-hubio.c +1 −2
  113. arch/mips/sgi-ip27/ip27-klnuma.c +0 −3
  114. arch/mips/sni/time.c +2 −2
  115. arch/parisc/mm/init.c +3 −1
  116. arch/powerpc/include/asm/8xx_immap.h +2 −2
  117. arch/powerpc/include/asm/uninorth.h +1 −1
  118. arch/powerpc/kernel/ptrace.c +11 −1
  119. arch/powerpc/platforms/83xx/suspend.c +5 −2
  120. arch/powerpc/sysdev/fsl_msi.c +5 −2
  121. arch/s390/crypto/prng.c +1 −1
  122. arch/s390/include/asm/diag.h +15 −2
  123. arch/s390/include/asm/mmu_context.h +1 −1
  124. arch/s390/kernel/diag.c +0 −21
  125. arch/s390/kernel/dis.c +1 −0
  126. arch/s390/kernel/entry.S +1 −1
  127. arch/s390/kernel/entry64.S +1 −1
  128. arch/s390/kvm/sie64a.S +2 −2
  129. arch/s390/mm/cmm.c +1 −1
  130. arch/s390/mm/fault.c +3 −3
  131. arch/s390/mm/pageattr.c +3 −2
  132. arch/s390/oprofile/hwsampler.c +4 −10
  133. arch/s390/oprofile/hwsampler.h +2 −2
  134. arch/s390/oprofile/init.c +2 −6
  135. arch/sh/kernel/ptrace_32.c +4 −0
  136. arch/sparc/kernel/apc.c +1 −1
  137. arch/sparc/kernel/pci_sabre.c +4 −1
  138. arch/sparc/kernel/pci_schizo.c +6 −2
  139. arch/sparc/kernel/pmc.c +1 −1
  140. arch/sparc/kernel/smp_32.c +7 −3
  141. arch/sparc/kernel/time_32.c +1 −1
  142. arch/sparc/lib/checksum_32.S +9 −3
  143. arch/um/Kconfig.um +1 −1
  144. arch/um/include/asm/thread_info.h +4 −1
  145. arch/um/os-Linux/util.c +22 −1
  146. arch/um/sys-i386/Makefile +1 −1
  147. arch/um/sys-i386/atomic64_cx8_32.S +225 −0
  148. arch/x86/boot/memory.c +1 −1
  149. arch/x86/include/asm/apicdef.h +1 −0
  150. arch/x86/include/asm/gart.h +12 −12
  151. arch/x86/include/asm/io_apic.h +1 −1
  152. arch/x86/include/asm/numa.h +1 −1
  153. arch/x86/include/asm/pgtable_types.h +1 −0
  154. arch/x86/include/asm/uv/uv_bau.h +13 −4
  155. arch/x86/include/asm/uv/uv_hub.h +2 −0
  156. arch/x86/include/asm/uv/uv_mmrs.h +15 −1
  157. arch/x86/include/asm/x86_init.h +12 −0
  158. arch/x86/kernel/aperture_64.c +1 −1
  159. arch/x86/kernel/apic/io_apic.c +5 −5
  160. arch/x86/kernel/apic/x2apic_uv_x.c +43 −5
  161. arch/x86/kernel/apm_32.c +5 −0
  162. arch/x86/kernel/cpu/amd.c +1 −1
  163. arch/x86/kernel/cpu/mcheck/mce_amd.c +1 −0
  164. arch/x86/kernel/cpu/mcheck/therm_throt.c +7 −5
  165. arch/x86/kernel/cpu/perf_event.c +17 −5
  166. arch/x86/kernel/cpu/perf_event_amd.c +18 −4
  167. arch/x86/kernel/cpu/perf_event_intel.c +84 −41
  168. arch/x86/kernel/cpu/perf_event_p4.c +14 −5
  169. arch/x86/kernel/devicetree.c +1 −1
  170. arch/x86/kernel/kprobes.c +3 −2
  171. arch/x86/kernel/pci-gart_64.c +8 −1
  172. arch/x86/kernel/ptrace.c +26 −10
  173. arch/x86/kernel/reboot_32.S +6 −6
  174. arch/x86/kernel/smpboot.c +0 −23
  175. arch/x86/kernel/x86_init.c +4 −0
  176. arch/x86/mm/init.c +22 −2
  177. arch/x86/mm/numa.c +13 −18
  178. arch/x86/mm/numa_64.c +1 −1
  179. arch/x86/mm/numa_emulation.c +6 −14
  180. arch/x86/platform/ce4100/falconfalls.dts +3 −3
  181. arch/x86/platform/uv/tlb_uv.c +63 −29
  182. arch/x86/xen/mmu.c +25 −5
  183. arch/x86/xen/setup.c +1 −1
  184. arch/xtensa/kernel/irq.c +6 −12
  185. block/blk-cgroup.c +7 −0
  186. block/blk-cgroup.h +3 −0
  187. block/blk-core.c +5 −12
  188. block/blk-sysfs.c +5 −3
  189. block/blk-throttle.c +4 −5
  190. block/blk.h +0 −1
  191. block/cfq-iosched.c +11 −20
  192. block/elevator.c +2 −1
  193. block/genhd.c +6 −2
  194. drivers/acpi/scan.c +4 −0
  195. drivers/ata/ahci.c +7 −1
  196. drivers/ata/ahci.h +4 −0
  197. drivers/ata/ata_piix.c +8 −0
  198. drivers/ata/libahci.c +37 −2
  199. drivers/ata/libata-core.c +2 −1
  200. drivers/ata/libata-eh.c +4 −2
  201. drivers/ata/pata_at91.c +19 −3
  202. drivers/atm/fore200e.c +5 −2
  203. drivers/base/power/main.c +1 −0
  204. drivers/base/power/wakeup.c +1 −1
  205. drivers/base/syscore.c +2 −0
  206. drivers/block/DAC960.c +0 −1
  207. drivers/block/amiflop.c +0 −1
  208. drivers/block/ataflop.c +0 −1
  209. drivers/block/floppy.c +0 −1
  210. drivers/block/paride/pd.c +0 −1
  211. drivers/block/paride/pf.c +0 −1
  212. drivers/block/rbd.c +158 −23
  213. drivers/block/swim.c +0 −1
  214. drivers/block/swim3.c +0 −1
  215. drivers/block/ub.c +0 −1
  216. drivers/block/xsysace.c +0 −1
  217. drivers/cdrom/gdrom.c +0 −1
  218. drivers/char/agp/generic.c +15 −4
  219. drivers/char/hw_random/n2-drv.c +5 −2
  220. drivers/char/ipmi/ipmi_si_intf.c +5 −2
  221. drivers/char/virtio_console.c +0 −11
  222. drivers/char/xilinx_hwicap/xilinx_hwicap.c +9 −5
  223. drivers/clk/clkdev.c +9 −10
  224. drivers/connector/connector.c +1 −0
  225. drivers/edac/amd64_edac.c +78 −10
  226. drivers/edac/amd64_edac.h +3 −0
  227. drivers/edac/edac_mc_sysfs.c +5 −6
  228. drivers/edac/ppc4xx_edac.c +1 −1
  229. drivers/firewire/ohci.c +25 −14
  230. drivers/gpu/drm/Kconfig +1 −0
  231. drivers/gpu/drm/drm_fb_helper.c +42 −11
  232. drivers/gpu/drm/drm_irq.c +23 −0
  233. drivers/gpu/drm/drm_mm.c +3 −3
  234. drivers/gpu/drm/i915/i915_dma.c +1 −1
  235. drivers/gpu/drm/i915/i915_drv.c +1 −1
  236. drivers/gpu/drm/i915/intel_display.c +45 −36
  237. drivers/gpu/drm/i915/intel_dp.c +15 −2
  238. drivers/gpu/drm/i915/intel_drv.h +1 −0
  239. drivers/gpu/drm/i915/intel_fb.c +10 −0
  240. drivers/gpu/drm/i915/intel_lvds.c +3 −0
  241. drivers/gpu/drm/i915/intel_tv.c +5 −4
  242. drivers/gpu/drm/nouveau/nouveau_dma.c +1 −1
  243. drivers/gpu/drm/nouveau/nouveau_drv.h +3 −0
  244. drivers/gpu/drm/nouveau/nouveau_fbcon.c +2 −2
  245. drivers/gpu/drm/nouveau/nouveau_mem.c +1 −3
  246. drivers/gpu/drm/nouveau/nouveau_notifier.c +7 −4
  247. drivers/gpu/drm/nouveau/nouveau_object.c +6 −4
  248. drivers/gpu/drm/nouveau/nouveau_sgdma.c +5 −3
  249. drivers/gpu/drm/nouveau/nouveau_state.c +6 −0
  250. drivers/gpu/drm/nouveau/nv50_instmem.c +6 −4
  251. drivers/gpu/drm/nouveau/nv50_vm.c +3 −2
  252. drivers/gpu/drm/nouveau/nvc0_vm.c +3 −2
  253. drivers/gpu/drm/radeon/atom.c +3 −3
  254. drivers/gpu/drm/radeon/atombios_crtc.c +1 −5
  255. drivers/gpu/drm/radeon/evergreen.c +58 −55
  256. drivers/gpu/drm/radeon/evergreend.h +6 −0
  257. drivers/gpu/drm/radeon/ni.c +9 −9
  258. drivers/gpu/drm/radeon/r600.c +1 −1
  259. drivers/gpu/drm/radeon/radeon_atombios.c +16 −7
  260. drivers/gpu/drm/radeon/radeon_atpx_handler.c +27 −2
  261. drivers/gpu/drm/radeon/radeon_connectors.c +12 −17
  262. drivers/gpu/drm/radeon/radeon_cursor.c +3 −3
  263. drivers/gpu/drm/radeon/radeon_gart.c +3 −3
  264. drivers/gpu/drm/radeon/radeon_i2c.c +6 −0
  265. drivers/gpu/drm/radeon/radeon_kms.c +16 −0
  266. drivers/gpu/drm/radeon/reg_srcs/cayman +1 −0
  267. drivers/gpu/drm/radeon/reg_srcs/evergreen +1 −0
  268. drivers/gpu/drm/radeon/reg_srcs/r600 +1 −0
  269. drivers/gpu/vga/vga_switcheroo.c +3 −3
  270. drivers/hwmon/Kconfig +5 −6
  271. drivers/hwmon/lm85.c +4 −2
  272. drivers/hwmon/lm90.c +15 −7
  273. drivers/hwmon/pmbus_core.c +0 −1
  274. drivers/hwmon/twl4030-madc-hwmon.c +1 −2
  275. drivers/i2c/busses/i2c-i801.c +5 −0
  276. drivers/i2c/busses/i2c-mpc.c +6 −3
  277. drivers/i2c/busses/i2c-parport.c +14 −13
  278. drivers/i2c/busses/i2c-pnx.c +1 −1
  279. drivers/ide/ide-cd_ioctl.c +6 −0
  280. drivers/ide/ide-gd.c +6 −1
  281. drivers/infiniband/hw/qib/qib_iba6120.c +1 −1
  282. drivers/infiniband/hw/qib/qib_iba7220.c +1 −1
  283. drivers/infiniband/hw/qib/qib_iba7322.c +1 −1
  284. drivers/input/touchscreen/ads7846.c +10 −3
  285. drivers/input/touchscreen/wm831x-ts.c +64 −11
  286. drivers/leds/leds-lm3530.c +1 −0
  287. drivers/md/md.c +1 −0
  288. drivers/md/raid5.c +4 −1
  289. drivers/media/common/tuners/tda18271-common.c +1 −10
  290. drivers/media/common/tuners/tda18271-fe.c +11 −10
  291. drivers/media/common/tuners/tda18271-maps.c +6 −6
  292. drivers/media/dvb/b2c2/flexcop-pci.c +1 −1
  293. drivers/media/dvb/dvb-usb/Kconfig +4 −2
  294. drivers/media/dvb/dvb-usb/dib0700_devices.c +3 −3
  295. drivers/media/dvb/ngene/ngene-core.c +1 −0
  296. drivers/media/media-entity.c +6 −2
  297. drivers/media/radio/radio-sf16fmr2.c +1 −1
  298. drivers/media/radio/saa7706h.c +1 −1
  299. drivers/media/radio/tef6862.c +1 −1
  300. drivers/media/rc/imon.c +27 −4
  301. drivers/media/rc/ite-cir.c +1 −0
  302. drivers/media/rc/mceusb.c +2 −0
  303. drivers/media/rc/rc-main.c +3 −1
  304. drivers/media/video/Kconfig +1 −1
  305. drivers/media/video/cx18/cx18-streams.c +9 −1
  306. drivers/media/video/cx23885/Kconfig +1 −0
  307. drivers/media/video/cx88/cx88-input.c +1 −1
  308. drivers/media/video/imx074.c +1 −1
  309. drivers/media/video/m52790.c +1 −1
  310. drivers/media/video/omap3isp/isp.c +25 −9
  311. drivers/media/video/omap3isp/isp.h +6 −6
  312. drivers/media/video/omap3isp/ispccdc.c +30 −7
  313. drivers/media/video/omap3isp/isppreview.c +1 −1
  314. drivers/media/video/omap3isp/ispqueue.c +3 −3
  315. drivers/media/video/omap3isp/ispresizer.c +60 −15
  316. drivers/media/video/omap3isp/ispstat.h +3 −3
  317. drivers/media/video/omap3isp/ispvideo.c +94 −14
  318. drivers/media/video/omap3isp/ispvideo.h +3 −0
  319. drivers/media/video/s5p-fimc/fimc-capture.c +5 −3
  320. drivers/media/video/s5p-fimc/fimc-core.c +47 −27
  321. drivers/media/video/sh_mobile_ceu_camera.c +5 −5
  322. drivers/media/video/sh_mobile_csi2.c +9 −2
  323. drivers/media/video/soc_camera.c +47 −8
  324. drivers/media/video/tda9840.c +1 −1
  325. drivers/media/video/tea6415c.c +1 −1
  326. drivers/media/video/tea6420.c +1 −1
  327. drivers/media/video/upd64031a.c +1 −1
  328. drivers/media/video/upd64083.c +1 −1
  329. drivers/media/video/v4l2-dev.c +10 −5
  330. drivers/media/video/v4l2-device.c +4 −1
  331. drivers/media/video/v4l2-subdev.c +7 −7
  332. drivers/media/video/videobuf-dma-contig.c +1 −1
  333. drivers/media/video/videobuf2-core.c +12 −5
  334. drivers/media/video/videobuf2-dma-contig.c +1 −1
  335. drivers/message/i2o/i2o_block.c +0 −1
  336. drivers/mfd/asic3.c +1 −1
  337. drivers/mfd/omap-usb-host.c +7 −10
  338. drivers/mfd/twl4030-power.c +2 −1
  339. drivers/mmc/core/bus.c +1 −0
  340. drivers/mmc/host/omap.c +1 −1
  341. drivers/mmc/host/sdhci-of-core.c +5 −2
  342. drivers/mmc/host/sdhci-pci.c +1 −0
  343. drivers/mmc/host/sdhci.c +8 −1
  344. drivers/mmc/host/tmio_mmc_pio.c +5 −5
  345. drivers/mtd/maps/physmap_of.c +5 −2
  346. drivers/mtd/nand/diskonchip.c +1 −1
  347. drivers/net/Kconfig +7 −1
  348. drivers/net/Makefile +3 −3
  349. drivers/net/amd8111e.c +1 −1
  350. drivers/net/arm/etherh.c +2 −2
  351. drivers/net/atl1c/atl1c.h +3 −3
  352. drivers/net/atl1c/atl1c_main.c +5 −9
  353. drivers/net/benet/be.h +1 −1
  354. drivers/net/benet/be_cmds.c +1 −1
  355. drivers/net/benet/be_main.c +13 −6
  356. drivers/net/bna/bfa_ioc.c +18 −13
  357. drivers/net/bna/bfa_ioc.h +1 −0
  358. drivers/net/bna/bfa_ioc_ct.c +28 −0
  359. drivers/net/bna/bfi.h +4 −2
  360. drivers/net/bna/bnad.c +0 −1
  361. drivers/net/bnx2.c +2 −0
  362. drivers/net/bnx2x/bnx2x_cmn.c +24 −10
  363. drivers/net/bnx2x/bnx2x_ethtool.c +4 −5
  364. drivers/net/bonding/bond_3ad.c +5 −2
  365. drivers/net/bonding/bond_3ad.h +5 −5
  366. drivers/net/bonding/bond_alb.c +3 −3
  367. drivers/net/bonding/bond_alb.h +1 −3
  368. drivers/net/can/mscan/mpc5xxx_can.c +5 −2
  369. drivers/net/can/sja1000/sja1000.c +1 −1
  370. drivers/net/can/slcan.c +3 −1
  371. drivers/net/ehea/ehea_ethtool.c +13 −8
  372. drivers/net/ehea/ehea_main.c +9 −6
  373. drivers/net/fs_enet/fs_enet-main.c +6 −3
  374. drivers/net/fs_enet/mac-fec.c +4 −4
  375. drivers/net/fs_enet/mii-fec.c +5 −2
  376. drivers/net/ftmac100.c +4 −4
  377. drivers/net/hydra.c +7 −7
  378. drivers/net/loopback.c +2 −1
  379. drivers/net/mii.c +4 −0
  380. drivers/net/natsemi.c +3 −0
  381. drivers/net/ne-h8300.c +8 −8
  382. drivers/net/netconsole.c +8 −0
  383. drivers/net/netxen/netxen_nic.h +2 −2
  384. drivers/net/netxen/netxen_nic_main.c +17 −0
  385. drivers/net/pch_gbe/pch_gbe_main.c +16 −7
  386. drivers/net/qlcnic/qlcnic.h +1 −0
  387. drivers/net/qlcnic/qlcnic_main.c +14 −0
  388. drivers/net/r8169.c +71 −28
  389. drivers/net/sfc/efx.c +4 −2
  390. drivers/net/sfc/io.h +2 −0
  391. drivers/net/sfc/mcdi.c +30 −19
  392. drivers/net/sfc/net_driver.h +0 −2
  393. drivers/net/sfc/nic.c +22 −7
  394. drivers/net/sfc/nic.h +3 −0
  395. drivers/net/sfc/selftest.c +6 −19
  396. drivers/net/sfc/siena.c +21 −4
  397. drivers/net/sfc/tx.c +2 −1
  398. drivers/net/sis900.c +19 −4
  399. drivers/net/slip.c +3 −1
  400. drivers/net/stmmac/dwmac_lib.c +14 −14
  401. drivers/net/stmmac/stmmac_main.c +28 −21
  402. drivers/net/sunhme.c +5 −2
  403. drivers/net/tg3.c +6 −2
  404. drivers/net/tokenring/3c359.c +2 −2
  405. drivers/net/tokenring/lanstreamer.c +1 −1
  406. drivers/net/tokenring/olympic.c +1 −1
  407. drivers/net/usb/cdc_ether.c +13 −3
  408. drivers/net/usb/cdc_ncm.c +2 −2
  409. drivers/net/usb/ipheth.c +9 −5
  410. drivers/net/usb/smsc95xx.c +1 −1
  411. drivers/net/usb/usbnet.c +15 −3
  412. drivers/net/veth.c +12 −0
  413. drivers/net/vmxnet3/vmxnet3_drv.c +6 −4
  414. drivers/net/vmxnet3/vmxnet3_ethtool.c +3 −0
  415. drivers/net/wireless/ath/ath9k/hif_usb.c +2 −2
  416. drivers/net/wireless/ath/ath9k/hw.c +0 −9
  417. drivers/net/wireless/ath/ath9k/mac.c +22 −3
  418. drivers/net/wireless/ath/ath9k/mac.h +1 −1
  419. drivers/net/wireless/ath/ath9k/main.c +18 −2
  420. drivers/net/wireless/ath/ath9k/recv.c +3 −3
  421. drivers/net/wireless/ath/regd_common.h +1 −0
  422. drivers/net/wireless/b43/main.c +1 −0
  423. drivers/net/wireless/iwlegacy/Kconfig +5 −4
  424. drivers/net/wireless/iwlegacy/iwl-3945-hw.h +0 −2
  425. drivers/net/wireless/iwlegacy/iwl-4965-hw.h +0 −3
  426. drivers/net/wireless/iwlegacy/iwl-4965-tx.c +19 −9
  427. drivers/net/wireless/iwlegacy/iwl-core.c +18 −6
  428. drivers/net/wireless/iwlegacy/iwl-dev.h +6 −0
  429. drivers/net/wireless/iwlegacy/iwl-eeprom.c +0 −7
  430. drivers/net/wireless/iwlegacy/iwl-led.c +19 −1
  431. drivers/net/wireless/iwlegacy/iwl3945-base.c +0 −4
  432. drivers/net/wireless/iwlegacy/iwl4965-base.c +4 −10
  433. drivers/net/wireless/iwlwifi/iwl-5000.c +3 −0
  434. drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +1 −6
  435. drivers/net/wireless/iwlwifi/iwl-agn-tx.c +18 −9
  436. drivers/net/wireless/libertas/cmd.c +4 −2
  437. drivers/net/wireless/mwl8k.c +8 −1
  438. drivers/net/wireless/p54/txrx.c +1 −1
  439. drivers/net/zorro8390.c +6 −6
  440. drivers/parport/parport_pc.c +3 −5
  441. drivers/pci/Kconfig +3 −1
  442. drivers/pci/Makefile +2 −2
  443. drivers/pci/intel-iommu.c +43 −12
  444. drivers/pci/setup-bus.c +2 −2
  445. drivers/pcmcia/pcmcia_resource.c +1 −1
  446. drivers/platform/x86/eeepc-laptop.c +41 −16
  447. drivers/platform/x86/sony-laptop.c +105 −25
  448. drivers/platform/x86/thinkpad_acpi.c +4 −2
  449. drivers/rapidio/switches/idt_gen2.c +9 −0
  450. drivers/rapidio/switches/idtcps.c +6 −0
  451. drivers/rapidio/switches/tsi57x.c +6 −0
  452. drivers/rtc/rtc-coh901331.c +2 −2
  453. drivers/rtc/rtc-davinci.c +3 −2
  454. drivers/rtc/rtc-ds1286.c +1 −1
  455. drivers/rtc/rtc-ep93xx.c +2 −3
  456. drivers/rtc/rtc-m41t80.c +3 −2
  457. drivers/rtc/rtc-max8925.c +5 −3
  458. drivers/rtc/rtc-max8998.c +3 −2
  459. drivers/rtc/rtc-mc13xxx.c +6 −2
  460. drivers/rtc/rtc-msm6242.c +2 −1
  461. drivers/rtc/rtc-mxc.c +11 −8
  462. drivers/rtc/rtc-omap.c +1 −1
  463. drivers/rtc/rtc-pcap.c +3 −1
  464. drivers/rtc/rtc-rp5c01.c +3 −2
  465. drivers/rtc/rtc-s3c.c +10 −3
  466. drivers/s390/block/dasd.c +32 −19
  467. drivers/s390/block/dasd_devmap.c +30 −0
  468. drivers/s390/block/dasd_diag.c +1 −1
  469. drivers/s390/block/dasd_eckd.c +3 −2
  470. drivers/s390/block/dasd_genhd.c +1 −1
  471. drivers/s390/block/dasd_int.h +3 −0
  472. drivers/s390/block/dasd_ioctl.c +87 −41
  473. drivers/s390/char/sclp_cmd.c +2 −0
  474. drivers/s390/char/tape_block.c +0 −1
  475. drivers/s390/cio/qdio_main.c +12 −5
  476. drivers/s390/kvm/kvm_virtio.c +1 −1
  477. drivers/scsi/device_handler/scsi_dh.c +6 −3
  478. drivers/scsi/mpt2sas/mpt2sas_ctl.c +21 −2
  479. drivers/scsi/pmcraid.c +3 −0
  480. drivers/scsi/qlogicpti.c +5 −2
  481. drivers/scsi/scsi_lib.c +17 −15
  482. drivers/scsi/scsi_scan.c +2 −0
  483. drivers/scsi/scsi_sysfs.c +8 −8
  484. drivers/scsi/scsi_transport_fc.c +4 −15
  485. drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +0 −4
  486. drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c +0 −3
  487. drivers/staging/gma500/Kconfig +1 −1
  488. drivers/staging/intel_sst/intelmid_v1_control.c +1 −0
  489. drivers/staging/intel_sst/intelmid_v2_control.c +1 −0
  490. drivers/staging/olpc_dcon/olpc_dcon_xo_1.c +1 −0
  491. drivers/staging/rt2860/common/cmm_data_pci.c +1 −1
  492. drivers/staging/rt2860/common/cmm_data_usb.c +1 −1
  493. drivers/staging/rts_pstor/debug.h +1 −1
  494. drivers/staging/rts_pstor/ms.c +1 −0
  495. drivers/staging/rts_pstor/rtsx_chip.c +3 −2
  496. drivers/staging/rts_pstor/rtsx_scsi.c +1 −0
  497. drivers/staging/rts_pstor/sd.c +2 −2
  498. drivers/staging/rts_pstor/trace.h +1 −1
  499. drivers/staging/rts_pstor/xd.c +1 −0
  500. drivers/staging/solo6x10/Kconfig +1 −0
  501. drivers/staging/spectra/ffsport.c +1 −1
  502. drivers/staging/tidspbridge/dynload/cload.c +1 −1
  503. drivers/staging/tty/specialix.c +1 −1
  504. drivers/staging/usbip/vhci_hcd.c +5 −6
  505. drivers/staging/usbip/vhci_sysfs.c +4 −3
  506. drivers/staging/wlan-ng/cfg80211.c +1 −1
  507. drivers/tty/n_gsm.c +6 −2
  508. drivers/tty/serial/imx.c +2 −1
  509. drivers/tty/serial/of_serial.c +5 −2
  510. drivers/usb/gadget/fsl_qe_udc.c +5 −2
  511. drivers/usb/host/ehci-omap.c +20 −0
  512. drivers/usb/host/isp1760-hcd.c +1 −0
  513. drivers/usb/host/xhci-hub.c +17 −2
  514. drivers/usb/musb/musb_gadget.c +2 −4
  515. drivers/usb/musb/omap2430.c +1 −1
  516. drivers/video/acornfb.c +10 −16
  517. drivers/video/fbmem.c +148 −75
  518. drivers/virtio/virtio_pci.c +8 −7
  519. drivers/virtio/virtio_ring.c +1 −0
  520. drivers/watchdog/iTCO_wdt.c +97 −0
  521. drivers/watchdog/mpc8xxx_wdt.c +5 −2
  522. drivers/xen/manage.c +8 −1
  523. fs/btrfs/acl.c +3 −2
  524. fs/btrfs/ctree.h +1 −1
  525. fs/btrfs/disk-io.c +1 −0
  526. fs/btrfs/extent-tree.c +30 −11
  527. fs/btrfs/extent_io.c +1 −1
  528. fs/btrfs/free-space-cache.c +8 −5
  529. fs/btrfs/inode.c +13 −7
  530. fs/btrfs/ioctl.c +15 −9
  531. fs/btrfs/tree-log.c +5 −2
  532. fs/btrfs/volumes.c +10 −0
  533. fs/ceph/addr.c +7 −0
  534. fs/ceph/caps.c +15 −15
  535. fs/ceph/file.c +4 −1
  536. fs/ceph/inode.c +6 −1
  537. fs/ceph/mds_client.c +1 −1
  538. fs/ceph/snap.c +1 −1
  539. fs/ceph/super.h +2 −2
  540. fs/ceph/xattr.c +8 −4
  541. fs/cifs/cifs_unicode.c +6 −8
  542. fs/cifs/connect.c +75 −55
  543. fs/cifs/sess.c +4 −15
  544. fs/configfs/dir.c +32 −7
  545. fs/dcache.c +32 −55
  546. fs/ecryptfs/crypto.c +21 −0
  547. fs/ecryptfs/ecryptfs_kernel.h +6 −1
  548. fs/ecryptfs/file.c +12 −13
  549. fs/ecryptfs/inode.c +32 −28
  550. fs/ecryptfs/kthread.c +3 −3
  551. fs/ecryptfs/main.c +50 −22
  552. fs/ecryptfs/super.c +4 −12
  553. fs/file.c +11 −7
  554. fs/fuse/dir.c +1 −1
  555. fs/gfs2/aops.c +1 −1
  556. fs/gfs2/dir.c +1 −1
  557. fs/gfs2/file.c +48 −10
  558. fs/gfs2/glock.c +2 −4
  559. fs/gfs2/glops.c +4 −0
  560. fs/gfs2/inode.c +41 −15
  561. fs/gfs2/inode.h +2 −1
  562. fs/gfs2/ops_fstype.c +1 −1
  563. fs/gfs2/rgrp.c +2 −2
  564. fs/gfs2/super.c +11 −3
  565. fs/hpfs/Kconfig +0 −1
  566. fs/hpfs/alloc.c +43 −75
  567. fs/hpfs/anode.c +69 −69
  568. fs/hpfs/buffer.c +8 −16
  569. fs/hpfs/dir.c +10 −12
  570. fs/hpfs/dnode.c +84 −90
  571. fs/hpfs/ea.c +69 −67
  572. fs/hpfs/file.c +21 −10
  573. fs/hpfs/hpfs.h +257 −182
  574. fs/hpfs/hpfs_fn.h +37 −43
  575. fs/hpfs/inode.c +21 −26
  576. fs/hpfs/map.c +30 −26
  577. fs/hpfs/name.c +0 −33
  578. fs/hpfs/namei.c +30 −76
  579. fs/hpfs/super.c +51 −67
  580. fs/logfs/super.c +4 −4
  581. fs/namei.c +1 −1
  582. fs/nfs/namespace.c +2 −2
  583. fs/nfs/nfs4_fs.h +1 −0
  584. fs/nfs/nfs4filelayout.c +16 −11
  585. fs/nfs/nfs4filelayout.h +1 −1
  586. fs/nfs/nfs4filelayoutdev.c +17 −17
  587. fs/nfs/nfs4proc.c +64 −60
  588. fs/nfs/nfs4state.c +34 −17
  589. fs/nfs/nfs4xdr.c +28 −25
  590. fs/nfs/pnfs.c +27 −15
  591. fs/nfs/pnfs.h +3 −3
  592. fs/nfs/read.c +2 −2
  593. fs/nfs/super.c +11 −2
  594. fs/nfs/write.c +3 −5
  595. fs/nfsd/nfs4state.c +2 −1
  596. fs/nfsd/vfs.c +8 −1
  597. fs/nilfs2/alloc.c +1 −1
  598. fs/ocfs2/cluster/heartbeat.c +43 −18
  599. fs/ocfs2/dir.c +1 −1
  600. fs/ocfs2/dlm/dlmdomain.c +2 −1
  601. fs/ocfs2/dlm/dlmmaster.c +3 −0
  602. fs/ocfs2/file.c +12 −0
  603. fs/ocfs2/journal.c +3 −0
  604. fs/ocfs2/ocfs2_fs.h +1 −1
  605. fs/partitions/efi.c +6 −0
  606. fs/proc/task_mmu.c +7 −5
  607. fs/ubifs/log.c +0 −20
  608. fs/ubifs/recovery.c +26 −0
  609. fs/ubifs/replay.c +12 −6
  610. fs/ubifs/super.c +25 −19
  611. fs/xattr.c +1 −1
  612. fs/xfs/linux-2.6/xfs_message.c +3 −1
  613. fs/xfs/linux-2.6/xfs_sync.c +1 −0
  614. fs/xfs/xfs_trans_ail.c +26 −21
  615. include/drm/drm_fb_helper.h +2 −1
  616. include/drm/drm_mm.h +1 −1
  617. include/drm/drm_pciids.h +5 −0
  618. include/drm/radeon_drm.h +2 −0
  619. include/linux/bit_spinlock.h +4 −4
  620. include/linux/blkdev.h +13 −13
  621. include/linux/bootmem.h +2 −0
  622. include/linux/capability.h +1 −12
  623. include/linux/cred.h +8 −2
  624. include/linux/dcache.h +2 −2
  625. include/linux/device.h +0 −1
  626. include/linux/fb.h +1 −0
  627. include/linux/flex_array.h +1 −1
  628. include/linux/fs.h +0 −1
  629. include/linux/ftrace_event.h +1 −0
  630. include/linux/gfp.h +2 −0
  631. include/linux/huge_mm.h +1 −1
  632. include/linux/libata.h +1 −2
  633. include/linux/list_bl.h +11 −0
  634. include/linux/mfd/wm831x/pdata.h +2 −0
  635. include/linux/mm.h +25 −2
  636. include/linux/nfs_fs_sb.h +1 −0
  637. include/linux/nfs_xdr.h +3 −0
  638. include/linux/of_device.h +6 −2
  639. include/linux/pci_ids.h +0 −4
  640. include/linux/percpu.h +1 −1
  641. include/linux/posix-clock.h +3 −2
  642. include/linux/proc_fs.h +2 −0
  643. include/linux/ptrace.h +12 −1
  644. include/linux/sched.h +3 −0
  645. include/linux/security.h +1 −1
  646. include/linux/sunrpc/sched.h +4 −1
  647. include/linux/usb/usbnet.h +3 −2
  648. include/linux/v4l2-mediabus.h +5 −2
  649. include/linux/videodev2.h +1 −0
  650. include/media/v4l2-device.h +1 −1
  651. include/net/inet_ecn.h +13 −3
  652. include/net/ip_vs.h +17 −0
  653. include/net/llc_pdu.h +4 −4
  654. include/net/xfrm.h +3 −0
  655. include/scsi/scsi_device.h +1 −0
  656. include/trace/events/gfpflags.h +5 −1
  657. init/Kconfig +8 −8
  658. kernel/capability.c +12 −0
  659. kernel/cred.c +6 −6
  660. kernel/exit.c +1 −1
  661. kernel/hrtimer.c +5 −5
  662. kernel/irq/proc.c +1 −1
  663. kernel/kexec.c +7 −0
  664. kernel/power/hibernate.c +8 −2
  665. kernel/power/suspend.c +6 −3
  666. kernel/power/user.c +4 −1
  667. kernel/ptrace.c +17 −0
  668. kernel/time/clocksource.c +2 −2
  669. kernel/time/posix-clock.c +9 −15
  670. kernel/time/tick-broadcast.c +11 −1
  671. kernel/trace/Kconfig +1 −1
  672. kernel/trace/trace.c +1 −0
  673. kernel/trace/trace_events.c +1 −0
  674. kernel/watchdog.c +4 −1
  675. kernel/workqueue.c +7 −1
  676. lib/flex_array.c +18 −6
  677. lib/vsprintf.c +1 −1
  678. lib/xz/xz_dec_lzma2.c +3 −3
  679. mm/huge_memory.c +24 −19
  680. mm/memory.c +9 −12
  681. mm/mlock.c +1 −4
  682. mm/mmap.c +7 −4
  683. mm/oom_kill.c +6 −3
  684. mm/page_alloc.c +42 −15
  685. mm/page_cgroup.c +1 −1
  686. mm/shmem.c +83 −66
  687. mm/slub.c +2 −2
  688. mm/swap.c +3 −0
  689. mm/vmscan.c +1 −1
  690. net/8021q/vlan.c +3 −0
  691. net/8021q/vlan_dev.c +0 −3
  692. net/9p/client.c +1 −1
  693. net/9p/protocol.c +1 −0
  694. net/9p/trans_common.c +3 −8
  695. net/bluetooth/hci_core.c +2 −3
  696. net/bluetooth/hci_event.c +0 −2
  697. net/bluetooth/l2cap_core.c +1 −0
  698. net/bridge/br_input.c +1 −1
  699. net/bridge/br_netfilter.c +3 −5
  700. net/bridge/netfilter/ebtables.c +11 −53
  701. net/caif/cfdgml.c +5 −1
  702. net/caif/cfmuxl.c +2 −2
  703. net/can/bcm.c +6 −1
  704. net/can/raw.c +6 −1
  705. net/ceph/messenger.c +13 −13
  706. net/ceph/osd_client.c +2 −2
  707. net/core/dev.c +23 −23
  708. net/dccp/options.c +2 −0
  709. net/dsa/Kconfig +2 −2
  710. net/dsa/mv88e6131.c +21 −5
  711. net/ieee802154/Makefile +0 −2
  712. net/ipv4/devinet.c +1 −1
  713. net/ipv4/fib_trie.c +0 −3
  714. net/ipv4/inet_connection_sock.c +2 −3
  715. net/ipv4/inetpeer.c +7 −6
  716. net/ipv4/ip_fragment.c +15 −16
  717. net/ipv4/ip_options.c +3 −3
  718. net/ipv4/route.c +7 −0
  719. net/ipv4/sysctl_net_ipv4.c +0 −3
  720. net/ipv4/tcp_cubic.c +7 −2
  721. net/ipv4/xfrm4_output.c +6 −2
  722. net/ipv4/xfrm4_state.c +1 −0
  723. net/ipv6/addrconf.c +1 −1
  724. net/ipv6/esp6.c +1 −1
  725. net/ipv6/inet6_connection_sock.c +1 −1
  726. net/ipv6/netfilter/ip6t_REJECT.c +3 −1
  727. net/ipv6/route.c +7 −1
  728. net/ipv6/udp.c +1 −1
  729. net/ipv6/xfrm6_output.c +3 −3
  730. net/ipv6/xfrm6_state.c +1 −0
  731. net/irda/af_irda.c +1 −2
  732. net/l2tp/l2tp_ip.c +1 −1
  733. net/llc/llc_input.c +1 −2
  734. net/mac80211/cfg.c +2 −0
  735. net/mac80211/debugfs_netdev.c +2 −2
  736. net/mac80211/tx.c +4 −0
  737. net/netfilter/ipset/ip_set_bitmap_ipmac.c +4 −0
  738. net/netfilter/ipset/ip_set_core.c +10 −8
  739. net/netfilter/ipvs/ip_vs_app.c +4 −13
  740. net/netfilter/ipvs/ip_vs_conn.c +4 −12
  741. net/netfilter/ipvs/ip_vs_core.c +93 −10
  742. net/netfilter/ipvs/ip_vs_ctl.c +104 −22
  743. net/netfilter/ipvs/ip_vs_est.c +3 −11
  744. net/netfilter/ipvs/ip_vs_proto.c +2 −9
  745. net/netfilter/ipvs/ip_vs_sync.c +37 −28
  746. net/netfilter/nf_conntrack_netlink.c +4 −0
  747. net/netfilter/x_tables.c +2 −2
  748. net/netfilter/xt_DSCP.c +1 −1
  749. net/netfilter/xt_conntrack.c +0 −5
  750. net/netfilter/xt_set.c +16 −2
  751. net/sctp/associola.c +4 −0
  752. net/sctp/ulpevent.c +1 −1
  753. net/sunrpc/Kconfig +4 −5
  754. net/sunrpc/auth_gss/auth_gss.c +5 −3
  755. net/sunrpc/clnt.c +4 −1
  756. net/sunrpc/xprt.c +1 −0
  757. net/unix/af_unix.c +15 −1
  758. net/xfrm/xfrm_policy.c +13 −1
  759. net/xfrm/xfrm_replay.c +4 −1
  760. net/xfrm/xfrm_user.c +3 −0
  761. scripts/kconfig/conf.c +1 −1
  762. security/capability.c +1 −1
  763. security/security.c +2 −4
  764. security/selinux/avc.c +29 −7
  765. security/selinux/hooks.c +16 −11
  766. security/selinux/include/avc.h +13 −5
  767. security/selinux/ss/policydb.c +3 −7
  768. security/smack/smack_lsm.c +5 −1
  769. sound/aoa/codecs/tas.c +1 −1
  770. sound/pci/au88x0/au88x0_pcm.c +5 −2
  771. sound/pci/hda/hda_codec.c +4 −0
  772. sound/pci/hda/patch_realtek.c +35 −20
  773. sound/pci/hda/patch_via.c +7 −3
  774. sound/soc/codecs/jz4740.c +0 −2
  775. sound/soc/codecs/sn95031.c +1 −1
  776. sound/soc/codecs/ssm2602.c +5 −5
  777. sound/soc/codecs/uda134x.c +0 −2
  778. sound/soc/codecs/wm8903.c +24 −16
  779. sound/soc/codecs/wm8994.c +16 −0
  780. sound/soc/codecs/wm_hubs.c +4 −4
  781. sound/soc/davinci/davinci-mcasp.c +12 −7
  782. sound/soc/jz4740/jz4740-i2s.c +1 −1
  783. sound/soc/mid-x86/sst_platform.c +12 −4
  784. sound/soc/samsung/goni_wm8994.c +4 −4
  785. sound/soc/samsung/pcm.c +2 −2
  786. sound/soc/sh/fsi.c +16 −6
  787. sound/soc/soc-core.c +6 −1
  788. sound/soc/tegra/harmony.c +1 −0
  789. sound/usb/format.c +3 −1
  790. sound/usb/quirks.c +1 −0
  791. tools/perf/Makefile +10 −6
  792. tools/perf/builtin-record.c +6 −3
  793. tools/perf/builtin-stat.c +4 −3
  794. tools/perf/builtin-test.c +6 −6
  795. tools/perf/builtin-top.c +6 −5
  796. tools/perf/util/evlist.c +112 −45
  797. tools/perf/util/evlist.h +2 −1
  798. tools/perf/util/evsel.c +7 −20
  799. tools/perf/util/evsel.h +3 −3
  800. tools/perf/util/python.c +6 −5
  801. tools/perf/util/ui/browsers/annotate.c +4 −2
  802. tools/perf/util/ui/browsers/hists.c +1 −1
Documentation/DocBook/media-entities.tmpl+1−0
@@ -294,6 +294,7 @@ · 293 unmodified lines
294294 <!ENTITY sub-srggb10 SYSTEM "v4l/pixfmt-srggb10.xml">
295295 <!ENTITY sub-srggb8 SYSTEM "v4l/pixfmt-srggb8.xml">
296296 <!ENTITY sub-y10 SYSTEM "v4l/pixfmt-y10.xml">
297+<!ENTITY sub-y12 SYSTEM "v4l/pixfmt-y12.xml">
297298 <!ENTITY sub-pixfmt SYSTEM "v4l/pixfmt.xml">
298299 <!ENTITY sub-cropcap SYSTEM "v4l/vidioc-cropcap.xml">
299300 <!ENTITY sub-dbg-g-register SYSTEM "v4l/vidioc-dbg-g-register.xml">
Documentation/DocBook/v4l/media-ioc-setup-link.xml+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 <varlistentry>
3535 <term><parameter>request</parameter></term>
3636 <listitem>
37− <para>MEDIA_IOC_ENUM_LINKS</para>
37+ <para>MEDIA_IOC_SETUP_LINK</para>
3838 </listitem>
3939 </varlistentry>
4040 <varlistentry>
Documentation/DocBook/v4l/pixfmt-y12.xml+79−0
@@ -0,0 +1,79 @@
1+<refentry id="V4L2-PIX-FMT-Y12">
2+ <refmeta>
3+ <refentrytitle>V4L2_PIX_FMT_Y12 ('Y12 ')</refentrytitle>
4+ &manvol;
5+ </refmeta>
6+ <refnamediv>
7+ <refname><constant>V4L2_PIX_FMT_Y12</constant></refname>
8+ <refpurpose>Grey-scale image</refpurpose>
9+ </refnamediv>
10+ <refsect1>
11+ <title>Description</title>
12+
13+ <para>This is a grey-scale image with a depth of 12 bits per pixel. Pixels
14+are stored in 16-bit words with unused high bits padded with 0. The least
15+significant byte is stored at lower memory addresses (little-endian).</para>
16+
17+ <example>
18+ <title><constant>V4L2_PIX_FMT_Y12</constant> 4 &times; 4
19+pixel image</title>
20+
21+ <formalpara>
22+ <title>Byte Order.</title>
23+ <para>Each cell is one byte.
24+ <informaltable frame="none">
25+ <tgroup cols="9" align="center">
26+ <colspec align="left" colwidth="2*" />
27+ <tbody valign="top">
28+ <row>
29+ <entry>start&nbsp;+&nbsp;0:</entry>
30+ <entry>Y'<subscript>00low</subscript></entry>
31+ <entry>Y'<subscript>00high</subscript></entry>
32+ <entry>Y'<subscript>01low</subscript></entry>
33+ <entry>Y'<subscript>01high</subscript></entry>
34+ <entry>Y'<subscript>02low</subscript></entry>
35+ <entry>Y'<subscript>02high</subscript></entry>
36+ <entry>Y'<subscript>03low</subscript></entry>
37+ <entry>Y'<subscript>03high</subscript></entry>
38+ </row>
39+ <row>
40+ <entry>start&nbsp;+&nbsp;8:</entry>
41+ <entry>Y'<subscript>10low</subscript></entry>
42+ <entry>Y'<subscript>10high</subscript></entry>
43+ <entry>Y'<subscript>11low</subscript></entry>
44+ <entry>Y'<subscript>11high</subscript></entry>
45+ <entry>Y'<subscript>12low</subscript></entry>
46+ <entry>Y'<subscript>12high</subscript></entry>
47+ <entry>Y'<subscript>13low</subscript></entry>
48+ <entry>Y'<subscript>13high</subscript></entry>
49+ </row>
50+ <row>
51+ <entry>start&nbsp;+&nbsp;16:</entry>
52+ <entry>Y'<subscript>20low</subscript></entry>
53+ <entry>Y'<subscript>20high</subscript></entry>
54+ <entry>Y'<subscript>21low</subscript></entry>
55+ <entry>Y'<subscript>21high</subscript></entry>
56+ <entry>Y'<subscript>22low</subscript></entry>
57+ <entry>Y'<subscript>22high</subscript></entry>
58+ <entry>Y'<subscript>23low</subscript></entry>
59+ <entry>Y'<subscript>23high</subscript></entry>
60+ </row>
61+ <row>
62+ <entry>start&nbsp;+&nbsp;24:</entry>
63+ <entry>Y'<subscript>30low</subscript></entry>
64+ <entry>Y'<subscript>30high</subscript></entry>
65+ <entry>Y'<subscript>31low</subscript></entry>
66+ <entry>Y'<subscript>31high</subscript></entry>
67+ <entry>Y'<subscript>32low</subscript></entry>
68+ <entry>Y'<subscript>32high</subscript></entry>
69+ <entry>Y'<subscript>33low</subscript></entry>
70+ <entry>Y'<subscript>33high</subscript></entry>
71+ </row>
72+ </tbody>
73+ </tgroup>
74+ </informaltable>
75+ </para>
76+ </formalpara>
77+ </example>
78+ </refsect1>
79+</refentry>
Documentation/DocBook/v4l/pixfmt.xml+1−0
@@ -696,6 +696,7 @@ information.</para> · 695 unmodified lines
696696 &sub-packed-yuv;
697697 &sub-grey;
698698 &sub-y10;
699+ &sub-y12;
699700 &sub-y16;
700701 &sub-yuyv;
701702 &sub-uyvy;
Documentation/DocBook/v4l/subdev-formats.xml+59−0
@@ -456,6 +456,23 @@ · 455 unmodified lines
456456 <entry>b<subscript>1</subscript></entry>
457457 <entry>b<subscript>0</subscript></entry>
458458 </row>
459+ <row id="V4L2-MBUS-FMT-SGBRG8-1X8">
460+ <entry>V4L2_MBUS_FMT_SGBRG8_1X8</entry>
461+ <entry>0x3013</entry>
462+ <entry></entry>
463+ <entry>-</entry>
464+ <entry>-</entry>
465+ <entry>-</entry>
466+ <entry>-</entry>
467+ <entry>g<subscript>7</subscript></entry>
468+ <entry>g<subscript>6</subscript></entry>
469+ <entry>g<subscript>5</subscript></entry>
470+ <entry>g<subscript>4</subscript></entry>
471+ <entry>g<subscript>3</subscript></entry>
472+ <entry>g<subscript>2</subscript></entry>
473+ <entry>g<subscript>1</subscript></entry>
474+ <entry>g<subscript>0</subscript></entry>
475+ </row>
459476 <row id="V4L2-MBUS-FMT-SGRBG8-1X8">
460477 <entry>V4L2_MBUS_FMT_SGRBG8_1X8</entry>
461478 <entry>0x3002</entry>
@@ -473,6 +490,23 @@ · 11 unmodified lines
473490 <entry>g<subscript>1</subscript></entry>
474491 <entry>g<subscript>0</subscript></entry>
475492 </row>
493+ <row id="V4L2-MBUS-FMT-SRGGB8-1X8">
494+ <entry>V4L2_MBUS_FMT_SRGGB8_1X8</entry>
495+ <entry>0x3014</entry>
496+ <entry></entry>
497+ <entry>-</entry>
498+ <entry>-</entry>
499+ <entry>-</entry>
500+ <entry>-</entry>
501+ <entry>r<subscript>7</subscript></entry>
502+ <entry>r<subscript>6</subscript></entry>
503+ <entry>r<subscript>5</subscript></entry>
504+ <entry>r<subscript>4</subscript></entry>
505+ <entry>r<subscript>3</subscript></entry>
506+ <entry>r<subscript>2</subscript></entry>
507+ <entry>r<subscript>1</subscript></entry>
508+ <entry>r<subscript>0</subscript></entry>
509+ </row>
476510 <row id="V4L2-MBUS-FMT-SBGGR10-DPCM8-1X8">
477511 <entry>V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8</entry>
478512 <entry>0x300b</entry>
@@ -2159,6 +2193,31 @@ · 1680 unmodified lines
21592193 <entry>u<subscript>1</subscript></entry>
21602194 <entry>u<subscript>0</subscript></entry>
21612195 </row>
2196+ <row id="V4L2-MBUS-FMT-Y12-1X12">
2197+ <entry>V4L2_MBUS_FMT_Y12_1X12</entry>
2198+ <entry>0x2013</entry>
2199+ <entry></entry>
2200+ <entry>-</entry>
2201+ <entry>-</entry>
2202+ <entry>-</entry>
2203+ <entry>-</entry>
2204+ <entry>-</entry>
2205+ <entry>-</entry>
2206+ <entry>-</entry>
2207+ <entry>-</entry>
2208+ <entry>y<subscript>11</subscript></entry>
2209+ <entry>y<subscript>10</subscript></entry>
2210+ <entry>y<subscript>9</subscript></entry>
2211+ <entry>y<subscript>8</subscript></entry>
2212+ <entry>y<subscript>7</subscript></entry>
2213+ <entry>y<subscript>6</subscript></entry>
2214+ <entry>y<subscript>5</subscript></entry>
2215+ <entry>y<subscript>4</subscript></entry>
2216+ <entry>y<subscript>3</subscript></entry>
2217+ <entry>y<subscript>2</subscript></entry>
2218+ <entry>y<subscript>1</subscript></entry>
2219+ <entry>y<subscript>0</subscript></entry>
2220+ </row>
21622221 <row id="V4L2-MBUS-FMT-UYVY8-1X16">
21632222 <entry>V4L2_MBUS_FMT_UYVY8_1X16</entry>
21642223 <entry>0x200f</entry>
Documentation/cgroups/memory.txt+13−2
@@ -52,8 +52,10 @@ Brief summary of control files. · 51 unmodified lines
5252 tasks # attach a task(thread) and show list of threads
5353 cgroup.procs # show list of processes
5454 cgroup.event_control # an interface for event_fd()
55− memory.usage_in_bytes # show current memory(RSS+Cache) usage.
56− memory.memsw.usage_in_bytes # show current memory+Swap usage
55+ memory.usage_in_bytes # show current res_counter usage for memory
56+ (See 5.5 for details)
57+ memory.memsw.usage_in_bytes # show current res_counter usage for memory+Swap
58+ (See 5.5 for details)
5759 memory.limit_in_bytes # set/show limit of memory usage
5860 memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage
5961 memory.failcnt # show the number of memory usage hits limits
@@ -453,6 +455,15 @@ memory under it will be reclaimed. · 393 unmodified lines
453455 You can reset failcnt by writing 0 to failcnt file.
454456 # echo 0 > .../memory.failcnt
455457
458+5.5 usage_in_bytes
459+
460+For efficiency, as other kernel components, memory cgroup uses some optimization
461+to avoid unnecessary cacheline false sharing. usage_in_bytes is affected by the
462+method and doesn't show 'exact' value of memory(and swap) usage, it's an fuzz
463+value for efficient access. (Of course, when necessary, it's synchronized.)
464+If you want to know more exact memory usage, you should use RSS+CACHE(+SWAP)
465+value in memory.stat(see 5.2).
466+
456467 6. Hierarchy support
457468
458469 The memory controller supports a deep hierarchy and hierarchical accounting.
Documentation/flexible-arrays.txt+2−2
@@ -66,10 +66,10 @@ trick is to ensure that any needed memory allocations are done before · 65 unmodified lines
6666 entering atomic context, using:
6767
6868 int flex_array_prealloc(struct flex_array *array, unsigned int start,
69− unsigned int end, gfp_t flags);
69+ unsigned int nr_elements, gfp_t flags);
7070
7171 This function will ensure that memory for the elements indexed in the range
72−defined by start and end has been allocated. Thereafter, a
72+defined by start and nr_elements has been allocated. Thereafter, a
7373 flex_array_put() call on an element in that range is guaranteed not to
7474 block.
7575
Documentation/hwmon/adm1021+19−17
@@ -14,10 +14,6 @@ Supported chips: · 13 unmodified lines
1414 Prefix: 'gl523sm'
1515 Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
1616 Datasheet:
17− * Intel Xeon Processor
18− Prefix: - any other - may require 'force_adm1021' parameter
19− Addresses scanned: none
20− Datasheet: Publicly available at Intel website
2117 * Maxim MAX1617
2218 Prefix: 'max1617'
2319 Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
@@ -91,21 +87,27 @@ will do no harm, but will return 'old' values. It is possible to make · 67 unmodified lines
9187 ADM1021-clones do faster measurements, but there is really no good reason
9288 for that.
9389
94−Xeon support
95−------------
9690
97−Some Xeon processors have real max1617, adm1021, or compatible chips
98−within them, with two temperature sensors.
91+Netburst-based Xeon support
92+---------------------------
9993
100−Other Xeons have chips with only one sensor.
94+Some Xeon processors based on the Netburst (early Pentium 4, from 2001 to
95+2003) microarchitecture had real MAX1617, ADM1021, or compatible chips
96+within them, with two temperature sensors. Other Xeon processors of this
97+era (with 400 MHz FSB) had chips with only one temperature sensor.
10198
102−If you have a Xeon, and the adm1021 module loads, and both temperatures
103−appear valid, then things are good.
99+If you have such an old Xeon, and you get two valid temperatures when
100+loading the adm1021 module, then things are good.
104101
105−If the adm1021 module doesn't load, you should try this:
106− modprobe adm1021 force_adm1021=BUS,ADDRESS
107− ADDRESS can only be 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e.
102+If nothing happens when loading the adm1021 module, and you are certain
103+that your specific Xeon processor model includes compatible sensors, you
104+will have to explicitly instantiate the sensor chips from user-space. See
105+method 4 in Documentation/i2c/instantiating-devices. Possible slave
106+addresses are 0x18, 0x1a, 0x29, 0x2b, 0x4c, or 0x4e. It is likely that
107+only temp2 will be correct and temp1 will have to be ignored.
108108
109−If you have dual Xeons you may have appear to have two separate
110−adm1021-compatible chips, or two single-temperature sensors, at distinct
111−addresses.
109+Previous generations of the Xeon processor (based on Pentium II/III)
110+didn't have these sensors. Next generations of Xeon processors (533 MHz
111+FSB and faster) lost them, until the Core-based generation which
112+introduced integrated digital thermal sensors. These are supported by
113+the coretemp driver.
Documentation/hwmon/lm90+20−9
@@ -32,6 +32,16 @@ Supported chips: · 31 unmodified lines
3232 Addresses scanned: I2C 0x4c and 0x4d
3333 Datasheet: Publicly available at the ON Semiconductor website
3434 http://www.onsemi.com/PowerSolutions/product.do?id=ADT7461
35+ * Analog Devices ADT7461A
36+ Prefix: 'adt7461a'
37+ Addresses scanned: I2C 0x4c and 0x4d
38+ Datasheet: Publicly available at the ON Semiconductor website
39+ http://www.onsemi.com/PowerSolutions/product.do?id=ADT7461A
40+ * ON Semiconductor NCT1008
41+ Prefix: 'nct1008'
42+ Addresses scanned: I2C 0x4c and 0x4d
43+ Datasheet: Publicly available at the ON Semiconductor website
44+ http://www.onsemi.com/PowerSolutions/product.do?id=NCT1008
3545 * Maxim MAX6646
3646 Prefix: 'max6646'
3747 Addresses scanned: I2C 0x4d
@@ -149,7 +159,7 @@ ADM1032: · 111 unmodified lines
149159 * ALERT is triggered by open remote sensor.
150160 * SMBus PEC support for Write Byte and Receive Byte transactions.
151161
152−ADT7461:
162+ADT7461, ADT7461A, NCT1008:
153163 * Extended temperature range (breaks compatibility)
154164 * Lower resolution for remote temperature
155165
@@ -195,9 +205,9 @@ are exported, one for each channel, but these values are of course linked. · 39 unmodified lines
195205 Only the local hysteresis can be set from user-space, and the same delta
196206 applies to the remote hysteresis.
197207
198−The lm90 driver will not update its values more frequently than every
199−other second; reading them more often will do no harm, but will return
200−'old' values.
208+The lm90 driver will not update its values more frequently than configured with
209+the update_interval attribute; reading them more often will do no harm, but will
210+return 'old' values.
201211
202212 SMBus Alert Support
203213 -------------------
@@ -205,11 +215,12 @@ SMBus Alert Support · 1 unmodified line
205215 This driver has basic support for SMBus alert. When an alert is received,
206216 the status register is read and the faulty temperature channel is logged.
207217
208−The Analog Devices chips (ADM1032 and ADT7461) do not implement the SMBus
209−alert protocol properly so additional care is needed: the ALERT output is
210−disabled when an alert is received, and is re-enabled only when the alarm
211−is gone. Otherwise the chip would block alerts from other chips in the bus
212−as long as the alarm is active.
218+The Analog Devices chips (ADM1032, ADT7461 and ADT7461A) and ON
219+Semiconductor chips (NCT1008) do not implement the SMBus alert protocol
220+properly so additional care is needed: the ALERT output is disabled when
221+an alert is received, and is re-enabled only when the alarm is gone.
222+Otherwise the chip would block alerts from other chips in the bus as long
223+as the alarm is active.
213224
214225 PEC Support
215226 -----------
Documentation/hwmon/max16064+62−0
@@ -0,0 +1,62 @@
1+Kernel driver max16064
2+======================
3+
4+Supported chips:
5+ * Maxim MAX16064
6+ Prefix: 'max16064'
7+ Addresses scanned: -
8+ Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX16064.pdf
9+
10+Author: Guenter Roeck <guenter.roeck@ericsson.com>
11+
12+
13+Description
14+-----------
15+
16+This driver supports hardware montoring for Maxim MAX16064 Quad Power-Supply
17+Controller with Active-Voltage Output Control and PMBus Interface.
18+
19+The driver is a client driver to the core PMBus driver.
20+Please see Documentation/hwmon/pmbus for details on PMBus client drivers.
21+
22+
23+Usage Notes
24+-----------
25+
26+This driver does not auto-detect devices. You will have to instantiate the
27+devices explicitly. Please see Documentation/i2c/instantiating-devices for
28+details.
29+
30+
31+Platform data support
32+---------------------
33+
34+The driver supports standard PMBus driver platform data.
35+
36+
37+Sysfs entries
38+-------------
39+
40+The following attributes are supported. Limits are read-write; all other
41+attributes are read-only.
42+
43+in[1-4]_label "vout[1-4]"
44+in[1-4]_input Measured voltage. From READ_VOUT register.
45+in[1-4]_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
46+in[1-4]_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
47+in[1-4]_lcrit Critical minumum Voltage. VOUT_UV_FAULT_LIMIT register.
48+in[1-4]_crit Critical maximum voltage. From VOUT_OV_FAULT_LIMIT register.
49+in[1-4]_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
50+in[1-4]_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
51+in[1-4]_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status.
52+in[1-4]_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status.
53+
54+temp1_input Measured temperature. From READ_TEMPERATURE_1 register.
55+temp1_max Maximum temperature. From OT_WARN_LIMIT register.
56+temp1_crit Critical high temperature. From OT_FAULT_LIMIT register.
57+temp1_max_alarm Chip temperature high alarm. Set by comparing
58+ READ_TEMPERATURE_1 with OT_WARN_LIMIT if TEMP_OT_WARNING
59+ status is set.
60+temp1_crit_alarm Chip temperature critical high alarm. Set by comparing
61+ READ_TEMPERATURE_1 with OT_FAULT_LIMIT if TEMP_OT_FAULT
62+ status is set.
Documentation/hwmon/max34440+79−0
@@ -0,0 +1,79 @@
1+Kernel driver max34440
2+======================
3+
4+Supported chips:
5+ * Maxim MAX34440
6+ Prefixes: 'max34440'
7+ Addresses scanned: -
8+ Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34440.pdf
9+ * Maxim MAX34441
10+ PMBus 5-Channel Power-Supply Manager and Intelligent Fan Controller
11+ Prefixes: 'max34441'
12+ Addresses scanned: -
13+ Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34441.pdf
14+
15+Author: Guenter Roeck <guenter.roeck@ericsson.com>
16+
17+
18+Description
19+-----------
20+
21+This driver supports hardware montoring for Maxim MAX34440 PMBus 6-Channel
22+Power-Supply Manager and MAX34441 PMBus 5-Channel Power-Supply Manager
23+and Intelligent Fan Controller.
24+
25+The driver is a client driver to the core PMBus driver. Please see
26+Documentation/hwmon/pmbus for details on PMBus client drivers.
27+
28+
29+Usage Notes
30+-----------
31+
32+This driver does not auto-detect devices. You will have to instantiate the
33+devices explicitly. Please see Documentation/i2c/instantiating-devices for
34+details.
35+
36+
37+Platform data support
38+---------------------
39+
40+The driver supports standard PMBus driver platform data.
41+
42+
43+Sysfs entries
44+-------------
45+
46+The following attributes are supported. Limits are read-write; all other
47+attributes are read-only.
48+
49+in[1-6]_label "vout[1-6]".
50+in[1-6]_input Measured voltage. From READ_VOUT register.
51+in[1-6]_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
52+in[1-6]_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
53+in[1-6]_lcrit Critical minumum Voltage. VOUT_UV_FAULT_LIMIT register.
54+in[1-6]_crit Critical maximum voltage. From VOUT_OV_FAULT_LIMIT register.
55+in[1-6]_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
56+in[1-6]_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
57+in[1-6]_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status.
58+in[1-6]_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status.
59+
60+curr[1-6]_label "iout[1-6]".
61+curr[1-6]_input Measured current. From READ_IOUT register.
62+curr[1-6]_max Maximum current. From IOUT_OC_WARN_LIMIT register.
63+curr[1-6]_crit Critical maximum current. From IOUT_OC_FAULT_LIMIT register.
64+curr[1-6]_max_alarm Current high alarm. From IOUT_OC_WARNING status.
65+curr[1-6]_crit_alarm Current critical high alarm. From IOUT_OC_FAULT status.
66+
67+ in6 and curr6 attributes only exist for MAX34440.
68+
69+temp[1-8]_input Measured temperatures. From READ_TEMPERATURE_1 register.
70+ temp1 is the chip's internal temperature. temp2..temp5
71+ are remote I2C temperature sensors. For MAX34441, temp6
72+ is a remote thermal-diode sensor. For MAX34440, temp6..8
73+ are remote I2C temperature sensors.
74+temp[1-8]_max Maximum temperature. From OT_WARN_LIMIT register.
75+temp[1-8]_crit Critical high temperature. From OT_FAULT_LIMIT register.
76+temp[1-8]_max_alarm Temperature high alarm.
77+temp[1-8]_crit_alarm Temperature critical high alarm.
78+
79+ temp7 and temp8 attributes only exist for MAX34440.
Documentation/hwmon/max8688+69−0
@@ -0,0 +1,69 @@
1+Kernel driver max8688
2+=====================
3+
4+Supported chips:
5+ * Maxim MAX8688
6+ Prefix: 'max8688'
7+ Addresses scanned: -
8+ Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX8688.pdf
9+
10+Author: Guenter Roeck <guenter.roeck@ericsson.com>
11+
12+
13+Description
14+-----------
15+
16+This driver supports hardware montoring for Maxim MAX8688 Digital Power-Supply
17+Controller/Monitor with PMBus Interface.
18+
19+The driver is a client driver to the core PMBus driver. Please see
20+Documentation/hwmon/pmbus for details on PMBus client drivers.
21+
22+
23+Usage Notes
24+-----------
25+
26+This driver does not auto-detect devices. You will have to instantiate the
27+devices explicitly. Please see Documentation/i2c/instantiating-devices for
28+details.
29+
30+
31+Platform data support
32+---------------------
33+
34+The driver supports standard PMBus driver platform data.
35+
36+
37+Sysfs entries
38+-------------
39+
40+The following attributes are supported. Limits are read-write; all other
41+attributes are read-only.
42+
43+in1_label "vout1"
44+in1_input Measured voltage. From READ_VOUT register.
45+in1_min Minumum Voltage. From VOUT_UV_WARN_LIMIT register.
46+in1_max Maximum voltage. From VOUT_OV_WARN_LIMIT register.
47+in1_lcrit Critical minumum Voltage. VOUT_UV_FAULT_LIMIT register.
48+in1_crit Critical maximum voltage. From VOUT_OV_FAULT_LIMIT register.
49+in1_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status.
50+in1_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status.
51+in1_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status.
52+in1_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status.
53+
54+curr1_label "iout1"
55+curr1_input Measured current. From READ_IOUT register.
56+curr1_max Maximum current. From IOUT_OC_WARN_LIMIT register.
57+curr1_crit Critical maximum current. From IOUT_OC_FAULT_LIMIT register.
58+curr1_max_alarm Current high alarm. From IOUT_OC_WARN_LIMIT register.
59+curr1_crit_alarm Current critical high alarm. From IOUT_OC_FAULT status.
60+
61+temp1_input Measured temperature. From READ_TEMPERATURE_1 register.
62+temp1_max Maximum temperature. From OT_WARN_LIMIT register.
63+temp1_crit Critical high temperature. From OT_FAULT_LIMIT register.
64+temp1_max_alarm Chip temperature high alarm. Set by comparing
65+ READ_TEMPERATURE_1 with OT_WARN_LIMIT if TEMP_OT_WARNING
66+ status is set.
67+temp1_crit_alarm Chip temperature critical high alarm. Set by comparing
68+ READ_TEMPERATURE_1 with OT_FAULT_LIMIT if TEMP_OT_FAULT
69+ status is set.
Documentation/hwmon/pmbus+8−26
@@ -13,26 +13,6 @@ Supported chips: · 12 unmodified lines
1313 Prefix: 'ltc2978'
1414 Addresses scanned: -
1515 Datasheet: http://cds.linear.com/docs/Datasheet/2978fa.pdf
16− * Maxim MAX16064
17− Quad Power-Supply Controller
18− Prefix: 'max16064'
19− Addresses scanned: -
20− Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX16064.pdf
21− * Maxim MAX34440
22− PMBus 6-Channel Power-Supply Manager
23− Prefixes: 'max34440'
24− Addresses scanned: -
25− Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34440.pdf
26− * Maxim MAX34441
27− PMBus 5-Channel Power-Supply Manager and Intelligent Fan Controller
28− Prefixes: 'max34441'
29− Addresses scanned: -
30− Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX34441.pdf
31− * Maxim MAX8688
32− Digital Power-Supply Controller/Monitor
33− Prefix: 'max8688'
34− Addresses scanned: -
35− Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX8688.pdf
3616 * Generic PMBus devices
3717 Prefix: 'pmbus'
3818 Addresses scanned: -
@@ -175,11 +155,13 @@ currX_crit Critical maximum current. · 136 unmodified lines
175155 From IIN_OC_FAULT_LIMIT or IOUT_OC_FAULT_LIMIT register.
176156 currX_alarm Current high alarm.
177157 From IIN_OC_WARNING or IOUT_OC_WARNING status.
158+currX_max_alarm Current high alarm.
159+ From IIN_OC_WARN_LIMIT or IOUT_OC_WARN_LIMIT status.
178160 currX_lcrit_alarm Output current critical low alarm.
179161 From IOUT_UC_FAULT status.
180162 currX_crit_alarm Current critical high alarm.
181163 From IIN_OC_FAULT or IOUT_OC_FAULT status.
182−currX_label "iin" or "vinY"
164+currX_label "iin" or "ioutY"
183165
184166 powerX_input Measured power. From READ_PIN or READ_POUT register.
185167 powerX_cap Output power cap. From POUT_MAX register.
@@ -193,13 +175,13 @@ powerX_crit_alarm Output power critical high alarm. · 7 unmodified lines
193175 From POUT_OP_FAULT status.
194176 powerX_label "pin" or "poutY"
195177
196−tempX_input Measured tempererature.
178+tempX_input Measured temperature.
197179 From READ_TEMPERATURE_X register.
198−tempX_min Mimimum tempererature. From UT_WARN_LIMIT register.
199−tempX_max Maximum tempererature. From OT_WARN_LIMIT register.
200−tempX_lcrit Critical low tempererature.
180+tempX_min Mimimum temperature. From UT_WARN_LIMIT register.
181+tempX_max Maximum temperature. From OT_WARN_LIMIT register.
182+tempX_lcrit Critical low temperature.
201183 From UT_FAULT_LIMIT register.
202−tempX_crit Critical high tempererature.
184+tempX_crit Critical high temperature.
203185 From OT_FAULT_LIMIT register.
204186 tempX_min_alarm Chip temperature low alarm. Set by comparing
205187 READ_TEMPERATURE_X with UT_WARN_LIMIT if
Documentation/hwmon/smm665+4−4
@@ -150,8 +150,8 @@ in8_crit_alarm Channel F critical alarm · 149 unmodified lines
150150 in9_crit_alarm AIN1 critical alarm
151151 in10_crit_alarm AIN2 critical alarm
152152
153−temp1_input Chip tempererature
154−temp1_min Mimimum chip tempererature
155−temp1_max Maximum chip tempererature
156−temp1_crit Critical chip tempererature
153+temp1_input Chip temperature
154+temp1_min Mimimum chip temperature
155+temp1_max Maximum chip temperature
156+temp1_crit Critical chip temperature
157157 temp1_crit_alarm Temperature critical alarm
Documentation/hwmon/submitting-patches+109−0
@@ -0,0 +1,109 @@
1+ How to Get Your Patch Accepted Into the Hwmon Subsystem
2+ -------------------------------------------------------
3+
4+This text is is a collection of suggestions for people writing patches or
5+drivers for the hwmon subsystem. Following these suggestions will greatly
6+increase the chances of your change being accepted.
7+
8+
9+1. General
10+----------
11+
12+* It should be unnecessary to mention, but please read and follow
13+ Documentation/SubmitChecklist
14+ Documentation/SubmittingDrivers
15+ Documentation/SubmittingPatches
16+ Documentation/CodingStyle
17+
18+* If your patch generates checkpatch warnings, please refrain from explanations
19+ such as "I don't like that coding style". Keep in mind that each unnecessary
20+ warning helps hiding a real problem. If you don't like the kernel coding
21+ style, don't write kernel drivers.
22+
23+* Please test your patch thoroughly. We are not your test group.
24+ Sometimes a patch can not or not completely be tested because of missing
25+ hardware. In such cases, you should test-build the code on at least one
26+ architecture. If run-time testing was not achieved, it should be written
27+ explicitly below the patch header.
28+
29+* If your patch (or the driver) is affected by configuration options such as
30+ CONFIG_SMP or CONFIG_HOTPLUG, make sure it compiles for all configuration
31+ variants.
32+
33+
34+2. Adding functionality to existing drivers
35+-------------------------------------------
36+
37+* Make sure the documentation in Documentation/hwmon/<driver_name> is up to
38+ date.
39+
40+* Make sure the information in Kconfig is up to date.
41+
42+* If the added functionality requires some cleanup or structural changes, split
43+ your patch into a cleanup part and the actual addition. This makes it easier
44+ to review your changes, and to bisect any resulting problems.
45+
46+* Never mix bug fixes, cleanup, and functional enhancements in a single patch.
47+
48+
49+3. New drivers
50+--------------
51+
52+* Running your patch or driver file(s) through checkpatch does not mean its
53+ formatting is clean. If unsure about formatting in your new driver, run it
54+ through Lindent. Lindent is not perfect, and you may have to do some minor
55+ cleanup, but it is a good start.
56+
57+* Consider adding yourself to MAINTAINERS.
58+
59+* Document the driver in Documentation/hwmon/<driver_name>.
60+
61+* Add the driver to Kconfig and Makefile in alphabetical order.
62+
63+* Make sure that all dependencies are listed in Kconfig. For new drivers, it
64+ is most likely prudent to add a dependency on EXPERIMENTAL.
65+
66+* Avoid forward declarations if you can. Rearrange the code if necessary.
67+
68+* Avoid calculations in macros and macro-generated functions. While such macros
69+ may save a line or so in the source, it obfuscates the code and makes code
70+ review more difficult. It may also result in code which is more complicated
71+ than necessary. Use inline functions or just regular functions instead.
72+
73+* If the driver has a detect function, make sure it is silent. Debug messages
74+ and messages printed after a successful detection are acceptable, but it
75+ must not print messages such as "Chip XXX not found/supported".
76+
77+ Keep in mind that the detect function will run for all drivers supporting an
78+ address if a chip is detected on that address. Unnecessary messages will just
79+ pollute the kernel log and not provide any value.
80+
81+* Provide a detect function if and only if a chip can be detected reliably.
82+
83+* Avoid writing to chip registers in the detect function. If you have to write,
84+ only do it after you have already gathered enough data to be certain that the
85+ detection is going to be successful.
86+
87+ Keep in mind that the chip might not be what your driver believes it is, and
88+ writing to it might cause a bad misconfiguration.
89+
90+* Make sure there are no race conditions in the probe function. Specifically,
91+ completely initialize your chip first, then create sysfs entries and register
92+ with the hwmon subsystem.
93+
94+* Do not provide support for deprecated sysfs attributes.
95+
96+* Do not create non-standard attributes unless really needed. If you have to use
97+ non-standard attributes, or you believe you do, discuss it on the mailing list
98+ first. Either case, provide a detailed explanation why you need the
99+ non-standard attribute(s).
100+ Standard attributes are specified in Documentation/hwmon/sysfs-interface.
101+
102+* When deciding which sysfs attributes to support, look at the chip's
103+ capabilities. While we do not expect your driver to support everything the
104+ chip may offer, it should at least support all limits and alarms.
105+
106+* Last but not least, please check if a driver for your chip already exists
107+ before starting to write a new driver. Especially for temperature sensors,
108+ new chips are often variants of previously released chips. In some cases,
109+ a presumably new chip may simply have been relabeled.
Documentation/md.txt+10−0
@@ -552,6 +552,16 @@ also have · 551 unmodified lines
552552 within the array where IO will be blocked. This is currently
553553 only supported for raid4/5/6.
554554
555+ sync_min
556+ sync_max
557+ The two values, given as numbers of sectors, indicate a range
558+ withing the array where 'check'/'repair' will operate. Must be
559+ a multiple of chunk_size. When it reaches "sync_max" it will
560+ pause, rather than complete.
561+ You can use 'select' or 'poll' on "sync_completed" to wait for
562+ that number to reach sync_max. Then you can either increase
563+ "sync_max", or can write 'idle' to "sync_action".
564+
555565
556566 Each active md device may also have attributes specific to the
557567 personality module that manages it.
Documentation/sound/alsa/SB-Live-mixer.txt+3−3
@@ -87,14 +87,14 @@ accumulator. ALSA uses accumulators 0 and 1 for left and right PCM. · 86 unmodified lines
8787 The result is forwarded to the ADC capture FIFO (thus to the standard capture
8888 PCM device).
8989
90−name='Music Playback Volume',index=0
90+name='Synth Playback Volume',index=0
9191
9292 This control is used to attenuate samples for left and right MIDI FX-bus
9393 accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples.
9494 The result samples are forwarded to the front DAC PCM slots of the AC97 codec.
9595
96−name='Music Capture Volume',index=0
97−name='Music Capture Switch',index=0
96+name='Synth Capture Volume',index=0
97+name='Synth Capture Switch',index=0
9898
9999 These controls are used to attenuate samples for left and right MIDI FX-bus
100100 accumulator. ALSA uses accumulators 4 and 5 for left and right PCM.
Documentation/video4linux/sh_mobile_ceu_camera.txt+3−3
@@ -37,7 +37,7 @@ Generic scaling / cropping scheme · 36 unmodified lines
3737 -1'-
3838
3939 In the above chart minuses and slashes represent "real" data amounts, points and
40−accents represent "useful" data, basically, CEU scaled amd cropped output,
40+accents represent "useful" data, basically, CEU scaled and cropped output,
4141 mapped back onto the client's source plane.
4242
4343 Such a configuration can be produced by user requests:
@@ -65,7 +65,7 @@ Do not touch input rectangle - it is already optimal. · 21 unmodified lines
6565
6666 1. Calculate current sensor scales:
6767
68− scale_s = ((3') - (3)) / ((2') - (2))
68+ scale_s = ((2') - (2)) / ((3') - (3))
6969
7070 2. Calculate "effective" input crop (sensor subwindow) - CEU crop scaled back at
7171 current sensor scales onto input window - this is user S_CROP:
@@ -80,7 +80,7 @@ window: · 8 unmodified lines
8080 4. Calculate sensor output window by applying combined scales to real input
8181 window:
8282
83− width_s_out = ((2') - (2)) / scale_comb
83+ width_s_out = ((7') - (7)) = ((2') - (2)) / scale_comb
8484
8585 5. Apply iterative sensor S_FMT for sensor output window.
8686
Documentation/workqueue.txt+40−0
@@ -12,6 +12,7 @@ CONTENTS · 11 unmodified lines
1212 4. Application Programming Interface (API)
1313 5. Example Execution Scenarios
1414 6. Guidelines
15+7. Debugging
1516
1617
1718 1. Introduction
@@ -379,3 +380,42 @@ If q1 has WQ_CPU_INTENSIVE set, · 361 unmodified lines
379380 * Unless work items are expected to consume a huge amount of CPU
380381 cycles, using a bound wq is usually beneficial due to the increased
381382 level of locality in wq operations and work item execution.
383+
384+
385+7. Debugging
386+
387+Because the work functions are executed by generic worker threads
388+there are a few tricks needed to shed some light on misbehaving
389+workqueue users.
390+
391+Worker threads show up in the process list as:
392+
393+root 5671 0.0 0.0 0 0 ? S 12:07 0:00 [kworker/0:1]
394+root 5672 0.0 0.0 0 0 ? S 12:07 0:00 [kworker/1:2]
395+root 5673 0.0 0.0 0 0 ? S 12:12 0:00 [kworker/0:0]
396+root 5674 0.0 0.0 0 0 ? S 12:13 0:00 [kworker/1:0]
397+
398+If kworkers are going crazy (using too much cpu), there are two types
399+of possible problems:
400+
401+ 1. Something beeing scheduled in rapid succession
402+ 2. A single work item that consumes lots of cpu cycles
403+
404+The first one can be tracked using tracing:
405+
406+ $ echo workqueue:workqueue_queue_work > /sys/kernel/debug/tracing/set_event
407+ $ cat /sys/kernel/debug/tracing/trace_pipe > out.txt
408+ (wait a few secs)
409+ ^C
410+
411+If something is busy looping on work queueing, it would be dominating
412+the output and the offender can be determined with the work item
413+function.
414+
415+For the second type of problems it should be possible to just check
416+the stack trace of the offending worker thread.
417+
418+ $ cat /proc/THE_OFFENDING_KWORKER/stack
419+
420+The work item's function should be trivially visible in the stack
421+trace.
MAINTAINERS+58−56
@@ -151,6 +151,7 @@ S: Maintained · 150 unmodified lines
151151 F: drivers/net/hamradio/6pack.c
152152
153153 8169 10/100/1000 GIGABIT ETHERNET DRIVER
154+M: Realtek linux nic maintainers <nic_swsd@realtek.com>
154155 M: Francois Romieu <romieu@fr.zoreil.com>
155156 L: netdev@vger.kernel.org
156157 S: Maintained
@@ -1031,12 +1032,13 @@ W: http://www.fluff.org/ben/linux/ · 874 unmodified lines
10311032 S: Maintained
10321033 F: arch/arm/mach-s3c64xx/
10331034
1034−ARM/S5P ARM ARCHITECTURES
1035+ARM/S5P EXYNOS ARM ARCHITECTURES
10351036 M: Kukjin Kim <kgene.kim@samsung.com>
10361037 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
10371038 L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
10381039 S: Maintained
10391040 F: arch/arm/mach-s5p*/
1041+F: arch/arm/mach-exynos*/
10401042
10411043 ARM/SAMSUNG MOBILE MACHINE SUPPORT
10421044 M: Kyungmin Park <kyungmin.park@samsung.com>
@@ -2807,42 +2809,23 @@ GPIO SUBSYSTEM · 1764 unmodified lines
28072809 M: Grant Likely <grant.likely@secretlab.ca>
28082810 S: Maintained
28092811 T: git git://git.secretlab.ca/git/linux-2.6.git
2810−F: Documentation/gpio/gpio.txt
2812+F: Documentation/gpio.txt
28112813 F: drivers/gpio/
28122814 F: include/linux/gpio*
28132815
2816+GRE DEMULTIPLEXER DRIVER
2817+M: Dmitry Kozlov <xeb@mail.ru>
2818+L: netdev@vger.kernel.org
2819+S: Maintained
2820+F: net/ipv4/gre.c
2821+F: include/net/gre.h
2822+
28142823 GRETH 10/100/1G Ethernet MAC device driver
28152824 M: Kristoffer Glembo <kristoffer@gaisler.com>
28162825 L: netdev@vger.kernel.org
28172826 S: Maintained
28182827 F: drivers/net/greth*
28192828
2820−HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER
2821−M: Frank Seidel <frank@f-seidel.de>
2822−L: platform-driver-x86@vger.kernel.org
2823−W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/
2824−S: Maintained
2825−F: drivers/platform/x86/hdaps.c
2826−
2827−HWPOISON MEMORY FAILURE HANDLING
2828−M: Andi Kleen <andi@firstfloor.org>
2829−L: linux-mm@kvack.org
2830−T: git git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6.git hwpoison
2831−S: Maintained
2832−F: mm/memory-failure.c
2833−F: mm/hwpoison-inject.c
2834−
2835−HYPERVISOR VIRTUAL CONSOLE DRIVER
2836−L: linuxppc-dev@lists.ozlabs.org
2837−S: Odd Fixes
2838−F: drivers/tty/hvc/
2839−
2840−iSCSI BOOT FIRMWARE TABLE (iBFT) DRIVER
2841−M: Peter Jones <pjones@redhat.com>
2842−M: Konrad Rzeszutek Wilk <konrad@kernel.org>
2843−S: Maintained
2844−F: drivers/firmware/iscsi_ibft*
2845−
28462829 GSPCA FINEPIX SUBDRIVER
28472830 M: Frank Zago <frank@zago.net>
28482831 L: linux-media@vger.kernel.org
@@ -2893,6 +2876,26 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git · 44 unmodified lines
28932876 S: Maintained
28942877 F: drivers/media/video/gspca/
28952878
2879+HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER
2880+M: Frank Seidel <frank@f-seidel.de>
2881+L: platform-driver-x86@vger.kernel.org
2882+W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/
2883+S: Maintained
2884+F: drivers/platform/x86/hdaps.c
2885+
2886+HWPOISON MEMORY FAILURE HANDLING
2887+M: Andi Kleen <andi@firstfloor.org>
2888+L: linux-mm@kvack.org
2889+T: git git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6.git hwpoison
2890+S: Maintained
2891+F: mm/memory-failure.c
2892+F: mm/hwpoison-inject.c
2893+
2894+HYPERVISOR VIRTUAL CONSOLE DRIVER
2895+L: linuxppc-dev@lists.ozlabs.org
2896+S: Odd Fixes
2897+F: drivers/tty/hvc/
2898+
28962899 HARDWARE MONITORING
28972900 M: Jean Delvare <khali@linux-fr.org>
28982901 M: Guenter Roeck <guenter.roeck@ericsson.com>
@@ -3476,6 +3479,12 @@ F: Documentation/isapnp.txt · 577 unmodified lines
34763479 F: drivers/pnp/isapnp/
34773480 F: include/linux/isapnp.h
34783481
3482+iSCSI BOOT FIRMWARE TABLE (iBFT) DRIVER
3483+M: Peter Jones <pjones@redhat.com>
3484+M: Konrad Rzeszutek Wilk <konrad@kernel.org>
3485+S: Maintained
3486+F: drivers/firmware/iscsi_ibft*
3487+
34793488 ISCSI
34803489 M: Mike Christie <michaelc@cs.wisc.edu>
34813490 L: open-iscsi@googlegroups.com
@@ -4987,6 +4996,13 @@ F: Documentation/pps/ · 1505 unmodified lines
49874996 F: drivers/pps/
49884997 F: include/linux/pps*.h
49894998
4999+PPTP DRIVER
5000+M: Dmitry Kozlov <xeb@mail.ru>
5001+L: netdev@vger.kernel.org
5002+S: Maintained
5003+F: drivers/net/pptp.c
5004+W: http://sourceforge.net/projects/accel-pptp
5005+
49905006 PREEMPTIBLE KERNEL
49915007 M: Robert Love <rml@tech9.net>
49925008 L: kpreempt-tech@lists.sourceforge.net
@@ -5395,7 +5411,7 @@ F: drivers/media/video/*7146* · 402 unmodified lines
53955411 F: include/media/*7146*
53965412
53975413 SAMSUNG AUDIO (ASoC) DRIVERS
5398−M: Jassi Brar <jassi.brar@samsung.com>
5414+M: Jassi Brar <jassisinghbrar@gmail.com>
53995415 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
54005416 S: Supported
54015417 F: sound/soc/samsung
@@ -6554,7 +6570,7 @@ S: Maintained · 1152 unmodified lines
65546570 F: drivers/usb/host/uhci*
65556571
65566572 USB "USBNET" DRIVER FRAMEWORK
6557−M: David Brownell <dbrownell@users.sourceforge.net>
6573+M: Oliver Neukum <oneukum@suse.de>
65586574 L: netdev@vger.kernel.org
65596575 W: http://www.linux-usb.org/usbnet
65606576 S: Maintained
@@ -6920,6 +6936,18 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86. · 359 unmodified lines
69206936 S: Maintained
69216937 F: drivers/platform/x86
69226938
6939+XEN HYPERVISOR INTERFACE
6940+M: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
6941+M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
6942+L: xen-devel@lists.xensource.com (moderated for non-subscribers)
6943+L: virtualization@lists.linux-foundation.org
6944+S: Supported
6945+F: arch/x86/xen/
6946+F: drivers/*/xen-*front.c
6947+F: drivers/xen/
6948+F: arch/x86/include/asm/xen/
6949+F: include/xen/
6950+
69236951 XEN NETWORK BACKEND DRIVER
69246952 M: Ian Campbell <ian.campbell@citrix.com>
69256953 L: xen-devel@lists.xensource.com (moderated for non-subscribers)
@@ -6941,18 +6969,6 @@ S: Supported · 15 unmodified lines
69416969 F: arch/x86/xen/*swiotlb*
69426970 F: drivers/xen/*swiotlb*
69436971
6944−XEN HYPERVISOR INTERFACE
6945−M: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
6946−M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
6947−L: xen-devel@lists.xensource.com (moderated for non-subscribers)
6948−L: virtualization@lists.linux-foundation.org
6949−S: Supported
6950−F: arch/x86/xen/
6951−F: drivers/*/xen-*front.c
6952−F: drivers/xen/
6953−F: arch/x86/include/asm/xen/
6954−F: include/xen/
6955−
69566972 XFS FILESYSTEM
69576973 P: Silicon Graphics Inc
69586974 M: Alex Elder <aelder@sgi.com>
@@ -7022,20 +7038,6 @@ M: "Maciej W. Rozycki" <macro@linux-mips.org> · 63 unmodified lines
70227038 S: Maintained
70237039 F: drivers/tty/serial/zs.*
70247040
7025−GRE DEMULTIPLEXER DRIVER
7026−M: Dmitry Kozlov <xeb@mail.ru>
7027−L: netdev@vger.kernel.org
7028−S: Maintained
7029−F: net/ipv4/gre.c
7030−F: include/net/gre.h
7031−
7032−PPTP DRIVER
7033−M: Dmitry Kozlov <xeb@mail.ru>
7034−L: netdev@vger.kernel.org
7035−S: Maintained
7036−F: drivers/net/pptp.c
7037−W: http://sourceforge.net/projects/accel-pptp
7038−
70397041 THE REST
70407042 M: Linus Torvalds <torvalds@linux-foundation.org>
70417043 L: linux-kernel@vger.kernel.org
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 2
22 PATCHLEVEL = 6
33 SUBLEVEL = 39
4−EXTRAVERSION = -rc4
4+EXTRAVERSION =
55 NAME = Flesh-Eating Bats with Fangs
66
77 # *DOCUMENTATION*
arch/alpha/include/asm/unistd.h+5−1
@@ -452,10 +452,14 @@ · 451 unmodified lines
452452 #define __NR_fanotify_init 494
453453 #define __NR_fanotify_mark 495
454454 #define __NR_prlimit64 496
455+#define __NR_name_to_handle_at 497
456+#define __NR_open_by_handle_at 498
457+#define __NR_clock_adjtime 499
458+#define __NR_syncfs 500
455459
456460 #ifdef __KERNEL__
457461
458−#define NR_SYSCALLS 497
462+#define NR_SYSCALLS 501
459463
460464 #define __ARCH_WANT_IPC_PARSE_VERSION
461465 #define __ARCH_WANT_OLD_READDIR
arch/alpha/kernel/systbls.S+8−4
@@ -498,23 +498,27 @@ sys_call_table: · 497 unmodified lines
498498 .quad sys_ni_syscall /* sys_timerfd */
499499 .quad sys_eventfd
500500 .quad sys_recvmmsg
501− .quad sys_fallocate /* 480 */
501+ .quad sys_fallocate /* 480 */
502502 .quad sys_timerfd_create
503503 .quad sys_timerfd_settime
504504 .quad sys_timerfd_gettime
505505 .quad sys_signalfd4
506− .quad sys_eventfd2 /* 485 */
506+ .quad sys_eventfd2 /* 485 */
507507 .quad sys_epoll_create1
508508 .quad sys_dup3
509509 .quad sys_pipe2
510510 .quad sys_inotify_init1
511− .quad sys_preadv /* 490 */
511+ .quad sys_preadv /* 490 */
512512 .quad sys_pwritev
513513 .quad sys_rt_tgsigqueueinfo
514514 .quad sys_perf_event_open
515515 .quad sys_fanotify_init
516− .quad sys_fanotify_mark /* 495 */
516+ .quad sys_fanotify_mark /* 495 */
517517 .quad sys_prlimit64
518+ .quad sys_name_to_handle_at
519+ .quad sys_open_by_handle_at
520+ .quad sys_clock_adjtime
521+ .quad sys_syncfs /* 500 */
518522
519523 .size sys_call_table, . - sys_call_table
520524 .type sys_call_table, @object
arch/alpha/kernel/time.c+1−2
@@ -375,8 +375,7 @@ static struct clocksource clocksource_rpcc = { · 374 unmodified lines
375375
376376 static inline void register_rpcc_clocksource(long cycle_freq)
377377 {
378− clocksource_calc_mult_shift(&clocksource_rpcc, cycle_freq, 4);
379− clocksource_register(&clocksource_rpcc);
378+ clocksource_register_hz(&clocksource_rpcc, cycle_freq);
380379 }
381380 #else /* !CONFIG_SMP */
382381 static inline void register_rpcc_clocksource(long cycle_freq)
arch/arm/boot/compressed/Makefile+1−1
@@ -74,7 +74,7 @@ ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT) · 73 unmodified lines
7474 ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS)
7575 else
7676 ZTEXTADDR := 0
77−ZBSSADDR := ALIGN(4)
77+ZBSSADDR := ALIGN(8)
7878 endif
7979
8080 SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
arch/arm/boot/compressed/head.S+24−11
@@ -179,15 +179,14 @@ not_angel: · 178 unmodified lines
179179 bl cache_on
180180
181181 restart: adr r0, LC0
182− ldmia r0, {r1, r2, r3, r5, r6, r9, r11, r12}
183− ldr sp, [r0, #32]
182+ ldmia r0, {r1, r2, r3, r6, r9, r11, r12}
183+ ldr sp, [r0, #28]
184184
185185 /*
186186 * We might be running at a different address. We need
187187 * to fix up various pointers.
188188 */
189189 sub r0, r0, r1 @ calculate the delta offset
190− add r5, r5, r0 @ _start
191190 add r6, r6, r0 @ _edata
192191
193192 #ifndef CONFIG_ZBOOT_ROM
@@ -206,31 +205,40 @@ restart: adr r0, LC0 · 12 unmodified lines
206205 /*
207206 * Check to see if we will overwrite ourselves.
208207 * r4 = final kernel address
209− * r5 = start of this image
210208 * r9 = size of decompressed image
211209 * r10 = end of this image, including bss/stack/malloc space if non XIP
212210 * We basically want:
213− * r4 >= r10 -> OK
214− * r4 + image length <= r5 -> OK
211+ * r4 - 16k page directory >= r10 -> OK
212+ * r4 + image length <= current position (pc) -> OK
215213 */
214+ add r10, r10, #16384
216215 cmp r4, r10
217216 bhs wont_overwrite
218217 add r10, r4, r9
219− cmp r10, r5
218+ ARM( cmp r10, pc )
219+ THUMB( mov lr, pc )
220+ THUMB( cmp r10, lr )
220221 bls wont_overwrite
221222
222223 /*
223224 * Relocate ourselves past the end of the decompressed kernel.
224− * r5 = start of this image
225225 * r6 = _edata
226226 * r10 = end of the decompressed kernel
227227 * Because we always copy ahead, we need to do it from the end and go
228228 * backward in case the source and destination overlap.
229229 */
230− /* Round up to next 256-byte boundary. */
231− add r10, r10, #256
230+ /*
231+ * Bump to the next 256-byte boundary with the size of
232+ * the relocation code added. This avoids overwriting
233+ * ourself when the offset is small.
234+ */
235+ add r10, r10, #((reloc_code_end - restart + 256) & ~255)
232236 bic r10, r10, #255
233237
238+ /* Get start of code we want to copy and align it down. */
239+ adr r5, restart
240+ bic r5, r5, #31
241+
234242 sub r9, r6, r5 @ size to copy
235243 add r9, r9, #31 @ rounded up to a multiple
236244 bic r9, r9, #31 @ ... of 32 bytes
@@ -245,6 +253,11 @@ restart: adr r0, LC0 · 8 unmodified lines
245253 /* Preserve offset to relocated code. */
246254 sub r6, r9, r6
247255
256+#ifndef CONFIG_ZBOOT_ROM
257+ /* cache_clean_flush may use the stack, so relocate it */
258+ add sp, sp, r6
259+#endif
260+
248261 bl cache_clean_flush
249262
250263 adr r0, BSYM(restart)
@@ -333,7 +346,6 @@ not_relocated: mov r0, #0 · 82 unmodified lines
333346 LC0: .word LC0 @ r1
334347 .word __bss_start @ r2
335348 .word _end @ r3
336− .word _start @ r5
337349 .word _edata @ r6
338350 .word _image_size @ r9
339351 .word _got_start @ r11
@@ -1062,6 +1074,7 @@ memdump: mov r12, r0 · 722 unmodified lines
10621074 #endif
10631075
10641076 .ltorg
1077+reloc_code_end:
10651078
10661079 .align
10671080 .section ".stack", "aw", %nobits
arch/arm/boot/compressed/vmlinux.lds.in+1−0
@@ -54,6 +54,7 @@ SECTIONS · 53 unmodified lines
5454 .bss : { *(.bss) }
5555 _end = .;
5656
57+ . = ALIGN(8); /* the stack must be 64-bit aligned */
5758 .stack : { *(.stack) }
5859
5960 .stab 0 : { *(.stab) }
arch/arm/configs/at91x40_defconfig+48−0
@@ -0,0 +1,48 @@
1+CONFIG_EXPERIMENTAL=y
2+CONFIG_LOG_BUF_SHIFT=14
3+CONFIG_EMBEDDED=y
4+# CONFIG_HOTPLUG is not set
5+# CONFIG_ELF_CORE is not set
6+# CONFIG_FUTEX is not set
7+# CONFIG_TIMERFD is not set
8+# CONFIG_VM_EVENT_COUNTERS is not set
9+# CONFIG_COMPAT_BRK is not set
10+CONFIG_SLAB=y
11+# CONFIG_LBDAF is not set
12+# CONFIG_BLK_DEV_BSG is not set
13+# CONFIG_IOSCHED_DEADLINE is not set
14+# CONFIG_IOSCHED_CFQ is not set
15+# CONFIG_MMU is not set
16+CONFIG_ARCH_AT91=y
17+CONFIG_ARCH_AT91X40=y
18+CONFIG_MACH_AT91EB01=y
19+CONFIG_AT91_EARLY_USART0=y
20+CONFIG_CPU_ARM7TDMI=y
21+CONFIG_SET_MEM_PARAM=y
22+CONFIG_DRAM_BASE=0x01000000
23+CONFIG_DRAM_SIZE=0x00400000
24+CONFIG_FLASH_MEM_BASE=0x01400000
25+CONFIG_PROCESSOR_ID=0x14000040
26+CONFIG_ZBOOT_ROM_TEXT=0x0
27+CONFIG_ZBOOT_ROM_BSS=0x0
28+CONFIG_BINFMT_FLAT=y
29+# CONFIG_SUSPEND is not set
30+# CONFIG_FW_LOADER is not set
31+CONFIG_MTD=y
32+CONFIG_MTD_PARTITIONS=y
33+CONFIG_MTD_CHAR=y
34+CONFIG_MTD_BLOCK=y
35+CONFIG_MTD_RAM=y
36+CONFIG_MTD_ROM=y
37+CONFIG_BLK_DEV_RAM=y
38+# CONFIG_INPUT is not set
39+# CONFIG_SERIO is not set
40+# CONFIG_VT is not set
41+# CONFIG_DEVKMEM is not set
42+# CONFIG_HW_RANDOM is not set
43+# CONFIG_HWMON is not set
44+# CONFIG_USB_SUPPORT is not set
45+CONFIG_EXT2_FS=y
46+# CONFIG_DNOTIFY is not set
47+CONFIG_ROMFS_FS=y
48+# CONFIG_ENABLE_MUST_CHECK is not set
arch/arm/include/asm/cputype.h+1−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 #define __ASM_ARM_CPUTYPE_H
33
44 #include <linux/stringify.h>
5+#include <linux/kernel.h>
56
67 #define CPUID_ID 0
78 #define CPUID_CACHETYPE 1
arch/arm/include/asm/kprobes.h+3−0
@@ -39,10 +39,13 @@ typedef u32 kprobe_opcode_t; · 38 unmodified lines
3939 struct kprobe;
4040 typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *);
4141
42+typedef unsigned long (kprobe_check_cc)(unsigned long);
43+
4244 /* Architecture specific copy of original instruction. */
4345 struct arch_specific_insn {
4446 kprobe_opcode_t *insn;
4547 kprobe_insn_handler_t *insn_handler;
48+ kprobe_check_cc *insn_check_cc;
4649 };
4750
4851 struct prev_kprobe {
arch/arm/include/asm/system.h+1−1
@@ -159,7 +159,7 @@ extern unsigned int user_debug; · 158 unmodified lines
159159 #include <mach/barriers.h>
160160 #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
161161 #define mb() do { dsb(); outer_sync(); } while (0)
162−#define rmb() dmb()
162+#define rmb() dsb()
163163 #define wmb() mb()
164164 #else
165165 #include <asm/memory.h>
arch/arm/include/asm/unistd.h+4−0
@@ -396,6 +396,10 @@ · 395 unmodified lines
396396 #define __NR_fanotify_init (__NR_SYSCALL_BASE+367)
397397 #define __NR_fanotify_mark (__NR_SYSCALL_BASE+368)
398398 #define __NR_prlimit64 (__NR_SYSCALL_BASE+369)
399+#define __NR_name_to_handle_at (__NR_SYSCALL_BASE+370)
400+#define __NR_open_by_handle_at (__NR_SYSCALL_BASE+371)
401+#define __NR_clock_adjtime (__NR_SYSCALL_BASE+372)
402+#define __NR_syncfs (__NR_SYSCALL_BASE+373)
399403
400404 /*
401405 * The following SWIs are ARM private.
arch/arm/kernel/calls.S+4−0
@@ -379,6 +379,10 @@ · 378 unmodified lines
379379 CALL(sys_fanotify_init)
380380 CALL(sys_fanotify_mark)
381381 CALL(sys_prlimit64)
382+/* 370 */ CALL(sys_name_to_handle_at)
383+ CALL(sys_open_by_handle_at)
384+ CALL(sys_clock_adjtime)
385+ CALL(sys_syncfs)
382386 #ifndef syscalls_counted
383387 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
384388 #define syscalls_counted
arch/arm/kernel/kprobes-decode.c+457−320
@@ -34,9 +34,6 @@ · 33 unmodified lines
3434 *
3535 * *) If the PC is written to by the instruction, the
3636 * instruction must be fully simulated in software.
37− * If it is a conditional instruction, the handler
38− * will use insn[0] to copy its condition code to
39− * set r0 to 1 and insn[1] to "mov pc, lr" to return.
4037 *
4138 * *) Otherwise, a modified form of the instruction is
4239 * directly executed. Its handler calls the
@@ -68,13 +65,17 @@ · 25 unmodified lines
6865
6966 #define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25)
7067
68+#define is_r15(insn, bitpos) (((insn) & (0xf << bitpos)) == (0xf << bitpos))
69+
70+/*
71+ * Test if load/store instructions writeback the address register.
72+ * if P (bit 24) == 0 or W (bit 21) == 1
73+ */
74+#define is_writeback(insn) ((insn ^ 0x01000000) & 0x01200000)
75+
7176 #define PSR_fs (PSR_f|PSR_s)
7277
7378 #define KPROBE_RETURN_INSTRUCTION 0xe1a0f00e /* mov pc, lr */
74−#define SET_R0_TRUE_INSTRUCTION 0xe3a00001 /* mov r0, #1 */
75−
76−#define truecc_insn(insn) (((insn) & 0xf0000000) | \
77− (SET_R0_TRUE_INSTRUCTION & 0x0fffffff))
7879
7980 typedef long (insn_0arg_fn_t)(void);
8081 typedef long (insn_1arg_fn_t)(long);
@@ -419,14 +420,10 @@ insnslot_llret_4arg_rwflags(long r0, long r1, long r2, long r3, long *cpsr, · 338 unmodified lines
419420
420421 static void __kprobes simulate_bbl(struct kprobe *p, struct pt_regs *regs)
421422 {
422− insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
423423 kprobe_opcode_t insn = p->opcode;
424424 long iaddr = (long)p->addr;
425425 int disp = branch_displacement(insn);
426426
427− if (!insnslot_1arg_rflags(0, regs->ARM_cpsr, i_fn))
428− return;
429−
430427 if (insn & (1 << 24))
431428 regs->ARM_lr = iaddr + 4;
432429
@@ -446,14 +443,10 @@ static void __kprobes simulate_blx1(struct kprobe *p, struct pt_regs *regs) · 13 unmodified lines
446443
447444 static void __kprobes simulate_blx2bx(struct kprobe *p, struct pt_regs *regs)
448445 {
449− insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
450446 kprobe_opcode_t insn = p->opcode;
451447 int rm = insn & 0xf;
452448 long rmv = regs->uregs[rm];
453449
454− if (!insnslot_1arg_rflags(0, regs->ARM_cpsr, i_fn))
455− return;
456−
457450 if (insn & (1 << 5))
458451 regs->ARM_lr = (long)p->addr + 4;
459452
@@ -463,9 +456,16 @@ static void __kprobes simulate_blx2bx(struct kprobe *p, struct pt_regs *regs) · 3 unmodified lines
463456 regs->ARM_cpsr |= PSR_T_BIT;
464457 }
465458
459+static void __kprobes simulate_mrs(struct kprobe *p, struct pt_regs *regs)
460+{
461+ kprobe_opcode_t insn = p->opcode;
462+ int rd = (insn >> 12) & 0xf;
463+ unsigned long mask = 0xf8ff03df; /* Mask out execution state */
464+ regs->uregs[rd] = regs->ARM_cpsr & mask;
465+}
466+
466467 static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs)
467468 {
468− insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
469469 kprobe_opcode_t insn = p->opcode;
470470 int rn = (insn >> 16) & 0xf;
471471 int lbit = insn & (1 << 20);
@@ -476,9 +476,6 @@ static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs) · 4 unmodified lines
476476 int reg_bit_vector;
477477 int reg_count;
478478
479− if (!insnslot_1arg_rflags(0, regs->ARM_cpsr, i_fn))
480− return;
481−
482479 reg_count = 0;
483480 reg_bit_vector = insn & 0xffff;
484481 while (reg_bit_vector) {
@@ -510,11 +507,6 @@ static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs) · 25 unmodified lines
510507
511508 static void __kprobes simulate_stm1_pc(struct kprobe *p, struct pt_regs *regs)
512509 {
513− insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
514−
515− if (!insnslot_1arg_rflags(0, regs->ARM_cpsr, i_fn))
516− return;
517−
518510 regs->ARM_pc = (long)p->addr + str_pc_offset;
519511 simulate_ldm1stm1(p, regs);
520512 regs->ARM_pc = (long)p->addr + 4;
@@ -525,24 +517,16 @@ static void __kprobes simulate_mov_ipsp(struct kprobe *p, struct pt_regs *regs) · 4 unmodified lines
525517 regs->uregs[12] = regs->uregs[13];
526518 }
527519
528−static void __kprobes emulate_ldcstc(struct kprobe *p, struct pt_regs *regs)
529−{
530− insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
531− kprobe_opcode_t insn = p->opcode;
532− int rn = (insn >> 16) & 0xf;
533− long rnv = regs->uregs[rn];
534−
535− /* Save Rn in case of writeback. */
536− regs->uregs[rn] = insnslot_1arg_rflags(rnv, regs->ARM_cpsr, i_fn);
537−}
538−
539520 static void __kprobes emulate_ldrd(struct kprobe *p, struct pt_regs *regs)
540521 {
541522 insn_2arg_fn_t *i_fn = (insn_2arg_fn_t *)&p->ainsn.insn[0];
542523 kprobe_opcode_t insn = p->opcode;
524+ long ppc = (long)p->addr + 8;
543525 int rd = (insn >> 12) & 0xf;
544526 int rn = (insn >> 16) & 0xf;
545527 int rm = insn & 0xf; /* rm may be invalid, don't care. */
528+ long rmv = (rm == 15) ? ppc : regs->uregs[rm];
529+ long rnv = (rn == 15) ? ppc : regs->uregs[rn];
546530
547531 /* Not following the C calling convention here, so need asm(). */
548532 __asm__ __volatile__ (
@@ -554,29 +538,36 @@ static void __kprobes emulate_ldrd(struct kprobe *p, struct pt_regs *regs) · 5 unmodified lines
554538 "str r0, %[rn] \n\t" /* in case of writeback */
555539 "str r2, %[rd0] \n\t"
556540 "str r3, %[rd1] \n\t"
557− : [rn] "+m" (regs->uregs[rn]),
541+ : [rn] "+m" (rnv),
558542 [rd0] "=m" (regs->uregs[rd]),
559543 [rd1] "=m" (regs->uregs[rd+1])
560− : [rm] "m" (regs->uregs[rm]),
544+ : [rm] "m" (rmv),
561545 [cpsr] "r" (regs->ARM_cpsr),
562546 [i_fn] "r" (i_fn)
563547 : "r0", "r1", "r2", "r3", "lr", "cc"
564548 );
549+ if (is_writeback(insn))
550+ regs->uregs[rn] = rnv;
565551 }
566552
567553 static void __kprobes emulate_strd(struct kprobe *p, struct pt_regs *regs)
568554 {
569555 insn_4arg_fn_t *i_fn = (insn_4arg_fn_t *)&p->ainsn.insn[0];
570556 kprobe_opcode_t insn = p->opcode;
557+ long ppc = (long)p->addr + 8;
571558 int rd = (insn >> 12) & 0xf;
572559 int rn = (insn >> 16) & 0xf;
573560 int rm = insn & 0xf;
574− long rnv = regs->uregs[rn];
575− long rmv = regs->uregs[rm]; /* rm/rmv may be invalid, don't care. */
561+ long rnv = (rn == 15) ? ppc : regs->uregs[rn];
562+ /* rm/rmv may be invalid, don't care. */
563+ long rmv = (rm == 15) ? ppc : regs->uregs[rm];
564+ long rnv_wb;
576565
577− regs->uregs[rn] = insnslot_4arg_rflags(rnv, rmv, regs->uregs[rd],
566+ rnv_wb = insnslot_4arg_rflags(rnv, rmv, regs->uregs[rd],
578567 regs->uregs[rd+1],
579568 regs->ARM_cpsr, i_fn);
569+ if (is_writeback(insn))
570+ regs->uregs[rn] = rnv_wb;
580571 }
581572
582573 static void __kprobes emulate_ldr(struct kprobe *p, struct pt_regs *regs)
@@ -630,31 +621,6 @@ static void __kprobes emulate_str(struct kprobe *p, struct pt_regs *regs) · 47 unmodified lines
630621 regs->uregs[rn] = rnv_wb; /* Save Rn in case of writeback. */
631622 }
632623
633−static void __kprobes emulate_mrrc(struct kprobe *p, struct pt_regs *regs)
634−{
635− insn_llret_0arg_fn_t *i_fn = (insn_llret_0arg_fn_t *)&p->ainsn.insn[0];
636− kprobe_opcode_t insn = p->opcode;
637− union reg_pair fnr;
638− int rd = (insn >> 12) & 0xf;
639− int rn = (insn >> 16) & 0xf;
640−
641− fnr.dr = insnslot_llret_0arg_rflags(regs->ARM_cpsr, i_fn);
642− regs->uregs[rn] = fnr.r0;
643− regs->uregs[rd] = fnr.r1;
644−}
645−
646−static void __kprobes emulate_mcrr(struct kprobe *p, struct pt_regs *regs)
647−{
648− insn_2arg_fn_t *i_fn = (insn_2arg_fn_t *)&p->ainsn.insn[0];
649− kprobe_opcode_t insn = p->opcode;
650− int rd = (insn >> 12) & 0xf;
651− int rn = (insn >> 16) & 0xf;
652− long rnv = regs->uregs[rn];
653− long rdv = regs->uregs[rd];
654−
655− insnslot_2arg_rflags(rnv, rdv, regs->ARM_cpsr, i_fn);
656−}
657−
658624 static void __kprobes emulate_sat(struct kprobe *p, struct pt_regs *regs)
659625 {
660626 insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
@@ -688,32 +654,32 @@ static void __kprobes emulate_none(struct kprobe *p, struct pt_regs *regs) · 27 unmodified lines
688654 insnslot_0arg_rflags(regs->ARM_cpsr, i_fn);
689655 }
690656
691−static void __kprobes emulate_rd12(struct kprobe *p, struct pt_regs *regs)
657+static void __kprobes emulate_nop(struct kprobe *p, struct pt_regs *regs)
692658 {
693− insn_0arg_fn_t *i_fn = (insn_0arg_fn_t *)&p->ainsn.insn[0];
694− kprobe_opcode_t insn = p->opcode;
695− int rd = (insn >> 12) & 0xf;
696−
697− regs->uregs[rd] = insnslot_0arg_rflags(regs->ARM_cpsr, i_fn);
698659 }
699660
700−static void __kprobes emulate_ird12(struct kprobe *p, struct pt_regs *regs)
661+static void __kprobes
662+emulate_rd12_modify(struct kprobe *p, struct pt_regs *regs)
701663 {
702664 insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
703665 kprobe_opcode_t insn = p->opcode;
704− int ird = (insn >> 12) & 0xf;
666+ int rd = (insn >> 12) & 0xf;
667+ long rdv = regs->uregs[rd];
705668
706− insnslot_1arg_rflags(regs->uregs[ird], regs->ARM_cpsr, i_fn);
669+ regs->uregs[rd] = insnslot_1arg_rflags(rdv, regs->ARM_cpsr, i_fn);
707670 }
708671
709−static void __kprobes emulate_rn16(struct kprobe *p, struct pt_regs *regs)
672+static void __kprobes
673+emulate_rd12rn0_modify(struct kprobe *p, struct pt_regs *regs)
710674 {
711− insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
675+ insn_2arg_fn_t *i_fn = (insn_2arg_fn_t *)&p->ainsn.insn[0];
712676 kprobe_opcode_t insn = p->opcode;
713− int rn = (insn >> 16) & 0xf;
677+ int rd = (insn >> 12) & 0xf;
678+ int rn = insn & 0xf;
679+ long rdv = regs->uregs[rd];
714680 long rnv = regs->uregs[rn];
715681
716− insnslot_1arg_rflags(rnv, regs->ARM_cpsr, i_fn);
682+ regs->uregs[rd] = insnslot_2arg_rflags(rdv, rnv, regs->ARM_cpsr, i_fn);
717683 }
718684
719685 static void __kprobes emulate_rd12rm0(struct kprobe *p, struct pt_regs *regs)
@@ -818,6 +784,17 @@ emulate_alu_imm_rwflags(struct kprobe *p, struct pt_regs *regs) · 98 unmodified lines
818784 regs->uregs[rd] = insnslot_1arg_rwflags(rnv, &regs->ARM_cpsr, i_fn);
819785 }
820786
787+static void __kprobes
788+emulate_alu_tests_imm(struct kprobe *p, struct pt_regs *regs)
789+{
790+ insn_1arg_fn_t *i_fn = (insn_1arg_fn_t *)&p->ainsn.insn[0];
791+ kprobe_opcode_t insn = p->opcode;
792+ int rn = (insn >> 16) & 0xf;
793+ long rnv = (rn == 15) ? (long)p->addr + 8 : regs->uregs[rn];
794+
795+ insnslot_1arg_rwflags(rnv, &regs->ARM_cpsr, i_fn);
796+}
797+
821798 static void __kprobes
822799 emulate_alu_rflags(struct kprobe *p, struct pt_regs *regs)
823800 {
@@ -854,14 +831,34 @@ emulate_alu_rwflags(struct kprobe *p, struct pt_regs *regs) · 30 unmodified lines
854831 insnslot_3arg_rwflags(rnv, rmv, rsv, &regs->ARM_cpsr, i_fn);
855832 }
856833
834+static void __kprobes
835+emulate_alu_tests(struct kprobe *p, struct pt_regs *regs)
836+{
837+ insn_3arg_fn_t *i_fn = (insn_3arg_fn_t *)&p->ainsn.insn[0];
838+ kprobe_opcode_t insn = p->opcode;
839+ long ppc = (long)p->addr + 8;
840+ int rn = (insn >> 16) & 0xf;
841+ int rs = (insn >> 8) & 0xf; /* rs/rsv may be invalid, don't care. */
842+ int rm = insn & 0xf;
843+ long rnv = (rn == 15) ? ppc : regs->uregs[rn];
844+ long rmv = (rm == 15) ? ppc : regs->uregs[rm];
845+ long rsv = regs->uregs[rs];
846+
847+ insnslot_3arg_rwflags(rnv, rmv, rsv, &regs->ARM_cpsr, i_fn);
848+}
849+
857850 static enum kprobe_insn __kprobes
858851 prep_emulate_ldr_str(kprobe_opcode_t insn, struct arch_specific_insn *asi)
859852 {
860− int ibit = (insn & (1 << 26)) ? 25 : 22;
853+ int not_imm = (insn & (1 << 26)) ? (insn & (1 << 25))
854+ : (~insn & (1 << 22));
855+
856+ if (is_writeback(insn) && is_r15(insn, 16))
857+ return INSN_REJECTED; /* Writeback to PC */
861858
862859 insn &= 0xfff00fff;
863860 insn |= 0x00001000; /* Rn = r0, Rd = r1 */
864− if (insn & (1 << ibit)) {
861+ if (not_imm) {
865862 insn &= ~0xf;
866863 insn |= 2; /* Rm = r2 */
867864 }
@@ -871,20 +868,40 @@ prep_emulate_ldr_str(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 3 unmodified lines
871868 }
872869
873870 static enum kprobe_insn __kprobes
874−prep_emulate_rd12rm0(kprobe_opcode_t insn, struct arch_specific_insn *asi)
871+prep_emulate_rd12_modify(kprobe_opcode_t insn, struct arch_specific_insn *asi)
875872 {
876− insn &= 0xffff0ff0; /* Rd = r0, Rm = r0 */
873+ if (is_r15(insn, 12))
874+ return INSN_REJECTED; /* Rd is PC */
875+
876+ insn &= 0xffff0fff; /* Rd = r0 */
877877 asi->insn[0] = insn;
878− asi->insn_handler = emulate_rd12rm0;
878+ asi->insn_handler = emulate_rd12_modify;
879879 return INSN_GOOD;
880880 }
881881
882882 static enum kprobe_insn __kprobes
883−prep_emulate_rd12(kprobe_opcode_t insn, struct arch_specific_insn *asi)
883+prep_emulate_rd12rn0_modify(kprobe_opcode_t insn,
884+ struct arch_specific_insn *asi)
884885 {
885− insn &= 0xffff0fff; /* Rd = r0 */
886+ if (is_r15(insn, 12))
887+ return INSN_REJECTED; /* Rd is PC */
888+
889+ insn &= 0xffff0ff0; /* Rd = r0 */
890+ insn |= 0x00000001; /* Rn = r1 */
891+ asi->insn[0] = insn;
892+ asi->insn_handler = emulate_rd12rn0_modify;
893+ return INSN_GOOD;
894+}
895+
896+static enum kprobe_insn __kprobes
897+prep_emulate_rd12rm0(kprobe_opcode_t insn, struct arch_specific_insn *asi)
898+{
899+ if (is_r15(insn, 12))
900+ return INSN_REJECTED; /* Rd is PC */
901+
902+ insn &= 0xffff0ff0; /* Rd = r0, Rm = r0 */
886903 asi->insn[0] = insn;
887− asi->insn_handler = emulate_rd12;
904+ asi->insn_handler = emulate_rd12rm0;
888905 return INSN_GOOD;
889906 }
890907
@@ -892,6 +909,9 @@ static enum kprobe_insn __kprobes · 1 unmodified line
892909 prep_emulate_rd12rn16rm0_wflags(kprobe_opcode_t insn,
893910 struct arch_specific_insn *asi)
894911 {
912+ if (is_r15(insn, 12))
913+ return INSN_REJECTED; /* Rd is PC */
914+
895915 insn &= 0xfff00ff0; /* Rd = r0, Rn = r0 */
896916 insn |= 0x00000001; /* Rm = r1 */
897917 asi->insn[0] = insn;
@@ -903,6 +923,9 @@ static enum kprobe_insn __kprobes · 5 unmodified lines
903923 prep_emulate_rd16rs8rm0_wflags(kprobe_opcode_t insn,
904924 struct arch_specific_insn *asi)
905925 {
926+ if (is_r15(insn, 16))
927+ return INSN_REJECTED; /* Rd is PC */
928+
906929 insn &= 0xfff0f0f0; /* Rd = r0, Rs = r0 */
907930 insn |= 0x00000001; /* Rm = r1 */
908931 asi->insn[0] = insn;
@@ -914,6 +937,9 @@ static enum kprobe_insn __kprobes · 5 unmodified lines
914937 prep_emulate_rd16rn12rs8rm0_wflags(kprobe_opcode_t insn,
915938 struct arch_specific_insn *asi)
916939 {
940+ if (is_r15(insn, 16))
941+ return INSN_REJECTED; /* Rd is PC */
942+
917943 insn &= 0xfff000f0; /* Rd = r0, Rn = r0 */
918944 insn |= 0x00000102; /* Rs = r1, Rm = r2 */
919945 asi->insn[0] = insn;
@@ -925,6 +951,9 @@ static enum kprobe_insn __kprobes · 5 unmodified lines
925951 prep_emulate_rdhi16rdlo12rs8rm0_wflags(kprobe_opcode_t insn,
926952 struct arch_specific_insn *asi)
927953 {
954+ if (is_r15(insn, 16) || is_r15(insn, 12))
955+ return INSN_REJECTED; /* RdHi or RdLo is PC */
956+
928957 insn &= 0xfff000f0; /* RdHi = r0, RdLo = r1 */
929958 insn |= 0x00001203; /* Rs = r2, Rm = r3 */
930959 asi->insn[0] = insn;
@@ -945,20 +974,13 @@ prep_emulate_rdhi16rdlo12rs8rm0_wflags(kprobe_opcode_t insn, · 14 unmodified lines
945974 static enum kprobe_insn __kprobes
946975 space_1111(kprobe_opcode_t insn, struct arch_specific_insn *asi)
947976 {
948− /* CPS mmod == 1 : 1111 0001 0000 xx10 xxxx xxxx xx0x xxxx */
949− /* RFE : 1111 100x x0x1 xxxx xxxx 1010 xxxx xxxx */
950− /* SRS : 1111 100x x1x0 1101 xxxx 0101 xxxx xxxx */
951− if ((insn & 0xfff30020) == 0xf1020000 ||
952− (insn & 0xfe500f00) == 0xf8100a00 ||
953− (insn & 0xfe5f0f00) == 0xf84d0500)
954− return INSN_REJECTED;
955−
956− /* PLD : 1111 01x1 x101 xxxx xxxx xxxx xxxx xxxx : */
957− if ((insn & 0xfd700000) == 0xf4500000) {
958− insn &= 0xfff0ffff; /* Rn = r0 */
959− asi->insn[0] = insn;
960− asi->insn_handler = emulate_rn16;
961− return INSN_GOOD;
977+ /* memory hint : 1111 0100 x001 xxxx xxxx xxxx xxxx xxxx : */
978+ /* PLDI : 1111 0100 x101 xxxx xxxx xxxx xxxx xxxx : */
979+ /* PLDW : 1111 0101 x001 xxxx xxxx xxxx xxxx xxxx : */
980+ /* PLD : 1111 0101 x101 xxxx xxxx xxxx xxxx xxxx : */
981+ if ((insn & 0xfe300000) == 0xf4100000) {
982+ asi->insn_handler = emulate_nop;
983+ return INSN_GOOD_NO_SLOT;
962984 }
963985
964986 /* BLX(1) : 1111 101x xxxx xxxx xxxx xxxx xxxx xxxx : */
@@ -967,41 +989,22 @@ space_1111(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 2 unmodified lines
967989 return INSN_GOOD_NO_SLOT;
968990 }
969991
970− /* SETEND : 1111 0001 0000 0001 xxxx xxxx 0000 xxxx */
971− /* CDP2 : 1111 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
972− if ((insn & 0xffff00f0) == 0xf1010000 ||
973− (insn & 0xff000010) == 0xfe000000) {
974− asi->insn[0] = insn;
975− asi->insn_handler = emulate_none;
976− return INSN_GOOD;
977− }
992+ /* CPS : 1111 0001 0000 xxx0 xxxx xxxx xx0x xxxx */
993+ /* SETEND: 1111 0001 0000 0001 xxxx xxxx 0000 xxxx */
978994
995+ /* SRS : 1111 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
996+ /* RFE : 1111 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
997+
998+ /* Coprocessor instructions... */
979999 /* MCRR2 : 1111 1100 0100 xxxx xxxx xxxx xxxx xxxx : (Rd != Rn) */
9801000 /* MRRC2 : 1111 1100 0101 xxxx xxxx xxxx xxxx xxxx : (Rd != Rn) */
981− if ((insn & 0xffe00000) == 0xfc400000) {
982− insn &= 0xfff00fff; /* Rn = r0 */
983− insn |= 0x00001000; /* Rd = r1 */
984− asi->insn[0] = insn;
985− asi->insn_handler =
986− (insn & (1 << 20)) ? emulate_mrrc : emulate_mcrr;
987− return INSN_GOOD;
988− }
1001+ /* LDC2 : 1111 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
1002+ /* STC2 : 1111 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
1003+ /* CDP2 : 1111 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
1004+ /* MCR2 : 1111 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
1005+ /* MRC2 : 1111 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
9891006
990− /* LDC2 : 1111 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
991− /* STC2 : 1111 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
992− if ((insn & 0xfe000000) == 0xfc000000) {
993− insn &= 0xfff0ffff; /* Rn = r0 */
994− asi->insn[0] = insn;
995− asi->insn_handler = emulate_ldcstc;
996− return INSN_GOOD;
997− }
998−
999− /* MCR2 : 1111 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
1000− /* MRC2 : 1111 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
1001− insn &= 0xffff0fff; /* Rd = r0 */
1002− asi->insn[0] = insn;
1003− asi->insn_handler = (insn & (1 << 20)) ? emulate_rd12 : emulate_ird12;
1004− return INSN_GOOD;
1007+ return INSN_REJECTED;
10051008 }
10061009
10071010 static enum kprobe_insn __kprobes
@@ -1010,19 +1013,18 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 2 unmodified lines
10101013 /* cccc 0001 0xx0 xxxx xxxx xxxx xxxx xxx0 xxxx */
10111014 if ((insn & 0x0f900010) == 0x01000000) {
10121015
1013− /* BXJ : cccc 0001 0010 xxxx xxxx xxxx 0010 xxxx */
1014− /* MSR : cccc 0001 0x10 xxxx xxxx xxxx 0000 xxxx */
1015− if ((insn & 0x0ff000f0) == 0x01200020 ||
1016− (insn & 0x0fb000f0) == 0x01200000)
1017− return INSN_REJECTED;
1018−
1019− /* MRS : cccc 0001 0x00 xxxx xxxx xxxx 0000 xxxx */
1020− if ((insn & 0x0fb00010) == 0x01000000)
1021− return prep_emulate_rd12(insn, asi);
1016+ /* MRS cpsr : cccc 0001 0000 xxxx xxxx xxxx 0000 xxxx */
1017+ if ((insn & 0x0ff000f0) == 0x01000000) {
1018+ if (is_r15(insn, 12))
1019+ return INSN_REJECTED; /* Rd is PC */
1020+ asi->insn_handler = simulate_mrs;
1021+ return INSN_GOOD_NO_SLOT;
1022+ }
10221023
10231024 /* SMLALxy : cccc 0001 0100 xxxx xxxx xxxx 1xx0 xxxx */
10241025 if ((insn & 0x0ff00090) == 0x01400080)
1025− return prep_emulate_rdhi16rdlo12rs8rm0_wflags(insn, asi);
1026+ return prep_emulate_rdhi16rdlo12rs8rm0_wflags(insn,
1027+ asi);
10261028
10271029 /* SMULWy : cccc 0001 0010 xxxx xxxx xxxx 1x10 xxxx */
10281030 /* SMULxy : cccc 0001 0110 xxxx xxxx xxxx 1xx0 xxxx */
@@ -1031,24 +1033,29 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 2 unmodified lines
10311033 return prep_emulate_rd16rs8rm0_wflags(insn, asi);
10321034
10331035 /* SMLAxy : cccc 0001 0000 xxxx xxxx xxxx 1xx0 xxxx : Q */
1034− /* SMLAWy : cccc 0001 0010 xxxx xxxx xxxx 0x00 xxxx : Q */
1035− return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
1036+ /* SMLAWy : cccc 0001 0010 xxxx xxxx xxxx 1x00 xxxx : Q */
1037+ if ((insn & 0x0ff00090) == 0x01000080 ||
1038+ (insn & 0x0ff000b0) == 0x01200080)
1039+ return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
1040+
1041+ /* BXJ : cccc 0001 0010 xxxx xxxx xxxx 0010 xxxx */
1042+ /* MSR : cccc 0001 0x10 xxxx xxxx xxxx 0000 xxxx */
1043+ /* MRS spsr : cccc 0001 0100 xxxx xxxx xxxx 0000 xxxx */
10361044
1045+ /* Other instruction encodings aren't yet defined */
1046+ return INSN_REJECTED;
10371047 }
10381048
10391049 /* cccc 0001 0xx0 xxxx xxxx xxxx xxxx 0xx1 xxxx */
10401050 else if ((insn & 0x0f900090) == 0x01000010) {
10411051
1042− /* BKPT : 1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
1043− if ((insn & 0xfff000f0) == 0xe1200070)
1044− return INSN_REJECTED;
1045−
10461052 /* BLX(2) : cccc 0001 0010 xxxx xxxx xxxx 0011 xxxx */
10471053 /* BX : cccc 0001 0010 xxxx xxxx xxxx 0001 xxxx */
10481054 if ((insn & 0x0ff000d0) == 0x01200010) {
1049− asi->insn[0] = truecc_insn(insn);
1055+ if ((insn & 0x0ff000ff) == 0x0120003f)
1056+ return INSN_REJECTED; /* BLX pc */
10501057 asi->insn_handler = simulate_blx2bx;
1051− return INSN_GOOD;
1058+ return INSN_GOOD_NO_SLOT;
10521059 }
10531060
10541061 /* CLZ : cccc 0001 0110 xxxx xxxx xxxx 0001 xxxx */
@@ -1059,17 +1066,27 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 4 unmodified lines
10591066 /* QSUB : cccc 0001 0010 xxxx xxxx xxxx 0101 xxxx :Q */
10601067 /* QDADD : cccc 0001 0100 xxxx xxxx xxxx 0101 xxxx :Q */
10611068 /* QDSUB : cccc 0001 0110 xxxx xxxx xxxx 0101 xxxx :Q */
1062− return prep_emulate_rd12rn16rm0_wflags(insn, asi);
1069+ if ((insn & 0x0f9000f0) == 0x01000050)
1070+ return prep_emulate_rd12rn16rm0_wflags(insn, asi);
1071+
1072+ /* BKPT : 1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
1073+ /* SMC : cccc 0001 0110 xxxx xxxx xxxx 0111 xxxx */
1074+
1075+ /* Other instruction encodings aren't yet defined */
1076+ return INSN_REJECTED;
10631077 }
10641078
10651079 /* cccc 0000 xxxx xxxx xxxx xxxx xxxx 1001 xxxx */
1066− else if ((insn & 0x0f000090) == 0x00000090) {
1080+ else if ((insn & 0x0f0000f0) == 0x00000090) {
10671081
10681082 /* MUL : cccc 0000 0000 xxxx xxxx xxxx 1001 xxxx : */
10691083 /* MULS : cccc 0000 0001 xxxx xxxx xxxx 1001 xxxx :cc */
10701084 /* MLA : cccc 0000 0010 xxxx xxxx xxxx 1001 xxxx : */
10711085 /* MLAS : cccc 0000 0011 xxxx xxxx xxxx 1001 xxxx :cc */
10721086 /* UMAAL : cccc 0000 0100 xxxx xxxx xxxx 1001 xxxx : */
1087+ /* undef : cccc 0000 0101 xxxx xxxx xxxx 1001 xxxx : */
1088+ /* MLS : cccc 0000 0110 xxxx xxxx xxxx 1001 xxxx : */
1089+ /* undef : cccc 0000 0111 xxxx xxxx xxxx 1001 xxxx : */
10731090 /* UMULL : cccc 0000 1000 xxxx xxxx xxxx 1001 xxxx : */
10741091 /* UMULLS : cccc 0000 1001 xxxx xxxx xxxx 1001 xxxx :cc */
10751092 /* UMLAL : cccc 0000 1010 xxxx xxxx xxxx 1001 xxxx : */
@@ -1078,13 +1095,15 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 2 unmodified lines
10781095 /* SMULLS : cccc 0000 1101 xxxx xxxx xxxx 1001 xxxx :cc */
10791096 /* SMLAL : cccc 0000 1110 xxxx xxxx xxxx 1001 xxxx : */
10801097 /* SMLALS : cccc 0000 1111 xxxx xxxx xxxx 1001 xxxx :cc */
1081− if ((insn & 0x0fe000f0) == 0x00000090) {
1082− return prep_emulate_rd16rs8rm0_wflags(insn, asi);
1083− } else if ((insn & 0x0fe000f0) == 0x00200090) {
1084− return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
1085− } else {
1086− return prep_emulate_rdhi16rdlo12rs8rm0_wflags(insn, asi);
1087− }
1098+ if ((insn & 0x00d00000) == 0x00500000)
1099+ return INSN_REJECTED;
1100+ else if ((insn & 0x00e00000) == 0x00000000)
1101+ return prep_emulate_rd16rs8rm0_wflags(insn, asi);
1102+ else if ((insn & 0x00a00000) == 0x00200000)
1103+ return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
1104+ else
1105+ return prep_emulate_rdhi16rdlo12rs8rm0_wflags(insn,
1106+ asi);
10881107 }
10891108
10901109 /* cccc 000x xxxx xxxx xxxx xxxx xxxx 1xx1 xxxx */
@@ -1092,23 +1111,45 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 1 unmodified line
10921111
10931112 /* SWP : cccc 0001 0000 xxxx xxxx xxxx 1001 xxxx */
10941113 /* SWPB : cccc 0001 0100 xxxx xxxx xxxx 1001 xxxx */
1095− /* LDRD : cccc 000x xxx0 xxxx xxxx xxxx 1101 xxxx */
1096− /* STRD : cccc 000x xxx0 xxxx xxxx xxxx 1111 xxxx */
1114+ /* ??? : cccc 0001 0x01 xxxx xxxx xxxx 1001 xxxx */
1115+ /* ??? : cccc 0001 0x10 xxxx xxxx xxxx 1001 xxxx */
1116+ /* ??? : cccc 0001 0x11 xxxx xxxx xxxx 1001 xxxx */
10971117 /* STREX : cccc 0001 1000 xxxx xxxx xxxx 1001 xxxx */
10981118 /* LDREX : cccc 0001 1001 xxxx xxxx xxxx 1001 xxxx */
1119+ /* STREXD: cccc 0001 1010 xxxx xxxx xxxx 1001 xxxx */
1120+ /* LDREXD: cccc 0001 1011 xxxx xxxx xxxx 1001 xxxx */
1121+ /* STREXB: cccc 0001 1100 xxxx xxxx xxxx 1001 xxxx */
1122+ /* LDREXB: cccc 0001 1101 xxxx xxxx xxxx 1001 xxxx */
1123+ /* STREXH: cccc 0001 1110 xxxx xxxx xxxx 1001 xxxx */
1124+ /* LDREXH: cccc 0001 1111 xxxx xxxx xxxx 1001 xxxx */
1125+
1126+ /* LDRD : cccc 000x xxx0 xxxx xxxx xxxx 1101 xxxx */
1127+ /* STRD : cccc 000x xxx0 xxxx xxxx xxxx 1111 xxxx */
10991128 /* LDRH : cccc 000x xxx1 xxxx xxxx xxxx 1011 xxxx */
11001129 /* STRH : cccc 000x xxx0 xxxx xxxx xxxx 1011 xxxx */
11011130 /* LDRSB : cccc 000x xxx1 xxxx xxxx xxxx 1101 xxxx */
11021131 /* LDRSH : cccc 000x xxx1 xxxx xxxx xxxx 1111 xxxx */
1103− if ((insn & 0x0fb000f0) == 0x01000090) {
1104− /* SWP/SWPB */
1105− return prep_emulate_rd12rn16rm0_wflags(insn, asi);
1132+ if ((insn & 0x0f0000f0) == 0x01000090) {
1133+ if ((insn & 0x0fb000f0) == 0x01000090) {
1134+ /* SWP/SWPB */
1135+ return prep_emulate_rd12rn16rm0_wflags(insn,
1136+ asi);
1137+ } else {
1138+ /* STREX/LDREX variants and unallocaed space */
1139+ return INSN_REJECTED;
1140+ }
1141+
11061142 } else if ((insn & 0x0e1000d0) == 0x00000d0) {
11071143 /* STRD/LDRD */
1144+ if ((insn & 0x0000e000) == 0x0000e000)
1145+ return INSN_REJECTED; /* Rd is LR or PC */
1146+ if (is_writeback(insn) && is_r15(insn, 16))
1147+ return INSN_REJECTED; /* Writeback to PC */
1148+
11081149 insn &= 0xfff00fff;
11091150 insn |= 0x00002000; /* Rn = r0, Rd = r2 */
1110− if (insn & (1 << 22)) {
1111− /* I bit */
1151+ if (!(insn & (1 << 22))) {
1152+ /* Register index */
11121153 insn &= ~0xf;
11131154 insn |= 1; /* Rm = r1 */
11141155 }
@@ -1118,6 +1159,9 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 3 unmodified lines
11181159 return INSN_GOOD;
11191160 }
11201161
1162+ /* LDRH/STRH/LDRSB/LDRSH */
1163+ if (is_r15(insn, 12))
1164+ return INSN_REJECTED; /* Rd is PC */
11211165 return prep_emulate_ldr_str(insn, asi);
11221166 }
11231167
@@ -1125,7 +1169,7 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 1 unmodified line
11251169
11261170 /*
11271171 * ALU op with S bit and Rd == 15 :
1128− * cccc 000x xxx1 xxxx 1111 xxxx xxxx xxxx
1172+ * cccc 000x xxx1 xxxx 1111 xxxx xxxx xxxx
11291173 */
11301174 if ((insn & 0x0e10f000) == 0x0010f000)
11311175 return INSN_REJECTED;
@@ -1154,22 +1198,61 @@ space_cccc_000x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 22 unmodified lines
11541198 insn |= 0x00000200; /* Rs = r2 */
11551199 }
11561200 asi->insn[0] = insn;
1157− asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */
1201+
1202+ if ((insn & 0x0f900000) == 0x01100000) {
1203+ /*
1204+ * TST : cccc 0001 0001 xxxx xxxx xxxx xxxx xxxx
1205+ * TEQ : cccc 0001 0011 xxxx xxxx xxxx xxxx xxxx
1206+ * CMP : cccc 0001 0101 xxxx xxxx xxxx xxxx xxxx
1207+ * CMN : cccc 0001 0111 xxxx xxxx xxxx xxxx xxxx
1208+ */
1209+ asi->insn_handler = emulate_alu_tests;
1210+ } else {
1211+ /* ALU ops which write to Rd */
1212+ asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */
11581213 emulate_alu_rwflags : emulate_alu_rflags;
1214+ }
11591215 return INSN_GOOD;
11601216 }
11611217
11621218 static enum kprobe_insn __kprobes
11631219 space_cccc_001x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
11641220 {
1221+ /* MOVW : cccc 0011 0000 xxxx xxxx xxxx xxxx xxxx */
1222+ /* MOVT : cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx */
1223+ if ((insn & 0x0fb00000) == 0x03000000)
1224+ return prep_emulate_rd12_modify(insn, asi);
1225+
1226+ /* hints : cccc 0011 0010 0000 xxxx xxxx xxxx xxxx */
1227+ if ((insn & 0x0fff0000) == 0x03200000) {
1228+ unsigned op2 = insn & 0x000000ff;
1229+ if (op2 == 0x01 || op2 == 0x04) {
1230+ /* YIELD : cccc 0011 0010 0000 xxxx xxxx 0000 0001 */
1231+ /* SEV : cccc 0011 0010 0000 xxxx xxxx 0000 0100 */
1232+ asi->insn[0] = insn;
1233+ asi->insn_handler = emulate_none;
1234+ return INSN_GOOD;
1235+ } else if (op2 <= 0x03) {
1236+ /* NOP : cccc 0011 0010 0000 xxxx xxxx 0000 0000 */
1237+ /* WFE : cccc 0011 0010 0000 xxxx xxxx 0000 0010 */
1238+ /* WFI : cccc 0011 0010 0000 xxxx xxxx 0000 0011 */
1239+ /*
1240+ * We make WFE and WFI true NOPs to avoid stalls due
1241+ * to missing events whilst processing the probe.
1242+ */
1243+ asi->insn_handler = emulate_nop;
1244+ return INSN_GOOD_NO_SLOT;
1245+ }
1246+ /* For DBG and unallocated hints it's safest to reject them */
1247+ return INSN_REJECTED;
1248+ }
1249+
11651250 /*
11661251 * MSR : cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx
1167− * Undef : cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx
11681252 * ALU op with S bit and Rd == 15 :
11691253 * cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx
11701254 */
11711255 if ((insn & 0x0fb00000) == 0x03200000 || /* MSR */
1172− (insn & 0x0ff00000) == 0x03400000 || /* Undef */
11731256 (insn & 0x0e10f000) == 0x0210f000) /* ALU s-bit, R15 */
11741257 return INSN_REJECTED;
11751258
@@ -1180,10 +1263,22 @@ space_cccc_001x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 4 unmodified lines
11801263 * *S (bit 20) updates condition codes
11811264 * ADC/SBC/RSC reads the C flag
11821265 */
1183− insn &= 0xffff0fff; /* Rd = r0 */
1266+ insn &= 0xfff00fff; /* Rn = r0 and Rd = r0 */
11841267 asi->insn[0] = insn;
1185− asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */
1268+
1269+ if ((insn & 0x0f900000) == 0x03100000) {
1270+ /*
1271+ * TST : cccc 0011 0001 xxxx xxxx xxxx xxxx xxxx
1272+ * TEQ : cccc 0011 0011 xxxx xxxx xxxx xxxx xxxx
1273+ * CMP : cccc 0011 0101 xxxx xxxx xxxx xxxx xxxx
1274+ * CMN : cccc 0011 0111 xxxx xxxx xxxx xxxx xxxx
1275+ */
1276+ asi->insn_handler = emulate_alu_tests_imm;
1277+ } else {
1278+ /* ALU ops which write to Rd */
1279+ asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */
11861280 emulate_alu_imm_rwflags : emulate_alu_imm_rflags;
1281+ }
11871282 return INSN_GOOD;
11881283 }
11891284
@@ -1192,6 +1287,8 @@ space_cccc_0110__1(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 2 unmodified lines
11921287 {
11931288 /* SEL : cccc 0110 1000 xxxx xxxx xxxx 1011 xxxx GE: !!! */
11941289 if ((insn & 0x0ff000f0) == 0x068000b0) {
1290+ if (is_r15(insn, 12))
1291+ return INSN_REJECTED; /* Rd is PC */
11951292 insn &= 0xfff00ff0; /* Rd = r0, Rn = r0 */
11961293 insn |= 0x00000001; /* Rm = r1 */
11971294 asi->insn[0] = insn;
@@ -1205,6 +1302,8 @@ space_cccc_0110__1(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 7 unmodified lines
12051302 /* USAT16 : cccc 0110 1110 xxxx xxxx xxxx 0011 xxxx :Q */
12061303 if ((insn & 0x0fa00030) == 0x06a00010 ||
12071304 (insn & 0x0fb000f0) == 0x06a00030) {
1305+ if (is_r15(insn, 12))
1306+ return INSN_REJECTED; /* Rd is PC */
12081307 insn &= 0xffff0ff0; /* Rd = r0, Rm = r0 */
12091308 asi->insn[0] = insn;
12101309 asi->insn_handler = emulate_sat;
@@ -1213,57 +1312,101 @@ space_cccc_0110__1(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 2 unmodified lines
12131312
12141313 /* REV : cccc 0110 1011 xxxx xxxx xxxx 0011 xxxx */
12151314 /* REV16 : cccc 0110 1011 xxxx xxxx xxxx 1011 xxxx */
1315+ /* RBIT : cccc 0110 1111 xxxx xxxx xxxx 0011 xxxx */
12161316 /* REVSH : cccc 0110 1111 xxxx xxxx xxxx 1011 xxxx */
12171317 if ((insn & 0x0ff00070) == 0x06b00030 ||
1218− (insn & 0x0ff000f0) == 0x06f000b0)
1318+ (insn & 0x0ff00070) == 0x06f00030)
12191319 return prep_emulate_rd12rm0(insn, asi);
12201320
1321+ /* ??? : cccc 0110 0000 xxxx xxxx xxxx xxx1 xxxx : */
12211322 /* SADD16 : cccc 0110 0001 xxxx xxxx xxxx 0001 xxxx :GE */
12221323 /* SADDSUBX : cccc 0110 0001 xxxx xxxx xxxx 0011 xxxx :GE */
12231324 /* SSUBADDX : cccc 0110 0001 xxxx xxxx xxxx 0101 xxxx :GE */
12241325 /* SSUB16 : cccc 0110 0001 xxxx xxxx xxxx 0111 xxxx :GE */
12251326 /* SADD8 : cccc 0110 0001 xxxx xxxx xxxx 1001 xxxx :GE */
1327+ /* ??? : cccc 0110 0001 xxxx xxxx xxxx 1011 xxxx : */
1328+ /* ??? : cccc 0110 0001 xxxx xxxx xxxx 1101 xxxx : */
12261329 /* SSUB8 : cccc 0110 0001 xxxx xxxx xxxx 1111 xxxx :GE */
12271330 /* QADD16 : cccc 0110 0010 xxxx xxxx xxxx 0001 xxxx : */
12281331 /* QADDSUBX : cccc 0110 0010 xxxx xxxx xxxx 0011 xxxx : */
12291332 /* QSUBADDX : cccc 0110 0010 xxxx xxxx xxxx 0101 xxxx : */
12301333 /* QSUB16 : cccc 0110 0010 xxxx xxxx xxxx 0111 xxxx : */
12311334 /* QADD8 : cccc 0110 0010 xxxx xxxx xxxx 1001 xxxx : */
1335+ /* ??? : cccc 0110 0010 xxxx xxxx xxxx 1011 xxxx : */
1336+ /* ??? : cccc 0110 0010 xxxx xxxx xxxx 1101 xxxx : */
12321337 /* QSUB8 : cccc 0110 0010 xxxx xxxx xxxx 1111 xxxx : */
12331338 /* SHADD16 : cccc 0110 0011 xxxx xxxx xxxx 0001 xxxx : */
12341339 /* SHADDSUBX : cccc 0110 0011 xxxx xxxx xxxx 0011 xxxx : */
12351340 /* SHSUBADDX : cccc 0110 0011 xxxx xxxx xxxx 0101 xxxx : */
12361341 /* SHSUB16 : cccc 0110 0011 xxxx xxxx xxxx 0111 xxxx : */
12371342 /* SHADD8 : cccc 0110 0011 xxxx xxxx xxxx 1001 xxxx : */
1343+ /* ??? : cccc 0110 0011 xxxx xxxx xxxx 1011 xxxx : */
1344+ /* ??? : cccc 0110 0011 xxxx xxxx xxxx 1101 xxxx : */
12381345 /* SHSUB8 : cccc 0110 0011 xxxx xxxx xxxx 1111 xxxx : */
1346+ /* ??? : cccc 0110 0100 xxxx xxxx xxxx xxx1 xxxx : */
12391347 /* UADD16 : cccc 0110 0101 xxxx xxxx xxxx 0001 xxxx :GE */
12401348 /* UADDSUBX : cccc 0110 0101 xxxx xxxx xxxx 0011 xxxx :GE */
12411349 /* USUBADDX : cccc 0110 0101 xxxx xxxx xxxx 0101 xxxx :GE */
12421350 /* USUB16 : cccc 0110 0101 xxxx xxxx xxxx 0111 xxxx :GE */
12431351 /* UADD8 : cccc 0110 0101 xxxx xxxx xxxx 1001 xxxx :GE */
1352+ /* ??? : cccc 0110 0101 xxxx xxxx xxxx 1011 xxxx : */
1353+ /* ??? : cccc 0110 0101 xxxx xxxx xxxx 1101 xxxx : */
12441354 /* USUB8 : cccc 0110 0101 xxxx xxxx xxxx 1111 xxxx :GE */
12451355 /* UQADD16 : cccc 0110 0110 xxxx xxxx xxxx 0001 xxxx : */
12461356 /* UQADDSUBX : cccc 0110 0110 xxxx xxxx xxxx 0011 xxxx : */
12471357 /* UQSUBADDX : cccc 0110 0110 xxxx xxxx xxxx 0101 xxxx : */
12481358 /* UQSUB16 : cccc 0110 0110 xxxx xxxx xxxx 0111 xxxx : */
12491359 /* UQADD8 : cccc 0110 0110 xxxx xxxx xxxx 1001 xxxx : */
1360+ /* ??? : cccc 0110 0110 xxxx xxxx xxxx 1011 xxxx : */
1361+ /* ??? : cccc 0110 0110 xxxx xxxx xxxx 1101 xxxx : */
12501362 /* UQSUB8 : cccc 0110 0110 xxxx xxxx xxxx 1111 xxxx : */
12511363 /* UHADD16 : cccc 0110 0111 xxxx xxxx xxxx 0001 xxxx : */
12521364 /* UHADDSUBX : cccc 0110 0111 xxxx xxxx xxxx 0011 xxxx : */
12531365 /* UHSUBADDX : cccc 0110 0111 xxxx xxxx xxxx 0101 xxxx : */
12541366 /* UHSUB16 : cccc 0110 0111 xxxx xxxx xxxx 0111 xxxx : */
12551367 /* UHADD8 : cccc 0110 0111 xxxx xxxx xxxx 1001 xxxx : */
1368+ /* ??? : cccc 0110 0111 xxxx xxxx xxxx 1011 xxxx : */
1369+ /* ??? : cccc 0110 0111 xxxx xxxx xxxx 1101 xxxx : */
12561370 /* UHSUB8 : cccc 0110 0111 xxxx xxxx xxxx 1111 xxxx : */
1371+ if ((insn & 0x0f800010) == 0x06000010) {
1372+ if ((insn & 0x00300000) == 0x00000000 ||
1373+ (insn & 0x000000e0) == 0x000000a0 ||
1374+ (insn & 0x000000e0) == 0x000000c0)
1375+ return INSN_REJECTED; /* Unallocated space */
1376+ return prep_emulate_rd12rn16rm0_wflags(insn, asi);
1377+ }
1378+
12571379 /* PKHBT : cccc 0110 1000 xxxx xxxx xxxx x001 xxxx : */
12581380 /* PKHTB : cccc 0110 1000 xxxx xxxx xxxx x101 xxxx : */
1381+ if ((insn & 0x0ff00030) == 0x06800010)
1382+ return prep_emulate_rd12rn16rm0_wflags(insn, asi);
1383+
12591384 /* SXTAB16 : cccc 0110 1000 xxxx xxxx xxxx 0111 xxxx : */
1260− /* SXTB : cccc 0110 1010 xxxx xxxx xxxx 0111 xxxx : */
1385+ /* SXTB16 : cccc 0110 1000 1111 xxxx xxxx 0111 xxxx : */
1386+ /* ??? : cccc 0110 1001 xxxx xxxx xxxx 0111 xxxx : */
12611387 /* SXTAB : cccc 0110 1010 xxxx xxxx xxxx 0111 xxxx : */
1388+ /* SXTB : cccc 0110 1010 1111 xxxx xxxx 0111 xxxx : */
12621389 /* SXTAH : cccc 0110 1011 xxxx xxxx xxxx 0111 xxxx : */
1390+ /* SXTH : cccc 0110 1011 1111 xxxx xxxx 0111 xxxx : */
12631391 /* UXTAB16 : cccc 0110 1100 xxxx xxxx xxxx 0111 xxxx : */
1392+ /* UXTB16 : cccc 0110 1100 1111 xxxx xxxx 0111 xxxx : */
1393+ /* ??? : cccc 0110 1101 xxxx xxxx xxxx 0111 xxxx : */
12641394 /* UXTAB : cccc 0110 1110 xxxx xxxx xxxx 0111 xxxx : */
1395+ /* UXTB : cccc 0110 1110 1111 xxxx xxxx 0111 xxxx : */
12651396 /* UXTAH : cccc 0110 1111 xxxx xxxx xxxx 0111 xxxx : */
1266− return prep_emulate_rd12rn16rm0_wflags(insn, asi);
1397+ /* UXTH : cccc 0110 1111 1111 xxxx xxxx 0111 xxxx : */
1398+ if ((insn & 0x0f8000f0) == 0x06800070) {
1399+ if ((insn & 0x00300000) == 0x00100000)
1400+ return INSN_REJECTED; /* Unallocated space */
1401+
1402+ if ((insn & 0x000f0000) == 0x000f0000)
1403+ return prep_emulate_rd12rm0(insn, asi);
1404+ else
1405+ return prep_emulate_rd12rn16rm0_wflags(insn, asi);
1406+ }
1407+
1408+ /* Other instruction encodings aren't yet defined */
1409+ return INSN_REJECTED;
12671410 }
12681411
12691412 static enum kprobe_insn __kprobes
@@ -1273,29 +1416,49 @@ space_cccc_0111__1(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 3 unmodified lines
12731416 if ((insn & 0x0ff000f0) == 0x03f000f0)
12741417 return INSN_REJECTED;
12751418
1276− /* USADA8 : cccc 0111 1000 xxxx xxxx xxxx 0001 xxxx */
1277− /* USAD8 : cccc 0111 1000 xxxx 1111 xxxx 0001 xxxx */
1278− if ((insn & 0x0ff000f0) == 0x07800010)
1279− return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
1280−
12811419 /* SMLALD : cccc 0111 0100 xxxx xxxx xxxx 00x1 xxxx */
12821420 /* SMLSLD : cccc 0111 0100 xxxx xxxx xxxx 01x1 xxxx */
12831421 if ((insn & 0x0ff00090) == 0x07400010)
12841422 return prep_emulate_rdhi16rdlo12rs8rm0_wflags(insn, asi);
12851423
12861424 /* SMLAD : cccc 0111 0000 xxxx xxxx xxxx 00x1 xxxx :Q */
1425+ /* SMUAD : cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx :Q */
12871426 /* SMLSD : cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx :Q */
1427+ /* SMUSD : cccc 0111 0000 xxxx 1111 xxxx 01x1 xxxx : */
12881428 /* SMMLA : cccc 0111 0101 xxxx xxxx xxxx 00x1 xxxx : */
1289− /* SMMLS : cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx : */
1429+ /* SMMUL : cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx : */
1430+ /* USADA8 : cccc 0111 1000 xxxx xxxx xxxx 0001 xxxx : */
1431+ /* USAD8 : cccc 0111 1000 xxxx 1111 xxxx 0001 xxxx : */
12901432 if ((insn & 0x0ff00090) == 0x07000010 ||
12911433 (insn & 0x0ff000d0) == 0x07500010 ||
1292− (insn & 0x0ff000d0) == 0x075000d0)
1434+ (insn & 0x0ff000f0) == 0x07800010) {
1435+
1436+ if ((insn & 0x0000f000) == 0x0000f000)
1437+ return prep_emulate_rd16rs8rm0_wflags(insn, asi);
1438+ else
1439+ return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
1440+ }
1441+
1442+ /* SMMLS : cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx : */
1443+ if ((insn & 0x0ff000d0) == 0x075000d0)
12931444 return prep_emulate_rd16rn12rs8rm0_wflags(insn, asi);
12941445
1295− /* SMUSD : cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx : */
1296− /* SMUAD : cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx :Q */
1297− /* SMMUL : cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx : */
1298− return prep_emulate_rd16rs8rm0_wflags(insn, asi);
1446+ /* SBFX : cccc 0111 101x xxxx xxxx xxxx x101 xxxx : */
1447+ /* UBFX : cccc 0111 111x xxxx xxxx xxxx x101 xxxx : */
1448+ if ((insn & 0x0fa00070) == 0x07a00050)
1449+ return prep_emulate_rd12rm0(insn, asi);
1450+
1451+ /* BFI : cccc 0111 110x xxxx xxxx xxxx x001 xxxx : */
1452+ /* BFC : cccc 0111 110x xxxx xxxx xxxx x001 1111 : */
1453+ if ((insn & 0x0fe00070) == 0x07c00010) {
1454+
1455+ if ((insn & 0x0000000f) == 0x0000000f)
1456+ return prep_emulate_rd12_modify(insn, asi);
1457+ else
1458+ return prep_emulate_rd12rn0_modify(insn, asi);
1459+ }
1460+
1461+ return INSN_REJECTED;
12991462 }
13001463
13011464 static enum kprobe_insn __kprobes
@@ -1309,6 +1472,10 @@ space_cccc_01xx(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 7 unmodified lines
13091472 /* STRB : cccc 01xx x1x0 xxxx xxxx xxxx xxxx xxxx */
13101473 /* STRBT : cccc 01x0 x110 xxxx xxxx xxxx xxxx xxxx */
13111474 /* STRT : cccc 01x0 x010 xxxx xxxx xxxx xxxx xxxx */
1475+
1476+ if ((insn & 0x00500000) == 0x00500000 && is_r15(insn, 12))
1477+ return INSN_REJECTED; /* LDRB into PC */
1478+
13121479 return prep_emulate_ldr_str(insn, asi);
13131480 }
13141481
@@ -1323,10 +1490,9 @@ space_cccc_100x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 8 unmodified lines
13231490
13241491 /* LDM(1) : cccc 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
13251492 /* STM(1) : cccc 100x x0x0 xxxx xxxx xxxx xxxx xxxx */
1326− asi->insn[0] = truecc_insn(insn);
13271493 asi->insn_handler = ((insn & 0x108000) == 0x008000) ? /* STM & R15 */
13281494 simulate_stm1_pc : simulate_ldm1stm1;
1329− return INSN_GOOD;
1495+ return INSN_GOOD_NO_SLOT;
13301496 }
13311497
13321498 static enum kprobe_insn __kprobes
@@ -1334,58 +1500,117 @@ space_cccc_101x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 1 unmodified line
13341500 {
13351501 /* B : cccc 1010 xxxx xxxx xxxx xxxx xxxx xxxx */
13361502 /* BL : cccc 1011 xxxx xxxx xxxx xxxx xxxx xxxx */
1337− asi->insn[0] = truecc_insn(insn);
13381503 asi->insn_handler = simulate_bbl;
1339− return INSN_GOOD;
1504+ return INSN_GOOD_NO_SLOT;
13401505 }
13411506
13421507 static enum kprobe_insn __kprobes
1343−space_cccc_1100_010x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1508+space_cccc_11xx(kprobe_opcode_t insn, struct arch_specific_insn *asi)
13441509 {
1510+ /* Coprocessor instructions... */
13451511 /* MCRR : cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */
13461512 /* MRRC : cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx : (Rd!=Rn) */
1347− insn &= 0xfff00fff;
1348− insn |= 0x00001000; /* Rn = r0, Rd = r1 */
1349− asi->insn[0] = insn;
1350− asi->insn_handler = (insn & (1 << 20)) ? emulate_mrrc : emulate_mcrr;
1351− return INSN_GOOD;
1513+ /* LDC : cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
1514+ /* STC : cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
1515+ /* CDP : cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
1516+ /* MCR : cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
1517+ /* MRC : cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
1518+
1519+ /* SVC : cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
1520+
1521+ return INSN_REJECTED;
13521522 }
13531523
1354−static enum kprobe_insn __kprobes
1355−space_cccc_110x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1524+static unsigned long __kprobes __check_eq(unsigned long cpsr)
13561525 {
1357− /* LDC : cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
1358− /* STC : cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
1359− insn &= 0xfff0ffff; /* Rn = r0 */
1360− asi->insn[0] = insn;
1361− asi->insn_handler = emulate_ldcstc;
1362− return INSN_GOOD;
1526+ return cpsr & PSR_Z_BIT;
13631527 }
13641528
1365−static enum kprobe_insn __kprobes
1366−space_cccc_111x(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1529+static unsigned long __kprobes __check_ne(unsigned long cpsr)
13671530 {
1368− /* BKPT : 1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
1369− /* SWI : cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
1370− if ((insn & 0xfff000f0) == 0xe1200070 ||
1371− (insn & 0x0f000000) == 0x0f000000)
1372− return INSN_REJECTED;
1531+ return (~cpsr) & PSR_Z_BIT;
1532+}
13731533
1374− /* CDP : cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
1375− if ((insn & 0x0f000010) == 0x0e000000) {
1376− asi->insn[0] = insn;
1377− asi->insn_handler = emulate_none;
1378− return INSN_GOOD;
1379− }
1534+static unsigned long __kprobes __check_cs(unsigned long cpsr)
1535+{
1536+ return cpsr & PSR_C_BIT;
1537+}
13801538
1381− /* MCR : cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
1382− /* MRC : cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
1383− insn &= 0xffff0fff; /* Rd = r0 */
1384− asi->insn[0] = insn;
1385− asi->insn_handler = (insn & (1 << 20)) ? emulate_rd12 : emulate_ird12;
1386− return INSN_GOOD;
1539+static unsigned long __kprobes __check_cc(unsigned long cpsr)
1540+{
1541+ return (~cpsr) & PSR_C_BIT;
1542+}
1543+
1544+static unsigned long __kprobes __check_mi(unsigned long cpsr)
1545+{
1546+ return cpsr & PSR_N_BIT;
1547+}
1548+
1549+static unsigned long __kprobes __check_pl(unsigned long cpsr)
1550+{
1551+ return (~cpsr) & PSR_N_BIT;
1552+}
1553+
1554+static unsigned long __kprobes __check_vs(unsigned long cpsr)
1555+{
1556+ return cpsr & PSR_V_BIT;
1557+}
1558+
1559+static unsigned long __kprobes __check_vc(unsigned long cpsr)
1560+{
1561+ return (~cpsr) & PSR_V_BIT;
1562+}
1563+
1564+static unsigned long __kprobes __check_hi(unsigned long cpsr)
1565+{
1566+ cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */
1567+ return cpsr & PSR_C_BIT;
13871568 }
13881569
1570+static unsigned long __kprobes __check_ls(unsigned long cpsr)
1571+{
1572+ cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */
1573+ return (~cpsr) & PSR_C_BIT;
1574+}
1575+
1576+static unsigned long __kprobes __check_ge(unsigned long cpsr)
1577+{
1578+ cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
1579+ return (~cpsr) & PSR_N_BIT;
1580+}
1581+
1582+static unsigned long __kprobes __check_lt(unsigned long cpsr)
1583+{
1584+ cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
1585+ return cpsr & PSR_N_BIT;
1586+}
1587+
1588+static unsigned long __kprobes __check_gt(unsigned long cpsr)
1589+{
1590+ unsigned long temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
1591+ temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */
1592+ return (~temp) & PSR_N_BIT;
1593+}
1594+
1595+static unsigned long __kprobes __check_le(unsigned long cpsr)
1596+{
1597+ unsigned long temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
1598+ temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */
1599+ return temp & PSR_N_BIT;
1600+}
1601+
1602+static unsigned long __kprobes __check_al(unsigned long cpsr)
1603+{
1604+ return true;
1605+}
1606+
1607+static kprobe_check_cc * const condition_checks[16] = {
1608+ &__check_eq, &__check_ne, &__check_cs, &__check_cc,
1609+ &__check_mi, &__check_pl, &__check_vs, &__check_vc,
1610+ &__check_hi, &__check_ls, &__check_ge, &__check_lt,
1611+ &__check_gt, &__check_le, &__check_al, &__check_al
1612+};
1613+
13891614 /* Return:
13901615 * INSN_REJECTED If instruction is one not allowed to kprobe,
13911616 * INSN_GOOD If instruction is supported and uses instruction slot,
@@ -1401,133 +1626,45 @@ space_cccc_111x(kprobe_opcode_t insn, struct arch_specific_insn *asi) · 9 unmodified lines
14011626 enum kprobe_insn __kprobes
14021627 arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
14031628 {
1629+ asi->insn_check_cc = condition_checks[insn>>28];
14041630 asi->insn[1] = KPROBE_RETURN_INSTRUCTION;
14051631
1406− if ((insn & 0xf0000000) == 0xf0000000) {
1632+ if ((insn & 0xf0000000) == 0xf0000000)
14071633
14081634 return space_1111(insn, asi);
14091635
1410− } else if ((insn & 0x0e000000) == 0x00000000) {
1636+ else if ((insn & 0x0e000000) == 0x00000000)
14111637
14121638 return space_cccc_000x(insn, asi);
14131639
1414− } else if ((insn & 0x0e000000) == 0x02000000) {
1640+ else if ((insn & 0x0e000000) == 0x02000000)
14151641
14161642 return space_cccc_001x(insn, asi);
14171643
1418− } else if ((insn & 0x0f000010) == 0x06000010) {
1644+ else if ((insn & 0x0f000010) == 0x06000010)
14191645
14201646 return space_cccc_0110__1(insn, asi);
14211647
1422− } else if ((insn & 0x0f000010) == 0x07000010) {
1648+ else if ((insn & 0x0f000010) == 0x07000010)
14231649
14241650 return space_cccc_0111__1(insn, asi);
14251651
1426− } else if ((insn & 0x0c000000) == 0x04000000) {
1652+ else if ((insn & 0x0c000000) == 0x04000000)
14271653
14281654 return space_cccc_01xx(insn, asi);
14291655
1430− } else if ((insn & 0x0e000000) == 0x08000000) {
1656+ else if ((insn & 0x0e000000) == 0x08000000)
14311657
14321658 return space_cccc_100x(insn, asi);
14331659
1434− } else if ((insn & 0x0e000000) == 0x0a000000) {
1660+ else if ((insn & 0x0e000000) == 0x0a000000)
14351661
14361662 return space_cccc_101x(insn, asi);
14371663
1438− } else if ((insn & 0x0fe00000) == 0x0c400000) {
1439−
1440− return space_cccc_1100_010x(insn, asi);
1441−
1442− } else if ((insn & 0x0e000000) == 0x0c000000) {
1443−
1444− return space_cccc_110x(insn, asi);
1445−
1446− }
1447−
1448− return space_cccc_111x(insn, asi);
1664+ return space_cccc_11xx(insn, asi);
14491665 }
14501666
14511667 void __init arm_kprobe_decode_init(void)
14521668 {
14531669 find_str_pc_offset();
14541670 }
1455−
1456−
1457−/*
1458− * All ARM instructions listed below.
1459− *
1460− * Instructions and their general purpose registers are given.
1461− * If a particular register may not use R15, it is prefixed with a "!".
1462− * If marked with a "*" means the value returned by reading R15
1463− * is implementation defined.
1464− *
1465− * ADC/ADD/AND/BIC/CMN/CMP/EOR/MOV/MVN/ORR/RSB/RSC/SBC/SUB/TEQ
1466− * TST: Rd, Rn, Rm, !Rs
1467− * BX: Rm
1468− * BLX(2): !Rm
1469− * BX: Rm (R15 legal, but discouraged)
1470− * BXJ: !Rm,
1471− * CLZ: !Rd, !Rm
1472− * CPY: Rd, Rm
1473− * LDC/2,STC/2 immediate offset & unindex: Rn
1474− * LDC/2,STC/2 immediate pre/post-indexed: !Rn
1475− * LDM(1/3): !Rn, register_list
1476− * LDM(2): !Rn, !register_list
1477− * LDR,STR,PLD immediate offset: Rd, Rn
1478− * LDR,STR,PLD register offset: Rd, Rn, !Rm
1479− * LDR,STR,PLD scaled register offset: Rd, !Rn, !Rm
1480− * LDR,STR immediate pre/post-indexed: Rd, !Rn
1481− * LDR,STR register pre/post-indexed: Rd, !Rn, !Rm
1482− * LDR,STR scaled register pre/post-indexed: Rd, !Rn, !Rm
1483− * LDRB,STRB immediate offset: !Rd, Rn
1484− * LDRB,STRB register offset: !Rd, Rn, !Rm
1485− * LDRB,STRB scaled register offset: !Rd, !Rn, !Rm
1486− * LDRB,STRB immediate pre/post-indexed: !Rd, !Rn
1487− * LDRB,STRB register pre/post-indexed: !Rd, !Rn, !Rm
1488− * LDRB,STRB scaled register pre/post-indexed: !Rd, !Rn, !Rm
1489− * LDRT,LDRBT,STRBT immediate pre/post-indexed: !Rd, !Rn
1490− * LDRT,LDRBT,STRBT register pre/post-indexed: !Rd, !Rn, !Rm
1491− * LDRT,LDRBT,STRBT scaled register pre/post-indexed: !Rd, !Rn, !Rm
1492− * LDRH/SH/SB/D,STRH/SH/SB/D immediate offset: !Rd, Rn
1493− * LDRH/SH/SB/D,STRH/SH/SB/D register offset: !Rd, Rn, !Rm
1494− * LDRH/SH/SB/D,STRH/SH/SB/D immediate pre/post-indexed: !Rd, !Rn
1495− * LDRH/SH/SB/D,STRH/SH/SB/D register pre/post-indexed: !Rd, !Rn, !Rm
1496− * LDREX: !Rd, !Rn
1497− * MCR/2: !Rd
1498− * MCRR/2,MRRC/2: !Rd, !Rn
1499− * MLA: !Rd, !Rn, !Rm, !Rs
1500− * MOV: Rd
1501− * MRC/2: !Rd (if Rd==15, only changes cond codes, not the register)
1502− * MRS,MSR: !Rd
1503− * MUL: !Rd, !Rm, !Rs
1504− * PKH{BT,TB}: !Rd, !Rn, !Rm
1505− * QDADD,[U]QADD/16/8/SUBX: !Rd, !Rm, !Rn
1506− * QDSUB,[U]QSUB/16/8/ADDX: !Rd, !Rm, !Rn
1507− * REV/16/SH: !Rd, !Rm
1508− * RFE: !Rn
1509− * {S,U}[H]ADD{16,8,SUBX},{S,U}[H]SUB{16,8,ADDX}: !Rd, !Rn, !Rm
1510− * SEL: !Rd, !Rn, !Rm
1511− * SMLA<x><y>,SMLA{D,W<y>},SMLSD,SMML{A,S}: !Rd, !Rn, !Rm, !Rs
1512− * SMLAL<x><y>,SMLA{D,LD},SMLSLD,SMMULL,SMULW<y>: !RdHi, !RdLo, !Rm, !Rs
1513− * SMMUL,SMUAD,SMUL<x><y>,SMUSD: !Rd, !Rm, !Rs
1514− * SSAT/16: !Rd, !Rm
1515− * STM(1/2): !Rn, register_list* (R15 in reg list not recommended)
1516− * STRT immediate pre/post-indexed: Rd*, !Rn
1517− * STRT register pre/post-indexed: Rd*, !Rn, !Rm
1518− * STRT scaled register pre/post-indexed: Rd*, !Rn, !Rm
1519− * STREX: !Rd, !Rn, !Rm
1520− * SWP/B: !Rd, !Rn, !Rm
1521− * {S,U}XTA{B,B16,H}: !Rd, !Rn, !Rm
1522− * {S,U}XT{B,B16,H}: !Rd, !Rm
1523− * UM{AA,LA,UL}L: !RdHi, !RdLo, !Rm, !Rs
1524− * USA{D8,A8,T,T16}: !Rd, !Rm, !Rs
1525− *
1526− * May transfer control by writing R15 (possible mode changes or alternate
1527− * mode accesses marked by "*"):
1528− * ALU op (* with s-bit), B, BL, BKPT, BLX(1/2), BX, BXJ, CPS*, CPY,
1529− * LDM(1), LDM(2/3)*, LDR, MOV, RFE*, SWI*
1530− *
1531− * Instructions that do not take general registers, nor transfer control:
1532− * CDP/2, SETEND, SRS*
1533− */
arch/arm/kernel/kprobes.c+2−1
@@ -134,7 +134,8 @@ static void __kprobes singlestep(struct kprobe *p, struct pt_regs *regs, · 133 unmodified lines
134134 struct kprobe_ctlblk *kcb)
135135 {
136136 regs->ARM_pc += 4;
137− p->ainsn.insn_handler(p, regs);
137+ if (p->ainsn.insn_check_cc(regs->ARM_cpsr))
138+ p->ainsn.insn_handler(p, regs);
138139 }
139140
140141 /*
arch/arm/kernel/perf_event.c+2−1
@@ -746,7 +746,8 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) · 745 unmodified lines
746746
747747 tail = (struct frame_tail __user *)regs->ARM_fp - 1;
748748
749− while (tail && !((unsigned long)tail & 0x3))
749+ while ((entry->nr < PERF_MAX_STACK_DEPTH) &&
750+ tail && !((unsigned long)tail & 0x3))
750751 tail = user_backtrace(tail, entry);
751752 }
752753
arch/arm/kernel/ptrace.c+8−0
@@ -767,12 +767,20 @@ long arch_ptrace(struct task_struct *child, long request, · 766 unmodified lines
767767
768768 #ifdef CONFIG_HAVE_HW_BREAKPOINT
769769 case PTRACE_GETHBPREGS:
770+ if (ptrace_get_breakpoints(child) < 0)
771+ return -ESRCH;
772+
770773 ret = ptrace_gethbpregs(child, addr,
771774 (unsigned long __user *)data);
775+ ptrace_put_breakpoints(child);
772776 break;
773777 case PTRACE_SETHBPREGS:
778+ if (ptrace_get_breakpoints(child) < 0)
779+ return -ESRCH;
780+
774781 ret = ptrace_sethbpregs(child, addr,
775782 (unsigned long __user *)data);
783+ ptrace_put_breakpoints(child);
776784 break;
777785 #endif
778786
arch/arm/kernel/signal.c+53−37
@@ -597,45 +597,19 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, · 596 unmodified lines
597597 return err;
598598 }
599599
600−static inline void setup_syscall_restart(struct pt_regs *regs)
601−{
602− regs->ARM_r0 = regs->ARM_ORIG_r0;
603− regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;
604−}
605−
606600 /*
607601 * OK, we're invoking a handler
608602 */
609603 static int
610604 handle_signal(unsigned long sig, struct k_sigaction *ka,
611605 siginfo_t *info, sigset_t *oldset,
612− struct pt_regs * regs, int syscall)
606+ struct pt_regs * regs)
613607 {
614608 struct thread_info *thread = current_thread_info();
615609 struct task_struct *tsk = current;
616610 int usig = sig;
617611 int ret;
618612
619− /*
620− * If we were from a system call, check for system call restarting...
621− */
622− if (syscall) {
623− switch (regs->ARM_r0) {
624− case -ERESTART_RESTARTBLOCK:
625− case -ERESTARTNOHAND:
626− regs->ARM_r0 = -EINTR;
627− break;
628− case -ERESTARTSYS:
629− if (!(ka->sa.sa_flags & SA_RESTART)) {
630− regs->ARM_r0 = -EINTR;
631− break;
632− }
633− /* fallthrough */
634− case -ERESTARTNOINTR:
635− setup_syscall_restart(regs);
636− }
637− }
638−
639613 /*
640614 * translate the signal
641615 */
@@ -685,6 +659,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, · 43 unmodified lines
685659 */
686660 static void do_signal(struct pt_regs *regs, int syscall)
687661 {
662+ unsigned int retval = 0, continue_addr = 0, restart_addr = 0;
688663 struct k_sigaction ka;
689664 siginfo_t info;
690665 int signr;
@@ -698,18 +673,61 @@ static void do_signal(struct pt_regs *regs, int syscall) · 7 unmodified lines
698673 if (!user_mode(regs))
699674 return;
700675
676+ /*
677+ * If we were from a system call, check for system call restarting...
678+ */
679+ if (syscall) {
680+ continue_addr = regs->ARM_pc;
681+ restart_addr = continue_addr - (thumb_mode(regs) ? 2 : 4);
682+ retval = regs->ARM_r0;
683+
684+ /*
685+ * Prepare for system call restart. We do this here so that a
686+ * debugger will see the already changed PSW.
687+ */
688+ switch (retval) {
689+ case -ERESTARTNOHAND:
690+ case -ERESTARTSYS:
691+ case -ERESTARTNOINTR:
692+ regs->ARM_r0 = regs->ARM_ORIG_r0;
693+ regs->ARM_pc = restart_addr;
694+ break;
695+ case -ERESTART_RESTARTBLOCK:
696+ regs->ARM_r0 = -EINTR;
697+ break;
698+ }
699+ }
700+
701701 if (try_to_freeze())
702702 goto no_signal;
703703
704+ /*
705+ * Get the signal to deliver. When running under ptrace, at this
706+ * point the debugger may change all our registers ...
707+ */
704708 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
705709 if (signr > 0) {
706710 sigset_t *oldset;
707711
712+ /*
713+ * Depending on the signal settings we may need to revert the
714+ * decision to restart the system call. But skip this if a
715+ * debugger has chosen to restart at a different PC.
716+ */
717+ if (regs->ARM_pc == restart_addr) {
718+ if (retval == -ERESTARTNOHAND
719+ || (retval == -ERESTARTSYS
720+ && !(ka.sa.sa_flags & SA_RESTART))) {
721+ regs->ARM_r0 = -EINTR;
722+ regs->ARM_pc = continue_addr;
723+ }
724+ }
725+
708726 if (test_thread_flag(TIF_RESTORE_SIGMASK))
709727 oldset = &current->saved_sigmask;
710728 else
711729 oldset = &current->blocked;
712− if (handle_signal(signr, &ka, &info, oldset, regs, syscall) == 0) {
730+ if (handle_signal(signr, &ka, &info, oldset, regs) == 0) {
713731 /*
714732 * A signal was successfully delivered; the saved
715733 * sigmask will have been stored in the signal frame,
@@ -723,11 +741,14 @@ static void do_signal(struct pt_regs *regs, int syscall) · 7 unmodified lines
723741 }
724742
725743 no_signal:
726− /*
727− * No signal to deliver to the process - restart the syscall.
728− */
729744 if (syscall) {
730− if (regs->ARM_r0 == -ERESTART_RESTARTBLOCK) {
745+ /*
746+ * Handle restarting a different system call. As above,
747+ * if a debugger has chosen to restart at a different PC,
748+ * ignore the restart.
749+ */
750+ if (retval == -ERESTART_RESTARTBLOCK
751+ && regs->ARM_pc == continue_addr) {
731752 if (thumb_mode(regs)) {
732753 regs->ARM_r7 = __NR_restart_syscall - __NR_SYSCALL_BASE;
733754 regs->ARM_pc -= 2;
@@ -750,11 +771,6 @@ static void do_signal(struct pt_regs *regs, int syscall) · 16 unmodified lines
750771 #endif
751772 }
752773 }
753− if (regs->ARM_r0 == -ERESTARTNOHAND ||
754− regs->ARM_r0 == -ERESTARTSYS ||
755− regs->ARM_r0 == -ERESTARTNOINTR) {
756− setup_syscall_restart(regs);
757− }
758774
759775 /* If there's no signal to deliver, we just put the saved sigmask
760776 * back.
arch/arm/kernel/smp.c+1−1
@@ -479,7 +479,7 @@ static void broadcast_timer_set_mode(enum clock_event_mode mode, · 478 unmodified lines
479479 {
480480 }
481481
482−static void broadcast_timer_setup(struct clock_event_device *evt)
482+static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
483483 {
484484 evt->name = "dummy_timer";
485485 evt->features = CLOCK_EVT_FEAT_ONESHOT |
arch/arm/kernel/sys_oabi-compat.c+1−1
@@ -311,7 +311,7 @@ asmlinkage long sys_oabi_semtimedop(int semid, · 310 unmodified lines
311311 long err;
312312 int i;
313313
314− if (nsops < 1)
314+ if (nsops < 1 || nsops > SEMOPM)
315315 return -EINVAL;
316316 sops = kmalloc(sizeof(*sops) * nsops, GFP_KERNEL);
317317 if (!sops)
arch/arm/mach-at91/Kconfig+1−0
@@ -83,6 +83,7 @@ config ARCH_AT91CAP9 · 82 unmodified lines
8383 select CPU_ARM926T
8484 select GENERIC_CLOCKEVENTS
8585 select HAVE_FB_ATMEL
86+ select HAVE_NET_MACB
8687
8788 config ARCH_AT572D940HF
8889 bool "AT572D940HF"
arch/arm/mach-at91/board-eb01.c+6−1
@@ -30,6 +30,11 @@ · 29 unmodified lines
3030 #include <mach/board.h>
3131 #include "generic.h"
3232
33+static void __init at91eb01_init_irq(void)
34+{
35+ at91x40_init_interrupts(NULL);
36+}
37+
3338 static void __init at91eb01_map_io(void)
3439 {
3540 at91x40_initialize(40000000);
@@ -38,7 +43,7 @@ static void __init at91eb01_map_io(void) · 2 unmodified lines
3843 MACHINE_START(AT91EB01, "Atmel AT91 EB01")
3944 /* Maintainer: Greg Ungerer <gerg@snapgear.com> */
4045 .timer = &at91x40_timer,
41− .init_irq = at91x40_init_interrupts,
46+ .init_irq = at91eb01_init_irq,
4247 .map_io = at91eb01_map_io,
4348 MACHINE_END
4449
arch/arm/mach-at91/include/mach/cpu.h+28−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #define ARCH_ID_AT91SAM9G45 0x819b05a0
2828 #define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */
2929 #define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */
30+#define ARCH_ID_AT91SAM9X5 0x819a05a0
3031 #define ARCH_ID_AT91CAP9 0x039A03A0
3132
3233 #define ARCH_ID_AT91SAM9XE128 0x329973a0
@@ -55,6 +56,12 @@ static inline unsigned long at91_cpu_fully_identify(void) · 22 unmodified lines
5556 #define ARCH_EXID_AT91SAM9G46 0x00000003
5657 #define ARCH_EXID_AT91SAM9G45 0x00000004
5758
59+#define ARCH_EXID_AT91SAM9G15 0x00000000
60+#define ARCH_EXID_AT91SAM9G35 0x00000001
61+#define ARCH_EXID_AT91SAM9X35 0x00000002
62+#define ARCH_EXID_AT91SAM9G25 0x00000003
63+#define ARCH_EXID_AT91SAM9X25 0x00000004
64+
5865 static inline unsigned long at91_exid_identify(void)
5966 {
6067 return at91_sys_read(AT91_DBGU_EXID);
@@ -143,6 +150,27 @@ static inline unsigned long at91cap9_rev_identify(void) · 82 unmodified lines
143150 #define cpu_is_at91sam9m11() (0)
144151 #endif
145152
153+#ifdef CONFIG_ARCH_AT91SAM9X5
154+#define cpu_is_at91sam9x5() (at91_cpu_identify() == ARCH_ID_AT91SAM9X5)
155+#define cpu_is_at91sam9g15() (cpu_is_at91sam9x5() && \
156+ (at91_exid_identify() == ARCH_EXID_AT91SAM9G15))
157+#define cpu_is_at91sam9g35() (cpu_is_at91sam9x5() && \
158+ (at91_exid_identify() == ARCH_EXID_AT91SAM9G35))
159+#define cpu_is_at91sam9x35() (cpu_is_at91sam9x5() && \
160+ (at91_exid_identify() == ARCH_EXID_AT91SAM9X35))
161+#define cpu_is_at91sam9g25() (cpu_is_at91sam9x5() && \
162+ (at91_exid_identify() == ARCH_EXID_AT91SAM9G25))
163+#define cpu_is_at91sam9x25() (cpu_is_at91sam9x5() && \
164+ (at91_exid_identify() == ARCH_EXID_AT91SAM9X25))
165+#else
166+#define cpu_is_at91sam9x5() (0)
167+#define cpu_is_at91sam9g15() (0)
168+#define cpu_is_at91sam9g35() (0)
169+#define cpu_is_at91sam9x35() (0)
170+#define cpu_is_at91sam9g25() (0)
171+#define cpu_is_at91sam9x25() (0)
172+#endif
173+
146174 #ifdef CONFIG_ARCH_AT91CAP9
147175 #define cpu_is_at91cap9() (at91_cpu_identify() == ARCH_ID_AT91CAP9)
148176 #define cpu_is_at91cap9_revB() (at91cap9_rev_identify() == ARCH_REVISION_CAP9_B)
arch/arm/mach-davinci/Kconfig+6−0
@@ -63,6 +63,7 @@ config MACH_DAVINCI_EVM · 62 unmodified lines
6363 depends on ARCH_DAVINCI_DM644x
6464 select MISC_DEVICES
6565 select EEPROM_AT24
66+ select I2C
6667 help
6768 Configure this option to specify the whether the board used
6869 for development is a DM644x EVM
@@ -72,6 +73,7 @@ config MACH_SFFSDR · 3 unmodified lines
7273 depends on ARCH_DAVINCI_DM644x
7374 select MISC_DEVICES
7475 select EEPROM_AT24
76+ select I2C
7577 help
7678 Say Y here to select the Lyrtech Small Form Factor
7779 Software Defined Radio (SFFSDR) board.
@@ -105,6 +107,7 @@ config MACH_DAVINCI_DM6467_EVM · 27 unmodified lines
105107 select MACH_DAVINCI_DM6467TEVM
106108 select MISC_DEVICES
107109 select EEPROM_AT24
110+ select I2C
108111 help
109112 Configure this option to specify the whether the board used
110113 for development is a DM6467 EVM
@@ -118,6 +121,7 @@ config MACH_DAVINCI_DM365_EVM · 7 unmodified lines
118121 depends on ARCH_DAVINCI_DM365
119122 select MISC_DEVICES
120123 select EEPROM_AT24
124+ select I2C
121125 help
122126 Configure this option to specify whether the board used
123127 for development is a DM365 EVM
@@ -129,6 +133,7 @@ config MACH_DAVINCI_DA830_EVM · 5 unmodified lines
129133 select GPIO_PCF857X
130134 select MISC_DEVICES
131135 select EEPROM_AT24
136+ select I2C
132137 help
133138 Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module.
134139
@@ -205,6 +210,7 @@ config MACH_MITYOMAPL138 · 70 unmodified lines
205210 depends on ARCH_DAVINCI_DA850
206211 select MISC_DEVICES
207212 select EEPROM_AT24
213+ select I2C
208214 help
209215 Say Y here to select the Critical Link MityDSP-L138/MityARM-1808
210216 System on Module. Information on this SoM may be found at
arch/arm/mach-davinci/board-mityomapl138.c+2−2
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include <mach/mux.h>
3030 #include <mach/spi.h>
3131
32−#define MITYOMAPL138_PHY_ID "0:03"
32+#define MITYOMAPL138_PHY_ID ""
3333
3434 #define FACTORY_CONFIG_MAGIC 0x012C0138
3535 #define FACTORY_CONFIG_VERSION 0x00010001
@@ -414,7 +414,7 @@ static struct resource mityomapl138_nandflash_resource[] = { · 378 unmodified lines
414414
415415 static struct platform_device mityomapl138_nandflash_device = {
416416 .name = "davinci_nand",
417− .id = 0,
417+ .id = 1,
418418 .dev = {
419419 .platform_data = &mityomapl138_nandflash_data,
420420 },
arch/arm/mach-davinci/devices-da8xx.c+9−3
@@ -39,7 +39,8 @@ · 38 unmodified lines
3939 #define DA8XX_GPIO_BASE 0x01e26000
4040 #define DA8XX_I2C1_BASE 0x01e28000
4141 #define DA8XX_SPI0_BASE 0x01c41000
42−#define DA8XX_SPI1_BASE 0x01f0e000
42+#define DA830_SPI1_BASE 0x01e12000
43+#define DA850_SPI1_BASE 0x01f0e000
4344
4445 #define DA8XX_EMAC_CTRL_REG_OFFSET 0x3000
4546 #define DA8XX_EMAC_MOD_REG_OFFSET 0x2000
@@ -762,8 +763,8 @@ static struct resource da8xx_spi0_resources[] = { · 716 unmodified lines
762763
763764 static struct resource da8xx_spi1_resources[] = {
764765 [0] = {
765− .start = DA8XX_SPI1_BASE,
766− .end = DA8XX_SPI1_BASE + SZ_4K - 1,
766+ .start = DA830_SPI1_BASE,
767+ .end = DA830_SPI1_BASE + SZ_4K - 1,
767768 .flags = IORESOURCE_MEM,
768769 },
769770 [1] = {
@@ -832,5 +833,10 @@ int __init da8xx_register_spi(int instance, struct spi_board_info *info, · 62 unmodified lines
832833
833834 da8xx_spi_pdata[instance].num_chipselect = len;
834835
836+ if (instance == 1 && cpu_is_davinci_da850()) {
837+ da8xx_spi1_resources[0].start = DA850_SPI1_BASE;
838+ da8xx_spi1_resources[0].end = DA850_SPI1_BASE + SZ_4K - 1;
839+ }
840+
835841 return platform_device_register(&da8xx_spi_device[instance]);
836842 }
arch/arm/mach-davinci/dm355.c+1−1
@@ -314,7 +314,7 @@ static struct clk timer2_clk = { · 313 unmodified lines
314314 .name = "timer2",
315315 .parent = &pll1_aux_clk,
316316 .lpsc = DAVINCI_LPSC_TIMER2,
317− .usecount = 1, /* REVISIT: why can't' this be disabled? */
317+ .usecount = 1, /* REVISIT: why can't this be disabled? */
318318 };
319319
320320 static struct clk timer3_clk = {
arch/arm/mach-davinci/dm644x.c+1−1
@@ -274,7 +274,7 @@ static struct clk timer2_clk = { · 273 unmodified lines
274274 .name = "timer2",
275275 .parent = &pll1_aux_clk,
276276 .lpsc = DAVINCI_LPSC_TIMER2,
277− .usecount = 1, /* REVISIT: why can't' this be disabled? */
277+ .usecount = 1, /* REVISIT: why can't this be disabled? */
278278 };
279279
280280 static struct clk_lookup dm644x_clks[] = {
arch/arm/mach-davinci/include/mach/debug-macro.S+8−5
@@ -24,6 +24,9 @@ · 23 unmodified lines
2424
2525 #define UART_SHIFT 2
2626
27+#define davinci_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
28+#define davinci_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
29+
2730 .pushsection .data
2831 davinci_uart_phys: .word 0
2932 davinci_uart_virt: .word 0
@@ -34,7 +37,7 @@ davinci_uart_virt: .word 0 · 4 unmodified lines
3437 /* Use davinci_uart_phys/virt if already configured */
3538 10: mrc p15, 0, \rp, c1, c0
3639 tst \rp, #1 @ MMU enabled?
37− ldreq \rp, =__virt_to_phys(davinci_uart_phys)
40+ ldreq \rp, =davinci_uart_v2p(davinci_uart_phys)
3841 ldrne \rp, =davinci_uart_phys
3942 add \rv, \rp, #4 @ davinci_uart_virt
4043 ldr \rp, [\rp, #0]
@@ -48,18 +51,18 @@ davinci_uart_virt: .word 0 · 7 unmodified lines
4851 tst \rp, #1 @ MMU enabled?
4952
5053 /* Copy uart phys address from decompressor uart info */
51− ldreq \rv, =__virt_to_phys(davinci_uart_phys)
54+ ldreq \rv, =davinci_uart_v2p(davinci_uart_phys)
5255 ldrne \rv, =davinci_uart_phys
5356 ldreq \rp, =DAVINCI_UART_INFO
54− ldrne \rp, =__phys_to_virt(DAVINCI_UART_INFO)
57+ ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO)
5558 ldr \rp, [\rp, #0]
5659 str \rp, [\rv]
5760
5861 /* Copy uart virt address from decompressor uart info */
59− ldreq \rv, =__virt_to_phys(davinci_uart_virt)
62+ ldreq \rv, =davinci_uart_v2p(davinci_uart_virt)
6063 ldrne \rv, =davinci_uart_virt
6164 ldreq \rp, =DAVINCI_UART_INFO
62− ldrne \rp, =__phys_to_virt(DAVINCI_UART_INFO)
65+ ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO)
6366 ldr \rp, [\rp, #4]
6467 str \rp, [\rv]
6568
arch/arm/mach-davinci/include/mach/serial.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 *
2323 * This area sits just below the page tables (see arch/arm/kernel/head.S).
2424 */
25−#define DAVINCI_UART_INFO (PHYS_OFFSET + 0x3ff8)
25+#define DAVINCI_UART_INFO (PLAT_PHYS_OFFSET + 0x3ff8)
2626
2727 #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
2828 #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
arch/arm/mach-mx3/mach-vpr200.c+8−3
@@ -257,11 +257,16 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { · 256 unmodified lines
257257 .workaround = FLS_USB2_WORKAROUND_ENGCM09152,
258258 };
259259
260+static int vpr200_usbh_init(struct platform_device *pdev)
261+{
262+ return mx35_initialize_usb_hw(pdev->id,
263+ MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY);
264+}
265+
260266 /* USB HOST config */
261267 static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
262− .portsc = MXC_EHCI_MODE_SERIAL,
263− .flags = MXC_EHCI_INTERFACE_SINGLE_UNI |
264− MXC_EHCI_INTERNAL_PHY,
268+ .init = vpr200_usbh_init,
269+ .portsc = MXC_EHCI_MODE_SERIAL,
265270 };
266271
267272 static struct platform_device *devices[] __initdata = {
arch/arm/mach-mx5/board-mx53_loco.c+1−1
@@ -193,7 +193,7 @@ static iomux_v3_cfg_t mx53_loco_pads[] = { · 192 unmodified lines
193193 .wakeup = wake, \
194194 }
195195
196−static const struct gpio_keys_button loco_buttons[] __initconst = {
196+static struct gpio_keys_button loco_buttons[] = {
197197 GPIO_BUTTON(MX53_LOCO_POWER, KEY_POWER, 1, "power", 0),
198198 GPIO_BUTTON(MX53_LOCO_UI1, KEY_VOLUMEUP, 1, "volume-up", 0),
199199 GPIO_BUTTON(MX53_LOCO_UI2, KEY_VOLUMEDOWN, 1, "volume-down", 0),
arch/arm/mach-mxs/clock-mx28.c+6−1
@@ -295,11 +295,11 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \ · 294 unmodified lines
295295 unsigned long diff, parent_rate, calc_rate; \
296296 int i; \
297297 \
298− parent_rate = clk_get_rate(clk->parent); \
299298 div_max = BM_CLKCTRL_##dr##_DIV >> BP_CLKCTRL_##dr##_DIV; \
300299 bm_busy = BM_CLKCTRL_##dr##_BUSY; \
301300 \
302301 if (clk->parent == &ref_xtal_clk) { \
302+ parent_rate = clk_get_rate(clk->parent); \
303303 div = DIV_ROUND_UP(parent_rate, rate); \
304304 if (clk == &cpu_clk) { \
305305 div_max = BM_CLKCTRL_CPU_DIV_XTAL >> \
@@ -309,6 +309,11 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \ · 3 unmodified lines
309309 if (div == 0 || div > div_max) \
310310 return -EINVAL; \
311311 } else { \
312+ /* \
313+ * hack alert: this block modifies clk->parent, too, \
314+ * so the base to use it the grand parent. \
315+ */ \
316+ parent_rate = clk_get_rate(clk->parent->parent); \
312317 rate >>= PARENT_RATE_SHIFT; \
313318 parent_rate >>= PARENT_RATE_SHIFT; \
314319 diff = parent_rate; \
arch/arm/mach-omap2/Makefile+1−1
@@ -68,7 +68,7 @@ obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o · 67 unmodified lines
6868 obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
6969
7070 AFLAGS_sleep24xx.o :=-Wa,-march=armv6
71−AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a
71+AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec)
7272
7373 ifeq ($(CONFIG_PM_VERBOSE),y)
7474 CFLAGS_pm_bus.o += -DDEBUG
arch/arm/mach-omap2/board-rx51.c+7−2
@@ -141,14 +141,19 @@ static void __init rx51_init(void) · 140 unmodified lines
141141 static void __init rx51_map_io(void)
142142 {
143143 omap2_set_globals_3xxx();
144− rx51_video_mem_init();
145144 omap34xx_map_common_io();
146145 }
147146
147+static void __init rx51_reserve(void)
148+{
149+ rx51_video_mem_init();
150+ omap_reserve();
151+}
152+
148153 MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
149154 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
150155 .boot_params = 0x80000100,
151− .reserve = omap_reserve,
156+ .reserve = rx51_reserve,
152157 .map_io = rx51_map_io,
153158 .init_early = rx51_init_early,
154159 .init_irq = omap_init_irq,
arch/arm/mach-omap2/clkt34xx_dpll3m2.c+1−0
@@ -115,6 +115,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) · 114 unmodified lines
115115 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
116116 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
117117 0, 0, 0, 0);
118+ clk->rate = rate;
118119
119120 return 0;
120121 }
arch/arm/mach-omap2/clock44xx_data.c+2−7
@@ -3116,14 +3116,9 @@ static struct omap_clk omap44xx_clks[] = { · 3115 unmodified lines
31163116 CLK(NULL, "dsp_fck", &dsp_fck, CK_443X),
31173117 CLK("omapdss_dss", "sys_clk", &dss_sys_clk, CK_443X),
31183118 CLK("omapdss_dss", "tv_clk", &dss_tv_clk, CK_443X),
3119− CLK("omapdss_dss", "dss_clk", &dss_dss_clk, CK_443X),
31203119 CLK("omapdss_dss", "video_clk", &dss_48mhz_clk, CK_443X),
3121− CLK("omapdss_dss", "fck", &dss_fck, CK_443X),
3122− /*
3123− * On OMAP4, DSS ick is a dummy clock; this is needed for compatibility
3124− * with OMAP2/3.
3125− */
3126− CLK("omapdss_dss", "ick", &dummy_ck, CK_443X),
3120+ CLK("omapdss_dss", "fck", &dss_dss_clk, CK_443X),
3121+ CLK("omapdss_dss", "ick", &dss_fck, CK_443X),
31273122 CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X),
31283123 CLK(NULL, "emif1_fck", &emif1_fck, CK_443X),
31293124 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X),
arch/arm/mach-omap2/cm2xxx_3xxx.c+17−0
@@ -247,6 +247,7 @@ struct omap3_cm_regs { · 246 unmodified lines
247247 u32 per_cm_clksel;
248248 u32 emu_cm_clksel;
249249 u32 emu_cm_clkstctrl;
250+ u32 pll_cm_autoidle;
250251 u32 pll_cm_autoidle2;
251252 u32 pll_cm_clksel4;
252253 u32 pll_cm_clksel5;
@@ -319,6 +320,15 @@ void omap3_cm_save_context(void) · 66 unmodified lines
319320 omap2_cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1);
320321 cm_context.emu_cm_clkstctrl =
321322 omap2_cm_read_mod_reg(OMAP3430_EMU_MOD, OMAP2_CM_CLKSTCTRL);
323+ /*
324+ * As per erratum i671, ROM code does not respect the PER DPLL
325+ * programming scheme if CM_AUTOIDLE_PLL.AUTO_PERIPH_DPLL == 1.
326+ * In this case, even though this register has been saved in
327+ * scratchpad contents, we need to restore AUTO_PERIPH_DPLL
328+ * by ourselves. So, we need to save it anyway.
329+ */
330+ cm_context.pll_cm_autoidle =
331+ omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
322332 cm_context.pll_cm_autoidle2 =
323333 omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2);
324334 cm_context.pll_cm_clksel4 =
@@ -441,6 +451,13 @@ void omap3_cm_restore_context(void) · 116 unmodified lines
441451 CM_CLKSEL1);
442452 omap2_cm_write_mod_reg(cm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD,
443453 OMAP2_CM_CLKSTCTRL);
454+ /*
455+ * As per erratum i671, ROM code does not respect the PER DPLL
456+ * programming scheme if CM_AUTOIDLE_PLL.AUTO_PERIPH_DPLL == 1.
457+ * In this case, we need to restore AUTO_PERIPH_DPLL by ourselves.
458+ */
459+ omap2_cm_write_mod_reg(cm_context.pll_cm_autoidle, PLL_MOD,
460+ CM_AUTOIDLE);
444461 omap2_cm_write_mod_reg(cm_context.pll_cm_autoidle2, PLL_MOD,
445462 CM_AUTOIDLE2);
446463 omap2_cm_write_mod_reg(cm_context.pll_cm_clksel4, PLL_MOD,
arch/arm/mach-omap2/control.c+7−1
@@ -316,8 +316,14 @@ void omap3_save_scratchpad_contents(void) · 315 unmodified lines
316316 omap2_cm_read_mod_reg(WKUP_MOD, CM_CLKSEL);
317317 prcm_block_contents.cm_clken_pll =
318318 omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
319+ /*
320+ * As per erratum i671, ROM code does not respect the PER DPLL
321+ * programming scheme if CM_AUTOIDLE_PLL..AUTO_PERIPH_DPLL == 1.
322+ * Then, in anycase, clear these bits to avoid extra latencies.
323+ */
319324 prcm_block_contents.cm_autoidle_pll =
320− omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_AUTOIDLE_PLL);
325+ omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE) &
326+ ~OMAP3430_AUTO_PERIPH_DPLL_MASK;
321327 prcm_block_contents.cm_clksel1_pll =
322328 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL1_PLL);
323329 prcm_block_contents.cm_clksel2_pll =
arch/arm/mach-omap2/omap_hwmod_2420_data.c+5−1
@@ -1639,6 +1639,7 @@ static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = { · 1638 unmodified lines
16391639
16401640 static struct omap_hwmod omap2420_gpio1_hwmod = {
16411641 .name = "gpio1",
1642+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
16421643 .mpu_irqs = omap242x_gpio1_irqs,
16431644 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio1_irqs),
16441645 .main_clk = "gpios_fck",
@@ -1669,6 +1670,7 @@ static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = { · 24 unmodified lines
16691670
16701671 static struct omap_hwmod omap2420_gpio2_hwmod = {
16711672 .name = "gpio2",
1673+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
16721674 .mpu_irqs = omap242x_gpio2_irqs,
16731675 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio2_irqs),
16741676 .main_clk = "gpios_fck",
@@ -1699,6 +1701,7 @@ static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = { · 24 unmodified lines
16991701
17001702 static struct omap_hwmod omap2420_gpio3_hwmod = {
17011703 .name = "gpio3",
1704+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
17021705 .mpu_irqs = omap242x_gpio3_irqs,
17031706 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio3_irqs),
17041707 .main_clk = "gpios_fck",
@@ -1729,6 +1732,7 @@ static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = { · 24 unmodified lines
17291732
17301733 static struct omap_hwmod omap2420_gpio4_hwmod = {
17311734 .name = "gpio4",
1735+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
17321736 .mpu_irqs = omap242x_gpio4_irqs,
17331737 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio4_irqs),
17341738 .main_clk = "gpios_fck",
@@ -1782,7 +1786,7 @@ static struct omap_hwmod_irq_info omap2420_dma_system_irqs[] = { · 47 unmodified lines
17821786 static struct omap_hwmod_addr_space omap2420_dma_system_addrs[] = {
17831787 {
17841788 .pa_start = 0x48056000,
1785− .pa_end = 0x4a0560ff,
1789+ .pa_end = 0x48056fff,
17861790 .flags = ADDR_TYPE_RT
17871791 },
17881792 };
arch/arm/mach-omap2/omap_hwmod_2430_data.c+6−1
@@ -1742,6 +1742,7 @@ static struct omap_hwmod_ocp_if *omap2430_gpio1_slaves[] = { · 1741 unmodified lines
17421742
17431743 static struct omap_hwmod omap2430_gpio1_hwmod = {
17441744 .name = "gpio1",
1745+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
17451746 .mpu_irqs = omap243x_gpio1_irqs,
17461747 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio1_irqs),
17471748 .main_clk = "gpios_fck",
@@ -1772,6 +1773,7 @@ static struct omap_hwmod_ocp_if *omap2430_gpio2_slaves[] = { · 24 unmodified lines
17721773
17731774 static struct omap_hwmod omap2430_gpio2_hwmod = {
17741775 .name = "gpio2",
1776+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
17751777 .mpu_irqs = omap243x_gpio2_irqs,
17761778 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio2_irqs),
17771779 .main_clk = "gpios_fck",
@@ -1802,6 +1804,7 @@ static struct omap_hwmod_ocp_if *omap2430_gpio3_slaves[] = { · 24 unmodified lines
18021804
18031805 static struct omap_hwmod omap2430_gpio3_hwmod = {
18041806 .name = "gpio3",
1807+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
18051808 .mpu_irqs = omap243x_gpio3_irqs,
18061809 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio3_irqs),
18071810 .main_clk = "gpios_fck",
@@ -1832,6 +1835,7 @@ static struct omap_hwmod_ocp_if *omap2430_gpio4_slaves[] = { · 24 unmodified lines
18321835
18331836 static struct omap_hwmod omap2430_gpio4_hwmod = {
18341837 .name = "gpio4",
1838+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
18351839 .mpu_irqs = omap243x_gpio4_irqs,
18361840 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio4_irqs),
18371841 .main_clk = "gpios_fck",
@@ -1862,6 +1866,7 @@ static struct omap_hwmod_ocp_if *omap2430_gpio5_slaves[] = { · 24 unmodified lines
18621866
18631867 static struct omap_hwmod omap2430_gpio5_hwmod = {
18641868 .name = "gpio5",
1869+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
18651870 .mpu_irqs = omap243x_gpio5_irqs,
18661871 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio5_irqs),
18671872 .main_clk = "gpio5_fck",
@@ -1915,7 +1920,7 @@ static struct omap_hwmod_irq_info omap2430_dma_system_irqs[] = { · 47 unmodified lines
19151920 static struct omap_hwmod_addr_space omap2430_dma_system_addrs[] = {
19161921 {
19171922 .pa_start = 0x48056000,
1918− .pa_end = 0x4a0560ff,
1923+ .pa_end = 0x48056fff,
19191924 .flags = ADDR_TYPE_RT
19201925 },
19211926 };
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c+7−1
@@ -2141,6 +2141,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_gpio1_slaves[] = { · 2140 unmodified lines
21412141
21422142 static struct omap_hwmod omap3xxx_gpio1_hwmod = {
21432143 .name = "gpio1",
2144+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
21442145 .mpu_irqs = omap3xxx_gpio1_irqs,
21452146 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio1_irqs),
21462147 .main_clk = "gpio1_ick",
@@ -2177,6 +2178,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_gpio2_slaves[] = { · 30 unmodified lines
21772178
21782179 static struct omap_hwmod omap3xxx_gpio2_hwmod = {
21792180 .name = "gpio2",
2181+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
21802182 .mpu_irqs = omap3xxx_gpio2_irqs,
21812183 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio2_irqs),
21822184 .main_clk = "gpio2_ick",
@@ -2213,6 +2215,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_gpio3_slaves[] = { · 30 unmodified lines
22132215
22142216 static struct omap_hwmod omap3xxx_gpio3_hwmod = {
22152217 .name = "gpio3",
2218+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
22162219 .mpu_irqs = omap3xxx_gpio3_irqs,
22172220 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio3_irqs),
22182221 .main_clk = "gpio3_ick",
@@ -2249,6 +2252,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_gpio4_slaves[] = { · 30 unmodified lines
22492252
22502253 static struct omap_hwmod omap3xxx_gpio4_hwmod = {
22512254 .name = "gpio4",
2255+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
22522256 .mpu_irqs = omap3xxx_gpio4_irqs,
22532257 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio4_irqs),
22542258 .main_clk = "gpio4_ick",
@@ -2285,6 +2289,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_gpio5_slaves[] = { · 30 unmodified lines
22852289
22862290 static struct omap_hwmod omap3xxx_gpio5_hwmod = {
22872291 .name = "gpio5",
2292+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
22882293 .mpu_irqs = omap3xxx_gpio5_irqs,
22892294 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio5_irqs),
22902295 .main_clk = "gpio5_ick",
@@ -2321,6 +2326,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_gpio6_slaves[] = { · 30 unmodified lines
23212326
23222327 static struct omap_hwmod omap3xxx_gpio6_hwmod = {
23232328 .name = "gpio6",
2329+ .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
23242330 .mpu_irqs = omap3xxx_gpio6_irqs,
23252331 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio6_irqs),
23262332 .main_clk = "gpio6_ick",
@@ -2386,7 +2392,7 @@ static struct omap_hwmod_irq_info omap3xxx_dma_system_irqs[] = { · 59 unmodified lines
23862392 static struct omap_hwmod_addr_space omap3xxx_dma_system_addrs[] = {
23872393 {
23882394 .pa_start = 0x48056000,
2389− .pa_end = 0x4a0560ff,
2395+ .pa_end = 0x48056fff,
23902396 .flags = ADDR_TYPE_RT
23912397 },
23922398 };
arch/arm/mach-omap2/omap_hwmod_44xx_data.c+1−1
@@ -885,7 +885,7 @@ static struct omap_hwmod_ocp_if *omap44xx_dma_system_masters[] = { · 884 unmodified lines
885885 static struct omap_hwmod_addr_space omap44xx_dma_system_addrs[] = {
886886 {
887887 .pa_start = 0x4a056000,
888− .pa_end = 0x4a0560ff,
888+ .pa_end = 0x4a056fff,
889889 .flags = ADDR_TYPE_RT
890890 },
891891 };
arch/arm/mach-omap2/omap_l3_smx.c+2−2
@@ -196,11 +196,11 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) · 195 unmodified lines
196196 /* No timeout error for debug sources */
197197 }
198198
199− base = ((l3->rt) + (*(omap3_l3_bases[int_type] + err_source)));
200−
201199 /* identify the error source */
202200 for (err_source = 0; !(status & (1 << err_source)); err_source++)
203201 ;
202+
203+ base = l3->rt + *(omap3_l3_bases[int_type] + err_source);
204204 error = omap3_l3_readll(base, L3_ERROR_LOG);
205205
206206 if (error) {
arch/arm/mach-omap2/pm.c+1−0
@@ -89,6 +89,7 @@ static void omap2_init_processor_devices(void) · 88 unmodified lines
8989 if (cpu_is_omap44xx()) {
9090 _init_omap_device("l3_main_1", &l3_dev);
9191 _init_omap_device("dsp", &dsp_dev);
92+ _init_omap_device("iva", &iva_dev);
9293 } else {
9394 _init_omap_device("l3_main", &l3_dev);
9495 }
arch/arm/mach-omap2/voltage.c+0−1
@@ -114,7 +114,6 @@ static int __init _config_common_vdd_data(struct omap_vdd_info *vdd) · 113 unmodified lines
114114 sys_clk_speed /= 1000;
115115
116116 /* Generic voltage parameters */
117− vdd->curr_volt = 1200000;
118117 vdd->volt_scale = vp_forceupdate_scale_voltage;
119118 vdd->vp_enabled = false;
120119
arch/arm/mach-pxa/hx4700.c+1−1
@@ -711,7 +711,7 @@ static struct regulator_consumer_supply bq24022_consumers[] = { · 710 unmodified lines
711711 static struct regulator_init_data bq24022_init_data = {
712712 .constraints = {
713713 .max_uA = 500000,
714− .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
714+ .valid_ops_mask = REGULATOR_CHANGE_CURRENT|REGULATOR_CHANGE_STATUS,
715715 },
716716 .num_consumer_supplies = ARRAY_SIZE(bq24022_consumers),
717717 .consumer_supplies = bq24022_consumers,
arch/arm/mach-pxa/magician.c+1−1
@@ -599,7 +599,7 @@ static struct regulator_consumer_supply bq24022_consumers[] = { · 598 unmodified lines
599599 static struct regulator_init_data bq24022_init_data = {
600600 .constraints = {
601601 .max_uA = 500000,
602− .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
602+ .valid_ops_mask = REGULATOR_CHANGE_CURRENT | REGULATOR_CHANGE_STATUS,
603603 },
604604 .num_consumer_supplies = ARRAY_SIZE(bq24022_consumers),
605605 .consumer_supplies = bq24022_consumers,
arch/arm/mach-realview/include/mach/barriers.h+1−1
@@ -4,5 +4,5 @@ · 3 unmodified lines
44 * operation to deadlock the system.
55 */
66 #define mb() dsb()
7−#define rmb() dmb()
7+#define rmb() dsb()
88 #define wmb() mb()
arch/arm/mach-s3c2440/mach-gta02.c+5−0
@@ -409,6 +409,10 @@ struct platform_device s3c24xx_pwm_device = { · 408 unmodified lines
409409 .num_resources = 0,
410410 };
411411
412+static struct platform_device gta02_dfbmcs320_device = {
413+ .name = "dfbmcs320",
414+};
415+
412416 static struct i2c_board_info gta02_i2c_devs[] __initdata = {
413417 {
414418 I2C_BOARD_INFO("pcf50633", 0x73),
@@ -523,6 +527,7 @@ static struct platform_device *gta02_devices[] __initdata = { · 108 unmodified lines
523527 &s3c_device_iis,
524528 &samsung_asoc_dma,
525529 &s3c_device_i2c0,
530+ &gta02_dfbmcs320_device,
526531 &gta02_buttons_device,
527532 &s3c_device_adc,
528533 &s3c_device_ts,
arch/arm/mach-tegra/include/mach/barriers.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323
2424 #include <asm/outercache.h>
2525
26−#define rmb() dmb()
26+#define rmb() dsb()
2727 #define wmb() do { dsb(); outer_sync(); } while (0)
2828 #define mb() wmb()
2929
arch/arm/mach-ux500/board-mop500.c+10−9
@@ -178,16 +178,15 @@ static struct i2c_board_info __initdata mop500_i2c0_devices[] = { · 177 unmodified lines
178178 .irq = NOMADIK_GPIO_TO_IRQ(217),
179179 .platform_data = &mop500_tc35892_data,
180180 },
181−};
182−
183−/* I2C0 devices only available prior to HREFv60 */
184−static struct i2c_board_info __initdata mop500_i2c0_old_devices[] = {
181+ /* I2C0 devices only available prior to HREFv60 */
185182 {
186183 I2C_BOARD_INFO("tps61052", 0x33),
187184 .platform_data = &mop500_tps61052_data,
188185 },
189186 };
190187
188+#define NUM_PRE_V60_I2C0_DEVICES 1
189+
191190 static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
192191 {
193192 /* lp5521 LED driver, 1st device */
@@ -425,6 +424,8 @@ static void __init mop500_uart_init(void) · 231 unmodified lines
425424
426425 static void __init mop500_init_machine(void)
427426 {
427+ int i2c0_devs;
428+
428429 /*
429430 * The HREFv60 board removed a GPIO expander and routed
430431 * all these GPIO pins to the internal GPIO controller
@@ -448,11 +449,11 @@ static void __init mop500_init_machine(void) · 17 unmodified lines
448449
449450 platform_device_register(&ab8500_device);
450451
451− i2c_register_board_info(0, mop500_i2c0_devices,
452− ARRAY_SIZE(mop500_i2c0_devices));
453− if (!machine_is_hrefv60())
454− i2c_register_board_info(0, mop500_i2c0_old_devices,
455− ARRAY_SIZE(mop500_i2c0_old_devices));
452+ i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
453+ if (machine_is_hrefv60())
454+ i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
455+
456+ i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
456457 i2c_register_board_info(2, mop500_i2c2_devices,
457458 ARRAY_SIZE(mop500_i2c2_devices));
458459 }
arch/arm/mm/init.c+15−1
@@ -392,7 +392,7 @@ free_memmap(unsigned long start_pfn, unsigned long end_pfn) · 391 unmodified lines
392392 * Convert start_pfn/end_pfn to a struct page pointer.
393393 */
394394 start_pg = pfn_to_page(start_pfn - 1) + 1;
395− end_pg = pfn_to_page(end_pfn);
395+ end_pg = pfn_to_page(end_pfn - 1) + 1;
396396
397397 /*
398398 * Convert to physical addresses, and
@@ -426,6 +426,14 @@ static void __init free_unused_memmap(struct meminfo *mi) · 27 unmodified lines
426426
427427 bank_start = bank_pfn_start(bank);
428428
429+#ifdef CONFIG_SPARSEMEM
430+ /*
431+ * Take care not to free memmap entries that don't exist
432+ * due to SPARSEMEM sections which aren't present.
433+ */
434+ bank_start = min(bank_start,
435+ ALIGN(prev_bank_end, PAGES_PER_SECTION));
436+#endif
429437 /*
430438 * If we had a previous bank, and there is a space
431439 * between the current bank and the previous, free it.
@@ -440,6 +448,12 @@ static void __init free_unused_memmap(struct meminfo *mi) · 8 unmodified lines
440448 */
441449 prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES);
442450 }
451+
452+#ifdef CONFIG_SPARSEMEM
453+ if (!IS_ALIGNED(prev_bank_end, PAGES_PER_SECTION))
454+ free_memmap(prev_bank_end,
455+ ALIGN(prev_bank_end, PAGES_PER_SECTION));
456+#endif
443457 }
444458
445459 static void __init free_highpages(void)
arch/arm/mm/proc-xscale.S+1−1
@@ -395,7 +395,7 @@ ENTRY(xscale_dma_a0_map_area) · 394 unmodified lines
395395 teq r2, #DMA_TO_DEVICE
396396 beq xscale_dma_clean_range
397397 b xscale_dma_flush_range
398−ENDPROC(xscsale_dma_a0_map_area)
398+ENDPROC(xscale_dma_a0_map_area)
399399
400400 /*
401401 * dma_unmap_area(start, size, dir)
arch/arm/plat-mxc/gpio.c+7−0
@@ -295,6 +295,12 @@ static int mxc_gpio_direction_output(struct gpio_chip *chip, · 294 unmodified lines
295295 return 0;
296296 }
297297
298+/*
299+ * This lock class tells lockdep that GPIO irqs are in a different
300+ * category than their parents, so it won't report false recursion.
301+ */
302+static struct lock_class_key gpio_lock_class;
303+
298304 int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
299305 {
300306 int i, j;
@@ -311,6 +317,7 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt) · 10 unmodified lines
311317 __raw_writel(~0, port[i].base + GPIO_ISR);
312318 for (j = port[i].virtual_irq_start;
313319 j < port[i].virtual_irq_start + 32; j++) {
320+ irq_set_lockdep_class(j, &gpio_lock_class);
314321 irq_set_chip_and_handler(j, &gpio_irq_chip,
315322 handle_level_irq);
316323 set_irq_flags(j, IRQF_VALID);
arch/arm/plat-mxc/ssi-fiq.S+2−0
@@ -124,6 +124,8 @@ imx_ssi_fiq_start: · 123 unmodified lines
124124 1:
125125 @ return from FIQ
126126 subs pc, lr, #4
127+
128+ .align
127129 imx_ssi_fiq_base:
128130 .word 0x0
129131 imx_ssi_fiq_rx_buffer:
arch/arm/plat-omap/iommu.c+2−0
@@ -793,6 +793,8 @@ static irqreturn_t iommu_fault_handler(int irq, void *data) · 792 unmodified lines
793793 clk_enable(obj->clk);
794794 errs = iommu_report_fault(obj, &da);
795795 clk_disable(obj->clk);
796+ if (errs == 0)
797+ return IRQ_HANDLED;
796798
797799 /* Fault callback or TLB/PTE Dynamic loading */
798800 if (obj->isr && !obj->isr(obj, da, errs, obj->isr_priv))
arch/m68k/mm/motorola.c+2−0
@@ -300,6 +300,8 @@ void __init paging_init(void) · 299 unmodified lines
300300 zones_size[ZONE_DMA] = m68k_memory[i].size >> PAGE_SHIFT;
301301 free_area_init_node(i, zones_size,
302302 m68k_memory[i].addr >> PAGE_SHIFT, NULL);
303+ if (node_present_pages(i))
304+ node_set_state(i, N_NORMAL_MEMORY);
303305 }
304306 }
305307
arch/mips/Kconfig+0−5
@@ -997,9 +997,6 @@ config IRQ_GT641XX · 996 unmodified lines
997997 config IRQ_GIC
998998 bool
999999
1000−config IRQ_CPU_OCTEON
1001− bool
1002−
10031000 config MIPS_BOARDS_GEN
10041001 bool
10051002
@@ -1359,8 +1356,6 @@ config CPU_SB1 · 353 unmodified lines
13591356 config CPU_CAVIUM_OCTEON
13601357 bool "Cavium Octeon processor"
13611358 depends on SYS_HAS_CPU_CAVIUM_OCTEON
1362− select IRQ_CPU
1363− select IRQ_CPU_OCTEON
13641359 select CPU_HAS_PREFETCH
13651360 select CPU_SUPPORTS_64BIT_KERNEL
13661361 select SYS_SUPPORTS_SMP
arch/mips/alchemy/devboards/db1x00/board_setup.c+33−28
@@ -127,13 +127,10 @@ const char *get_system_type(void) · 126 unmodified lines
127127 void __init board_setup(void)
128128 {
129129 unsigned long bcsr1, bcsr2;
130− u32 pin_func;
131130
132131 bcsr1 = DB1000_BCSR_PHYS_ADDR;
133132 bcsr2 = DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS;
134133
135− pin_func = 0;
136−
137134 #ifdef CONFIG_MIPS_DB1000
138135 printk(KERN_INFO "AMD Alchemy Au1000/Db1000 Board\n");
139136 #endif
@@ -164,12 +161,16 @@ void __init board_setup(void) · 24 unmodified lines
164161 /* Not valid for Au1550 */
165162 #if defined(CONFIG_IRDA) && \
166163 (defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100))
167− /* Set IRFIRSEL instead of GPIO15 */
168− pin_func = au_readl(SYS_PINFUNC) | SYS_PF_IRF;
169− au_writel(pin_func, SYS_PINFUNC);
170− /* Power off until the driver is in use */
171− bcsr_mod(BCSR_RESETS, BCSR_RESETS_IRDA_MODE_MASK,
172− BCSR_RESETS_IRDA_MODE_OFF);
164+ {
165+ u32 pin_func;
166+
167+ /* Set IRFIRSEL instead of GPIO15 */
168+ pin_func = au_readl(SYS_PINFUNC) | SYS_PF_IRF;
169+ au_writel(pin_func, SYS_PINFUNC);
170+ /* Power off until the driver is in use */
171+ bcsr_mod(BCSR_RESETS, BCSR_RESETS_IRDA_MODE_MASK,
172+ BCSR_RESETS_IRDA_MODE_OFF);
173+ }
173174 #endif
174175 bcsr_write(BCSR_PCMCIA, 0); /* turn off PCMCIA power */
175176
@@ -177,31 +178,35 @@ void __init board_setup(void) · 1 unmodified line
177178 alchemy_gpio1_input_enable();
178179
179180 #ifdef CONFIG_MIPS_MIRAGE
180− /* GPIO[20] is output */
181− alchemy_gpio_direction_output(20, 0);
181+ {
182+ u32 pin_func;
182183
183− /* Set GPIO[210:208] instead of SSI_0 */
184− pin_func = au_readl(SYS_PINFUNC) | SYS_PF_S0;
184+ /* GPIO[20] is output */
185+ alchemy_gpio_direction_output(20, 0);
185186
186− /* Set GPIO[215:211] for LEDs */
187− pin_func |= 5 << 2;
187+ /* Set GPIO[210:208] instead of SSI_0 */
188+ pin_func = au_readl(SYS_PINFUNC) | SYS_PF_S0;
188189
189− /* Set GPIO[214:213] for more LEDs */
190− pin_func |= 5 << 12;
190+ /* Set GPIO[215:211] for LEDs */
191+ pin_func |= 5 << 2;
191192
192− /* Set GPIO[207:200] instead of PCMCIA/LCD */
193− pin_func |= SYS_PF_LCD | SYS_PF_PC;
194− au_writel(pin_func, SYS_PINFUNC);
193+ /* Set GPIO[214:213] for more LEDs */
194+ pin_func |= 5 << 12;
195195
196− /*
197− * Enable speaker amplifier. This should
198− * be part of the audio driver.
199− */
200− alchemy_gpio_direction_output(209, 1);
196+ /* Set GPIO[207:200] instead of PCMCIA/LCD */
197+ pin_func |= SYS_PF_LCD | SYS_PF_PC;
198+ au_writel(pin_func, SYS_PINFUNC);
201199
202− pm_power_off = mirage_power_off;
203− _machine_halt = mirage_power_off;
204− _machine_restart = (void(*)(char *))mips_softreset;
200+ /*
201+ * Enable speaker amplifier. This should
202+ * be part of the audio driver.
203+ */
204+ alchemy_gpio_direction_output(209, 1);
205+
206+ pm_power_off = mirage_power_off;
207+ _machine_halt = mirage_power_off;
208+ _machine_restart = (void(*)(char *))mips_softreset;
209+ }
205210 #endif
206211
207212 #ifdef CONFIG_MIPS_BOSPORUS
arch/mips/alchemy/xxs1500/init.c+2−3
@@ -51,10 +51,9 @@ void __init prom_init(void) · 50 unmodified lines
5151 prom_init_cmdline();
5252
5353 memsize_str = prom_getenv("memsize");
54− if (!memsize_str)
54+ if (!memsize_str || strict_strtoul(memsize_str, 0, &memsize))
5555 memsize = 0x04000000;
56− else
57− strict_strtoul(memsize_str, 0, &memsize);
56+
5857 add_memory_region(0, memsize, BOOT_MEM_RAM);
5958 }
6059
arch/mips/ar7/gpio.c+1−3
@@ -325,9 +325,7 @@ int __init ar7_gpio_init(void) · 324 unmodified lines
325325 size = 0x1f;
326326 }
327327
328− gpch->regs = ioremap_nocache(AR7_REGS_GPIO,
329− AR7_REGS_GPIO + 0x10);
330−
328+ gpch->regs = ioremap_nocache(AR7_REGS_GPIO, size);
331329 if (!gpch->regs) {
332330 printk(KERN_ERR "%s: failed to ioremap regs\n",
333331 gpch->chip.label);
arch/mips/boot/compressed/calc_vmlinuz_load_addr.c+1−1
@@ -16,8 +16,8 @@ · 15 unmodified lines
1616
1717 int main(int argc, char *argv[])
1818 {
19+ unsigned long long vmlinux_size, vmlinux_load_addr, vmlinuz_load_addr;
1920 struct stat sb;
20− uint64_t vmlinux_size, vmlinux_load_addr, vmlinuz_load_addr;
2121
2222 if (argc != 3) {
2323 fprintf(stderr, "Usage: %s <pathname> <vmlinux_load_addr>\n",
arch/mips/cavium-octeon/Kconfig+4−11
@@ -1,11 +1,7 @@
1−config CAVIUM_OCTEON_SPECIFIC_OPTIONS
2− bool "Enable Octeon specific options"
3− depends on CPU_CAVIUM_OCTEON
4− default "y"
1+if CPU_CAVIUM_OCTEON
52
63 config CAVIUM_CN63XXP1
74 bool "Enable CN63XXP1 errata worarounds"
8− depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
95 default "n"
106 help
117 The CN63XXP1 chip requires build time workarounds to
@@ -16,7 +12,6 @@ config CAVIUM_CN63XXP1 · 4 unmodified lines
1612
1713 config CAVIUM_OCTEON_2ND_KERNEL
1814 bool "Build the kernel to be used as a 2nd kernel on the same chip"
19− depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
2015 default "n"
2116 help
2217 This option configures this kernel to be linked at a different
@@ -26,7 +21,6 @@ config CAVIUM_OCTEON_2ND_KERNEL · 3 unmodified lines
2621
2722 config CAVIUM_OCTEON_HW_FIX_UNALIGNED
2823 bool "Enable hardware fixups of unaligned loads and stores"
29− depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
3024 default "y"
3125 help
3226 Configure the Octeon hardware to automatically fix unaligned loads
@@ -38,7 +32,6 @@ config CAVIUM_OCTEON_HW_FIX_UNALIGNED · 5 unmodified lines
3832
3933 config CAVIUM_OCTEON_CVMSEG_SIZE
4034 int "Number of L1 cache lines reserved for CVMSEG memory"
41− depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
4235 range 0 54
4336 default 1
4437 help
@@ -50,7 +43,6 @@ config CAVIUM_OCTEON_CVMSEG_SIZE · 5 unmodified lines
5043
5144 config CAVIUM_OCTEON_LOCK_L2
5245 bool "Lock often used kernel code in the L2"
53− depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
5446 default "y"
5547 help
5648 Enable locking parts of the kernel into the L2 cache.
@@ -93,7 +85,6 @@ config CAVIUM_OCTEON_LOCK_L2_MEMCPY · 36 unmodified lines
9385 config ARCH_SPARSEMEM_ENABLE
9486 def_bool y
9587 select SPARSEMEM_STATIC
96− depends on CPU_CAVIUM_OCTEON
9788
9889 config CAVIUM_OCTEON_HELPER
9990 def_bool y
@@ -107,6 +98,8 @@ config NEED_SG_DMA_LENGTH · 7 unmodified lines
10798
10899 config SWIOTLB
109100 def_bool y
110− depends on CPU_CAVIUM_OCTEON
111101 select IOMMU_HELPER
112102 select NEED_SG_DMA_LENGTH
103+
104+
105+endif # CPU_CAVIUM_OCTEON
arch/mips/include/asm/cache.h+1−1
@@ -17,6 +17,6 @@ · 16 unmodified lines
1717 #define SMP_CACHE_SHIFT L1_CACHE_SHIFT
1818 #define SMP_CACHE_BYTES L1_CACHE_BYTES
1919
20−#define __read_mostly __attribute__((__section__(".data.read_mostly")))
20+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
2121
2222 #endif /* _ASM_CACHE_H */
arch/mips/include/asm/cevt-r4k.h+3−0
@@ -14,6 +14,9 @@ · 13 unmodified lines
1414 #ifndef __ASM_CEVT_R4K_H
1515 #define __ASM_CEVT_R4K_H
1616
17+#include <linux/clockchips.h>
18+#include <asm/time.h>
19+
1720 DECLARE_PER_CPU(struct clock_event_device, mips_clockevent_device);
1821
1922 void mips_event_handler(struct clock_event_device *dev);
arch/mips/include/asm/dma-mapping.h+2−0
@@ -5,7 +5,9 @@ · 4 unmodified lines
55 #include <asm/cache.h>
66 #include <asm-generic/dma-coherent.h>
77
8+#ifndef CONFIG_SGI_IP27 /* Kludge to fix 2.6.39 build for IP27 */
89 #include <dma-coherence.h>
10+#endif
911
1012 extern struct dma_map_ops *mips_dma_map_ops;
1113
arch/mips/include/asm/hugetlb.h+1−0
@@ -70,6 +70,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, · 69 unmodified lines
7070 static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
7171 unsigned long addr, pte_t *ptep)
7272 {
73+ flush_tlb_mm(vma->vm_mm);
7374 }
7475
7576 static inline int huge_pte_none(pte_t pte)
arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h+1−1
@@ -88,7 +88,7 @@ struct bcm_tag { · 87 unmodified lines
8888 char kernel_crc[CRC_LEN];
8989 /* 228-235: Unused at present */
9090 char reserved1[8];
91− /* 236-239: CRC32 of header excluding tagVersion */
91+ /* 236-239: CRC32 of header excluding last 20 bytes */
9292 char header_crc[CRC_LEN];
9393 /* 240-255: Unused at present */
9494 char reserved2[16];
arch/mips/jazz/jazzdma.c+2−3
@@ -211,7 +211,7 @@ EXPORT_SYMBOL(vdma_free); · 210 unmodified lines
211211 */
212212 int vdma_remap(unsigned long laddr, unsigned long paddr, unsigned long size)
213213 {
214− int first, pages, npages;
214+ int first, pages;
215215
216216 if (laddr > 0xffffff) {
217217 if (vdma_debug)
@@ -228,8 +228,7 @@ int vdma_remap(unsigned long laddr, unsigned long paddr, unsigned long size) · 10 unmodified lines
228228 return -EINVAL; /* invalid physical address */
229229 }
230230
231− npages = pages =
232− (((paddr & (VDMA_PAGESIZE - 1)) + size) >> 12) + 1;
231+ pages = (((paddr & (VDMA_PAGESIZE - 1)) + size) >> 12) + 1;
233232 first = laddr >> 12;
234233 if (vdma_debug)
235234 printk("vdma_remap: first=%x, pages=%x\n", first, pages);
arch/mips/jz4740/dma.c+1−3
@@ -242,9 +242,7 @@ EXPORT_SYMBOL_GPL(jz4740_dma_get_residue); · 241 unmodified lines
242242
243243 static void jz4740_dma_chan_irq(struct jz4740_dma_chan *dma)
244244 {
245− uint32_t status;
246−
247− status = jz4740_dma_read(JZ_REG_DMA_STATUS_CTRL(dma->id));
245+ (void) jz4740_dma_read(JZ_REG_DMA_STATUS_CTRL(dma->id));
248246
249247 jz4740_dma_write_mask(JZ_REG_DMA_STATUS_CTRL(dma->id), 0,
250248 JZ_DMA_STATUS_CTRL_ENABLE | JZ_DMA_STATUS_CTRL_TRANSFER_DONE);
arch/mips/jz4740/time.c+1−1
@@ -89,7 +89,7 @@ static int jz4740_clockevent_set_next(unsigned long evt, · 88 unmodified lines
8989
9090 static struct clock_event_device jz4740_clockevent = {
9191 .name = "jz4740-timer",
92− .features = CLOCK_EVT_FEAT_PERIODIC,
92+ .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
9393 .set_next_event = jz4740_clockevent_set_next,
9494 .set_mode = jz4740_clockevent_set_mode,
9595 .rating = 200,
arch/mips/jz4740/timer.c+2−0
@@ -27,11 +27,13 @@ void jz4740_timer_enable_watchdog(void) · 26 unmodified lines
2727 {
2828 writel(BIT(16), jz4740_timer_base + JZ_REG_TIMER_STOP_CLEAR);
2929 }
30+EXPORT_SYMBOL_GPL(jz4740_timer_enable_watchdog);
3031
3132 void jz4740_timer_disable_watchdog(void)
3233 {
3334 writel(BIT(16), jz4740_timer_base + JZ_REG_TIMER_STOP_SET);
3435 }
36+EXPORT_SYMBOL_GPL(jz4740_timer_disable_watchdog);
3537
3638 void __init jz4740_timer_init(void)
3739 {
arch/mips/kernel/ftrace.c+3−2
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 #define JAL 0x0c000000 /* jump & link: ip --> ra, jump to target */
2525 #define ADDR_MASK 0x03ffffff /* op_code|addr : 31...26|25 ....0 */
26+#define JUMP_RANGE_MASK ((1UL << 28) - 1)
2627
2728 #define INSN_NOP 0x00000000 /* nop */
2829 #define INSN_JAL(addr) \
@@ -44,12 +45,12 @@ static inline void ftrace_dyn_arch_init_insns(void) · 15 unmodified lines
4445
4546 /* jal (ftrace_caller + 8), jump over the first two instruction */
4647 buf = (u32 *)&insn_jal_ftrace_caller;
47− uasm_i_jal(&buf, (FTRACE_ADDR + 8));
48+ uasm_i_jal(&buf, (FTRACE_ADDR + 8) & JUMP_RANGE_MASK);
4849
4950 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
5051 /* j ftrace_graph_caller */
5152 buf = (u32 *)&insn_j_ftrace_graph_caller;
52− uasm_i_j(&buf, (unsigned long)ftrace_graph_caller);
53+ uasm_i_j(&buf, (unsigned long)ftrace_graph_caller & JUMP_RANGE_MASK);
5354 #endif
5455 }
5556
arch/mips/kernel/ptrace.c+2−2
@@ -540,8 +540,8 @@ asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) · 539 unmodified lines
540540 secure_computing(regs->regs[2]);
541541
542542 if (unlikely(current->audit_context) && entryexit)
543− audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]),
544− regs->regs[2]);
543+ audit_syscall_exit(AUDITSC_RESULT(regs->regs[7]),
544+ -regs->regs[2]);
545545
546546 if (!(current->ptrace & PT_PTRACED))
547547 goto out;
arch/mips/kernel/scall32-o32.S+1−1
@@ -565,7 +565,7 @@ einval: li v0, -ENOSYS · 564 unmodified lines
565565 sys sys_ioprio_get 2 /* 4315 */
566566 sys sys_utimensat 4
567567 sys sys_signalfd 3
568− sys sys_ni_syscall 0
568+ sys sys_ni_syscall 0 /* was timerfd */
569569 sys sys_eventfd 1
570570 sys sys_fallocate 6 /* 4320 */
571571 sys sys_timerfd_create 2
arch/mips/kernel/scall64-64.S+1−1
@@ -404,7 +404,7 @@ sys_call_table: · 403 unmodified lines
404404 PTR sys_ioprio_get
405405 PTR sys_utimensat /* 5275 */
406406 PTR sys_signalfd
407− PTR sys_ni_syscall
407+ PTR sys_ni_syscall /* was timerfd */
408408 PTR sys_eventfd
409409 PTR sys_fallocate
410410 PTR sys_timerfd_create /* 5280 */
arch/mips/kernel/scall64-n32.S+1−1
@@ -403,7 +403,7 @@ EXPORT(sysn32_call_table) · 402 unmodified lines
403403 PTR sys_ioprio_get
404404 PTR compat_sys_utimensat
405405 PTR compat_sys_signalfd /* 6280 */
406− PTR sys_ni_syscall
406+ PTR sys_ni_syscall /* was timerfd */
407407 PTR sys_eventfd
408408 PTR sys_fallocate
409409 PTR sys_timerfd_create
arch/mips/kernel/scall64-o32.S+1−1
@@ -522,7 +522,7 @@ sys_call_table: · 521 unmodified lines
522522 PTR sys_ioprio_get /* 4315 */
523523 PTR compat_sys_utimensat
524524 PTR compat_sys_signalfd
525− PTR sys_ni_syscall
525+ PTR sys_ni_syscall /* was timerfd */
526526 PTR sys_eventfd
527527 PTR sys32_fallocate /* 4320 */
528528 PTR sys_timerfd_create
arch/mips/kernel/traps.c+2−4
@@ -374,7 +374,8 @@ void __noreturn die(const char *str, struct pt_regs *regs) · 373 unmodified lines
374374 unsigned long dvpret = dvpe();
375375 #endif /* CONFIG_MIPS_MT_SMTC */
376376
377− notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV);
377+ if (notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV) == NOTIFY_STOP)
378+ sig = 0;
378379
379380 console_verbose();
380381 spin_lock_irq(&die_lock);
@@ -383,9 +384,6 @@ void __noreturn die(const char *str, struct pt_regs *regs) · 2 unmodified lines
383384 mips_mt_regdump(dvpret);
384385 #endif /* CONFIG_MIPS_MT_SMTC */
385386
386− if (notify_die(DIE_OOPS, str, regs, 0, regs_to_trapnr(regs), SIGSEGV) == NOTIFY_STOP)
387− sig = 0;
388−
389387 printk("%s[#%d]:\n", str, ++die_counter);
390388 show_registers(regs);
391389 add_taint(TAINT_DIE);
arch/mips/kernel/vmlinux.lds.S+1−0
@@ -74,6 +74,7 @@ SECTIONS · 73 unmodified lines
7474 INIT_TASK_DATA(PAGE_SIZE)
7575 NOSAVE_DATA
7676 CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
77+ READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
7778 DATA_DATA
7879 CONSTRUCTORS
7980 }
arch/mips/loongson/common/env.c+3−2
@@ -29,9 +29,10 @@ unsigned long memsize, highmemsize; · 28 unmodified lines
2929
3030 #define parse_even_earlier(res, option, p) \
3131 do { \
32− int ret; \
32+ unsigned int tmp __maybe_unused; \
33+ \
3334 if (strncmp(option, (char *)p, strlen(option)) == 0) \
34− ret = strict_strtol((char *)p + strlen(option"="), 10, &res); \
35+ tmp = strict_strtol((char *)p + strlen(option"="), 10, &res); \
3536 } while (0)
3637
3738 void __init prom_init_env(void)
arch/mips/mm/c-r4k.c+0−2
@@ -1075,7 +1075,6 @@ static int __cpuinit probe_scache(void) · 1074 unmodified lines
10751075 unsigned long flags, addr, begin, end, pow2;
10761076 unsigned int config = read_c0_config();
10771077 struct cpuinfo_mips *c = &current_cpu_data;
1078− int tmp;
10791078
10801079 if (config & CONF_SC)
10811080 return 0;
@@ -1108,7 +1107,6 @@ static int __cpuinit probe_scache(void) · 26 unmodified lines
11081107
11091108 /* Now search for the wrap around point. */
11101109 pow2 = (128 * 1024);
1111− tmp = 0;
11121110 for (addr = begin + (128 * 1024); addr < end; addr = begin + pow2) {
11131111 cache_op(Index_Load_Tag_SD, addr);
11141112 __asm__ __volatile__("nop; nop; nop; nop;"); /* hazard... */
arch/mips/mm/tlbex.c+2−2
@@ -1151,8 +1151,8 @@ static void __cpuinit build_r4000_tlb_refill_handler(void) · 1150 unmodified lines
11511151 struct uasm_reloc *r = relocs;
11521152 u32 *f;
11531153 unsigned int final_len;
1154− struct mips_huge_tlb_info htlb_info;
1155− enum vmalloc64_mode vmalloc_mode;
1154+ struct mips_huge_tlb_info htlb_info __maybe_unused;
1155+ enum vmalloc64_mode vmalloc_mode __maybe_unused;
11561156
11571157 memset(tlb_handler, 0, sizeof(tlb_handler));
11581158 memset(labels, 0, sizeof(labels));
arch/mips/mti-malta/malta-init.c+3−11
@@ -193,8 +193,6 @@ extern struct plat_smp_ops msmtc_smp_ops; · 192 unmodified lines
193193
194194 void __init prom_init(void)
195195 {
196− int result;
197−
198196 prom_argc = fw_arg0;
199197 _prom_argv = (int *) fw_arg1;
200198 _prom_envp = (int *) fw_arg2;
@@ -360,20 +358,14 @@ void __init prom_init(void) · 159 unmodified lines
360358 #ifdef CONFIG_SERIAL_8250_CONSOLE
361359 console_config();
362360 #endif
363− /* Early detection of CMP support */
364− result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ);
365−
366361 #ifdef CONFIG_MIPS_CMP
367− if (result)
362+ /* Early detection of CMP support */
363+ if (gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ))
368364 register_smp_ops(&cmp_smp_ops);
365+ else
369366 #endif
370367 #ifdef CONFIG_MIPS_MT_SMP
371−#ifdef CONFIG_MIPS_CMP
372− if (!result)
373368 register_smp_ops(&vsmp_smp_ops);
374−#else
375− register_smp_ops(&vsmp_smp_ops);
376−#endif
377369 #endif
378370 #ifdef CONFIG_MIPS_MT_SMTC
379371 register_smp_ops(&msmtc_smp_ops);
arch/mips/mti-malta/malta-int.c+1−2
@@ -56,7 +56,6 @@ static DEFINE_RAW_SPINLOCK(mips_irq_lock); · 55 unmodified lines
5656 static inline int mips_pcibios_iack(void)
5757 {
5858 int irq;
59− u32 dummy;
6059
6160 /*
6261 * Determine highest priority pending interrupt by performing
@@ -83,7 +82,7 @@ static inline int mips_pcibios_iack(void) · 20 unmodified lines
8382 BONITO_PCIMAP_CFG = 0x20000;
8483
8584 /* Flush Bonito register block */
86− dummy = BONITO_PCIMAP_CFG;
85+ (void) BONITO_PCIMAP_CFG;
8786 iob(); /* sync */
8887
8988 irq = __raw_readl((u32 *)_pcictrl_bonito_pcicfg);
arch/mips/pmc-sierra/msp71xx/msp_irq_per.c+1−1
@@ -97,7 +97,7 @@ static int msp_per_irq_set_affinity(struct irq_data *d, · 96 unmodified lines
9797
9898 static struct irq_chip msp_per_irq_controller = {
9999 .name = "MSP_PER",
100− .irq_enable = unmask_per_irq.
100+ .irq_enable = unmask_per_irq,
101101 .irq_disable = mask_per_irq,
102102 .irq_ack = msp_per_irq_ack,
103103 #ifdef CONFIG_SMP
arch/mips/power/hibernate.S+1−1
@@ -35,7 +35,7 @@ LEAF(swsusp_arch_resume) · 34 unmodified lines
3535 0:
3636 PTR_L t1, PBE_ADDRESS(t0) /* source */
3737 PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */
38− PTR_ADDIU t3, t1, PAGE_SIZE
38+ PTR_ADDU t3, t1, PAGE_SIZE
3939 1:
4040 REG_L t8, (t1)
4141 REG_S t8, (t2)
arch/mips/rb532/gpio.c+1−1
@@ -185,7 +185,7 @@ int __init rb532_gpio_init(void) · 184 unmodified lines
185185 struct resource *r;
186186
187187 r = rb532_gpio_reg0_res;
188− rb532_gpio_chip->regbase = ioremap_nocache(r->start, r->end - r->start);
188+ rb532_gpio_chip->regbase = ioremap_nocache(r->start, resource_size(r));
189189
190190 if (!rb532_gpio_chip->regbase) {
191191 printk(KERN_ERR "rb532: cannot remap GPIO register 0\n");
arch/mips/sgi-ip22/ip22-platform.c+2−2
@@ -132,7 +132,7 @@ static struct platform_device eth1_device = { · 131 unmodified lines
132132 */
133133 static int __init sgiseeq_devinit(void)
134134 {
135− unsigned int tmp;
135+ unsigned int pbdma __maybe_unused;
136136 int res, i;
137137
138138 eth0_pd.hpc = hpc3c0;
@@ -151,7 +151,7 @@ static int __init sgiseeq_devinit(void) · 12 unmodified lines
151151
152152 /* Second HPC is missing? */
153153 if (ip22_is_fullhouse() ||
154− get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1]))
154+ get_dbe(pbdma, (unsigned int *)&hpc3c1->pbdma[1]))
155155 return 0;
156156
157157 sgimc->giopar |= SGIMC_GIOPAR_MASTEREXP1 | SGIMC_GIOPAR_EXP164 |
arch/mips/sgi-ip22/ip22-time.c+2−2
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 static unsigned long dosample(void)
3333 {
3434 u32 ct0, ct1;
35− u8 msb, lsb;
35+ u8 msb;
3636
3737 /* Start the counter. */
3838 sgint->tcword = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL |
@@ -46,7 +46,7 @@ static unsigned long dosample(void) · 7 unmodified lines
4646 /* Latch and spin until top byte of counter2 is zero */
4747 do {
4848 writeb(SGINT_TCWORD_CNT2 | SGINT_TCWORD_CLAT, &sgint->tcword);
49− lsb = readb(&sgint->tcnt2);
49+ (void) readb(&sgint->tcnt2);
5050 msb = readb(&sgint->tcnt2);
5151 ct1 = read_c0_count();
5252 } while (msb);
arch/mips/sgi-ip27/ip27-hubio.c+1−2
@@ -29,7 +29,6 @@ unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget, · 28 unmodified lines
2929 unsigned long xtalk_addr, size_t size)
3030 {
3131 nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
32− volatile hubreg_t junk;
3332 unsigned i;
3433
3534 /* use small-window mapping if possible */
@@ -64,7 +63,7 @@ unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget, · 28 unmodified lines
6463 * after we write it.
6564 */
6665 IIO_ITTE_PUT(nasid, i, HUB_PIO_MAP_TO_MEM, widget, xtalk_addr);
67− junk = HUB_L(IIO_ITTE_GET(nasid, i));
66+ (void) HUB_L(IIO_ITTE_GET(nasid, i));
6867
6968 return NODE_BWIN_BASE(nasid, widget) + (xtalk_addr % BWIN_SIZE);
7069 }
arch/mips/sgi-ip27/ip27-klnuma.c+0−3
@@ -54,11 +54,8 @@ void __init setup_replication_mask(void) · 53 unmodified lines
5454
5555 static __init void set_ktext_source(nasid_t client_nasid, nasid_t server_nasid)
5656 {
57− cnodeid_t client_cnode;
5857 kern_vars_t *kvp;
5958
60− client_cnode = NASID_TO_COMPACT_NODEID(client_nasid);
61−
6259 kvp = &hub_data(client_nasid)->kern_vars;
6360
6461 KERN_VARS_ADDR(client_nasid) = (unsigned long)kvp;
arch/mips/sni/time.c+2−2
@@ -95,7 +95,7 @@ static void __init sni_a20r_timer_setup(void) · 94 unmodified lines
9595 static __init unsigned long dosample(void)
9696 {
9797 u32 ct0, ct1;
98− volatile u8 msb, lsb;
98+ volatile u8 msb;
9999
100100 /* Start the counter. */
101101 outb_p(0x34, 0x43);
@@ -108,7 +108,7 @@ static __init unsigned long dosample(void) · 6 unmodified lines
108108 /* Latch and spin until top byte of counter0 is zero */
109109 do {
110110 outb(0x00, 0x43);
111− lsb = inb(0x40);
111+ (void) inb(0x40);
112112 msb = inb(0x40);
113113 ct1 = read_c0_count();
114114 } while (msb);
arch/parisc/mm/init.c+3−1
@@ -266,8 +266,10 @@ static void __init setup_bootmem(void) · 265 unmodified lines
266266 }
267267 memset(pfnnid_map, 0xff, sizeof(pfnnid_map));
268268
269− for (i = 0; i < npmem_ranges; i++)
269+ for (i = 0; i < npmem_ranges; i++) {
270+ node_set_state(i, N_NORMAL_MEMORY);
270271 node_set_online(i);
272+ }
271273 #endif
272274
273275 /*
arch/powerpc/include/asm/8xx_immap.h+2−2
@@ -393,8 +393,8 @@ typedef struct fec { · 392 unmodified lines
393393 uint fec_addr_low; /* lower 32 bits of station address */
394394 ushort fec_addr_high; /* upper 16 bits of station address */
395395 ushort res1; /* reserved */
396− uint fec_hash_table_high; /* upper 32-bits of hash table */
397− uint fec_hash_table_low; /* lower 32-bits of hash table */
396+ uint fec_grp_hash_table_high; /* upper 32-bits of hash table */
397+ uint fec_grp_hash_table_low; /* lower 32-bits of hash table */
398398 uint fec_r_des_start; /* beginning of Rx descriptor ring */
399399 uint fec_x_des_start; /* beginning of Tx descriptor ring */
400400 uint fec_r_buff_size; /* Rx buffer size */
arch/powerpc/include/asm/uninorth.h+1−1
@@ -60,7 +60,7 @@ · 59 unmodified lines
6060 *
6161 * Obviously, the GART is not cache coherent and so any change to it
6262 * must be flushed to memory (or maybe just make the GART space non
63− * cachable). AGP memory itself does't seem to be cache coherent neither.
63+ * cachable). AGP memory itself doesn't seem to be cache coherent neither.
6464 *
6565 * In order to invalidate the GART (which is probably necessary to inval
6666 * the bridge internal TLBs), the following sequence has to be written,
arch/powerpc/kernel/ptrace.c+11−1
@@ -933,12 +933,16 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr, · 932 unmodified lines
933933 if (data && !(data & DABR_TRANSLATION))
934934 return -EIO;
935935 #ifdef CONFIG_HAVE_HW_BREAKPOINT
936+ if (ptrace_get_breakpoints(task) < 0)
937+ return -ESRCH;
938+
936939 bp = thread->ptrace_bps[0];
937940 if ((!data) || !(data & (DABR_DATA_WRITE | DABR_DATA_READ))) {
938941 if (bp) {
939942 unregister_hw_breakpoint(bp);
940943 thread->ptrace_bps[0] = NULL;
941944 }
945+ ptrace_put_breakpoints(task);
942946 return 0;
943947 }
944948 if (bp) {
@@ -948,9 +952,12 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr, · 3 unmodified lines
948952 (DABR_DATA_WRITE | DABR_DATA_READ),
949953 &attr.bp_type);
950954 ret = modify_user_hw_breakpoint(bp, &attr);
951− if (ret)
955+ if (ret) {
956+ ptrace_put_breakpoints(task);
952957 return ret;
958+ }
953959 thread->ptrace_bps[0] = bp;
960+ ptrace_put_breakpoints(task);
954961 thread->dabr = data;
955962 return 0;
956963 }
@@ -965,9 +972,12 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr, · 8 unmodified lines
965972 ptrace_triggered, task);
966973 if (IS_ERR(bp)) {
967974 thread->ptrace_bps[0] = NULL;
975+ ptrace_put_breakpoints(task);
968976 return PTR_ERR(bp);
969977 }
970978
979+ ptrace_put_breakpoints(task);
980+
971981 #endif /* CONFIG_HAVE_HW_BREAKPOINT */
972982
973983 /* Move contents to the DABR register */
arch/powerpc/platforms/83xx/suspend.c+5−2
@@ -318,17 +318,20 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = { · 317 unmodified lines
318318 .end = mpc83xx_suspend_end,
319319 };
320320
321+static struct of_device_id pmc_match[];
321322 static int pmc_probe(struct platform_device *ofdev)
322323 {
324+ const struct of_device_id *match;
323325 struct device_node *np = ofdev->dev.of_node;
324326 struct resource res;
325327 struct pmc_type *type;
326328 int ret = 0;
327329
328− if (!ofdev->dev.of_match)
330+ match = of_match_device(pmc_match, &ofdev->dev);
331+ if (!match)
329332 return -EINVAL;
330333
331− type = ofdev->dev.of_match->data;
334+ type = match->data;
332335
333336 if (!of_device_is_available(np))
334337 return -ENODEV;
arch/powerpc/sysdev/fsl_msi.c+5−2
@@ -304,8 +304,10 @@ static int __devinit fsl_msi_setup_hwirq(struct fsl_msi *msi, · 303 unmodified lines
304304 return 0;
305305 }
306306
307+static const struct of_device_id fsl_of_msi_ids[];
307308 static int __devinit fsl_of_msi_probe(struct platform_device *dev)
308309 {
310+ const struct of_device_id *match;
309311 struct fsl_msi *msi;
310312 struct resource res;
311313 int err, i, j, irq_index, count;
@@ -316,9 +318,10 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev) · 4 unmodified lines
316318 u32 offset;
317319 static const u32 all_avail[] = { 0, NR_MSI_IRQS };
318320
319− if (!dev->dev.of_match)
321+ match = of_match_device(fsl_of_msi_ids, &dev->dev);
322+ if (!match)
320323 return -EINVAL;
321− features = dev->dev.of_match->data;
324+ features = match->data;
322325
323326 printk(KERN_DEBUG "Setting up Freescale MSI support\n");
324327
arch/s390/crypto/prng.c+1−1
@@ -76,7 +76,7 @@ static void prng_seed(int nbytes) · 75 unmodified lines
7676
7777 /* Add the entropy */
7878 while (nbytes >= 8) {
79− *((__u64 *)parm_block) ^= *((__u64 *)buf+i*8);
79+ *((__u64 *)parm_block) ^= *((__u64 *)(buf+i));
8080 prng_add_entropy();
8181 i += 8;
8282 nbytes -= 8;
arch/s390/include/asm/diag.h+15−2
@@ -9,9 +9,22 @@ · 8 unmodified lines
99 #define _ASM_S390_DIAG_H
1010
1111 /*
12− * Diagnose 10: Release pages
12+ * Diagnose 10: Release page range
1313 */
14−extern void diag10(unsigned long addr);
14+static inline void diag10_range(unsigned long start_pfn, unsigned long num_pfn)
15+{
16+ unsigned long start_addr, end_addr;
17+
18+ start_addr = start_pfn << PAGE_SHIFT;
19+ end_addr = (start_pfn + num_pfn - 1) << PAGE_SHIFT;
20+
21+ asm volatile(
22+ "0: diag %0,%1,0x10\n"
23+ "1:\n"
24+ EX_TABLE(0b, 1b)
25+ EX_TABLE(1b, 1b)
26+ : : "a" (start_addr), "a" (end_addr));
27+}
1528
1629 /*
1730 * Diagnose 14: Input spool file manipulation
arch/s390/include/asm/mmu_context.h+1−1
@@ -23,7 +23,7 @@ static inline int init_new_context(struct task_struct *tsk, · 22 unmodified lines
2323 #ifdef CONFIG_64BIT
2424 mm->context.asce_bits |= _ASCE_TYPE_REGION3;
2525 #endif
26− if (current->mm->context.alloc_pgste) {
26+ if (current->mm && current->mm->context.alloc_pgste) {
2727 /*
2828 * alloc_pgste indicates, that any NEW context will be created
2929 * with extended page tables. The old context is unchanged. The
arch/s390/kernel/diag.c+0−21
@@ -8,27 +8,6 @@ · 7 unmodified lines
88 #include <linux/module.h>
99 #include <asm/diag.h>
1010
11−/*
12− * Diagnose 10: Release pages
13− */
14−void diag10(unsigned long addr)
15−{
16− if (addr >= 0x7ff00000)
17− return;
18− asm volatile(
19−#ifdef CONFIG_64BIT
20− " sam31\n"
21− " diag %0,%0,0x10\n"
22− "0: sam64\n"
23−#else
24− " diag %0,%0,0x10\n"
25− "0:\n"
26−#endif
27− EX_TABLE(0b, 0b)
28− : : "a" (addr));
29−}
30−EXPORT_SYMBOL(diag10);
31−
3211 /*
3312 * Diagnose 14: Input spool file manipulation
3413 */
arch/s390/kernel/dis.c+1−0
@@ -672,6 +672,7 @@ static struct insn opcode_b2[] = { · 671 unmodified lines
672672 { "rp", 0x77, INSTR_S_RD },
673673 { "stcke", 0x78, INSTR_S_RD },
674674 { "sacf", 0x79, INSTR_S_RD },
675+ { "spp", 0x80, INSTR_S_RD },
675676 { "stsi", 0x7d, INSTR_S_RD },
676677 { "srnm", 0x99, INSTR_S_RD },
677678 { "stfpc", 0x9c, INSTR_S_RD },
arch/s390/kernel/entry.S+1−1
@@ -836,7 +836,7 @@ restart_base: · 835 unmodified lines
836836 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on
837837 basr %r14,0
838838 l %r14,restart_addr-.(%r14)
839− br %r14 # branch to start_secondary
839+ basr %r14,%r14 # branch to start_secondary
840840 restart_addr:
841841 .long start_secondary
842842 .align 8
arch/s390/kernel/entry64.S+1−1
@@ -841,7 +841,7 @@ restart_base: · 840 unmodified lines
841841 mvc __LC_SYSTEM_TIMER(8),__TI_system_timer(%r1)
842842 xc __LC_STEAL_TIMER(8),__LC_STEAL_TIMER
843843 stosm __SF_EMPTY(%r15),0x04 # now we can turn dat on
844− jg start_secondary
844+ brasl %r14,start_secondary
845845 .align 8
846846 restart_vtime:
847847 .long 0x7fffffff,0xffffffff
arch/s390/kvm/sie64a.S+2−2
@@ -48,10 +48,10 @@ sie_irq_handler: · 47 unmodified lines
4848 tm __TI_flags+7(%r2),_TIF_EXIT_SIE
4949 jz 0f
5050 larl %r2,sie_exit # work pending, leave sie
51− stg %r2,__LC_RETURN_PSW+8
51+ stg %r2,SPI_PSW+8(0,%r15)
5252 br %r14
5353 0: larl %r2,sie_reenter # re-enter with guest id
54− stg %r2,__LC_RETURN_PSW+8
54+ stg %r2,SPI_PSW+8(0,%r15)
5555 1: br %r14
5656
5757 /*
arch/s390/mm/cmm.c+1−1
@@ -91,7 +91,7 @@ static long cmm_alloc_pages(long nr, long *counter, · 90 unmodified lines
9191 } else
9292 free_page((unsigned long) npa);
9393 }
94− diag10(addr);
94+ diag10_range(addr >> PAGE_SHIFT, 1);
9595 pa->pages[pa->index++] = addr;
9696 (*counter)++;
9797 spin_unlock(&cmm_lock);
arch/s390/mm/fault.c+3−3
@@ -543,7 +543,6 @@ static void pfault_interrupt(unsigned int ext_int_code, · 542 unmodified lines
543543 struct task_struct *tsk;
544544 __u16 subcode;
545545
546− kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++;
547546 /*
548547 * Get the external interruption subcode & pfault
549548 * initial/completion signal bit. VM stores this
@@ -553,14 +552,15 @@ static void pfault_interrupt(unsigned int ext_int_code, · 3 unmodified lines
553552 subcode = ext_int_code >> 16;
554553 if ((subcode & 0xff00) != __SUBCODE_MASK)
555554 return;
555+ kstat_cpu(smp_processor_id()).irqs[EXTINT_PFL]++;
556556
557557 /*
558558 * Get the token (= address of the task structure of the affected task).
559559 */
560560 #ifdef CONFIG_64BIT
561− tsk = *(struct task_struct **) param64;
561+ tsk = (struct task_struct *) param64;
562562 #else
563− tsk = *(struct task_struct **) param32;
563+ tsk = (struct task_struct *) param32;
564564 #endif
565565
566566 if (subcode & 0x0080) {
arch/s390/mm/pageattr.c+3−2
@@ -24,12 +24,13 @@ static void change_page_attr(unsigned long addr, int numpages, · 23 unmodified lines
2424 WARN_ON_ONCE(1);
2525 continue;
2626 }
27− ptep = pte_offset_kernel(pmdp, addr + i * PAGE_SIZE);
27+ ptep = pte_offset_kernel(pmdp, addr);
2828
2929 pte = *ptep;
3030 pte = set(pte);
31− ptep_invalidate(&init_mm, addr + i * PAGE_SIZE, ptep);
31+ ptep_invalidate(&init_mm, addr, ptep);
3232 *ptep = pte;
33+ addr += PAGE_SIZE;
3334 }
3435 }
3536
arch/s390/oprofile/hwsampler.c+4−10
@@ -1021,20 +1021,14 @@ deallocate_exit: · 1020 unmodified lines
10211021 return rc;
10221022 }
10231023
1024−long hwsampler_query_min_interval(void)
1024+unsigned long hwsampler_query_min_interval(void)
10251025 {
1026− if (min_sampler_rate)
1027− return min_sampler_rate;
1028− else
1029− return -EINVAL;
1026+ return min_sampler_rate;
10301027 }
10311028
1032−long hwsampler_query_max_interval(void)
1029+unsigned long hwsampler_query_max_interval(void)
10331030 {
1034− if (max_sampler_rate)
1035− return max_sampler_rate;
1036− else
1037− return -EINVAL;
1031+ return max_sampler_rate;
10381032 }
10391033
10401034 unsigned long hwsampler_get_sample_overflow_count(unsigned int cpu)
arch/s390/oprofile/hwsampler.h+2−2
@@ -102,8 +102,8 @@ int hwsampler_setup(void); · 101 unmodified lines
102102 int hwsampler_shutdown(void);
103103 int hwsampler_allocate(unsigned long sdbt, unsigned long sdb);
104104 int hwsampler_deallocate(void);
105−long hwsampler_query_min_interval(void);
106−long hwsampler_query_max_interval(void);
105+unsigned long hwsampler_query_min_interval(void);
106+unsigned long hwsampler_query_max_interval(void);
107107 int hwsampler_start_all(unsigned long interval);
108108 int hwsampler_stop_all(void);
109109 int hwsampler_deactivate(unsigned int cpu);
arch/s390/oprofile/init.c+2−6
@@ -145,15 +145,11 @@ static int oprofile_hwsampler_init(struct oprofile_operations *ops) · 144 unmodified lines
145145 * create hwsampler files only if hwsampler_setup() succeeds.
146146 */
147147 oprofile_min_interval = hwsampler_query_min_interval();
148− if (oprofile_min_interval < 0) {
149− oprofile_min_interval = 0;
148+ if (oprofile_min_interval == 0)
150149 return -ENODEV;
151− }
152150 oprofile_max_interval = hwsampler_query_max_interval();
153− if (oprofile_max_interval < 0) {
154− oprofile_max_interval = 0;
151+ if (oprofile_max_interval == 0)
155152 return -ENODEV;
156− }
157153
158154 if (oprofile_timer_init(ops))
159155 return -ENODEV;
arch/sh/kernel/ptrace_32.c+4−0
@@ -117,7 +117,11 @@ void user_enable_single_step(struct task_struct *child) · 116 unmodified lines
117117
118118 set_tsk_thread_flag(child, TIF_SINGLESTEP);
119119
120+ if (ptrace_get_breakpoints(child) < 0)
121+ return;
122+
120123 set_single_step(child, pc);
124+ ptrace_put_breakpoints(child);
121125 }
122126
123127 void user_disable_single_step(struct task_struct *child)
arch/sparc/kernel/apc.c+1−1
@@ -165,7 +165,7 @@ static int __devinit apc_probe(struct platform_device *op) · 164 unmodified lines
165165 return 0;
166166 }
167167
168−static struct of_device_id __initdata apc_match[] = {
168+static struct of_device_id apc_match[] = {
169169 {
170170 .name = APC_OBPNAME,
171171 },
arch/sparc/kernel/pci_sabre.c+4−1
@@ -452,8 +452,10 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm, · 451 unmodified lines
452452 sabre_scan_bus(pbm, &op->dev);
453453 }
454454
455+static const struct of_device_id sabre_match[];
455456 static int __devinit sabre_probe(struct platform_device *op)
456457 {
458+ const struct of_device_id *match;
457459 const struct linux_prom64_registers *pr_regs;
458460 struct device_node *dp = op->dev.of_node;
459461 struct pci_pbm_info *pbm;
@@ -463,7 +465,8 @@ static int __devinit sabre_probe(struct platform_device *op) · 3 unmodified lines
463465 const u32 *vdma;
464466 u64 clear_irq;
465467
466− hummingbird_p = op->dev.of_match && (op->dev.of_match->data != NULL);
468+ match = of_match_device(sabre_match, &op->dev);
469+ hummingbird_p = match && (match->data != NULL);
467470 if (!hummingbird_p) {
468471 struct device_node *cpu_dp;
469472
arch/sparc/kernel/pci_schizo.c+6−2
@@ -1458,11 +1458,15 @@ out_err: · 1457 unmodified lines
14581458 return err;
14591459 }
14601460
1461+static const struct of_device_id schizo_match[];
14611462 static int __devinit schizo_probe(struct platform_device *op)
14621463 {
1463− if (!op->dev.of_match)
1464+ const struct of_device_id *match;
1465+
1466+ match = of_match_device(schizo_match, &op->dev);
1467+ if (!match)
14641468 return -EINVAL;
1465− return __schizo_init(op, (unsigned long) op->dev.of_match->data);
1469+ return __schizo_init(op, (unsigned long)match->data);
14661470 }
14671471
14681472 /* The ordering of this table is very important. Some Tomatillo
arch/sparc/kernel/pmc.c+1−1
@@ -69,7 +69,7 @@ static int __devinit pmc_probe(struct platform_device *op) · 68 unmodified lines
6969 return 0;
7070 }
7171
72−static struct of_device_id __initdata pmc_match[] = {
72+static struct of_device_id pmc_match[] = {
7373 {
7474 .name = PMC_OBPNAME,
7575 },
arch/sparc/kernel/smp_32.c+7−3
@@ -53,6 +53,7 @@ cpumask_t smp_commenced_mask = CPU_MASK_NONE; · 52 unmodified lines
5353 void __cpuinit smp_store_cpu_info(int id)
5454 {
5555 int cpu_node;
56+ int mid;
5657
5758 cpu_data(id).udelay_val = loops_per_jiffy;
5859
@@ -60,10 +61,13 @@ void __cpuinit smp_store_cpu_info(int id) · 1 unmodified line
6061 cpu_data(id).clock_tick = prom_getintdefault(cpu_node,
6162 "clock-frequency", 0);
6263 cpu_data(id).prom_node = cpu_node;
63− cpu_data(id).mid = cpu_get_hwmid(cpu_node);
64+ mid = cpu_get_hwmid(cpu_node);
6465
65− if (cpu_data(id).mid < 0)
66− panic("No MID found for CPU%d at node 0x%08d", id, cpu_node);
66+ if (mid < 0) {
67+ printk(KERN_NOTICE "No MID found for CPU%d at node 0x%08d", id, cpu_node);
68+ mid = 0;
69+ }
70+ cpu_data(id).mid = mid;
6771 }
6872
6973 void __init smp_cpus_done(unsigned int max_cpus)
arch/sparc/kernel/time_32.c+1−1
@@ -168,7 +168,7 @@ static int __devinit clock_probe(struct platform_device *op) · 167 unmodified lines
168168 return 0;
169169 }
170170
171−static struct of_device_id __initdata clock_match[] = {
171+static struct of_device_id clock_match[] = {
172172 {
173173 .name = "eeprom",
174174 },
arch/sparc/lib/checksum_32.S+9−3
@@ -289,10 +289,16 @@ cc_end_cruft: · 288 unmodified lines
289289
290290 /* Also, handle the alignment code out of band. */
291291 cc_dword_align:
292− cmp %g1, 6
293− bl,a ccte
292+ cmp %g1, 16
293+ bge 1f
294+ srl %g1, 1, %o3
295+2: cmp %o3, 0
296+ be,a ccte
294297 andcc %g1, 0xf, %o3
295− andcc %o0, 0x1, %g0
298+ andcc %o3, %o0, %g0 ! Check %o0 only (%o1 has the same last 2 bits)
299+ be,a 2b
300+ srl %o3, 1, %o3
301+1: andcc %o0, 0x1, %g0
296302 bne ccslow
297303 andcc %o0, 0x2, %g0
298304 be 1f
arch/um/Kconfig.um+1−1
@@ -47,7 +47,7 @@ config HOSTFS · 46 unmodified lines
4747
4848 config HPPFS
4949 tristate "HoneyPot ProcFS (EXPERIMENTAL)"
50− depends on EXPERIMENTAL
50+ depends on EXPERIMENTAL && PROC_FS
5151 help
5252 hppfs (HoneyPot ProcFS) is a filesystem which allows UML /proc
5353 entries to be overridden, removed, or fabricated from the host.
arch/um/include/asm/thread_info.h+4−1
@@ -49,7 +49,10 @@ static inline struct thread_info *current_thread_info(void) · 48 unmodified lines
4949 {
5050 struct thread_info *ti;
5151 unsigned long mask = THREAD_SIZE - 1;
52− ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);
52+ void *p;
53+
54+ asm volatile ("" : "=r" (p) : "0" (&ti));
55+ ti = (struct thread_info *) (((unsigned long)p) & ~mask);
5356 return ti;
5457 }
5558
arch/um/os-Linux/util.c+22−1
@@ -5,6 +5,7 @@ · 4 unmodified lines
55
66 #include <stdio.h>
77 #include <stdlib.h>
8+#include <unistd.h>
89 #include <errno.h>
910 #include <signal.h>
1011 #include <string.h>
@@ -75,6 +76,26 @@ void setup_hostinfo(char *buf, int len) · 64 unmodified lines
7576 host.release, host.version, host.machine);
7677 }
7778
79+/*
80+ * We cannot use glibc's abort(). It makes use of tgkill() which
81+ * has no effect within UML's kernel threads.
82+ * After that glibc would execute an invalid instruction to kill
83+ * the calling process and UML crashes with SIGSEGV.
84+ */
85+static inline void __attribute__ ((noreturn)) uml_abort(void)
86+{
87+ sigset_t sig;
88+
89+ fflush(NULL);
90+
91+ if (!sigemptyset(&sig) && !sigaddset(&sig, SIGABRT))
92+ sigprocmask(SIG_UNBLOCK, &sig, 0);
93+
94+ for (;;)
95+ if (kill(getpid(), SIGABRT) < 0)
96+ exit(127);
97+}
98+
7899 void os_dump_core(void)
79100 {
80101 int pid;
@@ -116,5 +137,5 @@ void os_dump_core(void) · 35 unmodified lines
116137 while ((pid = waitpid(-1, NULL, WNOHANG | __WALL)) > 0)
117138 os_kill_ptraced_process(pid, 0);
118139
119− abort();
140+ uml_abort();
120141 }
arch/um/sys-i386/Makefile+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
66 ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
7− sys_call_table.o tls.o
7+ sys_call_table.o tls.o atomic64_cx8_32.o
88
99 obj-$(CONFIG_BINFMT_ELF) += elfcore.o
1010
arch/um/sys-i386/atomic64_cx8_32.S+225−0
@@ -0,0 +1,225 @@
1+/*
2+ * atomic64_t for 586+
3+ *
4+ * Copied from arch/x86/lib/atomic64_cx8_32.S
5+ *
6+ * Copyright © 2010 Luca Barbieri
7+ *
8+ * This program is free software; you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License as published by
10+ * the Free Software Foundation; either version 2 of the License, or
11+ * (at your option) any later version.
12+ *
13+ */
14+
15+#include <linux/linkage.h>
16+#include <asm/alternative-asm.h>
17+#include <asm/dwarf2.h>
18+
19+.macro SAVE reg
20+ pushl_cfi %\reg
21+ CFI_REL_OFFSET \reg, 0
22+.endm
23+
24+.macro RESTORE reg
25+ popl_cfi %\reg
26+ CFI_RESTORE \reg
27+.endm
28+
29+.macro read64 reg
30+ movl %ebx, %eax
31+ movl %ecx, %edx
32+/* we need LOCK_PREFIX since otherwise cmpxchg8b always does the write */
33+ LOCK_PREFIX
34+ cmpxchg8b (\reg)
35+.endm
36+
37+ENTRY(atomic64_read_cx8)
38+ CFI_STARTPROC
39+
40+ read64 %ecx
41+ ret
42+ CFI_ENDPROC
43+ENDPROC(atomic64_read_cx8)
44+
45+ENTRY(atomic64_set_cx8)
46+ CFI_STARTPROC
47+
48+1:
49+/* we don't need LOCK_PREFIX since aligned 64-bit writes
50+ * are atomic on 586 and newer */
51+ cmpxchg8b (%esi)
52+ jne 1b
53+
54+ ret
55+ CFI_ENDPROC
56+ENDPROC(atomic64_set_cx8)
57+
58+ENTRY(atomic64_xchg_cx8)
59+ CFI_STARTPROC
60+
61+ movl %ebx, %eax
62+ movl %ecx, %edx
63+1:
64+ LOCK_PREFIX
65+ cmpxchg8b (%esi)
66+ jne 1b
67+
68+ ret
69+ CFI_ENDPROC
70+ENDPROC(atomic64_xchg_cx8)
71+
72+.macro addsub_return func ins insc
73+ENTRY(atomic64_\func\()_return_cx8)
74+ CFI_STARTPROC
75+ SAVE ebp
76+ SAVE ebx
77+ SAVE esi
78+ SAVE edi
79+
80+ movl %eax, %esi
81+ movl %edx, %edi
82+ movl %ecx, %ebp
83+
84+ read64 %ebp
85+1:
86+ movl %eax, %ebx
87+ movl %edx, %ecx
88+ \ins\()l %esi, %ebx
89+ \insc\()l %edi, %ecx
90+ LOCK_PREFIX
91+ cmpxchg8b (%ebp)
92+ jne 1b
93+
94+10:
95+ movl %ebx, %eax
96+ movl %ecx, %edx
97+ RESTORE edi
98+ RESTORE esi
99+ RESTORE ebx
100+ RESTORE ebp
101+ ret
102+ CFI_ENDPROC
103+ENDPROC(atomic64_\func\()_return_cx8)
104+.endm
105+
106+addsub_return add add adc
107+addsub_return sub sub sbb
108+
109+.macro incdec_return func ins insc
110+ENTRY(atomic64_\func\()_return_cx8)
111+ CFI_STARTPROC
112+ SAVE ebx
113+
114+ read64 %esi
115+1:
116+ movl %eax, %ebx
117+ movl %edx, %ecx
118+ \ins\()l $1, %ebx
119+ \insc\()l $0, %ecx
120+ LOCK_PREFIX
121+ cmpxchg8b (%esi)
122+ jne 1b
123+
124+10:
125+ movl %ebx, %eax
126+ movl %ecx, %edx
127+ RESTORE ebx
128+ ret
129+ CFI_ENDPROC
130+ENDPROC(atomic64_\func\()_return_cx8)
131+.endm
132+
133+incdec_return inc add adc
134+incdec_return dec sub sbb
135+
136+ENTRY(atomic64_dec_if_positive_cx8)
137+ CFI_STARTPROC
138+ SAVE ebx
139+
140+ read64 %esi
141+1:
142+ movl %eax, %ebx
143+ movl %edx, %ecx
144+ subl $1, %ebx
145+ sbb $0, %ecx
146+ js 2f
147+ LOCK_PREFIX
148+ cmpxchg8b (%esi)
149+ jne 1b
150+
151+2:
152+ movl %ebx, %eax
153+ movl %ecx, %edx
154+ RESTORE ebx
155+ ret
156+ CFI_ENDPROC
157+ENDPROC(atomic64_dec_if_positive_cx8)
158+
159+ENTRY(atomic64_add_unless_cx8)
160+ CFI_STARTPROC
161+ SAVE ebp
162+ SAVE ebx
163+/* these just push these two parameters on the stack */
164+ SAVE edi
165+ SAVE esi
166+
167+ movl %ecx, %ebp
168+ movl %eax, %esi
169+ movl %edx, %edi
170+
171+ read64 %ebp
172+1:
173+ cmpl %eax, 0(%esp)
174+ je 4f
175+2:
176+ movl %eax, %ebx
177+ movl %edx, %ecx
178+ addl %esi, %ebx
179+ adcl %edi, %ecx
180+ LOCK_PREFIX
181+ cmpxchg8b (%ebp)
182+ jne 1b
183+
184+ movl $1, %eax
185+3:
186+ addl $8, %esp
187+ CFI_ADJUST_CFA_OFFSET -8
188+ RESTORE ebx
189+ RESTORE ebp
190+ ret
191+4:
192+ cmpl %edx, 4(%esp)
193+ jne 2b
194+ xorl %eax, %eax
195+ jmp 3b
196+ CFI_ENDPROC
197+ENDPROC(atomic64_add_unless_cx8)
198+
199+ENTRY(atomic64_inc_not_zero_cx8)
200+ CFI_STARTPROC
201+ SAVE ebx
202+
203+ read64 %esi
204+1:
205+ testl %eax, %eax
206+ je 4f
207+2:
208+ movl %eax, %ebx
209+ movl %edx, %ecx
210+ addl $1, %ebx
211+ adcl $0, %ecx
212+ LOCK_PREFIX
213+ cmpxchg8b (%esi)
214+ jne 1b
215+
216+ movl $1, %eax
217+3:
218+ RESTORE ebx
219+ ret
220+4:
221+ testl %edx, %edx
222+ jne 2b
223+ jmp 3b
224+ CFI_ENDPROC
225+ENDPROC(atomic64_inc_not_zero_cx8)
arch/x86/boot/memory.c+1−1
@@ -91,7 +91,7 @@ static int detect_memory_e801(void) · 90 unmodified lines
9191 if (oreg.ax > 15*1024) {
9292 return -1; /* Bogus! */
9393 } else if (oreg.ax == 15*1024) {
94− boot_params.alt_mem_k = (oreg.dx << 6) + oreg.ax;
94+ boot_params.alt_mem_k = (oreg.bx << 6) + oreg.ax;
9595 } else {
9696 /*
9797 * This ignores memory above 16MB if we have a memory
arch/x86/include/asm/apicdef.h+1−0
@@ -78,6 +78,7 @@ · 77 unmodified lines
7878 #define APIC_DEST_LOGICAL 0x00800
7979 #define APIC_DEST_PHYSICAL 0x00000
8080 #define APIC_DM_FIXED 0x00000
81+#define APIC_DM_FIXED_MASK 0x00700
8182 #define APIC_DM_LOWEST 0x00100
8283 #define APIC_DM_SMI 0x00200
8384 #define APIC_DM_REMRD 0x00300
arch/x86/include/asm/gart.h+12−12
@@ -66,7 +66,7 @@ static inline void gart_set_size_and_enable(struct pci_dev *dev, u32 order) · 65 unmodified lines
6666 * Don't enable translation but enable GART IO and CPU accesses.
6767 * Also, set DISTLBWALKPRB since GART tables memory is UC.
6868 */
69− ctl = DISTLBWALKPRB | order << 1;
69+ ctl = order << 1;
7070
7171 pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, ctl);
7272 }
@@ -75,17 +75,17 @@ static inline void enable_gart_translation(struct pci_dev *dev, u64 addr) · 2 unmodified lines
7575 {
7676 u32 tmp, ctl;
7777
78− /* address of the mappings table */
79− addr >>= 12;
80− tmp = (u32) addr<<4;
81− tmp &= ~0xf;
82− pci_write_config_dword(dev, AMD64_GARTTABLEBASE, tmp);
83−
84− /* Enable GART translation for this hammer. */
85− pci_read_config_dword(dev, AMD64_GARTAPERTURECTL, &ctl);
86− ctl |= GARTEN;
87− ctl &= ~(DISGARTCPU | DISGARTIO);
88− pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, ctl);
78+ /* address of the mappings table */
79+ addr >>= 12;
80+ tmp = (u32) addr<<4;
81+ tmp &= ~0xf;
82+ pci_write_config_dword(dev, AMD64_GARTTABLEBASE, tmp);
83+
84+ /* Enable GART translation for this hammer. */
85+ pci_read_config_dword(dev, AMD64_GARTAPERTURECTL, &ctl);
86+ ctl |= GARTEN | DISTLBWALKPRB;
87+ ctl &= ~(DISGARTCPU | DISGARTIO);
88+ pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, ctl);
8989 }
9090
9191 static inline int aperture_valid(u64 aper_base, u32 aper_size, u32 min_size)
arch/x86/include/asm/io_apic.h+1−1
@@ -150,7 +150,7 @@ void setup_IO_APIC_irq_extra(u32 gsi); · 149 unmodified lines
150150 extern void ioapic_and_gsi_init(void);
151151 extern void ioapic_insert_resources(void);
152152
153−int io_apic_setup_irq_pin(unsigned int irq, int node, struct io_apic_irq_attr *attr);
153+int io_apic_setup_irq_pin_once(unsigned int irq, int node, struct io_apic_irq_attr *attr);
154154
155155 extern struct IO_APIC_route_entry **alloc_ioapic_entries(void);
156156 extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries);
arch/x86/include/asm/numa.h+1−1
@@ -51,7 +51,7 @@ static inline void numa_remove_cpu(int cpu) { } · 50 unmodified lines
5151 #endif /* CONFIG_NUMA */
5252
5353 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
54−struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable);
54+void debug_cpumask_set_cpu(int cpu, int node, bool enable);
5555 #endif
5656
5757 #endif /* _ASM_X86_NUMA_H */
arch/x86/include/asm/pgtable_types.h+1−0
@@ -299,6 +299,7 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, · 298 unmodified lines
299299 /* Install a pte for a particular vaddr in kernel space. */
300300 void set_pte_vaddr(unsigned long vaddr, pte_t pte);
301301
302+extern void native_pagetable_reserve(u64 start, u64 end);
302303 #ifdef CONFIG_X86_32
303304 extern void native_pagetable_setup_start(pgd_t *base);
304305 extern void native_pagetable_setup_done(pgd_t *base);
arch/x86/include/asm/uv/uv_bau.h+13−4
@@ -94,6 +94,8 @@ · 93 unmodified lines
9494 /* after this # consecutive successes, bump up the throttle if it was lowered */
9595 #define COMPLETE_THRESHOLD 5
9696
97+#define UV_LB_SUBNODEID 0x10
98+
9799 /*
98100 * number of entries in the destination side payload queue
99101 */
@@ -124,7 +126,7 @@ · 24 unmodified lines
124126 * The distribution specification (32 bytes) is interpreted as a 256-bit
125127 * distribution vector. Adjacent bits correspond to consecutive even numbered
126128 * nodeIDs. The result of adding the index of a given bit to the 15-bit
127− * 'base_dest_nodeid' field of the header corresponds to the
129+ * 'base_dest_nasid' field of the header corresponds to the
128130 * destination nodeID associated with that specified bit.
129131 */
130132 struct bau_target_uvhubmask {
@@ -176,7 +178,7 @@ struct bau_msg_payload { · 45 unmodified lines
176178 struct bau_msg_header {
177179 unsigned int dest_subnodeid:6; /* must be 0x10, for the LB */
178180 /* bits 5:0 */
179− unsigned int base_dest_nodeid:15; /* nasid of the */
181+ unsigned int base_dest_nasid:15; /* nasid of the */
180182 /* bits 20:6 */ /* first bit in uvhub map */
181183 unsigned int command:8; /* message type */
182184 /* bits 28:21 */
@@ -378,6 +380,10 @@ struct ptc_stats { · 195 unmodified lines
378380 unsigned long d_rcanceled; /* number of messages canceled by resets */
379381 };
380382
383+struct hub_and_pnode {
384+ short uvhub;
385+ short pnode;
386+};
381387 /*
382388 * one per-cpu; to locate the software tables
383389 */
@@ -399,10 +405,12 @@ struct bau_control { · 15 unmodified lines
399405 int baudisabled;
400406 int set_bau_off;
401407 short cpu;
408+ short osnode;
402409 short uvhub_cpu;
403410 short uvhub;
404411 short cpus_in_socket;
405412 short cpus_in_uvhub;
413+ short partition_base_pnode;
406414 unsigned short message_number;
407415 unsigned short uvhub_quiesce;
408416 short socket_acknowledge_count[DEST_Q_SIZE];
@@ -422,15 +430,16 @@ struct bau_control { · 13 unmodified lines
422430 int congested_period;
423431 cycles_t period_time;
424432 long period_requests;
433+ struct hub_and_pnode *target_hub_and_pnode;
425434 };
426435
427436 static inline int bau_uvhub_isset(int uvhub, struct bau_target_uvhubmask *dstp)
428437 {
429438 return constant_test_bit(uvhub, &dstp->bits[0]);
430439 }
431−static inline void bau_uvhub_set(int uvhub, struct bau_target_uvhubmask *dstp)
440+static inline void bau_uvhub_set(int pnode, struct bau_target_uvhubmask *dstp)
432441 {
433− __set_bit(uvhub, &dstp->bits[0]);
442+ __set_bit(pnode, &dstp->bits[0]);
434443 }
435444 static inline void bau_uvhubs_clear(struct bau_target_uvhubmask *dstp,
436445 int nbits)
arch/x86/include/asm/uv/uv_hub.h+2−0
@@ -398,6 +398,8 @@ struct uv_blade_info { · 397 unmodified lines
398398 unsigned short nr_online_cpus;
399399 unsigned short pnode;
400400 short memory_nid;
401+ spinlock_t nmi_lock;
402+ unsigned long nmi_count;
401403 };
402404 extern struct uv_blade_info *uv_blade_info;
403405 extern short *uv_node_to_blade;
arch/x86/include/asm/uv/uv_mmrs.h+15−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 *
66 * SGI UV MMR definitions
77 *
8− * Copyright (C) 2007-2010 Silicon Graphics, Inc. All rights reserved.
8+ * Copyright (C) 2007-2011 Silicon Graphics, Inc. All rights reserved.
99 */
1010
1111 #ifndef _ASM_X86_UV_UV_MMRS_H
@@ -1099,5 +1099,19 @@ union uvh_rtc1_int_config_u { · 1087 unmodified lines
10991099 } s;
11001100 };
11011101
1102+/* ========================================================================= */
1103+/* UVH_SCRATCH5 */
1104+/* ========================================================================= */
1105+#define UVH_SCRATCH5 0x2d0200UL
1106+#define UVH_SCRATCH5_32 0x00778
1107+
1108+#define UVH_SCRATCH5_SCRATCH5_SHFT 0
1109+#define UVH_SCRATCH5_SCRATCH5_MASK 0xffffffffffffffffUL
1110+union uvh_scratch5_u {
1111+ unsigned long v;
1112+ struct uvh_scratch5_s {
1113+ unsigned long scratch5 : 64; /* RW, W1CS */
1114+ } s;
1115+};
11021116
11031117 #endif /* __ASM_UV_MMRS_X86_H__ */
arch/x86/include/asm/x86_init.h+12−0
@@ -67,6 +67,17 @@ struct x86_init_oem { · 66 unmodified lines
6767 void (*banner)(void);
6868 };
6969
70+/**
71+ * struct x86_init_mapping - platform specific initial kernel pagetable setup
72+ * @pagetable_reserve: reserve a range of addresses for kernel pagetable usage
73+ *
74+ * For more details on the purpose of this hook, look in
75+ * init_memory_mapping and the commit that added it.
76+ */
77+struct x86_init_mapping {
78+ void (*pagetable_reserve)(u64 start, u64 end);
79+};
80+
7081 /**
7182 * struct x86_init_paging - platform specific paging functions
7283 * @pagetable_setup_start: platform specific pre paging_init() call
@@ -123,6 +134,7 @@ struct x86_init_ops { · 50 unmodified lines
123134 struct x86_init_mpparse mpparse;
124135 struct x86_init_irqs irqs;
125136 struct x86_init_oem oem;
137+ struct x86_init_mapping mapping;
126138 struct x86_init_paging paging;
127139 struct x86_init_timers timers;
128140 struct x86_init_iommu iommu;
arch/x86/kernel/aperture_64.c+1−1
@@ -499,7 +499,7 @@ out: · 498 unmodified lines
499499 * Don't enable translation yet but enable GART IO and CPU
500500 * accesses and set DISTLBWALKPRB since GART table memory is UC.
501501 */
502− u32 ctl = DISTLBWALKPRB | aper_order << 1;
502+ u32 ctl = aper_order << 1;
503503
504504 bus = amd_nb_bus_dev_ranges[i].bus;
505505 dev_base = amd_nb_bus_dev_ranges[i].dev_base;
arch/x86/kernel/apic/io_apic.c+5−5
@@ -128,8 +128,8 @@ static int __init parse_noapic(char *str) · 127 unmodified lines
128128 }
129129 early_param("noapic", parse_noapic);
130130
131−static int io_apic_setup_irq_pin_once(unsigned int irq, int node,
132− struct io_apic_irq_attr *attr);
131+static int io_apic_setup_irq_pin(unsigned int irq, int node,
132+ struct io_apic_irq_attr *attr);
133133
134134 /* Will be called in mpparse/acpi/sfi codes for saving IRQ info */
135135 void mp_save_irq(struct mpc_intsrc *m)
@@ -3570,7 +3570,7 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev) · 3434 unmodified lines
35703570 }
35713571 #endif /* CONFIG_HT_IRQ */
35723572
3573−int
3573+static int
35743574 io_apic_setup_irq_pin(unsigned int irq, int node, struct io_apic_irq_attr *attr)
35753575 {
35763576 struct irq_cfg *cfg = alloc_irq_and_cfg_at(irq, node);
@@ -3585,8 +3585,8 @@ io_apic_setup_irq_pin(unsigned int irq, int node, struct io_apic_irq_attr *attr) · 8 unmodified lines
35853585 return ret;
35863586 }
35873587
3588−static int io_apic_setup_irq_pin_once(unsigned int irq, int node,
3589− struct io_apic_irq_attr *attr)
3588+int io_apic_setup_irq_pin_once(unsigned int irq, int node,
3589+ struct io_apic_irq_attr *attr)
35903590 {
35913591 unsigned int id = attr->ioapic, pin = attr->ioapic_pin;
35923592 int ret;
arch/x86/kernel/apic/x2apic_uv_x.c+43−5
@@ -37,6 +37,13 @@ · 36 unmodified lines
3737 #include <asm/smp.h>
3838 #include <asm/x86_init.h>
3939 #include <asm/emergency-restart.h>
40+#include <asm/nmi.h>
41+
42+/* BMC sets a bit this MMR non-zero before sending an NMI */
43+#define UVH_NMI_MMR UVH_SCRATCH5
44+#define UVH_NMI_MMR_CLEAR (UVH_NMI_MMR + 8)
45+#define UV_NMI_PENDING_MASK (1UL << 63)
46+DEFINE_PER_CPU(unsigned long, cpu_last_nmi_count);
4047
4148 DEFINE_PER_CPU(int, x2apic_extra_bits);
4249
@@ -642,18 +649,46 @@ void __cpuinit uv_cpu_init(void) · 599 unmodified lines
642649 */
643650 int uv_handle_nmi(struct notifier_block *self, unsigned long reason, void *data)
644651 {
652+ unsigned long real_uv_nmi;
653+ int bid;
654+
645655 if (reason != DIE_NMIUNKNOWN)
646656 return NOTIFY_OK;
647657
648658 if (in_crash_kexec)
649659 /* do nothing if entering the crash kernel */
650660 return NOTIFY_OK;
661+
651662 /*
652− * Use a lock so only one cpu prints at a time
653− * to prevent intermixed output.
663+ * Each blade has an MMR that indicates when an NMI has been sent
664+ * to cpus on the blade. If an NMI is detected, atomically
665+ * clear the MMR and update a per-blade NMI count used to
666+ * cause each cpu on the blade to notice a new NMI.
667+ */
668+ bid = uv_numa_blade_id();
669+ real_uv_nmi = (uv_read_local_mmr(UVH_NMI_MMR) & UV_NMI_PENDING_MASK);
670+
671+ if (unlikely(real_uv_nmi)) {
672+ spin_lock(&uv_blade_info[bid].nmi_lock);
673+ real_uv_nmi = (uv_read_local_mmr(UVH_NMI_MMR) & UV_NMI_PENDING_MASK);
674+ if (real_uv_nmi) {
675+ uv_blade_info[bid].nmi_count++;
676+ uv_write_local_mmr(UVH_NMI_MMR_CLEAR, UV_NMI_PENDING_MASK);
677+ }
678+ spin_unlock(&uv_blade_info[bid].nmi_lock);
679+ }
680+
681+ if (likely(__get_cpu_var(cpu_last_nmi_count) == uv_blade_info[bid].nmi_count))
682+ return NOTIFY_DONE;
683+
684+ __get_cpu_var(cpu_last_nmi_count) = uv_blade_info[bid].nmi_count;
685+
686+ /*
687+ * Use a lock so only one cpu prints at a time.
688+ * This prevents intermixed output.
654689 */
655690 spin_lock(&uv_nmi_lock);
656− pr_info("NMI stack dump cpu %u:\n", smp_processor_id());
691+ pr_info("UV NMI stack dump cpu %u:\n", smp_processor_id());
657692 dump_stack();
658693 spin_unlock(&uv_nmi_lock);
659694
@@ -661,7 +696,8 @@ int uv_handle_nmi(struct notifier_block *self, unsigned long reason, void *data) · 1 unmodified line
661696 }
662697
663698 static struct notifier_block uv_dump_stack_nmi_nb = {
664− .notifier_call = uv_handle_nmi
699+ .notifier_call = uv_handle_nmi,
700+ .priority = NMI_LOCAL_LOW_PRIOR - 1,
665701 };
666702
667703 void uv_register_nmi_notifier(void)
@@ -720,8 +756,9 @@ void __init uv_system_init(void) · 52 unmodified lines
720756 printk(KERN_DEBUG "UV: Found %d blades\n", uv_num_possible_blades());
721757
722758 bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades();
723− uv_blade_info = kmalloc(bytes, GFP_KERNEL);
759+ uv_blade_info = kzalloc(bytes, GFP_KERNEL);
724760 BUG_ON(!uv_blade_info);
761+
725762 for (blade = 0; blade < uv_num_possible_blades(); blade++)
726763 uv_blade_info[blade].memory_nid = -1;
727764
@@ -747,6 +784,7 @@ void __init uv_system_init(void) · 19 unmodified lines
747784 uv_blade_info[blade].pnode = pnode;
748785 uv_blade_info[blade].nr_possible_cpus = 0;
749786 uv_blade_info[blade].nr_online_cpus = 0;
787+ spin_lock_init(&uv_blade_info[blade].nmi_lock);
750788 max_pnode = max(pnode, max_pnode);
751789 blade++;
752790 }
arch/x86/kernel/apm_32.c+5−0
@@ -228,6 +228,7 @@ · 227 unmodified lines
228228 #include <linux/kthread.h>
229229 #include <linux/jiffies.h>
230230 #include <linux/acpi.h>
231+#include <linux/syscore_ops.h>
231232
232233 #include <asm/system.h>
233234 #include <asm/uaccess.h>
@@ -1238,6 +1239,7 @@ static int suspend(int vetoable) · 1004 unmodified lines
12381239
12391240 local_irq_disable();
12401241 sysdev_suspend(PMSG_SUSPEND);
1242+ syscore_suspend();
12411243
12421244 local_irq_enable();
12431245
@@ -1255,6 +1257,7 @@ static int suspend(int vetoable) · 11 unmodified lines
12551257 apm_error("suspend", err);
12561258 err = (err == APM_SUCCESS) ? 0 : -EIO;
12571259
1260+ syscore_resume();
12581261 sysdev_resume();
12591262 local_irq_enable();
12601263
@@ -1280,6 +1283,7 @@ static void standby(void) · 19 unmodified lines
12801283
12811284 local_irq_disable();
12821285 sysdev_suspend(PMSG_SUSPEND);
1286+ syscore_suspend();
12831287 local_irq_enable();
12841288
12851289 err = set_system_power_state(APM_STATE_STANDBY);
@@ -1287,6 +1291,7 @@ static void standby(void) · 1 unmodified line
12871291 apm_error("standby", err);
12881292
12891293 local_irq_disable();
1294+ syscore_resume();
12901295 sysdev_resume();
12911296 local_irq_enable();
12921297
arch/x86/kernel/cpu/amd.c+1−1
@@ -613,7 +613,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) · 612 unmodified lines
613613 #endif
614614
615615 /* As a rule processors have APIC timer running in deep C states */
616− if (c->x86 >= 0xf && !cpu_has_amd_erratum(amd_erratum_400))
616+ if (c->x86 > 0xf && !cpu_has_amd_erratum(amd_erratum_400))
617617 set_cpu_cap(c, X86_FEATURE_ARAT);
618618
619619 /*
arch/x86/kernel/cpu/mcheck/mce_amd.c+1−0
@@ -509,6 +509,7 @@ recurse: · 508 unmodified lines
509509 out_free:
510510 if (b) {
511511 kobject_put(&b->kobj);
512+ list_del(&b->miscj);
512513 kfree(b);
513514 }
514515 return err;
arch/x86/kernel/cpu/mcheck/therm_throt.c+7−5
@@ -446,18 +446,20 @@ void intel_init_thermal(struct cpuinfo_x86 *c) · 445 unmodified lines
446446 */
447447 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
448448
449+ h = lvtthmr_init;
449450 /*
450451 * The initial value of thermal LVT entries on all APs always reads
451452 * 0x10000 because APs are woken up by BSP issuing INIT-SIPI-SIPI
452453 * sequence to them and LVT registers are reset to 0s except for
453454 * the mask bits which are set to 1s when APs receive INIT IPI.
454− * Always restore the value that BIOS has programmed on AP based on
455− * BSP's info we saved since BIOS is always setting the same value
456− * for all threads/cores
455+ * If BIOS takes over the thermal interrupt and sets its interrupt
456+ * delivery mode to SMI (not fixed), it restores the value that the
457+ * BIOS has programmed on AP based on BSP's info we saved since BIOS
458+ * is always setting the same value for all threads/cores.
457459 */
458− apic_write(APIC_LVTTHMR, lvtthmr_init);
460+ if ((h & APIC_DM_FIXED_MASK) != APIC_DM_FIXED)
461+ apic_write(APIC_LVTTHMR, lvtthmr_init);
459462
460− h = lvtthmr_init;
461463
462464 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
463465 printk(KERN_DEBUG
arch/x86/kernel/cpu/perf_event.c+17−5
@@ -586,8 +586,12 @@ static int x86_setup_perfctr(struct perf_event *event) · 585 unmodified lines
586586 return -EOPNOTSUPP;
587587 }
588588
589+ /*
590+ * Do not allow config1 (extended registers) to propagate,
591+ * there's no sane user-space generalization yet:
592+ */
589593 if (attr->type == PERF_TYPE_RAW)
590− return x86_pmu_extra_regs(event->attr.config, event);
594+ return 0;
591595
592596 if (attr->type == PERF_TYPE_HW_CACHE)
593597 return set_ext_hw_attr(hwc, event);
@@ -609,8 +613,8 @@ static int x86_setup_perfctr(struct perf_event *event) · 15 unmodified lines
609613 /*
610614 * Branch tracing:
611615 */
612− if ((attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS) &&
613− (hwc->sample_period == 1)) {
616+ if (attr->config == PERF_COUNT_HW_BRANCH_INSTRUCTIONS &&
617+ !attr->freq && hwc->sample_period == 1) {
614618 /* BTS is not supported by this architecture. */
615619 if (!x86_pmu.bts_active)
616620 return -EOPNOTSUPP;
@@ -1284,6 +1288,16 @@ static int x86_pmu_handle_irq(struct pt_regs *regs) · 667 unmodified lines
12841288
12851289 cpuc = &__get_cpu_var(cpu_hw_events);
12861290
1291+ /*
1292+ * Some chipsets need to unmask the LVTPC in a particular spot
1293+ * inside the nmi handler. As a result, the unmasking was pushed
1294+ * into all the nmi handlers.
1295+ *
1296+ * This generic handler doesn't seem to have any issues where the
1297+ * unmasking occurs so it was left at the top.
1298+ */
1299+ apic_write(APIC_LVTPC, APIC_DM_NMI);
1300+
12871301 for (idx = 0; idx < x86_pmu.num_counters; idx++) {
12881302 if (!test_bit(idx, cpuc->active_mask)) {
12891303 /*
@@ -1370,8 +1384,6 @@ perf_event_nmi_handler(struct notifier_block *self, · 80 unmodified lines
13701384 return NOTIFY_DONE;
13711385 }
13721386
1373− apic_write(APIC_LVTPC, APIC_DM_NMI);
1374−
13751387 handled = x86_pmu.handle_irq(args->regs);
13761388 if (!handled)
13771389 return NOTIFY_DONE;
arch/x86/kernel/cpu/perf_event_amd.c+18−4
@@ -8,7 +8,7 @@ static __initconst const u64 amd_hw_cache_event_ids · 7 unmodified lines
88 [ C(L1D) ] = {
99 [ C(OP_READ) ] = {
1010 [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
11− [ C(RESULT_MISS) ] = 0x0041, /* Data Cache Misses */
11+ [ C(RESULT_MISS) ] = 0x0141, /* Data Cache Misses */
1212 },
1313 [ C(OP_WRITE) ] = {
1414 [ C(RESULT_ACCESS) ] = 0x0142, /* Data Cache Refills :system */
@@ -427,7 +427,9 @@ static __initconst const struct x86_pmu amd_pmu = { · 412 unmodified lines
427427 *
428428 * Exceptions:
429429 *
430+ * 0x000 FP PERF_CTL[3], PERF_CTL[5:3] (*)
430431 * 0x003 FP PERF_CTL[3]
432+ * 0x004 FP PERF_CTL[3], PERF_CTL[5:3] (*)
431433 * 0x00B FP PERF_CTL[3]
432434 * 0x00D FP PERF_CTL[3]
433435 * 0x023 DE PERF_CTL[2:0]
@@ -448,6 +450,8 @@ static __initconst const struct x86_pmu amd_pmu = { · 14 unmodified lines
448450 * 0x0DF LS PERF_CTL[5:0]
449451 * 0x1D6 EX PERF_CTL[5:0]
450452 * 0x1D8 EX PERF_CTL[5:0]
453+ *
454+ * (*) depending on the umask all FPU counters may be used
451455 */
452456
453457 static struct event_constraint amd_f15_PMC0 = EVENT_CONSTRAINT(0, 0x01, 0);
@@ -460,18 +464,28 @@ static struct event_constraint amd_f15_PMC53 = EVENT_CONSTRAINT(0, 0x38, 0); · 6 unmodified lines
460464 static struct event_constraint *
461465 amd_get_event_constraints_f15h(struct cpu_hw_events *cpuc, struct perf_event *event)
462466 {
463− unsigned int event_code = amd_get_event_code(&event->hw);
467+ struct hw_perf_event *hwc = &event->hw;
468+ unsigned int event_code = amd_get_event_code(hwc);
464469
465470 switch (event_code & AMD_EVENT_TYPE_MASK) {
466471 case AMD_EVENT_FP:
467472 switch (event_code) {
473+ case 0x000:
474+ if (!(hwc->config & 0x0000F000ULL))
475+ break;
476+ if (!(hwc->config & 0x00000F00ULL))
477+ break;
478+ return &amd_f15_PMC3;
479+ case 0x004:
480+ if (hweight_long(hwc->config & ARCH_PERFMON_EVENTSEL_UMASK) <= 1)
481+ break;
482+ return &amd_f15_PMC3;
468483 case 0x003:
469484 case 0x00B:
470485 case 0x00D:
471486 return &amd_f15_PMC3;
472− default:
473− return &amd_f15_PMC53;
474487 }
488+ return &amd_f15_PMC53;
475489 case AMD_EVENT_LS:
476490 case AMD_EVENT_DC:
477491 case AMD_EVENT_EX_LS:
arch/x86/kernel/cpu/perf_event_intel.c+84−41
@@ -25,7 +25,7 @@ struct intel_percore { · 24 unmodified lines
2525 /*
2626 * Intel PerfMon, used on Core and later.
2727 */
28−static const u64 intel_perfmon_event_map[] =
28+static u64 intel_perfmon_event_map[PERF_COUNT_HW_MAX] __read_mostly =
2929 {
3030 [PERF_COUNT_HW_CPU_CYCLES] = 0x003c,
3131 [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
@@ -184,26 +184,23 @@ static __initconst const u64 snb_hw_cache_event_ids · 152 unmodified lines
184184 },
185185 },
186186 [ C(LL ) ] = {
187− /*
188− * TBD: Need Off-core Response Performance Monitoring support
189− */
190187 [ C(OP_READ) ] = {
191− /* OFFCORE_RESPONSE_0.ANY_DATA.LOCAL_CACHE */
188+ /* OFFCORE_RESPONSE.ANY_DATA.LOCAL_CACHE */
192189 [ C(RESULT_ACCESS) ] = 0x01b7,
193− /* OFFCORE_RESPONSE_1.ANY_DATA.ANY_LLC_MISS */
194− [ C(RESULT_MISS) ] = 0x01bb,
190+ /* OFFCORE_RESPONSE.ANY_DATA.ANY_LLC_MISS */
191+ [ C(RESULT_MISS) ] = 0x01b7,
195192 },
196193 [ C(OP_WRITE) ] = {
197− /* OFFCORE_RESPONSE_0.ANY_RFO.LOCAL_CACHE */
194+ /* OFFCORE_RESPONSE.ANY_RFO.LOCAL_CACHE */
198195 [ C(RESULT_ACCESS) ] = 0x01b7,
199− /* OFFCORE_RESPONSE_1.ANY_RFO.ANY_LLC_MISS */
200− [ C(RESULT_MISS) ] = 0x01bb,
196+ /* OFFCORE_RESPONSE.ANY_RFO.ANY_LLC_MISS */
197+ [ C(RESULT_MISS) ] = 0x01b7,
201198 },
202199 [ C(OP_PREFETCH) ] = {
203− /* OFFCORE_RESPONSE_0.PREFETCH.LOCAL_CACHE */
200+ /* OFFCORE_RESPONSE.PREFETCH.LOCAL_CACHE */
204201 [ C(RESULT_ACCESS) ] = 0x01b7,
205− /* OFFCORE_RESPONSE_1.PREFETCH.ANY_LLC_MISS */
206− [ C(RESULT_MISS) ] = 0x01bb,
202+ /* OFFCORE_RESPONSE.PREFETCH.ANY_LLC_MISS */
203+ [ C(RESULT_MISS) ] = 0x01b7,
207204 },
208205 },
209206 [ C(DTLB) ] = {
@@ -285,26 +282,26 @@ static __initconst const u64 westmere_hw_cache_event_ids · 75 unmodified lines
285282 },
286283 [ C(LL ) ] = {
287284 [ C(OP_READ) ] = {
288− /* OFFCORE_RESPONSE_0.ANY_DATA.LOCAL_CACHE */
285+ /* OFFCORE_RESPONSE.ANY_DATA.LOCAL_CACHE */
289286 [ C(RESULT_ACCESS) ] = 0x01b7,
290− /* OFFCORE_RESPONSE_1.ANY_DATA.ANY_LLC_MISS */
291− [ C(RESULT_MISS) ] = 0x01bb,
287+ /* OFFCORE_RESPONSE.ANY_DATA.ANY_LLC_MISS */
288+ [ C(RESULT_MISS) ] = 0x01b7,
292289 },
293290 /*
294291 * Use RFO, not WRITEBACK, because a write miss would typically occur
295292 * on RFO.
296293 */
297294 [ C(OP_WRITE) ] = {
298− /* OFFCORE_RESPONSE_1.ANY_RFO.LOCAL_CACHE */
299− [ C(RESULT_ACCESS) ] = 0x01bb,
300− /* OFFCORE_RESPONSE_0.ANY_RFO.ANY_LLC_MISS */
295+ /* OFFCORE_RESPONSE.ANY_RFO.LOCAL_CACHE */
296+ [ C(RESULT_ACCESS) ] = 0x01b7,
297+ /* OFFCORE_RESPONSE.ANY_RFO.ANY_LLC_MISS */
301298 [ C(RESULT_MISS) ] = 0x01b7,
302299 },
303300 [ C(OP_PREFETCH) ] = {
304− /* OFFCORE_RESPONSE_0.PREFETCH.LOCAL_CACHE */
301+ /* OFFCORE_RESPONSE.PREFETCH.LOCAL_CACHE */
305302 [ C(RESULT_ACCESS) ] = 0x01b7,
306− /* OFFCORE_RESPONSE_1.PREFETCH.ANY_LLC_MISS */
307− [ C(RESULT_MISS) ] = 0x01bb,
303+ /* OFFCORE_RESPONSE.PREFETCH.ANY_LLC_MISS */
304+ [ C(RESULT_MISS) ] = 0x01b7,
308305 },
309306 },
310307 [ C(DTLB) ] = {
@@ -352,16 +349,36 @@ static __initconst const u64 westmere_hw_cache_event_ids · 41 unmodified lines
352349 };
353350
354351 /*
355− * OFFCORE_RESPONSE MSR bits (subset), See IA32 SDM Vol 3 30.6.1.3
352+ * Nehalem/Westmere MSR_OFFCORE_RESPONSE bits;
353+ * See IA32 SDM Vol 3B 30.6.1.3
356354 */
357355
358−#define DMND_DATA_RD (1 << 0)
359−#define DMND_RFO (1 << 1)
360−#define DMND_WB (1 << 3)
361−#define PF_DATA_RD (1 << 4)
362−#define PF_DATA_RFO (1 << 5)
363−#define RESP_UNCORE_HIT (1 << 8)
364−#define RESP_MISS (0xf600) /* non uncore hit */
356+#define NHM_DMND_DATA_RD (1 << 0)
357+#define NHM_DMND_RFO (1 << 1)
358+#define NHM_DMND_IFETCH (1 << 2)
359+#define NHM_DMND_WB (1 << 3)
360+#define NHM_PF_DATA_RD (1 << 4)
361+#define NHM_PF_DATA_RFO (1 << 5)
362+#define NHM_PF_IFETCH (1 << 6)
363+#define NHM_OFFCORE_OTHER (1 << 7)
364+#define NHM_UNCORE_HIT (1 << 8)
365+#define NHM_OTHER_CORE_HIT_SNP (1 << 9)
366+#define NHM_OTHER_CORE_HITM (1 << 10)
367+ /* reserved */
368+#define NHM_REMOTE_CACHE_FWD (1 << 12)
369+#define NHM_REMOTE_DRAM (1 << 13)
370+#define NHM_LOCAL_DRAM (1 << 14)
371+#define NHM_NON_DRAM (1 << 15)
372+
373+#define NHM_ALL_DRAM (NHM_REMOTE_DRAM|NHM_LOCAL_DRAM)
374+
375+#define NHM_DMND_READ (NHM_DMND_DATA_RD)
376+#define NHM_DMND_WRITE (NHM_DMND_RFO|NHM_DMND_WB)
377+#define NHM_DMND_PREFETCH (NHM_PF_DATA_RD|NHM_PF_DATA_RFO)
378+
379+#define NHM_L3_HIT (NHM_UNCORE_HIT|NHM_OTHER_CORE_HIT_SNP|NHM_OTHER_CORE_HITM)
380+#define NHM_L3_MISS (NHM_NON_DRAM|NHM_ALL_DRAM|NHM_REMOTE_CACHE_FWD)
381+#define NHM_L3_ACCESS (NHM_L3_HIT|NHM_L3_MISS)
365382
366383 static __initconst const u64 nehalem_hw_cache_extra_regs
367384 [PERF_COUNT_HW_CACHE_MAX]
@@ -370,16 +387,16 @@ static __initconst const u64 nehalem_hw_cache_extra_regs · 2 unmodified lines
370387 {
371388 [ C(LL ) ] = {
372389 [ C(OP_READ) ] = {
373− [ C(RESULT_ACCESS) ] = DMND_DATA_RD|RESP_UNCORE_HIT,
374− [ C(RESULT_MISS) ] = DMND_DATA_RD|RESP_MISS,
390+ [ C(RESULT_ACCESS) ] = NHM_DMND_READ|NHM_L3_ACCESS,
391+ [ C(RESULT_MISS) ] = NHM_DMND_READ|NHM_L3_MISS,
375392 },
376393 [ C(OP_WRITE) ] = {
377− [ C(RESULT_ACCESS) ] = DMND_RFO|DMND_WB|RESP_UNCORE_HIT,
378− [ C(RESULT_MISS) ] = DMND_RFO|DMND_WB|RESP_MISS,
394+ [ C(RESULT_ACCESS) ] = NHM_DMND_WRITE|NHM_L3_ACCESS,
395+ [ C(RESULT_MISS) ] = NHM_DMND_WRITE|NHM_L3_MISS,
379396 },
380397 [ C(OP_PREFETCH) ] = {
381− [ C(RESULT_ACCESS) ] = PF_DATA_RD|PF_DATA_RFO|RESP_UNCORE_HIT,
382− [ C(RESULT_MISS) ] = PF_DATA_RD|PF_DATA_RFO|RESP_MISS,
398+ [ C(RESULT_ACCESS) ] = NHM_DMND_PREFETCH|NHM_L3_ACCESS,
399+ [ C(RESULT_MISS) ] = NHM_DMND_PREFETCH|NHM_L3_MISS,
383400 },
384401 }
385402 };
@@ -391,12 +408,12 @@ static __initconst const u64 nehalem_hw_cache_event_ids · 5 unmodified lines
391408 {
392409 [ C(L1D) ] = {
393410 [ C(OP_READ) ] = {
394− [ C(RESULT_ACCESS) ] = 0x0f40, /* L1D_CACHE_LD.MESI */
395− [ C(RESULT_MISS) ] = 0x0140, /* L1D_CACHE_LD.I_STATE */
411+ [ C(RESULT_ACCESS) ] = 0x010b, /* MEM_INST_RETIRED.LOADS */
412+ [ C(RESULT_MISS) ] = 0x0151, /* L1D.REPL */
396413 },
397414 [ C(OP_WRITE) ] = {
398− [ C(RESULT_ACCESS) ] = 0x0f41, /* L1D_CACHE_ST.MESI */
399− [ C(RESULT_MISS) ] = 0x0141, /* L1D_CACHE_ST.I_STATE */
415+ [ C(RESULT_ACCESS) ] = 0x020b, /* MEM_INST_RETURED.STORES */
416+ [ C(RESULT_MISS) ] = 0x0251, /* L1D.M_REPL */
400417 },
401418 [ C(OP_PREFETCH) ] = {
402419 [ C(RESULT_ACCESS) ] = 0x014e, /* L1D_PREFETCH.REQUESTS */
@@ -933,6 +950,16 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) · 530 unmodified lines
933950
934951 cpuc = &__get_cpu_var(cpu_hw_events);
935952
953+ /*
954+ * Some chipsets need to unmask the LVTPC in a particular spot
955+ * inside the nmi handler. As a result, the unmasking was pushed
956+ * into all the nmi handlers.
957+ *
958+ * This handler doesn't seem to have any issues with the unmasking
959+ * so it was left at the top.
960+ */
961+ apic_write(APIC_LVTPC, APIC_DM_NMI);
962+
936963 intel_pmu_disable_all();
937964 handled = intel_pmu_drain_bts_buffer();
938965 status = intel_pmu_get_status();
@@ -998,6 +1025,9 @@ intel_bts_constraints(struct perf_event *event) · 59 unmodified lines
9981025 struct hw_perf_event *hwc = &event->hw;
9991026 unsigned int hw_event, bts_event;
10001027
1028+ if (event->attr.freq)
1029+ return NULL;
1030+
10011031 hw_event = hwc->config & INTEL_ARCH_EVENT_MASK;
10021032 bts_event = x86_pmu.event_map(PERF_COUNT_HW_BRANCH_INSTRUCTIONS);
10031033
@@ -1305,7 +1335,7 @@ static void intel_clovertown_quirks(void) · 301 unmodified lines
13051335 * AJ106 could possibly be worked around by not allowing LBR
13061336 * usage from PEBS, including the fixup.
13071337 * AJ68 could possibly be worked around by always programming
1308− * a pebs_event_reset[0] value and coping with the lost events.
1338+ * a pebs_event_reset[0] value and coping with the lost events.
13091339 *
13101340 * But taken together it might just make sense to not enable PEBS on
13111341 * these chips.
@@ -1409,6 +1439,18 @@ static __init int intel_pmu_init(void) · 97 unmodified lines
14091439 x86_pmu.percore_constraints = intel_nehalem_percore_constraints;
14101440 x86_pmu.enable_all = intel_pmu_nhm_enable_all;
14111441 x86_pmu.extra_regs = intel_nehalem_extra_regs;
1442+
1443+ if (ebx & 0x40) {
1444+ /*
1445+ * Erratum AAJ80 detected, we work it around by using
1446+ * the BR_MISP_EXEC.ANY event. This will over-count
1447+ * branch-misses, but it's still much better than the
1448+ * architectural event which is often completely bogus:
1449+ */
1450+ intel_perfmon_event_map[PERF_COUNT_HW_BRANCH_MISSES] = 0x7f89;
1451+
1452+ pr_cont("erratum AAJ80 worked around, ");
1453+ }
14121454 pr_cont("Nehalem events, ");
14131455 break;
14141456
@@ -1425,6 +1467,7 @@ static __init int intel_pmu_init(void) · 10 unmodified lines
14251467
14261468 case 37: /* 32 nm nehalem, "Clarkdale" */
14271469 case 44: /* 32 nm nehalem, "Gulftown" */
1470+ case 47: /* 32 nm Xeon E7 */
14281471 memcpy(hw_cache_event_ids, westmere_hw_cache_event_ids,
14291472 sizeof(hw_cache_event_ids));
14301473 memcpy(hw_cache_extra_regs, nehalem_hw_cache_extra_regs,
arch/x86/kernel/cpu/perf_event_p4.c+14−5
@@ -947,14 +947,23 @@ static int p4_pmu_handle_irq(struct pt_regs *regs) · 946 unmodified lines
947947 if (!x86_perf_event_set_period(event))
948948 continue;
949949 if (perf_event_overflow(event, 1, &data, regs))
950− p4_pmu_disable_event(event);
950+ x86_pmu_stop(event, 0);
951951 }
952952
953− if (handled) {
954− /* p4 quirk: unmask it again */
955− apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
953+ if (handled)
956954 inc_irq_stat(apic_perf_irqs);
957− }
955+
956+ /*
957+ * When dealing with the unmasking of the LVTPC on P4 perf hw, it has
958+ * been observed that the OVF bit flag has to be cleared first _before_
959+ * the LVTPC can be unmasked.
960+ *
961+ * The reason is the NMI line will continue to be asserted while the OVF
962+ * bit is set. This causes a second NMI to generate if the LVTPC is
963+ * unmasked before the OVF bit is cleared, leading to unknown NMI
964+ * messages.
965+ */
966+ apic_write(APIC_LVTPC, APIC_DM_NMI);
958967
959968 return handled;
960969 }
arch/x86/kernel/devicetree.c+1−1
@@ -391,7 +391,7 @@ static int ioapic_xlate(struct irq_domain *id, const u32 *intspec, u32 intsize, · 390 unmodified lines
391391
392392 set_io_apic_irq_attr(&attr, idx, line, it->trigger, it->polarity);
393393
394− return io_apic_setup_irq_pin(*out_hwirq, cpu_to_node(0), &attr);
394+ return io_apic_setup_irq_pin_once(*out_hwirq, cpu_to_node(0), &attr);
395395 }
396396
397397 static void __init ioapic_add_ofnode(struct device_node *np)
arch/x86/kernel/kprobes.c+3−2
@@ -1183,12 +1183,13 @@ static void __kprobes optimized_callback(struct optimized_kprobe *op, · 1182 unmodified lines
11831183 struct pt_regs *regs)
11841184 {
11851185 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
1186+ unsigned long flags;
11861187
11871188 /* This is possible if op is under delayed unoptimizing */
11881189 if (kprobe_disabled(&op->kp))
11891190 return;
11901191
1191− preempt_disable();
1192+ local_irq_save(flags);
11921193 if (kprobe_running()) {
11931194 kprobes_inc_nmissed_count(&op->kp);
11941195 } else {
@@ -1207,7 +1208,7 @@ static void __kprobes optimized_callback(struct optimized_kprobe *op, · 12 unmodified lines
12071208 opt_pre_handler(&op->kp, regs);
12081209 __this_cpu_write(current_kprobe, NULL);
12091210 }
1210− preempt_enable_no_resched();
1211+ local_irq_restore(flags);
12111212 }
12121213
12131214 static int __kprobes copy_optimized_instructions(u8 *dest, u8 *src)
arch/x86/kernel/pci-gart_64.c+8−1
@@ -81,6 +81,9 @@ static u32 gart_unmapped_entry; · 80 unmodified lines
8181 #define AGPEXTERN
8282 #endif
8383
84+/* GART can only remap to physical addresses < 1TB */
85+#define GART_MAX_PHYS_ADDR (1ULL << 40)
86+
8487 /* backdoor interface to AGP driver */
8588 AGPEXTERN int agp_memory_reserved;
8689 AGPEXTERN __u32 *agp_gatt_table;
@@ -212,9 +215,13 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem, · 125 unmodified lines
212215 size_t size, int dir, unsigned long align_mask)
213216 {
214217 unsigned long npages = iommu_num_pages(phys_mem, size, PAGE_SIZE);
215− unsigned long iommu_page = alloc_iommu(dev, npages, align_mask);
218+ unsigned long iommu_page;
216219 int i;
217220
221+ if (unlikely(phys_mem + size > GART_MAX_PHYS_ADDR))
222+ return bad_dma_addr;
223+
224+ iommu_page = alloc_iommu(dev, npages, align_mask);
218225 if (iommu_page == -1) {
219226 if (!nonforced_iommu(dev, phys_mem, size))
220227 return phys_mem;
arch/x86/kernel/ptrace.c+26−10
@@ -608,6 +608,9 @@ static int ptrace_write_dr7(struct task_struct *tsk, unsigned long data) · 607 unmodified lines
608608 unsigned len, type;
609609 struct perf_event *bp;
610610
611+ if (ptrace_get_breakpoints(tsk) < 0)
612+ return -ESRCH;
613+
611614 data &= ~DR_CONTROL_RESERVED;
612615 old_dr7 = ptrace_get_dr7(thread->ptrace_bps);
613616 restore:
@@ -655,6 +658,9 @@ restore: · 41 unmodified lines
655658 }
656659 goto restore;
657660 }
661+
662+ ptrace_put_breakpoints(tsk);
663+
658664 return ((orig_ret < 0) ? orig_ret : rc);
659665 }
660666
@@ -668,10 +674,17 @@ static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n) · 7 unmodified lines
668674
669675 if (n < HBP_NUM) {
670676 struct perf_event *bp;
677+
678+ if (ptrace_get_breakpoints(tsk) < 0)
679+ return -ESRCH;
680+
671681 bp = thread->ptrace_bps[n];
672682 if (!bp)
673− return 0;
674− val = bp->hw.info.address;
683+ val = 0;
684+ else
685+ val = bp->hw.info.address;
686+
687+ ptrace_put_breakpoints(tsk);
675688 } else if (n == 6) {
676689 val = thread->debugreg6;
677690 } else if (n == 7) {
@@ -686,6 +699,10 @@ static int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr, · 8 unmodified lines
686699 struct perf_event *bp;
687700 struct thread_struct *t = &tsk->thread;
688701 struct perf_event_attr attr;
702+ int err = 0;
703+
704+ if (ptrace_get_breakpoints(tsk) < 0)
705+ return -ESRCH;
689706
690707 if (!t->ptrace_bps[nr]) {
691708 ptrace_breakpoint_init(&attr);
@@ -709,24 +726,23 @@ static int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr, · 17 unmodified lines
709726 * writing for the user. And anyway this is the previous
710727 * behaviour.
711728 */
712− if (IS_ERR(bp))
713− return PTR_ERR(bp);
729+ if (IS_ERR(bp)) {
730+ err = PTR_ERR(bp);
731+ goto put;
732+ }
714733
715734 t->ptrace_bps[nr] = bp;
716735 } else {
717− int err;
718−
719736 bp = t->ptrace_bps[nr];
720737
721738 attr = bp->attr;
722739 attr.bp_addr = addr;
723740 err = modify_user_hw_breakpoint(bp, &attr);
724− if (err)
725− return err;
726741 }
727742
728−
729− return 0;
743+put:
744+ ptrace_put_breakpoints(tsk);
745+ return err;
730746 }
731747
732748 /*
arch/x86/kernel/reboot_32.S+6−6
@@ -21,26 +21,26 @@ r_base = . · 20 unmodified lines
2121 /* Get our own relocated address */
2222 call 1f
2323 1: popl %ebx
24− subl $1b, %ebx
24+ subl $(1b - r_base), %ebx
2525
2626 /* Compute the equivalent real-mode segment */
2727 movl %ebx, %ecx
2828 shrl $4, %ecx
2929
3030 /* Patch post-real-mode segment jump */
31− movw dispatch_table(%ebx,%eax,2),%ax
32− movw %ax, 101f(%ebx)
33− movw %cx, 102f(%ebx)
31+ movw (dispatch_table - r_base)(%ebx,%eax,2),%ax
32+ movw %ax, (101f - r_base)(%ebx)
33+ movw %cx, (102f - r_base)(%ebx)
3434
3535 /* Set up the IDT for real mode. */
36− lidtl machine_real_restart_idt(%ebx)
36+ lidtl (machine_real_restart_idt - r_base)(%ebx)
3737
3838 /*
3939 * Set up a GDT from which we can load segment descriptors for real
4040 * mode. The GDT is not used in real mode; it is just needed here to
4141 * prepare the descriptors.
4242 */
43− lgdtl machine_real_restart_gdt(%ebx)
43+ lgdtl (machine_real_restart_gdt - r_base)(%ebx)
4444
4545 /*
4646 * Load the data segment registers with 16-bit compatible values
arch/x86/kernel/smpboot.c+0−23
@@ -312,26 +312,6 @@ void __cpuinit smp_store_cpu_info(int id) · 311 unmodified lines
312312 identify_secondary_cpu(c);
313313 }
314314
315−static void __cpuinit check_cpu_siblings_on_same_node(int cpu1, int cpu2)
316−{
317− int node1 = early_cpu_to_node(cpu1);
318− int node2 = early_cpu_to_node(cpu2);
319−
320− /*
321− * Our CPU scheduler assumes all logical cpus in the same physical cpu
322− * share the same node. But, buggy ACPI or NUMA emulation might assign
323− * them to different node. Fix it.
324− */
325− if (node1 != node2) {
326− pr_warning("CPU %d in node %d and CPU %d in node %d are in the same physical CPU. forcing same node %d\n",
327− cpu1, node1, cpu2, node2, node2);
328−
329− numa_remove_cpu(cpu1);
330− numa_set_node(cpu1, node2);
331− numa_add_cpu(cpu1);
332− }
333−}
334−
335315 static void __cpuinit link_thread_siblings(int cpu1, int cpu2)
336316 {
337317 cpumask_set_cpu(cpu1, cpu_sibling_mask(cpu2));
@@ -340,7 +320,6 @@ static void __cpuinit link_thread_siblings(int cpu1, int cpu2) · 2 unmodified lines
340320 cpumask_set_cpu(cpu2, cpu_core_mask(cpu1));
341321 cpumask_set_cpu(cpu1, cpu_llc_shared_mask(cpu2));
342322 cpumask_set_cpu(cpu2, cpu_llc_shared_mask(cpu1));
343− check_cpu_siblings_on_same_node(cpu1, cpu2);
344323 }
345324
346325
@@ -382,12 +361,10 @@ void __cpuinit set_cpu_sibling_map(int cpu) · 35 unmodified lines
382361 per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) {
383362 cpumask_set_cpu(i, cpu_llc_shared_mask(cpu));
384363 cpumask_set_cpu(cpu, cpu_llc_shared_mask(i));
385− check_cpu_siblings_on_same_node(cpu, i);
386364 }
387365 if (c->phys_proc_id == cpu_data(i).phys_proc_id) {
388366 cpumask_set_cpu(i, cpu_core_mask(cpu));
389367 cpumask_set_cpu(cpu, cpu_core_mask(i));
390− check_cpu_siblings_on_same_node(cpu, i);
391368 /*
392369 * Does this new cpu bringup a new core?
393370 */
arch/x86/kernel/x86_init.c+4−0
@@ -61,6 +61,10 @@ struct x86_init_ops x86_init __initdata = { · 60 unmodified lines
6161 .banner = default_banner,
6262 },
6363
64+ .mapping = {
65+ .pagetable_reserve = native_pagetable_reserve,
66+ },
67+
6468 .paging = {
6569 .pagetable_setup_start = native_pagetable_setup_start,
6670 .pagetable_setup_done = native_pagetable_setup_done,
arch/x86/mm/init.c+22−2
@@ -81,6 +81,11 @@ static void __init find_early_table_space(unsigned long end, int use_pse, · 80 unmodified lines
8181 end, pgt_buf_start << PAGE_SHIFT, pgt_buf_top << PAGE_SHIFT);
8282 }
8383
84+void __init native_pagetable_reserve(u64 start, u64 end)
85+{
86+ memblock_x86_reserve_range(start, end, "PGTABLE");
87+}
88+
8489 struct map_range {
8590 unsigned long start;
8691 unsigned long end;
@@ -272,9 +277,24 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, · 185 unmodified lines
272277
273278 __flush_tlb_all();
274279
280+ /*
281+ * Reserve the kernel pagetable pages we used (pgt_buf_start -
282+ * pgt_buf_end) and free the other ones (pgt_buf_end - pgt_buf_top)
283+ * so that they can be reused for other purposes.
284+ *
285+ * On native it just means calling memblock_x86_reserve_range, on Xen it
286+ * also means marking RW the pagetable pages that we allocated before
287+ * but that haven't been used.
288+ *
289+ * In fact on xen we mark RO the whole range pgt_buf_start -
290+ * pgt_buf_top, because we have to make sure that when
291+ * init_memory_mapping reaches the pagetable pages area, it maps
292+ * RO all the pagetable pages, including the ones that are beyond
293+ * pgt_buf_end at that time.
294+ */
275295 if (!after_bootmem && pgt_buf_end > pgt_buf_start)
276− memblock_x86_reserve_range(pgt_buf_start << PAGE_SHIFT,
277− pgt_buf_end << PAGE_SHIFT, "PGTABLE");
296+ x86_init.mapping.pagetable_reserve(PFN_PHYS(pgt_buf_start),
297+ PFN_PHYS(pgt_buf_end));
278298
279299 if (!after_bootmem)
280300 early_memtest(start, end);
arch/x86/mm/numa.c+13−18
@@ -213,53 +213,48 @@ int early_cpu_to_node(int cpu) · 212 unmodified lines
213213 return per_cpu(x86_cpu_to_node_map, cpu);
214214 }
215215
216−struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable)
216+void debug_cpumask_set_cpu(int cpu, int node, bool enable)
217217 {
218− int node = early_cpu_to_node(cpu);
219218 struct cpumask *mask;
220219 char buf[64];
221220
222221 if (node == NUMA_NO_NODE) {
223222 /* early_cpu_to_node() already emits a warning and trace */
224− return NULL;
223+ return;
225224 }
226225 mask = node_to_cpumask_map[node];
227226 if (!mask) {
228227 pr_err("node_to_cpumask_map[%i] NULL\n", node);
229228 dump_stack();
230− return NULL;
229+ return;
231230 }
232231
232+ if (enable)
233+ cpumask_set_cpu(cpu, mask);
234+ else
235+ cpumask_clear_cpu(cpu, mask);
236+
233237 cpulist_scnprintf(buf, sizeof(buf), mask);
234238 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
235239 enable ? "numa_add_cpu" : "numa_remove_cpu",
236240 cpu, node, buf);
237− return mask;
241+ return;
238242 }
239243
240244 # ifndef CONFIG_NUMA_EMU
241−static void __cpuinit numa_set_cpumask(int cpu, int enable)
245+static void __cpuinit numa_set_cpumask(int cpu, bool enable)
242246 {
243− struct cpumask *mask;
244−
245− mask = debug_cpumask_set_cpu(cpu, enable);
246− if (!mask)
247− return;
248−
249− if (enable)
250− cpumask_set_cpu(cpu, mask);
251− else
252− cpumask_clear_cpu(cpu, mask);
247+ debug_cpumask_set_cpu(cpu, early_cpu_to_node(cpu), enable);
253248 }
254249
255250 void __cpuinit numa_add_cpu(int cpu)
256251 {
257− numa_set_cpumask(cpu, 1);
252+ numa_set_cpumask(cpu, true);
258253 }
259254
260255 void __cpuinit numa_remove_cpu(int cpu)
261256 {
262− numa_set_cpumask(cpu, 0);
257+ numa_set_cpumask(cpu, false);
263258 }
264259 # endif /* !CONFIG_NUMA_EMU */
265260
arch/x86/mm/numa_64.c+1−1
@@ -306,7 +306,7 @@ int __init numa_cleanup_meminfo(struct numa_meminfo *mi) · 305 unmodified lines
306306 bi->end = min(bi->end, high);
307307
308308 /* and there's no empty block */
309− if (bi->start == bi->end) {
309+ if (bi->start >= bi->end) {
310310 numa_remove_memblk_from(i--, mi);
311311 continue;
312312 }
arch/x86/mm/numa_emulation.c+6−14
@@ -454,10 +454,9 @@ void __cpuinit numa_remove_cpu(int cpu) · 453 unmodified lines
454454 cpumask_clear_cpu(cpu, node_to_cpumask_map[i]);
455455 }
456456 #else /* !CONFIG_DEBUG_PER_CPU_MAPS */
457−static void __cpuinit numa_set_cpumask(int cpu, int enable)
457+static void __cpuinit numa_set_cpumask(int cpu, bool enable)
458458 {
459− struct cpumask *mask;
460− int nid, physnid, i;
459+ int nid, physnid;
461460
462461 nid = early_cpu_to_node(cpu);
463462 if (nid == NUMA_NO_NODE) {
@@ -467,28 +466,21 @@ static void __cpuinit numa_set_cpumask(int cpu, int enable) · 3 unmodified lines
467466
468467 physnid = emu_nid_to_phys[nid];
469468
470− for_each_online_node(i) {
469+ for_each_online_node(nid) {
471470 if (emu_nid_to_phys[nid] != physnid)
472471 continue;
473472
474− mask = debug_cpumask_set_cpu(cpu, enable);
475− if (!mask)
476− return;
477−
478− if (enable)
479− cpumask_set_cpu(cpu, mask);
480− else
481− cpumask_clear_cpu(cpu, mask);
473+ debug_cpumask_set_cpu(cpu, nid, enable);
482474 }
483475 }
484476
485477 void __cpuinit numa_add_cpu(int cpu)
486478 {
487− numa_set_cpumask(cpu, 1);
479+ numa_set_cpumask(cpu, true);
488480 }
489481
490482 void __cpuinit numa_remove_cpu(int cpu)
491483 {
492− numa_set_cpumask(cpu, 0);
484+ numa_set_cpumask(cpu, false);
493485 }
494486 #endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
arch/x86/platform/ce4100/falconfalls.dts+3−3
@@ -347,7 +347,7 @@ · 346 unmodified lines
347347 "pciclass0c03";
348348
349349 reg = <0x16800 0x0 0x0 0x0 0x0>;
350− interrupts = <22 3>;
350+ interrupts = <22 1>;
351351 };
352352
353353 usb@d,1 {
@@ -357,7 +357,7 @@ · 3 unmodified lines
357357 "pciclass0c03";
358358
359359 reg = <0x16900 0x0 0x0 0x0 0x0>;
360− interrupts = <22 3>;
360+ interrupts = <22 1>;
361361 };
362362
363363 sata@e,0 {
@@ -367,7 +367,7 @@ · 3 unmodified lines
367367 "pciclass0106";
368368
369369 reg = <0x17000 0x0 0x0 0x0 0x0>;
370− interrupts = <23 3>;
370+ interrupts = <23 1>;
371371 };
372372
373373 flash@f,0 {
arch/x86/platform/uv/tlb_uv.c+63−29
@@ -699,16 +699,17 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, · 698 unmodified lines
699699 struct mm_struct *mm,
700700 unsigned long va, unsigned int cpu)
701701 {
702− int tcpu;
703− int uvhub;
704702 int locals = 0;
705703 int remotes = 0;
706704 int hubs = 0;
705+ int tcpu;
706+ int tpnode;
707707 struct bau_desc *bau_desc;
708708 struct cpumask *flush_mask;
709709 struct ptc_stats *stat;
710710 struct bau_control *bcp;
711711 struct bau_control *tbcp;
712+ struct hub_and_pnode *hpp;
712713
713714 /* kernel was booted 'nobau' */
714715 if (nobau)
@@ -750,11 +751,18 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, · 35 unmodified lines
750751 bau_desc += UV_ITEMS_PER_DESCRIPTOR * bcp->uvhub_cpu;
751752 bau_uvhubs_clear(&bau_desc->distribution, UV_DISTRIBUTION_SIZE);
752753
753− /* cpu statistics */
754754 for_each_cpu(tcpu, flush_mask) {
755− uvhub = uv_cpu_to_blade_id(tcpu);
756− bau_uvhub_set(uvhub, &bau_desc->distribution);
757− if (uvhub == bcp->uvhub)
755+ /*
756+ * The distribution vector is a bit map of pnodes, relative
757+ * to the partition base pnode (and the partition base nasid
758+ * in the header).
759+ * Translate cpu to pnode and hub using an array stored
760+ * in local memory.
761+ */
762+ hpp = &bcp->socket_master->target_hub_and_pnode[tcpu];
763+ tpnode = hpp->pnode - bcp->partition_base_pnode;
764+ bau_uvhub_set(tpnode, &bau_desc->distribution);
765+ if (hpp->uvhub == bcp->uvhub)
758766 locals++;
759767 else
760768 remotes++;
@@ -855,7 +863,7 @@ void uv_bau_message_interrupt(struct pt_regs *regs) · 94 unmodified lines
855863 * an interrupt, but causes an error message to be returned to
856864 * the sender.
857865 */
858−static void uv_enable_timeouts(void)
866+static void __init uv_enable_timeouts(void)
859867 {
860868 int uvhub;
861869 int nuvhubs;
@@ -1326,10 +1334,10 @@ static int __init uv_ptc_init(void) · 464 unmodified lines
13261334 }
13271335
13281336 /*
1329− * initialize the sending side's sending buffers
1337+ * Initialize the sending side's sending buffers.
13301338 */
13311339 static void
1332−uv_activation_descriptor_init(int node, int pnode)
1340+uv_activation_descriptor_init(int node, int pnode, int base_pnode)
13331341 {
13341342 int i;
13351343 int cpu;
@@ -1352,11 +1360,11 @@ uv_activation_descriptor_init(int node, int pnode) · 16 unmodified lines
13521360 n = pa >> uv_nshift;
13531361 m = pa & uv_mmask;
13541362
1363+ /* the 14-bit pnode */
13551364 uv_write_global_mmr64(pnode, UVH_LB_BAU_SB_DESCRIPTOR_BASE,
13561365 (n << UV_DESC_BASE_PNODE_SHIFT | m));
1357−
13581366 /*
1359− * initializing all 8 (UV_ITEMS_PER_DESCRIPTOR) descriptors for each
1367+ * Initializing all 8 (UV_ITEMS_PER_DESCRIPTOR) descriptors for each
13601368 * cpu even though we only use the first one; one descriptor can
13611369 * describe a broadcast to 256 uv hubs.
13621370 */
@@ -1365,12 +1373,13 @@ uv_activation_descriptor_init(int node, int pnode) · 2 unmodified lines
13651373 memset(bd2, 0, sizeof(struct bau_desc));
13661374 bd2->header.sw_ack_flag = 1;
13671375 /*
1368− * base_dest_nodeid is the nasid of the first uvhub
1369− * in the partition. The bit map will indicate uvhub numbers,
1370− * which are 0-N in a partition. Pnodes are unique system-wide.
1376+ * The base_dest_nasid set in the message header is the nasid
1377+ * of the first uvhub in the partition. The bit map will
1378+ * indicate destination pnode numbers relative to that base.
1379+ * They may not be consecutive if nasid striding is being used.
13711380 */
1372− bd2->header.base_dest_nodeid = UV_PNODE_TO_NASID(uv_partition_base_pnode);
1373− bd2->header.dest_subnodeid = 0x10; /* the LB */
1381+ bd2->header.base_dest_nasid = UV_PNODE_TO_NASID(base_pnode);
1382+ bd2->header.dest_subnodeid = UV_LB_SUBNODEID;
13741383 bd2->header.command = UV_NET_ENDPOINT_INTD;
13751384 bd2->header.int_both = 1;
13761385 /*
@@ -1442,7 +1451,7 @@ uv_payload_queue_init(int node, int pnode) · 65 unmodified lines
14421451 /*
14431452 * Initialization of each UV hub's structures
14441453 */
1445−static void __init uv_init_uvhub(int uvhub, int vector)
1454+static void __init uv_init_uvhub(int uvhub, int vector, int base_pnode)
14461455 {
14471456 int node;
14481457 int pnode;
@@ -1450,11 +1459,11 @@ static void __init uv_init_uvhub(int uvhub, int vector) · 1 unmodified line
14501459
14511460 node = uvhub_to_first_node(uvhub);
14521461 pnode = uv_blade_to_pnode(uvhub);
1453− uv_activation_descriptor_init(node, pnode);
1462+ uv_activation_descriptor_init(node, pnode, base_pnode);
14541463 uv_payload_queue_init(node, pnode);
14551464 /*
1456− * the below initialization can't be in firmware because the
1457− * messaging IRQ will be determined by the OS
1465+ * The below initialization can't be in firmware because the
1466+ * messaging IRQ will be determined by the OS.
14581467 */
14591468 apicid = uvhub_to_first_apicid(uvhub) | uv_apicid_hibits;
14601469 uv_write_global_mmr64(pnode, UVH_BAU_DATA_CONFIG,
@@ -1491,10 +1500,11 @@ calculate_destination_timeout(void) · 30 unmodified lines
14911500 /*
14921501 * initialize the bau_control structure for each cpu
14931502 */
1494−static int __init uv_init_per_cpu(int nuvhubs)
1503+static int __init uv_init_per_cpu(int nuvhubs, int base_part_pnode)
14951504 {
14961505 int i;
14971506 int cpu;
1507+ int tcpu;
14981508 int pnode;
14991509 int uvhub;
15001510 int have_hmaster;
@@ -1528,6 +1538,15 @@ static int __init uv_init_per_cpu(int nuvhubs) · 27 unmodified lines
15281538 bcp = &per_cpu(bau_control, cpu);
15291539 memset(bcp, 0, sizeof(struct bau_control));
15301540 pnode = uv_cpu_hub_info(cpu)->pnode;
1541+ if ((pnode - base_part_pnode) >= UV_DISTRIBUTION_SIZE) {
1542+ printk(KERN_EMERG
1543+ "cpu %d pnode %d-%d beyond %d; BAU disabled\n",
1544+ cpu, pnode, base_part_pnode,
1545+ UV_DISTRIBUTION_SIZE);
1546+ return 1;
1547+ }
1548+ bcp->osnode = cpu_to_node(cpu);
1549+ bcp->partition_base_pnode = uv_partition_base_pnode;
15311550 uvhub = uv_cpu_hub_info(cpu)->numa_blade_id;
15321551 *(uvhub_mask + (uvhub/8)) |= (1 << (uvhub%8));
15331552 bdp = &uvhub_descs[uvhub];
@@ -1536,7 +1555,7 @@ static int __init uv_init_per_cpu(int nuvhubs) · 2 unmodified lines
15361555 bdp->pnode = pnode;
15371556 /* kludge: 'assuming' one node per socket, and assuming that
15381557 disabling a socket just leaves a gap in node numbers */
1539− socket = (cpu_to_node(cpu) & 1);
1558+ socket = bcp->osnode & 1;
15401559 bdp->socket_mask |= (1 << socket);
15411560 sdp = &bdp->socket[socket];
15421561 sdp->cpu_number[sdp->num_cpus] = cpu;
@@ -1585,6 +1604,20 @@ static int __init uv_init_per_cpu(int nuvhubs) · 42 unmodified lines
15851604 nextsocket:
15861605 socket++;
15871606 socket_mask = (socket_mask >> 1);
1607+ /* each socket gets a local array of pnodes/hubs */
1608+ bcp = smaster;
1609+ bcp->target_hub_and_pnode = kmalloc_node(
1610+ sizeof(struct hub_and_pnode) *
1611+ num_possible_cpus(), GFP_KERNEL, bcp->osnode);
1612+ memset(bcp->target_hub_and_pnode, 0,
1613+ sizeof(struct hub_and_pnode) *
1614+ num_possible_cpus());
1615+ for_each_present_cpu(tcpu) {
1616+ bcp->target_hub_and_pnode[tcpu].pnode =
1617+ uv_cpu_hub_info(tcpu)->pnode;
1618+ bcp->target_hub_and_pnode[tcpu].uvhub =
1619+ uv_cpu_hub_info(tcpu)->numa_blade_id;
1620+ }
15881621 }
15891622 }
15901623 kfree(uvhub_descs);
@@ -1637,21 +1670,22 @@ static int __init uv_bau_init(void) · 46 unmodified lines
16371670 spin_lock_init(&disable_lock);
16381671 congested_cycles = microsec_2_cycles(congested_response_us);
16391672
1640− if (uv_init_per_cpu(nuvhubs)) {
1641− nobau = 1;
1642− return 0;
1643− }
1644−
16451673 uv_partition_base_pnode = 0x7fffffff;
1646− for (uvhub = 0; uvhub < nuvhubs; uvhub++)
1674+ for (uvhub = 0; uvhub < nuvhubs; uvhub++) {
16471675 if (uv_blade_nr_possible_cpus(uvhub) &&
16481676 (uv_blade_to_pnode(uvhub) < uv_partition_base_pnode))
16491677 uv_partition_base_pnode = uv_blade_to_pnode(uvhub);
1678+ }
1679+
1680+ if (uv_init_per_cpu(nuvhubs, uv_partition_base_pnode)) {
1681+ nobau = 1;
1682+ return 0;
1683+ }
16501684
16511685 vector = UV_BAU_MESSAGE;
16521686 for_each_possible_blade(uvhub)
16531687 if (uv_blade_nr_possible_cpus(uvhub))
1654− uv_init_uvhub(uvhub, vector);
1688+ uv_init_uvhub(uvhub, vector, uv_partition_base_pnode);
16551689
16561690 uv_enable_timeouts();
16571691 alloc_intr_gate(vector, uv_bau_message_intr1);
arch/x86/xen/mmu.c+25−5
@@ -1275,6 +1275,20 @@ static __init void xen_pagetable_setup_start(pgd_t *base) · 1274 unmodified lines
12751275 {
12761276 }
12771277
1278+static __init void xen_mapping_pagetable_reserve(u64 start, u64 end)
1279+{
1280+ /* reserve the range used */
1281+ native_pagetable_reserve(start, end);
1282+
1283+ /* set as RW the rest */
1284+ printk(KERN_DEBUG "xen: setting RW the range %llx - %llx\n", end,
1285+ PFN_PHYS(pgt_buf_top));
1286+ while (end < PFN_PHYS(pgt_buf_top)) {
1287+ make_lowmem_page_readwrite(__va(end));
1288+ end += PAGE_SIZE;
1289+ }
1290+}
1291+
12781292 static void xen_post_allocator_init(void);
12791293
12801294 static __init void xen_pagetable_setup_done(pgd_t *base)
@@ -1473,16 +1487,20 @@ static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd) · 192 unmodified lines
14731487 #endif
14741488 }
14751489
1490+#ifdef CONFIG_X86_32
14761491 static __init pte_t mask_rw_pte(pte_t *ptep, pte_t pte)
14771492 {
1478− unsigned long pfn = pte_pfn(pte);
1479−
1480−#ifdef CONFIG_X86_32
14811493 /* If there's an existing pte, then don't allow _PAGE_RW to be set */
14821494 if (pte_val_ma(*ptep) & _PAGE_PRESENT)
14831495 pte = __pte_ma(((pte_val_ma(*ptep) & _PAGE_RW) | ~_PAGE_RW) &
14841496 pte_val_ma(pte));
1485−#endif
1497+
1498+ return pte;
1499+}
1500+#else /* CONFIG_X86_64 */
1501+static __init pte_t mask_rw_pte(pte_t *ptep, pte_t pte)
1502+{
1503+ unsigned long pfn = pte_pfn(pte);
14861504
14871505 /*
14881506 * If the new pfn is within the range of the newly allocated
@@ -1491,12 +1509,13 @@ static __init pte_t mask_rw_pte(pte_t *ptep, pte_t pte) · 2 unmodified lines
14911509 * it is RO.
14921510 */
14931511 if (((!is_early_ioremap_ptep(ptep) &&
1494− pfn >= pgt_buf_start && pfn < pgt_buf_end)) ||
1512+ pfn >= pgt_buf_start && pfn < pgt_buf_top)) ||
14951513 (is_early_ioremap_ptep(ptep) && pfn != (pgt_buf_end - 1)))
14961514 pte = pte_wrprotect(pte);
14971515
14981516 return pte;
14991517 }
1518+#endif /* CONFIG_X86_64 */
15001519
15011520 /* Init-time set_pte while constructing initial pagetables, which
15021521 doesn't allow RO pagetable pages to be remapped RW */
@@ -2100,6 +2119,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = { · 597 unmodified lines
21002119
21012120 void __init xen_init_mmu_ops(void)
21022121 {
2122+ x86_init.mapping.pagetable_reserve = xen_mapping_pagetable_reserve;
21032123 x86_init.paging.pagetable_setup_start = xen_pagetable_setup_start;
21042124 x86_init.paging.pagetable_setup_done = xen_pagetable_setup_done;
21052125 pv_mmu_ops = xen_mmu_ops;
arch/x86/xen/setup.c+1−1
@@ -227,7 +227,7 @@ char * __init xen_memory_setup(void) · 226 unmodified lines
227227
228228 memcpy(map_raw, map, sizeof(map));
229229 e820.nr_map = 0;
230− xen_extra_mem_start = mem_end;
230+ xen_extra_mem_start = max((1ULL << 32), mem_end);
231231 for (i = 0; i < memmap.nr_entries; i++) {
232232 unsigned long long end;
233233
arch/xtensa/kernel/irq.c+6−12
@@ -64,47 +64,41 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs) · 63 unmodified lines
6464
6565 int arch_show_interrupts(struct seq_file *p, int prec)
6666 {
67− int j;
68−
69− seq_printf(p, "%*s: ", prec, "NMI");
70− for_each_online_cpu(j)
71− seq_printf(p, "%10u ", nmi_count(j));
72− seq_putc(p, '\n');
7367 seq_printf(p, "%*s: ", prec, "ERR");
7468 seq_printf(p, "%10u\n", atomic_read(&irq_err_count));
7569 return 0;
7670 }
7771
78−static void xtensa_irq_mask(struct irq_chip *d)
72+static void xtensa_irq_mask(struct irq_data *d)
7973 {
8074 cached_irq_mask &= ~(1 << d->irq);
8175 set_sr (cached_irq_mask, INTENABLE);
8276 }
8377
84−static void xtensa_irq_unmask(struct irq_chip *d)
78+static void xtensa_irq_unmask(struct irq_data *d)
8579 {
8680 cached_irq_mask |= 1 << d->irq;
8781 set_sr (cached_irq_mask, INTENABLE);
8882 }
8983
90−static void xtensa_irq_enable(struct irq_chip *d)
84+static void xtensa_irq_enable(struct irq_data *d)
9185 {
9286 variant_irq_enable(d->irq);
9387 xtensa_irq_unmask(d->irq);
9488 }
9589
96−static void xtensa_irq_disable(struct irq_chip *d)
90+static void xtensa_irq_disable(struct irq_data *d)
9791 {
9892 xtensa_irq_mask(d->irq);
9993 variant_irq_disable(d->irq);
10094 }
10195
102−static void xtensa_irq_ack(struct irq_chip *d)
96+static void xtensa_irq_ack(struct irq_data *d)
10397 {
10498 set_sr(1 << d->irq, INTCLEAR);
10599 }
106100
107−static int xtensa_irq_retrigger(struct irq_chip *d)
101+static int xtensa_irq_retrigger(struct irq_data *d)
108102 {
109103 set_sr (1 << d->irq, INTSET);
110104 return 1;
block/blk-cgroup.c+7−0
@@ -114,6 +114,13 @@ struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) · 113 unmodified lines
114114 }
115115 EXPORT_SYMBOL_GPL(cgroup_to_blkio_cgroup);
116116
117+struct blkio_cgroup *task_blkio_cgroup(struct task_struct *tsk)
118+{
119+ return container_of(task_subsys_state(tsk, blkio_subsys_id),
120+ struct blkio_cgroup, css);
121+}
122+EXPORT_SYMBOL_GPL(task_blkio_cgroup);
123+
117124 static inline void
118125 blkio_update_group_weight(struct blkio_group *blkg, unsigned int weight)
119126 {
block/blk-cgroup.h+3−0
@@ -291,6 +291,7 @@ static inline void blkiocg_set_start_empty_time(struct blkio_group *blkg) {} · 290 unmodified lines
291291 #if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
292292 extern struct blkio_cgroup blkio_root_cgroup;
293293 extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup);
294+extern struct blkio_cgroup *task_blkio_cgroup(struct task_struct *tsk);
294295 extern void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
295296 struct blkio_group *blkg, void *key, dev_t dev,
296297 enum blkio_policy_id plid);
@@ -314,6 +315,8 @@ void blkiocg_update_io_remove_stats(struct blkio_group *blkg, · 17 unmodified lines
314315 struct cgroup;
315316 static inline struct blkio_cgroup *
316317 cgroup_to_blkio_cgroup(struct cgroup *cgroup) { return NULL; }
318+static inline struct blkio_cgroup *
319+task_blkio_cgroup(struct task_struct *tsk) { return NULL; }
317320
318321 static inline void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
319322 struct blkio_group *blkg, void *key, dev_t dev,
block/blk-core.c+5−12
@@ -292,7 +292,6 @@ EXPORT_SYMBOL(blk_sync_queue); · 291 unmodified lines
292292 /**
293293 * __blk_run_queue - run a single device queue
294294 * @q: The queue to run
295− * @force_kblockd: Don't run @q->request_fn directly. Use kblockd.
296295 *
297296 * Description:
298297 * See @blk_run_queue. This variant must be called with the queue lock
@@ -303,15 +302,7 @@ void __blk_run_queue(struct request_queue *q) · 4 unmodified lines
303302 if (unlikely(blk_queue_stopped(q)))
304303 return;
305304
306− /*
307− * Only recurse once to avoid overrunning the stack, let the unplug
308− * handling reinvoke the handler shortly if we already got there.
309− */
310− if (!queue_flag_test_and_set(QUEUE_FLAG_REENTER, q)) {
311− q->request_fn(q);
312− queue_flag_clear(QUEUE_FLAG_REENTER, q);
313− } else
314− queue_delayed_work(kblockd_workqueue, &q->delay_work, 0);
305+ q->request_fn(q);
315306 }
316307 EXPORT_SYMBOL(__blk_run_queue);
317308
@@ -325,9 +316,12 @@ EXPORT_SYMBOL(__blk_run_queue); · 7 unmodified lines
325316 */
326317 void blk_run_queue_async(struct request_queue *q)
327318 {
328− if (likely(!blk_queue_stopped(q)))
319+ if (likely(!blk_queue_stopped(q))) {
320+ __cancel_delayed_work(&q->delay_work);
329321 queue_delayed_work(kblockd_workqueue, &q->delay_work, 0);
322+ }
330323 }
324+EXPORT_SYMBOL(blk_run_queue_async);
331325
332326 /**
333327 * blk_run_queue - run a single device queue
@@ -2787,7 +2781,6 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) · 2453 unmodified lines
27872781
27882782 local_irq_restore(flags);
27892783 }
2790−EXPORT_SYMBOL(blk_flush_plug_list);
27912784
27922785 void blk_finish_plug(struct blk_plug *plug)
27932786 {
block/blk-sysfs.c+5−3
@@ -66,14 +66,14 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count) · 65 unmodified lines
6666
6767 if (rl->count[BLK_RW_SYNC] >= q->nr_requests) {
6868 blk_set_queue_full(q, BLK_RW_SYNC);
69− } else if (rl->count[BLK_RW_SYNC]+1 <= q->nr_requests) {
69+ } else {
7070 blk_clear_queue_full(q, BLK_RW_SYNC);
7171 wake_up(&rl->wait[BLK_RW_SYNC]);
7272 }
7373
7474 if (rl->count[BLK_RW_ASYNC] >= q->nr_requests) {
7575 blk_set_queue_full(q, BLK_RW_ASYNC);
76− } else if (rl->count[BLK_RW_ASYNC]+1 <= q->nr_requests) {
76+ } else {
7777 blk_clear_queue_full(q, BLK_RW_ASYNC);
7878 wake_up(&rl->wait[BLK_RW_ASYNC]);
7979 }
@@ -509,8 +509,10 @@ int blk_register_queue(struct gendisk *disk) · 429 unmodified lines
509509 return ret;
510510
511511 ret = kobject_add(&q->kobj, kobject_get(&dev->kobj), "%s", "queue");
512− if (ret < 0)
512+ if (ret < 0) {
513+ blk_trace_remove_sysfs(dev);
513514 return ret;
515+ }
514516
515517 kobject_uevent(&q->kobj, KOBJ_ADD);
516518
block/blk-throttle.c+4−5
@@ -160,9 +160,8 @@ static void throtl_put_tg(struct throtl_grp *tg) · 159 unmodified lines
160160 }
161161
162162 static struct throtl_grp * throtl_find_alloc_tg(struct throtl_data *td,
163− struct cgroup *cgroup)
163+ struct blkio_cgroup *blkcg)
164164 {
165− struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgroup);
166165 struct throtl_grp *tg = NULL;
167166 void *key = td;
168167 struct backing_dev_info *bdi = &td->queue->backing_dev_info;
@@ -229,12 +228,12 @@ done: · 60 unmodified lines
229228
230229 static struct throtl_grp * throtl_get_tg(struct throtl_data *td)
231230 {
232− struct cgroup *cgroup;
233231 struct throtl_grp *tg = NULL;
232+ struct blkio_cgroup *blkcg;
234233
235234 rcu_read_lock();
236− cgroup = task_cgroup(current, blkio_subsys_id);
237− tg = throtl_find_alloc_tg(td, cgroup);
235+ blkcg = task_blkio_cgroup(current);
236+ tg = throtl_find_alloc_tg(td, blkcg);
238237 if (!tg)
239238 tg = &td->root_tg;
240239 rcu_read_unlock();
block/blk.h+0−1
@@ -22,7 +22,6 @@ void blk_rq_timed_out_timer(unsigned long data); · 21 unmodified lines
2222 void blk_delete_timer(struct request *);
2323 void blk_add_timer(struct request *);
2424 void __generic_unplug_device(struct request_queue *);
25−void blk_run_queue_async(struct request_queue *q);
2625
2726 /*
2827 * Internal atomic flags for request handling
block/cfq-iosched.c+11−20
@@ -1014,10 +1014,9 @@ void cfq_update_blkio_group_weight(void *key, struct blkio_group *blkg, · 1013 unmodified lines
10141014 cfqg->needs_update = true;
10151015 }
10161016
1017−static struct cfq_group *
1018−cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
1017+static struct cfq_group * cfq_find_alloc_cfqg(struct cfq_data *cfqd,
1018+ struct blkio_cgroup *blkcg, int create)
10191019 {
1020− struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgroup);
10211020 struct cfq_group *cfqg = NULL;
10221021 void *key = cfqd;
10231022 int i, j;
@@ -1079,12 +1078,12 @@ done: · 55 unmodified lines
10791078 */
10801079 static struct cfq_group *cfq_get_cfqg(struct cfq_data *cfqd, int create)
10811080 {
1082− struct cgroup *cgroup;
1081+ struct blkio_cgroup *blkcg;
10831082 struct cfq_group *cfqg = NULL;
10841083
10851084 rcu_read_lock();
1086− cgroup = task_cgroup(current, blkio_subsys_id);
1087− cfqg = cfq_find_alloc_cfqg(cfqd, cgroup, create);
1085+ blkcg = task_blkio_cgroup(current);
1086+ cfqg = cfq_find_alloc_cfqg(cfqd, blkcg, create);
10881087 if (!cfqg && create)
10891088 cfqg = &cfqd->root_group;
10901089 rcu_read_unlock();
@@ -2582,28 +2581,20 @@ static void cfq_put_queue(struct cfq_queue *cfqq) · 1491 unmodified lines
25822581 }
25832582
25842583 /*
2585− * Must always be called with the rcu_read_lock() held
2584+ * Call func for each cic attached to this ioc.
25862585 */
25872586 static void
2588−__call_for_each_cic(struct io_context *ioc,
2589− void (*func)(struct io_context *, struct cfq_io_context *))
2587+call_for_each_cic(struct io_context *ioc,
2588+ void (*func)(struct io_context *, struct cfq_io_context *))
25902589 {
25912590 struct cfq_io_context *cic;
25922591 struct hlist_node *n;
25932592
2593+ rcu_read_lock();
2594+
25942595 hlist_for_each_entry_rcu(cic, n, &ioc->cic_list, cic_list)
25952596 func(ioc, cic);
2596−}
25972597
2598−/*
2599− * Call func for each cic attached to this ioc.
2600− */
2601−static void
2602−call_for_each_cic(struct io_context *ioc,
2603− void (*func)(struct io_context *, struct cfq_io_context *))
2604−{
2605− rcu_read_lock();
2606− __call_for_each_cic(ioc, func);
26072598 rcu_read_unlock();
26082599 }
26092600
@@ -2664,7 +2655,7 @@ static void cfq_free_io_context(struct io_context *ioc) · 54 unmodified lines
26642655 * should be ok to iterate over the known list, we will see all cic's
26652656 * since no new ones are added.
26662657 */
2667− __call_for_each_cic(ioc, cic_free_func);
2658+ call_for_each_cic(ioc, cic_free_func);
26682659 }
26692660
26702661 static void cfq_put_cooperator(struct cfq_queue *cfqq)
block/elevator.c+2−1
@@ -666,7 +666,8 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where) · 665 unmodified lines
666666 q->boundary_rq = rq;
667667 }
668668 } else if (!(rq->cmd_flags & REQ_ELVPRIV) &&
669− where == ELEVATOR_INSERT_SORT)
669+ (where == ELEVATOR_INSERT_SORT ||
670+ where == ELEVATOR_INSERT_SORT_MERGE))
670671 where = ELEVATOR_INSERT_BACK;
671672
672673 switch (where) {
block/genhd.c+6−2
@@ -1588,9 +1588,13 @@ static void disk_events_workfn(struct work_struct *work) · 1587 unmodified lines
15881588
15891589 spin_unlock_irq(&ev->lock);
15901590
1591− /* tell userland about new events */
1591+ /*
1592+ * Tell userland about new events. Only the events listed in
1593+ * @disk->events are reported. Unlisted events are processed the
1594+ * same internally but never get reported to userland.
1595+ */
15921596 for (i = 0; i < ARRAY_SIZE(disk_uevents); i++)
1593− if (events & (1 << i))
1597+ if (events & disk->events & (1 << i))
15941598 envp[nr_events++] = disk_uevents[i];
15951599
15961600 if (nr_events)
drivers/acpi/scan.c+4−0
@@ -943,6 +943,10 @@ static int acpi_bus_get_flags(struct acpi_device *device) · 942 unmodified lines
943943 if (ACPI_SUCCESS(status))
944944 device->flags.lockable = 1;
945945
946+ /* Power resources cannot be power manageable. */
947+ if (device->device_type == ACPI_BUS_TYPE_POWER)
948+ return 0;
949+
946950 /* Presence of _PS0|_PR0 indicates 'power manageable' */
947951 status = acpi_get_handle(device->handle, "_PS0", &temp);
948952 if (ACPI_FAILURE(status))
drivers/ata/ahci.c+7−1
@@ -150,7 +150,7 @@ static const struct ata_port_info ahci_port_info[] = { · 149 unmodified lines
150150 {
151151 AHCI_HFLAGS (AHCI_HFLAG_NO_FPDMA_AA | AHCI_HFLAG_NO_PMP |
152152 AHCI_HFLAG_YES_NCQ),
153− .flags = AHCI_FLAG_COMMON,
153+ .flags = AHCI_FLAG_COMMON | ATA_FLAG_NO_DIPM,
154154 .pio_mask = ATA_PIO4,
155155 .udma_mask = ATA_UDMA6,
156156 .port_ops = &ahci_ops,
@@ -261,6 +261,12 @@ static const struct pci_device_id ahci_pci_tbl[] = { · 104 unmodified lines
261261 { PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
262262 { PCI_VDEVICE(INTEL, 0x2826), board_ahci }, /* PBG RAID */
263263 { PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */
264+ { PCI_VDEVICE(INTEL, 0x1e02), board_ahci }, /* Panther Point AHCI */
265+ { PCI_VDEVICE(INTEL, 0x1e03), board_ahci }, /* Panther Point AHCI */
266+ { PCI_VDEVICE(INTEL, 0x1e04), board_ahci }, /* Panther Point RAID */
267+ { PCI_VDEVICE(INTEL, 0x1e05), board_ahci }, /* Panther Point RAID */
268+ { PCI_VDEVICE(INTEL, 0x1e06), board_ahci }, /* Panther Point RAID */
269+ { PCI_VDEVICE(INTEL, 0x1e07), board_ahci }, /* Panther Point RAID */
264270
265271 /* JMicron 360/1/3/5/6, match class to avoid IDE function */
266272 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
drivers/ata/ahci.h+4−0
@@ -229,6 +229,10 @@ enum { · 228 unmodified lines
229229 EM_CTL_ALHD = (1 << 26), /* Activity LED */
230230 EM_CTL_XMT = (1 << 25), /* Transmit Only */
231231 EM_CTL_SMB = (1 << 24), /* Single Message Buffer */
232+ EM_CTL_SGPIO = (1 << 19), /* SGPIO messages supported */
233+ EM_CTL_SES = (1 << 18), /* SES-2 messages supported */
234+ EM_CTL_SAFTE = (1 << 17), /* SAF-TE messages supported */
235+ EM_CTL_LED = (1 << 16), /* LED messages supported */
232236
233237 /* em message type */
234238 EM_MSG_TYPE_LED = (1 << 0), /* LED */
drivers/ata/ata_piix.c+8−0
@@ -309,6 +309,14 @@ static const struct pci_device_id piix_pci_tbl[] = { · 308 unmodified lines
309309 { 0x8086, 0x1d00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata },
310310 /* SATA Controller IDE (PBG) */
311311 { 0x8086, 0x1d08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
312+ /* SATA Controller IDE (Panther Point) */
313+ { 0x8086, 0x1e00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata },
314+ /* SATA Controller IDE (Panther Point) */
315+ { 0x8086, 0x1e01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata },
316+ /* SATA Controller IDE (Panther Point) */
317+ { 0x8086, 0x1e08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
318+ /* SATA Controller IDE (Panther Point) */
319+ { 0x8086, 0x1e09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
312320 { } /* terminate list */
313321 };
314322
drivers/ata/libahci.c+37−2
@@ -109,6 +109,8 @@ static ssize_t ahci_read_em_buffer(struct device *dev, · 108 unmodified lines
109109 static ssize_t ahci_store_em_buffer(struct device *dev,
110110 struct device_attribute *attr,
111111 const char *buf, size_t size);
112+static ssize_t ahci_show_em_supported(struct device *dev,
113+ struct device_attribute *attr, char *buf);
112114
113115 static DEVICE_ATTR(ahci_host_caps, S_IRUGO, ahci_show_host_caps, NULL);
114116 static DEVICE_ATTR(ahci_host_cap2, S_IRUGO, ahci_show_host_cap2, NULL);
@@ -116,6 +118,7 @@ static DEVICE_ATTR(ahci_host_version, S_IRUGO, ahci_show_host_version, NULL); · 1 unmodified line
116118 static DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL);
117119 static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO,
118120 ahci_read_em_buffer, ahci_store_em_buffer);
121+static DEVICE_ATTR(em_message_supported, S_IRUGO, ahci_show_em_supported, NULL);
119122
120123 struct device_attribute *ahci_shost_attrs[] = {
121124 &dev_attr_link_power_management_policy,
@@ -126,6 +129,7 @@ struct device_attribute *ahci_shost_attrs[] = { · 4 unmodified lines
126129 &dev_attr_ahci_host_version,
127130 &dev_attr_ahci_port_cmd,
128131 &dev_attr_em_buffer,
132+ &dev_attr_em_message_supported,
129133 NULL
130134 };
131135 EXPORT_SYMBOL_GPL(ahci_shost_attrs);
@@ -343,6 +347,24 @@ static ssize_t ahci_store_em_buffer(struct device *dev, · 211 unmodified lines
343347 return size;
344348 }
345349
350+static ssize_t ahci_show_em_supported(struct device *dev,
351+ struct device_attribute *attr, char *buf)
352+{
353+ struct Scsi_Host *shost = class_to_shost(dev);
354+ struct ata_port *ap = ata_shost_to_port(shost);
355+ struct ahci_host_priv *hpriv = ap->host->private_data;
356+ void __iomem *mmio = hpriv->mmio;
357+ u32 em_ctl;
358+
359+ em_ctl = readl(mmio + HOST_EM_CTL);
360+
361+ return sprintf(buf, "%s%s%s%s\n",
362+ em_ctl & EM_CTL_LED ? "led " : "",
363+ em_ctl & EM_CTL_SAFTE ? "saf-te " : "",
364+ em_ctl & EM_CTL_SES ? "ses-2 " : "",
365+ em_ctl & EM_CTL_SGPIO ? "sgpio " : "");
366+}
367+
346368 /**
347369 * ahci_save_initial_config - Save and fixup initial config values
348370 * @dev: target AHCI device
@@ -1897,7 +1919,17 @@ static void ahci_pmp_attach(struct ata_port *ap) · 1548 unmodified lines
18971919 ahci_enable_fbs(ap);
18981920
18991921 pp->intr_mask |= PORT_IRQ_BAD_PMP;
1900− writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
1922+
1923+ /*
1924+ * We must not change the port interrupt mask register if the
1925+ * port is marked frozen, the value in pp->intr_mask will be
1926+ * restored later when the port is thawed.
1927+ *
1928+ * Note that during initialization, the port is marked as
1929+ * frozen since the irq handler is not yet registered.
1930+ */
1931+ if (!(ap->pflags & ATA_PFLAG_FROZEN))
1932+ writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
19011933 }
19021934
19031935 static void ahci_pmp_detach(struct ata_port *ap)
@@ -1913,7 +1945,10 @@ static void ahci_pmp_detach(struct ata_port *ap) · 9 unmodified lines
19131945 writel(cmd, port_mmio + PORT_CMD);
19141946
19151947 pp->intr_mask &= ~PORT_IRQ_BAD_PMP;
1916− writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
1948+
1949+ /* see comment above in ahci_pmp_attach() */
1950+ if (!(ap->pflags & ATA_PFLAG_FROZEN))
1951+ writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
19171952 }
19181953
19191954 int ahci_port_resume(struct ata_port *ap)
drivers/ata/libata-core.c+2−1
@@ -4139,6 +4139,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 4138 unmodified lines
41394139 */
41404140 { "PIONEER DVD-RW DVRTD08", "1.00", ATA_HORKAGE_NOSETXFER },
41414141 { "PIONEER DVD-RW DVR-212D", "1.28", ATA_HORKAGE_NOSETXFER },
4142+ { "PIONEER DVD-RW DVR-216D", "1.08", ATA_HORKAGE_NOSETXFER },
41424143
41434144 /* End Marker */
41444145 { }
@@ -5480,7 +5481,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host) · 1335 unmodified lines
54805481 if (!ap)
54815482 return NULL;
54825483
5483− ap->pflags |= ATA_PFLAG_INITIALIZING;
5484+ ap->pflags |= ATA_PFLAG_INITIALIZING | ATA_PFLAG_FROZEN;
54845485 ap->lock = &host->lock;
54855486 ap->print_id = -1;
54865487 ap->host = host;
drivers/ata/libata-eh.c+4−2
@@ -3316,6 +3316,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, · 3315 unmodified lines
33163316 struct ata_eh_context *ehc = &link->eh_context;
33173317 struct ata_device *dev, *link_dev = NULL, *lpm_dev = NULL;
33183318 enum ata_lpm_policy old_policy = link->lpm_policy;
3319+ bool no_dipm = link->ap->flags & ATA_FLAG_NO_DIPM;
33193320 unsigned int hints = ATA_LPM_EMPTY | ATA_LPM_HIPM;
33203321 unsigned int err_mask;
33213322 int rc;
@@ -3332,7 +3333,7 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, · 10 unmodified lines
33323333 */
33333334 ata_for_each_dev(dev, link, ENABLED) {
33343335 bool hipm = ata_id_has_hipm(dev->id);
3335− bool dipm = ata_id_has_dipm(dev->id);
3336+ bool dipm = ata_id_has_dipm(dev->id) && !no_dipm;
33363337
33373338 /* find the first enabled and LPM enabled devices */
33383339 if (!link_dev)
@@ -3389,7 +3390,8 @@ static int ata_eh_set_lpm(struct ata_link *link, enum ata_lpm_policy policy, · 50 unmodified lines
33893390
33903391 /* host config updated, enable DIPM if transitioning to MIN_POWER */
33913392 ata_for_each_dev(dev, link, ENABLED) {
3392− if (policy == ATA_LPM_MIN_POWER && ata_id_has_dipm(dev->id)) {
3393+ if (policy == ATA_LPM_MIN_POWER && !no_dipm &&
3394+ ata_id_has_dipm(dev->id)) {
33933395 err_mask = ata_dev_set_feature(dev,
33943396 SETFEATURES_SATA_ENABLE, SATA_DIPM);
33953397 if (err_mask && err_mask != AC_ERR_DEV) {
drivers/ata/pata_at91.c+19−3
@@ -33,11 +33,12 @@ · 32 unmodified lines
3333
3434
3535 #define DRV_NAME "pata_at91"
36−#define DRV_VERSION "0.1"
36+#define DRV_VERSION "0.2"
3737
3838 #define CF_IDE_OFFSET 0x00c00000
3939 #define CF_ALT_IDE_OFFSET 0x00e00000
4040 #define CF_IDE_RES_SIZE 0x08
41+#define NCS_RD_PULSE_LIMIT 0x3f /* maximal value for pulse bitfields */
4142
4243 struct at91_ide_info {
4344 unsigned long mode;
@@ -49,8 +50,18 @@ struct at91_ide_info { · 5 unmodified lines
4950 void __iomem *alt_addr;
5051 };
5152
52−static const struct ata_timing initial_timing =
53− {XFER_PIO_0, 70, 290, 240, 600, 165, 150, 600, 0};
53+static const struct ata_timing initial_timing = {
54+ .mode = XFER_PIO_0,
55+ .setup = 70,
56+ .act8b = 290,
57+ .rec8b = 240,
58+ .cyc8b = 600,
59+ .active = 165,
60+ .recover = 150,
61+ .dmack_hold = 0,
62+ .cycle = 600,
63+ .udma = 0
64+};
5465
5566 static unsigned long calc_mck_cycles(unsigned long ns, unsigned long mck_hz)
5667 {
@@ -109,6 +120,11 @@ static void set_smc_timing(struct device *dev, · 52 unmodified lines
109120 /* (CS0, CS1, DIR, OE) <= (CFCE1, CFCE2, CFRNW, NCSX) timings */
110121 ncs_read_setup = 1;
111122 ncs_read_pulse = read_cycle - 2;
123+ if (ncs_read_pulse > NCS_RD_PULSE_LIMIT) {
124+ ncs_read_pulse = NCS_RD_PULSE_LIMIT;
125+ dev_warn(dev, "ncs_read_pulse limited to maximal value %lu\n",
126+ ncs_read_pulse);
127+ }
112128
113129 /* Write timings same as read timings */
114130 write_cycle = read_cycle;
drivers/atm/fore200e.c+5−2
@@ -2643,16 +2643,19 @@ fore200e_init(struct fore200e* fore200e, struct device *parent) · 2642 unmodified lines
26432643 }
26442644
26452645 #ifdef CONFIG_SBUS
2646+static const struct of_device_id fore200e_sba_match[];
26462647 static int __devinit fore200e_sba_probe(struct platform_device *op)
26472648 {
2649+ const struct of_device_id *match;
26482650 const struct fore200e_bus *bus;
26492651 struct fore200e *fore200e;
26502652 static int index = 0;
26512653 int err;
26522654
2653− if (!op->dev.of_match)
2655+ match = of_match_device(fore200e_sba_match, &op->dev);
2656+ if (!match)
26542657 return -EINVAL;
2655− bus = op->dev.of_match->data;
2658+ bus = match->data;
26562659
26572660 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL);
26582661 if (!fore200e)
drivers/base/power/main.c+1−0
@@ -63,6 +63,7 @@ void device_pm_init(struct device *dev) · 62 unmodified lines
6363 dev->power.wakeup = NULL;
6464 spin_lock_init(&dev->power.lock);
6565 pm_runtime_init(dev);
66+ INIT_LIST_HEAD(&dev->power.entry);
6667 }
6768
6869 /**
drivers/base/power/wakeup.c+1−1
@@ -258,7 +258,7 @@ void device_set_wakeup_capable(struct device *dev, bool capable) · 257 unmodified lines
258258 if (!!dev->power.can_wakeup == !!capable)
259259 return;
260260
261− if (device_is_registered(dev)) {
261+ if (device_is_registered(dev) && !list_empty(&dev->power.entry)) {
262262 if (capable) {
263263 if (wakeup_sysfs_add(dev))
264264 return;
drivers/base/syscore.c+2−0
@@ -73,6 +73,7 @@ int syscore_suspend(void) · 72 unmodified lines
7373
7474 return ret;
7575 }
76+EXPORT_SYMBOL_GPL(syscore_suspend);
7677
7778 /**
7879 * syscore_resume - Execute all the registered system core resume callbacks.
@@ -95,6 +96,7 @@ void syscore_resume(void) · 16 unmodified lines
9596 "Interrupts enabled after %pF\n", ops->resume);
9697 }
9798 }
99+EXPORT_SYMBOL_GPL(syscore_resume);
98100 #endif /* CONFIG_PM_SLEEP */
99101
100102 /**
drivers/block/DAC960.c+0−1
@@ -2547,7 +2547,6 @@ static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller) · 2546 unmodified lines
25472547 disk->major = MajorNumber;
25482548 disk->first_minor = n << DAC960_MaxPartitionsBits;
25492549 disk->fops = &DAC960_BlockDeviceOperations;
2550− disk->events = DISK_EVENT_MEDIA_CHANGE;
25512550 }
25522551 /*
25532552 Indicate the Block Device Registration completed successfully,
drivers/block/amiflop.c+0−1
@@ -1736,7 +1736,6 @@ static int __init fd_probe_drives(void) · 1735 unmodified lines
17361736 disk->major = FLOPPY_MAJOR;
17371737 disk->first_minor = drive;
17381738 disk->fops = &floppy_fops;
1739− disk->events = DISK_EVENT_MEDIA_CHANGE;
17401739 sprintf(disk->disk_name, "fd%d", drive);
17411740 disk->private_data = &unit[drive];
17421741 set_capacity(disk, 880*2);
drivers/block/ataflop.c+0−1
@@ -1964,7 +1964,6 @@ static int __init atari_floppy_init (void) · 1963 unmodified lines
19641964 unit[i].disk->first_minor = i;
19651965 sprintf(unit[i].disk->disk_name, "fd%d", i);
19661966 unit[i].disk->fops = &floppy_fops;
1967− unit[i].disk->events = DISK_EVENT_MEDIA_CHANGE;
19681967 unit[i].disk->private_data = &unit[i];
19691968 unit[i].disk->queue = blk_init_queue(do_fd_request,
19701969 &ataflop_lock);
drivers/block/floppy.c+0−1
@@ -4205,7 +4205,6 @@ static int __init floppy_init(void) · 4204 unmodified lines
42054205 disks[dr]->major = FLOPPY_MAJOR;
42064206 disks[dr]->first_minor = TOMINOR(dr);
42074207 disks[dr]->fops = &floppy_fops;
4208− disks[dr]->events = DISK_EVENT_MEDIA_CHANGE;
42094208 sprintf(disks[dr]->disk_name, "fd%d", dr);
42104209
42114210 init_timer(&motor_off_timer[dr]);
drivers/block/paride/pd.c+0−1
@@ -837,7 +837,6 @@ static void pd_probe_drive(struct pd_unit *disk) · 836 unmodified lines
837837 p->fops = &pd_fops;
838838 p->major = major;
839839 p->first_minor = (disk - pd) << PD_BITS;
840− p->events = DISK_EVENT_MEDIA_CHANGE;
841840 disk->gd = p;
842841 p->private_data = disk;
843842 p->queue = pd_queue;
drivers/block/paride/pf.c+0−1
@@ -294,7 +294,6 @@ static void __init pf_init_units(void) · 293 unmodified lines
294294 disk->first_minor = unit;
295295 strcpy(disk->disk_name, pf->name);
296296 disk->fops = &pf_fops;
297− disk->events = DISK_EVENT_MEDIA_CHANGE;
298297 if (!(*drives[unit])[D_PRT])
299298 pf_drive_count++;
300299 }
drivers/block/rbd.c+158−23
@@ -92,6 +92,8 @@ struct rbd_client { · 91 unmodified lines
9292 struct list_head node;
9393 };
9494
95+struct rbd_req_coll;
96+
9597 /*
9698 * a single io request
9799 */
@@ -100,6 +102,24 @@ struct rbd_request { · 2 unmodified lines
100102 struct bio *bio; /* cloned bio */
101103 struct page **pages; /* list of used pages */
102104 u64 len;
105+ int coll_index;
106+ struct rbd_req_coll *coll;
107+};
108+
109+struct rbd_req_status {
110+ int done;
111+ int rc;
112+ u64 bytes;
113+};
114+
115+/*
116+ * a collection of requests
117+ */
118+struct rbd_req_coll {
119+ int total;
120+ int num_done;
121+ struct kref kref;
122+ struct rbd_req_status status[0];
103123 };
104124
105125 struct rbd_snap {
@@ -416,6 +436,17 @@ static void rbd_put_client(struct rbd_device *rbd_dev) · 310 unmodified lines
416436 rbd_dev->client = NULL;
417437 }
418438
439+/*
440+ * Destroy requests collection
441+ */
442+static void rbd_coll_release(struct kref *kref)
443+{
444+ struct rbd_req_coll *coll =
445+ container_of(kref, struct rbd_req_coll, kref);
446+
447+ dout("rbd_coll_release %p\n", coll);
448+ kfree(coll);
449+}
419450
420451 /*
421452 * Create a new header structure, translate header format from the on-disk
@@ -590,6 +621,14 @@ static u64 rbd_get_segment(struct rbd_image_header *header, · 168 unmodified lines
590621 return len;
591622 }
592623
624+static int rbd_get_num_segments(struct rbd_image_header *header,
625+ u64 ofs, u64 len)
626+{
627+ u64 start_seg = ofs >> header->obj_order;
628+ u64 end_seg = (ofs + len - 1) >> header->obj_order;
629+ return end_seg - start_seg + 1;
630+}
631+
593632 /*
594633 * bio helpers
595634 */
@@ -735,6 +774,50 @@ static void rbd_destroy_ops(struct ceph_osd_req_op *ops) · 139 unmodified lines
735774 kfree(ops);
736775 }
737776
777+static void rbd_coll_end_req_index(struct request *rq,
778+ struct rbd_req_coll *coll,
779+ int index,
780+ int ret, u64 len)
781+{
782+ struct request_queue *q;
783+ int min, max, i;
784+
785+ dout("rbd_coll_end_req_index %p index %d ret %d len %lld\n",
786+ coll, index, ret, len);
787+
788+ if (!rq)
789+ return;
790+
791+ if (!coll) {
792+ blk_end_request(rq, ret, len);
793+ return;
794+ }
795+
796+ q = rq->q;
797+
798+ spin_lock_irq(q->queue_lock);
799+ coll->status[index].done = 1;
800+ coll->status[index].rc = ret;
801+ coll->status[index].bytes = len;
802+ max = min = coll->num_done;
803+ while (max < coll->total && coll->status[max].done)
804+ max++;
805+
806+ for (i = min; i<max; i++) {
807+ __blk_end_request(rq, coll->status[i].rc,
808+ coll->status[i].bytes);
809+ coll->num_done++;
810+ kref_put(&coll->kref, rbd_coll_release);
811+ }
812+ spin_unlock_irq(q->queue_lock);
813+}
814+
815+static void rbd_coll_end_req(struct rbd_request *req,
816+ int ret, u64 len)
817+{
818+ rbd_coll_end_req_index(req->rq, req->coll, req->coll_index, ret, len);
819+}
820+
738821 /*
739822 * Send ceph osd request
740823 */
@@ -749,6 +832,8 @@ static int rbd_do_request(struct request *rq, · 8 unmodified lines
749832 int flags,
750833 struct ceph_osd_req_op *ops,
751834 int num_reply,
835+ struct rbd_req_coll *coll,
836+ int coll_index,
752837 void (*rbd_cb)(struct ceph_osd_request *req,
753838 struct ceph_msg *msg),
754839 struct ceph_osd_request **linger_req,
@@ -763,12 +848,20 @@ static int rbd_do_request(struct request *rq, · 8 unmodified lines
763848 struct ceph_osd_request_head *reqhead;
764849 struct rbd_image_header *header = &dev->header;
765850
766− ret = -ENOMEM;
767851 req_data = kzalloc(sizeof(*req_data), GFP_NOIO);
768− if (!req_data)
769− goto done;
852+ if (!req_data) {
853+ if (coll)
854+ rbd_coll_end_req_index(rq, coll, coll_index,
855+ -ENOMEM, len);
856+ return -ENOMEM;
857+ }
770858
771− dout("rbd_do_request len=%lld ofs=%lld\n", len, ofs);
859+ if (coll) {
860+ req_data->coll = coll;
861+ req_data->coll_index = coll_index;
862+ }
863+
864+ dout("rbd_do_request obj=%s ofs=%lld len=%lld\n", obj, len, ofs);
772865
773866 down_read(&header->snap_rwsem);
774867
@@ -777,9 +870,9 @@ static int rbd_do_request(struct request *rq, · 2 unmodified lines
777870 ops,
778871 false,
779872 GFP_NOIO, pages, bio);
780− if (IS_ERR(req)) {
873+ if (!req) {
781874 up_read(&header->snap_rwsem);
782− ret = PTR_ERR(req);
875+ ret = -ENOMEM;
783876 goto done_pages;
784877 }
785878
@@ -828,7 +921,8 @@ static int rbd_do_request(struct request *rq, · 42 unmodified lines
828921 ret = ceph_osdc_wait_request(&dev->client->osdc, req);
829922 if (ver)
830923 *ver = le64_to_cpu(req->r_reassert_version.version);
831− dout("reassert_ver=%lld\n", le64_to_cpu(req->r_reassert_version.version));
924+ dout("reassert_ver=%lld\n",
925+ le64_to_cpu(req->r_reassert_version.version));
832926 ceph_osdc_put_request(req);
833927 }
834928 return ret;
@@ -837,10 +931,8 @@ done_err: · 2 unmodified lines
837931 bio_chain_put(req_data->bio);
838932 ceph_osdc_put_request(req);
839933 done_pages:
934+ rbd_coll_end_req(req_data, ret, len);
840935 kfree(req_data);
841−done:
842− if (rq)
843− blk_end_request(rq, ret, len);
844936 return ret;
845937 }
846938
@@ -874,7 +966,7 @@ static void rbd_req_cb(struct ceph_osd_request *req, struct ceph_msg *msg) · 27 unmodified lines
874966 bytes = req_data->len;
875967 }
876968
877− blk_end_request(req_data->rq, rc, bytes);
969+ rbd_coll_end_req(req_data, rc, bytes);
878970
879971 if (req_data->bio)
880972 bio_chain_put(req_data->bio);
@@ -934,6 +1026,7 @@ static int rbd_req_sync_op(struct rbd_device *dev, · 53 unmodified lines
9341026 flags,
9351027 ops,
9361028 2,
1029+ NULL, 0,
9371030 NULL,
9381031 linger_req, ver);
9391032 if (ret < 0)
@@ -959,7 +1052,9 @@ static int rbd_do_op(struct request *rq, · 19 unmodified lines
9591052 u64 snapid,
9601053 int opcode, int flags, int num_reply,
9611054 u64 ofs, u64 len,
962− struct bio *bio)
1055+ struct bio *bio,
1056+ struct rbd_req_coll *coll,
1057+ int coll_index)
9631058 {
9641059 char *seg_name;
9651060 u64 seg_ofs;
@@ -995,7 +1090,10 @@ static int rbd_do_op(struct request *rq, · 29 unmodified lines
9951090 flags,
9961091 ops,
9971092 num_reply,
1093+ coll, coll_index,
9981094 rbd_req_cb, 0, NULL);
1095+
1096+ rbd_destroy_ops(ops);
9991097 done:
10001098 kfree(seg_name);
10011099 return ret;
@@ -1008,13 +1106,15 @@ static int rbd_req_write(struct request *rq, · 6 unmodified lines
10081106 struct rbd_device *rbd_dev,
10091107 struct ceph_snap_context *snapc,
10101108 u64 ofs, u64 len,
1011− struct bio *bio)
1109+ struct bio *bio,
1110+ struct rbd_req_coll *coll,
1111+ int coll_index)
10121112 {
10131113 return rbd_do_op(rq, rbd_dev, snapc, CEPH_NOSNAP,
10141114 CEPH_OSD_OP_WRITE,
10151115 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
10161116 2,
1017− ofs, len, bio);
1117+ ofs, len, bio, coll, coll_index);
10181118 }
10191119
10201120 /*
@@ -1024,14 +1124,16 @@ static int rbd_req_read(struct request *rq, · 3 unmodified lines
10241124 struct rbd_device *rbd_dev,
10251125 u64 snapid,
10261126 u64 ofs, u64 len,
1027− struct bio *bio)
1127+ struct bio *bio,
1128+ struct rbd_req_coll *coll,
1129+ int coll_index)
10281130 {
10291131 return rbd_do_op(rq, rbd_dev, NULL,
10301132 (snapid ? snapid : CEPH_NOSNAP),
10311133 CEPH_OSD_OP_READ,
10321134 CEPH_OSD_FLAG_READ,
10331135 2,
1034− ofs, len, bio);
1136+ ofs, len, bio, coll, coll_index);
10351137 }
10361138
10371139 /*
@@ -1063,7 +1165,9 @@ static int rbd_req_sync_notify_ack(struct rbd_device *dev, · 25 unmodified lines
10631165 {
10641166 struct ceph_osd_req_op *ops;
10651167 struct page **pages = NULL;
1066− int ret = rbd_create_rw_ops(&ops, 1, CEPH_OSD_OP_NOTIFY_ACK, 0);
1168+ int ret;
1169+
1170+ ret = rbd_create_rw_ops(&ops, 1, CEPH_OSD_OP_NOTIFY_ACK, 0);
10671171 if (ret < 0)
10681172 return ret;
10691173
@@ -1077,6 +1181,7 @@ static int rbd_req_sync_notify_ack(struct rbd_device *dev, · 7 unmodified lines
10771181 CEPH_OSD_FLAG_READ,
10781182 ops,
10791183 1,
1184+ NULL, 0,
10801185 rbd_simple_req_cb, 0, NULL);
10811186
10821187 rbd_destroy_ops(ops);
@@ -1274,6 +1379,20 @@ static int rbd_req_sync_exec(struct rbd_device *dev, · 191 unmodified lines
12741379 return ret;
12751380 }
12761381
1382+static struct rbd_req_coll *rbd_alloc_coll(int num_reqs)
1383+{
1384+ struct rbd_req_coll *coll =
1385+ kzalloc(sizeof(struct rbd_req_coll) +
1386+ sizeof(struct rbd_req_status) * num_reqs,
1387+ GFP_ATOMIC);
1388+
1389+ if (!coll)
1390+ return NULL;
1391+ coll->total = num_reqs;
1392+ kref_init(&coll->kref);
1393+ return coll;
1394+}
1395+
12771396 /*
12781397 * block device queue callback
12791398 */
@@ -1291,6 +1410,8 @@ static void rbd_rq_fn(struct request_queue *q) · 11 unmodified lines
12911410 bool do_write;
12921411 int size, op_size = 0;
12931412 u64 ofs;
1413+ int num_segs, cur_seg = 0;
1414+ struct rbd_req_coll *coll;
12941415
12951416 /* peek at request from block layer */
12961417 if (!rq)
@@ -1321,6 +1442,14 @@ static void rbd_rq_fn(struct request_queue *q) · 24 unmodified lines
13211442 do_write ? "write" : "read",
13221443 size, blk_rq_pos(rq) * 512ULL);
13231444
1445+ num_segs = rbd_get_num_segments(&rbd_dev->header, ofs, size);
1446+ coll = rbd_alloc_coll(num_segs);
1447+ if (!coll) {
1448+ spin_lock_irq(q->queue_lock);
1449+ __blk_end_request_all(rq, -ENOMEM);
1450+ goto next;
1451+ }
1452+
13241453 do {
13251454 /* a bio clone to be passed down to OSD req */
13261455 dout("rq->bio->bi_vcnt=%d\n", rq->bio->bi_vcnt);
@@ -1328,35 +1457,41 @@ static void rbd_rq_fn(struct request_queue *q) · 1 unmodified line
13281457 rbd_dev->header.block_name,
13291458 ofs, size,
13301459 NULL, NULL);
1460+ kref_get(&coll->kref);
13311461 bio = bio_chain_clone(&rq_bio, &next_bio, &bp,
13321462 op_size, GFP_ATOMIC);
13331463 if (!bio) {
1334− spin_lock_irq(q->queue_lock);
1335− __blk_end_request_all(rq, -ENOMEM);
1336− goto next;
1464+ rbd_coll_end_req_index(rq, coll, cur_seg,
1465+ -ENOMEM, op_size);
1466+ goto next_seg;
13371467 }
13381468
1469+
13391470 /* init OSD command: write or read */
13401471 if (do_write)
13411472 rbd_req_write(rq, rbd_dev,
13421473 rbd_dev->header.snapc,
13431474 ofs,
1344− op_size, bio);
1475+ op_size, bio,
1476+ coll, cur_seg);
13451477 else
13461478 rbd_req_read(rq, rbd_dev,
13471479 cur_snap_id(rbd_dev),
13481480 ofs,
1349− op_size, bio);
1481+ op_size, bio,
1482+ coll, cur_seg);
13501483
1484+next_seg:
13511485 size -= op_size;
13521486 ofs += op_size;
13531487
1488+ cur_seg++;
13541489 rq_bio = next_bio;
13551490 } while (size > 0);
1491+ kref_put(&coll->kref, rbd_coll_release);
13561492
13571493 if (bp)
13581494 bio_pair_release(bp);
1359−
13601495 spin_lock_irq(q->queue_lock);
13611496 next:
13621497 rq = blk_fetch_request(q);
drivers/block/swim.c+0−1
@@ -858,7 +858,6 @@ static int __devinit swim_floppy_init(struct swim_priv *swd) · 857 unmodified lines
858858 swd->unit[drive].disk->first_minor = drive;
859859 sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive);
860860 swd->unit[drive].disk->fops = &floppy_fops;
861− swd->unit[drive].disk->events = DISK_EVENT_MEDIA_CHANGE;
862861 swd->unit[drive].disk->private_data = &swd->unit[drive];
863862 swd->unit[drive].disk->queue = swd->queue;
864863 set_capacity(swd->unit[drive].disk, 2880);
drivers/block/swim3.c+0−1
@@ -1163,7 +1163,6 @@ static int __devinit swim3_attach(struct macio_dev *mdev, const struct of_device · 1162 unmodified lines
11631163 disk->major = FLOPPY_MAJOR;
11641164 disk->first_minor = i;
11651165 disk->fops = &floppy_fops;
1166− disk->events = DISK_EVENT_MEDIA_CHANGE;
11671166 disk->private_data = &floppy_states[i];
11681167 disk->queue = swim3_queue;
11691168 disk->flags |= GENHD_FL_REMOVABLE;
drivers/block/ub.c+0−1
@@ -2334,7 +2334,6 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum) · 2333 unmodified lines
23342334 disk->major = UB_MAJOR;
23352335 disk->first_minor = lun->id * UB_PARTS_PER_LUN;
23362336 disk->fops = &ub_bd_fops;
2337− disk->events = DISK_EVENT_MEDIA_CHANGE;
23382337 disk->private_data = lun;
23392338 disk->driverfs_dev = &sc->intf->dev;
23402339
drivers/block/xsysace.c+0−1
@@ -1005,7 +1005,6 @@ static int __devinit ace_setup(struct ace_device *ace) · 1004 unmodified lines
10051005 ace->gd->major = ace_major;
10061006 ace->gd->first_minor = ace->id * ACE_NUM_MINORS;
10071007 ace->gd->fops = &ace_fops;
1008− ace->gd->events = DISK_EVENT_MEDIA_CHANGE;
10091008 ace->gd->queue = ace->queue;
10101009 ace->gd->private_data = ace;
10111010 snprintf(ace->gd->disk_name, 32, "xs%c", ace->id + 'a');
drivers/cdrom/gdrom.c+0−1
@@ -803,7 +803,6 @@ static int __devinit probe_gdrom(struct platform_device *devptr) · 802 unmodified lines
803803 goto probe_fail_cdrom_register;
804804 }
805805 gd.disk->fops = &gdrom_bdops;
806− gd.disk->events = DISK_EVENT_MEDIA_CHANGE;
807806 /* latch on to the interrupt */
808807 err = gdrom_set_interrupt_handlers();
809808 if (err)
drivers/char/agp/generic.c+15−4
@@ -115,6 +115,9 @@ static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages) · 114 unmodified lines
115115 struct agp_memory *new;
116116 unsigned long alloc_size = num_agp_pages*sizeof(struct page *);
117117
118+ if (INT_MAX/sizeof(struct page *) < num_agp_pages)
119+ return NULL;
120+
118121 new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL);
119122 if (new == NULL)
120123 return NULL;
@@ -234,11 +237,14 @@ struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge, · 113 unmodified lines
234237 int scratch_pages;
235238 struct agp_memory *new;
236239 size_t i;
240+ int cur_memory;
237241
238242 if (!bridge)
239243 return NULL;
240244
241− if ((atomic_read(&bridge->current_memory_agp) + page_count) > bridge->max_memory_agp)
245+ cur_memory = atomic_read(&bridge->current_memory_agp);
246+ if ((cur_memory + page_count > bridge->max_memory_agp) ||
247+ (cur_memory + page_count < page_count))
242248 return NULL;
243249
244250 if (type >= AGP_USER_TYPES) {
@@ -1089,8 +1095,8 @@ int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type) · 844 unmodified lines
10891095 return -EINVAL;
10901096 }
10911097
1092− /* AK: could wrap */
1093− if ((pg_start + mem->page_count) > num_entries)
1098+ if (((pg_start + mem->page_count) > num_entries) ||
1099+ ((pg_start + mem->page_count) < pg_start))
10941100 return -EINVAL;
10951101
10961102 j = pg_start;
@@ -1124,7 +1130,7 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type) · 27 unmodified lines
11241130 {
11251131 size_t i;
11261132 struct agp_bridge_data *bridge;
1127− int mask_type;
1133+ int mask_type, num_entries;
11281134
11291135 bridge = mem->bridge;
11301136 if (!bridge)
@@ -1136,6 +1142,11 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type) · 5 unmodified lines
11361142 if (type != mem->type)
11371143 return -EINVAL;
11381144
1145+ num_entries = agp_num_entries();
1146+ if (((pg_start + mem->page_count) > num_entries) ||
1147+ ((pg_start + mem->page_count) < pg_start))
1148+ return -EINVAL;
1149+
11391150 mask_type = bridge->driver->agp_type_to_mask_type(bridge, type);
11401151 if (mask_type != 0) {
11411152 /* The generic routines know nothing of memory types */
drivers/char/hw_random/n2-drv.c+5−2
@@ -619,15 +619,18 @@ static void __devinit n2rng_driver_version(void) · 618 unmodified lines
619619 pr_info("%s", version);
620620 }
621621
622+static const struct of_device_id n2rng_match[];
622623 static int __devinit n2rng_probe(struct platform_device *op)
623624 {
625+ const struct of_device_id *match;
624626 int victoria_falls;
625627 int err = -ENOMEM;
626628 struct n2rng *np;
627629
628− if (!op->dev.of_match)
630+ match = of_match_device(n2rng_match, &op->dev);
631+ if (!match)
629632 return -EINVAL;
630− victoria_falls = (op->dev.of_match->data != NULL);
633+ victoria_falls = (match->data != NULL);
631634
632635 n2rng_driver_version();
633636 np = kzalloc(sizeof(*np), GFP_KERNEL);
drivers/char/ipmi/ipmi_si_intf.c+5−2
@@ -2554,9 +2554,11 @@ static struct pci_driver ipmi_pci_driver = { · 2553 unmodified lines
25542554 };
25552555 #endif /* CONFIG_PCI */
25562556
2557+static struct of_device_id ipmi_match[];
25572558 static int __devinit ipmi_probe(struct platform_device *dev)
25582559 {
25592560 #ifdef CONFIG_OF
2561+ const struct of_device_id *match;
25602562 struct smi_info *info;
25612563 struct resource resource;
25622564 const __be32 *regsize, *regspacing, *regshift;
@@ -2566,7 +2568,8 @@ static int __devinit ipmi_probe(struct platform_device *dev) · 3 unmodified lines
25662568
25672569 dev_info(&dev->dev, "probing via device tree\n");
25682570
2569− if (!dev->dev.of_match)
2571+ match = of_match_device(ipmi_match, &dev->dev);
2572+ if (!match)
25702573 return -EINVAL;
25712574
25722575 ret = of_address_to_resource(np, 0, &resource);
@@ -2601,7 +2604,7 @@ static int __devinit ipmi_probe(struct platform_device *dev) · 28 unmodified lines
26012604 return -ENOMEM;
26022605 }
26032606
2604− info->si_type = (enum si_type) dev->dev.of_match->data;
2607+ info->si_type = (enum si_type) match->data;
26052608 info->addr_source = SI_DEVICETREE;
26062609 info->irq_setup = std_irq_setup;
26072610
drivers/char/virtio_console.c+0−11
@@ -1280,18 +1280,7 @@ static void unplug_port(struct port *port) · 1279 unmodified lines
12801280 spin_lock_irq(&pdrvdata_lock);
12811281 list_del(&port->cons.list);
12821282 spin_unlock_irq(&pdrvdata_lock);
1283−#if 0
1284− /*
1285− * hvc_remove() not called as removing one hvc port
1286− * results in other hvc ports getting frozen.
1287− *
1288− * Once this is resolved in hvc, this functionality
1289− * will be enabled. Till that is done, the -EPIPE
1290− * return from get_chars() above will help
1291− * hvc_console.c to clean up on ports we remove here.
1292− */
12931283 hvc_remove(port->cons.hvc);
1294−#endif
12951284 }
12961285
12971286 /* Remove unused data this port might have received. */
drivers/char/xilinx_hwicap/xilinx_hwicap.c+9−5
@@ -715,13 +715,13 @@ static int __devexit hwicap_remove(struct device *dev) · 714 unmodified lines
715715 }
716716
717717 #ifdef CONFIG_OF
718−static int __devinit hwicap_of_probe(struct platform_device *op)
718+static int __devinit hwicap_of_probe(struct platform_device *op,
719+ const struct hwicap_driver_config *config)
719720 {
720721 struct resource res;
721722 const unsigned int *id;
722723 const char *family;
723724 int rc;
724− const struct hwicap_driver_config *config = op->dev.of_match->data;
725725 const struct config_registers *regs;
726726
727727
@@ -751,20 +751,24 @@ static int __devinit hwicap_of_probe(struct platform_device *op) · 23 unmodified lines
751751 regs);
752752 }
753753 #else
754−static inline int hwicap_of_probe(struct platform_device *op)
754+static inline int hwicap_of_probe(struct platform_device *op,
755+ const struct hwicap_driver_config *config)
755756 {
756757 return -EINVAL;
757758 }
758759 #endif /* CONFIG_OF */
759760
761+static const struct of_device_id __devinitconst hwicap_of_match[];
760762 static int __devinit hwicap_drv_probe(struct platform_device *pdev)
761763 {
764+ const struct of_device_id *match;
762765 struct resource *res;
763766 const struct config_registers *regs;
764767 const char *family;
765768
766− if (pdev->dev.of_match)
767− return hwicap_of_probe(pdev);
769+ match = of_match_device(hwicap_of_match, &pdev->dev);
770+ if (match)
771+ return hwicap_of_probe(pdev, match->data);
768772
769773 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
770774 if (!res)
drivers/clk/clkdev.c+9−10
@@ -32,10 +32,9 @@ static DEFINE_MUTEX(clocks_mutex); · 31 unmodified lines
3232 * Then we take the most specific entry - with the following
3333 * order of precedence: dev+con > dev only > con only.
3434 */
35−static struct clk *clk_find(const char *dev_id, const char *con_id)
35+static struct clk_lookup *clk_find(const char *dev_id, const char *con_id)
3636 {
37− struct clk_lookup *p;
38− struct clk *clk = NULL;
37+ struct clk_lookup *p, *cl = NULL;
3938 int match, best = 0;
4039
4140 list_for_each_entry(p, &clocks, node) {
@@ -52,27 +51,27 @@ static struct clk *clk_find(const char *dev_id, const char *con_id) · 10 unmodified lines
5251 }
5352
5453 if (match > best) {
55− clk = p->clk;
54+ cl = p;
5655 if (match != 3)
5756 best = match;
5857 else
5958 break;
6059 }
6160 }
62− return clk;
61+ return cl;
6362 }
6463
6564 struct clk *clk_get_sys(const char *dev_id, const char *con_id)
6665 {
67− struct clk *clk;
66+ struct clk_lookup *cl;
6867
6968 mutex_lock(&clocks_mutex);
70− clk = clk_find(dev_id, con_id);
71− if (clk && !__clk_get(clk))
72− clk = NULL;
69+ cl = clk_find(dev_id, con_id);
70+ if (cl && !__clk_get(cl->clk))
71+ cl = NULL;
7372 mutex_unlock(&clocks_mutex);
7473
75− return clk ? clk : ERR_PTR(-ENOENT);
74+ return cl ? cl->clk : ERR_PTR(-ENOENT);
7675 }
7776 EXPORT_SYMBOL(clk_get_sys);
7877
drivers/connector/connector.c+1−0
@@ -142,6 +142,7 @@ static int cn_call_callback(struct sk_buff *skb) · 141 unmodified lines
142142 cbq->callback(msg, nsp);
143143 kfree_skb(skb);
144144 cn_queue_release_callback(cbq);
145+ err = 0;
145146 }
146147
147148 return err;
drivers/edac/amd64_edac.c+78−10
@@ -211,8 +211,6 @@ static int amd64_get_scrub_rate(struct mem_ctl_info *mci) · 210 unmodified lines
211211
212212 scrubval = scrubval & 0x001F;
213213
214− amd64_debug("pci-read, sdram scrub control value: %d\n", scrubval);
215−
216214 for (i = 0; i < ARRAY_SIZE(scrubrates); i++) {
217215 if (scrubrates[i].scrubval == scrubval) {
218216 retval = scrubrates[i].bandwidth;
@@ -933,25 +931,74 @@ static int k8_early_channel_count(struct amd64_pvt *pvt) · 714 unmodified lines
933931 /* On F10h and later ErrAddr is MC4_ADDR[47:1] */
934932 static u64 get_error_address(struct mce *m)
935933 {
934+ struct cpuinfo_x86 *c = &boot_cpu_data;
935+ u64 addr;
936936 u8 start_bit = 1;
937937 u8 end_bit = 47;
938938
939− if (boot_cpu_data.x86 == 0xf) {
939+ if (c->x86 == 0xf) {
940940 start_bit = 3;
941941 end_bit = 39;
942942 }
943943
944− return m->addr & GENMASK(start_bit, end_bit);
944+ addr = m->addr & GENMASK(start_bit, end_bit);
945+
946+ /*
947+ * Erratum 637 workaround
948+ */
949+ if (c->x86 == 0x15) {
950+ struct amd64_pvt *pvt;
951+ u64 cc6_base, tmp_addr;
952+ u32 tmp;
953+ u8 mce_nid, intlv_en;
954+
955+ if ((addr & GENMASK(24, 47)) >> 24 != 0x00fdf7)
956+ return addr;
957+
958+ mce_nid = amd_get_nb_id(m->extcpu);
959+ pvt = mcis[mce_nid]->pvt_info;
960+
961+ amd64_read_pci_cfg(pvt->F1, DRAM_LOCAL_NODE_LIM, &tmp);
962+ intlv_en = tmp >> 21 & 0x7;
963+
964+ /* add [47:27] + 3 trailing bits */
965+ cc6_base = (tmp & GENMASK(0, 20)) << 3;
966+
967+ /* reverse and add DramIntlvEn */
968+ cc6_base |= intlv_en ^ 0x7;
969+
970+ /* pin at [47:24] */
971+ cc6_base <<= 24;
972+
973+ if (!intlv_en)
974+ return cc6_base | (addr & GENMASK(0, 23));
975+
976+ amd64_read_pci_cfg(pvt->F1, DRAM_LOCAL_NODE_BASE, &tmp);
977+
978+ /* faster log2 */
979+ tmp_addr = (addr & GENMASK(12, 23)) << __fls(intlv_en + 1);
980+
981+ /* OR DramIntlvSel into bits [14:12] */
982+ tmp_addr |= (tmp & GENMASK(21, 23)) >> 9;
983+
984+ /* add remaining [11:0] bits from original MC4_ADDR */
985+ tmp_addr |= addr & GENMASK(0, 11);
986+
987+ return cc6_base | tmp_addr;
988+ }
989+
990+ return addr;
945991 }
946992
947993 static void read_dram_base_limit_regs(struct amd64_pvt *pvt, unsigned range)
948994 {
995+ struct cpuinfo_x86 *c = &boot_cpu_data;
949996 int off = range << 3;
950997
951998 amd64_read_pci_cfg(pvt->F1, DRAM_BASE_LO + off, &pvt->ranges[range].base.lo);
952999 amd64_read_pci_cfg(pvt->F1, DRAM_LIMIT_LO + off, &pvt->ranges[range].lim.lo);
9531000
954− if (boot_cpu_data.x86 == 0xf)
1001+ if (c->x86 == 0xf)
9551002 return;
9561003
9571004 if (!dram_rw(pvt, range))
@@ -959,6 +1006,31 @@ static void read_dram_base_limit_regs(struct amd64_pvt *pvt, unsigned range) · 1 unmodified line
9591006
9601007 amd64_read_pci_cfg(pvt->F1, DRAM_BASE_HI + off, &pvt->ranges[range].base.hi);
9611008 amd64_read_pci_cfg(pvt->F1, DRAM_LIMIT_HI + off, &pvt->ranges[range].lim.hi);
1009+
1010+ /* Factor in CC6 save area by reading dst node's limit reg */
1011+ if (c->x86 == 0x15) {
1012+ struct pci_dev *f1 = NULL;
1013+ u8 nid = dram_dst_node(pvt, range);
1014+ u32 llim;
1015+
1016+ f1 = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x18 + nid, 1));
1017+ if (WARN_ON(!f1))
1018+ return;
1019+
1020+ amd64_read_pci_cfg(f1, DRAM_LOCAL_NODE_LIM, &llim);
1021+
1022+ pvt->ranges[range].lim.lo &= GENMASK(0, 15);
1023+
1024+ /* {[39:27],111b} */
1025+ pvt->ranges[range].lim.lo |= ((llim & 0x1fff) << 3 | 0x7) << 16;
1026+
1027+ pvt->ranges[range].lim.hi &= GENMASK(0, 7);
1028+
1029+ /* [47:40] */
1030+ pvt->ranges[range].lim.hi |= llim >> 13;
1031+
1032+ pci_dev_put(f1);
1033+ }
9621034 }
9631035
9641036 static void k8_map_sysaddr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr,
@@ -1403,12 +1475,8 @@ static int f1x_match_to_this_node(struct amd64_pvt *pvt, unsigned range, · 438 unmodified lines
14031475 return -EINVAL;
14041476 }
14051477
1406− if (intlv_en &&
1407− (intlv_sel != ((sys_addr >> 12) & intlv_en))) {
1408− amd64_warn("Botched intlv bits, en: 0x%x, sel: 0x%x\n",
1409− intlv_en, intlv_sel);
1478+ if (intlv_en && (intlv_sel != ((sys_addr >> 12) & intlv_en)))
14101479 return -EINVAL;
1411− }
14121480
14131481 sys_addr = f1x_swap_interleaved_region(pvt, sys_addr);
14141482
drivers/edac/amd64_edac.h+3−0
@@ -196,6 +196,9 @@ · 195 unmodified lines
196196
197197 #define DCT_CFG_SEL 0x10C
198198
199+#define DRAM_LOCAL_NODE_BASE 0x120
200+#define DRAM_LOCAL_NODE_LIM 0x124
201+
199202 #define DRAM_BASE_HI 0x140
200203 #define DRAM_LIMIT_HI 0x144
201204
drivers/edac/edac_mc_sysfs.c+5−6
@@ -458,13 +458,13 @@ static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci, · 457 unmodified lines
458458 return -EINVAL;
459459
460460 new_bw = mci->set_sdram_scrub_rate(mci, bandwidth);
461− if (new_bw >= 0) {
462− edac_printk(KERN_DEBUG, EDAC_MC, "Scrub rate set to %d\n", new_bw);
463− return count;
461+ if (new_bw < 0) {
462+ edac_printk(KERN_WARNING, EDAC_MC,
463+ "Error setting scrub rate to: %lu\n", bandwidth);
464+ return -EINVAL;
464465 }
465466
466− edac_printk(KERN_DEBUG, EDAC_MC, "Error setting scrub rate to: %lu\n", bandwidth);
467− return -EINVAL;
467+ return count;
468468 }
469469
470470 /*
@@ -483,7 +483,6 @@ static ssize_t mci_sdram_scrub_rate_show(struct mem_ctl_info *mci, char *data) · 12 unmodified lines
483483 return bandwidth;
484484 }
485485
486− edac_printk(KERN_DEBUG, EDAC_MC, "Read scrub rate: %d\n", bandwidth);
487486 return sprintf(data, "%d\n", bandwidth);
488487 }
489488
drivers/edac/ppc4xx_edac.c+1−1
@@ -1019,7 +1019,7 @@ ppc4xx_edac_mc_init(struct mem_ctl_info *mci, · 1018 unmodified lines
10191019 struct ppc4xx_edac_pdata *pdata = NULL;
10201020 const struct device_node *np = op->dev.of_node;
10211021
1022− if (op->dev.of_match == NULL)
1022+ if (of_match_device(ppc4xx_edac_match, &op->dev) == NULL)
10231023 return -EINVAL;
10241024
10251025 /* Initial driver pointers and private data */
drivers/firewire/ohci.c+25−14
@@ -2199,7 +2199,6 @@ static int ohci_set_config_rom(struct fw_card *card, · 2198 unmodified lines
21992199 {
22002200 struct fw_ohci *ohci;
22012201 unsigned long flags;
2202− int ret = -EBUSY;
22032202 __be32 *next_config_rom;
22042203 dma_addr_t uninitialized_var(next_config_rom_bus);
22052204
@@ -2240,22 +2239,37 @@ static int ohci_set_config_rom(struct fw_card *card, · 34 unmodified lines
22402239
22412240 spin_lock_irqsave(&ohci->lock, flags);
22422241
2242+ /*
2243+ * If there is not an already pending config_rom update,
2244+ * push our new allocation into the ohci->next_config_rom
2245+ * and then mark the local variable as null so that we
2246+ * won't deallocate the new buffer.
2247+ *
2248+ * OTOH, if there is a pending config_rom update, just
2249+ * use that buffer with the new config_rom data, and
2250+ * let this routine free the unused DMA allocation.
2251+ */
2252+
22432253 if (ohci->next_config_rom == NULL) {
22442254 ohci->next_config_rom = next_config_rom;
22452255 ohci->next_config_rom_bus = next_config_rom_bus;
2256+ next_config_rom = NULL;
2257+ }
22462258
2247− copy_config_rom(ohci->next_config_rom, config_rom, length);
2259+ copy_config_rom(ohci->next_config_rom, config_rom, length);
22482260
2249− ohci->next_header = config_rom[0];
2250− ohci->next_config_rom[0] = 0;
2261+ ohci->next_header = config_rom[0];
2262+ ohci->next_config_rom[0] = 0;
22512263
2252− reg_write(ohci, OHCI1394_ConfigROMmap,
2253− ohci->next_config_rom_bus);
2254− ret = 0;
2255− }
2264+ reg_write(ohci, OHCI1394_ConfigROMmap, ohci->next_config_rom_bus);
22562265
22572266 spin_unlock_irqrestore(&ohci->lock, flags);
22582267
2268+ /* If we didn't use the DMA allocation, delete it. */
2269+ if (next_config_rom != NULL)
2270+ dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
2271+ next_config_rom, next_config_rom_bus);
2272+
22592273 /*
22602274 * Now initiate a bus reset to have the changes take
22612275 * effect. We clean up the old config rom memory and DMA
@@ -2263,13 +2277,10 @@ static int ohci_set_config_rom(struct fw_card *card, · 1 unmodified line
22632277 * controller could need to access it before the bus reset
22642278 * takes effect.
22652279 */
2266− if (ret == 0)
2267− fw_schedule_bus_reset(&ohci->card, true, true);
2268− else
2269− dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
2270− next_config_rom, next_config_rom_bus);
22712280
2272− return ret;
2281+ fw_schedule_bus_reset(&ohci->card, true, true);
2282+
2283+ return 0;
22732284 }
22742285
22752286 static void ohci_send_request(struct fw_card *card, struct fw_packet *packet)
drivers/gpu/drm/Kconfig+1−0
@@ -24,6 +24,7 @@ config DRM_KMS_HELPER · 23 unmodified lines
2424 depends on DRM
2525 select FB
2626 select FRAMEBUFFER_CONSOLE if !EXPERT
27+ select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
2728 help
2829 FB and CRTC helpers for KMS drivers.
2930
drivers/gpu/drm/drm_fb_helper.c+42−11
@@ -342,9 +342,22 @@ int drm_fb_helper_debug_leave(struct fb_info *info) · 341 unmodified lines
342342 }
343343 EXPORT_SYMBOL(drm_fb_helper_debug_leave);
344344
345+bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper)
346+{
347+ bool error = false;
348+ int i, ret;
349+ for (i = 0; i < fb_helper->crtc_count; i++) {
350+ struct drm_mode_set *mode_set = &fb_helper->crtc_info[i].mode_set;
351+ ret = drm_crtc_helper_set_config(mode_set);
352+ if (ret)
353+ error = true;
354+ }
355+ return error;
356+}
357+EXPORT_SYMBOL(drm_fb_helper_restore_fbdev_mode);
358+
345359 bool drm_fb_helper_force_kernel_mode(void)
346360 {
347− int i = 0;
348361 bool ret, error = false;
349362 struct drm_fb_helper *helper;
350363
@@ -352,12 +365,12 @@ bool drm_fb_helper_force_kernel_mode(void) · 1 unmodified line
352365 return false;
353366
354367 list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) {
355− for (i = 0; i < helper->crtc_count; i++) {
356− struct drm_mode_set *mode_set = &helper->crtc_info[i].mode_set;
357− ret = drm_crtc_helper_set_config(mode_set);
358− if (ret)
359− error = true;
360− }
368+ if (helper->dev->switch_power_state == DRM_SWITCH_POWER_OFF)
369+ continue;
370+
371+ ret = drm_fb_helper_restore_fbdev_mode(helper);
372+ if (ret)
373+ error = true;
361374 }
362375 return error;
363376 }
@@ -1503,17 +1516,33 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) · 1139 unmodified lines
15031516 }
15041517 EXPORT_SYMBOL(drm_fb_helper_initial_config);
15051518
1506−bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
1519+/**
1520+ * drm_fb_helper_hotplug_event - respond to a hotplug notification by
1521+ * probing all the outputs attached to the fb.
1522+ * @fb_helper: the drm_fb_helper
1523+ *
1524+ * LOCKING:
1525+ * Called at runtime, must take mode config lock.
1526+ *
1527+ * Scan the connectors attached to the fb_helper and try to put together a
1528+ * setup after *notification of a change in output configuration.
1529+ *
1530+ * RETURNS:
1531+ * 0 on success and a non-zero error code otherwise.
1532+ */
1533+int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
15071534 {
1535+ struct drm_device *dev = fb_helper->dev;
15081536 int count = 0;
15091537 u32 max_width, max_height, bpp_sel;
15101538 bool bound = false, crtcs_bound = false;
15111539 struct drm_crtc *crtc;
15121540
15131541 if (!fb_helper->fb)
1514− return false;
1542+ return 0;
15151543
1516− list_for_each_entry(crtc, &fb_helper->dev->mode_config.crtc_list, head) {
1544+ mutex_lock(&dev->mode_config.mutex);
1545+ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
15171546 if (crtc->fb)
15181547 crtcs_bound = true;
15191548 if (crtc->fb == fb_helper->fb)
@@ -1522,7 +1551,8 @@ bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) · 2 unmodified lines
15221551
15231552 if (!bound && crtcs_bound) {
15241553 fb_helper->delayed_hotplug = true;
1525− return false;
1554+ mutex_unlock(&dev->mode_config.mutex);
1555+ return 0;
15261556 }
15271557 DRM_DEBUG_KMS("\n");
15281558
@@ -1533,6 +1563,7 @@ bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) · 4 unmodified lines
15331563 count = drm_fb_helper_probe_connector_modes(fb_helper, max_width,
15341564 max_height);
15351565 drm_setup_crtcs(fb_helper);
1566+ mutex_unlock(&dev->mode_config.mutex);
15361567
15371568 return drm_fb_helper_single_fb_probe(fb_helper, bpp_sel);
15381569 }
drivers/gpu/drm/drm_irq.c+23−0
@@ -932,11 +932,34 @@ EXPORT_SYMBOL(drm_vblank_put); · 931 unmodified lines
932932
933933 void drm_vblank_off(struct drm_device *dev, int crtc)
934934 {
935+ struct drm_pending_vblank_event *e, *t;
936+ struct timeval now;
935937 unsigned long irqflags;
938+ unsigned int seq;
936939
937940 spin_lock_irqsave(&dev->vbl_lock, irqflags);
938941 vblank_disable_and_save(dev, crtc);
939942 DRM_WAKEUP(&dev->vbl_queue[crtc]);
943+
944+ /* Send any queued vblank events, lest the natives grow disquiet */
945+ seq = drm_vblank_count_and_time(dev, crtc, &now);
946+ list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) {
947+ if (e->pipe != crtc)
948+ continue;
949+ DRM_DEBUG("Sending premature vblank event on disable: \
950+ wanted %d, current %d\n",
951+ e->event.sequence, seq);
952+
953+ e->event.sequence = seq;
954+ e->event.tv_sec = now.tv_sec;
955+ e->event.tv_usec = now.tv_usec;
956+ drm_vblank_put(dev, e->pipe);
957+ list_move_tail(&e->base.link, &e->base.file_priv->event_list);
958+ wake_up_interruptible(&e->base.file_priv->event_wait);
959+ trace_drm_vblank_event_delivered(e->base.pid, e->pipe,
960+ e->event.sequence);
961+ }
962+
940963 spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
941964 }
942965 EXPORT_SYMBOL(drm_vblank_off);
drivers/gpu/drm/drm_mm.c+3−3
@@ -431,7 +431,7 @@ EXPORT_SYMBOL(drm_mm_search_free_in_range); · 430 unmodified lines
431431 void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new)
432432 {
433433 list_replace(&old->node_list, &new->node_list);
434− list_replace(&old->node_list, &new->hole_stack);
434+ list_replace(&old->hole_stack, &new->hole_stack);
435435 new->hole_follows = old->hole_follows;
436436 new->mm = old->mm;
437437 new->start = old->start;
@@ -699,8 +699,8 @@ int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm) · 261 unmodified lines
699699 entry->size);
700700 total_used += entry->size;
701701 if (entry->hole_follows) {
702− hole_start = drm_mm_hole_node_start(&mm->head_node);
703− hole_end = drm_mm_hole_node_end(&mm->head_node);
702+ hole_start = drm_mm_hole_node_start(entry);
703+ hole_end = drm_mm_hole_node_end(entry);
704704 hole_size = hole_end - hole_start;
705705 seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n",
706706 hole_start, hole_end, hole_size);
drivers/gpu/drm/i915/i915_dma.c+1−1
@@ -2207,7 +2207,7 @@ void i915_driver_lastclose(struct drm_device * dev) · 2206 unmodified lines
22072207 drm_i915_private_t *dev_priv = dev->dev_private;
22082208
22092209 if (!dev_priv || drm_core_check_feature(dev, DRIVER_MODESET)) {
2210− drm_fb_helper_restore();
2210+ intel_fb_restore_mode(dev);
22112211 vga_switcheroo_process_delayed_switch();
22122212 return;
22132213 }
drivers/gpu/drm/i915/i915_drv.c+1−1
@@ -49,7 +49,7 @@ module_param_named(panel_ignore_lid, i915_panel_ignore_lid, int, 0600); · 48 unmodified lines
4949 unsigned int i915_powersave = 1;
5050 module_param_named(powersave, i915_powersave, int, 0600);
5151
52−unsigned int i915_semaphores = 1;
52+unsigned int i915_semaphores = 0;
5353 module_param_named(semaphores, i915_semaphores, int, 0600);
5454
5555 unsigned int i915_enable_rc6 = 0;
drivers/gpu/drm/i915/intel_display.c+45−36
@@ -3771,8 +3771,11 @@ static bool g4x_compute_wm0(struct drm_device *dev, · 3770 unmodified lines
37713771 int entries, tlb_miss;
37723772
37733773 crtc = intel_get_crtc_for_plane(dev, plane);
3774− if (crtc->fb == NULL || !crtc->enabled)
3774+ if (crtc->fb == NULL || !crtc->enabled) {
3775+ *cursor_wm = cursor->guard_size;
3776+ *plane_wm = display->guard_size;
37753777 return false;
3778+ }
37763779
37773780 htotal = crtc->mode.htotal;
37783781 hdisplay = crtc->mode.hdisplay;
@@ -5602,9 +5605,9 @@ static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc) · 1823 unmodified lines
56025605 intel_clock_t clock;
56035606
56045607 if ((dpll & DISPLAY_RATE_SELECT_FPA1) == 0)
5605− fp = FP0(pipe);
5608+ fp = I915_READ(FP0(pipe));
56065609 else
5607− fp = FP1(pipe);
5610+ fp = I915_READ(FP1(pipe));
56085611
56095612 clock.m1 = (fp & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT;
56105613 if (IS_PINEVIEW(dev)) {
@@ -6215,36 +6218,6 @@ cleanup_work: · 604 unmodified lines
62156218 return ret;
62166219 }
62176220
6218−static void intel_crtc_reset(struct drm_crtc *crtc)
6219−{
6220− struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
6221−
6222− /* Reset flags back to the 'unknown' status so that they
6223− * will be correctly set on the initial modeset.
6224− */
6225− intel_crtc->dpms_mode = -1;
6226−}
6227−
6228−static struct drm_crtc_helper_funcs intel_helper_funcs = {
6229− .dpms = intel_crtc_dpms,
6230− .mode_fixup = intel_crtc_mode_fixup,
6231− .mode_set = intel_crtc_mode_set,
6232− .mode_set_base = intel_pipe_set_base,
6233− .mode_set_base_atomic = intel_pipe_set_base_atomic,
6234− .load_lut = intel_crtc_load_lut,
6235− .disable = intel_crtc_disable,
6236−};
6237−
6238−static const struct drm_crtc_funcs intel_crtc_funcs = {
6239− .reset = intel_crtc_reset,
6240− .cursor_set = intel_crtc_cursor_set,
6241− .cursor_move = intel_crtc_cursor_move,
6242− .gamma_set = intel_crtc_gamma_set,
6243− .set_config = drm_crtc_helper_set_config,
6244− .destroy = intel_crtc_destroy,
6245− .page_flip = intel_crtc_page_flip,
6246−};
6247−
62486221 static void intel_sanitize_modesetting(struct drm_device *dev,
62496222 int pipe, int plane)
62506223 {
@@ -6281,6 +6254,42 @@ static void intel_sanitize_modesetting(struct drm_device *dev, · 30 unmodified lines
62816254 intel_disable_pipe(dev_priv, pipe);
62826255 }
62836256
6257+static void intel_crtc_reset(struct drm_crtc *crtc)
6258+{
6259+ struct drm_device *dev = crtc->dev;
6260+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
6261+
6262+ /* Reset flags back to the 'unknown' status so that they
6263+ * will be correctly set on the initial modeset.
6264+ */
6265+ intel_crtc->dpms_mode = -1;
6266+
6267+ /* We need to fix up any BIOS configuration that conflicts with
6268+ * our expectations.
6269+ */
6270+ intel_sanitize_modesetting(dev, intel_crtc->pipe, intel_crtc->plane);
6271+}
6272+
6273+static struct drm_crtc_helper_funcs intel_helper_funcs = {
6274+ .dpms = intel_crtc_dpms,
6275+ .mode_fixup = intel_crtc_mode_fixup,
6276+ .mode_set = intel_crtc_mode_set,
6277+ .mode_set_base = intel_pipe_set_base,
6278+ .mode_set_base_atomic = intel_pipe_set_base_atomic,
6279+ .load_lut = intel_crtc_load_lut,
6280+ .disable = intel_crtc_disable,
6281+};
6282+
6283+static const struct drm_crtc_funcs intel_crtc_funcs = {
6284+ .reset = intel_crtc_reset,
6285+ .cursor_set = intel_crtc_cursor_set,
6286+ .cursor_move = intel_crtc_cursor_move,
6287+ .gamma_set = intel_crtc_gamma_set,
6288+ .set_config = drm_crtc_helper_set_config,
6289+ .destroy = intel_crtc_destroy,
6290+ .page_flip = intel_crtc_page_flip,
6291+};
6292+
62846293 static void intel_crtc_init(struct drm_device *dev, int pipe)
62856294 {
62866295 drm_i915_private_t *dev_priv = dev->dev_private;
@@ -6330,8 +6339,6 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) · 43 unmodified lines
63306339
63316340 setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer,
63326341 (unsigned long)intel_crtc);
6333−
6334− intel_sanitize_modesetting(dev, intel_crtc->pipe, intel_crtc->plane);
63356342 }
63366343
63376344 int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
@@ -6572,8 +6579,10 @@ intel_user_framebuffer_create(struct drm_device *dev, · 234 unmodified lines
65726579 return ERR_PTR(-ENOENT);
65736580
65746581 intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
6575− if (!intel_fb)
6582+ if (!intel_fb) {
6583+ drm_gem_object_unreference_unlocked(&obj->base);
65766584 return ERR_PTR(-ENOMEM);
6585+ }
65776586
65786587 ret = intel_framebuffer_init(dev, intel_fb, mode_cmd, obj);
65796588 if (ret) {
drivers/gpu/drm/i915/intel_dp.c+15−2
@@ -1470,7 +1470,8 @@ intel_dp_link_down(struct intel_dp *intel_dp) · 1469 unmodified lines
14701470
14711471 if (!HAS_PCH_CPT(dev) &&
14721472 I915_READ(intel_dp->output_reg) & DP_PIPEB_SELECT) {
1473− struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.base.crtc);
1473+ struct drm_crtc *crtc = intel_dp->base.base.crtc;
1474+
14741475 /* Hardware workaround: leaving our transcoder select
14751476 * set to transcoder B while it's off will prevent the
14761477 * corresponding HDMI output on transcoder A.
@@ -1485,7 +1486,19 @@ intel_dp_link_down(struct intel_dp *intel_dp) · 8 unmodified lines
14851486 /* Changes to enable or select take place the vblank
14861487 * after being written.
14871488 */
1488− intel_wait_for_vblank(dev, intel_crtc->pipe);
1489+ if (crtc == NULL) {
1490+ /* We can arrive here never having been attached
1491+ * to a CRTC, for instance, due to inheriting
1492+ * random state from the BIOS.
1493+ *
1494+ * If the pipe is not running, play safe and
1495+ * wait for the clocks to stabilise before
1496+ * continuing.
1497+ */
1498+ POSTING_READ(intel_dp->output_reg);
1499+ msleep(50);
1500+ } else
1501+ intel_wait_for_vblank(dev, to_intel_crtc(crtc)->pipe);
14891502 }
14901503
14911504 I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN);
drivers/gpu/drm/i915/intel_drv.h+1−0
@@ -338,4 +338,5 @@ extern int intel_overlay_attrs(struct drm_device *dev, void *data, · 337 unmodified lines
338338 struct drm_file *file_priv);
339339
340340 extern void intel_fb_output_poll_changed(struct drm_device *dev);
341+extern void intel_fb_restore_mode(struct drm_device *dev);
341342 #endif /* __INTEL_DRV_H__ */
drivers/gpu/drm/i915/intel_fb.c+10−0
@@ -264,3 +264,13 @@ void intel_fb_output_poll_changed(struct drm_device *dev) · 263 unmodified lines
264264 drm_i915_private_t *dev_priv = dev->dev_private;
265265 drm_fb_helper_hotplug_event(&dev_priv->fbdev->helper);
266266 }
267+
268+void intel_fb_restore_mode(struct drm_device *dev)
269+{
270+ int ret;
271+ drm_i915_private_t *dev_priv = dev->dev_private;
272+
273+ ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper);
274+ if (ret)
275+ DRM_DEBUG("failed to restore crtc mode\n");
276+}
drivers/gpu/drm/i915/intel_lvds.c+3−0
@@ -539,6 +539,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, · 538 unmodified lines
539539 struct drm_device *dev = dev_priv->dev;
540540 struct drm_connector *connector = dev_priv->int_lvds_connector;
541541
542+ if (dev->switch_power_state != DRM_SWITCH_POWER_ON)
543+ return NOTIFY_OK;
544+
542545 /*
543546 * check and update the status of LVDS connector after receiving
544547 * the LID nofication event.
drivers/gpu/drm/i915/intel_tv.c+5−4
@@ -1151,10 +1151,10 @@ intel_tv_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, · 1150 unmodified lines
11511151 (video_levels->blank << TV_BLANK_LEVEL_SHIFT)));
11521152 {
11531153 int pipeconf_reg = PIPECONF(pipe);
1154− int dspcntr_reg = DSPCNTR(pipe);
1154+ int dspcntr_reg = DSPCNTR(intel_crtc->plane);
11551155 int pipeconf = I915_READ(pipeconf_reg);
11561156 int dspcntr = I915_READ(dspcntr_reg);
1157− int dspbase_reg = DSPADDR(pipe);
1157+ int dspbase_reg = DSPADDR(intel_crtc->plane);
11581158 int xpos = 0x0, ypos = 0x0;
11591159 unsigned int xsize, ysize;
11601160 /* Pipe must be off here */
@@ -1378,7 +1378,9 @@ intel_tv_detect(struct drm_connector *connector, bool force) · 217 unmodified lines
13781378 if (type < 0)
13791379 return connector_status_disconnected;
13801380
1381+ intel_tv->type = type;
13811382 intel_tv_find_better_format(connector);
1383+
13821384 return connector_status_connected;
13831385 }
13841386
@@ -1670,8 +1672,7 @@ intel_tv_init(struct drm_device *dev) · 285 unmodified lines
16701672 *
16711673 * More recent chipsets favour HDMI rather than integrated S-Video.
16721674 */
1673− connector->polled =
1674− DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT;
1675+ connector->polled = DRM_CONNECTOR_POLL_CONNECT;
16751676
16761677 drm_connector_init(dev, connector, &intel_tv_connector_funcs,
16771678 DRM_MODE_CONNECTOR_SVIDEO);
drivers/gpu/drm/nouveau/nouveau_dma.c+1−1
@@ -83,7 +83,7 @@ nouveau_dma_init(struct nouveau_channel *chan) · 82 unmodified lines
8383 return ret;
8484
8585 /* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier object */
86− ret = nouveau_notifier_alloc(chan, NvNotify0, 32, 0xfd0, 0x1000,
86+ ret = nouveau_notifier_alloc(chan, NvNotify0, 32, 0xfe0, 0x1000,
8787 &chan->m2mf_ntfy);
8888 if (ret)
8989 return ret;
drivers/gpu/drm/nouveau/nouveau_drv.h+3−0
@@ -682,6 +682,9 @@ struct drm_nouveau_private { · 681 unmodified lines
682682 /* For PFIFO and PGRAPH. */
683683 spinlock_t context_switch_lock;
684684
685+ /* VM/PRAMIN flush, legacy PRAMIN aperture */
686+ spinlock_t vm_lock;
687+
685688 /* RAMIN configuration, RAMFC, RAMHT and RAMRO offsets */
686689 struct nouveau_ramht *ramht;
687690 struct nouveau_gpuobj *ramfc;
drivers/gpu/drm/nouveau/nouveau_fbcon.c+2−2
@@ -181,13 +181,13 @@ nouveau_fbcon_sync(struct fb_info *info) · 180 unmodified lines
181181 OUT_RING (chan, 0);
182182 }
183183
184− nouveau_bo_wr32(chan->notifier_bo, chan->m2mf_ntfy + 3, 0xffffffff);
184+ nouveau_bo_wr32(chan->notifier_bo, chan->m2mf_ntfy/4 + 3, 0xffffffff);
185185 FIRE_RING(chan);
186186 mutex_unlock(&chan->mutex);
187187
188188 ret = -EBUSY;
189189 for (i = 0; i < 100000; i++) {
190− if (!nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy + 3)) {
190+ if (!nouveau_bo_rd32(chan->notifier_bo, chan->m2mf_ntfy/4 + 3)) {
191191 ret = 0;
192192 break;
193193 }
drivers/gpu/drm/nouveau/nouveau_mem.c+1−3
@@ -152,8 +152,6 @@ nouveau_mem_vram_fini(struct drm_device *dev) · 151 unmodified lines
152152 {
153153 struct drm_nouveau_private *dev_priv = dev->dev_private;
154154
155− nouveau_bo_ref(NULL, &dev_priv->vga_ram);
156−
157155 ttm_bo_device_release(&dev_priv->ttm.bdev);
158156
159157 nouveau_ttm_global_release(dev_priv);
@@ -398,7 +396,7 @@ nouveau_mem_vram_init(struct drm_device *dev) · 238 unmodified lines
398396 dma_bits = 40;
399397 } else
400398 if (drm_pci_device_is_pcie(dev) &&
401− dev_priv->chipset != 0x40 &&
399+ dev_priv->chipset > 0x40 &&
402400 dev_priv->chipset != 0x45) {
403401 if (pci_dma_supported(dev->pdev, DMA_BIT_MASK(39)))
404402 dma_bits = 39;
drivers/gpu/drm/nouveau/nouveau_notifier.c+7−4
@@ -35,19 +35,22 @@ nouveau_notifier_init_channel(struct nouveau_channel *chan) · 34 unmodified lines
3535 {
3636 struct drm_device *dev = chan->dev;
3737 struct nouveau_bo *ntfy = NULL;
38− uint32_t flags;
38+ uint32_t flags, ttmpl;
3939 int ret;
4040
41− if (nouveau_vram_notify)
41+ if (nouveau_vram_notify) {
4242 flags = NOUVEAU_GEM_DOMAIN_VRAM;
43− else
43+ ttmpl = TTM_PL_FLAG_VRAM;
44+ } else {
4445 flags = NOUVEAU_GEM_DOMAIN_GART;
46+ ttmpl = TTM_PL_FLAG_TT;
47+ }
4548
4649 ret = nouveau_gem_new(dev, NULL, PAGE_SIZE, 0, flags, 0, 0, &ntfy);
4750 if (ret)
4851 return ret;
4952
50− ret = nouveau_bo_pin(ntfy, flags);
53+ ret = nouveau_bo_pin(ntfy, ttmpl);
5154 if (ret)
5255 goto out_err;
5356
drivers/gpu/drm/nouveau/nouveau_object.c+6−4
@@ -1039,19 +1039,20 @@ nv_ro32(struct nouveau_gpuobj *gpuobj, u32 offset) · 1038 unmodified lines
10391039 {
10401040 struct drm_nouveau_private *dev_priv = gpuobj->dev->dev_private;
10411041 struct drm_device *dev = gpuobj->dev;
1042+ unsigned long flags;
10421043
10431044 if (gpuobj->pinst == ~0 || !dev_priv->ramin_available) {
10441045 u64 ptr = gpuobj->vinst + offset;
10451046 u32 base = ptr >> 16;
10461047 u32 val;
10471048
1048− spin_lock(&dev_priv->ramin_lock);
1049+ spin_lock_irqsave(&dev_priv->vm_lock, flags);
10491050 if (dev_priv->ramin_base != base) {
10501051 dev_priv->ramin_base = base;
10511052 nv_wr32(dev, 0x001700, dev_priv->ramin_base);
10521053 }
10531054 val = nv_rd32(dev, 0x700000 + (ptr & 0xffff));
1054− spin_unlock(&dev_priv->ramin_lock);
1055+ spin_unlock_irqrestore(&dev_priv->vm_lock, flags);
10551056 return val;
10561057 }
10571058
@@ -1063,18 +1064,19 @@ nv_wo32(struct nouveau_gpuobj *gpuobj, u32 offset, u32 val) · 5 unmodified lines
10631064 {
10641065 struct drm_nouveau_private *dev_priv = gpuobj->dev->dev_private;
10651066 struct drm_device *dev = gpuobj->dev;
1067+ unsigned long flags;
10661068
10671069 if (gpuobj->pinst == ~0 || !dev_priv->ramin_available) {
10681070 u64 ptr = gpuobj->vinst + offset;
10691071 u32 base = ptr >> 16;
10701072
1071− spin_lock(&dev_priv->ramin_lock);
1073+ spin_lock_irqsave(&dev_priv->vm_lock, flags);
10721074 if (dev_priv->ramin_base != base) {
10731075 dev_priv->ramin_base = base;
10741076 nv_wr32(dev, 0x001700, dev_priv->ramin_base);
10751077 }
10761078 nv_wr32(dev, 0x700000 + (ptr & 0xffff), val);
1077− spin_unlock(&dev_priv->ramin_lock);
1079+ spin_unlock_irqrestore(&dev_priv->vm_lock, flags);
10781080 return;
10791081 }
10801082
drivers/gpu/drm/nouveau/nouveau_sgdma.c+5−3
@@ -42,7 +42,8 @@ nouveau_sgdma_populate(struct ttm_backend *be, unsigned long num_pages, · 41 unmodified lines
4242
4343 nvbe->nr_pages = 0;
4444 while (num_pages--) {
45− if (dma_addrs[nvbe->nr_pages] != DMA_ERROR_CODE) {
45+ /* this code path isn't called and is incorrect anyways */
46+ if (0) { /*dma_addrs[nvbe->nr_pages] != DMA_ERROR_CODE)*/
4647 nvbe->pages[nvbe->nr_pages] =
4748 dma_addrs[nvbe->nr_pages];
4849 nvbe->ttm_alloced[nvbe->nr_pages] = true;
@@ -55,6 +56,7 @@ nouveau_sgdma_populate(struct ttm_backend *be, unsigned long num_pages, · 6 unmodified lines
5556 be->func->clear(be);
5657 return -EFAULT;
5758 }
59+ nvbe->ttm_alloced[nvbe->nr_pages] = false;
5860 }
5961
6062 nvbe->nr_pages++;
@@ -427,7 +429,7 @@ nouveau_sgdma_init(struct drm_device *dev) · 366 unmodified lines
427429 u32 aper_size, align;
428430 int ret;
429431
430− if (dev_priv->card_type >= NV_50 || drm_pci_device_is_pcie(dev))
432+ if (dev_priv->card_type >= NV_40 && drm_pci_device_is_pcie(dev))
431433 aper_size = 512 * 1024 * 1024;
432434 else
433435 aper_size = 64 * 1024 * 1024;
@@ -457,7 +459,7 @@ nouveau_sgdma_init(struct drm_device *dev) · 23 unmodified lines
457459 dev_priv->gart_info.func = &nv50_sgdma_backend;
458460 } else
459461 if (drm_pci_device_is_pcie(dev) &&
460− dev_priv->chipset != 0x40 && dev_priv->chipset != 0x45) {
462+ dev_priv->chipset > 0x40 && dev_priv->chipset != 0x45) {
461463 if (nv44_graph_class(dev)) {
462464 dev_priv->gart_info.func = &nv44_sgdma_backend;
463465 align = 512 * 1024;
drivers/gpu/drm/nouveau/nouveau_state.c+6−0
@@ -608,6 +608,7 @@ nouveau_card_init(struct drm_device *dev) · 607 unmodified lines
608608 spin_lock_init(&dev_priv->channels.lock);
609609 spin_lock_init(&dev_priv->tile.lock);
610610 spin_lock_init(&dev_priv->context_switch_lock);
611+ spin_lock_init(&dev_priv->vm_lock);
611612
612613 /* Make the CRTCs and I2C buses accessible */
613614 ret = engine->display.early_init(dev);
@@ -767,6 +768,11 @@ static void nouveau_card_takedown(struct drm_device *dev) · 153 unmodified lines
767768 engine->mc.takedown(dev);
768769 engine->display.late_takedown(dev);
769770
771+ if (dev_priv->vga_ram) {
772+ nouveau_bo_unpin(dev_priv->vga_ram);
773+ nouveau_bo_ref(NULL, &dev_priv->vga_ram);
774+ }
775+
770776 mutex_lock(&dev->struct_mutex);
771777 ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_VRAM);
772778 ttm_bo_clean_mm(&dev_priv->ttm.bdev, TTM_PL_TT);
drivers/gpu/drm/nouveau/nv50_instmem.c+6−4
@@ -404,23 +404,25 @@ void · 403 unmodified lines
404404 nv50_instmem_flush(struct drm_device *dev)
405405 {
406406 struct drm_nouveau_private *dev_priv = dev->dev_private;
407+ unsigned long flags;
407408
408− spin_lock(&dev_priv->ramin_lock);
409+ spin_lock_irqsave(&dev_priv->vm_lock, flags);
409410 nv_wr32(dev, 0x00330c, 0x00000001);
410411 if (!nv_wait(dev, 0x00330c, 0x00000002, 0x00000000))
411412 NV_ERROR(dev, "PRAMIN flush timeout\n");
412− spin_unlock(&dev_priv->ramin_lock);
413+ spin_unlock_irqrestore(&dev_priv->vm_lock, flags);
413414 }
414415
415416 void
416417 nv84_instmem_flush(struct drm_device *dev)
417418 {
418419 struct drm_nouveau_private *dev_priv = dev->dev_private;
420+ unsigned long flags;
419421
420− spin_lock(&dev_priv->ramin_lock);
422+ spin_lock_irqsave(&dev_priv->vm_lock, flags);
421423 nv_wr32(dev, 0x070000, 0x00000001);
422424 if (!nv_wait(dev, 0x070000, 0x00000002, 0x00000000))
423425 NV_ERROR(dev, "PRAMIN flush timeout\n");
424− spin_unlock(&dev_priv->ramin_lock);
426+ spin_unlock_irqrestore(&dev_priv->vm_lock, flags);
425427 }
426428
drivers/gpu/drm/nouveau/nv50_vm.c+3−2
@@ -174,10 +174,11 @@ void · 173 unmodified lines
174174 nv50_vm_flush_engine(struct drm_device *dev, int engine)
175175 {
176176 struct drm_nouveau_private *dev_priv = dev->dev_private;
177+ unsigned long flags;
177178
178− spin_lock(&dev_priv->ramin_lock);
179+ spin_lock_irqsave(&dev_priv->vm_lock, flags);
179180 nv_wr32(dev, 0x100c80, (engine << 16) | 1);
180181 if (!nv_wait(dev, 0x100c80, 0x00000001, 0x00000000))
181182 NV_ERROR(dev, "vm flush timeout: engine %d\n", engine);
182− spin_unlock(&dev_priv->ramin_lock);
183+ spin_unlock_irqrestore(&dev_priv->vm_lock, flags);
183184 }
drivers/gpu/drm/nouveau/nvc0_vm.c+3−2
@@ -104,11 +104,12 @@ nvc0_vm_flush(struct nouveau_vm *vm) · 103 unmodified lines
104104 struct nouveau_instmem_engine *pinstmem = &dev_priv->engine.instmem;
105105 struct drm_device *dev = vm->dev;
106106 struct nouveau_vm_pgd *vpgd;
107+ unsigned long flags;
107108 u32 engine = (dev_priv->chan_vm == vm) ? 1 : 5;
108109
109110 pinstmem->flush(vm->dev);
110111
111− spin_lock(&dev_priv->ramin_lock);
112+ spin_lock_irqsave(&dev_priv->vm_lock, flags);
112113 list_for_each_entry(vpgd, &vm->pgd_list, head) {
113114 /* looks like maybe a "free flush slots" counter, the
114115 * faster you write to 0x100cbc to more it decreases
@@ -125,5 +126,5 @@ nvc0_vm_flush(struct nouveau_vm *vm) · 10 unmodified lines
125126 nv_rd32(dev, 0x100c80), engine);
126127 }
127128 }
128− spin_unlock(&dev_priv->ramin_lock);
129+ spin_unlock_irqrestore(&dev_priv->vm_lock, flags);
129130 }
drivers/gpu/drm/radeon/atom.c+3−3
@@ -135,7 +135,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base, · 134 unmodified lines
135135 case ATOM_IIO_MOVE_INDEX:
136136 temp &=
137137 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
138− CU8(base + 2));
138+ CU8(base + 3));
139139 temp |=
140140 ((index >> CU8(base + 2)) &
141141 (0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base +
@@ -145,7 +145,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base, · 3 unmodified lines
145145 case ATOM_IIO_MOVE_DATA:
146146 temp &=
147147 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
148− CU8(base + 2));
148+ CU8(base + 3));
149149 temp |=
150150 ((data >> CU8(base + 2)) &
151151 (0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base +
@@ -155,7 +155,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base, · 3 unmodified lines
155155 case ATOM_IIO_MOVE_ATTR:
156156 temp &=
157157 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) <<
158− CU8(base + 2));
158+ CU8(base + 3));
159159 temp |=
160160 ((ctx->
161161 io_attr >> CU8(base + 2)) & (0xFFFFFFFF >> (32 -
drivers/gpu/drm/radeon/atombios_crtc.c+1−5
@@ -532,10 +532,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, · 531 unmodified lines
532532 else
533533 pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
534534
535− if ((rdev->family == CHIP_R600) ||
536− (rdev->family == CHIP_RV610) ||
537− (rdev->family == CHIP_RV630) ||
538− (rdev->family == CHIP_RV670))
535+ if (rdev->family < CHIP_RV770)
539536 pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
540537 } else {
541538 pll->flags |= RADEON_PLL_LEGACY;
@@ -565,7 +562,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, · 23 unmodified lines
565562 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
566563 if (ss_enabled) {
567564 if (ss->refdiv) {
568− pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
569565 pll->flags |= RADEON_PLL_USE_REF_DIV;
570566 pll->reference_div = ss->refdiv;
571567 if (ASIC_IS_AVIVO(rdev))
drivers/gpu/drm/radeon/evergreen.c+58−55
@@ -353,7 +353,7 @@ static u32 evergreen_line_buffer_adjust(struct radeon_device *rdev, · 352 unmodified lines
353353 struct drm_display_mode *mode,
354354 struct drm_display_mode *other_mode)
355355 {
356− u32 tmp = 0;
356+ u32 tmp;
357357 /*
358358 * Line Buffer Setup
359359 * There are 3 line buffers, each one shared by 2 display controllers.
@@ -363,64 +363,63 @@ static u32 evergreen_line_buffer_adjust(struct radeon_device *rdev, · 3 unmodified lines
363363 * first display controller
364364 * 0 - first half of lb (3840 * 2)
365365 * 1 - first 3/4 of lb (5760 * 2)
366− * 2 - whole lb (7680 * 2)
366+ * 2 - whole lb (7680 * 2), other crtc must be disabled
367367 * 3 - first 1/4 of lb (1920 * 2)
368368 * second display controller
369369 * 4 - second half of lb (3840 * 2)
370370 * 5 - second 3/4 of lb (5760 * 2)
371− * 6 - whole lb (7680 * 2)
371+ * 6 - whole lb (7680 * 2), other crtc must be disabled
372372 * 7 - last 1/4 of lb (1920 * 2)
373373 */
374− if (mode && other_mode) {
375− if (mode->hdisplay > other_mode->hdisplay) {
376− if (mode->hdisplay > 2560)
377− tmp = 1; /* 3/4 */
378− else
379− tmp = 0; /* 1/2 */
380− } else if (other_mode->hdisplay > mode->hdisplay) {
381− if (other_mode->hdisplay > 2560)
382− tmp = 3; /* 1/4 */
383− else
384− tmp = 0; /* 1/2 */
385− } else
374+ /* this can get tricky if we have two large displays on a paired group
375+ * of crtcs. Ideally for multiple large displays we'd assign them to
376+ * non-linked crtcs for maximum line buffer allocation.
377+ */
378+ if (radeon_crtc->base.enabled && mode) {
379+ if (other_mode)
386380 tmp = 0; /* 1/2 */
387− } else if (mode)
388− tmp = 2; /* whole */
389− else if (other_mode)
390− tmp = 3; /* 1/4 */
381+ else
382+ tmp = 2; /* whole */
383+ } else
384+ tmp = 0;
391385
392386 /* second controller of the pair uses second half of the lb */
393387 if (radeon_crtc->crtc_id % 2)
394388 tmp += 4;
395389 WREG32(DC_LB_MEMORY_SPLIT + radeon_crtc->crtc_offset, tmp);
396390
397− switch (tmp) {
398− case 0:
399− case 4:
400− default:
401− if (ASIC_IS_DCE5(rdev))
402− return 4096 * 2;
403− else
404− return 3840 * 2;
405− case 1:
406− case 5:
407− if (ASIC_IS_DCE5(rdev))
408− return 6144 * 2;
409− else
410− return 5760 * 2;
411− case 2:
412− case 6:
413− if (ASIC_IS_DCE5(rdev))
414− return 8192 * 2;
415− else
416− return 7680 * 2;
417− case 3:
418− case 7:
419− if (ASIC_IS_DCE5(rdev))
420− return 2048 * 2;
421− else
422− return 1920 * 2;
391+ if (radeon_crtc->base.enabled && mode) {
392+ switch (tmp) {
393+ case 0:
394+ case 4:
395+ default:
396+ if (ASIC_IS_DCE5(rdev))
397+ return 4096 * 2;
398+ else
399+ return 3840 * 2;
400+ case 1:
401+ case 5:
402+ if (ASIC_IS_DCE5(rdev))
403+ return 6144 * 2;
404+ else
405+ return 5760 * 2;
406+ case 2:
407+ case 6:
408+ if (ASIC_IS_DCE5(rdev))
409+ return 8192 * 2;
410+ else
411+ return 7680 * 2;
412+ case 3:
413+ case 7:
414+ if (ASIC_IS_DCE5(rdev))
415+ return 2048 * 2;
416+ else
417+ return 1920 * 2;
418+ }
423419 }
420+
421+ /* controller not enabled, so no lb used */
422+ return 0;
424423 }
425424
426425 static u32 evergreen_get_number_of_dram_channels(struct radeon_device *rdev)
@@ -863,9 +862,15 @@ int evergreen_pcie_gart_enable(struct radeon_device *rdev) · 436 unmodified lines
863862 SYSTEM_ACCESS_MODE_NOT_IN_SYS |
864863 SYSTEM_APERTURE_UNMAPPED_ACCESS_PASS_THRU |
865864 EFFECTIVE_L1_TLB_SIZE(5) | EFFECTIVE_L1_QUEUE_SIZE(5);
866− WREG32(MC_VM_MD_L1_TLB0_CNTL, tmp);
867− WREG32(MC_VM_MD_L1_TLB1_CNTL, tmp);
868− WREG32(MC_VM_MD_L1_TLB2_CNTL, tmp);
865+ if (rdev->flags & RADEON_IS_IGP) {
866+ WREG32(FUS_MC_VM_MD_L1_TLB0_CNTL, tmp);
867+ WREG32(FUS_MC_VM_MD_L1_TLB1_CNTL, tmp);
868+ WREG32(FUS_MC_VM_MD_L1_TLB2_CNTL, tmp);
869+ } else {
870+ WREG32(MC_VM_MD_L1_TLB0_CNTL, tmp);
871+ WREG32(MC_VM_MD_L1_TLB1_CNTL, tmp);
872+ WREG32(MC_VM_MD_L1_TLB2_CNTL, tmp);
873+ }
869874 WREG32(MC_VM_MB_L1_TLB0_CNTL, tmp);
870875 WREG32(MC_VM_MB_L1_TLB1_CNTL, tmp);
871876 WREG32(MC_VM_MB_L1_TLB2_CNTL, tmp);
@@ -1775,7 +1780,10 @@ static void evergreen_gpu_init(struct radeon_device *rdev) · 903 unmodified lines
17751780
17761781
17771782 mc_shared_chmap = RREG32(MC_SHARED_CHMAP);
1778− mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);
1783+ if (rdev->flags & RADEON_IS_IGP)
1784+ mc_arb_ramcfg = RREG32(FUS_MC_ARB_RAMCFG);
1785+ else
1786+ mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG);
17791787
17801788 switch (rdev->config.evergreen.max_tile_pipes) {
17811789 case 1:
@@ -2581,7 +2589,7 @@ static inline u32 evergreen_get_ih_wptr(struct radeon_device *rdev) · 799 unmodified lines
25812589 u32 wptr, tmp;
25822590
25832591 if (rdev->wb.enabled)
2584− wptr = rdev->wb.wb[R600_WB_IH_WPTR_OFFSET/4];
2592+ wptr = le32_to_cpu(rdev->wb.wb[R600_WB_IH_WPTR_OFFSET/4]);
25852593 else
25862594 wptr = RREG32(IH_RB_WPTR);
25872595
@@ -2924,11 +2932,6 @@ static int evergreen_startup(struct radeon_device *rdev) · 336 unmodified lines
29242932 rdev->asic->copy = NULL;
29252933 dev_warn(rdev->dev, "failed blitter (%d) falling back to memcpy\n", r);
29262934 }
2927− /* XXX: ontario has problems blitting to gart at the moment */
2928− if (rdev->family == CHIP_PALM) {
2929− rdev->asic->copy = NULL;
2930− radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size);
2931− }
29322935
29332936 /* allocate wb buffer */
29342937 r = radeon_wb_init(rdev);
drivers/gpu/drm/radeon/evergreend.h+6−0
@@ -200,6 +200,7 @@ · 199 unmodified lines
200200 #define BURSTLENGTH_SHIFT 9
201201 #define BURSTLENGTH_MASK 0x00000200
202202 #define CHANSIZE_OVERRIDE (1 << 11)
203+#define FUS_MC_ARB_RAMCFG 0x2768
203204 #define MC_VM_AGP_TOP 0x2028
204205 #define MC_VM_AGP_BOT 0x202C
205206 #define MC_VM_AGP_BASE 0x2030
@@ -221,6 +222,11 @@ · 15 unmodified lines
221222 #define MC_VM_MD_L1_TLB0_CNTL 0x2654
222223 #define MC_VM_MD_L1_TLB1_CNTL 0x2658
223224 #define MC_VM_MD_L1_TLB2_CNTL 0x265C
225+
226+#define FUS_MC_VM_MD_L1_TLB0_CNTL 0x265C
227+#define FUS_MC_VM_MD_L1_TLB1_CNTL 0x2660
228+#define FUS_MC_VM_MD_L1_TLB2_CNTL 0x2664
229+
224230 #define MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR 0x203C
225231 #define MC_VM_SYSTEM_APERTURE_HIGH_ADDR 0x2038
226232 #define MC_VM_SYSTEM_APERTURE_LOW_ADDR 0x2034
drivers/gpu/drm/radeon/ni.c+9−9
@@ -674,7 +674,7 @@ static void cayman_gpu_init(struct radeon_device *rdev) · 673 unmodified lines
674674
675675 cc_rb_backend_disable = RREG32(CC_RB_BACKEND_DISABLE);
676676 cc_gc_shader_pipe_config = RREG32(CC_GC_SHADER_PIPE_CONFIG);
677− cgts_tcc_disable = RREG32(CGTS_TCC_DISABLE);
677+ cgts_tcc_disable = 0xff000000;
678678 gc_user_rb_backend_disable = RREG32(GC_USER_RB_BACKEND_DISABLE);
679679 gc_user_shader_pipe_config = RREG32(GC_USER_SHADER_PIPE_CONFIG);
680680 cgts_user_tcc_disable = RREG32(CGTS_USER_TCC_DISABLE);
@@ -871,7 +871,7 @@ static void cayman_gpu_init(struct radeon_device *rdev) · 190 unmodified lines
871871
872872 smx_dc_ctl0 = RREG32(SMX_DC_CTL0);
873873 smx_dc_ctl0 &= ~NUMBER_OF_SETS(0x1ff);
874− smx_dc_ctl0 |= NUMBER_OF_SETS(rdev->config.evergreen.sx_num_of_sets);
874+ smx_dc_ctl0 |= NUMBER_OF_SETS(rdev->config.cayman.sx_num_of_sets);
875875 WREG32(SMX_DC_CTL0, smx_dc_ctl0);
876876
877877 WREG32(SPI_CONFIG_CNTL_1, VTX_DONE_DELAY(4) | CRC_SIMD_ID_WADDR_DISABLE);
@@ -887,20 +887,20 @@ static void cayman_gpu_init(struct radeon_device *rdev) · 9 unmodified lines
887887
888888 WREG32(TA_CNTL_AUX, DISABLE_CUBE_ANISO);
889889
890− WREG32(SX_EXPORT_BUFFER_SIZES, (COLOR_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_size / 4) - 1) |
891− POSITION_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_pos_size / 4) - 1) |
892− SMX_BUFFER_SIZE((rdev->config.evergreen.sx_max_export_smx_size / 4) - 1)));
890+ WREG32(SX_EXPORT_BUFFER_SIZES, (COLOR_BUFFER_SIZE((rdev->config.cayman.sx_max_export_size / 4) - 1) |
891+ POSITION_BUFFER_SIZE((rdev->config.cayman.sx_max_export_pos_size / 4) - 1) |
892+ SMX_BUFFER_SIZE((rdev->config.cayman.sx_max_export_smx_size / 4) - 1)));
893893
894− WREG32(PA_SC_FIFO_SIZE, (SC_PRIM_FIFO_SIZE(rdev->config.evergreen.sc_prim_fifo_size) |
895− SC_HIZ_TILE_FIFO_SIZE(rdev->config.evergreen.sc_hiz_tile_fifo_size) |
896− SC_EARLYZ_TILE_FIFO_SIZE(rdev->config.evergreen.sc_earlyz_tile_fifo_size)));
894+ WREG32(PA_SC_FIFO_SIZE, (SC_PRIM_FIFO_SIZE(rdev->config.cayman.sc_prim_fifo_size) |
895+ SC_HIZ_TILE_FIFO_SIZE(rdev->config.cayman.sc_hiz_tile_fifo_size) |
896+ SC_EARLYZ_TILE_FIFO_SIZE(rdev->config.cayman.sc_earlyz_tile_fifo_size)));
897897
898898
899899 WREG32(VGT_NUM_INSTANCES, 1);
900900
901901 WREG32(CP_PERFMON_CNTL, 0);
902902
903− WREG32(SQ_MS_FIFO_SIZES, (CACHE_FIFO_SIZE(16 * rdev->config.evergreen.sq_num_cf_insts) |
903+ WREG32(SQ_MS_FIFO_SIZES, (CACHE_FIFO_SIZE(16 * rdev->config.cayman.sq_num_cf_insts) |
904904 FETCH_FIFO_HIWATER(0x4) |
905905 DONE_FIFO_HIWATER(0xe0) |
906906 ALU_UPDATE_FIFO_HIWATER(0x8)));
drivers/gpu/drm/radeon/r600.c+1−1
@@ -3231,7 +3231,7 @@ static inline u32 r600_get_ih_wptr(struct radeon_device *rdev) · 3230 unmodified lines
32313231 u32 wptr, tmp;
32323232
32333233 if (rdev->wb.enabled)
3234− wptr = rdev->wb.wb[R600_WB_IH_WPTR_OFFSET/4];
3234+ wptr = le32_to_cpu(rdev->wb.wb[R600_WB_IH_WPTR_OFFSET/4]);
32353235 else
32363236 wptr = RREG32(IH_RB_WPTR);
32373237
drivers/gpu/drm/radeon/radeon_atombios.c+16−7
@@ -431,7 +431,7 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, · 430 unmodified lines
431431 }
432432 }
433433
434− /* Acer laptop (Acer TravelMate 5730G) has an HDMI port
434+ /* Acer laptop (Acer TravelMate 5730/5730G) has an HDMI port
435435 * on the laptop and a DVI port on the docking station and
436436 * both share the same encoder, hpd pin, and ddc line.
437437 * So while the bios table is technically correct,
@@ -440,7 +440,7 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, · 2 unmodified lines
440440 * with different crtcs which isn't possible on the hardware
441441 * side and leaves no crtcs for LVDS or VGA.
442442 */
443− if ((dev->pdev->device == 0x95c4) &&
443+ if (((dev->pdev->device == 0x95c4) || (dev->pdev->device == 0x9591)) &&
444444 (dev->pdev->subsystem_vendor == 0x1025) &&
445445 (dev->pdev->subsystem_device == 0x013c)) {
446446 if ((*connector_type == DRM_MODE_CONNECTOR_DVII) &&
@@ -1574,9 +1574,17 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct · 1127 unmodified lines
15741574 ATOM_FAKE_EDID_PATCH_RECORD *fake_edid_record;
15751575 ATOM_PANEL_RESOLUTION_PATCH_RECORD *panel_res_record;
15761576 bool bad_record = false;
1577− u8 *record = (u8 *)(mode_info->atom_context->bios +
1578− data_offset +
1579− le16_to_cpu(lvds_info->info.usModePatchTableOffset));
1577+ u8 *record;
1578+
1579+ if ((frev == 1) && (crev < 2))
1580+ /* absolute */
1581+ record = (u8 *)(mode_info->atom_context->bios +
1582+ le16_to_cpu(lvds_info->info.usModePatchTableOffset));
1583+ else
1584+ /* relative */
1585+ record = (u8 *)(mode_info->atom_context->bios +
1586+ data_offset +
1587+ le16_to_cpu(lvds_info->info.usModePatchTableOffset));
15801588 while (*record != ATOM_RECORD_END_TYPE) {
15811589 switch (*record) {
15821590 case LCD_MODE_PATCH_RECORD_MODE_TYPE:
@@ -1599,9 +1607,10 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct · 16 unmodified lines
15991607 memcpy((u8 *)edid, (u8 *)&fake_edid_record->ucFakeEDIDString[0],
16001608 fake_edid_record->ucFakeEDIDLength);
16011609
1602− if (drm_edid_is_valid(edid))
1610+ if (drm_edid_is_valid(edid)) {
16031611 rdev->mode_info.bios_hardcoded_edid = edid;
1604− else
1612+ rdev->mode_info.bios_hardcoded_edid_size = edid_size;
1613+ } else
16051614 kfree(edid);
16061615 }
16071616 }
drivers/gpu/drm/radeon/radeon_atpx_handler.c+27−2
@@ -15,6 +15,9 @@ · 14 unmodified lines
1515 #define ATPX_VERSION 0
1616 #define ATPX_GPU_PWR 2
1717 #define ATPX_MUX_SELECT 3
18+#define ATPX_I2C_MUX_SELECT 4
19+#define ATPX_SWITCH_START 5
20+#define ATPX_SWITCH_END 6
1821
1922 #define ATPX_INTEGRATED 0
2023 #define ATPX_DISCRETE 1
@@ -149,13 +152,35 @@ static int radeon_atpx_switch_mux(acpi_handle handle, int mux_id) · 128 unmodified lines
149152 return radeon_atpx_execute(handle, ATPX_MUX_SELECT, mux_id);
150153 }
151154
155+static int radeon_atpx_switch_i2c_mux(acpi_handle handle, int mux_id)
156+{
157+ return radeon_atpx_execute(handle, ATPX_I2C_MUX_SELECT, mux_id);
158+}
159+
160+static int radeon_atpx_switch_start(acpi_handle handle, int gpu_id)
161+{
162+ return radeon_atpx_execute(handle, ATPX_SWITCH_START, gpu_id);
163+}
164+
165+static int radeon_atpx_switch_end(acpi_handle handle, int gpu_id)
166+{
167+ return radeon_atpx_execute(handle, ATPX_SWITCH_END, gpu_id);
168+}
152169
153170 static int radeon_atpx_switchto(enum vga_switcheroo_client_id id)
154171 {
172+ int gpu_id;
173+
155174 if (id == VGA_SWITCHEROO_IGD)
156− radeon_atpx_switch_mux(radeon_atpx_priv.atpx_handle, 0);
175+ gpu_id = ATPX_INTEGRATED;
157176 else
158− radeon_atpx_switch_mux(radeon_atpx_priv.atpx_handle, 1);
177+ gpu_id = ATPX_DISCRETE;
178+
179+ radeon_atpx_switch_start(radeon_atpx_priv.atpx_handle, gpu_id);
180+ radeon_atpx_switch_mux(radeon_atpx_priv.atpx_handle, gpu_id);
181+ radeon_atpx_switch_i2c_mux(radeon_atpx_priv.atpx_handle, gpu_id);
182+ radeon_atpx_switch_end(radeon_atpx_priv.atpx_handle, gpu_id);
183+
159184 return 0;
160185 }
161186
drivers/gpu/drm/radeon/radeon_connectors.c+12−17
@@ -1199,7 +1199,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 1198 unmodified lines
11991199 if (router->ddc_valid || router->cd_valid) {
12001200 radeon_connector->router_bus = radeon_i2c_lookup(rdev, &router->i2c_info);
12011201 if (!radeon_connector->router_bus)
1202− goto failed;
1202+ DRM_ERROR("Failed to assign router i2c bus! Check dmesg for i2c errors.\n");
12031203 }
12041204 switch (connector_type) {
12051205 case DRM_MODE_CONNECTOR_VGA:
@@ -1208,7 +1208,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 2 unmodified lines
12081208 if (i2c_bus->valid) {
12091209 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
12101210 if (!radeon_connector->ddc_bus)
1211− goto failed;
1211+ DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
12121212 }
12131213 radeon_connector->dac_load_detect = true;
12141214 drm_connector_attach_property(&radeon_connector->base,
@@ -1226,7 +1226,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 11 unmodified lines
12261226 if (i2c_bus->valid) {
12271227 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
12281228 if (!radeon_connector->ddc_bus)
1229− goto failed;
1229+ DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
12301230 }
12311231 radeon_connector->dac_load_detect = true;
12321232 drm_connector_attach_property(&radeon_connector->base,
@@ -1249,7 +1249,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 16 unmodified lines
12491249 if (i2c_bus->valid) {
12501250 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
12511251 if (!radeon_connector->ddc_bus)
1252− goto failed;
1252+ DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
12531253 }
12541254 subpixel_order = SubPixelHorizontalRGB;
12551255 drm_connector_attach_property(&radeon_connector->base,
@@ -1290,7 +1290,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 34 unmodified lines
12901290 if (i2c_bus->valid) {
12911291 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
12921292 if (!radeon_connector->ddc_bus)
1293− goto failed;
1293+ DRM_ERROR("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
12941294 }
12951295 drm_connector_attach_property(&radeon_connector->base,
12961296 rdev->mode_info.coherent_mode_property,
@@ -1329,10 +1329,10 @@ radeon_add_atom_connector(struct drm_device *dev, · 32 unmodified lines
13291329 else
13301330 radeon_dig_connector->dp_i2c_bus = radeon_i2c_create_dp(dev, i2c_bus, "DP-auxch");
13311331 if (!radeon_dig_connector->dp_i2c_bus)
1332− goto failed;
1332+ DRM_ERROR("DP: Failed to assign dp ddc bus! Check dmesg for i2c errors.\n");
13331333 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
13341334 if (!radeon_connector->ddc_bus)
1335− goto failed;
1335+ DRM_ERROR("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
13361336 }
13371337 subpixel_order = SubPixelHorizontalRGB;
13381338 drm_connector_attach_property(&radeon_connector->base,
@@ -1381,7 +1381,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 42 unmodified lines
13811381 if (i2c_bus->valid) {
13821382 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
13831383 if (!radeon_connector->ddc_bus)
1384− goto failed;
1384+ DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
13851385 }
13861386 drm_connector_attach_property(&radeon_connector->base,
13871387 dev->mode_config.scaling_mode_property,
@@ -1457,7 +1457,7 @@ radeon_add_legacy_connector(struct drm_device *dev, · 69 unmodified lines
14571457 if (i2c_bus->valid) {
14581458 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
14591459 if (!radeon_connector->ddc_bus)
1460− goto failed;
1460+ DRM_ERROR("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
14611461 }
14621462 radeon_connector->dac_load_detect = true;
14631463 drm_connector_attach_property(&radeon_connector->base,
@@ -1475,7 +1475,7 @@ radeon_add_legacy_connector(struct drm_device *dev, · 11 unmodified lines
14751475 if (i2c_bus->valid) {
14761476 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
14771477 if (!radeon_connector->ddc_bus)
1478− goto failed;
1478+ DRM_ERROR("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
14791479 }
14801480 radeon_connector->dac_load_detect = true;
14811481 drm_connector_attach_property(&radeon_connector->base,
@@ -1493,7 +1493,7 @@ radeon_add_legacy_connector(struct drm_device *dev, · 11 unmodified lines
14931493 if (i2c_bus->valid) {
14941494 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
14951495 if (!radeon_connector->ddc_bus)
1496− goto failed;
1496+ DRM_ERROR("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
14971497 }
14981498 if (connector_type == DRM_MODE_CONNECTOR_DVII) {
14991499 radeon_connector->dac_load_detect = true;
@@ -1538,7 +1538,7 @@ radeon_add_legacy_connector(struct drm_device *dev, · 38 unmodified lines
15381538 if (i2c_bus->valid) {
15391539 radeon_connector->ddc_bus = radeon_i2c_lookup(rdev, i2c_bus);
15401540 if (!radeon_connector->ddc_bus)
1541− goto failed;
1541+ DRM_ERROR("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n");
15421542 }
15431543 drm_connector_attach_property(&radeon_connector->base,
15441544 dev->mode_config.scaling_mode_property,
@@ -1567,9 +1567,4 @@ radeon_add_legacy_connector(struct drm_device *dev, · 22 unmodified lines
15671567 radeon_legacy_backlight_init(radeon_encoder, connector);
15681568 }
15691569 }
1570− return;
1571−
1572−failed:
1573− drm_connector_cleanup(connector);
1574− kfree(connector);
15751570 }
drivers/gpu/drm/radeon/radeon_cursor.c+3−3
@@ -167,9 +167,6 @@ int radeon_crtc_cursor_set(struct drm_crtc *crtc, · 166 unmodified lines
167167 return -EINVAL;
168168 }
169169
170− radeon_crtc->cursor_width = width;
171− radeon_crtc->cursor_height = height;
172−
173170 obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
174171 if (!obj) {
175172 DRM_ERROR("Cannot find cursor object %x for crtc %d\n", handle, radeon_crtc->crtc_id);
@@ -180,6 +177,9 @@ int radeon_crtc_cursor_set(struct drm_crtc *crtc, · 4 unmodified lines
180177 if (ret)
181178 goto fail;
182179
180+ radeon_crtc->cursor_width = width;
181+ radeon_crtc->cursor_height = height;
182+
183183 radeon_lock_cursor(crtc, true);
184184 /* XXX only 27 bit offset for legacy cursor */
185185 radeon_set_cursor(crtc, obj, gpu_addr);
drivers/gpu/drm/radeon/radeon_gart.c+3−3
@@ -181,9 +181,9 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, · 180 unmodified lines
181181 p = t / (PAGE_SIZE / RADEON_GPU_PAGE_SIZE);
182182
183183 for (i = 0; i < pages; i++, p++) {
184− /* On TTM path, we only use the DMA API if TTM_PAGE_FLAG_DMA32
185− * is requested. */
186− if (dma_addr[i] != DMA_ERROR_CODE) {
184+ /* we reverted the patch using dma_addr in TTM for now but this
185+ * code stops building on alpha so just comment it out for now */
186+ if (0) { /*dma_addr[i] != DMA_ERROR_CODE) */
187187 rdev->gart.ttm_alloced[p] = true;
188188 rdev->gart.pages_addr[p] = dma_addr[i];
189189 } else {
drivers/gpu/drm/radeon/radeon_i2c.c+6−0
@@ -1096,6 +1096,9 @@ void radeon_router_select_ddc_port(struct radeon_connector *radeon_connector) · 1095 unmodified lines
10961096 if (!radeon_connector->router.ddc_valid)
10971097 return;
10981098
1099+ if (!radeon_connector->router_bus)
1100+ return;
1101+
10991102 radeon_i2c_get_byte(radeon_connector->router_bus,
11001103 radeon_connector->router.i2c_addr,
11011104 0x3, &val);
@@ -1121,6 +1124,9 @@ void radeon_router_select_cd_port(struct radeon_connector *radeon_connector) · 19 unmodified lines
11211124 if (!radeon_connector->router.cd_valid)
11221125 return;
11231126
1127+ if (!radeon_connector->router_bus)
1128+ return;
1129+
11241130 radeon_i2c_get_byte(radeon_connector->router_bus,
11251131 radeon_connector->router.i2c_addr,
11261132 0x3, &val);
drivers/gpu/drm/radeon/radeon_kms.c+16−0
@@ -221,6 +221,22 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 220 unmodified lines
221221 return -EINVAL;
222222 }
223223 break;
224+ case RADEON_INFO_NUM_TILE_PIPES:
225+ if (rdev->family >= CHIP_CAYMAN)
226+ value = rdev->config.cayman.max_tile_pipes;
227+ else if (rdev->family >= CHIP_CEDAR)
228+ value = rdev->config.evergreen.max_tile_pipes;
229+ else if (rdev->family >= CHIP_RV770)
230+ value = rdev->config.rv770.max_tile_pipes;
231+ else if (rdev->family >= CHIP_R600)
232+ value = rdev->config.r600.max_tile_pipes;
233+ else {
234+ return -EINVAL;
235+ }
236+ break;
237+ case RADEON_INFO_FUSION_GART_WORKING:
238+ value = 1;
239+ break;
224240 default:
225241 DRM_DEBUG_KMS("Invalid request %d\n", info->request);
226242 return -EINVAL;
drivers/gpu/drm/radeon/reg_srcs/cayman+1−0
@@ -33,6 +33,7 @@ cayman 0x9400 · 32 unmodified lines
3333 0x00008E48 SQ_EX_ALLOC_TABLE_SLOTS
3434 0x00009100 SPI_CONFIG_CNTL
3535 0x0000913C SPI_CONFIG_CNTL_1
36+0x00009508 TA_CNTL_AUX
3637 0x00009830 DB_DEBUG
3738 0x00009834 DB_DEBUG2
3839 0x00009838 DB_DEBUG3
drivers/gpu/drm/radeon/reg_srcs/evergreen+1−0
@@ -46,6 +46,7 @@ evergreen 0x9400 · 45 unmodified lines
4646 0x00008E48 SQ_EX_ALLOC_TABLE_SLOTS
4747 0x00009100 SPI_CONFIG_CNTL
4848 0x0000913C SPI_CONFIG_CNTL_1
49+0x00009508 TA_CNTL_AUX
4950 0x00009700 VC_CNTL
5051 0x00009714 VC_ENHANCE
5152 0x00009830 DB_DEBUG
drivers/gpu/drm/radeon/reg_srcs/r600+1−0
@@ -708,6 +708,7 @@ r600 0x9400 · 707 unmodified lines
708708 0x00028D0C DB_RENDER_CONTROL
709709 0x00028D10 DB_RENDER_OVERRIDE
710710 0x0002880C DB_SHADER_CONTROL
711+0x00028D28 DB_SRESULTS_COMPARE_STATE0
711712 0x00028D2C DB_SRESULTS_COMPARE_STATE1
712713 0x00028430 DB_STENCILREFMASK
713714 0x00028434 DB_STENCILREFMASK_BF
drivers/gpu/vga/vga_switcheroo.c+3−3
@@ -219,9 +219,6 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client) · 218 unmodified lines
219219 int i;
220220 struct vga_switcheroo_client *active = NULL;
221221
222− if (new_client->active == true)
223− return 0;
224−
225222 for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) {
226223 if (vgasr_priv.clients[i].active == true) {
227224 active = &vgasr_priv.clients[i];
@@ -372,6 +369,9 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, · 144 unmodified lines
372369 goto out;
373370 }
374371
372+ if (client->active == true)
373+ goto out;
374+
375375 /* okay we want a switch - test if devices are willing to switch */
376376 can_switch = true;
377377 for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) {
drivers/hwmon/Kconfig+5−6
@@ -110,8 +110,7 @@ config SENSORS_ADM1021 · 109 unmodified lines
110110 help
111111 If you say yes here you get support for Analog Devices ADM1021
112112 and ADM1023 sensor chips and clones: Maxim MAX1617 and MAX1617A,
113− Genesys Logic GL523SM, National Semiconductor LM84, TI THMC10,
114− and the XEON processor built-in sensor.
113+ Genesys Logic GL523SM, National Semiconductor LM84 and TI THMC10.
115114
116115 This driver can also be built as a module. If so, the module
117116 will be called adm1021.
@@ -618,10 +617,10 @@ config SENSORS_LM90 · 500 unmodified lines
618617 depends on I2C
619618 help
620619 If you say yes here you get support for National Semiconductor LM90,
621− LM86, LM89 and LM99, Analog Devices ADM1032 and ADT7461, Maxim
622− MAX6646, MAX6647, MAX6648, MAX6649, MAX6657, MAX6658, MAX6659,
623− MAX6680, MAX6681, MAX6692, MAX6695, MAX6696, and Winbond/Nuvoton
624− W83L771W/G/AWG/ASG sensor chips.
620+ LM86, LM89 and LM99, Analog Devices ADM1032, ADT7461, and ADT7461A,
621+ Maxim MAX6646, MAX6647, MAX6648, MAX6649, MAX6657, MAX6658, MAX6659,
622+ MAX6680, MAX6681, MAX6692, MAX6695, MAX6696, ON Semiconductor NCT1008,
623+ and Winbond/Nuvoton W83L771W/G/AWG/ASG sensor chips.
625624
626625 This driver can also be built as a module. If so, the module
627626 will be called lm90.
drivers/hwmon/lm85.c+4−2
@@ -1094,6 +1094,7 @@ static struct attribute *lm85_attributes_minctl[] = { · 1093 unmodified lines
10941094 &sensor_dev_attr_pwm1_auto_pwm_minctl.dev_attr.attr,
10951095 &sensor_dev_attr_pwm2_auto_pwm_minctl.dev_attr.attr,
10961096 &sensor_dev_attr_pwm3_auto_pwm_minctl.dev_attr.attr,
1097+ NULL
10971098 };
10981099
10991100 static const struct attribute_group lm85_group_minctl = {
@@ -1104,6 +1105,7 @@ static struct attribute *lm85_attributes_temp_off[] = { · 4 unmodified lines
11041105 &sensor_dev_attr_temp1_auto_temp_off.dev_attr.attr,
11051106 &sensor_dev_attr_temp2_auto_temp_off.dev_attr.attr,
11061107 &sensor_dev_attr_temp3_auto_temp_off.dev_attr.attr,
1108+ NULL
11071109 };
11081110
11091111 static const struct attribute_group lm85_group_temp_off = {
@@ -1329,11 +1331,11 @@ static int lm85_probe(struct i2c_client *client, · 219 unmodified lines
13291331 if (data->type != emc6d103s) {
13301332 err = sysfs_create_group(&client->dev.kobj, &lm85_group_minctl);
13311333 if (err)
1332− goto err_kfree;
1334+ goto err_remove_files;
13331335 err = sysfs_create_group(&client->dev.kobj,
13341336 &lm85_group_temp_off);
13351337 if (err)
1336− goto err_kfree;
1338+ goto err_remove_files;
13371339 }
13381340
13391341 /* The ADT7463/68 have an optional VRM 10 mode where pin 21 is used
drivers/hwmon/lm90.c+15−7
@@ -49,10 +49,10 @@ · 48 unmodified lines
4949 * chips, but support three temperature sensors instead of two. MAX6695
5050 * and MAX6696 only differ in the pinout so they can be treated identically.
5151 *
52− * This driver also supports the ADT7461 chip from Analog Devices.
53− * It's supported in both compatibility and extended mode. It is mostly
54− * compatible with LM90 except for a data format difference for the
55− * temperature value registers.
52+ * This driver also supports ADT7461 and ADT7461A from Analog Devices as well as
53+ * NCT1008 from ON Semiconductor. The chips are supported in both compatibility
54+ * and extended mode. They are mostly compatible with LM90 except for a data
55+ * format difference for the temperature value registers.
5656 *
5757 * Since the LM90 was the first chipset supported by this driver, most
5858 * comments will refer to this chipset, but are actually general and
@@ -88,9 +88,10 @@ · 29 unmodified lines
8888 * Addresses to scan
8989 * Address is fully defined internally and cannot be changed except for
9090 * MAX6659, MAX6680 and MAX6681.
91− * LM86, LM89, LM90, LM99, ADM1032, ADM1032-1, ADT7461, MAX6649, MAX6657,
92− * MAX6658 and W83L771 have address 0x4c.
93− * ADM1032-2, ADT7461-2, LM89-1, LM99-1 and MAX6646 have address 0x4d.
91+ * LM86, LM89, LM90, LM99, ADM1032, ADM1032-1, ADT7461, ADT7461A, MAX6649,
92+ * MAX6657, MAX6658, NCT1008 and W83L771 have address 0x4c.
93+ * ADM1032-2, ADT7461-2, ADT7461A-2, LM89-1, LM99-1, MAX6646, and NCT1008D
94+ * have address 0x4d.
9495 * MAX6647 has address 0x4e.
9596 * MAX6659 can have address 0x4c, 0x4d or 0x4e.
9697 * MAX6680 and MAX6681 can have address 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b,
@@ -174,6 +175,7 @@ enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680, · 77 unmodified lines
174175 static const struct i2c_device_id lm90_id[] = {
175176 { "adm1032", adm1032 },
176177 { "adt7461", adt7461 },
178+ { "adt7461a", adt7461 },
177179 { "lm90", lm90 },
178180 { "lm86", lm86 },
179181 { "lm89", lm86 },
@@ -188,6 +190,7 @@ static const struct i2c_device_id lm90_id[] = { · 8 unmodified lines
188190 { "max6681", max6680 },
189191 { "max6695", max6696 },
190192 { "max6696", max6696 },
193+ { "nct1008", adt7461 },
191194 { "w83l771", w83l771 },
192195 { }
193196 };
@@ -1153,6 +1156,11 @@ static int lm90_detect(struct i2c_client *new_client, · 959 unmodified lines
11531156 && (reg_config1 & 0x1B) == 0x00
11541157 && reg_convrate <= 0x0A) {
11551158 name = "adt7461";
1159+ } else
1160+ if (chip_id == 0x57 /* ADT7461A, NCT1008 */
1161+ && (reg_config1 & 0x1B) == 0x00
1162+ && reg_convrate <= 0x0A) {
1163+ name = "adt7461a";
11561164 }
11571165 } else
11581166 if (man_id == 0x4D) { /* Maxim */
drivers/hwmon/pmbus_core.c+0−1
@@ -139,7 +139,6 @@ struct pmbus_data { · 138 unmodified lines
139139 * A single status register covers multiple attributes,
140140 * so we keep them all together.
141141 */
142− u8 status_bits;
143142 u8 status[PB_NUM_STATUS_REG];
144143
145144 u8 currpage;
drivers/hwmon/twl4030-madc-hwmon.c+1−2
@@ -98,7 +98,6 @@ static const struct attribute_group twl4030_madc_group = { · 97 unmodified lines
9898 static int __devinit twl4030_madc_hwmon_probe(struct platform_device *pdev)
9999 {
100100 int ret;
101− int status;
102101 struct device *hwmon;
103102
104103 ret = sysfs_create_group(&pdev->dev.kobj, &twl4030_madc_group);
@@ -107,7 +106,7 @@ static int __devinit twl4030_madc_hwmon_probe(struct platform_device *pdev) · 2 unmodified lines
107106 hwmon = hwmon_device_register(&pdev->dev);
108107 if (IS_ERR(hwmon)) {
109108 dev_err(&pdev->dev, "hwmon_device_register failed.\n");
110− status = PTR_ERR(hwmon);
109+ ret = PTR_ERR(hwmon);
111110 goto err_reg;
112111 }
113112
drivers/i2c/busses/i2c-i801.c+5−0
@@ -134,10 +134,15 @@ · 133 unmodified lines
134134 SMBHSTSTS_BUS_ERR | SMBHSTSTS_DEV_ERR | \
135135 SMBHSTSTS_INTR)
136136
137+/* Older devices have their ID defined in <linux/pci_ids.h> */
138+#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22
139+#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22
137140 /* Patsburg also has three 'Integrated Device Function' SMBus controllers */
138141 #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0 0x1d70
139142 #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1 0x1d71
140143 #define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2 0x1d72
144+#define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS 0x2330
145+#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30
141146
142147 struct i801_priv {
143148 struct i2c_adapter adapter;
drivers/i2c/busses/i2c-mpc.c+6−3
@@ -560,15 +560,18 @@ static struct i2c_adapter mpc_ops = { · 559 unmodified lines
560560 .timeout = HZ,
561561 };
562562
563+static const struct of_device_id mpc_i2c_of_match[];
563564 static int __devinit fsl_i2c_probe(struct platform_device *op)
564565 {
566+ const struct of_device_id *match;
565567 struct mpc_i2c *i2c;
566568 const u32 *prop;
567569 u32 clock = MPC_I2C_CLOCK_LEGACY;
568570 int result = 0;
569571 int plen;
570572
571− if (!op->dev.of_match)
573+ match = of_match_device(mpc_i2c_of_match, &op->dev);
574+ if (!match)
572575 return -EINVAL;
573576
574577 i2c = kzalloc(sizeof(*i2c), GFP_KERNEL);
@@ -605,8 +608,8 @@ static int __devinit fsl_i2c_probe(struct platform_device *op) · 30 unmodified lines
605608 clock = *prop;
606609 }
607610
608− if (op->dev.of_match->data) {
609− struct mpc_i2c_data *data = op->dev.of_match->data;
611+ if (match->data) {
612+ struct mpc_i2c_data *data = match->data;
610613 data->setup(op->dev.of_node, i2c, clock, data->prescaler);
611614 } else {
612615 /* Backwards compatibility */
drivers/i2c/busses/i2c-parport.c+14−13
@@ -1,7 +1,7 @@
11 /* ------------------------------------------------------------------------ *
22 * i2c-parport.c I2C bus over parallel port *
33 * ------------------------------------------------------------------------ *
4− Copyright (C) 2003-2010 Jean Delvare <khali@linux-fr.org>
4+ Copyright (C) 2003-2011 Jean Delvare <khali@linux-fr.org>
55
66 Based on older i2c-philips-par.c driver
77 Copyright (C) 1995-2000 Simon G. Vogl
@@ -33,6 +33,8 @@ · 25 unmodified lines
3333 #include <linux/i2c-algo-bit.h>
3434 #include <linux/i2c-smbus.h>
3535 #include <linux/slab.h>
36+#include <linux/list.h>
37+#include <linux/mutex.h>
3638 #include "i2c-parport.h"
3739
3840 /* ----- Device list ------------------------------------------------------ */
@@ -43,10 +45,11 @@ struct i2c_par { · 4 unmodified lines
4345 struct i2c_algo_bit_data algo_data;
4446 struct i2c_smbus_alert_setup alert_data;
4547 struct i2c_client *ara;
46− struct i2c_par *next;
48+ struct list_head node;
4749 };
4850
49−static struct i2c_par *adapter_list;
51+static LIST_HEAD(adapter_list);
52+static DEFINE_MUTEX(adapter_list_lock);
5053
5154 /* ----- Low-level parallel port access ----------------------------------- */
5255
@@ -228,8 +231,9 @@ static void i2c_parport_attach (struct parport *port) · 175 unmodified lines
228231 }
229232
230233 /* Add the new adapter to the list */
231− adapter->next = adapter_list;
232− adapter_list = adapter;
234+ mutex_lock(&adapter_list_lock);
235+ list_add_tail(&adapter->node, &adapter_list);
236+ mutex_unlock(&adapter_list_lock);
233237 return;
234238
235239 ERROR1:
@@ -241,11 +245,11 @@ ERROR0: · 5 unmodified lines
241245
242246 static void i2c_parport_detach (struct parport *port)
243247 {
244− struct i2c_par *adapter, *prev;
248+ struct i2c_par *adapter, *_n;
245249
246250 /* Walk the list */
247− for (prev = NULL, adapter = adapter_list; adapter;
248− prev = adapter, adapter = adapter->next) {
251+ mutex_lock(&adapter_list_lock);
252+ list_for_each_entry_safe(adapter, _n, &adapter_list, node) {
249253 if (adapter->pdev->port == port) {
250254 if (adapter->ara) {
251255 parport_disable_irq(port);
@@ -259,14 +263,11 @@ static void i2c_parport_detach (struct parport *port) · 7 unmodified lines
259263
260264 parport_release(adapter->pdev);
261265 parport_unregister_device(adapter->pdev);
262− if (prev)
263− prev->next = adapter->next;
264− else
265− adapter_list = adapter->next;
266+ list_del(&adapter->node);
266267 kfree(adapter);
267− return;
268268 }
269269 }
270+ mutex_unlock(&adapter_list_lock);
270271 }
271272
272273 static struct parport_driver i2c_parport_driver = {
drivers/i2c/busses/i2c-pnx.c+1−1
@@ -65,7 +65,7 @@ static inline void i2c_pnx_arm_timer(struct i2c_pnx_algo_data *alg_data) · 64 unmodified lines
6565 jiffies, expires);
6666
6767 timer->expires = jiffies + expires;
68− timer->data = (unsigned long)&alg_data;
68+ timer->data = (unsigned long)alg_data;
6969
7070 add_timer(timer);
7171 }
drivers/ide/ide-cd_ioctl.c+6−0
@@ -79,6 +79,12 @@ int ide_cdrom_drive_status(struct cdrom_device_info *cdi, int slot_nr) · 78 unmodified lines
7979 return CDS_DRIVE_NOT_READY;
8080 }
8181
82+/*
83+ * ide-cd always generates media changed event if media is missing, which
84+ * makes it impossible to use for proper event reporting, so disk->events
85+ * is cleared to 0 and the following function is used only to trigger
86+ * revalidation and never propagated to userland.
87+ */
8288 unsigned int ide_cdrom_check_events_real(struct cdrom_device_info *cdi,
8389 unsigned int clearing, int slot_nr)
8490 {
drivers/ide/ide-gd.c+6−1
@@ -298,6 +298,12 @@ static unsigned int ide_gd_check_events(struct gendisk *disk, · 297 unmodified lines
298298 return 0;
299299 }
300300
301+ /*
302+ * The following is used to force revalidation on the first open on
303+ * removeable devices, and never gets reported to userland as
304+ * genhd->events is 0. This is intended as removeable ide disk
305+ * can't really detect MEDIA_CHANGE events.
306+ */
301307 ret = drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED;
302308 drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;
303309
@@ -413,7 +419,6 @@ static int ide_gd_probe(ide_drive_t *drive) · 109 unmodified lines
413419 if (drive->dev_flags & IDE_DFLAG_REMOVABLE)
414420 g->flags = GENHD_FL_REMOVABLE;
415421 g->fops = &ide_gd_ops;
416− g->events = DISK_EVENT_MEDIA_CHANGE;
417422 add_disk(g);
418423 return 0;
419424
drivers/infiniband/hw/qib/qib_iba6120.c+1−1
@@ -1799,7 +1799,7 @@ static int qib_6120_setup_reset(struct qib_devdata *dd) · 1798 unmodified lines
17991799 /*
18001800 * Keep chip from being accessed until we are ready. Use
18011801 * writeq() directly, to allow the write even though QIB_PRESENT
1802− * isn't' set.
1802+ * isn't set.
18031803 */
18041804 dd->flags &= ~(QIB_INITTED | QIB_PRESENT);
18051805 dd->int_counter = 0; /* so we check interrupts work again */
drivers/infiniband/hw/qib/qib_iba7220.c+1−1
@@ -2111,7 +2111,7 @@ static int qib_setup_7220_reset(struct qib_devdata *dd) · 2110 unmodified lines
21112111 /*
21122112 * Keep chip from being accessed until we are ready. Use
21132113 * writeq() directly, to allow the write even though QIB_PRESENT
2114− * isn't' set.
2114+ * isn't set.
21152115 */
21162116 dd->flags &= ~(QIB_INITTED | QIB_PRESENT);
21172117 dd->int_counter = 0; /* so we check interrupts work again */
drivers/infiniband/hw/qib/qib_iba7322.c+1−1
@@ -3299,7 +3299,7 @@ static int qib_do_7322_reset(struct qib_devdata *dd) · 3298 unmodified lines
32993299 /*
33003300 * Keep chip from being accessed until we are ready. Use
33013301 * writeq() directly, to allow the write even though QIB_PRESENT
3302− * isn't' set.
3302+ * isn't set.
33033303 */
33043304 dd->flags &= ~(QIB_INITTED | QIB_PRESENT | QIB_BADINTR);
33053305 dd->flags |= QIB_DOING_RESET;
drivers/input/touchscreen/ads7846.c+10−3
@@ -281,17 +281,24 @@ struct ser_req { · 280 unmodified lines
281281 u8 command;
282282 u8 ref_off;
283283 u16 scratch;
284− __be16 sample;
285284 struct spi_message msg;
286285 struct spi_transfer xfer[6];
286+ /*
287+ * DMA (thus cache coherency maintenance) requires the
288+ * transfer buffers to live in their own cache lines.
289+ */
290+ __be16 sample ____cacheline_aligned;
287291 };
288292
289293 struct ads7845_ser_req {
290294 u8 command[3];
291− u8 pwrdown[3];
292− u8 sample[3];
293295 struct spi_message msg;
294296 struct spi_transfer xfer[2];
297+ /*
298+ * DMA (thus cache coherency maintenance) requires the
299+ * transfer buffers to live in their own cache lines.
300+ */
301+ u8 sample[3] ____cacheline_aligned;
295302 };
296303
297304 static int ads7846_read12_ser(struct device *dev, unsigned command)
drivers/input/touchscreen/wm831x-ts.c+64−11
@@ -68,8 +68,23 @@ struct wm831x_ts { · 67 unmodified lines
6868 unsigned int pd_irq;
6969 bool pressure;
7070 bool pen_down;
71+ struct work_struct pd_data_work;
7172 };
7273
74+static void wm831x_pd_data_work(struct work_struct *work)
75+{
76+ struct wm831x_ts *wm831x_ts =
77+ container_of(work, struct wm831x_ts, pd_data_work);
78+
79+ if (wm831x_ts->pen_down) {
80+ enable_irq(wm831x_ts->data_irq);
81+ dev_dbg(wm831x_ts->wm831x->dev, "IRQ PD->DATA done\n");
82+ } else {
83+ enable_irq(wm831x_ts->pd_irq);
84+ dev_dbg(wm831x_ts->wm831x->dev, "IRQ DATA->PD done\n");
85+ }
86+}
87+
7388 static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data)
7489 {
7590 struct wm831x_ts *wm831x_ts = irq_data;
@@ -110,6 +125,9 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data) · 34 unmodified lines
110125 }
111126
112127 if (!wm831x_ts->pen_down) {
128+ /* Switch from data to pen down */
129+ dev_dbg(wm831x->dev, "IRQ DATA->PD\n");
130+
113131 disable_irq_nosync(wm831x_ts->data_irq);
114132
115133 /* Don't need data any more */
@@ -128,6 +146,10 @@ static irqreturn_t wm831x_ts_data_irq(int irq, void *irq_data) · 12 unmodified lines
128146 ABS_PRESSURE, 0);
129147
130148 input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 0);
149+
150+ schedule_work(&wm831x_ts->pd_data_work);
151+ } else {
152+ input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1);
131153 }
132154
133155 input_sync(wm831x_ts->input_dev);
@@ -141,6 +163,11 @@ static irqreturn_t wm831x_ts_pen_down_irq(int irq, void *irq_data) · 7 unmodified lines
141163 struct wm831x *wm831x = wm831x_ts->wm831x;
142164 int ena = 0;
143165
166+ if (wm831x_ts->pen_down)
167+ return IRQ_HANDLED;
168+
169+ disable_irq_nosync(wm831x_ts->pd_irq);
170+
144171 /* Start collecting data */
145172 if (wm831x_ts->pressure)
146173 ena |= WM831X_TCH_Z_ENA;
@@ -149,14 +176,14 @@ static irqreturn_t wm831x_ts_pen_down_irq(int irq, void *irq_data) · 2 unmodified lines
149176 WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA,
150177 WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA | ena);
151178
152− input_report_key(wm831x_ts->input_dev, BTN_TOUCH, 1);
153− input_sync(wm831x_ts->input_dev);
154−
155179 wm831x_set_bits(wm831x, WM831X_INTERRUPT_STATUS_1,
156180 WM831X_TCHPD_EINT, WM831X_TCHPD_EINT);
157181
158182 wm831x_ts->pen_down = true;
159− enable_irq(wm831x_ts->data_irq);
183+
184+ /* Switch from pen down to data */
185+ dev_dbg(wm831x->dev, "IRQ PD->DATA\n");
186+ schedule_work(&wm831x_ts->pd_data_work);
160187
161188 return IRQ_HANDLED;
162189 }
@@ -182,13 +209,28 @@ static void wm831x_ts_input_close(struct input_dev *idev) · 19 unmodified lines
182209 struct wm831x_ts *wm831x_ts = input_get_drvdata(idev);
183210 struct wm831x *wm831x = wm831x_ts->wm831x;
184211
212+ /* Shut the controller down, disabling all other functionality too */
185213 wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
186− WM831X_TCH_ENA | WM831X_TCH_CVT_ENA |
187− WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
188− WM831X_TCH_Z_ENA, 0);
214+ WM831X_TCH_ENA | WM831X_TCH_X_ENA |
215+ WM831X_TCH_Y_ENA | WM831X_TCH_Z_ENA, 0);
189216
190− if (wm831x_ts->pen_down)
217+ /* Make sure any pending IRQs are done, the above will prevent
218+ * new ones firing.
219+ */
220+ synchronize_irq(wm831x_ts->data_irq);
221+ synchronize_irq(wm831x_ts->pd_irq);
222+
223+ /* Make sure the IRQ completion work is quiesced */
224+ flush_work_sync(&wm831x_ts->pd_data_work);
225+
226+ /* If we ended up with the pen down then make sure we revert back
227+ * to pen detection state for the next time we start up.
228+ */
229+ if (wm831x_ts->pen_down) {
191230 disable_irq(wm831x_ts->data_irq);
231+ enable_irq(wm831x_ts->pd_irq);
232+ wm831x_ts->pen_down = false;
233+ }
192234 }
193235
194236 static __devinit int wm831x_ts_probe(struct platform_device *pdev)
@@ -198,7 +240,7 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) · 3 unmodified lines
198240 struct wm831x_pdata *core_pdata = dev_get_platdata(pdev->dev.parent);
199241 struct wm831x_touch_pdata *pdata = NULL;
200242 struct input_dev *input_dev;
201− int error;
243+ int error, irqf;
202244
203245 if (core_pdata)
204246 pdata = core_pdata->touch;
@@ -212,6 +254,7 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) · 7 unmodified lines
212254
213255 wm831x_ts->wm831x = wm831x;
214256 wm831x_ts->input_dev = input_dev;
257+ INIT_WORK(&wm831x_ts->pd_data_work, wm831x_pd_data_work);
215258
216259 /*
217260 * If we have a direct IRQ use it, otherwise use the interrupt
@@ -270,9 +313,14 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) · 52 unmodified lines
270313 wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
271314 WM831X_TCH_RATE_MASK, 6);
272315
316+ if (pdata && pdata->data_irqf)
317+ irqf = pdata->data_irqf;
318+ else
319+ irqf = IRQF_TRIGGER_HIGH;
320+
273321 error = request_threaded_irq(wm831x_ts->data_irq,
274322 NULL, wm831x_ts_data_irq,
275− IRQF_ONESHOT,
323+ irqf | IRQF_ONESHOT,
276324 "Touchscreen data", wm831x_ts);
277325 if (error) {
278326 dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n",
@@ -281,9 +329,14 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev) · 2 unmodified lines
281329 }
282330 disable_irq(wm831x_ts->data_irq);
283331
332+ if (pdata && pdata->pd_irqf)
333+ irqf = pdata->pd_irqf;
334+ else
335+ irqf = IRQF_TRIGGER_HIGH;
336+
284337 error = request_threaded_irq(wm831x_ts->pd_irq,
285338 NULL, wm831x_ts_pen_down_irq,
286− IRQF_ONESHOT,
339+ irqf | IRQF_ONESHOT,
287340 "Touchscreen pen down", wm831x_ts);
288341 if (error) {
289342 dev_err(&pdev->dev, "Failed to request pen down IRQ %d: %d\n",
drivers/leds/leds-lm3530.c+1−0
@@ -349,6 +349,7 @@ static const struct i2c_device_id lm3530_id[] = { · 348 unmodified lines
349349 {LM3530_NAME, 0},
350350 {}
351351 };
352+MODULE_DEVICE_TABLE(i2c, lm3530_id);
352353
353354 static struct i2c_driver lm3530_i2c_driver = {
354355 .probe = lm3530_probe,
drivers/md/md.c+1−0
@@ -3170,6 +3170,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len) · 3169 unmodified lines
31703170 mddev->layout = mddev->new_layout;
31713171 mddev->chunk_sectors = mddev->new_chunk_sectors;
31723172 mddev->delta_disks = 0;
3173+ mddev->degraded = 0;
31733174 if (mddev->pers->sync_request == NULL) {
31743175 /* this is now an array without redundancy, so
31753176 * it must always be in_sync
drivers/md/raid5.c+4−1
@@ -5151,7 +5151,6 @@ static int run(mddev_t *mddev) · 5150 unmodified lines
51515151
51525152 mddev->queue->backing_dev_info.congested_data = mddev;
51535153 mddev->queue->backing_dev_info.congested_fn = raid5_congested;
5154− mddev->queue->queue_lock = &conf->device_lock;
51555154
51565155 chunk_size = mddev->chunk_sectors << 9;
51575156 blk_queue_io_min(mddev->queue, chunk_size);
@@ -5679,6 +5678,7 @@ static void raid5_quiesce(mddev_t *mddev, int state) · 521 unmodified lines
56795678 static void *raid45_takeover_raid0(mddev_t *mddev, int level)
56805679 {
56815680 struct raid0_private_data *raid0_priv = mddev->private;
5681+ sector_t sectors;
56825682
56835683 /* for raid0 takeover only one zone is supported */
56845684 if (raid0_priv->nr_strip_zones > 1) {
@@ -5687,6 +5687,9 @@ static void *raid45_takeover_raid0(mddev_t *mddev, int level) · 2 unmodified lines
56875687 return ERR_PTR(-EINVAL);
56885688 }
56895689
5690+ sectors = raid0_priv->strip_zone[0].zone_end;
5691+ sector_div(sectors, raid0_priv->strip_zone[0].nb_dev);
5692+ mddev->dev_sectors = sectors;
56905693 mddev->new_level = level;
56915694 mddev->new_layout = ALGORITHM_PARITY_N;
56925695 mddev->new_chunk_sectors = mddev->chunk_sectors;
drivers/media/common/tuners/tda18271-common.c+1−10
@@ -533,16 +533,7 @@ int tda18271_calc_main_pll(struct dvb_frontend *fe, u32 freq) · 532 unmodified lines
533533 if (tda_fail(ret))
534534 goto fail;
535535
536− regs[R_MPD] = (0x77 & pd);
537−
538− switch (priv->mode) {
539− case TDA18271_ANALOG:
540− regs[R_MPD] &= ~0x08;
541− break;
542− case TDA18271_DIGITAL:
543− regs[R_MPD] |= 0x08;
544− break;
545− }
536+ regs[R_MPD] = (0x7f & pd);
546537
547538 div = ((d * (freq / 1000)) << 7) / 125;
548539
drivers/media/common/tuners/tda18271-fe.c+11−10
@@ -579,8 +579,8 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq) · 578 unmodified lines
579579 #define RF3 2
580580 u32 rf_default[3];
581581 u32 rf_freq[3];
582− u8 prog_cal[3];
583− u8 prog_tab[3];
582+ s32 prog_cal[3];
583+ s32 prog_tab[3];
584584
585585 i = tda18271_lookup_rf_band(fe, &freq, NULL);
586586
@@ -602,32 +602,33 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq) · 15 unmodified lines
602602 return bcal;
603603
604604 tda18271_calc_rf_cal(fe, &rf_freq[rf]);
605− prog_tab[rf] = regs[R_EB14];
605+ prog_tab[rf] = (s32)regs[R_EB14];
606606
607607 if (1 == bcal)
608− prog_cal[rf] = tda18271_calibrate_rf(fe, rf_freq[rf]);
608+ prog_cal[rf] =
609+ (s32)tda18271_calibrate_rf(fe, rf_freq[rf]);
609610 else
610611 prog_cal[rf] = prog_tab[rf];
611612
612613 switch (rf) {
613614 case RF1:
614615 map[i].rf_a1 = 0;
615− map[i].rf_b1 = (s32)(prog_cal[RF1] - prog_tab[RF1]);
616+ map[i].rf_b1 = (prog_cal[RF1] - prog_tab[RF1]);
616617 map[i].rf1 = rf_freq[RF1] / 1000;
617618 break;
618619 case RF2:
619− dividend = (s32)(prog_cal[RF2] - prog_tab[RF2]) -
620− (s32)(prog_cal[RF1] + prog_tab[RF1]);
620+ dividend = (prog_cal[RF2] - prog_tab[RF2] -
621+ prog_cal[RF1] + prog_tab[RF1]);
621622 divisor = (s32)(rf_freq[RF2] - rf_freq[RF1]) / 1000;
622623 map[i].rf_a1 = (dividend / divisor);
623624 map[i].rf2 = rf_freq[RF2] / 1000;
624625 break;
625626 case RF3:
626− dividend = (s32)(prog_cal[RF3] - prog_tab[RF3]) -
627− (s32)(prog_cal[RF2] + prog_tab[RF2]);
627+ dividend = (prog_cal[RF3] - prog_tab[RF3] -
628+ prog_cal[RF2] + prog_tab[RF2]);
628629 divisor = (s32)(rf_freq[RF3] - rf_freq[RF2]) / 1000;
629630 map[i].rf_a2 = (dividend / divisor);
630− map[i].rf_b2 = (s32)(prog_cal[RF2] - prog_tab[RF2]);
631+ map[i].rf_b2 = (prog_cal[RF2] - prog_tab[RF2]);
631632 map[i].rf3 = rf_freq[RF3] / 1000;
632633 break;
633634 default:
drivers/media/common/tuners/tda18271-maps.c+6−6
@@ -229,8 +229,7 @@ static struct tda18271_map tda18271c2_km[] = { · 228 unmodified lines
229229 static struct tda18271_map tda18271_rf_band[] = {
230230 { .rfmax = 47900, .val = 0x00 },
231231 { .rfmax = 61100, .val = 0x01 },
232−/* { .rfmax = 152600, .val = 0x02 }, */
233− { .rfmax = 121200, .val = 0x02 },
232+ { .rfmax = 152600, .val = 0x02 },
234233 { .rfmax = 164700, .val = 0x03 },
235234 { .rfmax = 203500, .val = 0x04 },
236235 { .rfmax = 457800, .val = 0x05 },
@@ -448,7 +447,7 @@ static struct tda18271_map tda18271c2_rf_cal[] = { · 211 unmodified lines
448447 { .rfmax = 150000, .val = 0xb0 },
449448 { .rfmax = 151000, .val = 0xb1 },
450449 { .rfmax = 152000, .val = 0xb7 },
451− { .rfmax = 153000, .val = 0xbd },
450+ { .rfmax = 152600, .val = 0xbd },
452451 { .rfmax = 154000, .val = 0x20 },
453452 { .rfmax = 155000, .val = 0x22 },
454453 { .rfmax = 156000, .val = 0x24 },
@@ -459,7 +458,7 @@ static struct tda18271_map tda18271c2_rf_cal[] = { · 4 unmodified lines
459458 { .rfmax = 161000, .val = 0x2d },
460459 { .rfmax = 163000, .val = 0x2e },
461460 { .rfmax = 164000, .val = 0x2f },
462− { .rfmax = 165000, .val = 0x30 },
461+ { .rfmax = 164700, .val = 0x30 },
463462 { .rfmax = 166000, .val = 0x11 },
464463 { .rfmax = 167000, .val = 0x12 },
465464 { .rfmax = 168000, .val = 0x13 },
@@ -510,7 +509,8 @@ static struct tda18271_map tda18271c2_rf_cal[] = { · 44 unmodified lines
510509 { .rfmax = 236000, .val = 0x1b },
511510 { .rfmax = 237000, .val = 0x1c },
512511 { .rfmax = 240000, .val = 0x1d },
513− { .rfmax = 242000, .val = 0x1f },
512+ { .rfmax = 242000, .val = 0x1e },
513+ { .rfmax = 244000, .val = 0x1f },
514514 { .rfmax = 247000, .val = 0x20 },
515515 { .rfmax = 249000, .val = 0x21 },
516516 { .rfmax = 252000, .val = 0x22 },
@@ -624,7 +624,7 @@ static struct tda18271_map tda18271c2_rf_cal[] = { · 107 unmodified lines
624624 { .rfmax = 453000, .val = 0x93 },
625625 { .rfmax = 454000, .val = 0x94 },
626626 { .rfmax = 456000, .val = 0x96 },
627− { .rfmax = 457000, .val = 0x98 },
627+ { .rfmax = 457800, .val = 0x98 },
628628 { .rfmax = 461000, .val = 0x11 },
629629 { .rfmax = 468000, .val = 0x12 },
630630 { .rfmax = 472000, .val = 0x13 },
drivers/media/dvb/b2c2/flexcop-pci.c+1−1
@@ -38,7 +38,7 @@ MODULE_PARM_DESC(debug, · 37 unmodified lines
3838 DEBSTATUS);
3939
4040 #define DRIVER_VERSION "0.1"
41−#define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver"
41+#define DRIVER_NAME "flexcop-pci"
4242 #define DRIVER_AUTHOR "Patrick Boettcher <patrick.boettcher@desy.de>"
4343
4444 struct flexcop_pci {
drivers/media/dvb/dvb-usb/Kconfig+4−2
@@ -356,13 +356,15 @@ config DVB_USB_LME2510 · 355 unmodified lines
356356 select DVB_TDA826X if !DVB_FE_CUSTOMISE
357357 select DVB_STV0288 if !DVB_FE_CUSTOMISE
358358 select DVB_IX2505V if !DVB_FE_CUSTOMISE
359+ select DVB_STV0299 if !DVB_FE_CUSTOMISE
360+ select DVB_PLL if !DVB_FE_CUSTOMISE
359361 help
360362 Say Y here to support the LME DM04/QQBOX DVB-S USB2.0 .
361363
362364 config DVB_USB_TECHNISAT_USB2
363365 tristate "Technisat DVB-S/S2 USB2.0 support"
364366 depends on DVB_USB
365− select DVB_STB0899 if !DVB_FE_CUSTOMISE
366− select DVB_STB6100 if !DVB_FE_CUSTOMISE
367+ select DVB_STV090x if !DVB_FE_CUSTOMISE
368+ select DVB_STV6110x if !DVB_FE_CUSTOMISE
367369 help
368370 Say Y here to support the Technisat USB2 DVB-S/S2 device
drivers/media/dvb/dvb-usb/dib0700_devices.c+3−3
@@ -2162,7 +2162,7 @@ struct dibx000_agc_config dib7090_agc_config[2] = { · 2161 unmodified lines
21622162 .agc1_pt3 = 98,
21632163 .agc1_slope1 = 0,
21642164 .agc1_slope2 = 167,
2165− .agc1_pt1 = 98,
2165+ .agc2_pt1 = 98,
21662166 .agc2_pt2 = 255,
21672167 .agc2_slope1 = 104,
21682168 .agc2_slope2 = 0,
@@ -2440,11 +2440,11 @@ static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap) · 271 unmodified lines
24402440 dib0700_set_i2c_speed(adap->dev, 340);
24412441 adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x90, &tfe7090pvr_dib7000p_config[0]);
24422442
2443− dib7090_slave_reset(adap->fe);
2444−
24452443 if (adap->fe == NULL)
24462444 return -ENODEV;
24472445
2446+ dib7090_slave_reset(adap->fe);
2447+
24482448 return 0;
24492449 }
24502450
drivers/media/dvb/ngene/ngene-core.c+1−0
@@ -1520,6 +1520,7 @@ static int init_channel(struct ngene_channel *chan) · 1519 unmodified lines
15201520 if (dev->ci.en && (io & NGENE_IO_TSOUT)) {
15211521 dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1);
15221522 set_transfer(chan, 1);
1523+ chan->dev->channel[2].DataFormatFlags = DF_SWAP32;
15231524 set_transfer(&chan->dev->channel[2], 1);
15241525 dvb_register_device(adapter, &chan->ci_dev,
15251526 &ngene_dvbdev_ci, (void *) chan,
drivers/media/media-entity.c+6−2
@@ -378,7 +378,6 @@ EXPORT_SYMBOL_GPL(media_entity_create_link); · 377 unmodified lines
378378
379379 static int __media_entity_setup_link_notify(struct media_link *link, u32 flags)
380380 {
381− const u32 mask = MEDIA_LNK_FL_ENABLED;
382381 int ret;
383382
384383 /* Notify both entities. */
@@ -395,7 +394,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) · 10 unmodified lines
395394 return ret;
396395 }
397396
398− link->flags = (link->flags & ~mask) | (flags & mask);
397+ link->flags = flags;
399398 link->reverse->flags = link->flags;
400399
401400 return 0;
@@ -417,6 +416,7 @@ static int __media_entity_setup_link_notify(struct media_link *link, u32 flags) · 15 unmodified lines
417416 */
418417 int __media_entity_setup_link(struct media_link *link, u32 flags)
419418 {
419+ const u32 mask = MEDIA_LNK_FL_ENABLED;
420420 struct media_device *mdev;
421421 struct media_entity *source, *sink;
422422 int ret = -EBUSY;
@@ -424,6 +424,10 @@ int __media_entity_setup_link(struct media_link *link, u32 flags) · 1 unmodified line
424424 if (link == NULL)
425425 return -EINVAL;
426426
427+ /* The non-modifiable link flags must not be modified. */
428+ if ((link->flags & ~mask) != (flags & ~mask))
429+ return -EINVAL;
430+
427431 if (link->flags & MEDIA_LNK_FL_IMMUTABLE)
428432 return link->flags == flags ? 0 : -EINVAL;
429433
drivers/media/radio/radio-sf16fmr2.c+1−1
@@ -170,7 +170,7 @@ static int fmr2_setfreq(struct fmr2 *dev) · 169 unmodified lines
170170 return 0;
171171 }
172172
173−/* !!! not tested, in my card this does't work !!! */
173+/* !!! not tested, in my card this doesn't work !!! */
174174 static int fmr2_setvolume(struct fmr2 *dev)
175175 {
176176 int vol[16] = { 0x021, 0x084, 0x090, 0x104,
drivers/media/radio/saa7706h.c+1−1
@@ -376,7 +376,7 @@ static int __devinit saa7706h_probe(struct i2c_client *client, · 375 unmodified lines
376376 v4l_info(client, "chip found @ 0x%02x (%s)\n",
377377 client->addr << 1, client->adapter->name);
378378
379− state = kmalloc(sizeof(struct saa7706h_state), GFP_KERNEL);
379+ state = kzalloc(sizeof(struct saa7706h_state), GFP_KERNEL);
380380 if (state == NULL)
381381 return -ENOMEM;
382382 sd = &state->sd;
drivers/media/radio/tef6862.c+1−1
@@ -176,7 +176,7 @@ static int __devinit tef6862_probe(struct i2c_client *client, · 175 unmodified lines
176176 v4l_info(client, "chip found @ 0x%02x (%s)\n",
177177 client->addr << 1, client->adapter->name);
178178
179− state = kmalloc(sizeof(struct tef6862_state), GFP_KERNEL);
179+ state = kzalloc(sizeof(struct tef6862_state), GFP_KERNEL);
180180 if (state == NULL)
181181 return -ENOMEM;
182182 state->freq = TEF6862_LO_FREQ;
drivers/media/rc/imon.c+27−4
@@ -46,7 +46,7 @@ · 45 unmodified lines
4646 #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"
4747 #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"
4848 #define MOD_NAME "imon"
49−#define MOD_VERSION "0.9.2"
49+#define MOD_VERSION "0.9.3"
5050
5151 #define DISPLAY_MINOR_BASE 144
5252 #define DEVICE_NAME "lcd%d"
@@ -460,8 +460,9 @@ static int display_close(struct inode *inode, struct file *file) · 407 unmodified lines
460460 }
461461
462462 /**
463− * Sends a packet to the device -- this function must be called
464− * with ictx->lock held.
463+ * Sends a packet to the device -- this function must be called with
464+ * ictx->lock held, or its unlock/lock sequence while waiting for tx
465+ * to complete can/will lead to a deadlock.
465466 */
466467 static int send_packet(struct imon_context *ictx)
467468 {
@@ -991,12 +992,21 @@ static void imon_touch_display_timeout(unsigned long data) · 523 unmodified lines
991992 * the iMON remotes, and those used by the Windows MCE remotes (which is
992993 * really just RC-6), but only one or the other at a time, as the signals
993994 * are decoded onboard the receiver.
995+ *
996+ * This function gets called two different ways, one way is from
997+ * rc_register_device, for initial protocol selection/setup, and the other is
998+ * via a userspace-initiated protocol change request, either by direct sysfs
999+ * prodding or by something like ir-keytable. In the rc_register_device case,
1000+ * the imon context lock is already held, but when initiated from userspace,
1001+ * it is not, so we must acquire it prior to calling send_packet, which
1002+ * requires that the lock is held.
9941003 */
9951004 static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
9961005 {
9971006 int retval;
9981007 struct imon_context *ictx = rc->priv;
9991008 struct device *dev = ictx->dev;
1009+ bool unlock = false;
10001010 unsigned char ir_proto_packet[] = {
10011011 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 };
10021012
@@ -1029,6 +1039,11 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) · 26 unmodified lines
10291039
10301040 memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet));
10311041
1042+ if (!mutex_is_locked(&ictx->lock)) {
1043+ unlock = true;
1044+ mutex_lock(&ictx->lock);
1045+ }
1046+
10321047 retval = send_packet(ictx);
10331048 if (retval)
10341049 goto out;
@@ -1037,6 +1052,9 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) · 2 unmodified lines
10371052 ictx->pad_mouse = false;
10381053
10391054 out:
1055+ if (unlock)
1056+ mutex_unlock(&ictx->lock);
1057+
10401058 return retval;
10411059 }
10421060
@@ -2134,6 +2152,7 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) · 1091 unmodified lines
21342152 goto rdev_setup_failed;
21352153 }
21362154
2155+ mutex_unlock(&ictx->lock);
21372156 return ictx;
21382157
21392158 rdev_setup_failed:
@@ -2205,6 +2224,7 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf, · 65 unmodified lines
22052224 goto urb_submit_failed;
22062225 }
22072226
2227+ mutex_unlock(&ictx->lock);
22082228 return ictx;
22092229
22102230 urb_submit_failed:
@@ -2299,6 +2319,8 @@ static int __devinit imon_probe(struct usb_interface *interface, · 88 unmodified lines
22992319 usb_set_intfdata(interface, ictx);
23002320
23012321 if (ifnum == 0) {
2322+ mutex_lock(&ictx->lock);
2323+
23022324 if (product == 0xffdc && ictx->rf_device) {
23032325 sysfs_err = sysfs_create_group(&interface->dev.kobj,
23042326 &imon_rf_attr_group);
@@ -2309,13 +2331,14 @@ static int __devinit imon_probe(struct usb_interface *interface, · 4 unmodified lines
23092331
23102332 if (ictx->display_supported)
23112333 imon_init_display(ictx, interface);
2334+
2335+ mutex_unlock(&ictx->lock);
23122336 }
23132337
23142338 dev_info(dev, "iMON device (%04x:%04x, intf%d) on "
23152339 "usb<%d:%d> initialized\n", vendor, product, ifnum,
23162340 usbdev->bus->busnum, usbdev->devnum);
23172341
2318− mutex_unlock(&ictx->lock);
23192342 mutex_unlock(&driver_lock);
23202343
23212344 return 0;
drivers/media/rc/ite-cir.c+1−0
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include <linux/io.h>
3737 #include <linux/interrupt.h>
3838 #include <linux/sched.h>
39+#include <linux/delay.h>
3940 #include <linux/slab.h>
4041 #include <linux/input.h>
4142 #include <linux/bitops.h>
drivers/media/rc/mceusb.c+2−0
@@ -220,6 +220,8 @@ static struct usb_device_id mceusb_dev_table[] = { · 219 unmodified lines
220220 { USB_DEVICE(VENDOR_PHILIPS, 0x206c) },
221221 /* Philips/Spinel plus IR transceiver for ASUS */
222222 { USB_DEVICE(VENDOR_PHILIPS, 0x2088) },
223+ /* Philips IR transceiver (Dell branded) */
224+ { USB_DEVICE(VENDOR_PHILIPS, 0x2093) },
223225 /* Realtek MCE IR Receiver and card reader */
224226 { USB_DEVICE(VENDOR_REALTEK, 0x0161),
225227 .driver_info = MULTIFUNCTION },
drivers/media/rc/rc-main.c+3−1
@@ -707,7 +707,8 @@ static void ir_close(struct input_dev *idev) · 706 unmodified lines
707707 {
708708 struct rc_dev *rdev = input_get_drvdata(idev);
709709
710− rdev->close(rdev);
710+ if (rdev)
711+ rdev->close(rdev);
711712 }
712713
713714 /* class for /sys/class/rc */
@@ -733,6 +734,7 @@ static struct { · 19 unmodified lines
733734 { RC_TYPE_SONY, "sony" },
734735 { RC_TYPE_RC5_SZ, "rc-5-sz" },
735736 { RC_TYPE_LIRC, "lirc" },
737+ { RC_TYPE_OTHER, "other" },
736738 };
737739
738740 #define PROTO_NONE "none"
drivers/media/video/Kconfig+1−1
@@ -875,7 +875,7 @@ config MX3_VIDEO · 874 unmodified lines
875875 config VIDEO_MX3
876876 tristate "i.MX3x Camera Sensor Interface driver"
877877 depends on VIDEO_DEV && MX3_IPU && SOC_CAMERA
878− select VIDEOBUF_DMA_CONTIG
878+ select VIDEOBUF2_DMA_CONTIG
879879 select MX3_VIDEO
880880 ---help---
881881 This is a v4l2 driver for the i.MX3x Camera Sensor Interface
drivers/media/video/cx18/cx18-streams.c+9−1
@@ -350,9 +350,17 @@ void cx18_streams_cleanup(struct cx18 *cx, int unregister) · 349 unmodified lines
350350
351351 /* No struct video_device, but can have buffers allocated */
352352 if (type == CX18_ENC_STREAM_TYPE_IDX) {
353+ /* If the module params didn't inhibit IDX ... */
353354 if (cx->stream_buffers[type] != 0) {
354355 cx->stream_buffers[type] = 0;
355− cx18_stream_free(&cx->streams[type]);
356+ /*
357+ * Before calling cx18_stream_free(),
358+ * check if the IDX stream was actually set up.
359+ * Needed, since the cx18_probe() error path
360+ * exits through here as well as normal clean up
361+ */
362+ if (cx->streams[type].buffers != 0)
363+ cx18_stream_free(&cx->streams[type]);
356364 }
357365 continue;
358366 }
drivers/media/video/cx23885/Kconfig+1−0
@@ -22,6 +22,7 @@ config VIDEO_CX23885 · 21 unmodified lines
2222 select DVB_CX24116 if !DVB_FE_CUSTOMISE
2323 select DVB_STV0900 if !DVB_FE_CUSTOMISE
2424 select DVB_DS3000 if !DVB_FE_CUSTOMISE
25+ select DVB_STV0367 if !DVB_FE_CUSTOMISE
2526 select MEDIA_TUNER_MT2131 if !MEDIA_TUNER_CUSTOMISE
2627 select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE
2728 select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE
drivers/media/video/cx88/cx88-input.c+1−1
@@ -524,7 +524,7 @@ void cx88_ir_irq(struct cx88_core *core) · 523 unmodified lines
524524 for (todo = 32; todo > 0; todo -= bits) {
525525 ev.pulse = samples & 0x80000000 ? false : true;
526526 bits = min(todo, 32U - fls(ev.pulse ? samples : ~samples));
527− ev.duration = (bits * NSEC_PER_SEC) / (1000 * ir_samplerate);
527+ ev.duration = (bits * (NSEC_PER_SEC / 1000)) / ir_samplerate;
528528 ir_raw_event_store_with_filter(ir->dev, &ev);
529529 samples <<= bits;
530530 }
drivers/media/video/imx074.c+1−1
@@ -298,7 +298,7 @@ static unsigned long imx074_query_bus_param(struct soc_camera_device *icd) · 297 unmodified lines
298298 static int imx074_set_bus_param(struct soc_camera_device *icd,
299299 unsigned long flags)
300300 {
301− return -1;
301+ return -EINVAL;
302302 }
303303
304304 static struct soc_camera_ops imx074_ops = {
drivers/media/video/m52790.c+1−1
@@ -174,7 +174,7 @@ static int m52790_probe(struct i2c_client *client, · 173 unmodified lines
174174 v4l_info(client, "chip found @ 0x%x (%s)\n",
175175 client->addr << 1, client->adapter->name);
176176
177− state = kmalloc(sizeof(struct m52790_state), GFP_KERNEL);
177+ state = kzalloc(sizeof(struct m52790_state), GFP_KERNEL);
178178 if (state == NULL)
179179 return -ENOMEM;
180180
drivers/media/video/omap3isp/isp.c+25−9
@@ -215,20 +215,21 @@ static u32 isp_set_xclk(struct isp_device *isp, u32 xclk, u8 xclksel) · 214 unmodified lines
215215 }
216216
217217 switch (xclksel) {
218− case 0:
218+ case ISP_XCLK_A:
219219 isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL,
220220 ISPTCTRL_CTRL_DIVA_MASK,
221221 divisor << ISPTCTRL_CTRL_DIVA_SHIFT);
222222 dev_dbg(isp->dev, "isp_set_xclk(): cam_xclka set to %d Hz\n",
223223 currentxclk);
224224 break;
225− case 1:
225+ case ISP_XCLK_B:
226226 isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL,
227227 ISPTCTRL_CTRL_DIVB_MASK,
228228 divisor << ISPTCTRL_CTRL_DIVB_SHIFT);
229229 dev_dbg(isp->dev, "isp_set_xclk(): cam_xclkb set to %d Hz\n",
230230 currentxclk);
231231 break;
232+ case ISP_XCLK_NONE:
232233 default:
233234 omap3isp_put(isp);
234235 dev_dbg(isp->dev, "ISP_ERR: isp_set_xclk(): Invalid requested "
@@ -237,13 +238,13 @@ static u32 isp_set_xclk(struct isp_device *isp, u32 xclk, u8 xclksel) · 2 unmodified lines
237238 }
238239
239240 /* Do we go from stable whatever to clock? */
240− if (divisor >= 2 && isp->xclk_divisor[xclksel] < 2)
241+ if (divisor >= 2 && isp->xclk_divisor[xclksel - 1] < 2)
241242 omap3isp_get(isp);
242243 /* Stopping the clock. */
243− else if (divisor < 2 && isp->xclk_divisor[xclksel] >= 2)
244+ else if (divisor < 2 && isp->xclk_divisor[xclksel - 1] >= 2)
244245 omap3isp_put(isp);
245246
246− isp->xclk_divisor[xclksel] = divisor;
247+ isp->xclk_divisor[xclksel - 1] = divisor;
247248
248249 omap3isp_put(isp);
249250
@@ -285,7 +286,8 @@ static void isp_power_settings(struct isp_device *isp, int idle) · 35 unmodified lines
285286 */
286287 void omap3isp_configure_bridge(struct isp_device *isp,
287288 enum ccdc_input_entity input,
288− const struct isp_parallel_platform_data *pdata)
289+ const struct isp_parallel_platform_data *pdata,
290+ unsigned int shift)
289291 {
290292 u32 ispctrl_val;
291293
@@ -298,9 +300,9 @@ void omap3isp_configure_bridge(struct isp_device *isp, · 6 unmodified lines
298300 switch (input) {
299301 case CCDC_INPUT_PARALLEL:
300302 ispctrl_val |= ISPCTRL_PAR_SER_CLK_SEL_PARALLEL;
301− ispctrl_val |= pdata->data_lane_shift << ISPCTRL_SHIFT_SHIFT;
302303 ispctrl_val |= pdata->clk_pol << ISPCTRL_PAR_CLK_POL_SHIFT;
303304 ispctrl_val |= pdata->bridge << ISPCTRL_PAR_BRIDGE_SHIFT;
305+ shift += pdata->data_lane_shift * 2;
304306 break;
305307
306308 case CCDC_INPUT_CSI2A:
@@ -319,6 +321,8 @@ void omap3isp_configure_bridge(struct isp_device *isp, · 12 unmodified lines
319321 return;
320322 }
321323
324+ ispctrl_val |= ((shift/2) << ISPCTRL_SHIFT_SHIFT) & ISPCTRL_SHIFT_MASK;
325+
322326 ispctrl_val &= ~ISPCTRL_SYNC_DETECT_MASK;
323327 ispctrl_val |= ISPCTRL_SYNC_DETECT_VSRISE;
324328
@@ -658,6 +662,8 @@ int omap3isp_pipeline_pm_use(struct media_entity *entity, int use) · 333 unmodified lines
658662
659663 /* Apply power change to connected non-nodes. */
660664 ret = isp_pipeline_pm_power(entity, change);
665+ if (ret < 0)
666+ entity->use_count -= change;
661667
662668 mutex_unlock(&entity->parent->graph_mutex);
663669
@@ -872,6 +878,9 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe) · 208 unmodified lines
872878 }
873879 }
874880
881+ if (failure < 0)
882+ isp->needs_reset = true;
883+
875884 return failure;
876885 }
877886
@@ -884,7 +893,8 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe) · 6 unmodified lines
884893 * single-shot or continuous mode.
885894 *
886895 * Return 0 if successful, or the return value of the failed video::s_stream
887− * operation otherwise.
896+ * operation otherwise. The pipeline state is not updated when the operation
897+ * fails, except when stopping the pipeline.
888898 */
889899 int omap3isp_pipeline_set_stream(struct isp_pipeline *pipe,
890900 enum isp_pipeline_stream_state state)
@@ -895,7 +905,9 @@ int omap3isp_pipeline_set_stream(struct isp_pipeline *pipe, · 4 unmodified lines
895905 ret = isp_pipeline_disable(pipe);
896906 else
897907 ret = isp_pipeline_enable(pipe, state);
898− pipe->stream_state = state;
908+
909+ if (ret == 0 || state == ISP_PIPELINE_STREAM_STOPPED)
910+ pipe->stream_state = state;
899911
900912 return ret;
901913 }
@@ -1481,6 +1493,10 @@ void omap3isp_put(struct isp_device *isp) · 579 unmodified lines
14811493 if (--isp->ref_count == 0) {
14821494 isp_disable_interrupts(isp);
14831495 isp_save_ctx(isp);
1496+ if (isp->needs_reset) {
1497+ isp_reset(isp);
1498+ isp->needs_reset = false;
1499+ }
14841500 isp_disable_clocks(isp);
14851501 }
14861502 mutex_unlock(&isp->isp_mutex);
drivers/media/video/omap3isp/isp.h+6−6
@@ -132,7 +132,6 @@ struct isp_reg { · 131 unmodified lines
132132
133133 /**
134134 * struct isp_parallel_platform_data - Parallel interface platform data
135− * @width: Parallel bus width in bits (8, 10, 11 or 12)
136135 * @data_lane_shift: Data lane shifter
137136 * 0 - CAMEXT[13:0] -> CAM[13:0]
138137 * 1 - CAMEXT[13:2] -> CAM[11:0]
@@ -146,7 +145,6 @@ struct isp_reg { · 7 unmodified lines
146145 * ISPCTRL_PAR_BRIDGE_BENDIAN - Big endian
147146 */
148147 struct isp_parallel_platform_data {
149− unsigned int width;
150148 unsigned int data_lane_shift:2;
151149 unsigned int clk_pol:1;
152150 unsigned int bridge:4;
@@ -262,6 +260,7 @@ struct isp_device { · 109 unmodified lines
262260 /* ISP Obj */
263261 spinlock_t stat_lock; /* common lock for statistic drivers */
264262 struct mutex isp_mutex; /* For handling ref_count field */
263+ bool needs_reset;
265264 int has_context;
266265 int ref_count;
267266 unsigned int autoidle;
@@ -311,11 +310,12 @@ int omap3isp_pipeline_set_stream(struct isp_pipeline *pipe, · 43 unmodified lines
311310 enum isp_pipeline_stream_state state);
312311 void omap3isp_configure_bridge(struct isp_device *isp,
313312 enum ccdc_input_entity input,
314− const struct isp_parallel_platform_data *pdata);
313+ const struct isp_parallel_platform_data *pdata,
314+ unsigned int shift);
315315
316−#define ISP_XCLK_NONE -1
317−#define ISP_XCLK_A 0
318−#define ISP_XCLK_B 1
316+#define ISP_XCLK_NONE 0
317+#define ISP_XCLK_A 1
318+#define ISP_XCLK_B 2
319319
320320 struct isp_device *omap3isp_get(struct isp_device *isp);
321321 void omap3isp_put(struct isp_device *isp);
drivers/media/video/omap3isp/ispccdc.c+30−7
@@ -43,6 +43,12 @@ __ccdc_get_format(struct isp_ccdc_device *ccdc, struct v4l2_subdev_fh *fh, · 42 unmodified lines
4343
4444 static const unsigned int ccdc_fmts[] = {
4545 V4L2_MBUS_FMT_Y8_1X8,
46+ V4L2_MBUS_FMT_Y10_1X10,
47+ V4L2_MBUS_FMT_Y12_1X12,
48+ V4L2_MBUS_FMT_SGRBG8_1X8,
49+ V4L2_MBUS_FMT_SRGGB8_1X8,
50+ V4L2_MBUS_FMT_SBGGR8_1X8,
51+ V4L2_MBUS_FMT_SGBRG8_1X8,
4652 V4L2_MBUS_FMT_SGRBG10_1X10,
4753 V4L2_MBUS_FMT_SRGGB10_1X10,
4854 V4L2_MBUS_FMT_SBGGR10_1X10,
@@ -1110,21 +1116,38 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) · 1061 unmodified lines
11101116 struct isp_parallel_platform_data *pdata = NULL;
11111117 struct v4l2_subdev *sensor;
11121118 struct v4l2_mbus_framefmt *format;
1119+ const struct isp_format_info *fmt_info;
1120+ struct v4l2_subdev_format fmt_src;
1121+ unsigned int depth_out;
1122+ unsigned int depth_in = 0;
11131123 struct media_pad *pad;
11141124 unsigned long flags;
1125+ unsigned int shift;
11151126 u32 syn_mode;
11161127 u32 ccdc_pattern;
11171128
1118− if (ccdc->input == CCDC_INPUT_PARALLEL) {
1119− pad = media_entity_remote_source(&ccdc->pads[CCDC_PAD_SINK]);
1120− sensor = media_entity_to_v4l2_subdev(pad->entity);
1129+ pad = media_entity_remote_source(&ccdc->pads[CCDC_PAD_SINK]);
1130+ sensor = media_entity_to_v4l2_subdev(pad->entity);
1131+ if (ccdc->input == CCDC_INPUT_PARALLEL)
11211132 pdata = &((struct isp_v4l2_subdevs_group *)sensor->host_priv)
11221133 ->bus.parallel;
1134+
1135+ /* Compute shift value for lane shifter to configure the bridge. */
1136+ fmt_src.pad = pad->index;
1137+ fmt_src.which = V4L2_SUBDEV_FORMAT_ACTIVE;
1138+ if (!v4l2_subdev_call(sensor, pad, get_fmt, NULL, &fmt_src)) {
1139+ fmt_info = omap3isp_video_format_info(fmt_src.format.code);
1140+ depth_in = fmt_info->bpp;
11231141 }
11241142
1125− omap3isp_configure_bridge(isp, ccdc->input, pdata);
1143+ fmt_info = omap3isp_video_format_info
1144+ (isp->isp_ccdc.formats[CCDC_PAD_SINK].code);
1145+ depth_out = fmt_info->bpp;
1146+
1147+ shift = depth_in - depth_out;
1148+ omap3isp_configure_bridge(isp, ccdc->input, pdata, shift);
11261149
1127− ccdc->syncif.datsz = pdata ? pdata->width : 10;
1150+ ccdc->syncif.datsz = depth_out;
11281151 ccdc_config_sync_if(ccdc, &ccdc->syncif);
11291152
11301153 /* CCDC_PAD_SINK */
@@ -1338,7 +1361,7 @@ static int ccdc_sbl_wait_idle(struct isp_ccdc_device *ccdc, · 207 unmodified lines
13381361 * @ccdc: Pointer to ISP CCDC device.
13391362 * @event: Pointing which event trigger handler
13401363 *
1341− * Return 1 when the event and stopping request combination is satisfyied,
1364+ * Return 1 when the event and stopping request combination is satisfied,
13421365 * zero otherwise.
13431366 */
13441367 static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event)
@@ -1618,7 +1641,7 @@ static int ccdc_video_queue(struct isp_video *video, struct isp_buffer *buffer) · 273 unmodified lines
16181641
16191642 ccdc_set_outaddr(ccdc, buffer->isp_addr);
16201643
1621− /* We now have a buffer queued on the output, restart the pipeline in
1644+ /* We now have a buffer queued on the output, restart the pipeline
16221645 * on the next CCDC interrupt if running in continuous mode (or when
16231646 * starting the stream).
16241647 */
drivers/media/video/omap3isp/isppreview.c+1−1
@@ -755,7 +755,7 @@ static struct preview_update update_attrs[] = { · 754 unmodified lines
755755 * @configs - pointer to update config structure.
756756 * @config - return pointer to appropriate structure field.
757757 * @bit - for which feature to return pointers.
758− * Return size of coresponding prev_params member
758+ * Return size of corresponding prev_params member
759759 */
760760 static u32
761761 __preview_get_ptrs(struct prev_params *params, void **param,
drivers/media/video/omap3isp/ispqueue.c+3−3
@@ -339,7 +339,7 @@ static int isp_video_buffer_prepare_user(struct isp_video_buffer *buf) · 338 unmodified lines
339339 up_read(&current->mm->mmap_sem);
340340
341341 if (ret != buf->npages) {
342− buf->npages = ret;
342+ buf->npages = ret < 0 ? 0 : ret;
343343 isp_video_buffer_cleanup(buf);
344344 return -EFAULT;
345345 }
@@ -408,8 +408,8 @@ done: · 62 unmodified lines
408408 * isp_video_buffer_prepare_vm_flags - Get VMA flags for a userspace address
409409 *
410410 * This function locates the VMAs for the buffer's userspace address and checks
411− * that their flags match. The onlflag that we need to care for at the moment is
412− * VM_PFNMAP.
411+ * that their flags match. The only flag that we need to care for at the moment
412+ * is VM_PFNMAP.
413413 *
414414 * The buffer vm_flags field is set to the first VMA flags.
415415 *
drivers/media/video/omap3isp/ispresizer.c+60−15
@@ -714,19 +714,50 @@ static void resizer_print_status(struct isp_res_device *res) · 713 unmodified lines
714714 * iw and ih are the input width and height after cropping. Those equations need
715715 * to be satisfied exactly for the resizer to work correctly.
716716 *
717− * Reverting the equations, we can compute the resizing ratios with
717+ * The equations can't be easily reverted, as the >> 8 operation is not linear.
718+ * In addition, not all input sizes can be achieved for a given output size. To
719+ * get the highest input size lower than or equal to the requested input size,
720+ * we need to compute the highest resizing ratio that satisfies the following
721+ * inequality (taking the 4-tap mode width equation as an example)
722+ *
723+ * iw >= (32 * sph + (ow - 1) * hrsz + 16) >> 8 - 7
724+ *
725+ * (where iw is the requested input width) which can be rewritten as
726+ *
727+ * iw - 7 >= (32 * sph + (ow - 1) * hrsz + 16) >> 8
728+ * (iw - 7) << 8 >= 32 * sph + (ow - 1) * hrsz + 16 - b
729+ * ((iw - 7) << 8) + b >= 32 * sph + (ow - 1) * hrsz + 16
730+ *
731+ * where b is the value of the 8 least significant bits of the right hand side
732+ * expression of the last inequality. The highest resizing ratio value will be
733+ * achieved when b is equal to its maximum value of 255. That resizing ratio
734+ * value will still satisfy the original inequality, as b will disappear when
735+ * the expression will be shifted right by 8.
736+ *
737+ * The reverted the equations thus become
718738 *
719739 * - 8-phase, 4-tap mode
720− * hrsz = ((iw - 7) * 256 - 16 - 32 * sph) / (ow - 1)
721− * vrsz = ((ih - 4) * 256 - 16 - 32 * spv) / (oh - 1)
740+ * hrsz = ((iw - 7) * 256 + 255 - 16 - 32 * sph) / (ow - 1)
741+ * vrsz = ((ih - 4) * 256 + 255 - 16 - 32 * spv) / (oh - 1)
722742 * - 4-phase, 7-tap mode
723− * hrsz = ((iw - 7) * 256 - 32 - 64 * sph) / (ow - 1)
724− * vrsz = ((ih - 7) * 256 - 32 - 64 * spv) / (oh - 1)
743+ * hrsz = ((iw - 7) * 256 + 255 - 32 - 64 * sph) / (ow - 1)
744+ * vrsz = ((ih - 7) * 256 + 255 - 32 - 64 * spv) / (oh - 1)
725745 *
726− * The ratios are integer values, and must be rounded down to ensure that the
727− * cropped input size is not bigger than the uncropped input size. As the ratio
728− * in 7-tap mode is always smaller than the ratio in 4-tap mode, we can use the
729− * 7-tap mode equations to compute a ratio approximation.
746+ * The ratios are integer values, and are rounded down to ensure that the
747+ * cropped input size is not bigger than the uncropped input size.
748+ *
749+ * As the number of phases/taps, used to select the correct equations to compute
750+ * the ratio, depends on the ratio, we start with the 4-tap mode equations to
751+ * compute an approximation of the ratio, and switch to the 7-tap mode equations
752+ * if the approximation is higher than the ratio threshold.
753+ *
754+ * As the 7-tap mode equations will return a ratio smaller than or equal to the
755+ * 4-tap mode equations, the resulting ratio could become lower than or equal to
756+ * the ratio threshold. This 'equations loop' isn't an issue as long as the
757+ * correct equations are used to compute the final input size. Starting with the
758+ * 4-tap mode equations ensure that, in case of values resulting in a 'ratio
759+ * loop', the smallest of the ratio values will be used, never exceeding the
760+ * requested input size.
730761 *
731762 * We first clamp the output size according to the hardware capabilitie to avoid
732763 * auto-cropping the input more than required to satisfy the TRM equations. The
@@ -775,6 +806,8 @@ static void resizer_calc_ratios(struct isp_res_device *res, · 42 unmodified lines
775806 unsigned int max_width;
776807 unsigned int max_height;
777808 unsigned int width_alignment;
809+ unsigned int width;
810+ unsigned int height;
778811
779812 /*
780813 * Clamp the output height based on the hardware capabilities and
@@ -786,19 +819,22 @@ static void resizer_calc_ratios(struct isp_res_device *res, · 5 unmodified lines
786819 max_height = min_t(unsigned int, max_height, MAX_OUT_HEIGHT);
787820 output->height = clamp(output->height, min_height, max_height);
788821
789− ratio->vert = ((input->height - 7) * 256 - 32 - 64 * spv)
822+ ratio->vert = ((input->height - 4) * 256 + 255 - 16 - 32 * spv)
790823 / (output->height - 1);
824+ if (ratio->vert > MID_RESIZE_VALUE)
825+ ratio->vert = ((input->height - 7) * 256 + 255 - 32 - 64 * spv)
826+ / (output->height - 1);
791827 ratio->vert = clamp_t(unsigned int, ratio->vert,
792828 MIN_RESIZE_VALUE, MAX_RESIZE_VALUE);
793829
794830 if (ratio->vert <= MID_RESIZE_VALUE) {
795831 upscaled_height = (output->height - 1) * ratio->vert
796832 + 32 * spv + 16;
797− input->height = (upscaled_height >> 8) + 4;
833+ height = (upscaled_height >> 8) + 4;
798834 } else {
799835 upscaled_height = (output->height - 1) * ratio->vert
800836 + 64 * spv + 32;
801− input->height = (upscaled_height >> 8) + 7;
837+ height = (upscaled_height >> 8) + 7;
802838 }
803839
804840 /*
@@ -854,20 +890,29 @@ static void resizer_calc_ratios(struct isp_res_device *res, · 49 unmodified lines
854890 max_width & ~(width_alignment - 1));
855891 output->width = ALIGN(output->width, width_alignment);
856892
857− ratio->horz = ((input->width - 7) * 256 - 32 - 64 * sph)
893+ ratio->horz = ((input->width - 7) * 256 + 255 - 16 - 32 * sph)
858894 / (output->width - 1);
895+ if (ratio->horz > MID_RESIZE_VALUE)
896+ ratio->horz = ((input->width - 7) * 256 + 255 - 32 - 64 * sph)
897+ / (output->width - 1);
859898 ratio->horz = clamp_t(unsigned int, ratio->horz,
860899 MIN_RESIZE_VALUE, MAX_RESIZE_VALUE);
861900
862901 if (ratio->horz <= MID_RESIZE_VALUE) {
863902 upscaled_width = (output->width - 1) * ratio->horz
864903 + 32 * sph + 16;
865− input->width = (upscaled_width >> 8) + 7;
904+ width = (upscaled_width >> 8) + 7;
866905 } else {
867906 upscaled_width = (output->width - 1) * ratio->horz
868907 + 64 * sph + 32;
869− input->width = (upscaled_width >> 8) + 7;
908+ width = (upscaled_width >> 8) + 7;
870909 }
910+
911+ /* Center the new crop rectangle. */
912+ input->left += (input->width - width) / 2;
913+ input->top += (input->height - height) / 2;
914+ input->width = width;
915+ input->height = height;
871916 }
872917
873918 /*
drivers/media/video/omap3isp/ispstat.h+3−3
@@ -131,9 +131,9 @@ struct ispstat { · 130 unmodified lines
131131 struct ispstat_generic_config {
132132 /*
133133 * Fields must be in the same order as in:
134− * - isph3a_aewb_config
135− * - isph3a_af_config
136− * - isphist_config
134+ * - omap3isp_h3a_aewb_config
135+ * - omap3isp_h3a_af_config
136+ * - omap3isp_hist_config
137137 */
138138 u32 buf_size;
139139 u16 config_counter;
drivers/media/video/omap3isp/ispvideo.c+94−14
@@ -47,29 +47,59 @@ · 46 unmodified lines
4747
4848 static struct isp_format_info formats[] = {
4949 { V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8,
50− V4L2_MBUS_FMT_Y8_1X8, V4L2_PIX_FMT_GREY, 8, },
50+ V4L2_MBUS_FMT_Y8_1X8, V4L2_MBUS_FMT_Y8_1X8,
51+ V4L2_PIX_FMT_GREY, 8, },
52+ { V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y10_1X10,
53+ V4L2_MBUS_FMT_Y10_1X10, V4L2_MBUS_FMT_Y8_1X8,
54+ V4L2_PIX_FMT_Y10, 10, },
55+ { V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y10_1X10,
56+ V4L2_MBUS_FMT_Y12_1X12, V4L2_MBUS_FMT_Y8_1X8,
57+ V4L2_PIX_FMT_Y12, 12, },
58+ { V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8,
59+ V4L2_MBUS_FMT_SBGGR8_1X8, V4L2_MBUS_FMT_SBGGR8_1X8,
60+ V4L2_PIX_FMT_SBGGR8, 8, },
61+ { V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8,
62+ V4L2_MBUS_FMT_SGBRG8_1X8, V4L2_MBUS_FMT_SGBRG8_1X8,
63+ V4L2_PIX_FMT_SGBRG8, 8, },
64+ { V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8,
65+ V4L2_MBUS_FMT_SGRBG8_1X8, V4L2_MBUS_FMT_SGRBG8_1X8,
66+ V4L2_PIX_FMT_SGRBG8, 8, },
67+ { V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8,
68+ V4L2_MBUS_FMT_SRGGB8_1X8, V4L2_MBUS_FMT_SRGGB8_1X8,
69+ V4L2_PIX_FMT_SRGGB8, 8, },
5170 { V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8,
52− V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_PIX_FMT_SGRBG10DPCM8, 8, },
71+ V4L2_MBUS_FMT_SGRBG10_1X10, 0,
72+ V4L2_PIX_FMT_SGRBG10DPCM8, 8, },
5373 { V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR10_1X10,
54− V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_PIX_FMT_SBGGR10, 10, },
74+ V4L2_MBUS_FMT_SBGGR10_1X10, V4L2_MBUS_FMT_SBGGR8_1X8,
75+ V4L2_PIX_FMT_SBGGR10, 10, },
5576 { V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG10_1X10,
56− V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_PIX_FMT_SGBRG10, 10, },
77+ V4L2_MBUS_FMT_SGBRG10_1X10, V4L2_MBUS_FMT_SGBRG8_1X8,
78+ V4L2_PIX_FMT_SGBRG10, 10, },
5779 { V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG10_1X10,
58− V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_PIX_FMT_SGRBG10, 10, },
80+ V4L2_MBUS_FMT_SGRBG10_1X10, V4L2_MBUS_FMT_SGRBG8_1X8,
81+ V4L2_PIX_FMT_SGRBG10, 10, },
5982 { V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB10_1X10,
60− V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_PIX_FMT_SRGGB10, 10, },
83+ V4L2_MBUS_FMT_SRGGB10_1X10, V4L2_MBUS_FMT_SRGGB8_1X8,
84+ V4L2_PIX_FMT_SRGGB10, 10, },
6185 { V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR10_1X10,
62− V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_PIX_FMT_SBGGR12, 12, },
86+ V4L2_MBUS_FMT_SBGGR12_1X12, V4L2_MBUS_FMT_SBGGR8_1X8,
87+ V4L2_PIX_FMT_SBGGR12, 12, },
6388 { V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG10_1X10,
64− V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_PIX_FMT_SGBRG12, 12, },
89+ V4L2_MBUS_FMT_SGBRG12_1X12, V4L2_MBUS_FMT_SGBRG8_1X8,
90+ V4L2_PIX_FMT_SGBRG12, 12, },
6591 { V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG10_1X10,
66− V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_PIX_FMT_SGRBG12, 12, },
92+ V4L2_MBUS_FMT_SGRBG12_1X12, V4L2_MBUS_FMT_SGRBG8_1X8,
93+ V4L2_PIX_FMT_SGRBG12, 12, },
6794 { V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB10_1X10,
68− V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_PIX_FMT_SRGGB12, 12, },
95+ V4L2_MBUS_FMT_SRGGB12_1X12, V4L2_MBUS_FMT_SRGGB8_1X8,
96+ V4L2_PIX_FMT_SRGGB12, 12, },
6997 { V4L2_MBUS_FMT_UYVY8_1X16, V4L2_MBUS_FMT_UYVY8_1X16,
70− V4L2_MBUS_FMT_UYVY8_1X16, V4L2_PIX_FMT_UYVY, 16, },
98+ V4L2_MBUS_FMT_UYVY8_1X16, 0,
99+ V4L2_PIX_FMT_UYVY, 16, },
71100 { V4L2_MBUS_FMT_YUYV8_1X16, V4L2_MBUS_FMT_YUYV8_1X16,
72− V4L2_MBUS_FMT_YUYV8_1X16, V4L2_PIX_FMT_YUYV, 16, },
101+ V4L2_MBUS_FMT_YUYV8_1X16, 0,
102+ V4L2_PIX_FMT_YUYV, 16, },
73103 };
74104
75105 const struct isp_format_info *
@@ -85,6 +115,37 @@ omap3isp_video_format_info(enum v4l2_mbus_pixelcode code) · 9 unmodified lines
85115 return NULL;
86116 }
87117
118+/*
119+ * Decide whether desired output pixel code can be obtained with
120+ * the lane shifter by shifting the input pixel code.
121+ * @in: input pixelcode to shifter
122+ * @out: output pixelcode from shifter
123+ * @additional_shift: # of bits the sensor's LSB is offset from CAMEXT[0]
124+ *
125+ * return true if the combination is possible
126+ * return false otherwise
127+ */
128+static bool isp_video_is_shiftable(enum v4l2_mbus_pixelcode in,
129+ enum v4l2_mbus_pixelcode out,
130+ unsigned int additional_shift)
131+{
132+ const struct isp_format_info *in_info, *out_info;
133+
134+ if (in == out)
135+ return true;
136+
137+ in_info = omap3isp_video_format_info(in);
138+ out_info = omap3isp_video_format_info(out);
139+
140+ if ((in_info->flavor == 0) || (out_info->flavor == 0))
141+ return false;
142+
143+ if (in_info->flavor != out_info->flavor)
144+ return false;
145+
146+ return in_info->bpp - out_info->bpp + additional_shift <= 6;
147+}
148+
88149 /*
89150 * isp_video_mbus_to_pix - Convert v4l2_mbus_framefmt to v4l2_pix_format
90151 * @video: ISP video instance
@@ -235,6 +296,7 @@ static int isp_video_validate_pipeline(struct isp_pipeline *pipe) · 144 unmodified lines
235296 return -EPIPE;
236297
237298 while (1) {
299+ unsigned int shifter_link;
238300 /* Retrieve the sink format */
239301 pad = &subdev->entity.pads[0];
240302 if (!(pad->flags & MEDIA_PAD_FL_SINK))
@@ -263,6 +325,10 @@ static int isp_video_validate_pipeline(struct isp_pipeline *pipe) · 22 unmodified lines
263325 return -ENOSPC;
264326 }
265327
328+ /* If sink pad is on CCDC, the link has the lane shifter
329+ * in the middle of it. */
330+ shifter_link = subdev == &isp->isp_ccdc.subdev;
331+
266332 /* Retrieve the source format */
267333 pad = media_entity_remote_source(pad);
268334 if (pad == NULL ||
@@ -278,10 +344,24 @@ static int isp_video_validate_pipeline(struct isp_pipeline *pipe) · 9 unmodified lines
278344 return -EPIPE;
279345
280346 /* Check if the two ends match */
281− if (fmt_source.format.code != fmt_sink.format.code ||
282− fmt_source.format.width != fmt_sink.format.width ||
347+ if (fmt_source.format.width != fmt_sink.format.width ||
283348 fmt_source.format.height != fmt_sink.format.height)
284349 return -EPIPE;
350+
351+ if (shifter_link) {
352+ unsigned int parallel_shift = 0;
353+ if (isp->isp_ccdc.input == CCDC_INPUT_PARALLEL) {
354+ struct isp_parallel_platform_data *pdata =
355+ &((struct isp_v4l2_subdevs_group *)
356+ subdev->host_priv)->bus.parallel;
357+ parallel_shift = pdata->data_lane_shift * 2;
358+ }
359+ if (!isp_video_is_shiftable(fmt_source.format.code,
360+ fmt_sink.format.code,
361+ parallel_shift))
362+ return -EPIPE;
363+ } else if (fmt_source.format.code != fmt_sink.format.code)
364+ return -EPIPE;
285365 }
286366
287367 return 0;
drivers/media/video/omap3isp/ispvideo.h+3−0
@@ -49,6 +49,8 @@ struct v4l2_pix_format; · 48 unmodified lines
4949 * bits. Identical to @code if the format is 10 bits wide or less.
5050 * @uncompressed: V4L2 media bus format code for the corresponding uncompressed
5151 * format. Identical to @code if the format is not DPCM compressed.
52+ * @flavor: V4L2 media bus format code for the same pixel layout but
53+ * shifted to be 8 bits per pixel. =0 if format is not shiftable.
5254 * @pixelformat: V4L2 pixel format FCC identifier
5355 * @bpp: Bits per pixel
5456 */
@@ -56,6 +58,7 @@ struct isp_format_info { · 1 unmodified line
5658 enum v4l2_mbus_pixelcode code;
5759 enum v4l2_mbus_pixelcode truncated;
5860 enum v4l2_mbus_pixelcode uncompressed;
61+ enum v4l2_mbus_pixelcode flavor;
5962 u32 pixelformat;
6063 unsigned int bpp;
6164 };
drivers/media/video/s5p-fimc/fimc-capture.c+5−3
@@ -527,7 +527,7 @@ static int fimc_cap_s_fmt_mplane(struct file *file, void *priv, · 526 unmodified lines
527527 if (ret)
528528 return ret;
529529
530− if (vb2_is_streaming(&fimc->vid_cap.vbq) || fimc_capture_active(fimc))
530+ if (vb2_is_busy(&fimc->vid_cap.vbq) || fimc_capture_active(fimc))
531531 return -EBUSY;
532532
533533 frame = &ctx->d_frame;
@@ -539,8 +539,10 @@ static int fimc_cap_s_fmt_mplane(struct file *file, void *priv, · 5 unmodified lines
539539 return -EINVAL;
540540 }
541541
542− for (i = 0; i < frame->fmt->colplanes; i++)
543− frame->payload[i] = pix->plane_fmt[i].bytesperline * pix->height;
542+ for (i = 0; i < frame->fmt->colplanes; i++) {
543+ frame->payload[i] =
544+ (pix->width * pix->height * frame->fmt->depth[i]) >> 3;
545+ }
544546
545547 /* Output DMA frame pixel size and offsets. */
546548 frame->f_width = pix->plane_fmt[0].bytesperline * 8
drivers/media/video/s5p-fimc/fimc-core.c+47−27
@@ -361,10 +361,20 @@ static void fimc_capture_irq_handler(struct fimc_dev *fimc) · 360 unmodified lines
361361 {
362362 struct fimc_vid_cap *cap = &fimc->vid_cap;
363363 struct fimc_vid_buffer *v_buf;
364+ struct timeval *tv;
365+ struct timespec ts;
364366
365367 if (!list_empty(&cap->active_buf_q) &&
366368 test_bit(ST_CAPT_RUN, &fimc->state)) {
369+ ktime_get_real_ts(&ts);
370+
367371 v_buf = active_queue_pop(cap);
372+
373+ tv = &v_buf->vb.v4l2_buf.timestamp;
374+ tv->tv_sec = ts.tv_sec;
375+ tv->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
376+ v_buf->vb.v4l2_buf.sequence = cap->frame_count++;
377+
368378 vb2_buffer_done(&v_buf->vb, VB2_BUF_STATE_DONE);
369379 }
370380
@@ -758,7 +768,7 @@ static void fimc_unlock(struct vb2_queue *vq) · 387 unmodified lines
758768 mutex_unlock(&ctx->fimc_dev->lock);
759769 }
760770
761−struct vb2_ops fimc_qops = {
771+static struct vb2_ops fimc_qops = {
762772 .queue_setup = fimc_queue_setup,
763773 .buf_prepare = fimc_buf_prepare,
764774 .buf_queue = fimc_buf_queue,
@@ -927,23 +937,23 @@ int fimc_vidioc_try_fmt_mplane(struct file *file, void *priv, · 162 unmodified lines
927937 pix->num_planes = fmt->memplanes;
928938 pix->colorspace = V4L2_COLORSPACE_JPEG;
929939
930− for (i = 0; i < pix->num_planes; ++i) {
931− int bpl = pix->plane_fmt[i].bytesperline;
932940
933− dbg("[%d] bpl: %d, depth: %d, w: %d, h: %d",
934− i, bpl, fmt->depth[i], pix->width, pix->height);
941+ for (i = 0; i < pix->num_planes; ++i) {
942+ u32 bpl = pix->plane_fmt[i].bytesperline;
943+ u32 *sizeimage = &pix->plane_fmt[i].sizeimage;
935944
936− if (!bpl || (bpl * 8 / fmt->depth[i]) > pix->width)
937− bpl = (pix->width * fmt->depth[0]) >> 3;
945+ if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width))
946+ bpl = pix->width; /* Planar */
938947
939− if (!pix->plane_fmt[i].sizeimage)
940− pix->plane_fmt[i].sizeimage = pix->height * bpl;
948+ if (fmt->colplanes == 1 && /* Packed */
949+ (bpl == 0 || ((bpl * 8) / fmt->depth[i]) < pix->width))
950+ bpl = (pix->width * fmt->depth[0]) / 8;
941951
942− pix->plane_fmt[i].bytesperline = bpl;
952+ if (i == 0) /* Same bytesperline for each plane. */
953+ mod_x = bpl;
943954
944− dbg("[%d]: bpl: %d, sizeimage: %d",
945− i, pix->plane_fmt[i].bytesperline,
946− pix->plane_fmt[i].sizeimage);
955+ pix->plane_fmt[i].bytesperline = mod_x;
956+ *sizeimage = (pix->width * pix->height * fmt->depth[i]) / 8;
947957 }
948958
949959 return 0;
@@ -965,7 +975,7 @@ static int fimc_m2m_s_fmt_mplane(struct file *file, void *priv, · 15 unmodified lines
965975
966976 vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type);
967977
968− if (vb2_is_streaming(vq)) {
978+ if (vb2_is_busy(vq)) {
969979 v4l2_err(&fimc->m2m.v4l2_dev, "queue (%d) busy\n", f->type);
970980 return -EBUSY;
971981 }
@@ -985,8 +995,10 @@ static int fimc_m2m_s_fmt_mplane(struct file *file, void *priv, · 13 unmodified lines
985995 if (!frame->fmt)
986996 return -EINVAL;
987997
988− for (i = 0; i < frame->fmt->colplanes; i++)
989− frame->payload[i] = pix->plane_fmt[i].bytesperline * pix->height;
998+ for (i = 0; i < frame->fmt->colplanes; i++) {
999+ frame->payload[i] =
1000+ (pix->width * pix->height * frame->fmt->depth[i]) / 8;
1001+ }
9901002
9911003 frame->f_width = pix->plane_fmt[0].bytesperline * 8 /
9921004 frame->fmt->depth[0];
@@ -1750,7 +1762,7 @@ static int __devexit fimc_remove(struct platform_device *pdev) · 757 unmodified lines
17501762 }
17511763
17521764 /* Image pixel limits, similar across several FIMC HW revisions. */
1753−static struct fimc_pix_limit s5p_pix_limit[3] = {
1765+static struct fimc_pix_limit s5p_pix_limit[4] = {
17541766 [0] = {
17551767 .scaler_en_w = 3264,
17561768 .scaler_dis_w = 8192,
@@ -1775,6 +1787,14 @@ static struct fimc_pix_limit s5p_pix_limit[3] = { · 18 unmodified lines
17751787 .out_rot_en_w = 1280,
17761788 .out_rot_dis_w = 1920,
17771789 },
1790+ [3] = {
1791+ .scaler_en_w = 1920,
1792+ .scaler_dis_w = 8192,
1793+ .in_rot_en_h = 1366,
1794+ .in_rot_dis_w = 8192,
1795+ .out_rot_en_w = 1366,
1796+ .out_rot_dis_w = 1920,
1797+ },
17781798 };
17791799
17801800 static struct samsung_fimc_variant fimc0_variant_s5p = {
@@ -1827,7 +1847,7 @@ static struct samsung_fimc_variant fimc2_variant_s5pv210 = { · 46 unmodified lines
18271847 .pix_limit = &s5p_pix_limit[2],
18281848 };
18291849
1830−static struct samsung_fimc_variant fimc0_variant_s5pv310 = {
1850+static struct samsung_fimc_variant fimc0_variant_exynos4 = {
18311851 .pix_hoff = 1,
18321852 .has_inp_rot = 1,
18331853 .has_out_rot = 1,
@@ -1840,7 +1860,7 @@ static struct samsung_fimc_variant fimc0_variant_s5pv310 = { · 6 unmodified lines
18401860 .pix_limit = &s5p_pix_limit[1],
18411861 };
18421862
1843−static struct samsung_fimc_variant fimc2_variant_s5pv310 = {
1863+static struct samsung_fimc_variant fimc2_variant_exynos4 = {
18441864 .pix_hoff = 1,
18451865 .has_cistatus2 = 1,
18461866 .has_mainscaler_ext = 1,
@@ -1848,7 +1868,7 @@ static struct samsung_fimc_variant fimc2_variant_s5pv310 = { · 1 unmodified line
18481868 .min_out_pixsize = 16,
18491869 .hor_offs_align = 1,
18501870 .out_buf_count = 32,
1851− .pix_limit = &s5p_pix_limit[2],
1871+ .pix_limit = &s5p_pix_limit[3],
18521872 };
18531873
18541874 /* S5PC100 */
@@ -1874,12 +1894,12 @@ static struct samsung_fimc_driverdata fimc_drvdata_s5pv210 = { · 19 unmodified lines
18741894 };
18751895
18761896 /* S5PV310, S5PC210 */
1877−static struct samsung_fimc_driverdata fimc_drvdata_s5pv310 = {
1897+static struct samsung_fimc_driverdata fimc_drvdata_exynos4 = {
18781898 .variant = {
1879− [0] = &fimc0_variant_s5pv310,
1880− [1] = &fimc0_variant_s5pv310,
1881− [2] = &fimc0_variant_s5pv310,
1882− [3] = &fimc2_variant_s5pv310,
1899+ [0] = &fimc0_variant_exynos4,
1900+ [1] = &fimc0_variant_exynos4,
1901+ [2] = &fimc0_variant_exynos4,
1902+ [3] = &fimc2_variant_exynos4,
18831903 },
18841904 .num_entities = 4,
18851905 .lclk_frequency = 166000000UL,
@@ -1893,8 +1913,8 @@ static struct platform_device_id fimc_driver_ids[] = { · 7 unmodified lines
18931913 .name = "s5pv210-fimc",
18941914 .driver_data = (unsigned long)&fimc_drvdata_s5pv210,
18951915 }, {
1896− .name = "s5pv310-fimc",
1897− .driver_data = (unsigned long)&fimc_drvdata_s5pv310,
1916+ .name = "exynos4-fimc",
1917+ .driver_data = (unsigned long)&fimc_drvdata_exynos4,
18981918 },
18991919 {},
19001920 };
drivers/media/video/sh_mobile_ceu_camera.c+5−5
@@ -922,7 +922,7 @@ static int sh_mobile_ceu_get_formats(struct soc_camera_device *icd, unsigned int · 921 unmodified lines
922922 /* Try 2560x1920, 1280x960, 640x480, 320x240 */
923923 mf.width = 2560 >> shift;
924924 mf.height = 1920 >> shift;
925− ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video,
925+ ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video,
926926 s_mbus_fmt, &mf);
927927 if (ret < 0)
928928 return ret;
@@ -1224,7 +1224,7 @@ static int client_s_fmt(struct soc_camera_device *icd, · 295 unmodified lines
12241224 struct v4l2_cropcap cap;
12251225 int ret;
12261226
1227− ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video,
1227+ ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video,
12281228 s_mbus_fmt, mf);
12291229 if (ret < 0)
12301230 return ret;
@@ -1254,7 +1254,7 @@ static int client_s_fmt(struct soc_camera_device *icd, · 23 unmodified lines
12541254 tmp_h = min(2 * tmp_h, max_height);
12551255 mf->width = tmp_w;
12561256 mf->height = tmp_h;
1257− ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video,
1257+ ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video,
12581258 s_mbus_fmt, mf);
12591259 dev_geo(dev, "Camera scaled to %ux%u\n",
12601260 mf->width, mf->height);
@@ -1658,7 +1658,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd, · 397 unmodified lines
16581658 mf.code = xlate->code;
16591659 mf.colorspace = pix->colorspace;
16601660
1661− ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video, try_mbus_fmt, &mf);
1661+ ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video, try_mbus_fmt, &mf);
16621662 if (ret < 0)
16631663 return ret;
16641664
@@ -1682,7 +1682,7 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd, · 17 unmodified lines
16821682 */
16831683 mf.width = 2560;
16841684 mf.height = 1920;
1685− ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, video,
1685+ ret = v4l2_device_call_until_err(sd->v4l2_dev, (long)icd, video,
16861686 try_mbus_fmt, &mf);
16871687 if (ret < 0) {
16881688 /* Shouldn't actually happen... */
drivers/media/video/sh_mobile_csi2.c+9−2
@@ -38,6 +38,8 @@ struct sh_csi2 { · 37 unmodified lines
3838 void __iomem *base;
3939 struct platform_device *pdev;
4040 struct sh_csi2_client_config *client;
41+ unsigned long (*query_bus_param)(struct soc_camera_device *);
42+ int (*set_bus_param)(struct soc_camera_device *, unsigned long);
4143 };
4244
4345 static int sh_csi2_try_fmt(struct v4l2_subdev *sd,
@@ -208,6 +210,7 @@ static int sh_csi2_notify(struct notifier_block *nb, · 164 unmodified lines
208210 case BUS_NOTIFY_BOUND_DRIVER:
209211 snprintf(priv->subdev.name, V4L2_SUBDEV_NAME_SIZE, "%s%s",
210212 dev_name(v4l2_dev->dev), ".mipi-csi");
213+ priv->subdev.grp_id = (long)icd;
211214 ret = v4l2_device_register_subdev(v4l2_dev, &priv->subdev);
212215 dev_dbg(dev, "%s(%p): ret(register_subdev) = %d\n", __func__, priv, ret);
213216 if (ret < 0)
@@ -215,6 +218,8 @@ static int sh_csi2_notify(struct notifier_block *nb, · 1 unmodified line
215218
216219 priv->client = pdata->clients + i;
217220
221+ priv->set_bus_param = icd->ops->set_bus_param;
222+ priv->query_bus_param = icd->ops->query_bus_param;
218223 icd->ops->set_bus_param = sh_csi2_set_bus_param;
219224 icd->ops->query_bus_param = sh_csi2_query_bus_param;
220225
@@ -226,8 +231,10 @@ static int sh_csi2_notify(struct notifier_block *nb, · 5 unmodified lines
226231 priv->client = NULL;
227232
228233 /* Driver is about to be unbound */
229− icd->ops->set_bus_param = NULL;
230− icd->ops->query_bus_param = NULL;
234+ icd->ops->set_bus_param = priv->set_bus_param;
235+ icd->ops->query_bus_param = priv->query_bus_param;
236+ priv->set_bus_param = NULL;
237+ priv->query_bus_param = NULL;
231238
232239 v4l2_device_unregister_subdev(&priv->subdev);
233240
drivers/media/video/soc_camera.c+47−8
@@ -136,11 +136,50 @@ unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, · 135 unmodified lines
136136 }
137137 EXPORT_SYMBOL(soc_camera_apply_sensor_flags);
138138
139+#define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \
140+ ((x) >> 24) & 0xff
141+
142+static int soc_camera_try_fmt(struct soc_camera_device *icd,
143+ struct v4l2_format *f)
144+{
145+ struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
146+ struct v4l2_pix_format *pix = &f->fmt.pix;
147+ int ret;
148+
149+ dev_dbg(&icd->dev, "TRY_FMT(%c%c%c%c, %ux%u)\n",
150+ pixfmtstr(pix->pixelformat), pix->width, pix->height);
151+
152+ pix->bytesperline = 0;
153+ pix->sizeimage = 0;
154+
155+ ret = ici->ops->try_fmt(icd, f);
156+ if (ret < 0)
157+ return ret;
158+
159+ if (!pix->sizeimage) {
160+ if (!pix->bytesperline) {
161+ const struct soc_camera_format_xlate *xlate;
162+
163+ xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
164+ if (!xlate)
165+ return -EINVAL;
166+
167+ ret = soc_mbus_bytes_per_line(pix->width,
168+ xlate->host_fmt);
169+ if (ret > 0)
170+ pix->bytesperline = ret;
171+ }
172+ if (pix->bytesperline)
173+ pix->sizeimage = pix->bytesperline * pix->height;
174+ }
175+
176+ return 0;
177+}
178+
139179 static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv,
140180 struct v4l2_format *f)
141181 {
142182 struct soc_camera_device *icd = file->private_data;
143− struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
144183
145184 WARN_ON(priv != file->private_data);
146185
@@ -149,7 +188,7 @@ static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv, · 2 unmodified lines
149188 return -EINVAL;
150189
151190 /* limit format to hardware capabilities */
152− return ici->ops->try_fmt(icd, f);
191+ return soc_camera_try_fmt(icd, f);
153192 }
154193
155194 static int soc_camera_enum_input(struct file *file, void *priv,
@@ -362,9 +401,6 @@ static void soc_camera_free_user_formats(struct soc_camera_device *icd) · 206 unmodified lines
362401 icd->user_formats = NULL;
363402 }
364403
365−#define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \
366− ((x) >> 24) & 0xff
367−
368404 /* Called with .vb_lock held, or from the first open(2), see comment there */
369405 static int soc_camera_set_fmt(struct soc_camera_device *icd,
370406 struct v4l2_format *f)
@@ -377,7 +413,7 @@ static int soc_camera_set_fmt(struct soc_camera_device *icd, · 6 unmodified lines
377413 pixfmtstr(pix->pixelformat), pix->width, pix->height);
378414
379415 /* We always call try_fmt() before set_fmt() or set_crop() */
380− ret = ici->ops->try_fmt(icd, f);
416+ ret = soc_camera_try_fmt(icd, f);
381417 if (ret < 0)
382418 return ret;
383419
@@ -996,10 +1032,11 @@ static void soc_camera_free_i2c(struct soc_camera_device *icd) · 612 unmodified lines
9961032 {
9971033 struct i2c_client *client =
9981034 to_i2c_client(to_soc_camera_control(icd));
1035+ struct i2c_adapter *adap = client->adapter;
9991036 dev_set_drvdata(&icd->dev, NULL);
10001037 v4l2_device_unregister_subdev(i2c_get_clientdata(client));
10011038 i2c_unregister_device(client);
1002− i2c_put_adapter(client->adapter);
1039+ i2c_put_adapter(adap);
10031040 }
10041041 #else
10051042 #define soc_camera_init_i2c(icd, icl) (-ENODEV)
@@ -1071,6 +1108,9 @@ static int soc_camera_probe(struct device *dev) · 65 unmodified lines
10711108 }
10721109 }
10731110
1111+ sd = soc_camera_to_subdev(icd);
1112+ sd->grp_id = (long)icd;
1113+
10741114 /* At this point client .probe() should have run already */
10751115 ret = soc_camera_init_user_formats(icd);
10761116 if (ret < 0)
@@ -1092,7 +1132,6 @@ static int soc_camera_probe(struct device *dev) · 15 unmodified lines
10921132 goto evidstart;
10931133
10941134 /* Try to improve our guess of a reasonable window format */
1095− sd = soc_camera_to_subdev(icd);
10961135 if (!v4l2_subdev_call(sd, video, g_mbus_fmt, &mf)) {
10971136 icd->user_width = mf.width;
10981137 icd->user_height = mf.height;
drivers/media/video/tda9840.c+1−1
@@ -171,7 +171,7 @@ static int tda9840_probe(struct i2c_client *client, · 170 unmodified lines
171171 v4l_info(client, "chip found @ 0x%x (%s)\n",
172172 client->addr << 1, client->adapter->name);
173173
174− sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
174+ sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
175175 if (sd == NULL)
176176 return -ENOMEM;
177177 v4l2_i2c_subdev_init(sd, client, &tda9840_ops);
drivers/media/video/tea6415c.c+1−1
@@ -152,7 +152,7 @@ static int tea6415c_probe(struct i2c_client *client, · 151 unmodified lines
152152
153153 v4l_info(client, "chip found @ 0x%x (%s)\n",
154154 client->addr << 1, client->adapter->name);
155− sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
155+ sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
156156 if (sd == NULL)
157157 return -ENOMEM;
158158 v4l2_i2c_subdev_init(sd, client, &tea6415c_ops);
drivers/media/video/tea6420.c+1−1
@@ -125,7 +125,7 @@ static int tea6420_probe(struct i2c_client *client, · 124 unmodified lines
125125 v4l_info(client, "chip found @ 0x%x (%s)\n",
126126 client->addr << 1, client->adapter->name);
127127
128− sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
128+ sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
129129 if (sd == NULL)
130130 return -ENOMEM;
131131 v4l2_i2c_subdev_init(sd, client, &tea6420_ops);
drivers/media/video/upd64031a.c+1−1
@@ -230,7 +230,7 @@ static int upd64031a_probe(struct i2c_client *client, · 229 unmodified lines
230230 v4l_info(client, "chip found @ 0x%x (%s)\n",
231231 client->addr << 1, client->adapter->name);
232232
233− state = kmalloc(sizeof(struct upd64031a_state), GFP_KERNEL);
233+ state = kzalloc(sizeof(struct upd64031a_state), GFP_KERNEL);
234234 if (state == NULL)
235235 return -ENOMEM;
236236 sd = &state->sd;
drivers/media/video/upd64083.c+1−1
@@ -202,7 +202,7 @@ static int upd64083_probe(struct i2c_client *client, · 201 unmodified lines
202202 v4l_info(client, "chip found @ 0x%x (%s)\n",
203203 client->addr << 1, client->adapter->name);
204204
205− state = kmalloc(sizeof(struct upd64083_state), GFP_KERNEL);
205+ state = kzalloc(sizeof(struct upd64083_state), GFP_KERNEL);
206206 if (state == NULL)
207207 return -ENOMEM;
208208 sd = &state->sd;
drivers/media/video/v4l2-dev.c+10−5
@@ -389,7 +389,8 @@ static int v4l2_open(struct inode *inode, struct file *filp) · 388 unmodified lines
389389 video_get(vdev);
390390 mutex_unlock(&videodev_lock);
391391 #if defined(CONFIG_MEDIA_CONTROLLER)
392− if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) {
392+ if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
393+ vdev->vfl_type != VFL_TYPE_SUBDEV) {
393394 entity = media_entity_get(&vdev->entity);
394395 if (!entity) {
395396 ret = -EBUSY;
@@ -415,7 +416,8 @@ err: · 19 unmodified lines
415416 /* decrease the refcount in case of an error */
416417 if (ret) {
417418 #if defined(CONFIG_MEDIA_CONTROLLER)
418− if (vdev->v4l2_dev && vdev->v4l2_dev->mdev)
419+ if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
420+ vdev->vfl_type != VFL_TYPE_SUBDEV)
419421 media_entity_put(entity);
420422 #endif
421423 video_put(vdev);
@@ -437,7 +439,8 @@ static int v4l2_release(struct inode *inode, struct file *filp) · 15 unmodified lines
437439 mutex_unlock(vdev->lock);
438440 }
439441 #if defined(CONFIG_MEDIA_CONTROLLER)
440− if (vdev->v4l2_dev && vdev->v4l2_dev->mdev)
442+ if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
443+ vdev->vfl_type != VFL_TYPE_SUBDEV)
441444 media_entity_put(&vdev->entity);
442445 #endif
443446 /* decrease the refcount unconditionally since the release()
@@ -686,7 +689,8 @@ int __video_register_device(struct video_device *vdev, int type, int nr, · 242 unmodified lines
686689
687690 #if defined(CONFIG_MEDIA_CONTROLLER)
688691 /* Part 5: Register the entity. */
689− if (vdev->v4l2_dev && vdev->v4l2_dev->mdev) {
692+ if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
693+ vdev->vfl_type != VFL_TYPE_SUBDEV) {
690694 vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L;
691695 vdev->entity.name = vdev->name;
692696 vdev->entity.v4l.major = VIDEO_MAJOR;
@@ -733,7 +737,8 @@ void video_unregister_device(struct video_device *vdev) · 40 unmodified lines
733737 return;
734738
735739 #if defined(CONFIG_MEDIA_CONTROLLER)
736− if (vdev->v4l2_dev && vdev->v4l2_dev->mdev)
740+ if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
741+ vdev->vfl_type != VFL_TYPE_SUBDEV)
737742 media_device_unregister_entity(&vdev->entity);
738743 #endif
739744
drivers/media/video/v4l2-device.c+4−1
@@ -155,8 +155,10 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, · 154 unmodified lines
155155 sd->v4l2_dev = v4l2_dev;
156156 if (sd->internal_ops && sd->internal_ops->registered) {
157157 err = sd->internal_ops->registered(sd);
158− if (err)
158+ if (err) {
159+ module_put(sd->owner);
159160 return err;
161+ }
160162 }
161163
162164 /* This just returns 0 if either of the two args is NULL */
@@ -164,6 +166,7 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, · 1 unmodified line
164166 if (err) {
165167 if (sd->internal_ops && sd->internal_ops->unregistered)
166168 sd->internal_ops->unregistered(sd);
169+ module_put(sd->owner);
167170 return err;
168171 }
169172
drivers/media/video/v4l2-subdev.c+7−7
@@ -155,25 +155,25 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) · 154 unmodified lines
155155
156156 switch (cmd) {
157157 case VIDIOC_QUERYCTRL:
158− return v4l2_subdev_queryctrl(sd, arg);
158+ return v4l2_queryctrl(sd->ctrl_handler, arg);
159159
160160 case VIDIOC_QUERYMENU:
161− return v4l2_subdev_querymenu(sd, arg);
161+ return v4l2_querymenu(sd->ctrl_handler, arg);
162162
163163 case VIDIOC_G_CTRL:
164− return v4l2_subdev_g_ctrl(sd, arg);
164+ return v4l2_g_ctrl(sd->ctrl_handler, arg);
165165
166166 case VIDIOC_S_CTRL:
167− return v4l2_subdev_s_ctrl(sd, arg);
167+ return v4l2_s_ctrl(sd->ctrl_handler, arg);
168168
169169 case VIDIOC_G_EXT_CTRLS:
170− return v4l2_subdev_g_ext_ctrls(sd, arg);
170+ return v4l2_g_ext_ctrls(sd->ctrl_handler, arg);
171171
172172 case VIDIOC_S_EXT_CTRLS:
173− return v4l2_subdev_s_ext_ctrls(sd, arg);
173+ return v4l2_s_ext_ctrls(sd->ctrl_handler, arg);
174174
175175 case VIDIOC_TRY_EXT_CTRLS:
176− return v4l2_subdev_try_ext_ctrls(sd, arg);
176+ return v4l2_try_ext_ctrls(sd->ctrl_handler, arg);
177177
178178 case VIDIOC_DQEVENT:
179179 if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
drivers/media/video/videobuf-dma-contig.c+1−1
@@ -300,7 +300,7 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q, · 299 unmodified lines
300300
301301 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
302302 retval = remap_pfn_range(vma, vma->vm_start,
303− PFN_DOWN(virt_to_phys(mem->vaddr)),
303+ mem->dma_handle >> PAGE_SHIFT,
304304 size, vma->vm_page_prot);
305305 if (retval) {
306306 dev_err(q->dev, "mmap: remap failed with error %d. ", retval);
drivers/media/video/videobuf2-core.c+12−5
@@ -37,6 +37,9 @@ module_param(debug, int, 0644); · 36 unmodified lines
3737 #define call_qop(q, op, args...) \
3838 (((q)->ops->op) ? ((q)->ops->op(args)) : 0)
3939
40+#define V4L2_BUFFER_STATE_FLAGS (V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED | \
41+ V4L2_BUF_FLAG_DONE | V4L2_BUF_FLAG_ERROR)
42+
4043 /**
4144 * __vb2_buf_mem_alloc() - allocate video memory for the given buffer
4245 */
@@ -51,7 +54,7 @@ static int __vb2_buf_mem_alloc(struct vb2_buffer *vb, · 8 unmodified lines
5154 for (plane = 0; plane < vb->num_planes; ++plane) {
5255 mem_priv = call_memop(q, plane, alloc, q->alloc_ctx[plane],
5356 plane_sizes[plane]);
54− if (!mem_priv)
57+ if (IS_ERR_OR_NULL(mem_priv))
5558 goto free;
5659
5760 /* Associate allocator private data with this plane */
@@ -284,7 +287,7 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b) · 226 unmodified lines
284287 struct vb2_queue *q = vb->vb2_queue;
285288 int ret = 0;
286289
287− /* Copy back data such as timestamp, input, etc. */
290+ /* Copy back data such as timestamp, flags, input, etc. */
288291 memcpy(b, &vb->v4l2_buf, offsetof(struct v4l2_buffer, m));
289292 b->input = vb->v4l2_buf.input;
290293 b->reserved = vb->v4l2_buf.reserved;
@@ -313,7 +316,10 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b) · 22 unmodified lines
313316 b->m.userptr = vb->v4l2_planes[0].m.userptr;
314317 }
315318
316− b->flags = 0;
319+ /*
320+ * Clear any buffer state related flags.
321+ */
322+ b->flags &= ~V4L2_BUFFER_STATE_FLAGS;
317323
318324 switch (vb->state) {
319325 case VB2_BUF_STATE_QUEUED:
@@ -519,6 +525,7 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req) · 199 unmodified lines
519525 num_buffers = min_t(unsigned int, req->count, VIDEO_MAX_FRAME);
520526 memset(plane_sizes, 0, sizeof(plane_sizes));
521527 memset(q->alloc_ctx, 0, sizeof(q->alloc_ctx));
528+ q->memory = req->memory;
522529
523530 /*
524531 * Ask the driver how many buffers and planes per buffer it requires.
@@ -560,8 +567,6 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req) · 35 unmodified lines
560567 ret = num_buffers;
561568 }
562569
563− q->memory = req->memory;
564−
565570 /*
566571 * Return the number of successfully allocated buffers
567572 * to the userspace.
@@ -715,6 +720,8 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b, · 147 unmodified lines
715720
716721 vb->v4l2_buf.field = b->field;
717722 vb->v4l2_buf.timestamp = b->timestamp;
723+ vb->v4l2_buf.input = b->input;
724+ vb->v4l2_buf.flags = b->flags & ~V4L2_BUFFER_STATE_FLAGS;
718725
719726 return 0;
720727 }
drivers/media/video/videobuf2-dma-contig.c+1−1
@@ -46,7 +46,7 @@ static void *vb2_dma_contig_alloc(void *alloc_ctx, unsigned long size) · 45 unmodified lines
4646 GFP_KERNEL);
4747 if (!buf->vaddr) {
4848 dev_err(conf->dev, "dma_alloc_coherent of size %ld failed\n",
49− buf->size);
49+ size);
5050 kfree(buf);
5151 return ERR_PTR(-ENOMEM);
5252 }
drivers/message/i2o/i2o_block.c+0−1
@@ -1000,7 +1000,6 @@ static struct i2o_block_device *i2o_block_device_alloc(void) · 999 unmodified lines
10001000 gd->major = I2O_MAJOR;
10011001 gd->queue = queue;
10021002 gd->fops = &i2o_block_fops;
1003− gd->events = DISK_EVENT_MEDIA_CHANGE;
10041003 gd->private_data = dev;
10051004
10061005 dev->gd = gd;
drivers/mfd/asic3.c+1−1
@@ -144,7 +144,7 @@ static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc) · 143 unmodified lines
144144 int iter, i;
145145 unsigned long flags;
146146
147− data->chip->irq_ack(irq_data);
147+ data->chip->irq_ack(data);
148148
149149 for (iter = 0 ; iter < MAX_ASIC_ISR_LOOPS; iter++) {
150150 u32 status;
drivers/mfd/omap-usb-host.c+7−10
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 #include <linux/dma-mapping.h>
2626 #include <linux/spinlock.h>
2727 #include <linux/gpio.h>
28−#include <linux/regulator/consumer.h>
2928 #include <plat/usb.h>
3029
3130 #define USBHS_DRIVER_NAME "usbhs-omap"
@@ -700,8 +699,7 @@ static int usbhs_enable(struct device *dev) · 668 unmodified lines
700699 dev_dbg(dev, "starting TI HSUSB Controller\n");
701700 if (!pdata) {
702701 dev_dbg(dev, "missing platform_data\n");
703− ret = -ENODEV;
704− goto end_enable;
702+ return -ENODEV;
705703 }
706704
707705 spin_lock_irqsave(&omap->lock, flags);
@@ -719,14 +717,14 @@ static int usbhs_enable(struct device *dev) · 11 unmodified lines
719717 gpio_request(pdata->ehci_data->reset_gpio_port[0],
720718 "USB1 PHY reset");
721719 gpio_direction_output
722− (pdata->ehci_data->reset_gpio_port[0], 1);
720+ (pdata->ehci_data->reset_gpio_port[0], 0);
723721 }
724722
725723 if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) {
726724 gpio_request(pdata->ehci_data->reset_gpio_port[1],
727725 "USB2 PHY reset");
728726 gpio_direction_output
729− (pdata->ehci_data->reset_gpio_port[1], 1);
727+ (pdata->ehci_data->reset_gpio_port[1], 0);
730728 }
731729
732730 /* Hold the PHY in RESET for enough time till DIR is high */
@@ -906,16 +904,17 @@ static int usbhs_enable(struct device *dev) · 173 unmodified lines
906904
907905 if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
908906 gpio_set_value
909− (pdata->ehci_data->reset_gpio_port[0], 0);
907+ (pdata->ehci_data->reset_gpio_port[0], 1);
910908
911909 if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
912910 gpio_set_value
913− (pdata->ehci_data->reset_gpio_port[1], 0);
911+ (pdata->ehci_data->reset_gpio_port[1], 1);
914912 }
915913
916914 end_count:
917915 omap->count++;
918− goto end_enable;
916+ spin_unlock_irqrestore(&omap->lock, flags);
917+ return 0;
919918
920919 err_tll:
921920 if (pdata->ehci_data->phy_reset) {
@@ -931,8 +930,6 @@ err_tll: · 9 unmodified lines
931930 clk_disable(omap->usbhost_fs_fck);
932931 clk_disable(omap->usbhost_hs_fck);
933932 clk_disable(omap->usbhost_ick);
934−
935−end_enable:
936933 spin_unlock_irqrestore(&omap->lock, flags);
937934 return ret;
938935 }
drivers/mfd/twl4030-power.c+2−1
@@ -447,12 +447,13 @@ static int __init load_twl4030_script(struct twl4030_script *tscript, · 446 unmodified lines
447447 if (err)
448448 goto out;
449449 }
450− if (tscript->flags & TWL4030_SLEEP_SCRIPT)
450+ if (tscript->flags & TWL4030_SLEEP_SCRIPT) {
451451 if (order)
452452 pr_warning("TWL4030: Bad order of scripts (sleep "\
453453 "script before wakeup) Leads to boot"\
454454 "failure on some boards\n");
455455 err = twl4030_config_sleep_sequence(address);
456+ }
456457 out:
457458 return err;
458459 }
drivers/mmc/core/bus.c+1−0
@@ -284,6 +284,7 @@ int mmc_add_card(struct mmc_card *card) · 283 unmodified lines
284284 type = "SD-combo";
285285 if (mmc_card_blockaddr(card))
286286 type = "SDHC-combo";
287+ break;
287288 default:
288289 type = "?";
289290 break;
drivers/mmc/host/omap.c+1−1
@@ -832,7 +832,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id) · 831 unmodified lines
832832 return IRQ_HANDLED;
833833 }
834834
835− if (end_command)
835+ if (end_command && host->cmd)
836836 mmc_omap_cmd_done(host, host->cmd);
837837 if (host->data != NULL) {
838838 if (transfer_error)
drivers/mmc/host/sdhci-of-core.c+5−2
@@ -124,8 +124,10 @@ static bool __devinit sdhci_of_wp_inverted(struct device_node *np) · 123 unmodified lines
124124 #endif
125125 }
126126
127+static const struct of_device_id sdhci_of_match[];
127128 static int __devinit sdhci_of_probe(struct platform_device *ofdev)
128129 {
130+ const struct of_device_id *match;
129131 struct device_node *np = ofdev->dev.of_node;
130132 struct sdhci_of_data *sdhci_of_data;
131133 struct sdhci_host *host;
@@ -134,9 +136,10 @@ static int __devinit sdhci_of_probe(struct platform_device *ofdev) · 2 unmodified lines
134136 int size;
135137 int ret;
136138
137− if (!ofdev->dev.of_match)
139+ match = of_match_device(sdhci_of_match, &ofdev->dev);
140+ if (!match)
138141 return -EINVAL;
139− sdhci_of_data = ofdev->dev.of_match->data;
142+ sdhci_of_data = match->data;
140143
141144 if (!of_device_is_available(np))
142145 return -ENODEV;
drivers/mmc/host/sdhci-pci.c+1−0
@@ -957,6 +957,7 @@ static struct sdhci_pci_slot * __devinit sdhci_pci_probe_slot( · 956 unmodified lines
957957 host->ioaddr = pci_ioremap_bar(pdev, bar);
958958 if (!host->ioaddr) {
959959 dev_err(&pdev->dev, "failed to remap registers\n");
960+ ret = -ENOMEM;
960961 goto release;
961962 }
962963
drivers/mmc/host/sdhci.c+8−1
@@ -1334,6 +1334,13 @@ static void sdhci_tasklet_finish(unsigned long param) · 1333 unmodified lines
13341334
13351335 host = (struct sdhci_host*)param;
13361336
1337+ /*
1338+ * If this tasklet gets rescheduled while running, it will
1339+ * be run again afterwards but without any active request.
1340+ */
1341+ if (!host->mrq)
1342+ return;
1343+
13371344 spin_lock_irqsave(&host->lock, flags);
13381345
13391346 del_timer(&host->timer);
@@ -1345,7 +1352,7 @@ static void sdhci_tasklet_finish(unsigned long param) · 5 unmodified lines
13451352 * upon error conditions.
13461353 */
13471354 if (!(host->flags & SDHCI_DEVICE_DEAD) &&
1348− (mrq->cmd->error ||
1355+ ((mrq->cmd && mrq->cmd->error) ||
13491356 (mrq->data && (mrq->data->error ||
13501357 (mrq->data->stop && mrq->data->stop->error))) ||
13511358 (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {
drivers/mmc/host/tmio_mmc_pio.c+5−5
@@ -728,15 +728,15 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 727 unmodified lines
728728 tmio_mmc_set_clock(host, ios->clock);
729729
730730 /* Power sequence - OFF -> UP -> ON */
731− if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
731+ if (ios->power_mode == MMC_POWER_UP) {
732+ /* power up SD bus */
733+ if (host->set_pwr)
734+ host->set_pwr(host->pdev, 1);
735+ } else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
732736 /* power down SD bus */
733737 if (ios->power_mode == MMC_POWER_OFF && host->set_pwr)
734738 host->set_pwr(host->pdev, 0);
735739 tmio_mmc_clk_stop(host);
736− } else if (ios->power_mode == MMC_POWER_UP) {
737− /* power up SD bus */
738− if (host->set_pwr)
739− host->set_pwr(host->pdev, 1);
740740 } else {
741741 /* start bus clock */
742742 tmio_mmc_clk_start(host);
drivers/mtd/maps/physmap_of.c+5−2
@@ -214,11 +214,13 @@ static void __devinit of_free_probes(const char **probes) · 213 unmodified lines
214214 }
215215 #endif
216216
217+static struct of_device_id of_flash_match[];
217218 static int __devinit of_flash_probe(struct platform_device *dev)
218219 {
219220 #ifdef CONFIG_MTD_PARTITIONS
220221 const char **part_probe_types;
221222 #endif
223+ const struct of_device_id *match;
222224 struct device_node *dp = dev->dev.of_node;
223225 struct resource res;
224226 struct of_flash *info;
@@ -232,9 +234,10 @@ static int __devinit of_flash_probe(struct platform_device *dev) · 7 unmodified lines
232234 struct mtd_info **mtd_list = NULL;
233235 resource_size_t res_size;
234236
235− if (!dev->dev.of_match)
237+ match = of_match_device(of_flash_match, &dev->dev);
238+ if (!match)
236239 return -EINVAL;
237− probe_type = dev->dev.of_match->data;
240+ probe_type = match->data;
238241
239242 reg_tuple_size = (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32);
240243
drivers/mtd/nand/diskonchip.c+1−1
@@ -400,7 +400,7 @@ static uint16_t __init doc200x_ident_chip(struct mtd_info *mtd, int nr) · 399 unmodified lines
400400 doc200x_hwcontrol(mtd, 0, NAND_CTRL_ALE | NAND_CTRL_CHANGE);
401401 doc200x_hwcontrol(mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE);
402402
403− /* We can't' use dev_ready here, but at least we wait for the
403+ /* We can't use dev_ready here, but at least we wait for the
404404 * command to complete
405405 */
406406 udelay(50);
drivers/net/Kconfig+7−1
@@ -2536,7 +2536,7 @@ config S6GMAC · 2535 unmodified lines
25362536 source "drivers/net/stmmac/Kconfig"
25372537
25382538 config PCH_GBE
2539− tristate "PCH Gigabit Ethernet"
2539+ tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7223 IOH GbE"
25402540 depends on PCI
25412541 select MII
25422542 ---help---
@@ -2548,6 +2548,12 @@ config PCH_GBE · 5 unmodified lines
25482548 to Gigabit Ethernet.
25492549 This driver enables Gigabit Ethernet function.
25502550
2551+ This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
2552+ Output Hub), ML7223.
2553+ ML7223 IOH is for MP(Media Phone) use.
2554+ ML7223 is companion chip for Intel Atom E6xx series.
2555+ ML7223 is completely compatible for Intel EG20T PCH.
2556+
25512557 endif # NETDEV_1000
25522558
25532559 #
drivers/net/Makefile+3−3
@@ -144,7 +144,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o · 143 unmodified lines
144144 obj-$(CONFIG_SB1250_MAC) += sb1250-mac.o
145145 obj-$(CONFIG_B44) += b44.o
146146 obj-$(CONFIG_FORCEDETH) += forcedeth.o
147−obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
147+obj-$(CONFIG_NE_H8300) += ne-h8300.o
148148 obj-$(CONFIG_AX88796) += ax88796.o
149149 obj-$(CONFIG_BCM63XX_ENET) += bcm63xx_enet.o
150150 obj-$(CONFIG_FTMAC100) += ftmac100.o
@@ -219,7 +219,7 @@ obj-$(CONFIG_SC92031) += sc92031.o · 68 unmodified lines
219219 obj-$(CONFIG_LP486E) += lp486e.o
220220
221221 obj-$(CONFIG_ETH16I) += eth16i.o
222−obj-$(CONFIG_ZORRO8390) += zorro8390.o 8390.o
222+obj-$(CONFIG_ZORRO8390) += zorro8390.o
223223 obj-$(CONFIG_HPLANCE) += hplance.o 7990.o
224224 obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
225225 obj-$(CONFIG_EQUALIZER) += eql.o
@@ -231,7 +231,7 @@ obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o · 5 unmodified lines
231231 obj-$(CONFIG_DECLANCE) += declance.o
232232 obj-$(CONFIG_ATARILANCE) += atarilance.o
233233 obj-$(CONFIG_A2065) += a2065.o
234−obj-$(CONFIG_HYDRA) += hydra.o 8390.o
234+obj-$(CONFIG_HYDRA) += hydra.o
235235 obj-$(CONFIG_ARIADNE) += ariadne.o
236236 obj-$(CONFIG_CS89x0) += cs89x0.o
237237 obj-$(CONFIG_MACSONIC) += macsonic.o
drivers/net/amd8111e.c+1−1
@@ -106,7 +106,7 @@ MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version "M · 105 unmodified lines
106106 MODULE_LICENSE("GPL");
107107 MODULE_DEVICE_TABLE(pci, amd8111e_pci_tbl);
108108 module_param_array(speed_duplex, int, NULL, 0);
109−MODULE_PARM_DESC(speed_duplex, "Set device speed and duplex modes, 0: Auto Negotitate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex");
109+MODULE_PARM_DESC(speed_duplex, "Set device speed and duplex modes, 0: Auto Negotiate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex");
110110 module_param_array(coalesce, bool, NULL, 0);
111111 MODULE_PARM_DESC(coalesce, "Enable or Disable interrupt coalescing, 1: Enable, 0: Disable");
112112 module_param_array(dynamic_ipg, bool, NULL, 0);
drivers/net/arm/etherh.c+2−2
@@ -527,7 +527,7 @@ static void __init etherh_banner(void) · 526 unmodified lines
527527 * Read the ethernet address string from the on board rom.
528528 * This is an ascii string...
529529 */
530−static int __init etherh_addr(char *addr, struct expansion_card *ec)
530+static int __devinit etherh_addr(char *addr, struct expansion_card *ec)
531531 {
532532 struct in_chunk_dir cd;
533533 char *s;
@@ -655,7 +655,7 @@ static const struct net_device_ops etherh_netdev_ops = { · 121 unmodified lines
655655 static u32 etherh_regoffsets[16];
656656 static u32 etherm_regoffsets[16];
657657
658−static int __init
658+static int __devinit
659659 etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
660660 {
661661 const struct etherh_data *data = id->data;
drivers/net/atl1c/atl1c.h+3−3
@@ -566,9 +566,9 @@ struct atl1c_adapter { · 565 unmodified lines
566566 #define __AT_TESTING 0x0001
567567 #define __AT_RESETTING 0x0002
568568 #define __AT_DOWN 0x0003
569− u8 work_event;
570−#define ATL1C_WORK_EVENT_RESET 0x01
571−#define ATL1C_WORK_EVENT_LINK_CHANGE 0x02
569+ unsigned long work_event;
570+#define ATL1C_WORK_EVENT_RESET 0
571+#define ATL1C_WORK_EVENT_LINK_CHANGE 1
572572 u32 msg_enable;
573573
574574 bool have_msi;
drivers/net/atl1c/atl1c_main.c+5−9
@@ -325,7 +325,7 @@ static void atl1c_link_chg_event(struct atl1c_adapter *adapter) · 324 unmodified lines
325325 }
326326 }
327327
328− adapter->work_event |= ATL1C_WORK_EVENT_LINK_CHANGE;
328+ set_bit(ATL1C_WORK_EVENT_LINK_CHANGE, &adapter->work_event);
329329 schedule_work(&adapter->common_task);
330330 }
331331
@@ -337,20 +337,16 @@ static void atl1c_common_task(struct work_struct *work) · 5 unmodified lines
337337 adapter = container_of(work, struct atl1c_adapter, common_task);
338338 netdev = adapter->netdev;
339339
340− if (adapter->work_event & ATL1C_WORK_EVENT_RESET) {
341− adapter->work_event &= ~ATL1C_WORK_EVENT_RESET;
340+ if (test_and_clear_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event)) {
342341 netif_device_detach(netdev);
343342 atl1c_down(adapter);
344343 atl1c_up(adapter);
345344 netif_device_attach(netdev);
346− return;
347345 }
348346
349− if (adapter->work_event & ATL1C_WORK_EVENT_LINK_CHANGE) {
350− adapter->work_event &= ~ATL1C_WORK_EVENT_LINK_CHANGE;
347+ if (test_and_clear_bit(ATL1C_WORK_EVENT_LINK_CHANGE,
348+ &adapter->work_event))
351349 atl1c_check_link_status(adapter);
352− }
353− return;
354350 }
355351
356352
@@ -369,7 +365,7 @@ static void atl1c_tx_timeout(struct net_device *netdev) · 12 unmodified lines
369365 struct atl1c_adapter *adapter = netdev_priv(netdev);
370366
371367 /* Do the reset outside of interrupt context */
372− adapter->work_event |= ATL1C_WORK_EVENT_RESET;
368+ set_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event);
373369 schedule_work(&adapter->common_task);
374370 }
375371
drivers/net/benet/be.h+1−1
@@ -213,7 +213,7 @@ struct be_rx_stats { · 212 unmodified lines
213213
214214 struct be_rx_compl_info {
215215 u32 rss_hash;
216− u16 vid;
216+ u16 vlan_tag;
217217 u16 pkt_size;
218218 u16 rxq_idx;
219219 u16 mac_id;
drivers/net/benet/be_cmds.c+1−1
@@ -132,7 +132,7 @@ static void be_async_grp5_pvid_state_process(struct be_adapter *adapter, · 131 unmodified lines
132132 struct be_async_event_grp5_pvid_state *evt)
133133 {
134134 if (evt->enabled)
135− adapter->pvid = evt->tag;
135+ adapter->pvid = le16_to_cpu(evt->tag);
136136 else
137137 adapter->pvid = 0;
138138 }
drivers/net/benet/be_main.c+13−6
@@ -1018,7 +1018,8 @@ static void be_rx_compl_process(struct be_adapter *adapter, · 1017 unmodified lines
10181018 kfree_skb(skb);
10191019 return;
10201020 }
1021− vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, rxcp->vid);
1021+ vlan_hwaccel_receive_skb(skb, adapter->vlan_grp,
1022+ rxcp->vlan_tag);
10221023 } else {
10231024 netif_receive_skb(skb);
10241025 }
@@ -1076,7 +1077,8 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, · 51 unmodified lines
10761077 if (likely(!rxcp->vlanf))
10771078 napi_gro_frags(&eq_obj->napi);
10781079 else
1079− vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, rxcp->vid);
1080+ vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp,
1081+ rxcp->vlan_tag);
10801082 }
10811083
10821084 static void be_parse_rx_compl_v1(struct be_adapter *adapter,
@@ -1102,7 +1104,8 @@ static void be_parse_rx_compl_v1(struct be_adapter *adapter, · 19 unmodified lines
11021104 rxcp->pkt_type =
11031105 AMAP_GET_BITS(struct amap_eth_rx_compl_v1, cast_enc, compl);
11041106 rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vtm, compl);
1105− rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vlan_tag, compl);
1107+ rxcp->vlan_tag = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vlan_tag,
1108+ compl);
11061109 }
11071110
11081111 static void be_parse_rx_compl_v0(struct be_adapter *adapter,
@@ -1128,7 +1131,8 @@ static void be_parse_rx_compl_v0(struct be_adapter *adapter, · 19 unmodified lines
11281131 rxcp->pkt_type =
11291132 AMAP_GET_BITS(struct amap_eth_rx_compl_v0, cast_enc, compl);
11301133 rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vtm, compl);
1131− rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vlan_tag, compl);
1134+ rxcp->vlan_tag = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vlan_tag,
1135+ compl);
11321136 }
11331137
11341138 static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo)
@@ -1155,9 +1159,11 @@ static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) · 20 unmodified lines
11551159 rxcp->vlanf = 0;
11561160
11571161 if (!lancer_chip(adapter))
1158− rxcp->vid = swab16(rxcp->vid);
1162+ rxcp->vlan_tag = swab16(rxcp->vlan_tag);
11591163
1160− if ((adapter->pvid == rxcp->vid) && !adapter->vlan_tag[rxcp->vid])
1164+ if (((adapter->pvid & VLAN_VID_MASK) ==
1165+ (rxcp->vlan_tag & VLAN_VID_MASK)) &&
1166+ !adapter->vlan_tag[rxcp->vlan_tag])
11611167 rxcp->vlanf = 0;
11621168
11631169 /* As the compl has been parsed, reset it; we wont touch it again */
@@ -1873,6 +1879,7 @@ static void be_worker(struct work_struct *work) · 709 unmodified lines
18731879 be_detect_dump_ue(adapter);
18741880
18751881 reschedule:
1882+ adapter->work_counter++;
18761883 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
18771884 }
18781885
drivers/net/bna/bfa_ioc.c+18−13
@@ -38,6 +38,8 @@ · 37 unmodified lines
3838 #define bfa_ioc_map_port(__ioc) ((__ioc)->ioc_hwif->ioc_map_port(__ioc))
3939 #define bfa_ioc_notify_fail(__ioc) \
4040 ((__ioc)->ioc_hwif->ioc_notify_fail(__ioc))
41+#define bfa_ioc_sync_start(__ioc) \
42+ ((__ioc)->ioc_hwif->ioc_sync_start(__ioc))
4143 #define bfa_ioc_sync_join(__ioc) \
4244 ((__ioc)->ioc_hwif->ioc_sync_join(__ioc))
4345 #define bfa_ioc_sync_leave(__ioc) \
@@ -602,7 +604,7 @@ bfa_iocpf_sm_fwcheck(struct bfa_iocpf *iocpf, enum iocpf_event event) · 558 unmodified lines
602604 switch (event) {
603605 case IOCPF_E_SEMLOCKED:
604606 if (bfa_ioc_firmware_lock(ioc)) {
605− if (bfa_ioc_sync_complete(ioc)) {
607+ if (bfa_ioc_sync_start(ioc)) {
606608 iocpf->retry_count = 0;
607609 bfa_ioc_sync_join(ioc);
608610 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit);
@@ -1314,7 +1316,7 @@ bfa_nw_ioc_fwver_cmp(struct bfa_ioc *ioc, struct bfi_ioc_image_hdr *fwhdr) · 705 unmodified lines
13141316 * execution context (driver/bios) must match.
13151317 */
13161318 static bool
1317−bfa_ioc_fwver_valid(struct bfa_ioc *ioc)
1319+bfa_ioc_fwver_valid(struct bfa_ioc *ioc, u32 boot_env)
13181320 {
13191321 struct bfi_ioc_image_hdr fwhdr, *drv_fwhdr;
13201322
@@ -1325,7 +1327,7 @@ bfa_ioc_fwver_valid(struct bfa_ioc *ioc) · 4 unmodified lines
13251327 if (fwhdr.signature != drv_fwhdr->signature)
13261328 return false;
13271329
1328− if (fwhdr.exec != drv_fwhdr->exec)
1330+ if (swab32(fwhdr.param) != boot_env)
13291331 return false;
13301332
13311333 return bfa_nw_ioc_fwver_cmp(ioc, &fwhdr);
@@ -1352,9 +1354,12 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force) · 20 unmodified lines
13521354 {
13531355 enum bfi_ioc_state ioc_fwstate;
13541356 bool fwvalid;
1357+ u32 boot_env;
13551358
13561359 ioc_fwstate = readl(ioc->ioc_regs.ioc_fwstate);
13571360
1361+ boot_env = BFI_BOOT_LOADER_OS;
1362+
13581363 if (force)
13591364 ioc_fwstate = BFI_IOC_UNINIT;
13601365
@@ -1362,10 +1367,10 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force) · 1 unmodified line
13621367 * check if firmware is valid
13631368 */
13641369 fwvalid = (ioc_fwstate == BFI_IOC_UNINIT) ?
1365− false : bfa_ioc_fwver_valid(ioc);
1370+ false : bfa_ioc_fwver_valid(ioc, boot_env);
13661371
13671372 if (!fwvalid) {
1368− bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, ioc->pcidev.device_id);
1373+ bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, boot_env);
13691374 return;
13701375 }
13711376
@@ -1396,7 +1401,7 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force) · 24 unmodified lines
13961401 /**
13971402 * Initialize the h/w for any other states.
13981403 */
1399− bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, ioc->pcidev.device_id);
1404+ bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, boot_env);
14001405 }
14011406
14021407 void
@@ -1506,7 +1511,7 @@ bfa_ioc_hb_stop(struct bfa_ioc *ioc) · 103 unmodified lines
15061511 */
15071512 static void
15081513 bfa_ioc_download_fw(struct bfa_ioc *ioc, u32 boot_type,
1509− u32 boot_param)
1514+ u32 boot_env)
15101515 {
15111516 u32 *fwimg;
15121517 u32 pgnum, pgoff;
@@ -1558,10 +1563,10 @@ bfa_ioc_download_fw(struct bfa_ioc *ioc, u32 boot_type, · 45 unmodified lines
15581563 /*
15591564 * Set boot type and boot param at the end.
15601565 */
1561− writel((swab32(swab32(boot_type))), ((ioc->ioc_regs.smem_page_start)
1566+ writel(boot_type, ((ioc->ioc_regs.smem_page_start)
15621567 + (BFI_BOOT_TYPE_OFF)));
1563− writel((swab32(swab32(boot_param))), ((ioc->ioc_regs.smem_page_start)
1564− + (BFI_BOOT_PARAM_OFF)));
1568+ writel(boot_env, ((ioc->ioc_regs.smem_page_start)
1569+ + (BFI_BOOT_LOADER_OFF)));
15651570 }
15661571
15671572 static void
@@ -1721,7 +1726,7 @@ bfa_ioc_pll_init(struct bfa_ioc *ioc) · 153 unmodified lines
17211726 * as the entry vector.
17221727 */
17231728 static void
1724−bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param)
1729+bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_env)
17251730 {
17261731 void __iomem *rb;
17271732
@@ -1734,7 +1739,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param) · 6 unmodified lines
17341739 * Initialize IOC state of all functions on a chip reset.
17351740 */
17361741 rb = ioc->pcidev.pci_bar_kva;
1737− if (boot_param == BFI_BOOT_TYPE_MEMTEST) {
1742+ if (boot_type == BFI_BOOT_TYPE_MEMTEST) {
17381743 writel(BFI_IOC_MEMTEST, (rb + BFA_IOC0_STATE_REG));
17391744 writel(BFI_IOC_MEMTEST, (rb + BFA_IOC1_STATE_REG));
17401745 } else {
@@ -1743,7 +1748,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param) · 2 unmodified lines
17431748 }
17441749
17451750 bfa_ioc_msgflush(ioc);
1746− bfa_ioc_download_fw(ioc, boot_type, boot_param);
1751+ bfa_ioc_download_fw(ioc, boot_type, boot_env);
17471752
17481753 /**
17491754 * Enable interrupts just before starting LPU
drivers/net/bna/bfa_ioc.h+1−0
@@ -194,6 +194,7 @@ struct bfa_ioc_hwif { · 193 unmodified lines
194194 bool msix);
195195 void (*ioc_notify_fail) (struct bfa_ioc *ioc);
196196 void (*ioc_ownership_reset) (struct bfa_ioc *ioc);
197+ bool (*ioc_sync_start) (struct bfa_ioc *ioc);
197198 void (*ioc_sync_join) (struct bfa_ioc *ioc);
198199 void (*ioc_sync_leave) (struct bfa_ioc *ioc);
199200 void (*ioc_sync_ack) (struct bfa_ioc *ioc);
drivers/net/bna/bfa_ioc_ct.c+28−0
@@ -41,6 +41,7 @@ static void bfa_ioc_ct_map_port(struct bfa_ioc *ioc); · 40 unmodified lines
4141 static void bfa_ioc_ct_isr_mode_set(struct bfa_ioc *ioc, bool msix);
4242 static void bfa_ioc_ct_notify_fail(struct bfa_ioc *ioc);
4343 static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc);
44+static bool bfa_ioc_ct_sync_start(struct bfa_ioc *ioc);
4445 static void bfa_ioc_ct_sync_join(struct bfa_ioc *ioc);
4546 static void bfa_ioc_ct_sync_leave(struct bfa_ioc *ioc);
4647 static void bfa_ioc_ct_sync_ack(struct bfa_ioc *ioc);
@@ -63,6 +64,7 @@ bfa_nw_ioc_set_ct_hwif(struct bfa_ioc *ioc) · 16 unmodified lines
6364 nw_hwif_ct.ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set;
6465 nw_hwif_ct.ioc_notify_fail = bfa_ioc_ct_notify_fail;
6566 nw_hwif_ct.ioc_ownership_reset = bfa_ioc_ct_ownership_reset;
67+ nw_hwif_ct.ioc_sync_start = bfa_ioc_ct_sync_start;
6668 nw_hwif_ct.ioc_sync_join = bfa_ioc_ct_sync_join;
6769 nw_hwif_ct.ioc_sync_leave = bfa_ioc_ct_sync_leave;
6870 nw_hwif_ct.ioc_sync_ack = bfa_ioc_ct_sync_ack;
@@ -342,6 +344,32 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc) · 273 unmodified lines
342344 bfa_nw_ioc_hw_sem_release(ioc);
343345 }
344346
347+/**
348+ * Synchronized IOC failure processing routines
349+ */
350+static bool
351+bfa_ioc_ct_sync_start(struct bfa_ioc *ioc)
352+{
353+ u32 r32 = readl(ioc->ioc_regs.ioc_fail_sync);
354+ u32 sync_reqd = bfa_ioc_ct_get_sync_reqd(r32);
355+
356+ /*
357+ * Driver load time. If the sync required bit for this PCI fn
358+ * is set, it is due to an unclean exit by the driver for this
359+ * PCI fn in the previous incarnation. Whoever comes here first
360+ * should clean it up, no matter which PCI fn.
361+ */
362+
363+ if (sync_reqd & bfa_ioc_ct_sync_pos(ioc)) {
364+ writel(0, ioc->ioc_regs.ioc_fail_sync);
365+ writel(1, ioc->ioc_regs.ioc_usage_reg);
366+ writel(BFI_IOC_UNINIT, ioc->ioc_regs.ioc_fwstate);
367+ writel(BFI_IOC_UNINIT, ioc->ioc_regs.alt_ioc_fwstate);
368+ return true;
369+ }
370+
371+ return bfa_ioc_ct_sync_complete(ioc);
372+}
345373 /**
346374 * Synchronized IOC failure processing routines
347375 */
drivers/net/bna/bfi.h+4−2
@@ -184,12 +184,14 @@ enum bfi_mclass { · 183 unmodified lines
184184 #define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */
185185
186186 #define BFI_BOOT_TYPE_OFF 8
187−#define BFI_BOOT_PARAM_OFF 12
187+#define BFI_BOOT_LOADER_OFF 12
188188
189−#define BFI_BOOT_TYPE_NORMAL 0 /* param is device id */
189+#define BFI_BOOT_TYPE_NORMAL 0
190190 #define BFI_BOOT_TYPE_FLASH 1
191191 #define BFI_BOOT_TYPE_MEMTEST 2
192192
193+#define BFI_BOOT_LOADER_OS 0
194+
193195 #define BFI_BOOT_MEMTEST_RES_ADDR 0x900
194196 #define BFI_BOOT_MEMTEST_RES_SIG 0xA0A1A2A3
195197
drivers/net/bna/bnad.c+0−1
@@ -1837,7 +1837,6 @@ bnad_setup_rx(struct bnad *bnad, uint rx_id) · 1836 unmodified lines
18371837 /* Initialize the Rx event handlers */
18381838 rx_cbfn.rcb_setup_cbfn = bnad_cb_rcb_setup;
18391839 rx_cbfn.rcb_destroy_cbfn = bnad_cb_rcb_destroy;
1840− rx_cbfn.rcb_destroy_cbfn = NULL;
18411840 rx_cbfn.ccb_setup_cbfn = bnad_cb_ccb_setup;
18421841 rx_cbfn.ccb_destroy_cbfn = bnad_cb_ccb_destroy;
18431842 rx_cbfn.rx_cleanup_cbfn = bnad_cb_rx_cleanup;
drivers/net/bnx2.c+2−0
@@ -8413,6 +8413,8 @@ bnx2_remove_one(struct pci_dev *pdev) · 8412 unmodified lines
84138413
84148414 unregister_netdev(dev);
84158415
8416+ del_timer_sync(&bp->timer);
8417+
84168418 if (bp->mips_firmware)
84178419 release_firmware(bp->mips_firmware);
84188420 if (bp->rv2p_firmware)
drivers/net/bnx2x/bnx2x_cmn.c+24−10
@@ -2019,15 +2019,23 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb, · 2018 unmodified lines
20192019 static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb,
20202020 u32 *parsing_data, u32 xmit_type)
20212021 {
2022− *parsing_data |= ((tcp_hdrlen(skb)/4) <<
2023− ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) &
2024− ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW;
2022+ *parsing_data |=
2023+ ((((u8 *)skb_transport_header(skb) - skb->data) >> 1) <<
2024+ ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) &
2025+ ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W;
20252026
2026− *parsing_data |= ((((u8 *)tcp_hdr(skb) - skb->data) / 2) <<
2027− ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) &
2028− ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W;
2027+ if (xmit_type & XMIT_CSUM_TCP) {
2028+ *parsing_data |= ((tcp_hdrlen(skb) / 4) <<
2029+ ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) &
2030+ ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW;
20292031
2030− return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data;
2032+ return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data;
2033+ } else
2034+ /* We support checksum offload for TCP and UDP only.
2035+ * No need to pass the UDP header length - it's a constant.
2036+ */
2037+ return skb_transport_header(skb) +
2038+ sizeof(struct udphdr) - skb->data;
20312039 }
20322040
20332041 /**
@@ -2043,7 +2051,7 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb, · 9 unmodified lines
20432051 struct eth_tx_parse_bd_e1x *pbd,
20442052 u32 xmit_type)
20452053 {
2046− u8 hlen = (skb_network_header(skb) - skb->data) / 2;
2054+ u8 hlen = (skb_network_header(skb) - skb->data) >> 1;
20472055
20482056 /* for now NS flag is not used in Linux */
20492057 pbd->global_data =
@@ -2051,9 +2059,15 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb, · 1 unmodified line
20512059 ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT));
20522060
20532061 pbd->ip_hlen_w = (skb_transport_header(skb) -
2054− skb_network_header(skb)) / 2;
2062+ skb_network_header(skb)) >> 1;
20552063
2056− hlen += pbd->ip_hlen_w + tcp_hdrlen(skb) / 2;
2064+ hlen += pbd->ip_hlen_w;
2065+
2066+ /* We support checksum offload for TCP and UDP only */
2067+ if (xmit_type & XMIT_CSUM_TCP)
2068+ hlen += tcp_hdrlen(skb) / 2;
2069+ else
2070+ hlen += sizeof(struct udphdr) / 2;
20572071
20582072 pbd->total_hlen_w = cpu_to_le16(hlen);
20592073 hlen = hlen*2;
drivers/net/bnx2x/bnx2x_ethtool.c+4−5
@@ -2114,19 +2114,18 @@ static int bnx2x_phys_id(struct net_device *dev, u32 data) · 2113 unmodified lines
21142114 for (i = 0; i < (data * 2); i++) {
21152115 if ((i % 2) == 0)
21162116 bnx2x_set_led(&bp->link_params, &bp->link_vars,
2117− LED_MODE_OPER, SPEED_1000);
2117+ LED_MODE_ON, SPEED_1000);
21182118 else
21192119 bnx2x_set_led(&bp->link_params, &bp->link_vars,
2120− LED_MODE_OFF, 0);
2120+ LED_MODE_FRONT_PANEL_OFF, 0);
21212121
21222122 msleep_interruptible(500);
21232123 if (signal_pending(current))
21242124 break;
21252125 }
21262126
2127− if (bp->link_vars.link_up)
2128− bnx2x_set_led(&bp->link_params, &bp->link_vars, LED_MODE_OPER,
2129− bp->link_vars.line_speed);
2127+ bnx2x_set_led(&bp->link_params, &bp->link_vars,
2128+ LED_MODE_OPER, bp->link_vars.line_speed);
21302129
21312130 return 0;
21322131 }
drivers/net/bonding/bond_3ad.c+5−2
@@ -1482,8 +1482,11 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, · 1481 unmodified lines
14821482
14831483 static int agg_device_up(const struct aggregator *agg)
14841484 {
1485− return (netif_running(agg->slave->dev) &&
1486− netif_carrier_ok(agg->slave->dev));
1485+ struct port *port = agg->lag_ports;
1486+ if (!port)
1487+ return 0;
1488+ return (netif_running(port->slave->dev) &&
1489+ netif_carrier_ok(port->slave->dev));
14871490 }
14881491
14891492 /**
drivers/net/bonding/bond_3ad.h+5−5
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939
4040 typedef struct mac_addr {
4141 u8 mac_addr_value[ETH_ALEN];
42−} mac_addr_t;
42+} __packed mac_addr_t;
4343
4444 enum {
4545 BOND_AD_STABLE = 0,
@@ -134,12 +134,12 @@ typedef struct lacpdu { · 88 unmodified lines
134134 u8 tlv_type_terminator; // = terminator
135135 u8 terminator_length; // = 0
136136 u8 reserved_50[50]; // = 0
137−} lacpdu_t;
137+} __packed lacpdu_t;
138138
139139 typedef struct lacpdu_header {
140140 struct ethhdr hdr;
141141 struct lacpdu lacpdu;
142−} lacpdu_header_t;
142+} __packed lacpdu_header_t;
143143
144144 // Marker Protocol Data Unit(PDU) structure(43.5.3.2 in the 802.3ad standard)
145145 typedef struct bond_marker {
@@ -155,12 +155,12 @@ typedef struct bond_marker { · 9 unmodified lines
155155 u8 tlv_type_terminator; // = 0x00
156156 u8 terminator_length; // = 0x00
157157 u8 reserved_90[90]; // = 0
158−} bond_marker_t;
158+} __packed bond_marker_t;
159159
160160 typedef struct bond_marker_header {
161161 struct ethhdr hdr;
162162 struct bond_marker marker;
163−} bond_marker_header_t;
163+} __packed bond_marker_header_t;
164164
165165 #pragma pack()
166166
drivers/net/bonding/bond_alb.c+3−3
@@ -176,7 +176,7 @@ static int tlb_initialize(struct bonding *bond) · 175 unmodified lines
176176 bond_info->tx_hashtbl = new_hashtbl;
177177
178178 for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) {
179− tlb_init_table_entry(&bond_info->tx_hashtbl[i], 1);
179+ tlb_init_table_entry(&bond_info->tx_hashtbl[i], 0);
180180 }
181181
182182 _unlock_tx_hashtbl(bond);
@@ -701,7 +701,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) · 518 unmodified lines
701701 */
702702 rlb_choose_channel(skb, bond);
703703
704− /* The ARP relpy packets must be delayed so that
704+ /* The ARP reply packets must be delayed so that
705705 * they can cancel out the influence of the ARP request.
706706 */
707707 bond->alb_info.rlb_update_delay_counter = RLB_UPDATE_DELAY;
@@ -1042,7 +1042,7 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla · 334 unmodified lines
10421042 *
10431043 * If the permanent hw address of @slave is @bond's hw address, we need to
10441044 * find a different hw address to give @slave, that isn't in use by any other
1045− * slave in the bond. This address must be, of course, one of the premanent
1045+ * slave in the bond. This address must be, of course, one of the permanent
10461046 * addresses of the other slaves.
10471047 *
10481048 * We go over the slave list, and for each slave there we compare its
drivers/net/bonding/bond_alb.h+1−3
@@ -75,7 +75,7 @@ struct tlb_client_info { · 74 unmodified lines
7575 * gave this entry index.
7676 */
7777 u32 tx_bytes; /* Each Client accumulates the BytesTx that
78− * were tranmitted to it, and after each
78+ * were transmitted to it, and after each
7979 * CallBack the LoadHistory is divided
8080 * by the balance interval
8181 */
@@ -122,7 +122,6 @@ struct tlb_slave_info { · 40 unmodified lines
122122 };
123123
124124 struct alb_bond_info {
125− struct timer_list alb_timer;
126125 struct tlb_client_info *tx_hashtbl; /* Dynamically allocated */
127126 spinlock_t tx_hashtbl_lock;
128127 u32 unbalanced_load;
@@ -140,7 +139,6 @@ struct alb_bond_info { · 11 unmodified lines
140139 struct slave *next_rx_slave;/* next slave to be assigned
141140 * to a new rx client for
142141 */
143− u32 rlb_interval_counter;
144142 u8 primary_is_promisc; /* boolean */
145143 u32 rlb_promisc_timeout_counter;/* counts primary
146144 * promiscuity time
drivers/net/can/mscan/mpc5xxx_can.c+5−2
@@ -247,8 +247,10 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev, · 246 unmodified lines
247247 }
248248 #endif /* CONFIG_PPC_MPC512x */
249249
250+static struct of_device_id mpc5xxx_can_table[];
250251 static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
251252 {
253+ const struct of_device_id *match;
252254 struct mpc5xxx_can_data *data;
253255 struct device_node *np = ofdev->dev.of_node;
254256 struct net_device *dev;
@@ -258,9 +260,10 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev) · 3 unmodified lines
258260 int irq, mscan_clksrc = 0;
259261 int err = -ENOMEM;
260262
261− if (!ofdev->dev.of_match)
263+ match = of_match_device(mpc5xxx_can_table, &ofdev->dev);
264+ if (!match)
262265 return -EINVAL;
263− data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data;
266+ data = match->data;
264267
265268 base = of_iomap(np, 0);
266269 if (!base) {
drivers/net/can/sja1000/sja1000.c+1−1
@@ -346,10 +346,10 @@ static void sja1000_rx(struct net_device *dev) · 345 unmodified lines
346346 | (priv->read_reg(priv, REG_ID2) >> 5);
347347 }
348348
349+ cf->can_dlc = get_can_dlc(fi & 0x0F);
349350 if (fi & FI_RTR) {
350351 id |= CAN_RTR_FLAG;
351352 } else {
352− cf->can_dlc = get_can_dlc(fi & 0x0F);
353353 for (i = 0; i < cf->can_dlc; i++)
354354 cf->data[i] = priv->read_reg(priv, dreg++);
355355 }
drivers/net/can/slcan.c+3−1
@@ -583,7 +583,9 @@ static int slcan_open(struct tty_struct *tty) · 582 unmodified lines
583583 /* Done. We have linked the TTY line to a channel. */
584584 rtnl_unlock();
585585 tty->receive_room = 65536; /* We don't flow control */
586− return sl->dev->base_addr;
586+
587+ /* TTY layer expects 0 on success */
588+ return 0;
587589
588590 err_free_chan:
589591 sl->tty = NULL;
drivers/net/ehea/ehea_ethtool.c+13−8
@@ -55,15 +55,20 @@ static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 54 unmodified lines
5555 cmd->duplex = -1;
5656 }
5757
58− cmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_1000baseT_Full
59− | SUPPORTED_100baseT_Full | SUPPORTED_100baseT_Half
60− | SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Half
61− | SUPPORTED_Autoneg | SUPPORTED_FIBRE);
62−
63− cmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_Autoneg
64− | ADVERTISED_FIBRE);
58+ if (cmd->speed == SPEED_10000) {
59+ cmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
60+ cmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_FIBRE);
61+ cmd->port = PORT_FIBRE;
62+ } else {
63+ cmd->supported = (SUPPORTED_1000baseT_Full | SUPPORTED_100baseT_Full
64+ | SUPPORTED_100baseT_Half | SUPPORTED_10baseT_Full
65+ | SUPPORTED_10baseT_Half | SUPPORTED_Autoneg
66+ | SUPPORTED_TP);
67+ cmd->advertising = (ADVERTISED_1000baseT_Full | ADVERTISED_Autoneg
68+ | ADVERTISED_TP);
69+ cmd->port = PORT_TP;
70+ }
6571
66− cmd->port = PORT_FIBRE;
6772 cmd->autoneg = port->autoneg == 1 ? AUTONEG_ENABLE : AUTONEG_DISABLE;
6873
6974 return 0;
drivers/net/ehea/ehea_main.c+9−6
@@ -2688,9 +2688,6 @@ static int ehea_open(struct net_device *dev) · 2687 unmodified lines
26882688 netif_start_queue(dev);
26892689 }
26902690
2691− init_waitqueue_head(&port->swqe_avail_wq);
2692− init_waitqueue_head(&port->restart_wq);
2693−
26942691 mutex_unlock(&port->port_lock);
26952692
26962693 return ret;
@@ -3040,11 +3037,14 @@ static void ehea_rereg_mrs(void) · 343 unmodified lines
30403037
30413038 if (dev->flags & IFF_UP) {
30423039 mutex_lock(&port->port_lock);
3043− port_napi_enable(port);
30443040 ret = ehea_restart_qps(dev);
3045− check_sqs(port);
3046− if (!ret)
3041+ if (!ret) {
3042+ check_sqs(port);
3043+ port_napi_enable(port);
30473044 netif_wake_queue(dev);
3045+ } else {
3046+ netdev_err(dev, "Unable to restart QPS\n");
3047+ }
30483048 mutex_unlock(&port->port_lock);
30493049 }
30503050 }
@@ -3273,6 +3273,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, · 222 unmodified lines
32733273
32743274 INIT_WORK(&port->reset_task, ehea_reset_port);
32753275
3276+ init_waitqueue_head(&port->swqe_avail_wq);
3277+ init_waitqueue_head(&port->restart_wq);
3278+
32763279 ret = register_netdev(dev);
32773280 if (ret) {
32783281 pr_err("register_netdev failed. ret=%d\n", ret);
drivers/net/fs_enet/fs_enet-main.c+6−3
@@ -998,8 +998,10 @@ static const struct net_device_ops fs_enet_netdev_ops = { · 997 unmodified lines
998998 #endif
999999 };
10001000
1001+static struct of_device_id fs_enet_match[];
10011002 static int __devinit fs_enet_probe(struct platform_device *ofdev)
10021003 {
1004+ const struct of_device_id *match;
10031005 struct net_device *ndev;
10041006 struct fs_enet_private *fep;
10051007 struct fs_platform_info *fpi;
@@ -1007,14 +1009,15 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev) · 1 unmodified line
10071009 const u8 *mac_addr;
10081010 int privsize, len, ret = -ENODEV;
10091011
1010− if (!ofdev->dev.of_match)
1012+ match = of_match_device(fs_enet_match, &ofdev->dev);
1013+ if (!match)
10111014 return -EINVAL;
10121015
10131016 fpi = kzalloc(sizeof(*fpi), GFP_KERNEL);
10141017 if (!fpi)
10151018 return -ENOMEM;
10161019
1017− if (!IS_FEC(ofdev->dev.of_match)) {
1020+ if (!IS_FEC(match)) {
10181021 data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len);
10191022 if (!data || len != 4)
10201023 goto out_free_fpi;
@@ -1049,7 +1052,7 @@ static int __devinit fs_enet_probe(struct platform_device *ofdev) · 28 unmodified lines
10491052 fep->dev = &ofdev->dev;
10501053 fep->ndev = ndev;
10511054 fep->fpi = fpi;
1052− fep->ops = ofdev->dev.of_match->data;
1055+ fep->ops = match->data;
10531056
10541057 ret = fep->ops->setup_data(ndev);
10551058 if (ret)
drivers/net/fs_enet/mac-fec.c+4−4
@@ -226,8 +226,8 @@ static void set_multicast_finish(struct net_device *dev) · 225 unmodified lines
226226 }
227227
228228 FC(fecp, r_cntrl, FEC_RCNTRL_PROM);
229− FW(fecp, hash_table_high, fep->fec.hthi);
230− FW(fecp, hash_table_low, fep->fec.htlo);
229+ FW(fecp, grp_hash_table_high, fep->fec.hthi);
230+ FW(fecp, grp_hash_table_low, fep->fec.htlo);
231231 }
232232
233233 static void set_multicast_list(struct net_device *dev)
@@ -273,8 +273,8 @@ static void restart(struct net_device *dev) · 39 unmodified lines
273273 /*
274274 * Reset all multicast.
275275 */
276− FW(fecp, hash_table_high, fep->fec.hthi);
277− FW(fecp, hash_table_low, fep->fec.htlo);
276+ FW(fecp, grp_hash_table_high, fep->fec.hthi);
277+ FW(fecp, grp_hash_table_low, fep->fec.htlo);
278278
279279 /*
280280 * Set maximum receive buffer size.
drivers/net/fs_enet/mii-fec.c+5−2
@@ -101,17 +101,20 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus) · 100 unmodified lines
101101 return 0;
102102 }
103103
104+static struct of_device_id fs_enet_mdio_fec_match[];
104105 static int __devinit fs_enet_mdio_probe(struct platform_device *ofdev)
105106 {
107+ const struct of_device_id *match;
106108 struct resource res;
107109 struct mii_bus *new_bus;
108110 struct fec_info *fec;
109111 int (*get_bus_freq)(struct device_node *);
110112 int ret = -ENOMEM, clock, speed;
111113
112− if (!ofdev->dev.of_match)
114+ match = of_match_device(fs_enet_mdio_fec_match, &ofdev->dev);
115+ if (!match)
113116 return -EINVAL;
114− get_bus_freq = ofdev->dev.of_match->data;
117+ get_bus_freq = match->data;
115118
116119 new_bus = mdiobus_alloc();
117120 if (!new_bus)
drivers/net/ftmac100.c+4−4
@@ -139,11 +139,11 @@ static int ftmac100_reset(struct ftmac100 *priv) · 138 unmodified lines
139139 * that hardware reset completed (what the f*ck).
140140 * We still need to wait for a while.
141141 */
142− usleep_range(500, 1000);
142+ udelay(500);
143143 return 0;
144144 }
145145
146− usleep_range(1000, 10000);
146+ udelay(1000);
147147 }
148148
149149 netdev_err(netdev, "software reset failed\n");
@@ -772,7 +772,7 @@ static int ftmac100_mdio_read(struct net_device *netdev, int phy_id, int reg) · 622 unmodified lines
772772 if ((phycr & FTMAC100_PHYCR_MIIRD) == 0)
773773 return phycr & FTMAC100_PHYCR_MIIRDATA;
774774
775− usleep_range(100, 1000);
775+ udelay(100);
776776 }
777777
778778 netdev_err(netdev, "mdio read timed out\n");
@@ -801,7 +801,7 @@ static void ftmac100_mdio_write(struct net_device *netdev, int phy_id, int reg, · 22 unmodified lines
801801 if ((phycr & FTMAC100_PHYCR_MIIWR) == 0)
802802 return;
803803
804− usleep_range(100, 1000);
804+ udelay(100);
805805 }
806806
807807 netdev_err(netdev, "mdio write timed out\n");
drivers/net/hydra.c+7−7
@@ -98,15 +98,15 @@ static const struct net_device_ops hydra_netdev_ops = { · 97 unmodified lines
9898 .ndo_open = hydra_open,
9999 .ndo_stop = hydra_close,
100100
101− .ndo_start_xmit = ei_start_xmit,
102− .ndo_tx_timeout = ei_tx_timeout,
103− .ndo_get_stats = ei_get_stats,
104− .ndo_set_multicast_list = ei_set_multicast_list,
101+ .ndo_start_xmit = __ei_start_xmit,
102+ .ndo_tx_timeout = __ei_tx_timeout,
103+ .ndo_get_stats = __ei_get_stats,
104+ .ndo_set_multicast_list = __ei_set_multicast_list,
105105 .ndo_validate_addr = eth_validate_addr,
106− .ndo_set_mac_address = eth_mac_addr,
106+ .ndo_set_mac_address = eth_mac_addr,
107107 .ndo_change_mtu = eth_change_mtu,
108108 #ifdef CONFIG_NET_POLL_CONTROLLER
109− .ndo_poll_controller = ei_poll,
109+ .ndo_poll_controller = __ei_poll,
110110 #endif
111111 };
112112
@@ -125,7 +125,7 @@ static int __devinit hydra_init(struct zorro_dev *z) · 12 unmodified lines
125125 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
126126 };
127127
128− dev = alloc_ei_netdev();
128+ dev = ____alloc_ei_netdev(0);
129129 if (!dev)
130130 return -ENOMEM;
131131
drivers/net/loopback.c+2−1
@@ -173,7 +173,8 @@ static void loopback_setup(struct net_device *dev) · 172 unmodified lines
173173 | NETIF_F_RXCSUM
174174 | NETIF_F_HIGHDMA
175175 | NETIF_F_LLTX
176− | NETIF_F_NETNS_LOCAL;
176+ | NETIF_F_NETNS_LOCAL
177+ | NETIF_F_VLAN_CHALLENGED;
177178 dev->ethtool_ops = &loopback_ethtool_ops;
178179 dev->header_ops = &eth_header_ops;
179180 dev->netdev_ops = &loopback_ops;
drivers/net/mii.c+4−0
@@ -49,6 +49,10 @@ static u32 mii_get_an(struct mii_if_info *mii, u16 addr) · 48 unmodified lines
4949 result |= ADVERTISED_100baseT_Half;
5050 if (advert & ADVERTISE_100FULL)
5151 result |= ADVERTISED_100baseT_Full;
52+ if (advert & ADVERTISE_PAUSE_CAP)
53+ result |= ADVERTISED_Pause;
54+ if (advert & ADVERTISE_PAUSE_ASYM)
55+ result |= ADVERTISED_Asym_Pause;
5256
5357 return result;
5458 }
drivers/net/natsemi.c+3−0
@@ -860,6 +860,9 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev, · 859 unmodified lines
860860 prev_eedata = eedata;
861861 }
862862
863+ /* Store MAC Address in perm_addr */
864+ memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
865+
863866 dev->base_addr = (unsigned long __force) ioaddr;
864867 dev->irq = irq;
865868
drivers/net/ne-h8300.c+8−8
@@ -167,7 +167,7 @@ static void cleanup_card(struct net_device *dev) · 166 unmodified lines
167167 #ifndef MODULE
168168 struct net_device * __init ne_probe(int unit)
169169 {
170− struct net_device *dev = alloc_ei_netdev();
170+ struct net_device *dev = ____alloc_ei_netdev(0);
171171 int err;
172172
173173 if (!dev)
@@ -197,15 +197,15 @@ static const struct net_device_ops ne_netdev_ops = { · 23 unmodified lines
197197 .ndo_open = ne_open,
198198 .ndo_stop = ne_close,
199199
200− .ndo_start_xmit = ei_start_xmit,
201− .ndo_tx_timeout = ei_tx_timeout,
202− .ndo_get_stats = ei_get_stats,
203− .ndo_set_multicast_list = ei_set_multicast_list,
200+ .ndo_start_xmit = __ei_start_xmit,
201+ .ndo_tx_timeout = __ei_tx_timeout,
202+ .ndo_get_stats = __ei_get_stats,
203+ .ndo_set_multicast_list = __ei_set_multicast_list,
204204 .ndo_validate_addr = eth_validate_addr,
205− .ndo_set_mac_address = eth_mac_addr,
205+ .ndo_set_mac_address = eth_mac_addr,
206206 .ndo_change_mtu = eth_change_mtu,
207207 #ifdef CONFIG_NET_POLL_CONTROLLER
208− .ndo_poll_controller = ei_poll,
208+ .ndo_poll_controller = __ei_poll,
209209 #endif
210210 };
211211
@@ -637,7 +637,7 @@ int init_module(void) · 425 unmodified lines
637637 int err;
638638
639639 for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
640− struct net_device *dev = alloc_ei_netdev();
640+ struct net_device *dev = ____alloc_ei_netdev(0);
641641 if (!dev)
642642 break;
643643 if (io[this_dev]) {
drivers/net/netconsole.c+8−0
@@ -671,6 +671,7 @@ static int netconsole_netdev_event(struct notifier_block *this, · 670 unmodified lines
671671 goto done;
672672
673673 spin_lock_irqsave(&target_list_lock, flags);
674+restart:
674675 list_for_each_entry(nt, &target_list, list) {
675676 netconsole_target_get(nt);
676677 if (nt->np.dev == dev) {
@@ -683,9 +684,16 @@ static int netconsole_netdev_event(struct notifier_block *this, · 6 unmodified lines
683684 * rtnl_lock already held
684685 */
685686 if (nt->np.dev) {
687+ spin_unlock_irqrestore(
688+ &target_list_lock,
689+ flags);
686690 __netpoll_cleanup(&nt->np);
691+ spin_lock_irqsave(&target_list_lock,
692+ flags);
687693 dev_put(nt->np.dev);
688694 nt->np.dev = NULL;
695+ netconsole_target_put(nt);
696+ goto restart;
689697 }
690698 /* Fall through */
691699 case NETDEV_GOING_DOWN:
drivers/net/netxen/netxen_nic.h+2−2
@@ -174,7 +174,7 @@ · 173 unmodified lines
174174
175175 #define MAX_NUM_CARDS 4
176176
177−#define MAX_BUFFERS_PER_CMD 32
177+#define NETXEN_MAX_FRAGS_PER_TX 14
178178 #define MAX_TSO_HEADER_DESC 2
179179 #define MGMT_CMD_DESC_RESV 4
180180 #define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \
@@ -558,7 +558,7 @@ struct netxen_recv_crb { · 377 unmodified lines
558558 */
559559 struct netxen_cmd_buffer {
560560 struct sk_buff *skb;
561− struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1];
561+ struct netxen_skb_frag frag_array[MAX_SKB_FRAGS + 1];
562562 u32 frag_count;
563563 };
564564
drivers/net/netxen/netxen_nic_main.c+17−0
@@ -1844,6 +1844,8 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · 1843 unmodified lines
18441844 struct cmd_desc_type0 *hwdesc, *first_desc;
18451845 struct pci_dev *pdev;
18461846 int i, k;
1847+ int delta = 0;
1848+ struct skb_frag_struct *frag;
18471849
18481850 u32 producer;
18491851 int frag_count, no_of_desc;
@@ -1851,6 +1853,21 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · 1 unmodified line
18511853
18521854 frag_count = skb_shinfo(skb)->nr_frags + 1;
18531855
1856+ /* 14 frags supported for normal packet and
1857+ * 32 frags supported for TSO packet
1858+ */
1859+ if (!skb_is_gso(skb) && frag_count > NETXEN_MAX_FRAGS_PER_TX) {
1860+
1861+ for (i = 0; i < (frag_count - NETXEN_MAX_FRAGS_PER_TX); i++) {
1862+ frag = &skb_shinfo(skb)->frags[i];
1863+ delta += frag->size;
1864+ }
1865+
1866+ if (!__pskb_pull_tail(skb, delta))
1867+ goto drop_packet;
1868+
1869+ frag_count = 1 + skb_shinfo(skb)->nr_frags;
1870+ }
18541871 /* 4 fragments per cmd des */
18551872 no_of_desc = (frag_count + 3) >> 2;
18561873
drivers/net/pch_gbe/pch_gbe_main.c+16−7
@@ -34,6 +34,10 @@ const char pch_driver_version[] = DRV_VERSION; · 33 unmodified lines
3434 #define PCH_GBE_COPYBREAK_DEFAULT 256
3535 #define PCH_GBE_PCI_BAR 1
3636
37+/* Macros for ML7223 */
38+#define PCI_VENDOR_ID_ROHM 0x10db
39+#define PCI_DEVICE_ID_ROHM_ML7223_GBE 0x8013
40+
3741 #define PCH_GBE_TX_WEIGHT 64
3842 #define PCH_GBE_RX_WEIGHT 64
3943 #define PCH_GBE_RX_BUFFER_WRITE 16
@@ -43,8 +47,7 @@ const char pch_driver_version[] = DRV_VERSION; · 3 unmodified lines
4347
4448 #define PCH_GBE_MAC_RGMII_CTRL_SETTING ( \
4549 PCH_GBE_CHIP_TYPE_INTERNAL | \
46− PCH_GBE_RGMII_MODE_RGMII | \
47− PCH_GBE_CRS_SEL \
50+ PCH_GBE_RGMII_MODE_RGMII \
4851 )
4952
5053 /* Ethertype field values */
@@ -1494,12 +1497,11 @@ pch_gbe_clean_rx(struct pch_gbe_adapter *adapter, · 1443 unmodified lines
14941497 /* Write meta date of skb */
14951498 skb_put(skb, length);
14961499 skb->protocol = eth_type_trans(skb, netdev);
1497− if ((tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK) ==
1498− PCH_GBE_RXD_ACC_STAT_TCPIPOK) {
1499− skb->ip_summed = CHECKSUM_UNNECESSARY;
1500− } else {
1500+ if (tcp_ip_status & PCH_GBE_RXD_ACC_STAT_TCPIPOK)
15011501 skb->ip_summed = CHECKSUM_NONE;
1502− }
1502+ else
1503+ skb->ip_summed = CHECKSUM_UNNECESSARY;
1504+
15031505 napi_gro_receive(&adapter->napi, skb);
15041506 (*work_done)++;
15051507 pr_debug("Receive skb->ip_summed: %d length: %d\n",
@@ -2420,6 +2422,13 @@ static DEFINE_PCI_DEVICE_TABLE(pch_gbe_pcidev_id) = { · 914 unmodified lines
24202422 .class = (PCI_CLASS_NETWORK_ETHERNET << 8),
24212423 .class_mask = (0xFFFF00)
24222424 },
2425+ {.vendor = PCI_VENDOR_ID_ROHM,
2426+ .device = PCI_DEVICE_ID_ROHM_ML7223_GBE,
2427+ .subvendor = PCI_ANY_ID,
2428+ .subdevice = PCI_ANY_ID,
2429+ .class = (PCI_CLASS_NETWORK_ETHERNET << 8),
2430+ .class_mask = (0xFFFF00)
2431+ },
24232432 /* required last entry */
24242433 {0}
24252434 };
drivers/net/qlcnic/qlcnic.h+1−0
@@ -99,6 +99,7 @@ · 98 unmodified lines
9999 #define TX_UDPV6_PKT 0x0c
100100
101101 /* Tx defines */
102+#define QLCNIC_MAX_FRAGS_PER_TX 14
102103 #define MAX_TSO_HEADER_DESC 2
103104 #define MGMT_CMD_DESC_RESV 4
104105 #define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \
drivers/net/qlcnic/qlcnic_main.c+14−0
@@ -2099,6 +2099,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · 2098 unmodified lines
20992099 struct cmd_desc_type0 *hwdesc, *first_desc;
21002100 struct pci_dev *pdev;
21012101 struct ethhdr *phdr;
2102+ int delta = 0;
21022103 int i, k;
21032104
21042105 u32 producer;
@@ -2118,6 +2119,19 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) · 13 unmodified lines
21182119 }
21192120
21202121 frag_count = skb_shinfo(skb)->nr_frags + 1;
2122+ /* 14 frags supported for normal packet and
2123+ * 32 frags supported for TSO packet
2124+ */
2125+ if (!skb_is_gso(skb) && frag_count > QLCNIC_MAX_FRAGS_PER_TX) {
2126+
2127+ for (i = 0; i < (frag_count - QLCNIC_MAX_FRAGS_PER_TX); i++)
2128+ delta += skb_shinfo(skb)->frags[i].size;
2129+
2130+ if (!__pskb_pull_tail(skb, delta))
2131+ goto drop_packet;
2132+
2133+ frag_count = 1 + skb_shinfo(skb)->nr_frags;
2134+ }
21212135
21222136 /* 4 fragments per cmd des */
21232137 no_of_desc = (frag_count + 3) >> 2;
drivers/net/r8169.c+71−28
@@ -170,6 +170,16 @@ static const struct { · 169 unmodified lines
170170 };
171171 #undef _R
172172
173+static const struct rtl_firmware_info {
174+ int mac_version;
175+ const char *fw_name;
176+} rtl_firmware_infos[] = {
177+ { .mac_version = RTL_GIGA_MAC_VER_25, .fw_name = FIRMWARE_8168D_1 },
178+ { .mac_version = RTL_GIGA_MAC_VER_26, .fw_name = FIRMWARE_8168D_2 },
179+ { .mac_version = RTL_GIGA_MAC_VER_29, .fw_name = FIRMWARE_8105E_1 },
180+ { .mac_version = RTL_GIGA_MAC_VER_30, .fw_name = FIRMWARE_8105E_1 }
181+};
182+
173183 enum cfg_version {
174184 RTL_CFG_0 = 0x00,
175185 RTL_CFG_1,
@@ -565,6 +575,7 @@ struct rtl8169_private { · 389 unmodified lines
565575 u32 saved_wolopts;
566576
567577 const struct firmware *fw;
578+#define RTL_FIRMWARE_UNKNOWN ERR_PTR(-EAGAIN);
568579 };
569580
570581 MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
@@ -1789,25 +1800,26 @@ rtl_phy_write_fw(struct rtl8169_private *tp, const struct firmware *fw) · 1218 unmodified lines
17891800
17901801 static void rtl_release_firmware(struct rtl8169_private *tp)
17911802 {
1792− release_firmware(tp->fw);
1793− tp->fw = NULL;
1803+ if (!IS_ERR_OR_NULL(tp->fw))
1804+ release_firmware(tp->fw);
1805+ tp->fw = RTL_FIRMWARE_UNKNOWN;
17941806 }
17951807
1796−static int rtl_apply_firmware(struct rtl8169_private *tp, const char *fw_name)
1808+static void rtl_apply_firmware(struct rtl8169_private *tp)
17971809 {
1798− const struct firmware **fw = &tp->fw;
1799− int rc = !*fw;
1800−
1801− if (rc) {
1802− rc = request_firmware(fw, fw_name, &tp->pci_dev->dev);
1803− if (rc < 0)
1804− goto out;
1805− }
1810+ const struct firmware *fw = tp->fw;
18061811
18071812 /* TODO: release firmware once rtl_phy_write_fw signals failures. */
1808− rtl_phy_write_fw(tp, *fw);
1809−out:
1810− return rc;
1813+ if (!IS_ERR_OR_NULL(fw))
1814+ rtl_phy_write_fw(tp, fw);
1815+}
1816+
1817+static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
1818+{
1819+ if (rtl_readphy(tp, reg) != val)
1820+ netif_warn(tp, hw, tp->dev, "chipset not ready for firmware\n");
1821+ else
1822+ rtl_apply_firmware(tp);
18111823 }
18121824
18131825 static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
@@ -2246,10 +2258,8 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp) · 432 unmodified lines
22462258
22472259 rtl_writephy(tp, 0x1f, 0x0005);
22482260 rtl_writephy(tp, 0x05, 0x001b);
2249− if ((rtl_readphy(tp, 0x06) != 0xbf00) ||
2250− (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) {
2251− netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
2252− }
2261+
2262+ rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xbf00);
22532263
22542264 rtl_writephy(tp, 0x1f, 0x0000);
22552265 }
@@ -2351,10 +2361,8 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp) · 95 unmodified lines
23512361
23522362 rtl_writephy(tp, 0x1f, 0x0005);
23532363 rtl_writephy(tp, 0x05, 0x001b);
2354− if ((rtl_readphy(tp, 0x06) != 0xb300) ||
2355− (rtl_apply_firmware(tp, FIRMWARE_8168D_2) < 0)) {
2356− netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
2357− }
2364+
2365+ rtl_apply_firmware_cond(tp, MII_EXPANSION, 0xb300);
23582366
23592367 rtl_writephy(tp, 0x1f, 0x0000);
23602368 }
@@ -2474,8 +2482,7 @@ static void rtl8105e_hw_phy_config(struct rtl8169_private *tp) · 113 unmodified lines
24742482 rtl_writephy(tp, 0x18, 0x0310);
24752483 msleep(100);
24762484
2477− if (rtl_apply_firmware(tp, FIRMWARE_8105E_1) < 0)
2478− netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
2485+ rtl_apply_firmware(tp);
24792486
24802487 rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
24812488 }
@@ -3237,6 +3244,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 755 unmodified lines
32373244 tp->timer.data = (unsigned long) dev;
32383245 tp->timer.function = rtl8169_phy_timer;
32393246
3247+ tp->fw = RTL_FIRMWARE_UNKNOWN;
3248+
32403249 rc = register_netdev(dev);
32413250 if (rc < 0)
32423251 goto err_out_msi_4;
@@ -3288,10 +3297,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) · 45 unmodified lines
32883297
32893298 cancel_delayed_work_sync(&tp->task);
32903299
3291− rtl_release_firmware(tp);
3292−
32933300 unregister_netdev(dev);
32943301
3302+ rtl_release_firmware(tp);
3303+
32953304 if (pci_dev_run_wake(pdev))
32963305 pm_runtime_get_noresume(&pdev->dev);
32973306
@@ -3303,6 +3312,37 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev) · 5 unmodified lines
33033312 pci_set_drvdata(pdev, NULL);
33043313 }
33053314
3315+static void rtl_request_firmware(struct rtl8169_private *tp)
3316+{
3317+ int i;
3318+
3319+ /* Return early if the firmware is already loaded / cached. */
3320+ if (!IS_ERR(tp->fw))
3321+ goto out;
3322+
3323+ for (i = 0; i < ARRAY_SIZE(rtl_firmware_infos); i++) {
3324+ const struct rtl_firmware_info *info = rtl_firmware_infos + i;
3325+
3326+ if (info->mac_version == tp->mac_version) {
3327+ const char *name = info->fw_name;
3328+ int rc;
3329+
3330+ rc = request_firmware(&tp->fw, name, &tp->pci_dev->dev);
3331+ if (rc < 0) {
3332+ netif_warn(tp, ifup, tp->dev, "unable to load "
3333+ "firmware patch %s (%d)\n", name, rc);
3334+ goto out_disable_request_firmware;
3335+ }
3336+ goto out;
3337+ }
3338+ }
3339+
3340+out_disable_request_firmware:
3341+ tp->fw = NULL;
3342+out:
3343+ return;
3344+}
3345+
33063346 static int rtl8169_open(struct net_device *dev)
33073347 {
33083348 struct rtl8169_private *tp = netdev_priv(dev);
@@ -3334,11 +3374,13 @@ static int rtl8169_open(struct net_device *dev) · 25 unmodified lines
33343374
33353375 smp_mb();
33363376
3377+ rtl_request_firmware(tp);
3378+
33373379 retval = request_irq(dev->irq, rtl8169_interrupt,
33383380 (tp->features & RTL_FEATURE_MSI) ? 0 : IRQF_SHARED,
33393381 dev->name, dev);
33403382 if (retval < 0)
3341− goto err_release_ring_2;
3383+ goto err_release_fw_2;
33423384
33433385 napi_enable(&tp->napi);
33443386
@@ -3359,7 +3401,8 @@ static int rtl8169_open(struct net_device *dev) · 14 unmodified lines
33593401 out:
33603402 return retval;
33613403
3362−err_release_ring_2:
3404+err_release_fw_2:
3405+ rtl_release_firmware(tp);
33633406 rtl8169_rx_clear(tp);
33643407 err_free_rx_1:
33653408 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
drivers/net/sfc/efx.c+4−2
@@ -328,7 +328,8 @@ static int efx_poll(struct napi_struct *napi, int budget) · 327 unmodified lines
328328 * processing to finish, then directly poll (and ack ) the eventq.
329329 * Finally reenable NAPI and interrupts.
330330 *
331− * Since we are touching interrupts the caller should hold the suspend lock
331+ * This is for use only during a loopback self-test. It must not
332+ * deliver any packets up the stack as this can result in deadlock.
332333 */
333334 void efx_process_channel_now(struct efx_channel *channel)
334335 {
@@ -336,6 +337,7 @@ void efx_process_channel_now(struct efx_channel *channel) · 1 unmodified line
336337
337338 BUG_ON(channel->channel >= efx->n_channels);
338339 BUG_ON(!channel->enabled);
340+ BUG_ON(!efx->loopback_selftest);
339341
340342 /* Disable interrupts and wait for ISRs to complete */
341343 efx_nic_disable_interrupts(efx);
@@ -1436,7 +1438,7 @@ static void efx_start_all(struct efx_nic *efx) · 1094 unmodified lines
14361438 * restart the transmit interface early so the watchdog timer stops */
14371439 efx_start_port(efx);
14381440
1439− if (efx_dev_registered(efx))
1441+ if (efx_dev_registered(efx) && !efx->port_inhibited)
14401442 netif_tx_wake_all_queues(efx->net_dev);
14411443
14421444 efx_for_each_channel(channel, efx)
drivers/net/sfc/io.h+2−0
@@ -152,6 +152,7 @@ static inline void efx_reado(struct efx_nic *efx, efx_oword_t *value, · 151 unmodified lines
152152
153153 spin_lock_irqsave(&efx->biu_lock, flags);
154154 value->u32[0] = _efx_readd(efx, reg + 0);
155+ rmb();
155156 value->u32[1] = _efx_readd(efx, reg + 4);
156157 value->u32[2] = _efx_readd(efx, reg + 8);
157158 value->u32[3] = _efx_readd(efx, reg + 12);
@@ -174,6 +175,7 @@ static inline void efx_sram_readq(struct efx_nic *efx, void __iomem *membase, · 16 unmodified lines
174175 value->u64[0] = (__force __le64)__raw_readq(membase + addr);
175176 #else
176177 value->u32[0] = (__force __le32)__raw_readl(membase + addr);
178+ rmb();
177179 value->u32[1] = (__force __le32)__raw_readl(membase + addr + 4);
178180 #endif
179181 spin_unlock_irqrestore(&efx->biu_lock, flags);
drivers/net/sfc/mcdi.c+30−19
@@ -50,6 +50,20 @@ static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx) · 49 unmodified lines
5050 return &nic_data->mcdi;
5151 }
5252
53+static inline void
54+efx_mcdi_readd(struct efx_nic *efx, efx_dword_t *value, unsigned reg)
55+{
56+ struct siena_nic_data *nic_data = efx->nic_data;
57+ value->u32[0] = (__force __le32)__raw_readl(nic_data->mcdi_smem + reg);
58+}
59+
60+static inline void
61+efx_mcdi_writed(struct efx_nic *efx, const efx_dword_t *value, unsigned reg)
62+{
63+ struct siena_nic_data *nic_data = efx->nic_data;
64+ __raw_writel((__force u32)value->u32[0], nic_data->mcdi_smem + reg);
65+}
66+
5367 void efx_mcdi_init(struct efx_nic *efx)
5468 {
5569 struct efx_mcdi_iface *mcdi;
@@ -70,8 +84,8 @@ static void efx_mcdi_copyin(struct efx_nic *efx, unsigned cmd, · 14 unmodified lines
7084 const u8 *inbuf, size_t inlen)
7185 {
7286 struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
73− unsigned pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx);
74− unsigned doorbell = FR_CZ_MC_TREG_SMEM + MCDI_DOORBELL(efx);
87+ unsigned pdu = MCDI_PDU(efx);
88+ unsigned doorbell = MCDI_DOORBELL(efx);
7589 unsigned int i;
7690 efx_dword_t hdr;
7791 u32 xflags, seqno;
@@ -92,30 +106,28 @@ static void efx_mcdi_copyin(struct efx_nic *efx, unsigned cmd, · 14 unmodified lines
92106 MCDI_HEADER_SEQ, seqno,
93107 MCDI_HEADER_XFLAGS, xflags);
94108
95− efx_writed(efx, &hdr, pdu);
109+ efx_mcdi_writed(efx, &hdr, pdu);
96110
97− for (i = 0; i < inlen; i += 4) {
98− _efx_writed(efx, *((__le32 *)(inbuf + i)), pdu + 4 + i);
99− /* use wmb() within loop to inhibit write combining */
100− wmb();
101− }
111+ for (i = 0; i < inlen; i += 4)
112+ efx_mcdi_writed(efx, (const efx_dword_t *)(inbuf + i),
113+ pdu + 4 + i);
102114
103115 /* ring the doorbell with a distinctive value */
104− _efx_writed(efx, (__force __le32) 0x45789abc, doorbell);
105− wmb();
116+ EFX_POPULATE_DWORD_1(hdr, EFX_DWORD_0, 0x45789abc);
117+ efx_mcdi_writed(efx, &hdr, doorbell);
106118 }
107119
108120 static void efx_mcdi_copyout(struct efx_nic *efx, u8 *outbuf, size_t outlen)
109121 {
110122 struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
111− unsigned int pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx);
123+ unsigned int pdu = MCDI_PDU(efx);
112124 int i;
113125
114126 BUG_ON(atomic_read(&mcdi->state) == MCDI_STATE_QUIESCENT);
115127 BUG_ON(outlen & 3 || outlen >= 0x100);
116128
117129 for (i = 0; i < outlen; i += 4)
118− *((__le32 *)(outbuf + i)) = _efx_readd(efx, pdu + 4 + i);
130+ efx_mcdi_readd(efx, (efx_dword_t *)(outbuf + i), pdu + 4 + i);
119131 }
120132
121133 static int efx_mcdi_poll(struct efx_nic *efx)
@@ -123,7 +135,7 @@ static int efx_mcdi_poll(struct efx_nic *efx) · 1 unmodified line
123135 struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
124136 unsigned int time, finish;
125137 unsigned int respseq, respcmd, error;
126− unsigned int pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx);
138+ unsigned int pdu = MCDI_PDU(efx);
127139 unsigned int rc, spins;
128140 efx_dword_t reg;
129141
@@ -149,8 +161,7 @@ static int efx_mcdi_poll(struct efx_nic *efx) · 19 unmodified lines
149161
150162 time = get_seconds();
151163
152− rmb();
153− efx_readd(efx, &reg, pdu);
164+ efx_mcdi_readd(efx, &reg, pdu);
154165
155166 /* All 1's indicates that shared memory is in reset (and is
156167 * not a valid header). Wait for it to come out reset before
@@ -177,7 +188,7 @@ static int efx_mcdi_poll(struct efx_nic *efx) · 20 unmodified lines
177188 respseq, mcdi->seqno);
178189 rc = EIO;
179190 } else if (error) {
180− efx_readd(efx, &reg, pdu + 4);
191+ efx_mcdi_readd(efx, &reg, pdu + 4);
181192 switch (EFX_DWORD_FIELD(reg, EFX_DWORD_0)) {
182193 #define TRANSLATE_ERROR(name) \
183194 case MC_CMD_ERR_ ## name: \
@@ -211,21 +222,21 @@ out: · 27 unmodified lines
211222 /* Test and clear MC-rebooted flag for this port/function */
212223 int efx_mcdi_poll_reboot(struct efx_nic *efx)
213224 {
214− unsigned int addr = FR_CZ_MC_TREG_SMEM + MCDI_REBOOT_FLAG(efx);
225+ unsigned int addr = MCDI_REBOOT_FLAG(efx);
215226 efx_dword_t reg;
216227 uint32_t value;
217228
218229 if (efx_nic_rev(efx) < EFX_REV_SIENA_A0)
219230 return false;
220231
221− efx_readd(efx, &reg, addr);
232+ efx_mcdi_readd(efx, &reg, addr);
222233 value = EFX_DWORD_FIELD(reg, EFX_DWORD_0);
223234
224235 if (value == 0)
225236 return 0;
226237
227238 EFX_ZERO_DWORD(reg);
228− efx_writed(efx, &reg, addr);
239+ efx_mcdi_writed(efx, &reg, addr);
229240
230241 if (value == MC_STATUS_DWORD_ASSERT)
231242 return -EINTR;
drivers/net/sfc/net_driver.h+0−2
@@ -330,7 +330,6 @@ enum efx_rx_alloc_method { · 329 unmodified lines
330330 * @eventq_mask: Event queue pointer mask
331331 * @eventq_read_ptr: Event queue read pointer
332332 * @last_eventq_read_ptr: Last event queue read pointer value.
333− * @magic_count: Event queue test event count
334333 * @irq_count: Number of IRQs since last adaptive moderation decision
335334 * @irq_mod_score: IRQ moderation score
336335 * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors
@@ -360,7 +359,6 @@ struct efx_channel { · 23 unmodified lines
360359 unsigned int eventq_mask;
361360 unsigned int eventq_read_ptr;
362361 unsigned int last_eventq_read_ptr;
363− unsigned int magic_count;
364362
365363 unsigned int irq_count;
366364 unsigned int irq_mod_score;
drivers/net/sfc/nic.c+22−7
@@ -84,7 +84,8 @@ static inline void efx_write_buf_tbl(struct efx_nic *efx, efx_qword_t *value, · 83 unmodified lines
8484 static inline efx_qword_t *efx_event(struct efx_channel *channel,
8585 unsigned int index)
8686 {
87− return ((efx_qword_t *) (channel->eventq.addr)) + index;
87+ return ((efx_qword_t *) (channel->eventq.addr)) +
88+ (index & channel->eventq_mask);
8889 }
8990
9091 /* See if an event is present
@@ -673,7 +674,8 @@ void efx_nic_eventq_read_ack(struct efx_channel *channel) · 582 unmodified lines
673674 efx_dword_t reg;
674675 struct efx_nic *efx = channel->efx;
675676
676− EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR, channel->eventq_read_ptr);
677+ EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR,
678+ channel->eventq_read_ptr & channel->eventq_mask);
677679 efx_writed_table(efx, &reg, efx->type->evq_rptr_tbl_base,
678680 channel->channel);
679681 }
@@ -908,7 +910,7 @@ efx_handle_generated_event(struct efx_channel *channel, efx_qword_t *event) · 228 unmodified lines
908910
909911 code = EFX_QWORD_FIELD(*event, FSF_AZ_DRV_GEN_EV_MAGIC);
910912 if (code == EFX_CHANNEL_MAGIC_TEST(channel))
911− ++channel->magic_count;
913+ ; /* ignore */
912914 else if (code == EFX_CHANNEL_MAGIC_FILL(channel))
913915 /* The queue must be empty, so we won't receive any rx
914916 * events, so efx_process_channel() won't refill the
@@ -1015,8 +1017,7 @@ int efx_nic_process_eventq(struct efx_channel *channel, int budget) · 100 unmodified lines
10151017 /* Clear this event by marking it all ones */
10161018 EFX_SET_QWORD(*p_event);
10171019
1018− /* Increment read pointer */
1019− read_ptr = (read_ptr + 1) & channel->eventq_mask;
1020+ ++read_ptr;
10201021
10211022 ev_code = EFX_QWORD_FIELD(event, FSF_AZ_EV_CODE);
10221023
@@ -1060,6 +1061,13 @@ out: · 37 unmodified lines
10601061 return spent;
10611062 }
10621063
1064+/* Check whether an event is present in the eventq at the current
1065+ * read pointer. Only useful for self-test.
1066+ */
1067+bool efx_nic_event_present(struct efx_channel *channel)
1068+{
1069+ return efx_event_present(efx_event(channel, channel->eventq_read_ptr));
1070+}
10631071
10641072 /* Allocate buffer table entries for event queue */
10651073 int efx_nic_probe_eventq(struct efx_channel *channel)
@@ -1165,7 +1173,7 @@ static void efx_poll_flush_events(struct efx_nic *efx) · 99 unmodified lines
11651173 struct efx_tx_queue *tx_queue;
11661174 struct efx_rx_queue *rx_queue;
11671175 unsigned int read_ptr = channel->eventq_read_ptr;
1168− unsigned int end_ptr = (read_ptr - 1) & channel->eventq_mask;
1176+ unsigned int end_ptr = read_ptr + channel->eventq_mask - 1;
11691177
11701178 do {
11711179 efx_qword_t *event = efx_event(channel, read_ptr);
@@ -1205,7 +1213,7 @@ static void efx_poll_flush_events(struct efx_nic *efx) · 33 unmodified lines
12051213 * it's ok to throw away every non-flush event */
12061214 EFX_SET_QWORD(*event);
12071215
1208− read_ptr = (read_ptr + 1) & channel->eventq_mask;
1216+ ++read_ptr;
12091217 } while (read_ptr != end_ptr);
12101218
12111219 channel->eventq_read_ptr = read_ptr;
@@ -1929,6 +1937,13 @@ void efx_nic_get_regs(struct efx_nic *efx, void *buf) · 717 unmodified lines
19291937
19301938 size = min_t(size_t, table->step, 16);
19311939
1940+ if (table->offset >= efx->type->mem_map_size) {
1941+ /* No longer mapped; return dummy data */
1942+ memcpy(buf, "\xde\xc0\xad\xde", 4);
1943+ buf += table->rows * size;
1944+ continue;
1945+ }
1946+
19321947 for (i = 0; i < table->rows; i++) {
19331948 switch (table->step) {
19341949 case 4: /* 32-bit register or SRAM */
drivers/net/sfc/nic.h+3−0
@@ -143,10 +143,12 @@ static inline struct falcon_board *falcon_board(struct efx_nic *efx) · 142 unmodified lines
143143 /**
144144 * struct siena_nic_data - Siena NIC state
145145 * @mcdi: Management-Controller-to-Driver Interface
146+ * @mcdi_smem: MCDI shared memory mapping. The mapping is always uncacheable.
146147 * @wol_filter_id: Wake-on-LAN packet filter id
147148 */
148149 struct siena_nic_data {
149150 struct efx_mcdi_iface mcdi;
151+ void __iomem *mcdi_smem;
150152 int wol_filter_id;
151153 };
152154
@@ -184,6 +186,7 @@ extern void efx_nic_fini_eventq(struct efx_channel *channel); · 31 unmodified lines
184186 extern void efx_nic_remove_eventq(struct efx_channel *channel);
185187 extern int efx_nic_process_eventq(struct efx_channel *channel, int rx_quota);
186188 extern void efx_nic_eventq_read_ack(struct efx_channel *channel);
189+extern bool efx_nic_event_present(struct efx_channel *channel);
187190
188191 /* MAC/PHY */
189192 extern void falcon_drain_tx_fifo(struct efx_nic *efx);
drivers/net/sfc/selftest.c+6−19
@@ -131,8 +131,6 @@ static int efx_test_chip(struct efx_nic *efx, struct efx_self_tests *tests) · 130 unmodified lines
131131 static int efx_test_interrupts(struct efx_nic *efx,
132132 struct efx_self_tests *tests)
133133 {
134− struct efx_channel *channel;
135−
136134 netif_dbg(efx, drv, efx->net_dev, "testing interrupts\n");
137135 tests->interrupt = -1;
138136
@@ -140,15 +138,6 @@ static int efx_test_interrupts(struct efx_nic *efx, · 1 unmodified line
140138 efx->last_irq_cpu = -1;
141139 smp_wmb();
142140
143− /* ACK each interrupting event queue. Receiving an interrupt due to
144− * traffic before a test event is raised is considered a pass */
145− efx_for_each_channel(channel, efx) {
146− if (channel->work_pending)
147− efx_process_channel_now(channel);
148− if (efx->last_irq_cpu >= 0)
149− goto success;
150− }
151−
152141 efx_nic_generate_interrupt(efx);
153142
154143 /* Wait for arrival of test interrupt. */
@@ -173,13 +162,13 @@ static int efx_test_eventq_irq(struct efx_channel *channel, · 18 unmodified lines
173162 struct efx_self_tests *tests)
174163 {
175164 struct efx_nic *efx = channel->efx;
176− unsigned int magic_count, count;
165+ unsigned int read_ptr, count;
177166
178167 tests->eventq_dma[channel->channel] = -1;
179168 tests->eventq_int[channel->channel] = -1;
180169 tests->eventq_poll[channel->channel] = -1;
181170
182− magic_count = channel->magic_count;
171+ read_ptr = channel->eventq_read_ptr;
183172 channel->efx->last_irq_cpu = -1;
184173 smp_wmb();
185174
@@ -190,10 +179,7 @@ static int efx_test_eventq_irq(struct efx_channel *channel, · 4 unmodified lines
190179 do {
191180 schedule_timeout_uninterruptible(HZ / 100);
192181
193− if (channel->work_pending)
194− efx_process_channel_now(channel);
195−
196− if (channel->magic_count != magic_count)
182+ if (ACCESS_ONCE(channel->eventq_read_ptr) != read_ptr)
197183 goto eventq_ok;
198184 } while (++count < 2);
199185
@@ -211,8 +197,7 @@ static int efx_test_eventq_irq(struct efx_channel *channel, · 11 unmodified lines
211197 }
212198
213199 /* Check to see if event was received even if interrupt wasn't */
214− efx_process_channel_now(channel);
215− if (channel->magic_count != magic_count) {
200+ if (efx_nic_event_present(channel)) {
216201 netif_err(efx, drv, efx->net_dev,
217202 "channel %d event was generated, but "
218203 "failed to trigger an interrupt\n", channel->channel);
@@ -770,6 +755,8 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, · 551 unmodified lines
770755 __efx_reconfigure_port(efx);
771756 mutex_unlock(&efx->mac_lock);
772757
758+ netif_tx_wake_all_queues(efx->net_dev);
759+
773760 return rc_test;
774761 }
775762
drivers/net/sfc/siena.c+21−4
@@ -220,12 +220,26 @@ static int siena_probe_nic(struct efx_nic *efx) · 219 unmodified lines
220220 efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
221221 efx->net_dev->dev_id = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
222222
223+ /* Initialise MCDI */
224+ nic_data->mcdi_smem = ioremap_nocache(efx->membase_phys +
225+ FR_CZ_MC_TREG_SMEM,
226+ FR_CZ_MC_TREG_SMEM_STEP *
227+ FR_CZ_MC_TREG_SMEM_ROWS);
228+ if (!nic_data->mcdi_smem) {
229+ netif_err(efx, probe, efx->net_dev,
230+ "could not map MCDI at %llx+%x\n",
231+ (unsigned long long)efx->membase_phys +
232+ FR_CZ_MC_TREG_SMEM,
233+ FR_CZ_MC_TREG_SMEM_STEP * FR_CZ_MC_TREG_SMEM_ROWS);
234+ rc = -ENOMEM;
235+ goto fail1;
236+ }
223237 efx_mcdi_init(efx);
224238
225239 /* Recover from a failed assertion before probing */
226240 rc = efx_mcdi_handle_assertion(efx);
227241 if (rc)
228− goto fail1;
242+ goto fail2;
229243
230244 /* Let the BMC know that the driver is now in charge of link and
231245 * filter settings. We must do this before we reset the NIC */
@@ -280,6 +294,7 @@ fail4: · 48 unmodified lines
280294 fail3:
281295 efx_mcdi_drv_attach(efx, false, NULL);
282296 fail2:
297+ iounmap(nic_data->mcdi_smem);
283298 fail1:
284299 kfree(efx->nic_data);
285300 return rc;
@@ -359,6 +374,8 @@ static int siena_init_nic(struct efx_nic *efx) · 73 unmodified lines
359374
360375 static void siena_remove_nic(struct efx_nic *efx)
361376 {
377+ struct siena_nic_data *nic_data = efx->nic_data;
378+
362379 efx_nic_free_buffer(efx, &efx->irq_status);
363380
364381 siena_reset_hw(efx, RESET_TYPE_ALL);
@@ -368,7 +385,8 @@ static void siena_remove_nic(struct efx_nic *efx) · 3 unmodified lines
368385 efx_mcdi_drv_attach(efx, false, NULL);
369386
370387 /* Tear down the private nic state */
371− kfree(efx->nic_data);
388+ iounmap(nic_data->mcdi_smem);
389+ kfree(nic_data);
372390 efx->nic_data = NULL;
373391 }
374392
@@ -606,8 +624,7 @@ struct efx_nic_type siena_a0_nic_type = { · 231 unmodified lines
606624 .default_mac_ops = &efx_mcdi_mac_operations,
607625
608626 .revision = EFX_REV_SIENA_A0,
609− .mem_map_size = (FR_CZ_MC_TREG_SMEM +
610− FR_CZ_MC_TREG_SMEM_STEP * FR_CZ_MC_TREG_SMEM_ROWS),
627+ .mem_map_size = FR_CZ_MC_TREG_SMEM, /* MC_TREG_SMEM mapped separately */
611628 .txd_ptr_tbl_base = FR_BZ_TX_DESC_PTR_TBL,
612629 .rxd_ptr_tbl_base = FR_BZ_RX_DESC_PTR_TBL,
613630 .buf_tbl_base = FR_BZ_BUF_FULL_TBL,
drivers/net/sfc/tx.c+2−1
@@ -435,7 +435,8 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index) · 434 unmodified lines
435435 * queue state. */
436436 smp_mb();
437437 if (unlikely(netif_tx_queue_stopped(tx_queue->core_txq)) &&
438− likely(efx->port_enabled)) {
438+ likely(efx->port_enabled) &&
439+ likely(!efx->port_inhibited)) {
439440 fill_level = tx_queue->insert_count - tx_queue->read_count;
440441 if (fill_level < EFX_TXQ_THRESHOLD(efx)) {
441442 EFX_BUG_ON_PARANOID(!efx_dev_registered(efx));
drivers/net/sis900.c+19−4
@@ -240,7 +240,8 @@ static const struct ethtool_ops sis900_ethtool_ops; · 239 unmodified lines
240240 * @net_dev: the net device to get address for
241241 *
242242 * Older SiS900 and friends, use EEPROM to store MAC address.
243− * MAC address is read from read_eeprom() into @net_dev->dev_addr.
243+ * MAC address is read from read_eeprom() into @net_dev->dev_addr and
244+ * @net_dev->perm_addr.
244245 */
245246
246247 static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev)
@@ -261,6 +262,9 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de · 14 unmodified lines
261262 for (i = 0; i < 3; i++)
262263 ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
263264
265+ /* Store MAC Address in perm_addr */
266+ memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
267+
264268 return 1;
265269 }
266270
@@ -271,7 +275,8 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de · 4 unmodified lines
271275 *
272276 * SiS630E model, use APC CMOS RAM to store MAC address.
273277 * APC CMOS RAM is accessed through ISA bridge.
274− * MAC address is read into @net_dev->dev_addr.
278+ * MAC address is read into @net_dev->dev_addr and
279+ * @net_dev->perm_addr.
275280 */
276281
277282 static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
@@ -296,6 +301,10 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, · 18 unmodified lines
296301 outb(0x09 + i, 0x70);
297302 ((u8 *)(net_dev->dev_addr))[i] = inb(0x71);
298303 }
304+
305+ /* Store MAC Address in perm_addr */
306+ memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
307+
299308 pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40);
300309 pci_dev_put(isa_bridge);
301310
@@ -310,7 +319,7 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, · 8 unmodified lines
310319 *
311320 * SiS635 model, set MAC Reload Bit to load Mac address from APC
312321 * to rfdr. rfdr is accessed through rfcr. MAC address is read into
313− * @net_dev->dev_addr.
322+ * @net_dev->dev_addr and @net_dev->perm_addr.
314323 */
315324
316325 static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
@@ -334,6 +343,9 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, · 17 unmodified lines
334343 *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr);
335344 }
336345
346+ /* Store MAC Address in perm_addr */
347+ memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
348+
337349 /* enable packet filtering */
338350 outl(rfcrSave | RFEN, rfcr + ioaddr);
339351
@@ -353,7 +365,7 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, · 13 unmodified lines
353365 * EEDONE signal to refuse EEPROM access by LAN.
354366 * The EEPROM map of SiS962 or SiS963 is different to SiS900.
355367 * The signature field in SiS962 or SiS963 spec is meaningless.
356− * MAC address is read into @net_dev->dev_addr.
368+ * MAC address is read into @net_dev->dev_addr and @net_dev->perm_addr.
357369 */
358370
359371 static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev,
@@ -372,6 +384,9 @@ static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, · 12 unmodified lines
372384 for (i = 0; i < 3; i++)
373385 ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
374386
387+ /* Store MAC Address in perm_addr */
388+ memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
389+
375390 outl(EEDONE, ee_addr);
376391 return 1;
377392 } else {
drivers/net/slip.c+3−1
@@ -853,7 +853,9 @@ static int slip_open(struct tty_struct *tty) · 852 unmodified lines
853853 /* Done. We have linked the TTY line to a channel. */
854854 rtnl_unlock();
855855 tty->receive_room = 65536; /* We don't flow control */
856− return sl->dev->base_addr;
856+
857+ /* TTY layer expects 0 on success */
858+ return 0;
857859
858860 err_free_bufs:
859861 sl_free_bufs(sl);
drivers/net/stmmac/dwmac_lib.c+14−14
@@ -26,9 +26,9 @@ · 25 unmodified lines
2626
2727 #undef DWMAC_DMA_DEBUG
2828 #ifdef DWMAC_DMA_DEBUG
29−#define DBG(fmt, args...) printk(fmt, ## args)
29+#define DWMAC_LIB_DBG(fmt, args...) printk(fmt, ## args)
3030 #else
31−#define DBG(fmt, args...) do { } while (0)
31+#define DWMAC_LIB_DBG(fmt, args...) do { } while (0)
3232 #endif
3333
3434 /* CSR1 enables the transmit DMA to check for new descriptor */
@@ -152,7 +152,7 @@ int dwmac_dma_interrupt(void __iomem *ioaddr, · 117 unmodified lines
152152 /* read the status register (CSR5) */
153153 u32 intr_status = readl(ioaddr + DMA_STATUS);
154154
155− DBG(INFO, "%s: [CSR5: 0x%08x]\n", __func__, intr_status);
155+ DWMAC_LIB_DBG(KERN_INFO "%s: [CSR5: 0x%08x]\n", __func__, intr_status);
156156 #ifdef DWMAC_DMA_DEBUG
157157 /* It displays the DMA process states (CSR5 register) */
158158 show_tx_process_state(intr_status);
@@ -160,43 +160,43 @@ int dwmac_dma_interrupt(void __iomem *ioaddr, · 1 unmodified line
160160 #endif
161161 /* ABNORMAL interrupts */
162162 if (unlikely(intr_status & DMA_STATUS_AIS)) {
163− DBG(INFO, "CSR5[15] DMA ABNORMAL IRQ: ");
163+ DWMAC_LIB_DBG(KERN_INFO "CSR5[15] DMA ABNORMAL IRQ: ");
164164 if (unlikely(intr_status & DMA_STATUS_UNF)) {
165− DBG(INFO, "transmit underflow\n");
165+ DWMAC_LIB_DBG(KERN_INFO "transmit underflow\n");
166166 ret = tx_hard_error_bump_tc;
167167 x->tx_undeflow_irq++;
168168 }
169169 if (unlikely(intr_status & DMA_STATUS_TJT)) {
170− DBG(INFO, "transmit jabber\n");
170+ DWMAC_LIB_DBG(KERN_INFO "transmit jabber\n");
171171 x->tx_jabber_irq++;
172172 }
173173 if (unlikely(intr_status & DMA_STATUS_OVF)) {
174− DBG(INFO, "recv overflow\n");
174+ DWMAC_LIB_DBG(KERN_INFO "recv overflow\n");
175175 x->rx_overflow_irq++;
176176 }
177177 if (unlikely(intr_status & DMA_STATUS_RU)) {
178− DBG(INFO, "receive buffer unavailable\n");
178+ DWMAC_LIB_DBG(KERN_INFO "receive buffer unavailable\n");
179179 x->rx_buf_unav_irq++;
180180 }
181181 if (unlikely(intr_status & DMA_STATUS_RPS)) {
182− DBG(INFO, "receive process stopped\n");
182+ DWMAC_LIB_DBG(KERN_INFO "receive process stopped\n");
183183 x->rx_process_stopped_irq++;
184184 }
185185 if (unlikely(intr_status & DMA_STATUS_RWT)) {
186− DBG(INFO, "receive watchdog\n");
186+ DWMAC_LIB_DBG(KERN_INFO "receive watchdog\n");
187187 x->rx_watchdog_irq++;
188188 }
189189 if (unlikely(intr_status & DMA_STATUS_ETI)) {
190− DBG(INFO, "transmit early interrupt\n");
190+ DWMAC_LIB_DBG(KERN_INFO "transmit early interrupt\n");
191191 x->tx_early_irq++;
192192 }
193193 if (unlikely(intr_status & DMA_STATUS_TPS)) {
194− DBG(INFO, "transmit process stopped\n");
194+ DWMAC_LIB_DBG(KERN_INFO "transmit process stopped\n");
195195 x->tx_process_stopped_irq++;
196196 ret = tx_hard_error;
197197 }
198198 if (unlikely(intr_status & DMA_STATUS_FBI)) {
199− DBG(INFO, "fatal bus error\n");
199+ DWMAC_LIB_DBG(KERN_INFO "fatal bus error\n");
200200 x->fatal_bus_error_irq++;
201201 ret = tx_hard_error;
202202 }
@@ -215,7 +215,7 @@ int dwmac_dma_interrupt(void __iomem *ioaddr, · 12 unmodified lines
215215 /* Clear the interrupt by writing a logic 1 to the CSR5[15-0] */
216216 writel((intr_status & 0x1ffff), ioaddr + DMA_STATUS);
217217
218− DBG(INFO, "\n\n");
218+ DWMAC_LIB_DBG(KERN_INFO "\n\n");
219219 return ret;
220220 }
221221
drivers/net/stmmac/stmmac_main.c+28−21
@@ -750,7 +750,6 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv) · 749 unmodified lines
750750 priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE);
751751 priv->xstats.threshold = tc;
752752 }
753− stmmac_tx_err(priv);
754753 } else if (unlikely(status == tx_hard_error))
755754 stmmac_tx_err(priv);
756755 }
@@ -781,21 +780,6 @@ static int stmmac_open(struct net_device *dev) · 24 unmodified lines
781780
782781 stmmac_verify_args();
783782
784− ret = stmmac_init_phy(dev);
785− if (unlikely(ret)) {
786− pr_err("%s: Cannot attach to PHY (error: %d)\n", __func__, ret);
787− return ret;
788− }
789−
790− /* Request the IRQ lines */
791− ret = request_irq(dev->irq, stmmac_interrupt,
792− IRQF_SHARED, dev->name, dev);
793− if (unlikely(ret < 0)) {
794− pr_err("%s: ERROR: allocating the IRQ %d (error: %d)\n",
795− __func__, dev->irq, ret);
796− return ret;
797− }
798−
799783 #ifdef CONFIG_STMMAC_TIMER
800784 priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL);
801785 if (unlikely(priv->tm == NULL)) {
@@ -814,6 +798,11 @@ static int stmmac_open(struct net_device *dev) · 12 unmodified lines
814798 } else
815799 priv->tm->enable = 1;
816800 #endif
801+ ret = stmmac_init_phy(dev);
802+ if (unlikely(ret)) {
803+ pr_err("%s: Cannot attach to PHY (error: %d)\n", __func__, ret);
804+ goto open_error;
805+ }
817806
818807 /* Create and initialize the TX/RX descriptors chains. */
819808 priv->dma_tx_size = STMMAC_ALIGN(dma_txsize);
@@ -822,12 +811,11 @@ static int stmmac_open(struct net_device *dev) · 2 unmodified lines
822811 init_dma_desc_rings(dev);
823812
824813 /* DMA initialization and SW reset */
825− if (unlikely(priv->hw->dma->init(priv->ioaddr, priv->plat->pbl,
826− priv->dma_tx_phy,
827− priv->dma_rx_phy) < 0)) {
828−
814+ ret = priv->hw->dma->init(priv->ioaddr, priv->plat->pbl,
815+ priv->dma_tx_phy, priv->dma_rx_phy);
816+ if (ret < 0) {
829817 pr_err("%s: DMA initialization failed\n", __func__);
830− return -1;
818+ goto open_error;
831819 }
832820
833821 /* Copy the MAC addr into the HW */
@@ -848,6 +836,15 @@ static int stmmac_open(struct net_device *dev) · 14 unmodified lines
848836 writel(0xffffffff, priv->ioaddr + MMC_HIGH_INTR_MASK);
849837 writel(0xffffffff, priv->ioaddr + MMC_LOW_INTR_MASK);
850838
839+ /* Request the IRQ lines */
840+ ret = request_irq(dev->irq, stmmac_interrupt,
841+ IRQF_SHARED, dev->name, dev);
842+ if (unlikely(ret < 0)) {
843+ pr_err("%s: ERROR: allocating the IRQ %d (error: %d)\n",
844+ __func__, dev->irq, ret);
845+ goto open_error;
846+ }
847+
851848 /* Enable the MAC Rx/Tx */
852849 stmmac_enable_mac(priv->ioaddr);
853850
@@ -878,7 +875,17 @@ static int stmmac_open(struct net_device *dev) · 24 unmodified lines
878875 napi_enable(&priv->napi);
879876 skb_queue_head_init(&priv->rx_recycle);
880877 netif_start_queue(dev);
878+
881879 return 0;
880+
881+open_error:
882+#ifdef CONFIG_STMMAC_TIMER
883+ kfree(priv->tm);
884+#endif
885+ if (priv->phydev)
886+ phy_disconnect(priv->phydev);
887+
888+ return ret;
882889 }
883890
884891 /**
drivers/net/sunhme.c+5−2
@@ -3237,15 +3237,18 @@ static void happy_meal_pci_exit(void) · 3236 unmodified lines
32373237 #endif
32383238
32393239 #ifdef CONFIG_SBUS
3240+static const struct of_device_id hme_sbus_match[];
32403241 static int __devinit hme_sbus_probe(struct platform_device *op)
32413242 {
3243+ const struct of_device_id *match;
32423244 struct device_node *dp = op->dev.of_node;
32433245 const char *model = of_get_property(dp, "model", NULL);
32443246 int is_qfe;
32453247
3246− if (!op->dev.of_match)
3248+ match = of_match_device(hme_sbus_match, &op->dev);
3249+ if (!match)
32473250 return -EINVAL;
3248− is_qfe = (op->dev.of_match->data != NULL);
3251+ is_qfe = (match->data != NULL);
32493252
32503253 if (!is_qfe && model && !strcmp(model, "SUNW,sbus-qfe"))
32513254 is_qfe = 1;
drivers/net/tg3.c+6−2
@@ -12327,8 +12327,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) · 12326 unmodified lines
1232712327 if (val & VCPU_CFGSHDW_ASPM_DBNC)
1232812328 tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
1232912329 if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
12330− (val & VCPU_CFGSHDW_WOL_MAGPKT))
12330+ (val & VCPU_CFGSHDW_WOL_MAGPKT)) {
1233112331 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
12332+ device_set_wakeup_enable(&tp->pdev->dev, true);
12333+ }
1233212334 goto done;
1233312335 }
1233412336
@@ -12461,8 +12463,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) · 126 unmodified lines
1246112463 tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
1246212464
1246312465 if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
12464− (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE))
12466+ (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) {
1246512467 tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
12468+ device_set_wakeup_enable(&tp->pdev->dev, true);
12469+ }
1246612470
1246712471 if (cfg2 & (1 << 17))
1246812472 tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING;
drivers/net/tokenring/3c359.c+2−2
@@ -1251,7 +1251,7 @@ static netdev_tx_t xl_xmit(struct sk_buff *skb, struct net_device *dev) · 1250 unmodified lines
12511251 /*
12521252 * The NIC has told us that a packet has been downloaded onto the card, we must
12531253 * find out which packet it has done, clear the skb and information for the packet
1254− * then advance around the ring for all tranmitted packets
1254+ * then advance around the ring for all transmitted packets
12551255 */
12561256
12571257 static void xl_dn_comp(struct net_device *dev)
@@ -1568,7 +1568,7 @@ static void xl_arb_cmd(struct net_device *dev) · 310 unmodified lines
15681568 if (lan_status_diff & LSC_SOFT_ERR)
15691569 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n",dev->name);
15701570 if (lan_status_diff & LSC_TRAN_BCN)
1571− printk(KERN_INFO "%s: We are tranmitting the beacon, aaah\n",dev->name);
1571+ printk(KERN_INFO "%s: We are transmitting the beacon, aaah\n",dev->name);
15721572 if (lan_status_diff & LSC_SS)
15731573 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name);
15741574 if (lan_status_diff & LSC_RING_REC)
drivers/net/tokenring/lanstreamer.c+1−1
@@ -1675,7 +1675,7 @@ drop_frame: · 1674 unmodified lines
16751675 if (lan_status_diff & LSC_SOFT_ERR)
16761676 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n", dev->name);
16771677 if (lan_status_diff & LSC_TRAN_BCN)
1678− printk(KERN_INFO "%s: We are tranmitting the beacon, aaah\n", dev->name);
1678+ printk(KERN_INFO "%s: We are transmitting the beacon, aaah\n", dev->name);
16791679 if (lan_status_diff & LSC_SS)
16801680 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name);
16811681 if (lan_status_diff & LSC_RING_REC)
drivers/net/tokenring/olympic.c+1−1
@@ -1500,7 +1500,7 @@ drop_frame: · 1499 unmodified lines
15001500 if (lan_status_diff & LSC_SOFT_ERR)
15011501 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n",dev->name);
15021502 if (lan_status_diff & LSC_TRAN_BCN)
1503− printk(KERN_INFO "%s: We are tranmitting the beacon, aaah\n",dev->name);
1503+ printk(KERN_INFO "%s: We are transmitting the beacon, aaah\n",dev->name);
15041504 if (lan_status_diff & LSC_SS)
15051505 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name);
15061506 if (lan_status_diff & LSC_RING_REC)
drivers/net/usb/cdc_ether.c+13−3
@@ -460,7 +460,7 @@ static const struct driver_info cdc_info = { · 459 unmodified lines
460460 .manage_power = cdc_manage_power,
461461 };
462462
463−static const struct driver_info mbm_info = {
463+static const struct driver_info wwan_info = {
464464 .description = "Mobile Broadband Network Device",
465465 .flags = FLAG_WWAN,
466466 .bind = usbnet_cdc_bind,
@@ -471,6 +471,7 @@ static const struct driver_info mbm_info = { · 4 unmodified lines
471471
472472 /*-------------------------------------------------------------------------*/
473473
474+#define HUAWEI_VENDOR_ID 0x12D1
474475
475476 static const struct usb_device_id products [] = {
476477 /*
@@ -566,7 +567,7 @@ static const struct usb_device_id products [] = { · 89 unmodified lines
566567 {
567568 USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
568569 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
569− .driver_info = 0,
570+ .driver_info = (unsigned long)&wwan_info,
570571 },
571572
572573 /*
@@ -587,8 +588,17 @@ static const struct usb_device_id products [] = { · 14 unmodified lines
587588 }, {
588589 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
589590 USB_CDC_PROTO_NONE),
590− .driver_info = (unsigned long)&mbm_info,
591+ .driver_info = (unsigned long)&wwan_info,
591592
593+}, {
594+ /* Various Huawei modems with a network port like the UMG1831 */
595+ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
596+ | USB_DEVICE_ID_MATCH_INT_INFO,
597+ .idVendor = HUAWEI_VENDOR_ID,
598+ .bInterfaceClass = USB_CLASS_COMM,
599+ .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
600+ .bInterfaceProtocol = 255,
601+ .driver_info = (unsigned long)&wwan_info,
592602 },
593603 { }, // END
594604 };
drivers/net/usb/cdc_ncm.c+2−2
@@ -54,13 +54,13 @@ · 53 unmodified lines
5454 #include <linux/usb/usbnet.h>
5555 #include <linux/usb/cdc.h>
5656
57−#define DRIVER_VERSION "7-Feb-2011"
57+#define DRIVER_VERSION "23-Apr-2011"
5858
5959 /* CDC NCM subclass 3.2.1 */
6060 #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10
6161
6262 /* Maximum NTB length */
63−#define CDC_NCM_NTB_MAX_SIZE_TX 16384 /* bytes */
63+#define CDC_NCM_NTB_MAX_SIZE_TX (16384 + 4) /* bytes, must be short terminated */
6464 #define CDC_NCM_NTB_MAX_SIZE_RX 16384 /* bytes */
6565
6666 /* Minimum value for MaxDatagramSize, ch. 6.2.9 */
drivers/net/usb/ipheth.c+9−5
@@ -65,6 +65,7 @@ · 64 unmodified lines
6565 #define IPHETH_USBINTF_PROTO 1
6666
6767 #define IPHETH_BUF_SIZE 1516
68+#define IPHETH_IP_ALIGN 2 /* padding at front of URB */
6869 #define IPHETH_TX_TIMEOUT (5 * HZ)
6970
7071 #define IPHETH_INTFNUM 2
@@ -202,18 +203,21 @@ static void ipheth_rcvbulk_callback(struct urb *urb) · 131 unmodified lines
202203 return;
203204 }
204205
205− len = urb->actual_length;
206− buf = urb->transfer_buffer;
206+ if (urb->actual_length <= IPHETH_IP_ALIGN) {
207+ dev->net->stats.rx_length_errors++;
208+ return;
209+ }
210+ len = urb->actual_length - IPHETH_IP_ALIGN;
211+ buf = urb->transfer_buffer + IPHETH_IP_ALIGN;
207212
208− skb = dev_alloc_skb(NET_IP_ALIGN + len);
213+ skb = dev_alloc_skb(len);
209214 if (!skb) {
210215 err("%s: dev_alloc_skb: -ENOMEM", __func__);
211216 dev->net->stats.rx_dropped++;
212217 return;
213218 }
214219
215− skb_reserve(skb, NET_IP_ALIGN);
216− memcpy(skb_put(skb, len), buf + NET_IP_ALIGN, len - NET_IP_ALIGN);
220+ memcpy(skb_put(skb, len), buf, len);
217221 skb->dev = dev->net;
218222 skb->protocol = eth_type_trans(skb, dev->net);
219223
drivers/net/usb/smsc95xx.c+1−1
@@ -730,7 +730,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev) · 729 unmodified lines
730730 msleep(10);
731731 bmcr = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
732732 timeout++;
733− } while ((bmcr & MII_BMCR) && (timeout < 100));
733+ } while ((bmcr & BMCR_RESET) && (timeout < 100));
734734
735735 if (timeout >= 100) {
736736 netdev_warn(dev->net, "timeout on PHY Reset");
drivers/net/usb/usbnet.c+15−3
@@ -645,6 +645,7 @@ int usbnet_stop (struct net_device *net) · 644 unmodified lines
645645 struct driver_info *info = dev->driver_info;
646646 int retval;
647647
648+ clear_bit(EVENT_DEV_OPEN, &dev->flags);
648649 netif_stop_queue (net);
649650
650651 netif_info(dev, ifdown, dev->net,
@@ -736,6 +737,7 @@ int usbnet_open (struct net_device *net) · 85 unmodified lines
736737 }
737738 }
738739
740+ set_bit(EVENT_DEV_OPEN, &dev->flags);
739741 netif_start_queue (net);
740742 netif_info(dev, ifup, dev->net,
741743 "open: enable queueing (rx %d, tx %d) mtu %d %s framing\n",
@@ -1259,6 +1261,9 @@ void usbnet_disconnect (struct usb_interface *intf) · 517 unmodified lines
12591261 if (dev->driver_info->unbind)
12601262 dev->driver_info->unbind (dev, intf);
12611263
1264+ usb_kill_urb(dev->interrupt);
1265+ usb_free_urb(dev->interrupt);
1266+
12621267 free_netdev(net);
12631268 usb_put_dev (xdev);
12641269 }
@@ -1498,6 +1503,10 @@ int usbnet_resume (struct usb_interface *intf) · 233 unmodified lines
14981503 int retval;
14991504
15001505 if (!--dev->suspend_count) {
1506+ /* resume interrupt URBs */
1507+ if (dev->interrupt && test_bit(EVENT_DEV_OPEN, &dev->flags))
1508+ usb_submit_urb(dev->interrupt, GFP_NOIO);
1509+
15011510 spin_lock_irq(&dev->txq.lock);
15021511 while ((res = usb_get_from_anchor(&dev->deferred))) {
15031512
@@ -1516,9 +1525,12 @@ int usbnet_resume (struct usb_interface *intf) · 12 unmodified lines
15161525 smp_mb();
15171526 clear_bit(EVENT_DEV_ASLEEP, &dev->flags);
15181527 spin_unlock_irq(&dev->txq.lock);
1519− if (!(dev->txq.qlen >= TX_QLEN(dev)))
1520− netif_start_queue(dev->net);
1521− tasklet_schedule (&dev->bh);
1528+
1529+ if (test_bit(EVENT_DEV_OPEN, &dev->flags)) {
1530+ if (!(dev->txq.qlen >= TX_QLEN(dev)))
1531+ netif_start_queue(dev->net);
1532+ tasklet_schedule (&dev->bh);
1533+ }
15221534 }
15231535 return 0;
15241536 }
drivers/net/veth.c+12−0
@@ -403,6 +403,17 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, · 402 unmodified lines
403403 if (tb[IFLA_ADDRESS] == NULL)
404404 random_ether_addr(dev->dev_addr);
405405
406+ if (tb[IFLA_IFNAME])
407+ nla_strlcpy(dev->name, tb[IFLA_IFNAME], IFNAMSIZ);
408+ else
409+ snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d");
410+
411+ if (strchr(dev->name, '%')) {
412+ err = dev_alloc_name(dev, dev->name);
413+ if (err < 0)
414+ goto err_alloc_name;
415+ }
416+
406417 err = register_netdevice(dev);
407418 if (err < 0)
408419 goto err_register_dev;
@@ -422,6 +433,7 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, · 13 unmodified lines
422433
423434 err_register_dev:
424435 /* nothing to do */
436+err_alloc_name:
425437 err_configure_peer:
426438 unregister_netdevice(peer);
427439 return err;
drivers/net/vmxnet3/vmxnet3_drv.c+6−4
@@ -178,6 +178,7 @@ static void · 177 unmodified lines
178178 vmxnet3_process_events(struct vmxnet3_adapter *adapter)
179179 {
180180 int i;
181+ unsigned long flags;
181182 u32 events = le32_to_cpu(adapter->shared->ecr);
182183 if (!events)
183184 return;
@@ -190,10 +191,10 @@ vmxnet3_process_events(struct vmxnet3_adapter *adapter) · 6 unmodified lines
190191
191192 /* Check if there is an error on xmit/recv queues */
192193 if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) {
193− spin_lock(&adapter->cmd_lock);
194+ spin_lock_irqsave(&adapter->cmd_lock, flags);
194195 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
195196 VMXNET3_CMD_GET_QUEUE_STATUS);
196− spin_unlock(&adapter->cmd_lock);
197+ spin_unlock_irqrestore(&adapter->cmd_lock, flags);
197198
198199 for (i = 0; i < adapter->num_tx_queues; i++)
199200 if (adapter->tqd_start[i].status.stopped)
@@ -2733,13 +2734,14 @@ static void · 2533 unmodified lines
27332734 vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter)
27342735 {
27352736 u32 cfg;
2737+ unsigned long flags;
27362738
27372739 /* intr settings */
2738− spin_lock(&adapter->cmd_lock);
2740+ spin_lock_irqsave(&adapter->cmd_lock, flags);
27392741 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
27402742 VMXNET3_CMD_GET_CONF_INTR);
27412743 cfg = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD);
2742− spin_unlock(&adapter->cmd_lock);
2744+ spin_unlock_irqrestore(&adapter->cmd_lock, flags);
27432745 adapter->intr.type = cfg & 0x3;
27442746 adapter->intr.mask_mode = (cfg >> 2) & 0x3;
27452747
drivers/net/vmxnet3/vmxnet3_ethtool.c+3−0
@@ -311,6 +311,9 @@ vmxnet3_set_flags(struct net_device *netdev, u32 data) · 310 unmodified lines
311311 /* toggle the LRO feature*/
312312 netdev->features ^= NETIF_F_LRO;
313313
314+ /* Update private LRO flag */
315+ adapter->lro = lro_requested;
316+
314317 /* update harware LRO capability accordingly */
315318 if (lro_requested)
316319 adapter->shared->devRead.misc.uptFeatures |=
drivers/net/wireless/ath/ath9k/hif_usb.c+2−2
@@ -1040,7 +1040,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, · 1039 unmodified lines
10401040 }
10411041
10421042 ret = ath9k_htc_hw_init(hif_dev->htc_handle,
1043− &hif_dev->udev->dev, hif_dev->device_id,
1043+ &interface->dev, hif_dev->device_id,
10441044 hif_dev->udev->product, id->driver_info);
10451045 if (ret) {
10461046 ret = -EINVAL;
@@ -1158,7 +1158,7 @@ fail_resume: · 111 unmodified lines
11581158 #endif
11591159
11601160 static struct usb_driver ath9k_hif_usb_driver = {
1161− .name = "ath9k_hif_usb",
1161+ .name = KBUILD_MODNAME,
11621162 .probe = ath9k_hif_usb_probe,
11631163 .disconnect = ath9k_hif_usb_disconnect,
11641164 #ifdef CONFIG_PM
drivers/net/wireless/ath/ath9k/hw.c+0−9
@@ -1254,15 +1254,6 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, · 1253 unmodified lines
12541254 ah->txchainmask = common->tx_chainmask;
12551255 ah->rxchainmask = common->rx_chainmask;
12561256
1257− if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) {
1258− ath9k_hw_abortpcurecv(ah);
1259− if (!ath9k_hw_stopdmarecv(ah)) {
1260− ath_dbg(common, ATH_DBG_XMIT,
1261− "Failed to stop receive dma\n");
1262− bChannelChange = false;
1263− }
1264− }
1265−
12661257 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
12671258 return -EIO;
12681259
drivers/net/wireless/ath/ath9k/mac.c+22−3
@@ -751,28 +751,47 @@ void ath9k_hw_abortpcurecv(struct ath_hw *ah) · 750 unmodified lines
751751 }
752752 EXPORT_SYMBOL(ath9k_hw_abortpcurecv);
753753
754−bool ath9k_hw_stopdmarecv(struct ath_hw *ah)
754+bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
755755 {
756756 #define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */
757757 #define AH_RX_TIME_QUANTUM 100 /* usec */
758758 struct ath_common *common = ath9k_hw_common(ah);
759+ u32 mac_status, last_mac_status = 0;
759760 int i;
760761
762+ /* Enable access to the DMA observation bus */
763+ REG_WRITE(ah, AR_MACMISC,
764+ ((AR_MACMISC_DMA_OBS_LINE_8 << AR_MACMISC_DMA_OBS_S) |
765+ (AR_MACMISC_MISC_OBS_BUS_1 <<
766+ AR_MACMISC_MISC_OBS_BUS_MSB_S)));
767+
761768 REG_WRITE(ah, AR_CR, AR_CR_RXD);
762769
763770 /* Wait for rx enable bit to go low */
764771 for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) {
765772 if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0)
766773 break;
774+
775+ if (!AR_SREV_9300_20_OR_LATER(ah)) {
776+ mac_status = REG_READ(ah, AR_DMADBG_7) & 0x7f0;
777+ if (mac_status == 0x1c0 && mac_status == last_mac_status) {
778+ *reset = true;
779+ break;
780+ }
781+
782+ last_mac_status = mac_status;
783+ }
784+
767785 udelay(AH_TIME_QUANTUM);
768786 }
769787
770788 if (i == 0) {
771789 ath_err(common,
772− "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
790+ "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
773791 AH_RX_STOP_DMA_TIMEOUT / 1000,
774792 REG_READ(ah, AR_CR),
775− REG_READ(ah, AR_DIAG_SW));
793+ REG_READ(ah, AR_DIAG_SW),
794+ REG_READ(ah, AR_DMADBG_7));
776795 return false;
777796 } else {
778797 return true;
drivers/net/wireless/ath/ath9k/mac.h+1−1
@@ -695,7 +695,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set); · 694 unmodified lines
695695 void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
696696 void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning);
697697 void ath9k_hw_abortpcurecv(struct ath_hw *ah);
698−bool ath9k_hw_stopdmarecv(struct ath_hw *ah);
698+bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset);
699699 int ath9k_hw_beaconq_setup(struct ath_hw *ah);
700700
701701 /* Interrupt Handling */
drivers/net/wireless/ath/ath9k/main.c+18−2
@@ -1376,7 +1376,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, · 1375 unmodified lines
13761376
13771377 ath9k_calculate_iter_data(hw, vif, &iter_data);
13781378
1379− ath9k_ps_wakeup(sc);
13801379 /* Set BSSID mask. */
13811380 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
13821381 ath_hw_setbssidmask(common);
@@ -1411,7 +1410,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, · 28 unmodified lines
14111410 }
14121411
14131412 ath9k_hw_set_interrupts(ah, ah->imask);
1414− ath9k_ps_restore(sc);
14151413
14161414 /* Set up ANI */
14171415 if ((iter_data.naps + iter_data.nadhocs) > 0) {
@@ -1457,6 +1455,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, · 39 unmodified lines
14571455 struct ath_vif *avp = (void *)vif->drv_priv;
14581456 int ret = 0;
14591457
1458+ ath9k_ps_wakeup(sc);
14601459 mutex_lock(&sc->mutex);
14611460
14621461 switch (vif->type) {
@@ -1503,6 +1502,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, · 40 unmodified lines
15031502 ath9k_do_vif_add_setup(hw, vif);
15041503 out:
15051504 mutex_unlock(&sc->mutex);
1505+ ath9k_ps_restore(sc);
15061506 return ret;
15071507 }
15081508
@@ -1517,6 +1517,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, · 8 unmodified lines
15171517
15181518 ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n");
15191519 mutex_lock(&sc->mutex);
1520+ ath9k_ps_wakeup(sc);
15201521
15211522 /* See if new interface type is valid. */
15221523 if ((new_type == NL80211_IFTYPE_ADHOC) &&
@@ -1546,6 +1547,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, · 23 unmodified lines
15461547
15471548 ath9k_do_vif_add_setup(hw, vif);
15481549 out:
1550+ ath9k_ps_restore(sc);
15491551 mutex_unlock(&sc->mutex);
15501552 return ret;
15511553 }
@@ -1558,6 +1560,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, · 6 unmodified lines
15581560
15591561 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
15601562
1563+ ath9k_ps_wakeup(sc);
15611564 mutex_lock(&sc->mutex);
15621565
15631566 sc->nvifs--;
@@ -1569,6 +1572,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, · 5 unmodified lines
15691572 ath9k_calculate_summary_state(hw, NULL);
15701573
15711574 mutex_unlock(&sc->mutex);
1575+ ath9k_ps_restore(sc);
15721576 }
15731577
15741578 static void ath9k_enable_ps(struct ath_softc *sc)
@@ -1809,6 +1813,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, · 234 unmodified lines
18091813
18101814 txq = sc->tx.txq_map[queue];
18111815
1816+ ath9k_ps_wakeup(sc);
18121817 mutex_lock(&sc->mutex);
18131818
18141819 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
@@ -1832,6 +1837,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, · 17 unmodified lines
18321837 ath_beaconq_config(sc);
18331838
18341839 mutex_unlock(&sc->mutex);
1840+ ath9k_ps_restore(sc);
18351841
18361842 return ret;
18371843 }
@@ -1894,6 +1900,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, · 56 unmodified lines
18941900 int slottime;
18951901 int error;
18961902
1903+ ath9k_ps_wakeup(sc);
18971904 mutex_lock(&sc->mutex);
18981905
18991906 if (changed & BSS_CHANGED_BSSID) {
@@ -1994,6 +2001,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, · 94 unmodified lines
19942001 }
19952002
19962003 mutex_unlock(&sc->mutex);
2004+ ath9k_ps_restore(sc);
19972005 }
19982006
19992007 static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
@@ -2133,6 +2141,8 @@ static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class) · 133 unmodified lines
21332141 static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
21342142 {
21352143 struct ath_softc *sc = hw->priv;
2144+ struct ath_hw *ah = sc->sc_ah;
2145+ struct ath_common *common = ath9k_hw_common(ah);
21362146 int timeout = 200; /* ms */
21372147 int i, j;
21382148
@@ -2141,6 +2151,12 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop) · 2 unmodified lines
21412151
21422152 cancel_delayed_work_sync(&sc->tx_complete_work);
21432153
2154+ if (sc->sc_flags & SC_OP_INVALID) {
2155+ ath_dbg(common, ATH_DBG_ANY, "Device not present\n");
2156+ mutex_unlock(&sc->mutex);
2157+ return;
2158+ }
2159+
21442160 if (drop)
21452161 timeout = 1;
21462162
drivers/net/wireless/ath/ath9k/recv.c+3−3
@@ -486,12 +486,12 @@ start_recv: · 485 unmodified lines
486486 bool ath_stoprecv(struct ath_softc *sc)
487487 {
488488 struct ath_hw *ah = sc->sc_ah;
489− bool stopped;
489+ bool stopped, reset = false;
490490
491491 spin_lock_bh(&sc->rx.rxbuflock);
492492 ath9k_hw_abortpcurecv(ah);
493493 ath9k_hw_setrxfilter(ah, 0);
494− stopped = ath9k_hw_stopdmarecv(ah);
494+ stopped = ath9k_hw_stopdmarecv(ah, &reset);
495495
496496 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
497497 ath_edma_stop_recv(sc);
@@ -506,7 +506,7 @@ bool ath_stoprecv(struct ath_softc *sc) · 8 unmodified lines
506506 "confusing the DMA engine when we start RX up\n");
507507 ATH_DBG_WARN_ON_ONCE(!stopped);
508508 }
509− return stopped;
509+ return stopped && !reset;
510510 }
511511
512512 void ath_flushrecv(struct ath_softc *sc)
drivers/net/wireless/ath/regd_common.h+1−0
@@ -195,6 +195,7 @@ static struct reg_dmn_pair_mapping regDomainPairs[] = { · 194 unmodified lines
195195 {APL9_WORLD, CTL_ETSI, CTL_ETSI},
196196
197197 {APL3_FCCA, CTL_FCC, CTL_FCC},
198+ {APL7_FCCA, CTL_FCC, CTL_FCC},
198199 {APL1_ETSIC, CTL_FCC, CTL_ETSI},
199200 {APL2_ETSIC, CTL_FCC, CTL_ETSI},
200201 {APL2_APLD, CTL_FCC, NO_CTL},
drivers/net/wireless/b43/main.c+1−0
@@ -72,6 +72,7 @@ MODULE_FIRMWARE("b43/ucode11.fw"); · 71 unmodified lines
7272 MODULE_FIRMWARE("b43/ucode13.fw");
7373 MODULE_FIRMWARE("b43/ucode14.fw");
7474 MODULE_FIRMWARE("b43/ucode15.fw");
75+MODULE_FIRMWARE("b43/ucode16_mimo.fw");
7576 MODULE_FIRMWARE("b43/ucode5.fw");
7677 MODULE_FIRMWARE("b43/ucode9.fw");
7778
drivers/net/wireless/iwlegacy/Kconfig+5−4
@@ -1,6 +1,5 @@
11 config IWLWIFI_LEGACY
2− tristate "Intel Wireless Wifi legacy devices"
3− depends on PCI && MAC80211
2+ tristate
43 select FW_LOADER
54 select NEW_LEDS
65 select LEDS_CLASS
@@ -65,7 +64,8 @@ endmenu · 58 unmodified lines
6564
6665 config IWL4965
6766 tristate "Intel Wireless WiFi 4965AGN (iwl4965)"
68− depends on IWLWIFI_LEGACY
67+ depends on PCI && MAC80211
68+ select IWLWIFI_LEGACY
6969 ---help---
7070 This option enables support for
7171
@@ -92,7 +92,8 @@ config IWL4965 · 20 unmodified lines
9292
9393 config IWL3945
9494 tristate "Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)"
95− depends on IWLWIFI_LEGACY
95+ depends on PCI && MAC80211
96+ select IWLWIFI_LEGACY
9697 ---help---
9798 Select to build the driver supporting the:
9899
drivers/net/wireless/iwlegacy/iwl-3945-hw.h+0−2
@@ -74,8 +74,6 @@ · 73 unmodified lines
7474 /* RSSI to dBm */
7575 #define IWL39_RSSI_OFFSET 95
7676
77−#define IWL_DEFAULT_TX_POWER 0x0F
78−
7977 /*
8078 * EEPROM related constants, enums, and structures.
8179 */
drivers/net/wireless/iwlegacy/iwl-4965-hw.h+0−3
@@ -804,9 +804,6 @@ struct iwl4965_scd_bc_tbl { · 803 unmodified lines
804804
805805 #define IWL4965_DEFAULT_TX_RETRY 15
806806
807−/* Limit range of txpower output target to be between these values */
808−#define IWL4965_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm: 1 milliwatt */
809−
810807 /* EEPROM */
811808 #define IWL4965_FIRST_AMPDU_QUEUE 10
812809
drivers/net/wireless/iwlegacy/iwl-4965-tx.c+19−9
@@ -316,12 +316,18 @@ int iwl4965_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) · 315 unmodified lines
316316
317317 hdr_len = ieee80211_hdrlen(fc);
318318
319− /* Find index into station table for destination station */
320− sta_id = iwl_legacy_sta_id_or_broadcast(priv, ctx, info->control.sta);
321− if (sta_id == IWL_INVALID_STATION) {
322− IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
323− hdr->addr1);
324− goto drop_unlock;
319+ /* For management frames use broadcast id to do not break aggregation */
320+ if (!ieee80211_is_data(fc))
321+ sta_id = ctx->bcast_sta_id;
322+ else {
323+ /* Find index into station table for destination station */
324+ sta_id = iwl_legacy_sta_id_or_broadcast(priv, ctx, info->control.sta);
325+
326+ if (sta_id == IWL_INVALID_STATION) {
327+ IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
328+ hdr->addr1);
329+ goto drop_unlock;
330+ }
325331 }
326332
327333 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id);
@@ -1127,12 +1133,16 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) · 799 unmodified lines
11271133 q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) {
11281134
11291135 tx_info = &txq->txb[txq->q.read_ptr];
1130− iwl4965_tx_status(priv, tx_info,
1131− txq_id >= IWL4965_FIRST_AMPDU_QUEUE);
1136+
1137+ if (WARN_ON_ONCE(tx_info->skb == NULL))
1138+ continue;
11321139
11331140 hdr = (struct ieee80211_hdr *)tx_info->skb->data;
1134− if (hdr && ieee80211_is_data_qos(hdr->frame_control))
1141+ if (ieee80211_is_data_qos(hdr->frame_control))
11351142 nfreed++;
1143+
1144+ iwl4965_tx_status(priv, tx_info,
1145+ txq_id >= IWL4965_FIRST_AMPDU_QUEUE);
11361146 tx_info->skb = NULL;
11371147
11381148 priv->cfg->ops->lib->txq_free_tfd(priv, txq);
drivers/net/wireless/iwlegacy/iwl-core.c+18−6
@@ -160,6 +160,7 @@ int iwl_legacy_init_geos(struct iwl_priv *priv) · 159 unmodified lines
160160 struct ieee80211_channel *geo_ch;
161161 struct ieee80211_rate *rates;
162162 int i = 0;
163+ s8 max_tx_power = 0;
163164
164165 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
165166 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
@@ -235,8 +236,8 @@ int iwl_legacy_init_geos(struct iwl_priv *priv) · 69 unmodified lines
235236
236237 geo_ch->flags |= ch->ht40_extension_channel;
237238
238− if (ch->max_power_avg > priv->tx_power_device_lmt)
239− priv->tx_power_device_lmt = ch->max_power_avg;
239+ if (ch->max_power_avg > max_tx_power)
240+ max_tx_power = ch->max_power_avg;
240241 } else {
241242 geo_ch->flags |= IEEE80211_CHAN_DISABLED;
242243 }
@@ -249,6 +250,10 @@ int iwl_legacy_init_geos(struct iwl_priv *priv) · 6 unmodified lines
249250 geo_ch->flags);
250251 }
251252
253+ priv->tx_power_device_lmt = max_tx_power;
254+ priv->tx_power_user_lmt = max_tx_power;
255+ priv->tx_power_next = max_tx_power;
256+
252257 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
253258 priv->cfg->sku & IWL_SKU_A) {
254259 IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
@@ -1124,11 +1129,11 @@ int iwl_legacy_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force) · 869 unmodified lines
11241129 if (!priv->cfg->ops->lib->send_tx_power)
11251130 return -EOPNOTSUPP;
11261131
1127− if (tx_power < IWL4965_TX_POWER_TARGET_POWER_MIN) {
1132+ /* 0 dBm mean 1 milliwatt */
1133+ if (tx_power < 0) {
11281134 IWL_WARN(priv,
1129− "Requested user TXPOWER %d below lower limit %d.\n",
1130− tx_power,
1131− IWL4965_TX_POWER_TARGET_POWER_MIN);
1135+ "Requested user TXPOWER %d below 1 mW.\n",
1136+ tx_power);
11321137 return -EINVAL;
11331138 }
11341139
@@ -2150,6 +2155,13 @@ int iwl_legacy_mac_config(struct ieee80211_hw *hw, u32 changed) · 1015 unmodified lines
21502155 goto set_ch_out;
21512156 }
21522157
2158+ if (priv->iw_mode == NL80211_IFTYPE_ADHOC &&
2159+ !iwl_legacy_is_channel_ibss(ch_info)) {
2160+ IWL_DEBUG_MAC80211(priv, "leave - not IBSS channel\n");
2161+ ret = -EINVAL;
2162+ goto set_ch_out;
2163+ }
2164+
21532165 spin_lock_irqsave(&priv->lock, flags);
21542166
21552167 for_each_context(priv, ctx) {
drivers/net/wireless/iwlegacy/iwl-dev.h+6−0
@@ -1411,6 +1411,12 @@ iwl_legacy_is_channel_passive(const struct iwl_channel_info *ch) · 1410 unmodified lines
14111411 return (!(ch->flags & EEPROM_CHANNEL_ACTIVE)) ? 1 : 0;
14121412 }
14131413
1414+static inline int
1415+iwl_legacy_is_channel_ibss(const struct iwl_channel_info *ch)
1416+{
1417+ return (ch->flags & EEPROM_CHANNEL_IBSS) ? 1 : 0;
1418+}
1419+
14141420 static inline void
14151421 __iwl_legacy_free_pages(struct iwl_priv *priv, struct page *page)
14161422 {
drivers/net/wireless/iwlegacy/iwl-eeprom.c+0−7
@@ -471,13 +471,6 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv) · 470 unmodified lines
471471 flags & EEPROM_CHANNEL_RADAR))
472472 ? "" : "not ");
473473
474− /* Set the tx_power_user_lmt to the highest power
475− * supported by any channel */
476− if (eeprom_ch_info[ch].max_power_avg >
477− priv->tx_power_user_lmt)
478− priv->tx_power_user_lmt =
479− eeprom_ch_info[ch].max_power_avg;
480−
481474 ch_info++;
482475 }
483476 }
drivers/net/wireless/iwlegacy/iwl-led.c+19−1
@@ -48,8 +48,21 @@ module_param(led_mode, int, S_IRUGO); · 47 unmodified lines
4848 MODULE_PARM_DESC(led_mode, "0=system default, "
4949 "1=On(RF On)/Off(RF Off), 2=blinking");
5050
51+/* Throughput OFF time(ms) ON time (ms)
52+ * >300 25 25
53+ * >200 to 300 40 40
54+ * >100 to 200 55 55
55+ * >70 to 100 65 65
56+ * >50 to 70 75 75
57+ * >20 to 50 85 85
58+ * >10 to 20 95 95
59+ * >5 to 10 110 110
60+ * >1 to 5 130 130
61+ * >0 to 1 167 167
62+ * <=0 SOLID ON
63+ */
5164 static const struct ieee80211_tpt_blink iwl_blink[] = {
52− { .throughput = 0 * 1024 - 1, .blink_time = 334 },
65+ { .throughput = 0, .blink_time = 334 },
5366 { .throughput = 1 * 1024 - 1, .blink_time = 260 },
5467 { .throughput = 5 * 1024 - 1, .blink_time = 220 },
5568 { .throughput = 10 * 1024 - 1, .blink_time = 190 },
@@ -101,6 +114,11 @@ static int iwl_legacy_led_cmd(struct iwl_priv *priv, · 45 unmodified lines
101114 if (priv->blink_on == on && priv->blink_off == off)
102115 return 0;
103116
117+ if (off == 0) {
118+ /* led is SOLID_ON */
119+ on = IWL_LED_SOLID;
120+ }
121+
104122 IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n",
105123 priv->cfg->base_params->led_compensation);
106124 led_cmd.on = iwl_legacy_blink_compensation(priv, on,
drivers/net/wireless/iwlegacy/iwl3945-base.c+0−4
@@ -3825,10 +3825,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv) · 3824 unmodified lines
38253825 priv->force_reset[IWL_FW_RESET].reset_duration =
38263826 IWL_DELAY_NEXT_FORCE_FW_RELOAD;
38273827
3828−
3829− priv->tx_power_user_lmt = IWL_DEFAULT_TX_POWER;
3830− priv->tx_power_next = IWL_DEFAULT_TX_POWER;
3831−
38323828 if (eeprom->version < EEPROM_3945_EEPROM_VERSION) {
38333829 IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n",
38343830 eeprom->version);
drivers/net/wireless/iwlegacy/iwl4965-base.c+4−10
@@ -2984,15 +2984,15 @@ static void iwl4965_bg_txpower_work(struct work_struct *work) · 2983 unmodified lines
29842984 struct iwl_priv *priv = container_of(work, struct iwl_priv,
29852985 txpower_work);
29862986
2987+ mutex_lock(&priv->mutex);
2988+
29872989 /* If a scan happened to start before we got here
29882990 * then just return; the statistics notification will
29892991 * kick off another scheduled work to compensate for
29902992 * any temperature delta we missed here. */
29912993 if (test_bit(STATUS_EXIT_PENDING, &priv->status) ||
29922994 test_bit(STATUS_SCANNING, &priv->status))
2993− return;
2994−
2995− mutex_lock(&priv->mutex);
2995+ goto out;
29962996
29972997 /* Regardless of if we are associated, we must reconfigure the
29982998 * TX power since frames can be sent on non-radar channels while
@@ -3002,7 +3002,7 @@ static void iwl4965_bg_txpower_work(struct work_struct *work) · 3 unmodified lines
30023002 /* Update last_temperature to keep is_calib_needed from running
30033003 * when it isn't needed... */
30043004 priv->last_temperature = priv->temperature;
3005−
3005+out:
30063006 mutex_unlock(&priv->mutex);
30073007 }
30083008
@@ -3140,12 +3140,6 @@ static int iwl4965_init_drv(struct iwl_priv *priv) · 131 unmodified lines
31403140
31413141 iwl_legacy_init_scan_params(priv);
31423142
3143− /* Set the tx_power_user_lmt to the lowest power level
3144− * this value will get overwritten by channel max power avg
3145− * from eeprom */
3146− priv->tx_power_user_lmt = IWL4965_TX_POWER_TARGET_POWER_MIN;
3147− priv->tx_power_next = IWL4965_TX_POWER_TARGET_POWER_MIN;
3148−
31493143 ret = iwl_legacy_init_channel_map(priv);
31503144 if (ret) {
31513145 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
drivers/net/wireless/iwlwifi/iwl-5000.c+3−0
@@ -530,6 +530,9 @@ static struct iwl_ht_params iwl5000_ht_params = { · 529 unmodified lines
530530 struct iwl_cfg iwl5300_agn_cfg = {
531531 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
532532 IWL_DEVICE_5000,
533+ /* at least EEPROM 0x11A has wrong info */
534+ .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
535+ .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
533536 .ht_params = &iwl5000_ht_params,
534537 };
535538
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c+1−6
@@ -335,7 +335,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) · 334 unmodified lines
335335 struct ieee80211_channel *channel = conf->channel;
336336 const struct iwl_channel_info *ch_info;
337337 int ret = 0;
338− bool ht_changed[NUM_IWL_RXON_CTX] = {};
339338
340339 IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
341340
@@ -383,10 +382,8 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) · 41 unmodified lines
383382
384383 for_each_context(priv, ctx) {
385384 /* Configure HT40 channels */
386− if (ctx->ht.enabled != conf_is_ht(conf)) {
385+ if (ctx->ht.enabled != conf_is_ht(conf))
387386 ctx->ht.enabled = conf_is_ht(conf);
388− ht_changed[ctx->ctxid] = true;
389− }
390387
391388 if (ctx->ht.enabled) {
392389 if (conf_is_ht40_minus(conf)) {
@@ -455,8 +452,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) · 62 unmodified lines
455452 if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
456453 continue;
457454 iwlagn_commit_rxon(priv, ctx);
458− if (ht_changed[ctx->ctxid])
459− iwlagn_update_qos(priv, ctx);
460455 }
461456 out:
462457 mutex_unlock(&priv->mutex);
drivers/net/wireless/iwlwifi/iwl-agn-tx.c+18−9
@@ -568,12 +568,17 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) · 567 unmodified lines
568568
569569 hdr_len = ieee80211_hdrlen(fc);
570570
571− /* Find index into station table for destination station */
572− sta_id = iwl_sta_id_or_broadcast(priv, ctx, info->control.sta);
573− if (sta_id == IWL_INVALID_STATION) {
574− IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
575− hdr->addr1);
576− goto drop_unlock;
571+ /* For management frames use broadcast id to do not break aggregation */
572+ if (!ieee80211_is_data(fc))
573+ sta_id = ctx->bcast_sta_id;
574+ else {
575+ /* Find index into station table for destination station */
576+ sta_id = iwl_sta_id_or_broadcast(priv, ctx, info->control.sta);
577+ if (sta_id == IWL_INVALID_STATION) {
578+ IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
579+ hdr->addr1);
580+ goto drop_unlock;
581+ }
577582 }
578583
579584 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id);
@@ -1224,12 +1229,16 @@ int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) · 644 unmodified lines
12241229 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
12251230
12261231 tx_info = &txq->txb[txq->q.read_ptr];
1227− iwlagn_tx_status(priv, tx_info,
1228− txq_id >= IWLAGN_FIRST_AMPDU_QUEUE);
1232+
1233+ if (WARN_ON_ONCE(tx_info->skb == NULL))
1234+ continue;
12291235
12301236 hdr = (struct ieee80211_hdr *)tx_info->skb->data;
1231− if (hdr && ieee80211_is_data_qos(hdr->frame_control))
1237+ if (ieee80211_is_data_qos(hdr->frame_control))
12321238 nfreed++;
1239+
1240+ iwlagn_tx_status(priv, tx_info,
1241+ txq_id >= IWLAGN_FIRST_AMPDU_QUEUE);
12331242 tx_info->skb = NULL;
12341243
12351244 if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)
drivers/net/wireless/libertas/cmd.c+4−2
@@ -1339,8 +1339,8 @@ int lbs_execute_next_command(struct lbs_private *priv) · 1338 unmodified lines
13391339 cpu_to_le16(PS_MODE_ACTION_EXIT_PS)) {
13401340 lbs_deb_host(
13411341 "EXEC_NEXT_CMD: ignore ENTER_PS cmd\n");
1342− list_del(&cmdnode->list);
13431342 spin_lock_irqsave(&priv->driver_lock, flags);
1343+ list_del(&cmdnode->list);
13441344 lbs_complete_command(priv, cmdnode, 0);
13451345 spin_unlock_irqrestore(&priv->driver_lock, flags);
13461346
@@ -1352,8 +1352,8 @@ int lbs_execute_next_command(struct lbs_private *priv) · 5 unmodified lines
13521352 (priv->psstate == PS_STATE_PRE_SLEEP)) {
13531353 lbs_deb_host(
13541354 "EXEC_NEXT_CMD: ignore EXIT_PS cmd in sleep\n");
1355− list_del(&cmdnode->list);
13561355 spin_lock_irqsave(&priv->driver_lock, flags);
1356+ list_del(&cmdnode->list);
13571357 lbs_complete_command(priv, cmdnode, 0);
13581358 spin_unlock_irqrestore(&priv->driver_lock, flags);
13591359 priv->needtowakeup = 1;
@@ -1366,7 +1366,9 @@ int lbs_execute_next_command(struct lbs_private *priv) · 6 unmodified lines
13661366 "EXEC_NEXT_CMD: sending EXIT_PS\n");
13671367 }
13681368 }
1369+ spin_lock_irqsave(&priv->driver_lock, flags);
13691370 list_del(&cmdnode->list);
1371+ spin_unlock_irqrestore(&priv->driver_lock, flags);
13701372 lbs_deb_host("EXEC_NEXT_CMD: sending command 0x%04x\n",
13711373 le16_to_cpu(cmd->command));
13721374 lbs_submit_command(priv, cmdnode);
drivers/net/wireless/mwl8k.c+8−1
@@ -137,6 +137,7 @@ struct mwl8k_tx_queue { · 136 unmodified lines
137137 struct mwl8k_priv {
138138 struct ieee80211_hw *hw;
139139 struct pci_dev *pdev;
140+ int irq;
140141
141142 struct mwl8k_device_info *device_info;
142143
@@ -3761,9 +3762,11 @@ static int mwl8k_start(struct ieee80211_hw *hw) · 3618 unmodified lines
37613762 rc = request_irq(priv->pdev->irq, mwl8k_interrupt,
37623763 IRQF_SHARED, MWL8K_NAME, hw);
37633764 if (rc) {
3765+ priv->irq = -1;
37643766 wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
37653767 return -EIO;
37663768 }
3769+ priv->irq = priv->pdev->irq;
37673770
37683771 /* Enable TX reclaim and RX tasklets. */
37693772 tasklet_enable(&priv->poll_tx_task);
@@ -3800,6 +3803,7 @@ static int mwl8k_start(struct ieee80211_hw *hw) · 30 unmodified lines
38003803 if (rc) {
38013804 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK);
38023805 free_irq(priv->pdev->irq, hw);
3806+ priv->irq = -1;
38033807 tasklet_disable(&priv->poll_tx_task);
38043808 tasklet_disable(&priv->poll_rx_task);
38053809 }
@@ -3818,7 +3822,10 @@ static void mwl8k_stop(struct ieee80211_hw *hw) · 12 unmodified lines
38183822
38193823 /* Disable interrupts */
38203824 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK);
3821− free_irq(priv->pdev->irq, hw);
3825+ if (priv->irq != -1) {
3826+ free_irq(priv->pdev->irq, hw);
3827+ priv->irq = -1;
3828+ }
38223829
38233830 /* Stop finalize join worker */
38243831 cancel_work_sync(&priv->finalize_join_worker);
drivers/net/wireless/p54/txrx.c+1−1
@@ -703,7 +703,7 @@ void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb) · 702 unmodified lines
703703 struct p54_tx_info *p54info;
704704 struct p54_hdr *hdr;
705705 struct p54_tx_data *txhdr;
706− unsigned int padding, len, extra_len;
706+ unsigned int padding, len, extra_len = 0;
707707 int i, j, ridx;
708708 u16 hdr_flags = 0, aid = 0;
709709 u8 rate, queue = 0, crypt_offset = 0;
drivers/net/zorro8390.c+6−6
@@ -126,7 +126,7 @@ static int __devinit zorro8390_init_one(struct zorro_dev *z, · 125 unmodified lines
126126
127127 board = z->resource.start;
128128 ioaddr = board+cards[i].offset;
129− dev = alloc_ei_netdev();
129+ dev = ____alloc_ei_netdev(0);
130130 if (!dev)
131131 return -ENOMEM;
132132 if (!request_mem_region(ioaddr, NE_IO_EXTENT*2, DRV_NAME)) {
@@ -146,15 +146,15 @@ static int __devinit zorro8390_init_one(struct zorro_dev *z, · 13 unmodified lines
146146 static const struct net_device_ops zorro8390_netdev_ops = {
147147 .ndo_open = zorro8390_open,
148148 .ndo_stop = zorro8390_close,
149− .ndo_start_xmit = ei_start_xmit,
150− .ndo_tx_timeout = ei_tx_timeout,
151− .ndo_get_stats = ei_get_stats,
152− .ndo_set_multicast_list = ei_set_multicast_list,
149+ .ndo_start_xmit = __ei_start_xmit,
150+ .ndo_tx_timeout = __ei_tx_timeout,
151+ .ndo_get_stats = __ei_get_stats,
152+ .ndo_set_multicast_list = __ei_set_multicast_list,
153153 .ndo_validate_addr = eth_validate_addr,
154154 .ndo_set_mac_address = eth_mac_addr,
155155 .ndo_change_mtu = eth_change_mtu,
156156 #ifdef CONFIG_NET_POLL_CONTROLLER
157− .ndo_poll_controller = ei_poll,
157+ .ndo_poll_controller = __ei_poll,
158158 #endif
159159 };
160160
drivers/parport/parport_pc.c+3−5
@@ -2550,7 +2550,6 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, · 2549 unmodified lines
25502550 const struct parport_pc_via_data *via)
25512551 {
25522552 short inta_addr[6] = { 0x2A0, 0x2C0, 0x220, 0x240, 0x1E0 };
2553− struct resource *base_res;
25542553 u32 ite8872set;
25552554 u32 ite8872_lpt, ite8872_lpthi;
25562555 u8 ite8872_irq, type;
@@ -2561,8 +2560,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, · 4 unmodified lines
25612560
25622561 /* make sure which one chip */
25632562 for (i = 0; i < 5; i++) {
2564− base_res = request_region(inta_addr[i], 32, "it887x");
2565− if (base_res) {
2563+ if (request_region(inta_addr[i], 32, "it887x")) {
25662564 int test;
25672565 pci_write_config_dword(pdev, 0x60,
25682566 0xe5000000 | inta_addr[i]);
@@ -2571,7 +2569,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, · 2 unmodified lines
25712569 test = inb(inta_addr[i]);
25722570 if (test != 0xff)
25732571 break;
2574− release_region(inta_addr[i], 0x8);
2572+ release_region(inta_addr[i], 32);
25752573 }
25762574 }
25772575 if (i >= 5) {
@@ -2635,7 +2633,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq, · 57 unmodified lines
26352633 /*
26362634 * Release the resource so that parport_pc_probe_port can get it.
26372635 */
2638− release_resource(base_res);
2636+ release_region(inta_addr[i], 32);
26392637 if (parport_pc_probe_port(ite8872_lpt, ite8872_lpthi,
26402638 irq, PARPORT_DMA_NONE, &pdev->dev, 0)) {
26412639 printk(KERN_INFO
drivers/pci/Kconfig+3−1
@@ -88,4 +88,6 @@ config PCI_IOAPIC · 87 unmodified lines
8888 depends on HOTPLUG
8989 default y
9090
91−select NLS if (DMI || ACPI)
91+config PCI_LABEL
92+ def_bool y if (DMI || ACPI)
93+ select NLS
drivers/pci/Makefile+2−2
@@ -56,10 +56,10 @@ obj-$(CONFIG_TILE) += setup-bus.o setup-irq.o · 55 unmodified lines
5656 # ACPI Related PCI FW Functions
5757 # ACPI _DSM provided firmware instance and string name
5858 #
59−obj-$(CONFIG_ACPI) += pci-acpi.o pci-label.o
59+obj-$(CONFIG_ACPI) += pci-acpi.o
6060
6161 # SMBIOS provided firmware instance and labels
62−obj-$(CONFIG_DMI) += pci-label.o
62+obj-$(CONFIG_PCI_LABEL) += pci-label.o
6363
6464 # Cardbus & CompactPCI use setup-bus
6565 obj-$(CONFIG_HOTPLUG) += setup-bus.o
drivers/pci/intel-iommu.c+43−12
@@ -1299,7 +1299,7 @@ static void iommu_detach_domain(struct dmar_domain *domain, · 1298 unmodified lines
12991299 static struct iova_domain reserved_iova_list;
13001300 static struct lock_class_key reserved_rbtree_key;
13011301
1302−static void dmar_init_reserved_ranges(void)
1302+static int dmar_init_reserved_ranges(void)
13031303 {
13041304 struct pci_dev *pdev = NULL;
13051305 struct iova *iova;
@@ -1313,8 +1313,10 @@ static void dmar_init_reserved_ranges(void) · 7 unmodified lines
13131313 /* IOAPIC ranges shouldn't be accessed by DMA */
13141314 iova = reserve_iova(&reserved_iova_list, IOVA_PFN(IOAPIC_RANGE_START),
13151315 IOVA_PFN(IOAPIC_RANGE_END));
1316− if (!iova)
1316+ if (!iova) {
13171317 printk(KERN_ERR "Reserve IOAPIC range failed\n");
1318+ return -ENODEV;
1319+ }
13181320
13191321 /* Reserve all PCI MMIO to avoid peer-to-peer access */
13201322 for_each_pci_dev(pdev) {
@@ -1327,11 +1329,13 @@ static void dmar_init_reserved_ranges(void) · 6 unmodified lines
13271329 iova = reserve_iova(&reserved_iova_list,
13281330 IOVA_PFN(r->start),
13291331 IOVA_PFN(r->end));
1330− if (!iova)
1332+ if (!iova) {
13311333 printk(KERN_ERR "Reserve iova failed\n");
1334+ return -ENODEV;
1335+ }
13321336 }
13331337 }
1334−
1338+ return 0;
13351339 }
13361340
13371341 static void domain_reserve_special_ranges(struct dmar_domain *domain)
@@ -1835,7 +1839,7 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw) · 497 unmodified lines
18351839
18361840 ret = iommu_attach_domain(domain, iommu);
18371841 if (ret) {
1838− domain_exit(domain);
1842+ free_domain_mem(domain);
18391843 goto error;
18401844 }
18411845
@@ -2213,7 +2217,7 @@ static int __init iommu_prepare_static_identity_mapping(int hw) · 371 unmodified lines
22132217 return 0;
22142218 }
22152219
2216−int __init init_dmars(void)
2220+static int __init init_dmars(int force_on)
22172221 {
22182222 struct dmar_drhd_unit *drhd;
22192223 struct dmar_rmrr_unit *rmrr;
@@ -2393,8 +2397,15 @@ int __init init_dmars(void) · 173 unmodified lines
23932397 * enable translation
23942398 */
23952399 for_each_drhd_unit(drhd) {
2396− if (drhd->ignored)
2400+ if (drhd->ignored) {
2401+ /*
2402+ * we always have to disable PMRs or DMA may fail on
2403+ * this device
2404+ */
2405+ if (force_on)
2406+ iommu_disable_protect_mem_regions(drhd->iommu);
23972407 continue;
2408+ }
23982409 iommu = drhd->iommu;
23992410
24002411 iommu_flush_write_buffer(iommu);
@@ -3240,9 +3251,15 @@ static int device_notifier(struct notifier_block *nb, · 839 unmodified lines
32403251 if (!domain)
32413252 return 0;
32423253
3243− if (action == BUS_NOTIFY_UNBOUND_DRIVER && !iommu_pass_through)
3254+ if (action == BUS_NOTIFY_UNBOUND_DRIVER && !iommu_pass_through) {
32443255 domain_remove_one_dev_info(domain, pdev);
32453256
3257+ if (!(domain->flags & DOMAIN_FLAG_VIRTUAL_MACHINE) &&
3258+ !(domain->flags & DOMAIN_FLAG_STATIC_IDENTITY) &&
3259+ list_empty(&domain->devices))
3260+ domain_exit(domain);
3261+ }
3262+
32463263 return 0;
32473264 }
32483265
@@ -3277,12 +3294,21 @@ int __init intel_iommu_init(void) · 28 unmodified lines
32773294 if (no_iommu || dmar_disabled)
32783295 return -ENODEV;
32793296
3280− iommu_init_mempool();
3281− dmar_init_reserved_ranges();
3297+ if (iommu_init_mempool()) {
3298+ if (force_on)
3299+ panic("tboot: Failed to initialize iommu memory\n");
3300+ return -ENODEV;
3301+ }
3302+
3303+ if (dmar_init_reserved_ranges()) {
3304+ if (force_on)
3305+ panic("tboot: Failed to reserve iommu ranges\n");
3306+ return -ENODEV;
3307+ }
32823308
32833309 init_no_remapping_devices();
32843310
3285− ret = init_dmars();
3311+ ret = init_dmars(force_on);
32863312 if (ret) {
32873313 if (force_on)
32883314 panic("tboot: Failed to initialize DMARs\n");
@@ -3391,6 +3417,11 @@ static void domain_remove_one_dev_info(struct dmar_domain *domain, · 102 unmodified lines
33913417 domain->iommu_count--;
33923418 domain_update_iommu_cap(domain);
33933419 spin_unlock_irqrestore(&domain->iommu_lock, tmp_flags);
3420+
3421+ spin_lock_irqsave(&iommu->lock, tmp_flags);
3422+ clear_bit(domain->id, iommu->domain_ids);
3423+ iommu->domains[domain->id] = NULL;
3424+ spin_unlock_irqrestore(&iommu->lock, tmp_flags);
33943425 }
33953426
33963427 spin_unlock_irqrestore(&device_domain_lock, flags);
@@ -3607,9 +3638,9 @@ static int intel_iommu_attach_device(struct iommu_domain *domain, · 210 unmodified lines
36073638
36083639 pte = dmar_domain->pgd;
36093640 if (dma_pte_present(pte)) {
3610− free_pgtable_page(dmar_domain->pgd);
36113641 dmar_domain->pgd = (struct dma_pte *)
36123642 phys_to_virt(dma_pte_addr(pte));
3643+ free_pgtable_page(pte);
36133644 }
36143645 dmar_domain->agaw--;
36153646 }
drivers/pci/setup-bus.c+2−2
@@ -579,7 +579,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size, · 578 unmodified lines
579579 }
580580 size0 = calculate_iosize(size, min_size, size1,
581581 resource_size(b_res), 4096);
582− size1 = !add_size? size0:
582+ size1 = (!add_head || (add_head && !add_size)) ? size0 :
583583 calculate_iosize(size, min_size+add_size, size1,
584584 resource_size(b_res), 4096);
585585 if (!size0 && !size1) {
@@ -677,7 +677,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, · 91 unmodified lines
677677 align += aligns[order];
678678 }
679679 size0 = calculate_memsize(size, min_size, 0, resource_size(b_res), min_align);
680− size1 = !add_size ? size :
680+ size1 = (!add_head || (add_head && !add_size)) ? size0 :
681681 calculate_memsize(size, min_size+add_size, 0,
682682 resource_size(b_res), min_align);
683683 if (!size0 && !size1) {
drivers/pcmcia/pcmcia_resource.c+1−1
@@ -173,7 +173,7 @@ static int pcmcia_access_config(struct pcmcia_device *p_dev, · 172 unmodified lines
173173 c = p_dev->function_config;
174174
175175 if (!(c->state & CONFIG_LOCKED)) {
176− dev_dbg(&p_dev->dev, "Configuration isn't't locked\n");
176+ dev_dbg(&p_dev->dev, "Configuration isn't locked\n");
177177 mutex_unlock(&s->ops_mutex);
178178 return -EACCES;
179179 }
drivers/platform/x86/eeepc-laptop.c+41−16
@@ -585,8 +585,9 @@ static bool eeepc_wlan_rfkill_blocked(struct eeepc_laptop *eeepc) · 584 unmodified lines
585585 return true;
586586 }
587587
588−static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc)
588+static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
589589 {
590+ struct pci_dev *port;
590591 struct pci_dev *dev;
591592 struct pci_bus *bus;
592593 bool blocked = eeepc_wlan_rfkill_blocked(eeepc);
@@ -599,9 +600,16 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc) · 6 unmodified lines
599600 mutex_lock(&eeepc->hotplug_lock);
600601
601602 if (eeepc->hotplug_slot) {
602− bus = pci_find_bus(0, 1);
603+ port = acpi_get_pci_dev(handle);
604+ if (!port) {
605+ pr_warning("Unable to find port\n");
606+ goto out_unlock;
607+ }
608+
609+ bus = port->subordinate;
610+
603611 if (!bus) {
604− pr_warning("Unable to find PCI bus 1?\n");
612+ pr_warning("Unable to find PCI bus?\n");
605613 goto out_unlock;
606614 }
607615
@@ -609,6 +617,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc) · 1 unmodified line
609617 pr_err("Unable to read PCI config space?\n");
610618 goto out_unlock;
611619 }
620+
612621 absent = (l == 0xffffffff);
613622
614623 if (blocked != absent) {
@@ -647,6 +656,17 @@ out_unlock: · 32 unmodified lines
647656 mutex_unlock(&eeepc->hotplug_lock);
648657 }
649658
659+static void eeepc_rfkill_hotplug_update(struct eeepc_laptop *eeepc, char *node)
660+{
661+ acpi_status status = AE_OK;
662+ acpi_handle handle;
663+
664+ status = acpi_get_handle(NULL, node, &handle);
665+
666+ if (ACPI_SUCCESS(status))
667+ eeepc_rfkill_hotplug(eeepc, handle);
668+}
669+
650670 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
651671 {
652672 struct eeepc_laptop *eeepc = data;
@@ -654,7 +674,7 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data) · 1 unmodified line
654674 if (event != ACPI_NOTIFY_BUS_CHECK)
655675 return;
656676
657− eeepc_rfkill_hotplug(eeepc);
677+ eeepc_rfkill_hotplug(eeepc, handle);
658678 }
659679
660680 static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,
@@ -672,6 +692,11 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc, · 11 unmodified lines
672692 eeepc);
673693 if (ACPI_FAILURE(status))
674694 pr_warning("Failed to register notify on %s\n", node);
695+ /*
696+ * Refresh pci hotplug in case the rfkill state was
697+ * changed during setup.
698+ */
699+ eeepc_rfkill_hotplug(eeepc, handle);
675700 } else
676701 return -ENODEV;
677702
@@ -693,6 +718,12 @@ static void eeepc_unregister_rfkill_notifier(struct eeepc_laptop *eeepc, · 15 unmodified lines
693718 if (ACPI_FAILURE(status))
694719 pr_err("Error removing rfkill notify handler %s\n",
695720 node);
721+ /*
722+ * Refresh pci hotplug in case the rfkill
723+ * state was changed after
724+ * eeepc_unregister_rfkill_notifier()
725+ */
726+ eeepc_rfkill_hotplug(eeepc, handle);
696727 }
697728 }
698729
@@ -816,11 +847,7 @@ static void eeepc_rfkill_exit(struct eeepc_laptop *eeepc) · 117 unmodified lines
816847 rfkill_destroy(eeepc->wlan_rfkill);
817848 eeepc->wlan_rfkill = NULL;
818849 }
819− /*
820− * Refresh pci hotplug in case the rfkill state was changed after
821− * eeepc_unregister_rfkill_notifier()
822− */
823− eeepc_rfkill_hotplug(eeepc);
850+
824851 if (eeepc->hotplug_slot)
825852 pci_hp_deregister(eeepc->hotplug_slot);
826853
@@ -889,11 +916,6 @@ static int eeepc_rfkill_init(struct eeepc_laptop *eeepc) · 62 unmodified lines
889916 eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5");
890917 eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6");
891918 eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7");
892− /*
893− * Refresh pci hotplug in case the rfkill state was changed during
894− * setup.
895− */
896− eeepc_rfkill_hotplug(eeepc);
897919
898920 exit:
899921 if (result && result != -ENODEV)
@@ -928,8 +950,11 @@ static int eeepc_hotk_restore(struct device *device) · 28 unmodified lines
928950 struct eeepc_laptop *eeepc = dev_get_drvdata(device);
929951
930952 /* Refresh both wlan rfkill state and pci hotplug */
931− if (eeepc->wlan_rfkill)
932− eeepc_rfkill_hotplug(eeepc);
953+ if (eeepc->wlan_rfkill) {
954+ eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P5");
955+ eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P6");
956+ eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P7");
957+ }
933958
934959 if (eeepc->bluetooth_rfkill)
935960 rfkill_set_sw_state(eeepc->bluetooth_rfkill,
drivers/platform/x86/sony-laptop.c+105−25
@@ -934,6 +934,14 @@ static ssize_t sony_nc_sysfs_store(struct device *dev, · 933 unmodified lines
934934 /*
935935 * Backlight device
936936 */
937+struct sony_backlight_props {
938+ struct backlight_device *dev;
939+ int handle;
940+ u8 offset;
941+ u8 maxlvl;
942+};
943+struct sony_backlight_props sony_bl_props;
944+
937945 static int sony_backlight_update_status(struct backlight_device *bd)
938946 {
939947 return acpi_callsetfunc(sony_nc_acpi_handle, "SBRT",
@@ -954,21 +962,26 @@ static int sony_nc_get_brightness_ng(struct backlight_device *bd) · 14 unmodified lines
954962 {
955963 int result;
956964 int *handle = (int *)bl_get_data(bd);
965+ struct sony_backlight_props *sdev =
966+ (struct sony_backlight_props *)bl_get_data(bd);
957967
958− sony_call_snc_handle(*handle, 0x0200, &result);
968+ sony_call_snc_handle(sdev->handle, 0x0200, &result);
959969
960− return result & 0xff;
970+ return (result & 0xff) - sdev->offset;
961971 }
962972
963973 static int sony_nc_update_status_ng(struct backlight_device *bd)
964974 {
965975 int value, result;
966976 int *handle = (int *)bl_get_data(bd);
977+ struct sony_backlight_props *sdev =
978+ (struct sony_backlight_props *)bl_get_data(bd);
967979
968− value = bd->props.brightness;
969− sony_call_snc_handle(*handle, 0x0100 | (value << 16), &result);
980+ value = bd->props.brightness + sdev->offset;
981+ if (sony_call_snc_handle(sdev->handle, 0x0100 | (value << 16), &result))
982+ return -EIO;
970983
971− return sony_nc_get_brightness_ng(bd);
984+ return value;
972985 }
973986
974987 static const struct backlight_ops sony_backlight_ops = {
@@ -981,8 +994,6 @@ static const struct backlight_ops sony_backlight_ng_ops = { · 6 unmodified lines
981994 .update_status = sony_nc_update_status_ng,
982995 .get_brightness = sony_nc_get_brightness_ng,
983996 };
984−static int backlight_ng_handle;
985−static struct backlight_device *sony_backlight_device;
986997
987998 /*
988999 * New SNC-only Vaios event mapping to driver known keys
@@ -1549,6 +1560,75 @@ static void sony_nc_kbd_backlight_resume(void) · 560 unmodified lines
15491560 &ignore);
15501561 }
15511562
1563+static void sony_nc_backlight_ng_read_limits(int handle,
1564+ struct sony_backlight_props *props)
1565+{
1566+ int offset;
1567+ acpi_status status;
1568+ u8 brlvl, i;
1569+ u8 min = 0xff, max = 0x00;
1570+ struct acpi_object_list params;
1571+ union acpi_object in_obj;
1572+ union acpi_object *lvl_enum;
1573+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
1574+
1575+ props->handle = handle;
1576+ props->offset = 0;
1577+ props->maxlvl = 0xff;
1578+
1579+ offset = sony_find_snc_handle(handle);
1580+ if (offset < 0)
1581+ return;
1582+
1583+ /* try to read the boundaries from ACPI tables, if we fail the above
1584+ * defaults should be reasonable
1585+ */
1586+ params.count = 1;
1587+ params.pointer = &in_obj;
1588+ in_obj.type = ACPI_TYPE_INTEGER;
1589+ in_obj.integer.value = offset;
1590+ status = acpi_evaluate_object(sony_nc_acpi_handle, "SN06", &params,
1591+ &buffer);
1592+ if (ACPI_FAILURE(status))
1593+ return;
1594+
1595+ lvl_enum = (union acpi_object *) buffer.pointer;
1596+ if (!lvl_enum) {
1597+ pr_err("No SN06 return object.");
1598+ return;
1599+ }
1600+ if (lvl_enum->type != ACPI_TYPE_BUFFER) {
1601+ pr_err("Invalid SN06 return object 0x%.2x\n",
1602+ lvl_enum->type);
1603+ goto out_invalid;
1604+ }
1605+
1606+ /* the buffer lists brightness levels available, brightness levels are
1607+ * from 0 to 8 in the array, other values are used by ALS control.
1608+ */
1609+ for (i = 0; i < 9 && i < lvl_enum->buffer.length; i++) {
1610+
1611+ brlvl = *(lvl_enum->buffer.pointer + i);
1612+ dprintk("Brightness level: %d\n", brlvl);
1613+
1614+ if (!brlvl)
1615+ break;
1616+
1617+ if (brlvl > max)
1618+ max = brlvl;
1619+ if (brlvl < min)
1620+ min = brlvl;
1621+ }
1622+ props->offset = min;
1623+ props->maxlvl = max;
1624+ dprintk("Brightness levels: min=%d max=%d\n", props->offset,
1625+ props->maxlvl);
1626+
1627+out_invalid:
1628+ kfree(buffer.pointer);
1629+ return;
1630+}
1631+
15521632 static void sony_nc_backlight_setup(void)
15531633 {
15541634 acpi_handle unused;
@@ -1557,14 +1637,14 @@ static void sony_nc_backlight_setup(void) · 2 unmodified lines
15571637 struct backlight_properties props;
15581638
15591639 if (sony_find_snc_handle(0x12f) != -1) {
1560− backlight_ng_handle = 0x12f;
15611640 ops = &sony_backlight_ng_ops;
1562− max_brightness = 0xff;
1641+ sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props);
1642+ max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset;
15631643
15641644 } else if (sony_find_snc_handle(0x137) != -1) {
1565− backlight_ng_handle = 0x137;
15661645 ops = &sony_backlight_ng_ops;
1567− max_brightness = 0xff;
1646+ sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props);
1647+ max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset;
15681648
15691649 } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT",
15701650 &unused))) {
@@ -1577,22 +1657,22 @@ static void sony_nc_backlight_setup(void) · 6 unmodified lines
15771657 memset(&props, 0, sizeof(struct backlight_properties));
15781658 props.type = BACKLIGHT_PLATFORM;
15791659 props.max_brightness = max_brightness;
1580− sony_backlight_device = backlight_device_register("sony", NULL,
1581− &backlight_ng_handle,
1582− ops, &props);
1660+ sony_bl_props.dev = backlight_device_register("sony", NULL,
1661+ &sony_bl_props,
1662+ ops, &props);
15831663
1584− if (IS_ERR(sony_backlight_device)) {
1585− pr_warning(DRV_PFX "unable to register backlight device\n");
1586− sony_backlight_device = NULL;
1664+ if (IS_ERR(sony_bl_props.dev)) {
1665+ pr_warn(DRV_PFX "unable to register backlight device\n");
1666+ sony_bl_props.dev = NULL;
15871667 } else
1588− sony_backlight_device->props.brightness =
1589− ops->get_brightness(sony_backlight_device);
1668+ sony_bl_props.dev->props.brightness =
1669+ ops->get_brightness(sony_bl_props.dev);
15901670 }
15911671
15921672 static void sony_nc_backlight_cleanup(void)
15931673 {
1594− if (sony_backlight_device)
1595− backlight_device_unregister(sony_backlight_device);
1674+ if (sony_bl_props.dev)
1675+ backlight_device_unregister(sony_bl_props.dev);
15961676 }
15971677
15981678 static int sony_nc_add(struct acpi_device *device)
@@ -2590,7 +2670,7 @@ static long sonypi_misc_ioctl(struct file *fp, unsigned int cmd, · 991 unmodified lines
25902670 mutex_lock(&spic_dev.lock);
25912671 switch (cmd) {
25922672 case SONYPI_IOCGBRT:
2593− if (sony_backlight_device == NULL) {
2673+ if (sony_bl_props.dev == NULL) {
25942674 ret = -EIO;
25952675 break;
25962676 }
@@ -2603,7 +2683,7 @@ static long sonypi_misc_ioctl(struct file *fp, unsigned int cmd, · 6 unmodified lines
26032683 ret = -EFAULT;
26042684 break;
26052685 case SONYPI_IOCSBRT:
2606− if (sony_backlight_device == NULL) {
2686+ if (sony_bl_props.dev == NULL) {
26072687 ret = -EIO;
26082688 break;
26092689 }
@@ -2617,8 +2697,8 @@ static long sonypi_misc_ioctl(struct file *fp, unsigned int cmd, · 7 unmodified lines
26172697 break;
26182698 }
26192699 /* sync the backlight device status */
2620− sony_backlight_device->props.brightness =
2621− sony_backlight_get_brightness(sony_backlight_device);
2700+ sony_bl_props.dev->props.brightness =
2701+ sony_backlight_get_brightness(sony_bl_props.dev);
26222702 break;
26232703 case SONYPI_IOCGBAT1CAP:
26242704 if (ec_read16(SONYPI_BAT1_FULL, &val16)) {
drivers/platform/x86/thinkpad_acpi.c+4−2
@@ -128,7 +128,8 @@ enum { · 127 unmodified lines
128128 };
129129
130130 /* ACPI HIDs */
131−#define TPACPI_ACPI_HKEY_HID "IBM0068"
131+#define TPACPI_ACPI_IBM_HKEY_HID "IBM0068"
132+#define TPACPI_ACPI_LENOVO_HKEY_HID "LEN0068"
132133 #define TPACPI_ACPI_EC_HID "PNP0C09"
133134
134135 /* Input IDs */
@@ -3879,7 +3880,8 @@ errexit: · 3744 unmodified lines
38793880 }
38803881
38813882 static const struct acpi_device_id ibm_htk_device_ids[] = {
3882− {TPACPI_ACPI_HKEY_HID, 0},
3883+ {TPACPI_ACPI_IBM_HKEY_HID, 0},
3884+ {TPACPI_ACPI_LENOVO_HKEY_HID, 0},
38833885 {"", 0},
38843886 };
38853887
drivers/rapidio/switches/idt_gen2.c+9−0
@@ -95,6 +95,9 @@ idtg2_route_add_entry(struct rio_mport *mport, u16 destid, u8 hopcount, · 94 unmodified lines
9595 else
9696 table++;
9797
98+ if (route_port == RIO_INVALID_ROUTE)
99+ route_port = IDT_DEFAULT_ROUTE;
100+
98101 rio_mport_write_config_32(mport, destid, hopcount,
99102 LOCAL_RTE_CONF_DESTID_SEL, table);
100103
@@ -411,6 +414,12 @@ static int idtg2_switch_init(struct rio_dev *rdev, int do_enum) · 310 unmodified lines
411414 rdev->rswitch->em_handle = idtg2_em_handler;
412415 rdev->rswitch->sw_sysfs = idtg2_sysfs;
413416
417+ if (do_enum) {
418+ /* Ensure that default routing is disabled on startup */
419+ rio_write_config_32(rdev,
420+ RIO_STD_RTE_DEFAULT_PORT, IDT_NO_ROUTE);
421+ }
422+
414423 return 0;
415424 }
416425
drivers/rapidio/switches/idtcps.c+6−0
@@ -26,6 +26,9 @@ idtcps_route_add_entry(struct rio_mport *mport, u16 destid, u8 hopcount, · 25 unmodified lines
2626 {
2727 u32 result;
2828
29+ if (route_port == RIO_INVALID_ROUTE)
30+ route_port = CPS_DEFAULT_ROUTE;
31+
2932 if (table == RIO_GLOBAL_TABLE) {
3033 rio_mport_write_config_32(mport, destid, hopcount,
3134 RIO_STD_RTE_CONF_DESTID_SEL_CSR, route_destid);
@@ -130,6 +133,9 @@ static int idtcps_switch_init(struct rio_dev *rdev, int do_enum) · 98 unmodified lines
130133 /* set TVAL = ~50us */
131134 rio_write_config_32(rdev,
132135 rdev->phys_efptr + RIO_PORT_LINKTO_CTL_CSR, 0x8e << 8);
136+ /* Ensure that default routing is disabled on startup */
137+ rio_write_config_32(rdev,
138+ RIO_STD_RTE_DEFAULT_PORT, CPS_NO_ROUTE);
133139 }
134140
135141 return 0;
drivers/rapidio/switches/tsi57x.c+6−0
@@ -303,6 +303,12 @@ static int tsi57x_switch_init(struct rio_dev *rdev, int do_enum) · 302 unmodified lines
303303 rdev->rswitch->em_init = tsi57x_em_init;
304304 rdev->rswitch->em_handle = tsi57x_em_handler;
305305
306+ if (do_enum) {
307+ /* Ensure that default routing is disabled on startup */
308+ rio_write_config_32(rdev, RIO_STD_RTE_DEFAULT_PORT,
309+ RIO_INVALID_ROUTE);
310+ }
311+
306312 return 0;
307313 }
308314
drivers/rtc/rtc-coh901331.c+2−2
@@ -220,6 +220,7 @@ static int __init coh901331_probe(struct platform_device *pdev) · 219 unmodified lines
220220 }
221221 clk_disable(rtap->clk);
222222
223+ platform_set_drvdata(pdev, rtap);
223224 rtap->rtc = rtc_device_register("coh901331", &pdev->dev, &coh901331_ops,
224225 THIS_MODULE);
225226 if (IS_ERR(rtap->rtc)) {
@@ -227,11 +228,10 @@ static int __init coh901331_probe(struct platform_device *pdev) · 1 unmodified line
227228 goto out_no_rtc;
228229 }
229230
230− platform_set_drvdata(pdev, rtap);
231−
232231 return 0;
233232
234233 out_no_rtc:
234+ platform_set_drvdata(pdev, NULL);
235235 out_no_clk_enable:
236236 clk_put(rtap->clk);
237237 out_no_clk:
drivers/rtc/rtc-davinci.c+3−2
@@ -524,6 +524,8 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) · 523 unmodified lines
524524 goto fail2;
525525 }
526526
527+ platform_set_drvdata(pdev, davinci_rtc);
528+
527529 davinci_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
528530 &davinci_rtc_ops, THIS_MODULE);
529531 if (IS_ERR(davinci_rtc->rtc)) {
@@ -553,8 +555,6 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) · 23 unmodified lines
553555
554556 rtcss_write(davinci_rtc, PRTCSS_RTC_CCTRL_CAEN, PRTCSS_RTC_CCTRL);
555557
556− platform_set_drvdata(pdev, davinci_rtc);
557−
558558 device_init_wakeup(&pdev->dev, 0);
559559
560560 return 0;
@@ -562,6 +562,7 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) · 1 unmodified line
562562 fail4:
563563 rtc_device_unregister(davinci_rtc->rtc);
564564 fail3:
565+ platform_set_drvdata(pdev, NULL);
565566 iounmap(davinci_rtc->base);
566567 fail2:
567568 release_mem_region(davinci_rtc->pbase, davinci_rtc->base_size);
drivers/rtc/rtc-ds1286.c+1−1
@@ -355,6 +355,7 @@ static int __devinit ds1286_probe(struct platform_device *pdev) · 354 unmodified lines
355355 goto out;
356356 }
357357 spin_lock_init(&priv->lock);
358+ platform_set_drvdata(pdev, priv);
358359 rtc = rtc_device_register("ds1286", &pdev->dev,
359360 &ds1286_ops, THIS_MODULE);
360361 if (IS_ERR(rtc)) {
@@ -362,7 +363,6 @@ static int __devinit ds1286_probe(struct platform_device *pdev) · 1 unmodified line
362363 goto out;
363364 }
364365 priv->rtc = rtc;
365− platform_set_drvdata(pdev, priv);
366366 return 0;
367367
368368 out:
drivers/rtc/rtc-ep93xx.c+2−3
@@ -151,6 +151,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) · 150 unmodified lines
151151 return -ENXIO;
152152
153153 pdev->dev.platform_data = ep93xx_rtc;
154+ platform_set_drvdata(pdev, rtc);
154155
155156 rtc = rtc_device_register(pdev->name,
156157 &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE);
@@ -159,8 +160,6 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) · 2 unmodified lines
159160 goto exit;
160161 }
161162
162− platform_set_drvdata(pdev, rtc);
163−
164163 err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
165164 if (err)
166165 goto fail;
@@ -168,9 +167,9 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) · 1 unmodified line
168167 return 0;
169168
170169 fail:
171− platform_set_drvdata(pdev, NULL);
172170 rtc_device_unregister(rtc);
173171 exit:
172+ platform_set_drvdata(pdev, NULL);
174173 pdev->dev.platform_data = NULL;
175174 return err;
176175 }
drivers/rtc/rtc-m41t80.c+3−2
@@ -783,6 +783,9 @@ static int m41t80_probe(struct i2c_client *client, · 782 unmodified lines
783783 goto exit;
784784 }
785785
786+ clientdata->features = id->driver_data;
787+ i2c_set_clientdata(client, clientdata);
788+
786789 rtc = rtc_device_register(client->name, &client->dev,
787790 &m41t80_rtc_ops, THIS_MODULE);
788791 if (IS_ERR(rtc)) {
@@ -792,8 +795,6 @@ static int m41t80_probe(struct i2c_client *client, · 3 unmodified lines
792795 }
793796
794797 clientdata->rtc = rtc;
795− clientdata->features = id->driver_data;
796− i2c_set_clientdata(client, clientdata);
797798
798799 /* Make sure HT (Halt Update) bit is cleared */
799800 rc = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_HOUR);
drivers/rtc/rtc-max8925.c+5−3
@@ -257,6 +257,10 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev) · 256 unmodified lines
257257 goto out_irq;
258258 }
259259
260+ dev_set_drvdata(&pdev->dev, info);
261+ /* XXX - isn't this redundant? */
262+ platform_set_drvdata(pdev, info);
263+
260264 info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev,
261265 &max8925_rtc_ops, THIS_MODULE);
262266 ret = PTR_ERR(info->rtc_dev);
@@ -265,11 +269,9 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev) · 2 unmodified lines
265269 goto out_rtc;
266270 }
267271
268− dev_set_drvdata(&pdev->dev, info);
269− platform_set_drvdata(pdev, info);
270−
271272 return 0;
272273 out_rtc:
274+ platform_set_drvdata(pdev, NULL);
273275 free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info);
274276 out_irq:
275277 kfree(info);
drivers/rtc/rtc-max8998.c+3−2
@@ -265,6 +265,8 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev) · 264 unmodified lines
265265 info->rtc = max8998->rtc;
266266 info->irq = max8998->irq_base + MAX8998_IRQ_ALARM0;
267267
268+ platform_set_drvdata(pdev, info);
269+
268270 info->rtc_dev = rtc_device_register("max8998-rtc", &pdev->dev,
269271 &max8998_rtc_ops, THIS_MODULE);
270272
@@ -274,8 +276,6 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev) · 3 unmodified lines
274276 goto out_rtc;
275277 }
276278
277− platform_set_drvdata(pdev, info);
278−
279279 ret = request_threaded_irq(info->irq, NULL, max8998_rtc_alarm_irq, 0,
280280 "rtc-alarm0", info);
281281
@@ -293,6 +293,7 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev) · 11 unmodified lines
293293 return 0;
294294
295295 out_rtc:
296+ platform_set_drvdata(pdev, NULL);
296297 kfree(info);
297298 return ret;
298299 }
drivers/rtc/rtc-mc13xxx.c+6−2
@@ -349,11 +349,15 @@ static int __devinit mc13xxx_rtc_probe(struct platform_device *pdev) · 348 unmodified lines
349349 if (ret)
350350 goto err_alarm_irq_request;
351351
352+ mc13xxx_unlock(mc13xxx);
353+
352354 priv->rtc = rtc_device_register(pdev->name,
353355 &pdev->dev, &mc13xxx_rtc_ops, THIS_MODULE);
354356 if (IS_ERR(priv->rtc)) {
355357 ret = PTR_ERR(priv->rtc);
356358
359+ mc13xxx_lock(mc13xxx);
360+
357361 mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_TODA, priv);
358362 err_alarm_irq_request:
359363
@@ -365,12 +369,12 @@ err_reset_irq_status: · 5 unmodified lines
365369 mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_RTCRST, priv);
366370 err_reset_irq_request:
367371
372+ mc13xxx_unlock(mc13xxx);
373+
368374 platform_set_drvdata(pdev, NULL);
369375 kfree(priv);
370376 }
371377
372− mc13xxx_unlock(mc13xxx);
373−
374378 return ret;
375379 }
376380
drivers/rtc/rtc-msm6242.c+2−1
@@ -214,6 +214,7 @@ static int __init msm6242_rtc_probe(struct platform_device *dev) · 213 unmodified lines
214214 error = -ENOMEM;
215215 goto out_free_priv;
216216 }
217+ platform_set_drvdata(dev, priv);
217218
218219 rtc = rtc_device_register("rtc-msm6242", &dev->dev, &msm6242_rtc_ops,
219220 THIS_MODULE);
@@ -223,10 +224,10 @@ static int __init msm6242_rtc_probe(struct platform_device *dev) · 3 unmodified lines
223224 }
224225
225226 priv->rtc = rtc;
226− platform_set_drvdata(dev, priv);
227227 return 0;
228228
229229 out_unmap:
230+ platform_set_drvdata(dev, NULL);
230231 iounmap(priv->regs);
231232 out_free_priv:
232233 kfree(priv);
drivers/rtc/rtc-mxc.c+11−8
@@ -418,14 +418,6 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) · 417 unmodified lines
418418 goto exit_put_clk;
419419 }
420420
421− rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops,
422− THIS_MODULE);
423− if (IS_ERR(rtc)) {
424− ret = PTR_ERR(rtc);
425− goto exit_put_clk;
426− }
427−
428− pdata->rtc = rtc;
429421 platform_set_drvdata(pdev, pdata);
430422
431423 /* Configure and enable the RTC */
@@ -438,8 +430,19 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) · 6 unmodified lines
438430 pdata->irq = -1;
439431 }
440432
433+ rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops,
434+ THIS_MODULE);
435+ if (IS_ERR(rtc)) {
436+ ret = PTR_ERR(rtc);
437+ goto exit_clr_drvdata;
438+ }
439+
440+ pdata->rtc = rtc;
441+
441442 return 0;
442443
444+exit_clr_drvdata:
445+ platform_set_drvdata(pdev, NULL);
443446 exit_put_clk:
444447 clk_disable(pdata->clk);
445448 clk_put(pdata->clk);
drivers/rtc/rtc-omap.c+1−1
@@ -394,7 +394,7 @@ static int __init omap_rtc_probe(struct platform_device *pdev) · 393 unmodified lines
394394 return 0;
395395
396396 fail2:
397− free_irq(omap_rtc_timer, NULL);
397+ free_irq(omap_rtc_timer, rtc);
398398 fail1:
399399 rtc_device_unregister(rtc);
400400 fail0:
drivers/rtc/rtc-pcap.c+3−1
@@ -151,6 +151,8 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev) · 150 unmodified lines
151151
152152 pcap_rtc->pcap = dev_get_drvdata(pdev->dev.parent);
153153
154+ platform_set_drvdata(pdev, pcap_rtc);
155+
154156 pcap_rtc->rtc = rtc_device_register("pcap", &pdev->dev,
155157 &pcap_rtc_ops, THIS_MODULE);
156158 if (IS_ERR(pcap_rtc->rtc)) {
@@ -158,7 +160,6 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev) · 1 unmodified line
158160 goto fail_rtc;
159161 }
160162
161− platform_set_drvdata(pdev, pcap_rtc);
162163
163164 timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ);
164165 alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA);
@@ -177,6 +178,7 @@ fail_alarm: · 12 unmodified lines
177178 fail_timer:
178179 rtc_device_unregister(pcap_rtc->rtc);
179180 fail_rtc:
181+ platform_set_drvdata(pdev, NULL);
180182 kfree(pcap_rtc);
181183 return err;
182184 }
drivers/rtc/rtc-rp5c01.c+3−2
@@ -249,15 +249,15 @@ static int __init rp5c01_rtc_probe(struct platform_device *dev) · 248 unmodified lines
249249
250250 spin_lock_init(&priv->lock);
251251
252+ platform_set_drvdata(dev, priv);
253+
252254 rtc = rtc_device_register("rtc-rp5c01", &dev->dev, &rp5c01_rtc_ops,
253255 THIS_MODULE);
254256 if (IS_ERR(rtc)) {
255257 error = PTR_ERR(rtc);
256258 goto out_unmap;
257259 }
258−
259260 priv->rtc = rtc;
260− platform_set_drvdata(dev, priv);
261261
262262 error = sysfs_create_bin_file(&dev->dev.kobj, &priv->nvram_attr);
263263 if (error)
@@ -268,6 +268,7 @@ static int __init rp5c01_rtc_probe(struct platform_device *dev) · 4 unmodified lines
268268 out_unregister:
269269 rtc_device_unregister(rtc);
270270 out_unmap:
271+ platform_set_drvdata(dev, NULL);
271272 iounmap(priv->regs);
272273 out_free_priv:
273274 kfree(priv);
drivers/rtc/rtc-s3c.c+10−3
@@ -46,6 +46,7 @@ static struct clk *rtc_clk; · 45 unmodified lines
4646 static void __iomem *s3c_rtc_base;
4747 static int s3c_rtc_alarmno = NO_IRQ;
4848 static int s3c_rtc_tickno = NO_IRQ;
49+static bool wake_en;
4950 static enum s3c_cpu_type s3c_rtc_cpu_type;
5051
5152 static DEFINE_SPINLOCK(s3c_rtc_pie_lock);
@@ -562,8 +563,12 @@ static int s3c_rtc_suspend(struct platform_device *pdev, pm_message_t state) · 510 unmodified lines
562563 }
563564 s3c_rtc_enable(pdev, 0);
564565
565− if (device_may_wakeup(&pdev->dev))
566− enable_irq_wake(s3c_rtc_alarmno);
566+ if (device_may_wakeup(&pdev->dev) && !wake_en) {
567+ if (enable_irq_wake(s3c_rtc_alarmno) == 0)
568+ wake_en = true;
569+ else
570+ dev_err(&pdev->dev, "enable_irq_wake failed\n");
571+ }
567572
568573 return 0;
569574 }
@@ -579,8 +584,10 @@ static int s3c_rtc_resume(struct platform_device *pdev) · 9 unmodified lines
579584 writew(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON);
580585 }
581586
582− if (device_may_wakeup(&pdev->dev))
587+ if (device_may_wakeup(&pdev->dev) && wake_en) {
583588 disable_irq_wake(s3c_rtc_alarmno);
589+ wake_en = false;
590+ }
584591
585592 return 0;
586593 }
drivers/s390/block/dasd.c+32−19
@@ -1742,11 +1742,20 @@ int dasd_sleep_on_interruptible(struct dasd_ccw_req *cqr) · 1741 unmodified lines
17421742 static inline int _dasd_term_running_cqr(struct dasd_device *device)
17431743 {
17441744 struct dasd_ccw_req *cqr;
1745+ int rc;
17451746
17461747 if (list_empty(&device->ccw_queue))
17471748 return 0;
17481749 cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, devlist);
1749− return device->discipline->term_IO(cqr);
1750+ rc = device->discipline->term_IO(cqr);
1751+ if (!rc)
1752+ /*
1753+ * CQR terminated because a more important request is pending.
1754+ * Undo decreasing of retry counter because this is
1755+ * not an error case.
1756+ */
1757+ cqr->retries++;
1758+ return rc;
17501759 }
17511760
17521761 int dasd_sleep_on_immediatly(struct dasd_ccw_req *cqr)
@@ -2314,15 +2323,14 @@ static void dasd_flush_request_queue(struct dasd_block *block) · 561 unmodified lines
23142323
23152324 static int dasd_open(struct block_device *bdev, fmode_t mode)
23162325 {
2317− struct dasd_block *block = bdev->bd_disk->private_data;
23182326 struct dasd_device *base;
23192327 int rc;
23202328
2321− if (!block)
2329+ base = dasd_device_from_gendisk(bdev->bd_disk);
2330+ if (!base)
23222331 return -ENODEV;
23232332
2324− base = block->base;
2325− atomic_inc(&block->open_count);
2333+ atomic_inc(&base->block->open_count);
23262334 if (test_bit(DASD_FLAG_OFFLINE, &base->flags)) {
23272335 rc = -ENODEV;
23282336 goto unlock;
@@ -2355,21 +2363,28 @@ static int dasd_open(struct block_device *bdev, fmode_t mode) · 26 unmodified lines
23552363 goto out;
23562364 }
23572365
2366+ dasd_put_device(base);
23582367 return 0;
23592368
23602369 out:
23612370 module_put(base->discipline->owner);
23622371 unlock:
2363− atomic_dec(&block->open_count);
2372+ atomic_dec(&base->block->open_count);
2373+ dasd_put_device(base);
23642374 return rc;
23652375 }
23662376
23672377 static int dasd_release(struct gendisk *disk, fmode_t mode)
23682378 {
2369− struct dasd_block *block = disk->private_data;
2379+ struct dasd_device *base;
23702380
2371− atomic_dec(&block->open_count);
2372− module_put(block->base->discipline->owner);
2381+ base = dasd_device_from_gendisk(disk);
2382+ if (!base)
2383+ return -ENODEV;
2384+
2385+ atomic_dec(&base->block->open_count);
2386+ module_put(base->discipline->owner);
2387+ dasd_put_device(base);
23732388 return 0;
23742389 }
23752390
@@ -2378,20 +2393,20 @@ static int dasd_release(struct gendisk *disk, fmode_t mode) · 2 unmodified lines
23782393 */
23792394 static int dasd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
23802395 {
2381− struct dasd_block *block;
23822396 struct dasd_device *base;
23832397
2384− block = bdev->bd_disk->private_data;
2385− if (!block)
2398+ base = dasd_device_from_gendisk(bdev->bd_disk);
2399+ if (!base)
23862400 return -ENODEV;
2387− base = block->base;
23882401
23892402 if (!base->discipline ||
2390− !base->discipline->fill_geometry)
2403+ !base->discipline->fill_geometry) {
2404+ dasd_put_device(base);
23912405 return -EINVAL;
2392−
2393− base->discipline->fill_geometry(block, geo);
2394− geo->start = get_start_sect(bdev) >> block->s2b_shift;
2406+ }
2407+ base->discipline->fill_geometry(base->block, geo);
2408+ geo->start = get_start_sect(bdev) >> base->block->s2b_shift;
2409+ dasd_put_device(base);
23952410 return 0;
23962411 }
23972412
@@ -2528,7 +2543,6 @@ void dasd_generic_remove(struct ccw_device *cdev) · 130 unmodified lines
25282543 dasd_set_target_state(device, DASD_STATE_NEW);
25292544 /* dasd_delete_device destroys the device reference. */
25302545 block = device->block;
2531− device->block = NULL;
25322546 dasd_delete_device(device);
25332547 /*
25342548 * life cycle of block is bound to device, so delete it after
@@ -2650,7 +2664,6 @@ int dasd_generic_set_offline(struct ccw_device *cdev) · 115 unmodified lines
26502664 dasd_set_target_state(device, DASD_STATE_NEW);
26512665 /* dasd_delete_device destroys the device reference. */
26522666 block = device->block;
2653− device->block = NULL;
26542667 dasd_delete_device(device);
26552668 /*
26562669 * life cycle of block is bound to device, so delete it after
drivers/s390/block/dasd_devmap.c+30−0
@@ -674,6 +674,36 @@ dasd_device_from_cdev(struct ccw_device *cdev) · 673 unmodified lines
674674 return device;
675675 }
676676
677+void dasd_add_link_to_gendisk(struct gendisk *gdp, struct dasd_device *device)
678+{
679+ struct dasd_devmap *devmap;
680+
681+ devmap = dasd_find_busid(dev_name(&device->cdev->dev));
682+ if (IS_ERR(devmap))
683+ return;
684+ spin_lock(&dasd_devmap_lock);
685+ gdp->private_data = devmap;
686+ spin_unlock(&dasd_devmap_lock);
687+}
688+
689+struct dasd_device *dasd_device_from_gendisk(struct gendisk *gdp)
690+{
691+ struct dasd_device *device;
692+ struct dasd_devmap *devmap;
693+
694+ if (!gdp->private_data)
695+ return NULL;
696+ device = NULL;
697+ spin_lock(&dasd_devmap_lock);
698+ devmap = gdp->private_data;
699+ if (devmap && devmap->device) {
700+ device = devmap->device;
701+ dasd_get_device(device);
702+ }
703+ spin_unlock(&dasd_devmap_lock);
704+ return device;
705+}
706+
677707 /*
678708 * SECTION: files in sysfs
679709 */
drivers/s390/block/dasd_diag.c+1−1
@@ -239,7 +239,6 @@ static void dasd_ext_handler(unsigned int ext_int_code, · 238 unmodified lines
239239 addr_t ip;
240240 int rc;
241241
242− kstat_cpu(smp_processor_id()).irqs[EXTINT_DSD]++;
243242 switch (ext_int_code >> 24) {
244243 case DASD_DIAG_CODE_31BIT:
245244 ip = (addr_t) param32;
@@ -250,6 +249,7 @@ static void dasd_ext_handler(unsigned int ext_int_code, · 4 unmodified lines
250249 default:
251250 return;
252251 }
252+ kstat_cpu(smp_processor_id()).irqs[EXTINT_DSD]++;
253253 if (!ip) { /* no intparm: unsolicited interrupt */
254254 DBF_EVENT(DBF_NOTICE, "%s", "caught unsolicited "
255255 "interrupt");
drivers/s390/block/dasd_eckd.c+3−2
@@ -2037,7 +2037,7 @@ static void dasd_eckd_check_for_device_change(struct dasd_device *device, · 2036 unmodified lines
20372037 return;
20382038
20392039 /* summary unit check */
2040− if ((sense[7] == 0x0D) &&
2040+ if ((sense[27] & DASD_SENSE_BIT_0) && (sense[7] == 0x0D) &&
20412041 (scsw_dstat(&irb->scsw) & DEV_STAT_UNIT_CHECK)) {
20422042 dasd_alias_handle_summary_unit_check(device, irb);
20432043 return;
@@ -2053,7 +2053,8 @@ static void dasd_eckd_check_for_device_change(struct dasd_device *device, · 9 unmodified lines
20532053 /* loss of device reservation is handled via base devices only
20542054 * as alias devices may be used with several bases
20552055 */
2056− if (device->block && (sense[7] == 0x3F) &&
2056+ if (device->block && (sense[27] & DASD_SENSE_BIT_0) &&
2057+ (sense[7] == 0x3F) &&
20572058 (scsw_dstat(&irb->scsw) & DEV_STAT_UNIT_CHECK) &&
20582059 test_bit(DASD_FLAG_IS_RESERVED, &device->flags)) {
20592060 if (device->features & DASD_FEATURE_FAILONSLCK)
drivers/s390/block/dasd_genhd.c+1−1
@@ -73,7 +73,7 @@ int dasd_gendisk_alloc(struct dasd_block *block) · 72 unmodified lines
7373 if (base->features & DASD_FEATURE_READONLY ||
7474 test_bit(DASD_FLAG_DEVICE_RO, &base->flags))
7575 set_disk_ro(gdp, 1);
76− gdp->private_data = block;
76+ dasd_add_link_to_gendisk(gdp, base);
7777 gdp->queue = block->request_queue;
7878 block->gdp = gdp;
7979 set_capacity(block->gdp, 0);
drivers/s390/block/dasd_int.h+3−0
@@ -686,6 +686,9 @@ struct dasd_device *dasd_device_from_cdev(struct ccw_device *); · 685 unmodified lines
686686 struct dasd_device *dasd_device_from_cdev_locked(struct ccw_device *);
687687 struct dasd_device *dasd_device_from_devindex(int);
688688
689+void dasd_add_link_to_gendisk(struct gendisk *, struct dasd_device *);
690+struct dasd_device *dasd_device_from_gendisk(struct gendisk *);
691+
689692 int dasd_parse(void);
690693 int dasd_busid_known(const char *);
691694
drivers/s390/block/dasd_ioctl.c+87−41
@@ -42,16 +42,22 @@ dasd_ioctl_api_version(void __user *argp) · 41 unmodified lines
4242 static int
4343 dasd_ioctl_enable(struct block_device *bdev)
4444 {
45− struct dasd_block *block = bdev->bd_disk->private_data;
45+ struct dasd_device *base;
4646
4747 if (!capable(CAP_SYS_ADMIN))
4848 return -EACCES;
4949
50− dasd_enable_device(block->base);
50+ base = dasd_device_from_gendisk(bdev->bd_disk);
51+ if (!base)
52+ return -ENODEV;
53+
54+ dasd_enable_device(base);
5155 /* Formatting the dasd device can change the capacity. */
5256 mutex_lock(&bdev->bd_mutex);
53− i_size_write(bdev->bd_inode, (loff_t)get_capacity(block->gdp) << 9);
57+ i_size_write(bdev->bd_inode,
58+ (loff_t)get_capacity(base->block->gdp) << 9);
5459 mutex_unlock(&bdev->bd_mutex);
60+ dasd_put_device(base);
5561 return 0;
5662 }
5763
@@ -62,11 +68,14 @@ dasd_ioctl_enable(struct block_device *bdev) · 4 unmodified lines
6268 static int
6369 dasd_ioctl_disable(struct block_device *bdev)
6470 {
65− struct dasd_block *block = bdev->bd_disk->private_data;
71+ struct dasd_device *base;
6672
6773 if (!capable(CAP_SYS_ADMIN))
6874 return -EACCES;
6975
76+ base = dasd_device_from_gendisk(bdev->bd_disk);
77+ if (!base)
78+ return -ENODEV;
7079 /*
7180 * Man this is sick. We don't do a real disable but only downgrade
7281 * the device to DASD_STATE_BASIC. The reason is that dasdfmt uses
@@ -75,7 +84,7 @@ dasd_ioctl_disable(struct block_device *bdev) · 2 unmodified lines
7584 * using the BIODASDFMT ioctl. Therefore the correct state for the
7685 * device is DASD_STATE_BASIC that allows to do basic i/o.
7786 */
78− dasd_set_target_state(block->base, DASD_STATE_BASIC);
87+ dasd_set_target_state(base, DASD_STATE_BASIC);
7988 /*
8089 * Set i_size to zero, since read, write, etc. check against this
8190 * value.
@@ -83,6 +92,7 @@ dasd_ioctl_disable(struct block_device *bdev) · 1 unmodified line
8392 mutex_lock(&bdev->bd_mutex);
8493 i_size_write(bdev->bd_inode, 0);
8594 mutex_unlock(&bdev->bd_mutex);
95+ dasd_put_device(base);
8696 return 0;
8797 }
8898
@@ -191,26 +201,36 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata) · 102 unmodified lines
191201 static int
192202 dasd_ioctl_format(struct block_device *bdev, void __user *argp)
193203 {
194− struct dasd_block *block = bdev->bd_disk->private_data;
204+ struct dasd_device *base;
195205 struct format_data_t fdata;
206+ int rc;
196207
197208 if (!capable(CAP_SYS_ADMIN))
198209 return -EACCES;
199210 if (!argp)
200211 return -EINVAL;
201−
202− if (block->base->features & DASD_FEATURE_READONLY ||
203− test_bit(DASD_FLAG_DEVICE_RO, &block->base->flags))
212+ base = dasd_device_from_gendisk(bdev->bd_disk);
213+ if (!base)
214+ return -ENODEV;
215+ if (base->features & DASD_FEATURE_READONLY ||
216+ test_bit(DASD_FLAG_DEVICE_RO, &base->flags)) {
217+ dasd_put_device(base);
204218 return -EROFS;
205− if (copy_from_user(&fdata, argp, sizeof(struct format_data_t)))
219+ }
220+ if (copy_from_user(&fdata, argp, sizeof(struct format_data_t))) {
221+ dasd_put_device(base);
206222 return -EFAULT;
223+ }
207224 if (bdev != bdev->bd_contains) {
208225 pr_warning("%s: The specified DASD is a partition and cannot "
209226 "be formatted\n",
210− dev_name(&block->base->cdev->dev));
227+ dev_name(&base->cdev->dev));
228+ dasd_put_device(base);
211229 return -EINVAL;
212230 }
213− return dasd_format(block, &fdata);
231+ rc = dasd_format(base->block, &fdata);
232+ dasd_put_device(base);
233+ return rc;
214234 }
215235
216236 #ifdef CONFIG_DASD_PROFILE
@@ -340,8 +360,8 @@ static int dasd_ioctl_information(struct dasd_block *block, · 123 unmodified lines
340360 static int
341361 dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp)
342362 {
343− struct dasd_block *block = bdev->bd_disk->private_data;
344− int intval;
363+ struct dasd_device *base;
364+ int intval, rc;
345365
346366 if (!capable(CAP_SYS_ADMIN))
347367 return -EACCES;
@@ -350,10 +370,17 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) · 2 unmodified lines
350370 return -EINVAL;
351371 if (get_user(intval, (int __user *)argp))
352372 return -EFAULT;
353− if (!intval && test_bit(DASD_FLAG_DEVICE_RO, &block->base->flags))
373+ base = dasd_device_from_gendisk(bdev->bd_disk);
374+ if (!base)
375+ return -ENODEV;
376+ if (!intval && test_bit(DASD_FLAG_DEVICE_RO, &base->flags)) {
377+ dasd_put_device(base);
354378 return -EROFS;
379+ }
355380 set_disk_ro(bdev->bd_disk, intval);
356− return dasd_set_feature(block->base->cdev, DASD_FEATURE_READONLY, intval);
381+ rc = dasd_set_feature(base->cdev, DASD_FEATURE_READONLY, intval);
382+ dasd_put_device(base);
383+ return rc;
357384 }
358385
359386 static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd,
@@ -372,59 +399,78 @@ static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, · 12 unmodified lines
372399 int dasd_ioctl(struct block_device *bdev, fmode_t mode,
373400 unsigned int cmd, unsigned long arg)
374401 {
375− struct dasd_block *block = bdev->bd_disk->private_data;
402+ struct dasd_block *block;
403+ struct dasd_device *base;
376404 void __user *argp;
405+ int rc;
377406
378407 if (is_compat_task())
379408 argp = compat_ptr(arg);
380409 else
381410 argp = (void __user *)arg;
382411
383− if (!block)
384− return -ENODEV;
385−
386412 if ((_IOC_DIR(cmd) != _IOC_NONE) && !arg) {
387413 PRINT_DEBUG("empty data ptr");
388414 return -EINVAL;
389415 }
390416
417+ base = dasd_device_from_gendisk(bdev->bd_disk);
418+ if (!base)
419+ return -ENODEV;
420+ block = base->block;
421+ rc = 0;
391422 switch (cmd) {
392423 case BIODASDDISABLE:
393− return dasd_ioctl_disable(bdev);
424+ rc = dasd_ioctl_disable(bdev);
425+ break;
394426 case BIODASDENABLE:
395− return dasd_ioctl_enable(bdev);
427+ rc = dasd_ioctl_enable(bdev);
428+ break;
396429 case BIODASDQUIESCE:
397− return dasd_ioctl_quiesce(block);
430+ rc = dasd_ioctl_quiesce(block);
431+ break;
398432 case BIODASDRESUME:
399− return dasd_ioctl_resume(block);
433+ rc = dasd_ioctl_resume(block);
434+ break;
400435 case BIODASDFMT:
401− return dasd_ioctl_format(bdev, argp);
436+ rc = dasd_ioctl_format(bdev, argp);
437+ break;
402438 case BIODASDINFO:
403− return dasd_ioctl_information(block, cmd, argp);
439+ rc = dasd_ioctl_information(block, cmd, argp);
440+ break;
404441 case BIODASDINFO2:
405− return dasd_ioctl_information(block, cmd, argp);
442+ rc = dasd_ioctl_information(block, cmd, argp);
443+ break;
406444 case BIODASDPRRD:
407− return dasd_ioctl_read_profile(block, argp);
445+ rc = dasd_ioctl_read_profile(block, argp);
446+ break;
408447 case BIODASDPRRST:
409− return dasd_ioctl_reset_profile(block);
448+ rc = dasd_ioctl_reset_profile(block);
449+ break;
410450 case BLKROSET:
411− return dasd_ioctl_set_ro(bdev, argp);
451+ rc = dasd_ioctl_set_ro(bdev, argp);
452+ break;
412453 case DASDAPIVER:
413− return dasd_ioctl_api_version(argp);
454+ rc = dasd_ioctl_api_version(argp);
455+ break;
414456 case BIODASDCMFENABLE:
415− return enable_cmf(block->base->cdev);
457+ rc = enable_cmf(base->cdev);
458+ break;
416459 case BIODASDCMFDISABLE:
417− return disable_cmf(block->base->cdev);
460+ rc = disable_cmf(base->cdev);
461+ break;
418462 case BIODASDREADALLCMB:
419− return dasd_ioctl_readall_cmb(block, cmd, argp);
463+ rc = dasd_ioctl_readall_cmb(block, cmd, argp);
464+ break;
420465 default:
421466 /* if the discipline has an ioctl method try it. */
422− if (block->base->discipline->ioctl) {
423− int rval = block->base->discipline->ioctl(block, cmd, argp);
424− if (rval != -ENOIOCTLCMD)
425− return rval;
426− }
427−
428− return -EINVAL;
467+ if (base->discipline->ioctl) {
468+ rc = base->discipline->ioctl(block, cmd, argp);
469+ if (rc == -ENOIOCTLCMD)
470+ rc = -EINVAL;
471+ } else
472+ rc = -EINVAL;
429473 }
474+ dasd_put_device(base);
475+ return rc;
430476 }
drivers/s390/char/sclp_cmd.c+2−0
@@ -518,6 +518,8 @@ static void __init insert_increment(u16 rn, int standby, int assigned) · 517 unmodified lines
518518 return;
519519 new_incr->rn = rn;
520520 new_incr->standby = standby;
521+ if (!standby)
522+ new_incr->usecount = 1;
521523 last_rn = 0;
522524 prev = &sclp_mem_list;
523525 list_for_each_entry(incr, &sclp_mem_list, list) {
drivers/s390/char/tape_block.c+0−1
@@ -236,7 +236,6 @@ tapeblock_setup_device(struct tape_device * device) · 235 unmodified lines
236236 disk->major = tapeblock_major;
237237 disk->first_minor = device->first_minor;
238238 disk->fops = &tapeblock_fops;
239− disk->events = DISK_EVENT_MEDIA_CHANGE;
240239 disk->private_data = tape_get_device(device);
241240 disk->queue = blkdat->request_queue;
242241 set_capacity(disk, 0);
drivers/s390/cio/qdio_main.c+12−5
@@ -407,8 +407,11 @@ static inline void account_sbals(struct qdio_q *q, int count) · 406 unmodified lines
407407 q->q_stats.nr_sbals[pos]++;
408408 }
409409
410−static void announce_buffer_error(struct qdio_q *q, int count)
410+static void process_buffer_error(struct qdio_q *q, int count)
411411 {
412+ unsigned char state = (q->is_input_q) ? SLSB_P_INPUT_NOT_INIT :
413+ SLSB_P_OUTPUT_NOT_INIT;
414+
412415 q->qdio_error |= QDIO_ERROR_SLSB_STATE;
413416
414417 /* special handling for no target buffer empty */
@@ -426,6 +429,12 @@ static void announce_buffer_error(struct qdio_q *q, int count) · 11 unmodified lines
426429 DBF_ERROR("F14:%2x F15:%2x",
427430 q->sbal[q->first_to_check]->element[14].flags & 0xff,
428431 q->sbal[q->first_to_check]->element[15].flags & 0xff);
432+
433+ /*
434+ * Interrupts may be avoided as long as the error is present
435+ * so change the buffer state immediately to avoid starvation.
436+ */
437+ set_buf_states(q, q->first_to_check, state, count);
429438 }
430439
431440 static inline void inbound_primed(struct qdio_q *q, int count)
@@ -506,8 +515,7 @@ static int get_inbound_buffer_frontier(struct qdio_q *q) · 74 unmodified lines
506515 account_sbals(q, count);
507516 break;
508517 case SLSB_P_INPUT_ERROR:
509− announce_buffer_error(q, count);
510− /* process the buffer, the upper layer will take care of it */
518+ process_buffer_error(q, count);
511519 q->first_to_check = add_buf(q->first_to_check, count);
512520 atomic_sub(count, &q->nr_buf_used);
513521 if (q->irq_ptr->perf_stat_enabled)
@@ -677,8 +685,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q) · 163 unmodified lines
677685 account_sbals(q, count);
678686 break;
679687 case SLSB_P_OUTPUT_ERROR:
680− announce_buffer_error(q, count);
681− /* process the buffer, the upper layer will take care of it */
688+ process_buffer_error(q, count);
682689 q->first_to_check = add_buf(q->first_to_check, count);
683690 atomic_sub(count, &q->nr_buf_used);
684691 if (q->irq_ptr->perf_stat_enabled)
drivers/s390/kvm/kvm_virtio.c+1−1
@@ -381,10 +381,10 @@ static void kvm_extint_handler(unsigned int ext_int_code, · 380 unmodified lines
381381 u16 subcode;
382382 u32 param;
383383
384− kstat_cpu(smp_processor_id()).irqs[EXTINT_VRT]++;
385384 subcode = ext_int_code >> 16;
386385 if ((subcode & 0xff00) != VIRTIO_SUBCODE_64)
387386 return;
387+ kstat_cpu(smp_processor_id()).irqs[EXTINT_VRT]++;
388388
389389 /* The LSB might be overloaded, we have to mask it */
390390 vq = (struct virtqueue *)(param64 & ~1UL);
drivers/scsi/device_handler/scsi_dh.c+6−3
@@ -394,12 +394,14 @@ int scsi_dh_activate(struct request_queue *q, activate_complete fn, void *data) · 393 unmodified lines
394394 unsigned long flags;
395395 struct scsi_device *sdev;
396396 struct scsi_device_handler *scsi_dh = NULL;
397+ struct device *dev = NULL;
397398
398399 spin_lock_irqsave(q->queue_lock, flags);
399400 sdev = q->queuedata;
400401 if (sdev && sdev->scsi_dh_data)
401402 scsi_dh = sdev->scsi_dh_data->scsi_dh;
402− if (!scsi_dh || !get_device(&sdev->sdev_gendev) ||
403+ dev = get_device(&sdev->sdev_gendev);
404+ if (!scsi_dh || !dev ||
403405 sdev->sdev_state == SDEV_CANCEL ||
404406 sdev->sdev_state == SDEV_DEL)
405407 err = SCSI_DH_NOSYS;
@@ -410,12 +412,13 @@ int scsi_dh_activate(struct request_queue *q, activate_complete fn, void *data) · 4 unmodified lines
410412 if (err) {
411413 if (fn)
412414 fn(data, err);
413− return err;
415+ goto out;
414416 }
415417
416418 if (scsi_dh->activate)
417419 err = scsi_dh->activate(sdev, fn, data);
418− put_device(&sdev->sdev_gendev);
420+out:
421+ put_device(dev);
419422 return err;
420423 }
421424 EXPORT_SYMBOL_GPL(scsi_dh_activate);
drivers/scsi/mpt2sas/mpt2sas_ctl.c+21−2
@@ -688,6 +688,13 @@ _ctl_do_mpt_command(struct MPT2SAS_ADAPTER *ioc, · 687 unmodified lines
688688 goto out;
689689 }
690690
691+ /* Check for overflow and wraparound */
692+ if (karg.data_sge_offset * 4 > ioc->request_sz ||
693+ karg.data_sge_offset > (UINT_MAX / 4)) {
694+ ret = -EINVAL;
695+ goto out;
696+ }
697+
691698 /* copy in request message frame from user */
692699 if (copy_from_user(mpi_request, mf, karg.data_sge_offset*4)) {
693700 printk(KERN_ERR "failure at %s:%d/%s()!\n", __FILE__, __LINE__,
@@ -1963,7 +1970,7 @@ _ctl_diag_read_buffer(void __user *arg, enum block_state state) · 1269 unmodified lines
19631970 Mpi2DiagBufferPostReply_t *mpi_reply;
19641971 int rc, i;
19651972 u8 buffer_type;
1966− unsigned long timeleft;
1973+ unsigned long timeleft, request_size, copy_size;
19671974 u16 smid;
19681975 u16 ioc_status;
19691976 u8 issue_reset = 0;
@@ -1999,6 +2006,8 @@ _ctl_diag_read_buffer(void __user *arg, enum block_state state) · 29 unmodified lines
19992006 return -ENOMEM;
20002007 }
20012008
2009+ request_size = ioc->diag_buffer_sz[buffer_type];
2010+
20022011 if ((karg.starting_offset % 4) || (karg.bytes_to_read % 4)) {
20032012 printk(MPT2SAS_ERR_FMT "%s: either the starting_offset "
20042013 "or bytes_to_read are not 4 byte aligned\n", ioc->name,
@@ -2006,13 +2015,23 @@ _ctl_diag_read_buffer(void __user *arg, enum block_state state) · 1 unmodified line
20062015 return -EINVAL;
20072016 }
20082017
2018+ if (karg.starting_offset > request_size)
2019+ return -EINVAL;
2020+
20092021 diag_data = (void *)(request_data + karg.starting_offset);
20102022 dctlprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: diag_buffer(%p), "
20112023 "offset(%d), sz(%d)\n", ioc->name, __func__,
20122024 diag_data, karg.starting_offset, karg.bytes_to_read));
20132025
2026+ /* Truncate data on requests that are too large */
2027+ if ((diag_data + karg.bytes_to_read < diag_data) ||
2028+ (diag_data + karg.bytes_to_read > request_data + request_size))
2029+ copy_size = request_size - karg.starting_offset;
2030+ else
2031+ copy_size = karg.bytes_to_read;
2032+
20142033 if (copy_to_user((void __user *)uarg->diagnostic_data,
2015− diag_data, karg.bytes_to_read)) {
2034+ diag_data, copy_size)) {
20162035 printk(MPT2SAS_ERR_FMT "%s: Unable to write "
20172036 "mpt_diag_read_buffer_t data @ %p\n", ioc->name,
20182037 __func__, diag_data);
drivers/scsi/pmcraid.c+3−0
@@ -3814,6 +3814,9 @@ static long pmcraid_ioctl_passthrough( · 3813 unmodified lines
38143814 rc = -EFAULT;
38153815 goto out_free_buffer;
38163816 }
3817+ } else if (request_size < 0) {
3818+ rc = -EINVAL;
3819+ goto out_free_buffer;
38173820 }
38183821
38193822 /* check if we have any additional command parameters */
drivers/scsi/qlogicpti.c+5−2
@@ -1292,8 +1292,10 @@ static struct scsi_host_template qpti_template = { · 1291 unmodified lines
12921292 .use_clustering = ENABLE_CLUSTERING,
12931293 };
12941294
1295+static const struct of_device_id qpti_match[];
12951296 static int __devinit qpti_sbus_probe(struct platform_device *op)
12961297 {
1298+ const struct of_device_id *match;
12971299 struct scsi_host_template *tpnt;
12981300 struct device_node *dp = op->dev.of_node;
12991301 struct Scsi_Host *host;
@@ -1301,9 +1303,10 @@ static int __devinit qpti_sbus_probe(struct platform_device *op) · 1 unmodified line
13011303 static int nqptis;
13021304 const char *fcode;
13031305
1304− if (!op->dev.of_match)
1306+ match = of_match_device(qpti_match, &op->dev);
1307+ if (!match)
13051308 return -EINVAL;
1306− tpnt = op->dev.of_match->data;
1309+ tpnt = match->data;
13071310
13081311 /* Sometimes Antares cards come up not completely
13091312 * setup, and we get a report of a zero IRQ.
drivers/scsi/scsi_lib.c+17−15
@@ -74,8 +74,6 @@ struct kmem_cache *scsi_sdb_cache; · 73 unmodified lines
7474 */
7575 #define SCSI_QUEUE_DELAY 3
7676
77−static void scsi_run_queue(struct request_queue *q);
78−
7977 /*
8078 * Function: scsi_unprep_request()
8179 *
@@ -161,7 +159,7 @@ static int __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, int unbusy) · 79 unmodified lines
161159 blk_requeue_request(q, cmd->request);
162160 spin_unlock_irqrestore(q->queue_lock, flags);
163161
164− scsi_run_queue(q);
162+ kblockd_schedule_work(q, &device->requeue_work);
165163
166164 return 0;
167165 }
@@ -400,10 +398,15 @@ static inline int scsi_host_is_busy(struct Scsi_Host *shost) · 232 unmodified lines
400398 static void scsi_run_queue(struct request_queue *q)
401399 {
402400 struct scsi_device *sdev = q->queuedata;
403− struct Scsi_Host *shost = sdev->host;
401+ struct Scsi_Host *shost;
404402 LIST_HEAD(starved_list);
405403 unsigned long flags;
406404
405+ /* if the device is dead, sdev will be NULL, so no queue to run */
406+ if (!sdev)
407+ return;
408+
409+ shost = sdev->host;
407410 if (scsi_target(sdev)->single_lun)
408411 scsi_single_lun_run(sdev);
409412
@@ -411,8 +414,6 @@ static void scsi_run_queue(struct request_queue *q) · 1 unmodified line
411414 list_splice_init(&shost->starved_list, &starved_list);
412415
413416 while (!list_empty(&starved_list)) {
414− int flagset;
415−
416417 /*
417418 * As long as shost is accepting commands and we have
418419 * starved queues, call blk_run_queue. scsi_request_fn
@@ -436,18 +437,9 @@ static void scsi_run_queue(struct request_queue *q) · 17 unmodified lines
436437 }
437438
438439 spin_unlock(shost->host_lock);
439−
440440 spin_lock(sdev->request_queue->queue_lock);
441− flagset = test_bit(QUEUE_FLAG_REENTER, &q->queue_flags) &&
442− !test_bit(QUEUE_FLAG_REENTER,
443− &sdev->request_queue->queue_flags);
444− if (flagset)
445− queue_flag_set(QUEUE_FLAG_REENTER, sdev->request_queue);
446441 __blk_run_queue(sdev->request_queue);
447− if (flagset)
448− queue_flag_clear(QUEUE_FLAG_REENTER, sdev->request_queue);
449442 spin_unlock(sdev->request_queue->queue_lock);
450−
451443 spin_lock(shost->host_lock);
452444 }
453445 /* put any unprocessed entries back */
@@ -457,6 +449,16 @@ static void scsi_run_queue(struct request_queue *q) · 3 unmodified lines
457449 blk_run_queue(q);
458450 }
459451
452+void scsi_requeue_run_queue(struct work_struct *work)
453+{
454+ struct scsi_device *sdev;
455+ struct request_queue *q;
456+
457+ sdev = container_of(work, struct scsi_device, requeue_work);
458+ q = sdev->request_queue;
459+ scsi_run_queue(q);
460+}
461+
460462 /*
461463 * Function: scsi_requeue_command()
462464 *
drivers/scsi/scsi_scan.c+2−0
@@ -242,6 +242,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, · 241 unmodified lines
242242 int display_failure_msg = 1, ret;
243243 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
244244 extern void scsi_evt_thread(struct work_struct *work);
245+ extern void scsi_requeue_run_queue(struct work_struct *work);
245246
246247 sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size,
247248 GFP_ATOMIC);
@@ -264,6 +265,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, · 16 unmodified lines
264265 INIT_LIST_HEAD(&sdev->event_list);
265266 spin_lock_init(&sdev->list_lock);
266267 INIT_WORK(&sdev->event_work, scsi_evt_thread);
268+ INIT_WORK(&sdev->requeue_work, scsi_requeue_run_queue);
267269
268270 sdev->sdev_gendev.parent = get_device(&starget->dev);
269271 sdev->sdev_target = starget;
drivers/scsi/scsi_sysfs.c+8−8
@@ -322,14 +322,8 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work) · 321 unmodified lines
322322 kfree(evt);
323323 }
324324
325− if (sdev->request_queue) {
326− sdev->request_queue->queuedata = NULL;
327− /* user context needed to free queue */
328− scsi_free_queue(sdev->request_queue);
329− /* temporary expedient, try to catch use of queue lock
330− * after free of sdev */
331− sdev->request_queue = NULL;
332− }
325+ /* NULL queue means the device can't be used */
326+ sdev->request_queue = NULL;
333327
334328 scsi_target_reap(scsi_target(sdev));
335329
@@ -937,6 +931,12 @@ void __scsi_remove_device(struct scsi_device *sdev) · 601 unmodified lines
937931 if (sdev->host->hostt->slave_destroy)
938932 sdev->host->hostt->slave_destroy(sdev);
939933 transport_destroy_device(dev);
934+
935+ /* cause the request function to reject all I/O requests */
936+ sdev->request_queue->queuedata = NULL;
937+
938+ /* Freeing the queue signals to block that we're done */
939+ scsi_free_queue(sdev->request_queue);
940940 put_device(dev);
941941 }
942942
drivers/scsi/scsi_transport_fc.c+4−15
@@ -3816,28 +3816,17 @@ fail_host_msg: · 3815 unmodified lines
38163816 static void
38173817 fc_bsg_goose_queue(struct fc_rport *rport)
38183818 {
3819− int flagset;
3820− unsigned long flags;
3821−
38223819 if (!rport->rqst_q)
38233820 return;
38243821
3822+ /*
3823+ * This get/put dance makes no sense
3824+ */
38253825 get_device(&rport->dev);
3826−
3827− spin_lock_irqsave(rport->rqst_q->queue_lock, flags);
3828− flagset = test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags) &&
3829− !test_bit(QUEUE_FLAG_REENTER, &rport->rqst_q->queue_flags);
3830− if (flagset)
3831− queue_flag_set(QUEUE_FLAG_REENTER, rport->rqst_q);
3832− __blk_run_queue(rport->rqst_q);
3833− if (flagset)
3834− queue_flag_clear(QUEUE_FLAG_REENTER, rport->rqst_q);
3835− spin_unlock_irqrestore(rport->rqst_q->queue_lock, flags);
3836−
3826+ blk_run_queue_async(rport->rqst_q);
38373827 put_device(&rport->dev);
38383828 }
38393829
3840−
38413830 /**
38423831 * fc_bsg_rport_dispatch - process rport bsg requests and dispatch to LLDD
38433832 * @q: rport request queue
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c+0−4
@@ -2288,7 +2288,3 @@ err_dev: · 2287 unmodified lines
22882288 free_netdev(dev);
22892289 return NULL;
22902290 }
2291−
2292−EXPORT_SYMBOL(init_ft1000_card);
2293−EXPORT_SYMBOL(stop_ft1000_card);
2294−EXPORT_SYMBOL(flarion_ft1000_cnt);
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c+0−3
@@ -214,6 +214,3 @@ void ft1000CleanupProc(struct net_device *dev) · 213 unmodified lines
214214 remove_proc_entry(FT1000_PROC, init_net.proc_net);
215215 unregister_netdevice_notifier(&ft1000_netdev_notifier);
216216 }
217−
218−EXPORT_SYMBOL(ft1000InitProc);
219−EXPORT_SYMBOL(ft1000CleanupProc);
drivers/staging/gma500/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config DRM_PSB
22 tristate "Intel GMA500 KMS Framebuffer"
3− depends on DRM && PCI
3+ depends on DRM && PCI && X86
44 select FB_CFB_COPYAREA
55 select FB_CFB_FILLRECT
66 select FB_CFB_IMAGEBLIT
drivers/staging/intel_sst/intelmid_v1_control.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2929
3030 #include <linux/pci.h>
31+#include <linux/delay.h>
3132 #include <linux/file.h>
3233 #include <asm/mrst.h>
3334 #include <sound/pcm.h>
drivers/staging/intel_sst/intelmid_v2_control.c+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
3030
3131 #include <linux/pci.h>
32+#include <linux/delay.h>
3233 #include <linux/file.h>
3334 #include "intel_sst.h"
3435 #include "intelmid_snd_control.h"
drivers/staging/olpc_dcon/olpc_dcon_xo_1.c+1−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 */
1313 #include <linux/cs5535.h>
1414 #include <linux/gpio.h>
15+#include <linux/delay.h>
1516 #include <asm/olpc.h>
1617
1718 #include "olpc_dcon.h"
drivers/staging/rt2860/common/cmm_data_pci.c+1−1
@@ -444,7 +444,7 @@ int RTMPCheckRxError(struct rt_rtmp_adapter *pAd, · 443 unmodified lines
444444 return (NDIS_STATUS_FAILURE);
445445 }
446446 }
447− /* Drop not U2M frames, can't's drop here because we will drop beacon in this case */
447+ /* Drop not U2M frames, can't drop here because we will drop beacon in this case */
448448 /* I am kind of doubting the U2M bit operation */
449449 /* if (pRxD->U2M == 0) */
450450 /* return(NDIS_STATUS_FAILURE); */
drivers/staging/rt2860/common/cmm_data_usb.c+1−1
@@ -860,7 +860,7 @@ int RTMPCheckRxError(struct rt_rtmp_adapter *pAd, · 859 unmodified lines
860860 DBGPRINT_RAW(RT_DEBUG_ERROR, ("received packet too long\n"));
861861 return NDIS_STATUS_FAILURE;
862862 }
863− /* Drop not U2M frames, can't's drop here because we will drop beacon in this case */
863+ /* Drop not U2M frames, can't drop here because we will drop beacon in this case */
864864 /* I am kind of doubting the U2M bit operation */
865865 /* if (pRxD->U2M == 0) */
866866 /* return(NDIS_STATUS_FAILURE); */
drivers/staging/rts_pstor/debug.h+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828
2929 #define RTSX_STOR "rts_pstor: "
3030
31−#if CONFIG_RTS_PSTOR_DEBUG
31+#ifdef CONFIG_RTS_PSTOR_DEBUG
3232 #define RTSX_DEBUGP(x...) printk(KERN_DEBUG RTSX_STOR x)
3333 #define RTSX_DEBUGPN(x...) printk(KERN_DEBUG x)
3434 #define RTSX_DEBUGPX(x...) printk(x)
drivers/staging/rts_pstor/ms.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/blkdev.h>
2424 #include <linux/kthread.h>
2525 #include <linux/sched.h>
26+#include <linux/vmalloc.h>
2627
2728 #include "rtsx.h"
2829 #include "rtsx_transport.h"
drivers/staging/rts_pstor/rtsx_chip.c+3−2
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <linux/kthread.h>
2525 #include <linux/sched.h>
2626 #include <linux/workqueue.h>
27+#include <linux/vmalloc.h>
2728
2829 #include "rtsx.h"
2930 #include "rtsx_transport.h"
@@ -1311,11 +1312,11 @@ void rtsx_polling_func(struct rtsx_chip *chip) · 1281 unmodified lines
13111312
13121313 #ifdef SUPPORT_OCP
13131314 if (CHECK_LUN_MODE(chip, SD_MS_2LUN)) {
1314− #if CONFIG_RTS_PSTOR_DEBUG
1315+#ifdef CONFIG_RTS_PSTOR_DEBUG
13151316 if (chip->ocp_stat & (SD_OC_NOW | SD_OC_EVER | MS_OC_NOW | MS_OC_EVER)) {
13161317 RTSX_DEBUGP("Over current, OCPSTAT is 0x%x\n", chip->ocp_stat);
13171318 }
1318− #endif
1319+#endif
13191320
13201321 if (chip->ocp_stat & (SD_OC_NOW | SD_OC_EVER)) {
13211322 if (chip->card_exist & SD_CARD) {
drivers/staging/rts_pstor/rtsx_scsi.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/blkdev.h>
2424 #include <linux/kthread.h>
2525 #include <linux/sched.h>
26+#include <linux/vmalloc.h>
2627
2728 #include "rtsx.h"
2829 #include "rtsx_transport.h"
drivers/staging/rts_pstor/sd.c+2−2
@@ -909,7 +909,7 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) · 908 unmodified lines
909909 RTSX_WRITE_REG(chip, SD_VPCLK0_CTL, PHASE_NOT_RESET, PHASE_NOT_RESET);
910910 RTSX_WRITE_REG(chip, CLK_CTL, CHANGE_CLK, 0);
911911 } else {
912−#if CONFIG_RTS_PSTOR_DEBUG
912+#ifdef CONFIG_RTS_PSTOR_DEBUG
913913 rtsx_read_register(chip, SD_VP_CTL, &val);
914914 RTSX_DEBUGP("SD_VP_CTL: 0x%x\n", val);
915915 rtsx_read_register(chip, SD_DCMPS_CTL, &val);
@@ -958,7 +958,7 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 sample_point, u8 tune_dir) · 42 unmodified lines
958958 return STATUS_SUCCESS;
959959
960960 Fail:
961−#if CONFIG_RTS_PSTOR_DEBUG
961+#ifdef CONFIG_RTS_PSTOR_DEBUG
962962 rtsx_read_register(chip, SD_VP_CTL, &val);
963963 RTSX_DEBUGP("SD_VP_CTL: 0x%x\n", val);
964964 rtsx_read_register(chip, SD_DCMPS_CTL, &val);
drivers/staging/rts_pstor/trace.h+1−1
@@ -82,7 +82,7 @@ do { \ · 81 unmodified lines
8282 #define TRACE_GOTO(chip, label) goto label
8383 #endif
8484
85−#if CONFIG_RTS_PSTOR_DEBUG
85+#ifdef CONFIG_RTS_PSTOR_DEBUG
8686 static inline void rtsx_dump(u8 *buf, int buf_len)
8787 {
8888 int i;
drivers/staging/rts_pstor/xd.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/blkdev.h>
2424 #include <linux/kthread.h>
2525 #include <linux/sched.h>
26+#include <linux/vmalloc.h>
2627
2728 #include "rtsx.h"
2829 #include "rtsx_transport.h"
drivers/staging/solo6x10/Kconfig+1−0
@@ -2,6 +2,7 @@ config SOLO6X10 · 1 unmodified line
22 tristate "Softlogic 6x10 MPEG codec cards"
33 depends on PCI && VIDEO_DEV && SND && I2C
44 select VIDEOBUF_DMA_SG
5+ select SND_PCM
56 ---help---
67 This driver supports the Softlogic based MPEG-4 and h.264 codec
78 codec cards.
drivers/staging/spectra/ffsport.c+1−1
@@ -653,7 +653,7 @@ static int SBD_setup_device(struct spectra_nand_dev *dev, int which) · 652 unmodified lines
653653 }
654654 dev->queue->queuedata = dev;
655655
656− /* As Linux block layer does't support >4KB hardware sector, */
656+ /* As Linux block layer doesn't support >4KB hardware sector, */
657657 /* Here we force report 512 byte hardware sector size to Kernel */
658658 blk_queue_logical_block_size(dev->queue, 512);
659659
drivers/staging/tidspbridge/dynload/cload.c+1−1
@@ -718,7 +718,7 @@ static void dload_symbols(struct dload_state *dlthis) · 717 unmodified lines
718718 * as a temporary for .dllview record construction.
719719 * Allocate storage for the whole table. Add 1 to the section count
720720 * in case a trampoline section is auto-generated as well as the
721− * size of the trampoline section name so DLLView does't get lost.
721+ * size of the trampoline section name so DLLView doesn't get lost.
722722 */
723723
724724 siz = sym_count * sizeof(struct local_symbol);
drivers/staging/tty/specialix.c+1−1
@@ -978,7 +978,7 @@ static void sx_change_speed(struct specialix_board *bp, · 977 unmodified lines
978978 spin_lock_irqsave(&bp->lock, flags);
979979 sx_out(bp, CD186x_CAR, port_No(port));
980980
981− /* The Specialix board does't implement the RTS lines.
981+ /* The Specialix board doesn't implement the RTS lines.
982982 They are used to set the IRQ level. Don't touch them. */
983983 if (sx_crtscts(tty))
984984 port->MSVR = MSVR_DTR | (sx_in(bp, CD186x_MSVR) & MSVR_RTS);
drivers/staging/usbip/vhci_hcd.c+5−6
@@ -876,8 +876,10 @@ static void vhci_shutdown_connection(struct usbip_device *ud) · 875 unmodified lines
876876 }
877877
878878 /* kill threads related to this sdev, if v.c. exists */
879− kthread_stop(vdev->ud.tcp_rx);
880− kthread_stop(vdev->ud.tcp_tx);
879+ if (vdev->ud.tcp_rx)
880+ kthread_stop(vdev->ud.tcp_rx);
881+ if (vdev->ud.tcp_tx)
882+ kthread_stop(vdev->ud.tcp_tx);
881883
882884 usbip_uinfo("stop threads\n");
883885
@@ -949,9 +951,6 @@ static void vhci_device_init(struct vhci_device *vdev) · 65 unmodified lines
949951 {
950952 memset(vdev, 0, sizeof(*vdev));
951953
952− vdev->ud.tcp_rx = kthread_create(vhci_rx_loop, &vdev->ud, "vhci_rx");
953− vdev->ud.tcp_tx = kthread_create(vhci_tx_loop, &vdev->ud, "vhci_tx");
954−
955954 vdev->ud.side = USBIP_VHCI;
956955 vdev->ud.status = VDEV_ST_NULL;
957956 /* vdev->ud.lock = SPIN_LOCK_UNLOCKED; */
@@ -1139,7 +1138,7 @@ static int vhci_hcd_probe(struct platform_device *pdev) · 181 unmodified lines
11391138 usbip_uerr("create hcd failed\n");
11401139 return -ENOMEM;
11411140 }
1142−
1141+ hcd->has_tt = 1;
11431142
11441143 /* this is private data for vhci_hcd */
11451144 the_controller = hcd_to_vhci(hcd);
drivers/staging/usbip/vhci_sysfs.c+4−3
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include "vhci.h"
2222
2323 #include <linux/in.h>
24+#include <linux/kthread.h>
2425
2526 /* TODO: refine locking ?*/
2627
@@ -220,13 +221,13 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr, · 193 unmodified lines
220221 vdev->ud.tcp_socket = socket;
221222 vdev->ud.status = VDEV_ST_NOTASSIGNED;
222223
223− wake_up_process(vdev->ud.tcp_rx);
224− wake_up_process(vdev->ud.tcp_tx);
225−
226224 spin_unlock(&vdev->ud.lock);
227225 spin_unlock(&the_controller->lock);
228226 /* end the lock */
229227
228+ vdev->ud.tcp_rx = kthread_run(vhci_rx_loop, &vdev->ud, "vhci_rx");
229+ vdev->ud.tcp_tx = kthread_run(vhci_tx_loop, &vdev->ud, "vhci_tx");
230+
230231 rh_port_connect(rhport, speed);
231232
232233 return count;
drivers/staging/wlan-ng/cfg80211.c+1−1
@@ -273,7 +273,7 @@ exit: · 272 unmodified lines
273273 }
274274
275275 int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev,
276− u8 key_index)
276+ u8 key_index, bool unicast, bool multicast)
277277 {
278278 wlandevice_t *wlandev = dev->ml_priv;
279279
drivers/tty/n_gsm.c+6−2
@@ -1658,8 +1658,12 @@ static void gsm_queue(struct gsm_mux *gsm) · 1657 unmodified lines
16581658
16591659 if ((gsm->control & ~PF) == UI)
16601660 gsm->fcs = gsm_fcs_add_block(gsm->fcs, gsm->buf, gsm->len);
1661− /* generate final CRC with received FCS */
1662− gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs);
1661+ if (gsm->encoding == 0){
1662+ /* WARNING: gsm->received_fcs is used for gsm->encoding = 0 only.
1663+ In this case it contain the last piece of data
1664+ required to generate final CRC */
1665+ gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs);
1666+ }
16631667 if (gsm->fcs != GOOD_FCS) {
16641668 gsm->bad_fcs++;
16651669 if (debug & 4)
drivers/tty/serial/imx.c+2−1
@@ -382,12 +382,13 @@ static void imx_start_tx(struct uart_port *port) · 381 unmodified lines
382382 static irqreturn_t imx_rtsint(int irq, void *dev_id)
383383 {
384384 struct imx_port *sport = dev_id;
385− unsigned int val = readl(sport->port.membase + USR1) & USR1_RTSS;
385+ unsigned int val;
386386 unsigned long flags;
387387
388388 spin_lock_irqsave(&sport->port.lock, flags);
389389
390390 writel(USR1_RTSD, sport->port.membase + USR1);
391+ val = readl(sport->port.membase + USR1) & USR1_RTSS;
391392 uart_handle_cts_change(&sport->port, !!val);
392393 wake_up_interruptible(&sport->port.state->port.delta_msr_wait);
393394
drivers/tty/serial/of_serial.c+5−2
@@ -80,14 +80,17 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev, · 79 unmodified lines
8080 /*
8181 * Try to register a serial port
8282 */
83+static struct of_device_id of_platform_serial_table[];
8384 static int __devinit of_platform_serial_probe(struct platform_device *ofdev)
8485 {
86+ const struct of_device_id *match;
8587 struct of_serial_info *info;
8688 struct uart_port port;
8789 int port_type;
8890 int ret;
8991
90− if (!ofdev->dev.of_match)
92+ match = of_match_device(of_platform_serial_table, &ofdev->dev);
93+ if (!match)
9194 return -EINVAL;
9295
9396 if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
@@ -97,7 +100,7 @@ static int __devinit of_platform_serial_probe(struct platform_device *ofdev) · 3 unmodified lines
97100 if (info == NULL)
98101 return -ENOMEM;
99102
100− port_type = (unsigned long)ofdev->dev.of_match->data;
103+ port_type = (unsigned long)match->data;
101104 ret = of_platform_serial_setup(ofdev, port_type, &port);
102105 if (ret)
103106 goto out;
drivers/usb/gadget/fsl_qe_udc.c+5−2
@@ -2539,15 +2539,18 @@ static void qe_udc_release(struct device *dev) · 2538 unmodified lines
25392539 }
25402540
25412541 /* Driver probe functions */
2542+static const struct of_device_id qe_udc_match[];
25422543 static int __devinit qe_udc_probe(struct platform_device *ofdev)
25432544 {
2545+ const struct of_device_id *match;
25442546 struct device_node *np = ofdev->dev.of_node;
25452547 struct qe_ep *ep;
25462548 unsigned int ret = 0;
25472549 unsigned int i;
25482550 const void *prop;
25492551
2550− if (!ofdev->dev.of_match)
2552+ match = of_match_device(qe_udc_match, &ofdev->dev);
2553+ if (!match)
25512554 return -EINVAL;
25522555
25532556 prop = of_get_property(np, "mode", NULL);
@@ -2561,7 +2564,7 @@ static int __devinit qe_udc_probe(struct platform_device *ofdev) · 7 unmodified lines
25612564 return -ENOMEM;
25622565 }
25632566
2564− udc_controller->soc_type = (unsigned long)ofdev->dev.of_match->data;
2567+ udc_controller->soc_type = (unsigned long)match->data;
25652568 udc_controller->usb_regs = of_iomap(np, 0);
25662569 if (!udc_controller->usb_regs) {
25672570 ret = -ENOMEM;
drivers/usb/host/ehci-omap.c+20−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 #include <linux/slab.h>
4141 #include <linux/usb/ulpi.h>
4242 #include <plat/usb.h>
43+#include <linux/regulator/consumer.h>
4344
4445 /* EHCI Register Set */
4546 #define EHCI_INSNREG04 (0xA0)
@@ -118,6 +119,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) · 72 unmodified lines
118119 struct ehci_hcd *omap_ehci;
119120 int ret = -ENODEV;
120121 int irq;
122+ int i;
123+ char supply[7];
121124
122125 if (usb_disabled())
123126 return -ENODEV;
@@ -158,6 +161,23 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) · 34 unmodified lines
158161 hcd->rsrc_len = resource_size(res);
159162 hcd->regs = regs;
160163
164+ /* get ehci regulator and enable */
165+ for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
166+ if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) {
167+ pdata->regulator[i] = NULL;
168+ continue;
169+ }
170+ snprintf(supply, sizeof(supply), "hsusb%d", i);
171+ pdata->regulator[i] = regulator_get(dev, supply);
172+ if (IS_ERR(pdata->regulator[i])) {
173+ pdata->regulator[i] = NULL;
174+ dev_dbg(dev,
175+ "failed to get ehci port%d regulator\n", i);
176+ } else {
177+ regulator_enable(pdata->regulator[i]);
178+ }
179+ }
180+
161181 ret = omap_usbhs_enable(dev);
162182 if (ret) {
163183 dev_err(dev, "failed to start usbhs with err %d\n", ret);
drivers/usb/host/isp1760-hcd.c+1−0
@@ -1633,6 +1633,7 @@ static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) · 1632 unmodified lines
16331633 ints[i].qh = NULL;
16341634 ints[i].qtd = NULL;
16351635
1636+ urb->status = status;
16361637 isp1760_urb_done(hcd, urb);
16371638 if (qtd)
16381639 pe(hcd, qh, qtd);
drivers/usb/host/xhci-hub.c+17−2
@@ -777,7 +777,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd) · 776 unmodified lines
777777 if (t1 != t2)
778778 xhci_writel(xhci, t2, port_array[port_index]);
779779
780− if (DEV_HIGHSPEED(t1)) {
780+ if (hcd->speed != HCD_USB3) {
781781 /* enable remote wake up for USB 2.0 */
782782 u32 __iomem *addr;
783783 u32 tmp;
@@ -866,6 +866,21 @@ int xhci_bus_resume(struct usb_hcd *hcd) · 82 unmodified lines
866866 temp |= PORT_LINK_STROBE | XDEV_U0;
867867 xhci_writel(xhci, temp, port_array[port_index]);
868868 }
869+ /* wait for the port to enter U0 and report port link
870+ * state change.
871+ */
872+ spin_unlock_irqrestore(&xhci->lock, flags);
873+ msleep(20);
874+ spin_lock_irqsave(&xhci->lock, flags);
875+
876+ /* Clear PLC */
877+ temp = xhci_readl(xhci, port_array[port_index]);
878+ if (temp & PORT_PLC) {
879+ temp = xhci_port_state_to_neutral(temp);
880+ temp |= PORT_PLC;
881+ xhci_writel(xhci, temp, port_array[port_index]);
882+ }
883+
869884 slot_id = xhci_find_slot_id_by_port(hcd,
870885 xhci, port_index + 1);
871886 if (slot_id)
@@ -873,7 +888,7 @@ int xhci_bus_resume(struct usb_hcd *hcd) · 1 unmodified line
873888 } else
874889 xhci_writel(xhci, temp, port_array[port_index]);
875890
876− if (DEV_HIGHSPEED(temp)) {
891+ if (hcd->speed != HCD_USB3) {
877892 /* disable remote wake up for USB 2.0 */
878893 u32 __iomem *addr;
879894 u32 tmp;
drivers/usb/musb/musb_gadget.c+2−4
@@ -1887,11 +1887,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, · 1886 unmodified lines
18871887 otg_set_vbus(musb->xceiv, 1);
18881888
18891889 hcd->self.uses_pio_for_control = 1;
1890−
1891− if (musb->xceiv->last_event == USB_EVENT_NONE)
1892− pm_runtime_put(musb->controller);
1893−
18941890 }
1891+ if (musb->xceiv->last_event == USB_EVENT_NONE)
1892+ pm_runtime_put(musb->controller);
18951893
18961894 return 0;
18971895
drivers/usb/musb/omap2430.c+1−1
@@ -270,7 +270,7 @@ static int musb_otg_notifications(struct notifier_block *nb, · 269 unmodified lines
270270 DBG(4, "VBUS Disconnect\n");
271271
272272 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
273− if (is_otg_enabled(musb))
273+ if (is_otg_enabled(musb) || is_peripheral_enabled(musb))
274274 if (musb->gadget_driver)
275275 #endif
276276 {
drivers/video/acornfb.c+10−16
@@ -66,7 +66,7 @@ · 65 unmodified lines
6666 * have. Allow 1% either way on the nominal for TVs.
6767 */
6868 #define NR_MONTYPES 6
69−static struct fb_monspecs monspecs[NR_MONTYPES] __initdata = {
69+static struct fb_monspecs monspecs[NR_MONTYPES] __devinitdata = {
7070 { /* TV */
7171 .hfmin = 15469,
7272 .hfmax = 15781,
@@ -873,7 +873,7 @@ static struct fb_ops acornfb_ops = { · 800 unmodified lines
873873 /*
874874 * Everything after here is initialisation!!!
875875 */
876−static struct fb_videomode modedb[] __initdata = {
876+static struct fb_videomode modedb[] __devinitdata = {
877877 { /* 320x256 @ 50Hz */
878878 NULL, 50, 320, 256, 125000, 92, 62, 35, 19, 38, 2,
879879 FB_SYNC_COMP_HIGH_ACT,
@@ -925,8 +925,7 @@ static struct fb_videomode modedb[] __initdata = { · 45 unmodified lines
925925 }
926926 };
927927
928−static struct fb_videomode __initdata
929−acornfb_default_mode = {
928+static struct fb_videomode acornfb_default_mode __devinitdata = {
930929 .name = NULL,
931930 .refresh = 60,
932931 .xres = 640,
@@ -942,7 +941,7 @@ acornfb_default_mode = { · 9 unmodified lines
942941 .vmode = FB_VMODE_NONINTERLACED
943942 };
944943
945−static void __init acornfb_init_fbinfo(void)
944+static void __devinit acornfb_init_fbinfo(void)
946945 {
947946 static int first = 1;
948947
@@ -1018,8 +1017,7 @@ static void __init acornfb_init_fbinfo(void) · 69 unmodified lines
10181017 * size can optionally be followed by 'M' or 'K' for
10191018 * MB or KB respectively.
10201019 */
1021−static void __init
1022−acornfb_parse_mon(char *opt)
1020+static void __devinit acornfb_parse_mon(char *opt)
10231021 {
10241022 char *p = opt;
10251023
@@ -1066,8 +1064,7 @@ bad: · 40 unmodified lines
10661064 current_par.montype = -1;
10671065 }
10681066
1069−static void __init
1070−acornfb_parse_montype(char *opt)
1067+static void __devinit acornfb_parse_montype(char *opt)
10711068 {
10721069 current_par.montype = -2;
10731070
@@ -1108,8 +1105,7 @@ acornfb_parse_montype(char *opt) · 34 unmodified lines
11081105 }
11091106 }
11101107
1111−static void __init
1112−acornfb_parse_dram(char *opt)
1108+static void __devinit acornfb_parse_dram(char *opt)
11131109 {
11141110 unsigned int size;
11151111
@@ -1134,15 +1130,14 @@ acornfb_parse_dram(char *opt) · 18 unmodified lines
11341130 static struct options {
11351131 char *name;
11361132 void (*parse)(char *opt);
1137−} opt_table[] __initdata = {
1133+} opt_table[] __devinitdata = {
11381134 { "mon", acornfb_parse_mon },
11391135 { "montype", acornfb_parse_montype },
11401136 { "dram", acornfb_parse_dram },
11411137 { NULL, NULL }
11421138 };
11431139
1144−int __init
1145−acornfb_setup(char *options)
1140+static int __devinit acornfb_setup(char *options)
11461141 {
11471142 struct options *optp;
11481143 char *opt;
@@ -1179,8 +1174,7 @@ acornfb_setup(char *options) · 30 unmodified lines
11791174 * Detect type of monitor connected
11801175 * For now, we just assume SVGA
11811176 */
1182−static int __init
1183−acornfb_detect_monitortype(void)
1177+static int __devinit acornfb_detect_monitortype(void)
11841178 {
11851179 return 4;
11861180 }
drivers/video/fbmem.c+148−75
@@ -42,9 +42,34 @@ · 41 unmodified lines
4242
4343 #define FBPIXMAPSIZE (1024 * 8)
4444
45+static DEFINE_MUTEX(registration_lock);
4546 struct fb_info *registered_fb[FB_MAX] __read_mostly;
4647 int num_registered_fb __read_mostly;
4748
49+static struct fb_info *get_fb_info(unsigned int idx)
50+{
51+ struct fb_info *fb_info;
52+
53+ if (idx >= FB_MAX)
54+ return ERR_PTR(-ENODEV);
55+
56+ mutex_lock(&registration_lock);
57+ fb_info = registered_fb[idx];
58+ if (fb_info)
59+ atomic_inc(&fb_info->count);
60+ mutex_unlock(&registration_lock);
61+
62+ return fb_info;
63+}
64+
65+static void put_fb_info(struct fb_info *fb_info)
66+{
67+ if (!atomic_dec_and_test(&fb_info->count))
68+ return;
69+ if (fb_info->fbops->fb_destroy)
70+ fb_info->fbops->fb_destroy(fb_info);
71+}
72+
4873 int lock_fb_info(struct fb_info *info)
4974 {
5075 mutex_lock(&info->lock);
@@ -647,6 +672,7 @@ int fb_show_logo(struct fb_info *info, int rotate) { return 0; } · 596 unmodified lines
647672
648673 static void *fb_seq_start(struct seq_file *m, loff_t *pos)
649674 {
675+ mutex_lock(&registration_lock);
650676 return (*pos < FB_MAX) ? pos : NULL;
651677 }
652678
@@ -658,6 +684,7 @@ static void *fb_seq_next(struct seq_file *m, void *v, loff_t *pos) · 5 unmodified lines
658684
659685 static void fb_seq_stop(struct seq_file *m, void *v)
660686 {
687+ mutex_unlock(&registration_lock);
661688 }
662689
663690 static int fb_seq_show(struct seq_file *m, void *v)
@@ -690,13 +717,30 @@ static const struct file_operations fb_proc_fops = { · 26 unmodified lines
690717 .release = seq_release,
691718 };
692719
693−static ssize_t
694−fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
720+/*
721+ * We hold a reference to the fb_info in file->private_data,
722+ * but if the current registered fb has changed, we don't
723+ * actually want to use it.
724+ *
725+ * So look up the fb_info using the inode minor number,
726+ * and just verify it against the reference we have.
727+ */
728+static struct fb_info *file_fb_info(struct file *file)
695729 {
696− unsigned long p = *ppos;
697730 struct inode *inode = file->f_path.dentry->d_inode;
698731 int fbidx = iminor(inode);
699732 struct fb_info *info = registered_fb[fbidx];
733+
734+ if (info != file->private_data)
735+ info = NULL;
736+ return info;
737+}
738+
739+static ssize_t
740+fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
741+{
742+ unsigned long p = *ppos;
743+ struct fb_info *info = file_fb_info(file);
700744 u8 *buffer, *dst;
701745 u8 __iomem *src;
702746 int c, cnt = 0, err = 0;
@@ -761,9 +805,7 @@ static ssize_t · 58 unmodified lines
761805 fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
762806 {
763807 unsigned long p = *ppos;
764− struct inode *inode = file->f_path.dentry->d_inode;
765− int fbidx = iminor(inode);
766− struct fb_info *info = registered_fb[fbidx];
808+ struct fb_info *info = file_fb_info(file);
767809 u8 *buffer, *src;
768810 u8 __iomem *dst;
769811 int c, cnt = 0, err = 0;
@@ -1141,10 +1183,10 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, · 371 unmodified lines
11411183
11421184 static long fb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
11431185 {
1144− struct inode *inode = file->f_path.dentry->d_inode;
1145− int fbidx = iminor(inode);
1146− struct fb_info *info = registered_fb[fbidx];
1186+ struct fb_info *info = file_fb_info(file);
11471187
1188+ if (!info)
1189+ return -ENODEV;
11481190 return do_fb_ioctl(info, cmd, arg);
11491191 }
11501192
@@ -1265,12 +1307,13 @@ static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, · 114 unmodified lines
12651307 static long fb_compat_ioctl(struct file *file, unsigned int cmd,
12661308 unsigned long arg)
12671309 {
1268− struct inode *inode = file->f_path.dentry->d_inode;
1269− int fbidx = iminor(inode);
1270− struct fb_info *info = registered_fb[fbidx];
1271− struct fb_ops *fb = info->fbops;
1310+ struct fb_info *info = file_fb_info(file);
1311+ struct fb_ops *fb;
12721312 long ret = -ENOIOCTLCMD;
12731313
1314+ if (!info)
1315+ return -ENODEV;
1316+ fb = info->fbops;
12741317 switch(cmd) {
12751318 case FBIOGET_VSCREENINFO:
12761319 case FBIOPUT_VSCREENINFO:
@@ -1303,16 +1346,18 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd, · 26 unmodified lines
13031346 static int
13041347 fb_mmap(struct file *file, struct vm_area_struct * vma)
13051348 {
1306− int fbidx = iminor(file->f_path.dentry->d_inode);
1307− struct fb_info *info = registered_fb[fbidx];
1308− struct fb_ops *fb = info->fbops;
1349+ struct fb_info *info = file_fb_info(file);
1350+ struct fb_ops *fb;
13091351 unsigned long off;
13101352 unsigned long start;
13111353 u32 len;
13121354
1355+ if (!info)
1356+ return -ENODEV;
13131357 if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
13141358 return -EINVAL;
13151359 off = vma->vm_pgoff << PAGE_SHIFT;
1360+ fb = info->fbops;
13161361 if (!fb)
13171362 return -ENODEV;
13181363 mutex_lock(&info->mm_lock);
@@ -1361,14 +1406,16 @@ __releases(&info->lock) · 42 unmodified lines
13611406 struct fb_info *info;
13621407 int res = 0;
13631408
1364− if (fbidx >= FB_MAX)
1365− return -ENODEV;
1366− info = registered_fb[fbidx];
1367− if (!info)
1409+ info = get_fb_info(fbidx);
1410+ if (!info) {
13681411 request_module("fb%d", fbidx);
1369− info = registered_fb[fbidx];
1370− if (!info)
1371− return -ENODEV;
1412+ info = get_fb_info(fbidx);
1413+ if (!info)
1414+ return -ENODEV;
1415+ }
1416+ if (IS_ERR(info))
1417+ return PTR_ERR(info);
1418+
13721419 mutex_lock(&info->lock);
13731420 if (!try_module_get(info->fbops->owner)) {
13741421 res = -ENODEV;
@@ -1386,6 +1433,8 @@ __releases(&info->lock) · 11 unmodified lines
13861433 #endif
13871434 out:
13881435 mutex_unlock(&info->lock);
1436+ if (res)
1437+ put_fb_info(info);
13891438 return res;
13901439 }
13911440
@@ -1401,6 +1450,7 @@ __releases(&info->lock) · 9 unmodified lines
14011450 info->fbops->fb_release(info,1);
14021451 module_put(info->fbops->owner);
14031452 mutex_unlock(&info->lock);
1453+ put_fb_info(info);
14041454 return 0;
14051455 }
14061456
@@ -1487,8 +1537,10 @@ static bool fb_do_apertures_overlap(struct apertures_struct *gena, · 80 unmodified lines
14871537 return false;
14881538 }
14891539
1540+static int do_unregister_framebuffer(struct fb_info *fb_info);
1541+
14901542 #define VGA_FB_PHYS 0xA0000
1491−void remove_conflicting_framebuffers(struct apertures_struct *a,
1543+static void do_remove_conflicting_framebuffers(struct apertures_struct *a,
14921544 const char *name, bool primary)
14931545 {
14941546 int i;
@@ -1510,43 +1562,32 @@ void remove_conflicting_framebuffers(struct apertures_struct *a, · 15 unmodified lines
15101562 printk(KERN_INFO "fb: conflicting fb hw usage "
15111563 "%s vs %s - removing generic driver\n",
15121564 name, registered_fb[i]->fix.id);
1513− unregister_framebuffer(registered_fb[i]);
1565+ do_unregister_framebuffer(registered_fb[i]);
15141566 }
15151567 }
15161568 }
1517−EXPORT_SYMBOL(remove_conflicting_framebuffers);
15181569
1519−/**
1520− * register_framebuffer - registers a frame buffer device
1521− * @fb_info: frame buffer info structure
1522− *
1523− * Registers a frame buffer device @fb_info.
1524− *
1525− * Returns negative errno on error, or zero for success.
1526− *
1527− */
1528−
1529−int
1530−register_framebuffer(struct fb_info *fb_info)
1570+static int do_register_framebuffer(struct fb_info *fb_info)
15311571 {
15321572 int i;
15331573 struct fb_event event;
15341574 struct fb_videomode mode;
15351575
1536− if (num_registered_fb == FB_MAX)
1537− return -ENXIO;
1538−
15391576 if (fb_check_foreignness(fb_info))
15401577 return -ENOSYS;
15411578
1542− remove_conflicting_framebuffers(fb_info->apertures, fb_info->fix.id,
1579+ do_remove_conflicting_framebuffers(fb_info->apertures, fb_info->fix.id,
15431580 fb_is_primary_device(fb_info));
15441581
1582+ if (num_registered_fb == FB_MAX)
1583+ return -ENXIO;
1584+
15451585 num_registered_fb++;
15461586 for (i = 0 ; i < FB_MAX; i++)
15471587 if (!registered_fb[i])
15481588 break;
15491589 fb_info->node = i;
1590+ atomic_set(&fb_info->count, 1);
15501591 mutex_init(&fb_info->lock);
15511592 mutex_init(&fb_info->mm_lock);
15521593
@@ -1592,36 +1633,14 @@ register_framebuffer(struct fb_info *fb_info) · 39 unmodified lines
15921633 return 0;
15931634 }
15941635
1595−
1596−/**
1597− * unregister_framebuffer - releases a frame buffer device
1598− * @fb_info: frame buffer info structure
1599− *
1600− * Unregisters a frame buffer device @fb_info.
1601− *
1602− * Returns negative errno on error, or zero for success.
1603− *
1604− * This function will also notify the framebuffer console
1605− * to release the driver.
1606− *
1607− * This is meant to be called within a driver's module_exit()
1608− * function. If this is called outside module_exit(), ensure
1609− * that the driver implements fb_open() and fb_release() to
1610− * check that no processes are using the device.
1611− */
1612−
1613−int
1614−unregister_framebuffer(struct fb_info *fb_info)
1636+static int do_unregister_framebuffer(struct fb_info *fb_info)
16151637 {
16161638 struct fb_event event;
16171639 int i, ret = 0;
16181640
16191641 i = fb_info->node;
1620− if (!registered_fb[i]) {
1621− ret = -EINVAL;
1622− goto done;
1623− }
1624−
1642+ if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)
1643+ return -EINVAL;
16251644
16261645 if (!lock_fb_info(fb_info))
16271646 return -ENODEV;
@@ -1629,16 +1648,14 @@ unregister_framebuffer(struct fb_info *fb_info) · 1 unmodified line
16291648 ret = fb_notifier_call_chain(FB_EVENT_FB_UNBIND, &event);
16301649 unlock_fb_info(fb_info);
16311650
1632− if (ret) {
1633− ret = -EINVAL;
1634− goto done;
1635− }
1651+ if (ret)
1652+ return -EINVAL;
16361653
16371654 if (fb_info->pixmap.addr &&
16381655 (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
16391656 kfree(fb_info->pixmap.addr);
16401657 fb_destroy_modelist(&fb_info->modelist);
1641− registered_fb[i]=NULL;
1658+ registered_fb[i] = NULL;
16421659 num_registered_fb--;
16431660 fb_cleanup_device(fb_info);
16441661 device_destroy(fb_class, MKDEV(FB_MAJOR, i));
@@ -1646,9 +1663,65 @@ unregister_framebuffer(struct fb_info *fb_info) · 1 unmodified line
16461663 fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
16471664
16481665 /* this may free fb info */
1649− if (fb_info->fbops->fb_destroy)
1650− fb_info->fbops->fb_destroy(fb_info);
1651−done:
1666+ put_fb_info(fb_info);
1667+ return 0;
1668+}
1669+
1670+void remove_conflicting_framebuffers(struct apertures_struct *a,
1671+ const char *name, bool primary)
1672+{
1673+ mutex_lock(&registration_lock);
1674+ do_remove_conflicting_framebuffers(a, name, primary);
1675+ mutex_unlock(&registration_lock);
1676+}
1677+EXPORT_SYMBOL(remove_conflicting_framebuffers);
1678+
1679+/**
1680+ * register_framebuffer - registers a frame buffer device
1681+ * @fb_info: frame buffer info structure
1682+ *
1683+ * Registers a frame buffer device @fb_info.
1684+ *
1685+ * Returns negative errno on error, or zero for success.
1686+ *
1687+ */
1688+int
1689+register_framebuffer(struct fb_info *fb_info)
1690+{
1691+ int ret;
1692+
1693+ mutex_lock(&registration_lock);
1694+ ret = do_register_framebuffer(fb_info);
1695+ mutex_unlock(&registration_lock);
1696+
1697+ return ret;
1698+}
1699+
1700+/**
1701+ * unregister_framebuffer - releases a frame buffer device
1702+ * @fb_info: frame buffer info structure
1703+ *
1704+ * Unregisters a frame buffer device @fb_info.
1705+ *
1706+ * Returns negative errno on error, or zero for success.
1707+ *
1708+ * This function will also notify the framebuffer console
1709+ * to release the driver.
1710+ *
1711+ * This is meant to be called within a driver's module_exit()
1712+ * function. If this is called outside module_exit(), ensure
1713+ * that the driver implements fb_open() and fb_release() to
1714+ * check that no processes are using the device.
1715+ */
1716+int
1717+unregister_framebuffer(struct fb_info *fb_info)
1718+{
1719+ int ret;
1720+
1721+ mutex_lock(&registration_lock);
1722+ ret = do_unregister_framebuffer(fb_info);
1723+ mutex_unlock(&registration_lock);
1724+
16521725 return ret;
16531726 }
16541727
drivers/virtio/virtio_pci.c+8−7
@@ -590,15 +590,10 @@ static struct virtio_config_ops virtio_pci_config_ops = { · 589 unmodified lines
590590
591591 static void virtio_pci_release_dev(struct device *_d)
592592 {
593− struct virtio_device *dev = container_of(_d, struct virtio_device, dev);
593+ struct virtio_device *dev = container_of(_d, struct virtio_device,
594+ dev);
594595 struct virtio_pci_device *vp_dev = to_vp_device(dev);
595− struct pci_dev *pci_dev = vp_dev->pci_dev;
596596
597− vp_del_vqs(dev);
598− pci_set_drvdata(pci_dev, NULL);
599− pci_iounmap(pci_dev, vp_dev->ioaddr);
600− pci_release_regions(pci_dev);
601− pci_disable_device(pci_dev);
602597 kfree(vp_dev);
603598 }
604599
@@ -681,6 +676,12 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev) · 76 unmodified lines
681676 struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
682677
683678 unregister_virtio_device(&vp_dev->vdev);
679+
680+ vp_del_vqs(&vp_dev->vdev);
681+ pci_set_drvdata(pci_dev, NULL);
682+ pci_iounmap(pci_dev, vp_dev->ioaddr);
683+ pci_release_regions(pci_dev);
684+ pci_disable_device(pci_dev);
684685 }
685686
686687 #ifdef CONFIG_PM
drivers/virtio/virtio_ring.c+1−0
@@ -371,6 +371,7 @@ void *virtqueue_detach_unused_buf(struct virtqueue *_vq) · 370 unmodified lines
371371 /* detach_buf clears data, so grab it now. */
372372 buf = vq->data[i];
373373 detach_buf(vq, i);
374+ vq->vring.avail->idx--;
374375 END_USE(vq);
375376 return buf;
376377 }
drivers/watchdog/iTCO_wdt.c+97−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 * document number 324645-001, 324646-001: Cougar Point (CPT)
3636 * document number TBD : Patsburg (PBG)
3737 * document number TBD : DH89xxCC
38+ * document number TBD : Panther Point
3839 */
3940
4041 /*
@@ -153,6 +154,38 @@ enum iTCO_chipsets { · 112 unmodified lines
153154 TCO_PBG1, /* Patsburg */
154155 TCO_PBG2, /* Patsburg */
155156 TCO_DH89XXCC, /* DH89xxCC */
157+ TCO_PPT0, /* Panther Point */
158+ TCO_PPT1, /* Panther Point */
159+ TCO_PPT2, /* Panther Point */
160+ TCO_PPT3, /* Panther Point */
161+ TCO_PPT4, /* Panther Point */
162+ TCO_PPT5, /* Panther Point */
163+ TCO_PPT6, /* Panther Point */
164+ TCO_PPT7, /* Panther Point */
165+ TCO_PPT8, /* Panther Point */
166+ TCO_PPT9, /* Panther Point */
167+ TCO_PPT10, /* Panther Point */
168+ TCO_PPT11, /* Panther Point */
169+ TCO_PPT12, /* Panther Point */
170+ TCO_PPT13, /* Panther Point */
171+ TCO_PPT14, /* Panther Point */
172+ TCO_PPT15, /* Panther Point */
173+ TCO_PPT16, /* Panther Point */
174+ TCO_PPT17, /* Panther Point */
175+ TCO_PPT18, /* Panther Point */
176+ TCO_PPT19, /* Panther Point */
177+ TCO_PPT20, /* Panther Point */
178+ TCO_PPT21, /* Panther Point */
179+ TCO_PPT22, /* Panther Point */
180+ TCO_PPT23, /* Panther Point */
181+ TCO_PPT24, /* Panther Point */
182+ TCO_PPT25, /* Panther Point */
183+ TCO_PPT26, /* Panther Point */
184+ TCO_PPT27, /* Panther Point */
185+ TCO_PPT28, /* Panther Point */
186+ TCO_PPT29, /* Panther Point */
187+ TCO_PPT30, /* Panther Point */
188+ TCO_PPT31, /* Panther Point */
156189 };
157190
158191 static struct {
@@ -244,6 +277,38 @@ static struct { · 85 unmodified lines
244277 {"Patsburg", 2},
245278 {"Patsburg", 2},
246279 {"DH89xxCC", 2},
280+ {"Panther Point", 2},
281+ {"Panther Point", 2},
282+ {"Panther Point", 2},
283+ {"Panther Point", 2},
284+ {"Panther Point", 2},
285+ {"Panther Point", 2},
286+ {"Panther Point", 2},
287+ {"Panther Point", 2},
288+ {"Panther Point", 2},
289+ {"Panther Point", 2},
290+ {"Panther Point", 2},
291+ {"Panther Point", 2},
292+ {"Panther Point", 2},
293+ {"Panther Point", 2},
294+ {"Panther Point", 2},
295+ {"Panther Point", 2},
296+ {"Panther Point", 2},
297+ {"Panther Point", 2},
298+ {"Panther Point", 2},
299+ {"Panther Point", 2},
300+ {"Panther Point", 2},
301+ {"Panther Point", 2},
302+ {"Panther Point", 2},
303+ {"Panther Point", 2},
304+ {"Panther Point", 2},
305+ {"Panther Point", 2},
306+ {"Panther Point", 2},
307+ {"Panther Point", 2},
308+ {"Panther Point", 2},
309+ {"Panther Point", 2},
310+ {"Panther Point", 2},
311+ {"Panther Point", 2},
247312 {NULL, 0}
248313 };
249314
@@ -363,6 +428,38 @@ static DEFINE_PCI_DEVICE_TABLE(iTCO_wdt_pci_tbl) = { · 113 unmodified lines
363428 { ITCO_PCI_DEVICE(0x1d40, TCO_PBG1)},
364429 { ITCO_PCI_DEVICE(0x1d41, TCO_PBG2)},
365430 { ITCO_PCI_DEVICE(0x2310, TCO_DH89XXCC)},
431+ { ITCO_PCI_DEVICE(0x1e40, TCO_PPT0)},
432+ { ITCO_PCI_DEVICE(0x1e41, TCO_PPT1)},
433+ { ITCO_PCI_DEVICE(0x1e42, TCO_PPT2)},
434+ { ITCO_PCI_DEVICE(0x1e43, TCO_PPT3)},
435+ { ITCO_PCI_DEVICE(0x1e44, TCO_PPT4)},
436+ { ITCO_PCI_DEVICE(0x1e45, TCO_PPT5)},
437+ { ITCO_PCI_DEVICE(0x1e46, TCO_PPT6)},
438+ { ITCO_PCI_DEVICE(0x1e47, TCO_PPT7)},
439+ { ITCO_PCI_DEVICE(0x1e48, TCO_PPT8)},
440+ { ITCO_PCI_DEVICE(0x1e49, TCO_PPT9)},
441+ { ITCO_PCI_DEVICE(0x1e4a, TCO_PPT10)},
442+ { ITCO_PCI_DEVICE(0x1e4b, TCO_PPT11)},
443+ { ITCO_PCI_DEVICE(0x1e4c, TCO_PPT12)},
444+ { ITCO_PCI_DEVICE(0x1e4d, TCO_PPT13)},
445+ { ITCO_PCI_DEVICE(0x1e4e, TCO_PPT14)},
446+ { ITCO_PCI_DEVICE(0x1e4f, TCO_PPT15)},
447+ { ITCO_PCI_DEVICE(0x1e50, TCO_PPT16)},
448+ { ITCO_PCI_DEVICE(0x1e51, TCO_PPT17)},
449+ { ITCO_PCI_DEVICE(0x1e52, TCO_PPT18)},
450+ { ITCO_PCI_DEVICE(0x1e53, TCO_PPT19)},
451+ { ITCO_PCI_DEVICE(0x1e54, TCO_PPT20)},
452+ { ITCO_PCI_DEVICE(0x1e55, TCO_PPT21)},
453+ { ITCO_PCI_DEVICE(0x1e56, TCO_PPT22)},
454+ { ITCO_PCI_DEVICE(0x1e57, TCO_PPT23)},
455+ { ITCO_PCI_DEVICE(0x1e58, TCO_PPT24)},
456+ { ITCO_PCI_DEVICE(0x1e59, TCO_PPT25)},
457+ { ITCO_PCI_DEVICE(0x1e5a, TCO_PPT26)},
458+ { ITCO_PCI_DEVICE(0x1e5b, TCO_PPT27)},
459+ { ITCO_PCI_DEVICE(0x1e5c, TCO_PPT28)},
460+ { ITCO_PCI_DEVICE(0x1e5d, TCO_PPT29)},
461+ { ITCO_PCI_DEVICE(0x1e5e, TCO_PPT30)},
462+ { ITCO_PCI_DEVICE(0x1e5f, TCO_PPT31)},
366463 { 0, }, /* End of list */
367464 };
368465 MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl);
drivers/watchdog/mpc8xxx_wdt.c+5−2
@@ -185,17 +185,20 @@ static struct miscdevice mpc8xxx_wdt_miscdev = { · 184 unmodified lines
185185 .fops = &mpc8xxx_wdt_fops,
186186 };
187187
188+static const struct of_device_id mpc8xxx_wdt_match[];
188189 static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev)
189190 {
190191 int ret;
192+ const struct of_device_id *match;
191193 struct device_node *np = ofdev->dev.of_node;
192194 struct mpc8xxx_wdt_type *wdt_type;
193195 u32 freq = fsl_get_sys_freq();
194196 bool enabled;
195197
196− if (!ofdev->dev.of_match)
198+ match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev);
199+ if (!match)
197200 return -EINVAL;
198− wdt_type = ofdev->dev.of_match->data;
201+ wdt_type = match->data;
199202
200203 if (!freq || freq == -1)
201204 return -EINVAL;
drivers/xen/manage.c+8−1
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #include <linux/sysrq.h>
99 #include <linux/stop_machine.h>
1010 #include <linux/freezer.h>
11+#include <linux/syscore_ops.h>
1112
1213 #include <xen/xen.h>
1314 #include <xen/xenbus.h>
@@ -70,8 +71,13 @@ static int xen_suspend(void *data) · 56 unmodified lines
7071 BUG_ON(!irqs_disabled());
7172
7273 err = sysdev_suspend(PMSG_FREEZE);
74+ if (!err) {
75+ err = syscore_suspend();
76+ if (err)
77+ sysdev_resume();
78+ }
7379 if (err) {
74− printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
80+ printk(KERN_ERR "xen_suspend: system core suspend failed: %d\n",
7581 err);
7682 return err;
7783 }
@@ -95,6 +101,7 @@ static int xen_suspend(void *data) · 17 unmodified lines
95101 xen_timer_resume();
96102 }
97103
104+ syscore_resume();
98105 sysdev_resume();
99106
100107 return 0;
fs/btrfs/acl.c+3−2
@@ -178,12 +178,13 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, · 177 unmodified lines
178178
179179 if (value) {
180180 acl = posix_acl_from_xattr(value, size);
181+ if (IS_ERR(acl))
182+ return PTR_ERR(acl);
183+
181184 if (acl) {
182185 ret = posix_acl_valid(acl);
183186 if (ret)
184187 goto out;
185− } else if (IS_ERR(acl)) {
186− return PTR_ERR(acl);
187188 }
188189 }
189190
fs/btrfs/ctree.h+1−1
@@ -718,7 +718,7 @@ struct btrfs_space_info { · 717 unmodified lines
718718 u64 total_bytes; /* total bytes in the space,
719719 this doesn't take mirrors into account */
720720 u64 bytes_used; /* total bytes used,
721− this does't take mirrors into account */
721+ this doesn't take mirrors into account */
722722 u64 bytes_pinned; /* total bytes pinned, will be freed when the
723723 transaction finishes */
724724 u64 bytes_reserved; /* total bytes the allocator has reserved for
fs/btrfs/disk-io.c+1−0
@@ -2824,6 +2824,7 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, · 2823 unmodified lines
28242824
28252825 spin_lock(&delayed_refs->lock);
28262826 if (delayed_refs->num_entries == 0) {
2827+ spin_unlock(&delayed_refs->lock);
28272828 printk(KERN_INFO "delayed_refs has NO entry\n");
28282829 return ret;
28292830 }
fs/btrfs/extent-tree.c+30−11
@@ -8059,6 +8059,10 @@ static noinline int relocate_one_extent(struct btrfs_root *extent_root, · 8058 unmodified lines
80598059 u64 group_start = group->key.objectid;
80608060 new_extents = kmalloc(sizeof(*new_extents),
80618061 GFP_NOFS);
8062+ if (!new_extents) {
8063+ ret = -ENOMEM;
8064+ goto out;
8065+ }
80628066 nr_extents = 1;
80638067 ret = get_new_locations(reloc_inode,
80648068 extent_key,
@@ -8852,23 +8856,38 @@ out: · 787 unmodified lines
88528856 int btrfs_init_space_info(struct btrfs_fs_info *fs_info)
88538857 {
88548858 struct btrfs_space_info *space_info;
8859+ struct btrfs_super_block *disk_super;
8860+ u64 features;
8861+ u64 flags;
8862+ int mixed = 0;
88558863 int ret;
88568864
8857− ret = update_space_info(fs_info, BTRFS_BLOCK_GROUP_SYSTEM, 0, 0,
8858− &space_info);
8859− if (ret)
8860− return ret;
8865+ disk_super = &fs_info->super_copy;
8866+ if (!btrfs_super_root(disk_super))
8867+ return 1;
88618868
8862− ret = update_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA, 0, 0,
8863− &space_info);
8864− if (ret)
8865− return ret;
8869+ features = btrfs_super_incompat_flags(disk_super);
8870+ if (features & BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS)
8871+ mixed = 1;
88668872
8867− ret = update_space_info(fs_info, BTRFS_BLOCK_GROUP_DATA, 0, 0,
8868− &space_info);
8873+ flags = BTRFS_BLOCK_GROUP_SYSTEM;
8874+ ret = update_space_info(fs_info, flags, 0, 0, &space_info);
88698875 if (ret)
8870− return ret;
8876+ goto out;
88718877
8878+ if (mixed) {
8879+ flags = BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA;
8880+ ret = update_space_info(fs_info, flags, 0, 0, &space_info);
8881+ } else {
8882+ flags = BTRFS_BLOCK_GROUP_METADATA;
8883+ ret = update_space_info(fs_info, flags, 0, 0, &space_info);
8884+ if (ret)
8885+ goto out;
8886+
8887+ flags = BTRFS_BLOCK_GROUP_DATA;
8888+ ret = update_space_info(fs_info, flags, 0, 0, &space_info);
8889+ }
8890+out:
88728891 return ret;
88738892 }
88748893
fs/btrfs/extent_io.c+1−1
@@ -2681,7 +2681,7 @@ int extent_readpages(struct extent_io_tree *tree, · 2680 unmodified lines
26812681 prefetchw(&page->flags);
26822682 list_del(&page->lru);
26832683 if (!add_to_page_cache_lru(page, mapping,
2684− page->index, GFP_KERNEL)) {
2684+ page->index, GFP_NOFS)) {
26852685 __extent_read_full_page(tree, page, get_extent,
26862686 &bio, 0, &bio_flags);
26872687 }
fs/btrfs/free-space-cache.c+8−5
@@ -1768,10 +1768,13 @@ void btrfs_remove_free_space_cache(struct btrfs_block_group_cache *block_group) · 1767 unmodified lines
17681768
17691769 while ((node = rb_last(&block_group->free_space_offset)) != NULL) {
17701770 info = rb_entry(node, struct btrfs_free_space, offset_index);
1771− unlink_free_space(block_group, info);
1772− if (info->bitmap)
1773− kfree(info->bitmap);
1774− kmem_cache_free(btrfs_free_space_cachep, info);
1771+ if (!info->bitmap) {
1772+ unlink_free_space(block_group, info);
1773+ kmem_cache_free(btrfs_free_space_cachep, info);
1774+ } else {
1775+ free_bitmap(block_group, info);
1776+ }
1777+
17751778 if (need_resched()) {
17761779 spin_unlock(&block_group->tree_lock);
17771780 cond_resched();
@@ -2301,7 +2304,7 @@ int btrfs_trim_block_group(struct btrfs_block_group_cache *block_group, · 523 unmodified lines
23012304 start = entry->offset;
23022305 bytes = min(entry->bytes, end - start);
23032306 unlink_free_space(block_group, entry);
2304− kfree(entry);
2307+ kmem_cache_free(btrfs_free_space_cachep, entry);
23052308 }
23062309
23072310 spin_unlock(&block_group->tree_lock);
fs/btrfs/inode.c+13−7
@@ -954,6 +954,7 @@ static int cow_file_range_async(struct inode *inode, struct page *locked_page, · 953 unmodified lines
954954 1, 0, NULL, GFP_NOFS);
955955 while (start < end) {
956956 async_cow = kmalloc(sizeof(*async_cow), GFP_NOFS);
957+ BUG_ON(!async_cow);
957958 async_cow->inode = inode;
958959 async_cow->root = root;
959960 async_cow->locked_page = locked_page;
@@ -4731,9 +4732,10 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry, · 3771 unmodified lines
47314732 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
47324733 dentry->d_name.len, dir->i_ino, objectid,
47334734 BTRFS_I(dir)->block_group, mode, &index);
4734− err = PTR_ERR(inode);
4735− if (IS_ERR(inode))
4735+ if (IS_ERR(inode)) {
4736+ err = PTR_ERR(inode);
47364737 goto out_unlock;
4738+ }
47374739
47384740 err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
47394741 if (err) {
@@ -4792,9 +4794,10 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry, · 52 unmodified lines
47924794 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
47934795 dentry->d_name.len, dir->i_ino, objectid,
47944796 BTRFS_I(dir)->block_group, mode, &index);
4795− err = PTR_ERR(inode);
4796− if (IS_ERR(inode))
4797+ if (IS_ERR(inode)) {
4798+ err = PTR_ERR(inode);
47974799 goto out_unlock;
4800+ }
47984801
47994802 err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
48004803 if (err) {
@@ -4999,6 +5002,8 @@ static noinline int uncompress_inline(struct btrfs_path *path, · 198 unmodified lines
49995002 inline_size = btrfs_file_extent_inline_item_len(leaf,
50005003 btrfs_item_nr(leaf, path->slots[0]));
50015004 tmp = kmalloc(inline_size, GFP_NOFS);
5005+ if (!tmp)
5006+ return -ENOMEM;
50025007 ptr = btrfs_file_extent_inline_start(item);
50035008
50045009 read_extent_buffer(leaf, tmp, ptr, inline_size);
@@ -6036,7 +6041,7 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip, · 1031 unmodified lines
60366041 ret = btrfs_map_block(map_tree, READ, start_sector << 9,
60376042 &map_length, NULL, 0);
60386043 if (ret) {
6039− bio_put(bio);
6044+ bio_put(orig_bio);
60406045 return -EIO;
60416046 }
60426047
@@ -7273,9 +7278,10 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, · 1230 unmodified lines
72737278 dentry->d_name.len, dir->i_ino, objectid,
72747279 BTRFS_I(dir)->block_group, S_IFLNK|S_IRWXUGO,
72757280 &index);
7276− err = PTR_ERR(inode);
7277− if (IS_ERR(inode))
7281+ if (IS_ERR(inode)) {
7282+ err = PTR_ERR(inode);
72787283 goto out_unlock;
7284+ }
72797285
72807286 err = btrfs_init_inode_security(trans, inode, dir, &dentry->d_name);
72817287 if (err) {
fs/btrfs/ioctl.c+15−9
@@ -81,6 +81,13 @@ static unsigned int btrfs_flags_to_ioctl(unsigned int flags) · 80 unmodified lines
8181 iflags |= FS_NOATIME_FL;
8282 if (flags & BTRFS_INODE_DIRSYNC)
8383 iflags |= FS_DIRSYNC_FL;
84+ if (flags & BTRFS_INODE_NODATACOW)
85+ iflags |= FS_NOCOW_FL;
86+
87+ if ((flags & BTRFS_INODE_COMPRESS) && !(flags & BTRFS_INODE_NOCOMPRESS))
88+ iflags |= FS_COMPR_FL;
89+ else if (flags & BTRFS_INODE_NOCOMPRESS)
90+ iflags |= FS_NOCOMP_FL;
8491
8592 return iflags;
8693 }
@@ -144,16 +151,13 @@ static int check_flags(unsigned int flags) · 57 unmodified lines
144151 if (flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | \
145152 FS_NOATIME_FL | FS_NODUMP_FL | \
146153 FS_SYNC_FL | FS_DIRSYNC_FL | \
147− FS_NOCOMP_FL | FS_COMPR_FL | \
148− FS_NOCOW_FL | FS_COW_FL))
154+ FS_NOCOMP_FL | FS_COMPR_FL |
155+ FS_NOCOW_FL))
149156 return -EOPNOTSUPP;
150157
151158 if ((flags & FS_NOCOMP_FL) && (flags & FS_COMPR_FL))
152159 return -EINVAL;
153160
154− if ((flags & FS_NOCOW_FL) && (flags & FS_COW_FL))
155− return -EINVAL;
156−
157161 return 0;
158162 }
159163
@@ -218,6 +222,10 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) · 58 unmodified lines
218222 ip->flags |= BTRFS_INODE_DIRSYNC;
219223 else
220224 ip->flags &= ~BTRFS_INODE_DIRSYNC;
225+ if (flags & FS_NOCOW_FL)
226+ ip->flags |= BTRFS_INODE_NODATACOW;
227+ else
228+ ip->flags &= ~BTRFS_INODE_NODATACOW;
221229
222230 /*
223231 * The COMPRESS flag can only be changed by users, while the NOCOMPRESS
@@ -230,11 +238,9 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) · 6 unmodified lines
230238 } else if (flags & FS_COMPR_FL) {
231239 ip->flags |= BTRFS_INODE_COMPRESS;
232240 ip->flags &= ~BTRFS_INODE_NOCOMPRESS;
241+ } else {
242+ ip->flags &= ~(BTRFS_INODE_COMPRESS | BTRFS_INODE_NOCOMPRESS);
233243 }
234− if (flags & FS_NOCOW_FL)
235− ip->flags |= BTRFS_INODE_NODATACOW;
236− else if (flags & FS_COW_FL)
237− ip->flags &= ~BTRFS_INODE_NODATACOW;
238244
239245 trans = btrfs_join_transaction(root, 1);
240246 BUG_ON(IS_ERR(trans));
fs/btrfs/tree-log.c+5−2
@@ -2209,8 +2209,10 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, · 2208 unmodified lines
22092209
22102210 log = root->log_root;
22112211 path = btrfs_alloc_path();
2212− if (!path)
2213− return -ENOMEM;
2212+ if (!path) {
2213+ err = -ENOMEM;
2214+ goto out_unlock;
2215+ }
22142216
22152217 di = btrfs_lookup_dir_item(trans, log, path, dir->i_ino,
22162218 name, name_len, -1);
@@ -2271,6 +2273,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, · 54 unmodified lines
22712273 }
22722274 fail:
22732275 btrfs_free_path(path);
2276+out_unlock:
22742277 mutex_unlock(&BTRFS_I(dir)->log_mutex);
22752278 if (ret == -ENOSPC) {
22762279 root->fs_info->last_trans_log_full_commit = trans->transid;
fs/btrfs/volumes.c+10−0
@@ -155,6 +155,15 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) · 154 unmodified lines
155155 unsigned long limit;
156156 unsigned long last_waited = 0;
157157 int force_reg = 0;
158+ struct blk_plug plug;
159+
160+ /*
161+ * this function runs all the bios we've collected for
162+ * a particular device. We don't want to wander off to
163+ * another device without first sending all of these down.
164+ * So, setup a plug here and finish it off before we return
165+ */
166+ blk_start_plug(&plug);
158167
159168 bdi = blk_get_backing_dev_info(device->bdev);
160169 fs_info = device->dev_root->fs_info;
@@ -294,6 +303,7 @@ loop_lock: · 133 unmodified lines
294303 spin_unlock(&device->io_lock);
295304
296305 done:
306+ blk_finish_plug(&plug);
297307 return 0;
298308 }
299309
fs/ceph/addr.c+7−0
@@ -775,6 +775,13 @@ get_more_pages: · 774 unmodified lines
775775 ci->i_truncate_seq,
776776 ci->i_truncate_size,
777777 &inode->i_mtime, true, 1, 0);
778+
779+ if (!req) {
780+ rc = -ENOMEM;
781+ unlock_page(page);
782+ break;
783+ }
784+
778785 max_pages = req->r_num_pages;
779786
780787 alloc_page_vec(fsc, req);
fs/ceph/caps.c+15−15
@@ -819,7 +819,7 @@ int __ceph_caps_used(struct ceph_inode_info *ci) · 818 unmodified lines
819819 used |= CEPH_CAP_FILE_CACHE;
820820 if (ci->i_wr_ref)
821821 used |= CEPH_CAP_FILE_WR;
822− if (ci->i_wrbuffer_ref)
822+ if (ci->i_wb_ref || ci->i_wrbuffer_ref)
823823 used |= CEPH_CAP_FILE_BUFFER;
824824 return used;
825825 }
@@ -1331,10 +1331,11 @@ static void ceph_flush_snaps(struct ceph_inode_info *ci) · 505 unmodified lines
13311331 }
13321332
13331333 /*
1334− * Mark caps dirty. If inode is newly dirty, add to the global dirty
1335− * list.
1334+ * Mark caps dirty. If inode is newly dirty, return the dirty flags.
1335+ * Caller is then responsible for calling __mark_inode_dirty with the
1336+ * returned flags value.
13361337 */
1337−void __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask)
1338+int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask)
13381339 {
13391340 struct ceph_mds_client *mdsc =
13401341 ceph_sb_to_client(ci->vfs_inode.i_sb)->mdsc;
@@ -1357,7 +1358,7 @@ void __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask) · 16 unmodified lines
13571358 list_add(&ci->i_dirty_item, &mdsc->cap_dirty);
13581359 spin_unlock(&mdsc->cap_dirty_lock);
13591360 if (ci->i_flushing_caps == 0) {
1360− igrab(inode);
1361+ ihold(inode);
13611362 dirty |= I_DIRTY_SYNC;
13621363 }
13631364 }
@@ -1365,9 +1366,8 @@ void __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask) · 1 unmodified line
13651366 if (((was | ci->i_flushing_caps) & CEPH_CAP_FILE_BUFFER) &&
13661367 (mask & CEPH_CAP_FILE_BUFFER))
13671368 dirty |= I_DIRTY_DATASYNC;
1368− if (dirty)
1369− __mark_inode_dirty(inode, dirty);
13701369 __cap_delay_requeue(mdsc, ci);
1370+ return dirty;
13711371 }
13721372
13731373 /*
@@ -1990,11 +1990,11 @@ static void __take_cap_refs(struct ceph_inode_info *ci, int got) · 616 unmodified lines
19901990 if (got & CEPH_CAP_FILE_WR)
19911991 ci->i_wr_ref++;
19921992 if (got & CEPH_CAP_FILE_BUFFER) {
1993− if (ci->i_wrbuffer_ref == 0)
1994− igrab(&ci->vfs_inode);
1995− ci->i_wrbuffer_ref++;
1996− dout("__take_cap_refs %p wrbuffer %d -> %d (?)\n",
1997− &ci->vfs_inode, ci->i_wrbuffer_ref-1, ci->i_wrbuffer_ref);
1993+ if (ci->i_wb_ref == 0)
1994+ ihold(&ci->vfs_inode);
1995+ ci->i_wb_ref++;
1996+ dout("__take_cap_refs %p wb %d -> %d (?)\n",
1997+ &ci->vfs_inode, ci->i_wb_ref-1, ci->i_wb_ref);
19981998 }
19991999 }
20002000
@@ -2169,12 +2169,12 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had) · 168 unmodified lines
21692169 if (--ci->i_rdcache_ref == 0)
21702170 last++;
21712171 if (had & CEPH_CAP_FILE_BUFFER) {
2172− if (--ci->i_wrbuffer_ref == 0) {
2172+ if (--ci->i_wb_ref == 0) {
21732173 last++;
21742174 put++;
21752175 }
2176− dout("put_cap_refs %p wrbuffer %d -> %d (?)\n",
2177− inode, ci->i_wrbuffer_ref+1, ci->i_wrbuffer_ref);
2176+ dout("put_cap_refs %p wb %d -> %d (?)\n",
2177+ inode, ci->i_wb_ref+1, ci->i_wb_ref);
21782178 }
21792179 if (had & CEPH_CAP_FILE_WR)
21802180 if (--ci->i_wr_ref == 0) {
fs/ceph/file.c+4−1
@@ -734,9 +734,12 @@ retry_snap: · 733 unmodified lines
734734 }
735735 }
736736 if (ret >= 0) {
737+ int dirty;
737738 spin_lock(&inode->i_lock);
738− __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
739+ dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_WR);
739740 spin_unlock(&inode->i_lock);
741+ if (dirty)
742+ __mark_inode_dirty(inode, dirty);
740743 }
741744
742745 out:
fs/ceph/inode.c+6−1
@@ -355,6 +355,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb) · 354 unmodified lines
355355 ci->i_rd_ref = 0;
356356 ci->i_rdcache_ref = 0;
357357 ci->i_wr_ref = 0;
358+ ci->i_wb_ref = 0;
358359 ci->i_wrbuffer_ref = 0;
359360 ci->i_wrbuffer_ref_head = 0;
360361 ci->i_shared_gen = 0;
@@ -1567,6 +1568,7 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) · 1206 unmodified lines
15671568 int release = 0, dirtied = 0;
15681569 int mask = 0;
15691570 int err = 0;
1571+ int inode_dirty_flags = 0;
15701572
15711573 if (ceph_snap(inode) != CEPH_NOSNAP)
15721574 return -EROFS;
@@ -1725,13 +1727,16 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr) · 152 unmodified lines
17251727 dout("setattr %p ATTR_FILE ... hrm!\n", inode);
17261728
17271729 if (dirtied) {
1728− __ceph_mark_dirty_caps(ci, dirtied);
1730+ inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied);
17291731 inode->i_ctime = CURRENT_TIME;
17301732 }
17311733
17321734 release &= issued;
17331735 spin_unlock(&inode->i_lock);
17341736
1737+ if (inode_dirty_flags)
1738+ __mark_inode_dirty(inode, inode_dirty_flags);
1739+
17351740 if (mask) {
17361741 req->r_inode = igrab(inode);
17371742 req->r_inode_drop = release;
fs/ceph/mds_client.c+1−1
@@ -3304,8 +3304,8 @@ static void con_put(struct ceph_connection *con) · 3303 unmodified lines
33043304 {
33053305 struct ceph_mds_session *s = con->private;
33063306
3307+ dout("mdsc con_put %p (%d)\n", s, atomic_read(&s->s_ref) - 1);
33073308 ceph_put_mds_session(s);
3308− dout("mdsc con_put %p (%d)\n", s, atomic_read(&s->s_ref));
33093309 }
33103310
33113311 /*
fs/ceph/snap.c+1−1
@@ -206,7 +206,7 @@ void ceph_put_snap_realm(struct ceph_mds_client *mdsc, · 205 unmodified lines
206206 up_write(&mdsc->snap_rwsem);
207207 } else {
208208 spin_lock(&mdsc->snap_empty_lock);
209− list_add(&mdsc->snap_empty, &realm->empty_item);
209+ list_add(&realm->empty_item, &mdsc->snap_empty);
210210 spin_unlock(&mdsc->snap_empty_lock);
211211 }
212212 }
fs/ceph/super.h+2−2
@@ -293,7 +293,7 @@ struct ceph_inode_info { · 292 unmodified lines
293293
294294 /* held references to caps */
295295 int i_pin_ref;
296− int i_rd_ref, i_rdcache_ref, i_wr_ref;
296+ int i_rd_ref, i_rdcache_ref, i_wr_ref, i_wb_ref;
297297 int i_wrbuffer_ref, i_wrbuffer_ref_head;
298298 u32 i_shared_gen; /* increment each time we get FILE_SHARED */
299299 u32 i_rdcache_gen; /* incremented each time we get FILE_CACHE. */
@@ -506,7 +506,7 @@ static inline int __ceph_caps_dirty(struct ceph_inode_info *ci) · 206 unmodified lines
506506 {
507507 return ci->i_dirty_caps | ci->i_flushing_caps;
508508 }
509−extern void __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask);
509+extern int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask);
510510
511511 extern int ceph_caps_revoking(struct ceph_inode_info *ci, int mask);
512512 extern int __ceph_caps_used(struct ceph_inode_info *ci);
fs/ceph/xattr.c+8−4
@@ -703,6 +703,7 @@ int ceph_setxattr(struct dentry *dentry, const char *name, · 702 unmodified lines
703703 struct ceph_inode_xattr *xattr = NULL;
704704 int issued;
705705 int required_blob_size;
706+ int dirty;
706707
707708 if (ceph_snap(inode) != CEPH_NOSNAP)
708709 return -EROFS;
@@ -763,11 +764,12 @@ retry: · 54 unmodified lines
763764 dout("setxattr %p issued %s\n", inode, ceph_cap_string(issued));
764765 err = __set_xattr(ci, newname, name_len, newval,
765766 val_len, 1, 1, 1, &xattr);
766− __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL);
767+ dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL);
767768 ci->i_xattrs.dirty = true;
768769 inode->i_ctime = CURRENT_TIME;
769770 spin_unlock(&inode->i_lock);
770−
771+ if (dirty)
772+ __mark_inode_dirty(inode, dirty);
771773 return err;
772774
773775 do_sync:
@@ -810,6 +812,7 @@ int ceph_removexattr(struct dentry *dentry, const char *name) · 36 unmodified lines
810812 struct ceph_vxattr_cb *vxattrs = ceph_inode_vxattrs(inode);
811813 int issued;
812814 int err;
815+ int dirty;
813816
814817 if (ceph_snap(inode) != CEPH_NOSNAP)
815818 return -EROFS;
@@ -833,12 +836,13 @@ int ceph_removexattr(struct dentry *dentry, const char *name) · 17 unmodified lines
833836 goto do_sync;
834837
835838 err = __remove_xattr_by_name(ceph_inode(inode), name);
836− __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL);
839+ dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL);
837840 ci->i_xattrs.dirty = true;
838841 inode->i_ctime = CURRENT_TIME;
839842
840843 spin_unlock(&inode->i_lock);
841−
844+ if (dirty)
845+ __mark_inode_dirty(inode, dirty);
842846 return err;
843847 do_sync:
844848 spin_unlock(&inode->i_lock);
fs/cifs/cifs_unicode.c+6−8
@@ -277,6 +277,7 @@ cifsConvertToUCS(__le16 *target, const char *source, int srclen, · 276 unmodified lines
277277
278278 for (i = 0, j = 0; i < srclen; j++) {
279279 src_char = source[i];
280+ charlen = 1;
280281 switch (src_char) {
281282 case 0:
282283 put_unaligned(0, &target[j]);
@@ -316,16 +317,13 @@ cifsConvertToUCS(__le16 *target, const char *source, int srclen, · 33 unmodified lines
316317 dst_char = cpu_to_le16(0x003f);
317318 charlen = 1;
318319 }
319− /*
320− * character may take more than one byte in the source
321− * string, but will take exactly two bytes in the
322− * target string
323− */
324− i += charlen;
325− continue;
326320 }
321+ /*
322+ * character may take more than one byte in the source string,
323+ * but will take exactly two bytes in the target string
324+ */
325+ i += charlen;
327326 put_unaligned(dst_char, &target[j]);
328− i++; /* move to next char in source string */
329327 }
330328
331329 ctoUCS_out:
fs/cifs/connect.c+75−55
@@ -274,7 +274,8 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB) · 273 unmodified lines
274274 char *data_area_of_target;
275275 char *data_area_of_buf2;
276276 int remaining;
277− __u16 byte_count, total_data_size, total_in_buf, total_in_buf2;
277+ unsigned int byte_count, total_in_buf;
278+ __u16 total_data_size, total_in_buf2;
278279
279280 total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
280281
@@ -287,7 +288,7 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB) · 6 unmodified lines
287288 remaining = total_data_size - total_in_buf;
288289
289290 if (remaining < 0)
290− return -EINVAL;
291+ return -EPROTO;
291292
292293 if (remaining == 0) /* nothing to do, ignore */
293294 return 0;
@@ -308,20 +309,29 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB) · 14 unmodified lines
308309 data_area_of_target += total_in_buf;
309310
310311 /* copy second buffer into end of first buffer */
311− memcpy(data_area_of_target, data_area_of_buf2, total_in_buf2);
312312 total_in_buf += total_in_buf2;
313+ /* is the result too big for the field? */
314+ if (total_in_buf > USHRT_MAX)
315+ return -EPROTO;
313316 put_unaligned_le16(total_in_buf, &pSMBt->t2_rsp.DataCount);
317+
318+ /* fix up the BCC */
314319 byte_count = get_bcc_le(pTargetSMB);
315320 byte_count += total_in_buf2;
321+ /* is the result too big for the field? */
322+ if (byte_count > USHRT_MAX)
323+ return -EPROTO;
316324 put_bcc_le(byte_count, pTargetSMB);
317325
318326 byte_count = pTargetSMB->smb_buf_length;
319327 byte_count += total_in_buf2;
320−
321− /* BB also add check that we are not beyond maximum buffer size */
322−
328+ /* don't allow buffer to overflow */
329+ if (byte_count > CIFSMaxBufSize)
330+ return -ENOBUFS;
323331 pTargetSMB->smb_buf_length = byte_count;
324332
333+ memcpy(data_area_of_target, data_area_of_buf2, total_in_buf2);
334+
325335 if (remaining == total_in_buf2) {
326336 cFYI(1, "found the last secondary response");
327337 return 0; /* we are done */
@@ -607,59 +617,63 @@ incomplete_rcv: · 279 unmodified lines
607617 list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
608618 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
609619
610− if ((mid_entry->mid == smb_buffer->Mid) &&
611− (mid_entry->midState == MID_REQUEST_SUBMITTED) &&
612− (mid_entry->command == smb_buffer->Command)) {
613− if (length == 0 &&
614− check2ndT2(smb_buffer, server->maxBuf) > 0) {
615− /* We have a multipart transact2 resp */
616− isMultiRsp = true;
617− if (mid_entry->resp_buf) {
618− /* merge response - fix up 1st*/
619− if (coalesce_t2(smb_buffer,
620− mid_entry->resp_buf)) {
621− mid_entry->multiRsp =
622− true;
623− break;
624− } else {
625− /* all parts received */
626− mid_entry->multiEnd =
627− true;
628− goto multi_t2_fnd;
629− }
620+ if (mid_entry->mid != smb_buffer->Mid ||
621+ mid_entry->midState != MID_REQUEST_SUBMITTED ||
622+ mid_entry->command != smb_buffer->Command) {
623+ mid_entry = NULL;
624+ continue;
625+ }
626+
627+ if (length == 0 &&
628+ check2ndT2(smb_buffer, server->maxBuf) > 0) {
629+ /* We have a multipart transact2 resp */
630+ isMultiRsp = true;
631+ if (mid_entry->resp_buf) {
632+ /* merge response - fix up 1st*/
633+ length = coalesce_t2(smb_buffer,
634+ mid_entry->resp_buf);
635+ if (length > 0) {
636+ length = 0;
637+ mid_entry->multiRsp = true;
638+ break;
630639 } else {
631− if (!isLargeBuf) {
632− cERROR(1, "1st trans2 resp needs bigbuf");
633− /* BB maybe we can fix this up, switch
634− to already allocated large buffer? */
635− } else {
636− /* Have first buffer */
637− mid_entry->resp_buf =
638− smb_buffer;
639− mid_entry->largeBuf =
640− true;
641− bigbuf = NULL;
642− }
640+ /* all parts received or
641+ * packet is malformed
642+ */
643+ mid_entry->multiEnd = true;
644+ goto multi_t2_fnd;
645+ }
646+ } else {
647+ if (!isLargeBuf) {
648+ /*
649+ * FIXME: switch to already
650+ * allocated largebuf?
651+ */
652+ cERROR(1, "1st trans2 resp "
653+ "needs bigbuf");
654+ } else {
655+ /* Have first buffer */
656+ mid_entry->resp_buf =
657+ smb_buffer;
658+ mid_entry->largeBuf = true;
659+ bigbuf = NULL;
643660 }
644− break;
645661 }
646− mid_entry->resp_buf = smb_buffer;
647− mid_entry->largeBuf = isLargeBuf;
662+ break;
663+ }
664+ mid_entry->resp_buf = smb_buffer;
665+ mid_entry->largeBuf = isLargeBuf;
648666 multi_t2_fnd:
649− if (length == 0)
650− mid_entry->midState =
651− MID_RESPONSE_RECEIVED;
652− else
653− mid_entry->midState =
654− MID_RESPONSE_MALFORMED;
667+ if (length == 0)
668+ mid_entry->midState = MID_RESPONSE_RECEIVED;
669+ else
670+ mid_entry->midState = MID_RESPONSE_MALFORMED;
655671 #ifdef CONFIG_CIFS_STATS2
656− mid_entry->when_received = jiffies;
672+ mid_entry->when_received = jiffies;
657673 #endif
658− list_del_init(&mid_entry->qhead);
659− mid_entry->callback(mid_entry);
660− break;
661− }
662− mid_entry = NULL;
674+ list_del_init(&mid_entry->qhead);
675+ mid_entry->callback(mid_entry);
676+ break;
663677 }
664678 spin_unlock(&GlobalMid_Lock);
665679
@@ -807,8 +821,7 @@ static int · 141 unmodified lines
807821 cifs_parse_mount_options(char *options, const char *devname,
808822 struct smb_vol *vol)
809823 {
810− char *value;
811− char *data;
824+ char *value, *data, *end;
812825 unsigned int temp_len, i, j;
813826 char separator[2];
814827 short int override_uid = -1;
@@ -851,6 +864,7 @@ cifs_parse_mount_options(char *options, const char *devname, · 36 unmodified lines
851864 if (!options)
852865 return 1;
853866
867+ end = options + strlen(options);
854868 if (strncmp(options, "sep=", 4) == 0) {
855869 if (options[4] != 0) {
856870 separator[0] = options[4];
@@ -916,6 +930,7 @@ cifs_parse_mount_options(char *options, const char *devname, · 59 unmodified lines
916930 the only illegal character in a password is null */
917931
918932 if ((value[temp_len] == 0) &&
933+ (value + temp_len < end) &&
919934 (value[temp_len+1] == separator[0])) {
920935 /* reinsert comma */
921936 value[temp_len] = separator[0];
@@ -2658,6 +2673,11 @@ is_path_accessible(int xid, struct cifsTconInfo *tcon, · 1736 unmodified lines
26582673 0 /* not legacy */, cifs_sb->local_nls,
26592674 cifs_sb->mnt_cifs_flags &
26602675 CIFS_MOUNT_MAP_SPECIAL_CHR);
2676+
2677+ if (rc == -EOPNOTSUPP || rc == -EINVAL)
2678+ rc = SMBQueryInformation(xid, tcon, full_path, pfile_info,
2679+ cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
2680+ CIFS_MOUNT_MAP_SPECIAL_CHR);
26612681 kfree(pfile_info);
26622682 return rc;
26632683 }
fs/cifs/sess.c+4−15
@@ -276,7 +276,7 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifsSesInfo *ses, · 275 unmodified lines
276276 }
277277
278278 static void
279−decode_unicode_ssetup(char **pbcc_area, __u16 bleft, struct cifsSesInfo *ses,
279+decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses,
280280 const struct nls_table *nls_cp)
281281 {
282282 int len;
@@ -284,19 +284,6 @@ decode_unicode_ssetup(char **pbcc_area, __u16 bleft, struct cifsSesInfo *ses, · 1 unmodified line
284284
285285 cFYI(1, "bleft %d", bleft);
286286
287− /*
288− * Windows servers do not always double null terminate their final
289− * Unicode string. Check to see if there are an uneven number of bytes
290− * left. If so, then add an extra NULL pad byte to the end of the
291− * response.
292− *
293− * See section 2.7.2 in "Implementing CIFS" for details
294− */
295− if (bleft % 2) {
296− data[bleft] = 0;
297− ++bleft;
298− }
299−
300287 kfree(ses->serverOS);
301288 ses->serverOS = cifs_strndup_from_ucs(data, bleft, true, nls_cp);
302289 cFYI(1, "serverOS=%s", ses->serverOS);
@@ -929,7 +916,9 @@ ssetup_ntlmssp_authenticate: · 626 unmodified lines
929916 }
930917
931918 /* BB check if Unicode and decode strings */
932− if (smb_buf->Flags2 & SMBFLG2_UNICODE) {
919+ if (bytes_remaining == 0) {
920+ /* no string area to decode, do nothing */
921+ } else if (smb_buf->Flags2 & SMBFLG2_UNICODE) {
933922 /* unicode string area must be word-aligned */
934923 if (((unsigned long) bcc_ptr - (unsigned long) smb_buf) % 2) {
935924 ++bcc_ptr;
fs/configfs/dir.c+32−7
@@ -53,11 +53,14 @@ DEFINE_SPINLOCK(configfs_dirent_lock); · 52 unmodified lines
5353 static void configfs_d_iput(struct dentry * dentry,
5454 struct inode * inode)
5555 {
56− struct configfs_dirent * sd = dentry->d_fsdata;
56+ struct configfs_dirent *sd = dentry->d_fsdata;
5757
5858 if (sd) {
5959 BUG_ON(sd->s_dentry != dentry);
60+ /* Coordinate with configfs_readdir */
61+ spin_lock(&configfs_dirent_lock);
6062 sd->s_dentry = NULL;
63+ spin_unlock(&configfs_dirent_lock);
6164 configfs_put(sd);
6265 }
6366 iput(inode);
@@ -689,7 +692,8 @@ static int create_default_group(struct config_group *parent_group, · 625 unmodified lines
689692 sd = child->d_fsdata;
690693 sd->s_type |= CONFIGFS_USET_DEFAULT;
691694 } else {
692− d_delete(child);
695+ BUG_ON(child->d_inode);
696+ d_drop(child);
693697 dput(child);
694698 }
695699 }
@@ -1545,7 +1549,7 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir · 849 unmodified lines
15451549 struct configfs_dirent * parent_sd = dentry->d_fsdata;
15461550 struct configfs_dirent *cursor = filp->private_data;
15471551 struct list_head *p, *q = &cursor->s_sibling;
1548− ino_t ino;
1552+ ino_t ino = 0;
15491553 int i = filp->f_pos;
15501554
15511555 switch (i) {
@@ -1573,6 +1577,7 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir · 21 unmodified lines
15731577 struct configfs_dirent *next;
15741578 const char * name;
15751579 int len;
1580+ struct inode *inode = NULL;
15761581
15771582 next = list_entry(p, struct configfs_dirent,
15781583 s_sibling);
@@ -1581,9 +1586,28 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir · 2 unmodified lines
15811586
15821587 name = configfs_get_name(next);
15831588 len = strlen(name);
1584− if (next->s_dentry)
1585− ino = next->s_dentry->d_inode->i_ino;
1586− else
1589+
1590+ /*
1591+ * We'll have a dentry and an inode for
1592+ * PINNED items and for open attribute
1593+ * files. We lock here to prevent a race
1594+ * with configfs_d_iput() clearing
1595+ * s_dentry before calling iput().
1596+ *
1597+ * Why do we go to the trouble? If
1598+ * someone has an attribute file open,
1599+ * the inode number should match until
1600+ * they close it. Beyond that, we don't
1601+ * care.
1602+ */
1603+ spin_lock(&configfs_dirent_lock);
1604+ dentry = next->s_dentry;
1605+ if (dentry)
1606+ inode = dentry->d_inode;
1607+ if (inode)
1608+ ino = inode->i_ino;
1609+ spin_unlock(&configfs_dirent_lock);
1610+ if (!inode)
15871611 ino = iunique(configfs_sb, 2);
15881612
15891613 if (filldir(dirent, name, len, filp->f_pos, ino,
@@ -1683,7 +1707,8 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys) · 93 unmodified lines
16831707 err = configfs_attach_group(sd->s_element, &group->cg_item,
16841708 dentry);
16851709 if (err) {
1686− d_delete(dentry);
1710+ BUG_ON(dentry->d_inode);
1711+ d_drop(dentry);
16871712 dput(dentry);
16881713 } else {
16891714 spin_lock(&configfs_dirent_lock);
fs/dcache.c+32−55
@@ -99,12 +99,9 @@ static struct kmem_cache *dentry_cache __read_mostly; · 98 unmodified lines
9999 static unsigned int d_hash_mask __read_mostly;
100100 static unsigned int d_hash_shift __read_mostly;
101101
102−struct dcache_hash_bucket {
103− struct hlist_bl_head head;
104−};
105−static struct dcache_hash_bucket *dentry_hashtable __read_mostly;
102+static struct hlist_bl_head *dentry_hashtable __read_mostly;
106103
107−static inline struct dcache_hash_bucket *d_hash(struct dentry *parent,
104+static inline struct hlist_bl_head *d_hash(struct dentry *parent,
108105 unsigned long hash)
109106 {
110107 hash += ((unsigned long) parent ^ GOLDEN_RATIO_PRIME) / L1_CACHE_BYTES;
@@ -112,16 +109,6 @@ static inline struct dcache_hash_bucket *d_hash(struct dentry *parent, · 1 unmodified line
112109 return dentry_hashtable + (hash & D_HASHMASK);
113110 }
114111
115−static inline void spin_lock_bucket(struct dcache_hash_bucket *b)
116−{
117− bit_spin_lock(0, (unsigned long *)&b->head.first);
118−}
119−
120−static inline void spin_unlock_bucket(struct dcache_hash_bucket *b)
121−{
122− __bit_spin_unlock(0, (unsigned long *)&b->head.first);
123−}
124−
125112 /* Statistics gathering. */
126113 struct dentry_stat_t dentry_stat = {
127114 .age_limit = 45,
@@ -167,8 +154,8 @@ static void d_free(struct dentry *dentry) · 39 unmodified lines
167154 if (dentry->d_op && dentry->d_op->d_release)
168155 dentry->d_op->d_release(dentry);
169156
170− /* if dentry was never inserted into hash, immediate free is OK */
171− if (hlist_bl_unhashed(&dentry->d_hash))
157+ /* if dentry was never visible to RCU, immediate free is OK */
158+ if (!(dentry->d_flags & DCACHE_RCUACCESS))
172159 __d_free(&dentry->d_u.d_rcu);
173160 else
174161 call_rcu(&dentry->d_u.d_rcu, __d_free);
@@ -330,28 +317,19 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent) · 155 unmodified lines
330317 */
331318 void __d_drop(struct dentry *dentry)
332319 {
333− if (!(dentry->d_flags & DCACHE_UNHASHED)) {
334− if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED)) {
335− bit_spin_lock(0,
336− (unsigned long *)&dentry->d_sb->s_anon.first);
337− dentry->d_flags |= DCACHE_UNHASHED;
338− hlist_bl_del_init(&dentry->d_hash);
339− __bit_spin_unlock(0,
340− (unsigned long *)&dentry->d_sb->s_anon.first);
341− } else {
342− struct dcache_hash_bucket *b;
320+ if (!d_unhashed(dentry)) {
321+ struct hlist_bl_head *b;
322+ if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED))
323+ b = &dentry->d_sb->s_anon;
324+ else
343325 b = d_hash(dentry->d_parent, dentry->d_name.hash);
344− spin_lock_bucket(b);
345− /*
346− * We may not actually need to put DCACHE_UNHASHED
347− * manipulations under the hash lock, but follow
348− * the principle of least surprise.
349− */
350− dentry->d_flags |= DCACHE_UNHASHED;
351− hlist_bl_del_rcu(&dentry->d_hash);
352− spin_unlock_bucket(b);
353− dentry_rcuwalk_barrier(dentry);
354− }
326+
327+ hlist_bl_lock(b);
328+ __hlist_bl_del(&dentry->d_hash);
329+ dentry->d_hash.pprev = NULL;
330+ hlist_bl_unlock(b);
331+
332+ dentry_rcuwalk_barrier(dentry);
355333 }
356334 }
357335 EXPORT_SYMBOL(__d_drop);
@@ -1304,7 +1282,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name) · 946 unmodified lines
13041282 dname[name->len] = 0;
13051283
13061284 dentry->d_count = 1;
1307− dentry->d_flags = DCACHE_UNHASHED;
1285+ dentry->d_flags = 0;
13081286 spin_lock_init(&dentry->d_lock);
13091287 seqcount_init(&dentry->d_seq);
13101288 dentry->d_inode = NULL;
@@ -1606,10 +1584,9 @@ struct dentry *d_obtain_alias(struct inode *inode) · 295 unmodified lines
16061584 tmp->d_inode = inode;
16071585 tmp->d_flags |= DCACHE_DISCONNECTED;
16081586 list_add(&tmp->d_alias, &inode->i_dentry);
1609− bit_spin_lock(0, (unsigned long *)&tmp->d_sb->s_anon.first);
1610− tmp->d_flags &= ~DCACHE_UNHASHED;
1587+ hlist_bl_lock(&tmp->d_sb->s_anon);
16111588 hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon);
1612− __bit_spin_unlock(0, (unsigned long *)&tmp->d_sb->s_anon.first);
1589+ hlist_bl_unlock(&tmp->d_sb->s_anon);
16131590 spin_unlock(&tmp->d_lock);
16141591 spin_unlock(&inode->i_lock);
16151592 security_d_instantiate(tmp, inode);
@@ -1789,7 +1766,7 @@ struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, · 173 unmodified lines
17891766 unsigned int len = name->len;
17901767 unsigned int hash = name->hash;
17911768 const unsigned char *str = name->name;
1792− struct dcache_hash_bucket *b = d_hash(parent, hash);
1769+ struct hlist_bl_head *b = d_hash(parent, hash);
17931770 struct hlist_bl_node *node;
17941771 struct dentry *dentry;
17951772
@@ -1813,7 +1790,7 @@ struct dentry *__d_lookup_rcu(struct dentry *parent, struct qstr *name, · 17 unmodified lines
18131790 *
18141791 * See Documentation/filesystems/path-lookup.txt for more details.
18151792 */
1816− hlist_bl_for_each_entry_rcu(dentry, node, &b->head, d_hash) {
1793+ hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) {
18171794 struct inode *i;
18181795 const char *tname;
18191796 int tlen;
@@ -1908,7 +1885,7 @@ struct dentry *__d_lookup(struct dentry *parent, struct qstr *name) · 88 unmodified lines
19081885 unsigned int len = name->len;
19091886 unsigned int hash = name->hash;
19101887 const unsigned char *str = name->name;
1911− struct dcache_hash_bucket *b = d_hash(parent, hash);
1888+ struct hlist_bl_head *b = d_hash(parent, hash);
19121889 struct hlist_bl_node *node;
19131890 struct dentry *found = NULL;
19141891 struct dentry *dentry;
@@ -1935,7 +1912,7 @@ struct dentry *__d_lookup(struct dentry *parent, struct qstr *name) · 20 unmodified lines
19351912 */
19361913 rcu_read_lock();
19371914
1938− hlist_bl_for_each_entry_rcu(dentry, node, &b->head, d_hash) {
1915+ hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) {
19391916 const char *tname;
19401917 int tlen;
19411918
@@ -2086,13 +2063,13 @@ again: · 144 unmodified lines
20862063 }
20872064 EXPORT_SYMBOL(d_delete);
20882065
2089−static void __d_rehash(struct dentry * entry, struct dcache_hash_bucket *b)
2066+static void __d_rehash(struct dentry * entry, struct hlist_bl_head *b)
20902067 {
20912068 BUG_ON(!d_unhashed(entry));
2092− spin_lock_bucket(b);
2093− entry->d_flags &= ~DCACHE_UNHASHED;
2094− hlist_bl_add_head_rcu(&entry->d_hash, &b->head);
2095− spin_unlock_bucket(b);
2069+ hlist_bl_lock(b);
2070+ entry->d_flags |= DCACHE_RCUACCESS;
2071+ hlist_bl_add_head_rcu(&entry->d_hash, b);
2072+ hlist_bl_unlock(b);
20962073 }
20972074
20982075 static void _d_rehash(struct dentry * entry)
@@ -3025,7 +3002,7 @@ static void __init dcache_init_early(void) · 926 unmodified lines
30253002
30263003 dentry_hashtable =
30273004 alloc_large_system_hash("Dentry cache",
3028− sizeof(struct dcache_hash_bucket),
3005+ sizeof(struct hlist_bl_head),
30293006 dhash_entries,
30303007 13,
30313008 HASH_EARLY,
@@ -3034,7 +3011,7 @@ static void __init dcache_init_early(void) · 2 unmodified lines
30343011 0);
30353012
30363013 for (loop = 0; loop < (1 << d_hash_shift); loop++)
3037− INIT_HLIST_BL_HEAD(&dentry_hashtable[loop].head);
3014+ INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
30383015 }
30393016
30403017 static void __init dcache_init(void)
@@ -3057,7 +3034,7 @@ static void __init dcache_init(void) · 16 unmodified lines
30573034
30583035 dentry_hashtable =
30593036 alloc_large_system_hash("Dentry cache",
3060− sizeof(struct dcache_hash_bucket),
3037+ sizeof(struct hlist_bl_head),
30613038 dhash_entries,
30623039 13,
30633040 0,
@@ -3066,7 +3043,7 @@ static void __init dcache_init(void) · 2 unmodified lines
30663043 0);
30673044
30683045 for (loop = 0; loop < (1 << d_hash_shift); loop++)
3069− INIT_HLIST_BL_HEAD(&dentry_hashtable[loop].head);
3046+ INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
30703047 }
30713048
30723049 /* SLAB cache for __getname() consumers */
fs/ecryptfs/crypto.c+21−0
@@ -1452,6 +1452,25 @@ static void set_default_header_data(struct ecryptfs_crypt_stat *crypt_stat) · 1451 unmodified lines
14521452 crypt_stat->metadata_size = ECRYPTFS_MINIMUM_HEADER_EXTENT_SIZE;
14531453 }
14541454
1455+void ecryptfs_i_size_init(const char *page_virt, struct inode *inode)
1456+{
1457+ struct ecryptfs_mount_crypt_stat *mount_crypt_stat;
1458+ struct ecryptfs_crypt_stat *crypt_stat;
1459+ u64 file_size;
1460+
1461+ crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat;
1462+ mount_crypt_stat =
1463+ &ecryptfs_superblock_to_private(inode->i_sb)->mount_crypt_stat;
1464+ if (mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) {
1465+ file_size = i_size_read(ecryptfs_inode_to_lower(inode));
1466+ if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR)
1467+ file_size += crypt_stat->metadata_size;
1468+ } else
1469+ file_size = get_unaligned_be64(page_virt);
1470+ i_size_write(inode, (loff_t)file_size);
1471+ crypt_stat->flags |= ECRYPTFS_I_SIZE_INITIALIZED;
1472+}
1473+
14551474 /**
14561475 * ecryptfs_read_headers_virt
14571476 * @page_virt: The virtual address into which to read the headers
@@ -1482,6 +1501,8 @@ static int ecryptfs_read_headers_virt(char *page_virt, · 24 unmodified lines
14821501 rc = -EINVAL;
14831502 goto out;
14841503 }
1504+ if (!(crypt_stat->flags & ECRYPTFS_I_SIZE_INITIALIZED))
1505+ ecryptfs_i_size_init(page_virt, ecryptfs_dentry->d_inode);
14851506 offset += MAGIC_ECRYPTFS_MARKER_SIZE_BYTES;
14861507 rc = ecryptfs_process_flags(crypt_stat, (page_virt + offset),
14871508 &bytes_read);
fs/ecryptfs/ecryptfs_kernel.h+6−1
@@ -269,6 +269,7 @@ struct ecryptfs_crypt_stat { · 268 unmodified lines
269269 #define ECRYPTFS_ENCFN_USE_MOUNT_FNEK 0x00000800
270270 #define ECRYPTFS_ENCFN_USE_FEK 0x00001000
271271 #define ECRYPTFS_UNLINK_SIGS 0x00002000
272+#define ECRYPTFS_I_SIZE_INITIALIZED 0x00004000
272273 u32 flags;
273274 unsigned int file_version;
274275 size_t iv_bytes;
@@ -295,6 +296,8 @@ struct ecryptfs_crypt_stat { · 20 unmodified lines
295296 struct ecryptfs_inode_info {
296297 struct inode vfs_inode;
297298 struct inode *wii_inode;
299+ struct mutex lower_file_mutex;
300+ atomic_t lower_file_count;
298301 struct file *lower_file;
299302 struct ecryptfs_crypt_stat crypt_stat;
300303 };
@@ -626,6 +629,7 @@ struct ecryptfs_open_req { · 325 unmodified lines
626629 int ecryptfs_interpose(struct dentry *hidden_dentry,
627630 struct dentry *this_dentry, struct super_block *sb,
628631 u32 flags);
632+void ecryptfs_i_size_init(const char *page_virt, struct inode *inode);
629633 int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry,
630634 struct dentry *lower_dentry,
631635 struct inode *ecryptfs_dir_inode);
@@ -757,7 +761,8 @@ int ecryptfs_privileged_open(struct file **lower_file, · 125 unmodified lines
757761 struct dentry *lower_dentry,
758762 struct vfsmount *lower_mnt,
759763 const struct cred *cred);
760−int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry);
764+int ecryptfs_get_lower_file(struct dentry *ecryptfs_dentry);
765+void ecryptfs_put_lower_file(struct inode *inode);
761766 int
762767 ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
763768 size_t *packet_size,
fs/ecryptfs/file.c+12−13
@@ -191,10 +191,10 @@ static int ecryptfs_open(struct inode *inode, struct file *file) · 190 unmodified lines
191191 | ECRYPTFS_ENCRYPTED);
192192 }
193193 mutex_unlock(&crypt_stat->cs_mutex);
194− rc = ecryptfs_init_persistent_file(ecryptfs_dentry);
194+ rc = ecryptfs_get_lower_file(ecryptfs_dentry);
195195 if (rc) {
196196 printk(KERN_ERR "%s: Error attempting to initialize "
197− "the persistent file for the dentry with name "
197+ "the lower file for the dentry with name "
198198 "[%s]; rc = [%d]\n", __func__,
199199 ecryptfs_dentry->d_name.name, rc);
200200 goto out_free;
@@ -202,9 +202,9 @@ static int ecryptfs_open(struct inode *inode, struct file *file) · 1 unmodified line
202202 if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_ACCMODE)
203203 == O_RDONLY && (file->f_flags & O_ACCMODE) != O_RDONLY) {
204204 rc = -EPERM;
205− printk(KERN_WARNING "%s: Lower persistent file is RO; eCryptfs "
205+ printk(KERN_WARNING "%s: Lower file is RO; eCryptfs "
206206 "file must hence be opened RO\n", __func__);
207− goto out_free;
207+ goto out_put;
208208 }
209209 ecryptfs_set_file_lower(
210210 file, ecryptfs_inode_to_private(inode)->lower_file);
@@ -232,10 +232,11 @@ static int ecryptfs_open(struct inode *inode, struct file *file) · 21 unmodified lines
232232 "Plaintext passthrough mode is not "
233233 "enabled; returning -EIO\n");
234234 mutex_unlock(&crypt_stat->cs_mutex);
235− goto out_free;
235+ goto out_put;
236236 }
237237 rc = 0;
238− crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
238+ crypt_stat->flags &= ~(ECRYPTFS_I_SIZE_INITIALIZED
239+ | ECRYPTFS_ENCRYPTED);
239240 mutex_unlock(&crypt_stat->cs_mutex);
240241 goto out;
241242 }
@@ -245,6 +246,8 @@ static int ecryptfs_open(struct inode *inode, struct file *file) · 3 unmodified lines
245246 "[0x%.16lx] size: [0x%.16llx]\n", inode, inode->i_ino,
246247 (unsigned long long)i_size_read(inode));
247248 goto out;
249+out_put:
250+ ecryptfs_put_lower_file(inode);
248251 out_free:
249252 kmem_cache_free(ecryptfs_file_info_cache,
250253 ecryptfs_file_to_private(file));
@@ -254,17 +257,13 @@ out: · 3 unmodified lines
254257
255258 static int ecryptfs_flush(struct file *file, fl_owner_t td)
256259 {
257− int rc = 0;
258− struct file *lower_file = NULL;
259−
260− lower_file = ecryptfs_file_to_lower(file);
261− if (lower_file->f_op && lower_file->f_op->flush)
262− rc = lower_file->f_op->flush(lower_file, td);
263− return rc;
260+ return file->f_mode & FMODE_WRITE
261+ ? filemap_write_and_wait(file->f_mapping) : 0;
264262 }
265263
266264 static int ecryptfs_release(struct inode *inode, struct file *file)
267265 {
266+ ecryptfs_put_lower_file(inode);
268267 kmem_cache_free(ecryptfs_file_info_cache,
269268 ecryptfs_file_to_private(file));
270269 return 0;
fs/ecryptfs/inode.c+32−28
@@ -168,19 +168,18 @@ static int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry) · 167 unmodified lines
168168 "context; rc = [%d]\n", rc);
169169 goto out;
170170 }
171− rc = ecryptfs_init_persistent_file(ecryptfs_dentry);
171+ rc = ecryptfs_get_lower_file(ecryptfs_dentry);
172172 if (rc) {
173173 printk(KERN_ERR "%s: Error attempting to initialize "
174− "the persistent file for the dentry with name "
174+ "the lower file for the dentry with name "
175175 "[%s]; rc = [%d]\n", __func__,
176176 ecryptfs_dentry->d_name.name, rc);
177177 goto out;
178178 }
179179 rc = ecryptfs_write_metadata(ecryptfs_dentry);
180− if (rc) {
180+ if (rc)
181181 printk(KERN_ERR "Error writing headers; rc = [%d]\n", rc);
182− goto out;
183− }
182+ ecryptfs_put_lower_file(ecryptfs_dentry->d_inode);
184183 out:
185184 return rc;
186185 }
@@ -226,11 +225,9 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, · 39 unmodified lines
226225 struct dentry *lower_dir_dentry;
227226 struct vfsmount *lower_mnt;
228227 struct inode *lower_inode;
229− struct ecryptfs_mount_crypt_stat *mount_crypt_stat;
230228 struct ecryptfs_crypt_stat *crypt_stat;
231229 char *page_virt = NULL;
232− u64 file_size;
233− int rc = 0;
230+ int put_lower = 0, rc = 0;
234231
235232 lower_dir_dentry = lower_dentry->d_parent;
236233 lower_mnt = mntget(ecryptfs_dentry_to_lower_mnt(
@@ -277,14 +274,15 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, · 40 unmodified lines
277274 rc = -ENOMEM;
278275 goto out;
279276 }
280− rc = ecryptfs_init_persistent_file(ecryptfs_dentry);
277+ rc = ecryptfs_get_lower_file(ecryptfs_dentry);
281278 if (rc) {
282279 printk(KERN_ERR "%s: Error attempting to initialize "
283− "the persistent file for the dentry with name "
280+ "the lower file for the dentry with name "
284281 "[%s]; rc = [%d]\n", __func__,
285282 ecryptfs_dentry->d_name.name, rc);
286283 goto out_free_kmem;
287284 }
285+ put_lower = 1;
288286 crypt_stat = &ecryptfs_inode_to_private(
289287 ecryptfs_dentry->d_inode)->crypt_stat;
290288 /* TODO: lock for crypt_stat comparison */
@@ -302,18 +300,7 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry, · 11 unmodified lines
302300 }
303301 crypt_stat->flags |= ECRYPTFS_METADATA_IN_XATTR;
304302 }
305− mount_crypt_stat = &ecryptfs_superblock_to_private(
306− ecryptfs_dentry->d_sb)->mount_crypt_stat;
307− if (mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) {
308− if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR)
309− file_size = (crypt_stat->metadata_size
310− + i_size_read(lower_dentry->d_inode));
311− else
312− file_size = i_size_read(lower_dentry->d_inode);
313− } else {
314− file_size = get_unaligned_be64(page_virt);
315− }
316− i_size_write(ecryptfs_dentry->d_inode, (loff_t)file_size);
303+ ecryptfs_i_size_init(page_virt, ecryptfs_dentry->d_inode);
317304 out_free_kmem:
318305 kmem_cache_free(ecryptfs_header_cache_2, page_virt);
319306 goto out;
@@ -322,6 +309,8 @@ out_put: · 2 unmodified lines
322309 mntput(lower_mnt);
323310 d_drop(ecryptfs_dentry);
324311 out:
312+ if (put_lower)
313+ ecryptfs_put_lower_file(ecryptfs_dentry->d_inode);
325314 return rc;
326315 }
327316
@@ -538,8 +527,6 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) · 210 unmodified lines
538527 dget(lower_dentry);
539528 rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry);
540529 dput(lower_dentry);
541− if (!rc)
542− d_delete(lower_dentry);
543530 fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode);
544531 dir->i_nlink = lower_dir_dentry->d_inode->i_nlink;
545532 unlock_dir(lower_dir_dentry);
@@ -610,8 +597,8 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 64 unmodified lines
610597 fsstack_copy_attr_all(old_dir, lower_old_dir_dentry->d_inode);
611598 out_lock:
612599 unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
613− dput(lower_new_dentry->d_parent);
614− dput(lower_old_dentry->d_parent);
600+ dput(lower_new_dir_dentry);
601+ dput(lower_old_dir_dentry);
615602 dput(lower_new_dentry);
616603 dput(lower_old_dentry);
617604 return rc;
@@ -759,8 +746,11 @@ static int truncate_upper(struct dentry *dentry, struct iattr *ia, · 141 unmodified lines
759746
760747 if (unlikely((ia->ia_size == i_size))) {
761748 lower_ia->ia_valid &= ~ATTR_SIZE;
762− goto out;
749+ return 0;
763750 }
751+ rc = ecryptfs_get_lower_file(dentry);
752+ if (rc)
753+ return rc;
764754 crypt_stat = &ecryptfs_inode_to_private(dentry->d_inode)->crypt_stat;
765755 /* Switch on growing or shrinking file */
766756 if (ia->ia_size > i_size) {
@@ -838,6 +828,7 @@ static int truncate_upper(struct dentry *dentry, struct iattr *ia, · 71 unmodified lines
838828 lower_ia->ia_valid &= ~ATTR_SIZE;
839829 }
840830 out:
831+ ecryptfs_put_lower_file(inode);
841832 return rc;
842833 }
843834
@@ -913,7 +904,13 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) · 69 unmodified lines
913904
914905 mount_crypt_stat = &ecryptfs_superblock_to_private(
915906 dentry->d_sb)->mount_crypt_stat;
907+ rc = ecryptfs_get_lower_file(dentry);
908+ if (rc) {
909+ mutex_unlock(&crypt_stat->cs_mutex);
910+ goto out;
911+ }
916912 rc = ecryptfs_read_metadata(dentry);
913+ ecryptfs_put_lower_file(inode);
917914 if (rc) {
918915 if (!(mount_crypt_stat->flags
919916 & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED)) {
@@ -927,10 +924,17 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) · 7 unmodified lines
927924 goto out;
928925 }
929926 rc = 0;
930− crypt_stat->flags &= ~(ECRYPTFS_ENCRYPTED);
927+ crypt_stat->flags &= ~(ECRYPTFS_I_SIZE_INITIALIZED
928+ | ECRYPTFS_ENCRYPTED);
931929 }
932930 }
933931 mutex_unlock(&crypt_stat->cs_mutex);
932+ if (S_ISREG(inode->i_mode)) {
933+ rc = filemap_write_and_wait(inode->i_mapping);
934+ if (rc)
935+ goto out;
936+ fsstack_copy_attr_all(inode, lower_inode);
937+ }
934938 memcpy(&lower_ia, ia, sizeof(lower_ia));
935939 if (ia->ia_valid & ATTR_FILE)
936940 lower_ia.ia_file = ecryptfs_file_to_lower(ia->ia_file);
fs/ecryptfs/kthread.c+3−3
@@ -44,7 +44,7 @@ static struct task_struct *ecryptfs_kthread; · 43 unmodified lines
4444 * @ignored: ignored
4545 *
4646 * The eCryptfs kernel thread that has the responsibility of getting
47− * the lower persistent file with RW permissions.
47+ * the lower file with RW permissions.
4848 *
4949 * Returns zero on success; non-zero otherwise
5050 */
@@ -141,8 +141,8 @@ int ecryptfs_privileged_open(struct file **lower_file, · 90 unmodified lines
141141 int rc = 0;
142142
143143 /* Corresponding dput() and mntput() are done when the
144− * persistent file is fput() when the eCryptfs inode is
145− * destroyed. */
144+ * lower file is fput() when all eCryptfs files for the inode are
145+ * released. */
146146 dget(lower_dentry);
147147 mntget(lower_mnt);
148148 flags |= IS_RDONLY(lower_dentry->d_inode) ? O_RDONLY : O_RDWR;
fs/ecryptfs/main.c+50−22
@@ -96,7 +96,7 @@ void __ecryptfs_printk(const char *fmt, ...) · 95 unmodified lines
9696 }
9797
9898 /**
99− * ecryptfs_init_persistent_file
99+ * ecryptfs_init_lower_file
100100 * @ecryptfs_dentry: Fully initialized eCryptfs dentry object, with
101101 * the lower dentry and the lower mount set
102102 *
@@ -104,42 +104,70 @@ void __ecryptfs_printk(const char *fmt, ...) · 1 unmodified line
104104 * inode. All I/O operations to the lower inode occur through that
105105 * file. When the first eCryptfs dentry that interposes with the first
106106 * lower dentry for that inode is created, this function creates the
107− * persistent file struct and associates it with the eCryptfs
108− * inode. When the eCryptfs inode is destroyed, the file is closed.
107+ * lower file struct and associates it with the eCryptfs
108+ * inode. When all eCryptfs files associated with the inode are released, the
109+ * file is closed.
109110 *
110− * The persistent file will be opened with read/write permissions, if
111+ * The lower file will be opened with read/write permissions, if
111112 * possible. Otherwise, it is opened read-only.
112113 *
113− * This function does nothing if a lower persistent file is already
114+ * This function does nothing if a lower file is already
114115 * associated with the eCryptfs inode.
115116 *
116117 * Returns zero on success; non-zero otherwise
117118 */
118−int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
119+static int ecryptfs_init_lower_file(struct dentry *dentry,
120+ struct file **lower_file)
119121 {
120122 const struct cred *cred = current_cred();
121− struct ecryptfs_inode_info *inode_info =
122− ecryptfs_inode_to_private(ecryptfs_dentry->d_inode);
123− int rc = 0;
123+ struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
124+ struct vfsmount *lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
125+ int rc;
124126
125− if (!inode_info->lower_file) {
126− struct dentry *lower_dentry;
127− struct vfsmount *lower_mnt =
128− ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry);
127+ rc = ecryptfs_privileged_open(lower_file, lower_dentry, lower_mnt,
128+ cred);
129+ if (rc) {
130+ printk(KERN_ERR "Error opening lower file "
131+ "for lower_dentry [0x%p] and lower_mnt [0x%p]; "
132+ "rc = [%d]\n", lower_dentry, lower_mnt, rc);
133+ (*lower_file) = NULL;
134+ }
135+ return rc;
136+}
129137
130− lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry);
131− rc = ecryptfs_privileged_open(&inode_info->lower_file,
132− lower_dentry, lower_mnt, cred);
133− if (rc) {
134− printk(KERN_ERR "Error opening lower persistent file "
135− "for lower_dentry [0x%p] and lower_mnt [0x%p]; "
136− "rc = [%d]\n", lower_dentry, lower_mnt, rc);
137− inode_info->lower_file = NULL;
138− }
138+int ecryptfs_get_lower_file(struct dentry *dentry)
139+{
140+ struct ecryptfs_inode_info *inode_info =
141+ ecryptfs_inode_to_private(dentry->d_inode);
142+ int count, rc = 0;
143+
144+ mutex_lock(&inode_info->lower_file_mutex);
145+ count = atomic_inc_return(&inode_info->lower_file_count);
146+ if (WARN_ON_ONCE(count < 1))
147+ rc = -EINVAL;
148+ else if (count == 1) {
149+ rc = ecryptfs_init_lower_file(dentry,
150+ &inode_info->lower_file);
151+ if (rc)
152+ atomic_set(&inode_info->lower_file_count, 0);
139153 }
154+ mutex_unlock(&inode_info->lower_file_mutex);
140155 return rc;
141156 }
142157
158+void ecryptfs_put_lower_file(struct inode *inode)
159+{
160+ struct ecryptfs_inode_info *inode_info;
161+
162+ inode_info = ecryptfs_inode_to_private(inode);
163+ if (atomic_dec_and_mutex_lock(&inode_info->lower_file_count,
164+ &inode_info->lower_file_mutex)) {
165+ fput(inode_info->lower_file);
166+ inode_info->lower_file = NULL;
167+ mutex_unlock(&inode_info->lower_file_mutex);
168+ }
169+}
170+
143171 static struct inode *ecryptfs_get_inode(struct inode *lower_inode,
144172 struct super_block *sb)
145173 {
fs/ecryptfs/super.c+4−12
@@ -55,6 +55,8 @@ static struct inode *ecryptfs_alloc_inode(struct super_block *sb) · 54 unmodified lines
5555 if (unlikely(!inode_info))
5656 goto out;
5757 ecryptfs_init_crypt_stat(&inode_info->crypt_stat);
58+ mutex_init(&inode_info->lower_file_mutex);
59+ atomic_set(&inode_info->lower_file_count, 0);
5860 inode_info->lower_file = NULL;
5961 inode = &inode_info->vfs_inode;
6062 out:
@@ -77,8 +79,7 @@ static void ecryptfs_i_callback(struct rcu_head *head) · 16 unmodified lines
7779 *
7880 * This is used during the final destruction of the inode. All
7981 * allocation of memory related to the inode, including allocated
80− * memory in the crypt_stat struct, will be released here. This
81− * function also fput()'s the persistent file for the lower inode.
82+ * memory in the crypt_stat struct, will be released here.
8283 * There should be no chance that this deallocation will be missed.
8384 */
8485 static void ecryptfs_destroy_inode(struct inode *inode)
@@ -86,16 +87,7 @@ static void ecryptfs_destroy_inode(struct inode *inode) · 1 unmodified line
8687 struct ecryptfs_inode_info *inode_info;
8788
8889 inode_info = ecryptfs_inode_to_private(inode);
89− if (inode_info->lower_file) {
90− struct dentry *lower_dentry =
91− inode_info->lower_file->f_dentry;
92−
93− BUG_ON(!lower_dentry);
94− if (lower_dentry->d_inode) {
95− fput(inode_info->lower_file);
96− inode_info->lower_file = NULL;
97− }
98− }
90+ BUG_ON(inode_info->lower_file);
9991 ecryptfs_destroy_crypt_stat(&inode_info->crypt_stat);
10092 call_rcu(&inode->i_rcu, ecryptfs_i_callback);
10193 }
fs/file.c+11−7
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <linux/module.h>
1010 #include <linux/fs.h>
1111 #include <linux/mm.h>
12+#include <linux/mmzone.h>
1213 #include <linux/time.h>
1314 #include <linux/sched.h>
1415 #include <linux/slab.h>
@@ -39,14 +40,17 @@ int sysctl_nr_open_max = 1024 * 1024; /* raised later */ · 24 unmodified lines
3940 */
4041 static DEFINE_PER_CPU(struct fdtable_defer, fdtable_defer_list);
4142
42−static inline void *alloc_fdmem(unsigned int size)
43+static void *alloc_fdmem(unsigned int size)
4344 {
44− void *data;
45−
46− data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN);
47− if (data != NULL)
48− return data;
49−
45+ /*
46+ * Very large allocations can stress page reclaim, so fall back to
47+ * vmalloc() if the allocation size will be considered "large" by the VM.
48+ */
49+ if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
50+ void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN);
51+ if (data != NULL)
52+ return data;
53+ }
5054 return vmalloc(size);
5155 }
5256
fs/fuse/dir.c+1−1
@@ -174,7 +174,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd) · 173 unmodified lines
174174 if (!inode)
175175 return 0;
176176
177− if (nd->flags & LOOKUP_RCU)
177+ if (nd && (nd->flags & LOOKUP_RCU))
178178 return -ECHILD;
179179
180180 fc = get_fuse_conn(inode);
fs/gfs2/aops.c+1−1
@@ -884,8 +884,8 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping, · 883 unmodified lines
884884 }
885885
886886 brelse(dibh);
887− gfs2_trans_end(sdp);
888887 failed:
888+ gfs2_trans_end(sdp);
889889 if (al) {
890890 gfs2_inplace_release(ip);
891891 gfs2_quota_unlock(ip);
fs/gfs2/dir.c+1−1
@@ -1506,7 +1506,7 @@ struct inode *gfs2_dir_search(struct inode *dir, const struct qstr *name) · 1505 unmodified lines
15061506 inode = gfs2_inode_lookup(dir->i_sb,
15071507 be16_to_cpu(dent->de_type),
15081508 be64_to_cpu(dent->de_inum.no_addr),
1509− be64_to_cpu(dent->de_inum.no_formal_ino));
1509+ be64_to_cpu(dent->de_inum.no_formal_ino), 0);
15101510 brelse(bh);
15111511 return inode;
15121512 }
fs/gfs2/file.c+48−10
@@ -617,18 +617,51 @@ static ssize_t gfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov, · 616 unmodified lines
617617 return generic_file_aio_write(iocb, iov, nr_segs, pos);
618618 }
619619
620−static void empty_write_end(struct page *page, unsigned from,
621− unsigned to)
620+static int empty_write_end(struct page *page, unsigned from,
621+ unsigned to, int mode)
622622 {
623− struct gfs2_inode *ip = GFS2_I(page->mapping->host);
623+ struct inode *inode = page->mapping->host;
624+ struct gfs2_inode *ip = GFS2_I(inode);
625+ struct buffer_head *bh;
626+ unsigned offset, blksize = 1 << inode->i_blkbits;
627+ pgoff_t end_index = i_size_read(inode) >> PAGE_CACHE_SHIFT;
624628
625629 zero_user(page, from, to-from);
626630 mark_page_accessed(page);
627631
628− if (!gfs2_is_writeback(ip))
629− gfs2_page_add_databufs(ip, page, from, to);
632+ if (page->index < end_index || !(mode & FALLOC_FL_KEEP_SIZE)) {
633+ if (!gfs2_is_writeback(ip))
634+ gfs2_page_add_databufs(ip, page, from, to);
635+
636+ block_commit_write(page, from, to);
637+ return 0;
638+ }
639+
640+ offset = 0;
641+ bh = page_buffers(page);
642+ while (offset < to) {
643+ if (offset >= from) {
644+ set_buffer_uptodate(bh);
645+ mark_buffer_dirty(bh);
646+ clear_buffer_new(bh);
647+ write_dirty_buffer(bh, WRITE);
648+ }
649+ offset += blksize;
650+ bh = bh->b_this_page;
651+ }
630652
631− block_commit_write(page, from, to);
653+ offset = 0;
654+ bh = page_buffers(page);
655+ while (offset < to) {
656+ if (offset >= from) {
657+ wait_on_buffer(bh);
658+ if (!buffer_uptodate(bh))
659+ return -EIO;
660+ }
661+ offset += blksize;
662+ bh = bh->b_this_page;
663+ }
664+ return 0;
632665 }
633666
634667 static int needs_empty_write(sector_t block, struct inode *inode)
@@ -643,7 +676,8 @@ static int needs_empty_write(sector_t block, struct inode *inode) · 8 unmodified lines
643676 return !buffer_mapped(&bh_map);
644677 }
645678
646−static int write_empty_blocks(struct page *page, unsigned from, unsigned to)
679+static int write_empty_blocks(struct page *page, unsigned from, unsigned to,
680+ int mode)
647681 {
648682 struct inode *inode = page->mapping->host;
649683 unsigned start, end, next, blksize;
@@ -668,7 +702,9 @@ static int write_empty_blocks(struct page *page, unsigned from, unsigned to) · 18 unmodified lines
668702 gfs2_block_map);
669703 if (unlikely(ret))
670704 return ret;
671− empty_write_end(page, start, end);
705+ ret = empty_write_end(page, start, end, mode);
706+ if (unlikely(ret))
707+ return ret;
672708 end = 0;
673709 }
674710 start = next;
@@ -682,7 +718,9 @@ static int write_empty_blocks(struct page *page, unsigned from, unsigned to) · 7 unmodified lines
682718 ret = __block_write_begin(page, start, end - start, gfs2_block_map);
683719 if (unlikely(ret))
684720 return ret;
685− empty_write_end(page, start, end);
721+ ret = empty_write_end(page, start, end, mode);
722+ if (unlikely(ret))
723+ return ret;
686724 }
687725
688726 return 0;
@@ -731,7 +769,7 @@ static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len, · 42 unmodified lines
731769
732770 if (curr == end)
733771 to = end_offset;
734− error = write_empty_blocks(page, from, to);
772+ error = write_empty_blocks(page, from, to, mode);
735773 if (!error && offset + to > inode->i_size &&
736774 !(mode & FALLOC_FL_KEEP_SIZE)) {
737775 i_size_write(inode, offset + to);
fs/gfs2/glock.c+2−4
@@ -93,14 +93,12 @@ static unsigned int gl_hash(const struct gfs2_sbd *sdp, · 92 unmodified lines
9393
9494 static inline void spin_lock_bucket(unsigned int hash)
9595 {
96− struct hlist_bl_head *bl = &gl_hash_table[hash];
97− bit_spin_lock(0, (unsigned long *)bl);
96+ hlist_bl_lock(&gl_hash_table[hash]);
9897 }
9998
10099 static inline void spin_unlock_bucket(unsigned int hash)
101100 {
102− struct hlist_bl_head *bl = &gl_hash_table[hash];
103− __bit_spin_unlock(0, (unsigned long *)bl);
101+ hlist_bl_unlock(&gl_hash_table[hash]);
104102 }
105103
106104 static void gfs2_glock_dealloc(struct rcu_head *rcu)
fs/gfs2/glops.c+4−0
@@ -385,6 +385,10 @@ static int trans_go_demote_ok(const struct gfs2_glock *gl) · 384 unmodified lines
385385 static void iopen_go_callback(struct gfs2_glock *gl)
386386 {
387387 struct gfs2_inode *ip = (struct gfs2_inode *)gl->gl_object;
388+ struct gfs2_sbd *sdp = gl->gl_sbd;
389+
390+ if (sdp->sd_vfs->s_flags & MS_RDONLY)
391+ return;
388392
389393 if (gl->gl_demote_state == LM_ST_UNLOCKED &&
390394 gl->gl_state == LM_ST_SHARED && ip) {
fs/gfs2/inode.c+41−15
@@ -40,37 +40,61 @@ struct gfs2_inum_range_host { · 39 unmodified lines
4040 u64 ir_length;
4141 };
4242
43+struct gfs2_skip_data {
44+ u64 no_addr;
45+ int skipped;
46+ int non_block;
47+};
48+
4349 static int iget_test(struct inode *inode, void *opaque)
4450 {
4551 struct gfs2_inode *ip = GFS2_I(inode);
46− u64 *no_addr = opaque;
52+ struct gfs2_skip_data *data = opaque;
4753
48− if (ip->i_no_addr == *no_addr)
54+ if (ip->i_no_addr == data->no_addr) {
55+ if (data->non_block &&
56+ inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE)) {
57+ data->skipped = 1;
58+ return 0;
59+ }
4960 return 1;
50−
61+ }
5162 return 0;
5263 }
5364
5465 static int iget_set(struct inode *inode, void *opaque)
5566 {
5667 struct gfs2_inode *ip = GFS2_I(inode);
57− u64 *no_addr = opaque;
68+ struct gfs2_skip_data *data = opaque;
5869
59− inode->i_ino = (unsigned long)*no_addr;
60− ip->i_no_addr = *no_addr;
70+ if (data->skipped)
71+ return -ENOENT;
72+ inode->i_ino = (unsigned long)(data->no_addr);
73+ ip->i_no_addr = data->no_addr;
6174 return 0;
6275 }
6376
6477 struct inode *gfs2_ilookup(struct super_block *sb, u64 no_addr)
6578 {
6679 unsigned long hash = (unsigned long)no_addr;
67− return ilookup5(sb, hash, iget_test, &no_addr);
80+ struct gfs2_skip_data data;
81+
82+ data.no_addr = no_addr;
83+ data.skipped = 0;
84+ data.non_block = 0;
85+ return ilookup5(sb, hash, iget_test, &data);
6886 }
6987
70−static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr)
88+static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr,
89+ int non_block)
7190 {
91+ struct gfs2_skip_data data;
7292 unsigned long hash = (unsigned long)no_addr;
73− return iget5_locked(sb, hash, iget_test, iget_set, &no_addr);
93+
94+ data.no_addr = no_addr;
95+ data.skipped = 0;
96+ data.non_block = non_block;
97+ return iget5_locked(sb, hash, iget_test, iget_set, &data);
7498 }
7599
76100 /**
@@ -111,19 +135,20 @@ static void gfs2_set_iop(struct inode *inode) · 34 unmodified lines
111135 * @sb: The super block
112136 * @no_addr: The inode number
113137 * @type: The type of the inode
138+ * non_block: Can we block on inodes that are being freed?
114139 *
115140 * Returns: A VFS inode, or an error
116141 */
117142
118143 struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
119− u64 no_addr, u64 no_formal_ino)
144+ u64 no_addr, u64 no_formal_ino, int non_block)
120145 {
121146 struct inode *inode;
122147 struct gfs2_inode *ip;
123148 struct gfs2_glock *io_gl = NULL;
124149 int error;
125150
126− inode = gfs2_iget(sb, no_addr);
151+ inode = gfs2_iget(sb, no_addr, non_block);
127152 ip = GFS2_I(inode);
128153
129154 if (!inode)
@@ -185,11 +210,12 @@ struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, · 55 unmodified lines
185210 {
186211 struct super_block *sb = sdp->sd_vfs;
187212 struct gfs2_holder i_gh;
188− struct inode *inode;
213+ struct inode *inode = NULL;
189214 int error;
190215
216+ /* Must not read in block until block type is verified */
191217 error = gfs2_glock_nq_num(sdp, no_addr, &gfs2_inode_glops,
192− LM_ST_SHARED, LM_FLAG_ANY, &i_gh);
218+ LM_ST_EXCLUSIVE, GL_SKIP, &i_gh);
193219 if (error)
194220 return ERR_PTR(error);
195221
@@ -197,7 +223,7 @@ struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, · 1 unmodified line
197223 if (error)
198224 goto fail;
199225
200− inode = gfs2_inode_lookup(sb, DT_UNKNOWN, no_addr, 0);
226+ inode = gfs2_inode_lookup(sb, DT_UNKNOWN, no_addr, 0, 1);
201227 if (IS_ERR(inode))
202228 goto fail;
203229
@@ -843,7 +869,7 @@ struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name, · 639 unmodified lines
843869 goto fail_gunlock2;
844870
845871 inode = gfs2_inode_lookup(dir->i_sb, IF2DT(mode), inum.no_addr,
846− inum.no_formal_ino);
872+ inum.no_formal_ino, 0);
847873 if (IS_ERR(inode))
848874 goto fail_gunlock2;
849875
fs/gfs2/inode.h+2−1
@@ -97,7 +97,8 @@ err: · 96 unmodified lines
9797 }
9898
9999 extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type,
100− u64 no_addr, u64 no_formal_ino);
100+ u64 no_addr, u64 no_formal_ino,
101+ int non_block);
101102 extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
102103 u64 *no_formal_ino,
103104 unsigned int blktype);
fs/gfs2/ops_fstype.c+1−1
@@ -430,7 +430,7 @@ static int gfs2_lookup_root(struct super_block *sb, struct dentry **dptr, · 429 unmodified lines
430430 struct dentry *dentry;
431431 struct inode *inode;
432432
433− inode = gfs2_inode_lookup(sb, DT_DIR, no_addr, 0);
433+ inode = gfs2_inode_lookup(sb, DT_DIR, no_addr, 0, 0);
434434 if (IS_ERR(inode)) {
435435 fs_err(sdp, "can't read in %s inode: %ld\n", name, PTR_ERR(inode));
436436 return PTR_ERR(inode);
fs/gfs2/rgrp.c+2−2
@@ -945,7 +945,7 @@ static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip · 944 unmodified lines
945945 /* rgblk_search can return a block < goal, so we need to
946946 keep it marching forward. */
947947 no_addr = block + rgd->rd_data0;
948− goal++;
948+ goal = max(block + 1, goal + 1);
949949 if (*last_unlinked != NO_BLOCK && no_addr <= *last_unlinked)
950950 continue;
951951 if (no_addr == skip)
@@ -971,7 +971,7 @@ static void try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked, u64 skip · 19 unmodified lines
971971 found++;
972972
973973 /* Limit reclaim to sensible number of tasks */
974− if (found > 2*NR_CPUS)
974+ if (found > NR_CPUS)
975975 return;
976976 }
977977
fs/gfs2/super.c+11−3
@@ -1318,15 +1318,17 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt) · 1317 unmodified lines
13181318
13191319 static void gfs2_evict_inode(struct inode *inode)
13201320 {
1321− struct gfs2_sbd *sdp = inode->i_sb->s_fs_info;
1321+ struct super_block *sb = inode->i_sb;
1322+ struct gfs2_sbd *sdp = sb->s_fs_info;
13221323 struct gfs2_inode *ip = GFS2_I(inode);
13231324 struct gfs2_holder gh;
13241325 int error;
13251326
1326− if (inode->i_nlink)
1327+ if (inode->i_nlink || (sb->s_flags & MS_RDONLY))
13271328 goto out;
13281329
1329− error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
1330+ /* Must not read inode block until block type has been verified */
1331+ error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh);
13301332 if (unlikely(error)) {
13311333 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
13321334 goto out;
@@ -1336,6 +1338,12 @@ static void gfs2_evict_inode(struct inode *inode) · 3 unmodified lines
13361338 if (error)
13371339 goto out_truncate;
13381340
1341+ if (test_bit(GIF_INVALID, &ip->i_flags)) {
1342+ error = gfs2_inode_refresh(ip);
1343+ if (error)
1344+ goto out_truncate;
1345+ }
1346+
13391347 ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
13401348 gfs2_glock_dq_wait(&ip->i_iopen_gh);
13411349 gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, &ip->i_iopen_gh);
fs/hpfs/Kconfig+0−1
@@ -1,7 +1,6 @@
11 config HPFS_FS
22 tristate "OS/2 HPFS file system support"
33 depends on BLOCK
4− depends on BROKEN || !PREEMPT
54 help
65 OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
76 is the file system used for organizing files on OS/2 hard disk
fs/hpfs/alloc.c+43−75
@@ -8,8 +8,6 @@ · 7 unmodified lines
88
99 #include "hpfs_fn.h"
1010
11−static int hpfs_alloc_if_possible_nolock(struct super_block *s, secno sec);
12−
1311 /*
1412 * Check if a sector is allocated in bitmap
1513 * This is really slow. Turned on only if chk==2
@@ -18,9 +16,9 @@ static int hpfs_alloc_if_possible_nolock(struct super_block *s, secno sec); · 2 unmodified lines
1816 static int chk_if_allocated(struct super_block *s, secno sec, char *msg)
1917 {
2018 struct quad_buffer_head qbh;
21− unsigned *bmp;
19+ u32 *bmp;
2220 if (!(bmp = hpfs_map_bitmap(s, sec >> 14, &qbh, "chk"))) goto fail;
23− if ((bmp[(sec & 0x3fff) >> 5] >> (sec & 0x1f)) & 1) {
21+ if ((cpu_to_le32(bmp[(sec & 0x3fff) >> 5]) >> (sec & 0x1f)) & 1) {
2422 hpfs_error(s, "sector '%s' - %08x not allocated in bitmap", msg, sec);
2523 goto fail1;
2624 }
@@ -28,7 +26,7 @@ static int chk_if_allocated(struct super_block *s, secno sec, char *msg) · 1 unmodified line
2826 if (sec >= hpfs_sb(s)->sb_dirband_start && sec < hpfs_sb(s)->sb_dirband_start + hpfs_sb(s)->sb_dirband_size) {
2927 unsigned ssec = (sec - hpfs_sb(s)->sb_dirband_start) / 4;
3028 if (!(bmp = hpfs_map_dnode_bitmap(s, &qbh))) goto fail;
31− if ((bmp[ssec >> 5] >> (ssec & 0x1f)) & 1) {
29+ if ((le32_to_cpu(bmp[ssec >> 5]) >> (ssec & 0x1f)) & 1) {
3230 hpfs_error(s, "sector '%s' - %08x not allocated in directory bitmap", msg, sec);
3331 goto fail1;
3432 }
@@ -75,7 +73,6 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne · 40 unmodified lines
7573 hpfs_error(s, "Bad allocation size: %d", n);
7674 return 0;
7775 }
78− lock_super(s);
7976 if (bs != ~0x3fff) {
8077 if (!(bmp = hpfs_map_bitmap(s, near >> 14, &qbh, "aib"))) goto uls;
8178 } else {
@@ -85,10 +82,6 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne · 3 unmodified lines
8582 ret = bs + nr;
8683 goto rt;
8784 }
88− /*if (!tstbits(bmp, nr + n, n + forward)) {
89− ret = bs + nr + n;
90− goto rt;
91− }*/
9285 q = nr + n; b = 0;
9386 while ((a = tstbits(bmp, q, n + forward)) != 0) {
9487 q += a;
@@ -105,14 +98,14 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne · 10 unmodified lines
10598 goto rt;
10699 }
107100 nr >>= 5;
108− /*for (i = nr + 1; i != nr; i++, i &= 0x1ff) {*/
101+ /*for (i = nr + 1; i != nr; i++, i &= 0x1ff) */
109102 i = nr;
110103 do {
111− if (!bmp[i]) goto cont;
112− if (n + forward >= 0x3f && bmp[i] != -1) goto cont;
104+ if (!le32_to_cpu(bmp[i])) goto cont;
105+ if (n + forward >= 0x3f && le32_to_cpu(bmp[i]) != 0xffffffff) goto cont;
113106 q = i<<5;
114107 if (i > 0) {
115− unsigned k = bmp[i-1];
108+ unsigned k = le32_to_cpu(bmp[i-1]);
116109 while (k & 0x80000000) {
117110 q--; k <<= 1;
118111 }
@@ -132,18 +125,17 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne · 13 unmodified lines
132125 } while (i != nr);
133126 rt:
134127 if (ret) {
135− if (hpfs_sb(s)->sb_chk && ((ret >> 14) != (bs >> 14) || (bmp[(ret & 0x3fff) >> 5] | ~(((1 << n) - 1) << (ret & 0x1f))) != 0xffffffff)) {
128+ if (hpfs_sb(s)->sb_chk && ((ret >> 14) != (bs >> 14) || (le32_to_cpu(bmp[(ret & 0x3fff) >> 5]) | ~(((1 << n) - 1) << (ret & 0x1f))) != 0xffffffff)) {
136129 hpfs_error(s, "Allocation doesn't work! Wanted %d, allocated at %08x", n, ret);
137130 ret = 0;
138131 goto b;
139132 }
140− bmp[(ret & 0x3fff) >> 5] &= ~(((1 << n) - 1) << (ret & 0x1f));
133+ bmp[(ret & 0x3fff) >> 5] &= cpu_to_le32(~(((1 << n) - 1) << (ret & 0x1f)));
141134 hpfs_mark_4buffers_dirty(&qbh);
142135 }
143136 b:
144137 hpfs_brelse4(&qbh);
145138 uls:
146− unlock_super(s);
147139 return ret;
148140 }
149141
@@ -155,7 +147,7 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne · 5 unmodified lines
155147 * sectors
156148 */
157149
158−secno hpfs_alloc_sector(struct super_block *s, secno near, unsigned n, int forward, int lock)
150+secno hpfs_alloc_sector(struct super_block *s, secno near, unsigned n, int forward)
159151 {
160152 secno sec;
161153 int i;
@@ -167,7 +159,6 @@ secno hpfs_alloc_sector(struct super_block *s, secno near, unsigned n, int forwa · 5 unmodified lines
167159 forward = -forward;
168160 f_p = 1;
169161 }
170− if (lock) hpfs_lock_creation(s);
171162 n_bmps = (sbi->sb_fs_size + 0x4000 - 1) >> 14;
172163 if (near && near < sbi->sb_fs_size) {
173164 if ((sec = alloc_in_bmp(s, near, n, f_p ? forward : forward/4))) goto ret;
@@ -214,18 +205,17 @@ secno hpfs_alloc_sector(struct super_block *s, secno near, unsigned n, int forwa · 40 unmodified lines
214205 ret:
215206 if (sec && f_p) {
216207 for (i = 0; i < forward; i++) {
217− if (!hpfs_alloc_if_possible_nolock(s, sec + i + 1)) {
208+ if (!hpfs_alloc_if_possible(s, sec + i + 1)) {
218209 hpfs_error(s, "Prealloc doesn't work! Wanted %d, allocated at %08x, can't allocate %d", forward, sec, i);
219210 sec = 0;
220211 break;
221212 }
222213 }
223214 }
224− if (lock) hpfs_unlock_creation(s);
225215 return sec;
226216 }
227217
228−static secno alloc_in_dirband(struct super_block *s, secno near, int lock)
218+static secno alloc_in_dirband(struct super_block *s, secno near)
229219 {
230220 unsigned nr = near;
231221 secno sec;
@@ -236,49 +226,35 @@ static secno alloc_in_dirband(struct super_block *s, secno near, int lock) · 4 unmodified lines
236226 nr = sbi->sb_dirband_start + sbi->sb_dirband_size - 4;
237227 nr -= sbi->sb_dirband_start;
238228 nr >>= 2;
239− if (lock) hpfs_lock_creation(s);
240229 sec = alloc_in_bmp(s, (~0x3fff) | nr, 1, 0);
241− if (lock) hpfs_unlock_creation(s);
242230 if (!sec) return 0;
243231 return ((sec & 0x3fff) << 2) + sbi->sb_dirband_start;
244232 }
245233
246234 /* Alloc sector if it's free */
247235
248−static int hpfs_alloc_if_possible_nolock(struct super_block *s, secno sec)
236+int hpfs_alloc_if_possible(struct super_block *s, secno sec)
249237 {
250238 struct quad_buffer_head qbh;
251− unsigned *bmp;
252− lock_super(s);
239+ u32 *bmp;
253240 if (!(bmp = hpfs_map_bitmap(s, sec >> 14, &qbh, "aip"))) goto end;
254− if (bmp[(sec & 0x3fff) >> 5] & (1 << (sec & 0x1f))) {
255− bmp[(sec & 0x3fff) >> 5] &= ~(1 << (sec & 0x1f));
241+ if (le32_to_cpu(bmp[(sec & 0x3fff) >> 5]) & (1 << (sec & 0x1f))) {
242+ bmp[(sec & 0x3fff) >> 5] &= cpu_to_le32(~(1 << (sec & 0x1f)));
256243 hpfs_mark_4buffers_dirty(&qbh);
257244 hpfs_brelse4(&qbh);
258− unlock_super(s);
259245 return 1;
260246 }
261247 hpfs_brelse4(&qbh);
262248 end:
263− unlock_super(s);
264249 return 0;
265250 }
266251
267−int hpfs_alloc_if_possible(struct super_block *s, secno sec)
268−{
269− int r;
270− hpfs_lock_creation(s);
271− r = hpfs_alloc_if_possible_nolock(s, sec);
272− hpfs_unlock_creation(s);
273− return r;
274−}
275−
276252 /* Free sectors in bitmaps */
277253
278254 void hpfs_free_sectors(struct super_block *s, secno sec, unsigned n)
279255 {
280256 struct quad_buffer_head qbh;
281− unsigned *bmp;
257+ u32 *bmp;
282258 struct hpfs_sb_info *sbi = hpfs_sb(s);
283259 /*printk("2 - ");*/
284260 if (!n) return;
@@ -286,26 +262,22 @@ void hpfs_free_sectors(struct super_block *s, secno sec, unsigned n) · 1 unmodified line
286262 hpfs_error(s, "Trying to free reserved sector %08x", sec);
287263 return;
288264 }
289− lock_super(s);
290265 sbi->sb_max_fwd_alloc += n > 0xffff ? 0xffff : n;
291266 if (sbi->sb_max_fwd_alloc > 0xffffff) sbi->sb_max_fwd_alloc = 0xffffff;
292267 new_map:
293268 if (!(bmp = hpfs_map_bitmap(s, sec >> 14, &qbh, "free"))) {
294− unlock_super(s);
295269 return;
296270 }
297271 new_tst:
298− if ((bmp[(sec & 0x3fff) >> 5] >> (sec & 0x1f) & 1)) {
272+ if ((le32_to_cpu(bmp[(sec & 0x3fff) >> 5]) >> (sec & 0x1f) & 1)) {
299273 hpfs_error(s, "sector %08x not allocated", sec);
300274 hpfs_brelse4(&qbh);
301− unlock_super(s);
302275 return;
303276 }
304− bmp[(sec & 0x3fff) >> 5] |= 1 << (sec & 0x1f);
277+ bmp[(sec & 0x3fff) >> 5] |= cpu_to_le32(1 << (sec & 0x1f));
305278 if (!--n) {
306279 hpfs_mark_4buffers_dirty(&qbh);
307280 hpfs_brelse4(&qbh);
308− unlock_super(s);
309281 return;
310282 }
311283 if (!(++sec & 0x3fff)) {
@@ -327,13 +299,13 @@ int hpfs_check_free_dnodes(struct super_block *s, int n) · 15 unmodified lines
327299 int n_bmps = (hpfs_sb(s)->sb_fs_size + 0x4000 - 1) >> 14;
328300 int b = hpfs_sb(s)->sb_c_bitmap & 0x0fffffff;
329301 int i, j;
330− unsigned *bmp;
302+ u32 *bmp;
331303 struct quad_buffer_head qbh;
332304 if ((bmp = hpfs_map_dnode_bitmap(s, &qbh))) {
333305 for (j = 0; j < 512; j++) {
334306 unsigned k;
335− if (!bmp[j]) continue;
336− for (k = bmp[j]; k; k >>= 1) if (k & 1) if (!--n) {
307+ if (!le32_to_cpu(bmp[j])) continue;
308+ for (k = le32_to_cpu(bmp[j]); k; k >>= 1) if (k & 1) if (!--n) {
337309 hpfs_brelse4(&qbh);
338310 return 0;
339311 }
@@ -352,10 +324,10 @@ int hpfs_check_free_dnodes(struct super_block *s, int n) · 12 unmodified lines
352324 chk_bmp:
353325 if (bmp) {
354326 for (j = 0; j < 512; j++) {
355− unsigned k;
356− if (!bmp[j]) continue;
327+ u32 k;
328+ if (!le32_to_cpu(bmp[j])) continue;
357329 for (k = 0xf; k; k <<= 4)
358− if ((bmp[j] & k) == k) {
330+ if ((le32_to_cpu(bmp[j]) & k) == k) {
359331 if (!--n) {
360332 hpfs_brelse4(&qbh);
361333 return 0;
@@ -379,44 +351,40 @@ void hpfs_free_dnode(struct super_block *s, dnode_secno dno) · 17 unmodified lines
379351 hpfs_free_sectors(s, dno, 4);
380352 } else {
381353 struct quad_buffer_head qbh;
382− unsigned *bmp;
354+ u32 *bmp;
383355 unsigned ssec = (dno - hpfs_sb(s)->sb_dirband_start) / 4;
384− lock_super(s);
385356 if (!(bmp = hpfs_map_dnode_bitmap(s, &qbh))) {
386− unlock_super(s);
387357 return;
388358 }
389− bmp[ssec >> 5] |= 1 << (ssec & 0x1f);
359+ bmp[ssec >> 5] |= cpu_to_le32(1 << (ssec & 0x1f));
390360 hpfs_mark_4buffers_dirty(&qbh);
391361 hpfs_brelse4(&qbh);
392− unlock_super(s);
393362 }
394363 }
395364
396365 struct dnode *hpfs_alloc_dnode(struct super_block *s, secno near,
397− dnode_secno *dno, struct quad_buffer_head *qbh,
398− int lock)
366+ dnode_secno *dno, struct quad_buffer_head *qbh)
399367 {
400368 struct dnode *d;
401369 if (hpfs_count_one_bitmap(s, hpfs_sb(s)->sb_dmap) > FREE_DNODES_ADD) {
402− if (!(*dno = alloc_in_dirband(s, near, lock)))
403− if (!(*dno = hpfs_alloc_sector(s, near, 4, 0, lock))) return NULL;
370+ if (!(*dno = alloc_in_dirband(s, near)))
371+ if (!(*dno = hpfs_alloc_sector(s, near, 4, 0))) return NULL;
404372 } else {
405− if (!(*dno = hpfs_alloc_sector(s, near, 4, 0, lock)))
406− if (!(*dno = alloc_in_dirband(s, near, lock))) return NULL;
373+ if (!(*dno = hpfs_alloc_sector(s, near, 4, 0)))
374+ if (!(*dno = alloc_in_dirband(s, near))) return NULL;
407375 }
408376 if (!(d = hpfs_get_4sectors(s, *dno, qbh))) {
409377 hpfs_free_dnode(s, *dno);
410378 return NULL;
411379 }
412380 memset(d, 0, 2048);
413− d->magic = DNODE_MAGIC;
414− d->first_free = 52;
381+ d->magic = cpu_to_le32(DNODE_MAGIC);
382+ d->first_free = cpu_to_le32(52);
415383 d->dirent[0] = 32;
416384 d->dirent[2] = 8;
417385 d->dirent[30] = 1;
418386 d->dirent[31] = 255;
419− d->self = *dno;
387+ d->self = cpu_to_le32(*dno);
420388 return d;
421389 }
422390
@@ -424,16 +392,16 @@ struct fnode *hpfs_alloc_fnode(struct super_block *s, secno near, fnode_secno *f · 1 unmodified line
424392 struct buffer_head **bh)
425393 {
426394 struct fnode *f;
427− if (!(*fno = hpfs_alloc_sector(s, near, 1, FNODE_ALLOC_FWD, 1))) return NULL;
395+ if (!(*fno = hpfs_alloc_sector(s, near, 1, FNODE_ALLOC_FWD))) return NULL;
428396 if (!(f = hpfs_get_sector(s, *fno, bh))) {
429397 hpfs_free_sectors(s, *fno, 1);
430398 return NULL;
431399 }
432400 memset(f, 0, 512);
433− f->magic = FNODE_MAGIC;
434− f->ea_offs = 0xc4;
401+ f->magic = cpu_to_le32(FNODE_MAGIC);
402+ f->ea_offs = cpu_to_le16(0xc4);
435403 f->btree.n_free_nodes = 8;
436− f->btree.first_free = 8;
404+ f->btree.first_free = cpu_to_le16(8);
437405 return f;
438406 }
439407
@@ -441,16 +409,16 @@ struct anode *hpfs_alloc_anode(struct super_block *s, secno near, anode_secno *a · 1 unmodified line
441409 struct buffer_head **bh)
442410 {
443411 struct anode *a;
444− if (!(*ano = hpfs_alloc_sector(s, near, 1, ANODE_ALLOC_FWD, 1))) return NULL;
412+ if (!(*ano = hpfs_alloc_sector(s, near, 1, ANODE_ALLOC_FWD))) return NULL;
445413 if (!(a = hpfs_get_sector(s, *ano, bh))) {
446414 hpfs_free_sectors(s, *ano, 1);
447415 return NULL;
448416 }
449417 memset(a, 0, 512);
450− a->magic = ANODE_MAGIC;
451− a->self = *ano;
418+ a->magic = cpu_to_le32(ANODE_MAGIC);
419+ a->self = cpu_to_le32(*ano);
452420 a->btree.n_free_nodes = 40;
453421 a->btree.n_used_nodes = 0;
454− a->btree.first_free = 8;
422+ a->btree.first_free = cpu_to_le16(8);
455423 return a;
456424 }
fs/hpfs/anode.c+69−69
@@ -22,8 +22,8 @@ secno hpfs_bplus_lookup(struct super_block *s, struct inode *inode, · 21 unmodified lines
2222 if (hpfs_sb(s)->sb_chk) if (hpfs_stop_cycles(s, a, &c1, &c2, "hpfs_bplus_lookup")) return -1;
2323 if (btree->internal) {
2424 for (i = 0; i < btree->n_used_nodes; i++)
25− if (btree->u.internal[i].file_secno > sec) {
26− a = btree->u.internal[i].down;
25+ if (le32_to_cpu(btree->u.internal[i].file_secno) > sec) {
26+ a = le32_to_cpu(btree->u.internal[i].down);
2727 brelse(bh);
2828 if (!(anode = hpfs_map_anode(s, a, &bh))) return -1;
2929 btree = &anode->btree;
@@ -34,18 +34,18 @@ secno hpfs_bplus_lookup(struct super_block *s, struct inode *inode, · 4 unmodified lines
3434 return -1;
3535 }
3636 for (i = 0; i < btree->n_used_nodes; i++)
37− if (btree->u.external[i].file_secno <= sec &&
38− btree->u.external[i].file_secno + btree->u.external[i].length > sec) {
39− a = btree->u.external[i].disk_secno + sec - btree->u.external[i].file_secno;
37+ if (le32_to_cpu(btree->u.external[i].file_secno) <= sec &&
38+ le32_to_cpu(btree->u.external[i].file_secno) + le32_to_cpu(btree->u.external[i].length) > sec) {
39+ a = le32_to_cpu(btree->u.external[i].disk_secno) + sec - le32_to_cpu(btree->u.external[i].file_secno);
4040 if (hpfs_sb(s)->sb_chk) if (hpfs_chk_sectors(s, a, 1, "data")) {
4141 brelse(bh);
4242 return -1;
4343 }
4444 if (inode) {
4545 struct hpfs_inode_info *hpfs_inode = hpfs_i(inode);
46− hpfs_inode->i_file_sec = btree->u.external[i].file_secno;
47− hpfs_inode->i_disk_sec = btree->u.external[i].disk_secno;
48− hpfs_inode->i_n_secs = btree->u.external[i].length;
46+ hpfs_inode->i_file_sec = le32_to_cpu(btree->u.external[i].file_secno);
47+ hpfs_inode->i_disk_sec = le32_to_cpu(btree->u.external[i].disk_secno);
48+ hpfs_inode->i_n_secs = le32_to_cpu(btree->u.external[i].length);
4949 }
5050 brelse(bh);
5151 return a;
@@ -83,8 +83,8 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi · 31 unmodified lines
8383 return -1;
8484 }
8585 if (btree->internal) {
86− a = btree->u.internal[n].down;
87− btree->u.internal[n].file_secno = -1;
86+ a = le32_to_cpu(btree->u.internal[n].down);
87+ btree->u.internal[n].file_secno = cpu_to_le32(-1);
8888 mark_buffer_dirty(bh);
8989 brelse(bh);
9090 if (hpfs_sb(s)->sb_chk)
@@ -94,15 +94,15 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi · 3 unmodified lines
9494 goto go_down;
9595 }
9696 if (n >= 0) {
97− if (btree->u.external[n].file_secno + btree->u.external[n].length != fsecno) {
97+ if (le32_to_cpu(btree->u.external[n].file_secno) + le32_to_cpu(btree->u.external[n].length) != fsecno) {
9898 hpfs_error(s, "allocated size %08x, trying to add sector %08x, %cnode %08x",
99− btree->u.external[n].file_secno + btree->u.external[n].length, fsecno,
99+ le32_to_cpu(btree->u.external[n].file_secno) + le32_to_cpu(btree->u.external[n].length), fsecno,
100100 fnod?'f':'a', node);
101101 brelse(bh);
102102 return -1;
103103 }
104− if (hpfs_alloc_if_possible(s, se = btree->u.external[n].disk_secno + btree->u.external[n].length)) {
105− btree->u.external[n].length++;
104+ if (hpfs_alloc_if_possible(s, se = le32_to_cpu(btree->u.external[n].disk_secno) + le32_to_cpu(btree->u.external[n].length))) {
105+ btree->u.external[n].length = cpu_to_le32(le32_to_cpu(btree->u.external[n].length) + 1);
106106 mark_buffer_dirty(bh);
107107 brelse(bh);
108108 return se;
@@ -115,20 +115,20 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi · 6 unmodified lines
115115 }
116116 se = !fnod ? node : (node + 16384) & ~16383;
117117 }
118− if (!(se = hpfs_alloc_sector(s, se, 1, fsecno*ALLOC_M>ALLOC_FWD_MAX ? ALLOC_FWD_MAX : fsecno*ALLOC_M<ALLOC_FWD_MIN ? ALLOC_FWD_MIN : fsecno*ALLOC_M, 1))) {
118+ if (!(se = hpfs_alloc_sector(s, se, 1, fsecno*ALLOC_M>ALLOC_FWD_MAX ? ALLOC_FWD_MAX : fsecno*ALLOC_M<ALLOC_FWD_MIN ? ALLOC_FWD_MIN : fsecno*ALLOC_M))) {
119119 brelse(bh);
120120 return -1;
121121 }
122− fs = n < 0 ? 0 : btree->u.external[n].file_secno + btree->u.external[n].length;
122+ fs = n < 0 ? 0 : le32_to_cpu(btree->u.external[n].file_secno) + le32_to_cpu(btree->u.external[n].length);
123123 if (!btree->n_free_nodes) {
124− up = a != node ? anode->up : -1;
124+ up = a != node ? le32_to_cpu(anode->up) : -1;
125125 if (!(anode = hpfs_alloc_anode(s, a, &na, &bh1))) {
126126 brelse(bh);
127127 hpfs_free_sectors(s, se, 1);
128128 return -1;
129129 }
130130 if (a == node && fnod) {
131− anode->up = node;
131+ anode->up = cpu_to_le32(node);
132132 anode->btree.fnode_parent = 1;
133133 anode->btree.n_used_nodes = btree->n_used_nodes;
134134 anode->btree.first_free = btree->first_free;
@@ -137,9 +137,9 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi · 2 unmodified lines
137137 btree->internal = 1;
138138 btree->n_free_nodes = 11;
139139 btree->n_used_nodes = 1;
140− btree->first_free = (char *)&(btree->u.internal[1]) - (char *)btree;
141− btree->u.internal[0].file_secno = -1;
142− btree->u.internal[0].down = na;
140+ btree->first_free = cpu_to_le16((char *)&(btree->u.internal[1]) - (char *)btree);
141+ btree->u.internal[0].file_secno = cpu_to_le32(-1);
142+ btree->u.internal[0].down = cpu_to_le32(na);
143143 mark_buffer_dirty(bh);
144144 } else if (!(ranode = hpfs_alloc_anode(s, /*a*/0, &ra, &bh2))) {
145145 brelse(bh);
@@ -153,15 +153,15 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi · 7 unmodified lines
153153 btree = &anode->btree;
154154 }
155155 btree->n_free_nodes--; n = btree->n_used_nodes++;
156− btree->first_free += 12;
157− btree->u.external[n].disk_secno = se;
158− btree->u.external[n].file_secno = fs;
159− btree->u.external[n].length = 1;
156+ btree->first_free = cpu_to_le16(le16_to_cpu(btree->first_free) + 12);
157+ btree->u.external[n].disk_secno = cpu_to_le32(se);
158+ btree->u.external[n].file_secno = cpu_to_le32(fs);
159+ btree->u.external[n].length = cpu_to_le32(1);
160160 mark_buffer_dirty(bh);
161161 brelse(bh);

225 more lines aren’t shown here.

fs/hpfs/buffer.c+8−16

This diff is large: its 59 lines aren’t shown here.

fs/hpfs/dir.c+10−12

This diff is large: its 73 lines aren’t shown here.

fs/hpfs/dnode.c+84−90

This diff is large: its 540 lines aren’t shown here.

fs/hpfs/ea.c+69−67

This diff is large: its 303 lines aren’t shown here.

fs/hpfs/file.c+21−10

This diff is large: its 78 lines aren’t shown here.

fs/hpfs/hpfs.h+257−182

This diff is large: its 602 lines aren’t shown here.

fs/hpfs/hpfs_fn.h+37−43

This diff is large: its 216 lines aren’t shown here.

fs/hpfs/inode.c+21−26

This diff is large: its 125 lines aren’t shown here.

fs/hpfs/map.c+30−26

This diff is large: its 159 lines aren’t shown here.

fs/hpfs/name.c+0−33

This diff is large: its 40 lines aren’t shown here.

fs/hpfs/namei.c+30−76

This diff is large: its 382 lines aren’t shown here.

fs/hpfs/super.c+51−67

This diff is large: its 358 lines aren’t shown here.

fs/logfs/super.c+4−4

This diff is large: its 22 lines aren’t shown here.

fs/namei.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/nfs/namespace.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/nfs/nfs4_fs.h+1−0

This diff is large: its 8 lines aren’t shown here.

fs/nfs/nfs4filelayout.c+16−11

This diff is large: its 97 lines aren’t shown here.

fs/nfs/nfs4filelayout.h+1−1

This diff is large: its 8 lines aren’t shown here.

fs/nfs/nfs4filelayoutdev.c+17−17

This diff is large: its 140 lines aren’t shown here.

fs/nfs/nfs4proc.c+64−60

This diff is large: its 254 lines aren’t shown here.

fs/nfs/nfs4state.c+34−17

This diff is large: its 107 lines aren’t shown here.

fs/nfs/nfs4xdr.c+28−25

This diff is large: its 125 lines aren’t shown here.

fs/nfs/pnfs.c+27−15

This diff is large: its 167 lines aren’t shown here.

fs/nfs/pnfs.h+3−3

This diff is large: its 27 lines aren’t shown here.

fs/nfs/read.c+2−2

This diff is large: its 18 lines aren’t shown here.

fs/nfs/super.c+11−2

This diff is large: its 34 lines aren’t shown here.

fs/nfs/write.c+3−5

This diff is large: its 36 lines aren’t shown here.

fs/nfsd/nfs4state.c+2−1

This diff is large: its 18 lines aren’t shown here.

fs/nfsd/vfs.c+8−1

This diff is large: its 23 lines aren’t shown here.

fs/nilfs2/alloc.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/ocfs2/cluster/heartbeat.c+43−18

This diff is large: its 104 lines aren’t shown here.

fs/ocfs2/dir.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/ocfs2/dlm/dlmdomain.c+2−1

This diff is large: its 10 lines aren’t shown here.

fs/ocfs2/dlm/dlmmaster.c+3−0

This diff is large: its 10 lines aren’t shown here.

fs/ocfs2/file.c+12−0

This diff is large: its 27 lines aren’t shown here.

fs/ocfs2/journal.c+3−0

This diff is large: its 10 lines aren’t shown here.

fs/ocfs2/ocfs2_fs.h+1−1

This diff is large: its 9 lines aren’t shown here.

fs/partitions/efi.c+6−0

This diff is large: its 13 lines aren’t shown here.

fs/proc/task_mmu.c+7−5

This diff is large: its 29 lines aren’t shown here.

fs/ubifs/log.c+0−20

This diff is large: its 27 lines aren’t shown here.

fs/ubifs/recovery.c+26−0

This diff is large: its 33 lines aren’t shown here.

fs/ubifs/replay.c+12−6

This diff is large: its 72 lines aren’t shown here.

fs/ubifs/super.c+25−19

This diff is large: its 85 lines aren’t shown here.

fs/xattr.c+1−1

This diff is large: its 9 lines aren’t shown here.

fs/xfs/linux-2.6/xfs_message.c+3−1

This diff is large: its 12 lines aren’t shown here.

fs/xfs/linux-2.6/xfs_sync.c+1−0

This diff is large: its 8 lines aren’t shown here.

fs/xfs/xfs_trans_ail.c+26−21

This diff is large: its 95 lines aren’t shown here.

include/drm/drm_fb_helper.h+2−1

This diff is large: its 17 lines aren’t shown here.

include/drm/drm_mm.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/drm/drm_pciids.h+5−0

This diff is large: its 34 lines aren’t shown here.

include/drm/radeon_drm.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/bit_spinlock.h+4−4

This diff is large: its 16 lines aren’t shown here.

include/linux/blkdev.h+13−13

This diff is large: its 41 lines aren’t shown here.

include/linux/bootmem.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/capability.h+1−12

This diff is large: its 20 lines aren’t shown here.

include/linux/cred.h+8−2

This diff is large: its 26 lines aren’t shown here.

include/linux/dcache.h+2−2

This diff is large: its 18 lines aren’t shown here.

include/linux/device.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/linux/fb.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/flex_array.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/fs.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/linux/ftrace_event.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/gfp.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/huge_mm.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/libata.h+1−2

This diff is large: its 17 lines aren’t shown here.

include/linux/list_bl.h+11−0

This diff is large: its 25 lines aren’t shown here.

include/linux/mfd/wm831x/pdata.h+2−0

This diff is large: its 10 lines aren’t shown here.

include/linux/mm.h+25−2

This diff is large: its 45 lines aren’t shown here.

include/linux/nfs_fs_sb.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/nfs_xdr.h+3−0

This diff is large: its 24 lines aren’t shown here.

include/linux/of_device.h+6−2

This diff is large: its 22 lines aren’t shown here.

include/linux/pci_ids.h+0−4

This diff is large: its 24 lines aren’t shown here.

include/linux/percpu.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/posix-clock.h+3−2

This diff is large: its 26 lines aren’t shown here.

include/linux/proc_fs.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/ptrace.h+12−1

This diff is large: its 26 lines aren’t shown here.

include/linux/sched.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/linux/security.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/sunrpc/sched.h+4−1

This diff is large: its 18 lines aren’t shown here.

include/linux/usb/usbnet.h+3−2

This diff is large: its 19 lines aren’t shown here.

include/linux/v4l2-mediabus.h+5−2

This diff is large: its 30 lines aren’t shown here.

include/linux/videodev2.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/media/v4l2-device.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/inet_ecn.h+13−3

This diff is large: its 23 lines aren’t shown here.

include/net/ip_vs.h+17−0

This diff is large: its 31 lines aren’t shown here.

include/net/llc_pdu.h+4−4

This diff is large: its 36 lines aren’t shown here.

include/net/xfrm.h+3−0

This diff is large: its 24 lines aren’t shown here.

include/scsi/scsi_device.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/trace/events/gfpflags.h+5−1

This diff is large: its 19 lines aren’t shown here.

init/Kconfig+8−8

This diff is large: its 30 lines aren’t shown here.

kernel/capability.c+12−0

This diff is large: its 16 lines aren’t shown here.

kernel/cred.c+6−6

This diff is large: its 33 lines aren’t shown here.

kernel/exit.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/hrtimer.c+5−5

This diff is large: its 24 lines aren’t shown here.

kernel/irq/proc.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/kexec.c+7−0

This diff is large: its 28 lines aren’t shown here.

kernel/power/hibernate.c+8−2

This diff is large: its 26 lines aren’t shown here.

kernel/power/suspend.c+6−3

This diff is large: its 39 lines aren’t shown here.

kernel/power/user.c+4−1

This diff is large: its 20 lines aren’t shown here.

kernel/ptrace.c+17−0

This diff is large: its 28 lines aren’t shown here.

kernel/time/clocksource.c+2−2

This diff is large: its 20 lines aren’t shown here.

kernel/time/posix-clock.c+9−15

This diff is large: its 89 lines aren’t shown here.

kernel/time/tick-broadcast.c+11−1

This diff is large: its 29 lines aren’t shown here.

kernel/trace/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/trace/trace.c+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/trace/trace_events.c+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/watchdog.c+4−1

This diff is large: its 14 lines aren’t shown here.

kernel/workqueue.c+7−1

This diff is large: its 16 lines aren’t shown here.

lib/flex_array.c+18−6

This diff is large: its 51 lines aren’t shown here.

lib/vsprintf.c+1−1

This diff is large: its 9 lines aren’t shown here.

lib/xz/xz_dec_lzma2.c+3−3

This diff is large: its 20 lines aren’t shown here.

mm/huge_memory.c+24−19

This diff is large: its 93 lines aren’t shown here.

mm/memory.c+9−12

This diff is large: its 56 lines aren’t shown here.

mm/mlock.c+1−4

This diff is large: its 19 lines aren’t shown here.

mm/mmap.c+7−4

This diff is large: its 18 lines aren’t shown here.

mm/oom_kill.c+6−3

This diff is large: its 17 lines aren’t shown here.

mm/page_alloc.c+42−15

This diff is large: its 95 lines aren’t shown here.

mm/page_cgroup.c+1−1

This diff is large: its 9 lines aren’t shown here.

mm/shmem.c+83−66

This diff is large: its 257 lines aren’t shown here.

mm/slub.c+2−2

This diff is large: its 18 lines aren’t shown here.

mm/swap.c+3−0

This diff is large: its 10 lines aren’t shown here.

mm/vmscan.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/8021q/vlan.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/8021q/vlan_dev.c+0−3

This diff is large: its 10 lines aren’t shown here.

net/9p/client.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/9p/protocol.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/9p/trans_common.c+3−8

This diff is large: its 26 lines aren’t shown here.

net/bluetooth/hci_core.c+2−3

This diff is large: its 20 lines aren’t shown here.

net/bluetooth/hci_event.c+0−2

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/l2cap_core.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/bridge/br_input.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bridge/br_netfilter.c+3−5

This diff is large: its 23 lines aren’t shown here.

net/bridge/netfilter/ebtables.c+11−53

This diff is large: its 106 lines aren’t shown here.

net/caif/cfdgml.c+5−1

This diff is large: its 27 lines aren’t shown here.

net/caif/cfmuxl.c+2−2

This diff is large: its 12 lines aren’t shown here.

net/can/bcm.c+6−1

This diff is large: its 16 lines aren’t shown here.

net/can/raw.c+6−1

This diff is large: its 14 lines aren’t shown here.

net/ceph/messenger.c+13−13

This diff is large: its 40 lines aren’t shown here.

net/ceph/osd_client.c+2−2

This diff is large: its 11 lines aren’t shown here.

net/core/dev.c+23−23

This diff is large: its 120 lines aren’t shown here.

net/dccp/options.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/dsa/Kconfig+2−2

This diff is large: its 15 lines aren’t shown here.

net/dsa/mv88e6131.c+21−5

This diff is large: its 41 lines aren’t shown here.

net/ieee802154/Makefile+0−2

This diff is large: its 6 lines aren’t shown here.

net/ipv4/devinet.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/fib_trie.c+0−3

This diff is large: its 10 lines aren’t shown here.

net/ipv4/inet_connection_sock.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/ipv4/inetpeer.c+7−6

This diff is large: its 62 lines aren’t shown here.

net/ipv4/ip_fragment.c+15−16

This diff is large: its 47 lines aren’t shown here.

net/ipv4/ip_options.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/ipv4/route.c+7−0

This diff is large: its 21 lines aren’t shown here.

net/ipv4/sysctl_net_ipv4.c+0−3

This diff is large: its 17 lines aren’t shown here.

net/ipv4/tcp_cubic.c+7−2

This diff is large: its 23 lines aren’t shown here.

net/ipv4/xfrm4_output.c+6−2

This diff is large: its 22 lines aren’t shown here.

net/ipv4/xfrm4_state.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv6/addrconf.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/esp6.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/inet6_connection_sock.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/netfilter/ip6t_REJECT.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/ipv6/route.c+7−1

This diff is large: its 29 lines aren’t shown here.

net/ipv6/udp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/xfrm6_output.c+3−3

This diff is large: its 21 lines aren’t shown here.

net/ipv6/xfrm6_state.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/irda/af_irda.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/l2tp/l2tp_ip.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/llc/llc_input.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/mac80211/cfg.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/mac80211/debugfs_netdev.c+2−2

This diff is large: its 12 lines aren’t shown here.

net/mac80211/tx.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netfilter/ipset/ip_set_bitmap_ipmac.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netfilter/ipset/ip_set_core.c+10−8

This diff is large: its 47 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_app.c+4−13

This diff is large: its 43 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_conn.c+4−12

This diff is large: its 61 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_core.c+93−10

This diff is large: its 227 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_ctl.c+104−22

This diff is large: its 218 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_est.c+3−11

This diff is large: its 36 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto.c+2−9

This diff is large: its 46 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_sync.c+37−28

This diff is large: its 169 lines aren’t shown here.

net/netfilter/nf_conntrack_netlink.c+4−0

This diff is large: its 18 lines aren’t shown here.

net/netfilter/x_tables.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/netfilter/xt_DSCP.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/xt_conntrack.c+0−5

This diff is large: its 12 lines aren’t shown here.

net/netfilter/xt_set.c+16−2

This diff is large: its 66 lines aren’t shown here.

net/sctp/associola.c+4−0

This diff is large: its 18 lines aren’t shown here.

net/sctp/ulpevent.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sunrpc/Kconfig+4−5

This diff is large: its 19 lines aren’t shown here.

net/sunrpc/auth_gss/auth_gss.c+5−3

This diff is large: its 24 lines aren’t shown here.

net/sunrpc/clnt.c+4−1

This diff is large: its 12 lines aren’t shown here.

net/sunrpc/xprt.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/unix/af_unix.c+15−1

This diff is large: its 37 lines aren’t shown here.

net/xfrm/xfrm_policy.c+13−1

This diff is large: its 35 lines aren’t shown here.

net/xfrm/xfrm_replay.c+4−1

This diff is large: its 14 lines aren’t shown here.

net/xfrm/xfrm_user.c+3−0

This diff is large: its 10 lines aren’t shown here.

scripts/kconfig/conf.c+1−1

This diff is large: its 9 lines aren’t shown here.

security/capability.c+1−1

This diff is large: its 9 lines aren’t shown here.

security/security.c+2−4

This diff is large: its 19 lines aren’t shown here.

security/selinux/avc.c+29−7

This diff is large: its 87 lines aren’t shown here.

security/selinux/hooks.c+16−11

This diff is large: its 97 lines aren’t shown here.

security/selinux/include/avc.h+13−5

This diff is large: its 35 lines aren’t shown here.

security/selinux/ss/policydb.c+3−7

This diff is large: its 45 lines aren’t shown here.

security/smack/smack_lsm.c+5−1

This diff is large: its 20 lines aren’t shown here.

sound/aoa/codecs/tas.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/pci/au88x0/au88x0_pcm.c+5−2

This diff is large: its 23 lines aren’t shown here.

sound/pci/hda/hda_codec.c+4−0

This diff is large: its 32 lines aren’t shown here.

sound/pci/hda/patch_realtek.c+35−20

This diff is large: its 156 lines aren’t shown here.

sound/pci/hda/patch_via.c+7−3

This diff is large: its 22 lines aren’t shown here.

sound/soc/codecs/jz4740.c+0−2

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/sn95031.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/codecs/ssm2602.c+5−5

This diff is large: its 45 lines aren’t shown here.

sound/soc/codecs/uda134x.c+0−2

This diff is large: its 10 lines aren’t shown here.

sound/soc/codecs/wm8903.c+24−16

This diff is large: its 87 lines aren’t shown here.

sound/soc/codecs/wm8994.c+16−0

This diff is large: its 37 lines aren’t shown here.

sound/soc/codecs/wm_hubs.c+4−4

This diff is large: its 26 lines aren’t shown here.

sound/soc/davinci/davinci-mcasp.c+12−7

This diff is large: its 54 lines aren’t shown here.

sound/soc/jz4740/jz4740-i2s.c+1−1

This diff is large: its 9 lines aren’t shown here.

sound/soc/mid-x86/sst_platform.c+12−4

This diff is large: its 45 lines aren’t shown here.

sound/soc/samsung/goni_wm8994.c+4−4

This diff is large: its 23 lines aren’t shown here.

sound/soc/samsung/pcm.c+2−2

This diff is large: its 11 lines aren’t shown here.

sound/soc/sh/fsi.c+16−6

This diff is large: its 53 lines aren’t shown here.

sound/soc/soc-core.c+6−1

This diff is large: its 35 lines aren’t shown here.

sound/soc/tegra/harmony.c+1−0

This diff is large: its 8 lines aren’t shown here.

sound/usb/format.c+3−1

This diff is large: its 13 lines aren’t shown here.

sound/usb/quirks.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/perf/Makefile+10−6

This diff is large: its 35 lines aren’t shown here.

tools/perf/builtin-record.c+6−3

This diff is large: its 37 lines aren’t shown here.

tools/perf/builtin-stat.c+4−3

This diff is large: its 21 lines aren’t shown here.

tools/perf/builtin-test.c+6−6

This diff is large: its 54 lines aren’t shown here.

tools/perf/builtin-top.c+6−5

This diff is large: its 38 lines aren’t shown here.

tools/perf/util/evlist.c+112−45

This diff is large: its 231 lines aren’t shown here.

tools/perf/util/evlist.h+2−1

This diff is large: its 17 lines aren’t shown here.

tools/perf/util/evsel.c+7−20

This diff is large: its 63 lines aren’t shown here.

tools/perf/util/evsel.h+3−3

This diff is large: its 15 lines aren’t shown here.

tools/perf/util/python.c+6−5

This diff is large: its 34 lines aren’t shown here.

tools/perf/util/ui/browsers/annotate.c+4−2

This diff is large: its 29 lines aren’t shown here.

tools/perf/util/ui/browsers/hists.c+1−1

This diff is large: its 9 lines aren’t shown here.

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