History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts: net/bridge/br_mdb.c br_mdb.c conflict was a function call being removed to fix a bug in 'net' but whose signature was changed in 'net-next'.

David S. Miller committed 11 years ago

Commit c5e40ee2 parents 0528318 c5dfd65544 files · +4152 −3347Browse files

Unified · Split

544 files
  1. .mailmap +4 −1
  2. Documentation/ABI/testing/sysfs-bus-iio +2 −4
  3. Documentation/DocBook/drm.tmpl +1 −1
  4. Documentation/arm/SPEAr/overview.txt +1 −1
  5. Documentation/device-mapper/cache.txt +6 −0
  6. Documentation/device-mapper/thin-provisioning.txt +8 −1
  7. Documentation/devicetree/bindings/drm/imx/fsl-imx-drm.txt +24 −2
  8. Documentation/kbuild/makefiles.txt +8 −0
  9. MAINTAINERS +55 −54
  10. Makefile +6 −5
  11. arch/Kconfig +4 −0
  12. arch/alpha/include/asm/Kbuild +1 −0
  13. arch/alpha/include/asm/mm-arch-hooks.h +0 −15
  14. arch/arc/Kconfig +2 −1
  15. arch/arc/Makefile +2 −1
  16. arch/arc/boot/dts/axc003.dtsi +1 −1
  17. arch/arc/boot/dts/axc003_idu.dtsi +1 −1
  18. arch/arc/include/asm/Kbuild +1 −0
  19. arch/arc/include/asm/bitops.h +9 −26
  20. arch/arc/include/asm/futex.h +42 −6
  21. arch/arc/include/asm/mm-arch-hooks.h +0 −15
  22. arch/arc/include/asm/ptrace.h +1 −1
  23. arch/arc/kernel/intc-arcv2.c +0 −1
  24. arch/arc/kernel/intc-compact.c +0 −1
  25. arch/arc/kernel/mcip.c +19 −4
  26. arch/arc/kernel/setup.c +10 −5
  27. arch/arc/kernel/troubleshoot.c +0 −1
  28. arch/arc/mm/cache.c +10 −2
  29. arch/arc/mm/dma.c +2 −2
  30. arch/arm/boot/dts/am335x-pepper.dts +13 −3
  31. arch/arm/boot/dts/cros-ec-keyboard.dtsi +4 −0
  32. arch/arm/boot/dts/imx23.dtsi +1 −0
  33. arch/arm/boot/dts/imx27.dtsi +6 −6
  34. arch/arm/boot/dts/imx53-qsb-common.dtsi +3 −2
  35. arch/arm/boot/dts/k2e.dtsi +2 −1
  36. arch/arm/boot/dts/keystone.dtsi +2 −1
  37. arch/arm/boot/dts/omap3-overo-common-lcd35.dtsi +1 −1
  38. arch/arm/boot/dts/omap3-overo-common-lcd43.dtsi +1 −1
  39. arch/arm/boot/dts/omap4.dtsi +2 −0
  40. arch/arm/boot/dts/omap5.dtsi +2 −0
  41. arch/arm/boot/dts/socfpga_cyclone5_sockit.dts +13 −13
  42. arch/arm/boot/dts/spear1310-evb.dts +1 −1
  43. arch/arm/boot/dts/spear1310.dtsi +1 −1
  44. arch/arm/boot/dts/spear1340-evb.dts +1 −1
  45. arch/arm/boot/dts/spear1340.dtsi +1 −1
  46. arch/arm/boot/dts/spear13xx.dtsi +1 −1
  47. arch/arm/boot/dts/spear300-evb.dts +1 −1
  48. arch/arm/boot/dts/spear300.dtsi +1 −1
  49. arch/arm/boot/dts/spear310-evb.dts +1 −1
  50. arch/arm/boot/dts/spear310.dtsi +1 −1
  51. arch/arm/boot/dts/spear320-evb.dts +1 −1
  52. arch/arm/boot/dts/spear320.dtsi +1 −1
  53. arch/arm/boot/dts/spear3xx.dtsi +1 −1
  54. arch/arm/boot/dts/ste-ccu8540.dts +7 −0
  55. arch/arm/boot/dts/ste-ccu9540.dts +7 −0
  56. arch/arm/boot/dts/ste-dbx5x0.dtsi +3 −3
  57. arch/arm/boot/dts/ste-href.dtsi +1 −1
  58. arch/arm/boot/dts/ste-hrefprev60-stuib.dts +7 −0
  59. arch/arm/boot/dts/ste-hrefprev60-tvk.dts +7 −0
  60. arch/arm/boot/dts/ste-hrefprev60.dtsi +5 −0
  61. arch/arm/boot/dts/ste-hrefv60plus-stuib.dts +7 −0
  62. arch/arm/boot/dts/ste-hrefv60plus-tvk.dts +7 −0
  63. arch/arm/boot/dts/ste-hrefv60plus.dtsi +23 −2
  64. arch/arm/boot/dts/ste-snowball.dts +23 −2
  65. arch/arm/include/asm/Kbuild +1 −0
  66. arch/arm/include/asm/memory.h +1 −1
  67. arch/arm/include/asm/mm-arch-hooks.h +0 −15
  68. arch/arm/kernel/perf_event.c +2 −1
  69. arch/arm/kernel/reboot.c +1 −1
  70. arch/arm/mach-imx/gpc.c +6 −21
  71. arch/arm/mach-omap2/Kconfig +1 −0
  72. arch/arm/mach-pxa/capc7117.c +3 −0
  73. arch/arm/mach-pxa/cm-x2xx.c +3 −0
  74. arch/arm/mach-pxa/cm-x300.c +2 −0
  75. arch/arm/mach-pxa/colibri-pxa270.c +3 −0
  76. arch/arm/mach-pxa/em-x270.c +2 −0
  77. arch/arm/mach-pxa/icontrol.c +3 −0
  78. arch/arm/mach-pxa/trizeps4.c +3 −0
  79. arch/arm/mach-pxa/vpac270.c +3 −0
  80. arch/arm/mach-pxa/zeus.c +2 −0
  81. arch/arm/mach-spear/generic.h +1 −1
  82. arch/arm/mach-spear/include/mach/irqs.h +1 −1
  83. arch/arm/mach-spear/include/mach/misc_regs.h +1 −1
  84. arch/arm/mach-spear/include/mach/spear.h +1 −1
  85. arch/arm/mach-spear/include/mach/uncompress.h +1 −1
  86. arch/arm/mach-spear/pl080.c +1 −1
  87. arch/arm/mach-spear/pl080.h +1 −1
  88. arch/arm/mach-spear/restart.c +1 −1
  89. arch/arm/mach-spear/spear1310.c +1 −1
  90. arch/arm/mach-spear/spear1340.c +1 −1
  91. arch/arm/mach-spear/spear13xx.c +1 −1
  92. arch/arm/mach-spear/spear300.c +1 −1
  93. arch/arm/mach-spear/spear310.c +1 −1
  94. arch/arm/mach-spear/spear320.c +1 −1
  95. arch/arm/mach-spear/spear3xx.c +1 −1
  96. arch/arm/mm/dma-mapping.c +1 −1
  97. arch/arm/mm/proc-v7.S +9 −5
  98. arch/arm/net/bpf_jit_32.c +44 −13
  99. arch/arm64/include/asm/Kbuild +1 −0
  100. arch/arm64/include/asm/mm-arch-hooks.h +0 −15
  101. arch/arm64/kernel/entry.S +3 −2
  102. arch/arm64/kernel/irq.c +2 −2
  103. arch/avr32/include/asm/Kbuild +1 −0
  104. arch/avr32/include/asm/mm-arch-hooks.h +0 −15
  105. arch/avr32/kernel/time.c +33 −32
  106. arch/blackfin/include/asm/Kbuild +1 −0
  107. arch/blackfin/include/asm/mm-arch-hooks.h +0 −15
  108. arch/c6x/include/asm/Kbuild +1 −0
  109. arch/c6x/include/asm/mm-arch-hooks.h +0 −15
  110. arch/cris/include/asm/Kbuild +1 −0
  111. arch/cris/include/asm/mm-arch-hooks.h +0 −15
  112. arch/frv/include/asm/Kbuild +1 −0
  113. arch/frv/include/asm/mm-arch-hooks.h +0 −15
  114. arch/h8300/include/asm/Kbuild +1 −0
  115. arch/hexagon/include/asm/Kbuild +1 −0
  116. arch/hexagon/include/asm/mm-arch-hooks.h +0 −15
  117. arch/ia64/include/asm/Kbuild +1 −0
  118. arch/ia64/include/asm/mm-arch-hooks.h +0 −15
  119. arch/m32r/include/asm/Kbuild +1 −0
  120. arch/m32r/include/asm/mm-arch-hooks.h +0 −15
  121. arch/m68k/Kconfig.cpu +27 −22
  122. arch/m68k/configs/m5208evb_defconfig +3 −19
  123. arch/m68k/configs/m5249evb_defconfig +2 −15
  124. arch/m68k/configs/m5272c3_defconfig +2 −12
  125. arch/m68k/configs/m5275evb_defconfig +2 −17
  126. arch/m68k/configs/m5307c3_defconfig +3 −18
  127. arch/m68k/configs/m5407c3_defconfig +2 −15
  128. arch/m68k/configs/m5475evb_defconfig +1 −8
  129. arch/m68k/include/asm/Kbuild +1 −0
  130. arch/m68k/include/asm/coldfire.h +1 −1
  131. arch/m68k/include/asm/io_mm.h +2 −1
  132. arch/m68k/include/asm/mm-arch-hooks.h +0 −15
  133. arch/metag/include/asm/Kbuild +1 −0
  134. arch/metag/include/asm/mm-arch-hooks.h +0 −15
  135. arch/microblaze/include/asm/Kbuild +1 −0
  136. arch/microblaze/include/asm/mm-arch-hooks.h +0 −15
  137. arch/mips/Kconfig +1 −5
  138. arch/mips/Makefile +0 −7
  139. arch/mips/include/asm/Kbuild +1 −0
  140. arch/mips/include/asm/fpu.h +1 −1
  141. arch/mips/include/asm/mach-sibyte/war.h +1 −2
  142. arch/mips/include/asm/mm-arch-hooks.h +0 −15
  143. arch/mips/include/uapi/asm/sigcontext.h +2 −2
  144. arch/mips/kernel/asm-offsets.c +1 −1
  145. arch/mips/sibyte/Kconfig +0 −5
  146. arch/mips/sibyte/common/bus_watcher.c +1 −4
  147. arch/mips/sibyte/sb1250/setup.c +0 −2
  148. arch/mn10300/include/asm/Kbuild +1 −0
  149. arch/mn10300/include/asm/mm-arch-hooks.h +0 −15
  150. arch/nios2/include/asm/Kbuild +1 −0
  151. arch/nios2/include/asm/mm-arch-hooks.h +0 −15
  152. arch/openrisc/Kconfig +1 −3
  153. arch/openrisc/include/asm/Kbuild +1 −0
  154. arch/openrisc/include/asm/mm-arch-hooks.h +0 −15
  155. arch/parisc/include/asm/Kbuild +1 −0
  156. arch/parisc/include/asm/mm-arch-hooks.h +0 −15
  157. arch/parisc/include/asm/pgalloc.h +2 −1
  158. arch/s390/include/asm/Kbuild +1 −0
  159. arch/s390/include/asm/ctl_reg.h +4 −1
  160. arch/s390/include/asm/hugetlb.h +1 −0
  161. arch/s390/include/asm/mm-arch-hooks.h +0 −15
  162. arch/s390/include/asm/page.h +4 −4
  163. arch/s390/include/asm/perf_event.h +8 −0
  164. arch/s390/kernel/asm-offsets.c +7 −8
  165. arch/s390/kernel/entry.S +9 −4
  166. arch/s390/kernel/nmi.c +30 −21
  167. arch/s390/kernel/process.c +1 −1
  168. arch/s390/kernel/sclp.S +4 −0
  169. arch/s390/kernel/setup.c +0 −2
  170. arch/s390/kernel/traps.c +2 −2
  171. arch/s390/mm/pgtable.c +0 −2
  172. arch/s390/oprofile/init.c +1 −0
  173. arch/score/include/asm/Kbuild +1 −0
  174. arch/score/include/asm/mm-arch-hooks.h +0 −15
  175. arch/sh/include/asm/Kbuild +1 −0
  176. arch/sh/include/asm/mm-arch-hooks.h +0 −15
  177. arch/sparc/include/asm/Kbuild +1 −0
  178. arch/sparc/include/asm/mm-arch-hooks.h +0 −15
  179. arch/tile/include/asm/Kbuild +1 −0
  180. arch/tile/include/asm/mm-arch-hooks.h +0 −15
  181. arch/um/include/asm/Kbuild +1 −0
  182. arch/um/include/asm/mm-arch-hooks.h +0 −15
  183. arch/unicore32/include/asm/Kbuild +1 −0
  184. arch/unicore32/include/asm/mm-arch-hooks.h +0 −15
  185. arch/x86/Kconfig +1 −0
  186. arch/x86/Kconfig.debug +12 −0
  187. arch/x86/entry/entry_64.S +199 −100
  188. arch/x86/include/asm/Kbuild +1 −0
  189. arch/x86/include/asm/fpu/types.h +38 −34
  190. arch/x86/include/asm/intel_pmc_ipc.h +0 −27
  191. arch/x86/include/asm/kvm_host.h +2 −0
  192. arch/x86/include/asm/mm-arch-hooks.h +0 −15
  193. arch/x86/include/asm/mmu_context.h +1 −1
  194. arch/x86/include/asm/processor.h +7 −3
  195. arch/x86/include/uapi/asm/hyperv.h +2 −0
  196. arch/x86/kernel/fpu/init.c +40 −0
  197. arch/x86/kernel/nmi.c +52 −71
  198. arch/x86/kernel/process.c +1 −1
  199. arch/x86/kernel/smpboot.c +11 −0
  200. arch/x86/kvm/cpuid.c +2 −0
  201. arch/x86/kvm/iommu.c +2 −0
  202. arch/x86/kvm/mmu.c +9 −1
  203. arch/x86/kvm/svm.c +103 −5
  204. arch/x86/kvm/vmx.c +3 −8
  205. arch/x86/kvm/x86.c +19 −7
  206. arch/xtensa/include/asm/Kbuild +1 −0
  207. arch/xtensa/include/asm/mm-arch-hooks.h +0 −15
  208. block/bio-integrity.c +2 −2
  209. block/blk-cgroup.c +81 −59
  210. block/blk-core.c +1 −1
  211. block/blk-mq.c +1 −1
  212. drivers/acpi/resource.c +15 −9
  213. drivers/ata/pata_arasan_cf.c +2 −2
  214. drivers/block/nvme-core.c +11 −2
  215. drivers/bluetooth/btbcm.c +5 −6
  216. drivers/char/tpm/tpm-chip.c +2 −1
  217. drivers/char/tpm/tpm_crb.c +8 −0
  218. drivers/clk/spear/clk-aux-synth.c +1 −1
  219. drivers/clk/spear/clk-frac-synth.c +1 −1
  220. drivers/clk/spear/clk-gpt-synth.c +1 −1
  221. drivers/clk/spear/clk-vco-pll.c +1 −1
  222. drivers/clk/spear/clk.c +1 −1
  223. drivers/clk/spear/clk.h +1 −1
  224. drivers/clk/spear/spear1310_clock.c +1 −1
  225. drivers/clk/spear/spear1340_clock.c +1 −1
  226. drivers/clk/spear/spear3xx_clock.c +1 −1
  227. drivers/clk/spear/spear6xx_clock.c +1 −1
  228. drivers/cpufreq/cpufreq.c +10 −0
  229. drivers/cpufreq/freq_table.c +0 −9
  230. drivers/cpuidle/cpuidle.c +7 −2
  231. drivers/dma/dw/core.c +1 −1
  232. drivers/gpio/gpio-brcmstb.c +11 −3
  233. drivers/gpio/gpio-davinci.c +2 −4
  234. drivers/gpio/gpio-max732x.c +1 −0
  235. drivers/gpio/gpio-omap.c +4 −1
  236. drivers/gpio/gpio-pca953x.c +4 −0
  237. drivers/gpio/gpio-xilinx.c +2 −2
  238. drivers/gpio/gpio-zynq.c +1 −0
  239. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +16 −3
  240. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 −2
  241. drivers/gpu/drm/amd/amdgpu/cz_dpm.c +12 −4
  242. drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +4 −0
  243. drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1 −4
  244. drivers/gpu/drm/amd/amdgpu/vi.c +33 −2
  245. drivers/gpu/drm/armada/armada_crtc.c +0 −2
  246. drivers/gpu/drm/armada/armada_gem.c +3 −2
  247. drivers/gpu/drm/armada/armada_overlay.c +75 −46
  248. drivers/gpu/drm/drm_crtc.c +5 −2
  249. drivers/gpu/drm/drm_ioc32.c +60 −0
  250. drivers/gpu/drm/i915/i915_drv.h +3 −3
  251. drivers/gpu/drm/i915/i915_gem.c +17 −18
  252. drivers/gpu/drm/i915/i915_gem_context.c +2 −2
  253. drivers/gpu/drm/i915/i915_gem_dmabuf.c +0 −2
  254. drivers/gpu/drm/i915/i915_gem_gtt.c +2 −7
  255. drivers/gpu/drm/i915/i915_gem_stolen.c +0 −1
  256. drivers/gpu/drm/i915/i915_gem_tiling.c +1 −11
  257. drivers/gpu/drm/i915/i915_gem_userptr.c +27 −2
  258. drivers/gpu/drm/i915/i915_ioc32.c +1 −1
  259. drivers/gpu/drm/i915/i915_irq.c +3 −10
  260. drivers/gpu/drm/i915/i915_trace.h +1 −1
  261. drivers/gpu/drm/i915/intel_display.c +3 −5
  262. drivers/gpu/drm/i915/intel_ringbuffer.h +7 −0
  263. drivers/gpu/drm/imx/imx-tve.c +1 −1
  264. drivers/gpu/drm/imx/parallel-display.c +15 −6
  265. drivers/gpu/drm/radeon/ci_dpm.c +1 −1
  266. drivers/gpu/drm/radeon/radeon_gart.c +8 −4
  267. drivers/gpu/drm/radeon/radeon_gem.c +1 −0
  268. drivers/gpu/drm/radeon/radeon_object.c +0 −1
  269. drivers/gpu/drm/radeon/si_dpm.c +1 −0
  270. drivers/gpu/drm/rockchip/rockchip_drm_drv.c +0 −1
  271. drivers/gpu/drm/rockchip/rockchip_drm_fb.c +2 −1
  272. drivers/gpu/drm/rockchip/rockchip_drm_gem.c +34 −33
  273. drivers/gpu/drm/rockchip/rockchip_drm_vop.c +36 −13
  274. drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +6 −7
  275. drivers/gpu/ipu-v3/ipu-common.c +3 −0
  276. drivers/iio/accel/bmc150-accel.c +1 −1
  277. drivers/iio/adc/Kconfig +1 −2
  278. drivers/iio/adc/at91_adc.c +4 −4
  279. drivers/iio/adc/rockchip_saradc.c +4 −0
  280. drivers/iio/adc/twl4030-madc.c +2 −1
  281. drivers/iio/common/hid-sensors/hid-sensor-trigger.c +10 −1
  282. drivers/iio/dac/ad5624r_spi.c +2 −2
  283. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +18 −0
  284. drivers/iio/light/Kconfig +2 −0
  285. drivers/iio/light/cm3323.c +1 −1
  286. drivers/iio/light/ltr501.c +1 −1
  287. drivers/iio/light/stk3310.c +17 −36
  288. drivers/iio/light/tcs3414.c +1 −1
  289. drivers/iio/magnetometer/mmc35240.c +21 −14
  290. drivers/iio/proximity/sx9500.c +15 −13
  291. drivers/iio/temperature/tmp006.c +3 −0
  292. drivers/infiniband/core/agent.c +2 −2
  293. drivers/infiniband/core/cm.c +55 −6
  294. drivers/infiniband/core/iwpm_msg.c +16 −17
  295. drivers/infiniband/core/iwpm_util.c +10 −2
  296. drivers/infiniband/core/iwpm_util.h +22 −6
  297. drivers/infiniband/core/mad.c +17 −30
  298. drivers/infiniband/core/multicast.c +2 −6
  299. drivers/infiniband/core/opa_smi.h +2 −2
  300. drivers/infiniband/core/sa_query.c +2 −6
  301. drivers/infiniband/core/smi.c +18 −19
  302. drivers/infiniband/core/smi.h +2 −2
  303. drivers/infiniband/core/sysfs.c +1 −1
  304. drivers/infiniband/core/ucm.c +2 −2
  305. drivers/infiniband/core/ucma.c +3 −2
  306. drivers/infiniband/hw/ehca/ehca_sqp.c +3 −2
  307. drivers/infiniband/hw/ipath/ipath_mad.c +3 −2
  308. drivers/infiniband/hw/ipath/ipath_verbs.c +2 −2
  309. drivers/infiniband/hw/mlx4/mad.c +22 −12
  310. drivers/infiniband/hw/mlx4/main.c +18 −15
  311. drivers/infiniband/hw/mlx5/mad.c +3 −2
  312. drivers/infiniband/hw/mthca/mthca_mad.c +3 −2
  313. drivers/infiniband/hw/nes/nes_cm.c +3 −2
  314. drivers/infiniband/hw/nes/nes_hw.c +1 −1
  315. drivers/infiniband/hw/ocrdma/ocrdma_ah.c +3 −2
  316. drivers/infiniband/hw/ocrdma/ocrdma_main.c +1 −0
  317. drivers/infiniband/hw/qib/qib_mad.c +3 −2
  318. drivers/infiniband/ulp/ipoib/ipoib.h +28 −1
  319. drivers/infiniband/ulp/ipoib/ipoib_cm.c +14 −19
  320. drivers/infiniband/ulp/ipoib/ipoib_ib.c +18 −31
  321. drivers/infiniband/ulp/ipoib/ipoib_main.c +8 −13
  322. drivers/infiniband/ulp/srp/ib_srp.c +6 −17
  323. drivers/infiniband/ulp/srpt/ib_srpt.c +35 −36
  324. drivers/irqchip/irq-gic-v3-its.c +75 −36
  325. drivers/irqchip/spear-shirq.c +1 −1
  326. drivers/isdn/gigaset/ser-gigaset.c +10 −25
  327. drivers/md/bcache/closure.h +0 −3
  328. drivers/md/bcache/io.c +1 −0
  329. drivers/md/bcache/journal.c +2 −0
  330. drivers/md/bcache/request.c +11 −3
  331. drivers/md/dm-cache-target.c +23 −15
  332. drivers/md/dm-thin.c +37 −7
  333. drivers/md/dm.c +4 −8
  334. drivers/md/persistent-data/dm-btree-remove.c +3 −3
  335. drivers/md/persistent-data/dm-btree.c +1 −1
  336. drivers/mfd/stmpe-i2c.c +1 −1
  337. drivers/mfd/stmpe-spi.c +2 −2
  338. drivers/mmc/host/sdhci-spear.c +2 −2
  339. drivers/net/bonding/bond_main.c +31 −3
  340. drivers/net/can/at91_can.c +4 −4
  341. drivers/net/can/bfin_can.c +2 −4
  342. drivers/net/can/cc770/cc770.c +2 −2
  343. drivers/net/can/flexcan.c +3 −4
  344. drivers/net/can/grcan.c +2 −1
  345. drivers/net/can/sja1000/sja1000.c +2 −4
  346. drivers/net/can/slcan.c +1 −1
  347. drivers/net/can/spi/mcp251x.c +8 −9
  348. drivers/net/can/ti_hecc.c +1 −1
  349. drivers/net/can/usb/ems_usb.c +2 −4
  350. drivers/net/can/usb/esd_usb2.c +2 −4
  351. drivers/net/can/usb/peak_usb/pcan_usb.c +3 −4
  352. drivers/net/can/usb/peak_usb/pcan_usb_pro.c +2 −2
  353. drivers/net/can/usb/usb_8dev.c +2 −4
  354. drivers/net/dsa/bcm_sf2.c +13 −2
  355. drivers/net/dsa/mv88e6xxx.c +1 −1
  356. drivers/net/ethernet/broadcom/sb1250-mac.c +0 −9
  357. drivers/net/ethernet/freescale/fec_main.c +13 −75
  358. drivers/net/ethernet/marvell/mvneta.c +10 −12
  359. drivers/net/ethernet/renesas/ravb_main.c +38 −36
  360. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 −1
  361. drivers/net/ethernet/ti/cpsw.c +3 −6
  362. drivers/net/ethernet/ti/netcp_core.c +1 −1
  363. drivers/net/ipvlan/ipvlan.h +6 −3
  364. drivers/net/ipvlan/ipvlan_core.c +2 −4
  365. drivers/net/ipvlan/ipvlan_main.c +19 −23
  366. drivers/net/phy/dp83867.c +1 −1
  367. drivers/net/phy/mdio_bus.c +17 −2
  368. drivers/net/usb/qmi_wwan.c +1 −0
  369. drivers/net/virtio_net.c +2 −1
  370. drivers/net/wireless/ath/ath9k/hw.c +1 −0
  371. drivers/net/wireless/iwlwifi/iwl-fh.h +6 −0
  372. drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +5 −7
  373. drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h +2 −1
  374. drivers/net/wireless/iwlwifi/mvm/scan.c +3 −0
  375. drivers/net/wireless/iwlwifi/mvm/sta.c +2 −1
  376. drivers/net/wireless/iwlwifi/mvm/time-event.c +1 −1
  377. drivers/net/wireless/iwlwifi/mvm/tx.c +1 −1
  378. drivers/net/wireless/iwlwifi/pcie/drv.c +3 −2
  379. drivers/net/wireless/iwlwifi/pcie/internal.h +8 −43
  380. drivers/net/wireless/iwlwifi/pcie/rx.c +83 −331
  381. drivers/net/wireless/iwlwifi/pcie/trans.c +29 −23
  382. drivers/net/xen-netback/netback.c +3 −3
  383. drivers/pinctrl/bcm/pinctrl-bcm2835.c +2 −0
  384. drivers/pinctrl/freescale/pinctrl-imx1-core.c +1 −2
  385. drivers/pinctrl/nomadik/pinctrl-abx500.c +0 −1
  386. drivers/pinctrl/pinctrl-lpc18xx.c +2 −2
  387. drivers/pinctrl/pinctrl-single.c +2 −1
  388. drivers/pinctrl/samsung/pinctrl-samsung.c +0 −5
  389. drivers/pinctrl/sh-pfc/sh_pfc.h +1 −1
  390. drivers/pinctrl/spear/pinctrl-spear.c +1 −1
  391. drivers/pinctrl/spear/pinctrl-spear.h +1 −1
  392. drivers/pinctrl/spear/pinctrl-spear1310.c +2 −2
  393. drivers/pinctrl/spear/pinctrl-spear1340.c +2 −2
  394. drivers/pinctrl/spear/pinctrl-spear300.c +2 −2
  395. drivers/pinctrl/spear/pinctrl-spear310.c +2 −2
  396. drivers/pinctrl/spear/pinctrl-spear320.c +2 −2
  397. drivers/pinctrl/spear/pinctrl-spear3xx.c +1 −1
  398. drivers/pinctrl/spear/pinctrl-spear3xx.h +1 −1
  399. drivers/platform/x86/dell-laptop.c +125 −46
  400. drivers/platform/x86/intel_pmc_ipc.c +48 −35
  401. drivers/platform/x86/intel_scu_ipc.c +3 −3
  402. drivers/rtc/rtc-armada38x.c +1 −1
  403. drivers/rtc/rtc-mt6397.c +2 −2
  404. drivers/s390/block/dasd.c +29 −7
  405. drivers/s390/block/dasd_alias.c +2 −1
  406. drivers/s390/char/sclp_early.c +1 −0
  407. drivers/s390/crypto/zcrypt_api.c +7 −0
  408. drivers/scsi/scsi_sysfs.c +1 −1
  409. drivers/scsi/scsi_transport_srp.c +2 −1
  410. drivers/scsi/st.c +1 −1
  411. drivers/staging/board/Kconfig +1 −1
  412. drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +0 −1
  413. drivers/staging/vt6655/device_main.c +1 −1
  414. drivers/staging/vt6656/main_usb.c +1 −1
  415. drivers/usb/dwc2/core.c +15 −40
  416. drivers/usb/dwc2/core.h +6 −3
  417. drivers/usb/dwc2/hcd.c +42 −13
  418. drivers/usb/dwc2/hcd.h +4 −1
  419. drivers/usb/dwc2/hcd_queue.c +12 −37
  420. drivers/usb/dwc3/core.c +4 −2
  421. drivers/usb/gadget/composite.c +7 −4
  422. drivers/usb/gadget/configfs.c +1 −1
  423. drivers/usb/gadget/function/f_fs.c +4 −2
  424. drivers/usb/gadget/function/f_mass_storage.c +13 −3
  425. drivers/usb/gadget/function/f_midi.c +1 −3
  426. drivers/usb/gadget/udc/fotg210-udc.c +1 −2
  427. drivers/usb/musb/musb_virthub.c +1 −3
  428. drivers/usb/phy/phy-mxs-usb.c +3 −0
  429. drivers/usb/serial/cp210x.c +1 −0
  430. drivers/usb/serial/mos7720.c +138 −115
  431. drivers/usb/serial/option.c +1 −0
  432. drivers/usb/serial/usb-serial.c +1 −0
  433. drivers/watchdog/sp805_wdt.c +2 −2
  434. fs/btrfs/extent-tree.c +13 −0
  435. fs/btrfs/inode.c +2 −3
  436. fs/btrfs/ioctl.c +17 −1
  437. fs/btrfs/transaction.c +2 −2
  438. fs/configfs/item.c +2 −2
  439. fs/jfs/file.c +1 −1
  440. fs/jfs/inode.c +2 −2
  441. fs/jfs/namei.c +13 −14
  442. fs/locks.c +18 −20
  443. fs/nfs/nfs4proc.c +8 −10
  444. fs/proc/Kconfig +6 −0
  445. fs/proc/base.c +5 −0
  446. fs/proc/kcore.c +2 −2
  447. fs/udf/inode.c +7 −12
  448. include/asm-generic/mm-arch-hooks.h +16 −0
  449. include/linux/amba/sp810.h +1 −1
  450. include/linux/blk-cgroup.h +3 −8
  451. include/linux/clkdev.h +4 −3
  452. include/linux/compat.h +1 −1
  453. include/linux/configfs.h +2 −1
  454. include/linux/cpu.h +4 −3
  455. include/linux/dcache.h +2 −1
  456. include/linux/device.h +7 −8
  457. include/linux/fs.h +20 −10
  458. include/linux/gpio/driver.h +1 −1
  459. include/linux/hid-sensor-hub.h +1 −0
  460. include/linux/hugetlb.h +8 −9
  461. include/linux/init.h +0 −78
  462. include/linux/iommu.h +1 −1
  463. include/linux/kernel.h +5 −4
  464. include/linux/kobject.h +3 −2
  465. include/linux/kvm_host.h +18 −0
  466. include/linux/mmiotrace.h +1 −1
  467. include/linux/module.h +84 −0
  468. include/linux/page_owner.h +13 −0
  469. include/linux/pata_arasan_cf_data.h +1 −1
  470. include/linux/printk.h +3 −3
  471. include/linux/sched.h +14 −2
  472. include/net/cfg80211.h +17 −0
  473. include/net/ip.h +1 −0
  474. include/rdma/ib_verbs.h +17 −3
  475. include/scsi/scsi_transport_srp.h +1 −0
  476. kernel/cpu.c +0 −9
  477. kernel/fork.c +6 −1
  478. kernel/irq/resend.c +13 −5
  479. kernel/sched/fair.c +1 −1
  480. kernel/time/tick-broadcast.c +0 −1
  481. kernel/time/tick-common.c +1 −0
  482. kernel/trace/trace.h +1 −0
  483. kernel/trace/trace_branch.c +10 −7
  484. lib/decompress.c +4 −1
  485. lib/dma-debug.c +3 −0
  486. lib/hexdump.c +4 −3
  487. lib/kobject.c +3 −2
  488. mm/cma_debug.c +6 −5
  489. mm/page_alloc.c +8 −6
  490. mm/page_owner.c +7 −0
  491. net/ax25/ax25_subr.c +1 −0
  492. net/bridge/br_mdb.c +0 −1
  493. net/bridge/br_multicast.c +30 −7
  494. net/caif/caif_socket.c +8 −11
  495. net/core/datagram.c +47 −9
  496. net/core/dst.c +3 −1
  497. net/core/rtnetlink.c +7 −4
  498. net/ipv4/datagram.c +12 −4
  499. net/ipv4/inet_hashtables.c +5 −6
  500. net/ipv4/ip_fragment.c +4 −2
  501. net/ipv4/tcp_input.c +1 −2
  502. net/ipv6/datagram.c +15 −5
  503. net/ipv6/ip6_offload.c +0 −2
  504. net/mac80211/debugfs_netdev.c +1 −0
  505. net/mac80211/iface.c +14 −11
  506. net/mac80211/mesh_plink.c +4 −1
  507. net/mac80211/pm.c +16 −0
  508. net/mac80211/tdls.c +3 −3
  509. net/mac80211/tx.c +3 −1
  510. net/netlink/af_netlink.c +47 −32
  511. net/openvswitch/flow_table.c +1 −1
  512. net/rds/ib_rdma.c +3 −1
  513. net/sched/act_bpf.c +3 −0
  514. net/sched/cls_bpf.c +1 −1
  515. net/sched/cls_flow.c +3 −2
  516. net/sched/cls_flower.c +1 −1
  517. net/sched/sch_fq_codel.c +11 −2
  518. net/sched/sch_sfq.c +1 −1
  519. net/wireless/chan.c +34 −11
  520. net/wireless/nl80211.c +8 −6
  521. net/wireless/reg.c +4 −4
  522. net/wireless/trace.h +7 −4
  523. samples/trace_events/trace-events-sample.h +5 −2
  524. scripts/checkpatch.pl +1 −1
  525. sound/pci/hda/hda_generic.c +1 −1
  526. sound/pci/hda/patch_hdmi.c +2 −0
  527. sound/pci/hda/patch_realtek.c +55 −0
  528. sound/usb/line6/pcm.c +2 −7
  529. sound/usb/quirks-table.h +68 −0
  530. tools/lib/api/Makefile +1 −1
  531. tools/lib/hweight.c +62 −0
  532. tools/lib/traceevent/Makefile +1 −1
  533. tools/perf/MANIFEST +1 −1
  534. tools/perf/Makefile.perf +16 −3
  535. tools/perf/builtin-stat.c +2 −2
  536. tools/perf/ui/browsers/hists.c +1 −1
  537. tools/perf/util/Build +1 −1
  538. tools/perf/util/auxtrace.c +5 −5
  539. tools/perf/util/python-ext-sources +2 −2
  540. tools/perf/util/symbol.c +2 −0
  541. tools/perf/util/symbol.h +2 −1
  542. tools/perf/util/thread_map.c +1 −2
  543. tools/perf/util/vdso.c +3 −5
  544. virt/kvm/vfio.c +5 −0
.mailmap+4−1
@@ -116,6 +116,7 @@ Shiraz Hashim <shiraz.linux.kernel@gmail.com> <shiraz.hashim@st.com> · 115 unmodified lines
116116 Simon Kelley <simon@thekelleys.org.uk>
117117 Stéphane Witzmann <stephane.witzmann@ubpmes.univ-bpclermont.fr>
118118 Stephen Hemminger <shemminger@osdl.org>
119+Sudeep Holla <sudeep.holla@arm.com> Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
119120 Sumit Semwal <sumit.semwal@ti.com>
120121 Tejun Heo <htejun@gmail.com>
121122 Thomas Graf <tgraf@suug.ch>
@@ -125,7 +126,9 @@ Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> · 3 unmodified lines
125126 Uwe Kleine-König <ukl@pengutronix.de>
126127 Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
127128 Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
128−Viresh Kumar <viresh.linux@gmail.com> <viresh.kumar@st.com>
129+Viresh Kumar <vireshk@kernel.org> <viresh.kumar@st.com>
130+Viresh Kumar <vireshk@kernel.org> <viresh.linux@gmail.com>
131+Viresh Kumar <vireshk@kernel.org> <viresh.kumar2@arm.com>
129132 Takashi YOSHII <takashi.yoshii.zj@renesas.com>
130133 Yusuke Goda <goda.yusuke@renesas.com>
131134 Gustavo Padovan <gustavo@las.ic.unicamp.br>
Documentation/ABI/testing/sysfs-bus-iio+2−4
@@ -1234,10 +1234,8 @@ Description: · 1233 unmodified lines
12341234 object is near the sensor, usually be observing
12351235 reflectivity of infrared or ultrasound emitted.
12361236 Often these sensors are unit less and as such conversion
1237− to SI units is not possible. Where it is, the units should
1238− be meters. If such a conversion is not possible, the reported
1239− values should behave in the same way as a distance, i.e. lower
1240− values indicate something is closer to the sensor.
1237+ to SI units is not possible. Higher proximity measurements
1238+ indicate closer objects, and vice versa.
12411239
12421240 What: /sys/.../iio:deviceX/in_illuminance_input
12431241 What: /sys/.../iio:deviceX/in_illuminance_raw
Documentation/DocBook/drm.tmpl+1−1
@@ -3383,7 +3383,7 @@ void intel_crt_init(struct drm_device *dev) · 3382 unmodified lines
33833383 <td valign="top" >TBD</td>
33843384 </tr>
33853385 <tr>
3386− <td rowspan="2" valign="top" >omap</td>
3386+ <td valign="top" >omap</td>
33873387 <td valign="top" >Generic</td>
33883388 <td valign="top" >“zorder”</td>
33893389 <td valign="top" >RANGE</td>
Documentation/arm/SPEAr/overview.txt+1−1
@@ -60,4 +60,4 @@ Introduction · 59 unmodified lines
6060 Document Author
6161 ---------------
6262
63− Viresh Kumar <viresh.linux@gmail.com>, (c) 2010-2012 ST Microelectronics
63+ Viresh Kumar <vireshk@kernel.org>, (c) 2010-2012 ST Microelectronics
Documentation/device-mapper/cache.txt+6−0
@@ -258,6 +258,12 @@ cache metadata mode : ro if read-only, rw if read-write · 257 unmodified lines
258258 no further I/O will be permitted and the status will just
259259 contain the string 'Fail'. The userspace recovery tools
260260 should then be used.
261+needs_check : 'needs_check' if set, '-' if not set
262+ A metadata operation has failed, resulting in the needs_check
263+ flag being set in the metadata's superblock. The metadata
264+ device must be deactivated and checked/repaired before the
265+ cache can be made fully operational again. '-' indicates
266+ needs_check is not set.
261267
262268 Messages
263269 --------
Documentation/device-mapper/thin-provisioning.txt+8−1
@@ -296,7 +296,7 @@ ii) Status · 295 unmodified lines
296296 underlying device. When this is enabled when loading the table,
297297 it can get disabled if the underlying device doesn't support it.
298298
299− ro|rw
299+ ro|rw|out_of_data_space
300300 If the pool encounters certain types of device failures it will
301301 drop into a read-only metadata mode in which no changes to
302302 the pool metadata (like allocating new blocks) are permitted.
@@ -314,6 +314,13 @@ ii) Status · 11 unmodified lines
314314 module parameter can be used to change this timeout -- it
315315 defaults to 60 seconds but may be disabled using a value of 0.
316316
317+ needs_check
318+ A metadata operation has failed, resulting in the needs_check
319+ flag being set in the metadata's superblock. The metadata
320+ device must be deactivated and checked/repaired before the
321+ thin-pool can be made fully operational again. '-' indicates
322+ needs_check is not set.
323+
317324 iii) Messages
318325
319326 create_thin <dev id>
Documentation/devicetree/bindings/drm/imx/fsl-imx-drm.txt+24−2
@@ -65,8 +65,10 @@ Optional properties: · 64 unmodified lines
6565 - edid: verbatim EDID data block describing attached display.
6666 - ddc: phandle describing the i2c bus handling the display data
6767 channel
68−- port: A port node with endpoint definitions as defined in
68+- port@[0-1]: Port nodes with endpoint definitions as defined in
6969 Documentation/devicetree/bindings/media/video-interfaces.txt.
70+ Port 0 is the input port connected to the IPU display interface,
71+ port 1 is the output port connected to a panel.
7072
7173 example:
7274
@@ -75,9 +77,29 @@ display@di0 { · 2 unmodified lines
7577 edid = [edid-data];
7678 interface-pix-fmt = "rgb24";
7779
78− port {
80+ port@0 {
81+ reg = <0>;
82+
7983 display_in: endpoint {
8084 remote-endpoint = <&ipu_di0_disp0>;
8185 };
8286 };
87+
88+ port@1 {
89+ reg = <1>;
90+
91+ display_out: endpoint {
92+ remote-endpoint = <&panel_in>;
93+ };
94+ };
95+};
96+
97+panel {
98+ ...
99+
100+ port {
101+ panel_in: endpoint {
102+ remote-endpoint = <&display_out>;
103+ };
104+ };
83105 };
Documentation/kbuild/makefiles.txt+8−0
@@ -952,6 +952,14 @@ When kbuild executes, the following steps are followed (roughly): · 951 unmodified lines
952952 $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
953953 mode) if this option is supported by $(AR).
954954
955+ ARCH_CPPFLAGS, ARCH_AFLAGS, ARCH_CFLAGS Overrides the kbuild defaults
956+
957+ These variables are appended to the KBUILD_CPPFLAGS,
958+ KBUILD_AFLAGS, and KBUILD_CFLAGS, respectively, after the
959+ top-level Makefile has set any other flags. This provides a
960+ means for an architecture to override the defaults.
961+
962+
955963 --- 6.2 Add prerequisites to archheaders:
956964
957965 The archheaders: rule is used to generate header files that
MAINTAINERS+55−54
@@ -361,11 +361,11 @@ S: Supported · 360 unmodified lines
361361 F: drivers/input/touchscreen/ad7879.c
362362
363363 ADDRESS SPACE LAYOUT RANDOMIZATION (ASLR)
364−M: Jiri Kosina <jkosina@suse.cz>
364+M: Jiri Kosina <jkosina@suse.com>
365365 S: Maintained
366366
367367 ADM1025 HARDWARE MONITOR DRIVER
368−M: Jean Delvare <jdelvare@suse.de>
368+M: Jean Delvare <jdelvare@suse.com>
369369 L: lm-sensors@lm-sensors.org
370370 S: Maintained
371371 F: Documentation/hwmon/adm1025
@@ -430,7 +430,7 @@ S: Maintained · 58 unmodified lines
430430 F: drivers/macintosh/therm_adt746x.c
431431
432432 ADT7475 HARDWARE MONITOR DRIVER
433−M: Jean Delvare <jdelvare@suse.de>
433+M: Jean Delvare <jdelvare@suse.com>
434434 L: lm-sensors@lm-sensors.org
435435 S: Maintained
436436 F: Documentation/hwmon/adt7475
@@ -445,7 +445,7 @@ F: drivers/input/misc/adxl34x.c · 8 unmodified lines
445445
446446 ADVANSYS SCSI DRIVER
447447 M: Matthew Wilcox <matthew@wil.cx>
448−M: Hannes Reinecke <hare@suse.de>
448+M: Hannes Reinecke <hare@suse.com>
449449 L: linux-scsi@vger.kernel.org
450450 S: Maintained
451451 F: Documentation/scsi/advansys.txt
@@ -506,7 +506,7 @@ F: drivers/scsi/aha152x* · 54 unmodified lines
506506 F: drivers/scsi/pcmcia/aha152x*
507507
508508 AIC7XXX / AIC79XX SCSI DRIVER
509−M: Hannes Reinecke <hare@suse.de>
509+M: Hannes Reinecke <hare@suse.com>
510510 L: linux-scsi@vger.kernel.org
511511 S: Maintained
512512 F: drivers/scsi/aic7xxx/
@@ -746,7 +746,7 @@ S: Maintained · 233 unmodified lines
746746 F: sound/aoa/
747747
748748 APM DRIVER
749−M: Jiri Kosina <jkosina@suse.cz>
749+M: Jiri Kosina <jkosina@suse.com>
750750 S: Odd fixes
751751 F: arch/x86/kernel/apm_32.c
752752 F: include/linux/apm_bios.h
@@ -1001,6 +1001,7 @@ ARM/CONEXANT DIGICOLOR MACHINE SUPPORT · 248 unmodified lines
10011001 M: Baruch Siach <baruch@tkos.co.il>
10021002 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
10031003 S: Maintained
1004+F: arch/arm/boot/dts/cx92755*
10041005 N: digicolor
10051006
10061007 ARM/EBSA110 MACHINE SUPPORT
@@ -1324,7 +1325,7 @@ F: arch/arm/mach-pxa/include/mach/palmtc.h · 317 unmodified lines
13241325 F: arch/arm/mach-pxa/palmtc.c
13251326
13261327 ARM/PALM TREO SUPPORT
1327−M: Tomas Cech <sleep_walker@suse.cz>
1328+M: Tomas Cech <sleep_walker@suse.com>
13281329 L: linux-arm-kernel@lists.infradead.org
13291330 W: http://hackndev.com
13301331 S: Maintained
@@ -2405,7 +2406,7 @@ F: drivers/gpio/gpio-bt8xx.c · 1074 unmodified lines
24052406 BTRFS FILE SYSTEM
24062407 M: Chris Mason <clm@fb.com>
24072408 M: Josef Bacik <jbacik@fb.com>
2408−M: David Sterba <dsterba@suse.cz>
2409+M: David Sterba <dsterba@suse.com>
24092410 L: linux-btrfs@vger.kernel.org
24102411 W: http://btrfs.wiki.kernel.org/
24112412 Q: http://patchwork.kernel.org/project/linux-btrfs/list/
@@ -2748,7 +2749,7 @@ COCCINELLE/Semantic Patches (SmPL) · 336 unmodified lines
27482749 M: Julia Lawall <Julia.Lawall@lip6.fr>
27492750 M: Gilles Muller <Gilles.Muller@lip6.fr>
27502751 M: Nicolas Palix <nicolas.palix@imag.fr>
2751−M: Michal Marek <mmarek@suse.cz>
2752+M: Michal Marek <mmarek@suse.com>
27522753 L: cocci@systeme.lip6.fr (moderated for non-subscribers)
27532754 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild.git misc
27542755 W: http://coccinelle.lip6.fr/
@@ -2864,7 +2865,7 @@ F: kernel/cpuset.c · 109 unmodified lines
28642865
28652866 CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG)
28662867 M: Johannes Weiner <hannes@cmpxchg.org>
2867−M: Michal Hocko <mhocko@suse.cz>
2868+M: Michal Hocko <mhocko@kernel.org>
28682869 L: cgroups@vger.kernel.org
28692870 L: linux-mm@kvack.org
28702871 S: Maintained
@@ -2945,7 +2946,7 @@ F: arch/x86/kernel/cpuid.c · 74 unmodified lines
29452946 F: arch/x86/kernel/msr.c
29462947
29472948 CPU POWER MONITORING SUBSYSTEM
2948−M: Thomas Renninger <trenn@suse.de>
2949+M: Thomas Renninger <trenn@suse.com>
29492950 L: linux-pm@vger.kernel.org
29502951 S: Maintained
29512952 F: tools/power/cpupower/
@@ -3175,7 +3176,7 @@ F: Documentation/networking/dmfe.txt · 223 unmodified lines
31753176 F: drivers/net/ethernet/dec/tulip/dmfe.c
31763177
31773178 DC390/AM53C974 SCSI driver
3178−M: Hannes Reinecke <hare@suse.de>
3179+M: Hannes Reinecke <hare@suse.com>
31793180 L: linux-scsi@vger.kernel.org
31803181 S: Maintained
31813182 F: drivers/scsi/am53c974.c
@@ -3379,7 +3380,7 @@ W: http://www.win.tue.nl/~aeb/partitions/partition_types-1.html · 197 unmodified lines
33793380 S: Maintained
33803381
33813382 DISKQUOTA
3382−M: Jan Kara <jack@suse.cz>
3383+M: Jan Kara <jack@suse.com>
33833384 S: Maintained
33843385 F: Documentation/filesystems/quota.txt
33853386 F: fs/quota/
@@ -3435,7 +3436,7 @@ F: Documentation/hwmon/dme1737 · 49 unmodified lines
34353436 F: drivers/hwmon/dme1737.c
34363437
34373438 DMI/SMBIOS SUPPORT
3438−M: Jean Delvare <jdelvare@suse.de>
3439+M: Jean Delvare <jdelvare@suse.com>
34393440 S: Maintained
34403441 T: quilt http://jdelvare.nerim.net/devel/linux/jdelvare-dmi/
34413442 F: Documentation/ABI/testing/sysfs-firmware-dmi-tables
@@ -4051,7 +4052,7 @@ F: drivers/of/of_mdio.c · 609 unmodified lines
40514052 F: drivers/of/of_net.c
40524053
40534054 EXT2 FILE SYSTEM
4054−M: Jan Kara <jack@suse.cz>
4055+M: Jan Kara <jack@suse.com>
40554056 L: linux-ext4@vger.kernel.org
40564057 S: Maintained
40574058 F: Documentation/filesystems/ext2.txt
@@ -4059,7 +4060,7 @@ F: fs/ext2/ · 1 unmodified line
40594060 F: include/linux/ext2*
40604061
40614062 EXT3 FILE SYSTEM
4062−M: Jan Kara <jack@suse.cz>
4063+M: Jan Kara <jack@suse.com>
40634064 M: Andrew Morton <akpm@linux-foundation.org>
40644065 M: Andreas Dilger <adilger.kernel@dilger.ca>
40654066 L: linux-ext4@vger.kernel.org
@@ -4109,7 +4110,7 @@ F: drivers/video/fbdev/exynos/exynos_mipi* · 43 unmodified lines
41094110 F: include/video/exynos_mipi*
41104111
41114112 F71805F HARDWARE MONITORING DRIVER
4112−M: Jean Delvare <jdelvare@suse.de>
4113+M: Jean Delvare <jdelvare@suse.com>
41134114 L: lm-sensors@lm-sensors.org
41144115 S: Maintained
41154116 F: Documentation/hwmon/f71805f
@@ -4244,7 +4245,7 @@ S: Maintained · 128 unmodified lines
42444245 F: drivers/block/rsxx/
42454246
42464247 FLOPPY DRIVER
4247−M: Jiri Kosina <jkosina@suse.cz>
4248+M: Jiri Kosina <jkosina@suse.com>
42484249 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/floppy.git
42494250 S: Odd fixes
42504251 F: drivers/block/floppy.c
@@ -4665,7 +4666,7 @@ F: drivers/media/usb/stk1160/ · 414 unmodified lines
46654666
46664667 H8/300 ARCHITECTURE
46674668 M: Yoshinori Sato <ysato@users.sourceforge.jp>
4668−L: uclinux-h8-devel@lists.sourceforge.jp
4669+L: uclinux-h8-devel@lists.sourceforge.jp (moderated for non-subscribers)
46694670 W: http://uclinux-h8.sourceforge.jp
46704671 T: git git://git.sourceforge.jp/gitroot/uclinux-h8/linux.git
46714672 S: Maintained
@@ -4712,7 +4713,7 @@ S: Maintained · 40 unmodified lines
47124713 F: drivers/media/usb/hackrf/
47134714
47144715 HARDWARE MONITORING
4715−M: Jean Delvare <jdelvare@suse.de>
4716+M: Jean Delvare <jdelvare@suse.com>
47164717 M: Guenter Roeck <linux@roeck-us.net>
47174718 L: lm-sensors@lm-sensors.org
47184719 W: http://www.lm-sensors.org/
@@ -4815,7 +4816,7 @@ F: include/linux/pm.h · 96 unmodified lines
48154816 F: arch/*/include/asm/suspend*.h
48164817
48174818 HID CORE LAYER
4818−M: Jiri Kosina <jkosina@suse.cz>
4819+M: Jiri Kosina <jkosina@suse.com>
48194820 L: linux-input@vger.kernel.org
48204821 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
48214822 S: Maintained
@@ -4824,7 +4825,7 @@ F: include/linux/hid* · 2 unmodified lines
48244825 F: include/uapi/linux/hid*
48254826
48264827 HID SENSOR HUB DRIVERS
4827−M: Jiri Kosina <jkosina@suse.cz>
4828+M: Jiri Kosina <jkosina@suse.com>
48284829 M: Jonathan Cameron <jic23@kernel.org>
48294830 M: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
48304831 L: linux-input@vger.kernel.org
@@ -4958,7 +4959,7 @@ F: include/linux/hyperv.h · 127 unmodified lines
49584959 F: tools/hv/
49594960
49604961 I2C OVER PARALLEL PORT
4961−M: Jean Delvare <jdelvare@suse.de>
4962+M: Jean Delvare <jdelvare@suse.com>
49624963 L: linux-i2c@vger.kernel.org
49634964 S: Maintained
49644965 F: Documentation/i2c/busses/i2c-parport
@@ -4967,7 +4968,7 @@ F: drivers/i2c/busses/i2c-parport.c · 2 unmodified lines
49674968 F: drivers/i2c/busses/i2c-parport-light.c
49684969
49694970 I2C/SMBUS CONTROLLER DRIVERS FOR PC
4970−M: Jean Delvare <jdelvare@suse.de>
4971+M: Jean Delvare <jdelvare@suse.com>
49714972 L: linux-i2c@vger.kernel.org
49724973 S: Maintained
49734974 F: Documentation/i2c/busses/i2c-ali1535
@@ -5008,7 +5009,7 @@ F: drivers/i2c/busses/i2c-ismt.c · 34 unmodified lines
50085009 F: Documentation/i2c/busses/i2c-ismt
50095010
50105011 I2C/SMBUS STUB DRIVER
5011−M: Jean Delvare <jdelvare@suse.de>
5012+M: Jean Delvare <jdelvare@suse.com>
50125013 L: linux-i2c@vger.kernel.org
50135014 S: Maintained
50145015 F: drivers/i2c/i2c-stub.c
@@ -5035,7 +5036,7 @@ L: linux-acpi@vger.kernel.org · 20 unmodified lines
50355036 S: Maintained
50365037
50375038 I2C-TAOS-EVM DRIVER
5038−M: Jean Delvare <jdelvare@suse.de>
5039+M: Jean Delvare <jdelvare@suse.com>
50395040 L: linux-i2c@vger.kernel.org
50405041 S: Maintained
50415042 F: Documentation/i2c/busses/i2c-taos-evm
@@ -5564,8 +5565,8 @@ F: include/uapi/linux/ip_vs.h · 522 unmodified lines
55645565 F: net/netfilter/ipvs/
55655566
55665567 IPWIRELESS DRIVER
5567−M: Jiri Kosina <jkosina@suse.cz>
5568−M: David Sterba <dsterba@suse.cz>
5568+M: Jiri Kosina <jkosina@suse.com>
5569+M: David Sterba <dsterba@suse.com>
55695570 S: Odd Fixes
55705571 F: drivers/tty/ipwireless/
55715572
@@ -5685,7 +5686,7 @@ S: Maintained · 113 unmodified lines
56855686 F: drivers/isdn/hardware/eicon/
56865687
56875688 IT87 HARDWARE MONITORING DRIVER
5688−M: Jean Delvare <jdelvare@suse.de>
5689+M: Jean Delvare <jdelvare@suse.com>
56895690 L: lm-sensors@lm-sensors.org
56905691 S: Maintained
56915692 F: Documentation/hwmon/it87
@@ -5752,7 +5753,7 @@ F: include/uapi/linux/jffs2.h · 60 unmodified lines
57525753
57535754 JOURNALLING LAYER FOR BLOCK DEVICES (JBD)
57545755 M: Andrew Morton <akpm@linux-foundation.org>
5755−M: Jan Kara <jack@suse.cz>
5756+M: Jan Kara <jack@suse.com>
57565757 L: linux-ext4@vger.kernel.org
57575758 S: Maintained
57585759 F: fs/jbd/
@@ -5816,7 +5817,7 @@ S: Maintained · 57 unmodified lines
58165817 F: fs/autofs4/
58175818
58185819 KERNEL BUILD + files below scripts/ (unless maintained elsewhere)
5819−M: Michal Marek <mmarek@suse.cz>
5820+M: Michal Marek <mmarek@suse.com>
58205821 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild.git for-next
58215822 T: git git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild.git rc-fixes
58225823 L: linux-kbuild@vger.kernel.org
@@ -5880,7 +5881,7 @@ F: arch/x86/include/asm/svm.h · 57 unmodified lines
58805881 F: arch/x86/kvm/svm.c
58815882
58825883 KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
5883−M: Alexander Graf <agraf@suse.de>
5884+M: Alexander Graf <agraf@suse.com>
58845885 L: kvm-ppc@vger.kernel.org
58855886 W: http://kvm.qumranet.com
58865887 T: git git://github.com/agraf/linux-2.6.git
@@ -6037,7 +6038,7 @@ F: drivers/leds/ · 150 unmodified lines
60376038 F: include/linux/leds.h
60386039
60396040 LEGACY EEPROM DRIVER
6040−M: Jean Delvare <jdelvare@suse.de>
6041+M: Jean Delvare <jdelvare@suse.com>
60416042 S: Maintained
60426043 F: Documentation/misc-devices/eeprom
60436044 F: drivers/misc/eeprom/eeprom.c
@@ -6090,7 +6091,7 @@ F: include/linux/ata.h · 46 unmodified lines
60906091 F: include/linux/libata.h
60916092
60926093 LIBATA PATA ARASAN COMPACT FLASH CONTROLLER
6093−M: Viresh Kumar <viresh.linux@gmail.com>
6094+M: Viresh Kumar <vireshk@kernel.org>
60946095 L: linux-ide@vger.kernel.org
60956096 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
60966097 S: Maintained
@@ -6251,8 +6252,8 @@ F: drivers/platform/x86/hp_accel.c · 154 unmodified lines
62516252 LIVE PATCHING
62526253 M: Josh Poimboeuf <jpoimboe@redhat.com>
62536254 M: Seth Jennings <sjenning@redhat.com>
6254−M: Jiri Kosina <jkosina@suse.cz>
6255−M: Vojtech Pavlik <vojtech@suse.cz>
6255+M: Jiri Kosina <jkosina@suse.com>
6256+M: Vojtech Pavlik <vojtech@suse.com>
62566257 S: Maintained
62576258 F: kernel/livepatch/
62586259 F: include/linux/livepatch.h
@@ -6278,21 +6279,21 @@ S: Maintained · 19 unmodified lines
62786279 F: drivers/hwmon/lm73.c
62796280
62806281 LM78 HARDWARE MONITOR DRIVER
6281−M: Jean Delvare <jdelvare@suse.de>
6282+M: Jean Delvare <jdelvare@suse.com>
62826283 L: lm-sensors@lm-sensors.org
62836284 S: Maintained
62846285 F: Documentation/hwmon/lm78
62856286 F: drivers/hwmon/lm78.c
62866287
62876288 LM83 HARDWARE MONITOR DRIVER
6288−M: Jean Delvare <jdelvare@suse.de>
6289+M: Jean Delvare <jdelvare@suse.com>
62896290 L: lm-sensors@lm-sensors.org
62906291 S: Maintained
62916292 F: Documentation/hwmon/lm83
62926293 F: drivers/hwmon/lm83.c
62936294
62946295 LM90 HARDWARE MONITOR DRIVER
6295−M: Jean Delvare <jdelvare@suse.de>
6296+M: Jean Delvare <jdelvare@suse.com>
62966297 L: lm-sensors@lm-sensors.org
62976298 S: Maintained
62986299 F: Documentation/hwmon/lm90
@@ -7719,7 +7720,7 @@ S: Maintained · 1420 unmodified lines
77197720 F: drivers/char/pc8736x_gpio.c
77207721
77217722 PC87427 HARDWARE MONITORING DRIVER
7722−M: Jean Delvare <jdelvare@suse.de>
7723+M: Jean Delvare <jdelvare@suse.com>
77237724 L: lm-sensors@lm-sensors.org
77247725 S: Maintained
77257726 F: Documentation/hwmon/pc87427
@@ -7996,7 +7997,7 @@ S: Maintained · 270 unmodified lines
79967997 F: drivers/pinctrl/samsung/
79977998
79987999 PIN CONTROLLER - ST SPEAR
7999−M: Viresh Kumar <viresh.linux@gmail.com>
8000+M: Viresh Kumar <vireshk@kernel.org>
80008001 L: spear-devel@list.st.com
80018002 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
80028003 W: http://www.st.com/spear
@@ -8004,7 +8005,7 @@ S: Maintained · 1 unmodified line
80048005 F: drivers/pinctrl/spear/
80058006
80068007 PKTCDVD DRIVER
8007−M: Jiri Kosina <jkosina@suse.cz>
8008+M: Jiri Kosina <jkosina@suse.com>
80088009 S: Maintained
80098010 F: drivers/block/pktcdvd.c
80108011 F: include/linux/pktcdvd.h
@@ -8895,7 +8896,7 @@ S: Maintained · 884 unmodified lines
88958896 F: drivers/tty/serial/
88968897
88978898 SYNOPSYS DESIGNWARE DMAC DRIVER
8898−M: Viresh Kumar <viresh.linux@gmail.com>
8899+M: Viresh Kumar <vireshk@kernel.org>
88998900 M: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
89008901 S: Maintained
89018902 F: include/linux/dma/dw.h
@@ -9062,7 +9063,7 @@ S: Maintained · 160 unmodified lines
90629063 F: drivers/mmc/host/sdhci-s3c*
90639064
90649065 SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) ST SPEAR DRIVER
9065−M: Viresh Kumar <viresh.linux@gmail.com>
9066+M: Viresh Kumar <vireshk@kernel.org>
90669067 L: spear-devel@list.st.com
90679068 L: linux-mmc@vger.kernel.org
90689069 S: Maintained
@@ -9424,7 +9425,7 @@ F: Documentation/hwmon/sch5627 · 355 unmodified lines
94249425 F: drivers/hwmon/sch5627.c
94259426
94269427 SMSC47B397 HARDWARE MONITOR DRIVER
9427−M: Jean Delvare <jdelvare@suse.de>
9428+M: Jean Delvare <jdelvare@suse.com>
94289429 L: lm-sensors@lm-sensors.org
94299430 S: Maintained
94309431 F: Documentation/hwmon/smsc47b397
@@ -9473,7 +9474,7 @@ S: Supported · 42 unmodified lines
94739474 F: drivers/media/pci/solo6x10/
94749475
94759476 SOFTWARE RAID (Multiple Disks) SUPPORT
9476−M: Neil Brown <neilb@suse.de>
9477+M: Neil Brown <neilb@suse.com>
94779478 L: linux-raid@vger.kernel.org
94789479 S: Supported
94799480 F: drivers/md/
@@ -9516,7 +9517,7 @@ F: drivers/memstick/core/ms_block.* · 36 unmodified lines
95169517
95179518 SOUND
95189519 M: Jaroslav Kysela <perex@perex.cz>
9519−M: Takashi Iwai <tiwai@suse.de>
9520+M: Takashi Iwai <tiwai@suse.com>
95209521 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
95219522 W: http://www.alsa-project.org/
95229523 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
@@ -9600,7 +9601,7 @@ S: Maintained · 77 unmodified lines
96009601 F: include/linux/compiler.h
96019602
96029603 SPEAR PLATFORM SUPPORT
9603−M: Viresh Kumar <viresh.linux@gmail.com>
9604+M: Viresh Kumar <vireshk@kernel.org>
96049605 M: Shiraz Hashim <shiraz.linux.kernel@gmail.com>
96059606 L: spear-devel@list.st.com
96069607 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -9609,7 +9610,7 @@ S: Maintained · 2 unmodified lines
96099610 F: arch/arm/mach-spear/
96109611
96119612 SPEAR CLOCK FRAMEWORK SUPPORT
9612−M: Viresh Kumar <viresh.linux@gmail.com>
9613+M: Viresh Kumar <vireshk@kernel.org>
96139614 L: spear-devel@list.st.com
96149615 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
96159616 W: http://www.st.com/spear
@@ -10399,7 +10400,7 @@ K: ^Subject:.*(?i)trivial · 783 unmodified lines
1039910400
1040010401 TTY LAYER
1040110402 M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10402−M: Jiri Slaby <jslaby@suse.cz>
10403+M: Jiri Slaby <jslaby@suse.com>
1040310404 S: Supported
1040410405 T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
1040510406 F: Documentation/serial/
@@ -10473,7 +10474,7 @@ F: arch/m68k/*/*_no.* · 67 unmodified lines
1047310474 F: arch/m68k/include/asm/*_no.*
1047410475
1047510476 UDF FILESYSTEM
10476−M: Jan Kara <jack@suse.cz>
10477+M: Jan Kara <jack@suse.com>
1047710478 S: Maintained
1047810479 F: Documentation/filesystems/udf.txt
1047910480 F: fs/udf/
@@ -10616,7 +10617,7 @@ F: drivers/usb/gadget/ · 136 unmodified lines
1061610617 F: include/linux/usb/gadget*
1061710618
1061810619 USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...)
10619−M: Jiri Kosina <jkosina@suse.cz>
10620+M: Jiri Kosina <jkosina@suse.com>
1062010621 L: linux-usb@vger.kernel.org
1062110622 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
1062210623 S: Maintained
@@ -10741,7 +10742,7 @@ S: Maintained · 118 unmodified lines
1074110742 F: drivers/usb/host/uhci*
1074210743
1074310744 USB "USBNET" DRIVER FRAMEWORK
10744−M: Oliver Neukum <oneukum@suse.de>
10745+M: Oliver Neukum <oneukum@suse.com>
1074510746 L: netdev@vger.kernel.org
1074610747 W: http://www.linux-usb.org/usbnet
1074710748 S: Maintained
@@ -11068,7 +11069,7 @@ F: Documentation/hwmon/w83793 · 320 unmodified lines
1106811069 F: drivers/hwmon/w83793.c
1106911070
1107011071 W83795 HARDWARE MONITORING DRIVER
11071−M: Jean Delvare <jdelvare@suse.de>
11072+M: Jean Delvare <jdelvare@suse.com>
1107211073 L: lm-sensors@lm-sensors.org
1107311074 S: Maintained
1107411075 F: drivers/hwmon/w83795.c
Makefile+6−5
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 2
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc2
4+EXTRAVERSION = -rc3
55 NAME = Hurr durr I'ma sheep
66
77 # *DOCUMENTATION*
@@ -780,10 +780,11 @@ endif · 772 unmodified lines
780780 include scripts/Makefile.kasan
781781 include scripts/Makefile.extrawarn
782782
783−# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
784−KBUILD_CPPFLAGS += $(KCPPFLAGS)
785−KBUILD_AFLAGS += $(KAFLAGS)
786−KBUILD_CFLAGS += $(KCFLAGS)
783+# Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
784+# last assignments
785+KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
786+KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
787+KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
787788
788789 # Use --build-id when available.
789790 LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
arch/Kconfig+4−0
@@ -221,6 +221,10 @@ config ARCH_TASK_STRUCT_ALLOCATOR · 220 unmodified lines
221221 config ARCH_THREAD_INFO_ALLOCATOR
222222 bool
223223
224+# Select if arch wants to size task_struct dynamically via arch_task_struct_size:
225+config ARCH_WANTS_DYNAMIC_TASK_STRUCT
226+ bool
227+
224228 config HAVE_REGS_AND_STACK_ACCESS_API
225229 bool
226230 help
arch/alpha/include/asm/Kbuild+1−0
@@ -5,6 +5,7 @@ generic-y += cputime.h · 4 unmodified lines
55 generic-y += exec.h
66 generic-y += irq_work.h
77 generic-y += mcs_spinlock.h
8+generic-y += mm-arch-hooks.h
89 generic-y += preempt.h
910 generic-y += sections.h
1011 generic-y += trace_clock.h
arch/alpha/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_ALPHA_MM_ARCH_HOOKS_H
13−#define _ASM_ALPHA_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_ALPHA_MM_ARCH_HOOKS_H */
arch/arc/Kconfig+2−1
@@ -115,6 +115,7 @@ if ISA_ARCOMPACT · 114 unmodified lines
115115
116116 config ARC_CPU_750D
117117 bool "ARC750D"
118+ select ARC_CANT_LLSC
118119 help
119120 Support for ARC750 core
120121
@@ -362,7 +363,7 @@ config ARC_CANT_LLSC · 241 unmodified lines
362363 config ARC_HAS_LLSC
363364 bool "Insn: LLOCK/SCOND (efficient atomic ops)"
364365 default y
365− depends on !ARC_CPU_750D && !ARC_CANT_LLSC
366+ depends on !ARC_CANT_LLSC
366367
367368 config ARC_HAS_SWAPE
368369 bool "Insn: SWAPE (endian-swap)"
arch/arc/Makefile+2−1
@@ -49,7 +49,8 @@ endif · 48 unmodified lines
4949
5050 ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
5151 # Generic build system uses -O2, we want -O3
52−cflags-y += -O3
52+# Note: No need to add to cflags-y as that happens anyways
53+ARCH_CFLAGS += -O3
5354 endif
5455
5556 # small data is default for elf32 tool-chain. If not usable, disable it
arch/arc/boot/dts/axc003.dtsi+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212
1313 / {
1414 compatible = "snps,arc";
15− clock-frequency = <75000000>;
15+ clock-frequency = <90000000>;
1616 #address-cells = <1>;
1717 #size-cells = <1>;
1818
arch/arc/boot/dts/axc003_idu.dtsi+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212
1313 / {
1414 compatible = "snps,arc";
15− clock-frequency = <75000000>;
15+ clock-frequency = <90000000>;
1616 #address-cells = <1>;
1717 #size-cells = <1>;
1818
arch/arc/include/asm/Kbuild+1−0
@@ -22,6 +22,7 @@ generic-y += kvm_para.h · 21 unmodified lines
2222 generic-y += local.h
2323 generic-y += local64.h
2424 generic-y += mcs_spinlock.h
25+generic-y += mm-arch-hooks.h
2526 generic-y += mman.h
2627 generic-y += msgbuf.h
2728 generic-y += param.h
arch/arc/include/asm/bitops.h+9−26
@@ -50,8 +50,7 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\ · 49 unmodified lines
5050 * done for const @nr, but no code is generated due to gcc \
5151 * const prop. \
5252 */ \
53− if (__builtin_constant_p(nr)) \
54− nr &= 0x1f; \
53+ nr &= 0x1f; \
5554 \
5655 __asm__ __volatile__( \
5756 "1: llock %0, [%1] \n" \
@@ -82,8 +81,7 @@ static inline int test_and_##op##_bit(unsigned long nr, volatile unsigned long * · 24 unmodified lines
8281 \
8382 m += nr >> 5; \
8483 \
85− if (__builtin_constant_p(nr)) \
86− nr &= 0x1f; \
84+ nr &= 0x1f; \
8785 \
8886 /* \
8987 * Explicit full memory barrier needed before/after as \
@@ -129,16 +127,13 @@ static inline void op##_bit(unsigned long nr, volatile unsigned long *m)\ · 39 unmodified lines
129127 unsigned long temp, flags; \
130128 m += nr >> 5; \
131129 \
132− if (__builtin_constant_p(nr)) \
133− nr &= 0x1f; \
134− \
135130 /* \
136131 * spin lock/unlock provide the needed smp_mb() before/after \
137132 */ \
138133 bitops_lock(flags); \
139134 \
140135 temp = *m; \
141− *m = temp c_op (1UL << nr); \
136+ *m = temp c_op (1UL << (nr & 0x1f)); \
142137 \
143138 bitops_unlock(flags); \
144139 }
@@ -149,17 +144,14 @@ static inline int test_and_##op##_bit(unsigned long nr, volatile unsigned long * · 4 unmodified lines
149144 unsigned long old, flags; \
150145 m += nr >> 5; \
151146 \
152− if (__builtin_constant_p(nr)) \
153− nr &= 0x1f; \
154− \
155147 bitops_lock(flags); \
156148 \
157149 old = *m; \
158− *m = old c_op (1 << nr); \
150+ *m = old c_op (1UL << (nr & 0x1f)); \
159151 \
160152 bitops_unlock(flags); \
161153 \
162− return (old & (1 << nr)) != 0; \
154+ return (old & (1UL << (nr & 0x1f))) != 0; \
163155 }
164156
165157 #endif /* CONFIG_ARC_HAS_LLSC */
@@ -174,11 +166,8 @@ static inline void __##op##_bit(unsigned long nr, volatile unsigned long *m) \ · 8 unmodified lines
174166 unsigned long temp; \
175167 m += nr >> 5; \
176168 \
177− if (__builtin_constant_p(nr)) \
178− nr &= 0x1f; \
179− \
180169 temp = *m; \
181− *m = temp c_op (1UL << nr); \
170+ *m = temp c_op (1UL << (nr & 0x1f)); \
182171 }
183172
184173 #define __TEST_N_BIT_OP(op, c_op, asm_op) \
@@ -187,13 +176,10 @@ static inline int __test_and_##op##_bit(unsigned long nr, volatile unsigned long · 2 unmodified lines
187176 unsigned long old; \
188177 m += nr >> 5; \
189178 \
190− if (__builtin_constant_p(nr)) \
191− nr &= 0x1f; \
192− \
193179 old = *m; \
194− *m = old c_op (1 << nr); \
180+ *m = old c_op (1UL << (nr & 0x1f)); \
195181 \
196− return (old & (1 << nr)) != 0; \
182+ return (old & (1UL << (nr & 0x1f))) != 0; \
197183 }
198184
199185 #define BIT_OPS(op, c_op, asm_op) \
@@ -224,10 +210,7 @@ test_bit(unsigned int nr, const volatile unsigned long *addr) · 24 unmodified lines
224210
225211 addr += nr >> 5;
226212
227− if (__builtin_constant_p(nr))
228− nr &= 0x1f;
229−
230− mask = 1 << nr;
213+ mask = 1UL << (nr & 0x1f);
231214
232215 return ((mask & *addr) != 0);
233216 }
arch/arc/include/asm/futex.h+42−6
@@ -16,12 +16,40 @@ · 15 unmodified lines
1616 #include <linux/uaccess.h>
1717 #include <asm/errno.h>
1818
19+#ifdef CONFIG_ARC_HAS_LLSC
20+
21+#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg)\
22+ \
23+ __asm__ __volatile__( \
24+ "1: llock %1, [%2] \n" \
25+ insn "\n" \
26+ "2: scond %0, [%2] \n" \
27+ " bnz 1b \n" \
28+ " mov %0, 0 \n" \
29+ "3: \n" \
30+ " .section .fixup,\"ax\" \n" \
31+ " .align 4 \n" \
32+ "4: mov %0, %4 \n" \
33+ " b 3b \n" \
34+ " .previous \n" \
35+ " .section __ex_table,\"a\" \n" \
36+ " .align 4 \n" \
37+ " .word 1b, 4b \n" \
38+ " .word 2b, 4b \n" \
39+ " .previous \n" \
40+ \
41+ : "=&r" (ret), "=&r" (oldval) \
42+ : "r" (uaddr), "r" (oparg), "ir" (-EFAULT) \
43+ : "cc", "memory")
44+
45+#else /* !CONFIG_ARC_HAS_LLSC */
46+
1947 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg)\
2048 \
2149 __asm__ __volatile__( \
22− "1: ld %1, [%2] \n" \
50+ "1: ld %1, [%2] \n" \
2351 insn "\n" \
24− "2: st %0, [%2] \n" \
52+ "2: st %0, [%2] \n" \
2553 " mov %0, 0 \n" \
2654 "3: \n" \
2755 " .section .fixup,\"ax\" \n" \
@@ -39,6 +67,8 @@ · 11 unmodified lines
3967 : "r" (uaddr), "r" (oparg), "ir" (-EFAULT) \
4068 : "cc", "memory")
4169
70+#endif
71+
4272 static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
4373 {
4474 int op = (encoded_op >> 28) & 7;
@@ -123,11 +153,17 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, · 78 unmodified lines
123153
124154 pagefault_disable();
125155
126− /* TBD : can use llock/scond */
127156 __asm__ __volatile__(
128− "1: ld %0, [%3] \n"
129− " brne %0, %1, 3f \n"
130− "2: st %2, [%3] \n"
157+#ifdef CONFIG_ARC_HAS_LLSC
158+ "1: llock %0, [%3] \n"
159+ " brne %0, %1, 3f \n"
160+ "2: scond %2, [%3] \n"
161+ " bnz 1b \n"
162+#else
163+ "1: ld %0, [%3] \n"
164+ " brne %0, %1, 3f \n"
165+ "2: st %2, [%3] \n"
166+#endif
131167 "3: \n"
132168 " .section .fixup,\"ax\" \n"
133169 "4: mov %0, %4 \n"
arch/arc/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_ARC_MM_ARCH_HOOKS_H
13−#define _ASM_ARC_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_ARC_MM_ARCH_HOOKS_H */
arch/arc/include/asm/ptrace.h+1−1
@@ -106,7 +106,7 @@ struct callee_regs { · 105 unmodified lines
106106 long r25, r24, r23, r22, r21, r20, r19, r18, r17, r16, r15, r14, r13;
107107 };
108108
109−#define instruction_pointer(regs) ((regs)->ret)
109+#define instruction_pointer(regs) (unsigned long)((regs)->ret)
110110 #define profile_pc(regs) instruction_pointer(regs)
111111
112112 /* return 1 if user mode or 0 if kernel mode */
arch/arc/kernel/intc-arcv2.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 #include <linux/of.h>
1313 #include <linux/irqdomain.h>
1414 #include <linux/irqchip.h>
15−#include "../../drivers/irqchip/irqchip.h"
1615 #include <asm/irq.h>
1716
1817 /*
arch/arc/kernel/intc-compact.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 #include <linux/of.h>
1313 #include <linux/irqdomain.h>
1414 #include <linux/irqchip.h>
15−#include "../../drivers/irqchip/irqchip.h"
1615 #include <asm/irq.h>
1716
1817 /*
arch/arc/kernel/mcip.c+19−4
@@ -175,7 +175,6 @@ void mcip_init_early_smp(void) · 174 unmodified lines
175175 #include <linux/irqchip.h>
176176 #include <linux/of.h>
177177 #include <linux/of_irq.h>
178−#include "../../drivers/irqchip/irqchip.h"
179178
180179 /*
181180 * Set the DEST for @cmn_irq to @cpu_mask (1 bit per core)
@@ -218,11 +217,28 @@ static void idu_irq_unmask(struct irq_data *data) · 36 unmodified lines
218217 raw_spin_unlock_irqrestore(&mcip_lock, flags);
219218 }
220219
220+#ifdef CONFIG_SMP
221221 static int
222−idu_irq_set_affinity(struct irq_data *d, const struct cpumask *cpumask, bool f)
222+idu_irq_set_affinity(struct irq_data *data, const struct cpumask *cpumask,
223+ bool force)
223224 {
225+ unsigned long flags;
226+ cpumask_t online;
227+
228+ /* errout if no online cpu per @cpumask */
229+ if (!cpumask_and(&online, cpumask, cpu_online_mask))
230+ return -EINVAL;
231+
232+ raw_spin_lock_irqsave(&mcip_lock, flags);
233+
234+ idu_set_dest(data->hwirq, cpumask_bits(&online)[0]);
235+ idu_set_mode(data->hwirq, IDU_M_TRIG_LEVEL, IDU_M_DISTRI_RR);
236+
237+ raw_spin_unlock_irqrestore(&mcip_lock, flags);
238+
224239 return IRQ_SET_MASK_OK;
225240 }
241+#endif
226242
227243 static struct irq_chip idu_irq_chip = {
228244 .name = "MCIP IDU Intc",
@@ -330,8 +346,7 @@ idu_of_init(struct device_node *intc, struct device_node *parent) · 101 unmodified lines
330346 if (!i)
331347 idu_first_irq = irq;
332348
333− irq_set_handler_data(irq, domain);
334− irq_set_chained_handler(irq, idu_cascade_isr);
349+ irq_set_chained_handler_and_data(irq, idu_cascade_isr, domain);
335350 }
336351
337352 __mcip_cmd(CMD_IDU_ENABLE, 0);
arch/arc/kernel/setup.c+10−5
@@ -142,17 +142,22 @@ static void read_arc_build_cfg_regs(void) · 141 unmodified lines
142142 }
143143
144144 static const struct cpuinfo_data arc_cpu_tbl[] = {
145+#ifdef CONFIG_ISA_ARCOMPACT
145146 { {0x20, "ARC 600" }, 0x2F},
146147 { {0x30, "ARC 700" }, 0x33},
147148 { {0x34, "ARC 700 R4.10"}, 0x34},
148149 { {0x35, "ARC 700 R4.11"}, 0x35},
149− { {0x50, "ARC HS38" }, 0x51},
150+#else
151+ { {0x50, "ARC HS38 R2.0"}, 0x51},
152+ { {0x52, "ARC HS38 R2.1"}, 0x52},
153+#endif
150154 { {0x00, NULL } }
151155 };
152156
153−#define IS_AVAIL1(v, str) ((v) ? str : "")
154−#define IS_USED(cfg) (IS_ENABLED(cfg) ? "" : "(not used) ")
155−#define IS_AVAIL2(v, str, cfg) IS_AVAIL1(v, str), IS_AVAIL1(v, IS_USED(cfg))
157+#define IS_AVAIL1(v, s) ((v) ? s : "")
158+#define IS_USED_RUN(v) ((v) ? "" : "(not used) ")
159+#define IS_USED_CFG(cfg) IS_USED_RUN(IS_ENABLED(cfg))
160+#define IS_AVAIL2(v, s, cfg) IS_AVAIL1(v, s), IS_AVAIL1(v, IS_USED_CFG(cfg))
156161
157162 static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
158163 {
@@ -226,7 +231,7 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) · 67 unmodified lines
226231 n += scnprintf(buf + n, len - n, "mpy[opt %d] ", opt);
227232 }
228233 n += scnprintf(buf + n, len - n, "%s",
229− IS_USED(CONFIG_ARC_HAS_HW_MPY));
234+ IS_USED_CFG(CONFIG_ARC_HAS_HW_MPY));
230235 }
231236
232237 n += scnprintf(buf + n, len - n, "%s%s%s%s%s%s%s%s\n",
arch/arc/kernel/troubleshoot.c+0−1
@@ -58,7 +58,6 @@ static void show_callee_regs(struct callee_regs *cregs) · 57 unmodified lines
5858
5959 static void print_task_path_n_nm(struct task_struct *tsk, char *buf)
6060 {
61− struct path path;
6261 char *path_nm = NULL;
6362 struct mm_struct *mm;
6463 struct file *exe_file;
arch/arc/mm/cache.c+10−2
@@ -468,10 +468,18 @@ static void __ic_line_inv_vaddr(unsigned long paddr, unsigned long vaddr, · 467 unmodified lines
468468 noinline void slc_op(unsigned long paddr, unsigned long sz, const int op)
469469 {
470470 #ifdef CONFIG_ISA_ARCV2
471+ /*
472+ * SLC is shared between all cores and concurrent aux operations from
473+ * multiple cores need to be serialized using a spinlock
474+ * A concurrent operation can be silently ignored and/or the old/new
475+ * operation can remain incomplete forever (lockup in SLC_CTRL_BUSY loop
476+ * below)
477+ */
478+ static DEFINE_SPINLOCK(lock);
471479 unsigned long flags;
472480 unsigned int ctrl;
473481
474− local_irq_save(flags);
482+ spin_lock_irqsave(&lock, flags);
475483
476484 /*
477485 * The Region Flush operation is specified by CTRL.RGN_OP[11..9]
@@ -504,7 +512,7 @@ noinline void slc_op(unsigned long paddr, unsigned long sz, const int op) · 26 unmodified lines
504512
505513 while (read_aux_reg(ARC_REG_SLC_CTRL) & SLC_CTRL_BUSY);
506514
507− local_irq_restore(flags);
515+ spin_unlock_irqrestore(&lock, flags);
508516 #endif
509517 }
510518
arch/arc/mm/dma.c+2−2
@@ -60,8 +60,8 @@ void *dma_alloc_coherent(struct device *dev, size_t size, · 59 unmodified lines
6060
6161 /* This is kernel Virtual address (0x7000_0000 based) */
6262 kvaddr = ioremap_nocache((unsigned long)paddr, size);
63− if (kvaddr != NULL)
64− memset(kvaddr, 0, size);
63+ if (kvaddr == NULL)
64+ return NULL;
6565
6666 /* This is bus address, platform dependent */
6767 *dma_handle = (dma_addr_t)paddr;
arch/arm/boot/dts/am335x-pepper.dts+13−3
@@ -74,6 +74,7 @@ · 73 unmodified lines
7474 audio_codec: tlv320aic3106@1b {
7575 compatible = "ti,tlv320aic3106";
7676 reg = <0x1b>;
77+ ai3x-micbias-vg = <0x2>;
7778 };
7879
7980 accel: lis331dlh@1d {
@@ -153,7 +154,7 @@ · 73 unmodified lines
153154 ti,audio-routing =
154155 "Headphone Jack", "HPLOUT",
155156 "Headphone Jack", "HPROUT",
156− "LINE1L", "Line In";
157+ "MIC3L", "Mic3L Switch";
157158 };
158159
159160 &mcasp0 {
@@ -438,41 +439,50 @@ · 278 unmodified lines
438439 regulators {
439440 dcdc1_reg: regulator@0 {
440441 /* VDD_1V8 system supply */
442+ regulator-always-on;
441443 };
442444
443445 dcdc2_reg: regulator@1 {
444446 /* VDD_CORE voltage limits 0.95V - 1.26V with +/-4% tolerance */
445447 regulator-name = "vdd_core";
446448 regulator-min-microvolt = <925000>;
447− regulator-max-microvolt = <1325000>;
449+ regulator-max-microvolt = <1150000>;
448450 regulator-boot-on;
451+ regulator-always-on;
449452 };
450453
451454 dcdc3_reg: regulator@2 {
452455 /* VDD_MPU voltage limits 0.95V - 1.1V with +/-4% tolerance */
453456 regulator-name = "vdd_mpu";
454457 regulator-min-microvolt = <925000>;
455− regulator-max-microvolt = <1150000>;
458+ regulator-max-microvolt = <1325000>;
456459 regulator-boot-on;
460+ regulator-always-on;
457461 };
458462
459463 ldo1_reg: regulator@3 {
460464 /* VRTC 1.8V always-on supply */
465+ regulator-name = "vrtc,vdds";
461466 regulator-always-on;
462467 };
463468
464469 ldo2_reg: regulator@4 {
465470 /* 3.3V rail */
471+ regulator-name = "vdd_3v3aux";
472+ regulator-always-on;
466473 };
467474
468475 ldo3_reg: regulator@5 {
469476 /* VDD_3V3A 3.3V rail */
477+ regulator-name = "vdd_3v3a";
470478 regulator-min-microvolt = <3300000>;
471479 regulator-max-microvolt = <3300000>;
472480 };
473481
474482 ldo4_reg: regulator@6 {
475483 /* VDD_3V3B 3.3V rail */
484+ regulator-name = "vdd_3v3b";
485+ regulator-always-on;
476486 };
477487 };
478488 };
arch/arm/boot/dts/cros-ec-keyboard.dtsi+4−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 MATRIX_KEY(0x00, 0x02, KEY_F1)
2323 MATRIX_KEY(0x00, 0x03, KEY_B)
2424 MATRIX_KEY(0x00, 0x04, KEY_F10)
25+ MATRIX_KEY(0x00, 0x05, KEY_RO)
2526 MATRIX_KEY(0x00, 0x06, KEY_N)
2627 MATRIX_KEY(0x00, 0x08, KEY_EQUAL)
2728 MATRIX_KEY(0x00, 0x0a, KEY_RIGHTALT)
@@ -34,6 +35,7 @@ · 6 unmodified lines
3435 MATRIX_KEY(0x01, 0x08, KEY_APOSTROPHE)
3536 MATRIX_KEY(0x01, 0x09, KEY_F9)
3637 MATRIX_KEY(0x01, 0x0b, KEY_BACKSPACE)
38+ MATRIX_KEY(0x01, 0x0c, KEY_HENKAN)
3739
3840 MATRIX_KEY(0x02, 0x00, KEY_LEFTCTRL)
3941 MATRIX_KEY(0x02, 0x01, KEY_TAB)
@@ -45,6 +47,7 @@ · 5 unmodified lines
4547 MATRIX_KEY(0x02, 0x07, KEY_102ND)
4648 MATRIX_KEY(0x02, 0x08, KEY_LEFTBRACE)
4749 MATRIX_KEY(0x02, 0x09, KEY_F8)
50+ MATRIX_KEY(0x02, 0x0a, KEY_YEN)
4851
4952 MATRIX_KEY(0x03, 0x01, KEY_GRAVE)
5053 MATRIX_KEY(0x03, 0x02, KEY_F2)
@@ -53,6 +56,7 @@ · 2 unmodified lines
5356 MATRIX_KEY(0x03, 0x06, KEY_6)
5457 MATRIX_KEY(0x03, 0x08, KEY_MINUS)
5558 MATRIX_KEY(0x03, 0x0b, KEY_BACKSLASH)
59+ MATRIX_KEY(0x03, 0x0c, KEY_MUHENKAN)
5660
5761 MATRIX_KEY(0x04, 0x00, KEY_RIGHTCTRL)
5862 MATRIX_KEY(0x04, 0x01, KEY_A)
arch/arm/boot/dts/imx23.dtsi+1−0
@@ -468,6 +468,7 @@ · 467 unmodified lines
468468 interrupts = <36 37 38 39 40 41 42 43 44>;
469469 status = "disabled";
470470 clocks = <&clks 26>;
471+ #io-channel-cells = <1>;
471472 };
472473
473474 spdif@80054000 {
arch/arm/boot/dts/imx27.dtsi+6−6
@@ -108,7 +108,7 @@ · 107 unmodified lines
108108 };
109109
110110 gpt1: timer@10003000 {
111− compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
111+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
112112 reg = <0x10003000 0x1000>;
113113 interrupts = <26>;
114114 clocks = <&clks IMX27_CLK_GPT1_IPG_GATE>,
@@ -117,7 +117,7 @@ · 2 unmodified lines
117117 };
118118
119119 gpt2: timer@10004000 {
120− compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
120+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
121121 reg = <0x10004000 0x1000>;
122122 interrupts = <25>;
123123 clocks = <&clks IMX27_CLK_GPT2_IPG_GATE>,
@@ -126,7 +126,7 @@ · 2 unmodified lines
126126 };
127127
128128 gpt3: timer@10005000 {
129− compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
129+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
130130 reg = <0x10005000 0x1000>;
131131 interrupts = <24>;
132132 clocks = <&clks IMX27_CLK_GPT3_IPG_GATE>,
@@ -376,7 +376,7 @@ · 243 unmodified lines
376376 };
377377
378378 gpt4: timer@10019000 {
379− compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
379+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
380380 reg = <0x10019000 0x1000>;
381381 interrupts = <4>;
382382 clocks = <&clks IMX27_CLK_GPT4_IPG_GATE>,
@@ -385,7 +385,7 @@ · 2 unmodified lines
385385 };
386386
387387 gpt5: timer@1001a000 {
388− compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
388+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
389389 reg = <0x1001a000 0x1000>;
390390 interrupts = <3>;
391391 clocks = <&clks IMX27_CLK_GPT5_IPG_GATE>,
@@ -436,7 +436,7 @@ · 44 unmodified lines
436436 };
437437
438438 gpt6: timer@1001f000 {
439− compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
439+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
440440 reg = <0x1001f000 0x1000>;
441441 interrupts = <2>;
442442 clocks = <&clks IMX27_CLK_GPT6_IPG_GATE>,
arch/arm/boot/dts/imx53-qsb-common.dtsi+3−2
@@ -295,9 +295,10 @@ · 294 unmodified lines
295295 &tve {
296296 pinctrl-names = "default";
297297 pinctrl-0 = <&pinctrl_vga_sync>;
298+ ddc-i2c-bus = <&i2c2>;
298299 fsl,tve-mode = "vga";
299− fsl,hsync-pin = <4>;
300− fsl,vsync-pin = <6>;
300+ fsl,hsync-pin = <7>; /* IPU DI1 PIN7 via EIM_OE */
301+ fsl,vsync-pin = <8>; /* IPU DI1 PIN8 via EIM_RW */
301302 status = "okay";
302303 };
303304
arch/arm/boot/dts/k2e.dtsi+2−1
@@ -86,7 +86,7 @@ · 85 unmodified lines
8686 gpio,syscon-dev = <&devctrl 0x240>;
8787 };
8888
89− pcie@21020000 {
89+ pcie1: pcie@21020000 {
9090 compatible = "ti,keystone-pcie","snps,dw-pcie";
9191 clocks = <&clkpcie1>;
9292 clock-names = "pcie";
@@ -96,6 +96,7 @@ · 3 unmodified lines
9696 ranges = <0x81000000 0 0 0x23260000 0x4000 0x4000
9797 0x82000000 0 0x60000000 0x60000000 0 0x10000000>;
9898
99+ status = "disabled";
99100 device_type = "pci";
100101 num-lanes = <2>;
101102
arch/arm/boot/dts/keystone.dtsi+2−1
@@ -286,7 +286,7 @@ · 285 unmodified lines
286286 ti,syscon-dev = <&devctrl 0x2a0>;
287287 };
288288
289− pcie@21800000 {
289+ pcie0: pcie@21800000 {
290290 compatible = "ti,keystone-pcie", "snps,dw-pcie";
291291 clocks = <&clkpcie>;
292292 clock-names = "pcie";
@@ -296,6 +296,7 @@ · 3 unmodified lines
296296 ranges = <0x81000000 0 0 0x23250000 0 0x4000
297297 0x82000000 0 0x50000000 0x50000000 0 0x10000000>;
298298
299+ status = "disabled";
299300 device_type = "pci";
300301 num-lanes = <2>;
301302
arch/arm/boot/dts/omap3-overo-common-lcd35.dtsi+1−1
@@ -120,7 +120,7 @@ · 119 unmodified lines
120120
121121 lcd0: display@0 {
122122 compatible = "lgphilips,lb035q02";
123− label = "lcd";
123+ label = "lcd35";
124124
125125 reg = <1>; /* CS1 */
126126 spi-max-frequency = <10000000>;
arch/arm/boot/dts/omap3-overo-common-lcd43.dtsi+1−1
@@ -98,7 +98,7 @@ · 97 unmodified lines
9898
9999 lcd0: display@0 {
100100 compatible = "samsung,lte430wq-f0c", "panel-dpi";
101− label = "lcd";
101+ label = "lcd43";
102102
103103 pinctrl-names = "default";
104104 pinctrl-0 = <&lte430_pins>;
arch/arm/boot/dts/omap4.dtsi+2−0
@@ -551,6 +551,7 @@ · 550 unmodified lines
551551 reg = <0x4a066000 0x100>;
552552 interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
553553 ti,hwmods = "mmu_dsp";
554+ #iommu-cells = <0>;
554555 };
555556
556557 mmu_ipu: mmu@55082000 {
@@ -558,6 +559,7 @@ · 1 unmodified line
558559 reg = <0x55082000 0x100>;
559560 interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
560561 ti,hwmods = "mmu_ipu";
562+ #iommu-cells = <0>;
561563 ti,iommu-bus-err-back;
562564 };
563565
arch/arm/boot/dts/omap5.dtsi+2−0
@@ -612,6 +612,7 @@ · 611 unmodified lines
612612 reg = <0x4a066000 0x100>;
613613 interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
614614 ti,hwmods = "mmu_dsp";
615+ #iommu-cells = <0>;
615616 };
616617
617618 mmu_ipu: mmu@55082000 {
@@ -619,6 +620,7 @@ · 1 unmodified line
619620 reg = <0x55082000 0x100>;
620621 interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
621622 ti,hwmods = "mmu_ipu";
623+ #iommu-cells = <0>;
622624 ti,iommu-bus-err-back;
623625 };
624626
arch/arm/boot/dts/socfpga_cyclone5_sockit.dts+13−13
@@ -60,27 +60,27 @@ · 59 unmodified lines
6060 rxc-skew-ps = <2000>;
6161 };
6262
63−&mmc0 {
64− vmmc-supply = <&regulator_3_3v>;
65− vqmmc-supply = <&regulator_3_3v>;
66−};
67−
68−&usb1 {
69− status = "okay";
70−};
71−
7263 &gpio2 {
7364 status = "okay";
7465 };
7566
76−&i2c1{
67+&i2c1 {
7768 status = "okay";
7869
79− accel1: accel1@53{
80− compatible = "adxl34x";
70+ accel1: accelerometer@53 {
71+ compatible = "adi,adxl345";
8172 reg = <0x53>;
8273
83− interrupt-parent = < &portc >;
74+ interrupt-parent = <&portc>;
8475 interrupts = <3 2>;
8576 };
8677 };
78+
79+&mmc0 {
80+ vmmc-supply = <&regulator_3_3v>;
81+ vqmmc-supply = <&regulator_3_3v>;
82+};
83+
84+&usb1 {
85+ status = "okay";
86+};
arch/arm/boot/dts/spear1310-evb.dts+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for SPEAr1310 Evaluation Baord
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear1310.dtsi+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for all SPEAr1310 SoCs
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear1340-evb.dts+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for SPEAr1340 Evaluation Baord
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear1340.dtsi+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for all SPEAr1340 SoCs
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear13xx.dtsi+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for all SPEAr13xx SoCs
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear300-evb.dts+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for SPEAr300 Evaluation Baord
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear300.dtsi+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for SPEAr300 SoC
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear310-evb.dts+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for SPEAr310 Evaluation Baord
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear310.dtsi+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for SPEAr310 SoC
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear320-evb.dts+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for SPEAr320 Evaluation Baord
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear320.dtsi+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for SPEAr320 SoC
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/spear3xx.dtsi+1−1
@@ -1,7 +1,7 @@
11 /*
22 * DTS file for all SPEAr3xx SoCs
33 *
4− * Copyright 2012 Viresh Kumar <viresh.linux@gmail.com>
4+ * Copyright 2012 Viresh Kumar <vireshk@kernel.org>
55 *
66 * The code contained herein is licensed under the GNU General Public
77 * License. You may obtain a copy of the GNU General Public License
arch/arm/boot/dts/ste-ccu8540.dts+7−0
@@ -17,6 +17,13 @@ · 16 unmodified lines
1717 model = "ST-Ericsson U8540 platform with Device Tree";
1818 compatible = "st-ericsson,ccu8540", "st-ericsson,u8540";
1919
20+ /* This stablilizes the serial port enumeration */
21+ aliases {
22+ serial0 = &ux500_serial0;
23+ serial1 = &ux500_serial1;
24+ serial2 = &ux500_serial2;
25+ };
26+
2027 memory@0 {
2128 device_type = "memory";
2229 reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>;
arch/arm/boot/dts/ste-ccu9540.dts+7−0
@@ -16,6 +16,13 @@ · 15 unmodified lines
1616 model = "ST-Ericsson CCU9540 platform with Device Tree";
1717 compatible = "st-ericsson,ccu9540", "st-ericsson,u9540";
1818
19+ /* This stablilizes the serial port enumeration */
20+ aliases {
21+ serial0 = &ux500_serial0;
22+ serial1 = &ux500_serial1;
23+ serial2 = &ux500_serial2;
24+ };
25+
1926 memory {
2027 reg = <0x00000000 0x20000000>;
2128 };
arch/arm/boot/dts/ste-dbx5x0.dtsi+3−3
@@ -971,7 +971,7 @@ · 970 unmodified lines
971971 power-domains = <&pm_domains DOMAIN_VAPE>;
972972 };
973973
974− uart@80120000 {
974+ ux500_serial0: uart@80120000 {
975975 compatible = "arm,pl011", "arm,primecell";
976976 reg = <0x80120000 0x1000>;
977977 interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>;
@@ -986,7 +986,7 @@ · 8 unmodified lines
986986 status = "disabled";
987987 };
988988
989− uart@80121000 {
989+ ux500_serial1: uart@80121000 {
990990 compatible = "arm,pl011", "arm,primecell";
991991 reg = <0x80121000 0x1000>;
992992 interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>;
@@ -1001,7 +1001,7 @@ · 8 unmodified lines
10011001 status = "disabled";
10021002 };
10031003
1004− uart@80007000 {
1004+ ux500_serial2: uart@80007000 {
10051005 compatible = "arm,pl011", "arm,primecell";
10061006 reg = <0x80007000 0x1000>;
10071007 interrupts = <0 26 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/ste-href.dtsi+1−1
@@ -32,11 +32,11 @@ · 31 unmodified lines
3232 status = "okay";
3333 };
3434
35+ /* This UART is unused and thus left disabled */
3536 uart@80121000 {
3637 pinctrl-names = "default", "sleep";
3738 pinctrl-0 = <&uart1_default_mode>;
3839 pinctrl-1 = <&uart1_sleep_mode>;
39− status = "okay";
4040 };
4141
4242 uart@80007000 {
arch/arm/boot/dts/ste-hrefprev60-stuib.dts+7−0
@@ -17,6 +17,13 @@ · 16 unmodified lines
1717 model = "ST-Ericsson HREF (pre-v60) and ST UIB";
1818 compatible = "st-ericsson,mop500", "st-ericsson,u8500";
1919
20+ /* This stablilizes the serial port enumeration */
21+ aliases {
22+ serial0 = &ux500_serial0;
23+ serial1 = &ux500_serial1;
24+ serial2 = &ux500_serial2;
25+ };
26+
2027 soc {
2128 /* Reset line for the BU21013 touchscreen */
2229 i2c@80110000 {
arch/arm/boot/dts/ste-hrefprev60-tvk.dts+7−0
@@ -16,4 +16,11 @@ · 15 unmodified lines
1616 / {
1717 model = "ST-Ericsson HREF (pre-v60) and TVK1281618 UIB";
1818 compatible = "st-ericsson,mop500", "st-ericsson,u8500";
19+
20+ /* This stablilizes the serial port enumeration */
21+ aliases {
22+ serial0 = &ux500_serial0;
23+ serial1 = &ux500_serial1;
24+ serial2 = &ux500_serial2;
25+ };
1926 };
arch/arm/boot/dts/ste-hrefprev60.dtsi+5−0
@@ -23,6 +23,11 @@ · 22 unmodified lines
2323 };
2424
2525 soc {
26+ /* Enable UART1 on this board */
27+ uart@80121000 {
28+ status = "okay";
29+ };
30+
2631 i2c@80004000 {
2732 tps61052@33 {
2833 compatible = "tps61052";
arch/arm/boot/dts/ste-hrefv60plus-stuib.dts+7−0
@@ -19,6 +19,13 @@ · 18 unmodified lines
1919 model = "ST-Ericsson HREF (v60+) and ST UIB";
2020 compatible = "st-ericsson,hrefv60+", "st-ericsson,u8500";
2121
22+ /* This stablilizes the serial port enumeration */
23+ aliases {
24+ serial0 = &ux500_serial0;
25+ serial1 = &ux500_serial1;
26+ serial2 = &ux500_serial2;
27+ };
28+
2229 soc {
2330 /* Reset line for the BU21013 touchscreen */
2431 i2c@80110000 {
arch/arm/boot/dts/ste-hrefv60plus-tvk.dts+7−0
@@ -18,4 +18,11 @@ · 17 unmodified lines
1818 / {
1919 model = "ST-Ericsson HREF (v60+) and TVK1281618 UIB";
2020 compatible = "st-ericsson,hrefv60+", "st-ericsson,u8500";
21+
22+ /* This stablilizes the serial port enumeration */
23+ aliases {
24+ serial0 = &ux500_serial0;
25+ serial1 = &ux500_serial1;
26+ serial2 = &ux500_serial2;
27+ };
2128 };
arch/arm/boot/dts/ste-hrefv60plus.dtsi+23−2
@@ -43,15 +43,26 @@ · 42 unmodified lines
4343 <&vaudio_hf_hrefv60_mode>,
4444 <&gbf_hrefv60_mode>,
4545 <&hdtv_hrefv60_mode>,
46− <&touch_hrefv60_mode>;
46+ <&touch_hrefv60_mode>,
47+ <&gpios_hrefv60_mode>;
4748
4849 sdi0 {
49− /* SD card detect GPIO pin, extend default state */
5050 sdi0_default_mode: sdi0_default {
51+ /* SD card detect GPIO pin, extend default state */
5152 default_hrefv60_cfg1 {
5253 pins = "GPIO95_E8";
5354 ste,config = <&gpio_in_pu>;
5455 };
56+ /* VMMCI level-shifter enable */
57+ default_hrefv60_cfg2 {
58+ pins = "GPIO169_D22";
59+ ste,config = <&gpio_out_lo>;
60+ };
61+ /* VMMCI level-shifter voltage select */
62+ default_hrefv60_cfg3 {
63+ pins = "GPIO5_AG6";
64+ ste,config = <&gpio_out_hi>;
65+ };
5566 };
5667 };
5768 ipgpio {
@@ -213,6 +224,16 @@ · 155 unmodified lines
213224 };
214225 };
215226 };
227+ gpios {
228+ /* Dangling GPIO pins */
229+ gpios_hrefv60_mode: gpios_hrefv60 {
230+ default_cfg1 {
231+ /* Normally UART1 RXD, now dangling */
232+ pins = "GPIO4_AH6";
233+ ste,config = <&in_pu>;
234+ };
235+ };
236+ };
216237 };
217238 };
218239 };
arch/arm/boot/dts/ste-snowball.dts+23−2
@@ -18,6 +18,13 @@ · 17 unmodified lines
1818 model = "Calao Systems Snowball platform with device tree";
1919 compatible = "calaosystems,snowball-a9500", "st-ericsson,u9500";
2020
21+ /* This stablilizes the serial port enumeration */
22+ aliases {
23+ serial0 = &ux500_serial0;
24+ serial1 = &ux500_serial1;
25+ serial2 = &ux500_serial2;
26+ };
27+
2128 memory {
2229 reg = <0x00000000 0x20000000>;
2330 };
@@ -223,11 +230,11 @@ · 199 unmodified lines
223230 status = "okay";
224231 };
225232
233+ /* This UART is unused and thus left disabled */
226234 uart@80121000 {
227235 pinctrl-names = "default", "sleep";
228236 pinctrl-0 = <&uart1_default_mode>;
229237 pinctrl-1 = <&uart1_sleep_mode>;
230− status = "okay";
231238 };
232239
233240 uart@80007000 {
@@ -452,7 +459,21 @@ · 218 unmodified lines
452459 pins = "GPIO21_AB3"; /* DAT31DIR */
453460 ste,config = <&out_hi>;
454461 };
455−
462+ /* SD card detect GPIO pin, extend default state */
463+ snowball_cfg2 {
464+ pins = "GPIO218_AH11";
465+ ste,config = <&gpio_in_pu>;
466+ };
467+ /* VMMCI level-shifter enable */
468+ snowball_cfg3 {
469+ pins = "GPIO217_AH12";
470+ ste,config = <&gpio_out_lo>;
471+ };
472+ /* VMMCI level-shifter voltage select */
473+ snowball_cfg4 {
474+ pins = "GPIO228_AJ6";
475+ ste,config = <&gpio_out_hi>;
476+ };
456477 };
457478 };
458479 ssp0 {
arch/arm/include/asm/Kbuild+1−0
@@ -13,6 +13,7 @@ generic-y += kdebug.h · 12 unmodified lines
1313 generic-y += local.h
1414 generic-y += local64.h
1515 generic-y += mcs_spinlock.h
16+generic-y += mm-arch-hooks.h
1617 generic-y += msgbuf.h
1718 generic-y += param.h
1819 generic-y += parport.h
arch/arm/include/asm/memory.h+1−1
@@ -286,7 +286,7 @@ extern phys_addr_t (*arch_virt_to_idmap)(unsigned long x); · 285 unmodified lines
286286 */
287287 static inline phys_addr_t __virt_to_idmap(unsigned long x)
288288 {
289− if (arch_virt_to_idmap)
289+ if (IS_ENABLED(CONFIG_MMU) && arch_virt_to_idmap)
290290 return arch_virt_to_idmap(x);
291291 else
292292 return __virt_to_phys(x);
arch/arm/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_ARM_MM_ARCH_HOOKS_H
13−#define _ASM_ARM_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_ARM_MM_ARCH_HOOKS_H */
arch/arm/kernel/perf_event.c+2−1
@@ -818,12 +818,13 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) · 817 unmodified lines
818818 if (arch_find_n_match_cpu_physical_id(dn, cpu, NULL))
819819 break;
820820
821− of_node_put(dn);
822821 if (cpu >= nr_cpu_ids) {
823822 pr_warn("Failed to find logical CPU for %s\n",
824823 dn->name);
824+ of_node_put(dn);
825825 break;
826826 }
827+ of_node_put(dn);
827828
828829 irqs[i] = cpu;
829830 cpumask_set_cpu(cpu, &pmu->supported_cpus);
arch/arm/kernel/reboot.c+1−1
@@ -50,7 +50,7 @@ static void __soft_restart(void *addr) · 49 unmodified lines
5050 flush_cache_all();
5151
5252 /* Switch to the identity mapping. */
53− phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
53+ phys_reset = (phys_reset_t)(unsigned long)virt_to_idmap(cpu_reset);
5454 phys_reset((unsigned long)addr);
5555
5656 /* Should never get here. */
arch/arm/mach-imx/gpc.c+6−21
@@ -291,8 +291,6 @@ void __init imx_gpc_check_dt(void) · 290 unmodified lines
291291 }
292292 }
293293
294−#ifdef CONFIG_PM_GENERIC_DOMAINS
295−
296294 static void _imx6q_pm_pu_power_off(struct generic_pm_domain *genpd)
297295 {
298296 int iso, iso2sw;
@@ -399,7 +397,6 @@ static struct genpd_onecell_data imx_gpc_onecell_data = { · 100 unmodified lines
399397 static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg)
400398 {
401399 struct clk *clk;
402− bool is_off;
403400 int i;
404401
405402 imx6q_pu_domain.reg = pu_reg;
@@ -416,18 +413,13 @@ static int imx_gpc_genpd_init(struct device *dev, struct regulator *pu_reg) · 10 unmodified lines
416413 }
417414 imx6q_pu_domain.num_clks = i;
418415
419− is_off = IS_ENABLED(CONFIG_PM);
420− if (is_off) {
421− _imx6q_pm_pu_power_off(&imx6q_pu_domain.base);
422− } else {
423− /*
424− * Enable power if compiled without CONFIG_PM in case the
425− * bootloader disabled it.
426− */
427− imx6q_pm_pu_power_on(&imx6q_pu_domain.base);
428− }
416+ /* Enable power always in case bootloader disabled it. */
417+ imx6q_pm_pu_power_on(&imx6q_pu_domain.base);
418+
419+ if (!IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS))
420+ return 0;
429421
430− pm_genpd_init(&imx6q_pu_domain.base, NULL, is_off);
422+ pm_genpd_init(&imx6q_pu_domain.base, NULL, false);
431423 return of_genpd_add_provider_onecell(dev->of_node,
432424 &imx_gpc_onecell_data);
433425
@@ -437,13 +429,6 @@ clk_err: · 3 unmodified lines
437429 return -EINVAL;
438430 }
439431
440−#else
441−static inline int imx_gpc_genpd_init(struct device *dev, struct regulator *reg)
442−{
443− return 0;
444−}
445−#endif /* CONFIG_PM_GENERIC_DOMAINS */
446−
447432 static int imx_gpc_probe(struct platform_device *pdev)
448433 {
449434 struct regulator *pu_reg;
arch/arm/mach-omap2/Kconfig+1−0
@@ -60,6 +60,7 @@ config SOC_AM43XX · 59 unmodified lines
6060 select ARM_GIC
6161 select MACH_OMAP_GENERIC
6262 select MIGHT_HAVE_CACHE_L2X0
63+ select HAVE_ARM_SCU
6364
6465 config SOC_DRA7XX
6566 bool "TI DRA7XX"
arch/arm/mach-pxa/capc7117.c+3−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <linux/ata_platform.h>
2525 #include <linux/serial_8250.h>
2626 #include <linux/gpio.h>
27+#include <linux/regulator/machine.h>
2728
2829 #include <asm/mach-types.h>
2930 #include <asm/mach/arch.h>
@@ -144,6 +145,8 @@ static void __init capc7117_init(void) · 114 unmodified lines
144145
145146 capc7117_uarts_init();
146147 capc7117_ide_init();
148+
149+ regulator_has_full_constraints();
147150 }
148151
149152 MACHINE_START(CAPC7117,
arch/arm/mach-pxa/cm-x2xx.c+3−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/syscore_ops.h>
1414 #include <linux/irq.h>
1515 #include <linux/gpio.h>
16+#include <linux/regulator/machine.h>
1617
1718 #include <linux/dm9000.h>
1819 #include <linux/leds.h>
@@ -466,6 +467,8 @@ static void __init cmx2xx_init(void) · 447 unmodified lines
466467 cmx2xx_init_ac97();
467468 cmx2xx_init_touchscreen();
468469 cmx2xx_init_leds();
470+
471+ regulator_has_full_constraints();
469472 }
470473
471474 static void __init cmx2xx_init_irq(void)
arch/arm/mach-pxa/cm-x300.c+2−0
@@ -835,6 +835,8 @@ static void __init cm_x300_init(void) · 834 unmodified lines
835835 cm_x300_init_ac97();
836836 cm_x300_init_wi2wi();
837837 cm_x300_init_bl();
838+
839+ regulator_has_full_constraints();
838840 }
839841
840842 static void __init cm_x300_fixup(struct tag *tags, char **cmdline)
arch/arm/mach-pxa/colibri-pxa270.c+3−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/mtd/partitions.h>
1919 #include <linux/mtd/physmap.h>
2020 #include <linux/platform_device.h>
21+#include <linux/regulator/machine.h>
2122 #include <linux/ucb1400.h>
2223
2324 #include <asm/mach/arch.h>
@@ -294,6 +295,8 @@ static void __init colibri_pxa270_init(void) · 270 unmodified lines
294295 printk(KERN_ERR "Illegal colibri_pxa270_baseboard type %d\n",
295296 colibri_pxa270_baseboard);
296297 }
298+
299+ regulator_has_full_constraints();
297300 }
298301
299302 /* The "Income s.r.o. SH-Dmaster PXA270 SBC" board can be booted either
arch/arm/mach-pxa/em-x270.c+2−0
@@ -1306,6 +1306,8 @@ static void __init em_x270_init(void) · 1305 unmodified lines
13061306 em_x270_init_i2c();
13071307 em_x270_init_camera();
13081308 em_x270_userspace_consumers_init();
1309+
1310+ regulator_has_full_constraints();
13091311 }
13101312
13111313 MACHINE_START(EM_X270, "Compulab EM-X270")
arch/arm/mach-pxa/icontrol.c+3−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/spi/spi.h>
2727 #include <linux/spi/pxa2xx_spi.h>
2828 #include <linux/can/platform/mcp251x.h>
29+#include <linux/regulator/machine.h>
2930
3031 #include "generic.h"
3132
@@ -185,6 +186,8 @@ static void __init icontrol_init(void) · 153 unmodified lines
185186 mxm_8x10_mmc_init();
186187
187188 icontrol_can_init();
189+
190+ regulator_has_full_constraints();
188191 }
189192
190193 MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
arch/arm/mach-pxa/trizeps4.c+3−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/dm9000.h>
2727 #include <linux/mtd/physmap.h>
2828 #include <linux/mtd/partitions.h>
29+#include <linux/regulator/machine.h>
2930 #include <linux/i2c/pxa-i2c.h>
3031
3132 #include <asm/types.h>
@@ -534,6 +535,8 @@ static void __init trizeps4_init(void) · 502 unmodified lines
534535
535536 BCR_writew(trizeps_conxs_bcr);
536537 board_backlight_power(1);
538+
539+ regulator_has_full_constraints();
537540 }
538541
539542 static void __init trizeps4_map_io(void)
arch/arm/mach-pxa/vpac270.c+3−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <linux/dm9000.h>
2525 #include <linux/ucb1400.h>
2626 #include <linux/ata_platform.h>
27+#include <linux/regulator/machine.h>
2728 #include <linux/regulator/max1586.h>
2829 #include <linux/i2c/pxa-i2c.h>
2930
@@ -711,6 +712,8 @@ static void __init vpac270_init(void) · 681 unmodified lines
711712 vpac270_ts_init();
712713 vpac270_rtc_init();
713714 vpac270_ide_init();
715+
716+ regulator_has_full_constraints();
714717 }
715718
716719 MACHINE_START(VPAC270, "Voipac PXA270")
arch/arm/mach-pxa/zeus.c+2−0
@@ -868,6 +868,8 @@ static void __init zeus_init(void) · 867 unmodified lines
868868 i2c_register_board_info(0, ARRAY_AND_SIZE(zeus_i2c_devices));
869869 pxa2xx_set_spi_info(3, &pxa2xx_spi_ssp3_master_info);
870870 spi_register_board_info(zeus_spi_board_info, ARRAY_SIZE(zeus_spi_board_info));
871+
872+ regulator_has_full_constraints();
871873 }
872874
873875 static struct map_desc zeus_io_desc[] __initdata = {
arch/arm/mach-spear/generic.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Copyright (C) 2009-2012 ST Microelectronics
55 * Rajeev Kumar <rajeev-dlh.kumar@st.com>
6− * Viresh Kumar <viresh.linux@gmail.com>
6+ * Viresh Kumar <vireshk@kernel.org>
77 *
88 * This file is licensed under the terms of the GNU General Public
99 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/include/mach/irqs.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Copyright (C) 2009-2012 ST Microelectronics
55 * Rajeev Kumar <rajeev-dlh.kumar@st.com>
6− * Viresh Kumar <viresh.linux@gmail.com>
6+ * Viresh Kumar <vireshk@kernel.org>
77 *
88 * This file is licensed under the terms of the GNU General Public
99 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/include/mach/misc_regs.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Miscellaneous registers definitions for SPEAr3xx machine family
55 *
66 * Copyright (C) 2009 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/include/mach/spear.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Copyright (C) 2009,2012 ST Microelectronics
55 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
6− * Viresh Kumar <viresh.linux@gmail.com>
6+ * Viresh Kumar <vireshk@kernel.org>
77 *
88 * This file is licensed under the terms of the GNU General Public
99 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/include/mach/uncompress.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Serial port stubs for kernel decompress status messages
55 *
66 * Copyright (C) 2009 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/pl080.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * DMAC pl080 definitions for SPEAr platform
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/pl080.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * DMAC pl080 definitions for SPEAr platform
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/restart.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr platform specific restart functions
55 *
66 * Copyright (C) 2009 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/spear1310.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr1310 machine source file
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/spear1340.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr1340 machine source file
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/spear13xx.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr13XX machines common source file
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/spear300.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr300 machine source file
55 *
66 * Copyright (C) 2009-2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/spear310.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr310 machine source file
55 *
66 * Copyright (C) 2009-2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/spear320.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr320 machine source file
55 *
66 * Copyright (C) 2009-2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mach-spear/spear3xx.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr3XX machines common source file
55 *
66 * Copyright (C) 2009-2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
arch/arm/mm/dma-mapping.c+1−1
@@ -1971,7 +1971,7 @@ static int extend_iommu_mapping(struct dma_iommu_mapping *mapping) · 1970 unmodified lines
19711971 {
19721972 int next_bitmap;
19731973
1974− if (mapping->nr_bitmaps > mapping->extensions)
1974+ if (mapping->nr_bitmaps >= mapping->extensions)
19751975 return -EINVAL;
19761976
19771977 next_bitmap = mapping->nr_bitmaps;
arch/arm/mm/proc-v7.S+9−5
@@ -274,7 +274,10 @@ __v7_ca15mp_setup: · 273 unmodified lines
274274 __v7_b15mp_setup:
275275 __v7_ca17mp_setup:
276276 mov r10, #0
277−1:
277+1: adr r12, __v7_setup_stack @ the local stack
278+ stmia r12, {r0-r5, lr} @ v7_invalidate_l1 touches r0-r6
279+ bl v7_invalidate_l1
280+ ldmia r12, {r0-r5, lr}
278281 #ifdef CONFIG_SMP
279282 ALT_SMP(mrc p15, 0, r0, c1, c0, 1)
280283 ALT_UP(mov r0, #(1 << 6)) @ fake it for UP
@@ -283,7 +286,7 @@ __v7_ca17mp_setup: · 2 unmodified lines
283286 orreq r0, r0, r10 @ Enable CPU-specific SMP bits
284287 mcreq p15, 0, r0, c1, c0, 1
285288 #endif
286− b __v7_setup
289+ b __v7_setup_cont
287290
288291 /*
289292 * Errata:
@@ -413,10 +416,11 @@ __v7_pj4b_setup: · 123 unmodified lines
413416
414417 __v7_setup:
415418 adr r12, __v7_setup_stack @ the local stack
416− stmia r12, {r0-r5, r7, r9, r11, lr}
419+ stmia r12, {r0-r5, lr} @ v7_invalidate_l1 touches r0-r6
417420 bl v7_invalidate_l1
418− ldmia r12, {r0-r5, r7, r9, r11, lr}
421+ ldmia r12, {r0-r5, lr}
419422
423+__v7_setup_cont:
420424 and r0, r9, #0xff000000 @ ARM?
421425 teq r0, #0x41000000
422426 bne __errata_finish
@@ -480,7 +484,7 @@ ENDPROC(__v7_setup) · 57 unmodified lines
480484
481485 .align 2
482486 __v7_setup_stack:
483− .space 4 * 11 @ 11 registers
487+ .space 4 * 7 @ 12 registers
484488
485489 __INITDATA
486490
arch/arm/net/bpf_jit_32.c+44−13
@@ -74,32 +74,52 @@ struct jit_ctx { · 73 unmodified lines
7474
7575 int bpf_jit_enable __read_mostly;
7676
77−static u64 jit_get_skb_b(struct sk_buff *skb, unsigned offset)
77+static inline int call_neg_helper(struct sk_buff *skb, int offset, void *ret,
78+ unsigned int size)
79+{
80+ void *ptr = bpf_internal_load_pointer_neg_helper(skb, offset, size);
81+
82+ if (!ptr)
83+ return -EFAULT;
84+ memcpy(ret, ptr, size);
85+ return 0;
86+}
87+
88+static u64 jit_get_skb_b(struct sk_buff *skb, int offset)
7889 {
7990 u8 ret;
8091 int err;
8192
82− err = skb_copy_bits(skb, offset, &ret, 1);
93+ if (offset < 0)
94+ err = call_neg_helper(skb, offset, &ret, 1);
95+ else
96+ err = skb_copy_bits(skb, offset, &ret, 1);
8397
8498 return (u64)err << 32 | ret;
8599 }
86100
87−static u64 jit_get_skb_h(struct sk_buff *skb, unsigned offset)
101+static u64 jit_get_skb_h(struct sk_buff *skb, int offset)
88102 {
89103 u16 ret;
90104 int err;
91105
92− err = skb_copy_bits(skb, offset, &ret, 2);
106+ if (offset < 0)
107+ err = call_neg_helper(skb, offset, &ret, 2);
108+ else
109+ err = skb_copy_bits(skb, offset, &ret, 2);
93110
94111 return (u64)err << 32 | ntohs(ret);
95112 }
96113
97−static u64 jit_get_skb_w(struct sk_buff *skb, unsigned offset)
114+static u64 jit_get_skb_w(struct sk_buff *skb, int offset)
98115 {
99116 u32 ret;
100117 int err;
101118
102− err = skb_copy_bits(skb, offset, &ret, 4);
119+ if (offset < 0)
120+ err = call_neg_helper(skb, offset, &ret, 4);
121+ else
122+ err = skb_copy_bits(skb, offset, &ret, 4);
103123
104124 return (u64)err << 32 | ntohl(ret);
105125 }
@@ -536,9 +556,6 @@ static int build_body(struct jit_ctx *ctx) · 430 unmodified lines
536556 case BPF_LD | BPF_B | BPF_ABS:
537557 load_order = 0;
538558 load:
539− /* the interpreter will deal with the negative K */
540− if ((int)k < 0)
541− return -ENOTSUPP;
542559 emit_mov_i(r_off, k, ctx);
543560 load_common:
544561 ctx->seen |= SEEN_DATA | SEEN_CALL;
@@ -547,12 +564,24 @@ load_common: · 2 unmodified lines
547564 emit(ARM_SUB_I(r_scratch, r_skb_hl,
548565 1 << load_order), ctx);
549566 emit(ARM_CMP_R(r_scratch, r_off), ctx);
550− condt = ARM_COND_HS;
567+ condt = ARM_COND_GE;
551568 } else {
552569 emit(ARM_CMP_R(r_skb_hl, r_off), ctx);
553570 condt = ARM_COND_HI;
554571 }
555572
573+ /*
574+ * test for negative offset, only if we are
575+ * currently scheduled to take the fast
576+ * path. this will update the flags so that
577+ * the slowpath instruction are ignored if the
578+ * offset is negative.
579+ *
580+ * for loard_order == 0 the HI condition will
581+ * make loads at offset 0 take the slow path too.
582+ */
583+ _emit(condt, ARM_CMP_I(r_off, 0), ctx);
584+
556585 _emit(condt, ARM_ADD_R(r_scratch, r_off, r_skb_data),
557586 ctx);
558587
@@ -860,9 +889,11 @@ b_epilogue: · 301 unmodified lines
860889 off = offsetof(struct sk_buff, vlan_tci);
861890 emit(ARM_LDRH_I(r_A, r_skb, off), ctx);
862891 if (code == (BPF_ANC | SKF_AD_VLAN_TAG))
863− OP_IMM3(ARM_AND, r_A, r_A, VLAN_VID_MASK, ctx);
864− else
865− OP_IMM3(ARM_AND, r_A, r_A, VLAN_TAG_PRESENT, ctx);
892+ OP_IMM3(ARM_AND, r_A, r_A, ~VLAN_TAG_PRESENT, ctx);
893+ else {
894+ OP_IMM3(ARM_LSR, r_A, r_A, 12, ctx);
895+ OP_IMM3(ARM_AND, r_A, r_A, 0x1, ctx);
896+ }
866897 break;
867898 case BPF_ANC | SKF_AD_QUEUE:
868899 ctx->seen |= SEEN_SKB;
arch/arm64/include/asm/Kbuild+1−0
@@ -25,6 +25,7 @@ generic-y += kvm_para.h · 24 unmodified lines
2525 generic-y += local.h
2626 generic-y += local64.h
2727 generic-y += mcs_spinlock.h
28+generic-y += mm-arch-hooks.h
2829 generic-y += mman.h
2930 generic-y += msgbuf.h
3031 generic-y += msi.h
arch/arm64/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_ARM64_MM_ARCH_HOOKS_H
13−#define _ASM_ARM64_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_ARM64_MM_ARCH_HOOKS_H */
arch/arm64/kernel/entry.S+3−2
@@ -585,7 +585,8 @@ ENDPROC(el0_irq) · 584 unmodified lines
585585 *
586586 */
587587 ENTRY(cpu_switch_to)
588− add x8, x0, #THREAD_CPU_CONTEXT
588+ mov x10, #THREAD_CPU_CONTEXT
589+ add x8, x0, x10
589590 mov x9, sp
590591 stp x19, x20, [x8], #16 // store callee-saved registers
591592 stp x21, x22, [x8], #16
@@ -594,7 +595,7 @@ ENTRY(cpu_switch_to) · 2 unmodified lines
594595 stp x27, x28, [x8], #16
595596 stp x29, x9, [x8], #16
596597 str lr, [x8]
597− add x8, x1, #THREAD_CPU_CONTEXT
598+ add x8, x1, x10
598599 ldp x19, x20, [x8], #16 // restore callee-saved registers
599600 ldp x21, x22, [x8], #16
600601 ldp x23, x24, [x8], #16
arch/arm64/kernel/irq.c+2−2
@@ -61,7 +61,7 @@ void __init init_IRQ(void) · 60 unmodified lines
6161 static bool migrate_one_irq(struct irq_desc *desc)
6262 {
6363 struct irq_data *d = irq_desc_get_irq_data(desc);
64− const struct cpumask *affinity = d->affinity;
64+ const struct cpumask *affinity = irq_data_get_affinity_mask(d);
6565 struct irq_chip *c;
6666 bool ret = false;
6767
@@ -81,7 +81,7 @@ static bool migrate_one_irq(struct irq_desc *desc) · 13 unmodified lines
8181 if (!c->irq_set_affinity)
8282 pr_debug("IRQ%u: unable to set affinity\n", d->irq);
8383 else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
84− cpumask_copy(d->affinity, affinity);
84+ cpumask_copy(irq_data_get_affinity_mask(d), affinity);
8585
8686 return ret;
8787 }
arch/avr32/include/asm/Kbuild+1−0
@@ -12,6 +12,7 @@ generic-y += irq_work.h · 11 unmodified lines
1212 generic-y += local.h
1313 generic-y += local64.h
1414 generic-y += mcs_spinlock.h
15+generic-y += mm-arch-hooks.h
1516 generic-y += param.h
1617 generic-y += percpu.h
1718 generic-y += preempt.h
arch/avr32/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_AVR32_MM_ARCH_HOOKS_H
13−#define _ASM_AVR32_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_AVR32_MM_ARCH_HOOKS_H */
arch/avr32/kernel/time.c+33−32
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818
1919 #include <mach/pm.h>
2020
21+static bool disable_cpu_idle_poll;
2122
2223 static cycle_t read_cycle_count(struct clocksource *cs)
2324 {
@@ -80,45 +81,45 @@ static int comparator_next_event(unsigned long delta, · 56 unmodified lines
8081 return 0;
8182 }
8283
83−static void comparator_mode(enum clock_event_mode mode,
84− struct clock_event_device *evdev)
84+static int comparator_shutdown(struct clock_event_device *evdev)
8585 {
86− switch (mode) {
87− case CLOCK_EVT_MODE_ONESHOT:
88− pr_debug("%s: start\n", evdev->name);
89− /* FALLTHROUGH */
90− case CLOCK_EVT_MODE_RESUME:
86+ pr_debug("%s: %s\n", __func__, evdev->name);
87+ sysreg_write(COMPARE, 0);
88+
89+ if (disable_cpu_idle_poll) {
90+ disable_cpu_idle_poll = false;
9191 /*
92− * If we're using the COUNT and COMPARE registers we
93− * need to force idle poll.
92+ * Only disable idle poll if we have forced that
93+ * in a previous call.
9494 */
95− cpu_idle_poll_ctrl(true);
96− break;
97− case CLOCK_EVT_MODE_UNUSED:
98− case CLOCK_EVT_MODE_SHUTDOWN:
99− sysreg_write(COMPARE, 0);
100− pr_debug("%s: stop\n", evdev->name);
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− }
109− break;
110− default:
111− BUG();
95+ cpu_idle_poll_ctrl(false);
11296 }
97+ return 0;
98+}
99+
100+static int comparator_set_oneshot(struct clock_event_device *evdev)
101+{
102+ pr_debug("%s: %s\n", __func__, evdev->name);
103+
104+ disable_cpu_idle_poll = true;
105+ /*
106+ * If we're using the COUNT and COMPARE registers we
107+ * need to force idle poll.
108+ */
109+ cpu_idle_poll_ctrl(true);
110+
111+ return 0;
113112 }
114113
115114 static struct clock_event_device comparator = {
116− .name = "avr32_comparator",
117− .features = CLOCK_EVT_FEAT_ONESHOT,
118− .shift = 16,
119− .rating = 50,
120− .set_next_event = comparator_next_event,
121− .set_mode = comparator_mode,
115+ .name = "avr32_comparator",
116+ .features = CLOCK_EVT_FEAT_ONESHOT,
117+ .shift = 16,
118+ .rating = 50,
119+ .set_next_event = comparator_next_event,
120+ .set_state_shutdown = comparator_shutdown,
121+ .set_state_oneshot = comparator_set_oneshot,
122+ .tick_resume = comparator_set_oneshot,
122123 };
123124
124125 void read_persistent_clock(struct timespec *ts)
arch/blackfin/include/asm/Kbuild+1−0
@@ -21,6 +21,7 @@ generic-y += kvm_para.h · 20 unmodified lines
2121 generic-y += local.h
2222 generic-y += local64.h
2323 generic-y += mcs_spinlock.h
24+generic-y += mm-arch-hooks.h
2425 generic-y += mman.h
2526 generic-y += msgbuf.h
2627 generic-y += mutex.h
arch/blackfin/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_BLACKFIN_MM_ARCH_HOOKS_H
13−#define _ASM_BLACKFIN_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_BLACKFIN_MM_ARCH_HOOKS_H */
arch/c6x/include/asm/Kbuild+1−0
@@ -26,6 +26,7 @@ generic-y += kdebug.h · 25 unmodified lines
2626 generic-y += kmap_types.h
2727 generic-y += local.h
2828 generic-y += mcs_spinlock.h
29+generic-y += mm-arch-hooks.h
2930 generic-y += mman.h
3031 generic-y += mmu.h
3132 generic-y += mmu_context.h
arch/c6x/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_C6X_MM_ARCH_HOOKS_H
13−#define _ASM_C6X_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_C6X_MM_ARCH_HOOKS_H */
arch/cris/include/asm/Kbuild+1−0
@@ -18,6 +18,7 @@ generic-y += linkage.h · 17 unmodified lines
1818 generic-y += local.h
1919 generic-y += local64.h
2020 generic-y += mcs_spinlock.h
21+generic-y += mm-arch-hooks.h
2122 generic-y += module.h
2223 generic-y += percpu.h
2324 generic-y += preempt.h
arch/cris/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_CRIS_MM_ARCH_HOOKS_H
13−#define _ASM_CRIS_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_CRIS_MM_ARCH_HOOKS_H */
arch/frv/include/asm/Kbuild+1−0
@@ -4,5 +4,6 @@ generic-y += cputime.h · 3 unmodified lines
44 generic-y += exec.h
55 generic-y += irq_work.h
66 generic-y += mcs_spinlock.h
7+generic-y += mm-arch-hooks.h
78 generic-y += preempt.h
89 generic-y += trace_clock.h
arch/frv/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_FRV_MM_ARCH_HOOKS_H
13−#define _ASM_FRV_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_FRV_MM_ARCH_HOOKS_H */
arch/h8300/include/asm/Kbuild+1−0
@@ -33,6 +33,7 @@ generic-y += linkage.h · 32 unmodified lines
3333 generic-y += local.h
3434 generic-y += local64.h
3535 generic-y += mcs_spinlock.h
36+generic-y += mm-arch-hooks.h
3637 generic-y += mman.h
3738 generic-y += mmu.h
3839 generic-y += mmu_context.h
arch/hexagon/include/asm/Kbuild+1−0
@@ -28,6 +28,7 @@ generic-y += kmap_types.h · 27 unmodified lines
2828 generic-y += local.h
2929 generic-y += local64.h
3030 generic-y += mcs_spinlock.h
31+generic-y += mm-arch-hooks.h
3132 generic-y += mman.h
3233 generic-y += msgbuf.h
3334 generic-y += pci.h
arch/hexagon/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_HEXAGON_MM_ARCH_HOOKS_H
13−#define _ASM_HEXAGON_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_HEXAGON_MM_ARCH_HOOKS_H */
arch/ia64/include/asm/Kbuild+1−0
@@ -4,6 +4,7 @@ generic-y += exec.h · 3 unmodified lines
44 generic-y += irq_work.h
55 generic-y += kvm_para.h
66 generic-y += mcs_spinlock.h
7+generic-y += mm-arch-hooks.h
78 generic-y += preempt.h
89 generic-y += trace_clock.h
910 generic-y += vtime.h
arch/ia64/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_IA64_MM_ARCH_HOOKS_H
13−#define _ASM_IA64_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_IA64_MM_ARCH_HOOKS_H */
arch/m32r/include/asm/Kbuild+1−0
@@ -4,6 +4,7 @@ generic-y += cputime.h · 3 unmodified lines
44 generic-y += exec.h
55 generic-y += irq_work.h
66 generic-y += mcs_spinlock.h
7+generic-y += mm-arch-hooks.h
78 generic-y += module.h
89 generic-y += preempt.h
910 generic-y += sections.h
arch/m32r/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_M32R_MM_ARCH_HOOKS_H
13−#define _ASM_M32R_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_M32R_MM_ARCH_HOOKS_H */
arch/m68k/Kconfig.cpu+27−22
@@ -125,6 +125,13 @@ endif # M68KCLASSIC · 124 unmodified lines
125125
126126 if COLDFIRE
127127
128+choice
129+ prompt "ColdFire SoC type"
130+ default M520x
131+ help
132+ Select the type of ColdFire System-on-Chip (SoC) that you want
133+ to build for.
134+
128135 config M5206
129136 bool "MCF5206"
130137 depends on !MMU
@@ -174,9 +181,6 @@ config M525x · 43 unmodified lines
174181 help
175182 Freescale (Motorola) Coldfire 5251/5253 processor support.
176183
177−config M527x
178− bool
179−
180184 config M5271
181185 bool "MCF5271"
182186 depends on !MMU
@@ -223,9 +227,6 @@ config M5307 · 40 unmodified lines
223227 help
224228 Motorola ColdFire 5307 processor support.
225229
226−config M53xx
227− bool
228−
229230 config M532x
230231 bool "MCF532x"
231232 depends on !MMU
@@ -251,9 +252,6 @@ config M5407 · 19 unmodified lines
251252 help
252253 Motorola ColdFire 5407 processor support.
253254
254−config M54xx
255− bool
256−
257255 config M547x
258256 bool "MCF547x"
259257 select M54xx
@@ -280,6 +278,17 @@ config M5441x · 20 unmodified lines
280278 help
281279 Freescale Coldfire 54410/54415/54416/54417/54418 processor support.
282280
281+endchoice
282+
283+config M527x
284+ bool
285+
286+config M53xx
287+ bool
288+
289+config M54xx
290+ bool
291+
283292 endif # COLDFIRE
284293
285294
@@ -416,22 +425,18 @@ config HAVE_MBAR · 130 unmodified lines
416425 config HAVE_IPSBAR
417426 bool
418427
419−config CLOCK_SET
420− bool "Enable setting the CPU clock frequency"
421− depends on COLDFIRE
422− default n
423− help
424− On some CPU's you do not need to know what the core CPU clock
425− frequency is. On these you can disable clock setting. On some
426− traditional 68K parts, and on all ColdFire parts you need to set
427− the appropriate CPU clock frequency. On these devices many of the
428− onboard peripherals derive their timing from the master CPU clock
429− frequency.
430−
431428 config CLOCK_FREQ
432429 int "Set the core clock frequency"
430+ default "25000000" if M5206
431+ default "54000000" if M5206e
432+ default "166666666" if M520x
433+ default "140000000" if M5249
434+ default "150000000" if M527x || M523x
435+ default "90000000" if M5307
436+ default "50000000" if M5407
437+ default "266000000" if M54xx
433438 default "66666666"
434− depends on CLOCK_SET
439+ depends on COLDFIRE
435440 help
436441 Define the CPU clock frequency in use. This is the core clock
437442 frequency, it may or may not be the same as the external clock
arch/m68k/configs/m5208evb_defconfig+3−19
@@ -1,10 +1,6 @@
1−# CONFIG_MMU is not set
2−CONFIG_EXPERIMENTAL=y
31 CONFIG_LOG_BUF_SHIFT=14
4−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
52 CONFIG_EXPERT=y
63 # CONFIG_KALLSYMS is not set
7−# CONFIG_HOTPLUG is not set
84 # CONFIG_FUTEX is not set
95 # CONFIG_EPOLL is not set
106 # CONFIG_SIGNALFD is not set
@@ -16,17 +12,12 @@ CONFIG_EXPERT=y · 5 unmodified lines
1612 # CONFIG_BLK_DEV_BSG is not set
1713 # CONFIG_IOSCHED_DEADLINE is not set
1814 # CONFIG_IOSCHED_CFQ is not set
19−CONFIG_M520x=y
20−CONFIG_CLOCK_SET=y
21−CONFIG_CLOCK_FREQ=166666666
22−CONFIG_CLOCK_DIV=2
23−CONFIG_M5208EVB=y
15+# CONFIG_MMU is not set
2416 # CONFIG_4KSTACKS is not set
2517 CONFIG_RAMBASE=0x40000000
2618 CONFIG_RAMSIZE=0x2000000
2719 CONFIG_VECTORBASE=0x40000000
2820 CONFIG_KERNELBASE=0x40020000
29−CONFIG_RAM16BIT=y
3021 CONFIG_BINFMT_FLAT=y
3122 CONFIG_NET=y
3223 CONFIG_PACKET=y
@@ -40,24 +31,19 @@ CONFIG_INET=y · 7 unmodified lines
4031 # CONFIG_IPV6 is not set
4132 # CONFIG_FW_LOADER is not set
4233 CONFIG_MTD=y
43−CONFIG_MTD_CHAR=y
4434 CONFIG_MTD_BLOCK=y
4535 CONFIG_MTD_RAM=y
4636 CONFIG_MTD_UCLINUX=y
4737 CONFIG_BLK_DEV_RAM=y
48−# CONFIG_MISC_DEVICES is not set
4938 CONFIG_NETDEVICES=y
50−CONFIG_NET_ETHERNET=y
5139 CONFIG_FEC=y
52−# CONFIG_NETDEV_1000 is not set
53−# CONFIG_NETDEV_10000 is not set
5440 # CONFIG_INPUT is not set
5541 # CONFIG_SERIO is not set
5642 # CONFIG_VT is not set
43+# CONFIG_UNIX98_PTYS is not set
5744 CONFIG_SERIAL_MCF=y
5845 CONFIG_SERIAL_MCF_BAUDRATE=115200
5946 CONFIG_SERIAL_MCF_CONSOLE=y
60−# CONFIG_UNIX98_PTYS is not set
6147 # CONFIG_HW_RANDOM is not set
6248 # CONFIG_HWMON is not set
6349 # CONFIG_USB_SUPPORT is not set
@@ -68,8 +54,6 @@ CONFIG_EXT2_FS=y · 4 unmodified lines
6854 CONFIG_ROMFS_FS=y
6955 CONFIG_ROMFS_BACKED_BY_MTD=y
7056 # CONFIG_NETWORK_FILESYSTEMS is not set
71−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
72−CONFIG_SYSCTL_SYSCALL_CHECK=y
73−CONFIG_FULLDEBUG=y
7457 CONFIG_BOOTPARAM=y
7558 CONFIG_BOOTPARAM_STRING="root=/dev/mtdblock0"
59+CONFIG_FULLDEBUG=y
arch/m68k/configs/m5249evb_defconfig+2−15
@@ -1,10 +1,6 @@
1−# CONFIG_MMU is not set
2−CONFIG_EXPERIMENTAL=y
31 CONFIG_LOG_BUF_SHIFT=14
4−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
52 CONFIG_EXPERT=y
63 # CONFIG_KALLSYMS is not set
7−# CONFIG_HOTPLUG is not set
84 # CONFIG_FUTEX is not set
95 # CONFIG_EPOLL is not set
106 # CONFIG_SIGNALFD is not set
@@ -16,10 +12,8 @@ CONFIG_EXPERT=y · 5 unmodified lines
1612 # CONFIG_BLK_DEV_BSG is not set
1713 # CONFIG_IOSCHED_DEADLINE is not set
1814 # CONFIG_IOSCHED_CFQ is not set
15+# CONFIG_MMU is not set
1916 CONFIG_M5249=y
20−CONFIG_CLOCK_SET=y
21−CONFIG_CLOCK_FREQ=140000000
22−CONFIG_CLOCK_DIV=2
2317 CONFIG_M5249C3=y
2418 CONFIG_RAMBASE=0x00000000
2519 CONFIG_RAMSIZE=0x00800000
@@ -38,23 +32,18 @@ CONFIG_INET=y · 12 unmodified lines
3832 # CONFIG_IPV6 is not set
3933 # CONFIG_FW_LOADER is not set
4034 CONFIG_MTD=y
41−CONFIG_MTD_CHAR=y
4235 CONFIG_MTD_BLOCK=y
4336 CONFIG_MTD_RAM=y
4437 CONFIG_MTD_UCLINUX=y
4538 CONFIG_BLK_DEV_RAM=y
46−# CONFIG_MISC_DEVICES is not set
4739 CONFIG_NETDEVICES=y
48−CONFIG_NET_ETHERNET=y
49−# CONFIG_NETDEV_1000 is not set
50−# CONFIG_NETDEV_10000 is not set
5140 CONFIG_PPP=y
5241 # CONFIG_INPUT is not set
5342 # CONFIG_SERIO is not set
5443 # CONFIG_VT is not set
44+# CONFIG_UNIX98_PTYS is not set
5545 CONFIG_SERIAL_MCF=y
5646 CONFIG_SERIAL_MCF_CONSOLE=y
57−# CONFIG_UNIX98_PTYS is not set
5847 # CONFIG_HWMON is not set
5948 # CONFIG_USB_SUPPORT is not set
6049 CONFIG_EXT2_FS=y
@@ -62,7 +51,5 @@ CONFIG_EXT2_FS=y · 1 unmodified line
6251 CONFIG_ROMFS_FS=y
6352 CONFIG_ROMFS_BACKED_BY_MTD=y
6453 # CONFIG_NETWORK_FILESYSTEMS is not set
65−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
6654 CONFIG_BOOTPARAM=y
6755 CONFIG_BOOTPARAM_STRING="root=/dev/mtdblock0"
68−# CONFIG_CRC32 is not set
arch/m68k/configs/m5272c3_defconfig+2−12
@@ -1,10 +1,6 @@
1−# CONFIG_MMU is not set
2−CONFIG_EXPERIMENTAL=y
31 CONFIG_LOG_BUF_SHIFT=14
4−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
52 CONFIG_EXPERT=y
63 # CONFIG_KALLSYMS is not set
7−# CONFIG_HOTPLUG is not set
84 # CONFIG_FUTEX is not set
95 # CONFIG_EPOLL is not set
106 # CONFIG_SIGNALFD is not set
@@ -16,8 +12,8 @@ CONFIG_EXPERT=y · 5 unmodified lines
1612 # CONFIG_BLK_DEV_BSG is not set
1713 # CONFIG_IOSCHED_DEADLINE is not set
1814 # CONFIG_IOSCHED_CFQ is not set
15+# CONFIG_MMU is not set
1916 CONFIG_M5272=y
20−CONFIG_CLOCK_SET=y
2117 CONFIG_M5272C3=y
2218 CONFIG_RAMBASE=0x00000000
2319 CONFIG_RAMSIZE=0x00800000
@@ -36,23 +32,18 @@ CONFIG_INET=y · 12 unmodified lines
3632 # CONFIG_IPV6 is not set
3733 # CONFIG_FW_LOADER is not set
3834 CONFIG_MTD=y
39−CONFIG_MTD_CHAR=y
4035 CONFIG_MTD_BLOCK=y
4136 CONFIG_MTD_RAM=y
4237 CONFIG_MTD_UCLINUX=y
4338 CONFIG_BLK_DEV_RAM=y
44−# CONFIG_MISC_DEVICES is not set
4539 CONFIG_NETDEVICES=y
46−CONFIG_NET_ETHERNET=y
4740 CONFIG_FEC=y
48−# CONFIG_NETDEV_1000 is not set
49−# CONFIG_NETDEV_10000 is not set
5041 # CONFIG_INPUT is not set
5142 # CONFIG_SERIO is not set
5243 # CONFIG_VT is not set
44+# CONFIG_UNIX98_PTYS is not set
5345 CONFIG_SERIAL_MCF=y
5446 CONFIG_SERIAL_MCF_CONSOLE=y
55−# CONFIG_UNIX98_PTYS is not set
5647 # CONFIG_HWMON is not set
5748 # CONFIG_USB_SUPPORT is not set
5849 CONFIG_EXT2_FS=y
@@ -61,6 +52,5 @@ CONFIG_EXT2_FS=y · 2 unmodified lines
6152 CONFIG_ROMFS_FS=y
6253 CONFIG_ROMFS_BACKED_BY_MTD=y
6354 # CONFIG_NETWORK_FILESYSTEMS is not set
64−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
6555 CONFIG_BOOTPARAM=y
6656 CONFIG_BOOTPARAM_STRING="root=/dev/mtdblock0"
arch/m68k/configs/m5275evb_defconfig+2−17
@@ -1,10 +1,6 @@
1−# CONFIG_MMU is not set
2−CONFIG_EXPERIMENTAL=y
31 CONFIG_LOG_BUF_SHIFT=14
4−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
52 CONFIG_EXPERT=y
63 # CONFIG_KALLSYMS is not set
7−# CONFIG_HOTPLUG is not set
84 # CONFIG_FUTEX is not set
95 # CONFIG_EPOLL is not set
106 # CONFIG_SIGNALFD is not set
@@ -16,11 +12,8 @@ CONFIG_EXPERT=y · 5 unmodified lines
1612 # CONFIG_BLK_DEV_BSG is not set
1713 # CONFIG_IOSCHED_DEADLINE is not set
1814 # CONFIG_IOSCHED_CFQ is not set
15+# CONFIG_MMU is not set
1916 CONFIG_M5275=y
20−CONFIG_CLOCK_SET=y
21−CONFIG_CLOCK_FREQ=150000000
22−CONFIG_CLOCK_DIV=2
23−CONFIG_M5275EVB=y
2417 # CONFIG_4KSTACKS is not set
2518 CONFIG_RAMBASE=0x00000000
2619 CONFIG_RAMSIZE=0x00000000
@@ -39,24 +32,19 @@ CONFIG_INET=y · 12 unmodified lines
3932 # CONFIG_IPV6 is not set
4033 # CONFIG_FW_LOADER is not set
4134 CONFIG_MTD=y
42−CONFIG_MTD_CHAR=y
4335 CONFIG_MTD_BLOCK=y
4436 CONFIG_MTD_RAM=y
4537 CONFIG_MTD_UCLINUX=y
4638 CONFIG_BLK_DEV_RAM=y
47−# CONFIG_MISC_DEVICES is not set
4839 CONFIG_NETDEVICES=y
49−CONFIG_NET_ETHERNET=y
5040 CONFIG_FEC=y
51−# CONFIG_NETDEV_1000 is not set
52−# CONFIG_NETDEV_10000 is not set
5341 CONFIG_PPP=y
5442 # CONFIG_INPUT is not set
5543 # CONFIG_SERIO is not set
5644 # CONFIG_VT is not set
45+# CONFIG_UNIX98_PTYS is not set
5746 CONFIG_SERIAL_MCF=y
5847 CONFIG_SERIAL_MCF_CONSOLE=y
59−# CONFIG_UNIX98_PTYS is not set
6048 # CONFIG_HWMON is not set
6149 # CONFIG_USB_SUPPORT is not set
6250 CONFIG_EXT2_FS=y
@@ -65,8 +53,5 @@ CONFIG_EXT2_FS=y · 2 unmodified lines
6553 CONFIG_ROMFS_FS=y
6654 CONFIG_ROMFS_BACKED_BY_MTD=y
6755 # CONFIG_NETWORK_FILESYSTEMS is not set
68−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
69−CONFIG_SYSCTL_SYSCALL_CHECK=y
7056 CONFIG_BOOTPARAM=y
7157 CONFIG_BOOTPARAM_STRING="root=/dev/mtdblock0"
72−# CONFIG_CRC32 is not set
arch/m68k/configs/m5307c3_defconfig+3−18
@@ -1,10 +1,6 @@
1−# CONFIG_MMU is not set
2−CONFIG_EXPERIMENTAL=y
31 CONFIG_LOG_BUF_SHIFT=14
4−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
52 CONFIG_EXPERT=y
63 # CONFIG_KALLSYMS is not set
7−# CONFIG_HOTPLUG is not set
84 # CONFIG_FUTEX is not set
95 # CONFIG_EPOLL is not set
106 # CONFIG_SIGNALFD is not set
@@ -16,10 +12,8 @@ CONFIG_EXPERT=y · 5 unmodified lines
1612 # CONFIG_BLK_DEV_BSG is not set
1713 # CONFIG_IOSCHED_DEADLINE is not set
1814 # CONFIG_IOSCHED_CFQ is not set
15+# CONFIG_MMU is not set
1916 CONFIG_M5307=y
20−CONFIG_CLOCK_SET=y
21−CONFIG_CLOCK_FREQ=90000000
22−CONFIG_CLOCK_DIV=2
2317 CONFIG_M5307C3=y
2418 CONFIG_RAMBASE=0x00000000
2519 CONFIG_RAMSIZE=0x00800000
@@ -38,16 +32,11 @@ CONFIG_INET=y · 12 unmodified lines
3832 # CONFIG_IPV6 is not set
3933 # CONFIG_FW_LOADER is not set
4034 CONFIG_MTD=y
41−CONFIG_MTD_CHAR=y
4235 CONFIG_MTD_BLOCK=y
4336 CONFIG_MTD_RAM=y
4437 CONFIG_MTD_UCLINUX=y
4538 CONFIG_BLK_DEV_RAM=y
46−# CONFIG_MISC_DEVICES is not set
4739 CONFIG_NETDEVICES=y
48−CONFIG_NET_ETHERNET=y
49−# CONFIG_NETDEV_1000 is not set
50−# CONFIG_NETDEV_10000 is not set
5140 CONFIG_PPP=y
5241 CONFIG_SLIP=y
5342 CONFIG_SLIP_COMPRESSED=y
@@ -56,21 +45,17 @@ CONFIG_SLIP_COMPRESSED=y · 2 unmodified lines
5645 # CONFIG_INPUT_MOUSE is not set
5746 # CONFIG_SERIO is not set
5847 # CONFIG_VT is not set
48+# CONFIG_LEGACY_PTYS is not set
5949 CONFIG_SERIAL_MCF=y
6050 CONFIG_SERIAL_MCF_CONSOLE=y
61−# CONFIG_LEGACY_PTYS is not set
6251 # CONFIG_HW_RANDOM is not set
6352 # CONFIG_HWMON is not set
64−# CONFIG_HID_SUPPORT is not set
6553 # CONFIG_USB_SUPPORT is not set
6654 CONFIG_EXT2_FS=y
6755 # CONFIG_DNOTIFY is not set
6856 CONFIG_ROMFS_FS=y
6957 CONFIG_ROMFS_BACKED_BY_MTD=y
7058 # CONFIG_NETWORK_FILESYSTEMS is not set
71−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
72−CONFIG_SYSCTL_SYSCALL_CHECK=y
73−CONFIG_FULLDEBUG=y
7459 CONFIG_BOOTPARAM=y
7560 CONFIG_BOOTPARAM_STRING="root=/dev/mtdblock0"
76−# CONFIG_CRC32 is not set
61+CONFIG_FULLDEBUG=y
arch/m68k/configs/m5407c3_defconfig+2−15
@@ -1,10 +1,6 @@
1−# CONFIG_MMU is not set
2−CONFIG_EXPERIMENTAL=y
31 CONFIG_LOG_BUF_SHIFT=14
4−# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
52 CONFIG_EXPERT=y
63 # CONFIG_KALLSYMS is not set
7−# CONFIG_HOTPLUG is not set
84 # CONFIG_FUTEX is not set
95 # CONFIG_EPOLL is not set
106 # CONFIG_SIGNALFD is not set
@@ -17,9 +13,8 @@ CONFIG_MODULE_UNLOAD=y · 6 unmodified lines
1713 # CONFIG_BLK_DEV_BSG is not set
1814 # CONFIG_IOSCHED_DEADLINE is not set
1915 # CONFIG_IOSCHED_CFQ is not set
16+# CONFIG_MMU is not set
2017 CONFIG_M5407=y
21−CONFIG_CLOCK_SET=y
22−CONFIG_CLOCK_FREQ=50000000
2318 CONFIG_M5407C3=y
2419 CONFIG_RAMBASE=0x00000000
2520 CONFIG_RAMSIZE=0x00000000
@@ -38,22 +33,17 @@ CONFIG_INET=y · 12 unmodified lines
3833 # CONFIG_IPV6 is not set
3934 # CONFIG_FW_LOADER is not set
4035 CONFIG_MTD=y
41−CONFIG_MTD_CHAR=y
4236 CONFIG_MTD_BLOCK=y
4337 CONFIG_MTD_RAM=y
4438 CONFIG_MTD_UCLINUX=y
4539 CONFIG_BLK_DEV_RAM=y
46−# CONFIG_MISC_DEVICES is not set
4740 CONFIG_NETDEVICES=y
48−CONFIG_NET_ETHERNET=y
49−# CONFIG_NETDEV_1000 is not set
50−# CONFIG_NETDEV_10000 is not set
5141 CONFIG_PPP=y
5242 # CONFIG_INPUT is not set
5343 # CONFIG_VT is not set
44+# CONFIG_UNIX98_PTYS is not set
5445 CONFIG_SERIAL_MCF=y
5546 CONFIG_SERIAL_MCF_CONSOLE=y
56−# CONFIG_UNIX98_PTYS is not set
5747 # CONFIG_HW_RANDOM is not set
5848 # CONFIG_HWMON is not set
5949 # CONFIG_USB_SUPPORT is not set
@@ -63,8 +53,5 @@ CONFIG_EXT2_FS=y · 3 unmodified lines
6353 CONFIG_ROMFS_FS=y
6454 CONFIG_ROMFS_BACKED_BY_MTD=y
6555 # CONFIG_NETWORK_FILESYSTEMS is not set
66−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
67−CONFIG_SYSCTL_SYSCALL_CHECK=y
6856 CONFIG_BOOTPARAM=y
6957 CONFIG_BOOTPARAM_STRING="root=/dev/mtdblock0"
70−# CONFIG_CRC32 is not set
arch/m68k/configs/m5475evb_defconfig+1−8
@@ -1,11 +1,7 @@
1−CONFIG_EXPERIMENTAL=y
21 # CONFIG_SWAP is not set
32 CONFIG_LOG_BUF_SHIFT=14
4−CONFIG_SYSFS_DEPRECATED=y
5−CONFIG_SYSFS_DEPRECATED_V2=y
63 CONFIG_SYSCTL_SYSCALL=y
74 # CONFIG_KALLSYMS is not set
8−# CONFIG_HOTPLUG is not set
95 # CONFIG_FUTEX is not set
106 # CONFIG_EPOLL is not set
117 # CONFIG_SIGNALFD is not set
@@ -20,19 +16,16 @@ CONFIG_MODULES=y · 8 unmodified lines
2016 # CONFIG_IOSCHED_DEADLINE is not set
2117 # CONFIG_IOSCHED_CFQ is not set
2218 CONFIG_COLDFIRE=y
23−CONFIG_M547x=y
24−CONFIG_CLOCK_SET=y
25−CONFIG_CLOCK_FREQ=266000000
2619 # CONFIG_4KSTACKS is not set
2720 CONFIG_RAMBASE=0x0
2821 CONFIG_RAMSIZE=0x2000000
2922 CONFIG_VECTORBASE=0x0
3023 CONFIG_MBAR=0xff000000
3124 CONFIG_KERNELBASE=0x20000
25+CONFIG_PCI=y
3226 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
3327 # CONFIG_FW_LOADER is not set
3428 CONFIG_MTD=y
35−CONFIG_MTD_CHAR=y
3629 CONFIG_MTD_BLOCK=y
3730 CONFIG_MTD_CFI=y
3831 CONFIG_MTD_JEDECPROBE=y
arch/m68k/include/asm/Kbuild+1−0
@@ -18,6 +18,7 @@ generic-y += kvm_para.h · 17 unmodified lines
1818 generic-y += local.h
1919 generic-y += local64.h
2020 generic-y += mcs_spinlock.h
21+generic-y += mm-arch-hooks.h
2122 generic-y += mman.h
2223 generic-y += mutex.h
2324 generic-y += percpu.h
arch/m68k/include/asm/coldfire.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 * in any case new boards come along from time to time that have yet
2020 * another different clocking frequency.
2121 */
22−#ifdef CONFIG_CLOCK_SET
22+#ifdef CONFIG_CLOCK_FREQ
2323 #define MCF_CLK CONFIG_CLOCK_FREQ
2424 #else
2525 #error "Don't know what your ColdFire CPU clock frequency is??"
arch/m68k/include/asm/io_mm.h+2−1
@@ -413,7 +413,8 @@ static inline void isa_delay(void) · 412 unmodified lines
413413 #define writew(val, addr) out_le16((addr), (val))
414414 #endif /* CONFIG_ATARI_ROM_ISA */
415415
416−#if !defined(CONFIG_ISA) && !defined(CONFIG_ATARI_ROM_ISA)
416+#if !defined(CONFIG_ISA) && !defined(CONFIG_ATARI_ROM_ISA) && \
417+ !(defined(CONFIG_PCI) && defined(CONFIG_COLDFIRE))
417418 /*
418419 * We need to define dummy functions for GENERIC_IOMAP support.
419420 */
arch/m68k/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_M68K_MM_ARCH_HOOKS_H
13−#define _ASM_M68K_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_M68K_MM_ARCH_HOOKS_H */
arch/metag/include/asm/Kbuild+1−0
@@ -25,6 +25,7 @@ generic-y += kvm_para.h · 24 unmodified lines
2525 generic-y += local.h
2626 generic-y += local64.h
2727 generic-y += mcs_spinlock.h
28+generic-y += mm-arch-hooks.h
2829 generic-y += msgbuf.h
2930 generic-y += mutex.h
3031 generic-y += param.h
arch/metag/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_METAG_MM_ARCH_HOOKS_H
13−#define _ASM_METAG_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_METAG_MM_ARCH_HOOKS_H */
arch/microblaze/include/asm/Kbuild+1−0
@@ -6,6 +6,7 @@ generic-y += device.h · 5 unmodified lines
66 generic-y += exec.h
77 generic-y += irq_work.h
88 generic-y += mcs_spinlock.h
9+generic-y += mm-arch-hooks.h
910 generic-y += preempt.h
1011 generic-y += syscalls.h
1112 generic-y += trace_clock.h
arch/microblaze/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_MICROBLAZE_MM_ARCH_HOOKS_H
13−#define _ASM_MICROBLAZE_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_MICROBLAZE_MM_ARCH_HOOKS_H */
arch/mips/Kconfig+1−5
@@ -1427,6 +1427,7 @@ config CPU_MIPS64_R6 · 1426 unmodified lines
14271427 select CPU_SUPPORTS_HIGHMEM
14281428 select CPU_SUPPORTS_MSA
14291429 select GENERIC_CSUM
1430+ select MIPS_O32_FP64_SUPPORT if MIPS32_O32
14301431 help
14311432 Choose this option to build a kernel for release 6 or later of the
14321433 MIPS64 architecture. New MIPS processors, starting with the Warrior
@@ -2262,11 +2263,6 @@ config MIPS_CM · 829 unmodified lines
22622263 config MIPS_CPC
22632264 bool
22642265
2265−config SB1_PASS_1_WORKAROUNDS
2266− bool
2267− depends on CPU_SB1_PASS_1
2268− default y
2269−
22702266 config SB1_PASS_2_WORKAROUNDS
22712267 bool
22722268 depends on CPU_SB1 && (CPU_SB1_PASS_2_2 || CPU_SB1_PASS_2)
arch/mips/Makefile+0−7
@@ -181,13 +181,6 @@ cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,) · 180 unmodified lines
181181 cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,)
182182 cflags-$(CONFIG_CPU_DADDI_WORKAROUNDS) += $(call cc-option,-mno-daddi,)
183183
184−ifdef CONFIG_CPU_SB1
185−ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
186−KBUILD_AFLAGS_MODULE += -msb1-pass1-workarounds
187−KBUILD_CFLAGS_MODULE += -msb1-pass1-workarounds
188−endif
189−endif
190−
191184 # For smartmips configurations, there are hundreds of warnings due to ISA overrides
192185 # in assembly and header files. smartmips is only supported for MIPS32r1 onwards
193186 # and there is no support for 64-bit. Various '.set mips2' or '.set mips3' or
arch/mips/include/asm/Kbuild+1−0
@@ -7,6 +7,7 @@ generic-y += emergency-restart.h · 6 unmodified lines
77 generic-y += irq_work.h
88 generic-y += local64.h
99 generic-y += mcs_spinlock.h
10+generic-y += mm-arch-hooks.h
1011 generic-y += mutex.h
1112 generic-y += parport.h
1213 generic-y += percpu.h
arch/mips/include/asm/fpu.h+1−1
@@ -74,7 +74,7 @@ static inline int __enable_fpu(enum fpu_mode mode) · 73 unmodified lines
7474 goto fr_common;
7575
7676 case FPU_64BIT:
77−#if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS32_R6) \
77+#if !(defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) \
7878 || defined(CONFIG_64BIT))
7979 /* we only have a 32-bit FPU */
8080 return SIGFPE;
arch/mips/include/asm/mach-sibyte/war.h+1−2
@@ -13,8 +13,7 @@ · 12 unmodified lines
1313 #define R4600_V2_HIT_CACHEOP_WAR 0
1414 #define R5432_CP0_INTERRUPT_WAR 0
1515
16−#if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || \
17− defined(CONFIG_SB1_PASS_2_WORKAROUNDS)
16+#if defined(CONFIG_SB1_PASS_2_WORKAROUNDS)
1817
1918 #ifndef __ASSEMBLY__
2019 extern int sb1250_m3_workaround_needed(void);
arch/mips/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_MIPS_MM_ARCH_HOOKS_H
13−#define _ASM_MIPS_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_MIPS_MM_ARCH_HOOKS_H */
arch/mips/include/uapi/asm/sigcontext.h+2−2
@@ -16,7 +16,7 @@ · 15 unmodified lines
1616
1717 /*
1818 * Keep this struct definition in sync with the sigcontext fragment
19− * in arch/mips/tools/offset.c
19+ * in arch/mips/kernel/asm-offsets.c
2020 */
2121 struct sigcontext {
2222 unsigned int sc_regmask; /* Unused */
@@ -46,7 +46,7 @@ struct sigcontext { · 23 unmodified lines
4646 #include <linux/posix_types.h>
4747 /*
4848 * Keep this struct definition in sync with the sigcontext fragment
49− * in arch/mips/tools/offset.c
49+ * in arch/mips/kernel/asm-offsets.c
5050 *
5151 * Warning: this structure illdefined with sc_badvaddr being just an unsigned
5252 * int so it was changed to unsigned long in 2.6.0-test1. This may break
arch/mips/kernel/asm-offsets.c+1−1
@@ -1,5 +1,5 @@
11 /*
2− * offset.c: Calculate pt_regs and task_struct offsets.
2+ * asm-offsets.c: Calculate pt_regs and task_struct offsets.
33 *
44 * Copyright (C) 1996 David S. Miller
55 * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle
arch/mips/sibyte/Kconfig+0−5
@@ -81,11 +81,6 @@ choice · 80 unmodified lines
8181 prompt "SiByte SOC Stepping"
8282 depends on SIBYTE_SB1xxx_SOC
8383
84−config CPU_SB1_PASS_1
85− bool "1250 Pass1"
86− depends on SIBYTE_SB1250
87− select CPU_HAS_PREFETCH
88−
8984 config CPU_SB1_PASS_2_1250
9085 bool "1250 An"
9186 depends on SIBYTE_SB1250
arch/mips/sibyte/common/bus_watcher.c+1−4
@@ -81,10 +81,7 @@ void check_bus_watcher(void) · 80 unmodified lines
8181 {
8282 u32 status, l2_err, memio_err;
8383
84−#ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
85− /* Destructive read, clears register and interrupt */
86− status = csr_in32(IOADDR(A_SCD_BUS_ERR_STATUS));
87−#elif defined(CONFIG_SIBYTE_BCM112X) || defined(CONFIG_SIBYTE_SB1250)
84+#if defined(CONFIG_SIBYTE_BCM112X) || defined(CONFIG_SIBYTE_SB1250)
8885 /* Use non-destructive register */
8986 status = csr_in32(IOADDR(A_SCD_BUS_ERR_STATUS_DEBUG));
9087 #elif defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
arch/mips/sibyte/sb1250/setup.c+0−2
@@ -202,12 +202,10 @@ void __init sb1250_setup(void) · 201 unmodified lines
202202
203203 switch (war_pass) {
204204 case K_SYS_REVISION_BCM1250_PASS1:
205−#ifndef CONFIG_SB1_PASS_1_WORKAROUNDS
206205 printk("@@@@ This is a BCM1250 A0-A2 (Pass 1) board, "
207206 "and the kernel doesn't have the proper "
208207 "workarounds compiled in. @@@@\n");
209208 bad_config = 1;
210−#endif
211209 break;
212210 case K_SYS_REVISION_BCM1250_PASS2:
213211 /* Pass 2 - easiest as default for now - so many numbers */
arch/mn10300/include/asm/Kbuild+1−0
@@ -5,6 +5,7 @@ generic-y += cputime.h · 4 unmodified lines
55 generic-y += exec.h
66 generic-y += irq_work.h
77 generic-y += mcs_spinlock.h
8+generic-y += mm-arch-hooks.h
89 generic-y += preempt.h
910 generic-y += sections.h
1011 generic-y += trace_clock.h
arch/mn10300/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_MN10300_MM_ARCH_HOOKS_H
13−#define _ASM_MN10300_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_MN10300_MM_ARCH_HOOKS_H */
arch/nios2/include/asm/Kbuild+1−0
@@ -30,6 +30,7 @@ generic-y += kmap_types.h · 29 unmodified lines
3030 generic-y += kvm_para.h
3131 generic-y += local.h
3232 generic-y += mcs_spinlock.h
33+generic-y += mm-arch-hooks.h
3334 generic-y += mman.h
3435 generic-y += module.h
3536 generic-y += msgbuf.h
arch/nios2/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_NIOS2_MM_ARCH_HOOKS_H
13−#define _ASM_NIOS2_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_NIOS2_MM_ARCH_HOOKS_H */
arch/openrisc/Kconfig+1−3
@@ -17,6 +17,7 @@ config OPENRISC · 16 unmodified lines
1717 select GENERIC_IRQ_SHOW
1818 select GENERIC_IOMAP
1919 select GENERIC_CPU_DEVICES
20+ select HAVE_UID16
2021 select GENERIC_ATOMIC64
2122 select GENERIC_CLOCKEVENTS
2223 select GENERIC_STRNCPY_FROM_USER
@@ -31,9 +32,6 @@ config MMU · 8 unmodified lines
3132 config HAVE_DMA_ATTRS
3233 def_bool y
3334
34−config UID16
35− def_bool y
36−
3735 config RWSEM_GENERIC_SPINLOCK
3836 def_bool y
3937
arch/openrisc/include/asm/Kbuild+1−0
@@ -36,6 +36,7 @@ generic-y += kmap_types.h · 35 unmodified lines
3636 generic-y += kvm_para.h
3737 generic-y += local.h
3838 generic-y += mcs_spinlock.h
39+generic-y += mm-arch-hooks.h
3940 generic-y += mman.h
4041 generic-y += module.h
4142 generic-y += msgbuf.h
arch/openrisc/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_OPENRISC_MM_ARCH_HOOKS_H
13−#define _ASM_OPENRISC_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_OPENRISC_MM_ARCH_HOOKS_H */
arch/parisc/include/asm/Kbuild+1−0
@@ -15,6 +15,7 @@ generic-y += kvm_para.h · 14 unmodified lines
1515 generic-y += local.h
1616 generic-y += local64.h
1717 generic-y += mcs_spinlock.h
18+generic-y += mm-arch-hooks.h
1819 generic-y += mutex.h
1920 generic-y += param.h
2021 generic-y += percpu.h
arch/parisc/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_PARISC_MM_ARCH_HOOKS_H
13−#define _ASM_PARISC_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_PARISC_MM_ARCH_HOOKS_H */
arch/parisc/include/asm/pgalloc.h+2−1
@@ -72,7 +72,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) · 71 unmodified lines
7272
7373 static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
7474 {
75− if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
75+ if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED) {
7676 /*
7777 * This is the permanent pmd attached to the pgd;
7878 * cannot free it.
@@ -81,6 +81,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) · 2 unmodified lines
8181 */
8282 mm_inc_nr_pmds(mm);
8383 return;
84+ }
8485 free_pages((unsigned long)pmd, PMD_ORDER);
8586 }
8687
arch/s390/include/asm/Kbuild+1−0
@@ -3,5 +3,6 @@ · 2 unmodified lines
33 generic-y += clkdev.h
44 generic-y += irq_work.h
55 generic-y += mcs_spinlock.h
6+generic-y += mm-arch-hooks.h
67 generic-y += preempt.h
78 generic-y += trace_clock.h
arch/s390/include/asm/ctl_reg.h+4−1
@@ -57,7 +57,10 @@ union ctlreg0 { · 56 unmodified lines
5757 unsigned long lap : 1; /* Low-address-protection control */
5858 unsigned long : 4;
5959 unsigned long edat : 1; /* Enhanced-DAT-enablement control */
60− unsigned long : 23;
60+ unsigned long : 4;
61+ unsigned long afp : 1; /* AFP-register control */
62+ unsigned long vx : 1; /* Vector enablement control */
63+ unsigned long : 17;
6164 };
6265 };
6366
arch/s390/include/asm/hugetlb.h+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414
1515 #define is_hugepage_only_range(mm, addr, len) 0
1616 #define hugetlb_free_pgd_range free_pgd_range
17+#define hugepages_supported() (MACHINE_HAS_HPAGE)
1718
1819 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
1920 pte_t *ptep, pte_t pte);
arch/s390/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_S390_MM_ARCH_HOOKS_H
13−#define _ASM_S390_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_S390_MM_ARCH_HOOKS_H */
arch/s390/include/asm/page.h+4−4
@@ -17,10 +17,7 @@ · 16 unmodified lines
1717 #define PAGE_DEFAULT_ACC 0
1818 #define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
1919
20−#include <asm/setup.h>
21−#ifndef __ASSEMBLY__
22−
23−extern int HPAGE_SHIFT;
20+#define HPAGE_SHIFT 20
2421 #define HPAGE_SIZE (1UL << HPAGE_SHIFT)
2522 #define HPAGE_MASK (~(HPAGE_SIZE - 1))
2623 #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
@@ -30,6 +27,9 @@ extern int HPAGE_SHIFT; · 3 unmodified lines
3027 #define ARCH_HAS_PREPARE_HUGEPAGE
3128 #define ARCH_HAS_HUGEPAGE_CLEAR_FLUSH
3229
30+#include <asm/setup.h>
31+#ifndef __ASSEMBLY__
32+
3333 static inline void storage_key_init_range(unsigned long start, unsigned long end)
3434 {
3535 #if PAGE_DEFAULT_KEY
arch/s390/include/asm/perf_event.h+8−0
@@ -87,7 +87,15 @@ struct sf_raw_sample { · 86 unmodified lines
8787 } __packed;
8888
8989 /* Perf hardware reserve and release functions */
90+#ifdef CONFIG_PERF_EVENTS
9091 int perf_reserve_sampling(void);
9192 void perf_release_sampling(void);
93+#else /* CONFIG_PERF_EVENTS */
94+static inline int perf_reserve_sampling(void)
95+{
96+ return 0;
97+}
98+static inline void perf_release_sampling(void) {}
99+#endif /* CONFIG_PERF_EVENTS */
92100
93101 #endif /* _ASM_S390_PERF_EVENT_H */
arch/s390/kernel/asm-offsets.c+7−8
@@ -23,15 +23,15 @@ · 22 unmodified lines
2323
2424 int main(void)
2525 {
26− DEFINE(__THREAD_info, offsetof(struct task_struct, stack));
27− DEFINE(__THREAD_ksp, offsetof(struct task_struct, thread.ksp));
28− DEFINE(__THREAD_mm_segment, offsetof(struct task_struct, thread.mm_segment));
29− BLANK();
26+ DEFINE(__TASK_thread_info, offsetof(struct task_struct, stack));
27+ DEFINE(__TASK_thread, offsetof(struct task_struct, thread));
3028 DEFINE(__TASK_pid, offsetof(struct task_struct, pid));
3129 BLANK();
32− DEFINE(__THREAD_per_cause, offsetof(struct task_struct, thread.per_event.cause));
33− DEFINE(__THREAD_per_address, offsetof(struct task_struct, thread.per_event.address));
34− DEFINE(__THREAD_per_paid, offsetof(struct task_struct, thread.per_event.paid));
30+ DEFINE(__THREAD_ksp, offsetof(struct thread_struct, ksp));
31+ DEFINE(__THREAD_per_cause, offsetof(struct thread_struct, per_event.cause));
32+ DEFINE(__THREAD_per_address, offsetof(struct thread_struct, per_event.address));
33+ DEFINE(__THREAD_per_paid, offsetof(struct thread_struct, per_event.paid));
34+ DEFINE(__THREAD_trap_tdb, offsetof(struct thread_struct, trap_tdb));
3535 BLANK();
3636 DEFINE(__TI_task, offsetof(struct thread_info, task));
3737 DEFINE(__TI_flags, offsetof(struct thread_info, flags));
@@ -176,7 +176,6 @@ int main(void) · 138 unmodified lines
176176 DEFINE(__LC_VDSO_PER_CPU, offsetof(struct _lowcore, vdso_per_cpu_data));
177177 DEFINE(__LC_GMAP, offsetof(struct _lowcore, gmap));
178178 DEFINE(__LC_PGM_TDB, offsetof(struct _lowcore, pgm_tdb));
179− DEFINE(__THREAD_trap_tdb, offsetof(struct task_struct, thread.trap_tdb));
180179 DEFINE(__GMAP_ASCE, offsetof(struct gmap, asce));
181180 DEFINE(__SIE_PROG0C, offsetof(struct kvm_s390_sie_block, prog0c));
182181 DEFINE(__SIE_PROG20, offsetof(struct kvm_s390_sie_block, prog20));
arch/s390/kernel/entry.S+9−4
@@ -178,17 +178,21 @@ _PIF_WORK = (_PIF_PER_TRAP) · 177 unmodified lines
178178 */
179179 ENTRY(__switch_to)
180180 stmg %r6,%r15,__SF_GPRS(%r15) # store gprs of prev task
181− stg %r15,__THREAD_ksp(%r2) # store kernel stack of prev
182− lg %r4,__THREAD_info(%r2) # get thread_info of prev
183− lg %r5,__THREAD_info(%r3) # get thread_info of next
181+ lgr %r1,%r2
182+ aghi %r1,__TASK_thread # thread_struct of prev task
183+ lg %r4,__TASK_thread_info(%r2) # get thread_info of prev
184+ lg %r5,__TASK_thread_info(%r3) # get thread_info of next
185+ stg %r15,__THREAD_ksp(%r1) # store kernel stack of prev
186+ lgr %r1,%r3
187+ aghi %r1,__TASK_thread # thread_struct of next task
184188 lgr %r15,%r5
185189 aghi %r15,STACK_INIT # end of kernel stack of next
186190 stg %r3,__LC_CURRENT # store task struct of next
187191 stg %r5,__LC_THREAD_INFO # store thread info of next
188192 stg %r15,__LC_KERNEL_STACK # store end of kernel stack
193+ lg %r15,__THREAD_ksp(%r1) # load kernel stack of next
189194 lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4
190195 mvc __LC_CURRENT_PID+4(4,%r0),__TASK_pid(%r3) # store pid of next
191− lg %r15,__THREAD_ksp(%r3) # load kernel stack of next
192196 lmg %r6,%r15,__SF_GPRS(%r15) # load gprs of next task
193197 br %r14
194198
@@ -417,6 +421,7 @@ ENTRY(pgm_check_handler) · 222 unmodified lines
417421 LAST_BREAK %r14
418422 lg %r15,__LC_KERNEL_STACK
419423 lg %r14,__TI_task(%r12)
424+ aghi %r14,__TASK_thread # pointer to thread_struct
420425 lghi %r13,__LC_PGM_TDB
421426 tm __LC_PGM_ILC+2,0x02 # check for transaction abort
422427 jz 2f
arch/s390/kernel/nmi.c+30−21
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <asm/nmi.h>
2222 #include <asm/crw.h>
2323 #include <asm/switch_to.h>
24+#include <asm/ctl_reg.h>
2425
2526 struct mcck_struct {
2627 int kill_task;
@@ -129,26 +130,30 @@ static int notrace s390_revalidate_registers(struct mci *mci) · 102 unmodified lines
129130 } else
130131 asm volatile("lfpc 0(%0)" : : "a" (fpt_creg_save_area));
131132
132− asm volatile(
133− " ld 0,0(%0)\n"
134− " ld 1,8(%0)\n"
135− " ld 2,16(%0)\n"
136− " ld 3,24(%0)\n"
137− " ld 4,32(%0)\n"
138− " ld 5,40(%0)\n"
139− " ld 6,48(%0)\n"
140− " ld 7,56(%0)\n"
141− " ld 8,64(%0)\n"
142− " ld 9,72(%0)\n"
143− " ld 10,80(%0)\n"
144− " ld 11,88(%0)\n"
145− " ld 12,96(%0)\n"
146− " ld 13,104(%0)\n"
147− " ld 14,112(%0)\n"
148− " ld 15,120(%0)\n"
149− : : "a" (fpt_save_area));
150− /* Revalidate vector registers */
151− if (MACHINE_HAS_VX && current->thread.vxrs) {
133+ if (!MACHINE_HAS_VX) {
134+ /* Revalidate floating point registers */
135+ asm volatile(
136+ " ld 0,0(%0)\n"
137+ " ld 1,8(%0)\n"
138+ " ld 2,16(%0)\n"
139+ " ld 3,24(%0)\n"
140+ " ld 4,32(%0)\n"
141+ " ld 5,40(%0)\n"
142+ " ld 6,48(%0)\n"
143+ " ld 7,56(%0)\n"
144+ " ld 8,64(%0)\n"
145+ " ld 9,72(%0)\n"
146+ " ld 10,80(%0)\n"
147+ " ld 11,88(%0)\n"
148+ " ld 12,96(%0)\n"
149+ " ld 13,104(%0)\n"
150+ " ld 14,112(%0)\n"
151+ " ld 15,120(%0)\n"
152+ : : "a" (fpt_save_area));
153+ } else {
154+ /* Revalidate vector registers */
155+ union ctlreg0 cr0;
156+
152157 if (!mci->vr) {
153158 /*
154159 * Vector registers can't be restored and therefore
@@ -156,8 +161,12 @@ static int notrace s390_revalidate_registers(struct mci *mci) · 1 unmodified line
156161 */
157162 kill_task = 1;
158163 }
164+ cr0.val = S390_lowcore.cregs_save_area[0];
165+ cr0.afp = cr0.vx = 1;
166+ __ctl_load(cr0.val, 0, 0);
159167 restore_vx_regs((__vector128 *)
160− S390_lowcore.vector_save_area_addr);
168+ &S390_lowcore.vector_save_area);
169+ __ctl_load(S390_lowcore.cregs_save_area[0], 0, 0);
161170 }
162171 /* Revalidate access registers */
163172 asm volatile(
arch/s390/kernel/process.c+1−1
@@ -163,7 +163,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp, · 162 unmodified lines
163163 asmlinkage void execve_tail(void)
164164 {
165165 current->thread.fp_regs.fpc = 0;
166− asm volatile("sfpc %0,%0" : : "d" (0));
166+ asm volatile("sfpc %0" : : "d" (0));
167167 }
168168
169169 /*
arch/s390/kernel/sclp.S+4−0
@@ -270,6 +270,8 @@ ENTRY(_sclp_print_early) · 269 unmodified lines
270270 jno .Lesa2
271271 ahi %r15,-80
272272 stmh %r6,%r15,96(%r15) # store upper register halves
273+ basr %r13,0
274+ lmh %r0,%r15,.Lzeroes-.(%r13) # clear upper register halves
273275 .Lesa2:
274276 lr %r10,%r2 # save string pointer
275277 lhi %r2,0
@@ -291,6 +293,8 @@ ENTRY(_sclp_print_early) · 15 unmodified lines
291293 .Lesa3:
292294 lm %r6,%r15,120(%r15) # restore registers
293295 br %r14
296+.Lzeroes:
297+ .fill 64,4,0
294298
295299 .LwritedataS4:
296300 .long 0x00760005 # SCLP command for write data
arch/s390/kernel/setup.c+0−2
@@ -885,8 +885,6 @@ void __init setup_arch(char **cmdline_p) · 884 unmodified lines
885885 */
886886 setup_hwcaps();
887887
888− HPAGE_SHIFT = MACHINE_HAS_HPAGE ? 20 : 0;
889−
890888 /*
891889 * Create kernel page tables and switch to virtual addressing.
892890 */
arch/s390/kernel/traps.c+2−2
@@ -259,7 +259,7 @@ void vector_exception(struct pt_regs *regs) · 258 unmodified lines
259259 }
260260
261261 /* get vector interrupt code from fpc */
262− asm volatile("stfpc %0" : "=m" (current->thread.fp_regs.fpc));
262+ asm volatile("stfpc %0" : "=Q" (current->thread.fp_regs.fpc));
263263 vic = (current->thread.fp_regs.fpc & 0xf00) >> 8;
264264 switch (vic) {
265265 case 1: /* invalid vector operation */
@@ -297,7 +297,7 @@ void data_exception(struct pt_regs *regs) · 31 unmodified lines
297297
298298 location = get_trap_ip(regs);
299299
300− asm volatile("stfpc %0" : "=m" (current->thread.fp_regs.fpc));
300+ asm volatile("stfpc %0" : "=Q" (current->thread.fp_regs.fpc));
301301 /* Check for vector register enablement */
302302 if (MACHINE_HAS_VX && !current->thread.vxrs &&
303303 (current->thread.fp_regs.fpc & FPC_DXC_MASK) == 0xfe00) {
arch/s390/mm/pgtable.c+0−2
@@ -31,8 +31,6 @@ · 30 unmodified lines
3131 #define ALLOC_ORDER 2
3232 #define FRAG_MASK 0x03
3333
34−int HPAGE_SHIFT;
35−
3634 unsigned long *crst_table_alloc(struct mm_struct *mm)
3735 {
3836 struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
arch/s390/oprofile/init.c+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/fs.h>
1717 #include <linux/module.h>
1818 #include <asm/processor.h>
19+#include <asm/perf_event.h>
1920
2021 #include "../../../drivers/oprofile/oprof.h"
2122
arch/score/include/asm/Kbuild+1−0
@@ -7,6 +7,7 @@ generic-y += clkdev.h · 6 unmodified lines
77 generic-y += cputime.h
88 generic-y += irq_work.h
99 generic-y += mcs_spinlock.h
10+generic-y += mm-arch-hooks.h
1011 generic-y += preempt.h
1112 generic-y += sections.h
1213 generic-y += trace_clock.h
arch/score/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_SCORE_MM_ARCH_HOOKS_H
13−#define _ASM_SCORE_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_SCORE_MM_ARCH_HOOKS_H */
arch/sh/include/asm/Kbuild+1−0
@@ -16,6 +16,7 @@ generic-y += kvm_para.h · 15 unmodified lines
1616 generic-y += local.h
1717 generic-y += local64.h
1818 generic-y += mcs_spinlock.h
19+generic-y += mm-arch-hooks.h
1920 generic-y += mman.h
2021 generic-y += msgbuf.h
2122 generic-y += param.h
arch/sh/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_SH_MM_ARCH_HOOKS_H
13−#define _ASM_SH_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_SH_MM_ARCH_HOOKS_H */
arch/sparc/include/asm/Kbuild+1−0
@@ -12,6 +12,7 @@ generic-y += linkage.h · 11 unmodified lines
1212 generic-y += local.h
1313 generic-y += local64.h
1414 generic-y += mcs_spinlock.h
15+generic-y += mm-arch-hooks.h
1516 generic-y += module.h
1617 generic-y += mutex.h
1718 generic-y += preempt.h
arch/sparc/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_SPARC_MM_ARCH_HOOKS_H
13−#define _ASM_SPARC_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_SPARC_MM_ARCH_HOOKS_H */
arch/tile/include/asm/Kbuild+1−0
@@ -19,6 +19,7 @@ generic-y += irq_regs.h · 18 unmodified lines
1919 generic-y += local.h
2020 generic-y += local64.h
2121 generic-y += mcs_spinlock.h
22+generic-y += mm-arch-hooks.h
2223 generic-y += msgbuf.h
2324 generic-y += mutex.h
2425 generic-y += param.h
arch/tile/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_TILE_MM_ARCH_HOOKS_H
13−#define _ASM_TILE_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_TILE_MM_ARCH_HOOKS_H */
arch/um/include/asm/Kbuild+1−0
@@ -16,6 +16,7 @@ generic-y += irq_regs.h · 15 unmodified lines
1616 generic-y += irq_work.h
1717 generic-y += kdebug.h
1818 generic-y += mcs_spinlock.h
19+generic-y += mm-arch-hooks.h
1920 generic-y += mutex.h
2021 generic-y += param.h
2122 generic-y += pci.h
arch/um/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_UM_MM_ARCH_HOOKS_H
13−#define _ASM_UM_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_UM_MM_ARCH_HOOKS_H */
arch/unicore32/include/asm/Kbuild+1−0
@@ -26,6 +26,7 @@ generic-y += kdebug.h · 25 unmodified lines
2626 generic-y += kmap_types.h
2727 generic-y += local.h
2828 generic-y += mcs_spinlock.h
29+generic-y += mm-arch-hooks.h
2930 generic-y += mman.h
3031 generic-y += module.h
3132 generic-y += msgbuf.h
arch/unicore32/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_UNICORE32_MM_ARCH_HOOKS_H
13−#define _ASM_UNICORE32_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_UNICORE32_MM_ARCH_HOOKS_H */
arch/x86/Kconfig+1−0
@@ -41,6 +41,7 @@ config X86 · 40 unmodified lines
4141 select ARCH_USE_CMPXCHG_LOCKREF if X86_64
4242 select ARCH_USE_QUEUED_RWLOCKS
4343 select ARCH_USE_QUEUED_SPINLOCKS
44+ select ARCH_WANTS_DYNAMIC_TASK_STRUCT
4445 select ARCH_WANT_FRAME_POINTERS
4546 select ARCH_WANT_IPC_PARSE_VERSION if X86_32
4647 select ARCH_WANT_OPTIONAL_GPIOLIB
arch/x86/Kconfig.debug+12−0
@@ -297,6 +297,18 @@ config OPTIMIZE_INLINING · 296 unmodified lines
297297
298298 If unsure, say N.
299299
300+config DEBUG_ENTRY
301+ bool "Debug low-level entry code"
302+ depends on DEBUG_KERNEL
303+ ---help---
304+ This option enables sanity checks in x86's low-level entry code.
305+ Some of these sanity checks may slow down kernel entries and
306+ exits or otherwise impact performance.
307+
308+ This is currently used to help test NMI code.
309+
310+ If unsure, say N.
311+
300312 config DEBUG_NMI_SELFTEST
301313 bool "NMI Selftest"
302314 depends on DEBUG_KERNEL && X86_LOCAL_APIC
arch/x86/entry/entry_64.S+199−100
@@ -1237,11 +1237,12 @@ ENTRY(nmi) · 1236 unmodified lines
12371237 * If the variable is not set and the stack is not the NMI
12381238 * stack then:
12391239 * o Set the special variable on the stack
1240− * o Copy the interrupt frame into a "saved" location on the stack
1241− * o Copy the interrupt frame into a "copy" location on the stack
1240+ * o Copy the interrupt frame into an "outermost" location on the
1241+ * stack
1242+ * o Copy the interrupt frame into an "iret" location on the stack
12421243 * o Continue processing the NMI
12431244 * If the variable is set or the previous stack is the NMI stack:
1244− * o Modify the "copy" location to jump to the repeate_nmi
1245+ * o Modify the "iret" location to jump to the repeat_nmi
12451246 * o return back to the first NMI
12461247 *
12471248 * Now on exit of the first NMI, we first clear the stack variable
@@ -1250,31 +1251,151 @@ ENTRY(nmi) · 2 unmodified lines
12501251 * a nested NMI that updated the copy interrupt stack frame, a
12511252 * jump will be made to the repeat_nmi code that will handle the second
12521253 * NMI.
1254+ *
1255+ * However, espfix prevents us from directly returning to userspace
1256+ * with a single IRET instruction. Similarly, IRET to user mode
1257+ * can fault. We therefore handle NMIs from user space like
1258+ * other IST entries.
12531259 */
12541260
12551261 /* Use %rdx as our temp variable throughout */
12561262 pushq %rdx
12571263
1264+ testb $3, CS-RIP+8(%rsp)
1265+ jz .Lnmi_from_kernel
1266+
1267+ /*
1268+ * NMI from user mode. We need to run on the thread stack, but we
1269+ * can't go through the normal entry paths: NMIs are masked, and
1270+ * we don't want to enable interrupts, because then we'll end
1271+ * up in an awkward situation in which IRQs are on but NMIs
1272+ * are off.
1273+ */
1274+
1275+ SWAPGS
1276+ cld
1277+ movq %rsp, %rdx
1278+ movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
1279+ pushq 5*8(%rdx) /* pt_regs->ss */
1280+ pushq 4*8(%rdx) /* pt_regs->rsp */
1281+ pushq 3*8(%rdx) /* pt_regs->flags */
1282+ pushq 2*8(%rdx) /* pt_regs->cs */
1283+ pushq 1*8(%rdx) /* pt_regs->rip */
1284+ pushq $-1 /* pt_regs->orig_ax */
1285+ pushq %rdi /* pt_regs->di */
1286+ pushq %rsi /* pt_regs->si */
1287+ pushq (%rdx) /* pt_regs->dx */
1288+ pushq %rcx /* pt_regs->cx */
1289+ pushq %rax /* pt_regs->ax */
1290+ pushq %r8 /* pt_regs->r8 */
1291+ pushq %r9 /* pt_regs->r9 */
1292+ pushq %r10 /* pt_regs->r10 */
1293+ pushq %r11 /* pt_regs->r11 */
1294+ pushq %rbx /* pt_regs->rbx */
1295+ pushq %rbp /* pt_regs->rbp */
1296+ pushq %r12 /* pt_regs->r12 */
1297+ pushq %r13 /* pt_regs->r13 */
1298+ pushq %r14 /* pt_regs->r14 */
1299+ pushq %r15 /* pt_regs->r15 */
1300+
1301+ /*
1302+ * At this point we no longer need to worry about stack damage
1303+ * due to nesting -- we're on the normal thread stack and we're
1304+ * done with the NMI stack.
1305+ */
1306+
1307+ movq %rsp, %rdi
1308+ movq $-1, %rsi
1309+ call do_nmi
1310+
1311+ /*
1312+ * Return back to user mode. We must *not* do the normal exit
1313+ * work, because we don't want to enable interrupts. Fortunately,
1314+ * do_nmi doesn't modify pt_regs.
1315+ */
1316+ SWAPGS
1317+ jmp restore_c_regs_and_iret
1318+
1319+.Lnmi_from_kernel:
1320+ /*
1321+ * Here's what our stack frame will look like:
1322+ * +---------------------------------------------------------+
1323+ * | original SS |
1324+ * | original Return RSP |
1325+ * | original RFLAGS |
1326+ * | original CS |
1327+ * | original RIP |
1328+ * +---------------------------------------------------------+
1329+ * | temp storage for rdx |
1330+ * +---------------------------------------------------------+
1331+ * | "NMI executing" variable |
1332+ * +---------------------------------------------------------+
1333+ * | iret SS } Copied from "outermost" frame |
1334+ * | iret Return RSP } on each loop iteration; overwritten |
1335+ * | iret RFLAGS } by a nested NMI to force another |
1336+ * | iret CS } iteration if needed. |
1337+ * | iret RIP } |
1338+ * +---------------------------------------------------------+
1339+ * | outermost SS } initialized in first_nmi; |
1340+ * | outermost Return RSP } will not be changed before |
1341+ * | outermost RFLAGS } NMI processing is done. |
1342+ * | outermost CS } Copied to "iret" frame on each |
1343+ * | outermost RIP } iteration. |
1344+ * +---------------------------------------------------------+
1345+ * | pt_regs |
1346+ * +---------------------------------------------------------+
1347+ *
1348+ * The "original" frame is used by hardware. Before re-enabling
1349+ * NMIs, we need to be done with it, and we need to leave enough
1350+ * space for the asm code here.
1351+ *
1352+ * We return by executing IRET while RSP points to the "iret" frame.
1353+ * That will either return for real or it will loop back into NMI
1354+ * processing.
1355+ *
1356+ * The "outermost" frame is copied to the "iret" frame on each
1357+ * iteration of the loop, so each iteration starts with the "iret"
1358+ * frame pointing to the final return target.
1359+ */
1360+
12581361 /*
1259− * If %cs was not the kernel segment, then the NMI triggered in user
1260− * space, which means it is definitely not nested.
1362+ * Determine whether we're a nested NMI.
1363+ *
1364+ * If we interrupted kernel code between repeat_nmi and
1365+ * end_repeat_nmi, then we are a nested NMI. We must not
1366+ * modify the "iret" frame because it's being written by
1367+ * the outer NMI. That's okay; the outer NMI handler is
1368+ * about to about to call do_nmi anyway, so we can just
1369+ * resume the outer NMI.
12611370 */
1262− cmpl $__KERNEL_CS, 16(%rsp)
1263− jne first_nmi
1371+
1372+ movq $repeat_nmi, %rdx
1373+ cmpq 8(%rsp), %rdx
1374+ ja 1f
1375+ movq $end_repeat_nmi, %rdx
1376+ cmpq 8(%rsp), %rdx
1377+ ja nested_nmi_out
1378+1:
12641379
12651380 /*
1266− * Check the special variable on the stack to see if NMIs are
1267− * executing.
1381+ * Now check "NMI executing". If it's set, then we're nested.
1382+ * This will not detect if we interrupted an outer NMI just
1383+ * before IRET.
12681384 */
12691385 cmpl $1, -8(%rsp)
12701386 je nested_nmi
12711387
12721388 /*
1273− * Now test if the previous stack was an NMI stack.
1274− * We need the double check. We check the NMI stack to satisfy the
1275− * race when the first NMI clears the variable before returning.
1276− * We check the variable because the first NMI could be in a
1277− * breakpoint routine using a breakpoint stack.
1389+ * Now test if the previous stack was an NMI stack. This covers
1390+ * the case where we interrupt an outer NMI after it clears
1391+ * "NMI executing" but before IRET. We need to be careful, though:
1392+ * there is one case in which RSP could point to the NMI stack
1393+ * despite there being no NMI active: naughty userspace controls
1394+ * RSP at the very beginning of the SYSCALL targets. We can
1395+ * pull a fast one on naughty userspace, though: we program
1396+ * SYSCALL to mask DF, so userspace cannot cause DF to be set
1397+ * if it controls the kernel's RSP. We set DF before we clear
1398+ * "NMI executing".
12781399 */
12791400 lea 6*8(%rsp), %rdx
12801401 /* Compare the NMI stack (rdx) with the stack we came from (4*8(%rsp)) */
@@ -1286,25 +1407,20 @@ ENTRY(nmi) · 5 unmodified lines
12861407 cmpq %rdx, 4*8(%rsp)
12871408 /* If it is below the NMI stack, it is a normal NMI */
12881409 jb first_nmi
1289− /* Ah, it is within the NMI stack, treat it as nested */
1410+
1411+ /* Ah, it is within the NMI stack. */
1412+
1413+ testb $(X86_EFLAGS_DF >> 8), (3*8 + 1)(%rsp)
1414+ jz first_nmi /* RSP was user controlled. */
1415+
1416+ /* This is a nested NMI. */
12901417
12911418 nested_nmi:
12921419 /*
1293− * Do nothing if we interrupted the fixup in repeat_nmi.
1294− * It's about to repeat the NMI handler, so we are fine
1295− * with ignoring this one.
1420+ * Modify the "iret" frame to point to repeat_nmi, forcing another
1421+ * iteration of NMI handling.
12961422 */
1297− movq $repeat_nmi, %rdx
1298− cmpq 8(%rsp), %rdx
1299− ja 1f
1300− movq $end_repeat_nmi, %rdx
1301− cmpq 8(%rsp), %rdx
1302− ja nested_nmi_out
1303−
1304−1:
1305− /* Set up the interrupted NMIs stack to jump to repeat_nmi */
1306− leaq -1*8(%rsp), %rdx
1307− movq %rdx, %rsp
1423+ subq $8, %rsp
13081424 leaq -10*8(%rsp), %rdx
13091425 pushq $__KERNEL_DS
13101426 pushq %rdx
@@ -1318,61 +1434,42 @@ nested_nmi: · 7 unmodified lines
13181434 nested_nmi_out:
13191435 popq %rdx
13201436
1321− /* No need to check faults here */
1437+ /* We are returning to kernel mode, so this cannot result in a fault. */
13221438 INTERRUPT_RETURN
13231439
13241440 first_nmi:
1325− /*
1326− * Because nested NMIs will use the pushed location that we
1327− * stored in rdx, we must keep that space available.
1328− * Here's what our stack frame will look like:
1329− * +-------------------------+
1330− * | original SS |
1331− * | original Return RSP |
1332− * | original RFLAGS |
1333− * | original CS |
1334− * | original RIP |
1335− * +-------------------------+
1336− * | temp storage for rdx |
1337− * +-------------------------+
1338− * | NMI executing variable |
1339− * +-------------------------+
1340− * | copied SS |
1341− * | copied Return RSP |
1342− * | copied RFLAGS |
1343− * | copied CS |
1344− * | copied RIP |
1345− * +-------------------------+
1346− * | Saved SS |
1347− * | Saved Return RSP |
1348− * | Saved RFLAGS |
1349− * | Saved CS |
1350− * | Saved RIP |
1351− * +-------------------------+
1352− * | pt_regs |
1353− * +-------------------------+
1354− *
1355− * The saved stack frame is used to fix up the copied stack frame
1356− * that a nested NMI may change to make the interrupted NMI iret jump
1357− * to the repeat_nmi. The original stack frame and the temp storage
1358− * is also used by nested NMIs and can not be trusted on exit.
1359− */
1360− /* Do not pop rdx, nested NMIs will corrupt that part of the stack */
1441+ /* Restore rdx. */
13611442 movq (%rsp), %rdx
13621443
1363− /* Set the NMI executing variable on the stack. */
1364− pushq $1
1444+ /* Make room for "NMI executing". */
1445+ pushq $0
13651446
1366− /* Leave room for the "copied" frame */
1447+ /* Leave room for the "iret" frame */
13671448 subq $(5*8), %rsp
13681449
1369− /* Copy the stack frame to the Saved frame */
1450+ /* Copy the "original" frame to the "outermost" frame */
13701451 .rept 5
13711452 pushq 11*8(%rsp)
13721453 .endr
13731454
13741455 /* Everything up to here is safe from nested NMIs */
13751456
1457+#ifdef CONFIG_DEBUG_ENTRY
1458+ /*
1459+ * For ease of testing, unmask NMIs right away. Disabled by
1460+ * default because IRET is very expensive.
1461+ */
1462+ pushq $0 /* SS */
1463+ pushq %rsp /* RSP (minus 8 because of the previous push) */
1464+ addq $8, (%rsp) /* Fix up RSP */
1465+ pushfq /* RFLAGS */
1466+ pushq $__KERNEL_CS /* CS */
1467+ pushq $1f /* RIP */
1468+ INTERRUPT_RETURN /* continues at repeat_nmi below */
1469+1:
1470+#endif
1471+
1472+repeat_nmi:
13761473 /*
13771474 * If there was a nested NMI, the first NMI's iret will return
13781475 * here. But NMIs are still enabled and we can take another
@@ -1381,16 +1478,20 @@ first_nmi: · 2 unmodified lines
13811478 * it will just return, as we are about to repeat an NMI anyway.
13821479 * This makes it safe to copy to the stack frame that a nested
13831480 * NMI will update.
1481+ *
1482+ * RSP is pointing to "outermost RIP". gsbase is unknown, but, if
1483+ * we're repeating an NMI, gsbase has the same value that it had on
1484+ * the first iteration. paranoid_entry will load the kernel
1485+ * gsbase if needed before we call do_nmi. "NMI executing"
1486+ * is zero.
13841487 */
1385−repeat_nmi:
1488+ movq $1, 10*8(%rsp) /* Set "NMI executing". */
1489+
13861490 /*
1387− * Update the stack variable to say we are still in NMI (the update
1388− * is benign for the non-repeat case, where 1 was pushed just above
1389− * to this very stack slot).
1491+ * Copy the "outermost" frame to the "iret" frame. NMIs that nest
1492+ * here must not modify the "iret" frame while we're writing to
1493+ * it or it will end up containing garbage.
13901494 */
1391− movq $1, 10*8(%rsp)
1392−
1393− /* Make another copy, this one may be modified by nested NMIs */
13941495 addq $(10*8), %rsp
13951496 .rept 5
13961497 pushq -6*8(%rsp)
@@ -1399,9 +1500,9 @@ repeat_nmi: · 2 unmodified lines
13991500 end_repeat_nmi:
14001501
14011502 /*
1402− * Everything below this point can be preempted by a nested
1403− * NMI if the first NMI took an exception and reset our iret stack
1404− * so that we repeat another NMI.
1503+ * Everything below this point can be preempted by a nested NMI.
1504+ * If this happens, then the inner NMI will change the "iret"
1505+ * frame to point back to repeat_nmi.
14051506 */
14061507 pushq $-1 /* ORIG_RAX: no syscall to restart */
14071508 ALLOC_PT_GPREGS_ON_STACK
@@ -1415,28 +1516,11 @@ end_repeat_nmi: · 7 unmodified lines
14151516 */
14161517 call paranoid_entry
14171518
1418− /*
1419− * Save off the CR2 register. If we take a page fault in the NMI then
1420− * it could corrupt the CR2 value. If the NMI preempts a page fault
1421− * handler before it was able to read the CR2 register, and then the
1422− * NMI itself takes a page fault, the page fault that was preempted
1423− * will read the information from the NMI page fault and not the
1424− * origin fault. Save it off and restore it if it changes.
1425− * Use the r12 callee-saved register.
1426− */
1427− movq %cr2, %r12
1428−
14291519 /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
14301520 movq %rsp, %rdi
14311521 movq $-1, %rsi
14321522 call do_nmi
14331523
1434− /* Did the NMI take a page fault? Restore cr2 if it did */
1435− movq %cr2, %rcx
1436− cmpq %rcx, %r12
1437− je 1f
1438− movq %r12, %cr2
1439−1:
14401524 testl %ebx, %ebx /* swapgs needed? */
14411525 jnz nmi_restore
14421526 nmi_swapgs:
@@ -1444,11 +1528,26 @@ nmi_swapgs: · 1 unmodified line
14441528 nmi_restore:
14451529 RESTORE_EXTRA_REGS
14461530 RESTORE_C_REGS
1447− /* Pop the extra iret frame at once */
1531+
1532+ /* Point RSP at the "iret" frame. */
14481533 REMOVE_PT_GPREGS_FROM_STACK 6*8
14491534
1450− /* Clear the NMI executing stack variable */
1451− movq $0, 5*8(%rsp)
1535+ /*
1536+ * Clear "NMI executing". Set DF first so that we can easily
1537+ * distinguish the remaining code between here and IRET from
1538+ * the SYSCALL entry and exit paths. On a native kernel, we
1539+ * could just inspect RIP, but, on paravirt kernels,
1540+ * INTERRUPT_RETURN can translate into a jump into a
1541+ * hypercall page.
1542+ */
1543+ std
1544+ movq $0, 5*8(%rsp) /* clear "NMI executing" */
1545+
1546+ /*
1547+ * INTERRUPT_RETURN reads the "iret" frame and exits the NMI
1548+ * stack in a single instruction. We are returning to kernel
1549+ * mode, so this cannot result in a fault.
1550+ */
14521551 INTERRUPT_RETURN
14531552 END(nmi)
14541553
arch/x86/include/asm/Kbuild+1−0
@@ -9,3 +9,4 @@ generic-y += cputime.h · 8 unmodified lines
99 generic-y += dma-contiguous.h
1010 generic-y += early_ioremap.h
1111 generic-y += mcs_spinlock.h
12+generic-y += mm-arch-hooks.h
arch/x86/include/asm/fpu/types.h+38−34
@@ -189,6 +189,7 @@ union fpregs_state { · 188 unmodified lines
189189 struct fxregs_state fxsave;
190190 struct swregs_state soft;
191191 struct xregs_state xsave;
192+ u8 __padding[PAGE_SIZE];
192193 };
193194
194195 /*
@@ -197,40 +198,6 @@ union fpregs_state { · 2 unmodified lines
197198 * state fields:
198199 */
199200 struct fpu {
200− /*
201− * @state:
202− *
203− * In-memory copy of all FPU registers that we save/restore
204− * over context switches. If the task is using the FPU then
205− * the registers in the FPU are more recent than this state
206− * copy. If the task context-switches away then they get
207− * saved here and represent the FPU state.
208− *
209− * After context switches there may be a (short) time period
210− * during which the in-FPU hardware registers are unchanged
211− * and still perfectly match this state, if the tasks
212− * scheduled afterwards are not using the FPU.
213− *
214− * This is the 'lazy restore' window of optimization, which
215− * we track though 'fpu_fpregs_owner_ctx' and 'fpu->last_cpu'.
216− *
217− * We detect whether a subsequent task uses the FPU via setting
218− * CR0::TS to 1, which causes any FPU use to raise a #NM fault.
219− *
220− * During this window, if the task gets scheduled again, we
221− * might be able to skip having to do a restore from this
222− * memory buffer to the hardware registers - at the cost of
223− * incurring the overhead of #NM fault traps.
224− *
225− * Note that on modern CPUs that support the XSAVEOPT (or other
226− * optimized XSAVE instructions), we don't use #NM traps anymore,
227− * as the hardware can track whether FPU registers need saving
228− * or not. On such CPUs we activate the non-lazy ('eagerfpu')
229− * logic, which unconditionally saves/restores all FPU state
230− * across context switches. (if FPU state exists.)
231− */
232− union fpregs_state state;
233−
234201 /*
235202 * @last_cpu:
236203 *
@@ -288,6 +255,43 @@ struct fpu { · 51 unmodified lines
288255 * deal with bursty apps that only use the FPU for a short time:
289256 */
290257 unsigned char counter;
258+ /*
259+ * @state:
260+ *
261+ * In-memory copy of all FPU registers that we save/restore
262+ * over context switches. If the task is using the FPU then
263+ * the registers in the FPU are more recent than this state
264+ * copy. If the task context-switches away then they get
265+ * saved here and represent the FPU state.
266+ *
267+ * After context switches there may be a (short) time period
268+ * during which the in-FPU hardware registers are unchanged
269+ * and still perfectly match this state, if the tasks
270+ * scheduled afterwards are not using the FPU.
271+ *
272+ * This is the 'lazy restore' window of optimization, which
273+ * we track though 'fpu_fpregs_owner_ctx' and 'fpu->last_cpu'.
274+ *
275+ * We detect whether a subsequent task uses the FPU via setting
276+ * CR0::TS to 1, which causes any FPU use to raise a #NM fault.
277+ *
278+ * During this window, if the task gets scheduled again, we
279+ * might be able to skip having to do a restore from this
280+ * memory buffer to the hardware registers - at the cost of
281+ * incurring the overhead of #NM fault traps.
282+ *
283+ * Note that on modern CPUs that support the XSAVEOPT (or other
284+ * optimized XSAVE instructions), we don't use #NM traps anymore,
285+ * as the hardware can track whether FPU registers need saving
286+ * or not. On such CPUs we activate the non-lazy ('eagerfpu')
287+ * logic, which unconditionally saves/restores all FPU state
288+ * across context switches. (if FPU state exists.)
289+ */
290+ union fpregs_state state;
291+ /*
292+ * WARNING: 'state' is dynamically-sized. Do not put
293+ * anything after it here.
294+ */
291295 };
292296
293297 #endif /* _ASM_X86_FPU_H */
arch/x86/include/asm/intel_pmc_ipc.h+0−27
@@ -25,36 +25,9 @@ · 24 unmodified lines
2525
2626 #if IS_ENABLED(CONFIG_INTEL_PMC_IPC)
2727
28−/*
29− * intel_pmc_ipc_simple_command
30− * @cmd: command
31− * @sub: sub type
32− */
3328 int intel_pmc_ipc_simple_command(int cmd, int sub);
34−
35−/*
36− * intel_pmc_ipc_raw_cmd
37− * @cmd: command
38− * @sub: sub type
39− * @in: input data
40− * @inlen: input length in bytes
41− * @out: output data
42− * @outlen: output length in dwords
43− * @sptr: data writing to SPTR register
44− * @dptr: data writing to DPTR register
45− */
4629 int intel_pmc_ipc_raw_cmd(u32 cmd, u32 sub, u8 *in, u32 inlen,
4730 u32 *out, u32 outlen, u32 dptr, u32 sptr);
48−
49−/*
50− * intel_pmc_ipc_command
51− * @cmd: command
52− * @sub: sub type
53− * @in: input data
54− * @inlen: input length in bytes
55− * @out: output data
56− * @outlen: output length in dwords
57− */
5831 int intel_pmc_ipc_command(u32 cmd, u32 sub, u8 *in, u32 inlen,
5932 u32 *out, u32 outlen);
6033
arch/x86/include/asm/kvm_host.h+2−0
@@ -604,6 +604,8 @@ struct kvm_arch { · 603 unmodified lines
604604 bool iommu_noncoherent;
605605 #define __KVM_HAVE_ARCH_NONCOHERENT_DMA
606606 atomic_t noncoherent_dma_count;
607+#define __KVM_HAVE_ARCH_ASSIGNED_DEVICE
608+ atomic_t assigned_device_count;
607609 struct kvm_pic *vpic;
608610 struct kvm_ioapic *vioapic;
609611 struct kvm_pit *vpit;
arch/x86/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_X86_MM_ARCH_HOOKS_H
13−#define _ASM_X86_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_X86_MM_ARCH_HOOKS_H */
arch/x86/include/asm/mmu_context.h+1−1
@@ -23,7 +23,7 @@ extern struct static_key rdpmc_always_available; · 22 unmodified lines
2323
2424 static inline void load_mm_cr4(struct mm_struct *mm)
2525 {
26− if (static_key_true(&rdpmc_always_available) ||
26+ if (static_key_false(&rdpmc_always_available) ||
2727 atomic_read(&mm->context.perf_rdpmc_allowed))
2828 cr4_set_bits(X86_CR4_PCE);
2929 else
arch/x86/include/asm/processor.h+7−3
@@ -390,9 +390,6 @@ struct thread_struct { · 389 unmodified lines
390390 #endif
391391 unsigned long gs;
392392
393− /* Floating point and extended processor state */
394− struct fpu fpu;
395−
396393 /* Save middle states of ptrace breakpoints */
397394 struct perf_event *ptrace_bps[HBP_NUM];
398395 /* Debug status used for traps, single steps, etc... */
@@ -418,6 +415,13 @@ struct thread_struct { · 19 unmodified lines
418415 unsigned long iopl;
419416 /* Max allowed port in the bitmap, in bytes: */
420417 unsigned io_bitmap_max;
418+
419+ /* Floating point and extended processor state */
420+ struct fpu fpu;
421+ /*
422+ * WARNING: 'fpu' is dynamically-sized. It *MUST* be at
423+ * the end.
424+ */
421425 };
422426
423427 /*
arch/x86/include/uapi/asm/hyperv.h+2−0
@@ -108,6 +108,8 @@ · 107 unmodified lines
108108 #define HV_X64_HYPERCALL_PARAMS_XMM_AVAILABLE (1 << 4)
109109 /* Support for a virtual guest idle state is available */
110110 #define HV_X64_GUEST_IDLE_STATE_AVAILABLE (1 << 5)
111+/* Guest crash data handler available */
112+#define HV_X64_GUEST_CRASH_MSR_AVAILABLE (1 << 10)
111113
112114 /*
113115 * Implementation recommendations. Indicates which behaviors the hypervisor
arch/x86/kernel/fpu/init.c+40−0
@@ -4,6 +4,8 @@ · 3 unmodified lines
44 #include <asm/fpu/internal.h>
55 #include <asm/tlbflush.h>
66
7+#include <linux/sched.h>
8+
79 /*
810 * Initialize the TS bit in CR0 according to the style of context-switches
911 * we are using:
@@ -136,6 +138,43 @@ static void __init fpu__init_system_generic(void) · 126 unmodified lines
136138 unsigned int xstate_size;
137139 EXPORT_SYMBOL_GPL(xstate_size);
138140
141+/* Enforce that 'MEMBER' is the last field of 'TYPE': */
142+#define CHECK_MEMBER_AT_END_OF(TYPE, MEMBER) \
143+ BUILD_BUG_ON(sizeof(TYPE) != offsetofend(TYPE, MEMBER))
144+
145+/*
146+ * We append the 'struct fpu' to the task_struct:
147+ */
148+static void __init fpu__init_task_struct_size(void)
149+{
150+ int task_size = sizeof(struct task_struct);
151+
152+ /*
153+ * Subtract off the static size of the register state.
154+ * It potentially has a bunch of padding.
155+ */
156+ task_size -= sizeof(((struct task_struct *)0)->thread.fpu.state);
157+
158+ /*
159+ * Add back the dynamically-calculated register state
160+ * size.
161+ */
162+ task_size += xstate_size;
163+
164+ /*
165+ * We dynamically size 'struct fpu', so we require that
166+ * it be at the end of 'thread_struct' and that
167+ * 'thread_struct' be at the end of 'task_struct'. If
168+ * you hit a compile error here, check the structure to
169+ * see if something got added to the end.
170+ */
171+ CHECK_MEMBER_AT_END_OF(struct fpu, state);
172+ CHECK_MEMBER_AT_END_OF(struct thread_struct, fpu);
173+ CHECK_MEMBER_AT_END_OF(struct task_struct, thread);
174+
175+ arch_task_struct_size = task_size;
176+}
177+
139178 /*
140179 * Set up the xstate_size based on the legacy FPU context size.
141180 *
@@ -287,6 +326,7 @@ void __init fpu__init_system(struct cpuinfo_x86 *c) · 145 unmodified lines
287326 fpu__init_system_generic();
288327 fpu__init_system_xstate_size_legacy();
289328 fpu__init_system_xstate();
329+ fpu__init_task_struct_size();
290330
291331 fpu__init_system_ctx_switch();
292332 }
arch/x86/kernel/nmi.c+52−71
@@ -408,15 +408,15 @@ static void default_do_nmi(struct pt_regs *regs) · 407 unmodified lines
408408 NOKPROBE_SYMBOL(default_do_nmi);
409409
410410 /*
411− * NMIs can hit breakpoints which will cause it to lose its
412− * NMI context with the CPU when the breakpoint does an iret.
413− */
414−#ifdef CONFIG_X86_32
415−/*
416− * For i386, NMIs use the same stack as the kernel, and we can
417− * add a workaround to the iret problem in C (preventing nested
418− * NMIs if an NMI takes a trap). Simply have 3 states the NMI
419− * can be in:
411+ * NMIs can page fault or hit breakpoints which will cause it to lose
412+ * its NMI context with the CPU when the breakpoint or page fault does an IRET.
413+ *
414+ * As a result, NMIs can nest if NMIs get unmasked due an IRET during
415+ * NMI processing. On x86_64, the asm glue protects us from nested NMIs
416+ * if the outer NMI came from kernel mode, but we can still nest if the
417+ * outer NMI came from user mode.
418+ *
419+ * To handle these nested NMIs, we have three states:
420420 *
421421 * 1) not running
422422 * 2) executing
@@ -430,15 +430,14 @@ NOKPROBE_SYMBOL(default_do_nmi); · 7 unmodified lines
430430 * (Note, the latch is binary, thus multiple NMIs triggering,
431431 * when one is running, are ignored. Only one NMI is restarted.)
432432 *
433− * If an NMI hits a breakpoint that executes an iret, another
434− * NMI can preempt it. We do not want to allow this new NMI
435− * to run, but we want to execute it when the first one finishes.
436− * We set the state to "latched", and the exit of the first NMI will
437− * perform a dec_return, if the result is zero (NOT_RUNNING), then
438− * it will simply exit the NMI handler. If not, the dec_return
439− * would have set the state to NMI_EXECUTING (what we want it to
440− * be when we are running). In this case, we simply jump back
441− * to rerun the NMI handler again, and restart the 'latched' NMI.
433+ * If an NMI executes an iret, another NMI can preempt it. We do not
434+ * want to allow this new NMI to run, but we want to execute it when the
435+ * first one finishes. We set the state to "latched", and the exit of
436+ * the first NMI will perform a dec_return, if the result is zero
437+ * (NOT_RUNNING), then it will simply exit the NMI handler. If not, the
438+ * dec_return would have set the state to NMI_EXECUTING (what we want it
439+ * to be when we are running). In this case, we simply jump back to
440+ * rerun the NMI handler again, and restart the 'latched' NMI.
442441 *
443442 * No trap (breakpoint or page fault) should be hit before nmi_restart,
444443 * thus there is no race between the first check of state for NOT_RUNNING
@@ -461,49 +460,36 @@ enum nmi_states { · 16 unmodified lines
461460 static DEFINE_PER_CPU(enum nmi_states, nmi_state);
462461 static DEFINE_PER_CPU(unsigned long, nmi_cr2);
463462
464−#define nmi_nesting_preprocess(regs) \
465− do { \
466− if (this_cpu_read(nmi_state) != NMI_NOT_RUNNING) { \
467− this_cpu_write(nmi_state, NMI_LATCHED); \
468− return; \
469− } \
470− this_cpu_write(nmi_state, NMI_EXECUTING); \
471− this_cpu_write(nmi_cr2, read_cr2()); \
472− } while (0); \
473− nmi_restart:
474−
475−#define nmi_nesting_postprocess() \
476− do { \
477− if (unlikely(this_cpu_read(nmi_cr2) != read_cr2())) \
478− write_cr2(this_cpu_read(nmi_cr2)); \
479− if (this_cpu_dec_return(nmi_state)) \
480− goto nmi_restart; \
481− } while (0)
482−#else /* x86_64 */
463+#ifdef CONFIG_X86_64
483464 /*
484− * In x86_64 things are a bit more difficult. This has the same problem
485− * where an NMI hitting a breakpoint that calls iret will remove the
486− * NMI context, allowing a nested NMI to enter. What makes this more
487− * difficult is that both NMIs and breakpoints have their own stack.
488− * When a new NMI or breakpoint is executed, the stack is set to a fixed
489− * point. If an NMI is nested, it will have its stack set at that same
490− * fixed address that the first NMI had, and will start corrupting the
491− * stack. This is handled in entry_64.S, but the same problem exists with
492− * the breakpoint stack.
465+ * In x86_64, we need to handle breakpoint -> NMI -> breakpoint. Without
466+ * some care, the inner breakpoint will clobber the outer breakpoint's
467+ * stack.
493468 *
494− * If a breakpoint is being processed, and the debug stack is being used,
495− * if an NMI comes in and also hits a breakpoint, the stack pointer
496− * will be set to the same fixed address as the breakpoint that was
497− * interrupted, causing that stack to be corrupted. To handle this case,
498− * check if the stack that was interrupted is the debug stack, and if
499− * so, change the IDT so that new breakpoints will use the current stack
500− * and not switch to the fixed address. On return of the NMI, switch back
501− * to the original IDT.
469+ * If a breakpoint is being processed, and the debug stack is being
470+ * used, if an NMI comes in and also hits a breakpoint, the stack
471+ * pointer will be set to the same fixed address as the breakpoint that
472+ * was interrupted, causing that stack to be corrupted. To handle this
473+ * case, check if the stack that was interrupted is the debug stack, and
474+ * if so, change the IDT so that new breakpoints will use the current
475+ * stack and not switch to the fixed address. On return of the NMI,
476+ * switch back to the original IDT.
502477 */
503478 static DEFINE_PER_CPU(int, update_debug_stack);
479+#endif
504480
505−static inline void nmi_nesting_preprocess(struct pt_regs *regs)
481+dotraplinkage notrace void
482+do_nmi(struct pt_regs *regs, long error_code)
506483 {
484+ if (this_cpu_read(nmi_state) != NMI_NOT_RUNNING) {
485+ this_cpu_write(nmi_state, NMI_LATCHED);
486+ return;
487+ }
488+ this_cpu_write(nmi_state, NMI_EXECUTING);
489+ this_cpu_write(nmi_cr2, read_cr2());
490+nmi_restart:
491+
492+#ifdef CONFIG_X86_64
507493 /*
508494 * If we interrupted a breakpoint, it is possible that
509495 * the nmi handler will have breakpoints too. We need to
@@ -514,22 +500,8 @@ static inline void nmi_nesting_preprocess(struct pt_regs *regs) · 4 unmodified lines
514500 debug_stack_set_zero();
515501 this_cpu_write(update_debug_stack, 1);
516502 }
517−}
518−
519−static inline void nmi_nesting_postprocess(void)
520−{
521− if (unlikely(this_cpu_read(update_debug_stack))) {
522− debug_stack_reset();
523− this_cpu_write(update_debug_stack, 0);
524− }
525−}
526503 #endif
527504
528−dotraplinkage notrace void
529−do_nmi(struct pt_regs *regs, long error_code)
530−{
531− nmi_nesting_preprocess(regs);
532−
533505 nmi_enter();
534506
535507 inc_irq_stat(__nmi_count);
@@ -539,8 +511,17 @@ do_nmi(struct pt_regs *regs, long error_code) · 3 unmodified lines
539511
540512 nmi_exit();
541513
542− /* On i386, may loop back to preprocess */
543− nmi_nesting_postprocess();
514+#ifdef CONFIG_X86_64
515+ if (unlikely(this_cpu_read(update_debug_stack))) {
516+ debug_stack_reset();
517+ this_cpu_write(update_debug_stack, 0);
518+ }
519+#endif
520+
521+ if (unlikely(this_cpu_read(nmi_cr2) != read_cr2()))
522+ write_cr2(this_cpu_read(nmi_cr2));
523+ if (this_cpu_dec_return(nmi_state))
524+ goto nmi_restart;
544525 }
545526 NOKPROBE_SYMBOL(do_nmi);
546527
arch/x86/kernel/process.c+1−1
@@ -81,7 +81,7 @@ EXPORT_SYMBOL_GPL(idle_notifier_unregister); · 80 unmodified lines
8181 */
8282 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
8383 {
84− *dst = *src;
84+ memcpy(dst, src, arch_task_struct_size);
8585
8686 return fpu__copy(&dst->thread.fpu, &src->thread.fpu);
8787 }
arch/x86/kernel/smpboot.c+11−0
@@ -992,8 +992,17 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle) · 991 unmodified lines
992992
993993 common_cpu_up(cpu, tidle);
994994
995+ /*
996+ * We have to walk the irq descriptors to setup the vector
997+ * space for the cpu which comes online. Prevent irq
998+ * alloc/free across the bringup.
999+ */
1000+ irq_lock_sparse();
1001+
9951002 err = do_boot_cpu(apicid, cpu, tidle);
1003+
9961004 if (err) {
1005+ irq_unlock_sparse();
9971006 pr_err("do_boot_cpu failed(%d) to wakeup CPU#%u\n", err, cpu);
9981007 return -EIO;
9991008 }
@@ -1011,6 +1020,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle) · 11 unmodified lines
10111020 touch_nmi_watchdog();
10121021 }
10131022
1023+ irq_unlock_sparse();
1024+
10141025 return 0;
10151026 }
10161027
arch/x86/kvm/cpuid.c+2−0
@@ -98,6 +98,8 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu) · 97 unmodified lines
9898 best->ebx = xstate_required_size(vcpu->arch.xcr0, true);
9999
100100 vcpu->arch.eager_fpu = use_eager_fpu() || guest_cpuid_has_mpx(vcpu);
101+ if (vcpu->arch.eager_fpu)
102+ kvm_x86_ops->fpu_activate(vcpu);
101103
102104 /*
103105 * The existing code assumes virtual address is 48-bit in the canonical
arch/x86/kvm/iommu.c+2−0
@@ -200,6 +200,7 @@ int kvm_assign_device(struct kvm *kvm, struct pci_dev *pdev) · 199 unmodified lines
200200 goto out_unmap;
201201 }
202202
203+ kvm_arch_start_assignment(kvm);
203204 pci_set_dev_assigned(pdev);
204205
205206 dev_info(&pdev->dev, "kvm assign device\n");
@@ -224,6 +225,7 @@ int kvm_deassign_device(struct kvm *kvm, struct pci_dev *pdev) · 18 unmodified lines
224225 iommu_detach_device(domain, &pdev->dev);
225226
226227 pci_clear_dev_assigned(pdev);
228+ kvm_arch_end_assignment(kvm);
227229
228230 dev_info(&pdev->dev, "kvm deassign device\n");
229231
arch/x86/kvm/mmu.c+9−1
@@ -2479,6 +2479,14 @@ static int mmu_need_write_protect(struct kvm_vcpu *vcpu, gfn_t gfn, · 2478 unmodified lines
24792479 return 0;
24802480 }
24812481
2482+static bool kvm_is_mmio_pfn(pfn_t pfn)
2483+{
2484+ if (pfn_valid(pfn))
2485+ return !is_zero_pfn(pfn) && PageReserved(pfn_to_page(pfn));
2486+
2487+ return true;
2488+}
2489+
24822490 static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
24832491 unsigned pte_access, int level,
24842492 gfn_t gfn, pfn_t pfn, bool speculative,
@@ -2506,7 +2514,7 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep, · 21 unmodified lines
25062514 spte |= PT_PAGE_SIZE_MASK;
25072515 if (tdp_enabled)
25082516 spte |= kvm_x86_ops->get_mt_mask(vcpu, gfn,
2509− kvm_is_reserved_pfn(pfn));
2517+ kvm_is_mmio_pfn(pfn));
25102518
25112519 if (host_writable)
25122520 spte |= SPTE_HOST_WRITEABLE;
arch/x86/kvm/svm.c+103−5
@@ -865,6 +865,64 @@ static void svm_disable_lbrv(struct vcpu_svm *svm) · 864 unmodified lines
865865 set_msr_interception(msrpm, MSR_IA32_LASTINTTOIP, 0, 0);
866866 }
867867
868+#define MTRR_TYPE_UC_MINUS 7
869+#define MTRR2PROTVAL_INVALID 0xff
870+
871+static u8 mtrr2protval[8];
872+
873+static u8 fallback_mtrr_type(int mtrr)
874+{
875+ /*
876+ * WT and WP aren't always available in the host PAT. Treat
877+ * them as UC and UC- respectively. Everything else should be
878+ * there.
879+ */
880+ switch (mtrr)
881+ {
882+ case MTRR_TYPE_WRTHROUGH:
883+ return MTRR_TYPE_UNCACHABLE;
884+ case MTRR_TYPE_WRPROT:
885+ return MTRR_TYPE_UC_MINUS;
886+ default:
887+ BUG();
888+ }
889+}
890+
891+static void build_mtrr2protval(void)
892+{
893+ int i;
894+ u64 pat;
895+
896+ for (i = 0; i < 8; i++)
897+ mtrr2protval[i] = MTRR2PROTVAL_INVALID;
898+
899+ /* Ignore the invalid MTRR types. */
900+ mtrr2protval[2] = 0;
901+ mtrr2protval[3] = 0;
902+
903+ /*
904+ * Use host PAT value to figure out the mapping from guest MTRR
905+ * values to nested page table PAT/PCD/PWT values. We do not
906+ * want to change the host PAT value every time we enter the
907+ * guest.
908+ */
909+ rdmsrl(MSR_IA32_CR_PAT, pat);
910+ for (i = 0; i < 8; i++) {
911+ u8 mtrr = pat >> (8 * i);
912+
913+ if (mtrr2protval[mtrr] == MTRR2PROTVAL_INVALID)
914+ mtrr2protval[mtrr] = __cm_idx2pte(i);
915+ }
916+
917+ for (i = 0; i < 8; i++) {
918+ if (mtrr2protval[i] == MTRR2PROTVAL_INVALID) {
919+ u8 fallback = fallback_mtrr_type(i);
920+ mtrr2protval[i] = mtrr2protval[fallback];
921+ BUG_ON(mtrr2protval[i] == MTRR2PROTVAL_INVALID);
922+ }
923+ }
924+}
925+
868926 static __init int svm_hardware_setup(void)
869927 {
870928 int cpu;
@@ -931,6 +989,7 @@ static __init int svm_hardware_setup(void) · 60 unmodified lines
931989 } else
932990 kvm_disable_tdp();
933991
992+ build_mtrr2protval();
934993 return 0;
935994
936995 err:
@@ -1085,6 +1144,39 @@ static u64 svm_compute_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc) · 148 unmodified lines
10851144 return target_tsc - tsc;
10861145 }
10871146
1147+static void svm_set_guest_pat(struct vcpu_svm *svm, u64 *g_pat)
1148+{
1149+ struct kvm_vcpu *vcpu = &svm->vcpu;
1150+
1151+ /* Unlike Intel, AMD takes the guest's CR0.CD into account.
1152+ *
1153+ * AMD does not have IPAT. To emulate it for the case of guests
1154+ * with no assigned devices, just set everything to WB. If guests
1155+ * have assigned devices, however, we cannot force WB for RAM
1156+ * pages only, so use the guest PAT directly.
1157+ */
1158+ if (!kvm_arch_has_assigned_device(vcpu->kvm))
1159+ *g_pat = 0x0606060606060606;
1160+ else
1161+ *g_pat = vcpu->arch.pat;
1162+}
1163+
1164+static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
1165+{
1166+ u8 mtrr;
1167+
1168+ /*
1169+ * 1. MMIO: trust guest MTRR, so same as item 3.
1170+ * 2. No passthrough: always map as WB, and force guest PAT to WB as well
1171+ * 3. Passthrough: can't guarantee the result, try to trust guest.
1172+ */
1173+ if (!is_mmio && !kvm_arch_has_assigned_device(vcpu->kvm))
1174+ return 0;
1175+
1176+ mtrr = kvm_mtrr_get_guest_memory_type(vcpu, gfn);
1177+ return mtrr2protval[mtrr];
1178+}
1179+
10881180 static void init_vmcb(struct vcpu_svm *svm, bool init_event)
10891181 {
10901182 struct vmcb_control_area *control = &svm->vmcb->control;
@@ -1180,6 +1272,7 @@ static void init_vmcb(struct vcpu_svm *svm, bool init_event) · 89 unmodified lines
11801272 clr_cr_intercept(svm, INTERCEPT_CR3_READ);
11811273 clr_cr_intercept(svm, INTERCEPT_CR3_WRITE);
11821274 save->g_pat = svm->vcpu.arch.pat;
1275+ svm_set_guest_pat(svm, &save->g_pat);
11831276 save->cr3 = 0;
11841277 save->cr4 = 0;
11851278 }
@@ -3254,6 +3347,16 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 2068 unmodified lines
32543347 case MSR_VM_IGNNE:
32553348 vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
32563349 break;
3350+ case MSR_IA32_CR_PAT:
3351+ if (npt_enabled) {
3352+ if (!kvm_mtrr_valid(vcpu, MSR_IA32_CR_PAT, data))
3353+ return 1;
3354+ vcpu->arch.pat = data;
3355+ svm_set_guest_pat(svm, &svm->vmcb->save.g_pat);
3356+ mark_dirty(svm->vmcb, VMCB_NPT);
3357+ break;
3358+ }
3359+ /* fall through */
32573360 default:
32583361 return kvm_set_msr_common(vcpu, msr);
32593362 }
@@ -4088,11 +4191,6 @@ static bool svm_has_high_real_mode_segbase(void) · 828 unmodified lines
40884191 return true;
40894192 }
40904193
4091−static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
4092−{
4093− return 0;
4094−}
4095−
40964194 static void svm_cpuid_update(struct kvm_vcpu *vcpu)
40974195 {
40984196 }
arch/x86/kvm/vmx.c+3−8
@@ -8632,22 +8632,17 @@ static u64 vmx_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio) · 8631 unmodified lines
86328632 u64 ipat = 0;
86338633
86348634 /* For VT-d and EPT combination
8635− * 1. MMIO: always map as UC
8635+ * 1. MMIO: guest may want to apply WC, trust it.
86368636 * 2. EPT with VT-d:
86378637 * a. VT-d without snooping control feature: can't guarantee the
8638− * result, try to trust guest.
8638+ * result, try to trust guest. So the same as item 1.
86398639 * b. VT-d with snooping control feature: snooping control feature of
86408640 * VT-d engine can guarantee the cache correctness. Just set it
86418641 * to WB to keep consistent with host. So the same as item 3.
86428642 * 3. EPT without VT-d: always map as WB and set IPAT=1 to keep
86438643 * consistent with host MTRR
86448644 */
8645− if (is_mmio) {
8646− cache = MTRR_TYPE_UNCACHABLE;
8647− goto exit;
8648− }
8649−
8650− if (!kvm_arch_has_noncoherent_dma(vcpu->kvm)) {
8645+ if (!is_mmio && !kvm_arch_has_noncoherent_dma(vcpu->kvm)) {
86518646 ipat = VMX_EPT_IPAT_BIT;
86528647 cache = MTRR_TYPE_WRBACK;
86538648 goto exit;
arch/x86/kvm/x86.c+19−7
@@ -3157,8 +3157,7 @@ static void load_xsave(struct kvm_vcpu *vcpu, u8 *src) · 3156 unmodified lines
31573157 cpuid_count(XSTATE_CPUID, index,
31583158 &size, &offset, &ecx, &edx);
31593159 memcpy(dest, src + offset, size);
3160− } else
3161− WARN_ON_ONCE(1);
3160+ }
31623161
31633162 valid -= feature;
31643163 }
@@ -7315,11 +7314,6 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, · 4150 unmodified lines
73157314
73167315 vcpu = kvm_x86_ops->vcpu_create(kvm, id);
73177316
7318− /*
7319− * Activate fpu unconditionally in case the guest needs eager FPU. It will be
7320− * deactivated soon if it doesn't.
7321− */
7322− kvm_x86_ops->fpu_activate(vcpu);
73237317 return vcpu;
73247318 }
73257319
@@ -8218,6 +8212,24 @@ bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu) · 892 unmodified lines
82188212 kvm_x86_ops->interrupt_allowed(vcpu);
82198213 }
82208214
8215+void kvm_arch_start_assignment(struct kvm *kvm)
8216+{
8217+ atomic_inc(&kvm->arch.assigned_device_count);
8218+}
8219+EXPORT_SYMBOL_GPL(kvm_arch_start_assignment);
8220+
8221+void kvm_arch_end_assignment(struct kvm *kvm)
8222+{
8223+ atomic_dec(&kvm->arch.assigned_device_count);
8224+}
8225+EXPORT_SYMBOL_GPL(kvm_arch_end_assignment);
8226+
8227+bool kvm_arch_has_assigned_device(struct kvm *kvm)
8228+{
8229+ return atomic_read(&kvm->arch.assigned_device_count);
8230+}
8231+EXPORT_SYMBOL_GPL(kvm_arch_has_assigned_device);
8232+
82218233 void kvm_arch_register_noncoherent_dma(struct kvm *kvm)
82228234 {
82238235 atomic_inc(&kvm->arch.noncoherent_dma_count);
arch/xtensa/include/asm/Kbuild+1−0
@@ -19,6 +19,7 @@ generic-y += linkage.h · 18 unmodified lines
1919 generic-y += local.h
2020 generic-y += local64.h
2121 generic-y += mcs_spinlock.h
22+generic-y += mm-arch-hooks.h
2223 generic-y += percpu.h
2324 generic-y += preempt.h
2425 generic-y += resource.h
arch/xtensa/include/asm/mm-arch-hooks.h+0−15
@@ -1,15 +0,0 @@
1−/*
2− * Architecture specific mm hooks
3− *
4− * Copyright (C) 2015, IBM Corporation
5− * Author: Laurent Dufour <ldufour@linux.vnet.ibm.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#ifndef _ASM_XTENSA_MM_ARCH_HOOKS_H
13−#define _ASM_XTENSA_MM_ARCH_HOOKS_H
14−
15−#endif /* _ASM_XTENSA_MM_ARCH_HOOKS_H */
block/bio-integrity.c+2−2
@@ -51,7 +51,7 @@ struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio, · 50 unmodified lines
5151 unsigned long idx = BIO_POOL_NONE;
5252 unsigned inline_vecs;
5353
54− if (!bs) {
54+ if (!bs || !bs->bio_integrity_pool) {
5555 bip = kmalloc(sizeof(struct bio_integrity_payload) +
5656 sizeof(struct bio_vec) * nr_vecs, gfp_mask);
5757 inline_vecs = nr_vecs;
@@ -104,7 +104,7 @@ void bio_integrity_free(struct bio *bio) · 46 unmodified lines
104104 kfree(page_address(bip->bip_vec->bv_page) +
105105 bip->bip_vec->bv_offset);
106106
107− if (bs) {
107+ if (bs && bs->bio_integrity_pool) {
108108 if (bip->bip_slab != BIO_POOL_NONE)
109109 bvec_free(bs->bvec_integrity_pool, bip->bip_vec,
110110 bip->bip_slab);
block/blk-cgroup.c+81−59
@@ -29,6 +29,14 @@ · 28 unmodified lines
2929
3030 #define MAX_KEY_LEN 100
3131
32+/*
33+ * blkcg_pol_mutex protects blkcg_policy[] and policy [de]activation.
34+ * blkcg_pol_register_mutex nests outside of it and synchronizes entire
35+ * policy [un]register operations including cgroup file additions /
36+ * removals. Putting cgroup file registration outside blkcg_pol_mutex
37+ * allows grabbing it from cgroup callbacks.
38+ */
39+static DEFINE_MUTEX(blkcg_pol_register_mutex);
3240 static DEFINE_MUTEX(blkcg_pol_mutex);
3341
3442 struct blkcg blkcg_root;
@@ -38,6 +46,8 @@ struct cgroup_subsys_state * const blkcg_root_css = &blkcg_root.css; · 3 unmodified lines
3846
3947 static struct blkcg_policy *blkcg_policy[BLKCG_MAX_POLS];
4048
49+static LIST_HEAD(all_blkcgs); /* protected by blkcg_pol_mutex */
50+
4151 static bool blkcg_policy_enabled(struct request_queue *q,
4252 const struct blkcg_policy *pol)
4353 {
@@ -453,20 +463,7 @@ static int blkcg_reset_stats(struct cgroup_subsys_state *css, · 409 unmodified lines
453463 struct blkcg_gq *blkg;
454464 int i;
455465
456− /*
457− * XXX: We invoke cgroup_add/rm_cftypes() under blkcg_pol_mutex
458− * which ends up putting cgroup's internal cgroup_tree_mutex under
459− * it; however, cgroup_tree_mutex is nested above cgroup file
460− * active protection and grabbing blkcg_pol_mutex from a cgroup
461− * file operation creates a possible circular dependency. cgroup
462− * internal locking is planned to go through further simplification
463− * and this issue should go away soon. For now, let's trylock
464− * blkcg_pol_mutex and restart the write on failure.
465− *
466− * http://lkml.kernel.org/g/5363C04B.4010400@oracle.com
467− */
468− if (!mutex_trylock(&blkcg_pol_mutex))
469− return restart_syscall();
466+ mutex_lock(&blkcg_pol_mutex);
470467 spin_lock_irq(&blkcg->lock);
471468
472469 /*
@@ -822,8 +819,17 @@ static void blkcg_css_free(struct cgroup_subsys_state *css) · 349 unmodified lines
822819 {
823820 struct blkcg *blkcg = css_to_blkcg(css);
824821
825− if (blkcg != &blkcg_root)
822+ mutex_lock(&blkcg_pol_mutex);
823+ list_del(&blkcg->all_blkcgs_node);
824+ mutex_unlock(&blkcg_pol_mutex);
825+
826+ if (blkcg != &blkcg_root) {
827+ int i;
828+
829+ for (i = 0; i < BLKCG_MAX_POLS; i++)
830+ kfree(blkcg->pd[i]);
826831 kfree(blkcg);
832+ }
827833 }
828834
829835 static struct cgroup_subsys_state *
@@ -833,6 +839,8 @@ blkcg_css_alloc(struct cgroup_subsys_state *parent_css) · 3 unmodified lines
833839 struct cgroup_subsys_state *ret;
834840 int i;
835841
842+ mutex_lock(&blkcg_pol_mutex);
843+
836844 if (!parent_css) {
837845 blkcg = &blkcg_root;
838846 goto done;
@@ -875,14 +883,17 @@ done: · 36 unmodified lines
875883 #ifdef CONFIG_CGROUP_WRITEBACK
876884 INIT_LIST_HEAD(&blkcg->cgwb_list);
877885 #endif
886+ list_add_tail(&blkcg->all_blkcgs_node, &all_blkcgs);
887+
888+ mutex_unlock(&blkcg_pol_mutex);
878889 return &blkcg->css;
879890
880891 free_pd_blkcg:
881892 for (i--; i >= 0; i--)
882893 kfree(blkcg->pd[i]);
883−
884894 free_blkcg:
885895 kfree(blkcg);
896+ mutex_unlock(&blkcg_pol_mutex);
886897 return ret;
887898 }
888899
@@ -1037,10 +1048,8 @@ int blkcg_activate_policy(struct request_queue *q, · 148 unmodified lines
10371048 const struct blkcg_policy *pol)
10381049 {
10391050 LIST_HEAD(pds);
1040− LIST_HEAD(cpds);
10411051 struct blkcg_gq *blkg;
10421052 struct blkg_policy_data *pd, *nd;
1043− struct blkcg_policy_data *cpd, *cnd;
10441053 int cnt = 0, ret;
10451054
10461055 if (blkcg_policy_enabled(q, pol))
@@ -1053,10 +1062,7 @@ int blkcg_activate_policy(struct request_queue *q, · 6 unmodified lines
10531062 cnt++;
10541063 spin_unlock_irq(q->queue_lock);
10551064
1056− /*
1057− * Allocate per-blkg and per-blkcg policy data
1058− * for all existing blkgs.
1059− */
1065+ /* allocate per-blkg policy data for all existing blkgs */
10601066 while (cnt--) {
10611067 pd = kzalloc_node(pol->pd_size, GFP_KERNEL, q->node);
10621068 if (!pd) {
@@ -1064,15 +1070,6 @@ int blkcg_activate_policy(struct request_queue *q, · 1 unmodified line
10641070 goto out_free;
10651071 }
10661072 list_add_tail(&pd->alloc_node, &pds);
1067−
1068− if (!pol->cpd_size)
1069− continue;
1070− cpd = kzalloc_node(pol->cpd_size, GFP_KERNEL, q->node);
1071− if (!cpd) {
1072− ret = -ENOMEM;
1073− goto out_free;
1074− }
1075− list_add_tail(&cpd->alloc_node, &cpds);
10761073 }
10771074
10781075 /*
@@ -1082,32 +1079,17 @@ int blkcg_activate_policy(struct request_queue *q, · 3 unmodified lines
10821079 spin_lock_irq(q->queue_lock);
10831080
10841081 list_for_each_entry(blkg, &q->blkg_list, q_node) {
1085− if (WARN_ON(list_empty(&pds)) ||
1086− WARN_ON(pol->cpd_size && list_empty(&cpds))) {
1082+ if (WARN_ON(list_empty(&pds))) {
10871083 /* umm... this shouldn't happen, just abort */
10881084 ret = -ENOMEM;
10891085 goto out_unlock;
10901086 }
1091− cpd = list_first_entry(&cpds, struct blkcg_policy_data,
1092− alloc_node);
1093− list_del_init(&cpd->alloc_node);
10941087 pd = list_first_entry(&pds, struct blkg_policy_data, alloc_node);
10951088 list_del_init(&pd->alloc_node);
10961089
10971090 /* grab blkcg lock too while installing @pd on @blkg */
10981091 spin_lock(&blkg->blkcg->lock);
10991092
1100− if (!pol->cpd_size)
1101− goto no_cpd;
1102− if (!blkg->blkcg->pd[pol->plid]) {
1103− /* Per-policy per-blkcg data */
1104− blkg->blkcg->pd[pol->plid] = cpd;
1105− cpd->plid = pol->plid;
1106− pol->cpd_init_fn(blkg->blkcg);
1107− } else { /* must free it as it has already been extracted */
1108− kfree(cpd);
1109− }
1110−no_cpd:
11111093 blkg->pd[pol->plid] = pd;
11121094 pd->blkg = blkg;
11131095 pd->plid = pol->plid;
@@ -1124,8 +1106,6 @@ out_free: · 10 unmodified lines
11241106 blk_queue_bypass_end(q);
11251107 list_for_each_entry_safe(pd, nd, &pds, alloc_node)
11261108 kfree(pd);
1127− list_for_each_entry_safe(cpd, cnd, &cpds, alloc_node)
1128− kfree(cpd);
11291109 return ret;
11301110 }
11311111 EXPORT_SYMBOL_GPL(blkcg_activate_policy);
@@ -1162,8 +1142,6 @@ void blkcg_deactivate_policy(struct request_queue *q, · 30 unmodified lines
11621142
11631143 kfree(blkg->pd[pol->plid]);
11641144 blkg->pd[pol->plid] = NULL;
1165− kfree(blkg->blkcg->pd[pol->plid]);
1166− blkg->blkcg->pd[pol->plid] = NULL;
11671145
11681146 spin_unlock(&blkg->blkcg->lock);
11691147 }
@@ -1182,11 +1160,13 @@ EXPORT_SYMBOL_GPL(blkcg_deactivate_policy); · 12 unmodified lines
11821160 */
11831161 int blkcg_policy_register(struct blkcg_policy *pol)
11841162 {
1163+ struct blkcg *blkcg;
11851164 int i, ret;
11861165
11871166 if (WARN_ON(pol->pd_size < sizeof(struct blkg_policy_data)))
11881167 return -EINVAL;
11891168
1169+ mutex_lock(&blkcg_pol_register_mutex);
11901170 mutex_lock(&blkcg_pol_mutex);
11911171
11921172 /* find an empty slot */
@@ -1195,19 +1175,49 @@ int blkcg_policy_register(struct blkcg_policy *pol) · 2 unmodified lines
11951175 if (!blkcg_policy[i])
11961176 break;
11971177 if (i >= BLKCG_MAX_POLS)
1198− goto out_unlock;
1178+ goto err_unlock;
11991179
1200− /* register and update blkgs */
1180+ /* register @pol */
12011181 pol->plid = i;
1202− blkcg_policy[i] = pol;
1182+ blkcg_policy[pol->plid] = pol;
1183+
1184+ /* allocate and install cpd's */
1185+ if (pol->cpd_size) {
1186+ list_for_each_entry(blkcg, &all_blkcgs, all_blkcgs_node) {
1187+ struct blkcg_policy_data *cpd;
1188+
1189+ cpd = kzalloc(pol->cpd_size, GFP_KERNEL);
1190+ if (!cpd) {
1191+ mutex_unlock(&blkcg_pol_mutex);
1192+ goto err_free_cpds;
1193+ }
1194+
1195+ blkcg->pd[pol->plid] = cpd;
1196+ cpd->plid = pol->plid;
1197+ pol->cpd_init_fn(blkcg);
1198+ }
1199+ }
1200+
1201+ mutex_unlock(&blkcg_pol_mutex);
12031202
12041203 /* everything is in place, add intf files for the new policy */
12051204 if (pol->cftypes)
12061205 WARN_ON(cgroup_add_legacy_cftypes(&blkio_cgrp_subsys,
12071206 pol->cftypes));
1208− ret = 0;
1209−out_unlock:
1207+ mutex_unlock(&blkcg_pol_register_mutex);
1208+ return 0;
1209+
1210+err_free_cpds:
1211+ if (pol->cpd_size) {
1212+ list_for_each_entry(blkcg, &all_blkcgs, all_blkcgs_node) {
1213+ kfree(blkcg->pd[pol->plid]);
1214+ blkcg->pd[pol->plid] = NULL;
1215+ }
1216+ }
1217+ blkcg_policy[pol->plid] = NULL;
1218+err_unlock:
12101219 mutex_unlock(&blkcg_pol_mutex);
1220+ mutex_unlock(&blkcg_pol_register_mutex);
12111221 return ret;
12121222 }
12131223 EXPORT_SYMBOL_GPL(blkcg_policy_register);
@@ -1220,7 +1230,9 @@ EXPORT_SYMBOL_GPL(blkcg_policy_register); · 6 unmodified lines
12201230 */
12211231 void blkcg_policy_unregister(struct blkcg_policy *pol)
12221232 {
1223− mutex_lock(&blkcg_pol_mutex);
1233+ struct blkcg *blkcg;
1234+
1235+ mutex_lock(&blkcg_pol_register_mutex);
12241236
12251237 if (WARN_ON(blkcg_policy[pol->plid] != pol))
12261238 goto out_unlock;
@@ -1229,9 +1241,19 @@ void blkcg_policy_unregister(struct blkcg_policy *pol) · 2 unmodified lines
12291241 if (pol->cftypes)
12301242 cgroup_rm_cftypes(pol->cftypes);
12311243
1232− /* unregister and update blkgs */
1244+ /* remove cpds and unregister */
1245+ mutex_lock(&blkcg_pol_mutex);
1246+
1247+ if (pol->cpd_size) {
1248+ list_for_each_entry(blkcg, &all_blkcgs, all_blkcgs_node) {
1249+ kfree(blkcg->pd[pol->plid]);
1250+ blkcg->pd[pol->plid] = NULL;
1251+ }
1252+ }
12331253 blkcg_policy[pol->plid] = NULL;
1234−out_unlock:
1254+
12351255 mutex_unlock(&blkcg_pol_mutex);
1256+out_unlock:
1257+ mutex_unlock(&blkcg_pol_register_mutex);
12361258 }
12371259 EXPORT_SYMBOL_GPL(blkcg_policy_unregister);
block/blk-core.c+1−1
@@ -3370,7 +3370,7 @@ EXPORT_SYMBOL(blk_post_runtime_resume); · 3369 unmodified lines
33703370 int __init blk_dev_init(void)
33713371 {
33723372 BUILD_BUG_ON(__REQ_NR_BITS > 8 *
3373− sizeof(((struct request *)0)->cmd_flags));
3373+ FIELD_SIZEOF(struct request, cmd_flags));
33743374
33753375 /* used for unplugging and affects IO latency/throughput - HIGHPRI */
33763376 kblockd_workqueue = alloc_workqueue("kblockd",
block/blk-mq.c+1−1
@@ -1998,7 +1998,7 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, · 1997 unmodified lines
19981998 goto err_hctxs;
19991999
20002000 setup_timer(&q->timeout, blk_mq_rq_timer, (unsigned long) q);
2001− blk_queue_rq_timeout(q, set->timeout ? set->timeout : 30000);
2001+ blk_queue_rq_timeout(q, set->timeout ? set->timeout : 30 * HZ);
20022002
20032003 q->nr_queues = nr_cpu_ids;
20042004 q->nr_hw_queues = set->nr_hw_queues;
drivers/acpi/resource.c+15−9
@@ -193,6 +193,7 @@ static bool acpi_decode_space(struct resource_win *win, · 192 unmodified lines
193193 u8 iodec = attr->granularity == 0xfff ? ACPI_DECODE_10 : ACPI_DECODE_16;
194194 bool wp = addr->info.mem.write_protect;
195195 u64 len = attr->address_length;
196+ u64 start, end, offset = 0;
196197 struct resource *res = &win->res;
197198
198199 /*
@@ -204,9 +205,6 @@ static bool acpi_decode_space(struct resource_win *win, · 5 unmodified lines
204205 pr_debug("ACPI: Invalid address space min_addr_fix %d, max_addr_fix %d, len %llx\n",
205206 addr->min_address_fixed, addr->max_address_fixed, len);
206207
207− res->start = attr->minimum;
208− res->end = attr->maximum;
209−
210208 /*
211209 * For bridges that translate addresses across the bridge,
212210 * translation_offset is the offset that must be added to the
@@ -214,12 +212,22 @@ static bool acpi_decode_space(struct resource_win *win, · 1 unmodified line
214212 * primary side. Non-bridge devices must list 0 for all Address
215213 * Translation offset bits.
216214 */
217− if (addr->producer_consumer == ACPI_PRODUCER) {
218− res->start += attr->translation_offset;
219− res->end += attr->translation_offset;
220− } else if (attr->translation_offset) {
215+ if (addr->producer_consumer == ACPI_PRODUCER)
216+ offset = attr->translation_offset;
217+ else if (attr->translation_offset)
221218 pr_debug("ACPI: translation_offset(%lld) is invalid for non-bridge device.\n",
222219 attr->translation_offset);
220+ start = attr->minimum + offset;
221+ end = attr->maximum + offset;
222+
223+ win->offset = offset;
224+ res->start = start;
225+ res->end = end;
226+ if (sizeof(resource_size_t) < sizeof(u64) &&
227+ (offset != win->offset || start != res->start || end != res->end)) {
228+ pr_warn("acpi resource window ([%#llx-%#llx] ignored, not CPU addressable)\n",
229+ attr->minimum, attr->maximum);
230+ return false;
223231 }
224232
225233 switch (addr->resource_type) {
@@ -236,8 +244,6 @@ static bool acpi_decode_space(struct resource_win *win, · 10 unmodified lines
236244 return false;
237245 }
238246
239− win->offset = attr->translation_offset;
240−
241247 if (addr->producer_consumer == ACPI_PRODUCER)
242248 res->flags |= IORESOURCE_WINDOW;
243249
drivers/ata/pata_arasan_cf.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Arasan Compact Flash host controller source file
55 *
66 * Copyright (C) 2011 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
@@ -968,7 +968,7 @@ static struct platform_driver arasan_cf_driver = { · 957 unmodified lines
968968
969969 module_platform_driver(arasan_cf_driver);
970970
971−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
971+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
972972 MODULE_DESCRIPTION("Arasan ATA Compact Flash driver");
973973 MODULE_LICENSE("GPL");
974974 MODULE_ALIAS("platform:" DRIVER_NAME);
drivers/block/nvme-core.c+11−2
@@ -2108,8 +2108,17 @@ static void nvme_alloc_ns(struct nvme_dev *dev, unsigned nsid) · 2107 unmodified lines
21082108 goto out_free_disk;
21092109
21102110 add_disk(ns->disk);
2111− if (ns->ms)
2112− revalidate_disk(ns->disk);
2111+ if (ns->ms) {
2112+ struct block_device *bd = bdget_disk(ns->disk, 0);
2113+ if (!bd)
2114+ return;
2115+ if (blkdev_get(bd, FMODE_READ, NULL)) {
2116+ bdput(bd);
2117+ return;
2118+ }
2119+ blkdev_reread_part(bd);
2120+ blkdev_put(bd, FMODE_READ);
2121+ }
21132122 return;
21142123 out_free_disk:
21152124 kfree(disk);
drivers/bluetooth/btbcm.c+5−6
@@ -472,12 +472,11 @@ int btbcm_setup_apple(struct hci_dev *hdev) · 471 unmodified lines
472472
473473 /* Read Verbose Config Version Info */
474474 skb = btbcm_read_verbose_config(hdev);
475− if (IS_ERR(skb))
476− return PTR_ERR(skb);
477−
478− BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name, skb->data[1],
479− get_unaligned_le16(skb->data + 5));
480− kfree_skb(skb);
475+ if (!IS_ERR(skb)) {
476+ BT_INFO("%s: BCM: chip id %u build %4.4u", hdev->name, skb->data[1],
477+ get_unaligned_le16(skb->data + 5));
478+ kfree_skb(skb);
479+ }
481480
482481 set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
483482
drivers/char/tpm/tpm-chip.c+2−1
@@ -129,8 +129,9 @@ struct tpm_chip *tpmm_chip_alloc(struct device *dev, · 128 unmodified lines
129129
130130 device_initialize(&chip->dev);
131131
132− chip->cdev.owner = chip->pdev->driver->owner;
133132 cdev_init(&chip->cdev, &tpm_fops);
133+ chip->cdev.owner = chip->pdev->driver->owner;
134+ chip->cdev.kobj.parent = &chip->dev.kobj;
134135
135136 return chip;
136137 }
drivers/char/tpm/tpm_crb.c+8−0
@@ -233,6 +233,14 @@ static int crb_acpi_add(struct acpi_device *device) · 232 unmodified lines
233233 return -ENODEV;
234234 }
235235
236+ /* At least some versions of AMI BIOS have a bug that TPM2 table has
237+ * zero address for the control area and therefore we must fail.
238+ */
239+ if (!buf->control_area_pa) {
240+ dev_err(dev, "TPM2 ACPI table has a zero address for the control area\n");
241+ return -EINVAL;
242+ }
243+
236244 if (buf->hdr.length < sizeof(struct acpi_tpm2)) {
237245 dev_err(dev, "TPM2 ACPI table has wrong size");
238246 return -EINVAL;
drivers/clk/spear/clk-aux-synth.c+1−1
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 2012 ST Microelectronics
3− * Viresh Kumar <viresh.linux@gmail.com>
3+ * Viresh Kumar <vireshk@kernel.org>
44 *
55 * This file is licensed under the terms of the GNU General Public
66 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/clk-frac-synth.c+1−1
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 2012 ST Microelectronics
3− * Viresh Kumar <viresh.linux@gmail.com>
3+ * Viresh Kumar <vireshk@kernel.org>
44 *
55 * This file is licensed under the terms of the GNU General Public
66 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/clk-gpt-synth.c+1−1
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 2012 ST Microelectronics
3− * Viresh Kumar <viresh.linux@gmail.com>
3+ * Viresh Kumar <vireshk@kernel.org>
44 *
55 * This file is licensed under the terms of the GNU General Public
66 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/clk-vco-pll.c+1−1
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 2012 ST Microelectronics
3− * Viresh Kumar <viresh.linux@gmail.com>
3+ * Viresh Kumar <vireshk@kernel.org>
44 *
55 * This file is licensed under the terms of the GNU General Public
66 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/clk.c+1−1
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) 2012 ST Microelectronics
3− * Viresh Kumar <viresh.linux@gmail.com>
3+ * Viresh Kumar <vireshk@kernel.org>
44 *
55 * This file is licensed under the terms of the GNU General Public
66 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/clk.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Clock framework definitions for SPEAr platform
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/spear1310_clock.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr1310 machine clock framework source file
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/spear1340_clock.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * SPEAr1340 machine clock framework source file
55 *
66 * Copyright (C) 2012 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/spear3xx_clock.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * SPEAr3xx machines clock framework source file
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
drivers/clk/spear/spear6xx_clock.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * SPEAr6xx machines clock framework source file
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
drivers/cpufreq/cpufreq.c+10−0
@@ -169,6 +169,15 @@ struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy) · 168 unmodified lines
169169 }
170170 EXPORT_SYMBOL_GPL(get_governor_parent_kobj);
171171
172+struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu)
173+{
174+ struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu);
175+
176+ return policy && !policy_is_inactive(policy) ?
177+ policy->freq_table : NULL;
178+}
179+EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table);
180+
172181 static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
173182 {
174183 u64 idle_time;
@@ -1132,6 +1141,7 @@ static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu) · 957 unmodified lines
11321141
11331142 down_write(&policy->rwsem);
11341143 policy->cpu = cpu;
1144+ policy->governor = NULL;
11351145 up_write(&policy->rwsem);
11361146 }
11371147
drivers/cpufreq/freq_table.c+0−9
@@ -297,15 +297,6 @@ int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, · 296 unmodified lines
297297 }
298298 EXPORT_SYMBOL_GPL(cpufreq_table_validate_and_show);
299299
300−struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu);
301−
302−struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu)
303−{
304− struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu);
305− return policy ? policy->freq_table : NULL;
306−}
307−EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table);
308−
309300 MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
310301 MODULE_DESCRIPTION("CPUfreq frequency table helpers");
311302 MODULE_LICENSE("GPL");
drivers/cpuidle/cpuidle.c+7−2
@@ -112,7 +112,12 @@ int cpuidle_find_deepest_state(struct cpuidle_driver *drv, · 111 unmodified lines
112112 static void enter_freeze_proper(struct cpuidle_driver *drv,
113113 struct cpuidle_device *dev, int index)
114114 {
115− tick_freeze();
115+ /*
116+ * trace_suspend_resume() called by tick_freeze() for the last CPU
117+ * executing it contains RCU usage regarded as invalid in the idle
118+ * context, so tell RCU about that.
119+ */
120+ RCU_NONIDLE(tick_freeze());
116121 /*
117122 * The state used here cannot be a "coupled" one, because the "coupled"
118123 * cpuidle mechanism enables interrupts and doing that with timekeeping
@@ -122,7 +127,7 @@ static void enter_freeze_proper(struct cpuidle_driver *drv, · 3 unmodified lines
122127 WARN_ON(!irqs_disabled());
123128 /*
124129 * timekeeping_resume() that will be called by tick_unfreeze() for the
125− * last CPU executing it calls functions containing RCU read-side
130+ * first CPU executing it calls functions containing RCU read-side
126131 * critical sections, so tell RCU about that.
127132 */
128133 RCU_NONIDLE(tick_unfreeze());
drivers/dma/dw/core.c+1−1
@@ -1746,4 +1746,4 @@ EXPORT_SYMBOL_GPL(dw_dma_enable); · 1745 unmodified lines
17461746 MODULE_LICENSE("GPL v2");
17471747 MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller core driver");
17481748 MODULE_AUTHOR("Haavard Skinnemoen (Atmel)");
1749−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
1749+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
drivers/gpio/gpio-brcmstb.c+11−3
@@ -87,6 +87,15 @@ static int brcmstb_gpio_remove(struct platform_device *pdev) · 86 unmodified lines
8787 struct brcmstb_gpio_bank *bank;
8888 int ret = 0;
8989
90+ if (!priv) {
91+ dev_err(&pdev->dev, "called %s without drvdata!\n", __func__);
92+ return -EFAULT;
93+ }
94+
95+ /*
96+ * You can lose return values below, but we report all errors, and it's
97+ * more important to actually perform all of the steps.
98+ */
9099 list_for_each(pos, &priv->bank_list) {
91100 bank = list_entry(pos, struct brcmstb_gpio_bank, node);
92101 ret = bgpio_remove(&bank->bgc);
@@ -143,6 +152,8 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) · 50 unmodified lines
143152 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
144153 if (!priv)
145154 return -ENOMEM;
155+ platform_set_drvdata(pdev, priv);
156+ INIT_LIST_HEAD(&priv->bank_list);
146157
147158 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
148159 reg_base = devm_ioremap_resource(dev, res);
@@ -153,7 +164,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) · 4 unmodified lines
153164 priv->reg_base = reg_base;
154165 priv->pdev = pdev;
155166
156− INIT_LIST_HEAD(&priv->bank_list);
157167 if (brcmstb_gpio_sanity_check_banks(dev, np, res))
158168 return -EINVAL;
159169
@@ -221,8 +231,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev) · 61 unmodified lines
221231 dev_info(dev, "Registered %d banks (GPIO(s): %d-%d)\n",
222232 priv->num_banks, priv->gpio_base, gpio_base - 1);
223233
224− platform_set_drvdata(pdev, priv);
225−
226234 return 0;
227235
228236 fail:
drivers/gpio/gpio-davinci.c+2−4
@@ -578,15 +578,13 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev) · 577 unmodified lines
578578 writel_relaxed(~0, &g->clr_falling);
579579 writel_relaxed(~0, &g->clr_rising);
580580
581− /* set up all irqs in this bank */
582− irq_set_chained_handler(bank_irq, gpio_irq_handler);
583−
584581 /*
585582 * Each chip handles 32 gpios, and each irq bank consists of 16
586583 * gpio irqs. Pass the irq bank's corresponding controller to
587584 * the chained irq handler.
588585 */
589− irq_set_handler_data(bank_irq, &chips[gpio / 32]);
586+ irq_set_chained_handler_and_data(bank_irq, gpio_irq_handler,
587+ &chips[gpio / 32]);
590588
591589 binten |= BIT(bank);
592590 }
drivers/gpio/gpio-max732x.c+1−0
@@ -603,6 +603,7 @@ static int max732x_setup_gpio(struct max732x_chip *chip, · 602 unmodified lines
603603 gc->base = gpio_start;
604604 gc->ngpio = port;
605605 gc->label = chip->client->name;
606+ gc->dev = &chip->client->dev;
606607 gc->owner = THIS_MODULE;
607608
608609 return port;
drivers/gpio/gpio-omap.c+4−1
@@ -500,8 +500,10 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type) · 499 unmodified lines
500500
501501 spin_lock_irqsave(&bank->lock, flags);
502502 retval = omap_set_gpio_triggering(bank, offset, type);
503− if (retval)
503+ if (retval) {
504+ spin_unlock_irqrestore(&bank->lock, flags);
504505 goto error;
506+ }
505507 omap_gpio_init_irq(bank, offset);
506508 if (!omap_gpio_is_input(bank, offset)) {
507509 spin_unlock_irqrestore(&bank->lock, flags);
@@ -1185,6 +1187,7 @@ static int omap_gpio_probe(struct platform_device *pdev) · 677 unmodified lines
11851187 bank->irq = res->start;
11861188 bank->dev = dev;
11871189 bank->chip.dev = dev;
1190+ bank->chip.owner = THIS_MODULE;
11881191 bank->dbck_flag = pdata->dbck_flag;
11891192 bank->stride = pdata->bank_stride;
11901193 bank->width = pdata->bank_width;
drivers/gpio/gpio-pca953x.c+4−0
@@ -570,6 +570,10 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, · 569 unmodified lines
570570 "could not connect irqchip to gpiochip\n");
571571 return ret;
572572 }
573+
574+ gpiochip_set_chained_irqchip(&chip->gpio_chip,
575+ &pca953x_irq_chip,
576+ client->irq, NULL);
573577 }
574578
575579 return 0;
drivers/gpio/gpio-xilinx.c+2−2
@@ -220,9 +220,9 @@ static void xgpio_save_regs(struct of_mm_gpio_chip *mm_gc) · 219 unmodified lines
220220 if (!chip->gpio_width[1])
221221 return;
222222
223− xgpio_writereg(mm_gc->regs + XGPIO_DATA_OFFSET + XGPIO_TRI_OFFSET,
223+ xgpio_writereg(mm_gc->regs + XGPIO_DATA_OFFSET + XGPIO_CHANNEL_OFFSET,
224224 chip->gpio_state[1]);
225− xgpio_writereg(mm_gc->regs + XGPIO_TRI_OFFSET + XGPIO_TRI_OFFSET,
225+ xgpio_writereg(mm_gc->regs + XGPIO_TRI_OFFSET + XGPIO_CHANNEL_OFFSET,
226226 chip->gpio_dir[1]);
227227 }
228228
drivers/gpio/gpio-zynq.c+1−0
@@ -757,6 +757,7 @@ static int zynq_gpio_remove(struct platform_device *pdev) · 756 unmodified lines
757757 gpiochip_remove(&gpio->chip);
758758 clk_disable_unprepare(gpio->clk);
759759 device_set_wakeup_capable(&pdev->dev, 0);
760+ pm_runtime_disable(&pdev->dev);
760761 return 0;
761762 }
762763
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+16−3
@@ -669,6 +669,7 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev, · 668 unmodified lines
669669 static int amdgpu_cs_dependencies(struct amdgpu_device *adev,
670670 struct amdgpu_cs_parser *p)
671671 {
672+ struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
672673 struct amdgpu_ib *ib;
673674 int i, j, r;
674675
@@ -694,6 +695,7 @@ static int amdgpu_cs_dependencies(struct amdgpu_device *adev, · 19 unmodified lines
694695 for (j = 0; j < num_deps; ++j) {
695696 struct amdgpu_fence *fence;
696697 struct amdgpu_ring *ring;
698+ struct amdgpu_ctx *ctx;
697699
698700 r = amdgpu_cs_get_ring(adev, deps[j].ip_type,
699701 deps[j].ip_instance,
@@ -701,14 +703,21 @@ static int amdgpu_cs_dependencies(struct amdgpu_device *adev, · 1 unmodified line
701703 if (r)
702704 return r;
703705
706+ ctx = amdgpu_ctx_get(fpriv, deps[j].ctx_id);
707+ if (ctx == NULL)
708+ return -EINVAL;
709+
704710 r = amdgpu_fence_recreate(ring, p->filp,
705711 deps[j].handle,
706712 &fence);
707− if (r)
713+ if (r) {
714+ amdgpu_ctx_put(ctx);
708715 return r;
716+ }
709717
710718 amdgpu_sync_fence(&ib->sync, fence);
711719 amdgpu_fence_unref(&fence);
720+ amdgpu_ctx_put(ctx);
712721 }
713722 }
714723
@@ -808,12 +817,16 @@ int amdgpu_cs_wait_ioctl(struct drm_device *dev, void *data, · 93 unmodified lines
808817
809818 r = amdgpu_cs_get_ring(adev, wait->in.ip_type, wait->in.ip_instance,
810819 wait->in.ring, &ring);
811− if (r)
820+ if (r) {
821+ amdgpu_ctx_put(ctx);
812822 return r;
823+ }
813824
814825 r = amdgpu_fence_recreate(ring, filp, wait->in.handle, &fence);
815− if (r)
826+ if (r) {
827+ amdgpu_ctx_put(ctx);
816828 return r;
829+ }
817830
818831 r = fence_wait_timeout(&fence->base, true, timeout);
819832 amdgpu_fence_unref(&fence);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+7−2
@@ -1207,10 +1207,15 @@ static int amdgpu_early_init(struct amdgpu_device *adev) · 1206 unmodified lines
12071207 } else {
12081208 if (adev->ip_blocks[i].funcs->early_init) {
12091209 r = adev->ip_blocks[i].funcs->early_init((void *)adev);
1210− if (r)
1210+ if (r == -ENOENT)
1211+ adev->ip_block_enabled[i] = false;
1212+ else if (r)
12111213 return r;
1214+ else
1215+ adev->ip_block_enabled[i] = true;
1216+ } else {
1217+ adev->ip_block_enabled[i] = true;
12121218 }
1213− adev->ip_block_enabled[i] = true;
12141219 }
12151220 }
12161221
drivers/gpu/drm/amd/amdgpu/cz_dpm.c+12−4
@@ -1679,25 +1679,31 @@ static int cz_dpm_unforce_dpm_levels(struct amdgpu_device *adev) · 1678 unmodified lines
16791679 if (ret)
16801680 return ret;
16811681
1682− DRM_INFO("DPM unforce state min=%d, max=%d.\n",
1683− pi->sclk_dpm.soft_min_clk,
1684− pi->sclk_dpm.soft_max_clk);
1682+ DRM_DEBUG("DPM unforce state min=%d, max=%d.\n",
1683+ pi->sclk_dpm.soft_min_clk,
1684+ pi->sclk_dpm.soft_max_clk);
16851685
16861686 return 0;
16871687 }
16881688
16891689 static int cz_dpm_force_dpm_level(struct amdgpu_device *adev,
1690− enum amdgpu_dpm_forced_level level)
1690+ enum amdgpu_dpm_forced_level level)
16911691 {
16921692 int ret = 0;
16931693
16941694 switch (level) {
16951695 case AMDGPU_DPM_FORCED_LEVEL_HIGH:
1696+ ret = cz_dpm_unforce_dpm_levels(adev);
1697+ if (ret)
1698+ return ret;
16961699 ret = cz_dpm_force_highest(adev);
16971700 if (ret)
16981701 return ret;
16991702 break;
17001703 case AMDGPU_DPM_FORCED_LEVEL_LOW:
1704+ ret = cz_dpm_unforce_dpm_levels(adev);
1705+ if (ret)
1706+ return ret;
17011707 ret = cz_dpm_force_lowest(adev);
17021708 if (ret)
17031709 return ret;
@@ -1711,6 +1717,8 @@ static int cz_dpm_force_dpm_level(struct amdgpu_device *adev, · 7 unmodified lines
17111717 break;
17121718 }
17131719
1720+ adev->pm.dpm.forced_level = level;
1721+
17141722 return ret;
17151723 }
17161724
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c+4−0
@@ -2566,6 +2566,7 @@ static void dce_v8_0_crtc_dpms(struct drm_crtc *crtc, int mode) · 2565 unmodified lines
25662566 struct drm_device *dev = crtc->dev;
25672567 struct amdgpu_device *adev = dev->dev_private;
25682568 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
2569+ unsigned type;
25692570
25702571 switch (mode) {
25712572 case DRM_MODE_DPMS_ON:
@@ -2574,6 +2575,9 @@ static void dce_v8_0_crtc_dpms(struct drm_crtc *crtc, int mode) · 2 unmodified lines
25742575 dce_v8_0_vga_enable(crtc, true);
25752576 amdgpu_atombios_crtc_blank(crtc, ATOM_DISABLE);
25762577 dce_v8_0_vga_enable(crtc, false);
2578+ /* Make sure VBLANK interrupt is still enabled */
2579+ type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
2580+ amdgpu_irq_update(adev, &adev->crtc_irq, type);
25772581 drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
25782582 dce_v8_0_crtc_load_lut(crtc);
25792583 break;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+1−4
@@ -1813,10 +1813,7 @@ static u32 gfx_v8_0_get_rb_disabled(struct amdgpu_device *adev, · 1812 unmodified lines
18131813 u32 data, mask;
18141814
18151815 data = RREG32(mmCC_RB_BACKEND_DISABLE);
1816− if (data & 1)
1817− data &= CC_RB_BACKEND_DISABLE__BACKEND_DISABLE_MASK;
1818− else
1819− data = 0;
1816+ data &= CC_RB_BACKEND_DISABLE__BACKEND_DISABLE_MASK;
18201817
18211818 data |= RREG32(mmGC_USER_RB_BACKEND_DISABLE);
18221819
drivers/gpu/drm/amd/amdgpu/vi.c+33−2
@@ -122,6 +122,32 @@ static void vi_smc_wreg(struct amdgpu_device *adev, u32 reg, u32 v) · 121 unmodified lines
122122 spin_unlock_irqrestore(&adev->smc_idx_lock, flags);
123123 }
124124
125+/* smu_8_0_d.h */
126+#define mmMP0PUB_IND_INDEX 0x180
127+#define mmMP0PUB_IND_DATA 0x181
128+
129+static u32 cz_smc_rreg(struct amdgpu_device *adev, u32 reg)
130+{
131+ unsigned long flags;
132+ u32 r;
133+
134+ spin_lock_irqsave(&adev->smc_idx_lock, flags);
135+ WREG32(mmMP0PUB_IND_INDEX, (reg));
136+ r = RREG32(mmMP0PUB_IND_DATA);
137+ spin_unlock_irqrestore(&adev->smc_idx_lock, flags);
138+ return r;
139+}
140+
141+static void cz_smc_wreg(struct amdgpu_device *adev, u32 reg, u32 v)
142+{
143+ unsigned long flags;
144+
145+ spin_lock_irqsave(&adev->smc_idx_lock, flags);
146+ WREG32(mmMP0PUB_IND_INDEX, (reg));
147+ WREG32(mmMP0PUB_IND_DATA, (v));
148+ spin_unlock_irqrestore(&adev->smc_idx_lock, flags);
149+}
150+
125151 static u32 vi_uvd_ctx_rreg(struct amdgpu_device *adev, u32 reg)
126152 {
127153 unsigned long flags;
@@ -1222,8 +1248,13 @@ static int vi_common_early_init(void *handle) · 1094 unmodified lines
12221248 bool smc_enabled = false;
12231249 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
12241250
1225− adev->smc_rreg = &vi_smc_rreg;
1226− adev->smc_wreg = &vi_smc_wreg;
1251+ if (adev->flags & AMDGPU_IS_APU) {
1252+ adev->smc_rreg = &cz_smc_rreg;
1253+ adev->smc_wreg = &cz_smc_wreg;
1254+ } else {
1255+ adev->smc_rreg = &vi_smc_rreg;
1256+ adev->smc_wreg = &vi_smc_wreg;
1257+ }
12271258 adev->pcie_rreg = &vi_pcie_rreg;
12281259 adev->pcie_wreg = &vi_pcie_wreg;
12291260 adev->uvd_ctx_rreg = &vi_uvd_ctx_rreg;
drivers/gpu/drm/armada/armada_crtc.c+0−2
@@ -531,8 +531,6 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc, · 530 unmodified lines
531531
532532 drm_crtc_vblank_off(crtc);
533533
534− crtc->mode = *adj;
535−
536534 val = dcrtc->dumb_ctrl & ~CFG_DUMB_ENA;
537535 if (val != dcrtc->dumb_ctrl) {
538536 dcrtc->dumb_ctrl = val;
drivers/gpu/drm/armada/armada_gem.c+3−2
@@ -69,8 +69,9 @@ void armada_gem_free_object(struct drm_gem_object *obj) · 68 unmodified lines
6969
7070 if (dobj->obj.import_attach) {
7171 /* We only ever display imported data */
72− dma_buf_unmap_attachment(dobj->obj.import_attach, dobj->sgt,
73− DMA_TO_DEVICE);
72+ if (dobj->sgt)
73+ dma_buf_unmap_attachment(dobj->obj.import_attach,
74+ dobj->sgt, DMA_TO_DEVICE);
7475 drm_prime_gem_destroy(&dobj->obj, NULL);
7576 }
7677
drivers/gpu/drm/armada/armada_overlay.c+75−46
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 * published by the Free Software Foundation.
88 */
99 #include <drm/drmP.h>
10+#include <drm/drm_plane_helper.h>
1011 #include "armada_crtc.h"
1112 #include "armada_drm.h"
1213 #include "armada_fb.h"
@@ -85,16 +86,8 @@ static void armada_plane_vbl(struct armada_crtc *dcrtc, void *data) · 72 unmodified lines
8586
8687 if (fb)
8788 armada_drm_queue_unref_work(dcrtc->crtc.dev, fb);
88−}
8989
90−static unsigned armada_limit(int start, unsigned size, unsigned max)
91−{
92− int end = start + size;
93− if (end < 0)
94− return 0;
95− if (start < 0)
96− start = 0;
97− return (unsigned)end > max ? max - start : end - start;
90+ wake_up(&dplane->vbl.wait);
9891 }
9992
10093 static int
@@ -105,26 +98,39 @@ armada_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, · 4 unmodified lines
10598 {
10699 struct armada_plane *dplane = drm_to_armada_plane(plane);
107100 struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
101+ struct drm_rect src = {
102+ .x1 = src_x,
103+ .y1 = src_y,
104+ .x2 = src_x + src_w,
105+ .y2 = src_y + src_h,
106+ };
107+ struct drm_rect dest = {
108+ .x1 = crtc_x,
109+ .y1 = crtc_y,
110+ .x2 = crtc_x + crtc_w,
111+ .y2 = crtc_y + crtc_h,
112+ };
113+ const struct drm_rect clip = {
114+ .x2 = crtc->mode.hdisplay,
115+ .y2 = crtc->mode.vdisplay,
116+ };
108117 uint32_t val, ctrl0;
109118 unsigned idx = 0;
119+ bool visible;
110120 int ret;
111121
112− crtc_w = armada_limit(crtc_x, crtc_w, dcrtc->crtc.mode.hdisplay);
113− crtc_h = armada_limit(crtc_y, crtc_h, dcrtc->crtc.mode.vdisplay);
122+ ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip,
123+ 0, INT_MAX, true, false, &visible);
124+ if (ret)
125+ return ret;
126+
114127 ctrl0 = CFG_DMA_FMT(drm_fb_to_armada_fb(fb)->fmt) |
115128 CFG_DMA_MOD(drm_fb_to_armada_fb(fb)->mod) |
116129 CFG_CBSH_ENA | CFG_DMA_HSMOOTH | CFG_DMA_ENA;
117130
118131 /* Does the position/size result in nothing to display? */
119− if (crtc_w == 0 || crtc_h == 0) {
132+ if (!visible)
120133 ctrl0 &= ~CFG_DMA_ENA;
121− }
122−
123− /*
124− * FIXME: if the starting point is off screen, we need to
125− * adjust src_x, src_y, src_w, src_h appropriately, and
126− * according to the scale.
127− */
128134
129135 if (!dcrtc->plane) {
130136 dcrtc->plane = plane;
@@ -134,15 +140,19 @@ armada_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, · 3 unmodified lines
134140 /* FIXME: overlay on an interlaced display */
135141 /* Just updating the position/size? */
136142 if (plane->fb == fb && dplane->ctrl0 == ctrl0) {
137− val = (src_h & 0xffff0000) | src_w >> 16;
143+ val = (drm_rect_height(&src) & 0xffff0000) |
144+ drm_rect_width(&src) >> 16;
138145 dplane->src_hw = val;
139146 writel_relaxed(val, dcrtc->base + LCD_SPU_DMA_HPXL_VLN);
140− val = crtc_h << 16 | crtc_w;
147+
148+ val = drm_rect_height(&dest) << 16 | drm_rect_width(&dest);
141149 dplane->dst_hw = val;
142150 writel_relaxed(val, dcrtc->base + LCD_SPU_DZM_HPXL_VLN);
143− val = crtc_y << 16 | crtc_x;
151+
152+ val = dest.y1 << 16 | dest.x1;
144153 dplane->dst_yx = val;
145154 writel_relaxed(val, dcrtc->base + LCD_SPU_DMA_OVSA_HPXL_VLN);
155+
146156 return 0;
147157 } else if (~dplane->ctrl0 & ctrl0 & CFG_DMA_ENA) {
148158 /* Power up the Y/U/V FIFOs on ENA 0->1 transitions */
@@ -150,15 +160,14 @@ armada_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, · 1 unmodified line
150160 dcrtc->base + LCD_SPU_SRAM_PARA1);
151161 }
152162
153− ret = wait_event_timeout(dplane->vbl.wait,
154− list_empty(&dplane->vbl.update.node),
155− HZ/25);
156− if (ret < 0)
157− return ret;
163+ wait_event_timeout(dplane->vbl.wait,
164+ list_empty(&dplane->vbl.update.node),
165+ HZ/25);
158166
159167 if (plane->fb != fb) {
160168 struct armada_gem_object *obj = drm_fb_obj(fb);
161− uint32_t sy, su, sv;
169+ uint32_t addr[3], pixel_format;
170+ int i, num_planes, hsub;
162171
163172 /*
164173 * Take a reference on the new framebuffer - we want to
@@ -178,26 +187,39 @@ armada_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, · 13 unmodified lines
178187 older_fb);
179188 }
180189
181− src_y >>= 16;
182− src_x >>= 16;
183− sy = obj->dev_addr + fb->offsets[0] + src_y * fb->pitches[0] +
184− src_x * fb->bits_per_pixel / 8;
185− su = obj->dev_addr + fb->offsets[1] + src_y * fb->pitches[1] +
186− src_x;
187− sv = obj->dev_addr + fb->offsets[2] + src_y * fb->pitches[2] +
188− src_x;
190+ src_y = src.y1 >> 16;
191+ src_x = src.x1 >> 16;
189192
190− armada_reg_queue_set(dplane->vbl.regs, idx, sy,
193+ pixel_format = fb->pixel_format;
194+ hsub = drm_format_horz_chroma_subsampling(pixel_format);
195+ num_planes = drm_format_num_planes(pixel_format);
196+
197+ /*
198+ * Annoyingly, shifting a YUYV-format image by one pixel
199+ * causes the U/V planes to toggle. Toggle the UV swap.
200+ * (Unfortunately, this causes momentary colour flickering.)
201+ */
202+ if (src_x & (hsub - 1) && num_planes == 1)
203+ ctrl0 ^= CFG_DMA_MOD(CFG_SWAPUV);
204+
205+ for (i = 0; i < num_planes; i++)
206+ addr[i] = obj->dev_addr + fb->offsets[i] +
207+ src_y * fb->pitches[i] +
208+ src_x * drm_format_plane_cpp(pixel_format, i);
209+ for (; i < ARRAY_SIZE(addr); i++)
210+ addr[i] = 0;
211+
212+ armada_reg_queue_set(dplane->vbl.regs, idx, addr[0],
191213 LCD_SPU_DMA_START_ADDR_Y0);
192− armada_reg_queue_set(dplane->vbl.regs, idx, su,
214+ armada_reg_queue_set(dplane->vbl.regs, idx, addr[1],
193215 LCD_SPU_DMA_START_ADDR_U0);
194− armada_reg_queue_set(dplane->vbl.regs, idx, sv,
216+ armada_reg_queue_set(dplane->vbl.regs, idx, addr[2],
195217 LCD_SPU_DMA_START_ADDR_V0);
196− armada_reg_queue_set(dplane->vbl.regs, idx, sy,
218+ armada_reg_queue_set(dplane->vbl.regs, idx, addr[0],
197219 LCD_SPU_DMA_START_ADDR_Y1);
198− armada_reg_queue_set(dplane->vbl.regs, idx, su,
220+ armada_reg_queue_set(dplane->vbl.regs, idx, addr[1],
199221 LCD_SPU_DMA_START_ADDR_U1);
200− armada_reg_queue_set(dplane->vbl.regs, idx, sv,
222+ armada_reg_queue_set(dplane->vbl.regs, idx, addr[2],
201223 LCD_SPU_DMA_START_ADDR_V1);
202224
203225 val = fb->pitches[0] << 16 | fb->pitches[0];
@@ -208,24 +230,27 @@ armada_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, · 4 unmodified lines
208230 LCD_SPU_DMA_PITCH_UV);
209231 }
210232
211− val = (src_h & 0xffff0000) | src_w >> 16;
233+ val = (drm_rect_height(&src) & 0xffff0000) | drm_rect_width(&src) >> 16;
212234 if (dplane->src_hw != val) {
213235 dplane->src_hw = val;
214236 armada_reg_queue_set(dplane->vbl.regs, idx, val,
215237 LCD_SPU_DMA_HPXL_VLN);
216238 }
217− val = crtc_h << 16 | crtc_w;
239+
240+ val = drm_rect_height(&dest) << 16 | drm_rect_width(&dest);
218241 if (dplane->dst_hw != val) {
219242 dplane->dst_hw = val;
220243 armada_reg_queue_set(dplane->vbl.regs, idx, val,
221244 LCD_SPU_DZM_HPXL_VLN);
222245 }
223− val = crtc_y << 16 | crtc_x;
246+
247+ val = dest.y1 << 16 | dest.x1;
224248 if (dplane->dst_yx != val) {
225249 dplane->dst_yx = val;
226250 armada_reg_queue_set(dplane->vbl.regs, idx, val,
227251 LCD_SPU_DMA_OVSA_HPXL_VLN);
228252 }
253+
229254 if (dplane->ctrl0 != ctrl0) {
230255 dplane->ctrl0 = ctrl0;
231256 armada_reg_queue_mod(dplane->vbl.regs, idx, ctrl0,
@@ -279,7 +304,11 @@ static int armada_plane_disable(struct drm_plane *plane) · 47 unmodified lines
279304
280305 static void armada_plane_destroy(struct drm_plane *plane)
281306 {
282− kfree(plane);
307+ struct armada_plane *dplane = drm_to_armada_plane(plane);
308+
309+ drm_plane_cleanup(plane);
310+
311+ kfree(dplane);
283312 }
284313
285314 static int armada_plane_set_property(struct drm_plane *plane,
drivers/gpu/drm/drm_crtc.c+5−2
@@ -2706,8 +2706,11 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, · 2705 unmodified lines
27062706 if (!drm_core_check_feature(dev, DRIVER_MODESET))
27072707 return -EINVAL;
27082708
2709− /* For some reason crtc x/y offsets are signed internally. */
2710− if (crtc_req->x > INT_MAX || crtc_req->y > INT_MAX)
2709+ /*
2710+ * Universal plane src offsets are only 16.16, prevent havoc for
2711+ * drivers using universal plane code internally.
2712+ */
2713+ if (crtc_req->x & 0xffff0000 || crtc_req->y & 0xffff0000)
27112714 return -ERANGE;
27122715
27132716 drm_modeset_lock_all(dev);
drivers/gpu/drm/drm_ioc32.c+60−0
@@ -70,6 +70,8 @@ · 69 unmodified lines
7070
7171 #define DRM_IOCTL_WAIT_VBLANK32 DRM_IOWR(0x3a, drm_wait_vblank32_t)
7272
73+#define DRM_IOCTL_MODE_ADDFB232 DRM_IOWR(0xb8, drm_mode_fb_cmd232_t)
74+
7375 typedef struct drm_version_32 {
7476 int version_major; /**< Major version */
7577 int version_minor; /**< Minor version */
@@ -1016,6 +1018,63 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, · 940 unmodified lines
10161018 return 0;
10171019 }
10181020
1021+typedef struct drm_mode_fb_cmd232 {
1022+ u32 fb_id;
1023+ u32 width;
1024+ u32 height;
1025+ u32 pixel_format;
1026+ u32 flags;
1027+ u32 handles[4];
1028+ u32 pitches[4];
1029+ u32 offsets[4];
1030+ u64 modifier[4];
1031+} __attribute__((packed)) drm_mode_fb_cmd232_t;
1032+
1033+static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd,
1034+ unsigned long arg)
1035+{
1036+ struct drm_mode_fb_cmd232 __user *argp = (void __user *)arg;
1037+ struct drm_mode_fb_cmd232 req32;
1038+ struct drm_mode_fb_cmd2 __user *req64;
1039+ int i;
1040+ int err;
1041+
1042+ if (copy_from_user(&req32, argp, sizeof(req32)))
1043+ return -EFAULT;
1044+
1045+ req64 = compat_alloc_user_space(sizeof(*req64));
1046+
1047+ if (!access_ok(VERIFY_WRITE, req64, sizeof(*req64))
1048+ || __put_user(req32.width, &req64->width)
1049+ || __put_user(req32.height, &req64->height)
1050+ || __put_user(req32.pixel_format, &req64->pixel_format)
1051+ || __put_user(req32.flags, &req64->flags))
1052+ return -EFAULT;
1053+
1054+ for (i = 0; i < 4; i++) {
1055+ if (__put_user(req32.handles[i], &req64->handles[i]))
1056+ return -EFAULT;
1057+ if (__put_user(req32.pitches[i], &req64->pitches[i]))
1058+ return -EFAULT;
1059+ if (__put_user(req32.offsets[i], &req64->offsets[i]))
1060+ return -EFAULT;
1061+ if (__put_user(req32.modifier[i], &req64->modifier[i]))
1062+ return -EFAULT;
1063+ }
1064+
1065+ err = drm_ioctl(file, DRM_IOCTL_MODE_ADDFB2, (unsigned long)req64);
1066+ if (err)
1067+ return err;
1068+
1069+ if (__get_user(req32.fb_id, &req64->fb_id))
1070+ return -EFAULT;
1071+
1072+ if (copy_to_user(argp, &req32, sizeof(req32)))
1073+ return -EFAULT;
1074+
1075+ return 0;
1076+}
1077+
10191078 static drm_ioctl_compat_t *drm_compat_ioctls[] = {
10201079 [DRM_IOCTL_NR(DRM_IOCTL_VERSION32)] = compat_drm_version,
10211080 [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE32)] = compat_drm_getunique,
@@ -1048,6 +1107,7 @@ static drm_ioctl_compat_t *drm_compat_ioctls[] = { · 26 unmodified lines
10481107 [DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw,
10491108 #endif
10501109 [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank,
1110+ [DRM_IOCTL_NR(DRM_IOCTL_MODE_ADDFB232)] = compat_drm_mode_addfb2,
10511111 };
10521112
10531113 /**
drivers/gpu/drm/i915/i915_drv.h+3−3
@@ -826,6 +826,7 @@ struct intel_context { · 825 unmodified lines
826826 struct kref ref;
827827 int user_handle;
828828 uint8_t remap_slice;
829+ struct drm_i915_private *i915;
829830 struct drm_i915_file_private *file_priv;
830831 struct i915_ctx_hang_stats hang_stats;
831832 struct i915_hw_ppgtt *ppgtt;
@@ -2036,8 +2037,6 @@ struct drm_i915_gem_object { · 1204 unmodified lines
20362037 unsigned int cache_level:3;
20372038 unsigned int cache_dirty:1;
20382039
2039− unsigned int has_dma_mapping:1;
2040−
20412040 unsigned int frontbuffer_bits:INTEL_FRONTBUFFER_BITS;
20422041
20432042 unsigned int pin_display;
@@ -3116,7 +3115,8 @@ void i915_debugfs_cleanup(struct drm_minor *minor); · 1072 unmodified lines
31163115 int i915_debugfs_connector_add(struct drm_connector *connector);
31173116 void intel_display_crc_init(struct drm_device *dev);
31183117 #else
3119−static inline int i915_debugfs_connector_add(struct drm_connector *connector) {}
3118+static inline int i915_debugfs_connector_add(struct drm_connector *connector)
3119+{ return 0; }
31203120 static inline void intel_display_crc_init(struct drm_device *dev) {}
31213121 #endif
31223122
drivers/gpu/drm/i915/i915_gem.c+17−18
@@ -213,7 +213,6 @@ i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj) · 212 unmodified lines
213213 sg_dma_len(sg) = obj->base.size;
214214
215215 obj->pages = st;
216− obj->has_dma_mapping = true;
217216 return 0;
218217 }
219218
@@ -265,8 +264,6 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj) · 45 unmodified lines
265264
266265 sg_free_table(obj->pages);
267266 kfree(obj->pages);
268−
269− obj->has_dma_mapping = false;
270267 }
271268
272269 static void
@@ -2139,6 +2136,8 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj) · 1866 unmodified lines
21392136 obj->base.read_domains = obj->base.write_domain = I915_GEM_DOMAIN_CPU;
21402137 }
21412138
2139+ i915_gem_gtt_finish_object(obj);
2140+
21422141 if (i915_gem_object_needs_bit17_swizzle(obj))
21432142 i915_gem_object_save_bit_17_swizzle(obj);
21442143
@@ -2199,6 +2198,7 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) · 54 unmodified lines
21992198 struct sg_page_iter sg_iter;
22002199 struct page *page;
22012200 unsigned long last_pfn = 0; /* suppress gcc warning */
2201+ int ret;
22022202 gfp_t gfp;
22032203
22042204 /* Assert that the object is not currently in any GPU domain. As it
@@ -2246,8 +2246,10 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) · 41 unmodified lines
22462246 */
22472247 i915_gem_shrink_all(dev_priv);
22482248 page = shmem_read_mapping_page(mapping, i);
2249− if (IS_ERR(page))
2249+ if (IS_ERR(page)) {
2250+ ret = PTR_ERR(page);
22502251 goto err_pages;
2252+ }
22512253 }
22522254 #ifdef CONFIG_SWIOTLB
22532255 if (swiotlb_nr_tbl()) {
@@ -2276,6 +2278,10 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) · 22 unmodified lines
22762278 sg_mark_end(sg);
22772279 obj->pages = st;
22782280
2281+ ret = i915_gem_gtt_prepare_object(obj);
2282+ if (ret)
2283+ goto err_pages;
2284+
22792285 if (i915_gem_object_needs_bit17_swizzle(obj))
22802286 i915_gem_object_do_bit_17_swizzle(obj);
22812287
@@ -2300,10 +2306,10 @@ err_pages: · 18 unmodified lines
23002306 * space and so want to translate the error from shmemfs back to our
23012307 * usual understanding of ENOMEM.
23022308 */
2303− if (PTR_ERR(page) == -ENOSPC)
2304− return -ENOMEM;
2305− else
2306− return PTR_ERR(page);
2309+ if (ret == -ENOSPC)
2310+ ret = -ENOMEM;
2311+
2312+ return ret;
23072313 }
23082314
23092315 /* Ensure that the associated pages are gathered from the backing storage
@@ -2542,6 +2548,7 @@ int __i915_add_request(struct intel_engine_cs *ring, · 232 unmodified lines
25422548 }
25432549
25442550 request->emitted_jiffies = jiffies;
2551+ ring->last_submitted_seqno = request->seqno;
25452552 list_add_tail(&request->list, &ring->request_list);
25462553 request->file_priv = NULL;
25472554
@@ -3247,10 +3254,8 @@ int i915_vma_unbind(struct i915_vma *vma) · 699 unmodified lines
32473254
32483255 /* Since the unbound list is global, only move to that list if
32493256 * no more VMAs exist. */
3250− if (list_empty(&obj->vma_list)) {
3251− i915_gem_gtt_finish_object(obj);
3257+ if (list_empty(&obj->vma_list))
32523258 list_move_tail(&obj->global_list, &dev_priv->mm.unbound_list);
3253− }
32543259
32553260 /* And finally now the object is completely decoupled from this vma,
32563261 * we can drop its hold on the backing storage and allow it to be
@@ -3768,22 +3773,16 @@ search_free: · 511 unmodified lines
37683773 goto err_remove_node;
37693774 }
37703775
3771− ret = i915_gem_gtt_prepare_object(obj);
3772− if (ret)
3773− goto err_remove_node;
3774−
37753776 trace_i915_vma_bind(vma, flags);
37763777 ret = i915_vma_bind(vma, obj->cache_level, flags);
37773778 if (ret)
3778− goto err_finish_gtt;
3779+ goto err_remove_node;
37793780
37803781 list_move_tail(&obj->global_list, &dev_priv->mm.bound_list);
37813782 list_add_tail(&vma->mm_list, &vm->inactive_list);
37823783
37833784 return vma;
37843785
3785−err_finish_gtt:
3786− i915_gem_gtt_finish_object(obj);
37873786 err_remove_node:
37883787 drm_mm_remove_node(&vma->node);
37893788 err_free_vma:
drivers/gpu/drm/i915/i915_gem_context.c+2−2
@@ -135,8 +135,7 @@ static int get_context_size(struct drm_device *dev) · 134 unmodified lines
135135
136136 void i915_gem_context_free(struct kref *ctx_ref)
137137 {
138− struct intel_context *ctx = container_of(ctx_ref,
139− typeof(*ctx), ref);
138+ struct intel_context *ctx = container_of(ctx_ref, typeof(*ctx), ref);
140139
141140 trace_i915_context_free(ctx);
142141
@@ -195,6 +194,7 @@ __create_hw_context(struct drm_device *dev, · 52 unmodified lines
195194
196195 kref_init(&ctx->ref);
197196 list_add_tail(&ctx->link, &dev_priv->context_list);
197+ ctx->i915 = dev_priv;
198198
199199 if (dev_priv->hw_context_size) {
200200 struct drm_i915_gem_object *obj =
drivers/gpu/drm/i915/i915_gem_dmabuf.c+0−2
@@ -256,7 +256,6 @@ static int i915_gem_object_get_pages_dmabuf(struct drm_i915_gem_object *obj) · 255 unmodified lines
256256 return PTR_ERR(sg);
257257
258258 obj->pages = sg;
259− obj->has_dma_mapping = true;
260259 return 0;
261260 }
262261
@@ -264,7 +263,6 @@ static void i915_gem_object_put_pages_dmabuf(struct drm_i915_gem_object *obj) · 1 unmodified line
264263 {
265264 dma_buf_unmap_attachment(obj->base.import_attach,
266265 obj->pages, DMA_BIDIRECTIONAL);
267− obj->has_dma_mapping = false;
268266 }
269267
270268 static const struct drm_i915_gem_object_ops i915_gem_object_dmabuf_ops = {
drivers/gpu/drm/i915/i915_gem_gtt.c+2−7
@@ -1723,9 +1723,6 @@ void i915_gem_suspend_gtt_mappings(struct drm_device *dev) · 1722 unmodified lines
17231723
17241724 int i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj)
17251725 {
1726− if (obj->has_dma_mapping)
1727− return 0;
1728−
17291726 if (!dma_map_sg(&obj->base.dev->pdev->dev,
17301727 obj->pages->sgl, obj->pages->nents,
17311728 PCI_DMA_BIDIRECTIONAL))
@@ -1972,10 +1969,8 @@ void i915_gem_gtt_finish_object(struct drm_i915_gem_object *obj) · 240 unmodified lines
19721969
19731970 interruptible = do_idling(dev_priv);
19741971
1975− if (!obj->has_dma_mapping)
1976− dma_unmap_sg(&dev->pdev->dev,
1977− obj->pages->sgl, obj->pages->nents,
1978− PCI_DMA_BIDIRECTIONAL);
1972+ dma_unmap_sg(&dev->pdev->dev, obj->pages->sgl, obj->pages->nents,
1973+ PCI_DMA_BIDIRECTIONAL);
19791974
19801975 undo_idling(dev_priv, interruptible);
19811976 }
drivers/gpu/drm/i915/i915_gem_stolen.c+0−1
@@ -416,7 +416,6 @@ _i915_gem_object_create_stolen(struct drm_device *dev, · 415 unmodified lines
416416 if (obj->pages == NULL)
417417 goto cleanup;
418418
419− obj->has_dma_mapping = true;
420419 i915_gem_object_pin_pages(obj);
421420 obj->stolen = stolen;
422421
drivers/gpu/drm/i915/i915_gem_tiling.c+1−11
@@ -183,18 +183,8 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev) · 182 unmodified lines
183183 if (IS_GEN4(dev)) {
184184 uint32_t ddc2 = I915_READ(DCC2);
185185
186− if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE)) {
187− /* Since the swizzling may vary within an
188− * object, we have no idea what the swizzling
189− * is for any page in particular. Thus we
190− * cannot migrate tiled pages using the GPU,
191− * nor can we tell userspace what the exact
192− * swizzling is for any object.
193− */
186+ if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE))
194187 dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES;
195− swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
196− swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
197− }
198188 }
199189
200190 if (dcc == 0xffffffff) {
drivers/gpu/drm/i915/i915_gem_userptr.c+27−2
@@ -545,6 +545,26 @@ err: · 544 unmodified lines
545545 return ret;
546546 }
547547
548+static int
549+__i915_gem_userptr_set_pages(struct drm_i915_gem_object *obj,
550+ struct page **pvec, int num_pages)
551+{
552+ int ret;
553+
554+ ret = st_set_pages(&obj->pages, pvec, num_pages);
555+ if (ret)
556+ return ret;
557+
558+ ret = i915_gem_gtt_prepare_object(obj);
559+ if (ret) {
560+ sg_free_table(obj->pages);
561+ kfree(obj->pages);
562+ obj->pages = NULL;
563+ }
564+
565+ return ret;
566+}
567+
548568 static void
549569 __i915_gem_userptr_get_pages_worker(struct work_struct *_work)
550570 {
@@ -584,9 +604,12 @@ __i915_gem_userptr_get_pages_worker(struct work_struct *_work) · 33 unmodified lines
584604 if (obj->userptr.work != &work->work) {
585605 ret = 0;
586606 } else if (pinned == num_pages) {
587− ret = st_set_pages(&obj->pages, pvec, num_pages);
607+ ret = __i915_gem_userptr_set_pages(obj, pvec, num_pages);
588608 if (ret == 0) {
589609 list_add_tail(&obj->global_list, &to_i915(dev)->mm.unbound_list);
610+ obj->get_page.sg = obj->pages->sgl;
611+ obj->get_page.last = 0;
612+
590613 pinned = 0;
591614 }
592615 }
@@ -693,7 +716,7 @@ i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj) · 100 unmodified lines
693716 }
694717 }
695718 } else {
696− ret = st_set_pages(&obj->pages, pvec, num_pages);
719+ ret = __i915_gem_userptr_set_pages(obj, pvec, num_pages);
697720 if (ret == 0) {
698721 obj->userptr.work = NULL;
699722 pinned = 0;
@@ -715,6 +738,8 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj) · 15 unmodified lines
715738 if (obj->madv != I915_MADV_WILLNEED)
716739 obj->dirty = 0;
717740
741+ i915_gem_gtt_finish_object(obj);
742+
718743 for_each_sg_page(obj->pages->sgl, &sg_iter, obj->pages->nents, 0) {
719744 struct page *page = sg_page_iter_page(&sg_iter);
720745
drivers/gpu/drm/i915/i915_ioc32.c+1−1
@@ -204,7 +204,7 @@ long i915_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 203 unmodified lines
204204 drm_ioctl_compat_t *fn = NULL;
205205 int ret;
206206
207− if (nr < DRM_COMMAND_BASE)
207+ if (nr < DRM_COMMAND_BASE || nr >= DRM_COMMAND_END)
208208 return drm_compat_ioctl(filp, cmd, arg);
209209
210210 if (nr < DRM_COMMAND_BASE + ARRAY_SIZE(i915_compat_ioctls))
drivers/gpu/drm/i915/i915_irq.c+3−10
@@ -2706,18 +2706,11 @@ static void gen8_disable_vblank(struct drm_device *dev, int pipe) · 2705 unmodified lines
27062706 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
27072707 }
27082708
2709−static struct drm_i915_gem_request *
2710−ring_last_request(struct intel_engine_cs *ring)
2711−{
2712− return list_entry(ring->request_list.prev,
2713− struct drm_i915_gem_request, list);
2714−}
2715−
27162709 static bool
2717−ring_idle(struct intel_engine_cs *ring)
2710+ring_idle(struct intel_engine_cs *ring, u32 seqno)
27182711 {
27192712 return (list_empty(&ring->request_list) ||
2720− i915_gem_request_completed(ring_last_request(ring), false));
2713+ i915_seqno_passed(seqno, ring->last_submitted_seqno));
27212714 }
27222715
27232716 static bool
@@ -2939,7 +2932,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work) · 215 unmodified lines
29392932 acthd = intel_ring_get_active_head(ring);
29402933
29412934 if (ring->hangcheck.seqno == seqno) {
2942− if (ring_idle(ring)) {
2935+ if (ring_idle(ring, seqno)) {
29432936 ring->hangcheck.action = HANGCHECK_IDLE;
29442937
29452938 if (waitqueue_active(&ring->irq_queue)) {
drivers/gpu/drm/i915/i915_trace.h+1−1
@@ -727,7 +727,7 @@ DECLARE_EVENT_CLASS(i915_context, · 726 unmodified lines
727727 TP_fast_assign(
728728 __entry->ctx = ctx;
729729 __entry->vm = ctx->ppgtt ? &ctx->ppgtt->base : NULL;
730− __entry->dev = ctx->file_priv->dev_priv->dev->primary->index;
730+ __entry->dev = ctx->i915->dev->primary->index;
731731 ),
732732
733733 TP_printk("dev=%u, ctx=%p, ctx_vm=%p",
drivers/gpu/drm/i915/intel_display.c+3−5
@@ -6315,9 +6315,6 @@ static void intel_crtc_disable(struct drm_crtc *crtc) · 6314 unmodified lines
63156315 struct drm_connector *connector;
63166316 struct drm_i915_private *dev_priv = dev->dev_private;
63176317
6318− /* crtc should still be enabled when we disable it. */
6319− WARN_ON(!crtc->state->enable);
6320−
63216318 intel_crtc_disable_planes(crtc);
63226319 dev_priv->display.crtc_disable(crtc);
63236320 dev_priv->display.off(crtc);
@@ -12591,7 +12588,8 @@ static int __intel_set_mode(struct drm_crtc *modeset_crtc, · 6267 unmodified lines
1259112588 continue;
1259212589
1259312590 if (!crtc_state->enable) {
12594− intel_crtc_disable(crtc);
12591+ if (crtc->state->enable)
12592+ intel_crtc_disable(crtc);
1259512593 } else if (crtc->state->enable) {
1259612594 intel_crtc_disable_planes(crtc);
1259712595 dev_priv->display.crtc_disable(crtc);
@@ -13276,7 +13274,7 @@ intel_check_primary_plane(struct drm_plane *plane, · 678 unmodified lines
1327613274 if (ret)
1327713275 return ret;
1327813276
13279− if (intel_crtc->active) {
13277+ if (crtc_state ? crtc_state->base.active : intel_crtc->active) {
1328013278 struct intel_plane_state *old_state =
1328113279 to_intel_plane_state(plane->state);
1328213280
drivers/gpu/drm/i915/intel_ringbuffer.h+7−0
@@ -275,6 +275,13 @@ struct intel_engine_cs { · 274 unmodified lines
275275 * Do we have some not yet emitted requests outstanding?
276276 */
277277 struct drm_i915_gem_request *outstanding_lazy_request;
278+ /**
279+ * Seqno of request most recently submitted to request_list.
280+ * Used exclusively by hang checker to avoid grabbing lock while
281+ * inspecting request list.
282+ */
283+ u32 last_submitted_seqno;
284+
278285 bool gpu_caches_dirty;
279286
280287 wait_queue_head_t irq_queue;
drivers/gpu/drm/imx/imx-tve.c+1−1
@@ -301,7 +301,7 @@ static void imx_tve_encoder_prepare(struct drm_encoder *encoder) · 300 unmodified lines
301301
302302 switch (tve->mode) {
303303 case TVE_MODE_VGA:
304− imx_drm_set_bus_format_pins(encoder, MEDIA_BUS_FMT_YUV8_1X24,
304+ imx_drm_set_bus_format_pins(encoder, MEDIA_BUS_FMT_GBR888_1X24,
305305 tve->hsync_pin, tve->vsync_pin);
306306 break;
307307 case TVE_MODE_TVOUT:
drivers/gpu/drm/imx/parallel-display.c+15−6
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <drm/drm_panel.h>
2222 #include <linux/videodev2.h>
2323 #include <video/of_display_timing.h>
24+#include <linux/of_graph.h>
2425
2526 #include "imx-drm.h"
2627
@@ -208,7 +209,7 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data) · 181 unmodified lines
208209 {
209210 struct drm_device *drm = data;
210211 struct device_node *np = dev->of_node;
211− struct device_node *panel_node;
212+ struct device_node *port;
212213 const u8 *edidp;
213214 struct imx_parallel_display *imxpd;
214215 int ret;
@@ -234,11 +235,19 @@ static int imx_pd_bind(struct device *dev, struct device *master, void *data) · 19 unmodified lines
234235 imxpd->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI;
235236 }
236237
237− panel_node = of_parse_phandle(np, "fsl,panel", 0);
238− if (panel_node) {
239− imxpd->panel = of_drm_find_panel(panel_node);
240− if (!imxpd->panel)
241− return -EPROBE_DEFER;
238+ /* port@1 is the output port */
239+ port = of_graph_get_port_by_id(np, 1);
240+ if (port) {
241+ struct device_node *endpoint, *remote;
242+
243+ endpoint = of_get_child_by_name(port, "endpoint");
244+ if (endpoint) {
245+ remote = of_graph_get_remote_port_parent(endpoint);
246+ if (remote)
247+ imxpd->panel = of_drm_find_panel(remote);
248+ if (!imxpd->panel)
249+ return -EPROBE_DEFER;
250+ }
242251 }
243252
244253 imxpd->dev = dev;
drivers/gpu/drm/radeon/ci_dpm.c+1−1
@@ -5818,7 +5818,7 @@ int ci_dpm_init(struct radeon_device *rdev) · 5817 unmodified lines
58185818 tmp |= DPM_ENABLED;
58195819 break;
58205820 default:
5821− DRM_ERROR("Invalid PCC GPIO: %u!\n", gpio.shift);
5821+ DRM_DEBUG("Invalid PCC GPIO: %u!\n", gpio.shift);
58225822 break;
58235823 }
58245824 WREG32_SMC(CNB_PWRMGT_CNTL, tmp);
drivers/gpu/drm/radeon/radeon_gart.c+8−4
@@ -260,8 +260,10 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset, · 259 unmodified lines
260260 }
261261 }
262262 }
263− mb();
264− radeon_gart_tlb_flush(rdev);
263+ if (rdev->gart.ptr) {
264+ mb();
265+ radeon_gart_tlb_flush(rdev);
266+ }
265267 }
266268
267269 /**
@@ -306,8 +308,10 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset, · 38 unmodified lines
306308 page_base += RADEON_GPU_PAGE_SIZE;
307309 }
308310 }
309− mb();
310− radeon_gart_tlb_flush(rdev);
311+ if (rdev->gart.ptr) {
312+ mb();
313+ radeon_gart_tlb_flush(rdev);
314+ }
311315 return 0;
312316 }
313317
drivers/gpu/drm/radeon/radeon_gem.c+1−0
@@ -36,6 +36,7 @@ void radeon_gem_object_free(struct drm_gem_object *gobj) · 35 unmodified lines
3636 if (robj) {
3737 if (robj->gem_base.import_attach)
3838 drm_prime_gem_destroy(&robj->gem_base, robj->tbo.sg);
39+ radeon_mn_unregister(robj);
3940 radeon_bo_unref(&robj);
4041 }
4142 }
drivers/gpu/drm/radeon/radeon_object.c+0−1
@@ -75,7 +75,6 @@ static void radeon_ttm_bo_destroy(struct ttm_buffer_object *tbo) · 74 unmodified lines
7575 bo = container_of(tbo, struct radeon_bo, tbo);
7676
7777 radeon_update_memory_usage(bo, bo->tbo.mem.mem_type, -1);
78− radeon_mn_unregister(bo);
7978
8079 mutex_lock(&bo->rdev->gem.mutex);
8180 list_del_init(&bo->list);
drivers/gpu/drm/radeon/si_dpm.c+1−0
@@ -2926,6 +2926,7 @@ static struct si_dpm_quirk si_dpm_quirk_list[] = { · 2925 unmodified lines
29262926 /* PITCAIRN - https://bugs.freedesktop.org/show_bug.cgi?id=76490 */
29272927 { PCI_VENDOR_ID_ATI, 0x6810, 0x1462, 0x3036, 0, 120000 },
29282928 { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0xe271, 0, 120000 },
2929+ { PCI_VENDOR_ID_ATI, 0x6810, 0x174b, 0xe271, 85000, 90000 },
29292930 { 0, 0, 0, 0 },
29302931 };
29312932
drivers/gpu/drm/rockchip/rockchip_drm_drv.c+0−1
@@ -555,7 +555,6 @@ static struct platform_driver rockchip_drm_platform_driver = { · 554 unmodified lines
555555 .probe = rockchip_drm_platform_probe,
556556 .remove = rockchip_drm_platform_remove,
557557 .driver = {
558− .owner = THIS_MODULE,
559558 .name = "rockchip-drm",
560559 .of_match_table = rockchip_drm_dt_ids,
561560 .pm = &rockchip_drm_pm_ops,
drivers/gpu/drm/rockchip/rockchip_drm_fb.c+2−1
@@ -162,7 +162,8 @@ static void rockchip_drm_output_poll_changed(struct drm_device *dev) · 161 unmodified lines
162162 struct rockchip_drm_private *private = dev->dev_private;
163163 struct drm_fb_helper *fb_helper = &private->fbdev_helper;
164164
165− drm_fb_helper_hotplug_event(fb_helper);
165+ if (fb_helper)
166+ drm_fb_helper_hotplug_event(fb_helper);
166167 }
167168
168169 static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = {
drivers/gpu/drm/rockchip/rockchip_drm_gem.c+34−33
@@ -54,55 +54,56 @@ static void rockchip_gem_free_buf(struct rockchip_gem_object *rk_obj) · 53 unmodified lines
5454 &rk_obj->dma_attrs);
5555 }
5656
57−int rockchip_gem_mmap_buf(struct drm_gem_object *obj,
58− struct vm_area_struct *vma)
57+static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
58+ struct vm_area_struct *vma)
59+
5960 {
61+ int ret;
6062 struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj);
6163 struct drm_device *drm = obj->dev;
62− unsigned long vm_size;
6364
64− vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
65− vm_size = vma->vm_end - vma->vm_start;
66−
67− if (vm_size > obj->size)
68− return -EINVAL;
65+ /*
66+ * dma_alloc_attrs() allocated a struct page table for rk_obj, so clear
67+ * VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap().
68+ */
69+ vma->vm_flags &= ~VM_PFNMAP;
6970
70− return dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr,
71+ ret = dma_mmap_attrs(drm->dev, vma, rk_obj->kvaddr, rk_obj->dma_addr,
7172 obj->size, &rk_obj->dma_attrs);
73+ if (ret)
74+ drm_gem_vm_close(vma);
75+
76+ return ret;
7277 }
7378
74−/* drm driver mmap file operations */
75−int rockchip_gem_mmap(struct file *filp, struct vm_area_struct *vma)
79+int rockchip_gem_mmap_buf(struct drm_gem_object *obj,
80+ struct vm_area_struct *vma)
7681 {
77− struct drm_file *priv = filp->private_data;
78− struct drm_device *dev = priv->minor->dev;
79− struct drm_gem_object *obj;
80− struct drm_vma_offset_node *node;
82+ struct drm_device *drm = obj->dev;
8183 int ret;
8284
83− if (drm_device_is_unplugged(dev))
84− return -ENODEV;
85+ mutex_lock(&drm->struct_mutex);
86+ ret = drm_gem_mmap_obj(obj, obj->size, vma);
87+ mutex_unlock(&drm->struct_mutex);
88+ if (ret)
89+ return ret;
8590
86− mutex_lock(&dev->struct_mutex);
91+ return rockchip_drm_gem_object_mmap(obj, vma);
92+}
8793
88− node = drm_vma_offset_exact_lookup(dev->vma_offset_manager,
89− vma->vm_pgoff,
90− vma_pages(vma));
91− if (!node) {
92− mutex_unlock(&dev->struct_mutex);
93− DRM_ERROR("failed to find vma node.\n");
94− return -EINVAL;
95− } else if (!drm_vma_node_is_allowed(node, filp)) {
96− mutex_unlock(&dev->struct_mutex);
97− return -EACCES;
98− }
94+/* drm driver mmap file operations */
95+int rockchip_gem_mmap(struct file *filp, struct vm_area_struct *vma)
96+{
97+ struct drm_gem_object *obj;
98+ int ret;
9999
100− obj = container_of(node, struct drm_gem_object, vma_node);
101− ret = rockchip_gem_mmap_buf(obj, vma);
100+ ret = drm_gem_mmap(filp, vma);
101+ if (ret)
102+ return ret;
102103
103− mutex_unlock(&dev->struct_mutex);
104+ obj = vma->vm_private_data;
104105
105− return ret;
106+ return rockchip_drm_gem_object_mmap(obj, vma);
106107 }
107108
108109 struct rockchip_gem_object *
drivers/gpu/drm/rockchip/rockchip_drm_vop.c+36−13
@@ -170,6 +170,7 @@ struct vop_win_phy { · 169 unmodified lines
170170
171171 struct vop_reg enable;
172172 struct vop_reg format;
173+ struct vop_reg rb_swap;
173174 struct vop_reg act_info;
174175 struct vop_reg dsp_info;
175176 struct vop_reg dsp_st;
@@ -199,8 +200,12 @@ struct vop_data { · 23 unmodified lines
199200 static const uint32_t formats_01[] = {
200201 DRM_FORMAT_XRGB8888,
201202 DRM_FORMAT_ARGB8888,
203+ DRM_FORMAT_XBGR8888,
204+ DRM_FORMAT_ABGR8888,
202205 DRM_FORMAT_RGB888,
206+ DRM_FORMAT_BGR888,
203207 DRM_FORMAT_RGB565,
208+ DRM_FORMAT_BGR565,
204209 DRM_FORMAT_NV12,
205210 DRM_FORMAT_NV16,
206211 DRM_FORMAT_NV24,
@@ -209,8 +214,12 @@ static const uint32_t formats_01[] = { · 2 unmodified lines
209214 static const uint32_t formats_234[] = {
210215 DRM_FORMAT_XRGB8888,
211216 DRM_FORMAT_ARGB8888,
217+ DRM_FORMAT_XBGR8888,
218+ DRM_FORMAT_ABGR8888,
212219 DRM_FORMAT_RGB888,
220+ DRM_FORMAT_BGR888,
213221 DRM_FORMAT_RGB565,
222+ DRM_FORMAT_BGR565,
214223 };
215224
216225 static const struct vop_win_phy win01_data = {
@@ -218,6 +227,7 @@ static const struct vop_win_phy win01_data = { · 1 unmodified line
218227 .nformats = ARRAY_SIZE(formats_01),
219228 .enable = VOP_REG(WIN0_CTRL0, 0x1, 0),
220229 .format = VOP_REG(WIN0_CTRL0, 0x7, 1),
230+ .rb_swap = VOP_REG(WIN0_CTRL0, 0x1, 12),
221231 .act_info = VOP_REG(WIN0_ACT_INFO, 0x1fff1fff, 0),
222232 .dsp_info = VOP_REG(WIN0_DSP_INFO, 0x0fff0fff, 0),
223233 .dsp_st = VOP_REG(WIN0_DSP_ST, 0x1fff1fff, 0),
@@ -234,6 +244,7 @@ static const struct vop_win_phy win23_data = { · 10 unmodified lines
234244 .nformats = ARRAY_SIZE(formats_234),
235245 .enable = VOP_REG(WIN2_CTRL0, 0x1, 0),
236246 .format = VOP_REG(WIN2_CTRL0, 0x7, 1),
247+ .rb_swap = VOP_REG(WIN2_CTRL0, 0x1, 12),
237248 .dsp_info = VOP_REG(WIN2_DSP_INFO0, 0x0fff0fff, 0),
238249 .dsp_st = VOP_REG(WIN2_DSP_ST0, 0x1fff1fff, 0),
239250 .yrgb_mst = VOP_REG(WIN2_MST0, 0xffffffff, 0),
@@ -242,15 +253,6 @@ static const struct vop_win_phy win23_data = { · 2 unmodified lines
242253 .dst_alpha_ctl = VOP_REG(WIN2_DST_ALPHA_CTRL, 0xff, 0),
243254 };
244255
245−static const struct vop_win_phy cursor_data = {
246− .data_formats = formats_234,
247− .nformats = ARRAY_SIZE(formats_234),
248− .enable = VOP_REG(HWC_CTRL0, 0x1, 0),
249− .format = VOP_REG(HWC_CTRL0, 0x7, 1),
250− .dsp_st = VOP_REG(HWC_DSP_ST, 0x1fff1fff, 0),
251− .yrgb_mst = VOP_REG(HWC_MST, 0xffffffff, 0),
252−};
253−
254256 static const struct vop_ctrl ctrl_data = {
255257 .standby = VOP_REG(SYS_CTRL, 0x1, 22),
256258 .gate_en = VOP_REG(SYS_CTRL, 0x1, 23),
@@ -282,14 +284,14 @@ static const struct vop_reg_data vop_init_reg_table[] = { · 25 unmodified lines
282284 /*
283285 * Note: rk3288 has a dedicated 'cursor' window, however, that window requires
284286 * special support to get alpha blending working. For now, just use overlay
285− * window 1 for the drm cursor.
287+ * window 3 for the drm cursor.
288+ *
286289 */
287290 static const struct vop_win_data rk3288_vop_win_data[] = {
288291 { .base = 0x00, .phy = &win01_data, .type = DRM_PLANE_TYPE_PRIMARY },
289− { .base = 0x40, .phy = &win01_data, .type = DRM_PLANE_TYPE_CURSOR },
292+ { .base = 0x40, .phy = &win01_data, .type = DRM_PLANE_TYPE_OVERLAY },
290293 { .base = 0x00, .phy = &win23_data, .type = DRM_PLANE_TYPE_OVERLAY },
291− { .base = 0x50, .phy = &win23_data, .type = DRM_PLANE_TYPE_OVERLAY },
292− { .base = 0x00, .phy = &cursor_data, .type = DRM_PLANE_TYPE_OVERLAY },
294+ { .base = 0x50, .phy = &win23_data, .type = DRM_PLANE_TYPE_CURSOR },
293295 };
294296
295297 static const struct vop_data rk3288_vop = {
@@ -352,15 +354,32 @@ static inline void vop_mask_write_relaxed(struct vop *vop, uint32_t offset, · 56 unmodified lines
352354 }
353355 }
354356
357+static bool has_rb_swapped(uint32_t format)
358+{
359+ switch (format) {
360+ case DRM_FORMAT_XBGR8888:
361+ case DRM_FORMAT_ABGR8888:
362+ case DRM_FORMAT_BGR888:
363+ case DRM_FORMAT_BGR565:
364+ return true;
365+ default:
366+ return false;
367+ }
368+}
369+
355370 static enum vop_data_format vop_convert_format(uint32_t format)
356371 {
357372 switch (format) {
358373 case DRM_FORMAT_XRGB8888:
359374 case DRM_FORMAT_ARGB8888:
375+ case DRM_FORMAT_XBGR8888:
376+ case DRM_FORMAT_ABGR8888:
360377 return VOP_FMT_ARGB8888;
361378 case DRM_FORMAT_RGB888:
379+ case DRM_FORMAT_BGR888:
362380 return VOP_FMT_RGB888;
363381 case DRM_FORMAT_RGB565:
382+ case DRM_FORMAT_BGR565:
364383 return VOP_FMT_RGB565;
365384 case DRM_FORMAT_NV12:
366385 return VOP_FMT_YUV420SP;
@@ -378,6 +397,7 @@ static bool is_alpha_support(uint32_t format) · 11 unmodified lines
378397 {
379398 switch (format) {
380399 case DRM_FORMAT_ARGB8888:
400+ case DRM_FORMAT_ABGR8888:
381401 return true;
382402 default:
383403 return false;
@@ -588,6 +608,7 @@ static int vop_update_plane_event(struct drm_plane *plane, · 204 unmodified lines
588608 enum vop_data_format format;
589609 uint32_t val;
590610 bool is_alpha;
611+ bool rb_swap;
591612 bool visible;
592613 int ret;
593614 struct drm_rect dest = {
@@ -621,6 +642,7 @@ static int vop_update_plane_event(struct drm_plane *plane, · 27 unmodified lines
621642 return 0;
622643
623644 is_alpha = is_alpha_support(fb->pixel_format);
645+ rb_swap = has_rb_swapped(fb->pixel_format);
624646 format = vop_convert_format(fb->pixel_format);
625647 if (format < 0)
626648 return format;
@@ -689,6 +711,7 @@ static int vop_update_plane_event(struct drm_plane *plane, · 62 unmodified lines
689711 val = (dsp_sty - 1) << 16;
690712 val |= (dsp_stx - 1) & 0xffff;
691713 VOP_WIN_SET(vop, win, dsp_st, val);
714+ VOP_WIN_SET(vop, win, rb_swap, rb_swap);
692715
693716 if (is_alpha) {
694717 VOP_WIN_SET(vop, win, dst_alpha_ctl,
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c+6−7
@@ -963,14 +963,13 @@ void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev) · 962 unmodified lines
963963 } else {
964964 pool->npages_free += count;
965965 list_splice(&ttm_dma->pages_list, &pool->free_list);
966− npages = count;
967− if (pool->npages_free > _manager->options.max_size) {
966+ /*
967+ * Wait to have at at least NUM_PAGES_TO_ALLOC number of pages
968+ * to free in order to minimize calls to set_memory_wb().
969+ */
970+ if (pool->npages_free >= (_manager->options.max_size +
971+ NUM_PAGES_TO_ALLOC))
968972 npages = pool->npages_free - _manager->options.max_size;
969− /* free at least NUM_PAGES_TO_ALLOC number of pages
970− * to reduce calls to set_memory_wb */
971− if (npages < NUM_PAGES_TO_ALLOC)
972− npages = NUM_PAGES_TO_ALLOC;
973− }
974973 }
975974 spin_unlock_irqrestore(&pool->lock, irq_flags);
976975
drivers/gpu/ipu-v3/ipu-common.c+3−0
@@ -1107,6 +1107,9 @@ static int ipu_irq_init(struct ipu_soc *ipu) · 1106 unmodified lines
11071107 return ret;
11081108 }
11091109
1110+ for (i = 0; i < IPU_NUM_IRQS; i += 32)
1111+ ipu_cm_write(ipu, 0, IPU_INT_CTRL(i / 32));
1112+
11101113 for (i = 0; i < IPU_NUM_IRQS; i += 32) {
11111114 gc = irq_get_domain_generic_chip(ipu->domain, i);
11121115 gc->reg_base = ipu->cm_reg;
drivers/iio/accel/bmc150-accel.c+1−1
@@ -1464,7 +1464,7 @@ static void bmc150_accel_unregister_triggers(struct bmc150_accel_data *data, · 1463 unmodified lines
14641464 {
14651465 int i;
14661466
1467− for (i = from; i >= 0; i++) {
1467+ for (i = from; i >= 0; i--) {
14681468 if (data->triggers[i].indio_trig) {
14691469 iio_trigger_unregister(data->triggers[i].indio_trig);
14701470 data->triggers[i].indio_trig = NULL;
drivers/iio/adc/Kconfig+1−2
@@ -153,8 +153,7 @@ config DA9150_GPADC · 152 unmodified lines
153153
154154 config CC10001_ADC
155155 tristate "Cosmic Circuits 10001 ADC driver"
156− depends on HAVE_CLK || REGULATOR
157− depends on HAS_IOMEM
156+ depends on HAS_IOMEM && HAVE_CLK && REGULATOR
158157 select IIO_BUFFER
159158 select IIO_TRIGGERED_BUFFER
160159 help
drivers/iio/adc/at91_adc.c+4−4
@@ -182,7 +182,7 @@ struct at91_adc_caps { · 181 unmodified lines
182182 u8 ts_pen_detect_sensitivity;
183183
184184 /* startup time calculate function */
185− u32 (*calc_startup_ticks)(u8 startup_time, u32 adc_clk_khz);
185+ u32 (*calc_startup_ticks)(u32 startup_time, u32 adc_clk_khz);
186186
187187 u8 num_channels;
188188 struct at91_adc_reg_desc registers;
@@ -201,7 +201,7 @@ struct at91_adc_state { · 12 unmodified lines
201201 u8 num_channels;
202202 void __iomem *reg_base;
203203 struct at91_adc_reg_desc *registers;
204− u8 startup_time;
204+ u32 startup_time;
205205 u8 sample_hold_time;
206206 bool sleep_mode;
207207 struct iio_trigger **trig;
@@ -779,7 +779,7 @@ ret: · 571 unmodified lines
779779 return ret;
780780 }
781781
782−static u32 calc_startup_ticks_9260(u8 startup_time, u32 adc_clk_khz)
782+static u32 calc_startup_ticks_9260(u32 startup_time, u32 adc_clk_khz)
783783 {
784784 /*
785785 * Number of ticks needed to cover the startup time of the ADC
@@ -790,7 +790,7 @@ static u32 calc_startup_ticks_9260(u8 startup_time, u32 adc_clk_khz) · 4 unmodified lines
790790 return round_up((startup_time * adc_clk_khz / 1000) - 1, 8) / 8;
791791 }
792792
793−static u32 calc_startup_ticks_9x5(u8 startup_time, u32 adc_clk_khz)
793+static u32 calc_startup_ticks_9x5(u32 startup_time, u32 adc_clk_khz)
794794 {
795795 /*
796796 * For sama5d3x and at91sam9x5, the formula changes to:
drivers/iio/adc/rockchip_saradc.c+4−0
@@ -349,3 +349,7 @@ static struct platform_driver rockchip_saradc_driver = { · 348 unmodified lines
349349 };
350350
351351 module_platform_driver(rockchip_saradc_driver);
352+
353+MODULE_AUTHOR("Heiko Stuebner <heiko@sntech.de>");
354+MODULE_DESCRIPTION("Rockchip SARADC driver");
355+MODULE_LICENSE("GPL v2");
drivers/iio/adc/twl4030-madc.c+2−1
@@ -833,7 +833,8 @@ static int twl4030_madc_probe(struct platform_device *pdev) · 832 unmodified lines
833833 irq = platform_get_irq(pdev, 0);
834834 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
835835 twl4030_madc_threaded_irq_handler,
836− IRQF_TRIGGER_RISING, "twl4030_madc", madc);
836+ IRQF_TRIGGER_RISING | IRQF_ONESHOT,
837+ "twl4030_madc", madc);
837838 if (ret) {
838839 dev_err(&pdev->dev, "could not request irq\n");
839840 goto err_i2c;
drivers/iio/common/hid-sensors/hid-sensor-trigger.c+10−1
@@ -36,6 +36,8 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) · 35 unmodified lines
3636 s32 poll_value = 0;
3737
3838 if (state) {
39+ if (!atomic_read(&st->user_requested_state))
40+ return 0;
3941 if (sensor_hub_device_open(st->hsdev))
4042 return -EIO;
4143
@@ -52,8 +54,12 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) · 10 unmodified lines
5254
5355 poll_value = hid_sensor_read_poll_value(st);
5456 } else {
55− if (!atomic_dec_and_test(&st->data_ready))
57+ int val;
58+
59+ val = atomic_dec_if_positive(&st->data_ready);
60+ if (val < 0)
5661 return 0;
62+
5763 sensor_hub_device_close(st->hsdev);
5864 state_val = hid_sensor_get_usage_index(st->hsdev,
5965 st->power_state.report_id,
@@ -92,9 +98,11 @@ EXPORT_SYMBOL(hid_sensor_power_state); · 32 unmodified lines
9298
9399 int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
94100 {
101+
95102 #ifdef CONFIG_PM
96103 int ret;
97104
105+ atomic_set(&st->user_requested_state, state);
98106 if (state)
99107 ret = pm_runtime_get_sync(&st->pdev->dev);
100108 else {
@@ -109,6 +117,7 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state) · 8 unmodified lines
109117
110118 return 0;
111119 #else
120+ atomic_set(&st->user_requested_state, state);
112121 return _hid_sensor_power_state(st, state);
113122 #endif
114123 }
drivers/iio/dac/ad5624r_spi.c+2−2
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #include "ad5624r.h"
2323
2424 static int ad5624r_spi_write(struct spi_device *spi,
25− u8 cmd, u8 addr, u16 val, u8 len)
25+ u8 cmd, u8 addr, u16 val, u8 shift)
2626 {
2727 u32 data;
2828 u8 msg[3];
@@ -35,7 +35,7 @@ static int ad5624r_spi_write(struct spi_device *spi, · 6 unmodified lines
3535 * 14-, 12-bit input code followed by 0, 2, or 4 don't care bits,
3636 * for the AD5664R, AD5644R, and AD5624R, respectively.
3737 */
38− data = (0 << 22) | (cmd << 19) | (addr << 16) | (val << (16 - len));
38+ data = (0 << 22) | (cmd << 19) | (addr << 16) | (val << shift);
3939 msg[0] = data >> 16;
4040 msg[1] = data >> 8;
4141 msg[2] = data;
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c+18−0
@@ -431,6 +431,23 @@ static int inv_mpu6050_write_gyro_scale(struct inv_mpu6050_state *st, int val) · 430 unmodified lines
431431 return -EINVAL;
432432 }
433433
434+static int inv_write_raw_get_fmt(struct iio_dev *indio_dev,
435+ struct iio_chan_spec const *chan, long mask)
436+{
437+ switch (mask) {
438+ case IIO_CHAN_INFO_SCALE:
439+ switch (chan->type) {
440+ case IIO_ANGL_VEL:
441+ return IIO_VAL_INT_PLUS_NANO;
442+ default:
443+ return IIO_VAL_INT_PLUS_MICRO;
444+ }
445+ default:
446+ return IIO_VAL_INT_PLUS_MICRO;
447+ }
448+
449+ return -EINVAL;
450+}
434451 static int inv_mpu6050_write_accel_scale(struct inv_mpu6050_state *st, int val)
435452 {
436453 int result, i;
@@ -696,6 +713,7 @@ static const struct iio_info mpu_info = { · 259 unmodified lines
696713 .driver_module = THIS_MODULE,
697714 .read_raw = &inv_mpu6050_read_raw,
698715 .write_raw = &inv_mpu6050_write_raw,
716+ .write_raw_get_fmt = &inv_write_raw_get_fmt,
699717 .attrs = &inv_attribute_group,
700718 .validate_trigger = inv_mpu6050_validate_trigger,
701719 };
drivers/iio/light/Kconfig+2−0
@@ -188,6 +188,7 @@ config SENSORS_LM3533 · 187 unmodified lines
188188 config LTR501
189189 tristate "LTR-501ALS-01 light sensor"
190190 depends on I2C
191+ select REGMAP_I2C
191192 select IIO_BUFFER
192193 select IIO_TRIGGERED_BUFFER
193194 help
@@ -201,6 +202,7 @@ config LTR501 · 7 unmodified lines
201202 config STK3310
202203 tristate "STK3310 ALS and proximity sensor"
203204 depends on I2C
205+ select REGMAP_I2C
204206 help
205207 Say yes here to get support for the Sensortek STK3310 ambient light
206208 and proximity sensor. The STK3311 model is also supported by this
drivers/iio/light/cm3323.c+1−1
@@ -123,7 +123,7 @@ static int cm3323_set_it_bits(struct cm3323_data *data, int val, int val2) · 122 unmodified lines
123123 for (i = 0; i < ARRAY_SIZE(cm3323_int_time); i++) {
124124 if (val == cm3323_int_time[i].val &&
125125 val2 == cm3323_int_time[i].val2) {
126− reg_conf = data->reg_conf;
126+ reg_conf = data->reg_conf & ~CM3323_CONF_IT_MASK;
127127 reg_conf |= i << CM3323_CONF_IT_SHIFT;
128128
129129 ret = i2c_smbus_write_word_data(data->client,
drivers/iio/light/ltr501.c+1−1
@@ -1302,7 +1302,7 @@ static int ltr501_init(struct ltr501_data *data) · 1301 unmodified lines
13021302 if (ret < 0)
13031303 return ret;
13041304
1305− data->als_contr = ret | data->chip_info->als_mode_active;
1305+ data->als_contr = status | data->chip_info->als_mode_active;
13061306
13071307 ret = regmap_read(data->regmap, LTR501_PS_CONTR, &status);
13081308 if (ret < 0)
drivers/iio/light/stk3310.c+17−36
@@ -43,7 +43,6 @@ · 42 unmodified lines
4343 #define STK3311_CHIP_ID_VAL 0x1D
4444 #define STK3310_PSINT_EN 0x01
4545 #define STK3310_PS_MAX_VAL 0xFFFF
46−#define STK3310_THRESH_MAX 0xFFFF
4746
4847 #define STK3310_DRIVER_NAME "stk3310"
4948 #define STK3310_REGMAP_NAME "stk3310_regmap"
@@ -84,15 +83,13 @@ static const struct reg_field stk3310_reg_field_flag_psint = · 34 unmodified lines
8483 REG_FIELD(STK3310_REG_FLAG, 4, 4);
8584 static const struct reg_field stk3310_reg_field_flag_nf =
8685 REG_FIELD(STK3310_REG_FLAG, 0, 0);
87−/*
88− * Maximum PS values with regard to scale. Used to export the 'inverse'
89− * PS value (high values for far objects, low values for near objects).
90− */
86+
87+/* Estimate maximum proximity values with regard to measurement scale. */
9188 static const int stk3310_ps_max[4] = {
92− STK3310_PS_MAX_VAL / 64,
93− STK3310_PS_MAX_VAL / 16,
94− STK3310_PS_MAX_VAL / 4,
95− STK3310_PS_MAX_VAL,
89+ STK3310_PS_MAX_VAL / 640,
90+ STK3310_PS_MAX_VAL / 160,
91+ STK3310_PS_MAX_VAL / 40,
92+ STK3310_PS_MAX_VAL / 10
9693 };
9794
9895 static const int stk3310_scale_table[][2] = {
@@ -128,14 +125,14 @@ static const struct iio_event_spec stk3310_events[] = { · 29 unmodified lines
128125 /* Proximity event */
129126 {
130127 .type = IIO_EV_TYPE_THRESH,
131− .dir = IIO_EV_DIR_FALLING,
128+ .dir = IIO_EV_DIR_RISING,
132129 .mask_separate = BIT(IIO_EV_INFO_VALUE) |
133130 BIT(IIO_EV_INFO_ENABLE),
134131 },
135132 /* Out-of-proximity event */
136133 {
137134 .type = IIO_EV_TYPE_THRESH,
138− .dir = IIO_EV_DIR_RISING,
135+ .dir = IIO_EV_DIR_FALLING,
139136 .mask_separate = BIT(IIO_EV_INFO_VALUE) |
140137 BIT(IIO_EV_INFO_ENABLE),
141138 },
@@ -205,23 +202,16 @@ static int stk3310_read_event(struct iio_dev *indio_dev, · 63 unmodified lines
205202 u8 reg;
206203 u16 buf;
207204 int ret;
208− unsigned int index;
209205 struct stk3310_data *data = iio_priv(indio_dev);
210206
211207 if (info != IIO_EV_INFO_VALUE)
212208 return -EINVAL;
213209
214− /*
215− * Only proximity interrupts are implemented at the moment.
216− * Since we're inverting proximity values, the sensor's 'high'
217− * threshold will become our 'low' threshold, associated with
218− * 'near' events. Similarly, the sensor's 'low' threshold will
219− * be our 'high' threshold, associated with 'far' events.
220− */
210+ /* Only proximity interrupts are implemented at the moment. */
221211 if (dir == IIO_EV_DIR_RISING)
222− reg = STK3310_REG_THDL_PS;
223− else if (dir == IIO_EV_DIR_FALLING)
224212 reg = STK3310_REG_THDH_PS;
213+ else if (dir == IIO_EV_DIR_FALLING)
214+ reg = STK3310_REG_THDL_PS;
225215 else
226216 return -EINVAL;
227217
@@ -232,8 +222,7 @@ static int stk3310_read_event(struct iio_dev *indio_dev, · 4 unmodified lines
232222 dev_err(&data->client->dev, "register read failed\n");
233223 return ret;
234224 }
235− regmap_field_read(data->reg_ps_gain, &index);
236− *val = swab16(stk3310_ps_max[index] - buf);
225+ *val = swab16(buf);
237226
238227 return IIO_VAL_INT;
239228 }
@@ -257,13 +246,13 @@ static int stk3310_write_event(struct iio_dev *indio_dev, · 17 unmodified lines
257246 return -EINVAL;
258247
259248 if (dir == IIO_EV_DIR_RISING)
260− reg = STK3310_REG_THDL_PS;
261− else if (dir == IIO_EV_DIR_FALLING)
262249 reg = STK3310_REG_THDH_PS;
250+ else if (dir == IIO_EV_DIR_FALLING)
251+ reg = STK3310_REG_THDL_PS;
263252 else
264253 return -EINVAL;
265254
266− buf = swab16(stk3310_ps_max[index] - val);
255+ buf = swab16(val);
267256 ret = regmap_bulk_write(data->regmap, reg, &buf, 2);
268257 if (ret < 0)
269258 dev_err(&client->dev, "failed to set PS threshold!\n");
@@ -334,14 +323,6 @@ static int stk3310_read_raw(struct iio_dev *indio_dev, · 64 unmodified lines
334323 return ret;
335324 }
336325 *val = swab16(buf);
337− if (chan->type == IIO_PROXIMITY) {
338− /*
339− * Invert the proximity data so we return low values
340− * for close objects and high values for far ones.
341− */
342− regmap_field_read(data->reg_ps_gain, &index);
343− *val = stk3310_ps_max[index] - *val;
344− }
345326 mutex_unlock(&data->lock);
346327 return IIO_VAL_INT;
347328 case IIO_CHAN_INFO_INT_TIME:
@@ -581,8 +562,8 @@ static irqreturn_t stk3310_irq_event_handler(int irq, void *private) · 233 unmodified lines
581562 }
582563 event = IIO_UNMOD_EVENT_CODE(IIO_PROXIMITY, 1,
583564 IIO_EV_TYPE_THRESH,
584− (dir ? IIO_EV_DIR_RISING :
585− IIO_EV_DIR_FALLING));
565+ (dir ? IIO_EV_DIR_FALLING :
566+ IIO_EV_DIR_RISING));
586567 iio_push_event(indio_dev, event, data->timestamp);
587568
588569 /* Reset the interrupt flag */
drivers/iio/light/tcs3414.c+1−1
@@ -185,7 +185,7 @@ static int tcs3414_write_raw(struct iio_dev *indio_dev, · 184 unmodified lines
185185 if (val != 0)
186186 return -EINVAL;
187187 for (i = 0; i < ARRAY_SIZE(tcs3414_times); i++) {
188− if (val == tcs3414_times[i] * 1000) {
188+ if (val2 == tcs3414_times[i] * 1000) {
189189 data->timing &= ~TCS3414_INTEG_MASK;
190190 data->timing |= i;
191191 return i2c_smbus_write_byte_data(
drivers/iio/magnetometer/mmc35240.c+21−14
@@ -84,10 +84,10 @@ · 83 unmodified lines
8484 #define MMC35240_OTP_START_ADDR 0x1B
8585
8686 enum mmc35240_resolution {
87− MMC35240_16_BITS_SLOW = 0, /* 100 Hz */
88− MMC35240_16_BITS_FAST, /* 200 Hz */
89− MMC35240_14_BITS, /* 333 Hz */
90− MMC35240_12_BITS, /* 666 Hz */
87+ MMC35240_16_BITS_SLOW = 0, /* 7.92 ms */
88+ MMC35240_16_BITS_FAST, /* 4.08 ms */
89+ MMC35240_14_BITS, /* 2.16 ms */
90+ MMC35240_12_BITS, /* 1.20 ms */
9191 };
9292
9393 enum mmc35240_axis {
@@ -100,22 +100,22 @@ static const struct { · 6 unmodified lines
100100 int sens[3]; /* sensitivity per X, Y, Z axis */
101101 int nfo; /* null field output */
102102 } mmc35240_props_table[] = {
103− /* 16 bits, 100Hz ODR */
103+ /* 16 bits, 125Hz ODR */
104104 {
105105 {1024, 1024, 1024},
106106 32768,
107107 },
108− /* 16 bits, 200Hz ODR */
108+ /* 16 bits, 250Hz ODR */
109109 {
110110 {1024, 1024, 770},
111111 32768,
112112 },
113− /* 14 bits, 333Hz ODR */
113+ /* 14 bits, 450Hz ODR */
114114 {
115115 {256, 256, 193},
116116 8192,
117117 },
118− /* 12 bits, 666Hz ODR */
118+ /* 12 bits, 800Hz ODR */
119119 {
120120 {64, 64, 48},
121121 2048,
@@ -133,9 +133,15 @@ struct mmc35240_data { · 11 unmodified lines
133133 int axis_scale[3];
134134 };
135135
136−static const int mmc35240_samp_freq[] = {100, 200, 333, 666};
136+static const struct {
137+ int val;
138+ int val2;
139+} mmc35240_samp_freq[] = { {1, 500000},
140+ {13, 0},
141+ {25, 0},
142+ {50, 0} };
137143
138−static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("100 200 333 666");
144+static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("1.5 13 25 50");
139145
140146 #define MMC35240_CHANNEL(_axis) { \
141147 .type = IIO_MAGN, \
@@ -168,7 +174,8 @@ static int mmc35240_get_samp_freq_index(struct mmc35240_data *data, · 26 unmodified lines
168174 int i;
169175
170176 for (i = 0; i < ARRAY_SIZE(mmc35240_samp_freq); i++)
171− if (mmc35240_samp_freq[i] == val)
177+ if (mmc35240_samp_freq[i].val == val &&
178+ mmc35240_samp_freq[i].val2 == val2)
172179 return i;
173180 return -EINVAL;
174181 }
@@ -378,9 +385,9 @@ static int mmc35240_read_raw(struct iio_dev *indio_dev, · 203 unmodified lines
378385 if (i < 0 || i >= ARRAY_SIZE(mmc35240_samp_freq))
379386 return -EINVAL;
380387
381− *val = mmc35240_samp_freq[i];
382− *val2 = 0;
383− return IIO_VAL_INT;
388+ *val = mmc35240_samp_freq[i].val;
389+ *val2 = mmc35240_samp_freq[i].val2;
390+ return IIO_VAL_INT_PLUS_MICRO;
384391 default:
385392 return -EINVAL;
386393 }
drivers/iio/proximity/sx9500.c+15−13
@@ -80,6 +80,7 @@ · 79 unmodified lines
8080 #define SX9500_COMPSTAT_MASK GENMASK(3, 0)
8181
8282 #define SX9500_NUM_CHANNELS 4
83+#define SX9500_CHAN_MASK GENMASK(SX9500_NUM_CHANNELS - 1, 0)
8384
8485 struct sx9500_data {
8586 struct mutex mutex;
@@ -281,7 +282,7 @@ static int sx9500_read_prox_data(struct sx9500_data *data, · 195 unmodified lines
281282 if (ret < 0)
282283 return ret;
283284
284− *val = 32767 - (s16)be16_to_cpu(regval);
285+ *val = be16_to_cpu(regval);
285286
286287 return IIO_VAL_INT;
287288 }
@@ -329,20 +330,20 @@ static int sx9500_read_proximity(struct sx9500_data *data, · 41 unmodified lines
329330 else
330331 ret = sx9500_wait_for_sample(data);
331332
332− if (ret < 0)
333− return ret;
334−
335333 mutex_lock(&data->mutex);
336334
337− ret = sx9500_read_prox_data(data, chan, val);
338335 if (ret < 0)
339− goto out;
336+ goto out_dec_data_rdy;
340337
341− ret = sx9500_dec_chan_users(data, chan->channel);
338+ ret = sx9500_read_prox_data(data, chan, val);
342339 if (ret < 0)
343− goto out;
340+ goto out_dec_data_rdy;
344341
345342 ret = sx9500_dec_data_rdy_users(data);
343+ if (ret < 0)
344+ goto out_dec_chan;
345+
346+ ret = sx9500_dec_chan_users(data, chan->channel);
346347 if (ret < 0)
347348 goto out;
348349
@@ -350,6 +351,8 @@ static int sx9500_read_proximity(struct sx9500_data *data, · 1 unmodified line
350351
351352 goto out;
352353
354+out_dec_data_rdy:
355+ sx9500_dec_data_rdy_users(data);
353356 out_dec_chan:
354357 sx9500_dec_chan_users(data, chan->channel);
355358 out:
@@ -679,7 +682,7 @@ out: · 323 unmodified lines
679682 static int sx9500_buffer_preenable(struct iio_dev *indio_dev)
680683 {
681684 struct sx9500_data *data = iio_priv(indio_dev);
682− int ret, i;
685+ int ret = 0, i;
683686
684687 mutex_lock(&data->mutex);
685688
@@ -703,7 +706,7 @@ static int sx9500_buffer_preenable(struct iio_dev *indio_dev) · 17 unmodified lines
703706 static int sx9500_buffer_predisable(struct iio_dev *indio_dev)
704707 {
705708 struct sx9500_data *data = iio_priv(indio_dev);
706− int ret, i;
709+ int ret = 0, i;
707710
708711 iio_triggered_buffer_predisable(indio_dev);
709712
@@ -800,8 +803,7 @@ static int sx9500_init_compensation(struct iio_dev *indio_dev) · 90 unmodified lines
800803 unsigned int val;
801804
802805 ret = regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0,
803− GENMASK(SX9500_NUM_CHANNELS, 0),
804− GENMASK(SX9500_NUM_CHANNELS, 0));
806+ SX9500_CHAN_MASK, SX9500_CHAN_MASK);
805807 if (ret < 0)
806808 return ret;
807809
@@ -821,7 +823,7 @@ static int sx9500_init_compensation(struct iio_dev *indio_dev) · 13 unmodified lines
821823
822824 out:
823825 regmap_update_bits(data->regmap, SX9500_REG_PROX_CTRL0,
824− GENMASK(SX9500_NUM_CHANNELS, 0), 0);
826+ SX9500_CHAN_MASK, 0);
825827 return ret;
826828 }
827829
drivers/iio/temperature/tmp006.c+3−0
@@ -132,6 +132,9 @@ static int tmp006_write_raw(struct iio_dev *indio_dev, · 131 unmodified lines
132132 struct tmp006_data *data = iio_priv(indio_dev);
133133 int i;
134134
135+ if (mask != IIO_CHAN_INFO_SAMP_FREQ)
136+ return -EINVAL;
137+
135138 for (i = 0; i < ARRAY_SIZE(tmp006_freqs); i++)
136139 if ((val == tmp006_freqs[i][0]) &&
137140 (val2 == tmp006_freqs[i][1])) {
drivers/infiniband/core/agent.c+2−2
@@ -88,7 +88,7 @@ void agent_send_response(const struct ib_mad_hdr *mad_hdr, const struct ib_grh * · 87 unmodified lines
8888 struct ib_ah *ah;
8989 struct ib_mad_send_wr_private *mad_send_wr;
9090
91− if (device->node_type == RDMA_NODE_IB_SWITCH)
91+ if (rdma_cap_ib_switch(device))
9292 port_priv = ib_get_agent_port(device, 0);
9393 else
9494 port_priv = ib_get_agent_port(device, port_num);
@@ -122,7 +122,7 @@ void agent_send_response(const struct ib_mad_hdr *mad_hdr, const struct ib_grh * · 27 unmodified lines
122122 memcpy(send_buf->mad, mad_hdr, resp_mad_len);
123123 send_buf->ah = ah;
124124
125− if (device->node_type == RDMA_NODE_IB_SWITCH) {
125+ if (rdma_cap_ib_switch(device)) {
126126 mad_send_wr = container_of(send_buf,
127127 struct ib_mad_send_wr_private,
128128 send_buf);
drivers/infiniband/core/cm.c+55−6
@@ -169,6 +169,7 @@ struct cm_device { · 168 unmodified lines
169169 struct ib_device *ib_device;
170170 struct device *device;
171171 u8 ack_delay;
172+ int going_down;
172173 struct cm_port *port[0];
173174 };
174175
@@ -805,6 +806,11 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv) · 630 unmodified lines
805806 {
806807 int wait_time;
807808 unsigned long flags;
809+ struct cm_device *cm_dev;
810+
811+ cm_dev = ib_get_client_data(cm_id_priv->id.device, &cm_client);
812+ if (!cm_dev)
813+ return;
808814
809815 spin_lock_irqsave(&cm.lock, flags);
810816 cm_cleanup_timewait(cm_id_priv->timewait_info);
@@ -818,8 +824,14 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv) · 7 unmodified lines
818824 */
819825 cm_id_priv->id.state = IB_CM_TIMEWAIT;
820826 wait_time = cm_convert_to_ms(cm_id_priv->av.timeout);
821− queue_delayed_work(cm.wq, &cm_id_priv->timewait_info->work.work,
822− msecs_to_jiffies(wait_time));
827+
828+ /* Check if the device started its remove_one */
829+ spin_lock_irq(&cm.lock);
830+ if (!cm_dev->going_down)
831+ queue_delayed_work(cm.wq, &cm_id_priv->timewait_info->work.work,
832+ msecs_to_jiffies(wait_time));
833+ spin_unlock_irq(&cm.lock);
834+
823835 cm_id_priv->timewait_info = NULL;
824836 }
825837
@@ -3305,6 +3317,11 @@ static int cm_establish(struct ib_cm_id *cm_id) · 2479 unmodified lines
33053317 struct cm_work *work;
33063318 unsigned long flags;
33073319 int ret = 0;
3320+ struct cm_device *cm_dev;
3321+
3322+ cm_dev = ib_get_client_data(cm_id->device, &cm_client);
3323+ if (!cm_dev)
3324+ return -ENODEV;
33083325
33093326 work = kmalloc(sizeof *work, GFP_ATOMIC);
33103327 if (!work)
@@ -3343,7 +3360,17 @@ static int cm_establish(struct ib_cm_id *cm_id) · 32 unmodified lines
33433360 work->remote_id = cm_id->remote_id;
33443361 work->mad_recv_wc = NULL;
33453362 work->cm_event.event = IB_CM_USER_ESTABLISHED;
3346− queue_delayed_work(cm.wq, &work->work, 0);
3363+
3364+ /* Check if the device started its remove_one */
3365+ spin_lock_irq(&cm.lock);
3366+ if (!cm_dev->going_down) {
3367+ queue_delayed_work(cm.wq, &work->work, 0);
3368+ } else {
3369+ kfree(work);
3370+ ret = -ENODEV;
3371+ }
3372+ spin_unlock_irq(&cm.lock);
3373+
33473374 out:
33483375 return ret;
33493376 }
@@ -3394,6 +3421,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, · 44 unmodified lines
33943421 enum ib_cm_event_type event;
33953422 u16 attr_id;
33963423 int paths = 0;
3424+ int going_down = 0;
33973425
33983426 switch (mad_recv_wc->recv_buf.mad->mad_hdr.attr_id) {
33993427 case CM_REQ_ATTR_ID:
@@ -3452,7 +3480,19 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, · 52 unmodified lines
34523480 work->cm_event.event = event;
34533481 work->mad_recv_wc = mad_recv_wc;
34543482 work->port = port;
3455− queue_delayed_work(cm.wq, &work->work, 0);
3483+
3484+ /* Check if the device started its remove_one */
3485+ spin_lock_irq(&cm.lock);
3486+ if (!port->cm_dev->going_down)
3487+ queue_delayed_work(cm.wq, &work->work, 0);
3488+ else
3489+ going_down = 1;
3490+ spin_unlock_irq(&cm.lock);
3491+
3492+ if (going_down) {
3493+ kfree(work);
3494+ ib_free_recv_mad(mad_recv_wc);
3495+ }
34563496 }
34573497
34583498 static int cm_init_qp_init_attr(struct cm_id_private *cm_id_priv,
@@ -3771,7 +3811,7 @@ static void cm_add_one(struct ib_device *ib_device) · 312 unmodified lines
37713811
37723812 cm_dev->ib_device = ib_device;
37733813 cm_get_ack_delay(cm_dev);
3774−
3814+ cm_dev->going_down = 0;
37753815 cm_dev->device = device_create(&cm_class, &ib_device->dev,
37763816 MKDEV(0, 0), NULL,
37773817 "%s", ib_device->name);
@@ -3864,14 +3904,23 @@ static void cm_remove_one(struct ib_device *ib_device) · 86 unmodified lines
38643904 list_del(&cm_dev->list);
38653905 write_unlock_irqrestore(&cm.device_lock, flags);
38663906
3907+ spin_lock_irq(&cm.lock);
3908+ cm_dev->going_down = 1;
3909+ spin_unlock_irq(&cm.lock);
3910+
38673911 for (i = 1; i <= ib_device->phys_port_cnt; i++) {
38683912 if (!rdma_cap_ib_cm(ib_device, i))
38693913 continue;
38703914
38713915 port = cm_dev->port[i-1];
38723916 ib_modify_port(ib_device, port->port_num, 0, &port_modify);
3873− ib_unregister_mad_agent(port->mad_agent);
3917+ /*
3918+ * We flush the queue here after the going_down set, this
3919+ * verify that no new works will be queued in the recv handler,
3920+ * after that we can call the unregister_mad_agent
3921+ */
38743922 flush_workqueue(cm.wq);
3923+ ib_unregister_mad_agent(port->mad_agent);
38753924 cm_remove_port_fs(port);
38763925 }
38773926 device_unregister(cm_dev->device);
drivers/infiniband/core/iwpm_msg.c+16−17
@@ -67,7 +67,8 @@ int iwpm_register_pid(struct iwpm_dev_data *pm_msg, u8 nl_client) · 66 unmodified lines
6767 err_str = "Invalid port mapper client";
6868 goto pid_query_error;
6969 }
70− if (iwpm_registered_client(nl_client))
70+ if (iwpm_check_registration(nl_client, IWPM_REG_VALID) ||
71+ iwpm_user_pid == IWPM_PID_UNAVAILABLE)
7172 return 0;
7273 skb = iwpm_create_nlmsg(RDMA_NL_IWPM_REG_PID, &nlh, nl_client);
7374 if (!skb) {
@@ -106,7 +107,6 @@ int iwpm_register_pid(struct iwpm_dev_data *pm_msg, u8 nl_client) · 32 unmodified lines
106107 ret = ibnl_multicast(skb, nlh, RDMA_NL_GROUP_IWPM, GFP_KERNEL);
107108 if (ret) {
108109 skb = NULL; /* skb is freed in the netlink send-op handling */
109− iwpm_set_registered(nl_client, 1);
110110 iwpm_user_pid = IWPM_PID_UNAVAILABLE;
111111 err_str = "Unable to send a nlmsg";
112112 goto pid_query_error;
@@ -144,12 +144,12 @@ int iwpm_add_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client) · 31 unmodified lines
144144 err_str = "Invalid port mapper client";
145145 goto add_mapping_error;
146146 }
147− if (!iwpm_registered_client(nl_client)) {
147+ if (!iwpm_valid_pid())
148+ return 0;
149+ if (!iwpm_check_registration(nl_client, IWPM_REG_VALID)) {
148150 err_str = "Unregistered port mapper client";
149151 goto add_mapping_error;
150152 }
151− if (!iwpm_valid_pid())
152− return 0;
153153 skb = iwpm_create_nlmsg(RDMA_NL_IWPM_ADD_MAPPING, &nlh, nl_client);
154154 if (!skb) {
155155 err_str = "Unable to create a nlmsg";
@@ -214,12 +214,12 @@ int iwpm_add_and_query_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client) · 58 unmodified lines
214214 err_str = "Invalid port mapper client";
215215 goto query_mapping_error;
216216 }
217− if (!iwpm_registered_client(nl_client)) {
217+ if (!iwpm_valid_pid())
218+ return 0;
219+ if (!iwpm_check_registration(nl_client, IWPM_REG_VALID)) {
218220 err_str = "Unregistered port mapper client";
219221 goto query_mapping_error;
220222 }
221− if (!iwpm_valid_pid())
222− return 0;
223223 ret = -ENOMEM;
224224 skb = iwpm_create_nlmsg(RDMA_NL_IWPM_QUERY_MAPPING, &nlh, nl_client);
225225 if (!skb) {
@@ -288,12 +288,12 @@ int iwpm_remove_mapping(struct sockaddr_storage *local_addr, u8 nl_client) · 62 unmodified lines
288288 err_str = "Invalid port mapper client";
289289 goto remove_mapping_error;
290290 }
291− if (!iwpm_registered_client(nl_client)) {
291+ if (!iwpm_valid_pid())
292+ return 0;
293+ if (iwpm_check_registration(nl_client, IWPM_REG_UNDEF)) {
292294 err_str = "Unregistered port mapper client";
293295 goto remove_mapping_error;
294296 }
295− if (!iwpm_valid_pid())
296− return 0;
297297 skb = iwpm_create_nlmsg(RDMA_NL_IWPM_REMOVE_MAPPING, &nlh, nl_client);
298298 if (!skb) {
299299 ret = -ENOMEM;
@@ -388,7 +388,7 @@ int iwpm_register_pid_cb(struct sk_buff *skb, struct netlink_callback *cb) · 88 unmodified lines
388388 pr_debug("%s: iWarp Port Mapper (pid = %d) is available!\n",
389389 __func__, iwpm_user_pid);
390390 if (iwpm_valid_client(nl_client))
391− iwpm_set_registered(nl_client, 1);
391+ iwpm_set_registration(nl_client, IWPM_REG_VALID);
392392 register_pid_response_exit:
393393 nlmsg_request->request_done = 1;
394394 /* always for found nlmsg_request */
@@ -644,7 +644,6 @@ int iwpm_mapping_info_cb(struct sk_buff *skb, struct netlink_callback *cb) · 249 unmodified lines
644644 {
645645 struct nlattr *nltb[IWPM_NLA_MAPINFO_REQ_MAX];
646646 const char *msg_type = "Mapping Info response";
647− int iwpm_pid;
648647 u8 nl_client;
649648 char *iwpm_name;
650649 u16 iwpm_version;
@@ -669,14 +668,14 @@ int iwpm_mapping_info_cb(struct sk_buff *skb, struct netlink_callback *cb) · 18 unmodified lines
669668 __func__, nl_client);
670669 return ret;
671670 }
672− iwpm_set_registered(nl_client, 0);
671+ iwpm_set_registration(nl_client, IWPM_REG_INCOMPL);
673672 atomic_set(&echo_nlmsg_seq, cb->nlh->nlmsg_seq);
673+ iwpm_user_pid = cb->nlh->nlmsg_pid;
674674 if (!iwpm_mapinfo_available())
675675 return 0;
676− iwpm_pid = cb->nlh->nlmsg_pid;
677676 pr_debug("%s: iWarp Port Mapper (pid = %d) is available!\n",
678− __func__, iwpm_pid);
679− ret = iwpm_send_mapinfo(nl_client, iwpm_pid);
677+ __func__, iwpm_user_pid);
678+ ret = iwpm_send_mapinfo(nl_client, iwpm_user_pid);
680679 return ret;
681680 }
682681 EXPORT_SYMBOL(iwpm_mapping_info_cb);
drivers/infiniband/core/iwpm_util.c+10−2
@@ -78,6 +78,7 @@ init_exit: · 77 unmodified lines
7878 mutex_unlock(&iwpm_admin_lock);
7979 if (!ret) {
8080 iwpm_set_valid(nl_client, 1);
81+ iwpm_set_registration(nl_client, IWPM_REG_UNDEF);
8182 pr_debug("%s: Mapinfo and reminfo tables are created\n",
8283 __func__);
8384 }
@@ -106,6 +107,7 @@ int iwpm_exit(u8 nl_client) · 22 unmodified lines
106107 }
107108 mutex_unlock(&iwpm_admin_lock);
108109 iwpm_set_valid(nl_client, 0);
110+ iwpm_set_registration(nl_client, IWPM_REG_UNDEF);
109111 return 0;
110112 }
111113 EXPORT_SYMBOL(iwpm_exit);
@@ -397,17 +399,23 @@ void iwpm_set_valid(u8 nl_client, int valid) · 285 unmodified lines
397399 }
398400
399401 /* valid client */
400−int iwpm_registered_client(u8 nl_client)
402+u32 iwpm_get_registration(u8 nl_client)
401403 {
402404 return iwpm_admin.reg_list[nl_client];
403405 }
404406
405407 /* valid client */
406−void iwpm_set_registered(u8 nl_client, int reg)
408+void iwpm_set_registration(u8 nl_client, u32 reg)
407409 {
408410 iwpm_admin.reg_list[nl_client] = reg;
409411 }
410412
413+/* valid client */
414+u32 iwpm_check_registration(u8 nl_client, u32 reg)
415+{
416+ return (iwpm_get_registration(nl_client) & reg);
417+}
418+
411419 int iwpm_compare_sockaddr(struct sockaddr_storage *a_sockaddr,
412420 struct sockaddr_storage *b_sockaddr)
413421 {
drivers/infiniband/core/iwpm_util.h+22−6
@@ -58,6 +58,10 @@ · 57 unmodified lines
5858 #define IWPM_PID_UNDEFINED -1
5959 #define IWPM_PID_UNAVAILABLE -2
6060
61+#define IWPM_REG_UNDEF 0x01
62+#define IWPM_REG_VALID 0x02
63+#define IWPM_REG_INCOMPL 0x04
64+
6165 struct iwpm_nlmsg_request {
6266 struct list_head inprocess_list;
6367 __u32 nlmsg_seq;
@@ -88,7 +92,7 @@ struct iwpm_admin_data { · 24 unmodified lines
8892 atomic_t refcount;
8993 atomic_t nlmsg_seq;
9094 int client_list[RDMA_NL_NUM_CLIENTS];
91− int reg_list[RDMA_NL_NUM_CLIENTS];
95+ u32 reg_list[RDMA_NL_NUM_CLIENTS];
9296 };
9397
9498 /**
@@ -159,19 +163,31 @@ int iwpm_valid_client(u8 nl_client); · 64 unmodified lines
159163 void iwpm_set_valid(u8 nl_client, int valid);
160164
161165 /**
162− * iwpm_registered_client - Check if the port mapper client is registered
166+ * iwpm_check_registration - Check if the client registration
167+ * matches the given one
163168 * @nl_client: The index of the netlink client
169+ * @reg: The given registration type to compare with
164170 *
165171 * Call iwpm_register_pid() to register a client
172+ * Returns true if the client registration matches reg,
173+ * otherwise returns false
174+ */
175+u32 iwpm_check_registration(u8 nl_client, u32 reg);
176+
177+/**
178+ * iwpm_set_registration - Set the client registration
179+ * @nl_client: The index of the netlink client
180+ * @reg: Registration type to set
166181 */
167−int iwpm_registered_client(u8 nl_client);
182+void iwpm_set_registration(u8 nl_client, u32 reg);
168183
169184 /**
170− * iwpm_set_registered - Set the port mapper client to registered or not
185+ * iwpm_get_registration
171186 * @nl_client: The index of the netlink client
172− * @reg: 1 if registered or 0 if not
187+ *
188+ * Returns the client registration type
173189 */
174−void iwpm_set_registered(u8 nl_client, int reg);
190+u32 iwpm_get_registration(u8 nl_client);
175191
176192 /**
177193 * iwpm_send_mapinfo - Send local and mapped IPv4/IPv6 address info of
drivers/infiniband/core/mad.c+17−30
@@ -769,7 +769,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, · 768 unmodified lines
769769 bool opa = rdma_cap_opa_mad(mad_agent_priv->qp_info->port_priv->device,
770770 mad_agent_priv->qp_info->port_priv->port_num);
771771
772− if (device->node_type == RDMA_NODE_IB_SWITCH &&
772+ if (rdma_cap_ib_switch(device) &&
773773 smp->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE)
774774 port_num = send_wr->wr.ud.port_num;
775775 else
@@ -787,14 +787,15 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, · 11 unmodified lines
787787 if ((opa_get_smp_direction(opa_smp)
788788 ? opa_smp->route.dr.dr_dlid : opa_smp->route.dr.dr_slid) ==
789789 OPA_LID_PERMISSIVE &&
790− opa_smi_handle_dr_smp_send(opa_smp, device->node_type,
790+ opa_smi_handle_dr_smp_send(opa_smp,
791+ rdma_cap_ib_switch(device),
791792 port_num) == IB_SMI_DISCARD) {
792793 ret = -EINVAL;
793794 dev_err(&device->dev, "OPA Invalid directed route\n");
794795 goto out;
795796 }
796797 opa_drslid = be32_to_cpu(opa_smp->route.dr.dr_slid);
797− if (opa_drslid != OPA_LID_PERMISSIVE &&
798+ if (opa_drslid != be32_to_cpu(OPA_LID_PERMISSIVE) &&
798799 opa_drslid & 0xffff0000) {
799800 ret = -EINVAL;
800801 dev_err(&device->dev, "OPA Invalid dr_slid 0x%x\n",
@@ -810,7 +811,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv, · 9 unmodified lines
810811 } else {
811812 if ((ib_get_smp_direction(smp) ? smp->dr_dlid : smp->dr_slid) ==
812813 IB_LID_PERMISSIVE &&
813− smi_handle_dr_smp_send(smp, device->node_type, port_num) ==
814+ smi_handle_dr_smp_send(smp, rdma_cap_ib_switch(device), port_num) ==
814815 IB_SMI_DISCARD) {
815816 ret = -EINVAL;
816817 dev_err(&device->dev, "Invalid directed route\n");
@@ -2030,7 +2031,7 @@ static enum smi_action handle_ib_smi(const struct ib_mad_port_private *port_priv · 1213 unmodified lines
20302031 struct ib_smp *smp = (struct ib_smp *)recv->mad;
20312032
20322033 if (smi_handle_dr_smp_recv(smp,
2033− port_priv->device->node_type,
2034+ rdma_cap_ib_switch(port_priv->device),
20342035 port_num,
20352036 port_priv->device->phys_port_cnt) ==
20362037 IB_SMI_DISCARD)
@@ -2042,13 +2043,13 @@ static enum smi_action handle_ib_smi(const struct ib_mad_port_private *port_priv · 5 unmodified lines
20422043
20432044 if (retsmi == IB_SMI_SEND) { /* don't forward */
20442045 if (smi_handle_dr_smp_send(smp,
2045− port_priv->device->node_type,
2046+ rdma_cap_ib_switch(port_priv->device),
20462047 port_num) == IB_SMI_DISCARD)
20472048 return IB_SMI_DISCARD;
20482049
20492050 if (smi_check_local_smp(smp, port_priv->device) == IB_SMI_DISCARD)
20502051 return IB_SMI_DISCARD;
2051− } else if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH) {
2052+ } else if (rdma_cap_ib_switch(port_priv->device)) {
20522053 /* forward case for switches */
20532054 memcpy(response, recv, mad_priv_size(response));
20542055 response->header.recv_wc.wc = &response->header.wc;
@@ -2115,7 +2116,7 @@ handle_opa_smi(struct ib_mad_port_private *port_priv, · 60 unmodified lines
21152116 struct opa_smp *smp = (struct opa_smp *)recv->mad;
21162117
21172118 if (opa_smi_handle_dr_smp_recv(smp,
2118− port_priv->device->node_type,
2119+ rdma_cap_ib_switch(port_priv->device),
21192120 port_num,
21202121 port_priv->device->phys_port_cnt) ==
21212122 IB_SMI_DISCARD)
@@ -2127,7 +2128,7 @@ handle_opa_smi(struct ib_mad_port_private *port_priv, · 5 unmodified lines
21272128
21282129 if (retsmi == IB_SMI_SEND) { /* don't forward */
21292130 if (opa_smi_handle_dr_smp_send(smp,
2130− port_priv->device->node_type,
2131+ rdma_cap_ib_switch(port_priv->device),
21312132 port_num) == IB_SMI_DISCARD)
21322133 return IB_SMI_DISCARD;
21332134
@@ -2135,7 +2136,7 @@ handle_opa_smi(struct ib_mad_port_private *port_priv, · 1 unmodified line
21352136 IB_SMI_DISCARD)
21362137 return IB_SMI_DISCARD;
21372138
2138− } else if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH) {
2139+ } else if (rdma_cap_ib_switch(port_priv->device)) {
21392140 /* forward case for switches */
21402141 memcpy(response, recv, mad_priv_size(response));
21412142 response->header.recv_wc.wc = &response->header.wc;
@@ -2235,7 +2236,7 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, · 93 unmodified lines
22352236 goto out;
22362237 }
22372238
2238− if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH)
2239+ if (rdma_cap_ib_switch(port_priv->device))
22392240 port_num = wc->port_num;
22402241 else
22412242 port_num = port_priv->port_num;
@@ -3297,17 +3298,11 @@ static int ib_mad_port_close(struct ib_device *device, int port_num) · 1055 unmodified lines
32973298
32983299 static void ib_mad_init_device(struct ib_device *device)
32993300 {
3300− int start, end, i;
3301+ int start, i;
33013302
3302− if (device->node_type == RDMA_NODE_IB_SWITCH) {
3303− start = 0;
3304− end = 0;
3305− } else {
3306− start = 1;
3307− end = device->phys_port_cnt;
3308− }
3303+ start = rdma_start_port(device);
33093304
3310− for (i = start; i <= end; i++) {
3305+ for (i = start; i <= rdma_end_port(device); i++) {
33113306 if (!rdma_cap_ib_mad(device, i))
33123307 continue;
33133308
@@ -3342,17 +3337,9 @@ error: · 28 unmodified lines
33423337
33433338 static void ib_mad_remove_device(struct ib_device *device)
33443339 {
3345− int start, end, i;
3346−
3347− if (device->node_type == RDMA_NODE_IB_SWITCH) {
3348− start = 0;
3349− end = 0;
3350− } else {
3351− start = 1;
3352− end = device->phys_port_cnt;
3353− }
3340+ int i;
33543341
3355− for (i = start; i <= end; i++) {
3342+ for (i = rdma_start_port(device); i <= rdma_end_port(device); i++) {
33563343 if (!rdma_cap_ib_mad(device, i))
33573344 continue;
33583345
drivers/infiniband/core/multicast.c+2−6
@@ -812,12 +812,8 @@ static void mcast_add_one(struct ib_device *device) · 811 unmodified lines
812812 if (!dev)
813813 return;
814814
815− if (device->node_type == RDMA_NODE_IB_SWITCH)
816− dev->start_port = dev->end_port = 0;
817− else {
818− dev->start_port = 1;
819− dev->end_port = device->phys_port_cnt;
820− }
815+ dev->start_port = rdma_start_port(device);
816+ dev->end_port = rdma_end_port(device);
821817
822818 for (i = 0; i <= dev->end_port - dev->start_port; i++) {
823819 if (!rdma_cap_ib_mcast(device, dev->start_port + i))
drivers/infiniband/core/opa_smi.h+2−2
@@ -39,12 +39,12 @@ · 38 unmodified lines
3939
4040 #include "smi.h"
4141
42−enum smi_action opa_smi_handle_dr_smp_recv(struct opa_smp *smp, u8 node_type,
42+enum smi_action opa_smi_handle_dr_smp_recv(struct opa_smp *smp, bool is_switch,
4343 int port_num, int phys_port_cnt);
4444 int opa_smi_get_fwd_port(struct opa_smp *smp);
4545 extern enum smi_forward_action opa_smi_check_forward_dr_smp(struct opa_smp *smp);
4646 extern enum smi_action opa_smi_handle_dr_smp_send(struct opa_smp *smp,
47− u8 node_type, int port_num);
47+ bool is_switch, int port_num);
4848
4949 /*
5050 * Return IB_SMI_HANDLE if the SMP should be handled by the local SMA/SM
drivers/infiniband/core/sa_query.c+2−6
@@ -1156,12 +1156,8 @@ static void ib_sa_add_one(struct ib_device *device) · 1155 unmodified lines
11561156 int s, e, i;
11571157 int count = 0;
11581158
1159− if (device->node_type == RDMA_NODE_IB_SWITCH)
1160− s = e = 0;
1161− else {
1162− s = 1;
1163− e = device->phys_port_cnt;
1164− }
1159+ s = rdma_start_port(device);
1160+ e = rdma_end_port(device);
11651161
11661162 sa_dev = kzalloc(sizeof *sa_dev +
11671163 (e - s + 1) * sizeof (struct ib_sa_port),
drivers/infiniband/core/smi.c+18−19
@@ -41,7 +41,7 @@ · 40 unmodified lines
4141 #include "smi.h"
4242 #include "opa_smi.h"
4343
44−static enum smi_action __smi_handle_dr_smp_send(u8 node_type, int port_num,
44+static enum smi_action __smi_handle_dr_smp_send(bool is_switch, int port_num,
4545 u8 *hop_ptr, u8 hop_cnt,
4646 const u8 *initial_path,
4747 const u8 *return_path,
@@ -64,7 +64,7 @@ static enum smi_action __smi_handle_dr_smp_send(u8 node_type, int port_num, · 16 unmodified lines
6464
6565 /* C14-9:2 */
6666 if (*hop_ptr && *hop_ptr < hop_cnt) {
67− if (node_type != RDMA_NODE_IB_SWITCH)
67+ if (!is_switch)
6868 return IB_SMI_DISCARD;
6969
7070 /* return_path set when received */
@@ -77,7 +77,7 @@ static enum smi_action __smi_handle_dr_smp_send(u8 node_type, int port_num, · 6 unmodified lines
7777 if (*hop_ptr == hop_cnt) {
7878 /* return_path set when received */
7979 (*hop_ptr)++;
80− return (node_type == RDMA_NODE_IB_SWITCH ||
80+ return (is_switch ||
8181 dr_dlid_is_permissive ?
8282 IB_SMI_HANDLE : IB_SMI_DISCARD);
8383 }
@@ -96,7 +96,7 @@ static enum smi_action __smi_handle_dr_smp_send(u8 node_type, int port_num, · 12 unmodified lines
9696
9797 /* C14-13:2 */
9898 if (2 <= *hop_ptr && *hop_ptr <= hop_cnt) {
99− if (node_type != RDMA_NODE_IB_SWITCH)
99+ if (!is_switch)
100100 return IB_SMI_DISCARD;
101101
102102 (*hop_ptr)--;
@@ -108,7 +108,7 @@ static enum smi_action __smi_handle_dr_smp_send(u8 node_type, int port_num, · 5 unmodified lines
108108 if (*hop_ptr == 1) {
109109 (*hop_ptr)--;
110110 /* C14-13:3 -- SMPs destined for SM shouldn't be here */
111− return (node_type == RDMA_NODE_IB_SWITCH ||
111+ return (is_switch ||
112112 dr_slid_is_permissive ?
113113 IB_SMI_HANDLE : IB_SMI_DISCARD);
114114 }
@@ -127,9 +127,9 @@ static enum smi_action __smi_handle_dr_smp_send(u8 node_type, int port_num, · 12 unmodified lines
127127 * Return IB_SMI_DISCARD if the SMP should be discarded
128128 */
129129 enum smi_action smi_handle_dr_smp_send(struct ib_smp *smp,
130− u8 node_type, int port_num)
130+ bool is_switch, int port_num)
131131 {
132− return __smi_handle_dr_smp_send(node_type, port_num,
132+ return __smi_handle_dr_smp_send(is_switch, port_num,
133133 &smp->hop_ptr, smp->hop_cnt,
134134 smp->initial_path,
135135 smp->return_path,
@@ -139,9 +139,9 @@ enum smi_action smi_handle_dr_smp_send(struct ib_smp *smp, · 3 unmodified lines
139139 }
140140
141141 enum smi_action opa_smi_handle_dr_smp_send(struct opa_smp *smp,
142− u8 node_type, int port_num)
142+ bool is_switch, int port_num)
143143 {
144− return __smi_handle_dr_smp_send(node_type, port_num,
144+ return __smi_handle_dr_smp_send(is_switch, port_num,
145145 &smp->hop_ptr, smp->hop_cnt,
146146 smp->route.dr.initial_path,
147147 smp->route.dr.return_path,
@@ -152,7 +152,7 @@ enum smi_action opa_smi_handle_dr_smp_send(struct opa_smp *smp, · 4 unmodified lines
152152 OPA_LID_PERMISSIVE);
153153 }
154154
155−static enum smi_action __smi_handle_dr_smp_recv(u8 node_type, int port_num,
155+static enum smi_action __smi_handle_dr_smp_recv(bool is_switch, int port_num,
156156 int phys_port_cnt,
157157 u8 *hop_ptr, u8 hop_cnt,
158158 const u8 *initial_path,
@@ -173,7 +173,7 @@ static enum smi_action __smi_handle_dr_smp_recv(u8 node_type, int port_num, · 14 unmodified lines
173173
174174 /* C14-9:2 -- intermediate hop */
175175 if (*hop_ptr && *hop_ptr < hop_cnt) {
176− if (node_type != RDMA_NODE_IB_SWITCH)
176+ if (!is_switch)
177177 return IB_SMI_DISCARD;
178178
179179 return_path[*hop_ptr] = port_num;
@@ -188,7 +188,7 @@ static enum smi_action __smi_handle_dr_smp_recv(u8 node_type, int port_num, · 8 unmodified lines
188188 return_path[*hop_ptr] = port_num;
189189 /* hop_ptr updated when sending */
190190
191− return (node_type == RDMA_NODE_IB_SWITCH ||
191+ return (is_switch ||
192192 dr_dlid_is_permissive ?
193193 IB_SMI_HANDLE : IB_SMI_DISCARD);
194194 }
@@ -208,7 +208,7 @@ static enum smi_action __smi_handle_dr_smp_recv(u8 node_type, int port_num, · 13 unmodified lines
208208
209209 /* C14-13:2 */
210210 if (2 <= *hop_ptr && *hop_ptr <= hop_cnt) {
211− if (node_type != RDMA_NODE_IB_SWITCH)
211+ if (!is_switch)
212212 return IB_SMI_DISCARD;
213213
214214 /* hop_ptr updated when sending */
@@ -224,8 +224,7 @@ static enum smi_action __smi_handle_dr_smp_recv(u8 node_type, int port_num, · 9 unmodified lines
224224 return IB_SMI_HANDLE;
225225 }
226226 /* hop_ptr updated when sending */
227− return (node_type == RDMA_NODE_IB_SWITCH ?
228− IB_SMI_HANDLE : IB_SMI_DISCARD);
227+ return (is_switch ? IB_SMI_HANDLE : IB_SMI_DISCARD);
229228 }
230229
231230 /* C14-13:4 -- hop_ptr = 0 -> give to SM */
@@ -238,10 +237,10 @@ static enum smi_action __smi_handle_dr_smp_recv(u8 node_type, int port_num, · 6 unmodified lines
238237 * Adjust information for a received SMP
239238 * Return IB_SMI_DISCARD if the SMP should be dropped
240239 */
241−enum smi_action smi_handle_dr_smp_recv(struct ib_smp *smp, u8 node_type,
240+enum smi_action smi_handle_dr_smp_recv(struct ib_smp *smp, bool is_switch,
242241 int port_num, int phys_port_cnt)
243242 {
244− return __smi_handle_dr_smp_recv(node_type, port_num, phys_port_cnt,
243+ return __smi_handle_dr_smp_recv(is_switch, port_num, phys_port_cnt,
245244 &smp->hop_ptr, smp->hop_cnt,
246245 smp->initial_path,
247246 smp->return_path,
@@ -254,10 +253,10 @@ enum smi_action smi_handle_dr_smp_recv(struct ib_smp *smp, u8 node_type, · 6 unmodified lines
254253 * Adjust information for a received SMP
255254 * Return IB_SMI_DISCARD if the SMP should be dropped
256255 */
257−enum smi_action opa_smi_handle_dr_smp_recv(struct opa_smp *smp, u8 node_type,
256+enum smi_action opa_smi_handle_dr_smp_recv(struct opa_smp *smp, bool is_switch,
258257 int port_num, int phys_port_cnt)
259258 {
260− return __smi_handle_dr_smp_recv(node_type, port_num, phys_port_cnt,
259+ return __smi_handle_dr_smp_recv(is_switch, port_num, phys_port_cnt,
261260 &smp->hop_ptr, smp->hop_cnt,
262261 smp->route.dr.initial_path,
263262 smp->route.dr.return_path,
drivers/infiniband/core/smi.h+2−2
@@ -51,12 +51,12 @@ enum smi_forward_action { · 50 unmodified lines
5151 IB_SMI_FORWARD /* SMP should be forwarded (for switches only) */
5252 };
5353
54−enum smi_action smi_handle_dr_smp_recv(struct ib_smp *smp, u8 node_type,
54+enum smi_action smi_handle_dr_smp_recv(struct ib_smp *smp, bool is_switch,
5555 int port_num, int phys_port_cnt);
5656 int smi_get_fwd_port(struct ib_smp *smp);
5757 extern enum smi_forward_action smi_check_forward_dr_smp(struct ib_smp *smp);
5858 extern enum smi_action smi_handle_dr_smp_send(struct ib_smp *smp,
59− u8 node_type, int port_num);
59+ bool is_switch, int port_num);
6060
6161 /*
6262 * Return IB_SMI_HANDLE if the SMP should be handled by the local SMA/SM
drivers/infiniband/core/sysfs.c+1−1
@@ -870,7 +870,7 @@ int ib_device_register_sysfs(struct ib_device *device, · 869 unmodified lines
870870 goto err_put;
871871 }
872872
873− if (device->node_type == RDMA_NODE_IB_SWITCH) {
873+ if (rdma_cap_ib_switch(device)) {
874874 ret = add_port(device, 0, port_callback);
875875 if (ret)
876876 goto err_put;
drivers/infiniband/core/ucm.c+2−2
@@ -1193,6 +1193,7 @@ static int ib_ucm_close(struct inode *inode, struct file *filp) · 1192 unmodified lines
11931193 return 0;
11941194 }
11951195
1196+static DECLARE_BITMAP(overflow_map, IB_UCM_MAX_DEVICES);
11961197 static void ib_ucm_release_dev(struct device *dev)
11971198 {
11981199 struct ib_ucm_device *ucm_dev;
@@ -1202,7 +1203,7 @@ static void ib_ucm_release_dev(struct device *dev) · 3 unmodified lines
12021203 if (ucm_dev->devnum < IB_UCM_MAX_DEVICES)
12031204 clear_bit(ucm_dev->devnum, dev_map);
12041205 else
1205− clear_bit(ucm_dev->devnum - IB_UCM_MAX_DEVICES, dev_map);
1206+ clear_bit(ucm_dev->devnum - IB_UCM_MAX_DEVICES, overflow_map);
12061207 kfree(ucm_dev);
12071208 }
12081209
@@ -1226,7 +1227,6 @@ static ssize_t show_ibdev(struct device *dev, struct device_attribute *attr, · 17 unmodified lines
12261227 static DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);
12271228
12281229 static dev_t overflow_maj;
1229−static DECLARE_BITMAP(overflow_map, IB_UCM_MAX_DEVICES);
12301230 static int find_overflow_devnum(void)
12311231 {
12321232 int ret;
drivers/infiniband/core/ucma.c+3−2
@@ -1354,10 +1354,10 @@ static void ucma_lock_files(struct ucma_file *file1, struct ucma_file *file2) · 1353 unmodified lines
13541354 /* Acquire mutex's based on pointer comparison to prevent deadlock. */
13551355 if (file1 < file2) {
13561356 mutex_lock(&file1->mut);
1357− mutex_lock(&file2->mut);
1357+ mutex_lock_nested(&file2->mut, SINGLE_DEPTH_NESTING);
13581358 } else {
13591359 mutex_lock(&file2->mut);
1360− mutex_lock(&file1->mut);
1360+ mutex_lock_nested(&file1->mut, SINGLE_DEPTH_NESTING);
13611361 }
13621362 }
13631363
@@ -1616,6 +1616,7 @@ static void __exit ucma_cleanup(void) · 252 unmodified lines
16161616 device_remove_file(ucma_misc.this_device, &dev_attr_abi_version);
16171617 misc_deregister(&ucma_misc);
16181618 idr_destroy(&ctx_idr);
1619+ idr_destroy(&multicast_idr);
16191620 }
16201621
16211622 module_init(ucma_init);
drivers/infiniband/hw/ehca/ehca_sqp.c+3−2
@@ -226,8 +226,9 @@ int ehca_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num, · 225 unmodified lines
226226 const struct ib_mad *in_mad = (const struct ib_mad *)in;
227227 struct ib_mad *out_mad = (struct ib_mad *)out;
228228
229− BUG_ON(in_mad_size != sizeof(*in_mad) ||
230− *out_mad_size != sizeof(*out_mad));
229+ if (WARN_ON_ONCE(in_mad_size != sizeof(*in_mad) ||
230+ *out_mad_size != sizeof(*out_mad)))
231+ return IB_MAD_RESULT_FAILURE;
231232
232233 if (!port_num || port_num > ibdev->phys_port_cnt || !in_wc)
233234 return IB_MAD_RESULT_FAILURE;
drivers/infiniband/hw/ipath/ipath_mad.c+3−2
@@ -1499,8 +1499,9 @@ int ipath_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num, · 1498 unmodified lines
14991499 const struct ib_mad *in_mad = (const struct ib_mad *)in;
15001500 struct ib_mad *out_mad = (struct ib_mad *)out;
15011501
1502− BUG_ON(in_mad_size != sizeof(*in_mad) ||
1503− *out_mad_size != sizeof(*out_mad));
1502+ if (WARN_ON_ONCE(in_mad_size != sizeof(*in_mad) ||
1503+ *out_mad_size != sizeof(*out_mad)))
1504+ return IB_MAD_RESULT_FAILURE;
15041505
15051506 switch (in_mad->mad_hdr.mgmt_class) {
15061507 case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE:
drivers/infiniband/hw/ipath/ipath_verbs.c+2−2
@@ -2044,9 +2044,9 @@ int ipath_register_ib_device(struct ipath_devdata *dd) · 2043 unmodified lines
20442044
20452045 spin_lock_init(&idev->qp_table.lock);
20462046 spin_lock_init(&idev->lk_table.lock);
2047− idev->sm_lid = __constant_be16_to_cpu(IB_LID_PERMISSIVE);
2047+ idev->sm_lid = be16_to_cpu(IB_LID_PERMISSIVE);
20482048 /* Set the prefix to the default value (see ch. 4.1.1) */
2049− idev->gid_prefix = __constant_cpu_to_be64(0xfe80000000000000ULL);
2049+ idev->gid_prefix = cpu_to_be64(0xfe80000000000000ULL);
20502050
20512051 ret = ipath_init_qp_table(idev, ib_ipath_qp_table_size);
20522052 if (ret)
drivers/infiniband/hw/mlx4/mad.c+22−12
@@ -860,21 +860,31 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num, · 859 unmodified lines
860860 struct mlx4_ib_dev *dev = to_mdev(ibdev);
861861 const struct ib_mad *in_mad = (const struct ib_mad *)in;
862862 struct ib_mad *out_mad = (struct ib_mad *)out;
863+ enum rdma_link_layer link = rdma_port_get_link_layer(ibdev, port_num);
863864
864− BUG_ON(in_mad_size != sizeof(*in_mad) ||
865− *out_mad_size != sizeof(*out_mad));
865+ if (WARN_ON_ONCE(in_mad_size != sizeof(*in_mad) ||
866+ *out_mad_size != sizeof(*out_mad)))
867+ return IB_MAD_RESULT_FAILURE;
866868
867− switch (rdma_port_get_link_layer(ibdev, port_num)) {
868− case IB_LINK_LAYER_INFINIBAND:
869− if (!mlx4_is_slave(dev->dev))
870− return ib_process_mad(ibdev, mad_flags, port_num, in_wc,
871− in_grh, in_mad, out_mad);
872− case IB_LINK_LAYER_ETHERNET:
873− return iboe_process_mad(ibdev, mad_flags, port_num, in_wc,
874− in_grh, in_mad, out_mad);
875− default:
876− return -EINVAL;
869+ /* iboe_process_mad() which uses the HCA flow-counters to implement IB PMA
870+ * queries, should be called only by VFs and for that specific purpose
871+ */
872+ if (link == IB_LINK_LAYER_INFINIBAND) {
873+ if (mlx4_is_slave(dev->dev) &&
874+ in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_PERF_MGMT &&
875+ in_mad->mad_hdr.attr_id == IB_PMA_PORT_COUNTERS)
876+ return iboe_process_mad(ibdev, mad_flags, port_num, in_wc,
877+ in_grh, in_mad, out_mad);
878+
879+ return ib_process_mad(ibdev, mad_flags, port_num, in_wc,
880+ in_grh, in_mad, out_mad);
877881 }
882+
883+ if (link == IB_LINK_LAYER_ETHERNET)
884+ return iboe_process_mad(ibdev, mad_flags, port_num, in_wc,
885+ in_grh, in_mad, out_mad);
886+
887+ return -EINVAL;
878888 }
879889
880890 static void send_handler(struct ib_mad_agent *agent,
drivers/infiniband/hw/mlx4/main.c+18−15
@@ -253,14 +253,15 @@ static int mlx4_ib_query_device(struct ib_device *ibdev, · 252 unmodified lines
253253 props->hca_core_clock = dev->dev->caps.hca_core_clock * 1000UL;
254254 props->timestamp_mask = 0xFFFFFFFFFFFFULL;
255255
256− err = mlx4_get_internal_clock_params(dev->dev, &clock_params);
257− if (err)
258− goto out;
256+ if (!mlx4_is_slave(dev->dev))
257+ err = mlx4_get_internal_clock_params(dev->dev, &clock_params);
259258
260259 if (uhw->outlen >= resp.response_length + sizeof(resp.hca_core_clock_offset)) {
261− resp.hca_core_clock_offset = clock_params.offset % PAGE_SIZE;
262260 resp.response_length += sizeof(resp.hca_core_clock_offset);
263− resp.comp_mask |= QUERY_DEVICE_RESP_MASK_TIMESTAMP;
261+ if (!err && !mlx4_is_slave(dev->dev)) {
262+ resp.comp_mask |= QUERY_DEVICE_RESP_MASK_TIMESTAMP;
263+ resp.hca_core_clock_offset = clock_params.offset % PAGE_SIZE;
264+ }
264265 }
265266
266267 if (uhw->outlen) {
@@ -2669,31 +2670,33 @@ static void do_slave_init(struct mlx4_ib_dev *ibdev, int slave, int do_init) · 2402 unmodified lines
26692670 dm = kcalloc(ports, sizeof(*dm), GFP_ATOMIC);
26702671 if (!dm) {
26712672 pr_err("failed to allocate memory for tunneling qp update\n");
2672− goto out;
2673+ return;
26732674 }
26742675
26752676 for (i = 0; i < ports; i++) {
26762677 dm[i] = kmalloc(sizeof (struct mlx4_ib_demux_work), GFP_ATOMIC);
26772678 if (!dm[i]) {
26782679 pr_err("failed to allocate memory for tunneling qp update work struct\n");
2679− for (i = 0; i < dev->caps.num_ports; i++) {
2680− if (dm[i])
2681− kfree(dm[i]);
2682− }
2680+ while (--i >= 0)
2681+ kfree(dm[i]);
26832682 goto out;
26842683 }
2685− }
2686− /* initialize or tear down tunnel QPs for the slave */
2687− for (i = 0; i < ports; i++) {
26882684 INIT_WORK(&dm[i]->work, mlx4_ib_tunnels_update_work);
26892685 dm[i]->port = first_port + i + 1;
26902686 dm[i]->slave = slave;
26912687 dm[i]->do_init = do_init;
26922688 dm[i]->dev = ibdev;
2693− spin_lock_irqsave(&ibdev->sriov.going_down_lock, flags);
2694− if (!ibdev->sriov.is_going_down)
2689+ }
2690+ /* initialize or tear down tunnel QPs for the slave */
2691+ spin_lock_irqsave(&ibdev->sriov.going_down_lock, flags);
2692+ if (!ibdev->sriov.is_going_down) {
2693+ for (i = 0; i < ports; i++)
26952694 queue_work(ibdev->sriov.demux[i].ud_wq, &dm[i]->work);
26962695 spin_unlock_irqrestore(&ibdev->sriov.going_down_lock, flags);
2696+ } else {
2697+ spin_unlock_irqrestore(&ibdev->sriov.going_down_lock, flags);
2698+ for (i = 0; i < ports; i++)
2699+ kfree(dm[i]);
26972700 }
26982701 out:
26992702 kfree(dm);
drivers/infiniband/hw/mlx5/mad.c+3−2
@@ -68,8 +68,9 @@ int mlx5_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num, · 67 unmodified lines
6868 const struct ib_mad *in_mad = (const struct ib_mad *)in;
6969 struct ib_mad *out_mad = (struct ib_mad *)out;
7070
71− BUG_ON(in_mad_size != sizeof(*in_mad) ||
72− *out_mad_size != sizeof(*out_mad));
71+ if (WARN_ON_ONCE(in_mad_size != sizeof(*in_mad) ||
72+ *out_mad_size != sizeof(*out_mad)))
73+ return IB_MAD_RESULT_FAILURE;
7374
7475 slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
7576
drivers/infiniband/hw/mthca/mthca_mad.c+3−2
@@ -209,8 +209,9 @@ int mthca_process_mad(struct ib_device *ibdev, · 208 unmodified lines
209209 const struct ib_mad *in_mad = (const struct ib_mad *)in;
210210 struct ib_mad *out_mad = (struct ib_mad *)out;
211211
212− BUG_ON(in_mad_size != sizeof(*in_mad) ||
213− *out_mad_size != sizeof(*out_mad));
212+ if (WARN_ON_ONCE(in_mad_size != sizeof(*in_mad) ||
213+ *out_mad_size != sizeof(*out_mad)))
214+ return IB_MAD_RESULT_FAILURE;
214215
215216 /* Forward locally generated traps to the SM */
216217 if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP &&
drivers/infiniband/hw/nes/nes_cm.c+3−2
@@ -1520,8 +1520,9 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi · 1519 unmodified lines
15201520 int rc = arpindex;
15211521 struct net_device *netdev;
15221522 struct nes_adapter *nesadapter = nesvnic->nesdev->nesadapter;
1523+ __be32 dst_ipaddr = htonl(dst_ip);
15231524
1524− rt = ip_route_output(&init_net, htonl(dst_ip), 0, 0, 0);
1525+ rt = ip_route_output(&init_net, dst_ipaddr, nesvnic->local_ipaddr, 0, 0);
15251526 if (IS_ERR(rt)) {
15261527 printk(KERN_ERR "%s: ip_route_output_key failed for 0x%08X\n",
15271528 __func__, dst_ip);
@@ -1533,7 +1534,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi · 5 unmodified lines
15331534 else
15341535 netdev = nesvnic->netdev;
15351536
1536− neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, netdev);
1537+ neigh = dst_neigh_lookup(&rt->dst, &dst_ipaddr);
15371538
15381539 rcu_read_lock();
15391540 if (neigh) {
drivers/infiniband/hw/nes/nes_hw.c+1−1
@@ -3861,7 +3861,7 @@ void nes_manage_arp_cache(struct net_device *netdev, unsigned char *mac_addr, · 3860 unmodified lines
38613861 (((u32)mac_addr[2]) << 24) | (((u32)mac_addr[3]) << 16) |
38623862 (((u32)mac_addr[4]) << 8) | (u32)mac_addr[5]);
38633863 cqp_wqe->wqe_words[NES_CQP_ARP_WQE_MAC_HIGH_IDX] = cpu_to_le32(
3864− (((u32)mac_addr[0]) << 16) | (u32)mac_addr[1]);
3864+ (((u32)mac_addr[0]) << 8) | (u32)mac_addr[1]);
38653865 } else {
38663866 cqp_wqe->wqe_words[NES_CQP_ARP_WQE_MAC_ADDR_LOW_IDX] = 0;
38673867 cqp_wqe->wqe_words[NES_CQP_ARP_WQE_MAC_HIGH_IDX] = 0;
drivers/infiniband/hw/ocrdma/ocrdma_ah.c+3−2
@@ -215,8 +215,9 @@ int ocrdma_process_mad(struct ib_device *ibdev, · 214 unmodified lines
215215 const struct ib_mad *in_mad = (const struct ib_mad *)in;
216216 struct ib_mad *out_mad = (struct ib_mad *)out;
217217
218− BUG_ON(in_mad_size != sizeof(*in_mad) ||
219− *out_mad_size != sizeof(*out_mad));
218+ if (WARN_ON_ONCE(in_mad_size != sizeof(*in_mad) ||
219+ *out_mad_size != sizeof(*out_mad)))
220+ return IB_MAD_RESULT_FAILURE;
220221
221222 switch (in_mad->mad_hdr.mgmt_class) {
222223 case IB_MGMT_CLASS_PERF_MGMT:
drivers/infiniband/hw/ocrdma/ocrdma_main.c+1−0
@@ -696,6 +696,7 @@ static void __exit ocrdma_exit_module(void) · 695 unmodified lines
696696 ocrdma_unregister_inet6addr_notifier();
697697 ocrdma_unregister_inetaddr_notifier();
698698 ocrdma_rem_debugfs();
699+ idr_destroy(&ocrdma_dev_id);
699700 }
700701
701702 module_init(ocrdma_init_module);
drivers/infiniband/hw/qib/qib_mad.c+3−2
@@ -2412,8 +2412,9 @@ int qib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port, · 2411 unmodified lines
24122412 const struct ib_mad *in_mad = (const struct ib_mad *)in;
24132413 struct ib_mad *out_mad = (struct ib_mad *)out;
24142414
2415− BUG_ON(in_mad_size != sizeof(*in_mad) ||
2416− *out_mad_size != sizeof(*out_mad));
2415+ if (WARN_ON_ONCE(in_mad_size != sizeof(*in_mad) ||
2416+ *out_mad_size != sizeof(*out_mad)))
2417+ return IB_MAD_RESULT_FAILURE;
24172418
24182419 switch (in_mad->mad_hdr.mgmt_class) {
24192420 case IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE:
drivers/infiniband/ulp/ipoib/ipoib.h+28−1
@@ -239,7 +239,7 @@ struct ipoib_cm_tx { · 238 unmodified lines
239239 struct net_device *dev;
240240 struct ipoib_neigh *neigh;
241241 struct ipoib_path *path;
242− struct ipoib_cm_tx_buf *tx_ring;
242+ struct ipoib_tx_buf *tx_ring;
243243 unsigned tx_head;
244244 unsigned tx_tail;
245245 unsigned long flags;
@@ -504,6 +504,33 @@ int ipoib_mcast_stop_thread(struct net_device *dev); · 258 unmodified lines
504504 void ipoib_mcast_dev_down(struct net_device *dev);
505505 void ipoib_mcast_dev_flush(struct net_device *dev);
506506
507+int ipoib_dma_map_tx(struct ib_device *ca, struct ipoib_tx_buf *tx_req);
508+void ipoib_dma_unmap_tx(struct ipoib_dev_priv *priv,
509+ struct ipoib_tx_buf *tx_req);
510+
511+static inline void ipoib_build_sge(struct ipoib_dev_priv *priv,
512+ struct ipoib_tx_buf *tx_req)
513+{
514+ int i, off;
515+ struct sk_buff *skb = tx_req->skb;
516+ skb_frag_t *frags = skb_shinfo(skb)->frags;
517+ int nr_frags = skb_shinfo(skb)->nr_frags;
518+ u64 *mapping = tx_req->mapping;
519+
520+ if (skb_headlen(skb)) {
521+ priv->tx_sge[0].addr = mapping[0];
522+ priv->tx_sge[0].length = skb_headlen(skb);
523+ off = 1;
524+ } else
525+ off = 0;
526+
527+ for (i = 0; i < nr_frags; ++i) {
528+ priv->tx_sge[i + off].addr = mapping[i + off];
529+ priv->tx_sge[i + off].length = skb_frag_size(&frags[i]);
530+ }
531+ priv->tx_wr.num_sge = nr_frags + off;
532+}
533+
507534 #ifdef CONFIG_INFINIBAND_IPOIB_DEBUG
508535 struct ipoib_mcast_iter *ipoib_mcast_iter_init(struct net_device *dev);
509536 int ipoib_mcast_iter_next(struct ipoib_mcast_iter *iter);
drivers/infiniband/ulp/ipoib/ipoib_cm.c+14−19
@@ -694,14 +694,12 @@ repost: · 693 unmodified lines
694694 static inline int post_send(struct ipoib_dev_priv *priv,
695695 struct ipoib_cm_tx *tx,
696696 unsigned int wr_id,
697− u64 addr, int len)
697+ struct ipoib_tx_buf *tx_req)
698698 {
699699 struct ib_send_wr *bad_wr;
700700
701− priv->tx_sge[0].addr = addr;
702− priv->tx_sge[0].length = len;
701+ ipoib_build_sge(priv, tx_req);
703702
704− priv->tx_wr.num_sge = 1;
705703 priv->tx_wr.wr_id = wr_id | IPOIB_OP_CM;
706704
707705 return ib_post_send(tx->qp, &priv->tx_wr, &bad_wr);
@@ -710,8 +708,7 @@ static inline int post_send(struct ipoib_dev_priv *priv, · 2 unmodified lines
710708 void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_tx *tx)
711709 {
712710 struct ipoib_dev_priv *priv = netdev_priv(dev);
713− struct ipoib_cm_tx_buf *tx_req;
714− u64 addr;
711+ struct ipoib_tx_buf *tx_req;
715712 int rc;
716713
717714 if (unlikely(skb->len > tx->mtu)) {
@@ -735,24 +732,21 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_ · 17 unmodified lines
735732 */
736733 tx_req = &tx->tx_ring[tx->tx_head & (ipoib_sendq_size - 1)];
737734 tx_req->skb = skb;
738− addr = ib_dma_map_single(priv->ca, skb->data, skb->len, DMA_TO_DEVICE);
739− if (unlikely(ib_dma_mapping_error(priv->ca, addr))) {
735+
736+ if (unlikely(ipoib_dma_map_tx(priv->ca, tx_req))) {
740737 ++dev->stats.tx_errors;
741738 dev_kfree_skb_any(skb);
742739 return;
743740 }
744741
745− tx_req->mapping = addr;
746−
747742 skb_orphan(skb);
748743 skb_dst_drop(skb);
749744
750− rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1),
751− addr, skb->len);
745+ rc = post_send(priv, tx, tx->tx_head & (ipoib_sendq_size - 1), tx_req);
752746 if (unlikely(rc)) {
753747 ipoib_warn(priv, "post_send failed, error %d\n", rc);
754748 ++dev->stats.tx_errors;
755− ib_dma_unmap_single(priv->ca, addr, skb->len, DMA_TO_DEVICE);
749+ ipoib_dma_unmap_tx(priv, tx_req);
756750 dev_kfree_skb_any(skb);
757751 } else {
758752 dev->trans_start = jiffies;
@@ -777,7 +771,7 @@ void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *wc) · 18 unmodified lines
777771 struct ipoib_dev_priv *priv = netdev_priv(dev);
778772 struct ipoib_cm_tx *tx = wc->qp->qp_context;
779773 unsigned int wr_id = wc->wr_id & ~IPOIB_OP_CM;
780− struct ipoib_cm_tx_buf *tx_req;
774+ struct ipoib_tx_buf *tx_req;
781775 unsigned long flags;
782776
783777 ipoib_dbg_data(priv, "cm send completion: id %d, status: %d\n",
@@ -791,7 +785,7 @@ void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *wc) · 7 unmodified lines
791785
792786 tx_req = &tx->tx_ring[wr_id];
793787
794− ib_dma_unmap_single(priv->ca, tx_req->mapping, tx_req->skb->len, DMA_TO_DEVICE);
788+ ipoib_dma_unmap_tx(priv, tx_req);
795789
796790 /* FIXME: is this right? Shouldn't we only increment on success? */
797791 ++dev->stats.tx_packets;
@@ -1036,6 +1030,9 @@ static struct ib_qp *ipoib_cm_create_tx_qp(struct net_device *dev, struct ipoib_ · 238 unmodified lines
10361030
10371031 struct ib_qp *tx_qp;
10381032
1033+ if (dev->features & NETIF_F_SG)
1034+ attr.cap.max_send_sge = MAX_SKB_FRAGS + 1;
1035+
10391036 tx_qp = ib_create_qp(priv->pd, &attr);
10401037 if (PTR_ERR(tx_qp) == -EINVAL) {
10411038 ipoib_warn(priv, "can't use GFP_NOIO for QPs on device %s, using GFP_KERNEL\n",
@@ -1170,7 +1167,7 @@ err_tx: · 128 unmodified lines
11701167 static void ipoib_cm_tx_destroy(struct ipoib_cm_tx *p)
11711168 {
11721169 struct ipoib_dev_priv *priv = netdev_priv(p->dev);
1173− struct ipoib_cm_tx_buf *tx_req;
1170+ struct ipoib_tx_buf *tx_req;
11741171 unsigned long begin;
11751172
11761173 ipoib_dbg(priv, "Destroy active connection 0x%x head 0x%x tail 0x%x\n",
@@ -1197,8 +1194,7 @@ timeout: · 20 unmodified lines
11971194
11981195 while ((int) p->tx_tail - (int) p->tx_head < 0) {
11991196 tx_req = &p->tx_ring[p->tx_tail & (ipoib_sendq_size - 1)];
1200− ib_dma_unmap_single(priv->ca, tx_req->mapping, tx_req->skb->len,
1201− DMA_TO_DEVICE);
1197+ ipoib_dma_unmap_tx(priv, tx_req);
12021198 dev_kfree_skb_any(tx_req->skb);
12031199 ++p->tx_tail;
12041200 netif_tx_lock_bh(p->dev);
@@ -1455,7 +1451,6 @@ static void ipoib_cm_stale_task(struct work_struct *work) · 250 unmodified lines
14551451 spin_unlock_irq(&priv->lock);
14561452 }
14571453
1458−
14591454 static ssize_t show_mode(struct device *d, struct device_attribute *attr,
14601455 char *buf)
14611456 {
drivers/infiniband/ulp/ipoib/ipoib_ib.c+18−31
@@ -263,8 +263,7 @@ repost: · 262 unmodified lines
263263 "for buf %d\n", wr_id);
264264 }
265265
266−static int ipoib_dma_map_tx(struct ib_device *ca,
267− struct ipoib_tx_buf *tx_req)
266+int ipoib_dma_map_tx(struct ib_device *ca, struct ipoib_tx_buf *tx_req)
268267 {
269268 struct sk_buff *skb = tx_req->skb;
270269 u64 *mapping = tx_req->mapping;
@@ -305,8 +304,8 @@ partial_error: · 34 unmodified lines
305304 return -EIO;
306305 }
307306
308−static void ipoib_dma_unmap_tx(struct ib_device *ca,
309− struct ipoib_tx_buf *tx_req)
307+void ipoib_dma_unmap_tx(struct ipoib_dev_priv *priv,
308+ struct ipoib_tx_buf *tx_req)
310309 {
311310 struct sk_buff *skb = tx_req->skb;
312311 u64 *mapping = tx_req->mapping;
@@ -314,7 +313,8 @@ static void ipoib_dma_unmap_tx(struct ib_device *ca, · 1 unmodified line
314313 int off;
315314
316315 if (skb_headlen(skb)) {
317− ib_dma_unmap_single(ca, mapping[0], skb_headlen(skb), DMA_TO_DEVICE);
316+ ib_dma_unmap_single(priv->ca, mapping[0], skb_headlen(skb),
317+ DMA_TO_DEVICE);
318318 off = 1;
319319 } else
320320 off = 0;
@@ -322,8 +322,8 @@ static void ipoib_dma_unmap_tx(struct ib_device *ca, · 1 unmodified line
322322 for (i = 0; i < skb_shinfo(skb)->nr_frags; ++i) {
323323 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
324324
325− ib_dma_unmap_page(ca, mapping[i + off], skb_frag_size(frag),
326− DMA_TO_DEVICE);
325+ ib_dma_unmap_page(priv->ca, mapping[i + off],
326+ skb_frag_size(frag), DMA_TO_DEVICE);
327327 }
328328 }
329329
@@ -389,7 +389,7 @@ static void ipoib_ib_handle_tx_wc(struct net_device *dev, struct ib_wc *wc) · 59 unmodified lines
389389
390390 tx_req = &priv->tx_ring[wr_id];
391391
392− ipoib_dma_unmap_tx(priv->ca, tx_req);
392+ ipoib_dma_unmap_tx(priv, tx_req);
393393
394394 ++dev->stats.tx_packets;
395395 dev->stats.tx_bytes += tx_req->skb->len;
@@ -514,24 +514,10 @@ static inline int post_send(struct ipoib_dev_priv *priv, · 118 unmodified lines
514514 void *head, int hlen)
515515 {
516516 struct ib_send_wr *bad_wr;
517− int i, off;
518517 struct sk_buff *skb = tx_req->skb;
519− skb_frag_t *frags = skb_shinfo(skb)->frags;
520− int nr_frags = skb_shinfo(skb)->nr_frags;
521− u64 *mapping = tx_req->mapping;
522518
523− if (skb_headlen(skb)) {
524− priv->tx_sge[0].addr = mapping[0];
525− priv->tx_sge[0].length = skb_headlen(skb);
526− off = 1;
527− } else
528− off = 0;
519+ ipoib_build_sge(priv, tx_req);
529520
530− for (i = 0; i < nr_frags; ++i) {
531− priv->tx_sge[i + off].addr = mapping[i + off];
532− priv->tx_sge[i + off].length = skb_frag_size(&frags[i]);
533− }
534− priv->tx_wr.num_sge = nr_frags + off;
535521 priv->tx_wr.wr_id = wr_id;
536522 priv->tx_wr.wr.ud.remote_qpn = qpn;
537523 priv->tx_wr.wr.ud.ah = address;
@@ -617,7 +603,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, · 79 unmodified lines
617603 ipoib_warn(priv, "post_send failed, error %d\n", rc);
618604 ++dev->stats.tx_errors;
619605 --priv->tx_outstanding;
620− ipoib_dma_unmap_tx(priv->ca, tx_req);
606+ ipoib_dma_unmap_tx(priv, tx_req);
621607 dev_kfree_skb_any(skb);
622608 if (netif_queue_stopped(dev))
623609 netif_wake_queue(dev);
@@ -868,7 +854,7 @@ int ipoib_ib_dev_stop(struct net_device *dev) · 244 unmodified lines
868854 while ((int) priv->tx_tail - (int) priv->tx_head < 0) {
869855 tx_req = &priv->tx_ring[priv->tx_tail &
870856 (ipoib_sendq_size - 1)];
871− ipoib_dma_unmap_tx(priv->ca, tx_req);
857+ ipoib_dma_unmap_tx(priv, tx_req);
872858 dev_kfree_skb_any(tx_req->skb);
873859 ++priv->tx_tail;
874860 --priv->tx_outstanding;
@@ -985,20 +971,21 @@ static inline int update_child_pkey(struct ipoib_dev_priv *priv) · 110 unmodified lines
985971 }
986972
987973 static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv,
988− enum ipoib_flush_level level)
974+ enum ipoib_flush_level level,
975+ int nesting)
989976 {
990977 struct ipoib_dev_priv *cpriv;
991978 struct net_device *dev = priv->dev;
992979 int result;
993980
994− down_read(&priv->vlan_rwsem);
981+ down_read_nested(&priv->vlan_rwsem, nesting);
995982
996983 /*
997984 * Flush any child interfaces too -- they might be up even if
998985 * the parent is down.
999986 */
1000987 list_for_each_entry(cpriv, &priv->child_intfs, list)
1001− __ipoib_ib_dev_flush(cpriv, level);
988+ __ipoib_ib_dev_flush(cpriv, level, nesting + 1);
1002989
1003990 up_read(&priv->vlan_rwsem);
1004991
@@ -1076,7 +1063,7 @@ void ipoib_ib_dev_flush_light(struct work_struct *work) · 71 unmodified lines
10761063 struct ipoib_dev_priv *priv =
10771064 container_of(work, struct ipoib_dev_priv, flush_light);
10781065
1079− __ipoib_ib_dev_flush(priv, IPOIB_FLUSH_LIGHT);
1066+ __ipoib_ib_dev_flush(priv, IPOIB_FLUSH_LIGHT, 0);
10801067 }
10811068
10821069 void ipoib_ib_dev_flush_normal(struct work_struct *work)
@@ -1084,7 +1071,7 @@ void ipoib_ib_dev_flush_normal(struct work_struct *work) · 1 unmodified line
10841071 struct ipoib_dev_priv *priv =
10851072 container_of(work, struct ipoib_dev_priv, flush_normal);
10861073
1087− __ipoib_ib_dev_flush(priv, IPOIB_FLUSH_NORMAL);
1074+ __ipoib_ib_dev_flush(priv, IPOIB_FLUSH_NORMAL, 0);
10881075 }
10891076
10901077 void ipoib_ib_dev_flush_heavy(struct work_struct *work)
@@ -1092,7 +1079,7 @@ void ipoib_ib_dev_flush_heavy(struct work_struct *work) · 1 unmodified line
10921079 struct ipoib_dev_priv *priv =
10931080 container_of(work, struct ipoib_dev_priv, flush_heavy);
10941081
1095− __ipoib_ib_dev_flush(priv, IPOIB_FLUSH_HEAVY);
1082+ __ipoib_ib_dev_flush(priv, IPOIB_FLUSH_HEAVY, 0);
10961083 }
10971084
10981085 void ipoib_ib_dev_cleanup(struct net_device *dev)
drivers/infiniband/ulp/ipoib/ipoib_main.c+8−13
@@ -190,7 +190,7 @@ static netdev_features_t ipoib_fix_features(struct net_device *dev, netdev_featu · 189 unmodified lines
190190 struct ipoib_dev_priv *priv = netdev_priv(dev);
191191
192192 if (test_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags))
193− features &= ~(NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO);
193+ features &= ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
194194
195195 return features;
196196 }
@@ -232,6 +232,7 @@ int ipoib_set_mode(struct net_device *dev, const char *buf) · 35 unmodified lines
232232 ipoib_warn(priv, "enabling connected mode "
233233 "will cause multicast packet drops\n");
234234 netdev_update_features(dev);
235+ dev_set_mtu(dev, ipoib_cm_max_mtu(dev));
235236 rtnl_unlock();
236237 priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM;
237238
@@ -1577,7 +1578,8 @@ static struct net_device *ipoib_add_port(const char *format, · 1339 unmodified lines
15771578 SET_NETDEV_DEV(priv->dev, hca->dma_device);
15781579 priv->dev->dev_id = port - 1;
15791580
1580− if (!ib_query_port(hca, port, &attr))
1581+ result = ib_query_port(hca, port, &attr);
1582+ if (!result)
15811583 priv->max_ib_mtu = ib_mtu_enum_to_int(attr.max_mtu);
15821584 else {
15831585 printk(KERN_WARNING "%s: ib_query_port %d failed\n",
@@ -1598,7 +1600,8 @@ static struct net_device *ipoib_add_port(const char *format, · 14 unmodified lines
15981600 goto device_init_failed;
15991601 }
16001602
1601− if (ipoib_set_dev_features(priv, hca))
1603+ result = ipoib_set_dev_features(priv, hca);
1604+ if (result)
16021605 goto device_init_failed;
16031606
16041607 /*
@@ -1684,7 +1687,7 @@ static void ipoib_add_one(struct ib_device *device) · 79 unmodified lines
16841687 struct list_head *dev_list;
16851688 struct net_device *dev;
16861689 struct ipoib_dev_priv *priv;
1687− int s, e, p;
1690+ int p;
16881691 int count = 0;
16891692
16901693 dev_list = kmalloc(sizeof *dev_list, GFP_KERNEL);
@@ -1693,15 +1696,7 @@ static void ipoib_add_one(struct ib_device *device) · 2 unmodified lines
16931696
16941697 INIT_LIST_HEAD(dev_list);
16951698
1696− if (device->node_type == RDMA_NODE_IB_SWITCH) {
1697− s = 0;
1698− e = 0;
1699− } else {
1700− s = 1;
1701− e = device->phys_port_cnt;
1702− }
1703−
1704− for (p = s; p <= e; ++p) {
1699+ for (p = rdma_start_port(device); p <= rdma_end_port(device); ++p) {
17051700 if (!rdma_protocol_ib(device, p))
17061701 continue;
17071702 dev = ipoib_add_port("ib%d", device, p);
drivers/infiniband/ulp/srp/ib_srp.c+6−17
@@ -161,13 +161,10 @@ static int srp_tmo_set(const char *val, const struct kernel_param *kp) · 160 unmodified lines
161161 {
162162 int tmo, res;
163163
164− if (strncmp(val, "off", 3) != 0) {
165− res = kstrtoint(val, 0, &tmo);
166− if (res)
167− goto out;
168− } else {
169− tmo = -1;
170− }
164+ res = srp_parse_tmo(&tmo, val);
165+ if (res)
166+ goto out;
167+
171168 if (kp->arg == &srp_reconnect_delay)
172169 res = srp_tmo_valid(tmo, srp_fast_io_fail_tmo,
173170 srp_dev_loss_tmo);
@@ -3379,7 +3376,7 @@ static void srp_add_one(struct ib_device *device) · 3205 unmodified lines
33793376 struct srp_device *srp_dev;
33803377 struct ib_device_attr *dev_attr;
33813378 struct srp_host *host;
3382− int mr_page_shift, s, e, p;
3379+ int mr_page_shift, p;
33833380 u64 max_pages_per_mr;
33843381
33853382 dev_attr = kmalloc(sizeof *dev_attr, GFP_KERNEL);
@@ -3443,15 +3440,7 @@ static void srp_add_one(struct ib_device *device) · 57 unmodified lines
34433440 if (IS_ERR(srp_dev->mr))
34443441 goto err_pd;
34453442
3446− if (device->node_type == RDMA_NODE_IB_SWITCH) {
3447− s = 0;
3448− e = 0;
3449− } else {
3450− s = 1;
3451− e = device->phys_port_cnt;
3452− }
3453−
3454− for (p = s; p <= e; ++p) {
3443+ for (p = rdma_start_port(device); p <= rdma_end_port(device); ++p) {
34553444 host = srp_add_port(srp_dev, p);
34563445 if (host)
34573446 list_add_tail(&host->list, &srp_dev->dev_list);
drivers/infiniband/ulp/srpt/ib_srpt.c+35−36
@@ -302,7 +302,7 @@ static void srpt_get_iou(struct ib_dm_mad *mad) · 301 unmodified lines
302302 int i;
303303
304304 ioui = (struct ib_dm_iou_info *)mad->data;
305− ioui->change_id = __constant_cpu_to_be16(1);
305+ ioui->change_id = cpu_to_be16(1);
306306 ioui->max_controllers = 16;
307307
308308 /* set present for slot 1 and empty for the rest */
@@ -330,13 +330,13 @@ static void srpt_get_ioc(struct srpt_port *sport, u32 slot, · 21 unmodified lines
330330
331331 if (!slot || slot > 16) {
332332 mad->mad_hdr.status
333− = __constant_cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD);
333+ = cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD);
334334 return;
335335 }
336336
337337 if (slot > 2) {
338338 mad->mad_hdr.status
339− = __constant_cpu_to_be16(DM_MAD_STATUS_NO_IOC);
339+ = cpu_to_be16(DM_MAD_STATUS_NO_IOC);
340340 return;
341341 }
342342
@@ -348,10 +348,10 @@ static void srpt_get_ioc(struct srpt_port *sport, u32 slot, · 5 unmodified lines
348348 iocp->device_version = cpu_to_be16(sdev->dev_attr.hw_ver);
349349 iocp->subsys_vendor_id = cpu_to_be32(sdev->dev_attr.vendor_id);
350350 iocp->subsys_device_id = 0x0;
351− iocp->io_class = __constant_cpu_to_be16(SRP_REV16A_IB_IO_CLASS);
352− iocp->io_subclass = __constant_cpu_to_be16(SRP_IO_SUBCLASS);
353− iocp->protocol = __constant_cpu_to_be16(SRP_PROTOCOL);
354− iocp->protocol_version = __constant_cpu_to_be16(SRP_PROTOCOL_VERSION);
351+ iocp->io_class = cpu_to_be16(SRP_REV16A_IB_IO_CLASS);
352+ iocp->io_subclass = cpu_to_be16(SRP_IO_SUBCLASS);
353+ iocp->protocol = cpu_to_be16(SRP_PROTOCOL);
354+ iocp->protocol_version = cpu_to_be16(SRP_PROTOCOL_VERSION);
355355 iocp->send_queue_depth = cpu_to_be16(sdev->srq_size);
356356 iocp->rdma_read_depth = 4;
357357 iocp->send_size = cpu_to_be32(srp_max_req_size);
@@ -379,13 +379,13 @@ static void srpt_get_svc_entries(u64 ioc_guid, · 21 unmodified lines
379379
380380 if (!slot || slot > 16) {
381381 mad->mad_hdr.status
382− = __constant_cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD);
382+ = cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD);
383383 return;
384384 }
385385
386386 if (slot > 2 || lo > hi || hi > 1) {
387387 mad->mad_hdr.status
388− = __constant_cpu_to_be16(DM_MAD_STATUS_NO_IOC);
388+ = cpu_to_be16(DM_MAD_STATUS_NO_IOC);
389389 return;
390390 }
391391
@@ -436,7 +436,7 @@ static void srpt_mgmt_method_get(struct srpt_port *sp, struct ib_mad *rq_mad, · 44 unmodified lines
436436 break;
437437 default:
438438 rsp_mad->mad_hdr.status =
439− __constant_cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD_ATTR);
439+ cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD_ATTR);
440440 break;
441441 }
442442 }
@@ -493,11 +493,11 @@ static void srpt_mad_recv_handler(struct ib_mad_agent *mad_agent, · 50 unmodified lines
493493 break;
494494 case IB_MGMT_METHOD_SET:
495495 dm_mad->mad_hdr.status =
496− __constant_cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD_ATTR);
496+ cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD_ATTR);
497497 break;
498498 default:
499499 dm_mad->mad_hdr.status =
500− __constant_cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD);
500+ cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD);
501501 break;
502502 }
503503
@@ -1535,7 +1535,7 @@ static int srpt_build_cmd_rsp(struct srpt_rdma_ch *ch, · 1031 unmodified lines
15351535 memset(srp_rsp, 0, sizeof *srp_rsp);
15361536 srp_rsp->opcode = SRP_RSP;
15371537 srp_rsp->req_lim_delta =
1538− __constant_cpu_to_be32(1 + atomic_xchg(&ch->req_lim_delta, 0));
1538+ cpu_to_be32(1 + atomic_xchg(&ch->req_lim_delta, 0));
15391539 srp_rsp->tag = tag;
15401540 srp_rsp->status = status;
15411541
@@ -1585,8 +1585,8 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, · 43 unmodified lines
15851585 memset(srp_rsp, 0, sizeof *srp_rsp);
15861586
15871587 srp_rsp->opcode = SRP_RSP;
1588− srp_rsp->req_lim_delta = __constant_cpu_to_be32(1
1589− + atomic_xchg(&ch->req_lim_delta, 0));
1588+ srp_rsp->req_lim_delta =
1589+ cpu_to_be32(1 + atomic_xchg(&ch->req_lim_delta, 0));
15901590 srp_rsp->tag = tag;
15911591
15921592 srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
@@ -1630,7 +1630,7 @@ static uint64_t srpt_unpack_lun(const uint8_t *lun, int len) · 37 unmodified lines
16301630 switch (len) {
16311631 case 8:
16321632 if ((*((__be64 *)lun) &
1633− __constant_cpu_to_be64(0x0000FFFFFFFFFFFFLL)) != 0)
1633+ cpu_to_be64(0x0000FFFFFFFFFFFFLL)) != 0)
16341634 goto out_err;
16351635 break;
16361636 case 4:
@@ -2449,8 +2449,8 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 812 unmodified lines
24492449 }
24502450
24512451 if (it_iu_len > srp_max_req_size || it_iu_len < 64) {
2452− rej->reason = __constant_cpu_to_be32(
2453− SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE);
2452+ rej->reason = cpu_to_be32(
2453+ SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE);
24542454 ret = -EINVAL;
24552455 pr_err("rejected SRP_LOGIN_REQ because its"
24562456 " length (%d bytes) is out of range (%d .. %d)\n",
@@ -2459,8 +2459,8 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 2 unmodified lines
24592459 }
24602460
24612461 if (!sport->enabled) {
2462− rej->reason = __constant_cpu_to_be32(
2463− SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
2462+ rej->reason = cpu_to_be32(
2463+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
24642464 ret = -EINVAL;
24652465 pr_err("rejected SRP_LOGIN_REQ because the target port"
24662466 " has not yet been enabled\n");
@@ -2505,8 +2505,8 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 38 unmodified lines
25052505 if (*(__be64 *)req->target_port_id != cpu_to_be64(srpt_service_guid)
25062506 || *(__be64 *)(req->target_port_id + 8) !=
25072507 cpu_to_be64(srpt_service_guid)) {
2508− rej->reason = __constant_cpu_to_be32(
2509− SRP_LOGIN_REJ_UNABLE_ASSOCIATE_CHANNEL);
2508+ rej->reason = cpu_to_be32(
2509+ SRP_LOGIN_REJ_UNABLE_ASSOCIATE_CHANNEL);
25102510 ret = -ENOMEM;
25112511 pr_err("rejected SRP_LOGIN_REQ because it"
25122512 " has an invalid target port identifier.\n");
@@ -2515,8 +2515,8 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 2 unmodified lines
25152515
25162516 ch = kzalloc(sizeof *ch, GFP_KERNEL);
25172517 if (!ch) {
2518− rej->reason = __constant_cpu_to_be32(
2519− SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
2518+ rej->reason = cpu_to_be32(
2519+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
25202520 pr_err("rejected SRP_LOGIN_REQ because no memory.\n");
25212521 ret = -ENOMEM;
25222522 goto reject;
@@ -2552,8 +2552,8 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 29 unmodified lines
25522552
25532553 ret = srpt_create_ch_ib(ch);
25542554 if (ret) {
2555− rej->reason = __constant_cpu_to_be32(
2556− SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
2555+ rej->reason = cpu_to_be32(
2556+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
25572557 pr_err("rejected SRP_LOGIN_REQ because creating"
25582558 " a new RDMA channel failed.\n");
25592559 goto free_ring;
@@ -2561,8 +2561,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 1 unmodified line
25612561
25622562 ret = srpt_ch_qp_rtr(ch, ch->qp);
25632563 if (ret) {
2564− rej->reason = __constant_cpu_to_be32(
2565− SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
2564+ rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
25662565 pr_err("rejected SRP_LOGIN_REQ because enabling"
25672566 " RTR failed (error code = %d)\n", ret);
25682567 goto destroy_ib;
@@ -2580,15 +2579,15 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 11 unmodified lines
25802579 if (!nacl) {
25812580 pr_info("Rejected login because no ACL has been"
25822581 " configured yet for initiator %s.\n", ch->sess_name);
2583− rej->reason = __constant_cpu_to_be32(
2584− SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED);
2582+ rej->reason = cpu_to_be32(
2583+ SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED);
25852584 goto destroy_ib;
25862585 }
25872586
25882587 ch->sess = transport_init_session(TARGET_PROT_NORMAL);
25892588 if (IS_ERR(ch->sess)) {
2590− rej->reason = __constant_cpu_to_be32(
2591− SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
2589+ rej->reason = cpu_to_be32(
2590+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
25922591 pr_debug("Failed to create session\n");
25932592 goto deregister_session;
25942593 }
@@ -2604,8 +2603,8 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, · 9 unmodified lines
26042603 rsp->max_it_iu_len = req->req_it_iu_len;
26052604 rsp->max_ti_iu_len = req->req_it_iu_len;
26062605 ch->max_ti_iu_len = it_iu_len;
2607− rsp->buf_fmt = __constant_cpu_to_be16(SRP_BUF_FORMAT_DIRECT
2608− | SRP_BUF_FORMAT_INDIRECT);
2606+ rsp->buf_fmt = cpu_to_be16(SRP_BUF_FORMAT_DIRECT
2607+ | SRP_BUF_FORMAT_INDIRECT);
26092608 rsp->req_lim_delta = cpu_to_be32(ch->rq_size);
26102609 atomic_set(&ch->req_lim, ch->rq_size);
26112610 atomic_set(&ch->req_lim_delta, 0);
@@ -2655,8 +2654,8 @@ free_ch: · 43 unmodified lines
26552654 reject:
26562655 rej->opcode = SRP_LOGIN_REJ;
26572656 rej->tag = req->tag;
2658− rej->buf_fmt = __constant_cpu_to_be16(SRP_BUF_FORMAT_DIRECT
2659− | SRP_BUF_FORMAT_INDIRECT);
2657+ rej->buf_fmt = cpu_to_be16(SRP_BUF_FORMAT_DIRECT
2658+ | SRP_BUF_FORMAT_INDIRECT);
26602659
26612660 ib_send_cm_rej(cm_id, IB_CM_REJ_CONSUMER_DEFINED, NULL, 0,
26622661 (void *)rej, sizeof *rej);
drivers/irqchip/irq-gic-v3-its.c+75−36
@@ -75,6 +75,13 @@ struct its_node { · 74 unmodified lines
7575
7676 #define ITS_ITT_ALIGN SZ_256
7777
78+struct event_lpi_map {
79+ unsigned long *lpi_map;
80+ u16 *col_map;
81+ irq_hw_number_t lpi_base;
82+ int nr_lpis;
83+};
84+
7885 /*
7986 * The ITS view of a device - belongs to an ITS, a collection, owns an
8087 * interrupt translation table, and a list of interrupts.
@@ -82,11 +89,8 @@ struct its_node { · 1 unmodified line
8289 struct its_device {
8390 struct list_head entry;
8491 struct its_node *its;
85− struct its_collection *collection;
92+ struct event_lpi_map event_map;
8693 void *itt;
87− unsigned long *lpi_map;
88− irq_hw_number_t lpi_base;
89− int nr_lpis;
9094 u32 nr_ites;
9195 u32 device_id;
9296 };
@@ -99,6 +103,14 @@ static struct rdists *gic_rdists; · 6 unmodified lines
99103 #define gic_data_rdist() (raw_cpu_ptr(gic_rdists->rdist))
100104 #define gic_data_rdist_rd_base() (gic_data_rdist()->rd_base)
101105
106+static struct its_collection *dev_event_to_col(struct its_device *its_dev,
107+ u32 event)
108+{
109+ struct its_node *its = its_dev->its;
110+
111+ return its->collections + its_dev->event_map.col_map[event];
112+}
113+
102114 /*
103115 * ITS command descriptors - parameters to be encoded in a command
104116 * block.
@@ -134,7 +146,7 @@ struct its_cmd_desc { · 29 unmodified lines
134146 struct {
135147 struct its_device *dev;
136148 struct its_collection *col;
137− u32 id;
149+ u32 event_id;
138150 } its_movi_cmd;
139151
140152 struct {
@@ -241,7 +253,7 @@ static struct its_collection *its_build_mapd_cmd(struct its_cmd_block *cmd, · 100 unmodified lines
241253
242254 its_fixup_cmd(cmd);
243255
244− return desc->its_mapd_cmd.dev->collection;
256+ return NULL;
245257 }
246258
247259 static struct its_collection *its_build_mapc_cmd(struct its_cmd_block *cmd,
@@ -260,52 +272,72 @@ static struct its_collection *its_build_mapc_cmd(struct its_cmd_block *cmd, · 12 unmodified lines
260272 static struct its_collection *its_build_mapvi_cmd(struct its_cmd_block *cmd,
261273 struct its_cmd_desc *desc)
262274 {
275+ struct its_collection *col;
276+
277+ col = dev_event_to_col(desc->its_mapvi_cmd.dev,
278+ desc->its_mapvi_cmd.event_id);
279+
263280 its_encode_cmd(cmd, GITS_CMD_MAPVI);
264281 its_encode_devid(cmd, desc->its_mapvi_cmd.dev->device_id);
265282 its_encode_event_id(cmd, desc->its_mapvi_cmd.event_id);
266283 its_encode_phys_id(cmd, desc->its_mapvi_cmd.phys_id);
267− its_encode_collection(cmd, desc->its_mapvi_cmd.dev->collection->col_id);
284+ its_encode_collection(cmd, col->col_id);
268285
269286 its_fixup_cmd(cmd);
270287
271− return desc->its_mapvi_cmd.dev->collection;
288+ return col;
272289 }
273290
274291 static struct its_collection *its_build_movi_cmd(struct its_cmd_block *cmd,
275292 struct its_cmd_desc *desc)
276293 {
294+ struct its_collection *col;
295+
296+ col = dev_event_to_col(desc->its_movi_cmd.dev,
297+ desc->its_movi_cmd.event_id);
298+
277299 its_encode_cmd(cmd, GITS_CMD_MOVI);
278300 its_encode_devid(cmd, desc->its_movi_cmd.dev->device_id);
279− its_encode_event_id(cmd, desc->its_movi_cmd.id);
301+ its_encode_event_id(cmd, desc->its_movi_cmd.event_id);
280302 its_encode_collection(cmd, desc->its_movi_cmd.col->col_id);
281303
282304 its_fixup_cmd(cmd);
283305
284− return desc->its_movi_cmd.dev->collection;
306+ return col;
285307 }
286308
287309 static struct its_collection *its_build_discard_cmd(struct its_cmd_block *cmd,
288310 struct its_cmd_desc *desc)
289311 {
312+ struct its_collection *col;
313+
314+ col = dev_event_to_col(desc->its_discard_cmd.dev,
315+ desc->its_discard_cmd.event_id);
316+
290317 its_encode_cmd(cmd, GITS_CMD_DISCARD);
291318 its_encode_devid(cmd, desc->its_discard_cmd.dev->device_id);
292319 its_encode_event_id(cmd, desc->its_discard_cmd.event_id);
293320
294321 its_fixup_cmd(cmd);
295322
296− return desc->its_discard_cmd.dev->collection;
323+ return col;
297324 }
298325
299326 static struct its_collection *its_build_inv_cmd(struct its_cmd_block *cmd,
300327 struct its_cmd_desc *desc)
301328 {
329+ struct its_collection *col;
330+
331+ col = dev_event_to_col(desc->its_inv_cmd.dev,
332+ desc->its_inv_cmd.event_id);
333+
302334 its_encode_cmd(cmd, GITS_CMD_INV);
303335 its_encode_devid(cmd, desc->its_inv_cmd.dev->device_id);
304336 its_encode_event_id(cmd, desc->its_inv_cmd.event_id);
305337
306338 its_fixup_cmd(cmd);
307339
308− return desc->its_inv_cmd.dev->collection;
340+ return col;
309341 }
310342
311343 static struct its_collection *its_build_invall_cmd(struct its_cmd_block *cmd,
@@ -497,7 +529,7 @@ static void its_send_movi(struct its_device *dev, · 185 unmodified lines
497529
498530 desc.its_movi_cmd.dev = dev;
499531 desc.its_movi_cmd.col = col;
500− desc.its_movi_cmd.id = id;
532+ desc.its_movi_cmd.event_id = id;
501533
502534 its_send_single_command(dev->its, its_build_movi_cmd, &desc);
503535 }
@@ -528,7 +560,7 @@ static void its_send_invall(struct its_node *its, struct its_collection *col) · 24 unmodified lines
528560 static inline u32 its_get_event_id(struct irq_data *d)
529561 {
530562 struct its_device *its_dev = irq_data_get_irq_chip_data(d);
531− return d->hwirq - its_dev->lpi_base;
563+ return d->hwirq - its_dev->event_map.lpi_base;
532564 }
533565
534566 static void lpi_set_config(struct irq_data *d, bool enable)
@@ -583,7 +615,7 @@ static int its_set_affinity(struct irq_data *d, const struct cpumask *mask_val, · 48 unmodified lines
583615
584616 target_col = &its_dev->its->collections[cpu];
585617 its_send_movi(its_dev, target_col, id);
586− its_dev->collection = target_col;
618+ its_dev->event_map.col_map[id] = cpu;
587619
588620 return IRQ_SET_MASK_OK_DONE;
589621 }
@@ -713,8 +745,10 @@ out: · 123 unmodified lines
713745 return bitmap;
714746 }
715747
716−static void its_lpi_free(unsigned long *bitmap, int base, int nr_ids)
748+static void its_lpi_free(struct event_lpi_map *map)
717749 {
750+ int base = map->lpi_base;
751+ int nr_ids = map->nr_lpis;
718752 int lpi;
719753
720754 spin_lock(&lpi_lock);
@@ -731,7 +765,8 @@ static void its_lpi_free(unsigned long *bitmap, int base, int nr_ids) · 10 unmodified lines
731765
732766 spin_unlock(&lpi_lock);
733767
734− kfree(bitmap);
768+ kfree(map->lpi_map);
769+ kfree(map->col_map);
735770 }
736771
737772 /*
@@ -1099,11 +1134,11 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, · 361 unmodified lines
10991134 struct its_device *dev;
11001135 unsigned long *lpi_map;
11011136 unsigned long flags;
1137+ u16 *col_map = NULL;
11021138 void *itt;
11031139 int lpi_base;
11041140 int nr_lpis;
11051141 int nr_ites;
1106− int cpu;
11071142 int sz;
11081143
11091144 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
@@ -1117,20 +1152,24 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, · 7 unmodified lines
11171152 sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1;
11181153 itt = kzalloc(sz, GFP_KERNEL);
11191154 lpi_map = its_lpi_alloc_chunks(nvecs, &lpi_base, &nr_lpis);
1155+ if (lpi_map)
1156+ col_map = kzalloc(sizeof(*col_map) * nr_lpis, GFP_KERNEL);
11201157
1121− if (!dev || !itt || !lpi_map) {
1158+ if (!dev || !itt || !lpi_map || !col_map) {
11221159 kfree(dev);
11231160 kfree(itt);
11241161 kfree(lpi_map);
1162+ kfree(col_map);
11251163 return NULL;
11261164 }
11271165
11281166 dev->its = its;
11291167 dev->itt = itt;
11301168 dev->nr_ites = nr_ites;
1131− dev->lpi_map = lpi_map;
1132− dev->lpi_base = lpi_base;
1133− dev->nr_lpis = nr_lpis;
1169+ dev->event_map.lpi_map = lpi_map;
1170+ dev->event_map.col_map = col_map;
1171+ dev->event_map.lpi_base = lpi_base;
1172+ dev->event_map.nr_lpis = nr_lpis;
11341173 dev->device_id = dev_id;
11351174 INIT_LIST_HEAD(&dev->entry);
11361175
@@ -1138,10 +1177,6 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, · 1 unmodified line
11381177 list_add(&dev->entry, &its->its_device_list);
11391178 raw_spin_unlock_irqrestore(&its->lock, flags);
11401179
1141− /* Bind the device to the first possible CPU */
1142− cpu = cpumask_first(cpu_online_mask);
1143− dev->collection = &its->collections[cpu];
1144−
11451180 /* Map device to its ITT */
11461181 its_send_mapd(dev, 1);
11471182
@@ -1163,12 +1198,13 @@ static int its_alloc_device_irq(struct its_device *dev, irq_hw_number_t *hwirq) · 15 unmodified lines
11631198 {
11641199 int idx;
11651200
1166− idx = find_first_zero_bit(dev->lpi_map, dev->nr_lpis);
1167− if (idx == dev->nr_lpis)
1201+ idx = find_first_zero_bit(dev->event_map.lpi_map,
1202+ dev->event_map.nr_lpis);
1203+ if (idx == dev->event_map.nr_lpis)
11681204 return -ENOSPC;
11691205
1170− *hwirq = dev->lpi_base + idx;
1171− set_bit(idx, dev->lpi_map);
1206+ *hwirq = dev->event_map.lpi_base + idx;
1207+ set_bit(idx, dev->event_map.lpi_map);
11721208
11731209 return 0;
11741210 }
@@ -1288,7 +1324,8 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, · 113 unmodified lines
12881324 irq_domain_set_hwirq_and_chip(domain, virq + i,
12891325 hwirq, &its_irq_chip, its_dev);
12901326 dev_dbg(info->scratchpad[1].ptr, "ID:%d pID:%d vID:%d\n",
1291− (int)(hwirq - its_dev->lpi_base), (int)hwirq, virq + i);
1327+ (int)(hwirq - its_dev->event_map.lpi_base),
1328+ (int)hwirq, virq + i);
12921329 }
12931330
12941331 return 0;
@@ -1300,6 +1337,9 @@ static void its_irq_domain_activate(struct irq_domain *domain, · 5 unmodified lines
13001337 struct its_device *its_dev = irq_data_get_irq_chip_data(d);
13011338 u32 event = its_get_event_id(d);
13021339
1340+ /* Bind the LPI to the first possible CPU */
1341+ its_dev->event_map.col_map[event] = cpumask_first(cpu_online_mask);
1342+
13031343 /* Map the GIC IRQ and event to the device */
13041344 its_send_mapvi(its_dev, d->hwirq, event);
13051345 }
@@ -1327,17 +1367,16 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, · 21 unmodified lines
13271367 u32 event = its_get_event_id(data);
13281368
13291369 /* Mark interrupt index as unused */
1330− clear_bit(event, its_dev->lpi_map);
1370+ clear_bit(event, its_dev->event_map.lpi_map);
13311371
13321372 /* Nuke the entry in the domain */
13331373 irq_domain_reset_irq_data(data);
13341374 }
13351375
13361376 /* If all interrupts have been freed, start mopping the floor */
1337− if (bitmap_empty(its_dev->lpi_map, its_dev->nr_lpis)) {
1338− its_lpi_free(its_dev->lpi_map,
1339− its_dev->lpi_base,
1340− its_dev->nr_lpis);
1377+ if (bitmap_empty(its_dev->event_map.lpi_map,
1378+ its_dev->event_map.nr_lpis)) {
1379+ its_lpi_free(&its_dev->event_map);
13411380
13421381 /* Unmap device/itt */
13431382 its_send_mapd(its_dev, 0);
drivers/irqchip/spear-shirq.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * SPEAr platform shared irq layer source file
33 *
44 * Copyright (C) 2009-2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * Copyright (C) 2012 ST Microelectronics
88 * Shiraz Hashim <shiraz.linux.kernel@gmail.com>
drivers/isdn/gigaset/ser-gigaset.c+10−25
@@ -524,9 +524,18 @@ gigaset_tty_open(struct tty_struct *tty) · 523 unmodified lines
524524 cs->hw.ser->tty = tty;
525525 atomic_set(&cs->hw.ser->refcnt, 1);
526526 init_completion(&cs->hw.ser->dead_cmp);
527−
528527 tty->disc_data = cs;
529528
529+ /* Set the amount of data we're willing to receive per call
530+ * from the hardware driver to half of the input buffer size
531+ * to leave some reserve.
532+ * Note: We don't do flow control towards the hardware driver.
533+ * If more data is received than will fit into the input buffer,
534+ * it will be dropped and an error will be logged. This should
535+ * never happen as the device is slow and the buffer size ample.
536+ */
537+ tty->receive_room = RBUFSIZE/2;
538+
530539 /* OK.. Initialization of the datastructures and the HW is done.. Now
531540 * startup system and notify the LL that we are ready to run
532541 */
@@ -597,28 +606,6 @@ static int gigaset_tty_hangup(struct tty_struct *tty) · 64 unmodified lines
597606 return 0;
598607 }
599608
600−/*
601− * Read on the tty.
602− * Unused, received data goes only to the Gigaset driver.
603− */
604−static ssize_t
605−gigaset_tty_read(struct tty_struct *tty, struct file *file,
606− unsigned char __user *buf, size_t count)
607−{
608− return -EAGAIN;
609−}
610−
611−/*
612− * Write on the tty.
613− * Unused, transmit data comes only from the Gigaset driver.
614− */
615−static ssize_t
616−gigaset_tty_write(struct tty_struct *tty, struct file *file,
617− const unsigned char *buf, size_t count)
618−{
619− return -EAGAIN;
620−}
621−
622609 /*
623610 * Ioctl on the tty.
624611 * Called in process context only.
@@ -752,8 +739,6 @@ static struct tty_ldisc_ops gigaset_ldisc = { · 127 unmodified lines
752739 .open = gigaset_tty_open,
753740 .close = gigaset_tty_close,
754741 .hangup = gigaset_tty_hangup,
755− .read = gigaset_tty_read,
756− .write = gigaset_tty_write,
757742 .ioctl = gigaset_tty_ioctl,
758743 .receive_buf = gigaset_tty_receive,
759744 .write_wakeup = gigaset_tty_wakeup,
drivers/md/bcache/closure.h+0−3
@@ -320,7 +320,6 @@ static inline void closure_wake_up(struct closure_waitlist *list) · 319 unmodified lines
320320 do { \
321321 set_closure_fn(_cl, _fn, _wq); \
322322 closure_sub(_cl, CLOSURE_RUNNING + 1); \
323− return; \
324323 } while (0)
325324
326325 /**
@@ -349,7 +348,6 @@ do { \ · 22 unmodified lines
349348 do { \
350349 set_closure_fn(_cl, _fn, _wq); \
351350 closure_queue(_cl); \
352− return; \
353351 } while (0)
354352
355353 /**
@@ -365,7 +363,6 @@ do { \ · 9 unmodified lines
365363 do { \
366364 set_closure_fn(_cl, _destructor, NULL); \
367365 closure_sub(_cl, CLOSURE_RUNNING - CLOSURE_DESTRUCTOR + 1); \
368− return; \
369366 } while (0)
370367
371368 /**
drivers/md/bcache/io.c+1−0
@@ -105,6 +105,7 @@ void bch_generic_make_request(struct bio *bio, struct bio_split_pool *p) · 104 unmodified lines
105105 } while (n != bio);
106106
107107 continue_at(&s->cl, bch_bio_submit_split_done, NULL);
108+ return;
108109 submit:
109110 generic_make_request(bio);
110111 }
drivers/md/bcache/journal.c+2−0
@@ -592,12 +592,14 @@ static void journal_write_unlocked(struct closure *cl) · 591 unmodified lines
592592
593593 if (!w->need_write) {
594594 closure_return_with_destructor(cl, journal_write_unlock);
595+ return;
595596 } else if (journal_full(&c->journal)) {
596597 journal_reclaim(c);
597598 spin_unlock(&c->journal.lock);
598599
599600 btree_flush_write(c);
600601 continue_at(cl, journal_write, system_wq);
602+ return;
601603 }
602604
603605 c->journal.blocks_free -= set_blocks(w->data, block_bytes(c));
drivers/md/bcache/request.c+11−3
@@ -88,8 +88,10 @@ static void bch_data_insert_keys(struct closure *cl) · 87 unmodified lines
8888 if (journal_ref)
8989 atomic_dec_bug(journal_ref);
9090
91− if (!op->insert_data_done)
91+ if (!op->insert_data_done) {
9292 continue_at(cl, bch_data_insert_start, op->wq);
93+ return;
94+ }
9395
9496 bch_keylist_free(&op->insert_keys);
9597 closure_return(cl);
@@ -216,8 +218,10 @@ static void bch_data_insert_start(struct closure *cl) · 120 unmodified lines
216218 /* 1 for the device pointer and 1 for the chksum */
217219 if (bch_keylist_realloc(&op->insert_keys,
218220 3 + (op->csum ? 1 : 0),
219− op->c))
221+ op->c)) {
220222 continue_at(cl, bch_data_insert_keys, op->wq);
223+ return;
224+ }
221225
222226 k = op->insert_keys.top;
223227 bkey_init(k);
@@ -255,6 +259,7 @@ static void bch_data_insert_start(struct closure *cl) · 31 unmodified lines
255259
256260 op->insert_data_done = true;
257261 continue_at(cl, bch_data_insert_keys, op->wq);
262+ return;
258263 err:
259264 /* bch_alloc_sectors() blocks if s->writeback = true */
260265 BUG_ON(op->writeback);
@@ -576,8 +581,10 @@ static void cache_lookup(struct closure *cl) · 315 unmodified lines
576581 ret = bch_btree_map_keys(&s->op, s->iop.c,
577582 &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0),
578583 cache_lookup_fn, MAP_END_KEY);
579− if (ret == -EAGAIN)
584+ if (ret == -EAGAIN) {
580585 continue_at(cl, cache_lookup, bcache_wq);
586+ return;
587+ }
581588
582589 closure_return(cl);
583590 }
@@ -1085,6 +1092,7 @@ static void flash_dev_make_request(struct request_queue *q, struct bio *bio) · 501 unmodified lines
10851092 continue_at_nobarrier(&s->cl,
10861093 flash_dev_nodata,
10871094 bcache_wq);
1095+ return;
10881096 } else if (rw) {
10891097 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys,
10901098 &KEY(d->id, bio->bi_iter.bi_sector, 0),
drivers/md/dm-cache-target.c+23−15
@@ -424,7 +424,6 @@ static void free_migration(struct dm_cache_migration *mg) · 423 unmodified lines
424424 wake_up(&cache->migration_wait);
425425
426426 mempool_free(mg, cache->migration_pool);
427− wake_worker(cache);
428427 }
429428
430429 static int prealloc_data_structs(struct cache *cache, struct prealloc *p)
@@ -1947,6 +1946,7 @@ static int commit_if_needed(struct cache *cache) · 1516 unmodified lines
19471946
19481947 static void process_deferred_bios(struct cache *cache)
19491948 {
1949+ bool prealloc_used = false;
19501950 unsigned long flags;
19511951 struct bio_list bios;
19521952 struct bio *bio;
@@ -1981,13 +1981,16 @@ static void process_deferred_bios(struct cache *cache) · 28 unmodified lines
19811981 process_discard_bio(cache, &structs, bio);
19821982 else
19831983 process_bio(cache, &structs, bio);
1984+ prealloc_used = true;
19841985 }
19851986
1986− prealloc_free_structs(cache, &structs);
1987+ if (prealloc_used)
1988+ prealloc_free_structs(cache, &structs);
19871989 }
19881990
19891991 static void process_deferred_cells(struct cache *cache)
19901992 {
1993+ bool prealloc_used = false;
19911994 unsigned long flags;
19921995 struct dm_bio_prison_cell *cell, *tmp;
19931996 struct list_head cells;
@@ -2015,9 +2018,11 @@ static void process_deferred_cells(struct cache *cache) · 21 unmodified lines
20152018 }
20162019
20172020 process_cell(cache, &structs, cell);
2021+ prealloc_used = true;
20182022 }
20192023
2020− prealloc_free_structs(cache, &structs);
2024+ if (prealloc_used)
2025+ prealloc_free_structs(cache, &structs);
20212026 }
20222027
20232028 static void process_deferred_flush_bios(struct cache *cache, bool submit_bios)
@@ -2062,7 +2067,7 @@ static void process_deferred_writethrough_bios(struct cache *cache) · 38 unmodified lines
20622067
20632068 static void writeback_some_dirty_blocks(struct cache *cache)
20642069 {
2065− int r = 0;
2070+ bool prealloc_used = false;
20662071 dm_oblock_t oblock;
20672072 dm_cblock_t cblock;
20682073 struct prealloc structs;
@@ -2072,23 +2077,21 @@ static void writeback_some_dirty_blocks(struct cache *cache) · 3 unmodified lines
20722077 memset(&structs, 0, sizeof(structs));
20732078
20742079 while (spare_migration_bandwidth(cache)) {
2075− if (prealloc_data_structs(cache, &structs))
2076− break;
2080+ if (policy_writeback_work(cache->policy, &oblock, &cblock, busy))
2081+ break; /* no work to do */
20772082
2078− r = policy_writeback_work(cache->policy, &oblock, &cblock, busy);
2079− if (r)
2080− break;
2081−
2082− r = get_cell(cache, oblock, &structs, &old_ocell);
2083− if (r) {
2083+ if (prealloc_data_structs(cache, &structs) ||
2084+ get_cell(cache, oblock, &structs, &old_ocell)) {
20842085 policy_set_dirty(cache->policy, oblock);
20852086 break;
20862087 }
20872088
20882089 writeback(cache, &structs, oblock, cblock, old_ocell);
2090+ prealloc_used = true;
20892091 }
20902092
2091− prealloc_free_structs(cache, &structs);
2093+ if (prealloc_used)
2094+ prealloc_free_structs(cache, &structs);
20922095 }
20932096
20942097 /*----------------------------------------------------------------
@@ -3496,7 +3499,7 @@ static void cache_resume(struct dm_target *ti) · 1401 unmodified lines
34963499 * <#demotions> <#promotions> <#dirty>
34973500 * <#features> <features>*
34983501 * <#core args> <core args>
3499− * <policy name> <#policy args> <policy args>* <cache metadata mode>
3502+ * <policy name> <#policy args> <policy args>* <cache metadata mode> <needs_check>
35003503 */
35013504 static void cache_status(struct dm_target *ti, status_type_t type,
35023505 unsigned status_flags, char *result, unsigned maxlen)
@@ -3582,6 +3585,11 @@ static void cache_status(struct dm_target *ti, status_type_t type, · 79 unmodified lines
35823585 else
35833586 DMEMIT("rw ");
35843587
3588+ if (dm_cache_metadata_needs_check(cache->cmd))
3589+ DMEMIT("needs_check ");
3590+ else
3591+ DMEMIT("- ");
3592+
35853593 break;
35863594
35873595 case STATUSTYPE_TABLE:
@@ -3820,7 +3828,7 @@ static void cache_io_hints(struct dm_target *ti, struct queue_limits *limits) · 232 unmodified lines
38203828
38213829 static struct target_type cache_target = {
38223830 .name = "cache",
3823− .version = {1, 7, 0},
3831+ .version = {1, 8, 0},
38243832 .module = THIS_MODULE,
38253833 .ctr = cache_ctr,
38263834 .dtr = cache_dtr,
drivers/md/dm-thin.c+37−7
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/init.h>
1919 #include <linux/module.h>
2020 #include <linux/slab.h>
21+#include <linux/vmalloc.h>
2122 #include <linux/sort.h>
2223 #include <linux/rbtree.h>
2324
@@ -268,7 +269,7 @@ struct pool { · 244 unmodified lines
268269 process_mapping_fn process_prepared_mapping;
269270 process_mapping_fn process_prepared_discard;
270271
271− struct dm_bio_prison_cell *cell_sort_array[CELL_SORT_ARRAY_SIZE];
272+ struct dm_bio_prison_cell **cell_sort_array;
272273 };
273274
274275 static enum pool_mode get_pool_mode(struct pool *pool);
@@ -2281,18 +2282,23 @@ static void do_waker(struct work_struct *ws) · 2006 unmodified lines
22812282 queue_delayed_work(pool->wq, &pool->waker, COMMIT_PERIOD);
22822283 }
22832284
2285+static void notify_of_pool_mode_change_to_oods(struct pool *pool);
2286+
22842287 /*
22852288 * We're holding onto IO to allow userland time to react. After the
22862289 * timeout either the pool will have been resized (and thus back in
2287− * PM_WRITE mode), or we degrade to PM_READ_ONLY and start erroring IO.
2290+ * PM_WRITE mode), or we degrade to PM_OUT_OF_DATA_SPACE w/ error_if_no_space.
22882291 */
22892292 static void do_no_space_timeout(struct work_struct *ws)
22902293 {
22912294 struct pool *pool = container_of(to_delayed_work(ws), struct pool,
22922295 no_space_timeout);
22932296
2294− if (get_pool_mode(pool) == PM_OUT_OF_DATA_SPACE && !pool->pf.error_if_no_space)
2295− set_pool_mode(pool, PM_READ_ONLY);
2297+ if (get_pool_mode(pool) == PM_OUT_OF_DATA_SPACE && !pool->pf.error_if_no_space) {
2298+ pool->pf.error_if_no_space = true;
2299+ notify_of_pool_mode_change_to_oods(pool);
2300+ error_retry_list(pool);
2301+ }
22962302 }
22972303
22982304 /*----------------------------------------------------------------*/
@@ -2370,6 +2376,14 @@ static void notify_of_pool_mode_change(struct pool *pool, const char *new_mode) · 71 unmodified lines
23702376 dm_device_name(pool->pool_md), new_mode);
23712377 }
23722378
2379+static void notify_of_pool_mode_change_to_oods(struct pool *pool)
2380+{
2381+ if (!pool->pf.error_if_no_space)
2382+ notify_of_pool_mode_change(pool, "out-of-data-space (queue IO)");
2383+ else
2384+ notify_of_pool_mode_change(pool, "out-of-data-space (error IO)");
2385+}
2386+
23732387 static bool passdown_enabled(struct pool_c *pt)
23742388 {
23752389 return pt->adjusted_pf.discard_passdown;
@@ -2454,7 +2468,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) · 78 unmodified lines
24542468 * frequently seeing this mode.
24552469 */
24562470 if (old_mode != new_mode)
2457− notify_of_pool_mode_change(pool, "out-of-data-space");
2471+ notify_of_pool_mode_change_to_oods(pool);
24582472 pool->process_bio = process_bio_read_only;
24592473 pool->process_discard = process_discard_bio;
24602474 pool->process_cell = process_cell_read_only;
@@ -2777,6 +2791,7 @@ static void __pool_destroy(struct pool *pool) · 316 unmodified lines
27772791 {
27782792 __pool_table_remove(pool);
27792793
2794+ vfree(pool->cell_sort_array);
27802795 if (dm_pool_metadata_close(pool->pmd) < 0)
27812796 DMWARN("%s: dm_pool_metadata_close() failed.", __func__);
27822797
@@ -2889,6 +2904,13 @@ static struct pool *pool_create(struct mapped_device *pool_md, · 106 unmodified lines
28892904 goto bad_mapping_pool;
28902905 }
28912906
2907+ pool->cell_sort_array = vmalloc(sizeof(*pool->cell_sort_array) * CELL_SORT_ARRAY_SIZE);
2908+ if (!pool->cell_sort_array) {
2909+ *error = "Error allocating cell sort array";
2910+ err_p = ERR_PTR(-ENOMEM);
2911+ goto bad_sort_array;
2912+ }
2913+
28922914 pool->ref_count = 1;
28932915 pool->last_commit_jiffies = jiffies;
28942916 pool->pool_md = pool_md;
@@ -2897,6 +2919,8 @@ static struct pool *pool_create(struct mapped_device *pool_md, · 2 unmodified lines
28972919
28982920 return pool;
28992921
2922+bad_sort_array:
2923+ mempool_destroy(pool->mapping_pool);
29002924 bad_mapping_pool:
29012925 dm_deferred_set_destroy(pool->all_io_ds);
29022926 bad_all_io_ds:
@@ -3714,6 +3738,7 @@ static void emit_flags(struct pool_features *pf, char *result, · 811 unmodified lines
37143738 * Status line is:
37153739 * <transaction id> <used metadata sectors>/<total metadata sectors>
37163740 * <used data sectors>/<total data sectors> <held metadata root>
3741+ * <pool mode> <discard config> <no space config> <needs_check>
37173742 */
37183743 static void pool_status(struct dm_target *ti, status_type_t type,
37193744 unsigned status_flags, char *result, unsigned maxlen)
@@ -3815,6 +3840,11 @@ static void pool_status(struct dm_target *ti, status_type_t type, · 95 unmodified lines
38153840 else
38163841 DMEMIT("queue_if_no_space ");
38173842
3843+ if (dm_pool_metadata_needs_check(pool->pmd))
3844+ DMEMIT("needs_check ");
3845+ else
3846+ DMEMIT("- ");
3847+
38183848 break;
38193849
38203850 case STATUSTYPE_TABLE:
@@ -3918,7 +3948,7 @@ static struct target_type pool_target = { · 97 unmodified lines
39183948 .name = "thin-pool",
39193949 .features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE |
39203950 DM_TARGET_IMMUTABLE,
3921− .version = {1, 15, 0},
3951+ .version = {1, 16, 0},
39223952 .module = THIS_MODULE,
39233953 .ctr = pool_ctr,
39243954 .dtr = pool_dtr,
@@ -4305,7 +4335,7 @@ static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits) · 380 unmodified lines
43054335
43064336 static struct target_type thin_target = {
43074337 .name = "thin",
4308− .version = {1, 15, 0},
4338+ .version = {1, 16, 0},
43094339 .module = THIS_MODULE,
43104340 .ctr = thin_ctr,
43114341 .dtr = thin_dtr,
drivers/md/dm.c+4−8
@@ -1067,13 +1067,10 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig) · 1066 unmodified lines
10671067 */
10681068 static void rq_completed(struct mapped_device *md, int rw, bool run_queue)
10691069 {
1070− int nr_requests_pending;
1071−
10721070 atomic_dec(&md->pending[rw]);
10731071
10741072 /* nudge anyone waiting on suspend queue */
1075− nr_requests_pending = md_in_flight(md);
1076− if (!nr_requests_pending)
1073+ if (!md_in_flight(md))
10771074 wake_up(&md->wait);
10781075
10791076 /*
@@ -1085,8 +1082,7 @@ static void rq_completed(struct mapped_device *md, int rw, bool run_queue) · 5 unmodified lines
10851082 if (run_queue) {
10861083 if (md->queue->mq_ops)
10871084 blk_mq_run_hw_queues(md->queue, true);
1088− else if (!nr_requests_pending ||
1089− (nr_requests_pending >= md->queue->nr_congestion_on))
1085+ else
10901086 blk_run_queue_async(md->queue);
10911087 }
10921088
@@ -2281,8 +2277,6 @@ static void dm_init_old_md_queue(struct mapped_device *md) · 1188 unmodified lines
22812277
22822278 static void cleanup_mapped_device(struct mapped_device *md)
22832279 {
2284− cleanup_srcu_struct(&md->io_barrier);
2285−
22862280 if (md->wq)
22872281 destroy_workqueue(md->wq);
22882282 if (md->kworker_task)
@@ -2294,6 +2288,8 @@ static void cleanup_mapped_device(struct mapped_device *md) · 5 unmodified lines
22942288 if (md->bs)
22952289 bioset_free(md->bs);
22962290
2291+ cleanup_srcu_struct(&md->io_barrier);
2292+
22972293 if (md->disk) {
22982294 spin_lock(&_minor_lock);
22992295 md->disk->private_data = NULL;
drivers/md/persistent-data/dm-btree-remove.c+3−3
@@ -309,8 +309,8 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent, · 308 unmodified lines
309309
310310 if (s < 0 && nr_center < -s) {
311311 /* not enough in central node */
312− shift(left, center, nr_center);
313− s = nr_center - target;
312+ shift(left, center, -nr_center);
313+ s += nr_center;
314314 shift(left, right, s);
315315 nr_right += s;
316316 } else
@@ -323,7 +323,7 @@ static void redistribute3(struct dm_btree_info *info, struct btree_node *parent, · 6 unmodified lines
323323 if (s > 0 && nr_center < s) {
324324 /* not enough in central node */
325325 shift(center, right, nr_center);
326− s = target - nr_center;
326+ s -= nr_center;
327327 shift(left, right, s);
328328 nr_left -= s;
329329 } else
drivers/md/persistent-data/dm-btree.c+1−1
@@ -255,7 +255,7 @@ int dm_btree_del(struct dm_btree_info *info, dm_block_t root) · 254 unmodified lines
255255 int r;
256256 struct del_stack *s;
257257
258− s = kmalloc(sizeof(*s), GFP_KERNEL);
258+ s = kmalloc(sizeof(*s), GFP_NOIO);
259259 if (!s)
260260 return -ENOMEM;
261261 s->info = info;
drivers/mfd/stmpe-i2c.c+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 *
77 * License Terms: GNU General Public License, version 2
88 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
9− * Author: Viresh Kumar <viresh.linux@gmail.com> for ST Microelectronics
9+ * Author: Viresh Kumar <vireshk@kernel.org> for ST Microelectronics
1010 */
1111
1212 #include <linux/i2c.h>
drivers/mfd/stmpe-spi.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Copyright (C) ST Microelectronics SA 2011
55 *
66 * License Terms: GNU General Public License, version 2
7− * Author: Viresh Kumar <viresh.linux@gmail.com> for ST Microelectronics
7+ * Author: Viresh Kumar <vireshk@kernel.org> for ST Microelectronics
88 */
99
1010 #include <linux/spi/spi.h>
@@ -146,4 +146,4 @@ module_exit(stmpe_exit); · 135 unmodified lines
146146
147147 MODULE_LICENSE("GPL v2");
148148 MODULE_DESCRIPTION("STMPE MFD SPI Interface Driver");
149−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
149+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
drivers/mmc/host/sdhci-spear.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Support of SDHCI platform devices for spear soc family
55 *
66 * Copyright (C) 2010 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * Inspired by sdhci-pltfm.c
1010 *
@@ -211,5 +211,5 @@ static struct platform_driver sdhci_driver = { · 200 unmodified lines
211211 module_platform_driver(sdhci_driver);
212212
213213 MODULE_DESCRIPTION("SPEAr Secure Digital Host Controller Interface driver");
214−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
214+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
215215 MODULE_LICENSE("GPL v2");
drivers/net/bonding/bond_main.c+31−3
@@ -625,6 +625,23 @@ static void bond_set_dev_addr(struct net_device *bond_dev, · 624 unmodified lines
625625 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev);
626626 }
627627
628+static struct slave *bond_get_old_active(struct bonding *bond,
629+ struct slave *new_active)
630+{
631+ struct slave *slave;
632+ struct list_head *iter;
633+
634+ bond_for_each_slave(bond, slave, iter) {
635+ if (slave == new_active)
636+ continue;
637+
638+ if (ether_addr_equal(bond->dev->dev_addr, slave->dev->dev_addr))
639+ return slave;
640+ }
641+
642+ return NULL;
643+}
644+
628645 /* bond_do_fail_over_mac
629646 *
630647 * Perform special MAC address swapping for fail_over_mac settings
@@ -652,6 +669,9 @@ static void bond_do_fail_over_mac(struct bonding *bond, · 21 unmodified lines
652669 if (!new_active)
653670 return;
654671
672+ if (!old_active)
673+ old_active = bond_get_old_active(bond, new_active);
674+
655675 if (old_active) {
656676 ether_addr_copy(tmp_mac, new_active->dev->dev_addr);
657677 ether_addr_copy(saddr.sa_data,
@@ -1725,9 +1745,16 @@ err_free: · 1067 unmodified lines
17251745
17261746 err_undo_flags:
17271747 /* Enslave of first slave has failed and we need to fix master's mac */
1728− if (!bond_has_slaves(bond) &&
1729− ether_addr_equal_64bits(bond_dev->dev_addr, slave_dev->dev_addr))
1730− eth_hw_addr_random(bond_dev);
1748+ if (!bond_has_slaves(bond)) {
1749+ if (ether_addr_equal_64bits(bond_dev->dev_addr,
1750+ slave_dev->dev_addr))
1751+ eth_hw_addr_random(bond_dev);
1752+ if (bond_dev->type != ARPHRD_ETHER) {
1753+ ether_setup(bond_dev);
1754+ bond_dev->flags |= IFF_MASTER;
1755+ bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
1756+ }
1757+ }
17311758
17321759 return res;
17331760 }
@@ -1916,6 +1943,7 @@ static int bond_release_and_destroy(struct net_device *bond_dev, · 182 unmodified lines
19161943 bond_dev->priv_flags |= IFF_DISABLE_NETPOLL;
19171944 netdev_info(bond_dev, "Destroying bond %s\n",
19181945 bond_dev->name);
1946+ bond_remove_proc_entry(bond);
19191947 unregister_netdevice(bond_dev);
19201948 }
19211949 return ret;
drivers/net/can/at91_can.c+4−4
@@ -577,10 +577,10 @@ static void at91_rx_overflow_err(struct net_device *dev) · 576 unmodified lines
577577
578578 cf->can_id |= CAN_ERR_CRTL;
579579 cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
580− netif_receive_skb(skb);
581580
582581 stats->rx_packets++;
583582 stats->rx_bytes += cf->can_dlc;
583+ netif_receive_skb(skb);
584584 }
585585
586586 /**
@@ -642,10 +642,10 @@ static void at91_read_msg(struct net_device *dev, unsigned int mb) · 55 unmodified lines
642642 }
643643
644644 at91_read_mb(dev, mb, cf);
645− netif_receive_skb(skb);
646645
647646 stats->rx_packets++;
648647 stats->rx_bytes += cf->can_dlc;
648+ netif_receive_skb(skb);
649649
650650 can_led_event(dev, CAN_LED_EVENT_RX);
651651 }
@@ -802,10 +802,10 @@ static int at91_poll_err(struct net_device *dev, int quota, u32 reg_sr) · 150 unmodified lines
802802 return 0;
803803
804804 at91_poll_err_frame(dev, cf, reg_sr);
805− netif_receive_skb(skb);
806805
807806 dev->stats.rx_packets++;
808807 dev->stats.rx_bytes += cf->can_dlc;
808+ netif_receive_skb(skb);
809809
810810 return 1;
811811 }
@@ -1067,10 +1067,10 @@ static void at91_irq_err(struct net_device *dev) · 255 unmodified lines
10671067 return;
10681068
10691069 at91_irq_err_state(dev, cf, new_state);
1070− netif_rx(skb);
10711070
10721071 dev->stats.rx_packets++;
10731072 dev->stats.rx_bytes += cf->can_dlc;
1073+ netif_rx(skb);
10741074
10751075 priv->can.state = new_state;
10761076 }
drivers/net/can/bfin_can.c+2−4
@@ -424,10 +424,9 @@ static void bfin_can_rx(struct net_device *dev, u16 isrc) · 423 unmodified lines
424424 cf->data[6 - i] = (6 - i) < cf->can_dlc ? (val >> 8) : 0;
425425 }
426426
427− netif_rx(skb);
428−
429427 stats->rx_packets++;
430428 stats->rx_bytes += cf->can_dlc;
429+ netif_rx(skb);
431430 }
432431
433432 static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status)
@@ -508,10 +507,9 @@ static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status) · 74 unmodified lines
508507
509508 priv->can.state = state;
510509
511− netif_rx(skb);
512−
513510 stats->rx_packets++;
514511 stats->rx_bytes += cf->can_dlc;
512+ netif_rx(skb);
515513
516514 return 0;
517515 }
drivers/net/can/cc770/cc770.c+2−2
@@ -504,10 +504,10 @@ static void cc770_rx(struct net_device *dev, unsigned int mo, u8 ctrl1) · 503 unmodified lines
504504 for (i = 0; i < cf->can_dlc; i++)
505505 cf->data[i] = cc770_read_reg(priv, msgobj[mo].data[i]);
506506 }
507− netif_rx(skb);
508507
509508 stats->rx_packets++;
510509 stats->rx_bytes += cf->can_dlc;
510+ netif_rx(skb);
511511 }
512512
513513 static int cc770_err(struct net_device *dev, u8 status)
@@ -584,10 +584,10 @@ static int cc770_err(struct net_device *dev, u8 status) · 70 unmodified lines
584584 }
585585 }
586586
587− netif_rx(skb);
588587
589588 stats->rx_packets++;
590589 stats->rx_bytes += cf->can_dlc;
590+ netif_rx(skb);
591591
592592 return 0;
593593 }
drivers/net/can/flexcan.c+3−4
@@ -577,10 +577,10 @@ static int flexcan_poll_bus_err(struct net_device *dev, u32 reg_esr) · 576 unmodified lines
577577 return 0;
578578
579579 do_bus_err(dev, cf, reg_esr);
580− netif_receive_skb(skb);
581580
582581 dev->stats.rx_packets++;
583582 dev->stats.rx_bytes += cf->can_dlc;
583+ netif_receive_skb(skb);
584584
585585 return 1;
586586 }
@@ -622,10 +622,9 @@ static int flexcan_poll_state(struct net_device *dev, u32 reg_esr) · 35 unmodified lines
622622 if (unlikely(new_state == CAN_STATE_BUS_OFF))
623623 can_bus_off(dev);
624624
625− netif_receive_skb(skb);
626−
627625 dev->stats.rx_packets++;
628626 dev->stats.rx_bytes += cf->can_dlc;
627+ netif_receive_skb(skb);
629628
630629 return 1;
631630 }
@@ -670,10 +669,10 @@ static int flexcan_read_frame(struct net_device *dev) · 38 unmodified lines
670669 }
671670
672671 flexcan_read_fifo(dev, cf);
673− netif_receive_skb(skb);
674672
675673 stats->rx_packets++;
676674 stats->rx_bytes += cf->can_dlc;
675+ netif_receive_skb(skb);
677676
678677 can_led_event(dev, CAN_LED_EVENT_RX);
679678
drivers/net/can/grcan.c+2−1
@@ -1216,11 +1216,12 @@ static int grcan_receive(struct net_device *dev, int budget) · 1215 unmodified lines
12161216 cf->data[i] = (u8)(slot[j] >> shift);
12171217 }
12181218 }
1219− netif_receive_skb(skb);
12201219
12211220 /* Update statistics and read pointer */
12221221 stats->rx_packets++;
12231222 stats->rx_bytes += cf->can_dlc;
1223+ netif_receive_skb(skb);
1224+
12241225 rd = grcan_ring_add(rd, GRCAN_MSG_SIZE, dma->rx.size);
12251226 }
12261227
drivers/net/can/sja1000/sja1000.c+2−4
@@ -377,10 +377,9 @@ static void sja1000_rx(struct net_device *dev) · 376 unmodified lines
377377 /* release receive buffer */
378378 sja1000_write_cmdreg(priv, CMD_RRB);
379379
380− netif_rx(skb);
381−
382380 stats->rx_packets++;
383381 stats->rx_bytes += cf->can_dlc;
382+ netif_rx(skb);
384383
385384 can_led_event(dev, CAN_LED_EVENT_RX);
386385 }
@@ -484,10 +483,9 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) · 97 unmodified lines
484483 can_bus_off(dev);
485484 }
486485
487− netif_rx(skb);
488−
489486 stats->rx_packets++;
490487 stats->rx_bytes += cf->can_dlc;
488+ netif_rx(skb);
491489
492490 return 0;
493491 }
drivers/net/can/slcan.c+1−1
@@ -218,10 +218,10 @@ static void slc_bump(struct slcan *sl) · 217 unmodified lines
218218
219219 memcpy(skb_put(skb, sizeof(struct can_frame)),
220220 &cf, sizeof(struct can_frame));
221− netif_rx_ni(skb);
222221
223222 sl->dev->stats.rx_packets++;
224223 sl->dev->stats.rx_bytes += cf.can_dlc;
224+ netif_rx_ni(skb);
225225 }
226226
227227 /* parse tty input stream */
drivers/net/can/spi/mcp251x.c+8−9
@@ -1086,8 +1086,8 @@ static int mcp251x_can_probe(struct spi_device *spi) · 1085 unmodified lines
10861086 if (ret)
10871087 goto out_clk;
10881088
1089− priv->power = devm_regulator_get(&spi->dev, "vdd");
1090− priv->transceiver = devm_regulator_get(&spi->dev, "xceiver");
1089+ priv->power = devm_regulator_get_optional(&spi->dev, "vdd");
1090+ priv->transceiver = devm_regulator_get_optional(&spi->dev, "xceiver");
10911091 if ((PTR_ERR(priv->power) == -EPROBE_DEFER) ||
10921092 (PTR_ERR(priv->transceiver) == -EPROBE_DEFER)) {
10931093 ret = -EPROBE_DEFER;
@@ -1222,17 +1222,16 @@ static int __maybe_unused mcp251x_can_resume(struct device *dev) · 128 unmodified lines
12221222 struct spi_device *spi = to_spi_device(dev);
12231223 struct mcp251x_priv *priv = spi_get_drvdata(spi);
12241224
1225− if (priv->after_suspend & AFTER_SUSPEND_POWER) {
1225+ if (priv->after_suspend & AFTER_SUSPEND_POWER)
12261226 mcp251x_power_enable(priv->power, 1);
1227+
1228+ if (priv->after_suspend & AFTER_SUSPEND_UP) {
1229+ mcp251x_power_enable(priv->transceiver, 1);
12271230 queue_work(priv->wq, &priv->restart_work);
12281231 } else {
1229− if (priv->after_suspend & AFTER_SUSPEND_UP) {
1230− mcp251x_power_enable(priv->transceiver, 1);
1231− queue_work(priv->wq, &priv->restart_work);
1232− } else {
1233− priv->after_suspend = 0;
1234− }
1232+ priv->after_suspend = 0;
12351233 }
1234+
12361235 priv->force_quit = 0;
12371236 enable_irq(spi->irq);
12381237 return 0;
drivers/net/can/ti_hecc.c+1−1
@@ -747,9 +747,9 @@ static int ti_hecc_error(struct net_device *ndev, int int_status, · 746 unmodified lines
747747 }
748748 }
749749
750− netif_rx(skb);
751750 stats->rx_packets++;
752751 stats->rx_bytes += cf->can_dlc;
752+ netif_rx(skb);
753753
754754 return 0;
755755 }
drivers/net/can/usb/ems_usb.c+2−4
@@ -324,10 +324,9 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg) · 323 unmodified lines
324324 cf->data[i] = msg->msg.can_msg.msg[i];
325325 }
326326
327− netif_rx(skb);
328−
329327 stats->rx_packets++;
330328 stats->rx_bytes += cf->can_dlc;
329+ netif_rx(skb);
331330 }
332331
333332 static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
@@ -400,10 +399,9 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg) · 66 unmodified lines
400399 stats->rx_errors++;
401400 }
402401
403− netif_rx(skb);
404−
405402 stats->rx_packets++;
406403 stats->rx_bytes += cf->can_dlc;
404+ netif_rx(skb);
407405 }
408406
409407 /*
drivers/net/can/usb/esd_usb2.c+2−4
@@ -301,13 +301,12 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv, · 300 unmodified lines
301301 cf->data[7] = rxerr;
302302 }
303303
304− netif_rx(skb);
305−
306304 priv->bec.txerr = txerr;
307305 priv->bec.rxerr = rxerr;
308306
309307 stats->rx_packets++;
310308 stats->rx_bytes += cf->can_dlc;
309+ netif_rx(skb);
311310 }
312311 }
313312
@@ -347,10 +346,9 @@ static void esd_usb2_rx_can_msg(struct esd_usb2_net_priv *priv, · 33 unmodified lines
347346 cf->data[i] = msg->msg.rx.data[i];
348347 }
349348
350− netif_rx(skb);
351−
352349 stats->rx_packets++;
353350 stats->rx_bytes += cf->can_dlc;
351+ netif_rx(skb);
354352 }
355353
356354 return;
drivers/net/can/usb/peak_usb/pcan_usb.c+3−4
@@ -526,9 +526,9 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n, · 525 unmodified lines
526526 hwts->hwtstamp = timeval_to_ktime(tv);
527527 }
528528
529− netif_rx(skb);
530529 mc->netdev->stats.rx_packets++;
531530 mc->netdev->stats.rx_bytes += cf->can_dlc;
531+ netif_rx(skb);
532532
533533 return 0;
534534 }
@@ -659,12 +659,11 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len) · 124 unmodified lines
659659 hwts = skb_hwtstamps(skb);
660660 hwts->hwtstamp = timeval_to_ktime(tv);
661661
662− /* push the skb */
663− netif_rx(skb);
664−
665662 /* update statistics */
666663 mc->netdev->stats.rx_packets++;
667664 mc->netdev->stats.rx_bytes += cf->can_dlc;
665+ /* push the skb */
666+ netif_rx(skb);
668667
669668 return 0;
670669
drivers/net/can/usb/peak_usb/pcan_usb_pro.c+2−2
@@ -553,9 +553,9 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if, · 552 unmodified lines
553553 hwts = skb_hwtstamps(skb);
554554 hwts->hwtstamp = timeval_to_ktime(tv);
555555
556− netif_rx(skb);
557556 netdev->stats.rx_packets++;
558557 netdev->stats.rx_bytes += can_frame->can_dlc;
558+ netif_rx(skb);
559559
560560 return 0;
561561 }
@@ -670,9 +670,9 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if, · 108 unmodified lines
670670 peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(er->ts32), &tv);
671671 hwts = skb_hwtstamps(skb);
672672 hwts->hwtstamp = timeval_to_ktime(tv);
673− netif_rx(skb);
674673 netdev->stats.rx_packets++;
675674 netdev->stats.rx_bytes += can_frame->can_dlc;
675+ netif_rx(skb);
676676
677677 return 0;
678678 }
drivers/net/can/usb/usb_8dev.c+2−4
@@ -461,10 +461,9 @@ static void usb_8dev_rx_err_msg(struct usb_8dev_priv *priv, · 460 unmodified lines
461461 priv->bec.txerr = txerr;
462462 priv->bec.rxerr = rxerr;
463463
464− netif_rx(skb);
465−
466464 stats->rx_packets++;
467465 stats->rx_bytes += cf->can_dlc;
466+ netif_rx(skb);
468467 }
469468
470469 /* Read data and status frames */
@@ -494,10 +493,9 @@ static void usb_8dev_rx_can_msg(struct usb_8dev_priv *priv, · 23 unmodified lines
494493 else
495494 memcpy(cf->data, msg->data, cf->can_dlc);
496495
497− netif_rx(skb);
498−
499496 stats->rx_packets++;
500497 stats->rx_bytes += cf->can_dlc;
498+ netif_rx(skb);
501499
502500 can_led_event(priv->netdev, CAN_LED_EVENT_RX);
503501 } else {
drivers/net/dsa/bcm_sf2.c+13−2
@@ -696,9 +696,20 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds) · 695 unmodified lines
696696 }
697697
698698 /* Include the pseudo-PHY address and the broadcast PHY address to
699− * divert reads towards our workaround
699+ * divert reads towards our workaround. This is only required for
700+ * 7445D0, since 7445E0 disconnects the internal switch pseudo-PHY such
701+ * that we can use the regular SWITCH_MDIO master controller instead.
702+ *
703+ * By default, DSA initializes ds->phys_mii_mask to ds->phys_port_mask
704+ * to have a 1:1 mapping between Port address and PHY address in order
705+ * to utilize the slave_mii_bus instance to read from Port PHYs. This is
706+ * not what we want here, so we initialize phys_mii_mask 0 to always
707+ * utilize the "master" MDIO bus backed by the "mdio-unimac" driver.
700708 */
701− ds->phys_mii_mask |= ((1 << BRCM_PSEUDO_PHY_ADDR) | (1 << 0));
709+ if (of_machine_is_compatible("brcm,bcm7445d0"))
710+ ds->phys_mii_mask |= ((1 << BRCM_PSEUDO_PHY_ADDR) | (1 << 0));
711+ else
712+ ds->phys_mii_mask = 0;
702713
703714 rev = reg_readl(priv, REG_SWITCH_REVISION);
704715 priv->hw_params.top_rev = (rev >> SWITCH_TOP_REV_SHIFT) &
drivers/net/dsa/mv88e6xxx.c+1−1
@@ -1175,7 +1175,7 @@ int mv88e6xxx_leave_bridge(struct dsa_switch *ds, int port, u32 br_port_mask) · 1174 unmodified lines
11751175
11761176 newfid = __ffs(ps->fid_mask);
11771177 ps->fid[port] = newfid;
1178− ps->fid_mask &= (1 << newfid);
1178+ ps->fid_mask &= ~(1 << newfid);
11791179 ps->bridge_mask[fid] &= ~(1 << port);
11801180 ps->bridge_mask[newfid] = 1 << port;
11811181
drivers/net/ethernet/broadcom/sb1250-mac.c+0−9
@@ -1508,16 +1508,7 @@ static void sbmac_channel_start(struct sbmac_softc *s) · 1507 unmodified lines
15081508 __raw_writeq(reg, port);
15091509 port = s->sbm_base + R_MAC_ETHERNET_ADDR;
15101510
1511−#ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
1512− /*
1513− * Pass1 SOCs do not receive packets addressed to the
1514− * destination address in the R_MAC_ETHERNET_ADDR register.
1515− * Set the value to zero.
1516− */
1517− __raw_writeq(0, port);
1518−#else
15191511 __raw_writeq(reg, port);
1520−#endif
15211512
15221513 /*
15231514 * Set the receive filter for no packets, and write values
drivers/net/ethernet/freescale/fec_main.c+13−75
@@ -24,7 +24,6 @@ · 23 unmodified lines
2424 #include <linux/module.h>
2525 #include <linux/kernel.h>
2626 #include <linux/string.h>
27−#include <linux/pm_runtime.h>
2827 #include <linux/ptrace.h>
2928 #include <linux/errno.h>
3029 #include <linux/ioport.h>
@@ -78,7 +77,6 @@ static void fec_enet_itr_coal_init(struct net_device *ndev); · 47 unmodified lines
7877 #define FEC_ENET_RAEM_V 0x8
7978 #define FEC_ENET_RAFL_V 0x8
8079 #define FEC_ENET_OPD_V 0xFFF0
81−#define FEC_MDIO_PM_TIMEOUT 100 /* ms */
8280
8381 static struct platform_device_id fec_devtype[] = {
8482 {
@@ -1769,13 +1767,7 @@ static void fec_enet_adjust_link(struct net_device *ndev) · 1684 unmodified lines
17691767 static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
17701768 {
17711769 struct fec_enet_private *fep = bus->priv;
1772− struct device *dev = &fep->pdev->dev;
17731770 unsigned long time_left;
1774− int ret = 0;
1775−
1776− ret = pm_runtime_get_sync(dev);
1777− if (IS_ERR_VALUE(ret))
1778− return ret;
17791771
17801772 fep->mii_timeout = 0;
17811773 init_completion(&fep->mdio_done);
@@ -1791,30 +1783,18 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) · 9 unmodified lines
17911783 if (time_left == 0) {
17921784 fep->mii_timeout = 1;
17931785 netdev_err(fep->netdev, "MDIO read timeout\n");
1794− ret = -ETIMEDOUT;
1795− goto out;
1786+ return -ETIMEDOUT;
17961787 }
17971788
1798− ret = FEC_MMFR_DATA(readl(fep->hwp + FEC_MII_DATA));
1799−
1800−out:
1801− pm_runtime_mark_last_busy(dev);
1802− pm_runtime_put_autosuspend(dev);
1803−
1804− return ret;
1789+ /* return value */
1790+ return FEC_MMFR_DATA(readl(fep->hwp + FEC_MII_DATA));
18051791 }
18061792
18071793 static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
18081794 u16 value)
18091795 {
18101796 struct fec_enet_private *fep = bus->priv;
1811− struct device *dev = &fep->pdev->dev;
18121797 unsigned long time_left;
1813− int ret = 0;
1814−
1815− ret = pm_runtime_get_sync(dev);
1816− if (IS_ERR_VALUE(ret))
1817− return ret;
18181798
18191799 fep->mii_timeout = 0;
18201800 init_completion(&fep->mdio_done);
@@ -1831,13 +1811,10 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum, · 10 unmodified lines
18311811 if (time_left == 0) {
18321812 fep->mii_timeout = 1;
18331813 netdev_err(fep->netdev, "MDIO write timeout\n");
1834− ret = -ETIMEDOUT;
1814+ return -ETIMEDOUT;
18351815 }
18361816
1837− pm_runtime_mark_last_busy(dev);
1838− pm_runtime_put_autosuspend(dev);
1839−
1840− return ret;
1817+ return 0;
18411818 }
18421819
18431820 static int fec_enet_clk_enable(struct net_device *ndev, bool enable)
@@ -1849,6 +1826,9 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable) · 5 unmodified lines
18491826 ret = clk_prepare_enable(fep->clk_ahb);
18501827 if (ret)
18511828 return ret;
1829+ ret = clk_prepare_enable(fep->clk_ipg);
1830+ if (ret)
1831+ goto failed_clk_ipg;
18521832 if (fep->clk_enet_out) {
18531833 ret = clk_prepare_enable(fep->clk_enet_out);
18541834 if (ret)
@@ -1872,6 +1852,7 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable) · 17 unmodified lines
18721852 }
18731853 } else {
18741854 clk_disable_unprepare(fep->clk_ahb);
1855+ clk_disable_unprepare(fep->clk_ipg);
18751856 if (fep->clk_enet_out)
18761857 clk_disable_unprepare(fep->clk_enet_out);
18771858 if (fep->clk_ptp) {
@@ -1893,6 +1874,8 @@ failed_clk_ptp: · 15 unmodified lines
18931874 if (fep->clk_enet_out)
18941875 clk_disable_unprepare(fep->clk_enet_out);
18951876 failed_clk_enet_out:
1877+ clk_disable_unprepare(fep->clk_ipg);
1878+failed_clk_ipg:
18961879 clk_disable_unprepare(fep->clk_ahb);
18971880
18981881 return ret;
@@ -2864,14 +2847,10 @@ fec_enet_open(struct net_device *ndev) · 965 unmodified lines
28642847 struct fec_enet_private *fep = netdev_priv(ndev);
28652848 int ret;
28662849
2867− ret = pm_runtime_get_sync(&fep->pdev->dev);
2868− if (IS_ERR_VALUE(ret))
2869− return ret;
2870−
28712850 pinctrl_pm_select_default_state(&fep->pdev->dev);
28722851 ret = fec_enet_clk_enable(ndev, true);
28732852 if (ret)
2874− goto clk_enable;
2853+ return ret;
28752854
28762855 /* I should reset the ring buffers here, but I don't yet know
28772856 * a simple way to do that.
@@ -2902,9 +2881,6 @@ err_enet_mii_probe: · 24 unmodified lines
29022881 fec_enet_free_buffers(ndev);
29032882 err_enet_alloc:
29042883 fec_enet_clk_enable(ndev, false);
2905−clk_enable:
2906− pm_runtime_mark_last_busy(&fep->pdev->dev);
2907− pm_runtime_put_autosuspend(&fep->pdev->dev);
29082884 pinctrl_pm_select_sleep_state(&fep->pdev->dev);
29092885 return ret;
29102886 }
@@ -2927,9 +2903,6 @@ fec_enet_close(struct net_device *ndev) · 16 unmodified lines
29272903
29282904 fec_enet_clk_enable(ndev, false);
29292905 pinctrl_pm_select_sleep_state(&fep->pdev->dev);
2930− pm_runtime_mark_last_busy(&fep->pdev->dev);
2931− pm_runtime_put_autosuspend(&fep->pdev->dev);
2932−
29332906 fec_enet_free_buffers(ndev);
29342907
29352908 return 0;
@@ -3415,10 +3388,6 @@ fec_probe(struct platform_device *pdev) · 479 unmodified lines
34153388 if (ret)
34163389 goto failed_clk;
34173390
3418− ret = clk_prepare_enable(fep->clk_ipg);
3419− if (ret)
3420− goto failed_clk_ipg;
3421−
34223391 fep->reg_phy = devm_regulator_get(&pdev->dev, "phy");
34233392 if (!IS_ERR(fep->reg_phy)) {
34243393 ret = regulator_enable(fep->reg_phy);
@@ -3465,8 +3434,6 @@ fec_probe(struct platform_device *pdev) · 40 unmodified lines
34653434 netif_carrier_off(ndev);
34663435 fec_enet_clk_enable(ndev, false);
34673436 pinctrl_pm_select_sleep_state(&pdev->dev);
3468− pm_runtime_set_active(&pdev->dev);
3469− pm_runtime_enable(&pdev->dev);
34703437
34713438 ret = register_netdev(ndev);
34723439 if (ret)
@@ -3480,12 +3447,6 @@ fec_probe(struct platform_device *pdev) · 7 unmodified lines
34803447
34813448 fep->rx_copybreak = COPYBREAK_DEFAULT;
34823449 INIT_WORK(&fep->tx_timeout_work, fec_enet_timeout_work);
3483−
3484− pm_runtime_set_autosuspend_delay(&pdev->dev, FEC_MDIO_PM_TIMEOUT);
3485− pm_runtime_use_autosuspend(&pdev->dev);
3486− pm_runtime_mark_last_busy(&pdev->dev);
3487− pm_runtime_put_autosuspend(&pdev->dev);
3488−
34893450 return 0;
34903451
34913452 failed_register:
@@ -3496,8 +3457,6 @@ failed_init: · 4 unmodified lines
34963457 if (fep->reg_phy)
34973458 regulator_disable(fep->reg_phy);
34983459 failed_regulator:
3499− clk_disable_unprepare(fep->clk_ipg);
3500−failed_clk_ipg:
35013460 fec_enet_clk_enable(ndev, false);
35023461 failed_clk:
35033462 failed_phy:
@@ -3609,28 +3568,7 @@ failed_clk: · 105 unmodified lines
36093568 return ret;
36103569 }
36113570
3612−static int __maybe_unused fec_runtime_suspend(struct device *dev)
3613−{
3614− struct net_device *ndev = dev_get_drvdata(dev);
3615− struct fec_enet_private *fep = netdev_priv(ndev);
3616−
3617− clk_disable_unprepare(fep->clk_ipg);
3618−
3619− return 0;
3620−}
3621−
3622−static int __maybe_unused fec_runtime_resume(struct device *dev)
3623−{
3624− struct net_device *ndev = dev_get_drvdata(dev);
3625− struct fec_enet_private *fep = netdev_priv(ndev);
3626−
3627− return clk_prepare_enable(fep->clk_ipg);
3628−}
3629−
3630−static const struct dev_pm_ops fec_pm_ops = {
3631− SET_SYSTEM_SLEEP_PM_OPS(fec_suspend, fec_resume)
3632− SET_RUNTIME_PM_OPS(fec_runtime_suspend, fec_runtime_resume, NULL)
3633−};
3571+static SIMPLE_DEV_PM_OPS(fec_pm_ops, fec_suspend, fec_resume);
36343572
36353573 static struct platform_driver fec_driver = {
36363574 .driver = {
drivers/net/ethernet/marvell/mvneta.c+10−12
@@ -1462,7 +1462,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 1461 unmodified lines
14621462 struct mvneta_rx_queue *rxq)
14631463 {
14641464 struct net_device *dev = pp->dev;
1465− int rx_done, rx_filled;
1465+ int rx_done;
14661466 u32 rcvd_pkts = 0;
14671467 u32 rcvd_bytes = 0;
14681468
@@ -1473,7 +1473,6 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 4 unmodified lines
14731473 rx_todo = rx_done;
14741474
14751475 rx_done = 0;
1476− rx_filled = 0;
14771476
14781477 /* Fairness NAPI loop */
14791478 while (rx_done < rx_todo) {
@@ -1484,7 +1483,6 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 4 unmodified lines
14841483 int rx_bytes, err;
14851484
14861485 rx_done++;
1487− rx_filled++;
14881486 rx_status = rx_desc->status;
14891487 rx_bytes = rx_desc->data_size - (ETH_FCS_LEN + MVNETA_MH_SIZE);
14901488 data = (unsigned char *)rx_desc->buf_cookie;
@@ -1524,6 +1522,14 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 33 unmodified lines
15241522 continue;
15251523 }
15261524
1525+ /* Refill processing */
1526+ err = mvneta_rx_refill(pp, rx_desc);
1527+ if (err) {
1528+ netdev_err(dev, "Linux processing - Can't refill\n");
1529+ rxq->missed++;
1530+ goto err_drop_frame;
1531+ }
1532+
15271533 skb = build_skb(data, pp->frag_size > PAGE_SIZE ? 0 : pp->frag_size);
15281534 if (!skb)
15291535 goto err_drop_frame;
@@ -1543,14 +1549,6 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 13 unmodified lines
15431549 mvneta_rx_csum(pp, rx_status, skb);
15441550
15451551 napi_gro_receive(&pp->napi, skb);
1546−
1547− /* Refill processing */
1548− err = mvneta_rx_refill(pp, rx_desc);
1549− if (err) {
1550− netdev_err(dev, "Linux processing - Can't refill\n");
1551− rxq->missed++;
1552− rx_filled--;
1553− }
15541552 }
15551553
15561554 if (rcvd_pkts) {
@@ -1563,7 +1561,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 6 unmodified lines
15631561 }
15641562
15651563 /* Update rxq management counters */
1566− mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_filled);
1564+ mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_done);
15671565
15681566 return rx_done;
15691567 }
drivers/net/ethernet/renesas/ravb_main.c+38−36
@@ -228,9 +228,7 @@ static void ravb_ring_format(struct net_device *ndev, int q) · 227 unmodified lines
228228 struct ravb_desc *desc;
229229 int rx_ring_size = sizeof(*rx_desc) * priv->num_rx_ring[q];
230230 int tx_ring_size = sizeof(*tx_desc) * priv->num_tx_ring[q];
231− struct sk_buff *skb;
232231 dma_addr_t dma_addr;
233− void *buffer;
234232 int i;
235233
236234 priv->cur_rx[q] = 0;
@@ -241,41 +239,28 @@ static void ravb_ring_format(struct net_device *ndev, int q) · 4 unmodified lines
241239 memset(priv->rx_ring[q], 0, rx_ring_size);
242240 /* Build RX ring buffer */
243241 for (i = 0; i < priv->num_rx_ring[q]; i++) {
244− priv->rx_skb[q][i] = NULL;
245− skb = netdev_alloc_skb(ndev, PKT_BUF_SZ + RAVB_ALIGN - 1);
246− if (!skb)
247− break;
248− ravb_set_buffer_align(skb);
249242 /* RX descriptor */
250243 rx_desc = &priv->rx_ring[q][i];
251244 /* The size of the buffer should be on 16-byte boundary. */
252245 rx_desc->ds_cc = cpu_to_le16(ALIGN(PKT_BUF_SZ, 16));
253− dma_addr = dma_map_single(&ndev->dev, skb->data,
246+ dma_addr = dma_map_single(&ndev->dev, priv->rx_skb[q][i]->data,
254247 ALIGN(PKT_BUF_SZ, 16),
255248 DMA_FROM_DEVICE);
256− if (dma_mapping_error(&ndev->dev, dma_addr)) {
257− dev_kfree_skb(skb);
258− break;
259− }
260− priv->rx_skb[q][i] = skb;
249+ /* We just set the data size to 0 for a failed mapping which
250+ * should prevent DMA from happening...
251+ */
252+ if (dma_mapping_error(&ndev->dev, dma_addr))
253+ rx_desc->ds_cc = cpu_to_le16(0);
261254 rx_desc->dptr = cpu_to_le32(dma_addr);
262255 rx_desc->die_dt = DT_FEMPTY;
263256 }
264257 rx_desc = &priv->rx_ring[q][i];
265258 rx_desc->dptr = cpu_to_le32((u32)priv->rx_desc_dma[q]);
266259 rx_desc->die_dt = DT_LINKFIX; /* type */
267− priv->dirty_rx[q] = (u32)(i - priv->num_rx_ring[q]);
268260
269261 memset(priv->tx_ring[q], 0, tx_ring_size);
270262 /* Build TX ring buffer */
271263 for (i = 0; i < priv->num_tx_ring[q]; i++) {
272− priv->tx_skb[q][i] = NULL;
273− priv->tx_buffers[q][i] = NULL;
274− buffer = kmalloc(PKT_BUF_SZ + RAVB_ALIGN - 1, GFP_KERNEL);
275− if (!buffer)
276− break;
277− /* Aligned TX buffer */
278− priv->tx_buffers[q][i] = buffer;
279264 tx_desc = &priv->tx_ring[q][i];
280265 tx_desc->die_dt = DT_EEMPTY;
281266 }
@@ -298,7 +283,10 @@ static void ravb_ring_format(struct net_device *ndev, int q) · 16 unmodified lines
298283 static int ravb_ring_init(struct net_device *ndev, int q)
299284 {
300285 struct ravb_private *priv = netdev_priv(ndev);
286+ struct sk_buff *skb;
301287 int ring_size;
288+ void *buffer;
289+ int i;
302290
303291 /* Allocate RX and TX skb rings */
304292 priv->rx_skb[q] = kcalloc(priv->num_rx_ring[q],
@@ -308,12 +296,28 @@ static int ravb_ring_init(struct net_device *ndev, int q) · 3 unmodified lines
308296 if (!priv->rx_skb[q] || !priv->tx_skb[q])
309297 goto error;
310298
299+ for (i = 0; i < priv->num_rx_ring[q]; i++) {
300+ skb = netdev_alloc_skb(ndev, PKT_BUF_SZ + RAVB_ALIGN - 1);
301+ if (!skb)
302+ goto error;
303+ ravb_set_buffer_align(skb);
304+ priv->rx_skb[q][i] = skb;
305+ }
306+
311307 /* Allocate rings for the aligned buffers */
312308 priv->tx_buffers[q] = kcalloc(priv->num_tx_ring[q],
313309 sizeof(*priv->tx_buffers[q]), GFP_KERNEL);
314310 if (!priv->tx_buffers[q])
315311 goto error;
316312
313+ for (i = 0; i < priv->num_tx_ring[q]; i++) {
314+ buffer = kmalloc(PKT_BUF_SZ + RAVB_ALIGN - 1, GFP_KERNEL);
315+ if (!buffer)
316+ goto error;
317+ /* Aligned TX buffer */
318+ priv->tx_buffers[q][i] = buffer;
319+ }
320+
317321 /* Allocate all RX descriptors. */
318322 ring_size = sizeof(struct ravb_ex_rx_desc) * (priv->num_rx_ring[q] + 1);
319323 priv->rx_ring[q] = dma_alloc_coherent(NULL, ring_size,
@@ -524,6 +528,10 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q) · 204 unmodified lines
524528 if (--boguscnt < 0)
525529 break;
526530
531+ /* We use 0-byte descriptors to mark the DMA mapping errors */
532+ if (!pkt_len)
533+ continue;
534+
527535 if (desc_status & MSC_MC)
528536 stats->multicast++;
529537
@@ -543,10 +551,9 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q) · 13 unmodified lines
543551
544552 skb = priv->rx_skb[q][entry];
545553 priv->rx_skb[q][entry] = NULL;
546− dma_sync_single_for_cpu(&ndev->dev,
547− le32_to_cpu(desc->dptr),
548− ALIGN(PKT_BUF_SZ, 16),
549− DMA_FROM_DEVICE);
554+ dma_unmap_single(&ndev->dev, le32_to_cpu(desc->dptr),
555+ ALIGN(PKT_BUF_SZ, 16),
556+ DMA_FROM_DEVICE);
550557 get_ts &= (q == RAVB_NC) ?
551558 RAVB_RXTSTAMP_TYPE_V2_L2_EVENT :
552559 ~RAVB_RXTSTAMP_TYPE_V2_L2_EVENT;
@@ -584,17 +591,15 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q) · 31 unmodified lines
584591 if (!skb)
585592 break; /* Better luck next round. */
586593 ravb_set_buffer_align(skb);
587− dma_unmap_single(&ndev->dev, le32_to_cpu(desc->dptr),
588− ALIGN(PKT_BUF_SZ, 16),
589− DMA_FROM_DEVICE);
590594 dma_addr = dma_map_single(&ndev->dev, skb->data,
591595 le16_to_cpu(desc->ds_cc),
592596 DMA_FROM_DEVICE);
593597 skb_checksum_none_assert(skb);
594− if (dma_mapping_error(&ndev->dev, dma_addr)) {
595− dev_kfree_skb_any(skb);
596− break;
597− }
598+ /* We just set the data size to 0 for a failed mapping
599+ * which should prevent DMA from happening...
600+ */
601+ if (dma_mapping_error(&ndev->dev, dma_addr))
602+ desc->ds_cc = cpu_to_le16(0);
598603 desc->dptr = cpu_to_le32(dma_addr);
599604 priv->rx_skb[q][entry] = skb;
600605 }
@@ -1279,7 +1284,6 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 678 unmodified lines
12791284 u32 dma_addr;
12801285 void *buffer;
12811286 u32 entry;
1282− u32 tccr;
12831287
12841288 spin_lock_irqsave(&priv->lock, flags);
12851289 if (priv->cur_tx[q] - priv->dirty_tx[q] >= priv->num_tx_ring[q]) {
@@ -1328,9 +1332,7 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 42 unmodified lines
13281332 dma_wmb();
13291333 desc->die_dt = DT_FSINGLE;
13301334
1331− tccr = ravb_read(ndev, TCCR);
1332− if (!(tccr & (TCCR_TSRQ0 << q)))
1333− ravb_write(ndev, tccr | (TCCR_TSRQ0 << q), TCCR);
1335+ ravb_write(ndev, ravb_read(ndev, TCCR) | (TCCR_TSRQ0 << q), TCCR);
13341336
13351337 priv->cur_tx[q]++;
13361338 if (priv->cur_tx[q] - priv->dirty_tx[q] >= priv->num_tx_ring[q] &&
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+1−1
@@ -2843,7 +2843,7 @@ int stmmac_dvr_probe(struct device *device, · 2842 unmodified lines
28432843 if (res->mac)
28442844 memcpy(priv->dev->dev_addr, res->mac, ETH_ALEN);
28452845
2846− dev_set_drvdata(device, priv);
2846+ dev_set_drvdata(device, priv->dev);
28472847
28482848 /* Verify driver arguments */
28492849 stmmac_verify_args();
drivers/net/ethernet/ti/cpsw.c+3−6
@@ -793,9 +793,7 @@ static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id) · 792 unmodified lines
793793 static int cpsw_poll(struct napi_struct *napi, int budget)
794794 {
795795 struct cpsw_priv *priv = napi_to_priv(napi);
796− int num_tx, num_rx;
797−
798− num_tx = cpdma_chan_process(priv->txch, 128);
796+ int num_rx;
799797
800798 num_rx = cpdma_chan_process(priv->rxch, budget);
801799 if (num_rx < budget) {
@@ -810,9 +808,8 @@ static int cpsw_poll(struct napi_struct *napi, int budget) · 8 unmodified lines
810808 }
811809 }
812810
813− if (num_rx || num_tx)
814− cpsw_dbg(priv, intr, "poll %d rx, %d tx pkts\n",
815− num_rx, num_tx);
811+ if (num_rx)
812+ cpsw_dbg(priv, intr, "poll %d rx pkts\n", num_rx);
816813
817814 return num_rx;
818815 }
drivers/net/ethernet/ti/netcp_core.c+1−1
@@ -1617,11 +1617,11 @@ static int netcp_ndo_open(struct net_device *ndev) · 1616 unmodified lines
16171617 }
16181618 mutex_unlock(&netcp_modules_lock);
16191619
1620− netcp_rxpool_refill(netcp);
16211620 napi_enable(&netcp->rx_napi);
16221621 napi_enable(&netcp->tx_napi);
16231622 knav_queue_enable_notify(netcp->tx_compl_q);
16241623 knav_queue_enable_notify(netcp->rx_queue);
1624+ netcp_rxpool_refill(netcp);
16251625 netif_tx_wake_all_queues(ndev);
16261626 dev_dbg(netcp->ndev_dev, "netcp device %s opened\n", ndev->name);
16271627 return 0;
drivers/net/ipvlan/ipvlan.h+6−3
@@ -67,8 +67,6 @@ struct ipvl_dev { · 66 unmodified lines
6767 struct ipvl_port *port;
6868 struct net_device *phy_dev;
6969 struct list_head addrs;
70− int ipv4cnt;
71− int ipv6cnt;
7270 struct ipvl_pcpu_stats __percpu *pcpu_stats;
7371 DECLARE_BITMAP(mac_filters, IPVLAN_MAC_FILTER_SIZE);
7472 netdev_features_t sfeatures;
@@ -106,6 +104,11 @@ static inline struct ipvl_port *ipvlan_port_get_rcu(const struct net_device *d) · 31 unmodified lines
106104 return rcu_dereference(d->rx_handler_data);
107105 }
108106
107+static inline struct ipvl_port *ipvlan_port_get_rcu_bh(const struct net_device *d)
108+{
109+ return rcu_dereference_bh(d->rx_handler_data);
110+}
111+
109112 static inline struct ipvl_port *ipvlan_port_get_rtnl(const struct net_device *d)
110113 {
111114 return rtnl_dereference(d->rx_handler_data);
@@ -124,5 +127,5 @@ struct ipvl_addr *ipvlan_find_addr(const struct ipvl_dev *ipvlan, · 12 unmodified lines
124127 bool ipvlan_addr_busy(struct ipvl_port *port, void *iaddr, bool is_v6);
125128 struct ipvl_addr *ipvlan_ht_addr_lookup(const struct ipvl_port *port,
126129 const void *iaddr, bool is_v6);
127−void ipvlan_ht_addr_del(struct ipvl_addr *addr, bool sync);
130+void ipvlan_ht_addr_del(struct ipvl_addr *addr);
128131 #endif /* __IPVLAN_H */
drivers/net/ipvlan/ipvlan_core.c+2−4
@@ -85,11 +85,9 @@ void ipvlan_ht_addr_add(struct ipvl_dev *ipvlan, struct ipvl_addr *addr) · 84 unmodified lines
8585 hlist_add_head_rcu(&addr->hlnode, &port->hlhead[hash]);
8686 }
8787
88−void ipvlan_ht_addr_del(struct ipvl_addr *addr, bool sync)
88+void ipvlan_ht_addr_del(struct ipvl_addr *addr)
8989 {
9090 hlist_del_init_rcu(&addr->hlnode);
91− if (sync)
92− synchronize_rcu();
9391 }
9492
9593 struct ipvl_addr *ipvlan_find_addr(const struct ipvl_dev *ipvlan,
@@ -531,7 +529,7 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev) · 435 unmodified lines
531529 int ipvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
532530 {
533531 struct ipvl_dev *ipvlan = netdev_priv(dev);
534− struct ipvl_port *port = ipvlan_port_get_rcu(ipvlan->phy_dev);
532+ struct ipvl_port *port = ipvlan_port_get_rcu_bh(ipvlan->phy_dev);
535533
536534 if (!port)
537535 goto out;
drivers/net/ipvlan/ipvlan_main.c+19−23
@@ -153,10 +153,9 @@ static int ipvlan_open(struct net_device *dev) · 152 unmodified lines
153153 else
154154 dev->flags &= ~IFF_NOARP;
155155
156− if (ipvlan->ipv6cnt > 0 || ipvlan->ipv4cnt > 0) {
157− list_for_each_entry(addr, &ipvlan->addrs, anode)
158− ipvlan_ht_addr_add(ipvlan, addr);
159− }
156+ list_for_each_entry(addr, &ipvlan->addrs, anode)
157+ ipvlan_ht_addr_add(ipvlan, addr);
158+
160159 return dev_uc_add(phy_dev, phy_dev->dev_addr);
161160 }
162161
@@ -171,10 +170,9 @@ static int ipvlan_stop(struct net_device *dev) · 8 unmodified lines
171170
172171 dev_uc_del(phy_dev, phy_dev->dev_addr);
173172
174− if (ipvlan->ipv6cnt > 0 || ipvlan->ipv4cnt > 0) {
175− list_for_each_entry(addr, &ipvlan->addrs, anode)
176− ipvlan_ht_addr_del(addr, !dev->dismantle);
177− }
173+ list_for_each_entry(addr, &ipvlan->addrs, anode)
174+ ipvlan_ht_addr_del(addr);
175+
178176 return 0;
179177 }
180178
@@ -471,8 +469,6 @@ static int ipvlan_link_new(struct net *src_net, struct net_device *dev, · 290 unmodified lines
471469 ipvlan->port = port;
472470 ipvlan->sfeatures = IPVLAN_FEATURES;
473471 INIT_LIST_HEAD(&ipvlan->addrs);
474− ipvlan->ipv4cnt = 0;
475− ipvlan->ipv6cnt = 0;
476472
477473 /* TODO Probably put random address here to be presented to the
478474 * world but keep using the physical-dev address for the outgoing
@@ -508,12 +504,12 @@ static void ipvlan_link_delete(struct net_device *dev, struct list_head *head) · 29 unmodified lines
508504 struct ipvl_dev *ipvlan = netdev_priv(dev);
509505 struct ipvl_addr *addr, *next;
510506
511− if (ipvlan->ipv6cnt > 0 || ipvlan->ipv4cnt > 0) {
512− list_for_each_entry_safe(addr, next, &ipvlan->addrs, anode) {
513− ipvlan_ht_addr_del(addr, !dev->dismantle);
514− list_del(&addr->anode);
515− }
507+ list_for_each_entry_safe(addr, next, &ipvlan->addrs, anode) {
508+ ipvlan_ht_addr_del(addr);
509+ list_del(&addr->anode);
510+ kfree_rcu(addr, rcu);
516511 }
512+
517513 list_del_rcu(&ipvlan->pnode);
518514 unregister_netdevice_queue(dev, head);
519515 netdev_upper_dev_unlink(ipvlan->phy_dev, dev);
@@ -627,7 +623,7 @@ static int ipvlan_add_addr6(struct ipvl_dev *ipvlan, struct in6_addr *ip6_addr) · 107 unmodified lines
627623 memcpy(&addr->ip6addr, ip6_addr, sizeof(struct in6_addr));
628624 addr->atype = IPVL_IPV6;
629625 list_add_tail(&addr->anode, &ipvlan->addrs);
630− ipvlan->ipv6cnt++;
626+
631627 /* If the interface is not up, the address will be added to the hash
632628 * list by ipvlan_open.
633629 */
@@ -645,10 +641,8 @@ static void ipvlan_del_addr6(struct ipvl_dev *ipvlan, struct in6_addr *ip6_addr) · 11 unmodified lines
645641 if (!addr)
646642 return;
647643
648− ipvlan_ht_addr_del(addr, true);
644+ ipvlan_ht_addr_del(addr);
649645 list_del(&addr->anode);
650− ipvlan->ipv6cnt--;
651− WARN_ON(ipvlan->ipv6cnt < 0);
652646 kfree_rcu(addr, rcu);
653647
654648 return;
@@ -661,6 +655,10 @@ static int ipvlan_addr6_event(struct notifier_block *unused, · 6 unmodified lines
661655 struct net_device *dev = (struct net_device *)if6->idev->dev;
662656 struct ipvl_dev *ipvlan = netdev_priv(dev);
663657
658+ /* FIXME IPv6 autoconf calls us from bh without RTNL */
659+ if (in_softirq())
660+ return NOTIFY_DONE;
661+
664662 if (!netif_is_ipvlan(dev))
665663 return NOTIFY_DONE;
666664
@@ -699,7 +697,7 @@ static int ipvlan_add_addr4(struct ipvl_dev *ipvlan, struct in_addr *ip4_addr) · 32 unmodified lines
699697 memcpy(&addr->ip4addr, ip4_addr, sizeof(struct in_addr));
700698 addr->atype = IPVL_IPV4;
701699 list_add_tail(&addr->anode, &ipvlan->addrs);
702− ipvlan->ipv4cnt++;
700+
703701 /* If the interface is not up, the address will be added to the hash
704702 * list by ipvlan_open.
705703 */
@@ -717,10 +715,8 @@ static void ipvlan_del_addr4(struct ipvl_dev *ipvlan, struct in_addr *ip4_addr) · 11 unmodified lines
717715 if (!addr)
718716 return;
719717
720− ipvlan_ht_addr_del(addr, true);
718+ ipvlan_ht_addr_del(addr);
721719 list_del(&addr->anode);
722− ipvlan->ipv4cnt--;
723− WARN_ON(ipvlan->ipv4cnt < 0);
724720 kfree_rcu(addr, rcu);
725721
726722 return;
drivers/net/phy/dp83867.c+1−1
@@ -164,7 +164,7 @@ static int dp83867_config_init(struct phy_device *phydev) · 163 unmodified lines
164164 return ret;
165165 }
166166
167− if ((phydev->interface >= PHY_INTERFACE_MODE_RGMII_ID) ||
167+ if ((phydev->interface >= PHY_INTERFACE_MODE_RGMII_ID) &&
168168 (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
169169 val = phy_read_mmd_indirect(phydev, DP83867_RGMIICTL,
170170 DP83867_DEVADDR, phydev->addr);
drivers/net/phy/mdio_bus.c+17−2
@@ -421,6 +421,8 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv) · 420 unmodified lines
421421 {
422422 struct phy_device *phydev = to_phy_device(dev);
423423 struct phy_driver *phydrv = to_phy_driver(drv);
424+ const int num_ids = ARRAY_SIZE(phydev->c45_ids.device_ids);
425+ int i;
424426
425427 if (of_driver_match_device(dev, drv))
426428 return 1;
@@ -428,8 +430,21 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv) · 1 unmodified line
428430 if (phydrv->match_phy_device)
429431 return phydrv->match_phy_device(phydev);
430432
431− return (phydrv->phy_id & phydrv->phy_id_mask) ==
432− (phydev->phy_id & phydrv->phy_id_mask);
433+ if (phydev->is_c45) {
434+ for (i = 1; i < num_ids; i++) {
435+ if (!(phydev->c45_ids.devices_in_package & (1 << i)))
436+ continue;
437+
438+ if ((phydrv->phy_id & phydrv->phy_id_mask) ==
439+ (phydev->c45_ids.device_ids[i] &
440+ phydrv->phy_id_mask))
441+ return 1;
442+ }
443+ return 0;
444+ } else {
445+ return (phydrv->phy_id & phydrv->phy_id_mask) ==
446+ (phydev->phy_id & phydrv->phy_id_mask);
447+ }
433448 }
434449
435450 #ifdef CONFIG_PM
drivers/net/usb/qmi_wwan.c+1−0
@@ -757,6 +757,7 @@ static const struct usb_device_id products[] = { · 756 unmodified lines
757757 {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
758758 {QMI_FIXED_INTF(0x1199, 0x901f, 8)}, /* Sierra Wireless EM7355 */
759759 {QMI_FIXED_INTF(0x1199, 0x9041, 8)}, /* Sierra Wireless MC7305/MC7355 */
760+ {QMI_FIXED_INTF(0x1199, 0x9041, 10)}, /* Sierra Wireless MC7305/MC7355 */
760761 {QMI_FIXED_INTF(0x1199, 0x9051, 8)}, /* Netgear AirCard 340U */
761762 {QMI_FIXED_INTF(0x1199, 0x9053, 8)}, /* Sierra Wireless Modem */
762763 {QMI_FIXED_INTF(0x1199, 0x9054, 8)}, /* Sierra Wireless Modem */
drivers/net/virtio_net.c+2−1
@@ -1828,7 +1828,8 @@ static int virtnet_probe(struct virtio_device *vdev) · 1827 unmodified lines
18281828 else
18291829 vi->hdr_len = sizeof(struct virtio_net_hdr);
18301830
1831− if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT))
1831+ if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT) ||
1832+ virtio_has_feature(vdev, VIRTIO_F_VERSION_1))
18321833 vi->any_header_sg = true;
18331834
18341835 if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ))
drivers/net/wireless/ath/ath9k/hw.c+1−0
@@ -279,6 +279,7 @@ static void ath9k_hw_read_revisions(struct ath_hw *ah) · 278 unmodified lines
279279 return;
280280 case AR9300_DEVID_QCA956X:
281281 ah->hw_version.macVersion = AR_SREV_VERSION_9561;
282+ return;
282283 }
283284
284285 val = REG_READ(ah, AR_SREV) & AR_SREV_ID;
drivers/net/wireless/iwlwifi/iwl-fh.h+6−0
@@ -438,6 +438,12 @@ static inline unsigned int FH_MEM_CBBC_QUEUE(unsigned int chnl) · 437 unmodified lines
438438 #define RX_QUEUE_MASK 255
439439 #define RX_QUEUE_SIZE_LOG 8
440440
441+/*
442+ * RX related structures and functions
443+ */
444+#define RX_FREE_BUFFERS 64
445+#define RX_LOW_WATERMARK 8
446+
441447 /**
442448 * struct iwl_rb_status - reserve buffer status
443449 * host memory mapped FH registers
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c+5−7
@@ -540,13 +540,11 @@ static void iwl_set_hw_address_family_8000(struct device *dev, · 539 unmodified lines
540540 hw_addr = (const u8 *)(mac_override +
541541 MAC_ADDRESS_OVERRIDE_FAMILY_8000);
542542
543− /* The byte order is little endian 16 bit, meaning 214365 */
544− data->hw_addr[0] = hw_addr[1];
545− data->hw_addr[1] = hw_addr[0];
546− data->hw_addr[2] = hw_addr[3];
547− data->hw_addr[3] = hw_addr[2];
548− data->hw_addr[4] = hw_addr[5];
549− data->hw_addr[5] = hw_addr[4];
543+ /*
544+ * Store the MAC address from MAO section.
545+ * No byte swapping is required in MAO section
546+ */
547+ memcpy(data->hw_addr, hw_addr, ETH_ALEN);
550548
551549 /*
552550 * Force the use of the OTP MAC address in case of reserved MAC
drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h+2−1
@@ -660,7 +660,8 @@ struct iwl_scan_config { · 659 unmodified lines
660660 * iwl_umac_scan_flags
661661 *@IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request
662662 * can be preempted by other scan requests with higher priority.
663− * The low priority scan is aborted.
663+ * The low priority scan will be resumed when the higher proirity scan is
664+ * completed.
664665 *@IWL_UMAC_SCAN_FLAG_START_NOTIF: notification will be sent to the driver
665666 * when scan starts.
666667 */
drivers/net/wireless/iwlwifi/mvm/scan.c+3−0
@@ -1109,6 +1109,9 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, · 1108 unmodified lines
11091109 cmd->uid = cpu_to_le32(uid);
11101110 cmd->general_flags = cpu_to_le32(iwl_mvm_scan_umac_flags(mvm, params));
11111111
1112+ if (type == IWL_MVM_SCAN_SCHED)
1113+ cmd->flags = cpu_to_le32(IWL_UMAC_SCAN_FLAG_PREEMPTIVE);
1114+
11121115 if (iwl_mvm_scan_use_ebs(mvm, vif, n_iterations))
11131116 cmd->channel_flags = IWL_SCAN_CHANNEL_FLAG_EBS |
11141117 IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE |
drivers/net/wireless/iwlwifi/mvm/sta.c+2−1
@@ -1401,6 +1401,7 @@ int iwl_mvm_set_sta_key(struct iwl_mvm *mvm, · 1400 unmodified lines
14011401 bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE);
14021402 u8 sta_id;
14031403 int ret;
1404+ static const u8 __maybe_unused zero_addr[ETH_ALEN] = {0};
14041405
14051406 lockdep_assert_held(&mvm->mutex);
14061407
@@ -1467,7 +1468,7 @@ int iwl_mvm_set_sta_key(struct iwl_mvm *mvm, · 60 unmodified lines
14671468 end:
14681469 IWL_DEBUG_WEP(mvm, "key: cipher=%x len=%d idx=%d sta=%pM ret=%d\n",
14691470 keyconf->cipher, keyconf->keylen, keyconf->keyidx,
1470− sta->addr, ret);
1471+ sta ? sta->addr : zero_addr, ret);
14711472 return ret;
14721473 }
14731474
drivers/net/wireless/iwlwifi/mvm/time-event.c+1−1
@@ -86,7 +86,7 @@ void iwl_mvm_te_clear_data(struct iwl_mvm *mvm, · 85 unmodified lines
8686 {
8787 lockdep_assert_held(&mvm->time_event_lock);
8888
89− if (te_data->id == TE_MAX)
89+ if (!te_data->vif)
9090 return;
9191
9292 list_del(&te_data->list);
drivers/net/wireless/iwlwifi/mvm/tx.c+1−1
@@ -252,7 +252,7 @@ void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, struct iwl_tx_cmd *tx_cmd, · 251 unmodified lines
252252
253253 if (info->band == IEEE80211_BAND_2GHZ &&
254254 !iwl_mvm_bt_coex_is_shared_ant_avail(mvm))
255− rate_flags = BIT(mvm->cfg->non_shared_ant) << RATE_MCS_ANT_POS;
255+ rate_flags = mvm->cfg->non_shared_ant << RATE_MCS_ANT_POS;
256256 else
257257 rate_flags =
258258 BIT(mvm->mgmt_last_antenna_idx) << RATE_MCS_ANT_POS;
drivers/net/wireless/iwlwifi/pcie/drv.c+3−2
@@ -368,12 +368,14 @@ static const struct pci_device_id iwl_hw_card_ids[] = { · 367 unmodified lines
368368 /* 3165 Series */
369369 {IWL_PCI_DEVICE(0x3165, 0x4010, iwl3165_2ac_cfg)},
370370 {IWL_PCI_DEVICE(0x3165, 0x4012, iwl3165_2ac_cfg)},
371+ {IWL_PCI_DEVICE(0x3166, 0x4212, iwl3165_2ac_cfg)},
371372 {IWL_PCI_DEVICE(0x3165, 0x4410, iwl3165_2ac_cfg)},
372373 {IWL_PCI_DEVICE(0x3165, 0x4510, iwl3165_2ac_cfg)},
373374 {IWL_PCI_DEVICE(0x3165, 0x4110, iwl3165_2ac_cfg)},
374375 {IWL_PCI_DEVICE(0x3166, 0x4310, iwl3165_2ac_cfg)},
375376 {IWL_PCI_DEVICE(0x3166, 0x4210, iwl3165_2ac_cfg)},
376377 {IWL_PCI_DEVICE(0x3165, 0x8010, iwl3165_2ac_cfg)},
378+ {IWL_PCI_DEVICE(0x3165, 0x8110, iwl3165_2ac_cfg)},
377379
378380 /* 7265 Series */
379381 {IWL_PCI_DEVICE(0x095A, 0x5010, iwl7265_2ac_cfg)},
@@ -426,9 +428,8 @@ static const struct pci_device_id iwl_hw_card_ids[] = { · 46 unmodified lines
426428 {IWL_PCI_DEVICE(0x24F4, 0x1130, iwl8260_2ac_cfg)},
427429 {IWL_PCI_DEVICE(0x24F4, 0x1030, iwl8260_2ac_cfg)},
428430 {IWL_PCI_DEVICE(0x24F3, 0xC010, iwl8260_2ac_cfg)},
431+ {IWL_PCI_DEVICE(0x24F3, 0xC110, iwl8260_2ac_cfg)},
429432 {IWL_PCI_DEVICE(0x24F3, 0xD010, iwl8260_2ac_cfg)},
430− {IWL_PCI_DEVICE(0x24F4, 0xC030, iwl8260_2ac_cfg)},
431− {IWL_PCI_DEVICE(0x24F4, 0xD030, iwl8260_2ac_cfg)},
432433 {IWL_PCI_DEVICE(0x24F3, 0xC050, iwl8260_2ac_cfg)},
433434 {IWL_PCI_DEVICE(0x24F3, 0xD050, iwl8260_2ac_cfg)},
434435 {IWL_PCI_DEVICE(0x24F3, 0x8010, iwl8260_2ac_cfg)},
drivers/net/wireless/iwlwifi/pcie/internal.h+8−43
@@ -44,15 +44,6 @@ · 43 unmodified lines
4444 #include "iwl-io.h"
4545 #include "iwl-op-mode.h"
4646
47−/*
48− * RX related structures and functions
49− */
50−#define RX_NUM_QUEUES 1
51−#define RX_POST_REQ_ALLOC 2
52−#define RX_CLAIM_REQ_ALLOC 8
53−#define RX_POOL_SIZE ((RX_CLAIM_REQ_ALLOC - RX_POST_REQ_ALLOC) * RX_NUM_QUEUES)
54−#define RX_LOW_WATERMARK 8
55−
5647 struct iwl_host_cmd;
5748
5849 /*This file includes the declaration that are internal to the
@@ -86,29 +77,29 @@ struct isr_statistics { · 27 unmodified lines
8677 * struct iwl_rxq - Rx queue
8778 * @bd: driver's pointer to buffer of receive buffer descriptors (rbd)
8879 * @bd_dma: bus address of buffer of receive buffer descriptors (rbd)
80+ * @pool:
81+ * @queue:
8982 * @read: Shared index to newest available Rx buffer
9083 * @write: Shared index to oldest written Rx packet
9184 * @free_count: Number of pre-allocated buffers in rx_free
92− * @used_count: Number of RBDs handled to allocator to use for allocation
9385 * @write_actual:
94− * @rx_free: list of RBDs with allocated RB ready for use
95− * @rx_used: list of RBDs with no RB attached
86+ * @rx_free: list of free SKBs for use
87+ * @rx_used: List of Rx buffers with no SKB
9688 * @need_update: flag to indicate we need to update read/write index
9789 * @rb_stts: driver's pointer to receive buffer status
9890 * @rb_stts_dma: bus address of receive buffer status
9991 * @lock:
100− * @pool: initial pool of iwl_rx_mem_buffer for the queue
101− * @queue: actual rx queue
10292 *
10393 * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers
10494 */
10595 struct iwl_rxq {
10696 __le32 *bd;
10797 dma_addr_t bd_dma;
98+ struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
99+ struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE];
108100 u32 read;
109101 u32 write;
110102 u32 free_count;
111− u32 used_count;
112103 u32 write_actual;
113104 struct list_head rx_free;
114105 struct list_head rx_used;
@@ -116,32 +107,6 @@ struct iwl_rxq { · 1 unmodified line
116107 struct iwl_rb_status *rb_stts;
117108 dma_addr_t rb_stts_dma;
118109 spinlock_t lock;
119− struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE];
120− struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE];
121−};
122−
123−/**
124− * struct iwl_rb_allocator - Rx allocator
125− * @pool: initial pool of allocator
126− * @req_pending: number of requests the allcator had not processed yet
127− * @req_ready: number of requests honored and ready for claiming
128− * @rbd_allocated: RBDs with pages allocated and ready to be handled to
129− * the queue. This is a list of &struct iwl_rx_mem_buffer
130− * @rbd_empty: RBDs with no page attached for allocator use. This is a list
131− * of &struct iwl_rx_mem_buffer
132− * @lock: protects the rbd_allocated and rbd_empty lists
133− * @alloc_wq: work queue for background calls
134− * @rx_alloc: work struct for background calls
135− */
136−struct iwl_rb_allocator {
137− struct iwl_rx_mem_buffer pool[RX_POOL_SIZE];
138− atomic_t req_pending;
139− atomic_t req_ready;
140− struct list_head rbd_allocated;
141− struct list_head rbd_empty;
142− spinlock_t lock;
143− struct workqueue_struct *alloc_wq;
144− struct work_struct rx_alloc;
145110 };
146111
147112 struct iwl_dma_ptr {
@@ -285,7 +250,7 @@ iwl_pcie_get_scratchbuf_dma(struct iwl_txq *txq, int idx) · 137 unmodified lines
285250 /**
286251 * struct iwl_trans_pcie - PCIe transport specific data
287252 * @rxq: all the RX queue data
288− * @rba: allocator for RX replenishing
253+ * @rx_replenish: work that will be called when buffers need to be allocated
289254 * @drv - pointer to iwl_drv
290255 * @trans: pointer to the generic transport area
291256 * @scd_base_addr: scheduler sram base address in SRAM
@@ -308,7 +273,7 @@ iwl_pcie_get_scratchbuf_dma(struct iwl_txq *txq, int idx) · 16 unmodified lines
308273 */
309274 struct iwl_trans_pcie {
310275 struct iwl_rxq rxq;
311− struct iwl_rb_allocator rba;
276+ struct work_struct rx_replenish;
312277 struct iwl_trans *trans;
313278 struct iwl_drv *drv;
314279
drivers/net/wireless/iwlwifi/pcie/rx.c+83−331
@@ -1,7 +1,7 @@
11 /******************************************************************************
22 *
33 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
4− * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
4+ * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
55 *
66 * Portions of this file are derived from the ipw3945 project, as well
77 * as portions of the ieee80211 subsystem header files.
@@ -74,29 +74,16 @@ · 66 unmodified lines
7474 * resets the Rx queue buffers with new memory.
7575 *
7676 * The management in the driver is as follows:
77− * + A list of pre-allocated RBDs is stored in iwl->rxq->rx_free.
78− * When the interrupt handler is called, the request is processed.
79− * The page is either stolen - transferred to the upper layer
80− * or reused - added immediately to the iwl->rxq->rx_free list.
81− * + When the page is stolen - the driver updates the matching queue's used
82− * count, detaches the RBD and transfers it to the queue used list.
83− * When there are two used RBDs - they are transferred to the allocator empty
84− * list. Work is then scheduled for the allocator to start allocating
85− * eight buffers.
86− * When there are another 6 used RBDs - they are transferred to the allocator
87− * empty list and the driver tries to claim the pre-allocated buffers and
88− * add them to iwl->rxq->rx_free. If it fails - it continues to claim them
89− * until ready.
90− * When there are 8+ buffers in the free list - either from allocation or from
91− * 8 reused unstolen pages - restock is called to update the FW and indexes.
92− * + In order to make sure the allocator always has RBDs to use for allocation
93− * the allocator has initial pool in the size of num_queues*(8-2) - the
94− * maximum missing RBDs per allocation request (request posted with 2
95− * empty RBDs, there is no guarantee when the other 6 RBDs are supplied).
96− * The queues supplies the recycle of the rest of the RBDs.
77+ * + A list of pre-allocated SKBs is stored in iwl->rxq->rx_free. When
78+ * iwl->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled
79+ * to replenish the iwl->rxq->rx_free.
80+ * + In iwl_pcie_rx_replenish (scheduled) if 'processed' != 'read' then the
81+ * iwl->rxq is replenished and the READ INDEX is updated (updating the
82+ * 'processed' and 'read' driver indexes as well)
9783 * + A received packet is processed and handed to the kernel network stack,
9884 * detached from the iwl->rxq. The driver 'processed' index is updated.
99− * + If there are no allocated buffers in iwl->rxq->rx_free,
85+ * + The Host/Firmware iwl->rxq is replenished at irq thread time from the
86+ * rx_free list. If there are no allocated buffers in iwl->rxq->rx_free,
10087 * the READ INDEX is not incremented and iwl->status(RX_STALLED) is set.
10188 * If there were enough free buffers and RX_STALLED is set it is cleared.
10289 *
@@ -105,32 +92,18 @@ · 2 unmodified lines
10592 *
10693 * iwl_rxq_alloc() Allocates rx_free
10794 * iwl_pcie_rx_replenish() Replenishes rx_free list from rx_used, and calls
108− * iwl_pcie_rxq_restock.
109− * Used only during initialization.
95+ * iwl_pcie_rxq_restock
11096 * iwl_pcie_rxq_restock() Moves available buffers from rx_free into Rx
11197 * queue, updates firmware pointers, and updates
112− * the WRITE index.
113− * iwl_pcie_rx_allocator() Background work for allocating pages.
98+ * the WRITE index. If insufficient rx_free buffers
99+ * are available, schedules iwl_pcie_rx_replenish
114100 *
115101 * -- enable interrupts --
116102 * ISR - iwl_rx() Detach iwl_rx_mem_buffers from pool up to the
117103 * READ INDEX, detaching the SKB from the pool.
118104 * Moves the packet buffer from queue to rx_used.
119− * Posts and claims requests to the allocator.
120105 * Calls iwl_pcie_rxq_restock to refill any empty
121106 * slots.
122− *
123− * RBD life-cycle:
124− *
125− * Init:
126− * rxq.pool -> rxq.rx_used -> rxq.rx_free -> rxq.queue
127− *
128− * Regular Receive interrupt:
129− * Page Stolen:
130− * rxq.queue -> rxq.rx_used -> allocator.rbd_empty ->
131− * allocator.rbd_allocated -> rxq.rx_free -> rxq.queue
132− * Page not Stolen:
133− * rxq.queue -> rxq.rx_free -> rxq.queue
134107 * ...
135108 *
136109 */
@@ -267,6 +240,10 @@ static void iwl_pcie_rxq_restock(struct iwl_trans *trans) · 130 unmodified lines
267240 rxq->free_count--;
268241 }
269242 spin_unlock(&rxq->lock);
243+ /* If the pre-allocated buffer pool is dropping low, schedule to
244+ * refill it */
245+ if (rxq->free_count <= RX_LOW_WATERMARK)
246+ schedule_work(&trans_pcie->rx_replenish);
270247
271248 /* If we've added more space for the firmware to place data, tell it.
272249 * Increment device's write pointer in multiples of 8. */
@@ -277,44 +254,6 @@ static void iwl_pcie_rxq_restock(struct iwl_trans *trans) · 4 unmodified lines
277254 }
278255 }
279256
280−/*
281− * iwl_pcie_rx_alloc_page - allocates and returns a page.
282− *
283− */
284−static struct page *iwl_pcie_rx_alloc_page(struct iwl_trans *trans)
285−{
286− struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
287− struct iwl_rxq *rxq = &trans_pcie->rxq;
288− struct page *page;
289− gfp_t gfp_mask = GFP_KERNEL;
290−
291− if (rxq->free_count > RX_LOW_WATERMARK)
292− gfp_mask |= __GFP_NOWARN;
293−
294− if (trans_pcie->rx_page_order > 0)
295− gfp_mask |= __GFP_COMP;
296−
297− /* Alloc a new receive buffer */
298− page = alloc_pages(gfp_mask, trans_pcie->rx_page_order);
299− if (!page) {
300− if (net_ratelimit())
301− IWL_DEBUG_INFO(trans, "alloc_pages failed, order: %d\n",
302− trans_pcie->rx_page_order);
303− /* Issue an error if the hardware has consumed more than half
304− * of its free buffer list and we don't have enough
305− * pre-allocated buffers.
306−` */
307− if (rxq->free_count <= RX_LOW_WATERMARK &&
308− iwl_rxq_space(rxq) > (RX_QUEUE_SIZE / 2) &&
309− net_ratelimit())
310− IWL_CRIT(trans,
311− "Failed to alloc_pages with GFP_KERNEL. Only %u free buffers remaining.\n",
312− rxq->free_count);
313− return NULL;
314− }
315− return page;
316−}
317−
318257 /*
319258 * iwl_pcie_rxq_alloc_rbs - allocate a page for each used RBD
320259 *
@@ -324,12 +263,13 @@ static struct page *iwl_pcie_rx_alloc_page(struct iwl_trans *trans) · 3 unmodified lines
324263 * iwl_pcie_rxq_restock. The latter function will update the HW to use the newly
325264 * allocated buffers.
326265 */
327−static void iwl_pcie_rxq_alloc_rbs(struct iwl_trans *trans)
266+static void iwl_pcie_rxq_alloc_rbs(struct iwl_trans *trans, gfp_t priority)
328267 {
329268 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
330269 struct iwl_rxq *rxq = &trans_pcie->rxq;
331270 struct iwl_rx_mem_buffer *rxb;
332271 struct page *page;
272+ gfp_t gfp_mask = priority;
333273
334274 while (1) {
335275 spin_lock(&rxq->lock);
@@ -339,10 +279,32 @@ static void iwl_pcie_rxq_alloc_rbs(struct iwl_trans *trans) · 3 unmodified lines
339279 }
340280 spin_unlock(&rxq->lock);
341281
282+ if (rxq->free_count > RX_LOW_WATERMARK)
283+ gfp_mask |= __GFP_NOWARN;
284+
285+ if (trans_pcie->rx_page_order > 0)
286+ gfp_mask |= __GFP_COMP;
287+
342288 /* Alloc a new receive buffer */
343− page = iwl_pcie_rx_alloc_page(trans);
344− if (!page)
289+ page = alloc_pages(gfp_mask, trans_pcie->rx_page_order);
290+ if (!page) {
291+ if (net_ratelimit())
292+ IWL_DEBUG_INFO(trans, "alloc_pages failed, "
293+ "order: %d\n",
294+ trans_pcie->rx_page_order);
295+
296+ if ((rxq->free_count <= RX_LOW_WATERMARK) &&
297+ net_ratelimit())
298+ IWL_CRIT(trans, "Failed to alloc_pages with %s."
299+ "Only %u free buffers remaining.\n",
300+ priority == GFP_ATOMIC ?
301+ "GFP_ATOMIC" : "GFP_KERNEL",
302+ rxq->free_count);
303+ /* We don't reschedule replenish work here -- we will
304+ * call the restock method and if it still needs
305+ * more buffers it will schedule replenish */
345306 return;
307+ }
346308
347309 spin_lock(&rxq->lock);
348310
@@ -393,7 +355,7 @@ static void iwl_pcie_rxq_free_rbs(struct iwl_trans *trans) · 44 unmodified lines
393355
394356 lockdep_assert_held(&rxq->lock);
395357
396− for (i = 0; i < RX_QUEUE_SIZE; i++) {
358+ for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++) {
397359 if (!rxq->pool[i].page)
398360 continue;
399361 dma_unmap_page(trans->dev, rxq->pool[i].page_dma,
@@ -410,144 +372,32 @@ static void iwl_pcie_rxq_free_rbs(struct iwl_trans *trans) · 10 unmodified lines
410372 * When moving to rx_free an page is allocated for the slot.
411373 *
412374 * Also restock the Rx queue via iwl_pcie_rxq_restock.
413− * This is called only during initialization
375+ * This is called as a scheduled work item (except for during initialization)
414376 */
415−static void iwl_pcie_rx_replenish(struct iwl_trans *trans)
377+static void iwl_pcie_rx_replenish(struct iwl_trans *trans, gfp_t gfp)
416378 {
417− iwl_pcie_rxq_alloc_rbs(trans);
379+ iwl_pcie_rxq_alloc_rbs(trans, gfp);
418380
419381 iwl_pcie_rxq_restock(trans);
420382 }
421383
422−/*
423− * iwl_pcie_rx_allocator - Allocates pages in the background for RX queues
424− *
425− * Allocates for each received request 8 pages
426− * Called as a scheduled work item.
427− */
428−static void iwl_pcie_rx_allocator(struct iwl_trans *trans)
429−{
430− struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
431− struct iwl_rb_allocator *rba = &trans_pcie->rba;
432−
433− while (atomic_read(&rba->req_pending)) {
434− int i;
435− struct list_head local_empty;
436− struct list_head local_allocated;
437−
438− INIT_LIST_HEAD(&local_allocated);
439− spin_lock(&rba->lock);
440− /* swap out the entire rba->rbd_empty to a local list */
441− list_replace_init(&rba->rbd_empty, &local_empty);
442− spin_unlock(&rba->lock);
443−
444− for (i = 0; i < RX_CLAIM_REQ_ALLOC;) {
445− struct iwl_rx_mem_buffer *rxb;
446− struct page *page;
447−
448− /* List should never be empty - each reused RBD is
449− * returned to the list, and initial pool covers any
450− * possible gap between the time the page is allocated
451− * to the time the RBD is added.
452− */
453− BUG_ON(list_empty(&local_empty));
454− /* Get the first rxb from the rbd list */
455− rxb = list_first_entry(&local_empty,
456− struct iwl_rx_mem_buffer, list);
457− BUG_ON(rxb->page);
458−
459− /* Alloc a new receive buffer */
460− page = iwl_pcie_rx_alloc_page(trans);
461− if (!page)
462− continue;
463− rxb->page = page;
464−
465− /* Get physical address of the RB */
466− rxb->page_dma = dma_map_page(trans->dev, page, 0,
467− PAGE_SIZE << trans_pcie->rx_page_order,
468− DMA_FROM_DEVICE);
469− if (dma_mapping_error(trans->dev, rxb->page_dma)) {
470− rxb->page = NULL;
471− __free_pages(page, trans_pcie->rx_page_order);
472− continue;
473− }
474− /* dma address must be no more than 36 bits */
475− BUG_ON(rxb->page_dma & ~DMA_BIT_MASK(36));
476− /* and also 256 byte aligned! */
477− BUG_ON(rxb->page_dma & DMA_BIT_MASK(8));
478−
479− /* move the allocated entry to the out list */
480− list_move(&rxb->list, &local_allocated);
481− i++;
482− }
483−
484− spin_lock(&rba->lock);
485− /* add the allocated rbds to the allocator allocated list */
486− list_splice_tail(&local_allocated, &rba->rbd_allocated);
487− /* add the unused rbds back to the allocator empty list */
488− list_splice_tail(&local_empty, &rba->rbd_empty);
489− spin_unlock(&rba->lock);
490−
491− atomic_dec(&rba->req_pending);
492− atomic_inc(&rba->req_ready);
493− }
494−}
495−
496−/*
497− * iwl_pcie_rx_allocator_get - Returns the pre-allocated pages
498−.*
499−.* Called by queue when the queue posted allocation request and
500− * has freed 8 RBDs in order to restock itself.
501− */
502−static int iwl_pcie_rx_allocator_get(struct iwl_trans *trans,
503− struct iwl_rx_mem_buffer
504− *out[RX_CLAIM_REQ_ALLOC])
505−{
506− struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
507− struct iwl_rb_allocator *rba = &trans_pcie->rba;
508− int i;
509−
510− if (atomic_dec_return(&rba->req_ready) < 0) {
511− atomic_inc(&rba->req_ready);
512− IWL_DEBUG_RX(trans,
513− "Allocation request not ready, pending requests = %d\n",
514− atomic_read(&rba->req_pending));
515− return -ENOMEM;
516− }
517−
518− spin_lock(&rba->lock);
519− for (i = 0; i < RX_CLAIM_REQ_ALLOC; i++) {
520− /* Get next free Rx buffer, remove it from free list */
521− out[i] = list_first_entry(&rba->rbd_allocated,
522− struct iwl_rx_mem_buffer, list);
523− list_del(&out[i]->list);
524− }
525− spin_unlock(&rba->lock);
526−
527− return 0;
528−}
529−
530−static void iwl_pcie_rx_allocator_work(struct work_struct *data)
384+static void iwl_pcie_rx_replenish_work(struct work_struct *data)
531385 {
532− struct iwl_rb_allocator *rba_p =
533− container_of(data, struct iwl_rb_allocator, rx_alloc);
534386 struct iwl_trans_pcie *trans_pcie =
535− container_of(rba_p, struct iwl_trans_pcie, rba);
387+ container_of(data, struct iwl_trans_pcie, rx_replenish);
536388
537− iwl_pcie_rx_allocator(trans_pcie->trans);
389+ iwl_pcie_rx_replenish(trans_pcie->trans, GFP_KERNEL);
538390 }
539391
540392 static int iwl_pcie_rx_alloc(struct iwl_trans *trans)
541393 {
542394 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
543395 struct iwl_rxq *rxq = &trans_pcie->rxq;
544− struct iwl_rb_allocator *rba = &trans_pcie->rba;
545396 struct device *dev = trans->dev;
546397
547398 memset(&trans_pcie->rxq, 0, sizeof(trans_pcie->rxq));
548399
549400 spin_lock_init(&rxq->lock);
550− spin_lock_init(&rba->lock);
551401
552402 if (WARN_ON(rxq->bd || rxq->rb_stts))
553403 return -EINVAL;
@@ -637,49 +487,15 @@ static void iwl_pcie_rx_init_rxb_lists(struct iwl_rxq *rxq) · 83 unmodified lines
637487 INIT_LIST_HEAD(&rxq->rx_free);
638488 INIT_LIST_HEAD(&rxq->rx_used);
639489 rxq->free_count = 0;
640− rxq->used_count = 0;
641490
642− for (i = 0; i < RX_QUEUE_SIZE; i++)
491+ for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++)
643492 list_add(&rxq->pool[i].list, &rxq->rx_used);
644493 }
645494
646−static void iwl_pcie_rx_init_rba(struct iwl_rb_allocator *rba)
647−{
648− int i;
649−
650− lockdep_assert_held(&rba->lock);
651−
652− INIT_LIST_HEAD(&rba->rbd_allocated);
653− INIT_LIST_HEAD(&rba->rbd_empty);
654−
655− for (i = 0; i < RX_POOL_SIZE; i++)
656− list_add(&rba->pool[i].list, &rba->rbd_empty);
657−}
658−
659−static void iwl_pcie_rx_free_rba(struct iwl_trans *trans)
660−{
661− struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
662− struct iwl_rb_allocator *rba = &trans_pcie->rba;
663− int i;
664−
665− lockdep_assert_held(&rba->lock);
666−
667− for (i = 0; i < RX_POOL_SIZE; i++) {
668− if (!rba->pool[i].page)
669− continue;
670− dma_unmap_page(trans->dev, rba->pool[i].page_dma,
671− PAGE_SIZE << trans_pcie->rx_page_order,
672− DMA_FROM_DEVICE);
673− __free_pages(rba->pool[i].page, trans_pcie->rx_page_order);
674− rba->pool[i].page = NULL;
675− }
676−}
677−
678495 int iwl_pcie_rx_init(struct iwl_trans *trans)
679496 {
680497 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
681498 struct iwl_rxq *rxq = &trans_pcie->rxq;
682− struct iwl_rb_allocator *rba = &trans_pcie->rba;
683499 int i, err;
684500
685501 if (!rxq->bd) {
@@ -687,21 +503,11 @@ int iwl_pcie_rx_init(struct iwl_trans *trans) · 1 unmodified line
687503 if (err)
688504 return err;
689505 }
690− if (!rba->alloc_wq)
691− rba->alloc_wq = alloc_workqueue("rb_allocator",
692− WQ_HIGHPRI | WQ_UNBOUND, 1);
693− INIT_WORK(&rba->rx_alloc, iwl_pcie_rx_allocator_work);
694−
695− spin_lock(&rba->lock);
696− atomic_set(&rba->req_pending, 0);
697− atomic_set(&rba->req_ready, 0);
698− /* free all first - we might be reconfigured for a different size */
699− iwl_pcie_rx_free_rba(trans);
700− iwl_pcie_rx_init_rba(rba);
701− spin_unlock(&rba->lock);
702506
703507 spin_lock(&rxq->lock);
704508
509+ INIT_WORK(&trans_pcie->rx_replenish, iwl_pcie_rx_replenish_work);
510+
705511 /* free all first - we might be reconfigured for a different size */
706512 iwl_pcie_rxq_free_rbs(trans);
707513 iwl_pcie_rx_init_rxb_lists(rxq);
@@ -716,7 +522,7 @@ int iwl_pcie_rx_init(struct iwl_trans *trans) · 8 unmodified lines
716522 memset(rxq->rb_stts, 0, sizeof(*rxq->rb_stts));
717523 spin_unlock(&rxq->lock);
718524
719− iwl_pcie_rx_replenish(trans);
525+ iwl_pcie_rx_replenish(trans, GFP_KERNEL);
720526
721527 iwl_pcie_rx_hw_init(trans, rxq);
722528
@@ -731,7 +537,6 @@ void iwl_pcie_rx_free(struct iwl_trans *trans) · 8 unmodified lines
731537 {
732538 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
733539 struct iwl_rxq *rxq = &trans_pcie->rxq;
734− struct iwl_rb_allocator *rba = &trans_pcie->rba;
735540
736541 /*if rxq->bd is NULL, it means that nothing has been allocated,
737542 * exit now */
@@ -740,15 +545,7 @@ void iwl_pcie_rx_free(struct iwl_trans *trans) · 2 unmodified lines
740545 return;
741546 }
742547
743− cancel_work_sync(&rba->rx_alloc);
744− if (rba->alloc_wq) {
745− destroy_workqueue(rba->alloc_wq);
746− rba->alloc_wq = NULL;
747− }
748−
749− spin_lock(&rba->lock);
750− iwl_pcie_rx_free_rba(trans);
751− spin_unlock(&rba->lock);
548+ cancel_work_sync(&trans_pcie->rx_replenish);
752549
753550 spin_lock(&rxq->lock);
754551 iwl_pcie_rxq_free_rbs(trans);
@@ -769,43 +566,6 @@ void iwl_pcie_rx_free(struct iwl_trans *trans) · 14 unmodified lines
769566 rxq->rb_stts = NULL;
770567 }
771568
772−/*
773− * iwl_pcie_rx_reuse_rbd - Recycle used RBDs
774− *
775− * Called when a RBD can be reused. The RBD is transferred to the allocator.
776− * When there are 2 empty RBDs - a request for allocation is posted
777− */
778−static void iwl_pcie_rx_reuse_rbd(struct iwl_trans *trans,
779− struct iwl_rx_mem_buffer *rxb,
780− struct iwl_rxq *rxq)
781−{
782− struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
783− struct iwl_rb_allocator *rba = &trans_pcie->rba;
784−
785− /* Count the used RBDs */
786− rxq->used_count++;
787−
788− /* Move the RBD to the used list, will be moved to allocator in batches
789− * before claiming or posting a request*/
790− list_add_tail(&rxb->list, &rxq->rx_used);
791−
792− /* If we have RX_POST_REQ_ALLOC new released rx buffers -
793− * issue a request for allocator. Modulo RX_CLAIM_REQ_ALLOC is
794− * used for the case we failed to claim RX_CLAIM_REQ_ALLOC,
795− * after but we still need to post another request.
796− */
797− if ((rxq->used_count % RX_CLAIM_REQ_ALLOC) == RX_POST_REQ_ALLOC) {
798− /* Move the 2 RBDs to the allocator ownership.
799− Allocator has another 6 from pool for the request completion*/
800− spin_lock(&rba->lock);
801− list_splice_tail_init(&rxq->rx_used, &rba->rbd_empty);
802− spin_unlock(&rba->lock);
803−
804− atomic_inc(&rba->req_pending);
805− queue_work(rba->alloc_wq, &rba->rx_alloc);
806− }
807−}
808−
809569 static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans,
810570 struct iwl_rx_mem_buffer *rxb)
811571 {
@@ -928,13 +688,13 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans, · 116 unmodified lines
928688 */
929689 __free_pages(rxb->page, trans_pcie->rx_page_order);
930690 rxb->page = NULL;
931− iwl_pcie_rx_reuse_rbd(trans, rxb, rxq);
691+ list_add_tail(&rxb->list, &rxq->rx_used);
932692 } else {
933693 list_add_tail(&rxb->list, &rxq->rx_free);
934694 rxq->free_count++;
935695 }
936696 } else
937− iwl_pcie_rx_reuse_rbd(trans, rxb, rxq);
697+ list_add_tail(&rxb->list, &rxq->rx_used);
938698 }
939699
940700 /*
@@ -944,7 +704,10 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans) · 3 unmodified lines
944704 {
945705 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
946706 struct iwl_rxq *rxq = &trans_pcie->rxq;
947− u32 r, i, j;
707+ u32 r, i;
708+ u8 fill_rx = 0;
709+ u32 count = 8;
710+ int total_empty;
948711
949712 restart:
950713 spin_lock(&rxq->lock);
@@ -957,6 +720,14 @@ restart: · 6 unmodified lines
957720 if (i == r)
958721 IWL_DEBUG_RX(trans, "HW = SW = %d\n", r);
959722
723+ /* calculate total frames need to be restock after handling RX */
724+ total_empty = r - rxq->write_actual;
725+ if (total_empty < 0)
726+ total_empty += RX_QUEUE_SIZE;
727+
728+ if (total_empty > (RX_QUEUE_SIZE / 2))
729+ fill_rx = 1;
730+
960731 while (i != r) {
961732 struct iwl_rx_mem_buffer *rxb;
962733
@@ -968,48 +739,29 @@ restart: · 5 unmodified lines
968739 iwl_pcie_rx_handle_rb(trans, rxb);
969740
970741 i = (i + 1) & RX_QUEUE_MASK;
971−
972− /* If we have RX_CLAIM_REQ_ALLOC released rx buffers -
973− * try to claim the pre-allocated buffers from the allocator */
974− if (rxq->used_count >= RX_CLAIM_REQ_ALLOC) {
975− struct iwl_rb_allocator *rba = &trans_pcie->rba;
976− struct iwl_rx_mem_buffer *out[RX_CLAIM_REQ_ALLOC];
977−
978− /* Add the remaining 6 empty RBDs for allocator use */
979− spin_lock(&rba->lock);
980− list_splice_tail_init(&rxq->rx_used, &rba->rbd_empty);
981− spin_unlock(&rba->lock);
982−
983− /* If not ready - continue, will try to reclaim later.
984− * No need to reschedule work - allocator exits only on
985− * success */
986− if (!iwl_pcie_rx_allocator_get(trans, out)) {
987− /* If success - then RX_CLAIM_REQ_ALLOC
988− * buffers were retrieved and should be added
989− * to free list */
990− rxq->used_count -= RX_CLAIM_REQ_ALLOC;
991− for (j = 0; j < RX_CLAIM_REQ_ALLOC; j++) {
992− list_add_tail(&out[j]->list,
993− &rxq->rx_free);
994− rxq->free_count++;
995− }
742+ /* If there are a lot of unused frames,
743+ * restock the Rx queue so ucode wont assert. */
744+ if (fill_rx) {
745+ count++;
746+ if (count >= 8) {
747+ rxq->read = i;
748+ spin_unlock(&rxq->lock);
749+ iwl_pcie_rx_replenish(trans, GFP_ATOMIC);
750+ count = 0;
751+ goto restart;
996752 }
997753 }
998− /* handle restock for two cases:
999− * - we just pulled buffers from the allocator
1000− * - we have 8+ unstolen pages accumulated */
1001− if (rxq->free_count >= RX_CLAIM_REQ_ALLOC) {
1002− rxq->read = i;
1003− spin_unlock(&rxq->lock);
1004− iwl_pcie_rxq_restock(trans);
1005− goto restart;
1006− }
1007754 }
1008755
1009756 /* Backtrack one entry */
1010757 rxq->read = i;
1011758 spin_unlock(&rxq->lock);
1012759
760+ if (fill_rx)
761+ iwl_pcie_rx_replenish(trans, GFP_ATOMIC);
762+ else
763+ iwl_pcie_rxq_restock(trans);
764+
1013765 if (trans_pcie->napi.poll)
1014766 napi_gro_flush(&trans_pcie->napi, false);
1015767 }
drivers/net/wireless/iwlwifi/pcie/trans.c+29−23
@@ -182,7 +182,7 @@ static void iwl_trans_pcie_write_shr(struct iwl_trans *trans, u32 reg, u32 val) · 181 unmodified lines
182182
183183 static void iwl_pcie_set_pwr(struct iwl_trans *trans, bool vaux)
184184 {
185− if (!trans->cfg->apmg_not_supported)
185+ if (trans->cfg->apmg_not_supported)
186186 return;
187187
188188 if (vaux && pci_pme_capable(to_pci_dev(trans->dev), PCI_D3cold))
@@ -2459,7 +2459,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, · 2270 unmodified lines
24592459 struct iwl_trans_pcie *trans_pcie;
24602460 struct iwl_trans *trans;
24612461 u16 pci_cmd;
2462− int err;
2462+ int ret;
24632463
24642464 trans = iwl_trans_alloc(sizeof(struct iwl_trans_pcie),
24652465 &pdev->dev, cfg, &trans_ops_pcie, 0);
@@ -2474,8 +2474,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, · 8 unmodified lines
24742474 spin_lock_init(&trans_pcie->ref_lock);
24752475 init_waitqueue_head(&trans_pcie->ucode_write_waitq);
24762476
2477− err = pci_enable_device(pdev);
2478− if (err)
2477+ ret = pci_enable_device(pdev);
2478+ if (ret)
24792479 goto out_no_pci;
24802480
24812481 if (!cfg->base_params->pcie_l1_allowed) {
@@ -2491,23 +2491,23 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, · 9 unmodified lines
24912491
24922492 pci_set_master(pdev);
24932493
2494− err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36));
2495− if (!err)
2496− err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(36));
2497− if (err) {
2498− err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
2499− if (!err)
2500− err = pci_set_consistent_dma_mask(pdev,
2494+ ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(36));
2495+ if (!ret)
2496+ ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(36));
2497+ if (ret) {
2498+ ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
2499+ if (!ret)
2500+ ret = pci_set_consistent_dma_mask(pdev,
25012501 DMA_BIT_MASK(32));
25022502 /* both attempts failed: */
2503− if (err) {
2503+ if (ret) {
25042504 dev_err(&pdev->dev, "No suitable DMA available\n");
25052505 goto out_pci_disable_device;
25062506 }
25072507 }
25082508
2509− err = pci_request_regions(pdev, DRV_NAME);
2510− if (err) {
2509+ ret = pci_request_regions(pdev, DRV_NAME);
2510+ if (ret) {
25112511 dev_err(&pdev->dev, "pci_request_regions failed\n");
25122512 goto out_pci_disable_device;
25132513 }
@@ -2515,7 +2515,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, · 1 unmodified line
25152515 trans_pcie->hw_base = pci_ioremap_bar(pdev, 0);
25162516 if (!trans_pcie->hw_base) {
25172517 dev_err(&pdev->dev, "pci_ioremap_bar failed\n");
2518− err = -ENODEV;
2518+ ret = -ENODEV;
25192519 goto out_pci_release_regions;
25202520 }
25212521
@@ -2527,9 +2527,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, · 5 unmodified lines
25272527 trans_pcie->pci_dev = pdev;
25282528 iwl_disable_interrupts(trans);
25292529
2530− err = pci_enable_msi(pdev);
2531− if (err) {
2532− dev_err(&pdev->dev, "pci_enable_msi failed(0X%x)\n", err);
2530+ ret = pci_enable_msi(pdev);
2531+ if (ret) {
2532+ dev_err(&pdev->dev, "pci_enable_msi failed(0X%x)\n", ret);
25332533 /* enable rfkill interrupt: hw bug w/a */
25342534 pci_read_config_word(pdev, PCI_COMMAND, &pci_cmd);
25352535 if (pci_cmd & PCI_COMMAND_INTX_DISABLE) {
@@ -2547,11 +2547,16 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, · 11 unmodified lines
25472547 */
25482548 if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) {
25492549 unsigned long flags;
2550− int ret;
25512550
25522551 trans->hw_rev = (trans->hw_rev & 0xfff0) |
25532552 (CSR_HW_REV_STEP(trans->hw_rev << 2) << 2);
25542553
2554+ ret = iwl_pcie_prepare_card_hw(trans);
2555+ if (ret) {
2556+ IWL_WARN(trans, "Exit HW not ready\n");
2557+ goto out_pci_disable_msi;
2558+ }
2559+
25552560 /*
25562561 * in-order to recognize C step driver should read chip version
25572562 * id located at the AUX bus MISC address space.
@@ -2591,13 +2596,14 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, · 33 unmodified lines
25912596 /* Initialize the wait queue for commands */
25922597 init_waitqueue_head(&trans_pcie->wait_command_queue);
25932598
2594− if (iwl_pcie_alloc_ict(trans))
2599+ ret = iwl_pcie_alloc_ict(trans);
2600+ if (ret)
25952601 goto out_pci_disable_msi;
25962602
2597− err = request_threaded_irq(pdev->irq, iwl_pcie_isr,
2603+ ret = request_threaded_irq(pdev->irq, iwl_pcie_isr,
25982604 iwl_pcie_irq_handler,
25992605 IRQF_SHARED, DRV_NAME, trans);
2600− if (err) {
2606+ if (ret) {
26012607 IWL_ERR(trans, "Error allocating IRQ %d\n", pdev->irq);
26022608 goto out_free_ict;
26032609 }
@@ -2617,5 +2623,5 @@ out_pci_disable_device: · 13 unmodified lines
26172623 pci_disable_device(pdev);
26182624 out_no_pci:
26192625 iwl_trans_free(trans);
2620− return ERR_PTR(err);
2626+ return ERR_PTR(ret);
26212627 }
drivers/net/xen-netback/netback.c+3−3
@@ -1566,13 +1566,13 @@ static inline void xenvif_tx_dealloc_action(struct xenvif_queue *queue) · 1565 unmodified lines
15661566 smp_rmb();
15671567
15681568 while (dc != dp) {
1569− BUG_ON(gop - queue->tx_unmap_ops > MAX_PENDING_REQS);
1569+ BUG_ON(gop - queue->tx_unmap_ops >= MAX_PENDING_REQS);
15701570 pending_idx =
15711571 queue->dealloc_ring[pending_index(dc++)];
15721572
1573− pending_idx_release[gop-queue->tx_unmap_ops] =
1573+ pending_idx_release[gop - queue->tx_unmap_ops] =
15741574 pending_idx;
1575− queue->pages_to_unmap[gop-queue->tx_unmap_ops] =
1575+ queue->pages_to_unmap[gop - queue->tx_unmap_ops] =
15761576 queue->mmap_pages[pending_idx];
15771577 gnttab_set_unmap_op(gop,
15781578 idx_to_kaddr(queue, pending_idx),
drivers/pinctrl/bcm/pinctrl-bcm2835.c+2−0
@@ -473,6 +473,8 @@ static void bcm2835_gpio_irq_disable(struct irq_data *data) · 472 unmodified lines
473473
474474 spin_lock_irqsave(&pc->irq_lock[bank], flags);
475475 bcm2835_gpio_irq_config(pc, gpio, false);
476+ /* Clear events that were latched prior to clearing event sources */
477+ bcm2835_gpio_set_bit(pc, GPEDS0, gpio);
476478 clear_bit(offset, &pc->enabled_irq_map[bank]);
477479 spin_unlock_irqrestore(&pc->irq_lock[bank], flags);
478480 }
drivers/pinctrl/freescale/pinctrl-imx1-core.c+1−2
@@ -403,14 +403,13 @@ static int imx1_pinconf_set(struct pinctrl_dev *pctldev, · 402 unmodified lines
403403 unsigned num_configs)
404404 {
405405 struct imx1_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
406− const struct imx1_pinctrl_soc_info *info = ipctl->info;
407406 int i;
408407
409408 for (i = 0; i != num_configs; ++i) {
410409 imx1_write_bit(ipctl, pin_id, configs[i] & 0x01, MX1_PUEN);
411410
412411 dev_dbg(ipctl->dev, "pinconf set pullup pin %s\n",
413− info->pins[pin_id].name);
412+ pin_desc_get(pctldev, pin_id)->name);
414413 }
415414
416415 return 0;
drivers/pinctrl/nomadik/pinctrl-abx500.c+0−1
@@ -787,7 +787,6 @@ static const struct pinmux_ops abx500_pinmux_ops = { · 786 unmodified lines
787787 .set_mux = abx500_pmx_set,
788788 .gpio_request_enable = abx500_gpio_request_enable,
789789 .gpio_disable_free = abx500_gpio_disable_free,
790− .strict = true,
791790 };
792791
793792 static int abx500_get_groups_cnt(struct pinctrl_dev *pctldev)
drivers/pinctrl/pinctrl-lpc18xx.c+2−2
@@ -823,7 +823,7 @@ static int lpc18xx_pconf_set_i2c0(struct pinctrl_dev *pctldev, · 822 unmodified lines
823823 break;
824824
825825 case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
826− if (param)
826+ if (param_val)
827827 *reg &= ~(LPC18XX_SCU_I2C0_ZIF << shift);
828828 else
829829 *reg |= (LPC18XX_SCU_I2C0_ZIF << shift);
@@ -876,7 +876,7 @@ static int lpc18xx_pconf_set_pin(struct pinctrl_dev *pctldev, · 46 unmodified lines
876876 break;
877877
878878 case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
879− if (param)
879+ if (param_val)
880880 *reg &= ~LPC18XX_SCU_PIN_ZIF;
881881 else
882882 *reg |= LPC18XX_SCU_PIN_ZIF;
drivers/pinctrl/pinctrl-single.c+2−1
@@ -1760,7 +1760,8 @@ static int pcs_irq_init_chained_handler(struct pcs_device *pcs, · 1759 unmodified lines
17601760 int res;
17611761
17621762 res = request_irq(pcs_soc->irq, pcs_irq_handler,
1763− IRQF_SHARED | IRQF_NO_SUSPEND,
1763+ IRQF_SHARED | IRQF_NO_SUSPEND |
1764+ IRQF_NO_THREAD,
17641765 name, pcs_soc);
17651766 if (res) {
17661767 pcs_soc->irq = -1;
drivers/pinctrl/samsung/pinctrl-samsung.c+0−5
@@ -33,11 +33,6 @@ · 32 unmodified lines
3333 #include "../core.h"
3434 #include "pinctrl-samsung.h"
3535
36−#define GROUP_SUFFIX "-grp"
37−#define GSUFFIX_LEN sizeof(GROUP_SUFFIX)
38−#define FUNCTION_SUFFIX "-mux"
39−#define FSUFFIX_LEN sizeof(FUNCTION_SUFFIX)
40−
4136 /* list of all possible config options supported */
4237 static struct pin_config {
4338 const char *property;
drivers/pinctrl/sh-pfc/sh_pfc.h+1−1
@@ -224,7 +224,7 @@ struct sh_pfc_soc_info { · 223 unmodified lines
224224
225225 /* PINMUX_GPIO_GP_ALL - Expand to a list of sh_pfc_pin entries */
226226 #define _GP_GPIO(bank, _pin, _name, sfx) \
227− [(bank * 32) + _pin] = { \
227+ { \
228228 .pin = (bank * 32) + _pin, \
229229 .name = __stringify(_name), \
230230 .enum_id = _name##_DATA, \
drivers/pinctrl/spear/pinctrl-spear.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Driver for the ST Microelectronics SPEAr pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * Inspired from:
88 * - U300 Pinctl drivers
drivers/pinctrl/spear/pinctrl-spear.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Driver header file for the ST Microelectronics SPEAr pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
drivers/pinctrl/spear/pinctrl-spear1310.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Driver for the ST Microelectronics SPEAr1310 pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
@@ -2730,7 +2730,7 @@ static void __exit spear1310_pinctrl_exit(void) · 2721 unmodified lines
27302730 }
27312731 module_exit(spear1310_pinctrl_exit);
27322732
2733−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
2733+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
27342734 MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
27352735 MODULE_LICENSE("GPL v2");
27362736 MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear1340.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Driver for the ST Microelectronics SPEAr1340 pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
@@ -2046,7 +2046,7 @@ static void __exit spear1340_pinctrl_exit(void) · 2037 unmodified lines
20462046 }
20472047 module_exit(spear1340_pinctrl_exit);
20482048
2049−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
2049+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
20502050 MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver");
20512051 MODULE_LICENSE("GPL v2");
20522052 MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear300.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Driver for the ST Microelectronics SPEAr300 pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
@@ -703,7 +703,7 @@ static void __exit spear300_pinctrl_exit(void) · 694 unmodified lines
703703 }
704704 module_exit(spear300_pinctrl_exit);
705705
706−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
706+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
707707 MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver");
708708 MODULE_LICENSE("GPL v2");
709709 MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear310.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Driver for the ST Microelectronics SPEAr310 pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
@@ -426,7 +426,7 @@ static void __exit spear310_pinctrl_exit(void) · 417 unmodified lines
426426 }
427427 module_exit(spear310_pinctrl_exit);
428428
429−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
429+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
430430 MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver");
431431 MODULE_LICENSE("GPL v2");
432432 MODULE_DEVICE_TABLE(of, spear310_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear320.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Driver for the ST Microelectronics SPEAr320 pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
@@ -3467,7 +3467,7 @@ static void __exit spear320_pinctrl_exit(void) · 3458 unmodified lines
34673467 }
34683468 module_exit(spear320_pinctrl_exit);
34693469
3470−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
3470+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
34713471 MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver");
34723472 MODULE_LICENSE("GPL v2");
34733473 MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match);
drivers/pinctrl/spear/pinctrl-spear3xx.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Driver for the ST Microelectronics SPEAr3xx pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
drivers/pinctrl/spear/pinctrl-spear3xx.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * Header file for the ST Microelectronics SPEAr3xx pinmux
33 *
44 * Copyright (C) 2012 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
drivers/platform/x86/dell-laptop.c+125−46
@@ -309,12 +309,15 @@ static const struct dmi_system_id dell_quirks[] __initconst = { · 308 unmodified lines
309309 static struct calling_interface_buffer *buffer;
310310 static DEFINE_MUTEX(buffer_mutex);
311311
312−static int hwswitch_state;
312+static void clear_buffer(void)
313+{
314+ memset(buffer, 0, sizeof(struct calling_interface_buffer));
315+}
313316
314317 static void get_buffer(void)
315318 {
316319 mutex_lock(&buffer_mutex);
317− memset(buffer, 0, sizeof(struct calling_interface_buffer));
320+ clear_buffer();
318321 }
319322
320323 static void release_buffer(void)
@@ -548,21 +551,41 @@ static int dell_rfkill_set(void *data, bool blocked) · 227 unmodified lines
548551 int disable = blocked ? 1 : 0;
549552 unsigned long radio = (unsigned long)data;
550553 int hwswitch_bit = (unsigned long)data - 1;
554+ int hwswitch;
555+ int status;
556+ int ret;
551557
552558 get_buffer();
559+
560+ dell_send_request(buffer, 17, 11);
561+ ret = buffer->output[0];
562+ status = buffer->output[1];
563+
564+ if (ret != 0)
565+ goto out;
566+
567+ clear_buffer();
568+
569+ buffer->input[0] = 0x2;
553570 dell_send_request(buffer, 17, 11);
571+ ret = buffer->output[0];
572+ hwswitch = buffer->output[1];
554573
555574 /* If the hardware switch controls this radio, and the hardware
556575 switch is disabled, always disable the radio */
557− if ((hwswitch_state & BIT(hwswitch_bit)) &&
558− !(buffer->output[1] & BIT(16)))
576+ if (ret == 0 && (hwswitch & BIT(hwswitch_bit)) &&
577+ (status & BIT(0)) && !(status & BIT(16)))
559578 disable = 1;
560579
580+ clear_buffer();
581+
561582 buffer->input[0] = (1 | (radio<<8) | (disable << 16));
562583 dell_send_request(buffer, 17, 11);
584+ ret = buffer->output[0];
563585
586+ out:
564587 release_buffer();
565− return 0;
588+ return dell_smi_error(ret);
566589 }
567590
568591 /* Must be called with the buffer held */
@@ -572,6 +595,7 @@ static void dell_rfkill_update_sw_state(struct rfkill *rfkill, int radio, · 3 unmodified lines
572595 if (status & BIT(0)) {
573596 /* Has hw-switch, sync sw_state to BIOS */
574597 int block = rfkill_blocked(rfkill);
598+ clear_buffer();
575599 buffer->input[0] = (1 | (radio << 8) | (block << 16));
576600 dell_send_request(buffer, 17, 11);
577601 } else {
@@ -581,23 +605,43 @@ static void dell_rfkill_update_sw_state(struct rfkill *rfkill, int radio, · 3 unmodified lines
581605 }
582606
583607 static void dell_rfkill_update_hw_state(struct rfkill *rfkill, int radio,
584− int status)
608+ int status, int hwswitch)
585609 {
586− if (hwswitch_state & (BIT(radio - 1)))
610+ if (hwswitch & (BIT(radio - 1)))
587611 rfkill_set_hw_state(rfkill, !(status & BIT(16)));
588612 }
589613
590614 static void dell_rfkill_query(struct rfkill *rfkill, void *data)
591615 {
616+ int radio = ((unsigned long)data & 0xF);
617+ int hwswitch;
592618 int status;
619+ int ret;
593620
594621 get_buffer();
622+
595623 dell_send_request(buffer, 17, 11);
624+ ret = buffer->output[0];
596625 status = buffer->output[1];
597626
598− dell_rfkill_update_hw_state(rfkill, (unsigned long)data, status);
627+ if (ret != 0 || !(status & BIT(0))) {
628+ release_buffer();
629+ return;
630+ }
631+
632+ clear_buffer();
633+
634+ buffer->input[0] = 0x2;
635+ dell_send_request(buffer, 17, 11);
636+ ret = buffer->output[0];
637+ hwswitch = buffer->output[1];
599638
600639 release_buffer();
640+
641+ if (ret != 0)
642+ return;
643+
644+ dell_rfkill_update_hw_state(rfkill, radio, status, hwswitch);
601645 }
602646
603647 static const struct rfkill_ops dell_rfkill_ops = {
@@ -609,13 +653,27 @@ static struct dentry *dell_laptop_dir; · 5 unmodified lines
609653
610654 static int dell_debugfs_show(struct seq_file *s, void *data)
611655 {
656+ int hwswitch_state;
657+ int hwswitch_ret;
612658 int status;
659+ int ret;
613660
614661 get_buffer();
662+
615663 dell_send_request(buffer, 17, 11);
664+ ret = buffer->output[0];
616665 status = buffer->output[1];
666+
667+ clear_buffer();
668+
669+ buffer->input[0] = 0x2;
670+ dell_send_request(buffer, 17, 11);
671+ hwswitch_ret = buffer->output[0];
672+ hwswitch_state = buffer->output[1];
673+
617674 release_buffer();
618675
676+ seq_printf(s, "return:\t%d\n", ret);
619677 seq_printf(s, "status:\t0x%X\n", status);
620678 seq_printf(s, "Bit 0 : Hardware switch supported: %lu\n",
621679 status & BIT(0));
@@ -657,7 +715,8 @@ static int dell_debugfs_show(struct seq_file *s, void *data) · 35 unmodified lines
657715 seq_printf(s, "Bit 21: WiGig is blocked: %lu\n",
658716 (status & BIT(21)) >> 21);
659717
660− seq_printf(s, "\nhwswitch_state:\t0x%X\n", hwswitch_state);
718+ seq_printf(s, "\nhwswitch_return:\t%d\n", hwswitch_ret);
719+ seq_printf(s, "hwswitch_state:\t0x%X\n", hwswitch_state);
661720 seq_printf(s, "Bit 0 : Wifi controlled by switch: %lu\n",
662721 hwswitch_state & BIT(0));
663722 seq_printf(s, "Bit 1 : Bluetooth controlled by switch: %lu\n",
@@ -693,25 +752,43 @@ static const struct file_operations dell_debugfs_fops = { · 29 unmodified lines
693752
694753 static void dell_update_rfkill(struct work_struct *ignored)
695754 {
755+ int hwswitch = 0;
696756 int status;
757+ int ret;
697758
698759 get_buffer();
760+
699761 dell_send_request(buffer, 17, 11);
762+ ret = buffer->output[0];
700763 status = buffer->output[1];
701764
765+ if (ret != 0)
766+ goto out;
767+
768+ clear_buffer();
769+
770+ buffer->input[0] = 0x2;
771+ dell_send_request(buffer, 17, 11);
772+ ret = buffer->output[0];
773+
774+ if (ret == 0 && (status & BIT(0)))
775+ hwswitch = buffer->output[1];
776+
702777 if (wifi_rfkill) {
703− dell_rfkill_update_hw_state(wifi_rfkill, 1, status);
778+ dell_rfkill_update_hw_state(wifi_rfkill, 1, status, hwswitch);
704779 dell_rfkill_update_sw_state(wifi_rfkill, 1, status);
705780 }
706781 if (bluetooth_rfkill) {
707− dell_rfkill_update_hw_state(bluetooth_rfkill, 2, status);
782+ dell_rfkill_update_hw_state(bluetooth_rfkill, 2, status,
783+ hwswitch);
708784 dell_rfkill_update_sw_state(bluetooth_rfkill, 2, status);
709785 }
710786 if (wwan_rfkill) {
711− dell_rfkill_update_hw_state(wwan_rfkill, 3, status);
787+ dell_rfkill_update_hw_state(wwan_rfkill, 3, status, hwswitch);
712788 dell_rfkill_update_sw_state(wwan_rfkill, 3, status);
713789 }
714790
791+ out:
715792 release_buffer();
716793 }
717794 static DECLARE_DELAYED_WORK(dell_rfkill_work, dell_update_rfkill);
@@ -773,21 +850,17 @@ static int __init dell_setup_rfkill(void) · 55 unmodified lines
773850
774851 get_buffer();
775852 dell_send_request(buffer, 17, 11);
853+ ret = buffer->output[0];
776854 status = buffer->output[1];
777− buffer->input[0] = 0x2;
778− dell_send_request(buffer, 17, 11);
779− hwswitch_state = buffer->output[1];
780855 release_buffer();
781856
782− if (!(status & BIT(0))) {
783− if (force_rfkill) {
784− /* No hwsitch, clear all hw-controlled bits */
785− hwswitch_state &= ~7;
786− } else {
787− /* rfkill is only tested on laptops with a hwswitch */
788− return 0;
789− }
790− }
857+ /* dell wireless info smbios call is not supported */
858+ if (ret != 0)
859+ return 0;
860+
861+ /* rfkill is only tested on laptops with a hwswitch */
862+ if (!(status & BIT(0)) && !force_rfkill)
863+ return 0;
791864
792865 if ((status & (1<<2|1<<8)) == (1<<2|1<<8)) {
793866 wifi_rfkill = rfkill_alloc("dell-wifi", &platform_device->dev,
@@ -932,47 +1005,50 @@ static void dell_cleanup_rfkill(void) · 138 unmodified lines
9321005
9331006 static int dell_send_intensity(struct backlight_device *bd)
9341007 {
935− int ret = 0;
1008+ int token;
1009+ int ret;
1010+
1011+ token = find_token_location(BRIGHTNESS_TOKEN);
1012+ if (token == -1)
1013+ return -ENODEV;
9361014
9371015 get_buffer();
938− buffer->input[0] = find_token_location(BRIGHTNESS_TOKEN);
1016+ buffer->input[0] = token;
9391017 buffer->input[1] = bd->props.brightness;
9401018
941− if (buffer->input[0] == -1) {
942− ret = -ENODEV;
943− goto out;
944− }
945−
9461019 if (power_supply_is_system_supplied() > 0)
9471020 dell_send_request(buffer, 1, 2);
9481021 else
9491022 dell_send_request(buffer, 1, 1);
9501023
951− out:
1024+ ret = dell_smi_error(buffer->output[0]);
1025+
9521026 release_buffer();
9531027 return ret;
9541028 }
9551029
9561030 static int dell_get_intensity(struct backlight_device *bd)
9571031 {
958− int ret = 0;
1032+ int token;
1033+ int ret;
9591034
960− get_buffer();
961− buffer->input[0] = find_token_location(BRIGHTNESS_TOKEN);
1035+ token = find_token_location(BRIGHTNESS_TOKEN);
1036+ if (token == -1)
1037+ return -ENODEV;
9621038
963− if (buffer->input[0] == -1) {
964− ret = -ENODEV;
965− goto out;
966− }
1039+ get_buffer();
1040+ buffer->input[0] = token;
9671041
9681042 if (power_supply_is_system_supplied() > 0)
9691043 dell_send_request(buffer, 0, 2);
9701044 else
9711045 dell_send_request(buffer, 0, 1);
9721046
973− ret = buffer->output[1];
1047+ if (buffer->output[0])
1048+ ret = dell_smi_error(buffer->output[0]);
1049+ else
1050+ ret = buffer->output[1];
9741051
975− out:
9761052 release_buffer();
9771053 return ret;
9781054 }
@@ -2036,6 +2112,7 @@ static void kbd_led_exit(void) · 1057 unmodified lines
20362112 static int __init dell_init(void)
20372113 {
20382114 int max_intensity = 0;
2115+ int token;
20392116 int ret;
20402117
20412118 if (!dmi_check_system(dell_device_table))
@@ -2094,13 +2171,15 @@ static int __init dell_init(void) · 52 unmodified lines
20942171 if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
20952172 return 0;
20962173
2097− get_buffer();
2098− buffer->input[0] = find_token_location(BRIGHTNESS_TOKEN);
2099− if (buffer->input[0] != -1) {
2174+ token = find_token_location(BRIGHTNESS_TOKEN);
2175+ if (token != -1) {
2176+ get_buffer();
2177+ buffer->input[0] = token;
21002178 dell_send_request(buffer, 0, 2);
2101− max_intensity = buffer->output[3];
2179+ if (buffer->output[0] == 0)
2180+ max_intensity = buffer->output[3];
2181+ release_buffer();
21022182 }
2103− release_buffer();
21042183
21052184 if (max_intensity) {
21062185 struct backlight_properties props;
drivers/platform/x86/intel_pmc_ipc.c+48−35
@@ -96,18 +96,18 @@ static struct intel_pmc_ipc_dev { · 95 unmodified lines
9696 struct completion cmd_complete;
9797
9898 /* The following PMC BARs share the same ACPI device with the IPC */
99− void *acpi_io_base;
99+ resource_size_t acpi_io_base;
100100 int acpi_io_size;
101101 struct platform_device *tco_dev;
102102
103103 /* gcr */
104− void *gcr_base;
104+ resource_size_t gcr_base;
105105 int gcr_size;
106106
107107 /* punit */
108− void *punit_base;
108+ resource_size_t punit_base;
109109 int punit_size;
110− void *punit_base2;
110+ resource_size_t punit_base2;
111111 int punit_size2;
112112 struct platform_device *punit_dev;
113113 } ipcdev;
@@ -210,10 +210,15 @@ static int intel_pmc_ipc_check_status(void) · 96 unmodified lines
210210 return ret;
211211 }
212212
213−/*
214− * intel_pmc_ipc_simple_command
215− * @cmd: command
216− * @sub: sub type
213+/**
214+ * intel_pmc_ipc_simple_command() - Simple IPC command
215+ * @cmd: IPC command code.
216+ * @sub: IPC command sub type.
217+ *
218+ * Send a simple IPC command to PMC when don't need to specify
219+ * input/output data and source/dest pointers.
220+ *
221+ * Return: an IPC error code or 0 on success.
217222 */
218223 int intel_pmc_ipc_simple_command(int cmd, int sub)
219224 {
@@ -232,16 +237,20 @@ int intel_pmc_ipc_simple_command(int cmd, int sub) · 12 unmodified lines
232237 }
233238 EXPORT_SYMBOL_GPL(intel_pmc_ipc_simple_command);
234239
235−/*
236− * intel_pmc_ipc_raw_cmd
237− * @cmd: command
238− * @sub: sub type
239− * @in: input data
240− * @inlen: input length in bytes
241− * @out: output data
242− * @outlen: output length in dwords
243− * @sptr: data writing to SPTR register
244− * @dptr: data writing to DPTR register
240+/**
241+ * intel_pmc_ipc_raw_cmd() - IPC command with data and pointers
242+ * @cmd: IPC command code.
243+ * @sub: IPC command sub type.
244+ * @in: input data of this IPC command.
245+ * @inlen: input data length in bytes.
246+ * @out: output data of this IPC command.
247+ * @outlen: output data length in dwords.
248+ * @sptr: data writing to SPTR register.
249+ * @dptr: data writing to DPTR register.
250+ *
251+ * Send an IPC command to PMC with input/output data and source/dest pointers.
252+ *
253+ * Return: an IPC error code or 0 on success.
245254 */
246255 int intel_pmc_ipc_raw_cmd(u32 cmd, u32 sub, u8 *in, u32 inlen, u32 *out,
247256 u32 outlen, u32 dptr, u32 sptr)
@@ -278,14 +287,18 @@ int intel_pmc_ipc_raw_cmd(u32 cmd, u32 sub, u8 *in, u32 inlen, u32 *out, · 30 unmodified lines
278287 }
279288 EXPORT_SYMBOL_GPL(intel_pmc_ipc_raw_cmd);
280289
281−/*
282− * intel_pmc_ipc_command
283− * @cmd: command
284− * @sub: sub type
285− * @in: input data
286− * @inlen: input length in bytes
287− * @out: output data
288− * @outlen: output length in dwords
290+/**
291+ * intel_pmc_ipc_command() - IPC command with input/output data
292+ * @cmd: IPC command code.
293+ * @sub: IPC command sub type.
294+ * @in: input data of this IPC command.
295+ * @inlen: input data length in bytes.
296+ * @out: output data of this IPC command.
297+ * @outlen: output data length in dwords.
298+ *
299+ * Send an IPC command to PMC with input/output data.
300+ *
301+ * Return: an IPC error code or 0 on success.
289302 */
290303 int intel_pmc_ipc_command(u32 cmd, u32 sub, u8 *in, u32 inlen,
291304 u32 *out, u32 outlen)
@@ -480,11 +493,11 @@ static int ipc_create_punit_device(void) · 188 unmodified lines
480493 pdev->dev.parent = ipcdev.dev;
481494
482495 res = punit_res;
483− res->start = (resource_size_t)ipcdev.punit_base;
496+ res->start = ipcdev.punit_base;
484497 res->end = res->start + ipcdev.punit_size - 1;
485498
486499 res = punit_res + PUNIT_RESOURCE_INTER;
487− res->start = (resource_size_t)ipcdev.punit_base2;
500+ res->start = ipcdev.punit_base2;
488501 res->end = res->start + ipcdev.punit_size2 - 1;
489502
490503 ret = platform_device_add_resources(pdev, punit_res,
@@ -522,15 +535,15 @@ static int ipc_create_tco_device(void) · 31 unmodified lines
522535 pdev->dev.parent = ipcdev.dev;
523536
524537 res = tco_res + TCO_RESOURCE_ACPI_IO;
525− res->start = (resource_size_t)ipcdev.acpi_io_base + TCO_BASE_OFFSET;
538+ res->start = ipcdev.acpi_io_base + TCO_BASE_OFFSET;
526539 res->end = res->start + TCO_REGS_SIZE - 1;
527540
528541 res = tco_res + TCO_RESOURCE_SMI_EN_IO;
529− res->start = (resource_size_t)ipcdev.acpi_io_base + SMI_EN_OFFSET;
542+ res->start = ipcdev.acpi_io_base + SMI_EN_OFFSET;
530543 res->end = res->start + SMI_EN_SIZE - 1;
531544
532545 res = tco_res + TCO_RESOURCE_GCR_MEM;
533− res->start = (resource_size_t)ipcdev.gcr_base;
546+ res->start = ipcdev.gcr_base;
534547 res->end = res->start + ipcdev.gcr_size - 1;
535548
536549 ret = platform_device_add_resources(pdev, tco_res, ARRAY_SIZE(tco_res));
@@ -589,7 +602,7 @@ static int ipc_plat_get_res(struct platform_device *pdev) · 52 unmodified lines
589602 return -ENXIO;
590603 }
591604 size = resource_size(res);
592− ipcdev.acpi_io_base = (void *)res->start;
605+ ipcdev.acpi_io_base = res->start;
593606 ipcdev.acpi_io_size = size;
594607 dev_info(&pdev->dev, "io res: %llx %x\n",
595608 (long long)res->start, (int)resource_size(res));
@@ -601,7 +614,7 @@ static int ipc_plat_get_res(struct platform_device *pdev) · 5 unmodified lines
601614 return -ENXIO;
602615 }
603616 size = resource_size(res);
604− ipcdev.punit_base = (void *)res->start;
617+ ipcdev.punit_base = res->start;
605618 ipcdev.punit_size = size;
606619 dev_info(&pdev->dev, "punit data res: %llx %x\n",
607620 (long long)res->start, (int)resource_size(res));
@@ -613,7 +626,7 @@ static int ipc_plat_get_res(struct platform_device *pdev) · 5 unmodified lines
613626 return -ENXIO;
614627 }
615628 size = resource_size(res);
616− ipcdev.punit_base2 = (void *)res->start;
629+ ipcdev.punit_base2 = res->start;
617630 ipcdev.punit_size2 = size;
618631 dev_info(&pdev->dev, "punit interface res: %llx %x\n",
619632 (long long)res->start, (int)resource_size(res));
@@ -637,7 +650,7 @@ static int ipc_plat_get_res(struct platform_device *pdev) · 17 unmodified lines
637650 }
638651 ipcdev.ipc_base = addr;
639652
640− ipcdev.gcr_base = (void *)(res->start + size);
653+ ipcdev.gcr_base = res->start + size;
641654 ipcdev.gcr_size = PLAT_RESOURCE_GCR_SIZE;
642655 dev_info(&pdev->dev, "ipc res: %llx %x\n",
643656 (long long)res->start, (int)resource_size(res));
drivers/platform/x86/intel_scu_ipc.c+3−3
@@ -216,13 +216,13 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) · 215 unmodified lines
216216 int nc;
217217 u32 offset = 0;
218218 int err;
219− u8 cbuf[IPC_WWBUF_SIZE] = { };
219+ u8 cbuf[IPC_WWBUF_SIZE];
220220 u32 *wbuf = (u32 *)&cbuf;
221221
222− mutex_lock(&ipclock);
223−
224222 memset(cbuf, 0, sizeof(cbuf));
225223
224+ mutex_lock(&ipclock);
225+
226226 if (ipcdev.pdev == NULL) {
227227 mutex_unlock(&ipclock);
228228 return -ENODEV;
drivers/rtc/rtc-armada38x.c+1−1
@@ -88,7 +88,7 @@ static int armada38x_rtc_set_time(struct device *dev, struct rtc_time *tm) · 87 unmodified lines
8888 {
8989 struct armada38x_rtc *rtc = dev_get_drvdata(dev);
9090 int ret = 0;
91− unsigned long time, flags;
91+ unsigned long time;
9292
9393 ret = rtc_tm_to_time(tm, &time);
9494
drivers/rtc/rtc-mt6397.c+2−2
@@ -343,6 +343,8 @@ static int mtk_rtc_probe(struct platform_device *pdev) · 342 unmodified lines
343343 goto out_dispose_irq;
344344 }
345345
346+ device_init_wakeup(&pdev->dev, 1);
347+
346348 rtc->rtc_dev = rtc_device_register("mt6397-rtc", &pdev->dev,
347349 &mtk_rtc_ops, THIS_MODULE);
348350 if (IS_ERR(rtc->rtc_dev)) {
@@ -351,8 +353,6 @@ static int mtk_rtc_probe(struct platform_device *pdev) · 2 unmodified lines
351353 goto out_free_irq;
352354 }
353355
354− device_init_wakeup(&pdev->dev, 1);
355−
356356 return 0;
357357
358358 out_free_irq:
drivers/s390/block/dasd.c+29−7
@@ -1862,6 +1862,33 @@ static void __dasd_device_check_expire(struct dasd_device *device) · 1861 unmodified lines
18621862 }
18631863 }
18641864
1865+/*
1866+ * return 1 when device is not eligible for IO
1867+ */
1868+static int __dasd_device_is_unusable(struct dasd_device *device,
1869+ struct dasd_ccw_req *cqr)
1870+{
1871+ int mask = ~(DASD_STOPPED_DC_WAIT | DASD_UNRESUMED_PM);
1872+
1873+ if (test_bit(DASD_FLAG_OFFLINE, &device->flags)) {
1874+ /* dasd is being set offline. */
1875+ return 1;
1876+ }
1877+ if (device->stopped) {
1878+ if (device->stopped & mask) {
1879+ /* stopped and CQR will not change that. */
1880+ return 1;
1881+ }
1882+ if (!test_bit(DASD_CQR_VERIFY_PATH, &cqr->flags)) {
1883+ /* CQR is not able to change device to
1884+ * operational. */
1885+ return 1;
1886+ }
1887+ /* CQR required to get device operational. */
1888+ }
1889+ return 0;
1890+}
1891+
18651892 /*
18661893 * Take a look at the first request on the ccw queue and check
18671894 * if it needs to be started.
@@ -1876,13 +1903,8 @@ static void __dasd_device_start_head(struct dasd_device *device) · 8 unmodified lines
18761903 cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, devlist);
18771904 if (cqr->status != DASD_CQR_QUEUED)
18781905 return;
1879− /* when device is stopped, return request to previous layer
1880− * exception: only the disconnect or unresumed bits are set and the
1881− * cqr is a path verification request
1882− */
1883− if (device->stopped &&
1884− !(!(device->stopped & ~(DASD_STOPPED_DC_WAIT | DASD_UNRESUMED_PM))
1885− && test_bit(DASD_CQR_VERIFY_PATH, &cqr->flags))) {
1906+ /* if device is not usable return request to upper layer */
1907+ if (__dasd_device_is_unusable(device, cqr)) {
18861908 cqr->intrc = -EAGAIN;
18871909 cqr->status = DASD_CQR_CLEARED;
18881910 dasd_schedule_device_bh(device);
drivers/s390/block/dasd_alias.c+2−1
@@ -699,7 +699,8 @@ struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *base_device) · 698 unmodified lines
699699 struct dasd_device, alias_list);
700700 spin_unlock_irqrestore(&lcu->lock, flags);
701701 alias_priv = (struct dasd_eckd_private *) alias_device->private;
702− if ((alias_priv->count < private->count) && !alias_device->stopped)
702+ if ((alias_priv->count < private->count) && !alias_device->stopped &&
703+ !test_bit(DASD_FLAG_OFFLINE, &alias_device->flags))
703704 return alias_device;
704705 else
705706 return NULL;
drivers/s390/char/sclp_early.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #define KMSG_COMPONENT "sclp_early"
88 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
99
10+#include <linux/errno.h>
1011 #include <asm/ctl_reg.h>
1112 #include <asm/sclp.h>
1213 #include <asm/ipl.h>
drivers/s390/crypto/zcrypt_api.c+7−0
@@ -54,6 +54,10 @@ MODULE_DESCRIPTION("Cryptographic Coprocessor interface, " \ · 53 unmodified lines
5454 "Copyright IBM Corp. 2001, 2012");
5555 MODULE_LICENSE("GPL");
5656
57+static int zcrypt_hwrng_seed = 1;
58+module_param_named(hwrng_seed, zcrypt_hwrng_seed, int, S_IRUSR|S_IRGRP);
59+MODULE_PARM_DESC(hwrng_seed, "Turn on/off hwrng auto seed, default is 1 (on).");
60+
5761 static DEFINE_SPINLOCK(zcrypt_device_lock);
5862 static LIST_HEAD(zcrypt_device_list);
5963 static int zcrypt_device_count = 0;
@@ -1373,6 +1377,7 @@ static int zcrypt_rng_data_read(struct hwrng *rng, u32 *data) · 1313 unmodified lines
13731377 static struct hwrng zcrypt_rng_dev = {
13741378 .name = "zcrypt",
13751379 .data_read = zcrypt_rng_data_read,
1380+ .quality = 990,
13761381 };
13771382
13781383 static int zcrypt_rng_device_add(void)
@@ -1387,6 +1392,8 @@ static int zcrypt_rng_device_add(void) · 8 unmodified lines
13871392 goto out;
13881393 }
13891394 zcrypt_rng_buffer_index = 0;
1395+ if (!zcrypt_hwrng_seed)
1396+ zcrypt_rng_dev.quality = 0;
13901397 rc = hwrng_register(&zcrypt_rng_dev);
13911398 if (rc)
13921399 goto out_free;
drivers/scsi/scsi_sysfs.c+1−1
@@ -859,7 +859,7 @@ sdev_store_queue_depth(struct device *dev, struct device_attribute *attr, · 858 unmodified lines
859859
860860 depth = simple_strtoul(buf, NULL, 0);
861861
862− if (depth < 1 || depth > sht->can_queue)
862+ if (depth < 1 || depth > sdev->host->can_queue)
863863 return -EINVAL;
864864
865865 retval = sht->change_queue_depth(sdev, depth);
drivers/scsi/scsi_transport_srp.c+2−1
@@ -203,7 +203,7 @@ static ssize_t srp_show_tmo(char *buf, int tmo) · 202 unmodified lines
203203 return tmo >= 0 ? sprintf(buf, "%d\n", tmo) : sprintf(buf, "off\n");
204204 }
205205
206−static int srp_parse_tmo(int *tmo, const char *buf)
206+int srp_parse_tmo(int *tmo, const char *buf)
207207 {
208208 int res = 0;
209209
@@ -214,6 +214,7 @@ static int srp_parse_tmo(int *tmo, const char *buf) · 4 unmodified lines
214214
215215 return res;
216216 }
217+EXPORT_SYMBOL(srp_parse_tmo);
217218
218219 static ssize_t show_reconnect_delay(struct device *dev,
219220 struct device_attribute *attr, char *buf)
drivers/scsi/st.c+1−1
@@ -1329,9 +1329,9 @@ static int st_open(struct inode *inode, struct file *filp) · 1328 unmodified lines
13291329 spin_lock(&st_use_lock);
13301330 STp->in_use = 0;
13311331 spin_unlock(&st_use_lock);
1332− scsi_tape_put(STp);
13331332 if (resumed)
13341333 scsi_autopm_put_device(STp->device);
1334+ scsi_tape_put(STp);
13351335 return retval;
13361336
13371337 }
drivers/staging/board/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config STAGING_BOARD
22 bool "Staging Board Support"
3− depends on OF_ADDRESS
3+ depends on OF_ADDRESS && OF_IRQ && CLKDEV_LOOKUP
44 help
55 Select to enable per-board staging support code.
66
drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h+0−1
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 #define DEBUG_PORTAL_ALLOC
3232 #define DEBUG_SUBSYSTEM S_LND
3333
34−#include <asm/irq.h>
3534 #include <linux/crc32.h>
3635 #include <linux/errno.h>
3736 #include <linux/if.h>
drivers/staging/vt6655/device_main.c+1−1
@@ -1418,7 +1418,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, · 1417 unmodified lines
14181418
14191419 priv->current_aid = conf->aid;
14201420
1421− if (changed & BSS_CHANGED_BSSID) {
1421+ if (changed & BSS_CHANGED_BSSID && conf->bssid) {
14221422 unsigned long flags;
14231423
14241424 spin_lock_irqsave(&priv->lock, flags);
drivers/staging/vt6656/main_usb.c+1−1
@@ -701,7 +701,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, · 700 unmodified lines
701701
702702 priv->current_aid = conf->aid;
703703
704− if (changed & BSS_CHANGED_BSSID)
704+ if (changed & BSS_CHANGED_BSSID && conf->bssid)
705705 vnt_mac_set_bssid_addr(priv, (u8 *)conf->bssid);
706706
707707
drivers/usb/dwc2/core.c+15−40
@@ -72,17 +72,7 @@ static int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg) · 71 unmodified lines
7272 dev_dbg(hsotg->dev, "%s\n", __func__);
7373
7474 /* Backup Host regs */
75− hr = hsotg->hr_backup;
76− if (!hr) {
77− hr = devm_kzalloc(hsotg->dev, sizeof(*hr), GFP_KERNEL);
78− if (!hr) {
79− dev_err(hsotg->dev, "%s: can't allocate host regs\n",
80− __func__);
81− return -ENOMEM;
82− }
83−
84− hsotg->hr_backup = hr;
85− }
75+ hr = &hsotg->hr_backup;
8676 hr->hcfg = readl(hsotg->regs + HCFG);
8777 hr->haintmsk = readl(hsotg->regs + HAINTMSK);
8878 for (i = 0; i < hsotg->core_params->host_channels; ++i)
@@ -90,6 +80,7 @@ static int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg) · 1 unmodified line
9080
9181 hr->hprt0 = readl(hsotg->regs + HPRT0);
9282 hr->hfir = readl(hsotg->regs + HFIR);
83+ hr->valid = true;
9384
9485 return 0;
9586 }
@@ -109,12 +100,13 @@ static int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg) · 13 unmodified lines
109100 dev_dbg(hsotg->dev, "%s\n", __func__);
110101
111102 /* Restore host regs */
112− hr = hsotg->hr_backup;
113− if (!hr) {
103+ hr = &hsotg->hr_backup;
104+ if (!hr->valid) {
114105 dev_err(hsotg->dev, "%s: no host registers to restore\n",
115106 __func__);
116107 return -EINVAL;
117108 }
109+ hr->valid = false;
118110
119111 writel(hr->hcfg, hsotg->regs + HCFG);
120112 writel(hr->haintmsk, hsotg->regs + HAINTMSK);
@@ -152,17 +144,7 @@ static int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg) · 31 unmodified lines
152144 dev_dbg(hsotg->dev, "%s\n", __func__);
153145
154146 /* Backup dev regs */
155− dr = hsotg->dr_backup;
156− if (!dr) {
157− dr = devm_kzalloc(hsotg->dev, sizeof(*dr), GFP_KERNEL);
158− if (!dr) {
159− dev_err(hsotg->dev, "%s: can't allocate device regs\n",
160− __func__);
161− return -ENOMEM;
162− }
163−
164− hsotg->dr_backup = dr;
165− }
147+ dr = &hsotg->dr_backup;
166148
167149 dr->dcfg = readl(hsotg->regs + DCFG);
168150 dr->dctl = readl(hsotg->regs + DCTL);
@@ -195,7 +177,7 @@ static int dwc2_backup_device_registers(struct dwc2_hsotg *hsotg) · 26 unmodified lines
195177 dr->doeptsiz[i] = readl(hsotg->regs + DOEPTSIZ(i));
196178 dr->doepdma[i] = readl(hsotg->regs + DOEPDMA(i));
197179 }
198−
180+ dr->valid = true;
199181 return 0;
200182 }
201183
@@ -215,12 +197,13 @@ static int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg) · 13 unmodified lines
215197 dev_dbg(hsotg->dev, "%s\n", __func__);
216198
217199 /* Restore dev regs */
218− dr = hsotg->dr_backup;
219− if (!dr) {
200+ dr = &hsotg->dr_backup;
201+ if (!dr->valid) {
220202 dev_err(hsotg->dev, "%s: no device registers to restore\n",
221203 __func__);
222204 return -EINVAL;
223205 }
206+ dr->valid = false;
224207
225208 writel(dr->dcfg, hsotg->regs + DCFG);
226209 writel(dr->dctl, hsotg->regs + DCTL);
@@ -268,17 +251,7 @@ static int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg) · 41 unmodified lines
268251 int i;
269252
270253 /* Backup global regs */
271− gr = hsotg->gr_backup;
272− if (!gr) {
273− gr = devm_kzalloc(hsotg->dev, sizeof(*gr), GFP_KERNEL);
274− if (!gr) {
275− dev_err(hsotg->dev, "%s: can't allocate global regs\n",
276− __func__);
277− return -ENOMEM;
278− }
279−
280− hsotg->gr_backup = gr;
281− }
254+ gr = &hsotg->gr_backup;
282255
283256 gr->gotgctl = readl(hsotg->regs + GOTGCTL);
284257 gr->gintmsk = readl(hsotg->regs + GINTMSK);
@@ -291,6 +264,7 @@ static int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg) · 6 unmodified lines
291264 for (i = 0; i < MAX_EPS_CHANNELS; i++)
292265 gr->dtxfsiz[i] = readl(hsotg->regs + DPTXFSIZN(i));
293266
267+ gr->valid = true;
294268 return 0;
295269 }
296270
@@ -309,12 +283,13 @@ static int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg) · 12 unmodified lines
309283 dev_dbg(hsotg->dev, "%s\n", __func__);
310284
311285 /* Restore global regs */
312− gr = hsotg->gr_backup;
313− if (!gr) {
286+ gr = &hsotg->gr_backup;
287+ if (!gr->valid) {
314288 dev_err(hsotg->dev, "%s: no global registers to restore\n",
315289 __func__);
316290 return -EINVAL;
317291 }
292+ gr->valid = false;
318293
319294 writel(0xffffffff, hsotg->regs + GINTSTS);
320295 writel(gr->gotgctl, hsotg->regs + GOTGCTL);
drivers/usb/dwc2/core.h+6−3
@@ -492,6 +492,7 @@ struct dwc2_gregs_backup { · 491 unmodified lines
492492 u32 gdfifocfg;
493493 u32 dtxfsiz[MAX_EPS_CHANNELS];
494494 u32 gpwrdn;
495+ bool valid;
495496 };
496497
497498 /**
@@ -521,6 +522,7 @@ struct dwc2_dregs_backup { · 23 unmodified lines
521522 u32 doepctl[MAX_EPS_CHANNELS];
522523 u32 doeptsiz[MAX_EPS_CHANNELS];
523524 u32 doepdma[MAX_EPS_CHANNELS];
525+ bool valid;
524526 };
525527
526528 /**
@@ -538,6 +540,7 @@ struct dwc2_hregs_backup { · 11 unmodified lines
538540 u32 hcintmsk[MAX_EPS_CHANNELS];
539541 u32 hprt0;
540542 u32 hfir;
543+ bool valid;
541544 };
542545
543546 /**
@@ -705,9 +708,9 @@ struct dwc2_hsotg { · 161 unmodified lines
705708 struct work_struct wf_otg;
706709 struct timer_list wkp_timer;
707710 enum dwc2_lx_state lx_state;
708− struct dwc2_gregs_backup *gr_backup;
709− struct dwc2_dregs_backup *dr_backup;
710− struct dwc2_hregs_backup *hr_backup;
711+ struct dwc2_gregs_backup gr_backup;
712+ struct dwc2_dregs_backup dr_backup;
713+ struct dwc2_hregs_backup hr_backup;
711714
712715 struct dentry *debug_root;
713716 struct debugfs_regset32 *regset;
drivers/usb/dwc2/hcd.c+42−13
@@ -359,10 +359,9 @@ void dwc2_hcd_stop(struct dwc2_hsotg *hsotg) · 358 unmodified lines
359359
360360 /* Caller must hold driver lock */
361361 static int dwc2_hcd_urb_enqueue(struct dwc2_hsotg *hsotg,
362− struct dwc2_hcd_urb *urb, void **ep_handle,
363− gfp_t mem_flags)
362+ struct dwc2_hcd_urb *urb, struct dwc2_qh *qh,
363+ struct dwc2_qtd *qtd)
364364 {
365− struct dwc2_qtd *qtd;
366365 u32 intr_mask;
367366 int retval;
368367 int dev_speed;
@@ -386,18 +385,15 @@ static int dwc2_hcd_urb_enqueue(struct dwc2_hsotg *hsotg, · 17 unmodified lines
386385 return -ENODEV;
387386 }
388387
389− qtd = kzalloc(sizeof(*qtd), mem_flags);
390388 if (!qtd)
391− return -ENOMEM;
389+ return -EINVAL;
392390
393391 dwc2_hcd_qtd_init(qtd, urb);
394− retval = dwc2_hcd_qtd_add(hsotg, qtd, (struct dwc2_qh **)ep_handle,
395− mem_flags);
392+ retval = dwc2_hcd_qtd_add(hsotg, qtd, qh);
396393 if (retval) {
397394 dev_err(hsotg->dev,
398395 "DWC OTG HCD URB Enqueue failed adding QTD. Error status %d\n",
399396 retval);
400− kfree(qtd);
401397 return retval;
402398 }
403399
@@ -2445,6 +2441,9 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, · 2041 unmodified lines
24452441 u32 tflags = 0;
24462442 void *buf;
24472443 unsigned long flags;
2444+ struct dwc2_qh *qh;
2445+ bool qh_allocated = false;
2446+ struct dwc2_qtd *qtd;
24482447
24492448 if (dbg_urb(urb)) {
24502449 dev_vdbg(hsotg->dev, "DWC OTG HCD URB Enqueue\n");
@@ -2523,15 +2522,32 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, · 72 unmodified lines
25232522 urb->iso_frame_desc[i].length);
25242523
25252524 urb->hcpriv = dwc2_urb;
2525+ qh = (struct dwc2_qh *) ep->hcpriv;
2526+ /* Create QH for the endpoint if it doesn't exist */
2527+ if (!qh) {
2528+ qh = dwc2_hcd_qh_create(hsotg, dwc2_urb, mem_flags);
2529+ if (!qh) {
2530+ retval = -ENOMEM;
2531+ goto fail0;
2532+ }
2533+ ep->hcpriv = qh;
2534+ qh_allocated = true;
2535+ }
2536+
2537+ qtd = kzalloc(sizeof(*qtd), mem_flags);
2538+ if (!qtd) {
2539+ retval = -ENOMEM;
2540+ goto fail1;
2541+ }
25262542
25272543 spin_lock_irqsave(&hsotg->lock, flags);
25282544 retval = usb_hcd_link_urb_to_ep(hcd, urb);
25292545 if (retval)
2530− goto fail1;
2546+ goto fail2;
25312547
2532− retval = dwc2_hcd_urb_enqueue(hsotg, dwc2_urb, &ep->hcpriv, mem_flags);
2548+ retval = dwc2_hcd_urb_enqueue(hsotg, dwc2_urb, qh, qtd);
25332549 if (retval)
2534− goto fail2;
2550+ goto fail3;
25352551
25362552 if (alloc_bandwidth) {
25372553 dwc2_allocate_bus_bandwidth(hcd,
@@ -2543,12 +2559,25 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, · 5 unmodified lines
25432559
25442560 return 0;
25452561
2546−fail2:
2562+fail3:
25472563 dwc2_urb->priv = NULL;
25482564 usb_hcd_unlink_urb_from_ep(hcd, urb);
2549−fail1:
2565+fail2:
25502566 spin_unlock_irqrestore(&hsotg->lock, flags);
25512567 urb->hcpriv = NULL;
2568+ kfree(qtd);
2569+fail1:
2570+ if (qh_allocated) {
2571+ struct dwc2_qtd *qtd2, *qtd2_tmp;
2572+
2573+ ep->hcpriv = NULL;
2574+ dwc2_hcd_qh_unlink(hsotg, qh);
2575+ /* Free each QTD in the QH's QTD list */
2576+ list_for_each_entry_safe(qtd2, qtd2_tmp, &qh->qtd_list,
2577+ qtd_list_entry)
2578+ dwc2_hcd_qtd_unlink_and_free(hsotg, qtd2, qh);
2579+ dwc2_hcd_qh_free(hsotg, qh);
2580+ }
25522581 fail0:
25532582 kfree(dwc2_urb);
25542583
drivers/usb/dwc2/hcd.h+4−1
@@ -463,6 +463,9 @@ extern void dwc2_hcd_queue_transactions(struct dwc2_hsotg *hsotg, · 462 unmodified lines
463463 /* Schedule Queue Functions */
464464 /* Implemented in hcd_queue.c */
465465 extern void dwc2_hcd_init_usecs(struct dwc2_hsotg *hsotg);
466+extern struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg,
467+ struct dwc2_hcd_urb *urb,
468+ gfp_t mem_flags);
466469 extern void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh);
467470 extern int dwc2_hcd_qh_add(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh);
468471 extern void dwc2_hcd_qh_unlink(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh);
@@ -471,7 +474,7 @@ extern void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, · 2 unmodified lines
471474
472475 extern void dwc2_hcd_qtd_init(struct dwc2_qtd *qtd, struct dwc2_hcd_urb *urb);
473476 extern int dwc2_hcd_qtd_add(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
474− struct dwc2_qh **qh, gfp_t mem_flags);
477+ struct dwc2_qh *qh);
475478
476479 /* Unlinks and frees a QTD */
477480 static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg,
drivers/usb/dwc2/hcd_queue.c+12−37
@@ -191,7 +191,7 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, · 190 unmodified lines
191191 *
192192 * Return: Pointer to the newly allocated QH, or NULL on error
193193 */
194−static struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg,
194+struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg,
195195 struct dwc2_hcd_urb *urb,
196196 gfp_t mem_flags)
197197 {
@@ -767,57 +767,32 @@ void dwc2_hcd_qtd_init(struct dwc2_qtd *qtd, struct dwc2_hcd_urb *urb) · 569 unmodified lines
767767 *
768768 * @hsotg: The DWC HCD structure
769769 * @qtd: The QTD to add
770− * @qh: Out parameter to return queue head
771− * @atomic_alloc: Flag to do atomic alloc if needed
770+ * @qh: Queue head to add qtd to
772771 *
773772 * Return: 0 if successful, negative error code otherwise
774773 *
775− * Finds the correct QH to place the QTD into. If it does not find a QH, it
776− * will create a new QH. If the QH to which the QTD is added is not currently
777− * scheduled, it is placed into the proper schedule based on its EP type.
774+ * If the QH to which the QTD is added is not currently scheduled, it is placed
775+ * into the proper schedule based on its EP type.
778776 */
779777 int dwc2_hcd_qtd_add(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
780− struct dwc2_qh **qh, gfp_t mem_flags)
778+ struct dwc2_qh *qh)
781779 {
782− struct dwc2_hcd_urb *urb = qtd->urb;
783− int allocated = 0;
784780 int retval;
785781
786− /*
787− * Get the QH which holds the QTD-list to insert to. Create QH if it
788− * doesn't exist.
789− */
790− if (*qh == NULL) {
791− *qh = dwc2_hcd_qh_create(hsotg, urb, mem_flags);
792− if (*qh == NULL)
793− return -ENOMEM;
794− allocated = 1;
782+ if (unlikely(!qh)) {
783+ dev_err(hsotg->dev, "%s: Invalid QH\n", __func__);
784+ retval = -EINVAL;
785+ goto fail;
795786 }
796787
797− retval = dwc2_hcd_qh_add(hsotg, *qh);
788+ retval = dwc2_hcd_qh_add(hsotg, qh);
798789 if (retval)
799790 goto fail;
800791
801− qtd->qh = *qh;
802− list_add_tail(&qtd->qtd_list_entry, &(*qh)->qtd_list);
792+ qtd->qh = qh;
793+ list_add_tail(&qtd->qtd_list_entry, &qh->qtd_list);
803794
804795 return 0;
805−
806796 fail:
807− if (allocated) {
808− struct dwc2_qtd *qtd2, *qtd2_tmp;
809− struct dwc2_qh *qh_tmp = *qh;
810−
811− *qh = NULL;
812− dwc2_hcd_qh_unlink(hsotg, qh_tmp);
813−
814− /* Free each QTD in the QH's QTD list */
815− list_for_each_entry_safe(qtd2, qtd2_tmp, &qh_tmp->qtd_list,
816− qtd_list_entry)
817− dwc2_hcd_qtd_unlink_and_free(hsotg, qtd2, qh_tmp);
818−
819− dwc2_hcd_qh_free(hsotg, qh_tmp);
820− }
821−
822797 return retval;
823798 }
drivers/usb/dwc3/core.c+4−2
@@ -446,10 +446,12 @@ static int dwc3_phy_setup(struct dwc3 *dwc) · 445 unmodified lines
446446 /* Select the HS PHY interface */
447447 switch (DWC3_GHWPARAMS3_HSPHY_IFC(dwc->hwparams.hwparams3)) {
448448 case DWC3_GHWPARAMS3_HSPHY_IFC_UTMI_ULPI:
449− if (!strncmp(dwc->hsphy_interface, "utmi", 4)) {
449+ if (dwc->hsphy_interface &&
450+ !strncmp(dwc->hsphy_interface, "utmi", 4)) {
450451 reg &= ~DWC3_GUSB2PHYCFG_ULPI_UTMI;
451452 break;
452− } else if (!strncmp(dwc->hsphy_interface, "ulpi", 4)) {
453+ } else if (dwc->hsphy_interface &&
454+ !strncmp(dwc->hsphy_interface, "ulpi", 4)) {
453455 reg |= DWC3_GUSB2PHYCFG_ULPI_UTMI;
454456 dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
455457 } else {
drivers/usb/gadget/composite.c+7−4
@@ -1758,10 +1758,13 @@ unknown: · 1757 unmodified lines
17581758 * take such requests too, if that's ever needed: to work
17591759 * in config 0, etc.
17601760 */
1761− list_for_each_entry(f, &cdev->config->functions, list)
1762− if (f->req_match && f->req_match(f, ctrl))
1763− goto try_fun_setup;
1764− f = NULL;
1761+ if (cdev->config) {
1762+ list_for_each_entry(f, &cdev->config->functions, list)
1763+ if (f->req_match && f->req_match(f, ctrl))
1764+ goto try_fun_setup;
1765+ f = NULL;
1766+ }
1767+
17651768 switch (ctrl->bRequestType & USB_RECIP_MASK) {
17661769 case USB_RECIP_INTERFACE:
17671770 if (!cdev->config || intf >= MAX_CONFIG_INTERFACES)
drivers/usb/gadget/configfs.c+1−1
@@ -571,7 +571,7 @@ static struct config_group *function_make( · 570 unmodified lines
571571 if (IS_ERR(fi))
572572 return ERR_CAST(fi);
573573
574− ret = config_item_set_name(&fi->group.cg_item, name);
574+ ret = config_item_set_name(&fi->group.cg_item, "%s", name);
575575 if (ret) {
576576 usb_put_function_instance(fi);
577577 return ERR_PTR(ret);
drivers/usb/gadget/function/f_fs.c+4−2
@@ -924,7 +924,8 @@ static ssize_t ffs_epfile_write_iter(struct kiocb *kiocb, struct iov_iter *from) · 923 unmodified lines
924924
925925 kiocb->private = p;
926926
927− kiocb_set_cancel_fn(kiocb, ffs_aio_cancel);
927+ if (p->aio)
928+ kiocb_set_cancel_fn(kiocb, ffs_aio_cancel);
928929
929930 res = ffs_epfile_io(kiocb->ki_filp, p);
930931 if (res == -EIOCBQUEUED)
@@ -968,7 +969,8 @@ static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to) · 37 unmodified lines
968969
969970 kiocb->private = p;
970971
971− kiocb_set_cancel_fn(kiocb, ffs_aio_cancel);
972+ if (p->aio)
973+ kiocb_set_cancel_fn(kiocb, ffs_aio_cancel);
972974
973975 res = ffs_epfile_io(kiocb->ki_filp, p);
974976 if (res == -EIOCBQUEUED)
drivers/usb/gadget/function/f_mass_storage.c+13−3
@@ -2786,7 +2786,7 @@ int fsg_common_set_nluns(struct fsg_common *common, int nluns) · 2785 unmodified lines
27862786 return -EINVAL;
27872787 }
27882788
2789− curlun = kcalloc(nluns, sizeof(*curlun), GFP_KERNEL);
2789+ curlun = kcalloc(FSG_MAX_LUNS, sizeof(*curlun), GFP_KERNEL);
27902790 if (unlikely(!curlun))
27912791 return -ENOMEM;
27922792
@@ -2796,8 +2796,6 @@ int fsg_common_set_nluns(struct fsg_common *common, int nluns) · 3 unmodified lines
27962796 common->luns = curlun;
27972797 common->nluns = nluns;
27982798
2799− pr_info("Number of LUNs=%d\n", common->nluns);
2800−
28012799 return 0;
28022800 }
28032801 EXPORT_SYMBOL_GPL(fsg_common_set_nluns);
@@ -3563,14 +3561,26 @@ static struct usb_function *fsg_alloc(struct usb_function_instance *fi) · 759 unmodified lines
35633561 struct fsg_opts *opts = fsg_opts_from_func_inst(fi);
35643562 struct fsg_common *common = opts->common;
35653563 struct fsg_dev *fsg;
3564+ unsigned nluns, i;
35663565
35673566 fsg = kzalloc(sizeof(*fsg), GFP_KERNEL);
35683567 if (unlikely(!fsg))
35693568 return ERR_PTR(-ENOMEM);
35703569
35713570 mutex_lock(&opts->lock);
3571+ if (!opts->refcnt) {
3572+ for (nluns = i = 0; i < FSG_MAX_LUNS; ++i)
3573+ if (common->luns[i])
3574+ nluns = i + 1;
3575+ if (!nluns)
3576+ pr_warn("No LUNS defined, continuing anyway\n");
3577+ else
3578+ common->nluns = nluns;
3579+ pr_info("Number of LUNs=%u\n", common->nluns);
3580+ }
35723581 opts->refcnt++;
35733582 mutex_unlock(&opts->lock);
3583+
35743584 fsg->function.name = FSG_DRIVER_DESC;
35753585 fsg->function.bind = fsg_bind;
35763586 fsg->function.unbind = fsg_unbind;
drivers/usb/gadget/function/f_midi.c+1−3
@@ -1145,7 +1145,7 @@ static struct usb_function *f_midi_alloc(struct usb_function_instance *fi) · 1144 unmodified lines
11451145 if (opts->id && !midi->id) {
11461146 status = -ENOMEM;
11471147 mutex_unlock(&opts->lock);
1148− goto kstrdup_fail;
1148+ goto setup_fail;
11491149 }
11501150 midi->in_ports = opts->in_ports;
11511151 midi->out_ports = opts->out_ports;
@@ -1164,8 +1164,6 @@ static struct usb_function *f_midi_alloc(struct usb_function_instance *fi) · 12 unmodified lines
11641164
11651165 return &midi->func;
11661166
1167−kstrdup_fail:
1168− f_midi_unregister_card(midi);
11691167 setup_fail:
11701168 for (--i; i >= 0; i--)
11711169 kfree(midi->in_port[i]);
drivers/usb/gadget/udc/fotg210-udc.c+1−2
@@ -1171,7 +1171,7 @@ static int fotg210_udc_probe(struct platform_device *pdev) · 1170 unmodified lines
11711171 udc_name, fotg210);
11721172 if (ret < 0) {
11731173 pr_err("request_irq error (%d)\n", ret);
1174− goto err_irq;
1174+ goto err_req;
11751175 }
11761176
11771177 ret = usb_add_gadget_udc(&pdev->dev, &fotg210->gadget);
@@ -1183,7 +1183,6 @@ static int fotg210_udc_probe(struct platform_device *pdev) · 5 unmodified lines
11831183 return 0;
11841184
11851185 err_add_udc:
1186−err_irq:
11871186 free_irq(ires->start, fotg210);
11881187
11891188 err_req:
drivers/usb/musb/musb_virthub.c+1−3
@@ -275,9 +275,7 @@ static int musb_has_gadget(struct musb *musb) · 274 unmodified lines
275275 #ifdef CONFIG_USB_MUSB_HOST
276276 return 1;
277277 #else
278− if (musb->port_mode == MUSB_PORT_MODE_HOST)
279− return 1;
280− return musb->g.dev.driver != NULL;
278+ return musb->port_mode == MUSB_PORT_MODE_HOST;
281279 #endif
282280 }
283281
drivers/usb/phy/phy-mxs-usb.c+3−0
@@ -217,6 +217,9 @@ static bool mxs_phy_get_vbus_status(struct mxs_phy *mxs_phy) · 216 unmodified lines
217217 {
218218 unsigned int vbus_value;
219219
220+ if (!mxs_phy->regmap_anatop)
221+ return false;
222+
220223 if (mxs_phy->port_id == 0)
221224 regmap_read(mxs_phy->regmap_anatop,
222225 ANADIG_USB1_VBUS_DET_STAT,
drivers/usb/serial/cp210x.c+1−0
@@ -187,6 +187,7 @@ static const struct usb_device_id id_table[] = { · 186 unmodified lines
187187 { USB_DEVICE(0x1FB9, 0x0602) }, /* Lake Shore Model 648 Magnet Power Supply */
188188 { USB_DEVICE(0x1FB9, 0x0700) }, /* Lake Shore Model 737 VSM Controller */
189189 { USB_DEVICE(0x1FB9, 0x0701) }, /* Lake Shore Model 776 Hall Matrix */
190+ { USB_DEVICE(0x2626, 0xEA60) }, /* Aruba Networks 7xxx USB Serial Console */
190191 { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
191192 { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */
192193 { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */
drivers/usb/serial/mos7720.c+138−115
@@ -121,26 +121,26 @@ static DEFINE_SPINLOCK(release_lock); · 120 unmodified lines
121121 static const unsigned int dummy; /* for clarity in register access fns */
122122
123123 enum mos_regs {
124− THR, /* serial port regs */
125− RHR,
126− IER,
127− FCR,
128− ISR,
129− LCR,
130− MCR,
131− LSR,
132− MSR,
133− SPR,
134− DLL,
135− DLM,
136− DPR, /* parallel port regs */
137− DSR,
138− DCR,
139− ECR,
140− SP1_REG, /* device control regs */
141− SP2_REG, /* serial port 2 (7720 only) */
142− PP_REG,
143− SP_CONTROL_REG,
124+ MOS7720_THR, /* serial port regs */
125+ MOS7720_RHR,
126+ MOS7720_IER,
127+ MOS7720_FCR,
128+ MOS7720_ISR,
129+ MOS7720_LCR,
130+ MOS7720_MCR,
131+ MOS7720_LSR,
132+ MOS7720_MSR,
133+ MOS7720_SPR,
134+ MOS7720_DLL,
135+ MOS7720_DLM,
136+ MOS7720_DPR, /* parallel port regs */
137+ MOS7720_DSR,
138+ MOS7720_DCR,
139+ MOS7720_ECR,
140+ MOS7720_SP1_REG, /* device control regs */
141+ MOS7720_SP2_REG, /* serial port 2 (7720 only) */
142+ MOS7720_PP_REG,
143+ MOS7720_SP_CONTROL_REG,
144144 };
145145
146146 /*
@@ -150,26 +150,26 @@ enum mos_regs { · 3 unmodified lines
150150 static inline __u16 get_reg_index(enum mos_regs reg)
151151 {
152152 static const __u16 mos7715_index_lookup_table[] = {
153− 0x00, /* THR */
154− 0x00, /* RHR */
155− 0x01, /* IER */
156− 0x02, /* FCR */
157− 0x02, /* ISR */
158− 0x03, /* LCR */
159− 0x04, /* MCR */
160− 0x05, /* LSR */
161− 0x06, /* MSR */
162− 0x07, /* SPR */
163− 0x00, /* DLL */
164− 0x01, /* DLM */
165− 0x00, /* DPR */
166− 0x01, /* DSR */
167− 0x02, /* DCR */
168− 0x0a, /* ECR */
169− 0x01, /* SP1_REG */
170− 0x02, /* SP2_REG (7720 only) */
171− 0x04, /* PP_REG (7715 only) */
172− 0x08, /* SP_CONTROL_REG */
153+ 0x00, /* MOS7720_THR */
154+ 0x00, /* MOS7720_RHR */
155+ 0x01, /* MOS7720_IER */
156+ 0x02, /* MOS7720_FCR */
157+ 0x02, /* MOS7720_ISR */
158+ 0x03, /* MOS7720_LCR */
159+ 0x04, /* MOS7720_MCR */
160+ 0x05, /* MOS7720_LSR */
161+ 0x06, /* MOS7720_MSR */
162+ 0x07, /* MOS7720_SPR */
163+ 0x00, /* MOS7720_DLL */
164+ 0x01, /* MOS7720_DLM */
165+ 0x00, /* MOS7720_DPR */
166+ 0x01, /* MOS7720_DSR */
167+ 0x02, /* MOS7720_DCR */
168+ 0x0a, /* MOS7720_ECR */
169+ 0x01, /* MOS7720_SP1_REG */
170+ 0x02, /* MOS7720_SP2_REG (7720 only) */
171+ 0x04, /* MOS7720_PP_REG (7715 only) */
172+ 0x08, /* MOS7720_SP_CONTROL_REG */
173173 };
174174 return mos7715_index_lookup_table[reg];
175175 }
@@ -181,10 +181,10 @@ static inline __u16 get_reg_index(enum mos_regs reg) · 5 unmodified lines
181181 static inline __u16 get_reg_value(enum mos_regs reg,
182182 unsigned int serial_portnum)
183183 {
184− if (reg >= SP1_REG) /* control reg */
184+ if (reg >= MOS7720_SP1_REG) /* control reg */
185185 return 0x0000;
186186
187− else if (reg >= DPR) /* parallel port reg (7715 only) */
187+ else if (reg >= MOS7720_DPR) /* parallel port reg (7715 only) */
188188 return 0x0100;
189189
190190 else /* serial port reg */
@@ -252,7 +252,8 @@ static inline int mos7715_change_mode(struct mos7715_parport *mos_parport, · 61 unmodified lines
252252 enum mos7715_pp_modes mode)
253253 {
254254 mos_parport->shadowECR = mode;
255− write_mos_reg(mos_parport->serial, dummy, ECR, mos_parport->shadowECR);
255+ write_mos_reg(mos_parport->serial, dummy, MOS7720_ECR,
256+ mos_parport->shadowECR);
256257 return 0;
257258 }
258259
@@ -486,7 +487,7 @@ static void parport_mos7715_write_data(struct parport *pp, unsigned char d) · 227 unmodified lines
486487 if (parport_prologue(pp) < 0)
487488 return;
488489 mos7715_change_mode(mos_parport, SPP);
489− write_mos_reg(mos_parport->serial, dummy, DPR, (__u8)d);
490+ write_mos_reg(mos_parport->serial, dummy, MOS7720_DPR, (__u8)d);
490491 parport_epilogue(pp);
491492 }
492493
@@ -497,7 +498,7 @@ static unsigned char parport_mos7715_read_data(struct parport *pp) · 4 unmodified lines
497498
498499 if (parport_prologue(pp) < 0)
499500 return 0;
500− read_mos_reg(mos_parport->serial, dummy, DPR, &d);
501+ read_mos_reg(mos_parport->serial, dummy, MOS7720_DPR, &d);
501502 parport_epilogue(pp);
502503 return d;
503504 }
@@ -510,7 +511,7 @@ static void parport_mos7715_write_control(struct parport *pp, unsigned char d) · 6 unmodified lines
510511 if (parport_prologue(pp) < 0)
511512 return;
512513 data = ((__u8)d & 0x0f) | (mos_parport->shadowDCR & 0xf0);
513− write_mos_reg(mos_parport->serial, dummy, DCR, data);
514+ write_mos_reg(mos_parport->serial, dummy, MOS7720_DCR, data);
514515 mos_parport->shadowDCR = data;
515516 parport_epilogue(pp);
516517 }
@@ -543,7 +544,8 @@ static unsigned char parport_mos7715_frob_control(struct parport *pp, · 26 unmodified lines
543544 if (parport_prologue(pp) < 0)
544545 return 0;
545546 mos_parport->shadowDCR = (mos_parport->shadowDCR & (~mask)) ^ val;
546− write_mos_reg(mos_parport->serial, dummy, DCR, mos_parport->shadowDCR);
547+ write_mos_reg(mos_parport->serial, dummy, MOS7720_DCR,
548+ mos_parport->shadowDCR);
547549 dcr = mos_parport->shadowDCR & 0x0f;
548550 parport_epilogue(pp);
549551 return dcr;
@@ -581,7 +583,8 @@ static void parport_mos7715_data_forward(struct parport *pp) · 31 unmodified lines
581583 return;
582584 mos7715_change_mode(mos_parport, PS2);
583585 mos_parport->shadowDCR &= ~0x20;
584− write_mos_reg(mos_parport->serial, dummy, DCR, mos_parport->shadowDCR);
586+ write_mos_reg(mos_parport->serial, dummy, MOS7720_DCR,
587+ mos_parport->shadowDCR);
585588 parport_epilogue(pp);
586589 }
587590
@@ -593,7 +596,8 @@ static void parport_mos7715_data_reverse(struct parport *pp) · 5 unmodified lines
593596 return;
594597 mos7715_change_mode(mos_parport, PS2);
595598 mos_parport->shadowDCR |= 0x20;
596− write_mos_reg(mos_parport->serial, dummy, DCR, mos_parport->shadowDCR);
599+ write_mos_reg(mos_parport->serial, dummy, MOS7720_DCR,
600+ mos_parport->shadowDCR);
597601 parport_epilogue(pp);
598602 }
599603
@@ -633,8 +637,10 @@ static void parport_mos7715_restore_state(struct parport *pp, · 33 unmodified lines
633637 spin_unlock(&release_lock);
634638 return;
635639 }
636− write_parport_reg_nonblock(mos_parport, DCR, mos_parport->shadowDCR);
637− write_parport_reg_nonblock(mos_parport, ECR, mos_parport->shadowECR);
640+ write_parport_reg_nonblock(mos_parport, MOS7720_DCR,
641+ mos_parport->shadowDCR);
642+ write_parport_reg_nonblock(mos_parport, MOS7720_ECR,
643+ mos_parport->shadowECR);
638644 spin_unlock(&release_lock);
639645 }
640646
@@ -714,14 +720,16 @@ static int mos7715_parport_init(struct usb_serial *serial) · 73 unmodified lines
714720 init_completion(&mos_parport->syncmsg_compl);
715721
716722 /* cycle parallel port reset bit */
717− write_mos_reg(mos_parport->serial, dummy, PP_REG, (__u8)0x80);
718− write_mos_reg(mos_parport->serial, dummy, PP_REG, (__u8)0x00);
723+ write_mos_reg(mos_parport->serial, dummy, MOS7720_PP_REG, (__u8)0x80);
724+ write_mos_reg(mos_parport->serial, dummy, MOS7720_PP_REG, (__u8)0x00);
719725
720726 /* initialize device registers */
721727 mos_parport->shadowDCR = DCR_INIT_VAL;
722− write_mos_reg(mos_parport->serial, dummy, DCR, mos_parport->shadowDCR);
728+ write_mos_reg(mos_parport->serial, dummy, MOS7720_DCR,
729+ mos_parport->shadowDCR);
723730 mos_parport->shadowECR = ECR_INIT_VAL;
724− write_mos_reg(mos_parport->serial, dummy, ECR, mos_parport->shadowECR);
731+ write_mos_reg(mos_parport->serial, dummy, MOS7720_ECR,
732+ mos_parport->shadowECR);
725733
726734 /* register with parport core */
727735 mos_parport->pp = parport_register_port(0, PARPORT_IRQ_NONE,
@@ -1033,45 +1041,49 @@ static int mos7720_open(struct tty_struct *tty, struct usb_serial_port *port) · 305 unmodified lines
10331041 /* Initialize MCS7720 -- Write Init values to corresponding Registers
10341042 *
10351043 * Register Index
1036− * 0 : THR/RHR
1037− * 1 : IER
1038− * 2 : FCR
1039− * 3 : LCR
1040− * 4 : MCR
1041− * 5 : LSR
1042− * 6 : MSR
1043− * 7 : SPR
1044+ * 0 : MOS7720_THR/MOS7720_RHR
1045+ * 1 : MOS7720_IER
1046+ * 2 : MOS7720_FCR
1047+ * 3 : MOS7720_LCR
1048+ * 4 : MOS7720_MCR
1049+ * 5 : MOS7720_LSR
1050+ * 6 : MOS7720_MSR
1051+ * 7 : MOS7720_SPR
10441052 *
10451053 * 0x08 : SP1/2 Control Reg
10461054 */
10471055 port_number = port->port_number;
1048− read_mos_reg(serial, port_number, LSR, &data);
1056+ read_mos_reg(serial, port_number, MOS7720_LSR, &data);
10491057
10501058 dev_dbg(&port->dev, "SS::%p LSR:%x\n", mos7720_port, data);
10511059
1052− write_mos_reg(serial, dummy, SP1_REG, 0x02);
1053− write_mos_reg(serial, dummy, SP2_REG, 0x02);
1060+ write_mos_reg(serial, dummy, MOS7720_SP1_REG, 0x02);
1061+ write_mos_reg(serial, dummy, MOS7720_SP2_REG, 0x02);
10541062
1055− write_mos_reg(serial, port_number, IER, 0x00);
1056− write_mos_reg(serial, port_number, FCR, 0x00);
1063+ write_mos_reg(serial, port_number, MOS7720_IER, 0x00);
1064+ write_mos_reg(serial, port_number, MOS7720_FCR, 0x00);
10571065
1058− write_mos_reg(serial, port_number, FCR, 0xcf);
1066+ write_mos_reg(serial, port_number, MOS7720_FCR, 0xcf);
10591067 mos7720_port->shadowLCR = 0x03;
1060− write_mos_reg(serial, port_number, LCR, mos7720_port->shadowLCR);
1068+ write_mos_reg(serial, port_number, MOS7720_LCR,
1069+ mos7720_port->shadowLCR);
10611070 mos7720_port->shadowMCR = 0x0b;
1062− write_mos_reg(serial, port_number, MCR, mos7720_port->shadowMCR);
1071+ write_mos_reg(serial, port_number, MOS7720_MCR,
1072+ mos7720_port->shadowMCR);
10631073
1064− write_mos_reg(serial, port_number, SP_CONTROL_REG, 0x00);
1065− read_mos_reg(serial, dummy, SP_CONTROL_REG, &data);
1074+ write_mos_reg(serial, port_number, MOS7720_SP_CONTROL_REG, 0x00);
1075+ read_mos_reg(serial, dummy, MOS7720_SP_CONTROL_REG, &data);
10661076 data = data | (port->port_number + 1);
1067− write_mos_reg(serial, dummy, SP_CONTROL_REG, data);
1077+ write_mos_reg(serial, dummy, MOS7720_SP_CONTROL_REG, data);
10681078 mos7720_port->shadowLCR = 0x83;
1069− write_mos_reg(serial, port_number, LCR, mos7720_port->shadowLCR);
1070− write_mos_reg(serial, port_number, THR, 0x0c);
1071− write_mos_reg(serial, port_number, IER, 0x00);
1079+ write_mos_reg(serial, port_number, MOS7720_LCR,
1080+ mos7720_port->shadowLCR);
1081+ write_mos_reg(serial, port_number, MOS7720_THR, 0x0c);
1082+ write_mos_reg(serial, port_number, MOS7720_IER, 0x00);
10721083 mos7720_port->shadowLCR = 0x03;
1073− write_mos_reg(serial, port_number, LCR, mos7720_port->shadowLCR);
1074− write_mos_reg(serial, port_number, IER, 0x0c);
1084+ write_mos_reg(serial, port_number, MOS7720_LCR,
1085+ mos7720_port->shadowLCR);
1086+ write_mos_reg(serial, port_number, MOS7720_IER, 0x0c);
10751087
10761088 response = usb_submit_urb(port->read_urb, GFP_KERNEL);
10771089 if (response)
@@ -1144,8 +1156,8 @@ static void mos7720_close(struct usb_serial_port *port) · 66 unmodified lines
11441156 usb_kill_urb(port->write_urb);
11451157 usb_kill_urb(port->read_urb);
11461158
1147− write_mos_reg(serial, port->port_number, MCR, 0x00);
1148− write_mos_reg(serial, port->port_number, IER, 0x00);
1159+ write_mos_reg(serial, port->port_number, MOS7720_MCR, 0x00);
1160+ write_mos_reg(serial, port->port_number, MOS7720_IER, 0x00);
11491161
11501162 mos7720_port->open = 0;
11511163 }
@@ -1169,7 +1181,8 @@ static void mos7720_break(struct tty_struct *tty, int break_state) · 17 unmodified lines
11691181 data = mos7720_port->shadowLCR & ~UART_LCR_SBC;
11701182
11711183 mos7720_port->shadowLCR = data;
1172− write_mos_reg(serial, port->port_number, LCR, mos7720_port->shadowLCR);
1184+ write_mos_reg(serial, port->port_number, MOS7720_LCR,
1185+ mos7720_port->shadowLCR);
11731186 }
11741187
11751188 /*
@@ -1297,7 +1310,7 @@ static void mos7720_throttle(struct tty_struct *tty) · 121 unmodified lines
12971310 /* if we are implementing RTS/CTS, toggle that line */
12981311 if (tty->termios.c_cflag & CRTSCTS) {
12991312 mos7720_port->shadowMCR &= ~UART_MCR_RTS;
1300− write_mos_reg(port->serial, port->port_number, MCR,
1313+ write_mos_reg(port->serial, port->port_number, MOS7720_MCR,
13011314 mos7720_port->shadowMCR);
13021315 }
13031316 }
@@ -1327,7 +1340,7 @@ static void mos7720_unthrottle(struct tty_struct *tty) · 23 unmodified lines
13271340 /* if we are implementing RTS/CTS, toggle that line */
13281341 if (tty->termios.c_cflag & CRTSCTS) {
13291342 mos7720_port->shadowMCR |= UART_MCR_RTS;
1330− write_mos_reg(port->serial, port->port_number, MCR,
1343+ write_mos_reg(port->serial, port->port_number, MOS7720_MCR,
13311344 mos7720_port->shadowMCR);
13321345 }
13331346 }
@@ -1352,35 +1365,39 @@ static int set_higher_rates(struct moschip_port *mos7720_port, · 18 unmodified lines
13521365 dev_dbg(&port->dev, "Sending Setting Commands ..........\n");
13531366 port_number = port->port_number;
13541367
1355− write_mos_reg(serial, port_number, IER, 0x00);
1356− write_mos_reg(serial, port_number, FCR, 0x00);
1357− write_mos_reg(serial, port_number, FCR, 0xcf);
1368+ write_mos_reg(serial, port_number, MOS7720_IER, 0x00);
1369+ write_mos_reg(serial, port_number, MOS7720_FCR, 0x00);
1370+ write_mos_reg(serial, port_number, MOS7720_FCR, 0xcf);
13581371 mos7720_port->shadowMCR = 0x0b;
1359− write_mos_reg(serial, port_number, MCR, mos7720_port->shadowMCR);
1360− write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x00);
1372+ write_mos_reg(serial, port_number, MOS7720_MCR,
1373+ mos7720_port->shadowMCR);
1374+ write_mos_reg(serial, dummy, MOS7720_SP_CONTROL_REG, 0x00);
13611375
13621376 /***********************************************
13631377 * Set for higher rates *
13641378 ***********************************************/
13651379 /* writing baud rate verbatum into uart clock field clearly not right */
13661380 if (port_number == 0)
1367− sp_reg = SP1_REG;
1381+ sp_reg = MOS7720_SP1_REG;
13681382 else
1369− sp_reg = SP2_REG;
1383+ sp_reg = MOS7720_SP2_REG;
13701384 write_mos_reg(serial, dummy, sp_reg, baud * 0x10);
1371− write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x03);
1385+ write_mos_reg(serial, dummy, MOS7720_SP_CONTROL_REG, 0x03);
13721386 mos7720_port->shadowMCR = 0x2b;
1373− write_mos_reg(serial, port_number, MCR, mos7720_port->shadowMCR);
1387+ write_mos_reg(serial, port_number, MOS7720_MCR,
1388+ mos7720_port->shadowMCR);
13741389
13751390 /***********************************************
13761391 * Set DLL/DLM
13771392 ***********************************************/
13781393 mos7720_port->shadowLCR = mos7720_port->shadowLCR | UART_LCR_DLAB;
1379− write_mos_reg(serial, port_number, LCR, mos7720_port->shadowLCR);
1380− write_mos_reg(serial, port_number, DLL, 0x01);
1381− write_mos_reg(serial, port_number, DLM, 0x00);
1394+ write_mos_reg(serial, port_number, MOS7720_LCR,
1395+ mos7720_port->shadowLCR);
1396+ write_mos_reg(serial, port_number, MOS7720_DLL, 0x01);
1397+ write_mos_reg(serial, port_number, MOS7720_DLM, 0x00);
13821398 mos7720_port->shadowLCR = mos7720_port->shadowLCR & ~UART_LCR_DLAB;
1383− write_mos_reg(serial, port_number, LCR, mos7720_port->shadowLCR);
1399+ write_mos_reg(serial, port_number, MOS7720_LCR,
1400+ mos7720_port->shadowLCR);
13841401
13851402 return 0;
13861403 }
@@ -1488,15 +1505,16 @@ static int send_cmd_write_baud_rate(struct moschip_port *mos7720_port, · 101 unmodified lines
14881505
14891506 /* Enable access to divisor latch */
14901507 mos7720_port->shadowLCR = mos7720_port->shadowLCR | UART_LCR_DLAB;
1491− write_mos_reg(serial, number, LCR, mos7720_port->shadowLCR);
1508+ write_mos_reg(serial, number, MOS7720_LCR, mos7720_port->shadowLCR);
14921509
14931510 /* Write the divisor */
1494− write_mos_reg(serial, number, DLL, (__u8)(divisor & 0xff));
1495− write_mos_reg(serial, number, DLM, (__u8)((divisor & 0xff00) >> 8));
1511+ write_mos_reg(serial, number, MOS7720_DLL, (__u8)(divisor & 0xff));
1512+ write_mos_reg(serial, number, MOS7720_DLM,
1513+ (__u8)((divisor & 0xff00) >> 8));
14961514
14971515 /* Disable access to divisor latch */
14981516 mos7720_port->shadowLCR = mos7720_port->shadowLCR & ~UART_LCR_DLAB;
1499− write_mos_reg(serial, number, LCR, mos7720_port->shadowLCR);
1517+ write_mos_reg(serial, number, MOS7720_LCR, mos7720_port->shadowLCR);
15001518
15011519 return status;
15021520 }
@@ -1600,14 +1618,16 @@ static void change_port_settings(struct tty_struct *tty, · 97 unmodified lines
16001618
16011619
16021620 /* Disable Interrupts */
1603− write_mos_reg(serial, port_number, IER, 0x00);
1604− write_mos_reg(serial, port_number, FCR, 0x00);
1605− write_mos_reg(serial, port_number, FCR, 0xcf);
1621+ write_mos_reg(serial, port_number, MOS7720_IER, 0x00);
1622+ write_mos_reg(serial, port_number, MOS7720_FCR, 0x00);
1623+ write_mos_reg(serial, port_number, MOS7720_FCR, 0xcf);
16061624
16071625 /* Send the updated LCR value to the mos7720 */
1608− write_mos_reg(serial, port_number, LCR, mos7720_port->shadowLCR);
1626+ write_mos_reg(serial, port_number, MOS7720_LCR,
1627+ mos7720_port->shadowLCR);
16091628 mos7720_port->shadowMCR = 0x0b;
1610− write_mos_reg(serial, port_number, MCR, mos7720_port->shadowMCR);
1629+ write_mos_reg(serial, port_number, MOS7720_MCR,
1630+ mos7720_port->shadowMCR);
16111631
16121632 /* set up the MCR register and send it to the mos7720 */
16131633 mos7720_port->shadowMCR = UART_MCR_OUT2;
@@ -1619,14 +1639,17 @@ static void change_port_settings(struct tty_struct *tty, · 5 unmodified lines
16191639 /* To set hardware flow control to the specified *
16201640 * serial port, in SP1/2_CONTROL_REG */
16211641 if (port_number)
1622− write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x01);
1642+ write_mos_reg(serial, dummy, MOS7720_SP_CONTROL_REG,
1643+ 0x01);
16231644 else
1624− write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x02);
1645+ write_mos_reg(serial, dummy, MOS7720_SP_CONTROL_REG,
1646+ 0x02);
16251647
16261648 } else
16271649 mos7720_port->shadowMCR &= ~(UART_MCR_XONANY);
16281650
1629− write_mos_reg(serial, port_number, MCR, mos7720_port->shadowMCR);
1651+ write_mos_reg(serial, port_number, MOS7720_MCR,
1652+ mos7720_port->shadowMCR);
16301653
16311654 /* Determine divisor based on baud rate */
16321655 baud = tty_get_baud_rate(tty);
@@ -1639,7 +1662,7 @@ static void change_port_settings(struct tty_struct *tty, · 6 unmodified lines
16391662 if (baud >= 230400) {
16401663 set_higher_rates(mos7720_port, baud);
16411664 /* Enable Interrupts */
1642− write_mos_reg(serial, port_number, IER, 0x0c);
1665+ write_mos_reg(serial, port_number, MOS7720_IER, 0x0c);
16431666 return;
16441667 }
16451668
@@ -1650,7 +1673,7 @@ static void change_port_settings(struct tty_struct *tty, · 4 unmodified lines
16501673 if (cflag & CBAUD)
16511674 tty_encode_baud_rate(tty, baud, baud);
16521675 /* Enable Interrupts */
1653− write_mos_reg(serial, port_number, IER, 0x0c);
1676+ write_mos_reg(serial, port_number, MOS7720_IER, 0x0c);
16541677
16551678 if (port->read_urb->status != -EINPROGRESS) {
16561679 status = usb_submit_urb(port->read_urb, GFP_KERNEL);
@@ -1725,7 +1748,7 @@ static int get_lsr_info(struct tty_struct *tty, · 68 unmodified lines
17251748
17261749 count = mos7720_chars_in_buffer(tty);
17271750 if (count == 0) {
1728− read_mos_reg(port->serial, port_number, LSR, &data);
1751+ read_mos_reg(port->serial, port_number, MOS7720_LSR, &data);
17291752 if ((data & (UART_LSR_TEMT | UART_LSR_THRE))
17301753 == (UART_LSR_TEMT | UART_LSR_THRE)) {
17311754 dev_dbg(&port->dev, "%s -- Empty\n", __func__);
@@ -1782,7 +1805,7 @@ static int mos7720_tiocmset(struct tty_struct *tty, · 50 unmodified lines
17821805 mcr &= ~UART_MCR_LOOP;
17831806
17841807 mos7720_port->shadowMCR = mcr;
1785− write_mos_reg(port->serial, port->port_number, MCR,
1808+ write_mos_reg(port->serial, port->port_number, MOS7720_MCR,
17861809 mos7720_port->shadowMCR);
17871810
17881811 return 0;
@@ -1827,7 +1850,7 @@ static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd, · 38 unmodified lines
18271850 }
18281851
18291852 mos7720_port->shadowMCR = mcr;
1830− write_mos_reg(port->serial, port->port_number, MCR,
1853+ write_mos_reg(port->serial, port->port_number, MOS7720_MCR,
18311854 mos7720_port->shadowMCR);
18321855
18331856 return 0;
@@ -1942,7 +1965,7 @@ static int mos7720_startup(struct usb_serial *serial) · 108 unmodified lines
19421965 }
19431966 #endif
19441967 /* LSR For Port 1 */
1945− read_mos_reg(serial, 0, LSR, &data);
1968+ read_mos_reg(serial, 0, MOS7720_LSR, &data);
19461969 dev_dbg(&dev->dev, "LSR:%x\n", data);
19471970
19481971 return 0;
drivers/usb/serial/option.c+1−0
@@ -1765,6 +1765,7 @@ static const struct usb_device_id option_ids[] = { · 1764 unmodified lines
17651765 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) },
17661766 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */
17671767 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */
1768+ { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */
17681769 { USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) },
17691770 { USB_DEVICE(VIATELECOM_VENDOR_ID, VIATELECOM_PRODUCT_CDS7) },
17701771 { } /* Terminating entry */
drivers/usb/serial/usb-serial.c+1−0
@@ -1306,6 +1306,7 @@ static void __exit usb_serial_exit(void) · 1305 unmodified lines
13061306 tty_unregister_driver(usb_serial_tty_driver);
13071307 put_tty_driver(usb_serial_tty_driver);
13081308 bus_unregister(&usb_serial_bus_type);
1309+ idr_destroy(&serial_minors);
13091310 }
13101311
13111312
drivers/watchdog/sp805_wdt.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Watchdog driver for ARM SP805 watchdog module
55 *
66 * Copyright (C) 2010 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2 or later. This program is licensed "as is" without any
@@ -303,6 +303,6 @@ static struct amba_driver sp805_wdt_driver = { · 292 unmodified lines
303303
304304 module_amba_driver(sp805_wdt_driver);
305305
306−MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
306+MODULE_AUTHOR("Viresh Kumar <vireshk@kernel.org>");
307307 MODULE_DESCRIPTION("ARM SP805 Watchdog Driver");
308308 MODULE_LICENSE("GPL");
fs/btrfs/extent-tree.c+13−0
@@ -2296,9 +2296,22 @@ static int run_one_delayed_ref(struct btrfs_trans_handle *trans, · 2295 unmodified lines
22962296 static inline struct btrfs_delayed_ref_node *
22972297 select_delayed_ref(struct btrfs_delayed_ref_head *head)
22982298 {
2299+ struct btrfs_delayed_ref_node *ref;
2300+
22992301 if (list_empty(&head->ref_list))
23002302 return NULL;
23012303
2304+ /*
2305+ * Select a delayed ref of type BTRFS_ADD_DELAYED_REF first.
2306+ * This is to prevent a ref count from going down to zero, which deletes
2307+ * the extent item from the extent tree, when there still are references
2308+ * to add, which would fail because they would not find the extent item.
2309+ */
2310+ list_for_each_entry(ref, &head->ref_list, list) {
2311+ if (ref->action == BTRFS_ADD_DELAYED_REF)
2312+ return ref;
2313+ }
2314+
23022315 return list_entry(head->ref_list.next, struct btrfs_delayed_ref_node,
23032316 list);
23042317 }
fs/btrfs/inode.c+2−3
@@ -4209,7 +4209,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, · 4208 unmodified lines
42094209 u64 extent_num_bytes = 0;
42104210 u64 extent_offset = 0;
42114211 u64 item_end = 0;
4212− u64 last_size = (u64)-1;
4212+ u64 last_size = new_size;
42134213 u32 found_type = (u8)-1;
42144214 int found_extent;
42154215 int del_item;
@@ -4493,8 +4493,7 @@ out: · 277 unmodified lines
44934493 btrfs_abort_transaction(trans, root, ret);
44944494 }
44954495 error:
4496− if (last_size != (u64)-1 &&
4497− root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID)
4496+ if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID)
44984497 btrfs_ordered_update_i_size(inode, last_size, NULL);
44994498
45004499 btrfs_free_path(path);
fs/btrfs/ioctl.c+17−1
@@ -3090,7 +3090,7 @@ out_unlock: · 3089 unmodified lines
30903090 static long btrfs_ioctl_file_extent_same(struct file *file,
30913091 struct btrfs_ioctl_same_args __user *argp)
30923092 {
3093− struct btrfs_ioctl_same_args *same;
3093+ struct btrfs_ioctl_same_args *same = NULL;
30943094 struct btrfs_ioctl_same_extent_info *info;
30953095 struct inode *src = file_inode(file);
30963096 u64 off;
@@ -3120,6 +3120,7 @@ static long btrfs_ioctl_file_extent_same(struct file *file, · 23 unmodified lines
31203120
31213121 if (IS_ERR(same)) {
31223122 ret = PTR_ERR(same);
3123+ same = NULL;
31233124 goto out;
31243125 }
31253126
@@ -3190,6 +3191,7 @@ static long btrfs_ioctl_file_extent_same(struct file *file, · 64 unmodified lines
31903191
31913192 out:
31923193 mnt_drop_write_file(file);
3194+ kfree(same);
31933195 return ret;
31943196 }
31953197
@@ -3586,6 +3588,20 @@ process_slot: · 390 unmodified lines
35863588 u64 trim = 0;
35873589 u64 aligned_end = 0;
35883590
3591+ /*
3592+ * Don't copy an inline extent into an offset
3593+ * greater than zero. Having an inline extent
3594+ * at such an offset results in chaos as btrfs
3595+ * isn't prepared for such cases. Just skip
3596+ * this case for the same reasons as commented
3597+ * at btrfs_ioctl_clone().
3598+ */
3599+ if (last_dest_end > 0) {
3600+ ret = -EOPNOTSUPP;
3601+ btrfs_end_transaction(trans, root);
3602+ goto out;
3603+ }
3604+
35893605 if (off > key.offset) {
35903606 skip = off - key.offset;
35913607 new_key.offset += skip;
fs/btrfs/transaction.c+2−2
@@ -761,7 +761,7 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, · 760 unmodified lines
761761
762762 if (!list_empty(&trans->ordered)) {
763763 spin_lock(&info->trans_lock);
764− list_splice(&trans->ordered, &cur_trans->pending_ordered);
764+ list_splice_init(&trans->ordered, &cur_trans->pending_ordered);
765765 spin_unlock(&info->trans_lock);
766766 }
767767
@@ -1866,7 +1866,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, · 1098 unmodified lines
18661866 }
18671867
18681868 spin_lock(&root->fs_info->trans_lock);
1869− list_splice(&trans->ordered, &cur_trans->pending_ordered);
1869+ list_splice_init(&trans->ordered, &cur_trans->pending_ordered);
18701870 if (cur_trans->state >= TRANS_STATE_COMMIT_START) {
18711871 spin_unlock(&root->fs_info->trans_lock);
18721872 atomic_inc(&cur_trans->use_count);
fs/configfs/item.c+2−2
@@ -115,7 +115,7 @@ void config_item_init_type_name(struct config_item *item, · 114 unmodified lines
115115 const char *name,
116116 struct config_item_type *type)
117117 {
118− config_item_set_name(item, name);
118+ config_item_set_name(item, "%s", name);
119119 item->ci_type = type;
120120 config_item_init(item);
121121 }
@@ -124,7 +124,7 @@ EXPORT_SYMBOL(config_item_init_type_name); · 2 unmodified lines
124124 void config_group_init_type_name(struct config_group *group, const char *name,
125125 struct config_item_type *type)
126126 {
127− config_item_set_name(&group->cg_item, name);
127+ config_item_set_name(&group->cg_item, "%s", name);
128128 group->cg_item.ci_type = type;
129129 config_group_init(group);
130130 }
fs/jfs/file.c+1−1
@@ -76,7 +76,7 @@ static int jfs_open(struct inode *inode, struct file *file) · 75 unmodified lines
7676 if (ji->active_ag == -1) {
7777 struct jfs_sb_info *jfs_sb = JFS_SBI(inode->i_sb);
7878 ji->active_ag = BLKTOAG(addressPXD(&ji->ixpxd), jfs_sb);
79− atomic_inc( &jfs_sb->bmap->db_active[ji->active_ag]);
79+ atomic_inc(&jfs_sb->bmap->db_active[ji->active_ag]);
8080 }
8181 spin_unlock_irq(&ji->ag_lock);
8282 }
fs/jfs/inode.c+2−2
@@ -134,11 +134,11 @@ int jfs_write_inode(struct inode *inode, struct writeback_control *wbc) · 133 unmodified lines
134134 * It has been committed since the last change, but was still
135135 * on the dirty inode list.
136136 */
137− if (!test_cflag(COMMIT_Dirty, inode)) {
137+ if (!test_cflag(COMMIT_Dirty, inode)) {
138138 /* Make sure committed changes hit the disk */
139139 jfs_flush_journal(JFS_SBI(inode->i_sb)->log, wait);
140140 return 0;
141− }
141+ }
142142
143143 if (jfs_commit_inode(inode, wait)) {
144144 jfs_err("jfs_write_inode: jfs_commit_inode failed!");
fs/jfs/namei.c+13−14
@@ -1160,7 +1160,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 1159 unmodified lines
11601160 rc = dtModify(tid, new_dir, &new_dname, &ino,
11611161 old_ip->i_ino, JFS_RENAME);
11621162 if (rc)
1163− goto out4;
1163+ goto out_tx;
11641164 drop_nlink(new_ip);
11651165 if (S_ISDIR(new_ip->i_mode)) {
11661166 drop_nlink(new_ip);
@@ -1185,7 +1185,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 18 unmodified lines
11851185 if ((new_size = commitZeroLink(tid, new_ip)) < 0) {
11861186 txAbort(tid, 1); /* Marks FS Dirty */
11871187 rc = new_size;
1188− goto out4;
1188+ goto out_tx;
11891189 }
11901190 tblk = tid_to_tblock(tid);
11911191 tblk->xflag |= COMMIT_DELETE;
@@ -1203,7 +1203,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 11 unmodified lines
12031203 if (rc) {
12041204 jfs_err("jfs_rename didn't expect dtSearch to fail "
12051205 "w/rc = %d", rc);
1206− goto out4;
1206+ goto out_tx;
12071207 }
12081208
12091209 ino = old_ip->i_ino;
@@ -1211,7 +1211,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 1 unmodified line
12111211 if (rc) {
12121212 if (rc == -EIO)
12131213 jfs_err("jfs_rename: dtInsert returned -EIO");
1214− goto out4;
1214+ goto out_tx;
12151215 }
12161216 if (S_ISDIR(old_ip->i_mode))
12171217 inc_nlink(new_dir);
@@ -1226,7 +1226,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 8 unmodified lines
12261226 jfs_err("jfs_rename did not expect dtDelete to return rc = %d",
12271227 rc);
12281228 txAbort(tid, 1); /* Marks Filesystem dirty */
1229− goto out4;
1229+ goto out_tx;
12301230 }
12311231 if (S_ISDIR(old_ip->i_mode)) {
12321232 drop_nlink(old_dir);
@@ -1285,7 +1285,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 52 unmodified lines
12851285
12861286 rc = txCommit(tid, ipcount, iplist, commit_flag);
12871287
1288− out4:
1288+ out_tx:
12891289 txEnd(tid);
12901290 if (new_ip)
12911291 mutex_unlock(&JFS_IP(new_ip)->commit_mutex);
@@ -1308,13 +1308,6 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 16 unmodified lines
13081308 }
13091309 if (new_ip && (new_ip->i_nlink == 0))
13101310 set_cflag(COMMIT_Nolink, new_ip);
1311− out3:
1312− free_UCSname(&new_dname);
1313− out2:
1314− free_UCSname(&old_dname);
1315− out1:
1316− if (new_ip && !S_ISDIR(new_ip->i_mode))
1317− IWRITE_UNLOCK(new_ip);
13181311 /*
13191312 * Truncating the directory index table is not guaranteed. It
13201313 * may need to be done iteratively
@@ -1325,7 +1318,13 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 4 unmodified lines
13251318
13261319 clear_cflag(COMMIT_Stale, old_dir);
13271320 }
1328−
1321+ if (new_ip && !S_ISDIR(new_ip->i_mode))
1322+ IWRITE_UNLOCK(new_ip);
1323+ out3:
1324+ free_UCSname(&new_dname);
1325+ out2:
1326+ free_UCSname(&old_dname);
1327+ out1:
13291328 jfs_info("jfs_rename: returning %d", rc);
13301329 return rc;
13311330 }
fs/locks.c+18−20
@@ -862,12 +862,11 @@ static int posix_locks_deadlock(struct file_lock *caller_fl, · 861 unmodified lines
862862 * whether or not a lock was successfully freed by testing the return
863863 * value for -ENOENT.
864864 */
865−static int flock_lock_file(struct file *filp, struct file_lock *request)
865+static int flock_lock_inode(struct inode *inode, struct file_lock *request)
866866 {
867867 struct file_lock *new_fl = NULL;
868868 struct file_lock *fl;
869869 struct file_lock_context *ctx;
870− struct inode *inode = file_inode(filp);
871870 int error = 0;
872871 bool found = false;
873872 LIST_HEAD(dispose);
@@ -890,7 +889,7 @@ static int flock_lock_file(struct file *filp, struct file_lock *request) · 16 unmodified lines
890889 goto find_conflict;
891890
892891 list_for_each_entry(fl, &ctx->flc_flock, fl_list) {
893− if (filp != fl->fl_file)
892+ if (request->fl_file != fl->fl_file)
894893 continue;
895894 if (request->fl_type == fl->fl_type)
896895 goto out;
@@ -1164,20 +1163,19 @@ int posix_lock_file(struct file *filp, struct file_lock *fl, · 267 unmodified lines
11641163 EXPORT_SYMBOL(posix_lock_file);
11651164
11661165 /**
1167− * posix_lock_file_wait - Apply a POSIX-style lock to a file
1168− * @filp: The file to apply the lock to
1166+ * posix_lock_inode_wait - Apply a POSIX-style lock to a file
1167+ * @inode: inode of file to which lock request should be applied
11691168 * @fl: The lock to be applied
11701169 *
1171− * Add a POSIX style lock to a file.
1172− * We merge adjacent & overlapping locks whenever possible.
1173− * POSIX locks are sorted by owner task, then by starting address
1170+ * Variant of posix_lock_file_wait that does not take a filp, and so can be
1171+ * used after the filp has already been torn down.
11741172 */
1175−int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
1173+int posix_lock_inode_wait(struct inode *inode, struct file_lock *fl)
11761174 {
11771175 int error;
11781176 might_sleep ();
11791177 for (;;) {
1180− error = posix_lock_file(filp, fl, NULL);
1178+ error = __posix_lock_file(inode, fl, NULL);
11811179 if (error != FILE_LOCK_DEFERRED)
11821180 break;
11831181 error = wait_event_interruptible(fl->fl_wait, !fl->fl_next);
@@ -1189,7 +1187,7 @@ int posix_lock_file_wait(struct file *filp, struct file_lock *fl) · 5 unmodified lines
11891187 }
11901188 return error;
11911189 }
1192−EXPORT_SYMBOL(posix_lock_file_wait);
1190+EXPORT_SYMBOL(posix_lock_inode_wait);
11931191
11941192 /**
11951193 * locks_mandatory_locked - Check for an active lock
@@ -1851,18 +1849,18 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg) · 655 unmodified lines
18511849 }
18521850
18531851 /**
1854− * flock_lock_file_wait - Apply a FLOCK-style lock to a file
1855− * @filp: The file to apply the lock to
1852+ * flock_lock_inode_wait - Apply a FLOCK-style lock to a file
1853+ * @inode: inode of the file to apply to
18561854 * @fl: The lock to be applied
18571855 *
1858− * Add a FLOCK style lock to a file.
1856+ * Apply a FLOCK style lock request to an inode.
18591857 */
1860−int flock_lock_file_wait(struct file *filp, struct file_lock *fl)
1858+int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl)
18611859 {
18621860 int error;
18631861 might_sleep();
18641862 for (;;) {
1865− error = flock_lock_file(filp, fl);
1863+ error = flock_lock_inode(inode, fl);
18661864 if (error != FILE_LOCK_DEFERRED)
18671865 break;
18681866 error = wait_event_interruptible(fl->fl_wait, !fl->fl_next);
@@ -1874,8 +1872,7 @@ int flock_lock_file_wait(struct file *filp, struct file_lock *fl) · 5 unmodified lines
18741872 }
18751873 return error;
18761874 }
1877−
1878−EXPORT_SYMBOL(flock_lock_file_wait);
1875+EXPORT_SYMBOL(flock_lock_inode_wait);
18791876
18801877 /**
18811878 * sys_flock: - flock() system call.
@@ -2401,7 +2398,8 @@ locks_remove_flock(struct file *filp) · 519 unmodified lines
24012398 .fl_type = F_UNLCK,
24022399 .fl_end = OFFSET_MAX,
24032400 };
2404− struct file_lock_context *flctx = file_inode(filp)->i_flctx;
2401+ struct inode *inode = file_inode(filp);
2402+ struct file_lock_context *flctx = inode->i_flctx;
24052403
24062404 if (list_empty(&flctx->flc_flock))
24072405 return;
@@ -2409,7 +2407,7 @@ locks_remove_flock(struct file *filp) · 1 unmodified line
24092407 if (filp->f_op->flock)
24102408 filp->f_op->flock(filp, F_SETLKW, &fl);
24112409 else
2412− flock_lock_file(filp, &fl);
2410+ flock_lock_inode(inode, &fl);
24132411
24142412 if (fl.fl_ops && fl.fl_ops->fl_release_private)
24152413 fl.fl_ops->fl_release_private(&fl);
fs/nfs/nfs4proc.c+8−10
@@ -5439,15 +5439,15 @@ static int nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock * · 5438 unmodified lines
54395439 return err;
54405440 }
54415441
5442−static int do_vfs_lock(struct file *file, struct file_lock *fl)
5442+static int do_vfs_lock(struct inode *inode, struct file_lock *fl)
54435443 {
54445444 int res = 0;
54455445 switch (fl->fl_flags & (FL_POSIX|FL_FLOCK)) {
54465446 case FL_POSIX:
5447− res = posix_lock_file_wait(file, fl);
5447+ res = posix_lock_inode_wait(inode, fl);
54485448 break;
54495449 case FL_FLOCK:
5450− res = flock_lock_file_wait(file, fl);
5450+ res = flock_lock_inode_wait(inode, fl);
54515451 break;
54525452 default:
54535453 BUG();
@@ -5484,7 +5484,6 @@ static struct nfs4_unlockdata *nfs4_alloc_unlockdata(struct file_lock *fl, · 30 unmodified lines
54845484 atomic_inc(&lsp->ls_count);
54855485 /* Ensure we don't close file until we're done freeing locks! */
54865486 p->ctx = get_nfs_open_context(ctx);
5487− get_file(fl->fl_file);
54885487 memcpy(&p->fl, fl, sizeof(p->fl));
54895488 p->server = NFS_SERVER(inode);
54905489 return p;
@@ -5496,7 +5495,6 @@ static void nfs4_locku_release_calldata(void *data) · 5 unmodified lines
54965495 nfs_free_seqid(calldata->arg.seqid);
54975496 nfs4_put_lock_state(calldata->lsp);
54985497 put_nfs_open_context(calldata->ctx);
5499− fput(calldata->fl.fl_file);
55005498 kfree(calldata);
55015499 }
55025500
@@ -5509,7 +5507,7 @@ static void nfs4_locku_done(struct rpc_task *task, void *data) · 6 unmodified lines
55095507 switch (task->tk_status) {
55105508 case 0:
55115509 renew_lease(calldata->server, calldata->timestamp);
5512− do_vfs_lock(calldata->fl.fl_file, &calldata->fl);
5510+ do_vfs_lock(calldata->lsp->ls_state->inode, &calldata->fl);
55135511 if (nfs4_update_lock_stateid(calldata->lsp,
55145512 &calldata->res.stateid))
55155513 break;
@@ -5617,7 +5615,7 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock * · 101 unmodified lines
56175615 mutex_lock(&sp->so_delegreturn_mutex);
56185616 /* Exclude nfs4_reclaim_open_stateid() - note nesting! */
56195617 down_read(&nfsi->rwsem);
5620− if (do_vfs_lock(request->fl_file, request) == -ENOENT) {
5618+ if (do_vfs_lock(inode, request) == -ENOENT) {
56215619 up_read(&nfsi->rwsem);
56225620 mutex_unlock(&sp->so_delegreturn_mutex);
56235621 goto out;
@@ -5758,7 +5756,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata) · 134 unmodified lines
57585756 data->timestamp);
57595757 if (data->arg.new_lock) {
57605758 data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
5761− if (do_vfs_lock(data->fl.fl_file, &data->fl) < 0) {
5759+ if (do_vfs_lock(lsp->ls_state->inode, &data->fl) < 0) {
57625760 rpc_restart_call_prepare(task);
57635761 break;
57645762 }
@@ -6000,7 +5998,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock · 235 unmodified lines
60005998 if (status != 0)
60015999 goto out;
60026000 request->fl_flags |= FL_ACCESS;
6003− status = do_vfs_lock(request->fl_file, request);
6001+ status = do_vfs_lock(state->inode, request);
60046002 if (status < 0)
60056003 goto out;
60066004 down_read(&nfsi->rwsem);
@@ -6008,7 +6006,7 @@ static int _nfs4_proc_setlk(struct nfs4_state *state, int cmd, struct file_lock · 1 unmodified line
60086006 /* Yes: cache locks! */
60096007 /* ...but avoid races with delegation recall... */
60106008 request->fl_flags = fl_flags & ~FL_SLEEP;
6011− status = do_vfs_lock(request->fl_file, request);
6009+ status = do_vfs_lock(state->inode, request);
60126010 up_read(&nfsi->rwsem);
60136011 goto out;
60146012 }
fs/proc/Kconfig+6−0
@@ -75,3 +75,9 @@ config PROC_PAGE_MONITOR · 74 unmodified lines
7575 config PROC_CHILDREN
7676 bool "Include /proc/<pid>/task/<tid>/children file"
7777 default n
78+ help
79+ Provides a fast way to retrieve first level children pids of a task. See
80+ <file:Documentation/filesystems/proc.txt> for more information.
81+
82+ Say Y if you are running any user-space software which takes benefit from
83+ this interface. For example, rkt is such a piece of software.
fs/proc/base.c+5−0
@@ -243,6 +243,11 @@ static ssize_t proc_pid_cmdline_read(struct file *file, char __user *buf, · 242 unmodified lines
243243 len1 = arg_end - arg_start;
244244 len2 = env_end - env_start;
245245
246+ /* Empty ARGV. */
247+ if (len1 == 0) {
248+ rv = 0;
249+ goto out_free_page;
250+ }
246251 /*
247252 * Inherently racy -- command line shares address space
248253 * with code and data.
fs/proc/kcore.c+2−2
@@ -92,7 +92,7 @@ static size_t get_kcore_size(int *nphdr, size_t *elf_buflen) · 91 unmodified lines
9292 roundup(sizeof(CORE_STR), 4)) +
9393 roundup(sizeof(struct elf_prstatus), 4) +
9494 roundup(sizeof(struct elf_prpsinfo), 4) +
95− roundup(sizeof(struct task_struct), 4);
95+ roundup(arch_task_struct_size, 4);
9696 *elf_buflen = PAGE_ALIGN(*elf_buflen);
9797 return size + *elf_buflen;
9898 }
@@ -415,7 +415,7 @@ static void elf_kcore_store_hdr(char *bufp, int nphdr, int dataoff) · 316 unmodified lines
415415 /* set up the task structure */
416416 notes[2].name = CORE_STR;
417417 notes[2].type = NT_TASKSTRUCT;
418− notes[2].datasz = sizeof(struct task_struct);
418+ notes[2].datasz = arch_task_struct_size;
419419 notes[2].data = current;
420420
421421 nhdr->p_filesz += notesize(&notes[2]);
fs/udf/inode.c+7−12
@@ -1652,17 +1652,9 @@ static int udf_update_inode(struct inode *inode, int do_sync) · 1651 unmodified lines
16521652 iinfo->i_ext.i_data, inode->i_sb->s_blocksize -
16531653 sizeof(struct unallocSpaceEntry));
16541654 use->descTag.tagIdent = cpu_to_le16(TAG_IDENT_USE);
1655− use->descTag.tagLocation =
1656− cpu_to_le32(iinfo->i_location.logicalBlockNum);
1657− crclen = sizeof(struct unallocSpaceEntry) +
1658− iinfo->i_lenAlloc - sizeof(struct tag);
1659− use->descTag.descCRCLength = cpu_to_le16(crclen);
1660− use->descTag.descCRC = cpu_to_le16(crc_itu_t(0, (char *)use +
1661− sizeof(struct tag),
1662− crclen));
1663− use->descTag.tagChecksum = udf_tag_checksum(&use->descTag);
1655+ crclen = sizeof(struct unallocSpaceEntry);
16641656
1665− goto out;
1657+ goto finish;
16661658 }
16671659
16681660 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_UID_FORGET))
@@ -1782,6 +1774,8 @@ static int udf_update_inode(struct inode *inode, int do_sync) · 113 unmodified lines
17821774 efe->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EFE);
17831775 crclen = sizeof(struct extendedFileEntry);
17841776 }
1777+
1778+finish:
17851779 if (iinfo->i_strat4096) {
17861780 fe->icbTag.strategyType = cpu_to_le16(4096);
17871781 fe->icbTag.strategyParameter = cpu_to_le16(1);
@@ -1791,7 +1785,9 @@ static int udf_update_inode(struct inode *inode, int do_sync) · 3 unmodified lines
17911785 fe->icbTag.numEntries = cpu_to_le16(1);
17921786 }
17931787
1794− if (S_ISDIR(inode->i_mode))
1788+ if (iinfo->i_use)
1789+ fe->icbTag.fileType = ICBTAG_FILE_TYPE_USE;
1790+ else if (S_ISDIR(inode->i_mode))
17951791 fe->icbTag.fileType = ICBTAG_FILE_TYPE_DIRECTORY;
17961792 else if (S_ISREG(inode->i_mode))
17971793 fe->icbTag.fileType = ICBTAG_FILE_TYPE_REGULAR;
@@ -1828,7 +1824,6 @@ static int udf_update_inode(struct inode *inode, int do_sync) · 30 unmodified lines
18281824 crclen));
18291825 fe->descTag.tagChecksum = udf_tag_checksum(&fe->descTag);
18301826
1831−out:
18321827 set_buffer_uptodate(bh);
18331828 unlock_buffer(bh);
18341829
include/asm-generic/mm-arch-hooks.h+16−0
@@ -0,0 +1,16 @@
1+/*
2+ * Architecture specific mm hooks
3+ */
4+
5+#ifndef _ASM_GENERIC_MM_ARCH_HOOKS_H
6+#define _ASM_GENERIC_MM_ARCH_HOOKS_H
7+
8+/*
9+ * This file should be included through arch/../include/asm/Kbuild for
10+ * the architecture which doesn't need specific mm hooks.
11+ *
12+ * In that case, the generic hooks defined in include/linux/mm-arch-hooks.h
13+ * are used.
14+ */
15+
16+#endif /* _ASM_GENERIC_MM_ARCH_HOOKS_H */
include/linux/amba/sp810.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * ARM PrimeXsys System Controller SP810 header file
33 *
44 * Copyright (C) 2009 ST Microelectronics
5− * Viresh Kumar <viresh.linux@gmail.com>
5+ * Viresh Kumar <vireshk@kernel.org>
66 *
77 * This file is licensed under the terms of the GNU General Public
88 * License version 2. This program is licensed "as is" without any
include/linux/blk-cgroup.h+3−8
@@ -47,6 +47,7 @@ struct blkcg { · 46 unmodified lines
4747
4848 struct blkcg_policy_data *pd[BLKCG_MAX_POLS];
4949
50+ struct list_head all_blkcgs_node;
5051 #ifdef CONFIG_CGROUP_WRITEBACK
5152 struct list_head cgwb_list;
5253 #endif
@@ -88,18 +89,12 @@ struct blkg_policy_data { · 35 unmodified lines
8889 * Policies that need to keep per-blkcg data which is independent
8990 * from any request_queue associated to it must specify its size
9091 * with the cpd_size field of the blkcg_policy structure and
91− * embed a blkcg_policy_data in it. blkcg core allocates
92− * policy-specific per-blkcg structures lazily the first time
93− * they are actually needed, so it handles them together with
94− * blkgs. cpd_init() is invoked to let each policy handle
95− * per-blkcg data.
92+ * embed a blkcg_policy_data in it. cpd_init() is invoked to let
93+ * each policy handle per-blkcg data.
9694 */
9795 struct blkcg_policy_data {
9896 /* the policy id this per-policy data belongs to */
9997 int plid;
100−
101− /* used during policy activation */
102− struct list_head alloc_node;
10398 };
10499
105100 /* association between a blk cgroup and a request queue */
include/linux/clkdev.h+4−3
@@ -33,18 +33,19 @@ struct clk_lookup { · 32 unmodified lines
3333 }
3434
3535 struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
36− const char *dev_fmt, ...);
36+ const char *dev_fmt, ...) __printf(3, 4);
3737
3838 void clkdev_add(struct clk_lookup *cl);
3939 void clkdev_drop(struct clk_lookup *cl);
4040
4141 struct clk_lookup *clkdev_create(struct clk *clk, const char *con_id,
42− const char *dev_fmt, ...);
42+ const char *dev_fmt, ...) __printf(3, 4);
4343
4444 void clkdev_add_table(struct clk_lookup *, size_t);
4545 int clk_add_alias(const char *, const char *, const char *, struct device *);
4646
47−int clk_register_clkdev(struct clk *, const char *, const char *, ...);
47+int clk_register_clkdev(struct clk *, const char *, const char *, ...)
48+ __printf(3, 4);
4849 int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t);
4950
5051 #ifdef CONFIG_COMMON_CLK
include/linux/compat.h+1−1
@@ -424,7 +424,7 @@ asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv, · 423 unmodified lines
424424
425425 asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
426426
427−extern int compat_printk(const char *fmt, ...);
427+extern __printf(1, 2) int compat_printk(const char *fmt, ...);
428428 extern void sigset_from_compat(sigset_t *set, const compat_sigset_t *compat);
429429 extern void sigset_to_compat(compat_sigset_t *compat, const sigset_t *set);
430430
include/linux/configfs.h+2−1
@@ -64,7 +64,8 @@ struct config_item { · 63 unmodified lines
6464 struct dentry *ci_dentry;
6565 };
6666
67−extern int config_item_set_name(struct config_item *, const char *, ...);
67+extern __printf(2, 3)
68+int config_item_set_name(struct config_item *, const char *, ...);
6869
6970 static inline char *config_item_name(struct config_item * item)
7071 {
include/linux/cpu.h+4−3
@@ -40,9 +40,10 @@ extern void cpu_remove_dev_attr(struct device_attribute *attr); · 39 unmodified lines
4040 extern int cpu_add_dev_attr_group(struct attribute_group *attrs);
4141 extern void cpu_remove_dev_attr_group(struct attribute_group *attrs);
4242
43−extern struct device *cpu_device_create(struct device *parent, void *drvdata,
44− const struct attribute_group **groups,
45− const char *fmt, ...);
43+extern __printf(4, 5)
44+struct device *cpu_device_create(struct device *parent, void *drvdata,
45+ const struct attribute_group **groups,
46+ const char *fmt, ...);
4647 #ifdef CONFIG_HOTPLUG_CPU
4748 extern void unregister_cpu(struct cpu *cpu);
4849 extern ssize_t arch_cpu_probe(const char *, size_t);
include/linux/dcache.h+2−1
@@ -327,7 +327,8 @@ static inline unsigned d_count(const struct dentry *dentry) · 326 unmodified lines
327327 /*
328328 * helper function for dentry_operations.d_dname() members
329329 */
330−extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
330+extern __printf(4, 5)
331+char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
331332 extern char *simple_dname(struct dentry *, char *, int);
332333
333334 extern char *__d_path(const struct path *, const struct path *, char *, int);
include/linux/device.h+7−8
@@ -637,8 +637,9 @@ extern int devres_release_group(struct device *dev, void *id); · 636 unmodified lines
637637
638638 /* managed devm_k.alloc/kfree for device drivers */
639639 extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp);
640−extern char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
641− va_list ap);
640+extern __printf(3, 0)
641+char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt,
642+ va_list ap);
642643 extern __printf(3, 4)
643644 char *devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...);
644645 static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp)
@@ -1011,12 +1012,10 @@ extern int __must_check device_reprobe(struct device *dev); · 366 unmodified lines
10111012 /*
10121013 * Easy functions for dynamically creating devices on the fly
10131014 */
1014−extern struct device *device_create_vargs(struct class *cls,
1015− struct device *parent,
1016− dev_t devt,
1017− void *drvdata,
1018− const char *fmt,
1019− va_list vargs);
1015+extern __printf(5, 0)
1016+struct device *device_create_vargs(struct class *cls, struct device *parent,
1017+ dev_t devt, void *drvdata,
1018+ const char *fmt, va_list vargs);
10201019 extern __printf(5, 6)
10211020 struct device *device_create(struct class *cls, struct device *parent,
10221021 dev_t devt, void *drvdata,
include/linux/fs.h+20−10
@@ -1046,12 +1046,12 @@ extern void locks_remove_file(struct file *); · 1045 unmodified lines
10461046 extern void locks_release_private(struct file_lock *);
10471047 extern void posix_test_lock(struct file *, struct file_lock *);
10481048 extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
1049−extern int posix_lock_file_wait(struct file *, struct file_lock *);
1049+extern int posix_lock_inode_wait(struct inode *, struct file_lock *);
10501050 extern int posix_unblock_lock(struct file_lock *);
10511051 extern int vfs_test_lock(struct file *, struct file_lock *);
10521052 extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
10531053 extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1054−extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
1054+extern int flock_lock_inode_wait(struct inode *inode, struct file_lock *fl);
10551055 extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
10561056 extern void lease_get_mtime(struct inode *, struct timespec *time);
10571057 extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
@@ -1137,7 +1137,8 @@ static inline int posix_lock_file(struct file *filp, struct file_lock *fl, · 79 unmodified lines
11371137 return -ENOLCK;
11381138 }
11391139
1140−static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
1140+static inline int posix_lock_inode_wait(struct inode *inode,
1141+ struct file_lock *fl)
11411142 {
11421143 return -ENOLCK;
11431144 }
@@ -1163,8 +1164,8 @@ static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl) · 19 unmodified lines
11631164 return 0;
11641165 }
11651166
1166−static inline int flock_lock_file_wait(struct file *filp,
1167− struct file_lock *request)
1167+static inline int flock_lock_inode_wait(struct inode *inode,
1168+ struct file_lock *request)
11681169 {
11691170 return -ENOLCK;
11701171 }
@@ -1202,6 +1203,20 @@ static inline void show_fd_locks(struct seq_file *f, · 31 unmodified lines
12021203 struct file *filp, struct files_struct *files) {}
12031204 #endif /* !CONFIG_FILE_LOCKING */
12041205
1206+static inline struct inode *file_inode(const struct file *f)
1207+{
1208+ return f->f_inode;
1209+}
1210+
1211+static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
1212+{
1213+ return posix_lock_inode_wait(file_inode(filp), fl);
1214+}
1215+
1216+static inline int flock_lock_file_wait(struct file *filp, struct file_lock *fl)
1217+{
1218+ return flock_lock_inode_wait(file_inode(filp), fl);
1219+}
12051220
12061221 struct fasync_struct {
12071222 spinlock_t fa_lock;
@@ -2011,11 +2026,6 @@ extern void ihold(struct inode * inode); · 803 unmodified lines
20112026 extern void iput(struct inode *);
20122027 extern int generic_update_time(struct inode *, struct timespec *, int);
20132028
2014−static inline struct inode *file_inode(const struct file *f)
2015−{
2016− return f->f_inode;
2017−}
2018−
20192029 /* /sys/fs */
20202030 extern struct kobject *fs_kobj;
20212031
include/linux/gpio/driver.h+1−1
@@ -45,7 +45,7 @@ struct seq_file; · 44 unmodified lines
4545 * @base: identifies the first GPIO number handled by this chip;
4646 * or, if negative during registration, requests dynamic ID allocation.
4747 * DEPRECATION: providing anything non-negative and nailing the base
48− * base offset of GPIO chips is deprecated. Please pass -1 as base to
48+ * offset of GPIO chips is deprecated. Please pass -1 as base to
4949 * let gpiolib select the chip base in all possible cases. We want to
5050 * get rid of the static GPIO number space in the long run.
5151 * @ngpio: the number of GPIOs handled by this controller; the last GPIO
include/linux/hid-sensor-hub.h+1−0
@@ -230,6 +230,7 @@ struct hid_sensor_common { · 229 unmodified lines
230230 struct platform_device *pdev;
231231 unsigned usage_id;
232232 atomic_t data_ready;
233+ atomic_t user_requested_state;
233234 struct iio_trigger *trigger;
234235 struct hid_sensor_hub_attribute_info poll;
235236 struct hid_sensor_hub_attribute_info report_state;
include/linux/hugetlb.h+8−9
@@ -460,15 +460,14 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h, · 459 unmodified lines
460460 return &mm->page_table_lock;
461461 }
462462
463−static inline bool hugepages_supported(void)
464−{
465− /*
466− * Some platform decide whether they support huge pages at boot
467− * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when
468− * there is no such support
469− */
470− return HPAGE_SHIFT != 0;
471−}
463+#ifndef hugepages_supported
464+/*
465+ * Some platform decide whether they support huge pages at boot
466+ * time. Some of them, such as powerpc, set HPAGE_SHIFT to 0
467+ * when there is no such support
468+ */
469+#define hugepages_supported() (HPAGE_SHIFT != 0)
470+#endif
472471
473472 #else /* CONFIG_HUGETLB_PAGE */
474473 struct hstate {};
include/linux/init.h+0−78
@@ -282,68 +282,8 @@ void __init parse_early_param(void); · 281 unmodified lines
282282 void __init parse_early_options(char *cmdline);
283283 #endif /* __ASSEMBLY__ */
284284
285−/**
286− * module_init() - driver initialization entry point
287− * @x: function to be run at kernel boot time or module insertion
288− *
289− * module_init() will either be called during do_initcalls() (if
290− * builtin) or at module insertion time (if a module). There can only
291− * be one per module.
292− */
293−#define module_init(x) __initcall(x);
294−
295−/**
296− * module_exit() - driver exit entry point
297− * @x: function to be run when driver is removed
298− *
299− * module_exit() will wrap the driver clean-up code
300− * with cleanup_module() when used with rmmod when
301− * the driver is a module. If the driver is statically
302− * compiled into the kernel, module_exit() has no effect.
303− * There can only be one per module.
304− */
305−#define module_exit(x) __exitcall(x);
306−
307285 #else /* MODULE */
308286
309−/*
310− * In most cases loadable modules do not need custom
311− * initcall levels. There are still some valid cases where
312− * a driver may be needed early if built in, and does not
313− * matter when built as a loadable module. Like bus
314− * snooping debug drivers.
315− */
316−#define early_initcall(fn) module_init(fn)
317−#define core_initcall(fn) module_init(fn)
318−#define core_initcall_sync(fn) module_init(fn)
319−#define postcore_initcall(fn) module_init(fn)
320−#define postcore_initcall_sync(fn) module_init(fn)
321−#define arch_initcall(fn) module_init(fn)
322−#define subsys_initcall(fn) module_init(fn)
323−#define subsys_initcall_sync(fn) module_init(fn)
324−#define fs_initcall(fn) module_init(fn)
325−#define fs_initcall_sync(fn) module_init(fn)
326−#define rootfs_initcall(fn) module_init(fn)
327−#define device_initcall(fn) module_init(fn)
328−#define device_initcall_sync(fn) module_init(fn)
329−#define late_initcall(fn) module_init(fn)
330−#define late_initcall_sync(fn) module_init(fn)
331−
332−#define console_initcall(fn) module_init(fn)
333−#define security_initcall(fn) module_init(fn)
334−
335−/* Each module must use one module_init(). */
336−#define module_init(initfn) \
337− static inline initcall_t __inittest(void) \
338− { return initfn; } \
339− int init_module(void) __attribute__((alias(#initfn)));
340−
341−/* This is only required if you want to be unloadable. */
342−#define module_exit(exitfn) \
343− static inline exitcall_t __exittest(void) \
344− { return exitfn; } \
345− void cleanup_module(void) __attribute__((alias(#exitfn)));
346−
347287 #define __setup_param(str, unique_id, fn) /* nothing */
348288 #define __setup(str, func) /* nothing */
349289 #endif
@@ -351,24 +291,6 @@ void __init parse_early_options(char *cmdline); · 1 unmodified line
351291 /* Data marked not to be saved by software suspend */
352292 #define __nosavedata __section(.data..nosave)
353293
354−/* This means "can be init if no module support, otherwise module load
355− may call it." */
356−#ifdef CONFIG_MODULES
357−#define __init_or_module
358−#define __initdata_or_module
359−#define __initconst_or_module
360−#define __INIT_OR_MODULE .text
361−#define __INITDATA_OR_MODULE .data
362−#define __INITRODATA_OR_MODULE .section ".rodata","a",%progbits
363−#else
364−#define __init_or_module __init
365−#define __initdata_or_module __initdata
366−#define __initconst_or_module __initconst
367−#define __INIT_OR_MODULE __INIT
368−#define __INITDATA_OR_MODULE __INITDATA
369−#define __INITRODATA_OR_MODULE __INITRODATA
370−#endif /*CONFIG_MODULES*/
371−
372294 #ifdef MODULE
373295 #define __exit_p(x) x
374296 #else
include/linux/iommu.h+1−1
@@ -258,7 +258,7 @@ extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, · 257 unmodified lines
258258 void *data);
259259 struct device *iommu_device_create(struct device *parent, void *drvdata,
260260 const struct attribute_group **groups,
261− const char *fmt, ...);
261+ const char *fmt, ...) __printf(4, 5);
262262 void iommu_device_destroy(struct device *dev);
263263 int iommu_device_link(struct device *dev, struct device *link);
264264 void iommu_device_unlink(struct device *dev, struct device *link);
include/linux/kernel.h+5−4
@@ -411,7 +411,8 @@ extern __printf(3, 0) · 410 unmodified lines
411411 int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
412412 extern __printf(2, 3)
413413 char *kasprintf(gfp_t gfp, const char *fmt, ...);
414−extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
414+extern __printf(2, 0)
415+char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
415416
416417 extern __scanf(2, 3)
417418 int sscanf(const char *, const char *, ...);
@@ -679,10 +680,10 @@ do { \ · 261 unmodified lines
679680 __ftrace_vprintk(_THIS_IP_, fmt, vargs); \
680681 } while (0)
681682
682−extern int
683+extern __printf(2, 0) int
683684 __ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
684685
685−extern int
686+extern __printf(2, 0) int
686687 __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
687688
688689 extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
@@ -702,7 +703,7 @@ int trace_printk(const char *fmt, ...) · 13 unmodified lines
702703 {
703704 return 0;
704705 }
705−static inline int
706+static __printf(1, 0) inline int
706707 ftrace_vprintk(const char *fmt, va_list ap)
707708 {
708709 return 0;
include/linux/kobject.h+3−2
@@ -80,8 +80,9 @@ struct kobject { · 79 unmodified lines
8080
8181 extern __printf(2, 3)
8282 int kobject_set_name(struct kobject *kobj, const char *name, ...);
83−extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
84− va_list vargs);
83+extern __printf(2, 0)
84+int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
85+ va_list vargs);
8586
8687 static inline const char *kobject_name(const struct kobject *kobj)
8788 {
include/linux/kvm_host.h+18−0
@@ -734,6 +734,24 @@ static inline bool kvm_arch_has_noncoherent_dma(struct kvm *kvm) · 733 unmodified lines
734734 return false;
735735 }
736736 #endif
737+#ifdef __KVM_HAVE_ARCH_ASSIGNED_DEVICE
738+void kvm_arch_start_assignment(struct kvm *kvm);
739+void kvm_arch_end_assignment(struct kvm *kvm);
740+bool kvm_arch_has_assigned_device(struct kvm *kvm);
741+#else
742+static inline void kvm_arch_start_assignment(struct kvm *kvm)
743+{
744+}
745+
746+static inline void kvm_arch_end_assignment(struct kvm *kvm)
747+{
748+}
749+
750+static inline bool kvm_arch_has_assigned_device(struct kvm *kvm)
751+{
752+ return false;
753+}
754+#endif
737755
738756 static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu)
739757 {
include/linux/mmiotrace.h+1−1
@@ -106,6 +106,6 @@ extern void enable_mmiotrace(void); · 105 unmodified lines
106106 extern void disable_mmiotrace(void);
107107 extern void mmio_trace_rw(struct mmiotrace_rw *rw);
108108 extern void mmio_trace_mapping(struct mmiotrace_map *map);
109−extern int mmio_trace_printk(const char *fmt, va_list args);
109+extern __printf(1, 0) int mmio_trace_printk(const char *fmt, va_list args);
110110
111111 #endif /* _LINUX_MMIOTRACE_H */
include/linux/module.h+84−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/compiler.h>
1212 #include <linux/cache.h>
1313 #include <linux/kmod.h>
14+#include <linux/init.h>
1415 #include <linux/elf.h>
1516 #include <linux/stringify.h>
1617 #include <linux/kobject.h>
@@ -71,6 +72,89 @@ extern struct module_attribute module_uevent; · 54 unmodified lines
7172 extern int init_module(void);
7273 extern void cleanup_module(void);
7374
75+#ifndef MODULE
76+/**
77+ * module_init() - driver initialization entry point
78+ * @x: function to be run at kernel boot time or module insertion
79+ *
80+ * module_init() will either be called during do_initcalls() (if
81+ * builtin) or at module insertion time (if a module). There can only
82+ * be one per module.
83+ */
84+#define module_init(x) __initcall(x);
85+
86+/**
87+ * module_exit() - driver exit entry point
88+ * @x: function to be run when driver is removed
89+ *
90+ * module_exit() will wrap the driver clean-up code
91+ * with cleanup_module() when used with rmmod when
92+ * the driver is a module. If the driver is statically
93+ * compiled into the kernel, module_exit() has no effect.
94+ * There can only be one per module.
95+ */
96+#define module_exit(x) __exitcall(x);
97+
98+#else /* MODULE */
99+
100+/*
101+ * In most cases loadable modules do not need custom
102+ * initcall levels. There are still some valid cases where
103+ * a driver may be needed early if built in, and does not
104+ * matter when built as a loadable module. Like bus
105+ * snooping debug drivers.
106+ */
107+#define early_initcall(fn) module_init(fn)
108+#define core_initcall(fn) module_init(fn)
109+#define core_initcall_sync(fn) module_init(fn)
110+#define postcore_initcall(fn) module_init(fn)
111+#define postcore_initcall_sync(fn) module_init(fn)
112+#define arch_initcall(fn) module_init(fn)
113+#define subsys_initcall(fn) module_init(fn)
114+#define subsys_initcall_sync(fn) module_init(fn)
115+#define fs_initcall(fn) module_init(fn)
116+#define fs_initcall_sync(fn) module_init(fn)
117+#define rootfs_initcall(fn) module_init(fn)
118+#define device_initcall(fn) module_init(fn)
119+#define device_initcall_sync(fn) module_init(fn)
120+#define late_initcall(fn) module_init(fn)
121+#define late_initcall_sync(fn) module_init(fn)
122+
123+#define console_initcall(fn) module_init(fn)
124+#define security_initcall(fn) module_init(fn)
125+
126+/* Each module must use one module_init(). */
127+#define module_init(initfn) \
128+ static inline initcall_t __inittest(void) \
129+ { return initfn; } \
130+ int init_module(void) __attribute__((alias(#initfn)));
131+
132+/* This is only required if you want to be unloadable. */
133+#define module_exit(exitfn) \
134+ static inline exitcall_t __exittest(void) \
135+ { return exitfn; } \
136+ void cleanup_module(void) __attribute__((alias(#exitfn)));
137+
138+#endif
139+
140+/* This means "can be init if no module support, otherwise module load
141+ may call it." */
142+#ifdef CONFIG_MODULES
143+#define __init_or_module
144+#define __initdata_or_module
145+#define __initconst_or_module
146+#define __INIT_OR_MODULE .text
147+#define __INITDATA_OR_MODULE .data
148+#define __INITRODATA_OR_MODULE .section ".rodata","a",%progbits
149+#else
150+#define __init_or_module __init
151+#define __initdata_or_module __initdata
152+#define __initconst_or_module __initconst
153+#define __INIT_OR_MODULE __INIT
154+#define __INITDATA_OR_MODULE __INITDATA
155+#define __INITRODATA_OR_MODULE __INITRODATA
156+#endif /*CONFIG_MODULES*/
157+
74158 /* Archs provide a method of finding the correct exception table. */
75159 struct exception_table_entry;
76160
include/linux/page_owner.h+13−0
@@ -8,6 +8,7 @@ extern struct page_ext_operations page_owner_ops; · 7 unmodified lines
88 extern void __reset_page_owner(struct page *page, unsigned int order);
99 extern void __set_page_owner(struct page *page,
1010 unsigned int order, gfp_t gfp_mask);
11+extern gfp_t __get_page_owner_gfp(struct page *page);
1112
1213 static inline void reset_page_owner(struct page *page, unsigned int order)
1314 {
@@ -25,6 +26,14 @@ static inline void set_page_owner(struct page *page, · 11 unmodified lines
2526
2627 __set_page_owner(page, order, gfp_mask);
2728 }
29+
30+static inline gfp_t get_page_owner_gfp(struct page *page)
31+{
32+ if (likely(!page_owner_inited))
33+ return 0;
34+
35+ return __get_page_owner_gfp(page);
36+}
2837 #else
2938 static inline void reset_page_owner(struct page *page, unsigned int order)
3039 {
@@ -33,6 +42,10 @@ static inline void set_page_owner(struct page *page, · 2 unmodified lines
3342 unsigned int order, gfp_t gfp_mask)
3443 {
3544 }
45+static inline gfp_t get_page_owner_gfp(struct page *page)
46+{
47+ return 0;
48+}
3649
3750 #endif /* CONFIG_PAGE_OWNER */
3851 #endif /* __LINUX_PAGE_OWNER_H */
include/linux/pata_arasan_cf_data.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Arasan Compact Flash host controller platform data header file
55 *
66 * Copyright (C) 2011 ST Microelectronics
7− * Viresh Kumar <viresh.linux@gmail.com>
7+ * Viresh Kumar <vireshk@kernel.org>
88 *
99 * This file is licensed under the terms of the GNU General Public
1010 * License version 2. This program is licensed "as is" without any
include/linux/printk.h+3−3
@@ -122,7 +122,7 @@ static inline __printf(1, 2) __cold · 121 unmodified lines
122122 void early_printk(const char *s, ...) { }
123123 #endif
124124
125−typedef int(*printk_func_t)(const char *fmt, va_list args);
125+typedef __printf(1, 0) int (*printk_func_t)(const char *fmt, va_list args);
126126
127127 #ifdef CONFIG_PRINTK
128128 asmlinkage __printf(5, 0)
@@ -166,7 +166,7 @@ char *log_buf_addr_get(void); · 37 unmodified lines
166166 u32 log_buf_len_get(void);
167167 void log_buf_kexec_setup(void);
168168 void __init setup_log_buf(int early);
169−void dump_stack_set_arch_desc(const char *fmt, ...);
169+__printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...);
170170 void dump_stack_print_info(const char *log_lvl);
171171 void show_regs_print_info(const char *log_lvl);
172172 #else
@@ -217,7 +217,7 @@ static inline void setup_log_buf(int early) · 44 unmodified lines
217217 {
218218 }
219219
220−static inline void dump_stack_set_arch_desc(const char *fmt, ...)
220+static inline __printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...)
221221 {
222222 }
223223
include/linux/sched.h+14−2
@@ -1522,8 +1522,6 @@ struct task_struct { · 1521 unmodified lines
15221522 /* hung task detection */
15231523 unsigned long last_switch_count;
15241524 #endif
1525−/* CPU-specific state of this task */
1526− struct thread_struct thread;
15271525 /* filesystem information */
15281526 struct fs_struct *fs;
15291527 /* open file information */
@@ -1778,8 +1776,22 @@ struct task_struct { · 248 unmodified lines
17781776 unsigned long task_state_change;
17791777 #endif
17801778 int pagefault_disabled;
1779+/* CPU-specific state of this task */
1780+ struct thread_struct thread;
1781+/*
1782+ * WARNING: on x86, 'thread_struct' contains a variable-sized
1783+ * structure. It *MUST* be at the end of 'task_struct'.
1784+ *
1785+ * Do not put anything below here!
1786+ */
17811787 };
17821788
1789+#ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
1790+extern int arch_task_struct_size __read_mostly;
1791+#else
1792+# define arch_task_struct_size (sizeof(struct task_struct))
1793+#endif
1794+
17831795 /* Future-safe accessor for struct task_struct's cpus_allowed. */
17841796 #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
17851797
include/net/cfg80211.h+17−0
@@ -4868,6 +4868,23 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, · 4867 unmodified lines
48684868 struct cfg80211_chan_def *chandef,
48694869 enum nl80211_iftype iftype);
48704870
4871+/**
4872+ * cfg80211_reg_can_beacon_relax - check if beaconing is allowed with relaxation
4873+ * @wiphy: the wiphy
4874+ * @chandef: the channel definition
4875+ * @iftype: interface type
4876+ *
4877+ * Return: %true if there is no secondary channel or the secondary channel(s)
4878+ * can be used for beaconing (i.e. is not a radar channel etc.). This version
4879+ * also checks if IR-relaxation conditions apply, to allow beaconing under
4880+ * more permissive conditions.
4881+ *
4882+ * Requires the RTNL to be held.
4883+ */
4884+bool cfg80211_reg_can_beacon_relax(struct wiphy *wiphy,
4885+ struct cfg80211_chan_def *chandef,
4886+ enum nl80211_iftype iftype);
4887+
48714888 /*
48724889 * cfg80211_ch_switch_notify - update wdev channel and notify userspace
48734890 * @dev: the device which switched channels
include/net/ip.h+1−0
@@ -161,6 +161,7 @@ static inline __u8 get_rtconn_flags(struct ipcm_cookie* ipc, struct sock* sk) · 160 unmodified lines
161161 }
162162
163163 /* datagram.c */
164+int __ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
164165 int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
165166
166167 void ip4_datagram_release_cb(struct sock *sk);
include/rdma/ib_verbs.h+17−3
@@ -1745,6 +1745,7 @@ struct ib_device { · 1744 unmodified lines
17451745 char node_desc[64];
17461746 __be64 node_guid;
17471747 u32 local_dma_lkey;
1748+ u16 is_switch:1;
17481749 u8 node_type;
17491750 u8 phys_port_cnt;
17501751
@@ -1823,6 +1824,20 @@ int ib_query_port(struct ib_device *device, · 72 unmodified lines
18231824 enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device,
18241825 u8 port_num);
18251826
1827+/**
1828+ * rdma_cap_ib_switch - Check if the device is IB switch
1829+ * @device: Device to check
1830+ *
1831+ * Device driver is responsible for setting is_switch bit on
1832+ * in ib_device structure at init time.
1833+ *
1834+ * Return: true if the device is IB switch.
1835+ */
1836+static inline bool rdma_cap_ib_switch(const struct ib_device *device)
1837+{
1838+ return device->is_switch;
1839+}
1840+
18261841 /**
18271842 * rdma_start_port - Return the first valid port number for the device
18281843 * specified
@@ -1833,7 +1848,7 @@ enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, · 4 unmodified lines
18331848 */
18341849 static inline u8 rdma_start_port(const struct ib_device *device)
18351850 {
1836− return (device->node_type == RDMA_NODE_IB_SWITCH) ? 0 : 1;
1851+ return rdma_cap_ib_switch(device) ? 0 : 1;
18371852 }
18381853
18391854 /**
@@ -1846,8 +1861,7 @@ static inline u8 rdma_start_port(const struct ib_device *device) · 6 unmodified lines
18461861 */
18471862 static inline u8 rdma_end_port(const struct ib_device *device)
18481863 {
1849− return (device->node_type == RDMA_NODE_IB_SWITCH) ?
1850− 0 : device->phys_port_cnt;
1864+ return rdma_cap_ib_switch(device) ? 0 : device->phys_port_cnt;
18511865 }
18521866
18531867 static inline bool rdma_protocol_ib(const struct ib_device *device, u8 port_num)
include/scsi/scsi_transport_srp.h+1−0
@@ -119,6 +119,7 @@ extern struct srp_rport *srp_rport_add(struct Scsi_Host *, · 118 unmodified lines
119119 extern void srp_rport_del(struct srp_rport *);
120120 extern int srp_tmo_valid(int reconnect_delay, int fast_io_fail_tmo,
121121 int dev_loss_tmo);
122+int srp_parse_tmo(int *tmo, const char *buf);
122123 extern int srp_reconnect_rport(struct srp_rport *rport);
123124 extern void srp_start_tl_fail_timers(struct srp_rport *rport);
124125 extern void srp_remove_host(struct Scsi_Host *);
kernel/cpu.c+0−9
@@ -527,18 +527,9 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen) · 526 unmodified lines
527527 goto out_notify;
528528 }
529529
530− /*
531− * Some architectures have to walk the irq descriptors to
532− * setup the vector space for the cpu which comes online.
533− * Prevent irq alloc/free across the bringup.
534− */
535− irq_lock_sparse();
536−
537530 /* Arch-specific enabling code. */
538531 ret = __cpu_up(cpu, idle);
539532
540− irq_unlock_sparse();
541−
542533 if (ret != 0)
543534 goto out_notify;
544535 BUG_ON(!cpu_online(cpu));
kernel/fork.c+6−1
@@ -287,6 +287,11 @@ static void set_max_threads(unsigned int max_threads_suggested) · 286 unmodified lines
287287 max_threads = clamp_t(u64, threads, MIN_THREADS, MAX_THREADS);
288288 }
289289
290+#ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
291+/* Initialized by the architecture: */
292+int arch_task_struct_size __read_mostly;
293+#endif
294+
290295 void __init fork_init(void)
291296 {
292297 #ifndef CONFIG_ARCH_TASK_STRUCT_ALLOCATOR
@@ -295,7 +300,7 @@ void __init fork_init(void) · 2 unmodified lines
295300 #endif
296301 /* create a slab on which task_structs can be allocated */
297302 task_struct_cachep =
298− kmem_cache_create("task_struct", sizeof(struct task_struct),
303+ kmem_cache_create("task_struct", arch_task_struct_size,
299304 ARCH_MIN_TASKALIGN, SLAB_PANIC | SLAB_NOTRACK, NULL);
300305 #endif
301306
kernel/irq/resend.c+13−5
@@ -75,13 +75,21 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq) · 74 unmodified lines
7575 !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) {
7676 #ifdef CONFIG_HARDIRQS_SW_RESEND
7777 /*
78− * If the interrupt has a parent irq and runs
79− * in the thread context of the parent irq,
80− * retrigger the parent.
78+ * If the interrupt is running in the thread
79+ * context of the parent irq we need to be
80+ * careful, because we cannot trigger it
81+ * directly.
8182 */
82− if (desc->parent_irq &&
83− irq_settings_is_nested_thread(desc))
83+ if (irq_settings_is_nested_thread(desc)) {
84+ /*
85+ * If the parent_irq is valid, we
86+ * retrigger the parent, otherwise we
87+ * do nothing.
88+ */
89+ if (!desc->parent_irq)
90+ return;
8491 irq = desc->parent_irq;
92+ }
8593 /* Set it pending and activate the softirq: */
8694 set_bit(irq, irqs_resend);
8795 tasklet_schedule(&resend_tasklet);
kernel/sched/fair.c+1−1
@@ -3683,7 +3683,7 @@ static void throttle_cfs_rq(struct cfs_rq *cfs_rq) · 3682 unmodified lines
36833683 cfs_rq->throttled = 1;
36843684 cfs_rq->throttled_clock = rq_clock(rq);
36853685 raw_spin_lock(&cfs_b->lock);
3686− empty = list_empty(&cfs_rq->throttled_list);
3686+ empty = list_empty(&cfs_b->throttled_cfs_rq);
36873687
36883688 /*
36893689 * Add to the _head_ of the list, so that an already-started
kernel/time/tick-broadcast.c+0−1
@@ -839,7 +839,6 @@ out: · 838 unmodified lines
839839 raw_spin_unlock(&tick_broadcast_lock);
840840 return ret;
841841 }
842−EXPORT_SYMBOL_GPL(tick_broadcast_oneshot_control);
843842
844843 /*
845844 * Reset the one shot broadcast for a cpu
kernel/time/tick-common.c+1−0
@@ -363,6 +363,7 @@ int tick_broadcast_oneshot_control(enum tick_broadcast_state state) · 362 unmodified lines
363363
364364 return __tick_broadcast_oneshot_control(state);
365365 }
366+EXPORT_SYMBOL_GPL(tick_broadcast_oneshot_control);
366367
367368 #ifdef CONFIG_HOTPLUG_CPU
368369 /*
kernel/trace/trace.h+1−0
@@ -444,6 +444,7 @@ enum { · 443 unmodified lines
444444
445445 TRACE_CONTROL_BIT,
446446
447+ TRACE_BRANCH_BIT,
447448 /*
448449 * Abuse of the trace_recursion.
449450 * As we need a way to maintain state if we are tracing the function
kernel/trace/trace_branch.c+10−7
@@ -36,9 +36,12 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) · 35 unmodified lines
3636 struct trace_branch *entry;
3737 struct ring_buffer *buffer;
3838 unsigned long flags;
39− int cpu, pc;
39+ int pc;
4040 const char *p;
4141
42+ if (current->trace_recursion & TRACE_BRANCH_BIT)
43+ return;
44+
4245 /*
4346 * I would love to save just the ftrace_likely_data pointer, but
4447 * this code can also be used by modules. Ugly things can happen
@@ -49,10 +52,10 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) · 4 unmodified lines
4952 if (unlikely(!tr))
5053 return;
5154
52− local_irq_save(flags);
53− cpu = raw_smp_processor_id();
54− data = per_cpu_ptr(tr->trace_buffer.data, cpu);
55− if (atomic_inc_return(&data->disabled) != 1)
55+ raw_local_irq_save(flags);
56+ current->trace_recursion |= TRACE_BRANCH_BIT;
57+ data = this_cpu_ptr(tr->trace_buffer.data);
58+ if (atomic_read(&data->disabled))
5659 goto out;
5760
5861 pc = preempt_count();
@@ -81,8 +84,8 @@ probe_likely_condition(struct ftrace_branch_data *f, int val, int expect) · 22 unmodified lines
8184 __buffer_unlock_commit(buffer, event);
8285
8386 out:
84− atomic_dec(&data->disabled);
85− local_irq_restore(flags);
87+ current->trace_recursion &= ~TRACE_BRANCH_BIT;
88+ raw_local_irq_restore(flags);
8689 }
8790
8891 static inline
lib/decompress.c+4−1
@@ -59,8 +59,11 @@ decompress_fn __init decompress_method(const unsigned char *inbuf, long len, · 58 unmodified lines
5959 {
6060 const struct compress_format *cf;
6161
62− if (len < 2)
62+ if (len < 2) {
63+ if (name)
64+ *name = NULL;
6365 return NULL; /* Need at least this much... */
66+ }
6467
6568 pr_debug("Compressed data magic: %#.2x %#.2x\n", inbuf[0], inbuf[1]);
6669
lib/dma-debug.c+3−0
@@ -574,6 +574,9 @@ void debug_dma_assert_idle(struct page *page) · 573 unmodified lines
574574 unsigned long flags;
575575 phys_addr_t cln;
576576
577+ if (dma_debug_disabled())
578+ return;
579+
577580 if (!page)
578581 return;
579582
lib/hexdump.c+4−3
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/ctype.h>
1212 #include <linux/kernel.h>
1313 #include <linux/export.h>
14+#include <asm/unaligned.h>
1415
1516 const char hex_asc[] = "0123456789abcdef";
1617 EXPORT_SYMBOL(hex_asc);
@@ -139,7 +140,7 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, · 122 unmodified lines
139140 for (j = 0; j < ngroups; j++) {
140141 ret = snprintf(linebuf + lx, linebuflen - lx,
141142 "%s%16.16llx", j ? " " : "",
142− (unsigned long long)*(ptr8 + j));
143+ get_unaligned(ptr8 + j));
143144 if (ret >= linebuflen - lx)
144145 goto overflow1;
145146 lx += ret;
@@ -150,7 +151,7 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, · 4 unmodified lines
150151 for (j = 0; j < ngroups; j++) {
151152 ret = snprintf(linebuf + lx, linebuflen - lx,
152153 "%s%8.8x", j ? " " : "",
153− *(ptr4 + j));
154+ get_unaligned(ptr4 + j));
154155 if (ret >= linebuflen - lx)
155156 goto overflow1;
156157 lx += ret;
@@ -161,7 +162,7 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, · 4 unmodified lines
161162 for (j = 0; j < ngroups; j++) {
162163 ret = snprintf(linebuf + lx, linebuflen - lx,
163164 "%s%4.4x", j ? " " : "",
164− *(ptr2 + j));
165+ get_unaligned(ptr2 + j));
165166 if (ret >= linebuflen - lx)
166167 goto overflow1;
167168 lx += ret;
lib/kobject.c+3−2
@@ -337,8 +337,9 @@ error: · 336 unmodified lines
337337 }
338338 EXPORT_SYMBOL(kobject_init);
339339
340−static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
341− const char *fmt, va_list vargs)
340+static __printf(3, 0) int kobject_add_varg(struct kobject *kobj,
341+ struct kobject *parent,
342+ const char *fmt, va_list vargs)
342343 {
343344 int retval;
344345
mm/cma_debug.c+6−5
@@ -39,7 +39,7 @@ static int cma_used_get(void *data, u64 *val) · 38 unmodified lines
3939
4040 mutex_lock(&cma->lock);
4141 /* pages counter is smaller than sizeof(int) */
42− used = bitmap_weight(cma->bitmap, (int)cma->count);
42+ used = bitmap_weight(cma->bitmap, (int)cma_bitmap_maxno(cma));
4343 mutex_unlock(&cma->lock);
4444 *val = (u64)used << cma->order_per_bit;
4545
@@ -52,13 +52,14 @@ static int cma_maxchunk_get(void *data, u64 *val) · 6 unmodified lines
5252 struct cma *cma = data;
5353 unsigned long maxchunk = 0;
5454 unsigned long start, end = 0;
55+ unsigned long bitmap_maxno = cma_bitmap_maxno(cma);
5556
5657 mutex_lock(&cma->lock);
5758 for (;;) {
58− start = find_next_zero_bit(cma->bitmap, cma->count, end);
59+ start = find_next_zero_bit(cma->bitmap, bitmap_maxno, end);
5960 if (start >= cma->count)
6061 break;
61− end = find_next_bit(cma->bitmap, cma->count, start);
62+ end = find_next_bit(cma->bitmap, bitmap_maxno, start);
6263 maxchunk = max(end - start, maxchunk);
6364 }
6465 mutex_unlock(&cma->lock);
@@ -170,10 +171,10 @@ static void cma_debugfs_add_one(struct cma *cma, int idx) · 105 unmodified lines
170171
171172 tmp = debugfs_create_dir(name, cma_debugfs_root);
172173
173− debugfs_create_file("alloc", S_IWUSR, cma_debugfs_root, cma,
174+ debugfs_create_file("alloc", S_IWUSR, tmp, cma,
174175 &cma_alloc_fops);
175176
176− debugfs_create_file("free", S_IWUSR, cma_debugfs_root, cma,
177+ debugfs_create_file("free", S_IWUSR, tmp, cma,
177178 &cma_free_fops);
178179
179180 debugfs_create_file("base_pfn", S_IRUGO, tmp,
mm/page_alloc.c+8−6
@@ -246,9 +246,7 @@ static inline void reset_deferred_meminit(pg_data_t *pgdat) · 245 unmodified lines
246246 /* Returns true if the struct page for the pfn is uninitialised */
247247 static inline bool __meminit early_page_uninitialised(unsigned long pfn)
248248 {
249− int nid = early_pfn_to_nid(pfn);
250−
251− if (pfn >= NODE_DATA(nid)->first_deferred_pfn)
249+ if (pfn >= NODE_DATA(early_pfn_to_nid(pfn))->first_deferred_pfn)
252250 return true;
253251
254252 return false;
@@ -1950,6 +1948,7 @@ void free_hot_cold_page_list(struct list_head *list, bool cold) · 1695 unmodified lines
19501948 void split_page(struct page *page, unsigned int order)
19511949 {
19521950 int i;
1951+ gfp_t gfp_mask;
19531952
19541953 VM_BUG_ON_PAGE(PageCompound(page), page);
19551954 VM_BUG_ON_PAGE(!page_count(page), page);
@@ -1963,10 +1962,11 @@ void split_page(struct page *page, unsigned int order) · 7 unmodified lines
19631962 split_page(virt_to_page(page[0].shadow), order);
19641963 #endif
19651964
1966− set_page_owner(page, 0, 0);
1965+ gfp_mask = get_page_owner_gfp(page);
1966+ set_page_owner(page, 0, gfp_mask);
19671967 for (i = 1; i < (1 << order); i++) {
19681968 set_page_refcounted(page + i);
1969− set_page_owner(page + i, 0, 0);
1969+ set_page_owner(page + i, 0, gfp_mask);
19701970 }
19711971 }
19721972 EXPORT_SYMBOL_GPL(split_page);
@@ -1996,6 +1996,8 @@ int __isolate_free_page(struct page *page, unsigned int order) · 23 unmodified lines
19961996 zone->free_area[order].nr_free--;
19971997 rmv_page_order(page);
19981998
1999+ set_page_owner(page, order, __GFP_MOVABLE);
2000+
19992001 /* Set the pageblock if the isolated page is at least a pageblock */
20002002 if (order >= pageblock_order - 1) {
20012003 struct page *endpage = page + (1 << order) - 1;
@@ -2007,7 +2009,7 @@ int __isolate_free_page(struct page *page, unsigned int order) · 5 unmodified lines
20072009 }
20082010 }
20092011
2010− set_page_owner(page, order, 0);
2012+
20112013 return 1UL << order;
20122014 }
20132015
mm/page_owner.c+7−0
@@ -76,6 +76,13 @@ void __set_page_owner(struct page *page, unsigned int order, gfp_t gfp_mask) · 75 unmodified lines
7676 __set_bit(PAGE_EXT_OWNER, &page_ext->flags);
7777 }
7878
79+gfp_t __get_page_owner_gfp(struct page *page)
80+{
81+ struct page_ext *page_ext = lookup_page_ext(page);
82+
83+ return page_ext->gfp_mask;
84+}
85+
7986 static ssize_t
8087 print_page_owner(char __user *buf, size_t count, unsigned long pfn,
8188 struct page *page, struct page_ext *page_ext)
net/ax25/ax25_subr.c+1−0
@@ -264,6 +264,7 @@ void ax25_disconnect(ax25_cb *ax25, int reason) · 263 unmodified lines
264264 {
265265 ax25_clear_queues(ax25);
266266
267+ ax25_stop_heartbeat(ax25);
267268 ax25_stop_t1timer(ax25);
268269 ax25_stop_t2timer(ax25);
269270 ax25_stop_t3timer(ax25);
net/bridge/br_mdb.c+0−1
@@ -356,7 +356,6 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, · 355 unmodified lines
356356 if (state == MDB_TEMPORARY)
357357 mod_timer(&p->timer, now + br->multicast_membership_interval);
358358
359− br_mdb_notify(br->dev, port, group, RTM_NEWMDB, state);
360359 return 0;
361360 }
362361
net/bridge/br_multicast.c+30−7
@@ -39,6 +39,16 @@ static void br_multicast_start_querier(struct net_bridge *br, · 38 unmodified lines
3939 struct bridge_mcast_own_query *query);
4040 static void br_multicast_add_router(struct net_bridge *br,
4141 struct net_bridge_port *port);
42+static void br_ip4_multicast_leave_group(struct net_bridge *br,
43+ struct net_bridge_port *port,
44+ __be32 group,
45+ __u16 vid);
46+#if IS_ENABLED(CONFIG_IPV6)
47+static void br_ip6_multicast_leave_group(struct net_bridge *br,
48+ struct net_bridge_port *port,
49+ const struct in6_addr *group,
50+ __u16 vid);
51+#endif
4252 unsigned int br_mdb_rehash_seq;
4353
4454 static inline int br_ip_equal(const struct br_ip *a, const struct br_ip *b)
@@ -1022,9 +1032,15 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br, · 977 unmodified lines
10221032 continue;
10231033 }
10241034
1025− err = br_ip4_multicast_add_group(br, port, group, vid);
1026− if (err)
1027− break;
1035+ if ((type == IGMPV3_CHANGE_TO_INCLUDE ||
1036+ type == IGMPV3_MODE_IS_INCLUDE) &&
1037+ ntohs(grec->grec_nsrcs) == 0) {
1038+ br_ip4_multicast_leave_group(br, port, group, vid);
1039+ } else {
1040+ err = br_ip4_multicast_add_group(br, port, group, vid);
1041+ if (err)
1042+ break;
1043+ }
10281044 }
10291045
10301046 return err;
@@ -1083,10 +1099,17 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, · 52 unmodified lines
10831099 continue;
10841100 }
10851101
1086− err = br_ip6_multicast_add_group(br, port, &grec->grec_mca,
1087− vid);
1088− if (err)
1089− break;
1102+ if ((grec->grec_type == MLD2_CHANGE_TO_INCLUDE ||
1103+ grec->grec_type == MLD2_MODE_IS_INCLUDE) &&
1104+ ntohs(*nsrcs) == 0) {
1105+ br_ip6_multicast_leave_group(br, port, &grec->grec_mca,
1106+ vid);
1107+ } else {
1108+ err = br_ip6_multicast_add_group(br, port,
1109+ &grec->grec_mca, vid);
1110+ if (!err)
1111+ break;
1112+ }
10901113 }
10911114
10921115 return err;
net/caif/caif_socket.c+8−11
@@ -121,12 +121,13 @@ static void caif_flow_ctrl(struct sock *sk, int mode) · 120 unmodified lines
121121 * Copied from sock.c:sock_queue_rcv_skb(), but changed so packets are
122122 * not dropped, but CAIF is sending flow off instead.
123123 */
124−static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
124+static void caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
125125 {
126126 int err;
127127 unsigned long flags;
128128 struct sk_buff_head *list = &sk->sk_receive_queue;
129129 struct caifsock *cf_sk = container_of(sk, struct caifsock, sk);
130+ bool queued = false;
130131
131132 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
132133 (unsigned int)sk->sk_rcvbuf && rx_flow_is_on(cf_sk)) {
@@ -139,7 +140,8 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) · 6 unmodified lines
139140
140141 err = sk_filter(sk, skb);
141142 if (err)
142− return err;
143+ goto out;
144+
143145 if (!sk_rmem_schedule(sk, skb, skb->truesize) && rx_flow_is_on(cf_sk)) {
144146 set_rx_flow_off(cf_sk);
145147 net_dbg_ratelimited("sending flow OFF due to rmem_schedule\n");
@@ -147,21 +149,16 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) · 1 unmodified line
147149 }
148150 skb->dev = NULL;
149151 skb_set_owner_r(skb, sk);
150− /* Cache the SKB length before we tack it onto the receive
151− * queue. Once it is added it no longer belongs to us and
152− * may be freed by other threads of control pulling packets
153− * from the queue.
154− */
155152 spin_lock_irqsave(&list->lock, flags);
156− if (!sock_flag(sk, SOCK_DEAD))
153+ queued = !sock_flag(sk, SOCK_DEAD);
154+ if (queued)
157155 __skb_queue_tail(list, skb);
158156 spin_unlock_irqrestore(&list->lock, flags);
159−
160− if (!sock_flag(sk, SOCK_DEAD))
157+out:
158+ if (queued)
161159 sk->sk_data_ready(sk);
162160 else
163161 kfree_skb(skb);
164− return 0;
165162 }
166163
167164 /* Packet Receive Callback function called from CAIF Stack */
net/core/datagram.c+47−9
@@ -131,6 +131,35 @@ out_noerr: · 130 unmodified lines
131131 goto out;
132132 }
133133
134+static int skb_set_peeked(struct sk_buff *skb)
135+{
136+ struct sk_buff *nskb;
137+
138+ if (skb->peeked)
139+ return 0;
140+
141+ /* We have to unshare an skb before modifying it. */
142+ if (!skb_shared(skb))
143+ goto done;
144+
145+ nskb = skb_clone(skb, GFP_ATOMIC);
146+ if (!nskb)
147+ return -ENOMEM;
148+
149+ skb->prev->next = nskb;
150+ skb->next->prev = nskb;
151+ nskb->prev = skb->prev;
152+ nskb->next = skb->next;
153+
154+ consume_skb(skb);
155+ skb = nskb;
156+
157+done:
158+ skb->peeked = 1;
159+
160+ return 0;
161+}
162+
134163 /**
135164 * __skb_recv_datagram - Receive a datagram skbuff
136165 * @sk: socket
@@ -165,7 +194,9 @@ out_noerr: · 28 unmodified lines
165194 struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags,
166195 int *peeked, int *off, int *err)
167196 {
197+ struct sk_buff_head *queue = &sk->sk_receive_queue;
168198 struct sk_buff *skb, *last;
199+ unsigned long cpu_flags;
169200 long timeo;
170201 /*
171202 * Caller is allowed not to check sk->sk_err before skb_recv_datagram()
@@ -184,8 +215,6 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, · 12 unmodified lines
184215 * Look at current nfs client by the way...
185216 * However, this function was correct in any case. 8)
186217 */
187− unsigned long cpu_flags;
188− struct sk_buff_head *queue = &sk->sk_receive_queue;
189218 int _off = *off;
190219
191220 last = (struct sk_buff *)queue;
@@ -199,7 +228,11 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, · 7 unmodified lines
199228 _off -= skb->len;
200229 continue;
201230 }
202− skb->peeked = 1;
231+
232+ error = skb_set_peeked(skb);
233+ if (error)
234+ goto unlock_err;
235+
203236 atomic_inc(&skb->users);
204237 } else
205238 __skb_unlink(skb, queue);
@@ -223,6 +256,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned int flags, · 17 unmodified lines
223256
224257 return NULL;
225258
259+unlock_err:
260+ spin_unlock_irqrestore(&queue->lock, cpu_flags);
226261 no_packet:
227262 *err = error;
228263 return NULL;
@@ -622,7 +657,8 @@ __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len) · 393 unmodified lines
622657 !skb->csum_complete_sw)
623658 netdev_rx_csum_fault(skb->dev);
624659 }
625− skb->csum_valid = !sum;
660+ if (!skb_shared(skb))
661+ skb->csum_valid = !sum;
626662 return sum;
627663 }
628664 EXPORT_SYMBOL(__skb_checksum_complete_head);
@@ -642,11 +678,13 @@ __sum16 __skb_checksum_complete(struct sk_buff *skb) · 13 unmodified lines
642678 netdev_rx_csum_fault(skb->dev);
643679 }
644680
645− /* Save full packet checksum */
646− skb->csum = csum;
647− skb->ip_summed = CHECKSUM_COMPLETE;
648− skb->csum_complete_sw = 1;
649− skb->csum_valid = !sum;
681+ if (!skb_shared(skb)) {
682+ /* Save full packet checksum */
683+ skb->csum = csum;
684+ skb->ip_summed = CHECKSUM_COMPLETE;
685+ skb->csum_complete_sw = 1;
686+ skb->csum_valid = !sum;
687+ }
650688
651689 return sum;
652690 }
net/core/dst.c+3−1
@@ -299,7 +299,9 @@ void dst_release(struct dst_entry *dst) · 298 unmodified lines
299299 int newrefcnt;
300300
301301 newrefcnt = atomic_dec_return(&dst->__refcnt);
302− WARN_ON(newrefcnt < 0);
302+ if (unlikely(newrefcnt < 0))
303+ net_warn_ratelimited("%s: dst:%p refcnt:%d\n",
304+ __func__, dst, newrefcnt);
303305 if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt)
304306 call_rcu(&dst->rcu_head, dst_destroy_rcu);
305307 }
net/core/rtnetlink.c+7−4
@@ -1808,10 +1808,13 @@ static int do_setlink(const struct sk_buff *skb, · 1807 unmodified lines
18081808 goto errout;
18091809
18101810 nla_for_each_nested(attr, tb[IFLA_VF_PORTS], rem) {
1811− if (nla_type(attr) != IFLA_VF_PORT)
1812− continue;
1813− err = nla_parse_nested(port, IFLA_PORT_MAX,
1814− attr, ifla_port_policy);
1811+ if (nla_type(attr) != IFLA_VF_PORT ||
1812+ nla_len(attr) < NLA_HDRLEN) {
1813+ err = -EINVAL;
1814+ goto errout;
1815+ }
1816+ err = nla_parse_nested(port, IFLA_PORT_MAX, attr,
1817+ ifla_port_policy);
18151818 if (err < 0)
18161819 goto errout;
18171820 if (!port[IFLA_PORT_VF]) {
net/ipv4/datagram.c+12−4
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include <net/route.h>
2121 #include <net/tcp_states.h>
2222
23−int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
23+int __ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
2424 {
2525 struct inet_sock *inet = inet_sk(sk);
2626 struct sockaddr_in *usin = (struct sockaddr_in *) uaddr;
@@ -39,8 +39,6 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) · 12 unmodified lines
3939
4040 sk_dst_reset(sk);
4141
42− lock_sock(sk);
43−
4442 oif = sk->sk_bound_dev_if;
4543 saddr = inet->inet_saddr;
4644 if (ipv4_is_multicast(usin->sin_addr.s_addr)) {
@@ -82,9 +80,19 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) · 35 unmodified lines
8280 sk_dst_set(sk, &rt->dst);
8381 err = 0;
8482 out:
85− release_sock(sk);
8683 return err;
8784 }
85+EXPORT_SYMBOL(__ip4_datagram_connect);
86+
87+int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
88+{
89+ int res;
90+
91+ lock_sock(sk);
92+ res = __ip4_datagram_connect(sk, uaddr, addr_len);
93+ release_sock(sk);
94+ return res;
95+}
8896 EXPORT_SYMBOL(ip4_datagram_connect);
8997
9098 /* Because UDP xmit path can manipulate sk_dst_cache without holding
net/ipv4/inet_hashtables.c+5−6
@@ -610,22 +610,21 @@ EXPORT_SYMBOL_GPL(inet_hashinfo_init); · 609 unmodified lines
610610
611611 int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)
612612 {
613+ unsigned int locksz = sizeof(spinlock_t);
613614 unsigned int i, nblocks = 1;
614615
615− if (sizeof(spinlock_t) != 0) {
616+ if (locksz != 0) {
616617 /* allocate 2 cache lines or at least one spinlock per cpu */
617− nblocks = max_t(unsigned int,
618− 2 * L1_CACHE_BYTES / sizeof(spinlock_t),
619− 1);
618+ nblocks = max(2U * L1_CACHE_BYTES / locksz, 1U);
620619 nblocks = roundup_pow_of_two(nblocks * num_possible_cpus());
621620
622621 /* no more locks than number of hash buckets */
623622 nblocks = min(nblocks, hashinfo->ehash_mask + 1);
624623
625− hashinfo->ehash_locks = kmalloc_array(nblocks, sizeof(spinlock_t),
624+ hashinfo->ehash_locks = kmalloc_array(nblocks, locksz,
626625 GFP_KERNEL | __GFP_NOWARN);
627626 if (!hashinfo->ehash_locks)
628− hashinfo->ehash_locks = vmalloc(nblocks * sizeof(spinlock_t));
627+ hashinfo->ehash_locks = vmalloc(nblocks * locksz);
629628
630629 if (!hashinfo->ehash_locks)
631630 return -ENOMEM;
net/ipv4/ip_fragment.c+4−2
@@ -351,7 +351,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) · 350 unmodified lines
351351 ihl = ip_hdrlen(skb);
352352
353353 /* Determine the position of this fragment. */
354− end = offset + skb->len - ihl;
354+ end = offset + skb->len - skb_network_offset(skb) - ihl;
355355 err = -EINVAL;
356356
357357 /* Is this the final fragment? */
@@ -381,7 +381,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb) · 23 unmodified lines
381381 goto err;
382382
383383 err = -ENOMEM;
384− if (!pskb_pull(skb, ihl))
384+ if (!pskb_pull(skb, skb_network_offset(skb) + ihl))
385385 goto err;
386386
387387 err = pskb_trim_rcsum(skb, end - offset);
@@ -627,6 +627,8 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, · 239 unmodified lines
627627 iph->frag_off = 0;
628628 }
629629
630+ ip_send_check(iph);
631+
630632 IP_INC_STATS_BH(net, IPSTATS_MIB_REASMOKS);
631633 qp->q.fragments = NULL;
632634 qp->q.fragments_tail = NULL;
net/ipv4/tcp_input.c+1−2
@@ -1920,14 +1920,13 @@ void tcp_enter_loss(struct sock *sk) · 1919 unmodified lines
19201920 const struct inet_connection_sock *icsk = inet_csk(sk);
19211921 struct tcp_sock *tp = tcp_sk(sk);
19221922 struct sk_buff *skb;
1923− bool new_recovery = false;
1923+ bool new_recovery = icsk->icsk_ca_state < TCP_CA_Recovery;
19241924 bool is_reneg; /* is receiver reneging on SACKs? */
19251925
19261926 /* Reduce ssthresh if it has not yet been made inside this window. */
19271927 if (icsk->icsk_ca_state <= TCP_CA_Disorder ||
19281928 !after(tp->high_seq, tp->snd_una) ||
19291929 (icsk->icsk_ca_state == TCP_CA_Loss && !icsk->icsk_retransmits)) {
1930− new_recovery = true;
19311930 tp->prior_ssthresh = tcp_current_ssthresh(sk);
19321931 tp->snd_ssthresh = icsk->icsk_ca_ops->ssthresh(sk);
19331932 tcp_ca_event(sk, CA_EVENT_LOSS);
net/ipv6/datagram.c+15−5
@@ -40,7 +40,7 @@ static bool ipv6_mapped_addr_any(const struct in6_addr *a) · 39 unmodified lines
4040 return ipv6_addr_v4mapped(a) && (a->s6_addr32[3] == 0);
4141 }
4242
43−int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
43+static int __ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
4444 {
4545 struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr;
4646 struct inet_sock *inet = inet_sk(sk);
@@ -56,7 +56,7 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) · 9 unmodified lines
5656 if (usin->sin6_family == AF_INET) {
5757 if (__ipv6_only_sock(sk))
5858 return -EAFNOSUPPORT;
59− err = ip4_datagram_connect(sk, uaddr, addr_len);
59+ err = __ip4_datagram_connect(sk, uaddr, addr_len);
6060 goto ipv4_connected;
6161 }
6262
@@ -98,9 +98,9 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) · 35 unmodified lines
9898 sin.sin_addr.s_addr = daddr->s6_addr32[3];
9999 sin.sin_port = usin->sin6_port;
100100
101− err = ip4_datagram_connect(sk,
102− (struct sockaddr *) &sin,
103− sizeof(sin));
101+ err = __ip4_datagram_connect(sk,
102+ (struct sockaddr *) &sin,
103+ sizeof(sin));
104104
105105 ipv4_connected:
106106 if (err)
@@ -204,6 +204,16 @@ out: · 97 unmodified lines
204204 fl6_sock_release(flowlabel);
205205 return err;
206206 }
207+
208+int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
209+{
210+ int res;
211+
212+ lock_sock(sk);
213+ res = __ip6_datagram_connect(sk, uaddr, addr_len);
214+ release_sock(sk);
215+ return res;
216+}
207217 EXPORT_SYMBOL_GPL(ip6_datagram_connect);
208218
209219 int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *uaddr,
net/ipv6/ip6_offload.c+0−2
@@ -292,8 +292,6 @@ static struct packet_offload ipv6_packet_offload __read_mostly = { · 291 unmodified lines
292292 static const struct net_offload sit_offload = {
293293 .callbacks = {
294294 .gso_segment = ipv6_gso_segment,
295− .gro_receive = ipv6_gro_receive,
296− .gro_complete = ipv6_gro_complete,
297295 },
298296 };
299297
net/mac80211/debugfs_netdev.c+1−0
@@ -723,6 +723,7 @@ void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata) · 722 unmodified lines
723723
724724 debugfs_remove_recursive(sdata->vif.debugfs_dir);
725725 sdata->vif.debugfs_dir = NULL;
726+ sdata->debugfs.subdir_stations = NULL;
726727 }
727728
728729 void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
net/mac80211/iface.c+14−11
@@ -1863,10 +1863,6 @@ void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata) · 1862 unmodified lines
18631863 ieee80211_teardown_sdata(sdata);
18641864 }
18651865
1866−/*
1867− * Remove all interfaces, may only be called at hardware unregistration
1868− * time because it doesn't do RCU-safe list removals.
1869− */
18701866 void ieee80211_remove_interfaces(struct ieee80211_local *local)
18711867 {
18721868 struct ieee80211_sub_if_data *sdata, *tmp;
@@ -1875,14 +1871,21 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) · 2 unmodified lines
18751871
18761872 ASSERT_RTNL();
18771873
1878− /*
1879− * Close all AP_VLAN interfaces first, as otherwise they
1880− * might be closed while the AP interface they belong to
1881− * is closed, causing unregister_netdevice_many() to crash.
1874+ /* Before destroying the interfaces, make sure they're all stopped so
1875+ * that the hardware is stopped. Otherwise, the driver might still be
1876+ * iterating the interfaces during the shutdown, e.g. from a worker
1877+ * or from RX processing or similar, and if it does so (using atomic
1878+ * iteration) while we're manipulating the list, the iteration will
1879+ * crash.
1880+ *
1881+ * After this, the hardware should be stopped and the driver should
1882+ * have stopped all of its activities, so that we can do RCU-unaware
1883+ * manipulations of the interface list below.
18821884 */
1883− list_for_each_entry(sdata, &local->interfaces, list)
1884− if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
1885− dev_close(sdata->dev);
1885+ cfg80211_shutdown_all_interfaces(local->hw.wiphy);
1886+
1887+ WARN(local->open_count, "%s: open count remains %d\n",
1888+ wiphy_name(local->hw.wiphy), local->open_count);
18861889
18871890 mutex_lock(&local->iflist_mtx);
18881891 list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
net/mac80211/mesh_plink.c+4−1
@@ -306,7 +306,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, · 305 unmodified lines
306306 if (action == WLAN_SP_MESH_PEERING_CONFIRM) {
307307 /* AID */
308308 pos = skb_put(skb, 2);
309− put_unaligned_le16(plid, pos + 2);
309+ put_unaligned_le16(plid, pos);
310310 }
311311 if (ieee80211_add_srates_ie(sdata, skb, true, band) ||
312312 ieee80211_add_ext_srates_ie(sdata, skb, true, band) ||
@@ -1122,6 +1122,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, · 809 unmodified lines
11221122 WLAN_SP_MESH_PEERING_CONFIRM) {
11231123 baseaddr += 4;
11241124 baselen += 4;
1125+
1126+ if (baselen > len)
1127+ return;
11251128 }
11261129 ieee802_11_parse_elems(baseaddr, len - baselen, true, &elems);
11271130 mesh_process_plink_frame(sdata, mgmt, &elems);
net/mac80211/pm.c+16−0
@@ -76,6 +76,22 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) · 75 unmodified lines
7676 if (sdata->vif.type != NL80211_IFTYPE_STATION)
7777 continue;
7878 ieee80211_mgd_quiesce(sdata);
79+ /* If suspended during TX in progress, and wowlan
80+ * is enabled (connection will be active) there
81+ * can be a race where the driver is put out
82+ * of power-save due to TX and during suspend
83+ * dynamic_ps_timer is cancelled and TX packet
84+ * is flushed, leaving the driver in ACTIVE even
85+ * after resuming until dynamic_ps_timer puts
86+ * driver back in DOZE.
87+ */
88+ if (sdata->u.mgd.associated &&
89+ sdata->u.mgd.powersave &&
90+ !(local->hw.conf.flags & IEEE80211_CONF_PS)) {
91+ local->hw.conf.flags |= IEEE80211_CONF_PS;
92+ ieee80211_hw_config(local,
93+ IEEE80211_CONF_CHANGE_PS);
94+ }
7995 }
8096
8197 err = drv_suspend(local, wowlan);
net/mac80211/tdls.c+3−3
@@ -60,6 +60,7 @@ ieee80211_tdls_add_subband(struct ieee80211_sub_if_data *sdata, · 59 unmodified lines
6060 struct ieee80211_channel *ch;
6161 struct cfg80211_chan_def chandef;
6262 int i, subband_start;
63+ struct wiphy *wiphy = sdata->local->hw.wiphy;
6364
6465 for (i = start; i <= end; i += spacing) {
6566 if (!ch_cnt)
@@ -70,9 +71,8 @@ ieee80211_tdls_add_subband(struct ieee80211_sub_if_data *sdata, · 4 unmodified lines
7071 /* we will be active on the channel */
7172 cfg80211_chandef_create(&chandef, ch,
7273 NL80211_CHAN_NO_HT);
73− if (cfg80211_reg_can_beacon(sdata->local->hw.wiphy,
74− &chandef,
75− sdata->wdev.iftype)) {
74+ if (cfg80211_reg_can_beacon_relax(wiphy, &chandef,
75+ sdata->wdev.iftype)) {
7676 ch_cnt++;
7777 /*
7878 * check if the next channel is also part of
net/mac80211/tx.c+3−1
@@ -1117,7 +1117,9 @@ static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, · 1116 unmodified lines
11171117 queued = true;
11181118 info->control.vif = &tx->sdata->vif;
11191119 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
1120− info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
1120+ info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS |
1121+ IEEE80211_TX_CTL_NO_PS_BUFFER |
1122+ IEEE80211_TX_STATUS_EOSP;
11211123 __skb_queue_tail(&tid_tx->pending, skb);
11221124 if (skb_queue_len(&tid_tx->pending) > STA_MAX_TX_BUFFER)
11231125 purge_skb = __skb_dequeue(&tid_tx->pending);
net/netlink/af_netlink.c+47−32
@@ -357,25 +357,52 @@ err1: · 356 unmodified lines
357357 return NULL;
358358 }
359359
360+
361+static void
362+__netlink_set_ring(struct sock *sk, struct nl_mmap_req *req, bool tx_ring, void **pg_vec,
363+ unsigned int order)
364+{
365+ struct netlink_sock *nlk = nlk_sk(sk);
366+ struct sk_buff_head *queue;
367+ struct netlink_ring *ring;
368+
369+ queue = tx_ring ? &sk->sk_write_queue : &sk->sk_receive_queue;
370+ ring = tx_ring ? &nlk->tx_ring : &nlk->rx_ring;
371+
372+ spin_lock_bh(&queue->lock);
373+
374+ ring->frame_max = req->nm_frame_nr - 1;
375+ ring->head = 0;
376+ ring->frame_size = req->nm_frame_size;
377+ ring->pg_vec_pages = req->nm_block_size / PAGE_SIZE;
378+
379+ swap(ring->pg_vec_len, req->nm_block_nr);
380+ swap(ring->pg_vec_order, order);
381+ swap(ring->pg_vec, pg_vec);
382+
383+ __skb_queue_purge(queue);
384+ spin_unlock_bh(&queue->lock);
385+
386+ WARN_ON(atomic_read(&nlk->mapped));
387+
388+ if (pg_vec)
389+ free_pg_vec(pg_vec, order, req->nm_block_nr);
390+}
391+
360392 static int netlink_set_ring(struct sock *sk, struct nl_mmap_req *req,
361− bool closing, bool tx_ring)
393+ bool tx_ring)
362394 {
363395 struct netlink_sock *nlk = nlk_sk(sk);
364396 struct netlink_ring *ring;
365− struct sk_buff_head *queue;
366397 void **pg_vec = NULL;
367398 unsigned int order = 0;
368− int err;
369399
370400 ring = tx_ring ? &nlk->tx_ring : &nlk->rx_ring;
371− queue = tx_ring ? &sk->sk_write_queue : &sk->sk_receive_queue;
372401
373− if (!closing) {
374− if (atomic_read(&nlk->mapped))
375− return -EBUSY;
376− if (atomic_read(&ring->pending))
377− return -EBUSY;
378− }
402+ if (atomic_read(&nlk->mapped))
403+ return -EBUSY;
404+ if (atomic_read(&ring->pending))
405+ return -EBUSY;
379406
380407 if (req->nm_block_nr) {
381408 if (ring->pg_vec != NULL)
@@ -407,31 +434,19 @@ static int netlink_set_ring(struct sock *sk, struct nl_mmap_req *req, · 25 unmodified lines
407434 return -EINVAL;
408435 }
409436
410− err = -EBUSY;
411437 mutex_lock(&nlk->pg_vec_lock);
412− if (closing || atomic_read(&nlk->mapped) == 0) {
413− err = 0;
414− spin_lock_bh(&queue->lock);
415−
416− ring->frame_max = req->nm_frame_nr - 1;
417− ring->head = 0;
418− ring->frame_size = req->nm_frame_size;
419− ring->pg_vec_pages = req->nm_block_size / PAGE_SIZE;
420−
421− swap(ring->pg_vec_len, req->nm_block_nr);
422− swap(ring->pg_vec_order, order);
423− swap(ring->pg_vec, pg_vec);
424−
425− __skb_queue_purge(queue);
426− spin_unlock_bh(&queue->lock);
427−
428− WARN_ON(atomic_read(&nlk->mapped));
438+ if (atomic_read(&nlk->mapped) == 0) {
439+ __netlink_set_ring(sk, req, tx_ring, pg_vec, order);
440+ mutex_unlock(&nlk->pg_vec_lock);
441+ return 0;
429442 }
443+
430444 mutex_unlock(&nlk->pg_vec_lock);
431445
432446 if (pg_vec)
433447 free_pg_vec(pg_vec, order, req->nm_block_nr);
434− return err;
448+
449+ return -EBUSY;
435450 }
436451
437452 static void netlink_mm_open(struct vm_area_struct *vma)
@@ -900,10 +915,10 @@ static void netlink_sock_destruct(struct sock *sk) · 462 unmodified lines
900915
901916 memset(&req, 0, sizeof(req));
902917 if (nlk->rx_ring.pg_vec)
903− netlink_set_ring(sk, &req, true, false);
918+ __netlink_set_ring(sk, &req, false, NULL, 0);
904919 memset(&req, 0, sizeof(req));
905920 if (nlk->tx_ring.pg_vec)
906− netlink_set_ring(sk, &req, true, true);
921+ __netlink_set_ring(sk, &req, true, NULL, 0);
907922 }
908923 #endif /* CONFIG_NETLINK_MMAP */
909924
@@ -2223,7 +2238,7 @@ static int netlink_setsockopt(struct socket *sock, int level, int optname, · 1313 unmodified lines
22232238 return -EINVAL;
22242239 if (copy_from_user(&req, optval, sizeof(req)))
22252240 return -EFAULT;
2226− err = netlink_set_ring(sk, &req, false,
2241+ err = netlink_set_ring(sk, &req,
22272242 optname == NETLINK_TX_RING);
22282243 break;
22292244 }
net/openvswitch/flow_table.c+1−1
@@ -754,7 +754,7 @@ int ovs_flow_init(void) · 753 unmodified lines
754754 BUILD_BUG_ON(sizeof(struct sw_flow_key) % sizeof(long));
755755
756756 flow_cache = kmem_cache_create("sw_flow", sizeof(struct sw_flow)
757− + (num_possible_nodes()
757+ + (nr_node_ids
758758 * sizeof(struct flow_stats *)),
759759 0, 0, NULL);
760760 if (flow_cache == NULL)
net/rds/ib_rdma.c+3−1
@@ -759,8 +759,10 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents, · 758 unmodified lines
759759 }
760760
761761 ibmr = rds_ib_alloc_fmr(rds_ibdev);
762− if (IS_ERR(ibmr))
762+ if (IS_ERR(ibmr)) {
763+ rds_ib_dev_put(rds_ibdev);
763764 return ibmr;
765+ }
764766
765767 ret = rds_ib_map_fmr(rds_ibdev, ibmr, sg, nents);
766768 if (ret == 0)
net/sched/act_bpf.c+3−0
@@ -339,6 +339,9 @@ static void tcf_bpf_cleanup(struct tc_action *act, int bind) · 338 unmodified lines
339339 bpf_prog_put(prog->filter);
340340 else
341341 bpf_prog_destroy(prog->filter);
342+
343+ kfree(prog->bpf_ops);
344+ kfree(prog->bpf_name);
342345 }
343346
344347 static struct tc_action_ops act_bpf_ops __read_mostly = {
net/sched/cls_bpf.c+1−1
@@ -378,7 +378,7 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb, · 377 unmodified lines
378378 goto errout;
379379
380380 if (oldprog) {
381− list_replace_rcu(&prog->link, &oldprog->link);
381+ list_replace_rcu(&oldprog->link, &prog->link);
382382 tcf_unbind_filter(tp, &oldprog->res);
383383 call_rcu(&oldprog->rcu, __cls_bpf_delete_prog);
384384 } else {
net/sched/cls_flow.c+3−2
@@ -425,6 +425,8 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, · 424 unmodified lines
425425 if (!fnew)
426426 goto err2;
427427
428+ tcf_exts_init(&fnew->exts, TCA_FLOW_ACT, TCA_FLOW_POLICE);
429+
428430 fold = (struct flow_filter *)*arg;
429431 if (fold) {
430432 err = -EINVAL;
@@ -486,7 +488,6 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, · 55 unmodified lines
486488 fnew->mask = ~0U;
487489 fnew->tp = tp;
488490 get_random_bytes(&fnew->hashrnd, 4);
489− tcf_exts_init(&fnew->exts, TCA_FLOW_ACT, TCA_FLOW_POLICE);
490491 }
491492
492493 fnew->perturb_timer.function = flow_perturbation;
@@ -526,7 +527,7 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, · 33 unmodified lines
526527 if (*arg == 0)
527528 list_add_tail_rcu(&fnew->list, &head->filters);
528529 else
529− list_replace_rcu(&fnew->list, &fold->list);
530+ list_replace_rcu(&fold->list, &fnew->list);
530531
531532 *arg = (unsigned long)fnew;
532533
net/sched/cls_flower.c+1−1
@@ -499,7 +499,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, · 498 unmodified lines
499499 *arg = (unsigned long) fnew;
500500
501501 if (fold) {
502− list_replace_rcu(&fnew->list, &fold->list);
502+ list_replace_rcu(&fold->list, &fnew->list);
503503 tcf_unbind_filter(tp, &fold->res);
504504 call_rcu(&fold->rcu, fl_destroy_filter);
505505 } else {
net/sched/sch_fq_codel.c+11−2
@@ -155,14 +155,23 @@ static unsigned int fq_codel_drop(struct Qdisc *sch) · 154 unmodified lines
155155 skb = dequeue_head(flow);
156156 len = qdisc_pkt_len(skb);
157157 q->backlogs[idx] -= len;
158− kfree_skb(skb);
159158 sch->q.qlen--;
160159 qdisc_qstats_drop(sch);
161160 qdisc_qstats_backlog_dec(sch, skb);
161+ kfree_skb(skb);
162162 flow->dropped++;
163163 return idx;
164164 }
165165
166+static unsigned int fq_codel_qdisc_drop(struct Qdisc *sch)
167+{
168+ unsigned int prev_backlog;
169+
170+ prev_backlog = sch->qstats.backlog;
171+ fq_codel_drop(sch);
172+ return prev_backlog - sch->qstats.backlog;
173+}
174+
166175 static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
167176 {
168177 struct fq_codel_sched_data *q = qdisc_priv(sch);
@@ -604,7 +613,7 @@ static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = { · 435 unmodified lines
604613 .enqueue = fq_codel_enqueue,
605614 .dequeue = fq_codel_dequeue,
606615 .peek = qdisc_peek_dequeued,
607− .drop = fq_codel_drop,
616+ .drop = fq_codel_qdisc_drop,
608617 .init = fq_codel_init,
609618 .reset = fq_codel_reset,
610619 .destroy = fq_codel_destroy,
net/sched/sch_sfq.c+1−1
@@ -306,10 +306,10 @@ drop: · 305 unmodified lines
306306 len = qdisc_pkt_len(skb);
307307 slot->backlog -= len;
308308 sfq_dec(q, x);
309− kfree_skb(skb);
310309 sch->q.qlen--;
311310 qdisc_qstats_drop(sch);
312311 qdisc_qstats_backlog_dec(sch, skb);
312+ kfree_skb(skb);
313313 return len;
314314 }
315315
net/wireless/chan.c+34−11
@@ -797,23 +797,18 @@ static bool cfg80211_ir_permissive_chan(struct wiphy *wiphy, · 796 unmodified lines
797797 return false;
798798 }
799799
800−bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
801− struct cfg80211_chan_def *chandef,
802− enum nl80211_iftype iftype)
800+static bool _cfg80211_reg_can_beacon(struct wiphy *wiphy,
801+ struct cfg80211_chan_def *chandef,
802+ enum nl80211_iftype iftype,
803+ bool check_no_ir)
803804 {
804805 bool res;
805806 u32 prohibited_flags = IEEE80211_CHAN_DISABLED |
806807 IEEE80211_CHAN_RADAR;
807808
808− trace_cfg80211_reg_can_beacon(wiphy, chandef, iftype);
809+ trace_cfg80211_reg_can_beacon(wiphy, chandef, iftype, check_no_ir);
809810
810− /*
811− * Under certain conditions suggested by some regulatory bodies a
812− * GO/STA can IR on channels marked with IEEE80211_NO_IR. Set this flag
813− * only if such relaxations are not enabled and the conditions are not
814− * met.
815− */
816− if (!cfg80211_ir_permissive_chan(wiphy, iftype, chandef->chan))
811+ if (check_no_ir)
817812 prohibited_flags |= IEEE80211_CHAN_NO_IR;
818813
819814 if (cfg80211_chandef_dfs_required(wiphy, chandef, iftype) > 0 &&
@@ -827,8 +822,36 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, · 7 unmodified lines
827822 trace_cfg80211_return_bool(res);
828823 return res;
829824 }
825+
826+bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
827+ struct cfg80211_chan_def *chandef,
828+ enum nl80211_iftype iftype)
829+{
830+ return _cfg80211_reg_can_beacon(wiphy, chandef, iftype, true);
831+}
830832 EXPORT_SYMBOL(cfg80211_reg_can_beacon);
831833
834+bool cfg80211_reg_can_beacon_relax(struct wiphy *wiphy,
835+ struct cfg80211_chan_def *chandef,
836+ enum nl80211_iftype iftype)
837+{
838+ bool check_no_ir;
839+
840+ ASSERT_RTNL();
841+
842+ /*
843+ * Under certain conditions suggested by some regulatory bodies a
844+ * GO/STA can IR on channels marked with IEEE80211_NO_IR. Set this flag
845+ * only if such relaxations are not enabled and the conditions are not
846+ * met.
847+ */
848+ check_no_ir = !cfg80211_ir_permissive_chan(wiphy, iftype,
849+ chandef->chan);
850+
851+ return _cfg80211_reg_can_beacon(wiphy, chandef, iftype, check_no_ir);
852+}
853+EXPORT_SYMBOL(cfg80211_reg_can_beacon_relax);
854+
832855 int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
833856 struct cfg80211_chan_def *chandef)
834857 {
net/wireless/nl80211.c+8−6
@@ -2003,7 +2003,8 @@ static int __nl80211_set_channel(struct cfg80211_registered_device *rdev, · 2002 unmodified lines
20032003 switch (iftype) {
20042004 case NL80211_IFTYPE_AP:
20052005 case NL80211_IFTYPE_P2P_GO:
2006− if (!cfg80211_reg_can_beacon(&rdev->wiphy, &chandef, iftype)) {
2006+ if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &chandef,
2007+ iftype)) {
20072008 result = -EINVAL;
20082009 break;
20092010 }
@@ -3403,8 +3404,8 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) · 1393 unmodified lines
34033404 } else if (!nl80211_get_ap_channel(rdev, &params))
34043405 return -EINVAL;
34053406
3406− if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef,
3407− wdev->iftype))
3407+ if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &params.chandef,
3408+ wdev->iftype))
34083409 return -EINVAL;
34093410
34103411 if (info->attrs[NL80211_ATTR_ACL_POLICY]) {
@@ -6492,8 +6493,8 @@ skip_beacons: · 3081 unmodified lines
64926493 if (err)
64936494 return err;
64946495
6495− if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef,
6496− wdev->iftype))
6496+ if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &params.chandef,
6497+ wdev->iftype))
64976498 return -EINVAL;
64986499
64996500 err = cfg80211_chandef_dfs_required(wdev->wiphy,
@@ -10170,7 +10171,8 @@ static int nl80211_tdls_channel_switch(struct sk_buff *skb, · 3670 unmodified lines
1017010171 return -EINVAL;
1017110172
1017210173 /* we will be active on the TDLS link */
10173− if (!cfg80211_reg_can_beacon(&rdev->wiphy, &chandef, wdev->iftype))
10174+ if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, &chandef,
10175+ wdev->iftype))
1017410176 return -EINVAL;
1017510177
1017610178 /* don't allow switching to DFS channels */
net/wireless/reg.c+4−4
@@ -544,15 +544,15 @@ static int call_crda(const char *alpha2) · 543 unmodified lines
544544 reg_regdb_query(alpha2);
545545
546546 if (reg_crda_timeouts > REG_MAX_CRDA_TIMEOUTS) {
547− pr_info("Exceeded CRDA call max attempts. Not calling CRDA\n");
547+ pr_debug("Exceeded CRDA call max attempts. Not calling CRDA\n");
548548 return -EINVAL;
549549 }
550550
551551 if (!is_world_regdom((char *) alpha2))
552− pr_info("Calling CRDA for country: %c%c\n",
552+ pr_debug("Calling CRDA for country: %c%c\n",
553553 alpha2[0], alpha2[1]);
554554 else
555− pr_info("Calling CRDA to update world regulatory domain\n");
555+ pr_debug("Calling CRDA to update world regulatory domain\n");
556556
557557 return kobject_uevent_env(&reg_pdev->dev.kobj, KOBJ_CHANGE, env);
558558 }
@@ -1589,7 +1589,7 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) · 1030 unmodified lines
15891589 case NL80211_IFTYPE_AP:
15901590 case NL80211_IFTYPE_P2P_GO:
15911591 case NL80211_IFTYPE_ADHOC:
1592− return cfg80211_reg_can_beacon(wiphy, &chandef, iftype);
1592+ return cfg80211_reg_can_beacon_relax(wiphy, &chandef, iftype);
15931593 case NL80211_IFTYPE_STATION:
15941594 case NL80211_IFTYPE_P2P_CLIENT:
15951595 return cfg80211_chandef_usable(wiphy, &chandef,
net/wireless/trace.h+7−4
@@ -2358,20 +2358,23 @@ TRACE_EVENT(cfg80211_cqm_rssi_notify, · 2357 unmodified lines
23582358
23592359 TRACE_EVENT(cfg80211_reg_can_beacon,
23602360 TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
2361− enum nl80211_iftype iftype),
2362− TP_ARGS(wiphy, chandef, iftype),
2361+ enum nl80211_iftype iftype, bool check_no_ir),
2362+ TP_ARGS(wiphy, chandef, iftype, check_no_ir),
23632363 TP_STRUCT__entry(
23642364 WIPHY_ENTRY
23652365 CHAN_DEF_ENTRY
23662366 __field(enum nl80211_iftype, iftype)
2367+ __field(bool, check_no_ir)
23672368 ),
23682369 TP_fast_assign(
23692370 WIPHY_ASSIGN;
23702371 CHAN_DEF_ASSIGN(chandef);
23712372 __entry->iftype = iftype;
2373+ __entry->check_no_ir = check_no_ir;
23722374 ),
2373− TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", iftype=%d",
2374− WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->iftype)
2375+ TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT ", iftype=%d check_no_ir=%s",
2376+ WIPHY_PR_ARG, CHAN_DEF_PR_ARG, __entry->iftype,
2377+ BOOL_TO_STR(__entry->check_no_ir))
23752378 );
23762379
23772380 TRACE_EVENT(cfg80211_chandef_dfs_required,
samples/trace_events/trace-events-sample.h+5−2
@@ -168,7 +168,10 @@ · 167 unmodified lines
168168 *
169169 * For __dynamic_array(int, foo, bar) use __get_dynamic_array(foo)
170170 * Use __get_dynamic_array_len(foo) to get the length of the array
171− * saved.
171+ * saved. Note, __get_dynamic_array_len() returns the total allocated
172+ * length of the dynamic array; __print_array() expects the second
173+ * parameter to be the number of elements. To get that, the array length
174+ * needs to be divided by the element size.
172175 *
173176 * For __string(foo, bar) use __get_str(foo)
174177 *
@@ -288,7 +291,7 @@ TRACE_EVENT(foo_bar, · 113 unmodified lines
288291 * This prints out the array that is defined by __array in a nice format.
289292 */
290293 __print_array(__get_dynamic_array(list),
291− __get_dynamic_array_len(list),
294+ __get_dynamic_array_len(list) / sizeof(int),
292295 sizeof(int)),
293296 __get_str(str), __get_bitmask(cpus))
294297 );
scripts/checkpatch.pl+1−1
@@ -2599,7 +2599,7 @@ sub process { · 2598 unmodified lines
25992599 # if LONG_LINE is ignored, the other 2 types are also ignored
26002600 #
26012601
2602− if ($length > $max_line_length) {
2602+ if ($line =~ /^\+/ && $length > $max_line_length) {
26032603 my $msg_type = "LONG_LINE";
26042604
26052605 # Check the allowed long line types first
sound/pci/hda/hda_generic.c+1−1
@@ -5175,7 +5175,7 @@ static int alt_playback_pcm_open(struct hda_pcm_stream *hinfo, · 5174 unmodified lines
51755175 int err = 0;
51765176
51775177 mutex_lock(&spec->pcm_mutex);
5178− if (!spec->indep_hp_enabled)
5178+ if (spec->indep_hp && !spec->indep_hp_enabled)
51795179 err = -EBUSY;
51805180 else
51815181 spec->active_streams |= 1 << STREAM_INDEP_HP;
sound/pci/hda/patch_hdmi.c+2−0
@@ -3527,6 +3527,7 @@ static const struct hda_codec_preset snd_hda_preset_hdmi[] = { · 3526 unmodified lines
35273527 { .id = 0x80862807, .name = "Haswell HDMI", .patch = patch_generic_hdmi },
35283528 { .id = 0x80862808, .name = "Broadwell HDMI", .patch = patch_generic_hdmi },
35293529 { .id = 0x80862809, .name = "Skylake HDMI", .patch = patch_generic_hdmi },
3530+{ .id = 0x8086280a, .name = "Broxton HDMI", .patch = patch_generic_hdmi },
35303531 { .id = 0x80862880, .name = "CedarTrail HDMI", .patch = patch_generic_hdmi },
35313532 { .id = 0x80862882, .name = "Valleyview2 HDMI", .patch = patch_generic_hdmi },
35323533 { .id = 0x80862883, .name = "Braswell HDMI", .patch = patch_generic_hdmi },
@@ -3591,6 +3592,7 @@ MODULE_ALIAS("snd-hda-codec-id:80862806"); · 58 unmodified lines
35913592 MODULE_ALIAS("snd-hda-codec-id:80862807");
35923593 MODULE_ALIAS("snd-hda-codec-id:80862808");
35933594 MODULE_ALIAS("snd-hda-codec-id:80862809");
3595+MODULE_ALIAS("snd-hda-codec-id:8086280a");
35943596 MODULE_ALIAS("snd-hda-codec-id:80862880");
35953597 MODULE_ALIAS("snd-hda-codec-id:80862882");
35963598 MODULE_ALIAS("snd-hda-codec-id:80862883");
sound/pci/hda/patch_realtek.c+55−0
@@ -4441,6 +4441,55 @@ static void alc290_fixup_mono_speakers(struct hda_codec *codec, · 4440 unmodified lines
44414441 }
44424442 }
44434443
4444+/* Hook to update amp GPIO4 for automute */
4445+static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
4446+ struct hda_jack_callback *jack)
4447+{
4448+ struct alc_spec *spec = codec->spec;
4449+
4450+ snd_hda_gen_hp_automute(codec, jack);
4451+ /* mute_led_polarity is set to 0, so we pass inverted value here */
4452+ alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present);
4453+}
4454+
4455+/* Manage GPIOs for HP EliteBook Folio 9480m.
4456+ *
4457+ * GPIO4 is the headphone amplifier power control
4458+ * GPIO3 is the audio output mute indicator LED
4459+ */
4460+
4461+static void alc280_fixup_hp_9480m(struct hda_codec *codec,
4462+ const struct hda_fixup *fix,
4463+ int action)
4464+{
4465+ struct alc_spec *spec = codec->spec;
4466+ static const struct hda_verb gpio_init[] = {
4467+ { 0x01, AC_VERB_SET_GPIO_MASK, 0x18 },
4468+ { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x18 },
4469+ {}
4470+ };
4471+
4472+ if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4473+ /* Set the hooks to turn the headphone amp on/off
4474+ * as needed
4475+ */
4476+ spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook;
4477+ spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
4478+
4479+ /* The GPIOs are currently off */
4480+ spec->gpio_led = 0;
4481+
4482+ /* GPIO3 is connected to the output mute LED,
4483+ * high is on, low is off
4484+ */
4485+ spec->mute_led_polarity = 0;
4486+ spec->gpio_mute_led_mask = 0x08;
4487+
4488+ /* Initialize GPIO configuration */
4489+ snd_hda_add_verbs(codec, gpio_init);
4490+ }
4491+}
4492+
44444493 /* for hda_fixup_thinkpad_acpi() */
44454494 #include "thinkpad_helper.c"
44464495
@@ -4521,6 +4570,7 @@ enum { · 74 unmodified lines
45214570 ALC286_FIXUP_HP_GPIO_LED,
45224571 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
45234572 ALC280_FIXUP_HP_DOCK_PINS,
4573+ ALC280_FIXUP_HP_9480M,
45244574 ALC288_FIXUP_DELL_HEADSET_MODE,
45254575 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
45264576 ALC288_FIXUP_DELL_XPS_13_GPIO6,
@@ -5043,6 +5093,10 @@ static const struct hda_fixup alc269_fixups[] = { · 516 unmodified lines
50435093 .chained = true,
50445094 .chain_id = ALC280_FIXUP_HP_GPIO4
50455095 },
5096+ [ALC280_FIXUP_HP_9480M] = {
5097+ .type = HDA_FIXUP_FUNC,
5098+ .v.func = alc280_fixup_hp_9480m,
5099+ },
50465100 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
50475101 .type = HDA_FIXUP_FUNC,
50485102 .v.func = alc_fixup_headset_mode_dell_alc288,
@@ -5161,6 +5215,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 112 unmodified lines
51615215 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
51625216 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
51635217 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
5218+ SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
51645219 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
51655220 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
51665221 /* ALC290 */
sound/usb/line6/pcm.c+2−7
@@ -186,12 +186,8 @@ static int line6_stream_start(struct snd_line6_pcm *line6pcm, int direction, · 185 unmodified lines
186186 int ret = 0;
187187
188188 spin_lock_irqsave(&pstr->lock, flags);
189− if (!test_and_set_bit(type, &pstr->running)) {
190− if (pstr->active_urbs || pstr->unlink_urbs) {
191− ret = -EBUSY;
192− goto error;
193− }
194−
189+ if (!test_and_set_bit(type, &pstr->running) &&
190+ !(pstr->active_urbs || pstr->unlink_urbs)) {
195191 pstr->count = 0;
196192 /* Submit all currently available URBs */
197193 if (direction == SNDRV_PCM_STREAM_PLAYBACK)
@@ -199,7 +195,6 @@ static int line6_stream_start(struct snd_line6_pcm *line6pcm, int direction, · 1 unmodified line
199195 else
200196 ret = line6_submit_audio_in_all_urbs(line6pcm);
201197 }
202− error:
203198 if (ret < 0)
204199 clear_bit(type, &pstr->running);
205200 spin_unlock_irqrestore(&pstr->lock, flags);
sound/usb/quirks-table.h+68−0
@@ -2512,6 +2512,74 @@ YAMAHA_DEVICE(0x7010, "UB99"), · 2511 unmodified lines
25122512 }
25132513 },
25142514
2515+/* Steinberg devices */
2516+{
2517+ /* Steinberg MI2 */
2518+ USB_DEVICE_VENDOR_SPEC(0x0a4e, 0x2040),
2519+ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2520+ .ifnum = QUIRK_ANY_INTERFACE,
2521+ .type = QUIRK_COMPOSITE,
2522+ .data = & (const struct snd_usb_audio_quirk[]) {
2523+ {
2524+ .ifnum = 0,
2525+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
2526+ },
2527+ {
2528+ .ifnum = 1,
2529+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
2530+ },
2531+ {
2532+ .ifnum = 2,
2533+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
2534+ },
2535+ {
2536+ .ifnum = 3,
2537+ .type = QUIRK_MIDI_FIXED_ENDPOINT,
2538+ .data = &(const struct snd_usb_midi_endpoint_info) {
2539+ .out_cables = 0x0001,
2540+ .in_cables = 0x0001
2541+ }
2542+ },
2543+ {
2544+ .ifnum = -1
2545+ }
2546+ }
2547+ }
2548+},
2549+{
2550+ /* Steinberg MI4 */
2551+ USB_DEVICE_VENDOR_SPEC(0x0a4e, 0x4040),
2552+ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2553+ .ifnum = QUIRK_ANY_INTERFACE,
2554+ .type = QUIRK_COMPOSITE,
2555+ .data = & (const struct snd_usb_audio_quirk[]) {
2556+ {
2557+ .ifnum = 0,
2558+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
2559+ },
2560+ {
2561+ .ifnum = 1,
2562+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
2563+ },
2564+ {
2565+ .ifnum = 2,
2566+ .type = QUIRK_AUDIO_STANDARD_INTERFACE
2567+ },
2568+ {
2569+ .ifnum = 3,
2570+ .type = QUIRK_MIDI_FIXED_ENDPOINT,
2571+ .data = &(const struct snd_usb_midi_endpoint_info) {
2572+ .out_cables = 0x0001,
2573+ .in_cables = 0x0001
2574+ }
2575+ },
2576+ {
2577+ .ifnum = -1
2578+ }
2579+ }
2580+ }
2581+},
2582+
25152583 /* TerraTec devices */
25162584 {
25172585 USB_DEVICE_VENDOR_SPEC(0x0ccd, 0x0012),
tools/lib/api/Makefile+1−1
@@ -36,7 +36,7 @@ $(LIBFILE): $(API_IN) · 35 unmodified lines
3636
3737 clean:
3838 $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \
39− find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o | xargs $(RM)
39+ find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
4040
4141 FORCE:
4242
tools/lib/hweight.c+62−0
@@ -0,0 +1,62 @@
1+#include <linux/bitops.h>
2+#include <asm/types.h>
3+
4+/**
5+ * hweightN - returns the hamming weight of a N-bit word
6+ * @x: the word to weigh
7+ *
8+ * The Hamming Weight of a number is the total number of bits set in it.
9+ */
10+
11+unsigned int __sw_hweight32(unsigned int w)
12+{
13+#ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER
14+ w -= (w >> 1) & 0x55555555;
15+ w = (w & 0x33333333) + ((w >> 2) & 0x33333333);
16+ w = (w + (w >> 4)) & 0x0f0f0f0f;
17+ return (w * 0x01010101) >> 24;
18+#else
19+ unsigned int res = w - ((w >> 1) & 0x55555555);
20+ res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
21+ res = (res + (res >> 4)) & 0x0F0F0F0F;
22+ res = res + (res >> 8);
23+ return (res + (res >> 16)) & 0x000000FF;
24+#endif
25+}
26+
27+unsigned int __sw_hweight16(unsigned int w)
28+{
29+ unsigned int res = w - ((w >> 1) & 0x5555);
30+ res = (res & 0x3333) + ((res >> 2) & 0x3333);
31+ res = (res + (res >> 4)) & 0x0F0F;
32+ return (res + (res >> 8)) & 0x00FF;
33+}
34+
35+unsigned int __sw_hweight8(unsigned int w)
36+{
37+ unsigned int res = w - ((w >> 1) & 0x55);
38+ res = (res & 0x33) + ((res >> 2) & 0x33);
39+ return (res + (res >> 4)) & 0x0F;
40+}
41+
42+unsigned long __sw_hweight64(__u64 w)
43+{
44+#if BITS_PER_LONG == 32
45+ return __sw_hweight32((unsigned int)(w >> 32)) +
46+ __sw_hweight32((unsigned int)w);
47+#elif BITS_PER_LONG == 64
48+#ifdef CONFIG_ARCH_HAS_FAST_MULTIPLIER
49+ w -= (w >> 1) & 0x5555555555555555ul;
50+ w = (w & 0x3333333333333333ul) + ((w >> 2) & 0x3333333333333333ul);
51+ w = (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0ful;
52+ return (w * 0x0101010101010101ul) >> 56;
53+#else
54+ __u64 res = w - ((w >> 1) & 0x5555555555555555ul);
55+ res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul);
56+ res = (res + (res >> 4)) & 0x0F0F0F0F0F0F0F0Ful;
57+ res = res + (res >> 8);
58+ res = res + (res >> 16);
59+ return (res + (res >> 32)) & 0x00000000000000FFul;
60+#endif
61+#endif
62+}
tools/lib/traceevent/Makefile+1−1
@@ -268,7 +268,7 @@ install: install_lib · 267 unmodified lines
268268
269269 clean:
270270 $(call QUIET_CLEAN, libtraceevent) \
271− $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d \
271+ $(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd \
272272 $(RM) TRACEEVENT-CFLAGS tags TAGS
273273
274274 PHONY += force plugins
tools/perf/MANIFEST+1−1
@@ -18,6 +18,7 @@ tools/arch/x86/include/asm/atomic.h · 17 unmodified lines
1818 tools/arch/x86/include/asm/rmwcc.h
1919 tools/lib/traceevent
2020 tools/lib/api
21+tools/lib/hweight.c
2122 tools/lib/rbtree.c
2223 tools/lib/symbol/kallsyms.c
2324 tools/lib/symbol/kallsyms.h
@@ -57,7 +58,6 @@ include/linux/perf_event.h · 33 unmodified lines
5758 include/linux/list.h
5859 include/linux/hash.h
5960 include/linux/stringify.h
60−lib/hweight.c
6161 include/linux/swab.h
6262 arch/*/include/asm/unistd*.h
6363 arch/*/include/uapi/asm/unistd*.h
tools/perf/Makefile.perf+16−3
@@ -109,9 +109,22 @@ $(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD · 108 unmodified lines
109109 $(Q)$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
110110 $(Q)touch $(OUTPUT)PERF-VERSION-FILE
111111
112−CC = $(CROSS_COMPILE)gcc
113−LD ?= $(CROSS_COMPILE)ld
114−AR = $(CROSS_COMPILE)ar
112+# Makefiles suck: This macro sets a default value of $(2) for the
113+# variable named by $(1), unless the variable has been set by
114+# environment or command line. This is necessary for CC and AR
115+# because make sets default values, so the simpler ?= approach
116+# won't work as expected.
117+define allow-override
118+ $(if $(or $(findstring environment,$(origin $(1))),\
119+ $(findstring command line,$(origin $(1)))),,\
120+ $(eval $(1) = $(2)))
121+endef
122+
123+# Allow setting CC and AR and LD, or setting CROSS_COMPILE as a prefix.
124+$(call allow-override,CC,$(CROSS_COMPILE)gcc)
125+$(call allow-override,AR,$(CROSS_COMPILE)ar)
126+$(call allow-override,LD,$(CROSS_COMPILE)ld)
127+
115128 PKG_CONFIG = $(CROSS_COMPILE)pkg-config
116129
117130 RM = rm -f
tools/perf/builtin-stat.c+2−2
@@ -343,7 +343,7 @@ static int read_counter(struct perf_evsel *counter) · 342 unmodified lines
343343 return 0;
344344 }
345345
346−static void read_counters(bool close)
346+static void read_counters(bool close_counters)
347347 {
348348 struct perf_evsel *counter;
349349
@@ -354,7 +354,7 @@ static void read_counters(bool close) · 4 unmodified lines
354354 if (process_counter(counter))
355355 pr_warning("failed to process counter %s\n", counter->name);
356356
357− if (close) {
357+ if (close_counters) {
358358 perf_evsel__close_fd(counter, perf_evsel__nr_cpus(counter),
359359 thread_map__nr(evsel_list->threads));
360360 }
tools/perf/ui/browsers/hists.c+1−1
@@ -48,7 +48,7 @@ static struct rb_node *hists__filter_entries(struct rb_node *nd, · 47 unmodified lines
4848
4949 static bool hist_browser__has_filter(struct hist_browser *hb)
5050 {
51− return hists__has_filter(hb->hists) || hb->min_pcnt;
51+ return hists__has_filter(hb->hists) || hb->min_pcnt || symbol_conf.has_filter;
5252 }
5353
5454 static int hist_browser__get_folding(struct hist_browser *browser)
tools/perf/util/Build+1−1
@@ -143,6 +143,6 @@ $(OUTPUT)util/rbtree.o: ../lib/rbtree.c FORCE · 142 unmodified lines
143143 $(call rule_mkdir)
144144 $(call if_changed_dep,cc_o_c)
145145
146−$(OUTPUT)util/hweight.o: ../../lib/hweight.c FORCE
146+$(OUTPUT)util/hweight.o: ../lib/hweight.c FORCE
147147 $(call rule_mkdir)
148148 $(call if_changed_dep,cc_o_c)
tools/perf/util/auxtrace.c+5−5
@@ -53,11 +53,6 @@ int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, · 52 unmodified lines
5353 {
5454 struct perf_event_mmap_page *pc = userpg;
5555
56−#if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
57− pr_err("Cannot use AUX area tracing mmaps\n");
58− return -1;
59−#endif
60−
6156 WARN_ONCE(mm->base, "Uninitialized auxtrace_mmap\n");
6257
6358 mm->userpg = userpg;
@@ -73,6 +68,11 @@ int auxtrace_mmap__mmap(struct auxtrace_mmap *mm, · 9 unmodified lines
7368 return 0;
7469 }
7570
71+#if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
72+ pr_err("Cannot use AUX area tracing mmaps\n");
73+ return -1;
74+#endif
75+
7676 pc->aux_offset = mp->offset;
7777 pc->aux_size = mp->len;
7878
tools/perf/util/python-ext-sources+2−2
@@ -10,7 +10,7 @@ util/ctype.c · 9 unmodified lines
1010 util/evlist.c
1111 util/evsel.c
1212 util/cpumap.c
13−../../lib/hweight.c
13+../lib/hweight.c
1414 util/thread_map.c
1515 util/util.c
1616 util/xyarray.c
@@ -19,5 +19,5 @@ util/rblist.c · 2 unmodified lines
1919 util/stat.c
2020 util/strlist.c
2121 util/trace-event.c
22−../../lib/rbtree.c
22+../lib/rbtree.c
2323 util/string.c
tools/perf/util/symbol.c+2−0
@@ -1911,6 +1911,8 @@ int setup_list(struct strlist **list, const char *list_str, · 1910 unmodified lines
19111911 pr_err("problems parsing %s list\n", list_name);
19121912 return -1;
19131913 }
1914+
1915+ symbol_conf.has_filter = true;
19141916 return 0;
19151917 }
19161918
tools/perf/util/symbol.h+2−1
@@ -105,7 +105,8 @@ struct symbol_conf { · 104 unmodified lines
105105 demangle_kernel,
106106 filter_relative,
107107 show_hist_headers,
108− branch_callstack;
108+ branch_callstack,
109+ has_filter;
109110 const char *vmlinux_name,
110111 *kallsyms_name,
111112 *source_prefix,
tools/perf/util/thread_map.c+1−2
@@ -136,8 +136,7 @@ struct thread_map *thread_map__new_by_uid(uid_t uid) · 135 unmodified lines
136136 if (grow) {
137137 struct thread_map *tmp;
138138
139− tmp = realloc(threads, (sizeof(*threads) +
140− max_threads * sizeof(pid_t)));
139+ tmp = thread_map__realloc(threads, max_threads);
141140 if (tmp == NULL)
142141 goto out_free_namelist;
143142
tools/perf/util/vdso.c+3−5
@@ -236,18 +236,16 @@ static struct dso *__machine__findnew_compat(struct machine *machine, · 235 unmodified lines
236236 const char *file_name;
237237 struct dso *dso;
238238
239− pthread_rwlock_wrlock(&machine->dsos.lock);
240239 dso = __dsos__find(&machine->dsos, vdso_file->dso_name, true);
241240 if (dso)
242− goto out_unlock;
241+ goto out;
243242
244243 file_name = vdso__get_compat_file(vdso_file);
245244 if (!file_name)
246− goto out_unlock;
245+ goto out;
247246
248247 dso = __machine__addnew_vdso(machine, vdso_file->dso_name, file_name);
249−out_unlock:
250− pthread_rwlock_unlock(&machine->dsos.lock);
248+out:
251249 return dso;
252250 }
253251
virt/kvm/vfio.c+5−0
@@ -155,6 +155,8 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg) · 154 unmodified lines
155155 list_add_tail(&kvg->node, &kv->group_list);
156156 kvg->vfio_group = vfio_group;
157157
158+ kvm_arch_start_assignment(dev->kvm);
159+
158160 mutex_unlock(&kv->lock);
159161
160162 kvm_vfio_update_coherency(dev);
@@ -190,6 +192,8 @@ static int kvm_vfio_set_group(struct kvm_device *dev, long attr, u64 arg) · 29 unmodified lines
190192 break;
191193 }
192194
195+ kvm_arch_end_assignment(dev->kvm);
196+
193197 mutex_unlock(&kv->lock);
194198
195199 kvm_vfio_group_put_external_user(vfio_group);
@@ -239,6 +243,7 @@ static void kvm_vfio_destroy(struct kvm_device *dev) · 43 unmodified lines
239243 kvm_vfio_group_put_external_user(kvg->vfio_group);
240244 list_del(&kvg->node);
241245 kfree(kvg);
246+ kvm_arch_end_assignment(dev->kvm);
242247 }
243248
244249 kvm_vfio_update_coherency(dev);