History

Merge tag 'v3.12-rc4' into sched/core

Merge Linux v3.12-rc4 to fix a conflict and also to refresh the tree before applying more scheduler patches. Conflicts: arch/avr32/include/asm/Kbuild

Ingo Molnar committed 13 years ago

Commit 37bf0632 parents 6bfa687 d0e639c893 files · +8754 −4829Browse files

Unified · Split

893 files
  1. CREDITS +1 −2
  2. Documentation/arm64/tagged-pointers.txt +7 −7
  3. Documentation/block/00-INDEX +2 −0
  4. Documentation/block/cmdline-partition.txt +4 −4
  5. Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt +5 −5
  6. Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt +5 −5
  7. Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt +4 −4
  8. Documentation/devicetree/bindings/mmc/tmio_mmc.txt +10 −7
  9. Documentation/devicetree/bindings/net/fsl-tsec-phy.txt +17 −1
  10. Documentation/devicetree/bindings/pci/designware-pcie.txt +1 −1
  11. Documentation/devicetree/bindings/serial/qca,ar9330-uart.txt +0 −0
  12. Documentation/filesystems/vfs.txt +7 −7
  13. Documentation/kernel-parameters.txt +9 −1
  14. Documentation/networking/bonding.txt +6 −0
  15. Documentation/sound/alsa/HD-Audio-Models.txt +6 −0
  16. MAINTAINERS +33 −7
  17. Makefile +1 −1
  18. arch/Kconfig +0 −3
  19. arch/arc/include/asm/spinlock.h +8 −1
  20. arch/arc/include/asm/uaccess.h +2 −2
  21. arch/arc/kernel/signal.c +13 −12
  22. arch/arc/kernel/time.c +2 −5
  23. arch/arc/kernel/unaligned.c +6 −0
  24. arch/arm/Kconfig +1 −2
  25. arch/arm/boot/dts/Makefile +3 −0
  26. arch/arm/boot/dts/am335x-bone-common.dtsi +262 −0
  27. arch/arm/boot/dts/am335x-bone.dts +1 −255
  28. arch/arm/boot/dts/am335x-boneblack.dts +17 −0
  29. arch/arm/boot/dts/armada-370-netgear-rn102.dts +32 −17
  30. arch/arm/boot/dts/armada-xp.dtsi +11 −0
  31. arch/arm/boot/dts/at91sam9x5.dtsi +4 −2
  32. arch/arm/boot/dts/atlas6.dtsi +12 −0
  33. arch/arm/boot/dts/imx27.dtsi +3 −3
  34. arch/arm/boot/dts/imx51.dtsi +1 −1
  35. arch/arm/boot/dts/imx6q-pinfunc.h +2 −2
  36. arch/arm/boot/dts/kirkwood.dtsi +2 −1
  37. arch/arm/boot/dts/omap3-beagle-xm.dts +1 −1
  38. arch/arm/boot/dts/omap3-igep.dtsi +14 −0
  39. arch/arm/boot/dts/omap4-panda-common.dtsi +45 −1
  40. arch/arm/boot/dts/omap4-sdp.dts +38 −1
  41. arch/arm/boot/dts/omap5.dtsi +4 −3
  42. arch/arm/boot/dts/prima2.dtsi +23 −4
  43. arch/arm/boot/dts/r8a73a4.dtsi +3 −3
  44. arch/arm/boot/dts/r8a7778.dtsi +0 −1
  45. arch/arm/boot/dts/r8a7779.dtsi +0 −1
  46. arch/arm/boot/dts/r8a7790.dtsi +4 −5
  47. arch/arm/boot/dts/sh73a0.dtsi +3 −3
  48. arch/arm/common/edma.c +31 −7
  49. arch/arm/configs/multi_v7_defconfig +3 −0
  50. arch/arm/crypto/aes-armv4.S +3 −3
  51. arch/arm/include/asm/uaccess.h +7 −0
  52. arch/arm/kernel/entry-common.S +2 −2
  53. arch/arm/kernel/entry-header.S +4 −4
  54. arch/arm/kvm/reset.c +3 −3
  55. arch/arm/mach-at91/at91rm9200_time.c +1 −1
  56. arch/arm/mach-at91/at91sam926x_time.c +1 −1
  57. arch/arm/mach-at91/at91sam9g45_reset.S +8 −0
  58. arch/arm/mach-at91/at91x40_time.c +1 −1
  59. arch/arm/mach-davinci/board-dm365-evm.c +1 −1
  60. arch/arm/mach-davinci/include/mach/serial.h +2 −2
  61. arch/arm/mach-imx/clk-fixup-mux.c +1 −0
  62. arch/arm/mach-imx/clk-imx27.c +1 −1
  63. arch/arm/mach-imx/clk-imx51-imx53.c +2 −2
  64. arch/arm/mach-imx/mach-imx6q.c +7 −2
  65. arch/arm/mach-imx/system.c +11 −0
  66. arch/arm/mach-integrator/pci_v3.h +7 −0
  67. arch/arm/mach-mvebu/coherency.c +7 −1
  68. arch/arm/mach-mvebu/pmsu.c +1 −0
  69. arch/arm/mach-mvebu/system-controller.c +1 −0
  70. arch/arm/mach-omap2/cclock44xx_data.c +1 −1
  71. arch/arm/mach-omap2/cpuidle44xx.c +1 −1
  72. arch/arm/mach-omap2/gpmc.c +2 −2
  73. arch/arm/mach-omap2/mux34xx.c +1 −1
  74. arch/arm/mach-omap2/omap-smp.c +1 −1
  75. arch/arm/mach-omap2/omap_device.c +1 −1
  76. arch/arm/mach-sa1100/collie.c +1 −1
  77. arch/arm/mach-shmobile/board-armadillo800eva.c +2 −2
  78. arch/arm/mach-shmobile/board-lager.c +26 −1
  79. arch/arm/mach-shmobile/clock-r8a73a4.c +1 −1
  80. arch/arm/mach-shmobile/clock-sh73a0.c +1 −1
  81. arch/arm/mach-u300/Kconfig +5 −5
  82. arch/arm/mach-ux500/cache-l2x0.c +1 −0
  83. arch/arm/mach-vexpress/tc2_pm.c +10 −1
  84. arch/arm64/Kconfig.debug +0 −7
  85. arch/arm64/configs/defconfig +4 −1
  86. arch/arm64/include/asm/hwcap.h +1 −1
  87. arch/arm64/include/asm/uaccess.h +6 −4
  88. arch/arm64/kernel/fpsimd.c +2 −0
  89. arch/arm64/kernel/process.c +16 −5
  90. arch/arm64/kernel/setup.c +1 −1
  91. arch/arm64/mm/fault.c +1 −1
  92. arch/arm64/mm/tlb.S +1 −1
  93. arch/avr32/include/asm/Kbuild +16 −2
  94. arch/avr32/include/asm/cputime.h +0 −6
  95. arch/avr32/include/asm/delay.h +0 −1
  96. arch/avr32/include/asm/device.h +0 −7
  97. arch/avr32/include/asm/div64.h +0 −6
  98. arch/avr32/include/asm/emergency-restart.h +0 −6
  99. arch/avr32/include/asm/futex.h +0 −6
  100. arch/avr32/include/asm/irq_regs.h +0 −1
  101. arch/avr32/include/asm/local.h +0 −6
  102. arch/avr32/include/asm/local64.h +0 −1
  103. arch/avr32/include/asm/percpu.h +0 −6
  104. arch/avr32/include/asm/scatterlist.h +0 −6
  105. arch/avr32/include/asm/sections.h +0 −6
  106. arch/avr32/include/asm/topology.h +0 −6
  107. arch/avr32/include/asm/xor.h +0 −6
  108. arch/avr32/kernel/process.c +1 −1
  109. arch/avr32/kernel/time.c +8 −1
  110. arch/mips/Makefile +0 −3
  111. arch/mips/alchemy/board-mtx1.c +1 −1
  112. arch/mips/alchemy/common/usb.c +2 −1
  113. arch/mips/bcm63xx/cpu.c +2 −2
  114. arch/mips/boot/dts/include/dt-bindings +1 −1
  115. arch/mips/cavium-octeon/csrc-octeon.c +1 −0
  116. arch/mips/dec/prom/init.c +1 −0
  117. arch/mips/include/asm/cpu-features.h +1 −7
  118. arch/mips/include/asm/cpu-info.h +1 −0
  119. arch/mips/include/asm/cpu-type.h +203 −0
  120. arch/mips/include/asm/cpu.h +29 −9
  121. arch/mips/include/asm/mach-au1x00/au1000.h +3 −1
  122. arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h +2 −0
  123. arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h +2 −0
  124. arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h +2 −0
  125. arch/mips/include/asm/mipsregs.h +7 −0
  126. arch/mips/include/asm/pci.h +12 −0
  127. arch/mips/include/asm/timex.h +32 −1
  128. arch/mips/include/asm/vga.h +2 −1
  129. arch/mips/kernel/cpu-probe.c +37 −21
  130. arch/mips/kernel/idle.c +2 −1
  131. arch/mips/kernel/time.c +1 −0
  132. arch/mips/kernel/traps.c +2 −1
  133. arch/mips/mm/c-octeon.c +4 −2
  134. arch/mips/mm/c-r4k.c +34 −16
  135. arch/mips/mm/dma-default.c +5 −8
  136. arch/mips/mm/page.c +1 −0
  137. arch/mips/mm/sc-mips.c +2 −1
  138. arch/mips/mm/tlb-r4k.c +1 −0
  139. arch/mips/mm/tlbex.c +1 −0
  140. arch/mips/mti-malta/malta-time.c +3 −2
  141. arch/mips/mti-sead3/sead3-time.c +2 −1
  142. arch/mips/netlogic/xlr/fmn-config.c +2 −1
  143. arch/mips/oprofile/common.c +1 −0
  144. arch/mips/pci/pci-bcm1480.c +1 −0
  145. arch/mips/sibyte/bcm1480/setup.c +2 −1
  146. arch/mips/sibyte/sb1250/setup.c +2 −1
  147. arch/mips/sni/setup.c +2 −1
  148. arch/openrisc/include/asm/prom.h +0 −44
  149. arch/parisc/mm/fault.c +3 −2
  150. arch/powerpc/boot/Makefile +2 −2
  151. arch/powerpc/boot/epapr-wrapper.c +9 −0
  152. arch/powerpc/boot/epapr.c +2 −2
  153. arch/powerpc/boot/of.c +15 −1
  154. arch/powerpc/boot/wrapper +5 −4
  155. arch/powerpc/include/asm/irq.h +2 −2
  156. arch/powerpc/include/asm/processor.h +1 −3
  157. arch/powerpc/kernel/asm-offsets.c +2 −1
  158. arch/powerpc/kernel/iommu.c +1 −1
  159. arch/powerpc/kernel/irq.c +44 −56
  160. arch/powerpc/kernel/misc_32.S +20 −5
  161. arch/powerpc/kernel/misc_64.S +4 −6
  162. arch/powerpc/kernel/process.c +2 −1
  163. arch/powerpc/kernel/prom_init.c +21 −0
  164. arch/powerpc/kernel/sysfs.c +16 −2
  165. arch/powerpc/kernel/tm.S +64 −31
  166. arch/powerpc/kernel/vio.c +8 −4
  167. arch/powerpc/lib/checksum_64.S +42 −16
  168. arch/powerpc/lib/sstep.c +2 −1
  169. arch/powerpc/mm/init_64.c +4 −0
  170. arch/powerpc/mm/mem.c +9 −0
  171. arch/powerpc/perf/power8-pmu.c +3 −2
  172. arch/powerpc/platforms/pseries/smp.c +16 −10
  173. arch/s390/Kconfig +1 −1
  174. arch/s390/include/asm/mutex.h +0 −2
  175. arch/s390/include/asm/processor.h +2 −0
  176. arch/s390/include/asm/spinlock.h +5 −0
  177. arch/score/Kconfig +4 −0
  178. arch/score/Makefile +2 −2
  179. arch/score/include/asm/checksum.h +51 −42
  180. arch/score/include/asm/io.h +0 −1
  181. arch/score/include/asm/pgalloc.h +1 −1
  182. arch/score/kernel/entry.S +2 −2
  183. arch/score/kernel/process.c +2 −2
  184. arch/sparc/Kconfig +6 −1
  185. arch/sparc/include/asm/floppy_64.h +1 −1
  186. arch/sparc/kernel/Makefile +2 −1
  187. arch/sparc/kernel/ds.c +2 −3
  188. arch/sparc/kernel/ldc.c +2 −2
  189. arch/x86/Kconfig +3 −2
  190. arch/x86/include/asm/xen/page.h +20 −11
  191. arch/x86/kernel/cpu/perf_event.c +6 −6
  192. arch/x86/kernel/cpu/perf_event_intel.c +1 −0
  193. arch/x86/kernel/cpu/perf_event_intel_ds.c +1 −0
  194. arch/x86/kernel/cpu/perf_event_intel_uncore.c +5 −5
  195. arch/x86/kernel/entry_64.S +0 −15
  196. arch/x86/kernel/microcode_amd.c +1 −0
  197. arch/x86/kernel/reboot.c +17 −1
  198. arch/x86/kernel/smpboot.c +2 −1
  199. arch/x86/kernel/sysfb_simplefb.c +2 −2
  200. arch/x86/kvm/vmx.c +3 −1
  201. arch/x86/pci/mmconfig-shared.c +6 −1
  202. arch/x86/platform/efi/efi.c +7 −4
  203. arch/x86/xen/p2m.c +4 −6
  204. arch/x86/xen/spinlock.c +24 −2
  205. block/Kconfig +7 −2
  206. block/Makefile +1 −1
  207. block/blk-cgroup.c +15 −10
  208. block/blk-core.c +2 −4
  209. block/blk-exec.c +2 −2
  210. block/cfq-iosched.c +2 −2
  211. block/deadline-iosched.c +1 −1
  212. block/elevator.c +1 −1
  213. block/genhd.c +1 −2
  214. block/partitions/Kconfig +2 −2
  215. block/partitions/cmdline.c +4 −4
  216. drivers/acpi/acpi_ipmi.c +14 −10
  217. drivers/acpi/scan.c +2 −2
  218. drivers/ata/sata_promise.c +1 −1
  219. drivers/atm/he.c +1 −12
  220. drivers/atm/nicstar.c +1 −1
  221. drivers/base/core.c +7 −7
  222. drivers/bcma/driver_pci.c +26 −23
  223. drivers/bcma/scan.c +7 −5
  224. drivers/block/cciss.c +1 −0
  225. drivers/block/cpqarray.c +1 −0
  226. drivers/block/rbd.c +59 −18
  227. drivers/bluetooth/ath3k.c +2 −0
  228. drivers/bluetooth/btusb.c +5 −0
  229. drivers/bus/mvebu-mbus.c +9 −3
  230. drivers/char/tpm/xen-tpmfront.c +0 −36
  231. drivers/clocksource/Kconfig +1 −0
  232. drivers/clocksource/clksrc-of.c +3 −0
  233. drivers/clocksource/em_sti.c +1 −1
  234. drivers/clocksource/exynos_mct.c +9 −1
  235. drivers/cpufreq/acpi-cpufreq.c +4 −0
  236. drivers/cpufreq/cpufreq-cpu0.c +7 −2
  237. drivers/cpufreq/cpufreq.c +23 −11
  238. drivers/cpufreq/exynos5440-cpufreq.c +1 −1
  239. drivers/cpufreq/imx6q-cpufreq.c +6 −1
  240. drivers/cpufreq/intel_pstate.c +4 −1
  241. drivers/cpufreq/spear-cpufreq.c +1 −1
  242. drivers/dma/Kconfig +1 −0
  243. drivers/dma/edma.c +1 −1
  244. drivers/dma/imx-dma.c +15 −16
  245. drivers/gpio/gpio-omap.c +101 −57
  246. drivers/gpio/gpio-rcar.c +3 −4
  247. drivers/gpu/drm/ast/ast_drv.h +1 −1
  248. drivers/gpu/drm/drm_context.c +8 −65
  249. drivers/gpu/drm/drm_fb_helper.c +8 −0
  250. drivers/gpu/drm/drm_fops.c +20 −1
  251. drivers/gpu/drm/drm_stub.c +8 −2
  252. drivers/gpu/drm/exynos/Kconfig +1 −1
  253. drivers/gpu/drm/exynos/exynos_drm_buf.c +4 −3
  254. drivers/gpu/drm/exynos/exynos_drm_fbdev.c +3 −2
  255. drivers/gpu/drm/i2c/tda998x_drv.c +1 −2
  256. drivers/gpu/drm/i915/i915_gem.c +8 −11
  257. drivers/gpu/drm/i915/i915_gpu_error.c +4 −2
  258. drivers/gpu/drm/i915/i915_irq.c +54 −14
  259. drivers/gpu/drm/i915/intel_ddi.c +1 −1
  260. drivers/gpu/drm/i915/intel_display.c +24 −22
  261. drivers/gpu/drm/i915/intel_dp.c +12 −1
  262. drivers/gpu/drm/i915/intel_drv.h +1 −0
  263. drivers/gpu/drm/i915/intel_dvo.c +2 −0
  264. drivers/gpu/drm/i915/intel_panel.c +1 −0
  265. drivers/gpu/drm/i915/intel_pm.c +3 −3
  266. drivers/gpu/drm/i915/intel_sdvo.c +36 −27
  267. drivers/gpu/drm/i915/intel_tv.c +8 −0
  268. drivers/gpu/drm/msm/adreno/adreno_gpu.c +9 −1
  269. drivers/gpu/drm/msm/mdp4/mdp4_kms.c +0 −2
  270. drivers/gpu/drm/msm/msm_drv.c +37 −21
  271. drivers/gpu/drm/msm/msm_drv.h +7 −1
  272. drivers/gpu/drm/msm/msm_gem.c +24 −17
  273. drivers/gpu/drm/msm/msm_gem.h +1 −1
  274. drivers/gpu/drm/msm/msm_gem_submit.c +13 −11
  275. drivers/gpu/drm/msm/msm_gpu.c +20 −4
  276. drivers/gpu/drm/nouveau/core/subdev/bios/init.c +18 −3
  277. drivers/gpu/drm/nouveau/nouveau_display.c +15 −20
  278. drivers/gpu/drm/nouveau/nouveau_fbcon.c +2 −1
  279. drivers/gpu/drm/nouveau/nouveau_sgdma.c +1 −3
  280. drivers/gpu/drm/radeon/atombios_encoders.c +15 −8
  281. drivers/gpu/drm/radeon/btc_dpm.c +51 −6
  282. drivers/gpu/drm/radeon/btc_dpm.h +2 −0
  283. drivers/gpu/drm/radeon/ci_dpm.c +26 −6
  284. drivers/gpu/drm/radeon/ci_smc.c +26 −13
  285. drivers/gpu/drm/radeon/cik.c +37 −16
  286. drivers/gpu/drm/radeon/cypress_dpm.c +0 −6
  287. drivers/gpu/drm/radeon/dce6_afmt.c +10 −2
  288. drivers/gpu/drm/radeon/kv_dpm.c +129 −35
  289. drivers/gpu/drm/radeon/kv_dpm.h +1 −0
  290. drivers/gpu/drm/radeon/kv_smc.c +8 −0
  291. drivers/gpu/drm/radeon/ni_dpm.c +24 −6
  292. drivers/gpu/drm/radeon/ppsmc.h +2 −0
  293. drivers/gpu/drm/radeon/r100.c +12 −3
  294. drivers/gpu/drm/radeon/r420.c +7 −0
  295. drivers/gpu/drm/radeon/r600.c +19 −0
  296. drivers/gpu/drm/radeon/r600_dpm.c +15 −25
  297. drivers/gpu/drm/radeon/r600_hdmi.c +15 −5
  298. drivers/gpu/drm/radeon/r600d.h +1 −1
  299. drivers/gpu/drm/radeon/radeon.h +81 −1
  300. drivers/gpu/drm/radeon/radeon_asic.c +10 −3
  301. drivers/gpu/drm/radeon/radeon_asic.h +5 −0
  302. drivers/gpu/drm/radeon/radeon_atombios.c +43 −23
  303. drivers/gpu/drm/radeon/radeon_connectors.c +65 −4
  304. drivers/gpu/drm/radeon/radeon_cs.c +10 −4
  305. drivers/gpu/drm/radeon/radeon_device.c +23 −3
  306. drivers/gpu/drm/radeon/radeon_display.c +12 −0
  307. drivers/gpu/drm/radeon/radeon_drv.c +1 −1
  308. drivers/gpu/drm/radeon/radeon_mode.h +9 −0
  309. drivers/gpu/drm/radeon/radeon_pm.c +70 −19
  310. drivers/gpu/drm/radeon/radeon_ring.c +5 −3
  311. drivers/gpu/drm/radeon/radeon_trace.h +20 −7
  312. drivers/gpu/drm/radeon/radeon_uvd.c +1 −2
  313. drivers/gpu/drm/radeon/rs400.c +7 −0
  314. drivers/gpu/drm/radeon/rs600.c +11 −1
  315. drivers/gpu/drm/radeon/rs690.c +7 −0
  316. drivers/gpu/drm/radeon/rs780_dpm.c +92 −20
  317. drivers/gpu/drm/radeon/rv515.c +8 −0
  318. drivers/gpu/drm/radeon/rv6xx_dpm.c +0 −2
  319. drivers/gpu/drm/radeon/rv770_dpm.c +7 −9
  320. drivers/gpu/drm/radeon/rv770_smc.c +27 −17
  321. drivers/gpu/drm/radeon/rv770_smc.h +0 −2
  322. drivers/gpu/drm/radeon/rv770d.h +1 −1
  323. drivers/gpu/drm/radeon/si.c +17 −4
  324. drivers/gpu/drm/radeon/si_dpm.c +24 −6
  325. drivers/gpu/drm/radeon/si_smc.c +28 −15
  326. drivers/gpu/drm/radeon/sumo_dpm.c +0 −2
  327. drivers/gpu/drm/radeon/trinity_dpm.c +16 −1
  328. drivers/gpu/drm/radeon/trinity_dpm.h +2 −0
  329. drivers/gpu/drm/radeon/trinity_smc.c +8 −0
  330. drivers/gpu/drm/radeon/uvd_v1_0.c +2 −2
  331. drivers/gpu/drm/ttm/ttm_object.c +1 −1
  332. drivers/gpu/drm/ttm/ttm_tt.c +1 −1
  333. drivers/gpu/drm/udl/udl_gem.c +0 −1
  334. drivers/hv/connection.c +1 −1
  335. drivers/hv/hv_kvp.c +26 −12
  336. drivers/hv/hv_snapshot.c +3 −3
  337. drivers/hv/hv_util.c +54 −17
  338. drivers/hwmon/applesmc.c +10 −1
  339. drivers/i2c/busses/i2c-designware-core.c +20 −6
  340. drivers/i2c/busses/i2c-ismt.c +3 −0
  341. drivers/i2c/busses/i2c-mv64xxx.c +9 −7
  342. drivers/i2c/busses/i2c-s3c2410.c +0 −2
  343. drivers/iio/accel/bma180.c +2 −2
  344. drivers/iio/adc/at91_adc.c +6 −5
  345. drivers/iio/amplifiers/ad8366.c +1 −3
  346. drivers/iio/buffer_cb.c +2 −0
  347. drivers/iio/dac/mcp4725.c +6 −6
  348. drivers/iio/iio_core.h +4 −0
  349. drivers/iio/industrialio-buffer.c +28 −2
  350. drivers/iio/industrialio-core.c +22 −11
  351. drivers/iio/industrialio-event.c +14 −6
  352. drivers/iio/magnetometer/st_magn_core.c +9 −9
  353. drivers/iio/temperature/tmp006.c +4 −2
  354. drivers/infiniband/ulp/srpt/ib_srpt.c +6 −8
  355. drivers/iommu/arm-smmu.c +7 −6
  356. drivers/isdn/hardware/mISDN/hfcpci.c +2 −2
  357. drivers/isdn/hisax/amd7930_fn.c +2 −2
  358. drivers/isdn/hisax/avm_pci.c +2 −2
  359. drivers/isdn/hisax/config.c +1 −1
  360. drivers/isdn/hisax/diva.c +2 −2
  361. drivers/isdn/hisax/elsa.c +1 −1
  362. drivers/isdn/hisax/elsa_ser.c +1 −1
  363. drivers/isdn/hisax/hfc_pci.c +1 −1
  364. drivers/isdn/hisax/hfc_sx.c +1 −1
  365. drivers/isdn/hisax/hscx_irq.c +2 −2
  366. drivers/isdn/hisax/icc.c +2 −2
  367. drivers/isdn/hisax/ipacx.c +4 −4
  368. drivers/isdn/hisax/isac.c +2 −2
  369. drivers/isdn/hisax/isar.c +3 −3
  370. drivers/isdn/hisax/jade.c +5 −13
  371. drivers/isdn/hisax/jade_irq.c +2 −2
  372. drivers/isdn/hisax/l3_1tr6.c +18 −32
  373. drivers/isdn/hisax/netjet.c +1 −1
  374. drivers/isdn/hisax/q931.c +3 −3
  375. drivers/isdn/hisax/w6692.c +4 −4
  376. drivers/mailbox/mailbox-omap2.c +0 −1
  377. drivers/md/bcache/bcache.h +3 −4
  378. drivers/md/bcache/bset.c +28 −11
  379. drivers/md/bcache/btree.c +2 −2
  380. drivers/md/bcache/journal.c +20 −13
  381. drivers/md/bcache/request.c +9 −6
  382. drivers/md/bcache/sysfs.c +7 −2
  383. drivers/md/bcache/util.c +10 −1
  384. drivers/md/bcache/util.h +9 −3
  385. drivers/md/bcache/writeback.c +20 −22
  386. drivers/md/dm-io.c +3 −4
  387. drivers/md/dm-mpath.c +14 −4
  388. drivers/md/dm-snap-persistent.c +1 −1
  389. drivers/md/dm-snap.c +2 −3
  390. drivers/md/dm-stats.c +17 −6
  391. drivers/md/dm-thin.c +11 −3
  392. drivers/md/dm.c +67 −4
  393. drivers/md/dm.h +3 −0
  394. drivers/misc/mei/amthif.c +1 −0
  395. drivers/misc/mei/bus.c +4 −1
  396. drivers/misc/mei/client.h +6 −0
  397. drivers/misc/mei/hbm.c +6 −4
  398. drivers/misc/mei/init.c +3 −0
  399. drivers/misc/mei/main.c +4 −7
  400. drivers/misc/mei/mei_dev.h +3 −3
  401. drivers/mmc/host/sh_mobile_sdhi.c +8 −8
  402. drivers/mtd/nand/pxa3xx_nand.c +0 −7
  403. drivers/net/bonding/bond_alb.c +1 −1
  404. drivers/net/bonding/bond_alb.h +5 −4
  405. drivers/net/bonding/bond_main.c +11 −3
  406. drivers/net/bonding/bond_sysfs.c +39 −0
  407. drivers/net/bonding/bonding.h +1 −0
  408. drivers/net/can/flexcan.c +0 −12
  409. drivers/net/can/slcan.c +90 −49
  410. drivers/net/can/usb/peak_usb/pcan_usb_core.c +11 −4
  411. drivers/net/ethernet/adi/bfin_mac.c +2 −2
  412. drivers/net/ethernet/amd/sun3lance.c +1 −1
  413. drivers/net/ethernet/atheros/alx/main.c +2 −7
  414. drivers/net/ethernet/broadcom/bgmac.c +31 −13
  415. drivers/net/ethernet/broadcom/bgmac.h +3 −1
  416. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +33 −4
  417. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +5 −6
  418. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +2 −2
  419. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +99 −90
  420. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +24 −14
  421. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +4 −1
  422. drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +24 −26
  423. drivers/net/ethernet/broadcom/cnic.c +4 −2
  424. drivers/net/ethernet/broadcom/tg3.c +3 −3
  425. drivers/net/ethernet/broadcom/tg3.h +0 −1
  426. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +3 −1
  427. drivers/net/ethernet/dec/tulip/de4x5.c +1 −1
  428. drivers/net/ethernet/emulex/benet/be.h +2 −0
  429. drivers/net/ethernet/emulex/benet/be_cmds.c +9 −0
  430. drivers/net/ethernet/emulex/benet/be_cmds.h +3 −1
  431. drivers/net/ethernet/emulex/benet/be_main.c +47 −31
  432. drivers/net/ethernet/freescale/fec_main.c +1 −1
  433. drivers/net/ethernet/freescale/gianfar_ptp.c +3 −1
  434. drivers/net/ethernet/hp/hp100.c +1 −1
  435. drivers/net/ethernet/ibm/ehea/ehea_main.c +16 −5
  436. drivers/net/ethernet/intel/e1000e/ethtool.c +8 −0
  437. drivers/net/ethernet/intel/e1000e/ich8lan.c +8 −5
  438. drivers/net/ethernet/intel/e1000e/ich8lan.h +1 −1
  439. drivers/net/ethernet/intel/e1000e/netdev.c +1 −1
  440. drivers/net/ethernet/intel/i40e/i40e_adminq.c +3 −4
  441. drivers/net/ethernet/intel/i40e/i40e_common.c +1 −1
  442. drivers/net/ethernet/intel/i40e/i40e_main.c +82 −80
  443. drivers/net/ethernet/intel/igb/e1000_82575.c +4 −0
  444. drivers/net/ethernet/intel/igb/e1000_mac.c +9 −1
  445. drivers/net/ethernet/intel/igb/igb_ethtool.c +3 −0
  446. drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +25 −0
  447. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +17 −2
  448. drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +1 −0
  449. drivers/net/ethernet/lantiq_etop.c +2 −4
  450. drivers/net/ethernet/marvell/pxa168_eth.c +1 −2
  451. drivers/net/ethernet/marvell/skge.c +8 −4
  452. drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +10 −6
  453. drivers/net/ethernet/micrel/ks8851_mll.c +1 −1
  454. drivers/net/ethernet/moxa/moxart_ether.c +1 −1
  455. drivers/net/ethernet/natsemi/jazzsonic.c +1 −2
  456. drivers/net/ethernet/natsemi/xtsonic.c +1 −2
  457. drivers/net/ethernet/pasemi/pasemi_mac.c +2 −2
  458. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +8 −0
  459. drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +37 −2
  460. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +1 −0
  461. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c +7 −1
  462. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +12 −0
  463. drivers/net/ethernet/qlogic/qlge/qlge_dbg.c +2 −2
  464. drivers/net/ethernet/qlogic/qlge/qlge_mpi.c +1 −1
  465. drivers/net/ethernet/realtek/r8169.c +1 −0
  466. drivers/net/ethernet/sfc/Kconfig +1 −1
  467. drivers/net/ethernet/sfc/ef10.c +37 −21
  468. drivers/net/ethernet/sfc/mcdi.c +5 −5
  469. drivers/net/ethernet/sfc/mcdi_port.c +2 −0
  470. drivers/net/ethernet/sfc/nic.h +3 −0
  471. drivers/net/ethernet/smsc/smc91x.h +1 −1
  472. drivers/net/ethernet/smsc/smsc9420.c +1 −2
  473. drivers/net/ethernet/toshiba/ps3_gelic_net.c +1 −1
  474. drivers/net/ethernet/via/via-rhine.c +7 −2
  475. drivers/net/ethernet/xilinx/ll_temac_main.c +6 −0
  476. drivers/net/irda/mcs7780.c +23 −17
  477. drivers/net/loopback.c +1 −0
  478. drivers/net/netconsole.c +1 −4
  479. drivers/net/phy/cicada.c +2 −2
  480. drivers/net/ppp/pptp.c +1 −1
  481. drivers/net/slip/slip.c +3 −0
  482. drivers/net/tun.c +8 −3
  483. drivers/net/usb/cdc_ether.c +42 −73
  484. drivers/net/usb/dm9601.c +1 −1
  485. drivers/net/usb/qmi_wwan.c +1 −1
  486. drivers/net/usb/usbnet.c +21 −6
  487. drivers/net/vxlan.c +24 −25
  488. drivers/net/wireless/ath/ath9k/recv.c +0 −7
  489. drivers/net/wireless/ath/ath9k/xmit.c +14 −3
  490. drivers/net/wireless/brcm80211/Kconfig +2 −2
  491. drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +13 −15
  492. drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h +2 −1
  493. drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +8 −6
  494. drivers/net/wireless/brcm80211/brcmfmac/usb.c +1 −1
  495. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +4 −0
  496. drivers/net/wireless/cw1200/cw1200_spi.c +13 −3
  497. drivers/net/wireless/mwifiex/11n_aggr.c +2 −1
  498. drivers/net/wireless/mwifiex/11n_aggr.h +1 −1
  499. drivers/net/wireless/mwifiex/cmdevt.c +2 −3
  500. drivers/net/wireless/mwifiex/usb.c +0 −7
  501. drivers/net/wireless/mwifiex/wmm.c +1 −2
  502. drivers/net/wireless/p54/p54usb.c +2 −0
  503. drivers/net/wireless/rt2x00/rt2800lib.c +6 −5
  504. drivers/net/wireless/rtl818x/rtl8187/dev.c +10 −5
  505. drivers/net/wireless/rtlwifi/wifi.h +1 −1
  506. drivers/net/xen-netback/common.h +1 −0
  507. drivers/net/xen-netback/interface.c +11 −17
  508. drivers/net/xen-netback/netback.c +64 −30
  509. drivers/net/xen-netback/xenbus.c +123 −28
  510. drivers/pci/pci-acpi.c +3 −3
  511. drivers/pci/pci.c +7 −1
  512. drivers/pinctrl/pinconf.c +2 −2
  513. drivers/pinctrl/pinctrl-exynos.c +6 −6
  514. drivers/pinctrl/pinctrl-palmas.c +3 −2
  515. drivers/pinctrl/pinctrl-tegra114.c +2 −3
  516. drivers/regulator/da9063-regulator.c +1 −1
  517. drivers/regulator/palmas-regulator.c +7 −7
  518. drivers/regulator/ti-abb-regulator.c +14 −2
  519. drivers/regulator/wm831x-ldo.c +2 −2
  520. drivers/regulator/wm8350-regulator.c +1 −1
  521. drivers/scsi/bnx2fc/bnx2fc.h +1 −1
  522. drivers/scsi/bnx2fc/bnx2fc_hwi.c +1 −2
  523. drivers/scsi/bnx2i/bnx2i.h +1 −1
  524. drivers/scsi/bnx2i/bnx2i_hwi.c +1 −2
  525. drivers/staging/comedi/Kconfig +17 −16
  526. drivers/staging/comedi/drivers/ni_65xx.c +10 −15
  527. drivers/staging/dgap/dgap_driver.c +10 −7
  528. drivers/staging/dgnc/dgnc_driver.c +2 −2
  529. drivers/staging/iio/Kconfig +1 −1
  530. drivers/staging/iio/light/isl29018.c +1 −0
  531. drivers/staging/iio/magnetometer/hmc5843.c +1 −1
  532. drivers/staging/iio/meter/ade7854-spi.c +1 −1
  533. drivers/staging/imx-drm/imx-drm-core.c +3 −8
  534. drivers/staging/line6/toneport.c +7 −3
  535. drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +1 −1
  536. drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +1 −1
  537. drivers/staging/lustre/lustre/Kconfig +2 −2
  538. drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +2 −2
  539. drivers/staging/lustre/lustre/libcfs/workitem.c +1 −1
  540. drivers/staging/lustre/lustre/obdecho/echo_client.c +1 −1
  541. drivers/staging/lustre/lustre/ptlrpc/pinger.c +2 −2
  542. drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +4 −4
  543. drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +2 −2
  544. drivers/staging/lustre/lustre/ptlrpc/service.c +3 −3
  545. drivers/staging/octeon-usb/cvmx-usb.c +1 −1
  546. drivers/staging/octeon/ethernet-mem.c +1 −6
  547. drivers/staging/octeon/ethernet-rgmii.c +1 −3
  548. drivers/staging/octeon/ethernet-rx.c +1 −4
  549. drivers/staging/rtl8188eu/core/rtw_ieee80211.c +1 −1
  550. drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +7 −7
  551. drivers/staging/rtl8188eu/core/rtw_mp.c +1 −1
  552. drivers/staging/rtl8188eu/core/rtw_wlan_util.c +1 −1
  553. drivers/staging/rtl8188eu/hal/rtl8188e_dm.c +1 −1
  554. drivers/staging/rtl8188eu/include/odm.h +1 −1
  555. drivers/staging/rtl8188eu/include/rtl8188e_hal.h +1 −1
  556. drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +1 −0
  557. drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +1 −1
  558. drivers/staging/rtl8188eu/os_dep/usb_intf.c +1 −0
  559. drivers/staging/rtl8192u/r819xU_cmdpkt.c +2 −0
  560. drivers/staging/vt6656/card.c +2 −2
  561. drivers/staging/vt6656/iwctl.c +3 −0
  562. drivers/staging/vt6656/main_usb.c +2 −1
  563. drivers/staging/vt6656/rxtx.c +2 −0
  564. drivers/staging/xillybus/xillybus_core.c +1 −1
  565. drivers/staging/zram/zram_drv.c +0 −1
  566. drivers/target/iscsi/iscsi_target.c +9 −4
  567. drivers/target/iscsi/iscsi_target_nego.c +1 −1
  568. drivers/target/iscsi/iscsi_target_util.c +2 −2
  569. drivers/target/target_core_sbc.c +26 −2
  570. drivers/target/target_core_transport.c +15 −5
  571. drivers/target/target_core_xcopy.c +2 −2
  572. drivers/tty/hvc/hvc_xen.c +1 −0
  573. drivers/tty/n_tty.c +27 −22
  574. drivers/tty/serial/pch_uart.c +3 −10
  575. drivers/tty/serial/serial-tegra.c +3 −1
  576. drivers/tty/tty_ioctl.c +3 −0
  577. drivers/usb/chipidea/Kconfig +1 −1
  578. drivers/usb/chipidea/ci_hdrc_imx.c +5 −2
  579. drivers/usb/chipidea/ci_hdrc_pci.c +6 −1
  580. drivers/usb/chipidea/core.c +1 −0
  581. drivers/usb/chipidea/udc.c +3 −1
  582. drivers/usb/core/devio.c +16 −0
  583. drivers/usb/core/hub.c +3 −0
  584. drivers/usb/dwc3/Kconfig +0 −1
  585. drivers/usb/dwc3/dwc3-pci.c +4 −0
  586. drivers/usb/dwc3/gadget.c +2 −4
  587. drivers/usb/gadget/cdc2.c +1 −18
  588. drivers/usb/gadget/dummy_hcd.c +4 −3
  589. drivers/usb/gadget/f_ecm.c +1 −1
  590. drivers/usb/gadget/f_eem.c +1 −1
  591. drivers/usb/gadget/f_fs.c +28 −34
  592. drivers/usb/gadget/f_mass_storage.c +2 −0
  593. drivers/usb/gadget/fotg210-udc.c +1 −1
  594. drivers/usb/gadget/fusb300_udc.c +1 −1
  595. drivers/usb/gadget/multi.c +4 −4
  596. drivers/usb/gadget/mv_u3d_core.c +3 −0
  597. drivers/usb/gadget/pxa25x_udc.c +5 −4
  598. drivers/usb/gadget/s3c-hsotg.c +5 −10
  599. drivers/usb/host/ehci-fsl.c +7 −12
  600. drivers/usb/host/ehci-grlib.c +1 −1
  601. drivers/usb/host/ehci-hcd.c +1 −1
  602. drivers/usb/host/ehci-mv.c +1 −1
  603. drivers/usb/host/ehci-octeon.c +1 −1
  604. drivers/usb/host/ehci-pci.c +1 −1
  605. drivers/usb/host/ehci-pmcmsp.c +1 −1
  606. drivers/usb/host/ehci-ppc-of.c +1 −1
  607. drivers/usb/host/ehci-ps3.c +1 −1
  608. drivers/usb/host/ehci-q.c +5 −0
  609. drivers/usb/host/ehci-sead3.c +1 −1
  610. drivers/usb/host/ehci-sh.c +1 −1
  611. drivers/usb/host/ehci-tilegx.c +1 −1
  612. drivers/usb/host/ehci-w90x900.c +1 −1
  613. drivers/usb/host/ehci-xilinx-of.c +1 −1
  614. drivers/usb/host/fsl-mph-dr-of.c +3 −3
  615. drivers/usb/host/imx21-hcd.c +4 −4
  616. drivers/usb/host/ohci-hcd.c +12 −10
  617. drivers/usb/host/ohci-q.c +22 −4
  618. drivers/usb/host/uhci-pci.c +1 −1
  619. drivers/usb/host/uhci-q.c +8 −4
  620. drivers/usb/host/xhci-hub.c +36 −11
  621. drivers/usb/host/xhci-mem.c +2 −0
  622. drivers/usb/host/xhci-pci.c +1 −1
  623. drivers/usb/host/xhci-ring.c +35 −2
  624. drivers/usb/host/xhci.c +5 −20
  625. drivers/usb/host/xhci.h +11 −0
  626. drivers/usb/musb/musb_dsps.c +3 −0
  627. drivers/usb/musb/musb_gadget.c +4 −1
  628. drivers/usb/phy/phy-gpio-vbus-usb.c +5 −6
  629. drivers/usb/phy/phy-omap-usb3.c +1 −1
  630. drivers/usb/serial/Kconfig +1 −1
  631. drivers/usb/serial/option.c +3 −0
  632. drivers/usb/serial/pl2303.c +32 −11
  633. drivers/vhost/scsi.c +34 −16
  634. drivers/vhost/vhost.c +3 −1
  635. drivers/video/mmp/hw/mmp_ctrl.c +2 −15
  636. drivers/video/mxsfb.c +1 −0
  637. drivers/video/neofb.c +3 −1
  638. drivers/video/of_display_timing.c +3 −3
  639. drivers/video/omap2/displays-new/Kconfig +1 −0
  640. drivers/video/omap2/displays-new/connector-analog-tv.c +1 −1
  641. drivers/video/omap2/displays-new/connector-dvi.c +1 −1
  642. drivers/video/omap2/displays-new/connector-hdmi.c +1 −1
  643. drivers/video/omap2/dss/dispc.c +1 −0
  644. drivers/video/s3fb.c +1 −8
  645. drivers/xen/balloon.c +11 −12
  646. fs/9p/v9fs.c +4 −3
  647. fs/9p/vfs_inode_dotl.c +1 −7
  648. fs/afs/dir.c +0 −3
  649. fs/aio.c +37 −15
  650. fs/autofs4/waitq.c +3 −10
  651. fs/binfmt_elf.c +18 −12
  652. fs/bio-integrity.c +1 −1
  653. fs/bio.c +2 −2
  654. fs/btrfs/async-thread.c +19 −6
  655. fs/btrfs/async-thread.h +2 −0
  656. fs/btrfs/btrfs_inode.h +4 −1
  657. fs/btrfs/ctree.c +5 −2
  658. fs/btrfs/ctree.h +4 −13
  659. fs/btrfs/dev-replace.c +3 −6
  660. fs/btrfs/disk-io.c +2 −0
  661. fs/btrfs/extent-tree.c +30 −27
  662. fs/btrfs/extent_io.c +14 −4
  663. fs/btrfs/file.c +2 −2
  664. fs/btrfs/free-space-cache.c +47 −20
  665. fs/btrfs/free-space-cache.h +3 −2
  666. fs/btrfs/inode.c +11 −5
  667. fs/btrfs/ioctl.c +47 −33
  668. fs/btrfs/ordered-data.c +3 −21
  669. fs/btrfs/ordered-data.h +2 −3
  670. fs/btrfs/relocation.c +25 −18
  671. fs/btrfs/scrub.c +98 −14
  672. fs/btrfs/super.c +20 −1
  673. fs/btrfs/transaction.c +3 −6
  674. fs/btrfs/tree-log.c +48 −4
  675. fs/btrfs/volumes.c +10 −4
  676. fs/cachefiles/namei.c +1 −1
  677. fs/cachefiles/xattr.c +15 −14
  678. fs/cifs/cifsfs.h +1 −1
  679. fs/cifs/cifsglob.h +1 −4
  680. fs/cifs/cifspdu.h +1 −20
  681. fs/cifs/cifssmb.c +0 −1
  682. fs/cifs/dir.c +1 −0
  683. fs/cifs/file.c +8 −0
  684. fs/cifs/fscache.c +7 −0
  685. fs/cifs/fscache.h +13 −0
  686. fs/cifs/inode.c +39 −6
  687. fs/cifs/readdir.c +3 −0
  688. fs/cifs/sess.c +1 −83
  689. fs/fscache/cookie.c +2 −1
  690. fs/fuse/dir.c +13 −7
  691. fs/fuse/file.c +17 −6
  692. fs/fuse/fuse_i.h +2 −0
  693. fs/gfs2/inode.c +3 −1
  694. fs/namei.c +22 −12
  695. fs/nfs/dir.c +4 −1
  696. fs/nfs/nfs4file.c +2 −1
  697. fs/nfs/nfs4filelayoutdev.c +11 −9
  698. fs/nfs/nfs4proc.c +47 −11
  699. fs/nilfs2/page.c +2 −0
  700. fs/nilfs2/segment.c +9 −2
  701. fs/ocfs2/dcache.c +4 −3
  702. fs/ocfs2/super.c +1 −1
  703. fs/open.c +18 −3
  704. fs/pstore/platform.c +23 −6
  705. fs/reiserfs/journal.c +4 −63
  706. fs/super.c +2 −2
  707. fs/sysv/super.c +1 −0
  708. fs/udf/ialloc.c +7 −9
  709. fs/udf/super.c +40 −24
  710. fs/udf/udf_sb.h +1 −1
  711. fs/xfs/xfs_buf_item.c +1 −0
  712. fs/xfs/xfs_da_btree.c +3 −2
  713. fs/xfs/xfs_dir2_block.c +3 −3
  714. fs/xfs/xfs_dir2_format.h +20 −31
  715. fs/xfs/xfs_dir2_readdir.c +2 −2
  716. fs/xfs/xfs_dir2_sf.c +3 −3
  717. fs/xfs/xfs_dquot.c +16 −3
  718. fs/xfs/xfs_fs.h +1 −1
  719. fs/xfs/xfs_icache.c +4 −5
  720. fs/xfs/xfs_log_recover.c +60 −14
  721. include/asm-generic/hugetlb.h +2 −2
  722. include/asm-generic/vtime.h +1 −0
  723. include/drm/drmP.h +3 −4
  724. include/drm/drm_pciids.h +3 −0
  725. include/linux/balloon_compaction.h +25 −0
  726. include/linux/bcma/bcma_driver_pci.h +1 −0
  727. include/linux/blkdev.h +11 −0
  728. include/linux/ceph/osd_client.h +2 −0
  729. include/linux/device-mapper.h +2 −1
  730. include/linux/hyperv.h +5 −2
  731. include/linux/intel-iommu.h +1 −1
  732. include/linux/kernel.h +11 −0
  733. include/linux/memcontrol.h +10 −45
  734. include/linux/mutex.h +3 −3
  735. include/linux/netdevice.h +4 −4
  736. include/linux/netfilter/ipset/ip_set.h +4 −2
  737. include/linux/nfs_xdr.h +2 −1
  738. include/linux/of_irq.h +8 −12
  739. include/linux/regulator/driver.h +2 −0
  740. include/linux/skbuff.h +1 −1
  741. include/linux/smp.h +6 −0
  742. include/linux/timex.h +1 −0
  743. include/linux/usb/usbnet.h +1 −0
  744. include/net/addrconf.h +4 −0
  745. include/net/bluetooth/hci.h +1 −0
  746. include/net/ip.h +8 −4
  747. include/net/ip_vs.h +3 −6
  748. include/net/mrp.h +1 −0
  749. include/net/net_namespace.h +1 −0
  750. include/net/netfilter/nf_conntrack_extend.h +1 −1
  751. include/net/netfilter/nf_conntrack_synproxy.h +1 −1
  752. include/net/secure_seq.h +0 −1
  753. include/net/sock.h +5 −0
  754. include/trace/events/block.h +4 −2
  755. include/trace/events/btrfs.h +1 −0
  756. include/uapi/drm/radeon_drm.h +2 −0
  757. include/uapi/linux/perf_event.h +10 −5
  758. ipc/msg.c +26 −6
  759. ipc/sem.c +141 −73
  760. ipc/shm.c +12 −5
  761. ipc/util.c +12 −20
  762. ipc/util.h +9 −1
  763. kernel/audit.c +3 −2
  764. kernel/context_tracking.c +12 −0
  765. kernel/events/core.c +21 −0
  766. kernel/kmod.c +4 −0
  767. kernel/params.c +3 −3
  768. kernel/pid.c +5 −0
  769. kernel/power/snapshot.c +4 −1
  770. kernel/power/user.c +8 −0
  771. kernel/reboot.c +8 −1
  772. kernel/softirq.c +12 −3
  773. kernel/time/ntp.c +2 −4
  774. kernel/time/timekeeping.c +2 −0
  775. kernel/watchdog.c +55 −5
  776. lib/hexdump.c +2 −0
  777. lib/kobject.c +1 −4
  778. lib/lockref.c +20 −3
  779. mm/Kconfig +1 −1
  780. mm/bounce.c +2 −0
  781. mm/compaction.c +7 −0
  782. mm/hwpoison-inject.c +3 −2
  783. mm/madvise.c +3 −2
  784. mm/memcontrol.c +407 −153
  785. mm/memory-failure.c +5 −3
  786. mm/migrate.c +1 −1
  787. mm/mlock.c +7 −2
  788. mm/page_alloc.c +0 −4
  789. mm/vmscan.c +34 −53
  790. net/802/mrp.c +27 −0
  791. net/batman-adv/soft-interface.c +2 −0
  792. net/bluetooth/hci_core.c +20 −6
  793. net/bluetooth/hci_event.c +5 −1
  794. net/bluetooth/l2cap_core.c +7 −0
  795. net/bluetooth/rfcomm/tty.c +2 −33
  796. net/bridge/br_netlink.c +2 −2
  797. net/bridge/br_private.h +3 −5
  798. net/bridge/br_stp.c +16 −7
  799. net/bridge/br_stp_if.c +10 −2
  800. net/ceph/osd_client.c +11 −0
  801. net/core/dev.c +48 −1
  802. net/core/flow_dissector.c +2 −2
  803. net/core/netpoll.c +5 −6
  804. net/core/secure_seq.c +24 −3
  805. net/dccp/ipv6.c +1 −0
  806. net/ipv4/af_inet.c +1 −3
  807. net/ipv4/igmp.c +4 −4
  808. net/ipv4/inetpeer.c +2 −2
  809. net/ipv4/ip_output.c +4 −4
  810. net/ipv4/ip_tunnel.c +11 −11
  811. net/ipv4/ip_tunnel_core.c +1 −1
  812. net/ipv4/ipmr.c +1 −1
  813. net/ipv4/netfilter/ipt_SYNPROXY.c +7 −3
  814. net/ipv4/raw.c +4 −2
  815. net/ipv4/tcp_metrics.c +3 −1
  816. net/ipv4/tcp_output.c +11 −6
  817. net/ipv4/udp.c +1 −1
  818. net/ipv4/xfrm4_mode_tunnel.c +1 −1
  819. net/ipv6/addrconf.c +42 −37
  820. net/ipv6/ip6_gre.c +2 −2
  821. net/ipv6/ip6_output.c +22 −31
  822. net/ipv6/ip6_tunnel.c +3 −4
  823. net/ipv6/mcast.c +3 −3
  824. net/ipv6/netfilter/ip6t_SYNPROXY.c +7 −3
  825. net/ipv6/netfilter/nf_nat_proto_icmpv6.c +2 −2
  826. net/ipv6/raw.c +3 −1
  827. net/ipv6/sit.c +70 −16
  828. net/ipv6/udp.c +3 −1
  829. net/lapb/lapb_timer.c +1 −0
  830. net/netfilter/ipset/ip_set_core.c +2 −3
  831. net/netfilter/ipset/ip_set_getport.c +2 −2
  832. net/netfilter/ipset/ip_set_hash_gen.h +16 −12
  833. net/netfilter/ipset/ip_set_hash_ipportnet.c +2 −2
  834. net/netfilter/ipset/ip_set_hash_net.c +2 −2
  835. net/netfilter/ipset/ip_set_hash_netiface.c +2 −2
  836. net/netfilter/ipset/ip_set_hash_netport.c +2 −2
  837. net/netfilter/ipvs/ip_vs_core.c +10 −2
  838. net/netfilter/ipvs/ip_vs_ctl.c +35 −51
  839. net/netfilter/ipvs/ip_vs_est.c +3 −1
  840. net/netfilter/ipvs/ip_vs_lblc.c +33 −39
  841. net/netfilter/ipvs/ip_vs_lblcr.c +26 −36
  842. net/netfilter/ipvs/ip_vs_nq.c +4 −4
  843. net/netfilter/ipvs/ip_vs_sed.c +4 −4
  844. net/netfilter/ipvs/ip_vs_wlc.c +3 −3
  845. net/netfilter/ipvs/ip_vs_xmit.c +1 −1
  846. net/netfilter/nf_synproxy_core.c +7 −5
  847. net/netfilter/nfnetlink_queue_core.c +1 −1
  848. net/sched/sch_fq.c +63 −39
  849. net/sctp/input.c +1 −2
  850. net/sctp/ipv6.c +14 −30
  851. net/sunrpc/auth_gss/auth_gss.c +11 −0
  852. net/sysctl_net.c +2 −2
  853. scripts/checkpatch.pl +2 −2
  854. security/apparmor/crypto.c +16 −18
  855. security/apparmor/include/policy.h +3 −1
  856. security/apparmor/policy.c +2 −1
  857. security/selinux/avc.c +3 −6
  858. security/selinux/hooks.c +7 −8
  859. security/selinux/include/avc.h +5 −13
  860. sound/core/compress_offload.c +14 −1
  861. sound/pci/ac97/ac97_codec.c +1 −0
  862. sound/pci/hda/patch_cirrus.c +67 −5
  863. sound/pci/hda/patch_conexant.c +11 −0
  864. sound/pci/hda/patch_hdmi.c +29 −18
  865. sound/pci/hda/patch_realtek.c +15 −1
  866. sound/soc/blackfin/bf6xx-i2s.c +1 −0
  867. sound/soc/codecs/88pm860x-codec.c +3 −0
  868. sound/soc/codecs/ab8500-codec.c +6 −1
  869. sound/soc/codecs/max98095.c +2 −2
  870. sound/soc/fsl/imx-sgtl5000.c +5 −2
  871. sound/soc/soc-core.c +0 −1
  872. tools/lib/lk/debugfs.c +0 −1
  873. tools/perf/arch/x86/util/tsc.c +3 −3
  874. tools/perf/builtin-inject.c +0 −2
  875. tools/perf/builtin-kmem.c +1 −1
  876. tools/perf/builtin-report.c +3 −2
  877. tools/perf/builtin-script.c +0 −2
  878. tools/perf/builtin-trace.c +18 −0
  879. tools/perf/config/Makefile +4 −1
  880. tools/perf/config/feature-tests.mak +10 −0
  881. tools/perf/util/annotate.c +1 −1
  882. tools/perf/util/dwarf-aux.c +19 −0
  883. tools/perf/util/dwarf-aux.h +3 −0
  884. tools/perf/util/header.c +28 −13
  885. tools/perf/util/hist.c +2 −0
  886. tools/perf/util/machine.c +1 −1
  887. tools/perf/util/probe-finder.c +46 −43
  888. tools/perf/util/probe-finder.h +3 −0
  889. tools/perf/util/session.c +7 −2
  890. tools/perf/util/session.h +4 −0
  891. tools/perf/util/symbol-elf.c +16 −0
  892. tools/perf/util/trace-event-parse.c +1 −1
  893. virt/kvm/kvm_main.c +4 −2
CREDITS+1−2
@@ -2808,8 +2808,7 @@ S: Ottawa, Ontario · 2807 unmodified lines
28082808 S: Canada K2P 0X8
28092809
28102810 N: Mikael Pettersson
2811−E: mikpe@it.uu.se
2812−W: http://user.it.uu.se/~mikpe/linux/
2811+E: mikpelinux@gmail.com
28132812 D: Miscellaneous fixes
28142813
28152814 N: Reed H. Petty
Documentation/arm64/tagged-pointers.txt+7−7
@@ -18,17 +18,17 @@ this byte for application use, with the following caveats: · 17 unmodified lines
1818 parameters containing user virtual addresses *must* have
1919 their top byte cleared before trapping to the kernel.
2020
21− (2) Tags are not guaranteed to be preserved when delivering
22− signals. This means that signal handlers in applications
23− making use of tags cannot rely on the tag information for
24− user virtual addresses being maintained for fields inside
25− siginfo_t. One exception to this rule is for signals raised
26− in response to debug exceptions, where the tag information
21+ (2) Non-zero tags are not preserved when delivering signals.
22+ This means that signal handlers in applications making use
23+ of tags cannot rely on the tag information for user virtual
24+ addresses being maintained for fields inside siginfo_t.
25+ One exception to this rule is for signals raised in response
26+ to watchpoint debug exceptions, where the tag information
2727 will be preserved.
2828
2929 (3) Special care should be taken when using tagged pointers,
3030 since it is likely that C compilers will not hazard two
31− addresses differing only in the upper bits.
31+ virtual addresses differing only in the upper byte.
3232
3333 The architecture prevents the use of a tagged PC, so the upper byte will
3434 be set to a sign-extension of bit 55 on exception return.
Documentation/block/00-INDEX+2−0
@@ -6,6 +6,8 @@ capability.txt · 5 unmodified lines
66 - Generic Block Device Capability (/sys/block/<device>/capability)
77 cfq-iosched.txt
88 - CFQ IO scheduler tunables
9+cmdline-partition.txt
10+ - how to specify block device partitions on kernel command line
911 data-integrity.txt
1012 - Block data integrity
1113 deadline-iosched.txt
Documentation/block/cmdline-partition.txt+4−4
@@ -1,9 +1,9 @@
1−Embedded device command line partition
1+Embedded device command line partition parsing
22 =====================================================================
33
4−Read block device partition table from command line.
5−The partition used for fixed block device (eMMC) embedded device.
6−It is no MBR, save storage space. Bootloader can be easily accessed
4+Support for reading the block device partition table from the command line.
5+It is typically used for fixed block (eMMC) embedded devices.
6+It has no MBR, so saves storage space. Bootloader can be easily accessed
77 by absolute address of data on the block device.
88 Users can easily change the partition.
99
Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt+5−5
@@ -1,11 +1,11 @@
1−* Samsung Exynos specific extensions to the Synopsis Designware Mobile
1+* Samsung Exynos specific extensions to the Synopsys Designware Mobile
22 Storage Host Controller
33
4−The Synopsis designware mobile storage host controller is used to interface
4+The Synopsys designware mobile storage host controller is used to interface
55 a SoC with storage medium such as eMMC or SD/MMC cards. This file documents
6−differences between the core Synopsis dw mshc controller properties described
7−by synopsis-dw-mshc.txt and the properties used by the Samsung Exynos specific
8−extensions to the Synopsis Designware Mobile Storage Host Controller.
6+differences between the core Synopsys dw mshc controller properties described
7+by synopsys-dw-mshc.txt and the properties used by the Samsung Exynos specific
8+extensions to the Synopsys Designware Mobile Storage Host Controller.
99
1010 Required Properties:
1111
Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt+5−5
@@ -1,11 +1,11 @@
1−* Rockchip specific extensions to the Synopsis Designware Mobile
1+* Rockchip specific extensions to the Synopsys Designware Mobile
22 Storage Host Controller
33
4−The Synopsis designware mobile storage host controller is used to interface
4+The Synopsys designware mobile storage host controller is used to interface
55 a SoC with storage medium such as eMMC or SD/MMC cards. This file documents
6−differences between the core Synopsis dw mshc controller properties described
7−by synopsis-dw-mshc.txt and the properties used by the Rockchip specific
8−extensions to the Synopsis Designware Mobile Storage Host Controller.
6+differences between the core Synopsys dw mshc controller properties described
7+by synopsys-dw-mshc.txt and the properties used by the Rockchip specific
8+extensions to the Synopsys Designware Mobile Storage Host Controller.
99
1010 Required Properties:
1111
Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txtrenamed from Documentation/devicetree/bindings/mmc/synopsis-dw-mshc.txt+4−4
@@ -1,14 +1,14 @@
1−* Synopsis Designware Mobile Storage Host Controller
1+* Synopsys Designware Mobile Storage Host Controller
22
3−The Synopsis designware mobile storage host controller is used to interface
3+The Synopsys designware mobile storage host controller is used to interface
44 a SoC with storage medium such as eMMC or SD/MMC cards. This file documents
55 differences between the core mmc properties described by mmc.txt and the
6−properties used by the Synopsis Designware Mobile Storage Host Controller.
6+properties used by the Synopsys Designware Mobile Storage Host Controller.
77
88 Required Properties:
99
1010 * compatible: should be
11− - snps,dw-mshc: for controllers compliant with synopsis dw-mshc.
11+ - snps,dw-mshc: for controllers compliant with synopsys dw-mshc.
1212 * #address-cells: should be 1.
1313 * #size-cells: should be 0.
1414
Documentation/devicetree/bindings/mmc/tmio_mmc.txt+10−7
@@ -9,12 +9,15 @@ compulsory and any optional properties, common to all SD/MMC drivers, as · 8 unmodified lines
99 described in mmc.txt, can be used. Additionally the following tmio_mmc-specific
1010 optional bindings can be used.
1111
12+Required properties:
13+- compatible: "renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
14+ "renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC
15+ "renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
16+ "renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
17+ "renesas,sdhi-r8a7740" - SDHI IP on R8A7740 SoC
18+ "renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC
19+ "renesas,sdhi-r8a7779" - SDHI IP on R8A7779 SoC
20+ "renesas,sdhi-r8a7790" - SDHI IP on R8A7790 SoC
21+
1222 Optional properties:
1323 - toshiba,mmc-wrprotect-disable: write-protect detection is unavailable
14−
15−When used with Renesas SDHI hardware, the following compatibility strings
16−configure various model-specific properties:
17−
18−"renesas,sh7372-sdhi": (default) compatible with SH7372
19−"renesas,r8a7740-sdhi": compatible with R8A7740: certain MMC/SD commands have to
20− wait for the interface to become idle.
Documentation/devicetree/bindings/net/fsl-tsec-phy.txt+17−1
@@ -86,6 +86,7 @@ General Properties: · 85 unmodified lines
8686
8787 Clock Properties:
8888
89+ - fsl,cksel Timer reference clock source.
8990 - fsl,tclk-period Timer reference clock period in nanoseconds.
9091 - fsl,tmr-prsc Prescaler, divides the output clock.
9192 - fsl,tmr-add Frequency compensation value.
@@ -97,7 +98,7 @@ Clock Properties: · 5 unmodified lines
9798 clock. You must choose these carefully for the clock to work right.
9899 Here is how to figure good values:
99100
100− TimerOsc = system clock MHz
101+ TimerOsc = selected reference clock MHz
101102 tclk_period = desired clock period nanoseconds
102103 NominalFreq = 1000 / tclk_period MHz
103104 FreqDivRatio = TimerOsc / NominalFreq (must be greater that 1.0)
@@ -114,6 +115,20 @@ Clock Properties: · 10 unmodified lines
114115 Pulse Per Second (PPS) signal, since this will be offered to the PPS
115116 subsystem to synchronize the Linux clock.
116117
118+ Reference clock source is determined by the value, which is holded
119+ in CKSEL bits in TMR_CTRL register. "fsl,cksel" property keeps the
120+ value, which will be directly written in those bits, that is why,
121+ according to reference manual, the next clock sources can be used:
122+
123+ <0> - external high precision timer reference clock (TSEC_TMR_CLK
124+ input is used for this purpose);
125+ <1> - eTSEC system clock;
126+ <2> - eTSEC1 transmit clock;
127+ <3> - RTC clock input.
128+
129+ When this attribute is not used, eTSEC system clock will serve as
130+ IEEE 1588 timer reference clock.
131+
117132 Example:
118133
119134 ptp_clock@24E00 {
@@ -121,6 +136,7 @@ Example: · 1 unmodified line
121136 reg = <0x24E00 0xB0>;
122137 interrupts = <12 0x8 13 0x8>;
123138 interrupt-parent = < &ipic >;
139+ fsl,cksel = <1>;
124140 fsl,tclk-period = <10>;
125141 fsl,tmr-prsc = <100>;
126142 fsl,tmr-add = <0x999999A4>;
Documentation/devicetree/bindings/pci/designware-pcie.txt+1−1
@@ -1,4 +1,4 @@
1−* Synopsis Designware PCIe interface
1+* Synopsys Designware PCIe interface
22
33 Required properties:
44 - compatible: should contain "snps,dw-pcie" to identify the
Documentation/devicetree/bindings/serial/qca,ar9330-uart.txtrenamed from Documentation/devicetree/bindings/tty/serial/qca,ar9330-uart.txt+0−0

File renamed without changes.

Documentation/filesystems/vfs.txt+7−7
@@ -359,11 +359,9 @@ struct inode_operations { · 358 unmodified lines
359359 ssize_t (*listxattr) (struct dentry *, char *, size_t);
360360 int (*removexattr) (struct dentry *, const char *);
361361 void (*update_time)(struct inode *, struct timespec *, int);
362− int (*atomic_open)(struct inode *, struct dentry *,
362+ int (*atomic_open)(struct inode *, struct dentry *, struct file *,
363+ unsigned open_flag, umode_t create_mode, int *opened);
363364 int (*tmpfile) (struct inode *, struct dentry *, umode_t);
364−} ____cacheline_aligned;
365− struct file *, unsigned open_flag,
366− umode_t create_mode, int *opened);
367365 };
368366
369367 Again, all methods are called without any locks being held, unless
@@ -470,9 +468,11 @@ otherwise noted. · 100 unmodified lines
470468 method the filesystem can look up, possibly create and open the file in
471469 one atomic operation. If it cannot perform this (e.g. the file type
472470 turned out to be wrong) it may signal this by returning 1 instead of
473− usual 0 or -ve . This method is only called if the last
474− component is negative or needs lookup. Cached positive dentries are
475− still handled by f_op->open().
471+ usual 0 or -ve . This method is only called if the last component is
472+ negative or needs lookup. Cached positive dentries are still handled by
473+ f_op->open(). If the file was created, the FILE_CREATED flag should be
474+ set in "opened". In case of O_EXCL the method must only succeed if the
475+ file didn't exist and hence FILE_CREATED shall always be set on success.
476476
477477 tmpfile: called in the end of O_TMPFILE open(). Optional, equivalent to
478478 atomically creating, opening and unlinking a file in given directory.
Documentation/kernel-parameters.txt+9−1
@@ -480,6 +480,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 479 unmodified lines
480480 Format: <io>,<irq>,<mode>
481481 See header of drivers/net/hamradio/baycom_ser_hdx.c.
482482
483+ blkdevparts= Manual partition parsing of block device(s) for
484+ embedded devices based on command line input.
485+ See Documentation/block/cmdline-partition.txt
486+
483487 boot_delay= Milliseconds to delay each printk during boot.
484488 Values larger than 10 seconds (10000) are changed to
485489 no delay (0).
@@ -1357,7 +1361,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 871 unmodified lines
13571361 pages. In the event, a node is too small to have both
13581362 kernelcore and Movable pages, kernelcore pages will
13591363 take priority and other nodes will have a larger number
1360− of kernelcore pages. The Movable zone is used for the
1364+ of Movable pages. The Movable zone is used for the
13611365 allocation of pages that may be reclaimed or moved
13621366 by the page migration subsystem. This means that
13631367 HugeTLB pages may not be allocated from this zone.
@@ -3485,6 +3489,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 2121 unmodified lines
34853489 the unplug protocol
34863490 never -- do not unplug even if version check succeeds
34873491
3492+ xen_nopvspin [X86,XEN]
3493+ Disables the ticketlock slowpath using Xen PV
3494+ optimizations.
3495+
34883496 xirc2ps_cs= [NET,PCMCIA]
34893497 Format:
34903498 <irq>,<irq_mask>,<io>,<full_duplex>,<do_sound>,<lockup_hack>[,<irq2>[,<irq3>[,<irq4>]]]
Documentation/networking/bonding.txt+6−0
@@ -1362,6 +1362,12 @@ To add ARP targets: · 1361 unmodified lines
13621362 To remove an ARP target:
13631363 # echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target
13641364
1365+To configure the interval between learning packet transmits:
1366+# echo 12 > /sys/class/net/bond0/bonding/lp_interval
1367+ NOTE: the lp_inteval is the number of seconds between instances where
1368+the bonding driver sends learning packets to each slaves peer switch. The
1369+default interval is 1 second.
1370+
13651371 Example Configuration
13661372 ---------------------
13671373 We begin with the same example that is shown in section 3.3,
Documentation/sound/alsa/HD-Audio-Models.txt+6−0
@@ -296,6 +296,12 @@ Cirrus Logic CS4206/4207 · 295 unmodified lines
296296 imac27 IMac 27 Inch
297297 auto BIOS setup (default)
298298
299+Cirrus Logic CS4208
300+===================
301+ mba6 MacBook Air 6,1 and 6,2
302+ gpio0 Enable GPIO 0 amp
303+ auto BIOS setup (default)
304+
299305 VIA VT17xx/VT18xx/VT20xx
300306 ========================
301307 auto BIOS setup (default)
MAINTAINERS+33−7
@@ -824,15 +824,21 @@ S: Maintained · 823 unmodified lines
824824 F: arch/arm/mach-gemini/
825825
826826 ARM/CSR SIRFPRIMA2 MACHINE SUPPORT
827−M: Barry Song <baohua.song@csr.com>
827+M: Barry Song <baohua@kernel.org>
828828 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
829829 T: git git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux.git
830830 S: Maintained
831831 F: arch/arm/mach-prima2/
832+F: drivers/clk/clk-prima2.c
833+F: drivers/clocksource/timer-prima2.c
834+F: drivers/clocksource/timer-marco.c
832835 F: drivers/dma/sirf-dma.c
833836 F: drivers/i2c/busses/i2c-sirf.c
837+F: drivers/input/misc/sirfsoc-onkey.c
838+F: drivers/irqchip/irq-sirfsoc.c
834839 F: drivers/mmc/host/sdhci-sirf.c
835840 F: drivers/pinctrl/sirf/
841+F: drivers/rtc/rtc-sirfsoc.c
836842 F: drivers/spi/spi-sirf.c
837843
838844 ARM/EBSA110 MACHINE SUPPORT
@@ -1812,7 +1818,8 @@ S: Supported · 973 unmodified lines
18121818 F: drivers/net/ethernet/broadcom/bnx2x/
18131819
18141820 BROADCOM BCM281XX/BCM11XXX ARM ARCHITECTURE
1815−M: Christian Daudt <csd@broadcom.com>
1821+M: Christian Daudt <bcm@fixthebug.org>
1822+L: bcm-kernel-feedback-list@broadcom.com
18161823 T: git git://git.github.com/broadcom/bcm11351
18171824 S: Maintained
18181825 F: arch/arm/mach-bcm/
@@ -2639,6 +2646,18 @@ F: include/linux/device-mapper.h · 820 unmodified lines
26392646 F: include/linux/dm-*.h
26402647 F: include/uapi/linux/dm-*.h
26412648
2649+DIGI NEO AND CLASSIC PCI PRODUCTS
2650+M: Lidza Louina <lidza.louina@gmail.com>
2651+L: driverdev-devel@linuxdriverproject.org
2652+S: Maintained
2653+F: drivers/staging/dgnc/
2654+
2655+DIGI EPCA PCI PRODUCTS
2656+M: Lidza Louina <lidza.louina@gmail.com>
2657+L: driverdev-devel@linuxdriverproject.org
2658+S: Maintained
2659+F: drivers/staging/dgap/
2660+
26422661 DIOLAN U2C-12 I2C DRIVER
26432662 M: Guenter Roeck <linux@roeck-us.net>
26442663 L: linux-i2c@vger.kernel.org
@@ -4457,6 +4476,13 @@ L: linux-serial@vger.kernel.org · 1812 unmodified lines
44574476 S: Maintained
44584477 F: drivers/tty/serial/ioc3_serial.c
44594478
4479+IOMMU DRIVERS
4480+M: Joerg Roedel <joro@8bytes.org>
4481+L: iommu@lists.linux-foundation.org
4482+T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
4483+S: Maintained
4484+F: drivers/iommu/
4485+
44604486 IP MASQUERADING
44614487 M: Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
44624488 S: Maintained
@@ -6595,7 +6621,7 @@ S: Obsolete · 2132 unmodified lines
65956621 F: drivers/net/wireless/prism54/
65966622
65976623 PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER
6598−M: Mikael Pettersson <mikpe@it.uu.se>
6624+M: Mikael Pettersson <mikpelinux@gmail.com>
65996625 L: linux-ide@vger.kernel.org
66006626 S: Maintained
66016627 F: drivers/ata/sata_promise.*
@@ -7260,9 +7286,9 @@ F: kernel/wait.c · 658 unmodified lines
72607286 F: include/linux/wait.h
72617287
72627288 SCORE ARCHITECTURE
7263−M: Chen Liqin <liqin.chen@sunplusct.com>
7289+M: Chen Liqin <liqin.linux@gmail.com>
72647290 M: Lennox Wu <lennox.wu@gmail.com>
7265−W: http://www.sunplusct.com
7291+W: http://www.sunplus.com
72667292 S: Supported
72677293 F: arch/score/
72687294
@@ -8726,9 +8752,8 @@ F: Documentation/hid/hiddev.txt · 1457 unmodified lines
87268752 F: drivers/hid/usbhid/
87278753
87288754 USB/IP DRIVERS
8729−M: Matt Mooney <mfm@muteddisk.com>
87308755 L: linux-usb@vger.kernel.org
8731−S: Maintained
8756+S: Orphan
87328757 F: drivers/staging/usbip/
87338758
87348759 USB ISP116X DRIVER
@@ -9368,6 +9393,7 @@ F: arch/arm64/include/asm/xen/ · 633 unmodified lines
93689393
93699394 XEN NETWORK BACKEND DRIVER
93709395 M: Ian Campbell <ian.campbell@citrix.com>
9396+M: Wei Liu <wei.liu2@citrix.com>
93719397 L: xen-devel@lists.xenproject.org (moderated for non-subscribers)
93729398 L: netdev@vger.kernel.org
93739399 S: Supported
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 12
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc1
4+EXTRAVERSION = -rc4
55 NAME = One Giant Leap for Frogkind
66
77 # *DOCUMENTATION*
arch/Kconfig+0−3
@@ -286,9 +286,6 @@ config HAVE_PERF_USER_STACK_DUMP · 285 unmodified lines
286286 config HAVE_ARCH_JUMP_LABEL
287287 bool
288288
289−config HAVE_ARCH_MUTEX_CPU_RELAX
290− bool
291−
292289 config HAVE_RCU_TABLE_FREE
293290 bool
294291
arch/arc/include/asm/spinlock.h+8−1
@@ -45,7 +45,14 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) · 44 unmodified lines
4545
4646 static inline void arch_spin_unlock(arch_spinlock_t *lock)
4747 {
48− lock->slock = __ARCH_SPIN_LOCK_UNLOCKED__;
48+ unsigned int tmp = __ARCH_SPIN_LOCK_UNLOCKED__;
49+
50+ __asm__ __volatile__(
51+ " ex %0, [%1] \n"
52+ : "+r" (tmp)
53+ : "r"(&(lock->slock))
54+ : "memory");
55+
4956 smp_mb();
5057 }
5158
arch/arc/include/asm/uaccess.h+2−2
@@ -43,7 +43,7 @@ · 42 unmodified lines
4343 * Because it essentially checks if buffer end is within limit and @len is
4444 * non-ngeative, which implies that buffer start will be within limit too.
4545 *
46− * The reason for rewriting being, for majorit yof cases, @len is generally
46+ * The reason for rewriting being, for majority of cases, @len is generally
4747 * compile time constant, causing first sub-expression to be compile time
4848 * subsumed.
4949 *
@@ -53,7 +53,7 @@ · 3 unmodified lines
5353 *
5454 */
5555 #define __user_ok(addr, sz) (((sz) <= TASK_SIZE) && \
56− (((addr)+(sz)) <= get_fs()))
56+ ((addr) <= (get_fs() - (sz))))
5757 #define __access_ok(addr, sz) (unlikely(__kernel_ok) || \
5858 likely(__user_ok((addr), (sz))))
5959
arch/arc/kernel/signal.c+13−12
@@ -101,7 +101,6 @@ SYSCALL_DEFINE0(rt_sigreturn) · 100 unmodified lines
101101 {
102102 struct rt_sigframe __user *sf;
103103 unsigned int magic;
104− int err;
105104 struct pt_regs *regs = current_pt_regs();
106105
107106 /* Always make any pending restarted system calls return -EINTR */
@@ -119,15 +118,16 @@ SYSCALL_DEFINE0(rt_sigreturn) · 11 unmodified lines
119118 if (!access_ok(VERIFY_READ, sf, sizeof(*sf)))
120119 goto badframe;
121120
122− err = restore_usr_regs(regs, sf);
123− err |= __get_user(magic, &sf->sigret_magic);
124− if (err)
121+ if (__get_user(magic, &sf->sigret_magic))
125122 goto badframe;
126123
127124 if (unlikely(is_do_ss_needed(magic)))
128125 if (restore_altstack(&sf->uc.uc_stack))
129126 goto badframe;
130127
128+ if (restore_usr_regs(regs, sf))
129+ goto badframe;
130+
131131 /* Don't restart from sigreturn */
132132 syscall_wont_restart(regs);
133133
@@ -190,6 +190,15 @@ setup_rt_frame(int signo, struct k_sigaction *ka, siginfo_t *info, · 56 unmodified lines
190190 if (!sf)
191191 return 1;
192192
193+ /*
194+ * w/o SA_SIGINFO, struct ucontext is partially populated (only
195+ * uc_mcontext/uc_sigmask) for kernel's normal user state preservation
196+ * during signal handler execution. This works for SA_SIGINFO as well
197+ * although the semantics are now overloaded (the same reg state can be
198+ * inspected by userland: but are they allowed to fiddle with it ?
199+ */
200+ err |= stash_usr_regs(sf, regs, set);
201+
193202 /*
194203 * SA_SIGINFO requires 3 args to signal handler:
195204 * #1: sig-no (common to any handler)
@@ -213,14 +222,6 @@ setup_rt_frame(int signo, struct k_sigaction *ka, siginfo_t *info, · 17 unmodified lines
213222 magic = MAGIC_SIGALTSTK;
214223 }
215224
216− /*
217− * w/o SA_SIGINFO, struct ucontext is partially populated (only
218− * uc_mcontext/uc_sigmask) for kernel's normal user state preservation
219− * during signal handler execution. This works for SA_SIGINFO as well
220− * although the semantics are now overloaded (the same reg state can be
221− * inspected by userland: but are they allowed to fiddle with it ?
222− */
223− err |= stash_usr_regs(sf, regs, set);
224225 err |= __put_user(magic, &sf->sigret_magic);
225226 if (err)
226227 return err;
arch/arc/kernel/time.c+2−5
@@ -227,12 +227,9 @@ void __attribute__((weak)) arc_local_timer_setup(unsigned int cpu) · 226 unmodified lines
227227 {
228228 struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu);
229229
230− clockevents_calc_mult_shift(clk, arc_get_core_freq(), 5);
231−
232− clk->max_delta_ns = clockevent_delta2ns(ARC_TIMER_MAX, clk);
233230 clk->cpumask = cpumask_of(cpu);
234−
235− clockevents_register_device(clk);
231+ clockevents_config_and_register(clk, arc_get_core_freq(),
232+ 0, ARC_TIMER_MAX);
236233
237234 /*
238235 * setup the per-cpu timer IRQ handler - for all cpus
arch/arc/kernel/unaligned.c+6−0
@@ -245,6 +245,12 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs, · 244 unmodified lines
245245 regs->status32 &= ~STATUS_DE_MASK;
246246 } else {
247247 regs->ret += state.instr_len;
248+
249+ /* handle zero-overhead-loop */
250+ if ((regs->ret == regs->lp_end) && (regs->lp_count)) {
251+ regs->ret = regs->lp_start;
252+ regs->lp_count--;
253+ }
248254 }
249255
250256 return 0;
arch/arm/Kconfig+1−2
@@ -2217,8 +2217,7 @@ config NEON · 2216 unmodified lines
22172217
22182218 config KERNEL_MODE_NEON
22192219 bool "Support for NEON in kernel mode"
2220− default n
2221− depends on NEON
2220+ depends on NEON && AEABI
22222221 help
22232222 Say Y to include support for NEON in kernel mode.
22242223
arch/arm/boot/dts/Makefile+3−0
@@ -41,6 +41,8 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d33ek.dtb · 40 unmodified lines
4141 dtb-$(CONFIG_ARCH_AT91) += sama5d34ek.dtb
4242 dtb-$(CONFIG_ARCH_AT91) += sama5d35ek.dtb
4343
44+dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb
45+
4446 dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
4547 dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb \
4648 bcm28155-ap.dtb
@@ -183,6 +185,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ · 136 unmodified lines
183185 am335x-evm.dtb \
184186 am335x-evmsk.dtb \
185187 am335x-bone.dtb \
188+ am335x-boneblack.dtb \
186189 am3517-evm.dtb \
187190 am3517_mt_ventoux.dtb \
188191 am43x-epos-evm.dtb
arch/arm/boot/dts/am335x-bone-common.dtsi+262−0
@@ -0,0 +1,262 @@
1+/*
2+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License version 2 as
6+ * published by the Free Software Foundation.
7+ */
8+
9+/ {
10+ model = "TI AM335x BeagleBone";
11+ compatible = "ti,am335x-bone", "ti,am33xx";
12+
13+ cpus {
14+ cpu@0 {
15+ cpu0-supply = <&dcdc2_reg>;
16+ };
17+ };
18+
19+ memory {
20+ device_type = "memory";
21+ reg = <0x80000000 0x10000000>; /* 256 MB */
22+ };
23+
24+ am33xx_pinmux: pinmux@44e10800 {
25+ pinctrl-names = "default";
26+ pinctrl-0 = <&clkout2_pin>;
27+
28+ user_leds_s0: user_leds_s0 {
29+ pinctrl-single,pins = <
30+ 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */
31+ 0x58 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a6.gpio1_22 */
32+ 0x5c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a7.gpio1_23 */
33+ 0x60 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a8.gpio1_24 */
34+ >;
35+ };
36+
37+ i2c0_pins: pinmux_i2c0_pins {
38+ pinctrl-single,pins = <
39+ 0x188 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */
40+ 0x18c (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */
41+ >;
42+ };
43+
44+ uart0_pins: pinmux_uart0_pins {
45+ pinctrl-single,pins = <
46+ 0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */
47+ 0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */
48+ >;
49+ };
50+
51+ clkout2_pin: pinmux_clkout2_pin {
52+ pinctrl-single,pins = <
53+ 0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */
54+ >;
55+ };
56+
57+ cpsw_default: cpsw_default {
58+ pinctrl-single,pins = <
59+ /* Slave 1 */
60+ 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */
61+ 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */
62+ 0x118 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */
63+ 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd3.mii1_txd3 */
64+ 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd2.mii1_txd2 */
65+ 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.mii1_txd1 */
66+ 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.mii1_txd0 */
67+ 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.mii1_txclk */
68+ 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */
69+ 0x134 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */
70+ 0x138 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */
71+ 0x13c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */
72+ 0x140 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */
73+ >;
74+ };
75+
76+ cpsw_sleep: cpsw_sleep {
77+ pinctrl-single,pins = <
78+ /* Slave 1 reset value */
79+ 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)
80+ 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
81+ 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
82+ 0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
83+ 0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
84+ 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
85+ 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
86+ 0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
87+ 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
88+ 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
89+ 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
90+ 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
91+ 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
92+ >;
93+ };
94+
95+ davinci_mdio_default: davinci_mdio_default {
96+ pinctrl-single,pins = <
97+ /* MDIO */
98+ 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */
99+ 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */
100+ >;
101+ };
102+
103+ davinci_mdio_sleep: davinci_mdio_sleep {
104+ pinctrl-single,pins = <
105+ /* MDIO reset value */
106+ 0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
107+ 0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
108+ >;
109+ };
110+ };
111+
112+ ocp {
113+ uart0: serial@44e09000 {
114+ pinctrl-names = "default";
115+ pinctrl-0 = <&uart0_pins>;
116+
117+ status = "okay";
118+ };
119+
120+ musb: usb@47400000 {
121+ status = "okay";
122+
123+ control@44e10000 {
124+ status = "okay";
125+ };
126+
127+ usb-phy@47401300 {
128+ status = "okay";
129+ };
130+
131+ usb-phy@47401b00 {
132+ status = "okay";
133+ };
134+
135+ usb@47401000 {
136+ status = "okay";
137+ };
138+
139+ usb@47401800 {
140+ status = "okay";
141+ dr_mode = "host";
142+ };
143+
144+ dma-controller@07402000 {
145+ status = "okay";
146+ };
147+ };
148+
149+ i2c0: i2c@44e0b000 {
150+ pinctrl-names = "default";
151+ pinctrl-0 = <&i2c0_pins>;
152+
153+ status = "okay";
154+ clock-frequency = <400000>;
155+
156+ tps: tps@24 {
157+ reg = <0x24>;
158+ };
159+
160+ };
161+ };
162+
163+ leds {
164+ pinctrl-names = "default";
165+ pinctrl-0 = <&user_leds_s0>;
166+
167+ compatible = "gpio-leds";
168+
169+ led@2 {
170+ label = "beaglebone:green:heartbeat";
171+ gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
172+ linux,default-trigger = "heartbeat";
173+ default-state = "off";
174+ };
175+
176+ led@3 {
177+ label = "beaglebone:green:mmc0";
178+ gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
179+ linux,default-trigger = "mmc0";
180+ default-state = "off";
181+ };
182+
183+ led@4 {
184+ label = "beaglebone:green:usr2";
185+ gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
186+ default-state = "off";
187+ };
188+
189+ led@5 {
190+ label = "beaglebone:green:usr3";
191+ gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
192+ default-state = "off";
193+ };
194+ };
195+};
196+
197+/include/ "tps65217.dtsi"
198+
199+&tps {
200+ regulators {
201+ dcdc1_reg: regulator@0 {
202+ regulator-always-on;
203+ };
204+
205+ dcdc2_reg: regulator@1 {
206+ /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
207+ regulator-name = "vdd_mpu";
208+ regulator-min-microvolt = <925000>;
209+ regulator-max-microvolt = <1325000>;
210+ regulator-boot-on;
211+ regulator-always-on;
212+ };
213+
214+ dcdc3_reg: regulator@2 {
215+ /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
216+ regulator-name = "vdd_core";
217+ regulator-min-microvolt = <925000>;
218+ regulator-max-microvolt = <1150000>;
219+ regulator-boot-on;
220+ regulator-always-on;
221+ };
222+
223+ ldo1_reg: regulator@3 {
224+ regulator-always-on;
225+ };
226+
227+ ldo2_reg: regulator@4 {
228+ regulator-always-on;
229+ };
230+
231+ ldo3_reg: regulator@5 {
232+ regulator-always-on;
233+ };
234+
235+ ldo4_reg: regulator@6 {
236+ regulator-always-on;
237+ };
238+ };
239+};
240+
241+&cpsw_emac0 {
242+ phy_id = <&davinci_mdio>, <0>;
243+ phy-mode = "mii";
244+};
245+
246+&cpsw_emac1 {
247+ phy_id = <&davinci_mdio>, <1>;
248+ phy-mode = "mii";
249+};
250+
251+&mac {
252+ pinctrl-names = "default", "sleep";
253+ pinctrl-0 = <&cpsw_default>;
254+ pinctrl-1 = <&cpsw_sleep>;
255+
256+};
257+
258+&davinci_mdio {
259+ pinctrl-names = "default", "sleep";
260+ pinctrl-0 = <&davinci_mdio_default>;
261+ pinctrl-1 = <&davinci_mdio_sleep>;
262+};
arch/arm/boot/dts/am335x-bone.dts+1−255
@@ -8,258 +8,4 @@ · 7 unmodified lines
88 /dts-v1/;
99
1010 #include "am33xx.dtsi"
11−
12−/ {
13− model = "TI AM335x BeagleBone";
14− compatible = "ti,am335x-bone", "ti,am33xx";
15−
16− cpus {
17− cpu@0 {
18− cpu0-supply = <&dcdc2_reg>;
19− };
20− };
21−
22− memory {
23− device_type = "memory";
24− reg = <0x80000000 0x10000000>; /* 256 MB */
25− };
26−
27− am33xx_pinmux: pinmux@44e10800 {
28− pinctrl-names = "default";
29− pinctrl-0 = <&clkout2_pin>;
30−
31− user_leds_s0: user_leds_s0 {
32− pinctrl-single,pins = <
33− 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */
34− 0x58 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a6.gpio1_22 */
35− 0x5c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a7.gpio1_23 */
36− 0x60 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a8.gpio1_24 */
37− >;
38− };
39−
40− i2c0_pins: pinmux_i2c0_pins {
41− pinctrl-single,pins = <
42− 0x188 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */
43− 0x18c (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */
44− >;
45− };
46−
47− uart0_pins: pinmux_uart0_pins {
48− pinctrl-single,pins = <
49− 0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */
50− 0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */
51− >;
52− };
53−
54− clkout2_pin: pinmux_clkout2_pin {
55− pinctrl-single,pins = <
56− 0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */
57− >;
58− };
59−
60− cpsw_default: cpsw_default {
61− pinctrl-single,pins = <
62− /* Slave 1 */
63− 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */
64− 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */
65− 0x118 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */
66− 0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd3.mii1_txd3 */
67− 0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd2.mii1_txd2 */
68− 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.mii1_txd1 */
69− 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.mii1_txd0 */
70− 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.mii1_txclk */
71− 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */
72− 0x134 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */
73− 0x138 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */
74− 0x13c (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */
75− 0x140 (PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */
76− >;
77− };
78−
79− cpsw_sleep: cpsw_sleep {
80− pinctrl-single,pins = <
81− /* Slave 1 reset value */
82− 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)
83− 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
84− 0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
85− 0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
86− 0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
87− 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
88− 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
89− 0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
90− 0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
91− 0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
92− 0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
93− 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
94− 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
95− >;
96− };
97−
98− davinci_mdio_default: davinci_mdio_default {
99− pinctrl-single,pins = <
100− /* MDIO */
101− 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */
102− 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */
103− >;
104− };
105−
106− davinci_mdio_sleep: davinci_mdio_sleep {
107− pinctrl-single,pins = <
108− /* MDIO reset value */
109− 0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
110− 0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
111− >;
112− };
113− };
114−
115− ocp {
116− uart0: serial@44e09000 {
117− pinctrl-names = "default";
118− pinctrl-0 = <&uart0_pins>;
119−
120− status = "okay";
121− };
122−
123− musb: usb@47400000 {
124− status = "okay";
125−
126− control@44e10000 {
127− status = "okay";
128− };
129−
130− usb-phy@47401300 {
131− status = "okay";
132− };
133−
134− usb-phy@47401b00 {
135− status = "okay";
136− };
137−
138− usb@47401000 {
139− status = "okay";
140− };
141−
142− usb@47401800 {
143− status = "okay";
144− dr_mode = "host";
145− };
146−
147− dma-controller@07402000 {
148− status = "okay";
149− };
150− };
151−
152− i2c0: i2c@44e0b000 {
153− pinctrl-names = "default";
154− pinctrl-0 = <&i2c0_pins>;
155−
156− status = "okay";
157− clock-frequency = <400000>;
158−
159− tps: tps@24 {
160− reg = <0x24>;
161− };
162−
163− };
164− };
165−
166− leds {
167− pinctrl-names = "default";
168− pinctrl-0 = <&user_leds_s0>;
169−
170− compatible = "gpio-leds";
171−
172− led@2 {
173− label = "beaglebone:green:heartbeat";
174− gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
175− linux,default-trigger = "heartbeat";
176− default-state = "off";
177− };
178−
179− led@3 {
180− label = "beaglebone:green:mmc0";
181− gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
182− linux,default-trigger = "mmc0";
183− default-state = "off";
184− };
185−
186− led@4 {
187− label = "beaglebone:green:usr2";
188− gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
189− default-state = "off";
190− };
191−
192− led@5 {
193− label = "beaglebone:green:usr3";
194− gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
195− default-state = "off";
196− };
197− };
198−};
199−
200−/include/ "tps65217.dtsi"
201−
202−&tps {
203− regulators {
204− dcdc1_reg: regulator@0 {
205− regulator-always-on;
206− };
207−
208− dcdc2_reg: regulator@1 {
209− /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
210− regulator-name = "vdd_mpu";
211− regulator-min-microvolt = <925000>;
212− regulator-max-microvolt = <1325000>;
213− regulator-boot-on;
214− regulator-always-on;
215− };
216−
217− dcdc3_reg: regulator@2 {
218− /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
219− regulator-name = "vdd_core";
220− regulator-min-microvolt = <925000>;
221− regulator-max-microvolt = <1150000>;
222− regulator-boot-on;
223− regulator-always-on;
224− };
225−
226− ldo1_reg: regulator@3 {
227− regulator-always-on;
228− };
229−
230− ldo2_reg: regulator@4 {
231− regulator-always-on;
232− };
233−
234− ldo3_reg: regulator@5 {
235− regulator-always-on;
236− };
237−
238− ldo4_reg: regulator@6 {
239− regulator-always-on;
240− };
241− };
242−};
243−
244−&cpsw_emac0 {
245− phy_id = <&davinci_mdio>, <0>;
246− phy-mode = "mii";
247−};
248−
249−&cpsw_emac1 {
250− phy_id = <&davinci_mdio>, <1>;
251− phy-mode = "mii";
252−};
253−
254−&mac {
255− pinctrl-names = "default", "sleep";
256− pinctrl-0 = <&cpsw_default>;
257− pinctrl-1 = <&cpsw_sleep>;
258−
259−};
260−
261−&davinci_mdio {
262− pinctrl-names = "default", "sleep";
263− pinctrl-0 = <&davinci_mdio_default>;
264− pinctrl-1 = <&davinci_mdio_sleep>;
265−};
11+#include "am335x-bone-common.dtsi"
arch/arm/boot/dts/am335x-boneblack.dts+17−0
@@ -0,0 +1,17 @@
1+/*
2+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License version 2 as
6+ * published by the Free Software Foundation.
7+ */
8+/dts-v1/;
9+
10+#include "am33xx.dtsi"
11+#include "am335x-bone-common.dtsi"
12+
13+&ldo3_reg {
14+ regulator-min-microvolt = <1800000>;
15+ regulator-max-microvolt = <1800000>;
16+ regulator-always-on;
17+};
arch/arm/boot/dts/armada-370-netgear-rn102.dts+32−17
@@ -27,6 +27,25 @@ · 26 unmodified lines
2727 };
2828
2929 soc {
30+ ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
31+ MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
32+
33+ pcie-controller {
34+ status = "okay";
35+
36+ /* Connected to Marvell SATA controller */
37+ pcie@1,0 {
38+ /* Port 0, Lane 0 */
39+ status = "okay";
40+ };
41+
42+ /* Connected to FL1009 USB 3.0 controller */
43+ pcie@2,0 {
44+ /* Port 1, Lane 0 */
45+ status = "okay";
46+ };
47+ };
48+
3049 internal-regs {
3150 serial@12000 {
3251 clock-frequency = <200000000>;
@@ -57,6 +76,11 @@ · 24 unmodified lines
5776 marvell,pins = "mpp56";
5877 marvell,function = "gpio";
5978 };
79+
80+ poweroff: poweroff {
81+ marvell,pins = "mpp8";
82+ marvell,function = "gpio";
83+ };
6084 };
6185
6286 mdio {
@@ -89,22 +113,6 @@ · 26 unmodified lines
89113 pwm_polarity = <0>;
90114 };
91115 };
92−
93− pcie-controller {
94− status = "okay";
95−
96− /* Connected to Marvell SATA controller */
97− pcie@1,0 {
98− /* Port 0, Lane 0 */
99− status = "okay";
100− };
101−
102− /* Connected to FL1009 USB 3.0 controller */
103− pcie@2,0 {
104− /* Port 1, Lane 0 */
105− status = "okay";
106− };
107− };
108116 };
109117 };
110118
@@ -160,7 +168,7 @@ · 49 unmodified lines
160168 button@1 {
161169 label = "Power Button";
162170 linux,code = <116>; /* KEY_POWER */
163− gpios = <&gpio1 30 1>;
171+ gpios = <&gpio1 30 0>;
164172 };
165173
166174 button@2 {
@@ -176,4 +184,11 @@ · 9 unmodified lines
176184 };
177185 };
178186
187+ gpio_poweroff {
188+ compatible = "gpio-poweroff";
189+ pinctrl-0 = <&poweroff>;
190+ pinctrl-names = "default";
191+ gpios = <&gpio0 8 1>;
192+ };
193+
179194 };
arch/arm/boot/dts/armada-xp.dtsi+11−0
@@ -70,6 +70,8 @@ · 69 unmodified lines
7070
7171 timer@20300 {
7272 compatible = "marvell,armada-xp-timer";
73+ clocks = <&coreclk 2>, <&refclk>;
74+ clock-names = "nbclk", "fixed";
7375 };
7476
7577 coreclk: mvebu-sar@18230 {
@@ -169,4 +171,13 @@ · 93 unmodified lines
169171 };
170172 };
171173 };
174+
175+ clocks {
176+ /* 25 MHz reference crystal */
177+ refclk: oscillator {
178+ compatible = "fixed-clock";
179+ #clock-cells = <0>;
180+ clock-frequency = <25000000>;
181+ };
182+ };
172183 };
arch/arm/boot/dts/at91sam9x5.dtsi+4−2
@@ -190,12 +190,12 @@ · 189 unmodified lines
190190 AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA8 periph A */
191191 };
192192
193− pinctrl_uart2_rts: uart2_rts-0 {
193+ pinctrl_usart2_rts: usart2_rts-0 {
194194 atmel,pins =
195195 <AT91_PIOB 0 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB0 periph B */
196196 };
197197
198− pinctrl_uart2_cts: uart2_cts-0 {
198+ pinctrl_usart2_cts: usart2_cts-0 {
199199 atmel,pins =
200200 <AT91_PIOB 1 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB1 periph B */
201201 };
@@ -556,6 +556,7 @@ · 354 unmodified lines
556556 interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
557557 dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(0)>;
558558 dma-names = "rxtx";
559+ pinctrl-names = "default";
559560 #address-cells = <1>;
560561 #size-cells = <0>;
561562 status = "disabled";
@@ -567,6 +568,7 @@ · 5 unmodified lines
567568 interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
568569 dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(0)>;
569570 dma-names = "rxtx";
571+ pinctrl-names = "default";
570572 #address-cells = <1>;
571573 #size-cells = <0>;
572574 status = "disabled";
arch/arm/boot/dts/atlas6.dtsi+12−0
@@ -181,6 +181,8 @@ · 180 unmodified lines
181181 interrupts = <17>;
182182 fifosize = <128>;
183183 clocks = <&clks 13>;
184+ sirf,uart-dma-rx-channel = <21>;
185+ sirf,uart-dma-tx-channel = <2>;
184186 };
185187
186188 uart1: uart@b0060000 {
@@ -199,6 +201,8 @@ · 12 unmodified lines
199201 interrupts = <19>;
200202 fifosize = <128>;
201203 clocks = <&clks 15>;
204+ sirf,uart-dma-rx-channel = <6>;
205+ sirf,uart-dma-tx-channel = <7>;
202206 };
203207
204208 usp0: usp@b0080000 {
@@ -206,7 +210,10 @@ · 1 unmodified line
206210 compatible = "sirf,prima2-usp";
207211 reg = <0xb0080000 0x10000>;
208212 interrupts = <20>;
213+ fifosize = <128>;
209214 clocks = <&clks 28>;
215+ sirf,usp-dma-rx-channel = <17>;
216+ sirf,usp-dma-tx-channel = <18>;
210217 };
211218
212219 usp1: usp@b0090000 {
@@ -214,7 +221,10 @@ · 1 unmodified line
214221 compatible = "sirf,prima2-usp";
215222 reg = <0xb0090000 0x10000>;
216223 interrupts = <21>;
224+ fifosize = <128>;
217225 clocks = <&clks 29>;
226+ sirf,usp-dma-rx-channel = <14>;
227+ sirf,usp-dma-tx-channel = <15>;
218228 };
219229
220230 dmac0: dma-controller@b00b0000 {
@@ -237,6 +247,8 @@ · 16 unmodified lines
237247 compatible = "sirf,prima2-vip";
238248 reg = <0xb00C0000 0x10000>;
239249 clocks = <&clks 31>;
250+ interrupts = <14>;
251+ sirf,vip-dma-rx-channel = <16>;
240252 };
241253
242254 spi0: spi@b00d0000 {
arch/arm/boot/dts/imx27.dtsi+3−3
@@ -187,7 +187,7 @@ · 186 unmodified lines
187187 compatible = "fsl,imx27-cspi";
188188 reg = <0x1000e000 0x1000>;
189189 interrupts = <16>;
190− clocks = <&clks 53>, <&clks 53>;
190+ clocks = <&clks 53>, <&clks 60>;
191191 clock-names = "ipg", "per";
192192 status = "disabled";
193193 };
@@ -198,7 +198,7 @@ · 4 unmodified lines
198198 compatible = "fsl,imx27-cspi";
199199 reg = <0x1000f000 0x1000>;
200200 interrupts = <15>;
201− clocks = <&clks 52>, <&clks 52>;
201+ clocks = <&clks 52>, <&clks 60>;
202202 clock-names = "ipg", "per";
203203 status = "disabled";
204204 };
@@ -309,7 +309,7 @@ · 104 unmodified lines
309309 compatible = "fsl,imx27-cspi";
310310 reg = <0x10017000 0x1000>;
311311 interrupts = <6>;
312− clocks = <&clks 51>, <&clks 51>;
312+ clocks = <&clks 51>, <&clks 60>;
313313 clock-names = "ipg", "per";
314314 status = "disabled";
315315 };
arch/arm/boot/dts/imx51.dtsi+1−1
@@ -474,7 +474,7 @@ · 473 unmodified lines
474474 compatible = "fsl,imx51-pata", "fsl,imx27-pata";
475475 reg = <0x83fe0000 0x4000>;
476476 interrupts = <70>;
477− clocks = <&clks 161>;
477+ clocks = <&clks 172>;
478478 status = "disabled";
479479 };
480480
arch/arm/boot/dts/imx6q-pinfunc.h+2−2
@@ -207,8 +207,8 @@ · 206 unmodified lines
207207 #define MX6QDL_PAD_EIM_D29__ECSPI4_SS0 0x0c8 0x3dc 0x824 0x2 0x1
208208 #define MX6QDL_PAD_EIM_D29__UART2_RTS_B 0x0c8 0x3dc 0x924 0x4 0x1
209209 #define MX6QDL_PAD_EIM_D29__UART2_CTS_B 0x0c8 0x3dc 0x000 0x4 0x0
210−#define MX6QDL_PAD_EIM_D29__UART2_DTE_RTS_B 0x0c4 0x3dc 0x000 0x4 0x0
211−#define MX6QDL_PAD_EIM_D29__UART2_DTE_CTS_B 0x0c4 0x3dc 0x924 0x4 0x1
210+#define MX6QDL_PAD_EIM_D29__UART2_DTE_RTS_B 0x0c8 0x3dc 0x000 0x4 0x0
211+#define MX6QDL_PAD_EIM_D29__UART2_DTE_CTS_B 0x0c8 0x3dc 0x924 0x4 0x1
212212 #define MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x0c8 0x3dc 0x000 0x5 0x0
213213 #define MX6QDL_PAD_EIM_D29__IPU2_CSI1_VSYNC 0x0c8 0x3dc 0x8e4 0x6 0x0
214214 #define MX6QDL_PAD_EIM_D29__IPU1_DI0_PIN14 0x0c8 0x3dc 0x000 0x7 0x0
arch/arm/boot/dts/kirkwood.dtsi+2−1
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 cpu@0 {
1414 device_type = "cpu";
1515 compatible = "marvell,feroceon";
16+ reg = <0>;
1617 clocks = <&core_clk 1>, <&core_clk 3>, <&gate_clk 11>;
1718 clock-names = "cpu_clk", "ddrclk", "powersave";
1819 };
@@ -167,7 +168,7 @@ · 148 unmodified lines
167168 xor@60900 {
168169 compatible = "marvell,orion-xor";
169170 reg = <0x60900 0x100
170− 0xd0B00 0x100>;
171+ 0x60B00 0x100>;
171172 status = "okay";
172173 clocks = <&gate_clk 16>;
173174
arch/arm/boot/dts/omap3-beagle-xm.dts+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111
1212 / {
1313 model = "TI OMAP3 BeagleBoard xM";
14− compatible = "ti,omap3-beagle-xm, ti,omap3-beagle", "ti,omap3";
14+ compatible = "ti,omap3-beagle-xm", "ti,omap3-beagle", "ti,omap3";
1515
1616 cpus {
1717 cpu@0 {
arch/arm/boot/dts/omap3-igep.dtsi+14−0
@@ -48,6 +48,15 @@ · 47 unmodified lines
4848 >;
4949 };
5050
51+ mcbsp2_pins: pinmux_mcbsp2_pins {
52+ pinctrl-single,pins = <
53+ 0x10c (PIN_INPUT | MUX_MODE0) /* mcbsp2_fsx.mcbsp2_fsx */
54+ 0x10e (PIN_INPUT | MUX_MODE0) /* mcbsp2_clkx.mcbsp2_clkx */
55+ 0x110 (PIN_INPUT | MUX_MODE0) /* mcbsp2_dr.mcbsp2.dr */
56+ 0x112 (PIN_OUTPUT | MUX_MODE0) /* mcbsp2_dx.mcbsp2_dx */
57+ >;
58+ };
59+
5160 mmc1_pins: pinmux_mmc1_pins {
5261 pinctrl-single,pins = <
5362 0x114 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */
@@ -93,6 +102,11 @@ · 39 unmodified lines
93102 clock-frequency = <400000>;
94103 };
95104
105+&mcbsp2 {
106+ pinctrl-names = "default";
107+ pinctrl-0 = <&mcbsp2_pins>;
108+};
109+
96110 &mmc1 {
97111 pinctrl-names = "default";
98112 pinctrl-0 = <&mmc1_pins>;
arch/arm/boot/dts/omap4-panda-common.dtsi+45−1
@@ -107,6 +107,19 @@ · 106 unmodified lines
107107 */
108108 clock-frequency = <19200000>;
109109 };
110+
111+ /* regulator for wl12xx on sdio5 */
112+ wl12xx_vmmc: wl12xx_vmmc {
113+ pinctrl-names = "default";
114+ pinctrl-0 = <&wl12xx_gpio>;
115+ compatible = "regulator-fixed";
116+ regulator-name = "vwl1271";
117+ regulator-min-microvolt = <1800000>;
118+ regulator-max-microvolt = <1800000>;
119+ gpio = <&gpio2 11 0>;
120+ startup-delay-us = <70000>;
121+ enable-active-high;
122+ };
110123 };
111124
112125 &omap4_pmx_wkup {
@@ -235,6 +248,33 @@ · 122 unmodified lines
235248 0x1c (PIN_OUTPUT | MUX_MODE3) /* gpio_wk8 */
236249 >;
237250 };
251+
252+ /*
253+ * wl12xx GPIO outputs for WLAN_EN, BT_EN, FM_EN, BT_WAKEUP
254+ * REVISIT: Are the pull-ups needed for GPIO 48 and 49?
255+ */
256+ wl12xx_gpio: pinmux_wl12xx_gpio {
257+ pinctrl-single,pins = <
258+ 0x26 (PIN_OUTPUT | MUX_MODE3) /* gpmc_a19.gpio_43 */
259+ 0x2c (PIN_OUTPUT | MUX_MODE3) /* gpmc_a22.gpio_46 */
260+ 0x30 (PIN_OUTPUT_PULLUP | MUX_MODE3) /* gpmc_a24.gpio_48 */
261+ 0x32 (PIN_OUTPUT_PULLUP | MUX_MODE3) /* gpmc_a25.gpio_49 */
262+ >;
263+ };
264+
265+ /* wl12xx GPIO inputs and SDIO pins */
266+ wl12xx_pins: pinmux_wl12xx_pins {
267+ pinctrl-single,pins = <
268+ 0x38 (PIN_INPUT | MUX_MODE3) /* gpmc_ncs2.gpio_52 */
269+ 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */
270+ 0x108 (PIN_OUTPUT | MUX_MODE0) /* sdmmc5_clk.sdmmc5_clk */
271+ 0x10a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_cmd.sdmmc5_cmd */
272+ 0x10c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat0.sdmmc5_dat0 */
273+ 0x10e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1.sdmmc5_dat1 */
274+ 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat2.sdmmc5_dat2 */
275+ 0x112 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat3.sdmmc5_dat3 */
276+ >;
277+ };
238278 };
239279
240280 &i2c1 {
@@ -314,8 +354,12 @@ · 73 unmodified lines
314354 };
315355
316356 &mmc5 {
317− ti,non-removable;
357+ pinctrl-names = "default";
358+ pinctrl-0 = <&wl12xx_pins>;
359+ vmmc-supply = <&wl12xx_vmmc>;
360+ non-removable;
318361 bus-width = <4>;
362+ cap-power-off-card;
319363 };
320364
321365 &emif1 {
arch/arm/boot/dts/omap4-sdp.dts+38−1
@@ -140,6 +140,19 @@ · 139 unmodified lines
140140 "DMic", "Digital Mic",
141141 "Digital Mic", "Digital Mic1 Bias";
142142 };
143+
144+ /* regulator for wl12xx on sdio5 */
145+ wl12xx_vmmc: wl12xx_vmmc {
146+ pinctrl-names = "default";
147+ pinctrl-0 = <&wl12xx_gpio>;
148+ compatible = "regulator-fixed";
149+ regulator-name = "vwl1271";
150+ regulator-min-microvolt = <1800000>;
151+ regulator-max-microvolt = <1800000>;
152+ gpio = <&gpio2 22 0>;
153+ startup-delay-us = <70000>;
154+ enable-active-high;
155+ };
143156 };
144157
145158 &omap4_pmx_wkup {
@@ -295,6 +308,26 @@ · 149 unmodified lines
295308 0xf0 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c4_sda */
296309 >;
297310 };
311+
312+ /* wl12xx GPIO output for WLAN_EN */
313+ wl12xx_gpio: pinmux_wl12xx_gpio {
314+ pinctrl-single,pins = <
315+ 0x3c (PIN_OUTPUT | MUX_MODE3) /* gpmc_nwp.gpio_54 */
316+ >;
317+ };
318+
319+ /* wl12xx GPIO inputs and SDIO pins */
320+ wl12xx_pins: pinmux_wl12xx_pins {
321+ pinctrl-single,pins = <
322+ 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */
323+ 0x108 (PIN_OUTPUT | MUX_MODE3) /* sdmmc5_clk.sdmmc5_clk */
324+ 0x10a (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_cmd.sdmmc5_cmd */
325+ 0x10c (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat0.sdmmc5_dat0 */
326+ 0x10e (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat1.sdmmc5_dat1 */
327+ 0x110 (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat2.sdmmc5_dat2 */
328+ 0x112 (PIN_INPUT_PULLUP | MUX_MODE3) /* sdmmc5_dat3.sdmmc5_dat3 */
329+ >;
330+ };
298331 };
299332
300333 &i2c1 {
@@ -420,8 +453,12 @@ · 119 unmodified lines
420453 };
421454
422455 &mmc5 {
456+ pinctrl-names = "default";
457+ pinctrl-0 = <&wl12xx_pins>;
458+ vmmc-supply = <&wl12xx_vmmc>;
459+ non-removable;
423460 bus-width = <4>;
424− ti,non-removable;
461+ cap-power-off-card;
425462 };
426463
427464 &emif1 {
arch/arm/boot/dts/omap5.dtsi+4−3
@@ -637,7 +637,7 @@ · 636 unmodified lines
637637 omap_dwc3@4a020000 {
638638 compatible = "ti,dwc3";
639639 ti,hwmods = "usb_otg_ss";
640− reg = <0x4a020000 0x1000>;
640+ reg = <0x4a020000 0x10000>;
641641 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
642642 #address-cells = <1>;
643643 #size-cells = <1>;
@@ -645,17 +645,18 @@ · 1 unmodified line
645645 ranges;
646646 dwc3@4a030000 {
647647 compatible = "snps,dwc3";
648− reg = <0x4a030000 0x1000>;
648+ reg = <0x4a030000 0x10000>;
649649 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
650650 usb-phy = <&usb2_phy>, <&usb3_phy>;
651651 tx-fifo-resize;
652652 };
653653 };
654654
655− ocp2scp {
655+ ocp2scp@4a080000 {
656656 compatible = "ti,omap-ocp2scp";
657657 #address-cells = <1>;
658658 #size-cells = <1>;
659+ reg = <0x4a080000 0x20>;
659660 ranges;
660661 ti,hwmods = "ocp2scp1";
661662 usb2_phy: usb2phy@4a084000 {
arch/arm/boot/dts/prima2.dtsi+23−4
@@ -171,7 +171,8 @@ · 170 unmodified lines
171171 compatible = "simple-bus";
172172 #address-cells = <1>;
173173 #size-cells = <1>;
174− ranges = <0xb0000000 0xb0000000 0x180000>;
174+ ranges = <0xb0000000 0xb0000000 0x180000>,
175+ <0x56000000 0x56000000 0x1b00000>;
175176
176177 timer@b0020000 {
177178 compatible = "sirf,prima2-tick";
@@ -196,25 +197,32 @@ · 18 unmodified lines
196197 uart0: uart@b0050000 {
197198 cell-index = <0>;
198199 compatible = "sirf,prima2-uart";
199− reg = <0xb0050000 0x10000>;
200+ reg = <0xb0050000 0x1000>;
200201 interrupts = <17>;
202+ fifosize = <128>;
201203 clocks = <&clks 13>;
204+ sirf,uart-dma-rx-channel = <21>;
205+ sirf,uart-dma-tx-channel = <2>;
202206 };
203207
204208 uart1: uart@b0060000 {
205209 cell-index = <1>;
206210 compatible = "sirf,prima2-uart";
207− reg = <0xb0060000 0x10000>;
211+ reg = <0xb0060000 0x1000>;
208212 interrupts = <18>;
213+ fifosize = <32>;
209214 clocks = <&clks 14>;
210215 };
211216
212217 uart2: uart@b0070000 {
213218 cell-index = <2>;
214219 compatible = "sirf,prima2-uart";
215− reg = <0xb0070000 0x10000>;
220+ reg = <0xb0070000 0x1000>;
216221 interrupts = <19>;
222+ fifosize = <128>;
217223 clocks = <&clks 15>;
224+ sirf,uart-dma-rx-channel = <6>;
225+ sirf,uart-dma-tx-channel = <7>;
218226 };
219227
220228 usp0: usp@b0080000 {
@@ -222,7 +230,10 @@ · 1 unmodified line
222230 compatible = "sirf,prima2-usp";
223231 reg = <0xb0080000 0x10000>;
224232 interrupts = <20>;
233+ fifosize = <128>;
225234 clocks = <&clks 28>;
235+ sirf,usp-dma-rx-channel = <17>;
236+ sirf,usp-dma-tx-channel = <18>;
226237 };
227238
228239 usp1: usp@b0090000 {
@@ -230,7 +241,10 @@ · 1 unmodified line
230241 compatible = "sirf,prima2-usp";
231242 reg = <0xb0090000 0x10000>;
232243 interrupts = <21>;
244+ fifosize = <128>;
233245 clocks = <&clks 29>;
246+ sirf,usp-dma-rx-channel = <14>;
247+ sirf,usp-dma-tx-channel = <15>;
234248 };
235249
236250 usp2: usp@b00a0000 {
@@ -238,7 +252,10 @@ · 1 unmodified line
238252 compatible = "sirf,prima2-usp";
239253 reg = <0xb00a0000 0x10000>;
240254 interrupts = <22>;
255+ fifosize = <128>;
241256 clocks = <&clks 30>;
257+ sirf,usp-dma-rx-channel = <10>;
258+ sirf,usp-dma-tx-channel = <11>;
242259 };
243260
244261 dmac0: dma-controller@b00b0000 {
@@ -261,6 +278,8 @@ · 16 unmodified lines
261278 compatible = "sirf,prima2-vip";
262279 reg = <0xb00C0000 0x10000>;
263280 clocks = <&clks 31>;
281+ interrupts = <14>;
282+ sirf,vip-dma-rx-channel = <16>;
264283 };
265284
266285 spi0: spi@b00d0000 {
arch/arm/boot/dts/r8a73a4.dtsi+3−3
@@ -193,7 +193,7 @@ · 192 unmodified lines
193193 };
194194
195195 sdhi0: sdhi@ee100000 {
196− compatible = "renesas,r8a73a4-sdhi";
196+ compatible = "renesas,sdhi-r8a73a4";
197197 reg = <0 0xee100000 0 0x100>;
198198 interrupt-parent = <&gic>;
199199 interrupts = <0 165 4>;
@@ -202,7 +202,7 @@ · 2 unmodified lines
202202 };
203203
204204 sdhi1: sdhi@ee120000 {
205− compatible = "renesas,r8a73a4-sdhi";
205+ compatible = "renesas,sdhi-r8a73a4";
206206 reg = <0 0xee120000 0 0x100>;
207207 interrupt-parent = <&gic>;
208208 interrupts = <0 166 4>;
@@ -211,7 +211,7 @@ · 2 unmodified lines
211211 };
212212
213213 sdhi2: sdhi@ee140000 {
214− compatible = "renesas,r8a73a4-sdhi";
214+ compatible = "renesas,sdhi-r8a73a4";
215215 reg = <0 0xee140000 0 0x100>;
216216 interrupt-parent = <&gic>;
217217 interrupts = <0 167 4>;
arch/arm/boot/dts/r8a7778.dtsi+0−1
@@ -96,6 +96,5 @@ · 95 unmodified lines
9696 pfc: pfc@fffc0000 {
9797 compatible = "renesas,pfc-r8a7778";
9898 reg = <0xfffc000 0x118>;
99− #gpio-range-cells = <3>;
10099 };
101100 };
arch/arm/boot/dts/r8a7779.dtsi+0−1
@@ -188,7 +188,6 @@ · 187 unmodified lines
188188 pfc: pfc@fffc0000 {
189189 compatible = "renesas,pfc-r8a7779";
190190 reg = <0xfffc0000 0x23c>;
191− #gpio-range-cells = <3>;
192191 };
193192
194193 thermal@ffc48000 {
arch/arm/boot/dts/r8a7790.dtsi+4−5
@@ -148,11 +148,10 @@ · 147 unmodified lines
148148 pfc: pfc@e6060000 {
149149 compatible = "renesas,pfc-r8a7790";
150150 reg = <0 0xe6060000 0 0x250>;
151− #gpio-range-cells = <3>;
152151 };
153152
154153 sdhi0: sdhi@ee100000 {
155− compatible = "renesas,r8a7790-sdhi";
154+ compatible = "renesas,sdhi-r8a7790";
156155 reg = <0 0xee100000 0 0x100>;
157156 interrupt-parent = <&gic>;
158157 interrupts = <0 165 4>;
@@ -161,7 +160,7 @@ · 2 unmodified lines
161160 };
162161
163162 sdhi1: sdhi@ee120000 {
164− compatible = "renesas,r8a7790-sdhi";
163+ compatible = "renesas,sdhi-r8a7790";
165164 reg = <0 0xee120000 0 0x100>;
166165 interrupt-parent = <&gic>;
167166 interrupts = <0 166 4>;
@@ -170,7 +169,7 @@ · 2 unmodified lines
170169 };
171170
172171 sdhi2: sdhi@ee140000 {
173− compatible = "renesas,r8a7790-sdhi";
172+ compatible = "renesas,sdhi-r8a7790";
174173 reg = <0 0xee140000 0 0x100>;
175174 interrupt-parent = <&gic>;
176175 interrupts = <0 167 4>;
@@ -179,7 +178,7 @@ · 2 unmodified lines
179178 };
180179
181180 sdhi3: sdhi@ee160000 {
182− compatible = "renesas,r8a7790-sdhi";
181+ compatible = "renesas,sdhi-r8a7790";
183182 reg = <0 0xee160000 0 0x100>;
184183 interrupt-parent = <&gic>;
185184 interrupts = <0 168 4>;
arch/arm/boot/dts/sh73a0.dtsi+3−3
@@ -196,7 +196,7 @@ · 195 unmodified lines
196196 };
197197
198198 sdhi0: sdhi@ee100000 {
199− compatible = "renesas,r8a7740-sdhi";
199+ compatible = "renesas,sdhi-r8a7740";
200200 reg = <0xee100000 0x100>;
201201 interrupt-parent = <&gic>;
202202 interrupts = <0 83 4
@@ -208,7 +208,7 @@ · 5 unmodified lines
208208
209209 /* SDHI1 and SDHI2 have no CD pins, no need for CD IRQ */
210210 sdhi1: sdhi@ee120000 {
211− compatible = "renesas,r8a7740-sdhi";
211+ compatible = "renesas,sdhi-r8a7740";
212212 reg = <0xee120000 0x100>;
213213 interrupt-parent = <&gic>;
214214 interrupts = <0 88 4
@@ -219,7 +219,7 @@ · 4 unmodified lines
219219 };
220220
221221 sdhi2: sdhi@ee140000 {
222− compatible = "renesas,r8a7740-sdhi";
222+ compatible = "renesas,sdhi-r8a7740";
223223 reg = <0xee140000 0x100>;
224224 interrupt-parent = <&gic>;
225225 interrupts = <0 104 4
arch/arm/common/edma.c+31−7
@@ -269,6 +269,11 @@ static const struct edmacc_param dummy_paramset = { · 268 unmodified lines
269269 .ccnt = 1,
270270 };
271271
272+static const struct of_device_id edma_of_ids[] = {
273+ { .compatible = "ti,edma3", },
274+ {}
275+};
276+
272277 /*****************************************************************************/
273278
274279 static void map_dmach_queue(unsigned ctlr, unsigned ch_no,
@@ -560,14 +565,38 @@ static int reserve_contiguous_slots(int ctlr, unsigned int id, · 285 unmodified lines
560565 static int prepare_unused_channel_list(struct device *dev, void *data)
561566 {
562567 struct platform_device *pdev = to_platform_device(dev);
563− int i, ctlr;
568+ int i, count, ctlr;
569+ struct of_phandle_args dma_spec;
564570
571+ if (dev->of_node) {
572+ count = of_property_count_strings(dev->of_node, "dma-names");
573+ if (count < 0)
574+ return 0;
575+ for (i = 0; i < count; i++) {
576+ if (of_parse_phandle_with_args(dev->of_node, "dmas",
577+ "#dma-cells", i,
578+ &dma_spec))
579+ continue;
580+
581+ if (!of_match_node(edma_of_ids, dma_spec.np)) {
582+ of_node_put(dma_spec.np);
583+ continue;
584+ }
585+
586+ clear_bit(EDMA_CHAN_SLOT(dma_spec.args[0]),
587+ edma_cc[0]->edma_unused);
588+ of_node_put(dma_spec.np);
589+ }
590+ return 0;
591+ }
592+
593+ /* For non-OF case */
565594 for (i = 0; i < pdev->num_resources; i++) {
566595 if ((pdev->resource[i].flags & IORESOURCE_DMA) &&
567596 (int)pdev->resource[i].start >= 0) {
568597 ctlr = EDMA_CTLR(pdev->resource[i].start);
569598 clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start),
570− edma_cc[ctlr]->edma_unused);
599+ edma_cc[ctlr]->edma_unused);
571600 }
572601 }
573602
@@ -1762,11 +1791,6 @@ static int edma_probe(struct platform_device *pdev) · 1188 unmodified lines
17621791 return 0;
17631792 }
17641793
1765−static const struct of_device_id edma_of_ids[] = {
1766− { .compatible = "ti,edma3", },
1767− {}
1768−};
1769−
17701794 static struct platform_driver edma_driver = {
17711795 .driver = {
17721796 .name = "edma",
arch/arm/configs/multi_v7_defconfig+3−0
@@ -36,6 +36,7 @@ CONFIG_ARCH_TEGRA_114_SOC=y · 35 unmodified lines
3636 CONFIG_TEGRA_PCI=y
3737 CONFIG_TEGRA_EMC_SCALING_ENABLE=y
3838 CONFIG_ARCH_U8500=y
39+CONFIG_MACH_HREFV60=y
3940 CONFIG_MACH_SNOWBALL=y
4041 CONFIG_MACH_UX500_DT=y
4142 CONFIG_ARCH_VEXPRESS=y
@@ -46,6 +47,7 @@ CONFIG_ARCH_ZYNQ=y · 4 unmodified lines
4647 CONFIG_SMP=y
4748 CONFIG_HIGHPTE=y
4849 CONFIG_ARM_APPENDED_DTB=y
50+CONFIG_ARM_ATAG_DTB_COMPAT=y
4951 CONFIG_NET=y
5052 CONFIG_UNIX=y
5153 CONFIG_INET=y
@@ -133,6 +135,7 @@ CONFIG_MMC=y · 81 unmodified lines
133135 CONFIG_MMC_ARMMMCI=y
134136 CONFIG_MMC_SDHCI=y
135137 CONFIG_MMC_SDHCI_PLTFM=y
138+CONFIG_MMC_SDHCI_ESDHC_IMX=y
136139 CONFIG_MMC_SDHCI_TEGRA=y
137140 CONFIG_MMC_SDHCI_SPEAR=y
138141 CONFIG_MMC_OMAP=y
arch/arm/crypto/aes-armv4.S+3−3
@@ -148,7 +148,7 @@ AES_Te: · 147 unmodified lines
148148 @ const AES_KEY *key) {
149149 .align 5
150150 ENTRY(AES_encrypt)
151− sub r3,pc,#8 @ AES_encrypt
151+ adr r3,AES_encrypt
152152 stmdb sp!,{r1,r4-r12,lr}
153153 mov r12,r0 @ inp
154154 mov r11,r2
@@ -381,7 +381,7 @@ _armv4_AES_encrypt: · 226 unmodified lines
381381 .align 5
382382 ENTRY(private_AES_set_encrypt_key)
383383 _armv4_AES_set_encrypt_key:
384− sub r3,pc,#8 @ AES_set_encrypt_key
384+ adr r3,_armv4_AES_set_encrypt_key
385385 teq r0,#0
386386 moveq r0,#-1
387387 beq .Labrt
@@ -843,7 +843,7 @@ AES_Td: · 455 unmodified lines
843843 @ const AES_KEY *key) {
844844 .align 5
845845 ENTRY(AES_decrypt)
846− sub r3,pc,#8 @ AES_decrypt
846+ adr r3,AES_decrypt
847847 stmdb sp!,{r1,r4-r12,lr}
848848 mov r12,r0 @ inp
849849 mov r11,r2
arch/arm/include/asm/uaccess.h+7−0
@@ -19,6 +19,13 @@ · 18 unmodified lines
1919 #include <asm/unified.h>
2020 #include <asm/compiler.h>
2121
22+#if __LINUX_ARM_ARCH__ < 6
23+#include <asm-generic/uaccess-unaligned.h>
24+#else
25+#define __get_user_unaligned __get_user
26+#define __put_user_unaligned __put_user
27+#endif
28+
2229 #define VERIFY_READ 0
2330 #define VERIFY_WRITE 1
2431
arch/arm/kernel/entry-common.S+2−2
@@ -442,10 +442,10 @@ local_restart: · 441 unmodified lines
442442 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
443443
444444 add r1, sp, #S_OFF
445− cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE)
445+2: cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE)
446446 eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back
447447 bcs arm_syscall
448−2: mov why, #0 @ no longer a real syscall
448+ mov why, #0 @ no longer a real syscall
449449 b sys_ni_syscall @ not private func
450450
451451 #if defined(CONFIG_OABI_COMPAT) || !defined(CONFIG_AEABI)
arch/arm/kernel/entry-header.S+4−4
@@ -329,10 +329,10 @@ · 328 unmodified lines
329329 #ifdef CONFIG_CONTEXT_TRACKING
330330 .if \save
331331 stmdb sp!, {r0-r3, ip, lr}
332− bl user_exit
332+ bl context_tracking_user_exit
333333 ldmia sp!, {r0-r3, ip, lr}
334334 .else
335− bl user_exit
335+ bl context_tracking_user_exit
336336 .endif
337337 #endif
338338 .endm
@@ -341,10 +341,10 @@ · 2 unmodified lines
341341 #ifdef CONFIG_CONTEXT_TRACKING
342342 .if \save
343343 stmdb sp!, {r0-r3, ip, lr}
344− bl user_enter
344+ bl context_tracking_user_enter
345345 ldmia sp!, {r0-r3, ip, lr}
346346 .else
347− bl user_enter
347+ bl context_tracking_user_enter
348348 .endif
349349 #endif
350350 .endm
arch/arm/kvm/reset.c+3−3
@@ -58,14 +58,14 @@ static const struct kvm_irq_level a15_vtimer_irq = { · 57 unmodified lines
5858 */
5959 int kvm_reset_vcpu(struct kvm_vcpu *vcpu)
6060 {
61− struct kvm_regs *cpu_reset;
61+ struct kvm_regs *reset_regs;
6262 const struct kvm_irq_level *cpu_vtimer_irq;
6363
6464 switch (vcpu->arch.target) {
6565 case KVM_ARM_TARGET_CORTEX_A15:
6666 if (vcpu->vcpu_id > a15_max_cpu_idx)
6767 return -EINVAL;
68− cpu_reset = &a15_regs_reset;
68+ reset_regs = &a15_regs_reset;
6969 vcpu->arch.midr = read_cpuid_id();
7070 cpu_vtimer_irq = &a15_vtimer_irq;
7171 break;
@@ -74,7 +74,7 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu) · 2 unmodified lines
7474 }
7575
7676 /* Reset core registers */
77− memcpy(&vcpu->arch.regs, cpu_reset, sizeof(vcpu->arch.regs));
77+ memcpy(&vcpu->arch.regs, reset_regs, sizeof(vcpu->arch.regs));
7878
7979 /* Reset CP15 registers */
8080 kvm_reset_coprocs(vcpu);
arch/arm/mach-at91/at91rm9200_time.c+1−1
@@ -93,7 +93,7 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id) · 92 unmodified lines
9393
9494 static struct irqaction at91rm9200_timer_irq = {
9595 .name = "at91_tick",
96− .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
96+ .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
9797 .handler = at91rm9200_timer_interrupt,
9898 .irq = NR_IRQS_LEGACY + AT91_ID_SYS,
9999 };
arch/arm/mach-at91/at91sam926x_time.c+1−1
@@ -171,7 +171,7 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id) · 170 unmodified lines
171171
172172 static struct irqaction at91sam926x_pit_irq = {
173173 .name = "at91_tick",
174− .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
174+ .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
175175 .handler = at91sam926x_pit_interrupt,
176176 .irq = NR_IRQS_LEGACY + AT91_ID_SYS,
177177 };
arch/arm/mach-at91/at91sam9g45_reset.S+8−0
@@ -16,11 +16,17 @@ · 15 unmodified lines
1616 #include "at91_rstc.h"
1717 .arm
1818
19+/*
20+ * at91_ramc_base is an array void*
21+ * init at NULL if only one DDR controler is present in or DT
22+ */
1923 .globl at91sam9g45_restart
2024
2125 at91sam9g45_restart:
2226 ldr r5, =at91_ramc_base @ preload constants
2327 ldr r0, [r5]
28+ ldr r5, [r5, #4] @ ddr1
29+ cmp r5, #0
2430 ldr r4, =at91_rstc_base
2531 ldr r1, [r4]
2632
@@ -30,6 +36,8 @@ at91sam9g45_restart: · 3 unmodified lines
3036
3137 .balign 32 @ align to cache line
3238
39+ strne r2, [r5, #AT91_DDRSDRC_RTR] @ disable DDR1 access
40+ strne r3, [r5, #AT91_DDRSDRC_LPR] @ power down DDR1
3341 str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access
3442 str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0
3543 str r4, [r1, #AT91_RSTC_CR] @ reset processor
arch/arm/mach-at91/at91x40_time.c+1−1
@@ -57,7 +57,7 @@ static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) · 56 unmodified lines
5757
5858 static struct irqaction at91x40_timer_irq = {
5959 .name = "at91_tick",
60− .flags = IRQF_DISABLED | IRQF_TIMER,
60+ .flags = IRQF_TIMER,
6161 .handler = at91x40_timer_interrupt
6262 };
6363
arch/arm/mach-davinci/board-dm365-evm.c+1−1
@@ -176,7 +176,7 @@ static struct at24_platform_data eeprom_info = { · 175 unmodified lines
176176 .context = (void *)0x7f00,
177177 };
178178
179−static struct snd_platform_data dm365_evm_snd_data = {
179+static struct snd_platform_data dm365_evm_snd_data __maybe_unused = {
180180 .asp_chan_q = EVENTQ_3,
181181 };
182182
arch/arm/mach-davinci/include/mach/serial.h+2−2
@@ -15,8 +15,6 @@ · 14 unmodified lines
1515
1616 #include <mach/hardware.h>
1717
18−#include <linux/platform_device.h>
19−
2018 #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
2119 #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
2220 #define DAVINCI_UART2_BASE (IO_PHYS + 0x20800)
@@ -39,6 +37,8 @@ · 16 unmodified lines
3937 #define UART_DM646X_SCR_TX_WATERMARK 0x08
4038
4139 #ifndef __ASSEMBLY__
40+#include <linux/platform_device.h>
41+
4242 extern int davinci_serial_init(struct platform_device *);
4343 #endif
4444
arch/arm/mach-imx/clk-fixup-mux.c+1−0
@@ -90,6 +90,7 @@ struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg, · 89 unmodified lines
9090 init.ops = &clk_fixup_mux_ops;
9191 init.parent_names = parents;
9292 init.num_parents = num_parents;
93+ init.flags = 0;
9394
9495 fixup_mux->mux.reg = reg;
9596 fixup_mux->mux.shift = shift;
arch/arm/mach-imx/clk-imx27.c+1−1
@@ -285,7 +285,7 @@ int __init mx27_clocks_init(unsigned long fref) · 284 unmodified lines
285285 clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL);
286286 clk_register_clkdev(clk[rtc_ipg_gate], NULL, "imx21-rtc");
287287 clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL);
288− clk_register_clkdev(clk[cpu_div], NULL, "cpufreq-cpu0.0");
288+ clk_register_clkdev(clk[cpu_div], NULL, "cpu0");
289289 clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL);
290290
291291 mxc_timer_init(MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR), MX27_INT_GPT1);
arch/arm/mach-imx/clk-imx51-imx53.c+2−2
@@ -328,7 +328,7 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, · 327 unmodified lines
328328 clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1");
329329 clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2");
330330 clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma");
331− clk_register_clkdev(clk[cpu_podf], NULL, "cpufreq-cpu0.0");
331+ clk_register_clkdev(clk[cpu_podf], NULL, "cpu0");
332332 clk_register_clkdev(clk[iim_gate], "iim", NULL);
333333 clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.0");
334334 clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.1");
@@ -397,7 +397,7 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc, · 62 unmodified lines
397397 mx51_spdif_xtal_sel, ARRAY_SIZE(mx51_spdif_xtal_sel));
398398 clk[spdif1_sel] = imx_clk_mux("spdif1_sel", MXC_CCM_CSCMR2, 2, 2,
399399 spdif_sel, ARRAY_SIZE(spdif_sel));
400− clk[spdif1_pred] = imx_clk_divider("spdif1_podf", "spdif1_sel", MXC_CCM_CDCDR, 16, 3);
400+ clk[spdif1_pred] = imx_clk_divider("spdif1_pred", "spdif1_sel", MXC_CCM_CDCDR, 16, 3);
401401 clk[spdif1_podf] = imx_clk_divider("spdif1_podf", "spdif1_pred", MXC_CCM_CDCDR, 9, 6);
402402 clk[spdif1_com_sel] = imx_clk_mux("spdif1_com_sel", MXC_CCM_CSCMR2, 5, 1,
403403 mx51_spdif1_com_sel, ARRAY_SIZE(mx51_spdif1_com_sel));
arch/arm/mach-imx/mach-imx6q.c+7−2
@@ -233,10 +233,15 @@ put_node: · 232 unmodified lines
233233 of_node_put(np);
234234 }
235235
236−static void __init imx6q_opp_init(struct device *cpu_dev)
236+static void __init imx6q_opp_init(void)
237237 {
238238 struct device_node *np;
239+ struct device *cpu_dev = get_cpu_device(0);
239240
241+ if (!cpu_dev) {
242+ pr_warn("failed to get cpu0 device\n");
243+ return;
244+ }
240245 np = of_node_get(cpu_dev->of_node);
241246 if (!np) {
242247 pr_warn("failed to find cpu0 node\n");
@@ -268,7 +273,7 @@ static void __init imx6q_init_late(void) · 25 unmodified lines
268273 imx6q_cpuidle_init();
269274
270275 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) {
271− imx6q_opp_init(&imx6q_cpufreq_pdev.dev);
276+ imx6q_opp_init();
272277 platform_device_register(&imx6q_cpufreq_pdev);
273278 }
274279 }
arch/arm/mach-imx/system.c+11−0
@@ -117,6 +117,17 @@ void __init imx_init_l2cache(void) · 116 unmodified lines
117117 /* Configure the L2 PREFETCH and POWER registers */
118118 val = readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
119119 val |= 0x70800000;
120+ /*
121+ * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0
122+ * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2
123+ * But according to ARM PL310 errata: 752271
124+ * ID: 752271: Double linefill feature can cause data corruption
125+ * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2
126+ * Workaround: The only workaround to this erratum is to disable the
127+ * double linefill feature. This is the default behavior.
128+ */
129+ if (cpu_is_imx6q())
130+ val &= ~(1 << 30 | 1 << 23);
120131 writel_relaxed(val, l2x0_base + L2X0_PREFETCH_CTRL);
121132 val = L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN;
122133 writel_relaxed(val, l2x0_base + L2X0_POWER_CTRL);
arch/arm/mach-integrator/pci_v3.h+7−0
@@ -1,2 +1,9 @@
11 /* Simple oneliner include to the PCIv3 early init */
2+#ifdef CONFIG_PCI
23 extern int pci_v3_early_init(void);
4+#else
5+static inline int pci_v3_early_init(void)
6+{
7+ return 0;
8+}
9+#endif
arch/arm/mach-mvebu/coherency.c+7−1
@@ -140,6 +140,7 @@ int __init coherency_init(void) · 139 unmodified lines
140140 coherency_base = of_iomap(np, 0);
141141 coherency_cpu_base = of_iomap(np, 1);
142142 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
143+ of_node_put(np);
143144 }
144145
145146 return 0;
@@ -147,9 +148,14 @@ int __init coherency_init(void) · 1 unmodified line
147148
148149 static int __init coherency_late_init(void)
149150 {
150− if (of_find_matching_node(NULL, of_coherency_table))
151+ struct device_node *np;
152+
153+ np = of_find_matching_node(NULL, of_coherency_table);
154+ if (np) {
151155 bus_register_notifier(&platform_bus_type,
152156 &mvebu_hwcc_platform_nb);
157+ of_node_put(np);
158+ }
153159 return 0;
154160 }
155161
arch/arm/mach-mvebu/pmsu.c+1−0
@@ -67,6 +67,7 @@ int __init armada_370_xp_pmsu_init(void) · 66 unmodified lines
6767 pr_info("Initializing Power Management Service Unit\n");
6868 pmsu_mp_base = of_iomap(np, 0);
6969 pmsu_reset_base = of_iomap(np, 1);
70+ of_node_put(np);
7071 }
7172
7273 return 0;
arch/arm/mach-mvebu/system-controller.c+1−0
@@ -98,6 +98,7 @@ static int __init mvebu_system_controller_init(void) · 97 unmodified lines
9898 BUG_ON(!match);
9999 system_controller_base = of_iomap(np, 0);
100100 mvebu_sc = (struct mvebu_system_controller *)match->data;
101+ of_node_put(np);
101102 }
102103
103104 return 0;
arch/arm/mach-omap2/cclock44xx_data.c+1−1
@@ -1632,7 +1632,7 @@ static struct omap_clk omap44xx_clks[] = { · 1631 unmodified lines
16321632 CLK(NULL, "auxclk5_src_ck", &auxclk5_src_ck),
16331633 CLK(NULL, "auxclk5_ck", &auxclk5_ck),
16341634 CLK(NULL, "auxclkreq5_ck", &auxclkreq5_ck),
1635− CLK("omap-gpmc", "fck", &dummy_ck),
1635+ CLK("50000000.gpmc", "fck", &dummy_ck),
16361636 CLK("omap_i2c.1", "ick", &dummy_ck),
16371637 CLK("omap_i2c.2", "ick", &dummy_ck),
16381638 CLK("omap_i2c.3", "ick", &dummy_ck),
arch/arm/mach-omap2/cpuidle44xx.c+1−1
@@ -143,7 +143,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, · 142 unmodified lines
143143 * Call idle CPU cluster PM exit notifier chain
144144 * to restore GIC and wakeupgen context.
145145 */
146− if ((cx->mpu_state == PWRDM_POWER_RET) &&
146+ if (dev->cpu == 0 && (cx->mpu_state == PWRDM_POWER_RET) &&
147147 (cx->mpu_logic_state == PWRDM_POWER_OFF))
148148 cpu_cluster_pm_exit();
149149
arch/arm/mach-omap2/gpmc.c+2−2
@@ -1491,8 +1491,8 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, · 1490 unmodified lines
14911491 */
14921492 ret = gpmc_cs_remap(cs, res.start);
14931493 if (ret < 0) {
1494− dev_err(&pdev->dev, "cannot remap GPMC CS %d to 0x%x\n",
1495− cs, res.start);
1494+ dev_err(&pdev->dev, "cannot remap GPMC CS %d to %pa\n",
1495+ cs, &res.start);
14961496 goto err;
14971497 }
14981498
arch/arm/mach-omap2/mux34xx.c+1−1
@@ -620,7 +620,7 @@ static struct omap_mux __initdata omap3_muxmodes[] = { · 619 unmodified lines
620620 "uart1_rts", "ssi1_flag_tx", NULL, NULL,
621621 "gpio_149", NULL, NULL, "safe_mode"),
622622 _OMAP3_MUXENTRY(UART1_RX, 151,
623− "uart1_rx", "ss1_wake_tx", "mcbsp1_clkr", "mcspi4_clk",
623+ "uart1_rx", "ssi1_wake_tx", "mcbsp1_clkr", "mcspi4_clk",
624624 "gpio_151", NULL, NULL, "safe_mode"),
625625 _OMAP3_MUXENTRY(UART1_TX, 148,
626626 "uart1_tx", "ssi1_dat_tx", NULL, NULL,
arch/arm/mach-omap2/omap-smp.c+1−1
@@ -1,5 +1,5 @@
11 /*
2− * OMAP4 SMP source file. It contains platform specific fucntions
2+ * OMAP4 SMP source file. It contains platform specific functions
33 * needed for the linux smp kernel.
44 *
55 * Copyright (C) 2009 Texas Instruments, Inc.
arch/arm/mach-omap2/omap_device.c+1−1
@@ -158,7 +158,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev) · 157 unmodified lines
158158 }
159159
160160 od = omap_device_alloc(pdev, hwmods, oh_cnt);
161− if (!od) {
161+ if (IS_ERR(od)) {
162162 dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n",
163163 oh_name);
164164 ret = PTR_ERR(od);
arch/arm/mach-sa1100/collie.c+1−1
@@ -289,7 +289,7 @@ static void collie_flash_exit(void) · 288 unmodified lines
289289 }
290290
291291 static struct flash_platform_data collie_flash_data = {
292− .map_name = "cfi_probe",
292+ .map_name = "jedec_probe",
293293 .init = collie_flash_init,
294294 .set_vpp = collie_set_vpp,
295295 .exit = collie_flash_exit,
arch/arm/mach-shmobile/board-armadillo800eva.c+2−2
@@ -1108,9 +1108,9 @@ static const struct pinctrl_map eva_pinctrl_map[] = { · 1107 unmodified lines
11081108 PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.1", "pfc-r8a7740",
11091109 "fsib_mclk_in", "fsib"),
11101110 /* GETHER */
1111− PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7740",
1111+ PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740",
11121112 "gether_mii", "gether"),
1113− PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7740",
1113+ PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740",
11141114 "gether_int", "gether"),
11151115 /* HDMI */
11161116 PIN_MAP_MUX_GROUP_DEFAULT("sh-mobile-hdmi", "pfc-r8a7740",
arch/arm/mach-shmobile/board-lager.c+26−1
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/pinctrl/machine.h>
3030 #include <linux/platform_data/gpio-rcar.h>
3131 #include <linux/platform_device.h>
32+#include <linux/phy.h>
3233 #include <linux/regulator/fixed.h>
3334 #include <linux/regulator/machine.h>
3435 #include <linux/sh_eth.h>
@@ -155,6 +156,30 @@ static void __init lager_add_standard_devices(void) · 120 unmodified lines
155156 &ether_pdata, sizeof(ether_pdata));
156157 }
157158
159+/*
160+ * Ether LEDs on the Lager board are named LINK and ACTIVE which corresponds
161+ * to non-default 01 setting of the Micrel KSZ8041 PHY control register 1 bits
162+ * 14-15. We have to set them back to 01 from the default 00 value each time
163+ * the PHY is reset. It's also important because the PHY's LED0 signal is
164+ * connected to SoC's ETH_LINK signal and in the PHY's default mode it will
165+ * bounce on and off after each packet, which we apparently want to avoid.
166+ */
167+static int lager_ksz8041_fixup(struct phy_device *phydev)
168+{
169+ u16 phyctrl1 = phy_read(phydev, 0x1e);
170+
171+ phyctrl1 &= ~0xc000;
172+ phyctrl1 |= 0x4000;
173+ return phy_write(phydev, 0x1e, phyctrl1);
174+}
175+
176+static void __init lager_init(void)
177+{
178+ lager_add_standard_devices();
179+
180+ phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup);
181+}
182+
158183 static const char *lager_boards_compat_dt[] __initdata = {
159184 "renesas,lager",
160185 NULL,
@@ -163,6 +188,6 @@ static const char *lager_boards_compat_dt[] __initdata = { · 2 unmodified lines
163188 DT_MACHINE_START(LAGER_DT, "lager")
164189 .init_early = r8a7790_init_delay,
165190 .init_time = r8a7790_timer_init,
166− .init_machine = lager_add_standard_devices,
191+ .init_machine = lager_init,
167192 .dt_compat = lager_boards_compat_dt,
168193 MACHINE_END
arch/arm/mach-shmobile/clock-r8a73a4.c+1−1
@@ -555,7 +555,7 @@ static struct clk_lookup lookups[] = { · 554 unmodified lines
555555 CLKDEV_CON_ID("pll2h", &pll2h_clk),
556556
557557 /* CPU clock */
558− CLKDEV_DEV_ID("cpufreq-cpu0", &z_clk),
558+ CLKDEV_DEV_ID("cpu0", &z_clk),
559559
560560 /* DIV6 */
561561 CLKDEV_CON_ID("zb", &div6_clks[DIV6_ZB]),
arch/arm/mach-shmobile/clock-sh73a0.c+1−1
@@ -616,7 +616,7 @@ static struct clk_lookup lookups[] = { · 615 unmodified lines
616616 CLKDEV_DEV_ID("smp_twd", &twd_clk), /* smp_twd */
617617
618618 /* DIV4 clocks */
619− CLKDEV_DEV_ID("cpufreq-cpu0", &div4_clks[DIV4_Z]),
619+ CLKDEV_DEV_ID("cpu0", &div4_clks[DIV4_Z]),
620620
621621 /* DIV6 clocks */
622622 CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]),
arch/arm/mach-u300/Kconfig+5−5
@@ -1,7 +1,3 @@
1−menu "ST-Ericsson AB U300/U335 Platform"
2−
3−comment "ST-Ericsson Mobile Platform Products"
4−
51 config ARCH_U300
62 bool "ST-Ericsson U300 Series" if ARCH_MULTI_V5
73 depends on MMU
@@ -25,7 +21,9 @@ config ARCH_U300 · 17 unmodified lines
2521 help
2622 Support for ST-Ericsson U300 series mobile platforms.
2723
28−comment "ST-Ericsson U300/U335 Feature Selections"
24+if ARCH_U300
25+
26+menu "ST-Ericsson AB U300/U335 Platform"
2927
3028 config MACH_U300
3129 depends on ARCH_U300
@@ -53,3 +51,5 @@ config MACH_U300_SPIDUMMY · 21 unmodified lines
5351 SPI framework and ARM PL022 support.
5452
5553 endmenu
54+
55+endif
arch/arm/mach-ux500/cache-l2x0.c+1−0
@@ -69,6 +69,7 @@ static int __init ux500_l2x0_init(void) · 68 unmodified lines
6969 * some SMI service available.
7070 */
7171 outer_cache.disable = NULL;
72+ outer_cache.set_debug = NULL;
7273
7374 return 0;
7475 }
arch/arm/mach-vexpress/tc2_pm.c+10−1
@@ -131,6 +131,16 @@ static void tc2_pm_down(u64 residency) · 130 unmodified lines
131131 } else
132132 BUG();
133133
134+ /*
135+ * If the CPU is committed to power down, make sure
136+ * the power controller will be in charge of waking it
137+ * up upon IRQ, ie IRQ lines are cut from GIC CPU IF
138+ * to the CPU by disabling the GIC CPU IF to prevent wfi
139+ * from completing execution behind power controller back
140+ */
141+ if (!skip_wfi)
142+ gic_cpu_if_down();
143+
134144 if (last_man && __mcpm_outbound_enter_critical(cpu, cluster)) {
135145 arch_spin_unlock(&tc2_pm_lock);
136146
@@ -231,7 +241,6 @@ static void tc2_pm_suspend(u64 residency) · 94 unmodified lines
231241 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
232242 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
233243 ve_spc_set_resume_addr(cluster, cpu, virt_to_phys(mcpm_entry_point));
234− gic_cpu_if_down();
235244 tc2_pm_down(residency);
236245 }
237246
arch/arm64/Kconfig.debug+0−7
@@ -6,13 +6,6 @@ config FRAME_POINTER · 5 unmodified lines
66 bool
77 default y
88
9−config DEBUG_STACK_USAGE
10− bool "Enable stack utilization instrumentation"
11− depends on DEBUG_KERNEL
12− help
13− Enables the display of the minimum amount of free stack which each
14− task has ever had available in the sysrq-T output.
15−
169 config EARLY_PRINTK
1710 bool "Early printk support"
1811 default y
arch/arm64/configs/defconfig+4−1
@@ -42,7 +42,7 @@ CONFIG_IP_PNP_BOOTP=y · 41 unmodified lines
4242 # CONFIG_WIRELESS is not set
4343 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
4444 CONFIG_DEVTMPFS=y
45−# CONFIG_BLK_DEV is not set
45+CONFIG_BLK_DEV=y
4646 CONFIG_SCSI=y
4747 # CONFIG_SCSI_PROC_FS is not set
4848 CONFIG_BLK_DEV_SD=y
@@ -72,6 +72,7 @@ CONFIG_LOGO=y · 23 unmodified lines
7272 # CONFIG_IOMMU_SUPPORT is not set
7373 CONFIG_EXT2_FS=y
7474 CONFIG_EXT3_FS=y
75+CONFIG_EXT4_FS=y
7576 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
7677 # CONFIG_EXT3_FS_XATTR is not set
7778 CONFIG_FUSE_FS=y
@@ -90,3 +91,5 @@ CONFIG_DEBUG_KERNEL=y · 12 unmodified lines
9091 CONFIG_DEBUG_INFO=y
9192 # CONFIG_FTRACE is not set
9293 CONFIG_ATOMIC64_SELFTEST=y
94+CONFIG_VIRTIO_MMIO=y
95+CONFIG_VIRTIO_BLK=y
arch/arm64/include/asm/hwcap.h+1−1
@@ -43,6 +43,6 @@ · 42 unmodified lines
4343 COMPAT_HWCAP_VFPv3|COMPAT_HWCAP_VFPv4|\
4444 COMPAT_HWCAP_NEON|COMPAT_HWCAP_IDIV)
4545
46−extern unsigned int elf_hwcap;
46+extern unsigned long elf_hwcap;
4747 #endif
4848 #endif
arch/arm64/include/asm/uaccess.h+6−4
@@ -166,9 +166,10 @@ do { \ · 165 unmodified lines
166166
167167 #define get_user(x, ptr) \
168168 ({ \
169+ __typeof__(*(ptr)) __user *__p = (ptr); \
169170 might_fault(); \
170− access_ok(VERIFY_READ, (ptr), sizeof(*(ptr))) ? \
171− __get_user((x), (ptr)) : \
171+ access_ok(VERIFY_READ, __p, sizeof(*__p)) ? \
172+ __get_user((x), __p) : \
172173 ((x) = 0, -EFAULT); \
173174 })
174175
@@ -227,9 +228,10 @@ do { \ · 52 unmodified lines
227228
228229 #define put_user(x, ptr) \
229230 ({ \
231+ __typeof__(*(ptr)) __user *__p = (ptr); \
230232 might_fault(); \
231− access_ok(VERIFY_WRITE, (ptr), sizeof(*(ptr))) ? \
232− __put_user((x), (ptr)) : \
233+ access_ok(VERIFY_WRITE, __p, sizeof(*__p)) ? \
234+ __put_user((x), __p) : \
233235 -EFAULT; \
234236 })
235237
arch/arm64/kernel/fpsimd.c+2−0
@@ -80,8 +80,10 @@ void fpsimd_thread_switch(struct task_struct *next) · 79 unmodified lines
8080
8181 void fpsimd_flush_thread(void)
8282 {
83+ preempt_disable();
8384 memset(&current->thread.fpsimd_state, 0, sizeof(struct fpsimd_state));
8485 fpsimd_load_state(&current->thread.fpsimd_state);
86+ preempt_enable();
8587 }
8688
8789 #ifdef CONFIG_KERNEL_MODE_NEON
arch/arm64/kernel/process.c+16−5
@@ -143,15 +143,26 @@ void machine_restart(char *cmd) · 142 unmodified lines
143143
144144 void __show_regs(struct pt_regs *regs)
145145 {
146− int i;
146+ int i, top_reg;
147+ u64 lr, sp;
148+
149+ if (compat_user_mode(regs)) {
150+ lr = regs->compat_lr;
151+ sp = regs->compat_sp;
152+ top_reg = 12;
153+ } else {
154+ lr = regs->regs[30];
155+ sp = regs->sp;
156+ top_reg = 29;
157+ }
147158
148159 show_regs_print_info(KERN_DEFAULT);
149160 print_symbol("PC is at %s\n", instruction_pointer(regs));
150− print_symbol("LR is at %s\n", regs->regs[30]);
161+ print_symbol("LR is at %s\n", lr);
151162 printk("pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n",
152− regs->pc, regs->regs[30], regs->pstate);
153− printk("sp : %016llx\n", regs->sp);
154− for (i = 29; i >= 0; i--) {
163+ regs->pc, lr, regs->pstate);
164+ printk("sp : %016llx\n", sp);
165+ for (i = top_reg; i >= 0; i--) {
155166 printk("x%-2d: %016llx ", i, regs->regs[i]);
156167 if (i % 2 == 0)
157168 printk("\n");
arch/arm64/kernel/setup.c+1−1
@@ -57,7 +57,7 @@ · 56 unmodified lines
5757 unsigned int processor_id;
5858 EXPORT_SYMBOL(processor_id);
5959
60−unsigned int elf_hwcap __read_mostly;
60+unsigned long elf_hwcap __read_mostly;
6161 EXPORT_SYMBOL_GPL(elf_hwcap);
6262
6363 static const char *cpu_name;
arch/arm64/mm/fault.c+1−1
@@ -130,7 +130,7 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr, · 129 unmodified lines
130130 force_sig_info(sig, &si, tsk);
131131 }
132132
133−void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
133+static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
134134 {
135135 struct task_struct *tsk = current;
136136 struct mm_struct *mm = tsk->active_mm;
arch/arm64/mm/tlb.S+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 */
3636 ENTRY(__cpu_flush_user_tlb_range)
3737 vma_vm_mm x3, x2 // get vma->vm_mm
38− mmid x3, x3 // get vm_mm->context.id
38+ mmid w3, x3 // get vm_mm->context.id
3939 dsb sy
4040 lsr x0, x0, #12 // align address
4141 lsr x1, x1, #12
arch/avr32/include/asm/Kbuild+16−2
@@ -1,6 +1,20 @@
11
22 generic-y += clkdev.h
3+generic-y += cputime.h
4+generic-y += delay.h
5+generic-y += device.h
6+generic-y += div64.h
7+generic-y += emergency-restart.h
38 generic-y += exec.h
4−generic-y += trace_clock.h
9+generic-y += futex.h
10+generic-y += preempt.h
11+generic-y += irq_regs.h
512 generic-y += param.h
6−generic-y += preempt.h
13+generic-y += local.h
14+generic-y += local64.h
15+generic-y += percpu.h
16+generic-y += scatterlist.h
17+generic-y += sections.h
18+generic-y += topology.h
19+generic-y += trace_clock.h
20+generic-y += xor.h
arch/avr32/include/asm/cputime.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_CPUTIME_H
2−#define __ASM_AVR32_CPUTIME_H
3−
4−#include <asm-generic/cputime.h>
5−
6−#endif /* __ASM_AVR32_CPUTIME_H */
arch/avr32/include/asm/delay.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/delay.h>
arch/avr32/include/asm/device.h+0−7
@@ -1,7 +0,0 @@
1−/*
2− * Arch specific extensions to struct device
3− *
4− * This file is released under the GPLv2
5− */
6−#include <asm-generic/device.h>
7−
arch/avr32/include/asm/div64.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_DIV64_H
2−#define __ASM_AVR32_DIV64_H
3−
4−#include <asm-generic/div64.h>
5−
6−#endif /* __ASM_AVR32_DIV64_H */
arch/avr32/include/asm/emergency-restart.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_EMERGENCY_RESTART_H
2−#define __ASM_AVR32_EMERGENCY_RESTART_H
3−
4−#include <asm-generic/emergency-restart.h>
5−
6−#endif /* __ASM_AVR32_EMERGENCY_RESTART_H */
arch/avr32/include/asm/futex.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_FUTEX_H
2−#define __ASM_AVR32_FUTEX_H
3−
4−#include <asm-generic/futex.h>
5−
6−#endif /* __ASM_AVR32_FUTEX_H */
arch/avr32/include/asm/irq_regs.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/irq_regs.h>
arch/avr32/include/asm/local.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_LOCAL_H
2−#define __ASM_AVR32_LOCAL_H
3−
4−#include <asm-generic/local.h>
5−
6−#endif /* __ASM_AVR32_LOCAL_H */
arch/avr32/include/asm/local64.h+0−1
@@ -1 +0,0 @@
1−#include <asm-generic/local64.h>
arch/avr32/include/asm/percpu.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_PERCPU_H
2−#define __ASM_AVR32_PERCPU_H
3−
4−#include <asm-generic/percpu.h>
5−
6−#endif /* __ASM_AVR32_PERCPU_H */
arch/avr32/include/asm/scatterlist.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_SCATTERLIST_H
2−#define __ASM_AVR32_SCATTERLIST_H
3−
4−#include <asm-generic/scatterlist.h>
5−
6−#endif /* __ASM_AVR32_SCATTERLIST_H */
arch/avr32/include/asm/sections.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_SECTIONS_H
2−#define __ASM_AVR32_SECTIONS_H
3−
4−#include <asm-generic/sections.h>
5−
6−#endif /* __ASM_AVR32_SECTIONS_H */
arch/avr32/include/asm/topology.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __ASM_AVR32_TOPOLOGY_H
2−#define __ASM_AVR32_TOPOLOGY_H
3−
4−#include <asm-generic/topology.h>
5−
6−#endif /* __ASM_AVR32_TOPOLOGY_H */
arch/avr32/include/asm/xor.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef _ASM_XOR_H
2−#define _ASM_XOR_H
3−
4−#include <asm-generic/xor.h>
5−
6−#endif
arch/avr32/kernel/process.c+1−1
@@ -289,7 +289,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, · 288 unmodified lines
289289 memset(childregs, 0, sizeof(struct pt_regs));
290290 p->thread.cpu_context.r0 = arg;
291291 p->thread.cpu_context.r1 = usp; /* fn */
292− p->thread.cpu_context.r2 = syscall_return;
292+ p->thread.cpu_context.r2 = (unsigned long)syscall_return;
293293 p->thread.cpu_context.pc = (unsigned long)ret_from_kernel_thread;
294294 childregs->sr = MODE_SUPERVISOR;
295295 } else {
arch/avr32/kernel/time.c+8−1
@@ -98,7 +98,14 @@ static void comparator_mode(enum clock_event_mode mode, · 97 unmodified lines
9898 case CLOCK_EVT_MODE_SHUTDOWN:
9999 sysreg_write(COMPARE, 0);
100100 pr_debug("%s: stop\n", evdev->name);
101− cpu_idle_poll_ctrl(false);
101+ if (evdev->mode == CLOCK_EVT_MODE_ONESHOT ||
102+ evdev->mode == CLOCK_EVT_MODE_RESUME) {
103+ /*
104+ * Only disable idle poll if we have forced that
105+ * in a previous call.
106+ */
107+ cpu_idle_poll_ctrl(false);
108+ }
102109 break;
103110 default:
104111 BUG();
arch/mips/Makefile+0−3
@@ -288,9 +288,6 @@ endif · 287 unmodified lines
288288 vmlinux.32: vmlinux
289289 $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@
290290
291−
292−#obj-$(CONFIG_KPROBES) += kprobes.o
293−
294291 #
295292 # The 64-bit ELF tools are pretty broken so at this time we generate 64-bit
296293 # ELF files from 32-bit files by conversion.
arch/mips/alchemy/board-mtx1.c+1−1
@@ -276,7 +276,7 @@ static struct platform_device mtx1_pci_host = { · 275 unmodified lines
276276 .resource = alchemy_pci_host_res,
277277 };
278278
279−static struct __initdata platform_device * mtx1_devs[] = {
279+static struct platform_device *mtx1_devs[] __initdata = {
280280 &mtx1_pci_host,
281281 &mtx1_gpio_leds,
282282 &mtx1_wdt,
arch/mips/alchemy/common/usb.c+2−1
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/module.h>
1515 #include <linux/spinlock.h>
1616 #include <linux/syscore_ops.h>
17+#include <asm/cpu.h>
1718 #include <asm/mach-au1x00/au1000.h>
1819
1920 /* control register offsets */
@@ -358,7 +359,7 @@ static inline int au1200_coherency_bug(void) · 338 unmodified lines
358359 {
359360 #if defined(CONFIG_DMA_COHERENT)
360361 /* Au1200 AB USB does not support coherent memory */
361− if (!(read_c0_prid() & 0xff)) {
362+ if (!(read_c0_prid() & PRID_REV_MASK)) {
362363 printk(KERN_INFO "Au1200 USB: this is chip revision AB !!\n");
363364 printk(KERN_INFO "Au1200 USB: update your board or re-configure"
364365 " the kernel\n");
arch/mips/bcm63xx/cpu.c+2−2
@@ -306,14 +306,14 @@ void __init bcm63xx_cpu_init(void) · 305 unmodified lines
306306
307307 switch (c->cputype) {
308308 case CPU_BMIPS3300:
309− if ((read_c0_prid() & 0xff00) != PRID_IMP_BMIPS3300_ALT)
309+ if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT)
310310 __cpu_name[cpu] = "Broadcom BCM6338";
311311 /* fall-through */
312312 case CPU_BMIPS32:
313313 chipid_reg = BCM_6345_PERF_BASE;
314314 break;
315315 case CPU_BMIPS4350:
316− switch ((read_c0_prid() & 0xff)) {
316+ switch ((read_c0_prid() & PRID_REV_MASK)) {
317317 case 0x04:
318318 chipid_reg = BCM_3368_PERF_BASE;
319319 break;
arch/mips/boot/dts/include/dt-bindings+1−1
@@ -1 +1 @@
1−../../../../../include/dt-bindings
1+../../../../../include/dt-bindings
arch/mips/cavium-octeon/csrc-octeon.c+1−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/smp.h>
1313
1414 #include <asm/cpu-info.h>
15+#include <asm/cpu-type.h>
1516 #include <asm/time.h>
1617
1718 #include <asm/octeon/octeon.h>
arch/mips/dec/prom/init.c+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313
1414 #include <asm/bootinfo.h>
1515 #include <asm/cpu.h>
16+#include <asm/cpu-type.h>
1617 #include <asm/processor.h>
1718
1819 #include <asm/dec/prom.h>
arch/mips/include/asm/cpu-features.h+1−7
@@ -13,12 +13,6 @@ · 12 unmodified lines
1313 #include <asm/cpu-info.h>
1414 #include <cpu-feature-overrides.h>
1515
16−#ifndef current_cpu_type
17−#define current_cpu_type() current_cpu_data.cputype
18−#endif
19−
20−#define boot_cpu_type() cpu_data[0].cputype
21−
2216 /*
2317 * SMP assumption: Options of CPU 0 are a superset of all processors.
2418 * This is true for all known MIPS systems.
@@ -193,7 +187,7 @@ · 168 unmodified lines
193187
194188 /*
195189 * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other
196− * pre-MIPS32/MIPS53 processors have CLO, CLZ. The IDT RC64574 is 64-bit and
190+ * pre-MIPS32/MIPS64 processors have CLO, CLZ. The IDT RC64574 is 64-bit and
197191 * has CLO and CLZ but not DCLO nor DCLZ. For 64-bit kernels
198192 * cpu_has_clo_clz also indicates the availability of DCLO and DCLZ.
199193 */
arch/mips/include/asm/cpu-info.h+1−0
@@ -84,6 +84,7 @@ struct cpuinfo_mips { · 83 unmodified lines
8484 extern struct cpuinfo_mips cpu_data[];
8585 #define current_cpu_data cpu_data[smp_processor_id()]
8686 #define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
87+#define boot_cpu_data cpu_data[0]
8788
8889 extern void cpu_probe(void);
8990 extern void cpu_report(void);
arch/mips/include/asm/cpu-type.h+203−0
@@ -0,0 +1,203 @@
1+/*
2+ * This file is subject to the terms and conditions of the GNU General Public
3+ * License. See the file "COPYING" in the main directory of this archive
4+ * for more details.
5+ *
6+ * Copyright (C) 2003, 2004 Ralf Baechle
7+ * Copyright (C) 2004 Maciej W. Rozycki
8+ */
9+#ifndef __ASM_CPU_TYPE_H
10+#define __ASM_CPU_TYPE_H
11+
12+#include <linux/smp.h>
13+#include <linux/compiler.h>
14+
15+static inline int __pure __get_cpu_type(const int cpu_type)
16+{
17+ switch (cpu_type) {
18+#if defined(CONFIG_SYS_HAS_CPU_LOONGSON2E) || \
19+ defined(CONFIG_SYS_HAS_CPU_LOONGSON2F)
20+ case CPU_LOONGSON2:
21+#endif
22+
23+#ifdef CONFIG_SYS_HAS_CPU_LOONGSON1B
24+ case CPU_LOONGSON1:
25+#endif
26+
27+#ifdef CONFIG_SYS_HAS_CPU_MIPS32_R1
28+ case CPU_4KC:
29+ case CPU_ALCHEMY:
30+ case CPU_BMIPS3300:
31+ case CPU_BMIPS4350:
32+ case CPU_PR4450:
33+ case CPU_BMIPS32:
34+ case CPU_JZRISC:
35+#endif
36+
37+#if defined(CONFIG_SYS_HAS_CPU_MIPS32_R1) || \
38+ defined(CONFIG_SYS_HAS_CPU_MIPS32_R2)
39+ case CPU_4KEC:
40+#endif
41+
42+#ifdef CONFIG_SYS_HAS_CPU_MIPS32_R2
43+ case CPU_4KSC:
44+ case CPU_24K:
45+ case CPU_34K:
46+ case CPU_1004K:
47+ case CPU_74K:
48+ case CPU_M14KC:
49+ case CPU_M14KEC:
50+#endif
51+
52+#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R1
53+ case CPU_5KC:
54+ case CPU_5KE:
55+ case CPU_20KC:
56+ case CPU_25KF:
57+ case CPU_SB1:
58+ case CPU_SB1A:
59+#endif
60+
61+#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R2
62+ /*
63+ * All MIPS64 R2 processors have their own special symbols. That is,
64+ * there currently is no pure R2 core
65+ */
66+#endif
67+
68+#ifdef CONFIG_SYS_HAS_CPU_R3000
69+ case CPU_R2000:
70+ case CPU_R3000:
71+ case CPU_R3000A:
72+ case CPU_R3041:
73+ case CPU_R3051:
74+ case CPU_R3052:
75+ case CPU_R3081:
76+ case CPU_R3081E:
77+#endif
78+
79+#ifdef CONFIG_SYS_HAS_CPU_TX39XX
80+ case CPU_TX3912:
81+ case CPU_TX3922:
82+ case CPU_TX3927:
83+#endif
84+
85+#ifdef CONFIG_SYS_HAS_CPU_VR41XX
86+ case CPU_VR41XX:
87+ case CPU_VR4111:
88+ case CPU_VR4121:
89+ case CPU_VR4122:
90+ case CPU_VR4131:
91+ case CPU_VR4133:
92+ case CPU_VR4181:
93+ case CPU_VR4181A:
94+#endif
95+
96+#ifdef CONFIG_SYS_HAS_CPU_R4300
97+ case CPU_R4300:
98+ case CPU_R4310:
99+#endif
100+
101+#ifdef CONFIG_SYS_HAS_CPU_R4X00
102+ case CPU_R4000PC:
103+ case CPU_R4000SC:
104+ case CPU_R4000MC:
105+ case CPU_R4200:
106+ case CPU_R4400PC:
107+ case CPU_R4400SC:
108+ case CPU_R4400MC:
109+ case CPU_R4600:
110+ case CPU_R4700:
111+ case CPU_R4640:
112+ case CPU_R4650:
113+#endif
114+
115+#ifdef CONFIG_SYS_HAS_CPU_TX49XX
116+ case CPU_TX49XX:
117+#endif
118+
119+#ifdef CONFIG_SYS_HAS_CPU_R5000
120+ case CPU_R5000:
121+#endif
122+
123+#ifdef CONFIG_SYS_HAS_CPU_R5432
124+ case CPU_R5432:
125+#endif
126+
127+#ifdef CONFIG_SYS_HAS_CPU_R5500
128+ case CPU_R5500:
129+#endif
130+
131+#ifdef CONFIG_SYS_HAS_CPU_R6000
132+ case CPU_R6000:
133+ case CPU_R6000A:
134+#endif
135+
136+#ifdef CONFIG_SYS_HAS_CPU_NEVADA
137+ case CPU_NEVADA:
138+#endif
139+
140+#ifdef CONFIG_SYS_HAS_CPU_R8000
141+ case CPU_R8000:
142+#endif
143+
144+#ifdef CONFIG_SYS_HAS_CPU_R10000
145+ case CPU_R10000:
146+ case CPU_R12000:
147+ case CPU_R14000:
148+#endif
149+#ifdef CONFIG_SYS_HAS_CPU_RM7000
150+ case CPU_RM7000:
151+ case CPU_SR71000:
152+#endif
153+#ifdef CONFIG_SYS_HAS_CPU_RM9000
154+ case CPU_RM9000:
155+#endif
156+#ifdef CONFIG_SYS_HAS_CPU_SB1
157+ case CPU_SB1:
158+ case CPU_SB1A:
159+#endif
160+#ifdef CONFIG_SYS_HAS_CPU_CAVIUM_OCTEON
161+ case CPU_CAVIUM_OCTEON:
162+ case CPU_CAVIUM_OCTEON_PLUS:
163+ case CPU_CAVIUM_OCTEON2:
164+#endif
165+
166+#ifdef CONFIG_SYS_HAS_CPU_BMIPS4380
167+ case CPU_BMIPS4380:
168+#endif
169+
170+#ifdef CONFIG_SYS_HAS_CPU_BMIPS5000
171+ case CPU_BMIPS5000:
172+#endif
173+
174+#ifdef CONFIG_SYS_HAS_CPU_XLP
175+ case CPU_XLP:
176+#endif
177+
178+#ifdef CONFIG_SYS_HAS_CPU_XLR
179+ case CPU_XLR:
180+#endif
181+ break;
182+ default:
183+ unreachable();
184+ }
185+
186+ return cpu_type;
187+}
188+
189+static inline int __pure current_cpu_type(void)
190+{
191+ const int cpu_type = current_cpu_data.cputype;
192+
193+ return __get_cpu_type(cpu_type);
194+}
195+
196+static inline int __pure boot_cpu_type(void)
197+{
198+ const int cpu_type = cpu_data[0].cputype;
199+
200+ return __get_cpu_type(cpu_type);
201+}
202+
203+#endif /* __ASM_CPU_TYPE_H */
arch/mips/include/asm/cpu.h+29−9
@@ -3,15 +3,14 @@ · 2 unmodified lines
33 * various MIPS cpu types.
44 *
55 * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
6− * Copyright (C) 2004 Maciej W. Rozycki
6+ * Copyright (C) 2004, 2013 Maciej W. Rozycki
77 */
88 #ifndef _ASM_CPU_H
99 #define _ASM_CPU_H
1010
11−/* Assigned Company values for bits 23:16 of the PRId Register
12− (CP0 register 15, select 0). As of the MIPS32 and MIPS64 specs from
13− MTI, the PRId register is defined in this (backwards compatible)
14− way:
11+/*
12+ As of the MIPS32 and MIPS64 specs from MTI, the PRId register (CP0
13+ register 15, select 0) is defined in this (backwards compatible) way:
1514
1615 +----------------+----------------+----------------+----------------+
1716 | Company Options| Company ID | Processor ID | Revision |
@@ -23,6 +22,14 @@ · 5 unmodified lines
2322 spec.
2423 */
2524
25+#define PRID_OPT_MASK 0xff000000
26+
27+/*
28+ * Assigned Company values for bits 23:16 of the PRId register.
29+ */
30+
31+#define PRID_COMP_MASK 0xff0000
32+
2633 #define PRID_COMP_LEGACY 0x000000
2734 #define PRID_COMP_MIPS 0x010000
2835 #define PRID_COMP_BROADCOM 0x020000
@@ -38,10 +45,17 @@ · 9 unmodified lines
3845 #define PRID_COMP_INGENIC 0xd00000
3946
4047 /*
41− * Assigned values for the product ID register. In order to detect a
42− * certain CPU type exactly eventually additional registers may need to
43− * be examined. These are valid when 23:16 == PRID_COMP_LEGACY
48+ * Assigned Processor ID (implementation) values for bits 15:8 of the PRId
49+ * register. In order to detect a certain CPU type exactly eventually
50+ * additional registers may need to be examined.
4451 */
52+
53+#define PRID_IMP_MASK 0xff00
54+
55+/*
56+ * These are valid when 23:16 == PRID_COMP_LEGACY
57+ */
58+
4559 #define PRID_IMP_R2000 0x0100
4660 #define PRID_IMP_AU1_REV1 0x0100
4761 #define PRID_IMP_AU1_REV2 0x0200
@@ -182,11 +196,15 @@ · 134 unmodified lines
182196 #define PRID_IMP_NETLOGIC_XLP2XX 0x1200
183197
184198 /*
185− * Definitions for 7:0 on legacy processors
199+ * Particular Revision values for bits 7:0 of the PRId register.
186200 */
187201
188202 #define PRID_REV_MASK 0x00ff
189203
204+/*
205+ * Definitions for 7:0 on legacy processors
206+ */
207+
190208 #define PRID_REV_TX4927 0x0022
191209 #define PRID_REV_TX4937 0x0030
192210 #define PRID_REV_R4400 0x0040
@@ -227,6 +245,8 @@ · 34 unmodified lines
227245 * 31 16 15 8 7 0
228246 */
229247
248+#define FPIR_IMP_MASK 0xff00
249+
230250 #define FPIR_IMP_NONE 0x0000
231251
232252 enum cpu_type_enum {
arch/mips/include/asm/mach-au1x00/au1000.h+3−1
@@ -43,6 +43,8 @@ · 42 unmodified lines
4343 #include <linux/io.h>
4444 #include <linux/irq.h>
4545
46+#include <asm/cpu.h>
47+
4648 /* cpu pipeline flush */
4749 void static inline au_sync(void)
4850 {
@@ -140,7 +142,7 @@ static inline int au1xxx_cpu_needs_config_od(void) · 91 unmodified lines
140142
141143 static inline int alchemy_get_cputype(void)
142144 {
143− switch (read_c0_prid() & 0xffff0000) {
145+ switch (read_c0_prid() & (PRID_OPT_MASK | PRID_COMP_MASK)) {
144146 case 0x00030000:
145147 return ALCHEMY_CPU_AU1000;
146148 break;
arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h+2−0
@@ -8,6 +8,8 @@ · 7 unmodified lines
88 #ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
99 #define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
1010
11+#include <asm/cpu.h>
12+
1113 /*
1214 * IP22 with a variety of processors so we can't use defaults for everything.
1315 */
arch/mips/include/asm/mach-ip27/cpu-feature-overrides.h+2−0
@@ -8,6 +8,8 @@ · 7 unmodified lines
88 #ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
99 #define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
1010
11+#include <asm/cpu.h>
12+
1113 /*
1214 * IP27 only comes with R10000 family processors all using the same config
1315 */
arch/mips/include/asm/mach-ip28/cpu-feature-overrides.h+2−0
@@ -9,6 +9,8 @@ · 8 unmodified lines
99 #ifndef __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H
1010 #define __ASM_MACH_IP28_CPU_FEATURE_OVERRIDES_H
1111
12+#include <asm/cpu.h>
13+
1214 /*
1315 * IP28 only comes with R10000 family processors all using the same config
1416 */
arch/mips/include/asm/mipsregs.h+7−0
@@ -603,6 +603,13 @@ · 602 unmodified lines
603603 #define MIPS_CONF4_MMUEXTDEF (_ULCAST_(3) << 14)
604604 #define MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT (_ULCAST_(1) << 14)
605605
606+#define MIPS_CONF5_NF (_ULCAST_(1) << 0)
607+#define MIPS_CONF5_UFR (_ULCAST_(1) << 2)
608+#define MIPS_CONF5_MSAEN (_ULCAST_(1) << 27)
609+#define MIPS_CONF5_EVA (_ULCAST_(1) << 28)
610+#define MIPS_CONF5_CV (_ULCAST_(1) << 29)
611+#define MIPS_CONF5_K (_ULCAST_(1) << 30)
612+
606613 #define MIPS_CONF6_SYND (_ULCAST_(1) << 13)
607614
608615 #define MIPS_CONF7_WII (_ULCAST_(1) << 31)
arch/mips/include/asm/pci.h+12−0
@@ -83,6 +83,18 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) · 82 unmodified lines
8383 extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
8484 enum pci_mmap_state mmap_state, int write_combine);
8585
86+#define HAVE_ARCH_PCI_RESOURCE_TO_USER
87+
88+static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
89+ const struct resource *rsrc, resource_size_t *start,
90+ resource_size_t *end)
91+{
92+ phys_t size = resource_size(rsrc);
93+
94+ *start = fixup_bigphys_addr(rsrc->start, size);
95+ *end = rsrc->start + size;
96+}
97+
8698 /*
8799 * Dynamic DMA mapping stuff.
88100 * MIPS has everything mapped statically.
arch/mips/include/asm/timex.h+32−1
@@ -10,7 +10,9 @@ · 9 unmodified lines
1010
1111 #ifdef __KERNEL__
1212
13+#include <asm/cpu-features.h>
1314 #include <asm/mipsregs.h>
15+#include <asm/cpu-type.h>
1416
1517 /*
1618 * This is the clock rate of the i8253 PIT. A MIPS system may not have
@@ -33,9 +35,38 @@ · 16 unmodified lines
3335
3436 typedef unsigned int cycles_t;
3537
38+/*
39+ * On R4000/R4400 before version 5.0 an erratum exists such that if the
40+ * cycle counter is read in the exact moment that it is matching the
41+ * compare register, no interrupt will be generated.
42+ *
43+ * There is a suggested workaround and also the erratum can't strike if
44+ * the compare interrupt isn't being used as the clock source device.
45+ * However for now the implementaton of this function doesn't get these
46+ * fine details right.
47+ */
3648 static inline cycles_t get_cycles(void)
3749 {
38− return 0;
50+ switch (boot_cpu_type()) {
51+ case CPU_R4400PC:
52+ case CPU_R4400SC:
53+ case CPU_R4400MC:
54+ if ((read_c0_prid() & 0xff) >= 0x0050)
55+ return read_c0_count();
56+ break;
57+
58+ case CPU_R4000PC:
59+ case CPU_R4000SC:
60+ case CPU_R4000MC:
61+ break;
62+
63+ default:
64+ if (cpu_has_counter)
65+ return read_c0_count();
66+ break;
67+ }
68+
69+ return 0; /* no usable counter */
3970 }
4071
4172 #endif /* __KERNEL__ */
arch/mips/include/asm/vga.h+2−1
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #ifndef _ASM_VGA_H
77 #define _ASM_VGA_H
88
9+#include <asm/addrspace.h>
910 #include <asm/byteorder.h>
1011
1112 /*
@@ -13,7 +14,7 @@ · 1 unmodified line
1314 * access the videoram directly without any black magic.
1415 */
1516
16−#define VGA_MAP_MEM(x, s) (0xb0000000L + (unsigned long)(x))
17+#define VGA_MAP_MEM(x, s) CKSEG1ADDR(0x10000000L + (unsigned long)(x))
1718
1819 #define vga_readb(x) (*(x))
1920 #define vga_writeb(x, y) (*(y) = (x))
arch/mips/kernel/cpu-probe.c+37−21
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 #include <asm/bugs.h>
2222 #include <asm/cpu.h>
23+#include <asm/cpu-type.h>
2324 #include <asm/fpu.h>
2425 #include <asm/mipsregs.h>
2526 #include <asm/watch.h>
@@ -55,7 +56,7 @@ static inline void check_errata(void) · 29 unmodified lines
5556 {
5657 struct cpuinfo_mips *c = &current_cpu_data;
5758
58− switch (c->cputype) {
59+ switch (current_cpu_type()) {
5960 case CPU_34K:
6061 /*
6162 * Erratum "RPS May Cause Incorrect Instruction Execution"
@@ -122,7 +123,7 @@ static inline unsigned long cpu_get_fpu_id(void) · 60 unmodified lines
122123 */
123124 static inline int __cpu_has_fpu(void)
124125 {
125− return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE);
126+ return ((cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE);
126127 }
127128
128129 static inline void cpu_probe_vmbits(struct cpuinfo_mips *c)
@@ -290,6 +291,17 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c) · 161 unmodified lines
290291 return config4 & MIPS_CONF_M;
291292 }
292293
294+static inline unsigned int decode_config5(struct cpuinfo_mips *c)
295+{
296+ unsigned int config5;
297+
298+ config5 = read_c0_config5();
299+ config5 &= ~MIPS_CONF5_UFR;
300+ write_c0_config5(config5);
301+
302+ return config5 & MIPS_CONF_M;
303+}
304+
293305 static void decode_configs(struct cpuinfo_mips *c)
294306 {
295307 int ok;
@@ -310,6 +322,8 @@ static void decode_configs(struct cpuinfo_mips *c) · 14 unmodified lines
310322 ok = decode_config3(c);
311323 if (ok)
312324 ok = decode_config4(c);
325+ if (ok)
326+ ok = decode_config5(c);
313327
314328 mips_probe_watch_registers(c);
315329
@@ -322,7 +336,7 @@ static void decode_configs(struct cpuinfo_mips *c) · 6 unmodified lines
322336
323337 static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
324338 {
325− switch (c->processor_id & 0xff00) {
339+ switch (c->processor_id & PRID_IMP_MASK) {
326340 case PRID_IMP_R2000:
327341 c->cputype = CPU_R2000;
328342 __cpu_name[cpu] = "R2000";
@@ -333,7 +347,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 4 unmodified lines
333347 c->tlbsize = 64;
334348 break;
335349 case PRID_IMP_R3000:
336− if ((c->processor_id & 0xff) == PRID_REV_R3000A) {
350+ if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) {
337351 if (cpu_has_confreg()) {
338352 c->cputype = CPU_R3081E;
339353 __cpu_name[cpu] = "R3081";
@@ -353,7 +367,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 13 unmodified lines
353367 break;
354368 case PRID_IMP_R4000:
355369 if (read_c0_config() & CONF_SC) {
356− if ((c->processor_id & 0xff) >= PRID_REV_R4400) {
370+ if ((c->processor_id & PRID_REV_MASK) >=
371+ PRID_REV_R4400) {
357372 c->cputype = CPU_R4400PC;
358373 __cpu_name[cpu] = "R4400PC";
359374 } else {
@@ -361,7 +376,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 1 unmodified line
361376 __cpu_name[cpu] = "R4000PC";
362377 }
363378 } else {
364− if ((c->processor_id & 0xff) >= PRID_REV_R4400) {
379+ if ((c->processor_id & PRID_REV_MASK) >=
380+ PRID_REV_R4400) {
365381 c->cputype = CPU_R4400SC;
366382 __cpu_name[cpu] = "R4400SC";
367383 } else {
@@ -454,7 +470,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 86 unmodified lines
454470 __cpu_name[cpu] = "TX3927";
455471 c->tlbsize = 64;
456472 } else {
457− switch (c->processor_id & 0xff) {
473+ switch (c->processor_id & PRID_REV_MASK) {
458474 case PRID_REV_TX3912:
459475 c->cputype = CPU_TX3912;
460476 __cpu_name[cpu] = "TX3912";
@@ -640,7 +656,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) · 179 unmodified lines
640656 static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
641657 {
642658 decode_configs(c);
643− switch (c->processor_id & 0xff00) {
659+ switch (c->processor_id & PRID_IMP_MASK) {
644660 case PRID_IMP_4KC:
645661 c->cputype = CPU_4KC;
646662 __cpu_name[cpu] = "MIPS 4Kc";
@@ -711,7 +727,7 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) · 64 unmodified lines
711727 static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu)
712728 {
713729 decode_configs(c);
714− switch (c->processor_id & 0xff00) {
730+ switch (c->processor_id & PRID_IMP_MASK) {
715731 case PRID_IMP_AU1_REV1:
716732 case PRID_IMP_AU1_REV2:
717733 c->cputype = CPU_ALCHEMY;
@@ -730,7 +746,7 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) · 12 unmodified lines
730746 break;
731747 case 4:
732748 __cpu_name[cpu] = "Au1200";
733− if ((c->processor_id & 0xff) == 2)
749+ if ((c->processor_id & PRID_REV_MASK) == 2)
734750 __cpu_name[cpu] = "Au1250";
735751 break;
736752 case 5:
@@ -748,12 +764,12 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu) · 11 unmodified lines
748764 {
749765 decode_configs(c);
750766
751− switch (c->processor_id & 0xff00) {
767+ switch (c->processor_id & PRID_IMP_MASK) {
752768 case PRID_IMP_SB1:
753769 c->cputype = CPU_SB1;
754770 __cpu_name[cpu] = "SiByte SB1";
755771 /* FPU in pass1 is known to have issues. */
756− if ((c->processor_id & 0xff) < 0x02)
772+ if ((c->processor_id & PRID_REV_MASK) < 0x02)
757773 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
758774 break;
759775 case PRID_IMP_SB1A:
@@ -766,7 +782,7 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu) · 6 unmodified lines
766782 static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu)
767783 {
768784 decode_configs(c);
769− switch (c->processor_id & 0xff00) {
785+ switch (c->processor_id & PRID_IMP_MASK) {
770786 case PRID_IMP_SR71000:
771787 c->cputype = CPU_SR71000;
772788 __cpu_name[cpu] = "Sandcraft SR71000";
@@ -779,7 +795,7 @@ static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu) · 6 unmodified lines
779795 static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu)
780796 {
781797 decode_configs(c);
782− switch (c->processor_id & 0xff00) {
798+ switch (c->processor_id & PRID_IMP_MASK) {
783799 case PRID_IMP_PR4450:
784800 c->cputype = CPU_PR4450;
785801 __cpu_name[cpu] = "Philips PR4450";
@@ -791,7 +807,7 @@ static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu) · 5 unmodified lines
791807 static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
792808 {
793809 decode_configs(c);
794− switch (c->processor_id & 0xff00) {
810+ switch (c->processor_id & PRID_IMP_MASK) {
795811 case PRID_IMP_BMIPS32_REV4:
796812 case PRID_IMP_BMIPS32_REV8:
797813 c->cputype = CPU_BMIPS32;
@@ -806,7 +822,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) · 8 unmodified lines
806822 set_elf_platform(cpu, "bmips3300");
807823 break;
808824 case PRID_IMP_BMIPS43XX: {
809− int rev = c->processor_id & 0xff;
825+ int rev = c->processor_id & PRID_REV_MASK;
810826
811827 if (rev >= PRID_REV_BMIPS4380_LO &&
812828 rev <= PRID_REV_BMIPS4380_HI) {
@@ -832,7 +848,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) · 19 unmodified lines
832848 static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
833849 {
834850 decode_configs(c);
835− switch (c->processor_id & 0xff00) {
851+ switch (c->processor_id & PRID_IMP_MASK) {
836852 case PRID_IMP_CAVIUM_CN38XX:
837853 case PRID_IMP_CAVIUM_CN31XX:
838854 case PRID_IMP_CAVIUM_CN30XX:
@@ -875,7 +891,7 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu) · 36 unmodified lines
875891 decode_configs(c);
876892 /* JZRISC does not implement the CP0 counter. */
877893 c->options &= ~MIPS_CPU_COUNTER;
878− switch (c->processor_id & 0xff00) {
894+ switch (c->processor_id & PRID_IMP_MASK) {
879895 case PRID_IMP_JZRISC:
880896 c->cputype = CPU_JZRISC;
881897 __cpu_name[cpu] = "Ingenic JZRISC";
@@ -890,7 +906,7 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) · 8 unmodified lines
890906 {
891907 decode_configs(c);
892908
893− if ((c->processor_id & 0xff00) == PRID_IMP_NETLOGIC_AU13XX) {
909+ if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_NETLOGIC_AU13XX) {
894910 c->cputype = CPU_ALCHEMY;
895911 __cpu_name[cpu] = "Au1300";
896912 /* following stuff is not for Alchemy */
@@ -905,7 +921,7 @@ static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) · 8 unmodified lines
905921 MIPS_CPU_EJTAG |
906922 MIPS_CPU_LLSC);
907923
908− switch (c->processor_id & 0xff00) {
924+ switch (c->processor_id & PRID_IMP_MASK) {
909925 case PRID_IMP_NETLOGIC_XLP2XX:
910926 c->cputype = CPU_XLP;
911927 __cpu_name[cpu] = "Broadcom XLPII";
@@ -984,7 +1000,7 @@ void cpu_probe(void) · 72 unmodified lines
9841000 c->cputype = CPU_UNKNOWN;
9851001
9861002 c->processor_id = read_c0_prid();
987− switch (c->processor_id & 0xff0000) {
1003+ switch (c->processor_id & PRID_COMP_MASK) {
9881004 case PRID_COMP_LEGACY:
9891005 cpu_probe_legacy(c, cpu);
9901006 break;
arch/mips/kernel/idle.c+2−1
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/sched.h>
1919 #include <asm/cpu.h>
2020 #include <asm/cpu-info.h>
21+#include <asm/cpu-type.h>
2122 #include <asm/idle.h>
2223 #include <asm/mipsregs.h>
2324
@@ -136,7 +137,7 @@ void __init check_wait(void) · 112 unmodified lines
136137 return;
137138 }
138139
139− switch (c->cputype) {
140+ switch (current_cpu_type()) {
140141 case CPU_R3081:
141142 case CPU_R3081E:
142143 cpu_wait = r3081_wait;
arch/mips/kernel/time.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <linux/export.h>
2525
2626 #include <asm/cpu-features.h>
27+#include <asm/cpu-type.h>
2728 #include <asm/div64.h>
2829 #include <asm/smtc_ipi.h>
2930 #include <asm/time.h>
arch/mips/kernel/traps.c+2−1
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include <asm/break.h>
4040 #include <asm/cop2.h>
4141 #include <asm/cpu.h>
42+#include <asm/cpu-type.h>
4243 #include <asm/dsp.h>
4344 #include <asm/fpu.h>
4445 #include <asm/fpu_emulator.h>
@@ -622,7 +623,7 @@ static int simulate_rdhwr(struct pt_regs *regs, int rd, int rt) · 577 unmodified lines
622623 regs->regs[rt] = read_c0_count();
623624 return 0;
624625 case 3: /* Count register resolution */
625− switch (current_cpu_data.cputype) {
626+ switch (current_cpu_type()) {
626627 case CPU_20KC:
627628 case CPU_25KF:
628629 regs->regs[rt] = 1;
arch/mips/mm/c-octeon.c+4−2
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <asm/bootinfo.h>
2020 #include <asm/cacheops.h>
2121 #include <asm/cpu-features.h>
22+#include <asm/cpu-type.h>
2223 #include <asm/page.h>
2324 #include <asm/pgtable.h>
2425 #include <asm/r4kcache.h>
@@ -186,9 +187,10 @@ static void probe_octeon(void) · 161 unmodified lines
186187 unsigned long dcache_size;
187188 unsigned int config1;
188189 struct cpuinfo_mips *c = &current_cpu_data;
190+ int cputype = current_cpu_type();
189191
190192 config1 = read_c0_config1();
191− switch (c->cputype) {
193+ switch (cputype) {
192194 case CPU_CAVIUM_OCTEON:
193195 case CPU_CAVIUM_OCTEON_PLUS:
194196 c->icache.linesz = 2 << ((config1 >> 19) & 7);
@@ -199,7 +201,7 @@ static void probe_octeon(void) · 4 unmodified lines
199201 c->icache.sets * c->icache.ways * c->icache.linesz;
200202 c->icache.waybit = ffs(icache_size / c->icache.ways) - 1;
201203 c->dcache.linesz = 128;
202− if (c->cputype == CPU_CAVIUM_OCTEON_PLUS)
204+ if (cputype == CPU_CAVIUM_OCTEON_PLUS)
203205 c->dcache.sets = 2; /* CN5XXX has two Dcache sets */
204206 else
205207 c->dcache.sets = 1; /* CN3XXX has one Dcache set */
arch/mips/mm/c-r4k.c+34−16
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/highmem.h>
1313 #include <linux/kernel.h>
1414 #include <linux/linkage.h>
15+#include <linux/preempt.h>
1516 #include <linux/sched.h>
1617 #include <linux/smp.h>
1718 #include <linux/mm.h>
@@ -24,6 +25,7 @@ · 6 unmodified lines
2425 #include <asm/cacheops.h>
2526 #include <asm/cpu.h>
2627 #include <asm/cpu-features.h>
28+#include <asm/cpu-type.h>
2729 #include <asm/io.h>
2830 #include <asm/page.h>
2931 #include <asm/pgtable.h>
@@ -601,11 +603,13 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) · 571 unmodified lines
601603 /* Catch bad driver code */
602604 BUG_ON(size == 0);
603605
606+ preempt_disable();
604607 if (cpu_has_inclusive_pcaches) {
605608 if (size >= scache_size)
606609 r4k_blast_scache();
607610 else
608611 blast_scache_range(addr, addr + size);
612+ preempt_enable();
609613 __sync();
610614 return;
611615 }
@@ -621,6 +625,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) · 9 unmodified lines
621625 R4600_HIT_CACHEOP_WAR_IMPL;
622626 blast_dcache_range(addr, addr + size);
623627 }
628+ preempt_enable();
624629
625630 bc_wback_inv(addr, size);
626631 __sync();
@@ -631,6 +636,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) · 4 unmodified lines
631636 /* Catch bad driver code */
632637 BUG_ON(size == 0);
633638
639+ preempt_disable();
634640 if (cpu_has_inclusive_pcaches) {
635641 if (size >= scache_size)
636642 r4k_blast_scache();
@@ -645,6 +651,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) · 8 unmodified lines
645651 */
646652 blast_inv_scache_range(addr, addr + size);
647653 }
654+ preempt_enable();
648655 __sync();
649656 return;
650657 }
@@ -655,6 +662,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) · 4 unmodified lines
655662 R4600_HIT_CACHEOP_WAR_IMPL;
656663 blast_inv_dcache_range(addr, addr + size);
657664 }
665+ preempt_enable();
658666
659667 bc_inv(addr, size);
660668 __sync();
@@ -780,20 +788,30 @@ static inline void rm7k_erratum31(void) · 119 unmodified lines
780788
781789 static inline void alias_74k_erratum(struct cpuinfo_mips *c)
782790 {
791+ unsigned int imp = c->processor_id & PRID_IMP_MASK;
792+ unsigned int rev = c->processor_id & PRID_REV_MASK;
793+
783794 /*
784795 * Early versions of the 74K do not update the cache tags on a
785796 * vtag miss/ptag hit which can occur in the case of KSEG0/KUSEG
786797 * aliases. In this case it is better to treat the cache as always
787798 * having aliases.
788799 */
789− if ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(2, 4, 0))
790− c->dcache.flags |= MIPS_CACHE_VTAG;
791− if ((c->processor_id & 0xff) == PRID_REV_ENCODE_332(2, 4, 0))
792− write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
793− if (((c->processor_id & 0xff00) == PRID_IMP_1074K) &&
794− ((c->processor_id & 0xff) <= PRID_REV_ENCODE_332(1, 1, 0))) {
795− c->dcache.flags |= MIPS_CACHE_VTAG;
796− write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
800+ switch (imp) {
801+ case PRID_IMP_74K:
802+ if (rev <= PRID_REV_ENCODE_332(2, 4, 0))
803+ c->dcache.flags |= MIPS_CACHE_VTAG;
804+ if (rev == PRID_REV_ENCODE_332(2, 4, 0))
805+ write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
806+ break;
807+ case PRID_IMP_1074K:
808+ if (rev <= PRID_REV_ENCODE_332(1, 1, 0)) {
809+ c->dcache.flags |= MIPS_CACHE_VTAG;
810+ write_c0_config6(read_c0_config6() | MIPS_CONF6_SYND);
811+ }
812+ break;
813+ default:
814+ BUG();
797815 }
798816 }
799817
@@ -809,7 +827,7 @@ static void probe_pcache(void) · 9 unmodified lines
809827 unsigned long config1;
810828 unsigned int lsize;
811829
812− switch (c->cputype) {
830+ switch (current_cpu_type()) {
813831 case CPU_R4600: /* QED style two way caches? */
814832 case CPU_R4700:
815833 case CPU_R5000:
@@ -1025,7 +1043,8 @@ static void probe_pcache(void) · 209 unmodified lines
10251043 * presumably no vendor is shipping his hardware in the "bad"
10261044 * configuration.
10271045 */
1028− if ((prid & 0xff00) == PRID_IMP_R4000 && (prid & 0xff) < 0x40 &&
1046+ if ((prid & PRID_IMP_MASK) == PRID_IMP_R4000 &&
1047+ (prid & PRID_REV_MASK) < PRID_REV_R4400 &&
10291048 !(config & CONF_SC) && c->icache.linesz != 16 &&
10301049 PAGE_SIZE <= 0x8000)
10311050 panic("Improper R4000SC processor configuration detected");
@@ -1045,7 +1064,7 @@ static void probe_pcache(void) · 13 unmodified lines
10451064 * normally they'd suffer from aliases but magic in the hardware deals
10461065 * with that for us so we don't need to take care ourselves.
10471066 */
1048− switch (c->cputype) {
1067+ switch (current_cpu_type()) {
10491068 case CPU_20KC:
10501069 case CPU_25KF:
10511070 case CPU_SB1:
@@ -1065,7 +1084,7 @@ static void probe_pcache(void) · 13 unmodified lines
10651084 case CPU_34K:
10661085 case CPU_74K:
10671086 case CPU_1004K:
1068− if (c->cputype == CPU_74K)
1087+ if (current_cpu_type() == CPU_74K)
10691088 alias_74k_erratum(c);
10701089 if ((read_c0_config7() & (1 << 16))) {
10711090 /* effectively physically indexed dcache,
@@ -1078,7 +1097,7 @@ static void probe_pcache(void) · 6 unmodified lines
10781097 c->dcache.flags |= MIPS_CACHE_ALIASES;
10791098 }
10801099
1081− switch (c->cputype) {
1100+ switch (current_cpu_type()) {
10821101 case CPU_20KC:
10831102 /*
10841103 * Some older 20Kc chips doesn't have the 'VI' bit in
@@ -1207,7 +1226,7 @@ static void setup_scache(void) · 122 unmodified lines
12071226 * processors don't have a S-cache that would be relevant to the
12081227 * Linux memory management.
12091228 */
1210− switch (c->cputype) {
1229+ switch (current_cpu_type()) {
12111230 case CPU_R4000SC:
12121231 case CPU_R4000MC:
12131232 case CPU_R4400SC:
@@ -1384,9 +1403,8 @@ static void r4k_cache_error_setup(void) · 170 unmodified lines
13841403 {
13851404 extern char __weak except_vec2_generic;
13861405 extern char __weak except_vec2_sb1;
1387− struct cpuinfo_mips *c = &current_cpu_data;
13881406
1389− switch (c->cputype) {
1407+ switch (current_cpu_type()) {
13901408 case CPU_SB1:
13911409 case CPU_SB1A:
13921410 set_uncached_handler(0x100, &except_vec2_sb1, 0x80);
arch/mips/mm/dma-default.c+5−8
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/highmem.h>
1919
2020 #include <asm/cache.h>
21+#include <asm/cpu-type.h>
2122 #include <asm/io.h>
2223
2324 #include <dma-coherence.h>
@@ -307,12 +308,10 @@ static void mips_dma_sync_sg_for_cpu(struct device *dev, · 283 unmodified lines
307308 {
308309 int i;
309310
310− /* Make sure that gcc doesn't leave the empty loop body. */
311− for (i = 0; i < nelems; i++, sg++) {
312− if (cpu_needs_post_dma_flush(dev))
311+ if (cpu_needs_post_dma_flush(dev))
312+ for (i = 0; i < nelems; i++, sg++)
313313 __dma_sync(sg_page(sg), sg->offset, sg->length,
314314 direction);
315− }
316315 }
317316
318317 static void mips_dma_sync_sg_for_device(struct device *dev,
@@ -320,12 +319,10 @@ static void mips_dma_sync_sg_for_device(struct device *dev, · 1 unmodified line
320319 {
321320 int i;
322321
323− /* Make sure that gcc doesn't leave the empty loop body. */
324− for (i = 0; i < nelems; i++, sg++) {
325− if (!plat_device_is_coherent(dev))
322+ if (!plat_device_is_coherent(dev))
323+ for (i = 0; i < nelems; i++, sg++)
326324 __dma_sync(sg_page(sg), sg->offset, sg->length,
327325 direction);
328− }
329326 }
330327
331328 int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
arch/mips/mm/page.c+1−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818
1919 #include <asm/bugs.h>
2020 #include <asm/cacheops.h>
21+#include <asm/cpu-type.h>
2122 #include <asm/inst.h>
2223 #include <asm/io.h>
2324 #include <asm/page.h>
arch/mips/mm/sc-mips.c+2−1
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #include <linux/sched.h>
77 #include <linux/mm.h>
88
9+#include <asm/cpu-type.h>
910 #include <asm/mipsregs.h>
1011 #include <asm/bcache.h>
1112 #include <asm/cacheops.h>
@@ -71,7 +72,7 @@ static inline int mips_sc_is_activated(struct cpuinfo_mips *c) · 59 unmodified lines
7172 unsigned int tmp;
7273
7374 /* Check the bypass bit (L2B) */
74− switch (c->cputype) {
75+ switch (current_cpu_type()) {
7576 case CPU_34K:
7677 case CPU_74K:
7778 case CPU_1004K:
arch/mips/mm/tlb-r4k.c+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/module.h>
1717
1818 #include <asm/cpu.h>
19+#include <asm/cpu-type.h>
1920 #include <asm/bootinfo.h>
2021 #include <asm/mmu_context.h>
2122 #include <asm/pgtable.h>
arch/mips/mm/tlbex.c+1−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include <linux/cache.h>
3131
3232 #include <asm/cacheflush.h>
33+#include <asm/cpu-type.h>
3334 #include <asm/pgtable.h>
3435 #include <asm/war.h>
3536 #include <asm/uasm.h>
arch/mips/mti-malta/malta-time.c+3−2
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <linux/timex.h>
2828 #include <linux/mc146818rtc.h>
2929
30+#include <asm/cpu.h>
3031 #include <asm/mipsregs.h>
3132 #include <asm/mipsmtregs.h>
3233 #include <asm/hardirq.h>
@@ -76,7 +77,7 @@ static void __init estimate_frequencies(void) · 43 unmodified lines
7677 #endif
7778
7879 #if defined (CONFIG_KVM_GUEST) && defined (CONFIG_KVM_HOST_FREQ)
79− unsigned int prid = read_c0_prid() & 0xffff00;
80+ unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK);
8081
8182 /*
8283 * XXXKYMA: hardwire the CPU frequency to Host Freq/4
@@ -169,7 +170,7 @@ unsigned int get_c0_compare_int(void) · 86 unmodified lines
169170
170171 void __init plat_time_init(void)
171172 {
172− unsigned int prid = read_c0_prid() & 0xffff00;
173+ unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK);
173174 unsigned int freq;
174175
175176 estimate_frequencies();
arch/mips/mti-sead3/sead3-time.c+2−1
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 */
88 #include <linux/init.h>
99
10+#include <asm/cpu.h>
1011 #include <asm/setup.h>
1112 #include <asm/time.h>
1213 #include <asm/irq.h>
@@ -34,7 +35,7 @@ static void __iomem *status_reg = (void __iomem *)0xbf000410; · 21 unmodified lines
3435 */
3536 static unsigned int __init estimate_cpu_frequency(void)
3637 {
37− unsigned int prid = read_c0_prid() & 0xffff00;
38+ unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK);
3839 unsigned int tick = 0;
3940 unsigned int freq;
4041 unsigned int orig;
arch/mips/netlogic/xlr/fmn-config.c+2−1
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include <linux/irq.h>
3737 #include <linux/interrupt.h>
3838
39+#include <asm/cpu.h>
3940 #include <asm/mipsregs.h>
4041 #include <asm/netlogic/xlr/fmn.h>
4142 #include <asm/netlogic/xlr/xlr.h>
@@ -187,7 +188,7 @@ void xlr_board_info_setup(void) · 145 unmodified lines
187188 int processor_id, num_core;
188189
189190 num_core = hweight32(nlm_current_node()->coremask);
190− processor_id = read_c0_prid() & 0xff00;
191+ processor_id = read_c0_prid() & PRID_IMP_MASK;
191192
192193 setup_cpu_fmninfo(cpu, num_core);
193194 switch (processor_id) {
arch/mips/oprofile/common.c+1−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/oprofile.h>
1313 #include <linux/smp.h>
1414 #include <asm/cpu-info.h>
15+#include <asm/cpu-type.h>
1516
1617 #include "op_impl.h"
1718
arch/mips/pci/pci-bcm1480.c+1−0
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include <linux/mm.h>
4040 #include <linux/console.h>
4141 #include <linux/tty.h>
42+#include <linux/vt.h>
4243
4344 #include <asm/sibyte/bcm1480_regs.h>
4445 #include <asm/sibyte/bcm1480_scd.h>
arch/mips/sibyte/bcm1480/setup.c+2−1
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/string.h>
2323
2424 #include <asm/bootinfo.h>
25+#include <asm/cpu.h>
2526 #include <asm/mipsregs.h>
2627 #include <asm/io.h>
2728 #include <asm/sibyte/sb1250.h>
@@ -119,7 +120,7 @@ void __init bcm1480_setup(void) · 91 unmodified lines
119120 uint64_t sys_rev;
120121 int plldiv;
121122
122− sb1_pass = read_c0_prid() & 0xff;
123+ sb1_pass = read_c0_prid() & PRID_REV_MASK;
123124 sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
124125 soc_type = SYS_SOC_TYPE(sys_rev);
125126 part_type = G_SYS_PART(sys_rev);
arch/mips/sibyte/sb1250/setup.c+2−1
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/string.h>
2323
2424 #include <asm/bootinfo.h>
25+#include <asm/cpu.h>
2526 #include <asm/mipsregs.h>
2627 #include <asm/io.h>
2728 #include <asm/sibyte/sb1250.h>
@@ -182,7 +183,7 @@ void __init sb1250_setup(void) · 154 unmodified lines
182183 int plldiv;
183184 int bad_config = 0;
184185
185− sb1_pass = read_c0_prid() & 0xff;
186+ sb1_pass = read_c0_prid() & PRID_REV_MASK;
186187 sys_rev = __raw_readq(IOADDR(A_SCD_SYSTEM_REVISION));
187188 soc_type = SYS_SOC_TYPE(sys_rev);
188189 soc_pass = G_SYS_REVISION(sys_rev);
arch/mips/sni/setup.c+2−1
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #endif
2626
2727 #include <asm/bootinfo.h>
28+#include <asm/cpu.h>
2829 #include <asm/io.h>
2930 #include <asm/reboot.h>
3031 #include <asm/sni.h>
@@ -173,7 +174,7 @@ void __init plat_mem_setup(void) · 142 unmodified lines
173174 system_type = "RM300-Cxx";
174175 break;
175176 case SNI_BRD_PCI_DESKTOP:
176− switch (read_c0_prid() & 0xff00) {
177+ switch (read_c0_prid() & PRID_IMP_MASK) {
177178 case PRID_IMP_R4600:
178179 case PRID_IMP_R4700:
179180 system_type = "RM200-C20";
arch/openrisc/include/asm/prom.h+0−44
@@ -14,53 +14,9 @@ · 13 unmodified lines
1414 * the Free Software Foundation; either version 2 of the License, or
1515 * (at your option) any later version.
1616 */
17−
18−#include <linux/of.h> /* linux/of.h gets to determine #include ordering */
19−
2017 #ifndef _ASM_OPENRISC_PROM_H
2118 #define _ASM_OPENRISC_PROM_H
22−#ifdef __KERNEL__
23−#ifndef __ASSEMBLY__
2419
25−#include <linux/types.h>
26−#include <asm/irq.h>
27−#include <linux/irqdomain.h>
28−#include <linux/atomic.h>
29−#include <linux/of_irq.h>
30−#include <linux/of_fdt.h>
31−#include <linux/of_address.h>
32−#include <linux/proc_fs.h>
33−#include <linux/platform_device.h>
3420 #define HAVE_ARCH_DEVTREE_FIXUPS
3521
36−/* Other Prototypes */
37−extern int early_uartlite_console(void);
38−
39−/* Parse the ibm,dma-window property of an OF node into the busno, phys and
40− * size parameters.
41− */
42−void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
43− unsigned long *busno, unsigned long *phys, unsigned long *size);
44−
45−extern void kdump_move_device_tree(void);
46−
47−/* Get the MAC address */
48−extern const void *of_get_mac_address(struct device_node *np);
49−
50−/**
51− * of_irq_map_pci - Resolve the interrupt for a PCI device
52− * @pdev: the device whose interrupt is to be resolved
53− * @out_irq: structure of_irq filled by this function
54− *
55− * This function resolves the PCI interrupt for a given PCI device. If a
56− * device-node exists for a given pci_dev, it will use normal OF tree
57− * walking. If not, it will implement standard swizzling and walk up the
58− * PCI tree until an device-node is found, at which point it will finish
59− * resolving using the OF tree walking.
60− */
61−struct pci_dev;
62−extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
63−
64−#endif /* __ASSEMBLY__ */
65−#endif /* __KERNEL__ */
6622 #endif /* _ASM_OPENRISC_PROM_H */
arch/parisc/mm/fault.c+3−2
@@ -182,6 +182,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, · 181 unmodified lines
182182
183183 if (user_mode(regs))
184184 flags |= FAULT_FLAG_USER;
185+
186+ acc_type = parisc_acctyp(code, regs->iir);
187+
185188 if (acc_type & VM_WRITE)
186189 flags |= FAULT_FLAG_WRITE;
187190 retry:
@@ -196,8 +199,6 @@ retry: · 8 unmodified lines
196199
197200 good_area:
198201
199− acc_type = parisc_acctyp(code,regs->iir);
200−
201202 if ((vma->vm_flags & acc_type) != acc_type)
202203 goto bad_area;
203204
arch/powerpc/boot/Makefile+2−2
@@ -74,7 +74,7 @@ src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c · 73 unmodified lines
7474 src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
7575 src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c
7676
77−src-plat-y := of.c
77+src-plat-y := of.c epapr.c
7878 src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \
7979 treeboot-walnut.c cuboot-acadia.c \
8080 cuboot-kilauea.c simpleboot.c \
@@ -97,7 +97,7 @@ src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \ · 16 unmodified lines
9797 prpmc2800.c
9898 src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c
9999 src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c
100−src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c
100+src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
101101
102102 src-wlib := $(sort $(src-wlib-y))
103103 src-plat := $(sort $(src-plat-y))
arch/powerpc/boot/epapr-wrapper.c+9−0
@@ -0,0 +1,9 @@
1+extern void epapr_platform_init(unsigned long r3, unsigned long r4,
2+ unsigned long r5, unsigned long r6,
3+ unsigned long r7);
4+
5+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
6+ unsigned long r6, unsigned long r7)
7+{
8+ epapr_platform_init(r3, r4, r5, r6, r7);
9+}
arch/powerpc/boot/epapr.c+2−2
@@ -48,8 +48,8 @@ static void platform_fixups(void) · 47 unmodified lines
4848 fdt_addr, fdt_totalsize((void *)fdt_addr), ima_size);
4949 }
5050
51−void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
52− unsigned long r6, unsigned long r7)
51+void epapr_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
52+ unsigned long r6, unsigned long r7)
5353 {
5454 epapr_magic = r6;
5555 ima_size = r7;
arch/powerpc/boot/of.c+15−1
@@ -26,6 +26,9 @@ · 25 unmodified lines
2626
2727 static unsigned long claim_base;
2828
29+void epapr_platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
30+ unsigned long r6, unsigned long r7);
31+
2932 static void *of_try_claim(unsigned long size)
3033 {
3134 unsigned long addr = 0;
@@ -61,7 +64,7 @@ static void of_image_hdr(const void *hdr) · 29 unmodified lines
6164 }
6265 }
6366
64−void platform_init(unsigned long a1, unsigned long a2, void *promptr)
67+static void of_platform_init(unsigned long a1, unsigned long a2, void *promptr)
6568 {
6669 platform_ops.image_hdr = of_image_hdr;
6770 platform_ops.malloc = of_try_claim;
@@ -81,3 +84,14 @@ void platform_init(unsigned long a1, unsigned long a2, void *promptr) · 13 unmodified lines
8184 loader_info.initrd_size = a2;
8285 }
8386 }
87+
88+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
89+ unsigned long r6, unsigned long r7)
90+{
91+ /* Detect OF vs. ePAPR boot */
92+ if (r5)
93+ of_platform_init(r3, r4, (void *)r5);
94+ else
95+ epapr_platform_init(r3, r4, r5, r6, r7);
96+}
97+
arch/powerpc/boot/wrapper+5−4
@@ -148,18 +148,18 @@ make_space=y · 147 unmodified lines
148148
149149 case "$platform" in
150150 pseries)
151− platformo=$object/of.o
151+ platformo="$object/of.o $object/epapr.o"
152152 link_address='0x4000000'
153153 ;;
154154 maple)
155− platformo=$object/of.o
155+ platformo="$object/of.o $object/epapr.o"
156156 link_address='0x400000'
157157 ;;
158158 pmac|chrp)
159− platformo=$object/of.o
159+ platformo="$object/of.o $object/epapr.o"
160160 ;;
161161 coff)
162− platformo="$object/crt0.o $object/of.o"
162+ platformo="$object/crt0.o $object/of.o $object/epapr.o"
163163 lds=$object/zImage.coff.lds
164164 link_address='0x500000'
165165 pie=
@@ -253,6 +253,7 @@ treeboot-iss4xx-mpic) · 87 unmodified lines
253253 platformo="$object/treeboot-iss4xx.o"
254254 ;;
255255 epapr)
256+ platformo="$object/epapr.o $object/epapr-wrapper.o"
256257 link_address='0x20000000'
257258 pie=-pie
258259 ;;
arch/powerpc/include/asm/irq.h+2−2
@@ -69,9 +69,9 @@ extern struct thread_info *softirq_ctx[NR_CPUS]; · 68 unmodified lines
6969
7070 extern void irq_ctx_init(void);
7171 extern void call_do_softirq(struct thread_info *tp);
72−extern int call_handle_irq(int irq, void *p1,
73− struct thread_info *tp, void *func);
72+extern void call_do_irq(struct pt_regs *regs, struct thread_info *tp);
7473 extern void do_IRQ(struct pt_regs *regs);
74+extern void __do_irq(struct pt_regs *regs);
7575
7676 int irq_choose_cpu(const struct cpumask *mask);
7777
arch/powerpc/include/asm/processor.h+1−3
@@ -149,8 +149,6 @@ typedef struct { · 148 unmodified lines
149149
150150 struct thread_struct {
151151 unsigned long ksp; /* Kernel stack pointer */
152− unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */
153−
154152 #ifdef CONFIG_PPC64
155153 unsigned long ksp_vsid;
156154 #endif
@@ -162,6 +160,7 @@ struct thread_struct { · 5 unmodified lines
162160 #endif
163161 #ifdef CONFIG_PPC32
164162 void *pgdir; /* root of page-table tree */
163+ unsigned long ksp_limit; /* if ksp <= ksp_limit stack overflow */
165164 #endif
166165 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
167166 /*
@@ -321,7 +320,6 @@ struct thread_struct { · 153 unmodified lines
321320 #else
322321 #define INIT_THREAD { \
323322 .ksp = INIT_SP, \
324− .ksp_limit = INIT_SP_LIMIT, \
325323 .regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
326324 .fs = KERNEL_DS, \
327325 .fpr = {{0}}, \
arch/powerpc/kernel/asm-offsets.c+2−1
@@ -80,10 +80,11 @@ int main(void) · 79 unmodified lines
8080 DEFINE(TASKTHREADPPR, offsetof(struct task_struct, thread.ppr));
8181 #else
8282 DEFINE(THREAD_INFO, offsetof(struct task_struct, stack));
83+ DEFINE(THREAD_INFO_GAP, _ALIGN_UP(sizeof(struct thread_info), 16));
84+ DEFINE(KSP_LIMIT, offsetof(struct thread_struct, ksp_limit));
8385 #endif /* CONFIG_PPC64 */
8486
8587 DEFINE(KSP, offsetof(struct thread_struct, ksp));
86− DEFINE(KSP_LIMIT, offsetof(struct thread_struct, ksp_limit));
8788 DEFINE(PT_REGS, offsetof(struct thread_struct, regs));
8889 #ifdef CONFIG_BOOKE
8990 DEFINE(THREAD_NORMSAVES, offsetof(struct thread_struct, normsave[0]));
arch/powerpc/kernel/iommu.c+1−1
@@ -661,7 +661,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) · 660 unmodified lines
661661 /* number of bytes needed for the bitmap */
662662 sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long);
663663
664− page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz));
664+ page = alloc_pages_node(nid, GFP_KERNEL, get_order(sz));
665665 if (!page)
666666 panic("iommu_init_table: Can't allocate %ld bytes\n", sz);
667667 tbl->it_map = page_address(page);
arch/powerpc/kernel/irq.c+44−56
@@ -441,50 +441,6 @@ void migrate_irqs(void) · 440 unmodified lines
441441 }
442442 #endif
443443
444−static inline void handle_one_irq(unsigned int irq)
445−{
446− struct thread_info *curtp, *irqtp;
447− unsigned long saved_sp_limit;
448− struct irq_desc *desc;
449−
450− desc = irq_to_desc(irq);
451− if (!desc)
452− return;
453−
454− /* Switch to the irq stack to handle this */
455− curtp = current_thread_info();
456− irqtp = hardirq_ctx[smp_processor_id()];
457−
458− if (curtp == irqtp) {
459− /* We're already on the irq stack, just handle it */
460− desc->handle_irq(irq, desc);
461− return;
462− }
463−
464− saved_sp_limit = current->thread.ksp_limit;
465−
466− irqtp->task = curtp->task;
467− irqtp->flags = 0;
468−
469− /* Copy the softirq bits in preempt_count so that the
470− * softirq checks work in the hardirq context. */
471− irqtp->preempt_count = (irqtp->preempt_count & ~SOFTIRQ_MASK) |
472− (curtp->preempt_count & SOFTIRQ_MASK);
473−
474− current->thread.ksp_limit = (unsigned long)irqtp +
475− _ALIGN_UP(sizeof(struct thread_info), 16);
476−
477− call_handle_irq(irq, desc, irqtp, desc->handle_irq);
478− current->thread.ksp_limit = saved_sp_limit;
479− irqtp->task = NULL;
480−
481− /* Set any flag that may have been set on the
482− * alternate stack
483− */
484− if (irqtp->flags)
485− set_bits(irqtp->flags, &curtp->flags);
486−}
487−
488444 static inline void check_stack_overflow(void)
489445 {
490446 #ifdef CONFIG_DEBUG_STACKOVERFLOW
@@ -501,9 +457,9 @@ static inline void check_stack_overflow(void) · 10 unmodified lines
501457 #endif
502458 }
503459
504−void do_IRQ(struct pt_regs *regs)
460+void __do_irq(struct pt_regs *regs)
505461 {
506− struct pt_regs *old_regs = set_irq_regs(regs);
462+ struct irq_desc *desc;
507463 unsigned int irq;
508464
509465 irq_enter();
@@ -519,18 +475,56 @@ void do_IRQ(struct pt_regs *regs) · 9 unmodified lines
519475 */
520476 irq = ppc_md.get_irq();
521477
522− /* We can hard enable interrupts now */
478+ /* We can hard enable interrupts now to allow perf interrupts */
523479 may_hard_irq_enable();
524480
525481 /* And finally process it */
526− if (irq != NO_IRQ)
527− handle_one_irq(irq);
528− else
482+ if (unlikely(irq == NO_IRQ))
529483 __get_cpu_var(irq_stat).spurious_irqs++;
484+ else {
485+ desc = irq_to_desc(irq);
486+ if (likely(desc))
487+ desc->handle_irq(irq, desc);
488+ }
530489
531490 trace_irq_exit(regs);
532491
533492 irq_exit();
493+}
494+
495+void do_IRQ(struct pt_regs *regs)
496+{
497+ struct pt_regs *old_regs = set_irq_regs(regs);
498+ struct thread_info *curtp, *irqtp;
499+
500+ /* Switch to the irq stack to handle this */
501+ curtp = current_thread_info();
502+ irqtp = hardirq_ctx[raw_smp_processor_id()];
503+
504+ /* Already there ? */
505+ if (unlikely(curtp == irqtp)) {
506+ __do_irq(regs);
507+ set_irq_regs(old_regs);
508+ return;
509+ }
510+
511+ /* Prepare the thread_info in the irq stack */
512+ irqtp->task = curtp->task;
513+ irqtp->flags = 0;
514+
515+ /* Copy the preempt_count so that the [soft]irq checks work. */
516+ irqtp->preempt_count = curtp->preempt_count;
517+
518+ /* Switch stack and call */
519+ call_do_irq(regs, irqtp);
520+
521+ /* Restore stack limit */
522+ irqtp->task = NULL;
523+
524+ /* Copy back updates to the thread_info */
525+ if (irqtp->flags)
526+ set_bits(irqtp->flags, &curtp->flags);
527+
534528 set_irq_regs(old_regs);
535529 }
536530
@@ -592,28 +586,22 @@ void irq_ctx_init(void) · 55 unmodified lines
592586 memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
593587 tp = softirq_ctx[i];
594588 tp->cpu = i;
595− tp->preempt_count = 0;
596589
597590 memset((void *)hardirq_ctx[i], 0, THREAD_SIZE);
598591 tp = hardirq_ctx[i];
599592 tp->cpu = i;
600− tp->preempt_count = HARDIRQ_OFFSET;
601593 }
602594 }
603595
604596 static inline void do_softirq_onstack(void)
605597 {
606598 struct thread_info *curtp, *irqtp;
607− unsigned long saved_sp_limit = current->thread.ksp_limit;
608599
609600 curtp = current_thread_info();
610601 irqtp = softirq_ctx[smp_processor_id()];
611602 irqtp->task = curtp->task;
612603 irqtp->flags = 0;
613− current->thread.ksp_limit = (unsigned long)irqtp +
614− _ALIGN_UP(sizeof(struct thread_info), 16);
615604 call_do_softirq(irqtp);
616− current->thread.ksp_limit = saved_sp_limit;
617605 irqtp->task = NULL;
618606
619607 /* Set any flag that may have been set on the
arch/powerpc/kernel/misc_32.S+20−5
@@ -36,26 +36,41 @@ · 35 unmodified lines
3636
3737 .text
3838
39+/*
40+ * We store the saved ksp_limit in the unused part
41+ * of the STACK_FRAME_OVERHEAD
42+ */
3943 _GLOBAL(call_do_softirq)
4044 mflr r0
4145 stw r0,4(r1)
46+ lwz r10,THREAD+KSP_LIMIT(r2)
47+ addi r11,r3,THREAD_INFO_GAP
4248 stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r3)
4349 mr r1,r3
50+ stw r10,8(r1)
51+ stw r11,THREAD+KSP_LIMIT(r2)
4452 bl __do_softirq
53+ lwz r10,8(r1)
4554 lwz r1,0(r1)
4655 lwz r0,4(r1)
56+ stw r10,THREAD+KSP_LIMIT(r2)
4757 mtlr r0
4858 blr
4959
50−_GLOBAL(call_handle_irq)
60+_GLOBAL(call_do_irq)
5161 mflr r0
5262 stw r0,4(r1)
53− mtctr r6
54− stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r5)
55− mr r1,r5
56− bctrl
63+ lwz r10,THREAD+KSP_LIMIT(r2)
64+ addi r11,r3,THREAD_INFO_GAP
65+ stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4)
66+ mr r1,r4
67+ stw r10,8(r1)
68+ stw r11,THREAD+KSP_LIMIT(r2)
69+ bl __do_irq
70+ lwz r10,8(r1)
5771 lwz r1,0(r1)
5872 lwz r0,4(r1)
73+ stw r10,THREAD+KSP_LIMIT(r2)
5974 mtlr r0
6075 blr
6176
arch/powerpc/kernel/misc_64.S+4−6
@@ -40,14 +40,12 @@ _GLOBAL(call_do_softirq) · 39 unmodified lines
4040 mtlr r0
4141 blr
4242
43−_GLOBAL(call_handle_irq)
44− ld r8,0(r6)
43+_GLOBAL(call_do_irq)
4544 mflr r0
4645 std r0,16(r1)
47− mtctr r8
48− stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r5)
49− mr r1,r5
50− bctrl
46+ stdu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4)
47+ mr r1,r4
48+ bl .__do_irq
5149 ld r1,0(r1)
5250 ld r0,16(r1)
5351 mtlr r0
arch/powerpc/kernel/process.c+2−1
@@ -1000,9 +1000,10 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, · 999 unmodified lines
10001000 kregs = (struct pt_regs *) sp;
10011001 sp -= STACK_FRAME_OVERHEAD;
10021002 p->thread.ksp = sp;
1003+#ifdef CONFIG_PPC32
10031004 p->thread.ksp_limit = (unsigned long)task_stack_page(p) +
10041005 _ALIGN_UP(sizeof(struct thread_info), 16);
1005−
1006+#endif
10061007 #ifdef CONFIG_HAVE_HW_BREAKPOINT
10071008 p->thread.ptrace_bps[0] = NULL;
10081009 #endif
arch/powerpc/kernel/prom_init.c+21−0
@@ -196,6 +196,8 @@ static int __initdata mem_reserve_cnt; · 195 unmodified lines
196196
197197 static cell_t __initdata regbuf[1024];
198198
199+static bool rtas_has_query_cpu_stopped;
200+
199201
200202 /*
201203 * Error results ... some OF calls will return "-1" on error, some
@@ -1574,6 +1576,11 @@ static void __init prom_instantiate_rtas(void) · 1372 unmodified lines
15741576 prom_setprop(rtas_node, "/rtas", "linux,rtas-entry",
15751577 &val, sizeof(val));
15761578
1579+ /* Check if it supports "query-cpu-stopped-state" */
1580+ if (prom_getprop(rtas_node, "query-cpu-stopped-state",
1581+ &val, sizeof(val)) != PROM_ERROR)
1582+ rtas_has_query_cpu_stopped = true;
1583+
15771584 #if defined(CONFIG_PPC_POWERNV) && defined(__BIG_ENDIAN__)
15781585 /* PowerVN takeover hack */
15791586 prom_rtas_data = base;
@@ -1815,6 +1822,18 @@ static void __init prom_hold_cpus(void) · 235 unmodified lines
18151822 = (void *) LOW_ADDR(__secondary_hold_acknowledge);
18161823 unsigned long secondary_hold = LOW_ADDR(__secondary_hold);
18171824
1825+ /*
1826+ * On pseries, if RTAS supports "query-cpu-stopped-state",
1827+ * we skip this stage, the CPUs will be started by the
1828+ * kernel using RTAS.
1829+ */
1830+ if ((of_platform == PLATFORM_PSERIES ||
1831+ of_platform == PLATFORM_PSERIES_LPAR) &&
1832+ rtas_has_query_cpu_stopped) {
1833+ prom_printf("prom_hold_cpus: skipped\n");
1834+ return;
1835+ }
1836+
18181837 prom_debug("prom_hold_cpus: start...\n");
18191838 prom_debug(" 1) spinloop = 0x%x\n", (unsigned long)spinloop);
18201839 prom_debug(" 1) *spinloop = 0x%x\n", *spinloop);
@@ -3011,6 +3030,8 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, · 1190 unmodified lines
30113030 * On non-powermacs, put all CPUs in spin-loops.
30123031 *
30133032 * PowerMacs use a different mechanism to spin CPUs
3033+ *
3034+ * (This must be done after instanciating RTAS)
30143035 */
30153036 if (of_platform != PLATFORM_POWERMAC &&
30163037 of_platform != PLATFORM_OPAL)
arch/powerpc/kernel/sysfs.c+16−2
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <asm/machdep.h>
1818 #include <asm/smp.h>
1919 #include <asm/pmc.h>
20+#include <asm/firmware.h>
2021
2122 #include "cacheinfo.h"
2223
@@ -179,15 +180,25 @@ SYSFS_PMCSETUP(spurr, SPRN_SPURR); · 156 unmodified lines
179180 SYSFS_PMCSETUP(dscr, SPRN_DSCR);
180181 SYSFS_PMCSETUP(pir, SPRN_PIR);
181182
183+/*
184+ Lets only enable read for phyp resources and
185+ enable write when needed with a separate function.
186+ Lets be conservative and default to pseries.
187+*/
182188 static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
183189 static DEVICE_ATTR(spurr, 0400, show_spurr, NULL);
184190 static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr);
185−static DEVICE_ATTR(purr, 0600, show_purr, store_purr);
191+static DEVICE_ATTR(purr, 0400, show_purr, store_purr);
186192 static DEVICE_ATTR(pir, 0400, show_pir, NULL);
187193
188194 unsigned long dscr_default = 0;
189195 EXPORT_SYMBOL(dscr_default);
190196
197+static void add_write_permission_dev_attr(struct device_attribute *attr)
198+{
199+ attr->attr.mode |= 0200;
200+}
201+
191202 static ssize_t show_dscr_default(struct device *dev,
192203 struct device_attribute *attr, char *buf)
193204 {
@@ -394,8 +405,11 @@ static void register_cpu_online(unsigned int cpu) · 200 unmodified lines
394405 if (cpu_has_feature(CPU_FTR_MMCRA))
395406 device_create_file(s, &dev_attr_mmcra);
396407
397− if (cpu_has_feature(CPU_FTR_PURR))
408+ if (cpu_has_feature(CPU_FTR_PURR)) {
409+ if (!firmware_has_feature(FW_FEATURE_LPAR))
410+ add_write_permission_dev_attr(&dev_attr_purr);
398411 device_create_file(s, &dev_attr_purr);
412+ }
399413
400414 if (cpu_has_feature(CPU_FTR_SPURR))
401415 device_create_file(s, &dev_attr_spurr);
arch/powerpc/kernel/tm.S+64−31
@@ -79,6 +79,11 @@ _GLOBAL(tm_abort) · 78 unmodified lines
7979 TABORT(R3)
8080 blr
8181
82+ .section ".toc","aw"
83+DSCR_DEFAULT:
84+ .tc dscr_default[TC],dscr_default
85+
86+ .section ".text"
8287
8388 /* void tm_reclaim(struct thread_struct *thread,
8489 * unsigned long orig_msr,
@@ -123,6 +128,7 @@ _GLOBAL(tm_reclaim) · 38 unmodified lines
123128 mr r15, r14
124129 ori r15, r15, MSR_FP
125130 li r16, MSR_RI
131+ ori r16, r16, MSR_EE /* IRQs hard off */
126132 andc r15, r15, r16
127133 oris r15, r15, MSR_VEC@h
128134 #ifdef CONFIG_VSX
@@ -187,11 +193,18 @@ dont_backup_fp: · 58 unmodified lines
187193 std r1, PACATMSCRATCH(r13)
188194 ld r1, PACAR1(r13)
189195
196+ /* Store the PPR in r11 and reset to decent value */
197+ std r11, GPR11(r1) /* Temporary stash */
198+ mfspr r11, SPRN_PPR
199+ HMT_MEDIUM
200+
190201 /* Now get some more GPRS free */
191202 std r7, GPR7(r1) /* Temporary stash */
192203 std r12, GPR12(r1) /* '' '' '' */
193204 ld r12, STACK_PARAM(0)(r1) /* Param 0, thread_struct * */
194205
206+ std r11, THREAD_TM_PPR(r12) /* Store PPR and free r11 */
207+
195208 addi r7, r12, PT_CKPT_REGS /* Thread's ckpt_regs */
196209
197210 /* Make r7 look like an exception frame so that we
@@ -203,15 +216,19 @@ dont_backup_fp: · 5 unmodified lines
203216 SAVE_GPR(0, r7) /* user r0 */
204217 SAVE_GPR(2, r7) /* user r2 */
205218 SAVE_4GPRS(3, r7) /* user r3-r6 */
206− SAVE_4GPRS(8, r7) /* user r8-r11 */
219+ SAVE_GPR(8, r7) /* user r8 */
220+ SAVE_GPR(9, r7) /* user r9 */
221+ SAVE_GPR(10, r7) /* user r10 */
207222 ld r3, PACATMSCRATCH(r13) /* user r1 */
208223 ld r4, GPR7(r1) /* user r7 */
209− ld r5, GPR12(r1) /* user r12 */
210− GET_SCRATCH0(6) /* user r13 */
224+ ld r5, GPR11(r1) /* user r11 */
225+ ld r6, GPR12(r1) /* user r12 */
226+ GET_SCRATCH0(8) /* user r13 */
211227 std r3, GPR1(r7)
212228 std r4, GPR7(r7)
213− std r5, GPR12(r7)
214− std r6, GPR13(r7)
229+ std r5, GPR11(r7)
230+ std r6, GPR12(r7)
231+ std r8, GPR13(r7)
215232
216233 SAVE_NVGPRS(r7) /* user r14-r31 */
217234
@@ -234,14 +251,12 @@ dont_backup_fp: · 16 unmodified lines
234251 std r6, _XER(r7)
235252
236253
237− /* ******************** TAR, PPR, DSCR ********** */
254+ /* ******************** TAR, DSCR ********** */
238255 mfspr r3, SPRN_TAR
239− mfspr r4, SPRN_PPR
240− mfspr r5, SPRN_DSCR
256+ mfspr r4, SPRN_DSCR
241257
242258 std r3, THREAD_TM_TAR(r12)
243− std r4, THREAD_TM_PPR(r12)
244− std r5, THREAD_TM_DSCR(r12)
259+ std r4, THREAD_TM_DSCR(r12)
245260
246261 /* MSR and flags: We don't change CRs, and we don't need to alter
247262 * MSR.
@@ -258,7 +273,7 @@ dont_backup_fp: · 10 unmodified lines
258273 std r3, THREAD_TM_TFHAR(r12)
259274 std r4, THREAD_TM_TFIAR(r12)
260275
261− /* AMR and PPR are checkpointed too, but are unsupported by Linux. */
276+ /* AMR is checkpointed too, but is unsupported by Linux. */
262277
263278 /* Restore original MSR/IRQ state & clear TM mode */
264279 ld r14, TM_FRAME_L0(r1) /* Orig MSR */
@@ -274,6 +289,12 @@ dont_backup_fp: · 9 unmodified lines
274289 mtcr r4
275290 mtlr r0
276291 ld r2, 40(r1)
292+
293+ /* Load system default DSCR */
294+ ld r4, DSCR_DEFAULT@toc(r2)
295+ ld r0, 0(r4)
296+ mtspr SPRN_DSCR, r0
297+
277298 blr
278299
279300
@@ -358,25 +379,24 @@ dont_restore_fp: · 78 unmodified lines
358379
359380 restore_gprs:
360381
361− /* ******************** TAR, PPR, DSCR ********** */
362− ld r4, THREAD_TM_TAR(r3)
363− ld r5, THREAD_TM_PPR(r3)
364− ld r6, THREAD_TM_DSCR(r3)
382+ /* ******************** CR,LR,CCR,MSR ********** */
383+ ld r4, _CTR(r7)
384+ ld r5, _LINK(r7)
385+ ld r6, _CCR(r7)
386+ ld r8, _XER(r7)
365387
366− mtspr SPRN_TAR, r4
367− mtspr SPRN_PPR, r5
368− mtspr SPRN_DSCR, r6
388+ mtctr r4
389+ mtlr r5
390+ mtcr r6
391+ mtxer r8
369392
370− /* ******************** CR,LR,CCR,MSR ********** */
371− ld r3, _CTR(r7)
372− ld r4, _LINK(r7)
373− ld r5, _CCR(r7)
374− ld r6, _XER(r7)
393+ /* ******************** TAR ******************** */
394+ ld r4, THREAD_TM_TAR(r3)
395+ mtspr SPRN_TAR, r4
375396
376− mtctr r3
377− mtlr r4
378− mtcr r5
379− mtxer r6
397+ /* Load up the PPR and DSCR in GPRs only at this stage */
398+ ld r5, THREAD_TM_DSCR(r3)
399+ ld r6, THREAD_TM_PPR(r3)
380400
381401 /* Clear the MSR RI since we are about to change R1. EE is already off
382402 */
@@ -384,19 +404,26 @@ restore_gprs: · 1 unmodified line
384404 mtmsrd r4, 1
385405
386406 REST_4GPRS(0, r7) /* GPR0-3 */
387− REST_GPR(4, r7) /* GPR4-6 */
388− REST_GPR(5, r7)
389− REST_GPR(6, r7)
407+ REST_GPR(4, r7) /* GPR4 */
390408 REST_4GPRS(8, r7) /* GPR8-11 */
391409 REST_2GPRS(12, r7) /* GPR12-13 */
392410
393411 REST_NVGPRS(r7) /* GPR14-31 */
394412
395− ld r7, GPR7(r7) /* GPR7 */
413+ /* Load up PPR and DSCR here so we don't run with user values for long
414+ */
415+ mtspr SPRN_DSCR, r5
416+ mtspr SPRN_PPR, r6
417+
418+ REST_GPR(5, r7) /* GPR5-7 */
419+ REST_GPR(6, r7)
420+ ld r7, GPR7(r7)
396421
397422 /* Commit register state as checkpointed state: */
398423 TRECHKPT
399424
425+ HMT_MEDIUM
426+
400427 /* Our transactional state has now changed.
401428 *
402429 * Now just get out of here. Transactional (current) state will be
@@ -419,6 +446,12 @@ restore_gprs: · 16 unmodified lines
419446 mtcr r4
420447 mtlr r0
421448 ld r2, 40(r1)
449+
450+ /* Load system default DSCR */
451+ ld r4, DSCR_DEFAULT@toc(r2)
452+ ld r0, 0(r4)
453+ mtspr SPRN_DSCR, r0
454+
422455 blr
423456
424457 /* ****************************************************************** */
arch/powerpc/kernel/vio.c+8−4
@@ -1530,11 +1530,15 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, · 1529 unmodified lines
15301530 const char *cp;
15311531
15321532 dn = dev->of_node;
1533− if (!dn)
1534− return -ENODEV;
1533+ if (!dn) {
1534+ strcat(buf, "\n");
1535+ return strlen(buf);
1536+ }
15351537 cp = of_get_property(dn, "compatible", NULL);
1536− if (!cp)
1537− return -ENODEV;
1538+ if (!cp) {
1539+ strcat(buf, "\n");
1540+ return strlen(buf);
1541+ }
15381542
15391543 return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
15401544 }
arch/powerpc/lib/checksum_64.S+42−16
@@ -226,19 +226,35 @@ _GLOBAL(csum_partial) · 225 unmodified lines
226226 blr
227227
228228
229− .macro source
229+ .macro srcnr
230230 100:
231231 .section __ex_table,"a"
232232 .align 3
233− .llong 100b,.Lsrc_error
233+ .llong 100b,.Lsrc_error_nr
234234 .previous
235235 .endm
236236
237− .macro dest
237+ .macro source
238+150:
239+ .section __ex_table,"a"
240+ .align 3
241+ .llong 150b,.Lsrc_error
242+ .previous
243+ .endm
244+
245+ .macro dstnr
238246 200:
239247 .section __ex_table,"a"
240248 .align 3
241− .llong 200b,.Ldest_error
249+ .llong 200b,.Ldest_error_nr
250+ .previous
251+ .endm
252+
253+ .macro dest
254+250:
255+ .section __ex_table,"a"
256+ .align 3
257+ .llong 250b,.Ldest_error
242258 .previous
243259 .endm
244260
@@ -269,16 +285,16 @@ _GLOBAL(csum_partial_copy_generic) · 24 unmodified lines
269285 rldicl. r6,r3,64-1,64-2 /* r6 = (r3 & 0x3) >> 1 */
270286 beq .Lcopy_aligned
271287
272− li r7,4
273− sub r6,r7,r6
288+ li r9,4
289+ sub r6,r9,r6
274290 mtctr r6
275291
276292 1:
277−source; lhz r6,0(r3) /* align to doubleword */
293+srcnr; lhz r6,0(r3) /* align to doubleword */
278294 subi r5,r5,2
279295 addi r3,r3,2
280296 adde r0,r0,r6
281−dest; sth r6,0(r4)
297+dstnr; sth r6,0(r4)
282298 addi r4,r4,2
283299 bdnz 1b
284300
@@ -392,10 +408,10 @@ dest; std r16,56(r4) · 107 unmodified lines
392408
393409 mtctr r6
394410 3:
395−source; ld r6,0(r3)
411+srcnr; ld r6,0(r3)
396412 addi r3,r3,8
397413 adde r0,r0,r6
398−dest; std r6,0(r4)
414+dstnr; std r6,0(r4)
399415 addi r4,r4,8
400416 bdnz 3b
401417
@@ -405,10 +421,10 @@ dest; std r6,0(r4) · 3 unmodified lines
405421 srdi. r6,r5,2
406422 beq .Lcopy_tail_halfword
407423
408−source; lwz r6,0(r3)
424+srcnr; lwz r6,0(r3)
409425 addi r3,r3,4
410426 adde r0,r0,r6
411−dest; stw r6,0(r4)
427+dstnr; stw r6,0(r4)
412428 addi r4,r4,4
413429 subi r5,r5,4
414430
@@ -416,10 +432,10 @@ dest; stw r6,0(r4) · 1 unmodified line
416432 srdi. r6,r5,1
417433 beq .Lcopy_tail_byte
418434
419−source; lhz r6,0(r3)
435+srcnr; lhz r6,0(r3)
420436 addi r3,r3,2
421437 adde r0,r0,r6
422−dest; sth r6,0(r4)
438+dstnr; sth r6,0(r4)
423439 addi r4,r4,2
424440 subi r5,r5,2
425441
@@ -427,10 +443,10 @@ dest; sth r6,0(r4) · 1 unmodified line
427443 andi. r6,r5,1
428444 beq .Lcopy_finish
429445
430−source; lbz r6,0(r3)
446+srcnr; lbz r6,0(r3)
431447 sldi r9,r6,8 /* Pad the byte out to 16 bits */
432448 adde r0,r0,r9
433−dest; stb r6,0(r4)
449+dstnr; stb r6,0(r4)
434450
435451 .Lcopy_finish:
436452 addze r0,r0 /* add in final carry */
@@ -440,6 +456,11 @@ dest; stb r6,0(r4) · 3 unmodified lines
440456 blr
441457
442458 .Lsrc_error:
459+ ld r14,STK_REG(R14)(r1)
460+ ld r15,STK_REG(R15)(r1)
461+ ld r16,STK_REG(R16)(r1)
462+ addi r1,r1,STACKFRAMESIZE
463+.Lsrc_error_nr:
443464 cmpdi 0,r7,0
444465 beqlr
445466 li r6,-EFAULT
@@ -447,6 +468,11 @@ dest; stb r6,0(r4) · 1 unmodified line
447468 blr
448469
449470 .Ldest_error:
471+ ld r14,STK_REG(R14)(r1)
472+ ld r15,STK_REG(R15)(r1)
473+ ld r16,STK_REG(R16)(r1)
474+ addi r1,r1,STACKFRAMESIZE
475+.Ldest_error_nr:
450476 cmpdi 0,r8,0
451477 beqlr
452478 li r6,-EFAULT
arch/powerpc/lib/sstep.c+2−1
@@ -1505,6 +1505,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) · 1504 unmodified lines
15051505 */
15061506 if ((ra == 1) && !(regs->msr & MSR_PR) \
15071507 && (val3 >= (regs->gpr[1] - STACK_INT_FRAME_SIZE))) {
1508+#ifdef CONFIG_PPC32
15081509 /*
15091510 * Check if we will touch kernel sack overflow
15101511 */
@@ -1513,7 +1514,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) · 2 unmodified lines
15131514 err = -EINVAL;
15141515 break;
15151516 }
1516−
1517+#endif /* CONFIG_PPC32 */
15171518 /*
15181519 * Check if we already set since that means we'll
15191520 * lose the previous value.
arch/powerpc/mm/init_64.c+4−0
@@ -300,5 +300,9 @@ void vmemmap_free(unsigned long start, unsigned long end) · 299 unmodified lines
300300 {
301301 }
302302
303+void register_page_bootmem_memmap(unsigned long section_nr,
304+ struct page *start_page, unsigned long size)
305+{
306+}
303307 #endif /* CONFIG_SPARSEMEM_VMEMMAP */
304308
arch/powerpc/mm/mem.c+9−0
@@ -297,12 +297,21 @@ void __init paging_init(void) · 296 unmodified lines
297297 }
298298 #endif /* ! CONFIG_NEED_MULTIPLE_NODES */
299299
300+static void __init register_page_bootmem_info(void)
301+{
302+ int i;
303+
304+ for_each_online_node(i)
305+ register_page_bootmem_info_node(NODE_DATA(i));
306+}
307+
300308 void __init mem_init(void)
301309 {
302310 #ifdef CONFIG_SWIOTLB
303311 swiotlb_init(0);
304312 #endif
305313
314+ register_page_bootmem_info();
306315 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
307316 set_max_mapnr(max_pfn);
308317 free_all_bootmem();
arch/powerpc/perf/power8-pmu.c+3−2
@@ -199,6 +199,7 @@ · 198 unmodified lines
199199 #define MMCR1_UNIT_SHIFT(pmc) (60 - (4 * ((pmc) - 1)))
200200 #define MMCR1_COMBINE_SHIFT(pmc) (35 - ((pmc) - 1))
201201 #define MMCR1_PMCSEL_SHIFT(pmc) (24 - (((pmc) - 1)) * 8)
202+#define MMCR1_FAB_SHIFT 36
202203 #define MMCR1_DC_QUAL_SHIFT 47
203204 #define MMCR1_IC_QUAL_SHIFT 46
204205
@@ -388,8 +389,8 @@ static int power8_compute_mmcr(u64 event[], int n_ev, · 183 unmodified lines
388389 * the threshold bits are used for the match value.
389390 */
390391 if (event_is_fab_match(event[i])) {
391− mmcr1 |= (event[i] >> EVENT_THR_CTL_SHIFT) &
392− EVENT_THR_CTL_MASK;
392+ mmcr1 |= ((event[i] >> EVENT_THR_CTL_SHIFT) &
393+ EVENT_THR_CTL_MASK) << MMCR1_FAB_SHIFT;
393394 } else {
394395 val = (event[i] >> EVENT_THR_CTL_SHIFT) & EVENT_THR_CTL_MASK;
395396 mmcra |= val << MMCRA_THR_CTL_SHIFT;
arch/powerpc/platforms/pseries/smp.c+16−10
@@ -233,18 +233,24 @@ static void __init smp_init_pseries(void) · 232 unmodified lines
233233
234234 alloc_bootmem_cpumask_var(&of_spin_mask);
235235
236− /* Mark threads which are still spinning in hold loops. */
237− if (cpu_has_feature(CPU_FTR_SMT)) {
238− for_each_present_cpu(i) {
239− if (cpu_thread_in_core(i) == 0)
240− cpumask_set_cpu(i, of_spin_mask);
241− }
242− } else {
243− cpumask_copy(of_spin_mask, cpu_present_mask);
236+ /*
237+ * Mark threads which are still spinning in hold loops
238+ *
239+ * We know prom_init will not have started them if RTAS supports
240+ * query-cpu-stopped-state.
241+ */
242+ if (rtas_token("query-cpu-stopped-state") == RTAS_UNKNOWN_SERVICE) {
243+ if (cpu_has_feature(CPU_FTR_SMT)) {
244+ for_each_present_cpu(i) {
245+ if (cpu_thread_in_core(i) == 0)
246+ cpumask_set_cpu(i, of_spin_mask);
247+ }
248+ } else
249+ cpumask_copy(of_spin_mask, cpu_present_mask);
250+
251+ cpumask_clear_cpu(boot_cpuid, of_spin_mask);
244252 }
245253
246− cpumask_clear_cpu(boot_cpuid, of_spin_mask);
247−
248254 /* Non-lpar has additional take/give timebase */
249255 if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
250256 smp_ops->give_timebase = rtas_give_timebase;
arch/s390/Kconfig+1−1
@@ -93,6 +93,7 @@ config S390 · 92 unmodified lines
9393 select ARCH_INLINE_WRITE_UNLOCK_IRQ
9494 select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
9595 select ARCH_SAVE_PAGE_KEYS if HIBERNATION
96+ select ARCH_USE_CMPXCHG_LOCKREF
9697 select ARCH_WANT_IPC_PARSE_VERSION
9798 select BUILDTIME_EXTABLE_SORT
9899 select CLONE_BACKWARDS2
@@ -102,7 +103,6 @@ config S390 · 3 unmodified lines
102103 select GENERIC_TIME_VSYSCALL_OLD
103104 select HAVE_ALIGNED_STRUCT_PAGE if SLUB
104105 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
105− select HAVE_ARCH_MUTEX_CPU_RELAX
106106 select HAVE_ARCH_SECCOMP_FILTER
107107 select HAVE_ARCH_TRACEHOOK
108108 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT
arch/s390/include/asm/mutex.h+0−2
@@ -7,5 +7,3 @@ · 6 unmodified lines
77 */
88
99 #include <asm-generic/mutex-dec.h>
10−
11−#define arch_mutex_cpu_relax() barrier()
arch/s390/include/asm/processor.h+2−0
@@ -198,6 +198,8 @@ static inline void cpu_relax(void) · 197 unmodified lines
198198 barrier();
199199 }
200200
201+#define arch_mutex_cpu_relax() barrier()
202+
201203 static inline void psw_set_key(unsigned int key)
202204 {
203205 asm volatile("spka 0(%0)" : : "d" (key));
arch/s390/include/asm/spinlock.h+5−0
@@ -44,6 +44,11 @@ extern void arch_spin_lock_wait_flags(arch_spinlock_t *, unsigned long flags); · 43 unmodified lines
4444 extern int arch_spin_trylock_retry(arch_spinlock_t *);
4545 extern void arch_spin_relax(arch_spinlock_t *lock);
4646
47+static inline int arch_spin_value_unlocked(arch_spinlock_t lock)
48+{
49+ return lock.owner_cpu == 0;
50+}
51+
4752 static inline void arch_spin_lock(arch_spinlock_t *lp)
4853 {
4954 int old;
arch/score/Kconfig+4−0
@@ -2,6 +2,7 @@ menu "Machine selection" · 1 unmodified line
22
33 config SCORE
44 def_bool y
5+ select HAVE_GENERIC_HARDIRQS
56 select GENERIC_IRQ_SHOW
67 select GENERIC_IOMAP
78 select GENERIC_ATOMIC64
@@ -110,3 +111,6 @@ source "security/Kconfig" · 102 unmodified lines
110111 source "crypto/Kconfig"
111112
112113 source "lib/Kconfig"
114+
115+config NO_IOMEM
116+ def_bool y
arch/score/Makefile+2−2
@@ -20,8 +20,8 @@ cflags-y += -G0 -pipe -mel -mnhwloop -D__SCOREEL__ \ · 19 unmodified lines
2020 #
2121 KBUILD_AFLAGS += $(cflags-y)
2222 KBUILD_CFLAGS += $(cflags-y)
23−KBUILD_AFLAGS_MODULE += -mlong-calls
24−KBUILD_CFLAGS_MODULE += -mlong-calls
23+KBUILD_AFLAGS_MODULE +=
24+KBUILD_CFLAGS_MODULE +=
2525 LDFLAGS += --oformat elf32-littlescore
2626 LDFLAGS_vmlinux += -G0 -static -nostdlib
2727
arch/score/include/asm/checksum.h+51−42
@@ -184,48 +184,57 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, · 183 unmodified lines
184184 __wsum sum)
185185 {
186186 __asm__ __volatile__(
187− ".set\tnoreorder\t\t\t# csum_ipv6_magic\n\t"
188− ".set\tnoat\n\t"
189− "addu\t%0, %5\t\t\t# proto (long in network byte order)\n\t"
190− "sltu\t$1, %0, %5\n\t"
191− "addu\t%0, $1\n\t"
192− "addu\t%0, %6\t\t\t# csum\n\t"
193− "sltu\t$1, %0, %6\n\t"
194− "lw\t%1, 0(%2)\t\t\t# four words source address\n\t"
195− "addu\t%0, $1\n\t"
196− "addu\t%0, %1\n\t"
197− "sltu\t$1, %0, %1\n\t"
198− "lw\t%1, 4(%2)\n\t"
199− "addu\t%0, $1\n\t"
200− "addu\t%0, %1\n\t"
201− "sltu\t$1, %0, %1\n\t"
202− "lw\t%1, 8(%2)\n\t"
203− "addu\t%0, $1\n\t"
204− "addu\t%0, %1\n\t"
205− "sltu\t$1, %0, %1\n\t"
206− "lw\t%1, 12(%2)\n\t"
207− "addu\t%0, $1\n\t"
208− "addu\t%0, %1\n\t"
209− "sltu\t$1, %0, %1\n\t"
210− "lw\t%1, 0(%3)\n\t"
211− "addu\t%0, $1\n\t"
212− "addu\t%0, %1\n\t"
213− "sltu\t$1, %0, %1\n\t"
214− "lw\t%1, 4(%3)\n\t"
215− "addu\t%0, $1\n\t"
216− "addu\t%0, %1\n\t"
217− "sltu\t$1, %0, %1\n\t"
218− "lw\t%1, 8(%3)\n\t"
219− "addu\t%0, $1\n\t"
220− "addu\t%0, %1\n\t"
221− "sltu\t$1, %0, %1\n\t"
222− "lw\t%1, 12(%3)\n\t"
223− "addu\t%0, $1\n\t"
224− "addu\t%0, %1\n\t"
225− "sltu\t$1, %0, %1\n\t"
226− "addu\t%0, $1\t\t\t# Add final carry\n\t"
227− ".set\tnoat\n\t"
228− ".set\tnoreorder"
187+ ".set\tvolatile\t\t\t# csum_ipv6_magic\n\t"
188+ "add\t%0, %0, %5\t\t\t# proto (long in network byte order)\n\t"
189+ "cmp.c\t%5, %0\n\t"
190+ "bleu 1f\n\t"
191+ "addi\t%0, 0x1\n\t"
192+ "1:add\t%0, %0, %6\t\t\t# csum\n\t"
193+ "cmp.c\t%6, %0\n\t"
194+ "lw\t%1, [%2, 0]\t\t\t# four words source address\n\t"
195+ "bleu 1f\n\t"
196+ "addi\t%0, 0x1\n\t"
197+ "1:add\t%0, %0, %1\n\t"
198+ "cmp.c\t%1, %0\n\t"
199+ "1:lw\t%1, [%2, 4]\n\t"
200+ "bleu 1f\n\t"
201+ "addi\t%0, 0x1\n\t"
202+ "1:add\t%0, %0, %1\n\t"
203+ "cmp.c\t%1, %0\n\t"
204+ "lw\t%1, [%2,8]\n\t"
205+ "bleu 1f\n\t"
206+ "addi\t%0, 0x1\n\t"
207+ "1:add\t%0, %0, %1\n\t"
208+ "cmp.c\t%1, %0\n\t"
209+ "lw\t%1, [%2, 12]\n\t"
210+ "bleu 1f\n\t"
211+ "addi\t%0, 0x1\n\t"
212+ "1:add\t%0, %0,%1\n\t"
213+ "cmp.c\t%1, %0\n\t"
214+ "lw\t%1, [%3, 0]\n\t"
215+ "bleu 1f\n\t"
216+ "addi\t%0, 0x1\n\t"
217+ "1:add\t%0, %0, %1\n\t"
218+ "cmp.c\t%1, %0\n\t"
219+ "lw\t%1, [%3, 4]\n\t"
220+ "bleu 1f\n\t"
221+ "addi\t%0, 0x1\n\t"
222+ "1:add\t%0, %0, %1\n\t"
223+ "cmp.c\t%1, %0\n\t"
224+ "lw\t%1, [%3, 8]\n\t"
225+ "bleu 1f\n\t"
226+ "addi\t%0, 0x1\n\t"
227+ "1:add\t%0, %0, %1\n\t"
228+ "cmp.c\t%1, %0\n\t"
229+ "lw\t%1, [%3, 12]\n\t"
230+ "bleu 1f\n\t"
231+ "addi\t%0, 0x1\n\t"
232+ "1:add\t%0, %0, %1\n\t"
233+ "cmp.c\t%1, %0\n\t"
234+ "bleu 1f\n\t"
235+ "addi\t%0, 0x1\n\t"
236+ "1:\n\t"
237+ ".set\toptimize"
229238 : "=r" (sum), "=r" (proto)
230239 : "r" (saddr), "r" (daddr),
231240 "0" (htonl(len)), "1" (htonl(proto)), "r" (sum));
arch/score/include/asm/io.h+0−1
@@ -5,5 +5,4 @@ · 4 unmodified lines
55
66 #define virt_to_bus virt_to_phys
77 #define bus_to_virt phys_to_virt
8−
98 #endif /* _ASM_SCORE_IO_H */
arch/score/include/asm/pgalloc.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #define _ASM_SCORE_PGALLOC_H
33
44 #include <linux/mm.h>
5−
5+#include <linux/highmem.h>
66 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
77 pte_t *pte)
88 {
arch/score/kernel/entry.S+2−2
@@ -264,7 +264,7 @@ resume_kernel: · 263 unmodified lines
264264 disable_irq
265265 lw r8, [r28, TI_PRE_COUNT]
266266 cmpz.c r8
267− bne r8, restore_all
267+ bne restore_all
268268 need_resched:
269269 lw r8, [r28, TI_FLAGS]
270270 andri.c r9, r8, _TIF_NEED_RESCHED
@@ -415,7 +415,7 @@ ENTRY(handle_sys) · 144 unmodified lines
415415 sw r9, [r0, PT_EPC]
416416
417417 cmpi.c r27, __NR_syscalls # check syscall number
418− bgeu illegal_syscall
418+ bcs illegal_syscall
419419
420420 slli r8, r27, 2 # get syscall routine
421421 la r11, sys_call_table
arch/score/kernel/process.c+2−2
@@ -78,8 +78,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, · 77 unmodified lines
7878 p->thread.reg0 = (unsigned long) childregs;
7979 if (unlikely(p->flags & PF_KTHREAD)) {
8080 memset(childregs, 0, sizeof(struct pt_regs));
81− p->thread->reg12 = usp;
82− p->thread->reg13 = arg;
81+ p->thread.reg12 = usp;
82+ p->thread.reg13 = arg;
8383 p->thread.reg3 = (unsigned long) ret_from_kernel_thread;
8484 } else {
8585 *childregs = *current_pt_regs();
arch/sparc/Kconfig+6−1
@@ -506,12 +506,17 @@ config SUN_OPENPROMFS · 505 unmodified lines
506506 Only choose N if you know in advance that you will not need to modify
507507 OpenPROM settings on the running system.
508508
509−# Makefile helper
509+# Makefile helpers
510510 config SPARC64_PCI
511511 bool
512512 default y
513513 depends on SPARC64 && PCI
514514
515+config SPARC64_PCI_MSI
516+ bool
517+ default y
518+ depends on SPARC64_PCI && PCI_MSI
519+
515520 endmenu
516521
517522 menu "Executable file formats"
arch/sparc/include/asm/floppy_64.h+1−1
@@ -254,7 +254,7 @@ static int sun_fd_request_irq(void) · 253 unmodified lines
254254 once = 1;
255255
256256 error = request_irq(FLOPPY_IRQ, sparc_floppy_irq,
257− IRQF_DISABLED, "floppy", NULL);
257+ 0, "floppy", NULL);
258258
259259 return ((error == 0) ? 0 : -1);
260260 }
arch/sparc/kernel/Makefile+2−1
@@ -1,3 +1,4 @@
1+
12 #
23 # Makefile for the linux kernel.
34 #
@@ -99,7 +100,7 @@ obj-$(CONFIG_STACKTRACE) += stacktrace.o · 95 unmodified lines
99100 obj-$(CONFIG_SPARC64_PCI) += pci.o pci_common.o psycho_common.o
100101 obj-$(CONFIG_SPARC64_PCI) += pci_psycho.o pci_sabre.o pci_schizo.o
101102 obj-$(CONFIG_SPARC64_PCI) += pci_sun4v.o pci_sun4v_asm.o pci_fire.o
102−obj-$(CONFIG_PCI_MSI) += pci_msi.o
103+obj-$(CONFIG_SPARC64_PCI_MSI) += pci_msi.o
103104
104105 obj-$(CONFIG_COMPAT) += sys32.o sys_sparc32.o signal32.o
105106
arch/sparc/kernel/ds.c+2−3
@@ -849,9 +849,8 @@ void ldom_reboot(const char *boot_command) · 848 unmodified lines
849849 if (boot_command && strlen(boot_command)) {
850850 unsigned long len;
851851
852− strcpy(full_boot_str, "boot ");
853− strlcpy(full_boot_str + strlen("boot "), boot_command,
854− sizeof(full_boot_str + strlen("boot ")));
852+ snprintf(full_boot_str, sizeof(full_boot_str), "boot %s",
853+ boot_command);
855854 len = strlen(full_boot_str);
856855
857856 if (reboot_data_supported) {
arch/sparc/kernel/ldc.c+2−2
@@ -1249,12 +1249,12 @@ int ldc_bind(struct ldc_channel *lp, const char *name) · 1248 unmodified lines
12491249 snprintf(lp->rx_irq_name, LDC_IRQ_NAME_MAX, "%s RX", name);
12501250 snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name);
12511251
1252− err = request_irq(lp->cfg.rx_irq, ldc_rx, IRQF_DISABLED,
1252+ err = request_irq(lp->cfg.rx_irq, ldc_rx, 0,
12531253 lp->rx_irq_name, lp);
12541254 if (err)
12551255 return err;
12561256
1257− err = request_irq(lp->cfg.tx_irq, ldc_tx, IRQF_DISABLED,
1257+ err = request_irq(lp->cfg.tx_irq, ldc_tx, 0,
12581258 lp->tx_irq_name, lp);
12591259 if (err) {
12601260 free_irq(lp->cfg.rx_irq, lp);
arch/x86/Kconfig+3−2
@@ -481,11 +481,12 @@ config X86_INTEL_LPSS · 480 unmodified lines
481481 bool "Intel Low Power Subsystem Support"
482482 depends on ACPI
483483 select COMMON_CLK
484+ select PINCTRL
484485 ---help---
485486 Select to build support for Intel Low Power Subsystem such as
486487 found on Intel Lynxpoint PCH. Selecting this option enables
487− things like clock tree (common clock framework) which are needed
488− by the LPSS peripheral drivers.
488+ things like clock tree (common clock framework) and pincontrol
489+ which are needed by the LPSS peripheral drivers.
489490
490491 config X86_RDC321X
491492 bool "RDC R-321x SoC"
arch/x86/include/asm/xen/page.h+20−11
@@ -79,30 +79,38 @@ static inline int phys_to_machine_mapping_valid(unsigned long pfn) · 78 unmodified lines
7979 return get_phys_to_machine(pfn) != INVALID_P2M_ENTRY;
8080 }
8181
82−static inline unsigned long mfn_to_pfn(unsigned long mfn)
82+static inline unsigned long mfn_to_pfn_no_overrides(unsigned long mfn)
8383 {
8484 unsigned long pfn;
85− int ret = 0;
85+ int ret;
8686
8787 if (xen_feature(XENFEAT_auto_translated_physmap))
8888 return mfn;
8989
90− if (unlikely(mfn >= machine_to_phys_nr)) {
91− pfn = ~0;
92− goto try_override;
93− }
94− pfn = 0;
90+ if (unlikely(mfn >= machine_to_phys_nr))
91+ return ~0;
92+
9593 /*
9694 * The array access can fail (e.g., device space beyond end of RAM).
9795 * In such cases it doesn't matter what we return (we return garbage),
9896 * but we must handle the fault without crashing!
9997 */
10098 ret = __get_user(pfn, &machine_to_phys_mapping[mfn]);
101−try_override:
102− /* ret might be < 0 if there are no entries in the m2p for mfn */
10399 if (ret < 0)
104− pfn = ~0;
105− else if (get_phys_to_machine(pfn) != mfn)
100+ return ~0;
101+
102+ return pfn;
103+}
104+
105+static inline unsigned long mfn_to_pfn(unsigned long mfn)
106+{
107+ unsigned long pfn;
108+
109+ if (xen_feature(XENFEAT_auto_translated_physmap))
110+ return mfn;
111+
112+ pfn = mfn_to_pfn_no_overrides(mfn);
113+ if (get_phys_to_machine(pfn) != mfn) {
106114 /*
107115 * If this appears to be a foreign mfn (because the pfn
108116 * doesn't map back to the mfn), then check the local override
@@ -111,6 +119,7 @@ try_override: · 2 unmodified lines
111119 * m2p_find_override_pfn returns ~0 if it doesn't find anything.
112120 */
113121 pfn = m2p_find_override_pfn(mfn, ~0);
122+ }
114123
115124 /*
116125 * pfn is ~0 if there are no entries in the m2p for mfn or if the
arch/x86/kernel/cpu/perf_event.c+6−6
@@ -1506,7 +1506,7 @@ static int __init init_hw_perf_events(void) · 1505 unmodified lines
15061506 err = amd_pmu_init();
15071507 break;
15081508 default:
1509− return 0;
1509+ err = -ENOTSUPP;
15101510 }
15111511 if (err != 0) {
15121512 pr_cont("no PMU driver, software events only.\n");
@@ -1883,9 +1883,9 @@ static struct pmu pmu = { · 370 unmodified lines
18831883
18841884 void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now)
18851885 {
1886− userpg->cap_usr_time = 0;
1887− userpg->cap_usr_time_zero = 0;
1888− userpg->cap_usr_rdpmc = x86_pmu.attr_rdpmc;
1886+ userpg->cap_user_time = 0;
1887+ userpg->cap_user_time_zero = 0;
1888+ userpg->cap_user_rdpmc = x86_pmu.attr_rdpmc;
18891889 userpg->pmc_width = x86_pmu.cntval_bits;
18901890
18911891 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
@@ -1894,13 +1894,13 @@ void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now) · 2 unmodified lines
18941894 if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
18951895 return;
18961896
1897− userpg->cap_usr_time = 1;
1897+ userpg->cap_user_time = 1;
18981898 userpg->time_mult = this_cpu_read(cyc2ns);
18991899 userpg->time_shift = CYC2NS_SCALE_FACTOR;
19001900 userpg->time_offset = this_cpu_read(cyc2ns_offset) - now;
19011901
19021902 if (sched_clock_stable && !check_tsc_disabled()) {
1903− userpg->cap_usr_time_zero = 1;
1903+ userpg->cap_user_time_zero = 1;
19041904 userpg->time_zero = this_cpu_read(cyc2ns_offset);
19051905 }
19061906 }
arch/x86/kernel/cpu/perf_event_intel.c+1−0
@@ -2325,6 +2325,7 @@ __init int intel_pmu_init(void) · 2324 unmodified lines
23252325 break;
23262326
23272327 case 55: /* Atom 22nm "Silvermont" */
2328+ case 77: /* Avoton "Silvermont" */
23282329 memcpy(hw_cache_event_ids, slm_hw_cache_event_ids,
23292330 sizeof(hw_cache_event_ids));
23302331 memcpy(hw_cache_extra_regs, slm_hw_cache_extra_regs,
arch/x86/kernel/cpu/perf_event_intel_ds.c+1−0
@@ -584,6 +584,7 @@ struct event_constraint intel_snb_pebs_event_constraints[] = { · 583 unmodified lines
584584 INTEL_EVENT_CONSTRAINT(0xd0, 0xf), /* MEM_UOP_RETIRED.* */
585585 INTEL_EVENT_CONSTRAINT(0xd1, 0xf), /* MEM_LOAD_UOPS_RETIRED.* */
586586 INTEL_EVENT_CONSTRAINT(0xd2, 0xf), /* MEM_LOAD_UOPS_LLC_HIT_RETIRED.* */
587+ INTEL_EVENT_CONSTRAINT(0xd3, 0xf), /* MEM_LOAD_UOPS_LLC_MISS_RETIRED.* */
587588 INTEL_UEVENT_CONSTRAINT(0x02d4, 0xf), /* MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS */
588589 EVENT_CONSTRAINT_END
589590 };
arch/x86/kernel/cpu/perf_event_intel_uncore.c+5−5
@@ -2706,14 +2706,14 @@ static void uncore_pmu_init_hrtimer(struct intel_uncore_box *box) · 2705 unmodified lines
27062706 box->hrtimer.function = uncore_pmu_hrtimer;
27072707 }
27082708
2709−struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, int cpu)
2709+static struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, int node)
27102710 {
27112711 struct intel_uncore_box *box;
27122712 int i, size;
27132713
27142714 size = sizeof(*box) + type->num_shared_regs * sizeof(struct intel_uncore_extra_reg);
27152715
2716− box = kzalloc_node(size, GFP_KERNEL, cpu_to_node(cpu));
2716+ box = kzalloc_node(size, GFP_KERNEL, node);
27172717 if (!box)
27182718 return NULL;
27192719
@@ -3031,7 +3031,7 @@ static int uncore_validate_group(struct intel_uncore_pmu *pmu, · 311 unmodified lines
30313031 struct intel_uncore_box *fake_box;
30323032 int ret = -EINVAL, n;
30333033
3034− fake_box = uncore_alloc_box(pmu->type, smp_processor_id());
3034+ fake_box = uncore_alloc_box(pmu->type, NUMA_NO_NODE);
30353035 if (!fake_box)
30363036 return -ENOMEM;
30373037
@@ -3294,7 +3294,7 @@ static int uncore_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id · 256 unmodified lines
32943294 }
32953295
32963296 type = pci_uncores[UNCORE_PCI_DEV_TYPE(id->driver_data)];
3297− box = uncore_alloc_box(type, 0);
3297+ box = uncore_alloc_box(type, NUMA_NO_NODE);
32983298 if (!box)
32993299 return -ENOMEM;
33003300
@@ -3499,7 +3499,7 @@ static int uncore_cpu_prepare(int cpu, int phys_id) · 198 unmodified lines
34993499 if (pmu->func_id < 0)
35003500 pmu->func_id = j;
35013501
3502− box = uncore_alloc_box(type, cpu);
3502+ box = uncore_alloc_box(type, cpu_to_node(cpu));
35033503 if (!box)
35043504 return -ENOMEM;
35053505
arch/x86/kernel/entry_64.S+0−15
@@ -487,21 +487,6 @@ ENDPROC(native_usergs_sysret64) · 486 unmodified lines
487487 TRACE_IRQS_OFF
488488 .endm
489489
490−ENTRY(save_rest)
491− PARTIAL_FRAME 1 (REST_SKIP+8)
492− movq 5*8+16(%rsp), %r11 /* save return address */
493− movq_cfi rbx, RBX+16
494− movq_cfi rbp, RBP+16
495− movq_cfi r12, R12+16
496− movq_cfi r13, R13+16
497− movq_cfi r14, R14+16
498− movq_cfi r15, R15+16
499− movq %r11, 8(%rsp) /* return address */
500− FIXUP_TOP_OF_STACK %r11, 16
501− ret
502− CFI_ENDPROC
503−END(save_rest)
504−
505490 /* save complete stack frame */
506491 .pushsection .kprobes.text, "ax"
507492 ENTRY(save_paranoid)
arch/x86/kernel/microcode_amd.c+1−0
@@ -216,6 +216,7 @@ int apply_microcode_amd(int cpu) · 215 unmodified lines
216216 /* need to apply patch? */
217217 if (rev >= mc_amd->hdr.patch_id) {
218218 c->microcode = rev;
219+ uci->cpu_sig.rev = rev;
219220 return 0;
220221 }
221222
arch/x86/kernel/reboot.c+17−1
@@ -352,12 +352,28 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { · 351 unmodified lines
352352 },
353353 { /* Handle problems with rebooting on the Precision M6600. */
354354 .callback = set_pci_reboot,
355− .ident = "Dell OptiPlex 990",
355+ .ident = "Dell Precision M6600",
356356 .matches = {
357357 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
358358 DMI_MATCH(DMI_PRODUCT_NAME, "Precision M6600"),
359359 },
360360 },
361+ { /* Handle problems with rebooting on the Dell PowerEdge C6100. */
362+ .callback = set_pci_reboot,
363+ .ident = "Dell PowerEdge C6100",
364+ .matches = {
365+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
366+ DMI_MATCH(DMI_PRODUCT_NAME, "C6100"),
367+ },
368+ },
369+ { /* Some C6100 machines were shipped with vendor being 'Dell'. */
370+ .callback = set_pci_reboot,
371+ .ident = "Dell PowerEdge C6100",
372+ .matches = {
373+ DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
374+ DMI_MATCH(DMI_PRODUCT_NAME, "C6100"),
375+ },
376+ },
361377 { }
362378 };
363379
arch/x86/kernel/smpboot.c+2−1
@@ -653,6 +653,7 @@ static void announce_cpu(int cpu, int apicid) · 652 unmodified lines
653653 {
654654 static int current_node = -1;
655655 int node = early_cpu_to_node(cpu);
656+ int max_cpu_present = find_last_bit(cpumask_bits(cpu_present_mask), NR_CPUS);
656657
657658 if (system_state == SYSTEM_BOOTING) {
658659 if (node != current_node) {
@@ -661,7 +662,7 @@ static void announce_cpu(int cpu, int apicid) · 2 unmodified lines
661662 current_node = node;
662663 pr_info("Booting Node %3d, Processors ", node);
663664 }
664− pr_cont(" #%d%s", cpu, cpu == (nr_cpu_ids - 1) ? " OK\n" : "");
665+ pr_cont(" #%4d%s", cpu, cpu == max_cpu_present ? " OK\n" : "");
665666 return;
666667 } else
667668 pr_info("Booting Node %d Processor %d APIC 0x%x\n",
arch/x86/kernel/sysfb_simplefb.c+2−2
@@ -72,14 +72,14 @@ __init int create_simplefb(const struct screen_info *si, · 71 unmodified lines
7272 * the part that is occupied by the framebuffer */
7373 len = mode->height * mode->stride;
7474 len = PAGE_ALIGN(len);
75− if (len > si->lfb_size << 16) {
75+ if (len > (u64)si->lfb_size << 16) {
7676 printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n");
7777 return -EINVAL;
7878 }
7979
8080 /* setup IORESOURCE_MEM as framebuffer memory */
8181 memset(&res, 0, sizeof(res));
82− res.flags = IORESOURCE_MEM;
82+ res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
8383 res.name = simplefb_resname;
8484 res.start = si->lfb_base;
8585 res.end = si->lfb_base + len - 1;
arch/x86/kvm/vmx.c+3−1
@@ -5345,7 +5345,9 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) · 5344 unmodified lines
53455345 * There are errata that may cause this bit to not be set:
53465346 * AAK134, BY25.
53475347 */
5348− if (exit_qualification & INTR_INFO_UNBLOCK_NMI)
5348+ if (!(to_vmx(vcpu)->idt_vectoring_info & VECTORING_INFO_VALID_MASK) &&
5349+ cpu_has_virtual_nmis() &&
5350+ (exit_qualification & INTR_INFO_UNBLOCK_NMI))
53495351 vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI);
53505352
53515353 gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
arch/x86/pci/mmconfig-shared.c+6−1
@@ -700,7 +700,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, · 699 unmodified lines
700700 if (!(pci_probe & PCI_PROBE_MMCONF) || pci_mmcfg_arch_init_failed)
701701 return -ENODEV;
702702
703− if (start > end || !addr)
703+ if (start > end)
704704 return -EINVAL;
705705
706706 mutex_lock(&pci_mmcfg_lock);
@@ -716,6 +716,11 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, · 9 unmodified lines
716716 return -EEXIST;
717717 }
718718
719+ if (!addr) {
720+ mutex_unlock(&pci_mmcfg_lock);
721+ return -EINVAL;
722+ }
723+
719724 rc = -EBUSY;
720725 cfg = pci_mmconfig_alloc(seg, start, end, addr);
721726 if (cfg == NULL) {
arch/x86/platform/efi/efi.c+7−4
@@ -912,10 +912,13 @@ void __init efi_enter_virtual_mode(void) · 911 unmodified lines
912912
913913 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
914914 md = p;
915− if (!(md->attribute & EFI_MEMORY_RUNTIME) &&
916− md->type != EFI_BOOT_SERVICES_CODE &&
917− md->type != EFI_BOOT_SERVICES_DATA)
918− continue;
915+ if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
916+#ifdef CONFIG_X86_64
917+ if (md->type != EFI_BOOT_SERVICES_CODE &&
918+ md->type != EFI_BOOT_SERVICES_DATA)
919+#endif
920+ continue;
921+ }
919922
920923 size = md->num_pages << EFI_PAGE_SHIFT;
921924 end = md->phys_addr + size;
arch/x86/xen/p2m.c+4−6
@@ -879,7 +879,6 @@ int m2p_add_override(unsigned long mfn, struct page *page, · 878 unmodified lines
879879 unsigned long uninitialized_var(address);
880880 unsigned level;
881881 pte_t *ptep = NULL;
882− int ret = 0;
883882
884883 pfn = page_to_pfn(page);
885884 if (!PageHighMem(page)) {
@@ -926,8 +925,8 @@ int m2p_add_override(unsigned long mfn, struct page *page, · 40 unmodified lines
926925 * frontend pages while they are being shared with the backend,
927926 * because mfn_to_pfn (that ends up being called by GUPF) will
928927 * return the backend pfn rather than the frontend pfn. */
929− ret = __get_user(pfn, &machine_to_phys_mapping[mfn]);
930− if (ret == 0 && get_phys_to_machine(pfn) == mfn)
928+ pfn = mfn_to_pfn_no_overrides(mfn);
929+ if (get_phys_to_machine(pfn) == mfn)
931930 set_phys_to_machine(pfn, FOREIGN_FRAME(mfn));
932931
933932 return 0;
@@ -942,7 +941,6 @@ int m2p_remove_override(struct page *page, · 8 unmodified lines
942941 unsigned long uninitialized_var(address);
943942 unsigned level;
944943 pte_t *ptep = NULL;
945− int ret = 0;
946944
947945 pfn = page_to_pfn(page);
948946 mfn = get_phys_to_machine(pfn);
@@ -1029,8 +1027,8 @@ int m2p_remove_override(struct page *page, · 80 unmodified lines
10291027 * the original pfn causes mfn_to_pfn(mfn) to return the frontend
10301028 * pfn again. */
10311029 mfn &= ~FOREIGN_FRAME_BIT;
1032− ret = __get_user(pfn, &machine_to_phys_mapping[mfn]);
1033− if (ret == 0 && get_phys_to_machine(pfn) == FOREIGN_FRAME(mfn) &&
1030+ pfn = mfn_to_pfn_no_overrides(mfn);
1031+ if (get_phys_to_machine(pfn) == FOREIGN_FRAME(mfn) &&
10341032 m2p_find_override(mfn) == NULL)
10351033 set_phys_to_machine(pfn, mfn);
10361034
arch/x86/xen/spinlock.c+24−2
@@ -259,6 +259,14 @@ void xen_uninit_lock_cpu(int cpu) · 258 unmodified lines
259259 }
260260
261261
262+/*
263+ * Our init of PV spinlocks is split in two init functions due to us
264+ * using paravirt patching and jump labels patching and having to do
265+ * all of this before SMP code is invoked.
266+ *
267+ * The paravirt patching needs to be done _before_ the alternative asm code
268+ * is started, otherwise we would not patch the core kernel code.
269+ */
262270 void __init xen_init_spinlocks(void)
263271 {
264272
@@ -267,12 +275,26 @@ void __init xen_init_spinlocks(void) · 2 unmodified lines
267275 return;
268276 }
269277
270− static_key_slow_inc(&paravirt_ticketlocks_enabled);
271−
272278 pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning);
273279 pv_lock_ops.unlock_kick = xen_unlock_kick;
274280 }
275281
282+/*
283+ * While the jump_label init code needs to happend _after_ the jump labels are
284+ * enabled and before SMP is started. Hence we use pre-SMP initcall level
285+ * init. We cannot do it in xen_init_spinlocks as that is done before
286+ * jump labels are activated.
287+ */
288+static __init int xen_init_spinlocks_jump(void)
289+{
290+ if (!xen_pvspin)
291+ return 0;
292+
293+ static_key_slow_inc(&paravirt_ticketlocks_enabled);
294+ return 0;
295+}
296+early_initcall(xen_init_spinlocks_jump);
297+
276298 static __init int xen_parse_nopvspin(char *arg)
277299 {
278300 xen_pvspin = false;
block/Kconfig+7−2
@@ -99,11 +99,16 @@ config BLK_DEV_THROTTLING · 98 unmodified lines
9999
100100 See Documentation/cgroups/blkio-controller.txt for more information.
101101
102−config CMDLINE_PARSER
102+config BLK_CMDLINE_PARSER
103103 bool "Block device command line partition parser"
104104 default n
105105 ---help---
106− Parsing command line, get the partitions information.
106+ Enabling this option allows you to specify the partition layout from
107+ the kernel boot args. This is typically of use for embedded devices
108+ which don't otherwise have any standardized method for listing the
109+ partitions on a block device.
110+
111+ See Documentation/block/cmdline-partition.txt for more information.
107112
108113 menu "Partition Types"
109114
block/Makefile+1−1
@@ -18,4 +18,4 @@ obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o · 17 unmodified lines
1818
1919 obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o
2020 obj-$(CONFIG_BLK_DEV_INTEGRITY) += blk-integrity.o
21−obj-$(CONFIG_CMDLINE_PARSER) += cmdline-parser.o
21+obj-$(CONFIG_BLK_CMDLINE_PARSER) += cmdline-parser.o
block/blk-cgroup.c+15−10
@@ -235,8 +235,13 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg, · 234 unmodified lines
235235 blkg->online = true;
236236 spin_unlock(&blkcg->lock);
237237
238− if (!ret)
238+ if (!ret) {
239+ if (blkcg == &blkcg_root) {
240+ q->root_blkg = blkg;
241+ q->root_rl.blkg = blkg;
242+ }
239243 return blkg;
244+ }
240245
241246 /* @blkg failed fully initialized, use the usual release path */
242247 blkg_put(blkg);
@@ -334,6 +339,15 @@ static void blkg_destroy(struct blkcg_gq *blkg) · 91 unmodified lines
334339 if (rcu_dereference_raw(blkcg->blkg_hint) == blkg)
335340 rcu_assign_pointer(blkcg->blkg_hint, NULL);
336341
342+ /*
343+ * If root blkg is destroyed. Just clear the pointer since root_rl
344+ * does not take reference on root blkg.
345+ */
346+ if (blkcg == &blkcg_root) {
347+ blkg->q->root_blkg = NULL;
348+ blkg->q->root_rl.blkg = NULL;
349+ }
350+
337351 /*
338352 * Put the reference taken at the time of creation so that when all
339353 * queues are gone, group can be destroyed.
@@ -360,13 +374,6 @@ static void blkg_destroy_all(struct request_queue *q) · 20 unmodified lines
360374 blkg_destroy(blkg);
361375 spin_unlock(&blkcg->lock);
362376 }
363−
364− /*
365− * root blkg is destroyed. Just clear the pointer since
366− * root_rl does not take reference on root blkg.
367− */
368− q->root_blkg = NULL;
369− q->root_rl.blkg = NULL;
370377 }
371378
372379 /*
@@ -970,8 +977,6 @@ int blkcg_activate_policy(struct request_queue *q, · 597 unmodified lines
970977 ret = PTR_ERR(blkg);
971978 goto out_unlock;
972979 }
973− q->root_blkg = blkg;
974− q->root_rl.blkg = blkg;
975980
976981 list_for_each_entry(blkg, &q->blkg_list, q_node)
977982 cnt++;
block/blk-core.c+2−4
@@ -1549,11 +1549,9 @@ get_rq: · 1548 unmodified lines
15491549 if (plug) {
15501550 /*
15511551 * If this is the first request added after a plug, fire
1552− * of a plug trace. If others have been added before, check
1553− * if we have multiple devices in this plug. If so, make a
1554− * note to sort the list before dispatch.
1552+ * of a plug trace.
15551553 */
1556− if (list_empty(&plug->list))
1554+ if (!request_count)
15571555 trace_block_plug(q);
15581556 else {
15591557 if (request_count >= BLK_MAX_REQUEST_COUNT) {
block/blk-exec.c+2−2
@@ -68,9 +68,9 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk, · 67 unmodified lines
6868 spin_lock_irq(q->queue_lock);
6969
7070 if (unlikely(blk_queue_dying(q))) {
71+ rq->cmd_flags |= REQ_QUIET;
7172 rq->errors = -ENXIO;
72− if (rq->end_io)
73− rq->end_io(rq, rq->errors);
73+ __blk_end_request_all(rq, rq->errors);
7474 spin_unlock_irq(q->queue_lock);
7575 return;
7676 }
block/cfq-iosched.c+2−2
@@ -1803,7 +1803,7 @@ static u64 cfqg_prfill_avg_queue_size(struct seq_file *sf, · 1802 unmodified lines
18031803
18041804 if (samples) {
18051805 v = blkg_stat_read(&cfqg->stats.avg_queue_size_sum);
1806− do_div(v, samples);
1806+ v = div64_u64(v, samples);
18071807 }
18081808 __blkg_prfill_u64(sf, pd, v);
18091809 return 0;
@@ -4358,7 +4358,7 @@ static int cfq_init_queue(struct request_queue *q, struct elevator_type *e) · 2548 unmodified lines
43584358 if (!eq)
43594359 return -ENOMEM;
43604360
4361− cfqd = kmalloc_node(sizeof(*cfqd), GFP_KERNEL | __GFP_ZERO, q->node);
4361+ cfqd = kzalloc_node(sizeof(*cfqd), GFP_KERNEL, q->node);
43624362 if (!cfqd) {
43634363 kobject_put(&eq->kobj);
43644364 return -ENOMEM;
block/deadline-iosched.c+1−1
@@ -346,7 +346,7 @@ static int deadline_init_queue(struct request_queue *q, struct elevator_type *e) · 345 unmodified lines
346346 if (!eq)
347347 return -ENOMEM;
348348
349− dd = kmalloc_node(sizeof(*dd), GFP_KERNEL | __GFP_ZERO, q->node);
349+ dd = kzalloc_node(sizeof(*dd), GFP_KERNEL, q->node);
350350 if (!dd) {
351351 kobject_put(&eq->kobj);
352352 return -ENOMEM;
block/elevator.c+1−1
@@ -155,7 +155,7 @@ struct elevator_queue *elevator_alloc(struct request_queue *q, · 154 unmodified lines
155155 {
156156 struct elevator_queue *eq;
157157
158− eq = kmalloc_node(sizeof(*eq), GFP_KERNEL | __GFP_ZERO, q->node);
158+ eq = kzalloc_node(sizeof(*eq), GFP_KERNEL, q->node);
159159 if (unlikely(!eq))
160160 goto err;
161161
block/genhd.c+1−2
@@ -1252,8 +1252,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id) · 1251 unmodified lines
12521252 {
12531253 struct gendisk *disk;
12541254
1255− disk = kmalloc_node(sizeof(struct gendisk),
1256− GFP_KERNEL | __GFP_ZERO, node_id);
1255+ disk = kzalloc_node(sizeof(struct gendisk), GFP_KERNEL, node_id);
12571256 if (disk) {
12581257 if (!init_part_stats(&disk->part0)) {
12591258 kfree(disk);
block/partitions/Kconfig+2−2
@@ -263,7 +263,7 @@ config SYSV68_PARTITION · 262 unmodified lines
263263
264264 config CMDLINE_PARTITION
265265 bool "Command line partition support" if PARTITION_ADVANCED
266− select CMDLINE_PARSER
266+ select BLK_CMDLINE_PARSER
267267 help
268− Say Y here if you would read the partitions table from bootargs.
268+ Say Y here if you want to read the partition table from bootargs.
269269 The format for the command line is just like mtdparts.
block/partitions/cmdline.c+4−4
@@ -2,15 +2,15 @@ · 1 unmodified line
22 * Copyright (C) 2013 HUAWEI
33 * Author: Cai Zhiyong <caizhiyong@huawei.com>
44 *
5− * Read block device partition table from command line.
6− * The partition used for fixed block device (eMMC) embedded device.
7− * It is no MBR, save storage space. Bootloader can be easily accessed
5+ * Read block device partition table from the command line.
6+ * Typically used for fixed block (eMMC) embedded devices.
7+ * It has no MBR, so saves storage space. Bootloader can be easily accessed
88 * by absolute address of data on the block device.
99 * Users can easily change the partition.
1010 *
1111 * The format for the command line is just like mtdparts.
1212 *
13− * Verbose config please reference "Documentation/block/cmdline-partition.txt"
13+ * For further information, see "Documentation/block/cmdline-partition.txt"
1414 *
1515 */
1616
drivers/acpi/acpi_ipmi.c+14−10
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include <linux/ipmi.h>
4040 #include <linux/device.h>
4141 #include <linux/pnp.h>
42+#include <linux/spinlock.h>
4243
4344 MODULE_AUTHOR("Zhao Yakui");
4445 MODULE_DESCRIPTION("ACPI IPMI Opregion driver");
@@ -57,7 +58,7 @@ struct acpi_ipmi_device { · 12 unmodified lines
5758 struct list_head head;
5859 /* the IPMI request message list */
5960 struct list_head tx_msg_list;
60− struct mutex tx_msg_lock;
61+ spinlock_t tx_msg_lock;
6162 acpi_handle handle;
6263 struct pnp_dev *pnp_dev;
6364 ipmi_user_t user_interface;
@@ -147,6 +148,7 @@ static void acpi_format_ipmi_msg(struct acpi_ipmi_msg *tx_msg, · 83 unmodified lines
147148 struct kernel_ipmi_msg *msg;
148149 struct acpi_ipmi_buffer *buffer;
149150 struct acpi_ipmi_device *device;
151+ unsigned long flags;
150152
151153 msg = &tx_msg->tx_message;
152154 /*
@@ -177,10 +179,10 @@ static void acpi_format_ipmi_msg(struct acpi_ipmi_msg *tx_msg, · 24 unmodified lines
177179
178180 /* Get the msgid */
179181 device = tx_msg->device;
180− mutex_lock(&device->tx_msg_lock);
182+ spin_lock_irqsave(&device->tx_msg_lock, flags);
181183 device->curr_msgid++;
182184 tx_msg->tx_msgid = device->curr_msgid;
183− mutex_unlock(&device->tx_msg_lock);
185+ spin_unlock_irqrestore(&device->tx_msg_lock, flags);
184186 }
185187
186188 static void acpi_format_ipmi_response(struct acpi_ipmi_msg *msg,
@@ -242,6 +244,7 @@ static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) · 55 unmodified lines
242244 int msg_found = 0;
243245 struct acpi_ipmi_msg *tx_msg;
244246 struct pnp_dev *pnp_dev = ipmi_device->pnp_dev;
247+ unsigned long flags;
245248
246249 if (msg->user != ipmi_device->user_interface) {
247250 dev_warn(&pnp_dev->dev, "Unexpected response is returned. "
@@ -250,7 +253,7 @@ static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) · 2 unmodified lines
250253 ipmi_free_recv_msg(msg);
251254 return;
252255 }
253− mutex_lock(&ipmi_device->tx_msg_lock);
256+ spin_lock_irqsave(&ipmi_device->tx_msg_lock, flags);
254257 list_for_each_entry(tx_msg, &ipmi_device->tx_msg_list, head) {
255258 if (msg->msgid == tx_msg->tx_msgid) {
256259 msg_found = 1;
@@ -258,7 +261,7 @@ static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data) · 1 unmodified line
258261 }
259262 }
260263
261− mutex_unlock(&ipmi_device->tx_msg_lock);
264+ spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags);
262265 if (!msg_found) {
263266 dev_warn(&pnp_dev->dev, "Unexpected response (msg id %ld) is "
264267 "returned.\n", msg->msgid);
@@ -378,6 +381,7 @@ acpi_ipmi_space_handler(u32 function, acpi_physical_address address, · 113 unmodified lines
378381 struct acpi_ipmi_device *ipmi_device = handler_context;
379382 int err, rem_time;
380383 acpi_status status;
384+ unsigned long flags;
381385 /*
382386 * IPMI opregion message.
383387 * IPMI message is firstly written to the BMC and system software
@@ -395,9 +399,9 @@ acpi_ipmi_space_handler(u32 function, acpi_physical_address address, · 11 unmodified lines
395399 return AE_NO_MEMORY;
396400
397401 acpi_format_ipmi_msg(tx_msg, address, value);
398− mutex_lock(&ipmi_device->tx_msg_lock);
402+ spin_lock_irqsave(&ipmi_device->tx_msg_lock, flags);
399403 list_add_tail(&tx_msg->head, &ipmi_device->tx_msg_list);
400− mutex_unlock(&ipmi_device->tx_msg_lock);
404+ spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags);
401405 err = ipmi_request_settime(ipmi_device->user_interface,
402406 &tx_msg->addr,
403407 tx_msg->tx_msgid,
@@ -413,9 +417,9 @@ acpi_ipmi_space_handler(u32 function, acpi_physical_address address, · 9 unmodified lines
413417 status = AE_OK;
414418
415419 end_label:
416− mutex_lock(&ipmi_device->tx_msg_lock);
420+ spin_lock_irqsave(&ipmi_device->tx_msg_lock, flags);
417421 list_del(&tx_msg->head);
418− mutex_unlock(&ipmi_device->tx_msg_lock);
422+ spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags);
419423 kfree(tx_msg);
420424 return status;
421425 }
@@ -457,7 +461,7 @@ static void acpi_add_ipmi_device(struct acpi_ipmi_device *ipmi_device) · 35 unmodified lines
457461
458462 INIT_LIST_HEAD(&ipmi_device->head);
459463
460− mutex_init(&ipmi_device->tx_msg_lock);
464+ spin_lock_init(&ipmi_device->tx_msg_lock);
461465 INIT_LIST_HEAD(&ipmi_device->tx_msg_list);
462466 ipmi_install_space_handler(ipmi_device);
463467
drivers/acpi/scan.c+2−2
@@ -968,7 +968,7 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) · 967 unmodified lines
968968 }
969969 return 0;
970970 }
971−EXPORT_SYMBOL_GPL(acpi_bus_get_device);
971+EXPORT_SYMBOL(acpi_bus_get_device);
972972
973973 int acpi_device_add(struct acpi_device *device,
974974 void (*release)(struct device *))
@@ -1121,7 +1121,7 @@ int acpi_bus_register_driver(struct acpi_driver *driver) · 146 unmodified lines
11211121 EXPORT_SYMBOL(acpi_bus_register_driver);
11221122
11231123 /**
1124− * acpi_bus_unregister_driver - unregisters a driver with the APIC bus
1124+ * acpi_bus_unregister_driver - unregisters a driver with the ACPI bus
11251125 * @driver: driver to unregister
11261126 *
11271127 * Unregisters a driver with the ACPI bus. Searches the namespace for all
drivers/ata/sata_promise.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * sata_promise.c - Promise SATA
33 *
44 * Maintained by: Tejun Heo <tj@kernel.org>
5− * Mikael Pettersson <mikpe@it.uu.se>
5+ * Mikael Pettersson
66 * Please ALWAYS copy linux-ide@vger.kernel.org
77 * on emails.
88 *
drivers/atm/he.c+1−12
@@ -2865,15 +2865,4 @@ static struct pci_driver he_driver = { · 2864 unmodified lines
28652865 .id_table = he_pci_tbl,
28662866 };
28672867
2868−static int __init he_init(void)
2869−{
2870− return pci_register_driver(&he_driver);
2871−}
2872−
2873−static void __exit he_cleanup(void)
2874−{
2875− pci_unregister_driver(&he_driver);
2876−}
2877−
2878−module_init(he_init);
2879−module_exit(he_cleanup);
2868+module_pci_driver(he_driver);
drivers/atm/nicstar.c+1−1
@@ -778,7 +778,7 @@ static int ns_init_card(int i, struct pci_dev *pcidev) · 777 unmodified lines
778778 return error;
779779 }
780780
781− if (mac[i] == NULL || mac_pton(mac[i], card->atmdev->esi)) {
781+ if (mac[i] == NULL || !mac_pton(mac[i], card->atmdev->esi)) {
782782 nicstar_read_eprom(card->membase, NICSTAR_EPROM_MAC_ADDR_OFFSET,
783783 card->atmdev->esi, 6);
784784 if (memcmp(card->atmdev->esi, "\x00\x00\x00\x00\x00\x00", 6) ==
drivers/base/core.c+7−7
@@ -2017,7 +2017,7 @@ EXPORT_SYMBOL_GPL(device_move); · 2016 unmodified lines
20172017 */
20182018 void device_shutdown(void)
20192019 {
2020− struct device *dev;
2020+ struct device *dev, *parent;
20212021
20222022 spin_lock(&devices_kset->list_lock);
20232023 /*
@@ -2034,7 +2034,7 @@ void device_shutdown(void) · 10 unmodified lines
20342034 * prevent it from being freed because parent's
20352035 * lock is to be held
20362036 */
2037− get_device(dev->parent);
2037+ parent = get_device(dev->parent);
20382038 get_device(dev);
20392039 /*
20402040 * Make sure the device is off the kset list, in the
@@ -2044,8 +2044,8 @@ void device_shutdown(void) · 3 unmodified lines
20442044 spin_unlock(&devices_kset->list_lock);
20452045
20462046 /* hold lock to avoid race with probe/release */
2047− if (dev->parent)
2048− device_lock(dev->parent);
2047+ if (parent)
2048+ device_lock(parent);
20492049 device_lock(dev);
20502050
20512051 /* Don't allow any more runtime suspends */
@@ -2063,11 +2063,11 @@ void device_shutdown(void) · 11 unmodified lines
20632063 }
20642064
20652065 device_unlock(dev);
2066− if (dev->parent)
2067− device_unlock(dev->parent);
2066+ if (parent)
2067+ device_unlock(parent);
20682068
20692069 put_device(dev);
2070− put_device(dev->parent);
2070+ put_device(parent);
20712071
20722072 spin_lock(&devices_kset->list_lock);
20732073 }
drivers/bcma/driver_pci.c+26−23
@@ -210,25 +210,6 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc) · 209 unmodified lines
210210 }
211211 }
212212
213−static void bcma_core_pci_power_save(struct bcma_drv_pci *pc, bool up)
214−{
215− u16 data;
216−
217− if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
218− data = up ? 0x74 : 0x7C;
219− bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
220− BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64);
221− bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
222− BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
223− } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) {
224− data = up ? 0x75 : 0x7D;
225− bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
226− BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65);
227− bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
228− BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
229− }
230−}
231−
232213 /**************************************************
233214 * Init.
234215 **************************************************/
@@ -255,6 +236,32 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc) · 20 unmodified lines
255236 bcma_core_pci_clientmode_init(pc);
256237 }
257238
239+void bcma_core_pci_power_save(struct bcma_bus *bus, bool up)
240+{
241+ struct bcma_drv_pci *pc;
242+ u16 data;
243+
244+ if (bus->hosttype != BCMA_HOSTTYPE_PCI)
245+ return;
246+
247+ pc = &bus->drv_pci[0];
248+
249+ if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
250+ data = up ? 0x74 : 0x7C;
251+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
252+ BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64);
253+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
254+ BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
255+ } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) {
256+ data = up ? 0x75 : 0x7D;
257+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
258+ BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65);
259+ bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
260+ BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
261+ }
262+}
263+EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);
264+
258265 int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
259266 bool enable)
260267 {
@@ -310,8 +317,6 @@ void bcma_core_pci_up(struct bcma_bus *bus) · 49 unmodified lines
310317
311318 pc = &bus->drv_pci[0];
312319
313− bcma_core_pci_power_save(pc, true);
314−
315320 bcma_core_pci_extend_L1timer(pc, true);
316321 }
317322 EXPORT_SYMBOL_GPL(bcma_core_pci_up);
@@ -326,7 +331,5 @@ void bcma_core_pci_down(struct bcma_bus *bus) · 8 unmodified lines
326331 pc = &bus->drv_pci[0];
327332
328333 bcma_core_pci_extend_L1timer(pc, false);
329−
330− bcma_core_pci_power_save(pc, false);
331334 }
332335 EXPORT_SYMBOL_GPL(bcma_core_pci_down);
drivers/bcma/scan.c+7−5
@@ -269,6 +269,8 @@ static struct bcma_device *bcma_find_core_reverse(struct bcma_bus *bus, u16 core · 268 unmodified lines
269269 return NULL;
270270 }
271271
272+#define IS_ERR_VALUE_U32(x) ((x) >= (u32)-MAX_ERRNO)
273+
272274 static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
273275 struct bcma_device_id *match, int core_num,
274276 struct bcma_device *core)
@@ -351,11 +353,11 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, · 76 unmodified lines
351353 * the main register space for the core
352354 */
353355 tmp = bcma_erom_get_addr_desc(bus, eromptr, SCAN_ADDR_TYPE_SLAVE, 0);
354− if (tmp == 0 || IS_ERR_VALUE(tmp)) {
356+ if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) {
355357 /* Try again to see if it is a bridge */
356358 tmp = bcma_erom_get_addr_desc(bus, eromptr,
357359 SCAN_ADDR_TYPE_BRIDGE, 0);
358− if (tmp == 0 || IS_ERR_VALUE(tmp)) {
360+ if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) {
359361 return -EILSEQ;
360362 } else {
361363 bcma_info(bus, "Bridge found\n");
@@ -369,7 +371,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, · 7 unmodified lines
369371 for (j = 0; ; j++) {
370372 tmp = bcma_erom_get_addr_desc(bus, eromptr,
371373 SCAN_ADDR_TYPE_SLAVE, i);
372− if (IS_ERR_VALUE(tmp)) {
374+ if (IS_ERR_VALUE_U32(tmp)) {
373375 /* no more entries for port _i_ */
374376 /* pr_debug("erom: slave port %d "
375377 * "has %d descriptors\n", i, j); */
@@ -386,7 +388,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, · 10 unmodified lines
386388 for (j = 0; ; j++) {
387389 tmp = bcma_erom_get_addr_desc(bus, eromptr,
388390 SCAN_ADDR_TYPE_MWRAP, i);
389− if (IS_ERR_VALUE(tmp)) {
391+ if (IS_ERR_VALUE_U32(tmp)) {
390392 /* no more entries for port _i_ */
391393 /* pr_debug("erom: master wrapper %d "
392394 * "has %d descriptors\n", i, j); */
@@ -404,7 +406,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, · 11 unmodified lines
404406 for (j = 0; ; j++) {
405407 tmp = bcma_erom_get_addr_desc(bus, eromptr,
406408 SCAN_ADDR_TYPE_SWRAP, i + hack);
407− if (IS_ERR_VALUE(tmp)) {
409+ if (IS_ERR_VALUE_U32(tmp)) {
408410 /* no more entries for port _i_ */
409411 /* pr_debug("erom: master wrapper %d "
410412 * has %d descriptors\n", i, j); */
drivers/block/cciss.c+1−0
@@ -1189,6 +1189,7 @@ static int cciss_ioctl32_passthru(struct block_device *bdev, fmode_t mode, · 1188 unmodified lines
11891189 int err;
11901190 u32 cp;
11911191
1192+ memset(&arg64, 0, sizeof(arg64));
11921193 err = 0;
11931194 err |=
11941195 copy_from_user(&arg64.LUN_info, &arg32->LUN_info,
drivers/block/cpqarray.c+1−0
@@ -1193,6 +1193,7 @@ out_passthru: · 1192 unmodified lines
11931193 ida_pci_info_struct pciinfo;
11941194
11951195 if (!arg) return -EINVAL;
1196+ memset(&pciinfo, 0, sizeof(pciinfo));
11961197 pciinfo.bus = host->pci_dev->bus->number;
11971198 pciinfo.dev_fn = host->pci_dev->devfn;
11981199 pciinfo.board_id = host->board_id;
drivers/block/rbd.c+59−18
@@ -931,12 +931,14 @@ static const char *rbd_dev_v1_snap_name(struct rbd_device *rbd_dev, · 930 unmodified lines
931931 u64 snap_id)
932932 {
933933 u32 which;
934+ const char *snap_name;
934935
935936 which = rbd_dev_snap_index(rbd_dev, snap_id);
936937 if (which == BAD_SNAP_INDEX)
937− return NULL;
938+ return ERR_PTR(-ENOENT);
938939
939− return _rbd_dev_v1_snap_name(rbd_dev, which);
940+ snap_name = _rbd_dev_v1_snap_name(rbd_dev, which);
941+ return snap_name ? snap_name : ERR_PTR(-ENOMEM);
940942 }
941943
942944 static const char *rbd_snap_name(struct rbd_device *rbd_dev, u64 snap_id)
@@ -2812,7 +2814,7 @@ out_err: · 1869 unmodified lines
28122814 obj_request_done_set(obj_request);
28132815 }
28142816
2815−static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, u64 notify_id)
2817+static int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, u64 notify_id)
28162818 {
28172819 struct rbd_obj_request *obj_request;
28182820 struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
@@ -2827,16 +2829,17 @@ static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, u64 notify_id) · 8 unmodified lines
28272829 obj_request->osd_req = rbd_osd_req_create(rbd_dev, false, obj_request);
28282830 if (!obj_request->osd_req)
28292831 goto out;
2830− obj_request->callback = rbd_obj_request_put;
28312832
28322833 osd_req_op_watch_init(obj_request->osd_req, 0, CEPH_OSD_OP_NOTIFY_ACK,
28332834 notify_id, 0, 0);
28342835 rbd_osd_req_format_read(obj_request);
28352836
28362837 ret = rbd_obj_request_submit(osdc, obj_request);
2837−out:
28382838 if (ret)
2839− rbd_obj_request_put(obj_request);
2839+ goto out;
2840+ ret = rbd_obj_request_wait(obj_request);
2841+out:
2842+ rbd_obj_request_put(obj_request);
28402843
28412844 return ret;
28422845 }
@@ -2856,7 +2859,7 @@ static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data) · 13 unmodified lines
28562859 if (ret)
28572860 rbd_warn(rbd_dev, "header refresh error (%d)\n", ret);
28582861
2859− rbd_obj_notify_ack(rbd_dev, notify_id);
2862+ rbd_obj_notify_ack_sync(rbd_dev, notify_id);
28602863 }
28612864
28622865 /*
@@ -3328,6 +3331,31 @@ static void rbd_exists_validate(struct rbd_device *rbd_dev) · 465 unmodified lines
33283331 clear_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
33293332 }
33303333
3334+static void rbd_dev_update_size(struct rbd_device *rbd_dev)
3335+{
3336+ sector_t size;
3337+ bool removing;
3338+
3339+ /*
3340+ * Don't hold the lock while doing disk operations,
3341+ * or lock ordering will conflict with the bdev mutex via:
3342+ * rbd_add() -> blkdev_get() -> rbd_open()
3343+ */
3344+ spin_lock_irq(&rbd_dev->lock);
3345+ removing = test_bit(RBD_DEV_FLAG_REMOVING, &rbd_dev->flags);
3346+ spin_unlock_irq(&rbd_dev->lock);
3347+ /*
3348+ * If the device is being removed, rbd_dev->disk has
3349+ * been destroyed, so don't try to update its size
3350+ */
3351+ if (!removing) {
3352+ size = (sector_t)rbd_dev->mapping.size / SECTOR_SIZE;
3353+ dout("setting size to %llu sectors", (unsigned long long)size);
3354+ set_capacity(rbd_dev->disk, size);
3355+ revalidate_disk(rbd_dev->disk);
3356+ }
3357+}
3358+
33313359 static int rbd_dev_refresh(struct rbd_device *rbd_dev)
33323360 {
33333361 u64 mapping_size;
@@ -3347,12 +3375,7 @@ static int rbd_dev_refresh(struct rbd_device *rbd_dev) · 13 unmodified lines
33473375 up_write(&rbd_dev->header_rwsem);
33483376
33493377 if (mapping_size != rbd_dev->mapping.size) {
3350− sector_t size;
3351−
3352− size = (sector_t)rbd_dev->mapping.size / SECTOR_SIZE;
3353− dout("setting size to %llu sectors", (unsigned long long)size);
3354− set_capacity(rbd_dev->disk, size);
3355− revalidate_disk(rbd_dev->disk);
3378+ rbd_dev_update_size(rbd_dev);
33563379 }
33573380
33583381 return ret;
@@ -4061,8 +4084,13 @@ static u64 rbd_v2_snap_id_by_name(struct rbd_device *rbd_dev, const char *name) · 702 unmodified lines
40614084
40624085 snap_id = snapc->snaps[which];
40634086 snap_name = rbd_dev_v2_snap_name(rbd_dev, snap_id);
4064− if (IS_ERR(snap_name))
4065− break;
4087+ if (IS_ERR(snap_name)) {
4088+ /* ignore no-longer existing snapshots */
4089+ if (PTR_ERR(snap_name) == -ENOENT)
4090+ continue;
4091+ else
4092+ break;
4093+ }
40664094 found = !strcmp(name, snap_name);
40674095 kfree(snap_name);
40684096 }
@@ -4141,8 +4169,8 @@ static int rbd_dev_spec_update(struct rbd_device *rbd_dev) · 72 unmodified lines
41414169 /* Look up the snapshot name, and make a copy */
41424170
41434171 snap_name = rbd_snap_name(rbd_dev, spec->snap_id);
4144− if (!snap_name) {
4145− ret = -ENOMEM;
4172+ if (IS_ERR(snap_name)) {
4173+ ret = PTR_ERR(snap_name);
41464174 goto out_err;
41474175 }
41484176
@@ -5163,10 +5191,23 @@ static ssize_t rbd_remove(struct bus_type *bus, · 1014 unmodified lines
51635191 if (ret < 0 || already)
51645192 return ret;
51655193
5166− rbd_bus_del_dev(rbd_dev);
51675194 ret = rbd_dev_header_watch_sync(rbd_dev, false);
51685195 if (ret)
51695196 rbd_warn(rbd_dev, "failed to cancel watch event (%d)\n", ret);
5197+
5198+ /*
5199+ * flush remaining watch callbacks - these must be complete
5200+ * before the osd_client is shutdown
5201+ */
5202+ dout("%s: flushing notifies", __func__);
5203+ ceph_osdc_flush_notifies(&rbd_dev->rbd_client->client->osdc);
5204+ /*
5205+ * Don't free anything from rbd_dev->disk until after all
5206+ * notifies are completely processed. Otherwise
5207+ * rbd_bus_del_dev() will race with rbd_watch_cb(), resulting
5208+ * in a potential use after free of rbd_dev->disk or rbd_dev.
5209+ */
5210+ rbd_bus_del_dev(rbd_dev);
51705211 rbd_dev_image_release(rbd_dev);
51715212 module_put(THIS_MODULE);
51725213
drivers/bluetooth/ath3k.c+2−0
@@ -85,6 +85,7 @@ static struct usb_device_id ath3k_table[] = { · 84 unmodified lines
8585 { USB_DEVICE(0x04CA, 0x3008) },
8686 { USB_DEVICE(0x13d3, 0x3362) },
8787 { USB_DEVICE(0x0CF3, 0xE004) },
88+ { USB_DEVICE(0x0CF3, 0xE005) },
8889 { USB_DEVICE(0x0930, 0x0219) },
8990 { USB_DEVICE(0x0489, 0xe057) },
9091 { USB_DEVICE(0x13d3, 0x3393) },
@@ -126,6 +127,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { · 35 unmodified lines
126127 { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
127128 { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
128129 { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
130+ { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
129131 { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
130132 { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
131133 { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
drivers/bluetooth/btusb.c+5−0
@@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = { · 101 unmodified lines
102102
103103 /* Broadcom BCM20702A0 */
104104 { USB_DEVICE(0x0b05, 0x17b5) },
105+ { USB_DEVICE(0x0b05, 0x17cb) },
105106 { USB_DEVICE(0x04ca, 0x2003) },
106107 { USB_DEVICE(0x0489, 0xe042) },
107108 { USB_DEVICE(0x413c, 0x8197) },
@@ -112,6 +113,9 @@ static struct usb_device_id btusb_table[] = { · 4 unmodified lines
112113 /*Broadcom devices with vendor specific id */
113114 { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) },
114115
116+ /* Belkin F8065bf - Broadcom based */
117+ { USB_VENDOR_AND_INTERFACE_INFO(0x050d, 0xff, 0x01, 0x01) },
118+
115119 { } /* Terminating entry */
116120 };
117121
@@ -148,6 +152,7 @@ static struct usb_device_id blacklist_table[] = { · 30 unmodified lines
148152 { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
149153 { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
150154 { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
155+ { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
151156 { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
152157 { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
153158 { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
drivers/bus/mvebu-mbus.c+9−3
@@ -700,6 +700,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, · 699 unmodified lines
700700 phys_addr_t sdramwins_phys_base,
701701 size_t sdramwins_size)
702702 {
703+ struct device_node *np;
703704 int win;
704705
705706 mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
@@ -712,8 +713,11 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, · 6 unmodified lines
712713 return -ENOMEM;
713714 }
714715
715− if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"))
716+ np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
717+ if (np) {
716718 mbus->hw_io_coherency = 1;
719+ of_node_put(np);
720+ }
717721
718722 for (win = 0; win < mbus->soc->num_wins; win++)
719723 mvebu_mbus_disable_window(mbus, win);
@@ -861,11 +865,13 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np, · 141 unmodified lines
861865 int ret;
862866
863867 /*
864− * These are optional, so we clear them and they'll
865− * be zero if they are missing from the DT.
868+ * These are optional, so we make sure that resource_size(x) will
869+ * return 0.
866870 */
867871 memset(mem, 0, sizeof(struct resource));
872+ mem->end = -1;
868873 memset(io, 0, sizeof(struct resource));
874+ io->end = -1;
869875
870876 ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg));
871877 if (!ret) {
drivers/char/tpm/xen-tpmfront.c+0−36
@@ -142,32 +142,6 @@ static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count) · 141 unmodified lines
142142 return length;
143143 }
144144
145−ssize_t tpm_show_locality(struct device *dev, struct device_attribute *attr,
146− char *buf)
147−{
148− struct tpm_chip *chip = dev_get_drvdata(dev);
149− struct tpm_private *priv = TPM_VPRIV(chip);
150− u8 locality = priv->shr->locality;
151−
152− return sprintf(buf, "%d\n", locality);
153−}
154−
155−ssize_t tpm_store_locality(struct device *dev, struct device_attribute *attr,
156− const char *buf, size_t len)
157−{
158− struct tpm_chip *chip = dev_get_drvdata(dev);
159− struct tpm_private *priv = TPM_VPRIV(chip);
160− u8 val;
161−
162− int rv = kstrtou8(buf, 0, &val);
163− if (rv)
164− return rv;
165−
166− priv->shr->locality = val;
167−
168− return len;
169−}
170−
171145 static const struct file_operations vtpm_ops = {
172146 .owner = THIS_MODULE,
173147 .llseek = no_llseek,
@@ -188,8 +162,6 @@ static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); · 14 unmodified lines
188162 static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
189163 static DEVICE_ATTR(durations, S_IRUGO, tpm_show_durations, NULL);
190164 static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL);
191−static DEVICE_ATTR(locality, S_IRUGO | S_IWUSR, tpm_show_locality,
192− tpm_store_locality);
193165
194166 static struct attribute *vtpm_attrs[] = {
195167 &dev_attr_pubek.attr,
@@ -202,7 +174,6 @@ static struct attribute *vtpm_attrs[] = { · 6 unmodified lines
202174 &dev_attr_cancel.attr,
203175 &dev_attr_durations.attr,
204176 &dev_attr_timeouts.attr,
205− &dev_attr_locality.attr,
206177 NULL,
207178 };
208179
@@ -210,8 +181,6 @@ static struct attribute_group vtpm_attr_grp = { · 1 unmodified line
210181 .attrs = vtpm_attrs,
211182 };
212183
213−#define TPM_LONG_TIMEOUT (10 * 60 * HZ)
214−
215184 static const struct tpm_vendor_specific tpm_vtpm = {
216185 .status = vtpm_status,
217186 .recv = vtpm_recv,
@@ -224,11 +193,6 @@ static const struct tpm_vendor_specific tpm_vtpm = { · 6 unmodified lines
224193 .miscdev = {
225194 .fops = &vtpm_ops,
226195 },
227− .duration = {
228− TPM_LONG_TIMEOUT,
229− TPM_LONG_TIMEOUT,
230− TPM_LONG_TIMEOUT,
231− },
232196 };
233197
234198 static irqreturn_t tpmif_interrupt(int dummy, void *dev_id)
drivers/clocksource/Kconfig+1−0
@@ -26,6 +26,7 @@ config DW_APB_TIMER_OF · 25 unmodified lines
2626
2727 config ARMADA_370_XP_TIMER
2828 bool
29+ select CLKSRC_OF
2930
3031 config ORION_TIMER
3132 select CLKSRC_OF
drivers/clocksource/clksrc-of.c+3−0
@@ -30,6 +30,9 @@ void __init clocksource_of_init(void) · 29 unmodified lines
3030 clocksource_of_init_fn init_func;
3131
3232 for_each_matching_node_and_match(np, __clksrc_of_table, &match) {
33+ if (!of_device_is_available(np))
34+ continue;
35+
3336 init_func = match->data;
3437 init_func(np);
3538 }
drivers/clocksource/em_sti.c+1−1
@@ -301,7 +301,7 @@ static void em_sti_register_clockevent(struct em_sti_priv *p) · 300 unmodified lines
301301 ced->name = dev_name(&p->pdev->dev);
302302 ced->features = CLOCK_EVT_FEAT_ONESHOT;
303303 ced->rating = 200;
304− ced->cpumask = cpumask_of(0);
304+ ced->cpumask = cpu_possible_mask;
305305 ced->set_next_event = em_sti_clock_event_next;
306306 ced->set_mode = em_sti_clock_event_mode;
307307
drivers/clocksource/exynos_mct.c+9−1
@@ -428,7 +428,6 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt) · 427 unmodified lines
428428 evt->irq);
429429 return -EIO;
430430 }
431− irq_set_affinity(evt->irq, cpumask_of(cpu));
432431 } else {
433432 enable_percpu_irq(mct_irqs[MCT_L0_IRQ], 0);
434433 }
@@ -449,6 +448,7 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self, · 14 unmodified lines
449448 unsigned long action, void *hcpu)
450449 {
451450 struct mct_clock_event_device *mevt;
451+ unsigned int cpu;
452452
453453 /*
454454 * Grab cpu pointer in each case to avoid spurious
@@ -459,6 +459,12 @@ static int exynos4_mct_cpu_notify(struct notifier_block *self, · 4 unmodified lines
459459 mevt = this_cpu_ptr(&percpu_mct_tick);
460460 exynos4_local_timer_setup(&mevt->evt);
461461 break;
462+ case CPU_ONLINE:
463+ cpu = (unsigned long)hcpu;
464+ if (mct_int_type == MCT_INT_SPI)
465+ irq_set_affinity(mct_irqs[MCT_L0_IRQ + cpu],
466+ cpumask_of(cpu));
467+ break;
462468 case CPU_DYING:
463469 mevt = this_cpu_ptr(&percpu_mct_tick);
464470 exynos4_local_timer_stop(&mevt->evt);
@@ -500,6 +506,8 @@ static void __init exynos4_timer_resources(struct device_node *np, void __iomem · 35 unmodified lines
500506 &percpu_mct_tick);
501507 WARN(err, "MCT: can't request IRQ %d (%d)\n",
502508 mct_irqs[MCT_L0_IRQ], err);
509+ } else {
510+ irq_set_affinity(mct_irqs[MCT_L0_IRQ], cpumask_of(0));
503511 }
504512
505513 err = register_cpu_notifier(&exynos4_mct_cpu_nb);
drivers/cpufreq/acpi-cpufreq.c+4−0
@@ -986,6 +986,10 @@ static int __init acpi_cpufreq_init(void) · 985 unmodified lines
986986 {
987987 int ret;
988988
989+ /* don't keep reloading if cpufreq_driver exists */
990+ if (cpufreq_get_current_driver())
991+ return 0;
992+
989993 if (acpi_disabled)
990994 return 0;
991995
drivers/cpufreq/cpufreq-cpu0.c+7−2
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1313
1414 #include <linux/clk.h>
15+#include <linux/cpu.h>
1516 #include <linux/cpufreq.h>
1617 #include <linux/err.h>
1718 #include <linux/module.h>
@@ -177,7 +178,11 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) · 159 unmodified lines
177178 struct device_node *np;
178179 int ret;
179180
180− cpu_dev = &pdev->dev;
181+ cpu_dev = get_cpu_device(0);
182+ if (!cpu_dev) {
183+ pr_err("failed to get cpu0 device\n");
184+ return -ENODEV;
185+ }
181186
182187 np = of_node_get(cpu_dev->of_node);
183188 if (!np) {
@@ -224,7 +229,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) · 40 unmodified lines
224229 if (of_property_read_u32(np, "clock-latency", &transition_latency))
225230 transition_latency = CPUFREQ_ETERNAL;
226231
227− if (cpu_reg) {
232+ if (!IS_ERR(cpu_reg)) {
228233 struct opp *opp;
229234 unsigned long min_uV, max_uV;
230235 int i;
drivers/cpufreq/cpufreq.c+23−11
@@ -952,9 +952,20 @@ static void update_policy_cpu(struct cpufreq_policy *policy, unsigned int cpu) · 951 unmodified lines
952952 if (cpu == policy->cpu)
953953 return;
954954
955+ /*
956+ * Take direct locks as lock_policy_rwsem_write wouldn't work here.
957+ * Also lock for last cpu is enough here as contention will happen only
958+ * after policy->cpu is changed and after it is changed, other threads
959+ * will try to acquire lock for new cpu. And policy is already updated
960+ * by then.
961+ */
962+ down_write(&per_cpu(cpu_policy_rwsem, policy->cpu));
963+
955964 policy->last_cpu = policy->cpu;
956965 policy->cpu = cpu;
957966
967+ up_write(&per_cpu(cpu_policy_rwsem, policy->last_cpu));
968+
958969 #ifdef CONFIG_CPU_FREQ_TABLE
959970 cpufreq_frequency_table_update_policy_cpu(policy);
960971 #endif
@@ -1125,7 +1136,7 @@ static int cpufreq_nominate_new_policy_cpu(struct cpufreq_policy *policy, · 164 unmodified lines
11251136 int ret;
11261137
11271138 /* first sibling now owns the new sysfs dir */
1128− cpu_dev = get_cpu_device(cpumask_first(policy->cpus));
1139+ cpu_dev = get_cpu_device(cpumask_any_but(policy->cpus, old_cpu));
11291140
11301141 /* Don't touch sysfs files during light-weight tear-down */
11311142 if (frozen)
@@ -1189,12 +1200,9 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, · 57 unmodified lines
11891200 policy->governor->name, CPUFREQ_NAME_LEN);
11901201 #endif
11911202
1192− WARN_ON(lock_policy_rwsem_write(cpu));
1203+ lock_policy_rwsem_read(cpu);
11931204 cpus = cpumask_weight(policy->cpus);
1194−
1195− if (cpus > 1)
1196− cpumask_clear_cpu(cpu, policy->cpus);
1197− unlock_policy_rwsem_write(cpu);
1205+ unlock_policy_rwsem_read(cpu);
11981206
11991207 if (cpu != policy->cpu) {
12001208 if (!frozen)
@@ -1203,9 +1211,7 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, · 2 unmodified lines
12031211
12041212 new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu, frozen);
12051213 if (new_cpu >= 0) {
1206− WARN_ON(lock_policy_rwsem_write(cpu));
12071214 update_policy_cpu(policy, new_cpu);
1208− unlock_policy_rwsem_write(cpu);
12091215
12101216 if (!frozen) {
12111217 pr_debug("%s: policy Kobject moved to cpu: %d "
@@ -1237,9 +1243,12 @@ static int __cpufreq_remove_dev_finish(struct device *dev, · 25 unmodified lines
12371243 return -EINVAL;
12381244 }
12391245
1240− lock_policy_rwsem_read(cpu);
1246+ WARN_ON(lock_policy_rwsem_write(cpu));
12411247 cpus = cpumask_weight(policy->cpus);
1242− unlock_policy_rwsem_read(cpu);
1248+
1249+ if (cpus > 1)
1250+ cpumask_clear_cpu(cpu, policy->cpus);
1251+ unlock_policy_rwsem_write(cpu);
12431252
12441253 /* If cpu is last user of policy, free policy */
12451254 if (cpus == 1) {
@@ -1451,6 +1460,9 @@ unsigned int cpufreq_get(unsigned int cpu) · 205 unmodified lines
14511460 {
14521461 unsigned int ret_freq = 0;
14531462
1463+ if (cpufreq_disabled() || !cpufreq_driver)
1464+ return -ENOENT;
1465+
14541466 if (!down_read_trylock(&cpufreq_rwsem))
14551467 return 0;
14561468
@@ -2095,7 +2107,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) · 638 unmodified lines
20952107 write_lock_irqsave(&cpufreq_driver_lock, flags);
20962108 if (cpufreq_driver) {
20972109 write_unlock_irqrestore(&cpufreq_driver_lock, flags);
2098− return -EBUSY;
2110+ return -EEXIST;
20992111 }
21002112 cpufreq_driver = driver_data;
21012113 write_unlock_irqrestore(&cpufreq_driver_lock, flags);
drivers/cpufreq/exynos5440-cpufreq.c+1−1
@@ -457,7 +457,7 @@ err_free_table: · 456 unmodified lines
457457 opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table);
458458 err_put_node:
459459 of_node_put(np);
460− dev_err(dvfs_info->dev, "%s: failed initialization\n", __func__);
460+ dev_err(&pdev->dev, "%s: failed initialization\n", __func__);
461461 return ret;
462462 }
463463
drivers/cpufreq/imx6q-cpufreq.c+6−1
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 */
88
99 #include <linux/clk.h>
10+#include <linux/cpu.h>
1011 #include <linux/cpufreq.h>
1112 #include <linux/delay.h>
1213 #include <linux/err.h>
@@ -202,7 +203,11 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) · 189 unmodified lines
202203 unsigned long min_volt, max_volt;
203204 int num, ret;
204205
205− cpu_dev = &pdev->dev;
206+ cpu_dev = get_cpu_device(0);
207+ if (!cpu_dev) {
208+ pr_err("failed to get cpu0 device\n");
209+ return -ENODEV;
210+ }
206211
207212 np = of_node_get(cpu_dev->of_node);
208213 if (!np) {
drivers/cpufreq/intel_pstate.c+4−1
@@ -394,7 +394,10 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) · 393 unmodified lines
394394 trace_cpu_frequency(pstate * 100000, cpu->cpu);
395395
396396 cpu->pstate.current_pstate = pstate;
397− wrmsrl(MSR_IA32_PERF_CTL, pstate << 8);
397+ if (limits.no_turbo)
398+ wrmsrl(MSR_IA32_PERF_CTL, BIT(32) | (pstate << 8));
399+ else
400+ wrmsrl(MSR_IA32_PERF_CTL, pstate << 8);
398401
399402 }
400403
drivers/cpufreq/spear-cpufreq.c+1−1
@@ -113,7 +113,7 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy, · 112 unmodified lines
113113 unsigned int target_freq, unsigned int relation)
114114 {
115115 struct cpufreq_freqs freqs;
116− unsigned long newfreq;
116+ long newfreq;
117117 struct clk *srcclk;
118118 int index, ret, mult = 1;
119119
drivers/dma/Kconfig+1−0
@@ -198,6 +198,7 @@ config TI_EDMA · 197 unmodified lines
198198 depends on ARCH_DAVINCI || ARCH_OMAP
199199 select DMA_ENGINE
200200 select DMA_VIRTUAL_CHANNELS
201+ select TI_PRIV_EDMA
201202 default n
202203 help
203204 Enable support for the TI EDMA controller. This DMA
drivers/dma/edma.c+1−1
@@ -749,6 +749,6 @@ static void __exit edma_exit(void) · 748 unmodified lines
749749 }
750750 module_exit(edma_exit);
751751
752−MODULE_AUTHOR("Matt Porter <mporter@ti.com>");
752+MODULE_AUTHOR("Matt Porter <matt.porter@linaro.org>");
753753 MODULE_DESCRIPTION("TI EDMA DMA engine driver");
754754 MODULE_LICENSE("GPL v2");
drivers/dma/imx-dma.c+15−16
@@ -437,17 +437,18 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac) · 436 unmodified lines
437437 struct imxdma_engine *imxdma = imxdmac->imxdma;
438438 int chno = imxdmac->channel;
439439 struct imxdma_desc *desc;
440+ unsigned long flags;
440441
441− spin_lock(&imxdma->lock);
442+ spin_lock_irqsave(&imxdma->lock, flags);
442443 if (list_empty(&imxdmac->ld_active)) {
443− spin_unlock(&imxdma->lock);
444+ spin_unlock_irqrestore(&imxdma->lock, flags);
444445 goto out;
445446 }
446447
447448 desc = list_first_entry(&imxdmac->ld_active,
448449 struct imxdma_desc,
449450 node);
450− spin_unlock(&imxdma->lock);
451+ spin_unlock_irqrestore(&imxdma->lock, flags);
451452
452453 if (desc->sg) {
453454 u32 tmp;
@@ -519,7 +520,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 65 unmodified lines
519520 {
520521 struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan);
521522 struct imxdma_engine *imxdma = imxdmac->imxdma;
522− unsigned long flags;
523523 int slot = -1;
524524 int i;
525525
@@ -527,7 +527,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 1 unmodified line
527527 switch (d->type) {
528528 case IMXDMA_DESC_INTERLEAVED:
529529 /* Try to get a free 2D slot */
530− spin_lock_irqsave(&imxdma->lock, flags);
531530 for (i = 0; i < IMX_DMA_2D_SLOTS; i++) {
532531 if ((imxdma->slots_2d[i].count > 0) &&
533532 ((imxdma->slots_2d[i].xsr != d->x) ||
@@ -537,10 +536,8 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 3 unmodified lines
537536 slot = i;
538537 break;
539538 }
540− if (slot < 0) {
541− spin_unlock_irqrestore(&imxdma->lock, flags);
539+ if (slot < 0)
542540 return -EBUSY;
543− }
544541
545542 imxdma->slots_2d[slot].xsr = d->x;
546543 imxdma->slots_2d[slot].ysr = d->y;
@@ -549,7 +546,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 2 unmodified lines
549546
550547 imxdmac->slot_2d = slot;
551548 imxdmac->enabled_2d = true;
552− spin_unlock_irqrestore(&imxdma->lock, flags);
553549
554550 if (slot == IMX_DMA_2D_SLOT_A) {
555551 d->config_mem &= ~CCR_MSEL_B;
@@ -625,18 +621,17 @@ static void imxdma_tasklet(unsigned long data) · 69 unmodified lines
625621 struct imxdma_channel *imxdmac = (void *)data;
626622 struct imxdma_engine *imxdma = imxdmac->imxdma;
627623 struct imxdma_desc *desc;
624+ unsigned long flags;
628625
629− spin_lock(&imxdma->lock);
626+ spin_lock_irqsave(&imxdma->lock, flags);
630627
631628 if (list_empty(&imxdmac->ld_active)) {
632629 /* Someone might have called terminate all */
633− goto out;
630+ spin_unlock_irqrestore(&imxdma->lock, flags);
631+ return;
634632 }
635633 desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node);
636634
637− if (desc->desc.callback)
638− desc->desc.callback(desc->desc.callback_param);
639−
640635 /* If we are dealing with a cyclic descriptor, keep it on ld_active
641636 * and dont mark the descriptor as complete.
642637 * Only in non-cyclic cases it would be marked as complete
@@ -663,7 +658,11 @@ static void imxdma_tasklet(unsigned long data) · 20 unmodified lines
663658 __func__, imxdmac->channel);
664659 }
665660 out:
666− spin_unlock(&imxdma->lock);
661+ spin_unlock_irqrestore(&imxdma->lock, flags);
662+
663+ if (desc->desc.callback)
664+ desc->desc.callback(desc->desc.callback_param);
665+
667666 }
668667
669668 static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
@@ -883,7 +882,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic( · 213 unmodified lines
883882 kfree(imxdmac->sg_list);
884883
885884 imxdmac->sg_list = kcalloc(periods + 1,
886− sizeof(struct scatterlist), GFP_KERNEL);
885+ sizeof(struct scatterlist), GFP_ATOMIC);
887886 if (!imxdmac->sg_list)
888887 return NULL;
889888
drivers/gpio/gpio-omap.c+101−57
@@ -63,6 +63,7 @@ struct gpio_bank { · 62 unmodified lines
6363 struct gpio_chip chip;
6464 struct clk *dbck;
6565 u32 mod_usage;
66+ u32 irq_usage;
6667 u32 dbck_enable_mask;
6768 bool dbck_enabled;
6869 struct device *dev;
@@ -86,6 +87,9 @@ struct gpio_bank { · 17 unmodified lines
8687 #define GPIO_BIT(bank, gpio) (1 << GPIO_INDEX(bank, gpio))
8788 #define GPIO_MOD_CTRL_BIT BIT(0)
8889
90+#define BANK_USED(bank) (bank->mod_usage || bank->irq_usage)
91+#define LINE_USED(line, offset) (line & (1 << offset))
92+
8993 static int irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq)
9094 {
9195 return bank->chip.base + gpio_irq;
@@ -420,15 +424,69 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, · 328 unmodified lines
420424 return 0;
421425 }
422426
427+static void _enable_gpio_module(struct gpio_bank *bank, unsigned offset)
428+{
429+ if (bank->regs->pinctrl) {
430+ void __iomem *reg = bank->base + bank->regs->pinctrl;
431+
432+ /* Claim the pin for MPU */
433+ __raw_writel(__raw_readl(reg) | (1 << offset), reg);
434+ }
435+
436+ if (bank->regs->ctrl && !BANK_USED(bank)) {
437+ void __iomem *reg = bank->base + bank->regs->ctrl;
438+ u32 ctrl;
439+
440+ ctrl = __raw_readl(reg);
441+ /* Module is enabled, clocks are not gated */
442+ ctrl &= ~GPIO_MOD_CTRL_BIT;
443+ __raw_writel(ctrl, reg);
444+ bank->context.ctrl = ctrl;
445+ }
446+}
447+
448+static void _disable_gpio_module(struct gpio_bank *bank, unsigned offset)
449+{
450+ void __iomem *base = bank->base;
451+
452+ if (bank->regs->wkup_en &&
453+ !LINE_USED(bank->mod_usage, offset) &&
454+ !LINE_USED(bank->irq_usage, offset)) {
455+ /* Disable wake-up during idle for dynamic tick */
456+ _gpio_rmw(base, bank->regs->wkup_en, 1 << offset, 0);
457+ bank->context.wake_en =
458+ __raw_readl(bank->base + bank->regs->wkup_en);
459+ }
460+
461+ if (bank->regs->ctrl && !BANK_USED(bank)) {
462+ void __iomem *reg = bank->base + bank->regs->ctrl;
463+ u32 ctrl;
464+
465+ ctrl = __raw_readl(reg);
466+ /* Module is disabled, clocks are gated */
467+ ctrl |= GPIO_MOD_CTRL_BIT;
468+ __raw_writel(ctrl, reg);
469+ bank->context.ctrl = ctrl;
470+ }
471+}
472+
473+static int gpio_is_input(struct gpio_bank *bank, int mask)
474+{
475+ void __iomem *reg = bank->base + bank->regs->direction;
476+
477+ return __raw_readl(reg) & mask;
478+}
479+
423480 static int gpio_irq_type(struct irq_data *d, unsigned type)
424481 {
425482 struct gpio_bank *bank = irq_data_get_irq_chip_data(d);
426483 unsigned gpio = 0;
427484 int retval;
428485 unsigned long flags;
486+ unsigned offset;
429487
430− if (WARN_ON(!bank->mod_usage))
431− return -EINVAL;
488+ if (!BANK_USED(bank))
489+ pm_runtime_get_sync(bank->dev);
432490
433491 #ifdef CONFIG_ARCH_OMAP1
434492 if (d->irq > IH_MPUIO_BASE)
@@ -446,7 +504,17 @@ static int gpio_irq_type(struct irq_data *d, unsigned type) · 11 unmodified lines
446504 return -EINVAL;
447505
448506 spin_lock_irqsave(&bank->lock, flags);
449− retval = _set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), type);
507+ offset = GPIO_INDEX(bank, gpio);
508+ retval = _set_gpio_triggering(bank, offset, type);
509+ if (!LINE_USED(bank->mod_usage, offset)) {
510+ _enable_gpio_module(bank, offset);
511+ _set_gpio_direction(bank, offset, 1);
512+ } else if (!gpio_is_input(bank, 1 << offset)) {
513+ spin_unlock_irqrestore(&bank->lock, flags);
514+ return -EINVAL;
515+ }
516+
517+ bank->irq_usage |= 1 << GPIO_INDEX(bank, gpio);
450518 spin_unlock_irqrestore(&bank->lock, flags);
451519
452520 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
@@ -603,35 +671,19 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) · 150 unmodified lines
603671 * If this is the first gpio_request for the bank,
604672 * enable the bank module.
605673 */
606− if (!bank->mod_usage)
674+ if (!BANK_USED(bank))
607675 pm_runtime_get_sync(bank->dev);
608676
609677 spin_lock_irqsave(&bank->lock, flags);
610678 /* Set trigger to none. You need to enable the desired trigger with
611− * request_irq() or set_irq_type().
679+ * request_irq() or set_irq_type(). Only do this if the IRQ line has
680+ * not already been requested.
612681 */
613− _set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
614−
615− if (bank->regs->pinctrl) {
616− void __iomem *reg = bank->base + bank->regs->pinctrl;
617−
618− /* Claim the pin for MPU */
619− __raw_writel(__raw_readl(reg) | (1 << offset), reg);
620− }
621−
622− if (bank->regs->ctrl && !bank->mod_usage) {
623− void __iomem *reg = bank->base + bank->regs->ctrl;
624− u32 ctrl;
625−
626− ctrl = __raw_readl(reg);
627− /* Module is enabled, clocks are not gated */
628− ctrl &= ~GPIO_MOD_CTRL_BIT;
629− __raw_writel(ctrl, reg);
630− bank->context.ctrl = ctrl;
682+ if (!LINE_USED(bank->irq_usage, offset)) {
683+ _set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
684+ _enable_gpio_module(bank, offset);
631685 }
632−
633686 bank->mod_usage |= 1 << offset;
634−
635687 spin_unlock_irqrestore(&bank->lock, flags);
636688
637689 return 0;
@@ -640,31 +692,11 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) · 2 unmodified lines
640692 static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
641693 {
642694 struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip);
643− void __iomem *base = bank->base;
644695 unsigned long flags;
645696
646697 spin_lock_irqsave(&bank->lock, flags);
647−
648− if (bank->regs->wkup_en) {
649− /* Disable wake-up during idle for dynamic tick */
650− _gpio_rmw(base, bank->regs->wkup_en, 1 << offset, 0);
651− bank->context.wake_en =
652− __raw_readl(bank->base + bank->regs->wkup_en);
653− }
654−
655698 bank->mod_usage &= ~(1 << offset);
656−
657− if (bank->regs->ctrl && !bank->mod_usage) {
658− void __iomem *reg = bank->base + bank->regs->ctrl;
659− u32 ctrl;
660−
661− ctrl = __raw_readl(reg);
662− /* Module is disabled, clocks are gated */
663− ctrl |= GPIO_MOD_CTRL_BIT;
664− __raw_writel(ctrl, reg);
665− bank->context.ctrl = ctrl;
666− }
667−
699+ _disable_gpio_module(bank, offset);
668700 _reset_gpio(bank, bank->chip.base + offset);
669701 spin_unlock_irqrestore(&bank->lock, flags);
670702
@@ -672,7 +704,7 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset) · 1 unmodified line
672704 * If this is the last gpio to be freed in the bank,
673705 * disable the bank module.
674706 */
675− if (!bank->mod_usage)
707+ if (!BANK_USED(bank))
676708 pm_runtime_put(bank->dev);
677709 }
678710
@@ -762,10 +794,20 @@ static void gpio_irq_shutdown(struct irq_data *d) · 83 unmodified lines
762794 struct gpio_bank *bank = irq_data_get_irq_chip_data(d);
763795 unsigned int gpio = irq_to_gpio(bank, d->hwirq);
764796 unsigned long flags;
797+ unsigned offset = GPIO_INDEX(bank, gpio);
765798
766799 spin_lock_irqsave(&bank->lock, flags);
800+ bank->irq_usage &= ~(1 << offset);
801+ _disable_gpio_module(bank, offset);
767802 _reset_gpio(bank, gpio);
768803 spin_unlock_irqrestore(&bank->lock, flags);
804+
805+ /*
806+ * If this is the last IRQ to be freed in the bank,
807+ * disable the bank module.
808+ */
809+ if (!BANK_USED(bank))
810+ pm_runtime_put(bank->dev);
769811 }
770812
771813 static void gpio_ack_irq(struct irq_data *d)
@@ -897,13 +939,6 @@ static int gpio_input(struct gpio_chip *chip, unsigned offset) · 125 unmodified lines
897939 return 0;
898940 }
899941
900−static int gpio_is_input(struct gpio_bank *bank, int mask)
901−{
902− void __iomem *reg = bank->base + bank->regs->direction;
903−
904− return __raw_readl(reg) & mask;
905−}
906−
907942 static int gpio_get(struct gpio_chip *chip, unsigned offset)
908943 {
909944 struct gpio_bank *bank;
@@ -922,13 +957,22 @@ static int gpio_output(struct gpio_chip *chip, unsigned offset, int value) · 12 unmodified lines
922957 {
923958 struct gpio_bank *bank;
924959 unsigned long flags;
960+ int retval = 0;
925961
926962 bank = container_of(chip, struct gpio_bank, chip);
927963 spin_lock_irqsave(&bank->lock, flags);
964+
965+ if (LINE_USED(bank->irq_usage, offset)) {
966+ retval = -EINVAL;
967+ goto exit;
968+ }
969+
928970 bank->set_dataout(bank, offset, value);
929971 _set_gpio_direction(bank, offset, 0);
972+
973+exit:
930974 spin_unlock_irqrestore(&bank->lock, flags);
931− return 0;
975+ return retval;
932976 }
933977
934978 static int gpio_debounce(struct gpio_chip *chip, unsigned offset,
@@ -1400,7 +1444,7 @@ void omap2_gpio_prepare_for_idle(int pwr_mode) · 465 unmodified lines
14001444 struct gpio_bank *bank;
14011445
14021446 list_for_each_entry(bank, &omap_gpio_list, node) {
1403− if (!bank->mod_usage || !bank->loses_context)
1447+ if (!BANK_USED(bank) || !bank->loses_context)
14041448 continue;
14051449
14061450 bank->power_mode = pwr_mode;
@@ -1414,7 +1458,7 @@ void omap2_gpio_resume_after_idle(void) · 7 unmodified lines
14141458 struct gpio_bank *bank;
14151459
14161460 list_for_each_entry(bank, &omap_gpio_list, node) {
1417− if (!bank->mod_usage || !bank->loses_context)
1461+ if (!BANK_USED(bank) || !bank->loses_context)
14181462 continue;
14191463
14201464 pm_runtime_get_sync(bank->dev);
drivers/gpio/gpio-rcar.c+3−4
@@ -293,10 +293,9 @@ static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) · 292 unmodified lines
293293 if (pdata) {
294294 p->config = *pdata;
295295 } else if (IS_ENABLED(CONFIG_OF) && np) {
296− ret = of_parse_phandle_with_args(np, "gpio-ranges",
297− "#gpio-range-cells", 0, &args);
298− p->config.number_of_pins = ret == 0 && args.args_count == 3
299− ? args.args[2]
296+ ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0,
297+ &args);
298+ p->config.number_of_pins = ret == 0 ? args.args[2]
300299 : RCAR_MAX_GPIO_PER_BANK;
301300 p->config.gpio_base = -1;
302301 }
drivers/gpu/drm/ast/ast_drv.h+1−1
@@ -177,7 +177,7 @@ uint8_t ast_get_index_reg_mask(struct ast_private *ast, · 176 unmodified lines
177177
178178 static inline void ast_open_key(struct ast_private *ast)
179179 {
180− ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xA1, 0xFF, 0x04);
180+ ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x80, 0xA8);
181181 }
182182
183183 #define AST_VIDMEM_SIZE_8M 0x00800000
drivers/gpu/drm/drm_context.c+8−65
@@ -42,6 +42,10 @@ · 41 unmodified lines
4242
4343 #include <drm/drmP.h>
4444
45+/******************************************************************/
46+/** \name Context bitmap support */
47+/*@{*/
48+
4549 /**
4650 * Free a handle from the context bitmap.
4751 *
@@ -52,48 +56,13 @@ · 4 unmodified lines
5256 * in drm_device::ctx_idr, while holding the drm_device::struct_mutex
5357 * lock.
5458 */
55−static void drm_ctxbitmap_free(struct drm_device * dev, int ctx_handle)
59+void drm_ctxbitmap_free(struct drm_device * dev, int ctx_handle)
5660 {
57− if (drm_core_check_feature(dev, DRIVER_MODESET))
58− return;
59−
6061 mutex_lock(&dev->struct_mutex);
6162 idr_remove(&dev->ctx_idr, ctx_handle);
6263 mutex_unlock(&dev->struct_mutex);
6364 }
6465
65−/******************************************************************/
66−/** \name Context bitmap support */
67−/*@{*/
68−
69−void drm_legacy_ctxbitmap_release(struct drm_device *dev,
70− struct drm_file *file_priv)
71−{
72− if (drm_core_check_feature(dev, DRIVER_MODESET))
73− return;
74−
75− mutex_lock(&dev->ctxlist_mutex);
76− if (!list_empty(&dev->ctxlist)) {
77− struct drm_ctx_list *pos, *n;
78−
79− list_for_each_entry_safe(pos, n, &dev->ctxlist, head) {
80− if (pos->tag == file_priv &&
81− pos->handle != DRM_KERNEL_CONTEXT) {
82− if (dev->driver->context_dtor)
83− dev->driver->context_dtor(dev,
84− pos->handle);
85−
86− drm_ctxbitmap_free(dev, pos->handle);
87−
88− list_del(&pos->head);
89− kfree(pos);
90− --dev->ctx_count;
91− }
92− }
93− }
94− mutex_unlock(&dev->ctxlist_mutex);
95−}
96−
9766 /**
9867 * Context bitmap allocation.
9968 *
@@ -121,12 +90,10 @@ static int drm_ctxbitmap_next(struct drm_device * dev) · 21 unmodified lines
12190 *
12291 * Initialise the drm_device::ctx_idr
12392 */
124−void drm_legacy_ctxbitmap_init(struct drm_device * dev)
93+int drm_ctxbitmap_init(struct drm_device * dev)
12594 {
126− if (drm_core_check_feature(dev, DRIVER_MODESET))
127− return;
128−
12995 idr_init(&dev->ctx_idr);
96+ return 0;
13097 }
13198
13299 /**
@@ -137,7 +104,7 @@ void drm_legacy_ctxbitmap_init(struct drm_device * dev) · 4 unmodified lines
137104 * Free all idr members using drm_ctx_sarea_free helper function
138105 * while holding the drm_device::struct_mutex lock.
139106 */
140−void drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
107+void drm_ctxbitmap_cleanup(struct drm_device * dev)
141108 {
142109 mutex_lock(&dev->struct_mutex);
143110 idr_destroy(&dev->ctx_idr);
@@ -169,9 +136,6 @@ int drm_getsareactx(struct drm_device *dev, void *data, · 25 unmodified lines
169136 struct drm_local_map *map;
170137 struct drm_map_list *_entry;
171138
172− if (drm_core_check_feature(dev, DRIVER_MODESET))
173− return -EINVAL;
174−
175139 mutex_lock(&dev->struct_mutex);
176140
177141 map = idr_find(&dev->ctx_idr, request->ctx_id);
@@ -216,9 +180,6 @@ int drm_setsareactx(struct drm_device *dev, void *data, · 38 unmodified lines
216180 struct drm_local_map *map = NULL;
217181 struct drm_map_list *r_list = NULL;
218182
219− if (drm_core_check_feature(dev, DRIVER_MODESET))
220− return -EINVAL;
221−
222183 mutex_lock(&dev->struct_mutex);
223184 list_for_each_entry(r_list, &dev->maplist, head) {
224185 if (r_list->map
@@ -319,9 +280,6 @@ int drm_resctx(struct drm_device *dev, void *data, · 94 unmodified lines
319280 struct drm_ctx ctx;
320281 int i;
321282
322− if (drm_core_check_feature(dev, DRIVER_MODESET))
323− return -EINVAL;
324−
325283 if (res->count >= DRM_RESERVED_CONTEXTS) {
326284 memset(&ctx, 0, sizeof(ctx));
327285 for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) {
@@ -352,9 +310,6 @@ int drm_addctx(struct drm_device *dev, void *data, · 24 unmodified lines
352310 struct drm_ctx_list *ctx_entry;
353311 struct drm_ctx *ctx = data;
354312
355− if (drm_core_check_feature(dev, DRIVER_MODESET))
356− return -EINVAL;
357−
358313 ctx->handle = drm_ctxbitmap_next(dev);
359314 if (ctx->handle == DRM_KERNEL_CONTEXT) {
360315 /* Skip kernel's context and get a new one. */
@@ -398,9 +353,6 @@ int drm_getctx(struct drm_device *dev, void *data, struct drm_file *file_priv) · 37 unmodified lines
398353 {
399354 struct drm_ctx *ctx = data;
400355
401− if (drm_core_check_feature(dev, DRIVER_MODESET))
402− return -EINVAL;
403−
404356 /* This is 0, because we don't handle any context flags */
405357 ctx->flags = 0;
406358
@@ -423,9 +375,6 @@ int drm_switchctx(struct drm_device *dev, void *data, · 16 unmodified lines
423375 {
424376 struct drm_ctx *ctx = data;
425377
426− if (drm_core_check_feature(dev, DRIVER_MODESET))
427− return -EINVAL;
428−
429378 DRM_DEBUG("%d\n", ctx->handle);
430379 return drm_context_switch(dev, dev->last_context, ctx->handle);
431380 }
@@ -446,9 +395,6 @@ int drm_newctx(struct drm_device *dev, void *data, · 14 unmodified lines
446395 {
447396 struct drm_ctx *ctx = data;
448397
449− if (drm_core_check_feature(dev, DRIVER_MODESET))
450− return -EINVAL;
451−
452398 DRM_DEBUG("%d\n", ctx->handle);
453399 drm_context_switch_complete(dev, file_priv, ctx->handle);
454400
@@ -471,9 +417,6 @@ int drm_rmctx(struct drm_device *dev, void *data, · 16 unmodified lines
471417 {
472418 struct drm_ctx *ctx = data;
473419
474− if (drm_core_check_feature(dev, DRIVER_MODESET))
475− return -EINVAL;
476−
477420 DRM_DEBUG("%d\n", ctx->handle);
478421 if (ctx->handle != DRM_KERNEL_CONTEXT) {
479422 if (dev->driver->context_dtor)
drivers/gpu/drm/drm_fb_helper.c+8−0
@@ -407,6 +407,14 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) · 406 unmodified lines
407407 struct drm_connector *connector;
408408 int i, j;
409409
410+ /*
411+ * fbdev->blank can be called from irq context in case of a panic.
412+ * Since we already have our own special panic handler which will
413+ * restore the fbdev console mode completely, just bail out early.
414+ */
415+ if (oops_in_progress)
416+ return;
417+
410418 /*
411419 * fbdev->blank can be called from irq context in case of a panic.
412420 * Since we already have our own special panic handler which will
drivers/gpu/drm/drm_fops.c+20−1
@@ -439,7 +439,26 @@ int drm_release(struct inode *inode, struct file *filp) · 438 unmodified lines
439439 if (dev->driver->driver_features & DRIVER_GEM)
440440 drm_gem_release(dev, file_priv);
441441
442− drm_legacy_ctxbitmap_release(dev, file_priv);
442+ mutex_lock(&dev->ctxlist_mutex);
443+ if (!list_empty(&dev->ctxlist)) {
444+ struct drm_ctx_list *pos, *n;
445+
446+ list_for_each_entry_safe(pos, n, &dev->ctxlist, head) {
447+ if (pos->tag == file_priv &&
448+ pos->handle != DRM_KERNEL_CONTEXT) {
449+ if (dev->driver->context_dtor)
450+ dev->driver->context_dtor(dev,
451+ pos->handle);
452+
453+ drm_ctxbitmap_free(dev, pos->handle);
454+
455+ list_del(&pos->head);
456+ kfree(pos);
457+ --dev->ctx_count;
458+ }
459+ }
460+ }
461+ mutex_unlock(&dev->ctxlist_mutex);
443462
444463 mutex_lock(&dev->struct_mutex);
445464
drivers/gpu/drm/drm_stub.c+8−2
@@ -292,7 +292,13 @@ int drm_fill_in_dev(struct drm_device *dev, · 291 unmodified lines
292292 goto error_out_unreg;
293293 }
294294
295− drm_legacy_ctxbitmap_init(dev);
295+
296+
297+ retcode = drm_ctxbitmap_init(dev);
298+ if (retcode) {
299+ DRM_ERROR("Cannot allocate memory for context bitmap.\n");
300+ goto error_out_unreg;
301+ }
296302
297303 if (driver->driver_features & DRIVER_GEM) {
298304 retcode = drm_gem_init(dev);
@@ -446,7 +452,7 @@ void drm_put_dev(struct drm_device *dev) · 147 unmodified lines
446452 drm_rmmap(dev, r_list->map);
447453 drm_ht_remove(&dev->map_hash);
448454
449− drm_legacy_ctxbitmap_cleanup(dev);
455+ drm_ctxbitmap_cleanup(dev);
450456
451457 if (drm_core_check_feature(dev, DRIVER_MODESET))
452458 drm_put_minor(&dev->control);
drivers/gpu/drm/exynos/Kconfig+1−1
@@ -56,7 +56,7 @@ config DRM_EXYNOS_IPP · 55 unmodified lines
5656
5757 config DRM_EXYNOS_FIMC
5858 bool "Exynos DRM FIMC"
59− depends on DRM_EXYNOS_IPP && MFD_SYSCON && OF
59+ depends on DRM_EXYNOS_IPP && MFD_SYSCON
6060 help
6161 Choose this option if you want to use Exynos FIMC for DRM.
6262
drivers/gpu/drm/exynos/exynos_drm_buf.c+4−3
@@ -63,7 +63,8 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, · 62 unmodified lines
6363 return -ENOMEM;
6464 }
6565
66− buf->kvaddr = dma_alloc_attrs(dev->dev, buf->size,
66+ buf->kvaddr = (void __iomem *)dma_alloc_attrs(dev->dev,
67+ buf->size,
6768 &buf->dma_addr, GFP_KERNEL,
6869 &buf->dma_attrs);
6970 if (!buf->kvaddr) {
@@ -90,9 +91,9 @@ static int lowlevel_buffer_allocate(struct drm_device *dev, · 20 unmodified lines
9091 }
9192
9293 buf->sgt = drm_prime_pages_to_sg(buf->pages, nr_pages);
93− if (!buf->sgt) {
94+ if (IS_ERR(buf->sgt)) {
9495 DRM_ERROR("failed to get sg table.\n");
95− ret = -ENOMEM;
96+ ret = PTR_ERR(buf->sgt);
9697 goto err_free_attrs;
9798 }
9899
drivers/gpu/drm/exynos/exynos_drm_fbdev.c+3−2
@@ -99,12 +99,13 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper, · 98 unmodified lines
9999 if (is_drm_iommu_supported(dev)) {
100100 unsigned int nr_pages = buffer->size >> PAGE_SHIFT;
101101
102− buffer->kvaddr = vmap(buffer->pages, nr_pages, VM_MAP,
102+ buffer->kvaddr = (void __iomem *) vmap(buffer->pages,
103+ nr_pages, VM_MAP,
103104 pgprot_writecombine(PAGE_KERNEL));
104105 } else {
105106 phys_addr_t dma_addr = buffer->dma_addr;
106107 if (dma_addr)
107− buffer->kvaddr = phys_to_virt(dma_addr);
108+ buffer->kvaddr = (void __iomem *)phys_to_virt(dma_addr);
108109 else
109110 buffer->kvaddr = (void __iomem *)NULL;
110111 }
drivers/gpu/drm/i2c/tda998x_drv.c+1−2
@@ -707,8 +707,7 @@ tda998x_encoder_dpms(struct drm_encoder *encoder, int mode) · 706 unmodified lines
707707 reg_write(encoder, REG_VIP_CNTRL_2, priv->vip_cntrl_2);
708708 break;
709709 case DRM_MODE_DPMS_OFF:
710− /* disable audio and video ports */
711− reg_write(encoder, REG_ENA_AP, 0x00);
710+ /* disable video ports */
712711 reg_write(encoder, REG_ENA_VP_0, 0x00);
713712 reg_write(encoder, REG_ENA_VP_1, 0x00);
714713 reg_write(encoder, REG_ENA_VP_2, 0x00);
drivers/gpu/drm/i915/i915_gem.c+8−11
@@ -1392,14 +1392,11 @@ out: · 1391 unmodified lines
13921392 if (i915_terminally_wedged(&dev_priv->gpu_error))
13931393 return VM_FAULT_SIGBUS;
13941394 case -EAGAIN:
1395− /* Give the error handler a chance to run and move the
1396− * objects off the GPU active list. Next time we service the
1397− * fault, we should be able to transition the page into the
1398− * GTT without touching the GPU (and so avoid further
1399− * EIO/EGAIN). If the GPU is wedged, then there is no issue
1400− * with coherency, just lost writes.
1395+ /*
1396+ * EAGAIN means the gpu is hung and we'll wait for the error
1397+ * handler to reset everything when re-faulting in
1398+ * i915_mutex_lock_interruptible.
14011399 */
1402− set_need_resched();
14031400 case 0:
14041401 case -ERESTARTSYS:
14051402 case -EINTR:
@@ -4803,10 +4800,10 @@ i915_gem_inactive_count(struct shrinker *shrinker, struct shrink_control *sc) · 3397 unmodified lines
48034800
48044801 if (!mutex_trylock(&dev->struct_mutex)) {
48054802 if (!mutex_is_locked_by(&dev->struct_mutex, current))
4806− return SHRINK_STOP;
4803+ return 0;
48074804
48084805 if (dev_priv->mm.shrinker_no_lock_stealing)
4809− return SHRINK_STOP;
4806+ return 0;
48104807
48114808 unlock = false;
48124809 }
@@ -4904,10 +4901,10 @@ i915_gem_inactive_scan(struct shrinker *shrinker, struct shrink_control *sc) · 91 unmodified lines
49044901
49054902 if (!mutex_trylock(&dev->struct_mutex)) {
49064903 if (!mutex_is_locked_by(&dev->struct_mutex, current))
4907− return 0;
4904+ return SHRINK_STOP;
49084905
49094906 if (dev_priv->mm.shrinker_no_lock_stealing)
4910− return 0;
4907+ return SHRINK_STOP;
49114908
49124909 unlock = false;
49134910 }
drivers/gpu/drm/i915/i915_gpu_error.c+4−2
@@ -143,8 +143,10 @@ static void i915_error_vprintf(struct drm_i915_error_state_buf *e, · 142 unmodified lines
143143
144144 /* Seek the first printf which is hits start position */
145145 if (e->pos < e->start) {
146− len = vsnprintf(NULL, 0, f, args);
147− if (!__i915_error_seek(e, len))
146+ va_list tmp;
147+
148+ va_copy(tmp, args);
149+ if (!__i915_error_seek(e, vsnprintf(NULL, 0, f, tmp)))
148150 return;
149151 }
150152
drivers/gpu/drm/i915/i915_irq.c+54−14
@@ -1469,6 +1469,34 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg) · 1468 unmodified lines
14691469 return ret;
14701470 }
14711471
1472+static void i915_error_wake_up(struct drm_i915_private *dev_priv,
1473+ bool reset_completed)
1474+{
1475+ struct intel_ring_buffer *ring;
1476+ int i;
1477+
1478+ /*
1479+ * Notify all waiters for GPU completion events that reset state has
1480+ * been changed, and that they need to restart their wait after
1481+ * checking for potential errors (and bail out to drop locks if there is
1482+ * a gpu reset pending so that i915_error_work_func can acquire them).
1483+ */
1484+
1485+ /* Wake up __wait_seqno, potentially holding dev->struct_mutex. */
1486+ for_each_ring(ring, dev_priv, i)
1487+ wake_up_all(&ring->irq_queue);
1488+
1489+ /* Wake up intel_crtc_wait_for_pending_flips, holding crtc->mutex. */
1490+ wake_up_all(&dev_priv->pending_flip_queue);
1491+
1492+ /*
1493+ * Signal tasks blocked in i915_gem_wait_for_error that the pending
1494+ * reset state is cleared.
1495+ */
1496+ if (reset_completed)
1497+ wake_up_all(&dev_priv->gpu_error.reset_queue);
1498+}
1499+
14721500 /**
14731501 * i915_error_work_func - do process context error handling work
14741502 * @work: work struct
@@ -1483,11 +1511,10 @@ static void i915_error_work_func(struct work_struct *work) · 8 unmodified lines
14831511 drm_i915_private_t *dev_priv = container_of(error, drm_i915_private_t,
14841512 gpu_error);
14851513 struct drm_device *dev = dev_priv->dev;
1486− struct intel_ring_buffer *ring;
14871514 char *error_event[] = { I915_ERROR_UEVENT "=1", NULL };
14881515 char *reset_event[] = { I915_RESET_UEVENT "=1", NULL };
14891516 char *reset_done_event[] = { I915_ERROR_UEVENT "=0", NULL };
1490− int i, ret;
1517+ int ret;
14911518
14921519 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE, error_event);
14931520
@@ -1506,8 +1533,16 @@ static void i915_error_work_func(struct work_struct *work) · 12 unmodified lines
15061533 kobject_uevent_env(&dev->primary->kdev.kobj, KOBJ_CHANGE,
15071534 reset_event);
15081535
1536+ /*
1537+ * All state reset _must_ be completed before we update the
1538+ * reset counter, for otherwise waiters might miss the reset
1539+ * pending state and not properly drop locks, resulting in
1540+ * deadlocks with the reset work.
1541+ */
15091542 ret = i915_reset(dev);
15101543
1544+ intel_display_handle_reset(dev);
1545+
15111546 if (ret == 0) {
15121547 /*
15131548 * After all the gem state is reset, increment the reset
@@ -1528,12 +1563,11 @@ static void i915_error_work_func(struct work_struct *work) · 14 unmodified lines
15281563 atomic_set(&error->reset_counter, I915_WEDGED);
15291564 }
15301565
1531− for_each_ring(ring, dev_priv, i)
1532− wake_up_all(&ring->irq_queue);
1533−
1534− intel_display_handle_reset(dev);
1535−
1536− wake_up_all(&dev_priv->gpu_error.reset_queue);
1566+ /*
1567+ * Note: The wake_up also serves as a memory barrier so that
1568+ * waiters see the update value of the reset counter atomic_t.
1569+ */
1570+ i915_error_wake_up(dev_priv, true);
15371571 }
15381572 }
15391573
@@ -1642,8 +1676,6 @@ static void i915_report_and_clear_eir(struct drm_device *dev) · 102 unmodified lines
16421676 void i915_handle_error(struct drm_device *dev, bool wedged)
16431677 {
16441678 struct drm_i915_private *dev_priv = dev->dev_private;
1645− struct intel_ring_buffer *ring;
1646− int i;
16471679
16481680 i915_capture_error_state(dev);
16491681 i915_report_and_clear_eir(dev);
@@ -1653,11 +1685,19 @@ void i915_handle_error(struct drm_device *dev, bool wedged) · 3 unmodified lines
16531685 &dev_priv->gpu_error.reset_counter);
16541686
16551687 /*
1656− * Wakeup waiting processes so that the reset work item
1657− * doesn't deadlock trying to grab various locks.
1688+ * Wakeup waiting processes so that the reset work function
1689+ * i915_error_work_func doesn't deadlock trying to grab various
1690+ * locks. By bumping the reset counter first, the woken
1691+ * processes will see a reset in progress and back off,
1692+ * releasing their locks and then wait for the reset completion.
1693+ * We must do this for _all_ gpu waiters that might hold locks
1694+ * that the reset work needs to acquire.
1695+ *
1696+ * Note: The wake_up serves as the required memory barrier to
1697+ * ensure that the waiters see the updated value of the reset
1698+ * counter atomic_t.
16581699 */
1659− for_each_ring(ring, dev_priv, i)
1660− wake_up_all(&ring->irq_queue);
1700+ i915_error_wake_up(dev_priv, false);
16611701 }
16621702
16631703 /*
drivers/gpu/drm/i915/intel_ddi.c+1−1
@@ -778,7 +778,7 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) · 777 unmodified lines
778778 /* Can only use the always-on power well for eDP when
779779 * not using the panel fitter, and when not using motion
780780 * blur mitigation (which we don't support). */
781− if (intel_crtc->config.pch_pfit.size)
781+ if (intel_crtc->config.pch_pfit.enabled)
782782 temp |= TRANS_DDI_EDP_INPUT_A_ONOFF;
783783 else
784784 temp |= TRANS_DDI_EDP_INPUT_A_ON;
drivers/gpu/drm/i915/intel_display.c+24−22
@@ -2249,7 +2249,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, · 2248 unmodified lines
22492249 I915_WRITE(PIPESRC(intel_crtc->pipe),
22502250 ((crtc->mode.hdisplay - 1) << 16) |
22512251 (crtc->mode.vdisplay - 1));
2252− if (!intel_crtc->config.pch_pfit.size &&
2252+ if (!intel_crtc->config.pch_pfit.enabled &&
22532253 (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) ||
22542254 intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) {
22552255 I915_WRITE(PF_CTL(intel_crtc->pipe), 0);
@@ -3203,7 +3203,7 @@ static void ironlake_pfit_enable(struct intel_crtc *crtc) · 947 unmodified lines
32033203 struct drm_i915_private *dev_priv = dev->dev_private;
32043204 int pipe = crtc->pipe;
32053205
3206− if (crtc->config.pch_pfit.size) {
3206+ if (crtc->config.pch_pfit.enabled) {
32073207 /* Force use of hard-coded filter coefficients
32083208 * as some pre-programmed values are broken,
32093209 * e.g. x201.
@@ -3428,7 +3428,7 @@ static void ironlake_pfit_disable(struct intel_crtc *crtc) · 218 unmodified lines
34283428
34293429 /* To avoid upsetting the power well on haswell only disable the pfit if
34303430 * it's in use. The hw state code will make sure we get this right. */
3431− if (crtc->config.pch_pfit.size) {
3431+ if (crtc->config.pch_pfit.enabled) {
34323432 I915_WRITE(PF_CTL(pipe), 0);
34333433 I915_WRITE(PF_WIN_POS(pipe), 0);
34343434 I915_WRITE(PF_WIN_SZ(pipe), 0);
@@ -4775,6 +4775,10 @@ static void i9xx_set_pipeconf(struct intel_crtc *intel_crtc) · 1340 unmodified lines
47754775
47764776 pipeconf = 0;
47774777
4778+ if (dev_priv->quirks & QUIRK_PIPEA_FORCE &&
4779+ I915_READ(PIPECONF(intel_crtc->pipe)) & PIPECONF_ENABLE)
4780+ pipeconf |= PIPECONF_ENABLE;
4781+
47784782 if (intel_crtc->pipe == 0 && INTEL_INFO(dev)->gen < 4) {
47794783 /* Enable pixel doubling when the dot clock is > 90% of the (display)
47804784 * core speed.
@@ -4877,9 +4881,6 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, · 96 unmodified lines
48774881 return -EINVAL;
48784882 }
48794883
4880− /* Ensure that the cursor is valid for the new mode before changing... */
4881− intel_crtc_update_cursor(crtc, true);
4882−
48834884 if (is_lvds && dev_priv->lvds_downclock_avail) {
48844885 /*
48854886 * Ensure we match the reduced clock's P to the target clock.
@@ -5768,9 +5769,6 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, · 882 unmodified lines
57685769 intel_crtc->config.dpll.p2 = clock.p2;
57695770 }
57705771
5771− /* Ensure that the cursor is valid for the new mode before changing... */
5772− intel_crtc_update_cursor(crtc, true);
5773−
57745772 /* CPU eDP is the only output that doesn't need a PCH PLL of its own. */
57755773 if (intel_crtc->config.has_pch_encoder) {
57765774 fp = i9xx_dpll_compute_fp(&intel_crtc->config.dpll);
@@ -5859,6 +5857,7 @@ static void ironlake_get_pfit_config(struct intel_crtc *crtc, · 82 unmodified lines
58595857 tmp = I915_READ(PF_CTL(crtc->pipe));
58605858
58615859 if (tmp & PF_ENABLE) {
5860+ pipe_config->pch_pfit.enabled = true;
58625861 pipe_config->pch_pfit.pos = I915_READ(PF_WIN_POS(crtc->pipe));
58635862 pipe_config->pch_pfit.size = I915_READ(PF_WIN_SZ(crtc->pipe));
58645863
@@ -6236,7 +6235,7 @@ static void haswell_modeset_global_resources(struct drm_device *dev) · 371 unmodified lines
62366235 if (!crtc->base.enabled)
62376236 continue;
62386237
6239− if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.size ||
6238+ if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.enabled ||
62406239 crtc->config.cpu_transcoder != TRANSCODER_EDP)
62416240 enable = true;
62426241 }
@@ -6259,9 +6258,6 @@ static int haswell_crtc_mode_set(struct drm_crtc *crtc, · 16 unmodified lines
62596258 if (!intel_ddi_pll_mode_set(crtc))
62606259 return -EINVAL;
62616260
6262− /* Ensure that the cursor is valid for the new mode before changing... */
6263− intel_crtc_update_cursor(crtc, true);
6264−
62656261 if (intel_crtc->config.has_dp_encoder)
62666262 intel_dp_set_m_n(intel_crtc);
62676263
@@ -6494,15 +6490,15 @@ static void haswell_write_eld(struct drm_connector *connector, · 226 unmodified lines
64946490
64956491 /* Set ELD valid state */
64966492 tmp = I915_READ(aud_cntrl_st2);
6497− DRM_DEBUG_DRIVER("HDMI audio: pin eld vld status=0x%8x\n", tmp);
6493+ DRM_DEBUG_DRIVER("HDMI audio: pin eld vld status=0x%08x\n", tmp);
64986494 tmp |= (AUDIO_ELD_VALID_A << (pipe * 4));
64996495 I915_WRITE(aud_cntrl_st2, tmp);
65006496 tmp = I915_READ(aud_cntrl_st2);
6501− DRM_DEBUG_DRIVER("HDMI audio: eld vld status=0x%8x\n", tmp);
6497+ DRM_DEBUG_DRIVER("HDMI audio: eld vld status=0x%08x\n", tmp);
65026498
65036499 /* Enable HDMI mode */
65046500 tmp = I915_READ(aud_config);
6505− DRM_DEBUG_DRIVER("HDMI audio: audio conf: 0x%8x\n", tmp);
6501+ DRM_DEBUG_DRIVER("HDMI audio: audio conf: 0x%08x\n", tmp);
65066502 /* clear N_programing_enable and N_value_index */
65076503 tmp &= ~(AUD_CONFIG_N_VALUE_INDEX | AUD_CONFIG_N_PROG_ENABLE);
65086504 I915_WRITE(aud_config, tmp);
@@ -6937,7 +6933,8 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, · 428 unmodified lines
69376933 intel_crtc->cursor_width = width;
69386934 intel_crtc->cursor_height = height;
69396935
6940− intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
6936+ if (intel_crtc->active)
6937+ intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
69416938
69426939 return 0;
69436940 fail_unpin:
@@ -6956,7 +6953,8 @@ static int intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) · 12 unmodified lines
69566953 intel_crtc->cursor_x = x;
69576954 intel_crtc->cursor_y = y;
69586955
6959− intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
6956+ if (intel_crtc->active)
6957+ intel_crtc_update_cursor(crtc, intel_crtc->cursor_bo != NULL);
69606958
69616959 return 0;
69626960 }
@@ -8205,9 +8203,10 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc, · 1242 unmodified lines
82058203 pipe_config->gmch_pfit.control,
82068204 pipe_config->gmch_pfit.pgm_ratios,
82078205 pipe_config->gmch_pfit.lvds_border_bits);
8208− DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x\n",
8206+ DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x, %s\n",
82098207 pipe_config->pch_pfit.pos,
8210− pipe_config->pch_pfit.size);
8208+ pipe_config->pch_pfit.size,
8209+ pipe_config->pch_pfit.enabled ? "enabled" : "disabled");
82118210 DRM_DEBUG_KMS("ips: %i\n", pipe_config->ips_enabled);
82128211 }
82138212
@@ -8603,8 +8602,11 @@ intel_pipe_config_compare(struct drm_device *dev, · 389 unmodified lines
86038602 if (INTEL_INFO(dev)->gen < 4)
86048603 PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios);
86058604 PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits);
8606− PIPE_CONF_CHECK_I(pch_pfit.pos);
8607− PIPE_CONF_CHECK_I(pch_pfit.size);
8605+ PIPE_CONF_CHECK_I(pch_pfit.enabled);
8606+ if (current_config->pch_pfit.enabled) {
8607+ PIPE_CONF_CHECK_I(pch_pfit.pos);
8608+ PIPE_CONF_CHECK_I(pch_pfit.size);
8609+ }
86088610
86098611 PIPE_CONF_CHECK_I(ips_enabled);
86108612
drivers/gpu/drm/i915/intel_dp.c+12−1
@@ -588,7 +588,18 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode, · 587 unmodified lines
588588 DRM_DEBUG_KMS("aux_ch native nack\n");
589589 return -EREMOTEIO;
590590 case AUX_NATIVE_REPLY_DEFER:
591− udelay(100);
591+ /*
592+ * For now, just give more slack to branch devices. We
593+ * could check the DPCD for I2C bit rate capabilities,
594+ * and if available, adjust the interval. We could also
595+ * be more careful with DP-to-Legacy adapters where a
596+ * long legacy cable may force very low I2C bit rates.
597+ */
598+ if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
599+ DP_DWN_STRM_PORT_PRESENT)
600+ usleep_range(500, 600);
601+ else
602+ usleep_range(300, 400);
592603 continue;
593604 default:
594605 DRM_ERROR("aux_ch invalid native reply 0x%02x\n",
drivers/gpu/drm/i915/intel_drv.h+1−0
@@ -280,6 +280,7 @@ struct intel_crtc_config { · 279 unmodified lines
280280 struct {
281281 u32 pos;
282282 u32 size;
283+ bool enabled;
283284 } pch_pfit;
284285
285286 /* FDI configuration, only valid if has_pch_encoder is set. */
drivers/gpu/drm/i915/intel_dvo.c+2−0
@@ -263,6 +263,8 @@ static bool intel_dvo_compute_config(struct intel_encoder *encoder, · 262 unmodified lines
263263 C(vtotal);
264264 C(clock);
265265 #undef C
266+
267+ drm_mode_set_crtcinfo(adjusted_mode, 0);
266268 }
267269
268270 if (intel_dvo->dev.dev_ops->mode_fixup)
drivers/gpu/drm/i915/intel_panel.c+1−0
@@ -112,6 +112,7 @@ intel_pch_panel_fitting(struct intel_crtc *intel_crtc, · 111 unmodified lines
112112 done:
113113 pipe_config->pch_pfit.pos = (x << 16) | y;
114114 pipe_config->pch_pfit.size = (width << 16) | height;
115+ pipe_config->pch_pfit.enabled = pipe_config->pch_pfit.size != 0;
115116 }
116117
117118 static void
drivers/gpu/drm/i915/intel_pm.c+3−3
@@ -2096,16 +2096,16 @@ static uint32_t ilk_pipe_pixel_rate(struct drm_device *dev, · 2095 unmodified lines
20962096 struct drm_crtc *crtc)
20972097 {
20982098 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
2099− uint32_t pixel_rate, pfit_size;
2099+ uint32_t pixel_rate;
21002100
21012101 pixel_rate = intel_crtc->config.adjusted_mode.clock;
21022102
21032103 /* We only use IF-ID interlacing. If we ever use PF-ID we'll need to
21042104 * adjust the pixel_rate here. */
21052105
2106− pfit_size = intel_crtc->config.pch_pfit.size;
2107− if (pfit_size) {
2106+ if (intel_crtc->config.pch_pfit.enabled) {
21082107 uint64_t pipe_w, pipe_h, pfit_w, pfit_h;
2108+ uint32_t pfit_size = intel_crtc->config.pch_pfit.size;
21092109
21102110 pipe_w = intel_crtc->config.requested_mode.hdisplay;
21112111 pipe_h = intel_crtc->config.requested_mode.vdisplay;
drivers/gpu/drm/i915/intel_sdvo.c+36−27
@@ -788,6 +788,8 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd, · 787 unmodified lines
788788 uint16_t h_sync_offset, v_sync_offset;
789789 int mode_clock;
790790
791+ memset(dtd, 0, sizeof(*dtd));
792+
791793 width = mode->hdisplay;
792794 height = mode->vdisplay;
793795
@@ -830,44 +832,51 @@ static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd, · 36 unmodified lines
830832 if (mode->flags & DRM_MODE_FLAG_PVSYNC)
831833 dtd->part2.dtd_flags |= DTD_FLAG_VSYNC_POSITIVE;
832834
833− dtd->part2.sdvo_flags = 0;
834835 dtd->part2.v_sync_off_high = v_sync_offset & 0xc0;
835− dtd->part2.reserved = 0;
836836 }
837837
838−static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode,
838+static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode *pmode,
839839 const struct intel_sdvo_dtd *dtd)
840840 {
841− mode->hdisplay = dtd->part1.h_active;
842− mode->hdisplay += ((dtd->part1.h_high >> 4) & 0x0f) << 8;
843− mode->hsync_start = mode->hdisplay + dtd->part2.h_sync_off;
844− mode->hsync_start += (dtd->part2.sync_off_width_high & 0xc0) << 2;
845− mode->hsync_end = mode->hsync_start + dtd->part2.h_sync_width;
846− mode->hsync_end += (dtd->part2.sync_off_width_high & 0x30) << 4;
847− mode->htotal = mode->hdisplay + dtd->part1.h_blank;
848− mode->htotal += (dtd->part1.h_high & 0xf) << 8;
849−
850− mode->vdisplay = dtd->part1.v_active;
851− mode->vdisplay += ((dtd->part1.v_high >> 4) & 0x0f) << 8;
852− mode->vsync_start = mode->vdisplay;
853− mode->vsync_start += (dtd->part2.v_sync_off_width >> 4) & 0xf;
854− mode->vsync_start += (dtd->part2.sync_off_width_high & 0x0c) << 2;
855− mode->vsync_start += dtd->part2.v_sync_off_high & 0xc0;
856− mode->vsync_end = mode->vsync_start +
841+ struct drm_display_mode mode = {};
842+
843+ mode.hdisplay = dtd->part1.h_active;
844+ mode.hdisplay += ((dtd->part1.h_high >> 4) & 0x0f) << 8;
845+ mode.hsync_start = mode.hdisplay + dtd->part2.h_sync_off;
846+ mode.hsync_start += (dtd->part2.sync_off_width_high & 0xc0) << 2;
847+ mode.hsync_end = mode.hsync_start + dtd->part2.h_sync_width;
848+ mode.hsync_end += (dtd->part2.sync_off_width_high & 0x30) << 4;
849+ mode.htotal = mode.hdisplay + dtd->part1.h_blank;
850+ mode.htotal += (dtd->part1.h_high & 0xf) << 8;
851+
852+ mode.vdisplay = dtd->part1.v_active;
853+ mode.vdisplay += ((dtd->part1.v_high >> 4) & 0x0f) << 8;
854+ mode.vsync_start = mode.vdisplay;
855+ mode.vsync_start += (dtd->part2.v_sync_off_width >> 4) & 0xf;
856+ mode.vsync_start += (dtd->part2.sync_off_width_high & 0x0c) << 2;
857+ mode.vsync_start += dtd->part2.v_sync_off_high & 0xc0;
858+ mode.vsync_end = mode.vsync_start +
857859 (dtd->part2.v_sync_off_width & 0xf);
858− mode->vsync_end += (dtd->part2.sync_off_width_high & 0x3) << 4;
859− mode->vtotal = mode->vdisplay + dtd->part1.v_blank;
860− mode->vtotal += (dtd->part1.v_high & 0xf) << 8;
860+ mode.vsync_end += (dtd->part2.sync_off_width_high & 0x3) << 4;
861+ mode.vtotal = mode.vdisplay + dtd->part1.v_blank;
862+ mode.vtotal += (dtd->part1.v_high & 0xf) << 8;
861863
862− mode->clock = dtd->part1.clock * 10;
864+ mode.clock = dtd->part1.clock * 10;
863865
864− mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
865866 if (dtd->part2.dtd_flags & DTD_FLAG_INTERLACE)
866− mode->flags |= DRM_MODE_FLAG_INTERLACE;
867+ mode.flags |= DRM_MODE_FLAG_INTERLACE;
867868 if (dtd->part2.dtd_flags & DTD_FLAG_HSYNC_POSITIVE)
868− mode->flags |= DRM_MODE_FLAG_PHSYNC;
869+ mode.flags |= DRM_MODE_FLAG_PHSYNC;
870+ else
871+ mode.flags |= DRM_MODE_FLAG_NHSYNC;
869872 if (dtd->part2.dtd_flags & DTD_FLAG_VSYNC_POSITIVE)
870− mode->flags |= DRM_MODE_FLAG_PVSYNC;
873+ mode.flags |= DRM_MODE_FLAG_PVSYNC;
874+ else
875+ mode.flags |= DRM_MODE_FLAG_NVSYNC;
876+
877+ drm_mode_set_crtcinfo(&mode, 0);
878+
879+ drm_mode_copy(pmode, &mode);
871880 }
872881
873882 static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo)
drivers/gpu/drm/i915/intel_tv.c+8−0
@@ -916,6 +916,14 @@ intel_tv_compute_config(struct intel_encoder *encoder, · 915 unmodified lines
916916 DRM_DEBUG_KMS("forcing bpc to 8 for TV\n");
917917 pipe_config->pipe_bpp = 8*3;
918918
919+ /* TV has it's own notion of sync and other mode flags, so clear them. */
920+ pipe_config->adjusted_mode.flags = 0;
921+
922+ /*
923+ * FIXME: We don't check whether the input mode is actually what we want
924+ * or whether userspace is doing something stupid.
925+ */
926+
919927 return true;
920928 }
921929
drivers/gpu/drm/msm/adreno/adreno_gpu.c+9−1
@@ -124,6 +124,8 @@ void adreno_recover(struct msm_gpu *gpu) · 123 unmodified lines
124124
125125 /* reset completed fence seqno, just discard anything pending: */
126126 adreno_gpu->memptrs->fence = gpu->submitted_fence;
127+ adreno_gpu->memptrs->rptr = 0;
128+ adreno_gpu->memptrs->wptr = 0;
127129
128130 gpu->funcs->pm_resume(gpu);
129131 ret = gpu->funcs->hw_init(gpu);
@@ -229,7 +231,7 @@ void adreno_idle(struct msm_gpu *gpu) · 99 unmodified lines
229231 return;
230232 } while(time_before(jiffies, t));
231233
232− DRM_ERROR("timeout waiting for %s to drain ringbuffer!\n", gpu->name);
234+ DRM_ERROR("%s: timeout waiting to drain ringbuffer!\n", gpu->name);
233235
234236 /* TODO maybe we need to reset GPU here to recover from hang? */
235237 }
@@ -256,11 +258,17 @@ void adreno_wait_ring(struct msm_gpu *gpu, uint32_t ndwords) · 20 unmodified lines
256258 {
257259 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
258260 uint32_t freedwords;
261+ unsigned long t = jiffies + ADRENO_IDLE_TIMEOUT;
259262 do {
260263 uint32_t size = gpu->rb->size / 4;
261264 uint32_t wptr = get_wptr(gpu->rb);
262265 uint32_t rptr = adreno_gpu->memptrs->rptr;
263266 freedwords = (rptr + (size - 1) - wptr) % size;
267+
268+ if (time_after(jiffies, t)) {
269+ DRM_ERROR("%s: timeout waiting for ringbuffer space\n", gpu->name);
270+ break;
271+ }
264272 } while(freedwords < ndwords);
265273 }
266274
drivers/gpu/drm/msm/mdp4/mdp4_kms.c+0−2
@@ -19,8 +19,6 @@ · 18 unmodified lines
1919 #include "msm_drv.h"
2020 #include "mdp4_kms.h"
2121
22−#include <mach/iommu.h>
23−
2422 static struct mdp4_platform_config *mdp4_get_config(struct platform_device *dev);
2523
2624 static int mdp4_hw_init(struct msm_kms *kms)
drivers/gpu/drm/msm/msm_drv.c+37−21
@@ -18,8 +18,6 @@ · 17 unmodified lines
1818 #include "msm_drv.h"
1919 #include "msm_gpu.h"
2020
21−#include <mach/iommu.h>
22−
2321 static void msm_fb_output_poll_changed(struct drm_device *dev)
2422 {
2523 struct msm_drm_private *priv = dev->dev_private;
@@ -62,6 +60,8 @@ int msm_iommu_attach(struct drm_device *dev, struct iommu_domain *iommu, · 36 unmodified lines
6260 int i, ret;
6361
6462 for (i = 0; i < cnt; i++) {
63+ /* TODO maybe some day msm iommu won't require this hack: */
64+ struct device *msm_iommu_get_ctx(const char *ctx_name);
6565 struct device *ctx = msm_iommu_get_ctx(names[i]);
6666 if (!ctx)
6767 continue;
@@ -199,7 +199,7 @@ static int msm_load(struct drm_device *dev, unsigned long flags) · 131 unmodified lines
199199 * imx drm driver on iMX5
200200 */
201201 dev_err(dev->dev, "failed to load kms\n");
202− ret = PTR_ERR(priv->kms);
202+ ret = PTR_ERR(kms);
203203 goto fail;
204204 }
205205
@@ -499,25 +499,41 @@ int msm_wait_fence_interruptable(struct drm_device *dev, uint32_t fence, · 293 unmodified lines
499499 struct timespec *timeout)
500500 {
501501 struct msm_drm_private *priv = dev->dev_private;
502− unsigned long timeout_jiffies = timespec_to_jiffies(timeout);
503− unsigned long start_jiffies = jiffies;
504− unsigned long remaining_jiffies;
505502 int ret;
506503
507− if (time_after(start_jiffies, timeout_jiffies))
508− remaining_jiffies = 0;
509− else
510− remaining_jiffies = timeout_jiffies - start_jiffies;
511−
512− ret = wait_event_interruptible_timeout(priv->fence_event,
513− priv->completed_fence >= fence,
514− remaining_jiffies);
515− if (ret == 0) {
516− DBG("timeout waiting for fence: %u (completed: %u)",
517− fence, priv->completed_fence);
518− ret = -ETIMEDOUT;
519− } else if (ret != -ERESTARTSYS) {
520− ret = 0;
504+ if (!priv->gpu)
505+ return 0;
506+
507+ if (fence > priv->gpu->submitted_fence) {
508+ DRM_ERROR("waiting on invalid fence: %u (of %u)\n",
509+ fence, priv->gpu->submitted_fence);
510+ return -EINVAL;
511+ }
512+
513+ if (!timeout) {
514+ /* no-wait: */
515+ ret = fence_completed(dev, fence) ? 0 : -EBUSY;
516+ } else {
517+ unsigned long timeout_jiffies = timespec_to_jiffies(timeout);
518+ unsigned long start_jiffies = jiffies;
519+ unsigned long remaining_jiffies;
520+
521+ if (time_after(start_jiffies, timeout_jiffies))
522+ remaining_jiffies = 0;
523+ else
524+ remaining_jiffies = timeout_jiffies - start_jiffies;
525+
526+ ret = wait_event_interruptible_timeout(priv->fence_event,
527+ fence_completed(dev, fence),
528+ remaining_jiffies);
529+
530+ if (ret == 0) {
531+ DBG("timeout waiting for fence: %u (completed: %u)",
532+ fence, priv->completed_fence);
533+ ret = -ETIMEDOUT;
534+ } else if (ret != -ERESTARTSYS) {
535+ ret = 0;
536+ }
521537 }
522538
523539 return ret;
@@ -681,7 +697,7 @@ static struct drm_driver msm_driver = { · 157 unmodified lines
681697 .gem_vm_ops = &vm_ops,
682698 .dumb_create = msm_gem_dumb_create,
683699 .dumb_map_offset = msm_gem_dumb_map_offset,
684− .dumb_destroy = msm_gem_dumb_destroy,
700+ .dumb_destroy = drm_gem_dumb_destroy,
685701 #ifdef CONFIG_DEBUG_FS
686702 .debugfs_init = msm_debugfs_init,
687703 .debugfs_cleanup = msm_debugfs_cleanup,
drivers/gpu/drm/msm/msm_drv.h+7−1
@@ -153,7 +153,7 @@ void *msm_gem_vaddr(struct drm_gem_object *obj); · 152 unmodified lines
153153 int msm_gem_queue_inactive_work(struct drm_gem_object *obj,
154154 struct work_struct *work);
155155 void msm_gem_move_to_active(struct drm_gem_object *obj,
156− struct msm_gpu *gpu, uint32_t fence);
156+ struct msm_gpu *gpu, bool write, uint32_t fence);
157157 void msm_gem_move_to_inactive(struct drm_gem_object *obj);
158158 int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op,
159159 struct timespec *timeout);
@@ -191,6 +191,12 @@ u32 msm_readl(const void __iomem *addr); · 31 unmodified lines
191191 #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
192192 #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
193193
194+static inline bool fence_completed(struct drm_device *dev, uint32_t fence)
195+{
196+ struct msm_drm_private *priv = dev->dev_private;
197+ return priv->completed_fence >= fence;
198+}
199+
194200 static inline int align_pitch(int width, int bpp)
195201 {
196202 int bytespp = (bpp + 7) / 8;
drivers/gpu/drm/msm/msm_gem.c+24−17
@@ -40,9 +40,9 @@ static struct page **get_pages(struct drm_gem_object *obj) · 39 unmodified lines
4040 }
4141
4242 msm_obj->sgt = drm_prime_pages_to_sg(p, npages);
43− if (!msm_obj->sgt) {
43+ if (IS_ERR(msm_obj->sgt)) {
4444 dev_err(dev->dev, "failed to allocate sgt\n");
45− return ERR_PTR(-ENOMEM);
45+ return ERR_CAST(msm_obj->sgt);
4646 }
4747
4848 msm_obj->pages = p;
@@ -159,7 +159,6 @@ out_unlock: · 110 unmodified lines
159159 out:
160160 switch (ret) {
161161 case -EAGAIN:
162− set_need_resched();
163162 case 0:
164163 case -ERESTARTSYS:
165164 case -EINTR:
@@ -320,13 +319,6 @@ int msm_gem_dumb_create(struct drm_file *file, struct drm_device *dev, · 154 unmodified lines
320319 MSM_BO_SCANOUT | MSM_BO_WC, &args->handle);
321320 }
322321
323−int msm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
324− uint32_t handle)
325−{
326− /* No special work needed, drop the reference and see what falls out */
327− return drm_gem_handle_delete(file, handle);
328−}
329−
330322 int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
331323 uint32_t handle, uint64_t *offset)
332324 {
@@ -393,11 +385,14 @@ int msm_gem_queue_inactive_work(struct drm_gem_object *obj, · 60 unmodified lines
393385 }
394386
395387 void msm_gem_move_to_active(struct drm_gem_object *obj,
396− struct msm_gpu *gpu, uint32_t fence)
388+ struct msm_gpu *gpu, bool write, uint32_t fence)
397389 {
398390 struct msm_gem_object *msm_obj = to_msm_bo(obj);
399391 msm_obj->gpu = gpu;
400− msm_obj->fence = fence;
392+ if (write)
393+ msm_obj->write_fence = fence;
394+ else
395+ msm_obj->read_fence = fence;
401396 list_del_init(&msm_obj->mm_list);
402397 list_add_tail(&msm_obj->mm_list, &gpu->active_list);
403398 }
@@ -411,7 +406,8 @@ void msm_gem_move_to_inactive(struct drm_gem_object *obj) · 7 unmodified lines
411406 WARN_ON(!mutex_is_locked(&dev->struct_mutex));
412407
413408 msm_obj->gpu = NULL;
414− msm_obj->fence = 0;
409+ msm_obj->read_fence = 0;
410+ msm_obj->write_fence = 0;
415411 list_del_init(&msm_obj->mm_list);
416412 list_add_tail(&msm_obj->mm_list, &priv->inactive_list);
417413
@@ -433,8 +429,18 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, · 15 unmodified lines
433429 struct msm_gem_object *msm_obj = to_msm_bo(obj);
434430 int ret = 0;
435431
436− if (is_active(msm_obj) && !(op & MSM_PREP_NOSYNC))
437− ret = msm_wait_fence_interruptable(dev, msm_obj->fence, timeout);
432+ if (is_active(msm_obj)) {
433+ uint32_t fence = 0;
434+
435+ if (op & MSM_PREP_READ)
436+ fence = msm_obj->write_fence;
437+ if (op & MSM_PREP_WRITE)
438+ fence = max(fence, msm_obj->read_fence);
439+ if (op & MSM_PREP_NOSYNC)
440+ timeout = NULL;
441+
442+ ret = msm_wait_fence_interruptable(dev, fence, timeout);
443+ }
438444
439445 /* TODO cache maintenance */
440446
@@ -455,9 +461,10 @@ void msm_gem_describe(struct drm_gem_object *obj, struct seq_file *m) · 14 unmodified lines
455461 uint64_t off = drm_vma_node_start(&obj->vma_node);
456462
457463 WARN_ON(!mutex_is_locked(&dev->struct_mutex));
458− seq_printf(m, "%08x: %c(%d) %2d (%2d) %08llx %p %d\n",
464+ seq_printf(m, "%08x: %c(r=%u,w=%u) %2d (%2d) %08llx %p %d\n",
459465 msm_obj->flags, is_active(msm_obj) ? 'A' : 'I',
460− msm_obj->fence, obj->name, obj->refcount.refcount.counter,
466+ msm_obj->read_fence, msm_obj->write_fence,
467+ obj->name, obj->refcount.refcount.counter,
461468 off, msm_obj->vaddr, obj->size);
462469 }
463470
drivers/gpu/drm/msm/msm_gem.h+1−1
@@ -36,7 +36,7 @@ struct msm_gem_object { · 35 unmodified lines
3636 */
3737 struct list_head mm_list;
3838 struct msm_gpu *gpu; /* non-null if active */
39− uint32_t fence;
39+ uint32_t read_fence, write_fence;
4040
4141 /* Transiently in the process of submit ioctl, objects associated
4242 * with the submit are on submit->bo_list.. this only lasts for
drivers/gpu/drm/msm/msm_gem_submit.c+13−11
@@ -78,7 +78,7 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, · 77 unmodified lines
7878 }
7979
8080 if (submit_bo.flags & BO_INVALID_FLAGS) {
81− DBG("invalid flags: %x", submit_bo.flags);
81+ DRM_ERROR("invalid flags: %x\n", submit_bo.flags);
8282 ret = -EINVAL;
8383 goto out_unlock;
8484 }
@@ -92,7 +92,7 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, · 7 unmodified lines
9292 */
9393 obj = idr_find(&file->object_idr, submit_bo.handle);
9494 if (!obj) {
95− DBG("invalid handle %u at index %u", submit_bo.handle, i);
95+ DRM_ERROR("invalid handle %u at index %u\n", submit_bo.handle, i);
9696 ret = -EINVAL;
9797 goto out_unlock;
9898 }
@@ -100,7 +100,7 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, · 1 unmodified line
100100 msm_obj = to_msm_bo(obj);
101101
102102 if (!list_empty(&msm_obj->submit_entry)) {
103− DBG("handle %u at index %u already on submit list",
103+ DRM_ERROR("handle %u at index %u already on submit list\n",
104104 submit_bo.handle, i);
105105 ret = -EINVAL;
106106 goto out_unlock;
@@ -216,8 +216,9 @@ static int submit_bo(struct msm_gem_submit *submit, uint32_t idx, · 109 unmodified lines
216216 struct msm_gem_object **obj, uint32_t *iova, bool *valid)
217217 {
218218 if (idx >= submit->nr_bos) {
219− DBG("invalid buffer index: %u (out of %u)", idx, submit->nr_bos);
220− return EINVAL;
219+ DRM_ERROR("invalid buffer index: %u (out of %u)\n",
220+ idx, submit->nr_bos);
221+ return -EINVAL;
221222 }
222223
223224 if (obj)
@@ -239,7 +240,7 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob · 15 unmodified lines
239240 int ret;
240241
241242 if (offset % 4) {
242− DBG("non-aligned cmdstream buffer: %u", offset);
243+ DRM_ERROR("non-aligned cmdstream buffer: %u\n", offset);
243244 return -EINVAL;
244245 }
245246
@@ -266,7 +267,7 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob · 20 unmodified lines
266267 return -EFAULT;
267268
268269 if (submit_reloc.submit_offset % 4) {
269− DBG("non-aligned reloc offset: %u",
270+ DRM_ERROR("non-aligned reloc offset: %u\n",
270271 submit_reloc.submit_offset);
271272 return -EINVAL;
272273 }
@@ -276,7 +277,7 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob · 3 unmodified lines
276277
277278 if ((off >= (obj->base.size / 4)) ||
278279 (off < last_offset)) {
279− DBG("invalid offset %u at reloc %u", off, i);
280+ DRM_ERROR("invalid offset %u at reloc %u\n", off, i);
280281 return -EINVAL;
281282 }
282283
@@ -374,14 +375,15 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 91 unmodified lines
374375 goto out;
375376
376377 if (submit_cmd.size % 4) {
377− DBG("non-aligned cmdstream buffer size: %u",
378+ DRM_ERROR("non-aligned cmdstream buffer size: %u\n",
378379 submit_cmd.size);
379380 ret = -EINVAL;
380381 goto out;
381382 }
382383
383− if (submit_cmd.size >= msm_obj->base.size) {
384− DBG("invalid cmdstream size: %u", submit_cmd.size);
384+ if ((submit_cmd.size + submit_cmd.submit_offset) >=
385+ msm_obj->base.size) {
386+ DRM_ERROR("invalid cmdstream size: %u\n", submit_cmd.size);
385387 ret = -EINVAL;
386388 goto out;
387389 }
drivers/gpu/drm/msm/msm_gpu.c+20−4
@@ -29,13 +29,14 @@ · 28 unmodified lines
2929 static void bs_init(struct msm_gpu *gpu, struct platform_device *pdev)
3030 {
3131 struct drm_device *dev = gpu->dev;
32− struct kgsl_device_platform_data *pdata = pdev->dev.platform_data;
32+ struct kgsl_device_platform_data *pdata;
3333
3434 if (!pdev) {
3535 dev_err(dev->dev, "could not find dtv pdata\n");
3636 return;
3737 }
3838
39+ pdata = pdev->dev.platform_data;
3940 if (pdata->bus_scale_table) {
4041 gpu->bsc = msm_bus_scale_register_client(pdata->bus_scale_table);
4142 DBG("bus scale client: %08x", gpu->bsc);
@@ -230,6 +231,8 @@ static void hangcheck_timer_reset(struct msm_gpu *gpu) · 188 unmodified lines
230231 static void hangcheck_handler(unsigned long data)
231232 {
232233 struct msm_gpu *gpu = (struct msm_gpu *)data;
234+ struct drm_device *dev = gpu->dev;
235+ struct msm_drm_private *priv = dev->dev_private;
233236 uint32_t fence = gpu->funcs->last_fence(gpu);
234237
235238 if (fence != gpu->hangcheck_fence) {
@@ -237,14 +240,22 @@ static void hangcheck_handler(unsigned long data) · 1 unmodified line
237240 gpu->hangcheck_fence = fence;
238241 } else if (fence < gpu->submitted_fence) {
239242 /* no progress and not done.. hung! */
240− struct msm_drm_private *priv = gpu->dev->dev_private;
241243 gpu->hangcheck_fence = fence;
244+ dev_err(dev->dev, "%s: hangcheck detected gpu lockup!\n",
245+ gpu->name);
246+ dev_err(dev->dev, "%s: completed fence: %u\n",
247+ gpu->name, fence);
248+ dev_err(dev->dev, "%s: submitted fence: %u\n",
249+ gpu->name, gpu->submitted_fence);
242250 queue_work(priv->wq, &gpu->recover_work);
243251 }
244252
245253 /* if still more pending work, reset the hangcheck timer: */
246254 if (gpu->submitted_fence > gpu->hangcheck_fence)
247255 hangcheck_timer_reset(gpu);
256+
257+ /* workaround for missing irq: */
258+ queue_work(priv->wq, &gpu->retire_work);
248259 }
249260
250261 /*
@@ -265,7 +276,8 @@ static void retire_worker(struct work_struct *work) · 14 unmodified lines
265276 obj = list_first_entry(&gpu->active_list,
266277 struct msm_gem_object, mm_list);
267278
268− if (obj->fence <= fence) {
279+ if ((obj->read_fence <= fence) &&
280+ (obj->write_fence <= fence)) {
269281 /* move to inactive: */
270282 msm_gem_move_to_inactive(&obj->base);
271283 msm_gem_put_iova(&obj->base, gpu->id);
@@ -321,7 +333,11 @@ int msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, · 49 unmodified lines
321333 submit->gpu->id, &iova);
322334 }
323335
324− msm_gem_move_to_active(&msm_obj->base, gpu, submit->fence);
336+ if (submit->bos[i].flags & MSM_SUBMIT_BO_READ)
337+ msm_gem_move_to_active(&msm_obj->base, gpu, false, submit->fence);
338+
339+ if (submit->bos[i].flags & MSM_SUBMIT_BO_WRITE)
340+ msm_gem_move_to_active(&msm_obj->base, gpu, true, submit->fence);
325341 }
326342 hangcheck_timer_reset(gpu);
327343 mutex_unlock(&dev->struct_mutex);
drivers/gpu/drm/nouveau/core/subdev/bios/init.c+18−3
@@ -579,8 +579,22 @@ static void · 578 unmodified lines
579579 init_reserved(struct nvbios_init *init)
580580 {
581581 u8 opcode = nv_ro08(init->bios, init->offset);
582− trace("RESERVED\t0x%02x\n", opcode);
583− init->offset += 1;
582+ u8 length, i;
583+
584+ switch (opcode) {
585+ case 0xaa:
586+ length = 4;
587+ break;
588+ default:
589+ length = 1;
590+ break;
591+ }
592+
593+ trace("RESERVED 0x%02x\t", opcode);
594+ for (i = 1; i < length; i++)
595+ cont(" 0x%02x", nv_ro08(init->bios, init->offset + i));
596+ cont("\n");
597+ init->offset += length;
584598 }
585599
586600 /**
@@ -1437,7 +1451,7 @@ init_configure_mem(struct nvbios_init *init) · 850 unmodified lines
14371451 data = init_rdvgai(init, 0x03c4, 0x01);
14381452 init_wrvgai(init, 0x03c4, 0x01, data | 0x20);
14391453
1440− while ((addr = nv_ro32(bios, sdata)) != 0xffffffff) {
1454+ for (; (addr = nv_ro32(bios, sdata)) != 0xffffffff; sdata += 4) {
14411455 switch (addr) {
14421456 case 0x10021c: /* CKE_NORMAL */
14431457 case 0x1002d0: /* CMD_REFRESH */
@@ -2135,6 +2149,7 @@ static struct nvbios_init_opcode { · 691 unmodified lines
21352149 [0x99] = { init_zm_auxch },
21362150 [0x9a] = { init_i2c_long_if },
21372151 [0xa9] = { init_gpio_ne },
2152+ [0xaa] = { init_reserved },
21382153 };
21392154
21402155 #define init_opcode_nr (sizeof(init_opcode) / sizeof(init_opcode[0]))
drivers/gpu/drm/nouveau/nouveau_display.c+15−20
@@ -278,7 +278,6 @@ nouveau_display_create(struct drm_device *dev) · 277 unmodified lines
278278 {
279279 struct nouveau_drm *drm = nouveau_drm(dev);
280280 struct nouveau_display *disp;
281− u32 pclass = dev->pdev->class >> 8;
282281 int ret, gen;
283282
284283 disp = drm->display = kzalloc(sizeof(*disp), GFP_KERNEL);
@@ -340,29 +339,25 @@ nouveau_display_create(struct drm_device *dev) · 55 unmodified lines
340339 drm_kms_helper_poll_init(dev);
341340 drm_kms_helper_poll_disable(dev);
342341
343− if (nouveau_modeset == 1 ||
344− (nouveau_modeset < 0 && pclass == PCI_CLASS_DISPLAY_VGA)) {
345− if (drm->vbios.dcb.entries) {
346− if (nv_device(drm->device)->card_type < NV_50)
347− ret = nv04_display_create(dev);
348− else
349− ret = nv50_display_create(dev);
350− } else {
351− ret = 0;
352− }
353−
354− if (ret)
355− goto disp_create_err;
342+ if (drm->vbios.dcb.entries) {
343+ if (nv_device(drm->device)->card_type < NV_50)
344+ ret = nv04_display_create(dev);
345+ else
346+ ret = nv50_display_create(dev);
347+ } else {
348+ ret = 0;
349+ }
356350
357− if (dev->mode_config.num_crtc) {
358− ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
359− if (ret)
360− goto vblank_err;
361− }
351+ if (ret)
352+ goto disp_create_err;
362353
363− nouveau_backlight_init(dev);
354+ if (dev->mode_config.num_crtc) {
355+ ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
356+ if (ret)
357+ goto vblank_err;
364358 }
365359
360+ nouveau_backlight_init(dev);
366361 return 0;
367362
368363 vblank_err:
drivers/gpu/drm/nouveau/nouveau_fbcon.c+2−1
@@ -454,7 +454,8 @@ nouveau_fbcon_init(struct drm_device *dev) · 453 unmodified lines
454454 int preferred_bpp;
455455 int ret;
456456
457− if (!dev->mode_config.num_crtc)
457+ if (!dev->mode_config.num_crtc ||
458+ (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
458459 return 0;
459460
460461 fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
drivers/gpu/drm/nouveau/nouveau_sgdma.c+1−3
@@ -104,9 +104,7 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev, · 103 unmodified lines
104104 else
105105 nvbe->ttm.ttm.func = &nv50_sgdma_backend;
106106
107− if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) {
108− kfree(nvbe);
107+ if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page))
109108 return NULL;
110− }
111109 return &nvbe->ttm.ttm;
112110 }
drivers/gpu/drm/radeon/atombios_encoders.c+15−8
@@ -707,8 +707,9 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) · 706 unmodified lines
707707 switch (connector->connector_type) {
708708 case DRM_MODE_CONNECTOR_DVII:
709709 case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */
710− if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
711− radeon_audio)
710+ if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
711+ (drm_detect_hdmi_monitor(radeon_connector->edid) &&
712+ (radeon_connector->audio == RADEON_AUDIO_AUTO)))
712713 return ATOM_ENCODER_MODE_HDMI;
713714 else if (radeon_connector->use_digital)
714715 return ATOM_ENCODER_MODE_DVI;
@@ -718,8 +719,9 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) · 3 unmodified lines
718719 case DRM_MODE_CONNECTOR_DVID:
719720 case DRM_MODE_CONNECTOR_HDMIA:
720721 default:
721− if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
722− radeon_audio)
722+ if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
723+ (drm_detect_hdmi_monitor(radeon_connector->edid) &&
724+ (radeon_connector->audio == RADEON_AUDIO_AUTO)))
723725 return ATOM_ENCODER_MODE_HDMI;
724726 else
725727 return ATOM_ENCODER_MODE_DVI;
@@ -732,8 +734,9 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) · 6 unmodified lines
732734 if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
733735 (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
734736 return ATOM_ENCODER_MODE_DP;
735− else if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
736− radeon_audio)
737+ else if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
738+ (drm_detect_hdmi_monitor(radeon_connector->edid) &&
739+ (radeon_connector->audio == RADEON_AUDIO_AUTO)))
737740 return ATOM_ENCODER_MODE_HDMI;
738741 else
739742 return ATOM_ENCODER_MODE_DVI;
@@ -1647,8 +1650,12 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) · 907 unmodified lines
16471650 atombios_dig_encoder_setup(encoder, ATOM_ENABLE, 0);
16481651 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP, 0, 0);
16491652 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE, 0, 0);
1650− /* some early dce3.2 boards have a bug in their transmitter control table */
1651− if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730))
1653+ /* some dce3.x boards have a bug in their transmitter control table.
1654+ * ACTION_ENABLE_OUTPUT can probably be dropped since ACTION_ENABLE
1655+ * does the same thing and more.
1656+ */
1657+ if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) &&
1658+ (rdev->family != CHIP_RS880))
16521659 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
16531660 }
16541661 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
drivers/gpu/drm/radeon/btc_dpm.c+51−6
@@ -1168,6 +1168,23 @@ static const struct radeon_blacklist_clocks btc_blacklist_clocks[] = · 1167 unmodified lines
11681168 { 25000, 30000, RADEON_SCLK_UP }
11691169 };
11701170
1171+void btc_get_max_clock_from_voltage_dependency_table(struct radeon_clock_voltage_dependency_table *table,
1172+ u32 *max_clock)
1173+{
1174+ u32 i, clock = 0;
1175+
1176+ if ((table == NULL) || (table->count == 0)) {
1177+ *max_clock = clock;
1178+ return;
1179+ }
1180+
1181+ for (i = 0; i < table->count; i++) {
1182+ if (clock < table->entries[i].clk)
1183+ clock = table->entries[i].clk;
1184+ }
1185+ *max_clock = clock;
1186+}
1187+
11711188 void btc_apply_voltage_dependency_rules(struct radeon_clock_voltage_dependency_table *table,
11721189 u32 clock, u16 max_voltage, u16 *voltage)
11731190 {
@@ -2080,6 +2097,7 @@ static void btc_apply_state_adjust_rules(struct radeon_device *rdev, · 906 unmodified lines
20802097 bool disable_mclk_switching;
20812098 u32 mclk, sclk;
20822099 u16 vddc, vddci;
2100+ u32 max_sclk_vddc, max_mclk_vddci, max_mclk_vddc;
20832101
20842102 if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
20852103 btc_dpm_vblank_too_short(rdev))
@@ -2121,6 +2139,39 @@ static void btc_apply_state_adjust_rules(struct radeon_device *rdev, · 35 unmodified lines
21212139 ps->low.vddci = max_limits->vddci;
21222140 }
21232141
2142+ /* limit clocks to max supported clocks based on voltage dependency tables */
2143+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk,
2144+ &max_sclk_vddc);
2145+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddci_dependency_on_mclk,
2146+ &max_mclk_vddci);
2147+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_mclk,
2148+ &max_mclk_vddc);
2149+
2150+ if (max_sclk_vddc) {
2151+ if (ps->low.sclk > max_sclk_vddc)
2152+ ps->low.sclk = max_sclk_vddc;
2153+ if (ps->medium.sclk > max_sclk_vddc)
2154+ ps->medium.sclk = max_sclk_vddc;
2155+ if (ps->high.sclk > max_sclk_vddc)
2156+ ps->high.sclk = max_sclk_vddc;
2157+ }
2158+ if (max_mclk_vddci) {
2159+ if (ps->low.mclk > max_mclk_vddci)
2160+ ps->low.mclk = max_mclk_vddci;
2161+ if (ps->medium.mclk > max_mclk_vddci)
2162+ ps->medium.mclk = max_mclk_vddci;
2163+ if (ps->high.mclk > max_mclk_vddci)
2164+ ps->high.mclk = max_mclk_vddci;
2165+ }
2166+ if (max_mclk_vddc) {
2167+ if (ps->low.mclk > max_mclk_vddc)
2168+ ps->low.mclk = max_mclk_vddc;
2169+ if (ps->medium.mclk > max_mclk_vddc)
2170+ ps->medium.mclk = max_mclk_vddc;
2171+ if (ps->high.mclk > max_mclk_vddc)
2172+ ps->high.mclk = max_mclk_vddc;
2173+ }
2174+
21242175 /* XXX validate the min clocks required for display */
21252176
21262177 if (disable_mclk_switching) {
@@ -2340,12 +2391,6 @@ int btc_dpm_set_power_state(struct radeon_device *rdev) · 213 unmodified lines
23402391 return ret;
23412392 }
23422393
2343− ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
2344− if (ret) {
2345− DRM_ERROR("rv770_dpm_force_performance_level failed\n");
2346− return ret;
2347− }
2348−
23492394 return 0;
23502395 }
23512396
drivers/gpu/drm/radeon/btc_dpm.h+2−0
@@ -46,6 +46,8 @@ void btc_adjust_clock_combinations(struct radeon_device *rdev, · 45 unmodified lines
4646 struct rv7xx_pl *pl);
4747 void btc_apply_voltage_dependency_rules(struct radeon_clock_voltage_dependency_table *table,
4848 u32 clock, u16 max_voltage, u16 *voltage);
49+void btc_get_max_clock_from_voltage_dependency_table(struct radeon_clock_voltage_dependency_table *table,
50+ u32 *max_clock);
4951 void btc_apply_voltage_delta_rules(struct radeon_device *rdev,
5052 u16 max_vddc, u16 max_vddci,
5153 u16 *vddc, u16 *vddci);
drivers/gpu/drm/radeon/ci_dpm.c+26−6
@@ -146,6 +146,8 @@ static const struct ci_pt_config_reg didt_config_ci[] = · 145 unmodified lines
146146 };
147147
148148 extern u8 rv770_get_memory_module_index(struct radeon_device *rdev);
149+extern void btc_get_max_clock_from_voltage_dependency_table(struct radeon_clock_voltage_dependency_table *table,
150+ u32 *max_clock);
149151 extern int ni_copy_and_switch_arb_sets(struct radeon_device *rdev,
150152 u32 arb_freq_src, u32 arb_freq_dest);
151153 extern u8 si_get_ddr3_mclk_frequency_ratio(u32 memory_clock);
@@ -712,6 +714,7 @@ static void ci_apply_state_adjust_rules(struct radeon_device *rdev, · 560 unmodified lines
712714 struct radeon_clock_and_voltage_limits *max_limits;
713715 bool disable_mclk_switching;
714716 u32 sclk, mclk;
717+ u32 max_sclk_vddc, max_mclk_vddci, max_mclk_vddc;
715718 int i;
716719
717720 if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
@@ -739,6 +742,29 @@ static void ci_apply_state_adjust_rules(struct radeon_device *rdev, · 21 unmodified lines
739742 }
740743 }
741744
745+ /* limit clocks to max supported clocks based on voltage dependency tables */
746+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk,
747+ &max_sclk_vddc);
748+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddci_dependency_on_mclk,
749+ &max_mclk_vddci);
750+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_mclk,
751+ &max_mclk_vddc);
752+
753+ for (i = 0; i < ps->performance_level_count; i++) {
754+ if (max_sclk_vddc) {
755+ if (ps->performance_levels[i].sclk > max_sclk_vddc)
756+ ps->performance_levels[i].sclk = max_sclk_vddc;
757+ }
758+ if (max_mclk_vddci) {
759+ if (ps->performance_levels[i].mclk > max_mclk_vddci)
760+ ps->performance_levels[i].mclk = max_mclk_vddci;
761+ }
762+ if (max_mclk_vddc) {
763+ if (ps->performance_levels[i].mclk > max_mclk_vddc)
764+ ps->performance_levels[i].mclk = max_mclk_vddc;
765+ }
766+ }
767+
742768 /* XXX validate the min clocks required for display */
743769
744770 if (disable_mclk_switching) {
@@ -4748,12 +4774,6 @@ int ci_dpm_set_power_state(struct radeon_device *rdev) · 4003 unmodified lines
47484774 if (pi->pcie_performance_request)
47494775 ci_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps);
47504776
4751− ret = ci_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
4752− if (ret) {
4753− DRM_ERROR("ci_dpm_force_performance_level failed\n");
4754− return ret;
4755− }
4756−
47574777 cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
47584778 RADEON_CG_BLOCK_MC |
47594779 RADEON_CG_BLOCK_SDMA |
drivers/gpu/drm/radeon/ci_smc.c+26−13
@@ -47,10 +47,11 @@ int ci_copy_bytes_to_smc(struct radeon_device *rdev, · 46 unmodified lines
4747 u32 smc_start_address,
4848 const u8 *src, u32 byte_count, u32 limit)
4949 {
50+ unsigned long flags;
5051 u32 data, original_data;
5152 u32 addr;
5253 u32 extra_shift;
53− int ret;
54+ int ret = 0;
5455
5556 if (smc_start_address & 3)
5657 return -EINVAL;
@@ -59,13 +60,14 @@ int ci_copy_bytes_to_smc(struct radeon_device *rdev, · 2 unmodified lines
5960
6061 addr = smc_start_address;
6162
63+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
6264 while (byte_count >= 4) {
6365 /* SMC address space is BE */
6466 data = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3];
6567
6668 ret = ci_set_smc_sram_address(rdev, addr, limit);
6769 if (ret)
68− return ret;
70+ goto done;
6971
7072 WREG32(SMC_IND_DATA_0, data);
7173
@@ -80,7 +82,7 @@ int ci_copy_bytes_to_smc(struct radeon_device *rdev, · 8 unmodified lines
8082
8183 ret = ci_set_smc_sram_address(rdev, addr, limit);
8284 if (ret)
83− return ret;
85+ goto done;
8486
8587 original_data = RREG32(SMC_IND_DATA_0);
8688
@@ -97,11 +99,15 @@ int ci_copy_bytes_to_smc(struct radeon_device *rdev, · 10 unmodified lines
9799
98100 ret = ci_set_smc_sram_address(rdev, addr, limit);
99101 if (ret)
100− return ret;
102+ goto done;
101103
102104 WREG32(SMC_IND_DATA_0, data);
103105 }
104− return 0;
106+
107+done:
108+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
109+
110+ return ret;
105111 }
106112
107113 void ci_start_smc(struct radeon_device *rdev)
@@ -197,6 +203,7 @@ PPSMC_Result ci_wait_for_smc_inactive(struct radeon_device *rdev) · 89 unmodified lines
197203
198204 int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit)
199205 {
206+ unsigned long flags;
200207 u32 ucode_start_address;
201208 u32 ucode_size;
202209 const u8 *src;
@@ -219,6 +226,7 @@ int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit) · 16 unmodified lines
219226 return -EINVAL;
220227
221228 src = (const u8 *)rdev->smc_fw->data;
229+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
222230 WREG32(SMC_IND_INDEX_0, ucode_start_address);
223231 WREG32_P(SMC_IND_ACCESS_CNTL, AUTO_INCREMENT_IND_0, ~AUTO_INCREMENT_IND_0);
224232 while (ucode_size >= 4) {
@@ -231,6 +239,7 @@ int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit) · 6 unmodified lines
231239 ucode_size -= 4;
232240 }
233241 WREG32_P(SMC_IND_ACCESS_CNTL, 0, ~AUTO_INCREMENT_IND_0);
242+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
234243
235244 return 0;
236245 }
@@ -238,25 +247,29 @@ int ci_load_smc_ucode(struct radeon_device *rdev, u32 limit) · 1 unmodified line
238247 int ci_read_smc_sram_dword(struct radeon_device *rdev,
239248 u32 smc_address, u32 *value, u32 limit)
240249 {
250+ unsigned long flags;
241251 int ret;
242252
253+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
243254 ret = ci_set_smc_sram_address(rdev, smc_address, limit);
244− if (ret)
245− return ret;
255+ if (ret == 0)
256+ *value = RREG32(SMC_IND_DATA_0);
257+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
246258
247− *value = RREG32(SMC_IND_DATA_0);
248− return 0;
259+ return ret;
249260 }
250261
251262 int ci_write_smc_sram_dword(struct radeon_device *rdev,
252263 u32 smc_address, u32 value, u32 limit)
253264 {
265+ unsigned long flags;
254266 int ret;
255267
268+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
256269 ret = ci_set_smc_sram_address(rdev, smc_address, limit);
257− if (ret)
258− return ret;
270+ if (ret == 0)
271+ WREG32(SMC_IND_DATA_0, value);
272+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
259273
260− WREG32(SMC_IND_DATA_0, value);
261− return 0;
274+ return ret;
262275 }
drivers/gpu/drm/radeon/cik.c+37−16
@@ -77,6 +77,8 @@ static void cik_pcie_gen3_enable(struct radeon_device *rdev); · 76 unmodified lines
7777 static void cik_program_aspm(struct radeon_device *rdev);
7878 static void cik_init_pg(struct radeon_device *rdev);
7979 static void cik_init_cg(struct radeon_device *rdev);
80+static void cik_enable_gui_idle_interrupt(struct radeon_device *rdev,
81+ bool enable);
8082
8183 /* get temperature in millidegrees */
8284 int ci_get_temp(struct radeon_device *rdev)
@@ -120,20 +122,27 @@ int kv_get_temp(struct radeon_device *rdev) · 37 unmodified lines
120122 */
121123 u32 cik_pciep_rreg(struct radeon_device *rdev, u32 reg)
122124 {
125+ unsigned long flags;
123126 u32 r;
124127
128+ spin_lock_irqsave(&rdev->pciep_idx_lock, flags);
125129 WREG32(PCIE_INDEX, reg);
126130 (void)RREG32(PCIE_INDEX);
127131 r = RREG32(PCIE_DATA);
132+ spin_unlock_irqrestore(&rdev->pciep_idx_lock, flags);
128133 return r;
129134 }
130135
131136 void cik_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v)
132137 {
138+ unsigned long flags;
139+
140+ spin_lock_irqsave(&rdev->pciep_idx_lock, flags);
133141 WREG32(PCIE_INDEX, reg);
134142 (void)RREG32(PCIE_INDEX);
135143 WREG32(PCIE_DATA, v);
136144 (void)RREG32(PCIE_DATA);
145+ spin_unlock_irqrestore(&rdev->pciep_idx_lock, flags);
137146 }
138147
139148 static const u32 spectre_rlc_save_restore_register_list[] =
@@ -2722,7 +2731,8 @@ static void cik_gpu_init(struct radeon_device *rdev) · 2582 unmodified lines
27222731 } else if ((rdev->pdev->device == 0x1309) ||
27232732 (rdev->pdev->device == 0x130A) ||
27242733 (rdev->pdev->device == 0x130D) ||
2725− (rdev->pdev->device == 0x1313)) {
2734+ (rdev->pdev->device == 0x1313) ||
2735+ (rdev->pdev->device == 0x131D)) {
27262736 rdev->config.cik.max_cu_per_sh = 6;
27272737 rdev->config.cik.max_backends_per_se = 2;
27282738 } else if ((rdev->pdev->device == 0x1306) ||
@@ -2835,10 +2845,8 @@ static void cik_gpu_init(struct radeon_device *rdev) · 106 unmodified lines
28352845 rdev->config.cik.tile_config |= (3 << 0);
28362846 break;
28372847 }
2838− if ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT)
2839− rdev->config.cik.tile_config |= 1 << 4;
2840− else
2841− rdev->config.cik.tile_config |= 0 << 4;
2848+ rdev->config.cik.tile_config |=
2849+ ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4;
28422850 rdev->config.cik.tile_config |=
28432851 ((gb_addr_config & PIPE_INTERLEAVE_SIZE_MASK) >> PIPE_INTERLEAVE_SIZE_SHIFT) << 8;
28442852 rdev->config.cik.tile_config |=
@@ -4013,6 +4021,8 @@ static int cik_cp_resume(struct radeon_device *rdev) · 1168 unmodified lines
40134021 {
40144022 int r;
40154023
4024+ cik_enable_gui_idle_interrupt(rdev, false);
4025+
40164026 r = cik_cp_load_microcode(rdev);
40174027 if (r)
40184028 return r;
@@ -4024,6 +4034,8 @@ static int cik_cp_resume(struct radeon_device *rdev) · 5 unmodified lines
40244034 if (r)
40254035 return r;
40264036
4037+ cik_enable_gui_idle_interrupt(rdev, true);
4038+
40274039 return 0;
40284040 }
40294041
@@ -4442,8 +4454,8 @@ static int cik_mc_init(struct radeon_device *rdev) · 412 unmodified lines
44424454 rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0);
44434455 rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0);
44444456 /* size in MB on si */
4445− rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
4446− rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
4457+ rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
4458+ rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
44474459 rdev->mc.visible_vram_size = rdev->mc.aper_size;
44484460 si_vram_gtt_location(rdev, &rdev->mc);
44494461 radeon_update_bandwidth_info(rdev);
@@ -4721,12 +4733,13 @@ static void cik_vm_decode_fault(struct radeon_device *rdev, · 271 unmodified lines
47214733 u32 mc_id = (status & MEMORY_CLIENT_ID_MASK) >> MEMORY_CLIENT_ID_SHIFT;
47224734 u32 vmid = (status & FAULT_VMID_MASK) >> FAULT_VMID_SHIFT;
47234735 u32 protections = (status & PROTECTIONS_MASK) >> PROTECTIONS_SHIFT;
4724− char *block = (char *)&mc_client;
4736+ char block[5] = { mc_client >> 24, (mc_client >> 16) & 0xff,
4737+ (mc_client >> 8) & 0xff, mc_client & 0xff, 0 };
47254738
4726− printk("VM fault (0x%02x, vmid %d) at page %u, %s from %s (%d)\n",
4739+ printk("VM fault (0x%02x, vmid %d) at page %u, %s from '%s' (0x%08x) (%d)\n",
47274740 protections, vmid, addr,
47284741 (status & MEMORY_CLIENT_RW_MASK) ? "write" : "read",
4729− block, mc_id);
4742+ block, mc_client, mc_id);
47304743 }
47314744
47324745 /**
@@ -5376,7 +5389,9 @@ static void cik_enable_hdp_ls(struct radeon_device *rdev, · 643 unmodified lines
53765389 void cik_update_cg(struct radeon_device *rdev,
53775390 u32 block, bool enable)
53785391 {
5392+
53795393 if (block & RADEON_CG_BLOCK_GFX) {
5394+ cik_enable_gui_idle_interrupt(rdev, false);
53805395 /* order matters! */
53815396 if (enable) {
53825397 cik_enable_mgcg(rdev, true);
@@ -5385,6 +5400,7 @@ void cik_update_cg(struct radeon_device *rdev, · 2 unmodified lines
53855400 cik_enable_cgcg(rdev, false);
53865401 cik_enable_mgcg(rdev, false);
53875402 }
5403+ cik_enable_gui_idle_interrupt(rdev, true);
53885404 }
53895405
53905406 if (block & RADEON_CG_BLOCK_MC) {
@@ -5541,7 +5557,7 @@ static void cik_enable_gfx_cgpg(struct radeon_device *rdev, · 150 unmodified lines
55415557 {
55425558 u32 data, orig;
55435559
5544− if (enable && (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG)) {
5560+ if (enable && (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_PG)) {
55455561 orig = data = RREG32(RLC_PG_CNTL);
55465562 data |= GFX_PG_ENABLE;
55475563 if (orig != data)
@@ -5805,7 +5821,7 @@ static void cik_init_pg(struct radeon_device *rdev) · 257 unmodified lines
58055821 if (rdev->pg_flags) {
58065822 cik_enable_sck_slowdown_on_pu(rdev, true);
58075823 cik_enable_sck_slowdown_on_pd(rdev, true);
5808− if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG) {
5824+ if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_PG) {
58095825 cik_init_gfx_cgpg(rdev);
58105826 cik_enable_cp_pg(rdev, true);
58115827 cik_enable_gds_pg(rdev, true);
@@ -5819,7 +5835,7 @@ static void cik_fini_pg(struct radeon_device *rdev) · 7 unmodified lines
58195835 {
58205836 if (rdev->pg_flags) {
58215837 cik_update_gfx_pg(rdev, false);
5822− if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG) {
5838+ if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_PG) {
58235839 cik_enable_cp_pg(rdev, false);
58245840 cik_enable_gds_pg(rdev, false);
58255841 }
@@ -5895,7 +5911,9 @@ static void cik_disable_interrupt_state(struct radeon_device *rdev) · 69 unmodified lines
58955911 u32 tmp;
58965912
58975913 /* gfx ring */
5898− WREG32(CP_INT_CNTL_RING0, CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
5914+ tmp = RREG32(CP_INT_CNTL_RING0) &
5915+ (CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
5916+ WREG32(CP_INT_CNTL_RING0, tmp);
58995917 /* sdma */
59005918 tmp = RREG32(SDMA0_CNTL + SDMA0_REGISTER_OFFSET) & ~TRAP_ENABLE;
59015919 WREG32(SDMA0_CNTL + SDMA0_REGISTER_OFFSET, tmp);
@@ -6036,8 +6054,7 @@ static int cik_irq_init(struct radeon_device *rdev) · 134 unmodified lines
60366054 */
60376055 int cik_irq_set(struct radeon_device *rdev)
60386056 {
6039− u32 cp_int_cntl = CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE |
6040− PRIV_INSTR_INT_ENABLE | PRIV_REG_INT_ENABLE;
6057+ u32 cp_int_cntl;
60416058 u32 cp_m1p0, cp_m1p1, cp_m1p2, cp_m1p3;
60426059 u32 cp_m2p0, cp_m2p1, cp_m2p2, cp_m2p3;
60436060 u32 crtc1 = 0, crtc2 = 0, crtc3 = 0, crtc4 = 0, crtc5 = 0, crtc6 = 0;
@@ -6058,6 +6075,10 @@ int cik_irq_set(struct radeon_device *rdev) · 14 unmodified lines
60586075 return 0;
60596076 }
60606077
6078+ cp_int_cntl = RREG32(CP_INT_CNTL_RING0) &
6079+ (CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
6080+ cp_int_cntl |= PRIV_INSTR_INT_ENABLE | PRIV_REG_INT_ENABLE;
6081+
60616082 hpd1 = RREG32(DC_HPD1_INT_CONTROL) & ~DC_HPDx_INT_EN;
60626083 hpd2 = RREG32(DC_HPD2_INT_CONTROL) & ~DC_HPDx_INT_EN;
60636084 hpd3 = RREG32(DC_HPD3_INT_CONTROL) & ~DC_HPDx_INT_EN;
drivers/gpu/drm/radeon/cypress_dpm.c+0−6
@@ -2014,12 +2014,6 @@ int cypress_dpm_set_power_state(struct radeon_device *rdev) · 2013 unmodified lines
20142014 if (eg_pi->pcie_performance_request)
20152015 cypress_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps);
20162016
2017− ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
2018− if (ret) {
2019− DRM_ERROR("rv770_dpm_force_performance_level failed\n");
2020− return ret;
2021− }
2022−
20232017 return 0;
20242018 }
20252019
drivers/gpu/drm/radeon/dce6_afmt.c+10−2
@@ -28,22 +28,30 @@ · 27 unmodified lines
2828 static u32 dce6_endpoint_rreg(struct radeon_device *rdev,
2929 u32 block_offset, u32 reg)
3030 {
31+ unsigned long flags;
3132 u32 r;
3233
34+ spin_lock_irqsave(&rdev->end_idx_lock, flags);
3335 WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset, reg);
3436 r = RREG32(AZ_F0_CODEC_ENDPOINT_DATA + block_offset);
37+ spin_unlock_irqrestore(&rdev->end_idx_lock, flags);
38+
3539 return r;
3640 }
3741
3842 static void dce6_endpoint_wreg(struct radeon_device *rdev,
3943 u32 block_offset, u32 reg, u32 v)
4044 {
45+ unsigned long flags;
46+
47+ spin_lock_irqsave(&rdev->end_idx_lock, flags);
4148 if (ASIC_IS_DCE8(rdev))
4249 WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset, reg);
4350 else
4451 WREG32(AZ_F0_CODEC_ENDPOINT_INDEX + block_offset,
4552 AZ_ENDPOINT_REG_WRITE_EN | AZ_ENDPOINT_REG_INDEX(reg));
4653 WREG32(AZ_F0_CODEC_ENDPOINT_DATA + block_offset, v);
54+ spin_unlock_irqrestore(&rdev->end_idx_lock, flags);
4755 }
4856
4957 #define RREG32_ENDPOINT(block, reg) dce6_endpoint_rreg(rdev, (block), (reg))
@@ -86,12 +94,12 @@ void dce6_afmt_select_pin(struct drm_encoder *encoder) · 36 unmodified lines
8694 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
8795 struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
8896 u32 offset = dig->afmt->offset;
89− u32 id = dig->afmt->pin->id;
9097
9198 if (!dig->afmt->pin)
9299 return;
93100
94− WREG32(AFMT_AUDIO_SRC_CONTROL + offset, AFMT_AUDIO_SRC_SELECT(id));
101+ WREG32(AFMT_AUDIO_SRC_CONTROL + offset,
102+ AFMT_AUDIO_SRC_SELECT(dig->afmt->pin->id));
95103 }
96104
97105 void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder)
drivers/gpu/drm/radeon/kv_dpm.c+129−35
@@ -40,6 +40,7 @@ static int kv_calculate_dpm_settings(struct radeon_device *rdev); · 39 unmodified lines
4040 static void kv_enable_new_levels(struct radeon_device *rdev);
4141 static void kv_program_nbps_index_settings(struct radeon_device *rdev,
4242 struct radeon_ps *new_rps);
43+static int kv_set_enabled_level(struct radeon_device *rdev, u32 level);
4344 static int kv_set_enabled_levels(struct radeon_device *rdev);
4445 static int kv_force_dpm_highest(struct radeon_device *rdev);
4546 static int kv_force_dpm_lowest(struct radeon_device *rdev);
@@ -519,7 +520,7 @@ static int kv_set_dpm_boot_state(struct radeon_device *rdev) · 473 unmodified lines
519520
520521 static void kv_program_vc(struct radeon_device *rdev)
521522 {
522− WREG32_SMC(CG_FTV_0, 0x3FFFC000);
523+ WREG32_SMC(CG_FTV_0, 0x3FFFC100);
523524 }
524525
525526 static void kv_clear_vc(struct radeon_device *rdev)
@@ -638,7 +639,10 @@ static int kv_force_lowest_valid(struct radeon_device *rdev) · 112 unmodified lines
638639
639640 static int kv_unforce_levels(struct radeon_device *rdev)
640641 {
641− return kv_notify_message_to_smu(rdev, PPSMC_MSG_NoForcedLevel);
642+ if (rdev->family == CHIP_KABINI)
643+ return kv_notify_message_to_smu(rdev, PPSMC_MSG_NoForcedLevel);
644+ else
645+ return kv_set_enabled_levels(rdev);
642646 }
643647
644648 static int kv_update_sclk_t(struct radeon_device *rdev)
@@ -667,9 +671,8 @@ static int kv_program_bootup_state(struct radeon_device *rdev) · 22 unmodified lines
667671 &rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk;
668672
669673 if (table && table->count) {
670− for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) {
671− if ((table->entries[i].clk == pi->boot_pl.sclk) ||
672− (i == 0))
674+ for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) {
675+ if (table->entries[i].clk == pi->boot_pl.sclk)
673676 break;
674677 }
675678
@@ -682,9 +685,8 @@ static int kv_program_bootup_state(struct radeon_device *rdev) · 6 unmodified lines
682685 if (table->num_max_dpm_entries == 0)
683686 return -EINVAL;
684687
685− for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) {
686− if ((table->entries[i].sclk_frequency == pi->boot_pl.sclk) ||
687− (i == 0))
688+ for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) {
689+ if (table->entries[i].sclk_frequency == pi->boot_pl.sclk)
688690 break;
689691 }
690692
@@ -1078,6 +1080,13 @@ static int kv_enable_ulv(struct radeon_device *rdev, bool enable) · 387 unmodified lines
10781080 PPSMC_MSG_EnableULV : PPSMC_MSG_DisableULV);
10791081 }
10801082
1083+static void kv_reset_acp_boot_level(struct radeon_device *rdev)
1084+{
1085+ struct kv_power_info *pi = kv_get_pi(rdev);
1086+
1087+ pi->acp_boot_level = 0xff;
1088+}
1089+
10811090 static void kv_update_current_ps(struct radeon_device *rdev,
10821091 struct radeon_ps *rps)
10831092 {
@@ -1100,6 +1109,18 @@ static void kv_update_requested_ps(struct radeon_device *rdev, · 16 unmodified lines
11001109 pi->requested_rps.ps_priv = &pi->requested_ps;
11011110 }
11021111
1112+void kv_dpm_enable_bapm(struct radeon_device *rdev, bool enable)
1113+{
1114+ struct kv_power_info *pi = kv_get_pi(rdev);
1115+ int ret;
1116+
1117+ if (pi->bapm_enable) {
1118+ ret = kv_smc_bapm_enable(rdev, enable);
1119+ if (ret)
1120+ DRM_ERROR("kv_smc_bapm_enable failed\n");
1121+ }
1122+}
1123+
11031124 int kv_dpm_enable(struct radeon_device *rdev)
11041125 {
11051126 struct kv_power_info *pi = kv_get_pi(rdev);
@@ -1192,6 +1213,8 @@ int kv_dpm_enable(struct radeon_device *rdev) · 86 unmodified lines
11921213 return ret;
11931214 }
11941215
1216+ kv_reset_acp_boot_level(rdev);
1217+
11951218 if (rdev->irq.installed &&
11961219 r600_is_internal_thermal_sensor(rdev->pm.int_thermal_type)) {
11971220 ret = kv_set_thermal_temperature_range(rdev, R600_TEMP_RANGE_MIN, R600_TEMP_RANGE_MAX);
@@ -1203,6 +1226,12 @@ int kv_dpm_enable(struct radeon_device *rdev) · 5 unmodified lines
12031226 radeon_irq_set(rdev);
12041227 }
12051228
1229+ ret = kv_smc_bapm_enable(rdev, false);
1230+ if (ret) {
1231+ DRM_ERROR("kv_smc_bapm_enable failed\n");
1232+ return ret;
1233+ }
1234+
12061235 /* powerdown unused blocks for now */
12071236 kv_dpm_powergate_acp(rdev, true);
12081237 kv_dpm_powergate_samu(rdev, true);
@@ -1226,6 +1255,8 @@ void kv_dpm_disable(struct radeon_device *rdev) · 17 unmodified lines
12261255 RADEON_CG_BLOCK_BIF |
12271256 RADEON_CG_BLOCK_HDP), false);
12281257
1258+ kv_smc_bapm_enable(rdev, false);
1259+
12291260 /* powerup blocks */
12301261 kv_dpm_powergate_acp(rdev, false);
12311262 kv_dpm_powergate_samu(rdev, false);
@@ -1450,6 +1481,39 @@ static int kv_update_samu_dpm(struct radeon_device *rdev, bool gate) · 218 unmodified lines
14501481 return kv_enable_samu_dpm(rdev, !gate);
14511482 }
14521483
1484+static u8 kv_get_acp_boot_level(struct radeon_device *rdev)
1485+{
1486+ u8 i;
1487+ struct radeon_clock_voltage_dependency_table *table =
1488+ &rdev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
1489+
1490+ for (i = 0; i < table->count; i++) {
1491+ if (table->entries[i].clk >= 0) /* XXX */
1492+ break;
1493+ }
1494+
1495+ if (i >= table->count)
1496+ i = table->count - 1;
1497+
1498+ return i;
1499+}
1500+
1501+static void kv_update_acp_boot_level(struct radeon_device *rdev)
1502+{
1503+ struct kv_power_info *pi = kv_get_pi(rdev);
1504+ u8 acp_boot_level;
1505+
1506+ if (!pi->caps_stable_p_state) {
1507+ acp_boot_level = kv_get_acp_boot_level(rdev);
1508+ if (acp_boot_level != pi->acp_boot_level) {
1509+ pi->acp_boot_level = acp_boot_level;
1510+ kv_send_msg_to_smc_with_parameter(rdev,
1511+ PPSMC_MSG_ACPDPM_SetEnabledMask,
1512+ (1 << pi->acp_boot_level));
1513+ }
1514+ }
1515+}
1516+
14531517 static int kv_update_acp_dpm(struct radeon_device *rdev, bool gate)
14541518 {
14551519 struct kv_power_info *pi = kv_get_pi(rdev);
@@ -1461,7 +1525,7 @@ static int kv_update_acp_dpm(struct radeon_device *rdev, bool gate) · 5 unmodified lines
14611525 if (pi->caps_stable_p_state)
14621526 pi->acp_boot_level = table->count - 1;
14631527 else
1464− pi->acp_boot_level = 0;
1528+ pi->acp_boot_level = kv_get_acp_boot_level(rdev);
14651529
14661530 ret = kv_copy_bytes_to_smc(rdev,
14671531 pi->dpm_table_start +
@@ -1588,13 +1652,11 @@ static void kv_set_valid_clock_range(struct radeon_device *rdev, · 120 unmodified lines
15881652 }
15891653 }
15901654
1591− for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) {
1592− if ((table->entries[i].clk <= new_ps->levels[new_ps->num_levels -1].sclk) ||
1593− (i == 0)) {
1594− pi->highest_valid = i;
1655+ for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) {
1656+ if (table->entries[i].clk <= new_ps->levels[new_ps->num_levels - 1].sclk)
15951657 break;
1596− }
15971658 }
1659+ pi->highest_valid = i;
15981660
15991661 if (pi->lowest_valid > pi->highest_valid) {
16001662 if ((new_ps->levels[0].sclk - table->entries[pi->highest_valid].clk) >
@@ -1615,14 +1677,12 @@ static void kv_set_valid_clock_range(struct radeon_device *rdev, · 14 unmodified lines
16151677 }
16161678 }
16171679
1618− for (i = pi->graphics_dpm_level_count - 1; i >= 0; i--) {
1680+ for (i = pi->graphics_dpm_level_count - 1; i > 0; i--) {
16191681 if (table->entries[i].sclk_frequency <=
1620− new_ps->levels[new_ps->num_levels - 1].sclk ||
1621− i == 0) {
1622− pi->highest_valid = i;
1682+ new_ps->levels[new_ps->num_levels - 1].sclk)
16231683 break;
1624− }
16251684 }
1685+ pi->highest_valid = i;
16261686
16271687 if (pi->lowest_valid > pi->highest_valid) {
16281688 if ((new_ps->levels[0].sclk -
@@ -1724,6 +1784,14 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) · 95 unmodified lines
17241784 RADEON_CG_BLOCK_BIF |
17251785 RADEON_CG_BLOCK_HDP), false);
17261786
1787+ if (pi->bapm_enable) {
1788+ ret = kv_smc_bapm_enable(rdev, rdev->pm.dpm.ac_power);
1789+ if (ret) {
1790+ DRM_ERROR("kv_smc_bapm_enable failed\n");
1791+ return ret;
1792+ }
1793+ }
1794+
17271795 if (rdev->family == CHIP_KABINI) {
17281796 if (pi->enable_dpm) {
17291797 kv_set_valid_clock_range(rdev, new_ps);
@@ -1775,6 +1843,7 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) · 45 unmodified lines
17751843 return ret;
17761844 }
17771845 #endif
1846+ kv_update_acp_boot_level(rdev);
17781847 kv_update_sclk_t(rdev);
17791848 kv_enable_nb_dpm(rdev);
17801849 }
@@ -1785,7 +1854,6 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) · 4 unmodified lines
17851854 RADEON_CG_BLOCK_BIF |
17861855 RADEON_CG_BLOCK_HDP), true);
17871856
1788− rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO;
17891857 return 0;
17901858 }
17911859
@@ -1806,12 +1874,23 @@ void kv_dpm_setup_asic(struct radeon_device *rdev) · 14 unmodified lines
18061874
18071875 void kv_dpm_reset_asic(struct radeon_device *rdev)
18081876 {
1809− kv_force_lowest_valid(rdev);
1810− kv_init_graphics_levels(rdev);
1811− kv_program_bootup_state(rdev);
1812− kv_upload_dpm_settings(rdev);
1813− kv_force_lowest_valid(rdev);
1814− kv_unforce_levels(rdev);
1877+ struct kv_power_info *pi = kv_get_pi(rdev);
1878+
1879+ if (rdev->family == CHIP_KABINI) {
1880+ kv_force_lowest_valid(rdev);
1881+ kv_init_graphics_levels(rdev);
1882+ kv_program_bootup_state(rdev);
1883+ kv_upload_dpm_settings(rdev);
1884+ kv_force_lowest_valid(rdev);
1885+ kv_unforce_levels(rdev);
1886+ } else {
1887+ kv_init_graphics_levels(rdev);
1888+ kv_program_bootup_state(rdev);
1889+ kv_freeze_sclk_dpm(rdev, true);
1890+ kv_upload_dpm_settings(rdev);
1891+ kv_freeze_sclk_dpm(rdev, false);
1892+ kv_set_enabled_level(rdev, pi->graphics_boot_level);
1893+ }
18151894 }
18161895
18171896 //XXX use sumo_dpm_display_configuration_changed
@@ -1871,12 +1950,15 @@ static int kv_force_dpm_highest(struct radeon_device *rdev) · 53 unmodified lines
18711950 if (ret)
18721951 return ret;
18731952
1874− for (i = SMU7_MAX_LEVELS_GRAPHICS - 1; i >= 0; i--) {
1953+ for (i = SMU7_MAX_LEVELS_GRAPHICS - 1; i > 0; i--) {
18751954 if (enable_mask & (1 << i))
18761955 break;
18771956 }
18781957
1879− return kv_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_DPM_ForceState, i);
1958+ if (rdev->family == CHIP_KABINI)
1959+ return kv_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_DPM_ForceState, i);
1960+ else
1961+ return kv_set_enabled_level(rdev, i);
18801962 }
18811963
18821964 static int kv_force_dpm_lowest(struct radeon_device *rdev)
@@ -1893,7 +1975,10 @@ static int kv_force_dpm_lowest(struct radeon_device *rdev) · 10 unmodified lines
18931975 break;
18941976 }
18951977
1896− return kv_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_DPM_ForceState, i);
1978+ if (rdev->family == CHIP_KABINI)
1979+ return kv_send_msg_to_smc_with_parameter(rdev, PPSMC_MSG_DPM_ForceState, i);
1980+ else
1981+ return kv_set_enabled_level(rdev, i);
18971982 }
18981983
18991984 static u8 kv_get_sleep_divider_id_from_clock(struct radeon_device *rdev,
@@ -1911,9 +1996,9 @@ static u8 kv_get_sleep_divider_id_from_clock(struct radeon_device *rdev, · 11 unmodified lines
19111996 if (!pi->caps_sclk_ds)
19121997 return 0;
19131998
1914− for (i = KV_MAX_DEEPSLEEP_DIVIDER_ID; i <= 0; i--) {
1999+ for (i = KV_MAX_DEEPSLEEP_DIVIDER_ID; i > 0; i--) {
19152000 temp = sclk / sumo_get_sleep_divider_from_id(i);
1916− if ((temp >= min) || (i == 0))
2001+ if (temp >= min)
19172002 break;
19182003 }
19192004
@@ -2039,12 +2124,12 @@ static void kv_apply_state_adjust_rules(struct radeon_device *rdev, · 119 unmodified lines
20392124 ps->dpmx_nb_ps_lo = 0x1;
20402125 ps->dpmx_nb_ps_hi = 0x0;
20412126 } else {
2042− ps->dpm0_pg_nb_ps_lo = 0x1;
2127+ ps->dpm0_pg_nb_ps_lo = 0x3;
20432128 ps->dpm0_pg_nb_ps_hi = 0x0;
2044− ps->dpmx_nb_ps_lo = 0x2;
2045− ps->dpmx_nb_ps_hi = 0x1;
2129+ ps->dpmx_nb_ps_lo = 0x3;
2130+ ps->dpmx_nb_ps_hi = 0x0;
20462131
2047− if (pi->sys_info.nb_dpm_enable && pi->battery_state) {
2132+ if (pi->sys_info.nb_dpm_enable) {
20482133 force_high = (mclk >= pi->sys_info.nbp_memory_clock[3]) ||
20492134 pi->video_start || (rdev->pm.dpm.new_active_crtc_count >= 3) ||
20502135 pi->disable_nb_ps3_in_battery;
@@ -2210,6 +2295,15 @@ static void kv_enable_new_levels(struct radeon_device *rdev) · 159 unmodified lines
22102295 }
22112296 }
22122297
2298+static int kv_set_enabled_level(struct radeon_device *rdev, u32 level)
2299+{
2300+ u32 new_mask = (1 << level);
2301+
2302+ return kv_send_msg_to_smc_with_parameter(rdev,
2303+ PPSMC_MSG_SCLKDPM_SetEnabledMask,
2304+ new_mask);
2305+}
2306+
22132307 static int kv_set_enabled_levels(struct radeon_device *rdev)
22142308 {
22152309 struct kv_power_info *pi = kv_get_pi(rdev);
drivers/gpu/drm/radeon/kv_dpm.h+1−0
@@ -192,6 +192,7 @@ int kv_send_msg_to_smc_with_parameter(struct radeon_device *rdev, · 191 unmodified lines
192192 int kv_read_smc_sram_dword(struct radeon_device *rdev, u32 smc_address,
193193 u32 *value, u32 limit);
194194 int kv_smc_dpm_enable(struct radeon_device *rdev, bool enable);
195+int kv_smc_bapm_enable(struct radeon_device *rdev, bool enable);
195196 int kv_copy_bytes_to_smc(struct radeon_device *rdev,
196197 u32 smc_start_address,
197198 const u8 *src, u32 byte_count, u32 limit);
drivers/gpu/drm/radeon/kv_smc.c+8−0
@@ -107,6 +107,14 @@ int kv_smc_dpm_enable(struct radeon_device *rdev, bool enable) · 106 unmodified lines
107107 return kv_notify_message_to_smu(rdev, PPSMC_MSG_DPM_Disable);
108108 }
109109
110+int kv_smc_bapm_enable(struct radeon_device *rdev, bool enable)
111+{
112+ if (enable)
113+ return kv_notify_message_to_smu(rdev, PPSMC_MSG_EnableBAPM);
114+ else
115+ return kv_notify_message_to_smu(rdev, PPSMC_MSG_DisableBAPM);
116+}
117+
110118 int kv_copy_bytes_to_smc(struct radeon_device *rdev,
111119 u32 smc_start_address,
112120 const u8 *src, u32 byte_count, u32 limit)
drivers/gpu/drm/radeon/ni_dpm.c+24−6
@@ -787,6 +787,7 @@ static void ni_apply_state_adjust_rules(struct radeon_device *rdev, · 786 unmodified lines
787787 bool disable_mclk_switching;
788788 u32 mclk, sclk;
789789 u16 vddc, vddci;
790+ u32 max_sclk_vddc, max_mclk_vddci, max_mclk_vddc;
790791 int i;
791792
792793 if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
@@ -813,6 +814,29 @@ static void ni_apply_state_adjust_rules(struct radeon_device *rdev, · 20 unmodified lines
813814 }
814815 }
815816
817+ /* limit clocks to max supported clocks based on voltage dependency tables */
818+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk,
819+ &max_sclk_vddc);
820+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddci_dependency_on_mclk,
821+ &max_mclk_vddci);
822+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_mclk,
823+ &max_mclk_vddc);
824+
825+ for (i = 0; i < ps->performance_level_count; i++) {
826+ if (max_sclk_vddc) {
827+ if (ps->performance_levels[i].sclk > max_sclk_vddc)
828+ ps->performance_levels[i].sclk = max_sclk_vddc;
829+ }
830+ if (max_mclk_vddci) {
831+ if (ps->performance_levels[i].mclk > max_mclk_vddci)
832+ ps->performance_levels[i].mclk = max_mclk_vddci;
833+ }
834+ if (max_mclk_vddc) {
835+ if (ps->performance_levels[i].mclk > max_mclk_vddc)
836+ ps->performance_levels[i].mclk = max_mclk_vddc;
837+ }
838+ }
839+
816840 /* XXX validate the min clocks required for display */
817841
818842 if (disable_mclk_switching) {
@@ -3865,12 +3889,6 @@ int ni_dpm_set_power_state(struct radeon_device *rdev) · 3046 unmodified lines
38653889 return ret;
38663890 }
38673891
3868− ret = ni_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
3869− if (ret) {
3870− DRM_ERROR("ni_dpm_force_performance_level failed\n");
3871− return ret;
3872− }
3873−
38743892 return 0;
38753893 }
38763894
drivers/gpu/drm/radeon/ppsmc.h+2−0
@@ -163,6 +163,8 @@ typedef uint8_t PPSMC_Result; · 162 unmodified lines
163163 #define PPSMC_MSG_VCEPowerON ((uint32_t) 0x10f)
164164 #define PPSMC_MSG_DCE_RemoveVoltageAdjustment ((uint32_t) 0x11d)
165165 #define PPSMC_MSG_DCE_AllowVoltageAdjustment ((uint32_t) 0x11e)
166+#define PPSMC_MSG_EnableBAPM ((uint32_t) 0x120)
167+#define PPSMC_MSG_DisableBAPM ((uint32_t) 0x121)
166168 #define PPSMC_MSG_UVD_DPM_Config ((uint32_t) 0x124)
167169
168170
drivers/gpu/drm/radeon/r100.c+12−3
@@ -2853,21 +2853,28 @@ static void r100_pll_errata_after_data(struct radeon_device *rdev) · 2852 unmodified lines
28532853
28542854 uint32_t r100_pll_rreg(struct radeon_device *rdev, uint32_t reg)
28552855 {
2856+ unsigned long flags;
28562857 uint32_t data;
28572858
2859+ spin_lock_irqsave(&rdev->pll_idx_lock, flags);
28582860 WREG8(RADEON_CLOCK_CNTL_INDEX, reg & 0x3f);
28592861 r100_pll_errata_after_index(rdev);
28602862 data = RREG32(RADEON_CLOCK_CNTL_DATA);
28612863 r100_pll_errata_after_data(rdev);
2864+ spin_unlock_irqrestore(&rdev->pll_idx_lock, flags);
28622865 return data;
28632866 }
28642867
28652868 void r100_pll_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
28662869 {
2870+ unsigned long flags;
2871+
2872+ spin_lock_irqsave(&rdev->pll_idx_lock, flags);
28672873 WREG8(RADEON_CLOCK_CNTL_INDEX, ((reg & 0x3f) | RADEON_PLL_WR_EN));
28682874 r100_pll_errata_after_index(rdev);
28692875 WREG32(RADEON_CLOCK_CNTL_DATA, v);
28702876 r100_pll_errata_after_data(rdev);
2877+ spin_unlock_irqrestore(&rdev->pll_idx_lock, flags);
28712878 }
28722879
28732880 static void r100_set_safe_registers(struct radeon_device *rdev)
@@ -2926,9 +2933,11 @@ static int r100_debugfs_cp_ring_info(struct seq_file *m, void *data) · 52 unmodified lines
29262933 seq_printf(m, "CP_RB_RPTR 0x%08x\n", rdp);
29272934 seq_printf(m, "%u free dwords in ring\n", ring->ring_free_dw);
29282935 seq_printf(m, "%u dwords in ring\n", count);
2929− for (j = 0; j <= count; j++) {
2930− i = (rdp + j) & ring->ptr_mask;
2931− seq_printf(m, "r[%04d]=0x%08x\n", i, ring->ring[i]);
2936+ if (ring->ready) {
2937+ for (j = 0; j <= count; j++) {
2938+ i = (rdp + j) & ring->ptr_mask;
2939+ seq_printf(m, "r[%04d]=0x%08x\n", i, ring->ring[i]);
2940+ }
29322941 }
29332942 return 0;
29342943 }
drivers/gpu/drm/radeon/r420.c+7−0
@@ -160,18 +160,25 @@ void r420_pipes_init(struct radeon_device *rdev) · 159 unmodified lines
160160
161161 u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg)
162162 {
163+ unsigned long flags;
163164 u32 r;
164165
166+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
165167 WREG32(R_0001F8_MC_IND_INDEX, S_0001F8_MC_IND_ADDR(reg));
166168 r = RREG32(R_0001FC_MC_IND_DATA);
169+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
167170 return r;
168171 }
169172
170173 void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v)
171174 {
175+ unsigned long flags;
176+
177+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
172178 WREG32(R_0001F8_MC_IND_INDEX, S_0001F8_MC_IND_ADDR(reg) |
173179 S_0001F8_MC_IND_WR_EN(1));
174180 WREG32(R_0001FC_MC_IND_DATA, v);
181+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
175182 }
176183
177184 static void r420_debugfs(struct radeon_device *rdev)
drivers/gpu/drm/radeon/r600.c+19−0
@@ -119,6 +119,11 @@ u32 r600_get_xclk(struct radeon_device *rdev) · 118 unmodified lines
119119 return rdev->clock.spll.reference_freq;
120120 }
121121
122+int r600_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk)
123+{
124+ return 0;
125+}
126+
122127 /* get temperature in millidegrees */
123128 int rv6xx_get_temp(struct radeon_device *rdev)
124129 {
@@ -1045,20 +1050,27 @@ int r600_mc_wait_for_idle(struct radeon_device *rdev) · 920 unmodified lines
10451050
10461051 uint32_t rs780_mc_rreg(struct radeon_device *rdev, uint32_t reg)
10471052 {
1053+ unsigned long flags;
10481054 uint32_t r;
10491055
1056+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
10501057 WREG32(R_0028F8_MC_INDEX, S_0028F8_MC_IND_ADDR(reg));
10511058 r = RREG32(R_0028FC_MC_DATA);
10521059 WREG32(R_0028F8_MC_INDEX, ~C_0028F8_MC_IND_ADDR);
1060+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
10531061 return r;
10541062 }
10551063
10561064 void rs780_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
10571065 {
1066+ unsigned long flags;
1067+
1068+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
10581069 WREG32(R_0028F8_MC_INDEX, S_0028F8_MC_IND_ADDR(reg) |
10591070 S_0028F8_MC_IND_WR_EN(1));
10601071 WREG32(R_0028FC_MC_DATA, v);
10611072 WREG32(R_0028F8_MC_INDEX, 0x7F);
1073+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
10621074 }
10631075
10641076 static void r600_mc_program(struct radeon_device *rdev)
@@ -2092,20 +2104,27 @@ static void r600_gpu_init(struct radeon_device *rdev) · 1027 unmodified lines
20922104 */
20932105 u32 r600_pciep_rreg(struct radeon_device *rdev, u32 reg)
20942106 {
2107+ unsigned long flags;
20952108 u32 r;
20962109
2110+ spin_lock_irqsave(&rdev->pciep_idx_lock, flags);
20972111 WREG32(PCIE_PORT_INDEX, ((reg) & 0xff));
20982112 (void)RREG32(PCIE_PORT_INDEX);
20992113 r = RREG32(PCIE_PORT_DATA);
2114+ spin_unlock_irqrestore(&rdev->pciep_idx_lock, flags);
21002115 return r;
21012116 }
21022117
21032118 void r600_pciep_wreg(struct radeon_device *rdev, u32 reg, u32 v)
21042119 {
2120+ unsigned long flags;
2121+
2122+ spin_lock_irqsave(&rdev->pciep_idx_lock, flags);
21052123 WREG32(PCIE_PORT_INDEX, ((reg) & 0xff));
21062124 (void)RREG32(PCIE_PORT_INDEX);
21072125 WREG32(PCIE_PORT_DATA, (v));
21082126 (void)RREG32(PCIE_PORT_DATA);
2127+ spin_unlock_irqrestore(&rdev->pciep_idx_lock, flags);
21092128 }
21102129
21112130 /*
drivers/gpu/drm/radeon/r600_dpm.c+15−25
@@ -1084,7 +1084,7 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) · 1083 unmodified lines
10841084 rdev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.entries[i].dclk =
10851085 le16_to_cpu(uvd_clk->usDClkLow) | (uvd_clk->ucDClkHigh << 16);
10861086 rdev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.entries[i].v =
1087− le16_to_cpu(limits->entries[i].usVoltage);
1087+ le16_to_cpu(entry->usVoltage);
10881088 entry = (ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record *)
10891089 ((u8 *)entry + sizeof(ATOM_PPLIB_UVD_Clock_Voltage_Limit_Record));
10901090 }
@@ -1219,30 +1219,20 @@ int r600_parse_extended_power_table(struct radeon_device *rdev) · 128 unmodified lines
12191219
12201220 void r600_free_extended_power_table(struct radeon_device *rdev)
12211221 {
1222− if (rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk.entries)
1223− kfree(rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk.entries);
1224− if (rdev->pm.dpm.dyn_state.vddci_dependency_on_mclk.entries)
1225− kfree(rdev->pm.dpm.dyn_state.vddci_dependency_on_mclk.entries);
1226− if (rdev->pm.dpm.dyn_state.vddc_dependency_on_mclk.entries)
1227− kfree(rdev->pm.dpm.dyn_state.vddc_dependency_on_mclk.entries);
1228− if (rdev->pm.dpm.dyn_state.mvdd_dependency_on_mclk.entries)
1229− kfree(rdev->pm.dpm.dyn_state.mvdd_dependency_on_mclk.entries);
1230− if (rdev->pm.dpm.dyn_state.cac_leakage_table.entries)
1231− kfree(rdev->pm.dpm.dyn_state.cac_leakage_table.entries);
1232− if (rdev->pm.dpm.dyn_state.phase_shedding_limits_table.entries)
1233− kfree(rdev->pm.dpm.dyn_state.phase_shedding_limits_table.entries);
1234− if (rdev->pm.dpm.dyn_state.ppm_table)
1235− kfree(rdev->pm.dpm.dyn_state.ppm_table);
1236− if (rdev->pm.dpm.dyn_state.cac_tdp_table)
1237− kfree(rdev->pm.dpm.dyn_state.cac_tdp_table);
1238− if (rdev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table.entries)
1239− kfree(rdev->pm.dpm.dyn_state.vce_clock_voltage_dependency_table.entries);
1240− if (rdev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.entries)
1241− kfree(rdev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.entries);
1242− if (rdev->pm.dpm.dyn_state.samu_clock_voltage_dependency_table.entries)
1243− kfree(rdev->pm.dpm.dyn_state.samu_clock_voltage_dependency_table.entries);
1244− if (rdev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table.entries)
1245− kfree(rdev->pm.dpm.dyn_state.acp_clock_voltage_dependency_table.entries);
1222+ struct radeon_dpm_dynamic_state *dyn_state = &rdev->pm.dpm.dyn_state;
1223+
1224+ kfree(dyn_state->vddc_dependency_on_sclk.entries);
1225+ kfree(dyn_state->vddci_dependency_on_mclk.entries);
1226+ kfree(dyn_state->vddc_dependency_on_mclk.entries);
1227+ kfree(dyn_state->mvdd_dependency_on_mclk.entries);
1228+ kfree(dyn_state->cac_leakage_table.entries);
1229+ kfree(dyn_state->phase_shedding_limits_table.entries);
1230+ kfree(dyn_state->ppm_table);
1231+ kfree(dyn_state->cac_tdp_table);
1232+ kfree(dyn_state->vce_clock_voltage_dependency_table.entries);
1233+ kfree(dyn_state->uvd_clock_voltage_dependency_table.entries);
1234+ kfree(dyn_state->samu_clock_voltage_dependency_table.entries);
1235+ kfree(dyn_state->acp_clock_voltage_dependency_table.entries);
12461236 }
12471237
12481238 enum radeon_pcie_gen r600_get_pcie_gen_support(struct radeon_device *rdev,
drivers/gpu/drm/radeon/r600_hdmi.c+15−5
@@ -257,10 +257,7 @@ void r600_audio_set_dto(struct drm_encoder *encoder, u32 clock) · 256 unmodified lines
257257 * number (coefficient of two integer numbers. DCCG_AUDIO_DTOx_PHASE
258258 * is the numerator, DCCG_AUDIO_DTOx_MODULE is the denominator
259259 */
260− if (ASIC_IS_DCE3(rdev)) {
261− /* according to the reg specs, this should DCE3.2 only, but in
262− * practice it seems to cover DCE3.0 as well.
263− */
260+ if (ASIC_IS_DCE32(rdev)) {
264261 if (dig->dig_encoder == 0) {
265262 dto_cntl = RREG32(DCCG_AUDIO_DTO0_CNTL) & ~DCCG_AUDIO_DTO_WALLCLOCK_RATIO_MASK;
266263 dto_cntl |= DCCG_AUDIO_DTO_WALLCLOCK_RATIO(wallclock_ratio);
@@ -276,8 +273,21 @@ void r600_audio_set_dto(struct drm_encoder *encoder, u32 clock) · 9 unmodified lines
276273 WREG32(DCCG_AUDIO_DTO1_MODULE, dto_modulo);
277274 WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */
278275 }
276+ } else if (ASIC_IS_DCE3(rdev)) {
277+ /* according to the reg specs, this should DCE3.2 only, but in
278+ * practice it seems to cover DCE3.0/3.1 as well.
279+ */
280+ if (dig->dig_encoder == 0) {
281+ WREG32(DCCG_AUDIO_DTO0_PHASE, base_rate * 100);
282+ WREG32(DCCG_AUDIO_DTO0_MODULE, clock * 100);
283+ WREG32(DCCG_AUDIO_DTO_SELECT, 0); /* select DTO0 */
284+ } else {
285+ WREG32(DCCG_AUDIO_DTO1_PHASE, base_rate * 100);
286+ WREG32(DCCG_AUDIO_DTO1_MODULE, clock * 100);
287+ WREG32(DCCG_AUDIO_DTO_SELECT, 1); /* select DTO1 */
288+ }
279289 } else {
280− /* according to the reg specs, this should be DCE2.0 and DCE3.0 */
290+ /* according to the reg specs, this should be DCE2.0 and DCE3.0/3.1 */
281291 WREG32(AUDIO_DTO, AUDIO_DTO_PHASE(base_rate / 10) |
282292 AUDIO_DTO_MODULE(clock / 10));
283293 }
drivers/gpu/drm/radeon/r600d.h+1−1
@@ -1040,7 +1040,7 @@ · 1039 unmodified lines
10401040 # define HDMI0_AVI_INFO_CONT (1 << 1)
10411041 # define HDMI0_AUDIO_INFO_SEND (1 << 4)
10421042 # define HDMI0_AUDIO_INFO_CONT (1 << 5)
1043−# define HDMI0_AUDIO_INFO_SOURCE (1 << 6) /* 0 - sound block; 1 - hmdi regs */
1043+# define HDMI0_AUDIO_INFO_SOURCE (1 << 6) /* 0 - sound block; 1 - hdmi regs */
10441044 # define HDMI0_AUDIO_INFO_UPDATE (1 << 7)
10451045 # define HDMI0_MPEG_INFO_SEND (1 << 8)
10461046 # define HDMI0_MPEG_INFO_CONT (1 << 9)
drivers/gpu/drm/radeon/radeon.h+81−1
@@ -181,7 +181,7 @@ extern int radeon_aspm; · 180 unmodified lines
181181 #define RADEON_CG_SUPPORT_HDP_MGCG (1 << 16)
182182
183183 /* PG flags */
184−#define RADEON_PG_SUPPORT_GFX_CG (1 << 0)
184+#define RADEON_PG_SUPPORT_GFX_PG (1 << 0)
185185 #define RADEON_PG_SUPPORT_GFX_SMG (1 << 1)
186186 #define RADEON_PG_SUPPORT_GFX_DMG (1 << 2)
187187 #define RADEON_PG_SUPPORT_UVD (1 << 3)
@@ -1778,6 +1778,7 @@ struct radeon_asic { · 1590 unmodified lines
17781778 int (*force_performance_level)(struct radeon_device *rdev, enum radeon_dpm_forced_level level);
17791779 bool (*vblank_too_short)(struct radeon_device *rdev);
17801780 void (*powergate_uvd)(struct radeon_device *rdev, bool gate);
1781+ void (*enable_bapm)(struct radeon_device *rdev, bool enable);
17811782 } dpm;
17821783 /* pageflipping */
17831784 struct {
@@ -2110,6 +2111,28 @@ struct radeon_device { · 326 unmodified lines
21102111 resource_size_t rmmio_size;
21112112 /* protects concurrent MM_INDEX/DATA based register access */
21122113 spinlock_t mmio_idx_lock;
2114+ /* protects concurrent SMC based register access */
2115+ spinlock_t smc_idx_lock;
2116+ /* protects concurrent PLL register access */
2117+ spinlock_t pll_idx_lock;
2118+ /* protects concurrent MC register access */
2119+ spinlock_t mc_idx_lock;
2120+ /* protects concurrent PCIE register access */
2121+ spinlock_t pcie_idx_lock;
2122+ /* protects concurrent PCIE_PORT register access */
2123+ spinlock_t pciep_idx_lock;
2124+ /* protects concurrent PIF register access */
2125+ spinlock_t pif_idx_lock;
2126+ /* protects concurrent CG register access */
2127+ spinlock_t cg_idx_lock;
2128+ /* protects concurrent UVD register access */
2129+ spinlock_t uvd_idx_lock;
2130+ /* protects concurrent RCU register access */
2131+ spinlock_t rcu_idx_lock;
2132+ /* protects concurrent DIDT register access */
2133+ spinlock_t didt_idx_lock;
2134+ /* protects concurrent ENDPOINT (audio) register access */
2135+ spinlock_t end_idx_lock;
21132136 void __iomem *rmmio;
21142137 radeon_rreg_t mc_rreg;
21152138 radeon_wreg_t mc_wreg;
@@ -2277,123 +2300,179 @@ void cik_mm_wdoorbell(struct radeon_device *rdev, u32 offset, u32 v); · 161 unmodified lines
22772300 */
22782301 static inline uint32_t rv370_pcie_rreg(struct radeon_device *rdev, uint32_t reg)
22792302 {
2303+ unsigned long flags;
22802304 uint32_t r;
22812305
2306+ spin_lock_irqsave(&rdev->pcie_idx_lock, flags);
22822307 WREG32(RADEON_PCIE_INDEX, ((reg) & rdev->pcie_reg_mask));
22832308 r = RREG32(RADEON_PCIE_DATA);
2309+ spin_unlock_irqrestore(&rdev->pcie_idx_lock, flags);
22842310 return r;
22852311 }
22862312
22872313 static inline void rv370_pcie_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
22882314 {
2315+ unsigned long flags;
2316+
2317+ spin_lock_irqsave(&rdev->pcie_idx_lock, flags);
22892318 WREG32(RADEON_PCIE_INDEX, ((reg) & rdev->pcie_reg_mask));
22902319 WREG32(RADEON_PCIE_DATA, (v));
2320+ spin_unlock_irqrestore(&rdev->pcie_idx_lock, flags);
22912321 }
22922322
22932323 static inline u32 tn_smc_rreg(struct radeon_device *rdev, u32 reg)
22942324 {
2325+ unsigned long flags;
22952326 u32 r;
22962327
2328+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
22972329 WREG32(TN_SMC_IND_INDEX_0, (reg));
22982330 r = RREG32(TN_SMC_IND_DATA_0);
2331+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
22992332 return r;
23002333 }
23012334
23022335 static inline void tn_smc_wreg(struct radeon_device *rdev, u32 reg, u32 v)
23032336 {
2337+ unsigned long flags;
2338+
2339+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
23042340 WREG32(TN_SMC_IND_INDEX_0, (reg));
23052341 WREG32(TN_SMC_IND_DATA_0, (v));
2342+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
23062343 }
23072344
23082345 static inline u32 r600_rcu_rreg(struct radeon_device *rdev, u32 reg)
23092346 {
2347+ unsigned long flags;
23102348 u32 r;
23112349
2350+ spin_lock_irqsave(&rdev->rcu_idx_lock, flags);
23122351 WREG32(R600_RCU_INDEX, ((reg) & 0x1fff));
23132352 r = RREG32(R600_RCU_DATA);
2353+ spin_unlock_irqrestore(&rdev->rcu_idx_lock, flags);
23142354 return r;
23152355 }
23162356
23172357 static inline void r600_rcu_wreg(struct radeon_device *rdev, u32 reg, u32 v)
23182358 {
2359+ unsigned long flags;
2360+
2361+ spin_lock_irqsave(&rdev->rcu_idx_lock, flags);
23192362 WREG32(R600_RCU_INDEX, ((reg) & 0x1fff));
23202363 WREG32(R600_RCU_DATA, (v));
2364+ spin_unlock_irqrestore(&rdev->rcu_idx_lock, flags);
23212365 }
23222366
23232367 static inline u32 eg_cg_rreg(struct radeon_device *rdev, u32 reg)
23242368 {
2369+ unsigned long flags;
23252370 u32 r;
23262371
2372+ spin_lock_irqsave(&rdev->cg_idx_lock, flags);
23272373 WREG32(EVERGREEN_CG_IND_ADDR, ((reg) & 0xffff));
23282374 r = RREG32(EVERGREEN_CG_IND_DATA);
2375+ spin_unlock_irqrestore(&rdev->cg_idx_lock, flags);
23292376 return r;
23302377 }
23312378
23322379 static inline void eg_cg_wreg(struct radeon_device *rdev, u32 reg, u32 v)
23332380 {
2381+ unsigned long flags;
2382+
2383+ spin_lock_irqsave(&rdev->cg_idx_lock, flags);
23342384 WREG32(EVERGREEN_CG_IND_ADDR, ((reg) & 0xffff));
23352385 WREG32(EVERGREEN_CG_IND_DATA, (v));
2386+ spin_unlock_irqrestore(&rdev->cg_idx_lock, flags);
23362387 }
23372388
23382389 static inline u32 eg_pif_phy0_rreg(struct radeon_device *rdev, u32 reg)
23392390 {
2391+ unsigned long flags;
23402392 u32 r;
23412393
2394+ spin_lock_irqsave(&rdev->pif_idx_lock, flags);
23422395 WREG32(EVERGREEN_PIF_PHY0_INDEX, ((reg) & 0xffff));
23432396 r = RREG32(EVERGREEN_PIF_PHY0_DATA);
2397+ spin_unlock_irqrestore(&rdev->pif_idx_lock, flags);
23442398 return r;
23452399 }
23462400
23472401 static inline void eg_pif_phy0_wreg(struct radeon_device *rdev, u32 reg, u32 v)
23482402 {
2403+ unsigned long flags;
2404+
2405+ spin_lock_irqsave(&rdev->pif_idx_lock, flags);
23492406 WREG32(EVERGREEN_PIF_PHY0_INDEX, ((reg) & 0xffff));
23502407 WREG32(EVERGREEN_PIF_PHY0_DATA, (v));
2408+ spin_unlock_irqrestore(&rdev->pif_idx_lock, flags);
23512409 }
23522410
23532411 static inline u32 eg_pif_phy1_rreg(struct radeon_device *rdev, u32 reg)
23542412 {
2413+ unsigned long flags;
23552414 u32 r;
23562415
2416+ spin_lock_irqsave(&rdev->pif_idx_lock, flags);
23572417 WREG32(EVERGREEN_PIF_PHY1_INDEX, ((reg) & 0xffff));
23582418 r = RREG32(EVERGREEN_PIF_PHY1_DATA);
2419+ spin_unlock_irqrestore(&rdev->pif_idx_lock, flags);
23592420 return r;
23602421 }
23612422
23622423 static inline void eg_pif_phy1_wreg(struct radeon_device *rdev, u32 reg, u32 v)
23632424 {
2425+ unsigned long flags;
2426+
2427+ spin_lock_irqsave(&rdev->pif_idx_lock, flags);
23642428 WREG32(EVERGREEN_PIF_PHY1_INDEX, ((reg) & 0xffff));
23652429 WREG32(EVERGREEN_PIF_PHY1_DATA, (v));
2430+ spin_unlock_irqrestore(&rdev->pif_idx_lock, flags);
23662431 }
23672432
23682433 static inline u32 r600_uvd_ctx_rreg(struct radeon_device *rdev, u32 reg)
23692434 {
2435+ unsigned long flags;
23702436 u32 r;
23712437
2438+ spin_lock_irqsave(&rdev->uvd_idx_lock, flags);
23722439 WREG32(R600_UVD_CTX_INDEX, ((reg) & 0x1ff));
23732440 r = RREG32(R600_UVD_CTX_DATA);
2441+ spin_unlock_irqrestore(&rdev->uvd_idx_lock, flags);
23742442 return r;
23752443 }
23762444
23772445 static inline void r600_uvd_ctx_wreg(struct radeon_device *rdev, u32 reg, u32 v)
23782446 {
2447+ unsigned long flags;
2448+
2449+ spin_lock_irqsave(&rdev->uvd_idx_lock, flags);
23792450 WREG32(R600_UVD_CTX_INDEX, ((reg) & 0x1ff));
23802451 WREG32(R600_UVD_CTX_DATA, (v));
2452+ spin_unlock_irqrestore(&rdev->uvd_idx_lock, flags);
23812453 }
23822454
23832455
23842456 static inline u32 cik_didt_rreg(struct radeon_device *rdev, u32 reg)
23852457 {
2458+ unsigned long flags;
23862459 u32 r;
23872460
2461+ spin_lock_irqsave(&rdev->didt_idx_lock, flags);
23882462 WREG32(CIK_DIDT_IND_INDEX, (reg));
23892463 r = RREG32(CIK_DIDT_IND_DATA);
2464+ spin_unlock_irqrestore(&rdev->didt_idx_lock, flags);
23902465 return r;
23912466 }
23922467
23932468 static inline void cik_didt_wreg(struct radeon_device *rdev, u32 reg, u32 v)
23942469 {
2470+ unsigned long flags;
2471+
2472+ spin_lock_irqsave(&rdev->didt_idx_lock, flags);
23952473 WREG32(CIK_DIDT_IND_INDEX, (reg));
23962474 WREG32(CIK_DIDT_IND_DATA, (v));
2475+ spin_unlock_irqrestore(&rdev->didt_idx_lock, flags);
23972476 }
23982477
23992478 void r100_pll_errata_after_index(struct radeon_device *rdev);
@@ -2569,6 +2648,7 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v); · 169 unmodified lines
25692648 #define radeon_dpm_force_performance_level(rdev, l) rdev->asic->dpm.force_performance_level((rdev), (l))
25702649 #define radeon_dpm_vblank_too_short(rdev) rdev->asic->dpm.vblank_too_short((rdev))
25712650 #define radeon_dpm_powergate_uvd(rdev, g) rdev->asic->dpm.powergate_uvd((rdev), (g))
2651+#define radeon_dpm_enable_bapm(rdev, e) rdev->asic->dpm.enable_bapm((rdev), (e))
25722652
25732653 /* Common functions */
25742654 /* AGP */
drivers/gpu/drm/radeon/radeon_asic.c+10−3
@@ -1004,6 +1004,8 @@ static struct radeon_asic rv6xx_asic = { · 1003 unmodified lines
10041004 .wait_for_vblank = &avivo_wait_for_vblank,
10051005 .set_backlight_level = &atombios_set_backlight_level,
10061006 .get_backlight_level = &atombios_get_backlight_level,
1007+ .hdmi_enable = &r600_hdmi_enable,
1008+ .hdmi_setmode = &r600_hdmi_setmode,
10071009 },
10081010 .copy = {
10091011 .blit = &r600_copy_cpdma,
@@ -1037,6 +1039,7 @@ static struct radeon_asic rv6xx_asic = { · 27 unmodified lines
10371039 .set_pcie_lanes = &r600_set_pcie_lanes,
10381040 .set_clock_gating = NULL,
10391041 .get_temperature = &rv6xx_get_temp,
1042+ .set_uvd_clocks = &r600_set_uvd_clocks,
10401043 },
10411044 .dpm = {
10421045 .init = &rv6xx_dpm_init,
@@ -1126,6 +1129,7 @@ static struct radeon_asic rs780_asic = { · 83 unmodified lines
11261129 .set_pcie_lanes = NULL,
11271130 .set_clock_gating = NULL,
11281131 .get_temperature = &rv6xx_get_temp,
1132+ .set_uvd_clocks = &r600_set_uvd_clocks,
11291133 },
11301134 .dpm = {
11311135 .init = &rs780_dpm_init,
@@ -1141,6 +1145,7 @@ static struct radeon_asic rs780_asic = { · 9 unmodified lines
11411145 .get_mclk = &rs780_dpm_get_mclk,
11421146 .print_power_state = &rs780_dpm_print_power_state,
11431147 .debugfs_print_current_performance_level = &rs780_dpm_debugfs_print_current_performance_level,
1148+ .force_performance_level = &rs780_dpm_force_performance_level,
11441149 },
11451150 .pflip = {
11461151 .pre_page_flip = &rs600_pre_page_flip,
@@ -1791,6 +1796,7 @@ static struct radeon_asic trinity_asic = { · 644 unmodified lines
17911796 .print_power_state = &trinity_dpm_print_power_state,
17921797 .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
17931798 .force_performance_level = &trinity_dpm_force_performance_level,
1799+ .enable_bapm = &trinity_dpm_enable_bapm,
17941800 },
17951801 .pflip = {
17961802 .pre_page_flip = &evergreen_pre_page_flip,
@@ -2166,6 +2172,7 @@ static struct radeon_asic kv_asic = { · 369 unmodified lines
21662172 .debugfs_print_current_performance_level = &kv_dpm_debugfs_print_current_performance_level,
21672173 .force_performance_level = &kv_dpm_force_performance_level,
21682174 .powergate_uvd = &kv_dpm_powergate_uvd,
2175+ .enable_bapm = &kv_dpm_enable_bapm,
21692176 },
21702177 .pflip = {
21712178 .pre_page_flip = &evergreen_pre_page_flip,
@@ -2390,7 +2397,7 @@ int radeon_asic_init(struct radeon_device *rdev) · 218 unmodified lines
23902397 RADEON_CG_SUPPORT_HDP_LS |
23912398 RADEON_CG_SUPPORT_HDP_MGCG;
23922399 rdev->pg_flags = 0 |
2393− /*RADEON_PG_SUPPORT_GFX_CG | */
2400+ /*RADEON_PG_SUPPORT_GFX_PG | */
23942401 RADEON_PG_SUPPORT_SDMA;
23952402 break;
23962403 case CHIP_OLAND:
@@ -2479,7 +2486,7 @@ int radeon_asic_init(struct radeon_device *rdev) · 82 unmodified lines
24792486 RADEON_CG_SUPPORT_HDP_LS |
24802487 RADEON_CG_SUPPORT_HDP_MGCG;
24812488 rdev->pg_flags = 0;
2482− /*RADEON_PG_SUPPORT_GFX_CG |
2489+ /*RADEON_PG_SUPPORT_GFX_PG |
24832490 RADEON_PG_SUPPORT_GFX_SMG |
24842491 RADEON_PG_SUPPORT_GFX_DMG |
24852492 RADEON_PG_SUPPORT_UVD |
@@ -2507,7 +2514,7 @@ int radeon_asic_init(struct radeon_device *rdev) · 21 unmodified lines
25072514 RADEON_CG_SUPPORT_HDP_LS |
25082515 RADEON_CG_SUPPORT_HDP_MGCG;
25092516 rdev->pg_flags = 0;
2510− /*RADEON_PG_SUPPORT_GFX_CG |
2517+ /*RADEON_PG_SUPPORT_GFX_PG |
25112518 RADEON_PG_SUPPORT_GFX_SMG |
25122519 RADEON_PG_SUPPORT_UVD |
25132520 RADEON_PG_SUPPORT_VCE |
drivers/gpu/drm/radeon/radeon_asic.h+5−0
@@ -389,6 +389,7 @@ int r600_mc_wait_for_idle(struct radeon_device *rdev); · 388 unmodified lines
389389 u32 r600_get_xclk(struct radeon_device *rdev);
390390 uint64_t r600_get_gpu_clock_counter(struct radeon_device *rdev);
391391 int rv6xx_get_temp(struct radeon_device *rdev);
392+int r600_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk);
392393 int r600_dpm_pre_set_power_state(struct radeon_device *rdev);
393394 void r600_dpm_post_set_power_state(struct radeon_device *rdev);
394395 /* r600 dma */
@@ -428,6 +429,8 @@ void rs780_dpm_print_power_state(struct radeon_device *rdev, · 33 unmodified lines
428429 struct radeon_ps *ps);
429430 void rs780_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev,
430431 struct seq_file *m);
432+int rs780_dpm_force_performance_level(struct radeon_device *rdev,
433+ enum radeon_dpm_forced_level level);
431434
432435 /*
433436 * rv770,rv730,rv710,rv740
@@ -625,6 +628,7 @@ void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *r · 191 unmodified lines
625628 struct seq_file *m);
626629 int trinity_dpm_force_performance_level(struct radeon_device *rdev,
627630 enum radeon_dpm_forced_level level);
631+void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable);
628632
629633 /* DCE6 - SI */
630634 void dce6_bandwidth_update(struct radeon_device *rdev);
@@ -781,6 +785,7 @@ void kv_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, · 150 unmodified lines
781785 int kv_dpm_force_performance_level(struct radeon_device *rdev,
782786 enum radeon_dpm_forced_level level);
783787 void kv_dpm_powergate_uvd(struct radeon_device *rdev, bool gate);
788+void kv_dpm_enable_bapm(struct radeon_device *rdev, bool enable);
784789
785790 /* uvd v1.0 */
786791 uint32_t uvd_v1_0_get_rptr(struct radeon_device *rdev,
drivers/gpu/drm/radeon/radeon_atombios.c+43−23
@@ -1367,6 +1367,7 @@ bool radeon_atombios_get_ppll_ss_info(struct radeon_device *rdev, · 1366 unmodified lines
13671367 int index = GetIndexIntoMasterTable(DATA, PPLL_SS_Info);
13681368 uint16_t data_offset, size;
13691369 struct _ATOM_SPREAD_SPECTRUM_INFO *ss_info;
1370+ struct _ATOM_SPREAD_SPECTRUM_ASSIGNMENT *ss_assign;
13701371 uint8_t frev, crev;
13711372 int i, num_indices;
13721373
@@ -1378,18 +1379,21 @@ bool radeon_atombios_get_ppll_ss_info(struct radeon_device *rdev, · 5 unmodified lines
13781379
13791380 num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
13801381 sizeof(ATOM_SPREAD_SPECTRUM_ASSIGNMENT);
1381−
1382+ ss_assign = (struct _ATOM_SPREAD_SPECTRUM_ASSIGNMENT*)
1383+ ((u8 *)&ss_info->asSS_Info[0]);
13821384 for (i = 0; i < num_indices; i++) {
1383− if (ss_info->asSS_Info[i].ucSS_Id == id) {
1385+ if (ss_assign->ucSS_Id == id) {
13841386 ss->percentage =
1385− le16_to_cpu(ss_info->asSS_Info[i].usSpreadSpectrumPercentage);
1386− ss->type = ss_info->asSS_Info[i].ucSpreadSpectrumType;
1387− ss->step = ss_info->asSS_Info[i].ucSS_Step;
1388− ss->delay = ss_info->asSS_Info[i].ucSS_Delay;
1389− ss->range = ss_info->asSS_Info[i].ucSS_Range;
1390− ss->refdiv = ss_info->asSS_Info[i].ucRecommendedRef_Div;
1387+ le16_to_cpu(ss_assign->usSpreadSpectrumPercentage);
1388+ ss->type = ss_assign->ucSpreadSpectrumType;
1389+ ss->step = ss_assign->ucSS_Step;
1390+ ss->delay = ss_assign->ucSS_Delay;
1391+ ss->range = ss_assign->ucSS_Range;
1392+ ss->refdiv = ss_assign->ucRecommendedRef_Div;
13911393 return true;
13921394 }
1395+ ss_assign = (struct _ATOM_SPREAD_SPECTRUM_ASSIGNMENT*)
1396+ ((u8 *)ss_assign + sizeof(struct _ATOM_SPREAD_SPECTRUM_ASSIGNMENT));
13931397 }
13941398 }
13951399 return false;
@@ -1477,6 +1481,12 @@ union asic_ss_info { · 81 unmodified lines
14771481 struct _ATOM_ASIC_INTERNAL_SS_INFO_V3 info_3;
14781482 };
14791483
1484+union asic_ss_assignment {
1485+ struct _ATOM_ASIC_SS_ASSIGNMENT v1;
1486+ struct _ATOM_ASIC_SS_ASSIGNMENT_V2 v2;
1487+ struct _ATOM_ASIC_SS_ASSIGNMENT_V3 v3;
1488+};
1489+
14801490 bool radeon_atombios_get_asic_ss_info(struct radeon_device *rdev,
14811491 struct radeon_atom_ss *ss,
14821492 int id, u32 clock)
@@ -1485,6 +1495,7 @@ bool radeon_atombios_get_asic_ss_info(struct radeon_device *rdev, · 2 unmodified lines
14851495 int index = GetIndexIntoMasterTable(DATA, ASIC_InternalSS_Info);
14861496 uint16_t data_offset, size;
14871497 union asic_ss_info *ss_info;
1498+ union asic_ss_assignment *ss_assign;
14881499 uint8_t frev, crev;
14891500 int i, num_indices;
14901501
@@ -1509,45 +1520,52 @@ bool radeon_atombios_get_asic_ss_info(struct radeon_device *rdev, · 18 unmodified lines
15091520 num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
15101521 sizeof(ATOM_ASIC_SS_ASSIGNMENT);
15111522
1523+ ss_assign = (union asic_ss_assignment *)((u8 *)&ss_info->info.asSpreadSpectrum[0]);
15121524 for (i = 0; i < num_indices; i++) {
1513− if ((ss_info->info.asSpreadSpectrum[i].ucClockIndication == id) &&
1514− (clock <= le32_to_cpu(ss_info->info.asSpreadSpectrum[i].ulTargetClockRange))) {
1525+ if ((ss_assign->v1.ucClockIndication == id) &&
1526+ (clock <= le32_to_cpu(ss_assign->v1.ulTargetClockRange))) {
15151527 ss->percentage =
1516− le16_to_cpu(ss_info->info.asSpreadSpectrum[i].usSpreadSpectrumPercentage);
1517− ss->type = ss_info->info.asSpreadSpectrum[i].ucSpreadSpectrumMode;
1518− ss->rate = le16_to_cpu(ss_info->info.asSpreadSpectrum[i].usSpreadRateInKhz);
1528+ le16_to_cpu(ss_assign->v1.usSpreadSpectrumPercentage);
1529+ ss->type = ss_assign->v1.ucSpreadSpectrumMode;
1530+ ss->rate = le16_to_cpu(ss_assign->v1.usSpreadRateInKhz);
15191531 return true;
15201532 }
1533+ ss_assign = (union asic_ss_assignment *)
1534+ ((u8 *)ss_assign + sizeof(ATOM_ASIC_SS_ASSIGNMENT));
15211535 }
15221536 break;
15231537 case 2:
15241538 num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
15251539 sizeof(ATOM_ASIC_SS_ASSIGNMENT_V2);
1540+ ss_assign = (union asic_ss_assignment *)((u8 *)&ss_info->info_2.asSpreadSpectrum[0]);
15261541 for (i = 0; i < num_indices; i++) {
1527− if ((ss_info->info_2.asSpreadSpectrum[i].ucClockIndication == id) &&
1528− (clock <= le32_to_cpu(ss_info->info_2.asSpreadSpectrum[i].ulTargetClockRange))) {
1542+ if ((ss_assign->v2.ucClockIndication == id) &&
1543+ (clock <= le32_to_cpu(ss_assign->v2.ulTargetClockRange))) {
15291544 ss->percentage =
1530− le16_to_cpu(ss_info->info_2.asSpreadSpectrum[i].usSpreadSpectrumPercentage);
1531− ss->type = ss_info->info_2.asSpreadSpectrum[i].ucSpreadSpectrumMode;
1532− ss->rate = le16_to_cpu(ss_info->info_2.asSpreadSpectrum[i].usSpreadRateIn10Hz);
1545+ le16_to_cpu(ss_assign->v2.usSpreadSpectrumPercentage);
1546+ ss->type = ss_assign->v2.ucSpreadSpectrumMode;
1547+ ss->rate = le16_to_cpu(ss_assign->v2.usSpreadRateIn10Hz);
15331548 if ((crev == 2) &&
15341549 ((id == ASIC_INTERNAL_ENGINE_SS) ||
15351550 (id == ASIC_INTERNAL_MEMORY_SS)))
15361551 ss->rate /= 100;
15371552 return true;
15381553 }
1554+ ss_assign = (union asic_ss_assignment *)
1555+ ((u8 *)ss_assign + sizeof(ATOM_ASIC_SS_ASSIGNMENT_V2));
15391556 }
15401557 break;
15411558 case 3:
15421559 num_indices = (size - sizeof(ATOM_COMMON_TABLE_HEADER)) /
15431560 sizeof(ATOM_ASIC_SS_ASSIGNMENT_V3);
1561+ ss_assign = (union asic_ss_assignment *)((u8 *)&ss_info->info_3.asSpreadSpectrum[0]);
15441562 for (i = 0; i < num_indices; i++) {
1545− if ((ss_info->info_3.asSpreadSpectrum[i].ucClockIndication == id) &&
1546− (clock <= le32_to_cpu(ss_info->info_3.asSpreadSpectrum[i].ulTargetClockRange))) {
1563+ if ((ss_assign->v3.ucClockIndication == id) &&
1564+ (clock <= le32_to_cpu(ss_assign->v3.ulTargetClockRange))) {
15471565 ss->percentage =
1548− le16_to_cpu(ss_info->info_3.asSpreadSpectrum[i].usSpreadSpectrumPercentage);
1549− ss->type = ss_info->info_3.asSpreadSpectrum[i].ucSpreadSpectrumMode;
1550− ss->rate = le16_to_cpu(ss_info->info_3.asSpreadSpectrum[i].usSpreadRateIn10Hz);
1566+ le16_to_cpu(ss_assign->v3.usSpreadSpectrumPercentage);
1567+ ss->type = ss_assign->v3.ucSpreadSpectrumMode;
1568+ ss->rate = le16_to_cpu(ss_assign->v3.usSpreadRateIn10Hz);
15511569 if ((id == ASIC_INTERNAL_ENGINE_SS) ||
15521570 (id == ASIC_INTERNAL_MEMORY_SS))
15531571 ss->rate /= 100;
@@ -1555,6 +1573,8 @@ bool radeon_atombios_get_asic_ss_info(struct radeon_device *rdev, · 1 unmodified line
15551573 radeon_atombios_get_igp_ss_overrides(rdev, ss, id);
15561574 return true;
15571575 }
1576+ ss_assign = (union asic_ss_assignment *)
1577+ ((u8 *)ss_assign + sizeof(ATOM_ASIC_SS_ASSIGNMENT_V3));
15581578 }
15591579 break;
15601580 default:
drivers/gpu/drm/radeon/radeon_connectors.c+65−4
@@ -396,6 +396,21 @@ static int radeon_connector_set_property(struct drm_connector *connector, struct · 395 unmodified lines
396396 }
397397 }
398398
399+ if (property == rdev->mode_info.audio_property) {
400+ struct radeon_connector *radeon_connector = to_radeon_connector(connector);
401+ /* need to find digital encoder on connector */
402+ encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TMDS);
403+ if (!encoder)
404+ return 0;
405+
406+ radeon_encoder = to_radeon_encoder(encoder);
407+
408+ if (radeon_connector->audio != val) {
409+ radeon_connector->audio = val;
410+ radeon_property_change_mode(&radeon_encoder->base);
411+ }
412+ }
413+
399414 if (property == rdev->mode_info.underscan_property) {
400415 /* need to find digital encoder on connector */
401416 encoder = radeon_find_encoder(connector, DRM_MODE_ENCODER_TMDS);
@@ -1420,7 +1435,7 @@ radeon_dp_detect(struct drm_connector *connector, bool force) · 1018 unmodified lines
14201435 if (radeon_dp_getdpcd(radeon_connector))
14211436 ret = connector_status_connected;
14221437 } else {
1423− /* try non-aux ddc (DP to DVI/HMDI/etc. adapter) */
1438+ /* try non-aux ddc (DP to DVI/HDMI/etc. adapter) */
14241439 if (radeon_ddc_probe(radeon_connector, false))
14251440 ret = connector_status_connected;
14261441 }
@@ -1489,6 +1504,24 @@ static const struct drm_connector_funcs radeon_dp_connector_funcs = { · 62 unmodified lines
14891504 .force = radeon_dvi_force,
14901505 };
14911506
1507+static const struct drm_connector_funcs radeon_edp_connector_funcs = {
1508+ .dpms = drm_helper_connector_dpms,
1509+ .detect = radeon_dp_detect,
1510+ .fill_modes = drm_helper_probe_single_connector_modes,
1511+ .set_property = radeon_lvds_set_property,
1512+ .destroy = radeon_dp_connector_destroy,
1513+ .force = radeon_dvi_force,
1514+};
1515+
1516+static const struct drm_connector_funcs radeon_lvds_bridge_connector_funcs = {
1517+ .dpms = drm_helper_connector_dpms,
1518+ .detect = radeon_dp_detect,
1519+ .fill_modes = drm_helper_probe_single_connector_modes,
1520+ .set_property = radeon_lvds_set_property,
1521+ .destroy = radeon_dp_connector_destroy,
1522+ .force = radeon_dvi_force,
1523+};
1524+
14921525 void
14931526 radeon_add_atom_connector(struct drm_device *dev,
14941527 uint32_t connector_id,
@@ -1580,8 +1613,6 @@ radeon_add_atom_connector(struct drm_device *dev, · 85 unmodified lines
15801613 goto failed;
15811614 radeon_dig_connector->igp_lane_info = igp_lane_info;
15821615 radeon_connector->con_priv = radeon_dig_connector;
1583− drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);
1584− drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);
15851616 if (i2c_bus->valid) {
15861617 /* add DP i2c bus */
15871618 if (connector_type == DRM_MODE_CONNECTOR_eDP)
@@ -1598,6 +1629,10 @@ radeon_add_atom_connector(struct drm_device *dev, · 10 unmodified lines
15981629 case DRM_MODE_CONNECTOR_VGA:
15991630 case DRM_MODE_CONNECTOR_DVIA:
16001631 default:
1632+ drm_connector_init(dev, &radeon_connector->base,
1633+ &radeon_dp_connector_funcs, connector_type);
1634+ drm_connector_helper_add(&radeon_connector->base,
1635+ &radeon_dp_connector_helper_funcs);
16011636 connector->interlace_allowed = true;
16021637 connector->doublescan_allowed = true;
16031638 radeon_connector->dac_load_detect = true;
@@ -1610,6 +1645,10 @@ radeon_add_atom_connector(struct drm_device *dev, · 6 unmodified lines
16101645 case DRM_MODE_CONNECTOR_HDMIA:
16111646 case DRM_MODE_CONNECTOR_HDMIB:
16121647 case DRM_MODE_CONNECTOR_DisplayPort:
1648+ drm_connector_init(dev, &radeon_connector->base,
1649+ &radeon_dp_connector_funcs, connector_type);
1650+ drm_connector_helper_add(&radeon_connector->base,
1651+ &radeon_dp_connector_helper_funcs);
16131652 drm_object_attach_property(&radeon_connector->base.base,
16141653 rdev->mode_info.underscan_property,
16151654 UNDERSCAN_OFF);
@@ -1619,6 +1658,9 @@ radeon_add_atom_connector(struct drm_device *dev, · 3 unmodified lines
16191658 drm_object_attach_property(&radeon_connector->base.base,
16201659 rdev->mode_info.underscan_vborder_property,
16211660 0);
1661+ drm_object_attach_property(&radeon_connector->base.base,
1662+ rdev->mode_info.audio_property,
1663+ RADEON_AUDIO_DISABLE);
16221664 subpixel_order = SubPixelHorizontalRGB;
16231665 connector->interlace_allowed = true;
16241666 if (connector_type == DRM_MODE_CONNECTOR_HDMIB)
@@ -1634,6 +1676,10 @@ radeon_add_atom_connector(struct drm_device *dev, · 9 unmodified lines
16341676 break;
16351677 case DRM_MODE_CONNECTOR_LVDS:
16361678 case DRM_MODE_CONNECTOR_eDP:
1679+ drm_connector_init(dev, &radeon_connector->base,
1680+ &radeon_lvds_bridge_connector_funcs, connector_type);
1681+ drm_connector_helper_add(&radeon_connector->base,
1682+ &radeon_dp_connector_helper_funcs);
16371683 drm_object_attach_property(&radeon_connector->base.base,
16381684 dev->mode_config.scaling_mode_property,
16391685 DRM_MODE_SCALE_FULLSCREEN);
@@ -1708,6 +1754,11 @@ radeon_add_atom_connector(struct drm_device *dev, · 68 unmodified lines
17081754 rdev->mode_info.underscan_vborder_property,
17091755 0);
17101756 }
1757+ if (ASIC_IS_DCE2(rdev)) {
1758+ drm_object_attach_property(&radeon_connector->base.base,
1759+ rdev->mode_info.audio_property,
1760+ RADEON_AUDIO_DISABLE);
1761+ }
17111762 if (connector_type == DRM_MODE_CONNECTOR_DVII) {
17121763 radeon_connector->dac_load_detect = true;
17131764 drm_object_attach_property(&radeon_connector->base.base,
@@ -1748,6 +1799,11 @@ radeon_add_atom_connector(struct drm_device *dev, · 34 unmodified lines
17481799 rdev->mode_info.underscan_vborder_property,
17491800 0);
17501801 }
1802+ if (ASIC_IS_DCE2(rdev)) {
1803+ drm_object_attach_property(&radeon_connector->base.base,
1804+ rdev->mode_info.audio_property,
1805+ RADEON_AUDIO_DISABLE);
1806+ }
17511807 subpixel_order = SubPixelHorizontalRGB;
17521808 connector->interlace_allowed = true;
17531809 if (connector_type == DRM_MODE_CONNECTOR_HDMIB)
@@ -1787,6 +1843,11 @@ radeon_add_atom_connector(struct drm_device *dev, · 33 unmodified lines
17871843 rdev->mode_info.underscan_vborder_property,
17881844 0);
17891845 }
1846+ if (ASIC_IS_DCE2(rdev)) {
1847+ drm_object_attach_property(&radeon_connector->base.base,
1848+ rdev->mode_info.audio_property,
1849+ RADEON_AUDIO_DISABLE);
1850+ }
17901851 connector->interlace_allowed = true;
17911852 /* in theory with a DP to VGA converter... */
17921853 connector->doublescan_allowed = false;
@@ -1797,7 +1858,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 4 unmodified lines
17971858 goto failed;
17981859 radeon_dig_connector->igp_lane_info = igp_lane_info;
17991860 radeon_connector->con_priv = radeon_dig_connector;
1800− drm_connector_init(dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type);
1861+ drm_connector_init(dev, &radeon_connector->base, &radeon_edp_connector_funcs, connector_type);
18011862 drm_connector_helper_add(&radeon_connector->base, &radeon_dp_connector_helper_funcs);
18021863 if (i2c_bus->valid) {
18031864 /* add DP i2c bus */
drivers/gpu/drm/radeon/radeon_cs.c+10−4
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <drm/radeon_drm.h>
2929 #include "radeon_reg.h"
3030 #include "radeon.h"
31+#include "radeon_trace.h"
3132
3233 static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
3334 {
@@ -80,10 +81,13 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) · 46 unmodified lines
8081 p->relocs[i].lobj.bo = p->relocs[i].robj;
8182 p->relocs[i].lobj.written = !!r->write_domain;
8283
83− /* the first reloc of an UVD job is the
84− msg and that must be in VRAM */
85− if (p->ring == R600_RING_TYPE_UVD_INDEX && i == 0) {
86− /* TODO: is this still needed for NI+ ? */
84+ /* the first reloc of an UVD job is the msg and that must be in
85+ VRAM, also but everything into VRAM on AGP cards to avoid
86+ image corruptions */
87+ if (p->ring == R600_RING_TYPE_UVD_INDEX &&
88+ p->rdev->family < CHIP_PALM &&
89+ (i == 0 || drm_pci_device_is_agp(p->rdev->ddev))) {
90+
8791 p->relocs[i].lobj.domain =
8892 RADEON_GEM_DOMAIN_VRAM;
8993
@@ -559,6 +563,8 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 469 unmodified lines
559563 return r;
560564 }
561565
566+ trace_radeon_cs(&parser);
567+
562568 r = radeon_cs_ib_chunk(rdev, &parser);
563569 if (r) {
564570 goto out;
drivers/gpu/drm/radeon/radeon_device.c+23−3
@@ -1249,6 +1249,17 @@ int radeon_device_init(struct radeon_device *rdev, · 1248 unmodified lines
12491249 /* Registers mapping */
12501250 /* TODO: block userspace mapping of io register */
12511251 spin_lock_init(&rdev->mmio_idx_lock);
1252+ spin_lock_init(&rdev->smc_idx_lock);
1253+ spin_lock_init(&rdev->pll_idx_lock);
1254+ spin_lock_init(&rdev->mc_idx_lock);
1255+ spin_lock_init(&rdev->pcie_idx_lock);
1256+ spin_lock_init(&rdev->pciep_idx_lock);
1257+ spin_lock_init(&rdev->pif_idx_lock);
1258+ spin_lock_init(&rdev->cg_idx_lock);
1259+ spin_lock_init(&rdev->uvd_idx_lock);
1260+ spin_lock_init(&rdev->rcu_idx_lock);
1261+ spin_lock_init(&rdev->didt_idx_lock);
1262+ spin_lock_init(&rdev->end_idx_lock);
12521263 if (rdev->family >= CHIP_BONAIRE) {
12531264 rdev->rmmio_base = pci_resource_start(rdev->pdev, 5);
12541265 rdev->rmmio_size = pci_resource_len(rdev->pdev, 5);
@@ -1309,13 +1320,22 @@ int radeon_device_init(struct radeon_device *rdev, · 54 unmodified lines
13091320 return r;
13101321 }
13111322 if ((radeon_testing & 1)) {
1312− radeon_test_moves(rdev);
1323+ if (rdev->accel_working)
1324+ radeon_test_moves(rdev);
1325+ else
1326+ DRM_INFO("radeon: acceleration disabled, skipping move tests\n");
13131327 }
13141328 if ((radeon_testing & 2)) {
1315− radeon_test_syncing(rdev);
1329+ if (rdev->accel_working)
1330+ radeon_test_syncing(rdev);
1331+ else
1332+ DRM_INFO("radeon: acceleration disabled, skipping sync tests\n");
13161333 }
13171334 if (radeon_benchmarking) {
1318− radeon_benchmark(rdev, radeon_benchmarking);
1335+ if (rdev->accel_working)
1336+ radeon_benchmark(rdev, radeon_benchmarking);
1337+ else
1338+ DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n");
13191339 }
13201340 return 0;
13211341 }
drivers/gpu/drm/radeon/radeon_display.c+12−0
@@ -1172,6 +1172,12 @@ static struct drm_prop_enum_list radeon_underscan_enum_list[] = · 1171 unmodified lines
11721172 { UNDERSCAN_AUTO, "auto" },
11731173 };
11741174
1175+static struct drm_prop_enum_list radeon_audio_enum_list[] =
1176+{ { RADEON_AUDIO_DISABLE, "off" },
1177+ { RADEON_AUDIO_ENABLE, "on" },
1178+ { RADEON_AUDIO_AUTO, "auto" },
1179+};
1180+
11751181 static int radeon_modeset_create_props(struct radeon_device *rdev)
11761182 {
11771183 int sz;
@@ -1222,6 +1228,12 @@ static int radeon_modeset_create_props(struct radeon_device *rdev) · 44 unmodified lines
12221228 if (!rdev->mode_info.underscan_vborder_property)
12231229 return -ENOMEM;
12241230
1231+ sz = ARRAY_SIZE(radeon_audio_enum_list);
1232+ rdev->mode_info.audio_property =
1233+ drm_property_create_enum(rdev->ddev, 0,
1234+ "audio",
1235+ radeon_audio_enum_list, sz);
1236+
12251237 return 0;
12261238 }
12271239
drivers/gpu/drm/radeon/radeon_drv.c+1−1
@@ -153,7 +153,7 @@ int radeon_benchmarking = 0; · 152 unmodified lines
153153 int radeon_testing = 0;
154154 int radeon_connector_table = 0;
155155 int radeon_tv = 1;
156−int radeon_audio = 0;
156+int radeon_audio = 1;
157157 int radeon_disp_priority = 0;
158158 int radeon_hw_i2c = 0;
159159 int radeon_pcie_gen2 = -1;
drivers/gpu/drm/radeon/radeon_mode.h+9−0
@@ -247,6 +247,8 @@ struct radeon_mode_info { · 246 unmodified lines
247247 struct drm_property *underscan_property;
248248 struct drm_property *underscan_hborder_property;
249249 struct drm_property *underscan_vborder_property;
250+ /* audio */
251+ struct drm_property *audio_property;
250252 /* hardcoded DFP edid from BIOS */
251253 struct edid *bios_hardcoded_edid;
252254 int bios_hardcoded_edid_size;
@@ -471,6 +473,12 @@ struct radeon_router { · 218 unmodified lines
471473 u8 cd_mux_state;
472474 };
473475
476+enum radeon_connector_audio {
477+ RADEON_AUDIO_DISABLE = 0,
478+ RADEON_AUDIO_ENABLE = 1,
479+ RADEON_AUDIO_AUTO = 2
480+};
481+
474482 struct radeon_connector {
475483 struct drm_connector base;
476484 uint32_t connector_id;
@@ -489,6 +497,7 @@ struct radeon_connector { · 12 unmodified lines
489497 struct radeon_hpd hpd;
490498 struct radeon_router router;
491499 struct radeon_i2c_chan *router_bus;
500+ enum radeon_connector_audio audio;
492501 };
493502
494503 struct radeon_framebuffer {
drivers/gpu/drm/radeon/radeon_pm.c+70−19
@@ -67,7 +67,16 @@ int radeon_pm_get_type_index(struct radeon_device *rdev, · 66 unmodified lines
6767
6868 void radeon_pm_acpi_event_handler(struct radeon_device *rdev)
6969 {
70− if (rdev->pm.pm_method == PM_METHOD_PROFILE) {
70+ if ((rdev->pm.pm_method == PM_METHOD_DPM) && rdev->pm.dpm_enabled) {
71+ mutex_lock(&rdev->pm.mutex);
72+ if (power_supply_is_system_supplied() > 0)
73+ rdev->pm.dpm.ac_power = true;
74+ else
75+ rdev->pm.dpm.ac_power = false;
76+ if (rdev->asic->dpm.enable_bapm)
77+ radeon_dpm_enable_bapm(rdev, rdev->pm.dpm.ac_power);
78+ mutex_unlock(&rdev->pm.mutex);
79+ } else if (rdev->pm.pm_method == PM_METHOD_PROFILE) {
7180 if (rdev->pm.profile == PM_PROFILE_AUTO) {
7281 mutex_lock(&rdev->pm.mutex);
7382 radeon_pm_update_profile(rdev);
@@ -333,7 +342,7 @@ static ssize_t radeon_get_pm_profile(struct device *dev, · 259 unmodified lines
333342 struct device_attribute *attr,
334343 char *buf)
335344 {
336− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
345+ struct drm_device *ddev = dev_get_drvdata(dev);
337346 struct radeon_device *rdev = ddev->dev_private;
338347 int cp = rdev->pm.profile;
339348
@@ -349,7 +358,7 @@ static ssize_t radeon_set_pm_profile(struct device *dev, · 9 unmodified lines
349358 const char *buf,
350359 size_t count)
351360 {
352− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
361+ struct drm_device *ddev = dev_get_drvdata(dev);
353362 struct radeon_device *rdev = ddev->dev_private;
354363
355364 mutex_lock(&rdev->pm.mutex);
@@ -383,7 +392,7 @@ static ssize_t radeon_get_pm_method(struct device *dev, · 27 unmodified lines
383392 struct device_attribute *attr,
384393 char *buf)
385394 {
386− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
395+ struct drm_device *ddev = dev_get_drvdata(dev);
387396 struct radeon_device *rdev = ddev->dev_private;
388397 int pm = rdev->pm.pm_method;
389398
@@ -397,7 +406,7 @@ static ssize_t radeon_set_pm_method(struct device *dev, · 7 unmodified lines
397406 const char *buf,
398407 size_t count)
399408 {
400− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
409+ struct drm_device *ddev = dev_get_drvdata(dev);
401410 struct radeon_device *rdev = ddev->dev_private;
402411
403412 /* we don't support the legacy modes with dpm */
@@ -433,7 +442,7 @@ static ssize_t radeon_get_dpm_state(struct device *dev, · 29 unmodified lines
433442 struct device_attribute *attr,
434443 char *buf)
435444 {
436− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
445+ struct drm_device *ddev = dev_get_drvdata(dev);
437446 struct radeon_device *rdev = ddev->dev_private;
438447 enum radeon_pm_state_type pm = rdev->pm.dpm.user_state;
439448
@@ -447,7 +456,7 @@ static ssize_t radeon_set_dpm_state(struct device *dev, · 7 unmodified lines
447456 const char *buf,
448457 size_t count)
449458 {
450− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
459+ struct drm_device *ddev = dev_get_drvdata(dev);
451460 struct radeon_device *rdev = ddev->dev_private;
452461
453462 mutex_lock(&rdev->pm.mutex);
@@ -472,7 +481,7 @@ static ssize_t radeon_get_dpm_forced_performance_level(struct device *dev, · 18 unmodified lines
472481 struct device_attribute *attr,
473482 char *buf)
474483 {
475− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
484+ struct drm_device *ddev = dev_get_drvdata(dev);
476485 struct radeon_device *rdev = ddev->dev_private;
477486 enum radeon_dpm_forced_level level = rdev->pm.dpm.forced_level;
478487
@@ -486,7 +495,7 @@ static ssize_t radeon_set_dpm_forced_performance_level(struct device *dev, · 7 unmodified lines
486495 const char *buf,
487496 size_t count)
488497 {
489− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
498+ struct drm_device *ddev = dev_get_drvdata(dev);
490499 struct radeon_device *rdev = ddev->dev_private;
491500 enum radeon_dpm_forced_level level;
492501 int ret = 0;
@@ -524,7 +533,7 @@ static ssize_t radeon_hwmon_show_temp(struct device *dev, · 31 unmodified lines
524533 struct device_attribute *attr,
525534 char *buf)
526535 {
527− struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
536+ struct drm_device *ddev = dev_get_drvdata(dev);
528537 struct radeon_device *rdev = ddev->dev_private;
529538 int temp;
530539
@@ -536,6 +545,23 @@ static ssize_t radeon_hwmon_show_temp(struct device *dev, · 5 unmodified lines
536545 return snprintf(buf, PAGE_SIZE, "%d\n", temp);
537546 }
538547
548+static ssize_t radeon_hwmon_show_temp_thresh(struct device *dev,
549+ struct device_attribute *attr,
550+ char *buf)
551+{
552+ struct drm_device *ddev = dev_get_drvdata(dev);
553+ struct radeon_device *rdev = ddev->dev_private;
554+ int hyst = to_sensor_dev_attr(attr)->index;
555+ int temp;
556+
557+ if (hyst)
558+ temp = rdev->pm.dpm.thermal.min_temp;
559+ else
560+ temp = rdev->pm.dpm.thermal.max_temp;
561+
562+ return snprintf(buf, PAGE_SIZE, "%d\n", temp);
563+}
564+
539565 static ssize_t radeon_hwmon_show_name(struct device *dev,
540566 struct device_attribute *attr,
541567 char *buf)
@@ -544,16 +570,37 @@ static ssize_t radeon_hwmon_show_name(struct device *dev, · 2 unmodified lines
544570 }
545571
546572 static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, radeon_hwmon_show_temp, NULL, 0);
573+static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, radeon_hwmon_show_temp_thresh, NULL, 0);
574+static SENSOR_DEVICE_ATTR(temp1_crit_hyst, S_IRUGO, radeon_hwmon_show_temp_thresh, NULL, 1);
547575 static SENSOR_DEVICE_ATTR(name, S_IRUGO, radeon_hwmon_show_name, NULL, 0);
548576
549577 static struct attribute *hwmon_attributes[] = {
550578 &sensor_dev_attr_temp1_input.dev_attr.attr,
579+ &sensor_dev_attr_temp1_crit.dev_attr.attr,
580+ &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr,
551581 &sensor_dev_attr_name.dev_attr.attr,
552582 NULL
553583 };
554584
585+static umode_t hwmon_attributes_visible(struct kobject *kobj,
586+ struct attribute *attr, int index)
587+{
588+ struct device *dev = container_of(kobj, struct device, kobj);
589+ struct drm_device *ddev = dev_get_drvdata(dev);
590+ struct radeon_device *rdev = ddev->dev_private;
591+
592+ /* Skip limit attributes if DPM is not enabled */
593+ if (rdev->pm.pm_method != PM_METHOD_DPM &&
594+ (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr ||
595+ attr == &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr))
596+ return 0;
597+
598+ return attr->mode;
599+}
600+
555601 static const struct attribute_group hwmon_attrgroup = {
556602 .attrs = hwmon_attributes,
603+ .is_visible = hwmon_attributes_visible,
557604 };
558605
559606 static int radeon_hwmon_init(struct radeon_device *rdev)
@@ -870,10 +917,13 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev) · 310 unmodified lines
870917
871918 radeon_dpm_post_set_power_state(rdev);
872919
873− /* force low perf level for thermal */
874− if (rdev->pm.dpm.thermal_active &&
875− rdev->asic->dpm.force_performance_level) {
876− radeon_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_LOW);
920+ if (rdev->asic->dpm.force_performance_level) {
921+ if (rdev->pm.dpm.thermal_active)
922+ /* force low perf level for thermal */
923+ radeon_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_LOW);
924+ else
925+ /* otherwise, enable auto */
926+ radeon_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
877927 }
878928
879929 done:
@@ -952,7 +1002,7 @@ static void radeon_pm_resume_old(struct radeon_device *rdev) · 72 unmodified lines
9521002 {
9531003 /* set up the default clocks if the MC ucode is loaded */
9541004 if ((rdev->family >= CHIP_BARTS) &&
955− (rdev->family <= CHIP_HAINAN) &&
1005+ (rdev->family <= CHIP_CAYMAN) &&
9561006 rdev->mc_fw) {
9571007 if (rdev->pm.default_vddc)
9581008 radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
@@ -996,7 +1046,7 @@ static void radeon_pm_resume_dpm(struct radeon_device *rdev) · 37 unmodified lines
9961046 if (ret) {
9971047 DRM_ERROR("radeon: dpm resume failed\n");
9981048 if ((rdev->family >= CHIP_BARTS) &&
999− (rdev->family <= CHIP_HAINAN) &&
1049+ (rdev->family <= CHIP_CAYMAN) &&
10001050 rdev->mc_fw) {
10011051 if (rdev->pm.default_vddc)
10021052 radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
@@ -1047,7 +1097,7 @@ static int radeon_pm_init_old(struct radeon_device *rdev) · 44 unmodified lines
10471097 radeon_pm_init_profile(rdev);
10481098 /* set up the default clocks if the MC ucode is loaded */
10491099 if ((rdev->family >= CHIP_BARTS) &&
1050− (rdev->family <= CHIP_HAINAN) &&
1100+ (rdev->family <= CHIP_CAYMAN) &&
10511101 rdev->mc_fw) {
10521102 if (rdev->pm.default_vddc)
10531103 radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
@@ -1102,9 +1152,10 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev) · 48 unmodified lines
11021152 {
11031153 int ret;
11041154
1105− /* default to performance state */
1155+ /* default to balanced state */
11061156 rdev->pm.dpm.state = POWER_STATE_TYPE_BALANCED;
11071157 rdev->pm.dpm.user_state = POWER_STATE_TYPE_BALANCED;
1158+ rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO;
11081159 rdev->pm.default_sclk = rdev->clock.default_sclk;
11091160 rdev->pm.default_mclk = rdev->clock.default_mclk;
11101161 rdev->pm.current_sclk = rdev->clock.default_sclk;
@@ -1132,7 +1183,7 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev) · 21 unmodified lines
11321183 if (ret) {
11331184 rdev->pm.dpm_enabled = false;
11341185 if ((rdev->family >= CHIP_BARTS) &&
1135− (rdev->family <= CHIP_HAINAN) &&
1186+ (rdev->family <= CHIP_CAYMAN) &&
11361187 rdev->mc_fw) {
11371188 if (rdev->pm.default_vddc)
11381189 radeon_atom_set_voltage(rdev, rdev->pm.default_vddc,
drivers/gpu/drm/radeon/radeon_ring.c+5−3
@@ -839,9 +839,11 @@ static int radeon_debugfs_ring_info(struct seq_file *m, void *data) · 838 unmodified lines
839839 * packet that is the root issue
840840 */
841841 i = (ring->rptr + ring->ptr_mask + 1 - 32) & ring->ptr_mask;
842− for (j = 0; j <= (count + 32); j++) {
843− seq_printf(m, "r[%5d]=0x%08x\n", i, ring->ring[i]);
844− i = (i + 1) & ring->ptr_mask;
842+ if (ring->ready) {
843+ for (j = 0; j <= (count + 32); j++) {
844+ seq_printf(m, "r[%5d]=0x%08x\n", i, ring->ring[i]);
845+ i = (i + 1) & ring->ptr_mask;
846+ }
845847 }
846848 return 0;
847849 }
drivers/gpu/drm/radeon/radeon_trace.h+20−7
@@ -27,6 +27,26 @@ TRACE_EVENT(radeon_bo_create, · 26 unmodified lines
2727 TP_printk("bo=%p, pages=%u", __entry->bo, __entry->pages)
2828 );
2929
30+TRACE_EVENT(radeon_cs,
31+ TP_PROTO(struct radeon_cs_parser *p),
32+ TP_ARGS(p),
33+ TP_STRUCT__entry(
34+ __field(u32, ring)
35+ __field(u32, dw)
36+ __field(u32, fences)
37+ ),
38+
39+ TP_fast_assign(
40+ __entry->ring = p->ring;
41+ __entry->dw = p->chunks[p->chunk_ib_idx].length_dw;
42+ __entry->fences = radeon_fence_count_emitted(
43+ p->rdev, p->ring);
44+ ),
45+ TP_printk("ring=%u, dw=%u, fences=%u",
46+ __entry->ring, __entry->dw,
47+ __entry->fences)
48+);
49+
3050 DECLARE_EVENT_CLASS(radeon_fence_request,
3151
3252 TP_PROTO(struct drm_device *dev, u32 seqno),
@@ -53,13 +73,6 @@ DEFINE_EVENT(radeon_fence_request, radeon_fence_emit, · 20 unmodified lines
5373 TP_ARGS(dev, seqno)
5474 );
5575
56−DEFINE_EVENT(radeon_fence_request, radeon_fence_retire,
57−
58− TP_PROTO(struct drm_device *dev, u32 seqno),
59−
60− TP_ARGS(dev, seqno)
61−);
62−
6376 DEFINE_EVENT(radeon_fence_request, radeon_fence_wait_begin,
6477
6578 TP_PROTO(struct drm_device *dev, u32 seqno),
drivers/gpu/drm/radeon/radeon_uvd.c+1−2
@@ -476,8 +476,7 @@ static int radeon_uvd_cs_reloc(struct radeon_cs_parser *p, · 475 unmodified lines
476476 return -EINVAL;
477477 }
478478
479− /* TODO: is this still necessary on NI+ ? */
480− if ((cmd == 0 || cmd == 0x3) &&
479+ if (p->rdev->family < CHIP_PALM && (cmd == 0 || cmd == 0x3) &&
481480 (start >> 28) != (p->rdev->uvd.gpu_addr >> 28)) {
482481 DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n",
483482 start, end);
drivers/gpu/drm/radeon/rs400.c+7−0
@@ -274,19 +274,26 @@ static void rs400_mc_init(struct radeon_device *rdev) · 273 unmodified lines
274274
275275 uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg)
276276 {
277+ unsigned long flags;
277278 uint32_t r;
278279
280+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
279281 WREG32(RS480_NB_MC_INDEX, reg & 0xff);
280282 r = RREG32(RS480_NB_MC_DATA);
281283 WREG32(RS480_NB_MC_INDEX, 0xff);
284+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
282285 return r;
283286 }
284287
285288 void rs400_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
286289 {
290+ unsigned long flags;
291+
292+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
287293 WREG32(RS480_NB_MC_INDEX, ((reg) & 0xff) | RS480_NB_MC_IND_WR_EN);
288294 WREG32(RS480_NB_MC_DATA, (v));
289295 WREG32(RS480_NB_MC_INDEX, 0xff);
296+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
290297 }
291298
292299 #if defined(CONFIG_DEBUG_FS)
drivers/gpu/drm/radeon/rs600.c+11−1
@@ -847,16 +847,26 @@ void rs600_bandwidth_update(struct radeon_device *rdev) · 846 unmodified lines
847847
848848 uint32_t rs600_mc_rreg(struct radeon_device *rdev, uint32_t reg)
849849 {
850+ unsigned long flags;
851+ u32 r;
852+
853+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
850854 WREG32(R_000070_MC_IND_INDEX, S_000070_MC_IND_ADDR(reg) |
851855 S_000070_MC_IND_CITF_ARB0(1));
852− return RREG32(R_000074_MC_IND_DATA);
856+ r = RREG32(R_000074_MC_IND_DATA);
857+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
858+ return r;
853859 }
854860
855861 void rs600_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
856862 {
863+ unsigned long flags;
864+
865+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
857866 WREG32(R_000070_MC_IND_INDEX, S_000070_MC_IND_ADDR(reg) |
858867 S_000070_MC_IND_CITF_ARB0(1) | S_000070_MC_IND_WR_EN(1));
859868 WREG32(R_000074_MC_IND_DATA, v);
869+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
860870 }
861871
862872 static void rs600_debugfs(struct radeon_device *rdev)
drivers/gpu/drm/radeon/rs690.c+7−0
@@ -631,20 +631,27 @@ void rs690_bandwidth_update(struct radeon_device *rdev) · 630 unmodified lines
631631
632632 uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg)
633633 {
634+ unsigned long flags;
634635 uint32_t r;
635636
637+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
636638 WREG32(R_000078_MC_INDEX, S_000078_MC_IND_ADDR(reg));
637639 r = RREG32(R_00007C_MC_DATA);
638640 WREG32(R_000078_MC_INDEX, ~C_000078_MC_IND_ADDR);
641+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
639642 return r;
640643 }
641644
642645 void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
643646 {
647+ unsigned long flags;
648+
649+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
644650 WREG32(R_000078_MC_INDEX, S_000078_MC_IND_ADDR(reg) |
645651 S_000078_MC_IND_WR_EN(1));
646652 WREG32(R_00007C_MC_DATA, v);
647653 WREG32(R_000078_MC_INDEX, 0x7F);
654+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
648655 }
649656
650657 static void rs690_mc_program(struct radeon_device *rdev)
drivers/gpu/drm/radeon/rs780_dpm.c+92−20
@@ -62,9 +62,7 @@ static void rs780_get_pm_mode_parameters(struct radeon_device *rdev) · 61 unmodified lines
6262 radeon_crtc = to_radeon_crtc(crtc);
6363 pi->crtc_id = radeon_crtc->crtc_id;
6464 if (crtc->mode.htotal && crtc->mode.vtotal)
65− pi->refresh_rate =
66− (crtc->mode.clock * 1000) /
67− (crtc->mode.htotal * crtc->mode.vtotal);
65+ pi->refresh_rate = drm_mode_vrefresh(&crtc->mode);
6866 break;
6967 }
7068 }
@@ -376,9 +374,8 @@ static void rs780_disable_vbios_powersaving(struct radeon_device *rdev) · 305 unmodified lines
376374 WREG32_P(CG_INTGFX_MISC, 0, ~0xFFF00000);
377375 }
378376
379−static void rs780_force_voltage_to_high(struct radeon_device *rdev)
377+static void rs780_force_voltage(struct radeon_device *rdev, u16 voltage)
380378 {
381− struct igp_power_info *pi = rs780_get_pi(rdev);
382379 struct igp_ps *current_state = rs780_get_ps(rdev->pm.dpm.current_ps);
383380
384381 if ((current_state->max_voltage == RS780_VDDC_LEVEL_HIGH) &&
@@ -390,7 +387,7 @@ static void rs780_force_voltage_to_high(struct radeon_device *rdev) · 5 unmodified lines
390387 udelay(1);
391388
392389 WREG32_P(FVTHROT_PWM_CTRL_REG0,
393− STARTING_PWM_HIGHTIME(pi->max_voltage),
390+ STARTING_PWM_HIGHTIME(voltage),
394391 ~STARTING_PWM_HIGHTIME_MASK);
395392
396393 WREG32_P(FVTHROT_PWM_CTRL_REG0,
@@ -404,6 +401,26 @@ static void rs780_force_voltage_to_high(struct radeon_device *rdev) · 7 unmodified lines
404401 WREG32_P(GFX_MACRO_BYPASS_CNTL, 0, ~SPLL_BYPASS_CNTL);
405402 }
406403
404+static void rs780_force_fbdiv(struct radeon_device *rdev, u32 fb_div)
405+{
406+ struct igp_ps *current_state = rs780_get_ps(rdev->pm.dpm.current_ps);
407+
408+ if (current_state->sclk_low == current_state->sclk_high)
409+ return;
410+
411+ WREG32_P(GFX_MACRO_BYPASS_CNTL, SPLL_BYPASS_CNTL, ~SPLL_BYPASS_CNTL);
412+
413+ WREG32_P(FVTHROT_FBDIV_REG2, FORCED_FEEDBACK_DIV(fb_div),
414+ ~FORCED_FEEDBACK_DIV_MASK);
415+ WREG32_P(FVTHROT_FBDIV_REG1, STARTING_FEEDBACK_DIV(fb_div),
416+ ~STARTING_FEEDBACK_DIV_MASK);
417+ WREG32_P(FVTHROT_FBDIV_REG1, FORCE_FEEDBACK_DIV, ~FORCE_FEEDBACK_DIV);
418+
419+ udelay(100);
420+
421+ WREG32_P(GFX_MACRO_BYPASS_CNTL, 0, ~SPLL_BYPASS_CNTL);
422+}
423+
407424 static int rs780_set_engine_clock_scaling(struct radeon_device *rdev,
408425 struct radeon_ps *new_ps,
409426 struct radeon_ps *old_ps)
@@ -432,17 +449,13 @@ static int rs780_set_engine_clock_scaling(struct radeon_device *rdev, · 22 unmodified lines
432449 if (ret)
433450 return ret;
434451
435− WREG32_P(GFX_MACRO_BYPASS_CNTL, SPLL_BYPASS_CNTL, ~SPLL_BYPASS_CNTL);
436−
437− WREG32_P(FVTHROT_FBDIV_REG2, FORCED_FEEDBACK_DIV(max_dividers.fb_div),
438− ~FORCED_FEEDBACK_DIV_MASK);
439− WREG32_P(FVTHROT_FBDIV_REG1, STARTING_FEEDBACK_DIV(max_dividers.fb_div),
440− ~STARTING_FEEDBACK_DIV_MASK);
441− WREG32_P(FVTHROT_FBDIV_REG1, FORCE_FEEDBACK_DIV, ~FORCE_FEEDBACK_DIV);
442−
443− udelay(100);
452+ if ((min_dividers.ref_div != max_dividers.ref_div) ||
453+ (min_dividers.post_div != max_dividers.post_div) ||
454+ (max_dividers.ref_div != current_max_dividers.ref_div) ||
455+ (max_dividers.post_div != current_max_dividers.post_div))
456+ return -EINVAL;
444457
445− WREG32_P(GFX_MACRO_BYPASS_CNTL, 0, ~SPLL_BYPASS_CNTL);
458+ rs780_force_fbdiv(rdev, max_dividers.fb_div);
446459
447460 if (max_dividers.fb_div > min_dividers.fb_div) {
448461 WREG32_P(FVTHROT_FBDIV_REG0,
@@ -486,6 +499,9 @@ static void rs780_activate_engine_clk_scaling(struct radeon_device *rdev, · 37 unmodified lines
486499 (new_state->sclk_low == old_state->sclk_low))
487500 return;
488501
502+ if (new_state->sclk_high == new_state->sclk_low)
503+ return;
504+
489505 rs780_clk_scaling_enable(rdev, true);
490506 }
491507
@@ -649,7 +665,7 @@ int rs780_dpm_set_power_state(struct radeon_device *rdev) · 157 unmodified lines
649665 rs780_set_uvd_clock_before_set_eng_clock(rdev, new_ps, old_ps);
650666
651667 if (pi->voltage_control) {
652− rs780_force_voltage_to_high(rdev);
668+ rs780_force_voltage(rdev, pi->max_voltage);
653669 mdelay(5);
654670 }
655671
@@ -717,14 +733,18 @@ static void rs780_parse_pplib_non_clock_info(struct radeon_device *rdev, · 61 unmodified lines
717733 if (ATOM_PPLIB_NONCLOCKINFO_VER1 < table_rev) {
718734 rps->vclk = le32_to_cpu(non_clock_info->ulVCLK);
719735 rps->dclk = le32_to_cpu(non_clock_info->ulDCLK);
720− } else if (r600_is_uvd_state(rps->class, rps->class2)) {
721− rps->vclk = RS780_DEFAULT_VCLK_FREQ;
722− rps->dclk = RS780_DEFAULT_DCLK_FREQ;
723736 } else {
724737 rps->vclk = 0;
725738 rps->dclk = 0;
726739 }
727740
741+ if (r600_is_uvd_state(rps->class, rps->class2)) {
742+ if ((rps->vclk == 0) || (rps->dclk == 0)) {
743+ rps->vclk = RS780_DEFAULT_VCLK_FREQ;
744+ rps->dclk = RS780_DEFAULT_DCLK_FREQ;
745+ }
746+ }
747+
728748 if (rps->class & ATOM_PPLIB_CLASSIFICATION_BOOT)
729749 rdev->pm.dpm.boot_ps = rps;
730750 if (rps->class & ATOM_PPLIB_CLASSIFICATION_UVDSTATE)
@@ -986,3 +1006,55 @@ void rs780_dpm_debugfs_print_current_performance_level(struct radeon_device *rde · 255 unmodified lines
9861006 seq_printf(m, "power level 1 sclk: %u vddc_index: %d\n",
9871007 ps->sclk_high, ps->max_voltage);
9881008 }
1009+
1010+int rs780_dpm_force_performance_level(struct radeon_device *rdev,
1011+ enum radeon_dpm_forced_level level)
1012+{
1013+ struct igp_power_info *pi = rs780_get_pi(rdev);
1014+ struct radeon_ps *rps = rdev->pm.dpm.current_ps;
1015+ struct igp_ps *ps = rs780_get_ps(rps);
1016+ struct atom_clock_dividers dividers;
1017+ int ret;
1018+
1019+ rs780_clk_scaling_enable(rdev, false);
1020+ rs780_voltage_scaling_enable(rdev, false);
1021+
1022+ if (level == RADEON_DPM_FORCED_LEVEL_HIGH) {
1023+ if (pi->voltage_control)
1024+ rs780_force_voltage(rdev, pi->max_voltage);
1025+
1026+ ret = radeon_atom_get_clock_dividers(rdev, COMPUTE_ENGINE_PLL_PARAM,
1027+ ps->sclk_high, false, &dividers);
1028+ if (ret)
1029+ return ret;
1030+
1031+ rs780_force_fbdiv(rdev, dividers.fb_div);
1032+ } else if (level == RADEON_DPM_FORCED_LEVEL_LOW) {
1033+ ret = radeon_atom_get_clock_dividers(rdev, COMPUTE_ENGINE_PLL_PARAM,
1034+ ps->sclk_low, false, &dividers);
1035+ if (ret)
1036+ return ret;
1037+
1038+ rs780_force_fbdiv(rdev, dividers.fb_div);
1039+
1040+ if (pi->voltage_control)
1041+ rs780_force_voltage(rdev, pi->min_voltage);
1042+ } else {
1043+ if (pi->voltage_control)
1044+ rs780_force_voltage(rdev, pi->max_voltage);
1045+
1046+ if (ps->sclk_high != ps->sclk_low) {
1047+ WREG32_P(FVTHROT_FBDIV_REG1, 0, ~FORCE_FEEDBACK_DIV);
1048+ rs780_clk_scaling_enable(rdev, true);
1049+ }
1050+
1051+ if (pi->voltage_control) {
1052+ rs780_voltage_scaling_enable(rdev, true);
1053+ rs780_enable_voltage_scaling(rdev, rps);
1054+ }
1055+ }
1056+
1057+ rdev->pm.dpm.forced_level = level;
1058+
1059+ return 0;
1060+}
drivers/gpu/drm/radeon/rv515.c+8−0
@@ -209,19 +209,27 @@ static void rv515_mc_init(struct radeon_device *rdev) · 208 unmodified lines
209209
210210 uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg)
211211 {
212+ unsigned long flags;
212213 uint32_t r;
213214
215+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
214216 WREG32(MC_IND_INDEX, 0x7f0000 | (reg & 0xffff));
215217 r = RREG32(MC_IND_DATA);
216218 WREG32(MC_IND_INDEX, 0);
219+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
220+
217221 return r;
218222 }
219223
220224 void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
221225 {
226+ unsigned long flags;
227+
228+ spin_lock_irqsave(&rdev->mc_idx_lock, flags);
222229 WREG32(MC_IND_INDEX, 0xff0000 | ((reg) & 0xffff));
223230 WREG32(MC_IND_DATA, (v));
224231 WREG32(MC_IND_INDEX, 0);
232+ spin_unlock_irqrestore(&rdev->mc_idx_lock, flags);
225233 }
226234
227235 #if defined(CONFIG_DEBUG_FS)
drivers/gpu/drm/radeon/rv6xx_dpm.c+0−2
@@ -1758,8 +1758,6 @@ int rv6xx_dpm_set_power_state(struct radeon_device *rdev) · 1757 unmodified lines
17581758
17591759 rv6xx_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps);
17601760
1761− rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO;
1762−
17631761 return 0;
17641762 }
17651763
drivers/gpu/drm/radeon/rv770_dpm.c+7−9
@@ -2064,12 +2064,6 @@ int rv770_dpm_set_power_state(struct radeon_device *rdev) · 2063 unmodified lines
20642064 rv770_program_dcodt_after_state_switch(rdev, new_ps, old_ps);
20652065 rv770_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps);
20662066
2067− ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
2068− if (ret) {
2069− DRM_ERROR("rv770_dpm_force_performance_level failed\n");
2070− return ret;
2071− }
2072−
20732067 return 0;
20742068 }
20752069
@@ -2147,14 +2141,18 @@ static void rv7xx_parse_pplib_non_clock_info(struct radeon_device *rdev, · 71 unmodified lines
21472141 if (ATOM_PPLIB_NONCLOCKINFO_VER1 < table_rev) {
21482142 rps->vclk = le32_to_cpu(non_clock_info->ulVCLK);
21492143 rps->dclk = le32_to_cpu(non_clock_info->ulDCLK);
2150− } else if (r600_is_uvd_state(rps->class, rps->class2)) {
2151− rps->vclk = RV770_DEFAULT_VCLK_FREQ;
2152− rps->dclk = RV770_DEFAULT_DCLK_FREQ;
21532144 } else {
21542145 rps->vclk = 0;
21552146 rps->dclk = 0;
21562147 }
21572148
2149+ if (r600_is_uvd_state(rps->class, rps->class2)) {
2150+ if ((rps->vclk == 0) || (rps->dclk == 0)) {
2151+ rps->vclk = RV770_DEFAULT_VCLK_FREQ;
2152+ rps->dclk = RV770_DEFAULT_DCLK_FREQ;
2153+ }
2154+ }
2155+
21582156 if (rps->class & ATOM_PPLIB_CLASSIFICATION_BOOT)
21592157 rdev->pm.dpm.boot_ps = rps;
21602158 if (rps->class & ATOM_PPLIB_CLASSIFICATION_UVDSTATE)
drivers/gpu/drm/radeon/rv770_smc.c+27−17
@@ -274,8 +274,8 @@ static const u8 cayman_smc_int_vectors[] = · 273 unmodified lines
274274 0x08, 0x72, 0x08, 0x72
275275 };
276276
277−int rv770_set_smc_sram_address(struct radeon_device *rdev,
278− u16 smc_address, u16 limit)
277+static int rv770_set_smc_sram_address(struct radeon_device *rdev,
278+ u16 smc_address, u16 limit)
279279 {
280280 u32 addr;
281281
@@ -296,9 +296,10 @@ int rv770_copy_bytes_to_smc(struct radeon_device *rdev, · 14 unmodified lines
296296 u16 smc_start_address, const u8 *src,
297297 u16 byte_count, u16 limit)
298298 {
299+ unsigned long flags;
299300 u32 data, original_data, extra_shift;
300301 u16 addr;
301− int ret;
302+ int ret = 0;
302303
303304 if (smc_start_address & 3)
304305 return -EINVAL;
@@ -307,13 +308,14 @@ int rv770_copy_bytes_to_smc(struct radeon_device *rdev, · 2 unmodified lines
307308
308309 addr = smc_start_address;
309310
311+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
310312 while (byte_count >= 4) {
311313 /* SMC address space is BE */
312314 data = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3];
313315
314316 ret = rv770_set_smc_sram_address(rdev, addr, limit);
315317 if (ret)
316− return ret;
318+ goto done;
317319
318320 WREG32(SMC_SRAM_DATA, data);
319321
@@ -328,7 +330,7 @@ int rv770_copy_bytes_to_smc(struct radeon_device *rdev, · 8 unmodified lines
328330
329331 ret = rv770_set_smc_sram_address(rdev, addr, limit);
330332 if (ret)
331− return ret;
333+ goto done;
332334
333335 original_data = RREG32(SMC_SRAM_DATA);
334336
@@ -346,12 +348,15 @@ int rv770_copy_bytes_to_smc(struct radeon_device *rdev, · 11 unmodified lines
346348
347349 ret = rv770_set_smc_sram_address(rdev, addr, limit);
348350 if (ret)
349− return ret;
351+ goto done;
350352
351353 WREG32(SMC_SRAM_DATA, data);
352354 }
353355
354− return 0;
356+done:
357+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
358+
359+ return ret;
355360 }
356361
357362 static int rv770_program_interrupt_vectors(struct radeon_device *rdev,
@@ -461,12 +466,15 @@ PPSMC_Result rv770_wait_for_smc_inactive(struct radeon_device *rdev) · 103 unmodified lines
461466
462467 static void rv770_clear_smc_sram(struct radeon_device *rdev, u16 limit)
463468 {
469+ unsigned long flags;
464470 u16 i;
465471
472+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
466473 for (i = 0; i < limit; i += 4) {
467474 rv770_set_smc_sram_address(rdev, i, limit);
468475 WREG32(SMC_SRAM_DATA, 0);
469476 }
477+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
470478 }
471479
472480 int rv770_load_smc_ucode(struct radeon_device *rdev,
@@ -595,27 +603,29 @@ int rv770_load_smc_ucode(struct radeon_device *rdev, · 122 unmodified lines
595603 int rv770_read_smc_sram_dword(struct radeon_device *rdev,
596604 u16 smc_address, u32 *value, u16 limit)
597605 {
606+ unsigned long flags;
598607 int ret;
599608
609+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
600610 ret = rv770_set_smc_sram_address(rdev, smc_address, limit);
601− if (ret)
602− return ret;
603−
604− *value = RREG32(SMC_SRAM_DATA);
611+ if (ret == 0)
612+ *value = RREG32(SMC_SRAM_DATA);
613+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
605614
606− return 0;
615+ return ret;
607616 }
608617
609618 int rv770_write_smc_sram_dword(struct radeon_device *rdev,
610619 u16 smc_address, u32 value, u16 limit)
611620 {
621+ unsigned long flags;
612622 int ret;
613623
624+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
614625 ret = rv770_set_smc_sram_address(rdev, smc_address, limit);
615− if (ret)
616− return ret;
626+ if (ret == 0)
627+ WREG32(SMC_SRAM_DATA, value);
628+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
617629
618− WREG32(SMC_SRAM_DATA, value);
619−
620− return 0;
630+ return ret;
621631 }
drivers/gpu/drm/radeon/rv770_smc.h+0−2
@@ -187,8 +187,6 @@ typedef struct RV770_SMC_STATETABLE RV770_SMC_STATETABLE; · 186 unmodified lines
187187 #define RV770_SMC_SOFT_REGISTER_uvd_enabled 0x9C
188188 #define RV770_SMC_SOFT_REGISTER_is_asic_lombok 0xA0
189189
190−int rv770_set_smc_sram_address(struct radeon_device *rdev,
191− u16 smc_address, u16 limit);
192190 int rv770_copy_bytes_to_smc(struct radeon_device *rdev,
193191 u16 smc_start_address, const u8 *src,
194192 u16 byte_count, u16 limit);
drivers/gpu/drm/radeon/rv770d.h+1−1
@@ -852,7 +852,7 @@ · 851 unmodified lines
852852 #define AFMT_VBI_PACKET_CONTROL 0x7608
853853 # define AFMT_GENERIC0_UPDATE (1 << 2)
854854 #define AFMT_INFOFRAME_CONTROL0 0x760c
855−# define AFMT_AUDIO_INFO_SOURCE (1 << 6) /* 0 - sound block; 1 - hmdi regs */
855+# define AFMT_AUDIO_INFO_SOURCE (1 << 6) /* 0 - sound block; 1 - hdmi regs */
856856 # define AFMT_AUDIO_INFO_UPDATE (1 << 7)
857857 # define AFMT_MPEG_INFO_UPDATE (1 << 10)
858858 #define AFMT_GENERIC0_7 0x7610
drivers/gpu/drm/radeon/si.c+17−4
@@ -83,6 +83,8 @@ extern void si_dma_vm_set_page(struct radeon_device *rdev, · 82 unmodified lines
8383 uint64_t pe,
8484 uint64_t addr, unsigned count,
8585 uint32_t incr, uint32_t flags);
86+static void si_enable_gui_idle_interrupt(struct radeon_device *rdev,
87+ bool enable);
8688
8789 static const u32 verde_rlc_save_restore_register_list[] =
8890 {
@@ -3386,6 +3388,8 @@ static int si_cp_resume(struct radeon_device *rdev) · 3297 unmodified lines
33863388 u32 rb_bufsz;
33873389 int r;
33883390
3391+ si_enable_gui_idle_interrupt(rdev, false);
3392+
33893393 WREG32(CP_SEM_WAIT_TIMER, 0x0);
33903394 WREG32(CP_SEM_INCOMPLETE_TIMER_CNTL, 0x0);
33913395
@@ -3501,6 +3505,8 @@ static int si_cp_resume(struct radeon_device *rdev) · 109 unmodified lines
35013505 rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX].ready = false;
35023506 }
35033507
3508+ si_enable_gui_idle_interrupt(rdev, true);
3509+
35043510 return 0;
35053511 }
35063512
@@ -4888,7 +4894,7 @@ static void si_enable_gfx_cgpg(struct radeon_device *rdev, · 1381 unmodified lines
48884894 {
48894895 u32 tmp;
48904896
4891− if (enable && (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG)) {
4897+ if (enable && (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_PG)) {
48924898 tmp = RLC_PUD(0x10) | RLC_PDD(0x10) | RLC_TTPD(0x10) | RLC_MSD(0x10);
48934899 WREG32(RLC_TTOP_D, tmp);
48944900
@@ -5250,6 +5256,7 @@ void si_update_cg(struct radeon_device *rdev, · 355 unmodified lines
52505256 u32 block, bool enable)
52515257 {
52525258 if (block & RADEON_CG_BLOCK_GFX) {
5259+ si_enable_gui_idle_interrupt(rdev, false);
52535260 /* order matters! */
52545261 if (enable) {
52555262 si_enable_mgcg(rdev, true);
@@ -5258,6 +5265,7 @@ void si_update_cg(struct radeon_device *rdev, · 2 unmodified lines
52585265 si_enable_cgcg(rdev, false);
52595266 si_enable_mgcg(rdev, false);
52605267 }
5268+ si_enable_gui_idle_interrupt(rdev, true);
52615269 }
52625270
52635271 if (block & RADEON_CG_BLOCK_MC) {
@@ -5408,7 +5416,7 @@ static void si_init_pg(struct radeon_device *rdev) · 144 unmodified lines
54085416 si_init_dma_pg(rdev);
54095417 }
54105418 si_init_ao_cu_mask(rdev);
5411− if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_CG) {
5419+ if (rdev->pg_flags & RADEON_PG_SUPPORT_GFX_PG) {
54125420 si_init_gfx_cgpg(rdev);
54135421 }
54145422 si_enable_dma_pg(rdev, true);
@@ -5560,7 +5568,9 @@ static void si_disable_interrupt_state(struct radeon_device *rdev) · 145 unmodified lines
55605568 {
55615569 u32 tmp;
55625570
5563− WREG32(CP_INT_CNTL_RING0, CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
5571+ tmp = RREG32(CP_INT_CNTL_RING0) &
5572+ (CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
5573+ WREG32(CP_INT_CNTL_RING0, tmp);
55645574 WREG32(CP_INT_CNTL_RING1, 0);
55655575 WREG32(CP_INT_CNTL_RING2, 0);
55665576 tmp = RREG32(DMA_CNTL + DMA0_REGISTER_OFFSET) & ~TRAP_ENABLE;
@@ -5685,7 +5695,7 @@ static int si_irq_init(struct radeon_device *rdev) · 118 unmodified lines
56855695
56865696 int si_irq_set(struct radeon_device *rdev)
56875697 {
5688− u32 cp_int_cntl = CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE;
5698+ u32 cp_int_cntl;
56895699 u32 cp_int_cntl1 = 0, cp_int_cntl2 = 0;
56905700 u32 crtc1 = 0, crtc2 = 0, crtc3 = 0, crtc4 = 0, crtc5 = 0, crtc6 = 0;
56915701 u32 hpd1 = 0, hpd2 = 0, hpd3 = 0, hpd4 = 0, hpd5 = 0, hpd6 = 0;
@@ -5706,6 +5716,9 @@ int si_irq_set(struct radeon_device *rdev) · 14 unmodified lines
57065716 return 0;
57075717 }
57085718
5719+ cp_int_cntl = RREG32(CP_INT_CNTL_RING0) &
5720+ (CNTX_BUSY_INT_ENABLE | CNTX_EMPTY_INT_ENABLE);
5721+
57095722 if (!ASIC_IS_NODCE(rdev)) {
57105723 hpd1 = RREG32(DC_HPD1_INT_CONTROL) & ~DC_HPDx_INT_EN;
57115724 hpd2 = RREG32(DC_HPD2_INT_CONTROL) & ~DC_HPDx_INT_EN;
drivers/gpu/drm/radeon/si_dpm.c+24−6
@@ -2910,6 +2910,7 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, · 2909 unmodified lines
29102910 bool disable_sclk_switching = false;
29112911 u32 mclk, sclk;
29122912 u16 vddc, vddci;
2913+ u32 max_sclk_vddc, max_mclk_vddci, max_mclk_vddc;
29132914 int i;
29142915
29152916 if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
@@ -2943,6 +2944,29 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, · 27 unmodified lines
29432944 }
29442945 }
29452946
2947+ /* limit clocks to max supported clocks based on voltage dependency tables */
2948+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_sclk,
2949+ &max_sclk_vddc);
2950+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddci_dependency_on_mclk,
2951+ &max_mclk_vddci);
2952+ btc_get_max_clock_from_voltage_dependency_table(&rdev->pm.dpm.dyn_state.vddc_dependency_on_mclk,
2953+ &max_mclk_vddc);
2954+
2955+ for (i = 0; i < ps->performance_level_count; i++) {
2956+ if (max_sclk_vddc) {
2957+ if (ps->performance_levels[i].sclk > max_sclk_vddc)
2958+ ps->performance_levels[i].sclk = max_sclk_vddc;
2959+ }
2960+ if (max_mclk_vddci) {
2961+ if (ps->performance_levels[i].mclk > max_mclk_vddci)
2962+ ps->performance_levels[i].mclk = max_mclk_vddci;
2963+ }
2964+ if (max_mclk_vddc) {
2965+ if (ps->performance_levels[i].mclk > max_mclk_vddc)
2966+ ps->performance_levels[i].mclk = max_mclk_vddc;
2967+ }
2968+ }
2969+
29462970 /* XXX validate the min clocks required for display */
29472971
29482972 if (disable_mclk_switching) {
@@ -6075,12 +6099,6 @@ int si_dpm_set_power_state(struct radeon_device *rdev) · 3126 unmodified lines
60756099 return ret;
60766100 }
60776101
6078− ret = si_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO);
6079− if (ret) {
6080− DRM_ERROR("si_dpm_force_performance_level failed\n");
6081− return ret;
6082− }
6083−
60846102 si_update_cg(rdev, (RADEON_CG_BLOCK_GFX |
60856103 RADEON_CG_BLOCK_MC |
60866104 RADEON_CG_BLOCK_SDMA |
drivers/gpu/drm/radeon/si_smc.c+28−15
@@ -29,8 +29,8 @@ · 28 unmodified lines
2929 #include "ppsmc.h"
3030 #include "radeon_ucode.h"
3131
32−int si_set_smc_sram_address(struct radeon_device *rdev,
33− u32 smc_address, u32 limit)
32+static int si_set_smc_sram_address(struct radeon_device *rdev,
33+ u32 smc_address, u32 limit)
3434 {
3535 if (smc_address & 3)
3636 return -EINVAL;
@@ -47,7 +47,8 @@ int si_copy_bytes_to_smc(struct radeon_device *rdev, · 10 unmodified lines
4747 u32 smc_start_address,
4848 const u8 *src, u32 byte_count, u32 limit)
4949 {
50− int ret;
50+ unsigned long flags;
51+ int ret = 0;
5152 u32 data, original_data, addr, extra_shift;
5253
5354 if (smc_start_address & 3)
@@ -57,13 +58,14 @@ int si_copy_bytes_to_smc(struct radeon_device *rdev, · 3 unmodified lines
5758
5859 addr = smc_start_address;
5960
61+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
6062 while (byte_count >= 4) {
6163 /* SMC address space is BE */
6264 data = (src[0] << 24) | (src[1] << 16) | (src[2] << 8) | src[3];
6365
6466 ret = si_set_smc_sram_address(rdev, addr, limit);
6567 if (ret)
66− return ret;
68+ goto done;
6769
6870 WREG32(SMC_IND_DATA_0, data);
6971
@@ -78,7 +80,7 @@ int si_copy_bytes_to_smc(struct radeon_device *rdev, · 8 unmodified lines
7880
7981 ret = si_set_smc_sram_address(rdev, addr, limit);
8082 if (ret)
81− return ret;
83+ goto done;
8284
8385 original_data = RREG32(SMC_IND_DATA_0);
8486
@@ -96,11 +98,15 @@ int si_copy_bytes_to_smc(struct radeon_device *rdev, · 11 unmodified lines
9698
9799 ret = si_set_smc_sram_address(rdev, addr, limit);
98100 if (ret)
99− return ret;
101+ goto done;
100102
101103 WREG32(SMC_IND_DATA_0, data);
102104 }
103− return 0;
105+
106+done:
107+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
108+
109+ return ret;
104110 }
105111
106112 void si_start_smc(struct radeon_device *rdev)
@@ -203,6 +209,7 @@ PPSMC_Result si_wait_for_smc_inactive(struct radeon_device *rdev) · 96 unmodified lines
203209
204210 int si_load_smc_ucode(struct radeon_device *rdev, u32 limit)
205211 {
212+ unsigned long flags;
206213 u32 ucode_start_address;
207214 u32 ucode_size;
208215 const u8 *src;
@@ -241,6 +248,7 @@ int si_load_smc_ucode(struct radeon_device *rdev, u32 limit) · 32 unmodified lines
241248 return -EINVAL;
242249
243250 src = (const u8 *)rdev->smc_fw->data;
251+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
244252 WREG32(SMC_IND_INDEX_0, ucode_start_address);
245253 WREG32_P(SMC_IND_ACCESS_CNTL, AUTO_INCREMENT_IND_0, ~AUTO_INCREMENT_IND_0);
246254 while (ucode_size >= 4) {
@@ -253,6 +261,7 @@ int si_load_smc_ucode(struct radeon_device *rdev, u32 limit) · 6 unmodified lines
253261 ucode_size -= 4;
254262 }
255263 WREG32_P(SMC_IND_ACCESS_CNTL, 0, ~AUTO_INCREMENT_IND_0);
264+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
256265
257266 return 0;
258267 }
@@ -260,25 +269,29 @@ int si_load_smc_ucode(struct radeon_device *rdev, u32 limit) · 1 unmodified line
260269 int si_read_smc_sram_dword(struct radeon_device *rdev, u32 smc_address,
261270 u32 *value, u32 limit)
262271 {
272+ unsigned long flags;
263273 int ret;
264274
275+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
265276 ret = si_set_smc_sram_address(rdev, smc_address, limit);
266− if (ret)
267− return ret;
277+ if (ret == 0)
278+ *value = RREG32(SMC_IND_DATA_0);
279+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
268280
269− *value = RREG32(SMC_IND_DATA_0);
270− return 0;
281+ return ret;
271282 }
272283
273284 int si_write_smc_sram_dword(struct radeon_device *rdev, u32 smc_address,
274285 u32 value, u32 limit)
275286 {
287+ unsigned long flags;
276288 int ret;
277289
290+ spin_lock_irqsave(&rdev->smc_idx_lock, flags);
278291 ret = si_set_smc_sram_address(rdev, smc_address, limit);
279− if (ret)
280− return ret;
292+ if (ret == 0)
293+ WREG32(SMC_IND_DATA_0, value);
294+ spin_unlock_irqrestore(&rdev->smc_idx_lock, flags);
281295
282− WREG32(SMC_IND_DATA_0, value);
283− return 0;
296+ return ret;
284297 }
drivers/gpu/drm/radeon/sumo_dpm.c+0−2
@@ -1319,8 +1319,6 @@ int sumo_dpm_set_power_state(struct radeon_device *rdev) · 1318 unmodified lines
13191319 if (pi->enable_dpm)
13201320 sumo_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps);
13211321
1322− rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO;
1323−
13241322 return 0;
13251323 }
13261324
drivers/gpu/drm/radeon/trinity_dpm.c+16−1
@@ -1068,6 +1068,17 @@ static void trinity_update_requested_ps(struct radeon_device *rdev, · 1067 unmodified lines
10681068 pi->requested_rps.ps_priv = &pi->requested_ps;
10691069 }
10701070
1071+void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable)
1072+{
1073+ struct trinity_power_info *pi = trinity_get_pi(rdev);
1074+
1075+ if (pi->enable_bapm) {
1076+ trinity_acquire_mutex(rdev);
1077+ trinity_dpm_bapm_enable(rdev, enable);
1078+ trinity_release_mutex(rdev);
1079+ }
1080+}
1081+
10711082 int trinity_dpm_enable(struct radeon_device *rdev)
10721083 {
10731084 struct trinity_power_info *pi = trinity_get_pi(rdev);
@@ -1091,6 +1102,7 @@ int trinity_dpm_enable(struct radeon_device *rdev) · 17 unmodified lines
10911102 trinity_program_sclk_dpm(rdev);
10921103 trinity_start_dpm(rdev);
10931104 trinity_wait_for_dpm_enabled(rdev);
1105+ trinity_dpm_bapm_enable(rdev, false);
10941106 trinity_release_mutex(rdev);
10951107
10961108 if (rdev->irq.installed &&
@@ -1116,6 +1128,7 @@ void trinity_dpm_disable(struct radeon_device *rdev) · 19 unmodified lines
11161128 trinity_release_mutex(rdev);
11171129 return;
11181130 }
1131+ trinity_dpm_bapm_enable(rdev, false);
11191132 trinity_disable_clock_power_gating(rdev);
11201133 sumo_clear_vc(rdev);
11211134 trinity_wait_for_level_0(rdev);
@@ -1212,6 +1225,8 @@ int trinity_dpm_set_power_state(struct radeon_device *rdev) · 90 unmodified lines
12121225
12131226 trinity_acquire_mutex(rdev);
12141227 if (pi->enable_dpm) {
1228+ if (pi->enable_bapm)
1229+ trinity_dpm_bapm_enable(rdev, rdev->pm.dpm.ac_power);
12151230 trinity_set_uvd_clock_before_set_eng_clock(rdev, new_ps, old_ps);
12161231 trinity_enable_power_level_0(rdev);
12171232 trinity_force_level_0(rdev);
@@ -1221,7 +1236,6 @@ int trinity_dpm_set_power_state(struct radeon_device *rdev) · 3 unmodified lines
12211236 trinity_force_level_0(rdev);
12221237 trinity_unforce_levels(rdev);
12231238 trinity_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps);
1224− rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO;
12251239 }
12261240 trinity_release_mutex(rdev);
12271241
@@ -1854,6 +1868,7 @@ int trinity_dpm_init(struct radeon_device *rdev) · 626 unmodified lines
18541868 for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++)
18551869 pi->at[i] = TRINITY_AT_DFLT;
18561870
1871+ pi->enable_bapm = true;
18571872 pi->enable_nbps_policy = true;
18581873 pi->enable_sclk_ds = true;
18591874 pi->enable_gfx_power_gating = true;
drivers/gpu/drm/radeon/trinity_dpm.h+2−0
@@ -108,6 +108,7 @@ struct trinity_power_info { · 107 unmodified lines
108108 bool enable_auto_thermal_throttling;
109109 bool enable_dpm;
110110 bool enable_sclk_ds;
111+ bool enable_bapm;
111112 bool uvd_dpm;
112113 struct radeon_ps current_rps;
113114 struct trinity_ps current_ps;
@@ -118,6 +119,7 @@ struct trinity_power_info { · 4 unmodified lines
118119 #define TRINITY_AT_DFLT 30
119120
120121 /* trinity_smc.c */
122+int trinity_dpm_bapm_enable(struct radeon_device *rdev, bool enable);
121123 int trinity_dpm_config(struct radeon_device *rdev, bool enable);
122124 int trinity_uvd_dpm_config(struct radeon_device *rdev);
123125 int trinity_dpm_force_state(struct radeon_device *rdev, u32 n);
drivers/gpu/drm/radeon/trinity_smc.c+8−0
@@ -56,6 +56,14 @@ static int trinity_notify_message_to_smu(struct radeon_device *rdev, u32 id) · 55 unmodified lines
5656 return 0;
5757 }
5858
59+int trinity_dpm_bapm_enable(struct radeon_device *rdev, bool enable)
60+{
61+ if (enable)
62+ return trinity_notify_message_to_smu(rdev, PPSMC_MSG_EnableBAPM);
63+ else
64+ return trinity_notify_message_to_smu(rdev, PPSMC_MSG_DisableBAPM);
65+}
66+
5967 int trinity_dpm_config(struct radeon_device *rdev, bool enable)
6068 {
6169 if (enable)
drivers/gpu/drm/radeon/uvd_v1_0.c+2−2
@@ -212,8 +212,8 @@ int uvd_v1_0_start(struct radeon_device *rdev) · 211 unmodified lines
212212 /* enable VCPU clock */
213213 WREG32(UVD_VCPU_CNTL, 1 << 9);
214214
215− /* enable UMC */
216− WREG32_P(UVD_LMI_CTRL2, 0, ~(1 << 8));
215+ /* enable UMC and NC0 */
216+ WREG32_P(UVD_LMI_CTRL2, 1 << 13, ~((1 << 8) | (1 << 13)));
217217
218218 /* boot up the VCPU */
219219 WREG32(UVD_SOFT_RESET, 0);
drivers/gpu/drm/ttm/ttm_object.c+1−1
@@ -218,7 +218,7 @@ struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file *tfile, · 217 unmodified lines
218218 uint32_t key)
219219 {
220220 struct ttm_object_device *tdev = tfile->tdev;
221− struct ttm_base_object *base;
221+ struct ttm_base_object *uninitialized_var(base);
222222 struct drm_hash_item *hash;
223223 int ret;
224224
drivers/gpu/drm/ttm/ttm_tt.c+1−1
@@ -170,7 +170,7 @@ void ttm_tt_destroy(struct ttm_tt *ttm) · 169 unmodified lines
170170 ttm_tt_unbind(ttm);
171171 }
172172
173− if (likely(ttm->pages != NULL)) {
173+ if (ttm->state == tt_unbound) {
174174 ttm->bdev->driver->ttm_tt_unpopulate(ttm);
175175 }
176176
drivers/gpu/drm/udl/udl_gem.c+0−1
@@ -97,7 +97,6 @@ int udl_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) · 96 unmodified lines
9797 ret = vm_insert_page(vma, (unsigned long)vmf->virtual_address, page);
9898 switch (ret) {
9999 case -EAGAIN:
100− set_need_resched();
101100 case 0:
102101 case -ERESTARTSYS:
103102 return VM_FAULT_NOPAGE;
drivers/hv/connection.c+1−1
@@ -195,7 +195,7 @@ int vmbus_connect(void) · 194 unmodified lines
195195
196196 do {
197197 ret = vmbus_negotiate_version(msginfo, version);
198− if (ret)
198+ if (ret == -ETIMEDOUT)
199199 goto cleanup;
200200
201201 if (vmbus_connection.conn_state == CONNECTED)
drivers/hv/hv_kvp.c+26−12
@@ -32,13 +32,17 @@ · 31 unmodified lines
3232 /*
3333 * Pre win8 version numbers used in ws2008 and ws 2008 r2 (win7)
3434 */
35+#define WS2008_SRV_MAJOR 1
36+#define WS2008_SRV_MINOR 0
37+#define WS2008_SRV_VERSION (WS2008_SRV_MAJOR << 16 | WS2008_SRV_MINOR)
38+
3539 #define WIN7_SRV_MAJOR 3
3640 #define WIN7_SRV_MINOR 0
37−#define WIN7_SRV_MAJOR_MINOR (WIN7_SRV_MAJOR << 16 | WIN7_SRV_MINOR)
41+#define WIN7_SRV_VERSION (WIN7_SRV_MAJOR << 16 | WIN7_SRV_MINOR)
3842
3943 #define WIN8_SRV_MAJOR 4
4044 #define WIN8_SRV_MINOR 0
41−#define WIN8_SRV_MAJOR_MINOR (WIN8_SRV_MAJOR << 16 | WIN8_SRV_MINOR)
45+#define WIN8_SRV_VERSION (WIN8_SRV_MAJOR << 16 | WIN8_SRV_MINOR)
4246
4347 /*
4448 * Global state maintained for transaction that is being processed.
@@ -587,6 +591,8 @@ void hv_kvp_onchannelcallback(void *context) · 542 unmodified lines
587591
588592 struct icmsg_hdr *icmsghdrp;
589593 struct icmsg_negotiate *negop = NULL;
594+ int util_fw_version;
595+ int kvp_srv_version;
590596
591597 if (kvp_transaction.active) {
592598 /*
@@ -606,17 +612,26 @@ void hv_kvp_onchannelcallback(void *context) · 13 unmodified lines
606612
607613 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
608614 /*
609− * We start with win8 version and if the host cannot
610− * support that we use the previous version.
615+ * Based on the host, select appropriate
616+ * framework and service versions we will
617+ * negotiate.
611618 */
612− if (vmbus_prep_negotiate_resp(icmsghdrp, negop,
613− recv_buffer, UTIL_FW_MAJOR_MINOR,
614− WIN8_SRV_MAJOR_MINOR))
615− goto done;
616−
619+ switch (vmbus_proto_version) {
620+ case (VERSION_WS2008):
621+ util_fw_version = UTIL_WS2K8_FW_VERSION;
622+ kvp_srv_version = WS2008_SRV_VERSION;
623+ break;
624+ case (VERSION_WIN7):
625+ util_fw_version = UTIL_FW_VERSION;
626+ kvp_srv_version = WIN7_SRV_VERSION;
627+ break;
628+ default:
629+ util_fw_version = UTIL_FW_VERSION;
630+ kvp_srv_version = WIN8_SRV_VERSION;
631+ }
617632 vmbus_prep_negotiate_resp(icmsghdrp, negop,
618− recv_buffer, UTIL_FW_MAJOR_MINOR,
619− WIN7_SRV_MAJOR_MINOR);
633+ recv_buffer, util_fw_version,
634+ kvp_srv_version);
620635
621636 } else {
622637 kvp_msg = (struct hv_kvp_msg *)&recv_buffer[
@@ -649,7 +664,6 @@ void hv_kvp_onchannelcallback(void *context) · 26 unmodified lines
649664 return;
650665
651666 }
652−done:
653667
654668 icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
655669 | ICMSGHDRFLAG_RESPONSE;
drivers/hv/hv_snapshot.c+3−3
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626
2727 #define VSS_MAJOR 5
2828 #define VSS_MINOR 0
29−#define VSS_MAJOR_MINOR (VSS_MAJOR << 16 | VSS_MINOR)
29+#define VSS_VERSION (VSS_MAJOR << 16 | VSS_MINOR)
3030
3131
3232
@@ -190,8 +190,8 @@ void hv_vss_onchannelcallback(void *context) · 157 unmodified lines
190190
191191 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
192192 vmbus_prep_negotiate_resp(icmsghdrp, negop,
193− recv_buffer, UTIL_FW_MAJOR_MINOR,
194− VSS_MAJOR_MINOR);
193+ recv_buffer, UTIL_FW_VERSION,
194+ VSS_VERSION);
195195 } else {
196196 vss_msg = (struct hv_vss_msg *)&recv_buffer[
197197 sizeof(struct vmbuspipe_hdr) +
drivers/hv/hv_util.c+54−17
@@ -28,17 +28,32 @@ · 27 unmodified lines
2828 #include <linux/reboot.h>
2929 #include <linux/hyperv.h>
3030
31−#define SHUTDOWN_MAJOR 3
32−#define SHUTDOWN_MINOR 0
33−#define SHUTDOWN_MAJOR_MINOR (SHUTDOWN_MAJOR << 16 | SHUTDOWN_MINOR)
3431
35−#define TIMESYNCH_MAJOR 3
36−#define TIMESYNCH_MINOR 0
37−#define TIMESYNCH_MAJOR_MINOR (TIMESYNCH_MAJOR << 16 | TIMESYNCH_MINOR)
32+#define SD_MAJOR 3
33+#define SD_MINOR 0
34+#define SD_VERSION (SD_MAJOR << 16 | SD_MINOR)
3835
39−#define HEARTBEAT_MAJOR 3
40−#define HEARTBEAT_MINOR 0
41−#define HEARTBEAT_MAJOR_MINOR (HEARTBEAT_MAJOR << 16 | HEARTBEAT_MINOR)
36+#define SD_WS2008_MAJOR 1
37+#define SD_WS2008_VERSION (SD_WS2008_MAJOR << 16 | SD_MINOR)
38+
39+#define TS_MAJOR 3
40+#define TS_MINOR 0
41+#define TS_VERSION (TS_MAJOR << 16 | TS_MINOR)
42+
43+#define TS_WS2008_MAJOR 1
44+#define TS_WS2008_VERSION (TS_WS2008_MAJOR << 16 | TS_MINOR)
45+
46+#define HB_MAJOR 3
47+#define HB_MINOR 0
48+#define HB_VERSION (HB_MAJOR << 16 | HB_MINOR)
49+
50+#define HB_WS2008_MAJOR 1
51+#define HB_WS2008_VERSION (HB_WS2008_MAJOR << 16 | HB_MINOR)
52+
53+static int sd_srv_version;
54+static int ts_srv_version;
55+static int hb_srv_version;
56+static int util_fw_version;
4257
4358 static void shutdown_onchannelcallback(void *context);
4459 static struct hv_util_service util_shutdown = {
@@ -99,8 +114,8 @@ static void shutdown_onchannelcallback(void *context) · 54 unmodified lines
99114
100115 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
101116 vmbus_prep_negotiate_resp(icmsghdrp, negop,
102− shut_txf_buf, UTIL_FW_MAJOR_MINOR,
103− SHUTDOWN_MAJOR_MINOR);
117+ shut_txf_buf, util_fw_version,
118+ sd_srv_version);
104119 } else {
105120 shutdown_msg =
106121 (struct shutdown_msg_data *)&shut_txf_buf[
@@ -216,6 +231,7 @@ static void timesync_onchannelcallback(void *context) · 109 unmodified lines
216231 struct icmsg_hdr *icmsghdrp;
217232 struct ictimesync_data *timedatap;
218233 u8 *time_txf_buf = util_timesynch.recv_buffer;
234+ struct icmsg_negotiate *negop = NULL;
219235
220236 vmbus_recvpacket(channel, time_txf_buf,
221237 PAGE_SIZE, &recvlen, &requestid);
@@ -225,9 +241,10 @@ static void timesync_onchannelcallback(void *context) · 3 unmodified lines
225241 sizeof(struct vmbuspipe_hdr)];
226242
227243 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
228− vmbus_prep_negotiate_resp(icmsghdrp, NULL, time_txf_buf,
229− UTIL_FW_MAJOR_MINOR,
230− TIMESYNCH_MAJOR_MINOR);
244+ vmbus_prep_negotiate_resp(icmsghdrp, negop,
245+ time_txf_buf,
246+ util_fw_version,
247+ ts_srv_version);
231248 } else {
232249 timedatap = (struct ictimesync_data *)&time_txf_buf[
233250 sizeof(struct vmbuspipe_hdr) +
@@ -257,6 +274,7 @@ static void heartbeat_onchannelcallback(void *context) · 23 unmodified lines
257274 struct icmsg_hdr *icmsghdrp;
258275 struct heartbeat_msg_data *heartbeat_msg;
259276 u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
277+ struct icmsg_negotiate *negop = NULL;
260278
261279 vmbus_recvpacket(channel, hbeat_txf_buf,
262280 PAGE_SIZE, &recvlen, &requestid);
@@ -266,9 +284,9 @@ static void heartbeat_onchannelcallback(void *context) · 3 unmodified lines
266284 sizeof(struct vmbuspipe_hdr)];
267285
268286 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
269− vmbus_prep_negotiate_resp(icmsghdrp, NULL,
270− hbeat_txf_buf, UTIL_FW_MAJOR_MINOR,
271− HEARTBEAT_MAJOR_MINOR);
287+ vmbus_prep_negotiate_resp(icmsghdrp, negop,
288+ hbeat_txf_buf, util_fw_version,
289+ hb_srv_version);
272290 } else {
273291 heartbeat_msg =
274292 (struct heartbeat_msg_data *)&hbeat_txf_buf[
@@ -321,6 +339,25 @@ static int util_probe(struct hv_device *dev, · 46 unmodified lines
321339 goto error;
322340
323341 hv_set_drvdata(dev, srv);
342+ /*
343+ * Based on the host; initialize the framework and
344+ * service version numbers we will negotiate.
345+ */
346+ switch (vmbus_proto_version) {
347+ case (VERSION_WS2008):
348+ util_fw_version = UTIL_WS2K8_FW_VERSION;
349+ sd_srv_version = SD_WS2008_VERSION;
350+ ts_srv_version = TS_WS2008_VERSION;
351+ hb_srv_version = HB_WS2008_VERSION;
352+ break;
353+
354+ default:
355+ util_fw_version = UTIL_FW_VERSION;
356+ sd_srv_version = SD_VERSION;
357+ ts_srv_version = TS_VERSION;
358+ hb_srv_version = HB_VERSION;
359+ }
360+
324361 return 0;
325362
326363 error:
drivers/hwmon/applesmc.c+10−1
@@ -525,16 +525,25 @@ static int applesmc_init_smcreg_try(void) · 524 unmodified lines
525525 {
526526 struct applesmc_registers *s = &smcreg;
527527 bool left_light_sensor, right_light_sensor;
528+ unsigned int count;
528529 u8 tmp[1];
529530 int ret;
530531
531532 if (s->init_complete)
532533 return 0;
533534
534− ret = read_register_count(&s->key_count);
535+ ret = read_register_count(&count);
535536 if (ret)
536537 return ret;
537538
539+ if (s->cache && s->key_count != count) {
540+ pr_warn("key count changed from %d to %d\n",
541+ s->key_count, count);
542+ kfree(s->cache);
543+ s->cache = NULL;
544+ }
545+ s->key_count = count;
546+
538547 if (!s->cache)
539548 s->cache = kcalloc(s->key_count, sizeof(*s->cache), GFP_KERNEL);
540549 if (!s->cache)
drivers/i2c/busses/i2c-designware-core.c+20−6
@@ -98,6 +98,8 @@ · 97 unmodified lines
9898
9999 #define DW_IC_ERR_TX_ABRT 0x1
100100
101+#define DW_IC_TAR_10BITADDR_MASTER BIT(12)
102+
101103 /*
102104 * status codes
103105 */
@@ -388,22 +390,34 @@ static int i2c_dw_wait_bus_not_busy(struct dw_i2c_dev *dev) · 284 unmodified lines
388390 static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
389391 {
390392 struct i2c_msg *msgs = dev->msgs;
391− u32 ic_con;
393+ u32 ic_con, ic_tar = 0;
392394
393395 /* Disable the adapter */
394396 __i2c_dw_enable(dev, false);
395397
396− /* set the slave (target) address */
397− dw_writel(dev, msgs[dev->msg_write_idx].addr, DW_IC_TAR);
398−
399398 /* if the slave address is ten bit address, enable 10BITADDR */
400399 ic_con = dw_readl(dev, DW_IC_CON);
401− if (msgs[dev->msg_write_idx].flags & I2C_M_TEN)
400+ if (msgs[dev->msg_write_idx].flags & I2C_M_TEN) {
402401 ic_con |= DW_IC_CON_10BITADDR_MASTER;
403− else
402+ /*
403+ * If I2C_DYNAMIC_TAR_UPDATE is set, the 10-bit addressing
404+ * mode has to be enabled via bit 12 of IC_TAR register.
405+ * We set it always as I2C_DYNAMIC_TAR_UPDATE can't be
406+ * detected from registers.
407+ */
408+ ic_tar = DW_IC_TAR_10BITADDR_MASTER;
409+ } else {
404410 ic_con &= ~DW_IC_CON_10BITADDR_MASTER;
411+ }
412+
405413 dw_writel(dev, ic_con, DW_IC_CON);
406414
415+ /*
416+ * Set the slave (target) address and enable 10-bit addressing mode
417+ * if applicable.
418+ */
419+ dw_writel(dev, msgs[dev->msg_write_idx].addr | ic_tar, DW_IC_TAR);
420+
407421 /* Enable the adapter */
408422 __i2c_dw_enable(dev, true);
409423
drivers/i2c/busses/i2c-ismt.c+3−0
@@ -393,6 +393,9 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr, · 392 unmodified lines
393393
394394 desc = &priv->hw[priv->head];
395395
396+ /* Initialize the DMA buffer */
397+ memset(priv->dma_buffer, 0, sizeof(priv->dma_buffer));
398+
396399 /* Initialize the descriptor */
397400 memset(desc, 0, sizeof(struct ismt_desc));
398401 desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write);
drivers/i2c/busses/i2c-mv64xxx.c+9−7
@@ -234,9 +234,9 @@ static int mv64xxx_i2c_offload_msg(struct mv64xxx_i2c_data *drv_data) · 233 unmodified lines
234234 ctrl_reg |= MV64XXX_I2C_BRIDGE_CONTROL_WR |
235235 (msg->len - 1) << MV64XXX_I2C_BRIDGE_CONTROL_TX_SIZE_SHIFT;
236236
237− writel_relaxed(data_reg_lo,
237+ writel(data_reg_lo,
238238 drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_LO);
239− writel_relaxed(data_reg_hi,
239+ writel(data_reg_hi,
240240 drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_HI);
241241
242242 } else {
@@ -697,6 +697,7 @@ static const struct of_device_id mv64xxx_i2c_of_match_table[] = { · 454 unmodified lines
697697 MODULE_DEVICE_TABLE(of, mv64xxx_i2c_of_match_table);
698698
699699 #ifdef CONFIG_OF
700+#ifdef CONFIG_HAVE_CLK
700701 static int
701702 mv64xxx_calc_freq(const int tclk, const int n, const int m)
702703 {
@@ -726,16 +727,12 @@ mv64xxx_find_baud_factors(const u32 req_freq, const u32 tclk, u32 *best_n, · 23 unmodified lines
726727 return false;
727728 return true;
728729 }
730+#endif /* CONFIG_HAVE_CLK */
729731
730732 static int
731733 mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
732734 struct device *dev)
733735 {
734− const struct of_device_id *device;
735− struct device_node *np = dev->of_node;
736− u32 bus_freq, tclk;
737− int rc = 0;
738−
739736 /* CLK is mandatory when using DT to describe the i2c bus. We
740737 * need to know tclk in order to calculate bus clock
741738 * factors.
@@ -744,6 +741,11 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data, · 2 unmodified lines
744741 /* Have OF but no CLK */
745742 return -ENODEV;
746743 #else
744+ const struct of_device_id *device;
745+ struct device_node *np = dev->of_node;
746+ u32 bus_freq, tclk;
747+ int rc = 0;
748+
747749 if (IS_ERR(drv_data->clk)) {
748750 rc = -ENODEV;
749751 goto out;
drivers/i2c/busses/i2c-s3c2410.c+0−2
@@ -1178,8 +1178,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) · 1177 unmodified lines
11781178
11791179 i2c_del_adapter(&i2c->adap);
11801180
1181− clk_disable_unprepare(i2c->clk);
1182−
11831181 if (pdev->dev.of_node && IS_ERR(i2c->pctrl))
11841182 s3c24xx_i2c_dt_gpio_free(i2c);
11851183
drivers/iio/accel/bma180.c+2−2
@@ -620,7 +620,7 @@ static int bma180_remove(struct i2c_client *client) · 619 unmodified lines
620620 #ifdef CONFIG_PM_SLEEP
621621 static int bma180_suspend(struct device *dev)
622622 {
623− struct iio_dev *indio_dev = dev_to_iio_dev(dev);
623+ struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
624624 struct bma180_data *data = iio_priv(indio_dev);
625625 int ret;
626626
@@ -633,7 +633,7 @@ static int bma180_suspend(struct device *dev) · 6 unmodified lines
633633
634634 static int bma180_resume(struct device *dev)
635635 {
636− struct iio_dev *indio_dev = dev_to_iio_dev(dev);
636+ struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
637637 struct bma180_data *data = iio_priv(indio_dev);
638638 int ret;
639639
drivers/iio/adc/at91_adc.c+6−5
@@ -556,7 +556,7 @@ static const struct iio_info at91_adc_info = { · 555 unmodified lines
556556
557557 static int at91_adc_probe(struct platform_device *pdev)
558558 {
559− unsigned int prsc, mstrclk, ticks, adc_clk, shtim;
559+ unsigned int prsc, mstrclk, ticks, adc_clk, adc_clk_khz, shtim;
560560 int ret;
561561 struct iio_dev *idev;
562562 struct at91_adc_state *st;
@@ -649,6 +649,7 @@ static int at91_adc_probe(struct platform_device *pdev) · 86 unmodified lines
649649 */
650650 mstrclk = clk_get_rate(st->clk);
651651 adc_clk = clk_get_rate(st->adc_clk);
652+ adc_clk_khz = adc_clk / 1000;
652653 prsc = (mstrclk / (2 * adc_clk)) - 1;
653654
654655 if (!st->startup_time) {
@@ -662,15 +663,15 @@ static int at91_adc_probe(struct platform_device *pdev) · 7 unmodified lines
662663 * defined in the electrical characteristics of the board, divided by 8.
663664 * The formula thus is : Startup Time = (ticks + 1) * 8 / ADC Clock
664665 */
665− ticks = round_up((st->startup_time * adc_clk /
666− 1000000) - 1, 8) / 8;
666+ ticks = round_up((st->startup_time * adc_clk_khz /
667+ 1000) - 1, 8) / 8;
667668 /*
668669 * a minimal Sample and Hold Time is necessary for the ADC to guarantee
669670 * the best converted final value between two channels selection
670671 * The formula thus is : Sample and Hold Time = (shtim + 1) / ADCClock
671672 */
672− shtim = round_up((st->sample_hold_time * adc_clk /
673− 1000000) - 1, 1);
673+ shtim = round_up((st->sample_hold_time * adc_clk_khz /
674+ 1000) - 1, 1);
674675
675676 reg = AT91_ADC_PRESCAL_(prsc) & st->registers->mr_prescal_mask;
676677 reg |= AT91_ADC_STARTUP_(ticks) & st->registers->mr_startup_mask;
drivers/iio/amplifiers/ad8366.c+1−3
@@ -185,10 +185,8 @@ static int ad8366_remove(struct spi_device *spi) · 184 unmodified lines
185185
186186 iio_device_unregister(indio_dev);
187187
188− if (!IS_ERR(reg)) {
188+ if (!IS_ERR(reg))
189189 regulator_disable(reg);
190− regulator_put(reg);
191− }
192190
193191 return 0;
194192 }
drivers/iio/buffer_cb.c+2−0
@@ -41,6 +41,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, · 40 unmodified lines
4141 goto error_ret;
4242 }
4343
44+ iio_buffer_init(&cb_buff->buffer);
45+
4446 cb_buff->private = private;
4547 cb_buff->cb = cb;
4648 cb_buff->buffer.access = &iio_cb_access;
drivers/iio/dac/mcp4725.c+6−6
@@ -37,21 +37,21 @@ struct mcp4725_data { · 36 unmodified lines
3737
3838 static int mcp4725_suspend(struct device *dev)
3939 {
40− struct iio_dev *indio_dev = dev_to_iio_dev(dev);
41− struct mcp4725_data *data = iio_priv(indio_dev);
40+ struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
41+ to_i2c_client(dev)));
4242 u8 outbuf[2];
4343
4444 outbuf[0] = (data->powerdown_mode + 1) << 4;
4545 outbuf[1] = 0;
4646 data->powerdown = true;
4747
48− return i2c_master_send(to_i2c_client(dev), outbuf, 2);
48+ return i2c_master_send(data->client, outbuf, 2);
4949 }
5050
5151 static int mcp4725_resume(struct device *dev)
5252 {
53− struct iio_dev *indio_dev = dev_to_iio_dev(dev);
54− struct mcp4725_data *data = iio_priv(indio_dev);
53+ struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
54+ to_i2c_client(dev)));
5555 u8 outbuf[2];
5656
5757 /* restore previous DAC value */
@@ -59,7 +59,7 @@ static int mcp4725_resume(struct device *dev) · 1 unmodified line
5959 outbuf[1] = data->dac_value & 0xff;
6060 data->powerdown = false;
6161
62− return i2c_master_send(to_i2c_client(dev), outbuf, 2);
62+ return i2c_master_send(data->client, outbuf, 2);
6363 }
6464
6565 #ifdef CONFIG_PM_SLEEP
drivers/iio/iio_core.h+4−0
@@ -49,11 +49,15 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf, · 48 unmodified lines
4949 #define iio_buffer_poll_addr (&iio_buffer_poll)
5050 #define iio_buffer_read_first_n_outer_addr (&iio_buffer_read_first_n_outer)
5151
52+void iio_disable_all_buffers(struct iio_dev *indio_dev);
53+
5254 #else
5355
5456 #define iio_buffer_poll_addr NULL
5557 #define iio_buffer_read_first_n_outer_addr NULL
5658
59+static inline void iio_disable_all_buffers(struct iio_dev *indio_dev) {}
60+
5761 #endif
5862
5963 int iio_device_register_eventset(struct iio_dev *indio_dev);
drivers/iio/industrialio-buffer.c+28−2
@@ -460,6 +460,25 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, const long *mask, · 459 unmodified lines
460460 return bytes;
461461 }
462462
463+void iio_disable_all_buffers(struct iio_dev *indio_dev)
464+{
465+ struct iio_buffer *buffer, *_buffer;
466+
467+ if (list_empty(&indio_dev->buffer_list))
468+ return;
469+
470+ if (indio_dev->setup_ops->predisable)
471+ indio_dev->setup_ops->predisable(indio_dev);
472+
473+ list_for_each_entry_safe(buffer, _buffer,
474+ &indio_dev->buffer_list, buffer_list)
475+ list_del_init(&buffer->buffer_list);
476+
477+ indio_dev->currentmode = INDIO_DIRECT_MODE;
478+ if (indio_dev->setup_ops->postdisable)
479+ indio_dev->setup_ops->postdisable(indio_dev);
480+}
481+
463482 int iio_update_buffers(struct iio_dev *indio_dev,
464483 struct iio_buffer *insert_buffer,
465484 struct iio_buffer *remove_buffer)
@@ -528,8 +547,15 @@ int iio_update_buffers(struct iio_dev *indio_dev, · 62 unmodified lines
528547 * Note can only occur when adding a buffer.
529548 */
530549 list_del(&insert_buffer->buffer_list);
531− indio_dev->active_scan_mask = old_mask;
532− success = -EINVAL;
550+ if (old_mask) {
551+ indio_dev->active_scan_mask = old_mask;
552+ success = -EINVAL;
553+ }
554+ else {
555+ kfree(compound_mask);
556+ ret = -EINVAL;
557+ goto error_ret;
558+ }
533559 }
534560 } else {
535561 indio_dev->active_scan_mask = compound_mask;
drivers/iio/industrialio-core.c+22−11
@@ -848,13 +848,10 @@ static void iio_device_unregister_sysfs(struct iio_dev *indio_dev) · 847 unmodified lines
848848 static void iio_dev_release(struct device *device)
849849 {
850850 struct iio_dev *indio_dev = dev_to_iio_dev(device);
851− if (indio_dev->chrdev.dev)
852− cdev_del(&indio_dev->chrdev);
853851 if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
854852 iio_device_unregister_trigger_consumer(indio_dev);
855853 iio_device_unregister_eventset(indio_dev);
856854 iio_device_unregister_sysfs(indio_dev);
857− iio_device_unregister_debugfs(indio_dev);
858855
859856 ida_simple_remove(&iio_ida, indio_dev->id);
860857 kfree(indio_dev);
@@ -970,6 +967,8 @@ static int iio_chrdev_open(struct inode *inode, struct file *filp) · 109 unmodified lines
970967 if (test_and_set_bit(IIO_BUSY_BIT_POS, &indio_dev->flags))
971968 return -EBUSY;
972969
970+ iio_device_get(indio_dev);
971+
973972 filp->private_data = indio_dev;
974973
975974 return 0;
@@ -983,6 +982,8 @@ static int iio_chrdev_release(struct inode *inode, struct file *filp) · 7 unmodified lines
983982 struct iio_dev *indio_dev = container_of(inode->i_cdev,
984983 struct iio_dev, chrdev);
985984 clear_bit(IIO_BUSY_BIT_POS, &indio_dev->flags);
985+ iio_device_put(indio_dev);
986+
986987 return 0;
987988 }
988989
@@ -1052,18 +1053,20 @@ int iio_device_register(struct iio_dev *indio_dev) · 63 unmodified lines
10521053 indio_dev->setup_ops == NULL)
10531054 indio_dev->setup_ops = &noop_ring_setup_ops;
10541055
1055− ret = device_add(&indio_dev->dev);
1056− if (ret < 0)
1057− goto error_unreg_eventset;
10581056 cdev_init(&indio_dev->chrdev, &iio_buffer_fileops);
10591057 indio_dev->chrdev.owner = indio_dev->info->driver_module;
1058+ indio_dev->chrdev.kobj.parent = &indio_dev->dev.kobj;
10601059 ret = cdev_add(&indio_dev->chrdev, indio_dev->dev.devt, 1);
10611060 if (ret < 0)
1062− goto error_del_device;
1063− return 0;
1061+ goto error_unreg_eventset;
10641062
1065−error_del_device:
1066− device_del(&indio_dev->dev);
1063+ ret = device_add(&indio_dev->dev);
1064+ if (ret < 0)
1065+ goto error_cdev_del;
1066+
1067+ return 0;
1068+error_cdev_del:
1069+ cdev_del(&indio_dev->chrdev);
10671070 error_unreg_eventset:
10681071 iio_device_unregister_eventset(indio_dev);
10691072 error_free_sysfs:
@@ -1078,9 +1081,17 @@ EXPORT_SYMBOL(iio_device_register); · 8 unmodified lines
10781081 void iio_device_unregister(struct iio_dev *indio_dev)
10791082 {
10801083 mutex_lock(&indio_dev->info_exist_lock);
1084+
1085+ device_del(&indio_dev->dev);
1086+
1087+ if (indio_dev->chrdev.dev)
1088+ cdev_del(&indio_dev->chrdev);
1089+ iio_device_unregister_debugfs(indio_dev);
1090+
1091+ iio_disable_all_buffers(indio_dev);
1092+
10811093 indio_dev->info = NULL;
10821094 mutex_unlock(&indio_dev->info_exist_lock);
1083− device_del(&indio_dev->dev);
10841095 }
10851096 EXPORT_SYMBOL(iio_device_unregister);
10861097 subsys_initcall(iio_init);
drivers/iio/industrialio-event.c+14−6
@@ -72,7 +72,8 @@ EXPORT_SYMBOL(iio_push_event); · 71 unmodified lines
7272 static unsigned int iio_event_poll(struct file *filep,
7373 struct poll_table_struct *wait)
7474 {
75− struct iio_event_interface *ev_int = filep->private_data;
75+ struct iio_dev *indio_dev = filep->private_data;
76+ struct iio_event_interface *ev_int = indio_dev->event_interface;
7677 unsigned int events = 0;
7778
7879 poll_wait(filep, &ev_int->wait, wait);
@@ -90,7 +91,8 @@ static ssize_t iio_event_chrdev_read(struct file *filep, · 11 unmodified lines
9091 size_t count,
9192 loff_t *f_ps)
9293 {
93− struct iio_event_interface *ev_int = filep->private_data;
94+ struct iio_dev *indio_dev = filep->private_data;
95+ struct iio_event_interface *ev_int = indio_dev->event_interface;
9496 unsigned int copied;
9597 int ret;
9698
@@ -121,7 +123,8 @@ error_unlock: · 24 unmodified lines
121123
122124 static int iio_event_chrdev_release(struct inode *inode, struct file *filep)
123125 {
124− struct iio_event_interface *ev_int = filep->private_data;
126+ struct iio_dev *indio_dev = filep->private_data;
127+ struct iio_event_interface *ev_int = indio_dev->event_interface;
125128
126129 spin_lock_irq(&ev_int->wait.lock);
127130 __clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags);
@@ -133,6 +136,8 @@ static int iio_event_chrdev_release(struct inode *inode, struct file *filep) · 5 unmodified lines
133136 kfifo_reset_out(&ev_int->det_events);
134137 spin_unlock_irq(&ev_int->wait.lock);
135138
139+ iio_device_put(indio_dev);
140+
136141 return 0;
137142 }
138143
@@ -158,12 +163,15 @@ int iio_event_getfd(struct iio_dev *indio_dev) · 19 unmodified lines
158163 return -EBUSY;
159164 }
160165 spin_unlock_irq(&ev_int->wait.lock);
161− fd = anon_inode_getfd("iio:event",
162− &iio_event_chrdev_fileops, ev_int, O_RDONLY);
166+ iio_device_get(indio_dev);
167+
168+ fd = anon_inode_getfd("iio:event", &iio_event_chrdev_fileops,
169+ indio_dev, O_RDONLY);
163170 if (fd < 0) {
164171 spin_lock_irq(&ev_int->wait.lock);
165172 __clear_bit(IIO_BUSY_BIT_POS, &ev_int->flags);
166173 spin_unlock_irq(&ev_int->wait.lock);
174+ iio_device_put(indio_dev);
167175 }
168176 return fd;
169177 }
@@ -276,7 +284,7 @@ static int iio_device_add_event_sysfs(struct iio_dev *indio_dev, · 106 unmodified lines
276284 goto error_ret;
277285 }
278286 if (chan->modified)
279− mask = IIO_MOD_EVENT_CODE(chan->type, 0, chan->channel,
287+ mask = IIO_MOD_EVENT_CODE(chan->type, 0, chan->channel2,
280288 i/IIO_EV_DIR_MAX,
281289 i%IIO_EV_DIR_MAX);
282290 else if (chan->differential)
drivers/iio/magnetometer/st_magn_core.c+9−9
@@ -29,9 +29,9 @@ · 28 unmodified lines
2929 #define ST_MAGN_NUMBER_DATA_CHANNELS 3
3030
3131 /* DEFAULT VALUE FOR SENSORS */
32−#define ST_MAGN_DEFAULT_OUT_X_L_ADDR 0X04
33−#define ST_MAGN_DEFAULT_OUT_Y_L_ADDR 0X08
34−#define ST_MAGN_DEFAULT_OUT_Z_L_ADDR 0X06
32+#define ST_MAGN_DEFAULT_OUT_X_H_ADDR 0X03
33+#define ST_MAGN_DEFAULT_OUT_Y_H_ADDR 0X07
34+#define ST_MAGN_DEFAULT_OUT_Z_H_ADDR 0X05
3535
3636 /* FULLSCALE */
3737 #define ST_MAGN_FS_AVL_1300MG 1300
@@ -117,16 +117,16 @@ · 79 unmodified lines
117117 static const struct iio_chan_spec st_magn_16bit_channels[] = {
118118 ST_SENSORS_LSM_CHANNELS(IIO_MAGN,
119119 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
120− ST_SENSORS_SCAN_X, 1, IIO_MOD_X, 's', IIO_LE, 16, 16,
121− ST_MAGN_DEFAULT_OUT_X_L_ADDR),
120+ ST_SENSORS_SCAN_X, 1, IIO_MOD_X, 's', IIO_BE, 16, 16,
121+ ST_MAGN_DEFAULT_OUT_X_H_ADDR),
122122 ST_SENSORS_LSM_CHANNELS(IIO_MAGN,
123123 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
124− ST_SENSORS_SCAN_Y, 1, IIO_MOD_Y, 's', IIO_LE, 16, 16,
125− ST_MAGN_DEFAULT_OUT_Y_L_ADDR),
124+ ST_SENSORS_SCAN_Y, 1, IIO_MOD_Y, 's', IIO_BE, 16, 16,
125+ ST_MAGN_DEFAULT_OUT_Y_H_ADDR),
126126 ST_SENSORS_LSM_CHANNELS(IIO_MAGN,
127127 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
128− ST_SENSORS_SCAN_Z, 1, IIO_MOD_Z, 's', IIO_LE, 16, 16,
129− ST_MAGN_DEFAULT_OUT_Z_L_ADDR),
128+ ST_SENSORS_SCAN_Z, 1, IIO_MOD_Z, 's', IIO_BE, 16, 16,
129+ ST_MAGN_DEFAULT_OUT_Z_H_ADDR),
130130 IIO_CHAN_SOFT_TIMESTAMP(3)
131131 };
132132
drivers/iio/temperature/tmp006.c+4−2
@@ -255,12 +255,14 @@ static int tmp006_remove(struct i2c_client *client) · 254 unmodified lines
255255 #ifdef CONFIG_PM_SLEEP
256256 static int tmp006_suspend(struct device *dev)
257257 {
258− return tmp006_powerdown(iio_priv(dev_to_iio_dev(dev)));
258+ struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
259+ return tmp006_powerdown(iio_priv(indio_dev));
259260 }
260261
261262 static int tmp006_resume(struct device *dev)
262263 {
263− struct tmp006_data *data = iio_priv(dev_to_iio_dev(dev));
264+ struct tmp006_data *data = iio_priv(i2c_get_clientdata(
265+ to_i2c_client(dev)));
264266 return i2c_smbus_write_word_swapped(data->client, TMP006_CONFIG,
265267 data->config | TMP006_CONFIG_MOD_MASK);
266268 }
drivers/infiniband/ulp/srpt/ib_srpt.c+6−8
@@ -1588,7 +1588,7 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, · 1587 unmodified lines
15881588 int resp_data_len;
15891589 int resp_len;
15901590
1591− resp_data_len = (rsp_code == SRP_TSK_MGMT_SUCCESS) ? 0 : 4;
1591+ resp_data_len = 4;
15921592 resp_len = sizeof(*srp_rsp) + resp_data_len;
15931593
15941594 srp_rsp = ioctx->ioctx.buf;
@@ -1600,11 +1600,9 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, · 5 unmodified lines
16001600 + atomic_xchg(&ch->req_lim_delta, 0));
16011601 srp_rsp->tag = tag;
16021602
1603− if (rsp_code != SRP_TSK_MGMT_SUCCESS) {
1604− srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
1605− srp_rsp->resp_data_len = cpu_to_be32(resp_data_len);
1606− srp_rsp->data[3] = rsp_code;
1607− }
1603+ srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
1604+ srp_rsp->resp_data_len = cpu_to_be32(resp_data_len);
1605+ srp_rsp->data[3] = rsp_code;
16081606
16091607 return resp_len;
16101608 }
@@ -2358,6 +2356,8 @@ static void srpt_release_channel_work(struct work_struct *w) · 747 unmodified lines
23582356 transport_deregister_session(se_sess);
23592357 ch->sess = NULL;
23602358
2359+ ib_destroy_cm_id(ch->cm_id);
2360+
23612361 srpt_destroy_ch_ib(ch);
23622362
23632363 srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring,
@@ -2368,8 +2368,6 @@ static void srpt_release_channel_work(struct work_struct *w) · 4 unmodified lines
23682368 list_del(&ch->list);
23692369 spin_unlock_irq(&sdev->spinlock);
23702370
2371− ib_destroy_cm_id(ch->cm_id);
2372−
23732371 if (ch->release_done)
23742372 complete(ch->release_done);
23752373
drivers/iommu/arm-smmu.c+7−6
@@ -377,6 +377,7 @@ struct arm_smmu_cfg { · 376 unmodified lines
377377 u32 cbar;
378378 pgd_t *pgd;
379379 };
380+#define INVALID_IRPTNDX 0xff
380381
381382 #define ARM_SMMU_CB_ASID(cfg) ((cfg)->cbndx)
382383 #define ARM_SMMU_CB_VMID(cfg) ((cfg)->cbndx + 1)
@@ -840,7 +841,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, · 457 unmodified lines
840841 if (IS_ERR_VALUE(ret)) {
841842 dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
842843 root_cfg->irptndx, irq);
843− root_cfg->irptndx = -1;
844+ root_cfg->irptndx = INVALID_IRPTNDX;
844845 goto out_free_context;
845846 }
846847
@@ -869,7 +870,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain) · 22 unmodified lines
869870 writel_relaxed(0, cb_base + ARM_SMMU_CB_SCTLR);
870871 arm_smmu_tlb_inv_context(root_cfg);
871872
872− if (root_cfg->irptndx != -1) {
873+ if (root_cfg->irptndx != INVALID_IRPTNDX) {
873874 irq = smmu->irqs[smmu->num_global_irqs + root_cfg->irptndx];
874875 free_irq(irq, domain);
875876 }
@@ -1857,8 +1858,6 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) · 981 unmodified lines
18571858 goto out_put_parent;
18581859 }
18591860
1860− arm_smmu_device_reset(smmu);
1861−
18621861 for (i = 0; i < smmu->num_global_irqs; ++i) {
18631862 err = request_irq(smmu->irqs[i],
18641863 arm_smmu_global_fault,
@@ -1876,6 +1875,8 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) · 11 unmodified lines
18761875 spin_lock(&arm_smmu_devices_lock);
18771876 list_add(&smmu->list, &arm_smmu_devices);
18781877 spin_unlock(&arm_smmu_devices_lock);
1878+
1879+ arm_smmu_device_reset(smmu);
18791880 return 0;
18801881
18811882 out_free_irqs:
@@ -1966,10 +1967,10 @@ static int __init arm_smmu_init(void) · 84 unmodified lines
19661967 return ret;
19671968
19681969 /* Oh, for a proper bus abstraction */
1969− if (!iommu_present(&platform_bus_type));
1970+ if (!iommu_present(&platform_bus_type))
19701971 bus_set_iommu(&platform_bus_type, &arm_smmu_ops);
19711972
1972− if (!iommu_present(&amba_bustype));
1973+ if (!iommu_present(&amba_bustype))
19731974 bus_set_iommu(&amba_bustype, &arm_smmu_ops);
19741975
19751976 return 0;
drivers/isdn/hardware/mISDN/hfcpci.c+2−2
@@ -2295,8 +2295,8 @@ _hfcpci_softirq(struct device *dev, void *arg) · 2294 unmodified lines
22952295 static void
22962296 hfcpci_softirq(void *arg)
22972297 {
2298− (void) driver_for_each_device(&hfc_driver.driver, NULL, arg,
2299− _hfcpci_softirq);
2298+ WARN_ON_ONCE(driver_for_each_device(&hfc_driver.driver, NULL, arg,
2299+ _hfcpci_softirq) != 0);
23002300
23012301 /* if next event would be in the past ... */
23022302 if ((s32)(hfc_jiffies + tics - jiffies) <= 0)
drivers/isdn/hisax/amd7930_fn.c+2−2
@@ -314,7 +314,7 @@ Amd7930_empty_Dfifo(struct IsdnCardState *cs, int flag) · 313 unmodified lines
314314
315315 t += sprintf(t, "Amd7930: empty_Dfifo cnt: %d |", cs->rcvidx);
316316 QuickHex(t, cs->rcvbuf, cs->rcvidx);
317− debugl1(cs, cs->dlog);
317+ debugl1(cs, "%s", cs->dlog);
318318 }
319319 /* moves received data in sk-buffer */
320320 memcpy(skb_put(skb, cs->rcvidx), cs->rcvbuf, cs->rcvidx);
@@ -406,7 +406,7 @@ Amd7930_fill_Dfifo(struct IsdnCardState *cs) · 85 unmodified lines
406406
407407 t += sprintf(t, "Amd7930: fill_Dfifo cnt: %d |", count);
408408 QuickHex(t, deb_ptr, count);
409− debugl1(cs, cs->dlog);
409+ debugl1(cs, "%s", cs->dlog);
410410 }
411411 /* AMD interrupts on */
412412 AmdIrqOn(cs);
drivers/isdn/hisax/avm_pci.c+2−2
@@ -285,7 +285,7 @@ hdlc_empty_fifo(struct BCState *bcs, int count) · 284 unmodified lines
285285 t += sprintf(t, "hdlc_empty_fifo %c cnt %d",
286286 bcs->channel ? 'B' : 'A', count);
287287 QuickHex(t, p, count);
288− debugl1(cs, bcs->blog);
288+ debugl1(cs, "%s", bcs->blog);
289289 }
290290 }
291291
@@ -345,7 +345,7 @@ hdlc_fill_fifo(struct BCState *bcs) · 53 unmodified lines
345345 t += sprintf(t, "hdlc_fill_fifo %c cnt %d",
346346 bcs->channel ? 'B' : 'A', count);
347347 QuickHex(t, p, count);
348− debugl1(cs, bcs->blog);
348+ debugl1(cs, "%s", bcs->blog);
349349 }
350350 }
351351
drivers/isdn/hisax/config.c+1−1
@@ -1896,7 +1896,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if) · 1895 unmodified lines
18961896 ptr--;
18971897 *ptr++ = '\n';
18981898 *ptr = 0;
1899− HiSax_putstatus(cs, NULL, cs->dlog);
1899+ HiSax_putstatus(cs, NULL, "%s", cs->dlog);
19001900 } else
19011901 HiSax_putstatus(cs, "LogEcho: ",
19021902 "warning Frame too big (%d)",
drivers/isdn/hisax/diva.c+2−2
@@ -427,7 +427,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count) · 426 unmodified lines
427427 t += sprintf(t, "hscx_empty_fifo %c cnt %d",
428428 bcs->hw.hscx.hscx ? 'B' : 'A', count);
429429 QuickHex(t, ptr, count);
430− debugl1(cs, bcs->blog);
430+ debugl1(cs, "%s", bcs->blog);
431431 }
432432 }
433433
@@ -469,7 +469,7 @@ Memhscx_fill_fifo(struct BCState *bcs) · 35 unmodified lines
469469 t += sprintf(t, "hscx_fill_fifo %c cnt %d",
470470 bcs->hw.hscx.hscx ? 'B' : 'A', count);
471471 QuickHex(t, ptr, count);
472− debugl1(cs, bcs->blog);
472+ debugl1(cs, "%s", bcs->blog);
473473 }
474474 }
475475
drivers/isdn/hisax/elsa.c+1−1
@@ -535,7 +535,7 @@ check_arcofi(struct IsdnCardState *cs) · 534 unmodified lines
535535 t = tmp;
536536 t += sprintf(tmp, "Arcofi data");
537537 QuickHex(t, p, cs->dc.isac.mon_rxp);
538− debugl1(cs, tmp);
538+ debugl1(cs, "%s", tmp);
539539 if ((cs->dc.isac.mon_rxp == 2) && (cs->dc.isac.mon_rx[0] == 0xa0)) {
540540 switch (cs->dc.isac.mon_rx[1]) {
541541 case 0x80:
drivers/isdn/hisax/elsa_ser.c+1−1
@@ -344,7 +344,7 @@ static inline void receive_chars(struct IsdnCardState *cs, · 343 unmodified lines
344344
345345 t += sprintf(t, "modem read cnt %d", cs->hw.elsa.rcvcnt);
346346 QuickHex(t, cs->hw.elsa.rcvbuf, cs->hw.elsa.rcvcnt);
347− debugl1(cs, tmp);
347+ debugl1(cs, "%s", tmp);
348348 }
349349 cs->hw.elsa.rcvcnt = 0;
350350 }
drivers/isdn/hisax/hfc_pci.c+1−1
@@ -901,7 +901,7 @@ Begin: · 900 unmodified lines
901901 ptr--;
902902 *ptr++ = '\n';
903903 *ptr = 0;
904− HiSax_putstatus(cs, NULL, cs->dlog);
904+ HiSax_putstatus(cs, NULL, "%s", cs->dlog);
905905 } else
906906 HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", total - 3);
907907 }
drivers/isdn/hisax/hfc_sx.c+1−1
@@ -674,7 +674,7 @@ receive_emsg(struct IsdnCardState *cs) · 673 unmodified lines
674674 ptr--;
675675 *ptr++ = '\n';
676676 *ptr = 0;
677− HiSax_putstatus(cs, NULL, cs->dlog);
677+ HiSax_putstatus(cs, NULL, "%s", cs->dlog);
678678 } else
679679 HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", skb->len);
680680 }
drivers/isdn/hisax/hscx_irq.c+2−2
@@ -75,7 +75,7 @@ hscx_empty_fifo(struct BCState *bcs, int count) · 74 unmodified lines
7575 t += sprintf(t, "hscx_empty_fifo %c cnt %d",
7676 bcs->hw.hscx.hscx ? 'B' : 'A', count);
7777 QuickHex(t, ptr, count);
78− debugl1(cs, bcs->blog);
78+ debugl1(cs, "%s", bcs->blog);
7979 }
8080 }
8181
@@ -115,7 +115,7 @@ hscx_fill_fifo(struct BCState *bcs) · 33 unmodified lines
115115 t += sprintf(t, "hscx_fill_fifo %c cnt %d",
116116 bcs->hw.hscx.hscx ? 'B' : 'A', count);
117117 QuickHex(t, ptr, count);
118− debugl1(cs, bcs->blog);
118+ debugl1(cs, "%s", bcs->blog);
119119 }
120120 }
121121
drivers/isdn/hisax/icc.c+2−2
@@ -134,7 +134,7 @@ icc_empty_fifo(struct IsdnCardState *cs, int count) · 133 unmodified lines
134134
135135 t += sprintf(t, "icc_empty_fifo cnt %d", count);
136136 QuickHex(t, ptr, count);
137− debugl1(cs, cs->dlog);
137+ debugl1(cs, "%s", cs->dlog);
138138 }
139139 }
140140
@@ -176,7 +176,7 @@ icc_fill_fifo(struct IsdnCardState *cs) · 35 unmodified lines
176176
177177 t += sprintf(t, "icc_fill_fifo cnt %d", count);
178178 QuickHex(t, ptr, count);
179− debugl1(cs, cs->dlog);
179+ debugl1(cs, "%s", cs->dlog);
180180 }
181181 }
182182
drivers/isdn/hisax/ipacx.c+4−4
@@ -260,7 +260,7 @@ dch_empty_fifo(struct IsdnCardState *cs, int count) · 259 unmodified lines
260260
261261 t += sprintf(t, "dch_empty_fifo() cnt %d", count);
262262 QuickHex(t, ptr, count);
263− debugl1(cs, cs->dlog);
263+ debugl1(cs, "%s", cs->dlog);
264264 }
265265 }
266266
@@ -307,7 +307,7 @@ dch_fill_fifo(struct IsdnCardState *cs) · 40 unmodified lines
307307
308308 t += sprintf(t, "dch_fill_fifo() cnt %d", count);
309309 QuickHex(t, ptr, count);
310− debugl1(cs, cs->dlog);
310+ debugl1(cs, "%s", cs->dlog);
311311 }
312312 }
313313
@@ -539,7 +539,7 @@ bch_empty_fifo(struct BCState *bcs, int count) · 225 unmodified lines
539539
540540 t += sprintf(t, "bch_empty_fifo() B-%d cnt %d", hscx, count);
541541 QuickHex(t, ptr, count);
542− debugl1(cs, bcs->blog);
542+ debugl1(cs, "%s", bcs->blog);
543543 }
544544 }
545545
@@ -582,7 +582,7 @@ bch_fill_fifo(struct BCState *bcs) · 36 unmodified lines
582582
583583 t += sprintf(t, "chb_fill_fifo() B-%d cnt %d", hscx, count);
584584 QuickHex(t, ptr, count);
585− debugl1(cs, bcs->blog);
585+ debugl1(cs, "%s", bcs->blog);
586586 }
587587 }
588588
drivers/isdn/hisax/isac.c+2−2
@@ -137,7 +137,7 @@ isac_empty_fifo(struct IsdnCardState *cs, int count) · 136 unmodified lines
137137
138138 t += sprintf(t, "isac_empty_fifo cnt %d", count);
139139 QuickHex(t, ptr, count);
140− debugl1(cs, cs->dlog);
140+ debugl1(cs, "%s", cs->dlog);
141141 }
142142 }
143143
@@ -179,7 +179,7 @@ isac_fill_fifo(struct IsdnCardState *cs) · 35 unmodified lines
179179
180180 t += sprintf(t, "isac_fill_fifo cnt %d", count);
181181 QuickHex(t, ptr, count);
182− debugl1(cs, cs->dlog);
182+ debugl1(cs, "%s", cs->dlog);
183183 }
184184 }
185185
drivers/isdn/hisax/isar.c+3−3
@@ -74,7 +74,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len, · 73 unmodified lines
7474 t = tmp;
7575 t += sprintf(t, "sendmbox cnt %d", len);
7676 QuickHex(t, &msg[len-i], (i > 64) ? 64 : i);
77− debugl1(cs, tmp);
77+ debugl1(cs, "%s", tmp);
7878 i -= 64;
7979 }
8080 }
@@ -105,7 +105,7 @@ rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg) · 24 unmodified lines
105105 t = tmp;
106106 t += sprintf(t, "rcv_mbox cnt %d", ireg->clsb);
107107 QuickHex(t, &msg[ireg->clsb - i], (i > 64) ? 64 : i);
108− debugl1(cs, tmp);
108+ debugl1(cs, "%s", tmp);
109109 i -= 64;
110110 }
111111 }
@@ -1248,7 +1248,7 @@ isar_int_main(struct IsdnCardState *cs) · 1136 unmodified lines
12481248 tp += sprintf(debbuf, "msg iis(%x) msb(%x)",
12491249 ireg->iis, ireg->cmsb);
12501250 QuickHex(tp, (u_char *)ireg->par, ireg->clsb);
1251− debugl1(cs, debbuf);
1251+ debugl1(cs, "%s", debbuf);
12521252 }
12531253 break;
12541254 case ISAR_IIS_INVMSG:
drivers/isdn/hisax/jade.c+5−13
@@ -81,10 +81,7 @@ modejade(struct BCState *bcs, int mode, int bc) · 80 unmodified lines
8181 int jade = bcs->hw.hscx.hscx;
8282
8383 if (cs->debug & L1_DEB_HSCX) {
84− char tmp[40];
85− sprintf(tmp, "jade %c mode %d ichan %d",
86− 'A' + jade, mode, bc);
87− debugl1(cs, tmp);
84+ debugl1(cs, "jade %c mode %d ichan %d", 'A' + jade, mode, bc);
8885 }
8986 bcs->mode = mode;
9087 bcs->channel = bc;
@@ -257,23 +254,18 @@ void · 166 unmodified lines
257254 clear_pending_jade_ints(struct IsdnCardState *cs)
258255 {
259256 int val;
260− char tmp[64];
261257
262258 cs->BC_Write_Reg(cs, 0, jade_HDLC_IMR, 0x00);
263259 cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0x00);
264260
265261 val = cs->BC_Read_Reg(cs, 1, jade_HDLC_ISR);
266− sprintf(tmp, "jade B ISTA %x", val);
267− debugl1(cs, tmp);
262+ debugl1(cs, "jade B ISTA %x", val);
268263 val = cs->BC_Read_Reg(cs, 0, jade_HDLC_ISR);
269− sprintf(tmp, "jade A ISTA %x", val);
270− debugl1(cs, tmp);
264+ debugl1(cs, "jade A ISTA %x", val);
271265 val = cs->BC_Read_Reg(cs, 1, jade_HDLC_STAR);
272− sprintf(tmp, "jade B STAR %x", val);
273− debugl1(cs, tmp);
266+ debugl1(cs, "jade B STAR %x", val);
274267 val = cs->BC_Read_Reg(cs, 0, jade_HDLC_STAR);
275− sprintf(tmp, "jade A STAR %x", val);
276− debugl1(cs, tmp);
268+ debugl1(cs, "jade A STAR %x", val);
277269 /* Unmask ints */
278270 cs->BC_Write_Reg(cs, 0, jade_HDLC_IMR, 0xF8);
279271 cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0xF8);
drivers/isdn/hisax/jade_irq.c+2−2
@@ -65,7 +65,7 @@ jade_empty_fifo(struct BCState *bcs, int count) · 64 unmodified lines
6565 t += sprintf(t, "jade_empty_fifo %c cnt %d",
6666 bcs->hw.hscx.hscx ? 'B' : 'A', count);
6767 QuickHex(t, ptr, count);
68− debugl1(cs, bcs->blog);
68+ debugl1(cs, "%s", bcs->blog);
6969 }
7070 }
7171
@@ -105,7 +105,7 @@ jade_fill_fifo(struct BCState *bcs) · 33 unmodified lines
105105 t += sprintf(t, "jade_fill_fifo %c cnt %d",
106106 bcs->hw.hscx.hscx ? 'B' : 'A', count);
107107 QuickHex(t, ptr, count);
108− debugl1(cs, bcs->blog);
108+ debugl1(cs, "%s", bcs->blog);
109109 }
110110 }
111111
drivers/isdn/hisax/l3_1tr6.c+18−32
@@ -63,7 +63,7 @@ l3_1tr6_error(struct l3_process *pc, u_char *msg, struct sk_buff *skb) · 62 unmodified lines
6363 {
6464 dev_kfree_skb(skb);
6565 if (pc->st->l3.debug & L3_DEB_WARN)
66− l3_debug(pc->st, msg);
66+ l3_debug(pc->st, "%s", msg);
6767 l3_1tr6_release_req(pc, 0, NULL);
6868 }
6969
@@ -161,7 +161,6 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg) · 91 unmodified lines
161161 {
162162 u_char *p;
163163 int bcfound = 0;
164− char tmp[80];
165164 struct sk_buff *skb = arg;
166165
167166 /* Channel Identification */
@@ -214,10 +213,9 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg) · 46 unmodified lines
214213 /* Signal all services, linklevel takes care of Service-Indicator */
215214 if (bcfound) {
216215 if ((pc->para.setup.si1 != 7) && (pc->st->l3.debug & L3_DEB_WARN)) {
217− sprintf(tmp, "non-digital call: %s -> %s",
216+ l3_debug(pc->st, "non-digital call: %s -> %s",
218217 pc->para.setup.phone,
219218 pc->para.setup.eazmsn);
220− l3_debug(pc->st, tmp);
221219 }
222220 newl3state(pc, 6);
223221 pc->st->l3.l3l4(pc->st, CC_SETUP | INDICATION, pc);
@@ -301,7 +299,7 @@ l3_1tr6_info(struct l3_process *pc, u_char pr, void *arg) · 77 unmodified lines
301299 {
302300 u_char *p;
303301 int i, tmpcharge = 0;
304− char a_charge[8], tmp[32];
302+ char a_charge[8];
305303 struct sk_buff *skb = arg;
306304
307305 p = skb->data;
@@ -316,8 +314,8 @@ l3_1tr6_info(struct l3_process *pc, u_char pr, void *arg) · 8 unmodified lines
316314 pc->st->l3.l3l4(pc->st, CC_CHARGE | INDICATION, pc);
317315 }
318316 if (pc->st->l3.debug & L3_DEB_CHARGE) {
319− sprintf(tmp, "charging info %d", pc->para.chargeinfo);
320− l3_debug(pc->st, tmp);
317+ l3_debug(pc->st, "charging info %d",
318+ pc->para.chargeinfo);
321319 }
322320 } else if (pc->st->l3.debug & L3_DEB_CHARGE)
323321 l3_debug(pc->st, "charging info not found");
@@ -399,7 +397,7 @@ l3_1tr6_disc(struct l3_process *pc, u_char pr, void *arg) · 75 unmodified lines
399397 struct sk_buff *skb = arg;
400398 u_char *p;
401399 int i, tmpcharge = 0;
402− char a_charge[8], tmp[32];
400+ char a_charge[8];
403401
404402 StopAllL3Timer(pc);
405403 p = skb->data;
@@ -414,8 +412,8 @@ l3_1tr6_disc(struct l3_process *pc, u_char pr, void *arg) · 8 unmodified lines
414412 pc->st->l3.l3l4(pc->st, CC_CHARGE | INDICATION, pc);
415413 }
416414 if (pc->st->l3.debug & L3_DEB_CHARGE) {
417− sprintf(tmp, "charging info %d", pc->para.chargeinfo);
418− l3_debug(pc->st, tmp);
415+ l3_debug(pc->st, "charging info %d",
416+ pc->para.chargeinfo);
419417 }
420418 } else if (pc->st->l3.debug & L3_DEB_CHARGE)
421419 l3_debug(pc->st, "charging info not found");
@@ -746,7 +744,6 @@ up1tr6(struct PStack *st, int pr, void *arg) · 324 unmodified lines
746744 int i, mt, cr;
747745 struct l3_process *proc;
748746 struct sk_buff *skb = arg;
749− char tmp[80];
750747
751748 switch (pr) {
752749 case (DL_DATA | INDICATION):
@@ -762,26 +759,23 @@ up1tr6(struct PStack *st, int pr, void *arg) · 9 unmodified lines
762759 }
763760 if (skb->len < 4) {
764761 if (st->l3.debug & L3_DEB_PROTERR) {
765− sprintf(tmp, "up1tr6 len only %d", skb->len);
766− l3_debug(st, tmp);
762+ l3_debug(st, "up1tr6 len only %d", skb->len);
767763 }
768764 dev_kfree_skb(skb);
769765 return;
770766 }
771767 if ((skb->data[0] & 0xfe) != PROTO_DIS_N0) {
772768 if (st->l3.debug & L3_DEB_PROTERR) {
773− sprintf(tmp, "up1tr6%sunexpected discriminator %x message len %d",
769+ l3_debug(st, "up1tr6%sunexpected discriminator %x message len %d",
774770 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ",
775771 skb->data[0], skb->len);
776− l3_debug(st, tmp);
777772 }
778773 dev_kfree_skb(skb);
779774 return;
780775 }
781776 if (skb->data[1] != 1) {
782777 if (st->l3.debug & L3_DEB_PROTERR) {
783− sprintf(tmp, "up1tr6 CR len not 1");
784− l3_debug(st, tmp);
778+ l3_debug(st, "up1tr6 CR len not 1");
785779 }
786780 dev_kfree_skb(skb);
787781 return;
@@ -791,9 +785,8 @@ up1tr6(struct PStack *st, int pr, void *arg) · 3 unmodified lines
791785 if (skb->data[0] == PROTO_DIS_N0) {
792786 dev_kfree_skb(skb);
793787 if (st->l3.debug & L3_DEB_STATE) {
794− sprintf(tmp, "up1tr6%s N0 mt %x unhandled",
788+ l3_debug(st, "up1tr6%s N0 mt %x unhandled",
795789 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", mt);
796− l3_debug(st, tmp);
797790 }
798791 } else if (skb->data[0] == PROTO_DIS_N1) {
799792 if (!(proc = getl3proc(st, cr))) {
@@ -801,8 +794,7 @@ up1tr6(struct PStack *st, int pr, void *arg) · 1 unmodified line
801794 if (cr < 128) {
802795 if (!(proc = new_l3_process(st, cr))) {
803796 if (st->l3.debug & L3_DEB_PROTERR) {
804− sprintf(tmp, "up1tr6 no roc mem");
805− l3_debug(st, tmp);
797+ l3_debug(st, "up1tr6 no roc mem");
806798 }
807799 dev_kfree_skb(skb);
808800 return;
@@ -821,8 +813,7 @@ up1tr6(struct PStack *st, int pr, void *arg) · 12 unmodified lines
821813 } else {
822814 if (!(proc = new_l3_process(st, cr))) {
823815 if (st->l3.debug & L3_DEB_PROTERR) {
824− sprintf(tmp, "up1tr6 no roc mem");
825− l3_debug(st, tmp);
816+ l3_debug(st, "up1tr6 no roc mem");
826817 }
827818 dev_kfree_skb(skb);
828819 return;
@@ -837,18 +828,16 @@ up1tr6(struct PStack *st, int pr, void *arg) · 8 unmodified lines
837828 if (i == ARRAY_SIZE(datastln1)) {
838829 dev_kfree_skb(skb);
839830 if (st->l3.debug & L3_DEB_STATE) {
840− sprintf(tmp, "up1tr6%sstate %d mt %x unhandled",
831+ l3_debug(st, "up1tr6%sstate %d mt %x unhandled",
841832 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ",
842833 proc->state, mt);
843− l3_debug(st, tmp);
844834 }
845835 return;
846836 } else {
847837 if (st->l3.debug & L3_DEB_STATE) {
848− sprintf(tmp, "up1tr6%sstate %d mt %x",
838+ l3_debug(st, "up1tr6%sstate %d mt %x",
849839 (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ",
850840 proc->state, mt);
851− l3_debug(st, tmp);
852841 }
853842 datastln1[i].rout(proc, pr, skb);
854843 }
@@ -861,7 +850,6 @@ down1tr6(struct PStack *st, int pr, void *arg) · 6 unmodified lines
861850 int i, cr;
862851 struct l3_process *proc;
863852 struct Channel *chan;
864− char tmp[80];
865853
866854 if ((DL_ESTABLISH | REQUEST) == pr) {
867855 l3_msg(st, pr, NULL);
@@ -888,15 +876,13 @@ down1tr6(struct PStack *st, int pr, void *arg) · 20 unmodified lines
888876 break;
889877 if (i == ARRAY_SIZE(downstl)) {
890878 if (st->l3.debug & L3_DEB_STATE) {
891− sprintf(tmp, "down1tr6 state %d prim %d unhandled",
879+ l3_debug(st, "down1tr6 state %d prim %d unhandled",
892880 proc->state, pr);
893− l3_debug(st, tmp);
894881 }
895882 } else {
896883 if (st->l3.debug & L3_DEB_STATE) {
897− sprintf(tmp, "down1tr6 state %d prim %d",
884+ l3_debug(st, "down1tr6 state %d prim %d",
898885 proc->state, pr);
899− l3_debug(st, tmp);
900886 }
901887 downstl[i].rout(proc, pr, arg);
902888 }
drivers/isdn/hisax/netjet.c+1−1
@@ -176,7 +176,7 @@ static void printframe(struct IsdnCardState *cs, u_char *buf, int count, char *s · 175 unmodified lines
176176 else
177177 j = i;
178178 QuickHex(t, p, j);
179− debugl1(cs, tmp);
179+ debugl1(cs, "%s", tmp);
180180 p += j;
181181 i -= j;
182182 t = tmp;
drivers/isdn/hisax/q931.c+3−3
@@ -1179,7 +1179,7 @@ LogFrame(struct IsdnCardState *cs, u_char *buf, int size) · 1178 unmodified lines
11791179 dp--;
11801180 *dp++ = '\n';
11811181 *dp = 0;
1182− HiSax_putstatus(cs, NULL, cs->dlog);
1182+ HiSax_putstatus(cs, NULL, "%s", cs->dlog);
11831183 } else
11841184 HiSax_putstatus(cs, "LogFrame: ", "warning Frame too big (%d)", size);
11851185 }
@@ -1246,7 +1246,7 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) · 60 unmodified lines
12461246 }
12471247 if (finish) {
12481248 *dp = 0;
1249− HiSax_putstatus(cs, NULL, cs->dlog);
1249+ HiSax_putstatus(cs, NULL, "%s", cs->dlog);
12501250 return;
12511251 }
12521252 if ((0xfe & buf[0]) == PROTO_DIS_N0) { /* 1TR6 */
@@ -1509,5 +1509,5 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) · 256 unmodified lines
15091509 dp += sprintf(dp, "Unknown protocol %x!", buf[0]);
15101510 }
15111511 *dp = 0;
1512− HiSax_putstatus(cs, NULL, cs->dlog);
1512+ HiSax_putstatus(cs, NULL, "%s", cs->dlog);
15131513 }
drivers/isdn/hisax/w6692.c+4−4
@@ -154,7 +154,7 @@ W6692_empty_fifo(struct IsdnCardState *cs, int count) · 153 unmodified lines
154154
155155 t += sprintf(t, "W6692_empty_fifo cnt %d", count);
156156 QuickHex(t, ptr, count);
157− debugl1(cs, cs->dlog);
157+ debugl1(cs, "%s", cs->dlog);
158158 }
159159 }
160160
@@ -196,7 +196,7 @@ W6692_fill_fifo(struct IsdnCardState *cs) · 35 unmodified lines
196196
197197 t += sprintf(t, "W6692_fill_fifo cnt %d", count);
198198 QuickHex(t, ptr, count);
199− debugl1(cs, cs->dlog);
199+ debugl1(cs, "%s", cs->dlog);
200200 }
201201 }
202202
@@ -226,7 +226,7 @@ W6692B_empty_fifo(struct BCState *bcs, int count) · 23 unmodified lines
226226 t += sprintf(t, "W6692B_empty_fifo %c cnt %d",
227227 bcs->channel + '1', count);
228228 QuickHex(t, ptr, count);
229− debugl1(cs, bcs->blog);
229+ debugl1(cs, "%s", bcs->blog);
230230 }
231231 }
232232
@@ -264,7 +264,7 @@ W6692B_fill_fifo(struct BCState *bcs) · 31 unmodified lines
264264 t += sprintf(t, "W6692B_fill_fifo %c cnt %d",
265265 bcs->channel + '1', count);
266266 QuickHex(t, ptr, count);
267− debugl1(cs, bcs->blog);
267+ debugl1(cs, "%s", bcs->blog);
268268 }
269269 }
270270
drivers/mailbox/mailbox-omap2.c+0−1
@@ -325,7 +325,6 @@ static int omap2_mbox_remove(struct platform_device *pdev) · 324 unmodified lines
325325 kfree(privblk);
326326 kfree(mboxblk);
327327 kfree(list);
328− platform_set_drvdata(pdev, NULL);
329328
330329 return 0;
331330 }
drivers/md/bcache/bcache.h+3−4
@@ -498,7 +498,7 @@ struct cached_dev { · 497 unmodified lines
498498 */
499499 atomic_t has_dirty;
500500
501− struct ratelimit writeback_rate;
501+ struct bch_ratelimit writeback_rate;
502502 struct delayed_work writeback_rate_update;
503503
504504 /*
@@ -507,10 +507,9 @@ struct cached_dev { · 2 unmodified lines
507507 */
508508 sector_t last_read;
509509
510− /* Number of writeback bios in flight */
511− atomic_t in_flight;
510+ /* Limit number of writeback bios in flight */
511+ struct semaphore in_flight;
512512 struct closure_with_timer writeback;
513− struct closure_waitlist writeback_wait;
514513
515514 struct keybuf writeback_keys;
516515
drivers/md/bcache/bset.c+28−11
@@ -926,28 +926,45 @@ struct bkey *bch_next_recurse_key(struct btree *b, struct bkey *search) · 925 unmodified lines
926926
927927 /* Mergesort */
928928
929+static void sort_key_next(struct btree_iter *iter,
930+ struct btree_iter_set *i)
931+{
932+ i->k = bkey_next(i->k);
933+
934+ if (i->k == i->end)
935+ *i = iter->data[--iter->used];
936+}
937+
929938 static void btree_sort_fixup(struct btree_iter *iter)
930939 {
931940 while (iter->used > 1) {
932941 struct btree_iter_set *top = iter->data, *i = top + 1;
933− struct bkey *k;
934942
935943 if (iter->used > 2 &&
936944 btree_iter_cmp(i[0], i[1]))
937945 i++;
938946
939− for (k = i->k;
940− k != i->end && bkey_cmp(top->k, &START_KEY(k)) > 0;
941− k = bkey_next(k))
942− if (top->k > i->k)
943− __bch_cut_front(top->k, k);
944− else if (KEY_SIZE(k))
945− bch_cut_back(&START_KEY(k), top->k);
946−
947− if (top->k < i->k || k == i->k)
947+ if (bkey_cmp(top->k, &START_KEY(i->k)) <= 0)
948948 break;
949949
950− heap_sift(iter, i - top, btree_iter_cmp);
950+ if (!KEY_SIZE(i->k)) {
951+ sort_key_next(iter, i);
952+ heap_sift(iter, i - top, btree_iter_cmp);
953+ continue;
954+ }
955+
956+ if (top->k > i->k) {
957+ if (bkey_cmp(top->k, i->k) >= 0)
958+ sort_key_next(iter, i);
959+ else
960+ bch_cut_front(top->k, i->k);
961+
962+ heap_sift(iter, i - top, btree_iter_cmp);
963+ } else {
964+ /* can't happen because of comparison func */
965+ BUG_ON(!bkey_cmp(&START_KEY(top->k), &START_KEY(i->k)));
966+ bch_cut_back(&START_KEY(i->k), top->k);
967+ }
951968 }
952969 }
953970
drivers/md/bcache/btree.c+2−2
@@ -255,7 +255,7 @@ void bch_btree_node_read(struct btree *b) · 254 unmodified lines
255255
256256 return;
257257 err:
258− bch_cache_set_error(b->c, "io error reading bucket %lu",
258+ bch_cache_set_error(b->c, "io error reading bucket %zu",
259259 PTR_BUCKET_NR(b->c, &b->key, 0));
260260 }
261261
@@ -612,7 +612,7 @@ static unsigned long bch_mca_scan(struct shrinker *shrink, · 350 unmodified lines
612612 return SHRINK_STOP;
613613
614614 /* Return -1 if we can't do anything right now */
615− if (sc->gfp_mask & __GFP_WAIT)
615+ if (sc->gfp_mask & __GFP_IO)
616616 mutex_lock(&c->bucket_lock);
617617 else if (!mutex_trylock(&c->bucket_lock))
618618 return -1;
drivers/md/bcache/journal.c+20−13
@@ -153,7 +153,8 @@ int bch_journal_read(struct cache_set *c, struct list_head *list, · 152 unmodified lines
153153 bitmap_zero(bitmap, SB_JOURNAL_BUCKETS);
154154 pr_debug("%u journal buckets", ca->sb.njournal_buckets);
155155
156− /* Read journal buckets ordered by golden ratio hash to quickly
156+ /*
157+ * Read journal buckets ordered by golden ratio hash to quickly
157158 * find a sequence of buckets with valid journal entries
158159 */
159160 for (i = 0; i < ca->sb.njournal_buckets; i++) {
@@ -166,18 +167,20 @@ int bch_journal_read(struct cache_set *c, struct list_head *list, · 6 unmodified lines
166167 goto bsearch;
167168 }
168169
169− /* If that fails, check all the buckets we haven't checked
170+ /*
171+ * If that fails, check all the buckets we haven't checked
170172 * already
171173 */
172174 pr_debug("falling back to linear search");
173175
174− for (l = 0; l < ca->sb.njournal_buckets; l++) {
175− if (test_bit(l, bitmap))
176− continue;
177−
176+ for (l = find_first_zero_bit(bitmap, ca->sb.njournal_buckets);
177+ l < ca->sb.njournal_buckets;
178+ l = find_next_zero_bit(bitmap, ca->sb.njournal_buckets, l + 1))
178179 if (read_bucket(l))
179180 goto bsearch;
180− }
181+
182+ if (list_empty(list))
183+ continue;
181184 bsearch:
182185 /* Binary search */
183186 m = r = find_next_bit(bitmap, ca->sb.njournal_buckets, l + 1);
@@ -197,10 +200,12 @@ bsearch: · 13 unmodified lines
197200 r = m;
198201 }
199202
200− /* Read buckets in reverse order until we stop finding more
203+ /*
204+ * Read buckets in reverse order until we stop finding more
201205 * journal entries
202206 */
203− pr_debug("finishing up");
207+ pr_debug("finishing up: m %u njournal_buckets %u",
208+ m, ca->sb.njournal_buckets);
204209 l = m;
205210
206211 while (1) {
@@ -228,9 +233,10 @@ bsearch: · 21 unmodified lines
228233 }
229234 }
230235
231− c->journal.seq = list_entry(list->prev,
232− struct journal_replay,
233− list)->j.seq;
236+ if (!list_empty(list))
237+ c->journal.seq = list_entry(list->prev,
238+ struct journal_replay,
239+ list)->j.seq;
234240
235241 return 0;
236242 #undef read_bucket
@@ -428,7 +434,7 @@ static void do_journal_discard(struct cache *ca) · 191 unmodified lines
428434 return;
429435 }
430436
431− switch (atomic_read(&ja->discard_in_flight) == DISCARD_IN_FLIGHT) {
437+ switch (atomic_read(&ja->discard_in_flight)) {
432438 case DISCARD_IN_FLIGHT:
433439 return;
434440
@@ -689,6 +695,7 @@ void bch_journal_meta(struct cache_set *c, struct closure *cl) · 254 unmodified lines
689695 if (cl)
690696 BUG_ON(!closure_wait(&w->wait, cl));
691697
698+ closure_flush(&c->journal.io);
692699 __journal_try_write(c, true);
693700 }
694701 }
drivers/md/bcache/request.c+9−6
@@ -997,14 +997,17 @@ static void request_write(struct cached_dev *dc, struct search *s) · 996 unmodified lines
997997 } else {
998998 bch_writeback_add(dc);
999999
1000− if (s->op.flush_journal) {
1000+ if (bio->bi_rw & REQ_FLUSH) {
10011001 /* Also need to send a flush to the backing device */
1002− s->op.cache_bio = bio_clone_bioset(bio, GFP_NOIO,
1003− dc->disk.bio_split);
1002+ struct bio *flush = bio_alloc_bioset(0, GFP_NOIO,
1003+ dc->disk.bio_split);
10041004
1005− bio->bi_size = 0;
1006− bio->bi_vcnt = 0;
1007− closure_bio_submit(bio, cl, s->d);
1005+ flush->bi_rw = WRITE_FLUSH;
1006+ flush->bi_bdev = bio->bi_bdev;
1007+ flush->bi_end_io = request_endio;
1008+ flush->bi_private = cl;
1009+
1010+ closure_bio_submit(flush, cl, s->d);
10081011 } else {
10091012 s->op.cache_bio = bio;
10101013 }
drivers/md/bcache/sysfs.c+7−2
@@ -223,8 +223,13 @@ STORE(__cached_dev) · 222 unmodified lines
223223 }
224224
225225 if (attr == &sysfs_label) {
226− /* note: endlines are preserved */
227− memcpy(dc->sb.label, buf, SB_LABEL_SIZE);
226+ if (size > SB_LABEL_SIZE)
227+ return -EINVAL;
228+ memcpy(dc->sb.label, buf, size);
229+ if (size < SB_LABEL_SIZE)
230+ dc->sb.label[size] = '\0';
231+ if (size && dc->sb.label[size - 1] == '\n')
232+ dc->sb.label[size - 1] = '\0';
228233 bch_write_bdev_super(dc, NULL);
229234 if (dc->disk.c) {
230235 memcpy(dc->disk.c->uuids[dc->disk.id].label,
drivers/md/bcache/util.c+10−1
@@ -190,7 +190,16 @@ void bch_time_stats_update(struct time_stats *stats, uint64_t start_time) · 189 unmodified lines
190190 stats->last = now ?: 1;
191191 }
192192
193−unsigned bch_next_delay(struct ratelimit *d, uint64_t done)
193+/**
194+ * bch_next_delay() - increment @d by the amount of work done, and return how
195+ * long to delay until the next time to do some work.
196+ *
197+ * @d - the struct bch_ratelimit to update
198+ * @done - the amount of work done, in arbitrary units
199+ *
200+ * Returns the amount of time to delay by, in jiffies
201+ */
202+uint64_t bch_next_delay(struct bch_ratelimit *d, uint64_t done)
194203 {
195204 uint64_t now = local_clock();
196205
drivers/md/bcache/util.h+9−3
@@ -450,17 +450,23 @@ read_attribute(name ## _last_ ## frequency_units) · 449 unmodified lines
450450 (ewma) >> factor; \
451451 })
452452
453−struct ratelimit {
453+struct bch_ratelimit {
454+ /* Next time we want to do some work, in nanoseconds */
454455 uint64_t next;
456+
457+ /*
458+ * Rate at which we want to do work, in units per nanosecond
459+ * The units here correspond to the units passed to bch_next_delay()
460+ */
455461 unsigned rate;
456462 };
457463
458−static inline void ratelimit_reset(struct ratelimit *d)
464+static inline void bch_ratelimit_reset(struct bch_ratelimit *d)
459465 {
460466 d->next = local_clock();
461467 }
462468
463−unsigned bch_next_delay(struct ratelimit *d, uint64_t done);
469+uint64_t bch_next_delay(struct bch_ratelimit *d, uint64_t done);
464470
465471 #define __DIV_SAFE(n, d, zero) \
466472 ({ \
drivers/md/bcache/writeback.c+20−22
@@ -94,11 +94,15 @@ static void update_writeback_rate(struct work_struct *work) · 93 unmodified lines
9494
9595 static unsigned writeback_delay(struct cached_dev *dc, unsigned sectors)
9696 {
97+ uint64_t ret;
98+
9799 if (atomic_read(&dc->disk.detaching) ||
98100 !dc->writeback_percent)
99101 return 0;
100102
101− return bch_next_delay(&dc->writeback_rate, sectors * 10000000ULL);
103+ ret = bch_next_delay(&dc->writeback_rate, sectors * 10000000ULL);
104+
105+ return min_t(uint64_t, ret, HZ);
102106 }
103107
104108 /* Background writeback */
@@ -208,7 +212,7 @@ normal_refill: · 103 unmodified lines
208212
209213 up_write(&dc->writeback_lock);
210214
211− ratelimit_reset(&dc->writeback_rate);
215+ bch_ratelimit_reset(&dc->writeback_rate);
212216
213217 /* Punt to workqueue only so we don't recurse and blow the stack */
214218 continue_at(cl, read_dirty, dirty_wq);
@@ -318,9 +322,7 @@ static void write_dirty_finish(struct closure *cl) · 103 unmodified lines
318322 }
319323
320324 bch_keybuf_del(&dc->writeback_keys, w);
321− atomic_dec_bug(&dc->in_flight);
322−
323− closure_wake_up(&dc->writeback_wait);
325+ up(&dc->in_flight);
324326
325327 closure_return_with_destructor(cl, dirty_io_destructor);
326328 }
@@ -349,7 +351,7 @@ static void write_dirty(struct closure *cl) · 22 unmodified lines
349351
350352 closure_bio_submit(&io->bio, cl, &io->dc->disk);
351353
352− continue_at(cl, write_dirty_finish, dirty_wq);
354+ continue_at(cl, write_dirty_finish, system_wq);
353355 }
354356
355357 static void read_dirty_endio(struct bio *bio, int error)
@@ -369,7 +371,7 @@ static void read_dirty_submit(struct closure *cl) · 13 unmodified lines
369371
370372 closure_bio_submit(&io->bio, cl, &io->dc->disk);
371373
372− continue_at(cl, write_dirty, dirty_wq);
374+ continue_at(cl, write_dirty, system_wq);
373375 }
374376
375377 static void read_dirty(struct closure *cl)
@@ -394,12 +396,8 @@ static void read_dirty(struct closure *cl) · 18 unmodified lines
394396
395397 if (delay > 0 &&
396398 (KEY_START(&w->key) != dc->last_read ||
397− jiffies_to_msecs(delay) > 50)) {
398− w->private = NULL;
399−
400− closure_delay(&dc->writeback, delay);
401− continue_at(cl, read_dirty, dirty_wq);
402− }
399+ jiffies_to_msecs(delay) > 50))
400+ delay = schedule_timeout_uninterruptible(delay);
403401
404402 dc->last_read = KEY_OFFSET(&w->key);
405403
@@ -424,15 +422,10 @@ static void read_dirty(struct closure *cl) · 18 unmodified lines
424422
425423 trace_bcache_writeback(&w->key);
426424
427− closure_call(&io->cl, read_dirty_submit, NULL, &dc->disk.cl);
425+ down(&dc->in_flight);
426+ closure_call(&io->cl, read_dirty_submit, NULL, cl);
428427
429428 delay = writeback_delay(dc, KEY_SIZE(&w->key));
430−
431− atomic_inc(&dc->in_flight);
432−
433− if (!closure_wait_event(&dc->writeback_wait, cl,
434− atomic_read(&dc->in_flight) < 64))
435− continue_at(cl, read_dirty, dirty_wq);
436429 }
437430
438431 if (0) {
@@ -442,7 +435,11 @@ err: · 3 unmodified lines
442435 bch_keybuf_del(&dc->writeback_keys, w);
443436 }
444437
445− refill_dirty(cl);
438+ /*
439+ * Wait for outstanding writeback IOs to finish (and keybuf slots to be
440+ * freed) before refilling again
441+ */
442+ continue_at(cl, refill_dirty, dirty_wq);
446443 }
447444
448445 /* Init */
@@ -484,6 +481,7 @@ void bch_sectors_dirty_init(struct cached_dev *dc) · 35 unmodified lines
484481
485482 void bch_cached_dev_writeback_init(struct cached_dev *dc)
486483 {
484+ sema_init(&dc->in_flight, 64);
487485 closure_init_unlocked(&dc->writeback);
488486 init_rwsem(&dc->writeback_lock);
489487
@@ -513,7 +511,7 @@ void bch_writeback_exit(void) · 23 unmodified lines
513511
514512 int __init bch_writeback_init(void)
515513 {
516− dirty_wq = create_singlethread_workqueue("bcache_writeback");
514+ dirty_wq = create_workqueue("bcache_writeback");
517515 if (!dirty_wq)
518516 return -ENOMEM;
519517
drivers/md/dm-io.c+3−4
@@ -19,8 +19,6 @@ · 18 unmodified lines
1919 #define DM_MSG_PREFIX "io"
2020
2121 #define DM_IO_MAX_REGIONS BITS_PER_LONG
22−#define MIN_IOS 16
23−#define MIN_BIOS 16
2422
2523 struct dm_io_client {
2624 mempool_t *pool;
@@ -50,16 +48,17 @@ static struct kmem_cache *_dm_io_cache; · 23 unmodified lines
5048 struct dm_io_client *dm_io_client_create(void)
5149 {
5250 struct dm_io_client *client;
51+ unsigned min_ios = dm_get_reserved_bio_based_ios();
5352
5453 client = kmalloc(sizeof(*client), GFP_KERNEL);
5554 if (!client)
5655 return ERR_PTR(-ENOMEM);
5756
58− client->pool = mempool_create_slab_pool(MIN_IOS, _dm_io_cache);
57+ client->pool = mempool_create_slab_pool(min_ios, _dm_io_cache);
5958 if (!client->pool)
6059 goto bad;
6160
62− client->bios = bioset_create(MIN_BIOS, 0);
61+ client->bios = bioset_create(min_ios, 0);
6362 if (!client->bios)
6463 goto bad;
6564
drivers/md/dm-mpath.c+14−4
@@ -7,6 +7,7 @@ · 6 unmodified lines
77
88 #include <linux/device-mapper.h>
99
10+#include "dm.h"
1011 #include "dm-path-selector.h"
1112 #include "dm-uevent.h"
1213
@@ -116,8 +117,6 @@ struct dm_mpath_io { · 103 unmodified lines
116117
117118 typedef int (*action_fn) (struct pgpath *pgpath);
118119
119−#define MIN_IOS 256 /* Mempool size */
120−
121120 static struct kmem_cache *_mpio_cache;
122121
123122 static struct workqueue_struct *kmultipathd, *kmpath_handlerd;
@@ -190,6 +189,7 @@ static void free_priority_group(struct priority_group *pg, · 66 unmodified lines
190189 static struct multipath *alloc_multipath(struct dm_target *ti)
191190 {
192191 struct multipath *m;
192+ unsigned min_ios = dm_get_reserved_rq_based_ios();
193193
194194 m = kzalloc(sizeof(*m), GFP_KERNEL);
195195 if (m) {
@@ -202,7 +202,7 @@ static struct multipath *alloc_multipath(struct dm_target *ti) · 6 unmodified lines
202202 INIT_WORK(&m->trigger_event, trigger_event);
203203 init_waitqueue_head(&m->pg_init_wait);
204204 mutex_init(&m->work_mutex);
205− m->mpio_pool = mempool_create_slab_pool(MIN_IOS, _mpio_cache);
205+ m->mpio_pool = mempool_create_slab_pool(min_ios, _mpio_cache);
206206 if (!m->mpio_pool) {
207207 kfree(m);
208208 return NULL;
@@ -1268,6 +1268,7 @@ static int noretry_error(int error) · 1059 unmodified lines
12681268 case -EREMOTEIO:
12691269 case -EILSEQ:
12701270 case -ENODATA:
1271+ case -ENOSPC:
12711272 return 1;
12721273 }
12731274
@@ -1298,8 +1299,17 @@ static int do_end_io(struct multipath *m, struct request *clone, · 24 unmodified lines
12981299 if (!error && !clone->errors)
12991300 return 0; /* I/O complete */
13001301
1301− if (noretry_error(error))
1302+ if (noretry_error(error)) {
1303+ if ((clone->cmd_flags & REQ_WRITE_SAME) &&
1304+ !clone->q->limits.max_write_same_sectors) {
1305+ struct queue_limits *limits;
1306+
1307+ /* device doesn't really support WRITE SAME, disable it */
1308+ limits = dm_get_queue_limits(dm_table_get_md(m->ti->table));
1309+ limits->max_write_same_sectors = 0;
1310+ }
13021311 return error;
1312+ }
13031313
13041314 if (mpio->pgpath)
13051315 fail_path(mpio->pgpath);
drivers/md/dm-snap-persistent.c+1−1
@@ -256,7 +256,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw, · 255 unmodified lines
256256 */
257257 INIT_WORK_ONSTACK(&req.work, do_metadata);
258258 queue_work(ps->metadata_wq, &req.work);
259− flush_work(&req.work);
259+ flush_workqueue(ps->metadata_wq);
260260
261261 return req.result;
262262 }
drivers/md/dm-snap.c+2−3
@@ -725,17 +725,16 @@ static int calc_max_buckets(void) · 724 unmodified lines
725725 */
726726 static int init_hash_tables(struct dm_snapshot *s)
727727 {
728− sector_t hash_size, cow_dev_size, origin_dev_size, max_buckets;
728+ sector_t hash_size, cow_dev_size, max_buckets;
729729
730730 /*
731731 * Calculate based on the size of the original volume or
732732 * the COW volume...
733733 */
734734 cow_dev_size = get_dev_size(s->cow->bdev);
735− origin_dev_size = get_dev_size(s->origin->bdev);
736735 max_buckets = calc_max_buckets();
737736
738− hash_size = min(origin_dev_size, cow_dev_size) >> s->store->chunk_shift;
737+ hash_size = cow_dev_size >> s->store->chunk_shift;
739738 hash_size = min(hash_size, max_buckets);
740739
741740 if (hash_size < 64)
drivers/md/dm-stats.c+17−6
@@ -451,19 +451,26 @@ static void dm_stat_for_entry(struct dm_stat *s, size_t entry, · 450 unmodified lines
451451 struct dm_stat_percpu *p;
452452
453453 /*
454− * For strict correctness we should use local_irq_disable/enable
454+ * For strict correctness we should use local_irq_save/restore
455455 * instead of preempt_disable/enable.
456456 *
457− * This is racy if the driver finishes bios from non-interrupt
458− * context as well as from interrupt context or from more different
459− * interrupts.
457+ * preempt_disable/enable is racy if the driver finishes bios
458+ * from non-interrupt context as well as from interrupt context
459+ * or from more different interrupts.
460460 *
461− * However, the race only results in not counting some events,
462− * so it is acceptable.
461+ * On 64-bit architectures the race only results in not counting some
462+ * events, so it is acceptable. On 32-bit architectures the race could
463+ * cause the counter going off by 2^32, so we need to do proper locking
464+ * there.
463465 *
464466 * part_stat_lock()/part_stat_unlock() have this race too.
465467 */
468+#if BITS_PER_LONG == 32
469+ unsigned long flags;
470+ local_irq_save(flags);
471+#else
466472 preempt_disable();
473+#endif
467474 p = &s->stat_percpu[smp_processor_id()][entry];
468475
469476 if (!end) {
@@ -478,7 +485,11 @@ static void dm_stat_for_entry(struct dm_stat *s, size_t entry, · 8 unmodified lines
478485 p->ticks[idx] += duration;
479486 }
480487
488+#if BITS_PER_LONG == 32
489+ local_irq_restore(flags);
490+#else
481491 preempt_enable();
492+#endif
482493 }
483494
484495 static void __dm_stat_bio(struct dm_stat *s, unsigned long bi_rw,
drivers/md/dm-thin.c+11−3
@@ -2095,6 +2095,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) · 2094 unmodified lines
20952095 * them down to the data device. The thin device's discard
20962096 * processing will cause mappings to be removed from the btree.
20972097 */
2098+ ti->discard_zeroes_data_unsupported = true;
20982099 if (pf.discard_enabled && pf.discard_passdown) {
20992100 ti->num_discard_bios = 1;
21002101
@@ -2104,7 +2105,6 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) · 3 unmodified lines
21042105 * thin devices' discard limits consistent).
21052106 */
21062107 ti->discards_supported = true;
2107− ti->discard_zeroes_data_unsupported = true;
21082108 }
21092109 ti->private = pt;
21102110
@@ -2689,8 +2689,16 @@ static void pool_io_hints(struct dm_target *ti, struct queue_limits *limits) · 578 unmodified lines
26892689 * They get transferred to the live pool in bind_control_target()
26902690 * called from pool_preresume().
26912691 */
2692− if (!pt->adjusted_pf.discard_enabled)
2692+ if (!pt->adjusted_pf.discard_enabled) {
2693+ /*
2694+ * Must explicitly disallow stacking discard limits otherwise the
2695+ * block layer will stack them if pool's data device has support.
2696+ * QUEUE_FLAG_DISCARD wouldn't be set but there is no way for the
2697+ * user to see that, so make sure to set all discard limits to 0.
2698+ */
2699+ limits->discard_granularity = 0;
26932700 return;
2701+ }
26942702
26952703 disable_passdown_if_not_supported(pt);
26962704
@@ -2826,10 +2834,10 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) · 129 unmodified lines
28262834 ti->per_bio_data_size = sizeof(struct dm_thin_endio_hook);
28272835
28282836 /* In case the pool supports discards, pass them on. */
2837+ ti->discard_zeroes_data_unsupported = true;
28292838 if (tc->pool->pf.discard_enabled) {
28302839 ti->discards_supported = true;
28312840 ti->num_discard_bios = 1;
2832− ti->discard_zeroes_data_unsupported = true;
28332841 /* Discard bios must be split on a block boundary */
28342842 ti->split_discard_bios = true;
28352843 }
drivers/md/dm.c+67−4
@@ -211,10 +211,55 @@ struct dm_md_mempools { · 210 unmodified lines
211211 struct bio_set *bs;
212212 };
213213
214−#define MIN_IOS 256
214+#define RESERVED_BIO_BASED_IOS 16
215+#define RESERVED_REQUEST_BASED_IOS 256
216+#define RESERVED_MAX_IOS 1024
215217 static struct kmem_cache *_io_cache;
216218 static struct kmem_cache *_rq_tio_cache;
217219
220+/*
221+ * Bio-based DM's mempools' reserved IOs set by the user.
222+ */
223+static unsigned reserved_bio_based_ios = RESERVED_BIO_BASED_IOS;
224+
225+/*
226+ * Request-based DM's mempools' reserved IOs set by the user.
227+ */
228+static unsigned reserved_rq_based_ios = RESERVED_REQUEST_BASED_IOS;
229+
230+static unsigned __dm_get_reserved_ios(unsigned *reserved_ios,
231+ unsigned def, unsigned max)
232+{
233+ unsigned ios = ACCESS_ONCE(*reserved_ios);
234+ unsigned modified_ios = 0;
235+
236+ if (!ios)
237+ modified_ios = def;
238+ else if (ios > max)
239+ modified_ios = max;
240+
241+ if (modified_ios) {
242+ (void)cmpxchg(reserved_ios, ios, modified_ios);
243+ ios = modified_ios;
244+ }
245+
246+ return ios;
247+}
248+
249+unsigned dm_get_reserved_bio_based_ios(void)
250+{
251+ return __dm_get_reserved_ios(&reserved_bio_based_ios,
252+ RESERVED_BIO_BASED_IOS, RESERVED_MAX_IOS);
253+}
254+EXPORT_SYMBOL_GPL(dm_get_reserved_bio_based_ios);
255+
256+unsigned dm_get_reserved_rq_based_ios(void)
257+{
258+ return __dm_get_reserved_ios(&reserved_rq_based_ios,
259+ RESERVED_REQUEST_BASED_IOS, RESERVED_MAX_IOS);
260+}
261+EXPORT_SYMBOL_GPL(dm_get_reserved_rq_based_ios);
262+
218263 static int __init local_init(void)
219264 {
220265 int r = -ENOMEM;
@@ -2277,6 +2322,17 @@ struct target_type *dm_get_immutable_target_type(struct mapped_device *md) · 2056 unmodified lines
22772322 return md->immutable_target_type;
22782323 }
22792324
2325+/*
2326+ * The queue_limits are only valid as long as you have a reference
2327+ * count on 'md'.
2328+ */
2329+struct queue_limits *dm_get_queue_limits(struct mapped_device *md)
2330+{
2331+ BUG_ON(!atomic_read(&md->holders));
2332+ return &md->queue->limits;
2333+}
2334+EXPORT_SYMBOL_GPL(dm_get_queue_limits);
2335+
22802336 /*
22812337 * Fully initialize a request-based queue (->elevator, ->request_fn, etc).
22822338 */
@@ -2862,18 +2918,18 @@ struct dm_md_mempools *dm_alloc_md_mempools(unsigned type, unsigned integrity, u · 579 unmodified lines
28622918
28632919 if (type == DM_TYPE_BIO_BASED) {
28642920 cachep = _io_cache;
2865− pool_size = 16;
2921+ pool_size = dm_get_reserved_bio_based_ios();
28662922 front_pad = roundup(per_bio_data_size, __alignof__(struct dm_target_io)) + offsetof(struct dm_target_io, clone);
28672923 } else if (type == DM_TYPE_REQUEST_BASED) {
28682924 cachep = _rq_tio_cache;
2869− pool_size = MIN_IOS;
2925+ pool_size = dm_get_reserved_rq_based_ios();
28702926 front_pad = offsetof(struct dm_rq_clone_bio_info, clone);
28712927 /* per_bio_data_size is not used. See __bind_mempools(). */
28722928 WARN_ON(per_bio_data_size != 0);
28732929 } else
28742930 goto out;
28752931
2876− pools->io_pool = mempool_create_slab_pool(MIN_IOS, cachep);
2932+ pools->io_pool = mempool_create_slab_pool(pool_size, cachep);
28772933 if (!pools->io_pool)
28782934 goto out;
28792935
@@ -2924,6 +2980,13 @@ module_exit(dm_exit); · 44 unmodified lines
29242980
29252981 module_param(major, uint, 0);
29262982 MODULE_PARM_DESC(major, "The major number of the device mapper");
2983+
2984+module_param(reserved_bio_based_ios, uint, S_IRUGO | S_IWUSR);
2985+MODULE_PARM_DESC(reserved_bio_based_ios, "Reserved IOs in bio-based mempools");
2986+
2987+module_param(reserved_rq_based_ios, uint, S_IRUGO | S_IWUSR);
2988+MODULE_PARM_DESC(reserved_rq_based_ios, "Reserved IOs in request-based mempools");
2989+
29272990 MODULE_DESCRIPTION(DM_NAME " driver");
29282991 MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>");
29292992 MODULE_LICENSE("GPL");
drivers/md/dm.h+3−0
@@ -184,6 +184,9 @@ void dm_free_md_mempools(struct dm_md_mempools *pools); · 183 unmodified lines
184184 /*
185185 * Helpers that are used by DM core
186186 */
187+unsigned dm_get_reserved_bio_based_ios(void);
188+unsigned dm_get_reserved_rq_based_ios(void);
189+
187190 static inline bool dm_message_test_buffer_overflow(char *result, unsigned maxlen)
188191 {
189192 return !maxlen || strlen(result) + 1 >= maxlen;
drivers/misc/mei/amthif.c+1−0
@@ -57,6 +57,7 @@ void mei_amthif_reset_params(struct mei_device *dev) · 56 unmodified lines
5757 dev->iamthif_ioctl = false;
5858 dev->iamthif_state = MEI_IAMTHIF_IDLE;
5959 dev->iamthif_timer = 0;
60+ dev->iamthif_stall_timer = 0;
6061 }
6162
6263 /**
drivers/misc/mei/bus.c+4−1
@@ -297,10 +297,13 @@ int __mei_cl_recv(struct mei_cl *cl, u8 *buf, size_t length) · 296 unmodified lines
297297
298298 if (cl->reading_state != MEI_READ_COMPLETE &&
299299 !waitqueue_active(&cl->rx_wait)) {
300+
300301 mutex_unlock(&dev->device_lock);
301302
302303 if (wait_event_interruptible(cl->rx_wait,
303− (MEI_READ_COMPLETE == cl->reading_state))) {
304+ cl->reading_state == MEI_READ_COMPLETE ||
305+ mei_cl_is_transitioning(cl))) {
306+
304307 if (signal_pending(current))
305308 return -EINTR;
306309 return -ERESTARTSYS;
drivers/misc/mei/client.h+6−0
@@ -90,6 +90,12 @@ static inline bool mei_cl_is_connected(struct mei_cl *cl) · 89 unmodified lines
9090 cl->dev->dev_state == MEI_DEV_ENABLED &&
9191 cl->state == MEI_FILE_CONNECTED);
9292 }
93+static inline bool mei_cl_is_transitioning(struct mei_cl *cl)
94+{
95+ return (MEI_FILE_INITIALIZING == cl->state ||
96+ MEI_FILE_DISCONNECTED == cl->state ||
97+ MEI_FILE_DISCONNECTING == cl->state);
98+}
9399
94100 bool mei_cl_is_other_connecting(struct mei_cl *cl);
95101 int mei_cl_disconnect(struct mei_cl *cl);
drivers/misc/mei/hbm.c+6−4
@@ -35,11 +35,15 @@ static void mei_hbm_me_cl_allocate(struct mei_device *dev) · 34 unmodified lines
3535 struct mei_me_client *clients;
3636 int b;
3737
38+ dev->me_clients_num = 0;
39+ dev->me_client_presentation_num = 0;
40+ dev->me_client_index = 0;
41+
3842 /* count how many ME clients we have */
3943 for_each_set_bit(b, dev->me_clients_map, MEI_CLIENTS_MAX)
4044 dev->me_clients_num++;
4145
42− if (dev->me_clients_num <= 0)
46+ if (dev->me_clients_num == 0)
4347 return;
4448
4549 kfree(dev->me_clients);
@@ -221,7 +225,7 @@ static int mei_hbm_prop_req(struct mei_device *dev) · 175 unmodified lines
221225 struct hbm_props_request *prop_req;
222226 const size_t len = sizeof(struct hbm_props_request);
223227 unsigned long next_client_index;
224− u8 client_num;
228+ unsigned long client_num;
225229
226230
227231 client_num = dev->me_client_presentation_num;
@@ -677,8 +681,6 @@ void mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr) · 449 unmodified lines
677681 if (dev->dev_state == MEI_DEV_INIT_CLIENTS &&
678682 dev->hbm_state == MEI_HBM_ENUM_CLIENTS) {
679683 dev->init_clients_timer = 0;
680− dev->me_client_presentation_num = 0;
681− dev->me_client_index = 0;
682684 mei_hbm_me_cl_allocate(dev);
683685 dev->hbm_state = MEI_HBM_CLIENT_PROPERTIES;
684686
drivers/misc/mei/init.c+3−0
@@ -175,6 +175,9 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) · 174 unmodified lines
175175 memset(&dev->wr_ext_msg, 0, sizeof(dev->wr_ext_msg));
176176 }
177177
178+ /* we're already in reset, cancel the init timer */
179+ dev->init_clients_timer = 0;
180+
178181 dev->me_clients_num = 0;
179182 dev->rd_msg_hdr = 0;
180183 dev->wd_pending = false;
drivers/misc/mei/main.c+4−7
@@ -249,19 +249,16 @@ static ssize_t mei_read(struct file *file, char __user *ubuf, · 248 unmodified lines
249249 mutex_unlock(&dev->device_lock);
250250
251251 if (wait_event_interruptible(cl->rx_wait,
252− (MEI_READ_COMPLETE == cl->reading_state ||
253− MEI_FILE_INITIALIZING == cl->state ||
254− MEI_FILE_DISCONNECTED == cl->state ||
255− MEI_FILE_DISCONNECTING == cl->state))) {
252+ MEI_READ_COMPLETE == cl->reading_state ||
253+ mei_cl_is_transitioning(cl))) {
254+
256255 if (signal_pending(current))
257256 return -EINTR;
258257 return -ERESTARTSYS;
259258 }
260259
261260 mutex_lock(&dev->device_lock);
262− if (MEI_FILE_INITIALIZING == cl->state ||
263− MEI_FILE_DISCONNECTED == cl->state ||
264− MEI_FILE_DISCONNECTING == cl->state) {
261+ if (mei_cl_is_transitioning(cl)) {
265262 rets = -EBUSY;
266263 goto out;
267264 }
drivers/misc/mei/mei_dev.h+3−3
@@ -396,9 +396,9 @@ struct mei_device { · 395 unmodified lines
396396 struct mei_me_client *me_clients; /* Note: memory has to be allocated */
397397 DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX);
398398 DECLARE_BITMAP(host_clients_map, MEI_CLIENTS_MAX);
399− u8 me_clients_num;
400− u8 me_client_presentation_num;
401− u8 me_client_index;
399+ unsigned long me_clients_num;
400+ unsigned long me_client_presentation_num;
401+ unsigned long me_client_index;
402402
403403 struct mei_cl wd_cl;
404404 enum mei_wd_states wd_state;
drivers/mmc/host/sh_mobile_sdhi.c+8−8
@@ -113,14 +113,14 @@ static const struct sh_mobile_sdhi_ops sdhi_ops = { · 112 unmodified lines
113113 };
114114
115115 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
116− { .compatible = "renesas,shmobile-sdhi" },
117− { .compatible = "renesas,sh7372-sdhi" },
118− { .compatible = "renesas,sh73a0-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
119− { .compatible = "renesas,r8a73a4-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
120− { .compatible = "renesas,r8a7740-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
121− { .compatible = "renesas,r8a7778-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
122− { .compatible = "renesas,r8a7779-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
123− { .compatible = "renesas,r8a7790-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
116+ { .compatible = "renesas,sdhi-shmobile" },
117+ { .compatible = "renesas,sdhi-sh7372" },
118+ { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
119+ { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
120+ { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
121+ { .compatible = "renesas,sdhi-r8a7778", .data = &sh_mobile_sdhi_of_cfg[0], },
122+ { .compatible = "renesas,sdhi-r8a7779", .data = &sh_mobile_sdhi_of_cfg[0], },
123+ { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], },
124124 {},
125125 };
126126 MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);
drivers/mtd/nand/pxa3xx_nand.c+0−7
@@ -1236,7 +1236,6 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) · 1235 unmodified lines
12361236 return 0;
12371237 }
12381238
1239−#ifdef CONFIG_OF
12401239 static struct of_device_id pxa3xx_nand_dt_ids[] = {
12411240 {
12421241 .compatible = "marvell,pxa3xx-nand",
@@ -1284,12 +1283,6 @@ static int pxa3xx_nand_probe_dt(struct platform_device *pdev) · 41 unmodified lines
12841283
12851284 return 0;
12861285 }
1287−#else
1288−static inline int pxa3xx_nand_probe_dt(struct platform_device *pdev)
1289−{
1290− return 0;
1291−}
1292−#endif
12931286
12941287 static int pxa3xx_nand_probe(struct platform_device *pdev)
12951288 {
drivers/net/bonding/bond_alb.c+1−1
@@ -1472,7 +1472,7 @@ void bond_alb_monitor(struct work_struct *work) · 1471 unmodified lines
14721472 bond_info->lp_counter++;
14731473
14741474 /* send learning packets */
1475− if (bond_info->lp_counter >= BOND_ALB_LP_TICKS) {
1475+ if (bond_info->lp_counter >= BOND_ALB_LP_TICKS(bond)) {
14761476 /* change of curr_active_slave involves swapping of mac addresses.
14771477 * in order to avoid this swapping from happening while
14781478 * sending the learning packets, the curr_slave_lock must be held for
drivers/net/bonding/bond_alb.h+5−4
@@ -36,14 +36,15 @@ struct slave; · 35 unmodified lines
3636 * Used for division - never set
3737 * to zero !!!
3838 */
39−#define BOND_ALB_LP_INTERVAL 1 /* In seconds, periodic send of
40− * learning packets to the switch
41− */
39+#define BOND_ALB_DEFAULT_LP_INTERVAL 1
40+#define BOND_ALB_LP_INTERVAL(bond) (bond->params.lp_interval) /* In seconds, periodic send of
41+ * learning packets to the switch
42+ */
4243
4344 #define BOND_TLB_REBALANCE_TICKS (BOND_TLB_REBALANCE_INTERVAL \
4445 * ALB_TIMER_TICKS_PER_SEC)
4546
46−#define BOND_ALB_LP_TICKS (BOND_ALB_LP_INTERVAL \
47+#define BOND_ALB_LP_TICKS(bond) (BOND_ALB_LP_INTERVAL(bond) \
4748 * ALB_TIMER_TICKS_PER_SEC)
4849
4950 #define TLB_HASH_TABLE_SIZE 256 /* The size of the clients hash table.
drivers/net/bonding/bond_main.c+11−3
@@ -1724,6 +1724,7 @@ static int __bond_release_one(struct net_device *bond_dev, · 1723 unmodified lines
17241724 struct bonding *bond = netdev_priv(bond_dev);
17251725 struct slave *slave, *oldcurrent;
17261726 struct sockaddr addr;
1727+ int old_flags = bond_dev->flags;
17271728 netdev_features_t old_features = bond_dev->features;
17281729
17291730 /* slave is not a slave or master is not master of this slave */
@@ -1855,12 +1856,18 @@ static int __bond_release_one(struct net_device *bond_dev, · 125 unmodified lines
18551856 * bond_change_active_slave(..., NULL)
18561857 */
18571858 if (!USES_PRIMARY(bond->params.mode)) {
1858− /* unset promiscuity level from slave */
1859− if (bond_dev->flags & IFF_PROMISC)
1859+ /* unset promiscuity level from slave
1860+ * NOTE: The NETDEV_CHANGEADDR call above may change the value
1861+ * of the IFF_PROMISC flag in the bond_dev, but we need the
1862+ * value of that flag before that change, as that was the value
1863+ * when this slave was attached, so we cache at the start of the
1864+ * function and use it here. Same goes for ALLMULTI below
1865+ */
1866+ if (old_flags & IFF_PROMISC)
18601867 dev_set_promiscuity(slave_dev, -1);
18611868
18621869 /* unset allmulti level from slave */
1863− if (bond_dev->flags & IFF_ALLMULTI)
1870+ if (old_flags & IFF_ALLMULTI)
18641871 dev_set_allmulti(slave_dev, -1);
18651872
18661873 bond_hw_addr_flush(bond_dev, slave_dev);
@@ -4416,6 +4423,7 @@ static int bond_check_params(struct bond_params *params) · 2549 unmodified lines
44164423 params->all_slaves_active = all_slaves_active;
44174424 params->resend_igmp = resend_igmp;
44184425 params->min_links = min_links;
4426+ params->lp_interval = BOND_ALB_DEFAULT_LP_INTERVAL;
44194427
44204428 if (primary) {
44214429 strncpy(params->primary, primary, IFNAMSIZ);
drivers/net/bonding/bond_sysfs.c+39−0
@@ -1699,6 +1699,44 @@ out: · 1698 unmodified lines
16991699 static DEVICE_ATTR(resend_igmp, S_IRUGO | S_IWUSR,
17001700 bonding_show_resend_igmp, bonding_store_resend_igmp);
17011701
1702+
1703+static ssize_t bonding_show_lp_interval(struct device *d,
1704+ struct device_attribute *attr,
1705+ char *buf)
1706+{
1707+ struct bonding *bond = to_bond(d);
1708+ return sprintf(buf, "%d\n", bond->params.lp_interval);
1709+}
1710+
1711+static ssize_t bonding_store_lp_interval(struct device *d,
1712+ struct device_attribute *attr,
1713+ const char *buf, size_t count)
1714+{
1715+ struct bonding *bond = to_bond(d);
1716+ int new_value, ret = count;
1717+
1718+ if (sscanf(buf, "%d", &new_value) != 1) {
1719+ pr_err("%s: no lp interval value specified.\n",
1720+ bond->dev->name);
1721+ ret = -EINVAL;
1722+ goto out;
1723+ }
1724+
1725+ if (new_value <= 0) {
1726+ pr_err ("%s: lp_interval must be between 1 and %d\n",
1727+ bond->dev->name, INT_MAX);
1728+ ret = -EINVAL;
1729+ goto out;
1730+ }
1731+
1732+ bond->params.lp_interval = new_value;
1733+out:
1734+ return ret;
1735+}
1736+
1737+static DEVICE_ATTR(lp_interval, S_IRUGO | S_IWUSR,
1738+ bonding_show_lp_interval, bonding_store_lp_interval);
1739+
17021740 static struct attribute *per_bond_attrs[] = {
17031741 &dev_attr_slaves.attr,
17041742 &dev_attr_mode.attr,
@@ -1729,6 +1767,7 @@ static struct attribute *per_bond_attrs[] = { · 24 unmodified lines
17291767 &dev_attr_all_slaves_active.attr,
17301768 &dev_attr_resend_igmp.attr,
17311769 &dev_attr_min_links.attr,
1770+ &dev_attr_lp_interval.attr,
17321771 NULL,
17331772 };
17341773
drivers/net/bonding/bonding.h+1−0
@@ -176,6 +176,7 @@ struct bond_params { · 175 unmodified lines
176176 int tx_queues;
177177 int all_slaves_active;
178178 int resend_igmp;
179+ int lp_interval;
179180 };
180181
181182 struct bond_parm_tbl {
drivers/net/can/flexcan.c+0−12
@@ -702,7 +702,6 @@ static int flexcan_chip_start(struct net_device *dev) · 701 unmodified lines
702702 {
703703 struct flexcan_priv *priv = netdev_priv(dev);
704704 struct flexcan_regs __iomem *regs = priv->base;
705− unsigned int i;
706705 int err;
707706 u32 reg_mcr, reg_ctrl;
708707
@@ -772,17 +771,6 @@ static int flexcan_chip_start(struct net_device *dev) · 63 unmodified lines
772771 netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
773772 flexcan_write(reg_ctrl, &regs->ctrl);
774773
775− for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) {
776− flexcan_write(0, &regs->cantxfg[i].can_ctrl);
777− flexcan_write(0, &regs->cantxfg[i].can_id);
778− flexcan_write(0, &regs->cantxfg[i].data[0]);
779− flexcan_write(0, &regs->cantxfg[i].data[1]);
780−
781− /* put MB into rx queue */
782− flexcan_write(FLEXCAN_MB_CNT_CODE(0x4),
783− &regs->cantxfg[i].can_ctrl);
784− }
785−
786774 /* acceptance mask/acceptance code (accept everything) */
787775 flexcan_write(0x0, &regs->rxgmask);
788776 flexcan_write(0x0, &regs->rx14mask);
drivers/net/can/slcan.c+90−49
@@ -76,6 +76,10 @@ MODULE_PARM_DESC(maxdev, "Maximum number of slcan interfaces"); · 75 unmodified lines
7676 /* maximum rx buffer len: extended CAN frame with timestamp */
7777 #define SLC_MTU (sizeof("T1111222281122334455667788EA5F\r")+1)
7878
79+#define SLC_CMD_LEN 1
80+#define SLC_SFF_ID_LEN 3
81+#define SLC_EFF_ID_LEN 8
82+
7983 struct slcan {
8084 int magic;
8185
@@ -142,47 +146,63 @@ static void slc_bump(struct slcan *sl) · 60 unmodified lines
142146 {
143147 struct sk_buff *skb;
144148 struct can_frame cf;
145− int i, dlc_pos, tmp;
146− unsigned long ultmp;
147− char cmd = sl->rbuff[0];
148−
149− if ((cmd != 't') && (cmd != 'T') && (cmd != 'r') && (cmd != 'R'))
149+ int i, tmp;
150+ u32 tmpid;
151+ char *cmd = sl->rbuff;
152+
153+ cf.can_id = 0;
154+
155+ switch (*cmd) {
156+ case 'r':
157+ cf.can_id = CAN_RTR_FLAG;
158+ /* fallthrough */
159+ case 't':
160+ /* store dlc ASCII value and terminate SFF CAN ID string */
161+ cf.can_dlc = sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN];
162+ sl->rbuff[SLC_CMD_LEN + SLC_SFF_ID_LEN] = 0;
163+ /* point to payload data behind the dlc */
164+ cmd += SLC_CMD_LEN + SLC_SFF_ID_LEN + 1;
165+ break;
166+ case 'R':
167+ cf.can_id = CAN_RTR_FLAG;
168+ /* fallthrough */
169+ case 'T':
170+ cf.can_id |= CAN_EFF_FLAG;
171+ /* store dlc ASCII value and terminate EFF CAN ID string */
172+ cf.can_dlc = sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN];
173+ sl->rbuff[SLC_CMD_LEN + SLC_EFF_ID_LEN] = 0;
174+ /* point to payload data behind the dlc */
175+ cmd += SLC_CMD_LEN + SLC_EFF_ID_LEN + 1;
176+ break;
177+ default:
150178 return;
179+ }
151180
152− if (cmd & 0x20) /* tiny chars 'r' 't' => standard frame format */
153− dlc_pos = 4; /* dlc position tiiid */
154− else
155− dlc_pos = 9; /* dlc position Tiiiiiiiid */
156−
157− if (!((sl->rbuff[dlc_pos] >= '0') && (sl->rbuff[dlc_pos] < '9')))
181+ if (kstrtou32(sl->rbuff + SLC_CMD_LEN, 16, &tmpid))
158182 return;
159183
160− cf.can_dlc = sl->rbuff[dlc_pos] - '0'; /* get can_dlc from ASCII val */
184+ cf.can_id |= tmpid;
161185
162− sl->rbuff[dlc_pos] = 0; /* terminate can_id string */
163−
164− if (kstrtoul(sl->rbuff+1, 16, &ultmp))
186+ /* get can_dlc from sanitized ASCII value */
187+ if (cf.can_dlc >= '0' && cf.can_dlc < '9')
188+ cf.can_dlc -= '0';
189+ else
165190 return;
166191
167− cf.can_id = ultmp;
168−
169− if (!(cmd & 0x20)) /* NO tiny chars => extended frame format */
170− cf.can_id |= CAN_EFF_FLAG;
171−
172− if ((cmd | 0x20) == 'r') /* RTR frame */
173− cf.can_id |= CAN_RTR_FLAG;
174−
175192 *(u64 *) (&cf.data) = 0; /* clear payload */
176193
177− for (i = 0, dlc_pos++; i < cf.can_dlc; i++) {
178− tmp = hex_to_bin(sl->rbuff[dlc_pos++]);
179− if (tmp < 0)
180− return;
181− cf.data[i] = (tmp << 4);
182− tmp = hex_to_bin(sl->rbuff[dlc_pos++]);
183− if (tmp < 0)
184− return;
185− cf.data[i] |= tmp;
194+ /* RTR frames may have a dlc > 0 but they never have any data bytes */
195+ if (!(cf.can_id & CAN_RTR_FLAG)) {
196+ for (i = 0; i < cf.can_dlc; i++) {
197+ tmp = hex_to_bin(*cmd++);
198+ if (tmp < 0)
199+ return;
200+ cf.data[i] = (tmp << 4);
201+ tmp = hex_to_bin(*cmd++);
202+ if (tmp < 0)
203+ return;
204+ cf.data[i] |= tmp;
205+ }
186206 }
187207
188208 skb = dev_alloc_skb(sizeof(struct can_frame) +
@@ -209,7 +229,6 @@ static void slc_bump(struct slcan *sl) · 20 unmodified lines
209229 /* parse tty input stream */
210230 static void slcan_unesc(struct slcan *sl, unsigned char s)
211231 {
212−
213232 if ((s == '\r') || (s == '\a')) { /* CR or BEL ends the pdu */
214233 if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
215234 (sl->rcount > 4)) {
@@ -236,27 +255,46 @@ static void slcan_unesc(struct slcan *sl, unsigned char s) · 20 unmodified lines
236255 /* Encapsulate one can_frame and stuff into a TTY queue. */
237256 static void slc_encaps(struct slcan *sl, struct can_frame *cf)
238257 {
239− int actual, idx, i;
240− char cmd;
258+ int actual, i;
259+ unsigned char *pos;
260+ unsigned char *endpos;
261+ canid_t id = cf->can_id;
262+
263+ pos = sl->xbuff;
241264
242265 if (cf->can_id & CAN_RTR_FLAG)
243− cmd = 'R'; /* becomes 'r' in standard frame format */
266+ *pos = 'R'; /* becomes 'r' in standard frame format (SFF) */
244267 else
245− cmd = 'T'; /* becomes 't' in standard frame format */
268+ *pos = 'T'; /* becomes 't' in standard frame format (SSF) */
246269
247− if (cf->can_id & CAN_EFF_FLAG)
248− sprintf(sl->xbuff, "%c%08X%d", cmd,
249− cf->can_id & CAN_EFF_MASK, cf->can_dlc);
250− else
251− sprintf(sl->xbuff, "%c%03X%d", cmd | 0x20,
252− cf->can_id & CAN_SFF_MASK, cf->can_dlc);
270+ /* determine number of chars for the CAN-identifier */
271+ if (cf->can_id & CAN_EFF_FLAG) {
272+ id &= CAN_EFF_MASK;
273+ endpos = pos + SLC_EFF_ID_LEN;
274+ } else {
275+ *pos |= 0x20; /* convert R/T to lower case for SFF */
276+ id &= CAN_SFF_MASK;
277+ endpos = pos + SLC_SFF_ID_LEN;
278+ }
253279
254− idx = strlen(sl->xbuff);
280+ /* build 3 (SFF) or 8 (EFF) digit CAN identifier */
281+ pos++;
282+ while (endpos >= pos) {
283+ *endpos-- = hex_asc_upper[id & 0xf];
284+ id >>= 4;
285+ }
286+
287+ pos += (cf->can_id & CAN_EFF_FLAG) ? SLC_EFF_ID_LEN : SLC_SFF_ID_LEN;
255288
256− for (i = 0; i < cf->can_dlc; i++)
257− sprintf(&sl->xbuff[idx + 2*i], "%02X", cf->data[i]);
289+ *pos++ = cf->can_dlc + '0';
290+
291+ /* RTR frames may have a dlc > 0 but they never have any data bytes */
292+ if (!(cf->can_id & CAN_RTR_FLAG)) {
293+ for (i = 0; i < cf->can_dlc; i++)
294+ pos = hex_byte_pack_upper(pos, cf->data[i]);
295+ }
258296
259− strcat(sl->xbuff, "\r"); /* add terminating character */
297+ *pos++ = '\r';
260298
261299 /* Order of next two lines is *very* important.
262300 * When we are sending a little amount of data,
@@ -267,8 +305,8 @@ static void slc_encaps(struct slcan *sl, struct can_frame *cf) · 4 unmodified lines
267305 * 14 Oct 1994 Dmitry Gorodchanin.
268306 */
269307 set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
270− actual = sl->tty->ops->write(sl->tty, sl->xbuff, strlen(sl->xbuff));
271− sl->xleft = strlen(sl->xbuff) - actual;
308+ actual = sl->tty->ops->write(sl->tty, sl->xbuff, pos - sl->xbuff);
309+ sl->xleft = (pos - sl->xbuff) - actual;
272310 sl->xhead = sl->xbuff + actual;
273311 sl->dev->stats.tx_bytes += cf->can_dlc;
274312 }
@@ -286,11 +324,13 @@ static void slcan_write_wakeup(struct tty_struct *tty) · 11 unmodified lines
286324 if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev))
287325 return;
288326
327+ spin_lock(&sl->lock);
289328 if (sl->xleft <= 0) {
290329 /* Now serial buffer is almost free & we can start
291330 * transmission of another packet */
292331 sl->dev->stats.tx_packets++;
293332 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
333+ spin_unlock(&sl->lock);
294334 netif_wake_queue(sl->dev);
295335 return;
296336 }
@@ -298,6 +338,7 @@ static void slcan_write_wakeup(struct tty_struct *tty) · 1 unmodified line
298338 actual = tty->ops->write(tty, sl->xhead, sl->xleft);
299339 sl->xleft -= actual;
300340 sl->xhead += actual;
341+ spin_unlock(&sl->lock);
301342 }
302343
303344 /* Send a can_frame to a TTY queue. */
drivers/net/can/usb/peak_usb/pcan_usb_core.c+11−4
@@ -463,7 +463,7 @@ static int peak_usb_start(struct peak_usb_device *dev) · 462 unmodified lines
463463 if (i < PCAN_USB_MAX_TX_URBS) {
464464 if (i == 0) {
465465 netdev_err(netdev, "couldn't setup any tx URB\n");
466− return err;
466+ goto err_tx;
467467 }
468468
469469 netdev_warn(netdev, "tx performance may be slow\n");
@@ -472,7 +472,7 @@ static int peak_usb_start(struct peak_usb_device *dev) · 2 unmodified lines
472472 if (dev->adapter->dev_start) {
473473 err = dev->adapter->dev_start(dev);
474474 if (err)
475− goto failed;
475+ goto err_adapter;
476476 }
477477
478478 dev->state |= PCAN_USB_STATE_STARTED;
@@ -481,19 +481,26 @@ static int peak_usb_start(struct peak_usb_device *dev) · 2 unmodified lines
481481 if (dev->adapter->dev_set_bus) {
482482 err = dev->adapter->dev_set_bus(dev, 1);
483483 if (err)
484− goto failed;
484+ goto err_adapter;
485485 }
486486
487487 dev->can.state = CAN_STATE_ERROR_ACTIVE;
488488
489489 return 0;
490490
491−failed:
491+err_adapter:
492492 if (err == -ENODEV)
493493 netif_device_detach(dev->netdev);
494494
495495 netdev_warn(netdev, "couldn't submit control: %d\n", err);
496496
497+ for (i = 0; i < PCAN_USB_MAX_TX_URBS; i++) {
498+ usb_free_urb(dev->tx_contexts[i].urb);
499+ dev->tx_contexts[i].urb = NULL;
500+ }
501+err_tx:
502+ usb_kill_anchored_urbs(&dev->rx_submitted);
503+
497504 return err;
498505 }
499506
drivers/net/ethernet/adi/bfin_mac.c+2−2
@@ -530,7 +530,7 @@ static int bfin_mac_ethtool_setwol(struct net_device *dev, · 529 unmodified lines
530530 if (lp->wol && !lp->irq_wake_requested) {
531531 /* register wake irq handler */
532532 rc = request_irq(IRQ_MAC_WAKEDET, bfin_mac_wake_interrupt,
533− IRQF_DISABLED, "EMAC_WAKE", dev);
533+ 0, "EMAC_WAKE", dev);
534534 if (rc)
535535 return rc;
536536 lp->irq_wake_requested = true;
@@ -1686,7 +1686,7 @@ static int bfin_mac_probe(struct platform_device *pdev) · 1149 unmodified lines
16861686 /* now, enable interrupts */
16871687 /* register irq handler */
16881688 rc = request_irq(IRQ_MAC_RX, bfin_mac_interrupt,
1689− IRQF_DISABLED, "EMAC_RX", ndev);
1689+ 0, "EMAC_RX", ndev);
16901690 if (rc) {
16911691 dev_err(&pdev->dev, "Cannot request Blackfin MAC RX IRQ!\n");
16921692 rc = -EBUSY;
drivers/net/ethernet/amd/sun3lance.c+1−1
@@ -358,7 +358,7 @@ static int __init lance_probe( struct net_device *dev) · 357 unmodified lines
358358
359359 REGA(CSR0) = CSR0_STOP;
360360
361− if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) {
361+ if (request_irq(LANCE_IRQ, lance_interrupt, 0, "SUN3 Lance", dev) < 0) {
362362 #ifdef CONFIG_SUN3
363363 iounmap((void __iomem *)ioaddr);
364364 #endif
drivers/net/ethernet/atheros/alx/main.c+2−7
@@ -1188,7 +1188,7 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 1187 unmodified lines
11881188 struct alx_priv *alx;
11891189 struct alx_hw *hw;
11901190 bool phy_configured;
1191− int bars, pm_cap, err;
1191+ int bars, err;
11921192
11931193 err = pci_enable_device_mem(pdev);
11941194 if (err)
@@ -1225,18 +1225,13 @@ static int alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 30 unmodified lines
12251225 pci_enable_pcie_error_reporting(pdev);
12261226 pci_set_master(pdev);
12271227
1228− pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
1229− if (pm_cap == 0) {
1228+ if (!pdev->pm_cap) {
12301229 dev_err(&pdev->dev,
12311230 "Can't find power management capability, aborting\n");
12321231 err = -EIO;
12331232 goto out_pci_release;
12341233 }
12351234
1236− err = pci_set_power_state(pdev, PCI_D0);
1237− if (err)
1238− goto out_pci_release;
1239−
12401235 netdev = alloc_etherdev(sizeof(*alx));
12411236 if (!netdev) {
12421237 err = -ENOMEM;
drivers/net/ethernet/broadcom/bgmac.c+31−13
@@ -157,6 +157,7 @@ static netdev_tx_t bgmac_dma_tx_add(struct bgmac *bgmac, · 156 unmodified lines
157157 if (++ring->end >= BGMAC_TX_RING_SLOTS)
158158 ring->end = 0;
159159 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_TX_INDEX,
160+ ring->index_base +
160161 ring->end * sizeof(struct bgmac_dma_desc));
161162
162163 /* Always keep one slot free to allow detecting bugged calls. */
@@ -181,6 +182,8 @@ static void bgmac_dma_tx_free(struct bgmac *bgmac, struct bgmac_dma_ring *ring) · 18 unmodified lines
181182 /* The last slot that hardware didn't consume yet */
182183 empty_slot = bgmac_read(bgmac, ring->mmio_base + BGMAC_DMA_TX_STATUS);
183184 empty_slot &= BGMAC_DMA_TX_STATDPTR;
185+ empty_slot -= ring->index_base;
186+ empty_slot &= BGMAC_DMA_TX_STATDPTR;
184187 empty_slot /= sizeof(struct bgmac_dma_desc);
185188
186189 while (ring->start != empty_slot) {
@@ -274,6 +277,8 @@ static int bgmac_dma_rx_read(struct bgmac *bgmac, struct bgmac_dma_ring *ring, · 87 unmodified lines
274277
275278 end_slot = bgmac_read(bgmac, ring->mmio_base + BGMAC_DMA_RX_STATUS);
276279 end_slot &= BGMAC_DMA_RX_STATDPTR;
280+ end_slot -= ring->index_base;
281+ end_slot &= BGMAC_DMA_RX_STATDPTR;
277282 end_slot /= sizeof(struct bgmac_dma_desc);
278283
279284 ring->end = end_slot;
@@ -418,9 +423,6 @@ static int bgmac_dma_alloc(struct bgmac *bgmac) · 138 unmodified lines
418423 ring = &bgmac->tx_ring[i];
419424 ring->num_slots = BGMAC_TX_RING_SLOTS;
420425 ring->mmio_base = ring_base[i];
421− if (bgmac_dma_unaligned(bgmac, ring, BGMAC_DMA_RING_TX))
422− bgmac_warn(bgmac, "TX on ring 0x%X supports unaligned addressing but this feature is not implemented\n",
423− ring->mmio_base);
424426
425427 /* Alloc ring of descriptors */
426428 size = ring->num_slots * sizeof(struct bgmac_dma_desc);
@@ -435,6 +437,13 @@ static int bgmac_dma_alloc(struct bgmac *bgmac) · 8 unmodified lines
435437 if (ring->dma_base & 0xC0000000)
436438 bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n");
437439
440+ ring->unaligned = bgmac_dma_unaligned(bgmac, ring,
441+ BGMAC_DMA_RING_TX);
442+ if (ring->unaligned)
443+ ring->index_base = lower_32_bits(ring->dma_base);
444+ else
445+ ring->index_base = 0;
446+
438447 /* No need to alloc TX slots yet */
439448 }
440449
@@ -444,9 +453,6 @@ static int bgmac_dma_alloc(struct bgmac *bgmac) · 3 unmodified lines
444453 ring = &bgmac->rx_ring[i];
445454 ring->num_slots = BGMAC_RX_RING_SLOTS;
446455 ring->mmio_base = ring_base[i];
447− if (bgmac_dma_unaligned(bgmac, ring, BGMAC_DMA_RING_RX))
448− bgmac_warn(bgmac, "RX on ring 0x%X supports unaligned addressing but this feature is not implemented\n",
449− ring->mmio_base);
450456
451457 /* Alloc ring of descriptors */
452458 size = ring->num_slots * sizeof(struct bgmac_dma_desc);
@@ -462,6 +468,13 @@ static int bgmac_dma_alloc(struct bgmac *bgmac) · 9 unmodified lines
462468 if (ring->dma_base & 0xC0000000)
463469 bgmac_warn(bgmac, "DMA address using 0xC0000000 bit(s), it may need translation trick\n");
464470
471+ ring->unaligned = bgmac_dma_unaligned(bgmac, ring,
472+ BGMAC_DMA_RING_RX);
473+ if (ring->unaligned)
474+ ring->index_base = lower_32_bits(ring->dma_base);
475+ else
476+ ring->index_base = 0;
477+
465478 /* Alloc RX slots */
466479 for (j = 0; j < ring->num_slots; j++) {
467480 err = bgmac_dma_rx_skb_for_slot(bgmac, &ring->slots[j]);
@@ -489,12 +502,14 @@ static void bgmac_dma_init(struct bgmac *bgmac) · 21 unmodified lines
489502 for (i = 0; i < BGMAC_MAX_TX_RINGS; i++) {
490503 ring = &bgmac->tx_ring[i];
491504
492− /* We don't implement unaligned addressing, so enable first */
493− bgmac_dma_tx_enable(bgmac, ring);
505+ if (!ring->unaligned)
506+ bgmac_dma_tx_enable(bgmac, ring);
494507 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_TX_RINGLO,
495508 lower_32_bits(ring->dma_base));
496509 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_TX_RINGHI,
497510 upper_32_bits(ring->dma_base));
511+ if (ring->unaligned)
512+ bgmac_dma_tx_enable(bgmac, ring);
498513
499514 ring->start = 0;
500515 ring->end = 0; /* Points the slot that should *not* be read */
@@ -505,12 +520,14 @@ static void bgmac_dma_init(struct bgmac *bgmac) · 4 unmodified lines
505520
506521 ring = &bgmac->rx_ring[i];
507522
508− /* We don't implement unaligned addressing, so enable first */
509− bgmac_dma_rx_enable(bgmac, ring);
523+ if (!ring->unaligned)
524+ bgmac_dma_rx_enable(bgmac, ring);
510525 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_RX_RINGLO,
511526 lower_32_bits(ring->dma_base));
512527 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_RX_RINGHI,
513528 upper_32_bits(ring->dma_base));
529+ if (ring->unaligned)
530+ bgmac_dma_rx_enable(bgmac, ring);
514531
515532 for (j = 0, dma_desc = ring->cpu_base; j < ring->num_slots;
516533 j++, dma_desc++) {
@@ -531,6 +548,7 @@ static void bgmac_dma_init(struct bgmac *bgmac) · 14 unmodified lines
531548 }
532549
533550 bgmac_write(bgmac, ring->mmio_base + BGMAC_DMA_RX_INDEX,
551+ ring->index_base +
534552 ring->num_slots * sizeof(struct bgmac_dma_desc));
535553
536554 ring->start = 0;
@@ -908,10 +926,10 @@ static void bgmac_chip_reset(struct bgmac *bgmac) · 371 unmodified lines
908926 struct bcma_drv_cc *cc = &bgmac->core->bus->drv_cc;
909927 u8 et_swtype = 0;
910928 u8 sw_type = BGMAC_CHIPCTL_1_SW_TYPE_EPHY |
911− BGMAC_CHIPCTL_1_IF_TYPE_RMII;
912− char buf[2];
929+ BGMAC_CHIPCTL_1_IF_TYPE_MII;
930+ char buf[4];
913931
914− if (bcm47xx_nvram_getenv("et_swtype", buf, 1) > 0) {
932+ if (bcm47xx_nvram_getenv("et_swtype", buf, sizeof(buf)) > 0) {
915933 if (kstrtou8(buf, 0, &et_swtype))
916934 bgmac_err(bgmac, "Failed to parse et_swtype (%s)\n",
917935 buf);
drivers/net/ethernet/broadcom/bgmac.h+3−1
@@ -333,7 +333,7 @@ · 332 unmodified lines
333333
334334 #define BGMAC_CHIPCTL_1_IF_TYPE_MASK 0x00000030
335335 #define BGMAC_CHIPCTL_1_IF_TYPE_RMII 0x00000000
336−#define BGMAC_CHIPCTL_1_IF_TYPE_MI 0x00000010
336+#define BGMAC_CHIPCTL_1_IF_TYPE_MII 0x00000010
337337 #define BGMAC_CHIPCTL_1_IF_TYPE_RGMII 0x00000020
338338 #define BGMAC_CHIPCTL_1_SW_TYPE_MASK 0x000000C0
339339 #define BGMAC_CHIPCTL_1_SW_TYPE_EPHY 0x00000000
@@ -384,6 +384,8 @@ struct bgmac_dma_ring { · 44 unmodified lines
384384 u16 mmio_base;
385385 struct bgmac_dma_desc *cpu_base;
386386 dma_addr_t dma_base;
387+ u32 index_base; /* Used for unaligned rings only, otherwise 0 */
388+ bool unaligned;
387389
388390 struct bgmac_slot_info slots[BGMAC_RX_RING_SLOTS];
389391 };
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+33−4
@@ -246,8 +246,37 @@ enum { · 245 unmodified lines
246246 BNX2X_MAX_CNIC_ETH_CL_ID_IDX,
247247 };
248248
249−#define BNX2X_CNIC_START_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) *\
249+/* use a value high enough to be above all the PFs, which has least significant
250+ * nibble as 8, so when cnic needs to come up with a CID for UIO to use to
251+ * calculate doorbell address according to old doorbell configuration scheme
252+ * (db_msg_sz 1 << 7 * cid + 0x40 DPM offset) it can come up with a valid number
253+ * We must avoid coming up with cid 8 for iscsi since according to this method
254+ * the designated UIO cid will come out 0 and it has a special handling for that
255+ * case which doesn't suit us. Therefore will will cieling to closes cid which
256+ * has least signigifcant nibble 8 and if it is 8 we will move forward to 0x18.
257+ */
258+
259+#define BNX2X_1st_NON_L2_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * \
250260 (bp)->max_cos)
261+/* amount of cids traversed by UIO's DPM addition to doorbell */
262+#define UIO_DPM 8
263+/* roundup to DPM offset */
264+#define UIO_ROUNDUP(bp) (roundup(BNX2X_1st_NON_L2_ETH_CID(bp), \
265+ UIO_DPM))
266+/* offset to nearest value which has lsb nibble matching DPM */
267+#define UIO_CID_OFFSET(bp) ((UIO_ROUNDUP(bp) + UIO_DPM) % \
268+ (UIO_DPM * 2))
269+/* add offset to rounded-up cid to get a value which could be used with UIO */
270+#define UIO_DPM_ALIGN(bp) (UIO_ROUNDUP(bp) + UIO_CID_OFFSET(bp))
271+/* but wait - avoid UIO special case for cid 0 */
272+#define UIO_DPM_CID0_OFFSET(bp) ((UIO_DPM * 2) * \
273+ (UIO_DPM_ALIGN(bp) == UIO_DPM))
274+/* Properly DPM aligned CID dajusted to cid 0 secal case */
275+#define BNX2X_CNIC_START_ETH_CID(bp) (UIO_DPM_ALIGN(bp) + \
276+ (UIO_DPM_CID0_OFFSET(bp)))
277+/* how many cids were wasted - need this value for cid allocation */
278+#define UIO_CID_PAD(bp) (BNX2X_CNIC_START_ETH_CID(bp) - \
279+ BNX2X_1st_NON_L2_ETH_CID(bp))
251280 /* iSCSI L2 */
252281 #define BNX2X_ISCSI_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp))
253282 /* FCoE L2 */
@@ -1542,7 +1571,6 @@ struct bnx2x { · 1288 unmodified lines
15421571 */
15431572 bool fcoe_init;
15441573
1545− int pm_cap;
15461574 int mrrs;
15471575
15481576 struct delayed_work sp_task;
@@ -1681,10 +1709,11 @@ struct bnx2x { · 132 unmodified lines
16811709 * Maximum CID count that might be required by the bnx2x:
16821710 * Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI
16831711 */
1712+
16841713 #define BNX2X_L2_CID_COUNT(bp) (BNX2X_NUM_ETH_QUEUES(bp) * BNX2X_MULTI_TX_COS \
1685− + 2 * CNIC_SUPPORT(bp))
1714+ + CNIC_SUPPORT(bp) * (2 + UIO_CID_PAD(bp)))
16861715 #define BNX2X_L2_MAX_CID(bp) (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS \
1687− + 2 * CNIC_SUPPORT(bp))
1716+ + CNIC_SUPPORT(bp) * (2 + UIO_CID_PAD(bp)))
16881717 #define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\
16891718 ILT_PAGE_CIDS))
16901719
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+5−6
@@ -2481,8 +2481,7 @@ load_error_cnic2: · 2480 unmodified lines
24812481 load_error_cnic1:
24822482 bnx2x_napi_disable_cnic(bp);
24832483 /* Update the number of queues without the cnic queues */
2484− rc = bnx2x_set_real_num_queues(bp, 0);
2485− if (rc)
2484+ if (bnx2x_set_real_num_queues(bp, 0))
24862485 BNX2X_ERR("Unable to set real_num_queues not including cnic\n");
24872486 load_error_cnic0:
24882487 BNX2X_ERR("CNIC-related load failed\n");
@@ -3008,16 +3007,16 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state) · 519 unmodified lines
30083007 u16 pmcsr;
30093008
30103009 /* If there is no power capability, silently succeed */
3011− if (!bp->pm_cap) {
3010+ if (!bp->pdev->pm_cap) {
30123011 BNX2X_DEV_INFO("No power capability. Breaking.\n");
30133012 return 0;
30143013 }
30153014
3016− pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr);
3015+ pci_read_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL, &pmcsr);
30173016
30183017 switch (state) {
30193018 case PCI_D0:
3020− pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL,
3019+ pci_write_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL,
30213020 ((pmcsr & ~PCI_PM_CTRL_STATE_MASK) |
30223021 PCI_PM_CTRL_PME_STATUS));
30233022
@@ -3041,7 +3040,7 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state) · 17 unmodified lines
30413040 if (bp->wol)
30423041 pmcsr |= PCI_PM_CTRL_PME_ENABLE;
30433042
3044− pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL,
3043+ pci_write_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_CTRL,
30453044 pmcsr);
30463045
30473046 /* No more memory access after this point until
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+2−2
@@ -1387,9 +1387,9 @@ static bool bnx2x_is_nvm_accessible(struct bnx2x *bp) · 1386 unmodified lines
13871387 u16 pm = 0;
13881388 struct net_device *dev = pci_get_drvdata(bp->pdev);
13891389
1390− if (bp->pm_cap)
1390+ if (bp->pdev->pm_cap)
13911391 rc = pci_read_config_word(bp->pdev,
1392− bp->pm_cap + PCI_PM_CTRL, &pm);
1392+ bp->pdev->pm_cap + PCI_PM_CTRL, &pm);
13931393
13941394 if ((rc && !netif_running(dev)) ||
13951395 (!rc && ((pm & PCI_PM_CTRL_STATE_MASK) != (__force u16)PCI_D0)))
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+99−90
@@ -175,6 +175,7 @@ typedef int (*read_sfp_module_eeprom_func_p)(struct bnx2x_phy *phy, · 174 unmodified lines
175175 #define EDC_MODE_LINEAR 0x0022
176176 #define EDC_MODE_LIMITING 0x0044
177177 #define EDC_MODE_PASSIVE_DAC 0x0055
178+#define EDC_MODE_ACTIVE_DAC 0x0066
178179
179180 /* ETS defines*/
180181 #define DCBX_INVALID_COS (0xFF)
@@ -3684,6 +3685,41 @@ static void bnx2x_warpcore_enable_AN_KR2(struct bnx2x_phy *phy, · 3503 unmodified lines
36843685 bnx2x_update_link_attr(params, vars->link_attr_sync);
36853686 }
36863687
3688+static void bnx2x_disable_kr2(struct link_params *params,
3689+ struct link_vars *vars,
3690+ struct bnx2x_phy *phy)
3691+{
3692+ struct bnx2x *bp = params->bp;
3693+ int i;
3694+ static struct bnx2x_reg_set reg_set[] = {
3695+ /* Step 1 - Program the TX/RX alignment markers */
3696+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL5, 0x7690},
3697+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL7, 0xe647},
3698+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL6, 0xc4f0},
3699+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL9, 0x7690},
3700+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL11, 0xe647},
3701+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL10, 0xc4f0},
3702+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_USERB0_CTRL, 0x000c},
3703+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL1, 0x6000},
3704+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL3, 0x0000},
3705+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CODE_FIELD, 0x0002},
3706+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI1, 0x0000},
3707+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI2, 0x0af7},
3708+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI3, 0x0af7},
3709+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_BAM_CODE, 0x0002},
3710+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_UD_CODE, 0x0000}
3711+ };
3712+ DP(NETIF_MSG_LINK, "Disabling 20G-KR2\n");
3713+
3714+ for (i = 0; i < ARRAY_SIZE(reg_set); i++)
3715+ bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
3716+ reg_set[i].val);
3717+ vars->link_attr_sync &= ~LINK_ATTR_SYNC_KR2_ENABLE;
3718+ bnx2x_update_link_attr(params, vars->link_attr_sync);
3719+
3720+ vars->check_kr2_recovery_cnt = CHECK_KR2_RECOVERY_CNT;
3721+}
3722+
36873723 static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy,
36883724 struct link_params *params)
36893725 {
@@ -3715,7 +3751,6 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 25 unmodified lines
37153751 struct link_params *params,
37163752 struct link_vars *vars) {
37173753 u16 lane, i, cl72_ctrl, an_adv = 0;
3718− u16 ucode_ver;
37193754 struct bnx2x *bp = params->bp;
37203755 static struct bnx2x_reg_set reg_set[] = {
37213756 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7},
@@ -3806,15 +3841,7 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 84 unmodified lines
38063841
38073842 /* Advertise pause */
38083843 bnx2x_ext_phy_set_pause(params, phy, vars);
3809− /* Set KR Autoneg Work-Around flag for Warpcore version older than D108
3810− */
3811− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3812− MDIO_WC_REG_UC_INFO_B1_VERSION, &ucode_ver);
3813− if (ucode_ver < 0xd108) {
3814− DP(NETIF_MSG_LINK, "Enable AN KR work-around. WC ver:0x%x\n",
3815− ucode_ver);
3816− vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY;
3817− }
3844+ vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY;
38183845 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
38193846 MDIO_WC_REG_DIGITAL5_MISC7, 0x100);
38203847
@@ -3838,6 +3865,8 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 17 unmodified lines
38383865 bnx2x_set_aer_mmd(params, phy);
38393866
38403867 bnx2x_warpcore_enable_AN_KR2(phy, params, vars);
3868+ } else {
3869+ bnx2x_disable_kr2(params, vars, phy);
38413870 }
38423871
38433872 /* Enable Autoneg: only on the main lane */
@@ -4347,20 +4376,14 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy, · 503 unmodified lines
43474376 struct bnx2x *bp = params->bp;
43484377 u32 serdes_net_if;
43494378 u16 gp_status1 = 0, lnkup = 0, lnkup_kr = 0;
4350− u16 lane = bnx2x_get_warpcore_lane(phy, params);
43514379
43524380 vars->turn_to_run_wc_rt = vars->turn_to_run_wc_rt ? 0 : 1;
43534381
43544382 if (!vars->turn_to_run_wc_rt)
43554383 return;
43564384
4357− /* Return if there is no link partner */
4358− if (!(bnx2x_warpcore_get_sigdet(phy, params))) {
4359− DP(NETIF_MSG_LINK, "bnx2x_warpcore_get_sigdet false\n");
4360− return;
4361− }
4362−
43634385 if (vars->rx_tx_asic_rst) {
4386+ u16 lane = bnx2x_get_warpcore_lane(phy, params);
43644387 serdes_net_if = (REG_RD(bp, params->shmem_base +
43654388 offsetof(struct shmem_region, dev_info.
43664389 port_hw_config[params->port].default_cfg)) &
@@ -4375,14 +4398,8 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy, · 8 unmodified lines
43754398 /*10G KR*/
43764399 lnkup_kr = (gp_status1 >> (12+lane)) & 0x1;
43774400
4378− DP(NETIF_MSG_LINK,
4379− "gp_status1 0x%x\n", gp_status1);
4380−
43814401 if (lnkup_kr || lnkup) {
4382− vars->rx_tx_asic_rst = 0;
4383− DP(NETIF_MSG_LINK,
4384− "link up, rx_tx_asic_rst 0x%x\n",
4385− vars->rx_tx_asic_rst);
4402+ vars->rx_tx_asic_rst = 0;
43864403 } else {
43874404 /* Reset the lane to see if link comes up.*/
43884405 bnx2x_warpcore_reset_lane(bp, phy, 1);
@@ -4507,10 +4524,14 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, · 118 unmodified lines
45074524 * enabled transmitter to avoid current leakage in case
45084525 * no module is connected
45094526 */
4510− if (bnx2x_is_sfp_module_plugged(phy, params))
4511− bnx2x_sfp_module_detection(phy, params);
4512− else
4513− bnx2x_sfp_e3_set_transmitter(params, phy, 1);
4527+ if ((params->loopback_mode == LOOPBACK_NONE) ||
4528+ (params->loopback_mode == LOOPBACK_EXT)) {
4529+ if (bnx2x_is_sfp_module_plugged(phy, params))
4530+ bnx2x_sfp_module_detection(phy, params);
4531+ else
4532+ bnx2x_sfp_e3_set_transmitter(params,
4533+ phy, 1);
4534+ }
45144535
45154536 bnx2x_warpcore_config_sfi(phy, params);
45164537 break;
@@ -5757,6 +5778,11 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, · 1240 unmodified lines
57575778 rc = bnx2x_get_link_speed_duplex(phy, params, vars, link_up, gp_speed,
57585779 duplex);
57595780
5781+ /* In case of KR link down, start up the recovering procedure */
5782+ if ((!link_up) && (phy->media_type == ETH_PHY_KR) &&
5783+ (!(phy->flags & FLAGS_WC_DUAL_MODE)))
5784+ vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY;
5785+
57605786 DP(NETIF_MSG_LINK, "duplex %x flow_ctrl 0x%x link_status 0x%x\n",
57615787 vars->duplex, vars->flow_ctrl, vars->link_status);
57625788 return rc;
@@ -6507,6 +6533,11 @@ static int bnx2x_link_initialize(struct link_params *params, · 744 unmodified lines
65076533 params->phy[INT_PHY].config_init(phy, params, vars);
65086534 }
65096535
6536+ /* Re-read this value in case it was changed inside config_init due to
6537+ * limitations of optic module
6538+ */
6539+ vars->line_speed = params->phy[INT_PHY].req_line_speed;
6540+
65106541 /* Init external phy*/
65116542 if (non_ext_phy) {
65126543 if (params->phy[INT_PHY].supported &
@@ -8080,7 +8111,10 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 1567 unmodified lines
80808111 if (copper_module_type &
80818112 SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_ACTIVE) {
80828113 DP(NETIF_MSG_LINK, "Active Copper cable detected\n");
8083− check_limiting_mode = 1;
8114+ if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
8115+ *edc_mode = EDC_MODE_ACTIVE_DAC;
8116+ else
8117+ check_limiting_mode = 1;
80848118 } else if (copper_module_type &
80858119 SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) {
80868120 DP(NETIF_MSG_LINK,
@@ -8555,6 +8589,7 @@ static void bnx2x_warpcore_set_limiting_mode(struct link_params *params, · 468 unmodified lines
85558589 mode = MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE_DEFAULT;
85568590 break;
85578591 case EDC_MODE_PASSIVE_DAC:
8592+ case EDC_MODE_ACTIVE_DAC:
85588593 mode = MDIO_WC_REG_UC_INFO_B1_FIRMWARE_MODE_SFP_DAC;
85598594 break;
85608595 default:
@@ -9730,32 +9765,41 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, · 1169 unmodified lines
97309765 MDIO_AN_DEVAD, MDIO_AN_REG_8481_1000T_CTRL,
97319766 an_1000_val);
97329767
9733− /* set 100 speed advertisement */
9734− if ((phy->req_line_speed == SPEED_AUTO_NEG) &&
9735− (phy->speed_cap_mask &
9736− (PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL |
9737− PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF))) {
9738− an_10_100_val |= (1<<7);
9739− /* Enable autoneg and restart autoneg for legacy speeds */
9740− autoneg_val |= (1<<9 | 1<<12);
9741−
9742− if (phy->req_duplex == DUPLEX_FULL)
9768+ /* Set 10/100 speed advertisement */
9769+ if (phy->req_line_speed == SPEED_AUTO_NEG) {
9770+ if (phy->speed_cap_mask &
9771+ PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL) {
9772+ /* Enable autoneg and restart autoneg for legacy speeds
9773+ */
9774+ autoneg_val |= (1<<9 | 1<<12);
97439775 an_10_100_val |= (1<<8);
9744− DP(NETIF_MSG_LINK, "Advertising 100M\n");
9745− }
9746− /* set 10 speed advertisement */
9747− if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
9748− (phy->speed_cap_mask &
9749− (PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL |
9750− PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF)) &&
9751− (phy->supported &
9752− (SUPPORTED_10baseT_Half |
9753− SUPPORTED_10baseT_Full)))) {
9754− an_10_100_val |= (1<<5);
9755− autoneg_val |= (1<<9 | 1<<12);
9756− if (phy->req_duplex == DUPLEX_FULL)
9776+ DP(NETIF_MSG_LINK, "Advertising 100M-FD\n");
9777+ }
9778+
9779+ if (phy->speed_cap_mask &
9780+ PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF) {
9781+ /* Enable autoneg and restart autoneg for legacy speeds
9782+ */
9783+ autoneg_val |= (1<<9 | 1<<12);
9784+ an_10_100_val |= (1<<7);
9785+ DP(NETIF_MSG_LINK, "Advertising 100M-HD\n");
9786+ }
9787+
9788+ if ((phy->speed_cap_mask &
9789+ PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) &&
9790+ (phy->supported & SUPPORTED_10baseT_Full)) {
97579791 an_10_100_val |= (1<<6);
9758− DP(NETIF_MSG_LINK, "Advertising 10M\n");
9792+ autoneg_val |= (1<<9 | 1<<12);
9793+ DP(NETIF_MSG_LINK, "Advertising 10M-FD\n");
9794+ }
9795+
9796+ if ((phy->speed_cap_mask &
9797+ PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF) &&
9798+ (phy->supported & SUPPORTED_10baseT_Half)) {
9799+ an_10_100_val |= (1<<5);
9800+ autoneg_val |= (1<<9 | 1<<12);
9801+ DP(NETIF_MSG_LINK, "Advertising 10M-HD\n");
9802+ }
97599803 }
97609804
97619805 /* Only 10/100 are allowed to work in FORCE mode */
@@ -13432,43 +13476,6 @@ static void bnx2x_sfp_tx_fault_detection(struct bnx2x_phy *phy, · 3670 unmodified lines
1343213476 }
1343313477 }
1343413478 }
13435−static void bnx2x_disable_kr2(struct link_params *params,
13436− struct link_vars *vars,
13437− struct bnx2x_phy *phy)
13438−{
13439− struct bnx2x *bp = params->bp;
13440− int i;
13441− static struct bnx2x_reg_set reg_set[] = {
13442− /* Step 1 - Program the TX/RX alignment markers */
13443− {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL5, 0x7690},
13444− {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL7, 0xe647},
13445− {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL6, 0xc4f0},
13446− {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL9, 0x7690},
13447− {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL11, 0xe647},
13448− {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL10, 0xc4f0},
13449− {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_USERB0_CTRL, 0x000c},
13450− {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL1, 0x6000},
13451− {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL3, 0x0000},
13452− {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CODE_FIELD, 0x0002},
13453− {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI1, 0x0000},
13454− {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI2, 0x0af7},
13455− {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI3, 0x0af7},
13456− {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_BAM_CODE, 0x0002},
13457− {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_UD_CODE, 0x0000}
13458− };
13459− DP(NETIF_MSG_LINK, "Disabling 20G-KR2\n");
13460−
13461− for (i = 0; i < ARRAY_SIZE(reg_set); i++)
13462− bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
13463− reg_set[i].val);
13464− vars->link_attr_sync &= ~LINK_ATTR_SYNC_KR2_ENABLE;
13465− bnx2x_update_link_attr(params, vars->link_attr_sync);
13466−
13467− vars->check_kr2_recovery_cnt = CHECK_KR2_RECOVERY_CNT;
13468− /* Restart AN on leading lane */
13469− bnx2x_warpcore_restart_AN_KR(phy, params);
13470−}
13471−
1347213479 static void bnx2x_kr2_recovery(struct link_params *params,
1347313480 struct link_vars *vars,
1347413481 struct bnx2x_phy *phy)
@@ -13546,6 +13553,8 @@ static void bnx2x_check_kr2_wa(struct link_params *params, · 71 unmodified lines
1354613553 /* Disable KR2 on both lanes */
1354713554 DP(NETIF_MSG_LINK, "BP=0x%x, NP=0x%x\n", base_page, next_page);
1354813555 bnx2x_disable_kr2(params, vars, phy);
13556+ /* Restart AN on leading lane */
13557+ bnx2x_warpcore_restart_AN_KR(phy, params);
1354913558 return;
1355013559 }
1355113560 }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+24−14
@@ -4703,6 +4703,14 @@ bool bnx2x_chk_parity_attn(struct bnx2x *bp, bool *global, bool print) · 4702 unmodified lines
47034703 attn.sig[3] = REG_RD(bp,
47044704 MISC_REG_AEU_AFTER_INVERT_4_FUNC_0 +
47054705 port*4);
4706+ /* Since MCP attentions can't be disabled inside the block, we need to
4707+ * read AEU registers to see whether they're currently disabled
4708+ */
4709+ attn.sig[3] &= ((REG_RD(bp,
4710+ !port ? MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0
4711+ : MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0) &
4712+ MISC_AEU_ENABLE_MCP_PRTY_BITS) |
4713+ ~MISC_AEU_ENABLE_MCP_PRTY_BITS);
47064714
47074715 if (!CHIP_IS_E1x(bp))
47084716 attn.sig[4] = REG_RD(bp,
@@ -5447,26 +5455,24 @@ static void bnx2x_timer(unsigned long data) · 738 unmodified lines
54475455 if (IS_PF(bp) &&
54485456 !BP_NOMCP(bp)) {
54495457 int mb_idx = BP_FW_MB_IDX(bp);
5450− u32 drv_pulse;
5451− u32 mcp_pulse;
5458+ u16 drv_pulse;
5459+ u16 mcp_pulse;
54525460
54535461 ++bp->fw_drv_pulse_wr_seq;
54545462 bp->fw_drv_pulse_wr_seq &= DRV_PULSE_SEQ_MASK;
5455− /* TBD - add SYSTEM_TIME */
54565463 drv_pulse = bp->fw_drv_pulse_wr_seq;
54575464 bnx2x_drv_pulse(bp);
54585465
54595466 mcp_pulse = (SHMEM_RD(bp, func_mb[mb_idx].mcp_pulse_mb) &
54605467 MCP_PULSE_SEQ_MASK);
54615468 /* The delta between driver pulse and mcp response
5462− * should be 1 (before mcp response) or 0 (after mcp response)
5469+ * should not get too big. If the MFW is more than 5 pulses
5470+ * behind, we should worry about it enough to generate an error
5471+ * log.
54635472 */
5464− if ((drv_pulse != mcp_pulse) &&
5465− (drv_pulse != ((mcp_pulse + 1) & MCP_PULSE_SEQ_MASK))) {
5466− /* someone lost a heartbeat... */
5467− BNX2X_ERR("drv_pulse (0x%x) != mcp_pulse (0x%x)\n",
5473+ if (((drv_pulse - mcp_pulse) & MCP_PULSE_SEQ_MASK) > 5)
5474+ BNX2X_ERR("MFW seems hanged: drv_pulse (0x%x) != mcp_pulse (0x%x)\n",
54685475 drv_pulse, mcp_pulse);
5469− }
54705476 }
54715477
54725478 if (bp->state == BNX2X_STATE_OPEN)
@@ -8652,6 +8658,7 @@ u32 bnx2x_send_unload_req(struct bnx2x *bp, int unload_mode) · 3179 unmodified lines
86528658 else if (bp->wol) {
86538659 u32 emac_base = port ? GRCBASE_EMAC1 : GRCBASE_EMAC0;
86548660 u8 *mac_addr = bp->dev->dev_addr;
8661+ struct pci_dev *pdev = bp->pdev;
86558662 u32 val;
86568663 u16 pmc;
86578664
@@ -8668,9 +8675,9 @@ u32 bnx2x_send_unload_req(struct bnx2x *bp, int unload_mode) · 10 unmodified lines
86688675 EMAC_WR(bp, EMAC_REG_EMAC_MAC_MATCH + entry + 4, val);
86698676
86708677 /* Enable the PME and clear the status */
8671− pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmc);
8678+ pci_read_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, &pmc);
86728679 pmc |= PCI_PM_CTRL_PME_ENABLE | PCI_PM_CTRL_PME_STATUS;
8673− pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, pmc);
8680+ pci_write_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, pmc);
86748681
86758682 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_EN;
86768683
@@ -10399,7 +10406,7 @@ static void bnx2x_get_common_hwinfo(struct bnx2x *bp) · 1722 unmodified lines
1039910406 break;
1040010407 }
1040110408
10402− pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_PMC, &pmc);
10409+ pci_read_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_PMC, &pmc);
1040310410 bp->flags |= (pmc & PCI_PM_CAP_PME_D3cold) ? 0 : NO_WOL_FLAG;
1040410411
1040510412 BNX2X_DEV_INFO("%sWoL capable\n",
@@ -12141,8 +12148,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, · 1735 unmodified lines
1214112148 }
1214212149
1214312150 if (IS_PF(bp)) {
12144− bp->pm_cap = pdev->pm_cap;
12145− if (bp->pm_cap == 0) {
12151+ if (!pdev->pm_cap) {
1214612152 dev_err(&bp->pdev->dev,
1214712153 "Cannot find power management capability, aborting\n");
1214812154 rc = -EIO;
@@ -13632,6 +13638,10 @@ void bnx2x_setup_cnic_info(struct bnx2x *bp) · 1483 unmodified lines
1363213638 cp->fcoe_init_cid = BNX2X_FCOE_ETH_CID(bp);
1363313639 cp->iscsi_l2_cid = BNX2X_ISCSI_ETH_CID(bp);
1363413640
13641+ DP(NETIF_MSG_IFUP, "BNX2X_1st_NON_L2_ETH_CID(bp) %x, cp->starting_cid %x, cp->fcoe_init_cid %x, cp->iscsi_l2_cid %x\n",
13642+ BNX2X_1st_NON_L2_ETH_CID(bp), cp->starting_cid, cp->fcoe_init_cid,
13643+ cp->iscsi_l2_cid);
13644+
1363513645 if (NO_ISCSI_OOO(bp))
1363613646 cp->drv_state |= CNIC_DRV_STATE_NO_ISCSI_OOO;
1363713647 }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c+4−1
@@ -1819,7 +1819,7 @@ bnx2x_get_vf_igu_cam_info(struct bnx2x *bp) · 1818 unmodified lines
18191819 fid = GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID);
18201820 if (fid & IGU_FID_ENCODE_IS_PF)
18211821 current_pf = fid & IGU_FID_PF_NUM_MASK;
1822− else if (current_pf == BP_ABS_FUNC(bp))
1822+ else if (current_pf == BP_FUNC(bp))
18231823 bnx2x_vf_set_igu_info(bp, sb_id,
18241824 (fid & IGU_FID_VF_NUM_MASK));
18251825 DP(BNX2X_MSG_IOV, "%s[%d], igu_sb_id=%d, msix=%d\n",
@@ -3180,6 +3180,7 @@ int bnx2x_enable_sriov(struct bnx2x *bp) · 1354 unmodified lines
31803180 /* set local queue arrays */
31813181 vf->vfqs = &bp->vfdb->vfqs[qcount];
31823182 qcount += vf_sb_count(vf);
3183+ bnx2x_iov_static_resc(bp, vf);
31833184 }
31843185
31853186 /* prepare msix vectors in VF configuration space */
@@ -3187,6 +3188,8 @@ int bnx2x_enable_sriov(struct bnx2x *bp) · 1 unmodified line
31873188 bnx2x_pretend_func(bp, HW_VF_HANDLE(bp, vf_idx));
31883189 REG_WR(bp, PCICFG_OFFSET + GRC_CONFIG_REG_VF_MSIX_CONTROL,
31893190 num_vf_queues);
3191+ DP(BNX2X_MSG_IOV, "set msix vec num in VF %d cfg space to %d\n",
3192+ vf_idx, num_vf_queues);
31903193 }
31913194 bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
31923195
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c+24−26
@@ -1765,28 +1765,28 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, · 1764 unmodified lines
17651765 switch (mbx->first_tlv.tl.type) {
17661766 case CHANNEL_TLV_ACQUIRE:
17671767 bnx2x_vf_mbx_acquire(bp, vf, mbx);
1768− break;
1768+ return;
17691769 case CHANNEL_TLV_INIT:
17701770 bnx2x_vf_mbx_init_vf(bp, vf, mbx);
1771− break;
1771+ return;
17721772 case CHANNEL_TLV_SETUP_Q:
17731773 bnx2x_vf_mbx_setup_q(bp, vf, mbx);
1774− break;
1774+ return;
17751775 case CHANNEL_TLV_SET_Q_FILTERS:
17761776 bnx2x_vf_mbx_set_q_filters(bp, vf, mbx);
1777− break;
1777+ return;
17781778 case CHANNEL_TLV_TEARDOWN_Q:
17791779 bnx2x_vf_mbx_teardown_q(bp, vf, mbx);
1780− break;
1780+ return;
17811781 case CHANNEL_TLV_CLOSE:
17821782 bnx2x_vf_mbx_close_vf(bp, vf, mbx);
1783− break;
1783+ return;
17841784 case CHANNEL_TLV_RELEASE:
17851785 bnx2x_vf_mbx_release_vf(bp, vf, mbx);
1786− break;
1786+ return;
17871787 case CHANNEL_TLV_UPDATE_RSS:
17881788 bnx2x_vf_mbx_update_rss(bp, vf, mbx);
1789− break;
1789+ return;
17901790 }
17911791
17921792 } else {
@@ -1802,26 +1802,24 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, · 9 unmodified lines
18021802 for (i = 0; i < 20; i++)
18031803 DP_CONT(BNX2X_MSG_IOV, "%x ",
18041804 mbx->msg->req.tlv_buf_size.tlv_buffer[i]);
1805+ }
18051806
1806− /* test whether we can respond to the VF (do we have an address
1807− * for it?)
1808− */
1809− if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) {
1810− /* mbx_resp uses the op_rc of the VF */
1811− vf->op_rc = PFVF_STATUS_NOT_SUPPORTED;
1807+ /* can we respond to VF (do we have an address for it?) */
1808+ if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) {
1809+ /* mbx_resp uses the op_rc of the VF */
1810+ vf->op_rc = PFVF_STATUS_NOT_SUPPORTED;
18121811
1813− /* notify the VF that we do not support this request */
1814− bnx2x_vf_mbx_resp(bp, vf);
1815− } else {
1816− /* can't send a response since this VF is unknown to us
1817− * just ack the FW to release the mailbox and unlock
1818− * the channel.
1819− */
1820− storm_memset_vf_mbx_ack(bp, vf->abs_vfid);
1821− mmiowb();
1822− bnx2x_unlock_vf_pf_channel(bp, vf,
1823− mbx->first_tlv.tl.type);
1824− }
1812+ /* notify the VF that we do not support this request */
1813+ bnx2x_vf_mbx_resp(bp, vf);
1814+ } else {
1815+ /* can't send a response since this VF is unknown to us
1816+ * just ack the FW to release the mailbox and unlock
1817+ * the channel.
1818+ */
1819+ storm_memset_vf_mbx_ack(bp, vf->abs_vfid);
1820+ /* Firmware ack should be written before unlocking channel */
1821+ mmiowb();
1822+ bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type);
18251823 }
18261824 }
18271825
drivers/net/ethernet/broadcom/cnic.c+4−2
@@ -3135,6 +3135,7 @@ static void cnic_service_bnx2x_bh(unsigned long data) · 3134 unmodified lines
31353135 {
31363136 struct cnic_dev *dev = (struct cnic_dev *) data;
31373137 struct cnic_local *cp = dev->cnic_priv;
3138+ struct bnx2x *bp = netdev_priv(dev->netdev);
31383139 u32 status_idx, new_status_idx;
31393140
31403141 if (unlikely(!test_bit(CNIC_F_CNIC_UP, &dev->flags)))
@@ -3146,7 +3147,7 @@ static void cnic_service_bnx2x_bh(unsigned long data) · 5 unmodified lines
31463147 CNIC_WR16(dev, cp->kcq1.io_addr,
31473148 cp->kcq1.sw_prod_idx + MAX_KCQ_IDX);
31483149
3149− if (cp->ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE) {
3150+ if (!CNIC_SUPPORTS_FCOE(bp)) {
31503151 cp->arm_int(dev, status_idx);
31513152 break;
31523153 }
@@ -5217,7 +5218,8 @@ static void cnic_init_rings(struct cnic_dev *dev) · 2064 unmodified lines
52175218 "iSCSI CLIENT_SETUP did not complete\n");
52185219 cnic_spq_completion(dev, DRV_CTL_RET_L2_SPQ_CREDIT_CMD, 1);
52195220 cnic_ring_ctl(dev, cid, cli, 1);
5220− *cid_ptr = cid;
5221+ *cid_ptr = cid >> 4;
5222+ *(cid_ptr + 1) = cid * bp->db_size;
52215223 }
52225224 }
52235225
drivers/net/ethernet/broadcom/tg3.c+3−3
@@ -3034,6 +3034,7 @@ static bool tg3_phy_led_bug(struct tg3 *tp) · 3033 unmodified lines
30343034 {
30353035 switch (tg3_asic_rev(tp)) {
30363036 case ASIC_REV_5719:
3037+ case ASIC_REV_5720:
30373038 if ((tp->phy_flags & TG3_PHYFLG_MII_SERDES) &&
30383039 !tp->pci_fn)
30393040 return true;
@@ -16192,12 +16193,12 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) · 13152 unmodified lines
1619216193 * So explicitly force the chip into D0 here.
1619316194 */
1619416195 pci_read_config_dword(tp->pdev,
16195− tp->pm_cap + PCI_PM_CTRL,
16196+ tp->pdev->pm_cap + PCI_PM_CTRL,
1619616197 &pm_reg);
1619716198 pm_reg &= ~PCI_PM_CTRL_STATE_MASK;
1619816199 pm_reg |= PCI_PM_CTRL_PME_ENABLE | 0 /* D0 */;
1619916200 pci_write_config_dword(tp->pdev,
16200− tp->pm_cap + PCI_PM_CTRL,
16201+ tp->pdev->pm_cap + PCI_PM_CTRL,
1620116202 pm_reg);
1620216203
1620316204 /* Also, force SERR#/PERR# in PCI command. */
@@ -17346,7 +17347,6 @@ static int tg3_init_one(struct pci_dev *pdev, · 1142 unmodified lines
1734617347 tp = netdev_priv(dev);
1734717348 tp->pdev = pdev;
1734817349 tp->dev = dev;
17349− tp->pm_cap = pdev->pm_cap;
1735017350 tp->rx_mode = TG3_DEF_RX_MODE;
1735117351 tp->tx_mode = TG3_DEF_TX_MODE;
1735217352 tp->irq_sync = 1;
drivers/net/ethernet/broadcom/tg3.h+0−1
@@ -3234,7 +3234,6 @@ struct tg3 { · 3233 unmodified lines
32343234 u8 pci_lat_timer;
32353235
32363236 int pci_fn;
3237− int pm_cap;
32383237 int msi_cap;
32393238 int pcix_cap;
32403239 int pcie_readrq;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+3−1
@@ -6149,8 +6149,10 @@ static int __init cxgb4_init_module(void) · 6148 unmodified lines
61496149 pr_warn("could not create debugfs entry, continuing\n");
61506150
61516151 ret = pci_register_driver(&cxgb4_driver);
6152− if (ret < 0)
6152+ if (ret < 0) {
61536153 debugfs_remove(cxgb4_debugfs_root);
6154+ destroy_workqueue(workq);
6155+ }
61546156
61556157 register_inet6addr_notifier(&cxgb4_inet6addr_notifier);
61566158
drivers/net/ethernet/dec/tulip/de4x5.c+1−1
@@ -1321,7 +1321,7 @@ de4x5_open(struct net_device *dev) · 1320 unmodified lines
13211321 if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED,
13221322 lp->adapter_name, dev)) {
13231323 printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq);
1324− if (request_irq(dev->irq, de4x5_interrupt, IRQF_DISABLED | IRQF_SHARED,
1324+ if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED,
13251325 lp->adapter_name, dev)) {
13261326 printk("\n Cannot get IRQ- reconfigure your hardware.\n");
13271327 disable_ast(dev);
drivers/net/ethernet/emulex/benet/be.h+2−0
@@ -88,6 +88,7 @@ static inline char *nic_name(struct pci_dev *pdev) · 87 unmodified lines
8888 #define BE_MIN_MTU 256
8989
9090 #define BE_NUM_VLANS_SUPPORTED 64
91+#define BE_UMC_NUM_VLANS_SUPPORTED 15
9192 #define BE_MAX_EQD 96u
9293 #define BE_MAX_TX_FRAG_COUNT 30
9394
@@ -333,6 +334,7 @@ enum vf_state { · 239 unmodified lines
333334
334335 #define BE_FLAGS_LINK_STATUS_INIT 1
335336 #define BE_FLAGS_WORKER_SCHEDULED (1 << 3)
337+#define BE_FLAGS_VLAN_PROMISC (1 << 4)
336338 #define BE_FLAGS_NAPI_ENABLED (1 << 9)
337339 #define BE_UC_PMAC_COUNT 30
338340 #define BE_VF_UC_PMAC_COUNT 2
drivers/net/ethernet/emulex/benet/be_cmds.c+9−0
@@ -180,6 +180,9 @@ static int be_mcc_compl_process(struct be_adapter *adapter, · 179 unmodified lines
180180 dev_err(&adapter->pdev->dev,
181181 "opcode %d-%d failed:status %d-%d\n",
182182 opcode, subsystem, compl_status, extd_status);
183+
184+ if (extd_status == MCC_ADDL_STS_INSUFFICIENT_RESOURCES)
185+ return extd_status;
183186 }
184187 }
185188 done:
@@ -1812,6 +1815,12 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value) · 1626 unmodified lines
18121815 } else if (flags & IFF_ALLMULTI) {
18131816 req->if_flags_mask = req->if_flags =
18141817 cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS);
1818+ } else if (flags & BE_FLAGS_VLAN_PROMISC) {
1819+ req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_VLAN_PROMISCUOUS);
1820+
1821+ if (value == ON)
1822+ req->if_flags =
1823+ cpu_to_le32(BE_IF_FLAGS_VLAN_PROMISCUOUS);
18151824 } else {
18161825 struct netdev_hw_addr *ha;
18171826 int i = 0;
drivers/net/ethernet/emulex/benet/be_cmds.h+3−1
@@ -60,6 +60,8 @@ enum { · 59 unmodified lines
6060 MCC_STATUS_NOT_SUPPORTED = 66
6161 };
6262
63+#define MCC_ADDL_STS_INSUFFICIENT_RESOURCES 0x16
64+
6365 #define CQE_STATUS_COMPL_MASK 0xFFFF
6466 #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
6567 #define CQE_STATUS_EXTD_MASK 0xFFFF
@@ -1791,7 +1793,7 @@ struct be_nic_res_desc { · 1725 unmodified lines
17911793 u8 acpi_params;
17921794 u8 wol_param;
17931795 u16 rsvd7;
1794− u32 rsvd8[3];
1796+ u32 rsvd8[7];
17951797 } __packed;
17961798
17971799 struct be_cmd_req_get_func_config {
drivers/net/ethernet/emulex/benet/be_main.c+47−31
@@ -855,11 +855,11 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter, · 854 unmodified lines
855855 unsigned int eth_hdr_len;
856856 struct iphdr *ip;
857857
858− /* Lancer ASIC has a bug wherein packets that are 32 bytes or less
858+ /* Lancer, SH-R ASICs have a bug wherein Packets that are 32 bytes or less
859859 * may cause a transmit stall on that port. So the work-around is to
860− * pad such packets to a 36-byte length.
860+ * pad short packets (<= 32 bytes) to a 36-byte length.
861861 */
862− if (unlikely(lancer_chip(adapter) && skb->len <= 32)) {
862+ if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {
863863 if (skb_padto(skb, 36))
864864 goto tx_drop;
865865 skb->len = 36;
@@ -1013,18 +1013,40 @@ static int be_vid_config(struct be_adapter *adapter) · 147 unmodified lines
10131013 status = be_cmd_vlan_config(adapter, adapter->if_handle,
10141014 vids, num, 1, 0);
10151015
1016− /* Set to VLAN promisc mode as setting VLAN filter failed */
10171016 if (status) {
1018− dev_info(&adapter->pdev->dev, "Exhausted VLAN HW filters.\n");
1019− dev_info(&adapter->pdev->dev, "Disabling HW VLAN filtering.\n");
1020− goto set_vlan_promisc;
1017+ /* Set to VLAN promisc mode as setting VLAN filter failed */
1018+ if (status == MCC_ADDL_STS_INSUFFICIENT_RESOURCES)
1019+ goto set_vlan_promisc;
1020+ dev_err(&adapter->pdev->dev,
1021+ "Setting HW VLAN filtering failed.\n");
1022+ } else {
1023+ if (adapter->flags & BE_FLAGS_VLAN_PROMISC) {
1024+ /* hw VLAN filtering re-enabled. */
1025+ status = be_cmd_rx_filter(adapter,
1026+ BE_FLAGS_VLAN_PROMISC, OFF);
1027+ if (!status) {
1028+ dev_info(&adapter->pdev->dev,
1029+ "Disabling VLAN Promiscuous mode.\n");
1030+ adapter->flags &= ~BE_FLAGS_VLAN_PROMISC;
1031+ dev_info(&adapter->pdev->dev,
1032+ "Re-Enabling HW VLAN filtering\n");
1033+ }
1034+ }
10211035 }
10221036
10231037 return status;
10241038
10251039 set_vlan_promisc:
1026− status = be_cmd_vlan_config(adapter, adapter->if_handle,
1027− NULL, 0, 1, 1);
1040+ dev_warn(&adapter->pdev->dev, "Exhausted VLAN HW filters.\n");
1041+
1042+ status = be_cmd_rx_filter(adapter, BE_FLAGS_VLAN_PROMISC, ON);
1043+ if (!status) {
1044+ dev_info(&adapter->pdev->dev, "Enable VLAN Promiscuous mode\n");
1045+ dev_info(&adapter->pdev->dev, "Disabling HW VLAN filtering\n");
1046+ adapter->flags |= BE_FLAGS_VLAN_PROMISC;
1047+ } else
1048+ dev_err(&adapter->pdev->dev,
1049+ "Failed to enable VLAN Promiscuous mode.\n");
10281050 return status;
10291051 }
10301052
@@ -1033,10 +1055,6 @@ static int be_vlan_add_vid(struct net_device *netdev, __be16 proto, u16 vid) · 2 unmodified lines
10331055 struct be_adapter *adapter = netdev_priv(netdev);
10341056 int status = 0;
10351057
1036− if (!lancer_chip(adapter) && !be_physfn(adapter)) {
1037− status = -EINVAL;
1038− goto ret;
1039− }
10401058
10411059 /* Packets with VID 0 are always received by Lancer by default */
10421060 if (lancer_chip(adapter) && vid == 0)
@@ -1059,11 +1077,6 @@ static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid) · 16 unmodified lines
10591077 struct be_adapter *adapter = netdev_priv(netdev);
10601078 int status = 0;
10611079
1062− if (!lancer_chip(adapter) && !be_physfn(adapter)) {
1063− status = -EINVAL;
1064− goto ret;
1065− }
1066−
10671080 /* Packets with VID 0 are always received by Lancer by default */
10681081 if (lancer_chip(adapter) && vid == 0)
10691082 goto ret;
@@ -1188,8 +1201,8 @@ static int be_get_vf_config(struct net_device *netdev, int vf, · 118 unmodified lines
11881201
11891202 vi->vf = vf;
11901203 vi->tx_rate = vf_cfg->tx_rate;
1191− vi->vlan = vf_cfg->vlan_tag;
1192− vi->qos = 0;
1204+ vi->vlan = vf_cfg->vlan_tag & VLAN_VID_MASK;
1205+ vi->qos = vf_cfg->vlan_tag >> VLAN_PRIO_SHIFT;
11931206 memcpy(&vi->mac, vf_cfg->mac_addr, ETH_ALEN);
11941207
11951208 return 0;
@@ -1199,28 +1212,29 @@ static int be_set_vf_vlan(struct net_device *netdev, · 3 unmodified lines
11991212 int vf, u16 vlan, u8 qos)
12001213 {
12011214 struct be_adapter *adapter = netdev_priv(netdev);
1215+ struct be_vf_cfg *vf_cfg = &adapter->vf_cfg[vf];
12021216 int status = 0;
12031217
12041218 if (!sriov_enabled(adapter))
12051219 return -EPERM;
12061220
1207− if (vf >= adapter->num_vfs || vlan > 4095)
1221+ if (vf >= adapter->num_vfs || vlan > 4095 || qos > 7)
12081222 return -EINVAL;
12091223
1210− if (vlan) {
1211− if (adapter->vf_cfg[vf].vlan_tag != vlan) {
1224+ if (vlan || qos) {
1225+ vlan |= qos << VLAN_PRIO_SHIFT;
1226+ if (vf_cfg->vlan_tag != vlan) {
12121227 /* If this is new value, program it. Else skip. */
1213− adapter->vf_cfg[vf].vlan_tag = vlan;
1214−
1215− status = be_cmd_set_hsw_config(adapter, vlan,
1216− vf + 1, adapter->vf_cfg[vf].if_handle, 0);
1228+ vf_cfg->vlan_tag = vlan;
1229+ status = be_cmd_set_hsw_config(adapter, vlan, vf + 1,
1230+ vf_cfg->if_handle, 0);
12171231 }
12181232 } else {
12191233 /* Reset Transparent Vlan Tagging. */
1220− adapter->vf_cfg[vf].vlan_tag = 0;
1221− vlan = adapter->vf_cfg[vf].def_vid;
1234+ vf_cfg->vlan_tag = 0;
1235+ vlan = vf_cfg->def_vid;
12221236 status = be_cmd_set_hsw_config(adapter, vlan, vf + 1,
1223− adapter->vf_cfg[vf].if_handle, 0);
1237+ vf_cfg->if_handle, 0);
12241238 }
12251239
12261240
@@ -2802,7 +2816,7 @@ static int be_vfs_if_create(struct be_adapter *adapter) · 1575 unmodified lines
28022816 struct be_resources res = {0};
28032817 struct be_vf_cfg *vf_cfg;
28042818 u32 cap_flags, en_flags, vf;
2805− int status;
2819+ int status = 0;
28062820
28072821 cap_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST |
28082822 BE_IF_FLAGS_MULTICAST;
@@ -2963,6 +2977,8 @@ static void BEx_get_resources(struct be_adapter *adapter, · 154 unmodified lines
29632977
29642978 if (adapter->function_mode & FLEX10_MODE)
29652979 res->max_vlans = BE_NUM_VLANS_SUPPORTED/8;
2980+ else if (adapter->function_mode & UMC_ENABLED)
2981+ res->max_vlans = BE_UMC_NUM_VLANS_SUPPORTED;
29662982 else
29672983 res->max_vlans = BE_NUM_VLANS_SUPPORTED;
29682984 res->max_mcast_mac = BE_MAX_MC;
drivers/net/ethernet/freescale/fec_main.c+1−1
@@ -2199,7 +2199,7 @@ fec_probe(struct platform_device *pdev) · 2198 unmodified lines
21992199 goto failed_irq;
22002200 }
22012201 ret = devm_request_irq(&pdev->dev, irq, fec_enet_interrupt,
2202− IRQF_DISABLED, pdev->name, ndev);
2202+ 0, pdev->name, ndev);
22032203 if (ret)
22042204 goto failed_irq;
22052205 }
drivers/net/ethernet/freescale/gianfar_ptp.c+3−1
@@ -452,7 +452,9 @@ static int gianfar_ptp_probe(struct platform_device *dev) · 451 unmodified lines
452452 err = -ENODEV;
453453
454454 etsects->caps = ptp_gianfar_caps;
455− etsects->cksel = DEFAULT_CKSEL;
455+
456+ if (get_of_u32(node, "fsl,cksel", &etsects->cksel))
457+ etsects->cksel = DEFAULT_CKSEL;
456458
457459 if (get_of_u32(node, "fsl,tclk-period", &etsects->tclk_period) ||
458460 get_of_u32(node, "fsl,tmr-prsc", &etsects->tmr_prsc) ||
drivers/net/ethernet/hp/hp100.c+1−1
@@ -1097,7 +1097,7 @@ static int hp100_open(struct net_device *dev) · 1096 unmodified lines
10971097 /* New: if bus is PCI or EISA, interrupts might be shared interrupts */
10981098 if (request_irq(dev->irq, hp100_interrupt,
10991099 lp->bus == HP100_BUS_PCI || lp->bus ==
1100− HP100_BUS_EISA ? IRQF_SHARED : IRQF_DISABLED,
1100+ HP100_BUS_EISA ? IRQF_SHARED : 0,
11011101 "hp100", dev)) {
11021102 printk("hp100: %s: unable to get IRQ %d\n", dev->name, dev->irq);
11031103 return -EAGAIN;
drivers/net/ethernet/ibm/ehea/ehea_main.c+16−5
@@ -102,6 +102,19 @@ static int ehea_probe_adapter(struct platform_device *dev); · 101 unmodified lines
102102
103103 static int ehea_remove(struct platform_device *dev);
104104
105+static struct of_device_id ehea_module_device_table[] = {
106+ {
107+ .name = "lhea",
108+ .compatible = "IBM,lhea",
109+ },
110+ {
111+ .type = "network",
112+ .compatible = "IBM,lhea-ethernet",
113+ },
114+ {},
115+};
116+MODULE_DEVICE_TABLE(of, ehea_module_device_table);
117+
105118 static struct of_device_id ehea_device_table[] = {
106119 {
107120 .name = "lhea",
@@ -109,7 +122,6 @@ static struct of_device_id ehea_device_table[] = { · 1 unmodified line
109122 },
110123 {},
111124 };
112−MODULE_DEVICE_TABLE(of, ehea_device_table);
113125
114126 static struct platform_driver ehea_driver = {
115127 .driver = {
@@ -1285,7 +1297,7 @@ static int ehea_reg_interrupts(struct net_device *dev) · 1169 unmodified lines
12851297
12861298 ret = ibmebus_request_irq(port->qp_eq->attr.ist1,
12871299 ehea_qp_aff_irq_handler,
1288− IRQF_DISABLED, port->int_aff_name, port);
1300+ 0, port->int_aff_name, port);
12891301 if (ret) {
12901302 netdev_err(dev, "failed registering irq for qp_aff_irq_handler:ist=%X\n",
12911303 port->qp_eq->attr.ist1);
@@ -1303,8 +1315,7 @@ static int ehea_reg_interrupts(struct net_device *dev) · 11 unmodified lines
13031315 "%s-queue%d", dev->name, i);
13041316 ret = ibmebus_request_irq(pr->eq->attr.ist1,
13051317 ehea_recv_irq_handler,
1306− IRQF_DISABLED, pr->int_send_name,
1307− pr);
1318+ 0, pr->int_send_name, pr);
13081319 if (ret) {
13091320 netdev_err(dev, "failed registering irq for ehea_queue port_res_nr:%d, ist=%X\n",
13101321 i, pr->eq->attr.ist1);
@@ -3320,7 +3331,7 @@ static int ehea_probe_adapter(struct platform_device *dev) · 2009 unmodified lines
33203331 }
33213332
33223333 ret = ibmebus_request_irq(adapter->neq->attr.ist1,
3323− ehea_interrupt_neq, IRQF_DISABLED,
3334+ ehea_interrupt_neq, 0,
33243335 "ehea_neq", adapter);
33253336 if (ret) {
33263337 dev_err(&dev->dev, "requesting NEQ IRQ failed\n");
drivers/net/ethernet/intel/e1000e/ethtool.c+8−0
@@ -922,6 +922,14 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) · 921 unmodified lines
922922 else
923923 mask &= ~(1 << 30);
924924 }
925+ if (mac->type == e1000_pch2lan) {
926+ /* SHRAH[0,1,2] different than previous */
927+ if (i == 7)
928+ mask &= 0xFFF4FFFF;
929+ /* SHRAH[3] different than SHRAH[0,1,2] */
930+ if (i == 10)
931+ mask |= (1 << 30);
932+ }
925933
926934 REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask,
927935 0xFFFFFFFF);
drivers/net/ethernet/intel/e1000e/ich8lan.c+8−5
@@ -1371,7 +1371,10 @@ static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index) · 1370 unmodified lines
13711371 return;
13721372 }
13731373
1374− if (index < hw->mac.rar_entry_count) {
1374+ /* RAR[1-6] are owned by manageability. Skip those and program the
1375+ * next address into the SHRA register array.
1376+ */
1377+ if (index < (u32)(hw->mac.rar_entry_count - 6)) {
13751378 s32 ret_val;
13761379
13771380 ret_val = e1000_acquire_swflag_ich8lan(hw);
@@ -1962,8 +1965,8 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw) · 584 unmodified lines
19621965 if (ret_val)
19631966 goto release;
19641967
1965− /* Copy both RAL/H (rar_entry_count) and SHRAL/H (+4) to PHY */
1966− for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) {
1968+ /* Copy both RAL/H (rar_entry_count) and SHRAL/H to PHY */
1969+ for (i = 0; i < (hw->mac.rar_entry_count); i++) {
19671970 mac_reg = er32(RAL(i));
19681971 hw->phy.ops.write_reg_page(hw, BM_RAR_L(i),
19691972 (u16)(mac_reg & 0xFFFF));
@@ -2007,10 +2010,10 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) · 37 unmodified lines
20072010 return ret_val;
20082011
20092012 if (enable) {
2010− /* Write Rx addresses (rar_entry_count for RAL/H, +4 for
2013+ /* Write Rx addresses (rar_entry_count for RAL/H, and
20112014 * SHRAL/H) and initial CRC values to the MAC
20122015 */
2013− for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) {
2016+ for (i = 0; i < hw->mac.rar_entry_count; i++) {
20142017 u8 mac_addr[ETH_ALEN] = { 0 };
20152018 u32 addr_high, addr_low;
20162019
drivers/net/ethernet/intel/e1000e/ich8lan.h+1−1
@@ -98,7 +98,7 @@ · 97 unmodified lines
9898 #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL
9999
100100 #define E1000_ICH_RAR_ENTRIES 7
101−#define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */
101+#define E1000_PCH2_RAR_ENTRIES 11 /* RAR[0-6], SHRA[0-3] */
102102 #define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */
103103
104104 #define PHY_PAGE_SHIFT 5
drivers/net/ethernet/intel/e1000e/netdev.c+1−1
@@ -4868,7 +4868,7 @@ static void e1000_watchdog_task(struct work_struct *work) · 4867 unmodified lines
48684868 */
48694869 if ((hw->phy.type == e1000_phy_igp_3 ||
48704870 hw->phy.type == e1000_phy_bm) &&
4871− (hw->mac.autoneg == true) &&
4871+ hw->mac.autoneg &&
48724872 (adapter->link_speed == SPEED_10 ||
48734873 adapter->link_speed == SPEED_100) &&
48744874 (adapter->link_duplex == HALF_DUPLEX)) {
drivers/net/ethernet/intel/i40e/i40e_adminq.c+3−4
@@ -701,8 +701,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, · 700 unmodified lines
701701
702702 details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use);
703703 if (cmd_details) {
704− memcpy(details, cmd_details,
705− sizeof(struct i40e_asq_cmd_details));
704+ *details = *cmd_details;
706705
707706 /* If the cmd_details are defined copy the cookie. The
708707 * cpu_to_le32 is not needed here because the data is ignored
@@ -760,7 +759,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, · 51 unmodified lines
760759 desc_on_ring = I40E_ADMINQ_DESC(hw->aq.asq, hw->aq.asq.next_to_use);
761760
762761 /* if the desc is available copy the temp desc to the right place */
763− memcpy(desc_on_ring, desc, sizeof(struct i40e_aq_desc));
762+ *desc_on_ring = *desc;
764763
765764 /* if buff is not NULL assume indirect command */
766765 if (buff != NULL) {
@@ -807,7 +806,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw, · 40 unmodified lines
807806
808807 /* if ready, copy the desc back to temp */
809808 if (i40e_asq_done(hw)) {
810− memcpy(desc, desc_on_ring, sizeof(struct i40e_aq_desc));
809+ *desc = *desc_on_ring;
811810 if (buff != NULL)
812811 memcpy(buff, dma_buff->va, buff_size);
813812 retval = le16_to_cpu(desc->retval);
drivers/net/ethernet/intel/i40e/i40e_common.c+1−1
@@ -507,7 +507,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw, · 506 unmodified lines
507507
508508 /* save link status information */
509509 if (link)
510− memcpy(link, hw_link_info, sizeof(struct i40e_link_status));
510+ *link = *hw_link_info;
511511
512512 /* flag cleared so helper functions don't call AQ again */
513513 hw->phy.get_link_info = false;
drivers/net/ethernet/intel/i40e/i40e_main.c+82−80
@@ -101,10 +101,10 @@ int i40e_allocate_dma_mem_d(struct i40e_hw *hw, struct i40e_dma_mem *mem, · 100 unmodified lines
101101 mem->size = ALIGN(size, alignment);
102102 mem->va = dma_zalloc_coherent(&pf->pdev->dev, mem->size,
103103 &mem->pa, GFP_KERNEL);
104− if (mem->va)
105− return 0;
104+ if (!mem->va)
105+ return -ENOMEM;
106106
107− return -ENOMEM;
107+ return 0;
108108 }
109109
110110 /**
@@ -136,10 +136,10 @@ int i40e_allocate_virt_mem_d(struct i40e_hw *hw, struct i40e_virt_mem *mem, · 25 unmodified lines
136136 mem->size = size;
137137 mem->va = kzalloc(size, GFP_KERNEL);
138138
139− if (mem->va)
140− return 0;
139+ if (!mem->va)
140+ return -ENOMEM;
141141
142− return -ENOMEM;
142+ return 0;
143143 }
144144
145145 /**
@@ -174,8 +174,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, · 28 unmodified lines
174174 u16 needed, u16 id)
175175 {
176176 int ret = -ENOMEM;
177− int i = 0;
178− int j = 0;
177+ int i, j;
179178
180179 if (!pile || needed == 0 || id >= I40E_PILE_VALID_BIT) {
181180 dev_info(&pf->pdev->dev,
@@ -186,7 +185,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, · 4 unmodified lines
186185
187186 /* start the linear search with an imperfect hint */
188187 i = pile->search_hint;
189− while (i < pile->num_entries && ret < 0) {
188+ while (i < pile->num_entries) {
190189 /* skip already allocated entries */
191190 if (pile->list[i] & I40E_PILE_VALID_BIT) {
192191 i++;
@@ -205,6 +204,7 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile, · 12 unmodified lines
205204 pile->list[i+j] = id | I40E_PILE_VALID_BIT;
206205 ret = i;
207206 pile->search_hint = i + j;
207+ break;
208208 } else {
209209 /* not enough, so skip over it and continue looking */
210210 i += j;
@@ -1388,7 +1388,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) · 1177 unmodified lines
13881388 bool add_happened = false;
13891389 int filter_list_len = 0;
13901390 u32 changed_flags = 0;
1391− i40e_status ret = 0;
1391+ i40e_status aq_ret = 0;
13921392 struct i40e_pf *pf;
13931393 int num_add = 0;
13941394 int num_del = 0;
@@ -1449,28 +1449,28 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) · 54 unmodified lines
14491449
14501450 /* flush a full buffer */
14511451 if (num_del == filter_list_len) {
1452− ret = i40e_aq_remove_macvlan(&pf->hw,
1452+ aq_ret = i40e_aq_remove_macvlan(&pf->hw,
14531453 vsi->seid, del_list, num_del,
14541454 NULL);
14551455 num_del = 0;
14561456 memset(del_list, 0, sizeof(*del_list));
14571457
1458− if (ret)
1458+ if (aq_ret)
14591459 dev_info(&pf->pdev->dev,
14601460 "ignoring delete macvlan error, err %d, aq_err %d while flushing a full buffer\n",
1461− ret,
1461+ aq_ret,
14621462 pf->hw.aq.asq_last_status);
14631463 }
14641464 }
14651465 if (num_del) {
1466− ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid,
1466+ aq_ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid,
14671467 del_list, num_del, NULL);
14681468 num_del = 0;
14691469
1470− if (ret)
1470+ if (aq_ret)
14711471 dev_info(&pf->pdev->dev,
14721472 "ignoring delete macvlan error, err %d, aq_err %d\n",
1473− ret, pf->hw.aq.asq_last_status);
1473+ aq_ret, pf->hw.aq.asq_last_status);
14741474 }
14751475
14761476 kfree(del_list);
@@ -1515,32 +1515,30 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) · 38 unmodified lines
15151515
15161516 /* flush a full buffer */
15171517 if (num_add == filter_list_len) {
1518− ret = i40e_aq_add_macvlan(&pf->hw,
1519− vsi->seid,
1520− add_list,
1521− num_add,
1522− NULL);
1518+ aq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,
1519+ add_list, num_add,
1520+ NULL);
15231521 num_add = 0;
15241522
1525− if (ret)
1523+ if (aq_ret)
15261524 break;
15271525 memset(add_list, 0, sizeof(*add_list));
15281526 }
15291527 }
15301528 if (num_add) {
1531− ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,
1532− add_list, num_add, NULL);
1529+ aq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,
1530+ add_list, num_add, NULL);
15331531 num_add = 0;
15341532 }
15351533 kfree(add_list);
15361534 add_list = NULL;
15371535
1538− if (add_happened && (!ret)) {
1536+ if (add_happened && (!aq_ret)) {
15391537 /* do nothing */;
1540− } else if (add_happened && (ret)) {
1538+ } else if (add_happened && (aq_ret)) {
15411539 dev_info(&pf->pdev->dev,
15421540 "add filter failed, err %d, aq_err %d\n",
1543− ret, pf->hw.aq.asq_last_status);
1541+ aq_ret, pf->hw.aq.asq_last_status);
15441542 if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOSPC) &&
15451543 !test_bit(__I40E_FILTER_OVERFLOW_PROMISC,
15461544 &vsi->state)) {
@@ -1556,28 +1554,27 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) · 9 unmodified lines
15561554 if (changed_flags & IFF_ALLMULTI) {
15571555 bool cur_multipromisc;
15581556 cur_multipromisc = !!(vsi->current_netdev_flags & IFF_ALLMULTI);
1559− ret = i40e_aq_set_vsi_multicast_promiscuous(&vsi->back->hw,
1560− vsi->seid,
1561− cur_multipromisc,
1562− NULL);
1563− if (ret)
1557+ aq_ret = i40e_aq_set_vsi_multicast_promiscuous(&vsi->back->hw,
1558+ vsi->seid,
1559+ cur_multipromisc,
1560+ NULL);
1561+ if (aq_ret)
15641562 dev_info(&pf->pdev->dev,
15651563 "set multi promisc failed, err %d, aq_err %d\n",
1566− ret, pf->hw.aq.asq_last_status);
1564+ aq_ret, pf->hw.aq.asq_last_status);
15671565 }
15681566 if ((changed_flags & IFF_PROMISC) || promisc_forced_on) {
15691567 bool cur_promisc;
15701568 cur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) ||
15711569 test_bit(__I40E_FILTER_OVERFLOW_PROMISC,
15721570 &vsi->state));
1573− ret = i40e_aq_set_vsi_unicast_promiscuous(&vsi->back->hw,
1574− vsi->seid,
1575− cur_promisc,
1576− NULL);
1577− if (ret)
1571+ aq_ret = i40e_aq_set_vsi_unicast_promiscuous(&vsi->back->hw,
1572+ vsi->seid,
1573+ cur_promisc, NULL);
1574+ if (aq_ret)
15781575 dev_info(&pf->pdev->dev,
15791576 "set uni promisc failed, err %d, aq_err %d\n",
1580− ret, pf->hw.aq.asq_last_status);
1577+ aq_ret, pf->hw.aq.asq_last_status);
15811578 }
15821579
15831580 clear_bit(__I40E_CONFIG_BUSY, &vsi->state);
@@ -1790,6 +1787,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid) · 206 unmodified lines
17901787 * i40e_vsi_kill_vlan - Remove vsi membership for given vlan
17911788 * @vsi: the vsi being configured
17921789 * @vid: vlan id to be removed (0 = untagged only , -1 = any)
1790+ *
1791+ * Return: 0 on success or negative otherwise
17931792 **/
17941793 int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
17951794 {
@@ -1863,37 +1862,39 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid) · 67 unmodified lines
18631862 * i40e_vlan_rx_add_vid - Add a vlan id filter to HW offload
18641863 * @netdev: network interface to be adjusted
18651864 * @vid: vlan id to be added
1865+ *
1866+ * net_device_ops implementation for adding vlan ids
18661867 **/
18671868 static int i40e_vlan_rx_add_vid(struct net_device *netdev,
18681869 __always_unused __be16 proto, u16 vid)
18691870 {
18701871 struct i40e_netdev_priv *np = netdev_priv(netdev);
18711872 struct i40e_vsi *vsi = np->vsi;
1872− int ret;
1873+ int ret = 0;
18731874
18741875 if (vid > 4095)
1875− return 0;
1876+ return -EINVAL;
1877+
1878+ netdev_info(netdev, "adding %pM vid=%d\n", netdev->dev_addr, vid);
18761879
1877− netdev_info(vsi->netdev, "adding %pM vid=%d\n",
1878− netdev->dev_addr, vid);
18791880 /* If the network stack called us with vid = 0, we should
18801881 * indicate to i40e_vsi_add_vlan() that we want to receive
18811882 * any traffic (i.e. with any vlan tag, or untagged)
18821883 */
18831884 ret = i40e_vsi_add_vlan(vsi, vid ? vid : I40E_VLAN_ANY);
18841885
1885− if (!ret) {
1886− if (vid < VLAN_N_VID)
1887− set_bit(vid, vsi->active_vlans);
1888− }
1886+ if (!ret && (vid < VLAN_N_VID))
1887+ set_bit(vid, vsi->active_vlans);
18891888
1890− return 0;
1889+ return ret;
18911890 }
18921891
18931892 /**
18941893 * i40e_vlan_rx_kill_vid - Remove a vlan id filter from HW offload
18951894 * @netdev: network interface to be adjusted
18961895 * @vid: vlan id to be removed
1896+ *
1897+ * net_device_ops implementation for adding vlan ids
18971898 **/
18981899 static int i40e_vlan_rx_kill_vid(struct net_device *netdev,
18991900 __always_unused __be16 proto, u16 vid)
@@ -1901,15 +1902,16 @@ static int i40e_vlan_rx_kill_vid(struct net_device *netdev, · 1 unmodified line
19011902 struct i40e_netdev_priv *np = netdev_priv(netdev);
19021903 struct i40e_vsi *vsi = np->vsi;
19031904
1904− netdev_info(vsi->netdev, "removing %pM vid=%d\n",
1905− netdev->dev_addr, vid);
1905+ netdev_info(netdev, "removing %pM vid=%d\n", netdev->dev_addr, vid);
1906+
19061907 /* return code is ignored as there is nothing a user
19071908 * can do about failure to remove and a log message was
1908− * already printed from another function
1909+ * already printed from the other function
19091910 */
19101911 i40e_vsi_kill_vlan(vsi, vid);
19111912
19121913 clear_bit(vid, vsi->active_vlans);
1914+
19131915 return 0;
19141916 }
19151917
@@ -1936,10 +1938,10 @@ static void i40e_restore_vlan(struct i40e_vsi *vsi) · 20 unmodified lines
19361938 * @vsi: the vsi being adjusted
19371939 * @vid: the vlan id to set as a PVID
19381940 **/
1939−i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid)
1941+int i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid)
19401942 {
19411943 struct i40e_vsi_context ctxt;
1942− i40e_status ret;
1944+ i40e_status aq_ret;
19431945
19441946 vsi->info.valid_sections = cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID);
19451947 vsi->info.pvid = cpu_to_le16(vid);
@@ -1948,14 +1950,15 @@ i40e_status i40e_vsi_add_pvid(struct i40e_vsi *vsi, u16 vid) · 2 unmodified lines
19481950
19491951 ctxt.seid = vsi->seid;
19501952 memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info));
1951− ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
1952− if (ret) {
1953+ aq_ret = i40e_aq_update_vsi_params(&vsi->back->hw, &ctxt, NULL);
1954+ if (aq_ret) {
19531955 dev_info(&vsi->back->pdev->dev,
19541956 "%s: update vsi failed, aq_err=%d\n",
19551957 __func__, vsi->back->hw.aq.asq_last_status);
1958+ return -ENOENT;
19561959 }
19571960
1958− return ret;
1961+ return 0;
19591962 }
19601963
19611964 /**
@@ -3326,7 +3329,8 @@ static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf) · 1364 unmodified lines
33263329 **/
33273330 static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg)
33283331 {
3329− int num_tc = 0, i;
3332+ u8 num_tc = 0;
3333+ int i;
33303334
33313335 /* Scan the ETS Config Priority Table to find
33323336 * traffic class enabled for a given priority
@@ -3341,9 +3345,7 @@ static u8 i40e_dcb_get_num_tc(struct i40e_dcbx_config *dcbcfg) · 8 unmodified lines
33413345 /* Traffic class index starts from zero so
33423346 * increment to return the actual count
33433347 */
3344− num_tc++;
3345−
3346− return num_tc;
3348+ return num_tc + 1;
33473349 }
33483350
33493351 /**
@@ -3451,28 +3453,27 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) · 101 unmodified lines
34513453 struct i40e_aqc_query_vsi_bw_config_resp bw_config = {0};
34523454 struct i40e_pf *pf = vsi->back;
34533455 struct i40e_hw *hw = &pf->hw;
3456+ i40e_status aq_ret;
34543457 u32 tc_bw_max;
3455− int ret;
34563458 int i;
34573459
34583460 /* Get the VSI level BW configuration */
3459− ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL);
3460− if (ret) {
3461+ aq_ret = i40e_aq_query_vsi_bw_config(hw, vsi->seid, &bw_config, NULL);
3462+ if (aq_ret) {
34613463 dev_info(&pf->pdev->dev,
34623464 "couldn't get pf vsi bw config, err %d, aq_err %d\n",
3463− ret, pf->hw.aq.asq_last_status);
3464− return ret;
3465+ aq_ret, pf->hw.aq.asq_last_status);
3466+ return -EINVAL;
34653467 }
34663468
34673469 /* Get the VSI level BW configuration per TC */
3468− ret = i40e_aq_query_vsi_ets_sla_config(hw, vsi->seid,
3469− &bw_ets_config,
3470− NULL);
3471− if (ret) {
3470+ aq_ret = i40e_aq_query_vsi_ets_sla_config(hw, vsi->seid, &bw_ets_config,
3471+ NULL);
3472+ if (aq_ret) {
34723473 dev_info(&pf->pdev->dev,
34733474 "couldn't get pf vsi ets bw config, err %d, aq_err %d\n",
3474− ret, pf->hw.aq.asq_last_status);
3475− return ret;
3475+ aq_ret, pf->hw.aq.asq_last_status);
3476+ return -EINVAL;
34763477 }
34773478
34783479 if (bw_config.tc_valid_bits != bw_ets_config.tc_valid_bits) {
@@ -3494,7 +3495,8 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) · 15 unmodified lines
34943495 /* 3 bits out of 4 for each TC */
34953496 vsi->bw_ets_max_quanta[i] = (u8)((tc_bw_max >> (i*4)) & 0x7);
34963497 }
3497− return ret;
3498+
3499+ return 0;
34983500 }
34993501
35003502 /**
@@ -3505,30 +3507,30 @@ static int i40e_vsi_get_bw_info(struct i40e_vsi *vsi) · 4 unmodified lines
35053507 *
35063508 * Returns 0 on success, negative value on failure
35073509 **/
3508−static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi,
3509− u8 enabled_tc,
3510+static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
35103511 u8 *bw_share)
35113512 {
35123513 struct i40e_aqc_configure_vsi_tc_bw_data bw_data;
3513− int i, ret = 0;
3514+ i40e_status aq_ret;
3515+ int i;
35143516
35153517 bw_data.tc_valid_bits = enabled_tc;
35163518 for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
35173519 bw_data.tc_bw_credits[i] = bw_share[i];
35183520
3519− ret = i40e_aq_config_vsi_tc_bw(&vsi->back->hw, vsi->seid,
3520− &bw_data, NULL);
3521− if (ret) {
3521+ aq_ret = i40e_aq_config_vsi_tc_bw(&vsi->back->hw, vsi->seid, &bw_data,
3522+ NULL);
3523+ if (aq_ret) {
35223524 dev_info(&vsi->back->pdev->dev,
35233525 "%s: AQ command Config VSI BW allocation per TC failed = %d\n",
35243526 __func__, vsi->back->hw.aq.asq_last_status);
3525− return ret;
3527+ return -EINVAL;
35263528 }
35273529
35283530 for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
35293531 vsi->info.qs_handle[i] = bw_data.qs_handles[i];
35303532
3531− return ret;
3533+ return 0;
35323534 }
35333535
35343536 /**
drivers/net/ethernet/intel/igb/e1000_82575.c+4−0
@@ -719,6 +719,10 @@ static s32 igb_get_phy_id_82575(struct e1000_hw *hw) · 718 unmodified lines
719719 u32 ctrl_ext;
720720 u32 mdic;
721721
722+ /* Extra read required for some PHY's on i354 */
723+ if (hw->mac.type == e1000_i354)
724+ igb_get_phy_id(hw);
725+
722726 /* For SGMII PHYs, we try the list of possible addresses until
723727 * we find one that works. For non-SGMII PHYs
724728 * (e.g. integrated copper PHYs), an address of 1 should
drivers/net/ethernet/intel/igb/e1000_mac.c+9−1
@@ -712,6 +712,7 @@ static s32 igb_set_fc_watermarks(struct e1000_hw *hw) · 711 unmodified lines
712712 static s32 igb_set_default_fc(struct e1000_hw *hw)
713713 {
714714 s32 ret_val = 0;
715+ u16 lan_offset;
715716 u16 nvm_data;
716717
717718 /* Read and store word 0x0F of the EEPROM. This word contains bits
@@ -722,7 +723,14 @@ static s32 igb_set_default_fc(struct e1000_hw *hw) · 4 unmodified lines
722723 * control setting, then the variable hw->fc will
723724 * be initialized based on a value in the EEPROM.
724725 */
725− ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &nvm_data);
726+ if (hw->mac.type == e1000_i350) {
727+ lan_offset = NVM_82580_LAN_FUNC_OFFSET(hw->bus.func);
728+ ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG
729+ + lan_offset, 1, &nvm_data);
730+ } else {
731+ ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG,
732+ 1, &nvm_data);
733+ }
726734
727735 if (ret_val) {
728736 hw_dbg("NVM Read Error\n");
drivers/net/ethernet/intel/igb/igb_ethtool.c+3−0
@@ -1607,6 +1607,9 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter) · 1606 unmodified lines
16071607 igb_write_phy_reg(hw, I347AT4_PAGE_SELECT, 0);
16081608 igb_write_phy_reg(hw, PHY_CONTROL, 0x4140);
16091609 }
1610+ } else if (hw->phy.type == e1000_phy_82580) {
1611+ /* enable MII loopback */
1612+ igb_write_phy_reg(hw, I82580_PHY_LBK_CTRL, 0x8041);
16101613 }
16111614
16121615 /* add small delay to avoid loopback test failure */
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c+25−0
@@ -160,6 +160,13 @@ static int ixgbe_get_settings(struct net_device *netdev, · 159 unmodified lines
160160 bool autoneg = false;
161161 bool link_up;
162162
163+ /* SFP type is needed for get_link_capabilities */
164+ if (hw->phy.media_type & (ixgbe_media_type_fiber |
165+ ixgbe_media_type_fiber_qsfp)) {
166+ if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
167+ hw->phy.ops.identify_sfp(hw);
168+ }
169+
163170 hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg);
164171
165172 /* set the supported link speeds */
@@ -186,6 +193,11 @@ static int ixgbe_get_settings(struct net_device *netdev, · 20 unmodified lines
186193 ecmd->advertising |= ADVERTISED_1000baseT_Full;
187194 if (supported_link & IXGBE_LINK_SPEED_100_FULL)
188195 ecmd->advertising |= ADVERTISED_100baseT_Full;
196+
197+ if (hw->phy.multispeed_fiber && !autoneg) {
198+ if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
199+ ecmd->advertising = ADVERTISED_10000baseT_Full;
200+ }
189201 }
190202
191203 if (autoneg) {
@@ -314,6 +326,14 @@ static int ixgbe_set_settings(struct net_device *netdev, · 122 unmodified lines
314326 if (ecmd->advertising & ~ecmd->supported)
315327 return -EINVAL;
316328
329+ /* only allow one speed at a time if no autoneg */
330+ if (!ecmd->autoneg && hw->phy.multispeed_fiber) {
331+ if (ecmd->advertising ==
332+ (ADVERTISED_10000baseT_Full |
333+ ADVERTISED_1000baseT_Full))
334+ return -EINVAL;
335+ }
336+
317337 old = hw->phy.autoneg_advertised;
318338 advertised = 0;
319339 if (ecmd->advertising & ADVERTISED_10000baseT_Full)
@@ -1805,6 +1825,10 @@ static int ixgbe_run_loopback_test(struct ixgbe_adapter *adapter) · 1485 unmodified lines
18051825 unsigned int size = 1024;
18061826 netdev_tx_t tx_ret_val;
18071827 struct sk_buff *skb;
1828+ u32 flags_orig = adapter->flags;
1829+
1830+ /* DCB can modify the frames on Tx */
1831+ adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED;
18081832
18091833 /* allocate test skb */
18101834 skb = alloc_skb(size, GFP_KERNEL);
@@ -1857,6 +1881,7 @@ static int ixgbe_run_loopback_test(struct ixgbe_adapter *adapter) · 46 unmodified lines
18571881
18581882 /* free the original skb */
18591883 kfree_skb(skb);
1884+ adapter->flags = flags_orig;
18601885
18611886 return ret_val;
18621887 }
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+17−2
@@ -3571,7 +3571,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) · 3570 unmodified lines
35713571 {
35723572 struct ixgbe_hw *hw = &adapter->hw;
35733573 int i;
3574− u32 rxctrl;
3574+ u32 rxctrl, rfctl;
35753575
35763576 /* disable receives while setting up the descriptors */
35773577 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
@@ -3580,6 +3580,13 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) · 2 unmodified lines
35803580 ixgbe_setup_psrtype(adapter);
35813581 ixgbe_setup_rdrxctl(adapter);
35823582
3583+ /* RSC Setup */
3584+ rfctl = IXGBE_READ_REG(hw, IXGBE_RFCTL);
3585+ rfctl &= ~IXGBE_RFCTL_RSC_DIS;
3586+ if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))
3587+ rfctl |= IXGBE_RFCTL_RSC_DIS;
3588+ IXGBE_WRITE_REG(hw, IXGBE_RFCTL, rfctl);
3589+
35833590 /* Program registers for the distribution of queues */
35843591 ixgbe_setup_mrqc(adapter);
35853592
@@ -5993,8 +6000,16 @@ static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter) · 2407 unmodified lines
59936000 adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;
59946001
59956002 speed = hw->phy.autoneg_advertised;
5996− if ((!speed) && (hw->mac.ops.get_link_capabilities))
6003+ if ((!speed) && (hw->mac.ops.get_link_capabilities)) {
59976004 hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg);
6005+
6006+ /* setup the highest link when no autoneg */
6007+ if (!autoneg) {
6008+ if (speed & IXGBE_LINK_SPEED_10GB_FULL)
6009+ speed = IXGBE_LINK_SPEED_10GB_FULL;
6010+ }
6011+ }
6012+
59986013 if (hw->mac.ops.setup_link)
59996014 hw->mac.ops.setup_link(hw, speed, true);
60006015
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h+1−0
@@ -1861,6 +1861,7 @@ enum { · 1860 unmodified lines
18611861 #define IXGBE_RFCTL_ISCSI_DIS 0x00000001
18621862 #define IXGBE_RFCTL_ISCSI_DWC_MASK 0x0000003E
18631863 #define IXGBE_RFCTL_ISCSI_DWC_SHIFT 1
1864+#define IXGBE_RFCTL_RSC_DIS 0x00000020
18641865 #define IXGBE_RFCTL_NFSW_DIS 0x00000040
18651866 #define IXGBE_RFCTL_NFSR_DIS 0x00000080
18661867 #define IXGBE_RFCTL_NFS_VER_MASK 0x00000300
drivers/net/ethernet/lantiq_etop.c+2−4
@@ -282,8 +282,7 @@ ltq_etop_hw_init(struct net_device *dev) · 281 unmodified lines
282282
283283 if (IS_TX(i)) {
284284 ltq_dma_alloc_tx(&ch->dma);
285− request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
286− "etop_tx", priv);
285+ request_irq(irq, ltq_etop_dma_irq, 0, "etop_tx", priv);
287286 } else if (IS_RX(i)) {
288287 ltq_dma_alloc_rx(&ch->dma);
289288 for (ch->dma.desc = 0; ch->dma.desc < LTQ_DESC_NUM;
@@ -291,8 +290,7 @@ ltq_etop_hw_init(struct net_device *dev) · 1 unmodified line
291290 if (ltq_etop_alloc_skb(ch))
292291 return -ENOMEM;
293292 ch->dma.desc = 0;
294− request_irq(irq, ltq_etop_dma_irq, IRQF_DISABLED,
295− "etop_rx", priv);
293+ request_irq(irq, ltq_etop_dma_irq, 0, "etop_rx", priv);
296294 }
297295 ch->dma.irq = irq;
298296 }
drivers/net/ethernet/marvell/pxa168_eth.c+1−2
@@ -1123,8 +1123,7 @@ static int pxa168_eth_open(struct net_device *dev) · 1122 unmodified lines
11231123 struct pxa168_eth_private *pep = netdev_priv(dev);
11241124 int err;
11251125
1126− err = request_irq(dev->irq, pxa168_eth_int_handler,
1127− IRQF_DISABLED, dev->name, dev);
1126+ err = request_irq(dev->irq, pxa168_eth_int_handler, 0, dev->name, dev);
11281127 if (err) {
11291128 dev_err(&dev->dev, "can't assign irq\n");
11301129 return -EAGAIN;
drivers/net/ethernet/marvell/skge.c+8−4
@@ -3086,23 +3086,27 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, · 3085 unmodified lines
30863086 PCI_DMA_FROMDEVICE);
30873087 skge_rx_reuse(e, skge->rx_buf_size);
30883088 } else {
3089+ struct skge_element ee;
30893090 struct sk_buff *nskb;
30903091
30913092 nskb = netdev_alloc_skb_ip_align(dev, skge->rx_buf_size);
30923093 if (!nskb)
30933094 goto resubmit;
30943095
3096+ ee = *e;
3097+
3098+ skb = ee.skb;
3099+ prefetch(skb->data);
3100+
30953101 if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
30963102 dev_kfree_skb(nskb);
30973103 goto resubmit;
30983104 }
30993105
31003106 pci_unmap_single(skge->hw->pdev,
3101− dma_unmap_addr(e, mapaddr),
3102− dma_unmap_len(e, maplen),
3107+ dma_unmap_addr(&ee, mapaddr),
3108+ dma_unmap_len(&ee, maplen),
31033109 PCI_DMA_FROMDEVICE);
3104− skb = e->skb;
3105− prefetch(skb->data);
31063110 }
31073111
31083112 skb_put(skb, len);
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c+10−6
@@ -53,9 +53,11 @@ static int mlx4_en_moderation_update(struct mlx4_en_priv *priv) · 52 unmodified lines
5353 for (i = 0; i < priv->tx_ring_num; i++) {
5454 priv->tx_cq[i].moder_cnt = priv->tx_frames;
5555 priv->tx_cq[i].moder_time = priv->tx_usecs;
56− err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]);
57− if (err)
58− return err;
56+ if (priv->port_up) {
57+ err = mlx4_en_set_cq_moder(priv, &priv->tx_cq[i]);
58+ if (err)
59+ return err;
60+ }
5961 }
6062
6163 if (priv->adaptive_rx_coal)
@@ -65,9 +67,11 @@ static int mlx4_en_moderation_update(struct mlx4_en_priv *priv) · 3 unmodified lines
6567 priv->rx_cq[i].moder_cnt = priv->rx_frames;
6668 priv->rx_cq[i].moder_time = priv->rx_usecs;
6769 priv->last_moder_time[i] = MLX4_EN_AUTO_CONF;
68− err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]);
69− if (err)
70− return err;
70+ if (priv->port_up) {
71+ err = mlx4_en_set_cq_moder(priv, &priv->rx_cq[i]);
72+ if (err)
73+ return err;
74+ }
7175 }
7276
7377 return err;
drivers/net/ethernet/micrel/ks8851_mll.c+1−1
@@ -915,7 +915,7 @@ static int ks_net_open(struct net_device *netdev) · 914 unmodified lines
915915 struct ks_net *ks = netdev_priv(netdev);
916916 int err;
917917
918−#define KS_INT_FLAGS (IRQF_DISABLED|IRQF_TRIGGER_LOW)
918+#define KS_INT_FLAGS IRQF_TRIGGER_LOW
919919 /* lock the card, even if we may not actually do anything
920920 * else at the moment.
921921 */
drivers/net/ethernet/moxa/moxart_ether.c+1−1
@@ -543,7 +543,7 @@ static const struct of_device_id moxart_mac_match[] = { · 542 unmodified lines
543543 { }
544544 };
545545
546−struct __initdata platform_driver moxart_mac_driver = {
546+static struct platform_driver moxart_mac_driver = {
547547 .probe = moxart_mac_probe,
548548 .remove = moxart_remove,
549549 .driver = {
drivers/net/ethernet/natsemi/jazzsonic.c+1−2
@@ -83,8 +83,7 @@ static int jazzsonic_open(struct net_device* dev) · 82 unmodified lines
8383 {
8484 int retval;
8585
86− retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,
87− "sonic", dev);
86+ retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev);
8887 if (retval) {
8988 printk(KERN_ERR "%s: unable to get IRQ %d.\n",
9089 dev->name, dev->irq);
drivers/net/ethernet/natsemi/xtsonic.c+1−2
@@ -95,8 +95,7 @@ static int xtsonic_open(struct net_device *dev) · 94 unmodified lines
9595 {
9696 int retval;
9797
98− retval = request_irq(dev->irq, sonic_interrupt, IRQF_DISABLED,
99− "sonic", dev);
98+ retval = request_irq(dev->irq, sonic_interrupt, 0, "sonic", dev);
10099 if (retval) {
101100 printk(KERN_ERR "%s: unable to get IRQ %d.\n",
102101 dev->name, dev->irq);
drivers/net/ethernet/pasemi/pasemi_mac.c+2−2
@@ -1219,7 +1219,7 @@ static int pasemi_mac_open(struct net_device *dev) · 1218 unmodified lines
12191219 snprintf(mac->tx_irq_name, sizeof(mac->tx_irq_name), "%s tx",
12201220 dev->name);
12211221
1222− ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, IRQF_DISABLED,
1222+ ret = request_irq(mac->tx->chan.irq, pasemi_mac_tx_intr, 0,
12231223 mac->tx_irq_name, mac->tx);
12241224 if (ret) {
12251225 dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",
@@ -1230,7 +1230,7 @@ static int pasemi_mac_open(struct net_device *dev) · 4 unmodified lines
12301230 snprintf(mac->rx_irq_name, sizeof(mac->rx_irq_name), "%s rx",
12311231 dev->name);
12321232
1233− ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, IRQF_DISABLED,
1233+ ret = request_irq(mac->rx->chan.irq, pasemi_mac_rx_intr, 0,
12341234 mac->rx_irq_name, mac->rx);
12351235 if (ret) {
12361236 dev_err(&mac->pdev->dev, "request_irq of irq %d failed: %d\n",
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c+8−0
@@ -1794,3 +1794,11 @@ const struct ethtool_ops qlcnic_sriov_vf_ethtool_ops = { · 1793 unmodified lines
17941794 .set_msglevel = qlcnic_set_msglevel,
17951795 .get_msglevel = qlcnic_get_msglevel,
17961796 };
1797+
1798+const struct ethtool_ops qlcnic_ethtool_failed_ops = {
1799+ .get_settings = qlcnic_get_settings,
1800+ .get_drvinfo = qlcnic_get_drvinfo,
1801+ .set_msglevel = qlcnic_set_msglevel,
1802+ .get_msglevel = qlcnic_get_msglevel,
1803+ .set_dump = qlcnic_set_dump,
1804+};
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c+37−2
@@ -431,6 +431,9 @@ static void qlcnic_82xx_cancel_idc_work(struct qlcnic_adapter *adapter) · 430 unmodified lines
431431 while (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
432432 usleep_range(10000, 11000);
433433
434+ if (!adapter->fw_work.work.func)
435+ return;
436+
434437 cancel_delayed_work_sync(&adapter->fw_work);
435438 }
436439
@@ -2275,8 +2278,9 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 1838 unmodified lines
22752278 adapter->portnum = adapter->ahw->pci_func;
22762279 err = qlcnic_start_firmware(adapter);
22772280 if (err) {
2278− dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n");
2279− goto err_out_free_hw;
2281+ dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n"
2282+ "\t\tIf reboot doesn't help, try flashing the card\n");
2283+ goto err_out_maintenance_mode;
22802284 }
22812285
22822286 qlcnic_get_multiq_capability(adapter);
@@ -2408,6 +2412,22 @@ err_out_disable_pdev: · 125 unmodified lines
24082412 pci_set_drvdata(pdev, NULL);
24092413 pci_disable_device(pdev);
24102414 return err;
2415+
2416+err_out_maintenance_mode:
2417+ netdev->netdev_ops = &qlcnic_netdev_failed_ops;
2418+ SET_ETHTOOL_OPS(netdev, &qlcnic_ethtool_failed_ops);
2419+ err = register_netdev(netdev);
2420+
2421+ if (err) {
2422+ dev_err(&pdev->dev, "Failed to register net device\n");
2423+ qlcnic_clr_all_drv_state(adapter, 0);
2424+ goto err_out_free_hw;
2425+ }
2426+
2427+ pci_set_drvdata(pdev, adapter);
2428+ qlcnic_add_sysfs(adapter);
2429+
2430+ return 0;
24112431 }
24122432
24132433 static void qlcnic_remove(struct pci_dev *pdev)
@@ -2518,8 +2538,16 @@ static int qlcnic_resume(struct pci_dev *pdev) · 104 unmodified lines
25182538 static int qlcnic_open(struct net_device *netdev)
25192539 {
25202540 struct qlcnic_adapter *adapter = netdev_priv(netdev);
2541+ u32 state;
25212542 int err;
25222543
2544+ state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE);
2545+ if (state == QLCNIC_DEV_FAILED || state == QLCNIC_DEV_BADBAD) {
2546+ netdev_err(netdev, "%s: Device is in FAILED state\n", __func__);
2547+
2548+ return -EIO;
2549+ }
2550+
25232551 netif_carrier_off(netdev);
25242552
25252553 err = qlcnic_attach(adapter);
@@ -3228,6 +3256,13 @@ void qlcnic_82xx_dev_request_reset(struct qlcnic_adapter *adapter, u32 key) · 702 unmodified lines
32283256 return;
32293257
32303258 state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE);
3259+ if (state == QLCNIC_DEV_FAILED || state == QLCNIC_DEV_BADBAD) {
3260+ netdev_err(adapter->netdev, "%s: Device is in FAILED state\n",
3261+ __func__);
3262+ qlcnic_api_unlock(adapter);
3263+
3264+ return;
3265+ }
32313266
32323267 if (state == QLCNIC_DEV_READY) {
32333268 QLC_SHARED_REG_WR32(adapter, QLCNIC_CRB_DEV_STATE,
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c+1−0
@@ -1561,6 +1561,7 @@ static int qlcnic_sriov_vf_reinit_driver(struct qlcnic_adapter *adapter) · 1560 unmodified lines
15611561 {
15621562 int err;
15631563
1564+ adapter->need_fw_reset = 0;
15641565 qlcnic_83xx_reinit_mbx_work(adapter->ahw->mailbox);
15651566 qlcnic_83xx_enable_mbx_interrupt(adapter);
15661567
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c+7−1
@@ -397,6 +397,7 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter) · 396 unmodified lines
397397 {
398398 struct net_device *netdev = adapter->netdev;
399399
400+ rtnl_lock();
400401 if (netif_running(netdev))
401402 __qlcnic_down(adapter, netdev);
402403
@@ -407,12 +408,15 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter) · 4 unmodified lines
407408 /* After disabling SRIOV re-init the driver in default mode
408409 configure opmode based on op_mode of function
409410 */
410− if (qlcnic_83xx_configure_opmode(adapter))
411+ if (qlcnic_83xx_configure_opmode(adapter)) {
412+ rtnl_unlock();
411413 return -EIO;
414+ }
412415
413416 if (netif_running(netdev))
414417 __qlcnic_up(adapter, netdev);
415418
419+ rtnl_unlock();
416420 return 0;
417421 }
418422
@@ -533,6 +537,7 @@ static int qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter, int num_vfs) · 114 unmodified lines
533537 return -EIO;
534538 }
535539
540+ rtnl_lock();
536541 if (netif_running(netdev))
537542 __qlcnic_down(adapter, netdev);
538543
@@ -555,6 +560,7 @@ static int qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter, int num_vfs) · 16 unmodified lines
555560 __qlcnic_up(adapter, netdev);
556561
557562 error:
563+ rtnl_unlock();
558564 return err;
559565 }
560566
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c+12−0
@@ -1272,6 +1272,7 @@ void qlcnic_remove_sysfs_entries(struct qlcnic_adapter *adapter) · 1271 unmodified lines
12721272 void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter)
12731273 {
12741274 struct device *dev = &adapter->pdev->dev;
1275+ u32 state;
12751276
12761277 if (device_create_bin_file(dev, &bin_attr_port_stats))
12771278 dev_info(dev, "failed to create port stats sysfs entry");
@@ -1285,8 +1286,13 @@ void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter) · 7 unmodified lines
12851286 if (device_create_bin_file(dev, &bin_attr_mem))
12861287 dev_info(dev, "failed to create mem sysfs entry\n");
12871288
1289+ state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE);
1290+ if (state == QLCNIC_DEV_FAILED || state == QLCNIC_DEV_BADBAD)
1291+ return;
1292+
12881293 if (device_create_bin_file(dev, &bin_attr_pci_config))
12891294 dev_info(dev, "failed to create pci config sysfs entry");
1295+
12901296 if (device_create_file(dev, &dev_attr_beacon))
12911297 dev_info(dev, "failed to create beacon sysfs entry");
12921298
@@ -1307,6 +1313,7 @@ void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter) · 14 unmodified lines
13071313 void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter)
13081314 {
13091315 struct device *dev = &adapter->pdev->dev;
1316+ u32 state;
13101317
13111318 device_remove_bin_file(dev, &bin_attr_port_stats);
13121319
@@ -1315,6 +1322,11 @@ void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter) · 2 unmodified lines
13151322 device_remove_file(dev, &dev_attr_diag_mode);
13161323 device_remove_bin_file(dev, &bin_attr_crb);
13171324 device_remove_bin_file(dev, &bin_attr_mem);
1325+
1326+ state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE);
1327+ if (state == QLCNIC_DEV_FAILED || state == QLCNIC_DEV_BADBAD)
1328+ return;
1329+
13181330 device_remove_bin_file(dev, &bin_attr_pci_config);
13191331 device_remove_file(dev, &dev_attr_beacon);
13201332 if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED))
drivers/net/ethernet/qlogic/qlge/qlge_dbg.c+2−2
@@ -740,8 +740,8 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) · 739 unmodified lines
740740 int i;
741741
742742 if (!mpi_coredump) {
743− netif_err(qdev, drv, qdev->ndev, "No memory available\n");
744− return -ENOMEM;
743+ netif_err(qdev, drv, qdev->ndev, "No memory allocated\n");
744+ return -EINVAL;
745745 }
746746
747747 /* Try to get the spinlock, but dont worry if
drivers/net/ethernet/qlogic/qlge/qlge_mpi.c+1−1
@@ -1274,7 +1274,7 @@ void ql_mpi_reset_work(struct work_struct *work) · 1273 unmodified lines
12741274 return;
12751275 }
12761276
1277− if (!ql_core_dump(qdev, qdev->mpi_coredump)) {
1277+ if (qdev->mpi_coredump && !ql_core_dump(qdev, qdev->mpi_coredump)) {
12781278 netif_err(qdev, drv, qdev->ndev, "Core is dumped!\n");
12791279 qdev->core_is_dumped = 1;
12801280 queue_delayed_work(qdev->workqueue,
drivers/net/ethernet/realtek/r8169.c+1−0
@@ -4231,6 +4231,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp) · 4230 unmodified lines
42314231 case RTL_GIGA_MAC_VER_23:
42324232 case RTL_GIGA_MAC_VER_24:
42334233 case RTL_GIGA_MAC_VER_34:
4234+ case RTL_GIGA_MAC_VER_35:
42344235 RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST);
42354236 break;
42364237 case RTL_GIGA_MAC_VER_40:
drivers/net/ethernet/sfc/Kconfig+1−1
@@ -7,7 +7,7 @@ config SFC · 6 unmodified lines
77 select I2C_ALGOBIT
88 select PTP_1588_CLOCK
99 ---help---
10− This driver supports 10-gigabit Ethernet cards based on
10+ This driver supports 10/40-gigabit Ethernet cards based on
1111 the Solarflare SFC4000, SFC9000-family and SFC9100-family
1212 controllers.
1313
drivers/net/ethernet/sfc/ef10.c+37−21
@@ -94,7 +94,7 @@ static unsigned int efx_ef10_mem_map_size(struct efx_nic *efx) · 93 unmodified lines
9494 return resource_size(&efx->pci_dev->resource[EFX_MEM_BAR]);
9595 }
9696
97−static int efx_ef10_init_capabilities(struct efx_nic *efx)
97+static int efx_ef10_init_datapath_caps(struct efx_nic *efx)
9898 {
9999 MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_CAPABILITIES_OUT_LEN);
100100 struct efx_ef10_nic_data *nic_data = efx->nic_data;
@@ -107,16 +107,27 @@ static int efx_ef10_init_capabilities(struct efx_nic *efx) · 6 unmodified lines
107107 outbuf, sizeof(outbuf), &outlen);
108108 if (rc)
109109 return rc;
110+ if (outlen < sizeof(outbuf)) {
111+ netif_err(efx, drv, efx->net_dev,
112+ "unable to read datapath firmware capabilities\n");
113+ return -EIO;
114+ }
110115
111− if (outlen >= sizeof(outbuf)) {
112− nic_data->datapath_caps =
113− MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1);
114− if (!(nic_data->datapath_caps &
115− (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) {
116− netif_err(efx, drv, efx->net_dev,
117− "Capabilities don't indicate TSO support.\n");
118− return -ENODEV;
119− }
116+ nic_data->datapath_caps =
117+ MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1);
118+
119+ if (!(nic_data->datapath_caps &
120+ (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) {
121+ netif_err(efx, drv, efx->net_dev,
122+ "current firmware does not support TSO\n");
123+ return -ENODEV;
124+ }
125+
126+ if (!(nic_data->datapath_caps &
127+ (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {
128+ netif_err(efx, probe, efx->net_dev,
129+ "current firmware does not support an RX prefix\n");
130+ return -ENODEV;
120131 }
121132
122133 return 0;
@@ -217,21 +228,13 @@ static int efx_ef10_probe(struct efx_nic *efx) · 94 unmodified lines
217228 if (rc)
218229 goto fail3;
219230
220− rc = efx_ef10_init_capabilities(efx);
231+ rc = efx_ef10_init_datapath_caps(efx);
221232 if (rc < 0)
222233 goto fail3;
223234
224235 efx->rx_packet_len_offset =
225236 ES_DZ_RX_PREFIX_PKTLEN_OFST - ES_DZ_RX_PREFIX_SIZE;
226237
227− if (!(nic_data->datapath_caps &
228− (1 << MC_CMD_GET_CAPABILITIES_OUT_RX_PREFIX_LEN_14_LBN))) {
229− netif_err(efx, probe, efx->net_dev,
230− "current firmware does not support an RX prefix\n");
231− rc = -ENODEV;
232− goto fail3;
233− }
234−
235238 rc = efx_mcdi_port_get_number(efx);
236239 if (rc < 0)
237240 goto fail3;
@@ -260,8 +263,6 @@ static int efx_ef10_probe(struct efx_nic *efx) · 22 unmodified lines
260263 if (rc)
261264 goto fail3;
262265
263− efx_ptp_probe(efx);
264−
265266 return 0;
266267
267268 fail3:
@@ -342,6 +343,13 @@ static int efx_ef10_init_nic(struct efx_nic *efx) · 74 unmodified lines
342343 struct efx_ef10_nic_data *nic_data = efx->nic_data;
343344 int rc;
344345
346+ if (nic_data->must_check_datapath_caps) {
347+ rc = efx_ef10_init_datapath_caps(efx);
348+ if (rc)
349+ return rc;
350+ nic_data->must_check_datapath_caps = false;
351+ }
352+
345353 if (nic_data->must_realloc_vis) {
346354 /* We cannot let the number of VIs change now */
347355 rc = efx_ef10_alloc_vis(efx, nic_data->n_allocated_vis,
@@ -710,6 +718,14 @@ static int efx_ef10_mcdi_poll_reboot(struct efx_nic *efx) · 362 unmodified lines
710718 nic_data->must_restore_filters = true;
711719 nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
712720
721+ /* The datapath firmware might have been changed */
722+ nic_data->must_check_datapath_caps = true;
723+
724+ /* MAC statistics have been cleared on the NIC; clear the local
725+ * statistic that we update with efx_update_diff_stat().
726+ */
727+ nic_data->stats[EF10_STAT_rx_bad_bytes] = 0;
728+
713729 return -EIO;
714730 }
715731
drivers/net/ethernet/sfc/mcdi.c+5−5
@@ -27,10 +27,10 @@ · 26 unmodified lines
2727
2828 /* A reboot/assertion causes the MCDI status word to be set after the
2929 * command word is set or a REBOOT event is sent. If we notice a reboot
30− * via these mechanisms then wait 20ms for the status word to be set.
30+ * via these mechanisms then wait 250ms for the status word to be set.
3131 */
3232 #define MCDI_STATUS_DELAY_US 100
33−#define MCDI_STATUS_DELAY_COUNT 200
33+#define MCDI_STATUS_DELAY_COUNT 2500
3434 #define MCDI_STATUS_SLEEP_MS \
3535 (MCDI_STATUS_DELAY_US * MCDI_STATUS_DELAY_COUNT / 1000)
3636
@@ -800,9 +800,6 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc) · 763 unmodified lines
800800 } else {
801801 int count;
802802
803− /* Nobody was waiting for an MCDI request, so trigger a reset */
804− efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE);
805−
806803 /* Consume the status word since efx_mcdi_rpc_finish() won't */
807804 for (count = 0; count < MCDI_STATUS_DELAY_COUNT; ++count) {
808805 if (efx_mcdi_poll_reboot(efx))
@@ -810,6 +807,9 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc) · 1 unmodified line
810807 udelay(MCDI_STATUS_DELAY_US);
811808 }
812809 mcdi->new_epoch = true;
810+
811+ /* Nobody was waiting for an MCDI request, so trigger a reset */
812+ efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE);
813813 }
814814
815815 spin_unlock(&mcdi->iface_lock);
drivers/net/ethernet/sfc/mcdi_port.c+2−0
@@ -556,6 +556,7 @@ static int efx_mcdi_phy_set_settings(struct efx_nic *efx, struct ethtool_cmd *ec · 555 unmodified lines
556556 case 100: caps = 1 << MC_CMD_PHY_CAP_100FDX_LBN; break;
557557 case 1000: caps = 1 << MC_CMD_PHY_CAP_1000FDX_LBN; break;
558558 case 10000: caps = 1 << MC_CMD_PHY_CAP_10000FDX_LBN; break;
559+ case 40000: caps = 1 << MC_CMD_PHY_CAP_40000FDX_LBN; break;
559560 default: return -EINVAL;
560561 }
561562 } else {
@@ -841,6 +842,7 @@ static unsigned int efx_mcdi_event_link_speed[] = { · 279 unmodified lines
841842 [MCDI_EVENT_LINKCHANGE_SPEED_100M] = 100,
842843 [MCDI_EVENT_LINKCHANGE_SPEED_1G] = 1000,
843844 [MCDI_EVENT_LINKCHANGE_SPEED_10G] = 10000,
845+ [MCDI_EVENT_LINKCHANGE_SPEED_40G] = 40000,
844846 };
845847
846848 void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev)
drivers/net/ethernet/sfc/nic.h+3−0
@@ -400,6 +400,8 @@ enum { · 399 unmodified lines
400400 * @rx_rss_context: Firmware handle for our RSS context
401401 * @stats: Hardware statistics
402402 * @workaround_35388: Flag: firmware supports workaround for bug 35388
403+ * @must_check_datapath_caps: Flag: @datapath_caps needs to be revalidated
404+ * after MC reboot
403405 * @datapath_caps: Capabilities of datapath firmware (FLAGS1 field of
404406 * %MC_CMD_GET_CAPABILITIES response)
405407 */
@@ -413,6 +415,7 @@ struct efx_ef10_nic_data { · 7 unmodified lines
413415 u32 rx_rss_context;
414416 u64 stats[EF10_STAT_COUNT];
415417 bool workaround_35388;
418+ bool must_check_datapath_caps;
416419 u32 datapath_caps;
417420 };
418421
drivers/net/ethernet/smsc/smc91x.h+1−1
@@ -271,7 +271,7 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l) · 270 unmodified lines
271271 #define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l)
272272 #define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l)
273273
274−#define SMC_IRQ_FLAGS (IRQF_DISABLED)
274+#define SMC_IRQ_FLAGS 0
275275
276276 #else
277277
drivers/net/ethernet/smsc/smsc9420.c+1−2
@@ -1356,8 +1356,7 @@ static int smsc9420_open(struct net_device *dev) · 1355 unmodified lines
13561356 smsc9420_reg_write(pd, INT_STAT, 0xFFFFFFFF);
13571357 smsc9420_pci_flush_write(pd);
13581358
1359− result = request_irq(irq, smsc9420_isr, IRQF_SHARED | IRQF_DISABLED,
1360− DRV_NAME, pd);
1359+ result = request_irq(irq, smsc9420_isr, IRQF_SHARED, DRV_NAME, pd);
13611360 if (result) {
13621361 smsc_warn(IFUP, "Unable to use IRQ = %d", irq);
13631362 result = -ENODEV;
drivers/net/ethernet/toshiba/ps3_gelic_net.c+1−1
@@ -1726,7 +1726,7 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev) · 1725 unmodified lines
17261726 goto fail_alloc_irq;
17271727 }
17281728 result = request_irq(card->irq, gelic_card_interrupt,
1729− IRQF_DISABLED, netdev->name, card);
1729+ 0, netdev->name, card);
17301730
17311731 if (result) {
17321732 dev_info(ctodev(card), "%s:request_irq failed (%d)\n",
drivers/net/ethernet/via/via-rhine.c+7−2
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
3333
3434 #define DRV_NAME "via-rhine"
35−#define DRV_VERSION "1.5.0"
35+#define DRV_VERSION "1.5.1"
3636 #define DRV_RELDATE "2010-10-09"
3737
3838 #include <linux/types.h>
@@ -1704,7 +1704,12 @@ static netdev_tx_t rhine_start_tx(struct sk_buff *skb, · 1665 unmodified lines
17041704 cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN));
17051705
17061706 if (unlikely(vlan_tx_tag_present(skb))) {
1707− rp->tx_ring[entry].tx_status = cpu_to_le32((vlan_tx_tag_get(skb)) << 16);
1707+ u16 vid_pcp = vlan_tx_tag_get(skb);
1708+
1709+ /* drop CFI/DEI bit, register needs VID and PCP */
1710+ vid_pcp = (vid_pcp & VLAN_VID_MASK) |
1711+ ((vid_pcp & VLAN_PRIO_MASK) >> 1);
1712+ rp->tx_ring[entry].tx_status = cpu_to_le32((vid_pcp) << 16);
17081713 /* request tagging */
17091714 rp->tx_ring[entry].desc_length |= cpu_to_le32(0x020000);
17101715 }
drivers/net/ethernet/xilinx/ll_temac_main.c+6−0
@@ -297,6 +297,12 @@ static int temac_dma_bd_init(struct net_device *ndev) · 296 unmodified lines
297297 lp->rx_bd_p + (sizeof(*lp->rx_bd_v) * (RX_BD_NUM - 1)));
298298 lp->dma_out(lp, TX_CURDESC_PTR, lp->tx_bd_p);
299299
300+ /* Init descriptor indexes */
301+ lp->tx_bd_ci = 0;
302+ lp->tx_bd_next = 0;
303+ lp->tx_bd_tail = 0;
304+ lp->rx_bd_ci = 0;
305+
300306 return 0;
301307
302308 out:
drivers/net/irda/mcs7780.c+23−17
@@ -191,8 +191,8 @@ static inline int mcs_setup_transceiver_vishay(struct mcs_cb *mcs) · 190 unmodified lines
191191 goto error;
192192
193193 ret = 0;
194− error:
195− return ret;
194+error:
195+ return ret;
196196 }
197197
198198 /* Setup a communication between mcs7780 and agilent chip. */
@@ -501,8 +501,11 @@ static inline int mcs_setup_urbs(struct mcs_cb *mcs) · 302 unmodified lines
501501 return 0;
502502
503503 mcs->rx_urb = usb_alloc_urb(0, GFP_KERNEL);
504− if (!mcs->rx_urb)
504+ if (!mcs->rx_urb) {
505+ usb_free_urb(mcs->tx_urb);
506+ mcs->tx_urb = NULL;
505507 return 0;
508+ }
506509
507510 return 1;
508511 }
@@ -643,9 +646,9 @@ static int mcs_speed_change(struct mcs_cb *mcs) · 134 unmodified lines
643646 ret = mcs_set_reg(mcs, MCS_MODE_REG, rval);
644647
645648 mcs->speed = mcs->new_speed;
646− error:
647− mcs->new_speed = 0;
648− return ret;
649+error:
650+ mcs->new_speed = 0;
651+ return ret;
649652 }
650653
651654 /* Ioctl calls not supported at this time. Can be an area of future work. */
@@ -738,17 +741,20 @@ static int mcs_net_open(struct net_device *netdev) · 86 unmodified lines
738741
739742 ret = mcs_receive_start(mcs);
740743 if (ret)
741− goto error3;
744+ goto error4;
742745
743746 netif_start_queue(netdev);
744747 return 0;
745748
746− error3:
747− irlap_close(mcs->irlap);
748− error2:
749− kfree_skb(mcs->rx_buff.skb);
750− error1:
751− return ret;
749+error4:
750+ usb_free_urb(mcs->rx_urb);
751+ usb_free_urb(mcs->tx_urb);
752+error3:
753+ irlap_close(mcs->irlap);
754+error2:
755+ kfree_skb(mcs->rx_buff.skb);
756+error1:
757+ return ret;
752758 }
753759
754760 /* Receive callback function. */
@@ -946,11 +952,11 @@ static int mcs_probe(struct usb_interface *intf, · 191 unmodified lines
946952 usb_set_intfdata(intf, mcs);
947953 return 0;
948954
949− error2:
950− free_netdev(ndev);
955+error2:
956+ free_netdev(ndev);
951957
952− error1:
953− return ret;
958+error1:
959+ return ret;
954960 }
955961
956962 /* The current device is removed, the USB layer tells us to shut down. */
drivers/net/loopback.c+1−0
@@ -146,6 +146,7 @@ static int loopback_dev_init(struct net_device *dev) · 145 unmodified lines
146146
147147 static void loopback_dev_free(struct net_device *dev)
148148 {
149+ dev_net(dev)->loopback_dev = NULL;
149150 free_percpu(dev->lstats);
150151 free_netdev(dev);
151152 }
drivers/net/netconsole.c+1−4
@@ -684,15 +684,12 @@ restart: · 683 unmodified lines
684684 case NETDEV_RELEASE:
685685 case NETDEV_JOIN:
686686 case NETDEV_UNREGISTER:
687− /*
688− * rtnl_lock already held
687+ /* rtnl_lock already held
689688 * we might sleep in __netpoll_cleanup()
690689 */
691690 spin_unlock_irqrestore(&target_list_lock, flags);
692691
693− mutex_lock(&nt->mutex);
694692 __netpoll_cleanup(&nt->np);
695− mutex_unlock(&nt->mutex);
696693
697694 spin_lock_irqsave(&target_list_lock, flags);
698695 dev_put(nt->np.dev);
drivers/net/phy/cicada.c+2−2
@@ -30,9 +30,9 @@ · 29 unmodified lines
3030 #include <linux/ethtool.h>
3131 #include <linux/phy.h>
3232
33−#include <asm/io.h>
33+#include <linux/io.h>
3434 #include <asm/irq.h>
35−#include <asm/uaccess.h>
35+#include <linux/uaccess.h>
3636
3737 /* Cicada Extended Control Register 1 */
3838 #define MII_CIS8201_EXT_CON1 0x17
drivers/net/ppp/pptp.c+1−1
@@ -281,7 +281,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb) · 280 unmodified lines
281281 nf_reset(skb);
282282
283283 skb->ip_summed = CHECKSUM_NONE;
284− ip_select_ident(iph, &rt->dst, NULL);
284+ ip_select_ident(skb, &rt->dst, NULL);
285285 ip_send_check(iph);
286286
287287 ip_local_out(skb);
drivers/net/slip/slip.c+3−0
@@ -429,11 +429,13 @@ static void slip_write_wakeup(struct tty_struct *tty) · 428 unmodified lines
429429 if (!sl || sl->magic != SLIP_MAGIC || !netif_running(sl->dev))
430430 return;
431431
432+ spin_lock(&sl->lock);
432433 if (sl->xleft <= 0) {
433434 /* Now serial buffer is almost free & we can start
434435 * transmission of another packet */
435436 sl->dev->stats.tx_packets++;
436437 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
438+ spin_unlock(&sl->lock);
437439 sl_unlock(sl);
438440 return;
439441 }
@@ -441,6 +443,7 @@ static void slip_write_wakeup(struct tty_struct *tty) · 1 unmodified line
441443 actual = tty->ops->write(tty, sl->xhead, sl->xleft);
442444 sl->xleft -= actual;
443445 sl->xhead += actual;
446+ spin_unlock(&sl->lock);
444447 }
445448
446449 static void sl_tx_timeout(struct net_device *dev)
drivers/net/tun.c+8−3
@@ -1641,11 +1641,11 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) · 1640 unmodified lines
16411641 INIT_LIST_HEAD(&tun->disabled);
16421642 err = tun_attach(tun, file, false);
16431643 if (err < 0)
1644− goto err_free_dev;
1644+ goto err_free_flow;
16451645
16461646 err = register_netdevice(tun->dev);
16471647 if (err < 0)
1648− goto err_free_dev;
1648+ goto err_detach;
16491649
16501650 if (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
16511651 device_create_file(&tun->dev->dev, &dev_attr_owner) ||
@@ -1689,7 +1689,12 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) · 37 unmodified lines
16891689 strcpy(ifr->ifr_name, tun->dev->name);
16901690 return 0;
16911691
1692− err_free_dev:
1692+err_detach:
1693+ tun_detach_all(dev);
1694+err_free_flow:
1695+ tun_flow_uninit(tun);
1696+ security_tun_dev_free_security(tun->security);
1697+err_free_dev:
16931698 free_netdev(dev);
16941699 return err;
16951700 }
drivers/net/usb/cdc_ether.c+42−73
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #include <linux/usb/usbnet.h>
3434
3535
36−#if defined(CONFIG_USB_NET_RNDIS_HOST) || defined(CONFIG_USB_NET_RNDIS_HOST_MODULE)
36+#if IS_ENABLED(CONFIG_USB_NET_RNDIS_HOST)
3737
3838 static int is_rndis(struct usb_interface_descriptor *desc)
3939 {
@@ -69,8 +69,7 @@ static const u8 mbm_guid[16] = { · 29 unmodified lines
6969 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a,
7070 };
7171
72−/*
73− * probes control interface, claims data interface, collects the bulk
72+/* probes control interface, claims data interface, collects the bulk
7473 * endpoints, activates data interface (if needed), maybe sets MTU.
7574 * all pure cdc, except for certain firmware workarounds, and knowing
7675 * that rndis uses one different rule.
@@ -88,7 +87,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) · 11 unmodified lines
8887 struct usb_cdc_mdlm_desc *desc = NULL;
8988 struct usb_cdc_mdlm_detail_desc *detail = NULL;
9089
91− if (sizeof dev->data < sizeof *info)
90+ if (sizeof(dev->data) < sizeof(*info))
9291 return -EDOM;
9392
9493 /* expect strict spec conformance for the descriptors, but
@@ -126,10 +125,10 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) · 31 unmodified lines
126125 is_activesync(&intf->cur_altsetting->desc) ||
127126 is_wireless_rndis(&intf->cur_altsetting->desc));
128127
129− memset(info, 0, sizeof *info);
128+ memset(info, 0, sizeof(*info));
130129 info->control = intf;
131130 while (len > 3) {
132− if (buf [1] != USB_DT_CS_INTERFACE)
131+ if (buf[1] != USB_DT_CS_INTERFACE)
133132 goto next_desc;
134133
135134 /* use bDescriptorSubType to identify the CDC descriptors.
@@ -139,14 +138,14 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) · 3 unmodified lines
139138 * in favor of a complicated OID-based RPC scheme doing what
140139 * CDC Ethernet achieves with a simple descriptor.
141140 */
142− switch (buf [2]) {
141+ switch (buf[2]) {
143142 case USB_CDC_HEADER_TYPE:
144143 if (info->header) {
145144 dev_dbg(&intf->dev, "extra CDC header\n");
146145 goto bad_desc;
147146 }
148147 info->header = (void *) buf;
149− if (info->header->bLength != sizeof *info->header) {
148+ if (info->header->bLength != sizeof(*info->header)) {
150149 dev_dbg(&intf->dev, "CDC header len %u\n",
151150 info->header->bLength);
152151 goto bad_desc;
@@ -175,7 +174,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) · 22 unmodified lines
175174 goto bad_desc;
176175 }
177176 info->u = (void *) buf;
178− if (info->u->bLength != sizeof *info->u) {
177+ if (info->u->bLength != sizeof(*info->u)) {
179178 dev_dbg(&intf->dev, "CDC union len %u\n",
180179 info->u->bLength);
181180 goto bad_desc;
@@ -233,7 +232,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) · 51 unmodified lines
233232 goto bad_desc;
234233 }
235234 info->ether = (void *) buf;
236− if (info->ether->bLength != sizeof *info->ether) {
235+ if (info->ether->bLength != sizeof(*info->ether)) {
237236 dev_dbg(&intf->dev, "CDC ether len %u\n",
238237 info->ether->bLength);
239238 goto bad_desc;
@@ -274,8 +273,8 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) · 34 unmodified lines
274273 break;
275274 }
276275 next_desc:
277− len -= buf [0]; /* bLength */
278− buf += buf [0];
276+ len -= buf[0]; /* bLength */
277+ buf += buf[0];
279278 }
280279
281280 /* Microsoft ActiveSync based and some regular RNDIS devices lack the
@@ -379,9 +378,7 @@ void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf) · 97 unmodified lines
379378 }
380379 EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);
381380
382−/*-------------------------------------------------------------------------
383− *
384− * Communications Device Class, Ethernet Control model
381+/* Communications Device Class, Ethernet Control model
385382 *
386383 * Takes two interfaces. The DATA interface is inactive till an altsetting
387384 * is selected. Configuration data includes class descriptors. There's
@@ -389,8 +386,7 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_unbind); · 1 unmodified line
389386 *
390387 * This should interop with whatever the 2.4 "CDCEther.c" driver
391388 * (by Brad Hards) talked with, with more functionality.
392− *
393− *-------------------------------------------------------------------------*/
389+ */
394390
395391 static void dumpspeed(struct usbnet *dev, __le32 *speeds)
396392 {
@@ -404,7 +400,7 @@ void usbnet_cdc_status(struct usbnet *dev, struct urb *urb) · 7 unmodified lines
404400 {
405401 struct usb_cdc_notification *event;
406402
407− if (urb->actual_length < sizeof *event)
403+ if (urb->actual_length < sizeof(*event))
408404 return;
409405
410406 /* SPEED_CHANGE can get split into two 8-byte packets */
@@ -423,7 +419,7 @@ void usbnet_cdc_status(struct usbnet *dev, struct urb *urb) · 12 unmodified lines
423419 case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */
424420 netif_dbg(dev, timer, dev->net, "CDC: speed change (len %d)\n",
425421 urb->actual_length);
426− if (urb->actual_length != (sizeof *event + 8))
422+ if (urb->actual_length != (sizeof(*event) + 8))
427423 set_bit(EVENT_STS_SPLIT, &dev->flags);
428424 else
429425 dumpspeed(dev, (__le32 *) &event[1]);
@@ -469,7 +465,6 @@ EXPORT_SYMBOL_GPL(usbnet_cdc_bind); · 39 unmodified lines
469465 static const struct driver_info cdc_info = {
470466 .description = "CDC Ethernet Device",
471467 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
472− // .check_connect = cdc_check_connect,
473468 .bind = usbnet_cdc_bind,
474469 .unbind = usbnet_cdc_unbind,
475470 .status = usbnet_cdc_status,
@@ -493,9 +488,8 @@ static const struct driver_info wwan_info = { · 17 unmodified lines
493488 #define DELL_VENDOR_ID 0x413C
494489 #define REALTEK_VENDOR_ID 0x0bda
495490
496−static const struct usb_device_id products [] = {
497−/*
498− * BLACKLIST !!
491+static const struct usb_device_id products[] = {
492+/* BLACKLIST !!
499493 *
500494 * First blacklist any products that are egregiously nonconformant
501495 * with the CDC Ethernet specs. Minor braindamage we cope with; when
@@ -542,7 +536,7 @@ static const struct usb_device_id products [] = { · 40 unmodified lines
542536 .driver_info = 0,
543537 }, {
544538 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
545− | USB_DEVICE_ID_MATCH_DEVICE,
539+ | USB_DEVICE_ID_MATCH_DEVICE,
546540 .idVendor = 0x04DD,
547541 .idProduct = 0x8007, /* C-700 */
548542 ZAURUS_MASTER_INTERFACE,
@@ -659,8 +653,7 @@ static const struct usb_device_id products [] = { · 110 unmodified lines
659653 .driver_info = 0,
660654 },
661655
662−/*
663− * WHITELIST!!!
656+/* WHITELIST!!!
664657 *
665658 * CDC Ether uses two interfaces, not necessarily consecutive.
666659 * We match the main interface, ignoring the optional device
@@ -672,59 +665,39 @@ static const struct usb_device_id products [] = { · 5 unmodified lines
672665 */
673666 {
674667 /* ZTE (Vodafone) K3805-Z */
675− .match_flags = USB_DEVICE_ID_MATCH_VENDOR
676− | USB_DEVICE_ID_MATCH_PRODUCT
677− | USB_DEVICE_ID_MATCH_INT_INFO,
678− .idVendor = ZTE_VENDOR_ID,
679− .idProduct = 0x1003,
680− .bInterfaceClass = USB_CLASS_COMM,
681− .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
682− .bInterfaceProtocol = USB_CDC_PROTO_NONE,
668+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1003, USB_CLASS_COMM,
669+ USB_CDC_SUBCLASS_ETHERNET,
670+ USB_CDC_PROTO_NONE),
683671 .driver_info = (unsigned long)&wwan_info,
684672 }, {
685673 /* ZTE (Vodafone) K3806-Z */
686− .match_flags = USB_DEVICE_ID_MATCH_VENDOR
687− | USB_DEVICE_ID_MATCH_PRODUCT
688− | USB_DEVICE_ID_MATCH_INT_INFO,
689− .idVendor = ZTE_VENDOR_ID,
690− .idProduct = 0x1015,
691− .bInterfaceClass = USB_CLASS_COMM,
692− .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
693− .bInterfaceProtocol = USB_CDC_PROTO_NONE,
674+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1015, USB_CLASS_COMM,
675+ USB_CDC_SUBCLASS_ETHERNET,
676+ USB_CDC_PROTO_NONE),
694677 .driver_info = (unsigned long)&wwan_info,
695678 }, {
696679 /* ZTE (Vodafone) K4510-Z */
697− .match_flags = USB_DEVICE_ID_MATCH_VENDOR
698− | USB_DEVICE_ID_MATCH_PRODUCT
699− | USB_DEVICE_ID_MATCH_INT_INFO,
700− .idVendor = ZTE_VENDOR_ID,
701− .idProduct = 0x1173,
702− .bInterfaceClass = USB_CLASS_COMM,
703− .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
704− .bInterfaceProtocol = USB_CDC_PROTO_NONE,
680+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1173, USB_CLASS_COMM,
681+ USB_CDC_SUBCLASS_ETHERNET,
682+ USB_CDC_PROTO_NONE),
705683 .driver_info = (unsigned long)&wwan_info,
706684 }, {
707685 /* ZTE (Vodafone) K3770-Z */
708− .match_flags = USB_DEVICE_ID_MATCH_VENDOR
709− | USB_DEVICE_ID_MATCH_PRODUCT
710− | USB_DEVICE_ID_MATCH_INT_INFO,
711− .idVendor = ZTE_VENDOR_ID,
712− .idProduct = 0x1177,
713− .bInterfaceClass = USB_CLASS_COMM,
714− .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
715− .bInterfaceProtocol = USB_CDC_PROTO_NONE,
686+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1177, USB_CLASS_COMM,
687+ USB_CDC_SUBCLASS_ETHERNET,
688+ USB_CDC_PROTO_NONE),
716689 .driver_info = (unsigned long)&wwan_info,
717690 }, {
718691 /* ZTE (Vodafone) K3772-Z */
719− .match_flags = USB_DEVICE_ID_MATCH_VENDOR
720− | USB_DEVICE_ID_MATCH_PRODUCT
721− | USB_DEVICE_ID_MATCH_INT_INFO,
722− .idVendor = ZTE_VENDOR_ID,
723− .idProduct = 0x1181,
724− .bInterfaceClass = USB_CLASS_COMM,
725− .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
726− .bInterfaceProtocol = USB_CDC_PROTO_NONE,
692+ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1181, USB_CLASS_COMM,
693+ USB_CDC_SUBCLASS_ETHERNET,
694+ USB_CDC_PROTO_NONE),
727695 .driver_info = (unsigned long)&wwan_info,
696+}, {
697+ /* Telit modules */
698+ USB_VENDOR_AND_INTERFACE_INFO(0x1bc7, USB_CLASS_COMM,
699+ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
700+ .driver_info = (kernel_ulong_t) &wwan_info,
728701 }, {
729702 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
730703 USB_CDC_PROTO_NONE),
@@ -736,15 +709,11 @@ static const struct usb_device_id products [] = { · 5 unmodified lines
736709
737710 }, {
738711 /* Various Huawei modems with a network port like the UMG1831 */
739− .match_flags = USB_DEVICE_ID_MATCH_VENDOR
740− | USB_DEVICE_ID_MATCH_INT_INFO,
741− .idVendor = HUAWEI_VENDOR_ID,
742− .bInterfaceClass = USB_CLASS_COMM,
743− .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
744− .bInterfaceProtocol = 255,
712+ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_COMM,
713+ USB_CDC_SUBCLASS_ETHERNET, 255),
745714 .driver_info = (unsigned long)&wwan_info,
746715 },
747− { }, // END
716+ { }, /* END */
748717 };
749718 MODULE_DEVICE_TABLE(usb, products);
750719
drivers/net/usb/dm9601.c+1−1
@@ -303,7 +303,7 @@ static void dm9601_set_multicast(struct net_device *net) · 302 unmodified lines
303303 rx_ctl |= 0x02;
304304 } else if (net->flags & IFF_ALLMULTI ||
305305 netdev_mc_count(net) > DM_MAX_MCAST) {
306− rx_ctl |= 0x04;
306+ rx_ctl |= 0x08;
307307 } else if (!netdev_mc_empty(net)) {
308308 struct netdev_hw_addr *ha;
309309
drivers/net/usb/qmi_wwan.c+1−1
@@ -714,7 +714,7 @@ static const struct usb_device_id products[] = { · 713 unmodified lines
714714 {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
715715 {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */
716716 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
717− {QMI_FIXED_INTF(0x1e2d, 0x12d1, 4)}, /* Cinterion PLxx */
717+ {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */
718718
719719 /* 4. Gobi 1000 devices */
720720 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
drivers/net/usb/usbnet.c+21−6
@@ -1241,7 +1241,9 @@ static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) · 1240 unmodified lines
12411241 if (num_sgs == 1)
12421242 return 0;
12431243
1244− urb->sg = kmalloc(num_sgs * sizeof(struct scatterlist), GFP_ATOMIC);
1244+ /* reserve one for zero packet */
1245+ urb->sg = kmalloc((num_sgs + 1) * sizeof(struct scatterlist),
1246+ GFP_ATOMIC);
12451247 if (!urb->sg)
12461248 return -ENOMEM;
12471249
@@ -1305,7 +1307,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, · 57 unmodified lines
13051307 if (build_dma_sg(skb, urb) < 0)
13061308 goto drop;
13071309 }
1308− entry->length = length = urb->transfer_buffer_length;
1310+ length = urb->transfer_buffer_length;
13091311
13101312 /* don't assume the hardware handles USB_ZERO_PACKET
13111313 * NOTE: strictly conforming cdc-ether devices should expect
@@ -1317,15 +1319,18 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, · 5 unmodified lines
13171319 if (length % dev->maxpacket == 0) {
13181320 if (!(info->flags & FLAG_SEND_ZLP)) {
13191321 if (!(info->flags & FLAG_MULTI_PACKET)) {
1320− urb->transfer_buffer_length++;
1321− if (skb_tailroom(skb)) {
1322+ length++;
1323+ if (skb_tailroom(skb) && !urb->num_sgs) {
13221324 skb->data[skb->len] = 0;
13231325 __skb_put(skb, 1);
1324− }
1326+ } else if (urb->num_sgs)
1327+ sg_set_buf(&urb->sg[urb->num_sgs++],
1328+ dev->padding_pkt, 1);
13251329 }
13261330 } else
13271331 urb->transfer_flags |= URB_ZERO_PACKET;
13281332 }
1333+ entry->length = urb->transfer_buffer_length = length;
13291334
13301335 spin_lock_irqsave(&dev->txq.lock, flags);
13311336 retval = usb_autopm_get_interface_async(dev->intf);
@@ -1509,6 +1514,7 @@ void usbnet_disconnect (struct usb_interface *intf) · 177 unmodified lines
15091514
15101515 usb_kill_urb(dev->interrupt);
15111516 usb_free_urb(dev->interrupt);
1517+ kfree(dev->padding_pkt);
15121518
15131519 free_netdev(net);
15141520 }
@@ -1679,9 +1685,16 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) · 164 unmodified lines
16791685 /* initialize max rx_qlen and tx_qlen */
16801686 usbnet_update_max_qlen(dev);
16811687
1688+ if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) &&
1689+ !(info->flags & FLAG_MULTI_PACKET)) {
1690+ dev->padding_pkt = kzalloc(1, GFP_KERNEL);
1691+ if (!dev->padding_pkt)
1692+ goto out4;
1693+ }
1694+
16821695 status = register_netdev (net);
16831696 if (status)
1684− goto out4;
1697+ goto out5;
16851698 netif_info(dev, probe, dev->net,
16861699 "register '%s' at usb-%s-%s, %s, %pM\n",
16871700 udev->dev.driver->name,
@@ -1699,6 +1712,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) · 11 unmodified lines
16991712
17001713 return 0;
17011714
1715+out5:
1716+ kfree(dev->padding_pkt);
17021717 out4:
17031718 usb_free_urb(dev->interrupt);
17041719 out3:
drivers/net/vxlan.c+24−25
@@ -564,7 +564,7 @@ static void vxlan_notify_add_rx_port(struct sock *sk) · 563 unmodified lines
564564 struct net_device *dev;
565565 struct net *net = sock_net(sk);
566566 sa_family_t sa_family = sk->sk_family;
567− u16 port = htons(inet_sk(sk)->inet_sport);
567+ __be16 port = inet_sk(sk)->inet_sport;
568568
569569 rcu_read_lock();
570570 for_each_netdev_rcu(net, dev) {
@@ -581,7 +581,7 @@ static void vxlan_notify_del_rx_port(struct sock *sk) · 10 unmodified lines
581581 struct net_device *dev;
582582 struct net *net = sock_net(sk);
583583 sa_family_t sa_family = sk->sk_family;
584− u16 port = htons(inet_sk(sk)->inet_sport);
584+ __be16 port = inet_sk(sk)->inet_sport;
585585
586586 rcu_read_lock();
587587 for_each_netdev_rcu(net, dev) {
@@ -952,8 +952,7 @@ void vxlan_sock_release(struct vxlan_sock *vs) · 364 unmodified lines
952952
953953 spin_lock(&vn->sock_lock);
954954 hlist_del_rcu(&vs->hlist);
955− smp_wmb();
956− vs->sock->sk->sk_user_data = NULL;
955+ rcu_assign_sk_user_data(vs->sock->sk, NULL);
957956 vxlan_notify_del_rx_port(sk);
958957 spin_unlock(&vn->sock_lock);
959958
@@ -1048,8 +1047,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) · 88 unmodified lines
10481047
10491048 port = inet_sk(sk)->inet_sport;
10501049
1051− smp_read_barrier_depends();
1052− vs = (struct vxlan_sock *)sk->sk_user_data;
1050+ vs = rcu_dereference_sk_user_data(sk);
10531051 if (!vs)
10541052 goto drop;
10551053
@@ -2021,7 +2019,8 @@ static struct device_type vxlan_type = { · 965 unmodified lines
20212019 };
20222020
20232021 /* Calls the ndo_add_vxlan_port of the caller in order to
2024− * supply the listening VXLAN udp ports.
2022+ * supply the listening VXLAN udp ports. Callers are expected
2023+ * to implement the ndo_add_vxlan_port.
20252024 */
20262025 void vxlan_get_rx_port(struct net_device *dev)
20272026 {
@@ -2029,16 +2028,13 @@ void vxlan_get_rx_port(struct net_device *dev) · 1 unmodified line
20292028 struct net *net = dev_net(dev);
20302029 struct vxlan_net *vn = net_generic(net, vxlan_net_id);
20312030 sa_family_t sa_family;
2032− u16 port;
2033− int i;
2034−
2035− if (!dev || !dev->netdev_ops || !dev->netdev_ops->ndo_add_vxlan_port)
2036− return;
2031+ __be16 port;
2032+ unsigned int i;
20372033
20382034 spin_lock(&vn->sock_lock);
20392035 for (i = 0; i < PORT_HASH_SIZE; ++i) {
2040− hlist_for_each_entry_rcu(vs, vs_head(net, i), hlist) {
2041− port = htons(inet_sk(vs->sock->sk)->inet_sport);
2036+ hlist_for_each_entry_rcu(vs, &vn->sock_list[i], hlist) {
2037+ port = inet_sk(vs->sock->sk)->inet_sport;
20422038 sa_family = vs->sock->sk->sk_family;
20432039 dev->netdev_ops->ndo_add_vxlan_port(dev, sa_family,
20442040 port);
@@ -2304,8 +2300,7 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, __be16 port, · 259 unmodified lines
23042300 atomic_set(&vs->refcnt, 1);
23052301 vs->rcv = rcv;
23062302 vs->data = data;
2307− smp_wmb();
2308− vs->sock->sk->sk_user_data = vs;
2303+ rcu_assign_sk_user_data(vs->sock->sk, vs);
23092304
23102305 spin_lock(&vn->sock_lock);
23112306 hlist_add_head_rcu(&vs->hlist, vs_head(net, port));
@@ -2492,15 +2487,19 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, · 180 unmodified lines
24922487
24932488 SET_ETHTOOL_OPS(dev, &vxlan_ethtool_ops);
24942489
2495− /* create an fdb entry for default destination */
2496− err = vxlan_fdb_create(vxlan, all_zeros_mac,
2497− &vxlan->default_dst.remote_ip,
2498− NUD_REACHABLE|NUD_PERMANENT,
2499− NLM_F_EXCL|NLM_F_CREATE,
2500− vxlan->dst_port, vxlan->default_dst.remote_vni,
2501− vxlan->default_dst.remote_ifindex, NTF_SELF);
2502− if (err)
2503− return err;
2490+ /* create an fdb entry for a valid default destination */
2491+ if (!vxlan_addr_any(&vxlan->default_dst.remote_ip)) {
2492+ err = vxlan_fdb_create(vxlan, all_zeros_mac,
2493+ &vxlan->default_dst.remote_ip,
2494+ NUD_REACHABLE|NUD_PERMANENT,
2495+ NLM_F_EXCL|NLM_F_CREATE,
2496+ vxlan->dst_port,
2497+ vxlan->default_dst.remote_vni,
2498+ vxlan->default_dst.remote_ifindex,
2499+ NTF_SELF);
2500+ if (err)
2501+ return err;
2502+ }
25042503
25052504 err = register_netdevice(dev);
25062505 if (err) {
drivers/net/wireless/ath/ath9k/recv.c+0−7
@@ -1269,13 +1269,6 @@ static void ath9k_antenna_check(struct ath_softc *sc, · 1268 unmodified lines
12691269 if (!(ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB))
12701270 return;
12711271
1272− /*
1273− * All MPDUs in an aggregate will use the same LNA
1274− * as the first MPDU.
1275− */
1276− if (rs->rs_isaggr && !rs->rs_firstaggr)
1277− return;
1278−
12791272 /*
12801273 * Change the default rx antenna if rx diversity
12811274 * chooses the other antenna 3 times in a row.
drivers/net/wireless/ath/ath9k/xmit.c+14−3
@@ -399,6 +399,7 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf) · 398 unmodified lines
399399 tbf->bf_buf_addr = bf->bf_buf_addr;
400400 memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len);
401401 tbf->bf_state = bf->bf_state;
402+ tbf->bf_state.stale = false;
402403
403404 return tbf;
404405 }
@@ -1389,11 +1390,15 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, · 984 unmodified lines
13891390 u16 tid, u16 *ssn)
13901391 {
13911392 struct ath_atx_tid *txtid;
1393+ struct ath_txq *txq;
13921394 struct ath_node *an;
13931395 u8 density;
13941396
13951397 an = (struct ath_node *)sta->drv_priv;
13961398 txtid = ATH_AN_2_TID(an, tid);
1399+ txq = txtid->ac->txq;
1400+
1401+ ath_txq_lock(sc, txq);
13971402
13981403 /* update ampdu factor/density, they may have changed. This may happen
13991404 * in HT IBSS when a beacon with HT-info is received after the station
@@ -1417,6 +1422,8 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, · 17 unmodified lines
14171422 memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf));
14181423 txtid->baw_head = txtid->baw_tail = 0;
14191424
1425+ ath_txq_unlock_complete(sc, txq);
1426+
14201427 return 0;
14211428 }
14221429
@@ -1555,8 +1562,10 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw, · 132 unmodified lines
15551562 __skb_unlink(bf->bf_mpdu, tid_q);
15561563 list_add_tail(&bf->list, &bf_q);
15571564 ath_set_rates(tid->an->vif, tid->an->sta, bf);
1558− ath_tx_addto_baw(sc, tid, bf);
1559− bf->bf_state.bf_type &= ~BUF_AGGR;
1565+ if (bf_isampdu(bf)) {
1566+ ath_tx_addto_baw(sc, tid, bf);
1567+ bf->bf_state.bf_type &= ~BUF_AGGR;
1568+ }
15601569 if (bf_tail)
15611570 bf_tail->bf_next = bf;
15621571
@@ -1950,7 +1959,9 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, · 387 unmodified lines
19501959 if (bf_is_ampdu_not_probing(bf))
19511960 txq->axq_ampdu_depth++;
19521961
1953− bf = bf->bf_lastbf->bf_next;
1962+ bf_last = bf->bf_lastbf;
1963+ bf = bf_last->bf_next;
1964+ bf_last->bf_next = NULL;
19541965 }
19551966 }
19561967 }
drivers/net/wireless/brcm80211/Kconfig+2−2
@@ -28,7 +28,7 @@ config BRCMFMAC · 27 unmodified lines
2828
2929 config BRCMFMAC_SDIO
3030 bool "SDIO bus interface support for FullMAC driver"
31− depends on MMC
31+ depends on (MMC = y || MMC = BRCMFMAC)
3232 depends on BRCMFMAC
3333 select FW_LOADER
3434 default y
@@ -39,7 +39,7 @@ config BRCMFMAC_SDIO · 4 unmodified lines
3939
4040 config BRCMFMAC_USB
4141 bool "USB bus interface support for FullMAC driver"
42− depends on USB
42+ depends on (USB = y || USB = BRCMFMAC)
4343 depends on BRCMFMAC
4444 select FW_LOADER
4545 ---help---
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c+13−15
@@ -464,8 +464,6 @@ static struct sdio_driver brcmf_sdmmc_driver = { · 463 unmodified lines
464464
465465 static int brcmf_sdio_pd_probe(struct platform_device *pdev)
466466 {
467− int ret;
468−
469467 brcmf_dbg(SDIO, "Enter\n");
470468
471469 brcmfmac_sdio_pdata = pdev->dev.platform_data;
@@ -473,11 +471,7 @@ static int brcmf_sdio_pd_probe(struct platform_device *pdev) · 1 unmodified line
473471 if (brcmfmac_sdio_pdata->power_on)
474472 brcmfmac_sdio_pdata->power_on();
475473
476− ret = sdio_register_driver(&brcmf_sdmmc_driver);
477− if (ret)
478− brcmf_err("sdio_register_driver failed: %d\n", ret);
479−
480− return ret;
474+ return 0;
481475 }
482476
483477 static int brcmf_sdio_pd_remove(struct platform_device *pdev)
@@ -500,6 +494,15 @@ static struct platform_driver brcmf_sdio_pd = { · 16 unmodified lines
500494 }
501495 };
502496
497+void brcmf_sdio_register(void)
498+{
499+ int ret;
500+
501+ ret = sdio_register_driver(&brcmf_sdmmc_driver);
502+ if (ret)
503+ brcmf_err("sdio_register_driver failed: %d\n", ret);
504+}
505+
503506 void brcmf_sdio_exit(void)
504507 {
505508 brcmf_dbg(SDIO, "Enter\n");
@@ -510,18 +513,13 @@ void brcmf_sdio_exit(void) · 4 unmodified lines
510513 sdio_unregister_driver(&brcmf_sdmmc_driver);
511514 }
512515
513−void brcmf_sdio_init(void)
516+void __init brcmf_sdio_init(void)
514517 {
515518 int ret;
516519
517520 brcmf_dbg(SDIO, "Enter\n");
518521
519522 ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe);
520− if (ret == -ENODEV) {
521− brcmf_dbg(SDIO, "No platform data available, registering without.\n");
522− ret = sdio_register_driver(&brcmf_sdmmc_driver);
523− }
524−
525− if (ret)
526− brcmf_err("driver registration failed: %d\n", ret);
523+ if (ret == -ENODEV)
524+ brcmf_dbg(SDIO, "No platform data available.\n");
527525 }
drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h+2−1
@@ -156,10 +156,11 @@ extern int brcmf_bus_start(struct device *dev); · 155 unmodified lines
156156 #ifdef CONFIG_BRCMFMAC_SDIO
157157 extern void brcmf_sdio_exit(void);
158158 extern void brcmf_sdio_init(void);
159+extern void brcmf_sdio_register(void);
159160 #endif
160161 #ifdef CONFIG_BRCMFMAC_USB
161162 extern void brcmf_usb_exit(void);
162−extern void brcmf_usb_init(void);
163+extern void brcmf_usb_register(void);
163164 #endif
164165
165166 #endif /* _BRCMF_BUS_H_ */
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c+8−6
@@ -1231,21 +1231,23 @@ u32 brcmf_get_chip_info(struct brcmf_if *ifp) · 1230 unmodified lines
12311231 return bus->chip << 4 | bus->chiprev;
12321232 }
12331233
1234−static void brcmf_driver_init(struct work_struct *work)
1234+static void brcmf_driver_register(struct work_struct *work)
12351235 {
1236− brcmf_debugfs_init();
1237−
12381236 #ifdef CONFIG_BRCMFMAC_SDIO
1239− brcmf_sdio_init();
1237+ brcmf_sdio_register();
12401238 #endif
12411239 #ifdef CONFIG_BRCMFMAC_USB
1242− brcmf_usb_init();
1240+ brcmf_usb_register();
12431241 #endif
12441242 }
1245−static DECLARE_WORK(brcmf_driver_work, brcmf_driver_init);
1243+static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register);
12461244
12471245 static int __init brcmfmac_module_init(void)
12481246 {
1247+ brcmf_debugfs_init();
1248+#ifdef CONFIG_BRCMFMAC_SDIO
1249+ brcmf_sdio_init();
1250+#endif
12491251 if (!schedule_work(&brcmf_driver_work))
12501252 return -EBUSY;
12511253
drivers/net/wireless/brcm80211/brcmfmac/usb.c+1−1
@@ -1539,7 +1539,7 @@ void brcmf_usb_exit(void) · 1538 unmodified lines
15391539 brcmf_release_fw(&fw_image_list);
15401540 }
15411541
1542−void brcmf_usb_init(void)
1542+void brcmf_usb_register(void)
15431543 {
15441544 brcmf_dbg(USB, "Enter\n");
15451545 INIT_LIST_HEAD(&fw_image_list);
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c+4−0
@@ -457,6 +457,8 @@ static int brcms_ops_start(struct ieee80211_hw *hw) · 456 unmodified lines
457457 if (err != 0)
458458 brcms_err(wl->wlc->hw->d11core, "%s: brcms_up() returned %d\n",
459459 __func__, err);
460+
461+ bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, true);
460462 return err;
461463 }
462464
@@ -479,6 +481,8 @@ static void brcms_ops_stop(struct ieee80211_hw *hw) · 16 unmodified lines
479481 return;
480482 }
481483
484+ bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, false);
485+
482486 /* put driver in down state */
483487 spin_lock_bh(&wl->lock);
484488 brcms_down(wl);
drivers/net/wireless/cw1200/cw1200_spi.c+13−3
@@ -40,6 +40,7 @@ struct hwbus_priv { · 39 unmodified lines
4040 struct cw1200_common *core;
4141 const struct cw1200_platform_data_spi *pdata;
4242 spinlock_t lock; /* Serialize all bus operations */
43+ wait_queue_head_t wq;
4344 int claimed;
4445 };
4546
@@ -197,8 +198,11 @@ static void cw1200_spi_lock(struct hwbus_priv *self) · 151 unmodified lines
197198 {
198199 unsigned long flags;
199200
201+ DECLARE_WAITQUEUE(wait, current);
202+
200203 might_sleep();
201204
205+ add_wait_queue(&self->wq, &wait);
202206 spin_lock_irqsave(&self->lock, flags);
203207 while (1) {
204208 set_current_state(TASK_UNINTERRUPTIBLE);
@@ -211,6 +215,7 @@ static void cw1200_spi_lock(struct hwbus_priv *self) · 6 unmodified lines
211215 set_current_state(TASK_RUNNING);
212216 self->claimed = 1;
213217 spin_unlock_irqrestore(&self->lock, flags);
218+ remove_wait_queue(&self->wq, &wait);
214219
215220 return;
216221 }
@@ -222,6 +227,8 @@ static void cw1200_spi_unlock(struct hwbus_priv *self) · 5 unmodified lines
222227 spin_lock_irqsave(&self->lock, flags);
223228 self->claimed = 0;
224229 spin_unlock_irqrestore(&self->lock, flags);
230+ wake_up(&self->wq);
231+
225232 return;
226233 }
227234
@@ -243,9 +250,10 @@ static int cw1200_spi_irq_subscribe(struct hwbus_priv *self) · 15 unmodified lines
243250
244251 pr_debug("SW IRQ subscribe\n");
245252
246− ret = request_any_context_irq(self->func->irq, cw1200_spi_irq_handler,
247− IRQF_TRIGGER_HIGH,
248− "cw1200_wlan_irq", self);
253+ ret = request_threaded_irq(self->func->irq, NULL,
254+ cw1200_spi_irq_handler,
255+ IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
256+ "cw1200_wlan_irq", self);
249257 if (WARN_ON(ret < 0))
250258 goto exit;
251259
@@ -400,6 +408,8 @@ static int cw1200_spi_probe(struct spi_device *func) · 148 unmodified lines
400408
401409 spi_set_drvdata(func, self);
402410
411+ init_waitqueue_head(&self->wq);
412+
403413 status = cw1200_spi_irq_subscribe(self);
404414
405415 status = cw1200_core_probe(&cw1200_spi_hwbus_ops,
drivers/net/wireless/mwifiex/11n_aggr.c+2−1
@@ -150,7 +150,7 @@ mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv, · 149 unmodified lines
150150 */
151151 int
152152 mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
153− struct mwifiex_ra_list_tbl *pra_list, int headroom,
153+ struct mwifiex_ra_list_tbl *pra_list,
154154 int ptrindex, unsigned long ra_list_flags)
155155 __releases(&priv->wmm.ra_list_spinlock)
156156 {
@@ -160,6 +160,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, · 3 unmodified lines
160160 int pad = 0, ret;
161161 struct mwifiex_tx_param tx_param;
162162 struct txpd *ptx_pd = NULL;
163+ int headroom = adapter->iface_type == MWIFIEX_USB ? 0 : INTF_HEADER_LEN;
163164
164165 skb_src = skb_peek(&pra_list->skb_head);
165166 if (!skb_src) {
drivers/net/wireless/mwifiex/11n_aggr.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv,
2727 struct sk_buff *skb);
2828 int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
29− struct mwifiex_ra_list_tbl *ptr, int headroom,
29+ struct mwifiex_ra_list_tbl *ptr,
3030 int ptr_index, unsigned long flags)
3131 __releases(&priv->wmm.ra_list_spinlock);
3232
drivers/net/wireless/mwifiex/cmdevt.c+2−3
@@ -1155,7 +1155,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, · 1154 unmodified lines
11551155 uint32_t conditions = le32_to_cpu(phs_cfg->params.hs_config.conditions);
11561156
11571157 if (phs_cfg->action == cpu_to_le16(HS_ACTIVATE) &&
1158− adapter->iface_type == MWIFIEX_SDIO) {
1158+ adapter->iface_type != MWIFIEX_USB) {
11591159 mwifiex_hs_activated_event(priv, true);
11601160 return 0;
11611161 } else {
@@ -1167,8 +1167,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, · 5 unmodified lines
11671167 }
11681168 if (conditions != HS_CFG_CANCEL) {
11691169 adapter->is_hs_configured = true;
1170− if (adapter->iface_type == MWIFIEX_USB ||
1171− adapter->iface_type == MWIFIEX_PCIE)
1170+ if (adapter->iface_type == MWIFIEX_USB)
11721171 mwifiex_hs_activated_event(priv, true);
11731172 } else {
11741173 adapter->is_hs_configured = false;
drivers/net/wireless/mwifiex/usb.c+0−7
@@ -447,9 +447,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message) · 446 unmodified lines
447447 */
448448 adapter->is_suspended = true;
449449
450− for (i = 0; i < adapter->priv_num; i++)
451− netif_carrier_off(adapter->priv[i]->netdev);
452−
453450 if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb)
454451 usb_kill_urb(card->rx_cmd.urb);
455452
@@ -509,10 +506,6 @@ static int mwifiex_usb_resume(struct usb_interface *intf) · 53 unmodified lines
509506 MWIFIEX_RX_CMD_BUF_SIZE);
510507 }
511508
512− for (i = 0; i < adapter->priv_num; i++)
513− if (adapter->priv[i]->media_connected)
514− netif_carrier_on(adapter->priv[i]->netdev);
515−
516509 /* Disable Host Sleep */
517510 if (adapter->hs_activated)
518511 mwifiex_cancel_hs(mwifiex_get_priv(adapter,
drivers/net/wireless/mwifiex/wmm.c+1−2
@@ -1239,8 +1239,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) · 1238 unmodified lines
12391239 if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) &&
12401240 mwifiex_is_11n_aggragation_possible(priv, ptr,
12411241 adapter->tx_buf_size))
1242− mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN,
1243− ptr_index, flags);
1242+ mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags);
12441243 /* ra_list_spinlock has been freed in
12451244 mwifiex_11n_aggregate_pkt() */
12461245 else
drivers/net/wireless/p54/p54usb.c+2−0
@@ -83,6 +83,7 @@ static struct usb_device_id p54u_table[] = { · 82 unmodified lines
8383 {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */
8484 {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
8585 {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
86+ {USB_DEVICE(0x07aa, 0x0020)}, /* Corega WLUSB2GTST USB */
8687 {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */
8788 {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
8889 {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */
@@ -979,6 +980,7 @@ static int p54u_load_firmware(struct ieee80211_hw *dev, · 890 unmodified lines
979980 if (err) {
980981 dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s "
981982 "(%d)!\n", p54u_fwlist[i].fw, err);
983+ usb_put_dev(udev);
982984 }
983985
984986 return err;
drivers/net/wireless/rt2x00/rt2800lib.c+6−5
@@ -6659,19 +6659,20 @@ int rt2800_enable_radio(struct rt2x00_dev *rt2x00dev) · 6658 unmodified lines
66596659 rt2800_init_registers(rt2x00dev)))
66606660 return -EIO;
66616661
6662+ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev)))
6663+ return -EIO;
6664+
66626665 /*
66636666 * Send signal to firmware during boot time.
66646667 */
66656668 rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
66666669 rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
6667− if (rt2x00_is_usb(rt2x00dev)) {
6670+ if (rt2x00_is_usb(rt2x00dev))
66686671 rt2800_register_write(rt2x00dev, H2M_INT_SRC, 0);
6669− rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
6670− }
6672+ rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
66716673 msleep(1);
66726674
6673− if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev) ||
6674− rt2800_wait_bbp_ready(rt2x00dev)))
6675+ if (unlikely(rt2800_wait_bbp_ready(rt2x00dev)))
66756676 return -EIO;
66766677
66776678 rt2800_init_bbp(rt2x00dev);
drivers/net/wireless/rtl818x/rtl8187/dev.c+10−5
@@ -438,17 +438,16 @@ static int rtl8187_init_urbs(struct ieee80211_hw *dev) · 437 unmodified lines
438438 skb_queue_tail(&priv->rx_queue, skb);
439439 usb_anchor_urb(entry, &priv->anchored);
440440 ret = usb_submit_urb(entry, GFP_KERNEL);
441+ usb_put_urb(entry);
441442 if (ret) {
442443 skb_unlink(skb, &priv->rx_queue);
443444 usb_unanchor_urb(entry);
444445 goto err;
445446 }
446− usb_free_urb(entry);
447447 }
448448 return ret;
449449
450450 err:
451− usb_free_urb(entry);
452451 kfree_skb(skb);
453452 usb_kill_anchored_urbs(&priv->anchored);
454453 return ret;
@@ -956,8 +955,12 @@ static int rtl8187_start(struct ieee80211_hw *dev) · 501 unmodified lines
956955 (RETRY_COUNT << 8 /* short retry limit */) |
957956 (RETRY_COUNT << 0 /* long retry limit */) |
958957 (7 << 21 /* MAX TX DMA */));
959− rtl8187_init_urbs(dev);
960− rtl8187b_init_status_urb(dev);
958+ ret = rtl8187_init_urbs(dev);
959+ if (ret)
960+ goto rtl8187_start_exit;
961+ ret = rtl8187b_init_status_urb(dev);
962+ if (ret)
963+ usb_kill_anchored_urbs(&priv->anchored);
961964 goto rtl8187_start_exit;
962965 }
963966
@@ -966,7 +969,9 @@ static int rtl8187_start(struct ieee80211_hw *dev) · 2 unmodified lines
966969 rtl818x_iowrite32(priv, &priv->map->MAR[0], ~0);
967970 rtl818x_iowrite32(priv, &priv->map->MAR[1], ~0);
968971
969− rtl8187_init_urbs(dev);
972+ ret = rtl8187_init_urbs(dev);
973+ if (ret)
974+ goto rtl8187_start_exit;
970975
971976 reg = RTL818X_RX_CONF_ONLYERLPKT |
972977 RTL818X_RX_CONF_RX_AUTORESETPHY |
drivers/net/wireless/rtlwifi/wifi.h+1−1
@@ -2057,7 +2057,7 @@ struct rtl_priv { · 2056 unmodified lines
20572057 that it points to the data allocated
20582058 beyond this structure like:
20592059 rtl_pci_priv or rtl_usb_priv */
2060− u8 priv[0];
2060+ u8 priv[0] __aligned(sizeof(void *));
20612061 };
20622062
20632063 #define rtl_priv(hw) (((struct rtl_priv *)(hw)->priv))
drivers/net/xen-netback/common.h+1−0
@@ -184,6 +184,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref, · 183 unmodified lines
184184 unsigned long rx_ring_ref, unsigned int tx_evtchn,
185185 unsigned int rx_evtchn);
186186 void xenvif_disconnect(struct xenvif *vif);
187+void xenvif_free(struct xenvif *vif);
187188
188189 int xenvif_xenbus_init(void);
189190 void xenvif_xenbus_fini(void);
drivers/net/xen-netback/interface.c+11−17
@@ -353,6 +353,9 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, · 352 unmodified lines
353353 }
354354
355355 netdev_dbg(dev, "Successfully created xenvif\n");
356+
357+ __module_get(THIS_MODULE);
358+
356359 return vif;
357360 }
358361
@@ -366,8 +369,6 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref, · 7 unmodified lines
366369 if (vif->tx_irq)
367370 return 0;
368371
369− __module_get(THIS_MODULE);
370−
371372 err = xenvif_map_frontend_rings(vif, tx_ring_ref, rx_ring_ref);
372373 if (err < 0)
373374 goto err;
@@ -406,7 +407,7 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref, · 32 unmodified lines
406407
407408 init_waitqueue_head(&vif->wq);
408409 vif->task = kthread_create(xenvif_kthread,
409− (void *)vif, vif->dev->name);
410+ (void *)vif, "%s", vif->dev->name);
410411 if (IS_ERR(vif->task)) {
411412 pr_warn("Could not allocate kthread for %s\n", vif->dev->name);
412413 err = PTR_ERR(vif->task);
@@ -452,12 +453,6 @@ void xenvif_carrier_off(struct xenvif *vif) · 39 unmodified lines
452453
453454 void xenvif_disconnect(struct xenvif *vif)
454455 {
455− /* Disconnect funtion might get called by generic framework
456− * even before vif connects, so we need to check if we really
457− * need to do a module_put.
458− */
459− int need_module_put = 0;
460−
461456 if (netif_carrier_ok(vif->dev))
462457 xenvif_carrier_off(vif);
463458
@@ -468,23 +463,22 @@ void xenvif_disconnect(struct xenvif *vif) · 4 unmodified lines
468463 unbind_from_irqhandler(vif->tx_irq, vif);
469464 unbind_from_irqhandler(vif->rx_irq, vif);
470465 }
471− /* vif->irq is valid, we had a module_get in
472− * xenvif_connect.
473− */
474− need_module_put = 1;
466+ vif->tx_irq = 0;
475467 }
476468
477469 if (vif->task)
478470 kthread_stop(vif->task);
479471
472+ xenvif_unmap_frontend_rings(vif);
473+}
474+
475+void xenvif_free(struct xenvif *vif)
476+{
480477 netif_napi_del(&vif->napi);
481478
482479 unregister_netdev(vif->dev);
483480
484− xenvif_unmap_frontend_rings(vif);
485−
486481 free_netdev(vif->dev);
487482
488− if (need_module_put)
489− module_put(THIS_MODULE);
483+ module_put(THIS_MODULE);
490484 }
drivers/net/xen-netback/netback.c+64−30
@@ -212,6 +212,49 @@ static bool start_new_rx_buffer(int offset, unsigned long size, int head) · 211 unmodified lines
212212 return false;
213213 }
214214
215+struct xenvif_count_slot_state {
216+ unsigned long copy_off;
217+ bool head;
218+};
219+
220+unsigned int xenvif_count_frag_slots(struct xenvif *vif,
221+ unsigned long offset, unsigned long size,
222+ struct xenvif_count_slot_state *state)
223+{
224+ unsigned count = 0;
225+
226+ offset &= ~PAGE_MASK;
227+
228+ while (size > 0) {
229+ unsigned long bytes;
230+
231+ bytes = PAGE_SIZE - offset;
232+
233+ if (bytes > size)
234+ bytes = size;
235+
236+ if (start_new_rx_buffer(state->copy_off, bytes, state->head)) {
237+ count++;
238+ state->copy_off = 0;
239+ }
240+
241+ if (state->copy_off + bytes > MAX_BUFFER_OFFSET)
242+ bytes = MAX_BUFFER_OFFSET - state->copy_off;
243+
244+ state->copy_off += bytes;
245+
246+ offset += bytes;
247+ size -= bytes;
248+
249+ if (offset == PAGE_SIZE)
250+ offset = 0;
251+
252+ state->head = false;
253+ }
254+
255+ return count;
256+}
257+
215258 /*
216259 * Figure out how many ring slots we're going to need to send @skb to
217260 * the guest. This function is essentially a dry run of
@@ -219,48 +262,39 @@ static bool start_new_rx_buffer(int offset, unsigned long size, int head) · 1 unmodified line
219262 */
220263 unsigned int xenvif_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)
221264 {
265+ struct xenvif_count_slot_state state;
222266 unsigned int count;
223− int i, copy_off;
267+ unsigned char *data;
268+ unsigned i;
224269
225− count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE);
270+ state.head = true;
271+ state.copy_off = 0;
226272
227− copy_off = skb_headlen(skb) % PAGE_SIZE;
273+ /* Slot for the first (partial) page of data. */
274+ count = 1;
228275
276+ /* Need a slot for the GSO prefix for GSO extra data? */
229277 if (skb_shinfo(skb)->gso_size)
230278 count++;
231279
232− for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
233− unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
234− unsigned long offset = skb_shinfo(skb)->frags[i].page_offset;
235− unsigned long bytes;
236−
237− offset &= ~PAGE_MASK;
238−
239− while (size > 0) {
240− BUG_ON(offset >= PAGE_SIZE);
241− BUG_ON(copy_off > MAX_BUFFER_OFFSET);
242−
243− bytes = PAGE_SIZE - offset;
244−
245− if (bytes > size)
246− bytes = size;
280+ data = skb->data;
281+ while (data < skb_tail_pointer(skb)) {
282+ unsigned long offset = offset_in_page(data);
283+ unsigned long size = PAGE_SIZE - offset;
247284
248− if (start_new_rx_buffer(copy_off, bytes, 0)) {
249− count++;
250− copy_off = 0;
251− }
285+ if (data + size > skb_tail_pointer(skb))
286+ size = skb_tail_pointer(skb) - data;
252287
253− if (copy_off + bytes > MAX_BUFFER_OFFSET)
254− bytes = MAX_BUFFER_OFFSET - copy_off;
288+ count += xenvif_count_frag_slots(vif, offset, size, &state);
255289
256− copy_off += bytes;
290+ data += size;
291+ }
257292
258− offset += bytes;
259− size -= bytes;
293+ for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
294+ unsigned long size = skb_frag_size(&skb_shinfo(skb)->frags[i]);
295+ unsigned long offset = skb_shinfo(skb)->frags[i].page_offset;
260296
261− if (offset == PAGE_SIZE)
262− offset = 0;
263− }
297+ count += xenvif_count_frag_slots(vif, offset, size, &state);
264298 }
265299 return count;
266300 }
drivers/net/xen-netback/xenbus.c+123−28
@@ -24,6 +24,12 @@ · 23 unmodified lines
2424 struct backend_info {
2525 struct xenbus_device *dev;
2626 struct xenvif *vif;
27+
28+ /* This is the state that will be reflected in xenstore when any
29+ * active hotplug script completes.
30+ */
31+ enum xenbus_state state;
32+
2733 enum xenbus_state frontend_state;
2834 struct xenbus_watch hotplug_status_watch;
2935 u8 have_hotplug_status_watch:1;
@@ -42,7 +48,7 @@ static int netback_remove(struct xenbus_device *dev) · 12 unmodified lines
4248 if (be->vif) {
4349 kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
4450 xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
45− xenvif_disconnect(be->vif);
51+ xenvif_free(be->vif);
4652 be->vif = NULL;
4753 }
4854 kfree(be);
@@ -136,6 +142,8 @@ static int netback_probe(struct xenbus_device *dev, · 87 unmodified lines
136142 if (err)
137143 goto fail;
138144
145+ be->state = XenbusStateInitWait;
146+
139147 /* This kicks hotplug scripts, so do it immediately. */
140148 backend_create_xenvif(be);
141149
@@ -208,15 +216,113 @@ static void backend_create_xenvif(struct backend_info *be) · 66 unmodified lines
208216 kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
209217 }
210218
219+static void backend_disconnect(struct backend_info *be)
220+{
221+ if (be->vif)
222+ xenvif_disconnect(be->vif);
223+}
211224
212−static void disconnect_backend(struct xenbus_device *dev)
225+static void backend_connect(struct backend_info *be)
213226 {
214− struct backend_info *be = dev_get_drvdata(&dev->dev);
227+ if (be->vif)
228+ connect(be);
229+}
215230
216− if (be->vif) {
217− xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
218− xenvif_disconnect(be->vif);
219− be->vif = NULL;
231+static inline void backend_switch_state(struct backend_info *be,
232+ enum xenbus_state state)
233+{
234+ struct xenbus_device *dev = be->dev;
235+
236+ pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
237+ be->state = state;
238+
239+ /* If we are waiting for a hotplug script then defer the
240+ * actual xenbus state change.
241+ */
242+ if (!be->have_hotplug_status_watch)
243+ xenbus_switch_state(dev, state);
244+}
245+
246+/* Handle backend state transitions:
247+ *
248+ * The backend state starts in InitWait and the following transitions are
249+ * allowed.
250+ *
251+ * InitWait -> Connected
252+ *
253+ * ^ \ |
254+ * | \ |
255+ * | \ |
256+ * | \ |
257+ * | \ |
258+ * | \ |
259+ * | V V
260+ *
261+ * Closed <-> Closing
262+ *
263+ * The state argument specifies the eventual state of the backend and the
264+ * function transitions to that state via the shortest path.
265+ */
266+static void set_backend_state(struct backend_info *be,
267+ enum xenbus_state state)
268+{
269+ while (be->state != state) {
270+ switch (be->state) {
271+ case XenbusStateClosed:
272+ switch (state) {
273+ case XenbusStateInitWait:
274+ case XenbusStateConnected:
275+ pr_info("%s: prepare for reconnect\n",
276+ be->dev->nodename);
277+ backend_switch_state(be, XenbusStateInitWait);
278+ break;
279+ case XenbusStateClosing:
280+ backend_switch_state(be, XenbusStateClosing);
281+ break;
282+ default:
283+ BUG();
284+ }
285+ break;
286+ case XenbusStateInitWait:
287+ switch (state) {
288+ case XenbusStateConnected:
289+ backend_connect(be);
290+ backend_switch_state(be, XenbusStateConnected);
291+ break;
292+ case XenbusStateClosing:
293+ case XenbusStateClosed:
294+ backend_switch_state(be, XenbusStateClosing);
295+ break;
296+ default:
297+ BUG();
298+ }
299+ break;
300+ case XenbusStateConnected:
301+ switch (state) {
302+ case XenbusStateInitWait:
303+ case XenbusStateClosing:
304+ case XenbusStateClosed:
305+ backend_disconnect(be);
306+ backend_switch_state(be, XenbusStateClosing);
307+ break;
308+ default:
309+ BUG();
310+ }
311+ break;
312+ case XenbusStateClosing:
313+ switch (state) {
314+ case XenbusStateInitWait:
315+ case XenbusStateConnected:
316+ case XenbusStateClosed:
317+ backend_switch_state(be, XenbusStateClosed);
318+ break;
319+ default:
320+ BUG();
321+ }
322+ break;
323+ default:
324+ BUG();
325+ }
220326 }
221327 }
222328
@@ -228,42 +334,33 @@ static void frontend_changed(struct xenbus_device *dev, · 5 unmodified lines
228334 {
229335 struct backend_info *be = dev_get_drvdata(&dev->dev);
230336
231− pr_debug("frontend state %s\n", xenbus_strstate(frontend_state));
337+ pr_debug("%s -> %s\n", dev->otherend, xenbus_strstate(frontend_state));
232338
233339 be->frontend_state = frontend_state;
234340
235341 switch (frontend_state) {
236342 case XenbusStateInitialising:
237− if (dev->state == XenbusStateClosed) {
238− pr_info("%s: prepare for reconnect\n", dev->nodename);
239− xenbus_switch_state(dev, XenbusStateInitWait);
240− }
343+ set_backend_state(be, XenbusStateInitWait);
241344 break;
242345
243346 case XenbusStateInitialised:
244347 break;
245348
246349 case XenbusStateConnected:
247− if (dev->state == XenbusStateConnected)
248− break;
249− backend_create_xenvif(be);
250− if (be->vif)
251− connect(be);
350+ set_backend_state(be, XenbusStateConnected);
252351 break;
253352
254353 case XenbusStateClosing:
255− if (be->vif)
256− kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
257− disconnect_backend(dev);
258− xenbus_switch_state(dev, XenbusStateClosing);
354+ set_backend_state(be, XenbusStateClosing);
259355 break;
260356
261357 case XenbusStateClosed:
262− xenbus_switch_state(dev, XenbusStateClosed);
358+ set_backend_state(be, XenbusStateClosed);
263359 if (xenbus_dev_is_online(dev))
264360 break;
265361 /* fall through if not online */
266362 case XenbusStateUnknown:
363+ set_backend_state(be, XenbusStateClosed);
267364 device_unregister(&dev->dev);
268365 break;
269366
@@ -356,7 +453,9 @@ static void hotplug_status_changed(struct xenbus_watch *watch, · 86 unmodified lines
356453 if (IS_ERR(str))
357454 return;
358455 if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) {
359− xenbus_switch_state(be->dev, XenbusStateConnected);
456+ /* Complete any pending state change */
457+ xenbus_switch_state(be->dev, be->state);
458+
360459 /* Not interested in this watch anymore. */
361460 unregister_hotplug_status_watch(be);
362461 }
@@ -386,12 +485,8 @@ static void connect(struct backend_info *be) · 23 unmodified lines
386485 err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
387486 hotplug_status_changed,
388487 "%s/%s", dev->nodename, "hotplug-status");
389− if (err) {
390− /* Switch now, since we can't do a watch. */
391− xenbus_switch_state(dev, XenbusStateConnected);
392− } else {
488+ if (!err)
393489 be->have_hotplug_status_watch = 1;
394− }
395490
396491 netif_wake_queue(be->vif->dev);
397492 }
drivers/pci/pci-acpi.c+3−3
@@ -47,6 +47,9 @@ static void pci_acpi_wake_dev(acpi_handle handle, u32 event, void *context) · 46 unmodified lines
4747 if (event != ACPI_NOTIFY_DEVICE_WAKE || !pci_dev)
4848 return;
4949
50+ if (pci_dev->pme_poll)
51+ pci_dev->pme_poll = false;
52+
5053 if (pci_dev->current_state == PCI_D3cold) {
5154 pci_wakeup_event(pci_dev);
5255 pm_runtime_resume(&pci_dev->dev);
@@ -57,9 +60,6 @@ static void pci_acpi_wake_dev(acpi_handle handle, u32 event, void *context) · 4 unmodified lines
5760 if (pci_dev->pme_support)
5861 pci_check_pme_status(pci_dev);
5962
60− if (pci_dev->pme_poll)
61− pci_dev->pme_poll = false;
62−
6363 pci_wakeup_event(pci_dev);
6464 pm_runtime_resume(&pci_dev->dev);
6565
drivers/pci/pci.c+7−1
@@ -1155,8 +1155,14 @@ static void pci_enable_bridge(struct pci_dev *dev) · 1154 unmodified lines
11551155
11561156 pci_enable_bridge(dev->bus->self);
11571157
1158− if (pci_is_enabled(dev))
1158+ if (pci_is_enabled(dev)) {
1159+ if (!dev->is_busmaster) {
1160+ dev_warn(&dev->dev, "driver skip pci_set_master, fix it!\n");
1161+ pci_set_master(dev);
1162+ }
11591163 return;
1164+ }
1165+
11601166 retval = pci_enable_device(dev);
11611167 if (retval)
11621168 dev_err(&dev->dev, "Error enabling bridge (%d), continuing\n",
drivers/pinctrl/pinconf.c+2−2
@@ -490,7 +490,7 @@ exit: · 489 unmodified lines
490490 * <devicename> <state> <pinname> are values that should match the pinctrl-maps
491491 * <newvalue> reflects the new config and is driver dependant
492492 */
493−static int pinconf_dbg_config_write(struct file *file,
493+static ssize_t pinconf_dbg_config_write(struct file *file,
494494 const char __user *user_buf, size_t count, loff_t *ppos)
495495 {
496496 struct pinctrl_maps *maps_node;
@@ -508,7 +508,7 @@ static int pinconf_dbg_config_write(struct file *file, · 11 unmodified lines
508508 int i;
509509
510510 /* Get userspace string and assure termination */
511− buf_size = min(count, (size_t)(sizeof(buf)-1));
511+ buf_size = min(count, sizeof(buf) - 1);
512512 if (copy_from_user(buf, user_buf, buf_size))
513513 return -EFAULT;
514514 buf[buf_size] = 0;
drivers/pinctrl/pinctrl-exynos.c+6−6
@@ -663,18 +663,18 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) · 662 unmodified lines
663663 /* pin banks of s5pv210 pin-controller */
664664 static struct samsung_pin_bank s5pv210_pin_bank[] = {
665665 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
666− EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
666+ EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04),
667667 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
668668 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
669669 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
670670 EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14),
671− EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpd1", 0x18),
672− EXYNOS_PIN_BANK_EINTG(5, 0x0e0, "gpe0", 0x1c),
673− EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
674− EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpf0", 0x24),
671+ EXYNOS_PIN_BANK_EINTG(6, 0x0c0, "gpd1", 0x18),
672+ EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpe0", 0x1c),
673+ EXYNOS_PIN_BANK_EINTG(5, 0x100, "gpe1", 0x20),
674+ EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpf0", 0x24),
675675 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpf1", 0x28),
676676 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpf2", 0x2c),
677− EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf3", 0x30),
677+ EXYNOS_PIN_BANK_EINTG(6, 0x180, "gpf3", 0x30),
678678 EXYNOS_PIN_BANK_EINTG(7, 0x1a0, "gpg0", 0x34),
679679 EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38),
680680 EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c),
drivers/pinctrl/pinctrl-palmas.c+3−2
@@ -891,9 +891,10 @@ static int palmas_pinconf_set(struct pinctrl_dev *pctldev, · 890 unmodified lines
891891 param = pinconf_to_config_param(configs[i]);
892892 param_val = pinconf_to_config_argument(configs[i]);
893893
894+ if (param == PIN_CONFIG_BIAS_PULL_PIN_DEFAULT)
895+ continue;
896+
894897 switch (param) {
895− case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
896− return 0;
897898 case PIN_CONFIG_BIAS_DISABLE:
898899 case PIN_CONFIG_BIAS_PULL_UP:
899900 case PIN_CONFIG_BIAS_PULL_DOWN:
drivers/pinctrl/pinctrl-tegra114.c+2−3
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
55 *
6− * Arthur: Pritesh Raithatha <praithatha@nvidia.com>
6+ * Author: Pritesh Raithatha <praithatha@nvidia.com>
77 *
88 * This program is free software; you can redistribute it and/or modify it
99 * under the terms and conditions of the GNU General Public License,
@@ -2763,7 +2763,6 @@ static struct platform_driver tegra114_pinctrl_driver = { · 2753 unmodified lines
27632763 };
27642764 module_platform_driver(tegra114_pinctrl_driver);
27652765
2766−MODULE_ALIAS("platform:tegra114-pinctrl");
27672766 MODULE_AUTHOR("Pritesh Raithatha <praithatha@nvidia.com>");
2768−MODULE_DESCRIPTION("NVIDIA Tegra114 pincontrol driver");
2767+MODULE_DESCRIPTION("NVIDIA Tegra114 pinctrl driver");
27692768 MODULE_LICENSE("GPL v2");
drivers/regulator/da9063-regulator.c+1−1
@@ -709,7 +709,7 @@ static struct da9063_regulators_pdata *da9063_parse_regulators_dt( · 708 unmodified lines
709709 struct of_regulator_match **da9063_reg_matches)
710710 {
711711 da9063_reg_matches = NULL;
712− return PTR_ERR(-ENODEV);
712+ return ERR_PTR(-ENODEV);
713713 }
714714 #endif
715715
drivers/regulator/palmas-regulator.c+7−7
@@ -201,13 +201,7 @@ static unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500}; · 200 unmodified lines
201201 #define SMPS_CTRL_MODE_ECO 0x02
202202 #define SMPS_CTRL_MODE_PWM 0x03
203203
204−/* These values are derived from the data sheet. And are the number of steps
205− * where there is a voltage change, the ranges at beginning and end of register
206− * max/min values where there are no change are ommitted.
207− *
208− * So they are basically (maxV-minV)/stepV
209− */
210−#define PALMAS_SMPS_NUM_VOLTAGES 117
204+#define PALMAS_SMPS_NUM_VOLTAGES 122
211205 #define PALMAS_SMPS10_NUM_VOLTAGES 2
212206 #define PALMAS_LDO_NUM_VOLTAGES 50
213207
@@ -979,6 +973,7 @@ static int palmas_regulators_probe(struct platform_device *pdev) · 765 unmodified lines
979973 pmic->desc[id].min_uV = 900000;
980974 pmic->desc[id].uV_step = 50000;
981975 pmic->desc[id].linear_min_sel = 1;
976+ pmic->desc[id].enable_time = 500;
982977 pmic->desc[id].vsel_reg =
983978 PALMAS_BASE_TO_REG(PALMAS_LDO_BASE,
984979 palmas_regs_info[id].vsel_addr);
@@ -997,6 +992,11 @@ static int palmas_regulators_probe(struct platform_device *pdev) · 12 unmodified lines
997992 pmic->desc[id].min_uV = 450000;
998993 pmic->desc[id].uV_step = 25000;
999994 }
995+
996+ /* LOD6 in vibrator mode will have enable time 2000us */
997+ if (pdata && pdata->ldo6_vibrator &&
998+ (id == PALMAS_REG_LDO6))
999+ pmic->desc[id].enable_time = 2000;
10001000 } else {
10011001 pmic->desc[id].n_voltages = 1;
10021002 pmic->desc[id].ops = &palmas_ops_extreg;
drivers/regulator/ti-abb-regulator.c+14−2
@@ -279,8 +279,12 @@ static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb, · 278 unmodified lines
279279 ti_abb_rmw(regs->opp_sel_mask, info->opp_sel, regs->control_reg,
280280 abb->base);
281281
282− /* program LDO VBB vset override if needed */
283− if (abb->ldo_base)
282+ /*
283+ * program LDO VBB vset override if needed for !bypass mode
284+ * XXX: Do not switch sequence - for !bypass, LDO override reset *must*
285+ * be performed *before* switch to bias mode else VBB glitches.
286+ */
287+ if (abb->ldo_base && info->opp_sel != TI_ABB_NOMINAL_OPP)
284288 ti_abb_program_ldovbb(dev, abb, info);
285289
286290 /* Initiate ABB ldo change */
@@ -295,6 +299,14 @@ static int ti_abb_set_opp(struct regulator_dev *rdev, struct ti_abb *abb, · 8 unmodified lines
295299 if (ret)
296300 goto out;
297301
302+ /*
303+ * Reset LDO VBB vset override bypass mode
304+ * XXX: Do not switch sequence - for bypass, LDO override reset *must*
305+ * be performed *after* switch to bypass else VBB glitches.
306+ */
307+ if (abb->ldo_base && info->opp_sel == TI_ABB_NOMINAL_OPP)
308+ ti_abb_program_ldovbb(dev, abb, info);
309+
298310 out:
299311 return ret;
300312 }
drivers/regulator/wm831x-ldo.c+2−2
@@ -63,7 +63,7 @@ static irqreturn_t wm831x_ldo_uv_irq(int irq, void *data) · 62 unmodified lines
6363 */
6464
6565 static const struct regulator_linear_range wm831x_gp_ldo_ranges[] = {
66− { .min_uV = 900000, .max_uV = 1650000, .min_sel = 0, .max_sel = 14,
66+ { .min_uV = 900000, .max_uV = 1600000, .min_sel = 0, .max_sel = 14,
6767 .uV_step = 50000 },
6868 { .min_uV = 1700000, .max_uV = 3300000, .min_sel = 15, .max_sel = 31,
6969 .uV_step = 100000 },
@@ -332,7 +332,7 @@ static struct platform_driver wm831x_gp_ldo_driver = { · 262 unmodified lines
332332 */
333333
334334 static const struct regulator_linear_range wm831x_aldo_ranges[] = {
335− { .min_uV = 1000000, .max_uV = 1650000, .min_sel = 0, .max_sel = 12,
335+ { .min_uV = 1000000, .max_uV = 1600000, .min_sel = 0, .max_sel = 12,
336336 .uV_step = 50000 },
337337 { .min_uV = 1700000, .max_uV = 3500000, .min_sel = 13, .max_sel = 31,
338338 .uV_step = 100000 },
drivers/regulator/wm8350-regulator.c+1−1
@@ -543,7 +543,7 @@ static int wm8350_dcdc_set_suspend_mode(struct regulator_dev *rdev, · 542 unmodified lines
543543 }
544544
545545 static const struct regulator_linear_range wm8350_ldo_ranges[] = {
546− { .min_uV = 900000, .max_uV = 1750000, .min_sel = 0, .max_sel = 15,
546+ { .min_uV = 900000, .max_uV = 1650000, .min_sel = 0, .max_sel = 15,
547547 .uV_step = 50000 },
548548 { .min_uV = 1800000, .max_uV = 3300000, .min_sel = 16, .max_sel = 31,
549549 .uV_step = 100000 },
drivers/scsi/bnx2fc/bnx2fc.h+1−1
@@ -105,7 +105,7 @@ · 104 unmodified lines
105105 #define BNX2FC_RQ_WQE_SIZE (BNX2FC_RQ_BUF_SZ)
106106 #define BNX2FC_XFERQ_WQE_SIZE (sizeof(struct fcoe_xfrqe))
107107 #define BNX2FC_CONFQ_WQE_SIZE (sizeof(struct fcoe_confqe))
108−#define BNX2FC_5771X_DB_PAGE_SIZE 128
108+#define BNX2X_DB_SHIFT 3
109109
110110 #define BNX2FC_TASK_SIZE 128
111111 #define BNX2FC_TASKS_PER_PAGE (PAGE_SIZE/BNX2FC_TASK_SIZE)
drivers/scsi/bnx2fc/bnx2fc_hwi.c+1−2
@@ -1421,8 +1421,7 @@ int bnx2fc_map_doorbell(struct bnx2fc_rport *tgt) · 1420 unmodified lines
14211421
14221422 reg_base = pci_resource_start(hba->pcidev,
14231423 BNX2X_DOORBELL_PCI_BAR);
1424− reg_off = BNX2FC_5771X_DB_PAGE_SIZE *
1425− (context_id & 0x1FFFF) + DPM_TRIGER_TYPE;
1424+ reg_off = (1 << BNX2X_DB_SHIFT) * (context_id & 0x1FFFF);
14261425 tgt->ctx_base = ioremap_nocache(reg_base + reg_off, 4);
14271426 if (!tgt->ctx_base)
14281427 return -ENOMEM;
drivers/scsi/bnx2i/bnx2i.h+1−1
@@ -64,7 +64,7 @@ · 63 unmodified lines
6464 #define MAX_PAGES_PER_CTRL_STRUCT_POOL 8
6565 #define BNX2I_RESERVED_SLOW_PATH_CMD_SLOTS 4
6666
67−#define BNX2I_5771X_DBELL_PAGE_SIZE 128
67+#define BNX2X_DB_SHIFT 3
6868
6969 /* 5706/08 hardware has limit on maximum buffer size per BD it can handle */
7070 #define MAX_BD_LENGTH 65535
drivers/scsi/bnx2i/bnx2i_hwi.c+1−2
@@ -2738,8 +2738,7 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) · 2737 unmodified lines
27382738 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) {
27392739 reg_base = pci_resource_start(ep->hba->pcidev,
27402740 BNX2X_DOORBELL_PCI_BAR);
2741− reg_off = BNX2I_5771X_DBELL_PAGE_SIZE * (cid_num & 0x1FFFF) +
2742− DPM_TRIGER_TYPE;
2741+ reg_off = (1 << BNX2X_DB_SHIFT) * (cid_num & 0x1FFFF);
27432742 ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4);
27442743 goto arm_cq;
27452744 }
drivers/staging/comedi/Kconfig+17−16
@@ -96,6 +96,15 @@ config COMEDI_SKEL · 95 unmodified lines
9696 To compile this driver as a module, choose M here: the module will be
9797 called skel.
9898
99+config COMEDI_SSV_DNP
100+ tristate "SSV Embedded Systems DIL/Net-PC support"
101+ depends on X86_32 || COMPILE_TEST
102+ ---help---
103+ Enable support for SSV Embedded Systems DIL/Net-PC
104+
105+ To compile this driver as a module, choose M here: the module will be
106+ called ssv_dnp.
107+
99108 endif # COMEDI_MISC_DRIVERS
100109
101110 menuconfig COMEDI_ISA_DRIVERS
@@ -386,6 +395,14 @@ config COMEDI_DMM32AT · 284 unmodified lines
386395 To compile this driver as a module, choose M here: the module will be
387396 called dmm32at.
388397
398+config COMEDI_UNIOXX5
399+ tristate "Fastwel UNIOxx-5 analog and digital io board support"
400+ ---help---
401+ Enable support for Fastwel UNIOxx-5 (analog and digital i/o) boards
402+
403+ To compile this driver as a module, choose M here: the module will be
404+ called unioxx5.
405+
389406 config COMEDI_FL512
390407 tristate "FL512 ISA card support"
391408 ---help---
@@ -855,14 +872,6 @@ config COMEDI_DYNA_PCI10XX · 463 unmodified lines
855872 To compile this driver as a module, choose M here: the module will be
856873 called dyna_pci10xx.
857874
858−config COMEDI_UNIOXX5
859− tristate "Fastwel UNIOxx-5 analog and digital io board support"
860− ---help---
861− Enable support for Fastwel UNIOxx-5 (analog and digital i/o) boards
862−
863− To compile this driver as a module, choose M here: the module will be
864− called unioxx5.
865−
866875 config COMEDI_GSC_HPDI
867876 tristate "General Standards PCI-HPDI32 / PMC-HPDI32 support"
868877 select COMEDI_FC
@@ -1085,14 +1094,6 @@ config COMEDI_S626 · 216 unmodified lines
10851094 To compile this driver as a module, choose M here: the module will be
10861095 called s626.
10871096
1088−config COMEDI_SSV_DNP
1089− tristate "SSV Embedded Systems DIL/Net-PC support"
1090− ---help---
1091− Enable support for SSV Embedded Systems DIL/Net-PC
1092−
1093− To compile this driver as a module, choose M here: the module will be
1094− called ssv_dnp.
1095−
10961097 config COMEDI_MITE
10971098 depends on HAS_DMA
10981099 tristate
drivers/staging/comedi/drivers/ni_65xx.c+10−15
@@ -369,28 +369,23 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, · 368 unmodified lines
369369 {
370370 const struct ni_65xx_board *board = comedi_board(dev);
371371 struct ni_65xx_private *devpriv = dev->private;
372− unsigned base_bitfield_channel;
373− const unsigned max_ports_per_bitfield = 5;
372+ int base_bitfield_channel;
374373 unsigned read_bits = 0;
375− unsigned j;
374+ int last_port_offset = ni_65xx_port_by_channel(s->n_chan - 1);
375+ int port_offset;
376376
377377 base_bitfield_channel = CR_CHAN(insn->chanspec);
378− for (j = 0; j < max_ports_per_bitfield; ++j) {
379− const unsigned port_offset =
380− ni_65xx_port_by_channel(base_bitfield_channel) + j;
381− const unsigned port =
382− sprivate(s)->base_port + port_offset;
383− unsigned base_port_channel;
378+ for (port_offset = ni_65xx_port_by_channel(base_bitfield_channel);
379+ port_offset <= last_port_offset; port_offset++) {
380+ unsigned port = sprivate(s)->base_port + port_offset;
381+ int base_port_channel = port_offset * ni_65xx_channels_per_port;
384382 unsigned port_mask, port_data, port_read_bits;
385− int bitshift;
386− if (port >= ni_65xx_total_num_ports(board))
383+ int bitshift = base_port_channel - base_bitfield_channel;
384+
385+ if (bitshift >= 32)
387386 break;
388− base_port_channel = port_offset * ni_65xx_channels_per_port;
389387 port_mask = data[0];
390388 port_data = data[1];
391− bitshift = base_port_channel - base_bitfield_channel;
392− if (bitshift >= 32 || bitshift <= -32)
393− break;
394389 if (bitshift > 0) {
395390 port_mask >>= bitshift;
396391 port_data >>= bitshift;
drivers/staging/dgap/dgap_driver.c+10−7
@@ -474,7 +474,7 @@ static void dgap_cleanup_board(struct board_t *brd) · 473 unmodified lines
474474
475475 DGAP_LOCK(dgap_global_lock, flags);
476476 brd->msgbuf = NULL;
477− printk(brd->msgbuf_head);
477+ printk("%s", brd->msgbuf_head);
478478 kfree(brd->msgbuf_head);
479479 brd->msgbuf_head = NULL;
480480 DGAP_UNLOCK(dgap_global_lock, flags);
@@ -628,7 +628,7 @@ static int dgap_found_board(struct pci_dev *pdev, int id) · 147 unmodified lines
628628 DPR_INIT(("dgap_scan(%d) - printing out the msgbuf\n", i));
629629 DGAP_LOCK(dgap_global_lock, flags);
630630 brd->msgbuf = NULL;
631− printk(brd->msgbuf_head);
631+ printk("%s", brd->msgbuf_head);
632632 kfree(brd->msgbuf_head);
633633 brd->msgbuf_head = NULL;
634634 DGAP_UNLOCK(dgap_global_lock, flags);
@@ -955,25 +955,28 @@ static void dgap_mbuf(struct board_t *brd, const char *fmt, ...) { · 320 unmodified lines
955955 char buf[1024];
956956 int i;
957957 unsigned long flags;
958+ size_t length;
958959
959960 DGAP_LOCK(dgap_global_lock, flags);
960961
961962 /* Format buf using fmt and arguments contained in ap. */
962963 va_start(ap, fmt);
963− i = vsprintf(buf, fmt, ap);
964+ i = vsnprintf(buf, sizeof(buf), fmt, ap);
964965 va_end(ap);
965966
966967 DPR((buf));
967968
968969 if (!brd || !brd->msgbuf) {
969− printk(buf);
970+ printk("%s", buf);
970971 DGAP_UNLOCK(dgap_global_lock, flags);
971972 return;
972973 }
973974
974− memcpy(brd->msgbuf, buf, strlen(buf));
975− brd->msgbuf += strlen(buf);
976− *brd->msgbuf = 0;
975+ length = strlen(buf) + 1;
976+ if (brd->msgbuf - brd->msgbuf_head < length)
977+ length = brd->msgbuf - brd->msgbuf_head;
978+ memcpy(brd->msgbuf, buf, length);
979+ brd->msgbuf += length;
977980
978981 DGAP_UNLOCK(dgap_global_lock, flags);
979982 }
drivers/staging/dgnc/dgnc_driver.c+2−2
@@ -454,7 +454,7 @@ static void dgnc_cleanup_board(struct board_t *brd) · 453 unmodified lines
454454
455455 DGNC_LOCK(dgnc_global_lock, flags);
456456 brd->msgbuf = NULL;
457− printk(brd->msgbuf_head);
457+ printk("%s", brd->msgbuf_head);
458458 kfree(brd->msgbuf_head);
459459 brd->msgbuf_head = NULL;
460460 DGNC_UNLOCK(dgnc_global_lock, flags);
@@ -710,7 +710,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) · 249 unmodified lines
710710 DPR_INIT(("dgnc_scan(%d) - printing out the msgbuf\n", i));
711711 DGNC_LOCK(dgnc_global_lock, flags);
712712 brd->msgbuf = NULL;
713− printk(brd->msgbuf_head);
713+ printk("%s", brd->msgbuf_head);
714714 kfree(brd->msgbuf_head);
715715 brd->msgbuf_head = NULL;
716716 DGNC_UNLOCK(dgnc_global_lock, flags);
drivers/staging/iio/Kconfig+1−1
@@ -37,7 +37,7 @@ config IIO_SIMPLE_DUMMY_EVENTS · 36 unmodified lines
3737
3838 config IIO_SIMPLE_DUMMY_BUFFER
3939 boolean "Buffered capture support"
40− depends on IIO_KFIFO_BUF
40+ select IIO_KFIFO_BUF
4141 help
4242 Add buffered data capture to the simple dummy driver.
4343
drivers/staging/iio/light/isl29018.c+1−0
@@ -563,6 +563,7 @@ static int isl29018_probe(struct i2c_client *client, · 562 unmodified lines
563563 mutex_init(&chip->lock);
564564
565565 chip->lux_scale = 1;
566+ chip->lux_uscale = 0;
566567 chip->range = 1000;
567568 chip->adc_bit = 16;
568569 chip->suspended = false;
drivers/staging/iio/magnetometer/hmc5843.c+1−1
@@ -229,7 +229,7 @@ static int hmc5843_read_measurement(struct iio_dev *indio_dev, · 228 unmodified lines
229229 if (result < 0)
230230 return -EINVAL;
231231
232− *val = result;
232+ *val = sign_extend32(result, 15);
233233 return IIO_VAL_INT;
234234 }
235235
drivers/staging/iio/meter/ade7854-spi.c+1−1
@@ -299,7 +299,7 @@ static int ade7854_spi_probe(struct spi_device *spi) · 298 unmodified lines
299299 if (ret)
300300 iio_device_free(indio_dev);
301301
302− return 0;
302+ return ret;
303303 }
304304
305305 static int ade7854_spi_remove(struct spi_device *spi)
drivers/staging/imx-drm/imx-drm-core.c+3−8
@@ -41,7 +41,6 @@ struct imx_drm_device { · 40 unmodified lines
4141 struct list_head encoder_list;
4242 struct list_head connector_list;
4343 struct mutex mutex;
44− int references;
4544 int pipes;
4645 struct drm_fbdev_cma *fbhelper;
4746 };
@@ -241,8 +240,6 @@ struct drm_device *imx_drm_device_get(void) · 193 unmodified lines
241240 }
242241 }
243242
244− imxdrm->references++;
245−
246243 return imxdrm->drm;
247244
248245 unwind_crtc:
@@ -280,8 +277,6 @@ void imx_drm_device_put(void) · 31 unmodified lines
280277 list_for_each_entry(enc, &imxdrm->encoder_list, list)
281278 module_put(enc->owner);
282279
283− imxdrm->references--;
284−
285280 mutex_unlock(&imxdrm->mutex);
286281 }
287282 EXPORT_SYMBOL_GPL(imx_drm_device_put);
@@ -485,7 +480,7 @@ int imx_drm_add_crtc(struct drm_crtc *crtc, · 197 unmodified lines
485480
486481 mutex_lock(&imxdrm->mutex);
487482
488− if (imxdrm->references) {
483+ if (imxdrm->drm->open_count) {
489484 ret = -EBUSY;
490485 goto err_busy;
491486 }
@@ -564,7 +559,7 @@ int imx_drm_add_encoder(struct drm_encoder *encoder, · 72 unmodified lines
564559
565560 mutex_lock(&imxdrm->mutex);
566561
567− if (imxdrm->references) {
562+ if (imxdrm->drm->open_count) {
568563 ret = -EBUSY;
569564 goto err_busy;
570565 }
@@ -709,7 +704,7 @@ int imx_drm_add_connector(struct drm_connector *connector, · 138 unmodified lines
709704
710705 mutex_lock(&imxdrm->mutex);
711706
712− if (imxdrm->references) {
707+ if (imxdrm->drm->open_count) {
713708 ret = -EBUSY;
714709 goto err_busy;
715710 }
drivers/staging/line6/toneport.c+7−3
@@ -244,13 +244,17 @@ static int snd_toneport_source_put(struct snd_kcontrol *kcontrol, · 243 unmodified lines
244244 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
245245 struct usb_line6_toneport *toneport =
246246 (struct usb_line6_toneport *)line6pcm->line6;
247+ unsigned int source;
247248
248− if (ucontrol->value.enumerated.item[0] == toneport->source)
249+ source = ucontrol->value.enumerated.item[0];
250+ if (source >= ARRAY_SIZE(toneport_source_info))
251+ return -EINVAL;
252+ if (source == toneport->source)
249253 return 0;
250254
251− toneport->source = ucontrol->value.enumerated.item[0];
255+ toneport->source = source;
252256 toneport_send_cmd(toneport->line6.usbdev,
253− toneport_source_info[toneport->source].code, 0x0000);
257+ toneport_source_info[source].code, 0x0000);
254258 return 1;
255259 }
256260
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c+1−1
@@ -1802,7 +1802,7 @@ kiblnd_recv (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, int delayed, · 1801 unmodified lines
18021802 int
18031803 kiblnd_thread_start(int (*fn)(void *arg), void *arg, char *name)
18041804 {
1805− struct task_struct *task = kthread_run(fn, arg, name);
1805+ struct task_struct *task = kthread_run(fn, arg, "%s", name);
18061806
18071807 if (IS_ERR(task))
18081808 return PTR_ERR(task);
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c+1−1
@@ -1005,7 +1005,7 @@ ksocknal_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg) · 1004 unmodified lines
10051005 int
10061006 ksocknal_thread_start(int (*fn)(void *arg), void *arg, char *name)
10071007 {
1008− struct task_struct *task = kthread_run(fn, arg, name);
1008+ struct task_struct *task = kthread_run(fn, arg, "%s", name);
10091009
10101010 if (IS_ERR(task))
10111011 return PTR_ERR(task);
drivers/staging/lustre/lustre/Kconfig+2−2
@@ -1,6 +1,6 @@
11 config LUSTRE_FS
22 tristate "Lustre file system client support"
3− depends on INET && m
3+ depends on INET && m && !MIPS && !XTENSA && !SUPERH
44 select LNET
55 select CRYPTO
66 select CRYPTO_CRC32
@@ -52,7 +52,7 @@ config LUSTRE_DEBUG_EXPENSIVE_CHECK · 45 unmodified lines
5252 config LUSTRE_TRANSLATE_ERRNOS
5353 bool
5454 depends on LUSTRE_FS && !X86
55− default true
55+ default y
5656
5757 config LUSTRE_LLITE_LLOOP
5858 bool "Lustre virtual block device"
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c+2−2
@@ -800,9 +800,9 @@ static int ldlm_bl_thread_start(struct ldlm_bl_pool *blp) · 799 unmodified lines
800800
801801 init_completion(&bltd.bltd_comp);
802802 bltd.bltd_num = atomic_read(&blp->blp_num_threads);
803− snprintf(bltd.bltd_name, sizeof(bltd.bltd_name) - 1,
803+ snprintf(bltd.bltd_name, sizeof(bltd.bltd_name),
804804 "ldlm_bl_%02d", bltd.bltd_num);
805− task = kthread_run(ldlm_bl_thread_main, &bltd, bltd.bltd_name);
805+ task = kthread_run(ldlm_bl_thread_main, &bltd, "%s", bltd.bltd_name);
806806 if (IS_ERR(task)) {
807807 CERROR("cannot start LDLM thread ldlm_bl_%02d: rc %ld\n",
808808 atomic_read(&blp->blp_num_threads), PTR_ERR(task));
drivers/staging/lustre/lustre/libcfs/workitem.c+1−1
@@ -397,7 +397,7 @@ cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab, · 396 unmodified lines
397397 sched->ws_name, sched->ws_nthreads);
398398 }
399399
400− task = kthread_run(cfs_wi_scheduler, sched, name);
400+ task = kthread_run(cfs_wi_scheduler, sched, "%s", name);
401401 if (!IS_ERR(task)) {
402402 nthrs--;
403403 continue;
drivers/staging/lustre/lustre/obdecho/echo_client.c+1−1
@@ -1387,7 +1387,7 @@ echo_copyout_lsm (struct lov_stripe_md *lsm, void *_ulsm, int ulsm_nob) · 1386 unmodified lines
13871387 if (nob > ulsm_nob)
13881388 return (-EINVAL);
13891389
1390− if (copy_to_user (ulsm, lsm, sizeof(ulsm)))
1390+ if (copy_to_user (ulsm, lsm, sizeof(*ulsm)))
13911391 return (-EFAULT);
13921392
13931393 for (i = 0; i < lsm->lsm_stripe_count; i++) {
drivers/staging/lustre/lustre/ptlrpc/pinger.c+2−2
@@ -383,8 +383,8 @@ int ptlrpc_start_pinger(void) · 382 unmodified lines
383383
384384 /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we
385385 * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */
386− rc = PTR_ERR(kthread_run(ptlrpc_pinger_main,
387− &pinger_thread, pinger_thread.t_name));
386+ rc = PTR_ERR(kthread_run(ptlrpc_pinger_main, &pinger_thread,
387+ "%s", pinger_thread.t_name));
388388 if (IS_ERR_VALUE(rc)) {
389389 CERROR("cannot start thread: %d\n", rc);
390390 return rc;
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c+4−4
@@ -615,7 +615,7 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc) · 614 unmodified lines
615615 init_completion(&pc->pc_starting);
616616 init_completion(&pc->pc_finishing);
617617 spin_lock_init(&pc->pc_lock);
618− strncpy(pc->pc_name, name, sizeof(pc->pc_name) - 1);
618+ strlcpy(pc->pc_name, name, sizeof(pc->pc_name));
619619 pc->pc_set = ptlrpc_prep_set();
620620 if (pc->pc_set == NULL)
621621 GOTO(out, rc = -ENOMEM);
@@ -638,7 +638,7 @@ int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc) · 16 unmodified lines
638638 GOTO(out, rc);
639639 }
640640
641− task = kthread_run(ptlrpcd, pc, pc->pc_name);
641+ task = kthread_run(ptlrpcd, pc, "%s", pc->pc_name);
642642 if (IS_ERR(task))
643643 GOTO(out, rc = PTR_ERR(task));
644644
@@ -745,7 +745,7 @@ static int ptlrpcd_init(void) · 100 unmodified lines
745745 if (ptlrpcds == NULL)
746746 GOTO(out, rc = -ENOMEM);
747747
748− snprintf(name, 15, "ptlrpcd_rcv");
748+ snprintf(name, sizeof(name), "ptlrpcd_rcv");
749749 set_bit(LIOD_RECOVERY, &ptlrpcds->pd_thread_rcv.pc_flags);
750750 rc = ptlrpcd_start(-1, nthreads, name, &ptlrpcds->pd_thread_rcv);
751751 if (rc < 0)
@@ -764,7 +764,7 @@ static int ptlrpcd_init(void) · 12 unmodified lines
764764 * unnecessary dependency. But how to distribute async RPCs load
765765 * among all the ptlrpc daemons becomes another trouble. */
766766 for (i = 0; i < nthreads; i++) {
767− snprintf(name, 15, "ptlrpcd_%d", i);
767+ snprintf(name, sizeof(name), "ptlrpcd_%d", i);
768768 rc = ptlrpcd_start(i, nthreads, name, &ptlrpcds->pd_threads[i]);
769769 if (rc < 0)
770770 GOTO(out, rc);
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c+2−2
@@ -59,8 +59,8 @@ · 58 unmodified lines
5959 ****************************************/
6060
6161
62−#define PTRS_PER_PAGE (PAGE_CACHE_SIZE / sizeof(void *))
63−#define PAGES_PER_POOL (PTRS_PER_PAGE)
62+#define POINTERS_PER_PAGE (PAGE_CACHE_SIZE / sizeof(void *))
63+#define PAGES_PER_POOL (POINTERS_PER_PAGE)
6464
6565 #define IDLE_IDX_MAX (100)
6666 #define IDLE_IDX_WEIGHT (3)
drivers/staging/lustre/lustre/ptlrpc/service.c+3−3
@@ -2718,15 +2718,15 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait) · 2717 unmodified lines
27182718 spin_unlock(&svcpt->scp_lock);
27192719
27202720 if (svcpt->scp_cpt >= 0) {
2721− snprintf(thread->t_name, PTLRPC_THR_NAME_LEN, "%s%02d_%03d",
2721+ snprintf(thread->t_name, sizeof(thread->t_name), "%s%02d_%03d",
27222722 svc->srv_thread_name, svcpt->scp_cpt, thread->t_id);
27232723 } else {
2724− snprintf(thread->t_name, PTLRPC_THR_NAME_LEN, "%s_%04d",
2724+ snprintf(thread->t_name, sizeof(thread->t_name), "%s_%04d",
27252725 svc->srv_thread_name, thread->t_id);
27262726 }
27272727
27282728 CDEBUG(D_RPCTRACE, "starting thread '%s'\n", thread->t_name);
2729− rc = PTR_ERR(kthread_run(ptlrpc_main, thread, thread->t_name));
2729+ rc = PTR_ERR(kthread_run(ptlrpc_main, thread, "%s", thread->t_name));
27302730 if (IS_ERR_VALUE(rc)) {
27312731 CERROR("cannot start thread '%s': rc %d\n",
27322732 thread->t_name, rc);
drivers/staging/octeon-usb/cvmx-usb.c+1−1
@@ -604,7 +604,7 @@ int cvmx_usb_initialize(struct cvmx_usb_state *state, int usb_port_number, · 603 unmodified lines
604604 }
605605 }
606606
607− memset(usb, 0, sizeof(usb));
607+ memset(usb, 0, sizeof(*usb));
608608 usb->init_flags = flags;
609609
610610 /* Initialize the USB state structure */
drivers/staging/octeon/ethernet-mem.c+1−6
@@ -48,13 +48,8 @@ static int cvm_oct_fill_hw_skbuff(int pool, int size, int elements) · 47 unmodified lines
4848 while (freed) {
4949
5050 struct sk_buff *skb = dev_alloc_skb(size + 256);
51− if (unlikely(skb == NULL)) {
52− pr_warning
53− ("Failed to allocate skb for hardware pool %d\n",
54− pool);
51+ if (unlikely(skb == NULL))
5552 break;
56− }
57−
5853 skb_reserve(skb, 256 - (((unsigned long)skb->data) & 0x7f));
5954 *(struct sk_buff **)(skb->data - sizeof(void *)) = skb;
6055 cvmx_fpa_free(skb->data, pool, DONT_WRITEBACK(size / 128));
drivers/staging/octeon/ethernet-rgmii.c+1−3
@@ -373,9 +373,7 @@ int cvm_oct_rgmii_init(struct net_device *dev) · 372 unmodified lines
373373 * Enable interrupts on inband status changes
374374 * for this port.
375375 */
376− gmx_rx_int_en.u64 =
377− cvmx_read_csr(CVMX_GMXX_RXX_INT_EN
378− (index, interface));
376+ gmx_rx_int_en.u64 = 0;
379377 gmx_rx_int_en.s.phy_dupx = 1;
380378 gmx_rx_int_en.s.phy_link = 1;
381379 gmx_rx_int_en.s.phy_spd = 1;
drivers/staging/octeon/ethernet-rx.c+1−4
@@ -303,6 +303,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) · 302 unmodified lines
303303 if (backlog > budget * cores_in_use && napi != NULL)
304304 cvm_oct_enable_one_cpu();
305305 }
306+ rx_count++;
306307
307308 skb_in_hw = USE_SKBUFFS_IN_HW && work->word2.s.bufs == 1;
308309 if (likely(skb_in_hw)) {
@@ -336,9 +337,6 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) · 27 unmodified lines
336337 */
337338 skb = dev_alloc_skb(work->len);
338339 if (!skb) {
339− printk_ratelimited("Port %d failed to allocate "
340− "skbuff, packet dropped\n",
341− work->ipprt);
342340 cvm_oct_free_work(work);
343341 continue;
344342 }
@@ -429,7 +427,6 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) · 84 unmodified lines
429427 #endif
430428 }
431429 netif_receive_skb(skb);
432− rx_count++;
433430 } else {
434431 /* Drop any packet received for a device that isn't up */
435432 /*
drivers/staging/rtl8188eu/core/rtw_ieee80211.c+1−1
@@ -157,8 +157,8 @@ _func_enter_; · 156 unmodified lines
157157
158158 *frlen = *frlen + (len + 2);
159159
160− return pbuf + len + 2;
161160 _func_exit_;
161+ return pbuf + len + 2;
162162 }
163163
164164 inline u8 *rtw_set_ie_ch_switch (u8 *buf, u32 *buf_len, u8 ch_switch_mode,
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c+7−7
@@ -1827,13 +1827,13 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra · 1826 unmodified lines
18271827
18281828 #ifdef CONFIG_88EU_P2P
18291829
1830−static int get_reg_classes_full_count(struct p2p_channels channel_list)
1830+static int get_reg_classes_full_count(struct p2p_channels *channel_list)
18311831 {
18321832 int cnt = 0;
18331833 int i;
18341834
1835− for (i = 0; i < channel_list.reg_classes; i++) {
1836− cnt += channel_list.reg_class[i].channels;
1835+ for (i = 0; i < channel_list->reg_classes; i++) {
1836+ cnt += channel_list->reg_class[i].channels;
18371837 }
18381838
18391839 return cnt;
@@ -2065,7 +2065,7 @@ void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr) · 225 unmodified lines
20652065 /* + number of channels in all classes */
20662066 len_channellist_attr = 3
20672067 + (1 + 1) * (u16)(pmlmeext->channel_list.reg_classes)
2068− + get_reg_classes_full_count(pmlmeext->channel_list);
2068+ + get_reg_classes_full_count(&pmlmeext->channel_list);
20692069
20702070 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
20712071 p2pielen += 2;
@@ -2437,7 +2437,7 @@ static void issue_p2p_GO_response(struct adapter *padapter, u8 *raddr, u8 *frame · 365 unmodified lines
24372437 /* + number of channels in all classes */
24382438 len_channellist_attr = 3
24392439 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes
2440− + get_reg_classes_full_count(pmlmeext->channel_list);
2440+ + get_reg_classes_full_count(&pmlmeext->channel_list);
24412441
24422442 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
24432443
@@ -2859,7 +2859,7 @@ void issue_p2p_invitation_request(struct adapter *padapter, u8 *raddr) · 415 unmodified lines
28592859 /* + number of channels in all classes */
28602860 len_channellist_attr = 3
28612861 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes
2862− + get_reg_classes_full_count(pmlmeext->channel_list);
2862+ + get_reg_classes_full_count(&pmlmeext->channel_list);
28632863
28642864 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
28652865
@@ -3120,7 +3120,7 @@ void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr, u8 dialo · 254 unmodified lines
31203120 /* + number of channels in all classes */
31213121 len_channellist_attr = 3
31223122 + (1 + 1) * (u16)pmlmeext->channel_list.reg_classes
3123− + get_reg_classes_full_count(pmlmeext->channel_list);
3123+ + get_reg_classes_full_count(&pmlmeext->channel_list);
31243124
31253125 *(__le16 *)(p2pie + p2pielen) = cpu_to_le16(len_channellist_attr);
31263126 p2pielen += 2;
drivers/staging/rtl8188eu/core/rtw_mp.c+1−1
@@ -907,7 +907,7 @@ u32 mp_query_psd(struct adapter *pAdapter, u8 *data) · 906 unmodified lines
907907 sscanf(data, "pts =%d, start =%d, stop =%d", &psd_pts, &psd_start, &psd_stop);
908908 }
909909
910− _rtw_memset(data, '\0', sizeof(data));
910+ _rtw_memset(data, '\0', sizeof(*data));
911911
912912 i = psd_start;
913913 while (i < psd_stop) {
drivers/staging/rtl8188eu/core/rtw_wlan_util.c+1−1
@@ -631,7 +631,7 @@ void WMMOnAssocRsp(struct adapter *padapter) · 630 unmodified lines
631631 inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3;
632632
633633 if (pregpriv->wifi_spec == 1) {
634− u32 j, tmp, change_inx;
634+ u32 j, tmp, change_inx = false;
635635
636636 /* entry indx: 0->vo, 1->vi, 2->be, 3->bk. */
637637 for (i = 0; i < 4; i++) {
drivers/staging/rtl8188eu/hal/rtl8188e_dm.c+1−1
@@ -57,7 +57,7 @@ static void Init_ODM_ComInfo_88E(struct adapter *Adapter) · 56 unmodified lines
5757 u8 cut_ver, fab_ver;
5858
5959 /* Init Value */
60− _rtw_memset(dm_odm, 0, sizeof(dm_odm));
60+ _rtw_memset(dm_odm, 0, sizeof(*dm_odm));
6161
6262 dm_odm->Adapter = Adapter;
6363
drivers/staging/rtl8188eu/include/odm.h+1−1
@@ -1010,7 +1010,7 @@ enum dm_dig_op { · 1009 unmodified lines
10101010 #define DM_false_ALARM_THRESH_LOW 400
10111011 #define DM_false_ALARM_THRESH_HIGH 1000
10121012
1013−#define DM_DIG_MAX_NIC 0x3e
1013+#define DM_DIG_MAX_NIC 0x4e
10141014 #define DM_DIG_MIN_NIC 0x1e /* 0x22/0x1c */
10151015
10161016 #define DM_DIG_MAX_AP 0x32
drivers/staging/rtl8188eu/include/rtl8188e_hal.h+1−1
@@ -188,7 +188,7 @@ enum ChannelPlan { · 187 unmodified lines
188188
189189 struct txpowerinfo24g {
190190 u8 IndexCCK_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G];
191− u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G-1];
191+ u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G];
192192 /* If only one tx, only BW20 and OFDM are used. */
193193 s8 CCK_Diff[MAX_RF_PATH][MAX_TX_COUNT];
194194 s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT];
drivers/staging/rtl8188eu/include/rtw_mlme_ext.h+1−0
@@ -870,6 +870,7 @@ static struct fwevent wlanevents[] = { · 869 unmodified lines
870870 {0, NULL},
871871 {0, NULL},
872872 {0, &rtw_cpwm_event_callback},
873+ {0, NULL},
873874 };
874875
875876 #endif/* _RTL_MLME_EXT_C_ */
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c+1−1
@@ -6973,7 +6973,7 @@ static int rtw_mp_ctx(struct net_device *dev, · 6972 unmodified lines
69736973 stop = strncmp(extra, "stop", 4);
69746974 sscanf(extra, "count =%d, pkt", &count);
69756975
6976− _rtw_memset(extra, '\0', sizeof(extra));
6976+ _rtw_memset(extra, '\0', sizeof(*extra));
69776977
69786978 if (stop == 0) {
69796979 bStartTest = 0; /* To set Stop */
drivers/staging/rtl8188eu/os_dep/usb_intf.c+1−0
@@ -54,6 +54,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = { · 53 unmodified lines
5454 /*=== Customer ID ===*/
5555 /****** 8188EUS ********/
5656 {USB_DEVICE(0x8179, 0x07B8)}, /* Abocom - Abocom */
57+ {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
5758 {} /* Terminating entry */
5859 };
5960
drivers/staging/rtl8192u/r819xU_cmdpkt.c+2−0
@@ -37,6 +37,8 @@ rt_status SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen) · 36 unmodified lines
3737 /* Get TCB and local buffer from common pool.
3838 (It is shared by CmdQ, MgntQ, and USB coalesce DataQ) */
3939 skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4);
40+ if (!skb)
41+ return RT_STATUS_FAILURE;
4042 memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
4143 tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
4244 tcb_desc->queue_index = TXCMD_QUEUE;
drivers/staging/vt6656/card.c+2−2
@@ -172,8 +172,8 @@ static u16 swGetOFDMControlRate(struct vnt_private *pDevice, u16 wRateIdx) · 171 unmodified lines
172172 if (!CARDbIsOFDMinBasicRate(pDevice)) {
173173 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
174174 "swGetOFDMControlRate:(NO OFDM) %d\n", wRateIdx);
175− if (wRateIdx > RATE_24M)
176− wRateIdx = RATE_24M;
175+ if (wRateIdx > RATE_24M)
176+ wRateIdx = RATE_24M;
177177 return wRateIdx;
178178 }
179179
drivers/staging/vt6656/iwctl.c+3−0
@@ -1634,6 +1634,9 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_request_info *info, · 1633 unmodified lines
16341634 if (pMgmt == NULL)
16351635 return -EFAULT;
16361636
1637+ if (!(pDevice->flags & DEVICE_FLAGS_OPENED))
1638+ return -ENODEV;
1639+
16371640 buf = kzalloc(sizeof(struct viawget_wpa_param), GFP_KERNEL);
16381641 if (buf == NULL)
16391642 return -ENOMEM;
drivers/staging/vt6656/main_usb.c+2−1
@@ -1098,6 +1098,8 @@ static int device_close(struct net_device *dev) · 1097 unmodified lines
10981098 memset(pMgmt->abyCurrBSSID, 0, 6);
10991099 pMgmt->eCurrState = WMAC_STATE_IDLE;
11001100
1101+ pDevice->flags &= ~DEVICE_FLAGS_OPENED;
1102+
11011103 device_free_tx_bufs(pDevice);
11021104 device_free_rx_bufs(pDevice);
11031105 device_free_int_bufs(pDevice);
@@ -1109,7 +1111,6 @@ static int device_close(struct net_device *dev) · 5 unmodified lines
11091111 usb_free_urb(pDevice->pInterruptURB);
11101112
11111113 BSSvClearNodeDBTable(pDevice, 0);
1112− pDevice->flags &=(~DEVICE_FLAGS_OPENED);
11131114
11141115 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close2 \n");
11151116
drivers/staging/vt6656/rxtx.c+2−0
@@ -148,6 +148,8 @@ static void *s_vGetFreeContext(struct vnt_private *pDevice) · 147 unmodified lines
148148 DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"GetFreeContext()\n");
149149
150150 for (ii = 0; ii < pDevice->cbTD; ii++) {
151+ if (!pDevice->apTD[ii])
152+ return NULL;
151153 pContext = pDevice->apTD[ii];
152154 if (pContext->bBoolInUse == false) {
153155 pContext->bBoolInUse = true;
drivers/staging/xillybus/xillybus_core.c+1−1
@@ -2054,7 +2054,7 @@ static int xillybus_init_chrdev(struct xilly_endpoint *endpoint, · 2053 unmodified lines
20542054 NULL,
20552055 MKDEV(major, i),
20562056 NULL,
2057− devname);
2057+ "%s", devname);
20582058
20592059 if (IS_ERR(device)) {
20602060 pr_warn("xillybus: Failed to create %s "
drivers/staging/zram/zram_drv.c+0−1
@@ -981,4 +981,3 @@ MODULE_PARM_DESC(num_devices, "Number of zram devices"); · 980 unmodified lines
981981 MODULE_LICENSE("Dual BSD/GPL");
982982 MODULE_AUTHOR("Nitin Gupta <ngupta@vflare.org>");
983983 MODULE_DESCRIPTION("Compressed RAM Block Device");
984−MODULE_ALIAS("devname:zram");
drivers/target/iscsi/iscsi_target.c+9−4
@@ -753,7 +753,8 @@ static void iscsit_unmap_iovec(struct iscsi_cmd *cmd) · 752 unmodified lines
753753
754754 static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn)
755755 {
756− struct iscsi_cmd *cmd;
756+ LIST_HEAD(ack_list);
757+ struct iscsi_cmd *cmd, *cmd_p;
757758
758759 conn->exp_statsn = exp_statsn;
759760
@@ -761,19 +762,23 @@ static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn) · 1 unmodified line
761762 return;
762763
763764 spin_lock_bh(&conn->cmd_lock);
764− list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
765+ list_for_each_entry_safe(cmd, cmd_p, &conn->conn_cmd_list, i_conn_node) {
765766 spin_lock(&cmd->istate_lock);
766767 if ((cmd->i_state == ISTATE_SENT_STATUS) &&
767768 iscsi_sna_lt(cmd->stat_sn, exp_statsn)) {
768769 cmd->i_state = ISTATE_REMOVE;
769770 spin_unlock(&cmd->istate_lock);
770− iscsit_add_cmd_to_immediate_queue(cmd, conn,
771− cmd->i_state);
771+ list_move_tail(&cmd->i_conn_node, &ack_list);
772772 continue;
773773 }
774774 spin_unlock(&cmd->istate_lock);
775775 }
776776 spin_unlock_bh(&conn->cmd_lock);
777+
778+ list_for_each_entry_safe(cmd, cmd_p, &ack_list, i_conn_node) {
779+ list_del(&cmd->i_conn_node);
780+ iscsit_free_cmd(cmd, false);
781+ }
777782 }
778783
779784 static int iscsit_allocate_iovecs(struct iscsi_cmd *cmd)
drivers/target/iscsi/iscsi_target_nego.c+1−1
@@ -1192,7 +1192,7 @@ get_target: · 1191 unmodified lines
11921192 */
11931193 alloc_tags:
11941194 tag_num = max_t(u32, ISCSIT_MIN_TAGS, queue_depth);
1195− tag_num += ISCSIT_EXTRA_TAGS;
1195+ tag_num += (tag_num / 2) + ISCSIT_EXTRA_TAGS;
11961196 tag_size = sizeof(struct iscsi_cmd) + conn->conn_transport->priv_size;
11971197
11981198 ret = transport_alloc_session_tags(sess->se_sess, tag_num, tag_size);
drivers/target/iscsi/iscsi_target_util.c+2−2
@@ -736,7 +736,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) · 735 unmodified lines
736736 * Fallthrough
737737 */
738738 case ISCSI_OP_SCSI_TMFUNC:
739− rc = transport_generic_free_cmd(&cmd->se_cmd, 1);
739+ rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown);
740740 if (!rc && shutdown && se_cmd && se_cmd->se_sess) {
741741 __iscsit_free_cmd(cmd, true, shutdown);
742742 target_put_sess_cmd(se_cmd->se_sess, se_cmd);
@@ -752,7 +752,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) · 9 unmodified lines
752752 se_cmd = &cmd->se_cmd;
753753 __iscsit_free_cmd(cmd, true, shutdown);
754754
755− rc = transport_generic_free_cmd(&cmd->se_cmd, 1);
755+ rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown);
756756 if (!rc && shutdown && se_cmd->se_sess) {
757757 __iscsit_free_cmd(cmd, true, shutdown);
758758 target_put_sess_cmd(se_cmd->se_sess, se_cmd);
drivers/target/target_core_sbc.c+26−2
@@ -349,7 +349,16 @@ static sense_reason_t compare_and_write_post(struct se_cmd *cmd) · 348 unmodified lines
349349 {
350350 struct se_device *dev = cmd->se_dev;
351351
352− cmd->se_cmd_flags |= SCF_COMPARE_AND_WRITE_POST;
352+ /*
353+ * Only set SCF_COMPARE_AND_WRITE_POST to force a response fall-through
354+ * within target_complete_ok_work() if the command was successfully
355+ * sent to the backend driver.
356+ */
357+ spin_lock_irq(&cmd->t_state_lock);
358+ if ((cmd->transport_state & CMD_T_SENT) && !cmd->scsi_status)
359+ cmd->se_cmd_flags |= SCF_COMPARE_AND_WRITE_POST;
360+ spin_unlock_irq(&cmd->t_state_lock);
361+
353362 /*
354363 * Unlock ->caw_sem originally obtained during sbc_compare_and_write()
355364 * before the original READ I/O submission.
@@ -363,7 +372,7 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd) · 7 unmodified lines
363372 {
364373 struct se_device *dev = cmd->se_dev;
365374 struct scatterlist *write_sg = NULL, *sg;
366− unsigned char *buf, *addr;
375+ unsigned char *buf = NULL, *addr;
367376 struct sg_mapping_iter m;
368377 unsigned int offset = 0, len;
369378 unsigned int nlbas = cmd->t_task_nolb;
@@ -378,6 +387,15 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd) · 8 unmodified lines
378387 */
379388 if (!cmd->t_data_sg || !cmd->t_bidi_data_sg)
380389 return TCM_NO_SENSE;
390+ /*
391+ * Immediately exit + release dev->caw_sem if command has already
392+ * been failed with a non-zero SCSI status.
393+ */
394+ if (cmd->scsi_status) {
395+ pr_err("compare_and_write_callback: non zero scsi_status:"
396+ " 0x%02x\n", cmd->scsi_status);
397+ goto out;
398+ }
381399
382400 buf = kzalloc(cmd->data_length, GFP_KERNEL);
383401 if (!buf) {
@@ -508,6 +526,12 @@ sbc_compare_and_write(struct se_cmd *cmd) · 124 unmodified lines
508526 cmd->transport_complete_callback = NULL;
509527 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
510528 }
529+ /*
530+ * Reset cmd->data_length to individual block_size in order to not
531+ * confuse backend drivers that depend on this value matching the
532+ * size of the I/O being submitted.
533+ */
534+ cmd->data_length = cmd->t_task_nolb * dev->dev_attrib.block_size;
511535
512536 ret = cmd->execute_rw(cmd, cmd->t_bidi_data_sg, cmd->t_bidi_data_nents,
513537 DMA_FROM_DEVICE);
drivers/target/target_core_transport.c+15−5
@@ -236,17 +236,24 @@ int transport_alloc_session_tags(struct se_session *se_sess, · 235 unmodified lines
236236 {
237237 int rc;
238238
239− se_sess->sess_cmd_map = kzalloc(tag_num * tag_size, GFP_KERNEL);
239+ se_sess->sess_cmd_map = kzalloc(tag_num * tag_size,
240+ GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT);
240241 if (!se_sess->sess_cmd_map) {
241− pr_err("Unable to allocate se_sess->sess_cmd_map\n");
242− return -ENOMEM;
242+ se_sess->sess_cmd_map = vzalloc(tag_num * tag_size);
243+ if (!se_sess->sess_cmd_map) {
244+ pr_err("Unable to allocate se_sess->sess_cmd_map\n");
245+ return -ENOMEM;
246+ }
243247 }
244248
245249 rc = percpu_ida_init(&se_sess->sess_tag_pool, tag_num);
246250 if (rc < 0) {
247251 pr_err("Unable to init se_sess->sess_tag_pool,"
248252 " tag_num: %u\n", tag_num);
249− kfree(se_sess->sess_cmd_map);
253+ if (is_vmalloc_addr(se_sess->sess_cmd_map))
254+ vfree(se_sess->sess_cmd_map);
255+ else
256+ kfree(se_sess->sess_cmd_map);
250257 se_sess->sess_cmd_map = NULL;
251258 return -ENOMEM;
252259 }
@@ -412,7 +419,10 @@ void transport_free_session(struct se_session *se_sess) · 159 unmodified lines
412419 {
413420 if (se_sess->sess_cmd_map) {
414421 percpu_ida_destroy(&se_sess->sess_tag_pool);
415− kfree(se_sess->sess_cmd_map);
422+ if (is_vmalloc_addr(se_sess->sess_cmd_map))
423+ vfree(se_sess->sess_cmd_map);
424+ else
425+ kfree(se_sess->sess_cmd_map);
416426 }
417427 kmem_cache_free(se_sess_cache, se_sess);
418428 }
drivers/target/target_core_xcopy.c+2−2
@@ -298,8 +298,8 @@ static int target_xcopy_parse_segdesc_02(struct se_cmd *se_cmd, struct xcopy_op · 297 unmodified lines
298298 (unsigned long long)xop->dst_lba);
299299
300300 if (dc != 0) {
301− xop->dbl = (desc[29] << 16) & 0xff;
302− xop->dbl |= (desc[30] << 8) & 0xff;
301+ xop->dbl = (desc[29] & 0xff) << 16;
302+ xop->dbl |= (desc[30] & 0xff) << 8;
303303 xop->dbl |= desc[31] & 0xff;
304304
305305 pr_debug("XCOPY seg desc 0x02: DC=1 w/ dbl: %u\n", xop->dbl);
drivers/tty/hvc/hvc_xen.c+1−0
@@ -636,6 +636,7 @@ struct console xenboot_console = { · 635 unmodified lines
636636 .name = "xenboot",
637637 .write = xenboot_write_console,
638638 .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
639+ .index = -1,
639640 };
640641 #endif /* CONFIG_EARLY_PRINTK */
641642
drivers/tty/n_tty.c+27−22
@@ -1758,8 +1758,7 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old) · 1757 unmodified lines
17581758 canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON;
17591759 if (canon_change) {
17601760 bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
1761− ldata->line_start = 0;
1762− ldata->canon_head = ldata->read_tail;
1761+ ldata->line_start = ldata->canon_head = ldata->read_tail;
17631762 ldata->erasing = 0;
17641763 ldata->lnext = 0;
17651764 }
@@ -2184,28 +2183,34 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, · 418 unmodified lines
21842183
21852184 if (!input_available_p(tty, 0)) {
21862185 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
2187− retval = -EIO;
2188− break;
2189− }
2190− if (tty_hung_up_p(file))
2191− break;
2192− if (!timeout)
2193− break;
2194− if (file->f_flags & O_NONBLOCK) {
2195− retval = -EAGAIN;
2196− break;
2197− }
2198− if (signal_pending(current)) {
2199− retval = -ERESTARTSYS;
2200− break;
2201− }
2202− n_tty_set_room(tty);
2203− up_read(&tty->termios_rwsem);
2186+ up_read(&tty->termios_rwsem);
2187+ tty_flush_to_ldisc(tty);
2188+ down_read(&tty->termios_rwsem);
2189+ if (!input_available_p(tty, 0)) {
2190+ retval = -EIO;
2191+ break;
2192+ }
2193+ } else {
2194+ if (tty_hung_up_p(file))
2195+ break;
2196+ if (!timeout)
2197+ break;
2198+ if (file->f_flags & O_NONBLOCK) {
2199+ retval = -EAGAIN;
2200+ break;
2201+ }
2202+ if (signal_pending(current)) {
2203+ retval = -ERESTARTSYS;
2204+ break;
2205+ }
2206+ n_tty_set_room(tty);
2207+ up_read(&tty->termios_rwsem);
22042208
2205− timeout = schedule_timeout(timeout);
2209+ timeout = schedule_timeout(timeout);
22062210
2207− down_read(&tty->termios_rwsem);
2208− continue;
2211+ down_read(&tty->termios_rwsem);
2212+ continue;
2213+ }
22092214 }
22102215 __set_current_state(TASK_RUNNING);
22112216
drivers/tty/serial/pch_uart.c+3−10
@@ -667,30 +667,21 @@ static int pop_tx_x(struct eg20t_port *priv, unsigned char *buf) · 666 unmodified lines
667667
668668 static int dma_push_rx(struct eg20t_port *priv, int size)
669669 {
670− struct tty_struct *tty;
671670 int room;
672671 struct uart_port *port = &priv->port;
673672 struct tty_port *tport = &port->state->port;
674673
675− port = &priv->port;
676− tty = tty_port_tty_get(tport);
677− if (!tty) {
678− dev_dbg(priv->port.dev, "%s:tty is busy now", __func__);
679− return 0;
680− }
681−
682674 room = tty_buffer_request_room(tport, size);
683675
684676 if (room < size)
685677 dev_warn(port->dev, "Rx overrun: dropping %u bytes\n",
686678 size - room);
687679 if (!room)
688− return room;
680+ return 0;
689681
690682 tty_insert_flip_string(tport, sg_virt(&priv->sg_rx), size);
691683
692684 port->icount.rx += room;
693− tty_kref_put(tty);
694685
695686 return room;
696687 }
@@ -1098,6 +1089,8 @@ static void pch_uart_err_ir(struct eg20t_port *priv, unsigned int lsr) · 401 unmodified lines
10981089 if (tty == NULL) {
10991090 for (i = 0; error_msg[i] != NULL; i++)
11001091 dev_err(&priv->pdev->dev, error_msg[i]);
1092+ } else {
1093+ tty_kref_put(tty);
11011094 }
11021095 }
11031096
drivers/tty/serial/serial-tegra.c+3−1
@@ -732,7 +732,7 @@ static irqreturn_t tegra_uart_isr(int irq, void *data) · 731 unmodified lines
732732 static void tegra_uart_stop_rx(struct uart_port *u)
733733 {
734734 struct tegra_uart_port *tup = to_tegra_uport(u);
735− struct tty_struct *tty = tty_port_tty_get(&tup->uport.state->port);
735+ struct tty_struct *tty;
736736 struct tty_port *port = &u->state->port;
737737 struct dma_tx_state state;
738738 unsigned long ier;
@@ -744,6 +744,8 @@ static void tegra_uart_stop_rx(struct uart_port *u) · 5 unmodified lines
744744 if (!tup->rx_in_progress)
745745 return;
746746
747+ tty = tty_port_tty_get(&tup->uport.state->port);
748+
747749 tegra_uart_wait_sym_time(tup, 1); /* wait a character interval */
748750
749751 ier = tup->ier_shadow;
drivers/tty/tty_ioctl.c+3−0
@@ -1201,6 +1201,9 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, · 1200 unmodified lines
12011201 }
12021202 return 0;
12031203 case TCFLSH:
1204+ retval = tty_check_change(tty);
1205+ if (retval)
1206+ return retval;
12041207 return __tty_perform_flush(tty, arg);
12051208 default:
12061209 /* Try the mode commands */
drivers/usb/chipidea/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config USB_CHIPIDEA
22 tristate "ChipIdea Highspeed Dual Role Controller"
3− depends on (USB_EHCI_HCD && USB_GADGET) || (USB_EHCI_HCD && !USB_GADGET) || (!USB_EHCI_HCD && USB_GADGET)
3+ depends on ((USB_EHCI_HCD && USB_GADGET) || (USB_EHCI_HCD && !USB_GADGET) || (!USB_EHCI_HCD && USB_GADGET)) && HAS_DMA
44 help
55 Say Y here if your system has a dual role high speed USB
66 controller based on ChipIdea silicon IP. Currently, only the
drivers/usb/chipidea/ci_hdrc_imx.c+5−2
@@ -131,7 +131,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) · 130 unmodified lines
131131 if (ret) {
132132 dev_err(&pdev->dev, "usbmisc init failed, ret=%d\n",
133133 ret);
134− goto err_clk;
134+ goto err_phy;
135135 }
136136 }
137137
@@ -143,7 +143,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) · 5 unmodified lines
143143 dev_err(&pdev->dev,
144144 "Can't register ci_hdrc platform device, err=%d\n",
145145 ret);
146− goto err_clk;
146+ goto err_phy;
147147 }
148148
149149 if (data->usbmisc_data) {
@@ -164,6 +164,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) · 14 unmodified lines
164164
165165 disable_device:
166166 ci_hdrc_remove_device(data->ci_pdev);
167+err_phy:
168+ if (data->phy)
169+ usb_phy_shutdown(data->phy);
167170 err_clk:
168171 clk_disable_unprepare(data->clk);
169172 return ret;
drivers/usb/chipidea/ci_hdrc_pci.c+6−1
@@ -129,7 +129,12 @@ static DEFINE_PCI_DEVICE_TABLE(ci_hdrc_pci_id_table) = { · 128 unmodified lines
129129 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0829),
130130 .driver_data = (kernel_ulong_t)&penwell_pci_platdata,
131131 },
132− { 0, 0, 0, 0, 0, 0, 0 /* end: all zeroes */ }
132+ {
133+ /* Intel Clovertrail */
134+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xe006),
135+ .driver_data = (kernel_ulong_t)&penwell_pci_platdata,
136+ },
137+ { 0 } /* end: all zeroes */
133138 };
134139 MODULE_DEVICE_TABLE(pci, ci_hdrc_pci_id_table);
135140
drivers/usb/chipidea/core.c+1−0
@@ -605,6 +605,7 @@ static int ci_hdrc_remove(struct platform_device *pdev) · 604 unmodified lines
605605 dbg_remove_files(ci);
606606 free_irq(ci->irq, ci);
607607 ci_role_destroy(ci);
608+ kfree(ci->hw_bank.regmap);
608609
609610 return 0;
610611 }
drivers/usb/chipidea/udc.c+3−1
@@ -1600,6 +1600,8 @@ static void destroy_eps(struct ci_hdrc *ci) · 1599 unmodified lines
16001600 for (i = 0; i < ci->hw_ep_max; i++) {
16011601 struct ci_hw_ep *hwep = &ci->ci_hw_ep[i];
16021602
1603+ if (hwep->pending_td)
1604+ free_pending_td(hwep);
16031605 dma_pool_free(ci->qh_pool, hwep->qh.ptr, hwep->qh.dma);
16041606 }
16051607 }
@@ -1667,13 +1669,13 @@ static int ci_udc_stop(struct usb_gadget *gadget, · 61 unmodified lines
16671669 if (ci->platdata->notify_event)
16681670 ci->platdata->notify_event(ci,
16691671 CI_HDRC_CONTROLLER_STOPPED_EVENT);
1670− ci->driver = NULL;
16711672 spin_unlock_irqrestore(&ci->lock, flags);
16721673 _gadget_stop_activity(&ci->gadget);
16731674 spin_lock_irqsave(&ci->lock, flags);
16741675 pm_runtime_put(&ci->gadget.dev);
16751676 }
16761677
1678+ ci->driver = NULL;
16771679 spin_unlock_irqrestore(&ci->lock, flags);
16781680
16791681 return 0;
drivers/usb/core/devio.c+16−0
@@ -742,6 +742,22 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, · 741 unmodified lines
742742 if ((index & ~USB_DIR_IN) == 0)
743743 return 0;
744744 ret = findintfep(ps->dev, index);
745+ if (ret < 0) {
746+ /*
747+ * Some not fully compliant Win apps seem to get
748+ * index wrong and have the endpoint number here
749+ * rather than the endpoint address (with the
750+ * correct direction). Win does let this through,
751+ * so we'll not reject it here but leave it to
752+ * the device to not break KVM. But we warn.
753+ */
754+ ret = findintfep(ps->dev, index ^ 0x80);
755+ if (ret >= 0)
756+ dev_info(&ps->dev->dev,
757+ "%s: process %i (%s) requesting ep %02x but needs %02x\n",
758+ __func__, task_pid_nr(current),
759+ current->comm, index, index ^ 0x80);
760+ }
745761 if (ret >= 0)
746762 ret = checkintf(ps, ret);
747763 break;
drivers/usb/core/hub.c+3−0
@@ -3426,6 +3426,9 @@ static int usb_req_set_sel(struct usb_device *udev, enum usb3_link_state state) · 3425 unmodified lines
34263426 unsigned long long u2_pel;
34273427 int ret;
34283428
3429+ if (udev->state != USB_STATE_CONFIGURED)
3430+ return 0;
3431+
34293432 /* Convert SEL and PEL stored in ns to us */
34303433 u1_sel = DIV_ROUND_UP(udev->u1_params.sel, 1000);
34313434 u1_pel = DIV_ROUND_UP(udev->u1_params.pel, 1000);
drivers/usb/dwc3/Kconfig+0−1
@@ -1,7 +1,6 @@
11 config USB_DWC3
22 tristate "DesignWare USB3 DRD Core Support"
33 depends on (USB || USB_GADGET) && HAS_DMA
4− depends on EXTCON
54 select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
65 help
76 Say Y or M here if your system has a Dual Role SuperSpeed
drivers/usb/dwc3/dwc3-pci.c+4−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 /* FIXME define these in <linux/pci_ids.h> */
2929 #define PCI_VENDOR_ID_SYNOPSYS 0x16c3
3030 #define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd
31+#define PCI_DEVICE_ID_INTEL_BYT 0x0f37
32+#define PCI_DEVICE_ID_INTEL_MRFLD 0x119e
3133
3234 struct dwc3_pci {
3335 struct device *dev;
@@ -187,6 +189,8 @@ static DEFINE_PCI_DEVICE_TABLE(dwc3_pci_id_table) = { · 153 unmodified lines
187189 PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
188190 PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
189191 },
192+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), },
193+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRFLD), },
190194 { } /* Terminating Entry */
191195 };
192196 MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
drivers/usb/dwc3/gadget.c+2−4
@@ -2611,15 +2611,13 @@ int dwc3_gadget_init(struct dwc3 *dwc) · 2610 unmodified lines
26112611 ret = usb_add_gadget_udc(dwc->dev, &dwc->gadget);
26122612 if (ret) {
26132613 dev_err(dwc->dev, "failed to register udc\n");
2614− goto err5;
2614+ goto err4;
26152615 }
26162616
26172617 return 0;
26182618
2619−err5:
2620− dwc3_gadget_free_endpoints(dwc);
2621−
26222619 err4:
2620+ dwc3_gadget_free_endpoints(dwc);
26232621 dma_free_coherent(dwc->dev, DWC3_EP0_BOUNCE_SIZE,
26242622 dwc->ep0_bounce, dwc->ep0_bounce_addr);
26252623
drivers/usb/gadget/cdc2.c+1−18
@@ -113,12 +113,6 @@ static int __init cdc_do_config(struct usb_configuration *c) · 112 unmodified lines
113113 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP;
114114 }
115115
116− fi_ecm = usb_get_function_instance("ecm");
117− if (IS_ERR(fi_ecm)) {
118− status = PTR_ERR(fi_ecm);
119− goto err_func_ecm;
120− }
121−
122116 f_ecm = usb_get_function(fi_ecm);
123117 if (IS_ERR(f_ecm)) {
124118 status = PTR_ERR(f_ecm);
@@ -129,35 +123,24 @@ static int __init cdc_do_config(struct usb_configuration *c) · 4 unmodified lines
129123 if (status)
130124 goto err_add_ecm;
131125
132− fi_serial = usb_get_function_instance("acm");
133− if (IS_ERR(fi_serial)) {
134− status = PTR_ERR(fi_serial);
135− goto err_get_acm;
136− }
137−
138126 f_acm = usb_get_function(fi_serial);
139127 if (IS_ERR(f_acm)) {
140128 status = PTR_ERR(f_acm);
141− goto err_func_acm;
129+ goto err_get_acm;
142130 }
143131
144132 status = usb_add_function(c, f_acm);
145133 if (status)
146134 goto err_add_acm;
147−
148135 return 0;
149136
150137 err_add_acm:
151138 usb_put_function(f_acm);
152−err_func_acm:
153− usb_put_function_instance(fi_serial);
154139 err_get_acm:
155140 usb_remove_function(c, f_ecm);
156141 err_add_ecm:
157142 usb_put_function(f_ecm);
158143 err_get_ecm:
159− usb_put_function_instance(fi_ecm);
160−err_func_ecm:
161144 return status;
162145 }
163146
drivers/usb/gadget/dummy_hcd.c+4−3
@@ -923,8 +923,9 @@ static int dummy_udc_stop(struct usb_gadget *g, · 922 unmodified lines
923923 struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g);
924924 struct dummy *dum = dum_hcd->dum;
925925
926− dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
927− driver->driver.name);
926+ if (driver)
927+ dev_dbg(udc_dev(dum), "unregister gadget driver '%s'\n",
928+ driver->driver.name);
928929
929930 dum->driver = NULL;
930931
@@ -1000,8 +1001,8 @@ static int dummy_udc_remove(struct platform_device *pdev) · 69 unmodified lines
10001001 {
10011002 struct dummy *dum = platform_get_drvdata(pdev);
10021003
1003− usb_del_gadget_udc(&dum->gadget);
10041004 device_remove_file(&dum->gadget.dev, &dev_attr_function);
1005+ usb_del_gadget_udc(&dum->gadget);
10051006 return 0;
10061007 }
10071008
drivers/usb/gadget/f_ecm.c+1−1
@@ -995,7 +995,7 @@ static void ecm_unbind(struct usb_configuration *c, struct usb_function *f) · 994 unmodified lines
995995 usb_ep_free_request(ecm->notify, ecm->notify_req);
996996 }
997997
998−struct usb_function *ecm_alloc(struct usb_function_instance *fi)
998+static struct usb_function *ecm_alloc(struct usb_function_instance *fi)
999999 {
10001000 struct f_ecm *ecm;
10011001 struct f_ecm_opts *opts;
drivers/usb/gadget/f_eem.c+1−1
@@ -624,7 +624,7 @@ static void eem_unbind(struct usb_configuration *c, struct usb_function *f) · 623 unmodified lines
624624 usb_free_all_descriptors(f);
625625 }
626626
627−struct usb_function *eem_alloc(struct usb_function_instance *fi)
627+static struct usb_function *eem_alloc(struct usb_function_instance *fi)
628628 {
629629 struct f_eem *eem;
630630 struct f_eem_opts *opts;
drivers/usb/gadget/f_fs.c+28−34
@@ -1034,37 +1034,19 @@ struct ffs_sb_fill_data { · 1033 unmodified lines
10341034 struct ffs_file_perms perms;
10351035 umode_t root_mode;
10361036 const char *dev_name;
1037− union {
1038− /* set by ffs_fs_mount(), read by ffs_sb_fill() */
1039− void *private_data;
1040− /* set by ffs_sb_fill(), read by ffs_fs_mount */
1041− struct ffs_data *ffs_data;
1042− };
1037+ struct ffs_data *ffs_data;
10431038 };
10441039
10451040 static int ffs_sb_fill(struct super_block *sb, void *_data, int silent)
10461041 {
10471042 struct ffs_sb_fill_data *data = _data;
10481043 struct inode *inode;
1049− struct ffs_data *ffs;
1044+ struct ffs_data *ffs = data->ffs_data;
10501045
10511046 ENTER();
10521047
1053− /* Initialise data */
1054− ffs = ffs_data_new();
1055− if (unlikely(!ffs))
1056− goto Enomem;
1057−
10581048 ffs->sb = sb;
1059− ffs->dev_name = kstrdup(data->dev_name, GFP_KERNEL);
1060− if (unlikely(!ffs->dev_name))
1061− goto Enomem;
1062− ffs->file_perms = data->perms;
1063− ffs->private_data = data->private_data;
1064−
1065− /* used by the caller of this function */
1066− data->ffs_data = ffs;
1067−
1049+ data->ffs_data = NULL;
10681050 sb->s_fs_info = ffs;
10691051 sb->s_blocksize = PAGE_CACHE_SIZE;
10701052 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
@@ -1080,17 +1062,14 @@ static int ffs_sb_fill(struct super_block *sb, void *_data, int silent) · 9 unmodified lines
10801062 &data->perms);
10811063 sb->s_root = d_make_root(inode);
10821064 if (unlikely(!sb->s_root))
1083− goto Enomem;
1065+ return -ENOMEM;
10841066
10851067 /* EP0 file */
10861068 if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs,
10871069 &ffs_ep0_operations, NULL)))
1088− goto Enomem;
1070+ return -ENOMEM;
10891071
10901072 return 0;
1091−
1092−Enomem:
1093− return -ENOMEM;
10941073 }
10951074
10961075 static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts)
@@ -1193,6 +1172,7 @@ ffs_fs_mount(struct file_system_type *t, int flags, · 96 unmodified lines
11931172 struct dentry *rv;
11941173 int ret;
11951174 void *ffs_dev;
1175+ struct ffs_data *ffs;
11961176
11971177 ENTER();
11981178
@@ -1200,18 +1180,30 @@ ffs_fs_mount(struct file_system_type *t, int flags, · 1 unmodified line
12001180 if (unlikely(ret < 0))
12011181 return ERR_PTR(ret);
12021182
1183+ ffs = ffs_data_new();
1184+ if (unlikely(!ffs))
1185+ return ERR_PTR(-ENOMEM);
1186+ ffs->file_perms = data.perms;
1187+
1188+ ffs->dev_name = kstrdup(dev_name, GFP_KERNEL);
1189+ if (unlikely(!ffs->dev_name)) {
1190+ ffs_data_put(ffs);
1191+ return ERR_PTR(-ENOMEM);
1192+ }
1193+
12031194 ffs_dev = functionfs_acquire_dev_callback(dev_name);
1204− if (IS_ERR(ffs_dev))
1205− return ffs_dev;
1195+ if (IS_ERR(ffs_dev)) {
1196+ ffs_data_put(ffs);
1197+ return ERR_CAST(ffs_dev);
1198+ }
1199+ ffs->private_data = ffs_dev;
1200+ data.ffs_data = ffs;
12061201
1207− data.dev_name = dev_name;
1208− data.private_data = ffs_dev;
12091202 rv = mount_nodev(t, flags, &data, ffs_sb_fill);
1210−
1211− /* data.ffs_data is set by ffs_sb_fill */
1212− if (IS_ERR(rv))
1203+ if (IS_ERR(rv) && data.ffs_data) {
12131204 functionfs_release_dev_callback(data.ffs_data);
1214−
1205+ ffs_data_put(data.ffs_data);
1206+ }
12151207 return rv;
12161208 }
12171209
@@ -2264,6 +2256,8 @@ static int ffs_func_bind(struct usb_configuration *c, · 1046 unmodified lines
22642256 data->raw_descs + ret,
22652257 (sizeof data->raw_descs) - ret,
22662258 __ffs_func_bind_do_descs, func);
2259+ if (unlikely(ret < 0))
2260+ goto error;
22672261 }
22682262
22692263 /*
drivers/usb/gadget/f_mass_storage.c+2−0
@@ -2260,10 +2260,12 @@ reset: · 2259 unmodified lines
22602260 /* Disable the endpoints */
22612261 if (fsg->bulk_in_enabled) {
22622262 usb_ep_disable(fsg->bulk_in);
2263+ fsg->bulk_in->driver_data = NULL;
22632264 fsg->bulk_in_enabled = 0;
22642265 }
22652266 if (fsg->bulk_out_enabled) {
22662267 usb_ep_disable(fsg->bulk_out);
2268+ fsg->bulk_out->driver_data = NULL;
22672269 fsg->bulk_out_enabled = 0;
22682270 }
22692271
drivers/usb/gadget/fotg210-udc.c+1−1
@@ -1214,6 +1214,6 @@ static struct platform_driver fotg210_driver = { · 1213 unmodified lines
12141214
12151215 module_platform_driver(fotg210_driver);
12161216
1217−MODULE_AUTHOR("Yuan-Hsin Chen <yhchen@faraday-tech.com>");
1217+MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang <john453@faraday-tech.com>");
12181218 MODULE_LICENSE("GPL");
12191219 MODULE_DESCRIPTION(DRIVER_DESC);
drivers/usb/gadget/fusb300_udc.c+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222
2323 MODULE_DESCRIPTION("FUSB300 USB gadget driver");
2424 MODULE_LICENSE("GPL");
25−MODULE_AUTHOR("Yuan Hsin Chen <yhchen@faraday-tech.com>");
25+MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang <john453@faraday-tech.com>");
2626 MODULE_ALIAS("platform:fusb300_udc");
2727
2828 #define DRIVER_VERSION "20 October 2010"
drivers/usb/gadget/multi.c+4−4
@@ -179,7 +179,7 @@ err_conf: · 178 unmodified lines
179179 return ret;
180180 }
181181
182−static int rndis_config_register(struct usb_composite_dev *cdev)
182+static __ref int rndis_config_register(struct usb_composite_dev *cdev)
183183 {
184184 static struct usb_configuration config = {
185185 .bConfigurationValue = MULTI_RNDIS_CONFIG_NUM,
@@ -194,7 +194,7 @@ static int rndis_config_register(struct usb_composite_dev *cdev) · 8 unmodified lines
194194
195195 #else
196196
197−static int rndis_config_register(struct usb_composite_dev *cdev)
197+static __ref int rndis_config_register(struct usb_composite_dev *cdev)
198198 {
199199 return 0;
200200 }
@@ -241,7 +241,7 @@ err_conf: · 40 unmodified lines
241241 return ret;
242242 }
243243
244−static int cdc_config_register(struct usb_composite_dev *cdev)
244+static __ref int cdc_config_register(struct usb_composite_dev *cdev)
245245 {
246246 static struct usb_configuration config = {
247247 .bConfigurationValue = MULTI_CDC_CONFIG_NUM,
@@ -256,7 +256,7 @@ static int cdc_config_register(struct usb_composite_dev *cdev) · 8 unmodified lines
256256
257257 #else
258258
259−static int cdc_config_register(struct usb_composite_dev *cdev)
259+static __ref int cdc_config_register(struct usb_composite_dev *cdev)
260260 {
261261 return 0;
262262 }
drivers/usb/gadget/mv_u3d_core.c+3−0
@@ -645,6 +645,7 @@ static int mv_u3d_ep_disable(struct usb_ep *_ep) · 644 unmodified lines
645645 struct mv_u3d_ep *ep;
646646 struct mv_u3d_ep_context *ep_context;
647647 u32 epxcr, direction;
648+ unsigned long flags;
648649
649650 if (!_ep)
650651 return -EINVAL;
@@ -661,7 +662,9 @@ static int mv_u3d_ep_disable(struct usb_ep *_ep) · 10 unmodified lines
661662 direction = mv_u3d_ep_dir(ep);
662663
663664 /* nuke all pending requests (does flush) */
665+ spin_lock_irqsave(&u3d->lock, flags);
664666 mv_u3d_nuke(ep, -ESHUTDOWN);
667+ spin_unlock_irqrestore(&u3d->lock, flags);
665668
666669 /* Disable the endpoint for Rx or Tx and reset the endpoint type */
667670 if (direction == MV_U3D_EP_DIR_OUT) {
drivers/usb/gadget/pxa25x_udc.c+5−4
@@ -2054,7 +2054,7 @@ static struct pxa25x_udc memory = { · 2053 unmodified lines
20542054 /*
20552055 * probe - binds to the platform device
20562056 */
2057−static int __init pxa25x_udc_probe(struct platform_device *pdev)
2057+static int pxa25x_udc_probe(struct platform_device *pdev)
20582058 {
20592059 struct pxa25x_udc *dev = &memory;
20602060 int retval, irq;
@@ -2203,7 +2203,7 @@ static void pxa25x_udc_shutdown(struct platform_device *_dev) · 142 unmodified lines
22032203 pullup_off();
22042204 }
22052205
2206−static int __exit pxa25x_udc_remove(struct platform_device *pdev)
2206+static int pxa25x_udc_remove(struct platform_device *pdev)
22072207 {
22082208 struct pxa25x_udc *dev = platform_get_drvdata(pdev);
22092209
@@ -2294,7 +2294,8 @@ static int pxa25x_udc_resume(struct platform_device *dev) · 84 unmodified lines
22942294
22952295 static struct platform_driver udc_driver = {
22962296 .shutdown = pxa25x_udc_shutdown,
2297− .remove = __exit_p(pxa25x_udc_remove),
2297+ .probe = pxa25x_udc_probe,
2298+ .remove = pxa25x_udc_remove,
22982299 .suspend = pxa25x_udc_suspend,
22992300 .resume = pxa25x_udc_resume,
23002301 .driver = {
@@ -2303,7 +2304,7 @@ static struct platform_driver udc_driver = { · 2 unmodified lines
23032304 },
23042305 };
23052306
2306−module_platform_driver_probe(udc_driver, pxa25x_udc_probe);
2307+module_platform_driver(udc_driver);
23072308
23082309 MODULE_DESCRIPTION(DRIVER_DESC);
23092310 MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell");
drivers/usb/gadget/s3c-hsotg.c+5−10
@@ -543,7 +543,7 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg, · 542 unmodified lines
543543 * FIFO, requests of >512 cause the endpoint to get stuck with a
544544 * fragment of the end of the transfer in it.
545545 */
546− if (can_write > 512)
546+ if (can_write > 512 && !periodic)
547547 can_write = 512;
548548
549549 /*
@@ -2475,8 +2475,6 @@ irq_retry: · 1925 unmodified lines
24752475 if (gintsts & GINTSTS_ErlySusp) {
24762476 dev_dbg(hsotg->dev, "GINTSTS_ErlySusp\n");
24772477 writel(GINTSTS_ErlySusp, hsotg->regs + GINTSTS);
2478−
2479− s3c_hsotg_disconnect(hsotg);
24802478 }
24812479
24822480 /*
@@ -2962,9 +2960,6 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget, · 479 unmodified lines
29622960 if (!hsotg)
29632961 return -ENODEV;
29642962
2965− if (!driver || driver != hsotg->driver || !driver->unbind)
2966− return -EINVAL;
2967−
29682963 /* all endpoints should be shutdown */
29692964 for (ep = 0; ep < hsotg->num_of_eps; ep++)
29702965 s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);
@@ -2972,15 +2967,15 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget, · 1 unmodified line
29722967 spin_lock_irqsave(&hsotg->lock, flags);
29732968
29742969 s3c_hsotg_phy_disable(hsotg);
2975− regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
29762970
2977− hsotg->driver = NULL;
2971+ if (!driver)
2972+ hsotg->driver = NULL;
2973+
29782974 hsotg->gadget.speed = USB_SPEED_UNKNOWN;
29792975
29802976 spin_unlock_irqrestore(&hsotg->lock, flags);
29812977
2982− dev_info(hsotg->dev, "unregistered gadget driver '%s'\n",
2983− driver->driver.name);
2978+ regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
29842979
29852980 return 0;
29862981 }
drivers/usb/host/ehci-fsl.c+7−12
@@ -130,7 +130,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, · 129 unmodified lines
130130 }
131131
132132 /* Enable USB controller, 83xx or 8536 */
133− if (pdata->have_sysif_regs)
133+ if (pdata->have_sysif_regs && pdata->controller_ver < FSL_USB_VER_1_6)
134134 setbits32(hcd->regs + FSL_SOC_USB_CTRL, 0x4);
135135
136136 /* Don't need to set host mode here. It will be done by tdi_reset() */
@@ -232,15 +232,9 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, · 95 unmodified lines
232232 case FSL_USB2_PHY_ULPI:
233233 if (pdata->have_sysif_regs && pdata->controller_ver) {
234234 /* controller version 1.6 or above */
235+ clrbits32(non_ehci + FSL_SOC_USB_CTRL, UTMI_PHY_EN);
235236 setbits32(non_ehci + FSL_SOC_USB_CTRL,
236− ULPI_PHY_CLK_SEL);
237− /*
238− * Due to controller issue of PHY_CLK_VALID in ULPI
239− * mode, we set USB_CTRL_USB_EN before checking
240− * PHY_CLK_VALID, otherwise PHY_CLK_VALID doesn't work.
241− */
242− clrsetbits_be32(non_ehci + FSL_SOC_USB_CTRL,
243− UTMI_PHY_EN, USB_CTRL_USB_EN);
237+ ULPI_PHY_CLK_SEL | USB_CTRL_USB_EN);
244238 }
245239 portsc |= PORT_PTS_ULPI;
246240 break;
@@ -270,8 +264,9 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, · 23 unmodified lines
270264 if (pdata->have_sysif_regs && pdata->controller_ver &&
271265 (phy_mode == FSL_USB2_PHY_ULPI)) {
272266 /* check PHY_CLK_VALID to get phy clk valid */
273− if (!spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) &
274− PHY_CLK_VALID, FSL_USB_PHY_CLK_TIMEOUT, 0)) {
267+ if (!(spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) &
268+ PHY_CLK_VALID, FSL_USB_PHY_CLK_TIMEOUT, 0) ||
269+ in_be32(non_ehci + FSL_SOC_USB_PRICTRL))) {
275270 printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n");
276271 return -EINVAL;
277272 }
@@ -669,7 +664,7 @@ static const struct hc_driver ehci_fsl_hc_driver = { · 391 unmodified lines
669664 * generic hardware linkage
670665 */
671666 .irq = ehci_irq,
672− .flags = HCD_USB2 | HCD_MEMORY | HCD_BH,
667+ .flags = HCD_USB2 | HCD_MEMORY,
673668
674669 /*
675670 * basic lifecycle operations
drivers/usb/host/ehci-grlib.c+1−1
@@ -43,7 +43,7 @@ static const struct hc_driver ehci_grlib_hc_driver = { · 42 unmodified lines
4343 * generic hardware linkage
4444 */
4545 .irq = ehci_irq,
46− .flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
46+ .flags = HCD_MEMORY | HCD_USB2,
4747
4848 /*
4949 * basic lifecycle operations
drivers/usb/host/ehci-hcd.c+1−1
@@ -1158,7 +1158,7 @@ static const struct hc_driver ehci_hc_driver = { · 1157 unmodified lines
11581158 * generic hardware linkage
11591159 */
11601160 .irq = ehci_irq,
1161− .flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
1161+ .flags = HCD_MEMORY | HCD_USB2,
11621162
11631163 /*
11641164 * basic lifecycle operations
drivers/usb/host/ehci-mv.c+1−1
@@ -96,7 +96,7 @@ static const struct hc_driver mv_ehci_hc_driver = { · 95 unmodified lines
9696 * generic hardware linkage
9797 */
9898 .irq = ehci_irq,
99− .flags = HCD_MEMORY | HCD_USB2 | HCD_BH,
99+ .flags = HCD_MEMORY | HCD_USB2,
100100
101101 /*

1 more lines aren’t shown here.

drivers/usb/host/ehci-octeon.c+1−1

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

drivers/usb/host/ehci-pci.c+1−1

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

drivers/usb/host/ehci-pmcmsp.c+1−1

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

drivers/usb/host/ehci-ppc-of.c+1−1

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

drivers/usb/host/ehci-ps3.c+1−1

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

drivers/usb/host/ehci-q.c+5−0

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

drivers/usb/host/ehci-sead3.c+1−1

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

drivers/usb/host/ehci-sh.c+1−1

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

drivers/usb/host/ehci-tilegx.c+1−1

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

drivers/usb/host/ehci-w90x900.c+1−1

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

drivers/usb/host/ehci-xilinx-of.c+1−1

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

drivers/usb/host/fsl-mph-dr-of.c+3−3

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

drivers/usb/host/imx21-hcd.c+4−4

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

drivers/usb/host/ohci-hcd.c+12−10

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

drivers/usb/host/ohci-q.c+22−4

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

drivers/usb/host/uhci-pci.c+1−1

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

drivers/usb/host/uhci-q.c+8−4

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

drivers/usb/host/xhci-hub.c+36−11

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

drivers/usb/host/xhci-mem.c+2−0

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

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

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

drivers/usb/host/xhci-ring.c+35−2

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

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

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

drivers/usb/host/xhci.h+11−0

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

drivers/usb/musb/musb_dsps.c+3−0

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

drivers/usb/musb/musb_gadget.c+4−1

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

drivers/usb/phy/phy-gpio-vbus-usb.c+5−6

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

drivers/usb/phy/phy-omap-usb3.c+1−1

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

drivers/usb/serial/Kconfig+1−1

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

drivers/usb/serial/option.c+3−0

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

drivers/usb/serial/pl2303.c+32−11

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

drivers/vhost/scsi.c+34−16

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

drivers/vhost/vhost.c+3−1

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

drivers/video/mmp/hw/mmp_ctrl.c+2−15

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

drivers/video/mxsfb.c+1−0

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

drivers/video/neofb.c+3−1

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

drivers/video/of_display_timing.c+3−3

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

drivers/video/omap2/displays-new/Kconfig+1−0

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

drivers/video/omap2/displays-new/connector-analog-tv.c+1−1

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

drivers/video/omap2/displays-new/connector-dvi.c+1−1

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

drivers/video/omap2/displays-new/connector-hdmi.c+1−1

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

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

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

drivers/video/s3fb.c+1−8

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

drivers/xen/balloon.c+11−12

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

fs/9p/v9fs.c+4−3

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

fs/9p/vfs_inode_dotl.c+1−7

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

fs/afs/dir.c+0−3

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

fs/aio.c+37−15

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

fs/autofs4/waitq.c+3−10

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

fs/binfmt_elf.c+18−12

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

fs/bio-integrity.c+1−1

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

fs/bio.c+2−2

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

fs/btrfs/async-thread.c+19−6

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

fs/btrfs/async-thread.h+2−0

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

fs/btrfs/btrfs_inode.h+4−1

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

fs/btrfs/ctree.c+5−2

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

fs/btrfs/ctree.h+4−13

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

fs/btrfs/dev-replace.c+3−6

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

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

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

fs/btrfs/extent-tree.c+30−27

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

fs/btrfs/extent_io.c+14−4

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

fs/btrfs/file.c+2−2

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

fs/btrfs/free-space-cache.c+47−20

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

fs/btrfs/free-space-cache.h+3−2

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

fs/btrfs/inode.c+11−5

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

fs/btrfs/ioctl.c+47−33

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

fs/btrfs/ordered-data.c+3−21

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

fs/btrfs/ordered-data.h+2−3

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

fs/btrfs/relocation.c+25−18

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

fs/btrfs/scrub.c+98−14

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

fs/btrfs/super.c+20−1

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

fs/btrfs/transaction.c+3−6

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

fs/btrfs/tree-log.c+48−4

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

fs/btrfs/volumes.c+10−4

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

fs/cachefiles/namei.c+1−1

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

fs/cachefiles/xattr.c+15−14

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

fs/cifs/cifsfs.h+1−1

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

fs/cifs/cifsglob.h+1−4

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

fs/cifs/cifspdu.h+1−20

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

fs/cifs/cifssmb.c+0−1

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

fs/cifs/dir.c+1−0

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

fs/cifs/file.c+8−0

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

fs/cifs/fscache.c+7−0

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

fs/cifs/fscache.h+13−0

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

fs/cifs/inode.c+39−6

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

fs/cifs/readdir.c+3−0

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

fs/cifs/sess.c+1−83

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

fs/fscache/cookie.c+2−1

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

fs/fuse/dir.c+13−7

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

fs/fuse/file.c+17−6

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

fs/fuse/fuse_i.h+2−0

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

fs/gfs2/inode.c+3−1

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

fs/namei.c+22−12

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

fs/nfs/dir.c+4−1

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

fs/nfs/nfs4file.c+2−1

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

fs/nfs/nfs4filelayoutdev.c+11−9

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

fs/nfs/nfs4proc.c+47−11

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

fs/nilfs2/page.c+2−0

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

fs/nilfs2/segment.c+9−2

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

fs/ocfs2/dcache.c+4−3

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

fs/ocfs2/super.c+1−1

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

fs/open.c+18−3

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

fs/pstore/platform.c+23−6

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

fs/reiserfs/journal.c+4−63

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

fs/super.c+2−2

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

fs/sysv/super.c+1−0

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

fs/udf/ialloc.c+7−9

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

fs/udf/super.c+40−24

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

fs/udf/udf_sb.h+1−1

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

fs/xfs/xfs_buf_item.c+1−0

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

fs/xfs/xfs_da_btree.c+3−2

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

fs/xfs/xfs_dir2_block.c+3−3

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

fs/xfs/xfs_dir2_format.h+20−31

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

fs/xfs/xfs_dir2_readdir.c+2−2

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

fs/xfs/xfs_dir2_sf.c+3−3

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

fs/xfs/xfs_dquot.c+16−3

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

fs/xfs/xfs_fs.h+1−1

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

fs/xfs/xfs_icache.c+4−5

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

fs/xfs/xfs_log_recover.c+60−14

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

include/asm-generic/hugetlb.h+2−2

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

include/asm-generic/vtime.h+1−0

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

include/drm/drmP.h+3−4

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

include/drm/drm_pciids.h+3−0

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

include/linux/balloon_compaction.h+25−0

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

include/linux/bcma/bcma_driver_pci.h+1−0

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

include/linux/blkdev.h+11−0

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

include/linux/ceph/osd_client.h+2−0

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

include/linux/device-mapper.h+2−1

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

include/linux/hyperv.h+5−2

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

include/linux/intel-iommu.h+1−1

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

include/linux/kernel.h+11−0

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

include/linux/memcontrol.h+10−45

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

include/linux/mutex.h+3−3

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

include/linux/netdevice.h+4−4

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

include/linux/netfilter/ipset/ip_set.h+4−2

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

include/linux/nfs_xdr.h+2−1

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

include/linux/of_irq.h+8−12

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

include/linux/regulator/driver.h+2−0

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

include/linux/skbuff.h+1−1

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

include/linux/smp.h+6−0

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

include/linux/timex.h+1−0

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

include/linux/usb/usbnet.h+1−0

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

include/net/addrconf.h+4−0

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

include/net/bluetooth/hci.h+1−0

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

include/net/ip.h+8−4

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

include/net/ip_vs.h+3−6

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

include/net/mrp.h+1−0

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

include/net/net_namespace.h+1−0

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

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

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

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

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

include/net/secure_seq.h+0−1

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

include/net/sock.h+5−0

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

include/trace/events/block.h+4−2

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

include/trace/events/btrfs.h+1−0

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

include/uapi/drm/radeon_drm.h+2−0

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

include/uapi/linux/perf_event.h+10−5

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

ipc/msg.c+26−6

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

ipc/sem.c+141−73

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

ipc/shm.c+12−5

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

ipc/util.c+12−20

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

ipc/util.h+9−1

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

kernel/audit.c+3−2

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

kernel/context_tracking.c+12−0

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

kernel/events/core.c+21−0

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

kernel/kmod.c+4−0

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

kernel/params.c+3−3

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

kernel/pid.c+5−0

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

kernel/power/snapshot.c+4−1

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

kernel/power/user.c+8−0

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

kernel/reboot.c+8−1

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

kernel/softirq.c+12−3

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

kernel/time/ntp.c+2−4

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

kernel/time/timekeeping.c+2−0

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

kernel/watchdog.c+55−5

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

lib/hexdump.c+2−0

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

lib/kobject.c+1−4

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

lib/lockref.c+20−3

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

mm/Kconfig+1−1

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

mm/bounce.c+2−0

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

mm/compaction.c+7−0

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

mm/hwpoison-inject.c+3−2

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

mm/madvise.c+3−2

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

mm/memcontrol.c+407−153

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

mm/memory-failure.c+5−3

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

mm/migrate.c+1−1

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

mm/mlock.c+7−2

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

mm/page_alloc.c+0−4

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

mm/vmscan.c+34−53

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

net/802/mrp.c+27−0

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

net/batman-adv/soft-interface.c+2−0

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

net/bluetooth/hci_core.c+20−6

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

net/bluetooth/hci_event.c+5−1

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

net/bluetooth/l2cap_core.c+7−0

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

net/bluetooth/rfcomm/tty.c+2−33

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

net/bridge/br_netlink.c+2−2

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

net/bridge/br_private.h+3−5

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

net/bridge/br_stp.c+16−7

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

net/bridge/br_stp_if.c+10−2

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

net/ceph/osd_client.c+11−0

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

net/core/dev.c+48−1

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

net/core/flow_dissector.c+2−2

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

net/core/netpoll.c+5−6

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

net/core/secure_seq.c+24−3

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

net/dccp/ipv6.c+1−0

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

net/ipv4/af_inet.c+1−3

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

net/ipv4/igmp.c+4−4

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

net/ipv4/inetpeer.c+2−2

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

net/ipv4/ip_output.c+4−4

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

net/ipv4/ip_tunnel.c+11−11

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

net/ipv4/ip_tunnel_core.c+1−1

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

net/ipv4/ipmr.c+1−1

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

net/ipv4/netfilter/ipt_SYNPROXY.c+7−3

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

net/ipv4/raw.c+4−2

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

net/ipv4/tcp_metrics.c+3−1

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

net/ipv4/tcp_output.c+11−6

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

net/ipv4/udp.c+1−1

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

net/ipv4/xfrm4_mode_tunnel.c+1−1

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

net/ipv6/addrconf.c+42−37

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

net/ipv6/ip6_gre.c+2−2

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

net/ipv6/ip6_output.c+22−31

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

net/ipv6/ip6_tunnel.c+3−4

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

net/ipv6/mcast.c+3−3

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

net/ipv6/netfilter/ip6t_SYNPROXY.c+7−3

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

net/ipv6/netfilter/nf_nat_proto_icmpv6.c+2−2

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

net/ipv6/raw.c+3−1

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

net/ipv6/sit.c+70−16

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

net/ipv6/udp.c+3−1

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

net/lapb/lapb_timer.c+1−0

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

net/netfilter/ipset/ip_set_core.c+2−3

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

net/netfilter/ipset/ip_set_getport.c+2−2

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

net/netfilter/ipset/ip_set_hash_gen.h+16−12

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

net/netfilter/ipset/ip_set_hash_ipportnet.c+2−2

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

net/netfilter/ipset/ip_set_hash_net.c+2−2

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

net/netfilter/ipset/ip_set_hash_netiface.c+2−2

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

net/netfilter/ipset/ip_set_hash_netport.c+2−2

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

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

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

net/netfilter/ipvs/ip_vs_ctl.c+35−51

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

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

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

net/netfilter/ipvs/ip_vs_lblc.c+33−39

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

net/netfilter/ipvs/ip_vs_lblcr.c+26−36

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

net/netfilter/ipvs/ip_vs_nq.c+4−4

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

net/netfilter/ipvs/ip_vs_sed.c+4−4

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

net/netfilter/ipvs/ip_vs_wlc.c+3−3

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

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

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

net/netfilter/nf_synproxy_core.c+7−5

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

net/netfilter/nfnetlink_queue_core.c+1−1

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

net/sched/sch_fq.c+63−39

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

net/sctp/input.c+1−2

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

net/sctp/ipv6.c+14−30

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

net/sunrpc/auth_gss/auth_gss.c+11−0

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

net/sysctl_net.c+2−2

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

scripts/checkpatch.pl+2−2

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

security/apparmor/crypto.c+16−18

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

security/apparmor/include/policy.h+3−1

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

security/apparmor/policy.c+2−1

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

security/selinux/avc.c+3−6

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

security/selinux/hooks.c+7−8

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

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

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

sound/core/compress_offload.c+14−1

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

sound/pci/ac97/ac97_codec.c+1−0

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

sound/pci/hda/patch_cirrus.c+67−5

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

sound/pci/hda/patch_conexant.c+11−0

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

sound/pci/hda/patch_hdmi.c+29−18

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

sound/pci/hda/patch_realtek.c+15−1

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

sound/soc/blackfin/bf6xx-i2s.c+1−0

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

sound/soc/codecs/88pm860x-codec.c+3−0

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

sound/soc/codecs/ab8500-codec.c+6−1

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

sound/soc/codecs/max98095.c+2−2

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

sound/soc/fsl/imx-sgtl5000.c+5−2

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

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

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

tools/lib/lk/debugfs.c+0−1

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

tools/perf/arch/x86/util/tsc.c+3−3

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

tools/perf/builtin-inject.c+0−2

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

tools/perf/builtin-kmem.c+1−1

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

tools/perf/builtin-report.c+3−2

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

tools/perf/builtin-script.c+0−2

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

tools/perf/builtin-trace.c+18−0

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

tools/perf/config/Makefile+4−1

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

tools/perf/config/feature-tests.mak+10−0

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

tools/perf/util/annotate.c+1−1

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

tools/perf/util/dwarf-aux.c+19−0

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

tools/perf/util/dwarf-aux.h+3−0

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

tools/perf/util/header.c+28−13

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

tools/perf/util/hist.c+2−0

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

tools/perf/util/machine.c+1−1

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

tools/perf/util/probe-finder.c+46−43

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

tools/perf/util/probe-finder.h+3−0

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

tools/perf/util/session.c+7−2

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

tools/perf/util/session.h+4−0

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

tools/perf/util/symbol-elf.c+16−0

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

tools/perf/util/trace-event-parse.c+1−1

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

virt/kvm/kvm_main.c+4−2

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