History

Merge branch 'perf/urgent' into perf/core

Conflicts: tools/perf/builtin-record.c tools/perf/builtin-top.c tools/perf/perf.h tools/perf/util/top.h Merge reason: resolve these cherry-picking conflicts.

Ingo Molnar committed 14 years ago

Commit 737f24b2 parents 8eedce9 b7c9242920 files · +7205 −46120Browse files

Unified · Split

920 files
  1. Documentation/input/event-codes.txt +64 −8
  2. Documentation/sysctl/kernel.txt +2 −0
  3. MAINTAINERS +16 −24
  4. Makefile +1 −1
  5. arch/arm/boot/dts/exynos4210.dtsi +1 −0
  6. arch/arm/boot/dts/tegra-paz00.dts +3 −3
  7. arch/arm/common/it8152.c +0 −7
  8. arch/arm/common/pl330.c +2 −1
  9. arch/arm/include/asm/assembler.h +5 −0
  10. arch/arm/include/asm/hardware/pl330.h +1 −1
  11. arch/arm/include/asm/processor.h +1 −0
  12. arch/arm/include/asm/tlb.h +9 −1
  13. arch/arm/kernel/entry-armv.S +1 −1
  14. arch/arm/kernel/perf_event_v7.c +28 −0
  15. arch/arm/kernel/ptrace.c +13 −4
  16. arch/arm/kernel/signal.c +2 −3
  17. arch/arm/kernel/smp_twd.c +1 −1
  18. arch/arm/kernel/traps.c +4 −1
  19. arch/arm/kernel/vmlinux.lds.S +1 −0
  20. arch/arm/mach-at91/at91rm9200_devices.c +1 −1
  21. arch/arm/mach-at91/at91sam9260_devices.c +3 −6
  22. arch/arm/mach-at91/at91sam9261_devices.c +1 −1
  23. arch/arm/mach-at91/at91sam9263_devices.c +4 −4
  24. arch/arm/mach-at91/include/mach/at91sam9_smc.h +29 −0
  25. arch/arm/mach-at91/sam9_smc.c +71 −5
  26. arch/arm/mach-at91/sam9_smc.h +0 −23
  27. arch/arm/mach-bcmring/arch.c +1 −1
  28. arch/arm/mach-bcmring/dma.c +0 −812
  29. arch/arm/mach-bcmring/include/mach/dma.h +0 −196
  30. arch/arm/mach-davinci/board-da850-evm.c +1 −1
  31. arch/arm/mach-davinci/board-dm365-evm.c +1 −1
  32. arch/arm/mach-davinci/board-dm644x-evm.c +1 −1
  33. arch/arm/mach-davinci/board-dm646x-evm.c +1 −1
  34. arch/arm/mach-davinci/board-neuros-osd2.c +1 −1
  35. arch/arm/mach-davinci/board-omapl138-hawk.c +1 −1
  36. arch/arm/mach-davinci/board-sffsdr.c +1 −1
  37. arch/arm/mach-davinci/da850.c +0 −32
  38. arch/arm/mach-dove/common.c +2 −1
  39. arch/arm/mach-ep93xx/vision_ep9307.c +3 −1
  40. arch/arm/mach-exynos/clock-exynos4210.c +2 −0
  41. arch/arm/mach-exynos/clock-exynos4212.c +2 −0
  42. arch/arm/mach-exynos/clock.c +2 −0
  43. arch/arm/mach-exynos/mach-exynos4-dt.c +6 −2
  44. arch/arm/mach-exynos/mach-nuri.c +4 −4
  45. arch/arm/mach-exynos/mach-universal_c210.c +1 −1
  46. arch/arm/mach-exynos/pm.c +3 −1
  47. arch/arm/mach-kirkwood/common.c +2 −1
  48. arch/arm/mach-kirkwood/mpp.h +160 −160
  49. arch/arm/mach-mv78xx0/common.c +2 −1
  50. arch/arm/mach-mv78xx0/mpp.h +113 −113
  51. arch/arm/mach-omap2/Kconfig +5 −6
  52. arch/arm/mach-omap2/Makefile +2 −2
  53. arch/arm/mach-omap2/board-4430sdp.c +25 −10
  54. arch/arm/mach-omap2/board-cm-t35.c +1 −1
  55. arch/arm/mach-omap2/board-generic.c +4 −0
  56. arch/arm/mach-omap2/board-omap3evm.c +16 −7
  57. arch/arm/mach-omap2/board-omap4panda.c +18 −6
  58. arch/arm/mach-omap2/board-zoom-peripherals.c +4 −2
  59. arch/arm/mach-omap2/devices.c +1 −0
  60. arch/arm/mach-omap2/display.c +0 −4
  61. arch/arm/mach-omap2/gpmc.c +6 −0
  62. arch/arm/mach-omap2/hsmmc.c +12 −12
  63. arch/arm/mach-omap2/io.c +3 −1
  64. arch/arm/mach-omap2/mux.c +11 −11
  65. arch/arm/mach-omap2/omap-headsmp.S +1 −0
  66. arch/arm/mach-omap2/omap_hwmod.c +8 −8
  67. arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c +0 −21
  68. arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c +22 −0
  69. arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +47 −7
  70. arch/arm/mach-omap2/omap_hwmod_44xx_data.c +2 −0
  71. arch/arm/mach-omap2/pm24xx.c +1 −7
  72. arch/arm/mach-omap2/prm2xxx_3xxx.c +1 −0
  73. arch/arm/mach-omap2/prm44xx.c +1 −0
  74. arch/arm/mach-omap2/serial.c +4 −4
  75. arch/arm/mach-omap2/smartreflex.c +1 −1
  76. arch/arm/mach-omap2/timer.c +1 −1
  77. arch/arm/mach-omap2/vc.c +4 −6
  78. arch/arm/mach-omap2/voltagedomains3xxx_data.c +2 −0
  79. arch/arm/mach-omap2/voltagedomains44xx_data.c +2 −0
  80. arch/arm/mach-omap2/vp.c +5 −0
  81. arch/arm/mach-orion5x/common.c +3 −1
  82. arch/arm/mach-s3c2410/cpu-freq.c +5 −3
  83. arch/arm/mach-s3c2410/dma.c +3 −2
  84. arch/arm/mach-s3c2410/pll.c +1 −1
  85. arch/arm/mach-s3c2410/pm.c +1 −1
  86. arch/arm/mach-s3c2412/cpu-freq.c +2 −1
  87. arch/arm/mach-s3c2412/dma.c +2 −1
  88. arch/arm/mach-s3c2412/irq.c +1 −1
  89. arch/arm/mach-s3c2412/pm.c +1 −1
  90. arch/arm/mach-s3c2416/irq.c +2 −1
  91. arch/arm/mach-s3c2416/pm.c +1 −1
  92. arch/arm/mach-s3c2440/clock.c +1 −1
  93. arch/arm/mach-s3c2440/dma.c +2 −1
  94. arch/arm/mach-s3c2440/irq.c +1 −1
  95. arch/arm/mach-s3c2440/s3c2440-cpufreq.c +2 −1
  96. arch/arm/mach-s3c2440/s3c2440-pll-12000000.c +1 −1
  97. arch/arm/mach-s3c2440/s3c2440-pll-16934400.c +2 −1
  98. arch/arm/mach-s3c2440/s3c2442.c +1 −1
  99. arch/arm/mach-s3c2440/s3c244x-clock.c +1 −1
  100. arch/arm/mach-s3c2440/s3c244x-irq.c +1 −1
  101. arch/arm/mach-s3c2443/dma.c +2 −1
  102. arch/arm/mach-s3c2443/irq.c +2 −1
  103. arch/arm/mach-s3c64xx/clock.c +5 −0
  104. arch/arm/mach-s3c64xx/common.c +1 −1
  105. arch/arm/mach-s5p64x0/pm.c +1 −1
  106. arch/arm/mach-s5pv210/clock.c +2 −2
  107. arch/arm/mach-s5pv210/pm.c +1 −1
  108. arch/arm/mach-shmobile/board-ag5evm.c +15 −14
  109. arch/arm/mach-shmobile/board-ap4evb.c +2 −10
  110. arch/arm/mach-shmobile/board-kota2.c +1 −2
  111. arch/arm/mach-shmobile/board-mackerel.c +21 −74
  112. arch/arm/mach-shmobile/clock-sh73a0.c +113 −0
  113. arch/arm/mach-shmobile/include/mach/sh73a0.h +3 −3
  114. arch/arm/mach-shmobile/intc-sh73a0.c +2 −0
  115. arch/arm/mach-shmobile/pfc-r8a7779.c +1 −1
  116. arch/arm/mach-shmobile/pfc-sh7372.c +41 −0
  117. arch/arm/mach-shmobile/setup-sh7372.c +2 −0
  118. arch/arm/mach-shmobile/smp-sh73a0.c +1 −1
  119. arch/arm/mach-tegra/board-paz00.c +4 −4
  120. arch/arm/mach-tegra/board-paz00.h +1 −1
  121. arch/arm/mach-tegra/include/mach/dma.h +5 −5
  122. arch/arm/mm/Kconfig +2 −1
  123. arch/arm/mm/cache-v7.S +6 −0
  124. arch/arm/mm/ioremap.c +1 −2
  125. arch/arm/plat-omap/include/plat/omap-secure.h +1 −1
  126. arch/arm/plat-orion/common.c +4 −5
  127. arch/arm/plat-orion/include/plat/common.h +2 −1
  128. arch/arm/plat-orion/mpp.c +1 −2
  129. arch/arm/plat-samsung/devs.c +3 −1
  130. arch/avr32/Kconfig +1 −0
  131. arch/c6x/boot/Makefile +1 −1
  132. arch/m68k/include/asm/mcf_pgtable.h +2 −1
  133. arch/m68k/mm/mcfmmu.c +5 −4
  134. arch/m68k/platform/coldfire/entry.S +1 −3
  135. arch/mips/Kconfig +1 −0
  136. arch/mips/lib/iomap-pci.c +2 −2
  137. arch/powerpc/configs/ppc64_defconfig +0 −5
  138. arch/powerpc/include/asm/ppc-pci.h +5 −0
  139. arch/powerpc/include/asm/ptrace.h +12 −8
  140. arch/powerpc/kernel/entry_32.S +1 −1
  141. arch/powerpc/kernel/entry_64.S +5 −1
  142. arch/powerpc/kernel/exceptions-64s.S +1 −1
  143. arch/powerpc/kernel/irq.c +5 −1
  144. arch/powerpc/kernel/perf_event.c +7 −1
  145. arch/powerpc/kernel/process.c +3 −3
  146. arch/powerpc/kernel/rtas.c +3 −2
  147. arch/powerpc/kernel/signal.c +8 −4
  148. arch/powerpc/kernel/signal.h +1 −1
  149. arch/powerpc/platforms/powernv/pci.c +14 −8
  150. arch/powerpc/platforms/pseries/eeh.c +2 −2
  151. arch/powerpc/platforms/pseries/suspend.c +5 −1
  152. arch/powerpc/platforms/wsp/ics.c +1 −1
  153. arch/powerpc/platforms/wsp/smp.c +1 −1
  154. arch/powerpc/platforms/wsp/wsp_pci.c +4 −4
  155. arch/powerpc/sysdev/fsl_pci.c +29 −19
  156. arch/s390/include/asm/compat.h +0 −7
  157. arch/s390/kernel/compat_wrapper.S +1 −1
  158. arch/s390/kernel/process.c +3 −3
  159. arch/s390/kernel/ptrace.c +1 −1
  160. arch/s390/kernel/setup.c +1 −1
  161. arch/s390/kernel/signal.c +0 −1
  162. arch/s390/kernel/time.c +5 −2
  163. arch/s390/mm/fault.c +0 −1
  164. arch/s390/mm/mmap.c +1 −1
  165. arch/s390/mm/pgtable.c +1 −1
  166. arch/sh/Kconfig +1 −0
  167. arch/sh/boards/board-sh7757lcr.c +9 −11
  168. arch/sh/boards/mach-ap325rxa/setup.c +1 −0
  169. arch/sh/boards/mach-ecovec24/setup.c +2 −0
  170. arch/sh/boards/mach-kfr2r09/setup.c +1 −0
  171. arch/sh/boards/mach-migor/setup.c +2 −0
  172. arch/sh/boards/mach-se/7724/setup.c +1 −0
  173. arch/sh/drivers/pci/pci-sh7780.c +1 −1
  174. arch/sh/drivers/pci/pci.c +2 −2
  175. arch/sh/include/asm/device.h +4 −4
  176. arch/sh/kernel/cpu/sh4a/clock-sh7724.c +1 −1
  177. arch/sh/kernel/cpu/sh4a/setup-sh7757.c +21 −1
  178. arch/sh/kernel/smp.c +1 −1
  179. arch/sh/kernel/topology.c +1 −1
  180. arch/sh/mm/cache-sh2a.c +2 −0
  181. arch/x86/include/asm/i387.h +252 −55
  182. arch/x86/include/asm/kvm_emulate.h +16 −0
  183. arch/x86/include/asm/perf_event.h +8 −0
  184. arch/x86/include/asm/processor.h +2 −0
  185. arch/x86/include/asm/thread_info.h +0 −2
  186. arch/x86/kernel/cpu/common.c +5 −0
  187. arch/x86/kernel/cpu/intel_cacheinfo.c +36 −8
  188. arch/x86/kernel/cpu/mcheck/mce_amd.c +2 −0
  189. arch/x86/kernel/cpu/perf_event.c +3 −0
  190. arch/x86/kernel/cpu/perf_event.h +6 −2
  191. arch/x86/kernel/cpu/perf_event_amd.c +35 −2
  192. arch/x86/kernel/entry_64.S +8 −1
  193. arch/x86/kernel/microcode_amd.c +0 −1
  194. arch/x86/kernel/process_32.c +5 −21
  195. arch/x86/kernel/process_64.c +5 −25
  196. arch/x86/kernel/traps.c +14 −29
  197. arch/x86/kernel/xsave.c +4 −8
  198. arch/x86/kvm/emulate.c +51 −0
  199. arch/x86/kvm/svm.c +5 −0
  200. arch/x86/kvm/vmx.c +1 −1
  201. arch/x86/kvm/x86.c +45 −0
  202. arch/x86/pci/xen.c +1 −1
  203. arch/x86/xen/enlighten.c +2 −4
  204. arch/x86/xen/mmu.c +4 −4
  205. arch/x86/xen/smp.c +7 −0
  206. arch/xtensa/include/asm/string.h +0 −3
  207. block/blk-cgroup.c +1 −1
  208. block/blk-core.c +17 −16
  209. block/blk-ioc.c +25 −86
  210. block/blk-merge.c +37 −0
  211. block/blk.h +2 −0
  212. block/bsg.c +2 −1
  213. block/cfq-iosched.c +9 −15
  214. block/elevator.c +4 −51
  215. block/partitions/ldm.c +4 −7
  216. crypto/sha512_generic.c +37 −46
  217. drivers/acpi/processor_driver.c +0 −7
  218. drivers/ata/pata_at91.c +21 −27
  219. drivers/atm/solos-pci.c +2 −2
  220. drivers/base/cpu.c +21 −0
  221. drivers/base/memory.c +26 −5
  222. drivers/base/node.c +8 −0
  223. drivers/base/regmap/regcache.c +2 −2
  224. drivers/bcma/main.c +1 −3
  225. drivers/bcma/scan.c +11 −8
  226. drivers/block/floppy.c +16 −1
  227. drivers/block/loop.c +13 −11
  228. drivers/block/mtip32xx/mtip32xx.c +5 −6
  229. drivers/block/mtip32xx/mtip32xx.h +0 −5
  230. drivers/block/nvme.c +2 −0
  231. drivers/bluetooth/btusb.c +1 −3
  232. drivers/cdrom/cdrom.c +6 −14
  233. drivers/cpuidle/Kconfig +1 −1
  234. drivers/dma/at_hdmac.c +2 −2
  235. drivers/dma/at_hdmac_regs.h +8 −9
  236. drivers/dma/dmatest.c +1 −1
  237. drivers/dma/imx-sdma.c +4 −2
  238. drivers/dma/shdma.c +2 −1
  239. drivers/edac/i3200_edac.c +2 −13
  240. drivers/gpio/gpio-lpc32xx.c +1 −1
  241. drivers/gpio/gpio-ml-ioh.c +1 −0
  242. drivers/gpio/gpio-pch.c +1 −0
  243. drivers/gpio/gpio-samsung.c +13 −10
  244. drivers/gpu/drm/drm_ioc32.c +2 −1
  245. drivers/gpu/drm/exynos/exynos_drm_core.c +3 −0
  246. drivers/gpu/drm/exynos/exynos_drm_crtc.c +3 −3
  247. drivers/gpu/drm/exynos/exynos_drm_drv.c +18 −8
  248. drivers/gpu/drm/exynos/exynos_drm_encoder.c +34 −0
  249. drivers/gpu/drm/exynos/exynos_drm_encoder.h +1 −0
  250. drivers/gpu/drm/exynos/exynos_drm_fbdev.c +4 −66
  251. drivers/gpu/drm/exynos/exynos_drm_fimd.c +6 −1
  252. drivers/gpu/drm/exynos/exynos_mixer.c +12 −7
  253. drivers/gpu/drm/i915/i915_reg.h +15 −0
  254. drivers/gpu/drm/i915/intel_display.c +27 −5
  255. drivers/gpu/drm/i915/intel_dp.c +5 −15
  256. drivers/gpu/drm/i915/intel_lvds.c +8 −0
  257. drivers/gpu/drm/radeon/evergreen.c +2 −0
  258. drivers/gpu/drm/radeon/ni.c +1 −0
  259. drivers/gpu/drm/radeon/r100.c +8 −4
  260. drivers/gpu/drm/radeon/r300.c +7 −1
  261. drivers/gpu/drm/radeon/r420.c +7 −1
  262. drivers/gpu/drm/radeon/r520.c +7 −1
  263. drivers/gpu/drm/radeon/r600.c +1 −0
  264. drivers/gpu/drm/radeon/radeon_atombios.c +20 −0
  265. drivers/gpu/drm/radeon/radeon_cs.c +4 −0
  266. drivers/gpu/drm/radeon/radeon_fence.c +3 −1
  267. drivers/gpu/drm/radeon/radeon_ring.c +5 −2
  268. drivers/gpu/drm/radeon/rs400.c +7 −1
  269. drivers/gpu/drm/radeon/rs600.c +8 −4
  270. drivers/gpu/drm/radeon/rs690.c +7 −1
  271. drivers/gpu/drm/radeon/rv515.c +7 −1
  272. drivers/gpu/drm/radeon/rv770.c +1 −0
  273. drivers/hid/hid-hyperv.c +1 −0
  274. drivers/hid/hid-wacom.c +4 −3
  275. drivers/hid/hid-wiimote-core.c +2 −2
  276. drivers/hid/usbhid/hiddev.c +2 −2
  277. drivers/hwmon/ads1015.c +1 −2
  278. drivers/hwmon/f75375s.c +8 −10
  279. drivers/hwmon/max6639.c +12 −10
  280. drivers/hwmon/pmbus/max34440.c +1 −1
  281. drivers/hwmon/w83627ehf.c +20 −8
  282. drivers/i2c/busses/i2c-omap.c +1 −1
  283. drivers/i2c/busses/i2c-tegra.c +1 −1
  284. drivers/ide/Makefile +0 −1
  285. drivers/ide/at91_ide.c +0 −366
  286. drivers/infiniband/ulp/ipoib/ipoib.h +4 −2
  287. drivers/infiniband/ulp/ipoib/ipoib_main.c +19 −36
  288. drivers/infiniband/ulp/ipoib/ipoib_multicast.c +1 −9
  289. drivers/infiniband/ulp/srpt/ib_srpt.c +7 −10
  290. drivers/infiniband/ulp/srpt/ib_srpt.h +0 −1
  291. drivers/input/evdev.c +1 −1
  292. drivers/input/keyboard/twl4030_keypad.c +1 −3
  293. drivers/input/serio/i8042-x86ia64io.h +7 −0
  294. drivers/input/serio/serio_raw.c +9 −6
  295. drivers/iommu/amd_iommu.c +3 −0
  296. drivers/iommu/msm_iommu.c +1 −6
  297. drivers/isdn/i4l/isdn_net.c +1 −1
  298. drivers/leds/leds-lm3530.c +2 −2
  299. drivers/macintosh/adb.c +2 −2
  300. drivers/md/dm-raid.c +9 −3
  301. drivers/md/md.c +3 −2
  302. drivers/media/radio/wl128x/Kconfig +2 −2
  303. drivers/media/rc/imon.c +22 −4
  304. drivers/media/video/hdpvr/hdpvr-core.c +15 −3
  305. drivers/media/video/hdpvr/hdpvr-video.c +33 −13
  306. drivers/media/video/hdpvr/hdpvr.h +1 −0
  307. drivers/media/video/omap3isp/ispccdc.c +1 −1
  308. drivers/mfd/Kconfig +1 −1
  309. drivers/mfd/twl-core.c +4 −2
  310. drivers/mfd/twl4030-power.c +10 −10
  311. drivers/mfd/twl6040-core.c +77 −51
  312. drivers/misc/Kconfig +3 −14
  313. drivers/misc/c2port/c2port-duramar2150.c +1 −0
  314. drivers/misc/cb710/core.c +1 −0
  315. drivers/misc/cs5535-mfgpt.c +1 −1
  316. drivers/misc/lkdtm.c +5 −1
  317. drivers/misc/vmw_balloon.c +7 −7
  318. drivers/mmc/card/block.c +1 −0
  319. drivers/mmc/core/core.c +39 −10
  320. drivers/mmc/core/host.h +0 −21
  321. drivers/mmc/core/mmc.c +17 −9
  322. drivers/mmc/core/sd.c +18 −4
  323. drivers/mmc/core/sdio.c +4 −3
  324. drivers/mmc/core/sdio_irq.c +8 −2
  325. drivers/mmc/host/Kconfig +0 −1
  326. drivers/mmc/host/atmel-mci.c +3 −0
  327. drivers/mmc/host/dw_mmc.c +75 −69
  328. drivers/mmc/host/of_mmc_spi.c +2 −2
  329. drivers/mmc/host/sdhci-of-esdhc.c +32 −0
  330. drivers/mmc/host/sdhci-pci.c +1 −1
  331. drivers/mmc/host/sdhci-pltfm.c +9 −1
  332. drivers/mmc/host/sh_mmcif.c +9 −7
  333. drivers/mmc/host/tmio_mmc.h +6 −1
  334. drivers/mmc/host/tmio_mmc_dma.c +12 −0
  335. drivers/mmc/host/tmio_mmc_pio.c +5 −1
  336. drivers/mtd/mtdcore.c +1 −1
  337. drivers/mtd/nand/atmel_nand.c +41 −4
  338. drivers/mtd/nand/gpmi-nand/gpmi-lib.c +14 −4
  339. drivers/mtd/nand/nand_base.c +1 −1
  340. drivers/net/can/cc770/cc770.c +3 −1
  341. drivers/net/can/cc770/cc770_isa.c +15 −1
  342. drivers/net/can/flexcan.c +6 −1
  343. drivers/net/can/pch_can.c +2 −1
  344. drivers/net/can/sja1000/peak_pci.c +9 −14
  345. drivers/net/can/sja1000/sja1000.c +12 −1
  346. drivers/net/can/ti_hecc.c +2 −1
  347. drivers/net/can/usb/ems_usb.c +0 −9
  348. drivers/net/ethernet/3com/3c59x.c +1 −1
  349. drivers/net/ethernet/atheros/atl1c/atl1c_main.c +0 −4
  350. drivers/net/ethernet/broadcom/b44.c +1 −1
  351. drivers/net/ethernet/broadcom/bcm63xx_enet.c +1 −1
  352. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 −2
  353. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +1 −16
  354. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +4 −4
  355. drivers/net/ethernet/broadcom/cnic.c +5 −1
  356. drivers/net/ethernet/brocade/bna/bnad_ethtool.c +4 −6
  357. drivers/net/ethernet/cisco/enic/cq_enet_desc.h +1 −1
  358. drivers/net/ethernet/cisco/enic/enic_pp.c +1 −1
  359. drivers/net/ethernet/emulex/benet/be_ethtool.c +1 −5
  360. drivers/net/ethernet/freescale/fec.c +2 −2
  361. drivers/net/ethernet/intel/e1000/e1000_main.c +6 −4
  362. drivers/net/ethernet/intel/igb/igb_main.c +2 −1
  363. drivers/net/ethernet/intel/igbvf/Makefile +1 −1
  364. drivers/net/ethernet/intel/igbvf/defines.h +1 −1
  365. drivers/net/ethernet/intel/igbvf/ethtool.c +1 −1
  366. drivers/net/ethernet/intel/igbvf/igbvf.h +1 −1
  367. drivers/net/ethernet/intel/igbvf/mbx.c +1 −1
  368. drivers/net/ethernet/intel/igbvf/mbx.h +1 −1
  369. drivers/net/ethernet/intel/igbvf/netdev.c +2 −2
  370. drivers/net/ethernet/intel/igbvf/regs.h +1 −1
  371. drivers/net/ethernet/intel/igbvf/vf.c +1 −1
  372. drivers/net/ethernet/intel/igbvf/vf.h +1 −1
  373. drivers/net/ethernet/intel/ixgbe/Makefile +1 −1
  374. drivers/net/ethernet/intel/ixgbe/ixgbe.h +1 −1
  375. drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c +1 −1
  376. drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +1 −1
  377. drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +1 −1
  378. drivers/net/ethernet/intel/ixgbe/ixgbe_common.h +2 −2
  379. drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c +1 −1
  380. drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.h +1 −1
  381. drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c +1 −1
  382. drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.h +1 −1
  383. drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c +1 −1
  384. drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.h +1 −1
  385. drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +10 −3
  386. drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +53 −39
  387. drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +1 −1
  388. drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h +1 −1
  389. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +13 −9
  390. drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c +1 −1
  391. drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h +1 −1
  392. drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +1 −1
  393. drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +1 −1
  394. drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +6 −2
  395. drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h +1 −1
  396. drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +1 −1
  397. drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c +1 −1
  398. drivers/net/ethernet/intel/ixgbevf/Makefile +1 −1
  399. drivers/net/ethernet/intel/ixgbevf/defines.h +1 −1
  400. drivers/net/ethernet/intel/ixgbevf/ethtool.c +1 −1
  401. drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +1 −1
  402. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +8 −4
  403. drivers/net/ethernet/intel/ixgbevf/mbx.c +1 −1
  404. drivers/net/ethernet/intel/ixgbevf/mbx.h +1 −1
  405. drivers/net/ethernet/intel/ixgbevf/regs.h +1 −1
  406. drivers/net/ethernet/intel/ixgbevf/vf.c +16 −5
  407. drivers/net/ethernet/intel/ixgbevf/vf.h +1 −1
  408. drivers/net/ethernet/jme.c +1 −9
  409. drivers/net/ethernet/jme.h +1 −1
  410. drivers/net/ethernet/marvell/skge.c +13 −58
  411. drivers/net/ethernet/mellanox/mlx4/cmd.c +5 −5
  412. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +2 −1
  413. drivers/net/ethernet/mellanox/mlx4/en_rx.c +7 −3
  414. drivers/net/ethernet/mellanox/mlx4/eq.c +7 −6
  415. drivers/net/ethernet/mellanox/mlx4/fw.c +1 −1
  416. drivers/net/ethernet/mellanox/mlx4/main.c +6 −4
  417. drivers/net/ethernet/mellanox/mlx4/mcg.c +8 −8
  418. drivers/net/ethernet/mellanox/mlx4/mlx4.h +1 −1
  419. drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +2 −1
  420. drivers/net/ethernet/mellanox/mlx4/mr.c +6 −6
  421. drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +13 −8
  422. drivers/net/ethernet/micrel/Kconfig +0 −1
  423. drivers/net/ethernet/micrel/ks8851.c +1 −1
  424. drivers/net/ethernet/micrel/ks8851_mll.c +6 −8
  425. drivers/net/ethernet/octeon/octeon_mgmt.c +2 −2
  426. drivers/net/ethernet/renesas/sh_eth.c +3 −1
  427. drivers/net/ethernet/renesas/sh_eth.h +0 −3
  428. drivers/net/ethernet/sfc/rx.c +2 −2
  429. drivers/net/ethernet/stmicro/stmmac/common.h +1 −0
  430. drivers/net/ethernet/stmicro/stmmac/enh_desc.c +1 −1
  431. drivers/net/ethernet/stmicro/stmmac/norm_desc.c +1 −1
  432. drivers/net/ethernet/stmicro/stmmac/stmmac.h +3 −2
  433. drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +6 −1
  434. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +107 −98
  435. drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +2 −4
  436. drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +10 −13
  437. drivers/net/ethernet/ti/cpmac.c +2 −2
  438. drivers/net/ethernet/ti/davinci_emac.c +6 −3
  439. drivers/net/ethernet/ti/davinci_mdio.c +1 −1
  440. drivers/net/ethernet/toshiba/Kconfig +1 −1
  441. drivers/net/ethernet/via/via-velocity.c +0 −3
  442. drivers/net/ethernet/xscale/ixp4xx_eth.c +2 −1
  443. drivers/net/hyperv/netvsc_drv.c +9 −9
  444. drivers/net/hyperv/rndis_filter.c +32 −0
  445. drivers/net/phy/icplus.c +35 −20
  446. drivers/net/ppp/ppp_generic.c +23 −0
  447. drivers/net/tokenring/Kconfig +4 −1
  448. drivers/net/usb/cdc_ether.c +7 −0
  449. drivers/net/usb/hso.c +1 −1
  450. drivers/net/usb/ipheth.c +5 −0
  451. drivers/net/usb/zaurus.c +12 −0
  452. drivers/net/veth.c +3 −1
  453. drivers/net/vmxnet3/vmxnet3_drv.c +2 −2
  454. drivers/net/wireless/ath/ath9k/hw.c +5 −2
  455. drivers/net/wireless/ath/ath9k/init.c +5 −4
  456. drivers/net/wireless/ath/ath9k/rc.c +2 −2
  457. drivers/net/wireless/ath/ath9k/recv.c +8 −0
  458. drivers/net/wireless/iwlwifi/iwl-agn-tx.c +10 −4
  459. drivers/net/wireless/iwlwifi/iwl-commands.h +1 −0
  460. drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +1 −0
  461. drivers/net/wireless/mwifiex/cfg80211.c +7 −1
  462. drivers/net/wireless/mwifiex/init.c +2 −1
  463. drivers/net/wireless/mwifiex/main.c +8 −4
  464. drivers/net/wireless/mwifiex/sta_ioctl.c +7 −1
  465. drivers/net/wireless/rt2x00/rt2800lib.c +4 −4
  466. drivers/net/wireless/rtlwifi/pci.c +2 −2
  467. drivers/net/wireless/zd1211rw/zd_mac.c +8 −0
  468. drivers/pci/iov.c +1 −2
  469. drivers/pci/probe.c +5 −0
  470. drivers/pci/remove.c +22 −6
  471. drivers/pci/xen-pcifront.c +5 −5
  472. drivers/pcmcia/ds.c +1 −3
  473. drivers/pinctrl/core.c +1 −1
  474. drivers/platform/x86/ibm_rtl.c +2 −13
  475. drivers/platform/x86/intel_ips.c +2 −13
  476. drivers/power/bq27x00_battery.c +5 −10
  477. drivers/power/charger-manager.c +2 −2
  478. drivers/power/lp8727_charger.c +1 −0
  479. drivers/regulator/max8649.c +1 −1
  480. drivers/regulator/mc13xxx-regulator-core.c +2 −0
  481. drivers/rtc/rtc-at91sam9.c +10 −3
  482. drivers/s390/block/dasd_eckd.c +1 −1
  483. drivers/s390/block/dasd_ioctl.c +1 −0
  484. drivers/s390/char/con3215.c +15 −7
  485. drivers/s390/char/fs3270.c +1 −0
  486. drivers/s390/char/vmcp.c +1 −0
  487. drivers/s390/cio/chsc_sch.c +1 −0
  488. drivers/s390/scsi/zfcp_cfdc.c +1 −0
  489. drivers/scsi/device_handler/scsi_dh_rdac.c +14 −11
  490. drivers/scsi/ipr.c +18 −6
  491. drivers/scsi/isci/host.c +3 −1
  492. drivers/scsi/mpt2sas/mpt2sas_base.c +2 −1
  493. drivers/scsi/qla2xxx/qla_attr.c +4 −9
  494. drivers/scsi/qla2xxx/qla_bsg.c +9 −41
  495. drivers/scsi/qla2xxx/qla_dbg.c +2 −1
  496. drivers/scsi/qla2xxx/qla_def.h +1 −0
  497. drivers/scsi/qla2xxx/qla_inline.h +13 −0
  498. drivers/scsi/qla2xxx/qla_isr.c +0 −1
  499. drivers/scsi/qla2xxx/qla_mbx.c +6 −1
  500. drivers/scsi/qla2xxx/qla_nx.c +1 −14
  501. drivers/scsi/qla2xxx/qla_os.c +8 −11
  502. drivers/scsi/qla2xxx/qla_version.h +1 −1
  503. drivers/scsi/qla4xxx/ql4_nx.c +2 −21
  504. drivers/scsi/scsi_pm.c +16 −0
  505. drivers/scsi/scsi_priv.h +1 −0
  506. drivers/scsi/scsi_scan.c +2 −2
  507. drivers/sh/clk/cpg.c +1 −1
  508. drivers/spi/Kconfig +1 −1
  509. drivers/spi/spi-topcliff-pch.c +3 −3
  510. drivers/ssb/driver_pcicore.c +1 −1
  511. drivers/staging/Kconfig +0 −4
  512. drivers/staging/Makefile +0 −2
  513. drivers/staging/android/Kconfig +1 −4
  514. drivers/staging/android/Makefile +0 −1
  515. drivers/staging/android/android_pmem.h +0 −93
  516. drivers/staging/android/binder.c +11 −2
  517. drivers/staging/android/lowmemorykiller.c +4 −1
  518. drivers/staging/android/pmem.c +0 −1345
  519. drivers/staging/asus_oled/asus_oled.c +9 −4
  520. drivers/staging/gma500/Kconfig +0 −33
  521. drivers/staging/gma500/Makefile +0 −52
  522. drivers/staging/gma500/TODO +0 −15
  523. drivers/staging/gma500/accel_2d.c +0 −414
  524. drivers/staging/gma500/backlight.c +0 −49
  525. drivers/staging/gma500/cdv_device.c +0 −350
  526. drivers/staging/gma500/cdv_device.h +0 −36
  527. drivers/staging/gma500/cdv_intel_crt.c +0 −326
  528. drivers/staging/gma500/cdv_intel_display.c +0 −1508
  529. drivers/staging/gma500/cdv_intel_hdmi.c +0 −376
  530. drivers/staging/gma500/cdv_intel_lvds.c +0 −721
  531. drivers/staging/gma500/displays/hdmi.h +0 −33
  532. drivers/staging/gma500/displays/pyr_cmd.h +0 −34
  533. drivers/staging/gma500/displays/pyr_vid.h +0 −34
  534. drivers/staging/gma500/displays/tmd_cmd.h +0 −34
  535. drivers/staging/gma500/displays/tmd_vid.h +0 −34
  536. drivers/staging/gma500/displays/tpo_cmd.h +0 −35
  537. drivers/staging/gma500/displays/tpo_vid.h +0 −33
  538. drivers/staging/gma500/framebuffer.c +0 −856
  539. drivers/staging/gma500/framebuffer.h +0 −48
  540. drivers/staging/gma500/gem.c +0 −292
  541. drivers/staging/gma500/gem_glue.c +0 −89
  542. drivers/staging/gma500/gem_glue.h +0 −2
  543. drivers/staging/gma500/gtt.c +0 −553
  544. drivers/staging/gma500/gtt.h +0 −64
  545. drivers/staging/gma500/intel_bios.c +0 −303
  546. drivers/staging/gma500/intel_bios.h +0 −430
  547. drivers/staging/gma500/intel_i2c.c +0 −170
  548. drivers/staging/gma500/intel_opregion.c +0 −81
  549. drivers/staging/gma500/mdfld_device.c +0 −714
  550. drivers/staging/gma500/mdfld_dsi_dbi.c +0 −761
  551. drivers/staging/gma500/mdfld_dsi_dbi.h +0 −173
  552. drivers/staging/gma500/mdfld_dsi_dbi_dpu.c +0 −778
  553. drivers/staging/gma500/mdfld_dsi_dbi_dpu.h +0 −154
  554. drivers/staging/gma500/mdfld_dsi_dpi.c +0 −805
  555. drivers/staging/gma500/mdfld_dsi_dpi.h +0 −78
  556. drivers/staging/gma500/mdfld_dsi_output.c +0 −1014
  557. drivers/staging/gma500/mdfld_dsi_output.h +0 −138
  558. drivers/staging/gma500/mdfld_dsi_pkg_sender.c +0 −1484
  559. drivers/staging/gma500/mdfld_dsi_pkg_sender.h +0 −184
  560. drivers/staging/gma500/mdfld_intel_display.c +0 −1404
  561. drivers/staging/gma500/mdfld_msic.h +0 −31
  562. drivers/staging/gma500/mdfld_output.c +0 −171
  563. drivers/staging/gma500/mdfld_output.h +0 −41
  564. drivers/staging/gma500/mdfld_pyr_cmd.c +0 −558
  565. drivers/staging/gma500/mdfld_tmd_vid.c +0 −206
  566. drivers/staging/gma500/mdfld_tpo_cmd.c +0 −509
  567. drivers/staging/gma500/mdfld_tpo_vid.c +0 −140
  568. drivers/staging/gma500/medfield.h +0 −268
  569. drivers/staging/gma500/mid_bios.c +0 −270
  570. drivers/staging/gma500/mid_bios.h +0 −21
  571. drivers/staging/gma500/mmu.c +0 −858
  572. drivers/staging/gma500/mrst.h +0 −252
  573. drivers/staging/gma500/mrst_crtc.c +0 −604
  574. drivers/staging/gma500/mrst_device.c +0 −634
  575. drivers/staging/gma500/mrst_hdmi.c +0 −852
  576. drivers/staging/gma500/mrst_hdmi_i2c.c +0 −328
  577. drivers/staging/gma500/mrst_lvds.c +0 −407
  578. drivers/staging/gma500/power.c +0 −318
  579. drivers/staging/gma500/power.h +0 −67
  580. drivers/staging/gma500/psb_device.c +0 −321
  581. drivers/staging/gma500/psb_drm.h +0 −219
  582. drivers/staging/gma500/psb_drv.c +0 −1230
  583. drivers/staging/gma500/psb_drv.h +0 −952
  584. drivers/staging/gma500/psb_intel_display.c +0 −1429
  585. drivers/staging/gma500/psb_intel_display.h +0 −28
  586. drivers/staging/gma500/psb_intel_drv.h +0 −230
  587. drivers/staging/gma500/psb_intel_lvds.c +0 −854
  588. drivers/staging/gma500/psb_intel_modes.c +0 −77
  589. drivers/staging/gma500/psb_intel_reg.h +0 −1235
  590. drivers/staging/gma500/psb_intel_sdvo.c +0 −1293
  591. drivers/staging/gma500/psb_intel_sdvo_regs.h +0 −338
  592. drivers/staging/gma500/psb_irq.c +0 −627
  593. drivers/staging/gma500/psb_irq.h +0 −45
  594. drivers/staging/gma500/psb_lid.c +0 −88
  595. drivers/staging/gma500/psb_reg.h +0 −582
  596. drivers/staging/omapdrm/Makefile +1 −0
  597. drivers/staging/omapdrm/omap_crtc.c +45 −146
  598. drivers/staging/omapdrm/omap_drv.c +48 −33
  599. drivers/staging/omapdrm/omap_drv.h +46 −6
  600. drivers/staging/omapdrm/omap_fb.c +167 −57
  601. drivers/staging/omapdrm/omap_fbdev.c +37 −22
  602. drivers/staging/omapdrm/omap_gem.c +19 −4
  603. drivers/staging/omapdrm/omap_plane.c +344 −0
  604. drivers/staging/omapdrm/omap_priv.h +10 −2
  605. drivers/staging/pohmelfs/Kconfig +0 −20
  606. drivers/staging/pohmelfs/Makefile +0 −3
  607. drivers/staging/pohmelfs/config.c +0 −611
  608. drivers/staging/pohmelfs/crypto.c +0 −878
  609. drivers/staging/pohmelfs/dir.c +0 −1102
  610. drivers/staging/pohmelfs/inode.c +0 −2055
  611. drivers/staging/pohmelfs/lock.c +0 −182
  612. drivers/staging/pohmelfs/mcache.c +0 −171
  613. drivers/staging/pohmelfs/net.c +0 −1209
  614. drivers/staging/pohmelfs/netfs.h +0 −919
  615. drivers/staging/pohmelfs/path_entry.c +0 −120
  616. drivers/staging/pohmelfs/trans.c +0 −706
  617. drivers/staging/rtl8712/drv_types.h +7 −0
  618. drivers/staging/rtl8712/hal_init.c +43 −19
  619. drivers/staging/rtl8712/os_intfs.c +11 −3
  620. drivers/staging/rtl8712/rtl8712_hal.h +1 −0
  621. drivers/staging/rtl8712/rtl871x_sta_mgt.c +1 −0
  622. drivers/staging/rtl8712/usb_intf.c +7 −3
  623. drivers/staging/tidspbridge/core/tiomap3430.c +0 −2
  624. drivers/staging/tidspbridge/rmgr/drv_interface.c +35 −23
  625. drivers/staging/usbip/stub_main.c +2 −2
  626. drivers/staging/zcache/zcache-main.c +12 −13
  627. drivers/target/iscsi/iscsi_target.c +34 −5
  628. drivers/target/iscsi/iscsi_target_configfs.c +1 −0
  629. drivers/target/iscsi/iscsi_target_core.h +4 −2
  630. drivers/target/iscsi/iscsi_target_erl1.c +2 −2
  631. drivers/target/iscsi/iscsi_target_login.c +35 −4
  632. drivers/target/iscsi/iscsi_target_util.c +11 −0
  633. drivers/target/target_core_alua.c +4 −4
  634. drivers/target/target_core_cdb.c +26 −25
  635. drivers/target/target_core_configfs.c +8 −4
  636. drivers/target/target_core_device.c +15 −13
  637. drivers/target/target_core_fabric_configfs.c +2 −2
  638. drivers/target/target_core_iblock.c +9 −2
  639. drivers/target/target_core_internal.h +1 −1
  640. drivers/target/target_core_pr.c +22 −21
  641. drivers/target/target_core_pscsi.c +2 −2
  642. drivers/target/target_core_tpg.c +1 −2
  643. drivers/target/target_core_transport.c +83 −41
  644. drivers/target/tcm_fc/tfc_cmd.c +2 −7
  645. drivers/tty/serial/8250/8250.c +1 −1
  646. drivers/tty/serial/m32r_sio.c +0 −0
  647. drivers/tty/serial/m32r_sio.h +0 −0
  648. drivers/tty/serial/m32r_sio_reg.h +0 −0
  649. drivers/tty/serial/omap-serial.c +25 −5
  650. drivers/tty/serial/samsung.c +2 −1
  651. drivers/tty/vt/vt_ioctl.c +0 −1
  652. drivers/usb/core/hcd-pci.c +4 −1
  653. drivers/usb/core/hcd.c +4 −2
  654. drivers/usb/core/hub.c +17 −13
  655. drivers/usb/gadget/f_loopback.c +1 −1
  656. drivers/usb/host/Kconfig +4 −4
  657. drivers/usb/host/ehci-fsl.c +9 −2
  658. drivers/usb/host/ehci-fsl.h +1 −0
  659. drivers/usb/host/pci-quirks.c +17 −0
  660. drivers/usb/host/xhci-hub.c +1 −1
  661. drivers/usb/host/xhci-mem.c +24 −8
  662. drivers/usb/host/xhci.c +5 −0
  663. drivers/usb/musb/musb_io.h +2 −1
  664. drivers/usb/otg/Kconfig +1 −1
  665. drivers/usb/serial/cp210x.c +2 −0
  666. drivers/usb/serial/ftdi_sio.c +1 −0
  667. drivers/usb/serial/ftdi_sio_ids.h +7 −0
  668. drivers/usb/serial/option.c +25 −15
  669. drivers/usb/serial/qcserial.c +14 −2
  670. drivers/usb/serial/ti_usb_3410_5052.c +4 −2
  671. drivers/usb/serial/ti_usb_3410_5052.h +4 −0
  672. drivers/usb/storage/usb.c +31 −59
  673. drivers/usb/storage/usb.h +4 −3
  674. drivers/video/atmel_lcdfb.c +1 −1
  675. drivers/video/fsl-diu-fb.c +2 −2
  676. drivers/video/intelfb/intelfbdrv.c +0 −1
  677. drivers/video/omap2/dss/dispc.c +1 −1
  678. drivers/video/omap2/dss/dpi.c +5 −0
  679. drivers/video/omap2/dss/dsi.c +1 −1
  680. drivers/video/omap2/dss/dss.c +1 −1
  681. drivers/video/omap2/dss/hdmi.c +4 −1
  682. drivers/video/omap2/dss/rfbi.c +1 −1
  683. drivers/video/omap2/dss/ti_hdmi.h +4 −0
  684. drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +64 −4
  685. drivers/video/omap2/dss/venc.c +1 −1
  686. drivers/video/pvr2fb.c +1 −1
  687. drivers/xen/cpu_hotplug.c +2 −1
  688. drivers/xen/xen-pciback/pci_stub.c +4 −4
  689. drivers/xen/xen-pciback/xenbus.c +3 −2
  690. drivers/xen/xenbus/xenbus_dev_frontend.c +4 −0
  691. fs/autofs4/autofs_i.h +1 −0
  692. fs/autofs4/dev-ioctl.c +1 −0
  693. fs/autofs4/expire.c +2 −0
  694. fs/autofs4/inode.c +2 −0
  695. fs/autofs4/waitq.c +19 −3
  696. fs/bio.c +3 −7
  697. fs/btrfs/backref.c +2 −0
  698. fs/btrfs/check-integrity.c +1 −1
  699. fs/btrfs/compression.c +2 −0
  700. fs/btrfs/ctree.h +1 −1
  701. fs/btrfs/disk-io.c +12 −0
  702. fs/btrfs/extent-tree.c +32 −19
  703. fs/btrfs/extent_io.c +65 −48
  704. fs/btrfs/extent_io.h +1 −0
  705. fs/btrfs/extent_map.h +2 −2
  706. fs/btrfs/file.c +12 −17
  707. fs/btrfs/free-space-cache.c +1 −0
  708. fs/btrfs/inode-map.c +4 −2
  709. fs/btrfs/inode.c +35 −5
  710. fs/btrfs/ioctl.c +35 −24
  711. fs/btrfs/scrub.c +5 −3
  712. fs/btrfs/transaction.c +9 −7
  713. fs/btrfs/volumes.c +31 −2
  714. fs/cifs/Kconfig +2 −2
  715. fs/cifs/connect.c +11 −12
  716. fs/cifs/dir.c +1 −1
  717. fs/cifs/sess.c +7 −4
  718. fs/compat.c +25 −31
  719. fs/dcache.c +4 −4
  720. fs/direct-io.c +2 −2
  721. fs/ecryptfs/crypto.c +61 −7
  722. fs/ecryptfs/ecryptfs_kernel.h +6 −0
  723. fs/ecryptfs/inode.c +2 −0
  724. fs/ecryptfs/keystore.c +3 −6
  725. fs/ecryptfs/mmap.c +2 −2
  726. fs/ecryptfs/read_write.c +2 −2
  727. fs/ecryptfs/super.c +13 −1
  728. fs/eventpoll.c +29 −1
  729. fs/exec.c +17 −16
  730. fs/fs-writeback.c +8 −8
  731. fs/inode.c +4 −4
  732. fs/ioprio.c +1 −1
  733. fs/jffs2/erase.c +1 −1
  734. fs/namei.c +3 −1
  735. fs/nfs/nfs4proc.c +55 −75
  736. fs/nfs/nfs4state.c +2 −0
  737. fs/nfs/nfs4xdr.c +4 −1
  738. fs/nilfs2/ioctl.c +2 −0
  739. fs/ntfs/attrib.c +3 −3
  740. fs/ntfs/mft.c +3 −3
  741. fs/ntfs/super.c +1 −3
  742. fs/ocfs2/namei.c +1 −1
  743. fs/quota/quota.c +21 −3
  744. fs/select.c +1 −1
  745. fs/signalfd.c +15 −0
  746. fs/super.c +22 −0
  747. fs/xfs/kmem.h +0 −6
  748. fs/xfs/xfs_dquot.c +38 −89
  749. fs/xfs/xfs_log_recover.c +4 −4
  750. fs/xfs/xfs_qm.c +111 −180
  751. fs/xfs/xfs_qm.h +0 −14
  752. fs/xfs/xfs_qm_stats.c +2 −2
  753. fs/xfs/xfs_qm_syscalls.c +2 −2
  754. fs/xfs/xfs_trace.h +2 −3
  755. fs/xfs/xfs_trans.c +2 −2
  756. fs/xfs/xfs_trans_dquot.c +6 −4
  757. include/asm-generic/io-64-nonatomic-hi-lo.h +28 −0
  758. include/asm-generic/io-64-nonatomic-lo-hi.h +28 −0
  759. include/asm-generic/pci_iomap.h +10 −0
  760. include/asm-generic/poll.h +2 −0
  761. include/linux/binfmts.h +2 −1
  762. include/linux/bitops.h +20 −0
  763. include/linux/blkdev.h +0 −3
  764. include/linux/cdrom.h +2 −1
  765. include/linux/compat.h +4 −0
  766. include/linux/digsig.h +2 −2
  767. include/linux/elevator.h +1 −8
  768. include/linux/fs.h +1 −0
  769. include/linux/gpio_keys.h +2 −0
  770. include/linux/hyperv.h +1 −1
  771. include/linux/if_link.h +1 −0
  772. include/linux/iocontext.h +2 −3
  773. include/linux/mfd/twl6040.h +2 −0
  774. include/linux/mmc/card.h +4 −0
  775. include/linux/mmc/dw_mmc.h +4 −2
  776. include/linux/mmc/host.h +20 −0
  777. include/linux/mtd/mtd.h +1 −3
  778. include/linux/netfilter_bridge/ebtables.h +2 −2
  779. include/linux/nfs_xdr.h +1 −1
  780. include/linux/pm_qos.h +13 −1
  781. include/linux/proportions.h +4 −0
  782. include/linux/rtnetlink.h +3 −0
  783. include/linux/sh_dma.h +1 −0
  784. include/linux/signalfd.h +4 −1
  785. include/linux/skbuff.h +10 −0
  786. include/linux/syscalls.h +1 −1
  787. include/linux/usb/ch11.h +2 −8
  788. include/linux/usb/ch9.h +1 −1
  789. include/net/bluetooth/bluetooth.h +2 −0
  790. include/net/bluetooth/hci_core.h +3 −3
  791. include/net/bluetooth/l2cap.h +6 −6
  792. include/net/flow.h +10 −0
  793. include/net/netfilter/nf_conntrack.h +1 −1
  794. include/net/netprio_cgroup.h +40 −8
  795. include/net/route.h +4 −0
  796. include/net/rtnetlink.h +1 −1
  797. include/net/sch_generic.h +8 −1
  798. include/net/tcp.h +10 −4
  799. include/sound/core.h +2 −0
  800. include/target/target_core_backend.h +2 −2
  801. include/target/target_core_base.h +1 −0
  802. include/target/target_core_fabric.h +1 −1
  803. include/trace/events/sched.h +0 −50
  804. include/trace/events/writeback.h +5 −2
  805. include/video/omapdss.h +5 −0
  806. kernel/events/core.c +14 −5
  807. kernel/events/hw_breakpoint.c +2 −2
  808. kernel/fork.c +5 −2
  809. kernel/irq/autoprobe.c +2 −2
  810. kernel/irq/chip.c +33 −9
  811. kernel/irq/internals.h +1 −1
  812. kernel/irq/manage.c +1 −1
  813. kernel/kprobes.c +5 −1
  814. kernel/params.c +2 −1
  815. kernel/pid.c +2 −2
  816. kernel/power/power.h +22 −2
  817. kernel/power/process.c +5 −2
  818. kernel/power/user.c +4 −2
  819. kernel/relay.c +8 −2
  820. kernel/sched/core.c +0 −1
  821. kernel/sched/fair.c +2 −0
  822. lib/Kconfig +3 −0
  823. lib/kstrtox.c +13 −5
  824. lib/pci_iomap.c +1 −1
  825. mm/backing-dev.c +18 −5
  826. mm/compaction.c +23 −1
  827. mm/filemap.c +4 −4
  828. mm/filemap_xip.c +6 −1
  829. mm/huge_memory.c +2 −2
  830. mm/kmemleak.c +2 −1
  831. mm/memcontrol.c +6 −2
  832. mm/migrate.c +1 −1
  833. mm/nommu.c +7 −2
  834. mm/page_alloc.c +1 −0
  835. mm/swap.c +1 −1
  836. net/atm/clip.c +6 −4
  837. net/bluetooth/af_bluetooth.c +5 −7
  838. net/bluetooth/hci_conn.c +4 −0
  839. net/bluetooth/hci_core.c +2 −1
  840. net/bluetooth/l2cap_core.c +14 −10
  841. net/bluetooth/l2cap_sock.c +3 −1
  842. net/bluetooth/rfcomm/core.c +12 −6
  843. net/bluetooth/rfcomm/sock.c +2 −0
  844. net/caif/caif_socket.c +6 −4
  845. net/caif/cfmuxl.c +3 −9
  846. net/core/dev.c +8 −2
  847. net/core/ethtool.c +2 −0
  848. net/core/neighbour.c +2 −0
  849. net/core/netpoll.c +1 −1
  850. net/core/netprio_cgroup.c +5 −10
  851. net/core/rtnetlink.c +57 −21
  852. net/core/sock.c +2 −5
  853. net/ipv4/Kconfig +1 −1
  854. net/ipv4/arp.c +2 −1
  855. net/ipv4/ip_gre.c +5 −5
  856. net/ipv4/ip_options.c +1 −1
  857. net/ipv4/ping.c +1 −0
  858. net/ipv4/sysctl_net_ipv4.c +0 −6
  859. net/ipv4/tcp.c +20 −8
  860. net/ipv4/tcp_input.c +29 −16
  861. net/ipv4/tcp_ipv4.c +5 −0
  862. net/ipv4/tcp_timer.c +1 −4
  863. net/ipv4/xfrm4_mode_beet.c +1 −4
  864. net/ipv4/xfrm4_mode_tunnel.c +2 −4
  865. net/ipv6/ip6mr.c +3 −1
  866. net/ipv6/ndisc.c +3 −2
  867. net/ipv6/xfrm6_mode_beet.c +1 −5
  868. net/ipv6/xfrm6_mode_tunnel.c +2 −4
  869. net/mac80211/debugfs_sta.c +2 −2
  870. net/mac80211/main.c +2 −2
  871. net/mac80211/rate.c +1 −1
  872. net/mac80211/rate.h +2 −1
  873. net/mac80211/rx.c +1 −1
  874. net/mac80211/sta_info.h +2 −0
  875. net/netfilter/ipvs/ip_vs_core.c +1 −1
  876. net/netfilter/nf_conntrack_core.c +34 −4
  877. net/netfilter/nf_conntrack_netlink.c +16 −30
  878. net/netfilter/nf_queue.c +32 −8
  879. net/netfilter/xt_TEE.c +3 −2
  880. net/rxrpc/ar-key.c +2 −2
  881. net/sched/sch_choke.c +1 −2
  882. net/sched/sch_netem.c +3 −6
  883. net/sched/sch_sfb.c +1 −2
  884. net/sched/sch_sfq.c +2 −3
  885. scripts/checkpatch.pl +6 −0
  886. scripts/coccicheck +4 −9
  887. scripts/depmod.sh +0 −6
  888. scripts/mod/file2alias.c +32 −5
  889. scripts/mod/modpost.c +9 −0
  890. scripts/package/builddeb +6 −6
  891. sound/isa/sb/emu8000_patch.c +0 −1
  892. sound/pci/hda/hda_codec.c +1 −1
  893. sound/pci/hda/hda_jack.c +15 −9
  894. sound/pci/hda/patch_ca0132.c +19 −14
  895. sound/pci/hda/patch_cirrus.c +4 −2
  896. sound/pci/hda/patch_realtek.c +80 −26
  897. sound/pci/hda/patch_sigmatel.c +2 −2
  898. sound/pci/hda/patch_via.c +132 −155
  899. sound/pci/intel8x0.c +6 −0
  900. sound/pci/oxygen/oxygen_mixer.c +14 −11
  901. sound/soc/codecs/ak4642.c +16 −15
  902. sound/soc/codecs/cs42l73.c +1 −1
  903. sound/soc/codecs/wm5100.c +11 −1
  904. sound/soc/codecs/wm8962.c +5 −5
  905. sound/soc/codecs/wm8994.c +10 −6
  906. sound/soc/codecs/wm8996.c +1 −1
  907. sound/soc/codecs/wm_hubs.c +12 −6
  908. sound/soc/samsung/neo1973_wm8753.c +1 −64
  909. sound/soc/sh/fsi.c +1 −5
  910. sound/soc/soc-core.c +11 −0
  911. sound/usb/caiaq/audio.c +4 −1
  912. sound/usb/card.h +1 −0
  913. sound/usb/format.c +1 −3
  914. sound/usb/quirks-table.h +8 −0
  915. sound/usb/quirks.c +5 −1
  916. tools/perf/util/event.c +1 −0
  917. tools/perf/util/evlist.c +4 −0
  918. tools/perf/util/probe-event.c +6 −0
  919. tools/perf/util/probe-finder.c +11 −1
  920. virt/kvm/kvm_main.c +1 −1
Documentation/input/event-codes.txt+64−8
@@ -17,11 +17,11 @@ reports supported by a device are also provided by sysfs in · 16 unmodified lines
1717 class/input/event*/device/capabilities/, and the properties of a device are
1818 provided in class/input/event*/device/properties.
1919
20−Types:
21−==========
22−Types are groupings of codes under a logical input construct. Each type has a
23−set of applicable codes to be used in generating events. See the Codes section
24−for details on valid codes for each type.
20+Event types:
21+===========
22+Event types are groupings of codes under a logical input construct. Each
23+type has a set of applicable codes to be used in generating events. See the
24+Codes section for details on valid codes for each type.
2525
2626 * EV_SYN:
2727 - Used as markers to separate events. Events may be separated in time or in
@@ -63,9 +63,9 @@ for details on valid codes for each type. · 35 unmodified lines
6363 * EV_FF_STATUS:
6464 - Used to receive force feedback device status.
6565
66−Codes:
67−==========
68−Codes define the precise type of event.
66+Event codes:
67+===========
68+Event codes define the precise type of event.
6969
7070 EV_SYN:
7171 ----------
@@ -220,6 +220,56 @@ EV_PWR: · 148 unmodified lines
220220 EV_PWR events are a special type of event used specifically for power
221221 mangement. Its usage is not well defined. To be addressed later.
222222
223+Device properties:
224+=================
225+Normally, userspace sets up an input device based on the data it emits,
226+i.e., the event types. In the case of two devices emitting the same event
227+types, additional information can be provided in the form of device
228+properties.
229+
230+INPUT_PROP_DIRECT + INPUT_PROP_POINTER:
231+--------------------------------------
232+The INPUT_PROP_DIRECT property indicates that device coordinates should be
233+directly mapped to screen coordinates (not taking into account trivial
234+transformations, such as scaling, flipping and rotating). Non-direct input
235+devices require non-trivial transformation, such as absolute to relative
236+transformation for touchpads. Typical direct input devices: touchscreens,
237+drawing tablets; non-direct devices: touchpads, mice.
238+
239+The INPUT_PROP_POINTER property indicates that the device is not transposed
240+on the screen and thus requires use of an on-screen pointer to trace user's
241+movements. Typical pointer devices: touchpads, tablets, mice; non-pointer
242+device: touchscreen.
243+
244+If neither INPUT_PROP_DIRECT or INPUT_PROP_POINTER are set, the property is
245+considered undefined and the device type should be deduced in the
246+traditional way, using emitted event types.
247+
248+INPUT_PROP_BUTTONPAD:
249+--------------------
250+For touchpads where the button is placed beneath the surface, such that
251+pressing down on the pad causes a button click, this property should be
252+set. Common in clickpad notebooks and macbooks from 2009 and onwards.
253+
254+Originally, the buttonpad property was coded into the bcm5974 driver
255+version field under the name integrated button. For backwards
256+compatibility, both methods need to be checked in userspace.
257+
258+INPUT_PROP_SEMI_MT:
259+------------------
260+Some touchpads, most common between 2008 and 2011, can detect the presence
261+of multiple contacts without resolving the individual positions; only the
262+number of contacts and a rectangular shape is known. For such
263+touchpads, the semi-mt property should be set.
264+
265+Depending on the device, the rectangle may enclose all touches, like a
266+bounding box, or just some of them, for instance the two most recent
267+touches. The diversity makes the rectangle of limited use, but some
268+gestures can normally be extracted from it.
269+
270+If INPUT_PROP_SEMI_MT is not set, the device is assumed to be a true MT
271+device.
272+
223273 Guidelines:
224274 ==========
225275 The guidelines below ensure proper single-touch and multi-finger functionality.
@@ -240,6 +290,8 @@ used to report when a touch is active on the screen. · 14 unmodified lines
240290 BTN_{MOUSE,LEFT,MIDDLE,RIGHT} must not be reported as the result of touch
241291 contact. BTN_TOOL_<name> events should be reported where possible.
242292
293+For new hardware, INPUT_PROP_DIRECT should be set.
294+
243295 Trackpads:
244296 ----------
245297 Legacy trackpads that only provide relative position information must report
@@ -250,6 +302,8 @@ location of the touch. BTN_TOUCH should be used to report when a touch is active · 4 unmodified lines
250302 on the trackpad. Where multi-finger support is available, BTN_TOOL_<name> should
251303 be used to report the number of touches active on the trackpad.
252304
305+For new hardware, INPUT_PROP_POINTER should be set.
306+
253307 Tablets:
254308 ----------
255309 BTN_TOOL_<name> events must be reported when a stylus or other tool is active on
@@ -260,3 +314,5 @@ button may be used for buttons on the tablet except BTN_{MOUSE,LEFT}. · 4 unmodified lines
260314 BTN_{0,1,2,etc} are good generic codes for unlabeled buttons. Do not use
261315 meaningful buttons, like BTN_FORWARD, unless the button is labeled for that
262316 purpose on the device.
317+
318+For new hardware, both INPUT_PROP_DIRECT and INPUT_PROP_POINTER should be set.
Documentation/sysctl/kernel.txt+2−0
@@ -601,6 +601,8 @@ can be ORed together: · 600 unmodified lines
601601 instead of using the one provided by the hardware.
602602 512 - A kernel warning has occurred.
603603 1024 - A module from drivers/staging was loaded.
604+2048 - The system is working around a severe firmware bug.
605+4096 - An out-of-tree module has been loaded.
604606
605607 ==============================================================
606608
MAINTAINERS+16−24
@@ -269,7 +269,6 @@ S: Orphan · 268 unmodified lines
269269 F: drivers/platform/x86/wmi.c
270270
271271 AD1889 ALSA SOUND DRIVER
272−M: Kyle McMartin <kyle@mcmartin.ca>
273272 M: Thibaut Varene <T-Bone@parisc-linux.org>
274273 W: http://wiki.parisc-linux.org/AD1889
275274 L: linux-parisc@vger.kernel.org
@@ -789,12 +788,6 @@ F: arch/arm/mach-mx*/ · 513 unmodified lines
789788 F: arch/arm/mach-imx/
790789 F: arch/arm/plat-mxc/
791790
792−ARM/FREESCALE IMX51
793−M: Amit Kucheria <amit.kucheria@canonical.com>
794−L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
795−S: Maintained
796−F: arch/arm/mach-mx5/
797−
798791 ARM/FREESCALE IMX6
799792 M: Shawn Guo <shawn.guo@linaro.org>
800793 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -2287,7 +2280,7 @@ F: drivers/acpi/dock.c · 1486 unmodified lines
22872280 DOCUMENTATION
22882281 M: Randy Dunlap <rdunlap@xenotime.net>
22892282 L: linux-doc@vger.kernel.org
2290−T: quilt http://userweb.kernel.org/~rdunlap/kernel-doc-patches/current/
2283+T: quilt http://xenotime.net/kernel-doc-patches/current/
22912284 S: Maintained
22922285 F: Documentation/
22932286
@@ -3053,7 +3046,6 @@ F: drivers/hwspinlock/hwspinlock_* · 759 unmodified lines
30533046 F: include/linux/hwspinlock.h
30543047
30553048 HARMONY SOUND DRIVER
3056−M: Kyle McMartin <kyle@mcmartin.ca>
30573049 L: linux-parisc@vger.kernel.org
30583050 S: Maintained
30593051 F: sound/parisc/harmony.*
@@ -3324,6 +3316,12 @@ S: Maintained · 264 unmodified lines
33243316 F: net/ieee802154/
33253317 F: drivers/ieee802154/
33263318
3319+IIO SUBSYSTEM AND DRIVERS
3320+M: Jonathan Cameron <jic23@cam.ac.uk>
3321+L: linux-iio@vger.kernel.org
3322+S: Maintained
3323+F: drivers/staging/iio/
3324+
33273325 IKANOS/ADI EAGLE ADSL USB DRIVER
33283326 M: Matthieu Castet <castet.matthieu@free.fr>
33293327 M: Stanislaw Gruszka <stf_xl@wp.pl>
@@ -3782,7 +3780,7 @@ F: Documentation/kdump/ · 452 unmodified lines
37823780
37833781 KERNEL AUTOMOUNTER v4 (AUTOFS4)
37843782 M: Ian Kent <raven@themaw.net>
3785−L: autofs@linux.kernel.org
3783+L: autofs@vger.kernel.org
37863784 S: Maintained
37873785 F: fs/autofs4/
37883786
@@ -3992,11 +3990,11 @@ M: Rusty Russell <rusty@rustcorp.com.au> · 203 unmodified lines
39923990 L: lguest@lists.ozlabs.org
39933991 W: http://lguest.ozlabs.org/
39943992 S: Odd Fixes
3995−F: Documentation/virtual/lguest/
3993+F: arch/x86/include/asm/lguest*.h
39963994 F: arch/x86/lguest/
39973995 F: drivers/lguest/
39983996 F: include/linux/lguest*.h
3999−F: arch/x86/include/asm/lguest*.h
3997+F: tools/lguest/
40003998
40013999 LINUX FOR IBM pSERIES (RS/6000)
40024000 M: Paul Mackerras <paulus@au.ibm.com>
@@ -4136,7 +4134,7 @@ L: linux-ntfs-dev@lists.sourceforge.net · 133 unmodified lines
41364134 W: http://www.linux-ntfs.org/content/view/19/37/
41374135 S: Maintained
41384136 F: Documentation/ldm.txt
4139−F: fs/partitions/ldm.*
4137+F: block/partitions/ldm.*
41404138
41414139 LogFS
41424140 M: Joern Engel <joern@logfs.org>
@@ -4687,7 +4685,7 @@ NTFS FILESYSTEM · 544 unmodified lines
46874685 M: Anton Altaparmakov <anton@tuxera.com>
46884686 L: linux-ntfs-dev@lists.sourceforge.net
46894687 W: http://www.tuxera.com/
4690−T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
4688+T: git git://git.kernel.org/pub/scm/linux/kernel/git/aia21/ntfs.git
46914689 S: Supported
46924690 F: Documentation/filesystems/ntfs.txt
46934691 F: fs/ntfs/
@@ -5000,9 +4998,8 @@ F: Documentation/blockdev/paride.txt · 306 unmodified lines
50004998 F: drivers/block/paride/
50014999
50025000 PARISC ARCHITECTURE
5003−M: Kyle McMartin <kyle@mcmartin.ca>
5004−M: Helge Deller <deller@gmx.de>
50055001 M: "James E.J. Bottomley" <jejb@parisc-linux.org>
5002+M: Helge Deller <deller@gmx.de>
50065003 L: linux-parisc@vger.kernel.org
50075004 W: http://www.parisc-linux.org/
50085005 Q: http://patchwork.kernel.org/project/linux-parisc/list/
@@ -5633,7 +5630,7 @@ W: http://www.ibm.com/developerworks/linux/linux390/ · 624 unmodified lines
56335630 S: Supported
56345631 F: arch/s390/
56355632 F: drivers/s390/
5636−F: fs/partitions/ibm.c
5633+F: block/partitions/ibm.c
56375634 F: Documentation/s390/
56385635 F: Documentation/DocBook/s390*
56395636
@@ -5861,7 +5858,7 @@ S: Maintained · 221 unmodified lines
58615858 F: drivers/mmc/host/sdhci-spear.c
58625859
58635860 SECURITY SUBSYSTEM
5864−M: James Morris <jmorris@namei.org>
5861+M: James Morris <james.l.morris@oracle.com>
58655862 L: linux-security-module@vger.kernel.org (suggested Cc:)
58665863 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git
58675864 W: http://security.wiki.kernel.org/
@@ -5874,7 +5871,7 @@ S: Supported · 6 unmodified lines
58745871
58755872 SELINUX SECURITY MODULE
58765873 M: Stephen Smalley <sds@tycho.nsa.gov>
5877−M: James Morris <jmorris@namei.org>
5874+M: James Morris <james.l.morris@oracle.com>
58785875 M: Eric Paris <eparis@parisplace.org>
58795876 L: selinux@tycho.nsa.gov (subscribers-only, general discussion)
58805877 W: http://selinuxproject.org
@@ -6396,11 +6393,6 @@ M: Omar Ramirez Luna <omar.ramirez@ti.com> · 515 unmodified lines
63966393 S: Odd Fixes
63976394 F: drivers/staging/tidspbridge/
63986395
6399−STAGING - TRIDENT TVMASTER TMxxxx USB VIDEO CAPTURE DRIVERS
6400−L: linux-media@vger.kernel.org
6401−S: Odd Fixes
6402−F: drivers/staging/tm6000/
6403−
64046396 STAGING - USB ENE SM/MS CARD READER DRIVER
64056397 M: Al Cho <acho@novell.com>
64066398 S: Odd Fixes
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 3
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc2
4+EXTRAVERSION = -rc5
55 NAME = Saber-toothed Squirrel
66
77 # *DOCUMENTATION*
arch/arm/boot/dts/exynos4210.dtsi+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 compatible = "arm,cortex-a9-gic";
3030 #interrupt-cells = <3>;
3131 interrupt-controller;
32+ cpu-offset = <0x8000>;
3233 reg = <0x10490000 0x1000>, <0x10480000 0x100>;
3334 };
3435
arch/arm/boot/dts/tegra-paz00.dts+3−3
@@ -46,11 +46,11 @@ · 45 unmodified lines
4646 };
4747
4848 serial@70006200 {
49− status = "disable";
49+ clock-frequency = <216000000>;
5050 };
5151
5252 serial@70006300 {
53− clock-frequency = <216000000>;
53+ status = "disable";
5454 };
5555
5656 serial@70006400 {
@@ -60,7 +60,7 @@ · 3 unmodified lines
6060 sdhci@c8000000 {
6161 cd-gpios = <&gpio 173 0>; /* gpio PV5 */
6262 wp-gpios = <&gpio 57 0>; /* gpio PH1 */
63− power-gpios = <&gpio 155 0>; /* gpio PT3 */
63+ power-gpios = <&gpio 169 0>; /* gpio PV1 */
6464 };
6565
6666 sdhci@c8000200 {
arch/arm/common/it8152.c+0−7
@@ -320,13 +320,6 @@ err0: · 319 unmodified lines
320320 return -EBUSY;
321321 }
322322
323−/*
324− * If we set up a device for bus mastering, we need to check the latency
325− * timer as we don't have even crappy BIOSes to set it properly.
326− * The implementation is from arch/i386/pci/i386.c
327− */
328−unsigned int pcibios_max_latency = 255;
329−
330323 /* ITE bridge requires setting latency timer to avoid early bus access
331324 termination by PCI bus master devices
332325 */
arch/arm/common/pl330.c+2−1
@@ -1502,12 +1502,13 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op) · 1501 unmodified lines
15021502 struct pl330_thread *thrd = ch_id;
15031503 struct pl330_dmac *pl330;
15041504 unsigned long flags;
1505− int ret = 0, active = thrd->req_running;
1505+ int ret = 0, active;
15061506
15071507 if (!thrd || thrd->free || thrd->dmac->state == DYING)
15081508 return -EINVAL;
15091509
15101510 pl330 = thrd->dmac;
1511+ active = thrd->req_running;
15111512
15121513 spin_lock_irqsave(&pl330->lock, flags);
15131514
arch/arm/include/asm/assembler.h+5−0
@@ -137,6 +137,11 @@ · 136 unmodified lines
137137 disable_irq
138138 .endm
139139
140+ .macro save_and_disable_irqs_notrace, oldcpsr
141+ mrs \oldcpsr, cpsr
142+ disable_irq_notrace
143+ .endm
144+
140145 /*
141146 * Restore interrupt state previously stored in a register. We don't
142147 * guarantee that this will preserve the flags.
arch/arm/include/asm/hardware/pl330.h+1−1
@@ -41,7 +41,7 @@ enum pl330_dstcachectrl { · 40 unmodified lines
4141 DCCTRL1, /* Bufferable only */
4242 DCCTRL2, /* Cacheable, but do not allocate */
4343 DCCTRL3, /* Cacheable and bufferable, but do not allocate */
44− DINVALID1 = 8,
44+ DINVALID1, /* AWCACHE = 0x1000 */
4545 DINVALID2,
4646 DCCTRL6, /* Cacheable write-through, allocate on writes only */
4747 DCCTRL7, /* Cacheable write-back, allocate on writes only */
arch/arm/include/asm/processor.h+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <asm/hw_breakpoint.h>
2323 #include <asm/ptrace.h>
2424 #include <asm/types.h>
25+#include <asm/system.h>
2526
2627 #ifdef __KERNEL__
2728 #define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \
arch/arm/include/asm/tlb.h+9−1
@@ -198,7 +198,15 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, · 197 unmodified lines
198198 unsigned long addr)
199199 {
200200 pgtable_page_dtor(pte);
201− tlb_add_flush(tlb, addr);
201+
202+ /*
203+ * With the classic ARM MMU, a pte page has two corresponding pmd
204+ * entries, each covering 1MB.
205+ */
206+ addr &= PMD_MASK;
207+ tlb_add_flush(tlb, addr + SZ_1M - PAGE_SIZE);
208+ tlb_add_flush(tlb, addr + SZ_1M);
209+
202210 tlb_remove_page(tlb, pte);
203211 }
204212
arch/arm/kernel/entry-armv.S+1−1
@@ -790,7 +790,7 @@ __kuser_cmpxchg64: @ 0xffff0f60 · 789 unmodified lines
790790 smp_dmb arm
791791 rsbs r0, r3, #0 @ set returned val and C flag
792792 ldmfd sp!, {r4, r5, r6, r7}
793− bx lr
793+ usr_ret lr
794794
795795 #elif !defined(CONFIG_SMP)
796796
arch/arm/kernel/perf_event_v7.c+28−0
@@ -469,6 +469,20 @@ static const unsigned armv7_a5_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] · 468 unmodified lines
469469 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
470470 },
471471 },
472+ [C(NODE)] = {
473+ [C(OP_READ)] = {
474+ [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
475+ [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
476+ },
477+ [C(OP_WRITE)] = {
478+ [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
479+ [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
480+ },
481+ [C(OP_PREFETCH)] = {
482+ [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
483+ [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
484+ },
485+ },
472486 };
473487
474488 /*
@@ -579,6 +593,20 @@ static const unsigned armv7_a15_perf_cache_map[PERF_COUNT_HW_CACHE_MAX] · 104 unmodified lines
579593 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
580594 },
581595 },
596+ [C(NODE)] = {
597+ [C(OP_READ)] = {
598+ [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
599+ [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
600+ },
601+ [C(OP_WRITE)] = {
602+ [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
603+ [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
604+ },
605+ [C(OP_PREFETCH)] = {
606+ [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
607+ [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
608+ },
609+ },
582610 };
583611
584612 /*
arch/arm/kernel/ptrace.c+13−4
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/perf_event.h>
2424 #include <linux/hw_breakpoint.h>
2525 #include <linux/regset.h>
26+#include <linux/audit.h>
2627
2728 #include <asm/pgtable.h>
2829 #include <asm/system.h>
@@ -699,10 +700,13 @@ static int vfp_set(struct task_struct *target, · 670 unmodified lines
699700 {
700701 int ret;
701702 struct thread_info *thread = task_thread_info(target);
702− struct vfp_hard_struct new_vfp = thread->vfpstate.hard;
703+ struct vfp_hard_struct new_vfp;
703704 const size_t user_fpregs_offset = offsetof(struct user_vfp, fpregs);
704705 const size_t user_fpscr_offset = offsetof(struct user_vfp, fpscr);
705706
707+ vfp_sync_hwstate(thread);
708+ new_vfp = thread->vfpstate.hard;
709+
706710 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
707711 &new_vfp.fpregs,
708712 user_fpregs_offset,
@@ -723,9 +727,8 @@ static int vfp_set(struct task_struct *target, · 14 unmodified lines
723727 if (ret)
724728 return ret;
725729
726− vfp_sync_hwstate(thread);
727− thread->vfpstate.hard = new_vfp;
728730 vfp_flush_hwstate(thread);
731+ thread->vfpstate.hard = new_vfp;
729732
730733 return 0;
731734 }
@@ -902,6 +905,12 @@ long arch_ptrace(struct task_struct *child, long request, · 170 unmodified lines
902905 return ret;
903906 }
904907
908+#ifdef __ARMEB__
909+#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB
910+#else
911+#define AUDIT_ARCH_NR AUDIT_ARCH_ARM
912+#endif
913+
905914 asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
906915 {
907916 unsigned long ip;
@@ -916,7 +925,7 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) · 8 unmodified lines
916925 if (!ip)
917926 audit_syscall_exit(regs);
918927 else
919− audit_syscall_entry(AUDIT_ARCH_ARMEB, scno, regs->ARM_r0,
928+ audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0,
920929 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);
921930
922931 if (!test_thread_flag(TIF_SYSCALL_TRACE))
arch/arm/kernel/signal.c+2−3
@@ -227,6 +227,8 @@ static int restore_vfp_context(struct vfp_sigframe __user *frame) · 226 unmodified lines
227227 if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)
228228 return -EINVAL;
229229
230+ vfp_flush_hwstate(thread);
231+
230232 /*
231233 * Copy the floating point registers. There can be unused
232234 * registers see asm/hwcap.h for details.
@@ -251,9 +253,6 @@ static int restore_vfp_context(struct vfp_sigframe __user *frame) · 18 unmodified lines
251253 __get_user_error(h->fpinst, &frame->ufp_exc.fpinst, err);
252254 __get_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err);
253255
254− if (!err)
255− vfp_flush_hwstate(thread);
256−
257256 return err ? -EFAULT : 0;
258257 }
259258
arch/arm/kernel/smp_twd.c+1−1
@@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = { · 128 unmodified lines
129129
130130 static int twd_cpufreq_init(void)
131131 {
132− if (!IS_ERR(twd_clk))
132+ if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))
133133 return cpufreq_register_notifier(&twd_cpufreq_nb,
134134 CPUFREQ_TRANSITION_NOTIFIER);
135135
arch/arm/kernel/traps.c+4−1
@@ -266,6 +266,7 @@ void die(const char *str, struct pt_regs *regs, int err) · 265 unmodified lines
266266 {
267267 struct thread_info *thread = current_thread_info();
268268 int ret;
269+ enum bug_trap_type bug_type = BUG_TRAP_TYPE_NONE;
269270
270271 oops_enter();
271272
@@ -273,7 +274,9 @@ void die(const char *str, struct pt_regs *regs, int err) · 1 unmodified line
273274 console_verbose();
274275 bust_spinlocks(1);
275276 if (!user_mode(regs))
276− report_bug(regs->ARM_pc, regs);
277+ bug_type = report_bug(regs->ARM_pc, regs);
278+ if (bug_type != BUG_TRAP_TYPE_NONE)
279+ str = "Oops - BUG";
277280 ret = __die(str, err, thread, regs);
278281
279282 if (regs && kexec_should_crash(thread->task))
arch/arm/kernel/vmlinux.lds.S+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <asm/page.h>
1111
1212 #define PROC_INFO \
13+ . = ALIGN(4); \
1314 VMLINUX_SYMBOL(__proc_info_begin) = .; \
1415 *(.proc.info.init) \
1516 VMLINUX_SYMBOL(__proc_info_end) = .;
arch/arm/mach-at91/at91rm9200_devices.c+1−1
@@ -83,7 +83,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} · 82 unmodified lines
8383 * USB Device (Gadget)
8484 * -------------------------------------------------------------------- */
8585
86−#ifdef CONFIG_USB_AT91
86+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
8787 static struct at91_udc_data udc_data;
8888
8989 static struct resource udc_resources[] = {
arch/arm/mach-at91/at91sam9260_devices.c+3−6
@@ -84,7 +84,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} · 83 unmodified lines
8484 * USB Device (Gadget)
8585 * -------------------------------------------------------------------- */
8686
87−#ifdef CONFIG_USB_AT91
87+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
8888 static struct at91_udc_data udc_data;
8989
9090 static struct resource udc_resources[] = {
@@ -1215,8 +1215,7 @@ void __init at91_add_device_serial(void) {} · 1124 unmodified lines
12151215 * CF/IDE
12161216 * -------------------------------------------------------------------- */
12171217
1218−#if defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE) || \
1219− defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE) || \
1218+#if defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE) || \
12201219 defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
12211220
12221221 static struct at91_cf_data cf0_data;
@@ -1313,10 +1312,8 @@ void __init at91_add_device_cf(struct at91_cf_data *data) · 90 unmodified lines
13131312 if (data->flags & AT91_CF_TRUE_IDE)
13141313 #if defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE)
13151314 pdev->name = "pata_at91";
1316−#elif defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE)
1317− pdev->name = "at91_ide";
13181315 #else
1319−#warning "board requires AT91_CF_TRUE_IDE: enable either at91_ide or pata_at91"
1316+#warning "board requires AT91_CF_TRUE_IDE: enable pata_at91"
13201317 #endif
13211318 else
13221319 pdev->name = "at91_cf";
arch/arm/mach-at91/at91sam9261_devices.c+1−1
@@ -87,7 +87,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} · 86 unmodified lines
8787 * USB Device (Gadget)
8888 * -------------------------------------------------------------------- */
8989
90−#ifdef CONFIG_USB_AT91
90+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
9191 static struct at91_udc_data udc_data;
9292
9393 static struct resource udc_resources[] = {
arch/arm/mach-at91/at91sam9263_devices.c+4−4
@@ -92,7 +92,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {} · 91 unmodified lines
9292 * USB Device (Gadget)
9393 * -------------------------------------------------------------------- */
9494
95−#ifdef CONFIG_USB_AT91
95+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
9696 static struct at91_udc_data udc_data;
9797
9898 static struct resource udc_resources[] = {
@@ -355,8 +355,8 @@ void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {} · 256 unmodified lines
355355 * Compact Flash (PCMCIA or IDE)
356356 * -------------------------------------------------------------------- */
357357
358−#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE) || \
359− defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE)
358+#if defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE) || \
359+ defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE)
360360
361361 static struct at91_cf_data cf0_data;
362362
@@ -450,7 +450,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data) · 87 unmodified lines
450450 at91_set_A_periph(AT91_PIN_PD9, 0); /* CFCE2 */
451451 at91_set_A_periph(AT91_PIN_PD14, 0); /* CFNRW */
452452
453− pdev->name = (data->flags & AT91_CF_TRUE_IDE) ? "at91_ide" : "at91_cf";
453+ pdev->name = (data->flags & AT91_CF_TRUE_IDE) ? "pata_at91" : "at91_cf";
454454 platform_device_register(pdev);
455455 }
456456 #else
arch/arm/mach-at91/include/mach/at91sam9_smc.h+29−0
@@ -18,6 +18,35 @@ · 17 unmodified lines
1818
1919 #include <mach/cpu.h>
2020
21+#ifndef __ASSEMBLY__
22+struct sam9_smc_config {
23+ /* Setup register */
24+ u8 ncs_read_setup;
25+ u8 nrd_setup;
26+ u8 ncs_write_setup;
27+ u8 nwe_setup;
28+
29+ /* Pulse register */
30+ u8 ncs_read_pulse;
31+ u8 nrd_pulse;
32+ u8 ncs_write_pulse;
33+ u8 nwe_pulse;
34+
35+ /* Cycle register */
36+ u16 read_cycle;
37+ u16 write_cycle;
38+
39+ /* Mode register */
40+ u32 mode;
41+ u8 tdf_cycles:4;
42+};
43+
44+extern void sam9_smc_configure(int id, int cs, struct sam9_smc_config *config);
45+extern void sam9_smc_read(int id, int cs, struct sam9_smc_config *config);
46+extern void sam9_smc_read_mode(int id, int cs, struct sam9_smc_config *config);
47+extern void sam9_smc_write_mode(int id, int cs, struct sam9_smc_config *config);
48+#endif
49+
2150 #define AT91_SMC_SETUP 0x00 /* Setup Register for CS n */
2251 #define AT91_SMC_NWESETUP (0x3f << 0) /* NWE Setup Length */
2352 #define AT91_SMC_NWESETUP_(x) ((x) << 0)
arch/arm/mach-at91/sam9_smc.c+71−5
@@ -2,6 +2,7 @@ · 1 unmodified line
22 * linux/arch/arm/mach-at91/sam9_smc.c
33 *
44 * Copyright (C) 2008 Andrew Victor
5+ * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
56 *
67 * This program is free software; you can redistribute it and/or modify
78 * it under the terms of the GNU General Public License version 2 as
@@ -22,7 +23,22 @@ · 14 unmodified lines
2223
2324 static void __iomem *smc_base_addr[2];
2425
25−static void __init sam9_smc_cs_configure(void __iomem *base, struct sam9_smc_config* config)
26+static void sam9_smc_cs_write_mode(void __iomem *base,
27+ struct sam9_smc_config *config)
28+{
29+ __raw_writel(config->mode
30+ | AT91_SMC_TDF_(config->tdf_cycles),
31+ base + AT91_SMC_MODE);
32+}
33+
34+void sam9_smc_write_mode(int id, int cs,
35+ struct sam9_smc_config *config)
36+{
37+ sam9_smc_cs_write_mode(AT91_SMC_CS(id, cs), config);
38+}
39+
40+static void sam9_smc_cs_configure(void __iomem *base,
41+ struct sam9_smc_config *config)
2642 {
2743
2844 /* Setup register */
@@ -45,16 +61,66 @@ static void __init sam9_smc_cs_configure(void __iomem *base, struct sam9_smc_con · 16 unmodified lines
4561 base + AT91_SMC_CYCLE);
4662
4763 /* Mode register */
48− __raw_writel(config->mode
49− | AT91_SMC_TDF_(config->tdf_cycles),
50− base + AT91_SMC_MODE);
64+ sam9_smc_cs_write_mode(base, config);
5165 }
5266
53−void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config)
67+void sam9_smc_configure(int id, int cs,
68+ struct sam9_smc_config *config)
5469 {
5570 sam9_smc_cs_configure(AT91_SMC_CS(id, cs), config);
5671 }
5772
73+static void sam9_smc_cs_read_mode(void __iomem *base,
74+ struct sam9_smc_config *config)
75+{
76+ u32 val = __raw_readl(base + AT91_SMC_MODE);
77+
78+ config->mode = (val & ~AT91_SMC_NWECYCLE);
79+ config->tdf_cycles = (val & AT91_SMC_NWECYCLE) >> 16 ;
80+}
81+
82+void sam9_smc_read_mode(int id, int cs,
83+ struct sam9_smc_config *config)
84+{
85+ sam9_smc_cs_read_mode(AT91_SMC_CS(id, cs), config);
86+}
87+
88+static void sam9_smc_cs_read(void __iomem *base,
89+ struct sam9_smc_config *config)
90+{
91+ u32 val;
92+
93+ /* Setup register */
94+ val = __raw_readl(base + AT91_SMC_SETUP);
95+
96+ config->nwe_setup = val & AT91_SMC_NWESETUP;
97+ config->ncs_write_setup = (val & AT91_SMC_NCS_WRSETUP) >> 8;
98+ config->nrd_setup = (val & AT91_SMC_NRDSETUP) >> 16;
99+ config->ncs_read_setup = (val & AT91_SMC_NCS_RDSETUP) >> 24;
100+
101+ /* Pulse register */
102+ val = __raw_readl(base + AT91_SMC_PULSE);
103+
104+ config->nwe_setup = val & AT91_SMC_NWEPULSE;
105+ config->ncs_write_pulse = (val & AT91_SMC_NCS_WRPULSE) >> 8;
106+ config->nrd_pulse = (val & AT91_SMC_NRDPULSE) >> 16;
107+ config->ncs_read_pulse = (val & AT91_SMC_NCS_RDPULSE) >> 24;
108+
109+ /* Cycle register */
110+ val = __raw_readl(base + AT91_SMC_CYCLE);
111+
112+ config->write_cycle = val & AT91_SMC_NWECYCLE;
113+ config->read_cycle = (val & AT91_SMC_NRDCYCLE) >> 16;
114+
115+ /* Mode register */
116+ sam9_smc_cs_read_mode(base, config);
117+}
118+
119+void sam9_smc_read(int id, int cs, struct sam9_smc_config *config)
120+{
121+ sam9_smc_cs_read(AT91_SMC_CS(id, cs), config);
122+}
123+
58124 void __init at91sam9_ioremap_smc(int id, u32 addr)
59125 {
60126 if (id > 1) {
arch/arm/mach-at91/sam9_smc.h+0−23
@@ -8,27 +8,4 @@ · 7 unmodified lines
88 * published by the Free Software Foundation.
99 */
1010
11−struct sam9_smc_config {
12− /* Setup register */
13− u8 ncs_read_setup;
14− u8 nrd_setup;
15− u8 ncs_write_setup;
16− u8 nwe_setup;
17−
18− /* Pulse register */
19− u8 ncs_read_pulse;
20− u8 nrd_pulse;
21− u8 ncs_write_pulse;
22− u8 nwe_pulse;
23−
24− /* Cycle register */
25− u16 read_cycle;
26− u16 write_cycle;
27−
28− /* Mode register */
29− u32 mode;
30− u8 tdf_cycles:4;
31−};
32−
33−extern void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config);
3411 extern void __init at91sam9_ioremap_smc(int id, u32 addr);
arch/arm/mach-bcmring/arch.c+1−1
@@ -194,6 +194,6 @@ MACHINE_START(BCMRING, "BCMRING") · 193 unmodified lines
194194 .init_early = bcmring_init_early,
195195 .init_irq = bcmring_init_irq,
196196 .timer = &bcmring_timer,
197− .init_machine = bcmring_init_machine
197+ .init_machine = bcmring_init_machine,
198198 .restart = bcmring_restart,
199199 MACHINE_END
arch/arm/mach-bcmring/dma.c+0−812
@@ -33,17 +33,11 @@ · 32 unmodified lines
3333
3434 #include <mach/timer.h>
3535
36−#include <linux/mm.h>
3736 #include <linux/pfn.h>
3837 #include <linux/atomic.h>
3938 #include <linux/sched.h>
4039 #include <mach/dma.h>
4140
42−/* I don't quite understand why dc4 fails when this is set to 1 and DMA is enabled */
43−/* especially since dc4 doesn't use kmalloc'd memory. */
44−
45−#define ALLOW_MAP_OF_KMALLOC_MEMORY 0
46−
4741 /* ---- Public Variables ------------------------------------------------- */
4842
4943 /* ---- Private Constants and Types -------------------------------------- */
@@ -53,58 +47,18 @@ · 3 unmodified lines
5347 #define CONTROLLER_FROM_HANDLE(handle) (((handle) >> 4) & 0x0f)
5448 #define CHANNEL_FROM_HANDLE(handle) ((handle) & 0x0f)
5549
56−#define DMA_MAP_DEBUG 0
57−
58−#if DMA_MAP_DEBUG
59−# define DMA_MAP_PRINT(fmt, args...) printk("%s: " fmt, __func__, ## args)
60−#else
61−# define DMA_MAP_PRINT(fmt, args...)
62−#endif
6350
6451 /* ---- Private Variables ------------------------------------------------ */
6552
6653 static DMA_Global_t gDMA;
6754 static struct proc_dir_entry *gDmaDir;
6855
69−static atomic_t gDmaStatMemTypeKmalloc = ATOMIC_INIT(0);
70−static atomic_t gDmaStatMemTypeVmalloc = ATOMIC_INIT(0);
71−static atomic_t gDmaStatMemTypeUser = ATOMIC_INIT(0);
72−static atomic_t gDmaStatMemTypeCoherent = ATOMIC_INIT(0);
73−
7456 #include "dma_device.c"
7557
7658 /* ---- Private Function Prototypes -------------------------------------- */
7759
7860 /* ---- Functions ------------------------------------------------------- */
7961
80−/****************************************************************************/
81−/**
82−* Displays information for /proc/dma/mem-type
83−*/
84−/****************************************************************************/
85−
86−static int dma_proc_read_mem_type(char *buf, char **start, off_t offset,
87− int count, int *eof, void *data)
88−{
89− int len = 0;
90−
91− len += sprintf(buf + len, "dma_map_mem statistics\n");
92− len +=
93− sprintf(buf + len, "coherent: %d\n",
94− atomic_read(&gDmaStatMemTypeCoherent));
95− len +=
96− sprintf(buf + len, "kmalloc: %d\n",
97− atomic_read(&gDmaStatMemTypeKmalloc));
98− len +=
99− sprintf(buf + len, "vmalloc: %d\n",
100− atomic_read(&gDmaStatMemTypeVmalloc));
101− len +=
102− sprintf(buf + len, "user: %d\n",
103− atomic_read(&gDmaStatMemTypeUser));
104−
105− return len;
106−}
107−
10862 /****************************************************************************/
10963 /**
11064 * Displays information for /proc/dma/channels
@@ -846,8 +800,6 @@ int dma_init(void) · 735 unmodified lines
846800 dma_proc_read_channels, NULL);
847801 create_proc_read_entry("devices", 0, gDmaDir,
848802 dma_proc_read_devices, NULL);
849− create_proc_read_entry("mem-type", 0, gDmaDir,
850− dma_proc_read_mem_type, NULL);
851803 }
852804
853805 out:
@@ -1565,767 +1517,3 @@ int dma_set_device_handler(DMA_Device_t dev, /* Device to set the callback for. · 711 unmodified lines
15651517 }
15661518
15671519 EXPORT_SYMBOL(dma_set_device_handler);
1568−
1569−/****************************************************************************/
1570−/**
1571−* Initializes a memory mapping structure
1572−*/
1573−/****************************************************************************/
1574−
1575−int dma_init_mem_map(DMA_MemMap_t *memMap)
1576−{
1577− memset(memMap, 0, sizeof(*memMap));
1578−
1579− sema_init(&memMap->lock, 1);
1580−
1581− return 0;
1582−}
1583−
1584−EXPORT_SYMBOL(dma_init_mem_map);
1585−
1586−/****************************************************************************/
1587−/**
1588−* Releases any memory currently being held by a memory mapping structure.
1589−*/
1590−/****************************************************************************/
1591−
1592−int dma_term_mem_map(DMA_MemMap_t *memMap)
1593−{
1594− down(&memMap->lock); /* Just being paranoid */
1595−
1596− /* Free up any allocated memory */
1597−
1598− up(&memMap->lock);
1599− memset(memMap, 0, sizeof(*memMap));
1600−
1601− return 0;
1602−}
1603−
1604−EXPORT_SYMBOL(dma_term_mem_map);
1605−
1606−/****************************************************************************/
1607−/**
1608−* Looks at a memory address and categorizes it.
1609−*
1610−* @return One of the values from the DMA_MemType_t enumeration.
1611−*/
1612−/****************************************************************************/
1613−
1614−DMA_MemType_t dma_mem_type(void *addr)
1615−{
1616− unsigned long addrVal = (unsigned long)addr;
1617−
1618− if (addrVal >= CONSISTENT_BASE) {
1619− /* NOTE: DMA virtual memory space starts at 0xFFxxxxxx */
1620−
1621− /* dma_alloc_xxx pages are physically and virtually contiguous */
1622−
1623− return DMA_MEM_TYPE_DMA;
1624− }
1625−
1626− /* Technically, we could add one more classification. Addresses between VMALLOC_END */
1627− /* and the beginning of the DMA virtual address could be considered to be I/O space. */
1628− /* Right now, nobody cares about this particular classification, so we ignore it. */
1629−
1630− if (is_vmalloc_addr(addr)) {
1631− /* Address comes from the vmalloc'd region. Pages are virtually */
1632− /* contiguous but NOT physically contiguous */
1633−
1634− return DMA_MEM_TYPE_VMALLOC;
1635− }
1636−
1637− if (addrVal >= PAGE_OFFSET) {
1638− /* PAGE_OFFSET is typically 0xC0000000 */
1639−
1640− /* kmalloc'd pages are physically contiguous */
1641−
1642− return DMA_MEM_TYPE_KMALLOC;
1643− }
1644−
1645− return DMA_MEM_TYPE_USER;
1646−}
1647−
1648−EXPORT_SYMBOL(dma_mem_type);
1649−
1650−/****************************************************************************/
1651−/**
1652−* Looks at a memory address and determines if we support DMA'ing to/from
1653−* that type of memory.
1654−*
1655−* @return boolean -
1656−* return value != 0 means dma supported
1657−* return value == 0 means dma not supported
1658−*/
1659−/****************************************************************************/
1660−
1661−int dma_mem_supports_dma(void *addr)
1662−{
1663− DMA_MemType_t memType = dma_mem_type(addr);
1664−
1665− return (memType == DMA_MEM_TYPE_DMA)
1666−#if ALLOW_MAP_OF_KMALLOC_MEMORY
1667− || (memType == DMA_MEM_TYPE_KMALLOC)
1668−#endif
1669− || (memType == DMA_MEM_TYPE_USER);
1670−}
1671−
1672−EXPORT_SYMBOL(dma_mem_supports_dma);
1673−
1674−/****************************************************************************/
1675−/**
1676−* Maps in a memory region such that it can be used for performing a DMA.
1677−*
1678−* @return
1679−*/
1680−/****************************************************************************/
1681−
1682−int dma_map_start(DMA_MemMap_t *memMap, /* Stores state information about the map */
1683− enum dma_data_direction dir /* Direction that the mapping will be going */
1684− ) {
1685− int rc;
1686−
1687− down(&memMap->lock);
1688−
1689− DMA_MAP_PRINT("memMap: %p\n", memMap);
1690−
1691− if (memMap->inUse) {
1692− printk(KERN_ERR "%s: memory map %p is already being used\n",
1693− __func__, memMap);
1694− rc = -EBUSY;
1695− goto out;
1696− }
1697−
1698− memMap->inUse = 1;
1699− memMap->dir = dir;
1700− memMap->numRegionsUsed = 0;
1701−
1702− rc = 0;
1703−
1704−out:
1705−
1706− DMA_MAP_PRINT("returning %d", rc);
1707−
1708− up(&memMap->lock);
1709−
1710− return rc;
1711−}
1712−
1713−EXPORT_SYMBOL(dma_map_start);
1714−
1715−/****************************************************************************/
1716−/**
1717−* Adds a segment of memory to a memory map. Each segment is both
1718−* physically and virtually contiguous.
1719−*
1720−* @return 0 on success, error code otherwise.
1721−*/
1722−/****************************************************************************/
1723−
1724−static int dma_map_add_segment(DMA_MemMap_t *memMap, /* Stores state information about the map */
1725− DMA_Region_t *region, /* Region that the segment belongs to */
1726− void *virtAddr, /* Virtual address of the segment being added */
1727− dma_addr_t physAddr, /* Physical address of the segment being added */
1728− size_t numBytes /* Number of bytes of the segment being added */
1729− ) {
1730− DMA_Segment_t *segment;
1731−
1732− DMA_MAP_PRINT("memMap:%p va:%p pa:0x%x #:%d\n", memMap, virtAddr,
1733− physAddr, numBytes);
1734−
1735− /* Sanity check */
1736−
1737− if (((unsigned long)virtAddr < (unsigned long)region->virtAddr)
1738− || (((unsigned long)virtAddr + numBytes)) >
1739− ((unsigned long)region->virtAddr + region->numBytes)) {
1740− printk(KERN_ERR
1741− "%s: virtAddr %p is outside region @ %p len: %d\n",
1742− __func__, virtAddr, region->virtAddr, region->numBytes);
1743− return -EINVAL;
1744− }
1745−
1746− if (region->numSegmentsUsed > 0) {
1747− /* Check to see if this segment is physically contiguous with the previous one */
1748−
1749− segment = &region->segment[region->numSegmentsUsed - 1];
1750−
1751− if ((segment->physAddr + segment->numBytes) == physAddr) {
1752− /* It is - just add on to the end */
1753−
1754− DMA_MAP_PRINT("appending %d bytes to last segment\n",
1755− numBytes);
1756−
1757− segment->numBytes += numBytes;
1758−
1759− return 0;
1760− }
1761− }
1762−
1763− /* Reallocate to hold more segments, if required. */
1764−
1765− if (region->numSegmentsUsed >= region->numSegmentsAllocated) {
1766− DMA_Segment_t *newSegment;
1767− size_t oldSize =
1768− region->numSegmentsAllocated * sizeof(*newSegment);
1769− int newAlloc = region->numSegmentsAllocated + 4;
1770− size_t newSize = newAlloc * sizeof(*newSegment);
1771−
1772− newSegment = kmalloc(newSize, GFP_KERNEL);
1773− if (newSegment == NULL) {
1774− return -ENOMEM;
1775− }
1776− memcpy(newSegment, region->segment, oldSize);
1777− memset(&((uint8_t *) newSegment)[oldSize], 0,
1778− newSize - oldSize);
1779− kfree(region->segment);
1780−
1781− region->numSegmentsAllocated = newAlloc;
1782− region->segment = newSegment;
1783− }
1784−
1785− segment = &region->segment[region->numSegmentsUsed];
1786− region->numSegmentsUsed++;
1787−
1788− segment->virtAddr = virtAddr;
1789− segment->physAddr = physAddr;
1790− segment->numBytes = numBytes;
1791−
1792− DMA_MAP_PRINT("returning success\n");
1793−
1794− return 0;
1795−}
1796−
1797−/****************************************************************************/
1798−/**
1799−* Adds a region of memory to a memory map. Each region is virtually
1800−* contiguous, but not necessarily physically contiguous.
1801−*
1802−* @return 0 on success, error code otherwise.
1803−*/
1804−/****************************************************************************/
1805−
1806−int dma_map_add_region(DMA_MemMap_t *memMap, /* Stores state information about the map */
1807− void *mem, /* Virtual address that we want to get a map of */
1808− size_t numBytes /* Number of bytes being mapped */
1809− ) {
1810− unsigned long addr = (unsigned long)mem;
1811− unsigned int offset;
1812− int rc = 0;
1813− DMA_Region_t *region;
1814− dma_addr_t physAddr;
1815−
1816− down(&memMap->lock);
1817−
1818− DMA_MAP_PRINT("memMap:%p va:%p #:%d\n", memMap, mem, numBytes);
1819−
1820− if (!memMap->inUse) {
1821− printk(KERN_ERR "%s: Make sure you call dma_map_start first\n",
1822− __func__);
1823− rc = -EINVAL;
1824− goto out;
1825− }
1826−
1827− /* Reallocate to hold more regions. */
1828−
1829− if (memMap->numRegionsUsed >= memMap->numRegionsAllocated) {
1830− DMA_Region_t *newRegion;
1831− size_t oldSize =
1832− memMap->numRegionsAllocated * sizeof(*newRegion);
1833− int newAlloc = memMap->numRegionsAllocated + 4;
1834− size_t newSize = newAlloc * sizeof(*newRegion);
1835−
1836− newRegion = kmalloc(newSize, GFP_KERNEL);
1837− if (newRegion == NULL) {
1838− rc = -ENOMEM;
1839− goto out;
1840− }
1841− memcpy(newRegion, memMap->region, oldSize);
1842− memset(&((uint8_t *) newRegion)[oldSize], 0, newSize - oldSize);
1843−
1844− kfree(memMap->region);
1845−
1846− memMap->numRegionsAllocated = newAlloc;
1847− memMap->region = newRegion;
1848− }
1849−
1850− region = &memMap->region[memMap->numRegionsUsed];
1851− memMap->numRegionsUsed++;
1852−
1853− offset = addr & ~PAGE_MASK;
1854−
1855− region->memType = dma_mem_type(mem);
1856− region->virtAddr = mem;
1857− region->numBytes = numBytes;
1858− region->numSegmentsUsed = 0;
1859− region->numLockedPages = 0;
1860− region->lockedPages = NULL;
1861−
1862− switch (region->memType) {
1863− case DMA_MEM_TYPE_VMALLOC:
1864− {
1865− atomic_inc(&gDmaStatMemTypeVmalloc);
1866−
1867− /* printk(KERN_ERR "%s: vmalloc'd pages are not supported\n", __func__); */
1868−
1869− /* vmalloc'd pages are not physically contiguous */
1870−
1871− rc = -EINVAL;
1872− break;
1873− }
1874−
1875− case DMA_MEM_TYPE_KMALLOC:
1876− {
1877− atomic_inc(&gDmaStatMemTypeKmalloc);
1878−
1879− /* kmalloc'd pages are physically contiguous, so they'll have exactly */
1880− /* one segment */
1881−
1882−#if ALLOW_MAP_OF_KMALLOC_MEMORY
1883− physAddr =
1884− dma_map_single(NULL, mem, numBytes, memMap->dir);
1885− rc = dma_map_add_segment(memMap, region, mem, physAddr,
1886− numBytes);
1887−#else
1888− rc = -EINVAL;
1889−#endif
1890− break;
1891− }
1892−
1893− case DMA_MEM_TYPE_DMA:
1894− {
1895− /* dma_alloc_xxx pages are physically contiguous */
1896−
1897− atomic_inc(&gDmaStatMemTypeCoherent);
1898−
1899− physAddr = (vmalloc_to_pfn(mem) << PAGE_SHIFT) + offset;
1900−
1901− dma_sync_single_for_cpu(NULL, physAddr, numBytes,
1902− memMap->dir);
1903− rc = dma_map_add_segment(memMap, region, mem, physAddr,
1904− numBytes);
1905− break;
1906− }
1907−
1908− case DMA_MEM_TYPE_USER:
1909− {
1910− size_t firstPageOffset;
1911− size_t firstPageSize;
1912− struct page **pages;
1913− struct task_struct *userTask;
1914−
1915− atomic_inc(&gDmaStatMemTypeUser);
1916−
1917−#if 1
1918− /* If the pages are user pages, then the dma_mem_map_set_user_task function */
1919− /* must have been previously called. */
1920−
1921− if (memMap->userTask == NULL) {
1922− printk(KERN_ERR
1923− "%s: must call dma_mem_map_set_user_task when using user-mode memory\n",
1924− __func__);
1925− return -EINVAL;
1926− }
1927−
1928− /* User pages need to be locked. */
1929−
1930− firstPageOffset =
1931− (unsigned long)region->virtAddr & (PAGE_SIZE - 1);
1932− firstPageSize = PAGE_SIZE - firstPageOffset;
1933−
1934− region->numLockedPages = (firstPageOffset
1935− + region->numBytes +
1936− PAGE_SIZE - 1) / PAGE_SIZE;
1937− pages =
1938− kmalloc(region->numLockedPages *
1939− sizeof(struct page *), GFP_KERNEL);
1940−
1941− if (pages == NULL) {
1942− region->numLockedPages = 0;
1943− return -ENOMEM;
1944− }
1945−
1946− userTask = memMap->userTask;
1947−
1948− down_read(&userTask->mm->mmap_sem);
1949− rc = get_user_pages(userTask, /* task */
1950− userTask->mm, /* mm */
1951− (unsigned long)region->virtAddr, /* start */
1952− region->numLockedPages, /* len */
1953− memMap->dir == DMA_FROM_DEVICE, /* write */
1954− 0, /* force */
1955− pages, /* pages (array of pointers to page) */
1956− NULL); /* vmas */
1957− up_read(&userTask->mm->mmap_sem);
1958−
1959− if (rc != region->numLockedPages) {
1960− kfree(pages);
1961− region->numLockedPages = 0;
1962−
1963− if (rc >= 0) {
1964− rc = -EINVAL;
1965− }
1966− } else {
1967− uint8_t *virtAddr = region->virtAddr;
1968− size_t bytesRemaining;
1969− int pageIdx;
1970−
1971− rc = 0; /* Since get_user_pages returns +ve number */
1972−
1973− region->lockedPages = pages;
1974−
1975− /* We've locked the user pages. Now we need to walk them and figure */
1976− /* out the physical addresses. */
1977−
1978− /* The first page may be partial */
1979−
1980− dma_map_add_segment(memMap,
1981− region,
1982− virtAddr,
1983− PFN_PHYS(page_to_pfn
1984− (pages[0])) +
1985− firstPageOffset,
1986− firstPageSize);
1987−
1988− virtAddr += firstPageSize;
1989− bytesRemaining =
1990− region->numBytes - firstPageSize;
1991−
1992− for (pageIdx = 1;
1993− pageIdx < region->numLockedPages;
1994− pageIdx++) {
1995− size_t bytesThisPage =
1996− (bytesRemaining >
1997− PAGE_SIZE ? PAGE_SIZE :
1998− bytesRemaining);
1999−
2000− DMA_MAP_PRINT
2001− ("pageIdx:%d pages[pageIdx]=%p pfn=%u phys=%u\n",
2002− pageIdx, pages[pageIdx],
2003− page_to_pfn(pages[pageIdx]),
2004− PFN_PHYS(page_to_pfn
2005− (pages[pageIdx])));
2006−
2007− dma_map_add_segment(memMap,
2008− region,
2009− virtAddr,
2010− PFN_PHYS(page_to_pfn
2011− (pages
2012− [pageIdx])),
2013− bytesThisPage);
2014−
2015− virtAddr += bytesThisPage;
2016− bytesRemaining -= bytesThisPage;
2017− }
2018− }
2019−#else
2020− printk(KERN_ERR
2021− "%s: User mode pages are not yet supported\n",
2022− __func__);
2023−
2024− /* user pages are not physically contiguous */
2025−
2026− rc = -EINVAL;
2027−#endif
2028− break;
2029− }
2030−
2031− default:
2032− {
2033− printk(KERN_ERR "%s: Unsupported memory type: %d\n",
2034− __func__, region->memType);
2035−
2036− rc = -EINVAL;
2037− break;
2038− }
2039− }
2040−
2041− if (rc != 0) {
2042− memMap->numRegionsUsed--;
2043− }
2044−
2045−out:
2046−
2047− DMA_MAP_PRINT("returning %d\n", rc);
2048−
2049− up(&memMap->lock);
2050−
2051− return rc;
2052−}
2053−
2054−EXPORT_SYMBOL(dma_map_add_segment);
2055−
2056−/****************************************************************************/
2057−/**
2058−* Maps in a memory region such that it can be used for performing a DMA.
2059−*
2060−* @return 0 on success, error code otherwise.
2061−*/
2062−/****************************************************************************/
2063−
2064−int dma_map_mem(DMA_MemMap_t *memMap, /* Stores state information about the map */
2065− void *mem, /* Virtual address that we want to get a map of */
2066− size_t numBytes, /* Number of bytes being mapped */
2067− enum dma_data_direction dir /* Direction that the mapping will be going */
2068− ) {
2069− int rc;
2070−
2071− rc = dma_map_start(memMap, dir);
2072− if (rc == 0) {
2073− rc = dma_map_add_region(memMap, mem, numBytes);
2074− if (rc < 0) {
2075− /* Since the add fails, this function will fail, and the caller won't */
2076− /* call unmap, so we need to do it here. */
2077−
2078− dma_unmap(memMap, 0);
2079− }
2080− }
2081−
2082− return rc;
2083−}
2084−
2085−EXPORT_SYMBOL(dma_map_mem);
2086−
2087−/****************************************************************************/
2088−/**
2089−* Setup a descriptor ring for a given memory map.
2090−*
2091−* It is assumed that the descriptor ring has already been initialized, and
2092−* this routine will only reallocate a new descriptor ring if the existing
2093−* one is too small.
2094−*
2095−* @return 0 on success, error code otherwise.
2096−*/
2097−/****************************************************************************/
2098−
2099−int dma_map_create_descriptor_ring(DMA_Device_t dev, /* DMA device (where the ring is stored) */
2100− DMA_MemMap_t *memMap, /* Memory map that will be used */
2101− dma_addr_t devPhysAddr /* Physical address of device */
2102− ) {
2103− int rc;
2104− int numDescriptors;
2105− DMA_DeviceAttribute_t *devAttr;
2106− DMA_Region_t *region;
2107− DMA_Segment_t *segment;
2108− dma_addr_t srcPhysAddr;
2109− dma_addr_t dstPhysAddr;
2110− int regionIdx;
2111− int segmentIdx;
2112−
2113− devAttr = &DMA_gDeviceAttribute[dev];
2114−
2115− down(&memMap->lock);
2116−
2117− /* Figure out how many descriptors we need */
2118−
2119− numDescriptors = 0;
2120− for (regionIdx = 0; regionIdx < memMap->numRegionsUsed; regionIdx++) {
2121− region = &memMap->region[regionIdx];
2122−
2123− for (segmentIdx = 0; segmentIdx < region->numSegmentsUsed;
2124− segmentIdx++) {
2125− segment = &region->segment[segmentIdx];
2126−
2127− if (memMap->dir == DMA_TO_DEVICE) {
2128− srcPhysAddr = segment->physAddr;
2129− dstPhysAddr = devPhysAddr;
2130− } else {
2131− srcPhysAddr = devPhysAddr;
2132− dstPhysAddr = segment->physAddr;
2133− }
2134−
2135− rc =
2136− dma_calculate_descriptor_count(dev, srcPhysAddr,
2137− dstPhysAddr,
2138− segment->
2139− numBytes);
2140− if (rc < 0) {
2141− printk(KERN_ERR
2142− "%s: dma_calculate_descriptor_count failed: %d\n",
2143− __func__, rc);
2144− goto out;
2145− }
2146− numDescriptors += rc;
2147− }
2148− }
2149−
2150− /* Adjust the size of the ring, if it isn't big enough */
2151−
2152− if (numDescriptors > devAttr->ring.descriptorsAllocated) {
2153− dma_free_descriptor_ring(&devAttr->ring);
2154− rc =
2155− dma_alloc_descriptor_ring(&devAttr->ring,
2156− numDescriptors);
2157− if (rc < 0) {
2158− printk(KERN_ERR
2159− "%s: dma_alloc_descriptor_ring failed: %d\n",
2160− __func__, rc);
2161− goto out;
2162− }
2163− } else {
2164− rc =
2165− dma_init_descriptor_ring(&devAttr->ring,
2166− numDescriptors);
2167− if (rc < 0) {
2168− printk(KERN_ERR
2169− "%s: dma_init_descriptor_ring failed: %d\n",
2170− __func__, rc);
2171− goto out;
2172− }
2173− }
2174−
2175− /* Populate the descriptors */
2176−
2177− for (regionIdx = 0; regionIdx < memMap->numRegionsUsed; regionIdx++) {
2178− region = &memMap->region[regionIdx];
2179−
2180− for (segmentIdx = 0; segmentIdx < region->numSegmentsUsed;
2181− segmentIdx++) {
2182− segment = &region->segment[segmentIdx];
2183−
2184− if (memMap->dir == DMA_TO_DEVICE) {
2185− srcPhysAddr = segment->physAddr;
2186− dstPhysAddr = devPhysAddr;
2187− } else {
2188− srcPhysAddr = devPhysAddr;
2189− dstPhysAddr = segment->physAddr;
2190− }
2191−
2192− rc =
2193− dma_add_descriptors(&devAttr->ring, dev,
2194− srcPhysAddr, dstPhysAddr,
2195− segment->numBytes);
2196− if (rc < 0) {
2197− printk(KERN_ERR
2198− "%s: dma_add_descriptors failed: %d\n",
2199− __func__, rc);
2200− goto out;
2201− }
2202− }
2203− }
2204−
2205− rc = 0;
2206−
2207−out:
2208−
2209− up(&memMap->lock);
2210− return rc;
2211−}
2212−
2213−EXPORT_SYMBOL(dma_map_create_descriptor_ring);
2214−
2215−/****************************************************************************/
2216−/**
2217−* Maps in a memory region such that it can be used for performing a DMA.
2218−*
2219−* @return
2220−*/
2221−/****************************************************************************/
2222−
2223−int dma_unmap(DMA_MemMap_t *memMap, /* Stores state information about the map */
2224− int dirtied /* non-zero if any of the pages were modified */
2225− ) {
2226−
2227− int rc = 0;
2228− int regionIdx;
2229− int segmentIdx;
2230− DMA_Region_t *region;
2231− DMA_Segment_t *segment;
2232−
2233− down(&memMap->lock);
2234−
2235− for (regionIdx = 0; regionIdx < memMap->numRegionsUsed; regionIdx++) {
2236− region = &memMap->region[regionIdx];
2237−
2238− for (segmentIdx = 0; segmentIdx < region->numSegmentsUsed;
2239− segmentIdx++) {
2240− segment = &region->segment[segmentIdx];
2241−
2242− switch (region->memType) {
2243− case DMA_MEM_TYPE_VMALLOC:
2244− {
2245− printk(KERN_ERR
2246− "%s: vmalloc'd pages are not yet supported\n",
2247− __func__);
2248− rc = -EINVAL;
2249− goto out;
2250− }
2251−
2252− case DMA_MEM_TYPE_KMALLOC:
2253− {
2254−#if ALLOW_MAP_OF_KMALLOC_MEMORY
2255− dma_unmap_single(NULL,
2256− segment->physAddr,
2257− segment->numBytes,
2258− memMap->dir);
2259−#endif
2260− break;
2261− }
2262−
2263− case DMA_MEM_TYPE_DMA:
2264− {
2265− dma_sync_single_for_cpu(NULL,
2266− segment->
2267− physAddr,
2268− segment->
2269− numBytes,
2270− memMap->dir);
2271− break;
2272− }
2273−
2274− case DMA_MEM_TYPE_USER:
2275− {
2276− /* Nothing to do here. */
2277−
2278− break;
2279− }
2280−
2281− default:
2282− {
2283− printk(KERN_ERR
2284− "%s: Unsupported memory type: %d\n",
2285− __func__, region->memType);
2286− rc = -EINVAL;
2287− goto out;
2288− }
2289− }
2290−
2291− segment->virtAddr = NULL;
2292− segment->physAddr = 0;
2293− segment->numBytes = 0;
2294− }
2295−
2296− if (region->numLockedPages > 0) {
2297− int pageIdx;
2298−
2299− /* Some user pages were locked. We need to go and unlock them now. */
2300−
2301− for (pageIdx = 0; pageIdx < region->numLockedPages;
2302− pageIdx++) {
2303− struct page *page =
2304− region->lockedPages[pageIdx];
2305−
2306− if (memMap->dir == DMA_FROM_DEVICE) {
2307− SetPageDirty(page);
2308− }
2309− page_cache_release(page);
2310− }
2311− kfree(region->lockedPages);
2312− region->numLockedPages = 0;
2313− region->lockedPages = NULL;
2314− }
2315−
2316− region->memType = DMA_MEM_TYPE_NONE;
2317− region->virtAddr = NULL;
2318− region->numBytes = 0;
2319− region->numSegmentsUsed = 0;
2320− }
2321− memMap->userTask = NULL;
2322− memMap->numRegionsUsed = 0;
2323− memMap->inUse = 0;
2324−
2325−out:
2326− up(&memMap->lock);
2327−
2328− return rc;
2329−}
2330−
2331−EXPORT_SYMBOL(dma_unmap);
arch/arm/mach-bcmring/include/mach/dma.h+0−196
@@ -26,15 +26,9 @@ · 25 unmodified lines
2626 /* ---- Include Files ---------------------------------------------------- */
2727
2828 #include <linux/kernel.h>
29−#include <linux/wait.h>
3029 #include <linux/semaphore.h>
3130 #include <csp/dmacHw.h>
3231 #include <mach/timer.h>
33−#include <linux/scatterlist.h>
34−#include <linux/dma-mapping.h>
35−#include <linux/mm.h>
36−#include <linux/vmalloc.h>
37−#include <linux/pagemap.h>
3832
3933 /* ---- Constants and Types ---------------------------------------------- */
4034
@@ -111,78 +105,6 @@ typedef struct { · 70 unmodified lines
111105
112106 } DMA_DescriptorRing_t;
113107
114−/****************************************************************************
115−*
116−* The DMA_MemType_t and DMA_MemMap_t are helper structures used to setup
117−* DMA chains from a variety of memory sources.
118−*
119−*****************************************************************************/
120−
121−#define DMA_MEM_MAP_MIN_SIZE 4096 /* Pages less than this size are better */
122− /* off not being DMA'd. */
123−
124−typedef enum {
125− DMA_MEM_TYPE_NONE, /* Not a valid setting */
126− DMA_MEM_TYPE_VMALLOC, /* Memory came from vmalloc call */
127− DMA_MEM_TYPE_KMALLOC, /* Memory came from kmalloc call */
128− DMA_MEM_TYPE_DMA, /* Memory came from dma_alloc_xxx call */
129− DMA_MEM_TYPE_USER, /* Memory came from user space. */
130−
131−} DMA_MemType_t;
132−
133−/* A segment represents a physically and virtually contiguous chunk of memory. */
134−/* i.e. each segment can be DMA'd */
135−/* A user of the DMA code will add memory regions. Each region may need to be */
136−/* represented by one or more segments. */
137−
138−typedef struct {
139− void *virtAddr; /* Virtual address used for this segment */
140− dma_addr_t physAddr; /* Physical address this segment maps to */
141− size_t numBytes; /* Size of the segment, in bytes */
142−
143−} DMA_Segment_t;
144−
145−/* A region represents a virtually contiguous chunk of memory, which may be */
146−/* made up of multiple segments. */
147−
148−typedef struct {
149− DMA_MemType_t memType;
150− void *virtAddr;
151− size_t numBytes;
152−
153− /* Each region (virtually contiguous) consists of one or more segments. Each */
154− /* segment is virtually and physically contiguous. */
155−
156− int numSegmentsUsed;
157− int numSegmentsAllocated;
158− DMA_Segment_t *segment;
159−
160− /* When a region corresponds to user memory, we need to lock all of the pages */
161− /* down before we can figure out the physical addresses. The lockedPage array contains */
162− /* the pages that were locked, and which subsequently need to be unlocked once the */
163− /* memory is unmapped. */
164−
165− unsigned numLockedPages;
166− struct page **lockedPages;
167−
168−} DMA_Region_t;
169−
170−typedef struct {
171− int inUse; /* Is this mapping currently being used? */
172− struct semaphore lock; /* Acquired when using this structure */
173− enum dma_data_direction dir; /* Direction this transfer is intended for */
174−
175− /* In the event that we're mapping user memory, we need to know which task */
176− /* the memory is for, so that we can obtain the correct mm locks. */
177−
178− struct task_struct *userTask;
179−
180− int numRegionsUsed;
181− int numRegionsAllocated;
182− DMA_Region_t *region;
183−
184−} DMA_MemMap_t;
185−
186108 /****************************************************************************
187109 *
188110 * The DMA_DeviceAttribute_t contains information which describes a
@@ -568,124 +490,6 @@ int dma_alloc_double_dst_descriptors(DMA_Handle_t handle, /* DMA Handle */ · 379 unmodified lines
568490 size_t numBytes /* Number of bytes in each destination buffer */
569491 );
570492
571−/****************************************************************************/
572−/**
573−* Initializes a DMA_MemMap_t data structure
574−*/
575−/****************************************************************************/
576−
577−int dma_init_mem_map(DMA_MemMap_t *memMap /* Stores state information about the map */
578− );
579−
580−/****************************************************************************/
581−/**
582−* Releases any memory currently being held by a memory mapping structure.
583−*/
584−/****************************************************************************/
585−
586−int dma_term_mem_map(DMA_MemMap_t *memMap /* Stores state information about the map */
587− );
588−
589−/****************************************************************************/
590−/**
591−* Looks at a memory address and categorizes it.
592−*
593−* @return One of the values from the DMA_MemType_t enumeration.
594−*/
595−/****************************************************************************/
596−
597−DMA_MemType_t dma_mem_type(void *addr);
598−
599−/****************************************************************************/
600−/**
601−* Sets the process (aka userTask) associated with a mem map. This is
602−* required if user-mode segments will be added to the mapping.
603−*/
604−/****************************************************************************/
605−
606−static inline void dma_mem_map_set_user_task(DMA_MemMap_t *memMap,
607− struct task_struct *task)
608−{
609− memMap->userTask = task;
610−}
611−
612−/****************************************************************************/
613−/**
614−* Looks at a memory address and determines if we support DMA'ing to/from
615−* that type of memory.
616−*
617−* @return boolean -
618−* return value != 0 means dma supported
619−* return value == 0 means dma not supported
620−*/
621−/****************************************************************************/
622−
623−int dma_mem_supports_dma(void *addr);
624−
625−/****************************************************************************/
626−/**
627−* Initializes a memory map for use. Since this function acquires a
628−* sempaphore within the memory map, it is VERY important that dma_unmap
629−* be called when you're finished using the map.
630−*/
631−/****************************************************************************/
632−
633−int dma_map_start(DMA_MemMap_t *memMap, /* Stores state information about the map */
634− enum dma_data_direction dir /* Direction that the mapping will be going */
635− );
636−
637−/****************************************************************************/
638−/**
639−* Adds a segment of memory to a memory map.
640−*
641−* @return 0 on success, error code otherwise.
642−*/
643−/****************************************************************************/
644−
645−int dma_map_add_region(DMA_MemMap_t *memMap, /* Stores state information about the map */
646− void *mem, /* Virtual address that we want to get a map of */
647− size_t numBytes /* Number of bytes being mapped */
648− );
649−
650−/****************************************************************************/
651−/**
652−* Creates a descriptor ring from a memory mapping.
653−*
654−* @return 0 on success, error code otherwise.
655−*/
656−/****************************************************************************/
657−
658−int dma_map_create_descriptor_ring(DMA_Device_t dev, /* DMA device (where the ring is stored) */
659− DMA_MemMap_t *memMap, /* Memory map that will be used */
660− dma_addr_t devPhysAddr /* Physical address of device */
661− );
662−
663−/****************************************************************************/
664−/**
665−* Maps in a memory region such that it can be used for performing a DMA.
666−*
667−* @return
668−*/
669−/****************************************************************************/
670−
671−int dma_map_mem(DMA_MemMap_t *memMap, /* Stores state information about the map */
672− void *addr, /* Virtual address that we want to get a map of */
673− size_t count, /* Number of bytes being mapped */
674− enum dma_data_direction dir /* Direction that the mapping will be going */
675− );
676−
677−/****************************************************************************/
678−/**
679−* Maps in a memory region such that it can be used for performing a DMA.
680−*
681−* @return
682−*/
683−/****************************************************************************/
684−
685−int dma_unmap(DMA_MemMap_t *memMap, /* Stores state information about the map */
686− int dirtied /* non-zero if any of the pages were modified */
687− );
688−
689493 /****************************************************************************/
690494 /**
691495 * Initiates a transfer when the descriptors have already been setup.
arch/arm/mach-davinci/board-da850-evm.c+1−1
@@ -44,7 +44,7 @@ · 43 unmodified lines
4444 #include <mach/aemif.h>
4545 #include <mach/spi.h>
4646
47−#define DA850_EVM_PHY_ID "0:00"
47+#define DA850_EVM_PHY_ID "davinci_mdio-0:00"
4848 #define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
4949 #define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
5050
arch/arm/mach-davinci/board-dm365-evm.c+1−1
@@ -54,7 +54,7 @@ static inline int have_tvp7002(void) · 53 unmodified lines
5454 return 0;
5555 }
5656
57−#define DM365_EVM_PHY_ID "0:01"
57+#define DM365_EVM_PHY_ID "davinci_mdio-0:01"
5858 /*
5959 * A MAX-II CPLD is used for various board control functions.
6060 */
arch/arm/mach-davinci/board-dm644x-evm.c+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #include <mach/usb.h>
4141 #include <mach/aemif.h>
4242
43−#define DM644X_EVM_PHY_ID "0:01"
43+#define DM644X_EVM_PHY_ID "davinci_mdio-0:01"
4444 #define LXT971_PHY_ID (0x001378e2)
4545 #define LXT971_PHY_MASK (0xfffffff0)
4646
arch/arm/mach-davinci/board-dm646x-evm.c+1−1
@@ -736,7 +736,7 @@ static struct davinci_uart_config uart_config __initdata = { · 735 unmodified lines
736736 .enabled_uarts = (1 << 0),
737737 };
738738
739−#define DM646X_EVM_PHY_ID "0:01"
739+#define DM646X_EVM_PHY_ID "davinci_mdio-0:01"
740740 /*
741741 * The following EDMA channels/slots are not being used by drivers (for
742742 * example: Timer, GPIO, UART events etc) on dm646x, hence they are being
arch/arm/mach-davinci/board-neuros-osd2.c+1−1
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939 #include <mach/mmc.h>
4040 #include <mach/usb.h>
4141
42−#define NEUROS_OSD2_PHY_ID "0:01"
42+#define NEUROS_OSD2_PHY_ID "davinci_mdio-0:01"
4343 #define LXT971_PHY_ID 0x001378e2
4444 #define LXT971_PHY_MASK 0xfffffff0
4545
arch/arm/mach-davinci/board-omapl138-hawk.c+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include <mach/da8xx.h>
2222 #include <mach/mux.h>
2323
24−#define HAWKBOARD_PHY_ID "0:07"
24+#define HAWKBOARD_PHY_ID "davinci_mdio-0:07"
2525 #define DA850_HAWK_MMCSD_CD_PIN GPIO_TO_PIN(3, 12)
2626 #define DA850_HAWK_MMCSD_WP_PIN GPIO_TO_PIN(3, 13)
2727
arch/arm/mach-davinci/board-sffsdr.c+1−1
@@ -42,7 +42,7 @@ · 41 unmodified lines
4242 #include <mach/mux.h>
4343 #include <mach/usb.h>
4444
45−#define SFFSDR_PHY_ID "0:01"
45+#define SFFSDR_PHY_ID "davinci_mdio-0:01"
4646 static struct mtd_partition davinci_sffsdr_nandflash_partition[] = {
4747 /* U-Boot Environment: Block 0
4848 * UBL: Block 1
arch/arm/mach-davinci/da850.c+0−32
@@ -153,34 +153,6 @@ static struct clk pll1_sysclk3 = { · 152 unmodified lines
153153 .div_reg = PLLDIV3,
154154 };
155155
156−static struct clk pll1_sysclk4 = {
157− .name = "pll1_sysclk4",
158− .parent = &pll1_clk,
159− .flags = CLK_PLL,
160− .div_reg = PLLDIV4,
161−};
162−
163−static struct clk pll1_sysclk5 = {
164− .name = "pll1_sysclk5",
165− .parent = &pll1_clk,
166− .flags = CLK_PLL,
167− .div_reg = PLLDIV5,
168−};
169−
170−static struct clk pll1_sysclk6 = {
171− .name = "pll0_sysclk6",
172− .parent = &pll0_clk,
173− .flags = CLK_PLL,
174− .div_reg = PLLDIV6,
175−};
176−
177−static struct clk pll1_sysclk7 = {
178− .name = "pll1_sysclk7",
179− .parent = &pll1_clk,
180− .flags = CLK_PLL,
181− .div_reg = PLLDIV7,
182−};
183−
184156 static struct clk i2c0_clk = {
185157 .name = "i2c0",
186158 .parent = &pll0_aux_clk,
@@ -397,10 +369,6 @@ static struct clk_lookup da850_clks[] = { · 210 unmodified lines
397369 CLK(NULL, "pll1_aux", &pll1_aux_clk),
398370 CLK(NULL, "pll1_sysclk2", &pll1_sysclk2),
399371 CLK(NULL, "pll1_sysclk3", &pll1_sysclk3),
400− CLK(NULL, "pll1_sysclk4", &pll1_sysclk4),
401− CLK(NULL, "pll1_sysclk5", &pll1_sysclk5),
402− CLK(NULL, "pll1_sysclk6", &pll1_sysclk6),
403− CLK(NULL, "pll1_sysclk7", &pll1_sysclk7),
404372 CLK("i2c_davinci.1", NULL, &i2c0_clk),
405373 CLK(NULL, "timer0", &timerp64_0_clk),
406374 CLK("watchdog", NULL, &timerp64_1_clk),
arch/arm/mach-dove/common.c+2−1
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <asm/mach/arch.h>
2929 #include <linux/irq.h>
3030 #include <plat/time.h>
31+#include <plat/ehci-orion.h>
3132 #include <plat/common.h>
3233 #include <plat/addr-map.h>
3334 #include "common.h"
@@ -71,7 +72,7 @@ void __init dove_map_io(void) · 37 unmodified lines
7172 ****************************************************************************/
7273 void __init dove_ehci0_init(void)
7374 {
74− orion_ehci_init(DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0);
75+ orion_ehci_init(DOVE_USB0_PHYS_BASE, IRQ_DOVE_USB0, EHCI_PHY_NA);
7576 }
7677
7778 /*****************************************************************************
arch/arm/mach-ep93xx/vision_ep9307.c+3−1
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <mach/hardware.h>
3333 #include <mach/fb.h>
3434 #include <mach/ep93xx_spi.h>
35+#include <mach/gpio-ep93xx.h>
3536
3637 #include <asm/mach-types.h>
3738 #include <asm/mach/map.h>
@@ -153,7 +154,6 @@ static struct i2c_board_info vision_i2c_info[] __initdata = { · 115 unmodified lines
153154 }, {
154155 I2C_BOARD_INFO("pca9539", 0x74),
155156 .platform_data = &pca953x_74_gpio_data,
156− .irq = gpio_to_irq(EP93XX_GPIO_LINE_F(7)),
157157 }, {
158158 I2C_BOARD_INFO("pca9539", 0x75),
159159 .platform_data = &pca953x_75_gpio_data,
@@ -348,6 +348,8 @@ static void __init vision_init_machine(void) · 188 unmodified lines
348348 "pca9539:74"))
349349 pr_warn("cannot request interrupt gpio for pca9539:74\n");
350350
351+ vision_i2c_info[1].irq = gpio_to_irq(EP93XX_GPIO_LINE_F(7));
352+
351353 ep93xx_register_i2c(&vision_i2c_gpio_data, vision_i2c_info,
352354 ARRAY_SIZE(vision_i2c_info));
353355 ep93xx_register_spi(&vision_spi_master, vision_spi_board_info,
arch/arm/mach-exynos/clock-exynos4210.c+2−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232
3333 #include "common.h"
3434
35+#ifdef CONFIG_PM_SLEEP
3536 static struct sleep_save exynos4210_clock_save[] = {
3637 SAVE_ITEM(S5P_CLKSRC_IMAGE),
3738 SAVE_ITEM(S5P_CLKSRC_LCD1),
@@ -42,6 +43,7 @@ static struct sleep_save exynos4210_clock_save[] = { · 4 unmodified lines
4243 SAVE_ITEM(S5P_CLKGATE_IP_LCD1),
4344 SAVE_ITEM(S5P_CLKGATE_IP_PERIR_4210),
4445 };
46+#endif
4547
4648 static struct clksrc_clk *sysclks[] = {
4749 /* nothing here yet */
arch/arm/mach-exynos/clock-exynos4212.c+2−0
@@ -32,12 +32,14 @@ · 31 unmodified lines
3232
3333 #include "common.h"
3434
35+#ifdef CONFIG_PM_SLEEP
3536 static struct sleep_save exynos4212_clock_save[] = {
3637 SAVE_ITEM(S5P_CLKSRC_IMAGE),
3738 SAVE_ITEM(S5P_CLKDIV_IMAGE),
3839 SAVE_ITEM(S5P_CLKGATE_IP_IMAGE_4212),
3940 SAVE_ITEM(S5P_CLKGATE_IP_PERIR_4212),
4041 };
42+#endif
4143
4244 static struct clk *clk_src_mpll_user_list[] = {
4345 [0] = &clk_fin_mpll,
arch/arm/mach-exynos/clock.c+2−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030
3131 #include "common.h"
3232
33+#ifdef CONFIG_PM_SLEEP
3334 static struct sleep_save exynos4_clock_save[] = {
3435 SAVE_ITEM(S5P_CLKDIV_LEFTBUS),
3536 SAVE_ITEM(S5P_CLKGATE_IP_LEFTBUS),
@@ -93,6 +94,7 @@ static struct sleep_save exynos4_clock_save[] = { · 57 unmodified lines
9394 SAVE_ITEM(S5P_CLKGATE_SCLKCPU),
9495 SAVE_ITEM(S5P_CLKGATE_IP_CPU),
9596 };
97+#endif
9698
9799 struct clk clk_sclk_hdmi27m = {
98100 .name = "sclk_hdmi27m",
arch/arm/mach-exynos/mach-exynos4-dt.c+6−2
@@ -15,11 +15,13 @@ · 14 unmodified lines
1515 #include <linux/serial_core.h>
1616
1717 #include <asm/mach/arch.h>
18+#include <asm/hardware/gic.h>
1819 #include <mach/map.h>
1920
2021 #include <plat/cpu.h>
2122 #include <plat/regs-serial.h>
22−#include <plat/exynos4.h>
23+
24+#include "common.h"
2325
2426 /*
2527 * The following lookup table is used to override device names when devices
@@ -60,7 +62,7 @@ static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = { · 34 unmodified lines
6062
6163 static void __init exynos4210_dt_map_io(void)
6264 {
63− s5p_init_io(NULL, 0, S5P_VA_CHIPID);
65+ exynos_init_io(NULL, 0);
6466 s3c24xx_init_clocks(24000000);
6567 }
6668
@@ -79,7 +81,9 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") · 12 unmodified lines
7981 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
8082 .init_irq = exynos4_init_irq,
8183 .map_io = exynos4210_dt_map_io,
84+ .handle_irq = gic_handle_irq,
8285 .init_machine = exynos4210_dt_machine_init,
8386 .timer = &exynos4_timer,
8487 .dt_compat = exynos4210_dt_compat,
88+ .restart = exynos4_restart,
8589 MACHINE_END
arch/arm/mach-exynos/mach-nuri.c+4−4
@@ -220,14 +220,14 @@ static struct s3c_fb_pd_win nuri_fb_win0 = { · 219 unmodified lines
220220 .lower_margin = 1,
221221 .hsync_len = 48,
222222 .vsync_len = 3,
223− .xres = 1280,
224− .yres = 800,
223+ .xres = 1024,
224+ .yres = 600,
225225 .refresh = 60,
226226 },
227227 .max_bpp = 24,
228228 .default_bpp = 16,
229− .virtual_x = 1280,
230− .virtual_y = 800,
229+ .virtual_x = 1024,
230+ .virtual_y = 2 * 600,
231231 };
232232
233233 static struct s3c_fb_platdata nuri_fb_pdata __initdata = {
arch/arm/mach-exynos/mach-universal_c210.c+1−1
@@ -910,7 +910,7 @@ static struct s5p_fimc_isp_info universal_camera_sensors[] = { · 909 unmodified lines
910910 .bus_type = FIMC_MIPI_CSI2,
911911 .board_info = &m5mols_board_info,
912912 .i2c_bus_num = 0,
913− .clk_frequency = 21600000UL,
913+ .clk_frequency = 24000000UL,
914914 .csi_data_align = 32,
915915 },
916916 };
arch/arm/mach-exynos/pm.c+3−1
@@ -206,7 +206,7 @@ static void exynos4_pm_prepare(void) · 205 unmodified lines
206206
207207 }
208208
209−static int exynos4_pm_add(struct device *dev)
209+static int exynos4_pm_add(struct device *dev, struct subsys_interface *sif)
210210 {
211211 pm_cpu_prep = exynos4_pm_prepare;
212212 pm_cpu_sleep = exynos4_cpu_suspend;
@@ -384,7 +384,9 @@ static void exynos4_pm_resume(void) · 171 unmodified lines
384384
385385 exynos4_restore_pll();
386386
387+#ifdef CONFIG_SMP
387388 scu_enable(S5P_VA_SCU);
389+#endif
388390
389391 #ifdef CONFIG_CACHE_L2X0
390392 s3c_pm_do_restore_core(exynos4_l2cc_save, ARRAY_SIZE(exynos4_l2cc_save));
arch/arm/mach-kirkwood/common.c+2−1
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <plat/cache-feroceon-l2.h>
2828 #include <plat/mvsdio.h>
2929 #include <plat/orion_nand.h>
30+#include <plat/ehci-orion.h>
3031 #include <plat/common.h>
3132 #include <plat/time.h>
3233 #include <plat/addr-map.h>
@@ -73,7 +74,7 @@ unsigned int kirkwood_clk_ctrl = CGC_DUNIT | CGC_RESERVED; · 40 unmodified lines
7374 void __init kirkwood_ehci_init(void)
7475 {
7576 kirkwood_clk_ctrl |= CGC_USB0;
76− orion_ehci_init(USB_PHYS_BASE, IRQ_KIRKWOOD_USB);
77+ orion_ehci_init(USB_PHYS_BASE, IRQ_KIRKWOOD_USB, EHCI_PHY_NA);
7778 }
7879
7980
arch/arm/mach-kirkwood/mpp.h+160−160
@@ -31,314 +31,314 @@ · 30 unmodified lines
3131 #define MPP_F6282_MASK MPP( 0, 0x0, 0, 0, 0, 0, 0, 0, 1 )
3232
3333 #define MPP0_GPIO MPP( 0, 0x0, 1, 1, 1, 1, 1, 1, 1 )
34−#define MPP0_NF_IO2 MPP( 0, 0x1, 1, 1, 1, 1, 1, 1, 1 )
35−#define MPP0_SPI_SCn MPP( 0, 0x2, 0, 1, 1, 1, 1, 1, 1 )
34+#define MPP0_NF_IO2 MPP( 0, 0x1, 0, 0, 1, 1, 1, 1, 1 )
35+#define MPP0_SPI_SCn MPP( 0, 0x2, 0, 0, 1, 1, 1, 1, 1 )
3636
3737 #define MPP1_GPO MPP( 1, 0x0, 0, 1, 1, 1, 1, 1, 1 )
38−#define MPP1_NF_IO3 MPP( 1, 0x1, 1, 1, 1, 1, 1, 1, 1 )
39−#define MPP1_SPI_MOSI MPP( 1, 0x2, 0, 1, 1, 1, 1, 1, 1 )
38+#define MPP1_NF_IO3 MPP( 1, 0x1, 0, 0, 1, 1, 1, 1, 1 )
39+#define MPP1_SPI_MOSI MPP( 1, 0x2, 0, 0, 1, 1, 1, 1, 1 )
4040
4141 #define MPP2_GPO MPP( 2, 0x0, 0, 1, 1, 1, 1, 1, 1 )
42−#define MPP2_NF_IO4 MPP( 2, 0x1, 1, 1, 1, 1, 1, 1, 1 )
43−#define MPP2_SPI_SCK MPP( 2, 0x2, 0, 1, 1, 1, 1, 1, 1 )
42+#define MPP2_NF_IO4 MPP( 2, 0x1, 0, 0, 1, 1, 1, 1, 1 )
43+#define MPP2_SPI_SCK MPP( 2, 0x2, 0, 0, 1, 1, 1, 1, 1 )
4444
4545 #define MPP3_GPO MPP( 3, 0x0, 0, 1, 1, 1, 1, 1, 1 )
46−#define MPP3_NF_IO5 MPP( 3, 0x1, 1, 1, 1, 1, 1, 1, 1 )
47−#define MPP3_SPI_MISO MPP( 3, 0x2, 1, 0, 1, 1, 1, 1, 1 )
46+#define MPP3_NF_IO5 MPP( 3, 0x1, 0, 0, 1, 1, 1, 1, 1 )
47+#define MPP3_SPI_MISO MPP( 3, 0x2, 0, 0, 1, 1, 1, 1, 1 )
4848
4949 #define MPP4_GPIO MPP( 4, 0x0, 1, 1, 1, 1, 1, 1, 1 )
50−#define MPP4_NF_IO6 MPP( 4, 0x1, 1, 1, 1, 1, 1, 1, 1 )
51−#define MPP4_UART0_RXD MPP( 4, 0x2, 1, 0, 1, 1, 1, 1, 1 )
52−#define MPP4_SATA1_ACTn MPP( 4, 0x5, 0, 1, 0, 0, 1, 1, 1 )
50+#define MPP4_NF_IO6 MPP( 4, 0x1, 0, 0, 1, 1, 1, 1, 1 )
51+#define MPP4_UART0_RXD MPP( 4, 0x2, 0, 0, 1, 1, 1, 1, 1 )
52+#define MPP4_SATA1_ACTn MPP( 4, 0x5, 0, 0, 0, 0, 1, 1, 1 )
5353 #define MPP4_LCD_VGA_HSYNC MPP( 4, 0xb, 0, 0, 0, 0, 0, 0, 1 )
54−#define MPP4_PTP_CLK MPP( 4, 0xd, 1, 0, 1, 1, 1, 1, 0 )
54+#define MPP4_PTP_CLK MPP( 4, 0xd, 0, 0, 1, 1, 1, 1, 0 )
5555
5656 #define MPP5_GPO MPP( 5, 0x0, 0, 1, 1, 1, 1, 1, 1 )
57−#define MPP5_NF_IO7 MPP( 5, 0x1, 1, 1, 1, 1, 1, 1, 1 )
58−#define MPP5_UART0_TXD MPP( 5, 0x2, 0, 1, 1, 1, 1, 1, 1 )
59−#define MPP5_PTP_TRIG_GEN MPP( 5, 0x4, 0, 1, 1, 1, 1, 1, 0 )
60−#define MPP5_SATA0_ACTn MPP( 5, 0x5, 0, 1, 0, 1, 1, 1, 1 )
57+#define MPP5_NF_IO7 MPP( 5, 0x1, 0, 0, 1, 1, 1, 1, 1 )
58+#define MPP5_UART0_TXD MPP( 5, 0x2, 0, 0, 1, 1, 1, 1, 1 )
59+#define MPP5_PTP_TRIG_GEN MPP( 5, 0x4, 0, 0, 1, 1, 1, 1, 0 )
60+#define MPP5_SATA0_ACTn MPP( 5, 0x5, 0, 0, 0, 1, 1, 1, 1 )
6161 #define MPP5_LCD_VGA_VSYNC MPP( 5, 0xb, 0, 0, 0, 0, 0, 0, 1 )
6262
63−#define MPP6_SYSRST_OUTn MPP( 6, 0x1, 0, 1, 1, 1, 1, 1, 1 )
64−#define MPP6_SPI_MOSI MPP( 6, 0x2, 0, 1, 1, 1, 1, 1, 1 )
65−#define MPP6_PTP_TRIG_GEN MPP( 6, 0x3, 0, 1, 1, 1, 1, 1, 0 )
63+#define MPP6_SYSRST_OUTn MPP( 6, 0x1, 0, 0, 1, 1, 1, 1, 1 )
64+#define MPP6_SPI_MOSI MPP( 6, 0x2, 0, 0, 1, 1, 1, 1, 1 )
65+#define MPP6_PTP_TRIG_GEN MPP( 6, 0x3, 0, 0, 1, 1, 1, 1, 0 )
6666
6767 #define MPP7_GPO MPP( 7, 0x0, 0, 1, 1, 1, 1, 1, 1 )
68−#define MPP7_PEX_RST_OUTn MPP( 7, 0x1, 0, 1, 1, 1, 1, 1, 0 )
69−#define MPP7_SPI_SCn MPP( 7, 0x2, 0, 1, 1, 1, 1, 1, 1 )
70−#define MPP7_PTP_TRIG_GEN MPP( 7, 0x3, 0, 1, 1, 1, 1, 1, 0 )
71−#define MPP7_LCD_PWM MPP( 7, 0xb, 0, 1, 0, 0, 0, 0, 1 )
68+#define MPP7_PEX_RST_OUTn MPP( 7, 0x1, 0, 0, 1, 1, 1, 1, 0 )
69+#define MPP7_SPI_SCn MPP( 7, 0x2, 0, 0, 1, 1, 1, 1, 1 )
70+#define MPP7_PTP_TRIG_GEN MPP( 7, 0x3, 0, 0, 1, 1, 1, 1, 0 )
71+#define MPP7_LCD_PWM MPP( 7, 0xb, 0, 0, 0, 0, 0, 0, 1 )
7272
7373 #define MPP8_GPIO MPP( 8, 0x0, 1, 1, 1, 1, 1, 1, 1 )
74−#define MPP8_TW0_SDA MPP( 8, 0x1, 1, 1, 1, 1, 1, 1, 1 )
75−#define MPP8_UART0_RTS MPP( 8, 0x2, 0, 1, 1, 1, 1, 1, 1 )
76−#define MPP8_UART1_RTS MPP( 8, 0x3, 0, 1, 1, 1, 1, 1, 1 )
77−#define MPP8_MII0_RXERR MPP( 8, 0x4, 1, 0, 0, 1, 1, 1, 1 )
78−#define MPP8_SATA1_PRESENTn MPP( 8, 0x5, 0, 1, 0, 0, 1, 1, 1 )
79−#define MPP8_PTP_CLK MPP( 8, 0xc, 1, 0, 1, 1, 1, 1, 0 )
80−#define MPP8_MII0_COL MPP( 8, 0xd, 1, 0, 1, 1, 1, 1, 1 )
74+#define MPP8_TW0_SDA MPP( 8, 0x1, 0, 0, 1, 1, 1, 1, 1 )
75+#define MPP8_UART0_RTS MPP( 8, 0x2, 0, 0, 1, 1, 1, 1, 1 )
76+#define MPP8_UART1_RTS MPP( 8, 0x3, 0, 0, 1, 1, 1, 1, 1 )
77+#define MPP8_MII0_RXERR MPP( 8, 0x4, 0, 0, 0, 1, 1, 1, 1 )
78+#define MPP8_SATA1_PRESENTn MPP( 8, 0x5, 0, 0, 0, 0, 1, 1, 1 )
79+#define MPP8_PTP_CLK MPP( 8, 0xc, 0, 0, 1, 1, 1, 1, 0 )
80+#define MPP8_MII0_COL MPP( 8, 0xd, 0, 0, 1, 1, 1, 1, 1 )
8181
8282 #define MPP9_GPIO MPP( 9, 0x0, 1, 1, 1, 1, 1, 1, 1 )
83−#define MPP9_TW0_SCK MPP( 9, 0x1, 1, 1, 1, 1, 1, 1, 1 )
84−#define MPP9_UART0_CTS MPP( 9, 0x2, 1, 0, 1, 1, 1, 1, 1 )
85−#define MPP9_UART1_CTS MPP( 9, 0x3, 1, 0, 1, 1, 1, 1, 1 )
86−#define MPP9_SATA0_PRESENTn MPP( 9, 0x5, 0, 1, 0, 1, 1, 1, 1 )
87−#define MPP9_PTP_EVENT_REQ MPP( 9, 0xc, 1, 0, 1, 1, 1, 1, 0 )
88−#define MPP9_MII0_CRS MPP( 9, 0xd, 1, 0, 1, 1, 1, 1, 1 )
83+#define MPP9_TW0_SCK MPP( 9, 0x1, 0, 0, 1, 1, 1, 1, 1 )
84+#define MPP9_UART0_CTS MPP( 9, 0x2, 0, 0, 1, 1, 1, 1, 1 )
85+#define MPP9_UART1_CTS MPP( 9, 0x3, 0, 0, 1, 1, 1, 1, 1 )
86+#define MPP9_SATA0_PRESENTn MPP( 9, 0x5, 0, 0, 0, 1, 1, 1, 1 )
87+#define MPP9_PTP_EVENT_REQ MPP( 9, 0xc, 0, 0, 1, 1, 1, 1, 0 )
88+#define MPP9_MII0_CRS MPP( 9, 0xd, 0, 0, 1, 1, 1, 1, 1 )
8989
9090 #define MPP10_GPO MPP( 10, 0x0, 0, 1, 1, 1, 1, 1, 1 )
91−#define MPP10_SPI_SCK MPP( 10, 0x2, 0, 1, 1, 1, 1, 1, 1 )
92−#define MPP10_UART0_TXD MPP( 10, 0X3, 0, 1, 1, 1, 1, 1, 1 )
93−#define MPP10_SATA1_ACTn MPP( 10, 0x5, 0, 1, 0, 0, 1, 1, 1 )
94−#define MPP10_PTP_TRIG_GEN MPP( 10, 0xc, 0, 1, 1, 1, 1, 1, 0 )
91+#define MPP10_SPI_SCK MPP( 10, 0x2, 0, 0, 1, 1, 1, 1, 1 )
92+#define MPP10_UART0_TXD MPP( 10, 0X3, 0, 0, 1, 1, 1, 1, 1 )
93+#define MPP10_SATA1_ACTn MPP( 10, 0x5, 0, 0, 0, 0, 1, 1, 1 )
94+#define MPP10_PTP_TRIG_GEN MPP( 10, 0xc, 0, 0, 1, 1, 1, 1, 0 )
9595
9696 #define MPP11_GPIO MPP( 11, 0x0, 1, 1, 1, 1, 1, 1, 1 )
97−#define MPP11_SPI_MISO MPP( 11, 0x2, 1, 0, 1, 1, 1, 1, 1 )
98−#define MPP11_UART0_RXD MPP( 11, 0x3, 1, 0, 1, 1, 1, 1, 1 )
99−#define MPP11_PTP_EVENT_REQ MPP( 11, 0x4, 1, 0, 1, 1, 1, 1, 0 )
100−#define MPP11_PTP_TRIG_GEN MPP( 11, 0xc, 0, 1, 1, 1, 1, 1, 0 )
101−#define MPP11_PTP_CLK MPP( 11, 0xd, 1, 0, 1, 1, 1, 1, 0 )
102−#define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 1, 0, 1, 1, 1, 1 )
97+#define MPP11_SPI_MISO MPP( 11, 0x2, 0, 0, 1, 1, 1, 1, 1 )
98+#define MPP11_UART0_RXD MPP( 11, 0x3, 0, 0, 1, 1, 1, 1, 1 )
99+#define MPP11_PTP_EVENT_REQ MPP( 11, 0x4, 0, 0, 1, 1, 1, 1, 0 )
100+#define MPP11_PTP_TRIG_GEN MPP( 11, 0xc, 0, 0, 1, 1, 1, 1, 0 )
101+#define MPP11_PTP_CLK MPP( 11, 0xd, 0, 0, 1, 1, 1, 1, 0 )
102+#define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 0, 0, 1, 1, 1, 1 )
103103
104104 #define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1, 1 )
105105 #define MPP12_GPIO MPP( 12, 0x0, 1, 1, 0, 0, 0, 1, 0 )
106−#define MPP12_SD_CLK MPP( 12, 0x1, 0, 1, 1, 1, 1, 1, 1 )
107−#define MPP12_AU_SPDIF0 MPP( 12, 0xa, 0, 1, 0, 0, 0, 0, 1 )
108−#define MPP12_SPI_MOSI MPP( 12, 0xb, 0, 1, 0, 0, 0, 0, 1 )
109−#define MPP12_TW1_SDA MPP( 12, 0xd, 1, 0, 0, 0, 0, 0, 1 )
106+#define MPP12_SD_CLK MPP( 12, 0x1, 0, 0, 1, 1, 1, 1, 1 )
107+#define MPP12_AU_SPDIF0 MPP( 12, 0xa, 0, 0, 0, 0, 0, 0, 1 )
108+#define MPP12_SPI_MOSI MPP( 12, 0xb, 0, 0, 0, 0, 0, 0, 1 )
109+#define MPP12_TW1_SDA MPP( 12, 0xd, 0, 0, 0, 0, 0, 0, 1 )
110110
111111 #define MPP13_GPIO MPP( 13, 0x0, 1, 1, 1, 1, 1, 1, 1 )
112−#define MPP13_SD_CMD MPP( 13, 0x1, 1, 1, 1, 1, 1, 1, 1 )
113−#define MPP13_UART1_TXD MPP( 13, 0x3, 0, 1, 1, 1, 1, 1, 1 )
114−#define MPP13_AU_SPDIFRMCLK MPP( 13, 0xa, 0, 1, 0, 0, 0, 0, 1 )
115−#define MPP13_LCDPWM MPP( 13, 0xb, 0, 1, 0, 0, 0, 0, 1 )
112+#define MPP13_SD_CMD MPP( 13, 0x1, 0, 0, 1, 1, 1, 1, 1 )
113+#define MPP13_UART1_TXD MPP( 13, 0x3, 0, 0, 1, 1, 1, 1, 1 )
114+#define MPP13_AU_SPDIFRMCLK MPP( 13, 0xa, 0, 0, 0, 0, 0, 0, 1 )
115+#define MPP13_LCDPWM MPP( 13, 0xb, 0, 0, 0, 0, 0, 0, 1 )
116116
117117 #define MPP14_GPIO MPP( 14, 0x0, 1, 1, 1, 1, 1, 1, 1 )
118−#define MPP14_SD_D0 MPP( 14, 0x1, 1, 1, 1, 1, 1, 1, 1 )
119−#define MPP14_UART1_RXD MPP( 14, 0x3, 1, 0, 1, 1, 1, 1, 1 )
120−#define MPP14_SATA1_PRESENTn MPP( 14, 0x4, 0, 1, 0, 0, 1, 1, 1 )
121−#define MPP14_AU_SPDIFI MPP( 14, 0xa, 1, 0, 0, 0, 0, 0, 1 )
122−#define MPP14_AU_I2SDI MPP( 14, 0xb, 1, 0, 0, 0, 0, 0, 1 )
123−#define MPP14_MII0_COL MPP( 14, 0xd, 1, 0, 1, 1, 1, 1, 1 )
118+#define MPP14_SD_D0 MPP( 14, 0x1, 0, 0, 1, 1, 1, 1, 1 )
119+#define MPP14_UART1_RXD MPP( 14, 0x3, 0, 0, 1, 1, 1, 1, 1 )
120+#define MPP14_SATA1_PRESENTn MPP( 14, 0x4, 0, 0, 0, 0, 1, 1, 1 )
121+#define MPP14_AU_SPDIFI MPP( 14, 0xa, 0, 0, 0, 0, 0, 0, 1 )
122+#define MPP14_AU_I2SDI MPP( 14, 0xb, 0, 0, 0, 0, 0, 0, 1 )
123+#define MPP14_MII0_COL MPP( 14, 0xd, 0, 0, 1, 1, 1, 1, 1 )
124124
125125 #define MPP15_GPIO MPP( 15, 0x0, 1, 1, 1, 1, 1, 1, 1 )
126−#define MPP15_SD_D1 MPP( 15, 0x1, 1, 1, 1, 1, 1, 1, 1 )
127−#define MPP15_UART0_RTS MPP( 15, 0x2, 0, 1, 1, 1, 1, 1, 1 )
128−#define MPP15_UART1_TXD MPP( 15, 0x3, 0, 1, 1, 1, 1, 1, 1 )
129−#define MPP15_SATA0_ACTn MPP( 15, 0x4, 0, 1, 0, 1, 1, 1, 1 )
130−#define MPP15_SPI_CSn MPP( 15, 0xb, 0, 1, 0, 0, 0, 0, 1 )
126+#define MPP15_SD_D1 MPP( 15, 0x1, 0, 0, 1, 1, 1, 1, 1 )
127+#define MPP15_UART0_RTS MPP( 15, 0x2, 0, 0, 1, 1, 1, 1, 1 )
128+#define MPP15_UART1_TXD MPP( 15, 0x3, 0, 0, 1, 1, 1, 1, 1 )
129+#define MPP15_SATA0_ACTn MPP( 15, 0x4, 0, 0, 0, 1, 1, 1, 1 )
130+#define MPP15_SPI_CSn MPP( 15, 0xb, 0, 0, 0, 0, 0, 0, 1 )
131131
132132 #define MPP16_GPIO MPP( 16, 0x0, 1, 1, 1, 1, 1, 1, 1 )
133−#define MPP16_SD_D2 MPP( 16, 0x1, 1, 1, 1, 1, 1, 1, 1 )
134−#define MPP16_UART0_CTS MPP( 16, 0x2, 1, 0, 1, 1, 1, 1, 1 )
135−#define MPP16_UART1_RXD MPP( 16, 0x3, 1, 0, 1, 1, 1, 1, 1 )
136−#define MPP16_SATA1_ACTn MPP( 16, 0x4, 0, 1, 0, 0, 1, 1, 1 )
137−#define MPP16_LCD_EXT_REF_CLK MPP( 16, 0xb, 1, 0, 0, 0, 0, 0, 1 )
138−#define MPP16_MII0_CRS MPP( 16, 0xd, 1, 0, 1, 1, 1, 1, 1 )
133+#define MPP16_SD_D2 MPP( 16, 0x1, 0, 0, 1, 1, 1, 1, 1 )
134+#define MPP16_UART0_CTS MPP( 16, 0x2, 0, 0, 1, 1, 1, 1, 1 )
135+#define MPP16_UART1_RXD MPP( 16, 0x3, 0, 0, 1, 1, 1, 1, 1 )
136+#define MPP16_SATA1_ACTn MPP( 16, 0x4, 0, 0, 0, 0, 1, 1, 1 )
137+#define MPP16_LCD_EXT_REF_CLK MPP( 16, 0xb, 0, 0, 0, 0, 0, 0, 1 )
138+#define MPP16_MII0_CRS MPP( 16, 0xd, 0, 0, 1, 1, 1, 1, 1 )
139139
140140 #define MPP17_GPIO MPP( 17, 0x0, 1, 1, 1, 1, 1, 1, 1 )
141−#define MPP17_SD_D3 MPP( 17, 0x1, 1, 1, 1, 1, 1, 1, 1 )
142−#define MPP17_SATA0_PRESENTn MPP( 17, 0x4, 0, 1, 0, 1, 1, 1, 1 )
143−#define MPP17_SATA1_ACTn MPP( 17, 0xa, 0, 1, 0, 0, 0, 0, 1 )
144−#define MPP17_TW1_SCK MPP( 17, 0xd, 1, 1, 0, 0, 0, 0, 1 )
141+#define MPP17_SD_D3 MPP( 17, 0x1, 0, 0, 1, 1, 1, 1, 1 )
142+#define MPP17_SATA0_PRESENTn MPP( 17, 0x4, 0, 0, 0, 1, 1, 1, 1 )
143+#define MPP17_SATA1_ACTn MPP( 17, 0xa, 0, 0, 0, 0, 0, 0, 1 )
144+#define MPP17_TW1_SCK MPP( 17, 0xd, 0, 0, 0, 0, 0, 0, 1 )
145145
146146 #define MPP18_GPO MPP( 18, 0x0, 0, 1, 1, 1, 1, 1, 1 )
147−#define MPP18_NF_IO0 MPP( 18, 0x1, 1, 1, 1, 1, 1, 1, 1 )
148−#define MPP18_PEX0_CLKREQ MPP( 18, 0x2, 0, 1, 0, 0, 0, 0, 1 )
147+#define MPP18_NF_IO0 MPP( 18, 0x1, 0, 0, 1, 1, 1, 1, 1 )
148+#define MPP18_PEX0_CLKREQ MPP( 18, 0x2, 0, 0, 0, 0, 0, 0, 1 )
149149
150150 #define MPP19_GPO MPP( 19, 0x0, 0, 1, 1, 1, 1, 1, 1 )
151−#define MPP19_NF_IO1 MPP( 19, 0x1, 1, 1, 1, 1, 1, 1, 1 )
151+#define MPP19_NF_IO1 MPP( 19, 0x1, 0, 0, 1, 1, 1, 1, 1 )
152152
153153 #define MPP20_GPIO MPP( 20, 0x0, 1, 1, 0, 1, 1, 1, 1 )
154−#define MPP20_TSMP0 MPP( 20, 0x1, 1, 1, 0, 0, 1, 1, 1 )
155−#define MPP20_TDM_CH0_TX_QL MPP( 20, 0x2, 0, 1, 0, 0, 1, 1, 1 )
154+#define MPP20_TSMP0 MPP( 20, 0x1, 0, 0, 0, 0, 1, 1, 1 )
155+#define MPP20_TDM_CH0_TX_QL MPP( 20, 0x2, 0, 0, 0, 0, 1, 1, 1 )
156156 #define MPP20_GE1_TXD0 MPP( 20, 0x3, 0, 0, 0, 1, 1, 1, 1 )
157−#define MPP20_AU_SPDIFI MPP( 20, 0x4, 1, 0, 0, 0, 1, 1, 1 )
158−#define MPP20_SATA1_ACTn MPP( 20, 0x5, 0, 1, 0, 0, 1, 1, 1 )
157+#define MPP20_AU_SPDIFI MPP( 20, 0x4, 0, 0, 0, 0, 1, 1, 1 )
158+#define MPP20_SATA1_ACTn MPP( 20, 0x5, 0, 0, 0, 0, 1, 1, 1 )
159159 #define MPP20_LCD_D0 MPP( 20, 0xb, 0, 0, 0, 0, 0, 0, 1 )
160160
161161 #define MPP21_GPIO MPP( 21, 0x0, 1, 1, 0, 1, 1, 1, 1 )
162−#define MPP21_TSMP1 MPP( 21, 0x1, 1, 1, 0, 0, 1, 1, 1 )
163−#define MPP21_TDM_CH0_RX_QL MPP( 21, 0x2, 0, 1, 0, 0, 1, 1, 1 )
162+#define MPP21_TSMP1 MPP( 21, 0x1, 0, 0, 0, 0, 1, 1, 1 )
163+#define MPP21_TDM_CH0_RX_QL MPP( 21, 0x2, 0, 0, 0, 0, 1, 1, 1 )
164164 #define MPP21_GE1_TXD1 MPP( 21, 0x3, 0, 0, 0, 1, 1, 1, 1 )
165−#define MPP21_AU_SPDIFO MPP( 21, 0x4, 0, 1, 0, 0, 1, 1, 1 )
166−#define MPP21_SATA0_ACTn MPP( 21, 0x5, 0, 1, 0, 1, 1, 1, 1 )
165+#define MPP21_AU_SPDIFO MPP( 21, 0x4, 0, 0, 0, 0, 1, 1, 1 )
166+#define MPP21_SATA0_ACTn MPP( 21, 0x5, 0, 0, 0, 1, 1, 1, 1 )
167167 #define MPP21_LCD_D1 MPP( 21, 0xb, 0, 0, 0, 0, 0, 0, 1 )
168168
169169 #define MPP22_GPIO MPP( 22, 0x0, 1, 1, 0, 1, 1, 1, 1 )
170−#define MPP22_TSMP2 MPP( 22, 0x1, 1, 1, 0, 0, 1, 1, 1 )
171−#define MPP22_TDM_CH2_TX_QL MPP( 22, 0x2, 0, 1, 0, 0, 1, 1, 1 )
170+#define MPP22_TSMP2 MPP( 22, 0x1, 0, 0, 0, 0, 1, 1, 1 )
171+#define MPP22_TDM_CH2_TX_QL MPP( 22, 0x2, 0, 0, 0, 0, 1, 1, 1 )
172172 #define MPP22_GE1_TXD2 MPP( 22, 0x3, 0, 0, 0, 1, 1, 1, 1 )
173−#define MPP22_AU_SPDIFRMKCLK MPP( 22, 0x4, 0, 1, 0, 0, 1, 1, 1 )
174−#define MPP22_SATA1_PRESENTn MPP( 22, 0x5, 0, 1, 0, 0, 1, 1, 1 )
173+#define MPP22_AU_SPDIFRMKCLK MPP( 22, 0x4, 0, 0, 0, 0, 1, 1, 1 )
174+#define MPP22_SATA1_PRESENTn MPP( 22, 0x5, 0, 0, 0, 0, 1, 1, 1 )
175175 #define MPP22_LCD_D2 MPP( 22, 0xb, 0, 0, 0, 0, 0, 0, 1 )
176176
177177 #define MPP23_GPIO MPP( 23, 0x0, 1, 1, 0, 1, 1, 1, 1 )
178−#define MPP23_TSMP3 MPP( 23, 0x1, 1, 1, 0, 0, 1, 1, 1 )
179−#define MPP23_TDM_CH2_RX_QL MPP( 23, 0x2, 1, 0, 0, 0, 1, 1, 1 )
178+#define MPP23_TSMP3 MPP( 23, 0x1, 0, 0, 0, 0, 1, 1, 1 )
179+#define MPP23_TDM_CH2_RX_QL MPP( 23, 0x2, 0, 0, 0, 0, 1, 1, 1 )
180180 #define MPP23_GE1_TXD3 MPP( 23, 0x3, 0, 0, 0, 1, 1, 1, 1 )
181−#define MPP23_AU_I2SBCLK MPP( 23, 0x4, 0, 1, 0, 0, 1, 1, 1 )
182−#define MPP23_SATA0_PRESENTn MPP( 23, 0x5, 0, 1, 0, 1, 1, 1, 1 )
181+#define MPP23_AU_I2SBCLK MPP( 23, 0x4, 0, 0, 0, 0, 1, 1, 1 )
182+#define MPP23_SATA0_PRESENTn MPP( 23, 0x5, 0, 0, 0, 1, 1, 1, 1 )
183183 #define MPP23_LCD_D3 MPP( 23, 0xb, 0, 0, 0, 0, 0, 0, 1 )
184184
185185 #define MPP24_GPIO MPP( 24, 0x0, 1, 1, 0, 1, 1, 1, 1 )
186−#define MPP24_TSMP4 MPP( 24, 0x1, 1, 1, 0, 0, 1, 1, 1 )
187−#define MPP24_TDM_SPI_CS0 MPP( 24, 0x2, 0, 1, 0, 0, 1, 1, 1 )
186+#define MPP24_TSMP4 MPP( 24, 0x1, 0, 0, 0, 0, 1, 1, 1 )
187+#define MPP24_TDM_SPI_CS0 MPP( 24, 0x2, 0, 0, 0, 0, 1, 1, 1 )
188188 #define MPP24_GE1_RXD0 MPP( 24, 0x3, 0, 0, 0, 1, 1, 1, 1 )
189−#define MPP24_AU_I2SDO MPP( 24, 0x4, 0, 1, 0, 0, 1, 1, 1 )
189+#define MPP24_AU_I2SDO MPP( 24, 0x4, 0, 0, 0, 0, 1, 1, 1 )
190190 #define MPP24_LCD_D4 MPP( 24, 0xb, 0, 0, 0, 0, 0, 0, 1 )
191191
192192 #define MPP25_GPIO MPP( 25, 0x0, 1, 1, 0, 1, 1, 1, 1 )
193−#define MPP25_TSMP5 MPP( 25, 0x1, 1, 1, 0, 0, 1, 1, 1 )
194−#define MPP25_TDM_SPI_SCK MPP( 25, 0x2, 0, 1, 0, 0, 1, 1, 1 )
193+#define MPP25_TSMP5 MPP( 25, 0x1, 0, 0, 0, 0, 1, 1, 1 )
194+#define MPP25_TDM_SPI_SCK MPP( 25, 0x2, 0, 0, 0, 0, 1, 1, 1 )
195195 #define MPP25_GE1_RXD1 MPP( 25, 0x3, 0, 0, 0, 1, 1, 1, 1 )
196−#define MPP25_AU_I2SLRCLK MPP( 25, 0x4, 0, 1, 0, 0, 1, 1, 1 )
196+#define MPP25_AU_I2SLRCLK MPP( 25, 0x4, 0, 0, 0, 0, 1, 1, 1 )
197197 #define MPP25_LCD_D5 MPP( 25, 0xb, 0, 0, 0, 0, 0, 0, 1 )
198198
199199 #define MPP26_GPIO MPP( 26, 0x0, 1, 1, 0, 1, 1, 1, 1 )
200−#define MPP26_TSMP6 MPP( 26, 0x1, 1, 1, 0, 0, 1, 1, 1 )
201−#define MPP26_TDM_SPI_MISO MPP( 26, 0x2, 1, 0, 0, 0, 1, 1, 1 )
200+#define MPP26_TSMP6 MPP( 26, 0x1, 0, 0, 0, 0, 1, 1, 1 )
201+#define MPP26_TDM_SPI_MISO MPP( 26, 0x2, 0, 0, 0, 0, 1, 1, 1 )
202202 #define MPP26_GE1_RXD2 MPP( 26, 0x3, 0, 0, 0, 1, 1, 1, 1 )
203−#define MPP26_AU_I2SMCLK MPP( 26, 0x4, 0, 1, 0, 0, 1, 1, 1 )
203+#define MPP26_AU_I2SMCLK MPP( 26, 0x4, 0, 0, 0, 0, 1, 1, 1 )
204204 #define MPP26_LCD_D6 MPP( 26, 0xb, 0, 0, 0, 0, 0, 0, 1 )
205205
206206 #define MPP27_GPIO MPP( 27, 0x0, 1, 1, 0, 1, 1, 1, 1 )
207−#define MPP27_TSMP7 MPP( 27, 0x1, 1, 1, 0, 0, 1, 1, 1 )
208−#define MPP27_TDM_SPI_MOSI MPP( 27, 0x2, 0, 1, 0, 0, 1, 1, 1 )
207+#define MPP27_TSMP7 MPP( 27, 0x1, 0, 0, 0, 0, 1, 1, 1 )
208+#define MPP27_TDM_SPI_MOSI MPP( 27, 0x2, 0, 0, 0, 0, 1, 1, 1 )
209209 #define MPP27_GE1_RXD3 MPP( 27, 0x3, 0, 0, 0, 1, 1, 1, 1 )
210−#define MPP27_AU_I2SDI MPP( 27, 0x4, 1, 0, 0, 0, 1, 1, 1 )
210+#define MPP27_AU_I2SDI MPP( 27, 0x4, 0, 0, 0, 0, 1, 1, 1 )
211211 #define MPP27_LCD_D7 MPP( 27, 0xb, 0, 0, 0, 0, 0, 0, 1 )
212212
213213 #define MPP28_GPIO MPP( 28, 0x0, 1, 1, 0, 1, 1, 1, 1 )
214−#define MPP28_TSMP8 MPP( 28, 0x1, 1, 1, 0, 0, 1, 1, 1 )
214+#define MPP28_TSMP8 MPP( 28, 0x1, 0, 0, 0, 0, 1, 1, 1 )
215215 #define MPP28_TDM_CODEC_INTn MPP( 28, 0x2, 0, 0, 0, 0, 1, 1, 1 )
216216 #define MPP28_GE1_COL MPP( 28, 0x3, 0, 0, 0, 1, 1, 1, 1 )
217−#define MPP28_AU_EXTCLK MPP( 28, 0x4, 1, 0, 0, 0, 1, 1, 1 )
217+#define MPP28_AU_EXTCLK MPP( 28, 0x4, 0, 0, 0, 0, 1, 1, 1 )
218218 #define MPP28_LCD_D8 MPP( 28, 0xb, 0, 0, 0, 0, 0, 0, 1 )
219219
220220 #define MPP29_GPIO MPP( 29, 0x0, 1, 1, 0, 1, 1, 1, 1 )
221−#define MPP29_TSMP9 MPP( 29, 0x1, 1, 1, 0, 0, 1, 1, 1 )
221+#define MPP29_TSMP9 MPP( 29, 0x1, 0, 0, 0, 0, 1, 1, 1 )
222222 #define MPP29_TDM_CODEC_RSTn MPP( 29, 0x2, 0, 0, 0, 0, 1, 1, 1 )
223223 #define MPP29_GE1_TCLK MPP( 29, 0x3, 0, 0, 0, 1, 1, 1, 1 )
224224 #define MPP29_LCD_D9 MPP( 29, 0xb, 0, 0, 0, 0, 0, 0, 1 )
225225
226226 #define MPP30_GPIO MPP( 30, 0x0, 1, 1, 0, 1, 1, 1, 1 )
227−#define MPP30_TSMP10 MPP( 30, 0x1, 1, 1, 0, 0, 1, 1, 1 )
228−#define MPP30_TDM_PCLK MPP( 30, 0x2, 1, 1, 0, 0, 1, 1, 1 )
227+#define MPP30_TSMP10 MPP( 30, 0x1, 0, 0, 0, 0, 1, 1, 1 )
228+#define MPP30_TDM_PCLK MPP( 30, 0x2, 0, 0, 0, 0, 1, 1, 1 )
229229 #define MPP30_GE1_RXCTL MPP( 30, 0x3, 0, 0, 0, 1, 1, 1, 1 )
230230 #define MPP30_LCD_D10 MPP( 30, 0xb, 0, 0, 0, 0, 0, 0, 1 )
231231
232232 #define MPP31_GPIO MPP( 31, 0x0, 1, 1, 0, 1, 1, 1, 1 )
233−#define MPP31_TSMP11 MPP( 31, 0x1, 1, 1, 0, 0, 1, 1, 1 )
234−#define MPP31_TDM_FS MPP( 31, 0x2, 1, 1, 0, 0, 1, 1, 1 )
233+#define MPP31_TSMP11 MPP( 31, 0x1, 0, 0, 0, 0, 1, 1, 1 )
234+#define MPP31_TDM_FS MPP( 31, 0x2, 0, 0, 0, 0, 1, 1, 1 )
235235 #define MPP31_GE1_RXCLK MPP( 31, 0x3, 0, 0, 0, 1, 1, 1, 1 )
236236 #define MPP31_LCD_D11 MPP( 31, 0xb, 0, 0, 0, 0, 0, 0, 1 )
237237
238238 #define MPP32_GPIO MPP( 32, 0x0, 1, 1, 0, 1, 1, 1, 1 )
239−#define MPP32_TSMP12 MPP( 32, 0x1, 1, 1, 0, 0, 1, 1, 1 )
240−#define MPP32_TDM_DRX MPP( 32, 0x2, 1, 0, 0, 0, 1, 1, 1 )
239+#define MPP32_TSMP12 MPP( 32, 0x1, 0, 0, 0, 0, 1, 1, 1 )
240+#define MPP32_TDM_DRX MPP( 32, 0x2, 0, 0, 0, 0, 1, 1, 1 )
241241 #define MPP32_GE1_TCLKOUT MPP( 32, 0x3, 0, 0, 0, 1, 1, 1, 1 )
242242 #define MPP32_LCD_D12 MPP( 32, 0xb, 0, 0, 0, 0, 0, 0, 1 )
243243
244244 #define MPP33_GPO MPP( 33, 0x0, 0, 1, 0, 1, 1, 1, 1 )
245−#define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1, 1 )
245+#define MPP33_TDM_DTX MPP( 33, 0x2, 0, 0, 0, 0, 1, 1, 1 )
246246 #define MPP33_GE1_TXCTL MPP( 33, 0x3, 0, 0, 0, 1, 1, 1, 1 )
247247 #define MPP33_LCD_D13 MPP( 33, 0xb, 0, 0, 0, 0, 0, 0, 1 )
248248
249249 #define MPP34_GPIO MPP( 34, 0x0, 1, 1, 0, 1, 1, 1, 1 )
250−#define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 1, 0, 0, 1, 1, 1 )
250+#define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 0, 0, 0, 1, 1, 1 )
251251 #define MPP34_GE1_TXEN MPP( 34, 0x3, 0, 0, 0, 1, 1, 1, 1 )
252−#define MPP34_SATA1_ACTn MPP( 34, 0x5, 0, 1, 0, 0, 0, 1, 1 )
252+#define MPP34_SATA1_ACTn MPP( 34, 0x5, 0, 0, 0, 0, 0, 1, 1 )
253253 #define MPP34_LCD_D14 MPP( 34, 0xb, 0, 0, 0, 0, 0, 0, 1 )
254254
255255 #define MPP35_GPIO MPP( 35, 0x0, 1, 1, 1, 1, 1, 1, 1 )
256−#define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 1, 0, 0, 1, 1, 1 )
256+#define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 0, 0, 0, 1, 1, 1 )
257257 #define MPP35_GE1_RXERR MPP( 35, 0x3, 0, 0, 0, 1, 1, 1, 1 )
258−#define MPP35_SATA0_ACTn MPP( 35, 0x5, 0, 1, 0, 1, 1, 1, 1 )
258+#define MPP35_SATA0_ACTn MPP( 35, 0x5, 0, 0, 0, 1, 1, 1, 1 )
259259 #define MPP35_LCD_D15 MPP( 22, 0xb, 0, 0, 0, 0, 0, 0, 1 )
260−#define MPP35_MII0_RXERR MPP( 35, 0xc, 1, 0, 1, 1, 1, 1, 1 )
260+#define MPP35_MII0_RXERR MPP( 35, 0xc, 0, 0, 1, 1, 1, 1, 1 )
261261
262262 #define MPP36_GPIO MPP( 36, 0x0, 1, 1, 1, 0, 0, 1, 1 )
263−#define MPP36_TSMP0 MPP( 36, 0x1, 1, 1, 0, 0, 0, 1, 1 )
264−#define MPP36_TDM_SPI_CS1 MPP( 36, 0x2, 0, 1, 0, 0, 0, 1, 1 )
265−#define MPP36_AU_SPDIFI MPP( 36, 0x4, 1, 0, 1, 0, 0, 1, 1 )
266−#define MPP36_TW1_SDA MPP( 36, 0xb, 1, 1, 0, 0, 0, 0, 1 )
263+#define MPP36_TSMP0 MPP( 36, 0x1, 0, 0, 0, 0, 0, 1, 1 )
264+#define MPP36_TDM_SPI_CS1 MPP( 36, 0x2, 0, 0, 0, 0, 0, 1, 1 )
265+#define MPP36_AU_SPDIFI MPP( 36, 0x4, 0, 0, 1, 0, 0, 1, 1 )
266+#define MPP36_TW1_SDA MPP( 36, 0xb, 0, 0, 0, 0, 0, 0, 1 )
267267
268268 #define MPP37_GPIO MPP( 37, 0x0, 1, 1, 1, 0, 0, 1, 1 )
269−#define MPP37_TSMP1 MPP( 37, 0x1, 1, 1, 0, 0, 0, 1, 1 )
270−#define MPP37_TDM_CH2_TX_QL MPP( 37, 0x2, 0, 1, 0, 0, 0, 1, 1 )
271−#define MPP37_AU_SPDIFO MPP( 37, 0x4, 0, 1, 1, 0, 0, 1, 1 )
272−#define MPP37_TW1_SCK MPP( 37, 0xb, 1, 1, 0, 0, 0, 0, 1 )
269+#define MPP37_TSMP1 MPP( 37, 0x1, 0, 0, 0, 0, 0, 1, 1 )
270+#define MPP37_TDM_CH2_TX_QL MPP( 37, 0x2, 0, 0, 0, 0, 0, 1, 1 )
271+#define MPP37_AU_SPDIFO MPP( 37, 0x4, 0, 0, 1, 0, 0, 1, 1 )
272+#define MPP37_TW1_SCK MPP( 37, 0xb, 0, 0, 0, 0, 0, 0, 1 )
273273
274274 #define MPP38_GPIO MPP( 38, 0x0, 1, 1, 1, 0, 0, 1, 1 )
275−#define MPP38_TSMP2 MPP( 38, 0x1, 1, 1, 0, 0, 0, 1, 1 )
276−#define MPP38_TDM_CH2_RX_QL MPP( 38, 0x2, 0, 1, 0, 0, 0, 1, 1 )
277−#define MPP38_AU_SPDIFRMLCLK MPP( 38, 0x4, 0, 1, 1, 0, 0, 1, 1 )
275+#define MPP38_TSMP2 MPP( 38, 0x1, 0, 0, 0, 0, 0, 1, 1 )
276+#define MPP38_TDM_CH2_RX_QL MPP( 38, 0x2, 0, 0, 0, 0, 0, 1, 1 )
277+#define MPP38_AU_SPDIFRMLCLK MPP( 38, 0x4, 0, 0, 1, 0, 0, 1, 1 )
278278 #define MPP38_LCD_D18 MPP( 38, 0xb, 0, 0, 0, 0, 0, 0, 1 )
279279
280280 #define MPP39_GPIO MPP( 39, 0x0, 1, 1, 1, 0, 0, 1, 1 )
281−#define MPP39_TSMP3 MPP( 39, 0x1, 1, 1, 0, 0, 0, 1, 1 )
282−#define MPP39_TDM_SPI_CS0 MPP( 39, 0x2, 0, 1, 0, 0, 0, 1, 1 )
283−#define MPP39_AU_I2SBCLK MPP( 39, 0x4, 0, 1, 1, 0, 0, 1, 1 )
281+#define MPP39_TSMP3 MPP( 39, 0x1, 0, 0, 0, 0, 0, 1, 1 )
282+#define MPP39_TDM_SPI_CS0 MPP( 39, 0x2, 0, 0, 0, 0, 0, 1, 1 )
283+#define MPP39_AU_I2SBCLK MPP( 39, 0x4, 0, 0, 1, 0, 0, 1, 1 )
284284 #define MPP39_LCD_D19 MPP( 39, 0xb, 0, 0, 0, 0, 0, 0, 1 )
285285
286286 #define MPP40_GPIO MPP( 40, 0x0, 1, 1, 1, 0, 0, 1, 1 )
287−#define MPP40_TSMP4 MPP( 40, 0x1, 1, 1, 0, 0, 0, 1, 1 )
288−#define MPP40_TDM_SPI_SCK MPP( 40, 0x2, 0, 1, 0, 0, 0, 1, 1 )
289−#define MPP40_AU_I2SDO MPP( 40, 0x4, 0, 1, 1, 0, 0, 1, 1 )
287+#define MPP40_TSMP4 MPP( 40, 0x1, 0, 0, 0, 0, 0, 1, 1 )
288+#define MPP40_TDM_SPI_SCK MPP( 40, 0x2, 0, 0, 0, 0, 0, 1, 1 )
289+#define MPP40_AU_I2SDO MPP( 40, 0x4, 0, 0, 1, 0, 0, 1, 1 )
290290 #define MPP40_LCD_D20 MPP( 40, 0xb, 0, 0, 0, 0, 0, 0, 1 )
291291
292292 #define MPP41_GPIO MPP( 41, 0x0, 1, 1, 1, 0, 0, 1, 1 )
293−#define MPP41_TSMP5 MPP( 41, 0x1, 1, 1, 0, 0, 0, 1, 1 )
294−#define MPP41_TDM_SPI_MISO MPP( 41, 0x2, 1, 0, 0, 0, 0, 1, 1 )
295−#define MPP41_AU_I2SLRCLK MPP( 41, 0x4, 0, 1, 1, 0, 0, 1, 1 )
293+#define MPP41_TSMP5 MPP( 41, 0x1, 0, 0, 0, 0, 0, 1, 1 )
294+#define MPP41_TDM_SPI_MISO MPP( 41, 0x2, 0, 0, 0, 0, 0, 1, 1 )
295+#define MPP41_AU_I2SLRCLK MPP( 41, 0x4, 0, 0, 1, 0, 0, 1, 1 )
296296 #define MPP41_LCD_D21 MPP( 41, 0xb, 0, 0, 0, 0, 0, 0, 1 )
297297
298298 #define MPP42_GPIO MPP( 42, 0x0, 1, 1, 1, 0, 0, 1, 1 )
299−#define MPP42_TSMP6 MPP( 42, 0x1, 1, 1, 0, 0, 0, 1, 1 )
300−#define MPP42_TDM_SPI_MOSI MPP( 42, 0x2, 0, 1, 0, 0, 0, 1, 1 )
301−#define MPP42_AU_I2SMCLK MPP( 42, 0x4, 0, 1, 1, 0, 0, 1, 1 )
299+#define MPP42_TSMP6 MPP( 42, 0x1, 0, 0, 0, 0, 0, 1, 1 )
300+#define MPP42_TDM_SPI_MOSI MPP( 42, 0x2, 0, 0, 0, 0, 0, 1, 1 )
301+#define MPP42_AU_I2SMCLK MPP( 42, 0x4, 0, 0, 1, 0, 0, 1, 1 )
302302 #define MPP42_LCD_D22 MPP( 42, 0xb, 0, 0, 0, 0, 0, 0, 1 )
303303
304304 #define MPP43_GPIO MPP( 43, 0x0, 1, 1, 1, 0, 0, 1, 1 )
305−#define MPP43_TSMP7 MPP( 43, 0x1, 1, 1, 0, 0, 0, 1, 1 )
305+#define MPP43_TSMP7 MPP( 43, 0x1, 0, 0, 0, 0, 0, 1, 1 )
306306 #define MPP43_TDM_CODEC_INTn MPP( 43, 0x2, 0, 0, 0, 0, 0, 1, 1 )
307−#define MPP43_AU_I2SDI MPP( 43, 0x4, 1, 0, 1, 0, 0, 1, 1 )
307+#define MPP43_AU_I2SDI MPP( 43, 0x4, 0, 0, 1, 0, 0, 1, 1 )
308308 #define MPP43_LCD_D23 MPP( 22, 0xb, 0, 0, 0, 0, 0, 0, 1 )
309309
310310 #define MPP44_GPIO MPP( 44, 0x0, 1, 1, 1, 0, 0, 1, 1 )
311−#define MPP44_TSMP8 MPP( 44, 0x1, 1, 1, 0, 0, 0, 1, 1 )
311+#define MPP44_TSMP8 MPP( 44, 0x1, 0, 0, 0, 0, 0, 1, 1 )
312312 #define MPP44_TDM_CODEC_RSTn MPP( 44, 0x2, 0, 0, 0, 0, 0, 1, 1 )
313−#define MPP44_AU_EXTCLK MPP( 44, 0x4, 1, 0, 1, 0, 0, 1, 1 )
313+#define MPP44_AU_EXTCLK MPP( 44, 0x4, 0, 0, 1, 0, 0, 1, 1 )
314314 #define MPP44_LCD_CLK MPP( 44, 0xb, 0, 0, 0, 0, 0, 0, 1 )
315315
316316 #define MPP45_GPIO MPP( 45, 0x0, 1, 1, 0, 0, 0, 1, 1 )
317−#define MPP45_TSMP9 MPP( 45, 0x1, 1, 1, 0, 0, 0, 1, 1 )
318−#define MPP45_TDM_PCLK MPP( 45, 0x2, 1, 1, 0, 0, 0, 1, 1 )
317+#define MPP45_TSMP9 MPP( 45, 0x1, 0, 0, 0, 0, 0, 1, 1 )
318+#define MPP45_TDM_PCLK MPP( 45, 0x2, 0, 0, 0, 0, 0, 1, 1 )
319319 #define MPP245_LCD_E MPP( 45, 0xb, 0, 0, 0, 0, 0, 0, 1 )
320320
321321 #define MPP46_GPIO MPP( 46, 0x0, 1, 1, 0, 0, 0, 1, 1 )
322−#define MPP46_TSMP10 MPP( 46, 0x1, 1, 1, 0, 0, 0, 1, 1 )
323−#define MPP46_TDM_FS MPP( 46, 0x2, 1, 1, 0, 0, 0, 1, 1 )
322+#define MPP46_TSMP10 MPP( 46, 0x1, 0, 0, 0, 0, 0, 1, 1 )
323+#define MPP46_TDM_FS MPP( 46, 0x2, 0, 0, 0, 0, 0, 1, 1 )
324324 #define MPP46_LCD_HSYNC MPP( 46, 0xb, 0, 0, 0, 0, 0, 0, 1 )
325325
326326 #define MPP47_GPIO MPP( 47, 0x0, 1, 1, 0, 0, 0, 1, 1 )
327−#define MPP47_TSMP11 MPP( 47, 0x1, 1, 1, 0, 0, 0, 1, 1 )
328−#define MPP47_TDM_DRX MPP( 47, 0x2, 1, 0, 0, 0, 0, 1, 1 )
327+#define MPP47_TSMP11 MPP( 47, 0x1, 0, 0, 0, 0, 0, 1, 1 )
328+#define MPP47_TDM_DRX MPP( 47, 0x2, 0, 0, 0, 0, 0, 1, 1 )
329329 #define MPP47_LCD_VSYNC MPP( 47, 0xb, 0, 0, 0, 0, 0, 0, 1 )
330330
331331 #define MPP48_GPIO MPP( 48, 0x0, 1, 1, 0, 0, 0, 1, 1 )
332−#define MPP48_TSMP12 MPP( 48, 0x1, 1, 1, 0, 0, 0, 1, 1 )
333−#define MPP48_TDM_DTX MPP( 48, 0x2, 0, 1, 0, 0, 0, 1, 1 )
332+#define MPP48_TSMP12 MPP( 48, 0x1, 0, 0, 0, 0, 0, 1, 1 )
333+#define MPP48_TDM_DTX MPP( 48, 0x2, 0, 0, 0, 0, 0, 1, 1 )
334334 #define MPP48_LCD_D16 MPP( 22, 0xb, 0, 0, 0, 0, 0, 0, 1 )
335335
336336 #define MPP49_GPIO MPP( 49, 0x0, 1, 1, 0, 0, 0, 1, 0 )
337337 #define MPP49_GPO MPP( 49, 0x0, 0, 1, 0, 0, 0, 0, 1 )
338−#define MPP49_TSMP9 MPP( 49, 0x1, 1, 1, 0, 0, 0, 1, 0 )
339−#define MPP49_TDM_CH0_RX_QL MPP( 49, 0x2, 0, 1, 0, 0, 0, 1, 1 )
340−#define MPP49_PTP_CLK MPP( 49, 0x5, 1, 0, 0, 0, 0, 1, 0 )
341−#define MPP49_PEX0_CLKREQ MPP( 49, 0xa, 0, 1, 0, 0, 0, 0, 1 )
338+#define MPP49_TSMP9 MPP( 49, 0x1, 0, 0, 0, 0, 0, 1, 0 )
339+#define MPP49_TDM_CH0_RX_QL MPP( 49, 0x2, 0, 0, 0, 0, 0, 1, 1 )
340+#define MPP49_PTP_CLK MPP( 49, 0x5, 0, 0, 0, 0, 0, 1, 0 )
341+#define MPP49_PEX0_CLKREQ MPP( 49, 0xa, 0, 0, 0, 0, 0, 0, 1 )
342342 #define MPP49_LCD_D17 MPP( 49, 0xb, 0, 0, 0, 0, 0, 0, 1 )
343343
344344 #define MPP_MAX 49
arch/arm/mach-mv78xx0/common.c+2−1
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <mach/mv78xx0.h>
2020 #include <mach/bridge-regs.h>
2121 #include <plat/cache-feroceon-l2.h>
22+#include <plat/ehci-orion.h>
2223 #include <plat/orion_nand.h>
2324 #include <plat/time.h>
2425 #include <plat/common.h>
@@ -169,7 +170,7 @@ void __init mv78xx0_map_io(void) · 144 unmodified lines
169170 ****************************************************************************/
170171 void __init mv78xx0_ehci0_init(void)
171172 {
172− orion_ehci_init(USB0_PHYS_BASE, IRQ_MV78XX0_USB_0);
173+ orion_ehci_init(USB0_PHYS_BASE, IRQ_MV78XX0_USB_0, EHCI_PHY_NA);
173174 }
174175
175176
arch/arm/mach-mv78xx0/mpp.h+113−113
@@ -24,296 +24,296 @@ · 23 unmodified lines
2424 #define MPP_78100_A0_MASK MPP(0, 0x0, 0, 0, 1)
2525
2626 #define MPP0_GPIO MPP(0, 0x0, 1, 1, 1)
27−#define MPP0_GE0_COL MPP(0, 0x1, 1, 0, 1)
28−#define MPP0_GE1_TXCLK MPP(0, 0x2, 0, 1, 1)
27+#define MPP0_GE0_COL MPP(0, 0x1, 0, 0, 1)
28+#define MPP0_GE1_TXCLK MPP(0, 0x2, 0, 0, 1)
2929 #define MPP0_UNUSED MPP(0, 0x3, 0, 0, 1)
3030
3131 #define MPP1_GPIO MPP(1, 0x0, 1, 1, 1)
32−#define MPP1_GE0_RXERR MPP(1, 0x1, 1, 0, 1)
33−#define MPP1_GE1_TXCTL MPP(1, 0x2, 0, 1, 1)
32+#define MPP1_GE0_RXERR MPP(1, 0x1, 0, 0, 1)
33+#define MPP1_GE1_TXCTL MPP(1, 0x2, 0, 0, 1)
3434 #define MPP1_UNUSED MPP(1, 0x3, 0, 0, 1)
3535
3636 #define MPP2_GPIO MPP(2, 0x0, 1, 1, 1)
37−#define MPP2_GE0_CRS MPP(2, 0x1, 1, 0, 1)
38−#define MPP2_GE1_RXCTL MPP(2, 0x2, 1, 0, 1)
37+#define MPP2_GE0_CRS MPP(2, 0x1, 0, 0, 1)
38+#define MPP2_GE1_RXCTL MPP(2, 0x2, 0, 0, 1)
3939 #define MPP2_UNUSED MPP(2, 0x3, 0, 0, 1)
4040
4141 #define MPP3_GPIO MPP(3, 0x0, 1, 1, 1)
42−#define MPP3_GE0_TXERR MPP(3, 0x1, 0, 1, 1)
43−#define MPP3_GE1_RXCLK MPP(3, 0x2, 1, 0, 1)
42+#define MPP3_GE0_TXERR MPP(3, 0x1, 0, 0, 1)
43+#define MPP3_GE1_RXCLK MPP(3, 0x2, 0, 0, 1)
4444 #define MPP3_UNUSED MPP(3, 0x3, 0, 0, 1)
4545
4646 #define MPP4_GPIO MPP(4, 0x0, 1, 1, 1)
47−#define MPP4_GE0_TXD4 MPP(4, 0x1, 0, 1, 1)
48−#define MPP4_GE1_TXD0 MPP(4, 0x2, 0, 1, 1)
47+#define MPP4_GE0_TXD4 MPP(4, 0x1, 0, 0, 1)
48+#define MPP4_GE1_TXD0 MPP(4, 0x2, 0, 0, 1)
4949 #define MPP4_UNUSED MPP(4, 0x3, 0, 0, 1)
5050
5151 #define MPP5_GPIO MPP(5, 0x0, 1, 1, 1)
52−#define MPP5_GE0_TXD5 MPP(5, 0x1, 0, 1, 1)
53−#define MPP5_GE1_TXD1 MPP(5, 0x2, 0, 1, 1)
52+#define MPP5_GE0_TXD5 MPP(5, 0x1, 0, 0, 1)
53+#define MPP5_GE1_TXD1 MPP(5, 0x2, 0, 0, 1)
5454 #define MPP5_UNUSED MPP(5, 0x3, 0, 0, 1)
5555
5656 #define MPP6_GPIO MPP(6, 0x0, 1, 1, 1)
57−#define MPP6_GE0_TXD6 MPP(6, 0x1, 0, 1, 1)
58−#define MPP6_GE1_TXD2 MPP(6, 0x2, 0, 1, 1)
57+#define MPP6_GE0_TXD6 MPP(6, 0x1, 0, 0, 1)
58+#define MPP6_GE1_TXD2 MPP(6, 0x2, 0, 0, 1)
5959 #define MPP6_UNUSED MPP(6, 0x3, 0, 0, 1)
6060
6161 #define MPP7_GPIO MPP(7, 0x0, 1, 1, 1)
62−#define MPP7_GE0_TXD7 MPP(7, 0x1, 0, 1, 1)
63−#define MPP7_GE1_TXD3 MPP(7, 0x2, 0, 1, 1)
62+#define MPP7_GE0_TXD7 MPP(7, 0x1, 0, 0, 1)
63+#define MPP7_GE1_TXD3 MPP(7, 0x2, 0, 0, 1)
6464 #define MPP7_UNUSED MPP(7, 0x3, 0, 0, 1)
6565
6666 #define MPP8_GPIO MPP(8, 0x0, 1, 1, 1)
67−#define MPP8_GE0_RXD4 MPP(8, 0x1, 1, 0, 1)
68−#define MPP8_GE1_RXD0 MPP(8, 0x2, 1, 0, 1)
67+#define MPP8_GE0_RXD4 MPP(8, 0x1, 0, 0, 1)
68+#define MPP8_GE1_RXD0 MPP(8, 0x2, 0, 0, 1)
6969 #define MPP8_UNUSED MPP(8, 0x3, 0, 0, 1)
7070
7171 #define MPP9_GPIO MPP(9, 0x0, 1, 1, 1)
72−#define MPP9_GE0_RXD5 MPP(9, 0x1, 1, 0, 1)
73−#define MPP9_GE1_RXD1 MPP(9, 0x2, 1, 0, 1)
72+#define MPP9_GE0_RXD5 MPP(9, 0x1, 0, 0, 1)
73+#define MPP9_GE1_RXD1 MPP(9, 0x2, 0, 0, 1)
7474 #define MPP9_UNUSED MPP(9, 0x3, 0, 0, 1)
7575
7676 #define MPP10_GPIO MPP(10, 0x0, 1, 1, 1)
77−#define MPP10_GE0_RXD6 MPP(10, 0x1, 1, 0, 1)
78−#define MPP10_GE1_RXD2 MPP(10, 0x2, 1, 0, 1)
77+#define MPP10_GE0_RXD6 MPP(10, 0x1, 0, 0, 1)
78+#define MPP10_GE1_RXD2 MPP(10, 0x2, 0, 0, 1)
7979 #define MPP10_UNUSED MPP(10, 0x3, 0, 0, 1)
8080
8181 #define MPP11_GPIO MPP(11, 0x0, 1, 1, 1)
82−#define MPP11_GE0_RXD7 MPP(11, 0x1, 1, 0, 1)
83−#define MPP11_GE1_RXD3 MPP(11, 0x2, 1, 0, 1)
82+#define MPP11_GE0_RXD7 MPP(11, 0x1, 0, 0, 1)
83+#define MPP11_GE1_RXD3 MPP(11, 0x2, 0, 0, 1)
8484 #define MPP11_UNUSED MPP(11, 0x3, 0, 0, 1)
8585
8686 #define MPP12_GPIO MPP(12, 0x0, 1, 1, 1)
87−#define MPP12_M_BB MPP(12, 0x3, 1, 0, 1)
88−#define MPP12_UA0_CTSn MPP(12, 0x4, 1, 0, 1)
89−#define MPP12_NAND_FLASH_REn0 MPP(12, 0x5, 0, 1, 1)
90−#define MPP12_TDM0_SCSn MPP(12, 0X6, 0, 1, 1)
87+#define MPP12_M_BB MPP(12, 0x3, 0, 0, 1)
88+#define MPP12_UA0_CTSn MPP(12, 0x4, 0, 0, 1)
89+#define MPP12_NAND_FLASH_REn0 MPP(12, 0x5, 0, 0, 1)
90+#define MPP12_TDM0_SCSn MPP(12, 0X6, 0, 0, 1)
9191 #define MPP12_UNUSED MPP(12, 0x1, 0, 0, 1)
9292
9393 #define MPP13_GPIO MPP(13, 0x0, 1, 1, 1)
94−#define MPP13_SYSRST_OUTn MPP(13, 0x3, 0, 1, 1)
95−#define MPP13_UA0_RTSn MPP(13, 0x4, 0, 1, 1)
96−#define MPP13_NAN_FLASH_WEn0 MPP(13, 0x5, 0, 1, 1)
97−#define MPP13_TDM_SCLK MPP(13, 0x6, 0, 1, 1)
94+#define MPP13_SYSRST_OUTn MPP(13, 0x3, 0, 0, 1)
95+#define MPP13_UA0_RTSn MPP(13, 0x4, 0, 0, 1)
96+#define MPP13_NAN_FLASH_WEn0 MPP(13, 0x5, 0, 0, 1)
97+#define MPP13_TDM_SCLK MPP(13, 0x6, 0, 0, 1)
9898 #define MPP13_UNUSED MPP(13, 0x1, 0, 0, 1)
9999
100100 #define MPP14_GPIO MPP(14, 0x0, 1, 1, 1)
101−#define MPP14_SATA1_ACTn MPP(14, 0x3, 0, 1, 1)
102−#define MPP14_UA1_CTSn MPP(14, 0x4, 1, 0, 1)
103−#define MPP14_NAND_FLASH_REn1 MPP(14, 0x5, 0, 1, 1)
104−#define MPP14_TDM_SMOSI MPP(14, 0x6, 0, 1, 1)
101+#define MPP14_SATA1_ACTn MPP(14, 0x3, 0, 0, 1)
102+#define MPP14_UA1_CTSn MPP(14, 0x4, 0, 0, 1)
103+#define MPP14_NAND_FLASH_REn1 MPP(14, 0x5, 0, 0, 1)
104+#define MPP14_TDM_SMOSI MPP(14, 0x6, 0, 0, 1)
105105 #define MPP14_UNUSED MPP(14, 0x1, 0, 0, 1)
106106
107107 #define MPP15_GPIO MPP(15, 0x0, 1, 1, 1)
108−#define MPP15_SATA0_ACTn MPP(15, 0x3, 0, 1, 1)
109−#define MPP15_UA1_RTSn MPP(15, 0x4, 0, 1, 1)
110−#define MPP15_NAND_FLASH_WEn1 MPP(15, 0x5, 0, 1, 1)
111−#define MPP15_TDM_SMISO MPP(15, 0x6, 1, 0, 1)
108+#define MPP15_SATA0_ACTn MPP(15, 0x3, 0, 0, 1)
109+#define MPP15_UA1_RTSn MPP(15, 0x4, 0, 0, 1)
110+#define MPP15_NAND_FLASH_WEn1 MPP(15, 0x5, 0, 0, 1)
111+#define MPP15_TDM_SMISO MPP(15, 0x6, 0, 0, 1)
112112 #define MPP15_UNUSED MPP(15, 0x1, 0, 0, 1)
113113
114114 #define MPP16_GPIO MPP(16, 0x0, 1, 1, 1)
115−#define MPP16_SATA1_PRESENTn MPP(16, 0x3, 0, 1, 1)
116−#define MPP16_UA2_TXD MPP(16, 0x4, 0, 1, 1)
117−#define MPP16_NAND_FLASH_REn3 MPP(16, 0x5, 0, 1, 1)
118−#define MPP16_TDM_INTn MPP(16, 0x6, 1, 0, 1)
115+#define MPP16_SATA1_PRESENTn MPP(16, 0x3, 0, 0, 1)
116+#define MPP16_UA2_TXD MPP(16, 0x4, 0, 0, 1)
117+#define MPP16_NAND_FLASH_REn3 MPP(16, 0x5, 0, 0, 1)
118+#define MPP16_TDM_INTn MPP(16, 0x6, 0, 0, 1)
119119 #define MPP16_UNUSED MPP(16, 0x1, 0, 0, 1)
120120
121121
122122 #define MPP17_GPIO MPP(17, 0x0, 1, 1, 1)
123−#define MPP17_SATA0_PRESENTn MPP(17, 0x3, 0, 1, 1)
124−#define MPP17_UA2_RXD MPP(17, 0x4, 1, 0, 1)
125−#define MPP17_NAND_FLASH_WEn3 MPP(17, 0x5, 0, 1, 1)
126−#define MPP17_TDM_RSTn MPP(17, 0x6, 0, 1, 1)
123+#define MPP17_SATA0_PRESENTn MPP(17, 0x3, 0, 0, 1)
124+#define MPP17_UA2_RXD MPP(17, 0x4, 0, 0, 1)
125+#define MPP17_NAND_FLASH_WEn3 MPP(17, 0x5, 0, 0, 1)
126+#define MPP17_TDM_RSTn MPP(17, 0x6, 0, 0, 1)
127127 #define MPP17_UNUSED MPP(17, 0x1, 0, 0, 1)
128128
129129
130130 #define MPP18_GPIO MPP(18, 0x0, 1, 1, 1)
131−#define MPP18_UA0_CTSn MPP(18, 0x4, 1, 0, 1)
132−#define MPP18_BOOT_FLASH_REn MPP(18, 0x5, 0, 1, 1)
131+#define MPP18_UA0_CTSn MPP(18, 0x4, 0, 0, 1)
132+#define MPP18_BOOT_FLASH_REn MPP(18, 0x5, 0, 0, 1)
133133 #define MPP18_UNUSED MPP(18, 0x1, 0, 0, 1)
134134
135135
136136
137137 #define MPP19_GPIO MPP(19, 0x0, 1, 1, 1)
138−#define MPP19_UA0_CTSn MPP(19, 0x4, 0, 1, 1)
139−#define MPP19_BOOT_FLASH_WEn MPP(19, 0x5, 0, 1, 1)
138+#define MPP19_UA0_CTSn MPP(19, 0x4, 0, 0, 1)
139+#define MPP19_BOOT_FLASH_WEn MPP(19, 0x5, 0, 0, 1)
140140 #define MPP19_UNUSED MPP(19, 0x1, 0, 0, 1)
141141
142142
143143 #define MPP20_GPIO MPP(20, 0x0, 1, 1, 1)
144−#define MPP20_UA1_CTSs MPP(20, 0x4, 1, 0, 1)
145−#define MPP20_TDM_PCLK MPP(20, 0x6, 1, 1, 0)
144+#define MPP20_UA1_CTSs MPP(20, 0x4, 0, 0, 1)
145+#define MPP20_TDM_PCLK MPP(20, 0x6, 0, 0, 0)
146146 #define MPP20_UNUSED MPP(20, 0x1, 0, 0, 1)
147147
148148
149149
150150 #define MPP21_GPIO MPP(21, 0x0, 1, 1, 1)
151−#define MPP21_UA1_CTSs MPP(21, 0x4, 0, 1, 1)
152−#define MPP21_TDM_FSYNC MPP(21, 0x6, 1, 1, 0)
151+#define MPP21_UA1_CTSs MPP(21, 0x4, 0, 0, 1)
152+#define MPP21_TDM_FSYNC MPP(21, 0x6, 0, 0, 0)
153153 #define MPP21_UNUSED MPP(21, 0x1, 0, 0, 1)
154154
155155
156156
157157 #define MPP22_GPIO MPP(22, 0x0, 1, 1, 1)
158−#define MPP22_UA3_TDX MPP(22, 0x4, 0, 1, 1)
159−#define MPP22_NAND_FLASH_REn2 MPP(22, 0x5, 0, 1, 1)
160−#define MPP22_TDM_DRX MPP(22, 0x6, 1, 0, 1)
158+#define MPP22_UA3_TDX MPP(22, 0x4, 0, 0, 1)
159+#define MPP22_NAND_FLASH_REn2 MPP(22, 0x5, 0, 0, 1)
160+#define MPP22_TDM_DRX MPP(22, 0x6, 0, 0, 1)
161161 #define MPP22_UNUSED MPP(22, 0x1, 0, 0, 1)
162162
163163
164164
165165 #define MPP23_GPIO MPP(23, 0x0, 1, 1, 1)
166−#define MPP23_UA3_RDX MPP(23, 0x4, 1, 0, 1)
167−#define MPP23_NAND_FLASH_WEn2 MPP(23, 0x5, 0, 1, 1)
168−#define MPP23_TDM_DTX MPP(23, 0x6, 0, 1, 1)
166+#define MPP23_UA3_RDX MPP(23, 0x4, 0, 0, 1)
167+#define MPP23_NAND_FLASH_WEn2 MPP(23, 0x5, 0, 0, 1)
168+#define MPP23_TDM_DTX MPP(23, 0x6, 0, 0, 1)
169169 #define MPP23_UNUSED MPP(23, 0x1, 0, 0, 1)
170170
171171
172172 #define MPP24_GPIO MPP(24, 0x0, 1, 1, 1)
173−#define MPP24_UA2_TXD MPP(24, 0x4, 0, 1, 1)
174−#define MPP24_TDM_INTn MPP(24, 0x6, 1, 0, 1)
173+#define MPP24_UA2_TXD MPP(24, 0x4, 0, 0, 1)
174+#define MPP24_TDM_INTn MPP(24, 0x6, 0, 0, 1)
175175 #define MPP24_UNUSED MPP(24, 0x1, 0, 0, 1)
176176
177177
178178 #define MPP25_GPIO MPP(25, 0x0, 1, 1, 1)
179−#define MPP25_UA2_RXD MPP(25, 0x4, 1, 0, 1)
180−#define MPP25_TDM_RSTn MPP(25, 0x6, 0, 1, 1)
179+#define MPP25_UA2_RXD MPP(25, 0x4, 0, 0, 1)
180+#define MPP25_TDM_RSTn MPP(25, 0x6, 0, 0, 1)
181181 #define MPP25_UNUSED MPP(25, 0x1, 0, 0, 1)
182182
183183
184184 #define MPP26_GPIO MPP(26, 0x0, 1, 1, 1)
185−#define MPP26_UA2_CTSn MPP(26, 0x4, 1, 0, 1)
186−#define MPP26_TDM_PCLK MPP(26, 0x6, 1, 1, 1)
185+#define MPP26_UA2_CTSn MPP(26, 0x4, 0, 0, 1)
186+#define MPP26_TDM_PCLK MPP(26, 0x6, 0, 0, 1)
187187 #define MPP26_UNUSED MPP(26, 0x1, 0, 0, 1)
188188
189189
190190 #define MPP27_GPIO MPP(27, 0x0, 1, 1, 1)
191−#define MPP27_UA2_RTSn MPP(27, 0x4, 0, 1, 1)
192−#define MPP27_TDM_FSYNC MPP(27, 0x6, 1, 1, 1)
191+#define MPP27_UA2_RTSn MPP(27, 0x4, 0, 0, 1)
192+#define MPP27_TDM_FSYNC MPP(27, 0x6, 0, 0, 1)
193193 #define MPP27_UNUSED MPP(27, 0x1, 0, 0, 1)
194194
195195
196196 #define MPP28_GPIO MPP(28, 0x0, 1, 1, 1)
197−#define MPP28_UA3_TXD MPP(28, 0x4, 0, 1, 1)
198−#define MPP28_TDM_DRX MPP(28, 0x6, 1, 0, 1)
197+#define MPP28_UA3_TXD MPP(28, 0x4, 0, 0, 1)
198+#define MPP28_TDM_DRX MPP(28, 0x6, 0, 0, 1)
199199 #define MPP28_UNUSED MPP(28, 0x1, 0, 0, 1)
200200
201201 #define MPP29_GPIO MPP(29, 0x0, 1, 1, 1)
202−#define MPP29_UA3_RXD MPP(29, 0x4, 1, 0, 1)
203−#define MPP29_SYSRST_OUTn MPP(29, 0x5, 0, 1, 1)
204−#define MPP29_TDM_DTX MPP(29, 0x6, 0, 1, 1)
202+#define MPP29_UA3_RXD MPP(29, 0x4, 0, 0, 1)
203+#define MPP29_SYSRST_OUTn MPP(29, 0x5, 0, 0, 1)
204+#define MPP29_TDM_DTX MPP(29, 0x6, 0, 0, 1)
205205 #define MPP29_UNUSED MPP(29, 0x1, 0, 0, 1)
206206
207207 #define MPP30_GPIO MPP(30, 0x0, 1, 1, 1)
208−#define MPP30_UA3_CTSn MPP(30, 0x4, 1, 0, 1)
208+#define MPP30_UA3_CTSn MPP(30, 0x4, 0, 0, 1)
209209 #define MPP30_UNUSED MPP(30, 0x1, 0, 0, 1)
210210
211211 #define MPP31_GPIO MPP(31, 0x0, 1, 1, 1)
212−#define MPP31_UA3_RTSn MPP(31, 0x4, 0, 1, 1)
213−#define MPP31_TDM1_SCSn MPP(31, 0x6, 0, 1, 1)
212+#define MPP31_UA3_RTSn MPP(31, 0x4, 0, 0, 1)
213+#define MPP31_TDM1_SCSn MPP(31, 0x6, 0, 0, 1)
214214 #define MPP31_UNUSED MPP(31, 0x1, 0, 0, 1)
215215
216216
217217 #define MPP32_GPIO MPP(32, 0x1, 1, 1, 1)
218−#define MPP32_UA3_TDX MPP(32, 0x4, 0, 1, 1)
219−#define MPP32_SYSRST_OUTn MPP(32, 0x5, 0, 1, 1)
220−#define MPP32_TDM0_RXQ MPP(32, 0x6, 0, 1, 1)
218+#define MPP32_UA3_TDX MPP(32, 0x4, 0, 0, 1)
219+#define MPP32_SYSRST_OUTn MPP(32, 0x5, 0, 0, 1)
220+#define MPP32_TDM0_RXQ MPP(32, 0x6, 0, 0, 1)
221221 #define MPP32_UNUSED MPP(32, 0x3, 0, 0, 1)
222222
223223
224224 #define MPP33_GPIO MPP(33, 0x1, 1, 1, 1)
225−#define MPP33_UA3_RDX MPP(33, 0x4, 1, 0, 1)
226−#define MPP33_TDM0_TXQ MPP(33, 0x6, 0, 1, 1)
225+#define MPP33_UA3_RDX MPP(33, 0x4, 0, 0, 1)
226+#define MPP33_TDM0_TXQ MPP(33, 0x6, 0, 0, 1)
227227 #define MPP33_UNUSED MPP(33, 0x3, 0, 0, 1)
228228
229229
230230
231231 #define MPP34_GPIO MPP(34, 0x1, 1, 1, 1)
232−#define MPP34_UA2_TDX MPP(34, 0x4, 0, 1, 1)
233−#define MPP34_TDM1_RXQ MPP(34, 0x6, 0, 1, 1)
232+#define MPP34_UA2_TDX MPP(34, 0x4, 0, 0, 1)
233+#define MPP34_TDM1_RXQ MPP(34, 0x6, 0, 0, 1)
234234 #define MPP34_UNUSED MPP(34, 0x3, 0, 0, 1)
235235
236236
237237
238238 #define MPP35_GPIO MPP(35, 0x1, 1, 1, 1)
239−#define MPP35_UA2_RDX MPP(35, 0x4, 1, 0, 1)
240−#define MPP35_TDM1_TXQ MPP(35, 0x6, 0, 1, 1)
239+#define MPP35_UA2_RDX MPP(35, 0x4, 0, 0, 1)
240+#define MPP35_TDM1_TXQ MPP(35, 0x6, 0, 0, 1)
241241 #define MPP35_UNUSED MPP(35, 0x3, 0, 0, 1)
242242
243243 #define MPP36_GPIO MPP(36, 0x1, 1, 1, 1)
244−#define MPP36_UA0_CTSn MPP(36, 0x2, 1, 0, 1)
245−#define MPP36_UA2_TDX MPP(36, 0x4, 0, 1, 1)
246−#define MPP36_TDM0_SCSn MPP(36, 0x6, 0, 1, 1)
244+#define MPP36_UA0_CTSn MPP(36, 0x2, 0, 0, 1)
245+#define MPP36_UA2_TDX MPP(36, 0x4, 0, 0, 1)
246+#define MPP36_TDM0_SCSn MPP(36, 0x6, 0, 0, 1)
247247 #define MPP36_UNUSED MPP(36, 0x3, 0, 0, 1)
248248
249249
250250 #define MPP37_GPIO MPP(37, 0x1, 1, 1, 1)
251−#define MPP37_UA0_RTSn MPP(37, 0x2, 0, 1, 1)
252−#define MPP37_UA2_RXD MPP(37, 0x4, 1, 0, 1)
253−#define MPP37_SYSRST_OUTn MPP(37, 0x5, 0, 1, 1)
254−#define MPP37_TDM_SCLK MPP(37, 0x6, 0, 1, 1)
251+#define MPP37_UA0_RTSn MPP(37, 0x2, 0, 0, 1)
252+#define MPP37_UA2_RXD MPP(37, 0x4, 0, 0, 1)
253+#define MPP37_SYSRST_OUTn MPP(37, 0x5, 0, 0, 1)
254+#define MPP37_TDM_SCLK MPP(37, 0x6, 0, 0, 1)
255255 #define MPP37_UNUSED MPP(37, 0x3, 0, 0, 1)
256256
257257
258258
259259
260260 #define MPP38_GPIO MPP(38, 0x1, 1, 1, 1)
261−#define MPP38_UA1_CTSn MPP(38, 0x2, 1, 0, 1)
262−#define MPP38_UA3_TXD MPP(38, 0x4, 0, 1, 1)
263−#define MPP38_SYSRST_OUTn MPP(38, 0x5, 0, 1, 1)
264−#define MPP38_TDM_SMOSI MPP(38, 0x6, 0, 1, 1)
261+#define MPP38_UA1_CTSn MPP(38, 0x2, 0, 0, 1)
262+#define MPP38_UA3_TXD MPP(38, 0x4, 0, 0, 1)
263+#define MPP38_SYSRST_OUTn MPP(38, 0x5, 0, 0, 1)
264+#define MPP38_TDM_SMOSI MPP(38, 0x6, 0, 0, 1)
265265 #define MPP38_UNUSED MPP(38, 0x3, 0, 0, 1)
266266
267267
268268
269269
270270 #define MPP39_GPIO MPP(39, 0x1, 1, 1, 1)
271−#define MPP39_UA1_RTSn MPP(39, 0x2, 0, 1, 1)
272−#define MPP39_UA3_RXD MPP(39, 0x4, 1, 0, 1)
273−#define MPP39_SYSRST_OUTn MPP(39, 0x5, 0, 1, 1)
274−#define MPP39_TDM_SMISO MPP(39, 0x6, 1, 0, 1)
271+#define MPP39_UA1_RTSn MPP(39, 0x2, 0, 0, 1)
272+#define MPP39_UA3_RXD MPP(39, 0x4, 0, 0, 1)
273+#define MPP39_SYSRST_OUTn MPP(39, 0x5, 0, 0, 1)
274+#define MPP39_TDM_SMISO MPP(39, 0x6, 0, 0, 1)
275275 #define MPP39_UNUSED MPP(39, 0x3, 0, 0, 1)
276276
277277
278278
279279 #define MPP40_GPIO MPP(40, 0x1, 1, 1, 1)
280−#define MPP40_TDM_INTn MPP(40, 0x6, 1, 0, 1)
280+#define MPP40_TDM_INTn MPP(40, 0x6, 0, 0, 1)
281281 #define MPP40_UNUSED MPP(40, 0x0, 0, 0, 1)
282282
283283
284284
285285 #define MPP41_GPIO MPP(41, 0x1, 1, 1, 1)
286−#define MPP41_TDM_RSTn MPP(41, 0x6, 0, 1, 1)
286+#define MPP41_TDM_RSTn MPP(41, 0x6, 0, 0, 1)
287287 #define MPP41_UNUSED MPP(41, 0x0, 0, 0, 1)
288288
289289
290290
291291 #define MPP42_GPIO MPP(42, 0x1, 1, 1, 1)
292−#define MPP42_TDM_PCLK MPP(42, 0x6, 1, 1, 1)
292+#define MPP42_TDM_PCLK MPP(42, 0x6, 0, 0, 1)
293293 #define MPP42_UNUSED MPP(42, 0x0, 0, 0, 1)
294294
295295
296296
297297 #define MPP43_GPIO MPP(43, 0x1, 1, 1, 1)
298−#define MPP43_TDM_FSYNC MPP(43, 0x6, 1, 1, 1)
298+#define MPP43_TDM_FSYNC MPP(43, 0x6, 0, 0, 1)
299299 #define MPP43_UNUSED MPP(43, 0x0, 0, 0, 1)
300300
301301
302302
303303 #define MPP44_GPIO MPP(44, 0x1, 1, 1, 1)
304−#define MPP44_TDM_DRX MPP(44, 0x6, 1, 0, 1)
304+#define MPP44_TDM_DRX MPP(44, 0x6, 0, 0, 1)
305305 #define MPP44_UNUSED MPP(44, 0x0, 0, 0, 1)
306306
307307
308308
309309 #define MPP45_GPIO MPP(45, 0x1, 1, 1, 1)
310−#define MPP45_SATA0_ACTn MPP(45, 0x3, 0, 1, 1)
311−#define MPP45_TDM_DRX MPP(45, 0x6, 0, 1, 1)
310+#define MPP45_SATA0_ACTn MPP(45, 0x3, 0, 0, 1)
311+#define MPP45_TDM_DRX MPP(45, 0x6, 0, 0, 1)
312312 #define MPP45_UNUSED MPP(45, 0x0, 0, 0, 1)
313313
314314
315315 #define MPP46_GPIO MPP(46, 0x1, 1, 1, 1)
316−#define MPP46_TDM_SCSn MPP(46, 0x6, 0, 1, 1)
316+#define MPP46_TDM_SCSn MPP(46, 0x6, 0, 0, 1)
317317 #define MPP46_UNUSED MPP(46, 0x0, 0, 0, 1)
318318
319319
@@ -323,14 +323,14 @@ · 3 unmodified lines
323323
324324
325325 #define MPP48_GPIO MPP(48, 0x1, 1, 1, 1)
326−#define MPP48_SATA1_ACTn MPP(48, 0x3, 0, 1, 1)
326+#define MPP48_SATA1_ACTn MPP(48, 0x3, 0, 0, 1)
327327 #define MPP48_UNUSED MPP(48, 0x2, 0, 0, 1)
328328
329329
330330
331331 #define MPP49_GPIO MPP(49, 0x1, 1, 1, 1)
332−#define MPP49_SATA0_ACTn MPP(49, 0x3, 0, 1, 1)
333−#define MPP49_M_BB MPP(49, 0x4, 1, 0, 1)
332+#define MPP49_SATA0_ACTn MPP(49, 0x3, 0, 0, 1)
333+#define MPP49_M_BB MPP(49, 0x4, 0, 0, 1)
334334 #define MPP49_UNUSED MPP(49, 0x2, 0, 0, 1)
335335
336336
arch/arm/mach-omap2/Kconfig+5−6
@@ -213,13 +213,12 @@ config MACH_OMAP3_PANDORA · 212 unmodified lines
213213 depends on ARCH_OMAP3
214214 default y
215215 select OMAP_PACKAGE_CBB
216− select REGULATOR_FIXED_VOLTAGE
216+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
217217
218218 config MACH_OMAP3_TOUCHBOOK
219219 bool "OMAP3 Touch Book"
220220 depends on ARCH_OMAP3
221221 default y
222− select BACKLIGHT_CLASS_DEVICE
223222
224223 config MACH_OMAP_3430SDP
225224 bool "OMAP 3430 SDP board"
@@ -265,7 +264,7 @@ config MACH_OMAP_ZOOM2 · 39 unmodified lines
265264 select SERIAL_8250
266265 select SERIAL_CORE_CONSOLE
267266 select SERIAL_8250_CONSOLE
268− select REGULATOR_FIXED_VOLTAGE
267+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
269268
270269 config MACH_OMAP_ZOOM3
271270 bool "OMAP3630 Zoom3 board"
@@ -275,7 +274,7 @@ config MACH_OMAP_ZOOM3 · 3 unmodified lines
275274 select SERIAL_8250
276275 select SERIAL_CORE_CONSOLE
277276 select SERIAL_8250_CONSOLE
278− select REGULATOR_FIXED_VOLTAGE
277+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
279278
280279 config MACH_CM_T35
281280 bool "CompuLab CM-T35/CM-T3730 modules"
@@ -334,7 +333,7 @@ config MACH_OMAP_4430SDP · 52 unmodified lines
334333 depends on ARCH_OMAP4
335334 select OMAP_PACKAGE_CBL
336335 select OMAP_PACKAGE_CBS
337− select REGULATOR_FIXED_VOLTAGE
336+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
338337
339338 config MACH_OMAP4_PANDA
340339 bool "OMAP4 Panda Board"
@@ -342,7 +341,7 @@ config MACH_OMAP4_PANDA · 1 unmodified line
342341 depends on ARCH_OMAP4
343342 select OMAP_PACKAGE_CBL
344343 select OMAP_PACKAGE_CBS
345− select REGULATOR_FIXED_VOLTAGE
344+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
346345
347346 config OMAP3_EMU
348347 bool "OMAP3 debugging peripherals"
arch/arm/mach-omap2/Makefile+2−2
@@ -11,9 +11,9 @@ hwmod-common = omap_hwmod.o \ · 10 unmodified lines
1111 omap_hwmod_common_data.o
1212 clock-common = clock.o clock_common_data.o \
1313 clkt_dpll.o clkt_clksel.o
14−secure-common = omap-smc.o omap-secure.o
14+secure-common = omap-smc.o omap-secure.o
1515
16−obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
16+obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
1717 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common) $(secure-common)
1818 obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common) $(secure-common)
1919
arch/arm/mach-omap2/board-4430sdp.c+25−10
@@ -52,8 +52,9 @@ · 51 unmodified lines
5252 #define ETH_KS8851_QUART 138
5353 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
5454 #define OMAP4_SFH7741_ENABLE_GPIO 188
55−#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
55+#define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
5656 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
57+#define HDMI_GPIO_HPD 63 /* Hotplug detect */
5758 #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
5859 #define DLP_POWER_ON_GPIO 40
5960
@@ -603,8 +604,9 @@ static void __init omap_sfh7741prox_init(void) · 543 unmodified lines
603604 }
604605
605606 static struct gpio sdp4430_hdmi_gpios[] = {
606− { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" },
607+ { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
607608 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
609+ { HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" },
608610 };
609611
610612 static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
@@ -621,8 +623,7 @@ static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev) · 10 unmodified lines
621623
622624 static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
623625 {
624− gpio_free(HDMI_GPIO_LS_OE);
625− gpio_free(HDMI_GPIO_HPD);
626+ gpio_free_array(sdp4430_hdmi_gpios, ARRAY_SIZE(sdp4430_hdmi_gpios));
626627 }
627628
628629 static struct nokia_dsi_panel_data dsi1_panel = {
@@ -738,6 +739,10 @@ static void sdp4430_lcd_init(void) · 109 unmodified lines
738739 pr_err("%s: Could not get lcd2_reset_gpio\n", __func__);
739740 }
740741
742+static struct omap_dss_hdmi_data sdp4430_hdmi_data = {
743+ .hpd_gpio = HDMI_GPIO_HPD,
744+};
745+
741746 static struct omap_dss_device sdp4430_hdmi_device = {
742747 .name = "hdmi",
743748 .driver_name = "hdmi_panel",
@@ -745,6 +750,7 @@ static struct omap_dss_device sdp4430_hdmi_device = { · 1 unmodified line
745750 .platform_enable = sdp4430_panel_enable_hdmi,
746751 .platform_disable = sdp4430_panel_disable_hdmi,
747752 .channel = OMAP_DSS_CHANNEL_DIGIT,
753+ .data = &sdp4430_hdmi_data,
748754 };
749755
750756 static struct picodlp_panel_data sdp4430_picodlp_pdata = {
@@ -808,7 +814,7 @@ static struct omap_dss_board_info sdp4430_dss_data = { · 57 unmodified lines
808814 .default_device = &sdp4430_lcd_device,
809815 };
810816
811−static void omap_4430sdp_display_init(void)
817+static void __init omap_4430sdp_display_init(void)
812818 {
813819 int r;
814820
@@ -829,6 +835,10 @@ static void omap_4430sdp_display_init(void) · 14 unmodified lines
829835 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
830836 else
831837 omap_hdmi_init(0);
838+
839+ omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
840+ omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
841+ omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
832842 }
833843
834844 #ifdef CONFIG_OMAP_MUX
@@ -841,7 +851,7 @@ static struct omap_board_mux board_mux[] __initdata = { · 6 unmodified lines
841851 #define board_mux NULL
842852 #endif
843853
844−static void omap4_sdp4430_wifi_mux_init(void)
854+static void __init omap4_sdp4430_wifi_mux_init(void)
845855 {
846856 omap_mux_init_gpio(GPIO_WIFI_IRQ, OMAP_PIN_INPUT |
847857 OMAP_PIN_OFF_WAKEUPENABLE);
@@ -868,12 +878,17 @@ static struct wl12xx_platform_data omap4_sdp4430_wlan_data __initdata = { · 20 unmodified lines
868878 .board_tcxo_clock = WL12XX_TCXOCLOCK_26,
869879 };
870880
871−static void omap4_sdp4430_wifi_init(void)
881+static void __init omap4_sdp4430_wifi_init(void)
872882 {
883+ int ret;
884+
873885 omap4_sdp4430_wifi_mux_init();
874− if (wl12xx_set_platform_data(&omap4_sdp4430_wlan_data))
875− pr_err("Error setting wl12xx data\n");
876− platform_device_register(&omap_vwlan_device);
886+ ret = wl12xx_set_platform_data(&omap4_sdp4430_wlan_data);
887+ if (ret)
888+ pr_err("Error setting wl12xx data: %d\n", ret);
889+ ret = platform_device_register(&omap_vwlan_device);
890+ if (ret)
891+ pr_err("Error registering wl12xx device: %d\n", ret);
877892 }
878893
879894 static void __init omap_4430sdp_init(void)
arch/arm/mach-omap2/board-cm-t35.c+1−1
@@ -437,7 +437,7 @@ static struct usbhs_omap_board_data usbhs_bdata __initdata = { · 436 unmodified lines
437437 .reset_gpio_port[2] = -EINVAL
438438 };
439439
440−static void cm_t35_init_usbh(void)
440+static void __init cm_t35_init_usbh(void)
441441 {
442442 int err;
443443
arch/arm/mach-omap2/board-generic.c+4−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/i2c/twl.h>
1818
1919 #include <mach/hardware.h>
20+#include <asm/hardware/gic.h>
2021 #include <asm/mach/arch.h>
2122
2223 #include <plat/board.h>
@@ -102,6 +103,7 @@ DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") · 79 unmodified lines
102103 .map_io = omap242x_map_io,
103104 .init_early = omap2420_init_early,
104105 .init_irq = omap2_init_irq,
106+ .handle_irq = omap2_intc_handle_irq,
105107 .init_machine = omap_generic_init,
106108 .timer = &omap2_timer,
107109 .dt_compat = omap242x_boards_compat,
@@ -141,6 +143,7 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") · 33 unmodified lines
141143 .map_io = omap3_map_io,
142144 .init_early = omap3430_init_early,
143145 .init_irq = omap3_init_irq,
146+ .handle_irq = omap3_intc_handle_irq,
144147 .init_machine = omap3_init,
145148 .timer = &omap3_timer,
146149 .dt_compat = omap3_boards_compat,
@@ -160,6 +163,7 @@ DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") · 13 unmodified lines
160163 .map_io = omap4_map_io,
161164 .init_early = omap4430_init_early,
162165 .init_irq = gic_init_irq,
166+ .handle_irq = gic_handle_irq,
163167 .init_machine = omap4_init,
164168 .timer = &omap4_timer,
165169 .dt_compat = omap4_boards_compat,
arch/arm/mach-omap2/board-omap3evm.c+16−7
@@ -617,6 +617,21 @@ static struct gpio omap3_evm_ehci_gpios[] __initdata = { · 616 unmodified lines
617617 { OMAP3_EVM_EHCI_SELECT, GPIOF_OUT_INIT_LOW, "select EHCI port" },
618618 };
619619
620+static void __init omap3_evm_wl12xx_init(void)
621+{
622+#ifdef CONFIG_WL12XX_PLATFORM_DATA
623+ int ret;
624+
625+ /* WL12xx WLAN Init */
626+ ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
627+ if (ret)
628+ pr_err("error setting wl12xx data: %d\n", ret);
629+ ret = platform_device_register(&omap3evm_wlan_regulator);
630+ if (ret)
631+ pr_err("error registering wl12xx device: %d\n", ret);
632+#endif
633+}
634+
620635 static void __init omap3_evm_init(void)
621636 {
622637 omap3_evm_get_revision();
@@ -665,13 +680,7 @@ static void __init omap3_evm_init(void) · 42 unmodified lines
665680 omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
666681 omap3evm_init_smsc911x();
667682 omap3_evm_display_init();
668−
669−#ifdef CONFIG_WL12XX_PLATFORM_DATA
670− /* WL12xx WLAN Init */
671− if (wl12xx_set_platform_data(&omap3evm_wlan_data))
672− pr_err("error setting wl12xx data\n");
673− platform_device_register(&omap3evm_wlan_regulator);
674−#endif
683+ omap3_evm_wl12xx_init();
675684 }
676685
677686 MACHINE_START(OMAP3EVM, "OMAP3 EVM")
arch/arm/mach-omap2/board-omap4panda.c+18−6
@@ -51,8 +51,9 @@ · 50 unmodified lines
5151 #define GPIO_HUB_NRESET 62
5252 #define GPIO_WIFI_PMENA 43
5353 #define GPIO_WIFI_IRQ 53
54−#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
54+#define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
5555 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
56+#define HDMI_GPIO_HPD 63 /* Hotplug detect */
5657
5758 /* wl127x BT, FM, GPS connectivity chip */
5859 static int wl1271_gpios[] = {46, -1, -1};
@@ -413,8 +414,9 @@ int __init omap4_panda_dvi_init(void) · 354 unmodified lines
413414 }
414415
415416 static struct gpio panda_hdmi_gpios[] = {
416− { HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_hpd" },
417+ { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" },
417418 { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" },
419+ { HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" },
418420 };
419421
420422 static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
@@ -431,10 +433,13 @@ static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev) · 10 unmodified lines
431433
432434 static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
433435 {
434− gpio_free(HDMI_GPIO_LS_OE);
435− gpio_free(HDMI_GPIO_HPD);
436+ gpio_free_array(panda_hdmi_gpios, ARRAY_SIZE(panda_hdmi_gpios));
436437 }
437438
439+static struct omap_dss_hdmi_data omap4_panda_hdmi_data = {
440+ .hpd_gpio = HDMI_GPIO_HPD,
441+};
442+
438443 static struct omap_dss_device omap4_panda_hdmi_device = {
439444 .name = "hdmi",
440445 .driver_name = "hdmi_panel",
@@ -442,6 +447,7 @@ static struct omap_dss_device omap4_panda_hdmi_device = { · 1 unmodified line
442447 .platform_enable = omap4_panda_panel_enable_hdmi,
443448 .platform_disable = omap4_panda_panel_disable_hdmi,
444449 .channel = OMAP_DSS_CHANNEL_DIGIT,
450+ .data = &omap4_panda_hdmi_data,
445451 };
446452
447453 static struct omap_dss_device *omap4_panda_dss_devices[] = {
@@ -473,18 +479,24 @@ void omap4_panda_display_init(void) · 25 unmodified lines
473479 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
474480 else
475481 omap_hdmi_init(0);
482+
483+ omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
484+ omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
485+ omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
476486 }
477487
478488 static void __init omap4_panda_init(void)
479489 {
480490 int package = OMAP_PACKAGE_CBS;
491+ int ret;
481492
482493 if (omap_rev() == OMAP4430_REV_ES1_0)
483494 package = OMAP_PACKAGE_CBL;
484495 omap4_mux_init(board_mux, NULL, package);
485496
486− if (wl12xx_set_platform_data(&omap_panda_wlan_data))
487− pr_err("error setting wl12xx data\n");
497+ ret = wl12xx_set_platform_data(&omap_panda_wlan_data);
498+ if (ret)
499+ pr_err("error setting wl12xx data: %d\n", ret);
488500
489501 omap4_panda_i2c_init();
490502 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
arch/arm/mach-omap2/board-zoom-peripherals.c+4−2
@@ -296,8 +296,10 @@ static void enable_board_wakeup_source(void) · 295 unmodified lines
296296
297297 void __init zoom_peripherals_init(void)
298298 {
299− if (wl12xx_set_platform_data(&omap_zoom_wlan_data))
300− pr_err("error setting wl12xx data\n");
299+ int ret = wl12xx_set_platform_data(&omap_zoom_wlan_data);
300+
301+ if (ret)
302+ pr_err("error setting wl12xx data: %d\n", ret);
301303
302304 omap_i2c_init();
303305 platform_device_register(&omap_vwlan_device);
arch/arm/mach-omap2/devices.c+1−0
@@ -405,6 +405,7 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) · 404 unmodified lines
405405 break;
406406 default:
407407 pr_err("Invalid McSPI Revision value\n");
408+ kfree(pdata);
408409 return -EINVAL;
409410 }
410411
arch/arm/mach-omap2/display.c+0−4
@@ -103,12 +103,8 @@ static void omap4_hdmi_mux_pads(enum omap_hdmi_flags flags) · 102 unmodified lines
103103 u32 reg;
104104 u16 control_i2c_1;
105105
106− /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
107− omap_mux_init_signal("hdmi_hpd",
108− OMAP_PIN_INPUT_PULLUP);
109106 omap_mux_init_signal("hdmi_cec",
110107 OMAP_PIN_INPUT_PULLUP);
111− /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
112108 omap_mux_init_signal("hdmi_ddc_scl",
113109 OMAP_PIN_INPUT_PULLUP);
114110 omap_mux_init_signal("hdmi_ddc_sda",
arch/arm/mach-omap2/gpmc.c+6−0
@@ -528,7 +528,13 @@ int gpmc_cs_configure(int cs, int cmd, int wval) · 527 unmodified lines
528528
529529 case GPMC_CONFIG_DEV_SIZE:
530530 regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
531+
532+ /* clear 2 target bits */
533+ regval &= ~GPMC_CONFIG1_DEVICESIZE(3);
534+
535+ /* set the proper value */
531536 regval |= GPMC_CONFIG1_DEVICESIZE(wval);
537+
532538 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
533539 break;
534540
arch/arm/mach-omap2/hsmmc.c+12−12
@@ -175,14 +175,15 @@ static void hsmmc2_select_input_clk_src(struct omap_mmc_platform_data *mmc) · 174 unmodified lines
175175 {
176176 u32 reg;
177177
178− if (mmc->slots[0].internal_clock) {
179− reg = omap_ctrl_readl(control_devconf1_offset);
178+ reg = omap_ctrl_readl(control_devconf1_offset);
179+ if (mmc->slots[0].internal_clock)
180180 reg |= OMAP2_MMCSDIO2ADPCLKISEL;
181− omap_ctrl_writel(reg, control_devconf1_offset);
182− }
181+ else
182+ reg &= ~OMAP2_MMCSDIO2ADPCLKISEL;
183+ omap_ctrl_writel(reg, control_devconf1_offset);
183184 }
184185
185−static void hsmmc23_before_set_reg(struct device *dev, int slot,
186+static void hsmmc2_before_set_reg(struct device *dev, int slot,
186187 int power_on, int vdd)
187188 {
188189 struct omap_mmc_platform_data *mmc = dev->platform_data;
@@ -292,8 +293,8 @@ static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller, · 103 unmodified lines
292293 }
293294 }
294295
295−static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
296− struct omap_mmc_platform_data *mmc)
296+static int omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
297+ struct omap_mmc_platform_data *mmc)
297298 {
298299 char *hc_name;
299300
@@ -407,14 +408,13 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, · 107 unmodified lines
407408 c->caps &= ~MMC_CAP_8_BIT_DATA;
408409 c->caps |= MMC_CAP_4_BIT_DATA;
409410 }
410− /* FALLTHROUGH */
411− case 3:
412411 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
413412 /* off-chip level shifting, or none */
414− mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
413+ mmc->slots[0].before_set_reg = hsmmc2_before_set_reg;
415414 mmc->slots[0].after_set_reg = NULL;
416415 }
417416 break;
417+ case 3:
418418 case 4:
419419 case 5:
420420 mmc->slots[0].before_set_reg = NULL;
@@ -430,7 +430,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, · 9 unmodified lines
430430
431431 #define MAX_OMAP_MMC_HWMOD_NAME_LEN 16
432432
433−void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
433+void omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
434434 {
435435 struct omap_hwmod *oh;
436436 struct platform_device *pdev;
@@ -487,7 +487,7 @@ done: · 50 unmodified lines
487487 kfree(mmc_data);
488488 }
489489
490−void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
490+void omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
491491 {
492492 u32 reg;
493493
arch/arm/mach-omap2/io.c+3−1
@@ -388,7 +388,7 @@ static void __init omap_hwmod_init_postsetup(void) · 387 unmodified lines
388388 omap_pm_if_early_init();
389389 }
390390
391−#ifdef CONFIG_ARCH_OMAP2
391+#ifdef CONFIG_SOC_OMAP2420
392392 void __init omap2420_init_early(void)
393393 {
394394 omap2_set_globals_242x();
@@ -400,7 +400,9 @@ void __init omap2420_init_early(void) · 5 unmodified lines
400400 omap_hwmod_init_postsetup();
401401 omap2420_clk_init();
402402 }
403+#endif
403404
405+#ifdef CONFIG_SOC_OMAP2430
404406 void __init omap2430_init_early(void)
405407 {
406408 omap2_set_globals_243x();
arch/arm/mach-omap2/mux.c+11−11
@@ -100,8 +100,8 @@ void omap_mux_write_array(struct omap_mux_partition *partition, · 99 unmodified lines
100100
101101 static char *omap_mux_options;
102102
103−static int __init _omap_mux_init_gpio(struct omap_mux_partition *partition,
104− int gpio, int val)
103+static int _omap_mux_init_gpio(struct omap_mux_partition *partition,
104+ int gpio, int val)
105105 {
106106 struct omap_mux_entry *e;
107107 struct omap_mux *gpio_mux = NULL;
@@ -145,7 +145,7 @@ static int __init _omap_mux_init_gpio(struct omap_mux_partition *partition, · 37 unmodified lines
145145 return 0;
146146 }
147147
148−int __init omap_mux_init_gpio(int gpio, int val)
148+int omap_mux_init_gpio(int gpio, int val)
149149 {
150150 struct omap_mux_partition *partition;
151151 int ret;
@@ -159,9 +159,9 @@ int __init omap_mux_init_gpio(int gpio, int val) · 7 unmodified lines
159159 return -ENODEV;
160160 }
161161
162−static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition,
163− const char *muxname,
164− struct omap_mux **found_mux)
162+static int _omap_mux_get_by_name(struct omap_mux_partition *partition,
163+ const char *muxname,
164+ struct omap_mux **found_mux)
165165 {
166166 struct omap_mux *mux = NULL;
167167 struct omap_mux_entry *e;
@@ -240,7 +240,7 @@ omap_mux_get_by_name(const char *muxname, · 72 unmodified lines
240240 return -ENODEV;
241241 }
242242
243−int __init omap_mux_init_signal(const char *muxname, int val)
243+int omap_mux_init_signal(const char *muxname, int val)
244244 {
245245 struct omap_mux_partition *partition = NULL;
246246 struct omap_mux *mux = NULL;
@@ -1094,8 +1094,8 @@ static void omap_mux_init_package(struct omap_mux *superset, · 847 unmodified lines
10941094 omap_mux_package_init_balls(package_balls, superset);
10951095 }
10961096
1097−static void omap_mux_init_signals(struct omap_mux_partition *partition,
1098− struct omap_board_mux *board_mux)
1097+static void __init omap_mux_init_signals(struct omap_mux_partition *partition,
1098+ struct omap_board_mux *board_mux)
10991099 {
11001100 omap_mux_set_cmdline_signals();
11011101 omap_mux_write_array(partition, board_mux);
@@ -1109,8 +1109,8 @@ static void omap_mux_init_package(struct omap_mux *superset, · 7 unmodified lines
11091109 {
11101110 }
11111111
1112−static void omap_mux_init_signals(struct omap_mux_partition *partition,
1113− struct omap_board_mux *board_mux)
1112+static void __init omap_mux_init_signals(struct omap_mux_partition *partition,
1113+ struct omap_board_mux *board_mux)
11141114 {
11151115 }
11161116
arch/arm/mach-omap2/omap-headsmp.S+1−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/linkage.h>
1919 #include <linux/init.h>
2020
21+ __CPUINIT
2122 /*
2223 * OMAP4 specific entry point for secondary CPU to jump from ROM
2324 * code. This routine also provides a holding flag into which
arch/arm/mach-omap2/omap_hwmod.c+8−8
@@ -1517,8 +1517,8 @@ static int _enable(struct omap_hwmod *oh) · 1516 unmodified lines
15171517 if (oh->_state != _HWMOD_STATE_INITIALIZED &&
15181518 oh->_state != _HWMOD_STATE_IDLE &&
15191519 oh->_state != _HWMOD_STATE_DISABLED) {
1520− WARN(1, "omap_hwmod: %s: enabled state can only be entered "
1521− "from initialized, idle, or disabled state\n", oh->name);
1520+ WARN(1, "omap_hwmod: %s: enabled state can only be entered from initialized, idle, or disabled state\n",
1521+ oh->name);
15221522 return -EINVAL;
15231523 }
15241524
@@ -1600,8 +1600,8 @@ static int _idle(struct omap_hwmod *oh) · 75 unmodified lines
16001600 pr_debug("omap_hwmod: %s: idling\n", oh->name);
16011601
16021602 if (oh->_state != _HWMOD_STATE_ENABLED) {
1603− WARN(1, "omap_hwmod: %s: idle state can only be entered from "
1604− "enabled state\n", oh->name);
1603+ WARN(1, "omap_hwmod: %s: idle state can only be entered from enabled state\n",
1604+ oh->name);
16051605 return -EINVAL;
16061606 }
16071607
@@ -1682,8 +1682,8 @@ static int _shutdown(struct omap_hwmod *oh) · 74 unmodified lines
16821682
16831683 if (oh->_state != _HWMOD_STATE_IDLE &&
16841684 oh->_state != _HWMOD_STATE_ENABLED) {
1685− WARN(1, "omap_hwmod: %s: disabled state can only be entered "
1686− "from idle, or enabled state\n", oh->name);
1685+ WARN(1, "omap_hwmod: %s: disabled state can only be entered from idle, or enabled state\n",
1686+ oh->name);
16871687 return -EINVAL;
16881688 }
16891689
@@ -2240,8 +2240,8 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh) · 550 unmodified lines
22402240 BUG_ON(!oh);
22412241
22422242 if (!oh->class->sysc || !oh->class->sysc->sysc_flags) {
2243− WARN(1, "omap_device: %s: OCP barrier impossible due to "
2244− "device configuration\n", oh->name);
2243+ WARN(1, "omap_device: %s: OCP barrier impossible due to device configuration\n",
2244+ oh->name);
22452245 return;
22462246 }
22472247
arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c+0−21
@@ -55,27 +55,6 @@ struct omap_hwmod_class omap2_dss_hwmod_class = { · 54 unmodified lines
5555 .reset = omap_dss_reset,
5656 };
5757
58−/*
59− * 'dispc' class
60− * display controller
61− */
62−
63−static struct omap_hwmod_class_sysconfig omap2_dispc_sysc = {
64− .rev_offs = 0x0000,
65− .sysc_offs = 0x0010,
66− .syss_offs = 0x0014,
67− .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
68− SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
69− .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
70− MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
71− .sysc_fields = &omap_hwmod_sysc_type1,
72−};
73−
74−struct omap_hwmod_class omap2_dispc_hwmod_class = {
75− .name = "dispc",
76− .sysc = &omap2_dispc_sysc,
77−};
78−
7958 /*
8059 * 'rfbi' class
8160 * remote frame buffer interface
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c+22−0
@@ -28,6 +28,28 @@ struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = { · 27 unmodified lines
2828 { .name = "dispc", .dma_req = 5 },
2929 { .dma_req = -1 }
3030 };
31+
32+/*
33+ * 'dispc' class
34+ * display controller
35+ */
36+
37+static struct omap_hwmod_class_sysconfig omap2_dispc_sysc = {
38+ .rev_offs = 0x0000,
39+ .sysc_offs = 0x0010,
40+ .syss_offs = 0x0014,
41+ .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
42+ SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
43+ .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
44+ MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
45+ .sysc_fields = &omap_hwmod_sysc_type1,
46+};
47+
48+struct omap_hwmod_class omap2_dispc_hwmod_class = {
49+ .name = "dispc",
50+ .sysc = &omap2_dispc_sysc,
51+};
52+
3153 /* OMAP2xxx Timer Common */
3254 static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc = {
3355 .rev_offs = 0x0000,
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c+47−7
@@ -1480,6 +1480,28 @@ static struct omap_hwmod omap3xxx_dss_core_hwmod = { · 1479 unmodified lines
14801480 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters),
14811481 };
14821482
1483+/*
1484+ * 'dispc' class
1485+ * display controller
1486+ */
1487+
1488+static struct omap_hwmod_class_sysconfig omap3_dispc_sysc = {
1489+ .rev_offs = 0x0000,
1490+ .sysc_offs = 0x0010,
1491+ .syss_offs = 0x0014,
1492+ .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
1493+ SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
1494+ SYSC_HAS_ENAWAKEUP),
1495+ .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1496+ MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1497+ .sysc_fields = &omap_hwmod_sysc_type1,
1498+};
1499+
1500+static struct omap_hwmod_class omap3_dispc_hwmod_class = {
1501+ .name = "dispc",
1502+ .sysc = &omap3_dispc_sysc,
1503+};
1504+
14831505 /* l4_core -> dss_dispc */
14841506 static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dispc = {
14851507 .master = &omap3xxx_l4_core_hwmod,
@@ -1503,7 +1525,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_dispc_slaves[] = { · 17 unmodified lines
15031525
15041526 static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
15051527 .name = "dss_dispc",
1506− .class = &omap2_dispc_hwmod_class,
1528+ .class = &omap3_dispc_hwmod_class,
15071529 .mpu_irqs = omap2_dispc_irqs,
15081530 .main_clk = "dss1_alwon_fck",
15091531 .prcm = {
@@ -3523,12 +3545,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { · 2013 unmodified lines
35233545 &omap3xxx_uart2_hwmod,
35243546 &omap3xxx_uart3_hwmod,
35253547
3526− /* dss class */
3527− &omap3xxx_dss_dispc_hwmod,
3528− &omap3xxx_dss_dsi1_hwmod,
3529− &omap3xxx_dss_rfbi_hwmod,
3530− &omap3xxx_dss_venc_hwmod,
3531−
35323548 /* i2c class */
35333549 &omap3xxx_i2c1_hwmod,
35343550 &omap3xxx_i2c2_hwmod,
@@ -3635,6 +3651,15 @@ static __initdata struct omap_hwmod *am35xx_hwmods[] = { · 100 unmodified lines
36353651 NULL
36363652 };
36373653
3654+static __initdata struct omap_hwmod *omap3xxx_dss_hwmods[] = {
3655+ /* dss class */
3656+ &omap3xxx_dss_dispc_hwmod,
3657+ &omap3xxx_dss_dsi1_hwmod,
3658+ &omap3xxx_dss_rfbi_hwmod,
3659+ &omap3xxx_dss_venc_hwmod,
3660+ NULL
3661+};
3662+
36383663 int __init omap3xxx_hwmod_init(void)
36393664 {
36403665 int r;
@@ -3708,6 +3733,21 @@ int __init omap3xxx_hwmod_init(void) · 67 unmodified lines
37083733
37093734 if (h)
37103735 r = omap_hwmod_register(h);
3736+ if (r < 0)
3737+ return r;
3738+
3739+ /*
3740+ * DSS code presumes that dss_core hwmod is handled first,
3741+ * _before_ any other DSS related hwmods so register common
3742+ * DSS hwmods last to ensure that dss_core is already registered.
3743+ * Otherwise some change things may happen, for ex. if dispc
3744+ * is handled before dss_core and DSS is enabled in bootloader
3745+ * DIPSC will be reset with outputs enabled which sometimes leads
3746+ * to unrecoverable L3 error.
3747+ * XXX The long-term fix to this is to ensure modules are set up
3748+ * in dependency order in the hwmod core code.
3749+ */
3750+ r = omap_hwmod_register(omap3xxx_dss_hwmods);
37113751
37123752 return r;
37133753 }
arch/arm/mach-omap2/omap_hwmod_44xx_data.c+2−0
@@ -1031,6 +1031,7 @@ static struct omap_hwmod_dma_info omap44xx_dmic_sdma_reqs[] = { · 1030 unmodified lines
10311031
10321032 static struct omap_hwmod_addr_space omap44xx_dmic_addrs[] = {
10331033 {
1034+ .name = "mpu",
10341035 .pa_start = 0x4012e000,
10351036 .pa_end = 0x4012e07f,
10361037 .flags = ADDR_TYPE_RT
@@ -1049,6 +1050,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic = { · 12 unmodified lines
10491050
10501051 static struct omap_hwmod_addr_space omap44xx_dmic_dma_addrs[] = {
10511052 {
1053+ .name = "dma",
10521054 .pa_start = 0x4902e000,
10531055 .pa_end = 0x4902e07f,
10541056 .flags = ADDR_TYPE_RT
arch/arm/mach-omap2/pm24xx.c+1−7
@@ -82,13 +82,7 @@ static int omap2_fclks_active(void) · 81 unmodified lines
8282 f1 = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
8383 f2 = omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
8484
85− /* Ignore UART clocks. These are handled by UART core (serial.c) */
86− f1 &= ~(OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_UART2_MASK);
87− f2 &= ~OMAP24XX_EN_UART3_MASK;
88−
89− if (f1 | f2)
90− return 1;
91− return 0;
85+ return (f1 | f2) ? 1 : 0;
9286 }
9387
9488 static void omap2_enter_full_retention(void)
arch/arm/mach-omap2/prm2xxx_3xxx.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include "common.h"
2020 #include <plat/cpu.h>
2121 #include <plat/prcm.h>
22+#include <plat/irqs.h>
2223
2324 #include "vp.h"
2425
arch/arm/mach-omap2/prm44xx.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919
2020 #include "common.h"
2121 #include <plat/cpu.h>
22+#include <plat/irqs.h>
2223 #include <plat/prcm.h>
2324
2425 #include "vp.h"
arch/arm/mach-omap2/serial.c+4−4
@@ -107,18 +107,18 @@ static void omap_uart_set_noidle(struct platform_device *pdev) · 106 unmodified lines
107107 omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_NO);
108108 }
109109
110−static void omap_uart_set_forceidle(struct platform_device *pdev)
110+static void omap_uart_set_smartidle(struct platform_device *pdev)
111111 {
112112 struct omap_device *od = to_omap_device(pdev);
113113
114− omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_FORCE);
114+ omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_SMART);
115115 }
116116
117117 #else
118118 static void omap_uart_enable_wakeup(struct platform_device *pdev, bool enable)
119119 {}
120120 static void omap_uart_set_noidle(struct platform_device *pdev) {}
121−static void omap_uart_set_forceidle(struct platform_device *pdev) {}
121+static void omap_uart_set_smartidle(struct platform_device *pdev) {}
122122 #endif /* CONFIG_PM */
123123
124124 #ifdef CONFIG_OMAP_MUX
@@ -349,7 +349,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata, · 224 unmodified lines
349349 omap_up.uartclk = OMAP24XX_BASE_BAUD * 16;
350350 omap_up.flags = UPF_BOOT_AUTOCONF;
351351 omap_up.get_context_loss_count = omap_pm_get_dev_context_loss_count;
352− omap_up.set_forceidle = omap_uart_set_forceidle;
352+ omap_up.set_forceidle = omap_uart_set_smartidle;
353353 omap_up.set_noidle = omap_uart_set_noidle;
354354 omap_up.enable_wakeup = omap_uart_enable_wakeup;
355355 omap_up.dma_rx_buf_size = info->dma_rx_buf_size;
arch/arm/mach-omap2/smartreflex.c+1−1
@@ -897,7 +897,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) · 896 unmodified lines
897897 ret = sr_late_init(sr_info);
898898 if (ret) {
899899 pr_warning("%s: Error in SR late init\n", __func__);
900− return ret;
900+ goto err_iounmap;
901901 }
902902 }
903903
arch/arm/mach-omap2/timer.c+1−1
@@ -270,7 +270,7 @@ static struct clocksource clocksource_gpt = { · 269 unmodified lines
270270 static u32 notrace dmtimer_read_sched_clock(void)
271271 {
272272 if (clksrc.reserved)
273− return __omap_dm_timer_read_counter(clksrc.io_base, 1);
273+ return __omap_dm_timer_read_counter(&clksrc, 1);
274274
275275 return 0;
276276 }
arch/arm/mach-omap2/vc.c+4−6
@@ -247,7 +247,7 @@ static void __init omap4_vc_init_channel(struct voltagedomain *voltdm) · 246 unmodified lines
247247 * omap_vc_i2c_init - initialize I2C interface to PMIC
248248 * @voltdm: voltage domain containing VC data
249249 *
250− * Use PMIC supplied seetings for I2C high-speed mode and
250+ * Use PMIC supplied settings for I2C high-speed mode and
251251 * master code (if set) and program the VC I2C configuration
252252 * register.
253253 *
@@ -265,8 +265,8 @@ static void __init omap_vc_i2c_init(struct voltagedomain *voltdm) · 11 unmodified lines
265265
266266 if (initialized) {
267267 if (voltdm->pmic->i2c_high_speed != i2c_high_speed)
268− pr_warn("%s: I2C config for all channels must match.",
269− __func__);
268+ pr_warn("%s: I2C config for vdd_%s does not match other channels (%u).",
269+ __func__, voltdm->name, i2c_high_speed);
270270 return;
271271 }
272272
@@ -292,9 +292,7 @@ void __init omap_vc_init_channel(struct voltagedomain *voltdm) · 19 unmodified lines
292292 u32 val;
293293
294294 if (!voltdm->pmic || !voltdm->pmic->uv_to_vsel) {
295− pr_err("%s: PMIC info requried to configure vc for"
296− "vdd_%s not populated.Hence cannot initialize vc\n",
297− __func__, voltdm->name);
295+ pr_err("%s: No PMIC info for vdd_%s\n", __func__, voltdm->name);
298296 return;
299297 }
300298
arch/arm/mach-omap2/voltagedomains3xxx_data.c+2−0
@@ -108,6 +108,7 @@ void __init omap3xxx_voltagedomains_init(void) · 107 unmodified lines
108108 * XXX Will depend on the process, validation, and binning
109109 * for the currently-running IC
110110 */
111+#ifdef CONFIG_PM_OPP
111112 if (cpu_is_omap3630()) {
112113 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data;
113114 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data;
@@ -115,6 +116,7 @@ void __init omap3xxx_voltagedomains_init(void) · 1 unmodified line
115116 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data;
116117 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;
117118 }
119+#endif
118120
119121 if (cpu_is_omap3517() || cpu_is_omap3505())
120122 voltdms = voltagedomains_am35xx;
arch/arm/mach-omap2/voltagedomains44xx_data.c+2−0
@@ -100,9 +100,11 @@ void __init omap44xx_voltagedomains_init(void) · 99 unmodified lines
100100 * XXX Will depend on the process, validation, and binning
101101 * for the currently-running IC
102102 */
103+#ifdef CONFIG_PM_OPP
103104 omap4_voltdm_mpu.volt_data = omap44xx_vdd_mpu_volt_data;
104105 omap4_voltdm_iva.volt_data = omap44xx_vdd_iva_volt_data;
105106 omap4_voltdm_core.volt_data = omap44xx_vdd_core_volt_data;
107+#endif
106108
107109 for (i = 0; voltdm = voltagedomains_omap4[i], voltdm; i++)
108110 voltdm->sys_clk.name = sys_clk_name;
arch/arm/mach-omap2/vp.c+5−0
@@ -41,6 +41,11 @@ void __init omap_vp_init(struct voltagedomain *voltdm) · 40 unmodified lines
4141 u32 val, sys_clk_rate, timeout, waittime;
4242 u32 vddmin, vddmax, vstepmin, vstepmax;
4343
44+ if (!voltdm->pmic || !voltdm->pmic->uv_to_vsel) {
45+ pr_err("%s: No PMIC info for vdd_%s\n", __func__, voltdm->name);
46+ return;
47+ }
48+
4449 if (!voltdm->read || !voltdm->write) {
4550 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
4651 __func__, voltdm->name);
arch/arm/mach-orion5x/common.c+3−1
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <mach/hardware.h>
3030 #include <mach/orion5x.h>
3131 #include <plat/orion_nand.h>
32+#include <plat/ehci-orion.h>
3233 #include <plat/time.h>
3334 #include <plat/common.h>
3435 #include <plat/addr-map.h>
@@ -72,7 +73,8 @@ void __init orion5x_map_io(void) · 37 unmodified lines
7273 ****************************************************************************/
7374 void __init orion5x_ehci0_init(void)
7475 {
75− orion_ehci_init(ORION5X_USB0_PHYS_BASE, IRQ_ORION5X_USB0_CTRL);
76+ orion_ehci_init(ORION5X_USB0_PHYS_BASE, IRQ_ORION5X_USB0_CTRL,
77+ EHCI_PHY_ORION);
7678 }
7779
7880
arch/arm/mach-s3c2410/cpu-freq.c+5−3
@@ -115,7 +115,8 @@ static struct s3c_cpufreq_info s3c2410_cpufreq_info = { · 114 unmodified lines
115115 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
116116 };
117117
118−static int s3c2410_cpufreq_add(struct device *dev)
118+static int s3c2410_cpufreq_add(struct device *dev,
119+ struct subsys_interface *sif)
119120 {
120121 return s3c_cpufreq_register(&s3c2410_cpufreq_info);
121122 }
@@ -133,7 +134,8 @@ static int __init s3c2410_cpufreq_init(void) · 11 unmodified lines
133134
134135 arch_initcall(s3c2410_cpufreq_init);
135136
136−static int s3c2410a_cpufreq_add(struct device *dev)
137+static int s3c2410a_cpufreq_add(struct device *dev,
138+ struct subsys_interface *sif)
137139 {
138140 /* alter the maximum freq settings for S3C2410A. If a board knows
139141 * it only has a maximum of 200, then it should register its own
@@ -144,7 +146,7 @@ static int s3c2410a_cpufreq_add(struct device *dev) · 4 unmodified lines
144146 s3c2410_cpufreq_info.max.pclk = 66500000;
145147 s3c2410_cpufreq_info.name = "s3c2410a";
146148
147− return s3c2410_cpufreq_add(dev);
149+ return s3c2410_cpufreq_add(dev, sif);
148150 }
149151
150152 static struct subsys_interface s3c2410a_cpufreq_interface = {
arch/arm/mach-s3c2410/dma.c+3−2
@@ -132,7 +132,8 @@ static struct s3c24xx_dma_order __initdata s3c2410_dma_order = { · 131 unmodified lines
132132 },
133133 };
134134
135−static int __init s3c2410_dma_add(struct device *dev)
135+static int __init s3c2410_dma_add(struct device *dev,
136+ struct subsys_interface *sif)
136137 {
137138 s3c2410_dma_init();
138139 s3c24xx_dma_order_set(&s3c2410_dma_order);
@@ -148,7 +149,7 @@ static struct subsys_interface s3c2410_dma_interface = { · 9 unmodified lines
148149
149150 static int __init s3c2410_dma_drvinit(void)
150151 {
151− return subsys_interface_register(&s3c2410_interface);
152+ return subsys_interface_register(&s3c2410_dma_interface);
152153 }
153154
154155 arch_initcall(s3c2410_dma_drvinit);
arch/arm/mach-s3c2410/pll.c+1−1
@@ -66,7 +66,7 @@ static struct cpufreq_frequency_table pll_vals_12MHz[] = { · 65 unmodified lines
6666 { .frequency = 270000000, .index = PLLVAL(127, 1, 1), },
6767 };
6868
69−static int s3c2410_plls_add(struct device *dev)
69+static int s3c2410_plls_add(struct device *dev, struct subsys_interface *sif)
7070 {
7171 return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz));
7272 }
arch/arm/mach-s3c2410/pm.c+1−1
@@ -111,7 +111,7 @@ struct syscore_ops s3c2410_pm_syscore_ops = { · 110 unmodified lines
111111 .resume = s3c2410_pm_resume,
112112 };
113113
114−static int s3c2410_pm_add(struct device *dev)
114+static int s3c2410_pm_add(struct device *dev, struct subsys_interface *sif)
115115 {
116116 pm_cpu_prep = s3c2410_pm_prepare;
117117 pm_cpu_sleep = s3c2410_cpu_suspend;
arch/arm/mach-s3c2412/cpu-freq.c+2−1
@@ -194,7 +194,8 @@ static struct s3c_cpufreq_info s3c2412_cpufreq_info = { · 193 unmodified lines
194194 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2412_iotiming_debugfs),
195195 };
196196
197−static int s3c2412_cpufreq_add(struct device *dev)
197+static int s3c2412_cpufreq_add(struct device *dev,
198+ struct subsys_interface *sif)
198199 {
199200 unsigned long fclk_rate;
200201
arch/arm/mach-s3c2412/dma.c+2−1
@@ -159,7 +159,8 @@ static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = { · 158 unmodified lines
159159 .map_size = ARRAY_SIZE(s3c2412_dma_mappings),
160160 };
161161
162−static int __init s3c2412_dma_add(struct device *dev)
162+static int __init s3c2412_dma_add(struct device *dev,
163+ struct subsys_interface *sif)
163164 {
164165 s3c2410_dma_init();
165166 return s3c24xx_dma_init_map(&s3c2412_dma_sel);
arch/arm/mach-s3c2412/irq.c+1−1
@@ -170,7 +170,7 @@ static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state) · 169 unmodified lines
170170
171171 static struct irq_chip s3c2412_irq_rtc_chip;
172172
173−static int s3c2412_irq_add(struct device *dev)
173+static int s3c2412_irq_add(struct device *dev, struct subsys_interface *sif)
174174 {
175175 unsigned int irqno;
176176
arch/arm/mach-s3c2412/pm.c+1−1
@@ -56,7 +56,7 @@ static void s3c2412_pm_prepare(void) · 55 unmodified lines
5656 {
5757 }
5858
59−static int s3c2412_pm_add(struct device *dev)
59+static int s3c2412_pm_add(struct device *dev, struct subsys_interface *sif)
6060 {
6161 pm_cpu_prep = s3c2412_pm_prepare;
6262 pm_cpu_sleep = s3c2412_cpu_suspend;
arch/arm/mach-s3c2416/irq.c+2−1
@@ -213,7 +213,8 @@ static int __init s3c2416_add_sub(unsigned int base, · 212 unmodified lines
213213 return 0;
214214 }
215215
216−static int __init s3c2416_irq_add(struct device *dev)
216+static int __init s3c2416_irq_add(struct device *dev,
217+ struct subsys_interface *sif)
217218 {
218219 printk(KERN_INFO "S3C2416: IRQ Support\n");
219220
arch/arm/mach-s3c2416/pm.c+1−1
@@ -48,7 +48,7 @@ static void s3c2416_pm_prepare(void) · 47 unmodified lines
4848 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
4949 }
5050
51−static int s3c2416_pm_add(struct device *dev)
51+static int s3c2416_pm_add(struct device *dev, struct subsys_interface *sif)
5252 {
5353 pm_cpu_prep = s3c2416_pm_prepare;
5454 pm_cpu_sleep = s3c2416_cpu_suspend;
arch/arm/mach-s3c2440/clock.c+1−1
@@ -149,7 +149,7 @@ static struct clk_lookup s3c2440_clk_lookup[] = { · 148 unmodified lines
149149 CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n),
150150 };
151151
152−static int s3c2440_clk_add(struct device *dev)
152+static int s3c2440_clk_add(struct device *dev, struct subsys_interface *sif)
153153 {
154154 struct clk *clock_upll;
155155 struct clk *clock_h;
arch/arm/mach-s3c2440/dma.c+2−1
@@ -174,7 +174,8 @@ static struct s3c24xx_dma_order __initdata s3c2440_dma_order = { · 173 unmodified lines
174174 },
175175 };
176176
177−static int __init s3c2440_dma_add(struct device *dev)
177+static int __init s3c2440_dma_add(struct device *dev,
178+ struct subsys_interface *sif)
178179 {
179180 s3c2410_dma_init();
180181 s3c24xx_dma_order_set(&s3c2440_dma_order);
arch/arm/mach-s3c2440/irq.c+1−1
@@ -92,7 +92,7 @@ static struct irq_chip s3c_irq_wdtac97 = { · 91 unmodified lines
9292 .irq_ack = s3c_irq_wdtac97_ack,
9393 };
9494
95−static int s3c2440_irq_add(struct device *dev)
95+static int s3c2440_irq_add(struct device *dev, struct subsys_interface *sif)
9696 {
9797 unsigned int irqno;
9898
arch/arm/mach-s3c2440/s3c2440-cpufreq.c+2−1
@@ -270,7 +270,8 @@ struct s3c_cpufreq_info s3c2440_cpufreq_info = { · 269 unmodified lines
270270 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
271271 };
272272
273−static int s3c2440_cpufreq_add(struct device *dev)
273+static int s3c2440_cpufreq_add(struct device *dev,
274+ struct subsys_interface *sif)
274275 {
275276 xtal = s3c_cpufreq_clk_get(NULL, "xtal");
276277 hclk = s3c_cpufreq_clk_get(NULL, "hclk");
arch/arm/mach-s3c2440/s3c2440-pll-12000000.c+1−1
@@ -51,7 +51,7 @@ static struct cpufreq_frequency_table s3c2440_plls_12[] __initdata = { · 50 unmodified lines
5151 { .frequency = 400000000, .index = PLLVAL(0x5c, 1, 1), }, /* FVco 800.000000 */
5252 };
5353
54−static int s3c2440_plls12_add(struct device *dev)
54+static int s3c2440_plls12_add(struct device *dev, struct subsys_interface *sif)
5555 {
5656 struct clk *xtal_clk;
5757 unsigned long xtal;
arch/arm/mach-s3c2440/s3c2440-pll-16934400.c+2−1
@@ -79,7 +79,8 @@ static struct cpufreq_frequency_table s3c2440_plls_169344[] __initdata = { · 78 unmodified lines
7979 { .frequency = 402192000, .index = PLLVAL(87, 2, 1), }, /* FVco 804.384000 */
8080 };
8181
82−static int s3c2440_plls169344_add(struct device *dev)
82+static int s3c2440_plls169344_add(struct device *dev,
83+ struct subsys_interface *sif)
8384 {
8485 struct clk *xtal_clk;
8586 unsigned long xtal;
arch/arm/mach-s3c2440/s3c2442.c+1−1
@@ -122,7 +122,7 @@ static struct clk s3c2442_clk_cam_upll = { · 121 unmodified lines
122122 },
123123 };
124124
125−static int s3c2442_clk_add(struct device *dev)
125+static int s3c2442_clk_add(struct device *dev, struct subsys_interface *sif)
126126 {
127127 struct clk *clock_upll;
128128 struct clk *clock_h;
arch/arm/mach-s3c2440/s3c244x-clock.c+1−1
@@ -72,7 +72,7 @@ static struct clk clk_arm = { · 71 unmodified lines
7272 },
7373 };
7474
75−static int s3c244x_clk_add(struct device *dev)
75+static int s3c244x_clk_add(struct device *dev, struct subsys_interface *sif)
7676 {
7777 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
7878 unsigned long clkdivn;
arch/arm/mach-s3c2440/s3c244x-irq.c+1−1
@@ -91,7 +91,7 @@ static struct irq_chip s3c_irq_cam = { · 90 unmodified lines
9191 .irq_ack = s3c_irq_cam_ack,
9292 };
9393
94−static int s3c244x_irq_add(struct device *dev)
94+static int s3c244x_irq_add(struct device *dev, struct subsys_interface *sif)
9595 {
9696 unsigned int irqno;
9797
arch/arm/mach-s3c2443/dma.c+2−1
@@ -135,7 +135,8 @@ static struct s3c24xx_dma_selection __initdata s3c2443_dma_sel = { · 134 unmodified lines
135135 .map_size = ARRAY_SIZE(s3c2443_dma_mappings),
136136 };
137137
138−static int __init s3c2443_dma_add(struct device *dev)
138+static int __init s3c2443_dma_add(struct device *dev,
139+ struct subsys_interface *sif)
139140 {
140141 s3c24xx_dma_init(6, IRQ_S3C2443_DMA0, 0x100);
141142 return s3c24xx_dma_init_map(&s3c2443_dma_sel);
arch/arm/mach-s3c2443/irq.c+2−1
@@ -241,7 +241,8 @@ static int __init s3c2443_add_sub(unsigned int base, · 240 unmodified lines
241241 return 0;
242242 }
243243
244−static int __init s3c2443_irq_add(struct device *dev)
244+static int __init s3c2443_irq_add(struct device *dev,
245+ struct subsys_interface *sif)
245246 {
246247 printk("S3C2443: IRQ Support\n");
247248
arch/arm/mach-s3c64xx/clock.c+5−0
@@ -138,6 +138,11 @@ static struct clk init_clocks_off[] = { · 137 unmodified lines
138138 .ctrlbit = S3C_CLKCON_PCLK_TSADC,
139139 }, {
140140 .name = "i2c",
141+#ifdef CONFIG_S3C_DEV_I2C1
142+ .devname = "s3c2440-i2c.0",
143+#else
144+ .devname = "s3c2440-i2c",
145+#endif
141146 .parent = &clk_p,
142147 .enable = s3c64xx_pclk_ctrl,
143148 .ctrlbit = S3C_CLKCON_PCLK_IIC,
arch/arm/mach-s3c64xx/common.c+1−1
@@ -49,7 +49,7 @@ · 48 unmodified lines
4949
5050 /* uart registration process */
5151
52−void __init s3c64xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
52+static void __init s3c64xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
5353 {
5454 s3c24xx_init_uartdevs("s3c6400-uart", s3c64xx_uart_resources, cfg, no);
5555 }
arch/arm/mach-s5p64x0/pm.c+1−1
@@ -160,7 +160,7 @@ static void s5p64x0_pm_prepare(void) · 159 unmodified lines
160160
161161 }
162162
163−static int s5p64x0_pm_add(struct device *dev)
163+static int s5p64x0_pm_add(struct device *dev, struct subsys_interface *sif)
164164 {
165165 pm_cpu_prep = s5p64x0_pm_prepare;
166166 pm_cpu_sleep = s5p64x0_cpu_suspend;
arch/arm/mach-s5pv210/clock.c+2−2
@@ -175,7 +175,7 @@ static int s5pv210_clk_mask1_ctrl(struct clk *clk, int enable) · 174 unmodified lines
175175 return s5p_gatectrl(S5P_CLK_SRC_MASK1, clk, enable);
176176 }
177177
178−static int exynos4_clk_hdmiphy_ctrl(struct clk *clk, int enable)
178+static int s5pv210_clk_hdmiphy_ctrl(struct clk *clk, int enable)
179179 {
180180 return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
181181 }
@@ -372,7 +372,7 @@ static struct clk init_clocks_off[] = { · 190 unmodified lines
372372 }, {
373373 .name = "hdmiphy",
374374 .devname = "s5pv210-hdmi",
375− .enable = exynos4_clk_hdmiphy_ctrl,
375+ .enable = s5pv210_clk_hdmiphy_ctrl,
376376 .ctrlbit = (1 << 0),
377377 }, {
378378 .name = "dacphy",
arch/arm/mach-s5pv210/pm.c+1−1
@@ -133,7 +133,7 @@ static void s5pv210_pm_prepare(void) · 132 unmodified lines
133133 s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
134134 }
135135
136−static int s5pv210_pm_add(struct device *dev)
136+static int s5pv210_pm_add(struct device *dev, struct subsys_interface *sif)
137137 {
138138 pm_cpu_prep = s5pv210_pm_prepare;
139139 pm_cpu_sleep = s5pv210_cpu_suspend;
arch/arm/mach-shmobile/board-ag5evm.c+15−14
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include <linux/serial_sci.h>
3131 #include <linux/smsc911x.h>
3232 #include <linux/gpio.h>
33+#include <linux/videodev2.h>
3334 #include <linux/input.h>
3435 #include <linux/input/sh_keysc.h>
3536 #include <linux/mmc/host.h>
@@ -37,7 +38,6 @@ · 1 unmodified line
3738 #include <linux/mmc/sh_mobile_sdhi.h>
3839 #include <linux/mfd/tmio.h>
3940 #include <linux/sh_clk.h>
40−#include <linux/dma-mapping.h>
4141 #include <video/sh_mobile_lcdc.h>
4242 #include <video/sh_mipi_dsi.h>
4343 #include <sound/sh_fsi.h>
@@ -159,19 +159,12 @@ static struct resource sh_mmcif_resources[] = { · 115 unmodified lines
159159 },
160160 };
161161
162−static struct sh_mmcif_dma sh_mmcif_dma = {
163− .chan_priv_rx = {
164− .slave_id = SHDMA_SLAVE_MMCIF_RX,
165− },
166− .chan_priv_tx = {
167− .slave_id = SHDMA_SLAVE_MMCIF_TX,
168− },
169−};
170162 static struct sh_mmcif_plat_data sh_mmcif_platdata = {
171163 .sup_pclk = 0,
172164 .ocr = MMC_VDD_165_195,
173165 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
174− .dma = &sh_mmcif_dma,
166+ .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
167+ .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
175168 };
176169
177170 static struct platform_device mmc_device = {
@@ -321,12 +314,11 @@ static struct resource mipidsi0_resources[] = { · 143 unmodified lines
321314 },
322315 };
323316
324−#define DSI0PHYCR 0xe615006c
325317 static int sh_mipi_set_dot_clock(struct platform_device *pdev,
326318 void __iomem *base,
327319 int enable)
328320 {
329− struct clk *pck;
321+ struct clk *pck, *phy;
330322 int ret;
331323
332324 pck = clk_get(&pdev->dev, "dsip_clk");
@@ -335,18 +327,27 @@ static int sh_mipi_set_dot_clock(struct platform_device *pdev, · 2 unmodified lines
335327 goto sh_mipi_set_dot_clock_pck_err;
336328 }
337329
330+ phy = clk_get(&pdev->dev, "dsiphy_clk");
331+ if (IS_ERR(phy)) {
332+ ret = PTR_ERR(phy);
333+ goto sh_mipi_set_dot_clock_phy_err;
334+ }
335+
338336 if (enable) {
339337 clk_set_rate(pck, clk_round_rate(pck, 24000000));
340− __raw_writel(0x2a809010, DSI0PHYCR);
338+ clk_set_rate(phy, clk_round_rate(pck, 510000000));
341339 clk_enable(pck);
340+ clk_enable(phy);
342341 } else {
343342 clk_disable(pck);
343+ clk_disable(phy);
344344 }
345345
346346 ret = 0;
347347
348+ clk_put(phy);
349+sh_mipi_set_dot_clock_phy_err:
348350 clk_put(pck);
349−
350351 sh_mipi_set_dot_clock_pck_err:
351352 return ret;
352353 }
arch/arm/mach-shmobile/board-ap4evb.c+2−10
@@ -295,15 +295,6 @@ static struct resource sh_mmcif_resources[] = { · 294 unmodified lines
295295 },
296296 };
297297
298−static struct sh_mmcif_dma sh_mmcif_dma = {
299− .chan_priv_rx = {
300− .slave_id = SHDMA_SLAVE_MMCIF_RX,
301− },
302− .chan_priv_tx = {
303− .slave_id = SHDMA_SLAVE_MMCIF_TX,
304− },
305−};
306−
307298 static struct sh_mmcif_plat_data sh_mmcif_plat = {
308299 .sup_pclk = 0,
309300 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -311,7 +302,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = { · 1 unmodified line
311302 MMC_CAP_8_BIT_DATA |
312303 MMC_CAP_NEEDS_POLL,
313304 .get_cd = slot_cn7_get_cd,
314− .dma = &sh_mmcif_dma,
305+ .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
306+ .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
315307 };
316308
317309 static struct platform_device sh_mmcif_device = {
arch/arm/mach-shmobile/board-kota2.c+1−2
@@ -143,11 +143,10 @@ static struct gpio_keys_button gpio_buttons[] = { · 142 unmodified lines
143143 static struct gpio_keys_platform_data gpio_key_info = {
144144 .buttons = gpio_buttons,
145145 .nbuttons = ARRAY_SIZE(gpio_buttons),
146− .poll_interval = 250, /* polled for now */
147146 };
148147
149148 static struct platform_device gpio_keys_device = {
150− .name = "gpio-keys-polled", /* polled for now */
149+ .name = "gpio-keys",
151150 .id = -1,
152151 .dev = {
153152 .platform_data = &gpio_key_info,
arch/arm/mach-shmobile/board-mackerel.c+21−74
@@ -43,7 +43,6 @@ · 42 unmodified lines
4343 #include <linux/smsc911x.h>
4444 #include <linux/sh_intc.h>
4545 #include <linux/tca6416_keypad.h>
46−#include <linux/usb/r8a66597.h>
4746 #include <linux/usb/renesas_usbhs.h>
4847 #include <linux/dma-mapping.h>
4948
@@ -145,11 +144,6 @@ · 95 unmodified lines
145144 * 1-2 short | VBUS 5V | Host
146145 * open | external VBUS | Function
147146 *
148− * *1
149− * CN31 is used as
150− * CONFIG_USB_R8A66597_HCD Host
151− * CONFIG_USB_RENESAS_USBHS Function
152− *
153147 * CAUTION
154148 *
155149 * renesas_usbhs driver can use external interrupt mode
@@ -161,15 +155,6 @@ · 5 unmodified lines
161155 * mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0",
162156 * because Touchscreen is using IRQ7-PORT40.
163157 * It is impossible to use IRQ7 demux on this board.
164− *
165− * We can use external interrupt mode USB-Function on "USB1".
166− * USB1 can become Host by r8a66597, and become Function by renesas_usbhs.
167− * But don't select both drivers in same time.
168− * These uses same IRQ number for request_irq(), and aren't supporting
169− * IRQF_SHARED / IORESOURCE_IRQ_SHAREABLE.
170− *
171− * Actually these are old/new version of USB driver.
172− * This mean its register will be broken if it supports shared IRQ,
173158 */
174159
175160 /*
@@ -207,6 +192,16 @@ · 31 unmodified lines
207192 *
208193 */
209194
195+/*
196+ * FSI - AK4642
197+ *
198+ * it needs amixer settings for playing
199+ *
200+ * amixer set "Headphone" on
201+ * amixer set "HPOUTL Mixer DACH" on
202+ * amixer set "HPOUTR Mixer DACH" on
203+ */
204+
210205 /*
211206 * FIXME !!
212207 *
@@ -676,51 +671,16 @@ static struct platform_device usbhs0_device = { · 463 unmodified lines
676671 * Use J30 to select between Host and Function. This setting
677672 * can however not be detected by software. Hotplug of USBHS1
678673 * is provided via IRQ8.
674+ *
675+ * Current USB1 works as "USB Host".
676+ * - set J30 "short"
677+ *
678+ * If you want to use it as "USB gadget",
679+ * - J30 "open"
680+ * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET
681+ * - add .get_vbus = usbhs_get_vbus in usbhs1_private
679682 */
680683 #define IRQ8 evt2irq(0x0300)
681−
682−/* USBHS1 USB Host support via r8a66597_hcd */
683−static void usb1_host_port_power(int port, int power)
684−{
685− if (!power) /* only power-on is supported for now */
686− return;
687−
688− /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
689− __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
690−}
691−
692−static struct r8a66597_platdata usb1_host_data = {
693− .on_chip = 1,
694− .port_power = usb1_host_port_power,
695−};
696−
697−static struct resource usb1_host_resources[] = {
698− [0] = {
699− .name = "USBHS1",
700− .start = 0xe68b0000,
701− .end = 0xe68b00e6 - 1,
702− .flags = IORESOURCE_MEM,
703− },
704− [1] = {
705− .start = evt2irq(0x1ce0) /* USB1_USB1I0 */,
706− .flags = IORESOURCE_IRQ,
707− },
708−};
709−
710−static struct platform_device usb1_host_device = {
711− .name = "r8a66597_hcd",
712− .id = 1,
713− .dev = {
714− .dma_mask = NULL, /* not use dma */
715− .coherent_dma_mask = 0xffffffff,
716− .platform_data = &usb1_host_data,
717− },
718− .num_resources = ARRAY_SIZE(usb1_host_resources),
719− .resource = usb1_host_resources,
720−};
721−
722−/* USBHS1 USB Function support via renesas_usbhs */
723−
724684 #define USB_PHY_MODE (1 << 4)
725685 #define USB_PHY_INT_EN ((1 << 3) | (1 << 2))
726686 #define USB_PHY_ON (1 << 1)
@@ -776,7 +736,7 @@ static void usbhs1_hardware_exit(struct platform_device *pdev) · 49 unmodified lines
776736
777737 static int usbhs1_get_id(struct platform_device *pdev)
778738 {
779− return USBHS_GADGET;
739+ return USBHS_HOST;
780740 }
781741
782742 static u32 usbhs1_pipe_cfg[] = {
@@ -807,7 +767,6 @@ static struct usbhs_private usbhs1_private = { · 24 unmodified lines
807767 .hardware_exit = usbhs1_hardware_exit,
808768 .get_id = usbhs1_get_id,
809769 .phy_reset = usbhs_phy_reset,
810− .get_vbus = usbhs_get_vbus,
811770 },
812771 .driver_param = {
813772 .buswait_bwait = 4,
@@ -1184,15 +1143,6 @@ static struct resource sh_mmcif_resources[] = { · 370 unmodified lines
11841143 },
11851144 };
11861145
1187−static struct sh_mmcif_dma sh_mmcif_dma = {
1188− .chan_priv_rx = {
1189− .slave_id = SHDMA_SLAVE_MMCIF_RX,
1190− },
1191− .chan_priv_tx = {
1192− .slave_id = SHDMA_SLAVE_MMCIF_TX,
1193− },
1194−};
1195−
11961146 static struct sh_mmcif_plat_data sh_mmcif_plat = {
11971147 .sup_pclk = 0,
11981148 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -1200,7 +1150,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = { · 1 unmodified line
12001150 MMC_CAP_8_BIT_DATA |
12011151 MMC_CAP_NEEDS_POLL,
12021152 .get_cd = slot_cn7_get_cd,
1203− .dma = &sh_mmcif_dma,
1153+ .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
1154+ .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
12041155 };
12051156
12061157 static struct platform_device sh_mmcif_device = {
@@ -1311,7 +1262,6 @@ static struct platform_device *mackerel_devices[] __initdata = { · 104 unmodified lines
13111262 &nor_flash_device,
13121263 &smc911x_device,
13131264 &lcdc_device,
1314− &usb1_host_device,
13151265 &usbhs1_device,
13161266 &usbhs0_device,
13171267 &leds_device,
@@ -1473,9 +1423,6 @@ static void __init mackerel_init(void) · 155 unmodified lines
14731423 gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */
14741424 gpio_request(GPIO_FN_IDIN_1_113, NULL);
14751425
1476− /* USB phy tweak to make the r8a66597_hcd host driver work */
1477− __raw_writew(0x8a0a, 0xe6058130); /* USBCR4 */
1478−
14791426 /* enable FSI2 port A (ak4643) */
14801427 gpio_request(GPIO_FN_FSIAIBT, NULL);
14811428 gpio_request(GPIO_FN_FSIAILR, NULL);
arch/arm/mach-shmobile/clock-sh73a0.c+113−0
@@ -365,6 +365,114 @@ static struct clk div6_clks[DIV6_NR] = { · 364 unmodified lines
365365 dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3),
366366 };
367367
368+/* DSI DIV */
369+static unsigned long dsiphy_recalc(struct clk *clk)
370+{
371+ u32 value;
372+
373+ value = __raw_readl(clk->mapping->base);
374+
375+ /* FIXME */
376+ if (!(value & 0x000B8000))
377+ return clk->parent->rate;
378+
379+ value &= 0x3f;
380+ value += 1;
381+
382+ if ((value < 12) ||
383+ (value > 33)) {
384+ pr_err("DSIPHY has wrong value (%d)", value);
385+ return 0;
386+ }
387+
388+ return clk->parent->rate / value;
389+}
390+
391+static long dsiphy_round_rate(struct clk *clk, unsigned long rate)
392+{
393+ return clk_rate_mult_range_round(clk, 12, 33, rate);
394+}
395+
396+static void dsiphy_disable(struct clk *clk)
397+{
398+ u32 value;
399+
400+ value = __raw_readl(clk->mapping->base);
401+ value &= ~0x000B8000;
402+
403+ __raw_writel(value , clk->mapping->base);
404+}
405+
406+static int dsiphy_enable(struct clk *clk)
407+{
408+ u32 value;
409+ int multi;
410+
411+ value = __raw_readl(clk->mapping->base);
412+ multi = (value & 0x3f) + 1;
413+
414+ if ((multi < 12) || (multi > 33))
415+ return -EIO;
416+
417+ __raw_writel(value | 0x000B8000, clk->mapping->base);
418+
419+ return 0;
420+}
421+
422+static int dsiphy_set_rate(struct clk *clk, unsigned long rate)
423+{
424+ u32 value;
425+ int idx;
426+
427+ idx = rate / clk->parent->rate;
428+ if ((idx < 12) || (idx > 33))
429+ return -EINVAL;
430+
431+ idx += -1;
432+
433+ value = __raw_readl(clk->mapping->base);
434+ value = (value & ~0x3f) + idx;
435+
436+ __raw_writel(value, clk->mapping->base);
437+
438+ return 0;
439+}
440+
441+static struct clk_ops dsiphy_clk_ops = {
442+ .recalc = dsiphy_recalc,
443+ .round_rate = dsiphy_round_rate,
444+ .set_rate = dsiphy_set_rate,
445+ .enable = dsiphy_enable,
446+ .disable = dsiphy_disable,
447+};
448+
449+static struct clk_mapping dsi0phy_clk_mapping = {
450+ .phys = DSI0PHYCR,
451+ .len = 4,
452+};
453+
454+static struct clk_mapping dsi1phy_clk_mapping = {
455+ .phys = DSI1PHYCR,
456+ .len = 4,
457+};
458+
459+static struct clk dsi0phy_clk = {
460+ .ops = &dsiphy_clk_ops,
461+ .parent = &div6_clks[DIV6_DSI0P], /* late install */
462+ .mapping = &dsi0phy_clk_mapping,
463+};
464+
465+static struct clk dsi1phy_clk = {
466+ .ops = &dsiphy_clk_ops,
467+ .parent = &div6_clks[DIV6_DSI1P], /* late install */
468+ .mapping = &dsi1phy_clk_mapping,
469+};
470+
471+static struct clk *late_main_clks[] = {
472+ &dsi0phy_clk,
473+ &dsi1phy_clk,
474+};
475+
368476 enum { MSTP001,
369477 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
370478 MSTP219,
@@ -429,6 +537,8 @@ static struct clk_lookup lookups[] = { · 58 unmodified lines
429537 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
430538 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
431539 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
540+ CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk),
541+ CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk),
432542
433543 /* MSTP32 clocks */
434544 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
@@ -504,6 +614,9 @@ void __init sh73a0_clock_init(void) · 69 unmodified lines
504614 if (!ret)
505615 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
506616
617+ for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
618+ ret = clk_register(late_main_clks[k]);
619+
507620 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
508621
509622 if (!ret)
arch/arm/mach-shmobile/include/mach/sh73a0.h+3−3
@@ -515,8 +515,8 @@ enum { · 514 unmodified lines
515515 SHDMA_SLAVE_MMCIF_RX,
516516 };
517517
518−/* PINT interrupts are located at Linux IRQ 768 and up */
519−#define SH73A0_PINT0_IRQ(irq) ((irq) + 768)
520−#define SH73A0_PINT1_IRQ(irq) ((irq) + 800)
518+/* PINT interrupts are located at Linux IRQ 800 and up */
519+#define SH73A0_PINT0_IRQ(irq) ((irq) + 800)
520+#define SH73A0_PINT1_IRQ(irq) ((irq) + 832)
521521
522522 #endif /* __ASM_SH73A0_H__ */
arch/arm/mach-shmobile/intc-sh73a0.c+2−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/kernel.h>
2020 #include <linux/init.h>
2121 #include <linux/interrupt.h>
22+#include <linux/module.h>
2223 #include <linux/irq.h>
2324 #include <linux/io.h>
2425 #include <linux/sh_intc.h>
@@ -445,6 +446,7 @@ void __init sh73a0_init_irq(void) · 420 unmodified lines
445446 setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]);
446447
447448 n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k)));
449+ WARN_ON(irq_alloc_desc_at(n, numa_node_id()) != n);
448450 irq_set_chip_and_handler_name(n, &intca_gic_irq_chip,
449451 handle_level_irq, "level");
450452 set_irq_flags(n, IRQF_VALID); /* yuck */
arch/arm/mach-shmobile/pfc-r8a7779.c+1−1
@@ -2120,7 +2120,7 @@ static struct pinmux_cfg_reg pinmux_config_regs[] = { · 2119 unmodified lines
21202120 FN_AUDATA3, 0, 0, 0 }
21212121 },
21222122 { PINMUX_CFG_REG_VAR("IPSR4", 0xfffc0030, 32,
2123− 3, 1, 1, 1, 1, 1, 1, 3, 3, 1,
2123+ 3, 1, 1, 1, 1, 1, 1, 3, 3,
21242124 1, 1, 1, 1, 1, 1, 3, 3, 3, 2) {
21252125 /* IP4_31_29 [3] */
21262126 FN_DU1_DB0, FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0,
arch/arm/mach-shmobile/pfc-sh7372.c+41−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/init.h>
2424 #include <linux/kernel.h>
2525 #include <linux/gpio.h>
26+#include <mach/irqs.h>
2627 #include <mach/sh7372.h>
2728
2829 #define CPU_ALL_PORT(fn, pfx, sfx) \
@@ -1594,6 +1595,43 @@ static struct pinmux_data_reg pinmux_data_regs[] = { · 1565 unmodified lines
15941595 { },
15951596 };
15961597
1598+#define EXT_IRQ16L(n) evt2irq(0x200 + ((n) << 5))
1599+#define EXT_IRQ16H(n) evt2irq(0x3200 + (((n) - 16) << 5))
1600+static struct pinmux_irq pinmux_irqs[] = {
1601+ PINMUX_IRQ(EXT_IRQ16L(0), PORT6_FN0, PORT162_FN0),
1602+ PINMUX_IRQ(EXT_IRQ16L(1), PORT12_FN0),
1603+ PINMUX_IRQ(EXT_IRQ16L(2), PORT4_FN0, PORT5_FN0),
1604+ PINMUX_IRQ(EXT_IRQ16L(3), PORT8_FN0, PORT16_FN0),
1605+ PINMUX_IRQ(EXT_IRQ16L(4), PORT17_FN0, PORT163_FN0),
1606+ PINMUX_IRQ(EXT_IRQ16L(5), PORT18_FN0),
1607+ PINMUX_IRQ(EXT_IRQ16L(6), PORT39_FN0, PORT164_FN0),
1608+ PINMUX_IRQ(EXT_IRQ16L(7), PORT40_FN0, PORT167_FN0),
1609+ PINMUX_IRQ(EXT_IRQ16L(8), PORT41_FN0, PORT168_FN0),
1610+ PINMUX_IRQ(EXT_IRQ16L(9), PORT42_FN0, PORT169_FN0),
1611+ PINMUX_IRQ(EXT_IRQ16L(10), PORT65_FN0),
1612+ PINMUX_IRQ(EXT_IRQ16L(11), PORT67_FN0),
1613+ PINMUX_IRQ(EXT_IRQ16L(12), PORT80_FN0, PORT137_FN0),
1614+ PINMUX_IRQ(EXT_IRQ16L(13), PORT81_FN0, PORT145_FN0),
1615+ PINMUX_IRQ(EXT_IRQ16L(14), PORT82_FN0, PORT146_FN0),
1616+ PINMUX_IRQ(EXT_IRQ16L(15), PORT83_FN0, PORT147_FN0),
1617+ PINMUX_IRQ(EXT_IRQ16H(16), PORT84_FN0, PORT170_FN0),
1618+ PINMUX_IRQ(EXT_IRQ16H(17), PORT85_FN0),
1619+ PINMUX_IRQ(EXT_IRQ16H(18), PORT86_FN0),
1620+ PINMUX_IRQ(EXT_IRQ16H(19), PORT87_FN0),
1621+ PINMUX_IRQ(EXT_IRQ16H(20), PORT92_FN0),
1622+ PINMUX_IRQ(EXT_IRQ16H(21), PORT93_FN0),
1623+ PINMUX_IRQ(EXT_IRQ16H(22), PORT94_FN0),
1624+ PINMUX_IRQ(EXT_IRQ16H(23), PORT95_FN0),
1625+ PINMUX_IRQ(EXT_IRQ16H(24), PORT112_FN0),
1626+ PINMUX_IRQ(EXT_IRQ16H(25), PORT119_FN0),
1627+ PINMUX_IRQ(EXT_IRQ16H(26), PORT121_FN0, PORT172_FN0),
1628+ PINMUX_IRQ(EXT_IRQ16H(27), PORT122_FN0, PORT180_FN0),
1629+ PINMUX_IRQ(EXT_IRQ16H(28), PORT123_FN0, PORT181_FN0),
1630+ PINMUX_IRQ(EXT_IRQ16H(29), PORT129_FN0, PORT182_FN0),
1631+ PINMUX_IRQ(EXT_IRQ16H(30), PORT130_FN0, PORT183_FN0),
1632+ PINMUX_IRQ(EXT_IRQ16H(31), PORT138_FN0, PORT184_FN0),
1633+};
1634+
15971635 static struct pinmux_info sh7372_pinmux_info = {
15981636 .name = "sh7372_pfc",
15991637 .reserved_id = PINMUX_RESERVED,
@@ -1614,6 +1652,9 @@ static struct pinmux_info sh7372_pinmux_info = { · 14 unmodified lines
16141652
16151653 .gpio_data = pinmux_data,
16161654 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1655+
1656+ .gpio_irq = pinmux_irqs,
1657+ .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
16171658 };
16181659
16191660 void sh7372_pinmux_init(void)
arch/arm/mach-shmobile/setup-sh7372.c+2−0
@@ -662,6 +662,7 @@ static struct sh_dmae_pdata usb_dma0_platform_data = { · 661 unmodified lines
662662 .dmaor_is_32bit = 1,
663663 .needs_tend_set = 1,
664664 .no_dmars = 1,
665+ .slave_only = 1,
665666 };
666667
667668 static struct resource sh7372_usb_dmae0_resources[] = {
@@ -723,6 +724,7 @@ static struct sh_dmae_pdata usb_dma1_platform_data = { · 55 unmodified lines
723724 .dmaor_is_32bit = 1,
724725 .needs_tend_set = 1,
725726 .no_dmars = 1,
727+ .slave_only = 1,
726728 };
727729
728730 static struct resource sh7372_usb_dmae1_resources[] = {
arch/arm/mach-shmobile/smp-sh73a0.c+1−1
@@ -80,7 +80,7 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu) · 79 unmodified lines
8080 /* enable cache coherency */
8181 modify_scu_cpu_psr(0, 3 << (cpu * 8));
8282
83− if (((__raw_readw(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
83+ if (((__raw_readl(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
8484 __raw_writel(1 << cpu, __io(WUPCR)); /* wake up */
8585 else
8686 __raw_writel(1 << cpu, __io(SRESCR)); /* reset */
arch/arm/mach-tegra/board-paz00.c+4−4
@@ -60,9 +60,9 @@ static struct plat_serial8250_port debug_uart_platform_data[] = { · 59 unmodified lines
6060 .uartclk = 216000000,
6161 }, {
6262 /* serial port on mini-pcie */
63− .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
64− .mapbase = TEGRA_UARTD_BASE,
65− .irq = INT_UARTD,
63+ .membase = IO_ADDRESS(TEGRA_UARTC_BASE),
64+ .mapbase = TEGRA_UARTC_BASE,
65+ .irq = INT_UARTC,
6666 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
6767 .type = PORT_TEGRA,
6868 .iotype = UPIO_MEM,
@@ -174,7 +174,7 @@ static void __init tegra_paz00_fixup(struct tag *tags, char **cmdline, · 105 unmodified lines
174174 static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
175175 /* name parent rate enabled */
176176 { "uarta", "pll_p", 216000000, true },
177− { "uartd", "pll_p", 216000000, true },
177+ { "uartc", "pll_p", 216000000, true },
178178
179179 { "pll_p_out4", "pll_p", 24000000, true },
180180 { "usbd", "clk_m", 12000000, false },
arch/arm/mach-tegra/board-paz00.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 /* SDCARD */
2323 #define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5
2424 #define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1
25−#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3
25+#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PV1
2626
2727 /* ULPI */
2828 #define TEGRA_ULPI_RST TEGRA_GPIO_PV0
arch/arm/mach-tegra/include/mach/dma.h+5−5
@@ -23,11 +23,6 @@ · 22 unmodified lines
2323
2424 #include <linux/list.h>
2525
26−#if defined(CONFIG_TEGRA_SYSTEM_DMA)
27−
28−struct tegra_dma_req;
29−struct tegra_dma_channel;
30−
3126 #define TEGRA_DMA_REQ_SEL_CNTR 0
3227 #define TEGRA_DMA_REQ_SEL_I2S_2 1
3328 #define TEGRA_DMA_REQ_SEL_I2S_1 2
@@ -56,6 +51,11 @@ struct tegra_dma_channel; · 22 unmodified lines
5651 #define TEGRA_DMA_REQ_SEL_OWR 25
5752 #define TEGRA_DMA_REQ_SEL_INVALID 31
5853
54+#if defined(CONFIG_TEGRA_SYSTEM_DMA)
55+
56+struct tegra_dma_req;
57+struct tegra_dma_channel;
58+
5959 enum tegra_dma_mode {
6060 TEGRA_DMA_SHARED = 1,
6161 TEGRA_DMA_MODE_CONTINOUS = 2,
arch/arm/mm/Kconfig+2−1
@@ -631,7 +631,8 @@ comment "Processor Features" · 630 unmodified lines
631631
632632 config ARM_LPAE
633633 bool "Support for the Large Physical Address Extension"
634− depends on MMU && CPU_V7
634+ depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \
635+ !CPU_32v4 && !CPU_32v3
635636 help
636637 Say Y if you have an ARMv7 processor supporting the LPAE page
637638 table format and you would like to access memory beyond the
arch/arm/mm/cache-v7.S+6−0
@@ -54,9 +54,15 @@ loop1: · 53 unmodified lines
5454 and r1, r1, #7 @ mask of the bits for current cache only
5555 cmp r1, #2 @ see what cache we have at this level
5656 blt skip @ skip if no cache, or just i-cache
57+#ifdef CONFIG_PREEMPT
58+ save_and_disable_irqs_notrace r9 @ make cssr&csidr read atomic
59+#endif
5760 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
5861 isb @ isb to sych the new cssr&csidr
5962 mrc p15, 1, r1, c0, c0, 0 @ read the new csidr
63+#ifdef CONFIG_PREEMPT
64+ restore_irqs_notrace r9
65+#endif
6066 and r2, r1, #7 @ extract the length of the cache lines
6167 add r2, r2, #4 @ add 4 (line length offset)
6268 ldr r4, =0x3ff
arch/arm/mm/ioremap.c+1−2
@@ -225,8 +225,7 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn, · 224 unmodified lines
225225 if ((area->flags & VM_ARM_MTYPE_MASK) != VM_ARM_MTYPE(mtype))
226226 continue;
227227 if (__phys_to_pfn(area->phys_addr) > pfn ||
228− __pfn_to_phys(pfn) + offset + size-1 >
229− area->phys_addr + area->size-1)
228+ __pfn_to_phys(pfn) + size-1 > area->phys_addr + area->size-1)
230229 continue;
231230 /* we can drop the lock here as we know *area is static */
232231 read_unlock(&vmlist_lock);
arch/arm/plat-omap/include/plat/omap-secure.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33
44 #include <linux/types.h>
55
6−#ifdef CONFIG_ARCH_OMAP2PLUS
6+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
77 extern int omap_secure_ram_reserve_memblock(void);
88 #else
99 static inline void omap_secure_ram_reserve_memblock(void)
arch/arm/plat-orion/common.c+4−5
@@ -789,10 +789,7 @@ void __init orion_xor1_init(unsigned long mapbase_low, · 788 unmodified lines
789789 /*****************************************************************************
790790 * EHCI
791791 ****************************************************************************/
792−static struct orion_ehci_data orion_ehci_data = {
793− .phy_version = EHCI_PHY_NA,
794−};
795−
792+static struct orion_ehci_data orion_ehci_data;
796793 static u64 ehci_dmamask = DMA_BIT_MASK(32);
797794
798795
@@ -812,8 +809,10 @@ static struct platform_device orion_ehci = { · 13 unmodified lines
812809 };
813810
814811 void __init orion_ehci_init(unsigned long mapbase,
815− unsigned long irq)
812+ unsigned long irq,
813+ enum orion_ehci_phy_ver phy_version)
816814 {
815+ orion_ehci_data.phy_version = phy_version;
817816 fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
818817 irq);
819818
arch/arm/plat-orion/include/plat/common.h+2−1
@@ -89,7 +89,8 @@ void __init orion_xor1_init(unsigned long mapbase_low, · 88 unmodified lines
8989 unsigned long irq_1);
9090
9191 void __init orion_ehci_init(unsigned long mapbase,
92− unsigned long irq);
92+ unsigned long irq,
93+ enum orion_ehci_phy_ver phy_version);
9394
9495 void __init orion_ehci_1_init(unsigned long mapbase,
9596 unsigned long irq);
arch/arm/plat-orion/mpp.c+1−2
@@ -64,8 +64,7 @@ void __init orion_mpp_conf(unsigned int *mpp_list, unsigned int variant_mask, · 63 unmodified lines
6464 gpio_mode |= GPIO_INPUT_OK;
6565 if (*mpp_list & MPP_OUTPUT_MASK)
6666 gpio_mode |= GPIO_OUTPUT_OK;
67− if (sel != 0)
68− gpio_mode = 0;
67+
6968 orion_gpio_set_valid(num, gpio_mode);
7069 }
7170
arch/arm/plat-samsung/devs.c+3−1
@@ -468,8 +468,10 @@ void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd) · 467 unmodified lines
468468 {
469469 struct s3c2410_platform_i2c *npd;
470470
471− if (!pd)
471+ if (!pd) {
472472 pd = &default_i2c_data;
473+ pd->bus_num = 0;
474+ }
473475
474476 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c),
475477 &s3c_device_i2c0);
arch/avr32/Kconfig+1−0
@@ -8,6 +8,7 @@ config AVR32 · 7 unmodified lines
88 select HAVE_KPROBES
99 select HAVE_GENERIC_HARDIRQS
1010 select GENERIC_IRQ_PROBE
11+ select GENERIC_ATOMIC64
1112 select HARDIRQS_SW_RESEND
1213 select GENERIC_IRQ_SHOW
1314 select ARCH_HAVE_NMI_SAFE_CMPXCHG
arch/c6x/boot/Makefile+1−1
@@ -13,7 +13,7 @@ obj-y += linked_dtb.o · 12 unmodified lines
1313 endif
1414
1515 $(obj)/%.dtb: $(src)/dts/%.dts FORCE
16− $(call cmd,dtc)
16+ $(call if_changed_dep,dtc)
1717
1818 quiet_cmd_cp = CP $< $@$2
1919 cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
arch/m68k/include/asm/mcf_pgtable.h+2−1
@@ -78,7 +78,8 @@ · 77 unmodified lines
7878 | CF_PAGE_READABLE \
7979 | CF_PAGE_WRITABLE \
8080 | CF_PAGE_EXEC \
81− | CF_PAGE_SYSTEM)
81+ | CF_PAGE_SYSTEM \
82+ | CF_PAGE_SHARED)
8283
8384 #define PAGE_COPY __pgprot(CF_PAGE_VALID \
8485 | CF_PAGE_ACCESSED \
arch/m68k/mm/mcfmmu.c+5−4
@@ -87,7 +87,7 @@ void __init paging_init(void) · 86 unmodified lines
8787
8888 int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
8989 {
90− unsigned long flags, mmuar;
90+ unsigned long flags, mmuar, mmutr;
9191 struct mm_struct *mm;
9292 pgd_t *pgd;
9393 pmd_t *pmd;
@@ -137,9 +137,10 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word) · 43 unmodified lines
137137 if (!pte_dirty(*pte) && !KMAPAREA(mmuar))
138138 set_pte(pte, pte_wrprotect(*pte));
139139
140− mmu_write(MMUTR, (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) |
141− (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK)
142− >> CF_PAGE_MMUTR_SHIFT) | MMUTR_V);
140+ mmutr = (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) | MMUTR_V;
141+ if ((mmuar < TASK_UNMAPPED_BASE) || (mmuar >= TASK_SIZE))
142+ mmutr |= (pte->pte & CF_PAGE_MMUTR_MASK) >> CF_PAGE_MMUTR_SHIFT;
143+ mmu_write(MMUTR, mmutr);
143144
144145 mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) |
145146 ((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X);
arch/m68k/platform/coldfire/entry.S+1−3
@@ -136,7 +136,7 @@ Luser_return: · 135 unmodified lines
136136 movel %sp,%d1 /* get thread_info pointer */
137137 andl #-THREAD_SIZE,%d1 /* at base of kernel stack */
138138 movel %d1,%a0
139− movel %a0@(TINFO_FLAGS),%d1 /* get thread_info->flags */
139+ moveb %a0@(TINFO_FLAGS+3),%d1 /* thread_info->flags (low 8 bits) */
140140 jne Lwork_to_do /* still work to do */
141141
142142 Lreturn:
@@ -148,8 +148,6 @@ Lwork_to_do: · 5 unmodified lines
148148 btst #TIF_NEED_RESCHED,%d1
149149 jne reschedule
150150
151− /* GERG: do we need something here for TRACEing?? */
152−
153151 Lsignal_return:
154152 subql #4,%sp /* dummy return address */
155153 SAVE_SWITCH_STACK
arch/mips/Kconfig+1−0
@@ -2356,6 +2356,7 @@ config PCI · 2355 unmodified lines
23562356 depends on HW_HAS_PCI
23572357 select PCI_DOMAINS
23582358 select GENERIC_PCI_IOMAP
2359+ select NO_GENERIC_PCI_IOPORT_MAP
23592360 help
23602361 Find out whether you have a PCI motherboard. PCI is the name of a
23612362 bus system, i.e. the way the CPU talks to the other stuff inside
arch/mips/lib/iomap-pci.c+2−2
@@ -10,8 +10,8 @@ · 9 unmodified lines
1010 #include <linux/module.h>
1111 #include <asm/io.h>
1212
13−static void __iomem *ioport_map_pci(struct pci_dev *dev,
14− unsigned long port, unsigned int nr)
13+void __iomem *__pci_ioport_map(struct pci_dev *dev,
14+ unsigned long port, unsigned int nr)
1515 {
1616 struct pci_controller *ctrl = dev->bus->sysdata;
1717 unsigned long base = ctrl->io_map_base;
arch/powerpc/configs/ppc64_defconfig+0−5
@@ -24,10 +24,6 @@ CONFIG_PPC_SPLPAR=y · 23 unmodified lines
2424 CONFIG_SCANLOG=m
2525 CONFIG_PPC_SMLPAR=y
2626 CONFIG_DTL=y
27−CONFIG_PPC_ISERIES=y
28−CONFIG_VIODASD=y
29−CONFIG_VIOCD=m
30−CONFIG_VIOTAPE=m
3127 CONFIG_PPC_MAPLE=y
3228 CONFIG_PPC_PASEMI=y
3329 CONFIG_PPC_PASEMI_IOMMU=y
@@ -259,7 +255,6 @@ CONFIG_PASEMI_MAC=y · 225 unmodified lines
259255 CONFIG_MLX4_EN=m
260256 CONFIG_QLGE=m
261257 CONFIG_BE2NET=m
262−CONFIG_ISERIES_VETH=m
263258 CONFIG_PPP=m
264259 CONFIG_PPP_ASYNC=m
265260 CONFIG_PPP_SYNC_TTY=m
arch/powerpc/include/asm/ppc-pci.h+5−0
@@ -142,6 +142,11 @@ static inline const char *eeh_pci_name(struct pci_dev *pdev) · 141 unmodified lines
142142 return pdev ? pci_name(pdev) : "<null>";
143143 }
144144
145+static inline const char *eeh_driver_name(struct pci_dev *pdev)
146+{
147+ return (pdev && pdev->driver) ? pdev->driver->name : "<null>";
148+}
149+
145150 #endif /* CONFIG_EEH */
146151
147152 #else /* CONFIG_PCI */
arch/powerpc/include/asm/ptrace.h+12−8
@@ -83,8 +83,18 @@ struct pt_regs { · 82 unmodified lines
8383
8484 #ifndef __ASSEMBLY__
8585
86−#define instruction_pointer(regs) ((regs)->nip)
87−#define user_stack_pointer(regs) ((regs)->gpr[1])
86+#define GET_IP(regs) ((regs)->nip)
87+#define GET_USP(regs) ((regs)->gpr[1])
88+#define GET_FP(regs) (0)
89+#define SET_FP(regs, val)
90+
91+#ifdef CONFIG_SMP
92+extern unsigned long profile_pc(struct pt_regs *regs);
93+#define profile_pc profile_pc
94+#endif
95+
96+#include <asm-generic/ptrace.h>
97+
8898 #define kernel_stack_pointer(regs) ((regs)->gpr[1])
8999 static inline int is_syscall_success(struct pt_regs *regs)
90100 {
@@ -99,12 +109,6 @@ static inline long regs_return_value(struct pt_regs *regs) · 8 unmodified lines
99109 return -regs->gpr[3];
100110 }
101111
102−#ifdef CONFIG_SMP
103−extern unsigned long profile_pc(struct pt_regs *regs);
104−#else
105−#define profile_pc(regs) instruction_pointer(regs)
106−#endif
107−
108112 #ifdef __powerpc64__
109113 #define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1)
110114 #else
arch/powerpc/kernel/entry_32.S+1−1
@@ -1213,7 +1213,7 @@ do_user_signal: /* r10 contains MSR_KERNEL here */ · 1212 unmodified lines
12131213 stw r3,_TRAP(r1)
12141214 2: addi r3,r1,STACK_FRAME_OVERHEAD
12151215 mr r4,r9
1216− bl do_signal
1216+ bl do_notify_resume
12171217 REST_NVGPRS(r1)
12181218 b recheck
12191219
arch/powerpc/kernel/entry_64.S+5−1
@@ -751,12 +751,16 @@ user_work: · 750 unmodified lines
751751
752752 andi. r0,r4,_TIF_NEED_RESCHED
753753 beq 1f
754+ li r5,1
755+ TRACE_AND_RESTORE_IRQ(r5);
754756 bl .schedule
755757 b .ret_from_except_lite
756758
757759 1: bl .save_nvgprs
760+ li r5,1
761+ TRACE_AND_RESTORE_IRQ(r5);
758762 addi r3,r1,STACK_FRAME_OVERHEAD
759− bl .do_signal
763+ bl .do_notify_resume
760764 b .ret_from_except
761765
762766 unrecov_restore:
arch/powerpc/kernel/exceptions-64s.S+1−1
@@ -774,8 +774,8 @@ alignment_common: · 773 unmodified lines
774774 program_check_common:
775775 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
776776 bl .save_nvgprs
777+ DISABLE_INTS
777778 addi r3,r1,STACK_FRAME_OVERHEAD
778− ENABLE_INTS
779779 bl .program_check_exception
780780 b .ret_from_except
781781
arch/powerpc/kernel/irq.c+5−1
@@ -118,10 +118,14 @@ static inline notrace void set_soft_enabled(unsigned long enable) · 117 unmodified lines
118118 static inline notrace void decrementer_check_overflow(void)
119119 {
120120 u64 now = get_tb_or_rtc();
121− u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
121+ u64 *next_tb;
122+
123+ preempt_disable();
124+ next_tb = &__get_cpu_var(decrementers_next_tb);
122125
123126 if (now >= *next_tb)
124127 set_dec(1);
128+ preempt_enable();
125129 }
126130
127131 notrace void arch_local_irq_restore(unsigned long en)
arch/powerpc/kernel/perf_event.c+7−1
@@ -865,6 +865,7 @@ static void power_pmu_start(struct perf_event *event, int ef_flags) · 864 unmodified lines
865865 {
866866 unsigned long flags;
867867 s64 left;
868+ unsigned long val;
868869
869870 if (!event->hw.idx || !event->hw.sample_period)
870871 return;
@@ -880,7 +881,12 @@ static void power_pmu_start(struct perf_event *event, int ef_flags) · 9 unmodified lines
880881
881882 event->hw.state = 0;
882883 left = local64_read(&event->hw.period_left);
883− write_pmc(event->hw.idx, left);
884+
885+ val = 0;
886+ if (left < 0x80000000L)
887+ val = 0x80000000L - left;
888+
889+ write_pmc(event->hw.idx, val);
884890
885891 perf_event_update_userpage(event);
886892 perf_pmu_enable(event->pmu);
arch/powerpc/kernel/process.c+3−3
@@ -566,12 +566,12 @@ static void show_instructions(struct pt_regs *regs) · 565 unmodified lines
566566 */
567567 if (!__kernel_text_address(pc) ||
568568 __get_user(instr, (unsigned int __user *)pc)) {
569− printk("XXXXXXXX ");
569+ printk(KERN_CONT "XXXXXXXX ");
570570 } else {
571571 if (regs->nip == pc)
572− printk("<%08x> ", instr);
572+ printk(KERN_CONT "<%08x> ", instr);
573573 else
574− printk("%08x ", instr);
574+ printk(KERN_CONT "%08x ", instr);
575575 }
576576
577577 pc += sizeof(int);
arch/powerpc/kernel/rtas.c+3−2
@@ -716,7 +716,6 @@ static int __rtas_suspend_last_cpu(struct rtas_suspend_me_data *data, int wake_w · 715 unmodified lines
716716 int cpu;
717717
718718 slb_set_size(SLB_MIN_SIZE);
719− stop_topology_update();
720719 printk(KERN_DEBUG "calling ibm,suspend-me on cpu %i\n", smp_processor_id());
721720
722721 while (rc == H_MULTI_THREADS_ACTIVE && !atomic_read(&data->done) &&
@@ -732,7 +731,6 @@ static int __rtas_suspend_last_cpu(struct rtas_suspend_me_data *data, int wake_w · 9 unmodified lines
732731 rc = atomic_read(&data->error);
733732
734733 atomic_set(&data->error, rc);
735− start_topology_update();
736734 pSeries_coalesce_init();
737735
738736 if (wake_when_done) {
@@ -846,6 +844,7 @@ int rtas_ibm_suspend_me(struct rtas_args *args) · 107 unmodified lines
846844 atomic_set(&data.error, 0);
847845 data.token = rtas_token("ibm,suspend-me");
848846 data.complete = &done;
847+ stop_topology_update();
849848
850849 /* Call function on all CPUs. One of us will make the
851850 * rtas call
@@ -858,6 +857,8 @@ int rtas_ibm_suspend_me(struct rtas_args *args) · 6 unmodified lines
858857 if (atomic_read(&data.error) != 0)
859858 printk(KERN_ERR "Error doing global join\n");
860859
860+ start_topology_update();
861+
861862 return atomic_read(&data.error);
862863 }
863864 #else /* CONFIG_PPC_PSERIES */
arch/powerpc/kernel/signal.c+8−4
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111
1212 #include <linux/tracehook.h>
1313 #include <linux/signal.h>
14+#include <linux/key.h>
1415 #include <asm/hw_breakpoint.h>
1516 #include <asm/uaccess.h>
1617 #include <asm/unistd.h>
@@ -113,8 +114,9 @@ static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka, · 96 unmodified lines
113114 }
114115 }
115116
116−static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
117+static int do_signal(struct pt_regs *regs)
117118 {
119+ sigset_t *oldset;
118120 siginfo_t info;
119121 int signr;
120122 struct k_sigaction ka;
@@ -123,7 +125,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) · 2 unmodified lines
123125
124126 if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK)
125127 oldset = &current->saved_sigmask;
126− else if (!oldset)
128+ else
127129 oldset = &current->blocked;
128130
129131 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
@@ -191,14 +193,16 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) · 61 unmodified lines
191193 return ret;
192194 }
193195
194−void do_signal(struct pt_regs *regs, unsigned long thread_info_flags)
196+void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
195197 {
196198 if (thread_info_flags & _TIF_SIGPENDING)
197− do_signal_pending(NULL, regs);
199+ do_signal(regs);
198200
199201 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
200202 clear_thread_flag(TIF_NOTIFY_RESUME);
201203 tracehook_notify_resume(regs);
204+ if (current->replacement_session_keyring)
205+ key_replace_session_keyring();
202206 }
203207 }
204208
arch/powerpc/kernel/signal.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212
1313 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
1414
15−extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags);
15+extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags);
1616
1717 extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
1818 size_t frame_size, int is_32);
arch/powerpc/platforms/powernv/pci.c+14−8
@@ -52,32 +52,38 @@ static int pnv_msi_check_device(struct pci_dev* pdev, int nvec, int type) · 51 unmodified lines
5252
5353 static unsigned int pnv_get_one_msi(struct pnv_phb *phb)
5454 {
55− unsigned int id;
55+ unsigned long flags;
56+ unsigned int id, rc;
57+
58+ spin_lock_irqsave(&phb->lock, flags);
5659
57− spin_lock(&phb->lock);
5860 id = find_next_zero_bit(phb->msi_map, phb->msi_count, phb->msi_next);
5961 if (id >= phb->msi_count && phb->msi_next)
6062 id = find_next_zero_bit(phb->msi_map, phb->msi_count, 0);
6163 if (id >= phb->msi_count) {
62− spin_unlock(&phb->lock);
63− return 0;
64+ rc = 0;
65+ goto out;
6466 }
6567 __set_bit(id, phb->msi_map);
66− spin_unlock(&phb->lock);
67− return id + phb->msi_base;
68+ rc = id + phb->msi_base;
69+out:
70+ spin_unlock_irqrestore(&phb->lock, flags);
71+ return rc;
6872 }
6973
7074 static void pnv_put_msi(struct pnv_phb *phb, unsigned int hwirq)
7175 {
76+ unsigned long flags;
7277 unsigned int id;
7378
7479 if (WARN_ON(hwirq < phb->msi_base ||
7580 hwirq >= (phb->msi_base + phb->msi_count)))
7681 return;
7782 id = hwirq - phb->msi_base;
78− spin_lock(&phb->lock);
83+
84+ spin_lock_irqsave(&phb->lock, flags);
7985 __clear_bit(id, phb->msi_map);
80− spin_unlock(&phb->lock);
86+ spin_unlock_irqrestore(&phb->lock, flags);
8187 }
8288
8389 static int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
arch/powerpc/platforms/pseries/eeh.c+2−2
@@ -551,9 +551,9 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev) · 550 unmodified lines
551551 printk (KERN_ERR "EEH: %d reads ignored for recovering device at "
552552 "location=%s driver=%s pci addr=%s\n",
553553 pdn->eeh_check_count, location,
554− dev->driver->name, eeh_pci_name(dev));
554+ eeh_driver_name(dev), eeh_pci_name(dev));
555555 printk (KERN_ERR "EEH: Might be infinite loop in %s driver\n",
556− dev->driver->name);
556+ eeh_driver_name(dev));
557557 dump_stack();
558558 }
559559 goto dn_unlock;
arch/powerpc/platforms/pseries/suspend.c+5−1
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <asm/machdep.h>
2525 #include <asm/mmu.h>
2626 #include <asm/rtas.h>
27+#include <asm/topology.h>
2728
2829 static u64 stream_id;
2930 static struct device suspend_dev;
@@ -138,8 +139,11 @@ static ssize_t store_hibernate(struct device *dev, · 108 unmodified lines
138139 ssleep(1);
139140 } while (rc == -EAGAIN);
140141
141− if (!rc)
142+ if (!rc) {
143+ stop_topology_update();
142144 rc = pm_suspend(PM_SUSPEND_MEM);
145+ start_topology_update();
146+ }
143147
144148 stream_id = 0;
145149
arch/powerpc/platforms/wsp/ics.c+1−1
@@ -346,7 +346,7 @@ static int wsp_chip_set_affinity(struct irq_data *d, · 345 unmodified lines
346346 * For the moment only implement delivery to all cpus or one cpu.
347347 * Get current irq_server for the given irq
348348 */
349− ret = cache_hwirq_map(ics, d->irq, cpumask);
349+ ret = cache_hwirq_map(ics, hw_irq, cpumask);
350350 if (ret == -1) {
351351 char cpulist[128];
352352 cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask);
arch/powerpc/platforms/wsp/smp.c+1−1
@@ -71,7 +71,7 @@ int __devinit smp_a2_kick_cpu(int nr) · 70 unmodified lines
7171
7272 static int __init smp_a2_probe(void)
7373 {
74− return cpus_weight(cpu_possible_map);
74+ return num_possible_cpus();
7575 }
7676
7777 static struct smp_ops_t a2_smp_ops = {
arch/powerpc/platforms/wsp/wsp_pci.c+4−4
@@ -468,15 +468,15 @@ static void __init wsp_pcie_configure_hw(struct pci_controller *hose) · 467 unmodified lines
468468 #define DUMP_REG(x) \
469469 pr_debug("%-30s : 0x%016llx\n", #x, in_be64(hose->cfg_data + x))
470470
471−#ifdef CONFIG_WSP_DD1_WORKAROUND_BAD_PCIE_CLASS
472− /* WSP DD1 has a bogus class code by default in the PCI-E
473− * root complex's built-in P2P bridge */
471+ /*
472+ * Some WSP variants has a bogus class code by default in the PCI-E
473+ * root complex's built-in P2P bridge
474+ */
474475 val = in_be64(hose->cfg_data + PCIE_REG_SYS_CFG1);
475476 pr_debug("PCI-E SYS_CFG1 : 0x%llx\n", val);
476477 out_be64(hose->cfg_data + PCIE_REG_SYS_CFG1,
477478 (val & ~PCIE_REG_SYS_CFG1_CLASS_CODE) | (PCI_CLASS_BRIDGE_PCI << 8));
478479 pr_debug("PCI-E SYS_CFG1 : 0x%llx\n", in_be64(hose->cfg_data + PCIE_REG_SYS_CFG1));
479−#endif /* CONFIG_WSP_DD1_WORKAROUND_BAD_PCIE_CLASS */
480480
481481 #ifdef CONFIG_WSP_DD1_WORKAROUND_DD1_TCE_BUGS
482482 /* XXX Disable TCE caching, it doesn't work on DD1 */
arch/powerpc/sysdev/fsl_pci.c+29−19
@@ -385,26 +385,36 @@ static void __init setup_pci_cmd(struct pci_controller *hose) · 384 unmodified lines
385385 void fsl_pcibios_fixup_bus(struct pci_bus *bus)
386386 {
387387 struct pci_controller *hose = pci_bus_to_host(bus);
388− int i;
389−
390− if ((bus->parent == hose->bus) &&
391− ((fsl_pcie_bus_fixup &&
392− early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) ||
393− (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK)))
394− {
395− for (i = 0; i < 4; ++i) {
388+ int i, is_pcie = 0, no_link;
389+
390+ /* The root complex bridge comes up with bogus resources,
391+ * we copy the PHB ones in.
392+ *
393+ * With the current generic PCI code, the PHB bus no longer
394+ * has bus->resource[0..4] set, so things are a bit more
395+ * tricky.
396+ */
397+
398+ if (fsl_pcie_bus_fixup)
399+ is_pcie = early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP);
400+ no_link = !!(hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK);
401+
402+ if (bus->parent == hose->bus && (is_pcie || no_link)) {
403+ for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; ++i) {
396404 struct resource *res = bus->resource[i];
397− struct resource *par = bus->parent->resource[i];
398− if (res) {
399− res->start = 0;
400− res->end = 0;
401− res->flags = 0;
402− }
403− if (res && par) {
404− res->start = par->start;
405− res->end = par->end;
406− res->flags = par->flags;
407− }
405+ struct resource *par;
406+
407+ if (!res)
408+ continue;
409+ if (i == 0)
410+ par = &hose->io_resource;
411+ else if (i < 4)
412+ par = &hose->mem_resources[i-1];
413+ else par = NULL;
414+
415+ res->start = par ? par->start : 0;
416+ res->end = par ? par->end : 0;
417+ res->flags = par ? par->flags : 0;
408418 }
409419 }
410420 }
arch/s390/include/asm/compat.h+0−7
@@ -172,13 +172,6 @@ static inline int is_compat_task(void) · 171 unmodified lines
172172 return is_32bit_task();
173173 }
174174
175−#else
176−
177−static inline int is_compat_task(void)
178−{
179− return 0;
180−}
181−
182175 #endif
183176
184177 static inline void __user *arch_compat_alloc_user_space(long len)
arch/s390/kernel/compat_wrapper.S+1−1
@@ -662,7 +662,7 @@ ENTRY(sys32_getresuid16_wrapper) · 661 unmodified lines
662662 ENTRY(sys32_poll_wrapper)
663663 llgtr %r2,%r2 # struct pollfd *
664664 llgfr %r3,%r3 # unsigned int
665− lgfr %r4,%r4 # long
665+ lgfr %r4,%r4 # int
666666 jg sys_poll # branch to system call
667667
668668 ENTRY(sys32_setresgid16_wrapper)
arch/s390/kernel/process.c+3−3
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929 #include <asm/irq.h>
3030 #include <asm/timer.h>
3131 #include <asm/nmi.h>
32−#include <asm/compat.h>
3332 #include <asm/smp.h>
3433 #include "entry.h"
3534
@@ -76,7 +75,6 @@ static void default_idle(void) · 40 unmodified lines
7675 if (test_thread_flag(TIF_MCCK_PENDING)) {
7776 local_mcck_enable();
7877 local_irq_enable();
79− s390_handle_mcck();
8078 return;
8179 }
8280 trace_hardirqs_on();
@@ -93,10 +91,12 @@ void cpu_idle(void) · 10 unmodified lines
9391 for (;;) {
9492 tick_nohz_idle_enter();
9593 rcu_idle_enter();
96− while (!need_resched())
94+ while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING))
9795 default_idle();
9896 rcu_idle_exit();
9997 tick_nohz_idle_exit();
98+ if (test_thread_flag(TIF_MCCK_PENDING))
99+ s390_handle_mcck();
100100 preempt_enable_no_resched();
101101 schedule();
102102 preempt_disable();
arch/s390/kernel/ptrace.c+1−1
@@ -20,8 +20,8 @@ · 19 unmodified lines
2020 #include <linux/regset.h>
2121 #include <linux/tracehook.h>
2222 #include <linux/seccomp.h>
23+#include <linux/compat.h>
2324 #include <trace/syscall.h>
24−#include <asm/compat.h>
2525 #include <asm/segment.h>
2626 #include <asm/page.h>
2727 #include <asm/pgtable.h>
arch/s390/kernel/setup.c+1−1
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 #include <linux/kexec.h>
4747 #include <linux/crash_dump.h>
4848 #include <linux/memory.h>
49+#include <linux/compat.h>
4950
5051 #include <asm/ipl.h>
5152 #include <asm/uaccess.h>
@@ -59,7 +60,6 @@ · 7 unmodified lines
5960 #include <asm/ptrace.h>
6061 #include <asm/sections.h>
6162 #include <asm/ebcdic.h>
62−#include <asm/compat.h>
6363 #include <asm/kvm_virtio.h>
6464 #include <asm/diag.h>
6565
arch/s390/kernel/signal.c+0−1
@@ -30,7 +30,6 @@ · 29 unmodified lines
3030 #include <asm/ucontext.h>
3131 #include <asm/uaccess.h>
3232 #include <asm/lowcore.h>
33−#include <asm/compat.h>
3433 #include "entry.h"
3534
3635 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
arch/s390/kernel/time.c+5−2
@@ -113,11 +113,14 @@ static void fixup_clock_comparator(unsigned long long delta) · 112 unmodified lines
113113 static int s390_next_ktime(ktime_t expires,
114114 struct clock_event_device *evt)
115115 {
116+ struct timespec ts;
116117 u64 nsecs;
117118
118− nsecs = ktime_to_ns(ktime_sub(expires, ktime_get_monotonic_offset()));
119+ ts.tv_sec = ts.tv_nsec = 0;
120+ monotonic_to_bootbased(&ts);
121+ nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires));
119122 do_div(nsecs, 125);
120− S390_lowcore.clock_comparator = TOD_UNIX_EPOCH + (nsecs << 9);
123+ S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9);
121124 set_clock_comparator(S390_lowcore.clock_comparator);
122125 return 0;
123126 }
arch/s390/mm/fault.c+0−1
@@ -36,7 +36,6 @@ · 35 unmodified lines
3636 #include <asm/pgtable.h>
3737 #include <asm/irq.h>
3838 #include <asm/mmu_context.h>
39−#include <asm/compat.h>
4039 #include "../kernel/entry.h"
4140
4241 #ifndef CONFIG_64BIT
arch/s390/mm/mmap.c+1−1
@@ -29,8 +29,8 @@ · 28 unmodified lines
2929 #include <linux/mman.h>
3030 #include <linux/module.h>
3131 #include <linux/random.h>
32+#include <linux/compat.h>
3233 #include <asm/pgalloc.h>
33−#include <asm/compat.h>
3434
3535 static unsigned long stack_maxrandom_size(void)
3636 {
arch/s390/mm/pgtable.c+1−1
@@ -574,7 +574,7 @@ static inline void page_table_free_pgste(unsigned long *table) · 573 unmodified lines
574574 page = pfn_to_page(__pa(table) >> PAGE_SHIFT);
575575 mp = (struct gmap_pgtable *) page->index;
576576 BUG_ON(!list_empty(&mp->mapper));
577− pgtable_page_ctor(page);
577+ pgtable_page_dtor(page);
578578 atomic_set(&page->_mapcount, -1);
579579 kfree(mp);
580580 __free_page(page);
arch/sh/Kconfig+1−0
@@ -859,6 +859,7 @@ config PCI · 858 unmodified lines
859859 depends on SYS_SUPPORTS_PCI
860860 select PCI_DOMAINS
861861 select GENERIC_PCI_IOMAP
862+ select NO_GENERIC_PCI_IOPORT_MAP
862863 help
863864 Find out whether you have a PCI motherboard. PCI is the name of a
864865 bus system, i.e. the way the CPU talks to the other stuff inside
arch/sh/boards/board-sh7757lcr.c+9−11
@@ -168,6 +168,11 @@ static struct resource sh_eth_giga1_resources[] = { · 167 unmodified lines
168168 .start = 0xfee00800,
169169 .end = 0xfee00fff,
170170 .flags = IORESOURCE_MEM,
171+ }, {
172+ /* TSU */
173+ .start = 0xfee01800,
174+ .end = 0xfee01fff,
175+ .flags = IORESOURCE_MEM,
171176 }, {
172177 .start = 316,
173178 .end = 316,
@@ -210,20 +215,13 @@ static struct resource sh_mmcif_resources[] = { · 36 unmodified lines
210215 },
211216 };
212217
213−static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
214− .chan_priv_tx = {
215− .slave_id = SHDMA_SLAVE_MMCIF_TX,
216− },
217− .chan_priv_rx = {
218− .slave_id = SHDMA_SLAVE_MMCIF_RX,
219− }
220−};
221−
222218 static struct sh_mmcif_plat_data sh_mmcif_plat = {
223− .dma = &sh7757lcr_mmcif_dma,
224219 .sup_pclk = 0x0f,
225− .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
220+ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
221+ MMC_CAP_NONREMOVABLE,
226222 .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
223+ .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
224+ .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
227225 };
228226
229227 static struct platform_device sh_mmcif_device = {
arch/sh/boards/mach-ap325rxa/setup.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/i2c.h>
2323 #include <linux/smsc911x.h>
2424 #include <linux/gpio.h>
25+#include <linux/videodev2.h>
2526 #include <media/ov772x.h>
2627 #include <media/soc_camera.h>
2728 #include <media/soc_camera_platform.h>
arch/sh/boards/mach-ecovec24/setup.c+2−0
@@ -29,9 +29,11 @@ · 28 unmodified lines
2929 #include <linux/input.h>
3030 #include <linux/input/sh_keysc.h>
3131 #include <linux/sh_eth.h>
32+#include <linux/videodev2.h>
3233 #include <video/sh_mobile_lcdc.h>
3334 #include <sound/sh_fsi.h>
3435 #include <media/sh_mobile_ceu.h>
36+#include <media/soc_camera.h>
3537 #include <media/tw9910.h>
3638 #include <media/mt9t112.h>
3739 #include <asm/heartbeat.h>
arch/sh/boards/mach-kfr2r09/setup.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/input/sh_keysc.h>
2323 #include <linux/i2c.h>
2424 #include <linux/usb/r8a66597.h>
25+#include <linux/videodev2.h>
2526 #include <media/rj54n1cb0c.h>
2627 #include <media/soc_camera.h>
2728 #include <media/sh_mobile_ceu.h>
arch/sh/boards/mach-migor/setup.c+2−0
@@ -21,9 +21,11 @@ · 20 unmodified lines
2121 #include <linux/delay.h>
2222 #include <linux/clk.h>
2323 #include <linux/gpio.h>
24+#include <linux/videodev2.h>
2425 #include <video/sh_mobile_lcdc.h>
2526 #include <media/sh_mobile_ceu.h>
2627 #include <media/ov772x.h>
28+#include <media/soc_camera.h>
2729 #include <media/tw9910.h>
2830 #include <asm/clock.h>
2931 #include <asm/machvec.h>
arch/sh/boards/mach-se/7724/setup.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <linux/input/sh_keysc.h>
2525 #include <linux/usb/r8a66597.h>
2626 #include <linux/sh_eth.h>
27+#include <linux/videodev2.h>
2728 #include <video/sh_mobile_lcdc.h>
2829 #include <media/sh_mobile_ceu.h>
2930 #include <sound/sh_fsi.h>
arch/sh/drivers/pci/pci-sh7780.c+1−1
@@ -74,7 +74,7 @@ struct pci_errors { · 73 unmodified lines
7474 { SH4_PCIINT_MLCK, "master lock error" },
7575 { SH4_PCIINT_TABT, "target-target abort" },
7676 { SH4_PCIINT_TRET, "target retry time out" },
77− { SH4_PCIINT_MFDE, "master function disable erorr" },
77+ { SH4_PCIINT_MFDE, "master function disable error" },
7878 { SH4_PCIINT_PRTY, "address parity error" },
7979 { SH4_PCIINT_SERR, "SERR" },
8080 { SH4_PCIINT_TWDP, "data parity error for target write" },
arch/sh/drivers/pci/pci.c+2−2
@@ -356,8 +356,8 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, · 355 unmodified lines
356356
357357 #ifndef CONFIG_GENERIC_IOMAP
358358
359−static void __iomem *ioport_map_pci(struct pci_dev *dev,
360− unsigned long port, unsigned int nr)
359+void __iomem *__pci_ioport_map(struct pci_dev *dev,
360+ unsigned long port, unsigned int nr)
361361 {
362362 struct pci_channel *chan = dev->sysdata;
363363
arch/sh/include/asm/device.h+4−4
@@ -3,9 +3,10 @@ · 2 unmodified lines
33 *
44 * This file is released under the GPLv2
55 */
6+#ifndef __ASM_SH_DEVICE_H
7+#define __ASM_SH_DEVICE_H
68
7−struct dev_archdata {
8−};
9+#include <asm-generic/device.h>
910
1011 struct platform_device;
1112 /* allocate contiguous memory chunk and fill in struct resource */
@@ -14,5 +15,4 @@ int platform_resource_setup_memory(struct platform_device *pdev, · 2 unmodified lines
1415
1516 void plat_early_device_setup(void);
1617
17−struct pdev_archdata {
18−};
18+#endif /* __ASM_SH_DEVICE_H */
arch/sh/kernel/cpu/sh4a/clock-sh7724.c+1−1
@@ -343,7 +343,7 @@ static struct clk_lookup lookups[] = { · 342 unmodified lines
343343 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]),
344344 CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]),
345345 CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]),
346− CLKDEV_CON_ID("spu0", &mstp_clks[HWBLK_SPU]),
346+ CLKDEV_DEV_ID("sh_fsi.0", &mstp_clks[HWBLK_SPU]),
347347 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
348348 CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]),
349349 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),
arch/sh/kernel/cpu/sh4a/setup-sh7757.c+21−1
@@ -133,7 +133,7 @@ static struct resource spi0_resources[] = { · 132 unmodified lines
133133 [0] = {
134134 .start = 0xfe002000,
135135 .end = 0xfe0020ff,
136− .flags = IORESOURCE_MEM,
136+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
137137 },
138138 [1] = {
139139 .start = 86,
@@ -661,6 +661,25 @@ static struct platform_device spi0_device = { · 521 unmodified lines
661661 .resource = spi0_resources,
662662 };
663663
664+static struct resource spi1_resources[] = {
665+ {
666+ .start = 0xffd8ee70,
667+ .end = 0xffd8eeff,
668+ .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
669+ },
670+ {
671+ .start = 54,
672+ .flags = IORESOURCE_IRQ,
673+ },
674+};
675+
676+static struct platform_device spi1_device = {
677+ .name = "sh_spi",
678+ .id = 1,
679+ .num_resources = ARRAY_SIZE(spi1_resources),
680+ .resource = spi1_resources,
681+};
682+
664683 static struct resource usb_ehci_resources[] = {
665684 [0] = {
666685 .start = 0xfe4f1000,
@@ -720,6 +739,7 @@ static struct platform_device *sh7757_devices[] __initdata = { · 53 unmodified lines
720739 &dma2_device,
721740 &dma3_device,
722741 &spi0_device,
742+ &spi1_device,
723743 &usb_ehci_device,
724744 &usb_ohci_device,
725745 };
arch/sh/kernel/smp.c+1−1
@@ -63,7 +63,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) · 62 unmodified lines
6363 mp_ops->prepare_cpus(max_cpus);
6464
6565 #ifndef CONFIG_HOTPLUG_CPU
66− init_cpu_present(&cpu_possible_map);
66+ init_cpu_present(cpu_possible_mask);
6767 #endif
6868 }
6969
arch/sh/kernel/topology.c+1−1
@@ -27,7 +27,7 @@ static cpumask_t cpu_coregroup_map(unsigned int cpu) · 26 unmodified lines
2727 * Presently all SH-X3 SMP cores are multi-cores, so just keep it
2828 * simple until we have a method for determining topology..
2929 */
30− return cpu_possible_map;
30+ return *cpu_possible_mask;
3131 }
3232
3333 const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
arch/sh/mm/cache-sh2a.c+2−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #define MAX_OCACHE_PAGES 32
2424 #define MAX_ICACHE_PAGES 32
2525
26+#ifdef CONFIG_CACHE_WRITEBACK
2627 static void sh2a_flush_oc_line(unsigned long v, int way)
2728 {
2829 unsigned long addr = (v & 0x000007f0) | (way << 11);
@@ -34,6 +35,7 @@ static void sh2a_flush_oc_line(unsigned long v, int way) · 5 unmodified lines
3435 __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr);
3536 }
3637 }
38+#endif
3739
3840 static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v)
3941 {
arch/x86/include/asm/i387.h+252−55
@@ -29,10 +29,11 @@ extern unsigned int sig_xstate_size; · 28 unmodified lines
2929 extern void fpu_init(void);
3030 extern void mxcsr_feature_mask_init(void);
3131 extern int init_fpu(struct task_struct *child);
32−extern asmlinkage void math_state_restore(void);
33−extern void __math_state_restore(void);
32+extern void math_state_restore(void);
3433 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
3534
35+DECLARE_PER_CPU(struct task_struct *, fpu_owner_task);
36+
3637 extern user_regset_active_fn fpregs_active, xfpregs_active;
3738 extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get,
3839 xstateregs_get;
@@ -212,19 +213,11 @@ static inline void fpu_fxsave(struct fpu *fpu) · 173 unmodified lines
212213
213214 #endif /* CONFIG_X86_64 */
214215
215−/* We need a safe address that is cheap to find and that is already
216− in L1 during context switch. The best choices are unfortunately
217− different for UP and SMP */
218−#ifdef CONFIG_SMP
219−#define safe_address (__per_cpu_offset[0])
220−#else
221−#define safe_address (__get_cpu_var(kernel_cpustat).cpustat[CPUTIME_USER])
222−#endif
223−
224216 /*
225− * These must be called with preempt disabled
217+ * These must be called with preempt disabled. Returns
218+ * 'true' if the FPU state is still intact.
226219 */
227−static inline void fpu_save_init(struct fpu *fpu)
220+static inline int fpu_save_init(struct fpu *fpu)
228221 {
229222 if (use_xsave()) {
230223 fpu_xsave(fpu);
@@ -233,33 +226,33 @@ static inline void fpu_save_init(struct fpu *fpu) · 2 unmodified lines
233226 * xsave header may indicate the init state of the FP.
234227 */
235228 if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
236− return;
229+ return 1;
237230 } else if (use_fxsr()) {
238231 fpu_fxsave(fpu);
239232 } else {
240233 asm volatile("fnsave %[fx]; fwait"
241234 : [fx] "=m" (fpu->state->fsave));
242− return;
235+ return 0;
243236 }
244237
245− if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES))
238+ /*
239+ * If exceptions are pending, we need to clear them so
240+ * that we don't randomly get exceptions later.
241+ *
242+ * FIXME! Is this perhaps only true for the old-style
243+ * irq13 case? Maybe we could leave the x87 state
244+ * intact otherwise?
245+ */
246+ if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES)) {
246247 asm volatile("fnclex");
247−
248− /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
249− is pending. Clear the x87 state here by setting it to fixed
250− values. safe_address is a random variable that should be in L1 */
251− alternative_input(
252− ASM_NOP8 ASM_NOP2,
253− "emms\n\t" /* clear stack tags */
254− "fildl %P[addr]", /* set F?P to defined value */
255− X86_FEATURE_FXSAVE_LEAK,
256− [addr] "m" (safe_address));
248+ return 0;
249+ }
250+ return 1;
257251 }
258252
259−static inline void __save_init_fpu(struct task_struct *tsk)
253+static inline int __save_init_fpu(struct task_struct *tsk)
260254 {
261− fpu_save_init(&tsk->thread.fpu);
262− task_thread_info(tsk)->status &= ~TS_USEDFPU;
255+ return fpu_save_init(&tsk->thread.fpu);
263256 }
264257
265258 static inline int fpu_fxrstor_checking(struct fpu *fpu)
@@ -277,44 +270,212 @@ static inline int fpu_restore_checking(struct fpu *fpu) · 11 unmodified lines
277270
278271 static inline int restore_fpu_checking(struct task_struct *tsk)
279272 {
273+ /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
274+ is pending. Clear the x87 state here by setting it to fixed
275+ values. "m" is a random variable that should be in L1 */
276+ alternative_input(
277+ ASM_NOP8 ASM_NOP2,
278+ "emms\n\t" /* clear stack tags */
279+ "fildl %P[addr]", /* set F?P to defined value */
280+ X86_FEATURE_FXSAVE_LEAK,
281+ [addr] "m" (tsk->thread.fpu.has_fpu));
282+
280283 return fpu_restore_checking(&tsk->thread.fpu);
281284 }
282285
283286 /*
284− * Signal frame handlers...
287+ * Software FPU state helpers. Careful: these need to
288+ * be preemption protection *and* they need to be
289+ * properly paired with the CR0.TS changes!
285290 */
286−extern int save_i387_xstate(void __user *buf);
287−extern int restore_i387_xstate(void __user *buf);
291+static inline int __thread_has_fpu(struct task_struct *tsk)
292+{
293+ return tsk->thread.fpu.has_fpu;
294+}
288295
289−static inline void __unlazy_fpu(struct task_struct *tsk)
296+/* Must be paired with an 'stts' after! */
297+static inline void __thread_clear_has_fpu(struct task_struct *tsk)
290298 {
291− if (task_thread_info(tsk)->status & TS_USEDFPU) {
292− __save_init_fpu(tsk);
293− stts();
294− } else
295− tsk->fpu_counter = 0;
299+ tsk->thread.fpu.has_fpu = 0;
300+ percpu_write(fpu_owner_task, NULL);
301+}
302+
303+/* Must be paired with a 'clts' before! */
304+static inline void __thread_set_has_fpu(struct task_struct *tsk)
305+{
306+ tsk->thread.fpu.has_fpu = 1;
307+ percpu_write(fpu_owner_task, tsk);
308+}
309+
310+/*
311+ * Encapsulate the CR0.TS handling together with the
312+ * software flag.
313+ *
314+ * These generally need preemption protection to work,
315+ * do try to avoid using these on their own.
316+ */
317+static inline void __thread_fpu_end(struct task_struct *tsk)
318+{
319+ __thread_clear_has_fpu(tsk);
320+ stts();
321+}
322+
323+static inline void __thread_fpu_begin(struct task_struct *tsk)
324+{
325+ clts();
326+ __thread_set_has_fpu(tsk);
327+}
328+
329+/*
330+ * FPU state switching for scheduling.
331+ *
332+ * This is a two-stage process:
333+ *
334+ * - switch_fpu_prepare() saves the old state and
335+ * sets the new state of the CR0.TS bit. This is
336+ * done within the context of the old process.
337+ *
338+ * - switch_fpu_finish() restores the new state as
339+ * necessary.
340+ */
341+typedef struct { int preload; } fpu_switch_t;
342+
343+/*
344+ * FIXME! We could do a totally lazy restore, but we need to
345+ * add a per-cpu "this was the task that last touched the FPU
346+ * on this CPU" variable, and the task needs to have a "I last
347+ * touched the FPU on this CPU" and check them.
348+ *
349+ * We don't do that yet, so "fpu_lazy_restore()" always returns
350+ * false, but some day..
351+ */
352+static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
353+{
354+ return new == percpu_read_stable(fpu_owner_task) &&
355+ cpu == new->thread.fpu.last_cpu;
356+}
357+
358+static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new, int cpu)
359+{
360+ fpu_switch_t fpu;
361+
362+ fpu.preload = tsk_used_math(new) && new->fpu_counter > 5;
363+ if (__thread_has_fpu(old)) {
364+ if (!__save_init_fpu(old))
365+ cpu = ~0;
366+ old->thread.fpu.last_cpu = cpu;
367+ old->thread.fpu.has_fpu = 0; /* But leave fpu_owner_task! */
368+
369+ /* Don't change CR0.TS if we just switch! */
370+ if (fpu.preload) {
371+ new->fpu_counter++;
372+ __thread_set_has_fpu(new);
373+ prefetch(new->thread.fpu.state);
374+ } else
375+ stts();
376+ } else {
377+ old->fpu_counter = 0;
378+ old->thread.fpu.last_cpu = ~0;
379+ if (fpu.preload) {
380+ new->fpu_counter++;
381+ if (fpu_lazy_restore(new, cpu))
382+ fpu.preload = 0;
383+ else
384+ prefetch(new->thread.fpu.state);
385+ __thread_fpu_begin(new);
386+ }
387+ }
388+ return fpu;
389+}
390+
391+/*
392+ * By the time this gets called, we've already cleared CR0.TS and
393+ * given the process the FPU if we are going to preload the FPU
394+ * state - all we need to do is to conditionally restore the register
395+ * state itself.
396+ */
397+static inline void switch_fpu_finish(struct task_struct *new, fpu_switch_t fpu)
398+{
399+ if (fpu.preload) {
400+ if (unlikely(restore_fpu_checking(new)))
401+ __thread_fpu_end(new);
402+ }
296403 }
297404
405+/*
406+ * Signal frame handlers...
407+ */
408+extern int save_i387_xstate(void __user *buf);
409+extern int restore_i387_xstate(void __user *buf);
410+
298411 static inline void __clear_fpu(struct task_struct *tsk)
299412 {
300− if (task_thread_info(tsk)->status & TS_USEDFPU) {
413+ if (__thread_has_fpu(tsk)) {
301414 /* Ignore delayed exceptions from user space */
302415 asm volatile("1: fwait\n"
303416 "2:\n"
304417 _ASM_EXTABLE(1b, 2b));
305− task_thread_info(tsk)->status &= ~TS_USEDFPU;
306− stts();
418+ __thread_fpu_end(tsk);
307419 }
308420 }
309421
422+/*
423+ * Were we in an interrupt that interrupted kernel mode?
424+ *
425+ * We can do a kernel_fpu_begin/end() pair *ONLY* if that
426+ * pair does nothing at all: the thread must not have fpu (so
427+ * that we don't try to save the FPU state), and TS must
428+ * be set (so that the clts/stts pair does nothing that is
429+ * visible in the interrupted kernel thread).
430+ */
431+static inline bool interrupted_kernel_fpu_idle(void)
432+{
433+ return !__thread_has_fpu(current) &&
434+ (read_cr0() & X86_CR0_TS);
435+}
436+
437+/*
438+ * Were we in user mode (or vm86 mode) when we were
439+ * interrupted?
440+ *
441+ * Doing kernel_fpu_begin/end() is ok if we are running
442+ * in an interrupt context from user mode - we'll just
443+ * save the FPU state as required.
444+ */
445+static inline bool interrupted_user_mode(void)
446+{
447+ struct pt_regs *regs = get_irq_regs();
448+ return regs && user_mode_vm(regs);
449+}
450+
451+/*
452+ * Can we use the FPU in kernel mode with the
453+ * whole "kernel_fpu_begin/end()" sequence?
454+ *
455+ * It's always ok in process context (ie "not interrupt")
456+ * but it is sometimes ok even from an irq.
457+ */
458+static inline bool irq_fpu_usable(void)
459+{
460+ return !in_interrupt() ||
461+ interrupted_user_mode() ||
462+ interrupted_kernel_fpu_idle();
463+}
464+
310465 static inline void kernel_fpu_begin(void)
311466 {
312− struct thread_info *me = current_thread_info();
467+ struct task_struct *me = current;
468+
469+ WARN_ON_ONCE(!irq_fpu_usable());
313470 preempt_disable();
314− if (me->status & TS_USEDFPU)
315− __save_init_fpu(me->task);
316− else
471+ if (__thread_has_fpu(me)) {
472+ __save_init_fpu(me);
473+ __thread_clear_has_fpu(me);
474+ /* We do 'stts()' in kernel_fpu_end() */
475+ } else {
476+ percpu_write(fpu_owner_task, NULL);
317477 clts();
478+ }
318479 }
319480
320481 static inline void kernel_fpu_end(void)
@@ -323,14 +484,6 @@ static inline void kernel_fpu_end(void) · 2 unmodified lines
323484 preempt_enable();
324485 }
325486
326−static inline bool irq_fpu_usable(void)
327−{
328− struct pt_regs *regs;
329−
330− return !in_interrupt() || !(regs = get_irq_regs()) || \
331− user_mode(regs) || (read_cr0() & X86_CR0_TS);
332−}
333−
334487 /*
335488 * Some instructions like VIA's padlock instructions generate a spurious
336489 * DNA fault but don't modify SSE registers. And these instructions
@@ -362,21 +515,65 @@ static inline void irq_ts_restore(int TS_state) · 25 unmodified lines
362515 stts();
363516 }
364517
518+/*
519+ * The question "does this thread have fpu access?"
520+ * is slightly racy, since preemption could come in
521+ * and revoke it immediately after the test.
522+ *
523+ * However, even in that very unlikely scenario,
524+ * we can just assume we have FPU access - typically
525+ * to save the FP state - we'll just take a #NM
526+ * fault and get the FPU access back.
527+ *
528+ * The actual user_fpu_begin/end() functions
529+ * need to be preemption-safe, though.
530+ *
531+ * NOTE! user_fpu_end() must be used only after you
532+ * have saved the FP state, and user_fpu_begin() must
533+ * be used only immediately before restoring it.
534+ * These functions do not do any save/restore on
535+ * their own.
536+ */
537+static inline int user_has_fpu(void)
538+{
539+ return __thread_has_fpu(current);
540+}
541+
542+static inline void user_fpu_end(void)
543+{
544+ preempt_disable();
545+ __thread_fpu_end(current);
546+ preempt_enable();
547+}
548+
549+static inline void user_fpu_begin(void)
550+{
551+ preempt_disable();
552+ if (!user_has_fpu())
553+ __thread_fpu_begin(current);
554+ preempt_enable();
555+}
556+
365557 /*
366558 * These disable preemption on their own and are safe
367559 */
368560 static inline void save_init_fpu(struct task_struct *tsk)
369561 {
562+ WARN_ON_ONCE(!__thread_has_fpu(tsk));
370563 preempt_disable();
371564 __save_init_fpu(tsk);
372− stts();
565+ __thread_fpu_end(tsk);
373566 preempt_enable();
374567 }
375568
376569 static inline void unlazy_fpu(struct task_struct *tsk)
377570 {
378571 preempt_disable();
379− __unlazy_fpu(tsk);
572+ if (__thread_has_fpu(tsk)) {
573+ __save_init_fpu(tsk);
574+ __thread_fpu_end(tsk);
575+ } else
576+ tsk->fpu_counter = 0;
380577 preempt_enable();
381578 }
382579
arch/x86/include/asm/kvm_emulate.h+16−0
@@ -190,6 +190,9 @@ struct x86_emulate_ops { · 189 unmodified lines
190190 int (*intercept)(struct x86_emulate_ctxt *ctxt,
191191 struct x86_instruction_info *info,
192192 enum x86_intercept_stage stage);
193+
194+ bool (*get_cpuid)(struct x86_emulate_ctxt *ctxt,
195+ u32 *eax, u32 *ebx, u32 *ecx, u32 *edx);
193196 };
194197
195198 typedef u32 __attribute__((vector_size(16))) sse128_t;
@@ -298,6 +301,19 @@ struct x86_emulate_ctxt { · 102 unmodified lines
298301 #define X86EMUL_MODE_PROT (X86EMUL_MODE_PROT16|X86EMUL_MODE_PROT32| \
299302 X86EMUL_MODE_PROT64)
300303
304+/* CPUID vendors */
305+#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx 0x68747541
306+#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx 0x444d4163
307+#define X86EMUL_CPUID_VENDOR_AuthenticAMD_edx 0x69746e65
308+
309+#define X86EMUL_CPUID_VENDOR_AMDisbetterI_ebx 0x69444d41
310+#define X86EMUL_CPUID_VENDOR_AMDisbetterI_ecx 0x21726574
311+#define X86EMUL_CPUID_VENDOR_AMDisbetterI_edx 0x74656273
312+
313+#define X86EMUL_CPUID_VENDOR_GenuineIntel_ebx 0x756e6547
314+#define X86EMUL_CPUID_VENDOR_GenuineIntel_ecx 0x6c65746e
315+#define X86EMUL_CPUID_VENDOR_GenuineIntel_edx 0x49656e69
316+
301317 enum x86_intercept_stage {
302318 X86_ICTP_NONE = 0, /* Allow zero-init to not match anything */
303319 X86_ICPT_PRE_EXCEPT,
arch/x86/include/asm/perf_event.h+8−0
@@ -240,4 +240,12 @@ static inline void perf_get_x86_pmu_capability(struct x86_pmu_capability *cap) · 239 unmodified lines
240240 static inline void perf_events_lapic_init(void) { }
241241 #endif
242242
243+#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_AMD)
244+ extern void amd_pmu_enable_virt(void);
245+ extern void amd_pmu_disable_virt(void);
246+#else
247+ static inline void amd_pmu_enable_virt(void) { }
248+ static inline void amd_pmu_disable_virt(void) { }
249+#endif
250+
243251 #endif /* _ASM_X86_PERF_EVENT_H */
arch/x86/include/asm/processor.h+2−0
@@ -374,6 +374,8 @@ union thread_xstate { · 373 unmodified lines
374374 };
375375
376376 struct fpu {
377+ unsigned int last_cpu;
378+ unsigned int has_fpu;
377379 union thread_xstate *state;
378380 };
379381
arch/x86/include/asm/thread_info.h+0−2
@@ -247,8 +247,6 @@ static inline struct thread_info *current_thread_info(void) · 246 unmodified lines
247247 * ever touches our thread-synchronous status, so we don't
248248 * have to worry about atomic accesses.
249249 */
250−#define TS_USEDFPU 0x0001 /* FPU was used by this task
251− this quantum (SMP) */
252250 #define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/
253251 #define TS_POLLING 0x0004 /* idle task polling need_resched,
254252 skip sending interrupt */
arch/x86/kernel/cpu/common.c+5−0
@@ -1044,6 +1044,9 @@ DEFINE_PER_CPU(char *, irq_stack_ptr) = · 1043 unmodified lines
10441044
10451045 DEFINE_PER_CPU(unsigned int, irq_count) = -1;
10461046
1047+DEFINE_PER_CPU(struct task_struct *, fpu_owner_task);
1048+EXPORT_PER_CPU_SYMBOL(fpu_owner_task);
1049+
10471050 /*
10481051 * Special IST stacks which the CPU switches to when it calls
10491052 * an IST-marked descriptor entry. Up to 7 stacks (hardware
@@ -1111,6 +1114,8 @@ void debug_stack_reset(void) · 61 unmodified lines
11111114
11121115 DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
11131116 EXPORT_PER_CPU_SYMBOL(current_task);
1117+DEFINE_PER_CPU(struct task_struct *, fpu_owner_task);
1118+EXPORT_PER_CPU_SYMBOL(fpu_owner_task);
11141119
11151120 #ifdef CONFIG_CC_STACKPROTECTOR
11161121 DEFINE_PER_CPU_ALIGNED(struct stack_canary, stack_canary);
arch/x86/kernel/cpu/intel_cacheinfo.c+36−8
@@ -326,8 +326,7 @@ static void __cpuinit amd_calc_l3_indices(struct amd_northbridge *nb) · 325 unmodified lines
326326 l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1;
327327 }
328328
329−static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf,
330− int index)
329+static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index)
331330 {
332331 int node;
333332
@@ -725,14 +724,16 @@ static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info); · 391 unmodified lines
725724 #define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y]))
726725
727726 #ifdef CONFIG_SMP
728−static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
727+
728+static int __cpuinit cache_shared_amd_cpu_map_setup(unsigned int cpu, int index)
729729 {
730− struct _cpuid4_info *this_leaf, *sibling_leaf;
731− unsigned long num_threads_sharing;
732− int index_msb, i, sibling;
730+ struct _cpuid4_info *this_leaf;
731+ int ret, i, sibling;
733732 struct cpuinfo_x86 *c = &cpu_data(cpu);
734733
735− if ((index == 3) && (c->x86_vendor == X86_VENDOR_AMD)) {
734+ ret = 0;
735+ if (index == 3) {
736+ ret = 1;
736737 for_each_cpu(i, cpu_llc_shared_mask(cpu)) {
737738 if (!per_cpu(ici_cpuid4_info, i))
738739 continue;
@@ -743,8 +744,35 @@ static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) · 4 unmodified lines
743744 set_bit(sibling, this_leaf->shared_cpu_map);
744745 }
745746 }
746− return;
747+ } else if ((c->x86 == 0x15) && ((index == 1) || (index == 2))) {
748+ ret = 1;
749+ for_each_cpu(i, cpu_sibling_mask(cpu)) {
750+ if (!per_cpu(ici_cpuid4_info, i))
751+ continue;
752+ this_leaf = CPUID4_INFO_IDX(i, index);
753+ for_each_cpu(sibling, cpu_sibling_mask(cpu)) {
754+ if (!cpu_online(sibling))
755+ continue;
756+ set_bit(sibling, this_leaf->shared_cpu_map);
757+ }
758+ }
747759 }
760+
761+ return ret;
762+}
763+
764+static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
765+{
766+ struct _cpuid4_info *this_leaf, *sibling_leaf;
767+ unsigned long num_threads_sharing;
768+ int index_msb, i;
769+ struct cpuinfo_x86 *c = &cpu_data(cpu);
770+
771+ if (c->x86_vendor == X86_VENDOR_AMD) {
772+ if (cache_shared_amd_cpu_map_setup(cpu, index))
773+ return;
774+ }
775+
748776 this_leaf = CPUID4_INFO_IDX(cpu, index);
749777 num_threads_sharing = 1 + this_leaf->base.eax.split.num_threads_sharing;
750778
arch/x86/kernel/cpu/mcheck/mce_amd.c+2−0
@@ -528,6 +528,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) · 527 unmodified lines
528528
529529 sprintf(name, "threshold_bank%i", bank);
530530
531+#ifdef CONFIG_SMP
531532 if (cpu_data(cpu).cpu_core_id && shared_bank[bank]) { /* symlink */
532533 i = cpumask_first(cpu_llc_shared_mask(cpu));
533534
@@ -553,6 +554,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) · 19 unmodified lines
553554
554555 goto out;
555556 }
557+#endif
556558
557559 b = kzalloc(sizeof(struct threshold_bank), GFP_KERNEL);
558560 if (!b) {
arch/x86/kernel/cpu/perf_event.c+3−0
@@ -988,6 +988,9 @@ static void x86_pmu_start(struct perf_event *event, int flags) · 987 unmodified lines
988988 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
989989 int idx = event->hw.idx;
990990
991+ if (WARN_ON_ONCE(!(event->hw.state & PERF_HES_STOPPED)))
992+ return;
993+
991994 if (WARN_ON_ONCE(idx == -1))
992995 return;
993996
arch/x86/kernel/cpu/perf_event.h+6−2
@@ -147,7 +147,9 @@ struct cpu_hw_events { · 146 unmodified lines
147147 /*
148148 * AMD specific bits
149149 */
150− struct amd_nb *amd_nb;
150+ struct amd_nb *amd_nb;
151+ /* Inverted mask of bits to clear in the perf_ctr ctrl registers */
152+ u64 perf_ctr_virt_mask;
151153
152154 void *kfree_on_online;
153155 };
@@ -425,9 +427,11 @@ void x86_pmu_disable_all(void); · 271 unmodified lines
425427 static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,
426428 u64 enable_mask)
427429 {
430+ u64 disable_mask = __this_cpu_read(cpu_hw_events.perf_ctr_virt_mask);
431+
428432 if (hwc->extra_reg.reg)
429433 wrmsrl(hwc->extra_reg.reg, hwc->extra_reg.config);
430− wrmsrl(hwc->config_base, hwc->config | enable_mask);
434+ wrmsrl(hwc->config_base, (hwc->config | enable_mask) & ~disable_mask);
431435 }
432436
433437 void x86_pmu_enable_all(int added);
arch/x86/kernel/cpu/perf_event_amd.c+35−2
@@ -1,4 +1,5 @@
11 #include <linux/perf_event.h>
2+#include <linux/export.h>
23 #include <linux/types.h>
34 #include <linux/init.h>
45 #include <linux/slab.h>
@@ -357,7 +358,9 @@ static void amd_pmu_cpu_starting(int cpu) · 352 unmodified lines
357358 struct amd_nb *nb;
358359 int i, nb_id;
359360
360− if (boot_cpu_data.x86_max_cores < 2)
361+ cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;
362+
363+ if (boot_cpu_data.x86_max_cores < 2 || boot_cpu_data.x86 == 0x15)
361364 return;
362365
363366 nb_id = amd_get_nb_id(cpu);
@@ -587,9 +590,9 @@ static __initconst const struct x86_pmu amd_pmu_f15h = { · 223 unmodified lines
587590 .put_event_constraints = amd_put_event_constraints,
588591
589592 .cpu_prepare = amd_pmu_cpu_prepare,
590− .cpu_starting = amd_pmu_cpu_starting,
591593 .cpu_dead = amd_pmu_cpu_dead,
592594 #endif
595+ .cpu_starting = amd_pmu_cpu_starting,
593596 };
594597
595598 __init int amd_pmu_init(void)
@@ -621,3 +624,33 @@ __init int amd_pmu_init(void) · 25 unmodified lines
621624
622625 return 0;
623626 }
627+
628+void amd_pmu_enable_virt(void)
629+{
630+ struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
631+
632+ cpuc->perf_ctr_virt_mask = 0;
633+
634+ /* Reload all events */
635+ x86_pmu_disable_all();
636+ x86_pmu_enable_all(0);
637+}
638+EXPORT_SYMBOL_GPL(amd_pmu_enable_virt);
639+
640+void amd_pmu_disable_virt(void)
641+{
642+ struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
643+
644+ /*
645+ * We only mask out the Host-only bit so that host-only counting works
646+ * when SVM is disabled. If someone sets up a guest-only counter when
647+ * SVM is disabled the Guest-only bits still gets set and the counter
648+ * will not count anything.
649+ */
650+ cpuc->perf_ctr_virt_mask = AMD_PERFMON_EVENTSEL_HOSTONLY;
651+
652+ /* Reload all events */
653+ x86_pmu_disable_all();
654+ x86_pmu_enable_all(0);
655+}
656+EXPORT_SYMBOL_GPL(amd_pmu_disable_virt);
arch/x86/kernel/entry_64.S+8−1
@@ -1531,11 +1531,18 @@ ENTRY(nmi) · 1530 unmodified lines
15311531 /* Use %rdx as out temp variable throughout */
15321532 pushq_cfi %rdx
15331533
1534+ /*
1535+ * If %cs was not the kernel segment, then the NMI triggered in user
1536+ * space, which means it is definitely not nested.
1537+ */
1538+ cmpl $__KERNEL_CS, 16(%rsp)
1539+ jne first_nmi
1540+
15341541 /*
15351542 * Check the special variable on the stack to see if NMIs are
15361543 * executing.
15371544 */
1538− cmp $1, -8(%rsp)
1545+ cmpl $1, -8(%rsp)
15391546 je nested_nmi
15401547
15411548 /*
arch/x86/kernel/microcode_amd.c+0−1
@@ -360,7 +360,6 @@ out: · 359 unmodified lines
360360 static enum ucode_state
361361 request_microcode_user(int cpu, const void __user *buf, size_t size)
362362 {
363− pr_info("AMD microcode update via /dev/cpu/microcode not supported\n");
364363 return UCODE_ERROR;
365364 }
366365
arch/x86/kernel/process_32.c+5−21
@@ -214,6 +214,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, · 213 unmodified lines
214214
215215 task_user_gs(p) = get_user_gs(regs);
216216
217+ p->fpu_counter = 0;
217218 p->thread.io_bitmap_ptr = NULL;
218219 tsk = current;
219220 err = -ENOMEM;
@@ -299,22 +300,11 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 79 unmodified lines
299300 *next = &next_p->thread;
300301 int cpu = smp_processor_id();
301302 struct tss_struct *tss = &per_cpu(init_tss, cpu);
302− bool preload_fpu;
303+ fpu_switch_t fpu;
303304
304305 /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
305306
306− /*
307− * If the task has used fpu the last 5 timeslices, just do a full
308− * restore of the math state immediately to avoid the trap; the
309− * chances of needing FPU soon are obviously high now
310− */
311− preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
312−
313− __unlazy_fpu(prev_p);
314−
315− /* we're going to use this soon, after a few expensive things */
316− if (preload_fpu)
317− prefetch(next->fpu.state);
307+ fpu = switch_fpu_prepare(prev_p, next_p, cpu);
318308
319309 /*
320310 * Reload esp0.
@@ -354,11 +344,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 33 unmodified lines
354344 task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
355345 __switch_to_xtra(prev_p, next_p, tss);
356346
357− /* If we're going to preload the fpu context, make sure clts
358− is run while we're batching the cpu state updates. */
359− if (preload_fpu)
360− clts();
361−
362347 /*
363348 * Leave lazy mode, flushing any hypercalls made here.
364349 * This must be done before restoring TLS segments so
@@ -368,15 +353,14 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 3 unmodified lines
368353 */
369354 arch_end_context_switch(next_p);
370355
371− if (preload_fpu)
372− __math_state_restore();
373−
374356 /*
375357 * Restore %gs if needed (which is common)
376358 */
377359 if (prev->gs | next->gs)
378360 lazy_load_gs(next->gs);
379361
362+ switch_fpu_finish(next_p, fpu);
363+
380364 percpu_write(current_task, next_p);
381365
382366 return prev_p;
arch/x86/kernel/process_64.c+5−25
@@ -286,6 +286,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, · 285 unmodified lines
286286
287287 set_tsk_thread_flag(p, TIF_FORK);
288288
289+ p->fpu_counter = 0;
289290 p->thread.io_bitmap_ptr = NULL;
290291
291292 savesegment(gs, p->thread.gsindex);
@@ -386,18 +387,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 94 unmodified lines
386387 int cpu = smp_processor_id();
387388 struct tss_struct *tss = &per_cpu(init_tss, cpu);
388389 unsigned fsindex, gsindex;
389− bool preload_fpu;
390+ fpu_switch_t fpu;
390391
391− /*
392− * If the task has used fpu the last 5 timeslices, just do a full
393− * restore of the math state immediately to avoid the trap; the
394− * chances of needing FPU soon are obviously high now
395− */
396− preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
397−
398− /* we're going to use this soon, after a few expensive things */
399− if (preload_fpu)
400− prefetch(next->fpu.state);
392+ fpu = switch_fpu_prepare(prev_p, next_p, cpu);
401393
402394 /*
403395 * Reload esp0, LDT and the page table pointer:
@@ -427,13 +419,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 23 unmodified lines
427419
428420 load_TLS(next, cpu);
429421
430− /* Must be after DS reload */
431− __unlazy_fpu(prev_p);
432−
433− /* Make sure cpu is ready for new context */
434− if (preload_fpu)
435− clts();
436−
437422 /*
438423 * Leave lazy mode, flushing any hypercalls made here.
439424 * This must be done before restoring TLS segments so
@@ -474,6 +459,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 34 unmodified lines
474459 wrmsrl(MSR_KERNEL_GS_BASE, next->gs);
475460 prev->gsindex = gsindex;
476461
462+ switch_fpu_finish(next_p, fpu);
463+
477464 /*
478465 * Switch the PDA and FPU contexts.
479466 */
@@ -492,13 +479,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 12 unmodified lines
492479 task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV))
493480 __switch_to_xtra(prev_p, next_p, tss);
494481
495− /*
496− * Preload the FPU context, now that we've determined that the
497− * task is likely to be using it.
498− */
499− if (preload_fpu)
500− __math_state_restore();
501−
502482 return prev_p;
503483 }
504484
arch/x86/kernel/traps.c+14−29
@@ -570,28 +570,6 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void) · 569 unmodified lines
570570 {
571571 }
572572
573−/*
574− * __math_state_restore assumes that cr0.TS is already clear and the
575− * fpu state is all ready for use. Used during context switch.
576− */
577−void __math_state_restore(void)
578−{
579− struct thread_info *thread = current_thread_info();
580− struct task_struct *tsk = thread->task;
581−
582− /*
583− * Paranoid restore. send a SIGSEGV if we fail to restore the state.
584− */
585− if (unlikely(restore_fpu_checking(tsk))) {
586− stts();
587− force_sig(SIGSEGV, tsk);
588− return;
589− }
590−
591− thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
592− tsk->fpu_counter++;
593−}
594−
595573 /*
596574 * 'math_state_restore()' saves the current math information in the
597575 * old math state array, and gets the new ones from the current task
@@ -599,13 +577,12 @@ void __math_state_restore(void) · 1 unmodified line
599577 * Careful.. There are problems with IBM-designed IRQ13 behaviour.
600578 * Don't touch unless you *really* know how it works.
601579 *
602− * Must be called with kernel preemption disabled (in this case,
603− * local interrupts are disabled at the call-site in entry.S).
580+ * Must be called with kernel preemption disabled (eg with local
581+ * local interrupts as in the case of do_device_not_available).
604582 */
605−asmlinkage void math_state_restore(void)
583+void math_state_restore(void)
606584 {
607− struct thread_info *thread = current_thread_info();
608− struct task_struct *tsk = thread->task;
585+ struct task_struct *tsk = current;
609586
610587 if (!tsk_used_math(tsk)) {
611588 local_irq_enable();
@@ -622,9 +599,17 @@ asmlinkage void math_state_restore(void) · 10 unmodified lines
622599 local_irq_disable();
623600 }
624601
625− clts(); /* Allow maths ops (or we recurse) */
602+ __thread_fpu_begin(tsk);
603+ /*
604+ * Paranoid restore. send a SIGSEGV if we fail to restore the state.
605+ */
606+ if (unlikely(restore_fpu_checking(tsk))) {
607+ __thread_fpu_end(tsk);
608+ force_sig(SIGSEGV, tsk);
609+ return;
610+ }
626611
627− __math_state_restore();
612+ tsk->fpu_counter++;
628613 }
629614 EXPORT_SYMBOL_GPL(math_state_restore);
630615
arch/x86/kernel/xsave.c+4−8
@@ -47,7 +47,7 @@ void __sanitize_i387_state(struct task_struct *tsk) · 46 unmodified lines
4747 if (!fx)
4848 return;
4949
50− BUG_ON(task_thread_info(tsk)->status & TS_USEDFPU);
50+ BUG_ON(__thread_has_fpu(tsk));
5151
5252 xstate_bv = tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv;
5353
@@ -168,7 +168,7 @@ int save_i387_xstate(void __user *buf) · 114 unmodified lines
168168 if (!used_math())
169169 return 0;
170170
171− if (task_thread_info(tsk)->status & TS_USEDFPU) {
171+ if (user_has_fpu()) {
172172 if (use_xsave())
173173 err = xsave_user(buf);
174174 else
@@ -176,8 +176,7 @@ int save_i387_xstate(void __user *buf) · 1 unmodified line
176176
177177 if (err)
178178 return err;
179− task_thread_info(tsk)->status &= ~TS_USEDFPU;
180− stts();
179+ user_fpu_end();
181180 } else {
182181 sanitize_i387_state(tsk);
183182 if (__copy_to_user(buf, &tsk->thread.fpu.state->fxsave,
@@ -292,10 +291,7 @@ int restore_i387_xstate(void __user *buf) · 108 unmodified lines
292291 return err;
293292 }
294293
295− if (!(task_thread_info(current)->status & TS_USEDFPU)) {
296− clts();
297− task_thread_info(current)->status |= TS_USEDFPU;
298− }
294+ user_fpu_begin();
299295 if (use_xsave())
300296 err = restore_user_xstate(buf);
301297 else
arch/x86/kvm/emulate.c+51−0
@@ -1891,6 +1891,51 @@ setup_syscalls_segments(struct x86_emulate_ctxt *ctxt, · 1890 unmodified lines
18911891 ss->p = 1;
18921892 }
18931893
1894+static bool em_syscall_is_enabled(struct x86_emulate_ctxt *ctxt)
1895+{
1896+ struct x86_emulate_ops *ops = ctxt->ops;
1897+ u32 eax, ebx, ecx, edx;
1898+
1899+ /*
1900+ * syscall should always be enabled in longmode - so only become
1901+ * vendor specific (cpuid) if other modes are active...
1902+ */
1903+ if (ctxt->mode == X86EMUL_MODE_PROT64)
1904+ return true;
1905+
1906+ eax = 0x00000000;
1907+ ecx = 0x00000000;
1908+ if (ops->get_cpuid(ctxt, &eax, &ebx, &ecx, &edx)) {
1909+ /*
1910+ * Intel ("GenuineIntel")
1911+ * remark: Intel CPUs only support "syscall" in 64bit
1912+ * longmode. Also an 64bit guest with a
1913+ * 32bit compat-app running will #UD !! While this
1914+ * behaviour can be fixed (by emulating) into AMD
1915+ * response - CPUs of AMD can't behave like Intel.
1916+ */
1917+ if (ebx == X86EMUL_CPUID_VENDOR_GenuineIntel_ebx &&
1918+ ecx == X86EMUL_CPUID_VENDOR_GenuineIntel_ecx &&
1919+ edx == X86EMUL_CPUID_VENDOR_GenuineIntel_edx)
1920+ return false;
1921+
1922+ /* AMD ("AuthenticAMD") */
1923+ if (ebx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx &&
1924+ ecx == X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx &&
1925+ edx == X86EMUL_CPUID_VENDOR_AuthenticAMD_edx)
1926+ return true;
1927+
1928+ /* AMD ("AMDisbetter!") */
1929+ if (ebx == X86EMUL_CPUID_VENDOR_AMDisbetterI_ebx &&
1930+ ecx == X86EMUL_CPUID_VENDOR_AMDisbetterI_ecx &&
1931+ edx == X86EMUL_CPUID_VENDOR_AMDisbetterI_edx)
1932+ return true;
1933+ }
1934+
1935+ /* default: (not Intel, not AMD), apply Intel's stricter rules... */
1936+ return false;
1937+}
1938+
18941939 static int em_syscall(struct x86_emulate_ctxt *ctxt)
18951940 {
18961941 struct x86_emulate_ops *ops = ctxt->ops;
@@ -1904,9 +1949,15 @@ static int em_syscall(struct x86_emulate_ctxt *ctxt) · 7 unmodified lines
19041949 ctxt->mode == X86EMUL_MODE_VM86)
19051950 return emulate_ud(ctxt);
19061951
1952+ if (!(em_syscall_is_enabled(ctxt)))
1953+ return emulate_ud(ctxt);
1954+
19071955 ops->get_msr(ctxt, MSR_EFER, &efer);
19081956 setup_syscalls_segments(ctxt, &cs, &ss);
19091957
1958+ if (!(efer & EFER_SCE))
1959+ return emulate_ud(ctxt);
1960+
19101961 ops->get_msr(ctxt, MSR_STAR, &msr_data);
19111962 msr_data >>= 32;
19121963 cs_sel = (u16)(msr_data & 0xfffc);
arch/x86/kvm/svm.c+5−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/ftrace_event.h>
3030 #include <linux/slab.h>
3131
32+#include <asm/perf_event.h>
3233 #include <asm/tlbflush.h>
3334 #include <asm/desc.h>
3435 #include <asm/kvm_para.h>
@@ -575,6 +576,8 @@ static void svm_hardware_disable(void *garbage) · 540 unmodified lines
575576 wrmsrl(MSR_AMD64_TSC_RATIO, TSC_RATIO_DEFAULT);
576577
577578 cpu_svm_disable();
579+
580+ amd_pmu_disable_virt();
578581 }
579582
580583 static int svm_hardware_enable(void *garbage)
@@ -622,6 +625,8 @@ static int svm_hardware_enable(void *garbage) · 41 unmodified lines
622625
623626 svm_init_erratum_383();
624627
628+ amd_pmu_enable_virt();
629+
625630 return 0;
626631 }
627632
arch/x86/kvm/vmx.c+1−1
@@ -1457,7 +1457,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) · 1456 unmodified lines
14571457 #ifdef CONFIG_X86_64
14581458 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
14591459 #endif
1460− if (current_thread_info()->status & TS_USEDFPU)
1460+ if (__thread_has_fpu(current))
14611461 clts();
14621462 load_gdt(&__get_cpu_var(host_gdt));
14631463 }
arch/x86/kvm/x86.c+45−0
@@ -1495,6 +1495,8 @@ static void record_steal_time(struct kvm_vcpu *vcpu) · 1494 unmodified lines
14951495
14961496 int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
14971497 {
1498+ bool pr = false;
1499+
14981500 switch (msr) {
14991501 case MSR_EFER:
15001502 return set_efer(vcpu, data);
@@ -1635,6 +1637,18 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) · 134 unmodified lines
16351637 pr_unimpl(vcpu, "unimplemented perfctr wrmsr: "
16361638 "0x%x data 0x%llx\n", msr, data);
16371639 break;
1640+ case MSR_P6_PERFCTR0:
1641+ case MSR_P6_PERFCTR1:
1642+ pr = true;
1643+ case MSR_P6_EVNTSEL0:
1644+ case MSR_P6_EVNTSEL1:
1645+ if (kvm_pmu_msr(vcpu, msr))
1646+ return kvm_pmu_set_msr(vcpu, msr, data);
1647+
1648+ if (pr || data != 0)
1649+ pr_unimpl(vcpu, "disabled perfctr wrmsr: "
1650+ "0x%x data 0x%llx\n", msr, data);
1651+ break;
16381652 case MSR_K7_CLK_CTL:
16391653 /*
16401654 * Ignore all writes to this no longer documented MSR.
@@ -1835,6 +1849,14 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) · 194 unmodified lines
18351849 case MSR_FAM10H_MMIO_CONF_BASE:
18361850 data = 0;
18371851 break;
1852+ case MSR_P6_PERFCTR0:
1853+ case MSR_P6_PERFCTR1:
1854+ case MSR_P6_EVNTSEL0:
1855+ case MSR_P6_EVNTSEL1:
1856+ if (kvm_pmu_msr(vcpu, msr))
1857+ return kvm_pmu_get_msr(vcpu, msr, pdata);
1858+ data = 0;
1859+ break;
18381860 case MSR_IA32_UCODE_REV:
18391861 data = 0x100000000ULL;
18401862 break;
@@ -4180,6 +4202,28 @@ static int emulator_intercept(struct x86_emulate_ctxt *ctxt, · 2339 unmodified lines
41804202 return kvm_x86_ops->check_intercept(emul_to_vcpu(ctxt), info, stage);
41814203 }
41824204
4205+static bool emulator_get_cpuid(struct x86_emulate_ctxt *ctxt,
4206+ u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
4207+{
4208+ struct kvm_cpuid_entry2 *cpuid = NULL;
4209+
4210+ if (eax && ecx)
4211+ cpuid = kvm_find_cpuid_entry(emul_to_vcpu(ctxt),
4212+ *eax, *ecx);
4213+
4214+ if (cpuid) {
4215+ *eax = cpuid->eax;
4216+ *ecx = cpuid->ecx;
4217+ if (ebx)
4218+ *ebx = cpuid->ebx;
4219+ if (edx)
4220+ *edx = cpuid->edx;
4221+ return true;
4222+ }
4223+
4224+ return false;
4225+}
4226+
41834227 static struct x86_emulate_ops emulate_ops = {
41844228 .read_std = kvm_read_guest_virt_system,
41854229 .write_std = kvm_write_guest_virt_system,
@@ -4211,6 +4255,7 @@ static struct x86_emulate_ops emulate_ops = { · 25 unmodified lines
42114255 .get_fpu = emulator_get_fpu,
42124256 .put_fpu = emulator_put_fpu,
42134257 .intercept = emulator_intercept,
4258+ .get_cpuid = emulator_get_cpuid,
42144259 };
42154260
42164261 static void cache_all_regs(struct kvm_vcpu *vcpu)
arch/x86/pci/xen.c+1−1
@@ -374,7 +374,7 @@ int __init pci_xen_init(void) · 373 unmodified lines
374374
375375 int __init pci_xen_hvm_init(void)
376376 {
377− if (!xen_feature(XENFEAT_hvm_pirqs))
377+ if (!xen_have_vector_callback || !xen_feature(XENFEAT_hvm_pirqs))
378378 return 0;
379379
380380 #ifdef CONFIG_ACPI
arch/x86/xen/enlighten.c+2−4
@@ -1141,7 +1141,9 @@ asmlinkage void __init xen_start_kernel(void) · 1140 unmodified lines
11411141
11421142 /* Prevent unwanted bits from being set in PTEs. */
11431143 __supported_pte_mask &= ~_PAGE_GLOBAL;
1144+#if 0
11441145 if (!xen_initial_domain())
1146+#endif
11451147 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
11461148
11471149 __supported_pte_mask |= _PAGE_IOMAP;
@@ -1204,10 +1206,6 @@ asmlinkage void __init xen_start_kernel(void) · 56 unmodified lines
12041206
12051207 pgd = (pgd_t *)xen_start_info->pt_base;
12061208
1207− if (!xen_initial_domain())
1208− __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
1209−
1210− __supported_pte_mask |= _PAGE_IOMAP;
12111209 /* Don't do the full vcpu_info placement stuff until we have a
12121210 possible map and a non-dummy shared_info. */
12131211 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
arch/x86/xen/mmu.c+4−4
@@ -415,13 +415,13 @@ static pteval_t iomap_pte(pteval_t val) · 414 unmodified lines
415415 static pteval_t xen_pte_val(pte_t pte)
416416 {
417417 pteval_t pteval = pte.pte;
418−
418+#if 0
419419 /* If this is a WC pte, convert back from Xen WC to Linux WC */
420420 if ((pteval & (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)) == _PAGE_PAT) {
421421 WARN_ON(!pat_enabled);
422422 pteval = (pteval & ~_PAGE_PAT) | _PAGE_PWT;
423423 }
424−
424+#endif
425425 if (xen_initial_domain() && (pteval & _PAGE_IOMAP))
426426 return pteval;
427427
@@ -463,7 +463,7 @@ void xen_set_pat(u64 pat) · 35 unmodified lines
463463 static pte_t xen_make_pte(pteval_t pte)
464464 {
465465 phys_addr_t addr = (pte & PTE_PFN_MASK);
466−
466+#if 0
467467 /* If Linux is trying to set a WC pte, then map to the Xen WC.
468468 * If _PAGE_PAT is set, then it probably means it is really
469469 * _PAGE_PSE, so avoid fiddling with the PAT mapping and hope
@@ -476,7 +476,7 @@ static pte_t xen_make_pte(pteval_t pte) · 6 unmodified lines
476476 if ((pte & (_PAGE_PCD | _PAGE_PWT)) == _PAGE_PWT)
477477 pte = (pte & ~(_PAGE_PCD | _PAGE_PWT)) | _PAGE_PAT;
478478 }
479−
479+#endif
480480 /*
481481 * Unprivileged domains are allowed to do IOMAPpings for
482482 * PCI passthrough, but not map ISA space. The ISA
arch/x86/xen/smp.c+7−0
@@ -409,6 +409,13 @@ static void __cpuinit xen_play_dead(void) /* used only with HOTPLUG_CPU */ · 408 unmodified lines
409409 play_dead_common();
410410 HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
411411 cpu_bringup();
412+ /*
413+ * Balance out the preempt calls - as we are running in cpu_idle
414+ * loop which has been called at bootup from cpu_bringup_and_idle.
415+ * The cpucpu_bringup_and_idle called cpu_bringup which made a
416+ * preempt_disable() So this preempt_enable will balance it out.
417+ */
418+ preempt_enable();
412419 }
413420
414421 #else /* !CONFIG_HOTPLUG_CPU */
arch/xtensa/include/asm/string.h+0−3
@@ -118,7 +118,4 @@ extern void *memmove(void *__dest, __const__ void *__src, size_t __n); · 117 unmodified lines
118118 /* Don't build bcopy at all ... */
119119 #define __HAVE_ARCH_BCOPY
120120
121−#define __HAVE_ARCH_MEMSCAN
122−#define memscan memchr
123−
124121 #endif /* _XTENSA_STRING_H */
block/blk-cgroup.c+1−1
@@ -1659,7 +1659,7 @@ static void blkiocg_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, · 1658 unmodified lines
16591659 ioc = get_task_io_context(task, GFP_ATOMIC, NUMA_NO_NODE);
16601660 if (ioc) {
16611661 ioc_cgroup_changed(ioc);
1662− put_io_context(ioc, NULL);
1662+ put_io_context(ioc);
16631663 }
16641664 }
16651665 }
block/blk-core.c+17−16
@@ -642,7 +642,7 @@ static inline void blk_free_request(struct request_queue *q, struct request *rq) · 641 unmodified lines
642642 if (rq->cmd_flags & REQ_ELVPRIV) {
643643 elv_put_request(q, rq);
644644 if (rq->elv.icq)
645− put_io_context(rq->elv.icq->ioc, q);
645+ put_io_context(rq->elv.icq->ioc);
646646 }
647647
648648 mempool_free(rq, q->rq.rq_pool);
@@ -872,13 +872,15 @@ retry: · 223 unmodified lines
872872 spin_unlock_irq(q->queue_lock);
873873
874874 /* create icq if missing */
875− if (unlikely(et->icq_cache && !icq))
875+ if ((rw_flags & REQ_ELVPRIV) && unlikely(et->icq_cache && !icq)) {
876876 icq = ioc_create_icq(q, gfp_mask);
877+ if (!icq)
878+ goto fail_icq;
879+ }
877880
878− /* rqs are guaranteed to have icq on elv_set_request() if requested */
879− if (likely(!et->icq_cache || icq))
880− rq = blk_alloc_request(q, icq, rw_flags, gfp_mask);
881+ rq = blk_alloc_request(q, icq, rw_flags, gfp_mask);
881882
883+fail_icq:
882884 if (unlikely(!rq)) {
883885 /*
884886 * Allocation failed presumably due to memory. Undo anything
@@ -1210,7 +1212,6 @@ static bool bio_attempt_back_merge(struct request_queue *q, struct request *req, · 325 unmodified lines
12101212 req->ioprio = ioprio_best(req->ioprio, bio_prio(bio));
12111213
12121214 drive_stat_acct(req, 0);
1213− elv_bio_merged(q, req, bio);
12141215 return true;
12151216 }
12161217
@@ -1241,7 +1242,6 @@ static bool bio_attempt_front_merge(struct request_queue *q, · 24 unmodified lines
12411242 req->ioprio = ioprio_best(req->ioprio, bio_prio(bio));
12421243
12431244 drive_stat_acct(req, 0);
1244− elv_bio_merged(q, req, bio);
12451245 return true;
12461246 }
12471247
@@ -1255,13 +1255,12 @@ static bool bio_attempt_front_merge(struct request_queue *q, · 7 unmodified lines
12551255 * on %current's plugged list. Returns %true if merge was successful,
12561256 * otherwise %false.
12571257 *
1258− * This function is called without @q->queue_lock; however, elevator is
1259− * accessed iff there already are requests on the plugged list which in
1260− * turn guarantees validity of the elevator.
1261− *
1262− * Note that, on successful merge, elevator operation
1263− * elevator_bio_merged_fn() will be called without queue lock. Elevator
1264− * must be ready for this.
1258+ * Plugging coalesces IOs from the same issuer for the same purpose without
1259+ * going through @q->queue_lock. As such it's more of an issuing mechanism
1260+ * than scheduling, and the request, while may have elvpriv data, is not
1261+ * added on the elevator at this point. In addition, we don't have
1262+ * reliable access to the elevator outside queue lock. Only check basic
1263+ * merging parameters without querying the elevator.
12651264 */
12661265 static bool attempt_plug_merge(struct request_queue *q, struct bio *bio,
12671266 unsigned int *request_count)
@@ -1280,10 +1279,10 @@ static bool attempt_plug_merge(struct request_queue *q, struct bio *bio, · 12 unmodified lines
12801279
12811280 (*request_count)++;
12821281
1283− if (rq->q != q)
1282+ if (rq->q != q || !blk_rq_merge_ok(rq, bio))
12841283 continue;
12851284
1286− el_ret = elv_try_merge(rq, bio);
1285+ el_ret = blk_try_merge(rq, bio);
12871286 if (el_ret == ELEVATOR_BACK_MERGE) {
12881287 ret = bio_attempt_back_merge(q, rq, bio);
12891288 if (ret)
@@ -1345,12 +1344,14 @@ void blk_queue_bio(struct request_queue *q, struct bio *bio) · 55 unmodified lines
13451344 el_ret = elv_merge(q, &req, bio);
13461345 if (el_ret == ELEVATOR_BACK_MERGE) {
13471346 if (bio_attempt_back_merge(q, req, bio)) {
1347+ elv_bio_merged(q, req, bio);
13481348 if (!attempt_back_merge(q, req))
13491349 elv_merged_request(q, req, el_ret);
13501350 goto out_unlock;
13511351 }
13521352 } else if (el_ret == ELEVATOR_FRONT_MERGE) {
13531353 if (bio_attempt_front_merge(q, req, bio)) {
1354+ elv_bio_merged(q, req, bio);
13541355 if (!attempt_front_merge(q, req))
13551356 elv_merged_request(q, req, el_ret);
13561357 goto out_unlock;
block/blk-ioc.c+25−86
@@ -29,21 +29,6 @@ void get_io_context(struct io_context *ioc) · 28 unmodified lines
2929 }
3030 EXPORT_SYMBOL(get_io_context);
3131
32−/*
33− * Releasing ioc may nest into another put_io_context() leading to nested
34− * fast path release. As the ioc's can't be the same, this is okay but
35− * makes lockdep whine. Keep track of nesting and use it as subclass.
36− */
37−#ifdef CONFIG_LOCKDEP
38−#define ioc_release_depth(q) ((q) ? (q)->ioc_release_depth : 0)
39−#define ioc_release_depth_inc(q) (q)->ioc_release_depth++
40−#define ioc_release_depth_dec(q) (q)->ioc_release_depth--
41−#else
42−#define ioc_release_depth(q) 0
43−#define ioc_release_depth_inc(q) do { } while (0)
44−#define ioc_release_depth_dec(q) do { } while (0)
45−#endif
46−
4732 static void icq_free_icq_rcu(struct rcu_head *head)
4833 {
4934 struct io_cq *icq = container_of(head, struct io_cq, __rcu_head);
@@ -75,11 +60,8 @@ static void ioc_exit_icq(struct io_cq *icq) · 25 unmodified lines
7560 if (rcu_dereference_raw(ioc->icq_hint) == icq)
7661 rcu_assign_pointer(ioc->icq_hint, NULL);
7762
78− if (et->ops.elevator_exit_icq_fn) {
79− ioc_release_depth_inc(q);
63+ if (et->ops.elevator_exit_icq_fn)
8064 et->ops.elevator_exit_icq_fn(icq);
81− ioc_release_depth_dec(q);
82− }
8365
8466 /*
8567 * @icq->q might have gone away by the time RCU callback runs
@@ -98,8 +80,15 @@ static void ioc_release_fn(struct work_struct *work) · 12 unmodified lines
9880 struct io_context *ioc = container_of(work, struct io_context,
9981 release_work);
10082 struct request_queue *last_q = NULL;
83+ unsigned long flags;
10184
102− spin_lock_irq(&ioc->lock);
85+ /*
86+ * Exiting icq may call into put_io_context() through elevator
87+ * which will trigger lockdep warning. The ioc's are guaranteed to
88+ * be different, use a different locking subclass here. Use
89+ * irqsave variant as there's no spin_lock_irq_nested().
90+ */
91+ spin_lock_irqsave_nested(&ioc->lock, flags, 1);
10392
10493 while (!hlist_empty(&ioc->icq_list)) {
10594 struct io_cq *icq = hlist_entry(ioc->icq_list.first,
@@ -121,15 +110,15 @@ static void ioc_release_fn(struct work_struct *work) · 15 unmodified lines
121110 */
122111 if (last_q) {
123112 spin_unlock(last_q->queue_lock);
124− spin_unlock_irq(&ioc->lock);
113+ spin_unlock_irqrestore(&ioc->lock, flags);
125114 blk_put_queue(last_q);
126115 } else {
127− spin_unlock_irq(&ioc->lock);
116+ spin_unlock_irqrestore(&ioc->lock, flags);
128117 }
129118
130119 last_q = this_q;
131− spin_lock_irq(this_q->queue_lock);
132− spin_lock(&ioc->lock);
120+ spin_lock_irqsave(this_q->queue_lock, flags);
121+ spin_lock_nested(&ioc->lock, 1);
133122 continue;
134123 }
135124 ioc_exit_icq(icq);
@@ -137,10 +126,10 @@ static void ioc_release_fn(struct work_struct *work) · 1 unmodified line
137126
138127 if (last_q) {
139128 spin_unlock(last_q->queue_lock);
140− spin_unlock_irq(&ioc->lock);
129+ spin_unlock_irqrestore(&ioc->lock, flags);
141130 blk_put_queue(last_q);
142131 } else {
143− spin_unlock_irq(&ioc->lock);
132+ spin_unlock_irqrestore(&ioc->lock, flags);
144133 }
145134
146135 kmem_cache_free(iocontext_cachep, ioc);
@@ -149,79 +138,29 @@ static void ioc_release_fn(struct work_struct *work) · 2 unmodified lines
149138 /**
150139 * put_io_context - put a reference of io_context
151140 * @ioc: io_context to put
152− * @locked_q: request_queue the caller is holding queue_lock of (hint)
153141 *
154142 * Decrement reference count of @ioc and release it if the count reaches
155− * zero. If the caller is holding queue_lock of a queue, it can indicate
156− * that with @locked_q. This is an optimization hint and the caller is
157− * allowed to pass in %NULL even when it's holding a queue_lock.
143+ * zero.
158144 */
159−void put_io_context(struct io_context *ioc, struct request_queue *locked_q)
145+void put_io_context(struct io_context *ioc)
160146 {
161− struct request_queue *last_q = locked_q;
162147 unsigned long flags;
163148
164149 if (ioc == NULL)
165150 return;
166151
167152 BUG_ON(atomic_long_read(&ioc->refcount) <= 0);
168− if (locked_q)
169− lockdep_assert_held(locked_q->queue_lock);
170−
171− if (!atomic_long_dec_and_test(&ioc->refcount))
172− return;
173153
174154 /*
175− * Destroy @ioc. This is a bit messy because icq's are chained
176− * from both ioc and queue, and ioc->lock nests inside queue_lock.
177− * The inner ioc->lock should be held to walk our icq_list and then
178− * for each icq the outer matching queue_lock should be grabbed.
179− * ie. We need to do reverse-order double lock dancing.
180− *
181− * Another twist is that we are often called with one of the
182− * matching queue_locks held as indicated by @locked_q, which
183− * prevents performing double-lock dance for other queues.
184− *
185− * So, we do it in two stages. The fast path uses the queue_lock
186− * the caller is holding and, if other queues need to be accessed,
187− * uses trylock to avoid introducing locking dependency. This can
188− * handle most cases, especially if @ioc was performing IO on only
189− * single device.
190− *
191− * If trylock doesn't cut it, we defer to @ioc->release_work which
192− * can do all the double-locking dancing.
155+ * Releasing ioc requires reverse order double locking and we may
156+ * already be holding a queue_lock. Do it asynchronously from wq.
193157 */
194− spin_lock_irqsave_nested(&ioc->lock, flags,
195− ioc_release_depth(locked_q));
196−
197− while (!hlist_empty(&ioc->icq_list)) {
198− struct io_cq *icq = hlist_entry(ioc->icq_list.first,
199− struct io_cq, ioc_node);
200− struct request_queue *this_q = icq->q;
201−
202− if (this_q != last_q) {
203− if (last_q && last_q != locked_q)
204− spin_unlock(last_q->queue_lock);
205− last_q = NULL;
206−
207− if (!spin_trylock(this_q->queue_lock))
208− break;
209− last_q = this_q;
210− continue;
211− }
212− ioc_exit_icq(icq);
158+ if (atomic_long_dec_and_test(&ioc->refcount)) {
159+ spin_lock_irqsave(&ioc->lock, flags);
160+ if (!hlist_empty(&ioc->icq_list))
161+ schedule_work(&ioc->release_work);
162+ spin_unlock_irqrestore(&ioc->lock, flags);
213163 }
214−
215− if (last_q && last_q != locked_q)
216− spin_unlock(last_q->queue_lock);
217−
218− spin_unlock_irqrestore(&ioc->lock, flags);
219−
220− /* if no icq is left, we're done; otherwise, kick release_work */
221− if (hlist_empty(&ioc->icq_list))
222− kmem_cache_free(iocontext_cachep, ioc);
223− else
224− schedule_work(&ioc->release_work);
225164 }
226165 EXPORT_SYMBOL(put_io_context);
227166
@@ -236,7 +175,7 @@ void exit_io_context(struct task_struct *task) · 8 unmodified lines
236175 task_unlock(task);
237176
238177 atomic_dec(&ioc->nr_tasks);
239− put_io_context(ioc, NULL);
178+ put_io_context(ioc);
240179 }
241180
242181 /**
block/blk-merge.c+37−0
@@ -471,3 +471,40 @@ int blk_attempt_req_merge(struct request_queue *q, struct request *rq, · 470 unmodified lines
471471 {
472472 return attempt_merge(q, rq, next);
473473 }
474+
475+bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
476+{
477+ if (!rq_mergeable(rq))
478+ return false;
479+
480+ /* don't merge file system requests and discard requests */
481+ if ((bio->bi_rw & REQ_DISCARD) != (rq->bio->bi_rw & REQ_DISCARD))
482+ return false;
483+
484+ /* don't merge discard requests and secure discard requests */
485+ if ((bio->bi_rw & REQ_SECURE) != (rq->bio->bi_rw & REQ_SECURE))
486+ return false;
487+
488+ /* different data direction or already started, don't merge */
489+ if (bio_data_dir(bio) != rq_data_dir(rq))
490+ return false;
491+
492+ /* must be same device and not a special request */
493+ if (rq->rq_disk != bio->bi_bdev->bd_disk || rq->special)
494+ return false;
495+
496+ /* only merge integrity protected bio into ditto rq */
497+ if (bio_integrity(bio) != blk_integrity_rq(rq))
498+ return false;
499+
500+ return true;
501+}
502+
503+int blk_try_merge(struct request *rq, struct bio *bio)
504+{
505+ if (blk_rq_pos(rq) + blk_rq_sectors(rq) == bio->bi_sector)
506+ return ELEVATOR_BACK_MERGE;
507+ else if (blk_rq_pos(rq) - bio_sectors(bio) == bio->bi_sector)
508+ return ELEVATOR_FRONT_MERGE;
509+ return ELEVATOR_NO_MERGE;
510+}
block/blk.h+2−0
@@ -137,6 +137,8 @@ int blk_attempt_req_merge(struct request_queue *q, struct request *rq, · 136 unmodified lines
137137 struct request *next);
138138 void blk_recalc_rq_segments(struct request *rq);
139139 void blk_rq_set_mixed_merge(struct request *rq);
140+bool blk_rq_merge_ok(struct request *rq, struct bio *bio);
141+int blk_try_merge(struct request *rq, struct bio *bio);
140142
141143 void blk_queue_congestion_threshold(struct request_queue *q);
142144
block/bsg.c+2−1
@@ -983,7 +983,8 @@ void bsg_unregister_queue(struct request_queue *q) · 982 unmodified lines
983983
984984 mutex_lock(&bsg_mutex);
985985 idr_remove(&bsg_minor_idr, bcd->minor);
986− sysfs_remove_link(&q->kobj, "bsg");
986+ if (q->kobj.sd)
987+ sysfs_remove_link(&q->kobj, "bsg");
987988 device_unregister(bcd->class_dev);
988989 bcd->class_dev = NULL;
989990 kref_put(&bcd->ref, bsg_kref_release_function);
block/cfq-iosched.c+9−15
@@ -1699,18 +1699,11 @@ static int cfq_allow_merge(struct request_queue *q, struct request *rq, · 1698 unmodified lines
16991699
17001700 /*
17011701 * Lookup the cfqq that this bio will be queued with and allow
1702− * merge only if rq is queued there. This function can be called
1703− * from plug merge without queue_lock. In such cases, ioc of @rq
1704− * and %current are guaranteed to be equal. Avoid lookup which
1705− * requires queue_lock by using @rq's cic.
1702+ * merge only if rq is queued there.
17061703 */
1707− if (current->io_context == RQ_CIC(rq)->icq.ioc) {
1708− cic = RQ_CIC(rq);
1709− } else {
1710− cic = cfq_cic_lookup(cfqd, current->io_context);
1711− if (!cic)
1712− return false;
1713− }
1704+ cic = cfq_cic_lookup(cfqd, current->io_context);
1705+ if (!cic)
1706+ return false;
17141707
17151708 cfqq = cic_to_cfqq(cic, cfq_bio_sync(bio));
17161709 return cfqq == RQ_CFQQ(rq);
@@ -1794,7 +1787,7 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq, · 77 unmodified lines
17941787 cfqd->active_queue = NULL;
17951788
17961789 if (cfqd->active_cic) {
1797− put_io_context(cfqd->active_cic->icq.ioc, cfqd->queue);
1790+ put_io_context(cfqd->active_cic->icq.ioc);
17981791 cfqd->active_cic = NULL;
17991792 }
18001793 }
@@ -3117,17 +3110,18 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq, · 1316 unmodified lines
31173110 */
31183111 static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
31193112 {
3113+ enum wl_type_t old_type = cfqq_type(cfqd->active_queue);
3114+
31203115 cfq_log_cfqq(cfqd, cfqq, "preempt");
3116+ cfq_slice_expired(cfqd, 1);
31213117
31223118 /*
31233119 * workload type is changed, don't save slice, otherwise preempt
31243120 * doesn't happen
31253121 */
3126− if (cfqq_type(cfqd->active_queue) != cfqq_type(cfqq))
3122+ if (old_type != cfqq_type(cfqq))
31273123 cfqq->cfqg->saved_workload_slice = 0;
31283124
3129− cfq_slice_expired(cfqd, 1);
3130−
31313125 /*
31323126 * Put the new queue at the front of the of the current list,
31333127 * so we know that it will be selected next.
block/elevator.c+4−51
@@ -70,39 +70,9 @@ static int elv_iosched_allow_merge(struct request *rq, struct bio *bio) · 69 unmodified lines
7070 /*
7171 * can we safely merge with this request?
7272 */
73−int elv_rq_merge_ok(struct request *rq, struct bio *bio)
73+bool elv_rq_merge_ok(struct request *rq, struct bio *bio)
7474 {
75− if (!rq_mergeable(rq))
76− return 0;
77−
78− /*
79− * Don't merge file system requests and discard requests
80− */
81− if ((bio->bi_rw & REQ_DISCARD) != (rq->bio->bi_rw & REQ_DISCARD))
82− return 0;
83−
84− /*
85− * Don't merge discard requests and secure discard requests
86− */
87− if ((bio->bi_rw & REQ_SECURE) != (rq->bio->bi_rw & REQ_SECURE))
88− return 0;
89−
90− /*
91− * different data direction or already started, don't merge
92− */
93− if (bio_data_dir(bio) != rq_data_dir(rq))
94− return 0;
95−
96− /*
97− * must be same device and not a special request
98− */
99− if (rq->rq_disk != bio->bi_bdev->bd_disk || rq->special)
100− return 0;
101−
102− /*
103− * only merge integrity protected bio into ditto rq
104− */
105− if (bio_integrity(bio) != blk_integrity_rq(rq))
75+ if (!blk_rq_merge_ok(rq, bio))
10676 return 0;
10777
10878 if (!elv_iosched_allow_merge(rq, bio))
@@ -112,23 +82,6 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio) · 3 unmodified lines
11282 }
11383 EXPORT_SYMBOL(elv_rq_merge_ok);
11484
115−int elv_try_merge(struct request *__rq, struct bio *bio)
116−{
117− int ret = ELEVATOR_NO_MERGE;
118−
119− /*
120− * we can merge and sequence is ok, check if it's possible
121− */
122− if (elv_rq_merge_ok(__rq, bio)) {
123− if (blk_rq_pos(__rq) + blk_rq_sectors(__rq) == bio->bi_sector)
124− ret = ELEVATOR_BACK_MERGE;
125− else if (blk_rq_pos(__rq) - bio_sectors(bio) == bio->bi_sector)
126− ret = ELEVATOR_FRONT_MERGE;
127− }
128−
129− return ret;
130−}
131−
13285 static struct elevator_type *elevator_find(const char *name)
13386 {
13487 struct elevator_type *e;
@@ -478,8 +431,8 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio) · 343 unmodified lines
478431 /*
479432 * First try one-hit cache.
480433 */
481− if (q->last_merge) {
482− ret = elv_try_merge(q->last_merge, bio);
434+ if (q->last_merge && elv_rq_merge_ok(q->last_merge, bio)) {
435+ ret = blk_try_merge(q->last_merge, bio);
483436 if (ret != ELEVATOR_NO_MERGE) {
484437 *req = q->last_merge;
485438 return ret;
block/partitions/ldm.c+4−7
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * ldm - Support for Windows Logical Disk Manager (Dynamic Disks)
33 *
44 * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org>
5− * Copyright (c) 2001-2007 Anton Altaparmakov
5+ * Copyright (c) 2001-2012 Anton Altaparmakov
66 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com>
77 *
88 * Documentation is available at http://www.linux-ntfs.org/doku.php?id=downloads
@@ -1341,20 +1341,17 @@ found: · 1332 unmodified lines
13411341 ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num);
13421342 return false;
13431343 }
1344−
13451344 if (f->map & (1 << rec)) {
13461345 ldm_error ("Duplicate VBLK, part %d.", rec);
13471346 f->map &= 0x7F; /* Mark the group as broken */
13481347 return false;
13491348 }
1350−
13511349 f->map |= (1 << rec);
1352−
1350+ if (!rec)
1351+ memcpy(f->data, data, VBLK_SIZE_HEAD);
13531352 data += VBLK_SIZE_HEAD;
13541353 size -= VBLK_SIZE_HEAD;
1355−
1356− memcpy (f->data+rec*(size-VBLK_SIZE_HEAD)+VBLK_SIZE_HEAD, data, size);
1357−
1354+ memcpy(f->data + VBLK_SIZE_HEAD + rec * size, data, size);
13581355 return true;
13591356 }
13601357
crypto/sha512_generic.c+37−46
@@ -31,11 +31,6 @@ static inline u64 Maj(u64 x, u64 y, u64 z) · 30 unmodified lines
3131 return (x & y) | (z & (x | y));
3232 }
3333
34−static inline u64 RORu64(u64 x, u64 y)
35−{
36− return (x >> y) | (x << (64 - y));
37−}
38−
3934 static const u64 sha512_K[80] = {
4035 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
4136 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
@@ -66,10 +61,10 @@ static const u64 sha512_K[80] = { · 24 unmodified lines
6661 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL,
6762 };
6863
69−#define e0(x) (RORu64(x,28) ^ RORu64(x,34) ^ RORu64(x,39))
70−#define e1(x) (RORu64(x,14) ^ RORu64(x,18) ^ RORu64(x,41))
71−#define s0(x) (RORu64(x, 1) ^ RORu64(x, 8) ^ (x >> 7))
72−#define s1(x) (RORu64(x,19) ^ RORu64(x,61) ^ (x >> 6))
64+#define e0(x) (ror64(x,28) ^ ror64(x,34) ^ ror64(x,39))
65+#define e1(x) (ror64(x,14) ^ ror64(x,18) ^ ror64(x,41))
66+#define s0(x) (ror64(x, 1) ^ ror64(x, 8) ^ (x >> 7))
67+#define s1(x) (ror64(x,19) ^ ror64(x,61) ^ (x >> 6))
7368
7469 static inline void LOAD_OP(int I, u64 *W, const u8 *input)
7570 {
@@ -78,7 +73,7 @@ static inline void LOAD_OP(int I, u64 *W, const u8 *input) · 2 unmodified lines
7873
7974 static inline void BLEND_OP(int I, u64 *W)
8075 {
81− W[I % 16] += s1(W[(I-2) % 16]) + W[(I-7) % 16] + s0(W[(I-15) % 16]);
76+ W[I & 15] += s1(W[(I-2) & 15]) + W[(I-7) & 15] + s0(W[(I-15) & 15]);
8277 }
8378
8479 static void
@@ -89,46 +84,42 @@ sha512_transform(u64 *state, const u8 *input) · 4 unmodified lines
8984 int i;
9085 u64 W[16];
9186
92− /* load the input */
93− for (i = 0; i < 16; i++)
94− LOAD_OP(i, W, input);
95−
9687 /* load the state into our registers */
9788 a=state[0]; b=state[1]; c=state[2]; d=state[3];
9889 e=state[4]; f=state[5]; g=state[6]; h=state[7];
9990
100−#define SHA512_0_15(i, a, b, c, d, e, f, g, h) \
101− t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[i]; \
102− t2 = e0(a) + Maj(a, b, c); \
103− d += t1; \
104− h = t1 + t2
105−
106−#define SHA512_16_79(i, a, b, c, d, e, f, g, h) \
107− BLEND_OP(i, W); \
108− t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)%16]; \
109− t2 = e0(a) + Maj(a, b, c); \
110− d += t1; \
111− h = t1 + t2
112−
113− for (i = 0; i < 16; i += 8) {
114− SHA512_0_15(i, a, b, c, d, e, f, g, h);
115− SHA512_0_15(i + 1, h, a, b, c, d, e, f, g);
116− SHA512_0_15(i + 2, g, h, a, b, c, d, e, f);
117− SHA512_0_15(i + 3, f, g, h, a, b, c, d, e);
118− SHA512_0_15(i + 4, e, f, g, h, a, b, c, d);
119− SHA512_0_15(i + 5, d, e, f, g, h, a, b, c);
120− SHA512_0_15(i + 6, c, d, e, f, g, h, a, b);
121− SHA512_0_15(i + 7, b, c, d, e, f, g, h, a);
122− }
123− for (i = 16; i < 80; i += 8) {
124− SHA512_16_79(i, a, b, c, d, e, f, g, h);
125− SHA512_16_79(i + 1, h, a, b, c, d, e, f, g);
126− SHA512_16_79(i + 2, g, h, a, b, c, d, e, f);
127− SHA512_16_79(i + 3, f, g, h, a, b, c, d, e);
128− SHA512_16_79(i + 4, e, f, g, h, a, b, c, d);
129− SHA512_16_79(i + 5, d, e, f, g, h, a, b, c);
130− SHA512_16_79(i + 6, c, d, e, f, g, h, a, b);
131− SHA512_16_79(i + 7, b, c, d, e, f, g, h, a);
91+ /* now iterate */
92+ for (i=0; i<80; i+=8) {
93+ if (!(i & 8)) {
94+ int j;
95+
96+ if (i < 16) {
97+ /* load the input */
98+ for (j = 0; j < 16; j++)
99+ LOAD_OP(i + j, W, input);
100+ } else {
101+ for (j = 0; j < 16; j++) {
102+ BLEND_OP(i + j, W);
103+ }
104+ }
105+ }
106+
107+ t1 = h + e1(e) + Ch(e,f,g) + sha512_K[i ] + W[(i & 15)];
108+ t2 = e0(a) + Maj(a,b,c); d+=t1; h=t1+t2;
109+ t1 = g + e1(d) + Ch(d,e,f) + sha512_K[i+1] + W[(i & 15) + 1];
110+ t2 = e0(h) + Maj(h,a,b); c+=t1; g=t1+t2;
111+ t1 = f + e1(c) + Ch(c,d,e) + sha512_K[i+2] + W[(i & 15) + 2];
112+ t2 = e0(g) + Maj(g,h,a); b+=t1; f=t1+t2;
113+ t1 = e + e1(b) + Ch(b,c,d) + sha512_K[i+3] + W[(i & 15) + 3];
114+ t2 = e0(f) + Maj(f,g,h); a+=t1; e=t1+t2;
115+ t1 = d + e1(a) + Ch(a,b,c) + sha512_K[i+4] + W[(i & 15) + 4];
116+ t2 = e0(e) + Maj(e,f,g); h+=t1; d=t1+t2;
117+ t1 = c + e1(h) + Ch(h,a,b) + sha512_K[i+5] + W[(i & 15) + 5];
118+ t2 = e0(d) + Maj(d,e,f); g+=t1; c=t1+t2;
119+ t1 = b + e1(g) + Ch(g,h,a) + sha512_K[i+6] + W[(i & 15) + 6];
120+ t2 = e0(c) + Maj(c,d,e); f+=t1; b=t1+t2;
121+ t1 = a + e1(f) + Ch(f,g,h) + sha512_K[i+7] + W[(i & 15) + 7];
122+ t2 = e0(b) + Maj(b,c,d); e+=t1; a=t1+t2;
132123 }
133124
134125 state[0] += a; state[1] += b; state[2] += c; state[3] += d;
drivers/acpi/processor_driver.c+0−7
@@ -579,13 +579,6 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) · 578 unmodified lines
579579 goto err_free_cpumask;
580580 }
581581
582− /*
583− * Do not start hotplugged CPUs now, but when they
584− * are onlined the first time
585− */
586− if (pr->flags.need_hotplug_init)
587− return 0;
588−
589582 /*
590583 * Do not start hotplugged CPUs now, but when they
591584 * are onlined the first time
drivers/ata/pata_at91.c+21−27
@@ -207,11 +207,11 @@ static void set_smc_timing(struct device *dev, struct ata_device *adev, · 206 unmodified lines
207207 {
208208 int ret = 0;
209209 int use_iordy;
210+ struct sam9_smc_config smc;
210211 unsigned int t6z; /* data tristate time in ns */
211212 unsigned int cycle; /* SMC Cycle width in MCK ticks */
212213 unsigned int setup; /* SMC Setup width in MCK ticks */
213214 unsigned int pulse; /* CFIOR and CFIOW pulse width in MCK ticks */
214− unsigned int cs_setup = 0;/* CS4 or CS5 setup width in MCK ticks */
215215 unsigned int cs_pulse; /* CS4 or CS5 pulse width in MCK ticks*/
216216 unsigned int tdf_cycles; /* SMC TDF MCK ticks */
217217 unsigned long mck_hz; /* MCK frequency in Hz */
@@ -244,26 +244,20 @@ static void set_smc_timing(struct device *dev, struct ata_device *adev, · 26 unmodified lines
244244 }
245245
246246 dev_dbg(dev, "Use IORDY=%u, TDF Cycles=%u\n", use_iordy, tdf_cycles);
247− info->mode |= AT91_SMC_TDF_(tdf_cycles);
248−
249− /* write SMC Setup Register */
250− at91_sys_write(AT91_SMC_SETUP(info->cs),
251− AT91_SMC_NWESETUP_(setup) |
252− AT91_SMC_NRDSETUP_(setup) |
253− AT91_SMC_NCS_WRSETUP_(cs_setup) |
254− AT91_SMC_NCS_RDSETUP_(cs_setup));
255− /* write SMC Pulse Register */
256− at91_sys_write(AT91_SMC_PULSE(info->cs),
257− AT91_SMC_NWEPULSE_(pulse) |
258− AT91_SMC_NRDPULSE_(pulse) |
259− AT91_SMC_NCS_WRPULSE_(cs_pulse) |
260− AT91_SMC_NCS_RDPULSE_(cs_pulse));
261− /* write SMC Cycle Register */
262− at91_sys_write(AT91_SMC_CYCLE(info->cs),
263− AT91_SMC_NWECYCLE_(cycle) |
264− AT91_SMC_NRDCYCLE_(cycle));
265− /* write SMC Mode Register*/
266− at91_sys_write(AT91_SMC_MODE(info->cs), info->mode);
247+
248+ /* SMC Setup Register */
249+ smc.nwe_setup = smc.nrd_setup = setup;
250+ smc.ncs_write_setup = smc.ncs_read_setup = 0;
251+ /* SMC Pulse Register */
252+ smc.nwe_pulse = smc.nrd_pulse = pulse;
253+ smc.ncs_write_pulse = smc.ncs_read_pulse = cs_pulse;
254+ /* SMC Cycle Register */
255+ smc.write_cycle = smc.read_cycle = cycle;
256+ /* SMC Mode Register*/
257+ smc.tdf_cycles = tdf_cycles;
258+ smc.mode = info->mode;
259+
260+ sam9_smc_configure(0, info->cs, &smc);
267261 }
268262
269263 static void pata_at91_set_piomode(struct ata_port *ap, struct ata_device *adev)
@@ -288,20 +282,20 @@ static unsigned int pata_at91_data_xfer_noirq(struct ata_device *dev, · 18 unmodified lines
288282 struct at91_ide_info *info = dev->link->ap->host->private_data;
289283 unsigned int consumed;
290284 unsigned long flags;
291− unsigned int mode;
285+ struct sam9_smc_config smc;
292286
293287 local_irq_save(flags);
294− mode = at91_sys_read(AT91_SMC_MODE(info->cs));
288+ sam9_smc_read_mode(0, info->cs, &smc);
295289
296290 /* set 16bit mode before writing data */
297− at91_sys_write(AT91_SMC_MODE(info->cs),
298− (mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_16);
291+ smc.mode = (smc.mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_16;
292+ sam9_smc_write_mode(0, info->cs, &smc);
299293
300294 consumed = ata_sff_data_xfer(dev, buf, buflen, rw);
301295
302296 /* restore 8bit mode after data is written */
303− at91_sys_write(AT91_SMC_MODE(info->cs),
304− (mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_8);
297+ smc.mode = (smc.mode & ~AT91_SMC_DBW) | AT91_SMC_DBW_8;
298+ sam9_smc_write_mode(0, info->cs, &smc);
305299
306300 local_irq_restore(flags);
307301 return consumed;
drivers/atm/solos-pci.c+2−2
@@ -1206,9 +1206,9 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) · 1205 unmodified lines
12061206
12071207 out_unmap_both:
12081208 pci_set_drvdata(dev, NULL);
1209− pci_iounmap(dev, card->config_regs);
1210− out_unmap_config:
12111209 pci_iounmap(dev, card->buffers);
1210+ out_unmap_config:
1211+ pci_iounmap(dev, card->config_regs);
12121212 out_release_regions:
12131213 pci_release_regions(dev);
12141214 out:
drivers/base/cpu.c+21−0
@@ -208,6 +208,25 @@ static ssize_t print_cpus_offline(struct device *dev, · 207 unmodified lines
208208 }
209209 static DEVICE_ATTR(offline, 0444, print_cpus_offline, NULL);
210210
211+static void cpu_device_release(struct device *dev)
212+{
213+ /*
214+ * This is an empty function to prevent the driver core from spitting a
215+ * warning at us. Yes, I know this is directly opposite of what the
216+ * documentation for the driver core and kobjects say, and the author
217+ * of this code has already been publically ridiculed for doing
218+ * something as foolish as this. However, at this point in time, it is
219+ * the only way to handle the issue of statically allocated cpu
220+ * devices. The different architectures will have their cpu device
221+ * code reworked to properly handle this in the near future, so this
222+ * function will then be changed to correctly free up the memory held
223+ * by the cpu device.
224+ *
225+ * Never copy this way of doing things, or you too will be made fun of
226+ * on the linux-kerenl list, you have been warned.
227+ */
228+}
229+
211230 /*
212231 * register_cpu - Setup a sysfs device for a CPU.
213232 * @cpu - cpu->hotpluggable field set to 1 will generate a control file in
@@ -221,8 +240,10 @@ int __cpuinit register_cpu(struct cpu *cpu, int num) · 7 unmodified lines
221240 int error;
222241
223242 cpu->node_id = cpu_to_node(num);
243+ memset(&cpu->dev, 0x00, sizeof(struct device));
224244 cpu->dev.id = num;
225245 cpu->dev.bus = &cpu_subsys;
246+ cpu->dev.release = cpu_device_release;
226247 error = device_register(&cpu->dev);
227248 if (!error && cpu->hotpluggable)
228249 register_cpu_control(cpu);
drivers/base/memory.c+26−5
@@ -572,19 +572,36 @@ static int init_memory_block(struct memory_block **memory, · 571 unmodified lines
572572 }
573573
574574 static int add_memory_section(int nid, struct mem_section *section,
575+ struct memory_block **mem_p,
575576 unsigned long state, enum mem_add_context context)
576577 {
577− struct memory_block *mem;
578+ struct memory_block *mem = NULL;
579+ int scn_nr = __section_nr(section);
578580 int ret = 0;
579581
580582 mutex_lock(&mem_sysfs_mutex);
581583
582− mem = find_memory_block(section);
584+ if (context == BOOT) {
585+ /* same memory block ? */
586+ if (mem_p && *mem_p)
587+ if (scn_nr >= (*mem_p)->start_section_nr &&
588+ scn_nr <= (*mem_p)->end_section_nr) {
589+ mem = *mem_p;
590+ kobject_get(&mem->dev.kobj);
591+ }
592+ } else
593+ mem = find_memory_block(section);
594+
583595 if (mem) {
584596 mem->section_count++;
585597 kobject_put(&mem->dev.kobj);
586− } else
598+ } else {
587599 ret = init_memory_block(&mem, section, state);
600+ /* store memory_block pointer for next loop */
601+ if (!ret && context == BOOT)
602+ if (mem_p)
603+ *mem_p = mem;
604+ }
588605
589606 if (!ret) {
590607 if (context == HOTPLUG &&
@@ -627,7 +644,7 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section, · 36 unmodified lines
627644 */
628645 int register_new_memory(int nid, struct mem_section *section)
629646 {
630− return add_memory_section(nid, section, MEM_OFFLINE, HOTPLUG);
647+ return add_memory_section(nid, section, NULL, MEM_OFFLINE, HOTPLUG);
631648 }
632649
633650 int unregister_memory_section(struct mem_section *section)
@@ -647,6 +664,7 @@ int __init memory_dev_init(void) · 13 unmodified lines
647664 int ret;
648665 int err;
649666 unsigned long block_sz;
667+ struct memory_block *mem = NULL;
650668
651669 ret = subsys_system_register(&memory_subsys, NULL);
652670 if (ret)
@@ -662,7 +680,10 @@ int __init memory_dev_init(void) · 9 unmodified lines
662680 for (i = 0; i < NR_MEM_SECTIONS; i++) {
663681 if (!present_section_nr(i))
664682 continue;
665− err = add_memory_section(0, __nr_to_section(i), MEM_ONLINE,
683+ /* don't need to reuse memory_block if only one per block */
684+ err = add_memory_section(0, __nr_to_section(i),
685+ (sections_per_block == 1) ? NULL : &mem,
686+ MEM_ONLINE,
666687 BOOT);
667688 if (!ret)
668689 ret = err;
drivers/base/node.c+8−0
@@ -456,7 +456,15 @@ static int link_mem_sections(int nid) · 455 unmodified lines
456456 if (!present_section_nr(section_nr))
457457 continue;
458458 mem_sect = __nr_to_section(section_nr);
459+
460+ /* same memblock ? */
461+ if (mem_blk)
462+ if ((section_nr >= mem_blk->start_section_nr) &&
463+ (section_nr <= mem_blk->end_section_nr))
464+ continue;
465+
459466 mem_blk = find_memory_block_hinted(mem_sect, mem_blk);
467+
460468 ret = register_mem_sect_under_node(mem_blk, nid);
461469 if (!err)
462470 err = ret;
drivers/base/regmap/regcache.c+2−2
@@ -53,7 +53,7 @@ static int regcache_hw_init(struct regmap *map) · 52 unmodified lines
5353 for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++) {
5454 val = regcache_get_val(map->reg_defaults_raw,
5555 i, map->cache_word_size);
56− if (!val)
56+ if (regmap_volatile(map, i))
5757 continue;
5858 count++;
5959 }
@@ -70,7 +70,7 @@ static int regcache_hw_init(struct regmap *map) · 10 unmodified lines
7070 for (i = 0, j = 0; i < map->num_reg_defaults_raw; i++) {
7171 val = regcache_get_val(map->reg_defaults_raw,
7272 i, map->cache_word_size);
73− if (!val)
73+ if (regmap_volatile(map, i))
7474 continue;
7575 map->reg_defaults[j].reg = i;
7676 map->reg_defaults[j].def = val;
drivers/bcma/main.c+1−3
@@ -169,10 +169,8 @@ int bcma_bus_register(struct bcma_bus *bus) · 168 unmodified lines
169169 err = bcma_sprom_get(bus);
170170 if (err == -ENOENT) {
171171 pr_err("No SPROM available\n");
172− } else if (err) {
172+ } else if (err)
173173 pr_err("Failed to get SPROM: %d\n", err);
174− return -ENOENT;
175− }
176174
177175 /* Register found cores */
178176 bcma_register_cores(bus);
drivers/bcma/scan.c+11−8
@@ -399,15 +399,18 @@ int bcma_bus_scan(struct bcma_bus *bus) · 398 unmodified lines
399399 core->bus = bus;
400400
401401 err = bcma_get_next_core(bus, &eromptr, NULL, core_num, core);
402− if (err == -ENODEV) {
403− core_num++;
404− continue;
405− } else if (err == -ENXIO)
406− continue;
407− else if (err == -ESPIPE)
408− break;
409− else if (err < 0)
402+ if (err < 0) {
403+ kfree(core);
404+ if (err == -ENODEV) {
405+ core_num++;
406+ continue;
407+ } else if (err == -ENXIO) {
408+ continue;
409+ } else if (err == -ESPIPE) {
410+ break;
411+ }
410412 return err;
413+ }
411414
412415 core->core_index = core_num++;
413416 bus->nr_cores++;
drivers/block/floppy.c+16−1
@@ -4368,8 +4368,14 @@ out_unreg_blkdev: · 4367 unmodified lines
43684368 out_put_disk:
43694369 while (dr--) {
43704370 del_timer_sync(&motor_off_timer[dr]);
4371− if (disks[dr]->queue)
4371+ if (disks[dr]->queue) {
43724372 blk_cleanup_queue(disks[dr]->queue);
4373+ /*
4374+ * put_disk() is not paired with add_disk() and
4375+ * will put queue reference one extra time. fix it.
4376+ */
4377+ disks[dr]->queue = NULL;
4378+ }
43734379 put_disk(disks[dr]);
43744380 }
43754381 return err;
@@ -4579,6 +4585,15 @@ static void __exit floppy_module_exit(void) · 203 unmodified lines
45794585 platform_device_unregister(&floppy_device[drive]);
45804586 }
45814587 blk_cleanup_queue(disks[drive]->queue);
4588+
4589+ /*
4590+ * These disks have not called add_disk(). Don't put down
4591+ * queue reference in put_disk().
4592+ */
4593+ if (!(allowed_drive_mask & (1 << drive)) ||
4594+ fdc_state[FDC(drive)].version == FDC_NONE)
4595+ disks[drive]->queue = NULL;
4596+
45824597 put_disk(disks[drive]);
45834598 }
45844599
drivers/block/loop.c+13−11
@@ -356,14 +356,14 @@ lo_direct_splice_actor(struct pipe_inode_info *pipe, struct splice_desc *sd) · 355 unmodified lines
356356 return __splice_from_pipe(pipe, sd, lo_splice_actor);
357357 }
358358
359−static int
359+static ssize_t
360360 do_lo_receive(struct loop_device *lo,
361361 struct bio_vec *bvec, int bsize, loff_t pos)
362362 {
363363 struct lo_read_data cookie;
364364 struct splice_desc sd;
365365 struct file *file;
366− long retval;
366+ ssize_t retval;
367367
368368 cookie.lo = lo;
369369 cookie.page = bvec->bv_page;
@@ -379,26 +379,28 @@ do_lo_receive(struct loop_device *lo, · 9 unmodified lines
379379 file = lo->lo_backing_file;
380380 retval = splice_direct_to_actor(file, &sd, lo_direct_splice_actor);
381381
382− if (retval < 0)
383− return retval;
384− if (retval != bvec->bv_len)
385− return -EIO;
386− return 0;
382+ return retval;
387383 }
388384
389385 static int
390386 lo_receive(struct loop_device *lo, struct bio *bio, int bsize, loff_t pos)
391387 {
392388 struct bio_vec *bvec;
393− int i, ret = 0;
389+ ssize_t s;
390+ int i;
394391
395392 bio_for_each_segment(bvec, bio, i) {
396− ret = do_lo_receive(lo, bvec, bsize, pos);
397− if (ret < 0)
393+ s = do_lo_receive(lo, bvec, bsize, pos);
394+ if (s < 0)
395+ return s;
396+
397+ if (s != bvec->bv_len) {
398+ zero_fill_bio(bio);
398399 break;
400+ }
399401 pos += bvec->bv_len;
400402 }
401− return ret;
403+ return 0;
402404 }
403405
404406 static int do_bio_filebacked(struct loop_device *lo, struct bio *bio)
drivers/block/mtip32xx/mtip32xx.c+5−6
@@ -2068,8 +2068,6 @@ static int mtip_hw_ioctl(struct driver_data *dd, unsigned int cmd, · 2067 unmodified lines
20682068 * when the read completes.
20692069 * @data Callback data passed to the callback function
20702070 * when the read completes.
2071− * @barrier If non-zero, this command must be completed before
2072− * issuing any other commands.
20732071 * @dir Direction (read or write)
20742072 *
20752073 * return value
@@ -2077,7 +2075,7 @@ static int mtip_hw_ioctl(struct driver_data *dd, unsigned int cmd, · 1 unmodified line
20772075 */
20782076 static void mtip_hw_submit_io(struct driver_data *dd, sector_t start,
20792077 int nsect, int nents, int tag, void *callback,
2080− void *data, int barrier, int dir)
2078+ void *data, int dir)
20812079 {
20822080 struct host_to_dev_fis *fis;
20832081 struct mtip_port *port = dd->port;
@@ -2108,8 +2106,6 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start, · 24 unmodified lines
21082106 *((unsigned int *) &fis->lba_low) = (start & 0xFFFFFF);
21092107 *((unsigned int *) &fis->lba_low_ex) = ((start >> 24) & 0xFFFFFF);
21102108 fis->device = 1 << 6;
2111− if (barrier)
2112− fis->device |= FUA_BIT;
21132109 fis->features = nsect & 0xFF;
21142110 fis->features_ex = (nsect >> 8) & 0xFF;
21152111 fis->sect_count = ((tag << 3) | (tag >> 5));
@@ -3087,7 +3083,6 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio) · 971 unmodified lines
30873083 tag,
30883084 bio_endio,
30893085 bio,
3090− bio->bi_rw & REQ_FUA,
30913086 bio_data_dir(bio));
30923087 } else
30933088 bio_io_error(bio);
@@ -3187,6 +3182,10 @@ skip_create_disk: · 93 unmodified lines
31873182 blk_queue_max_segments(dd->queue, MTIP_MAX_SG);
31883183 blk_queue_physical_block_size(dd->queue, 4096);
31893184 blk_queue_io_min(dd->queue, 4096);
3185+ /*
3186+ * write back cache is not supported in the device. FUA depends on
3187+ * write back cache support, hence setting flush support to zero.
3188+ */
31903189 blk_queue_flush(dd->queue, 0);
31913190
31923191 /* Set the capacity of the device in 512 byte sectors. */
drivers/block/mtip32xx/mtip32xx.h+0−5
@@ -104,9 +104,6 @@ · 103 unmodified lines
104104 /* BAR number used to access the HBA registers. */
105105 #define MTIP_ABAR 5
106106
107−/* Forced Unit Access Bit */
108−#define FUA_BIT 0x80
109−
110107 #ifdef DEBUG
111108 #define dbg_printk(format, arg...) \
112109 printk(pr_fmt(format), ##arg);
@@ -415,8 +412,6 @@ struct driver_data { · 302 unmodified lines
415412
416413 atomic_t resumeflag; /* Atomic variable to track suspend/resume */
417414
418− atomic_t eh_active; /* Flag for error handling tracking */
419−
420415 struct task_struct *mtip_svc_handler; /* task_struct of svc thd */
421416 };
422417
drivers/block/nvme.c+2−0
@@ -41,6 +41,8 @@ · 40 unmodified lines
4141 #include <linux/types.h>
4242 #include <linux/version.h>
4343
44+#include <asm-generic/io-64-nonatomic-lo-hi.h>
45+
4446 #define NVME_Q_DEPTH 1024
4547 #define SQ_SIZE(depth) (depth * sizeof(struct nvme_command))
4648 #define CQ_SIZE(depth) (depth * sizeof(struct nvme_completion))
drivers/bluetooth/btusb.c+1−3
@@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = { · 101 unmodified lines
102102
103103 /* Broadcom BCM20702A0 */
104104 { USB_DEVICE(0x0a5c, 0x21e3) },
105+ { USB_DEVICE(0x0a5c, 0x21f3) },
105106 { USB_DEVICE(0x413c, 0x8197) },
106107
107108 { } /* Terminating entry */
@@ -726,9 +727,6 @@ static int btusb_send_frame(struct sk_buff *skb) · 618 unmodified lines
726727 usb_fill_bulk_urb(urb, data->udev, pipe,
727728 skb->data, skb->len, btusb_tx_complete, skb);
728729
729− if (skb->priority >= HCI_PRIO_MAX - 1)
730− urb->transfer_flags = URB_ISO_ASAP;
731−
732730 hdev->stat.acl_tx++;
733731 break;
734732
drivers/cdrom/cdrom.c+6−14
@@ -286,8 +286,6 @@ · 285 unmodified lines
286286
287287 /* used to tell the module to turn on full debugging messages */
288288 static bool debug;
289−/* used to keep tray locked at all times */
290−static int keeplocked;
291289 /* default compatibility mode */
292290 static bool autoclose=1;
293291 static bool autoeject;
@@ -1204,7 +1202,7 @@ void cdrom_release(struct cdrom_device_info *cdi, fmode_t mode) · 910 unmodified lines
12041202 cdinfo(CD_CLOSE, "Use count for \"/dev/%s\" now zero\n", cdi->name);
12051203 cdrom_dvd_rw_close_write(cdi);
12061204
1207− if ((cdo->capability & CDC_LOCK) && !keeplocked) {
1205+ if ((cdo->capability & CDC_LOCK) && !cdi->keeplocked) {
12081206 cdinfo(CD_CLOSE, "Unlocking door!\n");
12091207 cdo->lock_door(cdi, 0);
12101208 }
@@ -1371,7 +1369,7 @@ static int cdrom_select_disc(struct cdrom_device_info *cdi, int slot) · 160 unmodified lines
13711369 curslot = info->hdr.curslot;
13721370 kfree(info);
13731371
1374− if (cdi->use_count > 1 || keeplocked) {
1372+ if (cdi->use_count > 1 || cdi->keeplocked) {
13751373 if (slot == CDSL_CURRENT) {
13761374 return curslot;
13771375 } else {
@@ -2119,11 +2117,6 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf, · 741 unmodified lines
21192117 if (!nr)
21202118 return -ENOMEM;
21212119
2122− if (!access_ok(VERIFY_WRITE, ubuf, nframes * CD_FRAMESIZE_RAW)) {
2123− ret = -EFAULT;
2124− goto out;
2125− }
2126−
21272120 cgc.data_direction = CGC_DATA_READ;
21282121 while (nframes > 0) {
21292122 if (nr > nframes)
@@ -2132,7 +2125,7 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf, · 2 unmodified lines
21322125 ret = cdrom_read_block(cdi, &cgc, lba, nr, 1, CD_FRAMESIZE_RAW);
21332126 if (ret)
21342127 break;
2135− if (__copy_to_user(ubuf, cgc.buffer, CD_FRAMESIZE_RAW * nr)) {
2128+ if (copy_to_user(ubuf, cgc.buffer, CD_FRAMESIZE_RAW * nr)) {
21362129 ret = -EFAULT;
21372130 break;
21382131 }
@@ -2140,7 +2133,6 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf, · 1 unmodified line
21402133 nframes -= nr;
21412134 lba += nr;
21422135 }
2143−out:
21442136 kfree(cgc.buffer);
21452137 return ret;
21462138 }
@@ -2295,7 +2287,7 @@ static int cdrom_ioctl_eject(struct cdrom_device_info *cdi) · 148 unmodified lines
22952287
22962288 if (!CDROM_CAN(CDC_OPEN_TRAY))
22972289 return -ENOSYS;
2298− if (cdi->use_count != 1 || keeplocked)
2290+ if (cdi->use_count != 1 || cdi->keeplocked)
22992291 return -EBUSY;
23002292 if (CDROM_CAN(CDC_LOCK)) {
23012293 int ret = cdi->ops->lock_door(cdi, 0);
@@ -2322,7 +2314,7 @@ static int cdrom_ioctl_eject_sw(struct cdrom_device_info *cdi, · 20 unmodified lines
23222314
23232315 if (!CDROM_CAN(CDC_OPEN_TRAY))
23242316 return -ENOSYS;
2325− if (keeplocked)
2317+ if (cdi->keeplocked)
23262318 return -EBUSY;
23272319
23282320 cdi->options &= ~(CDO_AUTO_CLOSE | CDO_AUTO_EJECT);
@@ -2453,7 +2445,7 @@ static int cdrom_ioctl_lock_door(struct cdrom_device_info *cdi, · 124 unmodified lines
24532445 if (!CDROM_CAN(CDC_LOCK))
24542446 return -EDRIVE_CANT_DO_THIS;
24552447
2456− keeplocked = arg ? 1 : 0;
2448+ cdi->keeplocked = arg ? 1 : 0;
24572449
24582450 /*
24592451 * Don't unlock the door on multiple opens by default, but allow
drivers/cpuidle/Kconfig+1−1
@@ -1,7 +1,7 @@
11
22 config CPU_IDLE
33 bool "CPU idle PM support"
4− default ACPI
4+ default y if ACPI || PPC_PSERIES
55 help
66 CPU idle is a generic framework for supporting software-controlled
77 idle processor power management. It includes modular cross-platform
drivers/dma/at_hdmac.c+2−2
@@ -1343,7 +1343,7 @@ static int __init at_dma_probe(struct platform_device *pdev) · 1342 unmodified lines
13431343
13441344 tasklet_init(&atchan->tasklet, atc_tasklet,
13451345 (unsigned long)atchan);
1346− atc_enable_irq(atchan);
1346+ atc_enable_chan_irq(atdma, i);
13471347 }
13481348
13491349 /* set base routines */
@@ -1410,7 +1410,7 @@ static int __exit at_dma_remove(struct platform_device *pdev) · 60 unmodified lines
14101410 struct at_dma_chan *atchan = to_at_dma_chan(chan);
14111411
14121412 /* Disable interrupts */
1413− atc_disable_irq(atchan);
1413+ atc_disable_chan_irq(atdma, chan->chan_id);
14141414 tasklet_disable(&atchan->tasklet);
14151415
14161416 tasklet_kill(&atchan->tasklet);
drivers/dma/at_hdmac_regs.h+8−9
@@ -327,28 +327,27 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli) · 326 unmodified lines
327327 }
328328
329329
330−static void atc_setup_irq(struct at_dma_chan *atchan, int on)
330+static void atc_setup_irq(struct at_dma *atdma, int chan_id, int on)
331331 {
332− struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
333− u32 ebci;
332+ u32 ebci;
334333
335334 /* enable interrupts on buffer transfer completion & error */
336− ebci = AT_DMA_BTC(atchan->chan_common.chan_id)
337− | AT_DMA_ERR(atchan->chan_common.chan_id);
335+ ebci = AT_DMA_BTC(chan_id)
336+ | AT_DMA_ERR(chan_id);
338337 if (on)
339338 dma_writel(atdma, EBCIER, ebci);
340339 else
341340 dma_writel(atdma, EBCIDR, ebci);
342341 }
343342
344−static inline void atc_enable_irq(struct at_dma_chan *atchan)
343+static void atc_enable_chan_irq(struct at_dma *atdma, int chan_id)
345344 {
346− atc_setup_irq(atchan, 1);
345+ atc_setup_irq(atdma, chan_id, 1);
347346 }
348347
349−static inline void atc_disable_irq(struct at_dma_chan *atchan)
348+static void atc_disable_chan_irq(struct at_dma *atdma, int chan_id)
350349 {
351− atc_setup_irq(atchan, 0);
350+ atc_setup_irq(atdma, chan_id, 0);
352351 }
353352
354353
drivers/dma/dmatest.c+1−1
@@ -599,7 +599,7 @@ static int dmatest_add_channel(struct dma_chan *chan) · 598 unmodified lines
599599 }
600600 if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
601601 cnt = dmatest_add_threads(dtc, DMA_PQ);
602− thread_count += cnt > 0 ?: 0;
602+ thread_count += cnt > 0 ? cnt : 0;
603603 }
604604
605605 pr_info("dmatest: Started %u threads using %s\n",
drivers/dma/imx-sdma.c+4−2
@@ -1102,11 +1102,13 @@ static int sdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, · 1101 unmodified lines
11021102 case DMA_SLAVE_CONFIG:
11031103 if (dmaengine_cfg->direction == DMA_DEV_TO_MEM) {
11041104 sdmac->per_address = dmaengine_cfg->src_addr;
1105− sdmac->watermark_level = dmaengine_cfg->src_maxburst;
1105+ sdmac->watermark_level = dmaengine_cfg->src_maxburst *
1106+ dmaengine_cfg->src_addr_width;
11061107 sdmac->word_size = dmaengine_cfg->src_addr_width;
11071108 } else {
11081109 sdmac->per_address = dmaengine_cfg->dst_addr;
1109− sdmac->watermark_level = dmaengine_cfg->dst_maxburst;
1110+ sdmac->watermark_level = dmaengine_cfg->dst_maxburst *
1111+ dmaengine_cfg->dst_addr_width;
11101112 sdmac->word_size = dmaengine_cfg->dst_addr_width;
11111113 }
11121114 sdmac->direction = dmaengine_cfg->direction;
drivers/dma/shdma.c+2−1
@@ -1262,7 +1262,8 @@ static int __init sh_dmae_probe(struct platform_device *pdev) · 1261 unmodified lines
12621262
12631263 INIT_LIST_HEAD(&shdev->common.channels);
12641264
1265− dma_cap_set(DMA_MEMCPY, shdev->common.cap_mask);
1265+ if (!pdata->slave_only)
1266+ dma_cap_set(DMA_MEMCPY, shdev->common.cap_mask);
12661267 if (pdata->slave && pdata->slave_num)
12671268 dma_cap_set(DMA_SLAVE, shdev->common.cap_mask);
12681269
drivers/edac/i3200_edac.c+2−13
@@ -15,6 +15,8 @@ · 14 unmodified lines
1515 #include <linux/io.h>
1616 #include "edac_core.h"
1717
18+#include <asm-generic/io-64-nonatomic-lo-hi.h>
19+
1820 #define I3200_REVISION "1.1"
1921
2022 #define EDAC_MOD_STR "i3200_edac"
@@ -101,19 +103,6 @@ struct i3200_priv { · 80 unmodified lines
101103
102104 static int nr_channels;
103105
104−#ifndef readq
105−static inline __u64 readq(const volatile void __iomem *addr)
106−{
107− const volatile u32 __iomem *p = addr;
108− u32 low, high;
109−
110− low = readl(p);
111− high = readl(p + 1);
112−
113− return low + ((u64)high << 32);
114−}
115−#endif
116−
117106 static int how_many_channels(struct pci_dev *pdev)
118107 {
119108 unsigned char capid0_8b; /* 8th byte of CAPID0 */
drivers/gpio/gpio-lpc32xx.c+1−1
@@ -96,7 +96,7 @@ static const char *gpio_p2_names[LPC32XX_GPIO_P2_MAX] = { · 95 unmodified lines
9696 };
9797
9898 static const char *gpio_p3_names[LPC32XX_GPIO_P3_MAX] = {
99− "gpi000", "gpio01", "gpio02", "gpio03",
99+ "gpio00", "gpio01", "gpio02", "gpio03",
100100 "gpio04", "gpio05"
101101 };
102102
drivers/gpio/gpio-ml-ioh.c+1−0
@@ -448,6 +448,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev, · 447 unmodified lines
448448 chip->reg = chip->base;
449449 chip->ch = i;
450450 mutex_init(&chip->lock);
451+ spin_lock_init(&chip->spinlock);
451452 ioh_gpio_setup(chip, num_ports[i]);
452453 ret = gpiochip_add(&chip->gpio);
453454 if (ret) {
drivers/gpio/gpio-pch.c+1−0
@@ -392,6 +392,7 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev, · 391 unmodified lines
392392 chip->reg = chip->base;
393393 pci_set_drvdata(pdev, chip);
394394 mutex_init(&chip->lock);
395+ spin_lock_init(&chip->spinlock);
395396 pch_gpio_setup(chip);
396397 ret = gpiochip_add(&chip->gpio);
397398 if (ret) {
drivers/gpio/gpio-samsung.c+13−10
@@ -2387,27 +2387,30 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = { · 2386 unmodified lines
23872387 };
23882388
23892389 #if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF)
2390−static int exynos4_gpio_xlate(struct gpio_chip *gc, struct device_node *np,
2391− const void *gpio_spec, u32 *flags)
2390+static int exynos4_gpio_xlate(struct gpio_chip *gc,
2391+ const struct of_phandle_args *gpiospec, u32 *flags)
23922392 {
2393− const __be32 *gpio = gpio_spec;
2394− const u32 n = be32_to_cpup(gpio);
2395− unsigned int pin = gc->base + be32_to_cpu(gpio[0]);
2393+ unsigned int pin;
23962394
23972395 if (WARN_ON(gc->of_gpio_n_cells < 4))
23982396 return -EINVAL;
23992397
2400− if (n > gc->ngpio)
2398+ if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
24012399 return -EINVAL;
24022400
2403− if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(be32_to_cpu(gpio[1]))))
2401+ if (gpiospec->args[0] > gc->ngpio)
2402+ return -EINVAL;
2403+
2404+ pin = gc->base + gpiospec->args[0];
2405+
2406+ if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(gpiospec->args[1])))
24042407 pr_warn("gpio_xlate: failed to set pin function\n");
2405− if (s3c_gpio_setpull(pin, be32_to_cpu(gpio[2])))
2408+ if (s3c_gpio_setpull(pin, gpiospec->args[2]))
24062409 pr_warn("gpio_xlate: failed to set pin pull up/down\n");
2407− if (s5p_gpio_set_drvstr(pin, be32_to_cpu(gpio[3])))
2410+ if (s5p_gpio_set_drvstr(pin, gpiospec->args[3]))
24082411 pr_warn("gpio_xlate: failed to set pin drive strength\n");
24092412
2410− return n;
2413+ return gpiospec->args[0];
24112414 }
24122415
24132416 static const struct of_device_id exynos4_gpio_dt_match[] __initdata = {
drivers/gpu/drm/drm_ioc32.c+2−1
@@ -315,7 +315,8 @@ static int compat_drm_getclient(struct file *file, unsigned int cmd, · 314 unmodified lines
315315 if (err)
316316 return err;
317317
318− if (__get_user(c32.auth, &client->auth)
318+ if (__get_user(c32.idx, &client->idx)
319+ || __get_user(c32.auth, &client->auth)
319320 || __get_user(c32.pid, &client->pid)
320321 || __get_user(c32.uid, &client->uid)
321322 || __get_user(c32.magic, &client->magic)
drivers/gpu/drm/exynos/exynos_drm_core.c+3−0
@@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv) · 192 unmodified lines
193193 return err;
194194 }
195195
196+ /* setup possible_clones. */
197+ exynos_drm_encoder_setup(drm_dev);
198+
196199 /*
197200 * if any specific driver such as fimd or hdmi driver called
198201 * exynos_drm_subdrv_register() later than drm_load(),
drivers/gpu/drm/exynos/exynos_drm_crtc.c+3−3
@@ -307,9 +307,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, · 306 unmodified lines
307307 */
308308 event->pipe = exynos_crtc->pipe;
309309
310− list_add_tail(&event->base.link,
311− &dev_priv->pageflip_event_list);
312−
313310 ret = drm_vblank_get(dev, exynos_crtc->pipe);
314311 if (ret) {
315312 DRM_DEBUG("failed to acquire vblank counter\n");
@@ -318,6 +315,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, · 2 unmodified lines
318315 goto out;
319316 }
320317
318+ list_add_tail(&event->base.link,
319+ &dev_priv->pageflip_event_list);
320+
321321 crtc->fb = fb;
322322 ret = exynos_drm_crtc_update(crtc);
323323 if (ret) {
drivers/gpu/drm/exynos/exynos_drm_drv.c+18−8
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333
3434 #include "exynos_drm_drv.h"
3535 #include "exynos_drm_crtc.h"
36+#include "exynos_drm_encoder.h"
3637 #include "exynos_drm_fbdev.h"
3738 #include "exynos_drm_fb.h"
3839 #include "exynos_drm_gem.h"
@@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) · 60 unmodified lines
99100 if (ret)
100101 goto err_vblank;
101102
103+ /* setup possible_clones. */
104+ exynos_drm_encoder_setup(dev);
105+
102106 /*
103107 * create and configure fb helper and also exynos specific
104108 * fbdev object.
@@ -141,16 +145,21 @@ static int exynos_drm_unload(struct drm_device *dev) · 36 unmodified lines
141145 }
142146
143147 static void exynos_drm_preclose(struct drm_device *dev,
144− struct drm_file *file_priv)
148+ struct drm_file *file)
145149 {
146− struct exynos_drm_private *dev_priv = dev->dev_private;
150+ DRM_DEBUG_DRIVER("%s\n", __FILE__);
147151
148− /*
149− * drm framework frees all events at release time,
150− * so private event list should be cleared.
151− */
152− if (!list_empty(&dev_priv->pageflip_event_list))
153− INIT_LIST_HEAD(&dev_priv->pageflip_event_list);
152+}
153+
154+static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
155+{
156+ DRM_DEBUG_DRIVER("%s\n", __FILE__);
157+
158+ if (!file->driver_priv)
159+ return;
160+
161+ kfree(file->driver_priv);
162+ file->driver_priv = NULL;
154163 }
155164
156165 static void exynos_drm_lastclose(struct drm_device *dev)
@@ -195,6 +204,7 @@ static struct drm_driver exynos_drm_driver = { · 38 unmodified lines
195204 .unload = exynos_drm_unload,
196205 .preclose = exynos_drm_preclose,
197206 .lastclose = exynos_drm_lastclose,
207+ .postclose = exynos_drm_postclose,
198208 .get_vblank_counter = drm_vblank_count,
199209 .enable_vblank = exynos_drm_crtc_enable_vblank,
200210 .disable_vblank = exynos_drm_crtc_disable_vblank,
drivers/gpu/drm/exynos/exynos_drm_encoder.c+34−0
@@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = { · 194 unmodified lines
195195 .destroy = exynos_drm_encoder_destroy,
196196 };
197197
198+static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder)
199+{
200+ struct drm_encoder *clone;
201+ struct drm_device *dev = encoder->dev;
202+ struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
203+ struct exynos_drm_display_ops *display_ops =
204+ exynos_encoder->manager->display_ops;
205+ unsigned int clone_mask = 0;
206+ int cnt = 0;
207+
208+ list_for_each_entry(clone, &dev->mode_config.encoder_list, head) {
209+ switch (display_ops->type) {
210+ case EXYNOS_DISPLAY_TYPE_LCD:
211+ case EXYNOS_DISPLAY_TYPE_HDMI:
212+ clone_mask |= (1 << (cnt++));
213+ break;
214+ default:
215+ continue;
216+ }
217+ }
218+
219+ return clone_mask;
220+}
221+
222+void exynos_drm_encoder_setup(struct drm_device *dev)
223+{
224+ struct drm_encoder *encoder;
225+
226+ DRM_DEBUG_KMS("%s\n", __FILE__);
227+
228+ list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
229+ encoder->possible_clones = exynos_drm_encoder_clones(encoder);
230+}
231+
198232 struct drm_encoder *
199233 exynos_drm_encoder_create(struct drm_device *dev,
200234 struct exynos_drm_manager *manager,
drivers/gpu/drm/exynos/exynos_drm_encoder.h+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030
3131 struct exynos_drm_manager;
3232
33+void exynos_drm_encoder_setup(struct drm_device *dev);
3334 struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev,
3435 struct exynos_drm_manager *mgr,
3536 unsigned int possible_crtcs);
drivers/gpu/drm/exynos/exynos_drm_fbdev.c+4−66
@@ -195,66 +195,6 @@ out: · 194 unmodified lines
195195 return ret;
196196 }
197197
198−static bool
199−exynos_drm_fbdev_is_samefb(struct drm_framebuffer *fb,
200− struct drm_fb_helper_surface_size *sizes)
201−{
202− if (fb->width != sizes->surface_width)
203− return false;
204− if (fb->height != sizes->surface_height)
205− return false;
206− if (fb->bits_per_pixel != sizes->surface_bpp)
207− return false;
208− if (fb->depth != sizes->surface_depth)
209− return false;
210−
211− return true;
212−}
213−
214−static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper,
215− struct drm_fb_helper_surface_size *sizes)
216−{
217− struct drm_device *dev = helper->dev;
218− struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper);
219− struct exynos_drm_gem_obj *exynos_gem_obj;
220− struct drm_framebuffer *fb = helper->fb;
221− struct drm_mode_fb_cmd2 mode_cmd = { 0 };
222− unsigned long size;
223−
224− DRM_DEBUG_KMS("%s\n", __FILE__);
225−
226− if (exynos_drm_fbdev_is_samefb(fb, sizes))
227− return 0;
228−
229− mode_cmd.width = sizes->surface_width;
230− mode_cmd.height = sizes->surface_height;
231− mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3);
232− mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
233− sizes->surface_depth);
234−
235− if (exynos_fbdev->exynos_gem_obj)
236− exynos_drm_gem_destroy(exynos_fbdev->exynos_gem_obj);
237−
238− if (fb->funcs->destroy)
239− fb->funcs->destroy(fb);
240−
241− size = mode_cmd.pitches[0] * mode_cmd.height;
242− exynos_gem_obj = exynos_drm_gem_create(dev, size);
243− if (IS_ERR(exynos_gem_obj))
244− return PTR_ERR(exynos_gem_obj);
245−
246− exynos_fbdev->exynos_gem_obj = exynos_gem_obj;
247−
248− helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd,
249− &exynos_gem_obj->base);
250− if (IS_ERR_OR_NULL(helper->fb)) {
251− DRM_ERROR("failed to create drm framebuffer.\n");
252− return PTR_ERR(helper->fb);
253− }
254−
255− return exynos_drm_fbdev_update(helper, helper->fb);
256−}
257−
258198 static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,
259199 struct drm_fb_helper_surface_size *sizes)
260200 {
@@ -262,6 +202,10 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, · 1 unmodified line
262202
263203 DRM_DEBUG_KMS("%s\n", __FILE__);
264204
205+ /*
206+ * with !helper->fb, it means that this funcion is called first time
207+ * and after that, the helper->fb would be used as clone mode.
208+ */
265209 if (!helper->fb) {
266210 ret = exynos_drm_fbdev_create(helper, sizes);
267211 if (ret < 0) {
@@ -274,12 +218,6 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, · 6 unmodified lines
274218 * because register_framebuffer() should be called.
275219 */
276220 ret = 1;
277− } else {
278− ret = exynos_drm_fbdev_recreate(helper, sizes);
279− if (ret < 0) {
280− DRM_ERROR("failed to reconfigure fbdev\n");
281− return ret;
282− }
283221 }
284222
285223 return ret;
drivers/gpu/drm/exynos/exynos_drm_fimd.c+6−1
@@ -604,7 +604,12 @@ static void fimd_finish_pageflip(struct drm_device *drm_dev, int crtc) · 603 unmodified lines
604604 }
605605
606606 if (is_checked) {
607− drm_vblank_put(drm_dev, crtc);
607+ /*
608+ * call drm_vblank_put only in case that drm_vblank_get was
609+ * called.
610+ */
611+ if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
612+ drm_vblank_put(drm_dev, crtc);
608613
609614 /*
610615 * don't off vblank if vblank_disable_allowed is 1,
drivers/gpu/drm/exynos/exynos_mixer.c+12−7
@@ -712,7 +712,12 @@ static void mixer_finish_pageflip(struct drm_device *drm_dev, int crtc) · 711 unmodified lines
712712 }
713713
714714 if (is_checked)
715− drm_vblank_put(drm_dev, crtc);
715+ /*
716+ * call drm_vblank_put only in case that drm_vblank_get was
717+ * called.
718+ */
719+ if (atomic_read(&drm_dev->vblank_refcount[crtc]) > 0)
720+ drm_vblank_put(drm_dev, crtc);
716721
717722 spin_unlock_irqrestore(&drm_dev->event_lock, flags);
718723 }
@@ -779,15 +784,15 @@ static void mixer_win_reset(struct mixer_context *ctx) · 60 unmodified lines
779784 mixer_reg_writemask(res, MXR_STATUS, MXR_STATUS_16_BURST,
780785 MXR_STATUS_BURST_MASK);
781786
782− /* setting default layer priority: layer1 > video > layer0
787+ /* setting default layer priority: layer1 > layer0 > video
783788 * because typical usage scenario would be
789+ * layer1 - OSD
784790 * layer0 - framebuffer
785791 * video - video overlay
786− * layer1 - OSD
787792 */
788− val = MXR_LAYER_CFG_GRP0_VAL(1);
789− val |= MXR_LAYER_CFG_VP_VAL(2);
790− val |= MXR_LAYER_CFG_GRP1_VAL(3);
793+ val = MXR_LAYER_CFG_GRP1_VAL(3);
794+ val |= MXR_LAYER_CFG_GRP0_VAL(2);
795+ val |= MXR_LAYER_CFG_VP_VAL(1);
791796 mixer_reg_write(res, MXR_LAYER_CFG, val);
792797
793798 /* setting background color */
@@ -1044,7 +1049,7 @@ static int mixer_remove(struct platform_device *pdev) · 250 unmodified lines
10441049 platform_get_drvdata(pdev);
10451050 struct mixer_context *ctx = (struct mixer_context *)drm_hdmi_ctx->ctx;
10461051
1047− dev_info(dev, "remove sucessful\n");
1052+ dev_info(dev, "remove successful\n");
10481053
10491054 mixer_resource_poweroff(ctx);
10501055 mixer_resources_cleanup(ctx);
drivers/gpu/drm/i915/i915_reg.h+15−0
@@ -3028,6 +3028,20 @@ · 3027 unmodified lines
30283028 #define DISP_TILE_SURFACE_SWIZZLING (1<<13)
30293029 #define DISP_FBC_WM_DIS (1<<15)
30303030
3031+/* GEN7 chicken */
3032+#define GEN7_COMMON_SLICE_CHICKEN1 0x7010
3033+# define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1<<10) | (1<<26))
3034+
3035+#define GEN7_L3CNTLREG1 0xB01C
3036+#define GEN7_WA_FOR_GEN7_L3_CONTROL 0x3C4FFF8C
3037+
3038+#define GEN7_L3_CHICKEN_MODE_REGISTER 0xB030
3039+#define GEN7_WA_L3_CHICKEN_MODE 0x20000000
3040+
3041+/* WaCatErrorRejectionIssue */
3042+#define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030
3043+#define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11)
3044+
30313045 /* PCH */
30323046
30333047 /* south display engine interrupt */
@@ -3618,6 +3632,7 @@ · 584 unmodified lines
36183632 #define GT_FIFO_NUM_RESERVED_ENTRIES 20
36193633
36203634 #define GEN6_UCGCTL2 0x9404
3635+# define GEN6_RCZUNIT_CLOCK_GATE_DISABLE (1 << 13)
36213636 # define GEN6_RCPBUNIT_CLOCK_GATE_DISABLE (1 << 12)
36223637 # define GEN6_RCCUNIT_CLOCK_GATE_DISABLE (1 << 11)
36233638
drivers/gpu/drm/i915/intel_display.c+27−5
@@ -1872,7 +1872,7 @@ static void intel_update_fbc(struct drm_device *dev) · 1871 unmodified lines
18721872 if (enable_fbc < 0) {
18731873 DRM_DEBUG_KMS("fbc set to per-chip default\n");
18741874 enable_fbc = 1;
1875− if (INTEL_INFO(dev)->gen <= 5)
1875+ if (INTEL_INFO(dev)->gen <= 6)
18761876 enable_fbc = 0;
18771877 }
18781878 if (!enable_fbc) {
@@ -5307,6 +5307,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, · 3428 unmodified lines
53075307 }
53085308 }
53095309
5310+ pipeconf &= ~PIPECONF_INTERLACE_MASK;
53105311 if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) {
53115312 pipeconf |= PIPECONF_INTERLACE_W_FIELD_INDICATION;
53125313 /* the chip adds 2 halflines automatically */
@@ -5317,7 +5318,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, · 4 unmodified lines
53175318 adjusted_mode->crtc_vsync_end -= 1;
53185319 adjusted_mode->crtc_vsync_start -= 1;
53195320 } else
5320− pipeconf &= ~PIPECONF_INTERLACE_MASK; /* progressive */
5321+ pipeconf |= PIPECONF_PROGRESSIVE;
53215322
53225323 I915_WRITE(HTOTAL(pipe),
53235324 (adjusted_mode->crtc_hdisplay - 1) |
@@ -5902,6 +5903,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, · 578 unmodified lines
59025903 }
59035904 }
59045905
5906+ pipeconf &= ~PIPECONF_INTERLACE_MASK;
59055907 if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) {
59065908 pipeconf |= PIPECONF_INTERLACE_W_FIELD_INDICATION;
59075909 /* the chip adds 2 halflines automatically */
@@ -5912,7 +5914,7 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, · 4 unmodified lines
59125914 adjusted_mode->crtc_vsync_end -= 1;
59135915 adjusted_mode->crtc_vsync_start -= 1;
59145916 } else
5915− pipeconf &= ~PIPECONF_INTERLACE_W_FIELD_INDICATION; /* progressive */
5917+ pipeconf |= PIPECONF_PROGRESSIVE;
59165918
59175919 I915_WRITE(HTOTAL(pipe),
59185920 (adjusted_mode->crtc_hdisplay - 1) |
@@ -8182,8 +8184,8 @@ void gen6_enable_rps(struct drm_i915_private *dev_priv) · 2263 unmodified lines
81828184 I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */
81838185
81848186 if (intel_enable_rc6(dev_priv->dev))
8185− rc6_mask = GEN6_RC_CTL_RC6p_ENABLE |
8186− GEN6_RC_CTL_RC6_ENABLE;
8187+ rc6_mask = GEN6_RC_CTL_RC6_ENABLE |
8188+ (IS_GEN7(dev_priv->dev)) ? GEN6_RC_CTL_RC6p_ENABLE : 0;
81878189
81888190 I915_WRITE(GEN6_RC_CONTROL,
81898191 rc6_mask |
@@ -8461,12 +8463,32 @@ static void ivybridge_init_clock_gating(struct drm_device *dev) · 271 unmodified lines
84618463 I915_WRITE(WM2_LP_ILK, 0);
84628464 I915_WRITE(WM1_LP_ILK, 0);
84638465
8466+ /* According to the spec, bit 13 (RCZUNIT) must be set on IVB.
8467+ * This implements the WaDisableRCZUnitClockGating workaround.
8468+ */
8469+ I915_WRITE(GEN6_UCGCTL2, GEN6_RCZUNIT_CLOCK_GATE_DISABLE);
8470+
84648471 I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE);
84658472
84668473 I915_WRITE(IVB_CHICKEN3,
84678474 CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
84688475 CHICKEN3_DGMG_DONE_FIX_DISABLE);
84698476
8477+ /* Apply the WaDisableRHWOOptimizationForRenderHang workaround. */
8478+ I915_WRITE(GEN7_COMMON_SLICE_CHICKEN1,
8479+ GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC);
8480+
8481+ /* WaApplyL3ControlAndL3ChickenMode requires those two on Ivy Bridge */
8482+ I915_WRITE(GEN7_L3CNTLREG1,
8483+ GEN7_WA_FOR_GEN7_L3_CONTROL);
8484+ I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
8485+ GEN7_WA_L3_CHICKEN_MODE);
8486+
8487+ /* This is required by WaCatErrorRejectionIssue */
8488+ I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
8489+ I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
8490+ GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
8491+
84708492 for_each_pipe(pipe) {
84718493 I915_WRITE(DSPCNTR(pipe),
84728494 I915_READ(DSPCNTR(pipe)) |
drivers/gpu/drm/i915/intel_dp.c+5−15
@@ -208,17 +208,8 @@ intel_dp_link_clock(uint8_t link_bw) · 207 unmodified lines
208208 */
209209
210210 static int
211−intel_dp_link_required(struct intel_dp *intel_dp, int pixel_clock, int check_bpp)
211+intel_dp_link_required(int pixel_clock, int bpp)
212212 {
213− struct drm_crtc *crtc = intel_dp->base.base.crtc;
214− struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
215− int bpp = 24;
216−
217− if (check_bpp)
218− bpp = check_bpp;
219− else if (intel_crtc)
220− bpp = intel_crtc->bpp;
221−
222213 return (pixel_clock * bpp + 9) / 10;
223214 }
224215
@@ -245,12 +236,11 @@ intel_dp_mode_valid(struct drm_connector *connector, · 20 unmodified lines
245236 return MODE_PANEL;
246237 }
247238
248− mode_rate = intel_dp_link_required(intel_dp, mode->clock, 0);
239+ mode_rate = intel_dp_link_required(mode->clock, 24);
249240 max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes);
250241
251242 if (mode_rate > max_rate) {
252− mode_rate = intel_dp_link_required(intel_dp,
253− mode->clock, 18);
243+ mode_rate = intel_dp_link_required(mode->clock, 18);
254244 if (mode_rate > max_rate)
255245 return MODE_CLOCK_HIGH;
256246 else
@@ -683,7 +673,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, · 426 unmodified lines
683673 int lane_count, clock;
684674 int max_lane_count = intel_dp_max_lane_count(intel_dp);
685675 int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0;
686− int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 0;
676+ int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24;
687677 static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
688678
689679 if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) {
@@ -701,7 +691,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, · 11 unmodified lines
701691 for (clock = 0; clock <= max_clock; clock++) {
702692 int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count);
703693
704− if (intel_dp_link_required(intel_dp, mode->clock, bpp)
694+ if (intel_dp_link_required(mode->clock, bpp)
705695 <= link_avail) {
706696 intel_dp->link_bw = bws[clock];
707697 intel_dp->lane_count = lane_count;
drivers/gpu/drm/i915/intel_lvds.c+8−0
@@ -692,6 +692,14 @@ static const struct dmi_system_id intel_no_lvds[] = { · 691 unmodified lines
692692 DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
693693 },
694694 },
695+ {
696+ .callback = intel_no_lvds_dmi_callback,
697+ .ident = "AOpen i45GMx-I",
698+ .matches = {
699+ DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
700+ DMI_MATCH(DMI_BOARD_NAME, "i45GMx-I"),
701+ },
702+ },
695703 {
696704 .callback = intel_no_lvds_dmi_callback,
697705 .ident = "Aopen i945GTt-VFA",
drivers/gpu/drm/radeon/evergreen.c+2−0
@@ -3191,6 +3191,7 @@ static int evergreen_startup(struct radeon_device *rdev) · 3190 unmodified lines
31913191 if (r) {
31923192 DRM_ERROR("radeon: failed testing IB (%d).\n", r);
31933193 rdev->accel_working = false;
3194+ return r;
31943195 }
31953196
31963197 r = r600_audio_init(rdev);
@@ -3222,6 +3223,7 @@ int evergreen_resume(struct radeon_device *rdev) · 25 unmodified lines
32223223 r = evergreen_startup(rdev);
32233224 if (r) {
32243225 DRM_ERROR("evergreen startup failed on resume\n");
3226+ rdev->accel_working = false;
32253227 return r;
32263228 }
32273229
drivers/gpu/drm/radeon/ni.c+1−0
@@ -1547,6 +1547,7 @@ int cayman_resume(struct radeon_device *rdev) · 1546 unmodified lines
15471547 r = cayman_startup(rdev);
15481548 if (r) {
15491549 DRM_ERROR("cayman startup failed on resume\n");
1550+ rdev->accel_working = false;
15501551 return r;
15511552 }
15521553 return r;
drivers/gpu/drm/radeon/r100.c+8−4
@@ -789,9 +789,7 @@ int r100_irq_process(struct radeon_device *rdev) · 788 unmodified lines
789789 WREG32(RADEON_AIC_CNTL, msi_rearm | RS400_MSI_REARM);
790790 break;
791791 default:
792− msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN;
793− WREG32(RADEON_MSI_REARM_EN, msi_rearm);
794− WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN);
792+ WREG32(RADEON_MSI_REARM_EN, RV370_MSI_REARM_EN);
795793 break;
796794 }
797795 }
@@ -3930,6 +3928,8 @@ static int r100_startup(struct radeon_device *rdev) · 3132 unmodified lines
39303928
39313929 int r100_resume(struct radeon_device *rdev)
39323930 {
3931+ int r;
3932+
39333933 /* Make sur GART are not working */
39343934 if (rdev->flags & RADEON_IS_PCI)
39353935 r100_pci_gart_disable(rdev);
@@ -3949,7 +3949,11 @@ int r100_resume(struct radeon_device *rdev) · 13 unmodified lines
39493949 radeon_surface_init(rdev);
39503950
39513951 rdev->accel_working = true;
3952− return r100_startup(rdev);
3952+ r = r100_startup(rdev);
3953+ if (r) {
3954+ rdev->accel_working = false;
3955+ }
3956+ return r;
39533957 }
39543958
39553959 int r100_suspend(struct radeon_device *rdev)
drivers/gpu/drm/radeon/r300.c+7−1
@@ -1431,6 +1431,8 @@ static int r300_startup(struct radeon_device *rdev) · 1430 unmodified lines
14311431
14321432 int r300_resume(struct radeon_device *rdev)
14331433 {
1434+ int r;
1435+
14341436 /* Make sur GART are not working */
14351437 if (rdev->flags & RADEON_IS_PCIE)
14361438 rv370_pcie_gart_disable(rdev);
@@ -1452,7 +1454,11 @@ int r300_resume(struct radeon_device *rdev) · 15 unmodified lines
14521454 radeon_surface_init(rdev);
14531455
14541456 rdev->accel_working = true;
1455− return r300_startup(rdev);
1457+ r = r300_startup(rdev);
1458+ if (r) {
1459+ rdev->accel_working = false;
1460+ }
1461+ return r;
14561462 }
14571463
14581464 int r300_suspend(struct radeon_device *rdev)
drivers/gpu/drm/radeon/r420.c+7−1
@@ -291,6 +291,8 @@ static int r420_startup(struct radeon_device *rdev) · 290 unmodified lines
291291
292292 int r420_resume(struct radeon_device *rdev)
293293 {
294+ int r;
295+
294296 /* Make sur GART are not working */
295297 if (rdev->flags & RADEON_IS_PCIE)
296298 rv370_pcie_gart_disable(rdev);
@@ -316,7 +318,11 @@ int r420_resume(struct radeon_device *rdev) · 19 unmodified lines
316318 radeon_surface_init(rdev);
317319
318320 rdev->accel_working = true;
319− return r420_startup(rdev);
321+ r = r420_startup(rdev);
322+ if (r) {
323+ rdev->accel_working = false;
324+ }
325+ return r;
320326 }
321327
322328 int r420_suspend(struct radeon_device *rdev)
drivers/gpu/drm/radeon/r520.c+7−1
@@ -218,6 +218,8 @@ static int r520_startup(struct radeon_device *rdev) · 217 unmodified lines
218218
219219 int r520_resume(struct radeon_device *rdev)
220220 {
221+ int r;
222+
221223 /* Make sur GART are not working */
222224 if (rdev->flags & RADEON_IS_PCIE)
223225 rv370_pcie_gart_disable(rdev);
@@ -237,7 +239,11 @@ int r520_resume(struct radeon_device *rdev) · 13 unmodified lines
237239 radeon_surface_init(rdev);
238240
239241 rdev->accel_working = true;
240− return r520_startup(rdev);
242+ r = r520_startup(rdev);
243+ if (r) {
244+ rdev->accel_working = false;
245+ }
246+ return r;
241247 }
242248
243249 int r520_init(struct radeon_device *rdev)
drivers/gpu/drm/radeon/r600.c+1−0
@@ -2529,6 +2529,7 @@ int r600_resume(struct radeon_device *rdev) · 2528 unmodified lines
25292529 r = r600_startup(rdev);
25302530 if (r) {
25312531 DRM_ERROR("r600 startup failed on resume\n");
2532+ rdev->accel_working = false;
25322533 return r;
25332534 }
25342535
drivers/gpu/drm/radeon/radeon_atombios.c+20−0
@@ -2931,6 +2931,20 @@ radeon_atombios_connected_scratch_regs(struct drm_connector *connector, · 2930 unmodified lines
29312931 bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP5;
29322932 }
29332933 }
2934+ if ((radeon_encoder->devices & ATOM_DEVICE_DFP6_SUPPORT) &&
2935+ (radeon_connector->devices & ATOM_DEVICE_DFP6_SUPPORT)) {
2936+ if (connected) {
2937+ DRM_DEBUG_KMS("DFP6 connected\n");
2938+ bios_0_scratch |= ATOM_S0_DFP6;
2939+ bios_3_scratch |= ATOM_S3_DFP6_ACTIVE;
2940+ bios_6_scratch |= ATOM_S6_ACC_REQ_DFP6;
2941+ } else {
2942+ DRM_DEBUG_KMS("DFP6 disconnected\n");
2943+ bios_0_scratch &= ~ATOM_S0_DFP6;
2944+ bios_3_scratch &= ~ATOM_S3_DFP6_ACTIVE;
2945+ bios_6_scratch &= ~ATOM_S6_ACC_REQ_DFP6;
2946+ }
2947+ }
29342948
29352949 if (rdev->family >= CHIP_R600) {
29362950 WREG32(R600_BIOS_0_SCRATCH, bios_0_scratch);
@@ -2951,6 +2965,9 @@ radeon_atombios_encoder_crtc_scratch_regs(struct drm_encoder *encoder, int crtc) · 14 unmodified lines
29512965 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
29522966 uint32_t bios_3_scratch;
29532967
2968+ if (ASIC_IS_DCE4(rdev))
2969+ return;
2970+
29542971 if (rdev->family >= CHIP_R600)
29552972 bios_3_scratch = RREG32(R600_BIOS_3_SCRATCH);
29562973 else
@@ -3003,6 +3020,9 @@ radeon_atombios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on) · 46 unmodified lines
30033020 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
30043021 uint32_t bios_2_scratch;
30053022
3023+ if (ASIC_IS_DCE4(rdev))
3024+ return;
3025+
30063026 if (rdev->family >= CHIP_R600)
30073027 bios_2_scratch = RREG32(R600_BIOS_2_SCRATCH);
30083028 else
drivers/gpu/drm/radeon/radeon_cs.c+4−0
@@ -453,6 +453,10 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 452 unmodified lines
453453 int r;
454454
455455 radeon_mutex_lock(&rdev->cs_mutex);
456+ if (!rdev->accel_working) {
457+ radeon_mutex_unlock(&rdev->cs_mutex);
458+ return -EBUSY;
459+ }
456460 /* initialize parser */
457461 memset(&parser, 0, sizeof(struct radeon_cs_parser));
458462 parser.filp = filp;
drivers/gpu/drm/radeon/radeon_fence.c+3−1
@@ -364,8 +364,10 @@ int radeon_fence_count_emitted(struct radeon_device *rdev, int ring) · 363 unmodified lines
364364 int not_processed = 0;
365365
366366 read_lock_irqsave(&rdev->fence_lock, irq_flags);
367− if (!rdev->fence_drv[ring].initialized)
367+ if (!rdev->fence_drv[ring].initialized) {
368+ read_unlock_irqrestore(&rdev->fence_lock, irq_flags);
368369 return 0;
370+ }
369371
370372 if (!list_empty(&rdev->fence_drv[ring].emitted)) {
371373 struct list_head *ptr;
drivers/gpu/drm/radeon/radeon_ring.c+5−2
@@ -500,8 +500,11 @@ static char radeon_debugfs_ib_names[RADEON_IB_POOL_SIZE][32]; · 499 unmodified lines
500500 int radeon_debugfs_ring_init(struct radeon_device *rdev)
501501 {
502502 #if defined(CONFIG_DEBUG_FS)
503− return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list,
504− ARRAY_SIZE(radeon_debugfs_ring_info_list));
503+ if (rdev->family >= CHIP_CAYMAN)
504+ return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list,
505+ ARRAY_SIZE(radeon_debugfs_ring_info_list));
506+ else
507+ return radeon_debugfs_add_files(rdev, radeon_debugfs_ring_info_list, 1);
505508 #else
506509 return 0;
507510 #endif
drivers/gpu/drm/radeon/rs400.c+7−1
@@ -442,6 +442,8 @@ static int rs400_startup(struct radeon_device *rdev) · 441 unmodified lines
442442
443443 int rs400_resume(struct radeon_device *rdev)
444444 {
445+ int r;
446+
445447 /* Make sur GART are not working */
446448 rs400_gart_disable(rdev);
447449 /* Resume clock before doing reset */
@@ -462,7 +464,11 @@ int rs400_resume(struct radeon_device *rdev) · 14 unmodified lines
462464 radeon_surface_init(rdev);
463465
464466 rdev->accel_working = true;
465− return rs400_startup(rdev);
467+ r = rs400_startup(rdev);
468+ if (r) {
469+ rdev->accel_working = false;
470+ }
471+ return r;
466472 }
467473
468474 int rs400_suspend(struct radeon_device *rdev)
drivers/gpu/drm/radeon/rs600.c+8−4
@@ -684,9 +684,7 @@ int rs600_irq_process(struct radeon_device *rdev) · 683 unmodified lines
684684 WREG32(RADEON_BUS_CNTL, msi_rearm | RS600_MSI_REARM);
685685 break;
686686 default:
687− msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN;
688− WREG32(RADEON_MSI_REARM_EN, msi_rearm);
689− WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN);
687+ WREG32(RADEON_MSI_REARM_EN, RV370_MSI_REARM_EN);
690688 break;
691689 }
692690 }
@@ -878,6 +876,8 @@ static int rs600_startup(struct radeon_device *rdev) · 185 unmodified lines
878876
879877 int rs600_resume(struct radeon_device *rdev)
880878 {
879+ int r;
880+
881881 /* Make sur GART are not working */
882882 rs600_gart_disable(rdev);
883883 /* Resume clock before doing reset */
@@ -896,7 +896,11 @@ int rs600_resume(struct radeon_device *rdev) · 12 unmodified lines
896896 radeon_surface_init(rdev);
897897
898898 rdev->accel_working = true;
899− return rs600_startup(rdev);
899+ r = rs600_startup(rdev);
900+ if (r) {
901+ rdev->accel_working = false;
902+ }
903+ return r;
900904 }
901905
902906 int rs600_suspend(struct radeon_device *rdev)
drivers/gpu/drm/radeon/rs690.c+7−1
@@ -659,6 +659,8 @@ static int rs690_startup(struct radeon_device *rdev) · 658 unmodified lines
659659
660660 int rs690_resume(struct radeon_device *rdev)
661661 {
662+ int r;
663+
662664 /* Make sur GART are not working */
663665 rs400_gart_disable(rdev);
664666 /* Resume clock before doing reset */
@@ -677,7 +679,11 @@ int rs690_resume(struct radeon_device *rdev) · 12 unmodified lines
677679 radeon_surface_init(rdev);
678680
679681 rdev->accel_working = true;
680− return rs690_startup(rdev);
682+ r = rs690_startup(rdev);
683+ if (r) {
684+ rdev->accel_working = false;
685+ }
686+ return r;
681687 }
682688
683689 int rs690_suspend(struct radeon_device *rdev)
drivers/gpu/drm/radeon/rv515.c+7−1
@@ -424,6 +424,8 @@ static int rv515_startup(struct radeon_device *rdev) · 423 unmodified lines
424424
425425 int rv515_resume(struct radeon_device *rdev)
426426 {
427+ int r;
428+
427429 /* Make sur GART are not working */
428430 if (rdev->flags & RADEON_IS_PCIE)
429431 rv370_pcie_gart_disable(rdev);
@@ -443,7 +445,11 @@ int rv515_resume(struct radeon_device *rdev) · 13 unmodified lines
443445 radeon_surface_init(rdev);
444446
445447 rdev->accel_working = true;
446− return rv515_startup(rdev);
448+ r = rv515_startup(rdev);
449+ if (r) {
450+ rdev->accel_working = false;
451+ }
452+ return r;
447453 }
448454
449455 int rv515_suspend(struct radeon_device *rdev)
drivers/gpu/drm/radeon/rv770.c+1−0
@@ -1139,6 +1139,7 @@ int rv770_resume(struct radeon_device *rdev) · 1138 unmodified lines
11391139 r = rv770_startup(rdev);
11401140 if (r) {
11411141 DRM_ERROR("r600 startup failed on resume\n");
1142+ rdev->accel_working = false;
11421143 return r;
11431144 }
11441145
drivers/hid/hid-hyperv.c+1−0
@@ -548,6 +548,7 @@ static int mousevsc_remove(struct hv_device *dev) · 547 unmodified lines
548548 struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
549549
550550 vmbus_close(dev->channel);
551+ hid_hw_stop(input_dev->hid_device);
551552 hid_destroy_device(input_dev->hid_device);
552553 mousevsc_free_device(input_dev);
553554
drivers/hid/hid-wacom.c+4−3
@@ -531,7 +531,6 @@ static int wacom_probe(struct hid_device *hdev, · 530 unmodified lines
531531 wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY;
532532 wdata->battery.use_for_apm = 0;
533533
534− power_supply_powers(&wdata->battery, &hdev->dev);
535534
536535 ret = power_supply_register(&hdev->dev, &wdata->battery);
537536 if (ret) {
@@ -540,6 +539,8 @@ static int wacom_probe(struct hid_device *hdev, · 2 unmodified lines
540539 goto err_battery;
541540 }
542541
542+ power_supply_powers(&wdata->battery, &hdev->dev);
543+
543544 wdata->ac.properties = wacom_ac_props;
544545 wdata->ac.num_properties = ARRAY_SIZE(wacom_ac_props);
545546 wdata->ac.get_property = wacom_ac_get_property;
@@ -547,14 +548,14 @@ static int wacom_probe(struct hid_device *hdev, · 1 unmodified line
547548 wdata->ac.type = POWER_SUPPLY_TYPE_MAINS;
548549 wdata->ac.use_for_apm = 0;
549550
550− power_supply_powers(&wdata->battery, &hdev->dev);
551−
552551 ret = power_supply_register(&hdev->dev, &wdata->ac);
553552 if (ret) {
554553 hid_warn(hdev,
555554 "can't create ac battery attribute, err: %d\n", ret);
556555 goto err_ac;
557556 }
557+
558+ power_supply_powers(&wdata->ac, &hdev->dev);
558559 #endif
559560 return 0;
560561
drivers/hid/hid-wiimote-core.c+2−2
@@ -1226,14 +1226,14 @@ static int wiimote_hid_probe(struct hid_device *hdev, · 1225 unmodified lines
12261226 wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY;
12271227 wdata->battery.use_for_apm = 0;
12281228
1229− power_supply_powers(&wdata->battery, &hdev->dev);
1230−
12311229 ret = power_supply_register(&wdata->hdev->dev, &wdata->battery);
12321230 if (ret) {
12331231 hid_err(hdev, "Cannot register battery device\n");
12341232 goto err_battery;
12351233 }
12361234
1235+ power_supply_powers(&wdata->battery, &hdev->dev);
1236+
12371237 ret = wiimote_leds_create(wdata);
12381238 if (ret)
12391239 goto err_free;
drivers/hid/usbhid/hiddev.c+2−2
@@ -922,11 +922,11 @@ void hiddev_disconnect(struct hid_device *hid) · 921 unmodified lines
922922 struct hiddev *hiddev = hid->hiddev;
923923 struct usbhid_device *usbhid = hid->driver_data;
924924
925+ usb_deregister_dev(usbhid->intf, &hiddev_class);
926+
925927 mutex_lock(&hiddev->existancelock);
926928 hiddev->exist = 0;
927929
928− usb_deregister_dev(usbhid->intf, &hiddev_class);
929−
930930 if (hiddev->open) {
931931 mutex_unlock(&hiddev->existancelock);
932932 usbhid_close(hiddev->hid);
drivers/hwmon/ads1015.c+1−2
@@ -271,7 +271,7 @@ static int ads1015_probe(struct i2c_client *client, · 270 unmodified lines
271271 continue;
272272 err = device_create_file(&client->dev, &ads1015_in[k].dev_attr);
273273 if (err)
274− goto exit_free;
274+ goto exit_remove;
275275 }
276276
277277 data->hwmon_dev = hwmon_device_register(&client->dev);
@@ -285,7 +285,6 @@ static int ads1015_probe(struct i2c_client *client, · 7 unmodified lines
285285 exit_remove:
286286 for (k = 0; k < ADS1015_CHANNELS; ++k)
287287 device_remove_file(&client->dev, &ads1015_in[k].dev_attr);
288−exit_free:
289288 kfree(data);
290289 exit:
291290 return err;
drivers/hwmon/f75375s.c+8−10
@@ -172,7 +172,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg, · 171 unmodified lines
172172 static inline void f75375_write16(struct i2c_client *client, u8 reg,
173173 u16 value)
174174 {
175− int err = i2c_smbus_write_byte_data(client, reg, (value << 8));
175+ int err = i2c_smbus_write_byte_data(client, reg, (value >> 8));
176176 if (err)
177177 return;
178178 i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
@@ -200,9 +200,6 @@ static struct f75375_data *f75375_update_device(struct device *dev) · 21 unmodified lines
200200 f75375_read16(client, F75375_REG_FAN_MIN(nr));
201201 data->fan_target[nr] =
202202 f75375_read16(client, F75375_REG_FAN_EXP(nr));
203− data->pwm[nr] = f75375_read8(client,
204− F75375_REG_FAN_PWM_DUTY(nr));
205−
206203 }
207204 for (nr = 0; nr < 4; nr++) {
208205 data->in_max[nr] =
@@ -218,6 +215,8 @@ static struct f75375_data *f75375_update_device(struct device *dev) · 9 unmodified lines
218215 if (time_after(jiffies, data->last_updated + 2 * HZ)
219216 || !data->valid) {
220217 for (nr = 0; nr < 2; nr++) {
218+ data->pwm[nr] = f75375_read8(client,
219+ F75375_REG_FAN_PWM_DUTY(nr));
221220 /* assign MSB, therefore shift it by 8 bits */
222221 data->temp11[nr] =
223222 f75375_read8(client, F75375_REG_TEMP(nr)) << 8;
@@ -341,8 +340,6 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) · 117 unmodified lines
341340 fanmode |= (1 << F75387_FAN_MANU_MODE(nr));
342341 fanmode |= (1 << F75387_FAN_DUTY_MODE(nr));
343342 data->pwm[nr] = 255;
344− f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
345− data->pwm[nr]);
346343 break;
347344 case 1: /* PWM */
348345 fanmode |= (1 << F75387_FAN_MANU_MODE(nr));
@@ -362,14 +359,12 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) · 13 unmodified lines
362359 case 0: /* full speed */
363360 fanmode |= (3 << FAN_CTRL_MODE(nr));
364361 data->pwm[nr] = 255;
365− f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
366− data->pwm[nr]);
367362 break;
368363 case 1: /* PWM */
369364 fanmode |= (3 << FAN_CTRL_MODE(nr));
370365 break;
371366 case 2: /* AUTOMATIC*/
372− fanmode |= (2 << FAN_CTRL_MODE(nr));
367+ fanmode |= (1 << FAN_CTRL_MODE(nr));
373368 break;
374369 case 3: /* fan speed */
375370 break;
@@ -378,6 +373,9 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val) · 2 unmodified lines
378373
379374 f75375_write8(client, F75375_REG_FAN_TIMER, fanmode);
380375 data->pwm_enable[nr] = val;
376+ if (val == 0)
377+ f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
378+ data->pwm[nr]);
381379 return 0;
382380 }
383381
@@ -723,7 +721,7 @@ static void f75375_init(struct i2c_client *client, struct f75375_data *data, · 339 unmodified lines
723721 if (data->kind == f75387) {
724722 bool manu, duty;
725723
726− if (!(conf & (1 << F75387_FAN_CTRL_LINEAR(nr))))
724+ if (!(mode & (1 << F75387_FAN_CTRL_LINEAR(nr))))
727725 data->pwm_mode[nr] = 1;
728726
729727 manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1);
drivers/hwmon/max6639.c+12−10
@@ -72,8 +72,8 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2e, 0x2f, I2C_CLIENT_END }; · 71 unmodified lines
7272
7373 static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 };
7474
75−#define FAN_FROM_REG(val, div, rpm_range) ((val) == 0 ? -1 : \
76− (val) == 255 ? 0 : (rpm_ranges[rpm_range] * 30) / ((div + 1) * (val)))
75+#define FAN_FROM_REG(val, rpm_range) ((val) == 0 || (val) == 255 ? \
76+ 0 : (rpm_ranges[rpm_range] * 30) / (val))
7777 #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255)
7878
7979 /*
@@ -333,7 +333,7 @@ static ssize_t show_fan_input(struct device *dev, · 253 unmodified lines
333333 return PTR_ERR(data);
334334
335335 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index],
336− data->ppr, data->rpm_range));
336+ data->rpm_range));
337337 }
338338
339339 static ssize_t show_alarm(struct device *dev,
@@ -429,9 +429,9 @@ static int max6639_init_client(struct i2c_client *client) · 89 unmodified lines
429429 struct max6639_data *data = i2c_get_clientdata(client);
430430 struct max6639_platform_data *max6639_info =
431431 client->dev.platform_data;
432− int i = 0;
432+ int i;
433433 int rpm_range = 1; /* default: 4000 RPM */
434− int err = 0;
434+ int err;
435435
436436 /* Reset chip to default values, see below for GCONFIG setup */
437437 err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG,
@@ -446,11 +446,6 @@ static int max6639_init_client(struct i2c_client *client) · 8 unmodified lines
446446 else
447447 data->ppr = 2;
448448 data->ppr -= 1;
449− err = i2c_smbus_write_byte_data(client,
450− MAX6639_REG_FAN_PPR(i),
451− data->ppr << 5);
452− if (err)
453− goto exit;
454449
455450 if (max6639_info)
456451 rpm_range = rpm_range_to_reg(max6639_info->rpm_range);
@@ -458,6 +453,13 @@ static int max6639_init_client(struct i2c_client *client) · 1 unmodified line
458453
459454 for (i = 0; i < 2; i++) {
460455
456+ /* Set Fan pulse per revolution */
457+ err = i2c_smbus_write_byte_data(client,
458+ MAX6639_REG_FAN_PPR(i),
459+ data->ppr << 6);
460+ if (err)
461+ goto exit;
462+
461463 /* Fans config PWM, RPM */
462464 err = i2c_smbus_write_byte_data(client,
463465 MAX6639_REG_FAN_CONFIG1(i),
drivers/hwmon/pmbus/max34440.c+1−1
@@ -82,7 +82,7 @@ static int max34440_write_word_data(struct i2c_client *client, int page, · 81 unmodified lines
8282 case PMBUS_VIRT_RESET_TEMP_HISTORY:
8383 ret = pmbus_write_word_data(client, page,
8484 MAX34440_MFR_TEMPERATURE_PEAK,
85− 0xffff);
85+ 0x8000);
8686 break;
8787 default:
8888 ret = -ENODATA;
drivers/hwmon/w83627ehf.c+20−8
@@ -1920,9 +1920,26 @@ w83627ehf_check_fan_inputs(const struct w83627ehf_sio_data *sio_data, · 1919 unmodified lines
19201920 fan4min = 0;
19211921 fan5pin = 0;
19221922 } else if (sio_data->kind == nct6776) {
1923− fan3pin = !(superio_inb(sio_data->sioreg, 0x24) & 0x40);
1924− fan4pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x01);
1925− fan5pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x02);
1923+ bool gpok = superio_inb(sio_data->sioreg, 0x27) & 0x80;
1924+
1925+ superio_select(sio_data->sioreg, W83627EHF_LD_HWM);
1926+ regval = superio_inb(sio_data->sioreg, SIO_REG_ENABLE);
1927+
1928+ if (regval & 0x80)
1929+ fan3pin = gpok;
1930+ else
1931+ fan3pin = !(superio_inb(sio_data->sioreg, 0x24) & 0x40);
1932+
1933+ if (regval & 0x40)
1934+ fan4pin = gpok;
1935+ else
1936+ fan4pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x01);
1937+
1938+ if (regval & 0x20)
1939+ fan5pin = gpok;
1940+ else
1941+ fan5pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x02);
1942+
19261943 fan4min = fan4pin;
19271944 } else if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) {
19281945 fan3pin = 1;
@@ -2332,11 +2349,6 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) · 403 unmodified lines
23322349 /* Read fan clock dividers immediately */
23332350 w83627ehf_update_fan_div_common(dev, data);
23342351
2335− /* Read pwm data to save original values */
2336− w83627ehf_update_pwm_common(dev, data);
2337− for (i = 0; i < data->pwm_num; i++)
2338− data->pwm_enable_orig[i] = data->pwm_enable[i];
2339−
23402352 /* Read pwm data to save original values */
23412353 w83627ehf_update_pwm_common(dev, data);
23422354 for (i = 0; i < data->pwm_num; i++)
drivers/i2c/busses/i2c-omap.c+1−1
@@ -1018,7 +1018,7 @@ omap_i2c_probe(struct platform_device *pdev) · 1017 unmodified lines
10181018 goto err_release_region;
10191019 }
10201020
1021− match = of_match_device(omap_i2c_of_match, &pdev->dev);
1021+ match = of_match_device(of_match_ptr(omap_i2c_of_match), &pdev->dev);
10221022 if (match) {
10231023 u32 freq = 100000; /* default to 100000 Hz */
10241024
drivers/i2c/busses/i2c-tegra.c+1−1
@@ -755,7 +755,7 @@ MODULE_DEVICE_TABLE(of, tegra_i2c_of_match); · 754 unmodified lines
755755
756756 static struct platform_driver tegra_i2c_driver = {
757757 .probe = tegra_i2c_probe,
758− .remove = tegra_i2c_remove,
758+ .remove = __devexit_p(tegra_i2c_remove),
759759 #ifdef CONFIG_PM
760760 .suspend = tegra_i2c_suspend,
761761 .resume = tegra_i2c_resume,
drivers/ide/Makefile+0−1
@@ -116,4 +116,3 @@ obj-$(CONFIG_BLK_DEV_IDE_AU1XXX) += au1xxx-ide.o · 115 unmodified lines
116116
117117 obj-$(CONFIG_BLK_DEV_IDE_TX4938) += tx4938ide.o
118118 obj-$(CONFIG_BLK_DEV_IDE_TX4939) += tx4939ide.o
119−obj-$(CONFIG_BLK_DEV_IDE_AT91) += at91_ide.o
drivers/ide/at91_ide.c+0−366
@@ -1,366 +0,0 @@
1−/*
2− * IDE host driver for AT91 (SAM9, CAP9, AT572D940HF) Static Memory Controller
3− * with Compact Flash True IDE logic
4− *
5− * Copyright (c) 2008, 2009 Kelvatek Ltd.
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License as published by
9− * the Free Software Foundation; either version 2 of the License, or
10− * (at your option) any later version.
11− *
12− * This program is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15− * GNU General Public License for more details.
16− *
17− * You should have received a copy of the GNU General Public License
18− * along with this program; if not, write to the Free Software
19− * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20− *
21− */
22−
23−#include <linux/kernel.h>
24−#include <linux/module.h>
25−#include <linux/clk.h>
26−#include <linux/err.h>
27−#include <linux/ide.h>
28−#include <linux/platform_device.h>
29−
30−#include <mach/board.h>
31−#include <asm/gpio.h>
32−#include <mach/at91sam9_smc.h>
33−
34−#define DRV_NAME "at91_ide"
35−
36−#define perr(fmt, args...) pr_err(DRV_NAME ": " fmt, ##args)
37−#define pdbg(fmt, args...) pr_debug("%s " fmt, __func__, ##args)
38−
39−/*
40− * Access to IDE device is possible through EBI Static Memory Controller
41− * with Compact Flash logic. For details see EBI and SMC datasheet sections
42− * of any microcontroller from AT91SAM9 family.
43− *
44− * Within SMC chip select address space, lines A[23:21] distinguish Compact
45− * Flash modes (I/O, common memory, attribute memory, True IDE). IDE modes are:
46− * 0x00c0000 - True IDE
47− * 0x00e0000 - Alternate True IDE (Alt Status Register)
48− *
49− * On True IDE mode Task File and Data Register are mapped at the same address.
50− * To distinguish access between these two different bus data width is used:
51− * 8Bit for Task File, 16Bit for Data I/O.
52− *
53− * After initialization we do 8/16 bit flipping (changes in SMC MODE register)
54− * only inside IDE callback routines which are serialized by IDE layer,
55− * so no additional locking needed.
56− */
57−
58−#define TASK_FILE 0x00c00000
59−#define ALT_MODE 0x00e00000
60−#define REGS_SIZE 8
61−
62−#define enter_16bit(cs, mode) do { \
63− mode = at91_sys_read(AT91_SMC_MODE(cs)); \
64− at91_sys_write(AT91_SMC_MODE(cs), mode | AT91_SMC_DBW_16); \
65−} while (0)
66−
67−#define leave_16bit(cs, mode) at91_sys_write(AT91_SMC_MODE(cs), mode);
68−
69−static void set_smc_timings(const u8 chipselect, const u16 cycle,
70− const u16 setup, const u16 pulse,
71− const u16 data_float, int use_iordy)
72−{
73− unsigned long mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
74− AT91_SMC_BAT_SELECT;
75−
76− /* disable or enable waiting for IORDY signal */
77− if (use_iordy)
78− mode |= AT91_SMC_EXNWMODE_READY;
79−
80− /* add data float cycles if needed */
81− if (data_float)
82− mode |= AT91_SMC_TDF_(data_float);
83−
84− at91_sys_write(AT91_SMC_MODE(chipselect), mode);
85−
86− /* setup timings in SMC */
87− at91_sys_write(AT91_SMC_SETUP(chipselect), AT91_SMC_NWESETUP_(setup) |
88− AT91_SMC_NCS_WRSETUP_(0) |
89− AT91_SMC_NRDSETUP_(setup) |
90− AT91_SMC_NCS_RDSETUP_(0));
91− at91_sys_write(AT91_SMC_PULSE(chipselect), AT91_SMC_NWEPULSE_(pulse) |
92− AT91_SMC_NCS_WRPULSE_(cycle) |
93− AT91_SMC_NRDPULSE_(pulse) |
94− AT91_SMC_NCS_RDPULSE_(cycle));
95− at91_sys_write(AT91_SMC_CYCLE(chipselect), AT91_SMC_NWECYCLE_(cycle) |
96− AT91_SMC_NRDCYCLE_(cycle));
97−}
98−
99−static unsigned int calc_mck_cycles(unsigned int ns, unsigned int mck_hz)
100−{
101− u64 tmp = ns;
102−
103− tmp *= mck_hz;
104− tmp += 1000*1000*1000 - 1; /* round up */
105− do_div(tmp, 1000*1000*1000);
106− return (unsigned int) tmp;
107−}
108−
109−static void apply_timings(const u8 chipselect, const u8 pio,
110− const struct ide_timing *timing, int use_iordy)
111−{
112− unsigned int t0, t1, t2, t6z;
113− unsigned int cycle, setup, pulse, data_float;
114− unsigned int mck_hz;
115− struct clk *mck;
116−
117− /* see table 22 of Compact Flash standard 4.1 for the meaning,
118− * we do not stretch active (t2) time, so setup (t1) + hold time (th)
119− * assure at least minimal recovery (t2i) time */
120− t0 = timing->cyc8b;
121− t1 = timing->setup;
122− t2 = timing->act8b;
123− t6z = (pio < 5) ? 30 : 20;
124−
125− pdbg("t0=%u t1=%u t2=%u t6z=%u\n", t0, t1, t2, t6z);
126−
127− mck = clk_get(NULL, "mck");
128− BUG_ON(IS_ERR(mck));
129− mck_hz = clk_get_rate(mck);
130− pdbg("mck_hz=%u\n", mck_hz);
131−
132− cycle = calc_mck_cycles(t0, mck_hz);
133− setup = calc_mck_cycles(t1, mck_hz);
134− pulse = calc_mck_cycles(t2, mck_hz);
135− data_float = calc_mck_cycles(t6z, mck_hz);
136−
137− pdbg("cycle=%u setup=%u pulse=%u data_float=%u\n",
138− cycle, setup, pulse, data_float);
139−
140− set_smc_timings(chipselect, cycle, setup, pulse, data_float, use_iordy);
141−}
142−
143−static void at91_ide_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
144− void *buf, unsigned int len)
145−{
146− ide_hwif_t *hwif = drive->hwif;
147− struct ide_io_ports *io_ports = &hwif->io_ports;
148− u8 chipselect = hwif->select_data;
149− unsigned long mode;
150−
151− pdbg("cs %u buf %p len %d\n", chipselect, buf, len);
152−
153− len++;
154−
155− enter_16bit(chipselect, mode);
156− readsw((void __iomem *)io_ports->data_addr, buf, len / 2);
157− leave_16bit(chipselect, mode);
158−}
159−
160−static void at91_ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
161− void *buf, unsigned int len)
162−{
163− ide_hwif_t *hwif = drive->hwif;
164− struct ide_io_ports *io_ports = &hwif->io_ports;
165− u8 chipselect = hwif->select_data;
166− unsigned long mode;
167−
168− pdbg("cs %u buf %p len %d\n", chipselect, buf, len);
169−
170− enter_16bit(chipselect, mode);
171− writesw((void __iomem *)io_ports->data_addr, buf, len / 2);
172− leave_16bit(chipselect, mode);
173−}
174−
175−static void at91_ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
176−{
177− struct ide_timing *timing;
178− u8 chipselect = hwif->select_data;
179− int use_iordy = 0;
180− const u8 pio = drive->pio_mode - XFER_PIO_0;
181−
182− pdbg("chipselect %u pio %u\n", chipselect, pio);
183−
184− timing = ide_timing_find_mode(XFER_PIO_0 + pio);
185− BUG_ON(!timing);
186−
187− if (ide_pio_need_iordy(drive, pio))
188− use_iordy = 1;
189−
190− apply_timings(chipselect, pio, timing, use_iordy);
191−}
192−
193−static const struct ide_tp_ops at91_ide_tp_ops = {
194− .exec_command = ide_exec_command,
195− .read_status = ide_read_status,
196− .read_altstatus = ide_read_altstatus,
197− .write_devctl = ide_write_devctl,
198−
199− .dev_select = ide_dev_select,
200− .tf_load = ide_tf_load,
201− .tf_read = ide_tf_read,
202−
203− .input_data = at91_ide_input_data,
204− .output_data = at91_ide_output_data,
205−};
206−
207−static const struct ide_port_ops at91_ide_port_ops = {
208− .set_pio_mode = at91_ide_set_pio_mode,
209−};
210−
211−static const struct ide_port_info at91_ide_port_info __initdata = {
212− .port_ops = &at91_ide_port_ops,
213− .tp_ops = &at91_ide_tp_ops,
214− .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA | IDE_HFLAG_SINGLE |
215− IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_UNMASK_IRQS,
216− .pio_mask = ATA_PIO6,
217− .chipset = ide_generic,
218−};
219−
220−/*
221− * If interrupt is delivered through GPIO, IRQ are triggered on falling
222− * and rising edge of signal. Whereas IDE device request interrupt on high
223− * level (rising edge in our case). This mean we have fake interrupts, so
224− * we need to check interrupt pin and exit instantly from ISR when line
225− * is on low level.
226− */
227−
228−irqreturn_t at91_irq_handler(int irq, void *dev_id)
229−{
230− int ntries = 8;
231− int pin_val1, pin_val2;
232−
233− /* additional deglitch, line can be noisy in badly designed PCB */
234− do {
235− pin_val1 = at91_get_gpio_value(irq);
236− pin_val2 = at91_get_gpio_value(irq);
237− } while (pin_val1 != pin_val2 && --ntries > 0);
238−
239− if (pin_val1 == 0 || ntries <= 0)
240− return IRQ_HANDLED;
241−
242− return ide_intr(irq, dev_id);
243−}
244−
245−static int __init at91_ide_probe(struct platform_device *pdev)
246−{
247− int ret;
248− struct ide_hw hw, *hws[] = { &hw };
249− struct ide_host *host;
250− struct resource *res;
251− unsigned long tf_base = 0, ctl_base = 0;
252− struct at91_cf_data *board = pdev->dev.platform_data;
253−
254− if (!board)
255− return -ENODEV;
256−
257− if (board->det_pin && at91_get_gpio_value(board->det_pin) != 0) {
258− perr("no device detected\n");
259− return -ENODEV;
260− }
261−
262− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
263− if (!res) {
264− perr("can't get memory resource\n");
265− return -ENODEV;
266− }
267−
268− if (!devm_request_mem_region(&pdev->dev, res->start + TASK_FILE,
269− REGS_SIZE, "ide") ||
270− !devm_request_mem_region(&pdev->dev, res->start + ALT_MODE,
271− REGS_SIZE, "alt")) {
272− perr("memory resources in use\n");
273− return -EBUSY;
274− }
275−
276− pdbg("chipselect %u irq %u res %08lx\n", board->chipselect,
277− board->irq_pin, (unsigned long) res->start);
278−
279− tf_base = (unsigned long) devm_ioremap(&pdev->dev, res->start + TASK_FILE,
280− REGS_SIZE);
281− ctl_base = (unsigned long) devm_ioremap(&pdev->dev, res->start + ALT_MODE,
282− REGS_SIZE);
283− if (!tf_base || !ctl_base) {
284− perr("can't map memory regions\n");
285− return -EBUSY;
286− }
287−
288− memset(&hw, 0, sizeof(hw));
289−
290− if (board->flags & AT91_IDE_SWAP_A0_A2) {
291− /* workaround for stupid hardware bug */
292− hw.io_ports.data_addr = tf_base + 0;
293− hw.io_ports.error_addr = tf_base + 4;
294− hw.io_ports.nsect_addr = tf_base + 2;
295− hw.io_ports.lbal_addr = tf_base + 6;
296− hw.io_ports.lbam_addr = tf_base + 1;
297− hw.io_ports.lbah_addr = tf_base + 5;
298− hw.io_ports.device_addr = tf_base + 3;
299− hw.io_ports.command_addr = tf_base + 7;
300− hw.io_ports.ctl_addr = ctl_base + 3;
301− } else
302− ide_std_init_ports(&hw, tf_base, ctl_base + 6);
303−
304− hw.irq = board->irq_pin;
305− hw.dev = &pdev->dev;
306−
307− host = ide_host_alloc(&at91_ide_port_info, hws, 1);
308− if (!host) {
309− perr("failed to allocate ide host\n");
310− return -ENOMEM;
311− }
312−
313− /* setup Static Memory Controller - PIO 0 as default */
314− apply_timings(board->chipselect, 0, ide_timing_find_mode(XFER_PIO_0), 0);
315−
316− /* with GPIO interrupt we have to do quirks in handler */
317− if (gpio_is_valid(board->irq_pin))
318− host->irq_handler = at91_irq_handler;
319−
320− host->ports[0]->select_data = board->chipselect;
321−
322− ret = ide_host_register(host, &at91_ide_port_info, hws);
323− if (ret) {
324− perr("failed to register ide host\n");
325− goto err_free_host;
326− }
327− platform_set_drvdata(pdev, host);
328− return 0;
329−
330−err_free_host:
331− ide_host_free(host);
332− return ret;
333−}
334−
335−static int __exit at91_ide_remove(struct platform_device *pdev)
336−{
337− struct ide_host *host = platform_get_drvdata(pdev);
338−
339− ide_host_remove(host);
340− return 0;
341−}
342−
343−static struct platform_driver at91_ide_driver = {
344− .driver = {
345− .name = DRV_NAME,
346− .owner = THIS_MODULE,
347− },
348− .remove = __exit_p(at91_ide_remove),
349−};
350−
351−static int __init at91_ide_init(void)
352−{
353− return platform_driver_probe(&at91_ide_driver, at91_ide_probe);
354−}
355−
356−static void __exit at91_ide_exit(void)
357−{
358− platform_driver_unregister(&at91_ide_driver);
359−}
360−
361−module_init(at91_ide_init);
362−module_exit(at91_ide_exit);
363−
364−MODULE_LICENSE("GPL");
365−MODULE_AUTHOR("Stanislaw Gruszka <stf_xl@wp.pl>");
366−
drivers/infiniband/ulp/ipoib/ipoib.h+4−2
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #include <linux/mutex.h>
4545
4646 #include <net/neighbour.h>
47+#include <net/sch_generic.h>
4748
4849 #include <linux/atomic.h>
4950
@@ -117,8 +118,9 @@ struct ipoib_header { · 67 unmodified lines
117118 u16 reserved;
118119 };
119120
120−struct ipoib_pseudoheader {
121− u8 hwaddr[INFINIBAND_ALEN];
121+struct ipoib_cb {
122+ struct qdisc_skb_cb qdisc_cb;
123+ u8 hwaddr[INFINIBAND_ALEN];
122124 };
123125
124126 /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */
drivers/infiniband/ulp/ipoib/ipoib_main.c+19−36
@@ -653,7 +653,7 @@ static void ipoib_path_lookup(struct sk_buff *skb, struct neighbour *n, struct n · 652 unmodified lines
653653 }
654654
655655 static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
656− struct ipoib_pseudoheader *phdr)
656+ struct ipoib_cb *cb)
657657 {
658658 struct ipoib_dev_priv *priv = netdev_priv(dev);
659659 struct ipoib_path *path;
@@ -661,17 +661,15 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, · 1 unmodified line
661661
662662 spin_lock_irqsave(&priv->lock, flags);
663663
664− path = __path_find(dev, phdr->hwaddr + 4);
664+ path = __path_find(dev, cb->hwaddr + 4);
665665 if (!path || !path->valid) {
666666 int new_path = 0;
667667
668668 if (!path) {
669− path = path_rec_create(dev, phdr->hwaddr + 4);
669+ path = path_rec_create(dev, cb->hwaddr + 4);
670670 new_path = 1;
671671 }
672672 if (path) {
673− /* put pseudoheader back on for next time */
674− skb_push(skb, sizeof *phdr);
675673 __skb_queue_tail(&path->queue, skb);
676674
677675 if (!path->query && path_rec_start(dev, path)) {
@@ -695,12 +693,10 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, · 17 unmodified lines
695693 be16_to_cpu(path->pathrec.dlid));
696694
697695 spin_unlock_irqrestore(&priv->lock, flags);
698− ipoib_send(dev, skb, path->ah, IPOIB_QPN(phdr->hwaddr));
696+ ipoib_send(dev, skb, path->ah, IPOIB_QPN(cb->hwaddr));
699697 return;
700698 } else if ((path->query || !path_rec_start(dev, path)) &&
701699 skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
702− /* put pseudoheader back on for next time */
703− skb_push(skb, sizeof *phdr);
704700 __skb_queue_tail(&path->queue, skb);
705701 } else {
706702 ++dev->stats.tx_dropped;
@@ -774,16 +770,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) · 67 unmodified lines
774770 dev_kfree_skb_any(skb);
775771 }
776772 } else {
777− struct ipoib_pseudoheader *phdr =
778− (struct ipoib_pseudoheader *) skb->data;
779− skb_pull(skb, sizeof *phdr);
773+ struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
780774
781− if (phdr->hwaddr[4] == 0xff) {
775+ if (cb->hwaddr[4] == 0xff) {
782776 /* Add in the P_Key for multicast*/
783− phdr->hwaddr[8] = (priv->pkey >> 8) & 0xff;
784− phdr->hwaddr[9] = priv->pkey & 0xff;
777+ cb->hwaddr[8] = (priv->pkey >> 8) & 0xff;
778+ cb->hwaddr[9] = priv->pkey & 0xff;
785779
786− ipoib_mcast_send(dev, phdr->hwaddr + 4, skb);
780+ ipoib_mcast_send(dev, cb->hwaddr + 4, skb);
787781 } else {
788782 /* unicast GID -- should be ARP or RARP reply */
789783
@@ -792,14 +786,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) · 2 unmodified lines
792786 ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n",
793787 skb_dst(skb) ? "neigh" : "dst",
794788 be16_to_cpup((__be16 *) skb->data),
795− IPOIB_QPN(phdr->hwaddr),
796− phdr->hwaddr + 4);
789+ IPOIB_QPN(cb->hwaddr),
790+ cb->hwaddr + 4);
797791 dev_kfree_skb_any(skb);
798792 ++dev->stats.tx_dropped;
799793 goto unlock;
800794 }
801795
802− unicast_arp_send(skb, dev, phdr);
796+ unicast_arp_send(skb, dev, cb);
803797 }
804798 }
805799 unlock:
@@ -825,8 +819,6 @@ static int ipoib_hard_header(struct sk_buff *skb, · 19 unmodified lines
825819 const void *daddr, const void *saddr, unsigned len)
826820 {
827821 struct ipoib_header *header;
828− struct dst_entry *dst;
829− struct neighbour *n;
830822
831823 header = (struct ipoib_header *) skb_push(skb, sizeof *header);
832824
@@ -834,18 +826,13 @@ static int ipoib_hard_header(struct sk_buff *skb, · 1 unmodified line
834826 header->reserved = 0;
835827
836828 /*
837− * If we don't have a neighbour structure, stuff the
838− * destination address onto the front of the skb so we can
839− * figure out where to send the packet later.
829+ * If we don't have a dst_entry structure, stuff the
830+ * destination address into skb->cb so we can figure out where
831+ * to send the packet later.
840832 */
841− dst = skb_dst(skb);
842− n = NULL;
843− if (dst)
844− n = dst_get_neighbour_noref_raw(dst);
845− if ((!dst || !n) && daddr) {
846− struct ipoib_pseudoheader *phdr =
847− (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
848− memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
833+ if (!skb_dst(skb)) {
834+ struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
835+ memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN);
849836 }
850837
851838 return 0;
@@ -1021,11 +1008,7 @@ static void ipoib_setup(struct net_device *dev) · 169 unmodified lines
10211008
10221009 dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
10231010
1024− /*
1025− * We add in INFINIBAND_ALEN to allow for the destination
1026− * address "pseudoheader" for skbs without neighbour struct.
1027− */
1028− dev->hard_header_len = IPOIB_ENCAP_LEN + INFINIBAND_ALEN;
1011+ dev->hard_header_len = IPOIB_ENCAP_LEN;
10291012 dev->addr_len = INFINIBAND_ALEN;
10301013 dev->type = ARPHRD_INFINIBAND;
10311014 dev->tx_queue_len = ipoib_sendq_size * 2;
drivers/infiniband/ulp/ipoib/ipoib_multicast.c+1−9
@@ -262,21 +262,13 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast, · 261 unmodified lines
262262 netif_tx_lock_bh(dev);
263263 while (!skb_queue_empty(&mcast->pkt_queue)) {
264264 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
265− struct dst_entry *dst = skb_dst(skb);
266− struct neighbour *n = NULL;
267265
268266 netif_tx_unlock_bh(dev);
269267
270268 skb->dev = dev;
271− if (dst)
272− n = dst_get_neighbour_noref_raw(dst);
273− if (!dst || !n) {
274− /* put pseudoheader back on for next time */
275− skb_push(skb, sizeof (struct ipoib_pseudoheader));
276− }
277−
278269 if (dev_queue_xmit(skb))
279270 ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n");
271+
280272 netif_tx_lock_bh(dev);
281273 }
282274 netif_tx_unlock_bh(dev);
drivers/infiniband/ulp/srpt/ib_srpt.c+7−10
@@ -69,8 +69,8 @@ MODULE_LICENSE("Dual BSD/GPL"); · 68 unmodified lines
6969 */
7070
7171 static u64 srpt_service_guid;
72−static spinlock_t srpt_dev_lock; /* Protects srpt_dev_list. */
73−static struct list_head srpt_dev_list; /* List of srpt_device structures. */
72+static DEFINE_SPINLOCK(srpt_dev_lock); /* Protects srpt_dev_list. */
73+static LIST_HEAD(srpt_dev_list); /* List of srpt_device structures. */
7474
7575 static unsigned srp_max_req_size = DEFAULT_MAX_REQ_SIZE;
7676 module_param(srp_max_req_size, int, 0444);
@@ -687,6 +687,7 @@ err: · 610 unmodified lines
687687 while (--i >= 0)
688688 srpt_free_ioctx(sdev, ring[i], dma_size, dir);
689689 kfree(ring);
690+ ring = NULL;
690691 out:
691692 return ring;
692693 }
@@ -2595,7 +2596,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 1902 unmodified lines
25952596 }
25962597
25972598 ch->sess = transport_init_session();
2598− if (!ch->sess) {
2599+ if (IS_ERR(ch->sess)) {
25992600 rej->reason = __constant_cpu_to_be32(
26002601 SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
26012602 pr_debug("Failed to create session\n");
@@ -3264,8 +3265,7 @@ static void srpt_add_one(struct ib_device *device) · 662 unmodified lines
32643265 for (i = 0; i < sdev->srq_size; ++i)
32653266 srpt_post_recv(sdev, sdev->ioctx_ring[i]);
32663267
3267− WARN_ON(sdev->device->phys_port_cnt
3268− > sizeof(sdev->port)/sizeof(sdev->port[0]));
3268+ WARN_ON(sdev->device->phys_port_cnt > ARRAY_SIZE(sdev->port));
32693269
32703270 for (i = 1; i <= sdev->device->phys_port_cnt; i++) {
32713271 sport = &sdev->port[i - 1];
@@ -4010,13 +4010,10 @@ static int __init srpt_init_module(void) · 738 unmodified lines
40104010 goto out;
40114011 }
40124012
4013− spin_lock_init(&srpt_dev_lock);
4014− INIT_LIST_HEAD(&srpt_dev_list);
4015−
4016− ret = -ENODEV;
40174013 srpt_target = target_fabric_configfs_init(THIS_MODULE, "srpt");
4018− if (!srpt_target) {
4014+ if (IS_ERR(srpt_target)) {
40194015 printk(KERN_ERR "couldn't register\n");
4016+ ret = PTR_ERR(srpt_target);
40204017 goto out;
40214018 }
40224019
drivers/infiniband/ulp/srpt/ib_srpt.h+0−1
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 #ifndef IB_SRPT_H
3636 #define IB_SRPT_H
3737
38−#include <linux/version.h>
3938 #include <linux/types.h>
4039 #include <linux/list.h>
4140 #include <linux/wait.h>
drivers/input/evdev.c+1−1
@@ -386,7 +386,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer, · 385 unmodified lines
386386 struct evdev_client *client = file->private_data;
387387 struct evdev *evdev = client->evdev;
388388 struct input_event event;
389− int retval;
389+ int retval = 0;
390390
391391 if (count < input_event_size())
392392 return -EINVAL;
drivers/input/keyboard/twl4030_keypad.c+1−3
@@ -34,7 +34,6 @@ · 33 unmodified lines
3434 #include <linux/i2c/twl.h>
3535 #include <linux/slab.h>
3636
37−
3837 /*
3938 * The TWL4030 family chips include a keypad controller that supports
4039 * up to an 8x8 switch matrix. The controller can issue system wakeup
@@ -302,7 +301,7 @@ static int __devinit twl4030_kp_program(struct twl4030_keypad *kp) · 261 unmodified lines
302301 if (twl4030_kpwrite_u8(kp, i, KEYP_DEB) < 0)
303302 return -EIO;
304303
305− /* Set timeout period to 100 ms */
304+ /* Set timeout period to 200 ms */
306305 i = KEYP_PERIOD_US(200000, PTV_PRESCALER);
307306 if (twl4030_kpwrite_u8(kp, (i & 0xFF), KEYP_TIMEOUT_L) < 0)
308307 return -EIO;
@@ -466,4 +465,3 @@ MODULE_AUTHOR("Texas Instruments"); · 157 unmodified lines
466465 MODULE_DESCRIPTION("TWL4030 Keypad Driver");
467466 MODULE_LICENSE("GPL");
468467 MODULE_ALIAS("platform:twl4030_keypad");
469−
drivers/input/serio/i8042-x86ia64io.h+7−0
@@ -512,6 +512,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = { · 511 unmodified lines
512512 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
513513 },
514514 },
515+ {
516+ /* Lenovo Ideapad U455 */
517+ .matches = {
518+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
519+ DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
520+ },
521+ },
515522 { }
516523 };
517524
drivers/input/serio/serio_raw.c+9−6
@@ -164,7 +164,8 @@ static ssize_t serio_raw_read(struct file *file, char __user *buffer, · 163 unmodified lines
164164 struct serio_raw_client *client = file->private_data;
165165 struct serio_raw *serio_raw = client->serio_raw;
166166 char uninitialized_var(c);
167− ssize_t retval = 0;
167+ ssize_t read = 0;
168+ int retval;
168169
169170 if (serio_raw->dead)
170171 return -ENODEV;
@@ -180,13 +181,15 @@ static ssize_t serio_raw_read(struct file *file, char __user *buffer, · 9 unmodified lines
180181 if (serio_raw->dead)
181182 return -ENODEV;
182183
183− while (retval < count && serio_raw_fetch_byte(serio_raw, &c)) {
184− if (put_user(c, buffer++))
185− return -EFAULT;
186− retval++;
184+ while (read < count && serio_raw_fetch_byte(serio_raw, &c)) {
185+ if (put_user(c, buffer++)) {
186+ retval = -EFAULT;
187+ break;
188+ }
189+ read++;
187190 }
188191
189− return retval;
192+ return read ?: retval;
190193 }
191194
192195 static ssize_t serio_raw_write(struct file *file, const char __user *buffer,
drivers/iommu/amd_iommu.c+3−0
@@ -2863,6 +2863,9 @@ static unsigned device_dma_ops_init(void) · 2862 unmodified lines
28632863
28642864 for_each_pci_dev(pdev) {
28652865 if (!check_device(&pdev->dev)) {
2866+
2867+ iommu_ignore_device(&pdev->dev);
2868+
28662869 unhandled += 1;
28672870 continue;
28682871 }
drivers/iommu/msm_iommu.c+1−6
@@ -482,23 +482,19 @@ static size_t msm_iommu_unmap(struct iommu_domain *domain, unsigned long va, · 481 unmodified lines
482482
483483 priv = domain->priv;
484484
485− if (!priv) {
486− ret = -ENODEV;
485+ if (!priv)
487486 goto fail;
488− }
489487
490488 fl_table = priv->pgtable;
491489
492490 if (len != SZ_16M && len != SZ_1M &&
493491 len != SZ_64K && len != SZ_4K) {
494492 pr_debug("Bad length: %d\n", len);
495− ret = -EINVAL;
496493 goto fail;
497494 }
498495
499496 if (!fl_table) {
500497 pr_debug("Null page table\n");
501− ret = -EINVAL;
502498 goto fail;
503499 }
504500
@@ -507,7 +503,6 @@ static size_t msm_iommu_unmap(struct iommu_domain *domain, unsigned long va, · 2 unmodified lines
507503
508504 if (*fl_pte == 0) {
509505 pr_debug("First level PTE is 0\n");
510− ret = -ENODEV;
511506 goto fail;
512507 }
513508
drivers/isdn/i4l/isdn_net.c+1−1
@@ -1901,7 +1901,7 @@ static int isdn_net_header(struct sk_buff *skb, struct net_device *dev, · 1900 unmodified lines
19011901 {
19021902 isdn_net_local *lp = netdev_priv(dev);
19031903 unsigned char *p;
1904− ushort len = 0;
1904+ int len = 0;
19051905
19061906 switch (lp->p_encap) {
19071907 case ISDN_NET_ENCAP_ETHER:
drivers/leds/leds-lm3530.c+2−2
@@ -164,8 +164,8 @@ static int lm3530_init_registers(struct lm3530_data *drvdata) · 163 unmodified lines
164164
165165 if (drvdata->mode == LM3530_BL_MODE_ALS) {
166166 if (pltfm->als_vmax == 0) {
167− pltfm->als_vmin = als_vmin = 0;
168− pltfm->als_vmin = als_vmax = LM3530_ALS_WINDOW_mV;
167+ pltfm->als_vmin = 0;
168+ pltfm->als_vmax = LM3530_ALS_WINDOW_mV;
169169 }
170170
171171 als_vmin = pltfm->als_vmin;
drivers/macintosh/adb.c+2−2
@@ -710,7 +710,7 @@ static ssize_t adb_read(struct file *file, char __user *buf, · 709 unmodified lines
710710 req = NULL;
711711 spin_lock_irqsave(&state->lock, flags);
712712 add_wait_queue(&state->wait_queue, &wait);
713− current->state = TASK_INTERRUPTIBLE;
713+ set_current_state(TASK_INTERRUPTIBLE);
714714
715715 for (;;) {
716716 req = state->completed;
@@ -734,7 +734,7 @@ static ssize_t adb_read(struct file *file, char __user *buf, · 17 unmodified lines
734734 spin_lock_irqsave(&state->lock, flags);
735735 }
736736
737− current->state = TASK_RUNNING;
737+ set_current_state(TASK_RUNNING);
738738 remove_wait_queue(&state->wait_queue, &wait);
739739 spin_unlock_irqrestore(&state->lock, flags);
740740
drivers/md/dm-raid.c+9−3
@@ -56,7 +56,8 @@ struct raid_dev { · 55 unmodified lines
5656 struct raid_set {
5757 struct dm_target *ti;
5858
59− uint64_t print_flags;
59+ uint32_t bitmap_loaded;
60+ uint32_t print_flags;
6061
6162 struct mddev md;
6263 struct raid_type *raid_type;
@@ -1085,7 +1086,7 @@ static int raid_status(struct dm_target *ti, status_type_t type, · 1022 unmodified lines
10851086 raid_param_cnt += 2;
10861087 }
10871088
1088− raid_param_cnt += (hweight64(rs->print_flags & ~DMPF_REBUILD) * 2);
1089+ raid_param_cnt += (hweight32(rs->print_flags & ~DMPF_REBUILD) * 2);
10891090 if (rs->print_flags & (DMPF_SYNC | DMPF_NOSYNC))
10901091 raid_param_cnt--;
10911092
@@ -1197,7 +1198,12 @@ static void raid_resume(struct dm_target *ti) · 105 unmodified lines
11971198 {
11981199 struct raid_set *rs = ti->private;
11991200
1200− bitmap_load(&rs->md);
1201+ if (!rs->bitmap_loaded) {
1202+ bitmap_load(&rs->md);
1203+ rs->bitmap_loaded = 1;
1204+ } else
1205+ md_wakeup_thread(rs->md.thread);
1206+
12011207 mddev_resume(&rs->md);
12021208 }
12031209
drivers/md/md.c+3−2
@@ -7333,7 +7333,8 @@ void md_do_sync(struct mddev *mddev) · 7332 unmodified lines
73337333 printk(KERN_INFO
73347334 "md: checkpointing %s of %s.\n",
73357335 desc, mdname(mddev));
7336− mddev->recovery_cp = mddev->curr_resync;
7336+ mddev->recovery_cp =
7337+ mddev->curr_resync_completed;
73377338 }
73387339 } else
73397340 mddev->recovery_cp = MaxSector;
@@ -7351,9 +7352,9 @@ void md_do_sync(struct mddev *mddev) · 11 unmodified lines
73517352 rcu_read_unlock();
73527353 }
73537354 }
7355+ skip:
73547356 set_bit(MD_CHANGE_DEVS, &mddev->flags);
73557357
7356− skip:
73577358 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
73587359 /* We completed so min/max setting can be forgotten if used. */
73597360 if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
drivers/media/radio/wl128x/Kconfig+2−2
@@ -4,8 +4,8 @@ · 3 unmodified lines
44 menu "Texas Instruments WL128x FM driver (ST based)"
55 config RADIO_WL128X
66 tristate "Texas Instruments WL128x FM Radio"
7− depends on VIDEO_V4L2 && RFKILL
8− select TI_ST if NET && GPIOLIB
7+ depends on VIDEO_V4L2 && RFKILL && GPIOLIB
8+ select TI_ST if NET
99 help
1010 Choose Y here if you have this FM radio chip.
1111
drivers/media/rc/imon.c+22−4
@@ -47,7 +47,7 @@ · 46 unmodified lines
4747 #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"
4848 #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"
4949 #define MOD_NAME "imon"
50−#define MOD_VERSION "0.9.3"
50+#define MOD_VERSION "0.9.4"
5151
5252 #define DISPLAY_MINOR_BASE 144
5353 #define DEVICE_NAME "lcd%d"
@@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb) · 1604 unmodified lines
16581658 return;
16591659
16601660 ictx = (struct imon_context *)urb->context;
1661− if (!ictx || !ictx->dev_present_intf0)
1661+ if (!ictx)
16621662 return;
16631663
1664+ /*
1665+ * if we get a callback before we're done configuring the hardware, we
1666+ * can't yet process the data, as there's nowhere to send it, but we
1667+ * still need to submit a new rx URB to avoid wedging the hardware
1668+ */
1669+ if (!ictx->dev_present_intf0)
1670+ goto out;
1671+
16641672 switch (urb->status) {
16651673 case -ENOENT: /* usbcore unlink successful! */
16661674 return;
@@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb) · 11 unmodified lines
16781686 break;
16791687 }
16801688
1689+out:
16811690 usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC);
16821691 }
16831692
@@ -1690,9 +1699,17 @@ static void usb_rx_callback_intf1(struct urb *urb) · 6 unmodified lines
16901699 return;
16911700
16921701 ictx = (struct imon_context *)urb->context;
1693− if (!ictx || !ictx->dev_present_intf1)
1702+ if (!ictx)
16941703 return;
16951704
1705+ /*
1706+ * if we get a callback before we're done configuring the hardware, we
1707+ * can't yet process the data, as there's nowhere to send it, but we
1708+ * still need to submit a new rx URB to avoid wedging the hardware
1709+ */
1710+ if (!ictx->dev_present_intf1)
1711+ goto out;
1712+
16961713 switch (urb->status) {
16971714 case -ENOENT: /* usbcore unlink successful! */
16981715 return;
@@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb) · 11 unmodified lines
17101727 break;
17111728 }
17121729
1730+out:
17131731 usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC);
17141732 }
17151733
@@ -2242,7 +2260,7 @@ find_endpoint_failed: · 526 unmodified lines
22422260 mutex_unlock(&ictx->lock);
22432261 usb_free_urb(rx_urb);
22442262 rx_urb_alloc_failed:
2245− dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret);
2263+ dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret);
22462264
22472265 return NULL;
22482266 }
drivers/media/video/hdpvr/hdpvr-core.c+15−3
@@ -154,10 +154,20 @@ static int device_authorization(struct hdpvr_device *dev) · 153 unmodified lines
154154 }
155155 #endif
156156
157+ dev->fw_ver = dev->usbc_buf[1];
158+
157159 v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",
158− dev->usbc_buf[1], &dev->usbc_buf[2]);
160+ dev->fw_ver, &dev->usbc_buf[2]);
161+
162+ if (dev->fw_ver > 0x15) {
163+ dev->options.brightness = 0x80;
164+ dev->options.contrast = 0x40;
165+ dev->options.hue = 0xf;
166+ dev->options.saturation = 0x40;
167+ dev->options.sharpness = 0x80;
168+ }
159169
160− switch (dev->usbc_buf[1]) {
170+ switch (dev->fw_ver) {
161171 case HDPVR_FIRMWARE_VERSION:
162172 dev->flags &= ~HDPVR_FLAG_AC3_CAP;
163173 break;
@@ -169,7 +179,7 @@ static int device_authorization(struct hdpvr_device *dev) · 5 unmodified lines
169179 default:
170180 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"
171181 " not work.\n");
172− if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3)
182+ if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3)
173183 dev->flags |= HDPVR_FLAG_AC3_CAP;
174184 else
175185 dev->flags &= ~HDPVR_FLAG_AC3_CAP;
@@ -270,6 +280,8 @@ static const struct hdpvr_options hdpvr_default_options = { · 94 unmodified lines
270280 .bitrate_mode = HDPVR_CONSTANT,
271281 .gop_mode = HDPVR_SIMPLE_IDR_GOP,
272282 .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC,
283+ /* original picture controls for firmware version <= 0x15 */
284+ /* updated in device_authorization() for newer firmware */
273285 .brightness = 0x86,
274286 .contrast = 0x80,
275287 .hue = 0x80,
drivers/media/video/hdpvr/hdpvr-video.c+33−13
@@ -283,12 +283,13 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev) · 282 unmodified lines
283283
284284 hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);
285285
286+ dev->status = STATUS_STREAMING;
287+
286288 INIT_WORK(&dev->worker, hdpvr_transmit_buffers);
287289 queue_work(dev->workqueue, &dev->worker);
288290
289291 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
290292 "streaming started\n");
291− dev->status = STATUS_STREAMING;
292293
293294 return 0;
294295 }
@@ -722,21 +723,39 @@ static const s32 supported_v4l2_ctrls[] = { · 427 unmodified lines
722723 };
723724
724725 static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc,
725− int ac3)
726+ int ac3, int fw_ver)
726727 {
727728 int err;
728729
730+ if (fw_ver > 0x15) {
731+ switch (qc->id) {
732+ case V4L2_CID_BRIGHTNESS:
733+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
734+ case V4L2_CID_CONTRAST:
735+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40);
736+ case V4L2_CID_SATURATION:
737+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40);
738+ case V4L2_CID_HUE:
739+ return v4l2_ctrl_query_fill(qc, 0x0, 0x1e, 1, 0xf);
740+ case V4L2_CID_SHARPNESS:
741+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
742+ }
743+ } else {
744+ switch (qc->id) {
745+ case V4L2_CID_BRIGHTNESS:
746+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86);
747+ case V4L2_CID_CONTRAST:
748+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
749+ case V4L2_CID_SATURATION:
750+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
751+ case V4L2_CID_HUE:
752+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
753+ case V4L2_CID_SHARPNESS:
754+ return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
755+ }
756+ }
757+
729758 switch (qc->id) {
730− case V4L2_CID_BRIGHTNESS:
731− return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86);
732− case V4L2_CID_CONTRAST:
733− return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
734− case V4L2_CID_SATURATION:
735− return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
736− case V4L2_CID_HUE:
737− return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
738− case V4L2_CID_SHARPNESS:
739− return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
740759 case V4L2_CID_MPEG_AUDIO_ENCODING:
741760 return v4l2_ctrl_query_fill(
742761 qc, V4L2_MPEG_AUDIO_ENCODING_AAC,
@@ -794,7 +813,8 @@ static int vidioc_queryctrl(struct file *file, void *private_data, · 51 unmodified lines
794813
795814 if (qc->id == supported_v4l2_ctrls[i])
796815 return fill_queryctrl(&dev->options, qc,
797− dev->flags & HDPVR_FLAG_AC3_CAP);
816+ dev->flags & HDPVR_FLAG_AC3_CAP,
817+ dev->fw_ver);
798818
799819 if (qc->id < supported_v4l2_ctrls[i])
800820 break;
drivers/media/video/hdpvr/hdpvr.h+1−0
@@ -113,6 +113,7 @@ struct hdpvr_device { · 112 unmodified lines
113113 /* usb control transfer buffer and lock */
114114 struct mutex usbc_mutex;
115115 u8 *usbc_buf;
116+ u8 fw_ver;
116117 };
117118
118119 static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)
drivers/media/video/omap3isp/ispccdc.c+1−1
@@ -1407,7 +1407,7 @@ static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event) · 1406 unmodified lines
14071407 static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)
14081408 {
14091409 struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity);
1410− struct video_device *vdev = &ccdc->subdev.devnode;
1410+ struct video_device *vdev = ccdc->subdev.devnode;
14111411 struct v4l2_event event;
14121412
14131413 memset(&event, 0, sizeof(event));
drivers/mfd/Kconfig+1−1
@@ -200,7 +200,7 @@ config MENELAUS · 199 unmodified lines
200200
201201 config TWL4030_CORE
202202 bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
203− depends on I2C=y && GENERIC_HARDIRQS && IRQ_DOMAIN
203+ depends on I2C=y && GENERIC_HARDIRQS
204204 help
205205 Say yes here if you have TWL4030 / TWL6030 family chip on your board.
206206 This core driver provides register access and IRQ handling
drivers/mfd/twl-core.c+4−2
@@ -263,7 +263,9 @@ struct twl_client { · 262 unmodified lines
263263
264264 static struct twl_client twl_modules[TWL_NUM_SLAVES];
265265
266+#ifdef CONFIG_IRQ_DOMAIN
266267 static struct irq_domain domain;
268+#endif
267269
268270 /* mapping the module id to slave id and base address */
269271 struct twl_mapping {
@@ -1226,13 +1228,13 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) · 956 unmodified lines
12261228 pdata->irq_base = status;
12271229 pdata->irq_end = pdata->irq_base + nr_irqs;
12281230
1231+#ifdef CONFIG_IRQ_DOMAIN
12291232 domain.irq_base = pdata->irq_base;
12301233 domain.nr_irq = nr_irqs;
1231−#ifdef CONFIG_OF_IRQ
12321234 domain.of_node = of_node_get(node);
12331235 domain.ops = &irq_domain_simple_ops;
1234−#endif
12351236 irq_domain_add(&domain);
1237+#endif
12361238
12371239 if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) {
12381240 dev_dbg(&client->dev, "can't talk I2C?\n");
drivers/mfd/twl4030-power.c+10−10
@@ -124,7 +124,7 @@ static u8 res_config_addrs[] = { · 123 unmodified lines
124124 [RES_MAIN_REF] = 0x94,
125125 };
126126
127−static int __init twl4030_write_script_byte(u8 address, u8 byte)
127+static int __devinit twl4030_write_script_byte(u8 address, u8 byte)
128128 {
129129 int err;
130130
@@ -138,7 +138,7 @@ out: · 7 unmodified lines
138138 return err;
139139 }
140140
141−static int __init twl4030_write_script_ins(u8 address, u16 pmb_message,
141+static int __devinit twl4030_write_script_ins(u8 address, u16 pmb_message,
142142 u8 delay, u8 next)
143143 {
144144 int err;
@@ -158,7 +158,7 @@ out: · 13 unmodified lines
158158 return err;
159159 }
160160
161−static int __init twl4030_write_script(u8 address, struct twl4030_ins *script,
161+static int __devinit twl4030_write_script(u8 address, struct twl4030_ins *script,
162162 int len)
163163 {
164164 int err;
@@ -183,7 +183,7 @@ static int __init twl4030_write_script(u8 address, struct twl4030_ins *script, · 18 unmodified lines
183183 return err;
184184 }
185185
186−static int __init twl4030_config_wakeup3_sequence(u8 address)
186+static int __devinit twl4030_config_wakeup3_sequence(u8 address)
187187 {
188188 int err;
189189 u8 data;
@@ -208,7 +208,7 @@ out: · 18 unmodified lines
208208 return err;
209209 }
210210
211−static int __init twl4030_config_wakeup12_sequence(u8 address)
211+static int __devinit twl4030_config_wakeup12_sequence(u8 address)
212212 {
213213 int err = 0;
214214 u8 data;
@@ -262,7 +262,7 @@ out: · 47 unmodified lines
262262 return err;
263263 }
264264
265−static int __init twl4030_config_sleep_sequence(u8 address)
265+static int __devinit twl4030_config_sleep_sequence(u8 address)
266266 {
267267 int err;
268268
@@ -276,7 +276,7 @@ static int __init twl4030_config_sleep_sequence(u8 address) · 7 unmodified lines
276276 return err;
277277 }
278278
279−static int __init twl4030_config_warmreset_sequence(u8 address)
279+static int __devinit twl4030_config_warmreset_sequence(u8 address)
280280 {
281281 int err;
282282 u8 rd_data;
@@ -324,7 +324,7 @@ out: · 41 unmodified lines
324324 return err;
325325 }
326326
327−static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
327+static int __devinit twl4030_configure_resource(struct twl4030_resconfig *rconfig)
328328 {
329329 int rconfig_addr;
330330 int err;
@@ -416,7 +416,7 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig) · 85 unmodified lines
416416 return 0;
417417 }
418418
419−static int __init load_twl4030_script(struct twl4030_script *tscript,
419+static int __devinit load_twl4030_script(struct twl4030_script *tscript,
420420 u8 address)
421421 {
422422 int err;
@@ -527,7 +527,7 @@ void twl4030_power_off(void) · 104 unmodified lines
527527 pr_err("TWL4030 Unable to power off\n");
528528 }
529529
530−void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts)
530+void __devinit twl4030_power_init(struct twl4030_power_data *twl4030_scripts)
531531 {
532532 int err = 0;
533533 int i;
drivers/mfd/twl6040-core.c+77−51
@@ -282,6 +282,7 @@ int twl6040_power(struct twl6040 *twl6040, int on) · 281 unmodified lines
282282 /* Default PLL configuration after power up */
283283 twl6040->pll = TWL6040_SYSCLK_SEL_LPPLL;
284284 twl6040->sysclk = 19200000;
285+ twl6040->mclk = 32768;
285286 } else {
286287 /* already powered-down */
287288 if (!twl6040->power_count) {
@@ -305,6 +306,7 @@ int twl6040_power(struct twl6040 *twl6040, int on) · 17 unmodified lines
305306 twl6040_power_down(twl6040);
306307 }
307308 twl6040->sysclk = 0;
309+ twl6040->mclk = 0;
308310 }
309311
310312 out:
@@ -324,23 +326,38 @@ int twl6040_set_pll(struct twl6040 *twl6040, int pll_id, · 13 unmodified lines
324326 hppllctl = twl6040_reg_read(twl6040, TWL6040_REG_HPPLLCTL);
325327 lppllctl = twl6040_reg_read(twl6040, TWL6040_REG_LPPLLCTL);
326328
329+ /* Force full reconfiguration when switching between PLL */
330+ if (pll_id != twl6040->pll) {
331+ twl6040->sysclk = 0;
332+ twl6040->mclk = 0;
333+ }
334+
327335 switch (pll_id) {
328336 case TWL6040_SYSCLK_SEL_LPPLL:
329337 /* low-power PLL divider */
330− switch (freq_out) {
331− case 17640000:
332− lppllctl |= TWL6040_LPLLFIN;
333− break;
334− case 19200000:
335− lppllctl &= ~TWL6040_LPLLFIN;
336− break;
337− default:
338− dev_err(twl6040->dev,
339− "freq_out %d not supported\n", freq_out);
340− ret = -EINVAL;
341− goto pll_out;
338+ /* Change the sysclk configuration only if it has been canged */
339+ if (twl6040->sysclk != freq_out) {
340+ switch (freq_out) {
341+ case 17640000:
342+ lppllctl |= TWL6040_LPLLFIN;
343+ break;
344+ case 19200000:
345+ lppllctl &= ~TWL6040_LPLLFIN;
346+ break;
347+ default:
348+ dev_err(twl6040->dev,
349+ "freq_out %d not supported\n",
350+ freq_out);
351+ ret = -EINVAL;
352+ goto pll_out;
353+ }
354+ twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL,
355+ lppllctl);
342356 }
343− twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
357+
358+ /* The PLL in use has not been change, we can exit */
359+ if (twl6040->pll == pll_id)
360+ break;
344361
345362 switch (freq_in) {
346363 case 32768:
@@ -371,48 +388,56 @@ int twl6040_set_pll(struct twl6040 *twl6040, int pll_id, · 24 unmodified lines
371388 goto pll_out;
372389 }
373390
374− hppllctl &= ~TWL6040_MCLK_MSK;
391+ if (twl6040->mclk != freq_in) {
392+ hppllctl &= ~TWL6040_MCLK_MSK;
393+
394+ switch (freq_in) {
395+ case 12000000:
396+ /* PLL enabled, active mode */
397+ hppllctl |= TWL6040_MCLK_12000KHZ |
398+ TWL6040_HPLLENA;
399+ break;
400+ case 19200000:
401+ /*
402+ * PLL disabled
403+ * (enable PLL if MCLK jitter quality
404+ * doesn't meet specification)
405+ */
406+ hppllctl |= TWL6040_MCLK_19200KHZ;
407+ break;
408+ case 26000000:
409+ /* PLL enabled, active mode */
410+ hppllctl |= TWL6040_MCLK_26000KHZ |
411+ TWL6040_HPLLENA;
412+ break;
413+ case 38400000:
414+ /* PLL enabled, active mode */
415+ hppllctl |= TWL6040_MCLK_38400KHZ |
416+ TWL6040_HPLLENA;
417+ break;
418+ default:
419+ dev_err(twl6040->dev,
420+ "freq_in %d not supported\n", freq_in);
421+ ret = -EINVAL;
422+ goto pll_out;
423+ }
375424
376− switch (freq_in) {
377− case 12000000:
378− /* PLL enabled, active mode */
379− hppllctl |= TWL6040_MCLK_12000KHZ |
380− TWL6040_HPLLENA;
381− break;
382− case 19200000:
383425 /*
384− * PLL disabled
385− * (enable PLL if MCLK jitter quality
386− * doesn't meet specification)
426+ * enable clock slicer to ensure input waveform is
427+ * square
387428 */
388− hppllctl |= TWL6040_MCLK_19200KHZ;
389− break;
390− case 26000000:
391− /* PLL enabled, active mode */
392− hppllctl |= TWL6040_MCLK_26000KHZ |
393− TWL6040_HPLLENA;
394− break;
395− case 38400000:
396− /* PLL enabled, active mode */
397− hppllctl |= TWL6040_MCLK_38400KHZ |
398− TWL6040_HPLLENA;
399− break;
400− default:
401− dev_err(twl6040->dev,
402− "freq_in %d not supported\n", freq_in);
403− ret = -EINVAL;
404− goto pll_out;
405− }
429+ hppllctl |= TWL6040_HPLLSQRENA;
406430
407− /* enable clock slicer to ensure input waveform is square */
408− hppllctl |= TWL6040_HPLLSQRENA;
409−
410− twl6040_reg_write(twl6040, TWL6040_REG_HPPLLCTL, hppllctl);
411− usleep_range(500, 700);
412− lppllctl |= TWL6040_HPLLSEL;
413− twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
414− lppllctl &= ~TWL6040_LPLLENA;
415− twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
431+ twl6040_reg_write(twl6040, TWL6040_REG_HPPLLCTL,
432+ hppllctl);
433+ usleep_range(500, 700);
434+ lppllctl |= TWL6040_HPLLSEL;
435+ twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL,
436+ lppllctl);
437+ lppllctl &= ~TWL6040_LPLLENA;
438+ twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL,
439+ lppllctl);
440+ }
416441 break;
417442 default:
418443 dev_err(twl6040->dev, "unknown pll id %d\n", pll_id);
@@ -421,6 +446,7 @@ int twl6040_set_pll(struct twl6040 *twl6040, int pll_id, · 2 unmodified lines
421446 }
422447
423448 twl6040->sysclk = freq_out;
449+ twl6040->mclk = freq_in;
424450 twl6040->pll = pll_id;
425451
426452 pll_out:
drivers/misc/Kconfig+3−14
@@ -2,24 +2,14 @@ · 1 unmodified line
22 # Misc strange devices
33 #
44
5−# This one has to live outside of the MISC_DEVICES conditional,
6−# because it may be selected by drivers/platform/x86/hp_accel.
5+menu "Misc devices"
6+
77 config SENSORS_LIS3LV02D
88 tristate
99 depends on INPUT
1010 select INPUT_POLLDEV
1111 default n
1212
13−menuconfig MISC_DEVICES
14− bool "Misc devices"
15− ---help---
16− Say Y here to get to see options for device drivers from various
17− different categories. This option alone does not add any kernel code.
18−
19− If you say N, all options in this submenu will be skipped and disabled.
20−
21−if MISC_DEVICES
22−
2313 config AD525X_DPOT
2414 tristate "Analog Devices Digital Potentiometers"
2515 depends on (I2C || SPI) && SYSFS
@@ -516,5 +506,4 @@ source "drivers/misc/ti-st/Kconfig" · 490 unmodified lines
516506 source "drivers/misc/lis3lv02d/Kconfig"
517507 source "drivers/misc/carma/Kconfig"
518508 source "drivers/misc/altera-stapl/Kconfig"
519−
520−endif # MISC_DEVICES
509+endmenu
drivers/misc/c2port/c2port-duramar2150.c+1−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/module.h>
1616 #include <linux/delay.h>
1717 #include <linux/io.h>
18+#include <linux/ioport.h>
1819 #include <linux/c2port.h>
1920
2021 #define DATA_PORT 0x325
drivers/misc/cb710/core.c+1−0
@@ -245,6 +245,7 @@ static int __devinit cb710_probe(struct pci_dev *pdev, · 244 unmodified lines
245245 if (err)
246246 return err;
247247
248+ spin_lock_init(&chip->irq_lock);
248249 chip->pdev = pdev;
249250 chip->iobase = pcim_iomap_table(pdev)[0];
250251
drivers/misc/cs5535-mfgpt.c+1−1
@@ -262,7 +262,7 @@ static void __init reset_all_timers(void) · 261 unmodified lines
262262 * In other cases (such as with VSAless OpenFirmware), the system firmware
263263 * leaves timers available for us to use.
264264 */
265−static int __init scan_timers(struct cs5535_mfgpt_chip *mfgpt)
265+static int __devinit scan_timers(struct cs5535_mfgpt_chip *mfgpt)
266266 {
267267 struct cs5535_mfgpt_timer timer = { .chip = mfgpt };
268268 unsigned long flags;
drivers/misc/lkdtm.c+5−1
@@ -354,6 +354,7 @@ static void lkdtm_do_action(enum ctype which) · 353 unmodified lines
354354 static void lkdtm_handler(void)
355355 {
356356 unsigned long flags;
357+ bool do_it = false;
357358
358359 spin_lock_irqsave(&count_lock, flags);
359360 count--;
@@ -361,10 +362,13 @@ static void lkdtm_handler(void) · 1 unmodified line
361362 cp_name_to_str(cpoint), cp_type_to_str(cptype), count);
362363
363364 if (count == 0) {
364− lkdtm_do_action(cptype);
365+ do_it = true;
365366 count = cpoint_count;
366367 }
367368 spin_unlock_irqrestore(&count_lock, flags);
369+
370+ if (do_it)
371+ lkdtm_do_action(cptype);
368372 }
369373
370374 static int lkdtm_register_cpoint(enum cname which)
drivers/misc/vmw_balloon.c+7−7
@@ -314,7 +314,7 @@ static bool vmballoon_send_get_target(struct vmballoon *b, u32 *new_target) · 313 unmodified lines
314314 * fear that guest will need it. Host may reject some pages, we need to
315315 * check the return value and maybe submit a different page.
316316 */
317−static bool vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn,
317+static int vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn,
318318 unsigned int *hv_status)
319319 {
320320 unsigned long status, dummy;
@@ -322,17 +322,17 @@ static bool vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn, · 1 unmodified line
322322
323323 pfn32 = (u32)pfn;
324324 if (pfn32 != pfn)
325− return false;
325+ return -1;
326326
327327 STATS_INC(b->stats.lock);
328328
329329 *hv_status = status = VMWARE_BALLOON_CMD(LOCK, pfn, dummy);
330330 if (vmballoon_check_status(b, status))
331− return true;
331+ return 0;
332332
333333 pr_debug("%s - ppn %lx, hv returns %ld\n", __func__, pfn, status);
334334 STATS_INC(b->stats.lock_fail);
335− return false;
335+ return 1;
336336 }
337337
338338 /*
@@ -411,7 +411,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep) · 72 unmodified lines
411411 struct page *page;
412412 gfp_t flags;
413413 unsigned int hv_status;
414− bool locked = false;
414+ int locked;
415415 flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP;
416416
417417 do {
@@ -431,7 +431,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep) · 13 unmodified lines
431431
432432 /* inform monitor */
433433 locked = vmballoon_send_lock_page(b, page_to_pfn(page), &hv_status);
434− if (!locked) {
434+ if (locked > 0) {
435435 STATS_INC(b->stats.refused_alloc);
436436
437437 if (hv_status == VMW_BALLOON_ERROR_RESET ||
@@ -449,7 +449,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep) · 11 unmodified lines
449449 if (++b->n_refused_pages >= VMW_BALLOON_MAX_REFUSED)
450450 return -EIO;
451451 }
452− } while (!locked);
452+ } while (locked != 0);
453453
454454 /* track allocated page */
455455 list_add(&page->lru, &b->pages);
drivers/mmc/card/block.c+1−0
@@ -1694,6 +1694,7 @@ static int mmc_add_disk(struct mmc_blk_data *md) · 1693 unmodified lines
16941694
16951695 md->power_ro_lock.show = power_ro_lock_show;
16961696 md->power_ro_lock.store = power_ro_lock_store;
1697+ sysfs_attr_init(&md->power_ro_lock.attr);
16971698 md->power_ro_lock.attr.mode = mode;
16981699 md->power_ro_lock.attr.name =
16991700 "ro_lock_until_next_power_on";
drivers/mmc/core/core.c+39−10
@@ -290,8 +290,11 @@ static void mmc_wait_for_req_done(struct mmc_host *host, · 289 unmodified lines
290290 static void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq,
291291 bool is_first_req)
292292 {
293− if (host->ops->pre_req)
293+ if (host->ops->pre_req) {
294+ mmc_host_clk_hold(host);
294295 host->ops->pre_req(host, mrq, is_first_req);
296+ mmc_host_clk_release(host);
297+ }
295298 }
296299
297300 /**
@@ -306,8 +309,11 @@ static void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq, · 8 unmodified lines
306309 static void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq,
307310 int err)
308311 {
309− if (host->ops->post_req)
312+ if (host->ops->post_req) {
313+ mmc_host_clk_hold(host);
310314 host->ops->post_req(host, mrq, err);
315+ mmc_host_clk_release(host);
316+ }
311317 }
312318
313319 /**
@@ -620,7 +626,9 @@ int mmc_host_enable(struct mmc_host *host) · 306 unmodified lines
620626 int err;
621627
622628 host->en_dis_recurs = 1;
629+ mmc_host_clk_hold(host);
623630 err = host->ops->enable(host);
631+ mmc_host_clk_release(host);
624632 host->en_dis_recurs = 0;
625633
626634 if (err) {
@@ -640,7 +648,9 @@ static int mmc_host_do_disable(struct mmc_host *host, int lazy) · 13 unmodified lines
640648 int err;
641649
642650 host->en_dis_recurs = 1;
651+ mmc_host_clk_hold(host);
643652 err = host->ops->disable(host, lazy);
653+ mmc_host_clk_release(host);
644654 host->en_dis_recurs = 0;
645655
646656 if (err < 0) {
@@ -1121,6 +1131,10 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc, · 474 unmodified lines
11211131 * might not allow this operation
11221132 */
11231133 voltage = regulator_get_voltage(supply);
1134+
1135+ if (mmc->caps2 & MMC_CAP2_BROKEN_VOLTAGE)
1136+ min_uV = max_uV = voltage;
1137+
11241138 if (voltage < 0)
11251139 result = voltage;
11261140 else if (voltage < min_uV || voltage > max_uV)
@@ -1203,8 +1217,11 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, bool cmd11 · 76 unmodified lines
12031217
12041218 host->ios.signal_voltage = signal_voltage;
12051219
1206− if (host->ops->start_signal_voltage_switch)
1220+ if (host->ops->start_signal_voltage_switch) {
1221+ mmc_host_clk_hold(host);
12071222 err = host->ops->start_signal_voltage_switch(host, &host->ios);
1223+ mmc_host_clk_release(host);
1224+ }
12081225
12091226 return err;
12101227 }
@@ -1239,6 +1256,7 @@ static void mmc_poweroff_notify(struct mmc_host *host) · 28 unmodified lines
12391256 int err = 0;
12401257
12411258 card = host->card;
1259+ mmc_claim_host(host);
12421260
12431261 /*
12441262 * Send power notify command only if card
@@ -1269,6 +1287,7 @@ static void mmc_poweroff_notify(struct mmc_host *host) · 24 unmodified lines
12691287 /* Set the card state to no notification after the poweroff */
12701288 card->poweroff_notify_state = MMC_NO_POWER_NOTIFICATION;
12711289 }
1290+ mmc_release_host(host);
12721291 }
12731292
12741293 /*
@@ -1327,12 +1346,28 @@ static void mmc_power_up(struct mmc_host *host) · 52 unmodified lines
13271346
13281347 void mmc_power_off(struct mmc_host *host)
13291348 {
1349+ int err = 0;
13301350 mmc_host_clk_hold(host);
13311351
13321352 host->ios.clock = 0;
13331353 host->ios.vdd = 0;
13341354
1335− mmc_poweroff_notify(host);
1355+ /*
1356+ * For eMMC 4.5 device send AWAKE command before
1357+ * POWER_OFF_NOTIFY command, because in sleep state
1358+ * eMMC 4.5 devices respond to only RESET and AWAKE cmd
1359+ */
1360+ if (host->card && mmc_card_is_sleep(host->card) &&
1361+ host->bus_ops->resume) {
1362+ err = host->bus_ops->resume(host);
1363+
1364+ if (!err)
1365+ mmc_poweroff_notify(host);
1366+ else
1367+ pr_warning("%s: error %d during resume "
1368+ "(continue with poweroff sequence)\n",
1369+ mmc_hostname(host), err);
1370+ }
13361371
13371372 /*
13381373 * Reset ocr mask to be the highest possible voltage supported for
@@ -2386,12 +2421,6 @@ int mmc_suspend_host(struct mmc_host *host) · 1047 unmodified lines
23862421 */
23872422 if (mmc_try_claim_host(host)) {
23882423 if (host->bus_ops->suspend) {
2389− /*
2390− * For eMMC 4.5 device send notify command
2391− * before sleep, because in sleep state eMMC 4.5
2392− * devices respond to only RESET and AWAKE cmd
2393− */
2394− mmc_poweroff_notify(host);
23952424 err = host->bus_ops->suspend(host);
23962425 }
23972426 mmc_do_release_host(host);
drivers/mmc/core/host.h+0−21
@@ -14,27 +14,6 @@ · 13 unmodified lines
1414
1515 int mmc_register_host_class(void);
1616 void mmc_unregister_host_class(void);
17−
18−#ifdef CONFIG_MMC_CLKGATE
19−void mmc_host_clk_hold(struct mmc_host *host);
20−void mmc_host_clk_release(struct mmc_host *host);
21−unsigned int mmc_host_clk_rate(struct mmc_host *host);
22−
23−#else
24−static inline void mmc_host_clk_hold(struct mmc_host *host)
25−{
26−}
27−
28−static inline void mmc_host_clk_release(struct mmc_host *host)
29−{
30−}
31−
32−static inline unsigned int mmc_host_clk_rate(struct mmc_host *host)
33−{
34− return host->ios.clock;
35−}
36−#endif
37−
3817 void mmc_host_deeper_disable(struct work_struct *work);
3918
4019 #endif
drivers/mmc/core/mmc.c+17−9
@@ -376,7 +376,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) · 375 unmodified lines
376376 }
377377
378378 card->ext_csd.raw_hc_erase_gap_size =
379− ext_csd[EXT_CSD_PARTITION_ATTRIBUTE];
379+ ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
380380 card->ext_csd.raw_sec_trim_mult =
381381 ext_csd[EXT_CSD_SEC_TRIM_MULT];
382382 card->ext_csd.raw_sec_erase_mult =
@@ -551,7 +551,7 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width) · 168 unmodified lines
551551 goto out;
552552
553553 /* only compare read only fields */
554− err = (!(card->ext_csd.raw_partition_support ==
554+ err = !((card->ext_csd.raw_partition_support ==
555555 bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) &&
556556 (card->ext_csd.raw_erased_mem_count ==
557557 bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) &&
@@ -1006,7 +1006,8 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, · 448 unmodified lines
10061006 err = mmc_select_hs200(card);
10071007 else if (host->caps & MMC_CAP_MMC_HIGHSPEED)
10081008 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
1009− EXT_CSD_HS_TIMING, 1, 0);
1009+ EXT_CSD_HS_TIMING, 1,
1010+ card->ext_csd.generic_cmd6_time);
10101011
10111012 if (err && err != -EBADMSG)
10121013 goto free_card;
@@ -1116,7 +1117,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, · 103 unmodified lines
11161117 * Activate wide bus and DDR (if supported).
11171118 */
11181119 if (!mmc_card_hs200(card) &&
1119− (card->csd.mmca_vsn >= CSD_SPEC_VER_3) &&
1120+ (card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
11201121 (host->caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA))) {
11211122 static unsigned ext_csd_bits[][2] = {
11221123 { EXT_CSD_BUS_WIDTH_8, EXT_CSD_DDR_BUS_WIDTH_8 },
@@ -1315,11 +1316,13 @@ static int mmc_suspend(struct mmc_host *host) · 192 unmodified lines
13151316 BUG_ON(!host->card);
13161317
13171318 mmc_claim_host(host);
1318− if (mmc_card_can_sleep(host))
1319+ if (mmc_card_can_sleep(host)) {
13191320 err = mmc_card_sleep(host);
1320− else if (!mmc_host_is_spi(host))
1321+ if (!err)
1322+ mmc_card_set_sleep(host->card);
1323+ } else if (!mmc_host_is_spi(host))
13211324 mmc_deselect_cards(host);
1322− host->card->state &= ~MMC_STATE_HIGHSPEED;
1325+ host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200);
13231326 mmc_release_host(host);
13241327
13251328 return err;
@@ -1339,7 +1342,11 @@ static int mmc_resume(struct mmc_host *host) · 13 unmodified lines
13391342 BUG_ON(!host->card);
13401343
13411344 mmc_claim_host(host);
1342− err = mmc_init_card(host, host->ocr, host->card);
1345+ if (mmc_card_is_sleep(host->card)) {
1346+ err = mmc_card_awake(host);
1347+ mmc_card_clr_sleep(host->card);
1348+ } else
1349+ err = mmc_init_card(host, host->ocr, host->card);
13431350 mmc_release_host(host);
13441351
13451352 return err;
@@ -1349,7 +1356,8 @@ static int mmc_power_restore(struct mmc_host *host) · 3 unmodified lines
13491356 {
13501357 int ret;
13511358
1352− host->card->state &= ~MMC_STATE_HIGHSPEED;
1359+ host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200);
1360+ mmc_card_clr_sleep(host->card);
13531361 mmc_claim_host(host);
13541362 ret = mmc_init_card(host, host->ocr, host->card);
13551363 mmc_release_host(host);
drivers/mmc/core/sd.c+18−4
@@ -451,9 +451,11 @@ static int sd_select_driver_type(struct mmc_card *card, u8 *status) · 450 unmodified lines
451451 * information and let the hardware specific code
452452 * return what is possible given the options
453453 */
454+ mmc_host_clk_hold(card->host);
454455 drive_strength = card->host->ops->select_drive_strength(
455456 card->sw_caps.uhs_max_dtr,
456457 host_drv_type, card_drv_type);
458+ mmc_host_clk_release(card->host);
457459
458460 err = mmc_sd_switch(card, 1, 2, drive_strength, status);
459461 if (err)
@@ -660,9 +662,12 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card) · 200 unmodified lines
660662 goto out;
661663
662664 /* SPI mode doesn't define CMD19 */
663− if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning)
665+ if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning) {
666+ mmc_host_clk_hold(card->host);
664667 err = card->host->ops->execute_tuning(card->host,
665668 MMC_SEND_TUNING_BLOCK);
669+ mmc_host_clk_release(card->host);
670+ }
666671
667672 out:
668673 kfree(status);
@@ -850,8 +855,11 @@ int mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card, · 181 unmodified lines
850855 if (!reinit) {
851856 int ro = -1;
852857
853− if (host->ops->get_ro)
858+ if (host->ops->get_ro) {
859+ mmc_host_clk_hold(card->host);
854860 ro = host->ops->get_ro(host);
861+ mmc_host_clk_release(card->host);
862+ }
855863
856864 if (ro < 0) {
857865 pr_warning("%s: host does not "
@@ -967,8 +975,11 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, · 109 unmodified lines
967975 * Since initialization is now complete, enable preset
968976 * value registers for UHS-I cards.
969977 */
970− if (host->ops->enable_preset_value)
978+ if (host->ops->enable_preset_value) {
979+ mmc_host_clk_hold(card->host);
971980 host->ops->enable_preset_value(host, true);
981+ mmc_host_clk_release(card->host);
982+ }
972983 } else {
973984 /*
974985 * Attempt to change to high-speed (if supported)
@@ -1151,8 +1162,11 @@ int mmc_attach_sd(struct mmc_host *host) · 176 unmodified lines
11511162 return err;
11521163
11531164 /* Disable preset value enable if already set since last time */
1154− if (host->ops->enable_preset_value)
1165+ if (host->ops->enable_preset_value) {
1166+ mmc_host_clk_hold(host);
11551167 host->ops->enable_preset_value(host, false);
1168+ mmc_host_clk_release(host);
1169+ }
11561170
11571171 err = mmc_send_app_op_cond(host, 0, &ocr);
11581172 if (err)
drivers/mmc/core/sdio.c+4−3
@@ -98,10 +98,11 @@ fail: · 97 unmodified lines
9898 return ret;
9999 }
100100
101−static int sdio_read_cccr(struct mmc_card *card)
101+static int sdio_read_cccr(struct mmc_card *card, u32 ocr)
102102 {
103103 int ret;
104104 int cccr_vsn;
105+ int uhs = ocr & R4_18V_PRESENT;
105106 unsigned char data;
106107 unsigned char speed;
107108
@@ -149,7 +150,7 @@ static int sdio_read_cccr(struct mmc_card *card) · 41 unmodified lines
149150 card->scr.sda_spec3 = 0;
150151 card->sw_caps.sd3_bus_mode = 0;
151152 card->sw_caps.sd3_drv_type = 0;
152− if (cccr_vsn >= SDIO_CCCR_REV_3_00) {
153+ if (cccr_vsn >= SDIO_CCCR_REV_3_00 && uhs) {
153154 card->scr.sda_spec3 = 1;
154155 ret = mmc_io_rw_direct(card, 0, 0,
155156 SDIO_CCCR_UHS, 0, &data);
@@ -712,7 +713,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, · 556 unmodified lines
712713 /*
713714 * Read the common registers.
714715 */
715− err = sdio_read_cccr(card);
716+ err = sdio_read_cccr(card, ocr);
716717 if (err)
717718 goto remove;
718719
drivers/mmc/core/sdio_irq.c+8−2
@@ -146,15 +146,21 @@ static int sdio_irq_thread(void *_host) · 145 unmodified lines
146146 }
147147
148148 set_current_state(TASK_INTERRUPTIBLE);
149− if (host->caps & MMC_CAP_SDIO_IRQ)
149+ if (host->caps & MMC_CAP_SDIO_IRQ) {
150+ mmc_host_clk_hold(host);
150151 host->ops->enable_sdio_irq(host, 1);
152+ mmc_host_clk_release(host);
153+ }
151154 if (!kthread_should_stop())
152155 schedule_timeout(period);
153156 set_current_state(TASK_RUNNING);
154157 } while (!kthread_should_stop());
155158
156− if (host->caps & MMC_CAP_SDIO_IRQ)
159+ if (host->caps & MMC_CAP_SDIO_IRQ) {
160+ mmc_host_clk_hold(host);
157161 host->ops->enable_sdio_irq(host, 0);
162+ mmc_host_clk_release(host);
163+ }
158164
159165 pr_debug("%s: IRQ thread exiting with code %d\n",
160166 mmc_hostname(host), ret);
drivers/mmc/host/Kconfig+0−1
@@ -477,7 +477,6 @@ config MMC_SDHI · 476 unmodified lines
477477 config MMC_CB710
478478 tristate "ENE CB710 MMC/SD Interface support"
479479 depends on PCI
480− select MISC_DEVICES
481480 select CB710_CORE
482481 help
483482 This option enables support for MMC/SD part of ENE CB710/720 Flash
drivers/mmc/host/atmel-mci.c+3−0
@@ -969,11 +969,14 @@ static void atmci_start_request(struct atmel_mci *host, · 968 unmodified lines
969969 host->data_status = 0;
970970
971971 if (host->need_reset) {
972+ iflags = atmci_readl(host, ATMCI_IMR);
973+ iflags &= (ATMCI_SDIOIRQA | ATMCI_SDIOIRQB);
972974 atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
973975 atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
974976 atmci_writel(host, ATMCI_MR, host->mode_reg);
975977 if (host->caps.has_cfg_reg)
976978 atmci_writel(host, ATMCI_CFG, host->cfg_reg);
979+ atmci_writel(host, ATMCI_IER, iflags);
977980 host->need_reset = false;
978981 }
979982 atmci_writel(host, ATMCI_SDCR, slot->sdc_reg);
drivers/mmc/host/dw_mmc.c+75−69
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #include <linux/ioport.h>
2323 #include <linux/module.h>
2424 #include <linux/platform_device.h>
25−#include <linux/scatterlist.h>
2625 #include <linux/seq_file.h>
2726 #include <linux/slab.h>
2827 #include <linux/stat.h>
@@ -502,8 +501,14 @@ static void dw_mci_submit_data(struct dw_mci *host, struct mmc_data *data) · 473 unmodified lines
502501 host->dir_status = DW_MCI_SEND_STATUS;
503502
504503 if (dw_mci_submit_data_dma(host, data)) {
504+ int flags = SG_MITER_ATOMIC;
505+ if (host->data->flags & MMC_DATA_READ)
506+ flags |= SG_MITER_TO_SG;
507+ else
508+ flags |= SG_MITER_FROM_SG;
509+
510+ sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags);
505511 host->sg = data->sg;
506− host->pio_offset = 0;
507512 host->part_buf_start = 0;
508513 host->part_buf_count = 0;
509514
@@ -972,6 +977,7 @@ static void dw_mci_tasklet_func(unsigned long priv) · 462 unmodified lines
972977 * generates a block interrupt, hence setting
973978 * the scatter-gather pointer to NULL.
974979 */
980+ sg_miter_stop(&host->sg_miter);
975981 host->sg = NULL;
976982 ctrl = mci_readl(host, CTRL);
977983 ctrl |= SDMMC_CTRL_FIFO_RESET;
@@ -1311,54 +1317,44 @@ static void dw_mci_pull_data(struct dw_mci *host, void *buf, int cnt) · 333 unmodified lines
13111317
13121318 static void dw_mci_read_data_pio(struct dw_mci *host)
13131319 {
1314− struct scatterlist *sg = host->sg;
1315− void *buf = sg_virt(sg);
1316− unsigned int offset = host->pio_offset;
1320+ struct sg_mapping_iter *sg_miter = &host->sg_miter;
1321+ void *buf;
1322+ unsigned int offset;
13171323 struct mmc_data *data = host->data;
13181324 int shift = host->data_shift;
13191325 u32 status;
13201326 unsigned int nbytes = 0, len;
1327+ unsigned int remain, fcnt;
13211328
13221329 do {
1323− len = host->part_buf_count +
1324− (SDMMC_GET_FCNT(mci_readl(host, STATUS)) << shift);
1325− if (offset + len <= sg->length) {
1330+ if (!sg_miter_next(sg_miter))
1331+ goto done;
1332+
1333+ host->sg = sg_miter->__sg;
1334+ buf = sg_miter->addr;
1335+ remain = sg_miter->length;
1336+ offset = 0;
1337+
1338+ do {
1339+ fcnt = (SDMMC_GET_FCNT(mci_readl(host, STATUS))
1340+ << shift) + host->part_buf_count;
1341+ len = min(remain, fcnt);
1342+ if (!len)
1343+ break;
13261344 dw_mci_pull_data(host, (void *)(buf + offset), len);
1327−
13281345 offset += len;
13291346 nbytes += len;
1330−
1331− if (offset == sg->length) {
1332− flush_dcache_page(sg_page(sg));
1333− host->sg = sg = sg_next(sg);
1334− if (!sg)
1335− goto done;
1336−
1337− offset = 0;
1338− buf = sg_virt(sg);
1339− }
1340− } else {
1341− unsigned int remaining = sg->length - offset;
1342− dw_mci_pull_data(host, (void *)(buf + offset),
1343− remaining);
1344− nbytes += remaining;
1345−
1346− flush_dcache_page(sg_page(sg));
1347− host->sg = sg = sg_next(sg);
1348− if (!sg)
1349− goto done;
1350−
1351− offset = len - remaining;
1352− buf = sg_virt(sg);
1353− dw_mci_pull_data(host, buf, offset);
1354− nbytes += offset;
1355− }
1347+ remain -= len;
1348+ } while (remain);
1349+ sg_miter->consumed = offset;
13561350
13571351 status = mci_readl(host, MINTSTS);
13581352 mci_writel(host, RINTSTS, SDMMC_INT_RXDR);
13591353 if (status & DW_MCI_DATA_ERROR_FLAGS) {
13601354 host->data_status = status;
13611355 data->bytes_xfered += nbytes;
1356+ sg_miter_stop(sg_miter);
1357+ host->sg = NULL;
13621358 smp_wmb();
13631359
13641360 set_bit(EVENT_DATA_ERROR, &host->pending_events);
@@ -1367,65 +1363,66 @@ static void dw_mci_read_data_pio(struct dw_mci *host) · 2 unmodified lines
13671363 return;
13681364 }
13691365 } while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/
1370− host->pio_offset = offset;
13711366 data->bytes_xfered += nbytes;
1367+
1368+ if (!remain) {
1369+ if (!sg_miter_next(sg_miter))
1370+ goto done;
1371+ sg_miter->consumed = 0;
1372+ }
1373+ sg_miter_stop(sg_miter);
13721374 return;
13731375
13741376 done:
13751377 data->bytes_xfered += nbytes;
1378+ sg_miter_stop(sg_miter);
1379+ host->sg = NULL;
13761380 smp_wmb();
13771381 set_bit(EVENT_XFER_COMPLETE, &host->pending_events);
13781382 }
13791383
13801384 static void dw_mci_write_data_pio(struct dw_mci *host)
13811385 {
1382− struct scatterlist *sg = host->sg;
1383− void *buf = sg_virt(sg);
1384− unsigned int offset = host->pio_offset;
1386+ struct sg_mapping_iter *sg_miter = &host->sg_miter;
1387+ void *buf;
1388+ unsigned int offset;
13851389 struct mmc_data *data = host->data;
13861390 int shift = host->data_shift;
13871391 u32 status;
13881392 unsigned int nbytes = 0, len;
1393+ unsigned int fifo_depth = host->fifo_depth;
1394+ unsigned int remain, fcnt;
13891395
13901396 do {
1391− len = ((host->fifo_depth -
1392− SDMMC_GET_FCNT(mci_readl(host, STATUS))) << shift)
1393− - host->part_buf_count;
1394− if (offset + len <= sg->length) {
1397+ if (!sg_miter_next(sg_miter))
1398+ goto done;
1399+
1400+ host->sg = sg_miter->__sg;
1401+ buf = sg_miter->addr;
1402+ remain = sg_miter->length;
1403+ offset = 0;
1404+
1405+ do {
1406+ fcnt = ((fifo_depth -
1407+ SDMMC_GET_FCNT(mci_readl(host, STATUS)))
1408+ << shift) - host->part_buf_count;
1409+ len = min(remain, fcnt);
1410+ if (!len)
1411+ break;
13951412 host->push_data(host, (void *)(buf + offset), len);
1396−
13971413 offset += len;
13981414 nbytes += len;
1399− if (offset == sg->length) {
1400− host->sg = sg = sg_next(sg);
1401− if (!sg)
1402− goto done;
1403−
1404− offset = 0;
1405− buf = sg_virt(sg);
1406− }
1407− } else {
1408− unsigned int remaining = sg->length - offset;
1409−
1410− host->push_data(host, (void *)(buf + offset),
1411− remaining);
1412− nbytes += remaining;
1413−
1414− host->sg = sg = sg_next(sg);
1415− if (!sg)
1416− goto done;
1417−
1418− offset = len - remaining;
1419− buf = sg_virt(sg);
1420− host->push_data(host, (void *)buf, offset);
1421− nbytes += offset;
1422− }
1415+ remain -= len;
1416+ } while (remain);
1417+ sg_miter->consumed = offset;
14231418
14241419 status = mci_readl(host, MINTSTS);
14251420 mci_writel(host, RINTSTS, SDMMC_INT_TXDR);
14261421 if (status & DW_MCI_DATA_ERROR_FLAGS) {
14271422 host->data_status = status;
14281423 data->bytes_xfered += nbytes;
1424+ sg_miter_stop(sg_miter);
1425+ host->sg = NULL;
14291426
14301427 smp_wmb();
14311428
@@ -1435,12 +1432,20 @@ static void dw_mci_write_data_pio(struct dw_mci *host) · 3 unmodified lines
14351432 return;
14361433 }
14371434 } while (status & SDMMC_INT_TXDR); /* if TXDR write again */
1438− host->pio_offset = offset;
14391435 data->bytes_xfered += nbytes;
1436+
1437+ if (!remain) {
1438+ if (!sg_miter_next(sg_miter))
1439+ goto done;
1440+ sg_miter->consumed = 0;
1441+ }
1442+ sg_miter_stop(sg_miter);
14401443 return;
14411444
14421445 done:
14431446 data->bytes_xfered += nbytes;
1447+ sg_miter_stop(sg_miter);
1448+ host->sg = NULL;
14441449 smp_wmb();
14451450 set_bit(EVENT_XFER_COMPLETE, &host->pending_events);
14461451 }
@@ -1643,6 +1648,7 @@ static void dw_mci_work_routine_card(struct work_struct *work) · 196 unmodified lines
16431648 * block interrupt, hence setting the
16441649 * scatter-gather pointer to NULL.
16451650 */
1651+ sg_miter_stop(&host->sg_miter);
16461652 host->sg = NULL;
16471653
16481654 ctrl = mci_readl(host, CTRL);
drivers/mmc/host/of_mmc_spi.c+2−2
@@ -113,8 +113,8 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi) · 112 unmodified lines
113113 const int j = i * 2;
114114 u32 mask;
115115
116− mask = mmc_vddrange_to_ocrmask(voltage_ranges[j],
117− voltage_ranges[j + 1]);
116+ mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
117+ be32_to_cpu(voltage_ranges[j + 1]));
118118 if (!mask) {
119119 ret = -EINVAL;
120120 dev_err(dev, "OF: voltage-range #%d is invalid\n", i);
drivers/mmc/host/sdhci-of-esdhc.c+32−0
@@ -38,6 +38,23 @@ static u8 esdhc_readb(struct sdhci_host *host, int reg) · 37 unmodified lines
3838 int base = reg & ~0x3;
3939 int shift = (reg & 0x3) * 8;
4040 u8 ret = (in_be32(host->ioaddr + base) >> shift) & 0xff;
41+
42+ /*
43+ * "DMA select" locates at offset 0x28 in SD specification, but on
44+ * P5020 or P3041, it locates at 0x29.
45+ */
46+ if (reg == SDHCI_HOST_CONTROL) {
47+ u32 dma_bits;
48+
49+ dma_bits = in_be32(host->ioaddr + reg);
50+ /* DMA select is 22,23 bits in Protocol Control Register */
51+ dma_bits = (dma_bits >> 5) & SDHCI_CTRL_DMA_MASK;
52+
53+ /* fixup the result */
54+ ret &= ~SDHCI_CTRL_DMA_MASK;
55+ ret |= dma_bits;
56+ }
57+
4158 return ret;
4259 }
4360
@@ -56,6 +73,21 @@ static void esdhc_writew(struct sdhci_host *host, u16 val, int reg) · 12 unmodified lines
5673
5774 static void esdhc_writeb(struct sdhci_host *host, u8 val, int reg)
5875 {
76+ /*
77+ * "DMA select" location is offset 0x28 in SD specification, but on
78+ * P5020 or P3041, it's located at 0x29.
79+ */
80+ if (reg == SDHCI_HOST_CONTROL) {
81+ u32 dma_bits;
82+
83+ /* DMA select is 22,23 bits in Protocol Control Register */
84+ dma_bits = (val & SDHCI_CTRL_DMA_MASK) << 5;
85+ clrsetbits_be32(host->ioaddr + reg , SDHCI_CTRL_DMA_MASK << 5,
86+ dma_bits);
87+ val &= ~SDHCI_CTRL_DMA_MASK;
88+ val |= in_be32(host->ioaddr + reg) & SDHCI_CTRL_DMA_MASK;
89+ }
90+
5991 /* Prevent SDHCI core from writing reserved bits (e.g. HISPD). */
6092 if (reg == SDHCI_HOST_CONTROL)
6193 val &= ~ESDHC_HOST_CONTROL_RES;
drivers/mmc/host/sdhci-pci.c+1−1
@@ -250,7 +250,7 @@ static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot) · 249 unmodified lines
250250
251251 static int mfd_sdio_probe_slot(struct sdhci_pci_slot *slot)
252252 {
253− slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD;
253+ slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE;
254254 return 0;
255255 }
256256
drivers/mmc/host/sdhci-pltfm.c+9−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * sdhci-pltfm.c Support for SDHCI platform devices
33 * Copyright (c) 2009 Intel Corporation
44 *
5− * Copyright (c) 2007 Freescale Semiconductor, Inc.
5+ * Copyright (c) 2007, 2011 Freescale Semiconductor, Inc.
66 * Copyright (c) 2009 MontaVista Software, Inc.
77 *
88 * Authors: Xiaobo Xie <X.Xie@freescale.com>
@@ -71,6 +71,14 @@ void sdhci_get_of_property(struct platform_device *pdev) · 62 unmodified lines
7171 if (sdhci_of_wp_inverted(np))
7272 host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
7373
74+ if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc"))
75+ host->quirks |= SDHCI_QUIRK_BROKEN_DMA;
76+
77+ if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
78+ of_device_is_compatible(np, "fsl,p1010-esdhc") ||
79+ of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
80+ host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
81+
7482 clk = of_get_property(np, "clock-frequency", &size);
7583 if (clk && size == sizeof(*clk) && *clk)
7684 pltfm_host->clock = be32_to_cpup(clk);
drivers/mmc/host/sh_mmcif.c+9−7
@@ -1327,7 +1327,7 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev) · 1326 unmodified lines
13271327 if (ret < 0)
13281328 goto clean_up2;
13291329
1330− mmc_add_host(mmc);
1330+ INIT_DELAYED_WORK(&host->timeout_work, mmcif_timeout_work);
13311331
13321332 sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);
13331333
@@ -1338,22 +1338,24 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev) · 4 unmodified lines
13381338 }
13391339 ret = request_threaded_irq(irq[1], sh_mmcif_intr, sh_mmcif_irqt, 0, "sh_mmc:int", host);
13401340 if (ret) {
1341− free_irq(irq[0], host);
13421341 dev_err(&pdev->dev, "request_irq error (sh_mmc:int)\n");
1343− goto clean_up3;
1342+ goto clean_up4;
13441343 }
13451344
1346− INIT_DELAYED_WORK(&host->timeout_work, mmcif_timeout_work);
1347−
1348− mmc_detect_change(host->mmc, 0);
1345+ ret = mmc_add_host(mmc);
1346+ if (ret < 0)
1347+ goto clean_up5;
13491348
13501349 dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
13511350 dev_dbg(&pdev->dev, "chip ver H'%04x\n",
13521351 sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
13531352 return ret;
13541353
1354+clean_up5:
1355+ free_irq(irq[1], host);
1356+clean_up4:
1357+ free_irq(irq[0], host);
13551358 clean_up3:
1356− mmc_remove_host(mmc);
13571359 pm_runtime_suspend(&pdev->dev);
13581360 clean_up2:
13591361 pm_runtime_disable(&pdev->dev);
drivers/mmc/host/tmio_mmc.h+6−1
@@ -20,8 +20,8 @@ · 19 unmodified lines
2020 #include <linux/mmc/tmio.h>
2121 #include <linux/mutex.h>
2222 #include <linux/pagemap.h>
23−#include <linux/spinlock.h>
2423 #include <linux/scatterlist.h>
24+#include <linux/spinlock.h>
2525
2626 /* Definitions for values the CTRL_SDIO_STATUS register can take. */
2727 #define TMIO_SDIO_STAT_IOIRQ 0x0001
@@ -120,6 +120,7 @@ void tmio_mmc_start_dma(struct tmio_mmc_host *host, struct mmc_data *data); · 92 unmodified lines
120120 void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable);
121121 void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata);
122122 void tmio_mmc_release_dma(struct tmio_mmc_host *host);
123+void tmio_mmc_abort_dma(struct tmio_mmc_host *host);
123124 #else
124125 static inline void tmio_mmc_start_dma(struct tmio_mmc_host *host,
125126 struct mmc_data *data)
@@ -140,6 +141,10 @@ static inline void tmio_mmc_request_dma(struct tmio_mmc_host *host, · 14 unmodified lines
140141 static inline void tmio_mmc_release_dma(struct tmio_mmc_host *host)
141142 {
142143 }
144+
145+static inline void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
146+{
147+}
143148 #endif
144149
145150 #ifdef CONFIG_PM
drivers/mmc/host/tmio_mmc_dma.c+12−0
@@ -34,6 +34,18 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable) · 33 unmodified lines
3434 #endif
3535 }
3636
37+void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
38+{
39+ tmio_mmc_enable_dma(host, false);
40+
41+ if (host->chan_rx)
42+ dmaengine_terminate_all(host->chan_rx);
43+ if (host->chan_tx)
44+ dmaengine_terminate_all(host->chan_tx);
45+
46+ tmio_mmc_enable_dma(host, true);
47+}
48+
3749 static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
3850 {
3951 struct scatterlist *sg = host->sg_ptr, *sg_tmp;
drivers/mmc/host/tmio_mmc_pio.c+5−1
@@ -41,8 +41,8 @@ · 40 unmodified lines
4141 #include <linux/platform_device.h>
4242 #include <linux/pm_runtime.h>
4343 #include <linux/scatterlist.h>
44−#include <linux/workqueue.h>
4544 #include <linux/spinlock.h>
45+#include <linux/workqueue.h>
4646
4747 #include "tmio_mmc.h"
4848
@@ -246,6 +246,7 @@ static void tmio_mmc_reset_work(struct work_struct *work) · 197 unmodified lines
246246 /* Ready for new calls */
247247 host->mrq = NULL;
248248
249+ tmio_mmc_abort_dma(host);
249250 mmc_request_done(host->mmc, mrq);
250251 }
251252
@@ -272,6 +273,9 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host) · 20 unmodified lines
272273 host->mrq = NULL;
273274 spin_unlock_irqrestore(&host->lock, flags);
274275
276+ if (mrq->cmd->error || (mrq->data && mrq->data->error))
277+ tmio_mmc_abort_dma(host);
278+
275279 mmc_request_done(host->mmc, mrq);
276280 }
277281
drivers/mtd/mtdcore.c+1−1
@@ -119,7 +119,7 @@ static int mtd_cls_suspend(struct device *dev, pm_message_t state) · 118 unmodified lines
119119 {
120120 struct mtd_info *mtd = dev_get_drvdata(dev);
121121
122− return mtd_suspend(mtd);
122+ return mtd ? mtd_suspend(mtd) : 0;
123123 }
124124
125125 static int mtd_cls_resume(struct device *dev)
drivers/mtd/nand/atmel_nand.c+41−4
@@ -161,6 +161,37 @@ static int atmel_nand_device_ready(struct mtd_info *mtd) · 160 unmodified lines
161161 !!host->board->rdy_pin_active_low;
162162 }
163163
164+/*
165+ * Minimal-overhead PIO for data access.
166+ */
167+static void atmel_read_buf8(struct mtd_info *mtd, u8 *buf, int len)
168+{
169+ struct nand_chip *nand_chip = mtd->priv;
170+
171+ __raw_readsb(nand_chip->IO_ADDR_R, buf, len);
172+}
173+
174+static void atmel_read_buf16(struct mtd_info *mtd, u8 *buf, int len)
175+{
176+ struct nand_chip *nand_chip = mtd->priv;
177+
178+ __raw_readsw(nand_chip->IO_ADDR_R, buf, len / 2);
179+}
180+
181+static void atmel_write_buf8(struct mtd_info *mtd, const u8 *buf, int len)
182+{
183+ struct nand_chip *nand_chip = mtd->priv;
184+
185+ __raw_writesb(nand_chip->IO_ADDR_W, buf, len);
186+}
187+
188+static void atmel_write_buf16(struct mtd_info *mtd, const u8 *buf, int len)
189+{
190+ struct nand_chip *nand_chip = mtd->priv;
191+
192+ __raw_writesw(nand_chip->IO_ADDR_W, buf, len / 2);
193+}
194+
164195 static void dma_complete_func(void *completion)
165196 {
166197 complete(completion);
@@ -235,27 +266,33 @@ err_buf: · 68 unmodified lines
235266 static void atmel_read_buf(struct mtd_info *mtd, u8 *buf, int len)
236267 {
237268 struct nand_chip *chip = mtd->priv;
269+ struct atmel_nand_host *host = chip->priv;
238270
239271 if (use_dma && len > mtd->oobsize)
240272 /* only use DMA for bigger than oob size: better performances */
241273 if (atmel_nand_dma_op(mtd, buf, len, 1) == 0)
242274 return;
243275
244− /* if no DMA operation possible, use PIO */
245− memcpy_fromio(buf, chip->IO_ADDR_R, len);
276+ if (host->board->bus_width_16)
277+ atmel_read_buf16(mtd, buf, len);
278+ else
279+ atmel_read_buf8(mtd, buf, len);
246280 }
247281
248282 static void atmel_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
249283 {
250284 struct nand_chip *chip = mtd->priv;
285+ struct atmel_nand_host *host = chip->priv;
251286
252287 if (use_dma && len > mtd->oobsize)
253288 /* only use DMA for bigger than oob size: better performances */
254289 if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0)
255290 return;
256291
257− /* if no DMA operation possible, use PIO */
258− memcpy_toio(chip->IO_ADDR_W, buf, len);
292+ if (host->board->bus_width_16)
293+ atmel_write_buf16(mtd, buf, len);
294+ else
295+ atmel_write_buf8(mtd, buf, len);
259296 }
260297
261298 /*
drivers/mtd/nand/gpmi-nand/gpmi-lib.c+14−4
@@ -69,17 +69,19 @@ static int clear_poll_bit(void __iomem *addr, u32 mask) · 68 unmodified lines
6969 * [1] enable the module.
7070 * [2] reset the module.
7171 *
72− * In most of the cases, it's ok. But there is a hardware bug in the BCH block.
72+ * In most of the cases, it's ok.
73+ * But in MX23, there is a hardware bug in the BCH block (see erratum #2847).
7374 * If you try to soft reset the BCH block, it becomes unusable until
7475 * the next hard reset. This case occurs in the NAND boot mode. When the board
7576 * boots by NAND, the ROM of the chip will initialize the BCH blocks itself.
7677 * So If the driver tries to reset the BCH again, the BCH will not work anymore.
77− * You will see a DMA timeout in this case.
78+ * You will see a DMA timeout in this case. The bug has been fixed
79+ * in the following chips, such as MX28.
7880 *
7981 * To avoid this bug, just add a new parameter `just_enable` for
8082 * the mxs_reset_block(), and rewrite it here.
8183 */
82−int gpmi_reset_block(void __iomem *reset_addr, bool just_enable)
84+static int gpmi_reset_block(void __iomem *reset_addr, bool just_enable)
8385 {
8486 int ret;
8587 int timeout = 0x400;
@@ -206,7 +208,15 @@ int bch_set_geometry(struct gpmi_nand_data *this) · 120 unmodified lines
206208 if (ret)
207209 goto err_out;
208210
209− ret = gpmi_reset_block(r->bch_regs, true);
211+ /*
212+ * Due to erratum #2847 of the MX23, the BCH cannot be soft reset on this
213+ * chip, otherwise it will lock up. So we skip resetting BCH on the MX23.
214+ * On the other hand, the MX28 needs the reset, because one case has been
215+ * seen where the BCH produced ECC errors constantly after 10000
216+ * consecutive reboots. The latter case has not been seen on the MX23 yet,
217+ * still we don't know if it could happen there as well.
218+ */
219+ ret = gpmi_reset_block(r->bch_regs, GPMI_IS_MX23(this));
210220 if (ret)
211221 goto err_out;
212222
drivers/mtd/nand/nand_base.c+1−1
@@ -2588,7 +2588,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, · 2587 unmodified lines
25882588 instr->state = MTD_ERASING;
25892589
25902590 while (len) {
2591− /* Heck if we have a bad block, we do not erase bad blocks! */
2591+ /* Check if we have a bad block, we do not erase bad blocks! */
25922592 if (nand_block_checkbad(mtd, ((loff_t) page) <<
25932593 chip->page_shift, 0, allowbbt)) {
25942594 pr_warn("%s: attempt to erase a bad block at page 0x%08x\n",
drivers/net/can/cc770/cc770.c+3−1
@@ -440,12 +440,14 @@ static netdev_tx_t cc770_start_xmit(struct sk_buff *skb, struct net_device *dev) · 439 unmodified lines
440440 for (i = 0; i < dlc; i++)
441441 cc770_write_reg(priv, msgobj[mo].data[i], cf->data[i]);
442442
443+ /* Store echo skb before starting the transfer */
444+ can_put_echo_skb(skb, dev, 0);
445+
443446 cc770_write_reg(priv, msgobj[mo].ctrl1,
444447 RMTPND_RES | TXRQST_SET | CPUUPD_RES | NEWDAT_UNC);
445448
446449 stats->tx_bytes += dlc;
447450
448− can_put_echo_skb(skb, dev, 0);
449451
450452 /*
451453 * HM: We had some cases of repeated IRQs so make sure the
drivers/net/can/cc770/cc770_isa.c+15−1
@@ -110,6 +110,11 @@ MODULE_PARM_DESC(bcr, "Bus configuration register (default=0x40 [CBY])"); · 109 unmodified lines
110110 #define CC770_IOSIZE 0x20
111111 #define CC770_IOSIZE_INDIRECT 0x02
112112
113+/* Spinlock for cc770_isa_port_write_reg_indirect
114+ * and cc770_isa_port_read_reg_indirect
115+ */
116+static DEFINE_SPINLOCK(cc770_isa_port_lock);
117+
113118 static struct platform_device *cc770_isa_devs[MAXDEV];
114119
115120 static u8 cc770_isa_mem_read_reg(const struct cc770_priv *priv, int reg)
@@ -138,18 +143,27 @@ static u8 cc770_isa_port_read_reg_indirect(const struct cc770_priv *priv, · 22 unmodified lines
138143 int reg)
139144 {
140145 unsigned long base = (unsigned long)priv->reg_base;
146+ unsigned long flags;
147+ u8 val;
141148
149+ spin_lock_irqsave(&cc770_isa_port_lock, flags);
142150 outb(reg, base);
143− return inb(base + 1);
151+ val = inb(base + 1);
152+ spin_unlock_irqrestore(&cc770_isa_port_lock, flags);
153+
154+ return val;
144155 }
145156
146157 static void cc770_isa_port_write_reg_indirect(const struct cc770_priv *priv,
147158 int reg, u8 val)
148159 {
149160 unsigned long base = (unsigned long)priv->reg_base;
161+ unsigned long flags;
150162
163+ spin_lock_irqsave(&cc770_isa_port_lock, flags);
151164 outb(reg, base);
152165 outb(val, base + 1);
166+ spin_unlock_irqrestore(&cc770_isa_port_lock, flags);
153167 }
154168
155169 static int __devinit cc770_isa_probe(struct platform_device *pdev)
drivers/net/can/flexcan.c+6−1
@@ -118,6 +118,9 @@ · 117 unmodified lines
118118 (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | FLEXCAN_ESR_BOFF_INT)
119119 #define FLEXCAN_ESR_ERR_ALL \
120120 (FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE)
121+#define FLEXCAN_ESR_ALL_INT \
122+ (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | \
123+ FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
121124
122125 /* FLEXCAN interrupt flag register (IFLAG) bits */
123126 #define FLEXCAN_TX_BUF_ID 8
@@ -577,7 +580,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id) · 453 unmodified lines
577580
578581 reg_iflag1 = flexcan_read(&regs->iflag1);
579582 reg_esr = flexcan_read(&regs->esr);
580− flexcan_write(FLEXCAN_ESR_ERR_INT, &regs->esr); /* ACK err IRQ */
583+ /* ACK all bus error and state change IRQ sources */
584+ if (reg_esr & FLEXCAN_ESR_ALL_INT)
585+ flexcan_write(reg_esr & FLEXCAN_ESR_ALL_INT, &regs->esr);
581586
582587 /*
583588 * schedule NAPI in case of:
drivers/net/can/pch_can.c+2−1
@@ -66,6 +66,7 @@ · 65 unmodified lines
6666 #define PCH_IF_CREQ_BUSY BIT(15)
6767
6868 #define PCH_STATUS_INT 0x8000
69+#define PCH_RP 0x00008000
6970 #define PCH_REC 0x00007f00
7071 #define PCH_TEC 0x000000ff
7172
@@ -527,7 +528,7 @@ static void pch_can_error(struct net_device *ndev, u32 status) · 455 unmodified lines
527528 priv->can.can_stats.error_passive++;
528529 state = CAN_STATE_ERROR_PASSIVE;
529530 cf->can_id |= CAN_ERR_CRTL;
530− if (((errc & PCH_REC) >> 8) > 127)
531+ if (errc & PCH_RP)
531532 cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
532533 if ((errc & PCH_TEC) > 127)
533534 cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE;
drivers/net/can/sja1000/peak_pci.c+9−14
@@ -39,9 +39,9 @@ MODULE_LICENSE("GPL v2"); · 38 unmodified lines
3939 #define DRV_NAME "peak_pci"
4040
4141 struct peak_pci_chan {
42− void __iomem *cfg_base; /* Common for all channels */
43− struct net_device *next_dev; /* Chain of network devices */
44− u16 icr_mask; /* Interrupt mask for fast ack */
42+ void __iomem *cfg_base; /* Common for all channels */
43+ struct net_device *prev_dev; /* Chain of network devices */
44+ u16 icr_mask; /* Interrupt mask for fast ack */
4545 };
4646
4747 #define PEAK_PCI_CAN_CLOCK (16000000 / 2)
@@ -98,7 +98,7 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev, · 50 unmodified lines
9898 {
9999 struct sja1000_priv *priv;
100100 struct peak_pci_chan *chan;
101− struct net_device *dev, *dev0 = NULL;
101+ struct net_device *dev;
102102 void __iomem *cfg_base, *reg_base;
103103 u16 sub_sys_id, icr;
104104 int i, err, channels;
@@ -196,18 +196,14 @@ static int __devinit peak_pci_probe(struct pci_dev *pdev, · 91 unmodified lines
196196 }
197197
198198 /* Create chain of SJA1000 devices */
199− if (i == 0)
200− dev0 = dev;
201− else
202− chan->next_dev = dev;
199+ chan->prev_dev = pci_get_drvdata(pdev);
200+ pci_set_drvdata(pdev, dev);
203201
204202 dev_info(&pdev->dev,
205203 "%s at reg_base=0x%p cfg_base=0x%p irq=%d\n",
206204 dev->name, priv->reg_base, chan->cfg_base, dev->irq);
207205 }
208206
209− pci_set_drvdata(pdev, dev0);
210−
211207 /* Enable interrupts */
212208 writew(icr, cfg_base + PITA_ICR + 2);
213209
@@ -217,12 +213,11 @@ failure_remove_channels: · 3 unmodified lines
217213 /* Disable interrupts */
218214 writew(0x0, cfg_base + PITA_ICR + 2);
219215
220− for (dev = dev0; dev; dev = chan->next_dev) {
216+ for (dev = pci_get_drvdata(pdev); dev; dev = chan->prev_dev) {
221217 unregister_sja1000dev(dev);
222218 free_sja1000dev(dev);
223219 priv = netdev_priv(dev);
224220 chan = priv->priv;
225− dev = chan->next_dev;
226221 }
227222
228223 pci_iounmap(pdev, reg_base);
@@ -241,7 +236,7 @@ failure_disable_pci: · 12 unmodified lines
241236
242237 static void __devexit peak_pci_remove(struct pci_dev *pdev)
243238 {
244− struct net_device *dev = pci_get_drvdata(pdev); /* First device */
239+ struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
245240 struct sja1000_priv *priv = netdev_priv(dev);
246241 struct peak_pci_chan *chan = priv->priv;
247242 void __iomem *cfg_base = chan->cfg_base;
@@ -255,7 +250,7 @@ static void __devexit peak_pci_remove(struct pci_dev *pdev) · 7 unmodified lines
255250 dev_info(&pdev->dev, "removing device %s\n", dev->name);
256251 unregister_sja1000dev(dev);
257252 free_sja1000dev(dev);
258− dev = chan->next_dev;
253+ dev = chan->prev_dev;
259254 if (!dev)
260255 break;
261256 priv = netdev_priv(dev);
drivers/net/can/sja1000/sja1000.c+12−1
@@ -95,11 +95,16 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val) · 94 unmodified lines
9595 spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
9696 }
9797
98+static int sja1000_is_absent(struct sja1000_priv *priv)
99+{
100+ return (priv->read_reg(priv, REG_MOD) == 0xFF);
101+}
102+
98103 static int sja1000_probe_chip(struct net_device *dev)
99104 {
100105 struct sja1000_priv *priv = netdev_priv(dev);
101106
102− if (priv->reg_base && (priv->read_reg(priv, 0) == 0xFF)) {
107+ if (priv->reg_base && sja1000_is_absent(priv)) {
103108 printk(KERN_INFO "%s: probing @0x%lX failed\n",
104109 DRV_NAME, dev->base_addr);
105110 return 0;
@@ -493,6 +498,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) · 387 unmodified lines
493498 while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) {
494499 n++;
495500 status = priv->read_reg(priv, REG_SR);
501+ /* check for absent controller due to hw unplug */
502+ if (status == 0xFF && sja1000_is_absent(priv))
503+ return IRQ_NONE;
496504
497505 if (isrc & IRQ_WUI)
498506 dev_warn(dev->dev.parent, "wakeup interrupt\n");
@@ -509,6 +517,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) · 10 unmodified lines
509517 while (status & SR_RBS) {
510518 sja1000_rx(dev);
511519 status = priv->read_reg(priv, REG_SR);
520+ /* check for absent controller */
521+ if (status == 0xFF && sja1000_is_absent(priv))
522+ return IRQ_NONE;
512523 }
513524 }
514525 if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) {
drivers/net/can/ti_hecc.c+2−1
@@ -745,9 +745,10 @@ static int ti_hecc_error(struct net_device *ndev, int int_status, · 744 unmodified lines
745745 }
746746 }
747747
748− netif_receive_skb(skb);
748+ netif_rx(skb);
749749 stats->rx_packets++;
750750 stats->rx_bytes += cf->can_dlc;
751+
751752 return 0;
752753 }
753754
drivers/net/can/usb/ems_usb.c+0−9
@@ -627,9 +627,6 @@ static int ems_usb_start(struct ems_usb *dev) · 626 unmodified lines
627627
628628 err = usb_submit_urb(urb, GFP_KERNEL);
629629 if (err) {
630− if (err == -ENODEV)
631− netif_device_detach(dev->netdev);
632−
633630 usb_unanchor_urb(urb);
634631 usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
635632 urb->transfer_dma);
@@ -659,9 +656,6 @@ static int ems_usb_start(struct ems_usb *dev) · 23 unmodified lines
659656
660657 err = usb_submit_urb(dev->intr_urb, GFP_KERNEL);
661658 if (err) {
662− if (err == -ENODEV)
663− netif_device_detach(dev->netdev);
664−
665659 dev_warn(netdev->dev.parent, "intr URB submit failed: %d\n",
666660 err);
667661
@@ -692,9 +686,6 @@ static int ems_usb_start(struct ems_usb *dev) · 24 unmodified lines
692686 return 0;
693687
694688 failed:
695− if (err == -ENODEV)
696− netif_device_detach(dev->netdev);
697−
698689 dev_warn(netdev->dev.parent, "couldn't submit control: %d\n", err);
699690
700691 return err;
drivers/net/ethernet/3com/3c59x.c+1−1
@@ -1842,7 +1842,7 @@ vortex_timer(unsigned long data) · 1841 unmodified lines
18421842 ok = 1;
18431843 }
18441844
1845− if (!netif_carrier_ok(dev))
1845+ if (dev->flags & IFF_SLAVE || !netif_carrier_ok(dev))
18461846 next_tick = 5*HZ;
18471847
18481848 if (vp->medialock)
drivers/net/ethernet/atheros/atl1c/atl1c_main.c+0−4
@@ -2244,10 +2244,6 @@ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb, · 2243 unmodified lines
22442244 dev_info(&adapter->pdev->dev, "tx locked\n");
22452245 return NETDEV_TX_LOCKED;
22462246 }
2247− if (skb->mark == 0x01)
2248− type = atl1c_trans_high;
2249− else
2250− type = atl1c_trans_normal;
22512247
22522248 if (atl1c_tpd_avail(adapter, type) < tpd_req) {
22532249 /* no enough descriptor, just stop queue */
drivers/net/ethernet/broadcom/b44.c+1−1
@@ -2339,7 +2339,7 @@ static inline int __init b44_pci_init(void) · 2338 unmodified lines
23392339 return err;
23402340 }
23412341
2342−static inline void __exit b44_pci_exit(void)
2342+static inline void b44_pci_exit(void)
23432343 {
23442344 #ifdef CONFIG_B44_PCI
23452345 ssb_pcihost_unregister(&b44_pci_driver);
drivers/net/ethernet/broadcom/bcm63xx_enet.c+1−1
@@ -797,7 +797,7 @@ static int bcm_enet_open(struct net_device *dev) · 796 unmodified lines
797797 if (priv->has_phy) {
798798 /* connect to PHY */
799799 snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT,
800− priv->mac_id ? "1" : "0", priv->phy_id);
800+ priv->mii_bus->id, priv->phy_id);
801801
802802 phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0,
803803 PHY_INTERFACE_MODE_MII);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+1−2
@@ -523,7 +523,6 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 522 unmodified lines
523523 skb = build_skb(data);
524524
525525 if (likely(skb)) {
526−
527526 #ifdef BNX2X_STOP_ON_ERROR
528527 if (pad + len > fp->rx_buf_size) {
529528 BNX2X_ERR("skb_put is about to fail... "
@@ -557,7 +556,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 27 unmodified lines
557556
558557 return;
559558 }
560−
559+ kfree(new_data);
561560 drop:
562561 /* drop the packet and keep the buffer in the bin */
563562 DP(NETIF_MSG_RX_STATUS,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+1−16
@@ -117,10 +117,6 @@ static int dropless_fc; · 116 unmodified lines
117117 module_param(dropless_fc, int, 0);
118118 MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring");
119119
120−static int poll;
121−module_param(poll, int, 0);
122−MODULE_PARM_DESC(poll, " Use polling (for debug)");
123−
124120 static int mrrs = -1;
125121 module_param(mrrs, int, 0);
126122 MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)");
@@ -4834,20 +4830,11 @@ void bnx2x_drv_pulse(struct bnx2x *bp) · 4707 unmodified lines
48344830
48354831 static void bnx2x_timer(unsigned long data)
48364832 {
4837− u8 cos;
48384833 struct bnx2x *bp = (struct bnx2x *) data;
48394834
48404835 if (!netif_running(bp->dev))
48414836 return;
48424837
4843− if (poll) {
4844− struct bnx2x_fastpath *fp = &bp->fp[0];
4845−
4846− for_each_cos_in_tx_queue(fp, cos)
4847− bnx2x_tx_int(bp, &fp->txdata[cos]);
4848− bnx2x_rx_int(fp, 1000);
4849− }
4850−
48514838 if (!BP_NOMCP(bp)) {
48524839 int mb_idx = BP_FW_MB_IDX(bp);
48534840 u32 drv_pulse;
@@ -10063,7 +10050,6 @@ static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp) · 5209 unmodified lines
1006310050 static int __devinit bnx2x_init_bp(struct bnx2x *bp)
1006410051 {
1006510052 int func;
10066− int timer_interval;
1006710053 int rc;
1006810054
1006910055 mutex_init(&bp->port.phy_mutex);
@@ -10139,8 +10125,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 69 unmodified lines
1013910125 bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR;
1014010126 bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR;
1014110127
10142− timer_interval = (CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ);
10143− bp->current_interval = (poll ? poll : timer_interval);
10128+ bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ;
1014410129
1014510130 init_timer(&bp->timer);
1014610131 bp->timer.expires = jiffies + bp->current_interval;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c+4−4
@@ -1081,17 +1081,17 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp) · 1080 unmodified lines
10811081 estats->rx_stat_ifhcinbadoctets_lo);
10821082
10831083 ADD_64(fstats->total_bytes_received_hi,
1084− tfunc->rcv_error_bytes.hi,
1084+ le32_to_cpu(tfunc->rcv_error_bytes.hi),
10851085 fstats->total_bytes_received_lo,
1086− tfunc->rcv_error_bytes.lo);
1086+ le32_to_cpu(tfunc->rcv_error_bytes.lo));
10871087
10881088 memcpy(estats, &(fstats->total_bytes_received_hi),
10891089 sizeof(struct host_func_stats) - 2*sizeof(u32));
10901090
10911091 ADD_64(estats->error_bytes_received_hi,
1092− tfunc->rcv_error_bytes.hi,
1092+ le32_to_cpu(tfunc->rcv_error_bytes.hi),
10931093 estats->error_bytes_received_lo,
1094− tfunc->rcv_error_bytes.lo);
1094+ le32_to_cpu(tfunc->rcv_error_bytes.lo));
10951095
10961096 ADD_64(estats->etherstatsoverrsizepkts_hi,
10971097 estats->rx_stat_dot3statsframestoolong_hi,
drivers/net/ethernet/broadcom/cnic.c+5−1
@@ -3584,7 +3584,11 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr, · 3583 unmodified lines
35843584 fl6.flowi6_oif = dst_addr->sin6_scope_id;
35853585
35863586 *dst = ip6_route_output(&init_net, NULL, &fl6);
3587− if (*dst)
3587+ if ((*dst)->error) {
3588+ dst_release(*dst);
3589+ *dst = NULL;
3590+ return -ENETUNREACH;
3591+ } else
35883592 return 0;
35893593 #endif
35903594
drivers/net/ethernet/brocade/bna/bnad_ethtool.c+4−6
@@ -946,7 +946,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, · 945 unmodified lines
946946
947947 flash_attr = kzalloc(sizeof(struct bfa_flash_attr), GFP_KERNEL);
948948 if (!flash_attr)
949− return -ENOMEM;
949+ return 0;
950950
951951 fcomp.bnad = bnad;
952952 fcomp.comp_status = 0;
@@ -958,7 +958,7 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, · 5 unmodified lines
958958 if (ret != BFA_STATUS_OK) {
959959 spin_unlock_irqrestore(&bnad->bna_lock, flags);
960960 kfree(flash_attr);
961− goto out_err;
961+ return 0;
962962 }
963963 spin_unlock_irqrestore(&bnad->bna_lock, flags);
964964 wait_for_completion(&fcomp.comp);
@@ -978,8 +978,6 @@ bnad_get_flash_partition_by_offset(struct bnad *bnad, u32 offset, · 13 unmodified lines
978978 }
979979 kfree(flash_attr);
980980 return flash_part;
981−out_err:
982− return -EINVAL;
983981 }
984982
985983 static int
@@ -1006,7 +1004,7 @@ bnad_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, · 20 unmodified lines
10061004 /* Query the flash partition based on the offset */
10071005 flash_part = bnad_get_flash_partition_by_offset(bnad,
10081006 eeprom->offset, &base_offset);
1009− if (flash_part <= 0)
1007+ if (flash_part == 0)
10101008 return -EFAULT;
10111009
10121010 fcomp.bnad = bnad;
@@ -1048,7 +1046,7 @@ bnad_set_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, · 35 unmodified lines
10481046 /* Query the flash partition based on the offset */
10491047 flash_part = bnad_get_flash_partition_by_offset(bnad,
10501048 eeprom->offset, &base_offset);
1051− if (flash_part <= 0)
1049+ if (flash_part == 0)
10521050 return -EFAULT;
10531051
10541052 fcomp.bnad = bnad;
drivers/net/ethernet/cisco/enic/cq_enet_desc.h+1−1
@@ -157,7 +157,7 @@ static inline void cq_enet_rq_desc_dec(struct cq_enet_rq_desc *desc, · 156 unmodified lines
157157 CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0;
158158 *fcoe_enc_error = (desc->flags &
159159 CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0;
160− *fcoe_eof = (u8)((desc->checksum_fcoe >>
160+ *fcoe_eof = (u8)((le16_to_cpu(desc->checksum_fcoe) >>
161161 CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) &
162162 CQ_ENET_RQ_DESC_FCOE_EOF_MASK);
163163 *checksum = 0;
drivers/net/ethernet/cisco/enic/enic_pp.c+1−1
@@ -72,7 +72,7 @@ static int enic_set_port_profile(struct enic *enic, int vf) · 71 unmodified lines
7272 struct enic_port_profile *pp;
7373 struct vic_provinfo *vp;
7474 const u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
75− const u16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX);
75+ const __be16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX);
7676 char uuid_str[38];
7777 char client_mac_str[18];
7878 u8 *client_mac;
drivers/net/ethernet/emulex/benet/be_ethtool.c+1−5
@@ -716,12 +716,8 @@ static int · 715 unmodified lines
716716 be_do_flash(struct net_device *netdev, struct ethtool_flash *efl)
717717 {
718718 struct be_adapter *adapter = netdev_priv(netdev);
719− char file_name[ETHTOOL_FLASH_MAX_FILENAME];
720719
721− file_name[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0;
722− strcpy(file_name, efl->data);
723−
724− return be_load_fw(adapter, file_name);
720+ return be_load_fw(adapter, efl->data);
725721 }
726722
727723 static int
drivers/net/ethernet/freescale/fec.c+2−2
@@ -986,11 +986,11 @@ static int fec_enet_mii_probe(struct net_device *ndev) · 985 unmodified lines
986986 printk(KERN_INFO
987987 "%s: no PHY, assuming direct connection to switch\n",
988988 ndev->name);
989− strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE);
989+ strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
990990 phy_id = 0;
991991 }
992992
993− snprintf(phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
993+ snprintf(phy_name, sizeof(phy_name), PHY_ID_FMT, mdio_bus_id, phy_id);
994994 phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, 0,
995995 fep->phy_interface);
996996 if (IS_ERR(phy_dev)) {
drivers/net/ethernet/intel/e1000/e1000_main.c+6−4
@@ -4740,12 +4740,14 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake) · 4739 unmodified lines
47404740 e1000_setup_rctl(adapter);
47414741 e1000_set_rx_mode(netdev);
47424742
4743+ rctl = er32(RCTL);
4744+
47434745 /* turn on all-multi mode if wake on multicast is enabled */
4744− if (wufc & E1000_WUFC_MC) {
4745− rctl = er32(RCTL);
4746+ if (wufc & E1000_WUFC_MC)
47464747 rctl |= E1000_RCTL_MPE;
4747− ew32(RCTL, rctl);
4748− }
4748+
4749+ /* enable receives in the hardware */
4750+ ew32(RCTL, rctl | E1000_RCTL_EN);
47494751
47504752 if (hw->mac_type >= e1000_82540) {
47514753 ctrl = er32(CTRL);
drivers/net/ethernet/intel/igb/igb_main.c+2−1
@@ -5012,7 +5012,8 @@ static int igb_find_enabled_vfs(struct igb_adapter *adapter) · 5011 unmodified lines
50125012 vf_devfn = pdev->devfn + 0x80;
50135013 pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
50145014 while (pvfdev) {
5015− if (pvfdev->devfn == vf_devfn)
5015+ if (pvfdev->devfn == vf_devfn &&
5016+ (pvfdev->bus->number >= pdev->bus->number))
50165017 vfs_found++;
50175018 vf_devfn += vf_stride;
50185019 pvfdev = pci_get_device(hw->vendor_id,
drivers/net/ethernet/intel/igbvf/Makefile+1−1
@@ -1,7 +1,7 @@
11 ################################################################################
22 #
33 # Intel(R) 82576 Virtual Function Linux driver
4−# Copyright(c) 2009 - 2010 Intel Corporation.
4+# Copyright(c) 2009 - 2012 Intel Corporation.
55 #
66 # This program is free software; you can redistribute it and/or modify it
77 # under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/igbvf/defines.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/igbvf/ethtool.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 2009 - 2010 Intel Corporation.
4+ Copyright(c) 2009 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/igbvf/igbvf.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 2009 - 2010 Intel Corporation.
4+ Copyright(c) 2009 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/igbvf/mbx.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 2009 - 2010 Intel Corporation.
4+ Copyright(c) 2009 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/igbvf/mbx.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/igbvf/netdev.c+2−2
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 2009 - 2010 Intel Corporation.
4+ Copyright(c) 2009 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
@@ -53,7 +53,7 @@ const char igbvf_driver_version[] = DRV_VERSION; · 45 unmodified lines
5353 static const char igbvf_driver_string[] =
5454 "Intel(R) Gigabit Virtual Function Network Driver";
5555 static const char igbvf_copyright[] =
56− "Copyright (c) 2009 - 2011 Intel Corporation.";
56+ "Copyright (c) 2009 - 2012 Intel Corporation.";
5757
5858 static int igbvf_poll(struct napi_struct *napi, int budget);
5959 static void igbvf_reset(struct igbvf_adapter *);
drivers/net/ethernet/intel/igbvf/regs.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 2009 - 2010 Intel Corporation.
4+ Copyright(c) 2009 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/igbvf/vf.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 2009 - 2010 Intel Corporation.
4+ Copyright(c) 2009 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/igbvf/vf.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel(R) 82576 Virtual Function Linux driver
4− Copyright(c) 2009 - 2010 Intel Corporation.
4+ Copyright(c) 2009 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/Makefile+1−1
@@ -1,7 +1,7 @@
11 ################################################################################
22 #
33 # Intel 10 Gigabit PCI Express Linux driver
4−# Copyright(c) 1999 - 2010 Intel Corporation.
4+# Copyright(c) 1999 - 2012 Intel Corporation.
55 #
66 # This program is free software; you can redistribute it and/or modify it
77 # under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_common.h+2−2
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
@@ -75,7 +75,7 @@ s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, · 67 unmodified lines
7575 s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw);
7676 s32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw);
7777 s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
78−s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packtetbuf_num);
78+s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packetbuf_num);
7979 s32 ixgbe_fc_autoneg(struct ixgbe_hw *hw);
8080
8181 s32 ixgbe_validate_mac_addr(u8 *mac_addr);
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82599.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c+10−3
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
@@ -112,6 +112,8 @@ static u8 ixgbe_dcbnl_get_state(struct net_device *netdev) · 104 unmodified lines
112112 static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
113113 {
114114 u8 err = 0;
115+ u8 prio_tc[MAX_USER_PRIORITY] = {0};
116+ int i;
115117 struct ixgbe_adapter *adapter = netdev_priv(netdev);
116118
117119 /* Fail command if not in CEE mode */
@@ -122,10 +124,15 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) · 4 unmodified lines
122124 if (!!state != !(adapter->flags & IXGBE_FLAG_DCB_ENABLED))
123125 return err;
124126
125− if (state > 0)
127+ if (state > 0) {
126128 err = ixgbe_setup_tc(netdev, adapter->dcb_cfg.num_tcs.pg_tcs);
127− else
129+ ixgbe_dcb_unpack_map(&adapter->dcb_cfg, DCB_TX_CONFIG, prio_tc);
130+ } else {
128131 err = ixgbe_setup_tc(netdev, 0);
132+ }
133+
134+ for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
135+ netdev_set_prio_tc_map(netdev, i, prio_tc[i]);
129136
130137 return err;
131138 }
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c+53−39
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
@@ -58,7 +58,7 @@ struct ixgbe_stats { · 50 unmodified lines
5858 sizeof(((struct rtnl_link_stats64 *)0)->m), \
5959 offsetof(struct rtnl_link_stats64, m)
6060
61−static struct ixgbe_stats ixgbe_gstrings_stats[] = {
61+static const struct ixgbe_stats ixgbe_gstrings_stats[] = {
6262 {"rx_packets", IXGBE_NETDEV_STAT(rx_packets)},
6363 {"tx_packets", IXGBE_NETDEV_STAT(tx_packets)},
6464 {"rx_bytes", IXGBE_NETDEV_STAT(rx_bytes)},
@@ -120,19 +120,23 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = { · 55 unmodified lines
120120 #endif /* IXGBE_FCOE */
121121 };
122122
123−#define IXGBE_QUEUE_STATS_LEN \
124− ((((struct ixgbe_adapter *)netdev_priv(netdev))->num_tx_queues + \
125− ((struct ixgbe_adapter *)netdev_priv(netdev))->num_rx_queues) * \
123+/* ixgbe allocates num_tx_queues and num_rx_queues symmetrically so
124+ * we set the num_rx_queues to evaluate to num_tx_queues. This is
125+ * used because we do not have a good way to get the max number of
126+ * rx queues with CONFIG_RPS disabled.
127+ */
128+#define IXGBE_NUM_RX_QUEUES netdev->num_tx_queues
129+
130+#define IXGBE_QUEUE_STATS_LEN ( \
131+ (netdev->num_tx_queues + IXGBE_NUM_RX_QUEUES) * \
126132 (sizeof(struct ixgbe_queue_stats) / sizeof(u64)))
127133 #define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats)
128134 #define IXGBE_PB_STATS_LEN ( \
129− (((struct ixgbe_adapter *)netdev_priv(netdev))->flags & \
130− IXGBE_FLAG_DCB_ENABLED) ? \
131− (sizeof(((struct ixgbe_adapter *)0)->stats.pxonrxc) + \
132− sizeof(((struct ixgbe_adapter *)0)->stats.pxontxc) + \
133− sizeof(((struct ixgbe_adapter *)0)->stats.pxoffrxc) + \
134− sizeof(((struct ixgbe_adapter *)0)->stats.pxofftxc)) \
135− / sizeof(u64) : 0)
135+ (sizeof(((struct ixgbe_adapter *)0)->stats.pxonrxc) + \
136+ sizeof(((struct ixgbe_adapter *)0)->stats.pxontxc) + \
137+ sizeof(((struct ixgbe_adapter *)0)->stats.pxoffrxc) + \
138+ sizeof(((struct ixgbe_adapter *)0)->stats.pxofftxc)) \
139+ / sizeof(u64))
136140 #define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + \
137141 IXGBE_PB_STATS_LEN + \
138142 IXGBE_QUEUE_STATS_LEN)
@@ -1078,8 +1082,15 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev, · 939 unmodified lines
10781082 data[i] = (ixgbe_gstrings_stats[i].sizeof_stat ==
10791083 sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
10801084 }
1081− for (j = 0; j < adapter->num_tx_queues; j++) {
1085+ for (j = 0; j < IXGBE_NUM_RX_QUEUES; j++) {
10821086 ring = adapter->tx_ring[j];
1087+ if (!ring) {
1088+ data[i] = 0;
1089+ data[i+1] = 0;
1090+ i += 2;
1091+ continue;
1092+ }
1093+
10831094 do {
10841095 start = u64_stats_fetch_begin_bh(&ring->syncp);
10851096 data[i] = ring->stats.packets;
@@ -1087,8 +1098,15 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev, · 1 unmodified line
10871098 } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
10881099 i += 2;
10891100 }
1090− for (j = 0; j < adapter->num_rx_queues; j++) {
1101+ for (j = 0; j < IXGBE_NUM_RX_QUEUES; j++) {
10911102 ring = adapter->rx_ring[j];
1103+ if (!ring) {
1104+ data[i] = 0;
1105+ data[i+1] = 0;
1106+ i += 2;
1107+ continue;
1108+ }
1109+
10921110 do {
10931111 start = u64_stats_fetch_begin_bh(&ring->syncp);
10941112 data[i] = ring->stats.packets;
@@ -1096,22 +1114,20 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev, · 1 unmodified line
10961114 } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
10971115 i += 2;
10981116 }
1099− if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
1100− for (j = 0; j < MAX_TX_PACKET_BUFFERS; j++) {
1101− data[i++] = adapter->stats.pxontxc[j];
1102− data[i++] = adapter->stats.pxofftxc[j];
1103− }
1104− for (j = 0; j < MAX_RX_PACKET_BUFFERS; j++) {
1105− data[i++] = adapter->stats.pxonrxc[j];
1106− data[i++] = adapter->stats.pxoffrxc[j];
1107− }
1117+
1118+ for (j = 0; j < IXGBE_MAX_PACKET_BUFFERS; j++) {
1119+ data[i++] = adapter->stats.pxontxc[j];
1120+ data[i++] = adapter->stats.pxofftxc[j];
1121+ }
1122+ for (j = 0; j < IXGBE_MAX_PACKET_BUFFERS; j++) {
1123+ data[i++] = adapter->stats.pxonrxc[j];
1124+ data[i++] = adapter->stats.pxoffrxc[j];
11081125 }
11091126 }
11101127
11111128 static void ixgbe_get_strings(struct net_device *netdev, u32 stringset,
11121129 u8 *data)
11131130 {
1114− struct ixgbe_adapter *adapter = netdev_priv(netdev);
11151131 char *p = (char *)data;
11161132 int i;
11171133
@@ -1126,31 +1142,29 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, · 8 unmodified lines
11261142 ETH_GSTRING_LEN);
11271143 p += ETH_GSTRING_LEN;
11281144 }
1129− for (i = 0; i < adapter->num_tx_queues; i++) {
1145+ for (i = 0; i < netdev->num_tx_queues; i++) {
11301146 sprintf(p, "tx_queue_%u_packets", i);
11311147 p += ETH_GSTRING_LEN;
11321148 sprintf(p, "tx_queue_%u_bytes", i);
11331149 p += ETH_GSTRING_LEN;
11341150 }
1135− for (i = 0; i < adapter->num_rx_queues; i++) {
1151+ for (i = 0; i < IXGBE_NUM_RX_QUEUES; i++) {
11361152 sprintf(p, "rx_queue_%u_packets", i);
11371153 p += ETH_GSTRING_LEN;
11381154 sprintf(p, "rx_queue_%u_bytes", i);
11391155 p += ETH_GSTRING_LEN;
11401156 }
1141− if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
1142− for (i = 0; i < MAX_TX_PACKET_BUFFERS; i++) {
1143− sprintf(p, "tx_pb_%u_pxon", i);
1144− p += ETH_GSTRING_LEN;
1145− sprintf(p, "tx_pb_%u_pxoff", i);
1146− p += ETH_GSTRING_LEN;
1147− }
1148− for (i = 0; i < MAX_RX_PACKET_BUFFERS; i++) {
1149− sprintf(p, "rx_pb_%u_pxon", i);
1150− p += ETH_GSTRING_LEN;
1151− sprintf(p, "rx_pb_%u_pxoff", i);
1152− p += ETH_GSTRING_LEN;
1153− }
1157+ for (i = 0; i < IXGBE_MAX_PACKET_BUFFERS; i++) {
1158+ sprintf(p, "tx_pb_%u_pxon", i);
1159+ p += ETH_GSTRING_LEN;
1160+ sprintf(p, "tx_pb_%u_pxoff", i);
1161+ p += ETH_GSTRING_LEN;
1162+ }
1163+ for (i = 0; i < IXGBE_MAX_PACKET_BUFFERS; i++) {
1164+ sprintf(p, "rx_pb_%u_pxon", i);
1165+ p += ETH_GSTRING_LEN;
1166+ sprintf(p, "rx_pb_%u_pxoff", i);
1167+ p += ETH_GSTRING_LEN;
11541168 }
11551169 /* BUG_ON(p - data != IXGBE_STATS_LEN * ETH_GSTRING_LEN); */
11561170 break;
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+13−9
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
@@ -64,7 +64,7 @@ char ixgbe_default_device_descr[] = · 56 unmodified lines
6464 __stringify(BUILD) "-k"
6565 const char ixgbe_driver_version[] = DRV_VERSION;
6666 static const char ixgbe_copyright[] =
67− "Copyright (c) 1999-2011 Intel Corporation.";
67+ "Copyright (c) 1999-2012 Intel Corporation.";
6868
6969 static const struct ixgbe_info *ixgbe_info_tbl[] = {
7070 [board_82598] = &ixgbe_82598_info,
@@ -2633,22 +2633,22 @@ static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter, · 2562 unmodified lines
26332633 /*
26342634 * we must limit the number of descriptors so that the
26352635 * total size of max desc * buf_len is not greater
2636− * than 65535
2636+ * than 65536
26372637 */
26382638 if (ring_is_ps_enabled(ring)) {
2639−#if (MAX_SKB_FRAGS > 16)
2639+#if (PAGE_SIZE < 8192)
26402640 rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
2641−#elif (MAX_SKB_FRAGS > 8)
2641+#elif (PAGE_SIZE < 16384)
26422642 rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
2643−#elif (MAX_SKB_FRAGS > 4)
2643+#elif (PAGE_SIZE < 32768)
26442644 rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
26452645 #else
26462646 rscctrl |= IXGBE_RSCCTL_MAXDESC_1;
26472647 #endif
26482648 } else {
2649− if (rx_buf_len < IXGBE_RXBUFFER_4K)
2649+ if (rx_buf_len <= IXGBE_RXBUFFER_4K)
26502650 rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
2651− else if (rx_buf_len < IXGBE_RXBUFFER_8K)
2651+ else if (rx_buf_len <= IXGBE_RXBUFFER_8K)
26522652 rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
26532653 else
26542654 rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
@@ -2830,7 +2830,7 @@ static void ixgbe_configure_virtualization(struct ixgbe_adapter *adapter) · 175 unmodified lines
28302830 IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl | vt_reg_bits);
28312831
28322832 vf_shift = adapter->num_vfs % 32;
2833− reg_offset = (adapter->num_vfs > 32) ? 1 : 0;
2833+ reg_offset = (adapter->num_vfs >= 32) ? 1 : 0;
28342834
28352835 /* Enable only the PF's pool for Tx/Rx */
28362836 IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (1 << vf_shift));
@@ -4330,6 +4330,10 @@ static int ixgbe_set_num_queues(struct ixgbe_adapter *adapter) · 1493 unmodified lines
43304330 adapter->num_tx_queues = 1;
43314331
43324332 done:
4333+ if ((adapter->netdev->reg_state == NETREG_UNREGISTERED) ||
4334+ (adapter->netdev->reg_state == NETREG_UNREGISTERING))
4335+ return 0;
4336+
43334337 /* Notify the stack of the (possibly) reduced queue counts. */
43344338 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
43354339 return netif_set_real_num_rx_queues(adapter->netdev,
drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c+6−2
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
@@ -67,7 +67,8 @@ static int ixgbe_find_enabled_vfs(struct ixgbe_adapter *adapter) · 59 unmodified lines
6767 vf_devfn = pdev->devfn + 0x80;
6868 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL);
6969 while (pvfdev) {
70− if (pvfdev->devfn == vf_devfn)
70+ if (pvfdev->devfn == vf_devfn &&
71+ (pvfdev->bus->number >= pdev->bus->number))
7172 vfs_found++;
7273 vf_devfn += 2;
7374 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID,
@@ -646,6 +647,9 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) · 572 unmodified lines
646647 ixgbe_ndo_set_vf_spoofchk(adapter->netdev, vf, false);
647648 retval = ixgbe_set_vf_macvlan(adapter, vf, index,
648649 (unsigned char *)(&msgbuf[1]));
650+ if (retval == -ENOSPC)
651+ e_warn(drv, "VF %d has requested a MACVLAN filter "
652+ "but there is no space for it\n", vf);
649653 break;
650654 default:
651655 e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]);
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 10 Gigabit PCI Express Linux driver
4− Copyright(c) 1999 - 2011 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbevf/Makefile+1−1
@@ -1,7 +1,7 @@
11 ################################################################################
22 #
33 # Intel 82599 Virtual Function driver
4−# Copyright(c) 1999 - 2010 Intel Corporation.
4+# Copyright(c) 1999 - 2012 Intel Corporation.
55 #
66 # This program is free software; you can redistribute it and/or modify it
77 # under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbevf/defines.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbevf/ethtool.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2009 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+8−4
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
@@ -60,7 +60,7 @@ static const char ixgbevf_driver_string[] = · 52 unmodified lines
6060 #define DRV_VERSION "2.2.0-k"
6161 const char ixgbevf_driver_version[] = DRV_VERSION;
6262 static char ixgbevf_copyright[] =
63− "Copyright (c) 2009 - 2010 Intel Corporation.";
63+ "Copyright (c) 2009 - 2012 Intel Corporation.";
6464
6565 static const struct ixgbevf_info *ixgbevf_info_tbl[] = {
6666 [board_82599_vf] = &ixgbevf_82599_vf_info,
@@ -935,7 +935,11 @@ static irqreturn_t ixgbevf_msix_mbx(int irq, void *data) · 868 unmodified lines
935935 if (msg & IXGBE_VT_MSGTYPE_NACK)
936936 pr_warn("Last Request of type %2.2x to PF Nacked\n",
937937 msg & 0xFF);
938− goto out;
938+ /*
939+ * Restore the PFSTS bit in case someone is polling for a
940+ * return message from the PF
941+ */
942+ hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFSTS;
939943 }
940944
941945 /*
@@ -945,7 +949,7 @@ static irqreturn_t ixgbevf_msix_mbx(int irq, void *data) · 3 unmodified lines
945949 */
946950 if (got_ack)
947951 hw->mbx.v2p_mailbox |= IXGBE_VFMAILBOX_PFACK;
948−out:
952+
949953 return IRQ_HANDLED;
950954 }
951955
drivers/net/ethernet/intel/ixgbevf/mbx.c+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbevf/mbx.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbevf/regs.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/intel/ixgbevf/vf.c+16−5
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
@@ -283,6 +283,17 @@ static s32 ixgbevf_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, · 275 unmodified lines
283283 return ret_val;
284284 }
285285
286+static void ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw,
287+ u32 *msg, u16 size)
288+{
289+ struct ixgbe_mbx_info *mbx = &hw->mbx;
290+ u32 retmsg[IXGBE_VFMAILBOX_SIZE];
291+ s32 retval = mbx->ops.write_posted(hw, msg, size);
292+
293+ if (!retval)
294+ mbx->ops.read_posted(hw, retmsg, size);
295+}
296+
286297 /**
287298 * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses
288299 * @hw: pointer to the HW structure
@@ -294,7 +305,6 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, · 5 unmodified lines
294305 struct net_device *netdev)
295306 {
296307 struct netdev_hw_addr *ha;
297− struct ixgbe_mbx_info *mbx = &hw->mbx;
298308 u32 msgbuf[IXGBE_VFMAILBOX_SIZE];
299309 u16 *vector_list = (u16 *)&msgbuf[1];
300310 u32 cnt, i;
@@ -321,7 +331,7 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, · 20 unmodified lines
321331 vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr);
322332 }
323333
324− mbx->ops.write_posted(hw, msgbuf, IXGBE_VFMAILBOX_SIZE);
334+ ixgbevf_write_msg_read_ack(hw, msgbuf, IXGBE_VFMAILBOX_SIZE);
325335
326336 return 0;
327337 }
@@ -336,7 +346,6 @@ static s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, · 8 unmodified lines
336346 static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind,
337347 bool vlan_on)
338348 {
339− struct ixgbe_mbx_info *mbx = &hw->mbx;
340349 u32 msgbuf[2];
341350
342351 msgbuf[0] = IXGBE_VF_SET_VLAN;
@@ -344,7 +353,9 @@ static s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, · 1 unmodified line
344353 /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */
345354 msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT;
346355
347− return mbx->ops.write_posted(hw, msgbuf, 2);
356+ ixgbevf_write_msg_read_ack(hw, msgbuf, 2);
357+
358+ return 0;
348359 }
349360
350361 /**
drivers/net/ethernet/intel/ixgbevf/vf.h+1−1
@@ -1,7 +1,7 @@
11 /*******************************************************************************
22
33 Intel 82599 Virtual Function driver
4− Copyright(c) 1999 - 2010 Intel Corporation.
4+ Copyright(c) 1999 - 2012 Intel Corporation.
55
66 This program is free software; you can redistribute it and/or modify it
77 under the terms and conditions of the GNU General Public License,
drivers/net/ethernet/jme.c+1−9
@@ -2328,19 +2328,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu) · 2327 unmodified lines
23282328 ((new_mtu) < IPV6_MIN_MTU))
23292329 return -EINVAL;
23302330
2331− if (new_mtu > 4000) {
2332− jme->reg_rxcs &= ~RXCS_FIFOTHNP;
2333− jme->reg_rxcs |= RXCS_FIFOTHNP_64QW;
2334− jme_restart_rx_engine(jme);
2335− } else {
2336− jme->reg_rxcs &= ~RXCS_FIFOTHNP;
2337− jme->reg_rxcs |= RXCS_FIFOTHNP_128QW;
2338− jme_restart_rx_engine(jme);
2339− }
23402331
23412332 netdev->mtu = new_mtu;
23422333 netdev_update_features(netdev);
23432334
2335+ jme_restart_rx_engine(jme);
23442336 jme_reset_link(jme);
23452337
23462338 return 0;
drivers/net/ethernet/jme.h+1−1
@@ -730,7 +730,7 @@ enum jme_rxcs_values { · 729 unmodified lines
730730 RXCS_RETRYCNT_60 = 0x00000F00,
731731
732732 RXCS_DEFAULT = RXCS_FIFOTHTP_128T |
733− RXCS_FIFOTHNP_128QW |
733+ RXCS_FIFOTHNP_16QW |
734734 RXCS_DMAREQSZ_128B |
735735 RXCS_RETRYGAP_256ns |
736736 RXCS_RETRYCNT_32,
drivers/net/ethernet/marvell/skge.c+13−58
@@ -931,20 +931,17 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base) · 930 unmodified lines
931931 }
932932
933933 /* Allocate and setup a new buffer for receiving */
934−static int skge_rx_setup(struct pci_dev *pdev,
935− struct skge_element *e,
936− struct sk_buff *skb, unsigned int bufsize)
934+static void skge_rx_setup(struct skge_port *skge, struct skge_element *e,
935+ struct sk_buff *skb, unsigned int bufsize)
937936 {
938937 struct skge_rx_desc *rd = e->desc;
939− dma_addr_t map;
938+ u64 map;
940939
941− map = pci_map_single(pdev, skb->data, bufsize,
940+ map = pci_map_single(skge->hw->pdev, skb->data, bufsize,
942941 PCI_DMA_FROMDEVICE);
943− if (pci_dma_mapping_error(pdev, map))
944− goto mapping_error;
945942
946− rd->dma_lo = lower_32_bits(map);
947− rd->dma_hi = upper_32_bits(map);
943+ rd->dma_lo = map;
944+ rd->dma_hi = map >> 32;
948945 e->skb = skb;
949946 rd->csum1_start = ETH_HLEN;
950947 rd->csum2_start = ETH_HLEN;
@@ -956,13 +953,6 @@ static int skge_rx_setup(struct pci_dev *pdev, · 5 unmodified lines
956953 rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize;
957954 dma_unmap_addr_set(e, mapaddr, map);
958955 dma_unmap_len_set(e, maplen, bufsize);
959− return 0;
960−
961−mapping_error:
962− if (net_ratelimit())
963− dev_warn(&pdev->dev, "%s: rx mapping error\n",
964− skb->dev->name);
965− return -EIO;
966956 }
967957
968958 /* Resume receiving using existing skb,
@@ -1024,11 +1014,7 @@ static int skge_rx_fill(struct net_device *dev) · 55 unmodified lines
10241014 return -ENOMEM;
10251015
10261016 skb_reserve(skb, NET_IP_ALIGN);
1027− if (skge_rx_setup(skge->hw->pdev, e, skb, skge->rx_buf_size)) {
1028− kfree_skb(skb);
1029− return -ENOMEM;
1030− }
1031−
1017+ skge_rx_setup(skge, e, skb, skge->rx_buf_size);
10321018 } while ((e = e->next) != ring->start);
10331019
10341020 ring->to_clean = ring->start;
@@ -2743,7 +2729,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, · 1708 unmodified lines
27432729 struct skge_tx_desc *td;
27442730 int i;
27452731 u32 control, len;
2746− dma_addr_t map;
2732+ u64 map;
27472733
27482734 if (skb_padto(skb, ETH_ZLEN))
27492735 return NETDEV_TX_OK;
@@ -2757,14 +2743,11 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, · 7 unmodified lines
27572743 e->skb = skb;
27582744 len = skb_headlen(skb);
27592745 map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);
2760− if (pci_dma_mapping_error(hw->pdev, map))
2761− goto mapping_error;
2762−
27632746 dma_unmap_addr_set(e, mapaddr, map);
27642747 dma_unmap_len_set(e, maplen, len);
27652748
2766− td->dma_lo = lower_32_bits(map);
2767− td->dma_hi = upper_32_bits(map);
2749+ td->dma_lo = map;
2750+ td->dma_hi = map >> 32;
27682751
27692752 if (skb->ip_summed == CHECKSUM_PARTIAL) {
27702753 const int offset = skb_checksum_start_offset(skb);
@@ -2795,16 +2778,14 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, · 24 unmodified lines
27952778
27962779 map = skb_frag_dma_map(&hw->pdev->dev, frag, 0,
27972780 skb_frag_size(frag), DMA_TO_DEVICE);
2798− if (dma_mapping_error(&hw->pdev->dev, map))
2799− goto mapping_unwind;
28002781
28012782 e = e->next;
28022783 e->skb = skb;
28032784 tf = e->desc;
28042785 BUG_ON(tf->control & BMU_OWN);
28052786
2806− tf->dma_lo = lower_32_bits(map);
2807− tf->dma_hi = upper_32_bits(map);
2787+ tf->dma_lo = map;
2788+ tf->dma_hi = (u64) map >> 32;
28082789 dma_unmap_addr_set(e, mapaddr, map);
28092790 dma_unmap_len_set(e, maplen, skb_frag_size(frag));
28102791
@@ -2834,28 +2815,6 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, · 23 unmodified lines
28342815 }
28352816
28362817 return NETDEV_TX_OK;
2837−
2838−mapping_unwind:
2839− /* unroll any pages that were already mapped. */
2840− if (e != skge->tx_ring.to_use) {
2841− struct skge_element *u;
2842−
2843− for (u = skge->tx_ring.to_use->next; u != e; u = u->next)
2844− pci_unmap_page(hw->pdev, dma_unmap_addr(u, mapaddr),
2845− dma_unmap_len(u, maplen),
2846− PCI_DMA_TODEVICE);
2847− e = skge->tx_ring.to_use;
2848− }
2849− /* undo the mapping for the skb header */
2850− pci_unmap_single(hw->pdev, dma_unmap_addr(e, mapaddr),
2851− dma_unmap_len(e, maplen),
2852− PCI_DMA_TODEVICE);
2853−mapping_error:
2854− /* mapping error causes error message and packet to be discarded. */
2855− if (net_ratelimit())
2856− dev_warn(&hw->pdev->dev, "%s: tx mapping error\n", dev->name);
2857− dev_kfree_skb(skb);
2858− return NETDEV_TX_OK;
28592818 }
28602819
28612820
@@ -3099,17 +3058,13 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, · 237 unmodified lines
30993058 if (!nskb)
31003059 goto resubmit;
31013060
3102− if (unlikely(skge_rx_setup(skge->hw->pdev, e, nskb, skge->rx_buf_size))) {
3103− dev_kfree_skb(nskb);
3104− goto resubmit;
3105− }
3106−
31073061 pci_unmap_single(skge->hw->pdev,
31083062 dma_unmap_addr(e, mapaddr),
31093063 dma_unmap_len(e, maplen),
31103064 PCI_DMA_FROMDEVICE);
31113065 skb = e->skb;
31123066 prefetch(skb->data);
3067+ skge_rx_setup(skge, e, nskb, skge->rx_buf_size);
31133068 }
31143069
31153070 skb_put(skb, len);
drivers/net/ethernet/mellanox/mlx4/cmd.c+5−5
@@ -1616,12 +1616,12 @@ void mlx4_multi_func_cleanup(struct mlx4_dev *dev) · 1615 unmodified lines
16161616 kfree(priv->mfunc.master.slave_state[i].vlan_filter[port]);
16171617 }
16181618 kfree(priv->mfunc.master.slave_state);
1619− iounmap(priv->mfunc.comm);
1620− dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE,
1621− priv->mfunc.vhcr,
1622− priv->mfunc.vhcr_dma);
1623− priv->mfunc.vhcr = NULL;
16241619 }
1620+
1621+ iounmap(priv->mfunc.comm);
1622+ dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE,
1623+ priv->mfunc.vhcr, priv->mfunc.vhcr_dma);
1624+ priv->mfunc.vhcr = NULL;
16251625 }
16261626
16271627 void mlx4_cmd_cleanup(struct mlx4_dev *dev)
drivers/net/ethernet/mellanox/mlx4/en_netdev.c+2−1
@@ -892,7 +892,8 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv) · 891 unmodified lines
892892
893893 for (i = 0; i < priv->rx_ring_num; i++) {
894894 if (priv->rx_ring[i].rx_info)
895− mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i]);
895+ mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i],
896+ priv->prof->rx_ring_size, priv->stride);
896897 if (priv->rx_cq[i].buf)
897898 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]);
898899 }
drivers/net/ethernet/mellanox/mlx4/en_rx.c+7−3
@@ -168,8 +168,12 @@ static int mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv, · 167 unmodified lines
168168 return 0;
169169
170170 err:
171− while (i--)
171+ while (i--) {
172+ dma_addr_t dma = be64_to_cpu(rx_desc->data[i].addr);
173+ pci_unmap_single(priv->mdev->pdev, dma, skb_frags[i].size,
174+ PCI_DMA_FROMDEVICE);
172175 put_page(skb_frags[i].page);
176+ }
173177 return -ENOMEM;
174178 }
175179
@@ -380,12 +384,12 @@ err_allocator: · 204 unmodified lines
380384 }
381385
382386 void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
383− struct mlx4_en_rx_ring *ring)
387+ struct mlx4_en_rx_ring *ring, u32 size, u16 stride)
384388 {
385389 struct mlx4_en_dev *mdev = priv->mdev;
386390
387391 mlx4_en_unmap_buffer(&ring->wqres.buf);
388− mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size + TXBB_SIZE);
392+ mlx4_free_hwq_res(mdev->dev, &ring->wqres, size * stride + TXBB_SIZE);
389393 vfree(ring->rx_info);
390394 ring->rx_info = NULL;
391395 }
drivers/net/ethernet/mellanox/mlx4/eq.c+7−6
@@ -815,8 +815,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev) · 814 unmodified lines
815815 int err;
816816 int i;
817817
818− priv->eq_table.uar_map = kcalloc(sizeof *priv->eq_table.uar_map,
819− mlx4_num_eq_uar(dev), GFP_KERNEL);
818+ priv->eq_table.uar_map = kcalloc(mlx4_num_eq_uar(dev),
819+ sizeof *priv->eq_table.uar_map,
820+ GFP_KERNEL);
820821 if (!priv->eq_table.uar_map) {
821822 err = -ENOMEM;
822823 goto err_out_free;
@@ -1035,7 +1036,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) · 212 unmodified lines
10351036 struct mlx4_priv *priv = mlx4_priv(dev);
10361037 int vec = 0, err = 0, i;
10371038
1038− spin_lock(&priv->msix_ctl.pool_lock);
1039+ mutex_lock(&priv->msix_ctl.pool_lock);
10391040 for (i = 0; !vec && i < dev->caps.comp_pool; i++) {
10401041 if (~priv->msix_ctl.pool_bm & 1ULL << i) {
10411042 priv->msix_ctl.pool_bm |= 1ULL << i;
@@ -1057,7 +1058,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) · 15 unmodified lines
10571058 eq_set_ci(&priv->eq_table.eq[vec], 1);
10581059 }
10591060 }
1060− spin_unlock(&priv->msix_ctl.pool_lock);
1061+ mutex_unlock(&priv->msix_ctl.pool_lock);
10611062
10621063 if (vec) {
10631064 *vector = vec;
@@ -1078,13 +1079,13 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec) · 14 unmodified lines
10781079 if (likely(i >= 0)) {
10791080 /*sanity check , making sure were not trying to free irq's
10801081 Belonging to a legacy EQ*/
1081− spin_lock(&priv->msix_ctl.pool_lock);
1082+ mutex_lock(&priv->msix_ctl.pool_lock);
10821083 if (priv->msix_ctl.pool_bm & 1ULL << i) {
10831084 free_irq(priv->eq_table.eq[vec].irq,
10841085 &priv->eq_table.eq[vec]);
10851086 priv->msix_ctl.pool_bm &= ~(1ULL << i);
10861087 }
1087− spin_unlock(&priv->msix_ctl.pool_lock);
1088+ mutex_unlock(&priv->msix_ctl.pool_lock);
10881089 }
10891090
10901091 }
drivers/net/ethernet/mellanox/mlx4/fw.c+1−1
@@ -685,7 +685,7 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, · 684 unmodified lines
685685 return err;
686686 }
687687
688−static int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port)
688+int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port)
689689 {
690690 struct mlx4_cmd_mailbox *outbox = ptr;
691691
drivers/net/ethernet/mellanox/mlx4/main.c+6−4
@@ -531,15 +531,14 @@ int mlx4_change_port_types(struct mlx4_dev *dev, · 530 unmodified lines
531531 for (port = 0; port < dev->caps.num_ports; port++) {
532532 /* Change the port type only if the new type is different
533533 * from the current, and not set to Auto */
534− if (port_types[port] != dev->caps.port_type[port + 1]) {
534+ if (port_types[port] != dev->caps.port_type[port + 1])
535535 change = 1;
536− dev->caps.port_type[port + 1] = port_types[port];
537− }
538536 }
539537 if (change) {
540538 mlx4_unregister_device(dev);
541539 for (port = 1; port <= dev->caps.num_ports; port++) {
542540 mlx4_CLOSE_PORT(dev, port);
541+ dev->caps.port_type[port] = port_types[port - 1];
543542 err = mlx4_SET_PORT(dev, port);
544543 if (err) {
545544 mlx4_err(dev, "Failed to set port %d, "
@@ -986,6 +985,9 @@ static int map_bf_area(struct mlx4_dev *dev) · 440 unmodified lines
986985 resource_size_t bf_len;
987986 int err = 0;
988987
988+ if (!dev->caps.bf_reg_size)
989+ return -ENXIO;
990+
989991 bf_start = pci_resource_start(dev->pdev, 2) +
990992 (dev->caps.num_uars << PAGE_SHIFT);
991993 bf_len = pci_resource_len(dev->pdev, 2) -
@@ -1825,7 +1827,7 @@ slave_start: · 833 unmodified lines
18251827 goto err_master_mfunc;
18261828
18271829 priv->msix_ctl.pool_bm = 0;
1828− spin_lock_init(&priv->msix_ctl.pool_lock);
1830+ mutex_init(&priv->msix_ctl.pool_lock);
18291831
18301832 mlx4_enable_msi_x(dev);
18311833 if ((mlx4_is_mfunc(dev)) &&
drivers/net/ethernet/mellanox/mlx4/mcg.c+8−8
@@ -136,7 +136,7 @@ static int new_steering_entry(struct mlx4_dev *dev, u8 port, · 135 unmodified lines
136136 u32 prot;
137137 int err;
138138
139− s_steer = &mlx4_priv(dev)->steer[0];
139+ s_steer = &mlx4_priv(dev)->steer[port - 1];
140140 new_entry = kzalloc(sizeof *new_entry, GFP_KERNEL);
141141 if (!new_entry)
142142 return -ENOMEM;
@@ -220,7 +220,7 @@ static int existing_steering_entry(struct mlx4_dev *dev, u8 port, · 77 unmodified lines
220220 struct mlx4_promisc_qp *pqp;
221221 struct mlx4_promisc_qp *dqp;
222222
223− s_steer = &mlx4_priv(dev)->steer[0];
223+ s_steer = &mlx4_priv(dev)->steer[port - 1];
224224
225225 pqp = get_promisc_qp(dev, 0, steer, qpn);
226226 if (!pqp)
@@ -265,7 +265,7 @@ static bool check_duplicate_entry(struct mlx4_dev *dev, u8 port, · 38 unmodified lines
265265 struct mlx4_steer_index *tmp_entry, *entry = NULL;
266266 struct mlx4_promisc_qp *dqp, *tmp_dqp;
267267
268− s_steer = &mlx4_priv(dev)->steer[0];
268+ s_steer = &mlx4_priv(dev)->steer[port - 1];
269269
270270 /* if qp is not promisc, it cannot be duplicated */
271271 if (!get_promisc_qp(dev, 0, steer, qpn))
@@ -306,7 +306,7 @@ static bool can_remove_steering_entry(struct mlx4_dev *dev, u8 port, · 34 unmodified lines
306306 bool ret = false;
307307 int i;
308308
309− s_steer = &mlx4_priv(dev)->steer[0];
309+ s_steer = &mlx4_priv(dev)->steer[port - 1];
310310
311311 mailbox = mlx4_alloc_cmd_mailbox(dev);
312312 if (IS_ERR(mailbox))
@@ -361,7 +361,7 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, · 48 unmodified lines
361361 int err;
362362 struct mlx4_priv *priv = mlx4_priv(dev);
363363
364− s_steer = &mlx4_priv(dev)->steer[0];
364+ s_steer = &mlx4_priv(dev)->steer[port - 1];
365365
366366 mutex_lock(&priv->mcg_table.mutex);
367367
@@ -466,7 +466,7 @@ static int remove_promisc_qp(struct mlx4_dev *dev, u8 port, · 98 unmodified lines
466466 int loc, i;
467467 int err;
468468
469− s_steer = &mlx4_priv(dev)->steer[0];
469+ s_steer = &mlx4_priv(dev)->steer[port - 1];
470470 mutex_lock(&priv->mcg_table.mutex);
471471
472472 pqp = get_promisc_qp(dev, 0, steer, qpn);
@@ -1004,7 +1004,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc_remove); · 531 unmodified lines
10041004
10051005 int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port)
10061006 {
1007− if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER))
1007+ if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER))
10081008 return 0;
10091009
10101010 if (mlx4_is_mfunc(dev))
@@ -1016,7 +1016,7 @@ EXPORT_SYMBOL_GPL(mlx4_unicast_promisc_add); · 5 unmodified lines
10161016
10171017 int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port)
10181018 {
1019− if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER))
1019+ if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER))
10201020 return 0;
10211021
10221022 if (mlx4_is_mfunc(dev))
drivers/net/ethernet/mellanox/mlx4/mlx4.h+1−1
@@ -697,7 +697,7 @@ struct mlx4_sense { · 696 unmodified lines
697697
698698 struct mlx4_msix_ctl {
699699 u64 pool_bm;
700− spinlock_t pool_lock;
700+ struct mutex pool_lock;
701701 };
702702
703703 struct mlx4_steer {
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h+2−1
@@ -528,7 +528,8 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv, · 527 unmodified lines
528528 struct mlx4_en_rx_ring *ring,
529529 u32 size, u16 stride);
530530 void mlx4_en_destroy_rx_ring(struct mlx4_en_priv *priv,
531− struct mlx4_en_rx_ring *ring);
531+ struct mlx4_en_rx_ring *ring,
532+ u32 size, u16 stride);
532533 int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv);
533534 void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv,
534535 struct mlx4_en_rx_ring *ring);
drivers/net/ethernet/mellanox/mlx4/mr.c+6−6
@@ -304,7 +304,7 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox · 303 unmodified lines
304304 MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED);
305305 }
306306
307−static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align,
307+int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align,
308308 u32 *base_mridx)
309309 {
310310 struct mlx4_priv *priv = mlx4_priv(dev);
@@ -320,14 +320,14 @@ static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, · 9 unmodified lines
320320 }
321321 EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range);
322322
323−static void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt)
323+void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt)
324324 {
325325 struct mlx4_priv *priv = mlx4_priv(dev);
326326 mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt);
327327 }
328328 EXPORT_SYMBOL_GPL(mlx4_mr_release_range);
329329
330−static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd,
330+int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd,
331331 u64 iova, u64 size, u32 access, int npages,
332332 int page_shift, struct mlx4_mr *mr)
333333 {
@@ -457,7 +457,7 @@ int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access, · 123 unmodified lines
457457 }
458458 EXPORT_SYMBOL_GPL(mlx4_mr_alloc);
459459
460−static void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr)
460+void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr)
461461 {
462462 int err;
463463
@@ -852,7 +852,7 @@ err_free: · 388 unmodified lines
852852 }
853853 EXPORT_SYMBOL_GPL(mlx4_fmr_alloc);
854854
855−static int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx,
855+int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx,
856856 u32 pd, u32 access, int max_pages,
857857 int max_maps, u8 page_shift, struct mlx4_fmr *fmr)
858858 {
@@ -954,7 +954,7 @@ int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr) · 95 unmodified lines
954954 }
955955 EXPORT_SYMBOL_GPL(mlx4_fmr_free);
956956
957−static int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr)
957+int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr)
958958 {
959959 if (fmr->maps)
960960 return -EBUSY;
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c+13−8
@@ -73,6 +73,7 @@ struct res_gid { · 72 unmodified lines
7373 struct list_head list;
7474 u8 gid[16];
7575 enum mlx4_protocol prot;
76+ enum mlx4_steer_type steer;
7677 };
7778
7879 enum res_qp_states {
@@ -374,6 +375,7 @@ static struct res_common *alloc_qp_tr(int id) · 295 unmodified lines
374375
375376 ret->com.res_id = id;
376377 ret->com.state = RES_QP_RESERVED;
378+ ret->local_qpn = id;
377379 INIT_LIST_HEAD(&ret->mcg_list);
378380 spin_lock_init(&ret->mcg_spl);
379381
@@ -2479,7 +2481,8 @@ static struct res_gid *find_gid(struct mlx4_dev *dev, int slave, · 2099 unmodified lines
24792481 }
24802482
24812483 static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
2482− u8 *gid, enum mlx4_protocol prot)
2484+ u8 *gid, enum mlx4_protocol prot,
2485+ enum mlx4_steer_type steer)
24832486 {
24842487 struct res_gid *res;
24852488 int err;
@@ -2495,6 +2498,7 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, · 9 unmodified lines
24952498 } else {
24962499 memcpy(res->gid, gid, 16);
24972500 res->prot = prot;
2501+ res->steer = steer;
24982502 list_add_tail(&res->list, &rqp->mcg_list);
24992503 err = 0;
25002504 }
@@ -2504,14 +2508,15 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp, · 3 unmodified lines
25042508 }
25052509
25062510 static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
2507− u8 *gid, enum mlx4_protocol prot)
2511+ u8 *gid, enum mlx4_protocol prot,
2512+ enum mlx4_steer_type steer)
25082513 {
25092514 struct res_gid *res;
25102515 int err;
25112516
25122517 spin_lock_irq(&rqp->mcg_spl);
25132518 res = find_gid(dev, slave, rqp, gid);
2514− if (!res || res->prot != prot)
2519+ if (!res || res->prot != prot || res->steer != steer)
25152520 err = -EINVAL;
25162521 else {
25172522 list_del(&res->list);
@@ -2538,7 +2543,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, · 20 unmodified lines
25382543 int attach = vhcr->op_modifier;
25392544 int block_loopback = vhcr->in_modifier >> 31;
25402545 u8 steer_type_mask = 2;
2541− enum mlx4_steer_type type = gid[7] & steer_type_mask;
2546+ enum mlx4_steer_type type = (gid[7] & steer_type_mask) >> 1;
25422547
25432548 qpn = vhcr->in_modifier & 0xffffff;
25442549 err = get_res(dev, slave, qpn, RES_QP, &rqp);
@@ -2547,7 +2552,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, · 2 unmodified lines
25472552
25482553 qp.qpn = qpn;
25492554 if (attach) {
2550− err = add_mcg_res(dev, slave, rqp, gid, prot);
2555+ err = add_mcg_res(dev, slave, rqp, gid, prot, type);
25512556 if (err)
25522557 goto ex_put;
25532558
@@ -2556,7 +2561,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, · 2 unmodified lines
25562561 if (err)
25572562 goto ex_rem;
25582563 } else {
2559− err = rem_mcg_res(dev, slave, rqp, gid, prot);
2564+ err = rem_mcg_res(dev, slave, rqp, gid, prot, type);
25602565 if (err)
25612566 goto ex_put;
25622567 err = mlx4_qp_detach_common(dev, &qp, gid, prot, type);
@@ -2567,7 +2572,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave, · 4 unmodified lines
25672572
25682573 ex_rem:
25692574 /* ignore error return below, already in error */
2570− err1 = rem_mcg_res(dev, slave, rqp, gid, prot);
2575+ err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type);
25712576 ex_put:
25722577 put_res(dev, slave, qpn, RES_QP);
25732578
@@ -2606,7 +2611,7 @@ static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp) · 32 unmodified lines
26062611 list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) {
26072612 qp.qpn = rqp->local_qpn;
26082613 err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
2609− MLX4_MC_STEER);
2614+ rgid->steer);
26102615 list_del(&rgid->list);
26112616 kfree(rgid);
26122617 }
drivers/net/ethernet/micrel/Kconfig+0−1
@@ -42,7 +42,6 @@ config KS8851 · 41 unmodified lines
4242 select NET_CORE
4343 select MII
4444 select CRC32
45− select MISC_DEVICES
4645 select EEPROM_93CX6
4746 ---help---
4847 SPI driver for Micrel KS8851 SPI attached network chip.
drivers/net/ethernet/micrel/ks8851.c+1−1
@@ -583,7 +583,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks) · 582 unmodified lines
583583 ks8851_dbg_dumpkkt(ks, rxpkt);
584584
585585 skb->protocol = eth_type_trans(skb, ks->netdev);
586− netif_rx(skb);
586+ netif_rx_ni(skb);
587587
588588 ks->netdev->stats.rx_packets++;
589589 ks->netdev->stats.rx_bytes += rxlen;
drivers/net/ethernet/micrel/ks8851_mll.c+6−8
@@ -394,7 +394,6 @@ union ks_tx_hdr { · 393 unmodified lines
394394 * @msg_enable : The message flags controlling driver output (see ethtool).
395395 * @frame_cnt : number of frames received.
396396 * @bus_width : i/o bus width.
397− * @irq : irq number assigned to this device.
398397 * @rc_rxqcr : Cached copy of KS_RXQCR.
399398 * @rc_txcr : Cached copy of KS_TXCR.
400399 * @rc_ier : Cached copy of KS_IER.
@@ -441,7 +440,6 @@ struct ks_net { · 40 unmodified lines
441440 u32 msg_enable;
442441 u32 frame_cnt;
443442 int bus_width;
444− int irq;
445443
446444 u16 rc_rxqcr;
447445 u16 rc_txcr;
@@ -907,10 +905,10 @@ static int ks_net_open(struct net_device *netdev) · 459 unmodified lines
907905 netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__);
908906
909907 /* reset the HW */
910− err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
908+ err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
911909
912910 if (err) {
913− pr_err("Failed to request IRQ: %d: %d\n", ks->irq, err);
911+ pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err);
914912 return err;
915913 }
916914
@@ -955,7 +953,7 @@ static int ks_net_stop(struct net_device *netdev) · 38 unmodified lines
955953
956954 /* set powermode to soft power down to save power */
957955 ks_set_powermode(ks, PMECR_PM_SOFTDOWN);
958− free_irq(ks->irq, netdev);
956+ free_irq(netdev->irq, netdev);
959957 mutex_unlock(&ks->lock);
960958 return 0;
961959 }
@@ -1545,10 +1543,10 @@ static int __devinit ks8851_probe(struct platform_device *pdev) · 583 unmodified lines
15451543 if (!ks->hw_addr_cmd)
15461544 goto err_ioremap1;
15471545
1548− ks->irq = platform_get_irq(pdev, 0);
1546+ netdev->irq = platform_get_irq(pdev, 0);
15491547
1550− if (ks->irq < 0) {
1551− err = ks->irq;
1548+ if ((int)netdev->irq < 0) {
1549+ err = netdev->irq;
15521550 goto err_get_irq;
15531551 }
15541552
drivers/net/ethernet/octeon/octeon_mgmt.c+2−2
@@ -670,7 +670,7 @@ static void octeon_mgmt_adjust_link(struct net_device *netdev) · 669 unmodified lines
670670 static int octeon_mgmt_init_phy(struct net_device *netdev)
671671 {
672672 struct octeon_mgmt *p = netdev_priv(netdev);
673− char phy_id[20];
673+ char phy_id[MII_BUS_ID_SIZE + 3];
674674
675675 if (octeon_is_simulation()) {
676676 /* No PHYs in the simulator. */
@@ -678,7 +678,7 @@ static int octeon_mgmt_init_phy(struct net_device *netdev) · 1 unmodified line
678678 return 0;
679679 }
680680
681− snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "0", p->port);
681+ snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port);
682682
683683 p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0,
684684 PHY_INTERFACE_MODE_MII);
drivers/net/ethernet/renesas/sh_eth.c+3−1
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #include <linux/pm_runtime.h>
3939 #include <linux/slab.h>
4040 #include <linux/ethtool.h>
41+#include <linux/if_vlan.h>
4142 #include <linux/sh_eth.h>
4243
4344 #include "sh_eth.h"
@@ -817,7 +818,8 @@ static int sh_eth_dev_init(struct net_device *ndev) · 773 unmodified lines
817818 sh_eth_write(ndev, 0, TRIMD);
818819
819820 /* Recv frame limit set register */
820− sh_eth_write(ndev, RFLR_VALUE, RFLR);
821+ sh_eth_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN,
822+ RFLR);
821823
822824 sh_eth_write(ndev, sh_eth_read(ndev, EESR), EESR);
823825 sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR);
drivers/net/ethernet/renesas/sh_eth.h+0−3
@@ -575,9 +575,6 @@ enum RPADIR_BIT { · 574 unmodified lines
575575 RPADIR_PADR = 0x0003f,
576576 };
577577
578−/* RFLR */
579−#define RFLR_VALUE 0x1000
580−
581578 /* FDR */
582579 #define DEFAULT_FDR_INIT 0x00000707
583580
drivers/net/ethernet/sfc/rx.c+2−2
@@ -156,11 +156,10 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue) · 155 unmodified lines
156156 if (unlikely(!skb))
157157 return -ENOMEM;
158158
159− /* Adjust the SKB for padding and checksum */
159+ /* Adjust the SKB for padding */
160160 skb_reserve(skb, NET_IP_ALIGN);
161161 rx_buf->len = skb_len - NET_IP_ALIGN;
162162 rx_buf->is_page = false;
163− skb->ip_summed = CHECKSUM_UNNECESSARY;
164163
165164 rx_buf->dma_addr = pci_map_single(efx->pci_dev,
166165 skb->data, rx_buf->len,
@@ -496,6 +495,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel, · 329 unmodified lines
496495
497496 EFX_BUG_ON_PARANOID(!checksummed);
498497 rx_buf->u.skb = NULL;
498+ skb->ip_summed = CHECKSUM_UNNECESSARY;
499499
500500 gro_result = napi_gro_receive(napi, skb);
501501 }
drivers/net/ethernet/stmicro/stmmac/common.h+1−0
@@ -67,6 +67,7 @@ struct stmmac_extra_stats { · 66 unmodified lines
6767 unsigned long ipc_csum_error;
6868 unsigned long rx_collision;
6969 unsigned long rx_crc;
70+ unsigned long dribbling_bit;
7071 unsigned long rx_length;
7172 unsigned long rx_mii;
7273 unsigned long rx_multicast;
drivers/net/ethernet/stmicro/stmmac/enh_desc.c+1−1
@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, · 200 unmodified lines
201201
202202 if (unlikely(p->des01.erx.dribbling)) {
203203 CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n");
204− ret = discard_frame;
204+ x->dribbling_bit++;
205205 }
206206 if (unlikely(p->des01.erx.sa_filter_fail)) {
207207 CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n");
drivers/net/ethernet/stmicro/stmmac/norm_desc.c+1−1
@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, · 103 unmodified lines
104104 ret = discard_frame;
105105 }
106106 if (unlikely(p->des01.rx.dribbling))
107− ret = discard_frame;
107+ x->dribbling_bit++;
108108
109109 if (unlikely(p->des01.rx.length_error)) {
110110 x->rx_length++;
drivers/net/ethernet/stmicro/stmmac/stmmac.h+3−2
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 *******************************************************************************/
2222
2323 #define STMMAC_RESOURCE_NAME "stmmaceth"
24−#define DRV_MODULE_VERSION "Dec_2011"
24+#define DRV_MODULE_VERSION "Feb_2012"
2525 #include <linux/stmmac.h>
2626 #include <linux/phy.h>
2727 #include "common.h"
@@ -97,4 +97,5 @@ int stmmac_resume(struct net_device *ndev); · 69 unmodified lines
9797 int stmmac_suspend(struct net_device *ndev);
9898 int stmmac_dvr_remove(struct net_device *ndev);
9999 struct stmmac_priv *stmmac_dvr_probe(struct device *device,
100− struct plat_stmmacenet_data *plat_dat);
100+ struct plat_stmmacenet_data *plat_dat,
101+ void __iomem *addr);
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c+6−1
@@ -47,23 +47,25 @@ struct stmmac_stats { · 46 unmodified lines
4747 offsetof(struct stmmac_priv, xstats.m)}
4848
4949 static const struct stmmac_stats stmmac_gstrings_stats[] = {
50+ /* Transmit errors */
5051 STMMAC_STAT(tx_underflow),
5152 STMMAC_STAT(tx_carrier),
5253 STMMAC_STAT(tx_losscarrier),
5354 STMMAC_STAT(vlan_tag),
5455 STMMAC_STAT(tx_deferred),
5556 STMMAC_STAT(tx_vlan),
56− STMMAC_STAT(rx_vlan),
5757 STMMAC_STAT(tx_jabber),
5858 STMMAC_STAT(tx_frame_flushed),
5959 STMMAC_STAT(tx_payload_error),
6060 STMMAC_STAT(tx_ip_header_error),
61+ /* Receive errors */
6162 STMMAC_STAT(rx_desc),
6263 STMMAC_STAT(sa_filter_fail),
6364 STMMAC_STAT(overflow_error),
6465 STMMAC_STAT(ipc_csum_error),
6566 STMMAC_STAT(rx_collision),
6667 STMMAC_STAT(rx_crc),
68+ STMMAC_STAT(dribbling_bit),
6769 STMMAC_STAT(rx_length),
6870 STMMAC_STAT(rx_mii),
6971 STMMAC_STAT(rx_multicast),
@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { · 3 unmodified lines
7375 STMMAC_STAT(sa_rx_filter_fail),
7476 STMMAC_STAT(rx_missed_cntr),
7577 STMMAC_STAT(rx_overflow_cntr),
78+ STMMAC_STAT(rx_vlan),
79+ /* Tx/Rx IRQ errors */
7680 STMMAC_STAT(tx_undeflow_irq),
7781 STMMAC_STAT(tx_process_stopped_irq),
7882 STMMAC_STAT(tx_jabber_irq),
@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = { · 3 unmodified lines
8286 STMMAC_STAT(rx_watchdog_irq),
8387 STMMAC_STAT(tx_early_irq),
8488 STMMAC_STAT(fatal_bus_error_irq),
89+ /* Extra info */
8590 STMMAC_STAT(threshold),
8691 STMMAC_STAT(tx_pkt_n),
8792 STMMAC_STAT(rx_pkt_n),
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+107−98
@@ -241,7 +241,7 @@ static void stmmac_adjust_link(struct net_device *dev) · 240 unmodified lines
241241 case 1000:
242242 if (likely(priv->plat->has_gmac))
243243 ctrl &= ~priv->hw->link.port;
244− stmmac_hw_fix_mac_speed(priv);
244+ stmmac_hw_fix_mac_speed(priv);
245245 break;
246246 case 100:
247247 case 10:
@@ -785,7 +785,7 @@ static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) · 537 unmodified lines
785785 u32 uid = ((hwid & 0x0000ff00) >> 8);
786786 u32 synid = (hwid & 0x000000ff);
787787
788− pr_info("STMMAC - user ID: 0x%x, Synopsys ID: 0x%x\n",
788+ pr_info("stmmac - user ID: 0x%x, Synopsys ID: 0x%x\n",
789789 uid, synid);
790790
791791 return synid;
@@ -869,38 +869,6 @@ static int stmmac_get_hw_features(struct stmmac_priv *priv) · 77 unmodified lines
869869 return hw_cap;
870870 }
871871
872−/**
873− * stmmac_mac_device_setup
874− * @dev : device pointer
875− * Description: this is to attach the GMAC or MAC 10/100
876− * main core structures that will be completed during the
877− * open step.
878− */
879−static int stmmac_mac_device_setup(struct net_device *dev)
880−{
881− struct stmmac_priv *priv = netdev_priv(dev);
882−
883− struct mac_device_info *device;
884−
885− if (priv->plat->has_gmac)
886− device = dwmac1000_setup(priv->ioaddr);
887− else
888− device = dwmac100_setup(priv->ioaddr);
889−
890− if (!device)
891− return -ENOMEM;
892−
893− priv->hw = device;
894− priv->hw->ring = &ring_mode_ops;
895−
896− if (device_can_wakeup(priv->device)) {
897− priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */
898− enable_irq_wake(priv->wol_irq);
899− }
900−
901− return 0;
902−}
903−
904872 static void stmmac_check_ether_addr(struct stmmac_priv *priv)
905873 {
906874 /* verify if the MAC address is valid, in case of failures it
@@ -930,20 +898,8 @@ static int stmmac_open(struct net_device *dev) · 23 unmodified lines
930898 struct stmmac_priv *priv = netdev_priv(dev);
931899 int ret;
932900
933− /* MAC HW device setup */
934− ret = stmmac_mac_device_setup(dev);
935− if (ret < 0)
936− return ret;
937−
938901 stmmac_check_ether_addr(priv);
939902
940− stmmac_verify_args();
941−
942− /* Override with kernel parameters if supplied XXX CRS XXX
943− * this needs to have multiple instances */
944− if ((phyaddr >= 0) && (phyaddr <= 31))
945− priv->plat->phy_addr = phyaddr;
946−
947903 /* MDIO bus Registration */
948904 ret = stmmac_mdio_register(dev);
949905 if (ret < 0) {
@@ -976,44 +932,6 @@ static int stmmac_open(struct net_device *dev) · 26 unmodified lines
976932 goto open_error;
977933 }
978934
979− stmmac_get_synopsys_id(priv);
980−
981− priv->hw_cap_support = stmmac_get_hw_features(priv);
982−
983− if (priv->hw_cap_support) {
984− pr_info(" Support DMA HW capability register");
985−
986− /* We can override some gmac/dma configuration fields: e.g.
987− * enh_desc, tx_coe (e.g. that are passed through the
988− * platform) with the values from the HW capability
989− * register (if supported).
990− */
991− priv->plat->enh_desc = priv->dma_cap.enh_desc;
992− priv->plat->tx_coe = priv->dma_cap.tx_coe;
993− priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
994−
995− /* By default disable wol on magic frame if not supported */
996− if (!priv->dma_cap.pmt_magic_frame)
997− priv->wolopts &= ~WAKE_MAGIC;
998−
999− } else
1000− pr_info(" No HW DMA feature register supported");
1001−
1002− /* Select the enhnaced/normal descriptor structures */
1003− stmmac_selec_desc_mode(priv);
1004−
1005− /* PMT module is not integrated in all the MAC devices. */
1006− if (priv->plat->pmt) {
1007− pr_info(" Remote wake-up capable\n");
1008− device_set_wakeup_capable(priv->device, 1);
1009− }
1010−
1011− priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr);
1012− if (priv->rx_coe)
1013− pr_info(" Checksum Offload Engine supported\n");
1014− if (priv->plat->tx_coe)
1015− pr_info(" Checksum insertion supported\n");
1016−
1017935 /* Create and initialize the TX/RX descriptors chains. */
1018936 priv->dma_tx_size = STMMAC_ALIGN(dma_txsize);
1019937 priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize);
@@ -1030,14 +948,14 @@ static int stmmac_open(struct net_device *dev) · 10 unmodified lines
1030948
1031949 /* Copy the MAC addr into the HW */
1032950 priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0);
951+
1033952 /* If required, perform hw setup of the bus. */
1034953 if (priv->plat->bus_setup)
1035954 priv->plat->bus_setup(priv->ioaddr);
955+
1036956 /* Initialize the MAC Core */
1037957 priv->hw->mac->core_init(priv->ioaddr);
1038958
1039− netdev_update_features(dev);
1040−
1041959 /* Request the IRQ lines */
1042960 ret = request_irq(dev->irq, stmmac_interrupt,
1043961 IRQF_SHARED, dev->name, dev);
@@ -1047,6 +965,17 @@ static int stmmac_open(struct net_device *dev) · 3 unmodified lines
1047965 goto open_error;
1048966 }
1049967
968+ /* Request the Wake IRQ in case of another line is used for WoL */
969+ if (priv->wol_irq != dev->irq) {
970+ ret = request_irq(priv->wol_irq, stmmac_interrupt,
971+ IRQF_SHARED, dev->name, dev);
972+ if (unlikely(ret < 0)) {
973+ pr_err("%s: ERROR: allocating the ext WoL IRQ %d "
974+ "(error: %d)\n", __func__, priv->wol_irq, ret);
975+ goto open_error_wolirq;
976+ }
977+ }
978+
1050979 /* Enable the MAC Rx/Tx */
1051980 stmmac_set_mac(priv->ioaddr, true);
1052981
@@ -1062,7 +991,7 @@ static int stmmac_open(struct net_device *dev) · 9 unmodified lines
1062991 #ifdef CONFIG_STMMAC_DEBUG_FS
1063992 ret = stmmac_init_fs(dev);
1064993 if (ret < 0)
1065− pr_warning("\tFailed debugFS registration");
994+ pr_warning("%s: failed debugFS registration\n", __func__);
1066995 #endif
1067996 /* Start the ball rolling... */
1068997 DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name);
@@ -1072,6 +1001,7 @@ static int stmmac_open(struct net_device *dev) · 3 unmodified lines
10721001 #ifdef CONFIG_STMMAC_TIMER
10731002 priv->tm->timer_start(tmrate);
10741003 #endif
1004+
10751005 /* Dump DMA/MAC registers */
10761006 if (netif_msg_hw(priv)) {
10771007 priv->hw->mac->dump_regs(priv->ioaddr);
@@ -1087,6 +1017,9 @@ static int stmmac_open(struct net_device *dev) · 9 unmodified lines
10871017
10881018 return 0;
10891019
1020+open_error_wolirq:
1021+ free_irq(dev->irq, dev);
1022+
10901023 open_error:
10911024 #ifdef CONFIG_STMMAC_TIMER
10921025 kfree(priv->tm);
@@ -1127,6 +1060,8 @@ static int stmmac_release(struct net_device *dev) · 34 unmodified lines
11271060
11281061 /* Free the IRQ lines */
11291062 free_irq(dev->irq, dev);
1063+ if (priv->wol_irq != dev->irq)
1064+ free_irq(priv->wol_irq, dev);
11301065
11311066 /* Stop TX/RX DMA and clear the descriptors */
11321067 priv->hw->dma->stop_tx(priv->ioaddr);
@@ -1788,6 +1723,69 @@ static const struct net_device_ops stmmac_netdev_ops = { · 655 unmodified lines
17881723 .ndo_set_mac_address = eth_mac_addr,
17891724 };
17901725
1726+/**
1727+ * stmmac_hw_init - Init the MAC device
1728+ * @priv : pointer to the private device structure.
1729+ * Description: this function detects which MAC device
1730+ * (GMAC/MAC10-100) has to attached, checks the HW capability
1731+ * (if supported) and sets the driver's features (for example
1732+ * to use the ring or chaine mode or support the normal/enh
1733+ * descriptor structure).
1734+ */
1735+static int stmmac_hw_init(struct stmmac_priv *priv)
1736+{
1737+ int ret = 0;
1738+ struct mac_device_info *mac;
1739+
1740+ /* Identify the MAC HW device */
1741+ if (priv->plat->has_gmac)
1742+ mac = dwmac1000_setup(priv->ioaddr);
1743+ else
1744+ mac = dwmac100_setup(priv->ioaddr);
1745+ if (!mac)
1746+ return -ENOMEM;
1747+
1748+ priv->hw = mac;
1749+
1750+ /* To use the chained or ring mode */
1751+ priv->hw->ring = &ring_mode_ops;
1752+
1753+ /* Get and dump the chip ID */
1754+ stmmac_get_synopsys_id(priv);
1755+
1756+ /* Get the HW capability (new GMAC newer than 3.50a) */
1757+ priv->hw_cap_support = stmmac_get_hw_features(priv);
1758+ if (priv->hw_cap_support) {
1759+ pr_info(" DMA HW capability register supported");
1760+
1761+ /* We can override some gmac/dma configuration fields: e.g.
1762+ * enh_desc, tx_coe (e.g. that are passed through the
1763+ * platform) with the values from the HW capability
1764+ * register (if supported).
1765+ */
1766+ priv->plat->enh_desc = priv->dma_cap.enh_desc;
1767+ priv->plat->tx_coe = priv->dma_cap.tx_coe;
1768+ priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
1769+ } else
1770+ pr_info(" No HW DMA feature register supported");
1771+
1772+ /* Select the enhnaced/normal descriptor structures */
1773+ stmmac_selec_desc_mode(priv);
1774+
1775+ priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr);
1776+ if (priv->rx_coe)
1777+ pr_info(" RX Checksum Offload Engine supported\n");
1778+ if (priv->plat->tx_coe)
1779+ pr_info(" TX Checksum insertion supported\n");
1780+
1781+ if (priv->plat->pmt) {
1782+ pr_info(" Wake-Up On Lan supported\n");
1783+ device_set_wakeup_capable(priv->device, 1);
1784+ }
1785+
1786+ return ret;
1787+}
1788+
17911789 /**
17921790 * stmmac_dvr_probe
17931791 * @device: device pointer
@@ -1795,7 +1793,8 @@ static const struct net_device_ops stmmac_netdev_ops = { · 1 unmodified line
17951793 * call the alloc_etherdev, allocate the priv structure.
17961794 */
17971795 struct stmmac_priv *stmmac_dvr_probe(struct device *device,
1798− struct plat_stmmacenet_data *plat_dat)
1796+ struct plat_stmmacenet_data *plat_dat,
1797+ void __iomem *addr)
17991798 {
18001799 int ret = 0;
18011800 struct net_device *ndev = NULL;
@@ -1815,10 +1814,27 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, · 13 unmodified lines
18151814
18161815 ether_setup(ndev);
18171816
1818− ndev->netdev_ops = &stmmac_netdev_ops;
18191817 stmmac_set_ethtool_ops(ndev);
1818+ priv->pause = pause;
1819+ priv->plat = plat_dat;
1820+ priv->ioaddr = addr;
1821+ priv->dev->base_addr = (unsigned long)addr;
1822+
1823+ /* Verify driver arguments */
1824+ stmmac_verify_args();
1825+
1826+ /* Override with kernel parameters if supplied XXX CRS XXX
1827+ * this needs to have multiple instances */
1828+ if ((phyaddr >= 0) && (phyaddr <= 31))
1829+ priv->plat->phy_addr = phyaddr;
1830+
1831+ /* Init MAC and get the capabilities */
1832+ stmmac_hw_init(priv);
1833+
1834+ ndev->netdev_ops = &stmmac_netdev_ops;
18201835
1821− ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
1836+ ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1837+ NETIF_F_RXCSUM;
18221838 ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
18231839 ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
18241840 #ifdef STMMAC_VLAN_TAG_USED
@@ -1830,8 +1846,6 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, · 5 unmodified lines
18301846 if (flow_ctrl)
18311847 priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */
18321848
1833− priv->pause = pause;
1834− priv->plat = plat_dat;
18351849 netif_napi_add(ndev, &priv->napi, stmmac_poll, 64);
18361850
18371851 spin_lock_init(&priv->lock);
@@ -1839,15 +1853,10 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device, · 1 unmodified line
18391853
18401854 ret = register_netdev(ndev);
18411855 if (ret) {
1842− pr_err("%s: ERROR %i registering the device\n",
1843− __func__, ret);
1856+ pr_err("%s: ERROR %i registering the device\n", __func__, ret);
18441857 goto error;
18451858 }
18461859
1847− DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n",
1848− ndev->name, (ndev->features & NETIF_F_SG) ? "on" : "off",
1849− (ndev->features & NETIF_F_IP_CSUM) ? "on" : "off");
1850−
18511860 return priv;
18521861
18531862 error:
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c+2−4
@@ -96,13 +96,11 @@ static int __devinit stmmac_pci_probe(struct pci_dev *pdev, · 95 unmodified lines
9696
9797 stmmac_default_data();
9898
99− priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat);
99+ priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat, addr);
100100 if (!priv) {
101− pr_err("%s: main drivr probe failed", __func__);
101+ pr_err("%s: main driver probe failed", __func__);
102102 goto err_out;
103103 }
104− priv->ioaddr = addr;
105− priv->dev->base_addr = (unsigned long)addr;
106104 priv->dev->irq = pdev->irq;
107105 priv->wol_irq = pdev->irq;
108106
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c+10−13
@@ -59,16 +59,20 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) · 58 unmodified lines
5959 goto out_release_region;
6060 }
6161 plat_dat = pdev->dev.platform_data;
62− priv = stmmac_dvr_probe(&(pdev->dev), plat_dat);
62+
63+ /* Custom initialisation (if needed)*/
64+ if (plat_dat->init) {
65+ ret = plat_dat->init(pdev);
66+ if (unlikely(ret))
67+ goto out_unmap;
68+ }
69+
70+ priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr);
6371 if (!priv) {
64− pr_err("%s: main drivr probe failed", __func__);
72+ pr_err("%s: main driver probe failed", __func__);
6573 goto out_unmap;
6674 }
6775
68− priv->ioaddr = addr;
69− /* Set the I/O base addr */
70− priv->dev->base_addr = (unsigned long)addr;
71−
7276 /* Get the MAC information */
7377 priv->dev->irq = platform_get_irq_byname(pdev, "macirq");
7478 if (priv->dev->irq == -ENXIO) {
@@ -92,13 +96,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev) · 17 unmodified lines
9296
9397 platform_set_drvdata(pdev, priv->dev);
9498
95− /* Custom initialisation */
96− if (priv->plat->init) {
97− ret = priv->plat->init(pdev);
98− if (unlikely(ret))
99− goto out_unmap;
100− }
101−
10299 pr_debug("STMMAC platform driver registration completed");
103100
104101 return 0;
drivers/net/ethernet/ti/cpmac.c+2−2
@@ -1122,7 +1122,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) · 1121 unmodified lines
11221122 pdata = pdev->dev.platform_data;
11231123
11241124 if (external_switch || dumb_switch) {
1125− strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
1125+ strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
11261126 phy_id = pdev->id;
11271127 } else {
11281128 for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
@@ -1138,7 +1138,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev) · 9 unmodified lines
11381138 if (phy_id == PHY_MAX_ADDR) {
11391139 dev_err(&pdev->dev, "no PHY present, falling back "
11401140 "to switch on MDIO bus 0\n");
1141− strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
1141+ strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
11421142 phy_id = pdev->id;
11431143 }
11441144
drivers/net/ethernet/ti/davinci_emac.c+6−3
@@ -1009,7 +1009,7 @@ static void emac_rx_handler(void *token, int len, int status) · 1008 unmodified lines
10091009 int ret;
10101010
10111011 /* free and bail if we are shutting down */
1012− if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) {
1012+ if (unlikely(!netif_running(ndev))) {
10131013 dev_kfree_skb_any(skb);
10141014 return;
10151015 }
@@ -1038,7 +1038,9 @@ static void emac_rx_handler(void *token, int len, int status) · 22 unmodified lines
10381038 recycle:
10391039 ret = cpdma_chan_submit(priv->rxchan, skb, skb->data,
10401040 skb_tailroom(skb), GFP_KERNEL);
1041− if (WARN_ON(ret < 0))
1041+
1042+ WARN_ON(ret == -ENOMEM);
1043+ if (unlikely(ret < 0))
10421044 dev_kfree_skb_any(skb);
10431045 }
10441046
@@ -1600,8 +1602,9 @@ static int emac_dev_open(struct net_device *ndev) · 555 unmodified lines
16001602 if (IS_ERR(priv->phydev)) {
16011603 dev_err(emac_dev, "could not connect to phy %s\n",
16021604 priv->phy_id);
1605+ ret = PTR_ERR(priv->phydev);
16031606 priv->phydev = NULL;
1604− return PTR_ERR(priv->phydev);
1607+ return ret;
16051608 }
16061609
16071610 priv->link = 0;
drivers/net/ethernet/ti/davinci_mdio.c+1−1
@@ -318,9 +318,9 @@ static int __devinit davinci_mdio_probe(struct platform_device *pdev) · 317 unmodified lines
318318
319319 data->clk = clk_get(dev, NULL);
320320 if (IS_ERR(data->clk)) {
321− data->clk = NULL;
322321 dev_err(dev, "failed to get device clock\n");
323322 ret = PTR_ERR(data->clk);
323+ data->clk = NULL;
324324 goto bail_out;
325325 }
326326
drivers/net/ethernet/toshiba/Kconfig+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 config NET_VENDOR_TOSHIBA
66 bool "Toshiba devices"
77 default y
8− depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB) || PPC_PS3
8+ depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB || MIPS) || PPC_PS3
99 ---help---
1010 If you have a network (Ethernet) card belonging to this class, say Y
1111 and read the Ethernet-HOWTO, available from
drivers/net/ethernet/via/via-velocity.c+0−3
@@ -2491,9 +2491,6 @@ static int velocity_close(struct net_device *dev) · 2490 unmodified lines
24912491 if (dev->irq != 0)
24922492 free_irq(dev->irq, dev);
24932493
2494− /* Power down the chip */
2495− pci_set_power_state(vptr->pdev, PCI_D3hot);
2496−
24972494 velocity_free_rings(vptr);
24982495
24992496 vptr->flags &= (~VELOCITY_FLAGS_OPENED);
drivers/net/ethernet/xscale/ixp4xx_eth.c+2−1
@@ -1416,7 +1416,8 @@ static int __devinit eth_init_one(struct platform_device *pdev) · 1415 unmodified lines
14161416 __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control);
14171417 udelay(50);
14181418
1419− snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy);
1419+ snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
1420+ mdio_bus->id, plat->phy);
14201421 port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
14211422 PHY_INTERFACE_MODE_MII);
14221423 if (IS_ERR(port->phydev)) {
drivers/net/hyperv/netvsc_drv.c+9−9
@@ -123,7 +123,7 @@ static int netvsc_close(struct net_device *net) · 122 unmodified lines
123123 struct hv_device *device_obj = net_device_ctx->device_ctx;
124124 int ret;
125125
126− netif_stop_queue(net);
126+ netif_tx_disable(net);
127127
128128 ret = rndis_filter_close(device_obj);
129129 if (ret != 0)
@@ -151,10 +151,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) · 21 unmodified lines
151151 int ret;
152152 unsigned int i, num_pages, npg_data;
153153
154− /* Add multipage for skb->data and additional one for RNDIS */
154+ /* Add multipages for skb->data and additional 2 for RNDIS */
155155 npg_data = (((unsigned long)skb->data + skb_headlen(skb) - 1)
156156 >> PAGE_SHIFT) - ((unsigned long)skb->data >> PAGE_SHIFT) + 1;
157− num_pages = skb_shinfo(skb)->nr_frags + npg_data + 1;
157+ num_pages = skb_shinfo(skb)->nr_frags + npg_data + 2;
158158
159159 /* Allocate a netvsc packet based on # of frags. */
160160 packet = kzalloc(sizeof(struct hv_netvsc_packet) +
@@ -173,8 +173,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) · 12 unmodified lines
173173 sizeof(struct hv_netvsc_packet) +
174174 (num_pages * sizeof(struct hv_page_buffer));
175175
176− /* Setup the rndis header */
177− packet->page_buf_cnt = num_pages;
176+ /* If the rndis msg goes beyond 1 page, we will add 1 later */
177+ packet->page_buf_cnt = num_pages - 1;
178178
179179 /* Initialize it from the skb */
180180 packet->total_data_buflen = skb->len;
@@ -256,7 +256,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, · 75 unmodified lines
256256 schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20));
257257 } else {
258258 netif_carrier_off(net);
259− netif_stop_queue(net);
259+ netif_tx_disable(net);
260260 }
261261 }
262262
@@ -298,7 +298,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, · 35 unmodified lines
298298 skb->ip_summed = CHECKSUM_NONE;
299299
300300 net->stats.rx_packets++;
301− net->stats.rx_bytes += skb->len;
301+ net->stats.rx_bytes += packet->total_data_buflen;
302302
303303 /*
304304 * Pass the skb back up. Network stack will deallocate the skb when it
@@ -337,7 +337,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) · 32 unmodified lines
337337
338338 nvdev->start_remove = true;
339339 cancel_delayed_work_sync(&ndevctx->dwork);
340− netif_stop_queue(ndev);
340+ netif_tx_disable(ndev);
341341 rndis_filter_device_remove(hdev);
342342
343343 ndev->mtu = mtu;
@@ -460,7 +460,7 @@ static int netvsc_remove(struct hv_device *dev) · 116 unmodified lines
460460 cancel_delayed_work_sync(&ndev_ctx->dwork);
461461
462462 /* Stop outbound asap */
463− netif_stop_queue(net);
463+ netif_tx_disable(net);
464464
465465 unregister_netdev(net);
466466
drivers/net/hyperv/rndis_filter.c+32−0
@@ -321,6 +321,25 @@ static void rndis_filter_receive_data(struct rndis_device *dev, · 320 unmodified lines
321321 data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset;
322322
323323 pkt->total_data_buflen -= data_offset;
324+
325+ /*
326+ * Make sure we got a valid RNDIS message, now total_data_buflen
327+ * should be the data packet size plus the trailer padding size
328+ */
329+ if (pkt->total_data_buflen < rndis_pkt->data_len) {
330+ netdev_err(dev->net_dev->ndev, "rndis message buffer "
331+ "overflow detected (got %u, min %u)"
332+ "...dropping this message!\n",
333+ pkt->total_data_buflen, rndis_pkt->data_len);
334+ return;
335+ }
336+
337+ /*
338+ * Remove the rndis trailer padding from rndis packet message
339+ * rndis_pkt->data_len tell us the real data length, we only copy
340+ * the data packet to the stack, without the rndis trailer padding
341+ */
342+ pkt->total_data_buflen = rndis_pkt->data_len;
324343 pkt->data = (void *)((unsigned long)pkt->data + data_offset);
325344
326345 pkt->is_data_pkt = true;
@@ -778,6 +797,19 @@ int rndis_filter_send(struct hv_device *dev, · 451 unmodified lines
778797 (unsigned long)rndisMessage & (PAGE_SIZE-1);
779798 pkt->page_buf[0].len = rndisMessageSize;
780799
800+ /* Add one page_buf if the rndis msg goes beyond page boundary */
801+ if (pkt->page_buf[0].offset + rndisMessageSize > PAGE_SIZE) {
802+ int i;
803+ for (i = pkt->page_buf_cnt; i > 1; i--)
804+ pkt->page_buf[i] = pkt->page_buf[i-1];
805+ pkt->page_buf_cnt++;
806+ pkt->page_buf[0].len = PAGE_SIZE - pkt->page_buf[0].offset;
807+ pkt->page_buf[1].pfn = virt_to_phys((void *)((ulong)
808+ rndisMessage + pkt->page_buf[0].len)) >> PAGE_SHIFT;
809+ pkt->page_buf[1].offset = 0;
810+ pkt->page_buf[1].len = rndisMessageSize - pkt->page_buf[0].len;
811+ }
812+
781813 /* Save the packet send completion and context */
782814 filterPacket->completion = pkt->completion.send.send_completion;
783815 filterPacket->completion_ctx =
drivers/net/phy/icplus.c+35−20
@@ -30,16 +30,16 @@ · 29 unmodified lines
3030 #include <asm/irq.h>
3131 #include <asm/uaccess.h>
3232
33−MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IC1001 PHY drivers");
33+MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers");
3434 MODULE_AUTHOR("Michael Barkowski");
3535 MODULE_LICENSE("GPL");
3636
37−/* IP101A/IP1001 */
38−#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */
39−#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */
40−#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */
41−#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */
42−#define IP101A_APS_ON 2 /* IP101A APS Mode bit */
37+/* IP101A/G - IP1001 */
38+#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */
39+#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */
40+#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */
41+#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */
42+#define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */
4343
4444 static int ip175c_config_init(struct phy_device *phydev)
4545 {
@@ -98,20 +98,24 @@ static int ip175c_config_init(struct phy_device *phydev) · 52 unmodified lines
9898
9999 static int ip1xx_reset(struct phy_device *phydev)
100100 {
101− int err, bmcr;
101+ int bmcr;
102102
103103 /* Software Reset PHY */
104104 bmcr = phy_read(phydev, MII_BMCR);
105+ if (bmcr < 0)
106+ return bmcr;
105107 bmcr |= BMCR_RESET;
106− err = phy_write(phydev, MII_BMCR, bmcr);
107− if (err < 0)
108− return err;
108+ bmcr = phy_write(phydev, MII_BMCR, bmcr);
109+ if (bmcr < 0)
110+ return bmcr;
109111
110112 do {
111113 bmcr = phy_read(phydev, MII_BMCR);
114+ if (bmcr < 0)
115+ return bmcr;
112116 } while (bmcr & BMCR_RESET);
113117
114− return err;
118+ return 0;
115119 }
116120
117121 static int ip1001_config_init(struct phy_device *phydev)
@@ -124,7 +128,10 @@ static int ip1001_config_init(struct phy_device *phydev) · 6 unmodified lines
124128
125129 /* Enable Auto Power Saving mode */
126130 c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2);
131+ if (c < 0)
132+ return c;
127133 c |= IP1001_APS_ON;
134+ c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c);
128135 if (c < 0)
129136 return c;
130137
@@ -132,14 +139,19 @@ static int ip1001_config_init(struct phy_device *phydev) · 1 unmodified line
132139 /* Additional delay (2ns) used to adjust RX clock phase
133140 * at RGMII interface */
134141 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
142+ if (c < 0)
143+ return c;
144+
135145 c |= IP1001_PHASE_SEL_MASK;
136146 c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
147+ if (c < 0)
148+ return c;
137149 }
138150
139− return c;
151+ return 0;
140152 }
141153
142−static int ip101a_config_init(struct phy_device *phydev)
154+static int ip101a_g_config_init(struct phy_device *phydev)
143155 {
144156 int c;
145157
@@ -149,7 +161,7 @@ static int ip101a_config_init(struct phy_device *phydev) · 3 unmodified lines
149161
150162 /* Enable Auto Power Saving mode */
151163 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
152− c |= IP101A_APS_ON;
164+ c |= IP101A_G_APS_ON;
153165 return c;
154166 }
155167
@@ -191,6 +203,7 @@ static struct phy_driver ip1001_driver = { · 35 unmodified lines
191203 .phy_id_mask = 0x0ffffff0,
192204 .features = PHY_GBIT_FEATURES | SUPPORTED_Pause |
193205 SUPPORTED_Asym_Pause,
206+ .flags = PHY_HAS_INTERRUPT,
194207 .config_init = &ip1001_config_init,
195208 .config_aneg = &genphy_config_aneg,
196209 .read_status = &genphy_read_status,
@@ -199,13 +212,14 @@ static struct phy_driver ip1001_driver = { · 2 unmodified lines
199212 .driver = { .owner = THIS_MODULE,},
200213 };
201214
202−static struct phy_driver ip101a_driver = {
215+static struct phy_driver ip101a_g_driver = {
203216 .phy_id = 0x02430c54,
204− .name = "ICPlus IP101A",
217+ .name = "ICPlus IP101A/G",
205218 .phy_id_mask = 0x0ffffff0,
206219 .features = PHY_BASIC_FEATURES | SUPPORTED_Pause |
207220 SUPPORTED_Asym_Pause,
208− .config_init = &ip101a_config_init,
221+ .flags = PHY_HAS_INTERRUPT,
222+ .config_init = &ip101a_g_config_init,
209223 .config_aneg = &genphy_config_aneg,
210224 .read_status = &genphy_read_status,
211225 .suspend = genphy_suspend,
@@ -221,7 +235,7 @@ static int __init icplus_init(void) · 9 unmodified lines
221235 if (ret < 0)
222236 return -ENODEV;
223237
224− ret = phy_driver_register(&ip101a_driver);
238+ ret = phy_driver_register(&ip101a_g_driver);
225239 if (ret < 0)
226240 return -ENODEV;
227241
@@ -231,7 +245,7 @@ static int __init icplus_init(void) · 3 unmodified lines
231245 static void __exit icplus_exit(void)
232246 {
233247 phy_driver_unregister(&ip1001_driver);
234− phy_driver_unregister(&ip101a_driver);
248+ phy_driver_unregister(&ip101a_g_driver);
235249 phy_driver_unregister(&ip175c_driver);
236250 }
237251
@@ -241,6 +255,7 @@ module_exit(icplus_exit); · 3 unmodified lines
241255 static struct mdio_device_id __maybe_unused icplus_tbl[] = {
242256 { 0x02430d80, 0x0ffffff0 },
243257 { 0x02430d90, 0x0ffffff0 },
258+ { 0x02430c54, 0x0ffffff0 },
244259 { }
245260 };
246261
drivers/net/ppp/ppp_generic.c+23−0
@@ -2024,14 +2024,22 @@ ppp_mp_reconstruct(struct ppp *ppp) · 2023 unmodified lines
20242024 continue;
20252025 }
20262026 if (PPP_MP_CB(p)->sequence != seq) {
2027+ u32 oldseq;
20272028 /* Fragment `seq' is missing. If it is after
20282029 minseq, it might arrive later, so stop here. */
20292030 if (seq_after(seq, minseq))
20302031 break;
20312032 /* Fragment `seq' is lost, keep going. */
20322033 lost = 1;
2034+ oldseq = seq;
20332035 seq = seq_before(minseq, PPP_MP_CB(p)->sequence)?
20342036 minseq + 1: PPP_MP_CB(p)->sequence;
2037+
2038+ if (ppp->debug & 1)
2039+ netdev_printk(KERN_DEBUG, ppp->dev,
2040+ "lost frag %u..%u\n",
2041+ oldseq, seq-1);
2042+
20352043 goto again;
20362044 }
20372045
@@ -2076,6 +2084,10 @@ ppp_mp_reconstruct(struct ppp *ppp) · 38 unmodified lines
20762084 struct sk_buff *tmp2;
20772085
20782086 skb_queue_reverse_walk_from_safe(list, p, tmp2) {
2087+ if (ppp->debug & 1)
2088+ netdev_printk(KERN_DEBUG, ppp->dev,
2089+ "discarding frag %u\n",
2090+ PPP_MP_CB(p)->sequence);
20792091 __skb_unlink(p, list);
20802092 kfree_skb(p);
20812093 }
@@ -2091,6 +2103,17 @@ ppp_mp_reconstruct(struct ppp *ppp) · 9 unmodified lines
20912103 /* If we have discarded any fragments,
20922104 signal a receive error. */
20932105 if (PPP_MP_CB(head)->sequence != ppp->nextseq) {
2106+ skb_queue_walk_safe(list, p, tmp) {
2107+ if (p == head)
2108+ break;
2109+ if (ppp->debug & 1)
2110+ netdev_printk(KERN_DEBUG, ppp->dev,
2111+ "discarding frag %u\n",
2112+ PPP_MP_CB(p)->sequence);
2113+ __skb_unlink(p, list);
2114+ kfree_skb(p);
2115+ }
2116+
20942117 if (ppp->debug & 1)
20952118 netdev_printk(KERN_DEBUG, ppp->dev,
20962119 " missed pkts %u..%u\n",
drivers/net/tokenring/Kconfig+4−1
@@ -7,7 +7,6 @@ menuconfig TR · 6 unmodified lines
77 bool "Token Ring driver support"
88 depends on NETDEVICES && !UML
99 depends on (PCI || ISA || MCA || CCW || PCMCIA)
10− select LLC
1110 help
1211 Token Ring is IBM's way of communication on a local network; the
1312 rest of the world uses Ethernet. To participate on a Token Ring
@@ -20,6 +19,10 @@ menuconfig TR · 6 unmodified lines
2019
2120 if TR
2221
22+config WANT_LLC
23+ def_bool y
24+ select LLC
25+
2326 config PCMCIA_IBMTR
2427 tristate "IBM PCMCIA tokenring adapter support"
2528 depends on IBMTR!=y && PCMCIA
drivers/net/usb/cdc_ether.c+7−0
@@ -573,6 +573,13 @@ static const struct usb_device_id products [] = { · 572 unmodified lines
573573 .driver_info = 0,
574574 },
575575
576+/* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
577+{
578+ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
579+ USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
580+ .driver_info = 0,
581+},
582+
576583 /*
577584 * WHITELIST!!!
578585 *
drivers/net/usb/hso.c+1−1
@@ -1632,7 +1632,7 @@ static int hso_get_count(struct tty_struct *tty, · 1631 unmodified lines
16321632 struct hso_serial *serial = get_serial_by_tty(tty);
16331633 struct hso_tiocmget *tiocmget = serial->tiocmget;
16341634
1635− memset(&icount, 0, sizeof(struct serial_icounter_struct));
1635+ memset(icount, 0, sizeof(struct serial_icounter_struct));
16361636
16371637 if (!tiocmget)
16381638 return -ENOENT;
drivers/net/usb/ipheth.c+5−0
@@ -60,6 +60,7 @@ · 59 unmodified lines
6060 #define USB_PRODUCT_IPHONE_3GS 0x1294
6161 #define USB_PRODUCT_IPHONE_4 0x1297
6262 #define USB_PRODUCT_IPHONE_4_VZW 0x129c
63+#define USB_PRODUCT_IPHONE_4S 0x12a0
6364
6465 #define IPHETH_USBINTF_CLASS 255
6566 #define IPHETH_USBINTF_SUBCLASS 253
@@ -103,6 +104,10 @@ static struct usb_device_id ipheth_table[] = { · 37 unmodified lines
103104 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
104105 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
105106 IPHETH_USBINTF_PROTO) },
107+ { USB_DEVICE_AND_INTERFACE_INFO(
108+ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S,
109+ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
110+ IPHETH_USBINTF_PROTO) },
106111 { }
107112 };
108113 MODULE_DEVICE_TABLE(usb, ipheth_table);
drivers/net/usb/zaurus.c+12−0
@@ -315,6 +315,11 @@ static const struct usb_device_id products [] = { · 314 unmodified lines
315315 .idProduct = 0x9031, /* C-750 C-760 */
316316 ZAURUS_MASTER_INTERFACE,
317317 .driver_info = ZAURUS_PXA_INFO,
318+}, {
319+ /* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */
320+ USB_DEVICE_AND_INTERFACE_INFO(0x04DD, 0x9031, USB_CLASS_COMM,
321+ USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
322+ .driver_info = (unsigned long) &bogus_mdlm_info,
318323 }, {
319324 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
320325 | USB_DEVICE_ID_MATCH_DEVICE,
@@ -349,6 +354,13 @@ static const struct usb_device_id products [] = { · 28 unmodified lines
349354 ZAURUS_MASTER_INTERFACE,
350355 .driver_info = OLYMPUS_MXL_INFO,
351356 },
357+
358+/* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
359+{
360+ USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
361+ USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
362+ .driver_info = (unsigned long) &bogus_mdlm_info,
363+},
352364 { }, // END
353365 };
354366 MODULE_DEVICE_TABLE(usb, products);
drivers/net/veth.c+3−1
@@ -422,7 +422,9 @@ static void veth_dellink(struct net_device *dev, struct list_head *head) · 421 unmodified lines
422422 unregister_netdevice_queue(peer, head);
423423 }
424424
425−static const struct nla_policy veth_policy[VETH_INFO_MAX + 1];
425+static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = {
426+ [VETH_INFO_PEER] = { .len = sizeof(struct ifinfomsg) },
427+};
426428
427429 static struct rtnl_link_ops veth_link_ops = {
428430 .kind = DRV_NAME,
drivers/net/vmxnet3/vmxnet3_drv.c+2−2
@@ -843,8 +843,8 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, · 842 unmodified lines
843843 /* for simplicity, don't copy L4 headers */
844844 ctx->l4_hdr_size = 0;
845845 }
846− ctx->copy_size = ctx->eth_ip_hdr_size +
847− ctx->l4_hdr_size;
846+ ctx->copy_size = min(ctx->eth_ip_hdr_size +
847+ ctx->l4_hdr_size, skb->len);
848848 } else {
849849 ctx->eth_ip_hdr_size = 0;
850850 ctx->l4_hdr_size = 0;
drivers/net/wireless/ath/ath9k/hw.c+5−2
@@ -1037,13 +1037,16 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah) · 1036 unmodified lines
10371037
10381038 /*
10391039 * Workaround for early ACK timeouts, add an offset to match the
1040− * initval's 64us ack timeout value.
1040+ * initval's 64us ack timeout value. Use 48us for the CTS timeout.
10411041 * This was initially only meant to work around an issue with delayed
10421042 * BA frames in some implementations, but it has been found to fix ACK
10431043 * timeout issues in other cases as well.
10441044 */
1045− if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ)
1045+ if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) {
10461046 acktimeout += 64 - sifstime - ah->slottime;
1047+ ctstimeout += 48 - sifstime - ah->slottime;
1048+ }
1049+
10471050
10481051 ath9k_hw_set_sifs_time(ah, sifstime);
10491052 ath9k_hw_setslottime(ah, slottime);
drivers/net/wireless/ath/ath9k/init.c+5−4
@@ -822,6 +822,11 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, · 821 unmodified lines
822822 ARRAY_SIZE(ath9k_tpt_blink));
823823 #endif
824824
825+ INIT_WORK(&sc->hw_reset_work, ath_reset_work);
826+ INIT_WORK(&sc->hw_check_work, ath_hw_check);
827+ INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
828+ INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
829+
825830 /* Register with mac80211 */
826831 error = ieee80211_register_hw(hw);
827832 if (error)
@@ -840,10 +845,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, · 12 unmodified lines
840845 goto error_world;
841846 }
842847
843− INIT_WORK(&sc->hw_reset_work, ath_reset_work);
844− INIT_WORK(&sc->hw_check_work, ath_hw_check);
845− INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
846− INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
847848 sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
848849
849850 ath_init_leds(sc);
drivers/net/wireless/ath/ath9k/rc.c+2−2
@@ -694,7 +694,7 @@ static u8 ath_rc_get_highest_rix(struct ath_softc *sc, · 693 unmodified lines
694694 return rate;
695695
696696 /* This should not happen */
697− WARN_ON(1);
697+ WARN_ON_ONCE(1);
698698
699699 rate = ath_rc_priv->valid_rate_index[0];
700700
@@ -1346,7 +1346,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband, · 645 unmodified lines
13461346 fc = hdr->frame_control;
13471347 for (i = 0; i < sc->hw->max_rates; i++) {
13481348 struct ieee80211_tx_rate *rate = &tx_info->status.rates[i];
1349− if (!rate->count)
1349+ if (rate->idx < 0 || !rate->count)
13501350 break;
13511351
13521352 final_ts_idx = i;
drivers/net/wireless/ath/ath9k/recv.c+8−0
@@ -822,6 +822,14 @@ static bool ath9k_rx_accept(struct ath_common *common, · 821 unmodified lines
822822 (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC |
823823 ATH9K_RXERR_KEYMISS));
824824
825+ /*
826+ * Key miss events are only relevant for pairwise keys where the
827+ * descriptor does contain a valid key index. This has been observed
828+ * mostly with CCMP encryption.
829+ */
830+ if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID)
831+ rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
832+
825833 if (!rx_stats->rs_datalen)
826834 return false;
827835 /*
drivers/net/wireless/iwlwifi/iwl-agn-tx.c+10−4
@@ -91,6 +91,7 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv, · 90 unmodified lines
9191 tx_cmd->tid_tspec = qc[0] & 0xf;
9292 tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK;
9393 } else {
94+ tx_cmd->tid_tspec = IWL_TID_NON_QOS;
9495 if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
9596 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
9697 else
@@ -620,7 +621,7 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif, · 523 unmodified lines
620621 sta_priv->lq_sta.lq.agg_params.agg_frame_cnt_limit =
621622 sta_priv->max_agg_bufsize;
622623
623− IWL_INFO(priv, "Tx aggregation enabled on ra = %pM tid = %d\n",
624+ IWL_DEBUG_HT(priv, "Tx aggregation enabled on ra = %pM tid = %d\n",
624625 sta->addr, tid);
625626
626627 return iwl_send_lq_cmd(priv, ctx,
@@ -808,6 +809,8 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, · 181 unmodified lines
808809 u32 status = le16_to_cpu(tx_resp->status.status);
809810 int i;
810811
812+ WARN_ON(tid == IWL_TID_NON_QOS);
813+
811814 if (agg->wait_for_ba)
812815 IWL_DEBUG_TX_REPLY(priv,
813816 "got tx response w/o block-ack\n");
@@ -1035,10 +1038,13 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb, · 221 unmodified lines
10351038 }
10361039
10371040 __skb_queue_head_init(&skbs);
1038− priv->tid_data[sta_id][tid].next_reclaimed = next_reclaimed;
10391041
1040− IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d",
1041− next_reclaimed);
1042+ if (tid != IWL_TID_NON_QOS) {
1043+ priv->tid_data[sta_id][tid].next_reclaimed =
1044+ next_reclaimed;
1045+ IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d",
1046+ next_reclaimed);
1047+ }
10421048
10431049 /*we can free until ssn % q.n_bd not inclusive */
10441050 WARN_ON(iwl_trans_reclaim(trans(priv), sta_id, tid, txq_id,
drivers/net/wireless/iwlwifi/iwl-commands.h+1−0
@@ -815,6 +815,7 @@ struct iwl_qosparam_cmd { · 814 unmodified lines
815815
816816 #define IWL_INVALID_STATION 255
817817 #define IWL_MAX_TID_COUNT 8
818+#define IWL_TID_NON_QOS IWL_MAX_TID_COUNT
818819
819820 #define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2)
820821 #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8)
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c+1−0
@@ -1262,6 +1262,7 @@ static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid, · 1261 unmodified lines
12621262 txq->time_stamp = jiffies;
12631263
12641264 if (unlikely(txq_id >= IWLAGN_FIRST_AMPDU_QUEUE &&
1265+ tid != IWL_TID_NON_QOS &&
12651266 txq_id != trans_pcie->agg_txq[sta_id][tid])) {
12661267 /*
12671268 * FIXME: this is a uCode bug which need to be addressed,
drivers/net/wireless/mwifiex/cfg80211.c+7−1
@@ -841,7 +841,12 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, · 840 unmodified lines
841841 ret = mwifiex_set_rf_channel(priv, channel,
842842 priv->adapter->channel_type);
843843
844− ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */
844+ /* As this is new association, clear locally stored
845+ * keys and security related flags */
846+ priv->sec_info.wpa_enabled = false;
847+ priv->sec_info.wpa2_enabled = false;
848+ priv->wep_key_curr_index = 0;
849+ ret = mwifiex_set_encode(priv, NULL, 0, 0, 1);
845850
846851 if (mode == NL80211_IFTYPE_ADHOC) {
847852 /* "privacy" is set only for ad-hoc mode */
@@ -886,6 +891,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, · 38 unmodified lines
886891 dev_dbg(priv->adapter->dev,
887892 "info: setting wep encryption"
888893 " with key len %d\n", sme->key_len);
894+ priv->wep_key_curr_index = sme->key_idx;
889895 ret = mwifiex_set_encode(priv, sme->key, sme->key_len,
890896 sme->key_idx, 0);
891897 }
drivers/net/wireless/mwifiex/init.c+2−1
@@ -382,7 +382,8 @@ mwifiex_free_adapter(struct mwifiex_adapter *adapter) · 381 unmodified lines
382382
383383 adapter->if_ops.cleanup_if(adapter);
384384
385− dev_kfree_skb_any(adapter->sleep_cfm);
385+ if (adapter->sleep_cfm)
386+ dev_kfree_skb_any(adapter->sleep_cfm);
386387 }
387388
388389 /*
drivers/net/wireless/mwifiex/main.c+8−4
@@ -822,7 +822,9 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) · 821 unmodified lines
822822 continue;
823823
824824 rtnl_lock();
825− mwifiex_del_virtual_intf(priv->wdev->wiphy, priv->netdev);
825+ if (priv->wdev && priv->netdev)
826+ mwifiex_del_virtual_intf(priv->wdev->wiphy,
827+ priv->netdev);
826828 rtnl_unlock();
827829 }
828830
@@ -830,9 +832,11 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) · 1 unmodified line
830832 if (!priv)
831833 goto exit_remove;
832834
833− wiphy_unregister(priv->wdev->wiphy);
834− wiphy_free(priv->wdev->wiphy);
835− kfree(priv->wdev);
835+ if (priv->wdev) {
836+ wiphy_unregister(priv->wdev->wiphy);
837+ wiphy_free(priv->wdev->wiphy);
838+ kfree(priv->wdev);
839+ }
836840
837841 mwifiex_terminate_workqueue(adapter);
838842
drivers/net/wireless/mwifiex/sta_ioctl.c+7−1
@@ -54,7 +54,7 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist, · 53 unmodified lines
5454 int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
5555 {
5656 bool cancel_flag = false;
57− int status = adapter->cmd_wait_q.status;
57+ int status;
5858 struct cmd_ctrl_node *cmd_queued;
5959
6060 if (!adapter->cmd_queued)
@@ -79,6 +79,8 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter) · 18 unmodified lines
7979 mwifiex_cancel_pending_ioctl(adapter);
8080 dev_dbg(adapter->dev, "cmd cancel\n");
8181 }
82+
83+ status = adapter->cmd_wait_q.status;
8284 adapter->cmd_wait_q.status = 0;
8385
8486 return status;
@@ -240,6 +242,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, · 155 unmodified lines
240242
241243 if (!netif_queue_stopped(priv->netdev))
242244 mwifiex_stop_net_dev_queue(priv->netdev, adapter);
245+ if (netif_carrier_ok(priv->netdev))
246+ netif_carrier_off(priv->netdev);
243247
244248 /* Clear any past association response stored for
245249 * application retrieval */
@@ -271,6 +275,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, · 25 unmodified lines
271275
272276 if (!netif_queue_stopped(priv->netdev))
273277 mwifiex_stop_net_dev_queue(priv->netdev, adapter);
278+ if (netif_carrier_ok(priv->netdev))
279+ netif_carrier_off(priv->netdev);
274280
275281 if (!ret) {
276282 dev_dbg(adapter->dev, "info: network found in scan"
drivers/net/wireless/rt2x00/rt2800lib.c+4−4
@@ -514,9 +514,9 @@ EXPORT_SYMBOL_GPL(rt2800_write_tx_data); · 513 unmodified lines
514514
515515 static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2)
516516 {
517− int rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0);
518− int rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1);
519− int rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2);
517+ s8 rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0);
518+ s8 rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1);
519+ s8 rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2);
520520 u16 eeprom;
521521 u8 offset0;
522522 u8 offset1;
@@ -552,7 +552,7 @@ static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2) · 29 unmodified lines
552552 * which gives less energy...
553553 */
554554 rssi0 = max(rssi0, rssi1);
555− return max(rssi0, rssi2);
555+ return (int)max(rssi0, rssi2);
556556 }
557557
558558 void rt2800_process_rxwi(struct queue_entry *entry,
drivers/net/wireless/rtlwifi/pci.c+2−2
@@ -1501,7 +1501,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev) · 1500 unmodified lines
15011501 return err;
15021502 }
15031503
1504− return 1;
1504+ return 0;
15051505 }
15061506
15071507 static int rtl_pci_start(struct ieee80211_hw *hw)
@@ -1870,7 +1870,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, · 362 unmodified lines
18701870 }
18711871
18721872 /* Init PCI sw */
1873− err = !rtl_pci_init(hw, pdev);
1873+ err = rtl_pci_init(hw, pdev);
18741874 if (err) {
18751875 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
18761876 ("Failed to init PCI.\n"));
drivers/net/wireless/zd1211rw/zd_mac.c+8−0
@@ -866,6 +866,14 @@ static int fill_ctrlset(struct zd_mac *mac, · 865 unmodified lines
866866
867867 ZD_ASSERT(frag_len <= 0xffff);
868868
869+ /*
870+ * Firmware computes the duration itself (for all frames except PSPoll)
871+ * and needs the field set to 0 at input, otherwise firmware messes up
872+ * duration_id and sets bits 14 and 15 on.
873+ */
874+ if (!ieee80211_is_pspoll(hdr->frame_control))
875+ hdr->duration_id = 0;
876+
869877 txrate = ieee80211_get_tx_rate(mac->hw, info);
870878
871879 cs->modulation = txrate->hw_value;
drivers/pci/iov.c+1−2
@@ -347,8 +347,6 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) · 346 unmodified lines
347347 return rc;
348348 }
349349
350− pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz);
351−
352350 iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE;
353351 pci_cfg_access_lock(dev);
354352 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
@@ -466,6 +464,7 @@ found: · 111 unmodified lines
466464 return -EIO;
467465
468466 pgsz &= ~(pgsz - 1);
467+ pci_write_config_dword(dev, pos + PCI_SRIOV_SYS_PGSIZE, pgsz);
469468
470469 nres = 0;
471470 for (i = 0; i < PCI_SRIOV_NUM_BARS; i++) {
drivers/pci/probe.c+5−0
@@ -651,6 +651,11 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, · 650 unmodified lines
651651 dev_dbg(&dev->dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n",
652652 secondary, subordinate, pass);
653653
654+ if (!primary && (primary != bus->number) && secondary && subordinate) {
655+ dev_warn(&dev->dev, "Primary bus is hard wired to 0\n");
656+ primary = bus->number;
657+ }
658+
654659 /* Check if setup is sensible at all */
655660 if (!pass &&
656661 (primary != bus->number || secondary <= bus->number)) {
drivers/pci/remove.c+22−6
@@ -77,6 +77,7 @@ void pci_remove_bus(struct pci_bus *pci_bus) · 76 unmodified lines
7777 }
7878 EXPORT_SYMBOL(pci_remove_bus);
7979
80+static void __pci_remove_behind_bridge(struct pci_dev *dev);
8081 /**
8182 * pci_remove_bus_device - remove a PCI device and any children
8283 * @dev: the device to remove
@@ -94,7 +95,7 @@ static void __pci_remove_bus_device(struct pci_dev *dev) · 11 unmodified lines
9495 if (dev->subordinate) {
9596 struct pci_bus *b = dev->subordinate;
9697
97− pci_remove_behind_bridge(dev);
98+ __pci_remove_behind_bridge(dev);
9899 pci_remove_bus(b);
99100 dev->subordinate = NULL;
100101 }
@@ -107,6 +108,24 @@ void pci_remove_bus_device(struct pci_dev *dev) · 6 unmodified lines
107108 __pci_remove_bus_device(dev);
108109 }
109110
111+static void __pci_remove_behind_bridge(struct pci_dev *dev)
112+{
113+ struct list_head *l, *n;
114+
115+ if (dev->subordinate)
116+ list_for_each_safe(l, n, &dev->subordinate->devices)
117+ __pci_remove_bus_device(pci_dev_b(l));
118+}
119+
120+static void pci_stop_behind_bridge(struct pci_dev *dev)
121+{
122+ struct list_head *l, *n;
123+
124+ if (dev->subordinate)
125+ list_for_each_safe(l, n, &dev->subordinate->devices)
126+ pci_stop_bus_device(pci_dev_b(l));
127+}
128+
110129 /**
111130 * pci_remove_behind_bridge - remove all devices behind a PCI bridge
112131 * @dev: PCI bridge device
@@ -117,11 +136,8 @@ void pci_remove_bus_device(struct pci_dev *dev) · 4 unmodified lines
117136 */
118137 void pci_remove_behind_bridge(struct pci_dev *dev)
119138 {
120− struct list_head *l, *n;
121−
122− if (dev->subordinate)
123− list_for_each_safe(l, n, &dev->subordinate->devices)
124− __pci_remove_bus_device(pci_dev_b(l));
139+ pci_stop_behind_bridge(dev);
140+ __pci_remove_behind_bridge(dev);
125141 }
126142
127143 static void pci_stop_bus_devices(struct pci_bus *bus)
drivers/pci/xen-pcifront.c+5−5
@@ -189,7 +189,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn, · 188 unmodified lines
189189
190190 if (verbose_request)
191191 dev_info(&pdev->xdev->dev,
192− "read dev=%04x:%02x:%02x.%01x - offset %x size %d\n",
192+ "read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
193193 pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
194194 PCI_FUNC(devfn), where, size);
195195
@@ -228,7 +228,7 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn, · 32 unmodified lines
228228
229229 if (verbose_request)
230230 dev_info(&pdev->xdev->dev,
231− "write dev=%04x:%02x:%02x.%01x - "
231+ "write dev=%04x:%02x:%02x.%d - "
232232 "offset %x size %d val %x\n",
233233 pci_domain_nr(bus), bus->number,
234234 PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
@@ -432,7 +432,7 @@ static int __devinit pcifront_scan_bus(struct pcifront_device *pdev, · 197 unmodified lines
432432 d = pci_scan_single_device(b, devfn);
433433 if (d)
434434 dev_info(&pdev->xdev->dev, "New device on "
435− "%04x:%02x:%02x.%02x found.\n", domain, bus,
435+ "%04x:%02x:%02x.%d found.\n", domain, bus,
436436 PCI_SLOT(devfn), PCI_FUNC(devfn));
437437 }
438438
@@ -1041,7 +1041,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev) · 602 unmodified lines
10411041 pci_dev = pci_get_slot(pci_bus, PCI_DEVFN(slot, func));
10421042 if (!pci_dev) {
10431043 dev_dbg(&pdev->xdev->dev,
1044− "Cannot get PCI device %04x:%02x:%02x.%02x\n",
1044+ "Cannot get PCI device %04x:%02x:%02x.%d\n",
10451045 domain, bus, slot, func);
10461046 continue;
10471047 }
@@ -1049,7 +1049,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev) · 1 unmodified line
10491049 pci_dev_put(pci_dev);
10501050
10511051 dev_dbg(&pdev->xdev->dev,
1052− "PCI device %04x:%02x:%02x.%02x removed.\n",
1052+ "PCI device %04x:%02x:%02x.%d removed.\n",
10531053 domain, bus, slot, func);
10541054 }
10551055
drivers/pcmcia/ds.c+1−3
@@ -1269,10 +1269,8 @@ static int pcmcia_bus_add(struct pcmcia_socket *skt) · 1268 unmodified lines
12691269
12701270 static int pcmcia_bus_early_resume(struct pcmcia_socket *skt)
12711271 {
1272− if (!verify_cis_cache(skt)) {
1273− pcmcia_put_socket(skt);
1272+ if (!verify_cis_cache(skt))
12741273 return 0;
1275− }
12761274
12771275 dev_dbg(&skt->dev, "cis mismatch - different card\n");
12781276
drivers/pinctrl/core.c+1−1
@@ -189,7 +189,7 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev, · 188 unmodified lines
189189 pindesc->pctldev = pctldev;
190190
191191 /* Copy basic pin info */
192− if (pindesc->name) {
192+ if (name) {
193193 pindesc->name = name;
194194 } else {
195195 pindesc->name = kasprintf(GFP_KERNEL, "PIN%u", number);
drivers/platform/x86/ibm_rtl.c+2−13
@@ -33,6 +33,8 @@ · 32 unmodified lines
3333 #include <linux/mutex.h>
3434 #include <asm/bios_ebda.h>
3535
36+#include <asm-generic/io-64-nonatomic-lo-hi.h>
37+
3638 static bool force;
3739 module_param(force, bool, 0);
3840 MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
@@ -83,19 +85,6 @@ static void __iomem *rtl_cmd_addr; · 44 unmodified lines
8385 static u8 rtl_cmd_type;
8486 static u8 rtl_cmd_width;
8587
86−#ifndef readq
87−static inline __u64 readq(const volatile void __iomem *addr)
88−{
89− const volatile u32 __iomem *p = addr;
90− u32 low, high;
91−
92− low = readl(p);
93− high = readl(p + 1);
94−
95− return low + ((u64)high << 32);
96−}
97−#endif
98−
9988 static void __iomem *rtl_port_map(phys_addr_t addr, unsigned long len)
10089 {
10190 if (rtl_cmd_type == RTL_ADDR_TYPE_MMIO)
drivers/platform/x86/intel_ips.c+2−13
@@ -77,6 +77,8 @@ · 76 unmodified lines
7777 #include <asm/processor.h>
7878 #include "intel_ips.h"
7979
80+#include <asm-generic/io-64-nonatomic-lo-hi.h>
81+
8082 #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32
8183
8284 /*
@@ -344,19 +346,6 @@ struct ips_driver { · 261 unmodified lines
344346 static bool
345347 ips_gpu_turbo_enabled(struct ips_driver *ips);
346348
347−#ifndef readq
348−static inline __u64 readq(const volatile void __iomem *addr)
349−{
350− const volatile u32 __iomem *p = addr;
351− u32 low, high;
352−
353− low = readl(p);
354− high = readl(p + 1);
355−
356− return low + ((u64)high << 32);
357−}
358−#endif
359−
360349 /**
361350 * ips_cpu_busy - is CPU busy?
362351 * @ips: IPS driver struct
drivers/power/bq27x00_battery.c+5−10
@@ -62,11 +62,10 @@ · 61 unmodified lines
6262
6363 #define BQ27500_REG_SOC 0x2C
6464 #define BQ27500_REG_DCAP 0x3C /* Design capacity */
65−#define BQ27500_FLAG_DSG BIT(0) /* Discharging */
65+#define BQ27500_FLAG_DSC BIT(0)
6666 #define BQ27500_FLAG_SOCF BIT(1) /* State-of-Charge threshold final */
6767 #define BQ27500_FLAG_SOC1 BIT(2) /* State-of-Charge threshold 1 */
68−#define BQ27500_FLAG_CHG BIT(8) /* Charging */
69−#define BQ27500_FLAG_FC BIT(9) /* Fully charged */
68+#define BQ27500_FLAG_FC BIT(9)
7069
7170 #define BQ27000_RS 20 /* Resistor sense */
7271
@@ -312,7 +311,7 @@ static void bq27x00_update(struct bq27x00_device_info *di) · 239 unmodified lines
312311 struct bq27x00_reg_cache cache = {0, };
313312 bool is_bq27500 = di->chip == BQ27500;
314313
315− cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, is_bq27500);
314+ cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, !is_bq27500);
316315 if (cache.flags >= 0) {
317316 if (!is_bq27500 && (cache.flags & BQ27000_FLAG_CI)) {
318317 dev_info(di->dev, "battery is not calibrated! ignoring capacity values\n");
@@ -401,14 +400,10 @@ static int bq27x00_battery_status(struct bq27x00_device_info *di, · 82 unmodified lines
401400 if (di->chip == BQ27500) {
402401 if (di->cache.flags & BQ27500_FLAG_FC)
403402 status = POWER_SUPPLY_STATUS_FULL;
404− else if (di->cache.flags & BQ27500_FLAG_DSG)
403+ else if (di->cache.flags & BQ27500_FLAG_DSC)
405404 status = POWER_SUPPLY_STATUS_DISCHARGING;
406− else if (di->cache.flags & BQ27500_FLAG_CHG)
407− status = POWER_SUPPLY_STATUS_CHARGING;
408− else if (power_supply_am_i_supplied(&di->bat))
409− status = POWER_SUPPLY_STATUS_NOT_CHARGING;
410405 else
411− status = POWER_SUPPLY_STATUS_UNKNOWN;
406+ status = POWER_SUPPLY_STATUS_CHARGING;
412407 } else {
413408 if (di->cache.flags & BQ27000_FLAG_FC)
414409 status = POWER_SUPPLY_STATUS_FULL;
drivers/power/charger-manager.c+2−2
@@ -974,10 +974,11 @@ static int __devexit charger_manager_remove(struct platform_device *pdev) · 973 unmodified lines
974974 return 0;
975975 }
976976
977−const struct platform_device_id charger_manager_id[] = {
977+static const struct platform_device_id charger_manager_id[] = {
978978 { "charger-manager", 0 },
979979 { },
980980 };
981+MODULE_DEVICE_TABLE(platform, charger_manager_id);
981982
982983 static int cm_suspend_prepare(struct device *dev)
983984 {
@@ -1069,4 +1070,3 @@ module_exit(charger_manager_cleanup); · 85 unmodified lines
10691070 MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
10701071 MODULE_DESCRIPTION("Charger Manager");
10711072 MODULE_LICENSE("GPL");
1072−MODULE_ALIAS("charger-manager");
drivers/power/lp8727_charger.c+1−0
@@ -464,6 +464,7 @@ static int __devexit lp8727_remove(struct i2c_client *cl) · 463 unmodified lines
464464
465465 static const struct i2c_device_id lp8727_ids[] = {
466466 {"lp8727", 0},
467+ { }
467468 };
468469
469470 static struct i2c_driver lp8727_driver = {
drivers/regulator/max8649.c+1−1
@@ -150,7 +150,7 @@ static int max8649_enable_time(struct regulator_dev *rdev) · 149 unmodified lines
150150 if (ret != 0)
151151 return ret;
152152 val &= MAX8649_VOL_MASK;
153− voltage = max8649_list_voltage(rdev, (unsigned char)ret); /* uV */
153+ voltage = max8649_list_voltage(rdev, (unsigned char)val); /* uV */
154154
155155 /* get rate */
156156 ret = regmap_read(info->regmap, MAX8649_RAMP, &val);
drivers/regulator/mc13xxx-regulator-core.c+2−0
@@ -254,6 +254,7 @@ int __devinit mc13xxx_get_num_regulators_dt(struct platform_device *pdev) · 253 unmodified lines
254254
255255 return num;
256256 }
257+EXPORT_SYMBOL_GPL(mc13xxx_get_num_regulators_dt);
257258
258259 struct mc13xxx_regulator_init_data * __devinit mc13xxx_parse_regulators_dt(
259260 struct platform_device *pdev, struct mc13xxx_regulator *regulators,
@@ -291,6 +292,7 @@ struct mc13xxx_regulator_init_data * __devinit mc13xxx_parse_regulators_dt( · 31 unmodified lines
291292
292293 return data;
293294 }
295+EXPORT_SYMBOL_GPL(mc13xxx_parse_regulators_dt);
294296 #endif
295297
296298 MODULE_LICENSE("GPL v2");
drivers/rtc/rtc-at91sam9.c+10−3
@@ -307,8 +307,12 @@ static int __init at91_rtc_probe(struct platform_device *pdev) · 306 unmodified lines
307307 device_init_wakeup(&pdev->dev, 1);
308308
309309 platform_set_drvdata(pdev, rtc);
310− rtc->rtt = (void __force __iomem *) (AT91_VA_BASE_SYS - AT91_BASE_SYS);
311− rtc->rtt += r->start;
310+ rtc->rtt = ioremap(r->start, resource_size(r));
311+ if (!rtc->rtt) {
312+ dev_err(&pdev->dev, "failed to map registers, aborting.\n");
313+ ret = -ENOMEM;
314+ goto fail;
315+ }
312316
313317 mr = rtt_readl(rtc, MR);
314318
@@ -326,7 +330,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) · 11 unmodified lines
326330 &at91_rtc_ops, THIS_MODULE);
327331 if (IS_ERR(rtc->rtcdev)) {
328332 ret = PTR_ERR(rtc->rtcdev);
329− goto fail;
333+ goto fail_register;
330334 }
331335
332336 /* register irq handler after we know what name we'll use */
@@ -351,6 +355,8 @@ static int __init at91_rtc_probe(struct platform_device *pdev) · 18 unmodified lines
351355
352356 return 0;
353357
358+fail_register:
359+ iounmap(rtc->rtt);
354360 fail:
355361 platform_set_drvdata(pdev, NULL);
356362 kfree(rtc);
@@ -371,6 +377,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev) · 14 unmodified lines
371377
372378 rtc_device_unregister(rtc->rtcdev);
373379
380+ iounmap(rtc->rtt);
374381 platform_set_drvdata(pdev, NULL);
375382 kfree(rtc);
376383 return 0;
drivers/s390/block/dasd_eckd.c+1−1
@@ -18,12 +18,12 @@ · 17 unmodified lines
1818 #include <linux/hdreg.h> /* HDIO_GETGEO */
1919 #include <linux/bio.h>
2020 #include <linux/module.h>
21+#include <linux/compat.h>
2122 #include <linux/init.h>
2223
2324 #include <asm/debug.h>
2425 #include <asm/idals.h>
2526 #include <asm/ebcdic.h>
26−#include <asm/compat.h>
2727 #include <asm/io.h>
2828 #include <asm/uaccess.h>
2929 #include <asm/cio.h>
drivers/s390/block/dasd_ioctl.c+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #define KMSG_COMPONENT "dasd"
1414
1515 #include <linux/interrupt.h>
16+#include <linux/compat.h>
1617 #include <linux/major.h>
1718 #include <linux/fs.h>
1819 #include <linux/blkpg.h>
drivers/s390/char/con3215.c+15−7
@@ -87,6 +87,7 @@ struct raw3215_info { · 86 unmodified lines
8787 struct tty_struct *tty; /* pointer to tty structure if present */
8888 struct raw3215_req *queued_read; /* pointer to queued read requests */
8989 struct raw3215_req *queued_write;/* pointer to queued write requests */
90+ struct tasklet_struct tlet; /* tasklet to invoke tty_wakeup */
9091 wait_queue_head_t empty_wait; /* wait queue for flushing */
9192 struct timer_list timer; /* timer for delayed output */
9293 int line_pos; /* position on the line (for tabs) */
@@ -333,20 +334,24 @@ static inline void raw3215_try_io(struct raw3215_info *raw) · 240 unmodified lines
333334 }
334335 }
335336
337+/*
338+ * Call tty_wakeup from tasklet context
339+ */
340+static void raw3215_wakeup(unsigned long data)
341+{
342+ struct raw3215_info *raw = (struct raw3215_info *) data;
343+ tty_wakeup(raw->tty);
344+}
345+
336346 /*
337347 * Try to start the next IO and wake up processes waiting on the tty.
338348 */
339349 static void raw3215_next_io(struct raw3215_info *raw)
340350 {
341− struct tty_struct *tty;
342−
343351 raw3215_mk_write_req(raw);
344352 raw3215_try_io(raw);
345− tty = raw->tty;
346− if (tty != NULL &&
347− RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE) {
348− tty_wakeup(tty);
349− }
353+ if (raw->tty && RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE)
354+ tasklet_schedule(&raw->tlet);
350355 }
351356
352357 /*
@@ -682,6 +687,7 @@ static int raw3215_probe (struct ccw_device *cdev) · 329 unmodified lines
682687 return -ENOMEM;
683688 }
684689 init_waitqueue_head(&raw->empty_wait);
690+ tasklet_init(&raw->tlet, raw3215_wakeup, (unsigned long) raw);
685691
686692 dev_set_drvdata(&cdev->dev, raw);
687693 cdev->handler = raw3215_irq;
@@ -901,6 +907,7 @@ static int __init con3215_init(void) · 213 unmodified lines
901907
902908 raw->flags |= RAW3215_FIXED;
903909 init_waitqueue_head(&raw->empty_wait);
910+ tasklet_init(&raw->tlet, raw3215_wakeup, (unsigned long) raw);
904911
905912 /* Request the console irq */
906913 if (raw3215_startup(raw) != 0) {
@@ -966,6 +973,7 @@ static void tty3215_close(struct tty_struct *tty, struct file * filp) · 59 unmodified lines
966973 tty->closing = 1;
967974 /* Shutdown the terminal */
968975 raw3215_shutdown(raw);
976+ tasklet_kill(&raw->tlet);
969977 tty->closing = 0;
970978 raw->tty = NULL;
971979 }
drivers/s390/char/fs3270.c+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/console.h>
1212 #include <linux/init.h>
1313 #include <linux/interrupt.h>
14+#include <linux/compat.h>
1415 #include <linux/module.h>
1516 #include <linux/list.h>
1617 #include <linux/slab.h>
drivers/s390/char/vmcp.c+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313
1414 #include <linux/fs.h>
1515 #include <linux/init.h>
16+#include <linux/compat.h>
1617 #include <linux/kernel.h>
1718 #include <linux/miscdevice.h>
1819 #include <linux/slab.h>
drivers/s390/cio/chsc_sch.c+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 */
99
1010 #include <linux/slab.h>
11+#include <linux/compat.h>
1112 #include <linux/device.h>
1213 #include <linux/module.h>
1314 #include <linux/uaccess.h>
drivers/s390/scsi/zfcp_cfdc.c+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #define KMSG_COMPONENT "zfcp"
1212 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
1313
14+#include <linux/compat.h>
1415 #include <linux/slab.h>
1516 #include <linux/types.h>
1617 #include <linux/miscdevice.h>
drivers/scsi/device_handler/scsi_dh_rdac.c+14−11
@@ -364,10 +364,7 @@ static void release_controller(struct kref *kref) · 363 unmodified lines
364364 struct rdac_controller *ctlr;
365365 ctlr = container_of(kref, struct rdac_controller, kref);
366366
367− flush_workqueue(kmpath_rdacd);
368− spin_lock(&list_lock);
369367 list_del(&ctlr->node);
370− spin_unlock(&list_lock);
371368 kfree(ctlr);
372369 }
373370
@@ -376,20 +373,17 @@ static struct rdac_controller *get_controller(int index, char *array_name, · 2 unmodified lines
376373 {
377374 struct rdac_controller *ctlr, *tmp;
378375
379− spin_lock(&list_lock);
380−
381376 list_for_each_entry(tmp, &ctlr_list, node) {
382377 if ((memcmp(tmp->array_id, array_id, UNIQUE_ID_LEN) == 0) &&
383378 (tmp->index == index) &&
384379 (tmp->host == sdev->host)) {
385380 kref_get(&tmp->kref);
386− spin_unlock(&list_lock);
387381 return tmp;
388382 }
389383 }
390384 ctlr = kmalloc(sizeof(*ctlr), GFP_ATOMIC);
391385 if (!ctlr)
392− goto done;
386+ return NULL;
393387
394388 /* initialize fields of controller */
395389 memcpy(ctlr->array_id, array_id, UNIQUE_ID_LEN);
@@ -405,8 +399,7 @@ static struct rdac_controller *get_controller(int index, char *array_name, · 9 unmodified lines
405399 INIT_WORK(&ctlr->ms_work, send_mode_select);
406400 INIT_LIST_HEAD(&ctlr->ms_head);
407401 list_add(&ctlr->node, &ctlr_list);
408−done:
409− spin_unlock(&list_lock);
402+
410403 return ctlr;
411404 }
412405
@@ -517,9 +510,12 @@ static int initialize_controller(struct scsi_device *sdev, · 104 unmodified lines
517510 index = 0;
518511 else
519512 index = 1;
513+
514+ spin_lock(&list_lock);
520515 h->ctlr = get_controller(index, array_name, array_id, sdev);
521516 if (!h->ctlr)
522517 err = SCSI_DH_RES_TEMP_UNAVAIL;
518+ spin_unlock(&list_lock);
523519 }
524520 return err;
525521 }
@@ -906,7 +902,9 @@ static int rdac_bus_attach(struct scsi_device *sdev) · 380 unmodified lines
906902 return 0;
907903
908904 clean_ctlr:
905+ spin_lock(&list_lock);
909906 kref_put(&h->ctlr->kref, release_controller);
907+ spin_unlock(&list_lock);
910908
911909 failed:
912910 kfree(scsi_dh_data);
@@ -921,14 +919,19 @@ static void rdac_bus_detach( struct scsi_device *sdev ) · 8 unmodified lines
921919 struct rdac_dh_data *h;
922920 unsigned long flags;
923921
924− spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
925922 scsi_dh_data = sdev->scsi_dh_data;
923+ h = (struct rdac_dh_data *) scsi_dh_data->buf;
924+ if (h->ctlr && h->ctlr->ms_queued)
925+ flush_workqueue(kmpath_rdacd);
926+
927+ spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
926928 sdev->scsi_dh_data = NULL;
927929 spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
928930
929− h = (struct rdac_dh_data *) scsi_dh_data->buf;
931+ spin_lock(&list_lock);
930932 if (h->ctlr)
931933 kref_put(&h->ctlr->kref, release_controller);
934+ spin_unlock(&list_lock);
932935 kfree(scsi_dh_data);
933936 module_put(THIS_MODULE);
934937 sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", RDAC_NAME);
drivers/scsi/ipr.c+18−6
@@ -4613,11 +4613,13 @@ static int __ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd) · 4612 unmodified lines
46134613 ENTER;
46144614 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
46154615
4616− dev_err(&ioa_cfg->pdev->dev,
4617− "Adapter being reset as a result of error recovery.\n");
4616+ if (!ioa_cfg->in_reset_reload) {
4617+ dev_err(&ioa_cfg->pdev->dev,
4618+ "Adapter being reset as a result of error recovery.\n");
46184619
4619− if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)
4620− ioa_cfg->sdt_state = GET_DUMP;
4620+ if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)
4621+ ioa_cfg->sdt_state = GET_DUMP;
4622+ }
46214623
46224624 rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV);
46234625
@@ -4907,7 +4909,7 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd) · 283 unmodified lines
49074909 struct ipr_ioa_cfg *ioa_cfg;
49084910 struct ipr_resource_entry *res;
49094911 struct ipr_cmd_pkt *cmd_pkt;
4910− u32 ioasc;
4912+ u32 ioasc, int_reg;
49114913 int op_found = 0;
49124914
49134915 ENTER;
@@ -4920,7 +4922,17 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd) · 6 unmodified lines
49204922 */
49214923 if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead)
49224924 return FAILED;
4923− if (!res || !ipr_is_gscsi(res))
4925+ if (!res)
4926+ return FAILED;
4927+
4928+ /*
4929+ * If we are aborting a timed out op, chances are that the timeout was caused
4930+ * by a still not detected EEH error. In such cases, reading a register will
4931+ * trigger the EEH recovery infrastructure.
4932+ */
4933+ int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
4934+
4935+ if (!ipr_is_gscsi(res))
49244936 return FAILED;
49254937
49264938 list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
drivers/scsi/isci/host.c+3−1
@@ -1848,9 +1848,11 @@ static enum sci_status sci_oem_parameters_set(struct isci_host *ihost) · 1847 unmodified lines
18481848 if (state == SCIC_RESET ||
18491849 state == SCIC_INITIALIZING ||
18501850 state == SCIC_INITIALIZED) {
1851+ u8 oem_version = pci_info->orom ? pci_info->orom->hdr.version :
1852+ ISCI_ROM_VER_1_0;
18511853
18521854 if (sci_oem_parameters_validate(&ihost->oem_parameters,
1853− pci_info->orom->hdr.version))
1855+ oem_version))
18541856 return SCI_FAILURE_INVALID_PARAMETER_VALUE;
18551857
18561858 return SCI_SUCCESS;
drivers/scsi/mpt2sas/mpt2sas_base.c+2−1
@@ -4548,7 +4548,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, · 4547 unmodified lines
45484548 printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n",
45494549 ioc->name, __func__);
45504550 r = 0;
4551− goto out;
4551+ goto out_unlocked;
45524552 }
45534553
45544554 if (mpt2sas_fwfault_debug)
@@ -4604,6 +4604,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, · 49 unmodified lines
46044604 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
46054605 mutex_unlock(&ioc->reset_in_progress_mutex);
46064606
4607+ out_unlocked:
46074608 dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name,
46084609 __func__));
46094610 return r;
drivers/scsi/qla2xxx/qla_attr.c+4−9
@@ -1036,8 +1036,7 @@ qla2x00_link_state_show(struct device *dev, struct device_attribute *attr, · 1035 unmodified lines
10361036 vha->device_flags & DFLG_NO_CABLE)
10371037 len = snprintf(buf, PAGE_SIZE, "Link Down\n");
10381038 else if (atomic_read(&vha->loop_state) != LOOP_READY ||
1039− test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
1040− test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
1039+ qla2x00_reset_active(vha))
10411040 len = snprintf(buf, PAGE_SIZE, "Unknown Link State\n");
10421041 else {
10431042 len = snprintf(buf, PAGE_SIZE, "Link Up - ");
@@ -1359,8 +1358,7 @@ qla2x00_thermal_temp_show(struct device *dev, · 315 unmodified lines
13591358 return snprintf(buf, PAGE_SIZE, "\n");
13601359
13611360 temp = frac = 0;
1362− if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
1363− test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
1361+ if (qla2x00_reset_active(vha))
13641362 ql_log(ql_log_warn, vha, 0x707b,
13651363 "ISP reset active.\n");
13661364 else if (!vha->hw->flags.eeh_busy)
@@ -1379,8 +1377,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, · 12 unmodified lines
13791377 int rval = QLA_FUNCTION_FAILED;
13801378 uint16_t state[5];
13811379
1382− if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
1383− test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
1380+ if (qla2x00_reset_active(vha))
13841381 ql_log(ql_log_warn, vha, 0x707c,
13851382 "ISP reset active.\n");
13861383 else if (!vha->hw->flags.eeh_busy)
@@ -1693,9 +1690,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) · 306 unmodified lines
16931690 if (IS_FWI2_CAPABLE(ha)) {
16941691 rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma);
16951692 } else if (atomic_read(&base_vha->loop_state) == LOOP_READY &&
1696− !test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) &&
1697− !test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) &&
1698− !ha->dpc_active) {
1693+ !qla2x00_reset_active(vha) && !ha->dpc_active) {
16991694 /* Must be in a 'READY' state for statistics retrieval. */
17001695 rval = qla2x00_get_link_status(base_vha, base_vha->loop_id,
17011696 stats, stats_dma);
drivers/scsi/qla2xxx/qla_bsg.c+9−41
@@ -108,13 +108,6 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job) · 107 unmodified lines
108108 goto exit_fcp_prio_cfg;
109109 }
110110
111− if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
112− test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
113− test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
114− ret = -EBUSY;
115− goto exit_fcp_prio_cfg;
116− }
117−
118111 /* Get the sub command */
119112 oper = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
120113
@@ -646,13 +639,6 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job) · 525 unmodified lines
646639 dma_addr_t rsp_data_dma;
647640 uint32_t rsp_data_len;
648641
649− if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
650− test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
651− test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
652− ql_log(ql_log_warn, vha, 0x7018, "Abort active or needed.\n");
653− return -EBUSY;
654− }
655−
656642 if (!vha->flags.online) {
657643 ql_log(ql_log_warn, vha, 0x7019, "Host is not online.\n");
658644 return -EIO;
@@ -874,13 +860,6 @@ qla84xx_reset(struct fc_bsg_job *bsg_job) · 215 unmodified lines
874860 int rval = 0;
875861 uint32_t flag;
876862
877− if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
878− test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
879− test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
880− ql_log(ql_log_warn, vha, 0x702e, "Abort active or needed.\n");
881− return -EBUSY;
882− }
883−
884863 if (!IS_QLA84XX(ha)) {
885864 ql_dbg(ql_dbg_user, vha, 0x702f, "Not 84xx, exiting.\n");
886865 return -EINVAL;
@@ -922,11 +901,6 @@ qla84xx_updatefw(struct fc_bsg_job *bsg_job) · 35 unmodified lines
922901 uint32_t flag;
923902 uint32_t fw_ver;
924903
925− if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
926− test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
927− test_bit(ISP_ABORT_RETRY, &vha->dpc_flags))
928− return -EBUSY;
929−
930904 if (!IS_QLA84XX(ha)) {
931905 ql_dbg(ql_dbg_user, vha, 0x7032,
932906 "Not 84xx, exiting.\n");
@@ -1036,14 +1010,6 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job) · 103 unmodified lines
10361010 uint32_t data_len = 0;
10371011 uint32_t dma_direction = DMA_NONE;
10381012
1039− if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
1040− test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
1041− test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
1042− ql_log(ql_log_warn, vha, 0x7039,
1043− "Abort active or needed.\n");
1044− return -EBUSY;
1045− }
1046−
10471013 if (!IS_QLA84XX(ha)) {
10481014 ql_log(ql_log_warn, vha, 0x703a,
10491015 "Not 84xx, exiting.\n");
@@ -1246,13 +1212,6 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job) · 196 unmodified lines
12461212
12471213 bsg_job->reply->reply_payload_rcv_len = 0;
12481214
1249− if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
1250− test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
1251− test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
1252− ql_log(ql_log_warn, vha, 0x7045, "abort active or needed.\n");
1253− return -EBUSY;
1254− }
1255−
12561215 if (!IS_IIDMA_CAPABLE(vha->hw)) {
12571216 ql_log(ql_log_info, vha, 0x7046, "iiDMA not supported.\n");
12581217 return -EINVAL;
@@ -1668,6 +1627,15 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job) · 409 unmodified lines
16681627 vha = shost_priv(host);
16691628 }
16701629
1630+ if (qla2x00_reset_active(vha)) {
1631+ ql_dbg(ql_dbg_user, vha, 0x709f,
1632+ "BSG: ISP abort active/needed -- cmd=%d.\n",
1633+ bsg_job->request->msgcode);
1634+ bsg_job->reply->result = (DID_ERROR << 16);
1635+ bsg_job->job_done(bsg_job);
1636+ return -EBUSY;
1637+ }
1638+
16711639 ql_dbg(ql_dbg_user, vha, 0x7000,
16721640 "Entered %s msgcode=0x%x.\n", __func__, bsg_job->request->msgcode);
16731641
drivers/scsi/qla2xxx/qla_dbg.c+2−1
@@ -19,7 +19,8 @@ · 18 unmodified lines
1919 * | DPC Thread | 0x401c | |
2020 * | Async Events | 0x5057 | 0x5052 |
2121 * | Timer Routines | 0x6011 | 0x600e,0x600f |
22− * | User Space Interactions | 0x709e | |
22+ * | User Space Interactions | 0x709e | 0x7018,0x702e |
23+ * | | | 0x7039,0x7045 |
2324 * | Task Management | 0x803c | 0x8025-0x8026 |
2425 * | | | 0x800b,0x8039 |
2526 * | AER/EEH | 0x900f | |
drivers/scsi/qla2xxx/qla_def.h+1−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 * ISP2100 HBAs.
4545 */
4646 #define MAILBOX_REGISTER_COUNT_2100 8
47+#define MAILBOX_REGISTER_COUNT_2200 24
4748 #define MAILBOX_REGISTER_COUNT 32
4849
4950 #define QLA2200A_RISC_ROM_VER 4
drivers/scsi/qla2xxx/qla_inline.h+13−0
@@ -131,3 +131,16 @@ qla2x00_hba_err_chk_enabled(srb_t *sp) · 130 unmodified lines
131131 }
132132 return 0;
133133 }
134+
135+static inline int
136+qla2x00_reset_active(scsi_qla_host_t *vha)
137+{
138+ scsi_qla_host_t *base_vha = pci_get_drvdata(vha->hw->pdev);
139+
140+ /* Test appropriate base-vha and vha flags. */
141+ return test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) ||
142+ test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) ||
143+ test_bit(ISP_ABORT_RETRY, &base_vha->dpc_flags) ||
144+ test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
145+ test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
146+}
drivers/scsi/qla2xxx/qla_isr.c+0−1
@@ -2090,7 +2090,6 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, · 2089 unmodified lines
20902090 break;
20912091 case CT_IOCB_TYPE:
20922092 qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE);
2093− clear_bit(MBX_INTERRUPT, &vha->hw->mbx_cmd_flags);
20942093 break;
20952094 case ELS_IOCB_TYPE:
20962095 qla24xx_els_ct_entry(vha, rsp->req, pkt, ELS_IOCB_TYPE);
drivers/scsi/qla2xxx/qla_mbx.c+6−1
@@ -342,6 +342,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) · 341 unmodified lines
342342
343343 set_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
344344 clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
345+ /* Allow next mbx cmd to come in. */
346+ complete(&ha->mbx_cmd_comp);
345347 if (ha->isp_ops->abort_isp(vha)) {
346348 /* Failed. retry later. */
347349 set_bit(ISP_ABORT_NEEDED,
@@ -350,6 +352,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) · 2 unmodified lines
350352 clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
351353 ql_dbg(ql_dbg_mbx, base_vha, 0x101f,
352354 "Finished abort_isp.\n");
355+ goto mbx_done;
353356 }
354357 }
355358 }
@@ -358,6 +361,7 @@ premature_exit: · 2 unmodified lines
358361 /* Allow next mbx cmd to come in. */
359362 complete(&ha->mbx_cmd_comp);
360363
364+mbx_done:
361365 if (rval) {
362366 ql_dbg(ql_dbg_mbx, base_vha, 0x1020,
363367 "**** Failed mbx[0]=%x, mb[1]=%x, mb[2]=%x, cmd=%x ****.\n",
@@ -2581,7 +2585,8 @@ qla2x00_stop_firmware(scsi_qla_host_t *vha) · 2217 unmodified lines
25812585 ql_dbg(ql_dbg_mbx, vha, 0x10a1, "Entered %s.\n", __func__);
25822586
25832587 mcp->mb[0] = MBC_STOP_FIRMWARE;
2584− mcp->out_mb = MBX_0;
2588+ mcp->mb[1] = 0;
2589+ mcp->out_mb = MBX_1|MBX_0;
25852590 mcp->in_mb = MBX_0;
25862591 mcp->tov = 5;
25872592 mcp->flags = 0;
drivers/scsi/qla2xxx/qla_nx.c+1−14
@@ -1165,19 +1165,6 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha) · 1164 unmodified lines
11651165 qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff);
11661166 else
11671167 qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff);
1168−
1169− /* reset ms */
1170− val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4);
1171− val |= (1 << 1);
1172− qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
1173− msleep(20);
1174−
1175− /* unreset ms */
1176− val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4);
1177− val &= ~(1 << 1);
1178− qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
1179− msleep(20);
1180−
11811168 qla82xx_rom_unlock(ha);
11821169
11831170 /* Read the signature value from the flash.
@@ -3392,7 +3379,7 @@ void qla82xx_watchdog(scsi_qla_host_t *vha) · 2208 unmodified lines
33923379 QLA82XX_CRB_PEG_NET_3 + 0x3c),
33933380 qla82xx_rd_32(ha,
33943381 QLA82XX_CRB_PEG_NET_4 + 0x3c));
3395− if (LSW(MSB(halt_status)) == 0x67)
3382+ if (((halt_status & 0x1fffff00) >> 8) == 0x67)
33963383 ql_log(ql_log_warn, vha, 0xb052,
33973384 "Firmware aborted with "
33983385 "error code 0x00006700. Device is "
drivers/scsi/qla2xxx/qla_os.c+8−11
@@ -625,6 +625,12 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) · 624 unmodified lines
625625 cmd->result = DID_NO_CONNECT << 16;
626626 goto qc24_fail_command;
627627 }
628+
629+ if (!fcport) {
630+ cmd->result = DID_NO_CONNECT << 16;
631+ goto qc24_fail_command;
632+ }
633+
628634 if (atomic_read(&fcport->state) != FCS_ONLINE) {
629635 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
630636 atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
@@ -877,6 +883,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) · 246 unmodified lines
877883
878884 spin_unlock_irqrestore(&ha->hardware_lock, flags);
879885 if (ha->isp_ops->abort_command(sp)) {
886+ ret = FAILED;
880887 ql_dbg(ql_dbg_taskm, vha, 0x8003,
881888 "Abort command mbx failed cmd=%p.\n", cmd);
882889 } else {
@@ -1124,7 +1131,6 @@ static int · 241 unmodified lines
11241131 qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
11251132 {
11261133 scsi_qla_host_t *vha = shost_priv(cmd->device->host);
1127− fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
11281134 struct qla_hw_data *ha = vha->hw;
11291135 int ret = FAILED;
11301136 unsigned int id, lun;
@@ -1133,15 +1139,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) · 2 unmodified lines
11331139 id = cmd->device->id;
11341140 lun = cmd->device->lun;
11351141
1136− if (!fcport) {
1137− return ret;
1138− }
1139−
1140− ret = fc_block_scsi_eh(cmd);
1141− if (ret != 0)
1142− return ret;
1143− ret = FAILED;
1144−
11451142 ql_log(ql_log_info, vha, 0x8018,
11461143 "ADAPTER RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun);
11471144
@@ -2047,7 +2044,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) · 899 unmodified lines
20472044 ha->nvram_data_off = ~0;
20482045 ha->isp_ops = &qla2100_isp_ops;
20492046 } else if (IS_QLA2200(ha)) {
2050− ha->mbx_count = MAILBOX_REGISTER_COUNT;
2047+ ha->mbx_count = MAILBOX_REGISTER_COUNT_2200;
20512048 req_length = REQUEST_ENTRY_CNT_2200;
20522049 rsp_length = RESPONSE_ENTRY_CNT_2100;
20532050 ha->max_loop_id = SNS_LAST_LOOP_ID_2100;
drivers/scsi/qla2xxx/qla_version.h+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 /*
88 * Driver version
99 */
10−#define QLA2XXX_VERSION "8.03.07.12-k"
10+#define QLA2XXX_VERSION "8.03.07.13-k"
1111
1212 #define QLA_DRIVER_MAJOR_VER 8
1313 #define QLA_DRIVER_MINOR_VER 3
drivers/scsi/qla4xxx/ql4_nx.c+2−21
@@ -10,6 +10,8 @@ · 9 unmodified lines
1010 #include "ql4_def.h"
1111 #include "ql4_glbl.h"
1212
13+#include <asm-generic/io-64-nonatomic-lo-hi.h>
14+
1315 #define MASK(n) DMA_BIT_MASK(n)
1416 #define MN_WIN(addr) (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff))
1517 #define OCM_WIN(addr) (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff))
@@ -655,27 +657,6 @@ static int qla4_8xxx_pci_is_same_window(struct scsi_qla_host *ha, · 639 unmodified lines
655657 return 0;
656658 }
657659
658−#ifndef readq
659−static inline __u64 readq(const volatile void __iomem *addr)
660−{
661− const volatile u32 __iomem *p = addr;
662− u32 low, high;
663−
664− low = readl(p);
665− high = readl(p + 1);
666−
667− return low + ((u64)high << 32);
668−}
669−#endif
670−
671−#ifndef writeq
672−static inline void writeq(__u64 val, volatile void __iomem *addr)
673−{
674− writel(val, addr);
675− writel(val >> 32, addr+4);
676−}
677−#endif
678−
679660 static int qla4_8xxx_pci_mem_read_direct(struct scsi_qla_host *ha,
680661 u64 off, void *data, int size)
681662 {
drivers/scsi/scsi_pm.c+16−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77
88 #include <linux/pm_runtime.h>
99 #include <linux/export.h>
10+#include <linux/async.h>
1011
1112 #include <scsi/scsi.h>
1213 #include <scsi/scsi_device.h>
@@ -92,6 +93,19 @@ static int scsi_bus_resume_common(struct device *dev) · 79 unmodified lines
9293 return err;
9394 }
9495
96+static int scsi_bus_prepare(struct device *dev)
97+{
98+ if (scsi_is_sdev_device(dev)) {
99+ /* sd probing uses async_schedule. Wait until it finishes. */
100+ async_synchronize_full();
101+
102+ } else if (scsi_is_host_device(dev)) {
103+ /* Wait until async scanning is finished */
104+ scsi_complete_async_scans();
105+ }
106+ return 0;
107+}
108+
95109 static int scsi_bus_suspend(struct device *dev)
96110 {
97111 return scsi_bus_suspend_common(dev, PMSG_SUSPEND);
@@ -110,6 +124,7 @@ static int scsi_bus_poweroff(struct device *dev) · 12 unmodified lines
110124 #else /* CONFIG_PM_SLEEP */
111125
112126 #define scsi_bus_resume_common NULL
127+#define scsi_bus_prepare NULL
113128 #define scsi_bus_suspend NULL
114129 #define scsi_bus_freeze NULL
115130 #define scsi_bus_poweroff NULL
@@ -218,6 +233,7 @@ void scsi_autopm_put_host(struct Scsi_Host *shost) · 102 unmodified lines
218233 #endif /* CONFIG_PM_RUNTIME */
219234
220235 const struct dev_pm_ops scsi_bus_pm_ops = {
236+ .prepare = scsi_bus_prepare,
221237 .suspend = scsi_bus_suspend,
222238 .resume = scsi_bus_resume_common,
223239 .freeze = scsi_bus_freeze,
drivers/scsi/scsi_priv.h+1−0
@@ -109,6 +109,7 @@ extern void scsi_exit_procfs(void); · 108 unmodified lines
109109 #endif /* CONFIG_PROC_FS */
110110
111111 /* scsi_scan.c */
112+extern int scsi_complete_async_scans(void);
112113 extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
113114 unsigned int, unsigned int, int);
114115 extern void scsi_forget_host(struct Scsi_Host *);
drivers/scsi/scsi_scan.c+2−2
@@ -1815,6 +1815,7 @@ static void scsi_finish_async_scan(struct async_scan_data *data) · 1814 unmodified lines
18151815 }
18161816 spin_unlock(&async_scan_lock);
18171817
1818+ scsi_autopm_put_host(shost);
18181819 scsi_host_put(shost);
18191820 kfree(data);
18201821 }
@@ -1841,7 +1842,6 @@ static int do_scan_async(void *_data) · 20 unmodified lines
18411842
18421843 do_scsi_scan_host(shost);
18431844 scsi_finish_async_scan(data);
1844− scsi_autopm_put_host(shost);
18451845 return 0;
18461846 }
18471847
@@ -1869,7 +1869,7 @@ void scsi_scan_host(struct Scsi_Host *shost) · 21 unmodified lines
18691869 p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
18701870 if (IS_ERR(p))
18711871 do_scan_async(data);
1872− /* scsi_autopm_put_host(shost) is called in do_scan_async() */
1872+ /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */
18731873 }
18741874 EXPORT_SYMBOL(scsi_scan_host);
18751875
drivers/sh/clk/cpg.c+1−1
@@ -190,7 +190,7 @@ static int __init sh_clk_init_parent(struct clk *clk) · 189 unmodified lines
190190 return -EINVAL;
191191 }
192192
193− clk->parent = clk->parent_table[val];
193+ clk_reparent(clk, clk->parent_table[val]);
194194 if (!clk->parent) {
195195 pr_err("sh_clk_init_parent: unable to set parent");
196196 return -EINVAL;
drivers/spi/Kconfig+1−1
@@ -299,7 +299,7 @@ config SPI_S3C24XX_FIQ · 298 unmodified lines
299299
300300 config SPI_S3C64XX
301301 tristate "Samsung S3C64XX series type SPI"
302− depends on (ARCH_S3C64XX || ARCH_S5P64X0)
302+ depends on (ARCH_S3C64XX || ARCH_S5P64X0 || ARCH_EXYNOS)
303303 select S3C64XX_DMA if ARCH_S3C64XX
304304 help
305305 SPI driver for Samsung S3C64XX and newer SoCs.
drivers/spi/spi-topcliff-pch.c+3−3
@@ -1720,7 +1720,7 @@ static int pch_spi_resume(struct pci_dev *pdev) · 1719 unmodified lines
17201720
17211721 #endif
17221722
1723−static struct pci_driver pch_spi_pcidev = {
1723+static struct pci_driver pch_spi_pcidev_driver = {
17241724 .name = "pch_spi",
17251725 .id_table = pch_spi_pcidev_id,
17261726 .probe = pch_spi_probe,
@@ -1736,7 +1736,7 @@ static int __init pch_spi_init(void) · 9 unmodified lines
17361736 if (ret)
17371737 return ret;
17381738
1739− ret = pci_register_driver(&pch_spi_pcidev);
1739+ ret = pci_register_driver(&pch_spi_pcidev_driver);
17401740 if (ret)
17411741 return ret;
17421742
@@ -1746,7 +1746,7 @@ module_init(pch_spi_init); · 3 unmodified lines
17461746
17471747 static void __exit pch_spi_exit(void)
17481748 {
1749− pci_unregister_driver(&pch_spi_pcidev);
1749+ pci_unregister_driver(&pch_spi_pcidev_driver);
17501750 platform_driver_unregister(&pch_spi_pd_driver);
17511751 }
17521752 module_exit(pch_spi_exit);
drivers/ssb/driver_pcicore.c+1−1
@@ -75,7 +75,7 @@ static u32 get_cfgspace_addr(struct ssb_pcicore *pc, · 74 unmodified lines
7575 u32 tmp;
7676
7777 /* We do only have one cardbus device behind the bridge. */
78− if (pc->cardbusmode && (dev >= 1))
78+ if (pc->cardbusmode && (dev > 1))
7979 goto out;
8080
8181 if (bus == 0) {
drivers/staging/Kconfig+0−4
@@ -60,8 +60,6 @@ source "drivers/staging/rts5139/Kconfig" · 59 unmodified lines
6060
6161 source "drivers/staging/frontier/Kconfig"
6262
63−source "drivers/staging/pohmelfs/Kconfig"
64−
6563 source "drivers/staging/phison/Kconfig"
6664
6765 source "drivers/staging/line6/Kconfig"
@@ -120,8 +118,6 @@ source "drivers/staging/cptm1217/Kconfig" · 52 unmodified lines
120118
121119 source "drivers/staging/ste_rmi4/Kconfig"
122120
123−source "drivers/staging/gma500/Kconfig"
124−
125121 source "drivers/staging/mei/Kconfig"
126122
127123 source "drivers/staging/nvec/Kconfig"
drivers/staging/Makefile+0−2
@@ -22,7 +22,6 @@ obj-$(CONFIG_R8712U) += rtl8712/ · 21 unmodified lines
2222 obj-$(CONFIG_RTS_PSTOR) += rts_pstor/
2323 obj-$(CONFIG_RTS5139) += rts5139/
2424 obj-$(CONFIG_TRANZPORT) += frontier/
25−obj-$(CONFIG_POHMELFS) += pohmelfs/
2625 obj-$(CONFIG_IDE_PHISON) += phison/
2726 obj-$(CONFIG_LINE6_USB) += line6/
2827 obj-$(CONFIG_USB_SERIAL_QUATECH2) += serqt_usb2/
@@ -52,7 +51,6 @@ obj-$(CONFIG_FT1000) += ft1000/ · 23 unmodified lines
5251 obj-$(CONFIG_SPEAKUP) += speakup/
5352 obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217) += cptm1217/
5453 obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += ste_rmi4/
55−obj-$(CONFIG_DRM_PSB) += gma500/
5654 obj-$(CONFIG_INTEL_MEI) += mei/
5755 obj-$(CONFIG_MFD_NVEC) += nvec/
5856 obj-$(CONFIG_DRM_OMAP) += omapdrm/
drivers/staging/android/Kconfig+1−4
@@ -27,6 +27,7 @@ config ANDROID_LOGGER · 26 unmodified lines
2727
2828 config ANDROID_RAM_CONSOLE
2929 bool "Android RAM buffer console"
30+ depends on !S390 && !UML
3031 default n
3132
3233 config ANDROID_RAM_CONSOLE_ENABLE_VERBOSE
@@ -99,10 +100,6 @@ config ANDROID_LOW_MEMORY_KILLER · 66 unmodified lines
99100 ---help---
100101 Register processes to be killed when memory is low
101102
102−config ANDROID_PMEM
103− bool "Android pmem allocator"
104− depends on ARM
105−
106103 source "drivers/staging/android/switch/Kconfig"
107104
108105 endif # if ANDROID
drivers/staging/android/Makefile+0−1
@@ -5,5 +5,4 @@ obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o · 4 unmodified lines
55 obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
66 obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o
77 obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
8−obj-$(CONFIG_ANDROID_PMEM) += pmem.o
98 obj-$(CONFIG_ANDROID_SWITCH) += switch/
drivers/staging/android/android_pmem.h+0−93
@@ -1,93 +0,0 @@
1−/* include/linux/android_pmem.h
2− *
3− * Copyright (C) 2007 Google, Inc.
4− *
5− * This software is licensed under the terms of the GNU General Public
6− * License version 2, as published by the Free Software Foundation, and
7− * may be copied, distributed, and modified under those terms.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− */
15−
16−#ifndef _ANDROID_PMEM_H_
17−#define _ANDROID_PMEM_H_
18−
19−#define PMEM_IOCTL_MAGIC 'p'
20−#define PMEM_GET_PHYS _IOW(PMEM_IOCTL_MAGIC, 1, unsigned int)
21−#define PMEM_MAP _IOW(PMEM_IOCTL_MAGIC, 2, unsigned int)
22−#define PMEM_GET_SIZE _IOW(PMEM_IOCTL_MAGIC, 3, unsigned int)
23−#define PMEM_UNMAP _IOW(PMEM_IOCTL_MAGIC, 4, unsigned int)
24−/* This ioctl will allocate pmem space, backing the file, it will fail
25− * if the file already has an allocation, pass it the len as the argument
26− * to the ioctl */
27−#define PMEM_ALLOCATE _IOW(PMEM_IOCTL_MAGIC, 5, unsigned int)
28−/* This will connect a one pmem file to another, pass the file that is already
29− * backed in memory as the argument to the ioctl
30− */
31−#define PMEM_CONNECT _IOW(PMEM_IOCTL_MAGIC, 6, unsigned int)
32−/* Returns the total size of the pmem region it is sent to as a pmem_region
33− * struct (with offset set to 0).
34− */
35−#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, unsigned int)
36−#define PMEM_CACHE_FLUSH _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
37−
38−struct android_pmem_platform_data
39−{
40− const char* name;
41− /* starting physical address of memory region */
42− unsigned long start;
43− /* size of memory region */
44− unsigned long size;
45− /* set to indicate the region should not be managed with an allocator */
46− unsigned no_allocator;
47− /* set to indicate maps of this region should be cached, if a mix of
48− * cached and uncached is desired, set this and open the device with
49− * O_SYNC to get an uncached region */
50− unsigned cached;
51− /* The MSM7k has bits to enable a write buffer in the bus controller*/
52− unsigned buffered;
53−};
54−
55−struct pmem_region {
56− unsigned long offset;
57− unsigned long len;
58−};
59−
60−#ifdef CONFIG_ANDROID_PMEM
61−int is_pmem_file(struct file *file);
62−int get_pmem_file(int fd, unsigned long *start, unsigned long *vstart,
63− unsigned long *end, struct file **filp);
64−int get_pmem_user_addr(struct file *file, unsigned long *start,
65− unsigned long *end);
66−void put_pmem_file(struct file* file);
67−void flush_pmem_file(struct file *file, unsigned long start, unsigned long len);
68−int pmem_setup(struct android_pmem_platform_data *pdata,
69− long (*ioctl)(struct file *, unsigned int, unsigned long),
70− int (*release)(struct inode *, struct file *));
71−int pmem_remap(struct pmem_region *region, struct file *file,
72− unsigned operation);
73−
74−#else
75−static inline int is_pmem_file(struct file *file) { return 0; }
76−static inline int get_pmem_file(int fd, unsigned long *start,
77− unsigned long *vstart, unsigned long *end,
78− struct file **filp) { return -ENOSYS; }
79−static inline int get_pmem_user_addr(struct file *file, unsigned long *start,
80− unsigned long *end) { return -ENOSYS; }
81−static inline void put_pmem_file(struct file* file) { return; }
82−static inline void flush_pmem_file(struct file *file, unsigned long start,
83− unsigned long len) { return; }
84−static inline int pmem_setup(struct android_pmem_platform_data *pdata,
85− long (*ioctl)(struct file *, unsigned int, unsigned long),
86− int (*release)(struct inode *, struct file *)) { return -ENOSYS; }
87−
88−static inline int pmem_remap(struct pmem_region *region, struct file *file,
89− unsigned operation) { return -ENOSYS; }
90−#endif
91−
92−#endif //_ANDROID_PPP_H_
93−
drivers/staging/android/binder.c+11−2
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838
3939 static DEFINE_MUTEX(binder_lock);
4040 static DEFINE_MUTEX(binder_deferred_lock);
41+static DEFINE_MUTEX(binder_mmap_lock);
4142
4243 static HLIST_HEAD(binder_procs);
4344 static HLIST_HEAD(binder_deferred_list);
@@ -632,6 +633,11 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, · 588 unmodified lines
632633 if (mm) {
633634 down_write(&mm->mmap_sem);
634635 vma = proc->vma;
636+ if (vma && mm != vma->vm_mm) {
637+ pr_err("binder: %d: vma mm and task mm mismatch\n",
638+ proc->pid);
639+ vma = NULL;
640+ }
635641 }
636642
637643 if (allocate == 0)
@@ -2759,7 +2765,6 @@ static void binder_vma_open(struct vm_area_struct *vma) · 2121 unmodified lines
27592765 proc->pid, vma->vm_start, vma->vm_end,
27602766 (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
27612767 (unsigned long)pgprot_val(vma->vm_page_prot));
2762− dump_stack();
27632768 }
27642769
27652770 static void binder_vma_close(struct vm_area_struct *vma)
@@ -2803,6 +2808,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma) · 37 unmodified lines
28032808 }
28042809 vma->vm_flags = (vma->vm_flags | VM_DONTCOPY) & ~VM_MAYWRITE;
28052810
2811+ mutex_lock(&binder_mmap_lock);
28062812 if (proc->buffer) {
28072813 ret = -EBUSY;
28082814 failure_string = "already mapped";
@@ -2817,6 +2823,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma) · 8 unmodified lines
28172823 }
28182824 proc->buffer = area->addr;
28192825 proc->user_buffer_offset = vma->vm_start - (uintptr_t)proc->buffer;
2826+ mutex_unlock(&binder_mmap_lock);
28202827
28212828 #ifdef CONFIG_CPU_CACHE_VIPT
28222829 if (cache_is_vipt_aliasing()) {
@@ -2849,7 +2856,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma) · 26 unmodified lines
28492856 binder_insert_free_buffer(proc, buffer);
28502857 proc->free_async_space = proc->buffer_size / 2;
28512858 barrier();
2852− proc->files = get_files_struct(current);
2859+ proc->files = get_files_struct(proc->tsk);
28532860 proc->vma = vma;
28542861
28552862 /*printk(KERN_INFO "binder_mmap: %d %lx-%lx maps %p\n",
@@ -2860,10 +2867,12 @@ err_alloc_small_buf_failed: · 4 unmodified lines
28602867 kfree(proc->pages);
28612868 proc->pages = NULL;
28622869 err_alloc_pages_failed:
2870+ mutex_lock(&binder_mmap_lock);
28632871 vfree(proc->buffer);
28642872 proc->buffer = NULL;
28652873 err_get_vm_area_failed:
28662874 err_already_mapped:
2875+ mutex_unlock(&binder_mmap_lock);
28672876 err_bad_arg:
28682877 printk(KERN_ERR "binder_mmap: %d %lx-%lx %s failed %d\n",
28692878 proc->pid, vma->vm_start, vma->vm_end, failure_string, ret);
drivers/staging/android/lowmemorykiller.c+4−1
@@ -54,6 +54,7 @@ static size_t lowmem_minfree[6] = { · 53 unmodified lines
5454 static int lowmem_minfree_size = 4;
5555
5656 static struct task_struct *lowmem_deathpending;
57+static unsigned long lowmem_deathpending_timeout;
5758
5859 #define lowmem_print(level, x...) \
5960 do { \
@@ -103,7 +104,8 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) · 43 unmodified lines
103104 * Note: Currently you need CONFIG_PROFILING
104105 * for this to work correctly.
105106 */
106− if (lowmem_deathpending)
107+ if (lowmem_deathpending &&
108+ time_before_eq(jiffies, lowmem_deathpending_timeout))
107109 return 0;
108110
109111 if (lowmem_adj_size < array_size)
@@ -178,6 +180,7 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) · 68 unmodified lines
178180 */
179181 #ifdef CONFIG_PROFILING
180182 lowmem_deathpending = selected;
183+ lowmem_deathpending_timeout = jiffies + HZ;
181184 task_handoff_register(&task_nb);
182185 #endif
183186 force_sig(SIGKILL, selected);
drivers/staging/android/pmem.c+0−1345
@@ -1,1345 +0,0 @@
1−/* pmem.c
2− *
3− * Copyright (C) 2007 Google, Inc.
4− *
5− * This software is licensed under the terms of the GNU General Public
6− * License version 2, as published by the Free Software Foundation, and
7− * may be copied, distributed, and modified under those terms.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− */
15−
16−#include <linux/miscdevice.h>
17−#include <linux/platform_device.h>
18−#include <linux/fs.h>
19−#include <linux/file.h>
20−#include <linux/mm.h>
21−#include <linux/list.h>
22−#include <linux/mutex.h>
23−#include <linux/debugfs.h>
24−#include <linux/mempolicy.h>
25−#include <linux/sched.h>
26−#include <asm/io.h>
27−#include <asm/uaccess.h>
28−#include <asm/cacheflush.h>
29−#include "android_pmem.h"
30−
31−#define PMEM_MAX_DEVICES 10
32−#define PMEM_MAX_ORDER 128
33−#define PMEM_MIN_ALLOC PAGE_SIZE
34−
35−#define PMEM_DEBUG 1
36−
37−/* indicates that a refernce to this file has been taken via get_pmem_file,
38− * the file should not be released until put_pmem_file is called */
39−#define PMEM_FLAGS_BUSY 0x1
40−/* indicates that this is a suballocation of a larger master range */
41−#define PMEM_FLAGS_CONNECTED 0x1 << 1
42−/* indicates this is a master and not a sub allocation and that it is mmaped */
43−#define PMEM_FLAGS_MASTERMAP 0x1 << 2
44−/* submap and unsubmap flags indicate:
45− * 00: subregion has never been mmaped
46− * 10: subregion has been mmaped, reference to the mm was taken
47− * 11: subretion has ben released, refernece to the mm still held
48− * 01: subretion has been released, reference to the mm has been released
49− */
50−#define PMEM_FLAGS_SUBMAP 0x1 << 3
51−#define PMEM_FLAGS_UNSUBMAP 0x1 << 4
52−
53−
54−struct pmem_data {
55− /* in alloc mode: an index into the bitmap
56− * in no_alloc mode: the size of the allocation */
57− int index;
58− /* see flags above for descriptions */
59− unsigned int flags;
60− /* protects this data field, if the mm_mmap sem will be held at the
61− * same time as this sem, the mm sem must be taken first (as this is
62− * the order for vma_open and vma_close ops */
63− struct rw_semaphore sem;
64− /* info about the mmaping process */
65− struct vm_area_struct *vma;
66− /* task struct of the mapping process */
67− struct task_struct *task;
68− /* process id of teh mapping process */
69− pid_t pid;
70− /* file descriptor of the master */
71− int master_fd;
72− /* file struct of the master */
73− struct file *master_file;
74− /* a list of currently available regions if this is a suballocation */
75− struct list_head region_list;
76− /* a linked list of data so we can access them for debugging */
77− struct list_head list;
78−#if PMEM_DEBUG
79− int ref;
80−#endif
81−};
82−
83−struct pmem_bits {
84− unsigned allocated:1; /* 1 if allocated, 0 if free */
85− unsigned order:7; /* size of the region in pmem space */
86−};
87−
88−struct pmem_region_node {
89− struct pmem_region region;
90− struct list_head list;
91−};
92−
93−#define PMEM_DEBUG_MSGS 0
94−#if PMEM_DEBUG_MSGS
95−#define DLOG(fmt,args...) \
96− do { printk(KERN_INFO "[%s:%s:%d] "fmt, __FILE__, __func__, __LINE__, \
97− ##args); } \
98− while (0)
99−#else
100−#define DLOG(x...) do {} while (0)
101−#endif
102−
103−struct pmem_info {
104− struct miscdevice dev;
105− /* physical start address of the remaped pmem space */
106− unsigned long base;
107− /* vitual start address of the remaped pmem space */
108− unsigned char __iomem *vbase;
109− /* total size of the pmem space */
110− unsigned long size;
111− /* number of entries in the pmem space */
112− unsigned long num_entries;
113− /* pfn of the garbage page in memory */
114− unsigned long garbage_pfn;
115− /* index of the garbage page in the pmem space */
116− int garbage_index;
117− /* the bitmap for the region indicating which entries are allocated
118− * and which are free */
119− struct pmem_bits *bitmap;
120− /* indicates the region should not be managed with an allocator */
121− unsigned no_allocator;
122− /* indicates maps of this region should be cached, if a mix of
123− * cached and uncached is desired, set this and open the device with
124− * O_SYNC to get an uncached region */
125− unsigned cached;
126− unsigned buffered;
127− /* in no_allocator mode the first mapper gets the whole space and sets
128− * this flag */
129− unsigned allocated;
130− /* for debugging, creates a list of pmem file structs, the
131− * data_list_lock should be taken before pmem_data->sem if both are
132− * needed */
133− struct mutex data_list_lock;
134− struct list_head data_list;
135− /* pmem_sem protects the bitmap array
136− * a write lock should be held when modifying entries in bitmap
137− * a read lock should be held when reading data from bits or
138− * dereferencing a pointer into bitmap
139− *
140− * pmem_data->sem protects the pmem data of a particular file
141− * Many of the function that require the pmem_data->sem have a non-
142− * locking version for when the caller is already holding that sem.
143− *
144− * IF YOU TAKE BOTH LOCKS TAKE THEM IN THIS ORDER:
145− * down(pmem_data->sem) => down(bitmap_sem)
146− */
147− struct rw_semaphore bitmap_sem;
148−
149− long (*ioctl)(struct file *, unsigned int, unsigned long);
150− int (*release)(struct inode *, struct file *);
151−};
152−
153−static struct pmem_info pmem[PMEM_MAX_DEVICES];
154−static int id_count;
155−
156−#define PMEM_IS_FREE(id, index) !(pmem[id].bitmap[index].allocated)
157−#define PMEM_ORDER(id, index) pmem[id].bitmap[index].order
158−#define PMEM_BUDDY_INDEX(id, index) (index ^ (1 << PMEM_ORDER(id, index)))
159−#define PMEM_NEXT_INDEX(id, index) (index + (1 << PMEM_ORDER(id, index)))
160−#define PMEM_OFFSET(index) (index * PMEM_MIN_ALLOC)
161−#define PMEM_START_ADDR(id, index) (PMEM_OFFSET(index) + pmem[id].base)
162−#define PMEM_LEN(id, index) ((1 << PMEM_ORDER(id, index)) * PMEM_MIN_ALLOC)
163−#define PMEM_END_ADDR(id, index) (PMEM_START_ADDR(id, index) + \
164− PMEM_LEN(id, index))
165−#define PMEM_START_VADDR(id, index) (PMEM_OFFSET(id, index) + pmem[id].vbase)
166−#define PMEM_END_VADDR(id, index) (PMEM_START_VADDR(id, index) + \
167− PMEM_LEN(id, index))
168−#define PMEM_REVOKED(data) (data->flags & PMEM_FLAGS_REVOKED)
169−#define PMEM_IS_PAGE_ALIGNED(addr) (!((addr) & (~PAGE_MASK)))
170−#define PMEM_IS_SUBMAP(data) ((data->flags & PMEM_FLAGS_SUBMAP) && \
171− (!(data->flags & PMEM_FLAGS_UNSUBMAP)))
172−
173−static int pmem_release(struct inode *, struct file *);
174−static int pmem_mmap(struct file *, struct vm_area_struct *);
175−static int pmem_open(struct inode *, struct file *);
176−static long pmem_ioctl(struct file *, unsigned int, unsigned long);
177−
178−struct file_operations pmem_fops = {
179− .release = pmem_release,
180− .mmap = pmem_mmap,
181− .open = pmem_open,
182− .unlocked_ioctl = pmem_ioctl,
183−};
184−
185−static int get_id(struct file *file)
186−{
187− return MINOR(file->f_dentry->d_inode->i_rdev);
188−}
189−
190−int is_pmem_file(struct file *file)
191−{
192− int id;
193−
194− if (unlikely(!file || !file->f_dentry || !file->f_dentry->d_inode))
195− return 0;
196− id = get_id(file);
197− if (unlikely(id >= PMEM_MAX_DEVICES))
198− return 0;
199− if (unlikely(file->f_dentry->d_inode->i_rdev !=
200− MKDEV(MISC_MAJOR, pmem[id].dev.minor)))
201− return 0;
202− return 1;
203−}
204−
205−static int has_allocation(struct file *file)
206−{
207− struct pmem_data *data;
208− /* check is_pmem_file first if not accessed via pmem_file_ops */
209−
210− if (unlikely(!file->private_data))
211− return 0;
212− data = (struct pmem_data *)file->private_data;
213− if (unlikely(data->index < 0))
214− return 0;
215− return 1;
216−}
217−
218−static int is_master_owner(struct file *file)
219−{
220− struct file *master_file;
221− struct pmem_data *data;
222− int put_needed, ret = 0;
223−
224− if (!is_pmem_file(file) || !has_allocation(file))
225− return 0;
226− data = (struct pmem_data *)file->private_data;
227− if (PMEM_FLAGS_MASTERMAP & data->flags)
228− return 1;
229− master_file = fget_light(data->master_fd, &put_needed);
230− if (master_file && data->master_file == master_file)
231− ret = 1;
232− fput_light(master_file, put_needed);
233− return ret;
234−}
235−
236−static int pmem_free(int id, int index)
237−{
238− /* caller should hold the write lock on pmem_sem! */
239− int buddy, curr = index;
240− DLOG("index %d\n", index);
241−
242− if (pmem[id].no_allocator) {
243− pmem[id].allocated = 0;
244− return 0;
245− }
246− /* clean up the bitmap, merging any buddies */
247− pmem[id].bitmap[curr].allocated = 0;
248− /* find a slots buddy Buddy# = Slot# ^ (1 << order)
249− * if the buddy is also free merge them
250− * repeat until the buddy is not free or end of the bitmap is reached
251− */
252− do {
253− buddy = PMEM_BUDDY_INDEX(id, curr);
254− if (PMEM_IS_FREE(id, buddy) &&
255− PMEM_ORDER(id, buddy) == PMEM_ORDER(id, curr)) {
256− PMEM_ORDER(id, buddy)++;
257− PMEM_ORDER(id, curr)++;
258− curr = min(buddy, curr);
259− } else {
260− break;
261− }
262− } while (curr < pmem[id].num_entries);
263−
264− return 0;
265−}
266−
267−static void pmem_revoke(struct file *file, struct pmem_data *data);
268−
269−static int pmem_release(struct inode *inode, struct file *file)
270−{
271− struct pmem_data *data = (struct pmem_data *)file->private_data;
272− struct pmem_region_node *region_node;
273− struct list_head *elt, *elt2;
274− int id = get_id(file), ret = 0;
275−
276−
277− mutex_lock(&pmem[id].data_list_lock);
278− /* if this file is a master, revoke all the memory in the connected
279− * files */
280− if (PMEM_FLAGS_MASTERMAP & data->flags) {
281− struct pmem_data *sub_data;
282− list_for_each(elt, &pmem[id].data_list) {
283− sub_data = list_entry(elt, struct pmem_data, list);
284− down_read(&sub_data->sem);
285− if (PMEM_IS_SUBMAP(sub_data) &&
286− file == sub_data->master_file) {
287− up_read(&sub_data->sem);
288− pmem_revoke(file, sub_data);
289− } else
290− up_read(&sub_data->sem);
291− }
292− }
293− list_del(&data->list);
294− mutex_unlock(&pmem[id].data_list_lock);
295−
296−
297− down_write(&data->sem);
298−
299− /* if its not a conencted file and it has an allocation, free it */
300− if (!(PMEM_FLAGS_CONNECTED & data->flags) && has_allocation(file)) {
301− down_write(&pmem[id].bitmap_sem);
302− ret = pmem_free(id, data->index);
303− up_write(&pmem[id].bitmap_sem);
304− }
305−
306− /* if this file is a submap (mapped, connected file), downref the
307− * task struct */
308− if (PMEM_FLAGS_SUBMAP & data->flags)
309− if (data->task) {
310− put_task_struct(data->task);
311− data->task = NULL;
312− }
313−
314− file->private_data = NULL;
315−
316− list_for_each_safe(elt, elt2, &data->region_list) {
317− region_node = list_entry(elt, struct pmem_region_node, list);
318− list_del(elt);
319− kfree(region_node);
320− }
321− BUG_ON(!list_empty(&data->region_list));
322−
323− up_write(&data->sem);
324− kfree(data);
325− if (pmem[id].release)
326− ret = pmem[id].release(inode, file);
327−
328− return ret;
329−}
330−
331−static int pmem_open(struct inode *inode, struct file *file)
332−{
333− struct pmem_data *data;
334− int id = get_id(file);
335− int ret = 0;
336−
337− DLOG("current %u file %p(%d)\n", current->pid, file, file_count(file));
338− /* setup file->private_data to indicate its unmapped */
339− /* you can only open a pmem device one time */
340− if (file->private_data != NULL)
341− return -1;
342− data = kmalloc(sizeof(struct pmem_data), GFP_KERNEL);
343− if (!data) {
344− printk("pmem: unable to allocate memory for pmem metadata.");
345− return -1;
346− }
347− data->flags = 0;
348− data->index = -1;
349− data->task = NULL;
350− data->vma = NULL;
351− data->pid = 0;
352− data->master_file = NULL;
353−#if PMEM_DEBUG
354− data->ref = 0;
355−#endif
356− INIT_LIST_HEAD(&data->region_list);
357− init_rwsem(&data->sem);
358−
359− file->private_data = data;
360− INIT_LIST_HEAD(&data->list);
361−
362− mutex_lock(&pmem[id].data_list_lock);
363− list_add(&data->list, &pmem[id].data_list);
364− mutex_unlock(&pmem[id].data_list_lock);
365− return ret;
366−}
367−
368−static unsigned long pmem_order(unsigned long len)
369−{
370− int i;
371−
372− len = (len + PMEM_MIN_ALLOC - 1)/PMEM_MIN_ALLOC;
373− len--;
374− for (i = 0; i < sizeof(len)*8; i++)
375− if (len >> i == 0)
376− break;
377− return i;
378−}
379−
380−static int pmem_allocate(int id, unsigned long len)
381−{
382− /* caller should hold the write lock on pmem_sem! */
383− /* return the corresponding pdata[] entry */
384− int curr = 0;
385− int end = pmem[id].num_entries;
386− int best_fit = -1;
387− unsigned long order = pmem_order(len);
388−
389− if (pmem[id].no_allocator) {
390− DLOG("no allocator");
391− if ((len > pmem[id].size) || pmem[id].allocated)
392− return -1;
393− pmem[id].allocated = 1;
394− return len;
395− }
396−
397− if (order > PMEM_MAX_ORDER)
398− return -1;
399− DLOG("order %lx\n", order);
400−
401− /* look through the bitmap:
402− * if you find a free slot of the correct order use it
403− * otherwise, use the best fit (smallest with size > order) slot
404− */
405− while (curr < end) {
406− if (PMEM_IS_FREE(id, curr)) {
407− if (PMEM_ORDER(id, curr) == (unsigned char)order) {
408− /* set the not free bit and clear others */
409− best_fit = curr;
410− break;
411− }
412− if (PMEM_ORDER(id, curr) > (unsigned char)order &&
413− (best_fit < 0 ||
414− PMEM_ORDER(id, curr) < PMEM_ORDER(id, best_fit)))
415− best_fit = curr;
416− }
417− curr = PMEM_NEXT_INDEX(id, curr);
418− }
419−
420− /* if best_fit < 0, there are no suitable slots,
421− * return an error
422− */
423− if (best_fit < 0) {
424− printk("pmem: no space left to allocate!\n");
425− return -1;
426− }
427−
428− /* now partition the best fit:
429− * split the slot into 2 buddies of order - 1
430− * repeat until the slot is of the correct order
431− */
432− while (PMEM_ORDER(id, best_fit) > (unsigned char)order) {
433− int buddy;
434− PMEM_ORDER(id, best_fit) -= 1;
435− buddy = PMEM_BUDDY_INDEX(id, best_fit);
436− PMEM_ORDER(id, buddy) = PMEM_ORDER(id, best_fit);
437− }
438− pmem[id].bitmap[best_fit].allocated = 1;
439− return best_fit;
440−}
441−
442−static pgprot_t pmem_access_prot(struct file *file, pgprot_t vma_prot)
443−{
444− int id = get_id(file);
445−#ifdef pgprot_noncached
446− if (pmem[id].cached == 0 || file->f_flags & O_SYNC)
447− return pgprot_noncached(vma_prot);
448−#endif
449−#ifdef pgprot_ext_buffered
450− else if (pmem[id].buffered)
451− return pgprot_ext_buffered(vma_prot);
452−#endif
453− return vma_prot;
454−}
455−
456−static unsigned long pmem_start_addr(int id, struct pmem_data *data)
457−{
458− if (pmem[id].no_allocator)
459− return PMEM_START_ADDR(id, 0);
460− else
461− return PMEM_START_ADDR(id, data->index);
462−
463−}
464−
465−static void *pmem_start_vaddr(int id, struct pmem_data *data)
466−{
467− return pmem_start_addr(id, data) - pmem[id].base + pmem[id].vbase;
468−}
469−
470−static unsigned long pmem_len(int id, struct pmem_data *data)
471−{
472− if (pmem[id].no_allocator)
473− return data->index;
474− else
475− return PMEM_LEN(id, data->index);
476−}
477−
478−static int pmem_map_garbage(int id, struct vm_area_struct *vma,
479− struct pmem_data *data, unsigned long offset,
480− unsigned long len)
481−{
482− int i, garbage_pages = len >> PAGE_SHIFT;
483−
484− vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP | VM_SHARED | VM_WRITE;
485− for (i = 0; i < garbage_pages; i++) {
486− if (vm_insert_pfn(vma, vma->vm_start + offset + (i * PAGE_SIZE),
487− pmem[id].garbage_pfn))
488− return -EAGAIN;
489− }
490− return 0;
491−}
492−
493−static int pmem_unmap_pfn_range(int id, struct vm_area_struct *vma,
494− struct pmem_data *data, unsigned long offset,
495− unsigned long len)
496−{
497− int garbage_pages;
498− DLOG("unmap offset %lx len %lx\n", offset, len);
499−
500− BUG_ON(!PMEM_IS_PAGE_ALIGNED(len));
501−
502− garbage_pages = len >> PAGE_SHIFT;
503− zap_page_range(vma, vma->vm_start + offset, len, NULL);
504− pmem_map_garbage(id, vma, data, offset, len);
505− return 0;
506−}
507−
508−static int pmem_map_pfn_range(int id, struct vm_area_struct *vma,
509− struct pmem_data *data, unsigned long offset,
510− unsigned long len)
511−{
512− DLOG("map offset %lx len %lx\n", offset, len);
513− BUG_ON(!PMEM_IS_PAGE_ALIGNED(vma->vm_start));
514− BUG_ON(!PMEM_IS_PAGE_ALIGNED(vma->vm_end));
515− BUG_ON(!PMEM_IS_PAGE_ALIGNED(len));
516− BUG_ON(!PMEM_IS_PAGE_ALIGNED(offset));
517−
518− if (io_remap_pfn_range(vma, vma->vm_start + offset,
519− (pmem_start_addr(id, data) + offset) >> PAGE_SHIFT,
520− len, vma->vm_page_prot)) {
521− return -EAGAIN;
522− }
523− return 0;
524−}
525−
526−static int pmem_remap_pfn_range(int id, struct vm_area_struct *vma,
527− struct pmem_data *data, unsigned long offset,
528− unsigned long len)
529−{
530− /* hold the mm semp for the vma you are modifying when you call this */
531− BUG_ON(!vma);
532− zap_page_range(vma, vma->vm_start + offset, len, NULL);
533− return pmem_map_pfn_range(id, vma, data, offset, len);
534−}
535−
536−static void pmem_vma_open(struct vm_area_struct *vma)
537−{
538− struct file *file = vma->vm_file;
539− struct pmem_data *data = file->private_data;
540− int id = get_id(file);
541− /* this should never be called as we don't support copying pmem
542− * ranges via fork */
543− BUG_ON(!has_allocation(file));
544− down_write(&data->sem);
545− /* remap the garbage pages, forkers don't get access to the data */
546− pmem_unmap_pfn_range(id, vma, data, 0, vma->vm_start - vma->vm_end);
547− up_write(&data->sem);
548−}
549−
550−static void pmem_vma_close(struct vm_area_struct *vma)
551−{
552− struct file *file = vma->vm_file;
553− struct pmem_data *data = file->private_data;
554−
555− DLOG("current %u ppid %u file %p count %d\n", current->pid,
556− current->parent->pid, file, file_count(file));
557− if (unlikely(!is_pmem_file(file) || !has_allocation(file))) {
558− printk(KERN_WARNING "pmem: something is very wrong, you are "
559− "closing a vm backing an allocation that doesn't "
560− "exist!\n");
561− return;
562− }
563− down_write(&data->sem);
564− if (data->vma == vma) {
565− data->vma = NULL;
566− if ((data->flags & PMEM_FLAGS_CONNECTED) &&
567− (data->flags & PMEM_FLAGS_SUBMAP))
568− data->flags |= PMEM_FLAGS_UNSUBMAP;
569− }
570− /* the kernel is going to free this vma now anyway */
571− up_write(&data->sem);
572−}
573−
574−static struct vm_operations_struct vm_ops = {
575− .open = pmem_vma_open,
576− .close = pmem_vma_close,
577−};
578−
579−static int pmem_mmap(struct file *file, struct vm_area_struct *vma)
580−{
581− struct pmem_data *data;
582− int index;
583− unsigned long vma_size = vma->vm_end - vma->vm_start;
584− int ret = 0, id = get_id(file);
585−
586− if (vma->vm_pgoff || !PMEM_IS_PAGE_ALIGNED(vma_size)) {
587−#if PMEM_DEBUG
588− printk(KERN_ERR "pmem: mmaps must be at offset zero, aligned"
589− " and a multiple of pages_size.\n");
590−#endif
591− return -EINVAL;
592− }
593−
594− data = (struct pmem_data *)file->private_data;
595− down_write(&data->sem);
596− /* check this file isn't already mmaped, for submaps check this file
597− * has never been mmaped */
598− if ((data->flags & PMEM_FLAGS_SUBMAP) ||
599− (data->flags & PMEM_FLAGS_UNSUBMAP)) {
600−#if PMEM_DEBUG
601− printk(KERN_ERR "pmem: you can only mmap a pmem file once, "
602− "this file is already mmaped. %x\n", data->flags);
603−#endif
604− ret = -EINVAL;
605− goto error;
606− }
607− /* if file->private_data == unalloced, alloc*/
608− if (data && data->index == -1) {
609− down_write(&pmem[id].bitmap_sem);
610− index = pmem_allocate(id, vma->vm_end - vma->vm_start);
611− up_write(&pmem[id].bitmap_sem);
612− data->index = index;
613− }
614− /* either no space was available or an error occured */
615− if (!has_allocation(file)) {
616− ret = -EINVAL;
617− printk("pmem: could not find allocation for map.\n");
618− goto error;
619− }
620−
621− if (pmem_len(id, data) < vma_size) {
622−#if PMEM_DEBUG
623− printk(KERN_WARNING "pmem: mmap size [%lu] does not match"
624− "size of backing region [%lu].\n", vma_size,
625− pmem_len(id, data));
626−#endif
627− ret = -EINVAL;
628− goto error;
629− }
630−
631− vma->vm_pgoff = pmem_start_addr(id, data) >> PAGE_SHIFT;
632− vma->vm_page_prot = pmem_access_prot(file, vma->vm_page_prot);
633−
634− if (data->flags & PMEM_FLAGS_CONNECTED) {
635− struct pmem_region_node *region_node;
636− struct list_head *elt;
637− if (pmem_map_garbage(id, vma, data, 0, vma_size)) {
638− printk("pmem: mmap failed in kernel!\n");
639− ret = -EAGAIN;
640− goto error;
641− }
642− list_for_each(elt, &data->region_list) {
643− region_node = list_entry(elt, struct pmem_region_node,
644− list);
645− DLOG("remapping file: %p %lx %lx\n", file,
646− region_node->region.offset,
647− region_node->region.len);
648− if (pmem_remap_pfn_range(id, vma, data,
649− region_node->region.offset,
650− region_node->region.len)) {
651− ret = -EAGAIN;
652− goto error;
653− }
654− }
655− data->flags |= PMEM_FLAGS_SUBMAP;
656− get_task_struct(current->group_leader);
657− data->task = current->group_leader;
658− data->vma = vma;
659−#if PMEM_DEBUG
660− data->pid = current->pid;
661−#endif
662− DLOG("submmapped file %p vma %p pid %u\n", file, vma,
663− current->pid);
664− } else {
665− if (pmem_map_pfn_range(id, vma, data, 0, vma_size)) {
666− printk(KERN_INFO "pmem: mmap failed in kernel!\n");
667− ret = -EAGAIN;
668− goto error;
669− }
670− data->flags |= PMEM_FLAGS_MASTERMAP;
671− data->pid = current->pid;
672− }
673− vma->vm_ops = &vm_ops;
674−error:
675− up_write(&data->sem);
676− return ret;
677−}
678−
679−/* the following are the api for accessing pmem regions by other drivers
680− * from inside the kernel */
681−int get_pmem_user_addr(struct file *file, unsigned long *start,
682− unsigned long *len)
683−{
684− struct pmem_data *data;
685− if (!is_pmem_file(file) || !has_allocation(file)) {
686−#if PMEM_DEBUG
687− printk(KERN_INFO "pmem: requested pmem data from invalid"
688− "file.\n");
689−#endif
690− return -1;
691− }
692− data = (struct pmem_data *)file->private_data;
693− down_read(&data->sem);
694− if (data->vma) {
695− *start = data->vma->vm_start;
696− *len = data->vma->vm_end - data->vma->vm_start;
697− } else {
698− *start = 0;
699− *len = 0;
700− }
701− up_read(&data->sem);
702− return 0;
703−}
704−
705−int get_pmem_addr(struct file *file, unsigned long *start,
706− unsigned long *vstart, unsigned long *len)
707−{
708− struct pmem_data *data;
709− int id;
710−
711− if (!is_pmem_file(file) || !has_allocation(file)) {
712− return -1;
713− }
714−
715− data = (struct pmem_data *)file->private_data;
716− if (data->index == -1) {
717−#if PMEM_DEBUG
718− printk(KERN_INFO "pmem: requested pmem data from file with no "
719− "allocation.\n");
720− return -1;
721−#endif
722− }
723− id = get_id(file);
724−
725− down_read(&data->sem);
726− *start = pmem_start_addr(id, data);
727− *len = pmem_len(id, data);
728− *vstart = (unsigned long)pmem_start_vaddr(id, data);
729− up_read(&data->sem);
730−#if PMEM_DEBUG
731− down_write(&data->sem);
732− data->ref++;
733− up_write(&data->sem);
734−#endif
735− return 0;
736−}
737−
738−int get_pmem_file(int fd, unsigned long *start, unsigned long *vstart,
739− unsigned long *len, struct file **filp)
740−{
741− struct file *file;
742−
743− file = fget(fd);
744− if (unlikely(file == NULL)) {
745− printk(KERN_INFO "pmem: requested data from file descriptor "
746− "that doesn't exist.");
747− return -1;
748− }
749−
750− if (get_pmem_addr(file, start, vstart, len))
751− goto end;
752−
753− if (filp)
754− *filp = file;
755− return 0;
756−end:
757− fput(file);
758− return -1;
759−}
760−
761−void put_pmem_file(struct file *file)
762−{
763− struct pmem_data *data;
764− int id;
765−
766− if (!is_pmem_file(file))
767− return;
768− id = get_id(file);
769− data = (struct pmem_data *)file->private_data;
770−#if PMEM_DEBUG
771− down_write(&data->sem);
772− if (data->ref == 0) {
773− printk("pmem: pmem_put > pmem_get %s (pid %d)\n",
774− pmem[id].dev.name, data->pid);
775− BUG();
776− }
777− data->ref--;
778− up_write(&data->sem);
779−#endif
780− fput(file);
781−}
782−
783−void flush_pmem_file(struct file *file, unsigned long offset, unsigned long len)
784−{
785− struct pmem_data *data;
786− int id;
787− void *vaddr;
788− struct pmem_region_node *region_node;
789− struct list_head *elt;
790− void *flush_start, *flush_end;
791−
792− if (!is_pmem_file(file) || !has_allocation(file)) {
793− return;
794− }
795−
796− id = get_id(file);
797− data = (struct pmem_data *)file->private_data;
798− if (!pmem[id].cached || file->f_flags & O_SYNC)
799− return;
800−
801− down_read(&data->sem);
802− vaddr = pmem_start_vaddr(id, data);
803− /* if this isn't a submmapped file, flush the whole thing */
804− if (unlikely(!(data->flags & PMEM_FLAGS_CONNECTED))) {
805− dmac_flush_range(vaddr, vaddr + pmem_len(id, data));
806− goto end;
807− }
808− /* otherwise, flush the region of the file we are drawing */
809− list_for_each(elt, &data->region_list) {
810− region_node = list_entry(elt, struct pmem_region_node, list);
811− if ((offset >= region_node->region.offset) &&
812− ((offset + len) <= (region_node->region.offset +
813− region_node->region.len))) {
814− flush_start = vaddr + region_node->region.offset;
815− flush_end = flush_start + region_node->region.len;
816− dmac_flush_range(flush_start, flush_end);
817− break;
818− }
819− }
820−end:
821− up_read(&data->sem);
822−}
823−
824−static int pmem_connect(unsigned long connect, struct file *file)
825−{
826− struct pmem_data *data = (struct pmem_data *)file->private_data;
827− struct pmem_data *src_data;
828− struct file *src_file;
829− int ret = 0, put_needed;
830−
831− down_write(&data->sem);
832− /* retrieve the src file and check it is a pmem file with an alloc */
833− src_file = fget_light(connect, &put_needed);
834− DLOG("connect %p to %p\n", file, src_file);
835− if (!src_file) {
836− printk("pmem: src file not found!\n");
837− ret = -EINVAL;
838− goto err_no_file;
839− }
840− if (unlikely(!is_pmem_file(src_file) || !has_allocation(src_file))) {
841− printk(KERN_INFO "pmem: src file is not a pmem file or has no "
842− "alloc!\n");
843− ret = -EINVAL;
844− goto err_bad_file;
845− }
846− src_data = (struct pmem_data *)src_file->private_data;
847−
848− if (has_allocation(file) && (data->index != src_data->index)) {
849− printk("pmem: file is already mapped but doesn't match this"
850− " src_file!\n");
851− ret = -EINVAL;
852− goto err_bad_file;
853− }
854− data->index = src_data->index;
855− data->flags |= PMEM_FLAGS_CONNECTED;
856− data->master_fd = connect;
857− data->master_file = src_file;
858−
859−err_bad_file:
860− fput_light(src_file, put_needed);
861−err_no_file:
862− up_write(&data->sem);
863− return ret;
864−}
865−
866−static void pmem_unlock_data_and_mm(struct pmem_data *data,
867− struct mm_struct *mm)
868−{
869− up_write(&data->sem);
870− if (mm != NULL) {
871− up_write(&mm->mmap_sem);
872− mmput(mm);
873− }
874−}
875−
876−static int pmem_lock_data_and_mm(struct file *file, struct pmem_data *data,
877− struct mm_struct **locked_mm)
878−{
879− int ret = 0;
880− struct mm_struct *mm = NULL;
881− *locked_mm = NULL;
882−lock_mm:
883− down_read(&data->sem);
884− if (PMEM_IS_SUBMAP(data)) {
885− mm = get_task_mm(data->task);
886− if (!mm) {
887−#if PMEM_DEBUG
888− printk("pmem: can't remap task is gone!\n");
889−#endif
890− up_read(&data->sem);
891− return -1;
892− }
893− }
894− up_read(&data->sem);
895−
896− if (mm)
897− down_write(&mm->mmap_sem);
898−
899− down_write(&data->sem);
900− /* check that the file didn't get mmaped before we could take the
901− * data sem, this should be safe b/c you can only submap each file
902− * once */
903− if (PMEM_IS_SUBMAP(data) && !mm) {
904− pmem_unlock_data_and_mm(data, mm);
905− up_write(&data->sem);
906− goto lock_mm;
907− }
908− /* now check that vma.mm is still there, it could have been
909− * deleted by vma_close before we could get the data->sem */
910− if ((data->flags & PMEM_FLAGS_UNSUBMAP) && (mm != NULL)) {
911− /* might as well release this */
912− if (data->flags & PMEM_FLAGS_SUBMAP) {
913− put_task_struct(data->task);
914− data->task = NULL;
915− /* lower the submap flag to show the mm is gone */
916− data->flags &= ~(PMEM_FLAGS_SUBMAP);
917− }
918− pmem_unlock_data_and_mm(data, mm);
919− return -1;
920− }
921− *locked_mm = mm;
922− return ret;
923−}
924−
925−int pmem_remap(struct pmem_region *region, struct file *file,
926− unsigned operation)
927−{
928− int ret;
929− struct pmem_region_node *region_node;
930− struct mm_struct *mm = NULL;
931− struct list_head *elt, *elt2;
932− int id = get_id(file);
933− struct pmem_data *data = (struct pmem_data *)file->private_data;
934−
935− /* pmem region must be aligned on a page boundry */
936− if (unlikely(!PMEM_IS_PAGE_ALIGNED(region->offset) ||
937− !PMEM_IS_PAGE_ALIGNED(region->len))) {
938−#if PMEM_DEBUG
939− printk("pmem: request for unaligned pmem suballocation "
940− "%lx %lx\n", region->offset, region->len);
941−#endif
942− return -EINVAL;
943− }
944−
945− /* if userspace requests a region of len 0, there's nothing to do */
946− if (region->len == 0)
947− return 0;
948−
949− /* lock the mm and data */
950− ret = pmem_lock_data_and_mm(file, data, &mm);
951− if (ret)
952− return 0;
953−
954− /* only the owner of the master file can remap the client fds
955− * that back in it */
956− if (!is_master_owner(file)) {
957−#if PMEM_DEBUG
958− printk("pmem: remap requested from non-master process\n");
959−#endif
960− ret = -EINVAL;
961− goto err;
962− }
963−
964− /* check that the requested range is within the src allocation */
965− if (unlikely((region->offset > pmem_len(id, data)) ||
966− (region->len > pmem_len(id, data)) ||
967− (region->offset + region->len > pmem_len(id, data)))) {
968−#if PMEM_DEBUG
969− printk(KERN_INFO "pmem: suballoc doesn't fit in src_file!\n");
970−#endif
971− ret = -EINVAL;
972− goto err;
973− }
974−
975− if (operation == PMEM_MAP) {
976− region_node = kmalloc(sizeof(struct pmem_region_node),
977− GFP_KERNEL);
978− if (!region_node) {
979− ret = -ENOMEM;
980−#if PMEM_DEBUG
981− printk(KERN_INFO "No space to allocate metadata!");
982−#endif
983− goto err;
984− }
985− region_node->region = *region;
986− list_add(&region_node->list, &data->region_list);
987− } else if (operation == PMEM_UNMAP) {
988− int found = 0;
989− list_for_each_safe(elt, elt2, &data->region_list) {
990− region_node = list_entry(elt, struct pmem_region_node,
991− list);
992− if (region->len == 0 ||
993− (region_node->region.offset == region->offset &&
994− region_node->region.len == region->len)) {
995− list_del(elt);
996− kfree(region_node);
997− found = 1;
998− }
999− }
1000− if (!found) {
1001−#if PMEM_DEBUG
1002− printk("pmem: Unmap region does not map any mapped "
1003− "region!");
1004−#endif
1005− ret = -EINVAL;
1006− goto err;
1007− }
1008− }
1009−
1010− if (data->vma && PMEM_IS_SUBMAP(data)) {
1011− if (operation == PMEM_MAP)
1012− ret = pmem_remap_pfn_range(id, data->vma, data,
1013− region->offset, region->len);
1014− else if (operation == PMEM_UNMAP)
1015− ret = pmem_unmap_pfn_range(id, data->vma, data,
1016− region->offset, region->len);
1017− }
1018−
1019−err:
1020− pmem_unlock_data_and_mm(data, mm);
1021− return ret;
1022−}
1023−
1024−static void pmem_revoke(struct file *file, struct pmem_data *data)
1025−{
1026− struct pmem_region_node *region_node;
1027− struct list_head *elt, *elt2;
1028− struct mm_struct *mm = NULL;
1029− int id = get_id(file);
1030− int ret = 0;
1031−
1032− data->master_file = NULL;
1033− ret = pmem_lock_data_and_mm(file, data, &mm);
1034− /* if lock_data_and_mm fails either the task that mapped the fd, or
1035− * the vma that mapped it have already gone away, nothing more
1036− * needs to be done */
1037− if (ret)
1038− return;
1039− /* unmap everything */
1040− /* delete the regions and region list nothing is mapped any more */
1041− if (data->vma)
1042− list_for_each_safe(elt, elt2, &data->region_list) {
1043− region_node = list_entry(elt, struct pmem_region_node,
1044− list);
1045− pmem_unmap_pfn_range(id, data->vma, data,
1046− region_node->region.offset,
1047− region_node->region.len);
1048− list_del(elt);
1049− kfree(region_node);
1050− }
1051− /* delete the master file */
1052− pmem_unlock_data_and_mm(data, mm);
1053−}
1054−
1055−static void pmem_get_size(struct pmem_region *region, struct file *file)
1056−{
1057− struct pmem_data *data = (struct pmem_data *)file->private_data;
1058− int id = get_id(file);
1059−
1060− if (!has_allocation(file)) {
1061− region->offset = 0;
1062− region->len = 0;
1063− return;
1064− } else {
1065− region->offset = pmem_start_addr(id, data);
1066− region->len = pmem_len(id, data);
1067− }
1068− DLOG("offset %lx len %lx\n", region->offset, region->len);
1069−}
1070−
1071−
1072−static long pmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1073−{
1074− struct pmem_data *data;
1075− int id = get_id(file);
1076−
1077− switch (cmd) {
1078− case PMEM_GET_PHYS:
1079− {
1080− struct pmem_region region;
1081− DLOG("get_phys\n");
1082− if (!has_allocation(file)) {
1083− region.offset = 0;
1084− region.len = 0;
1085− } else {
1086− data = (struct pmem_data *)file->private_data;
1087− region.offset = pmem_start_addr(id, data);
1088− region.len = pmem_len(id, data);
1089− }
1090− printk(KERN_INFO "pmem: request for physical address of pmem region "
1091− "from process %d.\n", current->pid);
1092− if (copy_to_user((void __user *)arg, &region,
1093− sizeof(struct pmem_region)))
1094− return -EFAULT;
1095− break;
1096− }
1097− case PMEM_MAP:
1098− {
1099− struct pmem_region region;
1100− if (copy_from_user(&region, (void __user *)arg,
1101− sizeof(struct pmem_region)))
1102− return -EFAULT;
1103− data = (struct pmem_data *)file->private_data;
1104− return pmem_remap(&region, file, PMEM_MAP);
1105− }
1106− break;
1107− case PMEM_UNMAP:
1108− {
1109− struct pmem_region region;
1110− if (copy_from_user(&region, (void __user *)arg,
1111− sizeof(struct pmem_region)))
1112− return -EFAULT;
1113− data = (struct pmem_data *)file->private_data;
1114− return pmem_remap(&region, file, PMEM_UNMAP);
1115− break;
1116− }
1117− case PMEM_GET_SIZE:
1118− {
1119− struct pmem_region region;
1120− DLOG("get_size\n");
1121− pmem_get_size(&region, file);
1122− if (copy_to_user((void __user *)arg, &region,
1123− sizeof(struct pmem_region)))
1124− return -EFAULT;
1125− break;
1126− }
1127− case PMEM_GET_TOTAL_SIZE:
1128− {
1129− struct pmem_region region;
1130− DLOG("get total size\n");
1131− region.offset = 0;
1132− get_id(file);
1133− region.len = pmem[id].size;
1134− if (copy_to_user((void __user *)arg, &region,
1135− sizeof(struct pmem_region)))
1136− return -EFAULT;
1137− break;
1138− }
1139− case PMEM_ALLOCATE:
1140− {
1141− if (has_allocation(file))
1142− return -EINVAL;
1143− data = (struct pmem_data *)file->private_data;
1144− data->index = pmem_allocate(id, arg);
1145− break;
1146− }
1147− case PMEM_CONNECT:
1148− DLOG("connect\n");
1149− return pmem_connect(arg, file);
1150− break;
1151− case PMEM_CACHE_FLUSH:
1152− {
1153− struct pmem_region region;
1154− DLOG("flush\n");
1155− if (copy_from_user(&region, (void __user *)arg,
1156− sizeof(struct pmem_region)))
1157− return -EFAULT;
1158− flush_pmem_file(file, region.offset, region.len);
1159− break;
1160− }
1161− default:
1162− if (pmem[id].ioctl)
1163− return pmem[id].ioctl(file, cmd, arg);
1164− return -EINVAL;
1165− }
1166− return 0;
1167−}
1168−
1169−#if PMEM_DEBUG
1170−static ssize_t debug_open(struct inode *inode, struct file *file)
1171−{
1172− file->private_data = inode->i_private;
1173− return 0;
1174−}
1175−
1176−static ssize_t debug_read(struct file *file, char __user *buf, size_t count,
1177− loff_t *ppos)
1178−{
1179− struct list_head *elt, *elt2;
1180− struct pmem_data *data;
1181− struct pmem_region_node *region_node;
1182− int id = (int)file->private_data;
1183− const int debug_bufmax = 4096;
1184− static char buffer[4096];
1185− int n = 0;
1186−
1187− DLOG("debug open\n");
1188− n = scnprintf(buffer, debug_bufmax,
1189− "pid #: mapped regions (offset, len) (offset,len)...\n");
1190−
1191− mutex_lock(&pmem[id].data_list_lock);
1192− list_for_each(elt, &pmem[id].data_list) {
1193− data = list_entry(elt, struct pmem_data, list);
1194− down_read(&data->sem);
1195− n += scnprintf(buffer + n, debug_bufmax - n, "pid %u:",
1196− data->pid);
1197− list_for_each(elt2, &data->region_list) {
1198− region_node = list_entry(elt2, struct pmem_region_node,
1199− list);
1200− n += scnprintf(buffer + n, debug_bufmax - n,
1201− "(%lx,%lx) ",
1202− region_node->region.offset,
1203− region_node->region.len);
1204− }
1205− n += scnprintf(buffer + n, debug_bufmax - n, "\n");
1206− up_read(&data->sem);
1207− }
1208− mutex_unlock(&pmem[id].data_list_lock);
1209−
1210− n++;
1211− buffer[n] = 0;
1212− return simple_read_from_buffer(buf, count, ppos, buffer, n);
1213−}
1214−
1215−static struct file_operations debug_fops = {
1216− .read = debug_read,
1217− .open = debug_open,
1218−};
1219−#endif
1220−
1221−#if 0
1222−static struct miscdevice pmem_dev = {
1223− .name = "pmem",
1224− .fops = &pmem_fops,
1225−};
1226−#endif
1227−
1228−int pmem_setup(struct android_pmem_platform_data *pdata,
1229− long (*ioctl)(struct file *, unsigned int, unsigned long),
1230− int (*release)(struct inode *, struct file *))
1231−{
1232− int err = 0;
1233− int i, index = 0;
1234− int id = id_count;
1235− id_count++;
1236−
1237− pmem[id].no_allocator = pdata->no_allocator;
1238− pmem[id].cached = pdata->cached;
1239− pmem[id].buffered = pdata->buffered;
1240− pmem[id].base = pdata->start;
1241− pmem[id].size = pdata->size;
1242− pmem[id].ioctl = ioctl;
1243− pmem[id].release = release;
1244− init_rwsem(&pmem[id].bitmap_sem);
1245− mutex_init(&pmem[id].data_list_lock);
1246− INIT_LIST_HEAD(&pmem[id].data_list);
1247− pmem[id].dev.name = pdata->name;
1248− pmem[id].dev.minor = id;
1249− pmem[id].dev.fops = &pmem_fops;
1250− printk(KERN_INFO "%s: %d init\n", pdata->name, pdata->cached);
1251−
1252− err = misc_register(&pmem[id].dev);
1253− if (err) {
1254− printk(KERN_ALERT "Unable to register pmem driver!\n");
1255− goto err_cant_register_device;
1256− }
1257− pmem[id].num_entries = pmem[id].size / PMEM_MIN_ALLOC;
1258−
1259− pmem[id].bitmap = kmalloc(pmem[id].num_entries *
1260− sizeof(struct pmem_bits), GFP_KERNEL);
1261− if (!pmem[id].bitmap)
1262− goto err_no_mem_for_metadata;
1263−
1264− memset(pmem[id].bitmap, 0, sizeof(struct pmem_bits) *
1265− pmem[id].num_entries);
1266−
1267− for (i = sizeof(pmem[id].num_entries) * 8 - 1; i >= 0; i--) {
1268− if ((pmem[id].num_entries) & 1<<i) {
1269− PMEM_ORDER(id, index) = i;
1270− index = PMEM_NEXT_INDEX(id, index);
1271− }
1272− }
1273−
1274− if (pmem[id].cached)
1275− pmem[id].vbase = ioremap_cached(pmem[id].base,
1276− pmem[id].size);
1277−#ifdef ioremap_ext_buffered
1278− else if (pmem[id].buffered)
1279− pmem[id].vbase = ioremap_ext_buffered(pmem[id].base,
1280− pmem[id].size);
1281−#endif
1282− else
1283− pmem[id].vbase = ioremap(pmem[id].base, pmem[id].size);
1284−
1285− if (pmem[id].vbase == 0)
1286− goto error_cant_remap;
1287−
1288− pmem[id].garbage_pfn = page_to_pfn(alloc_page(GFP_KERNEL));
1289− if (pmem[id].no_allocator)
1290− pmem[id].allocated = 0;
1291−
1292−#if PMEM_DEBUG
1293− debugfs_create_file(pdata->name, S_IFREG | S_IRUGO, NULL, (void *)id,
1294− &debug_fops);
1295−#endif
1296− return 0;
1297−error_cant_remap:
1298− kfree(pmem[id].bitmap);
1299−err_no_mem_for_metadata:
1300− misc_deregister(&pmem[id].dev);
1301−err_cant_register_device:
1302− return -1;
1303−}
1304−
1305−static int pmem_probe(struct platform_device *pdev)
1306−{
1307− struct android_pmem_platform_data *pdata;
1308−
1309− if (!pdev || !pdev->dev.platform_data) {
1310− printk(KERN_ALERT "Unable to probe pmem!\n");
1311− return -1;
1312− }
1313− pdata = pdev->dev.platform_data;
1314− return pmem_setup(pdata, NULL, NULL);
1315−}
1316−
1317−
1318−static int pmem_remove(struct platform_device *pdev)
1319−{
1320− int id = pdev->id;
1321− __free_page(pfn_to_page(pmem[id].garbage_pfn));
1322− misc_deregister(&pmem[id].dev);
1323− return 0;
1324−}
1325−
1326−static struct platform_driver pmem_driver = {
1327− .probe = pmem_probe,
1328− .remove = pmem_remove,
1329− .driver = { .name = "android_pmem" }
1330−};
1331−
1332−
1333−static int __init pmem_init(void)
1334−{
1335− return platform_driver_register(&pmem_driver);
1336−}
1337−
1338−static void __exit pmem_exit(void)
1339−{
1340− platform_driver_unregister(&pmem_driver);
1341−}
1342−
1343−module_init(pmem_init);
1344−module_exit(pmem_exit);
1345−
drivers/staging/asus_oled/asus_oled.c+9−4
@@ -355,7 +355,14 @@ static void send_data(struct asus_oled_dev *odev) · 354 unmodified lines
355355
356356 static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
357357 {
358− while (count-- > 0 && val) {
358+ odev->last_val = val;
359+
360+ if (val == 0) {
361+ odev->buf_offs += count;
362+ return 0;
363+ }
364+
365+ while (count-- > 0) {
359366 size_t x = odev->buf_offs % odev->width;
360367 size_t y = odev->buf_offs / odev->width;
361368 size_t i;
@@ -406,7 +413,6 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count) · 44 unmodified lines
406413 ;
407414 }
408415
409− odev->last_val = val;
410416 odev->buf_offs++;
411417 }
412418
@@ -805,10 +811,9 @@ error: · 392 unmodified lines
805811
806812 static void __exit asus_oled_exit(void)
807813 {
814+ usb_deregister(&oled_driver);
808815 class_remove_file(oled_class, &class_attr_version.attr);
809816 class_destroy(oled_class);
810−
811− usb_deregister(&oled_driver);
812817 }
813818
814819 module_init(asus_oled_init);
drivers/staging/gma500/Kconfig+0−33
@@ -1,33 +0,0 @@
1−config DRM_PSB
2− tristate "Intel GMA5/600 KMS Framebuffer"
3− depends on DRM && PCI && X86 && BROKEN
4− select FB_CFB_COPYAREA
5− select FB_CFB_FILLRECT
6− select FB_CFB_IMAGEBLIT
7− select DRM_KMS_HELPER
8− select DRM_TTM
9− help
10− Say yes for an experimental 2D KMS framebuffer driver for the
11− Intel GMA500 ('Poulsbo') and other Intel IMG based graphics
12− devices.
13−
14−config DRM_PSB_MRST
15− bool "Intel GMA600 support (Experimental)"
16− depends on DRM_PSB
17− help
18− Say yes to include support for GMA600 (Intel Moorestown/Oaktrail)
19− platforms with LVDS ports. HDMI and MIPI are not currently
20− supported.
21−
22−config DRM_PSB_MFLD
23− bool "Intel Medfield support (Experimental)"
24− depends on DRM_PSB
25− help
26− Say yes to include support for Intel Medfield platforms with MIPI
27− interfaces.
28−
29−config DRM_PSB_CDV
30− bool "Intel Cedarview support (Experimental)"
31− depends on DRM_PSB
32− help
33− Say yes to include support for Intel Cedarview platforms
drivers/staging/gma500/Makefile+0−52
@@ -1,52 +0,0 @@
1−#
2−# KMS driver for the GMA500
3−#
4−ccflags-y += -Iinclude/drm
5−
6−psb_gfx-y += gem_glue.o \
7− accel_2d.o \
8− backlight.o \
9− framebuffer.o \
10− gem.o \
11− gtt.o \
12− intel_bios.o \
13− intel_i2c.o \
14− intel_opregion.o \
15− mmu.o \
16− power.o \
17− psb_drv.o \
18− psb_intel_display.o \
19− psb_intel_lvds.o \
20− psb_intel_modes.o \
21− psb_intel_sdvo.o \
22− psb_lid.o \
23− psb_irq.o \
24− psb_device.o \
25− mid_bios.o
26−
27−psb_gfx-$(CONFIG_DRM_PSB_CDV) += cdv_device.o \
28− cdv_intel_crt.o \
29− cdv_intel_display.o \
30− cdv_intel_hdmi.o \
31− cdv_intel_lvds.o
32−
33−psb_gfx-$(CONFIG_DRM_PSB_MRST) += mrst_device.o \
34− mrst_crtc.o \
35− mrst_lvds.o \
36− mrst_hdmi.o \
37− mrst_hdmi_i2c.o
38−
39−psb_gfx-$(CONFIG_DRM_PSB_MFLD) += mdfld_device.o \
40− mdfld_output.o \
41− mdfld_pyr_cmd.o \
42− mdfld_tmd_vid.o \
43− mdfld_tpo_cmd.o \
44− mdfld_tpo_vid.o \
45− mdfld_dsi_pkg_sender.o \
46− mdfld_dsi_dpi.o \
47− mdfld_dsi_output.o \
48− mdfld_dsi_dbi.o \
49− mdfld_dsi_dbi_dpu.o \
50− mdfld_intel_display.o
51−
52−obj-$(CONFIG_DRM_PSB) += psb_gfx.o
drivers/staging/gma500/TODO+0−15
@@ -1,15 +0,0 @@
1−- Sort out the power management side. Not important for Poulsbo but
2− matters for Moorestown/Medfield
3−- Debug Oaktrail/Moorestown support (single pipe, no BIOS on mrst,
4− some other differences)
5−- Add 2D acceleration via console and DRM
6−- Add scrolling acceleration using the GTT to do remapping on the main
7− framebuffer.
8−- HDMI testing
9−- Oaktrail HDMI and other features
10−- Oaktrail MIPI
11−- Medfield needs a lot of further love
12−
13−As per kernel policy and the in the interest of the safety of various
14−kittens there is no support or plans to add hooks for the closed user space
15−stuff.
drivers/staging/gma500/accel_2d.c+0−414
@@ -1,414 +0,0 @@
1−/**************************************************************************
2− * Copyright (c) 2007-2011, Intel Corporation.
3− * All Rights Reserved.
4− *
5− * This program is free software; you can redistribute it and/or modify it
6− * under the terms and conditions of the GNU General Public License,
7− * version 2, as published by the Free Software Foundation.
8− *
9− * This program is distributed in the hope it will be useful, but WITHOUT
10− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12− * more details.
13− *
14− * You should have received a copy of the GNU General Public License along with
15− * this program; if not, write to the Free Software Foundation, Inc.,
16− * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17− *
18− * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
19− * develop this driver.
20− *
21− **************************************************************************/
22−
23−#include <linux/module.h>
24−#include <linux/kernel.h>
25−#include <linux/errno.h>
26−#include <linux/string.h>
27−#include <linux/mm.h>
28−#include <linux/tty.h>
29−#include <linux/slab.h>
30−#include <linux/delay.h>
31−#include <linux/fb.h>
32−#include <linux/init.h>
33−#include <linux/console.h>
34−
35−#include <drm/drmP.h>
36−#include <drm/drm.h>
37−#include <drm/drm_crtc.h>
38−
39−#include "psb_drv.h"
40−#include "psb_reg.h"
41−#include "framebuffer.h"
42−
43−/**
44− * psb_spank - reset the 2D engine
45− * @dev_priv: our PSB DRM device
46− *
47− * Soft reset the graphics engine and then reload the necessary registers.
48− * We use this at initialisation time but it will become relevant for
49− * accelerated X later
50− */
51−void psb_spank(struct drm_psb_private *dev_priv)
52−{
53− PSB_WSGX32(_PSB_CS_RESET_BIF_RESET | _PSB_CS_RESET_DPM_RESET |
54− _PSB_CS_RESET_TA_RESET | _PSB_CS_RESET_USE_RESET |
55− _PSB_CS_RESET_ISP_RESET | _PSB_CS_RESET_TSP_RESET |
56− _PSB_CS_RESET_TWOD_RESET, PSB_CR_SOFT_RESET);
57− PSB_RSGX32(PSB_CR_SOFT_RESET);
58−
59− msleep(1);
60−
61− PSB_WSGX32(0, PSB_CR_SOFT_RESET);
62− wmb();
63− PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) | _PSB_CB_CTRL_CLEAR_FAULT,
64− PSB_CR_BIF_CTRL);
65− wmb();
66− (void) PSB_RSGX32(PSB_CR_BIF_CTRL);
67−
68− msleep(1);
69− PSB_WSGX32(PSB_RSGX32(PSB_CR_BIF_CTRL) & ~_PSB_CB_CTRL_CLEAR_FAULT,
70− PSB_CR_BIF_CTRL);
71− (void) PSB_RSGX32(PSB_CR_BIF_CTRL);
72− PSB_WSGX32(dev_priv->gtt.gatt_start, PSB_CR_BIF_TWOD_REQ_BASE);
73−}
74−
75−/**
76− * psb2_2d_wait_available - wait for FIFO room
77− * @dev_priv: our DRM device
78− * @size: size (in dwords) of the command we want to issue
79− *
80− * Wait until there is room to load the FIFO with our data. If the
81− * device is not responding then reset it
82− */
83−static int psb_2d_wait_available(struct drm_psb_private *dev_priv,
84− unsigned size)
85−{
86− uint32_t avail = PSB_RSGX32(PSB_CR_2D_SOCIF);
87− unsigned long t = jiffies + HZ;
88−
89− while (avail < size) {
90− avail = PSB_RSGX32(PSB_CR_2D_SOCIF);
91− if (time_after(jiffies, t)) {
92− psb_spank(dev_priv);
93− return -EIO;
94− }
95− }
96− return 0;
97−}
98−
99−/**
100− * psb_2d_submit - submit a 2D command
101− * @dev_priv: our DRM device
102− * @cmdbuf: command to issue
103− * @size: length (in dwords)
104− *
105− * Issue one or more 2D commands to the accelerator. This needs to be
106− * serialized later when we add the GEM interfaces for acceleration
107− */
108−static int psbfb_2d_submit(struct drm_psb_private *dev_priv, uint32_t *cmdbuf,
109− unsigned size)
110−{
111− int ret = 0;
112− int i;
113− unsigned submit_size;
114− unsigned long flags;
115−
116− spin_lock_irqsave(&dev_priv->lock_2d, flags);
117− while (size > 0) {
118− submit_size = (size < 0x60) ? size : 0x60;
119− size -= submit_size;
120− ret = psb_2d_wait_available(dev_priv, submit_size);
121− if (ret)
122− break;
123−
124− submit_size <<= 2;
125−
126− for (i = 0; i < submit_size; i += 4)
127− PSB_WSGX32(*cmdbuf++, PSB_SGX_2D_SLAVE_PORT + i);
128−
129− (void)PSB_RSGX32(PSB_SGX_2D_SLAVE_PORT + i - 4);
130− }
131− spin_unlock_irqrestore(&dev_priv->lock_2d, flags);
132− return ret;
133−}
134−
135−
136−/**
137− * psb_accel_2d_copy_direction - compute blit order
138− * @xdir: X direction of move
139− * @ydir: Y direction of move
140− *
141− * Compute the correct order setings to ensure that an overlapping blit
142− * correctly copies all the pixels.
143− */
144−static u32 psb_accel_2d_copy_direction(int xdir, int ydir)
145−{
146− if (xdir < 0)
147− return (ydir < 0) ? PSB_2D_COPYORDER_BR2TL :
148− PSB_2D_COPYORDER_TR2BL;
149− else
150− return (ydir < 0) ? PSB_2D_COPYORDER_BL2TR :
151− PSB_2D_COPYORDER_TL2BR;
152−}
153−
154−/**
155− * psb_accel_2d_copy - accelerated 2D copy
156− * @dev_priv: our DRM device
157− * @src_offset in bytes
158− * @src_stride in bytes
159− * @src_format psb 2D format defines
160− * @dst_offset in bytes
161− * @dst_stride in bytes
162− * @dst_format psb 2D format defines
163− * @src_x offset in pixels
164− * @src_y offset in pixels
165− * @dst_x offset in pixels
166− * @dst_y offset in pixels
167− * @size_x of the copied area
168− * @size_y of the copied area
169− *
170− * Format and issue a 2D accelerated copy command.
171− */
172−static int psb_accel_2d_copy(struct drm_psb_private *dev_priv,
173− uint32_t src_offset, uint32_t src_stride,
174− uint32_t src_format, uint32_t dst_offset,
175− uint32_t dst_stride, uint32_t dst_format,
176− uint16_t src_x, uint16_t src_y,
177− uint16_t dst_x, uint16_t dst_y,
178− uint16_t size_x, uint16_t size_y)
179−{
180− uint32_t blit_cmd;
181− uint32_t buffer[10];
182− uint32_t *buf;
183− uint32_t direction;
184−
185− buf = buffer;
186−
187− direction =
188− psb_accel_2d_copy_direction(src_x - dst_x, src_y - dst_y);
189−
190− if (direction == PSB_2D_COPYORDER_BR2TL ||
191− direction == PSB_2D_COPYORDER_TR2BL) {
192− src_x += size_x - 1;
193− dst_x += size_x - 1;
194− }
195− if (direction == PSB_2D_COPYORDER_BR2TL ||
196− direction == PSB_2D_COPYORDER_BL2TR) {
197− src_y += size_y - 1;
198− dst_y += size_y - 1;
199− }
200−
201− blit_cmd =
202− PSB_2D_BLIT_BH |
203− PSB_2D_ROT_NONE |
204− PSB_2D_DSTCK_DISABLE |
205− PSB_2D_SRCCK_DISABLE |
206− PSB_2D_USE_PAT | PSB_2D_ROP3_SRCCOPY | direction;
207−
208− *buf++ = PSB_2D_FENCE_BH;
209− *buf++ =
210− PSB_2D_DST_SURF_BH | dst_format | (dst_stride <<
211− PSB_2D_DST_STRIDE_SHIFT);
212− *buf++ = dst_offset;
213− *buf++ =
214− PSB_2D_SRC_SURF_BH | src_format | (src_stride <<
215− PSB_2D_SRC_STRIDE_SHIFT);
216− *buf++ = src_offset;
217− *buf++ =
218− PSB_2D_SRC_OFF_BH | (src_x << PSB_2D_SRCOFF_XSTART_SHIFT) |
219− (src_y << PSB_2D_SRCOFF_YSTART_SHIFT);
220− *buf++ = blit_cmd;
221− *buf++ =
222− (dst_x << PSB_2D_DST_XSTART_SHIFT) | (dst_y <<
223− PSB_2D_DST_YSTART_SHIFT);
224− *buf++ =
225− (size_x << PSB_2D_DST_XSIZE_SHIFT) | (size_y <<
226− PSB_2D_DST_YSIZE_SHIFT);
227− *buf++ = PSB_2D_FLUSH_BH;
228−
229− return psbfb_2d_submit(dev_priv, buffer, buf - buffer);
230−}
231−
232−/**
233− * psbfb_copyarea_accel - copyarea acceleration for /dev/fb
234− * @info: our framebuffer
235− * @a: copyarea parameters from the framebuffer core
236− *
237− * Perform a 2D copy via the accelerator
238− */
239−static void psbfb_copyarea_accel(struct fb_info *info,
240− const struct fb_copyarea *a)
241−{
242− struct psb_fbdev *fbdev = info->par;
243− struct psb_framebuffer *psbfb = &fbdev->pfb;
244− struct drm_device *dev = psbfb->base.dev;
245− struct drm_framebuffer *fb = fbdev->psb_fb_helper.fb;
246− struct drm_psb_private *dev_priv = dev->dev_private;
247− uint32_t offset;
248− uint32_t stride;
249− uint32_t src_format;
250− uint32_t dst_format;
251−
252− if (!fb)
253− return;
254−
255− offset = psbfb->gtt->offset;
256− stride = fb->pitches[0];
257−
258− switch (fb->depth) {
259− case 8:
260− src_format = PSB_2D_SRC_332RGB;
261− dst_format = PSB_2D_DST_332RGB;
262− break;
263− case 15:
264− src_format = PSB_2D_SRC_555RGB;
265− dst_format = PSB_2D_DST_555RGB;
266− break;
267− case 16:
268− src_format = PSB_2D_SRC_565RGB;
269− dst_format = PSB_2D_DST_565RGB;
270− break;
271− case 24:
272− case 32:
273− /* this is wrong but since we don't do blending its okay */
274− src_format = PSB_2D_SRC_8888ARGB;
275− dst_format = PSB_2D_DST_8888ARGB;
276− break;
277− default:
278− /* software fallback */
279− cfb_copyarea(info, a);
280− return;
281− }
282−
283− if (!gma_power_begin(dev, false)) {
284− cfb_copyarea(info, a);
285− return;
286− }
287− psb_accel_2d_copy(dev_priv,
288− offset, stride, src_format,
289− offset, stride, dst_format,
290− a->sx, a->sy, a->dx, a->dy, a->width, a->height);
291− gma_power_end(dev);
292−}
293−
294−/**
295− * psbfb_copyarea - 2D copy interface
296− * @info: our framebuffer
297− * @region: region to copy
298− *
299− * Copy an area of the framebuffer console either by the accelerator
300− * or directly using the cfb helpers according to the request
301− */
302−void psbfb_copyarea(struct fb_info *info,
303− const struct fb_copyarea *region)
304−{
305− if (unlikely(info->state != FBINFO_STATE_RUNNING))
306− return;
307−
308− /* Avoid the 8 pixel erratum */
309− if (region->width == 8 || region->height == 8 ||
310− (info->flags & FBINFO_HWACCEL_DISABLED))
311− return cfb_copyarea(info, region);
312−
313− psbfb_copyarea_accel(info, region);
314−}
315−
316−/**
317− * psbfb_sync - synchronize 2D
318− * @info: our framebuffer
319− *
320− * Wait for the 2D engine to quiesce so that we can do CPU
321− * access to the framebuffer again
322− */
323−int psbfb_sync(struct fb_info *info)
324−{
325− struct psb_fbdev *fbdev = info->par;
326− struct psb_framebuffer *psbfb = &fbdev->pfb;
327− struct drm_device *dev = psbfb->base.dev;
328− struct drm_psb_private *dev_priv = dev->dev_private;
329− unsigned long _end = jiffies + DRM_HZ;
330− int busy = 0;
331− unsigned long flags;
332−
333− spin_lock_irqsave(&dev_priv->lock_2d, flags);
334− /*
335− * First idle the 2D engine.
336− */
337−
338− if ((PSB_RSGX32(PSB_CR_2D_SOCIF) == _PSB_C2_SOCIF_EMPTY) &&
339− ((PSB_RSGX32(PSB_CR_2D_BLIT_STATUS) & _PSB_C2B_STATUS_BUSY) == 0))
340− goto out;
341−
342− do {
343− busy = (PSB_RSGX32(PSB_CR_2D_SOCIF) != _PSB_C2_SOCIF_EMPTY);
344− cpu_relax();
345− } while (busy && !time_after_eq(jiffies, _end));
346−
347− if (busy)
348− busy = (PSB_RSGX32(PSB_CR_2D_SOCIF) != _PSB_C2_SOCIF_EMPTY);
349− if (busy)
350− goto out;
351−
352− do {
353− busy = ((PSB_RSGX32(PSB_CR_2D_BLIT_STATUS) &
354− _PSB_C2B_STATUS_BUSY) != 0);
355− cpu_relax();
356− } while (busy && !time_after_eq(jiffies, _end));
357− if (busy)
358− busy = ((PSB_RSGX32(PSB_CR_2D_BLIT_STATUS) &
359− _PSB_C2B_STATUS_BUSY) != 0);
360−
361−out:
362− spin_unlock_irqrestore(&dev_priv->lock_2d, flags);
363− return (busy) ? -EBUSY : 0;
364−}
365−
366−int psb_accel_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
367−{
368− struct drm_psb_private *dev_priv = dev->dev_private;
369− struct drm_psb_2d_op *op = data;
370− u32 *op_ptr = &op->cmd[0];
371− int i;
372− struct drm_gem_object *obj;
373− struct gtt_range *gtt;
374− int err = -EINVAL;
375−
376− if (!dev_priv->ops->accel_2d)
377− return -EOPNOTSUPP;
378− if (op->size > PSB_2D_OP_BUFLEN)
379− return -EINVAL;
380−
381− /* The GEM object being used. We need to support separate src/dst/etc
382− in the end but for now keep them all the same */
383− obj = drm_gem_object_lookup(dev, file, op->src);
384− if (obj == NULL)
385− return -ENOENT;
386− gtt = container_of(obj, struct gtt_range, gem);
387−
388− if (psb_gtt_pin(gtt) < 0)
389− goto bad_2;
390− for (i = 0; i < op->size; i++, op_ptr++) {
391− u32 r = *op_ptr & 0xF0000000;
392− /* Fill in the GTT offsets for the command buffer */
393− if (r == PSB_2D_SRC_SURF_BH ||
394− r == PSB_2D_DST_SURF_BH ||
395− r == PSB_2D_MASK_SURF_BH ||
396− r == PSB_2D_PAT_SURF_BH) {
397− i++;
398− op_ptr++;
399− if (i == op->size)
400− goto bad;
401− if (*op_ptr)
402− goto bad;
403− *op_ptr = gtt->offset;
404− continue;
405− }
406− }
407− psbfb_2d_submit(dev_priv, op->cmd, op->size);
408− err = 0;
409−bad:
410− psb_gtt_unpin(gtt);
411−bad_2:
412− drm_gem_object_unreference(obj);
413− return err;
414−}
drivers/staging/gma500/backlight.c+0−49
@@ -1,49 +0,0 @@
1−/*
2− * GMA500 Backlight Interface
3− *
4− * Copyright (c) 2009-2011, Intel Corporation.
5− *
6− * This program is free software; you can redistribute it and/or modify it
7− * under the terms and conditions of the GNU General Public License,
8− * version 2, as published by the Free Software Foundation.
9− *
10− * This program is distributed in the hope it will be useful, but WITHOUT
11− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13− * more details.
14− *
15− * You should have received a copy of the GNU General Public License along with
16− * this program; if not, write to the Free Software Foundation, Inc.,
17− * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18− *
19− * Authors: Eric Knopp
20− *
21− */
22−
23−#include "psb_drv.h"
24−#include "psb_intel_reg.h"
25−#include "psb_intel_drv.h"
26−#include "intel_bios.h"
27−#include "power.h"
28−
29−int gma_backlight_init(struct drm_device *dev)
30−{
31−#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
32− struct drm_psb_private *dev_priv = dev->dev_private;
33− return dev_priv->ops->backlight_init(dev);
34−#else
35− return 0;
36−#endif
37−}
38−
39−void gma_backlight_exit(struct drm_device *dev)
40−{
41−#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
42− struct drm_psb_private *dev_priv = dev->dev_private;
43− if (dev_priv->backlight_device) {
44− dev_priv->backlight_device->props.brightness = 0;
45− backlight_update_status(dev_priv->backlight_device);
46− backlight_device_unregister(dev_priv->backlight_device);
47− }
48−#endif
49−}
drivers/staging/gma500/cdv_device.c+0−350
@@ -1,350 +0,0 @@
1−/**************************************************************************
2− * Copyright (c) 2011, Intel Corporation.
3− * All Rights Reserved.
4− *
5− * This program is free software; you can redistribute it and/or modify it
6− * under the terms and conditions of the GNU General Public License,
7− * version 2, as published by the Free Software Foundation.
8− *
9− * This program is distributed in the hope it will be useful, but WITHOUT
10− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12− * more details.
13− *
14− * You should have received a copy of the GNU General Public License along with
15− * this program; if not, write to the Free Software Foundation, Inc.,
16− * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17− *
18− **************************************************************************/
19−
20−#include <linux/backlight.h>
21−#include <drm/drmP.h>
22−#include <drm/drm.h>
23−#include "psb_drm.h"
24−#include "psb_drv.h"
25−#include "psb_reg.h"
26−#include "psb_intel_reg.h"
27−#include "intel_bios.h"
28−#include "cdv_device.h"
29−
30−#define VGA_SR_INDEX 0x3c4
31−#define VGA_SR_DATA 0x3c5
32−
33−static void cdv_disable_vga(struct drm_device *dev)
34−{
35− u8 sr1;
36− u32 vga_reg;
37−
38− vga_reg = VGACNTRL;
39−
40− outb(1, VGA_SR_INDEX);
41− sr1 = inb(VGA_SR_DATA);
42− outb(sr1 | 1<<5, VGA_SR_DATA);
43− udelay(300);
44−
45− REG_WRITE(vga_reg, VGA_DISP_DISABLE);
46− REG_READ(vga_reg);
47−}
48−
49−static int cdv_output_init(struct drm_device *dev)
50−{
51− struct drm_psb_private *dev_priv = dev->dev_private;
52− cdv_disable_vga(dev);
53−
54− cdv_intel_crt_init(dev, &dev_priv->mode_dev);
55− cdv_intel_lvds_init(dev, &dev_priv->mode_dev);
56−
57− /* These bits indicate HDMI not SDVO on CDV, but we don't yet support
58− the HDMI interface */
59− if (REG_READ(SDVOB) & SDVO_DETECTED)
60− cdv_hdmi_init(dev, &dev_priv->mode_dev, SDVOB);
61− if (REG_READ(SDVOC) & SDVO_DETECTED)
62− cdv_hdmi_init(dev, &dev_priv->mode_dev, SDVOC);
63− return 0;
64−}
65−
66−#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
67−
68−/*
69− * Poulsbo Backlight Interfaces
70− */
71−
72−#define BLC_PWM_PRECISION_FACTOR 100 /* 10000000 */
73−#define BLC_PWM_FREQ_CALC_CONSTANT 32
74−#define MHz 1000000
75−
76−#define PSB_BLC_PWM_PRECISION_FACTOR 10
77−#define PSB_BLC_MAX_PWM_REG_FREQ 0xFFFE
78−#define PSB_BLC_MIN_PWM_REG_FREQ 0x2
79−
80−#define PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR (0xFFFE)
81−#define PSB_BACKLIGHT_PWM_CTL_SHIFT (16)
82−
83−static int cdv_brightness;
84−static struct backlight_device *cdv_backlight_device;
85−
86−static int cdv_get_brightness(struct backlight_device *bd)
87−{
88− /* return locally cached var instead of HW read (due to DPST etc.) */
89− /* FIXME: ideally return actual value in case firmware fiddled with
90− it */
91− return cdv_brightness;
92−}
93−
94−
95−static int cdv_backlight_setup(struct drm_device *dev)
96−{
97− struct drm_psb_private *dev_priv = dev->dev_private;
98− unsigned long core_clock;
99− /* u32 bl_max_freq; */
100− /* unsigned long value; */
101− u16 bl_max_freq;
102− uint32_t value;
103− uint32_t blc_pwm_precision_factor;
104−
105− /* get bl_max_freq and pol from dev_priv*/
106− if (!dev_priv->lvds_bl) {
107− dev_err(dev->dev, "Has no valid LVDS backlight info\n");
108− return -ENOENT;
109− }
110− bl_max_freq = dev_priv->lvds_bl->freq;
111− blc_pwm_precision_factor = PSB_BLC_PWM_PRECISION_FACTOR;
112−
113− core_clock = dev_priv->core_freq;
114−
115− value = (core_clock * MHz) / BLC_PWM_FREQ_CALC_CONSTANT;
116− value *= blc_pwm_precision_factor;
117− value /= bl_max_freq;
118− value /= blc_pwm_precision_factor;
119−
120− if (value > (unsigned long long)PSB_BLC_MAX_PWM_REG_FREQ ||
121− value < (unsigned long long)PSB_BLC_MIN_PWM_REG_FREQ)
122− return -ERANGE;
123− else {
124− /* FIXME */
125− }
126− return 0;
127−}
128−
129−static int cdv_set_brightness(struct backlight_device *bd)
130−{
131− int level = bd->props.brightness;
132−
133− /* Percentage 1-100% being valid */
134− if (level < 1)
135− level = 1;
136−
137− /*cdv_intel_lvds_set_brightness(dev, level); FIXME */
138− cdv_brightness = level;
139− return 0;
140−}
141−
142−static const struct backlight_ops cdv_ops = {
143− .get_brightness = cdv_get_brightness,
144− .update_status = cdv_set_brightness,
145−};
146−
147−static int cdv_backlight_init(struct drm_device *dev)
148−{
149− struct drm_psb_private *dev_priv = dev->dev_private;
150− int ret;
151− struct backlight_properties props;
152−
153− memset(&props, 0, sizeof(struct backlight_properties));
154− props.max_brightness = 100;
155− props.type = BACKLIGHT_PLATFORM;
156−
157− cdv_backlight_device = backlight_device_register("psb-bl",
158− NULL, (void *)dev, &cdv_ops, &props);
159− if (IS_ERR(cdv_backlight_device))
160− return PTR_ERR(cdv_backlight_device);
161−
162− ret = cdv_backlight_setup(dev);
163− if (ret < 0) {
164− backlight_device_unregister(cdv_backlight_device);
165− cdv_backlight_device = NULL;
166− return ret;
167− }
168− cdv_backlight_device->props.brightness = 100;
169− cdv_backlight_device->props.max_brightness = 100;
170− backlight_update_status(cdv_backlight_device);
171− dev_priv->backlight_device = cdv_backlight_device;
172− return 0;
173−}
174−
175−#endif
176−
177−/*
178− * Provide the Cedarview specific chip logic and low level methods
179− * for power management
180− *
181− * FIXME: we need to implement the apm/ospm base management bits
182− * for this and the MID devices.
183− */
184−
185−static inline u32 CDV_MSG_READ32(uint port, uint offset)
186−{
187− int mcr = (0x10<<24) | (port << 16) | (offset << 8);
188− uint32_t ret_val = 0;
189− struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
190− pci_write_config_dword(pci_root, 0xD0, mcr);
191− pci_read_config_dword(pci_root, 0xD4, &ret_val);
192− pci_dev_put(pci_root);
193− return ret_val;
194−}
195−
196−static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
197−{
198− int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
199− struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
200− pci_write_config_dword(pci_root, 0xD4, value);
201− pci_write_config_dword(pci_root, 0xD0, mcr);
202− pci_dev_put(pci_root);
203−}
204−
205−#define PSB_APM_CMD 0x0
206−#define PSB_APM_STS 0x04
207−#define PSB_PM_SSC 0x20
208−#define PSB_PM_SSS 0x30
209−#define PSB_PWRGT_GFX_MASK 0x3
210−#define CDV_PWRGT_DISPLAY_CNTR 0x000fc00c
211−#define CDV_PWRGT_DISPLAY_STS 0x000fc00c
212−
213−static void cdv_init_pm(struct drm_device *dev)
214−{
215− struct drm_psb_private *dev_priv = dev->dev_private;
216− u32 pwr_cnt;
217− int i;
218−
219− dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
220− PSB_APMBA) & 0xFFFF;
221− dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
222− PSB_OSPMBA) & 0xFFFF;
223−
224− /* Force power on for now */
225− pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
226− pwr_cnt &= ~PSB_PWRGT_GFX_MASK;
227−
228− outl(pwr_cnt, dev_priv->apm_base + PSB_APM_CMD);
229− for (i = 0; i < 5; i++) {
230− u32 pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
231− if ((pwr_sts & PSB_PWRGT_GFX_MASK) == 0)
232− break;
233− udelay(10);
234− }
235− pwr_cnt = inl(dev_priv->ospm_base + PSB_PM_SSC);
236− pwr_cnt &= ~CDV_PWRGT_DISPLAY_CNTR;
237− outl(pwr_cnt, dev_priv->ospm_base + PSB_PM_SSC);
238− for (i = 0; i < 5; i++) {
239− u32 pwr_sts = inl(dev_priv->ospm_base + PSB_PM_SSS);
240− if ((pwr_sts & CDV_PWRGT_DISPLAY_STS) == 0)
241− break;
242− udelay(10);
243− }
244−}
245−
246−/**
247− * cdv_save_display_registers - save registers lost on suspend
248− * @dev: our DRM device
249− *
250− * Save the state we need in order to be able to restore the interface
251− * upon resume from suspend
252− *
253− * FIXME: review
254− */
255−static int cdv_save_display_registers(struct drm_device *dev)
256−{
257− return 0;
258−}
259−
260−/**
261− * cdv_restore_display_registers - restore lost register state
262− * @dev: our DRM device
263− *
264− * Restore register state that was lost during suspend and resume.
265− *
266− * FIXME: review
267− */
268−static int cdv_restore_display_registers(struct drm_device *dev)
269−{
270− return 0;
271−}
272−
273−static int cdv_power_down(struct drm_device *dev)
274−{
275− return 0;
276−}
277−
278−static int cdv_power_up(struct drm_device *dev)
279−{
280− return 0;
281−}
282−
283−/* FIXME ? - shared with Poulsbo */
284−static void cdv_get_core_freq(struct drm_device *dev)
285−{
286− uint32_t clock;
287− struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
288− struct drm_psb_private *dev_priv = dev->dev_private;
289−
290− pci_write_config_dword(pci_root, 0xD0, 0xD0050300);
291− pci_read_config_dword(pci_root, 0xD4, &clock);
292− pci_dev_put(pci_root);
293−
294− switch (clock & 0x07) {
295− case 0:
296− dev_priv->core_freq = 100;
297− break;
298− case 1:
299− dev_priv->core_freq = 133;
300− break;
301− case 2:
302− dev_priv->core_freq = 150;
303− break;
304− case 3:
305− dev_priv->core_freq = 178;
306− break;
307− case 4:
308− dev_priv->core_freq = 200;
309− break;
310− case 5:
311− case 6:
312− case 7:
313− dev_priv->core_freq = 266;
314− default:
315− dev_priv->core_freq = 0;
316− }
317−}
318−
319−static int cdv_chip_setup(struct drm_device *dev)
320−{
321− cdv_get_core_freq(dev);
322− gma_intel_opregion_init(dev);
323− psb_intel_init_bios(dev);
324− return 0;
325−}
326−
327−/* CDV is much like Poulsbo but has MID like SGX offsets and PM */
328−
329−const struct psb_ops cdv_chip_ops = {
330− .name = "Cedartrail",
331− .accel_2d = 0,
332− .pipes = 2,
333− .sgx_offset = MRST_SGX_OFFSET,
334− .chip_setup = cdv_chip_setup,
335−
336− .crtc_helper = &cdv_intel_helper_funcs,
337− .crtc_funcs = &cdv_intel_crtc_funcs,
338−
339− .output_init = cdv_output_init,
340−
341−#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
342− .backlight_init = cdv_backlight_init,
343−#endif
344−
345− .init_pm = cdv_init_pm,
346− .save_regs = cdv_save_display_registers,
347− .restore_regs = cdv_restore_display_registers,
348− .power_down = cdv_power_down,
349− .power_up = cdv_power_up,
350−};
drivers/staging/gma500/cdv_device.h+0−36
@@ -1,36 +0,0 @@
1−/*
2− * Copyright © 2011 Intel Corporation
3− *
4− * This program is free software; you can redistribute it and/or modify it
5− * under the terms and conditions of the GNU General Public License,
6− * version 2, as published by the Free Software Foundation.
7− *
8− * This program is distributed in the hope it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11− * more details.
12− *
13− * You should have received a copy of the GNU General Public License along with
14− * this program; if not, write to the Free Software Foundation, Inc.,
15− * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16− */
17−
18−extern const struct drm_crtc_helper_funcs cdv_intel_helper_funcs;
19−extern const struct drm_crtc_funcs cdv_intel_crtc_funcs;
20−extern void cdv_intel_crt_init(struct drm_device *dev,
21− struct psb_intel_mode_device *mode_dev);
22−extern void cdv_intel_lvds_init(struct drm_device *dev,
23− struct psb_intel_mode_device *mode_dev);
24−extern void cdv_hdmi_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev,
25− int reg);
26−extern struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev,
27− struct drm_crtc *crtc);
28−
29−extern inline void cdv_intel_wait_for_vblank(struct drm_device *dev)
30−{
31− /* Wait for 20ms, i.e. one cycle at 50hz. */
32− /* FIXME: msleep ?? */
33− mdelay(20);
34−}
35−
36−
drivers/staging/gma500/cdv_intel_crt.c+0−326
@@ -1,326 +0,0 @@
1−/*
2− * Copyright © 2006-2007 Intel Corporation
3− *
4− * Permission is hereby granted, free of charge, to any person obtaining a
5− * copy of this software and associated documentation files (the "Software"),
6− * to deal in the Software without restriction, including without limitation
7− * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8− * and/or sell copies of the Software, and to permit persons to whom the
9− * Software is furnished to do so, subject to the following conditions:
10− *
11− * The above copyright notice and this permission notice (including the next
12− * paragraph) shall be included in all copies or substantial portions of the
13− * Software.
14− *
15− * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16− * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17− * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18− * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19− * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20− * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21− * DEALINGS IN THE SOFTWARE.
22− *
23− * Authors:
24− * Eric Anholt <eric@anholt.net>
25− */
26−
27−#include <linux/i2c.h>
28−#include <drm/drmP.h>
29−
30−#include "intel_bios.h"
31−#include "psb_drv.h"
32−#include "psb_intel_drv.h"
33−#include "psb_intel_reg.h"
34−#include "power.h"
35−#include <linux/pm_runtime.h>
36−
37−
38−static void cdv_intel_crt_dpms(struct drm_encoder *encoder, int mode)
39−{
40− struct drm_device *dev = encoder->dev;
41− u32 temp, reg;
42− reg = ADPA;
43−
44− temp = REG_READ(reg);
45− temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE);
46− temp &= ~ADPA_DAC_ENABLE;
47−
48− switch (mode) {
49− case DRM_MODE_DPMS_ON:
50− temp |= ADPA_DAC_ENABLE;
51− break;
52− case DRM_MODE_DPMS_STANDBY:
53− temp |= ADPA_DAC_ENABLE | ADPA_HSYNC_CNTL_DISABLE;
54− break;
55− case DRM_MODE_DPMS_SUSPEND:
56− temp |= ADPA_DAC_ENABLE | ADPA_VSYNC_CNTL_DISABLE;
57− break;
58− case DRM_MODE_DPMS_OFF:
59− temp |= ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE;
60− break;
61− }
62−
63− REG_WRITE(reg, temp);
64−}
65−
66−static int cdv_intel_crt_mode_valid(struct drm_connector *connector,
67− struct drm_display_mode *mode)
68−{
69− int max_clock = 0;
70− if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
71− return MODE_NO_DBLESCAN;
72−
73− /* The lowest clock for CDV is 20000KHz */
74− if (mode->clock < 20000)
75− return MODE_CLOCK_LOW;
76−
77− /* The max clock for CDV is 355 instead of 400 */
78− max_clock = 355000;
79− if (mode->clock > max_clock)
80− return MODE_CLOCK_HIGH;
81−
82− if (mode->hdisplay > 1680 || mode->vdisplay > 1050)
83− return MODE_PANEL;
84−
85− return MODE_OK;
86−}
87−
88−static bool cdv_intel_crt_mode_fixup(struct drm_encoder *encoder,
89− struct drm_display_mode *mode,
90− struct drm_display_mode *adjusted_mode)
91−{
92− return true;
93−}
94−
95−static void cdv_intel_crt_mode_set(struct drm_encoder *encoder,
96− struct drm_display_mode *mode,
97− struct drm_display_mode *adjusted_mode)
98−{
99−
100− struct drm_device *dev = encoder->dev;
101− struct drm_crtc *crtc = encoder->crtc;
102− struct psb_intel_crtc *psb_intel_crtc =
103− to_psb_intel_crtc(crtc);
104− int dpll_md_reg;
105− u32 adpa, dpll_md;
106− u32 adpa_reg;
107−
108− if (psb_intel_crtc->pipe == 0)
109− dpll_md_reg = DPLL_A_MD;
110− else
111− dpll_md_reg = DPLL_B_MD;
112−
113− adpa_reg = ADPA;
114−
115− /*
116− * Disable separate mode multiplier used when cloning SDVO to CRT
117− * XXX this needs to be adjusted when we really are cloning
118− */
119− {
120− dpll_md = REG_READ(dpll_md_reg);
121− REG_WRITE(dpll_md_reg,
122− dpll_md & ~DPLL_MD_UDI_MULTIPLIER_MASK);
123− }
124−
125− adpa = 0;
126− if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
127− adpa |= ADPA_HSYNC_ACTIVE_HIGH;
128− if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
129− adpa |= ADPA_VSYNC_ACTIVE_HIGH;
130−
131− if (psb_intel_crtc->pipe == 0)
132− adpa |= ADPA_PIPE_A_SELECT;
133− else
134− adpa |= ADPA_PIPE_B_SELECT;
135−
136− REG_WRITE(adpa_reg, adpa);
137−}
138−
139−
140−/**
141− * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence.
142− *
143− * \return true if CRT is connected.
144− * \return false if CRT is disconnected.
145− */
146−static bool cdv_intel_crt_detect_hotplug(struct drm_connector *connector,
147− bool force)
148−{
149− struct drm_device *dev = connector->dev;
150− u32 hotplug_en;
151− int i, tries = 0, ret = false;
152− u32 adpa_orig;
153−
154− /* disable the DAC when doing the hotplug detection */
155−
156− adpa_orig = REG_READ(ADPA);
157−
158− REG_WRITE(ADPA, adpa_orig & ~(ADPA_DAC_ENABLE));
159−
160− /*
161− * On a CDV thep, CRT detect sequence need to be done twice
162− * to get a reliable result.
163− */
164− tries = 2;
165−
166− hotplug_en = REG_READ(PORT_HOTPLUG_EN);
167− hotplug_en &= ~(CRT_HOTPLUG_DETECT_MASK);
168− hotplug_en |= CRT_HOTPLUG_FORCE_DETECT;
169−
170− hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
171− hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
172−
173− for (i = 0; i < tries ; i++) {
174− unsigned long timeout;
175− /* turn on the FORCE_DETECT */
176− REG_WRITE(PORT_HOTPLUG_EN, hotplug_en);
177− timeout = jiffies + msecs_to_jiffies(1000);
178− /* wait for FORCE_DETECT to go off */
179− do {
180− if (!(REG_READ(PORT_HOTPLUG_EN) &
181− CRT_HOTPLUG_FORCE_DETECT))
182− break;
183− msleep(1);
184− } while (time_after(timeout, jiffies));
185− }
186−
187− if ((REG_READ(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) !=
188− CRT_HOTPLUG_MONITOR_NONE)
189− ret = true;
190−
191− /* Restore the saved ADPA */
192− REG_WRITE(ADPA, adpa_orig);
193− return ret;
194−}
195−
196−static enum drm_connector_status cdv_intel_crt_detect(
197− struct drm_connector *connector, bool force)
198−{
199− if (cdv_intel_crt_detect_hotplug(connector, force))
200− return connector_status_connected;
201− else
202− return connector_status_disconnected;
203−}
204−
205−static void cdv_intel_crt_destroy(struct drm_connector *connector)
206−{
207− struct psb_intel_output *intel_output = to_psb_intel_output(connector);
208−
209− psb_intel_i2c_destroy(intel_output->ddc_bus);
210− drm_sysfs_connector_remove(connector);
211− drm_connector_cleanup(connector);
212− kfree(connector);
213−}
214−
215−static int cdv_intel_crt_get_modes(struct drm_connector *connector)
216−{
217− struct psb_intel_output *intel_output =
218− to_psb_intel_output(connector);
219− return psb_intel_ddc_get_modes(intel_output);
220−}
221−
222−static int cdv_intel_crt_set_property(struct drm_connector *connector,
223− struct drm_property *property,
224− uint64_t value)
225−{
226− return 0;
227−}
228−
229−/*
230− * Routines for controlling stuff on the analog port
231− */
232−
233−static const struct drm_encoder_helper_funcs cdv_intel_crt_helper_funcs = {
234− .dpms = cdv_intel_crt_dpms,
235− .mode_fixup = cdv_intel_crt_mode_fixup,
236− .prepare = psb_intel_encoder_prepare,
237− .commit = psb_intel_encoder_commit,
238− .mode_set = cdv_intel_crt_mode_set,
239−};
240−
241−static const struct drm_connector_funcs cdv_intel_crt_connector_funcs = {
242− .dpms = drm_helper_connector_dpms,
243− .detect = cdv_intel_crt_detect,
244− .fill_modes = drm_helper_probe_single_connector_modes,
245− .destroy = cdv_intel_crt_destroy,
246− .set_property = cdv_intel_crt_set_property,
247−};
248−
249−static const struct drm_connector_helper_funcs
250− cdv_intel_crt_connector_helper_funcs = {
251− .mode_valid = cdv_intel_crt_mode_valid,
252− .get_modes = cdv_intel_crt_get_modes,
253− .best_encoder = psb_intel_best_encoder,
254−};
255−
256−static void cdv_intel_crt_enc_destroy(struct drm_encoder *encoder)
257−{
258− drm_encoder_cleanup(encoder);
259−}
260−
261−static const struct drm_encoder_funcs cdv_intel_crt_enc_funcs = {
262− .destroy = cdv_intel_crt_enc_destroy,
263−};
264−
265−void cdv_intel_crt_init(struct drm_device *dev,
266− struct psb_intel_mode_device *mode_dev)
267−{
268−
269− struct psb_intel_output *psb_intel_output;
270− struct drm_connector *connector;
271− struct drm_encoder *encoder;
272−
273− u32 i2c_reg;
274−
275− psb_intel_output = kzalloc(sizeof(struct psb_intel_output), GFP_KERNEL);
276− if (!psb_intel_output)
277− return;
278−
279− psb_intel_output->mode_dev = mode_dev;
280− connector = &psb_intel_output->base;
281− drm_connector_init(dev, connector,
282− &cdv_intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
283−
284− encoder = &psb_intel_output->enc;
285− drm_encoder_init(dev, encoder,
286− &cdv_intel_crt_enc_funcs, DRM_MODE_ENCODER_DAC);
287−
288− drm_mode_connector_attach_encoder(&psb_intel_output->base,
289− &psb_intel_output->enc);
290−
291− /* Set up the DDC bus. */
292− i2c_reg = GPIOA;
293− /* Remove the following code for CDV */
294− /*
295− if (dev_priv->crt_ddc_bus != 0)
296− i2c_reg = dev_priv->crt_ddc_bus;
297− }*/
298− psb_intel_output->ddc_bus = psb_intel_i2c_create(dev,
299− i2c_reg, "CRTDDC_A");
300− if (!psb_intel_output->ddc_bus) {
301− dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
302− "failed.\n");
303− goto failed_ddc;
304− }
305−
306− psb_intel_output->type = INTEL_OUTPUT_ANALOG;
307− /*
308− psb_intel_output->clone_mask = (1 << INTEL_ANALOG_CLONE_BIT);
309− psb_intel_output->crtc_mask = (1 << 0) | (1 << 1);
310− */
311− connector->interlace_allowed = 0;
312− connector->doublescan_allowed = 0;
313−
314− drm_encoder_helper_add(encoder, &cdv_intel_crt_helper_funcs);
315− drm_connector_helper_add(connector,
316− &cdv_intel_crt_connector_helper_funcs);
317−
318− drm_sysfs_connector_add(connector);
319−
320− return;
321−failed_ddc:
322− drm_encoder_cleanup(&psb_intel_output->enc);
323− drm_connector_cleanup(&psb_intel_output->base);
324− kfree(psb_intel_output);
325− return;
326−}
drivers/staging/gma500/cdv_intel_display.c+0−1508
@@ -1,1508 +0,0 @@
1−/*
2− * Copyright © 2006-2011 Intel Corporation
3− *
4− * This program is free software; you can redistribute it and/or modify it
5− * under the terms and conditions of the GNU General Public License,
6− * version 2, as published by the Free Software Foundation.
7− *
8− * This program is distributed in the hope it will be useful, but WITHOUT
9− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11− * more details.
12− *
13− * You should have received a copy of the GNU General Public License along with
14− * this program; if not, write to the Free Software Foundation, Inc.,
15− * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16− *
17− * Authors:
18− * Eric Anholt <eric@anholt.net>
19− */
20−
21−#include <linux/i2c.h>
22−#include <linux/pm_runtime.h>
23−
24−#include <drm/drmP.h>
25−#include "framebuffer.h"
26−#include "psb_drv.h"
27−#include "psb_intel_drv.h"
28−#include "psb_intel_reg.h"
29−#include "psb_intel_display.h"
30−#include "power.h"
31−#include "cdv_device.h"
32−
33−
34−struct cdv_intel_range_t {
35− int min, max;
36−};
37−
38−struct cdv_intel_p2_t {
39− int dot_limit;
40− int p2_slow, p2_fast;
41−};
42−
43−struct cdv_intel_clock_t {
44− /* given values */
45− int n;
46− int m1, m2;
47− int p1, p2;
48− /* derived values */
49− int dot;
50− int vco;
51− int m;
52− int p;
53−};
54−
55−#define INTEL_P2_NUM 2
56−
57−struct cdv_intel_limit_t {
58− struct cdv_intel_range_t dot, vco, n, m, m1, m2, p, p1;
59− struct cdv_intel_p2_t p2;
60−};
61−
62−#define CDV_LIMIT_SINGLE_LVDS_96 0
63−#define CDV_LIMIT_SINGLE_LVDS_100 1
64−#define CDV_LIMIT_DAC_HDMI_27 2
65−#define CDV_LIMIT_DAC_HDMI_96 3
66−
67−static const struct cdv_intel_limit_t cdv_intel_limits[] = {
68− { /* CDV_SIGNLE_LVDS_96MHz */
69− .dot = {.min = 20000, .max = 115500},
70− .vco = {.min = 1800000, .max = 3600000},
71− .n = {.min = 2, .max = 6},
72− .m = {.min = 60, .max = 160},
73− .m1 = {.min = 0, .max = 0},
74− .m2 = {.min = 58, .max = 158},
75− .p = {.min = 28, .max = 140},
76− .p1 = {.min = 2, .max = 10},
77− .p2 = {.dot_limit = 200000,
78− .p2_slow = 14, .p2_fast = 14},
79− },
80− { /* CDV_SINGLE_LVDS_100MHz */
81− .dot = {.min = 20000, .max = 115500},
82− .vco = {.min = 1800000, .max = 3600000},
83− .n = {.min = 2, .max = 6},
84− .m = {.min = 60, .max = 160},
85− .m1 = {.min = 0, .max = 0},
86− .m2 = {.min = 58, .max = 158},
87− .p = {.min = 28, .max = 140},
88− .p1 = {.min = 2, .max = 10},
89− /* The single-channel range is 25-112Mhz, and dual-channel
90− * is 80-224Mhz. Prefer single channel as much as possible.
91− */
92− .p2 = {.dot_limit = 200000, .p2_slow = 14, .p2_fast = 14},
93− },
94− { /* CDV_DAC_HDMI_27MHz */
95− .dot = {.min = 20000, .max = 400000},
96− .vco = {.min = 1809000, .max = 3564000},
97− .n = {.min = 1, .max = 1},
98− .m = {.min = 67, .max = 132},
99− .m1 = {.min = 0, .max = 0},
100− .m2 = {.min = 65, .max = 130},
101− .p = {.min = 5, .max = 90},
102− .p1 = {.min = 1, .max = 9},
103− .p2 = {.dot_limit = 225000, .p2_slow = 10, .p2_fast = 5},
104− },
105− { /* CDV_DAC_HDMI_96MHz */
106− .dot = {.min = 20000, .max = 400000},
107− .vco = {.min = 1800000, .max = 3600000},
108− .n = {.min = 2, .max = 6},
109− .m = {.min = 60, .max = 160},
110− .m1 = {.min = 0, .max = 0},
111− .m2 = {.min = 58, .max = 158},
112− .p = {.min = 5, .max = 100},
113− .p1 = {.min = 1, .max = 10},
114− .p2 = {.dot_limit = 225000, .p2_slow = 10, .p2_fast = 5},
115− },
116−};
117−
118−#define _wait_for(COND, MS, W) ({ \
119− unsigned long timeout__ = jiffies + msecs_to_jiffies(MS); \
120− int ret__ = 0; \
121− while (!(COND)) { \
122− if (time_after(jiffies, timeout__)) { \
123− ret__ = -ETIMEDOUT; \
124− break; \
125− } \
126− if (W && !in_dbg_master()) \
127− msleep(W); \
128− } \
129− ret__; \
130−})
131−
132−#define wait_for(COND, MS) _wait_for(COND, MS, 1)
133−
134−
135−static int cdv_sb_read(struct drm_device *dev, u32 reg, u32 *val)
136−{
137− int ret;
138−
139− ret = wait_for((REG_READ(SB_PCKT) & SB_BUSY) == 0, 1000);
140− if (ret) {
141− DRM_ERROR("timeout waiting for SB to idle before read\n");
142− return ret;
143− }
144−
145− REG_WRITE(SB_ADDR, reg);
146− REG_WRITE(SB_PCKT,
147− SET_FIELD(SB_OPCODE_READ, SB_OPCODE) |
148− SET_FIELD(SB_DEST_DPLL, SB_DEST) |
149− SET_FIELD(0xf, SB_BYTE_ENABLE));
150−
151− ret = wait_for((REG_READ(SB_PCKT) & SB_BUSY) == 0, 1000);
152− if (ret) {
153− DRM_ERROR("timeout waiting for SB to idle after read\n");
154− return ret;
155− }
156−
157− *val = REG_READ(SB_DATA);
158−
159− return 0;
160−}
161−
162−static int cdv_sb_write(struct drm_device *dev, u32 reg, u32 val)
163−{
164− int ret;
165− static bool dpio_debug = true;
166− u32 temp;
167−
168− if (dpio_debug) {
169− if (cdv_sb_read(dev, reg, &temp) == 0)
170− DRM_DEBUG_KMS("0x%08x: 0x%08x (before)\n", reg, temp);
171− DRM_DEBUG_KMS("0x%08x: 0x%08x\n", reg, val);
172− }
173−
174− ret = wait_for((REG_READ(SB_PCKT) & SB_BUSY) == 0, 1000);
175− if (ret) {
176− DRM_ERROR("timeout waiting for SB to idle before write\n");
177− return ret;
178− }
179−
180− REG_WRITE(SB_ADDR, reg);
181− REG_WRITE(SB_DATA, val);
182− REG_WRITE(SB_PCKT,
183− SET_FIELD(SB_OPCODE_WRITE, SB_OPCODE) |
184− SET_FIELD(SB_DEST_DPLL, SB_DEST) |
185− SET_FIELD(0xf, SB_BYTE_ENABLE));
186−
187− ret = wait_for((REG_READ(SB_PCKT) & SB_BUSY) == 0, 1000);
188− if (ret) {
189− DRM_ERROR("timeout waiting for SB to idle after write\n");
190− return ret;
191− }
192−
193− if (dpio_debug) {
194− if (cdv_sb_read(dev, reg, &temp) == 0)
195− DRM_DEBUG_KMS("0x%08x: 0x%08x (after)\n", reg, temp);
196− }
197−
198− return 0;
199−}
200−
201−/* Reset the DPIO configuration register. The BIOS does this at every
202− * mode set.
203− */
204−static void cdv_sb_reset(struct drm_device *dev)
205−{
206−
207− REG_WRITE(DPIO_CFG, 0);
208− REG_READ(DPIO_CFG);
209− REG_WRITE(DPIO_CFG, DPIO_MODE_SELECT_0 | DPIO_CMN_RESET_N);
210−}
211−
212−/* Unlike most Intel display engines, on Cedarview the DPLL registers
213− * are behind this sideband bus. They must be programmed while the
214− * DPLL reference clock is on in the DPLL control register, but before
215− * the DPLL is enabled in the DPLL control register.
216− */
217−static int
218−cdv_dpll_set_clock_cdv(struct drm_device *dev, struct drm_crtc *crtc,
219− struct cdv_intel_clock_t *clock)
220−{
221− struct psb_intel_crtc *psb_crtc =
222− to_psb_intel_crtc(crtc);
223− int pipe = psb_crtc->pipe;
224− u32 m, n_vco, p;
225− int ret = 0;
226− int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
227− u32 ref_value;
228−
229− cdv_sb_reset(dev);
230−
231− if ((REG_READ(dpll_reg) & DPLL_SYNCLOCK_ENABLE) == 0) {
232− DRM_ERROR("Attempting to set DPLL with refclk disabled\n");
233− return -EBUSY;
234− }
235−
236− /* Follow the BIOS and write the REF/SFR Register. Hardcoded value */
237− ref_value = 0x68A701;
238−
239− cdv_sb_write(dev, SB_REF_SFR(pipe), ref_value);
240−
241− /* We don't know what the other fields of these regs are, so
242− * leave them in place.
243− */
244− ret = cdv_sb_read(dev, SB_M(pipe), &m);
245− if (ret)
246− return ret;
247− m &= ~SB_M_DIVIDER_MASK;
248− m |= ((clock->m2) << SB_M_DIVIDER_SHIFT);
249− ret = cdv_sb_write(dev, SB_M(pipe), m);
250− if (ret)
251− return ret;
252−
253− ret = cdv_sb_read(dev, SB_N_VCO(pipe), &n_vco);
254− if (ret)
255− return ret;
256−
257− /* Follow the BIOS to program the N_DIVIDER REG */
258− n_vco &= 0xFFFF;
259− n_vco |= 0x107;
260− n_vco &= ~(SB_N_VCO_SEL_MASK |
261− SB_N_DIVIDER_MASK |
262− SB_N_CB_TUNE_MASK);
263−
264− n_vco |= ((clock->n) << SB_N_DIVIDER_SHIFT);
265−
266− if (clock->vco < 2250000) {
267− n_vco |= (2 << SB_N_CB_TUNE_SHIFT);
268− n_vco |= (0 << SB_N_VCO_SEL_SHIFT);
269− } else if (clock->vco < 2750000) {
270− n_vco |= (1 << SB_N_CB_TUNE_SHIFT);
271− n_vco |= (1 << SB_N_VCO_SEL_SHIFT);
272− } else if (clock->vco < 3300000) {
273− n_vco |= (0 << SB_N_CB_TUNE_SHIFT);
274− n_vco |= (2 << SB_N_VCO_SEL_SHIFT);
275− } else {
276− n_vco |= (0 << SB_N_CB_TUNE_SHIFT);
277− n_vco |= (3 << SB_N_VCO_SEL_SHIFT);
278− }
279−
280− ret = cdv_sb_write(dev, SB_N_VCO(pipe), n_vco);
281− if (ret)
282− return ret;
283−
284− ret = cdv_sb_read(dev, SB_P(pipe), &p);
285− if (ret)
286− return ret;
287− p &= ~(SB_P2_DIVIDER_MASK | SB_P1_DIVIDER_MASK);
288− p |= SET_FIELD(clock->p1, SB_P1_DIVIDER);
289− switch (clock->p2) {
290− case 5:
291− p |= SET_FIELD(SB_P2_5, SB_P2_DIVIDER);
292− break;
293− case 10:
294− p |= SET_FIELD(SB_P2_10, SB_P2_DIVIDER);
295− break;
296− case 14:
297− p |= SET_FIELD(SB_P2_14, SB_P2_DIVIDER);
298− break;
299− case 7:
300− p |= SET_FIELD(SB_P2_7, SB_P2_DIVIDER);
301− break;
302− default:
303− DRM_ERROR("Bad P2 clock: %d\n", clock->p2);
304− return -EINVAL;
305− }
306− ret = cdv_sb_write(dev, SB_P(pipe), p);
307− if (ret)
308− return ret;
309−
310− /* always Program the Lane Register for the Pipe A*/
311− if (pipe == 0) {
312− /* Program the Lane0/1 for HDMI B */
313− u32 lane_reg, lane_value;
314−
315− lane_reg = PSB_LANE0;
316− cdv_sb_read(dev, lane_reg, &lane_value);
317− lane_value &= ~(LANE_PLL_MASK);
318− lane_value |= LANE_PLL_ENABLE;
319− cdv_sb_write(dev, lane_reg, lane_value);
320−
321− lane_reg = PSB_LANE1;
322− cdv_sb_read(dev, lane_reg, &lane_value);
323− lane_value &= ~(LANE_PLL_MASK);
324− lane_value |= LANE_PLL_ENABLE;
325− cdv_sb_write(dev, lane_reg, lane_value);
326−
327− /* Program the Lane2/3 for HDMI C */
328− lane_reg = PSB_LANE2;
329− cdv_sb_read(dev, lane_reg, &lane_value);
330− lane_value &= ~(LANE_PLL_MASK);
331− lane_value |= LANE_PLL_ENABLE;
332− cdv_sb_write(dev, lane_reg, lane_value);
333−
334− lane_reg = PSB_LANE3;
335− cdv_sb_read(dev, lane_reg, &lane_value);
336− lane_value &= ~(LANE_PLL_MASK);
337− lane_value |= LANE_PLL_ENABLE;
338− cdv_sb_write(dev, lane_reg, lane_value);
339− }
340−
341− return 0;
342−}
343−
344−/*
345− * Returns whether any output on the specified pipe is of the specified type
346− */
347−bool cdv_intel_pipe_has_type(struct drm_crtc *crtc, int type)
348−{
349− struct drm_device *dev = crtc->dev;
350− struct drm_mode_config *mode_config = &dev->mode_config;
351− struct drm_connector *l_entry;
352−
353− list_for_each_entry(l_entry, &mode_config->connector_list, head) {
354− if (l_entry->encoder && l_entry->encoder->crtc == crtc) {
355− struct psb_intel_output *psb_intel_output =
356− to_psb_intel_output(l_entry);
357− if (psb_intel_output->type == type)
358− return true;
359− }
360− }
361− return false;
362−}
363−
364−static const struct cdv_intel_limit_t *cdv_intel_limit(struct drm_crtc *crtc,
365− int refclk)
366−{
367− const struct cdv_intel_limit_t *limit;
368− if (cdv_intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
369− /*
370− * Now only single-channel LVDS is supported on CDV. If it is
371− * incorrect, please add the dual-channel LVDS.
372− */
373− if (refclk == 96000)
374− limit = &cdv_intel_limits[CDV_LIMIT_SINGLE_LVDS_96];
375− else
376− limit = &cdv_intel_limits[CDV_LIMIT_SINGLE_LVDS_100];
377− } else {
378− if (refclk == 27000)
379− limit = &cdv_intel_limits[CDV_LIMIT_DAC_HDMI_27];
380− else
381− limit = &cdv_intel_limits[CDV_LIMIT_DAC_HDMI_96];
382− }
383− return limit;
384−}
385−
386−/* m1 is reserved as 0 in CDV, n is a ring counter */
387−static void cdv_intel_clock(struct drm_device *dev,
388− int refclk, struct cdv_intel_clock_t *clock)
389−{
390− clock->m = clock->m2 + 2;
391− clock->p = clock->p1 * clock->p2;
392− clock->vco = (refclk * clock->m) / clock->n;
393− clock->dot = clock->vco / clock->p;
394−}
395−
396−
397−#define INTELPllInvalid(s) { /* ErrorF (s) */; return false; }
398−static bool cdv_intel_PLL_is_valid(struct drm_crtc *crtc,
399− const struct cdv_intel_limit_t *limit,
400− struct cdv_intel_clock_t *clock)
401−{
402− if (clock->p1 < limit->p1.min || limit->p1.max < clock->p1)
403− INTELPllInvalid("p1 out of range\n");
404− if (clock->p < limit->p.min || limit->p.max < clock->p)
405− INTELPllInvalid("p out of range\n");
406− /* unnecessary to check the range of m(m1/M2)/n again */
407− if (clock->vco < limit->vco.min || limit->vco.max < clock->vco)
408− INTELPllInvalid("vco out of range\n");
409− /* XXX: We may need to be checking "Dot clock"
410− * depending on the multiplier, connector, etc.,
411− * rather than just a single range.
412− */
413− if (clock->dot < limit->dot.min || limit->dot.max < clock->dot)
414− INTELPllInvalid("dot out of range\n");
415−
416− return true;
417−}
418−
419−static bool cdv_intel_find_best_PLL(struct drm_crtc *crtc, int target,
420− int refclk,
421− struct cdv_intel_clock_t *best_clock)
422−{
423− struct drm_device *dev = crtc->dev;
424− struct cdv_intel_clock_t clock;
425− const struct cdv_intel_limit_t *limit = cdv_intel_limit(crtc, refclk);
426− int err = target;
427−
428−
429− if (cdv_intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) &&
430− (REG_READ(LVDS) & LVDS_PORT_EN) != 0) {
431− /*
432− * For LVDS, if the panel is on, just rely on its current
433− * settings for dual-channel. We haven't figured out how to
434− * reliably set up different single/dual channel state, if we
435− * even can.
436− */
437− if ((REG_READ(LVDS) & LVDS_CLKB_POWER_MASK) ==
438− LVDS_CLKB_POWER_UP)
439− clock.p2 = limit->p2.p2_fast;
440− else
441− clock.p2 = limit->p2.p2_slow;
442− } else {
443− if (target < limit->p2.dot_limit)
444− clock.p2 = limit->p2.p2_slow;
445− else
446− clock.p2 = limit->p2.p2_fast;
447− }
448−
449− memset(best_clock, 0, sizeof(*best_clock));
450− clock.m1 = 0;
451− /* m1 is reserved as 0 in CDV, n is a ring counter.
452− So skip the m1 loop */
453− for (clock.n = limit->n.min; clock.n <= limit->n.max; clock.n++) {
454− for (clock.m2 = limit->m2.min; clock.m2 <= limit->m2.max;
455− clock.m2++) {
456− for (clock.p1 = limit->p1.min;
457− clock.p1 <= limit->p1.max;
458− clock.p1++) {
459− int this_err;
460−
461− cdv_intel_clock(dev, refclk, &clock);
462−
463− if (!cdv_intel_PLL_is_valid(crtc,
464− limit, &clock))
465− continue;
466−
467− this_err = abs(clock.dot - target);
468− if (this_err < err) {
469− *best_clock = clock;
470− err = this_err;
471− }
472− }
473− }
474− }
475−
476− return err != target;
477−}
478−
479−int cdv_intel_pipe_set_base(struct drm_crtc *crtc,
480− int x, int y, struct drm_framebuffer *old_fb)
481−{
482− struct drm_device *dev = crtc->dev;
483− struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
484− struct psb_framebuffer *psbfb = to_psb_fb(crtc->fb);
485− int pipe = psb_intel_crtc->pipe;
486− unsigned long start, offset;
487− int dspbase = (pipe == 0 ? DSPABASE : DSPBBASE);
488− int dspsurf = (pipe == 0 ? DSPASURF : DSPBSURF);
489− int dspstride = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE;
490− int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR;
491− u32 dspcntr;
492− int ret = 0;
493−
494− if (!gma_power_begin(dev, true))
495− return 0;
496−
497− /* no fb bound */
498− if (!crtc->fb) {
499− dev_err(dev->dev, "No FB bound\n");
500− goto psb_intel_pipe_cleaner;
501− }
502−
503−
504− /* We are displaying this buffer, make sure it is actually loaded
505− into the GTT */
506− ret = psb_gtt_pin(psbfb->gtt);
507− if (ret < 0)
508− goto psb_intel_pipe_set_base_exit;
509− start = psbfb->gtt->offset;
510− offset = y * crtc->fb->pitches[0] + x * (crtc->fb->bits_per_pixel / 8);
511−
512− REG_WRITE(dspstride, crtc->fb->pitches[0]);
513−
514− dspcntr = REG_READ(dspcntr_reg);
515− dspcntr &= ~DISPPLANE_PIXFORMAT_MASK;
516−
517− switch (crtc->fb->bits_per_pixel) {
518− case 8:
519− dspcntr |= DISPPLANE_8BPP;
520− break;
521− case 16:
522− if (crtc->fb->depth == 15)
523− dspcntr |= DISPPLANE_15_16BPP;
524− else
525− dspcntr |= DISPPLANE_16BPP;
526− break;
527− case 24:
528− case 32:
529− dspcntr |= DISPPLANE_32BPP_NO_ALPHA;
530− break;
531− default:
532− dev_err(dev->dev, "Unknown color depth\n");
533− ret = -EINVAL;
534− goto psb_intel_pipe_set_base_exit;
535− }
536− REG_WRITE(dspcntr_reg, dspcntr);
537−
538− dev_dbg(dev->dev,
539− "Writing base %08lX %08lX %d %d\n", start, offset, x, y);
540−
541− REG_WRITE(dspbase, offset);
542− REG_READ(dspbase);
543− REG_WRITE(dspsurf, start);
544− REG_READ(dspsurf);
545−
546−psb_intel_pipe_cleaner:
547− /* If there was a previous display we can now unpin it */
548− if (old_fb)
549− psb_gtt_unpin(to_psb_fb(old_fb)->gtt);
550−
551−psb_intel_pipe_set_base_exit:
552− gma_power_end(dev);
553− return ret;
554−}
555−
556−/**
557− * Sets the power management mode of the pipe and plane.
558− *
559− * This code should probably grow support for turning the cursor off and back
560− * on appropriately at the same time as we're turning the pipe off/on.
561− */
562−static void cdv_intel_crtc_dpms(struct drm_crtc *crtc, int mode)
563−{
564− struct drm_device *dev = crtc->dev;
565− struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
566− int pipe = psb_intel_crtc->pipe;
567− int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
568− int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR;
569− int dspbase_reg = (pipe == 0) ? DSPABASE : DSPBBASE;
570− int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
571− u32 temp;
572− bool enabled;
573−
574− /* XXX: When our outputs are all unaware of DPMS modes other than off
575− * and on, we should map those modes to DRM_MODE_DPMS_OFF in the CRTC.
576− */
577− switch (mode) {
578− case DRM_MODE_DPMS_ON:
579− case DRM_MODE_DPMS_STANDBY:
580− case DRM_MODE_DPMS_SUSPEND:
581− /* Enable the DPLL */
582− temp = REG_READ(dpll_reg);
583− if ((temp & DPLL_VCO_ENABLE) == 0) {
584− REG_WRITE(dpll_reg, temp);
585− REG_READ(dpll_reg);
586− /* Wait for the clocks to stabilize. */
587− udelay(150);
588− REG_WRITE(dpll_reg, temp | DPLL_VCO_ENABLE);
589− REG_READ(dpll_reg);
590− /* Wait for the clocks to stabilize. */
591− udelay(150);
592− REG_WRITE(dpll_reg, temp | DPLL_VCO_ENABLE);
593− REG_READ(dpll_reg);
594− /* Wait for the clocks to stabilize. */
595− udelay(150);
596− }
597−
598− /* Jim Bish - switch plan and pipe per scott */
599− /* Enable the plane */
600− temp = REG_READ(dspcntr_reg);
601− if ((temp & DISPLAY_PLANE_ENABLE) == 0) {
602− REG_WRITE(dspcntr_reg,
603− temp | DISPLAY_PLANE_ENABLE);
604− /* Flush the plane changes */
605− REG_WRITE(dspbase_reg, REG_READ(dspbase_reg));
606− }
607−
608− udelay(150);
609−
610− /* Enable the pipe */
611− temp = REG_READ(pipeconf_reg);
612− if ((temp & PIPEACONF_ENABLE) == 0)
613− REG_WRITE(pipeconf_reg, temp | PIPEACONF_ENABLE);
614−
615− psb_intel_crtc_load_lut(crtc);
616−
617− /* Give the overlay scaler a chance to enable
618− * if it's on this pipe */
619− /* psb_intel_crtc_dpms_video(crtc, true); TODO */
620− break;
621− case DRM_MODE_DPMS_OFF:
622− /* Give the overlay scaler a chance to disable
623− * if it's on this pipe */
624− /* psb_intel_crtc_dpms_video(crtc, FALSE); TODO */
625−
626− /* Disable the VGA plane that we never use */
627− REG_WRITE(VGACNTRL, VGA_DISP_DISABLE);
628−
629− /* Jim Bish - changed pipe/plane here as well. */
630−
631− /* Wait for vblank for the disable to take effect */
632− cdv_intel_wait_for_vblank(dev);
633−
634− /* Next, disable display pipes */
635− temp = REG_READ(pipeconf_reg);
636− if ((temp & PIPEACONF_ENABLE) != 0) {
637− REG_WRITE(pipeconf_reg, temp & ~PIPEACONF_ENABLE);
638− REG_READ(pipeconf_reg);
639− }
640−
641− /* Wait for vblank for the disable to take effect. */
642− cdv_intel_wait_for_vblank(dev);
643−
644− udelay(150);
645−
646− /* Disable display plane */
647− temp = REG_READ(dspcntr_reg);
648− if ((temp & DISPLAY_PLANE_ENABLE) != 0) {
649− REG_WRITE(dspcntr_reg,
650− temp & ~DISPLAY_PLANE_ENABLE);
651− /* Flush the plane changes */
652− REG_WRITE(dspbase_reg, REG_READ(dspbase_reg));
653− REG_READ(dspbase_reg);
654− }
655−
656− temp = REG_READ(dpll_reg);
657− if ((temp & DPLL_VCO_ENABLE) != 0) {
658− REG_WRITE(dpll_reg, temp & ~DPLL_VCO_ENABLE);
659− REG_READ(dpll_reg);
660− }
661−
662− /* Wait for the clocks to turn off. */
663− udelay(150);
664− break;
665− }
666− enabled = crtc->enabled && mode != DRM_MODE_DPMS_OFF;
667− /*Set FIFO Watermarks*/
668− REG_WRITE(DSPARB, 0x3F3E);
669−}
670−
671−static void cdv_intel_crtc_prepare(struct drm_crtc *crtc)
672−{
673− struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
674− crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
675−}
676−
677−static void cdv_intel_crtc_commit(struct drm_crtc *crtc)
678−{
679− struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
680− crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON);
681−}
682−
683−void cdv_intel_encoder_prepare(struct drm_encoder *encoder)
684−{
685− struct drm_encoder_helper_funcs *encoder_funcs =
686− encoder->helper_private;
687− /* lvds has its own version of prepare see cdv_intel_lvds_prepare */
688− encoder_funcs->dpms(encoder, DRM_MODE_DPMS_OFF);
689−}
690−
691−void cdv_intel_encoder_commit(struct drm_encoder *encoder)
692−{
693− struct drm_encoder_helper_funcs *encoder_funcs =
694− encoder->helper_private;
695− /* lvds has its own version of commit see cdv_intel_lvds_commit */
696− encoder_funcs->dpms(encoder, DRM_MODE_DPMS_ON);
697−}
698−
699−static bool cdv_intel_crtc_mode_fixup(struct drm_crtc *crtc,
700− struct drm_display_mode *mode,
701− struct drm_display_mode *adjusted_mode)
702−{
703− return true;
704−}
705−
706−
707−/**
708− * Return the pipe currently connected to the panel fitter,
709− * or -1 if the panel fitter is not present or not in use
710− */
711−static int cdv_intel_panel_fitter_pipe(struct drm_device *dev)
712−{
713− u32 pfit_control;
714−
715− pfit_control = REG_READ(PFIT_CONTROL);
716−
717− /* See if the panel fitter is in use */
718− if ((pfit_control & PFIT_ENABLE) == 0)
719− return -1;
720− return (pfit_control >> 29) & 0x3;
721−}
722−
723−static int cdv_intel_crtc_mode_set(struct drm_crtc *crtc,
724− struct drm_display_mode *mode,
725− struct drm_display_mode *adjusted_mode,
726− int x, int y,
727− struct drm_framebuffer *old_fb)
728−{
729− struct drm_device *dev = crtc->dev;
730− struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
731− int pipe = psb_intel_crtc->pipe;
732− int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B;
733− int dpll_md_reg = (psb_intel_crtc->pipe == 0) ? DPLL_A_MD : DPLL_B_MD;
734− int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR;
735− int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
736− int htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B;
737− int hblank_reg = (pipe == 0) ? HBLANK_A : HBLANK_B;
738− int hsync_reg = (pipe == 0) ? HSYNC_A : HSYNC_B;
739− int vtot_reg = (pipe == 0) ? VTOTAL_A : VTOTAL_B;
740− int vblank_reg = (pipe == 0) ? VBLANK_A : VBLANK_B;
741− int vsync_reg = (pipe == 0) ? VSYNC_A : VSYNC_B;
742− int dspsize_reg = (pipe == 0) ? DSPASIZE : DSPBSIZE;
743− int dsppos_reg = (pipe == 0) ? DSPAPOS : DSPBPOS;
744− int pipesrc_reg = (pipe == 0) ? PIPEASRC : PIPEBSRC;
745− int refclk;
746− struct cdv_intel_clock_t clock;
747− u32 dpll = 0, dspcntr, pipeconf;
748− bool ok, is_sdvo = false, is_dvo = false;
749− bool is_crt = false, is_lvds = false, is_tv = false;
750− bool is_hdmi = false;
751− struct drm_mode_config *mode_config = &dev->mode_config;
752− struct drm_connector *connector;
753−
754− list_for_each_entry(connector, &mode_config->connector_list, head) {
755− struct psb_intel_output *psb_intel_output =
756− to_psb_intel_output(connector);
757−
758− if (!connector->encoder
759− || connector->encoder->crtc != crtc)
760− continue;
761−
762− switch (psb_intel_output->type) {
763− case INTEL_OUTPUT_LVDS:
764− is_lvds = true;
765− break;
766− case INTEL_OUTPUT_SDVO:
767− is_sdvo = true;
768− break;
769− case INTEL_OUTPUT_DVO:
770− is_dvo = true;
771− break;
772− case INTEL_OUTPUT_TVOUT:
773− is_tv = true;
774− break;
775− case INTEL_OUTPUT_ANALOG:
776− is_crt = true;
777− break;
778− case INTEL_OUTPUT_HDMI:
779− is_hdmi = true;
780− break;
781− }
782− }
783−
784− refclk = 96000;
785−
786− /* Hack selection about ref clk for CRT */
787− /* Select 27MHz as the reference clk for HDMI */
788− if (is_crt || is_hdmi)
789− refclk = 27000;
790−
791− drm_mode_debug_printmodeline(adjusted_mode);
792−
793− ok = cdv_intel_find_best_PLL(crtc, adjusted_mode->clock, refclk,
794− &clock);
795− if (!ok) {
796− dev_err(dev->dev, "Couldn't find PLL settings for mode!\n");
797− return 0;
798− }
799−
800− dpll = DPLL_VGA_MODE_DIS;
801− if (is_tv) {
802− /* XXX: just matching BIOS for now */
803−/* dpll |= PLL_REF_INPUT_TVCLKINBC; */
804− dpll |= 3;
805− }
806− dpll |= PLL_REF_INPUT_DREFCLK;
807−
808− dpll |= DPLL_SYNCLOCK_ENABLE;
809− dpll |= DPLL_VGA_MODE_DIS;
810− if (is_lvds)
811− dpll |= DPLLB_MODE_LVDS;
812− else
813− dpll |= DPLLB_MODE_DAC_SERIAL;
814− /* dpll |= (2 << 11); */
815−
816− /* setup pipeconf */
817− pipeconf = REG_READ(pipeconf_reg);
818−
819− /* Set up the display plane register */
820− dspcntr = DISPPLANE_GAMMA_ENABLE;
821−
822− if (pipe == 0)
823− dspcntr |= DISPPLANE_SEL_PIPE_A;
824− else
825− dspcntr |= DISPPLANE_SEL_PIPE_B;
826−
827− dspcntr |= DISPLAY_PLANE_ENABLE;
828− pipeconf |= PIPEACONF_ENABLE;
829−
830− REG_WRITE(dpll_reg, dpll | DPLL_VGA_MODE_DIS | DPLL_SYNCLOCK_ENABLE);
831− REG_READ(dpll_reg);
832−
833− cdv_dpll_set_clock_cdv(dev, crtc, &clock);
834−
835− udelay(150);
836−
837−
838− /* The LVDS pin pair needs to be on before the DPLLs are enabled.
839− * This is an exception to the general rule that mode_set doesn't turn

669 more lines aren’t shown here.

drivers/staging/gma500/cdv_intel_hdmi.c+0−376

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

drivers/staging/gma500/cdv_intel_lvds.c+0−721

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

drivers/staging/gma500/displays/hdmi.h+0−33

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

drivers/staging/gma500/displays/pyr_cmd.h+0−34

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

drivers/staging/gma500/displays/pyr_vid.h+0−34

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

drivers/staging/gma500/displays/tmd_cmd.h+0−34

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

drivers/staging/gma500/displays/tmd_vid.h+0−34

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

drivers/staging/gma500/displays/tpo_cmd.h+0−35

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

drivers/staging/gma500/displays/tpo_vid.h+0−33

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

drivers/staging/gma500/framebuffer.c+0−856

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

drivers/staging/gma500/framebuffer.h+0−48

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

drivers/staging/gma500/gem.c+0−292

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

drivers/staging/gma500/gem_glue.c+0−89

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

drivers/staging/gma500/gem_glue.h+0−2

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

drivers/staging/gma500/gtt.c+0−553

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

drivers/staging/gma500/gtt.h+0−64

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

drivers/staging/gma500/intel_bios.c+0−303

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

drivers/staging/gma500/intel_bios.h+0−430

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

drivers/staging/gma500/intel_i2c.c+0−170

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

drivers/staging/gma500/intel_opregion.c+0−81

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

drivers/staging/gma500/mdfld_device.c+0−714

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

drivers/staging/gma500/mdfld_dsi_dbi.c+0−761

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

drivers/staging/gma500/mdfld_dsi_dbi.h+0−173

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

drivers/staging/gma500/mdfld_dsi_dbi_dpu.c+0−778

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

drivers/staging/gma500/mdfld_dsi_dbi_dpu.h+0−154

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

drivers/staging/gma500/mdfld_dsi_dpi.c+0−805

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

drivers/staging/gma500/mdfld_dsi_dpi.h+0−78

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

drivers/staging/gma500/mdfld_dsi_output.c+0−1014

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

drivers/staging/gma500/mdfld_dsi_output.h+0−138

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

drivers/staging/gma500/mdfld_dsi_pkg_sender.c+0−1484

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

drivers/staging/gma500/mdfld_dsi_pkg_sender.h+0−184

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

drivers/staging/gma500/mdfld_intel_display.c+0−1404

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

drivers/staging/gma500/mdfld_msic.h+0−31

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

drivers/staging/gma500/mdfld_output.c+0−171

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

drivers/staging/gma500/mdfld_output.h+0−41

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

drivers/staging/gma500/mdfld_pyr_cmd.c+0−558

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

drivers/staging/gma500/mdfld_tmd_vid.c+0−206

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

drivers/staging/gma500/mdfld_tpo_cmd.c+0−509

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

drivers/staging/gma500/mdfld_tpo_vid.c+0−140

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

drivers/staging/gma500/medfield.h+0−268

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

drivers/staging/gma500/mid_bios.c+0−270

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

drivers/staging/gma500/mid_bios.h+0−21

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

drivers/staging/gma500/mmu.c+0−858

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

drivers/staging/gma500/mrst.h+0−252

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

drivers/staging/gma500/mrst_crtc.c+0−604

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

drivers/staging/gma500/mrst_device.c+0−634

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

drivers/staging/gma500/mrst_hdmi.c+0−852

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

drivers/staging/gma500/mrst_hdmi_i2c.c+0−328

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

drivers/staging/gma500/mrst_lvds.c+0−407

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

drivers/staging/gma500/power.c+0−318

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

drivers/staging/gma500/power.h+0−67

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

drivers/staging/gma500/psb_device.c+0−321

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

drivers/staging/gma500/psb_drm.h+0−219

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

drivers/staging/gma500/psb_drv.c+0−1230

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

drivers/staging/gma500/psb_drv.h+0−952

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

drivers/staging/gma500/psb_intel_display.c+0−1429

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

drivers/staging/gma500/psb_intel_display.h+0−28

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

drivers/staging/gma500/psb_intel_drv.h+0−230

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

drivers/staging/gma500/psb_intel_lvds.c+0−854

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

drivers/staging/gma500/psb_intel_modes.c+0−77

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

drivers/staging/gma500/psb_intel_reg.h+0−1235

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

drivers/staging/gma500/psb_intel_sdvo.c+0−1293

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

drivers/staging/gma500/psb_intel_sdvo_regs.h+0−338

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

drivers/staging/gma500/psb_irq.c+0−627

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

drivers/staging/gma500/psb_irq.h+0−45

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

drivers/staging/gma500/psb_lid.c+0−88

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

drivers/staging/gma500/psb_reg.h+0−582

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

drivers/staging/omapdrm/Makefile+1−0

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

drivers/staging/omapdrm/omap_crtc.c+45−146

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

drivers/staging/omapdrm/omap_drv.c+48−33

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

drivers/staging/omapdrm/omap_drv.h+46−6

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

drivers/staging/omapdrm/omap_fb.c+167−57

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

drivers/staging/omapdrm/omap_fbdev.c+37−22

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

drivers/staging/omapdrm/omap_gem.c+19−4

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

drivers/staging/omapdrm/omap_plane.c+344−0

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

drivers/staging/omapdrm/omap_priv.h+10−2

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

drivers/staging/pohmelfs/Kconfig+0−20

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

drivers/staging/pohmelfs/Makefile+0−3

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

drivers/staging/pohmelfs/config.c+0−611

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

drivers/staging/pohmelfs/crypto.c+0−878

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

drivers/staging/pohmelfs/dir.c+0−1102

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

drivers/staging/pohmelfs/inode.c+0−2055

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

drivers/staging/pohmelfs/lock.c+0−182

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

drivers/staging/pohmelfs/mcache.c+0−171

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

drivers/staging/pohmelfs/net.c+0−1209

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

drivers/staging/pohmelfs/netfs.h+0−919

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

drivers/staging/pohmelfs/path_entry.c+0−120

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

drivers/staging/pohmelfs/trans.c+0−706

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

drivers/staging/rtl8712/drv_types.h+7−0

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

drivers/staging/rtl8712/hal_init.c+43−19

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

drivers/staging/rtl8712/os_intfs.c+11−3

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

drivers/staging/rtl8712/rtl8712_hal.h+1−0

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

drivers/staging/rtl8712/rtl871x_sta_mgt.c+1−0

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

drivers/staging/rtl8712/usb_intf.c+7−3

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

drivers/staging/tidspbridge/core/tiomap3430.c+0−2

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

drivers/staging/tidspbridge/rmgr/drv_interface.c+35−23

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

drivers/staging/usbip/stub_main.c+2−2

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

drivers/staging/zcache/zcache-main.c+12−13

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

drivers/target/iscsi/iscsi_target.c+34−5

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

drivers/target/iscsi/iscsi_target_configfs.c+1−0

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

drivers/target/iscsi/iscsi_target_core.h+4−2

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

drivers/target/iscsi/iscsi_target_erl1.c+2−2

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

drivers/target/iscsi/iscsi_target_login.c+35−4

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

drivers/target/iscsi/iscsi_target_util.c+11−0

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

drivers/target/target_core_alua.c+4−4

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

drivers/target/target_core_cdb.c+26−25

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

drivers/target/target_core_configfs.c+8−4

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

drivers/target/target_core_device.c+15−13

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

drivers/target/target_core_fabric_configfs.c+2−2

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

drivers/target/target_core_iblock.c+9−2

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

drivers/target/target_core_internal.h+1−1

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

drivers/target/target_core_pr.c+22−21

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

drivers/target/target_core_pscsi.c+2−2

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

drivers/target/target_core_tpg.c+1−2

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

drivers/target/target_core_transport.c+83−41

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

drivers/target/tcm_fc/tfc_cmd.c+2−7

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

drivers/tty/serial/8250/8250.c+1−1

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

drivers/tty/serial/m32r_sio.crenamed from drivers/tty/serial/8250/m32r_sio.c+0−0

File renamed without changes.

drivers/tty/serial/m32r_sio.hrenamed from drivers/tty/serial/8250/m32r_sio.h+0−0

File renamed without changes.

drivers/tty/serial/m32r_sio_reg.hrenamed from drivers/tty/serial/8250/m32r_sio_reg.h+0−0

File renamed without changes.

drivers/tty/serial/omap-serial.c+25−5

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

drivers/tty/serial/samsung.c+2−1

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

drivers/tty/vt/vt_ioctl.c+0−1

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

drivers/usb/core/hcd-pci.c+4−1

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

drivers/usb/core/hcd.c+4−2

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

drivers/usb/core/hub.c+17−13

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

drivers/usb/gadget/f_loopback.c+1−1

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

drivers/usb/host/Kconfig+4−4

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

drivers/usb/host/ehci-fsl.c+9−2

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

drivers/usb/host/ehci-fsl.h+1−0

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

drivers/usb/host/pci-quirks.c+17−0

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

drivers/usb/host/xhci-hub.c+1−1

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

drivers/usb/host/xhci-mem.c+24−8

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

drivers/usb/host/xhci.c+5−0

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

drivers/usb/musb/musb_io.h+2−1

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

drivers/usb/otg/Kconfig+1−1

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

drivers/usb/serial/cp210x.c+2−0

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

drivers/usb/serial/ftdi_sio.c+1−0

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

drivers/usb/serial/ftdi_sio_ids.h+7−0

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

drivers/usb/serial/option.c+25−15

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

drivers/usb/serial/qcserial.c+14−2

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

drivers/usb/serial/ti_usb_3410_5052.c+4−2

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

drivers/usb/serial/ti_usb_3410_5052.h+4−0

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

drivers/usb/storage/usb.c+31−59

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

drivers/usb/storage/usb.h+4−3

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

drivers/video/atmel_lcdfb.c+1−1

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

drivers/video/fsl-diu-fb.c+2−2

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

drivers/video/intelfb/intelfbdrv.c+0−1

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

drivers/video/omap2/dss/dispc.c+1−1

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

drivers/video/omap2/dss/dpi.c+5−0

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

drivers/video/omap2/dss/dsi.c+1−1

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

drivers/video/omap2/dss/dss.c+1−1

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

drivers/video/omap2/dss/hdmi.c+4−1

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

drivers/video/omap2/dss/rfbi.c+1−1

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

drivers/video/omap2/dss/ti_hdmi.h+4−0

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

drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c+64−4

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

drivers/video/omap2/dss/venc.c+1−1

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

drivers/video/pvr2fb.c+1−1

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

drivers/xen/cpu_hotplug.c+2−1

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

drivers/xen/xen-pciback/pci_stub.c+4−4

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

drivers/xen/xen-pciback/xenbus.c+3−2

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

drivers/xen/xenbus/xenbus_dev_frontend.c+4−0

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

fs/autofs4/autofs_i.h+1−0

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

fs/autofs4/dev-ioctl.c+1−0

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

fs/autofs4/expire.c+2−0

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

fs/autofs4/inode.c+2−0

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

fs/autofs4/waitq.c+19−3

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

fs/bio.c+3−7

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

fs/btrfs/backref.c+2−0

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

fs/btrfs/check-integrity.c+1−1

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

fs/btrfs/compression.c+2−0

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

fs/btrfs/ctree.h+1−1

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

fs/btrfs/disk-io.c+12−0

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

fs/btrfs/extent-tree.c+32−19

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

fs/btrfs/extent_io.c+65−48

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

fs/btrfs/extent_io.h+1−0

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

fs/btrfs/extent_map.h+2−2

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

fs/btrfs/file.c+12−17

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

fs/btrfs/free-space-cache.c+1−0

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

fs/btrfs/inode-map.c+4−2

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

fs/btrfs/inode.c+35−5

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

fs/btrfs/ioctl.c+35−24

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

fs/btrfs/scrub.c+5−3

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

fs/btrfs/transaction.c+9−7

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

fs/btrfs/volumes.c+31−2

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

fs/cifs/Kconfig+2−2

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

fs/cifs/connect.c+11−12

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

fs/cifs/dir.c+1−1

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

fs/cifs/sess.c+7−4

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

fs/compat.c+25−31

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

fs/dcache.c+4−4

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

fs/direct-io.c+2−2

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

fs/ecryptfs/crypto.c+61−7

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

fs/ecryptfs/ecryptfs_kernel.h+6−0

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

fs/ecryptfs/inode.c+2−0

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

fs/ecryptfs/keystore.c+3−6

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

fs/ecryptfs/mmap.c+2−2

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

fs/ecryptfs/read_write.c+2−2

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

fs/ecryptfs/super.c+13−1

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

fs/eventpoll.c+29−1

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

fs/exec.c+17−16

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

fs/fs-writeback.c+8−8

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

fs/inode.c+4−4

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

fs/ioprio.c+1−1

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

fs/jffs2/erase.c+1−1

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

fs/namei.c+3−1

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

fs/nfs/nfs4proc.c+55−75

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

fs/nfs/nfs4state.c+2−0

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

fs/nfs/nfs4xdr.c+4−1

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

fs/nilfs2/ioctl.c+2−0

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

fs/ntfs/attrib.c+3−3

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

fs/ntfs/mft.c+3−3

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

fs/ntfs/super.c+1−3

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

fs/ocfs2/namei.c+1−1

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

fs/quota/quota.c+21−3

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

fs/select.c+1−1

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

fs/signalfd.c+15−0

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

fs/super.c+22−0

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

fs/xfs/kmem.h+0−6

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

fs/xfs/xfs_dquot.c+38−89

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

fs/xfs/xfs_log_recover.c+4−4

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

fs/xfs/xfs_qm.c+111−180

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

fs/xfs/xfs_qm.h+0−14

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

fs/xfs/xfs_qm_stats.c+2−2

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

fs/xfs/xfs_qm_syscalls.c+2−2

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

fs/xfs/xfs_trace.h+2−3

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

fs/xfs/xfs_trans.c+2−2

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

fs/xfs/xfs_trans_dquot.c+6−4

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

include/asm-generic/io-64-nonatomic-hi-lo.h+28−0

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

include/asm-generic/io-64-nonatomic-lo-hi.h+28−0

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

include/asm-generic/pci_iomap.h+10−0

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

include/asm-generic/poll.h+2−0

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

include/linux/binfmts.h+2−1

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

include/linux/bitops.h+20−0

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

include/linux/blkdev.h+0−3

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

include/linux/cdrom.h+2−1

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

include/linux/compat.h+4−0

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

include/linux/digsig.h+2−2

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

include/linux/elevator.h+1−8

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

include/linux/fs.h+1−0

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

include/linux/gpio_keys.h+2−0

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

include/linux/hyperv.h+1−1

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

include/linux/if_link.h+1−0

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

include/linux/iocontext.h+2−3

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

include/linux/mfd/twl6040.h+2−0

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

include/linux/mmc/card.h+4−0

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

include/linux/mmc/dw_mmc.h+4−2

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

include/linux/mmc/host.h+20−0

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

include/linux/mtd/mtd.h+1−3

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

include/linux/netfilter_bridge/ebtables.h+2−2

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

include/linux/nfs_xdr.h+1−1

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

include/linux/pm_qos.h+13−1

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

include/linux/proportions.h+4−0

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

include/linux/rtnetlink.h+3−0

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

include/linux/sh_dma.h+1−0

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

include/linux/signalfd.h+4−1

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

include/linux/skbuff.h+10−0

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

include/linux/syscalls.h+1−1

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

include/linux/usb/ch11.h+2−8

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

include/linux/usb/ch9.h+1−1

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

include/net/bluetooth/bluetooth.h+2−0

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

include/net/bluetooth/hci_core.h+3−3

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

include/net/bluetooth/l2cap.h+6−6

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

include/net/flow.h+10−0

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

include/net/netfilter/nf_conntrack.h+1−1

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

include/net/netprio_cgroup.h+40−8

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

include/net/route.h+4−0

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

include/net/rtnetlink.h+1−1

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

include/net/sch_generic.h+8−1

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

include/net/tcp.h+10−4

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

include/sound/core.h+2−0

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

include/target/target_core_backend.h+2−2

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

include/target/target_core_base.h+1−0

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

include/target/target_core_fabric.h+1−1

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

include/trace/events/sched.h+0−50

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

include/trace/events/writeback.h+5−2

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

include/video/omapdss.h+5−0

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

kernel/events/core.c+14−5

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

kernel/events/hw_breakpoint.c+2−2

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

kernel/fork.c+5−2

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

kernel/irq/autoprobe.c+2−2

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

kernel/irq/chip.c+33−9

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

kernel/irq/internals.h+1−1

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

kernel/irq/manage.c+1−1

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

kernel/kprobes.c+5−1

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

kernel/params.c+2−1

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

kernel/pid.c+2−2

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

kernel/power/power.h+22−2

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

kernel/power/process.c+5−2

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

kernel/power/user.c+4−2

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

kernel/relay.c+8−2

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

kernel/sched/core.c+0−1

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

kernel/sched/fair.c+2−0

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

lib/Kconfig+3−0

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

lib/kstrtox.c+13−5

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

lib/pci_iomap.c+1−1

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

mm/backing-dev.c+18−5

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

mm/compaction.c+23−1

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

mm/filemap.c+4−4

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

mm/filemap_xip.c+6−1

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

mm/huge_memory.c+2−2

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

mm/kmemleak.c+2−1

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

mm/memcontrol.c+6−2

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

mm/migrate.c+1−1

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

mm/nommu.c+7−2

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

mm/page_alloc.c+1−0

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

mm/swap.c+1−1

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

net/atm/clip.c+6−4

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

net/bluetooth/af_bluetooth.c+5−7

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

net/bluetooth/hci_conn.c+4−0

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

net/bluetooth/hci_core.c+2−1

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

net/bluetooth/l2cap_core.c+14−10

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

net/bluetooth/l2cap_sock.c+3−1

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

net/bluetooth/rfcomm/core.c+12−6

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

net/bluetooth/rfcomm/sock.c+2−0

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

net/caif/caif_socket.c+6−4

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

net/caif/cfmuxl.c+3−9

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

net/core/dev.c+8−2

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

net/core/ethtool.c+2−0

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

net/core/neighbour.c+2−0

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

net/core/netpoll.c+1−1

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

net/core/netprio_cgroup.c+5−10

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

net/core/rtnetlink.c+57−21

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

net/core/sock.c+2−5

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

net/ipv4/Kconfig+1−1

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

net/ipv4/arp.c+2−1

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

net/ipv4/ip_gre.c+5−5

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

net/ipv4/ip_options.c+1−1

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

net/ipv4/ping.c+1−0

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

net/ipv4/sysctl_net_ipv4.c+0−6

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

net/ipv4/tcp.c+20−8

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

net/ipv4/tcp_input.c+29−16

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

net/ipv4/tcp_ipv4.c+5−0

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

net/ipv4/tcp_timer.c+1−4

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

net/ipv4/xfrm4_mode_beet.c+1−4

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

net/ipv4/xfrm4_mode_tunnel.c+2−4

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

net/ipv6/ip6mr.c+3−1

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

net/ipv6/ndisc.c+3−2

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

net/ipv6/xfrm6_mode_beet.c+1−5

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

net/ipv6/xfrm6_mode_tunnel.c+2−4

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

net/mac80211/debugfs_sta.c+2−2

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

net/mac80211/main.c+2−2

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

net/mac80211/rate.c+1−1

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

net/mac80211/rate.h+2−1

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

net/mac80211/rx.c+1−1

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

net/mac80211/sta_info.h+2−0

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

net/netfilter/ipvs/ip_vs_core.c+1−1

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

net/netfilter/nf_conntrack_core.c+34−4

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

net/netfilter/nf_conntrack_netlink.c+16−30

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

net/netfilter/nf_queue.c+32−8

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

net/netfilter/xt_TEE.c+3−2

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

net/rxrpc/ar-key.c+2−2

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

net/sched/sch_choke.c+1−2

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

net/sched/sch_netem.c+3−6

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

net/sched/sch_sfb.c+1−2

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

net/sched/sch_sfq.c+2−3

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

scripts/checkpatch.pl+6−0

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

scripts/coccicheck+4−9

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

scripts/depmod.sh+0−6

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

scripts/mod/file2alias.c+32−5

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

scripts/mod/modpost.c+9−0

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

scripts/package/builddeb+6−6

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

sound/isa/sb/emu8000_patch.c+0−1

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

sound/pci/hda/hda_codec.c+1−1

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

sound/pci/hda/hda_jack.c+15−9

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

sound/pci/hda/patch_ca0132.c+19−14

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

sound/pci/hda/patch_cirrus.c+4−2

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

sound/pci/hda/patch_realtek.c+80−26

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

sound/pci/hda/patch_sigmatel.c+2−2

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

sound/pci/hda/patch_via.c+132−155

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

sound/pci/intel8x0.c+6−0

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

sound/pci/oxygen/oxygen_mixer.c+14−11

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

sound/soc/codecs/ak4642.c+16−15

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

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

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

sound/soc/codecs/wm5100.c+11−1

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

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

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

sound/soc/codecs/wm8994.c+10−6

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

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

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

sound/soc/codecs/wm_hubs.c+12−6

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

sound/soc/samsung/neo1973_wm8753.c+1−64

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

sound/soc/sh/fsi.c+1−5

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

sound/soc/soc-core.c+11−0

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

sound/usb/caiaq/audio.c+4−1

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

sound/usb/card.h+1−0

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

sound/usb/format.c+1−3

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

sound/usb/quirks-table.h+8−0

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

sound/usb/quirks.c+5−1

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

tools/perf/util/event.c+1−0

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

tools/perf/util/evlist.c+4−0

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

tools/perf/util/probe-event.c+6−0

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

tools/perf/util/probe-finder.c+11−1

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

virt/kvm/kvm_main.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