History

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

Conflicts: drivers/net/usb/qmi_wwan.c include/net/dst.h Trivial merge conflicts, both were overlapping changes.

David S. Miller committed 13 years ago

Commit c3fa32b2 parents 34d92d5 320437a557 files · +4329 −2970Browse files

Unified · Split

557 files
  1. Documentation/ABI/stable/sysfs-bus-usb +4 −4
  2. Documentation/ABI/testing/sysfs-devices-power +16 −16
  3. Documentation/ABI/testing/sysfs-power +11 −11
  4. Documentation/acpi/dsdt-override.txt +1 −1
  5. Documentation/devicetree/bindings/memory.txt +0 −168
  6. Documentation/devicetree/bindings/mmc/tmio_mmc.txt +10 −7
  7. Documentation/sound/alsa/HD-Audio-Models.txt +1 −0
  8. MAINTAINERS +40 −14
  9. Makefile +1 −1
  10. arch/arc/kernel/ptrace.c +1 −1
  11. arch/arc/kernel/signal.c +13 −12
  12. arch/arm/Makefile +7 −2
  13. arch/arm/boot/Makefile +8 −8
  14. arch/arm/boot/dts/Makefile +2 −0
  15. arch/arm/boot/dts/armada-370-netgear-rn102.dts +32 −17
  16. arch/arm/boot/dts/armada-xp.dtsi +11 −0
  17. arch/arm/boot/dts/at91sam9x5.dtsi +4 −2
  18. arch/arm/boot/dts/atlas6.dtsi +12 −0
  19. arch/arm/boot/dts/exynos5250.dtsi +5 −0
  20. arch/arm/boot/dts/kirkwood.dtsi +2 −1
  21. arch/arm/boot/dts/omap3-beagle-xm.dts +1 −1
  22. arch/arm/boot/dts/omap3.dtsi +2 −2
  23. arch/arm/boot/dts/prima2.dtsi +23 −4
  24. arch/arm/boot/dts/r8a73a4.dtsi +3 −3
  25. arch/arm/boot/dts/r8a7778.dtsi +0 −1
  26. arch/arm/boot/dts/r8a7779.dtsi +0 −1
  27. arch/arm/boot/dts/r8a7790.dtsi +4 −5
  28. arch/arm/boot/dts/sh73a0.dtsi +3 −3
  29. arch/arm/boot/install.sh +14 −0
  30. arch/arm/common/edma.c +31 −7
  31. arch/arm/common/mcpm_entry.c +4 −2
  32. arch/arm/common/sharpsl_param.c +4 −1
  33. arch/arm/configs/multi_v7_defconfig +1 −0
  34. arch/arm/include/asm/Kbuild +0 −1
  35. arch/arm/include/asm/jump_label.h +1 −1
  36. arch/arm/include/asm/mcpm.h +10 −4
  37. arch/arm/include/asm/syscall.h +6 −0
  38. arch/arm/kernel/head.S +20 −1
  39. arch/arm/mach-at91/at91rm9200_time.c +1 −1
  40. arch/arm/mach-at91/at91sam926x_time.c +1 −1
  41. arch/arm/mach-at91/at91sam9g45_reset.S +8 −0
  42. arch/arm/mach-at91/at91x40_time.c +1 −1
  43. arch/arm/mach-davinci/board-dm365-evm.c +1 −1
  44. arch/arm/mach-davinci/include/mach/serial.h +2 −2
  45. arch/arm/mach-integrator/pci_v3.h +7 −0
  46. arch/arm/mach-mvebu/coherency.c +7 −1
  47. arch/arm/mach-mvebu/pmsu.c +1 −0
  48. arch/arm/mach-mvebu/system-controller.c +1 −0
  49. arch/arm/mach-omap2/board-generic.c +18 −0
  50. arch/arm/mach-omap2/board-rx51-peripherals.c +9 −0
  51. arch/arm/mach-omap2/gpmc-onenand.c +11 −1
  52. arch/arm/mach-omap2/mux.h +1 −3
  53. arch/arm/mach-omap2/timer.c +2 −2
  54. arch/arm/mach-shmobile/board-armadillo800eva.c +2 −2
  55. arch/arm/mach-shmobile/board-lager.c +26 −1
  56. arch/arm/mach-vexpress/tc2_pm.c +10 −1
  57. arch/arm/mm/dma-mapping.c +28 −15
  58. arch/arm/mm/init.c +0 −3
  59. arch/arm64/Kconfig.debug +0 −7
  60. arch/arm64/configs/defconfig +4 −1
  61. arch/arm64/include/asm/uaccess.h +6 −4
  62. arch/arm64/kernel/fpsimd.c +2 −0
  63. arch/arm64/mm/tlb.S +1 −1
  64. arch/mips/alchemy/board-mtx1.c +1 −1
  65. arch/mips/include/asm/jump_label.h +1 −1
  66. arch/mips/kernel/octeon_switch.S +1 −1
  67. arch/mips/kernel/r2300_switch.S +1 −1
  68. arch/mips/kernel/r4k_switch.S +1 −1
  69. arch/mips/mm/c-r4k.c +2 −0
  70. arch/parisc/configs/712_defconfig +2 −0
  71. arch/parisc/configs/a500_defconfig +2 −0
  72. arch/parisc/configs/b180_defconfig +3 −0
  73. arch/parisc/configs/c3000_defconfig +3 −0
  74. arch/parisc/configs/c8000_defconfig +2 −0
  75. arch/parisc/configs/default_defconfig +2 −0
  76. arch/parisc/include/asm/traps.h +1 −1
  77. arch/parisc/kernel/smp.c +1 −7
  78. arch/parisc/kernel/traps.c +3 −8
  79. arch/parisc/lib/memcpy.c +14 −1
  80. arch/parisc/mm/fault.c +10 −5
  81. arch/powerpc/include/asm/jump_label.h +1 −1
  82. arch/powerpc/kernel/iommu.c +1 −1
  83. arch/powerpc/kernel/irq.c +3 −2
  84. arch/powerpc/kernel/sysfs.c +16 −2
  85. arch/powerpc/kernel/tm.S +64 −31
  86. arch/powerpc/kernel/vio.c +8 −4
  87. arch/powerpc/kvm/book3s_hv_rmhandlers.S +1 −1
  88. arch/powerpc/kvm/e500_mmu_host.c +17 −1
  89. arch/powerpc/lib/checksum_64.S +42 −16
  90. arch/powerpc/mm/init_64.c +4 −0
  91. arch/powerpc/mm/mem.c +9 −0
  92. arch/powerpc/perf/power8-pmu.c +3 −2
  93. arch/s390/include/asm/jump_label.h +1 −1
  94. arch/s390/include/asm/pgtable.h +3 −1
  95. arch/s390/include/asm/timex.h +14 −14
  96. arch/s390/kernel/compat_signal.c +2 −2
  97. arch/s390/kernel/crash_dump.c +20 −22
  98. arch/s390/kernel/debug.c +1 −1
  99. arch/s390/kernel/entry.S +1 −0
  100. arch/s390/kernel/entry64.S +1 −0
  101. arch/s390/kernel/kprobes.c +5 −1
  102. arch/s390/kvm/interrupt.c +3 −3
  103. arch/s390/lib/delay.c +7 −7
  104. arch/sparc/Kconfig +6 −1
  105. arch/sparc/include/asm/floppy_64.h +1 −1
  106. arch/sparc/include/asm/jump_label.h +1 −1
  107. arch/sparc/kernel/Makefile +2 −1
  108. arch/sparc/kernel/ds.c +2 −3
  109. arch/sparc/kernel/ldc.c +2 −2
  110. arch/tile/include/asm/atomic.h +3 −2
  111. arch/tile/include/asm/atomic_32.h +15 −12
  112. arch/tile/include/asm/cmpxchg.h +17 −11
  113. arch/tile/include/asm/percpu.h +31 −3
  114. arch/tile/kernel/hardwall.c +3 −3
  115. arch/tile/kernel/intvec_32.S +3 −0
  116. arch/tile/kernel/intvec_64.S +3 −0
  117. arch/tile/kernel/stack.c +5 −7
  118. arch/tile/lib/atomic_32.c +4 −4
  119. arch/x86/Kconfig +4 −3
  120. arch/x86/include/asm/cpufeature.h +3 −3
  121. arch/x86/include/asm/jump_label.h +1 −1
  122. arch/x86/include/asm/mutex_64.h +2 −2
  123. arch/x86/kernel/apic/x2apic_uv_x.c +1 −1
  124. arch/x86/kernel/cpu/perf_event.c +3 −8
  125. arch/x86/kernel/kvm.c +14 −3
  126. arch/x86/kernel/reboot.c +8 −0
  127. arch/x86/kernel/sysfb_simplefb.c +2 −2
  128. arch/x86/kvm/vmx.c +12 −12
  129. arch/x86/pci/mmconfig-shared.c +6 −1
  130. arch/x86/xen/smp.c +9 −0
  131. block/partitions/efi.c +6 −1
  132. drivers/acpi/Kconfig +4 −4
  133. drivers/acpi/device_pm.c +0 −56
  134. drivers/acpi/power.c +4 −100
  135. drivers/acpi/scan.c +1 −2
  136. drivers/ata/ahci.c +1 −1
  137. drivers/ata/ahci_platform.c +1 −1
  138. drivers/ata/libahci.c +9 −1
  139. drivers/ata/libata-acpi.c +0 −14
  140. drivers/ata/libata-eh.c +3 −3
  141. drivers/ata/libata-scsi.c +0 −3
  142. drivers/ata/libata.h +0 −4
  143. drivers/ata/pata_isapnp.c +1 −1
  144. drivers/base/memory.c +5 −2
  145. drivers/bus/mvebu-mbus.c +9 −3
  146. drivers/char/random.c +5 −6
  147. drivers/char/tpm/xen-tpmfront.c +1 −0
  148. drivers/cpufreq/cpufreq-cpu0.c +1 −1
  149. drivers/cpufreq/intel_pstate.c +8 −5
  150. drivers/cpufreq/s3c64xx-cpufreq.c +1 −1
  151. drivers/cpufreq/spear-cpufreq.c +1 −1
  152. drivers/dma/Kconfig +1 −0
  153. drivers/dma/edma.c +2 −1
  154. drivers/dma/imx-dma.c +15 −16
  155. drivers/dma/sh/rcar-hpbdma.c +5 −4
  156. drivers/gpio/gpio-lynxpoint.c +3 −2
  157. drivers/gpio/gpio-omap.c +101 −57
  158. drivers/gpio/gpio-rcar.c +3 −4
  159. drivers/gpio/gpiolib.c +4 −2
  160. drivers/gpu/drm/drm_drv.c +8 −1
  161. drivers/gpu/drm/drm_edid.c +2 −0
  162. drivers/gpu/drm/drm_fb_helper.c +0 −8
  163. drivers/gpu/drm/gma500/gtt.c +1 −0
  164. drivers/gpu/drm/i915/i915_dma.c +3 −12
  165. drivers/gpu/drm/i915/i915_drv.c +4 −1
  166. drivers/gpu/drm/i915/i915_drv.h +6 −2
  167. drivers/gpu/drm/i915/i915_gem_gtt.c +85 −24
  168. drivers/gpu/drm/i915/i915_reg.h +12 −0
  169. drivers/gpu/drm/i915/intel_display.c +2 −36
  170. drivers/gpu/drm/i915/intel_dp.c +1 −1
  171. drivers/gpu/drm/i915/intel_drv.h +0 −1
  172. drivers/gpu/drm/i915/intel_pm.c +10 −3
  173. drivers/gpu/drm/nouveau/core/subdev/mc/base.c +1 −1
  174. drivers/gpu/drm/radeon/atombios_encoders.c +36 −18
  175. drivers/gpu/drm/radeon/btc_dpm.c +3 −3
  176. drivers/gpu/drm/radeon/cik.c +10 −0
  177. drivers/gpu/drm/radeon/dce6_afmt.c +3 −0
  178. drivers/gpu/drm/radeon/evergreen.c +1 −1
  179. drivers/gpu/drm/radeon/evergreen_hdmi.c +4 −2
  180. drivers/gpu/drm/radeon/evergreend.h +2 −2
  181. drivers/gpu/drm/radeon/ni.c +1 −0
  182. drivers/gpu/drm/radeon/r600.c +1 −0
  183. drivers/gpu/drm/radeon/r600_hdmi.c +17 −7
  184. drivers/gpu/drm/radeon/r600d.h +1 −1
  185. drivers/gpu/drm/radeon/radeon_connectors.c +21 −12
  186. drivers/gpu/drm/radeon/radeon_cs.c +1 −2
  187. drivers/gpu/drm/radeon/radeon_drv.c +2 −2
  188. drivers/gpu/drm/radeon/radeon_pm.c +3 −0
  189. drivers/gpu/drm/radeon/radeon_test.c +2 −2
  190. drivers/gpu/drm/radeon/radeon_uvd.c +4 −2
  191. drivers/gpu/drm/radeon/si.c +11 −0
  192. drivers/gpu/drm/radeon/si_dpm.c +3 −3
  193. drivers/gpu/drm/radeon/sid.h +2 −2
  194. drivers/gpu/drm/radeon/trinity_dpm.c +1 −1
  195. drivers/gpu/drm/radeon/uvd_v1_0.c +2 −2
  196. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +12 −5
  197. drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +1 −1
  198. drivers/hid/Kconfig +1 −0
  199. drivers/hid/hid-core.c +8 −5
  200. drivers/hid/hid-holtek-mouse.c +4 −0
  201. drivers/hid/hid-ids.h +7 −0
  202. drivers/hid/hid-input.c +4 −9
  203. drivers/hid/hid-roccat-kone.c +1 −1
  204. drivers/hid/hid-roccat-koneplus.c +2 −2
  205. drivers/hid/hid-roccat-kovaplus.c +2 −2
  206. drivers/hid/hid-roccat-pyra.c +2 −2
  207. drivers/hid/hid-wiimote-core.c +4 −1
  208. drivers/hid/hid-wiimote-modules.c +29 −11
  209. drivers/hid/hid-wiimote.h +3 −1
  210. drivers/hid/hidraw.c +14 −7
  211. drivers/hid/uhid.c +2 −1
  212. drivers/hid/usbhid/hid-quirks.c +3 −0
  213. drivers/hwmon/applesmc.c +13 −0
  214. drivers/i2c/busses/i2c-designware-platdrv.c +3 −2
  215. drivers/i2c/busses/i2c-imx.c +6 −5
  216. drivers/i2c/busses/i2c-mxs.c +2 −1
  217. drivers/i2c/busses/i2c-omap.c +3 −0
  218. drivers/i2c/busses/i2c-stu300.c +5 −6
  219. drivers/i2c/i2c-core.c +3 −0
  220. drivers/i2c/muxes/i2c-arb-gpio-challenge.c +1 −1
  221. drivers/i2c/muxes/i2c-mux-gpio.c +9 −5
  222. drivers/i2c/muxes/i2c-mux-pinctrl.c +2 −2
  223. drivers/iio/amplifiers/ad8366.c +1 −3
  224. drivers/iio/frequency/adf4350.c +4 −2
  225. drivers/iio/industrialio-buffer.c +3 −0
  226. drivers/iio/industrialio-core.c +1 −1
  227. drivers/iio/magnetometer/st_magn_core.c +9 −9
  228. drivers/infiniband/Kconfig +11 −0
  229. drivers/infiniband/core/uverbs.h +2 −0
  230. drivers/infiniband/core/uverbs_cmd.c +4 −0
  231. drivers/infiniband/core/uverbs_main.c +6 −0
  232. drivers/infiniband/hw/amso1100/c2_ae.c +1 −1
  233. drivers/infiniband/hw/mlx4/main.c +2 −0
  234. drivers/infiniband/hw/mlx5/main.c +10 −6
  235. drivers/infiniband/hw/mlx5/mr.c +33 −37
  236. drivers/infiniband/hw/mlx5/qp.c +30 −50
  237. drivers/infiniband/hw/mlx5/srq.c +3 −1
  238. drivers/infiniband/hw/mthca/mthca_eq.c +1 −1
  239. drivers/infiniband/hw/ocrdma/ocrdma_hw.c +3 −3
  240. drivers/infiniband/hw/ocrdma/ocrdma_main.c +1 −1
  241. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +3 −3
  242. drivers/infiniband/ulp/srpt/ib_srpt.c +6 −8
  243. drivers/iommu/Kconfig +1 −1
  244. drivers/iommu/arm-smmu.c +7 −6
  245. drivers/md/bcache/request.c +2 −3
  246. drivers/md/dm-snap-persistent.c +12 −6
  247. drivers/media/dvb-frontends/tda10071.c +1 −8
  248. drivers/media/i2c/ad9389b.c +6 −9
  249. drivers/media/i2c/adv7511.c +9 −9
  250. drivers/media/i2c/adv7842.c +12 −18
  251. drivers/media/i2c/ths8200.c +4 −8
  252. drivers/media/pci/saa7134/saa7134-video.c +1 −0
  253. drivers/media/platform/s5p-jpeg/jpeg-core.c +1 −0
  254. drivers/media/platform/sh_vou.c +1 −1
  255. drivers/media/platform/soc_camera/mx3_camera.c +2 −3
  256. drivers/media/tuners/e4000.c +2 −1
  257. drivers/media/usb/stkwebcam/stk-webcam.c +7 −0
  258. drivers/media/usb/uvc/uvc_driver.c +18 −0
  259. drivers/media/v4l2-core/videobuf2-core.c +3 −1
  260. drivers/media/v4l2-core/videobuf2-dma-contig.c +82 −5
  261. drivers/mmc/host/sh_mobile_sdhi.c +8 −8
  262. drivers/mtd/devices/m25p80.c +15 −2
  263. drivers/mtd/nand/nand_base.c +3 −5
  264. drivers/net/can/at91_can.c +2 −2
  265. drivers/net/can/flexcan.c +10 −4
  266. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +10 −5
  267. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +1 −0
  268. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +2 −38
  269. drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h +25 −13
  270. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +212 −176
  271. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +17 −12
  272. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +1 −1
  273. drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +1 −1
  274. drivers/net/ethernet/davicom/dm9000.c +38 −18
  275. drivers/net/ethernet/freescale/gianfar.c +28 −10
  276. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +15 −13
  277. drivers/net/ethernet/mellanox/mlx5/core/eq.c +3 −1
  278. drivers/net/ethernet/mellanox/mlx5/core/main.c +5 −16
  279. drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +14 −2
  280. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +1 −1
  281. drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +1 −7
  282. drivers/net/ethernet/renesas/sh_eth.c +4 −4
  283. drivers/net/ethernet/smsc/smc91x.h +2 −4
  284. drivers/net/ethernet/ti/cpsw.c +1 −8
  285. drivers/net/ethernet/ti/davinci_emac.c +1 −2
  286. drivers/net/hamradio/yam.c +0 −1
  287. drivers/net/usb/ax88179_178a.c +20 −3
  288. drivers/net/usb/qmi_wwan.c +1 −0
  289. drivers/net/usb/usbnet.c +3 −1
  290. drivers/net/virtio_net.c +13 −1
  291. drivers/net/wan/farsync.c +1 −0
  292. drivers/net/wan/wanxl.c +1 −0
  293. drivers/net/wireless/ath/ath9k/main.c +11 −12
  294. drivers/net/wireless/cw1200/cw1200_spi.c +2 −0
  295. drivers/net/wireless/iwlwifi/iwl-6000.c +6 −0
  296. drivers/net/wireless/iwlwifi/iwl-config.h +1 −0
  297. drivers/net/wireless/iwlwifi/iwl-trans.h +4 −2
  298. drivers/net/wireless/iwlwifi/mvm/power.c +4 −1
  299. drivers/net/wireless/iwlwifi/mvm/scan.c +11 −1
  300. drivers/net/wireless/iwlwifi/pcie/drv.c +42 −0
  301. drivers/net/wireless/iwlwifi/pcie/tx.c +2 −0
  302. drivers/net/wireless/mwifiex/join.c +8 −2
  303. drivers/net/wireless/mwifiex/sta_event.c +2 −1
  304. drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +2 −1
  305. drivers/of/Kconfig +0 −6
  306. drivers/of/Makefile +0 −1
  307. drivers/of/base.c +1 −3
  308. drivers/of/fdt.c +0 −12
  309. drivers/of/of_reserved_mem.c +0 −173
  310. drivers/of/platform.c +0 −4
  311. drivers/pci/hotplug/acpiphp_glue.c +5 −3
  312. drivers/pinctrl/pinconf.c +2 −2
  313. drivers/pinctrl/pinctrl-exynos.c +6 −6
  314. drivers/pinctrl/pinctrl-palmas.c +3 −2
  315. drivers/pinctrl/pinctrl-tegra114.c +2 −3
  316. drivers/platform/x86/Kconfig +1 −0
  317. drivers/platform/x86/sony-laptop.c +9 −17
  318. drivers/s390/block/dasd_eckd.c +71 −27
  319. drivers/s390/char/sclp.c +2 −2
  320. drivers/s390/char/sclp_cmd.c +5 −3
  321. drivers/s390/char/tty3270.c +1 −1
  322. drivers/s390/char/vmlogrdr.c +1 −1
  323. drivers/s390/cio/cio.c +2 −2
  324. drivers/s390/cio/qdio_main.c +5 −5
  325. drivers/spi/spi-atmel.c +2 −1
  326. drivers/spi/spi-clps711x.c +0 −3
  327. drivers/spi/spi-fsl-dspi.c +2 −8
  328. drivers/spi/spi-mpc512x-psc.c +3 −1
  329. drivers/spi/spi-pxa2xx.c +10 −1
  330. drivers/spi/spi-s3c64xx.c +2 −2
  331. drivers/spi/spi-sh-hspi.c +2 −2
  332. drivers/staging/comedi/drivers/ni_65xx.c +10 −15
  333. drivers/staging/media/msi3101/Kconfig +1 −0
  334. drivers/staging/media/msi3101/sdr-msi3101.c +8 −2
  335. drivers/target/iscsi/iscsi_target.c +9 −4
  336. drivers/target/iscsi/iscsi_target_nego.c +1 −1
  337. drivers/target/iscsi/iscsi_target_util.c +2 −2
  338. drivers/target/target_core_sbc.c +26 −2
  339. drivers/target/target_core_transport.c +15 −5
  340. drivers/target/target_core_xcopy.c +2 −2
  341. drivers/thermal/samsung/exynos_thermal_common.c +0 −2
  342. drivers/thermal/samsung/exynos_tmu.c +8 −4
  343. drivers/thermal/samsung/exynos_tmu.h +6 −1
  344. drivers/thermal/samsung/exynos_tmu_data.c +24 −6
  345. drivers/thermal/samsung/exynos_tmu_data.h +12 −1
  346. drivers/thermal/thermal_hwmon.c +1 −1
  347. drivers/thermal/ti-soc-thermal/ti-thermal-common.c +1 −0
  348. drivers/thermal/x86_pkg_temp_thermal.c +8 −6
  349. drivers/tty/hvc/hvc_xen.c +1 −0
  350. drivers/tty/n_tty.c +26 −20
  351. drivers/tty/serial/imx.c +0 −3
  352. drivers/tty/serial/vt8500_serial.c +3 −2
  353. drivers/usb/chipidea/ci_hdrc_pci.c +6 −1
  354. drivers/usb/chipidea/host.c +4 −2
  355. drivers/usb/core/quirks.c +6 −0
  356. drivers/usb/gadget/f_fs.c +2 −0
  357. drivers/usb/gadget/pxa25x_udc.c +5 −4
  358. drivers/usb/gadget/s3c-hsotg.c +1 −1
  359. drivers/usb/host/pci-quirks.c +2 −2
  360. drivers/usb/host/xhci-hub.c +0 −26
  361. drivers/usb/host/xhci-pci.c +25 −0
  362. drivers/usb/host/xhci.c +13 −1
  363. drivers/usb/host/xhci.h +2 −0
  364. drivers/usb/misc/Kconfig +1 −1
  365. drivers/usb/musb/musb_core.c +46 −0
  366. drivers/usb/musb/musb_core.h +1 −0
  367. drivers/usb/musb/musb_dsps.c +3 −0
  368. drivers/usb/musb/musb_gadget.c +6 −0
  369. drivers/usb/musb/musb_virthub.c +0 −46
  370. drivers/usb/phy/phy-gpio-vbus-usb.c +5 −6
  371. drivers/usb/serial/option.c +227 −1
  372. drivers/usb/serial/ti_usb_3410_5052.c +1 −0
  373. drivers/usb/storage/scsiglue.c +4 −1
  374. drivers/usb/storage/unusual_devs.h +7 −0
  375. drivers/vfio/vfio_iommu_type1.c +21 −19
  376. drivers/vhost/scsi.c +6 −1
  377. drivers/w1/w1.c +6 −0
  378. drivers/watchdog/hpwdt.c +6 −0
  379. drivers/watchdog/kempld_wdt.c +1 −1
  380. drivers/watchdog/sunxi_wdt.c +2 −2
  381. drivers/watchdog/ts72xx_wdt.c +2 −1
  382. fs/aio.c +37 −15
  383. fs/btrfs/async-thread.c +19 −6
  384. fs/btrfs/async-thread.h +2 −0
  385. fs/btrfs/dev-replace.c +1 −4
  386. fs/btrfs/disk-io.c +5 −4
  387. fs/btrfs/disk-io.h +11 −2
  388. fs/btrfs/extent_io.c +13 −9
  389. fs/btrfs/inode.c +2 −1
  390. fs/btrfs/relocation.c +1 −1
  391. fs/btrfs/root-tree.c +3 −5
  392. fs/btrfs/transaction.c +2 −5
  393. fs/btrfs/volumes.c +6 −1
  394. fs/buffer.c +12 −2
  395. fs/cifs/cifsfs.c +4 −2
  396. fs/cifs/cifsfs.h +1 −1
  397. fs/cifs/cifsglob.h +1 −4
  398. fs/cifs/cifspdu.h +24 −28
  399. fs/cifs/cifssmb.c +34 −7
  400. fs/cifs/file.c +8 −0
  401. fs/cifs/fscache.c +7 −0
  402. fs/cifs/fscache.h +13 −0
  403. fs/cifs/inode.c +39 −6
  404. fs/cifs/netmisc.c +3 −1
  405. fs/cifs/readdir.c +3 −0
  406. fs/cifs/sess.c +3 −85
  407. fs/cifs/smb2pdu.c +6 −0
  408. fs/cifs/smbfsctl.h +14 −0
  409. fs/cifs/transport.c +7 −2
  410. fs/dcache.c +7 −8
  411. fs/ext3/namei.c +2 −3
  412. fs/ext4/inode.c +1 −1
  413. fs/ext4/namei.c +2 −3
  414. fs/ext4/xattr.c +2 −0
  415. fs/fuse/dir.c +13 −7
  416. fs/fuse/file.c +17 −6
  417. fs/fuse/fuse_i.h +2 −0
  418. fs/jfs/jfs_inode.c +1 −2
  419. fs/namei.c +2 −1
  420. fs/proc/inode.c +7 −3
  421. fs/proc/task_mmu.c +3 −1
  422. fs/statfs.c +1 −1
  423. fs/xfs/xfs_dir2_block.c +3 −3
  424. fs/xfs/xfs_dir2_format.h +20 −31
  425. fs/xfs/xfs_dir2_readdir.c +2 −2
  426. fs/xfs/xfs_dir2_sf.c +3 −3
  427. fs/xfs/xfs_dquot.c +16 −3
  428. fs/xfs/xfs_log_recover.c +1 −0
  429. include/acpi/acpi_bus.h +0 −7
  430. include/asm-generic/hugetlb.h +2 −2
  431. include/dt-bindings/pinctrl/omap.h +1 −3
  432. include/linux/compiler-gcc4.h +15 −0
  433. include/linux/intel-iommu.h +1 −1
  434. include/linux/memcontrol.h +11 −39
  435. include/linux/miscdevice.h +1 −0
  436. include/linux/mlx5/device.h +2 −2
  437. include/linux/mlx5/driver.h +2 −4
  438. include/linux/of_reserved_mem.h +0 −14
  439. include/linux/perf_event.h +23 −1
  440. include/linux/random.h +1 −0
  441. include/linux/sched.h +3 −4
  442. include/linux/timex.h +14 −0
  443. include/linux/usb/usb_phy_gen_xceiv.h +1 −1
  444. include/linux/usb_usual.h +3 −1
  445. include/linux/vgaarb.h +0 −7
  446. include/linux/yam.h +1 −1
  447. include/net/cipso_ipv4.h +4 −2
  448. include/net/dst.h +12 −0
  449. include/net/ip6_route.h +2 −4
  450. include/net/mac802154.h +1 −1
  451. include/sound/rcar_snd.h +1 −0
  452. include/uapi/drm/drm_mode.h +2 −0
  453. include/uapi/rdma/ib_user_verbs.h +6 −0
  454. init/main.c +2 −0
  455. ipc/sem.c +29 −13
  456. ipc/util.c +21 −6
  457. kernel/cgroup.c +6 −8
  458. kernel/events/core.c +3 −3
  459. kernel/power/snapshot.c +4 −1
  460. kernel/power/user.c +8 −0
  461. kernel/softirq.c +12 −3
  462. lib/kobject.c +1 −1
  463. lib/percpu-refcount.c +3 −0
  464. mm/Kconfig +1 −1
  465. mm/filemap.c +1 −10
  466. mm/huge_memory.c +9 −1
  467. mm/hugetlb.c +16 −1
  468. mm/memcontrol.c +55 −88
  469. mm/memory.c +14 −6
  470. mm/migrate.c +2 −0
  471. mm/mprotect.c +5 −2
  472. mm/mremap.c +1 −4
  473. mm/oom_kill.c +1 −1
  474. mm/page-writeback.c +5 −5
  475. mm/slab_common.c +2 −0
  476. mm/swapfile.c +3 −1
  477. mm/vmscan.c +1 −0
  478. mm/zswap.c +4 −0
  479. net/bridge/br_fdb.c +2 −2
  480. net/bridge/br_mdb.c +1 −1
  481. net/bridge/br_multicast.c +26 −12
  482. net/bridge/br_netlink.c +1 −1
  483. net/bridge/br_private.h +1 −4
  484. net/bridge/br_stp_if.c +1 −1
  485. net/bridge/br_vlan.c +67 −58
  486. net/core/secure_seq.c +2 −0
  487. net/ipv4/ip_output.c +9 −4
  488. net/ipv4/ip_vti.c +11 −3
  489. net/ipv4/tcp_input.c +3 −1
  490. net/ipv4/tcp_output.c +7 −5
  491. net/ipv4/xfrm4_policy.c +1 −0
  492. net/ipv6/ah6.c +1 −2
  493. net/ipv6/esp6.c +1 −2
  494. net/ipv6/ip6_gre.c +1 −2
  495. net/ipv6/ip6_output.c +16 −13
  496. net/ipv6/ipcomp6.c +1 −2
  497. net/ipv6/route.c +37 −9
  498. net/ipv6/udp.c +2 −3
  499. net/ipv6/xfrm6_policy.c +1 −0
  500. net/key/af_key.c +2 −1
  501. net/l2tp/l2tp_ppp.c +4 −0
  502. net/mac80211/cfg.c +1 −1
  503. net/mac80211/ieee80211_i.h +3 −0
  504. net/mac80211/offchannel.c +2 −0
  505. net/mac80211/scan.c +19 −0
  506. net/mac80211/status.c +3 −0
  507. net/mac80211/tx.c +2 −1
  508. net/mac80211/util.c +4 −0
  509. net/netfilter/nf_conntrack_h323_main.c +2 −2
  510. net/sched/sch_netem.c +17 −0
  511. net/sctp/output.c +2 −1
  512. net/unix/af_unix.c +10 −0
  513. net/wireless/core.c +0 −2
  514. net/wireless/core.h +3 −0
  515. net/wireless/radiotap.c +6 −1
  516. net/xfrm/xfrm_policy.c +21 −7
  517. net/xfrm/xfrm_replay.c +28 −26
  518. net/xfrm/xfrm_user.c +3 −2
  519. security/apparmor/apparmorfs.c +1 −3
  520. security/apparmor/policy.c +1 −0
  521. security/selinux/avc.c +3 −6
  522. security/selinux/hooks.c +7 −8
  523. security/selinux/include/avc.h +5 −13
  524. sound/pci/ac97/ac97_codec.c +1 −0
  525. sound/pci/hda/hda_generic.c +1 −1
  526. sound/pci/hda/patch_conexant.c +11 −0
  527. sound/pci/hda/patch_hdmi.c +8 −10
  528. sound/pci/hda/patch_realtek.c +54 −0
  529. sound/pci/rme9652/hdsp.c +1 −0
  530. sound/soc/blackfin/bf6xx-i2s.c +1 −0
  531. sound/soc/codecs/88pm860x-codec.c +3 −0
  532. sound/soc/codecs/ab8500-codec.c +6 −1
  533. sound/soc/codecs/max98095.c +2 −2
  534. sound/soc/codecs/pcm1681.c +1 −1
  535. sound/soc/codecs/pcm1792a.c +1 −1
  536. sound/soc/codecs/tlv320aic3x.c +4 −0
  537. sound/soc/fsl/fsl_ssi.c +1 −1
  538. sound/soc/fsl/imx-mc13783.c +1 −1
  539. sound/soc/fsl/imx-sgtl5000.c +5 −2
  540. sound/soc/fsl/imx-ssi.c +12 −11
  541. sound/soc/fsl/imx-ssi.h +2 −0
  542. sound/soc/omap/Kconfig +2 −2
  543. sound/soc/sh/rcar/rsnd.h +2 −2
  544. sound/soc/soc-core.c +0 −1
  545. sound/usb/usx2y/us122l.c +3 −1
  546. sound/usb/usx2y/usbusx2yaudio.c +3 −19
  547. sound/usb/usx2y/usx2yhwdeppcm.c +1 −6
  548. tools/perf/Makefile +1 −0
  549. tools/perf/builtin-stat.c +1 −0
  550. tools/perf/config/feature-tests.mak +1 −1
  551. tools/perf/util/dwarf-aux.c +21 −4
  552. tools/perf/util/dwarf-aux.h +5 −1
  553. tools/perf/util/header.c +12 −0
  554. tools/perf/util/probe-finder.c +33 −16
  555. tools/perf/util/session.c +3 −1
  556. tools/testing/selftests/timers/posix_timers.c +1 −1
  557. virt/kvm/kvm_main.c +4 −2
Documentation/ABI/stable/sysfs-bus-usb+4−4
@@ -37,8 +37,8 @@ Description: · 36 unmodified lines
3737 that the USB device has been connected to the machine. This
3838 file is read-only.
3939 Users:
40− PowerTOP <power@bughost.org>
41− http://www.lesswatts.org/projects/powertop/
40+ PowerTOP <powertop@lists.01.org>
41+ https://01.org/powertop/
4242
4343 What: /sys/bus/usb/device/.../power/active_duration
4444 Date: January 2008
@@ -57,8 +57,8 @@ Description: · 12 unmodified lines
5757 will give an integer percentage. Note that this does not
5858 account for counter wrap.
5959 Users:
60− PowerTOP <power@bughost.org>
61− http://www.lesswatts.org/projects/powertop/
60+ PowerTOP <powertop@lists.01.org>
61+ https://01.org/powertop/
6262
6363 What: /sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend
6464 Date: January 2008
Documentation/ABI/testing/sysfs-devices-power+16−16
@@ -1,6 +1,6 @@
11 What: /sys/devices/.../power/
22 Date: January 2009
3−Contact: Rafael J. Wysocki <rjw@sisk.pl>
3+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
44 Description:
55 The /sys/devices/.../power directory contains attributes
66 allowing the user space to check and modify some power
@@ -8,7 +8,7 @@ Description: · 1 unmodified line
88
99 What: /sys/devices/.../power/wakeup
1010 Date: January 2009
11−Contact: Rafael J. Wysocki <rjw@sisk.pl>
11+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
1212 Description:
1313 The /sys/devices/.../power/wakeup attribute allows the user
1414 space to check if the device is enabled to wake up the system
@@ -34,7 +34,7 @@ Description: · 19 unmodified lines
3434
3535 What: /sys/devices/.../power/control
3636 Date: January 2009
37−Contact: Rafael J. Wysocki <rjw@sisk.pl>
37+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
3838 Description:
3939 The /sys/devices/.../power/control attribute allows the user
4040 space to control the run-time power management of the device.
@@ -53,7 +53,7 @@ Description: · 12 unmodified lines
5353
5454 What: /sys/devices/.../power/async
5555 Date: January 2009
56−Contact: Rafael J. Wysocki <rjw@sisk.pl>
56+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
5757 Description:
5858 The /sys/devices/.../async attribute allows the user space to
5959 enable or diasble the device's suspend and resume callbacks to
@@ -79,7 +79,7 @@ Description: · 19 unmodified lines
7979
8080 What: /sys/devices/.../power/wakeup_count
8181 Date: September 2010
82−Contact: Rafael J. Wysocki <rjw@sisk.pl>
82+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
8383 Description:
8484 The /sys/devices/.../wakeup_count attribute contains the number
8585 of signaled wakeup events associated with the device. This
@@ -88,7 +88,7 @@ Description: · 2 unmodified lines
8888
8989 What: /sys/devices/.../power/wakeup_active_count
9090 Date: September 2010
91−Contact: Rafael J. Wysocki <rjw@sisk.pl>
91+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
9292 Description:
9393 The /sys/devices/.../wakeup_active_count attribute contains the
9494 number of times the processing of wakeup events associated with
@@ -98,7 +98,7 @@ Description: · 3 unmodified lines
9898
9999 What: /sys/devices/.../power/wakeup_abort_count
100100 Date: February 2012
101−Contact: Rafael J. Wysocki <rjw@sisk.pl>
101+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
102102 Description:
103103 The /sys/devices/.../wakeup_abort_count attribute contains the
104104 number of times the processing of a wakeup event associated with
@@ -109,7 +109,7 @@ Description: · 4 unmodified lines
109109
110110 What: /sys/devices/.../power/wakeup_expire_count
111111 Date: February 2012
112−Contact: Rafael J. Wysocki <rjw@sisk.pl>
112+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
113113 Description:
114114 The /sys/devices/.../wakeup_expire_count attribute contains the
115115 number of times a wakeup event associated with the device has
@@ -119,7 +119,7 @@ Description: · 3 unmodified lines
119119
120120 What: /sys/devices/.../power/wakeup_active
121121 Date: September 2010
122−Contact: Rafael J. Wysocki <rjw@sisk.pl>
122+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
123123 Description:
124124 The /sys/devices/.../wakeup_active attribute contains either 1,
125125 or 0, depending on whether or not a wakeup event associated with
@@ -129,7 +129,7 @@ Description: · 3 unmodified lines
129129
130130 What: /sys/devices/.../power/wakeup_total_time_ms
131131 Date: September 2010
132−Contact: Rafael J. Wysocki <rjw@sisk.pl>
132+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
133133 Description:
134134 The /sys/devices/.../wakeup_total_time_ms attribute contains
135135 the total time of processing wakeup events associated with the
@@ -139,7 +139,7 @@ Description: · 3 unmodified lines
139139
140140 What: /sys/devices/.../power/wakeup_max_time_ms
141141 Date: September 2010
142−Contact: Rafael J. Wysocki <rjw@sisk.pl>
142+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
143143 Description:
144144 The /sys/devices/.../wakeup_max_time_ms attribute contains
145145 the maximum time of processing a single wakeup event associated
@@ -149,7 +149,7 @@ Description: · 3 unmodified lines
149149
150150 What: /sys/devices/.../power/wakeup_last_time_ms
151151 Date: September 2010
152−Contact: Rafael J. Wysocki <rjw@sisk.pl>
152+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
153153 Description:
154154 The /sys/devices/.../wakeup_last_time_ms attribute contains
155155 the value of the monotonic clock corresponding to the time of
@@ -160,7 +160,7 @@ Description: · 4 unmodified lines
160160
161161 What: /sys/devices/.../power/wakeup_prevent_sleep_time_ms
162162 Date: February 2012
163−Contact: Rafael J. Wysocki <rjw@sisk.pl>
163+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
164164 Description:
165165 The /sys/devices/.../wakeup_prevent_sleep_time_ms attribute
166166 contains the total time the device has been preventing
@@ -189,7 +189,7 @@ Description: · 22 unmodified lines
189189
190190 What: /sys/devices/.../power/pm_qos_latency_us
191191 Date: March 2012
192−Contact: Rafael J. Wysocki <rjw@sisk.pl>
192+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
193193 Description:
194194 The /sys/devices/.../power/pm_qos_resume_latency_us attribute
195195 contains the PM QoS resume latency limit for the given device,
@@ -207,7 +207,7 @@ Description: · 11 unmodified lines
207207
208208 What: /sys/devices/.../power/pm_qos_no_power_off
209209 Date: September 2012
210−Contact: Rafael J. Wysocki <rjw@sisk.pl>
210+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
211211 Description:
212212 The /sys/devices/.../power/pm_qos_no_power_off attribute
213213 is used for manipulating the PM QoS "no power off" flag. If
@@ -222,7 +222,7 @@ Description: · 8 unmodified lines
222222
223223 What: /sys/devices/.../power/pm_qos_remote_wakeup
224224 Date: September 2012
225−Contact: Rafael J. Wysocki <rjw@sisk.pl>
225+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
226226 Description:
227227 The /sys/devices/.../power/pm_qos_remote_wakeup attribute
228228 is used for manipulating the PM QoS "remote wakeup required"
Documentation/ABI/testing/sysfs-power+11−11
@@ -1,6 +1,6 @@
11 What: /sys/power/
22 Date: August 2006
3−Contact: Rafael J. Wysocki <rjw@sisk.pl>
3+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
44 Description:
55 The /sys/power directory will contain files that will
66 provide a unified interface to the power management
@@ -8,7 +8,7 @@ Description: · 1 unmodified line
88
99 What: /sys/power/state
1010 Date: August 2006
11−Contact: Rafael J. Wysocki <rjw@sisk.pl>
11+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
1212 Description:
1313 The /sys/power/state file controls the system power state.
1414 Reading from this file returns what states are supported,
@@ -22,7 +22,7 @@ Description: · 7 unmodified lines
2222
2323 What: /sys/power/disk
2424 Date: September 2006
25−Contact: Rafael J. Wysocki <rjw@sisk.pl>
25+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
2626 Description:
2727 The /sys/power/disk file controls the operating mode of the
2828 suspend-to-disk mechanism. Reading from this file returns
@@ -67,7 +67,7 @@ Description: · 38 unmodified lines
6767
6868 What: /sys/power/image_size
6969 Date: August 2006
70−Contact: Rafael J. Wysocki <rjw@sisk.pl>
70+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
7171 Description:
7272 The /sys/power/image_size file controls the size of the image
7373 created by the suspend-to-disk mechanism. It can be written a
@@ -84,7 +84,7 @@ Description: · 10 unmodified lines
8484
8585 What: /sys/power/pm_trace
8686 Date: August 2006
87−Contact: Rafael J. Wysocki <rjw@sisk.pl>
87+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
8888 Description:
8989 The /sys/power/pm_trace file controls the code which saves the
9090 last PM event point in the RTC across reboots, so that you can
@@ -133,7 +133,7 @@ Description: · 42 unmodified lines
133133
134134 What: /sys/power/pm_async
135135 Date: January 2009
136−Contact: Rafael J. Wysocki <rjw@sisk.pl>
136+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
137137 Description:
138138 The /sys/power/pm_async file controls the switch allowing the
139139 user space to enable or disable asynchronous suspend and resume
@@ -146,7 +146,7 @@ Description: · 6 unmodified lines
146146
147147 What: /sys/power/wakeup_count
148148 Date: July 2010
149−Contact: Rafael J. Wysocki <rjw@sisk.pl>
149+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
150150 Description:
151151 The /sys/power/wakeup_count file allows user space to put the
152152 system into a sleep state while taking into account the
@@ -161,7 +161,7 @@ Description: · 8 unmodified lines
161161
162162 What: /sys/power/reserved_size
163163 Date: May 2011
164−Contact: Rafael J. Wysocki <rjw@sisk.pl>
164+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
165165 Description:
166166 The /sys/power/reserved_size file allows user space to control
167167 the amount of memory reserved for allocations made by device
@@ -175,7 +175,7 @@ Description: · 7 unmodified lines
175175
176176 What: /sys/power/autosleep
177177 Date: April 2012
178−Contact: Rafael J. Wysocki <rjw@sisk.pl>
178+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
179179 Description:
180180 The /sys/power/autosleep file can be written one of the strings
181181 returned by reads from /sys/power/state. If that happens, a
@@ -192,7 +192,7 @@ Description: · 10 unmodified lines
192192
193193 What: /sys/power/wake_lock
194194 Date: February 2012
195−Contact: Rafael J. Wysocki <rjw@sisk.pl>
195+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
196196 Description:
197197 The /sys/power/wake_lock file allows user space to create
198198 wakeup source objects and activate them on demand (if one of
@@ -219,7 +219,7 @@ Description: · 20 unmodified lines
219219
220220 What: /sys/power/wake_unlock
221221 Date: February 2012
222−Contact: Rafael J. Wysocki <rjw@sisk.pl>
222+Contact: Rafael J. Wysocki <rjw@rjwysocki.net>
223223 Description:
224224 The /sys/power/wake_unlock file allows user space to deactivate
225225 wakeup sources created with the help of /sys/power/wake_lock.
Documentation/acpi/dsdt-override.txt+1−1
@@ -4,4 +4,4 @@ CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel. · 3 unmodified lines
44
55 When to use this method is described in detail on the
66 Linux/ACPI home page:
7−http://www.lesswatts.org/projects/acpi/overridingDSDT.php
7+https://01.org/linux-acpi/documentation/overriding-dsdt
Documentation/devicetree/bindings/memory.txt+0−168
@@ -1,168 +0,0 @@
1−*** Memory binding ***
2−
3−The /memory node provides basic information about the address and size
4−of the physical memory. This node is usually filled or updated by the
5−bootloader, depending on the actual memory configuration of the given
6−hardware.
7−
8−The memory layout is described by the following node:
9−
10−/ {
11− #address-cells = <(n)>;
12− #size-cells = <(m)>;
13− memory {
14− device_type = "memory";
15− reg = <(baseaddr1) (size1)
16− (baseaddr2) (size2)
17− ...
18− (baseaddrN) (sizeN)>;
19− };
20− ...
21−};
22−
23−A memory node follows the typical device tree rules for "reg" property:
24−n: number of cells used to store base address value
25−m: number of cells used to store size value
26−baseaddrX: defines a base address of the defined memory bank
27−sizeX: the size of the defined memory bank
28−
29−
30−More than one memory bank can be defined.
31−
32−
33−*** Reserved memory regions ***
34−
35−In /memory/reserved-memory node one can create child nodes describing
36−particular reserved (excluded from normal use) memory regions. Such
37−memory regions are usually designed for the special usage by various
38−device drivers. A good example are contiguous memory allocations or
39−memory sharing with other operating system on the same hardware board.
40−Those special memory regions might depend on the board configuration and
41−devices used on the target system.
42−
43−Parameters for each memory region can be encoded into the device tree
44−with the following convention:
45−
46−[(label):] (name) {
47− compatible = "linux,contiguous-memory-region", "reserved-memory-region";
48− reg = <(address) (size)>;
49− (linux,default-contiguous-region);
50−};
51−
52−compatible: one or more of:
53− - "linux,contiguous-memory-region" - enables binding of this
54− region to Contiguous Memory Allocator (special region for
55− contiguous memory allocations, shared with movable system
56− memory, Linux kernel-specific).
57− - "reserved-memory-region" - compatibility is defined, given
58− region is assigned for exclusive usage for by the respective
59− devices.
60−
61−reg: standard property defining the base address and size of
62− the memory region
63−
64−linux,default-contiguous-region: property indicating that the region
65− is the default region for all contiguous memory
66− allocations, Linux specific (optional)
67−
68−It is optional to specify the base address, so if one wants to use
69−autoconfiguration of the base address, '0' can be specified as a base
70−address in the 'reg' property.
71−
72−The /memory/reserved-memory node must contain the same #address-cells
73−and #size-cells value as the root node.
74−
75−
76−*** Device node's properties ***
77−
78−Once regions in the /memory/reserved-memory node have been defined, they
79−may be referenced by other device nodes. Bindings that wish to reference
80−memory regions should explicitly document their use of the following
81−property:
82−
83−memory-region = <&phandle_to_defined_region>;
84−
85−This property indicates that the device driver should use the memory
86−region pointed by the given phandle.
87−
88−
89−*** Example ***
90−
91−This example defines a memory consisting of 4 memory banks. 3 contiguous
92−regions are defined for Linux kernel, one default of all device drivers
93−(named contig_mem, placed at 0x72000000, 64MiB), one dedicated to the
94−framebuffer device (labelled display_mem, placed at 0x78000000, 8MiB)
95−and one for multimedia processing (labelled multimedia_mem, placed at
96−0x77000000, 64MiB). 'display_mem' region is then assigned to fb@12300000
97−device for DMA memory allocations (Linux kernel drivers will use CMA is
98−available or dma-exclusive usage otherwise). 'multimedia_mem' is
99−assigned to scaler@12500000 and codec@12600000 devices for contiguous
100−memory allocations when CMA driver is enabled.
101−
102−The reason for creating a separate region for framebuffer device is to
103−match the framebuffer base address to the one configured by bootloader,
104−so once Linux kernel drivers starts no glitches on the displayed boot
105−logo appears. Scaller and codec drivers should share the memory
106−allocations.
107−
108−/ {
109− #address-cells = <1>;
110− #size-cells = <1>;
111−
112− /* ... */
113−
114− memory {
115− reg = <0x40000000 0x10000000
116− 0x50000000 0x10000000
117− 0x60000000 0x10000000
118− 0x70000000 0x10000000>;
119−
120− reserved-memory {
121− #address-cells = <1>;
122− #size-cells = <1>;
123−
124− /*
125− * global autoconfigured region for contiguous allocations
126− * (used only with Contiguous Memory Allocator)
127− */
128− contig_region@0 {
129− compatible = "linux,contiguous-memory-region";
130− reg = <0x0 0x4000000>;
131− linux,default-contiguous-region;
132− };
133−
134− /*
135− * special region for framebuffer
136− */
137− display_region: region@78000000 {
138− compatible = "linux,contiguous-memory-region", "reserved-memory-region";
139− reg = <0x78000000 0x800000>;
140− };
141−
142− /*
143− * special region for multimedia processing devices
144− */
145− multimedia_region: region@77000000 {
146− compatible = "linux,contiguous-memory-region";
147− reg = <0x77000000 0x4000000>;
148− };
149− };
150− };
151−
152− /* ... */
153−
154− fb0: fb@12300000 {
155− status = "okay";
156− memory-region = <&display_region>;
157− };
158−
159− scaler: scaler@12500000 {
160− status = "okay";
161− memory-region = <&multimedia_region>;
162− };
163−
164− codec: codec@12600000 {
165− status = "okay";
166− memory-region = <&multimedia_region>;
167− };
168−};
Documentation/devicetree/bindings/mmc/tmio_mmc.txt+10−7
@@ -9,12 +9,15 @@ compulsory and any optional properties, common to all SD/MMC drivers, as · 8 unmodified lines
99 described in mmc.txt, can be used. Additionally the following tmio_mmc-specific
1010 optional bindings can be used.
1111
12+Required properties:
13+- compatible: "renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit
14+ "renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC
15+ "renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC
16+ "renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
17+ "renesas,sdhi-r8a7740" - SDHI IP on R8A7740 SoC
18+ "renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC
19+ "renesas,sdhi-r8a7779" - SDHI IP on R8A7779 SoC
20+ "renesas,sdhi-r8a7790" - SDHI IP on R8A7790 SoC
21+
1222 Optional properties:
1323 - toshiba,mmc-wrprotect-disable: write-protect detection is unavailable
14−
15−When used with Renesas SDHI hardware, the following compatibility strings
16−configure various model-specific properties:
17−
18−"renesas,sh7372-sdhi": (default) compatible with SH7372
19−"renesas,r8a7740-sdhi": compatible with R8A7740: certain MMC/SD commands have to
20− wait for the interface to become idle.
Documentation/sound/alsa/HD-Audio-Models.txt+1−0
@@ -28,6 +28,7 @@ ALC269/270/275/276/28x/29x · 27 unmodified lines
2828 alc269-dmic Enable ALC269(VA) digital mic workaround
2929 alc271-dmic Enable ALC271X digital mic workaround
3030 inv-dmic Inverted internal mic workaround
31+ headset-mic Indicates a combined headset (headphone+mic) jack
3132 lenovo-dock Enables docking station I/O for some Lenovos
3233 dell-headset-multi Headset jack, which can also be used as mic-in
3334 dell-headset-dock Headset jack (without mic-in), and also dock I/O
MAINTAINERS+40−14
@@ -237,11 +237,11 @@ F: drivers/platform/x86/acer-wmi.c · 236 unmodified lines
237237
238238 ACPI
239239 M: Len Brown <lenb@kernel.org>
240−M: Rafael J. Wysocki <rjw@sisk.pl>
240+M: Rafael J. Wysocki <rjw@rjwysocki.net>
241241 L: linux-acpi@vger.kernel.org
242−W: http://www.lesswatts.org/projects/acpi/
243−Q: http://patchwork.kernel.org/project/linux-acpi/list/
244−T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
242+W: https://01.org/linux-acpi
243+Q: https://patchwork.kernel.org/project/linux-acpi/list/
244+T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
245245 S: Supported
246246 F: drivers/acpi/
247247 F: drivers/pnp/pnpacpi/
@@ -256,21 +256,21 @@ F: drivers/pci/*/*/*acpi* · 8 unmodified lines
256256 ACPI FAN DRIVER
257257 M: Zhang Rui <rui.zhang@intel.com>
258258 L: linux-acpi@vger.kernel.org
259−W: http://www.lesswatts.org/projects/acpi/
259+W: https://01.org/linux-acpi
260260 S: Supported
261261 F: drivers/acpi/fan.c
262262
263263 ACPI THERMAL DRIVER
264264 M: Zhang Rui <rui.zhang@intel.com>
265265 L: linux-acpi@vger.kernel.org
266−W: http://www.lesswatts.org/projects/acpi/
266+W: https://01.org/linux-acpi
267267 S: Supported
268268 F: drivers/acpi/*thermal*
269269
270270 ACPI VIDEO DRIVER
271271 M: Zhang Rui <rui.zhang@intel.com>
272272 L: linux-acpi@vger.kernel.org
273−W: http://www.lesswatts.org/projects/acpi/
273+W: https://01.org/linux-acpi
274274 S: Supported
275275 F: drivers/acpi/video.c
276276
@@ -824,15 +824,21 @@ S: Maintained · 547 unmodified lines
824824 F: arch/arm/mach-gemini/
825825
826826 ARM/CSR SIRFPRIMA2 MACHINE SUPPORT
827−M: Barry Song <baohua.song@csr.com>
827+M: Barry Song <baohua@kernel.org>
828828 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
829829 T: git git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux.git
830830 S: Maintained
831831 F: arch/arm/mach-prima2/
832+F: drivers/clk/clk-prima2.c
833+F: drivers/clocksource/timer-prima2.c
834+F: drivers/clocksource/timer-marco.c
832835 F: drivers/dma/sirf-dma.c
833836 F: drivers/i2c/busses/i2c-sirf.c
837+F: drivers/input/misc/sirfsoc-onkey.c
838+F: drivers/irqchip/irq-sirfsoc.c
834839 F: drivers/mmc/host/sdhci-sirf.c
835840 F: drivers/pinctrl/sirf/
841+F: drivers/rtc/rtc-sirfsoc.c
836842 F: drivers/spi/spi-sirf.c
837843
838844 ARM/EBSA110 MACHINE SUPPORT
@@ -2295,7 +2301,7 @@ S: Maintained · 1456 unmodified lines
22952301 F: drivers/net/ethernet/ti/cpmac.c
22962302
22972303 CPU FREQUENCY DRIVERS
2298−M: Rafael J. Wysocki <rjw@sisk.pl>
2304+M: Rafael J. Wysocki <rjw@rjwysocki.net>
22992305 M: Viresh Kumar <viresh.kumar@linaro.org>
23002306 L: cpufreq@vger.kernel.org
23012307 L: linux-pm@vger.kernel.org
@@ -2326,7 +2332,7 @@ S: Maintained · 24 unmodified lines
23262332 F: drivers/cpuidle/cpuidle-big_little.c
23272333
23282334 CPUIDLE DRIVERS
2329−M: Rafael J. Wysocki <rjw@sisk.pl>
2335+M: Rafael J. Wysocki <rjw@rjwysocki.net>
23302336 M: Daniel Lezcano <daniel.lezcano@linaro.org>
23312337 L: linux-pm@vger.kernel.org
23322338 S: Maintained
@@ -3548,7 +3554,7 @@ F: fs/freevxfs/ · 1215 unmodified lines
35483554
35493555 FREEZER
35503556 M: Pavel Machek <pavel@ucw.cz>
3551−M: "Rafael J. Wysocki" <rjw@sisk.pl>
3557+M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
35523558 L: linux-pm@vger.kernel.org
35533559 S: Supported
35543560 F: Documentation/power/freezing-of-tasks.txt
@@ -3619,6 +3625,12 @@ L: linux-scsi@vger.kernel.org · 64 unmodified lines
36193625 S: Odd Fixes (e.g., new signatures)
36203626 F: drivers/scsi/fdomain.*
36213627
3628+GCOV BASED KERNEL PROFILING
3629+M: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
3630+S: Maintained
3631+F: kernel/gcov/
3632+F: Documentation/gcov.txt
3633+
36223634 GDT SCSI DISK ARRAY CONTROLLER DRIVER
36233635 M: Achim Leubner <achim_leubner@adaptec.com>
36243636 L: linux-scsi@vger.kernel.org
@@ -3884,7 +3896,7 @@ F: drivers/video/hgafb.c · 259 unmodified lines
38843896
38853897 HIBERNATION (aka Software Suspend, aka swsusp)
38863898 M: Pavel Machek <pavel@ucw.cz>
3887−M: "Rafael J. Wysocki" <rjw@sisk.pl>
3899+M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
38883900 L: linux-pm@vger.kernel.org
38893901 S: Supported
38903902 F: arch/x86/power/
@@ -4334,7 +4346,7 @@ F: drivers/video/i810/ · 443 unmodified lines
43344346 INTEL MENLOW THERMAL DRIVER
43354347 M: Sujith Thomas <sujith.thomas@intel.com>
43364348 L: platform-driver-x86@vger.kernel.org
4337−W: http://www.lesswatts.org/projects/acpi/
4349+W: https://01.org/linux-acpi
43384350 S: Supported
43394351 F: drivers/platform/x86/intel_menlow.c
43404352
@@ -4471,6 +4483,13 @@ L: linux-serial@vger.kernel.org · 130 unmodified lines
44714483 S: Maintained
44724484 F: drivers/tty/serial/ioc3_serial.c
44734485
4486+IOMMU DRIVERS
4487+M: Joerg Roedel <joro@8bytes.org>
4488+L: iommu@lists.linux-foundation.org
4489+T: git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
4490+S: Maintained
4491+F: drivers/iommu/
4492+
44744493 IP MASQUERADING
44754494 M: Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
44764495 S: Maintained
@@ -7812,6 +7831,13 @@ F: Documentation/sound/alsa/soc/ · 3335 unmodified lines
78127831 F: sound/soc/
78137832 F: include/sound/soc*
78147833
7834+SOUND - DMAENGINE HELPERS
7835+M: Lars-Peter Clausen <lars@metafoo.de>
7836+S: Supported
7837+F: include/sound/dmaengine_pcm.h
7838+F: sound/core/pcm_dmaengine.c
7839+F: sound/soc/soc-generic-dmaengine-pcm.c
7840+
78157841 SPARC + UltraSPARC (sparc/sparc64)
78167842 M: "David S. Miller" <davem@davemloft.net>
78177843 L: sparclinux@vger.kernel.org
@@ -8091,7 +8117,7 @@ F: drivers/sh/ · 273 unmodified lines
80918117 SUSPEND TO RAM
80928118 M: Len Brown <len.brown@intel.com>
80938119 M: Pavel Machek <pavel@ucw.cz>
8094−M: "Rafael J. Wysocki" <rjw@sisk.pl>
8120+M: "Rafael J. Wysocki" <rjw@rjwysocki.net>
80958121 L: linux-pm@vger.kernel.org
80968122 S: Supported
80978123 F: Documentation/power/
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 12
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc3
4+EXTRAVERSION = -rc6
55 NAME = One Giant Leap for Frogkind
66
77 # *DOCUMENTATION*
arch/arc/kernel/ptrace.c+1−1
@@ -102,7 +102,7 @@ static int genregs_set(struct task_struct *target, · 101 unmodified lines
102102 REG_IGNORE_ONE(pad2);
103103 REG_IN_CHUNK(callee, efa, cregs); /* callee_regs[r25..r13] */
104104 REG_IGNORE_ONE(efa); /* efa update invalid */
105− REG_IN_ONE(stop_pc, &ptregs->ret); /* stop_pc: PC update */
105+ REG_IGNORE_ONE(stop_pc); /* PC updated via @ret */
106106
107107 return ret;
108108 }
arch/arc/kernel/signal.c+13−12
@@ -101,7 +101,6 @@ SYSCALL_DEFINE0(rt_sigreturn) · 100 unmodified lines
101101 {
102102 struct rt_sigframe __user *sf;
103103 unsigned int magic;
104− int err;
105104 struct pt_regs *regs = current_pt_regs();
106105
107106 /* Always make any pending restarted system calls return -EINTR */
@@ -119,15 +118,16 @@ SYSCALL_DEFINE0(rt_sigreturn) · 11 unmodified lines
119118 if (!access_ok(VERIFY_READ, sf, sizeof(*sf)))
120119 goto badframe;
121120
122− err = restore_usr_regs(regs, sf);
123− err |= __get_user(magic, &sf->sigret_magic);
124− if (err)
121+ if (__get_user(magic, &sf->sigret_magic))
125122 goto badframe;
126123
127124 if (unlikely(is_do_ss_needed(magic)))
128125 if (restore_altstack(&sf->uc.uc_stack))
129126 goto badframe;
130127
128+ if (restore_usr_regs(regs, sf))
129+ goto badframe;
130+
131131 /* Don't restart from sigreturn */
132132 syscall_wont_restart(regs);
133133
@@ -190,6 +190,15 @@ setup_rt_frame(int signo, struct k_sigaction *ka, siginfo_t *info, · 56 unmodified lines
190190 if (!sf)
191191 return 1;
192192
193+ /*
194+ * w/o SA_SIGINFO, struct ucontext is partially populated (only
195+ * uc_mcontext/uc_sigmask) for kernel's normal user state preservation
196+ * during signal handler execution. This works for SA_SIGINFO as well
197+ * although the semantics are now overloaded (the same reg state can be
198+ * inspected by userland: but are they allowed to fiddle with it ?
199+ */
200+ err |= stash_usr_regs(sf, regs, set);
201+
193202 /*
194203 * SA_SIGINFO requires 3 args to signal handler:
195204 * #1: sig-no (common to any handler)
@@ -213,14 +222,6 @@ setup_rt_frame(int signo, struct k_sigaction *ka, siginfo_t *info, · 17 unmodified lines
213222 magic = MAGIC_SIGALTSTK;
214223 }
215224
216− /*
217− * w/o SA_SIGINFO, struct ucontext is partially populated (only
218− * uc_mcontext/uc_sigmask) for kernel's normal user state preservation
219− * during signal handler execution. This works for SA_SIGINFO as well
220− * although the semantics are now overloaded (the same reg state can be
221− * inspected by userland: but are they allowed to fiddle with it ?
222− */
223− err |= stash_usr_regs(sf, regs, set);
224225 err |= __put_user(magic, &sf->sigret_magic);
225226 if (err)
226227 return err;
arch/arm/Makefile+7−2
@@ -296,10 +296,15 @@ archprepare: · 295 unmodified lines
296296 # Convert bzImage to zImage
297297 bzImage: zImage
298298
299−zImage Image xipImage bootpImage uImage: vmlinux
299+BOOT_TARGETS = zImage Image xipImage bootpImage uImage
300+INSTALL_TARGETS = zinstall uinstall install
301+
302+PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
303+
304+$(BOOT_TARGETS): vmlinux
300305 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
301306
302−zinstall uinstall install: vmlinux
307+$(INSTALL_TARGETS):
303308 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
304309
305310 %.dtb: | scripts
arch/arm/boot/Makefile+8−8
@@ -95,24 +95,24 @@ initrd: · 94 unmodified lines
9595 @test "$(INITRD)" != "" || \
9696 (echo You must specify INITRD; exit -1)
9797
98−install: $(obj)/Image
99− $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
98+install:
99+ $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
100100 $(obj)/Image System.map "$(INSTALL_PATH)"
101101
102−zinstall: $(obj)/zImage
103− $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
102+zinstall:
103+ $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
104104 $(obj)/zImage System.map "$(INSTALL_PATH)"
105105
106−uinstall: $(obj)/uImage
107− $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
106+uinstall:
107+ $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
108108 $(obj)/uImage System.map "$(INSTALL_PATH)"
109109
110110 zi:
111− $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
111+ $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
112112 $(obj)/zImage System.map "$(INSTALL_PATH)"
113113
114114 i:
115− $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
115+ $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
116116 $(obj)/Image System.map "$(INSTALL_PATH)"
117117
118118 subdir- := bootp compressed dts
arch/arm/boot/dts/Makefile+2−0
@@ -41,6 +41,8 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d33ek.dtb · 40 unmodified lines
4141 dtb-$(CONFIG_ARCH_AT91) += sama5d34ek.dtb
4242 dtb-$(CONFIG_ARCH_AT91) += sama5d35ek.dtb
4343
44+dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb
45+
4446 dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
4547 dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb \
4648 bcm28155-ap.dtb
arch/arm/boot/dts/armada-370-netgear-rn102.dts+32−17
@@ -27,6 +27,25 @@ · 26 unmodified lines
2727 };
2828
2929 soc {
30+ ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
31+ MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
32+
33+ pcie-controller {
34+ status = "okay";
35+
36+ /* Connected to Marvell SATA controller */
37+ pcie@1,0 {
38+ /* Port 0, Lane 0 */
39+ status = "okay";
40+ };
41+
42+ /* Connected to FL1009 USB 3.0 controller */
43+ pcie@2,0 {
44+ /* Port 1, Lane 0 */
45+ status = "okay";
46+ };
47+ };
48+
3049 internal-regs {
3150 serial@12000 {
3251 clock-frequency = <200000000>;
@@ -57,6 +76,11 @@ · 24 unmodified lines
5776 marvell,pins = "mpp56";
5877 marvell,function = "gpio";
5978 };
79+
80+ poweroff: poweroff {
81+ marvell,pins = "mpp8";
82+ marvell,function = "gpio";
83+ };
6084 };
6185
6286 mdio {
@@ -89,22 +113,6 @@ · 26 unmodified lines
89113 pwm_polarity = <0>;
90114 };
91115 };
92−
93− pcie-controller {
94− status = "okay";
95−
96− /* Connected to Marvell SATA controller */
97− pcie@1,0 {
98− /* Port 0, Lane 0 */
99− status = "okay";
100− };
101−
102− /* Connected to FL1009 USB 3.0 controller */
103− pcie@2,0 {
104− /* Port 1, Lane 0 */
105− status = "okay";
106− };
107− };
108116 };
109117 };
110118
@@ -160,7 +168,7 @@ · 49 unmodified lines
160168 button@1 {
161169 label = "Power Button";
162170 linux,code = <116>; /* KEY_POWER */
163− gpios = <&gpio1 30 1>;
171+ gpios = <&gpio1 30 0>;
164172 };
165173
166174 button@2 {
@@ -176,4 +184,11 @@ · 9 unmodified lines
176184 };
177185 };
178186
187+ gpio_poweroff {
188+ compatible = "gpio-poweroff";
189+ pinctrl-0 = <&poweroff>;
190+ pinctrl-names = "default";
191+ gpios = <&gpio0 8 1>;
192+ };
193+
179194 };
arch/arm/boot/dts/armada-xp.dtsi+11−0
@@ -70,6 +70,8 @@ · 69 unmodified lines
7070
7171 timer@20300 {
7272 compatible = "marvell,armada-xp-timer";
73+ clocks = <&coreclk 2>, <&refclk>;
74+ clock-names = "nbclk", "fixed";
7375 };
7476
7577 coreclk: mvebu-sar@18230 {
@@ -169,4 +171,13 @@ · 93 unmodified lines
169171 };
170172 };
171173 };
174+
175+ clocks {
176+ /* 25 MHz reference crystal */
177+ refclk: oscillator {
178+ compatible = "fixed-clock";
179+ #clock-cells = <0>;
180+ clock-frequency = <25000000>;
181+ };
182+ };
172183 };
arch/arm/boot/dts/at91sam9x5.dtsi+4−2
@@ -190,12 +190,12 @@ · 189 unmodified lines
190190 AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA8 periph A */
191191 };
192192
193− pinctrl_uart2_rts: uart2_rts-0 {
193+ pinctrl_usart2_rts: usart2_rts-0 {
194194 atmel,pins =
195195 <AT91_PIOB 0 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB0 periph B */
196196 };
197197
198− pinctrl_uart2_cts: uart2_cts-0 {
198+ pinctrl_usart2_cts: usart2_cts-0 {
199199 atmel,pins =
200200 <AT91_PIOB 1 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB1 periph B */
201201 };
@@ -556,6 +556,7 @@ · 354 unmodified lines
556556 interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
557557 dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(0)>;
558558 dma-names = "rxtx";
559+ pinctrl-names = "default";
559560 #address-cells = <1>;
560561 #size-cells = <0>;
561562 status = "disabled";
@@ -567,6 +568,7 @@ · 5 unmodified lines
567568 interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
568569 dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(0)>;
569570 dma-names = "rxtx";
571+ pinctrl-names = "default";
570572 #address-cells = <1>;
571573 #size-cells = <0>;
572574 status = "disabled";
arch/arm/boot/dts/atlas6.dtsi+12−0
@@ -181,6 +181,8 @@ · 180 unmodified lines
181181 interrupts = <17>;
182182 fifosize = <128>;
183183 clocks = <&clks 13>;
184+ sirf,uart-dma-rx-channel = <21>;
185+ sirf,uart-dma-tx-channel = <2>;
184186 };
185187
186188 uart1: uart@b0060000 {
@@ -199,6 +201,8 @@ · 12 unmodified lines
199201 interrupts = <19>;
200202 fifosize = <128>;
201203 clocks = <&clks 15>;
204+ sirf,uart-dma-rx-channel = <6>;
205+ sirf,uart-dma-tx-channel = <7>;
202206 };
203207
204208 usp0: usp@b0080000 {
@@ -206,7 +210,10 @@ · 1 unmodified line
206210 compatible = "sirf,prima2-usp";
207211 reg = <0xb0080000 0x10000>;
208212 interrupts = <20>;
213+ fifosize = <128>;
209214 clocks = <&clks 28>;
215+ sirf,usp-dma-rx-channel = <17>;
216+ sirf,usp-dma-tx-channel = <18>;
210217 };
211218
212219 usp1: usp@b0090000 {
@@ -214,7 +221,10 @@ · 1 unmodified line
214221 compatible = "sirf,prima2-usp";
215222 reg = <0xb0090000 0x10000>;
216223 interrupts = <21>;
224+ fifosize = <128>;
217225 clocks = <&clks 29>;
226+ sirf,usp-dma-rx-channel = <14>;
227+ sirf,usp-dma-tx-channel = <15>;
218228 };
219229
220230 dmac0: dma-controller@b00b0000 {
@@ -237,6 +247,8 @@ · 16 unmodified lines
237247 compatible = "sirf,prima2-vip";
238248 reg = <0xb00C0000 0x10000>;
239249 clocks = <&clks 31>;
250+ interrupts = <14>;
251+ sirf,vip-dma-rx-channel = <16>;
240252 };
241253
242254 spi0: spi@b00d0000 {
arch/arm/boot/dts/exynos5250.dtsi+5−0
@@ -96,6 +96,11 @@ · 95 unmodified lines
9696 <1 14 0xf08>,
9797 <1 11 0xf08>,
9898 <1 10 0xf08>;
99+ /* Unfortunately we need this since some versions of U-Boot
100+ * on Exynos don't set the CNTFRQ register, so we need the
101+ * value from DT.
102+ */
103+ clock-frequency = <24000000>;
99104 };
100105
101106 mct@101C0000 {
arch/arm/boot/dts/kirkwood.dtsi+2−1
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 cpu@0 {
1414 device_type = "cpu";
1515 compatible = "marvell,feroceon";
16+ reg = <0>;
1617 clocks = <&core_clk 1>, <&core_clk 3>, <&gate_clk 11>;
1718 clock-names = "cpu_clk", "ddrclk", "powersave";
1819 };
@@ -167,7 +168,7 @@ · 148 unmodified lines
167168 xor@60900 {
168169 compatible = "marvell,orion-xor";
169170 reg = <0x60900 0x100
170− 0xd0B00 0x100>;
171+ 0x60B00 0x100>;
171172 status = "okay";
172173 clocks = <&gate_clk 16>;
173174
arch/arm/boot/dts/omap3-beagle-xm.dts+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111
1212 / {
1313 model = "TI OMAP3 BeagleBoard xM";
14− compatible = "ti,omap3-beagle-xm", "ti,omap3-beagle", "ti,omap3";
14+ compatible = "ti,omap3-beagle-xm", "ti,omap36xx", "ti,omap3";
1515
1616 cpus {
1717 cpu@0 {
arch/arm/boot/dts/omap3.dtsi+2−2
@@ -108,7 +108,7 @@ · 107 unmodified lines
108108 #address-cells = <1>;
109109 #size-cells = <0>;
110110 pinctrl-single,register-width = <16>;
111− pinctrl-single,function-mask = <0x7f1f>;
111+ pinctrl-single,function-mask = <0xff1f>;
112112 };
113113
114114 omap3_pmx_wkup: pinmux@0x48002a00 {
@@ -117,7 +117,7 @@ · 2 unmodified lines
117117 #address-cells = <1>;
118118 #size-cells = <0>;
119119 pinctrl-single,register-width = <16>;
120− pinctrl-single,function-mask = <0x7f1f>;
120+ pinctrl-single,function-mask = <0xff1f>;
121121 };
122122
123123 gpio1: gpio@48310000 {
arch/arm/boot/dts/prima2.dtsi+23−4
@@ -171,7 +171,8 @@ · 170 unmodified lines
171171 compatible = "simple-bus";
172172 #address-cells = <1>;
173173 #size-cells = <1>;
174− ranges = <0xb0000000 0xb0000000 0x180000>;
174+ ranges = <0xb0000000 0xb0000000 0x180000>,
175+ <0x56000000 0x56000000 0x1b00000>;
175176
176177 timer@b0020000 {
177178 compatible = "sirf,prima2-tick";
@@ -196,25 +197,32 @@ · 18 unmodified lines
196197 uart0: uart@b0050000 {
197198 cell-index = <0>;
198199 compatible = "sirf,prima2-uart";
199− reg = <0xb0050000 0x10000>;
200+ reg = <0xb0050000 0x1000>;
200201 interrupts = <17>;
202+ fifosize = <128>;
201203 clocks = <&clks 13>;
204+ sirf,uart-dma-rx-channel = <21>;
205+ sirf,uart-dma-tx-channel = <2>;
202206 };
203207
204208 uart1: uart@b0060000 {
205209 cell-index = <1>;
206210 compatible = "sirf,prima2-uart";
207− reg = <0xb0060000 0x10000>;
211+ reg = <0xb0060000 0x1000>;
208212 interrupts = <18>;
213+ fifosize = <32>;
209214 clocks = <&clks 14>;
210215 };
211216
212217 uart2: uart@b0070000 {
213218 cell-index = <2>;
214219 compatible = "sirf,prima2-uart";
215− reg = <0xb0070000 0x10000>;
220+ reg = <0xb0070000 0x1000>;
216221 interrupts = <19>;
222+ fifosize = <128>;
217223 clocks = <&clks 15>;
224+ sirf,uart-dma-rx-channel = <6>;
225+ sirf,uart-dma-tx-channel = <7>;
218226 };
219227
220228 usp0: usp@b0080000 {
@@ -222,7 +230,10 @@ · 1 unmodified line
222230 compatible = "sirf,prima2-usp";
223231 reg = <0xb0080000 0x10000>;
224232 interrupts = <20>;
233+ fifosize = <128>;
225234 clocks = <&clks 28>;
235+ sirf,usp-dma-rx-channel = <17>;
236+ sirf,usp-dma-tx-channel = <18>;
226237 };
227238
228239 usp1: usp@b0090000 {
@@ -230,7 +241,10 @@ · 1 unmodified line
230241 compatible = "sirf,prima2-usp";
231242 reg = <0xb0090000 0x10000>;
232243 interrupts = <21>;
244+ fifosize = <128>;
233245 clocks = <&clks 29>;
246+ sirf,usp-dma-rx-channel = <14>;
247+ sirf,usp-dma-tx-channel = <15>;
234248 };
235249
236250 usp2: usp@b00a0000 {
@@ -238,7 +252,10 @@ · 1 unmodified line
238252 compatible = "sirf,prima2-usp";
239253 reg = <0xb00a0000 0x10000>;
240254 interrupts = <22>;
255+ fifosize = <128>;
241256 clocks = <&clks 30>;
257+ sirf,usp-dma-rx-channel = <10>;
258+ sirf,usp-dma-tx-channel = <11>;
242259 };
243260
244261 dmac0: dma-controller@b00b0000 {
@@ -261,6 +278,8 @@ · 16 unmodified lines
261278 compatible = "sirf,prima2-vip";
262279 reg = <0xb00C0000 0x10000>;
263280 clocks = <&clks 31>;
281+ interrupts = <14>;
282+ sirf,vip-dma-rx-channel = <16>;
264283 };
265284
266285 spi0: spi@b00d0000 {
arch/arm/boot/dts/r8a73a4.dtsi+3−3
@@ -193,7 +193,7 @@ · 192 unmodified lines
193193 };
194194
195195 sdhi0: sdhi@ee100000 {
196− compatible = "renesas,r8a73a4-sdhi";
196+ compatible = "renesas,sdhi-r8a73a4";
197197 reg = <0 0xee100000 0 0x100>;
198198 interrupt-parent = <&gic>;
199199 interrupts = <0 165 4>;
@@ -202,7 +202,7 @@ · 2 unmodified lines
202202 };
203203
204204 sdhi1: sdhi@ee120000 {
205− compatible = "renesas,r8a73a4-sdhi";
205+ compatible = "renesas,sdhi-r8a73a4";
206206 reg = <0 0xee120000 0 0x100>;
207207 interrupt-parent = <&gic>;
208208 interrupts = <0 166 4>;
@@ -211,7 +211,7 @@ · 2 unmodified lines
211211 };
212212
213213 sdhi2: sdhi@ee140000 {
214− compatible = "renesas,r8a73a4-sdhi";
214+ compatible = "renesas,sdhi-r8a73a4";
215215 reg = <0 0xee140000 0 0x100>;
216216 interrupt-parent = <&gic>;
217217 interrupts = <0 167 4>;
arch/arm/boot/dts/r8a7778.dtsi+0−1
@@ -96,6 +96,5 @@ · 95 unmodified lines
9696 pfc: pfc@fffc0000 {
9797 compatible = "renesas,pfc-r8a7778";
9898 reg = <0xfffc000 0x118>;
99− #gpio-range-cells = <3>;
10099 };
101100 };
arch/arm/boot/dts/r8a7779.dtsi+0−1
@@ -188,7 +188,6 @@ · 187 unmodified lines
188188 pfc: pfc@fffc0000 {
189189 compatible = "renesas,pfc-r8a7779";
190190 reg = <0xfffc0000 0x23c>;
191− #gpio-range-cells = <3>;
192191 };
193192
194193 thermal@ffc48000 {
arch/arm/boot/dts/r8a7790.dtsi+4−5
@@ -148,11 +148,10 @@ · 147 unmodified lines
148148 pfc: pfc@e6060000 {
149149 compatible = "renesas,pfc-r8a7790";
150150 reg = <0 0xe6060000 0 0x250>;
151− #gpio-range-cells = <3>;
152151 };
153152
154153 sdhi0: sdhi@ee100000 {
155− compatible = "renesas,r8a7790-sdhi";
154+ compatible = "renesas,sdhi-r8a7790";
156155 reg = <0 0xee100000 0 0x100>;
157156 interrupt-parent = <&gic>;
158157 interrupts = <0 165 4>;
@@ -161,7 +160,7 @@ · 2 unmodified lines
161160 };
162161
163162 sdhi1: sdhi@ee120000 {
164− compatible = "renesas,r8a7790-sdhi";
163+ compatible = "renesas,sdhi-r8a7790";
165164 reg = <0 0xee120000 0 0x100>;
166165 interrupt-parent = <&gic>;
167166 interrupts = <0 166 4>;
@@ -170,7 +169,7 @@ · 2 unmodified lines
170169 };
171170
172171 sdhi2: sdhi@ee140000 {
173− compatible = "renesas,r8a7790-sdhi";
172+ compatible = "renesas,sdhi-r8a7790";
174173 reg = <0 0xee140000 0 0x100>;
175174 interrupt-parent = <&gic>;
176175 interrupts = <0 167 4>;
@@ -179,7 +178,7 @@ · 2 unmodified lines
179178 };
180179
181180 sdhi3: sdhi@ee160000 {
182− compatible = "renesas,r8a7790-sdhi";
181+ compatible = "renesas,sdhi-r8a7790";
183182 reg = <0 0xee160000 0 0x100>;
184183 interrupt-parent = <&gic>;
185184 interrupts = <0 168 4>;
arch/arm/boot/dts/sh73a0.dtsi+3−3
@@ -196,7 +196,7 @@ · 195 unmodified lines
196196 };
197197
198198 sdhi0: sdhi@ee100000 {
199− compatible = "renesas,r8a7740-sdhi";
199+ compatible = "renesas,sdhi-r8a7740";
200200 reg = <0xee100000 0x100>;
201201 interrupt-parent = <&gic>;
202202 interrupts = <0 83 4
@@ -208,7 +208,7 @@ · 5 unmodified lines
208208
209209 /* SDHI1 and SDHI2 have no CD pins, no need for CD IRQ */
210210 sdhi1: sdhi@ee120000 {
211− compatible = "renesas,r8a7740-sdhi";
211+ compatible = "renesas,sdhi-r8a7740";
212212 reg = <0xee120000 0x100>;
213213 interrupt-parent = <&gic>;
214214 interrupts = <0 88 4
@@ -219,7 +219,7 @@ · 4 unmodified lines
219219 };
220220
221221 sdhi2: sdhi@ee140000 {
222− compatible = "renesas,r8a7740-sdhi";
222+ compatible = "renesas,sdhi-r8a7740";
223223 reg = <0xee140000 0x100>;
224224 interrupt-parent = <&gic>;
225225 interrupts = <0 104 4
arch/arm/boot/install.sh+14−0
@@ -20,6 +20,20 @@ · 19 unmodified lines
2020 # $4 - default install path (blank if root directory)
2121 #
2222
23+verify () {
24+ if [ ! -f "$1" ]; then
25+ echo "" 1>&2
26+ echo " *** Missing file: $1" 1>&2
27+ echo ' *** You need to run "make" before "make install".' 1>&2
28+ echo "" 1>&2
29+ exit 1
30+ fi
31+}
32+
33+# Make sure the files actually exist
34+verify "$2"
35+verify "$3"
36+
2337 # User may have a custom install script
2438 if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
2539 if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
arch/arm/common/edma.c+31−7
@@ -269,6 +269,11 @@ static const struct edmacc_param dummy_paramset = { · 268 unmodified lines
269269 .ccnt = 1,
270270 };
271271
272+static const struct of_device_id edma_of_ids[] = {
273+ { .compatible = "ti,edma3", },
274+ {}
275+};
276+
272277 /*****************************************************************************/
273278
274279 static void map_dmach_queue(unsigned ctlr, unsigned ch_no,
@@ -560,14 +565,38 @@ static int reserve_contiguous_slots(int ctlr, unsigned int id, · 285 unmodified lines
560565 static int prepare_unused_channel_list(struct device *dev, void *data)
561566 {
562567 struct platform_device *pdev = to_platform_device(dev);
563− int i, ctlr;
568+ int i, count, ctlr;
569+ struct of_phandle_args dma_spec;
564570
571+ if (dev->of_node) {
572+ count = of_property_count_strings(dev->of_node, "dma-names");
573+ if (count < 0)
574+ return 0;
575+ for (i = 0; i < count; i++) {
576+ if (of_parse_phandle_with_args(dev->of_node, "dmas",
577+ "#dma-cells", i,
578+ &dma_spec))
579+ continue;
580+
581+ if (!of_match_node(edma_of_ids, dma_spec.np)) {
582+ of_node_put(dma_spec.np);
583+ continue;
584+ }
585+
586+ clear_bit(EDMA_CHAN_SLOT(dma_spec.args[0]),
587+ edma_cc[0]->edma_unused);
588+ of_node_put(dma_spec.np);
589+ }
590+ return 0;
591+ }
592+
593+ /* For non-OF case */
565594 for (i = 0; i < pdev->num_resources; i++) {
566595 if ((pdev->resource[i].flags & IORESOURCE_DMA) &&
567596 (int)pdev->resource[i].start >= 0) {
568597 ctlr = EDMA_CTLR(pdev->resource[i].start);
569598 clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start),
570− edma_cc[ctlr]->edma_unused);
599+ edma_cc[ctlr]->edma_unused);
571600 }
572601 }
573602
@@ -1762,11 +1791,6 @@ static int edma_probe(struct platform_device *pdev) · 1188 unmodified lines
17621791 return 0;
17631792 }
17641793
1765−static const struct of_device_id edma_of_ids[] = {
1766− { .compatible = "ti,edma3", },
1767− {}
1768−};
1769−
17701794 static struct platform_driver edma_driver = {
17711795 .driver = {
17721796 .name = "edma",
arch/arm/common/mcpm_entry.c+4−2
@@ -51,7 +51,8 @@ void mcpm_cpu_power_down(void) · 50 unmodified lines
5151 {
5252 phys_reset_t phys_reset;
5353
54− BUG_ON(!platform_ops);
54+ if (WARN_ON_ONCE(!platform_ops || !platform_ops->power_down))
55+ return;
5556 BUG_ON(!irqs_disabled());
5657
5758 /*
@@ -93,7 +94,8 @@ void mcpm_cpu_suspend(u64 expected_residency) · 35 unmodified lines
9394 {
9495 phys_reset_t phys_reset;
9596
96− BUG_ON(!platform_ops);
97+ if (WARN_ON_ONCE(!platform_ops || !platform_ops->suspend))
98+ return;
9799 BUG_ON(!irqs_disabled());
98100
99101 /* Very similar to mcpm_cpu_power_down() */
arch/arm/common/sharpsl_param.c+4−1
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/module.h>
1616 #include <linux/string.h>
1717 #include <asm/mach/sharpsl_param.h>
18+#include <asm/memory.h>
1819
1920 /*
2021 * Certain hardware parameters determined at the time of device manufacture,
@@ -25,8 +26,10 @@ · 4 unmodified lines
2526 */
2627 #ifdef CONFIG_ARCH_SA1100
2728 #define PARAM_BASE 0xe8ffc000
29+#define param_start(x) (void *)(x)
2830 #else
2931 #define PARAM_BASE 0xa0000a00
32+#define param_start(x) __va(x)
3033 #endif
3134 #define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a )
3235
@@ -41,7 +44,7 @@ EXPORT_SYMBOL(sharpsl_param); · 8 unmodified lines
4144
4245 void sharpsl_save_param(void)
4346 {
44− memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info));
47+ memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info));
4548
4649 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC)
4750 sharpsl_param.comadj=-1;
arch/arm/configs/multi_v7_defconfig+1−0
@@ -135,6 +135,7 @@ CONFIG_MMC=y · 134 unmodified lines
135135 CONFIG_MMC_ARMMMCI=y
136136 CONFIG_MMC_SDHCI=y
137137 CONFIG_MMC_SDHCI_PLTFM=y
138+CONFIG_MMC_SDHCI_ESDHC_IMX=y
138139 CONFIG_MMC_SDHCI_TEGRA=y
139140 CONFIG_MMC_SDHCI_SPEAR=y
140141 CONFIG_MMC_OMAP=y
arch/arm/include/asm/Kbuild+0−1
@@ -31,5 +31,4 @@ generic-y += termbits.h · 30 unmodified lines
3131 generic-y += termios.h
3232 generic-y += timex.h
3333 generic-y += trace_clock.h
34−generic-y += types.h
3534 generic-y += unaligned.h
arch/arm/include/asm/jump_label.h+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
1616
1717 static __always_inline bool arch_static_branch(struct static_key *key)
1818 {
19− asm goto("1:\n\t"
19+ asm_volatile_goto("1:\n\t"
2020 JUMP_LABEL_NOP "\n\t"
2121 ".pushsection __jump_table, \"aw\"\n\t"
2222 ".word 1b, %l[l_yes], %c0\n\t"
arch/arm/include/asm/mcpm.h+10−4
@@ -76,8 +76,11 @@ int mcpm_cpu_power_up(unsigned int cpu, unsigned int cluster); · 75 unmodified lines
7676 *
7777 * This must be called with interrupts disabled.
7878 *
79− * This does not return. Re-entry in the kernel is expected via
80− * mcpm_entry_point.
79+ * On success this does not return. Re-entry in the kernel is expected
80+ * via mcpm_entry_point.
81+ *
82+ * This will return if mcpm_platform_register() has not been called
83+ * previously in which case the caller should take appropriate action.
8184 */
8285 void mcpm_cpu_power_down(void);
8386
@@ -98,8 +101,11 @@ void mcpm_cpu_power_down(void); · 14 unmodified lines
98101 *
99102 * This must be called with interrupts disabled.
100103 *
101− * This does not return. Re-entry in the kernel is expected via
102− * mcpm_entry_point.
104+ * On success this does not return. Re-entry in the kernel is expected
105+ * via mcpm_entry_point.
106+ *
107+ * This will return if mcpm_platform_register() has not been called
108+ * previously in which case the caller should take appropriate action.
103109 */
104110 void mcpm_cpu_suspend(u64 expected_residency);
105111
arch/arm/include/asm/syscall.h+6−0
@@ -57,6 +57,9 @@ static inline void syscall_get_arguments(struct task_struct *task, · 56 unmodified lines
5757 unsigned int i, unsigned int n,
5858 unsigned long *args)
5959 {
60+ if (n == 0)
61+ return;
62+
6063 if (i + n > SYSCALL_MAX_ARGS) {
6164 unsigned long *args_bad = args + SYSCALL_MAX_ARGS - i;
6265 unsigned int n_bad = n + i - SYSCALL_MAX_ARGS;
@@ -81,6 +84,9 @@ static inline void syscall_set_arguments(struct task_struct *task, · 18 unmodified lines
8184 unsigned int i, unsigned int n,
8285 const unsigned long *args)
8386 {
87+ if (n == 0)
88+ return;
89+
8490 if (i + n > SYSCALL_MAX_ARGS) {
8591 pr_warning("%s called with max args %d, handling only %d\n",
8692 __func__, i + n, SYSCALL_MAX_ARGS);
arch/arm/kernel/head.S+20−1
@@ -487,7 +487,26 @@ __fixup_smp: · 486 unmodified lines
487487 mrc p15, 0, r0, c0, c0, 5 @ read MPIDR
488488 and r0, r0, #0xc0000000 @ multiprocessing extensions and
489489 teq r0, #0x80000000 @ not part of a uniprocessor system?
490− moveq pc, lr @ yes, assume SMP
490+ bne __fixup_smp_on_up @ no, assume UP
491+
492+ @ Core indicates it is SMP. Check for Aegis SOC where a single
493+ @ Cortex-A9 CPU is present but SMP operations fault.
494+ mov r4, #0x41000000
495+ orr r4, r4, #0x0000c000
496+ orr r4, r4, #0x00000090
497+ teq r3, r4 @ Check for ARM Cortex-A9
498+ movne pc, lr @ Not ARM Cortex-A9,
499+
500+ @ If a future SoC *does* use 0x0 as the PERIPH_BASE, then the
501+ @ below address check will need to be #ifdef'd or equivalent
502+ @ for the Aegis platform.
503+ mrc p15, 4, r0, c15, c0 @ get SCU base address
504+ teq r0, #0x0 @ '0' on actual UP A9 hardware
505+ beq __fixup_smp_on_up @ So its an A9 UP
506+ ldr r0, [r0, #4] @ read SCU Config
507+ and r0, r0, #0x3 @ number of CPUs
508+ teq r0, #0x0 @ is 1?
509+ movne pc, lr
491510
492511 __fixup_smp_on_up:
493512 adr r0, 1f
arch/arm/mach-at91/at91rm9200_time.c+1−1
@@ -93,7 +93,7 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id) · 92 unmodified lines
9393
9494 static struct irqaction at91rm9200_timer_irq = {
9595 .name = "at91_tick",
96− .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
96+ .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
9797 .handler = at91rm9200_timer_interrupt,
9898 .irq = NR_IRQS_LEGACY + AT91_ID_SYS,
9999 };
arch/arm/mach-at91/at91sam926x_time.c+1−1
@@ -171,7 +171,7 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id) · 170 unmodified lines
171171
172172 static struct irqaction at91sam926x_pit_irq = {
173173 .name = "at91_tick",
174− .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
174+ .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
175175 .handler = at91sam926x_pit_interrupt,
176176 .irq = NR_IRQS_LEGACY + AT91_ID_SYS,
177177 };
arch/arm/mach-at91/at91sam9g45_reset.S+8−0
@@ -16,11 +16,17 @@ · 15 unmodified lines
1616 #include "at91_rstc.h"
1717 .arm
1818
19+/*
20+ * at91_ramc_base is an array void*
21+ * init at NULL if only one DDR controler is present in or DT
22+ */
1923 .globl at91sam9g45_restart
2024
2125 at91sam9g45_restart:
2226 ldr r5, =at91_ramc_base @ preload constants
2327 ldr r0, [r5]
28+ ldr r5, [r5, #4] @ ddr1
29+ cmp r5, #0
2430 ldr r4, =at91_rstc_base
2531 ldr r1, [r4]
2632
@@ -30,6 +36,8 @@ at91sam9g45_restart: · 3 unmodified lines
3036
3137 .balign 32 @ align to cache line
3238
39+ strne r2, [r5, #AT91_DDRSDRC_RTR] @ disable DDR1 access
40+ strne r3, [r5, #AT91_DDRSDRC_LPR] @ power down DDR1
3341 str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access
3442 str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0
3543 str r4, [r1, #AT91_RSTC_CR] @ reset processor
arch/arm/mach-at91/at91x40_time.c+1−1
@@ -57,7 +57,7 @@ static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) · 56 unmodified lines
5757
5858 static struct irqaction at91x40_timer_irq = {
5959 .name = "at91_tick",
60− .flags = IRQF_DISABLED | IRQF_TIMER,
60+ .flags = IRQF_TIMER,
6161 .handler = at91x40_timer_interrupt
6262 };
6363
arch/arm/mach-davinci/board-dm365-evm.c+1−1
@@ -176,7 +176,7 @@ static struct at24_platform_data eeprom_info = { · 175 unmodified lines
176176 .context = (void *)0x7f00,
177177 };
178178
179−static struct snd_platform_data dm365_evm_snd_data = {
179+static struct snd_platform_data dm365_evm_snd_data __maybe_unused = {
180180 .asp_chan_q = EVENTQ_3,
181181 };
182182
arch/arm/mach-davinci/include/mach/serial.h+2−2
@@ -15,8 +15,6 @@ · 14 unmodified lines
1515
1616 #include <mach/hardware.h>
1717
18−#include <linux/platform_device.h>
19−
2018 #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000)
2119 #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400)
2220 #define DAVINCI_UART2_BASE (IO_PHYS + 0x20800)
@@ -39,6 +37,8 @@ · 16 unmodified lines
3937 #define UART_DM646X_SCR_TX_WATERMARK 0x08
4038
4139 #ifndef __ASSEMBLY__
40+#include <linux/platform_device.h>
41+
4242 extern int davinci_serial_init(struct platform_device *);
4343 #endif
4444
arch/arm/mach-integrator/pci_v3.h+7−0
@@ -1,2 +1,9 @@
11 /* Simple oneliner include to the PCIv3 early init */
2+#ifdef CONFIG_PCI
23 extern int pci_v3_early_init(void);
4+#else
5+static inline int pci_v3_early_init(void)
6+{
7+ return 0;
8+}
9+#endif
arch/arm/mach-mvebu/coherency.c+7−1
@@ -140,6 +140,7 @@ int __init coherency_init(void) · 139 unmodified lines
140140 coherency_base = of_iomap(np, 0);
141141 coherency_cpu_base = of_iomap(np, 1);
142142 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
143+ of_node_put(np);
143144 }
144145
145146 return 0;
@@ -147,9 +148,14 @@ int __init coherency_init(void) · 1 unmodified line
147148
148149 static int __init coherency_late_init(void)
149150 {
150− if (of_find_matching_node(NULL, of_coherency_table))
151+ struct device_node *np;
152+
153+ np = of_find_matching_node(NULL, of_coherency_table);
154+ if (np) {
151155 bus_register_notifier(&platform_bus_type,
152156 &mvebu_hwcc_platform_nb);
157+ of_node_put(np);
158+ }
153159 return 0;
154160 }
155161
arch/arm/mach-mvebu/pmsu.c+1−0
@@ -67,6 +67,7 @@ int __init armada_370_xp_pmsu_init(void) · 66 unmodified lines
6767 pr_info("Initializing Power Management Service Unit\n");
6868 pmsu_mp_base = of_iomap(np, 0);
6969 pmsu_reset_base = of_iomap(np, 1);
70+ of_node_put(np);
7071 }
7172
7273 return 0;
arch/arm/mach-mvebu/system-controller.c+1−0
@@ -98,6 +98,7 @@ static int __init mvebu_system_controller_init(void) · 97 unmodified lines
9898 BUG_ON(!match);
9999 system_controller_base = of_iomap(np, 0);
100100 mvebu_sc = (struct mvebu_system_controller *)match->data;
101+ of_node_put(np);
101102 }
102103
103104 return 0;
arch/arm/mach-omap2/board-generic.c+18−0
@@ -129,6 +129,24 @@ DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") · 128 unmodified lines
129129 .restart = omap3xxx_restart,
130130 MACHINE_END
131131
132+static const char *omap36xx_boards_compat[] __initdata = {
133+ "ti,omap36xx",
134+ NULL,
135+};
136+
137+DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
138+ .reserve = omap_reserve,
139+ .map_io = omap3_map_io,
140+ .init_early = omap3630_init_early,
141+ .init_irq = omap_intc_of_init,
142+ .handle_irq = omap3_intc_handle_irq,
143+ .init_machine = omap_generic_init,
144+ .init_late = omap3_init_late,
145+ .init_time = omap3_sync32k_timer_init,
146+ .dt_compat = omap36xx_boards_compat,
147+ .restart = omap3xxx_restart,
148+MACHINE_END
149+
132150 static const char *omap3_gp_boards_compat[] __initdata = {
133151 "ti,omap3-beagle",
134152 "timll,omap3-devkit8000",
arch/arm/mach-omap2/board-rx51-peripherals.c+9−0
@@ -167,38 +167,47 @@ static struct lp55xx_led_config rx51_lp5523_led_config[] = { · 166 unmodified lines
167167 .name = "lp5523:kb1",
168168 .chan_nr = 0,
169169 .led_current = 50,
170+ .max_current = 100,
170171 }, {
171172 .name = "lp5523:kb2",
172173 .chan_nr = 1,
173174 .led_current = 50,
175+ .max_current = 100,
174176 }, {
175177 .name = "lp5523:kb3",
176178 .chan_nr = 2,
177179 .led_current = 50,
180+ .max_current = 100,
178181 }, {
179182 .name = "lp5523:kb4",
180183 .chan_nr = 3,
181184 .led_current = 50,
185+ .max_current = 100,
182186 }, {
183187 .name = "lp5523:b",
184188 .chan_nr = 4,
185189 .led_current = 50,
190+ .max_current = 100,
186191 }, {
187192 .name = "lp5523:g",
188193 .chan_nr = 5,
189194 .led_current = 50,
195+ .max_current = 100,
190196 }, {
191197 .name = "lp5523:r",
192198 .chan_nr = 6,
193199 .led_current = 50,
200+ .max_current = 100,
194201 }, {
195202 .name = "lp5523:kb5",
196203 .chan_nr = 7,
197204 .led_current = 50,
205+ .max_current = 100,
198206 }, {
199207 .name = "lp5523:kb6",
200208 .chan_nr = 8,
201209 .led_current = 50,
210+ .max_current = 100,
202211 }
203212 };
204213
arch/arm/mach-omap2/gpmc-onenand.c+11−1
@@ -272,9 +272,19 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base) · 271 unmodified lines
272272 struct gpmc_timings t;
273273 int ret;
274274
275− if (gpmc_onenand_data->of_node)
275+ if (gpmc_onenand_data->of_node) {
276276 gpmc_read_settings_dt(gpmc_onenand_data->of_node,
277277 &onenand_async);
278+ if (onenand_async.sync_read || onenand_async.sync_write) {
279+ if (onenand_async.sync_write)
280+ gpmc_onenand_data->flags |=
281+ ONENAND_SYNC_READWRITE;
282+ else
283+ gpmc_onenand_data->flags |= ONENAND_SYNC_READ;
284+ onenand_async.sync_read = false;
285+ onenand_async.sync_write = false;
286+ }
287+ }
278288
279289 omap2_onenand_set_async_mode(onenand_base);
280290
arch/arm/mach-omap2/mux.h+1−3
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 #define OMAP_PULL_UP (1 << 4)
2929 #define OMAP_ALTELECTRICALSEL (1 << 5)
3030
31−/* 34xx specific mux bit defines */
31+/* omap3/4/5 specific mux bit defines */
3232 #define OMAP_INPUT_EN (1 << 8)
3333 #define OMAP_OFF_EN (1 << 9)
3434 #define OMAP_OFFOUT_EN (1 << 10)
@@ -36,8 +36,6 @@ · 1 unmodified line
3636 #define OMAP_OFF_PULL_EN (1 << 12)
3737 #define OMAP_OFF_PULL_UP (1 << 13)
3838 #define OMAP_WAKEUP_EN (1 << 14)
39−
40−/* 44xx specific mux bit defines */
4139 #define OMAP_WAKEUP_EVENT (1 << 15)
4240
4341 /* Active pin states */
arch/arm/mach-omap2/timer.c+2−2
@@ -628,7 +628,7 @@ void __init omap4_local_timer_init(void) · 627 unmodified lines
628628 #endif /* CONFIG_HAVE_ARM_TWD */
629629 #endif /* CONFIG_ARCH_OMAP4 */
630630
631−#ifdef CONFIG_SOC_OMAP5
631+#if defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX)
632632 void __init omap5_realtime_timer_init(void)
633633 {
634634 omap4_sync32k_timer_init();
@@ -636,7 +636,7 @@ void __init omap5_realtime_timer_init(void) · 1 unmodified line
636636
637637 clocksource_of_init();
638638 }
639−#endif /* CONFIG_SOC_OMAP5 */
639+#endif /* CONFIG_SOC_OMAP5 || CONFIG_SOC_DRA7XX */
640640
641641 /**
642642 * omap_timer_init - build and register timer device with an
arch/arm/mach-shmobile/board-armadillo800eva.c+2−2
@@ -1108,9 +1108,9 @@ static const struct pinctrl_map eva_pinctrl_map[] = { · 1107 unmodified lines
11081108 PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.1", "pfc-r8a7740",
11091109 "fsib_mclk_in", "fsib"),
11101110 /* GETHER */
1111− PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7740",
1111+ PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740",
11121112 "gether_mii", "gether"),
1113− PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7740",
1113+ PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740",
11141114 "gether_int", "gether"),
11151115 /* HDMI */
11161116 PIN_MAP_MUX_GROUP_DEFAULT("sh-mobile-hdmi", "pfc-r8a7740",
arch/arm/mach-shmobile/board-lager.c+26−1
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/pinctrl/machine.h>
3030 #include <linux/platform_data/gpio-rcar.h>
3131 #include <linux/platform_device.h>
32+#include <linux/phy.h>
3233 #include <linux/regulator/fixed.h>
3334 #include <linux/regulator/machine.h>
3435 #include <linux/sh_eth.h>
@@ -155,6 +156,30 @@ static void __init lager_add_standard_devices(void) · 120 unmodified lines
155156 &ether_pdata, sizeof(ether_pdata));
156157 }
157158
159+/*
160+ * Ether LEDs on the Lager board are named LINK and ACTIVE which corresponds
161+ * to non-default 01 setting of the Micrel KSZ8041 PHY control register 1 bits
162+ * 14-15. We have to set them back to 01 from the default 00 value each time
163+ * the PHY is reset. It's also important because the PHY's LED0 signal is
164+ * connected to SoC's ETH_LINK signal and in the PHY's default mode it will
165+ * bounce on and off after each packet, which we apparently want to avoid.
166+ */
167+static int lager_ksz8041_fixup(struct phy_device *phydev)
168+{
169+ u16 phyctrl1 = phy_read(phydev, 0x1e);
170+
171+ phyctrl1 &= ~0xc000;
172+ phyctrl1 |= 0x4000;
173+ return phy_write(phydev, 0x1e, phyctrl1);
174+}
175+
176+static void __init lager_init(void)
177+{
178+ lager_add_standard_devices();
179+
180+ phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup);
181+}
182+
158183 static const char *lager_boards_compat_dt[] __initdata = {
159184 "renesas,lager",
160185 NULL,
@@ -163,6 +188,6 @@ static const char *lager_boards_compat_dt[] __initdata = { · 2 unmodified lines
163188 DT_MACHINE_START(LAGER_DT, "lager")
164189 .init_early = r8a7790_init_delay,
165190 .init_time = r8a7790_timer_init,
166− .init_machine = lager_add_standard_devices,
191+ .init_machine = lager_init,
167192 .dt_compat = lager_boards_compat_dt,
168193 MACHINE_END
arch/arm/mach-vexpress/tc2_pm.c+10−1
@@ -131,6 +131,16 @@ static void tc2_pm_down(u64 residency) · 130 unmodified lines
131131 } else
132132 BUG();
133133
134+ /*
135+ * If the CPU is committed to power down, make sure
136+ * the power controller will be in charge of waking it
137+ * up upon IRQ, ie IRQ lines are cut from GIC CPU IF
138+ * to the CPU by disabling the GIC CPU IF to prevent wfi
139+ * from completing execution behind power controller back
140+ */
141+ if (!skip_wfi)
142+ gic_cpu_if_down();
143+
134144 if (last_man && __mcpm_outbound_enter_critical(cpu, cluster)) {
135145 arch_spin_unlock(&tc2_pm_lock);
136146
@@ -231,7 +241,6 @@ static void tc2_pm_suspend(u64 residency) · 94 unmodified lines
231241 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
232242 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
233243 ve_spc_set_resume_addr(cluster, cpu, virt_to_phys(mcpm_entry_point));
234− gic_cpu_if_down();
235244 tc2_pm_down(residency);
236245 }
237246
arch/arm/mm/dma-mapping.c+28−15
@@ -1232,7 +1232,8 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size) · 1231 unmodified lines
12321232 break;
12331233
12341234 len = (j - i) << PAGE_SHIFT;
1235− ret = iommu_map(mapping->domain, iova, phys, len, 0);
1235+ ret = iommu_map(mapping->domain, iova, phys, len,
1236+ IOMMU_READ|IOMMU_WRITE);
12361237 if (ret < 0)
12371238 goto fail;
12381239 iova += len;
@@ -1431,6 +1432,27 @@ static int arm_iommu_get_sgtable(struct device *dev, struct sg_table *sgt, · 192 unmodified lines
14311432 GFP_KERNEL);
14321433 }
14331434
1435+static int __dma_direction_to_prot(enum dma_data_direction dir)
1436+{
1437+ int prot;
1438+
1439+ switch (dir) {
1440+ case DMA_BIDIRECTIONAL:
1441+ prot = IOMMU_READ | IOMMU_WRITE;
1442+ break;
1443+ case DMA_TO_DEVICE:
1444+ prot = IOMMU_READ;
1445+ break;
1446+ case DMA_FROM_DEVICE:
1447+ prot = IOMMU_WRITE;
1448+ break;
1449+ default:
1450+ prot = 0;
1451+ }
1452+
1453+ return prot;
1454+}
1455+
14341456 /*
14351457 * Map a part of the scatter-gather list into contiguous io address space
14361458 */
@@ -1444,6 +1466,7 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg, · 7 unmodified lines
14441466 int ret = 0;
14451467 unsigned int count;
14461468 struct scatterlist *s;
1469+ int prot;
14471470
14481471 size = PAGE_ALIGN(size);
14491472 *handle = DMA_ERROR_CODE;
@@ -1460,7 +1483,9 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg, · 10 unmodified lines
14601483 !dma_get_attr(DMA_ATTR_SKIP_CPU_SYNC, attrs))
14611484 __dma_page_cpu_to_dev(sg_page(s), s->offset, s->length, dir);
14621485
1463− ret = iommu_map(mapping->domain, iova, phys, len, 0);
1486+ prot = __dma_direction_to_prot(dir);
1487+
1488+ ret = iommu_map(mapping->domain, iova, phys, len, prot);
14641489 if (ret < 0)
14651490 goto fail;
14661491 count += len >> PAGE_SHIFT;
@@ -1665,19 +1690,7 @@ static dma_addr_t arm_coherent_iommu_map_page(struct device *dev, struct page *p · 198 unmodified lines
16651690 if (dma_addr == DMA_ERROR_CODE)
16661691 return dma_addr;
16671692
1668− switch (dir) {
1669− case DMA_BIDIRECTIONAL:
1670− prot = IOMMU_READ | IOMMU_WRITE;
1671− break;
1672− case DMA_TO_DEVICE:
1673− prot = IOMMU_READ;
1674− break;
1675− case DMA_FROM_DEVICE:
1676− prot = IOMMU_WRITE;
1677− break;
1678− default:
1679− prot = 0;
1680− }
1693+ prot = __dma_direction_to_prot(dir);
16811694
16821695 ret = iommu_map(mapping->domain, dma_addr, page_to_phys(page), len, prot);
16831696 if (ret < 0)
arch/arm/mm/init.c+0−3
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include <linux/nodemask.h>
1818 #include <linux/initrd.h>
1919 #include <linux/of_fdt.h>
20−#include <linux/of_reserved_mem.h>
2120 #include <linux/highmem.h>
2221 #include <linux/gfp.h>
2322 #include <linux/memblock.h>
@@ -379,8 +378,6 @@ void __init arm_memblock_init(struct meminfo *mi, · 355 unmodified lines
379378 if (mdesc->reserve)
380379 mdesc->reserve();
381380
382− early_init_dt_scan_reserved_mem();
383−
384381 /*
385382 * reserve memory for DMA contigouos allocations,
386383 * must come from DMA area inside low memory
arch/arm64/Kconfig.debug+0−7
@@ -6,13 +6,6 @@ config FRAME_POINTER · 5 unmodified lines
66 bool
77 default y
88
9−config DEBUG_STACK_USAGE
10− bool "Enable stack utilization instrumentation"
11− depends on DEBUG_KERNEL
12− help
13− Enables the display of the minimum amount of free stack which each
14− task has ever had available in the sysrq-T output.
15−
169 config EARLY_PRINTK
1710 bool "Early printk support"
1811 default y
arch/arm64/configs/defconfig+4−1
@@ -42,7 +42,7 @@ CONFIG_IP_PNP_BOOTP=y · 41 unmodified lines
4242 # CONFIG_WIRELESS is not set
4343 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
4444 CONFIG_DEVTMPFS=y
45−# CONFIG_BLK_DEV is not set
45+CONFIG_BLK_DEV=y
4646 CONFIG_SCSI=y
4747 # CONFIG_SCSI_PROC_FS is not set
4848 CONFIG_BLK_DEV_SD=y
@@ -72,6 +72,7 @@ CONFIG_LOGO=y · 23 unmodified lines
7272 # CONFIG_IOMMU_SUPPORT is not set
7373 CONFIG_EXT2_FS=y
7474 CONFIG_EXT3_FS=y
75+CONFIG_EXT4_FS=y
7576 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
7677 # CONFIG_EXT3_FS_XATTR is not set
7778 CONFIG_FUSE_FS=y
@@ -90,3 +91,5 @@ CONFIG_DEBUG_KERNEL=y · 12 unmodified lines
9091 CONFIG_DEBUG_INFO=y
9192 # CONFIG_FTRACE is not set
9293 CONFIG_ATOMIC64_SELFTEST=y
94+CONFIG_VIRTIO_MMIO=y
95+CONFIG_VIRTIO_BLK=y
arch/arm64/include/asm/uaccess.h+6−4
@@ -166,9 +166,10 @@ do { \ · 165 unmodified lines
166166
167167 #define get_user(x, ptr) \
168168 ({ \
169+ __typeof__(*(ptr)) __user *__p = (ptr); \
169170 might_fault(); \
170− access_ok(VERIFY_READ, (ptr), sizeof(*(ptr))) ? \
171− __get_user((x), (ptr)) : \
171+ access_ok(VERIFY_READ, __p, sizeof(*__p)) ? \
172+ __get_user((x), __p) : \
172173 ((x) = 0, -EFAULT); \
173174 })
174175
@@ -227,9 +228,10 @@ do { \ · 52 unmodified lines
227228
228229 #define put_user(x, ptr) \
229230 ({ \
231+ __typeof__(*(ptr)) __user *__p = (ptr); \
230232 might_fault(); \
231− access_ok(VERIFY_WRITE, (ptr), sizeof(*(ptr))) ? \
232− __put_user((x), (ptr)) : \
233+ access_ok(VERIFY_WRITE, __p, sizeof(*__p)) ? \
234+ __put_user((x), __p) : \
233235 -EFAULT; \
234236 })
235237
arch/arm64/kernel/fpsimd.c+2−0
@@ -80,8 +80,10 @@ void fpsimd_thread_switch(struct task_struct *next) · 79 unmodified lines
8080
8181 void fpsimd_flush_thread(void)
8282 {
83+ preempt_disable();
8384 memset(&current->thread.fpsimd_state, 0, sizeof(struct fpsimd_state));
8485 fpsimd_load_state(&current->thread.fpsimd_state);
86+ preempt_enable();
8587 }
8688
8789 #ifdef CONFIG_KERNEL_MODE_NEON
arch/arm64/mm/tlb.S+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 */
3636 ENTRY(__cpu_flush_user_tlb_range)
3737 vma_vm_mm x3, x2 // get vma->vm_mm
38− mmid x3, x3 // get vm_mm->context.id
38+ mmid w3, x3 // get vm_mm->context.id
3939 dsb sy
4040 lsr x0, x0, #12 // align address
4141 lsr x1, x1, #12
arch/mips/alchemy/board-mtx1.c+1−1
@@ -276,7 +276,7 @@ static struct platform_device mtx1_pci_host = { · 275 unmodified lines
276276 .resource = alchemy_pci_host_res,
277277 };
278278
279−static struct __initdata platform_device * mtx1_devs[] = {
279+static struct platform_device *mtx1_devs[] __initdata = {
280280 &mtx1_pci_host,
281281 &mtx1_gpio_leds,
282282 &mtx1_wdt,
arch/mips/include/asm/jump_label.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222
2323 static __always_inline bool arch_static_branch(struct static_key *key)
2424 {
25− asm goto("1:\tnop\n\t"
25+ asm_volatile_goto("1:\tnop\n\t"
2626 "nop\n\t"
2727 ".pushsection __jump_table, \"aw\"\n\t"
2828 WORD_INSN " 1b, %l[l_yes], %0\n\t"
arch/mips/kernel/octeon_switch.S+1−1
@@ -73,7 +73,7 @@ · 72 unmodified lines
7373 3:
7474
7575 #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
76− PTR_L t8, __stack_chk_guard
76+ PTR_LA t8, __stack_chk_guard
7777 LONG_L t9, TASK_STACK_CANARY(a1)
7878 LONG_S t9, 0(t8)
7979 #endif
arch/mips/kernel/r2300_switch.S+1−1
@@ -67,7 +67,7 @@ LEAF(resume) · 66 unmodified lines
6767 1:
6868
6969 #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
70− PTR_L t8, __stack_chk_guard
70+ PTR_LA t8, __stack_chk_guard
7171 LONG_L t9, TASK_STACK_CANARY(a1)
7272 LONG_S t9, 0(t8)
7373 #endif
arch/mips/kernel/r4k_switch.S+1−1
@@ -69,7 +69,7 @@ · 68 unmodified lines
6969 1:
7070
7171 #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
72− PTR_L t8, __stack_chk_guard
72+ PTR_LA t8, __stack_chk_guard
7373 LONG_L t9, TASK_STACK_CANARY(a1)
7474 LONG_S t9, 0(t8)
7575 #endif
arch/mips/mm/c-r4k.c+2−0
@@ -609,6 +609,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) · 608 unmodified lines
609609 r4k_blast_scache();
610610 else
611611 blast_scache_range(addr, addr + size);
612+ preempt_enable();
612613 __sync();
613614 return;
614615 }
@@ -650,6 +651,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) · 35 unmodified lines
650651 */
651652 blast_inv_scache_range(addr, addr + size);
652653 }
654+ preempt_enable();
653655 __sync();
654656 return;
655657 }
arch/parisc/configs/712_defconfig+2−0
@@ -40,6 +40,8 @@ CONFIG_IP_NF_QUEUE=m · 39 unmodified lines
4040 CONFIG_LLC2=m
4141 CONFIG_NET_PKTGEN=m
4242 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
43+CONFIG_DEVTMPFS=y
44+CONFIG_DEVTMPFS_MOUNT=y
4345 # CONFIG_STANDALONE is not set
4446 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
4547 CONFIG_PARPORT=y
arch/parisc/configs/a500_defconfig+2−0
@@ -79,6 +79,8 @@ CONFIG_IP_DCCP=m · 78 unmodified lines
7979 CONFIG_LLC2=m
8080 CONFIG_NET_PKTGEN=m
8181 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
82+CONFIG_DEVTMPFS=y
83+CONFIG_DEVTMPFS_MOUNT=y
8284 # CONFIG_STANDALONE is not set
8385 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
8486 CONFIG_BLK_DEV_UMEM=m
arch/parisc/configs/b180_defconfig+3−0
@@ -4,6 +4,7 @@ CONFIG_IKCONFIG=y · 3 unmodified lines
44 CONFIG_IKCONFIG_PROC=y
55 CONFIG_LOG_BUF_SHIFT=16
66 CONFIG_SYSFS_DEPRECATED_V2=y
7+CONFIG_BLK_DEV_INITRD=y
78 CONFIG_SLAB=y
89 CONFIG_MODULES=y
910 CONFIG_MODVERSIONS=y
@@ -27,6 +28,8 @@ CONFIG_IP_PNP_BOOTP=y · 17 unmodified lines
2728 # CONFIG_INET_LRO is not set
2829 CONFIG_IPV6=y
2930 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31+CONFIG_DEVTMPFS=y
32+CONFIG_DEVTMPFS_MOUNT=y
3033 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
3134 CONFIG_PARPORT=y
3235 CONFIG_PARPORT_PC=y
arch/parisc/configs/c3000_defconfig+3−0
@@ -5,6 +5,7 @@ CONFIG_IKCONFIG=y · 4 unmodified lines
55 CONFIG_IKCONFIG_PROC=y
66 CONFIG_LOG_BUF_SHIFT=16
77 CONFIG_SYSFS_DEPRECATED_V2=y
8+CONFIG_BLK_DEV_INITRD=y
89 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
910 CONFIG_EXPERT=y
1011 CONFIG_KALLSYMS_ALL=y
@@ -39,6 +40,8 @@ CONFIG_NETFILTER_DEBUG=y · 28 unmodified lines
3940 CONFIG_IP_NF_QUEUE=m
4041 CONFIG_NET_PKTGEN=m
4142 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
43+CONFIG_DEVTMPFS=y
44+CONFIG_DEVTMPFS_MOUNT=y
4245 # CONFIG_STANDALONE is not set
4346 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
4447 CONFIG_BLK_DEV_UMEM=m
arch/parisc/configs/c8000_defconfig+2−0
@@ -62,6 +62,8 @@ CONFIG_TIPC=m · 61 unmodified lines
6262 CONFIG_LLC2=m
6363 CONFIG_DNS_RESOLVER=y
6464 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
65+CONFIG_DEVTMPFS=y
66+CONFIG_DEVTMPFS_MOUNT=y
6567 # CONFIG_STANDALONE is not set
6668 CONFIG_PARPORT=y
6769 CONFIG_PARPORT_PC=y
arch/parisc/configs/default_defconfig+2−0
@@ -49,6 +49,8 @@ CONFIG_INET6_ESP=y · 48 unmodified lines
4949 CONFIG_INET6_IPCOMP=y
5050 CONFIG_LLC2=m
5151 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
52+CONFIG_DEVTMPFS=y
53+CONFIG_DEVTMPFS_MOUNT=y
5254 # CONFIG_STANDALONE is not set
5355 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
5456 CONFIG_PARPORT=y
arch/parisc/include/asm/traps.h+1−1
@@ -6,7 +6,7 @@ struct pt_regs; · 5 unmodified lines
66
77 /* traps.c */
88 void parisc_terminate(char *msg, struct pt_regs *regs,
9− int code, unsigned long offset);
9+ int code, unsigned long offset) __noreturn __cold;
1010
1111 /* mm/fault.c */
1212 void do_page_fault(struct pt_regs *regs, unsigned long code,
arch/parisc/kernel/smp.c+1−7
@@ -72,7 +72,6 @@ enum ipi_message_type { · 71 unmodified lines
7272 IPI_NOP=0,
7373 IPI_RESCHEDULE=1,
7474 IPI_CALL_FUNC,
75− IPI_CALL_FUNC_SINGLE,
7675 IPI_CPU_START,
7776 IPI_CPU_STOP,
7877 IPI_CPU_TEST
@@ -164,11 +163,6 @@ ipi_interrupt(int irq, void *dev_id) · 85 unmodified lines
164163 generic_smp_call_function_interrupt();
165164 break;
166165
167− case IPI_CALL_FUNC_SINGLE:
168− smp_debug(100, KERN_DEBUG "CPU%d IPI_CALL_FUNC_SINGLE\n", this_cpu);
169− generic_smp_call_function_single_interrupt();
170− break;
171−
172166 case IPI_CPU_START:
173167 smp_debug(100, KERN_DEBUG "CPU%d IPI_CPU_START\n", this_cpu);
174168 break;
@@ -260,7 +254,7 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask) · 85 unmodified lines
260254
261255 void arch_send_call_function_single_ipi(int cpu)
262256 {
263− send_IPI_single(cpu, IPI_CALL_FUNC_SINGLE);
257+ send_IPI_single(cpu, IPI_CALL_FUNC);
264258 }
265259
266260 /*
arch/parisc/kernel/traps.c+3−8
@@ -291,11 +291,6 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err) · 290 unmodified lines
291291 do_exit(SIGSEGV);
292292 }
293293
294−int syscall_ipi(int (*syscall) (struct pt_regs *), struct pt_regs *regs)
295−{
296− return syscall(regs);
297−}
298−
299294 /* gdb uses break 4,8 */
300295 #define GDB_BREAK_INSN 0x10004
301296 static void handle_gdb_break(struct pt_regs *regs, int wot)
@@ -805,14 +800,14 @@ void notrace handle_interruption(int code, struct pt_regs *regs) · 503 unmodified lines
805800 else {
806801
807802 /*
808− * The kernel should never fault on its own address space.
803+ * The kernel should never fault on its own address space,
804+ * unless pagefault_disable() was called before.
809805 */
810806
811− if (fault_space == 0)
807+ if (fault_space == 0 && !in_atomic())
812808 {
813809 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC);
814810 parisc_terminate("Kernel Fault", regs, code, fault_address);
815−
816811 }
817812 }
818813
arch/parisc/lib/memcpy.c+14−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 #ifdef __KERNEL__
5757 #include <linux/module.h>
5858 #include <linux/compiler.h>
59−#include <asm/uaccess.h>
59+#include <linux/uaccess.h>
6060 #define s_space "%%sr1"
6161 #define d_space "%%sr2"
6262 #else
@@ -524,4 +524,17 @@ EXPORT_SYMBOL(copy_to_user); · 461 unmodified lines
524524 EXPORT_SYMBOL(copy_from_user);
525525 EXPORT_SYMBOL(copy_in_user);
526526 EXPORT_SYMBOL(memcpy);
527+
528+long probe_kernel_read(void *dst, const void *src, size_t size)
529+{
530+ unsigned long addr = (unsigned long)src;
531+
532+ if (size < 0 || addr < PAGE_SIZE)
533+ return -EFAULT;
534+
535+ /* check for I/O space F_EXTEND(0xfff00000) access as well? */
536+
537+ return __probe_kernel_read(dst, src, size);
538+}
539+
527540 #endif
arch/parisc/mm/fault.c+10−5
@@ -171,20 +171,25 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, · 170 unmodified lines
171171 unsigned long address)
172172 {
173173 struct vm_area_struct *vma, *prev_vma;
174− struct task_struct *tsk = current;
175− struct mm_struct *mm = tsk->mm;
174+ struct task_struct *tsk;
175+ struct mm_struct *mm;
176176 unsigned long acc_type;
177177 int fault;
178− unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
178+ unsigned int flags;
179179
180− if (in_atomic() || !mm)
180+ if (in_atomic())
181181 goto no_context;
182182
183+ tsk = current;
184+ mm = tsk->mm;
185+ if (!mm)
186+ goto no_context;
187+
188+ flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
183189 if (user_mode(regs))
184190 flags |= FAULT_FLAG_USER;
185191
186192 acc_type = parisc_acctyp(code, regs->iir);
187−
188193 if (acc_type & VM_WRITE)
189194 flags |= FAULT_FLAG_WRITE;
190195 retry:
arch/powerpc/include/asm/jump_label.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919
2020 static __always_inline bool arch_static_branch(struct static_key *key)
2121 {
22− asm goto("1:\n\t"
22+ asm_volatile_goto("1:\n\t"
2323 "nop\n\t"
2424 ".pushsection __jump_table, \"aw\"\n\t"
2525 JUMP_ENTRY_TYPE "1b, %l[l_yes], %c0\n\t"
arch/powerpc/kernel/iommu.c+1−1
@@ -661,7 +661,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) · 660 unmodified lines
661661 /* number of bytes needed for the bitmap */
662662 sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long);
663663
664− page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz));
664+ page = alloc_pages_node(nid, GFP_KERNEL, get_order(sz));
665665 if (!page)
666666 panic("iommu_init_table: Can't allocate %ld bytes\n", sz);
667667 tbl->it_map = page_address(page);
arch/powerpc/kernel/irq.c+3−2
@@ -495,14 +495,15 @@ void __do_irq(struct pt_regs *regs) · 494 unmodified lines
495495 void do_IRQ(struct pt_regs *regs)
496496 {
497497 struct pt_regs *old_regs = set_irq_regs(regs);
498− struct thread_info *curtp, *irqtp;
498+ struct thread_info *curtp, *irqtp, *sirqtp;
499499
500500 /* Switch to the irq stack to handle this */
501501 curtp = current_thread_info();
502502 irqtp = hardirq_ctx[raw_smp_processor_id()];
503+ sirqtp = softirq_ctx[raw_smp_processor_id()];
503504
504505 /* Already there ? */
505− if (unlikely(curtp == irqtp)) {
506+ if (unlikely(curtp == irqtp || curtp == sirqtp)) {
506507 __do_irq(regs);
507508 set_irq_regs(old_regs);
508509 return;
arch/powerpc/kernel/sysfs.c+16−2
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <asm/machdep.h>
1818 #include <asm/smp.h>
1919 #include <asm/pmc.h>
20+#include <asm/firmware.h>
2021
2122 #include "cacheinfo.h"
2223
@@ -179,15 +180,25 @@ SYSFS_PMCSETUP(spurr, SPRN_SPURR); · 156 unmodified lines
179180 SYSFS_PMCSETUP(dscr, SPRN_DSCR);
180181 SYSFS_PMCSETUP(pir, SPRN_PIR);
181182
183+/*
184+ Lets only enable read for phyp resources and
185+ enable write when needed with a separate function.
186+ Lets be conservative and default to pseries.
187+*/
182188 static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
183189 static DEVICE_ATTR(spurr, 0400, show_spurr, NULL);
184190 static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr);
185−static DEVICE_ATTR(purr, 0600, show_purr, store_purr);
191+static DEVICE_ATTR(purr, 0400, show_purr, store_purr);
186192 static DEVICE_ATTR(pir, 0400, show_pir, NULL);
187193
188194 unsigned long dscr_default = 0;
189195 EXPORT_SYMBOL(dscr_default);
190196
197+static void add_write_permission_dev_attr(struct device_attribute *attr)
198+{
199+ attr->attr.mode |= 0200;
200+}
201+
191202 static ssize_t show_dscr_default(struct device *dev,
192203 struct device_attribute *attr, char *buf)
193204 {
@@ -394,8 +405,11 @@ static void register_cpu_online(unsigned int cpu) · 200 unmodified lines
394405 if (cpu_has_feature(CPU_FTR_MMCRA))
395406 device_create_file(s, &dev_attr_mmcra);
396407
397− if (cpu_has_feature(CPU_FTR_PURR))
408+ if (cpu_has_feature(CPU_FTR_PURR)) {
409+ if (!firmware_has_feature(FW_FEATURE_LPAR))
410+ add_write_permission_dev_attr(&dev_attr_purr);
398411 device_create_file(s, &dev_attr_purr);
412+ }
399413
400414 if (cpu_has_feature(CPU_FTR_SPURR))
401415 device_create_file(s, &dev_attr_spurr);
arch/powerpc/kernel/tm.S+64−31
@@ -79,6 +79,11 @@ _GLOBAL(tm_abort) · 78 unmodified lines
7979 TABORT(R3)
8080 blr
8181
82+ .section ".toc","aw"
83+DSCR_DEFAULT:
84+ .tc dscr_default[TC],dscr_default
85+
86+ .section ".text"
8287
8388 /* void tm_reclaim(struct thread_struct *thread,
8489 * unsigned long orig_msr,
@@ -123,6 +128,7 @@ _GLOBAL(tm_reclaim) · 38 unmodified lines
123128 mr r15, r14
124129 ori r15, r15, MSR_FP
125130 li r16, MSR_RI
131+ ori r16, r16, MSR_EE /* IRQs hard off */
126132 andc r15, r15, r16
127133 oris r15, r15, MSR_VEC@h
128134 #ifdef CONFIG_VSX
@@ -187,11 +193,18 @@ dont_backup_fp: · 58 unmodified lines
187193 std r1, PACATMSCRATCH(r13)
188194 ld r1, PACAR1(r13)
189195
196+ /* Store the PPR in r11 and reset to decent value */
197+ std r11, GPR11(r1) /* Temporary stash */
198+ mfspr r11, SPRN_PPR
199+ HMT_MEDIUM
200+
190201 /* Now get some more GPRS free */
191202 std r7, GPR7(r1) /* Temporary stash */
192203 std r12, GPR12(r1) /* '' '' '' */
193204 ld r12, STACK_PARAM(0)(r1) /* Param 0, thread_struct * */
194205
206+ std r11, THREAD_TM_PPR(r12) /* Store PPR and free r11 */
207+
195208 addi r7, r12, PT_CKPT_REGS /* Thread's ckpt_regs */
196209
197210 /* Make r7 look like an exception frame so that we
@@ -203,15 +216,19 @@ dont_backup_fp: · 5 unmodified lines
203216 SAVE_GPR(0, r7) /* user r0 */
204217 SAVE_GPR(2, r7) /* user r2 */
205218 SAVE_4GPRS(3, r7) /* user r3-r6 */
206− SAVE_4GPRS(8, r7) /* user r8-r11 */
219+ SAVE_GPR(8, r7) /* user r8 */
220+ SAVE_GPR(9, r7) /* user r9 */
221+ SAVE_GPR(10, r7) /* user r10 */
207222 ld r3, PACATMSCRATCH(r13) /* user r1 */
208223 ld r4, GPR7(r1) /* user r7 */
209− ld r5, GPR12(r1) /* user r12 */
210− GET_SCRATCH0(6) /* user r13 */
224+ ld r5, GPR11(r1) /* user r11 */
225+ ld r6, GPR12(r1) /* user r12 */
226+ GET_SCRATCH0(8) /* user r13 */
211227 std r3, GPR1(r7)
212228 std r4, GPR7(r7)
213− std r5, GPR12(r7)
214− std r6, GPR13(r7)
229+ std r5, GPR11(r7)
230+ std r6, GPR12(r7)
231+ std r8, GPR13(r7)
215232
216233 SAVE_NVGPRS(r7) /* user r14-r31 */
217234
@@ -234,14 +251,12 @@ dont_backup_fp: · 16 unmodified lines
234251 std r6, _XER(r7)
235252
236253
237− /* ******************** TAR, PPR, DSCR ********** */
254+ /* ******************** TAR, DSCR ********** */
238255 mfspr r3, SPRN_TAR
239− mfspr r4, SPRN_PPR
240− mfspr r5, SPRN_DSCR
256+ mfspr r4, SPRN_DSCR
241257
242258 std r3, THREAD_TM_TAR(r12)
243− std r4, THREAD_TM_PPR(r12)
244− std r5, THREAD_TM_DSCR(r12)
259+ std r4, THREAD_TM_DSCR(r12)
245260
246261 /* MSR and flags: We don't change CRs, and we don't need to alter
247262 * MSR.
@@ -258,7 +273,7 @@ dont_backup_fp: · 10 unmodified lines
258273 std r3, THREAD_TM_TFHAR(r12)
259274 std r4, THREAD_TM_TFIAR(r12)
260275
261− /* AMR and PPR are checkpointed too, but are unsupported by Linux. */
276+ /* AMR is checkpointed too, but is unsupported by Linux. */
262277
263278 /* Restore original MSR/IRQ state & clear TM mode */
264279 ld r14, TM_FRAME_L0(r1) /* Orig MSR */
@@ -274,6 +289,12 @@ dont_backup_fp: · 9 unmodified lines
274289 mtcr r4
275290 mtlr r0
276291 ld r2, 40(r1)
292+
293+ /* Load system default DSCR */
294+ ld r4, DSCR_DEFAULT@toc(r2)
295+ ld r0, 0(r4)
296+ mtspr SPRN_DSCR, r0
297+
277298 blr
278299
279300
@@ -358,25 +379,24 @@ dont_restore_fp: · 78 unmodified lines
358379
359380 restore_gprs:
360381
361− /* ******************** TAR, PPR, DSCR ********** */
362− ld r4, THREAD_TM_TAR(r3)
363− ld r5, THREAD_TM_PPR(r3)
364− ld r6, THREAD_TM_DSCR(r3)
382+ /* ******************** CR,LR,CCR,MSR ********** */
383+ ld r4, _CTR(r7)
384+ ld r5, _LINK(r7)
385+ ld r6, _CCR(r7)
386+ ld r8, _XER(r7)
365387
366− mtspr SPRN_TAR, r4
367− mtspr SPRN_PPR, r5
368− mtspr SPRN_DSCR, r6
388+ mtctr r4
389+ mtlr r5
390+ mtcr r6
391+ mtxer r8
369392
370− /* ******************** CR,LR,CCR,MSR ********** */
371− ld r3, _CTR(r7)
372− ld r4, _LINK(r7)
373− ld r5, _CCR(r7)
374− ld r6, _XER(r7)
393+ /* ******************** TAR ******************** */
394+ ld r4, THREAD_TM_TAR(r3)
395+ mtspr SPRN_TAR, r4
375396
376− mtctr r3
377− mtlr r4
378− mtcr r5
379− mtxer r6
397+ /* Load up the PPR and DSCR in GPRs only at this stage */
398+ ld r5, THREAD_TM_DSCR(r3)
399+ ld r6, THREAD_TM_PPR(r3)
380400
381401 /* Clear the MSR RI since we are about to change R1. EE is already off
382402 */
@@ -384,19 +404,26 @@ restore_gprs: · 1 unmodified line
384404 mtmsrd r4, 1
385405
386406 REST_4GPRS(0, r7) /* GPR0-3 */
387− REST_GPR(4, r7) /* GPR4-6 */
388− REST_GPR(5, r7)
389− REST_GPR(6, r7)
407+ REST_GPR(4, r7) /* GPR4 */
390408 REST_4GPRS(8, r7) /* GPR8-11 */
391409 REST_2GPRS(12, r7) /* GPR12-13 */
392410
393411 REST_NVGPRS(r7) /* GPR14-31 */
394412
395− ld r7, GPR7(r7) /* GPR7 */
413+ /* Load up PPR and DSCR here so we don't run with user values for long
414+ */
415+ mtspr SPRN_DSCR, r5
416+ mtspr SPRN_PPR, r6
417+
418+ REST_GPR(5, r7) /* GPR5-7 */
419+ REST_GPR(6, r7)
420+ ld r7, GPR7(r7)
396421
397422 /* Commit register state as checkpointed state: */
398423 TRECHKPT
399424
425+ HMT_MEDIUM
426+
400427 /* Our transactional state has now changed.
401428 *
402429 * Now just get out of here. Transactional (current) state will be
@@ -419,6 +446,12 @@ restore_gprs: · 16 unmodified lines
419446 mtcr r4
420447 mtlr r0
421448 ld r2, 40(r1)
449+
450+ /* Load system default DSCR */
451+ ld r4, DSCR_DEFAULT@toc(r2)
452+ ld r0, 0(r4)
453+ mtspr SPRN_DSCR, r0
454+
422455 blr
423456
424457 /* ****************************************************************** */
arch/powerpc/kernel/vio.c+8−4
@@ -1530,11 +1530,15 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, · 1529 unmodified lines
15301530 const char *cp;
15311531
15321532 dn = dev->of_node;
1533− if (!dn)
1534− return -ENODEV;
1533+ if (!dn) {
1534+ strcat(buf, "\n");
1535+ return strlen(buf);
1536+ }
15351537 cp = of_get_property(dn, "compatible", NULL);
1536− if (!cp)
1537− return -ENODEV;
1538+ if (!cp) {
1539+ strcat(buf, "\n");
1540+ return strlen(buf);
1541+ }
15381542
15391543 return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
15401544 }
arch/powerpc/kvm/book3s_hv_rmhandlers.S+1−1
@@ -1066,7 +1066,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) · 1065 unmodified lines
10661066 BEGIN_FTR_SECTION
10671067 mfspr r8, SPRN_DSCR
10681068 ld r7, HSTATE_DSCR(r13)
1069− std r8, VCPU_DSCR(r7)
1069+ std r8, VCPU_DSCR(r9)
10701070 mtspr SPRN_DSCR, r7
10711071 END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206)
10721072
arch/powerpc/kvm/e500_mmu_host.c+17−1
@@ -332,6 +332,13 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 331 unmodified lines
332332 unsigned long hva;
333333 int pfnmap = 0;
334334 int tsize = BOOK3E_PAGESZ_4K;
335+ int ret = 0;
336+ unsigned long mmu_seq;
337+ struct kvm *kvm = vcpu_e500->vcpu.kvm;
338+
339+ /* used to check for invalidations in progress */
340+ mmu_seq = kvm->mmu_notifier_seq;
341+ smp_rmb();
335342
336343 /*
337344 * Translate guest physical to true physical, acquiring
@@ -449,6 +456,12 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 111 unmodified lines
449456 gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1);
450457 }
451458
459+ spin_lock(&kvm->mmu_lock);
460+ if (mmu_notifier_retry(kvm, mmu_seq)) {
461+ ret = -EAGAIN;
462+ goto out;
463+ }
464+
452465 kvmppc_e500_ref_setup(ref, gtlbe, pfn);
453466
454467 kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
@@ -457,10 +470,13 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 2 unmodified lines
457470 /* Clear i-cache for new pages */
458471 kvmppc_mmu_flush_icache(pfn);
459472
473+out:
474+ spin_unlock(&kvm->mmu_lock);
475+
460476 /* Drop refcount on page, so that mmu notifiers can clear it */
461477 kvm_release_pfn_clean(pfn);
462478
463− return 0;
479+ return ret;
464480 }
465481
466482 /* XXX only map the one-one case, for now use TLB0 */
arch/powerpc/lib/checksum_64.S+42−16
@@ -226,19 +226,35 @@ _GLOBAL(csum_partial) · 225 unmodified lines
226226 blr
227227
228228
229− .macro source
229+ .macro srcnr
230230 100:
231231 .section __ex_table,"a"
232232 .align 3
233− .llong 100b,.Lsrc_error
233+ .llong 100b,.Lsrc_error_nr
234234 .previous
235235 .endm
236236
237− .macro dest
237+ .macro source
238+150:
239+ .section __ex_table,"a"
240+ .align 3
241+ .llong 150b,.Lsrc_error
242+ .previous
243+ .endm
244+
245+ .macro dstnr
238246 200:
239247 .section __ex_table,"a"
240248 .align 3
241− .llong 200b,.Ldest_error
249+ .llong 200b,.Ldest_error_nr
250+ .previous
251+ .endm
252+
253+ .macro dest
254+250:
255+ .section __ex_table,"a"
256+ .align 3
257+ .llong 250b,.Ldest_error
242258 .previous
243259 .endm
244260
@@ -269,16 +285,16 @@ _GLOBAL(csum_partial_copy_generic) · 24 unmodified lines
269285 rldicl. r6,r3,64-1,64-2 /* r6 = (r3 & 0x3) >> 1 */
270286 beq .Lcopy_aligned
271287
272− li r7,4
273− sub r6,r7,r6
288+ li r9,4
289+ sub r6,r9,r6
274290 mtctr r6
275291
276292 1:
277−source; lhz r6,0(r3) /* align to doubleword */
293+srcnr; lhz r6,0(r3) /* align to doubleword */
278294 subi r5,r5,2
279295 addi r3,r3,2
280296 adde r0,r0,r6
281−dest; sth r6,0(r4)
297+dstnr; sth r6,0(r4)
282298 addi r4,r4,2
283299 bdnz 1b
284300
@@ -392,10 +408,10 @@ dest; std r16,56(r4) · 107 unmodified lines
392408
393409 mtctr r6
394410 3:
395−source; ld r6,0(r3)
411+srcnr; ld r6,0(r3)
396412 addi r3,r3,8
397413 adde r0,r0,r6
398−dest; std r6,0(r4)
414+dstnr; std r6,0(r4)
399415 addi r4,r4,8
400416 bdnz 3b
401417
@@ -405,10 +421,10 @@ dest; std r6,0(r4) · 3 unmodified lines
405421 srdi. r6,r5,2
406422 beq .Lcopy_tail_halfword
407423
408−source; lwz r6,0(r3)
424+srcnr; lwz r6,0(r3)
409425 addi r3,r3,4
410426 adde r0,r0,r6
411−dest; stw r6,0(r4)
427+dstnr; stw r6,0(r4)
412428 addi r4,r4,4
413429 subi r5,r5,4
414430
@@ -416,10 +432,10 @@ dest; stw r6,0(r4) · 1 unmodified line
416432 srdi. r6,r5,1
417433 beq .Lcopy_tail_byte
418434
419−source; lhz r6,0(r3)
435+srcnr; lhz r6,0(r3)
420436 addi r3,r3,2
421437 adde r0,r0,r6
422−dest; sth r6,0(r4)
438+dstnr; sth r6,0(r4)
423439 addi r4,r4,2
424440 subi r5,r5,2
425441
@@ -427,10 +443,10 @@ dest; sth r6,0(r4) · 1 unmodified line
427443 andi. r6,r5,1
428444 beq .Lcopy_finish
429445
430−source; lbz r6,0(r3)
446+srcnr; lbz r6,0(r3)
431447 sldi r9,r6,8 /* Pad the byte out to 16 bits */
432448 adde r0,r0,r9
433−dest; stb r6,0(r4)
449+dstnr; stb r6,0(r4)
434450
435451 .Lcopy_finish:
436452 addze r0,r0 /* add in final carry */
@@ -440,6 +456,11 @@ dest; stb r6,0(r4) · 3 unmodified lines
440456 blr
441457
442458 .Lsrc_error:
459+ ld r14,STK_REG(R14)(r1)
460+ ld r15,STK_REG(R15)(r1)
461+ ld r16,STK_REG(R16)(r1)
462+ addi r1,r1,STACKFRAMESIZE
463+.Lsrc_error_nr:
443464 cmpdi 0,r7,0
444465 beqlr
445466 li r6,-EFAULT
@@ -447,6 +468,11 @@ dest; stb r6,0(r4) · 1 unmodified line
447468 blr
448469
449470 .Ldest_error:
471+ ld r14,STK_REG(R14)(r1)
472+ ld r15,STK_REG(R15)(r1)
473+ ld r16,STK_REG(R16)(r1)
474+ addi r1,r1,STACKFRAMESIZE
475+.Ldest_error_nr:
450476 cmpdi 0,r8,0
451477 beqlr
452478 li r6,-EFAULT
arch/powerpc/mm/init_64.c+4−0
@@ -300,5 +300,9 @@ void vmemmap_free(unsigned long start, unsigned long end) · 299 unmodified lines
300300 {
301301 }
302302
303+void register_page_bootmem_memmap(unsigned long section_nr,
304+ struct page *start_page, unsigned long size)
305+{
306+}
303307 #endif /* CONFIG_SPARSEMEM_VMEMMAP */
304308
arch/powerpc/mm/mem.c+9−0
@@ -297,12 +297,21 @@ void __init paging_init(void) · 296 unmodified lines
297297 }
298298 #endif /* ! CONFIG_NEED_MULTIPLE_NODES */
299299
300+static void __init register_page_bootmem_info(void)
301+{
302+ int i;
303+
304+ for_each_online_node(i)
305+ register_page_bootmem_info_node(NODE_DATA(i));
306+}
307+
300308 void __init mem_init(void)
301309 {
302310 #ifdef CONFIG_SWIOTLB
303311 swiotlb_init(0);
304312 #endif
305313
314+ register_page_bootmem_info();
306315 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
307316 set_max_mapnr(max_pfn);
308317 free_all_bootmem();
arch/powerpc/perf/power8-pmu.c+3−2
@@ -199,6 +199,7 @@ · 198 unmodified lines
199199 #define MMCR1_UNIT_SHIFT(pmc) (60 - (4 * ((pmc) - 1)))
200200 #define MMCR1_COMBINE_SHIFT(pmc) (35 - ((pmc) - 1))
201201 #define MMCR1_PMCSEL_SHIFT(pmc) (24 - (((pmc) - 1)) * 8)
202+#define MMCR1_FAB_SHIFT 36
202203 #define MMCR1_DC_QUAL_SHIFT 47
203204 #define MMCR1_IC_QUAL_SHIFT 46
204205
@@ -388,8 +389,8 @@ static int power8_compute_mmcr(u64 event[], int n_ev, · 183 unmodified lines
388389 * the threshold bits are used for the match value.
389390 */
390391 if (event_is_fab_match(event[i])) {
391− mmcr1 |= (event[i] >> EVENT_THR_CTL_SHIFT) &
392− EVENT_THR_CTL_MASK;
392+ mmcr1 |= ((event[i] >> EVENT_THR_CTL_SHIFT) &
393+ EVENT_THR_CTL_MASK) << MMCR1_FAB_SHIFT;
393394 } else {
394395 val = (event[i] >> EVENT_THR_CTL_SHIFT) & EVENT_THR_CTL_MASK;
395396 mmcra |= val << MMCRA_THR_CTL_SHIFT;
arch/s390/include/asm/jump_label.h+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515
1616 static __always_inline bool arch_static_branch(struct static_key *key)
1717 {
18− asm goto("0: brcl 0,0\n"
18+ asm_volatile_goto("0: brcl 0,0\n"
1919 ".pushsection __jump_table, \"aw\"\n"
2020 ASM_ALIGN "\n"
2121 ASM_PTR " 0b, %l[label], %0\n"
arch/s390/include/asm/pgtable.h+3−1
@@ -748,7 +748,9 @@ static inline void pgste_set_key(pte_t *ptep, pgste_t pgste, pte_t entry) · 747 unmodified lines
748748
749749 static inline void pgste_set_pte(pte_t *ptep, pte_t entry)
750750 {
751− if (!MACHINE_HAS_ESOP && (pte_val(entry) & _PAGE_WRITE)) {
751+ if (!MACHINE_HAS_ESOP &&
752+ (pte_val(entry) & _PAGE_PRESENT) &&
753+ (pte_val(entry) & _PAGE_WRITE)) {
752754 /*
753755 * Without enhanced suppression-on-protection force
754756 * the dirty bit on for all writable ptes.
arch/s390/include/asm/timex.h+14−14
@@ -71,30 +71,30 @@ static inline void local_tick_enable(unsigned long long comp) · 70 unmodified lines
7171
7272 typedef unsigned long long cycles_t;
7373
74−static inline unsigned long long get_tod_clock(void)
75−{
76− unsigned long long clk;
77−
78−#ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES
79− asm volatile(".insn s,0xb27c0000,%0" : "=Q" (clk) : : "cc");
80−#else
81− asm volatile("stck %0" : "=Q" (clk) : : "cc");
82−#endif
83− return clk;
84−}
85−
8674 static inline void get_tod_clock_ext(char *clk)
8775 {
8876 asm volatile("stcke %0" : "=Q" (*clk) : : "cc");
8977 }
9078
91−static inline unsigned long long get_tod_clock_xt(void)
79+static inline unsigned long long get_tod_clock(void)
9280 {
9381 unsigned char clk[16];
9482 get_tod_clock_ext(clk);
9583 return *((unsigned long long *)&clk[1]);
9684 }
9785
86+static inline unsigned long long get_tod_clock_fast(void)
87+{
88+#ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES
89+ unsigned long long clk;
90+
91+ asm volatile("stckf %0" : "=Q" (clk) : : "cc");
92+ return clk;
93+#else
94+ return get_tod_clock();
95+#endif
96+}
97+
9898 static inline cycles_t get_cycles(void)
9999 {
100100 return (cycles_t) get_tod_clock() >> 2;
@@ -125,7 +125,7 @@ extern u64 sched_clock_base_cc; · 24 unmodified lines
125125 */
126126 static inline unsigned long long get_tod_clock_monotonic(void)
127127 {
128− return get_tod_clock_xt() - sched_clock_base_cc;
128+ return get_tod_clock() - sched_clock_base_cc;
129129 }
130130
131131 /**
arch/s390/kernel/compat_signal.c+2−2
@@ -99,7 +99,7 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) · 98 unmodified lines
9999 break;
100100 }
101101 }
102− return err;
102+ return err ? -EFAULT : 0;
103103 }
104104
105105 int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
@@ -148,7 +148,7 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) · 42 unmodified lines
148148 break;
149149 }
150150 }
151− return err;
151+ return err ? -EFAULT : 0;
152152 }
153153
154154 static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs)
arch/s390/kernel/crash_dump.c+20−22
@@ -40,28 +40,26 @@ static inline void *load_real_addr(void *addr) · 39 unmodified lines
4040 }
4141
4242 /*
43− * Copy up to one page to vmalloc or real memory
43+ * Copy real to virtual or real memory
4444 */
45−static ssize_t copy_page_real(void *buf, void *src, size_t csize)
45+static int copy_from_realmem(void *dest, void *src, size_t count)
4646 {
47− size_t size;
47+ unsigned long size;
48+ int rc;
4849
49− if (is_vmalloc_addr(buf)) {
50− BUG_ON(csize >= PAGE_SIZE);
51− /* If buf is not page aligned, copy first part */
52− size = min(roundup(__pa(buf), PAGE_SIZE) - __pa(buf), csize);
53− if (size) {
54− if (memcpy_real(load_real_addr(buf), src, size))
55− return -EFAULT;
56− buf += size;
57− src += size;
58− }
59− /* Copy second part */
60− size = csize - size;
61− return (size) ? memcpy_real(load_real_addr(buf), src, size) : 0;
62− } else {
63− return memcpy_real(buf, src, csize);
64− }
50+ if (!count)
51+ return 0;
52+ if (!is_vmalloc_or_module_addr(dest))
53+ return memcpy_real(dest, src, count);
54+ do {
55+ size = min(count, PAGE_SIZE - (__pa(dest) & ~PAGE_MASK));
56+ if (memcpy_real(load_real_addr(dest), src, size))
57+ return -EFAULT;
58+ count -= size;
59+ dest += size;
60+ src += size;
61+ } while (count);
62+ return 0;
6563 }
6664
6765 /*
@@ -114,7 +112,7 @@ static ssize_t copy_oldmem_page_kdump(char *buf, size_t csize, · 46 unmodified lines
114112 rc = copy_to_user_real((void __force __user *) buf,
115113 (void *) src, csize);
116114 else
117− rc = copy_page_real(buf, (void *) src, csize);
115+ rc = copy_from_realmem(buf, (void *) src, csize);
118116 return (rc == 0) ? rc : csize;
119117 }
120118
@@ -210,7 +208,7 @@ int copy_from_oldmem(void *dest, void *src, size_t count) · 89 unmodified lines
210208 if (OLDMEM_BASE) {
211209 if ((unsigned long) src < OLDMEM_SIZE) {
212210 copied = min(count, OLDMEM_SIZE - (unsigned long) src);
213− rc = memcpy_real(dest, src + OLDMEM_BASE, copied);
211+ rc = copy_from_realmem(dest, src + OLDMEM_BASE, copied);
214212 if (rc)
215213 return rc;
216214 }
@@ -223,7 +221,7 @@ int copy_from_oldmem(void *dest, void *src, size_t count) · 6 unmodified lines
223221 return rc;
224222 }
225223 }
226− return memcpy_real(dest + copied, src + copied, count - copied);
224+ return copy_from_realmem(dest + copied, src + copied, count - copied);
227225 }
228226
229227 /*
arch/s390/kernel/debug.c+1−1
@@ -867,7 +867,7 @@ static inline void · 866 unmodified lines
867867 debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level,
868868 int exception)
869869 {
870− active->id.stck = get_tod_clock();
870+ active->id.stck = get_tod_clock_fast();
871871 active->id.fields.cpuid = smp_processor_id();
872872 active->caller = __builtin_return_address(0);
873873 active->id.fields.exception = exception;
arch/s390/kernel/entry.S+1−0
@@ -266,6 +266,7 @@ sysc_sigpending: · 265 unmodified lines
266266 tm __TI_flags+3(%r12),_TIF_SYSCALL
267267 jno sysc_return
268268 lm %r2,%r7,__PT_R2(%r11) # load svc arguments
269+ l %r10,__TI_sysc_table(%r12) # 31 bit system call table
269270 xr %r8,%r8 # svc 0 returns -ENOSYS
270271 clc __PT_INT_CODE+2(2,%r11),BASED(.Lnr_syscalls+2)
271272 jnl sysc_nr_ok # invalid svc number -> do svc 0
arch/s390/kernel/entry64.S+1−0
@@ -297,6 +297,7 @@ sysc_sigpending: · 296 unmodified lines
297297 tm __TI_flags+7(%r12),_TIF_SYSCALL
298298 jno sysc_return
299299 lmg %r2,%r7,__PT_R2(%r11) # load svc arguments
300+ lg %r10,__TI_sysc_table(%r12) # address of system call table
300301 lghi %r8,0 # svc 0 returns -ENOSYS
301302 llgh %r1,__PT_INT_CODE+2(%r11) # load new svc number
302303 cghi %r1,NR_syscalls
arch/s390/kernel/kprobes.c+5−1
@@ -67,6 +67,11 @@ static int __kprobes is_prohibited_opcode(kprobe_opcode_t *insn) · 66 unmodified lines
6767 case 0xac: /* stnsm */
6868 case 0xad: /* stosm */
6969 return -EINVAL;
70+ case 0xc6:
71+ switch (insn[0] & 0x0f) {
72+ case 0x00: /* exrl */
73+ return -EINVAL;
74+ }
7075 }
7176 switch (insn[0]) {
7277 case 0x0101: /* pr */
@@ -180,7 +185,6 @@ static int __kprobes is_insn_relative_long(kprobe_opcode_t *insn) · 107 unmodified lines
180185 break;
181186 case 0xc6:
182187 switch (insn[0] & 0x0f) {
183− case 0x00: /* exrl */
184188 case 0x02: /* pfdrl */
185189 case 0x04: /* cghrl */
186190 case 0x05: /* chrl */
arch/s390/kvm/interrupt.c+3−3
@@ -385,7 +385,7 @@ static int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu) · 384 unmodified lines
385385 }
386386
387387 if ((!rc) && (vcpu->arch.sie_block->ckc <
388− get_tod_clock() + vcpu->arch.sie_block->epoch)) {
388+ get_tod_clock_fast() + vcpu->arch.sie_block->epoch)) {
389389 if ((!psw_extint_disabled(vcpu)) &&
390390 (vcpu->arch.sie_block->gcr[0] & 0x800ul))
391391 rc = 1;
@@ -425,7 +425,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu) · 33 unmodified lines
425425 goto no_timer;
426426 }
427427
428− now = get_tod_clock() + vcpu->arch.sie_block->epoch;
428+ now = get_tod_clock_fast() + vcpu->arch.sie_block->epoch;
429429 if (vcpu->arch.sie_block->ckc < now) {
430430 __unset_cpu_idle(vcpu);
431431 return 0;
@@ -515,7 +515,7 @@ void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu) · 83 unmodified lines
515515 }
516516
517517 if ((vcpu->arch.sie_block->ckc <
518− get_tod_clock() + vcpu->arch.sie_block->epoch))
518+ get_tod_clock_fast() + vcpu->arch.sie_block->epoch))
519519 __try_deliver_ckc_interrupt(vcpu);
520520
521521 if (atomic_read(&fi->active)) {
arch/s390/lib/delay.c+7−7
@@ -44,7 +44,7 @@ static void __udelay_disabled(unsigned long long usecs) · 43 unmodified lines
4444 do {
4545 set_clock_comparator(end);
4646 vtime_stop_cpu();
47− } while (get_tod_clock() < end);
47+ } while (get_tod_clock_fast() < end);
4848 lockdep_on();
4949 __ctl_load(cr0, 0, 0);
5050 __ctl_load(cr6, 6, 6);
@@ -55,7 +55,7 @@ static void __udelay_enabled(unsigned long long usecs) · 4 unmodified lines
5555 {
5656 u64 clock_saved, end;
5757
58− end = get_tod_clock() + (usecs << 12);
58+ end = get_tod_clock_fast() + (usecs << 12);
5959 do {
6060 clock_saved = 0;
6161 if (end < S390_lowcore.clock_comparator) {
@@ -65,7 +65,7 @@ static void __udelay_enabled(unsigned long long usecs) · 3 unmodified lines
6565 vtime_stop_cpu();
6666 if (clock_saved)
6767 local_tick_enable(clock_saved);
68− } while (get_tod_clock() < end);
68+ } while (get_tod_clock_fast() < end);
6969 }
7070
7171 /*
@@ -109,8 +109,8 @@ void udelay_simple(unsigned long long usecs) · 37 unmodified lines
109109 {
110110 u64 end;
111111
112− end = get_tod_clock() + (usecs << 12);
113− while (get_tod_clock() < end)
112+ end = get_tod_clock_fast() + (usecs << 12);
113+ while (get_tod_clock_fast() < end)
114114 cpu_relax();
115115 }
116116
@@ -120,10 +120,10 @@ void __ndelay(unsigned long long nsecs) · 3 unmodified lines
120120
121121 nsecs <<= 9;
122122 do_div(nsecs, 125);
123− end = get_tod_clock() + nsecs;
123+ end = get_tod_clock_fast() + nsecs;
124124 if (nsecs & ~0xfffUL)
125125 __udelay(nsecs >> 12);
126− while (get_tod_clock() < end)
126+ while (get_tod_clock_fast() < end)
127127 barrier();
128128 }
129129 EXPORT_SYMBOL(__ndelay);
arch/sparc/Kconfig+6−1
@@ -506,12 +506,17 @@ config SUN_OPENPROMFS · 505 unmodified lines
506506 Only choose N if you know in advance that you will not need to modify
507507 OpenPROM settings on the running system.
508508
509−# Makefile helper
509+# Makefile helpers
510510 config SPARC64_PCI
511511 bool
512512 default y
513513 depends on SPARC64 && PCI
514514
515+config SPARC64_PCI_MSI
516+ bool
517+ default y
518+ depends on SPARC64_PCI && PCI_MSI
519+
515520 endmenu
516521
517522 menu "Executable file formats"
arch/sparc/include/asm/floppy_64.h+1−1
@@ -254,7 +254,7 @@ static int sun_fd_request_irq(void) · 253 unmodified lines
254254 once = 1;
255255
256256 error = request_irq(FLOPPY_IRQ, sparc_floppy_irq,
257− IRQF_DISABLED, "floppy", NULL);
257+ 0, "floppy", NULL);
258258
259259 return ((error == 0) ? 0 : -1);
260260 }
arch/sparc/include/asm/jump_label.h+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99
1010 static __always_inline bool arch_static_branch(struct static_key *key)
1111 {
12− asm goto("1:\n\t"
12+ asm_volatile_goto("1:\n\t"
1313 "nop\n\t"
1414 "nop\n\t"
1515 ".pushsection __jump_table, \"aw\"\n\t"
arch/sparc/kernel/Makefile+2−1
@@ -1,3 +1,4 @@
1+
12 #
23 # Makefile for the linux kernel.
34 #
@@ -99,7 +100,7 @@ obj-$(CONFIG_STACKTRACE) += stacktrace.o · 95 unmodified lines
99100 obj-$(CONFIG_SPARC64_PCI) += pci.o pci_common.o psycho_common.o
100101 obj-$(CONFIG_SPARC64_PCI) += pci_psycho.o pci_sabre.o pci_schizo.o
101102 obj-$(CONFIG_SPARC64_PCI) += pci_sun4v.o pci_sun4v_asm.o pci_fire.o
102−obj-$(CONFIG_PCI_MSI) += pci_msi.o
103+obj-$(CONFIG_SPARC64_PCI_MSI) += pci_msi.o
103104
104105 obj-$(CONFIG_COMPAT) += sys32.o sys_sparc32.o signal32.o
105106
arch/sparc/kernel/ds.c+2−3
@@ -849,9 +849,8 @@ void ldom_reboot(const char *boot_command) · 848 unmodified lines
849849 if (boot_command && strlen(boot_command)) {
850850 unsigned long len;
851851
852− strcpy(full_boot_str, "boot ");
853− strlcpy(full_boot_str + strlen("boot "), boot_command,
854− sizeof(full_boot_str));
852+ snprintf(full_boot_str, sizeof(full_boot_str), "boot %s",
853+ boot_command);
855854 len = strlen(full_boot_str);
856855
857856 if (reboot_data_supported) {
arch/sparc/kernel/ldc.c+2−2
@@ -1249,12 +1249,12 @@ int ldc_bind(struct ldc_channel *lp, const char *name) · 1248 unmodified lines
12491249 snprintf(lp->rx_irq_name, LDC_IRQ_NAME_MAX, "%s RX", name);
12501250 snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name);
12511251
1252− err = request_irq(lp->cfg.rx_irq, ldc_rx, IRQF_DISABLED,
1252+ err = request_irq(lp->cfg.rx_irq, ldc_rx, 0,
12531253 lp->rx_irq_name, lp);
12541254 if (err)
12551255 return err;
12561256
1257− err = request_irq(lp->cfg.tx_irq, ldc_tx, IRQF_DISABLED,
1257+ err = request_irq(lp->cfg.tx_irq, ldc_tx, 0,
12581258 lp->tx_irq_name, lp);
12591259 if (err) {
12601260 free_irq(lp->cfg.rx_irq, lp);
arch/tile/include/asm/atomic.h+3−2
@@ -166,7 +166,7 @@ static inline int atomic_cmpxchg(atomic_t *v, int o, int n) · 165 unmodified lines
166166 *
167167 * Atomically sets @v to @i and returns old @v
168168 */
169−static inline u64 atomic64_xchg(atomic64_t *v, u64 n)
169+static inline long long atomic64_xchg(atomic64_t *v, long long n)
170170 {
171171 return xchg64(&v->counter, n);
172172 }
@@ -180,7 +180,8 @@ static inline u64 atomic64_xchg(atomic64_t *v, u64 n) · 7 unmodified lines
180180 * Atomically checks if @v holds @o and replaces it with @n if so.
181181 * Returns the old value at @v.
182182 */
183−static inline u64 atomic64_cmpxchg(atomic64_t *v, u64 o, u64 n)
183+static inline long long atomic64_cmpxchg(atomic64_t *v, long long o,
184+ long long n)
184185 {
185186 return cmpxchg64(&v->counter, o, n);
186187 }
arch/tile/include/asm/atomic_32.h+15−12
@@ -80,7 +80,7 @@ static inline void atomic_set(atomic_t *v, int n) · 79 unmodified lines
8080 /* A 64bit atomic type */
8181
8282 typedef struct {
83− u64 __aligned(8) counter;
83+ long long counter;
8484 } atomic64_t;
8585
8686 #define ATOMIC64_INIT(val) { (val) }
@@ -91,14 +91,14 @@ typedef struct { · 4 unmodified lines
9191 *
9292 * Atomically reads the value of @v.
9393 */
94−static inline u64 atomic64_read(const atomic64_t *v)
94+static inline long long atomic64_read(const atomic64_t *v)
9595 {
9696 /*
9797 * Requires an atomic op to read both 32-bit parts consistently.
9898 * Casting away const is safe since the atomic support routines
9999 * do not write to memory if the value has not been modified.
100100 */
101− return _atomic64_xchg_add((u64 *)&v->counter, 0);
101+ return _atomic64_xchg_add((long long *)&v->counter, 0);
102102 }
103103
104104 /**
@@ -108,7 +108,7 @@ static inline u64 atomic64_read(const atomic64_t *v) · 3 unmodified lines
108108 *
109109 * Atomically adds @i to @v.
110110 */
111−static inline void atomic64_add(u64 i, atomic64_t *v)
111+static inline void atomic64_add(long long i, atomic64_t *v)
112112 {
113113 _atomic64_xchg_add(&v->counter, i);
114114 }
@@ -120,7 +120,7 @@ static inline void atomic64_add(u64 i, atomic64_t *v) · 5 unmodified lines
120120 *
121121 * Atomically adds @i to @v and returns @i + @v
122122 */
123−static inline u64 atomic64_add_return(u64 i, atomic64_t *v)
123+static inline long long atomic64_add_return(long long i, atomic64_t *v)
124124 {
125125 smp_mb(); /* barrier for proper semantics */
126126 return _atomic64_xchg_add(&v->counter, i) + i;
@@ -135,7 +135,8 @@ static inline u64 atomic64_add_return(u64 i, atomic64_t *v) · 8 unmodified lines
135135 * Atomically adds @a to @v, so long as @v was not already @u.
136136 * Returns non-zero if @v was not @u, and zero otherwise.
137137 */
138−static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u)
138+static inline long long atomic64_add_unless(atomic64_t *v, long long a,
139+ long long u)
139140 {
140141 smp_mb(); /* barrier for proper semantics */
141142 return _atomic64_xchg_add_unless(&v->counter, a, u) != u;
@@ -151,7 +152,7 @@ static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u) · 9 unmodified lines
151152 * atomic64_set() can't be just a raw store, since it would be lost if it
152153 * fell between the load and store of one of the other atomic ops.
153154 */
154−static inline void atomic64_set(atomic64_t *v, u64 n)
155+static inline void atomic64_set(atomic64_t *v, long long n)
155156 {
156157 _atomic64_xchg(&v->counter, n);
157158 }
@@ -236,11 +237,13 @@ extern struct __get_user __atomic_xchg_add_unless(volatile int *p, · 78 unmodified lines
236237 extern struct __get_user __atomic_or(volatile int *p, int *lock, int n);
237238 extern struct __get_user __atomic_andn(volatile int *p, int *lock, int n);
238239 extern struct __get_user __atomic_xor(volatile int *p, int *lock, int n);
239−extern u64 __atomic64_cmpxchg(volatile u64 *p, int *lock, u64 o, u64 n);
240−extern u64 __atomic64_xchg(volatile u64 *p, int *lock, u64 n);
241−extern u64 __atomic64_xchg_add(volatile u64 *p, int *lock, u64 n);
242−extern u64 __atomic64_xchg_add_unless(volatile u64 *p,
243− int *lock, u64 o, u64 n);
240+extern long long __atomic64_cmpxchg(volatile long long *p, int *lock,
241+ long long o, long long n);
242+extern long long __atomic64_xchg(volatile long long *p, int *lock, long long n);
243+extern long long __atomic64_xchg_add(volatile long long *p, int *lock,
244+ long long n);
245+extern long long __atomic64_xchg_add_unless(volatile long long *p,
246+ int *lock, long long o, long long n);
244247
245248 /* Return failure from the atomic wrappers. */
246249 struct __get_user __atomic_bad_address(int __user *addr);
arch/tile/include/asm/cmpxchg.h+17−11
@@ -35,10 +35,10 @@ int _atomic_xchg(int *ptr, int n); · 34 unmodified lines
3535 int _atomic_xchg_add(int *v, int i);
3636 int _atomic_xchg_add_unless(int *v, int a, int u);
3737 int _atomic_cmpxchg(int *ptr, int o, int n);
38−u64 _atomic64_xchg(u64 *v, u64 n);
39−u64 _atomic64_xchg_add(u64 *v, u64 i);
40−u64 _atomic64_xchg_add_unless(u64 *v, u64 a, u64 u);
41−u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n);
38+long long _atomic64_xchg(long long *v, long long n);
39+long long _atomic64_xchg_add(long long *v, long long i);
40+long long _atomic64_xchg_add_unless(long long *v, long long a, long long u);
41+long long _atomic64_cmpxchg(long long *v, long long o, long long n);
4242
4343 #define xchg(ptr, n) \
4444 ({ \
@@ -53,7 +53,8 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); · 8 unmodified lines
5353 if (sizeof(*(ptr)) != 4) \
5454 __cmpxchg_called_with_bad_pointer(); \
5555 smp_mb(); \
56− (typeof(*(ptr)))_atomic_cmpxchg((int *)ptr, (int)o, (int)n); \
56+ (typeof(*(ptr)))_atomic_cmpxchg((int *)ptr, (int)o, \
57+ (int)n); \
5758 })
5859
5960 #define xchg64(ptr, n) \
@@ -61,7 +62,8 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); · 1 unmodified line
6162 if (sizeof(*(ptr)) != 8) \
6263 __xchg_called_with_bad_pointer(); \
6364 smp_mb(); \
64− (typeof(*(ptr)))_atomic64_xchg((u64 *)(ptr), (u64)(n)); \
65+ (typeof(*(ptr)))_atomic64_xchg((long long *)(ptr), \
66+ (long long)(n)); \
6567 })
6668
6769 #define cmpxchg64(ptr, o, n) \
@@ -69,7 +71,8 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); · 1 unmodified line
6971 if (sizeof(*(ptr)) != 8) \
7072 __cmpxchg_called_with_bad_pointer(); \
7173 smp_mb(); \
72− (typeof(*(ptr)))_atomic64_cmpxchg((u64 *)ptr, (u64)o, (u64)n); \
74+ (typeof(*(ptr)))_atomic64_cmpxchg((long long *)ptr, \
75+ (long long)o, (long long)n); \
7376 })
7477
7578 #else
@@ -81,10 +84,11 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); · 5 unmodified lines
8184 switch (sizeof(*(ptr))) { \
8285 case 4: \
8386 __x = (typeof(__x))(unsigned long) \
84− __insn_exch4((ptr), (u32)(unsigned long)(n)); \
87+ __insn_exch4((ptr), \
88+ (u32)(unsigned long)(n)); \
8589 break; \
8690 case 8: \
87− __x = (typeof(__x)) \
91+ __x = (typeof(__x)) \
8892 __insn_exch((ptr), (unsigned long)(n)); \
8993 break; \
9094 default: \
@@ -103,10 +107,12 @@ u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n); · 12 unmodified lines
103107 switch (sizeof(*(ptr))) { \
104108 case 4: \
105109 __x = (typeof(__x))(unsigned long) \
106− __insn_cmpexch4((ptr), (u32)(unsigned long)(n)); \
110+ __insn_cmpexch4((ptr), \
111+ (u32)(unsigned long)(n)); \
107112 break; \
108113 case 8: \
109− __x = (typeof(__x))__insn_cmpexch((ptr), (u64)(n)); \
114+ __x = (typeof(__x))__insn_cmpexch((ptr), \
115+ (long long)(n)); \
110116 break; \
111117 default: \
112118 __cmpxchg_called_with_bad_pointer(); \
arch/tile/include/asm/percpu.h+31−3
@@ -15,9 +15,37 @@ · 14 unmodified lines
1515 #ifndef _ASM_TILE_PERCPU_H
1616 #define _ASM_TILE_PERCPU_H
1717
18−register unsigned long __my_cpu_offset __asm__("tp");
19−#define __my_cpu_offset __my_cpu_offset
20−#define set_my_cpu_offset(tp) (__my_cpu_offset = (tp))
18+register unsigned long my_cpu_offset_reg asm("tp");
19+
20+#ifdef CONFIG_PREEMPT
21+/*
22+ * For full preemption, we can't just use the register variable
23+ * directly, since we need barrier() to hazard against it, causing the
24+ * compiler to reload anything computed from a previous "tp" value.
25+ * But we also don't want to use volatile asm, since we'd like the
26+ * compiler to be able to cache the value across multiple percpu reads.
27+ * So we use a fake stack read as a hazard against barrier().
28+ * The 'U' constraint is like 'm' but disallows postincrement.
29+ */
30+static inline unsigned long __my_cpu_offset(void)
31+{
32+ unsigned long tp;
33+ register unsigned long *sp asm("sp");
34+ asm("move %0, tp" : "=r" (tp) : "U" (*sp));
35+ return tp;
36+}
37+#define __my_cpu_offset __my_cpu_offset()
38+#else
39+/*
40+ * We don't need to hazard against barrier() since "tp" doesn't ever
41+ * change with PREEMPT_NONE, and with PREEMPT_VOLUNTARY it only
42+ * changes at function call points, at which we are already re-reading
43+ * the value of "tp" due to "my_cpu_offset_reg" being a global variable.
44+ */
45+#define __my_cpu_offset my_cpu_offset_reg
46+#endif
47+
48+#define set_my_cpu_offset(tp) (my_cpu_offset_reg = (tp))
2149
2250 #include <asm-generic/percpu.h>
2351
arch/tile/kernel/hardwall.c+3−3
@@ -66,7 +66,7 @@ static struct hardwall_type hardwall_types[] = { · 65 unmodified lines
6666 0,
6767 "udn",
6868 LIST_HEAD_INIT(hardwall_types[HARDWALL_UDN].list),
69− __SPIN_LOCK_INITIALIZER(hardwall_types[HARDWALL_UDN].lock),
69+ __SPIN_LOCK_UNLOCKED(hardwall_types[HARDWALL_UDN].lock),
7070 NULL
7171 },
7272 #ifndef __tilepro__
@@ -77,7 +77,7 @@ static struct hardwall_type hardwall_types[] = { · 4 unmodified lines
7777 1, /* disabled pending hypervisor support */
7878 "idn",
7979 LIST_HEAD_INIT(hardwall_types[HARDWALL_IDN].list),
80− __SPIN_LOCK_INITIALIZER(hardwall_types[HARDWALL_IDN].lock),
80+ __SPIN_LOCK_UNLOCKED(hardwall_types[HARDWALL_IDN].lock),
8181 NULL
8282 },
8383 { /* access to user-space IPI */
@@ -87,7 +87,7 @@ static struct hardwall_type hardwall_types[] = { · 3 unmodified lines
8787 0,
8888 "ipi",
8989 LIST_HEAD_INIT(hardwall_types[HARDWALL_IPI].list),
90− __SPIN_LOCK_INITIALIZER(hardwall_types[HARDWALL_IPI].lock),
90+ __SPIN_LOCK_UNLOCKED(hardwall_types[HARDWALL_IPI].lock),
9191 NULL
9292 },
9393 #endif
arch/tile/kernel/intvec_32.S+3−0
@@ -815,6 +815,9 @@ STD_ENTRY(interrupt_return) · 814 unmodified lines
815815 }
816816 bzt r28, 1f
817817 bnz r29, 1f
818+ /* Disable interrupts explicitly for preemption. */
819+ IRQ_DISABLE(r20,r21)
820+ TRACE_IRQS_OFF
818821 jal preempt_schedule_irq
819822 FEEDBACK_REENTER(interrupt_return)
820823 1:
arch/tile/kernel/intvec_64.S+3−0
@@ -841,6 +841,9 @@ STD_ENTRY(interrupt_return) · 840 unmodified lines
841841 }
842842 beqzt r28, 1f
843843 bnez r29, 1f
844+ /* Disable interrupts explicitly for preemption. */
845+ IRQ_DISABLE(r20,r21)
846+ TRACE_IRQS_OFF
844847 jal preempt_schedule_irq
845848 FEEDBACK_REENTER(interrupt_return)
846849 1:
arch/tile/kernel/stack.c+5−7
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/mmzone.h>
2424 #include <linux/dcache.h>
2525 #include <linux/fs.h>
26+#include <linux/string.h>
2627 #include <asm/backtrace.h>
2728 #include <asm/page.h>
2829 #include <asm/ucontext.h>
@@ -332,21 +333,18 @@ static void describe_addr(struct KBacktraceIterator *kbt, · 303 unmodified lines
332333 }
333334
334335 if (vma->vm_file) {
335− char *s;
336336 p = d_path(&vma->vm_file->f_path, buf, bufsize);
337337 if (IS_ERR(p))
338338 p = "?";
339− s = strrchr(p, '/');
340− if (s)
341− p = s+1;
339+ name = kbasename(p);
342340 } else {
343− p = "anon";
341+ name = "anon";
344342 }
345343
346344 /* Generate a string description of the vma info. */
347− namelen = strlen(p);
345+ namelen = strlen(name);
348346 remaining = (bufsize - 1) - namelen;
349− memmove(buf, p, namelen);
347+ memmove(buf, name, namelen);
350348 snprintf(buf + namelen, remaining, "[%lx+%lx] ",
351349 vma->vm_start, vma->vm_end - vma->vm_start);
352350 }
arch/tile/lib/atomic_32.c+4−4
@@ -107,19 +107,19 @@ unsigned long _atomic_xor(volatile unsigned long *p, unsigned long mask) · 106 unmodified lines
107107 EXPORT_SYMBOL(_atomic_xor);
108108
109109
110−u64 _atomic64_xchg(u64 *v, u64 n)
110+long long _atomic64_xchg(long long *v, long long n)
111111 {
112112 return __atomic64_xchg(v, __atomic_setup(v), n);
113113 }
114114 EXPORT_SYMBOL(_atomic64_xchg);
115115
116−u64 _atomic64_xchg_add(u64 *v, u64 i)
116+long long _atomic64_xchg_add(long long *v, long long i)
117117 {
118118 return __atomic64_xchg_add(v, __atomic_setup(v), i);
119119 }
120120 EXPORT_SYMBOL(_atomic64_xchg_add);
121121
122−u64 _atomic64_xchg_add_unless(u64 *v, u64 a, u64 u)
122+long long _atomic64_xchg_add_unless(long long *v, long long a, long long u)
123123 {
124124 /*
125125 * Note: argument order is switched here since it is easier
@@ -130,7 +130,7 @@ u64 _atomic64_xchg_add_unless(u64 *v, u64 a, u64 u) · 4 unmodified lines
130130 }
131131 EXPORT_SYMBOL(_atomic64_xchg_add_unless);
132132
133−u64 _atomic64_cmpxchg(u64 *v, u64 o, u64 n)
133+long long _atomic64_cmpxchg(long long *v, long long o, long long n)
134134 {
135135 return __atomic64_cmpxchg(v, __atomic_setup(v), o, n);
136136 }
arch/x86/Kconfig+4−3
@@ -860,7 +860,7 @@ source "kernel/Kconfig.preempt" · 859 unmodified lines
860860
861861 config X86_UP_APIC
862862 bool "Local APIC support on uniprocessors"
863− depends on X86_32 && !SMP && !X86_32_NON_STANDARD
863+ depends on X86_32 && !SMP && !X86_32_NON_STANDARD && !PCI_MSI
864864 ---help---
865865 A local APIC (Advanced Programmable Interrupt Controller) is an
866866 integrated interrupt controller in the CPU. If you have a single-CPU
@@ -885,11 +885,11 @@ config X86_UP_IOAPIC · 18 unmodified lines
885885
886886 config X86_LOCAL_APIC
887887 def_bool y
888− depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC
888+ depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_APIC || PCI_MSI
889889
890890 config X86_IO_APIC
891891 def_bool y
892− depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC
892+ depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI
893893
894894 config X86_VISWS_APIC
895895 def_bool y
@@ -1033,6 +1033,7 @@ config X86_REBOOTFIXUPS · 137 unmodified lines
10331033
10341034 config MICROCODE
10351035 tristate "CPU microcode loading support"
1036+ depends on CPU_SUP_AMD || CPU_SUP_INTEL
10361037 select FW_LOADER
10371038 ---help---
10381039
arch/x86/include/asm/cpufeature.h+3−3
@@ -374,7 +374,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) · 373 unmodified lines
374374 * Catch too early usage of this before alternatives
375375 * have run.
376376 */
377− asm goto("1: jmp %l[t_warn]\n"
377+ asm_volatile_goto("1: jmp %l[t_warn]\n"
378378 "2:\n"
379379 ".section .altinstructions,\"a\"\n"
380380 " .long 1b - .\n"
@@ -388,7 +388,7 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) · 7 unmodified lines
388388
389389 #endif
390390
391− asm goto("1: jmp %l[t_no]\n"
391+ asm_volatile_goto("1: jmp %l[t_no]\n"
392392 "2:\n"
393393 ".section .altinstructions,\"a\"\n"
394394 " .long 1b - .\n"
@@ -453,7 +453,7 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit) · 58 unmodified lines
453453 * have. Thus, we force the jump to the widest, 4-byte, signed relative
454454 * offset even though the last would often fit in less bytes.
455455 */
456− asm goto("1: .byte 0xe9\n .long %l[t_dynamic] - 2f\n"
456+ asm_volatile_goto("1: .byte 0xe9\n .long %l[t_dynamic] - 2f\n"
457457 "2:\n"
458458 ".section .altinstructions,\"a\"\n"
459459 " .long 1b - .\n" /* src offset */
arch/x86/include/asm/jump_label.h+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818
1919 static __always_inline bool arch_static_branch(struct static_key *key)
2020 {
21− asm goto("1:"
21+ asm_volatile_goto("1:"
2222 ".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
2323 ".pushsection __jump_table, \"aw\" \n\t"
2424 _ASM_ALIGN "\n\t"
arch/x86/include/asm/mutex_64.h+2−2
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 static inline void __mutex_fastpath_lock(atomic_t *v,
2121 void (*fail_fn)(atomic_t *))
2222 {
23− asm volatile goto(LOCK_PREFIX " decl %0\n"
23+ asm_volatile_goto(LOCK_PREFIX " decl %0\n"
2424 " jns %l[exit]\n"
2525 : : "m" (v->counter)
2626 : "memory", "cc"
@@ -75,7 +75,7 @@ static inline int __mutex_fastpath_lock_retval(atomic_t *count) · 48 unmodified lines
7575 static inline void __mutex_fastpath_unlock(atomic_t *v,
7676 void (*fail_fn)(atomic_t *))
7777 {
78− asm volatile goto(LOCK_PREFIX " incl %0\n"
78+ asm_volatile_goto(LOCK_PREFIX " incl %0\n"
7979 " jg %l[exit]\n"
8080 : : "m" (v->counter)
8181 : "memory", "cc"
arch/x86/kernel/apic/x2apic_uv_x.c+1−1
@@ -113,7 +113,7 @@ static int __init early_get_pnodeid(void) · 112 unmodified lines
113113 break;
114114 case UV3_HUB_PART_NUMBER:
115115 case UV3_HUB_PART_NUMBER_X:
116− uv_min_hub_revision_id += UV3_HUB_REVISION_BASE - 1;
116+ uv_min_hub_revision_id += UV3_HUB_REVISION_BASE;
117117 break;
118118 }
119119
arch/x86/kernel/cpu/perf_event.c+3−8
@@ -1888,10 +1888,7 @@ void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now) · 1887 unmodified lines
18881888 userpg->cap_user_rdpmc = x86_pmu.attr_rdpmc;
18891889 userpg->pmc_width = x86_pmu.cntval_bits;
18901890
1891− if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
1892− return;
1893−
1894− if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
1891+ if (!sched_clock_stable)
18951892 return;
18961893
18971894 userpg->cap_user_time = 1;
@@ -1899,10 +1896,8 @@ void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now) · 1 unmodified line
18991896 userpg->time_shift = CYC2NS_SCALE_FACTOR;
19001897 userpg->time_offset = this_cpu_read(cyc2ns_offset) - now;
19011898
1902− if (sched_clock_stable && !check_tsc_disabled()) {
1903− userpg->cap_user_time_zero = 1;
1904− userpg->time_zero = this_cpu_read(cyc2ns_offset);
1905− }
1899+ userpg->cap_user_time_zero = 1;
1900+ userpg->time_zero = this_cpu_read(cyc2ns_offset);
19061901 }
19071902
19081903 /*
arch/x86/kernel/kvm.c+14−3
@@ -775,11 +775,22 @@ void __init kvm_spinlock_init(void) · 774 unmodified lines
775775 if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))
776776 return;
777777
778− printk(KERN_INFO "KVM setup paravirtual spinlock\n");
778+ pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(kvm_lock_spinning);
779+ pv_lock_ops.unlock_kick = kvm_unlock_kick;
780+}
781+
782+static __init int kvm_spinlock_init_jump(void)
783+{
784+ if (!kvm_para_available())
785+ return 0;
786+ if (!kvm_para_has_feature(KVM_FEATURE_PV_UNHALT))
787+ return 0;
779788
780789 static_key_slow_inc(&paravirt_ticketlocks_enabled);
790+ printk(KERN_INFO "KVM setup paravirtual spinlock\n");
781791
782− pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(kvm_lock_spinning);
783− pv_lock_ops.unlock_kick = kvm_unlock_kick;
792+ return 0;
784793 }
794+early_initcall(kvm_spinlock_init_jump);
795+
785796 #endif /* CONFIG_PARAVIRT_SPINLOCKS */
arch/x86/kernel/reboot.c+8−0
@@ -326,6 +326,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { · 325 unmodified lines
326326 DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"),
327327 },
328328 },
329+ { /* Handle problems with rebooting on the Latitude E5410. */
330+ .callback = set_pci_reboot,
331+ .ident = "Dell Latitude E5410",
332+ .matches = {
333+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
334+ DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5410"),
335+ },
336+ },
329337 { /* Handle problems with rebooting on the Latitude E5420. */
330338 .callback = set_pci_reboot,
331339 .ident = "Dell Latitude E5420",
arch/x86/kernel/sysfb_simplefb.c+2−2
@@ -72,14 +72,14 @@ __init int create_simplefb(const struct screen_info *si, · 71 unmodified lines
7272 * the part that is occupied by the framebuffer */
7373 len = mode->height * mode->stride;
7474 len = PAGE_ALIGN(len);
75− if (len > si->lfb_size << 16) {
75+ if (len > (u64)si->lfb_size << 16) {
7676 printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n");
7777 return -EINVAL;
7878 }
7979
8080 /* setup IORESOURCE_MEM as framebuffer memory */
8181 memset(&res, 0, sizeof(res));
82− res.flags = IORESOURCE_MEM;
82+ res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
8383 res.name = simplefb_resname;
8484 res.start = si->lfb_base;
8585 res.end = si->lfb_base + len - 1;
arch/x86/kvm/vmx.c+12−12
@@ -3255,25 +3255,29 @@ static void vmx_decache_cr4_guest_bits(struct kvm_vcpu *vcpu) · 3254 unmodified lines
32553255
32563256 static void ept_load_pdptrs(struct kvm_vcpu *vcpu)
32573257 {
3258+ struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
3259+
32583260 if (!test_bit(VCPU_EXREG_PDPTR,
32593261 (unsigned long *)&vcpu->arch.regs_dirty))
32603262 return;
32613263
32623264 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
3263− vmcs_write64(GUEST_PDPTR0, vcpu->arch.mmu.pdptrs[0]);
3264− vmcs_write64(GUEST_PDPTR1, vcpu->arch.mmu.pdptrs[1]);
3265− vmcs_write64(GUEST_PDPTR2, vcpu->arch.mmu.pdptrs[2]);
3266− vmcs_write64(GUEST_PDPTR3, vcpu->arch.mmu.pdptrs[3]);
3265+ vmcs_write64(GUEST_PDPTR0, mmu->pdptrs[0]);
3266+ vmcs_write64(GUEST_PDPTR1, mmu->pdptrs[1]);
3267+ vmcs_write64(GUEST_PDPTR2, mmu->pdptrs[2]);
3268+ vmcs_write64(GUEST_PDPTR3, mmu->pdptrs[3]);
32673269 }
32683270 }
32693271
32703272 static void ept_save_pdptrs(struct kvm_vcpu *vcpu)
32713273 {
3274+ struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
3275+
32723276 if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
3273− vcpu->arch.mmu.pdptrs[0] = vmcs_read64(GUEST_PDPTR0);
3274− vcpu->arch.mmu.pdptrs[1] = vmcs_read64(GUEST_PDPTR1);
3275− vcpu->arch.mmu.pdptrs[2] = vmcs_read64(GUEST_PDPTR2);
3276− vcpu->arch.mmu.pdptrs[3] = vmcs_read64(GUEST_PDPTR3);
3277+ mmu->pdptrs[0] = vmcs_read64(GUEST_PDPTR0);
3278+ mmu->pdptrs[1] = vmcs_read64(GUEST_PDPTR1);
3279+ mmu->pdptrs[2] = vmcs_read64(GUEST_PDPTR2);
3280+ mmu->pdptrs[3] = vmcs_read64(GUEST_PDPTR3);
32773281 }
32783282
32793283 __set_bit(VCPU_EXREG_PDPTR,
@@ -7777,10 +7781,6 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) · 4497 unmodified lines
77777781 vmcs_write64(GUEST_PDPTR1, vmcs12->guest_pdptr1);
77787782 vmcs_write64(GUEST_PDPTR2, vmcs12->guest_pdptr2);
77797783 vmcs_write64(GUEST_PDPTR3, vmcs12->guest_pdptr3);
7780− __clear_bit(VCPU_EXREG_PDPTR,
7781− (unsigned long *)&vcpu->arch.regs_avail);
7782− __clear_bit(VCPU_EXREG_PDPTR,
7783− (unsigned long *)&vcpu->arch.regs_dirty);
77847784 }
77857785
77867786 kvm_register_write(vcpu, VCPU_REGS_RSP, vmcs12->guest_rsp);
arch/x86/pci/mmconfig-shared.c+6−1
@@ -700,7 +700,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, · 699 unmodified lines
700700 if (!(pci_probe & PCI_PROBE_MMCONF) || pci_mmcfg_arch_init_failed)
701701 return -ENODEV;
702702
703− if (start > end || !addr)
703+ if (start > end)
704704 return -EINVAL;
705705
706706 mutex_lock(&pci_mmcfg_lock);
@@ -716,6 +716,11 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, · 9 unmodified lines
716716 return -EEXIST;
717717 }
718718
719+ if (!addr) {
720+ mutex_unlock(&pci_mmcfg_lock);
721+ return -EINVAL;
722+ }
723+
719724 rc = -EBUSY;
720725 cfg = pci_mmconfig_alloc(seg, start, end, addr);
721726 if (cfg == NULL) {
arch/x86/xen/smp.c+9−0
@@ -278,6 +278,15 @@ static void __init xen_smp_prepare_boot_cpu(void) · 277 unmodified lines
278278 old memory can be recycled */
279279 make_lowmem_page_readwrite(xen_initial_gdt);
280280
281+#ifdef CONFIG_X86_32
282+ /*
283+ * Xen starts us with XEN_FLAT_RING1_DS, but linux code
284+ * expects __USER_DS
285+ */
286+ loadsegment(ds, __USER_DS);
287+ loadsegment(es, __USER_DS);
288+#endif
289+
281290 xen_filter_cpu_maps();
282291 xen_setup_vcpu_info_placement();
283292 }
block/partitions/efi.c+6−1
@@ -222,11 +222,16 @@ check_hybrid: · 221 unmodified lines
222222 * the disk size.
223223 *
224224 * Hybrid MBRs do not necessarily comply with this.
225+ *
226+ * Consider a bad value here to be a warning to support dd'ing
227+ * an image from a smaller disk to a larger disk.
225228 */
226229 if (ret == GPT_MBR_PROTECTIVE) {
227230 sz = le32_to_cpu(mbr->partition_record[part].size_in_lba);
228231 if (sz != (uint32_t) total_sectors - 1 && sz != 0xFFFFFFFF)
229− ret = 0;
232+ pr_debug("GPT: mbr size in lba (%u) different than whole disk (%u).\n",
233+ sz, min_t(uint32_t,
234+ total_sectors - 1, 0xFFFFFFFF));
230235 }
231236 done:
232237 return ret;
drivers/acpi/Kconfig+4−4
@@ -24,7 +24,7 @@ menuconfig ACPI · 23 unmodified lines
2424 are configured, ACPI is used.
2525
2626 The project home page for the Linux ACPI subsystem is here:
27− <http://www.lesswatts.org/projects/acpi/>
27+ <https://01.org/linux-acpi>
2828
2929 Linux support for ACPI is based on Intel Corporation's ACPI
3030 Component Architecture (ACPI CA). For more information on the
@@ -123,9 +123,9 @@ config ACPI_BUTTON · 92 unmodified lines
123123 default y
124124 help
125125 This driver handles events on the power, sleep, and lid buttons.
126− A daemon reads /proc/acpi/event and perform user-defined actions
127− such as shutting down the system. This is necessary for
128− software-controlled poweroff.
126+ A daemon reads events from input devices or via netlink and
127+ performs user-defined actions such as shutting down the system.
128+ This is necessary for software-controlled poweroff.
129129
130130 To compile this driver as a module, choose M here:
131131 the module will be called button.
drivers/acpi/device_pm.c+0−56
@@ -1025,60 +1025,4 @@ void acpi_dev_pm_detach(struct device *dev, bool power_off) · 1024 unmodified lines
10251025 }
10261026 }
10271027 EXPORT_SYMBOL_GPL(acpi_dev_pm_detach);
1028−
1029−/**
1030− * acpi_dev_pm_add_dependent - Add physical device depending for PM.
1031− * @handle: Handle of ACPI device node.
1032− * @depdev: Device depending on that node for PM.
1033− */
1034−void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev)
1035−{
1036− struct acpi_device_physical_node *dep;
1037− struct acpi_device *adev;
1038−
1039− if (!depdev || acpi_bus_get_device(handle, &adev))
1040− return;
1041−
1042− mutex_lock(&adev->physical_node_lock);
1043−
1044− list_for_each_entry(dep, &adev->power_dependent, node)
1045− if (dep->dev == depdev)
1046− goto out;
1047−
1048− dep = kzalloc(sizeof(*dep), GFP_KERNEL);
1049− if (dep) {
1050− dep->dev = depdev;
1051− list_add_tail(&dep->node, &adev->power_dependent);
1052− }
1053−
1054− out:
1055− mutex_unlock(&adev->physical_node_lock);
1056−}
1057−EXPORT_SYMBOL_GPL(acpi_dev_pm_add_dependent);
1058−
1059−/**
1060− * acpi_dev_pm_remove_dependent - Remove physical device depending for PM.
1061− * @handle: Handle of ACPI device node.
1062− * @depdev: Device depending on that node for PM.
1063− */
1064−void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev)
1065−{
1066− struct acpi_device_physical_node *dep;
1067− struct acpi_device *adev;
1068−
1069− if (!depdev || acpi_bus_get_device(handle, &adev))
1070− return;
1071−
1072− mutex_lock(&adev->physical_node_lock);
1073−
1074− list_for_each_entry(dep, &adev->power_dependent, node)
1075− if (dep->dev == depdev) {
1076− list_del(&dep->node);
1077− kfree(dep);
1078− break;
1079− }
1080−
1081− mutex_unlock(&adev->physical_node_lock);
1082−}
1083−EXPORT_SYMBOL_GPL(acpi_dev_pm_remove_dependent);
10841028 #endif /* CONFIG_PM */
drivers/acpi/power.c+4−100
@@ -59,16 +59,9 @@ ACPI_MODULE_NAME("power"); · 58 unmodified lines
5959 #define ACPI_POWER_RESOURCE_STATE_ON 0x01
6060 #define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF
6161
62−struct acpi_power_dependent_device {
63− struct list_head node;
64− struct acpi_device *adev;
65− struct work_struct work;
66−};
67−
6862 struct acpi_power_resource {
6963 struct acpi_device device;
7064 struct list_head list_node;
71− struct list_head dependent;
7265 char *name;
7366 u32 system_level;
7467 u32 order;
@@ -233,32 +226,6 @@ static int acpi_power_get_list_state(struct list_head *list, int *state) · 158 unmodified lines
233226 return 0;
234227 }
235228
236−static void acpi_power_resume_dependent(struct work_struct *work)
237−{
238− struct acpi_power_dependent_device *dep;
239− struct acpi_device_physical_node *pn;
240− struct acpi_device *adev;
241− int state;
242−
243− dep = container_of(work, struct acpi_power_dependent_device, work);
244− adev = dep->adev;
245− if (acpi_power_get_inferred_state(adev, &state))
246− return;
247−
248− if (state > ACPI_STATE_D0)
249− return;
250−
251− mutex_lock(&adev->physical_node_lock);
252−
253− list_for_each_entry(pn, &adev->physical_node_list, node)
254− pm_request_resume(pn->dev);
255−
256− list_for_each_entry(pn, &adev->power_dependent, node)
257− pm_request_resume(pn->dev);
258−
259− mutex_unlock(&adev->physical_node_lock);
260−}
261−
262229 static int __acpi_power_on(struct acpi_power_resource *resource)
263230 {
264231 acpi_status status = AE_OK;
@@ -283,14 +250,8 @@ static int acpi_power_on_unlocked(struct acpi_power_resource *resource) · 18 unmodified lines
283250 resource->name));
284251 } else {
285252 result = __acpi_power_on(resource);
286− if (result) {
253+ if (result)
287254 resource->ref_count--;
288− } else {
289− struct acpi_power_dependent_device *dep;
290−
291− list_for_each_entry(dep, &resource->dependent, node)
292− schedule_work(&dep->work);
293− }
294255 }
295256 return result;
296257 }
@@ -390,52 +351,6 @@ static int acpi_power_on_list(struct list_head *list) · 93 unmodified lines
390351 return result;
391352 }
392353
393−static void acpi_power_add_dependent(struct acpi_power_resource *resource,
394− struct acpi_device *adev)
395−{
396− struct acpi_power_dependent_device *dep;
397−
398− mutex_lock(&resource->resource_lock);
399−
400− list_for_each_entry(dep, &resource->dependent, node)
401− if (dep->adev == adev)
402− goto out;
403−
404− dep = kzalloc(sizeof(*dep), GFP_KERNEL);
405− if (!dep)
406− goto out;
407−
408− dep->adev = adev;
409− INIT_WORK(&dep->work, acpi_power_resume_dependent);
410− list_add_tail(&dep->node, &resource->dependent);
411−
412− out:
413− mutex_unlock(&resource->resource_lock);
414−}
415−
416−static void acpi_power_remove_dependent(struct acpi_power_resource *resource,
417− struct acpi_device *adev)
418−{
419− struct acpi_power_dependent_device *dep;
420− struct work_struct *work = NULL;
421−
422− mutex_lock(&resource->resource_lock);
423−
424− list_for_each_entry(dep, &resource->dependent, node)
425− if (dep->adev == adev) {
426− list_del(&dep->node);
427− work = &dep->work;
428− break;
429− }
430−
431− mutex_unlock(&resource->resource_lock);
432−
433− if (work) {
434− cancel_work_sync(work);
435− kfree(dep);
436− }
437−}
438−
439354 static struct attribute *attrs[] = {
440355 NULL,
441356 };
@@ -524,8 +439,6 @@ static void acpi_power_expose_hide(struct acpi_device *adev, · 82 unmodified lines
524439
525440 void acpi_power_add_remove_device(struct acpi_device *adev, bool add)
526441 {
527− struct acpi_device_power_state *ps;
528− struct acpi_power_resource_entry *entry;
529442 int state;
530443
531444 if (adev->wakeup.flags.valid)
@@ -535,16 +448,6 @@ void acpi_power_add_remove_device(struct acpi_device *adev, bool add) · 3 unmodified lines
535448 if (!adev->power.flags.power_resources)
536449 return;
537450
538− ps = &adev->power.states[ACPI_STATE_D0];
539− list_for_each_entry(entry, &ps->resources, node) {
540− struct acpi_power_resource *resource = entry->resource;
541−
542− if (add)
543− acpi_power_add_dependent(resource, adev);
544− else
545− acpi_power_remove_dependent(resource, adev);
546− }
547−
548451 for (state = ACPI_STATE_D0; state <= ACPI_STATE_D3_HOT; state++)
549452 acpi_power_expose_hide(adev,
550453 &adev->power.states[state].resources,
@@ -882,7 +785,6 @@ int acpi_add_power_resource(acpi_handle handle) · 331 unmodified lines
882785 acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER,
883786 ACPI_STA_DEFAULT);
884787 mutex_init(&resource->resource_lock);
885− INIT_LIST_HEAD(&resource->dependent);
886788 INIT_LIST_HEAD(&resource->list_node);
887789 resource->name = device->pnp.bus_id;
888790 strcpy(acpi_device_name(device), ACPI_POWER_DEVICE_NAME);
@@ -936,8 +838,10 @@ void acpi_resume_power_resources(void) · 47 unmodified lines
936838 mutex_lock(&resource->resource_lock);
937839
938840 result = acpi_power_get_state(resource->device.handle, &state);
939− if (result)
841+ if (result) {
842+ mutex_unlock(&resource->resource_lock);
940843 continue;
844+ }
941845
942846 if (state == ACPI_POWER_RESOURCE_STATE_OFF
943847 && resource->ref_count) {
drivers/acpi/scan.c+1−2
@@ -968,7 +968,7 @@ int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) · 967 unmodified lines
968968 }
969969 return 0;
970970 }
971−EXPORT_SYMBOL_GPL(acpi_bus_get_device);
971+EXPORT_SYMBOL(acpi_bus_get_device);
972972
973973 int acpi_device_add(struct acpi_device *device,
974974 void (*release)(struct device *))
@@ -999,7 +999,6 @@ int acpi_device_add(struct acpi_device *device, · 24 unmodified lines
999999 INIT_LIST_HEAD(&device->wakeup_list);
10001000 INIT_LIST_HEAD(&device->physical_node_list);
10011001 mutex_init(&device->physical_node_lock);
1002− INIT_LIST_HEAD(&device->power_dependent);
10031002
10041003 new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL);
10051004 if (!new_bus_id) {
drivers/ata/ahci.c+1−1
@@ -1343,7 +1343,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 1342 unmodified lines
13431343 if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
13441344 host->flags |= ATA_HOST_PARALLEL_SCAN;
13451345 else
1346− printk(KERN_INFO "ahci: SSS flag set, parallel bus scan disabled\n");
1346+ dev_info(&pdev->dev, "SSS flag set, parallel bus scan disabled\n");
13471347
13481348 if (pi.flags & ATA_FLAG_EM)
13491349 ahci_reset_em(host);
drivers/ata/ahci_platform.c+1−1
@@ -184,7 +184,7 @@ static int ahci_probe(struct platform_device *pdev) · 183 unmodified lines
184184 if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
185185 host->flags |= ATA_HOST_PARALLEL_SCAN;
186186 else
187− printk(KERN_INFO "ahci: SSS flag set, parallel bus scan disabled\n");
187+ dev_info(dev, "SSS flag set, parallel bus scan disabled\n");
188188
189189 if (pi.flags & ATA_FLAG_EM)
190190 ahci_reset_em(host);
drivers/ata/libahci.c+9−1
@@ -778,8 +778,16 @@ static void ahci_start_port(struct ata_port *ap) · 777 unmodified lines
778778 rc = ap->ops->transmit_led_message(ap,
779779 emp->led_state,
780780 4);
781+ /*
782+ * If busy, give a breather but do not
783+ * release EH ownership by using msleep()
784+ * instead of ata_msleep(). EM Transmit
785+ * bit is busy for the whole host and
786+ * releasing ownership will cause other
787+ * ports to fail the same way.
788+ */
781789 if (rc == -EBUSY)
782− ata_msleep(ap, 1);
790+ msleep(1);
783791 else
784792 break;
785793 }
drivers/ata/libata-acpi.c+0−14
@@ -1035,17 +1035,3 @@ void ata_acpi_on_disable(struct ata_device *dev) · 1034 unmodified lines
10351035 {
10361036 ata_acpi_clear_gtf(dev);
10371037 }
1038−
1039−void ata_scsi_acpi_bind(struct ata_device *dev)
1040−{
1041− acpi_handle handle = ata_dev_acpi_handle(dev);
1042− if (handle)
1043− acpi_dev_pm_add_dependent(handle, &dev->sdev->sdev_gendev);
1044−}
1045−
1046−void ata_scsi_acpi_unbind(struct ata_device *dev)
1047−{
1048− acpi_handle handle = ata_dev_acpi_handle(dev);
1049− if (handle)
1050− acpi_dev_pm_remove_dependent(handle, &dev->sdev->sdev_gendev);
1051−}
drivers/ata/libata-eh.c+3−3
@@ -1322,14 +1322,14 @@ void ata_eh_qc_complete(struct ata_queued_cmd *qc) · 1321 unmodified lines
13221322 * should be retried. To be used from EH.
13231323 *
13241324 * SCSI midlayer limits the number of retries to scmd->allowed.
1325− * scmd->retries is decremented for commands which get retried
1325+ * scmd->allowed is incremented for commands which get retried
13261326 * due to unrelated failures (qc->err_mask is zero).
13271327 */
13281328 void ata_eh_qc_retry(struct ata_queued_cmd *qc)
13291329 {
13301330 struct scsi_cmnd *scmd = qc->scsicmd;
1331− if (!qc->err_mask && scmd->retries)
1332− scmd->retries--;
1331+ if (!qc->err_mask)
1332+ scmd->allowed++;
13331333 __ata_eh_qc_complete(qc);
13341334 }
13351335
drivers/ata/libata-scsi.c+0−3
@@ -3679,7 +3679,6 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync) · 3678 unmodified lines
36793679 if (!IS_ERR(sdev)) {
36803680 dev->sdev = sdev;
36813681 scsi_device_put(sdev);
3682− ata_scsi_acpi_bind(dev);
36833682 } else {
36843683 dev->sdev = NULL;
36853684 }
@@ -3767,8 +3766,6 @@ static void ata_scsi_remove_dev(struct ata_device *dev) · 81 unmodified lines
37673766 struct scsi_device *sdev;
37683767 unsigned long flags;
37693768
3770− ata_scsi_acpi_unbind(dev);
3771−
37723769 /* Alas, we need to grab scan_mutex to ensure SCSI device
37733770 * state doesn't change underneath us and thus
37743771 * scsi_device_get() always succeeds. The mutex locking can
drivers/ata/libata.h+0−4
@@ -121,8 +121,6 @@ extern void ata_acpi_set_state(struct ata_port *ap, pm_message_t state); · 120 unmodified lines
121121 extern void ata_acpi_bind_port(struct ata_port *ap);
122122 extern void ata_acpi_bind_dev(struct ata_device *dev);
123123 extern acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
124−extern void ata_scsi_acpi_bind(struct ata_device *dev);
125−extern void ata_scsi_acpi_unbind(struct ata_device *dev);
126124 #else
127125 static inline void ata_acpi_dissociate(struct ata_host *host) { }
128126 static inline int ata_acpi_on_suspend(struct ata_port *ap) { return 0; }
@@ -133,8 +131,6 @@ static inline void ata_acpi_set_state(struct ata_port *ap, · 4 unmodified lines
133131 pm_message_t state) { }
134132 static inline void ata_acpi_bind_port(struct ata_port *ap) {}
135133 static inline void ata_acpi_bind_dev(struct ata_device *dev) {}
136−static inline void ata_scsi_acpi_bind(struct ata_device *dev) {}
137−static inline void ata_scsi_acpi_unbind(struct ata_device *dev) {}
138134 #endif
139135
140136 /* libata-scsi.c */
drivers/ata/pata_isapnp.c+1−1
@@ -78,7 +78,7 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev · 77 unmodified lines
7878
7979 ap->ioaddr.cmd_addr = cmd_addr;
8080
81− if (pnp_port_valid(idev, 1) == 0) {
81+ if (pnp_port_valid(idev, 1)) {
8282 ctl_addr = devm_ioport_map(&idev->dev,
8383 pnp_port_start(idev, 1), 1);
8484 ap->ioaddr.altstatus_addr = ctl_addr;
drivers/base/memory.c+5−2
@@ -333,8 +333,10 @@ store_mem_state(struct device *dev, · 332 unmodified lines
333333 online_type = ONLINE_KEEP;
334334 else if (!strncmp(buf, "offline", min_t(int, count, 7)))
335335 online_type = -1;
336− else
337− return -EINVAL;
336+ else {
337+ ret = -EINVAL;
338+ goto err;
339+ }
338340
339341 switch (online_type) {
340342 case ONLINE_KERNEL:
@@ -357,6 +359,7 @@ store_mem_state(struct device *dev, · 16 unmodified lines
357359 ret = -EINVAL; /* should never happen */
358360 }
359361
362+err:
360363 unlock_device_hotplug();
361364
362365 if (ret)
drivers/bus/mvebu-mbus.c+9−3
@@ -700,6 +700,7 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, · 699 unmodified lines
700700 phys_addr_t sdramwins_phys_base,
701701 size_t sdramwins_size)
702702 {
703+ struct device_node *np;
703704 int win;
704705
705706 mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
@@ -712,8 +713,11 @@ static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus, · 6 unmodified lines
712713 return -ENOMEM;
713714 }
714715
715− if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"))
716+ np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
717+ if (np) {
716718 mbus->hw_io_coherency = 1;
719+ of_node_put(np);
720+ }
717721
718722 for (win = 0; win < mbus->soc->num_wins; win++)
719723 mvebu_mbus_disable_window(mbus, win);
@@ -861,11 +865,13 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np, · 141 unmodified lines
861865 int ret;
862866
863867 /*
864− * These are optional, so we clear them and they'll
865− * be zero if they are missing from the DT.
868+ * These are optional, so we make sure that resource_size(x) will
869+ * return 0.
866870 */
867871 memset(mem, 0, sizeof(struct resource));
872+ mem->end = -1;
868873 memset(io, 0, sizeof(struct resource));
874+ io->end = -1;
869875
870876 ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg));
871877 if (!ret) {
drivers/char/random.c+5−6
@@ -640,7 +640,7 @@ struct timer_rand_state { · 639 unmodified lines
640640 */
641641 void add_device_randomness(const void *buf, unsigned int size)
642642 {
643− unsigned long time = get_cycles() ^ jiffies;
643+ unsigned long time = random_get_entropy() ^ jiffies;
644644
645645 mix_pool_bytes(&input_pool, buf, size, NULL);
646646 mix_pool_bytes(&input_pool, &time, sizeof(time), NULL);
@@ -677,7 +677,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num) · 30 unmodified lines
677677 goto out;
678678
679679 sample.jiffies = jiffies;
680− sample.cycles = get_cycles();
680+ sample.cycles = random_get_entropy();
681681 sample.num = num;
682682 mix_pool_bytes(&input_pool, &sample, sizeof(sample), NULL);
683683
@@ -744,7 +744,7 @@ void add_interrupt_randomness(int irq, int irq_flags) · 60 unmodified lines
744744 struct fast_pool *fast_pool = &__get_cpu_var(irq_randomness);
745745 struct pt_regs *regs = get_irq_regs();
746746 unsigned long now = jiffies;
747− __u32 input[4], cycles = get_cycles();
747+ __u32 input[4], cycles = random_get_entropy();
748748
749749 input[0] = cycles ^ jiffies;
750750 input[1] = irq;
@@ -1459,12 +1459,11 @@ struct ctl_table random_table[] = { · 708 unmodified lines
14591459
14601460 static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned;
14611461
1462−static int __init random_int_secret_init(void)
1462+int random_int_secret_init(void)
14631463 {
14641464 get_random_bytes(random_int_secret, sizeof(random_int_secret));
14651465 return 0;
14661466 }
1467−late_initcall(random_int_secret_init);
14681467
14691468 /*
14701469 * Get a random word for internal kernel use only. Similar to urandom but
@@ -1483,7 +1482,7 @@ unsigned int get_random_int(void) · 12 unmodified lines
14831482
14841483 hash = get_cpu_var(get_random_int_hash);
14851484
1486− hash[0] += current->pid + jiffies + get_cycles();
1485+ hash[0] += current->pid + jiffies + random_get_entropy();
14871486 md5_transform(hash, random_int_secret);
14881487 ret = hash[0];
14891488 put_cpu_var(get_random_int_hash);
drivers/char/tpm/xen-tpmfront.c+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/errno.h>
1111 #include <linux/err.h>
1212 #include <linux/interrupt.h>
13+#include <xen/xen.h>
1314 #include <xen/events.h>
1415 #include <xen/interface/io/tpmif.h>
1516 #include <xen/grant_table.h>
drivers/cpufreq/cpufreq-cpu0.c+1−1
@@ -229,7 +229,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) · 228 unmodified lines
229229 if (of_property_read_u32(np, "clock-latency", &transition_latency))
230230 transition_latency = CPUFREQ_ETERNAL;
231231
232− if (cpu_reg) {
232+ if (!IS_ERR(cpu_reg)) {
233233 struct opp *opp;
234234 unsigned long min_uV, max_uV;
235235 int i;
drivers/cpufreq/intel_pstate.c+8−5
@@ -383,6 +383,7 @@ static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) · 382 unmodified lines
383383 static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)
384384 {
385385 int max_perf, min_perf;
386+ u64 val;
386387
387388 intel_pstate_get_min_max(cpu, &min_perf, &max_perf);
388389
@@ -394,8 +395,11 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) · 5 unmodified lines
394395 trace_cpu_frequency(pstate * 100000, cpu->cpu);
395396
396397 cpu->pstate.current_pstate = pstate;
397− wrmsrl(MSR_IA32_PERF_CTL, pstate << 8);
398+ val = pstate << 8;
399+ if (limits.no_turbo)
400+ val |= (u64)1 << 32;
398401
402+ wrmsrl(MSR_IA32_PERF_CTL, val);
399403 }
400404
401405 static inline void intel_pstate_pstate_increase(struct cpudata *cpu, int steps)
@@ -634,8 +638,8 @@ static int intel_pstate_cpu_exit(struct cpufreq_policy *policy) · 232 unmodified lines
634638
635639 static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
636640 {
637− int rc, min_pstate, max_pstate;
638641 struct cpudata *cpu;
642+ int rc;
639643
640644 rc = intel_pstate_init_cpu(policy->cpu);
641645 if (rc)
@@ -649,9 +653,8 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy) · 7 unmodified lines
649653 else
650654 policy->policy = CPUFREQ_POLICY_POWERSAVE;
651655
652− intel_pstate_get_min_max(cpu, &min_pstate, &max_pstate);
653− policy->min = min_pstate * 100000;
654− policy->max = max_pstate * 100000;
656+ policy->min = cpu->pstate.min_pstate * 100000;
657+ policy->max = cpu->pstate.turbo_pstate * 100000;
655658
656659 /* cpuinfo and default policy values */
657660 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * 100000;
drivers/cpufreq/s3c64xx-cpufreq.c+1−1
@@ -166,7 +166,7 @@ static void __init s3c64xx_cpufreq_config_regulator(void) · 165 unmodified lines
166166 if (freq->frequency == CPUFREQ_ENTRY_INVALID)
167167 continue;
168168
169− dvfs = &s3c64xx_dvfs_table[freq->index];
169+ dvfs = &s3c64xx_dvfs_table[freq->driver_data];
170170 found = 0;
171171
172172 for (i = 0; i < count; i++) {
drivers/cpufreq/spear-cpufreq.c+1−1
@@ -113,7 +113,7 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy, · 112 unmodified lines
113113 unsigned int target_freq, unsigned int relation)
114114 {
115115 struct cpufreq_freqs freqs;
116− unsigned long newfreq;
116+ long newfreq;
117117 struct clk *srcclk;
118118 int index, ret, mult = 1;
119119
drivers/dma/Kconfig+1−0
@@ -198,6 +198,7 @@ config TI_EDMA · 197 unmodified lines
198198 depends on ARCH_DAVINCI || ARCH_OMAP
199199 select DMA_ENGINE
200200 select DMA_VIRTUAL_CHANNELS
201+ select TI_PRIV_EDMA
201202 default n
202203 help
203204 Enable support for the TI EDMA controller. This DMA
drivers/dma/edma.c+2−1
@@ -306,6 +306,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( · 305 unmodified lines
306306 EDMA_SLOT_ANY);
307307 if (echan->slot[i] < 0) {
308308 dev_err(dev, "Failed to allocate slot\n");
309+ kfree(edesc);
309310 return NULL;
310311 }
311312 }
@@ -749,6 +750,6 @@ static void __exit edma_exit(void) · 437 unmodified lines
749750 }
750751 module_exit(edma_exit);
751752
752−MODULE_AUTHOR("Matt Porter <mporter@ti.com>");
753+MODULE_AUTHOR("Matt Porter <matt.porter@linaro.org>");
753754 MODULE_DESCRIPTION("TI EDMA DMA engine driver");
754755 MODULE_LICENSE("GPL v2");
drivers/dma/imx-dma.c+15−16
@@ -437,17 +437,18 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac) · 436 unmodified lines
437437 struct imxdma_engine *imxdma = imxdmac->imxdma;
438438 int chno = imxdmac->channel;
439439 struct imxdma_desc *desc;
440+ unsigned long flags;
440441
441− spin_lock(&imxdma->lock);
442+ spin_lock_irqsave(&imxdma->lock, flags);
442443 if (list_empty(&imxdmac->ld_active)) {
443− spin_unlock(&imxdma->lock);
444+ spin_unlock_irqrestore(&imxdma->lock, flags);
444445 goto out;
445446 }
446447
447448 desc = list_first_entry(&imxdmac->ld_active,
448449 struct imxdma_desc,
449450 node);
450− spin_unlock(&imxdma->lock);
451+ spin_unlock_irqrestore(&imxdma->lock, flags);
451452
452453 if (desc->sg) {
453454 u32 tmp;
@@ -519,7 +520,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 65 unmodified lines
519520 {
520521 struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan);
521522 struct imxdma_engine *imxdma = imxdmac->imxdma;
522− unsigned long flags;
523523 int slot = -1;
524524 int i;
525525
@@ -527,7 +527,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 1 unmodified line
527527 switch (d->type) {
528528 case IMXDMA_DESC_INTERLEAVED:
529529 /* Try to get a free 2D slot */
530− spin_lock_irqsave(&imxdma->lock, flags);
531530 for (i = 0; i < IMX_DMA_2D_SLOTS; i++) {
532531 if ((imxdma->slots_2d[i].count > 0) &&
533532 ((imxdma->slots_2d[i].xsr != d->x) ||
@@ -537,10 +536,8 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 3 unmodified lines
537536 slot = i;
538537 break;
539538 }
540− if (slot < 0) {
541− spin_unlock_irqrestore(&imxdma->lock, flags);
539+ if (slot < 0)
542540 return -EBUSY;
543− }
544541
545542 imxdma->slots_2d[slot].xsr = d->x;
546543 imxdma->slots_2d[slot].ysr = d->y;
@@ -549,7 +546,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d) · 2 unmodified lines
549546
550547 imxdmac->slot_2d = slot;
551548 imxdmac->enabled_2d = true;
552− spin_unlock_irqrestore(&imxdma->lock, flags);
553549
554550 if (slot == IMX_DMA_2D_SLOT_A) {
555551 d->config_mem &= ~CCR_MSEL_B;
@@ -625,18 +621,17 @@ static void imxdma_tasklet(unsigned long data) · 69 unmodified lines
625621 struct imxdma_channel *imxdmac = (void *)data;
626622 struct imxdma_engine *imxdma = imxdmac->imxdma;
627623 struct imxdma_desc *desc;
624+ unsigned long flags;
628625
629− spin_lock(&imxdma->lock);
626+ spin_lock_irqsave(&imxdma->lock, flags);
630627
631628 if (list_empty(&imxdmac->ld_active)) {
632629 /* Someone might have called terminate all */
633− goto out;
630+ spin_unlock_irqrestore(&imxdma->lock, flags);
631+ return;
634632 }
635633 desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node);
636634
637− if (desc->desc.callback)
638− desc->desc.callback(desc->desc.callback_param);
639−
640635 /* If we are dealing with a cyclic descriptor, keep it on ld_active
641636 * and dont mark the descriptor as complete.
642637 * Only in non-cyclic cases it would be marked as complete
@@ -663,7 +658,11 @@ static void imxdma_tasklet(unsigned long data) · 20 unmodified lines
663658 __func__, imxdmac->channel);
664659 }
665660 out:
666− spin_unlock(&imxdma->lock);
661+ spin_unlock_irqrestore(&imxdma->lock, flags);
662+
663+ if (desc->desc.callback)
664+ desc->desc.callback(desc->desc.callback_param);
665+
667666 }
668667
669668 static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
@@ -883,7 +882,7 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic( · 213 unmodified lines
883882 kfree(imxdmac->sg_list);
884883
885884 imxdmac->sg_list = kcalloc(periods + 1,
886− sizeof(struct scatterlist), GFP_KERNEL);
885+ sizeof(struct scatterlist), GFP_ATOMIC);
887886 if (!imxdmac->sg_list)
888887 return NULL;
889888
drivers/dma/sh/rcar-hpbdma.c+5−4
@@ -93,6 +93,7 @@ struct hpb_dmae_chan { · 92 unmodified lines
9393 void __iomem *base;
9494 const struct hpb_dmae_slave_config *cfg;
9595 char dev_id[16]; /* unique name per DMAC of channel */
96+ dma_addr_t slave_addr;
9697 };
9798
9899 struct hpb_dmae_device {
@@ -432,7 +433,6 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, · 333 unmodified lines
432433 hpb_chan->xfer_mode = XFER_DOUBLE;
433434 } else {
434435 dev_err(hpb_chan->shdma_chan.dev, "DCR setting error");
435− shdma_free_irq(&hpb_chan->shdma_chan);
436436 return -EINVAL;
437437 }
438438
@@ -446,7 +446,8 @@ hpb_dmae_alloc_chan_resources(struct hpb_dmae_chan *hpb_chan, · 7 unmodified lines
446446 return 0;
447447 }
448448
449−static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try)
449+static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id,
450+ dma_addr_t slave_addr, bool try)
450451 {
451452 struct hpb_dmae_chan *chan = to_chan(schan);
452453 const struct hpb_dmae_slave_config *sc =
@@ -457,6 +458,7 @@ static int hpb_dmae_set_slave(struct shdma_chan *schan, int slave_id, bool try) · 4 unmodified lines
457458 if (try)
458459 return 0;
459460 chan->cfg = sc;
461+ chan->slave_addr = slave_addr ? : sc->addr;
460462 return hpb_dmae_alloc_chan_resources(chan, sc);
461463 }
462464
@@ -468,7 +470,7 @@ static dma_addr_t hpb_dmae_slave_addr(struct shdma_chan *schan) · 5 unmodified lines
468470 {
469471 struct hpb_dmae_chan *chan = to_chan(schan);
470472
471− return chan->cfg->addr;
473+ return chan->slave_addr;
472474 }
473475
474476 static struct shdma_desc *hpb_dmae_embedded_desc(void *buf, int i)
@@ -614,7 +616,6 @@ static void hpb_dmae_chan_remove(struct hpb_dmae_device *hpbdev) · 139 unmodified lines
614616 shdma_for_each_chan(schan, &hpbdev->shdma_dev, i) {
615617 BUG_ON(!schan);
616618
617− shdma_free_irq(schan);
618619 shdma_chan_remove(schan);
619620 }
620621 dma_dev->chancnt = 0;
drivers/gpio/gpio-lynxpoint.c+3−2
@@ -248,14 +248,15 @@ static void lp_gpio_irq_handler(unsigned irq, struct irq_desc *desc) · 247 unmodified lines
248248 struct lp_gpio *lg = irq_data_get_irq_handler_data(data);
249249 struct irq_chip *chip = irq_data_get_irq_chip(data);
250250 u32 base, pin, mask;
251− unsigned long reg, pending;
251+ unsigned long reg, ena, pending;
252252 unsigned virq;
253253
254254 /* check from GPIO controller which pin triggered the interrupt */
255255 for (base = 0; base < lg->chip.ngpio; base += 32) {
256256 reg = lp_gpio_reg(&lg->chip, base, LP_INT_STAT);
257+ ena = lp_gpio_reg(&lg->chip, base, LP_INT_ENABLE);
257258
258− while ((pending = inl(reg))) {
259+ while ((pending = (inl(reg) & inl(ena)))) {
259260 pin = __ffs(pending);
260261 mask = BIT(pin);
261262 /* Clear before handling so we don't lose an edge */
drivers/gpio/gpio-omap.c+101−57
@@ -63,6 +63,7 @@ struct gpio_bank { · 62 unmodified lines
6363 struct gpio_chip chip;
6464 struct clk *dbck;
6565 u32 mod_usage;
66+ u32 irq_usage;
6667 u32 dbck_enable_mask;
6768 bool dbck_enabled;
6869 struct device *dev;
@@ -86,6 +87,9 @@ struct gpio_bank { · 17 unmodified lines
8687 #define GPIO_BIT(bank, gpio) (1 << GPIO_INDEX(bank, gpio))
8788 #define GPIO_MOD_CTRL_BIT BIT(0)
8889
90+#define BANK_USED(bank) (bank->mod_usage || bank->irq_usage)
91+#define LINE_USED(line, offset) (line & (1 << offset))
92+
8993 static int irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq)
9094 {
9195 return bank->chip.base + gpio_irq;
@@ -420,15 +424,69 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, · 328 unmodified lines
420424 return 0;
421425 }
422426
427+static void _enable_gpio_module(struct gpio_bank *bank, unsigned offset)
428+{
429+ if (bank->regs->pinctrl) {
430+ void __iomem *reg = bank->base + bank->regs->pinctrl;
431+
432+ /* Claim the pin for MPU */
433+ __raw_writel(__raw_readl(reg) | (1 << offset), reg);
434+ }
435+
436+ if (bank->regs->ctrl && !BANK_USED(bank)) {
437+ void __iomem *reg = bank->base + bank->regs->ctrl;
438+ u32 ctrl;
439+
440+ ctrl = __raw_readl(reg);
441+ /* Module is enabled, clocks are not gated */
442+ ctrl &= ~GPIO_MOD_CTRL_BIT;
443+ __raw_writel(ctrl, reg);
444+ bank->context.ctrl = ctrl;
445+ }
446+}
447+
448+static void _disable_gpio_module(struct gpio_bank *bank, unsigned offset)
449+{
450+ void __iomem *base = bank->base;
451+
452+ if (bank->regs->wkup_en &&
453+ !LINE_USED(bank->mod_usage, offset) &&
454+ !LINE_USED(bank->irq_usage, offset)) {
455+ /* Disable wake-up during idle for dynamic tick */
456+ _gpio_rmw(base, bank->regs->wkup_en, 1 << offset, 0);
457+ bank->context.wake_en =
458+ __raw_readl(bank->base + bank->regs->wkup_en);
459+ }
460+
461+ if (bank->regs->ctrl && !BANK_USED(bank)) {
462+ void __iomem *reg = bank->base + bank->regs->ctrl;
463+ u32 ctrl;
464+
465+ ctrl = __raw_readl(reg);
466+ /* Module is disabled, clocks are gated */
467+ ctrl |= GPIO_MOD_CTRL_BIT;
468+ __raw_writel(ctrl, reg);
469+ bank->context.ctrl = ctrl;
470+ }
471+}
472+
473+static int gpio_is_input(struct gpio_bank *bank, int mask)
474+{
475+ void __iomem *reg = bank->base + bank->regs->direction;
476+
477+ return __raw_readl(reg) & mask;
478+}
479+
423480 static int gpio_irq_type(struct irq_data *d, unsigned type)
424481 {
425482 struct gpio_bank *bank = irq_data_get_irq_chip_data(d);
426483 unsigned gpio = 0;
427484 int retval;
428485 unsigned long flags;
486+ unsigned offset;
429487
430− if (WARN_ON(!bank->mod_usage))
431− return -EINVAL;
488+ if (!BANK_USED(bank))
489+ pm_runtime_get_sync(bank->dev);
432490
433491 #ifdef CONFIG_ARCH_OMAP1
434492 if (d->irq > IH_MPUIO_BASE)
@@ -446,7 +504,17 @@ static int gpio_irq_type(struct irq_data *d, unsigned type) · 11 unmodified lines
446504 return -EINVAL;
447505
448506 spin_lock_irqsave(&bank->lock, flags);
449− retval = _set_gpio_triggering(bank, GPIO_INDEX(bank, gpio), type);
507+ offset = GPIO_INDEX(bank, gpio);
508+ retval = _set_gpio_triggering(bank, offset, type);
509+ if (!LINE_USED(bank->mod_usage, offset)) {
510+ _enable_gpio_module(bank, offset);
511+ _set_gpio_direction(bank, offset, 1);
512+ } else if (!gpio_is_input(bank, 1 << offset)) {
513+ spin_unlock_irqrestore(&bank->lock, flags);
514+ return -EINVAL;
515+ }
516+
517+ bank->irq_usage |= 1 << GPIO_INDEX(bank, gpio);
450518 spin_unlock_irqrestore(&bank->lock, flags);
451519
452520 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
@@ -603,35 +671,19 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) · 150 unmodified lines
603671 * If this is the first gpio_request for the bank,
604672 * enable the bank module.
605673 */
606− if (!bank->mod_usage)
674+ if (!BANK_USED(bank))
607675 pm_runtime_get_sync(bank->dev);
608676
609677 spin_lock_irqsave(&bank->lock, flags);
610678 /* Set trigger to none. You need to enable the desired trigger with
611− * request_irq() or set_irq_type().
679+ * request_irq() or set_irq_type(). Only do this if the IRQ line has
680+ * not already been requested.
612681 */
613− _set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
614−
615− if (bank->regs->pinctrl) {
616− void __iomem *reg = bank->base + bank->regs->pinctrl;
617−
618− /* Claim the pin for MPU */
619− __raw_writel(__raw_readl(reg) | (1 << offset), reg);
620− }
621−
622− if (bank->regs->ctrl && !bank->mod_usage) {
623− void __iomem *reg = bank->base + bank->regs->ctrl;
624− u32 ctrl;
625−
626− ctrl = __raw_readl(reg);
627− /* Module is enabled, clocks are not gated */
628− ctrl &= ~GPIO_MOD_CTRL_BIT;
629− __raw_writel(ctrl, reg);
630− bank->context.ctrl = ctrl;
682+ if (!LINE_USED(bank->irq_usage, offset)) {
683+ _set_gpio_triggering(bank, offset, IRQ_TYPE_NONE);
684+ _enable_gpio_module(bank, offset);
631685 }
632−
633686 bank->mod_usage |= 1 << offset;
634−
635687 spin_unlock_irqrestore(&bank->lock, flags);
636688
637689 return 0;
@@ -640,31 +692,11 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) · 2 unmodified lines
640692 static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
641693 {
642694 struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip);
643− void __iomem *base = bank->base;
644695 unsigned long flags;
645696
646697 spin_lock_irqsave(&bank->lock, flags);
647−
648− if (bank->regs->wkup_en) {
649− /* Disable wake-up during idle for dynamic tick */
650− _gpio_rmw(base, bank->regs->wkup_en, 1 << offset, 0);
651− bank->context.wake_en =
652− __raw_readl(bank->base + bank->regs->wkup_en);
653− }
654−
655698 bank->mod_usage &= ~(1 << offset);
656−
657− if (bank->regs->ctrl && !bank->mod_usage) {
658− void __iomem *reg = bank->base + bank->regs->ctrl;
659− u32 ctrl;
660−
661− ctrl = __raw_readl(reg);
662− /* Module is disabled, clocks are gated */
663− ctrl |= GPIO_MOD_CTRL_BIT;
664− __raw_writel(ctrl, reg);
665− bank->context.ctrl = ctrl;
666− }
667−
699+ _disable_gpio_module(bank, offset);
668700 _reset_gpio(bank, bank->chip.base + offset);
669701 spin_unlock_irqrestore(&bank->lock, flags);
670702
@@ -672,7 +704,7 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset) · 1 unmodified line
672704 * If this is the last gpio to be freed in the bank,
673705 * disable the bank module.
674706 */
675− if (!bank->mod_usage)
707+ if (!BANK_USED(bank))
676708 pm_runtime_put(bank->dev);
677709 }
678710
@@ -762,10 +794,20 @@ static void gpio_irq_shutdown(struct irq_data *d) · 83 unmodified lines
762794 struct gpio_bank *bank = irq_data_get_irq_chip_data(d);
763795 unsigned int gpio = irq_to_gpio(bank, d->hwirq);
764796 unsigned long flags;
797+ unsigned offset = GPIO_INDEX(bank, gpio);
765798
766799 spin_lock_irqsave(&bank->lock, flags);
800+ bank->irq_usage &= ~(1 << offset);
801+ _disable_gpio_module(bank, offset);
767802 _reset_gpio(bank, gpio);
768803 spin_unlock_irqrestore(&bank->lock, flags);
804+
805+ /*
806+ * If this is the last IRQ to be freed in the bank,
807+ * disable the bank module.
808+ */
809+ if (!BANK_USED(bank))
810+ pm_runtime_put(bank->dev);
769811 }
770812
771813 static void gpio_ack_irq(struct irq_data *d)
@@ -897,13 +939,6 @@ static int gpio_input(struct gpio_chip *chip, unsigned offset) · 125 unmodified lines
897939 return 0;
898940 }
899941
900−static int gpio_is_input(struct gpio_bank *bank, int mask)
901−{
902− void __iomem *reg = bank->base + bank->regs->direction;
903−
904− return __raw_readl(reg) & mask;
905−}
906−
907942 static int gpio_get(struct gpio_chip *chip, unsigned offset)
908943 {
909944 struct gpio_bank *bank;
@@ -922,13 +957,22 @@ static int gpio_output(struct gpio_chip *chip, unsigned offset, int value) · 12 unmodified lines
922957 {
923958 struct gpio_bank *bank;
924959 unsigned long flags;
960+ int retval = 0;
925961
926962 bank = container_of(chip, struct gpio_bank, chip);
927963 spin_lock_irqsave(&bank->lock, flags);
964+
965+ if (LINE_USED(bank->irq_usage, offset)) {
966+ retval = -EINVAL;
967+ goto exit;
968+ }
969+
928970 bank->set_dataout(bank, offset, value);
929971 _set_gpio_direction(bank, offset, 0);
972+
973+exit:
930974 spin_unlock_irqrestore(&bank->lock, flags);
931− return 0;
975+ return retval;
932976 }
933977
934978 static int gpio_debounce(struct gpio_chip *chip, unsigned offset,
@@ -1400,7 +1444,7 @@ void omap2_gpio_prepare_for_idle(int pwr_mode) · 465 unmodified lines
14001444 struct gpio_bank *bank;
14011445
14021446 list_for_each_entry(bank, &omap_gpio_list, node) {
1403− if (!bank->mod_usage || !bank->loses_context)
1447+ if (!BANK_USED(bank) || !bank->loses_context)
14041448 continue;
14051449
14061450 bank->power_mode = pwr_mode;
@@ -1414,7 +1458,7 @@ void omap2_gpio_resume_after_idle(void) · 7 unmodified lines
14141458 struct gpio_bank *bank;
14151459
14161460 list_for_each_entry(bank, &omap_gpio_list, node) {
1417− if (!bank->mod_usage || !bank->loses_context)
1461+ if (!BANK_USED(bank) || !bank->loses_context)
14181462 continue;
14191463
14201464 pm_runtime_get_sync(bank->dev);
drivers/gpio/gpio-rcar.c+3−4
@@ -293,10 +293,9 @@ static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) · 292 unmodified lines
293293 if (pdata) {
294294 p->config = *pdata;
295295 } else if (IS_ENABLED(CONFIG_OF) && np) {
296− ret = of_parse_phandle_with_args(np, "gpio-ranges",
297− "#gpio-range-cells", 0, &args);
298− p->config.number_of_pins = ret == 0 && args.args_count == 3
299− ? args.args[2]
296+ ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0,
297+ &args);
298+ p->config.number_of_pins = ret == 0 ? args.args[2]
300299 : RCAR_MAX_GPIO_PER_BANK;
301300 p->config.gpio_base = -1;
302301 }
drivers/gpio/gpiolib.c+4−2
@@ -136,7 +136,7 @@ static struct gpio_desc *gpio_to_desc(unsigned gpio) · 135 unmodified lines
136136 */
137137 static int desc_to_gpio(const struct gpio_desc *desc)
138138 {
139− return desc->chip->base + gpio_chip_hwgpio(desc);
139+ return desc - &gpio_desc[0];
140140 }
141141
142142
@@ -1398,7 +1398,7 @@ static int gpiod_request(struct gpio_desc *desc, const char *label) · 1255 unmodified lines
13981398 int status = -EPROBE_DEFER;
13991399 unsigned long flags;
14001400
1401− if (!desc || !desc->chip) {
1401+ if (!desc) {
14021402 pr_warn("%s: invalid GPIO\n", __func__);
14031403 return -EINVAL;
14041404 }
@@ -1406,6 +1406,8 @@ static int gpiod_request(struct gpio_desc *desc, const char *label) · 1 unmodified line
14061406 spin_lock_irqsave(&gpio_lock, flags);
14071407
14081408 chip = desc->chip;
1409+ if (chip == NULL)
1410+ goto done;
14091411
14101412 if (!try_module_get(chip->owner))
14111413 goto done;
drivers/gpu/drm/drm_drv.c+8−1
@@ -402,9 +402,16 @@ long drm_ioctl(struct file *filp, · 401 unmodified lines
402402 cmd = ioctl->cmd_drv;
403403 }
404404 else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) {
405+ u32 drv_size;
406+
405407 ioctl = &drm_ioctls[nr];
406− cmd = ioctl->cmd;
408+
409+ drv_size = _IOC_SIZE(ioctl->cmd);
407410 usize = asize = _IOC_SIZE(cmd);
411+ if (drv_size > asize)
412+ asize = drv_size;
413+
414+ cmd = ioctl->cmd;
408415 } else
409416 goto err_i1;
410417
drivers/gpu/drm/drm_edid.c+2−0
@@ -2925,6 +2925,8 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb) · 2924 unmodified lines
29252925 /* Speaker Allocation Data Block */
29262926 if (dbl == 3) {
29272927 *sadb = kmalloc(dbl, GFP_KERNEL);
2928+ if (!*sadb)
2929+ return -ENOMEM;
29282930 memcpy(*sadb, &db[1], dbl);
29292931 count = dbl;
29302932 break;
drivers/gpu/drm/drm_fb_helper.c+0−8
@@ -407,14 +407,6 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) · 406 unmodified lines
407407 struct drm_connector *connector;
408408 int i, j;
409409
410− /*
411− * fbdev->blank can be called from irq context in case of a panic.
412− * Since we already have our own special panic handler which will
413− * restore the fbdev console mode completely, just bail out early.
414− */
415− if (oops_in_progress)
416− return;
417−
418410 /*
419411 * fbdev->blank can be called from irq context in case of a panic.
420412 * Since we already have our own special panic handler which will
drivers/gpu/drm/gma500/gtt.c+1−0
@@ -204,6 +204,7 @@ static int psb_gtt_attach_pages(struct gtt_range *gt) · 203 unmodified lines
204204 if (IS_ERR(pages))
205205 return PTR_ERR(pages);
206206
207+ gt->npage = gt->gem.size / PAGE_SIZE;
207208 gt->pages = pages;
208209
209210 return 0;
drivers/gpu/drm/i915/i915_dma.c+3−12
@@ -1290,12 +1290,9 @@ static int i915_load_modeset_init(struct drm_device *dev) · 1289 unmodified lines
12901290 * then we do not take part in VGA arbitration and the
12911291 * vga_client_register() fails with -ENODEV.
12921292 */
1293− if (!HAS_PCH_SPLIT(dev)) {
1294− ret = vga_client_register(dev->pdev, dev, NULL,
1295− i915_vga_set_decode);
1296− if (ret && ret != -ENODEV)
1297− goto out;
1298− }
1293+ ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode);
1294+ if (ret && ret != -ENODEV)
1295+ goto out;
12991296
13001297 intel_register_dsm_handler();
13011298
@@ -1351,12 +1348,6 @@ static int i915_load_modeset_init(struct drm_device *dev) · 49 unmodified lines
13511348 */
13521349 intel_fbdev_initial_config(dev);
13531350
1354− /*
1355− * Must do this after fbcon init so that
1356− * vgacon_save_screen() works during the handover.
1357− */
1358− i915_disable_vga_mem(dev);
1359−
13601351 /* Only enable hotplug handling once the fbdev is fully set up. */
13611352 dev_priv->enable_hotplug_processing = true;
13621353
drivers/gpu/drm/i915/i915_drv.c+4−1
@@ -505,6 +505,8 @@ static int i915_drm_freeze(struct drm_device *dev) · 504 unmodified lines
505505 intel_modeset_suspend_hw(dev);
506506 }
507507
508+ i915_gem_suspend_gtt_mappings(dev);
509+
508510 i915_save_state(dev);
509511
510512 intel_opregion_fini(dev);
@@ -648,7 +650,8 @@ static int i915_drm_thaw(struct drm_device *dev) · 137 unmodified lines
648650 mutex_lock(&dev->struct_mutex);
649651 i915_gem_restore_gtt_mappings(dev);
650652 mutex_unlock(&dev->struct_mutex);
651− }
653+ } else if (drm_core_check_feature(dev, DRIVER_MODESET))
654+ i915_check_and_clear_faults(dev);
652655
653656 __i915_drm_thaw(dev);
654657
drivers/gpu/drm/i915/i915_drv.h+6−2
@@ -497,10 +497,12 @@ struct i915_address_space { · 496 unmodified lines
497497
498498 /* FIXME: Need a more generic return type */
499499 gen6_gtt_pte_t (*pte_encode)(dma_addr_t addr,
500− enum i915_cache_level level);
500+ enum i915_cache_level level,
501+ bool valid); /* Create a valid PTE */
501502 void (*clear_range)(struct i915_address_space *vm,
502503 unsigned int first_entry,
503− unsigned int num_entries);
504+ unsigned int num_entries,
505+ bool use_scratch);
504506 void (*insert_entries)(struct i915_address_space *vm,
505507 struct sg_table *st,
506508 unsigned int first_entry,
@@ -2065,6 +2067,8 @@ void i915_ppgtt_bind_object(struct i915_hw_ppgtt *ppgtt, · 1558 unmodified lines
20652067 void i915_ppgtt_unbind_object(struct i915_hw_ppgtt *ppgtt,
20662068 struct drm_i915_gem_object *obj);
20672069
2070+void i915_check_and_clear_faults(struct drm_device *dev);
2071+void i915_gem_suspend_gtt_mappings(struct drm_device *dev);
20682072 void i915_gem_restore_gtt_mappings(struct drm_device *dev);
20692073 int __must_check i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj);
20702074 void i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj,
drivers/gpu/drm/i915/i915_gem_gtt.c+85−24
@@ -58,9 +58,10 @@ · 57 unmodified lines
5858 #define HSW_WT_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x6)
5959
6060 static gen6_gtt_pte_t snb_pte_encode(dma_addr_t addr,
61− enum i915_cache_level level)
61+ enum i915_cache_level level,
62+ bool valid)
6263 {
63− gen6_gtt_pte_t pte = GEN6_PTE_VALID;
64+ gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0;
6465 pte |= GEN6_PTE_ADDR_ENCODE(addr);
6566
6667 switch (level) {
@@ -79,9 +80,10 @@ static gen6_gtt_pte_t snb_pte_encode(dma_addr_t addr, · 12 unmodified lines
7980 }
8081
8182 static gen6_gtt_pte_t ivb_pte_encode(dma_addr_t addr,
82− enum i915_cache_level level)
83+ enum i915_cache_level level,
84+ bool valid)
8385 {
84− gen6_gtt_pte_t pte = GEN6_PTE_VALID;
86+ gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0;
8587 pte |= GEN6_PTE_ADDR_ENCODE(addr);
8688
8789 switch (level) {
@@ -105,9 +107,10 @@ static gen6_gtt_pte_t ivb_pte_encode(dma_addr_t addr, · 17 unmodified lines
105107 #define BYT_PTE_SNOOPED_BY_CPU_CACHES (1 << 2)
106108
107109 static gen6_gtt_pte_t byt_pte_encode(dma_addr_t addr,
108− enum i915_cache_level level)
110+ enum i915_cache_level level,
111+ bool valid)
109112 {
110− gen6_gtt_pte_t pte = GEN6_PTE_VALID;
113+ gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0;
111114 pte |= GEN6_PTE_ADDR_ENCODE(addr);
112115
113116 /* Mark the page as writeable. Other platforms don't have a
@@ -122,9 +125,10 @@ static gen6_gtt_pte_t byt_pte_encode(dma_addr_t addr, · 8 unmodified lines
122125 }
123126
124127 static gen6_gtt_pte_t hsw_pte_encode(dma_addr_t addr,
125− enum i915_cache_level level)
128+ enum i915_cache_level level,
129+ bool valid)
126130 {
127− gen6_gtt_pte_t pte = GEN6_PTE_VALID;
131+ gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0;
128132 pte |= HSW_PTE_ADDR_ENCODE(addr);
129133
130134 if (level != I915_CACHE_NONE)
@@ -134,9 +138,10 @@ static gen6_gtt_pte_t hsw_pte_encode(dma_addr_t addr, · 3 unmodified lines
134138 }
135139
136140 static gen6_gtt_pte_t iris_pte_encode(dma_addr_t addr,
137− enum i915_cache_level level)
141+ enum i915_cache_level level,
142+ bool valid)
138143 {
139− gen6_gtt_pte_t pte = GEN6_PTE_VALID;
144+ gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0;
140145 pte |= HSW_PTE_ADDR_ENCODE(addr);
141146
142147 switch (level) {
@@ -236,7 +241,8 @@ static int gen6_ppgtt_enable(struct drm_device *dev) · 93 unmodified lines
236241 /* PPGTT support for Sandybdrige/Gen6 and later */
237242 static void gen6_ppgtt_clear_range(struct i915_address_space *vm,
238243 unsigned first_entry,
239− unsigned num_entries)
244+ unsigned num_entries,
245+ bool use_scratch)
240246 {
241247 struct i915_hw_ppgtt *ppgtt =
242248 container_of(vm, struct i915_hw_ppgtt, base);
@@ -245,7 +251,7 @@ static void gen6_ppgtt_clear_range(struct i915_address_space *vm, · 2 unmodified lines
245251 unsigned first_pte = first_entry % I915_PPGTT_PT_ENTRIES;
246252 unsigned last_pte, i;
247253
248− scratch_pte = vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC);
254+ scratch_pte = vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC, true);
249255
250256 while (num_entries) {
251257 last_pte = first_pte + num_entries;
@@ -282,7 +288,7 @@ static void gen6_ppgtt_insert_entries(struct i915_address_space *vm, · 30 unmodified lines
282288 dma_addr_t page_addr;
283289
284290 page_addr = sg_page_iter_dma_address(&sg_iter);
285− pt_vaddr[act_pte] = vm->pte_encode(page_addr, cache_level);
291+ pt_vaddr[act_pte] = vm->pte_encode(page_addr, cache_level, true);
286292 if (++act_pte == I915_PPGTT_PT_ENTRIES) {
287293 kunmap_atomic(pt_vaddr);
288294 act_pt++;
@@ -367,7 +373,7 @@ static int gen6_ppgtt_init(struct i915_hw_ppgtt *ppgtt) · 78 unmodified lines
367373 }
368374
369375 ppgtt->base.clear_range(&ppgtt->base, 0,
370− ppgtt->num_pd_entries * I915_PPGTT_PT_ENTRIES);
376+ ppgtt->num_pd_entries * I915_PPGTT_PT_ENTRIES, true);
371377
372378 ppgtt->pd_offset = first_pd_entry_in_global_pt * sizeof(gen6_gtt_pte_t);
373379
@@ -444,7 +450,8 @@ void i915_ppgtt_unbind_object(struct i915_hw_ppgtt *ppgtt, · 70 unmodified lines
444450 {
445451 ppgtt->base.clear_range(&ppgtt->base,
446452 i915_gem_obj_ggtt_offset(obj) >> PAGE_SHIFT,
447− obj->base.size >> PAGE_SHIFT);
453+ obj->base.size >> PAGE_SHIFT,
454+ true);
448455 }
449456
450457 extern int intel_iommu_gfx_mapped;
@@ -485,15 +492,65 @@ static void undo_idling(struct drm_i915_private *dev_priv, bool interruptible) · 34 unmodified lines
485492 dev_priv->mm.interruptible = interruptible;
486493 }
487494
495+void i915_check_and_clear_faults(struct drm_device *dev)
496+{
497+ struct drm_i915_private *dev_priv = dev->dev_private;
498+ struct intel_ring_buffer *ring;
499+ int i;
500+
501+ if (INTEL_INFO(dev)->gen < 6)
502+ return;
503+
504+ for_each_ring(ring, dev_priv, i) {
505+ u32 fault_reg;
506+ fault_reg = I915_READ(RING_FAULT_REG(ring));
507+ if (fault_reg & RING_FAULT_VALID) {
508+ DRM_DEBUG_DRIVER("Unexpected fault\n"
509+ "\tAddr: 0x%08lx\\n"
510+ "\tAddress space: %s\n"
511+ "\tSource ID: %d\n"
512+ "\tType: %d\n",
513+ fault_reg & PAGE_MASK,
514+ fault_reg & RING_FAULT_GTTSEL_MASK ? "GGTT" : "PPGTT",
515+ RING_FAULT_SRCID(fault_reg),
516+ RING_FAULT_FAULT_TYPE(fault_reg));
517+ I915_WRITE(RING_FAULT_REG(ring),
518+ fault_reg & ~RING_FAULT_VALID);
519+ }
520+ }
521+ POSTING_READ(RING_FAULT_REG(&dev_priv->ring[RCS]));
522+}
523+
524+void i915_gem_suspend_gtt_mappings(struct drm_device *dev)
525+{
526+ struct drm_i915_private *dev_priv = dev->dev_private;
527+
528+ /* Don't bother messing with faults pre GEN6 as we have little
529+ * documentation supporting that it's a good idea.
530+ */
531+ if (INTEL_INFO(dev)->gen < 6)
532+ return;
533+
534+ i915_check_and_clear_faults(dev);
535+
536+ dev_priv->gtt.base.clear_range(&dev_priv->gtt.base,
537+ dev_priv->gtt.base.start / PAGE_SIZE,
538+ dev_priv->gtt.base.total / PAGE_SIZE,
539+ false);
540+}
541+
488542 void i915_gem_restore_gtt_mappings(struct drm_device *dev)
489543 {
490544 struct drm_i915_private *dev_priv = dev->dev_private;
491545 struct drm_i915_gem_object *obj;
492546
547+ i915_check_and_clear_faults(dev);
548+
493549 /* First fill our portion of the GTT with scratch pages */
494550 dev_priv->gtt.base.clear_range(&dev_priv->gtt.base,
495551 dev_priv->gtt.base.start / PAGE_SIZE,
496− dev_priv->gtt.base.total / PAGE_SIZE);
552+ dev_priv->gtt.base.total / PAGE_SIZE,
553+ true);
497554
498555 list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
499556 i915_gem_clflush_object(obj, obj->pin_display);
@@ -536,7 +593,7 @@ static void gen6_ggtt_insert_entries(struct i915_address_space *vm, · 36 unmodified lines
536593
537594 for_each_sg_page(st->sgl, &sg_iter, st->nents, 0) {
538595 addr = sg_page_iter_dma_address(&sg_iter);
539− iowrite32(vm->pte_encode(addr, level), &gtt_entries[i]);
596+ iowrite32(vm->pte_encode(addr, level, true), &gtt_entries[i]);
540597 i++;
541598 }
542599
@@ -548,7 +605,7 @@ static void gen6_ggtt_insert_entries(struct i915_address_space *vm, · 5 unmodified lines
548605 */
549606 if (i != 0)
550607 WARN_ON(readl(&gtt_entries[i-1]) !=
551− vm->pte_encode(addr, level));
608+ vm->pte_encode(addr, level, true));
552609
553610 /* This next bit makes the above posting read even more important. We
554611 * want to flush the TLBs only after we're certain all the PTE updates
@@ -560,7 +617,8 @@ static void gen6_ggtt_insert_entries(struct i915_address_space *vm, · 5 unmodified lines
560617
561618 static void gen6_ggtt_clear_range(struct i915_address_space *vm,
562619 unsigned int first_entry,
563− unsigned int num_entries)
620+ unsigned int num_entries,
621+ bool use_scratch)
564622 {
565623 struct drm_i915_private *dev_priv = vm->dev->dev_private;
566624 gen6_gtt_pte_t scratch_pte, __iomem *gtt_base =
@@ -573,7 +631,8 @@ static void gen6_ggtt_clear_range(struct i915_address_space *vm, · 6 unmodified lines
573631 first_entry, num_entries, max_entries))
574632 num_entries = max_entries;
575633
576− scratch_pte = vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC);
634+ scratch_pte = vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC, use_scratch);
635+
577636 for (i = 0; i < num_entries; i++)
578637 iowrite32(scratch_pte, &gtt_base[i]);
579638 readl(gtt_base);
@@ -594,7 +653,8 @@ static void i915_ggtt_insert_entries(struct i915_address_space *vm, · 14 unmodified lines
594653
595654 static void i915_ggtt_clear_range(struct i915_address_space *vm,
596655 unsigned int first_entry,
597− unsigned int num_entries)
656+ unsigned int num_entries,
657+ bool unused)
598658 {
599659 intel_gtt_clear_range(first_entry, num_entries);
600660 }
@@ -622,7 +682,8 @@ void i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj) · 21 unmodified lines
622682
623683 dev_priv->gtt.base.clear_range(&dev_priv->gtt.base,
624684 entry,
625− obj->base.size >> PAGE_SHIFT);
685+ obj->base.size >> PAGE_SHIFT,
686+ true);
626687
627688 obj->has_global_gtt_mapping = 0;
628689 }
@@ -709,11 +770,11 @@ void i915_gem_setup_global_gtt(struct drm_device *dev, · 80 unmodified lines
709770 const unsigned long count = (hole_end - hole_start) / PAGE_SIZE;
710771 DRM_DEBUG_KMS("clearing unused GTT space: [%lx, %lx]\n",
711772 hole_start, hole_end);
712− ggtt_vm->clear_range(ggtt_vm, hole_start / PAGE_SIZE, count);
773+ ggtt_vm->clear_range(ggtt_vm, hole_start / PAGE_SIZE, count, true);
713774 }
714775
715776 /* And finally clear the reserved guard page */
716− ggtt_vm->clear_range(ggtt_vm, end / PAGE_SIZE - 1, 1);
777+ ggtt_vm->clear_range(ggtt_vm, end / PAGE_SIZE - 1, 1, true);
717778 }
718779
719780 static bool
drivers/gpu/drm/i915/i915_reg.h+12−0
@@ -604,6 +604,10 @@ · 603 unmodified lines
604604 #define ARB_MODE_SWIZZLE_IVB (1<<5)
605605 #define RENDER_HWS_PGA_GEN7 (0x04080)
606606 #define RING_FAULT_REG(ring) (0x4094 + 0x100*(ring)->id)
607+#define RING_FAULT_GTTSEL_MASK (1<<11)
608+#define RING_FAULT_SRCID(x) ((x >> 3) & 0xff)
609+#define RING_FAULT_FAULT_TYPE(x) ((x >> 1) & 0x3)
610+#define RING_FAULT_VALID (1<<0)
607611 #define DONE_REG 0x40b0
608612 #define BSD_HWS_PGA_GEN7 (0x04180)
609613 #define BLT_HWS_PGA_GEN7 (0x04280)
@@ -3881,6 +3885,9 @@ · 3271 unmodified lines
38813885 #define GEN7_SQ_CHICKEN_MBCUNIT_CONFIG 0x9030
38823886 #define GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB (1<<11)
38833887
3888+#define HSW_SCRATCH1 0xb038
3889+#define HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE (1<<27)
3890+
38843891 #define HSW_FUSE_STRAP 0x42014
38853892 #define HSW_CDCLK_LIMIT (1 << 24)
38863893
@@ -4276,7 +4283,9 @@ · 389 unmodified lines
42764283 #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN)
42774284
42784285 #define SOUTH_DSPCLK_GATE_D 0xc2020
4286+#define PCH_DPLUNIT_CLOCK_GATE_DISABLE (1<<30)
42794287 #define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29)
4288+#define PCH_CPUNIT_CLOCK_GATE_DISABLE (1<<14)
42804289 #define PCH_LP_PARTITION_LEVEL_DISABLE (1<<12)
42814290
42824291 /* CPU: FDI_TX */
@@ -4728,6 +4737,9 @@ · 445 unmodified lines
47284737 #define GEN7_ROW_CHICKEN2_GT2 0xf4f4
47294738 #define DOP_CLOCK_GATING_DISABLE (1<<0)
47304739
4740+#define HSW_ROW_CHICKEN3 0xe49c
4741+#define HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE (1 << 6)
4742+
47314743 #define G4X_AUD_VID_DID (dev_priv->info->display_mmio_offset + 0x62020)
47324744 #define INTEL_AUDIO_DEVCL 0x808629FB
47334745 #define INTEL_AUDIO_DEVBLC 0x80862801
drivers/gpu/drm/i915/intel_display.c+2−36
@@ -3941,8 +3941,6 @@ static void intel_connector_check_state(struct intel_connector *connector) · 3940 unmodified lines
39413941 * consider. */
39423942 void intel_connector_dpms(struct drm_connector *connector, int mode)
39433943 {
3944− struct intel_encoder *encoder = intel_attached_encoder(connector);
3945−
39463944 /* All the simple cases only support two dpms states. */
39473945 if (mode != DRM_MODE_DPMS_ON)
39483946 mode = DRM_MODE_DPMS_OFF;
@@ -3953,10 +3951,8 @@ void intel_connector_dpms(struct drm_connector *connector, int mode) · 4 unmodified lines
39533951 connector->dpms = mode;
39543952
39553953 /* Only need to change hw state when actually enabled */
3956− if (encoder->base.crtc)
3957− intel_encoder_dpms(encoder, mode);
3958− else
3959− WARN_ON(encoder->connectors_active != false);
3954+ if (connector->encoder)
3955+ intel_encoder_dpms(to_intel_encoder(connector->encoder), mode);
39603956
39613957 intel_modeset_check_state(connector->dev);
39623958 }
@@ -10049,33 +10045,6 @@ static void i915_disable_vga(struct drm_device *dev) · 6086 unmodified lines
1004910045 POSTING_READ(vga_reg);
1005010046 }
1005110047
10052−static void i915_enable_vga_mem(struct drm_device *dev)
10053−{
10054− /* Enable VGA memory on Intel HD */
10055− if (HAS_PCH_SPLIT(dev)) {
10056− vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO);
10057− outb(inb(VGA_MSR_READ) | VGA_MSR_MEM_EN, VGA_MSR_WRITE);
10058− vga_set_legacy_decoding(dev->pdev, VGA_RSRC_LEGACY_IO |
10059− VGA_RSRC_LEGACY_MEM |
10060− VGA_RSRC_NORMAL_IO |
10061− VGA_RSRC_NORMAL_MEM);
10062− vga_put(dev->pdev, VGA_RSRC_LEGACY_IO);
10063− }
10064−}
10065−
10066−void i915_disable_vga_mem(struct drm_device *dev)
10067−{
10068− /* Disable VGA memory on Intel HD */
10069− if (HAS_PCH_SPLIT(dev)) {
10070− vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO);
10071− outb(inb(VGA_MSR_READ) & ~VGA_MSR_MEM_EN, VGA_MSR_WRITE);
10072− vga_set_legacy_decoding(dev->pdev, VGA_RSRC_LEGACY_IO |
10073− VGA_RSRC_NORMAL_IO |
10074− VGA_RSRC_NORMAL_MEM);
10075− vga_put(dev->pdev, VGA_RSRC_LEGACY_IO);
10076− }
10077−}
10078−
1007910048 void intel_modeset_init_hw(struct drm_device *dev)
1008010049 {
1008110050 intel_init_power_well(dev);
@@ -10354,7 +10323,6 @@ void i915_redisable_vga(struct drm_device *dev) · 272 unmodified lines
1035410323 if (I915_READ(vga_reg) != VGA_DISP_DISABLE) {
1035510324 DRM_DEBUG_KMS("Something enabled VGA plane, disabling it\n");
1035610325 i915_disable_vga(dev);
10357− i915_disable_vga_mem(dev);
1035810326 }
1035910327 }
1036010328
@@ -10568,8 +10536,6 @@ void intel_modeset_cleanup(struct drm_device *dev) · 207 unmodified lines
1056810536
1056910537 intel_disable_fbc(dev);
1057010538
10571− i915_enable_vga_mem(dev);
10572−
1057310539 intel_disable_gt_powersave(dev);
1057410540
1057510541 ironlake_teardown_rc6(dev);
drivers/gpu/drm/i915/intel_dp.c+1−1
@@ -1467,7 +1467,7 @@ static void intel_edp_psr_setup(struct intel_dp *intel_dp) · 1466 unmodified lines
14671467
14681468 /* Avoid continuous PSR exit by masking memup and hpd */
14691469 I915_WRITE(EDP_PSR_DEBUG_CTL, EDP_PSR_DEBUG_MASK_MEMUP |
1470− EDP_PSR_DEBUG_MASK_HPD);
1470+ EDP_PSR_DEBUG_MASK_HPD | EDP_PSR_DEBUG_MASK_LPSP);
14711471
14721472 intel_dp->psr_setup_done = true;
14731473 }
drivers/gpu/drm/i915/intel_drv.h+0−1
@@ -793,6 +793,5 @@ extern void hsw_pc8_disable_interrupts(struct drm_device *dev); · 792 unmodified lines
793793 extern void hsw_pc8_restore_interrupts(struct drm_device *dev);
794794 extern void intel_aux_display_runtime_get(struct drm_i915_private *dev_priv);
795795 extern void intel_aux_display_runtime_put(struct drm_i915_private *dev_priv);
796−extern void i915_disable_vga_mem(struct drm_device *dev);
797796
798797 #endif /* __INTEL_DRV_H__ */
drivers/gpu/drm/i915/intel_pm.c+10−3
@@ -3864,8 +3864,6 @@ static void valleyview_enable_rps(struct drm_device *dev) · 3863 unmodified lines
38643864 dev_priv->rps.rpe_delay),
38653865 dev_priv->rps.rpe_delay);
38663866
3867− INIT_DELAYED_WORK(&dev_priv->rps.vlv_work, vlv_rps_timer_work);
3868−
38693867 valleyview_set_rps(dev_priv->dev, dev_priv->rps.rpe_delay);
38703868
38713869 gen6_enable_rps_interrupts(dev);
@@ -4761,7 +4759,9 @@ static void cpt_init_clock_gating(struct drm_device *dev) · 889 unmodified lines
47614759 * gating for the panel power sequencer or it will fail to
47624760 * start up when no ports are active.
47634761 */
4764− I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE);
4762+ I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE |
4763+ PCH_DPLUNIT_CLOCK_GATE_DISABLE |
4764+ PCH_CPUNIT_CLOCK_GATE_DISABLE);
47654765 I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) |
47664766 DPLS_EDP_PPS_FIX_DIS);
47674767 /* The below fixes the weird display corruption, a few pixels shifted
@@ -4955,6 +4955,11 @@ static void haswell_init_clock_gating(struct drm_device *dev) · 187 unmodified lines
49554955 I915_WRITE(GEN7_L3_CHICKEN_MODE_REGISTER,
49564956 GEN7_WA_L3_CHICKEN_MODE);
49574957
4958+ /* L3 caching of data atomics doesn't work -- disable it. */
4959+ I915_WRITE(HSW_SCRATCH1, HSW_SCRATCH1_L3_DATA_ATOMICS_DISABLE);
4960+ I915_WRITE(HSW_ROW_CHICKEN3,
4961+ _MASKED_BIT_ENABLE(HSW_ROW_CHICKEN3_L3_GLOBAL_ATOMICS_DISABLE));
4962+
49584963 /* This is required by WaCatErrorRejectionIssue:hsw */
49594964 I915_WRITE(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
49604965 I915_READ(GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) |
@@ -5681,5 +5686,7 @@ void intel_pm_init(struct drm_device *dev) · 720 unmodified lines
56815686
56825687 INIT_DELAYED_WORK(&dev_priv->rps.delayed_resume_work,
56835688 intel_gen6_powersave_work);
5689+
5690+ INIT_DELAYED_WORK(&dev_priv->rps.vlv_work, vlv_rps_timer_work);
56845691 }
56855692
drivers/gpu/drm/nouveau/core/subdev/mc/base.c+1−1
@@ -113,7 +113,7 @@ nouveau_mc_create_(struct nouveau_object *parent, struct nouveau_object *engine, · 112 unmodified lines
113113 pmc->use_msi = false;
114114 break;
115115 default:
116− pmc->use_msi = nouveau_boolopt(device->cfgopt, "NvMSI", true);
116+ pmc->use_msi = nouveau_boolopt(device->cfgopt, "NvMSI", false);
117117 if (pmc->use_msi) {
118118 pmc->use_msi = pci_enable_msi(device->pdev) == 0;
119119 if (pmc->use_msi) {
drivers/gpu/drm/radeon/atombios_encoders.c+36−18
@@ -707,24 +707,37 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) · 706 unmodified lines
707707 switch (connector->connector_type) {
708708 case DRM_MODE_CONNECTOR_DVII:
709709 case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */
710− if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
711− (drm_detect_hdmi_monitor(radeon_connector->edid) &&
712− (radeon_connector->audio == RADEON_AUDIO_AUTO)))
713− return ATOM_ENCODER_MODE_HDMI;
714− else if (radeon_connector->use_digital)
710+ if (radeon_audio != 0) {
711+ if (radeon_connector->use_digital &&
712+ (radeon_connector->audio == RADEON_AUDIO_ENABLE))
713+ return ATOM_ENCODER_MODE_HDMI;
714+ else if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
715+ (radeon_connector->audio == RADEON_AUDIO_AUTO))
716+ return ATOM_ENCODER_MODE_HDMI;
717+ else if (radeon_connector->use_digital)
718+ return ATOM_ENCODER_MODE_DVI;
719+ else
720+ return ATOM_ENCODER_MODE_CRT;
721+ } else if (radeon_connector->use_digital) {
715722 return ATOM_ENCODER_MODE_DVI;
716− else
723+ } else {
717724 return ATOM_ENCODER_MODE_CRT;
725+ }
718726 break;
719727 case DRM_MODE_CONNECTOR_DVID:
720728 case DRM_MODE_CONNECTOR_HDMIA:
721729 default:
722− if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
723− (drm_detect_hdmi_monitor(radeon_connector->edid) &&
724− (radeon_connector->audio == RADEON_AUDIO_AUTO)))
725− return ATOM_ENCODER_MODE_HDMI;
726− else
730+ if (radeon_audio != 0) {
731+ if (radeon_connector->audio == RADEON_AUDIO_ENABLE)
732+ return ATOM_ENCODER_MODE_HDMI;
733+ else if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
734+ (radeon_connector->audio == RADEON_AUDIO_AUTO))
735+ return ATOM_ENCODER_MODE_HDMI;
736+ else
737+ return ATOM_ENCODER_MODE_DVI;
738+ } else {
727739 return ATOM_ENCODER_MODE_DVI;
740+ }
728741 break;
729742 case DRM_MODE_CONNECTOR_LVDS:
730743 return ATOM_ENCODER_MODE_LVDS;
@@ -732,14 +745,19 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) · 1 unmodified line
732745 case DRM_MODE_CONNECTOR_DisplayPort:
733746 dig_connector = radeon_connector->con_priv;
734747 if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
735− (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP))
748+ (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) {
736749 return ATOM_ENCODER_MODE_DP;
737− else if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) ||
738− (drm_detect_hdmi_monitor(radeon_connector->edid) &&
739− (radeon_connector->audio == RADEON_AUDIO_AUTO)))
740− return ATOM_ENCODER_MODE_HDMI;
741− else
750+ } else if (radeon_audio != 0) {
751+ if (radeon_connector->audio == RADEON_AUDIO_ENABLE)
752+ return ATOM_ENCODER_MODE_HDMI;
753+ else if (drm_detect_hdmi_monitor(radeon_connector->edid) &&
754+ (radeon_connector->audio == RADEON_AUDIO_AUTO))
755+ return ATOM_ENCODER_MODE_HDMI;
756+ else
757+ return ATOM_ENCODER_MODE_DVI;
758+ } else {
742759 return ATOM_ENCODER_MODE_DVI;
760+ }
743761 break;
744762 case DRM_MODE_CONNECTOR_eDP:
745763 return ATOM_ENCODER_MODE_DP;
@@ -1655,7 +1673,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) · 909 unmodified lines
16551673 * does the same thing and more.
16561674 */
16571675 if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) &&
1658− (rdev->family != CHIP_RS880))
1676+ (rdev->family != CHIP_RS780) && (rdev->family != CHIP_RS880))
16591677 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0);
16601678 }
16611679 if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) {
drivers/gpu/drm/radeon/btc_dpm.c+3−3
@@ -1930,7 +1930,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, · 1929 unmodified lines
19301930 }
19311931 j++;
19321932
1933− if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
1933+ if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
19341934 return -EINVAL;
19351935
19361936 tmp = RREG32(MC_PMG_CMD_MRS);
@@ -1945,7 +1945,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, · 8 unmodified lines
19451945 }
19461946 j++;
19471947
1948− if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
1948+ if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
19491949 return -EINVAL;
19501950 break;
19511951 case MC_SEQ_RESERVE_M >> 2:
@@ -1959,7 +1959,7 @@ static int btc_set_mc_special_registers(struct radeon_device *rdev, · 7 unmodified lines
19591959 }
19601960 j++;
19611961
1962− if (j > SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
1962+ if (j >= SMC_EVERGREEN_MC_REGISTER_ARRAY_SIZE)
19631963 return -EINVAL;
19641964 break;
19651965 default:
drivers/gpu/drm/radeon/cik.c+10−0
@@ -77,6 +77,8 @@ static void cik_pcie_gen3_enable(struct radeon_device *rdev); · 76 unmodified lines
7777 static void cik_program_aspm(struct radeon_device *rdev);
7878 static void cik_init_pg(struct radeon_device *rdev);
7979 static void cik_init_cg(struct radeon_device *rdev);
80+static void cik_fini_pg(struct radeon_device *rdev);
81+static void cik_fini_cg(struct radeon_device *rdev);
8082 static void cik_enable_gui_idle_interrupt(struct radeon_device *rdev,
8183 bool enable);
8284
@@ -1692,6 +1694,7 @@ static int cik_init_microcode(struct radeon_device *rdev) · 1609 unmodified lines
16921694 fw_name);
16931695 release_firmware(rdev->smc_fw);
16941696 rdev->smc_fw = NULL;
1697+ err = 0;
16951698 } else if (rdev->smc_fw->size != smc_req_size) {
16961699 printk(KERN_ERR
16971700 "cik_smc: Bogus length %zu in firmware \"%s\"\n",
@@ -3180,6 +3183,7 @@ int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) · 1482 unmodified lines
31803183 r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256);
31813184 if (r) {
31823185 DRM_ERROR("radeon: failed to get ib (%d).\n", r);
3186+ radeon_scratch_free(rdev, scratch);
31833187 return r;
31843188 }
31853189 ib.ptr[0] = PACKET3(PACKET3_SET_UCONFIG_REG, 1);
@@ -3196,6 +3200,8 @@ int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) · 10 unmodified lines
31963200 r = radeon_fence_wait(ib.fence, false);
31973201 if (r) {
31983202 DRM_ERROR("radeon: fence wait failed (%d).\n", r);
3203+ radeon_scratch_free(rdev, scratch);
3204+ radeon_ib_free(rdev, &ib);
31993205 return r;
32003206 }
32013207 for (i = 0; i < rdev->usec_timeout; i++) {
@@ -4185,6 +4191,10 @@ static void cik_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask) · 983 unmodified lines
41854191 dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
41864192 RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS));
41874193
4194+ /* disable CG/PG */
4195+ cik_fini_pg(rdev);
4196+ cik_fini_cg(rdev);
4197+
41884198 /* stop the rlc */
41894199 cik_rlc_stop(rdev);
41904200
drivers/gpu/drm/radeon/dce6_afmt.c+3−0
@@ -113,6 +113,9 @@ void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder) · 112 unmodified lines
113113 u8 *sadb;
114114 int sad_count;
115115
116+ /* XXX: setting this register causes hangs on some asics */
117+ return;
118+
116119 if (!dig->afmt->pin)
117120 return;
118121
drivers/gpu/drm/radeon/evergreen.c+1−1
@@ -3131,7 +3131,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev) · 3130 unmodified lines
31313131 rdev->config.evergreen.sx_max_export_size = 256;
31323132 rdev->config.evergreen.sx_max_export_pos_size = 64;
31333133 rdev->config.evergreen.sx_max_export_smx_size = 192;
3134− rdev->config.evergreen.max_hw_contexts = 8;
3134+ rdev->config.evergreen.max_hw_contexts = 4;
31353135 rdev->config.evergreen.sq_num_cf_insts = 2;
31363136
31373137 rdev->config.evergreen.sc_prim_fifo_size = 0x40;
drivers/gpu/drm/radeon/evergreen_hdmi.c+4−2
@@ -67,6 +67,9 @@ static void dce4_afmt_write_speaker_allocation(struct drm_encoder *encoder) · 66 unmodified lines
6767 u8 *sadb;
6868 int sad_count;
6969
70+ /* XXX: setting this register causes hangs on some asics */
71+ return;
72+
7073 list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
7174 if (connector->encoder == encoder)
7275 radeon_connector = to_radeon_connector(connector);
@@ -288,8 +291,7 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode · 215 unmodified lines
288291 /* fglrx clears sth in AFMT_AUDIO_PACKET_CONTROL2 here */
289292
290293 WREG32(HDMI_ACR_PACKET_CONTROL + offset,
291− HDMI_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
292− HDMI_ACR_SOURCE); /* select SW CTS value */
294+ HDMI_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */
293295
294296 evergreen_hdmi_update_ACR(encoder, mode->clock);
295297
drivers/gpu/drm/radeon/evergreend.h+2−2
@@ -1501,7 +1501,7 @@ · 1500 unmodified lines
15011501 * 6. COMMAND [29:22] | BYTE_COUNT [20:0]
15021502 */
15031503 # define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20)
1504− /* 0 - SRC_ADDR
1504+ /* 0 - DST_ADDR
15051505 * 1 - GDS
15061506 */
15071507 # define PACKET3_CP_DMA_ENGINE(x) ((x) << 27)
@@ -1516,7 +1516,7 @@ · 8 unmodified lines
15161516 # define PACKET3_CP_DMA_CP_SYNC (1 << 31)
15171517 /* COMMAND */
15181518 # define PACKET3_CP_DMA_DIS_WC (1 << 21)
1519−# define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 23)
1519+# define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22)
15201520 /* 0 - none
15211521 * 1 - 8 in 16
15221522 * 2 - 8 in 32
drivers/gpu/drm/radeon/ni.c+1−0
@@ -804,6 +804,7 @@ int ni_init_microcode(struct radeon_device *rdev) · 803 unmodified lines
804804 fw_name);
805805 release_firmware(rdev->smc_fw);
806806 rdev->smc_fw = NULL;
807+ err = 0;
807808 } else if (rdev->smc_fw->size != smc_req_size) {
808809 printk(KERN_ERR
809810 "ni_mc: Bogus length %zu in firmware \"%s\"\n",
drivers/gpu/drm/radeon/r600.c+1−0
@@ -2302,6 +2302,7 @@ int r600_init_microcode(struct radeon_device *rdev) · 2301 unmodified lines
23022302 fw_name);
23032303 release_firmware(rdev->smc_fw);
23042304 rdev->smc_fw = NULL;
2305+ err = 0;
23052306 } else if (rdev->smc_fw->size != smc_req_size) {
23062307 printk(KERN_ERR
23072308 "smc: Bogus length %zu in firmware \"%s\"\n",
drivers/gpu/drm/radeon/r600_hdmi.c+17−7
@@ -57,15 +57,15 @@ enum r600_hdmi_iec_status_bits { · 56 unmodified lines
5757 static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = {
5858 /* 32kHz 44.1kHz 48kHz */
5959 /* Clock N CTS N CTS N CTS */
60− { 25174, 4576, 28125, 7007, 31250, 6864, 28125 }, /* 25,20/1.001 MHz */
60+ { 25175, 4576, 28125, 7007, 31250, 6864, 28125 }, /* 25,20/1.001 MHz */
6161 { 25200, 4096, 25200, 6272, 28000, 6144, 25200 }, /* 25.20 MHz */
6262 { 27000, 4096, 27000, 6272, 30000, 6144, 27000 }, /* 27.00 MHz */
6363 { 27027, 4096, 27027, 6272, 30030, 6144, 27027 }, /* 27.00*1.001 MHz */
6464 { 54000, 4096, 54000, 6272, 60000, 6144, 54000 }, /* 54.00 MHz */
6565 { 54054, 4096, 54054, 6272, 60060, 6144, 54054 }, /* 54.00*1.001 MHz */
66− { 74175, 11648, 210937, 17836, 234375, 11648, 140625 }, /* 74.25/1.001 MHz */
66+ { 74176, 11648, 210937, 17836, 234375, 11648, 140625 }, /* 74.25/1.001 MHz */
6767 { 74250, 4096, 74250, 6272, 82500, 6144, 74250 }, /* 74.25 MHz */
68− { 148351, 11648, 421875, 8918, 234375, 5824, 140625 }, /* 148.50/1.001 MHz */
68+ { 148352, 11648, 421875, 8918, 234375, 5824, 140625 }, /* 148.50/1.001 MHz */
6969 { 148500, 4096, 148500, 6272, 165000, 6144, 148500 }, /* 148.50 MHz */
7070 { 0, 4096, 0, 6272, 0, 6144, 0 } /* Other */
7171 };
@@ -75,8 +75,15 @@ static const struct radeon_hdmi_acr r600_hdmi_predefined_acr[] = { · 3 unmodified lines
7575 */
7676 static void r600_hdmi_calc_cts(uint32_t clock, int *CTS, int N, int freq)
7777 {
78− if (*CTS == 0)
79− *CTS = clock * N / (128 * freq) * 1000;
78+ u64 n;
79+ u32 d;
80+
81+ if (*CTS == 0) {
82+ n = (u64)clock * (u64)N * 1000ULL;
83+ d = 128 * freq;
84+ do_div(n, d);
85+ *CTS = n;
86+ }
8087 DRM_DEBUG("Using ACR timing N=%d CTS=%d for frequency %d\n",
8188 N, *CTS, freq);
8289 }
@@ -302,6 +309,9 @@ static void dce3_2_afmt_write_speaker_allocation(struct drm_encoder *encoder) · 219 unmodified lines
302309 u8 *sadb;
303310 int sad_count;
304311
312+ /* XXX: setting this register causes hangs on some asics */
313+ return;
314+
305315 list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
306316 if (connector->encoder == encoder)
307317 radeon_connector = to_radeon_connector(connector);
@@ -444,8 +454,8 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod · 136 unmodified lines
444454 }
445455
446456 WREG32(HDMI0_ACR_PACKET_CONTROL + offset,
447− HDMI0_ACR_AUTO_SEND | /* allow hw to sent ACR packets when required */
448− HDMI0_ACR_SOURCE); /* select SW CTS value */
457+ HDMI0_ACR_SOURCE | /* select SW CTS value - XXX verify that hw CTS works on all families */
458+ HDMI0_ACR_AUTO_SEND); /* allow hw to sent ACR packets when required */
449459
450460 WREG32(HDMI0_VBI_PACKET_CONTROL + offset,
451461 HDMI0_NULL_SEND | /* send null packets when required */
drivers/gpu/drm/radeon/r600d.h+1−1
@@ -1523,7 +1523,7 @@ · 1522 unmodified lines
15231523 */
15241524 # define PACKET3_CP_DMA_CP_SYNC (1 << 31)
15251525 /* COMMAND */
1526−# define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 23)
1526+# define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22)
15271527 /* 0 - none
15281528 * 1 - 8 in 16
15291529 * 2 - 8 in 32
drivers/gpu/drm/radeon/radeon_connectors.c+21−12
@@ -1658,9 +1658,12 @@ radeon_add_atom_connector(struct drm_device *dev, · 1657 unmodified lines
16581658 drm_object_attach_property(&radeon_connector->base.base,
16591659 rdev->mode_info.underscan_vborder_property,
16601660 0);
1661− drm_object_attach_property(&radeon_connector->base.base,
1662− rdev->mode_info.audio_property,
1663− RADEON_AUDIO_DISABLE);
1661+ if (radeon_audio != 0)
1662+ drm_object_attach_property(&radeon_connector->base.base,
1663+ rdev->mode_info.audio_property,
1664+ (radeon_audio == 1) ?
1665+ RADEON_AUDIO_AUTO :
1666+ RADEON_AUDIO_DISABLE);
16641667 subpixel_order = SubPixelHorizontalRGB;
16651668 connector->interlace_allowed = true;
16661669 if (connector_type == DRM_MODE_CONNECTOR_HDMIB)
@@ -1754,10 +1757,12 @@ radeon_add_atom_connector(struct drm_device *dev, · 87 unmodified lines
17541757 rdev->mode_info.underscan_vborder_property,
17551758 0);
17561759 }
1757− if (ASIC_IS_DCE2(rdev)) {
1760+ if (ASIC_IS_DCE2(rdev) && (radeon_audio != 0)) {
17581761 drm_object_attach_property(&radeon_connector->base.base,
1759− rdev->mode_info.audio_property,
1760− RADEON_AUDIO_DISABLE);
1762+ rdev->mode_info.audio_property,
1763+ (radeon_audio == 1) ?
1764+ RADEON_AUDIO_AUTO :
1765+ RADEON_AUDIO_DISABLE);
17611766 }
17621767 if (connector_type == DRM_MODE_CONNECTOR_DVII) {
17631768 radeon_connector->dac_load_detect = true;
@@ -1799,10 +1804,12 @@ radeon_add_atom_connector(struct drm_device *dev, · 35 unmodified lines
17991804 rdev->mode_info.underscan_vborder_property,
18001805 0);
18011806 }
1802− if (ASIC_IS_DCE2(rdev)) {
1807+ if (ASIC_IS_DCE2(rdev) && (radeon_audio != 0)) {
18031808 drm_object_attach_property(&radeon_connector->base.base,
1804− rdev->mode_info.audio_property,
1805− RADEON_AUDIO_DISABLE);
1809+ rdev->mode_info.audio_property,
1810+ (radeon_audio == 1) ?
1811+ RADEON_AUDIO_AUTO :
1812+ RADEON_AUDIO_DISABLE);
18061813 }
18071814 subpixel_order = SubPixelHorizontalRGB;
18081815 connector->interlace_allowed = true;
@@ -1843,10 +1850,12 @@ radeon_add_atom_connector(struct drm_device *dev, · 34 unmodified lines
18431850 rdev->mode_info.underscan_vborder_property,
18441851 0);
18451852 }
1846− if (ASIC_IS_DCE2(rdev)) {
1853+ if (ASIC_IS_DCE2(rdev) && (radeon_audio != 0)) {
18471854 drm_object_attach_property(&radeon_connector->base.base,
1848− rdev->mode_info.audio_property,
1849− RADEON_AUDIO_DISABLE);
1855+ rdev->mode_info.audio_property,
1856+ (radeon_audio == 1) ?
1857+ RADEON_AUDIO_AUTO :
1858+ RADEON_AUDIO_DISABLE);
18501859 }
18511860 connector->interlace_allowed = true;
18521861 /* in theory with a DP to VGA converter... */
drivers/gpu/drm/radeon/radeon_cs.c+1−2
@@ -85,9 +85,8 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) · 84 unmodified lines
8585 VRAM, also but everything into VRAM on AGP cards to avoid
8686 image corruptions */
8787 if (p->ring == R600_RING_TYPE_UVD_INDEX &&
88− p->rdev->family < CHIP_PALM &&
8988 (i == 0 || drm_pci_device_is_agp(p->rdev->ddev))) {
90−
89+ /* TODO: is this still needed for NI+ ? */
9190 p->relocs[i].lobj.domain =
9291 RADEON_GEM_DOMAIN_VRAM;
9392
drivers/gpu/drm/radeon/radeon_drv.c+2−2
@@ -153,7 +153,7 @@ int radeon_benchmarking = 0; · 152 unmodified lines
153153 int radeon_testing = 0;
154154 int radeon_connector_table = 0;
155155 int radeon_tv = 1;
156−int radeon_audio = 1;
156+int radeon_audio = -1;
157157 int radeon_disp_priority = 0;
158158 int radeon_hw_i2c = 0;
159159 int radeon_pcie_gen2 = -1;
@@ -196,7 +196,7 @@ module_param_named(connector_table, radeon_connector_table, int, 0444); · 36 unmodified lines
196196 MODULE_PARM_DESC(tv, "TV enable (0 = disable)");
197197 module_param_named(tv, radeon_tv, int, 0444);
198198
199−MODULE_PARM_DESC(audio, "Audio enable (1 = enable)");
199+MODULE_PARM_DESC(audio, "Audio enable (-1 = auto, 0 = disable, 1 = enable)");
200200 module_param_named(audio, radeon_audio, int, 0444);
201201
202202 MODULE_PARM_DESC(disp_priority, "Display Priority (0 = auto, 1 = normal, 2 = high)");
drivers/gpu/drm/radeon/radeon_pm.c+3−0
@@ -945,6 +945,8 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable) · 944 unmodified lines
945945 if (enable) {
946946 mutex_lock(&rdev->pm.mutex);
947947 rdev->pm.dpm.uvd_active = true;
948+ /* disable this for now */
949+#if 0
948950 if ((rdev->pm.dpm.sd == 1) && (rdev->pm.dpm.hd == 0))
949951 dpm_state = POWER_STATE_TYPE_INTERNAL_UVD_SD;
950952 else if ((rdev->pm.dpm.sd == 2) && (rdev->pm.dpm.hd == 0))
@@ -954,6 +956,7 @@ void radeon_dpm_enable_uvd(struct radeon_device *rdev, bool enable) · 3 unmodified lines
954956 else if ((rdev->pm.dpm.sd == 0) && (rdev->pm.dpm.hd == 2))
955957 dpm_state = POWER_STATE_TYPE_INTERNAL_UVD_HD2;
956958 else
959+#endif
957960 dpm_state = POWER_STATE_TYPE_INTERNAL_UVD;
958961 rdev->pm.dpm.state = dpm_state;
959962 mutex_unlock(&rdev->pm.mutex);
drivers/gpu/drm/radeon/radeon_test.c+2−2
@@ -36,8 +36,8 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) · 35 unmodified lines
3636 struct radeon_bo *vram_obj = NULL;
3737 struct radeon_bo **gtt_obj = NULL;
3838 uint64_t gtt_addr, vram_addr;
39− unsigned i, n, size;
40− int r, ring;
39+ unsigned n, size;
40+ int i, r, ring;
4141
4242 switch (flag) {
4343 case RADEON_TEST_COPY_DMA:
drivers/gpu/drm/radeon/radeon_uvd.c+4−2
@@ -476,7 +476,8 @@ static int radeon_uvd_cs_reloc(struct radeon_cs_parser *p, · 475 unmodified lines
476476 return -EINVAL;
477477 }
478478
479− if (p->rdev->family < CHIP_PALM && (cmd == 0 || cmd == 0x3) &&
479+ /* TODO: is this still necessary on NI+ ? */
480+ if ((cmd == 0 || cmd == 0x3) &&
480481 (start >> 28) != (p->rdev->uvd.gpu_addr >> 28)) {
481482 DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n",
482483 start, end);
@@ -798,7 +799,8 @@ void radeon_uvd_note_usage(struct radeon_device *rdev) · 315 unmodified lines
798799 (rdev->pm.dpm.hd != hd)) {
799800 rdev->pm.dpm.sd = sd;
800801 rdev->pm.dpm.hd = hd;
801− streams_changed = true;
802+ /* disable this for now */
803+ /*streams_changed = true;*/
802804 }
803805 }
804806
drivers/gpu/drm/radeon/si.c+11−0
@@ -85,6 +85,9 @@ extern void si_dma_vm_set_page(struct radeon_device *rdev, · 84 unmodified lines
8585 uint32_t incr, uint32_t flags);
8686 static void si_enable_gui_idle_interrupt(struct radeon_device *rdev,
8787 bool enable);
88+static void si_fini_pg(struct radeon_device *rdev);
89+static void si_fini_cg(struct radeon_device *rdev);
90+static void si_rlc_stop(struct radeon_device *rdev);
8891
8992 static const u32 verde_rlc_save_restore_register_list[] =
9093 {
@@ -1678,6 +1681,7 @@ static int si_init_microcode(struct radeon_device *rdev) · 1587 unmodified lines
16781681 fw_name);
16791682 release_firmware(rdev->smc_fw);
16801683 rdev->smc_fw = NULL;
1684+ err = 0;
16811685 } else if (rdev->smc_fw->size != smc_req_size) {
16821686 printk(KERN_ERR
16831687 "si_smc: Bogus length %zu in firmware \"%s\"\n",
@@ -3608,6 +3612,13 @@ static void si_gpu_soft_reset(struct radeon_device *rdev, u32 reset_mask) · 1924 unmodified lines
36083612 dev_info(rdev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
36093613 RREG32(VM_CONTEXT1_PROTECTION_FAULT_STATUS));
36103614
3615+ /* disable PG/CG */
3616+ si_fini_pg(rdev);
3617+ si_fini_cg(rdev);
3618+
3619+ /* stop the rlc */
3620+ si_rlc_stop(rdev);
3621+
36113622 /* Disable CP parsing/prefetching */
36123623 WREG32(CP_ME_CNTL, CP_ME_HALT | CP_PFP_HALT | CP_CE_HALT);
36133624
drivers/gpu/drm/radeon/si_dpm.c+3−3
@@ -5208,7 +5208,7 @@ static int si_set_mc_special_registers(struct radeon_device *rdev, · 5207 unmodified lines
52085208 table->mc_reg_table_entry[k].mc_data[j] |= 0x100;
52095209 }
52105210 j++;
5211− if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
5211+ if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
52125212 return -EINVAL;
52135213
52145214 if (!pi->mem_gddr5) {
@@ -5218,7 +5218,7 @@ static int si_set_mc_special_registers(struct radeon_device *rdev, · 3 unmodified lines
52185218 table->mc_reg_table_entry[k].mc_data[j] =
52195219 (table->mc_reg_table_entry[k].mc_data[i] & 0xffff0000) >> 16;
52205220 j++;
5221− if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
5221+ if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
52225222 return -EINVAL;
52235223 }
52245224 break;
@@ -5231,7 +5231,7 @@ static int si_set_mc_special_registers(struct radeon_device *rdev, · 6 unmodified lines
52315231 (temp_reg & 0xffff0000) |
52325232 (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff);
52335233 j++;
5234− if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
5234+ if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
52355235 return -EINVAL;
52365236 break;
52375237 default:
drivers/gpu/drm/radeon/sid.h+2−2
@@ -1553,7 +1553,7 @@ · 1552 unmodified lines
15531553 * 6. COMMAND [30:21] | BYTE_COUNT [20:0]
15541554 */
15551555 # define PACKET3_CP_DMA_DST_SEL(x) ((x) << 20)
1556− /* 0 - SRC_ADDR
1556+ /* 0 - DST_ADDR
15571557 * 1 - GDS
15581558 */
15591559 # define PACKET3_CP_DMA_ENGINE(x) ((x) << 27)
@@ -1568,7 +1568,7 @@ · 8 unmodified lines
15681568 # define PACKET3_CP_DMA_CP_SYNC (1 << 31)
15691569 /* COMMAND */
15701570 # define PACKET3_CP_DMA_DIS_WC (1 << 21)
1571−# define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 23)
1571+# define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22)
15721572 /* 0 - none
15731573 * 1 - 8 in 16
15741574 * 2 - 8 in 32
drivers/gpu/drm/radeon/trinity_dpm.c+1−1
@@ -1868,7 +1868,7 @@ int trinity_dpm_init(struct radeon_device *rdev) · 1867 unmodified lines
18681868 for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++)
18691869 pi->at[i] = TRINITY_AT_DFLT;
18701870
1871− pi->enable_bapm = true;
1871+ pi->enable_bapm = false;
18721872 pi->enable_nbps_policy = true;
18731873 pi->enable_sclk_ds = true;
18741874 pi->enable_gfx_power_gating = true;
drivers/gpu/drm/radeon/uvd_v1_0.c+2−2
@@ -212,8 +212,8 @@ int uvd_v1_0_start(struct radeon_device *rdev) · 211 unmodified lines
212212 /* enable VCPU clock */
213213 WREG32(UVD_VCPU_CNTL, 1 << 9);
214214
215− /* enable UMC and NC0 */
216− WREG32_P(UVD_LMI_CTRL2, 1 << 13, ~((1 << 8) | (1 << 13)));
215+ /* enable UMC */
216+ WREG32_P(UVD_LMI_CTRL2, 0, ~(1 << 8));
217217
218218 /* boot up the VCPU */
219219 WREG32(UVD_SOFT_RESET, 0);
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+12−5
@@ -740,9 +740,17 @@ static void vmw_postclose(struct drm_device *dev, · 739 unmodified lines
740740 struct vmw_fpriv *vmw_fp;
741741
742742 vmw_fp = vmw_fpriv(file_priv);
743− ttm_object_file_release(&vmw_fp->tfile);
744− if (vmw_fp->locked_master)
743+
744+ if (vmw_fp->locked_master) {
745+ struct vmw_master *vmaster =
746+ vmw_master(vmw_fp->locked_master);
747+
748+ ttm_lock_set_kill(&vmaster->lock, true, SIGTERM);
749+ ttm_vt_unlock(&vmaster->lock);
745750 drm_master_put(&vmw_fp->locked_master);
751+ }
752+
753+ ttm_object_file_release(&vmw_fp->tfile);
746754 kfree(vmw_fp);
747755 }
748756
@@ -925,14 +933,13 @@ static void vmw_master_drop(struct drm_device *dev, · 176 unmodified lines
925933
926934 vmw_fp->locked_master = drm_master_get(file_priv->master);
927935 ret = ttm_vt_lock(&vmaster->lock, false, vmw_fp->tfile);
928− vmw_execbuf_release_pinned_bo(dev_priv);
929−
930936 if (unlikely((ret != 0))) {
931937 DRM_ERROR("Unable to lock TTM at VT switch.\n");
932938 drm_master_put(&vmw_fp->locked_master);
933939 }
934940
935− ttm_lock_set_kill(&vmaster->lock, true, SIGTERM);
941+ ttm_lock_set_kill(&vmaster->lock, false, SIGTERM);
942+ vmw_execbuf_release_pinned_bo(dev_priv);
936943
937944 if (!dev_priv->enable_fb) {
938945 ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM);
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c+1−1
@@ -970,7 +970,7 @@ void vmw_resource_unreserve(struct vmw_resource *res, · 969 unmodified lines
970970 if (new_backup)
971971 res->backup_offset = new_backup_offset;
972972
973− if (!res->func->may_evict)
973+ if (!res->func->may_evict || res->id == -1)
974974 return;
975975
976976 write_lock(&dev_priv->resource_lock);
drivers/hid/Kconfig+1−0
@@ -241,6 +241,7 @@ config HID_HOLTEK · 240 unmodified lines
241241 - Sharkoon Drakonia / Perixx MX-2000 gaming mice
242242 - Tracer Sniper TRM-503 / NOVA Gaming Slider X200 /
243243 Zalman ZM-GM1
244+ - SHARKOON DarkGlider Gaming mouse
244245
245246 config HOLTEK_FF
246247 bool "Holtek On Line Grip force feedback support"
drivers/hid/hid-core.c+8−5
@@ -319,7 +319,7 @@ static s32 item_sdata(struct hid_item *item) · 318 unmodified lines
319319
320320 static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
321321 {
322− __u32 raw_value;
322+ __s32 raw_value;
323323 switch (item->tag) {
324324 case HID_GLOBAL_ITEM_TAG_PUSH:
325325
@@ -370,10 +370,11 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) · 44 unmodified lines
370370 return 0;
371371
372372 case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT:
373− /* Units exponent negative numbers are given through a
374− * two's complement.
375− * See "6.2.2.7 Global Items" for more information. */
376− raw_value = item_udata(item);
373+ /* Many devices provide unit exponent as a two's complement
374+ * nibble due to the common misunderstanding of HID
375+ * specification 1.11, 6.2.2.7 Global Items. Attempt to handle
376+ * both this and the standard encoding. */
377+ raw_value = item_sdata(item);
377378 if (!(raw_value & 0xfffffff0))
378379 parser->global.unit_exponent = hid_snto32(raw_value, 4);
379380 else
@@ -1715,6 +1716,7 @@ static const struct hid_device_id hid_have_special_driver[] = { · 1335 unmodified lines
17151716 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) },
17161717 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) },
17171718 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) },
1719+ { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
17181720 { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_580) },
17191721 { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
17201722 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
@@ -1869,6 +1871,7 @@ static const struct hid_device_id hid_have_special_driver[] = { · 148 unmodified lines
18691871
18701872 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
18711873 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
1874+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
18721875 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
18731876 { }
18741877 };
drivers/hid/hid-holtek-mouse.c+4−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 * - USB ID 04d9:a067, sold as Sharkoon Drakonia and Perixx MX-2000
2828 * - USB ID 04d9:a04a, sold as Tracer Sniper TRM-503, NOVA Gaming Slider X200
2929 * and Zalman ZM-GM1
30+ * - USB ID 04d9:a081, sold as SHARKOON DarkGlider Gaming mouse
3031 */
3132
3233 static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
@@ -46,6 +47,7 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, · 13 unmodified lines
4647 }
4748 break;
4849 case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A:
50+ case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081:
4951 if (*rsize >= 113 && rdesc[106] == 0xff && rdesc[107] == 0x7f
5052 && rdesc[111] == 0xff && rdesc[112] == 0x7f) {
5153 hid_info(hdev, "Fixing up report descriptor\n");
@@ -63,6 +65,8 @@ static const struct hid_device_id holtek_mouse_devices[] = { · 11 unmodified lines
6365 USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) },
6466 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
6567 USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) },
68+ { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
69+ USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
6670 { }
6771 };
6872 MODULE_DEVICE_TABLE(hid, holtek_mouse_devices);
drivers/hid/hid-ids.h+7−0
@@ -450,6 +450,7 @@ · 449 unmodified lines
450450 #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD 0xa055
451451 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067 0xa067
452452 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A 0xa04a
453+#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081 0xa081
453454
454455 #define USB_VENDOR_ID_IMATION 0x0718
455456 #define USB_DEVICE_ID_DISC_STAKKA 0xd000
@@ -632,6 +633,7 @@ · 176 unmodified lines
632633 #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003
633634
634635 #define USB_VENDOR_ID_NINTENDO 0x057e
636+#define USB_VENDOR_ID_NINTENDO2 0x054c
635637 #define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306
636638 #define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330
637639
@@ -791,6 +793,8 @@ · 153 unmodified lines
791793 #define USB_DEVICE_ID_SYNAPTICS_COMP_TP 0x0009
792794 #define USB_DEVICE_ID_SYNAPTICS_WTP 0x0010
793795 #define USB_DEVICE_ID_SYNAPTICS_DPAD 0x0013
796+#define USB_DEVICE_ID_SYNAPTICS_LTS1 0x0af8
797+#define USB_DEVICE_ID_SYNAPTICS_LTS2 0x1d10
794798
795799 #define USB_VENDOR_ID_THINGM 0x27b8
796800 #define USB_DEVICE_ID_BLINK1 0x01ed
@@ -918,4 +922,7 @@ · 121 unmodified lines
918922 #define USB_VENDOR_ID_PRIMAX 0x0461
919923 #define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05
920924
925+#define USB_VENDOR_ID_SIS 0x0457
926+#define USB_DEVICE_ID_SIS_TS 0x1013
927+
921928 #endif
drivers/hid/hid-input.c+4−9
@@ -192,6 +192,7 @@ static int hidinput_setkeycode(struct input_dev *dev, · 191 unmodified lines
192192 return -EINVAL;
193193 }
194194
195+
195196 /**
196197 * hidinput_calc_abs_res - calculate an absolute axis resolution
197198 * @field: the HID report field to calculate resolution for
@@ -234,23 +235,17 @@ __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) · 36 unmodified lines
234235 case ABS_MT_TOOL_Y:
235236 case ABS_MT_TOUCH_MAJOR:
236237 case ABS_MT_TOUCH_MINOR:
237− if (field->unit & 0xffffff00) /* Not a length */
238− return 0;
239− unit_exponent += hid_snto32(field->unit >> 4, 4) - 1;
240− switch (field->unit & 0xf) {
241− case 0x1: /* If centimeters */
238+ if (field->unit == 0x11) { /* If centimeters */
242239 /* Convert to millimeters */
243240 unit_exponent += 1;
244− break;
245− case 0x3: /* If inches */
241+ } else if (field->unit == 0x13) { /* If inches */
246242 /* Convert to millimeters */
247243 prev = physical_extents;
248244 physical_extents *= 254;
249245 if (physical_extents < prev)
250246 return 0;
251247 unit_exponent -= 1;
252− break;
253− default:
248+ } else {
254249 return 0;
255250 }
256251 break;
drivers/hid/hid-roccat-kone.c+1−1
@@ -382,7 +382,7 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp, · 381 unmodified lines
382382 }
383383 #define PROFILE_ATTR(number) \
384384 static struct bin_attribute bin_attr_profile##number = { \
385− .attr = { .name = "profile##number", .mode = 0660 }, \
385+ .attr = { .name = "profile" #number, .mode = 0660 }, \
386386 .size = sizeof(struct kone_profile), \
387387 .read = kone_sysfs_read_profilex, \
388388 .write = kone_sysfs_write_profilex, \
drivers/hid/hid-roccat-koneplus.c+2−2
@@ -229,13 +229,13 @@ static ssize_t koneplus_sysfs_read_profilex_buttons(struct file *fp, · 228 unmodified lines
229229
230230 #define PROFILE_ATTR(number) \
231231 static struct bin_attribute bin_attr_profile##number##_settings = { \
232− .attr = { .name = "profile##number##_settings", .mode = 0440 }, \
232+ .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \
233233 .size = KONEPLUS_SIZE_PROFILE_SETTINGS, \
234234 .read = koneplus_sysfs_read_profilex_settings, \
235235 .private = &profile_numbers[number-1], \
236236 }; \
237237 static struct bin_attribute bin_attr_profile##number##_buttons = { \
238− .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \
238+ .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \
239239 .size = KONEPLUS_SIZE_PROFILE_BUTTONS, \
240240 .read = koneplus_sysfs_read_profilex_buttons, \
241241 .private = &profile_numbers[number-1], \
drivers/hid/hid-roccat-kovaplus.c+2−2
@@ -257,13 +257,13 @@ static ssize_t kovaplus_sysfs_read_profilex_buttons(struct file *fp, · 256 unmodified lines
257257
258258 #define PROFILE_ATTR(number) \
259259 static struct bin_attribute bin_attr_profile##number##_settings = { \
260− .attr = { .name = "profile##number##_settings", .mode = 0440 }, \
260+ .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \
261261 .size = KOVAPLUS_SIZE_PROFILE_SETTINGS, \
262262 .read = kovaplus_sysfs_read_profilex_settings, \
263263 .private = &profile_numbers[number-1], \
264264 }; \
265265 static struct bin_attribute bin_attr_profile##number##_buttons = { \
266− .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \
266+ .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \
267267 .size = KOVAPLUS_SIZE_PROFILE_BUTTONS, \
268268 .read = kovaplus_sysfs_read_profilex_buttons, \
269269 .private = &profile_numbers[number-1], \
drivers/hid/hid-roccat-pyra.c+2−2
@@ -225,13 +225,13 @@ static ssize_t pyra_sysfs_read_profilex_buttons(struct file *fp, · 224 unmodified lines
225225
226226 #define PROFILE_ATTR(number) \
227227 static struct bin_attribute bin_attr_profile##number##_settings = { \
228− .attr = { .name = "profile##number##_settings", .mode = 0440 }, \
228+ .attr = { .name = "profile" #number "_settings", .mode = 0440 }, \
229229 .size = PYRA_SIZE_PROFILE_SETTINGS, \
230230 .read = pyra_sysfs_read_profilex_settings, \
231231 .private = &profile_numbers[number-1], \
232232 }; \
233233 static struct bin_attribute bin_attr_profile##number##_buttons = { \
234− .attr = { .name = "profile##number##_buttons", .mode = 0440 }, \
234+ .attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \
235235 .size = PYRA_SIZE_PROFILE_BUTTONS, \
236236 .read = pyra_sysfs_read_profilex_buttons, \
237237 .private = &profile_numbers[number-1], \
drivers/hid/hid-wiimote-core.c+4−1
@@ -834,7 +834,8 @@ static void wiimote_init_set_type(struct wiimote_data *wdata, · 833 unmodified lines
834834 goto done;
835835 }
836836
837− if (vendor == USB_VENDOR_ID_NINTENDO) {
837+ if (vendor == USB_VENDOR_ID_NINTENDO ||
838+ vendor == USB_VENDOR_ID_NINTENDO2) {
838839 if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) {
839840 devtype = WIIMOTE_DEV_GEN10;
840841 goto done;
@@ -1855,6 +1856,8 @@ static void wiimote_hid_remove(struct hid_device *hdev) · 1014 unmodified lines
18551856 static const struct hid_device_id wiimote_hid_devices[] = {
18561857 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO,
18571858 USB_DEVICE_ID_NINTENDO_WIIMOTE) },
1859+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2,
1860+ USB_DEVICE_ID_NINTENDO_WIIMOTE) },
18581861 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO,
18591862 USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
18601863 { }
drivers/hid/hid-wiimote-modules.c+29−11
@@ -119,12 +119,22 @@ static const struct wiimod_ops wiimod_keys = { · 118 unmodified lines
119119 * the rumble motor, this flag shouldn't be set.
120120 */
121121
122+/* used by wiimod_rumble and wiipro_rumble */
123+static void wiimod_rumble_worker(struct work_struct *work)
124+{
125+ struct wiimote_data *wdata = container_of(work, struct wiimote_data,
126+ rumble_worker);
127+
128+ spin_lock_irq(&wdata->state.lock);
129+ wiiproto_req_rumble(wdata, wdata->state.cache_rumble);
130+ spin_unlock_irq(&wdata->state.lock);
131+}
132+
122133 static int wiimod_rumble_play(struct input_dev *dev, void *data,
123134 struct ff_effect *eff)
124135 {
125136 struct wiimote_data *wdata = input_get_drvdata(dev);
126137 __u8 value;
127− unsigned long flags;
128138
129139 /*
130140 * The wiimote supports only a single rumble motor so if any magnitude
@@ -137,9 +147,10 @@ static int wiimod_rumble_play(struct input_dev *dev, void *data, · 6 unmodified lines
137147 else
138148 value = 0;
139149
140− spin_lock_irqsave(&wdata->state.lock, flags);
141− wiiproto_req_rumble(wdata, value);
142− spin_unlock_irqrestore(&wdata->state.lock, flags);
150+ /* Locking state.lock here might deadlock with input_event() calls.
151+ * schedule_work acts as barrier. Merging multiple changes is fine. */
152+ wdata->state.cache_rumble = value;
153+ schedule_work(&wdata->rumble_worker);
143154
144155 return 0;
145156 }
@@ -147,6 +158,8 @@ static int wiimod_rumble_play(struct input_dev *dev, void *data, · 1 unmodified line
147158 static int wiimod_rumble_probe(const struct wiimod_ops *ops,
148159 struct wiimote_data *wdata)
149160 {
161+ INIT_WORK(&wdata->rumble_worker, wiimod_rumble_worker);
162+
150163 set_bit(FF_RUMBLE, wdata->input->ffbit);
151164 if (input_ff_create_memless(wdata->input, NULL, wiimod_rumble_play))
152165 return -ENOMEM;
@@ -159,6 +172,8 @@ static void wiimod_rumble_remove(const struct wiimod_ops *ops, · 6 unmodified lines
159172 {
160173 unsigned long flags;
161174
175+ cancel_work_sync(&wdata->rumble_worker);
176+
162177 spin_lock_irqsave(&wdata->state.lock, flags);
163178 wiiproto_req_rumble(wdata, 0);
164179 spin_unlock_irqrestore(&wdata->state.lock, flags);
@@ -1731,7 +1746,6 @@ static int wiimod_pro_play(struct input_dev *dev, void *data, · 1566 unmodified lines
17311746 {
17321747 struct wiimote_data *wdata = input_get_drvdata(dev);
17331748 __u8 value;
1734− unsigned long flags;
17351749
17361750 /*
17371751 * The wiimote supports only a single rumble motor so if any magnitude
@@ -1744,9 +1758,10 @@ static int wiimod_pro_play(struct input_dev *dev, void *data, · 6 unmodified lines
17441758 else
17451759 value = 0;
17461760
1747− spin_lock_irqsave(&wdata->state.lock, flags);
1748− wiiproto_req_rumble(wdata, value);
1749− spin_unlock_irqrestore(&wdata->state.lock, flags);
1761+ /* Locking state.lock here might deadlock with input_event() calls.
1762+ * schedule_work acts as barrier. Merging multiple changes is fine. */
1763+ wdata->state.cache_rumble = value;
1764+ schedule_work(&wdata->rumble_worker);
17501765
17511766 return 0;
17521767 }
@@ -1756,6 +1771,8 @@ static int wiimod_pro_probe(const struct wiimod_ops *ops, · 3 unmodified lines
17561771 {
17571772 int ret, i;
17581773
1774+ INIT_WORK(&wdata->rumble_worker, wiimod_rumble_worker);
1775+
17591776 wdata->extension.input = input_allocate_device();
17601777 if (!wdata->extension.input)
17611778 return -ENOMEM;
@@ -1817,12 +1834,13 @@ static void wiimod_pro_remove(const struct wiimod_ops *ops, · 55 unmodified lines
18171834 if (!wdata->extension.input)
18181835 return;
18191836
1837+ input_unregister_device(wdata->extension.input);
1838+ wdata->extension.input = NULL;
1839+ cancel_work_sync(&wdata->rumble_worker);
1840+
18201841 spin_lock_irqsave(&wdata->state.lock, flags);
18211842 wiiproto_req_rumble(wdata, 0);
18221843 spin_unlock_irqrestore(&wdata->state.lock, flags);
1823−
1824− input_unregister_device(wdata->extension.input);
1825− wdata->extension.input = NULL;
18261844 }
18271845
18281846 static const struct wiimod_ops wiimod_pro = {
drivers/hid/hid-wiimote.h+3−1
@@ -133,13 +133,15 @@ struct wiimote_state { · 132 unmodified lines
133133 __u8 *cmd_read_buf;
134134 __u8 cmd_read_size;
135135
136− /* calibration data */
136+ /* calibration/cache data */
137137 __u16 calib_bboard[4][3];
138+ __u8 cache_rumble;
138139 };
139140
140141 struct wiimote_data {
141142 struct hid_device *hdev;
142143 struct input_dev *input;
144+ struct work_struct rumble_worker;
143145 struct led_classdev *leds[4];
144146 struct input_dev *accel;
145147 struct input_dev *ir;
drivers/hid/hidraw.c+14−7
@@ -308,18 +308,25 @@ static int hidraw_fasync(int fd, struct file *file, int on) · 307 unmodified lines
308308 static void drop_ref(struct hidraw *hidraw, int exists_bit)
309309 {
310310 if (exists_bit) {
311− hid_hw_close(hidraw->hid);
312311 hidraw->exist = 0;
313− if (hidraw->open)
312+ if (hidraw->open) {
313+ hid_hw_close(hidraw->hid);
314314 wake_up_interruptible(&hidraw->wait);
315+ }
315316 } else {
316317 --hidraw->open;
317318 }
318−
319− if (!hidraw->open && !hidraw->exist) {
320− device_destroy(hidraw_class, MKDEV(hidraw_major, hidraw->minor));
321− hidraw_table[hidraw->minor] = NULL;
322− kfree(hidraw);
319+ if (!hidraw->open) {
320+ if (!hidraw->exist) {
321+ device_destroy(hidraw_class,
322+ MKDEV(hidraw_major, hidraw->minor));
323+ hidraw_table[hidraw->minor] = NULL;
324+ kfree(hidraw);
325+ } else {
326+ /* close device for last reader */
327+ hid_hw_power(hidraw->hid, PM_HINT_NORMAL);
328+ hid_hw_close(hidraw->hid);
329+ }
323330 }
324331 }
325332
drivers/hid/uhid.c+2−1
@@ -615,7 +615,7 @@ static const struct file_operations uhid_fops = { · 614 unmodified lines
615615
616616 static struct miscdevice uhid_misc = {
617617 .fops = &uhid_fops,
618− .minor = MISC_DYNAMIC_MINOR,
618+ .minor = UHID_MINOR,
619619 .name = UHID_NAME,
620620 };
621621
@@ -634,4 +634,5 @@ module_exit(uhid_exit); · 12 unmodified lines
634634 MODULE_LICENSE("GPL");
635635 MODULE_AUTHOR("David Herrmann <dh.herrmann@gmail.com>");
636636 MODULE_DESCRIPTION("User-space I/O driver support for HID subsystem");
637+MODULE_ALIAS_MISCDEV(UHID_MINOR);
637638 MODULE_ALIAS("devname:" UHID_NAME);
drivers/hid/usbhid/hid-quirks.c+3−0
@@ -110,6 +110,9 @@ static const struct hid_blacklist { · 109 unmodified lines
110110 { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT },
111111 { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT },
112112 { USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS },
113+ { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS1, HID_QUIRK_NO_INIT_REPORTS },
114+ { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS2, HID_QUIRK_NO_INIT_REPORTS },
115+ { USB_VENDOR_ID_SIS, USB_DEVICE_ID_SIS_TS, HID_QUIRK_NO_INIT_REPORTS },
113116
114117 { 0, 0 }
115118 };
drivers/hwmon/applesmc.c+13−0
@@ -230,6 +230,7 @@ static int send_argument(const char *key) · 229 unmodified lines
230230
231231 static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len)
232232 {
233+ u8 status, data = 0;
233234 int i;
234235
235236 if (send_command(cmd) || send_argument(key)) {
@@ -237,6 +238,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) · 1 unmodified line
237238 return -EIO;
238239 }
239240
241+ /* This has no effect on newer (2012) SMCs */
240242 if (send_byte(len, APPLESMC_DATA_PORT)) {
241243 pr_warn("%.4s: read len fail\n", key);
242244 return -EIO;
@@ -250,6 +252,17 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) · 7 unmodified lines
250252 buffer[i] = inb(APPLESMC_DATA_PORT);
251253 }
252254
255+ /* Read the data port until bit0 is cleared */
256+ for (i = 0; i < 16; i++) {
257+ udelay(APPLESMC_MIN_WAIT);
258+ status = inb(APPLESMC_CMD_PORT);
259+ if (!(status & 0x01))
260+ break;
261+ data = inb(APPLESMC_DATA_PORT);
262+ }
263+ if (i)
264+ pr_warn("flushed %d bytes, last value is: %d\n", i, data);
265+
253266 return 0;
254267 }
255268
drivers/i2c/busses/i2c-designware-platdrv.c+3−2
@@ -270,7 +270,8 @@ static SIMPLE_DEV_PM_OPS(dw_i2c_dev_pm_ops, dw_i2c_suspend, dw_i2c_resume); · 269 unmodified lines
270270 MODULE_ALIAS("platform:i2c_designware");
271271
272272 static struct platform_driver dw_i2c_driver = {
273− .remove = dw_i2c_remove,
273+ .probe = dw_i2c_probe,
274+ .remove = dw_i2c_remove,
274275 .driver = {
275276 .name = "i2c_designware",
276277 .owner = THIS_MODULE,
@@ -282,7 +283,7 @@ static struct platform_driver dw_i2c_driver = { · 5 unmodified lines
282283
283284 static int __init dw_i2c_init_driver(void)
284285 {
285− return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe);
286+ return platform_driver_register(&dw_i2c_driver);
286287 }
287288 subsys_initcall(dw_i2c_init_driver);
288289
drivers/i2c/busses/i2c-imx.c+6−5
@@ -365,7 +365,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) · 364 unmodified lines
365365 clk_disable_unprepare(i2c_imx->clk);
366366 }
367367
368−static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
368+static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
369369 unsigned int rate)
370370 {
371371 struct imx_i2c_clk_pair *i2c_clk_div = i2c_imx->hwdata->clk_div;
@@ -589,7 +589,7 @@ static struct i2c_algorithm i2c_imx_algo = { · 217 unmodified lines
589589 .functionality = i2c_imx_func,
590590 };
591591
592−static int __init i2c_imx_probe(struct platform_device *pdev)
592+static int i2c_imx_probe(struct platform_device *pdev)
593593 {
594594 const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids,
595595 &pdev->dev);
@@ -697,7 +697,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) · 101 unmodified lines
697697 return 0; /* Return OK */
698698 }
699699
700−static int __exit i2c_imx_remove(struct platform_device *pdev)
700+static int i2c_imx_remove(struct platform_device *pdev)
701701 {
702702 struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev);
703703
@@ -715,7 +715,8 @@ static int __exit i2c_imx_remove(struct platform_device *pdev) · 11 unmodified lines
715715 }
716716
717717 static struct platform_driver i2c_imx_driver = {
718− .remove = __exit_p(i2c_imx_remove),
718+ .probe = i2c_imx_probe,
719+ .remove = i2c_imx_remove,
719720 .driver = {
720721 .name = DRIVER_NAME,
721722 .owner = THIS_MODULE,
@@ -726,7 +727,7 @@ static struct platform_driver i2c_imx_driver = { · 4 unmodified lines
726727
727728 static int __init i2c_adap_imx_init(void)
728729 {
729− return platform_driver_probe(&i2c_imx_driver, i2c_imx_probe);
730+ return platform_driver_register(&i2c_imx_driver);
730731 }
731732 subsys_initcall(i2c_adap_imx_init);
732733
drivers/i2c/busses/i2c-mxs.c+2−1
@@ -780,12 +780,13 @@ static struct platform_driver mxs_i2c_driver = { · 779 unmodified lines
780780 .owner = THIS_MODULE,
781781 .of_match_table = mxs_i2c_dt_ids,
782782 },
783+ .probe = mxs_i2c_probe,
783784 .remove = mxs_i2c_remove,
784785 };
785786
786787 static int __init mxs_i2c_init(void)
787788 {
788− return platform_driver_probe(&mxs_i2c_driver, mxs_i2c_probe);
789+ return platform_driver_register(&mxs_i2c_driver);
789790 }
790791 subsys_initcall(mxs_i2c_init);
791792
drivers/i2c/busses/i2c-omap.c+3−0
@@ -939,6 +939,9 @@ omap_i2c_isr_thread(int this_irq, void *dev_id) · 938 unmodified lines
939939 /*
940940 * ProDB0017052: Clear ARDY bit twice
941941 */
942+ if (stat & OMAP_I2C_STAT_ARDY)
943+ omap_i2c_ack_stat(dev, OMAP_I2C_STAT_ARDY);
944+
942945 if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
943946 OMAP_I2C_STAT_AL)) {
944947 omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_RRDY |
drivers/i2c/busses/i2c-stu300.c+5−6
@@ -859,8 +859,7 @@ static const struct i2c_algorithm stu300_algo = { · 858 unmodified lines
859859 .functionality = stu300_func,
860860 };
861861
862−static int __init
863−stu300_probe(struct platform_device *pdev)
862+static int stu300_probe(struct platform_device *pdev)
864863 {
865864 struct stu300_dev *dev;
866865 struct i2c_adapter *adap;
@@ -966,8 +965,7 @@ static SIMPLE_DEV_PM_OPS(stu300_pm, stu300_suspend, stu300_resume); · 99 unmodified lines
966965 #define STU300_I2C_PM NULL
967966 #endif
968967
969−static int __exit
970−stu300_remove(struct platform_device *pdev)
968+static int stu300_remove(struct platform_device *pdev)
971969 {
972970 struct stu300_dev *dev = platform_get_drvdata(pdev);
973971
@@ -989,13 +987,14 @@ static struct platform_driver stu300_i2c_driver = { · 15 unmodified lines
989987 .pm = STU300_I2C_PM,
990988 .of_match_table = stu300_dt_match,
991989 },
992− .remove = __exit_p(stu300_remove),
990+ .probe = stu300_probe,
991+ .remove = stu300_remove,
993992
994993 };
995994
996995 static int __init stu300_init(void)
997996 {
998− return platform_driver_probe(&stu300_i2c_driver, stu300_probe);
997+ return platform_driver_register(&stu300_i2c_driver);
999998 }
1000999
10011000 static void __exit stu300_exit(void)
drivers/i2c/i2c-core.c+3−0
@@ -1134,6 +1134,9 @@ static void acpi_i2c_register_devices(struct i2c_adapter *adap) · 1133 unmodified lines
11341134 acpi_handle handle;
11351135 acpi_status status;
11361136
1137+ if (!adap->dev.parent)
1138+ return;
1139+
11371140 handle = ACPI_HANDLE(adap->dev.parent);
11381141 if (!handle)
11391142 return;
drivers/i2c/muxes/i2c-arb-gpio-challenge.c+1−1
@@ -200,7 +200,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev) · 199 unmodified lines
200200 arb->parent = of_find_i2c_adapter_by_node(parent_np);
201201 if (!arb->parent) {
202202 dev_err(dev, "Cannot find parent bus\n");
203− return -EINVAL;
203+ return -EPROBE_DEFER;
204204 }
205205
206206 /* Actually add the mux adapter */
drivers/i2c/muxes/i2c-mux-gpio.c+9−5
@@ -66,7 +66,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, · 65 unmodified lines
6666 struct device_node *adapter_np, *child;
6767 struct i2c_adapter *adapter;
6868 unsigned *values, *gpios;
69− int i = 0;
69+ int i = 0, ret;
7070
7171 if (!np)
7272 return -ENODEV;
@@ -79,7 +79,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, · 6 unmodified lines
7979 adapter = of_find_i2c_adapter_by_node(adapter_np);
8080 if (!adapter) {
8181 dev_err(&pdev->dev, "Cannot find parent bus\n");
82− return -ENODEV;
82+ return -EPROBE_DEFER;
8383 }
8484 mux->data.parent = i2c_adapter_id(adapter);
8585 put_device(&adapter->dev);
@@ -116,8 +116,12 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, · 30 unmodified lines
116116 return -ENOMEM;
117117 }
118118
119− for (i = 0; i < mux->data.n_gpios; i++)
120− gpios[i] = of_get_named_gpio(np, "mux-gpios", i);
119+ for (i = 0; i < mux->data.n_gpios; i++) {
120+ ret = of_get_named_gpio(np, "mux-gpios", i);
121+ if (ret < 0)
122+ return ret;
123+ gpios[i] = ret;
124+ }
121125
122126 mux->data.gpios = gpios;
123127
@@ -177,7 +181,7 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev) · 53 unmodified lines
177181 if (!parent) {
178182 dev_err(&pdev->dev, "Parent adapter (%d) not found\n",
179183 mux->data.parent);
180− return -ENODEV;
184+ return -EPROBE_DEFER;
181185 }
182186
183187 mux->parent = parent;
drivers/i2c/muxes/i2c-mux-pinctrl.c+2−2
@@ -113,7 +113,7 @@ static int i2c_mux_pinctrl_parse_dt(struct i2c_mux_pinctrl *mux, · 112 unmodified lines
113113 adapter = of_find_i2c_adapter_by_node(adapter_np);
114114 if (!adapter) {
115115 dev_err(mux->dev, "Cannot find parent bus\n");
116− return -ENODEV;
116+ return -EPROBE_DEFER;
117117 }
118118 mux->pdata->parent_bus_num = i2c_adapter_id(adapter);
119119 put_device(&adapter->dev);
@@ -211,7 +211,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev) · 91 unmodified lines
211211 if (!mux->parent) {
212212 dev_err(&pdev->dev, "Parent adapter (%d) not found\n",
213213 mux->pdata->parent_bus_num);
214− ret = -ENODEV;
214+ ret = -EPROBE_DEFER;
215215 goto err;
216216 }
217217
drivers/iio/amplifiers/ad8366.c+1−3
@@ -185,10 +185,8 @@ static int ad8366_remove(struct spi_device *spi) · 184 unmodified lines
185185
186186 iio_device_unregister(indio_dev);
187187
188− if (!IS_ERR(reg)) {
188+ if (!IS_ERR(reg))
189189 regulator_disable(reg);
190− regulator_put(reg);
191− }
192190
193191 return 0;
194192 }
drivers/iio/frequency/adf4350.c+4−2
@@ -525,8 +525,10 @@ static int adf4350_probe(struct spi_device *spi) · 524 unmodified lines
525525 }
526526
527527 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
528− if (indio_dev == NULL)
529− return -ENOMEM;
528+ if (indio_dev == NULL) {
529+ ret = -ENOMEM;
530+ goto error_disable_clk;
531+ }
530532
531533 st = iio_priv(indio_dev);
532534
drivers/iio/industrialio-buffer.c+3−0
@@ -477,6 +477,9 @@ void iio_disable_all_buffers(struct iio_dev *indio_dev) · 476 unmodified lines
477477 indio_dev->currentmode = INDIO_DIRECT_MODE;
478478 if (indio_dev->setup_ops->postdisable)
479479 indio_dev->setup_ops->postdisable(indio_dev);
480+
481+ if (indio_dev->available_scan_masks == NULL)
482+ kfree(indio_dev->active_scan_mask);
480483 }
481484
482485 int iio_update_buffers(struct iio_dev *indio_dev,
drivers/iio/industrialio-core.c+1−1
@@ -852,7 +852,6 @@ static void iio_dev_release(struct device *device) · 851 unmodified lines
852852 iio_device_unregister_trigger_consumer(indio_dev);
853853 iio_device_unregister_eventset(indio_dev);
854854 iio_device_unregister_sysfs(indio_dev);
855− iio_device_unregister_debugfs(indio_dev);
856855
857856 ida_simple_remove(&iio_ida, indio_dev->id);
858857 kfree(indio_dev);
@@ -1087,6 +1086,7 @@ void iio_device_unregister(struct iio_dev *indio_dev) · 228 unmodified lines
10871086
10881087 if (indio_dev->chrdev.dev)
10891088 cdev_del(&indio_dev->chrdev);
1089+ iio_device_unregister_debugfs(indio_dev);
10901090
10911091 iio_disable_all_buffers(indio_dev);
10921092
drivers/iio/magnetometer/st_magn_core.c+9−9
@@ -29,9 +29,9 @@ · 28 unmodified lines
2929 #define ST_MAGN_NUMBER_DATA_CHANNELS 3
3030
3131 /* DEFAULT VALUE FOR SENSORS */
32−#define ST_MAGN_DEFAULT_OUT_X_L_ADDR 0X04
33−#define ST_MAGN_DEFAULT_OUT_Y_L_ADDR 0X08
34−#define ST_MAGN_DEFAULT_OUT_Z_L_ADDR 0X06
32+#define ST_MAGN_DEFAULT_OUT_X_H_ADDR 0X03
33+#define ST_MAGN_DEFAULT_OUT_Y_H_ADDR 0X07
34+#define ST_MAGN_DEFAULT_OUT_Z_H_ADDR 0X05
3535
3636 /* FULLSCALE */
3737 #define ST_MAGN_FS_AVL_1300MG 1300
@@ -117,16 +117,16 @@ · 79 unmodified lines
117117 static const struct iio_chan_spec st_magn_16bit_channels[] = {
118118 ST_SENSORS_LSM_CHANNELS(IIO_MAGN,
119119 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
120− ST_SENSORS_SCAN_X, 1, IIO_MOD_X, 's', IIO_LE, 16, 16,
121− ST_MAGN_DEFAULT_OUT_X_L_ADDR),
120+ ST_SENSORS_SCAN_X, 1, IIO_MOD_X, 's', IIO_BE, 16, 16,
121+ ST_MAGN_DEFAULT_OUT_X_H_ADDR),
122122 ST_SENSORS_LSM_CHANNELS(IIO_MAGN,
123123 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
124− ST_SENSORS_SCAN_Y, 1, IIO_MOD_Y, 's', IIO_LE, 16, 16,
125− ST_MAGN_DEFAULT_OUT_Y_L_ADDR),
124+ ST_SENSORS_SCAN_Y, 1, IIO_MOD_Y, 's', IIO_BE, 16, 16,
125+ ST_MAGN_DEFAULT_OUT_Y_H_ADDR),
126126 ST_SENSORS_LSM_CHANNELS(IIO_MAGN,
127127 BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
128− ST_SENSORS_SCAN_Z, 1, IIO_MOD_Z, 's', IIO_LE, 16, 16,
129− ST_MAGN_DEFAULT_OUT_Z_L_ADDR),
128+ ST_SENSORS_SCAN_Z, 1, IIO_MOD_Z, 's', IIO_BE, 16, 16,
129+ ST_MAGN_DEFAULT_OUT_Z_H_ADDR),
130130 IIO_CHAN_SOFT_TIMESTAMP(3)
131131 };
132132
drivers/infiniband/Kconfig+11−0
@@ -31,6 +31,17 @@ config INFINIBAND_USER_ACCESS · 30 unmodified lines
3131 libibverbs, libibcm and a hardware driver library from
3232 <http://www.openfabrics.org/git/>.
3333
34+config INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
35+ bool "Experimental and unstable ABI for userspace access to flow steering verbs"
36+ depends on INFINIBAND_USER_ACCESS
37+ depends on STAGING
38+ ---help---
39+ The final ABI for userspace access to flow steering verbs
40+ has not been defined. To use the current ABI, *WHICH WILL
41+ CHANGE IN THE FUTURE*, say Y here.
42+
43+ If unsure, say N.
44+
3445 config INFINIBAND_USER_MEM
3546 bool
3647 depends on INFINIBAND_USER_ACCESS != n
drivers/infiniband/core/uverbs.h+2−0
@@ -217,7 +217,9 @@ IB_UVERBS_DECLARE_CMD(destroy_srq); · 216 unmodified lines
217217 IB_UVERBS_DECLARE_CMD(create_xsrq);
218218 IB_UVERBS_DECLARE_CMD(open_xrcd);
219219 IB_UVERBS_DECLARE_CMD(close_xrcd);
220+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
220221 IB_UVERBS_DECLARE_CMD(create_flow);
221222 IB_UVERBS_DECLARE_CMD(destroy_flow);
223+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
222224
223225 #endif /* UVERBS_H */
drivers/infiniband/core/uverbs_cmd.c+4−0
@@ -54,7 +54,9 @@ static struct uverbs_lock_class qp_lock_class = { .name = "QP-uobj" }; · 53 unmodified lines
5454 static struct uverbs_lock_class ah_lock_class = { .name = "AH-uobj" };
5555 static struct uverbs_lock_class srq_lock_class = { .name = "SRQ-uobj" };
5656 static struct uverbs_lock_class xrcd_lock_class = { .name = "XRCD-uobj" };
57+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
5758 static struct uverbs_lock_class rule_lock_class = { .name = "RULE-uobj" };
59+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
5860
5961 #define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \
6062 do { \
@@ -2599,6 +2601,7 @@ out_put: · 2538 unmodified lines
25992601 return ret ? ret : in_len;
26002602 }
26012603
2604+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
26022605 static int kern_spec_to_ib_spec(struct ib_kern_spec *kern_spec,
26032606 union ib_flow_spec *ib_spec)
26042607 {
@@ -2824,6 +2827,7 @@ ssize_t ib_uverbs_destroy_flow(struct ib_uverbs_file *file, · 219 unmodified lines
28242827
28252828 return ret ? ret : in_len;
28262829 }
2830+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
28272831
28282832 static int __uverbs_create_xsrq(struct ib_uverbs_file *file,
28292833 struct ib_uverbs_create_xsrq *cmd,
drivers/infiniband/core/uverbs_main.c+6−0
@@ -115,8 +115,10 @@ static ssize_t (*uverbs_cmd_table[])(struct ib_uverbs_file *file, · 114 unmodified lines
115115 [IB_USER_VERBS_CMD_CLOSE_XRCD] = ib_uverbs_close_xrcd,
116116 [IB_USER_VERBS_CMD_CREATE_XSRQ] = ib_uverbs_create_xsrq,
117117 [IB_USER_VERBS_CMD_OPEN_QP] = ib_uverbs_open_qp,
118+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
118119 [IB_USER_VERBS_CMD_CREATE_FLOW] = ib_uverbs_create_flow,
119120 [IB_USER_VERBS_CMD_DESTROY_FLOW] = ib_uverbs_destroy_flow
121+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
120122 };
121123
122124 static void ib_uverbs_add_one(struct ib_device *device);
@@ -605,6 +607,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 482 unmodified lines
605607 if (!(file->device->ib_dev->uverbs_cmd_mask & (1ull << hdr.command)))
606608 return -ENOSYS;
607609
610+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
608611 if (hdr.command >= IB_USER_VERBS_CMD_THRESHOLD) {
609612 struct ib_uverbs_cmd_hdr_ex hdr_ex;
610613
@@ -621,6 +624,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 10 unmodified lines
621624 (hdr_ex.out_words +
622625 hdr_ex.provider_out_words) * 4);
623626 } else {
627+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
624628 if (hdr.in_words * 4 != count)
625629 return -EINVAL;
626630
@@ -628,7 +632,9 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 1 unmodified line
628632 buf + sizeof(hdr),
629633 hdr.in_words * 4,
630634 hdr.out_words * 4);
635+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
631636 }
637+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
632638 }
633639
634640 static int ib_uverbs_mmap(struct file *filp, struct vm_area_struct *vma)
drivers/infiniband/hw/amso1100/c2_ae.c+1−1
@@ -141,7 +141,7 @@ static const char *to_qp_state_str(int state) · 140 unmodified lines
141141 return "C2_QP_STATE_ERROR";
142142 default:
143143 return "<invalid QP state>";
144− };
144+ }
145145 }
146146
147147 void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
drivers/infiniband/hw/mlx4/main.c+2−0
@@ -1691,9 +1691,11 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) · 1690 unmodified lines
16911691 ibdev->ib_dev.create_flow = mlx4_ib_create_flow;
16921692 ibdev->ib_dev.destroy_flow = mlx4_ib_destroy_flow;
16931693
1694+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
16941695 ibdev->ib_dev.uverbs_cmd_mask |=
16951696 (1ull << IB_USER_VERBS_CMD_CREATE_FLOW) |
16961697 (1ull << IB_USER_VERBS_CMD_DESTROY_FLOW);
1698+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
16971699 }
16981700
16991701 mlx4_ib_alloc_eqs(dev, ibdev);
drivers/infiniband/hw/mlx5/main.c+10−6
@@ -164,6 +164,7 @@ int mlx5_vector2eqn(struct mlx5_ib_dev *dev, int vector, int *eqn, int *irqn) · 163 unmodified lines
164164 static int alloc_comp_eqs(struct mlx5_ib_dev *dev)
165165 {
166166 struct mlx5_eq_table *table = &dev->mdev.priv.eq_table;
167+ char name[MLX5_MAX_EQ_NAME];
167168 struct mlx5_eq *eq, *n;
168169 int ncomp_vec;
169170 int nent;
@@ -180,11 +181,10 @@ static int alloc_comp_eqs(struct mlx5_ib_dev *dev) · 10 unmodified lines
180181 goto clean;
181182 }
182183
183− snprintf(eq->name, MLX5_MAX_EQ_NAME, "mlx5_comp%d", i);
184+ snprintf(name, MLX5_MAX_EQ_NAME, "mlx5_comp%d", i);
184185 err = mlx5_create_map_eq(&dev->mdev, eq,
185186 i + MLX5_EQ_VEC_COMP_BASE, nent, 0,
186− eq->name,
187− &dev->mdev.priv.uuari.uars[0]);
187+ name, &dev->mdev.priv.uuari.uars[0]);
188188 if (err) {
189189 kfree(eq);
190190 goto clean;
@@ -301,9 +301,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, · 110 unmodified lines
301301 props->max_srq_sge = max_rq_sg - 1;
302302 props->max_fast_reg_page_list_len = (unsigned int)-1;
303303 props->local_ca_ack_delay = dev->mdev.caps.local_ca_ack_delay;
304− props->atomic_cap = dev->mdev.caps.flags & MLX5_DEV_CAP_FLAG_ATOMIC ?
305− IB_ATOMIC_HCA : IB_ATOMIC_NONE;
306− props->masked_atomic_cap = IB_ATOMIC_HCA;
304+ props->atomic_cap = IB_ATOMIC_NONE;
305+ props->masked_atomic_cap = IB_ATOMIC_NONE;
307306 props->max_pkeys = be16_to_cpup((__be16 *)(out_mad->data + 28));
308307 props->max_mcast_grp = 1 << dev->mdev.caps.log_max_mcg;
309308 props->max_mcast_qp_attach = dev->mdev.caps.max_qp_mcg;
@@ -1006,6 +1005,11 @@ static void mlx5_ib_event(struct mlx5_core_dev *dev, enum mlx5_dev_event event, · 696 unmodified lines
10061005 ibev.device = &ibdev->ib_dev;
10071006 ibev.element.port_num = port;
10081007
1008+ if (port < 1 || port > ibdev->num_ports) {
1009+ mlx5_ib_warn(ibdev, "warning: event on port %d\n", port);
1010+ return;
1011+ }
1012+
10091013 if (ibdev->ib_active)
10101014 ib_dispatch_event(&ibev);
10111015 }
drivers/infiniband/hw/mlx5/mr.c+33−37
@@ -42,6 +42,10 @@ enum { · 41 unmodified lines
4242 DEF_CACHE_SIZE = 10,
4343 };
4444
45+enum {
46+ MLX5_UMR_ALIGN = 2048
47+};
48+
4549 static __be64 *mr_align(__be64 *ptr, int align)
4650 {
4751 unsigned long mask = align - 1;
@@ -61,13 +65,11 @@ static int order2idx(struct mlx5_ib_dev *dev, int order) · 13 unmodified lines
6165
6266 static int add_keys(struct mlx5_ib_dev *dev, int c, int num)
6367 {
64− struct device *ddev = dev->ib_dev.dma_device;
6568 struct mlx5_mr_cache *cache = &dev->cache;
6669 struct mlx5_cache_ent *ent = &cache->ent[c];
6770 struct mlx5_create_mkey_mbox_in *in;
6871 struct mlx5_ib_mr *mr;
6972 int npages = 1 << ent->order;
70− int size = sizeof(u64) * npages;
7173 int err = 0;
7274 int i;
7375
@@ -83,21 +85,6 @@ static int add_keys(struct mlx5_ib_dev *dev, int c, int num) · 9 unmodified lines
8385 }
8486 mr->order = ent->order;
8587 mr->umred = 1;
86− mr->pas = kmalloc(size + 0x3f, GFP_KERNEL);
87− if (!mr->pas) {
88− kfree(mr);
89− err = -ENOMEM;
90− goto out;
91− }
92− mr->dma = dma_map_single(ddev, mr_align(mr->pas, 0x40), size,
93− DMA_TO_DEVICE);
94− if (dma_mapping_error(ddev, mr->dma)) {
95− kfree(mr->pas);
96− kfree(mr);
97− err = -ENOMEM;
98− goto out;
99− }
100−
10188 in->seg.status = 1 << 6;
10289 in->seg.xlt_oct_size = cpu_to_be32((npages + 1) / 2);
10390 in->seg.qpn_mkey7_0 = cpu_to_be32(0xffffff << 8);
@@ -108,8 +95,6 @@ static int add_keys(struct mlx5_ib_dev *dev, int c, int num) · 4 unmodified lines
10895 sizeof(*in));
10996 if (err) {
11097 mlx5_ib_warn(dev, "create mkey failed %d\n", err);
111− dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE);
112− kfree(mr->pas);
11398 kfree(mr);
11499 goto out;
115100 }
@@ -129,11 +114,9 @@ out: · 13 unmodified lines
129114
130115 static void remove_keys(struct mlx5_ib_dev *dev, int c, int num)
131116 {
132− struct device *ddev = dev->ib_dev.dma_device;
133117 struct mlx5_mr_cache *cache = &dev->cache;
134118 struct mlx5_cache_ent *ent = &cache->ent[c];
135119 struct mlx5_ib_mr *mr;
136− int size;
137120 int err;
138121 int i;
139122
@@ -149,14 +132,10 @@ static void remove_keys(struct mlx5_ib_dev *dev, int c, int num) · 9 unmodified lines
149132 ent->size--;
150133 spin_unlock(&ent->lock);
151134 err = mlx5_core_destroy_mkey(&dev->mdev, &mr->mmr);
152− if (err) {
135+ if (err)
153136 mlx5_ib_warn(dev, "failed destroy mkey\n");
154− } else {
155− size = ALIGN(sizeof(u64) * (1 << mr->order), 0x40);
156− dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE);
157− kfree(mr->pas);
137+ else
158138 kfree(mr);
159− }
160139 }
161140 }
162141
@@ -408,13 +387,12 @@ static void free_cached_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr) · 245 unmodified lines
408387
409388 static void clean_keys(struct mlx5_ib_dev *dev, int c)
410389 {
411− struct device *ddev = dev->ib_dev.dma_device;
412390 struct mlx5_mr_cache *cache = &dev->cache;
413391 struct mlx5_cache_ent *ent = &cache->ent[c];
414392 struct mlx5_ib_mr *mr;
415− int size;
416393 int err;
417394
395+ cancel_delayed_work(&ent->dwork);
418396 while (1) {
419397 spin_lock(&ent->lock);
420398 if (list_empty(&ent->head)) {
@@ -427,14 +405,10 @@ static void clean_keys(struct mlx5_ib_dev *dev, int c) · 6 unmodified lines
427405 ent->size--;
428406 spin_unlock(&ent->lock);
429407 err = mlx5_core_destroy_mkey(&dev->mdev, &mr->mmr);
430− if (err) {
408+ if (err)
431409 mlx5_ib_warn(dev, "failed destroy mkey\n");
432− } else {
433− size = ALIGN(sizeof(u64) * (1 << mr->order), 0x40);
434− dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE);
435− kfree(mr->pas);
410+ else
436411 kfree(mr);
437− }
438412 }
439413 }
440414
@@ -540,13 +514,15 @@ int mlx5_mr_cache_cleanup(struct mlx5_ib_dev *dev) · 99 unmodified lines
540514 int i;
541515
542516 dev->cache.stopped = 1;
543− destroy_workqueue(dev->cache.wq);
517+ flush_workqueue(dev->cache.wq);
544518
545519 mlx5_mr_cache_debugfs_cleanup(dev);
546520
547521 for (i = 0; i < MAX_MR_CACHE_ENTRIES; i++)
548522 clean_keys(dev, i);
549523
524+ destroy_workqueue(dev->cache.wq);
525+
550526 return 0;
551527 }
552528
@@ -675,10 +651,12 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem, · 122 unmodified lines
675651 int page_shift, int order, int access_flags)
676652 {
677653 struct mlx5_ib_dev *dev = to_mdev(pd->device);
654+ struct device *ddev = dev->ib_dev.dma_device;
678655 struct umr_common *umrc = &dev->umrc;
679656 struct ib_send_wr wr, *bad;
680657 struct mlx5_ib_mr *mr;
681658 struct ib_sge sg;
659+ int size = sizeof(u64) * npages;
682660 int err;
683661 int i;
684662
@@ -697,7 +675,22 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem, · 12 unmodified lines
697675 if (!mr)
698676 return ERR_PTR(-EAGAIN);
699677
700− mlx5_ib_populate_pas(dev, umem, page_shift, mr_align(mr->pas, 0x40), 1);
678+ mr->pas = kmalloc(size + MLX5_UMR_ALIGN - 1, GFP_KERNEL);
679+ if (!mr->pas) {
680+ err = -ENOMEM;
681+ goto error;
682+ }
683+
684+ mlx5_ib_populate_pas(dev, umem, page_shift,
685+ mr_align(mr->pas, MLX5_UMR_ALIGN), 1);
686+
687+ mr->dma = dma_map_single(ddev, mr_align(mr->pas, MLX5_UMR_ALIGN), size,
688+ DMA_TO_DEVICE);
689+ if (dma_mapping_error(ddev, mr->dma)) {
690+ kfree(mr->pas);
691+ err = -ENOMEM;
692+ goto error;
693+ }
701694
702695 memset(&wr, 0, sizeof(wr));
703696 wr.wr_id = (u64)(unsigned long)mr;
@@ -718,6 +711,9 @@ static struct mlx5_ib_mr *reg_umr(struct ib_pd *pd, struct ib_umem *umem, · 14 unmodified lines
718711 wait_for_completion(&mr->done);
719712 up(&umrc->sem);
720713
714+ dma_unmap_single(ddev, mr->dma, size, DMA_TO_DEVICE);
715+ kfree(mr->pas);
716+
721717 if (mr->status != IB_WC_SUCCESS) {
722718 mlx5_ib_warn(dev, "reg umr failed\n");
723719 err = -EFAULT;
drivers/infiniband/hw/mlx5/qp.c+30−50
@@ -203,7 +203,7 @@ static int sq_overhead(enum ib_qp_type qp_type) · 202 unmodified lines
203203
204204 switch (qp_type) {
205205 case IB_QPT_XRC_INI:
206− size = sizeof(struct mlx5_wqe_xrc_seg);
206+ size += sizeof(struct mlx5_wqe_xrc_seg);
207207 /* fall through */
208208 case IB_QPT_RC:
209209 size += sizeof(struct mlx5_wqe_ctrl_seg) +
@@ -211,20 +211,23 @@ static int sq_overhead(enum ib_qp_type qp_type) · 1 unmodified line
211211 sizeof(struct mlx5_wqe_raddr_seg);
212212 break;
213213
214+ case IB_QPT_XRC_TGT:
215+ return 0;
216+
214217 case IB_QPT_UC:
215− size = sizeof(struct mlx5_wqe_ctrl_seg) +
218+ size += sizeof(struct mlx5_wqe_ctrl_seg) +
216219 sizeof(struct mlx5_wqe_raddr_seg);
217220 break;
218221
219222 case IB_QPT_UD:
220223 case IB_QPT_SMI:
221224 case IB_QPT_GSI:
222− size = sizeof(struct mlx5_wqe_ctrl_seg) +
225+ size += sizeof(struct mlx5_wqe_ctrl_seg) +
223226 sizeof(struct mlx5_wqe_datagram_seg);
224227 break;
225228
226229 case MLX5_IB_QPT_REG_UMR:
227− size = sizeof(struct mlx5_wqe_ctrl_seg) +
230+ size += sizeof(struct mlx5_wqe_ctrl_seg) +
228231 sizeof(struct mlx5_wqe_umr_ctrl_seg) +
229232 sizeof(struct mlx5_mkey_seg);
230233 break;
@@ -270,7 +273,8 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr, · 39 unmodified lines
270273 return wqe_size;
271274
272275 if (wqe_size > dev->mdev.caps.max_sq_desc_sz) {
273− mlx5_ib_dbg(dev, "\n");
276+ mlx5_ib_dbg(dev, "wqe_size(%d) > max_sq_desc_sz(%d)\n",
277+ wqe_size, dev->mdev.caps.max_sq_desc_sz);
274278 return -EINVAL;
275279 }
276280
@@ -280,9 +284,15 @@ static int calc_sq_size(struct mlx5_ib_dev *dev, struct ib_qp_init_attr *attr, · 3 unmodified lines
280284
281285 wq_size = roundup_pow_of_two(attr->cap.max_send_wr * wqe_size);
282286 qp->sq.wqe_cnt = wq_size / MLX5_SEND_WQE_BB;
287+ if (qp->sq.wqe_cnt > dev->mdev.caps.max_wqes) {
288+ mlx5_ib_dbg(dev, "wqe count(%d) exceeds limits(%d)\n",
289+ qp->sq.wqe_cnt, dev->mdev.caps.max_wqes);
290+ return -ENOMEM;
291+ }
283292 qp->sq.wqe_shift = ilog2(MLX5_SEND_WQE_BB);
284293 qp->sq.max_gs = attr->cap.max_send_sge;
285− qp->sq.max_post = 1 << ilog2(wq_size / wqe_size);
294+ qp->sq.max_post = wq_size / wqe_size;
295+ attr->cap.max_send_wr = qp->sq.max_post;
286296
287297 return wq_size;
288298 }
@@ -1280,6 +1290,11 @@ static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_Q · 991 unmodified lines
12801290 MLX5_QP_OPTPAR_Q_KEY,
12811291 [MLX5_QP_ST_MLX] = MLX5_QP_OPTPAR_PKEY_INDEX |
12821292 MLX5_QP_OPTPAR_Q_KEY,
1293+ [MLX5_QP_ST_XRC] = MLX5_QP_OPTPAR_ALT_ADDR_PATH |
1294+ MLX5_QP_OPTPAR_RRE |
1295+ MLX5_QP_OPTPAR_RAE |
1296+ MLX5_QP_OPTPAR_RWE |
1297+ MLX5_QP_OPTPAR_PKEY_INDEX,
12831298 },
12841299 },
12851300 [MLX5_QP_STATE_RTR] = {
@@ -1314,6 +1329,11 @@ static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_Q · 28 unmodified lines
13141329 [MLX5_QP_STATE_RTS] = {
13151330 [MLX5_QP_ST_UD] = MLX5_QP_OPTPAR_Q_KEY,
13161331 [MLX5_QP_ST_MLX] = MLX5_QP_OPTPAR_Q_KEY,
1332+ [MLX5_QP_ST_UC] = MLX5_QP_OPTPAR_RWE,
1333+ [MLX5_QP_ST_RC] = MLX5_QP_OPTPAR_RNR_TIMEOUT |
1334+ MLX5_QP_OPTPAR_RWE |
1335+ MLX5_QP_OPTPAR_RAE |
1336+ MLX5_QP_OPTPAR_RRE,
13171337 },
13181338 },
13191339 };
@@ -1651,29 +1671,6 @@ static __always_inline void set_raddr_seg(struct mlx5_wqe_raddr_seg *rseg, · 331 unmodified lines
16511671 rseg->reserved = 0;
16521672 }
16531673
1654−static void set_atomic_seg(struct mlx5_wqe_atomic_seg *aseg, struct ib_send_wr *wr)
1655−{
1656− if (wr->opcode == IB_WR_ATOMIC_CMP_AND_SWP) {
1657− aseg->swap_add = cpu_to_be64(wr->wr.atomic.swap);
1658− aseg->compare = cpu_to_be64(wr->wr.atomic.compare_add);
1659− } else if (wr->opcode == IB_WR_MASKED_ATOMIC_FETCH_AND_ADD) {
1660− aseg->swap_add = cpu_to_be64(wr->wr.atomic.compare_add);
1661− aseg->compare = cpu_to_be64(wr->wr.atomic.compare_add_mask);
1662− } else {
1663− aseg->swap_add = cpu_to_be64(wr->wr.atomic.compare_add);
1664− aseg->compare = 0;
1665− }
1666−}
1667−
1668−static void set_masked_atomic_seg(struct mlx5_wqe_masked_atomic_seg *aseg,
1669− struct ib_send_wr *wr)
1670−{
1671− aseg->swap_add = cpu_to_be64(wr->wr.atomic.swap);
1672− aseg->swap_add_mask = cpu_to_be64(wr->wr.atomic.swap_mask);
1673− aseg->compare = cpu_to_be64(wr->wr.atomic.compare_add);
1674− aseg->compare_mask = cpu_to_be64(wr->wr.atomic.compare_add_mask);
1675−}
1676−
16771674 static void set_datagram_seg(struct mlx5_wqe_datagram_seg *dseg,
16781675 struct ib_send_wr *wr)
16791676 {
@@ -2063,28 +2060,11 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 383 unmodified lines
20632060
20642061 case IB_WR_ATOMIC_CMP_AND_SWP:
20652062 case IB_WR_ATOMIC_FETCH_AND_ADD:
2066− set_raddr_seg(seg, wr->wr.atomic.remote_addr,
2067− wr->wr.atomic.rkey);
2068− seg += sizeof(struct mlx5_wqe_raddr_seg);
2069−
2070− set_atomic_seg(seg, wr);
2071− seg += sizeof(struct mlx5_wqe_atomic_seg);
2072−
2073− size += (sizeof(struct mlx5_wqe_raddr_seg) +
2074− sizeof(struct mlx5_wqe_atomic_seg)) / 16;
2075− break;
2076−
20772063 case IB_WR_MASKED_ATOMIC_CMP_AND_SWP:
2078− set_raddr_seg(seg, wr->wr.atomic.remote_addr,
2079− wr->wr.atomic.rkey);
2080− seg += sizeof(struct mlx5_wqe_raddr_seg);
2081−
2082− set_masked_atomic_seg(seg, wr);
2083− seg += sizeof(struct mlx5_wqe_masked_atomic_seg);
2084−
2085− size += (sizeof(struct mlx5_wqe_raddr_seg) +
2086− sizeof(struct mlx5_wqe_masked_atomic_seg)) / 16;
2087− break;
2064+ mlx5_ib_warn(dev, "Atomic operations are not supported yet\n");
2065+ err = -ENOSYS;
2066+ *bad_wr = wr;
2067+ goto out;
20882068
20892069 case IB_WR_LOCAL_INV:
20902070 next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL;
drivers/infiniband/hw/mlx5/srq.c+3−1
@@ -295,7 +295,7 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, · 294 unmodified lines
295295 mlx5_vfree(in);
296296 if (err) {
297297 mlx5_ib_dbg(dev, "create SRQ failed, err %d\n", err);
298− goto err_srq;
298+ goto err_usr_kern_srq;
299299 }
300300
301301 mlx5_ib_dbg(dev, "create SRQ with srqn 0x%x\n", srq->msrq.srqn);
@@ -316,6 +316,8 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, · 14 unmodified lines
316316
317317 err_core:
318318 mlx5_core_destroy_srq(&dev->mdev, &srq->msrq);
319+
320+err_usr_kern_srq:
319321 if (pd->uobject)
320322 destroy_srq_user(pd, srq);
321323 else
drivers/infiniband/hw/mthca/mthca_eq.c+1−1
@@ -357,7 +357,7 @@ static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq) · 356 unmodified lines
357357 mthca_warn(dev, "Unhandled event %02x(%02x) on EQ %d\n",
358358 eqe->type, eqe->subtype, eq->eqn);
359359 break;
360− };
360+ }
361361
362362 set_eqe_hw(eqe);
363363 ++eq->cons_index;
drivers/infiniband/hw/ocrdma/ocrdma_hw.c+3−3
@@ -150,7 +150,7 @@ enum ib_qp_state get_ibqp_state(enum ocrdma_qp_state qps) · 149 unmodified lines
150150 return IB_QPS_SQE;
151151 case OCRDMA_QPS_ERR:
152152 return IB_QPS_ERR;
153− };
153+ }
154154 return IB_QPS_ERR;
155155 }
156156
@@ -171,7 +171,7 @@ static enum ocrdma_qp_state get_ocrdma_qp_state(enum ib_qp_state qps) · 14 unmodified lines
171171 return OCRDMA_QPS_SQE;
172172 case IB_QPS_ERR:
173173 return OCRDMA_QPS_ERR;
174− };
174+ }
175175 return OCRDMA_QPS_ERR;
176176 }
177177
@@ -1982,7 +1982,7 @@ int ocrdma_mbx_create_qp(struct ocrdma_qp *qp, struct ib_qp_init_attr *attrs, · 1804 unmodified lines
19821982 break;
19831983 default:
19841984 return -EINVAL;
1985− };
1985+ }
19861986
19871987 cmd = ocrdma_init_emb_mqe(OCRDMA_CMD_CREATE_QP, sizeof(*cmd));
19881988 if (!cmd)
drivers/infiniband/hw/ocrdma/ocrdma_main.c+1−1
@@ -531,7 +531,7 @@ static void ocrdma_event_handler(struct ocrdma_dev *dev, u32 event) · 530 unmodified lines
531531 case BE_DEV_DOWN:
532532 ocrdma_close(dev);
533533 break;
534− };
534+ }
535535 }
536536
537537 static struct ocrdma_driver ocrdma_drv = {
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+3−3
@@ -141,7 +141,7 @@ static inline void get_link_speed_and_width(struct ocrdma_dev *dev, · 140 unmodified lines
141141 /* Unsupported */
142142 *ib_speed = IB_SPEED_SDR;
143143 *ib_width = IB_WIDTH_1X;
144− };
144+ }
145145 }
146146
147147
@@ -2331,7 +2331,7 @@ static enum ib_wc_status ocrdma_to_ibwc_err(u16 status) · 2183 unmodified lines
23312331 default:
23322332 ibwc_status = IB_WC_GENERAL_ERR;
23332333 break;
2334− };
2334+ }
23352335 return ibwc_status;
23362336 }
23372337
@@ -2370,7 +2370,7 @@ static void ocrdma_update_wc(struct ocrdma_qp *qp, struct ib_wc *ibwc, · 32 unmodified lines
23702370 pr_err("%s() invalid opcode received = 0x%x\n",
23712371 __func__, hdr->cw & OCRDMA_WQE_OPCODE_MASK);
23722372 break;
2373− };
2373+ }
23742374 }
23752375
23762376 static void ocrdma_set_cqe_status_flushed(struct ocrdma_qp *qp,
drivers/infiniband/ulp/srpt/ib_srpt.c+6−8
@@ -1588,7 +1588,7 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, · 1587 unmodified lines
15881588 int resp_data_len;
15891589 int resp_len;
15901590
1591− resp_data_len = (rsp_code == SRP_TSK_MGMT_SUCCESS) ? 0 : 4;
1591+ resp_data_len = 4;
15921592 resp_len = sizeof(*srp_rsp) + resp_data_len;
15931593
15941594 srp_rsp = ioctx->ioctx.buf;
@@ -1600,11 +1600,9 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch, · 5 unmodified lines
16001600 + atomic_xchg(&ch->req_lim_delta, 0));
16011601 srp_rsp->tag = tag;
16021602
1603− if (rsp_code != SRP_TSK_MGMT_SUCCESS) {
1604− srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
1605− srp_rsp->resp_data_len = cpu_to_be32(resp_data_len);
1606− srp_rsp->data[3] = rsp_code;
1607− }
1603+ srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
1604+ srp_rsp->resp_data_len = cpu_to_be32(resp_data_len);
1605+ srp_rsp->data[3] = rsp_code;
16081606
16091607 return resp_len;
16101608 }
@@ -2358,6 +2356,8 @@ static void srpt_release_channel_work(struct work_struct *w) · 747 unmodified lines
23582356 transport_deregister_session(se_sess);
23592357 ch->sess = NULL;
23602358
2359+ ib_destroy_cm_id(ch->cm_id);
2360+
23612361 srpt_destroy_ch_ib(ch);
23622362
23632363 srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring,
@@ -2368,8 +2368,6 @@ static void srpt_release_channel_work(struct work_struct *w) · 4 unmodified lines
23682368 list_del(&ch->list);
23692369 spin_unlock_irq(&sdev->spinlock);
23702370
2371− ib_destroy_cm_id(ch->cm_id);
2372−
23732371 if (ch->release_done)
23742372 complete(ch->release_done);
23752373
drivers/iommu/Kconfig+1−1
@@ -52,7 +52,7 @@ config AMD_IOMMU · 51 unmodified lines
5252 select PCI_PRI
5353 select PCI_PASID
5454 select IOMMU_API
55− depends on X86_64 && PCI && ACPI && X86_IO_APIC
55+ depends on X86_64 && PCI && ACPI
5656 ---help---
5757 With this option you can enable support for AMD IOMMU hardware in
5858 your system. An IOMMU is a hardware component which provides
drivers/iommu/arm-smmu.c+7−6
@@ -377,6 +377,7 @@ struct arm_smmu_cfg { · 376 unmodified lines
377377 u32 cbar;
378378 pgd_t *pgd;
379379 };
380+#define INVALID_IRPTNDX 0xff
380381
381382 #define ARM_SMMU_CB_ASID(cfg) ((cfg)->cbndx)
382383 #define ARM_SMMU_CB_VMID(cfg) ((cfg)->cbndx + 1)
@@ -840,7 +841,7 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, · 457 unmodified lines
840841 if (IS_ERR_VALUE(ret)) {
841842 dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
842843 root_cfg->irptndx, irq);
843− root_cfg->irptndx = -1;
844+ root_cfg->irptndx = INVALID_IRPTNDX;
844845 goto out_free_context;
845846 }
846847
@@ -869,7 +870,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain) · 22 unmodified lines
869870 writel_relaxed(0, cb_base + ARM_SMMU_CB_SCTLR);
870871 arm_smmu_tlb_inv_context(root_cfg);
871872
872− if (root_cfg->irptndx != -1) {
873+ if (root_cfg->irptndx != INVALID_IRPTNDX) {
873874 irq = smmu->irqs[smmu->num_global_irqs + root_cfg->irptndx];
874875 free_irq(irq, domain);
875876 }
@@ -1857,8 +1858,6 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) · 981 unmodified lines
18571858 goto out_put_parent;
18581859 }
18591860
1860− arm_smmu_device_reset(smmu);
1861−
18621861 for (i = 0; i < smmu->num_global_irqs; ++i) {
18631862 err = request_irq(smmu->irqs[i],
18641863 arm_smmu_global_fault,
@@ -1876,6 +1875,8 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) · 11 unmodified lines
18761875 spin_lock(&arm_smmu_devices_lock);
18771876 list_add(&smmu->list, &arm_smmu_devices);
18781877 spin_unlock(&arm_smmu_devices_lock);
1878+
1879+ arm_smmu_device_reset(smmu);
18791880 return 0;
18801881
18811882 out_free_irqs:
@@ -1966,10 +1967,10 @@ static int __init arm_smmu_init(void) · 84 unmodified lines
19661967 return ret;
19671968
19681969 /* Oh, for a proper bus abstraction */
1969− if (!iommu_present(&platform_bus_type));
1970+ if (!iommu_present(&platform_bus_type))
19701971 bus_set_iommu(&platform_bus_type, &arm_smmu_ops);
19711972
1972− if (!iommu_present(&amba_bustype));
1973+ if (!iommu_present(&amba_bustype))
19731974 bus_set_iommu(&amba_bustype, &arm_smmu_ops);
19741975
19751976 return 0;
drivers/md/bcache/request.c+2−3
@@ -996,10 +996,11 @@ static void request_write(struct cached_dev *dc, struct search *s) · 995 unmodified lines
996996 closure_bio_submit(bio, cl, s->d);
997997 } else {
998998 bch_writeback_add(dc);
999+ s->op.cache_bio = bio;
9991000
10001001 if (bio->bi_rw & REQ_FLUSH) {
10011002 /* Also need to send a flush to the backing device */
1002− struct bio *flush = bio_alloc_bioset(0, GFP_NOIO,
1003+ struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0,
10031004 dc->disk.bio_split);
10041005
10051006 flush->bi_rw = WRITE_FLUSH;
@@ -1008,8 +1009,6 @@ static void request_write(struct cached_dev *dc, struct search *s) · 2 unmodified lines
10081009 flush->bi_private = cl;
10091010
10101011 closure_bio_submit(flush, cl, s->d);
1011− } else {
1012− s->op.cache_bio = bio;
10131012 }
10141013 }
10151014 out:
drivers/md/dm-snap-persistent.c+12−6
@@ -269,6 +269,14 @@ static chunk_t area_location(struct pstore *ps, chunk_t area) · 268 unmodified lines
269269 return NUM_SNAPSHOT_HDR_CHUNKS + ((ps->exceptions_per_area + 1) * area);
270270 }
271271
272+static void skip_metadata(struct pstore *ps)
273+{
274+ uint32_t stride = ps->exceptions_per_area + 1;
275+ chunk_t next_free = ps->next_free;
276+ if (sector_div(next_free, stride) == NUM_SNAPSHOT_HDR_CHUNKS)
277+ ps->next_free++;
278+}
279+
272280 /*
273281 * Read or write a metadata area. Remembering to skip the first
274282 * chunk which holds the header.
@@ -502,6 +510,8 @@ static int read_exceptions(struct pstore *ps, · 227 unmodified lines
502510
503511 ps->current_area--;
504512
513+ skip_metadata(ps);
514+
505515 return 0;
506516 }
507517
@@ -616,8 +626,6 @@ static int persistent_prepare_exception(struct dm_exception_store *store, · 108 unmodified lines
616626 struct dm_exception *e)
617627 {
618628 struct pstore *ps = get_info(store);
619− uint32_t stride;
620− chunk_t next_free;
621629 sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev);
622630
623631 /* Is there enough room ? */
@@ -630,10 +638,8 @@ static int persistent_prepare_exception(struct dm_exception_store *store, · 6 unmodified lines
630638 * Move onto the next free pending, making sure to take
631639 * into account the location of the metadata chunks.
632640 */
633− stride = (ps->exceptions_per_area + 1);
634− next_free = ++ps->next_free;
635− if (sector_div(next_free, stride) == 1)
636− ps->next_free++;
641+ ps->next_free++;
642+ skip_metadata(ps);
637643
638644 atomic_inc(&ps->pending_count);
639645 return 0;
drivers/media/dvb-frontends/tda10071.c+1−8
@@ -912,14 +912,8 @@ static int tda10071_init(struct dvb_frontend *fe) · 911 unmodified lines
912912 { 0xd5, 0x03, 0x03 },
913913 };
914914
915− /* firmware status */
916− ret = tda10071_rd_reg(priv, 0x51, &tmp);
917− if (ret)
918− goto error;
919−
920− if (!tmp) {
915+ if (priv->warm) {
921916 /* warm state - wake up device from sleep */
922− priv->warm = 1;
923917
924918 for (i = 0; i < ARRAY_SIZE(tab); i++) {
925919 ret = tda10071_wr_reg_mask(priv, tab[i].reg,
@@ -937,7 +931,6 @@ static int tda10071_init(struct dvb_frontend *fe) · 11 unmodified lines
937931 goto error;
938932 } else {
939933 /* cold state - try to download firmware */
940− priv->warm = 0;
941934
942935 /* request the firmware, this will block and timeout */
943936 ret = request_firmware(&fw, fw_file, priv->i2c->dev.parent);
drivers/media/i2c/ad9389b.c+6−9
@@ -628,16 +628,13 @@ static int ad9389b_s_stream(struct v4l2_subdev *sd, int enable) · 627 unmodified lines
628628
629629 static const struct v4l2_dv_timings_cap ad9389b_timings_cap = {
630630 .type = V4L2_DV_BT_656_1120,
631− .bt = {
632− .max_width = 1920,
633− .max_height = 1200,
634− .min_pixelclock = 25000000,
635− .max_pixelclock = 170000000,
636− .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
631+ /* keep this initialization for compatibility with GCC < 4.4.6 */
632+ .reserved = { 0 },
633+ V4L2_INIT_BT_TIMINGS(0, 1920, 0, 1200, 25000000, 170000000,
634+ V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
637635 V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT,
638− .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE |
639− V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM,
640− },
636+ V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_REDUCED_BLANKING |
637+ V4L2_DV_BT_CAP_CUSTOM)
641638 };
642639
643640 static int ad9389b_s_dv_timings(struct v4l2_subdev *sd,
drivers/media/i2c/adv7511.c+9−9
@@ -119,16 +119,14 @@ static int adv7511_s_clock_freq(struct v4l2_subdev *sd, u32 freq); · 118 unmodified lines
119119
120120 static const struct v4l2_dv_timings_cap adv7511_timings_cap = {
121121 .type = V4L2_DV_BT_656_1120,
122− .bt = {
123− .max_width = ADV7511_MAX_WIDTH,
124− .max_height = ADV7511_MAX_HEIGHT,
125− .min_pixelclock = ADV7511_MIN_PIXELCLOCK,
126− .max_pixelclock = ADV7511_MAX_PIXELCLOCK,
127− .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
122+ /* keep this initialization for compatibility with GCC < 4.4.6 */
123+ .reserved = { 0 },
124+ V4L2_INIT_BT_TIMINGS(0, ADV7511_MAX_WIDTH, 0, ADV7511_MAX_HEIGHT,
125+ ADV7511_MIN_PIXELCLOCK, ADV7511_MAX_PIXELCLOCK,
126+ V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
128127 V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT,
129− .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE |
130− V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM,
131− },
128+ V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_REDUCED_BLANKING |
129+ V4L2_DV_BT_CAP_CUSTOM)
132130 };
133131
134132 static inline struct adv7511_state *get_adv7511_state(struct v4l2_subdev *sd)
@@ -1126,6 +1124,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id * · 991 unmodified lines
11261124 state->i2c_edid = i2c_new_dummy(client->adapter, state->i2c_edid_addr >> 1);
11271125 if (state->i2c_edid == NULL) {
11281126 v4l2_err(sd, "failed to register edid i2c client\n");
1127+ err = -ENOMEM;
11291128 goto err_entity;
11301129 }
11311130
@@ -1133,6 +1132,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id * · 1 unmodified line
11331132 state->work_queue = create_singlethread_workqueue(sd->name);
11341133 if (state->work_queue == NULL) {
11351134 v4l2_err(sd, "could not create workqueue\n");
1135+ err = -ENOMEM;
11361136 goto err_unreg_cec;
11371137 }
11381138
drivers/media/i2c/adv7842.c+12−18
@@ -546,30 +546,24 @@ static inline bool is_digital_input(struct v4l2_subdev *sd) · 545 unmodified lines
546546
547547 static const struct v4l2_dv_timings_cap adv7842_timings_cap_analog = {
548548 .type = V4L2_DV_BT_656_1120,
549− .bt = {
550− .max_width = 1920,
551− .max_height = 1200,
552− .min_pixelclock = 25000000,
553− .max_pixelclock = 170000000,
554− .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
549+ /* keep this initialization for compatibility with GCC < 4.4.6 */
550+ .reserved = { 0 },
551+ V4L2_INIT_BT_TIMINGS(0, 1920, 0, 1200, 25000000, 170000000,
552+ V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
555553 V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT,
556− .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE |
557− V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM,
558− },
554+ V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_REDUCED_BLANKING |
555+ V4L2_DV_BT_CAP_CUSTOM)
559556 };
560557
561558 static const struct v4l2_dv_timings_cap adv7842_timings_cap_digital = {
562559 .type = V4L2_DV_BT_656_1120,
563− .bt = {
564− .max_width = 1920,
565− .max_height = 1200,
566− .min_pixelclock = 25000000,
567− .max_pixelclock = 225000000,
568− .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
560+ /* keep this initialization for compatibility with GCC < 4.4.6 */
561+ .reserved = { 0 },
562+ V4L2_INIT_BT_TIMINGS(0, 1920, 0, 1200, 25000000, 225000000,
563+ V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT |
569564 V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT,
570− .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE |
571− V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM,
572− },
565+ V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_REDUCED_BLANKING |
566+ V4L2_DV_BT_CAP_CUSTOM)
573567 };
574568
575569 static inline const struct v4l2_dv_timings_cap *
drivers/media/i2c/ths8200.c+4−8
@@ -46,14 +46,10 @@ struct ths8200_state { · 45 unmodified lines
4646
4747 static const struct v4l2_dv_timings_cap ths8200_timings_cap = {
4848 .type = V4L2_DV_BT_656_1120,
49− .bt = {
50− .max_width = 1920,
51− .max_height = 1080,
52− .min_pixelclock = 25000000,
53− .max_pixelclock = 148500000,
54− .standards = V4L2_DV_BT_STD_CEA861,
55− .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE,
56− },
49+ /* keep this initialization for compatibility with GCC < 4.4.6 */
50+ .reserved = { 0 },
51+ V4L2_INIT_BT_TIMINGS(0, 1920, 0, 1080, 25000000, 148500000,
52+ V4L2_DV_BT_STD_CEA861, V4L2_DV_BT_CAP_PROGRESSIVE)
5753 };
5854
5955 static inline struct ths8200_state *to_state(struct v4l2_subdev *sd)
drivers/media/pci/saa7134/saa7134-video.c+1−0
@@ -1455,6 +1455,7 @@ static int video_release(struct file *file) · 1454 unmodified lines
14551455
14561456 /* stop video capture */
14571457 if (res_check(fh, RESOURCE_VIDEO)) {
1458+ pm_qos_remove_request(&dev->qos_request);
14581459 videobuf_streamoff(&fh->cap);
14591460 res_free(dev,fh,RESOURCE_VIDEO);
14601461 }
drivers/media/platform/s5p-jpeg/jpeg-core.c+1−0
@@ -1423,6 +1423,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev) · 1422 unmodified lines
14231423 jpeg->vfd_decoder->release = video_device_release;
14241424 jpeg->vfd_decoder->lock = &jpeg->lock;
14251425 jpeg->vfd_decoder->v4l2_dev = &jpeg->v4l2_dev;
1426+ jpeg->vfd_decoder->vfl_dir = VFL_DIR_M2M;
14261427
14271428 ret = video_register_device(jpeg->vfd_decoder, VFL_TYPE_GRABBER, -1);
14281429 if (ret) {
drivers/media/platform/sh_vou.c+1−1
@@ -776,7 +776,7 @@ static int sh_vou_try_fmt_vid_out(struct file *file, void *priv, · 775 unmodified lines
776776 v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1,
777777 &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0);
778778
779− for (i = 0; ARRAY_SIZE(vou_fmt); i++)
779+ for (i = 0; i < ARRAY_SIZE(vou_fmt); i++)
780780 if (vou_fmt[i].pfmt == pix->pixelformat)
781781 return 0;
782782
drivers/media/platform/soc_camera/mx3_camera.c+2−3
@@ -266,7 +266,6 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) · 265 unmodified lines
266266 struct idmac_channel *ichan = mx3_cam->idmac_channel[0];
267267 struct idmac_video_param *video = &ichan->params.video;
268268 const struct soc_mbus_pixelfmt *host_fmt = icd->current_fmt->host_fmt;
269− unsigned long flags;
270269 dma_cookie_t cookie;
271270 size_t new_size;
272271
@@ -328,7 +327,7 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) · 55 unmodified lines
328327 memset(vb2_plane_vaddr(vb, 0), 0xaa, vb2_get_plane_payload(vb, 0));
329328 #endif
330329
331− spin_lock_irqsave(&mx3_cam->lock, flags);
330+ spin_lock_irq(&mx3_cam->lock);
332331 list_add_tail(&buf->queue, &mx3_cam->capture);
333332
334333 if (!mx3_cam->active)
@@ -351,7 +350,7 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) · 16 unmodified lines
351350 if (mx3_cam->active == buf)
352351 mx3_cam->active = NULL;
353352
354− spin_unlock_irqrestore(&mx3_cam->lock, flags);
353+ spin_unlock_irq(&mx3_cam->lock);
355354 error:
356355 vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
357356 }
drivers/media/tuners/e4000.c+2−1
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 */
2020
2121 #include "e4000_priv.h"
22+#include <linux/math64.h>
2223
2324 /* write multiple registers */
2425 static int e4000_wr_regs(struct e4000_priv *priv, u8 reg, u8 *val, int len)
@@ -233,7 +234,7 @@ static int e4000_set_params(struct dvb_frontend *fe) · 208 unmodified lines
233234 * or more.
234235 */
235236 f_vco = c->frequency * e4000_pll_lut[i].mul;
236− sigma_delta = 0x10000UL * (f_vco % priv->cfg->clock) / priv->cfg->clock;
237+ sigma_delta = div_u64(0x10000ULL * (f_vco % priv->cfg->clock), priv->cfg->clock);
237238 buf[0] = f_vco / priv->cfg->clock;
238239 buf[1] = (sigma_delta >> 0) & 0xff;
239240 buf[2] = (sigma_delta >> 8) & 0xff;
drivers/media/usb/stkwebcam/stk-webcam.c+7−0
@@ -111,6 +111,13 @@ static const struct dmi_system_id stk_upside_down_dmi_table[] = { · 110 unmodified lines
111111 DMI_MATCH(DMI_PRODUCT_NAME, "F3JC")
112112 }
113113 },
114+ {
115+ .ident = "T12Rg-H",
116+ .matches = {
117+ DMI_MATCH(DMI_SYS_VENDOR, "HCL Infosystems Limited"),
118+ DMI_MATCH(DMI_PRODUCT_NAME, "T12Rg-H")
119+ }
120+ },
114121 {}
115122 };
116123
drivers/media/usb/uvc/uvc_driver.c+18−0
@@ -2090,6 +2090,15 @@ static struct usb_device_id uvc_ids[] = { · 2089 unmodified lines
20902090 .bInterfaceSubClass = 1,
20912091 .bInterfaceProtocol = 0,
20922092 .driver_info = UVC_QUIRK_PROBE_MINMAX },
2093+ /* Microsoft Lifecam NX-3000 */
2094+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
2095+ | USB_DEVICE_ID_MATCH_INT_INFO,
2096+ .idVendor = 0x045e,
2097+ .idProduct = 0x0721,
2098+ .bInterfaceClass = USB_CLASS_VIDEO,
2099+ .bInterfaceSubClass = 1,
2100+ .bInterfaceProtocol = 0,
2101+ .driver_info = UVC_QUIRK_PROBE_DEF },
20932102 /* Microsoft Lifecam VX-7000 */
20942103 { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
20952104 | USB_DEVICE_ID_MATCH_INT_INFO,
@@ -2174,6 +2183,15 @@ static struct usb_device_id uvc_ids[] = { · 78 unmodified lines
21742183 .bInterfaceSubClass = 1,
21752184 .bInterfaceProtocol = 0,
21762185 .driver_info = UVC_QUIRK_PROBE_DEF },
2186+ /* Dell SP2008WFP Monitor */
2187+ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
2188+ | USB_DEVICE_ID_MATCH_INT_INFO,
2189+ .idVendor = 0x05a9,
2190+ .idProduct = 0x2641,
2191+ .bInterfaceClass = USB_CLASS_VIDEO,
2192+ .bInterfaceSubClass = 1,
2193+ .bInterfaceProtocol = 0,
2194+ .driver_info = UVC_QUIRK_PROBE_DEF },
21772195 /* Dell Alienware X51 */
21782196 { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
21792197 | USB_DEVICE_ID_MATCH_INT_INFO,
drivers/media/v4l2-core/videobuf2-core.c+3−1
@@ -353,7 +353,9 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b) · 352 unmodified lines
353353
354354 if (b->m.planes[plane].bytesused > length)
355355 return -EINVAL;
356− if (b->m.planes[plane].data_offset >=
356+
357+ if (b->m.planes[plane].data_offset > 0 &&
358+ b->m.planes[plane].data_offset >=
357359 b->m.planes[plane].bytesused)
358360 return -EINVAL;
359361 }
drivers/media/v4l2-core/videobuf2-dma-contig.c+82−5
@@ -423,6 +423,39 @@ static inline int vma_is_io(struct vm_area_struct *vma) · 422 unmodified lines
423423 return !!(vma->vm_flags & (VM_IO | VM_PFNMAP));
424424 }
425425
426+static int vb2_dc_get_user_pfn(unsigned long start, int n_pages,
427+ struct vm_area_struct *vma, unsigned long *res)
428+{
429+ unsigned long pfn, start_pfn, prev_pfn;
430+ unsigned int i;
431+ int ret;
432+
433+ if (!vma_is_io(vma))
434+ return -EFAULT;
435+
436+ ret = follow_pfn(vma, start, &pfn);
437+ if (ret)
438+ return ret;
439+
440+ start_pfn = pfn;
441+ start += PAGE_SIZE;
442+
443+ for (i = 1; i < n_pages; ++i, start += PAGE_SIZE) {
444+ prev_pfn = pfn;
445+ ret = follow_pfn(vma, start, &pfn);
446+
447+ if (ret) {
448+ pr_err("no page for address %lu\n", start);
449+ return ret;
450+ }
451+ if (pfn != prev_pfn + 1)
452+ return -EINVAL;
453+ }
454+
455+ *res = start_pfn;
456+ return 0;
457+}
458+
426459 static int vb2_dc_get_user_pages(unsigned long start, struct page **pages,
427460 int n_pages, struct vm_area_struct *vma, int write)
428461 {
@@ -433,6 +466,9 @@ static int vb2_dc_get_user_pages(unsigned long start, struct page **pages, · 4 unmodified lines
433466 unsigned long pfn;
434467 int ret = follow_pfn(vma, start, &pfn);
435468
469+ if (!pfn_valid(pfn))
470+ return -EINVAL;
471+
436472 if (ret) {
437473 pr_err("no page for address %lu\n", start);
438474 return ret;
@@ -468,16 +504,49 @@ static void vb2_dc_put_userptr(void *buf_priv) · 29 unmodified lines
468504 struct vb2_dc_buf *buf = buf_priv;
469505 struct sg_table *sgt = buf->dma_sgt;
470506
471− dma_unmap_sg(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir);
472− if (!vma_is_io(buf->vma))
473− vb2_dc_sgt_foreach_page(sgt, vb2_dc_put_dirty_page);
507+ if (sgt) {
508+ dma_unmap_sg(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir);
509+ if (!vma_is_io(buf->vma))
510+ vb2_dc_sgt_foreach_page(sgt, vb2_dc_put_dirty_page);
474511
475− sg_free_table(sgt);
476− kfree(sgt);
512+ sg_free_table(sgt);
513+ kfree(sgt);
514+ }
477515 vb2_put_vma(buf->vma);
478516 kfree(buf);
479517 }
480518
519+/*
520+ * For some kind of reserved memory there might be no struct page available,
521+ * so all that can be done to support such 'pages' is to try to convert
522+ * pfn to dma address or at the last resort just assume that
523+ * dma address == physical address (like it has been assumed in earlier version
524+ * of videobuf2-dma-contig
525+ */
526+
527+#ifdef __arch_pfn_to_dma
528+static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn)
529+{
530+ return (dma_addr_t)__arch_pfn_to_dma(dev, pfn);
531+}
532+#elif defined(__pfn_to_bus)
533+static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn)
534+{
535+ return (dma_addr_t)__pfn_to_bus(pfn);
536+}
537+#elif defined(__pfn_to_phys)
538+static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn)
539+{
540+ return (dma_addr_t)__pfn_to_phys(pfn);
541+}
542+#else
543+static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn)
544+{
545+ /* really, we cannot do anything better at this point */
546+ return (dma_addr_t)(pfn) << PAGE_SHIFT;
547+}
548+#endif
549+
481550 static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr,
482551 unsigned long size, int write)
483552 {
@@ -548,6 +617,14 @@ static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr, · 64 unmodified lines
548617 /* extract page list from userspace mapping */
549618 ret = vb2_dc_get_user_pages(start, pages, n_pages, vma, write);
550619 if (ret) {
620+ unsigned long pfn;
621+ if (vb2_dc_get_user_pfn(start, n_pages, vma, &pfn) == 0) {
622+ buf->dma_addr = vb2_dc_pfn_to_dma(buf->dev, pfn);
623+ buf->size = size;
624+ kfree(pages);
625+ return buf;
626+ }
627+
551628 pr_err("failed to get user pages\n");
552629 goto fail_vma;
553630 }
drivers/mmc/host/sh_mobile_sdhi.c+8−8
@@ -113,14 +113,14 @@ static const struct sh_mobile_sdhi_ops sdhi_ops = { · 112 unmodified lines
113113 };
114114
115115 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
116− { .compatible = "renesas,shmobile-sdhi" },
117− { .compatible = "renesas,sh7372-sdhi" },
118− { .compatible = "renesas,sh73a0-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
119− { .compatible = "renesas,r8a73a4-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
120− { .compatible = "renesas,r8a7740-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
121− { .compatible = "renesas,r8a7778-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
122− { .compatible = "renesas,r8a7779-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
123− { .compatible = "renesas,r8a7790-sdhi", .data = &sh_mobile_sdhi_of_cfg[0], },
116+ { .compatible = "renesas,sdhi-shmobile" },
117+ { .compatible = "renesas,sdhi-sh7372" },
118+ { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
119+ { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
120+ { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
121+ { .compatible = "renesas,sdhi-r8a7778", .data = &sh_mobile_sdhi_of_cfg[0], },
122+ { .compatible = "renesas,sdhi-r8a7779", .data = &sh_mobile_sdhi_of_cfg[0], },
123+ { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], },
124124 {},
125125 };
126126 MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);
drivers/mtd/devices/m25p80.c+15−2
@@ -168,12 +168,25 @@ static inline int write_disable(struct m25p *flash) · 167 unmodified lines
168168 */
169169 static inline int set_4byte(struct m25p *flash, u32 jedec_id, int enable)
170170 {
171+ int status;
172+ bool need_wren = false;
173+
171174 switch (JEDEC_MFR(jedec_id)) {
172− case CFI_MFR_MACRONIX:
173175 case CFI_MFR_ST: /* Micron, actually */
176+ /* Some Micron need WREN command; all will accept it */
177+ need_wren = true;
178+ case CFI_MFR_MACRONIX:
174179 case 0xEF /* winbond */:
180+ if (need_wren)
181+ write_enable(flash);
182+
175183 flash->command[0] = enable ? OPCODE_EN4B : OPCODE_EX4B;
176− return spi_write(flash->spi, flash->command, 1);
184+ status = spi_write(flash->spi, flash->command, 1);
185+
186+ if (need_wren)
187+ write_disable(flash);
188+
189+ return status;
177190 default:
178191 /* Spansion style */
179192 flash->command[0] = OPCODE_BRWR;
drivers/mtd/nand/nand_base.c+3−5
@@ -2869,10 +2869,8 @@ static int nand_flash_detect_ext_param_page(struct mtd_info *mtd, · 2868 unmodified lines
28692869
28702870 len = le16_to_cpu(p->ext_param_page_length) * 16;
28712871 ep = kmalloc(len, GFP_KERNEL);
2872− if (!ep) {
2873− ret = -ENOMEM;
2874− goto ext_out;
2875− }
2872+ if (!ep)
2873+ return -ENOMEM;
28762874
28772875 /* Send our own NAND_CMD_PARAM. */
28782876 chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
@@ -2920,7 +2918,7 @@ static int nand_flash_detect_ext_param_page(struct mtd_info *mtd, · 41 unmodified lines
29202918 }
29212919
29222920 pr_info("ONFI extended param page detected.\n");
2923− return 0;
2921+ ret = 0;
29242922
29252923 ext_out:
29262924 kfree(ep);
drivers/net/can/at91_can.c+2−2
@@ -1405,10 +1405,10 @@ static int at91_can_remove(struct platform_device *pdev) · 1404 unmodified lines
14051405
14061406 static const struct platform_device_id at91_can_id_table[] = {
14071407 {
1408− .name = "at91_can",
1408+ .name = "at91sam9x5_can",
14091409 .driver_data = (kernel_ulong_t)&at91_at91sam9x5_data,
14101410 }, {
1411− .name = "at91sam9x5_can",
1411+ .name = "at91_can",
14121412 .driver_data = (kernel_ulong_t)&at91_at91sam9263_data,
14131413 }, {
14141414 /* sentinel */
drivers/net/can/flexcan.c+10−4
@@ -62,7 +62,7 @@ · 61 unmodified lines
6262 #define FLEXCAN_MCR_BCC BIT(16)
6363 #define FLEXCAN_MCR_LPRIO_EN BIT(13)
6464 #define FLEXCAN_MCR_AEN BIT(12)
65−#define FLEXCAN_MCR_MAXMB(x) ((x) & 0xf)
65+#define FLEXCAN_MCR_MAXMB(x) ((x) & 0x1f)
6666 #define FLEXCAN_MCR_IDAM_A (0 << 8)
6767 #define FLEXCAN_MCR_IDAM_B (1 << 8)
6868 #define FLEXCAN_MCR_IDAM_C (2 << 8)
@@ -735,9 +735,11 @@ static int flexcan_chip_start(struct net_device *dev) · 666 unmodified lines
735735 *
736736 */
737737 reg_mcr = flexcan_read(&regs->mcr);
738+ reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff);
738739 reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT |
739740 FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
740− FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS;
741+ FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS |
742+ FLEXCAN_MCR_MAXMB(FLEXCAN_TX_BUF_ID);
741743 netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr);
742744 flexcan_write(reg_mcr, &regs->mcr);
743745
@@ -771,6 +773,10 @@ static int flexcan_chip_start(struct net_device *dev) · 27 unmodified lines
771773 netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
772774 flexcan_write(reg_ctrl, &regs->ctrl);
773775
776+ /* Abort any pending TX, mark Mailbox as INACTIVE */
777+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x4),
778+ &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
779+
774780 /* acceptance mask/acceptance code (accept everything) */
775781 flexcan_write(0x0, &regs->rxgmask);
776782 flexcan_write(0x0, &regs->rx14mask);
@@ -979,9 +985,9 @@ static void unregister_flexcandev(struct net_device *dev) · 202 unmodified lines
979985 }
980986
981987 static const struct of_device_id flexcan_of_match[] = {
982− { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, },
983− { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, },
984988 { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },
989+ { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, },
990+ { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, },
985991 { /* sentinel */ },
986992 };
987993 MODULE_DEVICE_TABLE(of, flexcan_of_match);
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+10−5
@@ -1197,8 +1197,9 @@ union cdu_context { · 1196 unmodified lines
11971197 /* TM (timers) host DB constants */
11981198 #define TM_ILT_PAGE_SZ_HW 0
11991199 #define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW) /* 4K */
1200−/* #define TM_CONN_NUM (CNIC_STARTING_CID+CNIC_ISCSI_CXT_MAX) */
1201−#define TM_CONN_NUM 1024
1200+#define TM_CONN_NUM (BNX2X_FIRST_VF_CID + \
1201+ BNX2X_VF_CIDS + \
1202+ CNIC_ISCSI_CID_MAX)
12021203 #define TM_ILT_SZ (8 * TM_CONN_NUM)
12031204 #define TM_ILT_LINES DIV_ROUND_UP(TM_ILT_SZ, TM_ILT_PAGE_SZ)
12041205
@@ -1527,7 +1528,6 @@ struct bnx2x { · 322 unmodified lines
15271528 #define PCI_32BIT_FLAG (1 << 1)
15281529 #define ONE_PORT_FLAG (1 << 2)
15291530 #define NO_WOL_FLAG (1 << 3)
1530−#define USING_DAC_FLAG (1 << 4)
15311531 #define USING_MSIX_FLAG (1 << 5)
15321532 #define USING_MSI_FLAG (1 << 6)
15331533 #define DISABLE_MSI_FLAG (1 << 7)
@@ -1622,7 +1622,7 @@ struct bnx2x { · 88 unmodified lines
16221622 u16 rx_ticks_int;
16231623 u16 rx_ticks;
16241624 /* Maximal coalescing timeout in us */
1625−#define BNX2X_MAX_COALESCE_TOUT (0xf0*12)
1625+#define BNX2X_MAX_COALESCE_TOUT (0xff*BNX2X_BTR)
16261626
16271627 u32 lin_cnt;
16281628
@@ -2075,7 +2075,8 @@ u32 bnx2x_dmae_opcode(struct bnx2x *bp, u8 src_type, u8 dst_type, · 446 unmodified lines
20752075
20762076 void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae,
20772077 u8 src_type, u8 dst_type);
2078−int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae);
2078+int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae,
2079+ u32 *comp);
20792080
20802081 /* FLR related routines */
20812082 u32 bnx2x_flr_clnup_poll_count(struct bnx2x *bp);
@@ -2495,4 +2496,8 @@ enum { · 413 unmodified lines
24952496 #define NUM_MACS 8
24962497
24972498 void bnx2x_set_local_cmng(struct bnx2x *bp);
2499+
2500+#define MCPR_SCRATCH_BASE(bp) \
2501+ (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH)
2502+
24982503 #endif /* bnx2x.h */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+1−0
@@ -681,6 +681,7 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 680 unmodified lines
681681 }
682682 }
683683 #endif
684+ skb_record_rx_queue(skb, fp->rx_queue);
684685 napi_gro_receive(&fp->napi, skb);
685686 }
686687
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+2−38
@@ -894,17 +894,8 @@ static void bnx2x_get_regs(struct net_device *dev, · 893 unmodified lines
894894 * will re-enable parity attentions right after the dump.
895895 */
896896
897− /* Disable parity on path 0 */
898− bnx2x_pretend_func(bp, 0);
899897 bnx2x_disable_blocks_parity(bp);
900898
901− /* Disable parity on path 1 */
902− bnx2x_pretend_func(bp, 1);
903− bnx2x_disable_blocks_parity(bp);
904−
905− /* Return to current function */
906− bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
907−
908899 dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1;
909900 dump_hdr.preset = DUMP_ALL_PRESETS;
910901 dump_hdr.version = BNX2X_DUMP_VERSION;
@@ -931,18 +922,9 @@ static void bnx2x_get_regs(struct net_device *dev, · 20 unmodified lines
931922 /* Actually read the registers */
932923 __bnx2x_get_regs(bp, p);
933924
934− /* Re-enable parity attentions on path 0 */
935− bnx2x_pretend_func(bp, 0);
925+ /* Re-enable parity attentions */
936926 bnx2x_clear_blocks_parity(bp);
937927 bnx2x_enable_blocks_parity(bp);
938−
939− /* Re-enable parity attentions on path 1 */
940− bnx2x_pretend_func(bp, 1);
941− bnx2x_clear_blocks_parity(bp);
942− bnx2x_enable_blocks_parity(bp);
943−
944− /* Return to current function */
945− bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
946928 }
947929
948930 static int bnx2x_get_preset_regs_len(struct net_device *dev, u32 preset)
@@ -996,17 +978,8 @@ static int bnx2x_get_dump_data(struct net_device *dev, · 47 unmodified lines
996978 * will re-enable parity attentions right after the dump.
997979 */
998980
999− /* Disable parity on path 0 */
1000− bnx2x_pretend_func(bp, 0);
1001981 bnx2x_disable_blocks_parity(bp);
1002982
1003− /* Disable parity on path 1 */
1004− bnx2x_pretend_func(bp, 1);
1005− bnx2x_disable_blocks_parity(bp);
1006−
1007− /* Return to current function */
1008− bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
1009−
1010983 dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1;
1011984 dump_hdr.preset = bp->dump_preset_idx;
1012985 dump_hdr.version = BNX2X_DUMP_VERSION;
@@ -1035,19 +1008,10 @@ static int bnx2x_get_dump_data(struct net_device *dev, · 22 unmodified lines
10351008 /* Actually read the registers */
10361009 __bnx2x_get_preset_regs(bp, p, dump_hdr.preset);
10371010
1038− /* Re-enable parity attentions on path 0 */
1039− bnx2x_pretend_func(bp, 0);
1011+ /* Re-enable parity attentions */
10401012 bnx2x_clear_blocks_parity(bp);
10411013 bnx2x_enable_blocks_parity(bp);
10421014
1043− /* Re-enable parity attentions on path 1 */
1044− bnx2x_pretend_func(bp, 1);
1045− bnx2x_clear_blocks_parity(bp);
1046− bnx2x_enable_blocks_parity(bp);
1047−
1048− /* Return to current function */
1049− bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
1050−
10511015 return 0;
10521016 }
10531017
drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h+25−13
@@ -640,23 +640,35 @@ static const struct { · 639 unmodified lines
640640 * [30] MCP Latched ump_tx_parity
641641 * [31] MCP Latched scpad_parity
642642 */
643−#define MISC_AEU_ENABLE_MCP_PRTY_BITS \
643+#define MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS \
644644 (AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY | \
645645 AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY | \
646− AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY | \
646+ AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY)
647+
648+#define MISC_AEU_ENABLE_MCP_PRTY_BITS \
649+ (MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS | \
647650 AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY)
648651
649652 /* Below registers control the MCP parity attention output. When
650653 * MISC_AEU_ENABLE_MCP_PRTY_BITS are set - attentions are
651654 * enabled, when cleared - disabled.
652655 */
653−static const u32 mcp_attn_ctl_regs[] = {
654− MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0,
655− MISC_REG_AEU_ENABLE4_NIG_0,
656− MISC_REG_AEU_ENABLE4_PXP_0,
657− MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0,
658− MISC_REG_AEU_ENABLE4_NIG_1,
659− MISC_REG_AEU_ENABLE4_PXP_1
656+static const struct {
657+ u32 addr;
658+ u32 bits;
659+} mcp_attn_ctl_regs[] = {
660+ { MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0,
661+ MISC_AEU_ENABLE_MCP_PRTY_BITS },
662+ { MISC_REG_AEU_ENABLE4_NIG_0,
663+ MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS },
664+ { MISC_REG_AEU_ENABLE4_PXP_0,
665+ MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS },
666+ { MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0,
667+ MISC_AEU_ENABLE_MCP_PRTY_BITS },
668+ { MISC_REG_AEU_ENABLE4_NIG_1,
669+ MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS },
670+ { MISC_REG_AEU_ENABLE4_PXP_1,
671+ MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS }
660672 };
661673
662674 static inline void bnx2x_set_mcp_parity(struct bnx2x *bp, u8 enable)
@@ -665,14 +677,14 @@ static inline void bnx2x_set_mcp_parity(struct bnx2x *bp, u8 enable) · 2 unmodified lines
665677 u32 reg_val;
666678
667679 for (i = 0; i < ARRAY_SIZE(mcp_attn_ctl_regs); i++) {
668− reg_val = REG_RD(bp, mcp_attn_ctl_regs[i]);
680+ reg_val = REG_RD(bp, mcp_attn_ctl_regs[i].addr);
669681
670682 if (enable)
671− reg_val |= MISC_AEU_ENABLE_MCP_PRTY_BITS;
683+ reg_val |= mcp_attn_ctl_regs[i].bits;
672684 else
673− reg_val &= ~MISC_AEU_ENABLE_MCP_PRTY_BITS;
685+ reg_val &= ~mcp_attn_ctl_regs[i].bits;
674686
675− REG_WR(bp, mcp_attn_ctl_regs[i], reg_val);
687+ REG_WR(bp, mcp_attn_ctl_regs[i].addr, reg_val);
676688 }
677689 }
678690
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+212−176
@@ -503,9 +503,9 @@ void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, · 502 unmodified lines
503503 }
504504
505505 /* issue a dmae command over the init-channel and wait for completion */
506−int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae)
506+int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae,
507+ u32 *comp)
507508 {
508− u32 *wb_comp = bnx2x_sp(bp, wb_comp);
509509 int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 4000;
510510 int rc = 0;
511511
@@ -518,14 +518,14 @@ int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) · 6 unmodified lines
518518 spin_lock_bh(&bp->dmae_lock);
519519
520520 /* reset completion */
521− *wb_comp = 0;
521+ *comp = 0;
522522
523523 /* post the command on the channel used for initializations */
524524 bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp));
525525
526526 /* wait for completion */
527527 udelay(5);
528− while ((*wb_comp & ~DMAE_PCI_ERR_FLAG) != DMAE_COMP_VAL) {
528+ while ((*comp & ~DMAE_PCI_ERR_FLAG) != DMAE_COMP_VAL) {
529529
530530 if (!cnt ||
531531 (bp->recovery_state != BNX2X_RECOVERY_DONE &&
@@ -537,7 +537,7 @@ int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) · 5 unmodified lines
537537 cnt--;
538538 udelay(50);
539539 }
540− if (*wb_comp & DMAE_PCI_ERR_FLAG) {
540+ if (*comp & DMAE_PCI_ERR_FLAG) {
541541 BNX2X_ERR("DMAE PCI error!\n");
542542 rc = DMAE_PCI_ERROR;
543543 }
@@ -574,7 +574,7 @@ void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr, · 30 unmodified lines
574574 dmae.len = len32;
575575
576576 /* issue the command and wait for completion */
577− rc = bnx2x_issue_dmae_with_comp(bp, &dmae);
577+ rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp));
578578 if (rc) {
579579 BNX2X_ERR("DMAE returned failure %d\n", rc);
580580 bnx2x_panic();
@@ -611,7 +611,7 @@ void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32) · 30 unmodified lines
611611 dmae.len = len32;
612612
613613 /* issue the command and wait for completion */
614− rc = bnx2x_issue_dmae_with_comp(bp, &dmae);
614+ rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp));
615615 if (rc) {
616616 BNX2X_ERR("DMAE returned failure %d\n", rc);
617617 bnx2x_panic();
@@ -751,6 +751,10 @@ static int bnx2x_mc_assert(struct bnx2x *bp) · 133 unmodified lines
751751 return rc;
752752 }
753753
754+#define MCPR_TRACE_BUFFER_SIZE (0x800)
755+#define SCRATCH_BUFFER_SIZE(bp) \
756+ (CHIP_IS_E1(bp) ? 0x10000 : (CHIP_IS_E1H(bp) ? 0x20000 : 0x28000))
757+
754758 void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl)
755759 {
756760 u32 addr, val;
@@ -775,7 +779,17 @@ void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) · 18 unmodified lines
775779 trace_shmem_base = bp->common.shmem_base;
776780 else
777781 trace_shmem_base = SHMEM2_RD(bp, other_shmem_base_addr);
778− addr = trace_shmem_base - 0x800;
782+
783+ /* sanity */
784+ if (trace_shmem_base < MCPR_SCRATCH_BASE(bp) + MCPR_TRACE_BUFFER_SIZE ||
785+ trace_shmem_base >= MCPR_SCRATCH_BASE(bp) +
786+ SCRATCH_BUFFER_SIZE(bp)) {
787+ BNX2X_ERR("Unable to dump trace buffer (mark %x)\n",
788+ trace_shmem_base);
789+ return;
790+ }
791+
792+ addr = trace_shmem_base - MCPR_TRACE_BUFFER_SIZE;
779793
780794 /* validate TRCB signature */
781795 mark = REG_RD(bp, addr);
@@ -787,14 +801,17 @@ void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) · 5 unmodified lines
787801 /* read cyclic buffer pointer */
788802 addr += 4;
789803 mark = REG_RD(bp, addr);
790− mark = (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH)
791− + ((mark + 0x3) & ~0x3) - 0x08000000;
804+ mark = MCPR_SCRATCH_BASE(bp) + ((mark + 0x3) & ~0x3) - 0x08000000;
805+ if (mark >= trace_shmem_base || mark < addr + 4) {
806+ BNX2X_ERR("Mark doesn't fall inside Trace Buffer\n");
807+ return;
808+ }
792809 printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark);
793810
794811 printk("%s", lvl);
795812
796813 /* dump buffer after the mark */
797− for (offset = mark; offset <= trace_shmem_base; offset += 0x8*4) {
814+ for (offset = mark; offset < trace_shmem_base; offset += 0x8*4) {
798815 for (word = 0; word < 8; word++)
799816 data[word] = htonl(REG_RD(bp, offset + 4*word));
800817 data[8] = 0x0;
@@ -4280,65 +4297,60 @@ static void _print_next_block(int idx, const char *blk) · 3479 unmodified lines
42804297 pr_cont("%s%s", idx ? ", " : "", blk);
42814298 }
42824299
4283−static int bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig,
4284− int par_num, bool print)
4300+static bool bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig,
4301+ int *par_num, bool print)
42854302 {
4286− int i = 0;
4287− u32 cur_bit = 0;
4303+ u32 cur_bit;
4304+ bool res;
4305+ int i;
4306+
4307+ res = false;
4308+
42884309 for (i = 0; sig; i++) {
4289− cur_bit = ((u32)0x1 << i);
4310+ cur_bit = (0x1UL << i);
42904311 if (sig & cur_bit) {
4291− switch (cur_bit) {
4292− case AEU_INPUTS_ATTN_BITS_BRB_PARITY_ERROR:
4293− if (print) {
4294− _print_next_block(par_num++, "BRB");
4312+ res |= true; /* Each bit is real error! */
4313+
4314+ if (print) {
4315+ switch (cur_bit) {
4316+ case AEU_INPUTS_ATTN_BITS_BRB_PARITY_ERROR:
4317+ _print_next_block((*par_num)++, "BRB");
42954318 _print_parity(bp,
42964319 BRB1_REG_BRB1_PRTY_STS);
4297− }
4298− break;
4299− case AEU_INPUTS_ATTN_BITS_PARSER_PARITY_ERROR:
4300− if (print) {
4301− _print_next_block(par_num++, "PARSER");
4320+ break;
4321+ case AEU_INPUTS_ATTN_BITS_PARSER_PARITY_ERROR:
4322+ _print_next_block((*par_num)++,
4323+ "PARSER");
43024324 _print_parity(bp, PRS_REG_PRS_PRTY_STS);
4303− }
4304− break;
4305− case AEU_INPUTS_ATTN_BITS_TSDM_PARITY_ERROR:
4306− if (print) {
4307− _print_next_block(par_num++, "TSDM");
4325+ break;
4326+ case AEU_INPUTS_ATTN_BITS_TSDM_PARITY_ERROR:
4327+ _print_next_block((*par_num)++, "TSDM");
43084328 _print_parity(bp,
43094329 TSDM_REG_TSDM_PRTY_STS);
4310− }
4311− break;
4312− case AEU_INPUTS_ATTN_BITS_SEARCHER_PARITY_ERROR:
4313− if (print) {
4314− _print_next_block(par_num++,
4330+ break;
4331+ case AEU_INPUTS_ATTN_BITS_SEARCHER_PARITY_ERROR:
4332+ _print_next_block((*par_num)++,
43154333 "SEARCHER");
43164334 _print_parity(bp, SRC_REG_SRC_PRTY_STS);
4317− }
4318− break;
4319− case AEU_INPUTS_ATTN_BITS_TCM_PARITY_ERROR:
4320− if (print) {
4321− _print_next_block(par_num++, "TCM");
4322− _print_parity(bp,
4323− TCM_REG_TCM_PRTY_STS);
4324− }
4325− break;
4326− case AEU_INPUTS_ATTN_BITS_TSEMI_PARITY_ERROR:
4327− if (print) {
4328− _print_next_block(par_num++, "TSEMI");
4335+ break;
4336+ case AEU_INPUTS_ATTN_BITS_TCM_PARITY_ERROR:
4337+ _print_next_block((*par_num)++, "TCM");
4338+ _print_parity(bp, TCM_REG_TCM_PRTY_STS);
4339+ break;
4340+ case AEU_INPUTS_ATTN_BITS_TSEMI_PARITY_ERROR:
4341+ _print_next_block((*par_num)++,
4342+ "TSEMI");
43294343 _print_parity(bp,
43304344 TSEM_REG_TSEM_PRTY_STS_0);
43314345 _print_parity(bp,
43324346 TSEM_REG_TSEM_PRTY_STS_1);
4333− }
4334− break;
4335− case AEU_INPUTS_ATTN_BITS_PBCLIENT_PARITY_ERROR:
4336− if (print) {
4337− _print_next_block(par_num++, "XPB");
4347+ break;
4348+ case AEU_INPUTS_ATTN_BITS_PBCLIENT_PARITY_ERROR:
4349+ _print_next_block((*par_num)++, "XPB");
43384350 _print_parity(bp, GRCBASE_XPB +
43394351 PB_REG_PB_PRTY_STS);
4352+ break;
43404353 }
4341− break;
43424354 }
43434355
43444356 /* Clear the bit */
@@ -4346,53 +4358,59 @@ static int bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig, · 1 unmodified line
43464358 }
43474359 }
43484360
4349− return par_num;
4361+ return res;
43504362 }
43514363
4352−static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig,
4353− int par_num, bool *global,
4364+static bool bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig,
4365+ int *par_num, bool *global,
43544366 bool print)
43554367 {
4356− int i = 0;
4357− u32 cur_bit = 0;
4368+ u32 cur_bit;
4369+ bool res;
4370+ int i;
4371+
4372+ res = false;
4373+
43584374 for (i = 0; sig; i++) {
4359− cur_bit = ((u32)0x1 << i);
4375+ cur_bit = (0x1UL << i);
43604376 if (sig & cur_bit) {
4377+ res |= true; /* Each bit is real error! */
43614378 switch (cur_bit) {
43624379 case AEU_INPUTS_ATTN_BITS_PBF_PARITY_ERROR:
43634380 if (print) {
4364− _print_next_block(par_num++, "PBF");
4381+ _print_next_block((*par_num)++, "PBF");
43654382 _print_parity(bp, PBF_REG_PBF_PRTY_STS);
43664383 }
43674384 break;
43684385 case AEU_INPUTS_ATTN_BITS_QM_PARITY_ERROR:
43694386 if (print) {
4370− _print_next_block(par_num++, "QM");
4387+ _print_next_block((*par_num)++, "QM");
43714388 _print_parity(bp, QM_REG_QM_PRTY_STS);
43724389 }
43734390 break;
43744391 case AEU_INPUTS_ATTN_BITS_TIMERS_PARITY_ERROR:
43754392 if (print) {
4376− _print_next_block(par_num++, "TM");
4393+ _print_next_block((*par_num)++, "TM");
43774394 _print_parity(bp, TM_REG_TM_PRTY_STS);
43784395 }
43794396 break;
43804397 case AEU_INPUTS_ATTN_BITS_XSDM_PARITY_ERROR:
43814398 if (print) {
4382− _print_next_block(par_num++, "XSDM");
4399+ _print_next_block((*par_num)++, "XSDM");
43834400 _print_parity(bp,
43844401 XSDM_REG_XSDM_PRTY_STS);
43854402 }
43864403 break;
43874404 case AEU_INPUTS_ATTN_BITS_XCM_PARITY_ERROR:
43884405 if (print) {
4389− _print_next_block(par_num++, "XCM");
4406+ _print_next_block((*par_num)++, "XCM");
43904407 _print_parity(bp, XCM_REG_XCM_PRTY_STS);
43914408 }
43924409 break;
43934410 case AEU_INPUTS_ATTN_BITS_XSEMI_PARITY_ERROR:
43944411 if (print) {
4395− _print_next_block(par_num++, "XSEMI");
4412+ _print_next_block((*par_num)++,
4413+ "XSEMI");
43964414 _print_parity(bp,
43974415 XSEM_REG_XSEM_PRTY_STS_0);
43984416 _print_parity(bp,
@@ -4401,7 +4419,7 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, · 2 unmodified lines
44014419 break;
44024420 case AEU_INPUTS_ATTN_BITS_DOORBELLQ_PARITY_ERROR:
44034421 if (print) {
4404− _print_next_block(par_num++,
4422+ _print_next_block((*par_num)++,
44054423 "DOORBELLQ");
44064424 _print_parity(bp,
44074425 DORQ_REG_DORQ_PRTY_STS);
@@ -4409,7 +4427,7 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, · 1 unmodified line
44094427 break;
44104428 case AEU_INPUTS_ATTN_BITS_NIG_PARITY_ERROR:
44114429 if (print) {
4412− _print_next_block(par_num++, "NIG");
4430+ _print_next_block((*par_num)++, "NIG");
44134431 if (CHIP_IS_E1x(bp)) {
44144432 _print_parity(bp,
44154433 NIG_REG_NIG_PRTY_STS);
@@ -4423,32 +4441,34 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, · 7 unmodified lines
44234441 break;
44244442 case AEU_INPUTS_ATTN_BITS_VAUX_PCI_CORE_PARITY_ERROR:
44254443 if (print)
4426− _print_next_block(par_num++,
4444+ _print_next_block((*par_num)++,
44274445 "VAUX PCI CORE");
44284446 *global = true;
44294447 break;
44304448 case AEU_INPUTS_ATTN_BITS_DEBUG_PARITY_ERROR:
44314449 if (print) {
4432− _print_next_block(par_num++, "DEBUG");
4450+ _print_next_block((*par_num)++,
4451+ "DEBUG");
44334452 _print_parity(bp, DBG_REG_DBG_PRTY_STS);
44344453 }
44354454 break;
44364455 case AEU_INPUTS_ATTN_BITS_USDM_PARITY_ERROR:
44374456 if (print) {
4438− _print_next_block(par_num++, "USDM");
4457+ _print_next_block((*par_num)++, "USDM");
44394458 _print_parity(bp,
44404459 USDM_REG_USDM_PRTY_STS);
44414460 }
44424461 break;
44434462 case AEU_INPUTS_ATTN_BITS_UCM_PARITY_ERROR:
44444463 if (print) {
4445− _print_next_block(par_num++, "UCM");
4464+ _print_next_block((*par_num)++, "UCM");
44464465 _print_parity(bp, UCM_REG_UCM_PRTY_STS);
44474466 }
44484467 break;
44494468 case AEU_INPUTS_ATTN_BITS_USEMI_PARITY_ERROR:
44504469 if (print) {
4451− _print_next_block(par_num++, "USEMI");
4470+ _print_next_block((*par_num)++,
4471+ "USEMI");
44524472 _print_parity(bp,
44534473 USEM_REG_USEM_PRTY_STS_0);
44544474 _print_parity(bp,
@@ -4457,21 +4477,21 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, · 2 unmodified lines
44574477 break;
44584478 case AEU_INPUTS_ATTN_BITS_UPB_PARITY_ERROR:
44594479 if (print) {
4460− _print_next_block(par_num++, "UPB");
4480+ _print_next_block((*par_num)++, "UPB");
44614481 _print_parity(bp, GRCBASE_UPB +
44624482 PB_REG_PB_PRTY_STS);
44634483 }
44644484 break;
44654485 case AEU_INPUTS_ATTN_BITS_CSDM_PARITY_ERROR:
44664486 if (print) {
4467− _print_next_block(par_num++, "CSDM");
4487+ _print_next_block((*par_num)++, "CSDM");
44684488 _print_parity(bp,
44694489 CSDM_REG_CSDM_PRTY_STS);
44704490 }
44714491 break;
44724492 case AEU_INPUTS_ATTN_BITS_CCM_PARITY_ERROR:
44734493 if (print) {
4474− _print_next_block(par_num++, "CCM");
4494+ _print_next_block((*par_num)++, "CCM");
44754495 _print_parity(bp, CCM_REG_CCM_PRTY_STS);
44764496 }
44774497 break;
@@ -4482,80 +4502,73 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, · 4 unmodified lines
44824502 }
44834503 }
44844504
4485− return par_num;
4505+ return res;
44864506 }
44874507
4488−static int bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig,
4489− int par_num, bool print)
4508+static bool bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig,
4509+ int *par_num, bool print)
44904510 {
4491− int i = 0;
4492− u32 cur_bit = 0;
4511+ u32 cur_bit;
4512+ bool res;
4513+ int i;
4514+
4515+ res = false;
4516+
44934517 for (i = 0; sig; i++) {
4494− cur_bit = ((u32)0x1 << i);
4518+ cur_bit = (0x1UL << i);
44954519 if (sig & cur_bit) {
4496− switch (cur_bit) {
4497− case AEU_INPUTS_ATTN_BITS_CSEMI_PARITY_ERROR:
4498− if (print) {
4499− _print_next_block(par_num++, "CSEMI");
4520+ res |= true; /* Each bit is real error! */
4521+ if (print) {
4522+ switch (cur_bit) {
4523+ case AEU_INPUTS_ATTN_BITS_CSEMI_PARITY_ERROR:
4524+ _print_next_block((*par_num)++,
4525+ "CSEMI");
45004526 _print_parity(bp,
45014527 CSEM_REG_CSEM_PRTY_STS_0);
45024528 _print_parity(bp,
45034529 CSEM_REG_CSEM_PRTY_STS_1);
4504− }
4505− break;
4506− case AEU_INPUTS_ATTN_BITS_PXP_PARITY_ERROR:
4507− if (print) {
4508− _print_next_block(par_num++, "PXP");
4530+ break;
4531+ case AEU_INPUTS_ATTN_BITS_PXP_PARITY_ERROR:
4532+ _print_next_block((*par_num)++, "PXP");
45094533 _print_parity(bp, PXP_REG_PXP_PRTY_STS);
45104534 _print_parity(bp,
45114535 PXP2_REG_PXP2_PRTY_STS_0);
45124536 _print_parity(bp,
45134537 PXP2_REG_PXP2_PRTY_STS_1);
4514− }
4515− break;
4516− case AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR:
4517− if (print)
4518− _print_next_block(par_num++,
4519− "PXPPCICLOCKCLIENT");
4520− break;
4521− case AEU_INPUTS_ATTN_BITS_CFC_PARITY_ERROR:
4522− if (print) {
4523− _print_next_block(par_num++, "CFC");
4538+ break;
4539+ case AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR:
4540+ _print_next_block((*par_num)++,
4541+ "PXPPCICLOCKCLIENT");
4542+ break;
4543+ case AEU_INPUTS_ATTN_BITS_CFC_PARITY_ERROR:
4544+ _print_next_block((*par_num)++, "CFC");
45244545 _print_parity(bp,
45254546 CFC_REG_CFC_PRTY_STS);
4526− }
4527− break;
4528− case AEU_INPUTS_ATTN_BITS_CDU_PARITY_ERROR:
4529− if (print) {
4530− _print_next_block(par_num++, "CDU");
4547+ break;
4548+ case AEU_INPUTS_ATTN_BITS_CDU_PARITY_ERROR:
4549+ _print_next_block((*par_num)++, "CDU");
45314550 _print_parity(bp, CDU_REG_CDU_PRTY_STS);
4532− }
4533− break;
4534− case AEU_INPUTS_ATTN_BITS_DMAE_PARITY_ERROR:
4535− if (print) {
4536− _print_next_block(par_num++, "DMAE");
4551+ break;
4552+ case AEU_INPUTS_ATTN_BITS_DMAE_PARITY_ERROR:
4553+ _print_next_block((*par_num)++, "DMAE");
45374554 _print_parity(bp,
45384555 DMAE_REG_DMAE_PRTY_STS);
4539− }
4540− break;
4541− case AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR:
4542− if (print) {
4543− _print_next_block(par_num++, "IGU");
4556+ break;
4557+ case AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR:
4558+ _print_next_block((*par_num)++, "IGU");
45444559 if (CHIP_IS_E1x(bp))
45454560 _print_parity(bp,
45464561 HC_REG_HC_PRTY_STS);
45474562 else
45484563 _print_parity(bp,
45494564 IGU_REG_IGU_PRTY_STS);
4550− }
4551− break;
4552− case AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR:
4553− if (print) {
4554− _print_next_block(par_num++, "MISC");
4565+ break;
4566+ case AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR:
4567+ _print_next_block((*par_num)++, "MISC");
45554568 _print_parity(bp,
45564569 MISC_REG_MISC_PRTY_STS);
4570+ break;
45574571 }
4558− break;
45594572 }
45604573
45614574 /* Clear the bit */
@@ -4563,40 +4576,49 @@ static int bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig, · 1 unmodified line
45634576 }
45644577 }
45654578
4566− return par_num;
4579+ return res;
45674580 }
45684581
4569−static int bnx2x_check_blocks_with_parity3(u32 sig, int par_num,
4570− bool *global, bool print)
4582+static bool bnx2x_check_blocks_with_parity3(struct bnx2x *bp, u32 sig,
4583+ int *par_num, bool *global,
4584+ bool print)
45714585 {
4572− int i = 0;
4573− u32 cur_bit = 0;
4586+ bool res = false;
4587+ u32 cur_bit;
4588+ int i;
4589+
45744590 for (i = 0; sig; i++) {
4575− cur_bit = ((u32)0x1 << i);
4591+ cur_bit = (0x1UL << i);
45764592 if (sig & cur_bit) {
45774593 switch (cur_bit) {
45784594 case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY:
45794595 if (print)
4580− _print_next_block(par_num++, "MCP ROM");
4596+ _print_next_block((*par_num)++,
4597+ "MCP ROM");
45814598 *global = true;
4599+ res |= true;
45824600 break;
45834601 case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY:
45844602 if (print)
4585− _print_next_block(par_num++,
4603+ _print_next_block((*par_num)++,
45864604 "MCP UMP RX");
45874605 *global = true;
4606+ res |= true;
45884607 break;
45894608 case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY:
45904609 if (print)
4591− _print_next_block(par_num++,
4610+ _print_next_block((*par_num)++,
45924611 "MCP UMP TX");
45934612 *global = true;
4613+ res |= true;
45944614 break;
45954615 case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY:
45964616 if (print)
4597− _print_next_block(par_num++,
4617+ _print_next_block((*par_num)++,
45984618 "MCP SCPAD");
4599− *global = true;
4619+ /* clear latched SCPAD PATIRY from MCP */
4620+ REG_WR(bp, MISC_REG_AEU_CLR_LATCH_SIGNAL,
4621+ 1UL << 10);
46004622 break;
46014623 }
46024624
@@ -4605,45 +4627,50 @@ static int bnx2x_check_blocks_with_parity3(u32 sig, int par_num, · 2 unmodified lines
46054627 }
46064628 }
46074629
4608− return par_num;
4630+ return res;
46094631 }
46104632
4611−static int bnx2x_check_blocks_with_parity4(struct bnx2x *bp, u32 sig,
4612− int par_num, bool print)
4633+static bool bnx2x_check_blocks_with_parity4(struct bnx2x *bp, u32 sig,
4634+ int *par_num, bool print)
46134635 {
4614− int i = 0;
4615− u32 cur_bit = 0;
4636+ u32 cur_bit;
4637+ bool res;
4638+ int i;
4639+
4640+ res = false;
4641+
46164642 for (i = 0; sig; i++) {
4617− cur_bit = ((u32)0x1 << i);
4643+ cur_bit = (0x1UL << i);
46184644 if (sig & cur_bit) {
4619− switch (cur_bit) {
4620− case AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR:
4621− if (print) {
4622− _print_next_block(par_num++, "PGLUE_B");
4645+ res |= true; /* Each bit is real error! */
4646+ if (print) {
4647+ switch (cur_bit) {
4648+ case AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR:
4649+ _print_next_block((*par_num)++,
4650+ "PGLUE_B");
46234651 _print_parity(bp,
4624− PGLUE_B_REG_PGLUE_B_PRTY_STS);
4625− }
4626− break;
4627− case AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR:
4628− if (print) {
4629− _print_next_block(par_num++, "ATC");
4652+ PGLUE_B_REG_PGLUE_B_PRTY_STS);
4653+ break;
4654+ case AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR:
4655+ _print_next_block((*par_num)++, "ATC");
46304656 _print_parity(bp,
46314657 ATC_REG_ATC_PRTY_STS);
4658+ break;
46324659 }
4633− break;
46344660 }
4635−
46364661 /* Clear the bit */
46374662 sig &= ~cur_bit;
46384663 }
46394664 }
46404665
4641− return par_num;
4666+ return res;
46424667 }
46434668
46444669 static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print,
46454670 u32 *sig)
46464671 {
4672+ bool res = false;
4673+
46474674 if ((sig[0] & HW_PRTY_ASSERT_SET_0) ||
46484675 (sig[1] & HW_PRTY_ASSERT_SET_1) ||
46494676 (sig[2] & HW_PRTY_ASSERT_SET_2) ||
@@ -4660,23 +4687,22 @@ static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, · 10 unmodified lines
46604687 if (print)
46614688 netdev_err(bp->dev,
46624689 "Parity errors detected in blocks: ");
4663− par_num = bnx2x_check_blocks_with_parity0(bp,
4664− sig[0] & HW_PRTY_ASSERT_SET_0, par_num, print);
4665− par_num = bnx2x_check_blocks_with_parity1(bp,
4666− sig[1] & HW_PRTY_ASSERT_SET_1, par_num, global, print);
4667− par_num = bnx2x_check_blocks_with_parity2(bp,
4668− sig[2] & HW_PRTY_ASSERT_SET_2, par_num, print);
4669− par_num = bnx2x_check_blocks_with_parity3(
4670− sig[3] & HW_PRTY_ASSERT_SET_3, par_num, global, print);
4671− par_num = bnx2x_check_blocks_with_parity4(bp,
4672− sig[4] & HW_PRTY_ASSERT_SET_4, par_num, print);
4690+ res |= bnx2x_check_blocks_with_parity0(bp,
4691+ sig[0] & HW_PRTY_ASSERT_SET_0, &par_num, print);
4692+ res |= bnx2x_check_blocks_with_parity1(bp,
4693+ sig[1] & HW_PRTY_ASSERT_SET_1, &par_num, global, print);
4694+ res |= bnx2x_check_blocks_with_parity2(bp,
4695+ sig[2] & HW_PRTY_ASSERT_SET_2, &par_num, print);
4696+ res |= bnx2x_check_blocks_with_parity3(bp,
4697+ sig[3] & HW_PRTY_ASSERT_SET_3, &par_num, global, print);
4698+ res |= bnx2x_check_blocks_with_parity4(bp,
4699+ sig[4] & HW_PRTY_ASSERT_SET_4, &par_num, print);
46734700
46744701 if (print)
46754702 pr_cont("\n");
4703+ }
46764704
4677− return true;
4678− } else
4679− return false;
4705+ return res;
46804706 }
46814707
46824708 /**
@@ -7126,7 +7152,7 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 2443 unmodified lines
71267152 int port = BP_PORT(bp);
71277153 int init_phase = port ? PHASE_PORT1 : PHASE_PORT0;
71287154 u32 low, high;
7129− u32 val;
7155+ u32 val, reg;
71307156
71317157 DP(NETIF_MSG_HW, "starting port init port %d\n", port);
71327158
@@ -7271,6 +7297,17 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 138 unmodified lines
72717297 val |= CHIP_IS_E1(bp) ? 0 : 0x10;
72727298 REG_WR(bp, MISC_REG_AEU_MASK_ATTN_FUNC_0 + port*4, val);
72737299
7300+ /* SCPAD_PARITY should NOT trigger close the gates */
7301+ reg = port ? MISC_REG_AEU_ENABLE4_NIG_1 : MISC_REG_AEU_ENABLE4_NIG_0;
7302+ REG_WR(bp, reg,
7303+ REG_RD(bp, reg) &
7304+ ~AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY);
7305+
7306+ reg = port ? MISC_REG_AEU_ENABLE4_PXP_1 : MISC_REG_AEU_ENABLE4_PXP_0;
7307+ REG_WR(bp, reg,
7308+ REG_RD(bp, reg) &
7309+ ~AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY);
7310+
72747311 bnx2x_init_block(bp, BLOCK_NIG, init_phase);
72757312
72767313 if (!CHIP_IS_E1x(bp)) {
@@ -11693,9 +11730,6 @@ static int bnx2x_init_bp(struct bnx2x *bp) · 4416 unmodified lines
1169311730 static int bnx2x_open(struct net_device *dev)
1169411731 {
1169511732 struct bnx2x *bp = netdev_priv(dev);
11696− bool global = false;
11697− int other_engine = BP_PATH(bp) ? 0 : 1;
11698− bool other_load_status, load_status;
1169911733 int rc;
1170011734
1170111735 bp->stats_init = true;
@@ -11711,6 +11745,10 @@ static int bnx2x_open(struct net_device *dev) · 9 unmodified lines
1171111745 * Parity recovery is only relevant for PF driver.
1171211746 */
1171311747 if (IS_PF(bp)) {
11748+ int other_engine = BP_PATH(bp) ? 0 : 1;
11749+ bool other_load_status, load_status;
11750+ bool global = false;
11751+
1171411752 other_load_status = bnx2x_get_load_status(bp, other_engine);
1171511753 load_status = bnx2x_get_load_status(bp, BP_PATH(bp));
1171611754 if (!bnx2x_reset_is_done(bp, BP_PATH(bp)) ||
@@ -12103,7 +12141,6 @@ static int bnx2x_set_coherency_mask(struct bnx2x *bp) · 386 unmodified lines
1210312141 struct device *dev = &bp->pdev->dev;
1210412142
1210512143 if (dma_set_mask(dev, DMA_BIT_MASK(64)) == 0) {
12106− bp->flags |= USING_DAC_FLAG;
1210712144 if (dma_set_coherent_mask(dev, DMA_BIT_MASK(64)) != 0) {
1210812145 dev_err(dev, "dma_set_coherent_mask failed, aborting\n");
1210912146 return -EIO;
@@ -12274,8 +12311,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, · 164 unmodified lines
1227412311 NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
1227512312
1227612313 dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX;
12277− if (bp->flags & USING_DAC_FLAG)
12278− dev->features |= NETIF_F_HIGHDMA;
12314+ dev->features |= NETIF_F_HIGHDMA;
1227912315
1228012316 /* Add Loopback capability to the device */
1228112317 dev->hw_features |= NETIF_F_LOOPBACK;
@@ -12615,24 +12651,24 @@ static int set_max_cos_est(int chip_id) · 333 unmodified lines
1261512651 return BNX2X_MULTI_TX_COS_E1X;
1261612652 case BCM57712:
1261712653 case BCM57712_MF:
12618− case BCM57712_VF:
1261912654 return BNX2X_MULTI_TX_COS_E2_E3A0;
1262012655 case BCM57800:
1262112656 case BCM57800_MF:
12622− case BCM57800_VF:
1262312657 case BCM57810:
1262412658 case BCM57810_MF:
1262512659 case BCM57840_4_10:
1262612660 case BCM57840_2_20:
1262712661 case BCM57840_O:
1262812662 case BCM57840_MFO:
12629− case BCM57810_VF:
1263012663 case BCM57840_MF:
12631− case BCM57840_VF:
1263212664 case BCM57811:
1263312665 case BCM57811_MF:
12634− case BCM57811_VF:
1263512666 return BNX2X_MULTI_TX_COS_E3B0;
12667+ case BCM57712_VF:
12668+ case BCM57800_VF:
12669+ case BCM57810_VF:
12670+ case BCM57840_VF:
12671+ case BCM57811_VF:
1263612672 return 1;
1263712673 default:
1263812674 pr_err("Unknown board_type (%d), aborting\n", chip_id);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c+17−12
@@ -470,10 +470,10 @@ static int bnx2x_vfop_qdtor_cmd(struct bnx2x *bp, · 469 unmodified lines
470470 bnx2x_vfop_qdtor, cmd->done);
471471 return bnx2x_vfop_transition(bp, vf, bnx2x_vfop_qdtor,
472472 cmd->block);
473+ } else {
474+ BNX2X_ERR("VF[%d] failed to add a vfop\n", vf->abs_vfid);
475+ return -ENOMEM;
473476 }
474− DP(BNX2X_MSG_IOV, "VF[%d] failed to add a vfop. rc %d\n",
475− vf->abs_vfid, vfop->rc);
476− return -ENOMEM;
477477 }
478478
479479 static void
@@ -3391,14 +3391,16 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac) · 2911 unmodified lines
33913391 rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true);
33923392 if (rc) {
33933393 BNX2X_ERR("failed to delete eth macs\n");
3394− return -EINVAL;
3394+ rc = -EINVAL;
3395+ goto out;
33953396 }
33963397
33973398 /* remove existing uc list macs */
33983399 rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true);
33993400 if (rc) {
34003401 BNX2X_ERR("failed to delete uc_list macs\n");
3401− return -EINVAL;
3402+ rc = -EINVAL;
3403+ goto out;
34023404 }
34033405
34043406 /* configure the new mac to device */
@@ -3406,6 +3408,7 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac) · 1 unmodified line
34063408 bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true,
34073409 BNX2X_ETH_MAC, &ramrod_flags);
34083410
3411+out:
34093412 bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC);
34103413 }
34113414
@@ -3468,7 +3471,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) · 56 unmodified lines
34683471 &ramrod_flags);
34693472 if (rc) {
34703473 BNX2X_ERR("failed to delete vlans\n");
3471− return -EINVAL;
3474+ rc = -EINVAL;
3475+ goto out;
34723476 }
34733477
34743478 /* send queue update ramrod to configure default vlan and silent
@@ -3502,7 +3506,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) · 27 unmodified lines
35023506 rc = bnx2x_config_vlan_mac(bp, &ramrod_param);
35033507 if (rc) {
35043508 BNX2X_ERR("failed to configure vlan\n");
3505− return -EINVAL;
3509+ rc = -EINVAL;
3510+ goto out;
35063511 }
35073512
35083513 /* configure default vlan to vf queue and set silent
@@ -3520,18 +3525,18 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) · 11 unmodified lines
35203525 rc = bnx2x_queue_state_change(bp, &q_params);
35213526 if (rc) {
35223527 BNX2X_ERR("Failed to configure default VLAN\n");
3523− return rc;
3528+ goto out;
35243529 }
35253530
35263531 /* clear the flag indicating that this VF needs its vlan
3527− * (will only be set if the HV configured th Vlan before vf was
3528− * and we were called because the VF came up later
3532+ * (will only be set if the HV configured the Vlan before vf was
3533+ * up and we were called because the VF came up later
35293534 */
3535+out:
35303536 vf->cfg_flags &= ~VF_CFG_VLAN;
3531−
35323537 bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN);
35333538 }
3534− return 0;
3539+ return rc;
35353540 }
35363541
35373542 /* crc is the first field in the bulletin board. Compute the crc over the
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c+1−1
@@ -196,7 +196,7 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp) · 195 unmodified lines
196196
197197 } else if (bp->func_stx) {
198198 *stats_comp = 0;
199− bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp));
199+ bnx2x_issue_dmae_with_comp(bp, dmae, stats_comp);
200200 }
201201 }
202202
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c+1−1
@@ -1020,7 +1020,7 @@ static int bnx2x_copy32_vf_dmae(struct bnx2x *bp, u8 from_vf, · 1019 unmodified lines
10201020 dmae.len = len32;
10211021
10221022 /* issue the command and wait for completion */
1023− return bnx2x_issue_dmae_with_comp(bp, &dmae);
1023+ return bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp));
10241024 }
10251025
10261026 static void bnx2x_vf_mbx_resp_single_tlv(struct bnx2x *bp,
drivers/net/ethernet/davicom/dm9000.c+38−18
@@ -158,18 +158,6 @@ static inline board_info_t *to_dm9000_board(struct net_device *dev) · 157 unmodified lines
158158
159159 /* DM9000 network board routine ---------------------------- */
160160
161−static void
162−dm9000_reset(board_info_t * db)
163−{
164− dev_dbg(db->dev, "resetting device\n");
165−
166− /* RESET device */
167− writeb(DM9000_NCR, db->io_addr);
168− udelay(200);
169− writeb(NCR_RST, db->io_data);
170− udelay(200);
171−}
172−
173161 /*
174162 * Read a byte from I/O port
175163 */
@@ -191,6 +179,27 @@ iow(board_info_t * db, int reg, int value) · 15 unmodified lines
191179 writeb(value, db->io_data);
192180 }
193181
182+static void
183+dm9000_reset(board_info_t *db)
184+{
185+ dev_dbg(db->dev, "resetting device\n");
186+
187+ /* Reset DM9000, see DM9000 Application Notes V1.22 Jun 11, 2004 page 29
188+ * The essential point is that we have to do a double reset, and the
189+ * instruction is to set LBK into MAC internal loopback mode.
190+ */
191+ iow(db, DM9000_NCR, 0x03);
192+ udelay(100); /* Application note says at least 20 us */
193+ if (ior(db, DM9000_NCR) & 1)
194+ dev_err(db->dev, "dm9000 did not respond to first reset\n");
195+
196+ iow(db, DM9000_NCR, 0);
197+ iow(db, DM9000_NCR, 0x03);
198+ udelay(100);
199+ if (ior(db, DM9000_NCR) & 1)
200+ dev_err(db->dev, "dm9000 did not respond to second reset\n");
201+}
202+
194203 /* routines for sending block to chip */
195204
196205 static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count)
@@ -744,15 +753,20 @@ static const struct ethtool_ops dm9000_ethtool_ops = { · 547 unmodified lines
744753 static void dm9000_show_carrier(board_info_t *db,
745754 unsigned carrier, unsigned nsr)
746755 {
756+ int lpa;
747757 struct net_device *ndev = db->ndev;
758+ struct mii_if_info *mii = &db->mii;
748759 unsigned ncr = dm9000_read_locked(db, DM9000_NCR);
749760
750− if (carrier)
751− dev_info(db->dev, "%s: link up, %dMbps, %s-duplex, no LPA\n",
761+ if (carrier) {
762+ lpa = mii->mdio_read(mii->dev, mii->phy_id, MII_LPA);
763+ dev_info(db->dev,
764+ "%s: link up, %dMbps, %s-duplex, lpa 0x%04X\n",
752765 ndev->name, (nsr & NSR_SPEED) ? 10 : 100,
753− (ncr & NCR_FDX) ? "full" : "half");
754− else
766+ (ncr & NCR_FDX) ? "full" : "half", lpa);
767+ } else {
755768 dev_info(db->dev, "%s: link down\n", ndev->name);
769+ }
756770 }
757771
758772 static void
@@ -890,9 +904,15 @@ dm9000_init_dm9000(struct net_device *dev) · 131 unmodified lines
890904 (dev->features & NETIF_F_RXCSUM) ? RCSR_CSUM : 0);
891905
892906 iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */
907+ iow(db, DM9000_GPR, 0);
893908
894− dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */
895− dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); /* Init */
909+ /* If we are dealing with DM9000B, some extra steps are required: a
910+ * manual phy reset, and setting init params.
911+ */
912+ if (db->type == TYPE_DM9000B) {
913+ dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET);
914+ dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM);
915+ }
896916
897917 ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0;
898918
drivers/net/ethernet/freescale/gianfar.c+28−10
@@ -88,6 +88,7 @@ · 87 unmodified lines
8888
8989 #include <asm/io.h>
9090 #include <asm/reg.h>
91+#include <asm/mpc85xx.h>
9192 #include <asm/irq.h>
9293 #include <asm/uaccess.h>
9394 #include <linux/module.h>
@@ -939,9 +940,8 @@ static void gfar_init_filer_table(struct gfar_private *priv) · 845 unmodified lines
939940 }
940941 }
941942
942−static void gfar_detect_errata(struct gfar_private *priv)
943+static void __gfar_detect_errata_83xx(struct gfar_private *priv)
943944 {
944− struct device *dev = &priv->ofdev->dev;
945945 unsigned int pvr = mfspr(SPRN_PVR);
946946 unsigned int svr = mfspr(SPRN_SVR);
947947 unsigned int mod = (svr >> 16) & 0xfff6; /* w/o E suffix */
@@ -957,15 +957,33 @@ static void gfar_detect_errata(struct gfar_private *priv) · 9 unmodified lines
957957 (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0))
958958 priv->errata |= GFAR_ERRATA_76;
959959
960− /* MPC8313 and MPC837x all rev */
961− if ((pvr == 0x80850010 && mod == 0x80b0) ||
962− (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0))
963− priv->errata |= GFAR_ERRATA_A002;
960+ /* MPC8313 Rev < 2.0 */
961+ if (pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020)
962+ priv->errata |= GFAR_ERRATA_12;
963+}
964964
965− /* MPC8313 Rev < 2.0, MPC8548 rev 2.0 */
966− if ((pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020) ||
967− (pvr == 0x80210020 && mod == 0x8030 && rev == 0x0020))
965+static void __gfar_detect_errata_85xx(struct gfar_private *priv)
966+{
967+ unsigned int svr = mfspr(SPRN_SVR);
968+
969+ if ((SVR_SOC_VER(svr) == SVR_8548) && (SVR_REV(svr) == 0x20))
968970 priv->errata |= GFAR_ERRATA_12;
971+ if (((SVR_SOC_VER(svr) == SVR_P2020) && (SVR_REV(svr) < 0x20)) ||
972+ ((SVR_SOC_VER(svr) == SVR_P2010) && (SVR_REV(svr) < 0x20)))
973+ priv->errata |= GFAR_ERRATA_76; /* aka eTSEC 20 */
974+}
975+
976+static void gfar_detect_errata(struct gfar_private *priv)
977+{
978+ struct device *dev = &priv->ofdev->dev;
979+
980+ /* no plans to fix */
981+ priv->errata |= GFAR_ERRATA_A002;
982+
983+ if (pvr_version_is(PVR_VER_E500V1) || pvr_version_is(PVR_VER_E500V2))
984+ __gfar_detect_errata_85xx(priv);
985+ else /* non-mpc85xx parts, i.e. e300 core based */
986+ __gfar_detect_errata_83xx(priv);
969987
970988 if (priv->errata)
971989 dev_info(dev, "enabled errata workarounds, flags: 0x%x\n",
@@ -1599,7 +1617,7 @@ static int __gfar_is_rx_idle(struct gfar_private *priv) · 627 unmodified lines
15991617 /* Normaly TSEC should not hang on GRS commands, so we should
16001618 * actually wait for IEVENT_GRSC flag.
16011619 */
1602− if (likely(!gfar_has_errata(priv, GFAR_ERRATA_A002)))
1620+ if (!gfar_has_errata(priv, GFAR_ERRATA_A002))
16031621 return 0;
16041622
16051623 /* Read the eTSEC register at offset 0xD1C. If bits 7-14 are
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+15−13
@@ -180,28 +180,32 @@ static int verify_block_sig(struct mlx5_cmd_prot_block *block) · 179 unmodified lines
180180 return 0;
181181 }
182182
183−static void calc_block_sig(struct mlx5_cmd_prot_block *block, u8 token)
183+static void calc_block_sig(struct mlx5_cmd_prot_block *block, u8 token,
184+ int csum)
184185 {
185186 block->token = token;
186− block->ctrl_sig = ~xor8_buf(block->rsvd0, sizeof(*block) - sizeof(block->data) - 2);
187− block->sig = ~xor8_buf(block, sizeof(*block) - 1);
187+ if (csum) {
188+ block->ctrl_sig = ~xor8_buf(block->rsvd0, sizeof(*block) -
189+ sizeof(block->data) - 2);
190+ block->sig = ~xor8_buf(block, sizeof(*block) - 1);
191+ }
188192 }
189193
190−static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token)
194+static void calc_chain_sig(struct mlx5_cmd_msg *msg, u8 token, int csum)
191195 {
192196 struct mlx5_cmd_mailbox *next = msg->next;
193197
194198 while (next) {
195− calc_block_sig(next->buf, token);
199+ calc_block_sig(next->buf, token, csum);
196200 next = next->next;
197201 }
198202 }
199203
200−static void set_signature(struct mlx5_cmd_work_ent *ent)
204+static void set_signature(struct mlx5_cmd_work_ent *ent, int csum)
201205 {
202206 ent->lay->sig = ~xor8_buf(ent->lay, sizeof(*ent->lay));
203− calc_chain_sig(ent->in, ent->token);
204− calc_chain_sig(ent->out, ent->token);
207+ calc_chain_sig(ent->in, ent->token, csum);
208+ calc_chain_sig(ent->out, ent->token, csum);
205209 }
206210
207211 static void poll_timeout(struct mlx5_cmd_work_ent *ent)
@@ -539,8 +543,7 @@ static void cmd_work_handler(struct work_struct *work) · 331 unmodified lines
539543 lay->type = MLX5_PCI_CMD_XPORT;
540544 lay->token = ent->token;
541545 lay->status_own = CMD_OWNER_HW;
542− if (!cmd->checksum_disabled)
543− set_signature(ent);
546+ set_signature(ent, !cmd->checksum_disabled);
544547 dump_command(dev, ent, 1);
545548 ktime_get_ts(&ent->ts1);
546549
@@ -773,8 +776,6 @@ static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size) · 226 unmodified lines
773776
774777 copy = min_t(int, size, MLX5_CMD_DATA_BLOCK_SIZE);
775778 block = next->buf;
776− if (xor8_buf(block, sizeof(*block)) != 0xff)
777− return -EINVAL;
778779
779780 memcpy(to, block->data, copy);
780781 to += copy;
@@ -1361,6 +1362,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) · 580 unmodified lines
13611362 goto err_map;
13621363 }
13631364
1365+ cmd->checksum_disabled = 1;
13641366 cmd->max_reg_cmds = (1 << cmd->log_sz) - 1;
13651367 cmd->bitmask = (1 << cmd->max_reg_cmds) - 1;
13661368
@@ -1510,7 +1512,7 @@ int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr) · 143 unmodified lines
15101512 case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: return -EIO;
15111513 case MLX5_CMD_STAT_BAD_RES_ERR: return -EINVAL;
15121514 case MLX5_CMD_STAT_RES_BUSY: return -EBUSY;
1513− case MLX5_CMD_STAT_LIM_ERR: return -EINVAL;
1515+ case MLX5_CMD_STAT_LIM_ERR: return -ENOMEM;
15141516 case MLX5_CMD_STAT_BAD_RES_STATE_ERR: return -EINVAL;
15151517 case MLX5_CMD_STAT_IX_ERR: return -EINVAL;
15161518 case MLX5_CMD_STAT_NO_RES_ERR: return -EAGAIN;
drivers/net/ethernet/mellanox/mlx5/core/eq.c+3−1
@@ -366,9 +366,11 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, · 365 unmodified lines
366366 goto err_in;
367367 }
368368
369+ snprintf(eq->name, MLX5_MAX_EQ_NAME, "%s@pci:%s",
370+ name, pci_name(dev->pdev));
369371 eq->eqn = out.eq_number;
370372 err = request_irq(table->msix_arr[vecidx].vector, mlx5_msix_handler, 0,
371− name, eq);
373+ eq->name, eq);
372374 if (err)
373375 goto err_eq;
374376
drivers/net/ethernet/mellanox/mlx5/core/main.c+5−16
@@ -165,9 +165,7 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) · 164 unmodified lines
165165 struct mlx5_cmd_set_hca_cap_mbox_in *set_ctx = NULL;
166166 struct mlx5_cmd_query_hca_cap_mbox_in query_ctx;
167167 struct mlx5_cmd_set_hca_cap_mbox_out set_out;
168− struct mlx5_profile *prof = dev->profile;
169168 u64 flags;
170− int csum = 1;
171169 int err;
172170
173171 memset(&query_ctx, 0, sizeof(query_ctx));
@@ -197,20 +195,14 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) · 23 unmodified lines
197195 memcpy(&set_ctx->hca_cap, &query_out->hca_cap,
198196 sizeof(set_ctx->hca_cap));
199197
200− if (prof->mask & MLX5_PROF_MASK_CMDIF_CSUM) {
201− csum = !!prof->cmdif_csum;
202− flags = be64_to_cpu(set_ctx->hca_cap.flags);
203− if (csum)
204− flags |= MLX5_DEV_CAP_FLAG_CMDIF_CSUM;
205− else
206− flags &= ~MLX5_DEV_CAP_FLAG_CMDIF_CSUM;
207−
208− set_ctx->hca_cap.flags = cpu_to_be64(flags);
209− }
210−
211198 if (dev->profile->mask & MLX5_PROF_MASK_QP_SIZE)
212199 set_ctx->hca_cap.log_max_qp = dev->profile->log_max_qp;
213200
201+ flags = be64_to_cpu(query_out->hca_cap.flags);
202+ /* disable checksum */
203+ flags &= ~MLX5_DEV_CAP_FLAG_CMDIF_CSUM;
204+
205+ set_ctx->hca_cap.flags = cpu_to_be64(flags);
214206 memset(&set_out, 0, sizeof(set_out));
215207 set_ctx->hca_cap.log_uar_page_sz = cpu_to_be16(PAGE_SHIFT - 12);
216208 set_ctx->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_SET_HCA_CAP);
@@ -225,9 +217,6 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) · 8 unmodified lines
225217 if (err)
226218 goto query_ex;
227219
228− if (!csum)
229− dev->cmd.checksum_disabled = 1;
230−
231220 query_ex:
232221 kfree(query_out);
233222 kfree(set_ctx);
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c+14−2
@@ -90,6 +90,10 @@ struct mlx5_manage_pages_outbox { · 89 unmodified lines
9090 __be64 pas[0];
9191 };
9292
93+enum {
94+ MAX_RECLAIM_TIME_MSECS = 5000,
95+};
96+
9397 static int insert_page(struct mlx5_core_dev *dev, u64 addr, struct page *page, u16 func_id)
9498 {
9599 struct rb_root *root = &dev->priv.page_root;
@@ -279,6 +283,9 @@ static int reclaim_pages(struct mlx5_core_dev *dev, u32 func_id, int npages, · 183 unmodified lines
279283 int err;
280284 int i;
281285
286+ if (nclaimed)
287+ *nclaimed = 0;
288+
282289 memset(&in, 0, sizeof(in));
283290 outlen = sizeof(*out) + npages * sizeof(out->pas[0]);
284291 out = mlx5_vzalloc(outlen);
@@ -388,20 +395,25 @@ static int optimal_reclaimed_pages(void) · 103 unmodified lines
388395
389396 int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev)
390397 {
391− unsigned long end = jiffies + msecs_to_jiffies(5000);
398+ unsigned long end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS);
392399 struct fw_page *fwp;
393400 struct rb_node *p;
401+ int nclaimed = 0;
394402 int err;
395403
396404 do {
397405 p = rb_first(&dev->priv.page_root);
398406 if (p) {
399407 fwp = rb_entry(p, struct fw_page, rb_node);
400− err = reclaim_pages(dev, fwp->func_id, optimal_reclaimed_pages(), NULL);
408+ err = reclaim_pages(dev, fwp->func_id,
409+ optimal_reclaimed_pages(),
410+ &nclaimed);
401411 if (err) {
402412 mlx5_core_warn(dev, "failed reclaiming pages (%d)\n", err);
403413 return err;
404414 }
415+ if (nclaimed)
416+ end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS);
405417 }
406418 if (time_after(jiffies, end)) {
407419 mlx5_core_warn(dev, "FW did not return all pages. giving up...\n");
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c+1−1
@@ -691,7 +691,7 @@ static int qlcnic_set_channels(struct net_device *dev, · 690 unmodified lines
691691 return err;
692692 }
693693
694− if (channel->tx_count) {
694+ if (qlcnic_82xx_check(adapter) && channel->tx_count) {
695695 err = qlcnic_validate_max_tx_rings(adapter, channel->tx_count);
696696 if (err)
697697 return err;
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c+1−7
@@ -3648,11 +3648,6 @@ int qlcnic_validate_max_tx_rings(struct qlcnic_adapter *adapter, u32 txq) · 3647 unmodified lines
36483648 u8 max_hw = QLCNIC_MAX_TX_RINGS;
36493649 u32 max_allowed;
36503650
3651− if (!qlcnic_82xx_check(adapter)) {
3652− netdev_err(netdev, "No Multi TX-Q support\n");
3653− return -EINVAL;
3654− }
3655−
36563651 if (!qlcnic_use_msi_x && !qlcnic_use_msi) {
36573652 netdev_err(netdev, "No Multi TX-Q support in INT-x mode\n");
36583653 return -EINVAL;
@@ -3692,8 +3687,7 @@ int qlcnic_validate_max_rss(struct qlcnic_adapter *adapter, · 33 unmodified lines
36923687 u8 max_hw = adapter->ahw->max_rx_ques;
36933688 u32 max_allowed;
36943689
3695− if (qlcnic_82xx_check(adapter) && !qlcnic_use_msi_x &&
3696− !qlcnic_use_msi) {
3690+ if (!qlcnic_use_msi_x && !qlcnic_use_msi) {
36973691 netdev_err(netdev, "No RSS support in INT-x mode\n");
36983692 return -EINVAL;
36993693 }
drivers/net/ethernet/renesas/sh_eth.c+4−4
@@ -620,16 +620,12 @@ static struct sh_eth_cpu_data sh7734_data = { · 619 unmodified lines
620620 .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
621621 EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
622622 EESR_TDE | EESR_ECI,
623− .fdr_value = 0x0000070f,
624− .rmcr_value = 0x00000001,
625623
626624 .apr = 1,
627625 .mpr = 1,
628626 .tpauser = 1,
629627 .bculr = 1,
630628 .hw_swap = 1,
631− .rpadir = 1,
632− .rpadir_value = 2 << 16,
633629 .no_trimd = 1,
634630 .no_ade = 1,
635631 .tsu = 1,
@@ -692,12 +688,16 @@ static struct sh_eth_cpu_data r8a7740_data = { · 56 unmodified lines
692688 .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT |
693689 EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE |
694690 EESR_TDE | EESR_ECI,
691+ .fdr_value = 0x0000070f,
692+ .rmcr_value = 0x00000001,
695693
696694 .apr = 1,
697695 .mpr = 1,
698696 .tpauser = 1,
699697 .bculr = 1,
700698 .hw_swap = 1,
699+ .rpadir = 1,
700+ .rpadir_value = 2 << 16,
701701 .no_trimd = 1,
702702 .no_ade = 1,
703703 .tsu = 1,
drivers/net/ethernet/smsc/smc91x.h+2−4
@@ -1124,8 +1124,7 @@ static const char * chip_ids[ 16 ] = { · 1123 unmodified lines
11241124 void __iomem *__ioaddr = ioaddr; \
11251125 if (__len >= 2 && (unsigned long)__ptr & 2) { \
11261126 __len -= 2; \
1127− SMC_outw(*(u16 *)__ptr, ioaddr, \
1128− DATA_REG(lp)); \
1127+ SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \
11291128 __ptr += 2; \
11301129 } \
11311130 if (SMC_CAN_USE_DATACS && lp->datacs) \
@@ -1133,8 +1132,7 @@ static const char * chip_ids[ 16 ] = { · 1 unmodified line
11331132 SMC_outsl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \
11341133 if (__len & 2) { \
11351134 __ptr += (__len & ~3); \
1136− SMC_outw(*((u16 *)__ptr), ioaddr, \
1137− DATA_REG(lp)); \
1135+ SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \
11381136 } \
11391137 } else if (SMC_16BIT(lp)) \
11401138 SMC_outsw(ioaddr, DATA_REG(lp), p, (l) >> 1); \
drivers/net/ethernet/ti/cpsw.c+1−8
@@ -637,13 +637,6 @@ void cpsw_rx_handler(void *token, int len, int status) · 636 unmodified lines
637637 static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
638638 {
639639 struct cpsw_priv *priv = dev_id;
640− u32 rx, tx, rx_thresh;
641−
642− rx_thresh = __raw_readl(&priv->wr_regs->rx_thresh_stat);
643− rx = __raw_readl(&priv->wr_regs->rx_stat);
644− tx = __raw_readl(&priv->wr_regs->tx_stat);
645− if (!rx_thresh && !rx && !tx)
646− return IRQ_NONE;
647640
648641 cpsw_intr_disable(priv);
649642 if (priv->irq_enabled == true) {
@@ -1171,9 +1164,9 @@ static int cpsw_ndo_open(struct net_device *ndev) · 521 unmodified lines
11711164 }
11721165 }
11731166
1167+ napi_enable(&priv->napi);
11741168 cpdma_ctlr_start(priv->dma);
11751169 cpsw_intr_enable(priv);
1176− napi_enable(&priv->napi);
11771170 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
11781171 cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX);
11791172
drivers/net/ethernet/ti/davinci_emac.c+1−2
@@ -876,8 +876,7 @@ static void emac_dev_mcast_set(struct net_device *ndev) · 875 unmodified lines
876876 netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) {
877877 mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
878878 emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
879− }
880− if (!netdev_mc_empty(ndev)) {
879+ } else if (!netdev_mc_empty(ndev)) {
881880 struct netdev_hw_addr *ha;
882881
883882 mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
drivers/net/hamradio/yam.c+0−1
@@ -975,7 +975,6 @@ static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) · 974 unmodified lines
975975 return -EINVAL; /* Cannot change this parameter when up */
976976 if ((ym = kmalloc(sizeof(struct yamdrv_ioctl_mcs), GFP_KERNEL)) == NULL)
977977 return -ENOBUFS;
978− ym->bitrate = 9600;
979978 if (copy_from_user(ym, ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs))) {
980979 kfree(ym);
981980 return -EFAULT;
drivers/net/usb/ax88179_178a.c+20−3
@@ -36,8 +36,8 @@ · 35 unmodified lines
3636 #define AX_RXHDR_L4_TYPE_TCP 16
3737 #define AX_RXHDR_L3CSUM_ERR 2
3838 #define AX_RXHDR_L4CSUM_ERR 1
39−#define AX_RXHDR_CRC_ERR ((u32)BIT(31))
40−#define AX_RXHDR_DROP_ERR ((u32)BIT(30))
39+#define AX_RXHDR_CRC_ERR ((u32)BIT(29))
40+#define AX_RXHDR_DROP_ERR ((u32)BIT(31))
4141 #define AX_ACCESS_MAC 0x01
4242 #define AX_ACCESS_PHY 0x02
4343 #define AX_ACCESS_EEPROM 0x04
@@ -1406,6 +1406,19 @@ static const struct driver_info sitecom_info = { · 1362 unmodified lines
14061406 .tx_fixup = ax88179_tx_fixup,
14071407 };
14081408
1409+static const struct driver_info samsung_info = {
1410+ .description = "Samsung USB Ethernet Adapter",
1411+ .bind = ax88179_bind,
1412+ .unbind = ax88179_unbind,
1413+ .status = ax88179_status,
1414+ .link_reset = ax88179_link_reset,
1415+ .reset = ax88179_reset,
1416+ .stop = ax88179_stop,
1417+ .flags = FLAG_ETHER | FLAG_FRAMING_AX,
1418+ .rx_fixup = ax88179_rx_fixup,
1419+ .tx_fixup = ax88179_tx_fixup,
1420+};
1421+
14091422 static const struct usb_device_id products[] = {
14101423 {
14111424 /* ASIX AX88179 10/100/1000 */
@@ -1418,7 +1431,11 @@ static const struct usb_device_id products[] = { · 6 unmodified lines
14181431 }, {
14191432 /* Sitecom USB 3.0 to Gigabit Adapter */
14201433 USB_DEVICE(0x0df6, 0x0072),
1421− .driver_info = (unsigned long) &sitecom_info,
1434+ .driver_info = (unsigned long)&sitecom_info,
1435+}, {
1436+ /* Samsung USB Ethernet Adapter */
1437+ USB_DEVICE(0x04e8, 0xa100),
1438+ .driver_info = (unsigned long)&samsung_info,
14221439 },
14231440 { },
14241441 };
drivers/net/usb/qmi_wwan.c+1−0
@@ -730,6 +730,7 @@ static const struct usb_device_id products[] = { · 729 unmodified lines
730730 {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */
731731 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
732732 {QMI_FIXED_INTF(0x1bc7, 0x1201, 2)}, /* Telit LE920 */
733+ {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */
733734 {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */
734735
735736 /* 4. Gobi 1000 devices */
drivers/net/usb/usbnet.c+3−1
@@ -1688,8 +1688,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) · 1687 unmodified lines
16881688 if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) &&
16891689 !(info->flags & FLAG_MULTI_PACKET)) {
16901690 dev->padding_pkt = kzalloc(1, GFP_KERNEL);
1691− if (!dev->padding_pkt)
1691+ if (!dev->padding_pkt) {
1692+ status = -ENOMEM;
16921693 goto out4;
1694+ }
16931695 }
16941696
16951697 status = register_netdev (net);
drivers/net/virtio_net.c+13−1
@@ -938,7 +938,9 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) · 937 unmodified lines
938938 return -EINVAL;
939939 } else {
940940 vi->curr_queue_pairs = queue_pairs;
941− schedule_delayed_work(&vi->refill, 0);
941+ /* virtnet_open() will refill when device is going to up. */
942+ if (dev->flags & IFF_UP)
943+ schedule_delayed_work(&vi->refill, 0);
942944 }
943945
944946 return 0;
@@ -1116,6 +1118,11 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, · 171 unmodified lines
11161118 {
11171119 struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb);
11181120
1121+ mutex_lock(&vi->config_lock);
1122+
1123+ if (!vi->config_enable)
1124+ goto done;
1125+
11191126 switch(action & ~CPU_TASKS_FROZEN) {
11201127 case CPU_ONLINE:
11211128 case CPU_DOWN_FAILED:
@@ -1128,6 +1135,9 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, · 6 unmodified lines
11281135 default:
11291136 break;
11301137 }
1138+
1139+done:
1140+ mutex_unlock(&vi->config_lock);
11311141 return NOTIFY_OK;
11321142 }
11331143
@@ -1733,7 +1743,9 @@ static int virtnet_restore(struct virtio_device *vdev) · 599 unmodified lines
17331743 vi->config_enable = true;
17341744 mutex_unlock(&vi->config_lock);
17351745
1746+ rtnl_lock();
17361747 virtnet_set_queues(vi, vi->curr_queue_pairs);
1748+ rtnl_unlock();
17371749
17381750 return 0;
17391751 }
drivers/net/wan/farsync.c+1−0
@@ -1972,6 +1972,7 @@ fst_get_iface(struct fst_card_info *card, struct fst_port_info *port, · 1971 unmodified lines
19721972 }
19731973
19741974 i = port->index;
1975+ memset(&sync, 0, sizeof(sync));
19751976 sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed);
19761977 /* Lucky card and linux use same encoding here */
19771978 sync.clock_type = FST_RDB(card, portConfig[i].internalClock) ==
drivers/net/wan/wanxl.c+1−0
@@ -355,6 +355,7 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) · 354 unmodified lines
355355 ifr->ifr_settings.size = size; /* data size wanted */
356356 return -ENOBUFS;
357357 }
358+ memset(&line, 0, sizeof(line));
358359 line.clock_type = get_status(port)->clocking;
359360 line.clock_rate = 0;
360361 line.loopback = 0;
drivers/net/wireless/ath/ath9k/main.c+11−12
@@ -208,6 +208,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) · 207 unmodified lines
208208 struct ath_hw *ah = sc->sc_ah;
209209 struct ath_common *common = ath9k_hw_common(ah);
210210 unsigned long flags;
211+ int i;
211212
212213 if (ath_startrecv(sc) != 0) {
213214 ath_err(common, "Unable to restart recv logic\n");
@@ -235,6 +236,15 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) · 21 unmodified lines
235236 }
236237 work:
237238 ath_restart_work(sc);
239+
240+ for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
241+ if (!ATH_TXQ_SETUP(sc, i))
242+ continue;
243+
244+ spin_lock_bh(&sc->tx.txq[i].axq_lock);
245+ ath_txq_schedule(sc, &sc->tx.txq[i]);
246+ spin_unlock_bh(&sc->tx.txq[i].axq_lock);
247+ }
238248 }
239249
240250 ieee80211_wake_queues(sc->hw);
@@ -619,21 +629,10 @@ chip_reset: · 378 unmodified lines
619629
620630 static int ath_reset(struct ath_softc *sc)
621631 {
622− int i, r;
632+ int r;
623633
624634 ath9k_ps_wakeup(sc);
625−
626635 r = ath_reset_internal(sc, NULL);
627−
628− for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
629− if (!ATH_TXQ_SETUP(sc, i))
630− continue;
631−
632− spin_lock_bh(&sc->tx.txq[i].axq_lock);
633− ath_txq_schedule(sc, &sc->tx.txq[i]);
634− spin_unlock_bh(&sc->tx.txq[i].axq_lock);
635− }
636−
637636 ath9k_ps_restore(sc);
638637
639638 return r;
drivers/net/wireless/cw1200/cw1200_spi.c+2−0
@@ -237,7 +237,9 @@ static irqreturn_t cw1200_spi_irq_handler(int irq, void *dev_id) · 236 unmodified lines
237237 struct hwbus_priv *self = dev_id;
238238
239239 if (self->core) {
240+ cw1200_spi_lock(self);
240241 cw1200_irq_handler(self->core);
242+ cw1200_spi_unlock(self);
241243 return IRQ_HANDLED;
242244 } else {
243245 return IRQ_NONE;
drivers/net/wireless/iwlwifi/iwl-6000.c+6−0
@@ -240,6 +240,12 @@ const struct iwl_cfg iwl6035_2agn_cfg = { · 239 unmodified lines
240240 .ht_params = &iwl6000_ht_params,
241241 };
242242
243+const struct iwl_cfg iwl6035_2agn_sff_cfg = {
244+ .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN",
245+ IWL_DEVICE_6035,
246+ .ht_params = &iwl6000_ht_params,
247+};
248+
243249 const struct iwl_cfg iwl1030_bgn_cfg = {
244250 .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN",
245251 IWL_DEVICE_6030,
drivers/net/wireless/iwlwifi/iwl-config.h+1−0
@@ -280,6 +280,7 @@ extern const struct iwl_cfg iwl2000_2bgn_cfg; · 279 unmodified lines
280280 extern const struct iwl_cfg iwl2000_2bgn_d_cfg;
281281 extern const struct iwl_cfg iwl2030_2bgn_cfg;
282282 extern const struct iwl_cfg iwl6035_2agn_cfg;
283+extern const struct iwl_cfg iwl6035_2agn_sff_cfg;
283284 extern const struct iwl_cfg iwl105_bgn_cfg;
284285 extern const struct iwl_cfg iwl105_bgn_d_cfg;
285286 extern const struct iwl_cfg iwl135_bgn_cfg;
drivers/net/wireless/iwlwifi/iwl-trans.h+4−2
@@ -601,8 +601,10 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans, · 600 unmodified lines
601601 {
602602 int ret;
603603
604− WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,
605− "%s bad state = %d", __func__, trans->state);
604+ if (trans->state != IWL_TRANS_FW_ALIVE) {
605+ IWL_ERR(trans, "%s bad state = %d", __func__, trans->state);
606+ return -EIO;
607+ }
606608
607609 if (!(cmd->flags & CMD_ASYNC))
608610 lock_map_acquire_read(&trans->sync_cmd_lockdep_map);
drivers/net/wireless/iwlwifi/mvm/power.c+4−1
@@ -273,7 +273,10 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, · 272 unmodified lines
273273 if (!mvmvif->queue_params[ac].uapsd)
274274 continue;
275275
276− cmd->flags |= cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK);
276+ if (mvm->cur_ucode != IWL_UCODE_WOWLAN)
277+ cmd->flags |=
278+ cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK);
279+
277280 cmd->uapsd_ac_flags |= BIT(ac);
278281
279282 /* QNDP TID - the highest TID with no admission control */
drivers/net/wireless/iwlwifi/mvm/scan.c+11−1
@@ -394,6 +394,11 @@ static bool iwl_mvm_scan_abort_notif(struct iwl_notif_wait_data *notif_wait, · 393 unmodified lines
394394 return false;
395395 }
396396
397+ /*
398+ * If scan cannot be aborted, it means that we had a
399+ * SCAN_COMPLETE_NOTIFICATION in the pipe and it called
400+ * ieee80211_scan_completed already.
401+ */
397402 IWL_DEBUG_SCAN(mvm, "Scan cannot be aborted, exit now: %d\n",
398403 *resp);
399404 return true;
@@ -417,14 +422,19 @@ void iwl_mvm_cancel_scan(struct iwl_mvm *mvm) · 17 unmodified lines
417422 SCAN_COMPLETE_NOTIFICATION };
418423 int ret;
419424
425+ if (mvm->scan_status == IWL_MVM_SCAN_NONE)
426+ return;
427+
420428 iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_abort,
421429 scan_abort_notif,
422430 ARRAY_SIZE(scan_abort_notif),
423431 iwl_mvm_scan_abort_notif, NULL);
424432
425− ret = iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_CMD, CMD_SYNC, 0, NULL);
433+ ret = iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_CMD,
434+ CMD_SYNC | CMD_SEND_IN_RFKILL, 0, NULL);
426435 if (ret) {
427436 IWL_ERR(mvm, "Couldn't send SCAN_ABORT_CMD: %d\n", ret);
437+ /* mac80211's state will be cleaned in the fw_restart flow */
428438 goto out_remove_notif;
429439 }
430440
drivers/net/wireless/iwlwifi/pcie/drv.c+42−0
@@ -139,13 +139,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { · 138 unmodified lines
139139
140140 /* 6x00 Series */
141141 {IWL_PCI_DEVICE(0x422B, 0x1101, iwl6000_3agn_cfg)},
142+ {IWL_PCI_DEVICE(0x422B, 0x1108, iwl6000_3agn_cfg)},
142143 {IWL_PCI_DEVICE(0x422B, 0x1121, iwl6000_3agn_cfg)},
144+ {IWL_PCI_DEVICE(0x422B, 0x1128, iwl6000_3agn_cfg)},
143145 {IWL_PCI_DEVICE(0x422C, 0x1301, iwl6000i_2agn_cfg)},
144146 {IWL_PCI_DEVICE(0x422C, 0x1306, iwl6000i_2abg_cfg)},
145147 {IWL_PCI_DEVICE(0x422C, 0x1307, iwl6000i_2bg_cfg)},
146148 {IWL_PCI_DEVICE(0x422C, 0x1321, iwl6000i_2agn_cfg)},
147149 {IWL_PCI_DEVICE(0x422C, 0x1326, iwl6000i_2abg_cfg)},
148150 {IWL_PCI_DEVICE(0x4238, 0x1111, iwl6000_3agn_cfg)},
151+ {IWL_PCI_DEVICE(0x4238, 0x1118, iwl6000_3agn_cfg)},
149152 {IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)},
150153 {IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)},
151154
@@ -153,12 +156,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { · 1 unmodified line
153156 {IWL_PCI_DEVICE(0x0082, 0x1301, iwl6005_2agn_cfg)},
154157 {IWL_PCI_DEVICE(0x0082, 0x1306, iwl6005_2abg_cfg)},
155158 {IWL_PCI_DEVICE(0x0082, 0x1307, iwl6005_2bg_cfg)},
159+ {IWL_PCI_DEVICE(0x0082, 0x1308, iwl6005_2agn_cfg)},
156160 {IWL_PCI_DEVICE(0x0082, 0x1321, iwl6005_2agn_cfg)},
157161 {IWL_PCI_DEVICE(0x0082, 0x1326, iwl6005_2abg_cfg)},
162+ {IWL_PCI_DEVICE(0x0082, 0x1328, iwl6005_2agn_cfg)},
158163 {IWL_PCI_DEVICE(0x0085, 0x1311, iwl6005_2agn_cfg)},
164+ {IWL_PCI_DEVICE(0x0085, 0x1318, iwl6005_2agn_cfg)},
159165 {IWL_PCI_DEVICE(0x0085, 0x1316, iwl6005_2abg_cfg)},
160166 {IWL_PCI_DEVICE(0x0082, 0xC020, iwl6005_2agn_sff_cfg)},
161167 {IWL_PCI_DEVICE(0x0085, 0xC220, iwl6005_2agn_sff_cfg)},
168+ {IWL_PCI_DEVICE(0x0085, 0xC228, iwl6005_2agn_sff_cfg)},
162169 {IWL_PCI_DEVICE(0x0082, 0x4820, iwl6005_2agn_d_cfg)},
163170 {IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_2agn_mow1_cfg)},/* low 5GHz active */
164171 {IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_2agn_mow2_cfg)},/* high 5GHz active */
@@ -240,8 +247,11 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { · 75 unmodified lines
240247
241248 /* 6x35 Series */
242249 {IWL_PCI_DEVICE(0x088E, 0x4060, iwl6035_2agn_cfg)},
250+ {IWL_PCI_DEVICE(0x088E, 0x406A, iwl6035_2agn_sff_cfg)},
243251 {IWL_PCI_DEVICE(0x088F, 0x4260, iwl6035_2agn_cfg)},
252+ {IWL_PCI_DEVICE(0x088F, 0x426A, iwl6035_2agn_sff_cfg)},
244253 {IWL_PCI_DEVICE(0x088E, 0x4460, iwl6035_2agn_cfg)},
254+ {IWL_PCI_DEVICE(0x088E, 0x446A, iwl6035_2agn_sff_cfg)},
245255 {IWL_PCI_DEVICE(0x088E, 0x4860, iwl6035_2agn_cfg)},
246256 {IWL_PCI_DEVICE(0x088F, 0x5260, iwl6035_2agn_cfg)},
247257
@@ -260,54 +270,86 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { · 12 unmodified lines
260270 #if IS_ENABLED(CONFIG_IWLMVM)
261271 /* 7000 Series */
262272 {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)},
273+ {IWL_PCI_DEVICE(0x08B1, 0x4072, iwl7260_2ac_cfg)},
263274 {IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)},
264275 {IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)},
276+ {IWL_PCI_DEVICE(0x08B1, 0x406A, iwl7260_2n_cfg)},
265277 {IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)},
266278 {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)},
267279 {IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)},
268280 {IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)},
281+ {IWL_PCI_DEVICE(0x08B2, 0x4272, iwl7260_2ac_cfg)},
269282 {IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)},
283+ {IWL_PCI_DEVICE(0x08B2, 0x426A, iwl7260_2n_cfg)},
270284 {IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)},
271285 {IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)},
286+ {IWL_PCI_DEVICE(0x08B1, 0x4472, iwl7260_2ac_cfg)},
272287 {IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)},
288+ {IWL_PCI_DEVICE(0x08B1, 0x446A, iwl7260_2n_cfg)},
273289 {IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)},
274290 {IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)},
275291 {IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)},
276292 {IWL_PCI_DEVICE(0x08B1, 0x4A70, iwl7260_2ac_cfg_high_temp)},
277293 {IWL_PCI_DEVICE(0x08B1, 0x4A6E, iwl7260_2ac_cfg_high_temp)},
278294 {IWL_PCI_DEVICE(0x08B1, 0x4A6C, iwl7260_2ac_cfg_high_temp)},
295+ {IWL_PCI_DEVICE(0x08B1, 0x4570, iwl7260_2ac_cfg)},
296+ {IWL_PCI_DEVICE(0x08B1, 0x4560, iwl7260_2n_cfg)},
297+ {IWL_PCI_DEVICE(0x08B2, 0x4370, iwl7260_2ac_cfg)},
298+ {IWL_PCI_DEVICE(0x08B2, 0x4360, iwl7260_2n_cfg)},
299+ {IWL_PCI_DEVICE(0x08B1, 0x5070, iwl7260_2ac_cfg)},
279300 {IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)},
301+ {IWL_PCI_DEVICE(0x08B1, 0x402A, iwl7260_2n_cfg)},
280302 {IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)},
281303 {IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)},
282304 {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)},
305+ {IWL_PCI_DEVICE(0x08B1, 0xC072, iwl7260_2ac_cfg)},
283306 {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)},
284307 {IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)},
308+ {IWL_PCI_DEVICE(0x08B1, 0xC06A, iwl7260_2n_cfg)},
285309 {IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)},
286310 {IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)},
287311 {IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)},
312+ {IWL_PCI_DEVICE(0x08B1, 0xC770, iwl7260_2ac_cfg)},
313+ {IWL_PCI_DEVICE(0x08B1, 0xC760, iwl7260_2n_cfg)},
288314 {IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)},
315+ {IWL_PCI_DEVICE(0x08B2, 0xC272, iwl7260_2ac_cfg)},
289316 {IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)},
317+ {IWL_PCI_DEVICE(0x08B2, 0xC26A, iwl7260_n_cfg)},
290318 {IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)},
291319 {IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)},
320+ {IWL_PCI_DEVICE(0x08B1, 0xC472, iwl7260_2ac_cfg)},
292321 {IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)},
293322 {IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)},
323+ {IWL_PCI_DEVICE(0x08B1, 0xC570, iwl7260_2ac_cfg)},
324+ {IWL_PCI_DEVICE(0x08B1, 0xC560, iwl7260_2n_cfg)},
325+ {IWL_PCI_DEVICE(0x08B2, 0xC370, iwl7260_2ac_cfg)},
326+ {IWL_PCI_DEVICE(0x08B1, 0xC360, iwl7260_2n_cfg)},
294327 {IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)},
328+ {IWL_PCI_DEVICE(0x08B1, 0xC02A, iwl7260_2n_cfg)},
295329 {IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)},
296330 {IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)},
297331
298332 /* 3160 Series */
299333 {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)},
334+ {IWL_PCI_DEVICE(0x08B3, 0x0072, iwl3160_2ac_cfg)},
300335 {IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)},
336+ {IWL_PCI_DEVICE(0x08B3, 0x0172, iwl3160_2ac_cfg)},
301337 {IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)},
302338 {IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)},
303339 {IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)},
340+ {IWL_PCI_DEVICE(0x08B4, 0x0272, iwl3160_2ac_cfg)},
304341 {IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)},
342+ {IWL_PCI_DEVICE(0x08B3, 0x0472, iwl3160_2ac_cfg)},
343+ {IWL_PCI_DEVICE(0x08B4, 0x0370, iwl3160_2ac_cfg)},
305344 {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)},
345+ {IWL_PCI_DEVICE(0x08B3, 0x8072, iwl3160_2ac_cfg)},
306346 {IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)},
347+ {IWL_PCI_DEVICE(0x08B3, 0x8172, iwl3160_2ac_cfg)},
307348 {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)},
308349 {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)},
309350 {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)},
310351 {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)},
352+ {IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)},
311353 #endif /* CONFIG_IWLMVM */
312354
313355 {0}
drivers/net/wireless/iwlwifi/pcie/tx.c+2−0
@@ -1102,6 +1102,8 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo, · 1101 unmodified lines
11021102 * non-AGG queue.
11031103 */
11041104 iwl_clear_bits_prph(trans, SCD_AGGR_SEL, BIT(txq_id));
1105+
1106+ ssn = trans_pcie->txq[txq_id].q.read_ptr;
11051107 }
11061108
11071109 /* Place first TFD at index corresponding to start sequence number.
drivers/net/wireless/mwifiex/join.c+8−2
@@ -1422,13 +1422,19 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) · 1421 unmodified lines
14221422 */
14231423 int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac)
14241424 {
1425+ int ret = 0;
1426+
14251427 if (!priv->media_connected)
14261428 return 0;
14271429
14281430 switch (priv->bss_mode) {
14291431 case NL80211_IFTYPE_STATION:
14301432 case NL80211_IFTYPE_P2P_CLIENT:
1431− return mwifiex_deauthenticate_infra(priv, mac);
1433+ ret = mwifiex_deauthenticate_infra(priv, mac);
1434+ if (ret)
1435+ cfg80211_disconnected(priv->netdev, 0, NULL, 0,
1436+ GFP_KERNEL);
1437+ break;
14321438 case NL80211_IFTYPE_ADHOC:
14331439 return mwifiex_send_cmd_sync(priv,
14341440 HostCmd_CMD_802_11_AD_HOC_STOP,
@@ -1440,7 +1446,7 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) · 5 unmodified lines
14401446 break;
14411447 }
14421448
1443− return 0;
1449+ return ret;
14441450 }
14451451 EXPORT_SYMBOL_GPL(mwifiex_deauthenticate);
14461452
drivers/net/wireless/mwifiex/sta_event.c+2−1
@@ -118,7 +118,8 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code) · 117 unmodified lines
118118 dev_dbg(adapter->dev,
119119 "info: successfully disconnected from %pM: reason code %d\n",
120120 priv->cfg_bssid, reason_code);
121− if (priv->bss_mode == NL80211_IFTYPE_STATION) {
121+ if (priv->bss_mode == NL80211_IFTYPE_STATION ||
122+ priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
122123 cfg80211_disconnected(priv->netdev, reason_code, NULL, 0,
123124 GFP_KERNEL);
124125 }
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c+2−1
@@ -343,7 +343,8 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, · 342 unmodified lines
343343 (bool)GET_RX_DESC_PAGGR(pdesc));
344344 rx_status->mactime = GET_RX_DESC_TSFL(pdesc);
345345 if (phystatus) {
346− p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE);
346+ p_drvinfo = (struct rx_fwinfo_92c *)(skb->data +
347+ stats->rx_bufshift);
347348 rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc,
348349 p_drvinfo);
349350 }
drivers/of/Kconfig+0−6
@@ -74,10 +74,4 @@ config OF_MTD · 73 unmodified lines
7474 depends on MTD
7575 def_bool y
7676
77−config OF_RESERVED_MEM
78− depends on OF_FLATTREE && (DMA_CMA || (HAVE_GENERIC_DMA_COHERENT && HAVE_MEMBLOCK))
79− def_bool y
80− help
81− Initialization code for DMA reserved memory
82−
8377 endmenu # OF
drivers/of/Makefile+0−1
@@ -9,4 +9,3 @@ obj-$(CONFIG_OF_MDIO) += of_mdio.o · 8 unmodified lines
99 obj-$(CONFIG_OF_PCI) += of_pci.o
1010 obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o
1111 obj-$(CONFIG_OF_MTD) += of_mtd.o
12−obj-$(CONFIG_OF_RESERVED_MEM) += of_reserved_mem.o
drivers/of/base.c+1−3
@@ -303,10 +303,8 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) · 302 unmodified lines
303303 struct device_node *cpun, *cpus;
304304
305305 cpus = of_find_node_by_path("/cpus");
306− if (!cpus) {
307− pr_warn("Missing cpus node, bailing out\n");
306+ if (!cpus)
308307 return NULL;
309− }
310308
311309 for_each_child_of_node(cpus, cpun) {
312310 if (of_node_cmp(cpun->type, "cpu"))
drivers/of/fdt.c+0−12
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 #include <linux/string.h>
1919 #include <linux/errno.h>
2020 #include <linux/slab.h>
21−#include <linux/random.h>
2221
2322 #include <asm/setup.h> /* for COMMAND_LINE_SIZE */
2423 #ifdef CONFIG_PPC
@@ -803,14 +802,3 @@ void __init unflatten_device_tree(void) · 778 unmodified lines
803802 }
804803
805804 #endif /* CONFIG_OF_EARLY_FLATTREE */
806−
807−/* Feed entire flattened device tree into the random pool */
808−static int __init add_fdt_randomness(void)
809−{
810− if (initial_boot_params)
811− add_device_randomness(initial_boot_params,
812− be32_to_cpu(initial_boot_params->totalsize));
813−
814− return 0;
815−}
816−core_initcall(add_fdt_randomness);
drivers/of/of_reserved_mem.c+0−173
@@ -1,173 +0,0 @@
1−/*
2− * Device tree based initialization code for reserved memory.
3− *
4− * Copyright (c) 2013 Samsung Electronics Co., Ltd.
5− * http://www.samsung.com
6− * Author: Marek Szyprowski <m.szyprowski@samsung.com>
7− *
8− * This program is free software; you can redistribute it and/or
9− * modify it under the terms of the GNU General Public License as
10− * published by the Free Software Foundation; either version 2 of the
11− * License or (at your optional) any later version of the license.
12− */
13−
14−#include <linux/memblock.h>
15−#include <linux/err.h>
16−#include <linux/of.h>
17−#include <linux/of_fdt.h>
18−#include <linux/of_platform.h>
19−#include <linux/mm.h>
20−#include <linux/sizes.h>
21−#include <linux/mm_types.h>
22−#include <linux/dma-contiguous.h>
23−#include <linux/dma-mapping.h>
24−#include <linux/of_reserved_mem.h>
25−
26−#define MAX_RESERVED_REGIONS 16
27−struct reserved_mem {
28− phys_addr_t base;
29− unsigned long size;
30− struct cma *cma;
31− char name[32];
32−};
33−static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
34−static int reserved_mem_count;
35−
36−static int __init fdt_scan_reserved_mem(unsigned long node, const char *uname,
37− int depth, void *data)
38−{
39− struct reserved_mem *rmem = &reserved_mem[reserved_mem_count];
40− phys_addr_t base, size;
41− int is_cma, is_reserved;
42− unsigned long len;
43− const char *status;
44− __be32 *prop;
45−
46− is_cma = IS_ENABLED(CONFIG_DMA_CMA) &&
47− of_flat_dt_is_compatible(node, "linux,contiguous-memory-region");
48− is_reserved = of_flat_dt_is_compatible(node, "reserved-memory-region");
49−
50− if (!is_reserved && !is_cma) {
51− /* ignore node and scan next one */
52− return 0;
53− }
54−
55− status = of_get_flat_dt_prop(node, "status", &len);
56− if (status && strcmp(status, "okay") != 0) {
57− /* ignore disabled node nad scan next one */
58− return 0;
59− }
60−
61− prop = of_get_flat_dt_prop(node, "reg", &len);
62− if (!prop || (len < (dt_root_size_cells + dt_root_addr_cells) *
63− sizeof(__be32))) {
64− pr_err("Reserved mem: node %s, incorrect \"reg\" property\n",
65− uname);
66− /* ignore node and scan next one */
67− return 0;
68− }
69− base = dt_mem_next_cell(dt_root_addr_cells, &prop);
70− size = dt_mem_next_cell(dt_root_size_cells, &prop);
71−
72− if (!size) {
73− /* ignore node and scan next one */
74− return 0;
75− }
76−
77− pr_info("Reserved mem: found %s, memory base %lx, size %ld MiB\n",
78− uname, (unsigned long)base, (unsigned long)size / SZ_1M);
79−
80− if (reserved_mem_count == ARRAY_SIZE(reserved_mem))
81− return -ENOSPC;
82−
83− rmem->base = base;
84− rmem->size = size;
85− strlcpy(rmem->name, uname, sizeof(rmem->name));
86−
87− if (is_cma) {
88− struct cma *cma;
89− if (dma_contiguous_reserve_area(size, base, 0, &cma) == 0) {
90− rmem->cma = cma;
91− reserved_mem_count++;
92− if (of_get_flat_dt_prop(node,
93− "linux,default-contiguous-region",
94− NULL))
95− dma_contiguous_set_default(cma);
96− }
97− } else if (is_reserved) {
98− if (memblock_remove(base, size) == 0)
99− reserved_mem_count++;
100− else
101− pr_err("Failed to reserve memory for %s\n", uname);
102− }
103−
104− return 0;
105−}
106−
107−static struct reserved_mem *get_dma_memory_region(struct device *dev)
108−{
109− struct device_node *node;
110− const char *name;
111− int i;
112−
113− node = of_parse_phandle(dev->of_node, "memory-region", 0);
114− if (!node)
115− return NULL;
116−
117− name = kbasename(node->full_name);
118− for (i = 0; i < reserved_mem_count; i++)
119− if (strcmp(name, reserved_mem[i].name) == 0)
120− return &reserved_mem[i];
121− return NULL;
122−}
123−
124−/**
125− * of_reserved_mem_device_init() - assign reserved memory region to given device
126− *
127− * This function assign memory region pointed by "memory-region" device tree
128− * property to the given device.
129− */
130−void of_reserved_mem_device_init(struct device *dev)
131−{
132− struct reserved_mem *region = get_dma_memory_region(dev);
133− if (!region)
134− return;
135−
136− if (region->cma) {
137− dev_set_cma_area(dev, region->cma);
138− pr_info("Assigned CMA %s to %s device\n", region->name,
139− dev_name(dev));
140− } else {
141− if (dma_declare_coherent_memory(dev, region->base, region->base,
142− region->size, DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) != 0)
143− pr_info("Declared reserved memory %s to %s device\n",
144− region->name, dev_name(dev));
145− }
146−}
147−
148−/**
149− * of_reserved_mem_device_release() - release reserved memory device structures
150− *
151− * This function releases structures allocated for memory region handling for
152− * the given device.
153− */
154−void of_reserved_mem_device_release(struct device *dev)
155−{
156− struct reserved_mem *region = get_dma_memory_region(dev);
157− if (!region && !region->cma)
158− dma_release_declared_memory(dev);
159−}
160−
161−/**
162− * early_init_dt_scan_reserved_mem() - create reserved memory regions
163− *
164− * This function grabs memory from early allocator for device exclusive use
165− * defined in device tree structures. It should be called by arch specific code
166− * once the early allocator (memblock) has been activated and all other
167− * subsystems have already allocated/reserved memory.
168− */
169−void __init early_init_dt_scan_reserved_mem(void)
170−{
171− of_scan_flat_dt_by_path("/memory/reserved-memory",
172− fdt_scan_reserved_mem, NULL);
173−}
drivers/of/platform.c+0−4
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 #include <linux/of_device.h>
2222 #include <linux/of_irq.h>
2323 #include <linux/of_platform.h>
24−#include <linux/of_reserved_mem.h>
2524 #include <linux/platform_device.h>
2625
2726 const struct of_device_id of_default_bus_match_table[] = {
@@ -219,8 +218,6 @@ static struct platform_device *of_platform_device_create_pdata( · 191 unmodified lines
219218 dev->dev.bus = &platform_bus_type;
220219 dev->dev.platform_data = platform_data;
221220
222− of_reserved_mem_device_init(&dev->dev);
223−
224221 /* We do not fill the DMA ops for platform devices by default.
225222 * This is currently the responsibility of the platform code
226223 * to do such, possibly using a device notifier
@@ -228,7 +225,6 @@ static struct platform_device *of_platform_device_create_pdata( · 1 unmodified line
228225
229226 if (of_device_add(dev) != 0) {
230227 platform_device_put(dev);
231− of_reserved_mem_device_release(&dev->dev);
232228 return NULL;
233229 }
234230
drivers/pci/hotplug/acpiphp_glue.c+5−3
@@ -994,14 +994,16 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) · 993 unmodified lines
994994
995995 /*
996996 * This bridge should have been registered as a hotplug function
997− * under its parent, so the context has to be there. If not, we
998− * are in deep goo.
997+ * under its parent, so the context should be there, unless the
998+ * parent is going to be handled by pciehp, in which case this
999+ * bridge is not interesting to us either.
9991000 */
10001001 mutex_lock(&acpiphp_context_lock);
10011002 context = acpiphp_get_context(handle);
1002− if (WARN_ON(!context)) {
1003+ if (!context) {
10031004 mutex_unlock(&acpiphp_context_lock);
10041005 put_device(&bus->dev);
1006+ pci_dev_put(bridge->pci_dev);
10051007 kfree(bridge);
10061008 return;
10071009 }
drivers/pinctrl/pinconf.c+2−2
@@ -490,7 +490,7 @@ exit: · 489 unmodified lines
490490 * <devicename> <state> <pinname> are values that should match the pinctrl-maps
491491 * <newvalue> reflects the new config and is driver dependant
492492 */
493−static int pinconf_dbg_config_write(struct file *file,
493+static ssize_t pinconf_dbg_config_write(struct file *file,
494494 const char __user *user_buf, size_t count, loff_t *ppos)
495495 {
496496 struct pinctrl_maps *maps_node;
@@ -508,7 +508,7 @@ static int pinconf_dbg_config_write(struct file *file, · 11 unmodified lines
508508 int i;
509509
510510 /* Get userspace string and assure termination */
511− buf_size = min(count, (size_t)(sizeof(buf)-1));
511+ buf_size = min(count, sizeof(buf) - 1);
512512 if (copy_from_user(buf, user_buf, buf_size))
513513 return -EFAULT;
514514 buf[buf_size] = 0;
drivers/pinctrl/pinctrl-exynos.c+6−6
@@ -663,18 +663,18 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) · 662 unmodified lines
663663 /* pin banks of s5pv210 pin-controller */
664664 static struct samsung_pin_bank s5pv210_pin_bank[] = {
665665 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
666− EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
666+ EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04),
667667 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
668668 EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpc0", 0x0c),
669669 EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpc1", 0x10),
670670 EXYNOS_PIN_BANK_EINTG(4, 0x0a0, "gpd0", 0x14),
671− EXYNOS_PIN_BANK_EINTG(4, 0x0c0, "gpd1", 0x18),
672− EXYNOS_PIN_BANK_EINTG(5, 0x0e0, "gpe0", 0x1c),
673− EXYNOS_PIN_BANK_EINTG(8, 0x100, "gpe1", 0x20),
674− EXYNOS_PIN_BANK_EINTG(6, 0x120, "gpf0", 0x24),
671+ EXYNOS_PIN_BANK_EINTG(6, 0x0c0, "gpd1", 0x18),
672+ EXYNOS_PIN_BANK_EINTG(8, 0x0e0, "gpe0", 0x1c),
673+ EXYNOS_PIN_BANK_EINTG(5, 0x100, "gpe1", 0x20),
674+ EXYNOS_PIN_BANK_EINTG(8, 0x120, "gpf0", 0x24),
675675 EXYNOS_PIN_BANK_EINTG(8, 0x140, "gpf1", 0x28),
676676 EXYNOS_PIN_BANK_EINTG(8, 0x160, "gpf2", 0x2c),
677− EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpf3", 0x30),
677+ EXYNOS_PIN_BANK_EINTG(6, 0x180, "gpf3", 0x30),
678678 EXYNOS_PIN_BANK_EINTG(7, 0x1a0, "gpg0", 0x34),
679679 EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38),
680680 EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c),
drivers/pinctrl/pinctrl-palmas.c+3−2
@@ -891,9 +891,10 @@ static int palmas_pinconf_set(struct pinctrl_dev *pctldev, · 890 unmodified lines
891891 param = pinconf_to_config_param(configs[i]);
892892 param_val = pinconf_to_config_argument(configs[i]);
893893
894+ if (param == PIN_CONFIG_BIAS_PULL_PIN_DEFAULT)
895+ continue;
896+
894897 switch (param) {
895− case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
896− return 0;
897898 case PIN_CONFIG_BIAS_DISABLE:
898899 case PIN_CONFIG_BIAS_PULL_UP:
899900 case PIN_CONFIG_BIAS_PULL_DOWN:
drivers/pinctrl/pinctrl-tegra114.c+2−3
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
55 *
6− * Arthur: Pritesh Raithatha <praithatha@nvidia.com>
6+ * Author: Pritesh Raithatha <praithatha@nvidia.com>
77 *
88 * This program is free software; you can redistribute it and/or modify it
99 * under the terms and conditions of the GNU General Public License,
@@ -2763,7 +2763,6 @@ static struct platform_driver tegra114_pinctrl_driver = { · 2753 unmodified lines
27632763 };
27642764 module_platform_driver(tegra114_pinctrl_driver);
27652765
2766−MODULE_ALIAS("platform:tegra114-pinctrl");
27672766 MODULE_AUTHOR("Pritesh Raithatha <praithatha@nvidia.com>");
2768−MODULE_DESCRIPTION("NVIDIA Tegra114 pincontrol driver");
2767+MODULE_DESCRIPTION("NVIDIA Tegra114 pinctrl driver");
27692768 MODULE_LICENSE("GPL v2");
drivers/platform/x86/Kconfig+1−0
@@ -504,6 +504,7 @@ config ASUS_WMI · 503 unmodified lines
504504 depends on BACKLIGHT_CLASS_DEVICE
505505 depends on RFKILL || RFKILL = n
506506 depends on HOTPLUG_PCI
507+ depends on ACPI_VIDEO || ACPI_VIDEO = n
507508 select INPUT_SPARSEKMAP
508509 select LEDS_CLASS
509510 select NEW_LEDS
drivers/platform/x86/sony-laptop.c+9−17
@@ -127,18 +127,17 @@ MODULE_PARM_DESC(minor, · 126 unmodified lines
127127 "default is -1 (automatic)");
128128 #endif
129129
130−static int kbd_backlight = 1;
130+static int kbd_backlight = -1;
131131 module_param(kbd_backlight, int, 0444);
132132 MODULE_PARM_DESC(kbd_backlight,
133133 "set this to 0 to disable keyboard backlight, "
134− "1 to enable it (default: 0)");
134+ "1 to enable it (default: no change from current value)");
135135
136−static int kbd_backlight_timeout; /* = 0 */
136+static int kbd_backlight_timeout = -1;
137137 module_param(kbd_backlight_timeout, int, 0444);
138138 MODULE_PARM_DESC(kbd_backlight_timeout,
139− "set this to 0 to set the default 10 seconds timeout, "
140− "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout "
141− "(default: 0)");
139+ "meaningful values vary from 0 to 3 and their meaning depends "
140+ "on the model (default: no change from current value)");
142141
143142 #ifdef CONFIG_PM_SLEEP
144143 static void sony_nc_kbd_backlight_resume(void);
@@ -1844,6 +1843,8 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd, · 1699 unmodified lines
18441843 if (!kbdbl_ctl)
18451844 return -ENOMEM;
18461845
1846+ kbdbl_ctl->mode = kbd_backlight;
1847+ kbdbl_ctl->timeout = kbd_backlight_timeout;
18471848 kbdbl_ctl->handle = handle;
18481849 if (handle == 0x0137)
18491850 kbdbl_ctl->base = 0x0C00;
@@ -1870,8 +1871,8 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd, · 20 unmodified lines
18701871 if (ret)
18711872 goto outmode;
18721873
1873− __sony_nc_kbd_backlight_mode_set(kbd_backlight);
1874− __sony_nc_kbd_backlight_timeout_set(kbd_backlight_timeout);
1874+ __sony_nc_kbd_backlight_mode_set(kbdbl_ctl->mode);
1875+ __sony_nc_kbd_backlight_timeout_set(kbdbl_ctl->timeout);
18751876
18761877 return 0;
18771878
@@ -1886,17 +1887,8 @@ outkzalloc: · 8 unmodified lines
18861887 static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd)
18871888 {
18881889 if (kbdbl_ctl) {
1889− int result;
1890−
18911890 device_remove_file(&pd->dev, &kbdbl_ctl->mode_attr);
18921891 device_remove_file(&pd->dev, &kbdbl_ctl->timeout_attr);
1893−
1894− /* restore the default hw behaviour */
1895− sony_call_snc_handle(kbdbl_ctl->handle,
1896− kbdbl_ctl->base | 0x10000, &result);
1897− sony_call_snc_handle(kbdbl_ctl->handle,
1898− kbdbl_ctl->base + 0x200, &result);
1899−
19001892 kfree(kbdbl_ctl);
19011893 kbdbl_ctl = NULL;
19021894 }
drivers/s390/block/dasd_eckd.c+71−27
@@ -2077,6 +2077,7 @@ dasd_eckd_build_format(struct dasd_device *base, · 2076 unmodified lines
20772077 int intensity = 0;
20782078 int r0_perm;
20792079 int nr_tracks;
2080+ int use_prefix;
20802081
20812082 startdev = dasd_alias_get_start_dev(base);
20822083 if (!startdev)
@@ -2106,28 +2107,46 @@ dasd_eckd_build_format(struct dasd_device *base, · 23 unmodified lines
21062107 intensity = fdata->intensity;
21072108 }
21082109
2110+ use_prefix = base_priv->features.feature[8] & 0x01;
2111+
21092112 switch (intensity) {
21102113 case 0x00: /* Normal format */
21112114 case 0x08: /* Normal format, use cdl. */
21122115 cplength = 2 + (rpt*nr_tracks);
2113− datasize = sizeof(struct PFX_eckd_data) +
2114− sizeof(struct LO_eckd_data) +
2115− rpt * nr_tracks * sizeof(struct eckd_count);
2116+ if (use_prefix)
2117+ datasize = sizeof(struct PFX_eckd_data) +
2118+ sizeof(struct LO_eckd_data) +
2119+ rpt * nr_tracks * sizeof(struct eckd_count);
2120+ else
2121+ datasize = sizeof(struct DE_eckd_data) +
2122+ sizeof(struct LO_eckd_data) +
2123+ rpt * nr_tracks * sizeof(struct eckd_count);
21162124 break;
21172125 case 0x01: /* Write record zero and format track. */
21182126 case 0x09: /* Write record zero and format track, use cdl. */
21192127 cplength = 2 + rpt * nr_tracks;
2120− datasize = sizeof(struct PFX_eckd_data) +
2121− sizeof(struct LO_eckd_data) +
2122− sizeof(struct eckd_count) +
2123− rpt * nr_tracks * sizeof(struct eckd_count);
2128+ if (use_prefix)
2129+ datasize = sizeof(struct PFX_eckd_data) +
2130+ sizeof(struct LO_eckd_data) +
2131+ sizeof(struct eckd_count) +
2132+ rpt * nr_tracks * sizeof(struct eckd_count);
2133+ else
2134+ datasize = sizeof(struct DE_eckd_data) +
2135+ sizeof(struct LO_eckd_data) +
2136+ sizeof(struct eckd_count) +
2137+ rpt * nr_tracks * sizeof(struct eckd_count);
21242138 break;
21252139 case 0x04: /* Invalidate track. */
21262140 case 0x0c: /* Invalidate track, use cdl. */
21272141 cplength = 3;
2128− datasize = sizeof(struct PFX_eckd_data) +
2129− sizeof(struct LO_eckd_data) +
2130− sizeof(struct eckd_count);
2142+ if (use_prefix)
2143+ datasize = sizeof(struct PFX_eckd_data) +
2144+ sizeof(struct LO_eckd_data) +
2145+ sizeof(struct eckd_count);
2146+ else
2147+ datasize = sizeof(struct DE_eckd_data) +
2148+ sizeof(struct LO_eckd_data) +
2149+ sizeof(struct eckd_count);
21312150 break;
21322151 default:
21332152 dev_warn(&startdev->cdev->dev,
@@ -2147,14 +2166,25 @@ dasd_eckd_build_format(struct dasd_device *base, · 13 unmodified lines
21472166
21482167 switch (intensity & ~0x08) {
21492168 case 0x00: /* Normal format. */
2150− prefix(ccw++, (struct PFX_eckd_data *) data,
2151− fdata->start_unit, fdata->stop_unit,
2152− DASD_ECKD_CCW_WRITE_CKD, base, startdev);
2153− /* grant subsystem permission to format R0 */
2154− if (r0_perm)
2155− ((struct PFX_eckd_data *)data)
2156− ->define_extent.ga_extended |= 0x04;
2157− data += sizeof(struct PFX_eckd_data);
2169+ if (use_prefix) {
2170+ prefix(ccw++, (struct PFX_eckd_data *) data,
2171+ fdata->start_unit, fdata->stop_unit,
2172+ DASD_ECKD_CCW_WRITE_CKD, base, startdev);
2173+ /* grant subsystem permission to format R0 */
2174+ if (r0_perm)
2175+ ((struct PFX_eckd_data *)data)
2176+ ->define_extent.ga_extended |= 0x04;
2177+ data += sizeof(struct PFX_eckd_data);
2178+ } else {
2179+ define_extent(ccw++, (struct DE_eckd_data *) data,
2180+ fdata->start_unit, fdata->stop_unit,
2181+ DASD_ECKD_CCW_WRITE_CKD, startdev);
2182+ /* grant subsystem permission to format R0 */
2183+ if (r0_perm)
2184+ ((struct DE_eckd_data *) data)
2185+ ->ga_extended |= 0x04;
2186+ data += sizeof(struct DE_eckd_data);
2187+ }
21582188 ccw[-1].flags |= CCW_FLAG_CC;
21592189 locate_record(ccw++, (struct LO_eckd_data *) data,
21602190 fdata->start_unit, 0, rpt*nr_tracks,
@@ -2163,11 +2193,18 @@ dasd_eckd_build_format(struct dasd_device *base, · 2 unmodified lines
21632193 data += sizeof(struct LO_eckd_data);
21642194 break;
21652195 case 0x01: /* Write record zero + format track. */
2166− prefix(ccw++, (struct PFX_eckd_data *) data,
2167− fdata->start_unit, fdata->stop_unit,
2168− DASD_ECKD_CCW_WRITE_RECORD_ZERO,
2169− base, startdev);
2170− data += sizeof(struct PFX_eckd_data);
2196+ if (use_prefix) {
2197+ prefix(ccw++, (struct PFX_eckd_data *) data,
2198+ fdata->start_unit, fdata->stop_unit,
2199+ DASD_ECKD_CCW_WRITE_RECORD_ZERO,
2200+ base, startdev);
2201+ data += sizeof(struct PFX_eckd_data);
2202+ } else {
2203+ define_extent(ccw++, (struct DE_eckd_data *) data,
2204+ fdata->start_unit, fdata->stop_unit,
2205+ DASD_ECKD_CCW_WRITE_RECORD_ZERO, startdev);
2206+ data += sizeof(struct DE_eckd_data);
2207+ }
21712208 ccw[-1].flags |= CCW_FLAG_CC;
21722209 locate_record(ccw++, (struct LO_eckd_data *) data,
21732210 fdata->start_unit, 0, rpt * nr_tracks + 1,
@@ -2176,10 +2213,17 @@ dasd_eckd_build_format(struct dasd_device *base, · 2 unmodified lines
21762213 data += sizeof(struct LO_eckd_data);
21772214 break;
21782215 case 0x04: /* Invalidate track. */
2179− prefix(ccw++, (struct PFX_eckd_data *) data,
2180− fdata->start_unit, fdata->stop_unit,
2181− DASD_ECKD_CCW_WRITE_CKD, base, startdev);
2182− data += sizeof(struct PFX_eckd_data);
2216+ if (use_prefix) {
2217+ prefix(ccw++, (struct PFX_eckd_data *) data,
2218+ fdata->start_unit, fdata->stop_unit,
2219+ DASD_ECKD_CCW_WRITE_CKD, base, startdev);
2220+ data += sizeof(struct PFX_eckd_data);
2221+ } else {
2222+ define_extent(ccw++, (struct DE_eckd_data *) data,
2223+ fdata->start_unit, fdata->stop_unit,
2224+ DASD_ECKD_CCW_WRITE_CKD, startdev);
2225+ data += sizeof(struct DE_eckd_data);
2226+ }
21832227 ccw[-1].flags |= CCW_FLAG_CC;
21842228 locate_record(ccw++, (struct LO_eckd_data *) data,
21852229 fdata->start_unit, 0, 1,
drivers/s390/char/sclp.c+2−2
@@ -486,7 +486,7 @@ sclp_sync_wait(void) · 485 unmodified lines
486486 timeout = 0;
487487 if (timer_pending(&sclp_request_timer)) {
488488 /* Get timeout TOD value */
489− timeout = get_tod_clock() +
489+ timeout = get_tod_clock_fast() +
490490 sclp_tod_from_jiffies(sclp_request_timer.expires -
491491 jiffies);
492492 }
@@ -508,7 +508,7 @@ sclp_sync_wait(void) · 15 unmodified lines
508508 while (sclp_running_state != sclp_running_state_idle) {
509509 /* Check for expired request timer */
510510 if (timer_pending(&sclp_request_timer) &&
511− get_tod_clock() > timeout &&
511+ get_tod_clock_fast() > timeout &&
512512 del_timer(&sclp_request_timer))
513513 sclp_request_timer.function(sclp_request_timer.data);
514514 cpu_relax();
drivers/s390/char/sclp_cmd.c+5−3
@@ -145,9 +145,11 @@ bool __init sclp_has_linemode(void) · 144 unmodified lines
145145
146146 if (sccb->header.response_code != 0x20)
147147 return 0;
148− if (sccb->sclp_send_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK))
149− return 1;
150− return 0;
148+ if (!(sccb->sclp_send_mask & (EVTYP_OPCMD_MASK | EVTYP_PMSGCMD_MASK)))
149+ return 0;
150+ if (!(sccb->sclp_receive_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK)))
151+ return 0;
152+ return 1;
151153 }
152154
153155 bool __init sclp_has_vt220(void)
drivers/s390/char/tty3270.c+1−1
@@ -810,7 +810,7 @@ static void tty3270_resize_work(struct work_struct *work) · 809 unmodified lines
810810 struct winsize ws;
811811
812812 screen = tty3270_alloc_screen(tp->n_rows, tp->n_cols);
813− if (!screen)
813+ if (IS_ERR(screen))
814814 return;
815815 /* Switch to new output size */
816816 spin_lock_bh(&tp->view.lock);
drivers/s390/char/vmlogrdr.c+1−1
@@ -313,7 +313,7 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp) · 312 unmodified lines
313313 int ret;
314314
315315 dev_num = iminor(inode);
316− if (dev_num > MAXMINOR)
316+ if (dev_num >= MAXMINOR)
317317 return -ENODEV;
318318 logptr = &sys_ser[dev_num];
319319
drivers/s390/cio/cio.c+2−2
@@ -878,9 +878,9 @@ static void css_reset(void) · 877 unmodified lines
878878 atomic_inc(&chpid_reset_count);
879879 }
880880 /* Wait for machine check for all channel paths. */
881− timeout = get_tod_clock() + (RCHP_TIMEOUT << 12);
881+ timeout = get_tod_clock_fast() + (RCHP_TIMEOUT << 12);
882882 while (atomic_read(&chpid_reset_count) != 0) {
883− if (get_tod_clock() > timeout)
883+ if (get_tod_clock_fast() > timeout)
884884 break;
885885 cpu_relax();
886886 }
drivers/s390/cio/qdio_main.c+5−5
@@ -338,10 +338,10 @@ again: · 337 unmodified lines
338338 retries++;
339339
340340 if (!start_time) {
341− start_time = get_tod_clock();
341+ start_time = get_tod_clock_fast();
342342 goto again;
343343 }
344− if ((get_tod_clock() - start_time) < QDIO_BUSY_BIT_PATIENCE)
344+ if (get_tod_clock_fast() - start_time < QDIO_BUSY_BIT_PATIENCE)
345345 goto again;
346346 }
347347 if (retries) {
@@ -504,7 +504,7 @@ static int get_inbound_buffer_frontier(struct qdio_q *q) · 156 unmodified lines
504504 int count, stop;
505505 unsigned char state = 0;
506506
507− q->timestamp = get_tod_clock();
507+ q->timestamp = get_tod_clock_fast();
508508
509509 /*
510510 * Don't check 128 buffers, as otherwise qdio_inbound_q_moved
@@ -595,7 +595,7 @@ static inline int qdio_inbound_q_done(struct qdio_q *q) · 84 unmodified lines
595595 * At this point we know, that inbound first_to_check
596596 * has (probably) not moved (see qdio_inbound_processing).
597597 */
598− if (get_tod_clock() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) {
598+ if (get_tod_clock_fast() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) {
599599 DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%02x",
600600 q->first_to_check);
601601 return 1;
@@ -728,7 +728,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q) · 126 unmodified lines
728728 int count, stop;
729729 unsigned char state = 0;
730730
731− q->timestamp = get_tod_clock();
731+ q->timestamp = get_tod_clock_fast();
732732
733733 if (need_siga_sync(q))
734734 if (((queue_type(q) != QDIO_IQDIO_QFMT) &&
drivers/spi/spi-atmel.c+2−1
@@ -1583,7 +1583,7 @@ static int atmel_spi_probe(struct platform_device *pdev) · 1582 unmodified lines
15831583 /* Initialize the hardware */
15841584 ret = clk_prepare_enable(clk);
15851585 if (ret)
1586− goto out_unmap_regs;
1586+ goto out_free_irq;
15871587 spi_writel(as, CR, SPI_BIT(SWRST));
15881588 spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */
15891589 if (as->caps.has_wdrbt) {
@@ -1614,6 +1614,7 @@ out_free_dma: · 24 unmodified lines
16141614 spi_writel(as, CR, SPI_BIT(SWRST));
16151615 spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */
16161616 clk_disable_unprepare(clk);
1617+out_free_irq:
16171618 free_irq(irq, master);
16181619 out_unmap_regs:
16191620 iounmap(as->regs);
drivers/spi/spi-clps711x.c+0−3
@@ -226,7 +226,6 @@ static int spi_clps711x_probe(struct platform_device *pdev) · 225 unmodified lines
226226 dev_name(&pdev->dev), hw);
227227 if (ret) {
228228 dev_err(&pdev->dev, "Can't request IRQ\n");
229− clk_put(hw->spi_clk);
230229 goto clk_out;
231230 }
232231
@@ -247,7 +246,6 @@ err_out: · 14 unmodified lines
247246 gpio_free(hw->chipselect[i]);
248247
249248 spi_master_put(master);
250− kfree(master);
251249
252250 return ret;
253251 }
@@ -263,7 +261,6 @@ static int spi_clps711x_remove(struct platform_device *pdev) · 9 unmodified lines
263261 gpio_free(hw->chipselect[i]);
264262
265263 spi_unregister_master(master);
266− kfree(master);
267264
268265 return 0;
269266 }
drivers/spi/spi-fsl-dspi.c+2−8
@@ -476,15 +476,9 @@ static int dspi_probe(struct platform_device *pdev) · 475 unmodified lines
476476 master->bus_num = bus_num;
477477
478478 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
479− if (!res) {
480− dev_err(&pdev->dev, "can't get platform resource\n");
481− ret = -EINVAL;
482− goto out_master_put;
483− }
484−
485479 dspi->base = devm_ioremap_resource(&pdev->dev, res);
486− if (!dspi->base) {
487− ret = -EINVAL;
480+ if (IS_ERR(dspi->base)) {
481+ ret = PTR_ERR(dspi->base);
488482 goto out_master_put;
489483 }
490484
drivers/spi/spi-mpc512x-psc.c+3−1
@@ -522,8 +522,10 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, · 521 unmodified lines
522522 psc_num = master->bus_num;
523523 snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num);
524524 clk = devm_clk_get(dev, clk_name);
525− if (IS_ERR(clk))
525+ if (IS_ERR(clk)) {
526+ ret = PTR_ERR(clk);
526527 goto free_irq;
528+ }
527529 ret = clk_prepare_enable(clk);
528530 if (ret)
529531 goto free_irq;
drivers/spi/spi-pxa2xx.c+10−1
@@ -546,8 +546,17 @@ static irqreturn_t ssp_int(int irq, void *dev_id) · 545 unmodified lines
546546 if (pm_runtime_suspended(&drv_data->pdev->dev))
547547 return IRQ_NONE;
548548
549− sccr1_reg = read_SSCR1(reg);
549+ /*
550+ * If the device is not yet in RPM suspended state and we get an
551+ * interrupt that is meant for another device, check if status bits
552+ * are all set to one. That means that the device is already
553+ * powered off.
554+ */
550555 status = read_SSSR(reg);
556+ if (status == ~0)
557+ return IRQ_NONE;
558+
559+ sccr1_reg = read_SSCR1(reg);
551560
552561 /* Ignore possible writes if we don't need to write */
553562 if (!(sccr1_reg & SSCR1_TIE))
drivers/spi/spi-s3c64xx.c+2−2
@@ -1428,6 +1428,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) · 1427 unmodified lines
14281428 S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN,
14291429 sdd->regs + S3C64XX_SPI_INT_EN);
14301430
1431+ pm_runtime_enable(&pdev->dev);
1432+
14311433 if (spi_register_master(master)) {
14321434 dev_err(&pdev->dev, "cannot register SPI master\n");
14331435 ret = -EBUSY;
@@ -1440,8 +1442,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) · 6 unmodified lines
14401442 mem_res,
14411443 sdd->rx_dma.dmach, sdd->tx_dma.dmach);
14421444
1443− pm_runtime_enable(&pdev->dev);
1444−
14451445 return 0;
14461446
14471447 err3:
drivers/spi/spi-sh-hspi.c+2−2
@@ -296,6 +296,8 @@ static int hspi_probe(struct platform_device *pdev) · 295 unmodified lines
296296 goto error1;
297297 }
298298
299+ pm_runtime_enable(&pdev->dev);
300+
299301 master->num_chipselect = 1;
300302 master->bus_num = pdev->id;
301303 master->setup = hspi_setup;
@@ -309,8 +311,6 @@ static int hspi_probe(struct platform_device *pdev) · 7 unmodified lines
309311 goto error1;
310312 }
311313
312− pm_runtime_enable(&pdev->dev);
313−
314314 return 0;
315315
316316 error1:
drivers/staging/comedi/drivers/ni_65xx.c+10−15
@@ -369,28 +369,23 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, · 368 unmodified lines
369369 {
370370 const struct ni_65xx_board *board = comedi_board(dev);
371371 struct ni_65xx_private *devpriv = dev->private;
372− unsigned base_bitfield_channel;
373− const unsigned max_ports_per_bitfield = 5;
372+ int base_bitfield_channel;
374373 unsigned read_bits = 0;
375− unsigned j;
374+ int last_port_offset = ni_65xx_port_by_channel(s->n_chan - 1);
375+ int port_offset;
376376
377377 base_bitfield_channel = CR_CHAN(insn->chanspec);
378− for (j = 0; j < max_ports_per_bitfield; ++j) {
379− const unsigned port_offset =
380− ni_65xx_port_by_channel(base_bitfield_channel) + j;
381− const unsigned port =
382− sprivate(s)->base_port + port_offset;
383− unsigned base_port_channel;
378+ for (port_offset = ni_65xx_port_by_channel(base_bitfield_channel);
379+ port_offset <= last_port_offset; port_offset++) {
380+ unsigned port = sprivate(s)->base_port + port_offset;
381+ int base_port_channel = port_offset * ni_65xx_channels_per_port;
384382 unsigned port_mask, port_data, port_read_bits;
385− int bitshift;
386− if (port >= ni_65xx_total_num_ports(board))
383+ int bitshift = base_port_channel - base_bitfield_channel;
384+
385+ if (bitshift >= 32)
387386 break;
388− base_port_channel = port_offset * ni_65xx_channels_per_port;
389387 port_mask = data[0];
390388 port_data = data[1];
391− bitshift = base_port_channel - base_bitfield_channel;
392− if (bitshift >= 32 || bitshift <= -32)
393− break;
394389 if (bitshift > 0) {
395390 port_mask >>= bitshift;
396391 port_data >>= bitshift;
drivers/staging/media/msi3101/Kconfig+1−0
@@ -1,3 +1,4 @@
11 config USB_MSI3101
22 tristate "Mirics MSi3101 SDR Dongle"
33 depends on USB && VIDEO_DEV && VIDEO_V4L2
4+ select VIDEOBUF2_VMALLOC
drivers/staging/media/msi3101/sdr-msi3101.c+8−2
@@ -1131,7 +1131,13 @@ static int msi3101_queue_setup(struct vb2_queue *vq, · 1130 unmodified lines
11311131 /* Absolute min and max number of buffers available for mmap() */
11321132 *nbuffers = 32;
11331133 *nplanes = 1;
1134− sizes[0] = PAGE_ALIGN(3 * 3072); /* 3 * 768 * 4 */
1134+ /*
1135+ * 3, wMaxPacketSize 3x 1024 bytes
1136+ * 504, max IQ sample pairs per 1024 frame
1137+ * 2, two samples, I and Q
1138+ * 4, 32-bit float
1139+ */
1140+ sizes[0] = PAGE_ALIGN(3 * 504 * 2 * 4); /* = 12096 */
11351141 dev_dbg(&s->udev->dev, "%s: nbuffers=%d sizes[0]=%d\n",
11361142 __func__, *nbuffers, sizes[0]);
11371143 return 0;
@@ -1657,7 +1663,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, · 519 unmodified lines
16571663 f->frequency * 625UL / 10UL);
16581664 }
16591665
1660−const struct v4l2_ioctl_ops msi3101_ioctl_ops = {
1666+static const struct v4l2_ioctl_ops msi3101_ioctl_ops = {
16611667 .vidioc_querycap = msi3101_querycap,
16621668
16631669 .vidioc_enum_input = msi3101_enum_input,
drivers/target/iscsi/iscsi_target.c+9−4
@@ -753,7 +753,8 @@ static void iscsit_unmap_iovec(struct iscsi_cmd *cmd) · 752 unmodified lines
753753
754754 static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn)
755755 {
756− struct iscsi_cmd *cmd;
756+ LIST_HEAD(ack_list);
757+ struct iscsi_cmd *cmd, *cmd_p;
757758
758759 conn->exp_statsn = exp_statsn;
759760
@@ -761,19 +762,23 @@ static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn) · 1 unmodified line
761762 return;
762763
763764 spin_lock_bh(&conn->cmd_lock);
764− list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
765+ list_for_each_entry_safe(cmd, cmd_p, &conn->conn_cmd_list, i_conn_node) {
765766 spin_lock(&cmd->istate_lock);
766767 if ((cmd->i_state == ISTATE_SENT_STATUS) &&
767768 iscsi_sna_lt(cmd->stat_sn, exp_statsn)) {
768769 cmd->i_state = ISTATE_REMOVE;
769770 spin_unlock(&cmd->istate_lock);
770− iscsit_add_cmd_to_immediate_queue(cmd, conn,
771− cmd->i_state);
771+ list_move_tail(&cmd->i_conn_node, &ack_list);
772772 continue;
773773 }
774774 spin_unlock(&cmd->istate_lock);
775775 }
776776 spin_unlock_bh(&conn->cmd_lock);
777+
778+ list_for_each_entry_safe(cmd, cmd_p, &ack_list, i_conn_node) {
779+ list_del(&cmd->i_conn_node);
780+ iscsit_free_cmd(cmd, false);
781+ }
777782 }
778783
779784 static int iscsit_allocate_iovecs(struct iscsi_cmd *cmd)
drivers/target/iscsi/iscsi_target_nego.c+1−1
@@ -1192,7 +1192,7 @@ get_target: · 1191 unmodified lines
11921192 */
11931193 alloc_tags:
11941194 tag_num = max_t(u32, ISCSIT_MIN_TAGS, queue_depth);
1195− tag_num += ISCSIT_EXTRA_TAGS;
1195+ tag_num += (tag_num / 2) + ISCSIT_EXTRA_TAGS;
11961196 tag_size = sizeof(struct iscsi_cmd) + conn->conn_transport->priv_size;
11971197
11981198 ret = transport_alloc_session_tags(sess->se_sess, tag_num, tag_size);
drivers/target/iscsi/iscsi_target_util.c+2−2
@@ -736,7 +736,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) · 735 unmodified lines
736736 * Fallthrough
737737 */
738738 case ISCSI_OP_SCSI_TMFUNC:
739− rc = transport_generic_free_cmd(&cmd->se_cmd, 1);
739+ rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown);
740740 if (!rc && shutdown && se_cmd && se_cmd->se_sess) {
741741 __iscsit_free_cmd(cmd, true, shutdown);
742742 target_put_sess_cmd(se_cmd->se_sess, se_cmd);
@@ -752,7 +752,7 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) · 9 unmodified lines
752752 se_cmd = &cmd->se_cmd;
753753 __iscsit_free_cmd(cmd, true, shutdown);
754754
755− rc = transport_generic_free_cmd(&cmd->se_cmd, 1);
755+ rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown);
756756 if (!rc && shutdown && se_cmd->se_sess) {
757757 __iscsit_free_cmd(cmd, true, shutdown);
758758 target_put_sess_cmd(se_cmd->se_sess, se_cmd);
drivers/target/target_core_sbc.c+26−2
@@ -349,7 +349,16 @@ static sense_reason_t compare_and_write_post(struct se_cmd *cmd) · 348 unmodified lines
349349 {
350350 struct se_device *dev = cmd->se_dev;
351351
352− cmd->se_cmd_flags |= SCF_COMPARE_AND_WRITE_POST;
352+ /*
353+ * Only set SCF_COMPARE_AND_WRITE_POST to force a response fall-through
354+ * within target_complete_ok_work() if the command was successfully
355+ * sent to the backend driver.
356+ */
357+ spin_lock_irq(&cmd->t_state_lock);
358+ if ((cmd->transport_state & CMD_T_SENT) && !cmd->scsi_status)
359+ cmd->se_cmd_flags |= SCF_COMPARE_AND_WRITE_POST;
360+ spin_unlock_irq(&cmd->t_state_lock);
361+
353362 /*
354363 * Unlock ->caw_sem originally obtained during sbc_compare_and_write()
355364 * before the original READ I/O submission.
@@ -363,7 +372,7 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd) · 7 unmodified lines
363372 {
364373 struct se_device *dev = cmd->se_dev;
365374 struct scatterlist *write_sg = NULL, *sg;
366− unsigned char *buf, *addr;
375+ unsigned char *buf = NULL, *addr;
367376 struct sg_mapping_iter m;
368377 unsigned int offset = 0, len;
369378 unsigned int nlbas = cmd->t_task_nolb;
@@ -378,6 +387,15 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd) · 8 unmodified lines
378387 */
379388 if (!cmd->t_data_sg || !cmd->t_bidi_data_sg)
380389 return TCM_NO_SENSE;
390+ /*
391+ * Immediately exit + release dev->caw_sem if command has already
392+ * been failed with a non-zero SCSI status.
393+ */
394+ if (cmd->scsi_status) {
395+ pr_err("compare_and_write_callback: non zero scsi_status:"
396+ " 0x%02x\n", cmd->scsi_status);
397+ goto out;
398+ }
381399
382400 buf = kzalloc(cmd->data_length, GFP_KERNEL);
383401 if (!buf) {
@@ -508,6 +526,12 @@ sbc_compare_and_write(struct se_cmd *cmd) · 124 unmodified lines
508526 cmd->transport_complete_callback = NULL;
509527 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
510528 }
529+ /*
530+ * Reset cmd->data_length to individual block_size in order to not
531+ * confuse backend drivers that depend on this value matching the
532+ * size of the I/O being submitted.
533+ */
534+ cmd->data_length = cmd->t_task_nolb * dev->dev_attrib.block_size;
511535
512536 ret = cmd->execute_rw(cmd, cmd->t_bidi_data_sg, cmd->t_bidi_data_nents,
513537 DMA_FROM_DEVICE);
drivers/target/target_core_transport.c+15−5
@@ -236,17 +236,24 @@ int transport_alloc_session_tags(struct se_session *se_sess, · 235 unmodified lines
236236 {
237237 int rc;
238238
239− se_sess->sess_cmd_map = kzalloc(tag_num * tag_size, GFP_KERNEL);
239+ se_sess->sess_cmd_map = kzalloc(tag_num * tag_size,
240+ GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT);
240241 if (!se_sess->sess_cmd_map) {
241− pr_err("Unable to allocate se_sess->sess_cmd_map\n");
242− return -ENOMEM;
242+ se_sess->sess_cmd_map = vzalloc(tag_num * tag_size);
243+ if (!se_sess->sess_cmd_map) {
244+ pr_err("Unable to allocate se_sess->sess_cmd_map\n");
245+ return -ENOMEM;
246+ }
243247 }
244248
245249 rc = percpu_ida_init(&se_sess->sess_tag_pool, tag_num);
246250 if (rc < 0) {
247251 pr_err("Unable to init se_sess->sess_tag_pool,"
248252 " tag_num: %u\n", tag_num);
249− kfree(se_sess->sess_cmd_map);
253+ if (is_vmalloc_addr(se_sess->sess_cmd_map))
254+ vfree(se_sess->sess_cmd_map);
255+ else
256+ kfree(se_sess->sess_cmd_map);
250257 se_sess->sess_cmd_map = NULL;
251258 return -ENOMEM;
252259 }
@@ -412,7 +419,10 @@ void transport_free_session(struct se_session *se_sess) · 159 unmodified lines
412419 {
413420 if (se_sess->sess_cmd_map) {
414421 percpu_ida_destroy(&se_sess->sess_tag_pool);
415− kfree(se_sess->sess_cmd_map);
422+ if (is_vmalloc_addr(se_sess->sess_cmd_map))
423+ vfree(se_sess->sess_cmd_map);
424+ else
425+ kfree(se_sess->sess_cmd_map);
416426 }
417427 kmem_cache_free(se_sess_cache, se_sess);
418428 }
drivers/target/target_core_xcopy.c+2−2
@@ -298,8 +298,8 @@ static int target_xcopy_parse_segdesc_02(struct se_cmd *se_cmd, struct xcopy_op · 297 unmodified lines
298298 (unsigned long long)xop->dst_lba);
299299
300300 if (dc != 0) {
301− xop->dbl = (desc[29] << 16) & 0xff;
302− xop->dbl |= (desc[30] << 8) & 0xff;
301+ xop->dbl = (desc[29] & 0xff) << 16;
302+ xop->dbl |= (desc[30] & 0xff) << 8;
303303 xop->dbl |= desc[31] & 0xff;
304304
305305 pr_debug("XCOPY seg desc 0x02: DC=1 w/ dbl: %u\n", xop->dbl);
drivers/thermal/samsung/exynos_thermal_common.c+0−2
@@ -310,8 +310,6 @@ void exynos_report_trigger(struct thermal_sensor_conf *conf) · 309 unmodified lines
310310 }
311311
312312 th_zone = conf->pzone_data;
313− if (th_zone->therm_dev)
314− return;
315313
316314 if (th_zone->bind == false) {
317315 for (i = 0; i < th_zone->cool_dev_size; i++) {
drivers/thermal/samsung/exynos_tmu.c+8−4
@@ -317,6 +317,9 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) · 316 unmodified lines
317317
318318 con = readl(data->base + reg->tmu_ctrl);
319319
320+ if (pdata->test_mux)
321+ con |= (pdata->test_mux << reg->test_mux_addr_shift);
322+
320323 if (pdata->reference_voltage) {
321324 con &= ~(reg->buf_vref_sel_mask << reg->buf_vref_sel_shift);
322325 con |= pdata->reference_voltage << reg->buf_vref_sel_shift;
@@ -488,7 +491,7 @@ static const struct of_device_id exynos_tmu_match[] = { · 165 unmodified lines
488491 },
489492 {
490493 .compatible = "samsung,exynos4412-tmu",
491− .data = (void *)EXYNOS5250_TMU_DRV_DATA,
494+ .data = (void *)EXYNOS4412_TMU_DRV_DATA,
492495 },
493496 {
494497 .compatible = "samsung,exynos5250-tmu",
@@ -629,9 +632,10 @@ static int exynos_tmu_probe(struct platform_device *pdev) · 134 unmodified lines
629632 if (ret)
630633 return ret;
631634
632− if (pdata->type == SOC_ARCH_EXYNOS ||
633− pdata->type == SOC_ARCH_EXYNOS4210 ||
634− pdata->type == SOC_ARCH_EXYNOS5440)
635+ if (pdata->type == SOC_ARCH_EXYNOS4210 ||
636+ pdata->type == SOC_ARCH_EXYNOS4412 ||
637+ pdata->type == SOC_ARCH_EXYNOS5250 ||
638+ pdata->type == SOC_ARCH_EXYNOS5440)
635639 data->soc = pdata->type;
636640 else {
637641 ret = -EINVAL;
drivers/thermal/samsung/exynos_tmu.h+6−1
@@ -41,7 +41,8 @@ enum calibration_mode { · 40 unmodified lines
4141
4242 enum soc_type {
4343 SOC_ARCH_EXYNOS4210 = 1,
44− SOC_ARCH_EXYNOS,
44+ SOC_ARCH_EXYNOS4412,
45+ SOC_ARCH_EXYNOS5250,
4546 SOC_ARCH_EXYNOS5440,
4647 };
4748
@@ -84,6 +85,7 @@ enum soc_type { · 36 unmodified lines
8485 * @triminfo_reload_shift: shift of triminfo reload enable bit in triminfo_ctrl
8586 reg.
8687 * @tmu_ctrl: TMU main controller register.
88+ * @test_mux_addr_shift: shift bits of test mux address.
8789 * @buf_vref_sel_shift: shift bits of reference voltage in tmu_ctrl register.
8890 * @buf_vref_sel_mask: mask bits of reference voltage in tmu_ctrl register.
8991 * @therm_trip_mode_shift: shift bits of tripping mode in tmu_ctrl register.
@@ -150,6 +152,7 @@ struct exynos_tmu_registers { · 60 unmodified lines
150152 u32 triminfo_reload_shift;
151153
152154 u32 tmu_ctrl;
155+ u32 test_mux_addr_shift;
153156 u32 buf_vref_sel_shift;
154157 u32 buf_vref_sel_mask;
155158 u32 therm_trip_mode_shift;
@@ -257,6 +260,7 @@ struct exynos_tmu_registers { · 101 unmodified lines
257260 * @first_point_trim: temp value of the first point trimming
258261 * @second_point_trim: temp value of the second point trimming
259262 * @default_temp_offset: default temperature offset in case of no trimming
263+ * @test_mux; information if SoC supports test MUX
260264 * @cal_type: calibration type for temperature
261265 * @cal_mode: calibration mode for temperature
262266 * @freq_clip_table: Table representing frequency reduction percentage.
@@ -286,6 +290,7 @@ struct exynos_tmu_platform_data { · 23 unmodified lines
286290 u8 first_point_trim;
287291 u8 second_point_trim;
288292 u8 default_temp_offset;
293+ u8 test_mux;
289294
290295 enum calibration_type cal_type;
291296 enum calibration_mode cal_mode;
drivers/thermal/samsung/exynos_tmu_data.c+24−6
@@ -90,14 +90,15 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = { · 89 unmodified lines
9090 };
9191 #endif
9292
93−#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)
94−static const struct exynos_tmu_registers exynos5250_tmu_registers = {
93+#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
94+static const struct exynos_tmu_registers exynos4412_tmu_registers = {
9595 .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
9696 .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
9797 .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
9898 .triminfo_ctrl = EXYNOS_TMU_TRIMINFO_CON,
9999 .triminfo_reload_shift = EXYNOS_TRIMINFO_RELOAD_SHIFT,
100100 .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
101+ .test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT,
101102 .buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT,
102103 .buf_vref_sel_mask = EXYNOS_TMU_REF_VOLTAGE_MASK,
103104 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
@@ -128,7 +129,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = { · 24 unmodified lines
128129 .emul_time_mask = EXYNOS_EMUL_TIME_MASK,
129130 };
130131
131−#define EXYNOS5250_TMU_DATA \
132+#define EXYNOS4412_TMU_DATA \
132133 .threshold_falling = 10, \
133134 .trigger_levels[0] = 85, \
134135 .trigger_levels[1] = 103, \
@@ -162,15 +163,32 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = { · 27 unmodified lines
162163 .temp_level = 103, \
163164 }, \
164165 .freq_tab_count = 2, \
165− .type = SOC_ARCH_EXYNOS, \
166− .registers = &exynos5250_tmu_registers, \
166+ .registers = &exynos4412_tmu_registers, \
167167 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
168168 TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
169169 TMU_SUPPORT_EMUL_TIME)
170+#endif
170171
172+#if defined(CONFIG_SOC_EXYNOS4412)
173+struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
174+ .tmu_data = {
175+ {
176+ EXYNOS4412_TMU_DATA,
177+ .type = SOC_ARCH_EXYNOS4412,
178+ .test_mux = EXYNOS4412_MUX_ADDR_VALUE,
179+ },
180+ },
181+ .tmu_count = 1,
182+};
183+#endif
184+
185+#if defined(CONFIG_SOC_EXYNOS5250)
171186 struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
172187 .tmu_data = {
173− { EXYNOS5250_TMU_DATA },
188+ {
189+ EXYNOS4412_TMU_DATA,
190+ .type = SOC_ARCH_EXYNOS5250,
191+ },
174192 },
175193 .tmu_count = 1,
176194 };
drivers/thermal/samsung/exynos_tmu_data.h+12−1
@@ -95,6 +95,10 @@ · 94 unmodified lines
9595
9696 #define EXYNOS_MAX_TRIGGER_PER_REG 4
9797
98+/* Exynos4412 specific */
99+#define EXYNOS4412_MUX_ADDR_VALUE 6
100+#define EXYNOS4412_MUX_ADDR_SHIFT 20
101+
98102 /*exynos5440 specific registers*/
99103 #define EXYNOS5440_TMU_S0_7_TRIM 0x000
100104 #define EXYNOS5440_TMU_S0_7_CTRL 0x020
@@ -138,7 +142,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data; · 37 unmodified lines
138142 #define EXYNOS4210_TMU_DRV_DATA (NULL)
139143 #endif
140144
141−#if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412))
145+#if defined(CONFIG_SOC_EXYNOS4412)
146+extern struct exynos_tmu_init_data const exynos4412_default_tmu_data;
147+#define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data)
148+#else
149+#define EXYNOS4412_TMU_DRV_DATA (NULL)
150+#endif
151+
152+#if defined(CONFIG_SOC_EXYNOS5250)
142153 extern struct exynos_tmu_init_data const exynos5250_default_tmu_data;
143154 #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data)
144155 #else
drivers/thermal/thermal_hwmon.c+1−1
@@ -159,7 +159,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) · 158 unmodified lines
159159
160160 INIT_LIST_HEAD(&hwmon->tz_list);
161161 strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH);
162− hwmon->device = hwmon_device_register(&tz->device);
162+ hwmon->device = hwmon_device_register(NULL);
163163 if (IS_ERR(hwmon->device)) {
164164 result = PTR_ERR(hwmon->device);
165165 goto free_mem;
drivers/thermal/ti-soc-thermal/ti-thermal-common.c+1−0
@@ -110,6 +110,7 @@ static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal, · 109 unmodified lines
110110 } else {
111111 dev_err(bgp->dev,
112112 "Failed to read PCB state. Using defaults\n");
113+ ret = 0;
113114 }
114115 }
115116 *temp = ti_thermal_hotspot_temperature(tmp, slope, constant);
drivers/thermal/x86_pkg_temp_thermal.c+8−6
@@ -316,18 +316,19 @@ static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work) · 315 unmodified lines
316316 int phy_id = topology_physical_package_id(cpu);
317317 struct phy_dev_entry *phdev = pkg_temp_thermal_get_phy_entry(cpu);
318318 bool notify = false;
319+ unsigned long flags;
319320
320321 if (!phdev)
321322 return;
322323
323− spin_lock(&pkg_work_lock);
324+ spin_lock_irqsave(&pkg_work_lock, flags);
324325 ++pkg_work_cnt;
325326 if (unlikely(phy_id > max_phy_id)) {
326− spin_unlock(&pkg_work_lock);
327+ spin_unlock_irqrestore(&pkg_work_lock, flags);
327328 return;
328329 }
329330 pkg_work_scheduled[phy_id] = 0;
330− spin_unlock(&pkg_work_lock);
331+ spin_unlock_irqrestore(&pkg_work_lock, flags);
331332
332333 enable_pkg_thres_interrupt();
333334 rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val);
@@ -397,6 +398,7 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) · 63 unmodified lines
397398 int thres_count;
398399 u32 eax, ebx, ecx, edx;
399400 u8 *temp;
401+ unsigned long flags;
400402
401403 cpuid(6, &eax, &ebx, &ecx, &edx);
402404 thres_count = ebx & 0x07;
@@ -420,19 +422,19 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) · 17 unmodified lines
420422 goto err_ret_unlock;
421423 }
422424
423− spin_lock(&pkg_work_lock);
425+ spin_lock_irqsave(&pkg_work_lock, flags);
424426 if (topology_physical_package_id(cpu) > max_phy_id)
425427 max_phy_id = topology_physical_package_id(cpu);
426428 temp = krealloc(pkg_work_scheduled,
427429 (max_phy_id+1) * sizeof(u8), GFP_ATOMIC);
428430 if (!temp) {
429− spin_unlock(&pkg_work_lock);
431+ spin_unlock_irqrestore(&pkg_work_lock, flags);
430432 err = -ENOMEM;
431433 goto err_ret_free;
432434 }
433435 pkg_work_scheduled = temp;
434436 pkg_work_scheduled[topology_physical_package_id(cpu)] = 0;
435− spin_unlock(&pkg_work_lock);
437+ spin_unlock_irqrestore(&pkg_work_lock, flags);
436438
437439 phy_dev_entry->phys_proc_id = topology_physical_package_id(cpu);
438440 phy_dev_entry->first_cpu = cpu;
drivers/tty/hvc/hvc_xen.c+1−0
@@ -636,6 +636,7 @@ struct console xenboot_console = { · 635 unmodified lines
636636 .name = "xenboot",
637637 .write = xenboot_write_console,
638638 .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
639+ .index = -1,
639640 };
640641 #endif /* CONFIG_EARLY_PRINTK */
641642
drivers/tty/n_tty.c+26−20
@@ -2183,28 +2183,34 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, · 2182 unmodified lines
21832183
21842184 if (!input_available_p(tty, 0)) {
21852185 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
2186− retval = -EIO;
2187− break;
2188− }
2189− if (tty_hung_up_p(file))
2190− break;
2191− if (!timeout)
2192− break;
2193− if (file->f_flags & O_NONBLOCK) {
2194− retval = -EAGAIN;
2195− break;
2196− }
2197− if (signal_pending(current)) {
2198− retval = -ERESTARTSYS;
2199− break;
2200− }
2201− n_tty_set_room(tty);
2202− up_read(&tty->termios_rwsem);
2186+ up_read(&tty->termios_rwsem);
2187+ tty_flush_to_ldisc(tty);
2188+ down_read(&tty->termios_rwsem);
2189+ if (!input_available_p(tty, 0)) {
2190+ retval = -EIO;
2191+ break;
2192+ }
2193+ } else {
2194+ if (tty_hung_up_p(file))
2195+ break;
2196+ if (!timeout)
2197+ break;
2198+ if (file->f_flags & O_NONBLOCK) {
2199+ retval = -EAGAIN;
2200+ break;
2201+ }
2202+ if (signal_pending(current)) {
2203+ retval = -ERESTARTSYS;
2204+ break;
2205+ }
2206+ n_tty_set_room(tty);
2207+ up_read(&tty->termios_rwsem);
22032208
2204− timeout = schedule_timeout(timeout);
2209+ timeout = schedule_timeout(timeout);
22052210
2206− down_read(&tty->termios_rwsem);
2207− continue;
2211+ down_read(&tty->termios_rwsem);
2212+ continue;
2213+ }
22082214 }
22092215 __set_current_state(TASK_RUNNING);
22102216
drivers/tty/serial/imx.c+0−3
@@ -1912,9 +1912,6 @@ static int serial_imx_probe_dt(struct imx_port *sport, · 1911 unmodified lines
19121912
19131913 sport->devdata = of_id->data;
19141914
1915− if (of_device_is_stdout_path(np))
1916− add_preferred_console(imx_reg.cons->name, sport->port.line, 0);
1917−
19181915 return 0;
19191916 }
19201917 #else
drivers/tty/serial/vt8500_serial.c+3−2
@@ -561,12 +561,13 @@ static int vt8500_serial_probe(struct platform_device *pdev) · 560 unmodified lines
561561 if (!mmres || !irqres)
562562 return -ENODEV;
563563
564− if (np)
564+ if (np) {
565565 port = of_alias_get_id(np, "serial");
566566 if (port >= VT8500_MAX_PORTS)
567567 port = -1;
568− else
568+ } else {
569569 port = -1;
570+ }
570571
571572 if (port < 0) {
572573 /* calculate the port id */
drivers/usb/chipidea/ci_hdrc_pci.c+6−1
@@ -129,7 +129,12 @@ static DEFINE_PCI_DEVICE_TABLE(ci_hdrc_pci_id_table) = { · 128 unmodified lines
129129 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0829),
130130 .driver_data = (kernel_ulong_t)&penwell_pci_platdata,
131131 },
132− { 0, 0, 0, 0, 0, 0, 0 /* end: all zeroes */ }
132+ {
133+ /* Intel Clovertrail */
134+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xe006),
135+ .driver_data = (kernel_ulong_t)&penwell_pci_platdata,
136+ },
137+ { 0 } /* end: all zeroes */
133138 };
134139 MODULE_DEVICE_TABLE(pci, ci_hdrc_pci_id_table);
135140
drivers/usb/chipidea/host.c+4−2
@@ -100,8 +100,10 @@ static void host_stop(struct ci_hdrc *ci) · 99 unmodified lines
100100 {
101101 struct usb_hcd *hcd = ci->hcd;
102102
103− usb_remove_hcd(hcd);
104− usb_put_hcd(hcd);
103+ if (hcd) {
104+ usb_remove_hcd(hcd);
105+ usb_put_hcd(hcd);
106+ }
105107 if (ci->platdata->reg_vbus)
106108 regulator_disable(ci->platdata->reg_vbus);
107109 }
drivers/usb/core/quirks.c+6−0
@@ -97,6 +97,9 @@ static const struct usb_device_id usb_quirk_list[] = { · 96 unmodified lines
9797 /* Alcor Micro Corp. Hub */
9898 { USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME },
9999
100+ /* MicroTouch Systems touchscreen */
101+ { USB_DEVICE(0x0596, 0x051e), .driver_info = USB_QUIRK_RESET_RESUME },
102+
100103 /* appletouch */
101104 { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
102105
@@ -130,6 +133,9 @@ static const struct usb_device_id usb_quirk_list[] = { · 27 unmodified lines
130133 /* Broadcom BCM92035DGROM BT dongle */
131134 { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME },
132135
136+ /* MAYA44USB sound device */
137+ { USB_DEVICE(0x0a92, 0x0091), .driver_info = USB_QUIRK_RESET_RESUME },
138+
133139 /* Action Semiconductor flash disk */
134140 { USB_DEVICE(0x10d6, 0x2200), .driver_info =
135141 USB_QUIRK_STRING_FETCH_255 },
drivers/usb/gadget/f_fs.c+2−0
@@ -2256,6 +2256,8 @@ static int ffs_func_bind(struct usb_configuration *c, · 2255 unmodified lines
22562256 data->raw_descs + ret,
22572257 (sizeof data->raw_descs) - ret,
22582258 __ffs_func_bind_do_descs, func);
2259+ if (unlikely(ret < 0))
2260+ goto error;
22592261 }
22602262
22612263 /*
drivers/usb/gadget/pxa25x_udc.c+5−4
@@ -2054,7 +2054,7 @@ static struct pxa25x_udc memory = { · 2053 unmodified lines
20542054 /*
20552055 * probe - binds to the platform device
20562056 */
2057−static int __init pxa25x_udc_probe(struct platform_device *pdev)
2057+static int pxa25x_udc_probe(struct platform_device *pdev)
20582058 {
20592059 struct pxa25x_udc *dev = &memory;
20602060 int retval, irq;
@@ -2203,7 +2203,7 @@ static void pxa25x_udc_shutdown(struct platform_device *_dev) · 142 unmodified lines
22032203 pullup_off();
22042204 }
22052205
2206−static int __exit pxa25x_udc_remove(struct platform_device *pdev)
2206+static int pxa25x_udc_remove(struct platform_device *pdev)
22072207 {
22082208 struct pxa25x_udc *dev = platform_get_drvdata(pdev);
22092209
@@ -2294,7 +2294,8 @@ static int pxa25x_udc_resume(struct platform_device *dev) · 84 unmodified lines
22942294
22952295 static struct platform_driver udc_driver = {
22962296 .shutdown = pxa25x_udc_shutdown,
2297− .remove = __exit_p(pxa25x_udc_remove),
2297+ .probe = pxa25x_udc_probe,
2298+ .remove = pxa25x_udc_remove,
22982299 .suspend = pxa25x_udc_suspend,
22992300 .resume = pxa25x_udc_resume,
23002301 .driver = {
@@ -2303,7 +2304,7 @@ static struct platform_driver udc_driver = { · 2 unmodified lines
23032304 },
23042305 };
23052306
2306−module_platform_driver_probe(udc_driver, pxa25x_udc_probe);
2307+module_platform_driver(udc_driver);
23072308
23082309 MODULE_DESCRIPTION(DRIVER_DESC);
23092310 MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell");
drivers/usb/gadget/s3c-hsotg.c+1−1
@@ -543,7 +543,7 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg, · 542 unmodified lines
543543 * FIFO, requests of >512 cause the endpoint to get stuck with a
544544 * fragment of the end of the transfer in it.
545545 */
546− if (can_write > 512)
546+ if (can_write > 512 && !periodic)
547547 can_write = 512;
548548
549549 /*
drivers/usb/host/pci-quirks.c+2−2
@@ -799,7 +799,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev) · 798 unmodified lines
799799 * switchable ports.
800800 */
801801 pci_write_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN,
802− cpu_to_le32(ports_available));
802+ ports_available);
803803
804804 pci_read_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN,
805805 &ports_available);
@@ -821,7 +821,7 @@ void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev) · 15 unmodified lines
821821 * host.
822822 */
823823 pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR,
824− cpu_to_le32(ports_available));
824+ ports_available);
825825
826826 pci_read_config_dword(xhci_pdev, USB_INTEL_XUSB2PR,
827827 &ports_available);
drivers/usb/host/xhci-hub.c+0−26
@@ -1157,18 +1157,6 @@ int xhci_bus_suspend(struct usb_hcd *hcd) · 1156 unmodified lines
11571157 t1 = xhci_port_state_to_neutral(t1);
11581158 if (t1 != t2)
11591159 xhci_writel(xhci, t2, port_array[port_index]);
1160−
1161− if (hcd->speed != HCD_USB3) {
1162− /* enable remote wake up for USB 2.0 */
1163− __le32 __iomem *addr;
1164− u32 tmp;
1165−
1166− /* Get the port power control register address. */
1167− addr = port_array[port_index] + PORTPMSC;
1168− tmp = xhci_readl(xhci, addr);
1169− tmp |= PORT_RWE;
1170− xhci_writel(xhci, tmp, addr);
1171− }
11721160 }
11731161 hcd->state = HC_STATE_SUSPENDED;
11741162 bus_state->next_statechange = jiffies + msecs_to_jiffies(10);
@@ -1247,20 +1235,6 @@ int xhci_bus_resume(struct usb_hcd *hcd) · 72 unmodified lines
12471235 xhci_ring_device(xhci, slot_id);
12481236 } else
12491237 xhci_writel(xhci, temp, port_array[port_index]);
1250−
1251− if (hcd->speed != HCD_USB3) {
1252− /* disable remote wake up for USB 2.0 */
1253− __le32 __iomem *addr;
1254− u32 tmp;
1255−
1256− /* Add one to the port status register address to get
1257− * the port power control register address.
1258− */
1259− addr = port_array[port_index] + PORTPMSC;
1260− tmp = xhci_readl(xhci, addr);
1261− tmp &= ~PORT_RWE;
1262− xhci_writel(xhci, tmp, addr);
1263− }
12641238 }
12651239
12661240 (void) xhci_readl(xhci, &xhci->op_regs->command);
drivers/usb/host/xhci-pci.c+25−0
@@ -35,6 +35,9 @@ · 34 unmodified lines
3535 #define PCI_VENDOR_ID_ETRON 0x1b6f
3636 #define PCI_DEVICE_ID_ASROCK_P67 0x7023
3737
38+#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31
39+#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
40+
3841 static const char hcd_name[] = "xhci_hcd";
3942
4043 /* called after powerup, by probe or system-pm "wakeup" */
@@ -69,6 +72,14 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · 28 unmodified lines
6972 "QUIRK: Fresco Logic xHC needs configure"
7073 " endpoint cmd after reset endpoint");
7174 }
75+ if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
76+ pdev->revision == 0x4) {
77+ xhci->quirks |= XHCI_SLOW_SUSPEND;
78+ xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
79+ "QUIRK: Fresco Logic xHC revision %u"
80+ "must be suspended extra slowly",
81+ pdev->revision);
82+ }
7283 /* Fresco Logic confirms: all revisions of this chip do not
7384 * support MSI, even though some of them claim to in their PCI
7485 * capabilities.
@@ -110,6 +121,15 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · 35 unmodified lines
110121 xhci->quirks |= XHCI_SPURIOUS_REBOOT;
111122 xhci->quirks |= XHCI_AVOID_BEI;
112123 }
124+ if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
125+ (pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI ||
126+ pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI)) {
127+ /* Workaround for occasional spurious wakeups from S5 (or
128+ * any other sleep) on Haswell machines with LPT and LPT-LP
129+ * with the new Intel BIOS
130+ */
131+ xhci->quirks |= XHCI_SPURIOUS_WAKEUP;
132+ }
113133 if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
114134 pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
115135 xhci->quirks |= XHCI_RESET_ON_RESUME;
@@ -217,6 +237,11 @@ static void xhci_pci_remove(struct pci_dev *dev) · 101 unmodified lines
217237 usb_put_hcd(xhci->shared_hcd);
218238 }
219239 usb_hcd_pci_remove(dev);
240+
241+ /* Workaround for spurious wakeups at shutdown with HSW */
242+ if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
243+ pci_set_power_state(dev, PCI_D3hot);
244+
220245 kfree(xhci);
221246 }
222247
drivers/usb/host/xhci.c+13−1
@@ -730,6 +730,9 @@ void xhci_shutdown(struct usb_hcd *hcd) · 729 unmodified lines
730730
731731 spin_lock_irq(&xhci->lock);
732732 xhci_halt(xhci);
733+ /* Workaround for spurious wakeups at shutdown with HSW */
734+ if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
735+ xhci_reset(xhci);
733736 spin_unlock_irq(&xhci->lock);
734737
735738 xhci_cleanup_msix(xhci);
@@ -737,6 +740,10 @@ void xhci_shutdown(struct usb_hcd *hcd) · 1 unmodified line
737740 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
738741 "xhci_shutdown completed - status = %x",
739742 xhci_readl(xhci, &xhci->op_regs->status));
743+
744+ /* Yet another workaround for spurious wakeups at shutdown with HSW */
745+ if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
746+ pci_set_power_state(to_pci_dev(hcd->self.controller), PCI_D3hot);
740747 }
741748
742749 #ifdef CONFIG_PM
@@ -839,6 +846,7 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci) · 96 unmodified lines
839846 int xhci_suspend(struct xhci_hcd *xhci)
840847 {
841848 int rc = 0;
849+ unsigned int delay = XHCI_MAX_HALT_USEC;
842850 struct usb_hcd *hcd = xhci_to_hcd(xhci);
843851 u32 command;
844852
@@ -861,8 +869,12 @@ int xhci_suspend(struct xhci_hcd *xhci) · 16 unmodified lines
861869 command = xhci_readl(xhci, &xhci->op_regs->command);
862870 command &= ~CMD_RUN;
863871 xhci_writel(xhci, command, &xhci->op_regs->command);
872+
873+ /* Some chips from Fresco Logic need an extraordinary delay */
874+ delay *= (xhci->quirks & XHCI_SLOW_SUSPEND) ? 10 : 1;
875+
864876 if (xhci_handshake(xhci, &xhci->op_regs->status,
865− STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC)) {
877+ STS_HALT, STS_HALT, delay)) {
866878 xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n");
867879 spin_unlock_irq(&xhci->lock);
868880 return -ETIMEDOUT;
drivers/usb/host/xhci.h+2−0
@@ -1548,6 +1548,8 @@ struct xhci_hcd { · 1547 unmodified lines
15481548 #define XHCI_COMP_MODE_QUIRK (1 << 14)
15491549 #define XHCI_AVOID_BEI (1 << 15)
15501550 #define XHCI_PLAT (1 << 16)
1551+#define XHCI_SLOW_SUSPEND (1 << 17)
1552+#define XHCI_SPURIOUS_WAKEUP (1 << 18)
15511553 unsigned int num_active_eps;
15521554 unsigned int limit_active_eps;
15531555 /* There are two roothubs to keep track of bus suspend info for */
drivers/usb/misc/Kconfig+1−1
@@ -246,6 +246,6 @@ config USB_EZUSB_FX2 · 245 unmodified lines
246246 config USB_HSIC_USB3503
247247 tristate "USB3503 HSIC to USB20 Driver"
248248 depends on I2C
249− select REGMAP
249+ select REGMAP_I2C
250250 help
251251 This option enables support for SMSC USB3503 HSIC to USB 2.0 Driver.
drivers/usb/musb/musb_core.c+46−0
@@ -921,6 +921,52 @@ static void musb_generic_disable(struct musb *musb) · 920 unmodified lines
921921
922922 }
923923
924+/*
925+ * Program the HDRC to start (enable interrupts, dma, etc.).
926+ */
927+void musb_start(struct musb *musb)
928+{
929+ void __iomem *regs = musb->mregs;
930+ u8 devctl = musb_readb(regs, MUSB_DEVCTL);
931+
932+ dev_dbg(musb->controller, "<== devctl %02x\n", devctl);
933+
934+ /* Set INT enable registers, enable interrupts */
935+ musb->intrtxe = musb->epmask;
936+ musb_writew(regs, MUSB_INTRTXE, musb->intrtxe);
937+ musb->intrrxe = musb->epmask & 0xfffe;
938+ musb_writew(regs, MUSB_INTRRXE, musb->intrrxe);
939+ musb_writeb(regs, MUSB_INTRUSBE, 0xf7);
940+
941+ musb_writeb(regs, MUSB_TESTMODE, 0);
942+
943+ /* put into basic highspeed mode and start session */
944+ musb_writeb(regs, MUSB_POWER, MUSB_POWER_ISOUPDATE
945+ | MUSB_POWER_HSENAB
946+ /* ENSUSPEND wedges tusb */
947+ /* | MUSB_POWER_ENSUSPEND */
948+ );
949+
950+ musb->is_active = 0;
951+ devctl = musb_readb(regs, MUSB_DEVCTL);
952+ devctl &= ~MUSB_DEVCTL_SESSION;
953+
954+ /* session started after:
955+ * (a) ID-grounded irq, host mode;
956+ * (b) vbus present/connect IRQ, peripheral mode;
957+ * (c) peripheral initiates, using SRP
958+ */
959+ if (musb->port_mode != MUSB_PORT_MODE_HOST &&
960+ (devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) {
961+ musb->is_active = 1;
962+ } else {
963+ devctl |= MUSB_DEVCTL_SESSION;
964+ }
965+
966+ musb_platform_enable(musb);
967+ musb_writeb(regs, MUSB_DEVCTL, devctl);
968+}
969+
924970 /*
925971 * Make the HDRC stop (disable interrupts, etc.);
926972 * reversible by musb_start
drivers/usb/musb/musb_core.h+1−0
@@ -503,6 +503,7 @@ static inline void musb_configure_ep0(struct musb *musb) · 502 unmodified lines
503503 extern const char musb_driver_name[];
504504
505505 extern void musb_stop(struct musb *musb);
506+extern void musb_start(struct musb *musb);
506507
507508 extern void musb_write_fifo(struct musb_hw_ep *ep, u16 len, const u8 *src);
508509 extern void musb_read_fifo(struct musb_hw_ep *ep, u16 len, u8 *dst);
drivers/usb/musb/musb_dsps.c+3−0
@@ -535,6 +535,9 @@ static int dsps_probe(struct platform_device *pdev) · 534 unmodified lines
535535 struct dsps_glue *glue;
536536 int ret;
537537
538+ if (!strcmp(pdev->name, "musb-hdrc"))
539+ return -ENODEV;
540+
538541 match = of_match_node(musb_dsps_of_match, pdev->dev.of_node);
539542 if (!match) {
540543 dev_err(&pdev->dev, "fail to get matching of_match struct\n");
drivers/usb/musb/musb_gadget.c+6−0
@@ -1790,6 +1790,10 @@ int musb_gadget_setup(struct musb *musb) · 1789 unmodified lines
17901790 musb->g.max_speed = USB_SPEED_HIGH;
17911791 musb->g.speed = USB_SPEED_UNKNOWN;
17921792
1793+ MUSB_DEV_MODE(musb);
1794+ musb->xceiv->otg->default_a = 0;
1795+ musb->xceiv->state = OTG_STATE_B_IDLE;
1796+
17931797 /* this "gadget" abstracts/virtualizes the controller */
17941798 musb->g.name = musb_driver_name;
17951799 musb->g.is_otg = 1;
@@ -1855,6 +1859,8 @@ static int musb_gadget_start(struct usb_gadget *g, · 59 unmodified lines
18551859 musb->xceiv->state = OTG_STATE_B_IDLE;
18561860 spin_unlock_irqrestore(&musb->lock, flags);
18571861
1862+ musb_start(musb);
1863+
18581864 /* REVISIT: funcall to other code, which also
18591865 * handles power budgeting ... this way also
18601866 * ensures HdrcStart is indirectly called.
drivers/usb/musb/musb_virthub.c+0−46
@@ -44,52 +44,6 @@ · 43 unmodified lines
4444
4545 #include "musb_core.h"
4646
47−/*
48−* Program the HDRC to start (enable interrupts, dma, etc.).
49−*/
50−static void musb_start(struct musb *musb)
51−{
52− void __iomem *regs = musb->mregs;
53− u8 devctl = musb_readb(regs, MUSB_DEVCTL);
54−
55− dev_dbg(musb->controller, "<== devctl %02x\n", devctl);
56−
57− /* Set INT enable registers, enable interrupts */
58− musb->intrtxe = musb->epmask;
59− musb_writew(regs, MUSB_INTRTXE, musb->intrtxe);
60− musb->intrrxe = musb->epmask & 0xfffe;
61− musb_writew(regs, MUSB_INTRRXE, musb->intrrxe);
62− musb_writeb(regs, MUSB_INTRUSBE, 0xf7);
63−
64− musb_writeb(regs, MUSB_TESTMODE, 0);
65−
66− /* put into basic highspeed mode and start session */
67− musb_writeb(regs, MUSB_POWER, MUSB_POWER_ISOUPDATE
68− | MUSB_POWER_HSENAB
69− /* ENSUSPEND wedges tusb */
70− /* | MUSB_POWER_ENSUSPEND */
71− );
72−
73− musb->is_active = 0;
74− devctl = musb_readb(regs, MUSB_DEVCTL);
75− devctl &= ~MUSB_DEVCTL_SESSION;
76−
77− /* session started after:
78− * (a) ID-grounded irq, host mode;
79− * (b) vbus present/connect IRQ, peripheral mode;
80− * (c) peripheral initiates, using SRP
81− */
82− if (musb->port_mode != MUSB_PORT_MODE_HOST &&
83− (devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) {
84− musb->is_active = 1;
85− } else {
86− devctl |= MUSB_DEVCTL_SESSION;
87− }
88−
89− musb_platform_enable(musb);
90− musb_writeb(regs, MUSB_DEVCTL, devctl);
91−}
92−
9347 static void musb_port_suspend(struct musb *musb, bool do_suspend)
9448 {
9549 struct usb_otg *otg = musb->xceiv->otg;
drivers/usb/phy/phy-gpio-vbus-usb.c+5−6
@@ -241,7 +241,7 @@ static int gpio_vbus_set_suspend(struct usb_phy *phy, int suspend) · 240 unmodified lines
241241
242242 /* platform driver interface */
243243
244−static int __init gpio_vbus_probe(struct platform_device *pdev)
244+static int gpio_vbus_probe(struct platform_device *pdev)
245245 {
246246 struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
247247 struct gpio_vbus_data *gpio_vbus;
@@ -349,7 +349,7 @@ err_gpio: · 101 unmodified lines
349349 return err;
350350 }
351351
352−static int __exit gpio_vbus_remove(struct platform_device *pdev)
352+static int gpio_vbus_remove(struct platform_device *pdev)
353353 {
354354 struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
355355 struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
@@ -398,8 +398,6 @@ static const struct dev_pm_ops gpio_vbus_dev_pm_ops = { · 42 unmodified lines
398398 };
399399 #endif
400400
401−/* NOTE: the gpio-vbus device may *NOT* be hotplugged */
402−
403401 MODULE_ALIAS("platform:gpio-vbus");
404402
405403 static struct platform_driver gpio_vbus_driver = {
@@ -410,10 +408,11 @@ static struct platform_driver gpio_vbus_driver = { · 4 unmodified lines
410408 .pm = &gpio_vbus_dev_pm_ops,
411409 #endif
412410 },
413− .remove = __exit_p(gpio_vbus_remove),
411+ .probe = gpio_vbus_probe,
412+ .remove = gpio_vbus_remove,
414413 };
415414
416−module_platform_driver_probe(gpio_vbus_driver, gpio_vbus_probe);
415+module_platform_driver(gpio_vbus_driver);
417416
418417 MODULE_DESCRIPTION("simple GPIO controlled OTG transceiver driver");
419418 MODULE_AUTHOR("Philipp Zabel");
drivers/usb/serial/option.c+227−1
@@ -81,6 +81,7 @@ static void option_instat_callback(struct urb *urb); · 80 unmodified lines
8181
8282 #define HUAWEI_VENDOR_ID 0x12D1
8383 #define HUAWEI_PRODUCT_E173 0x140C
84+#define HUAWEI_PRODUCT_E1750 0x1406
8485 #define HUAWEI_PRODUCT_K4505 0x1464
8586 #define HUAWEI_PRODUCT_K3765 0x1465
8687 #define HUAWEI_PRODUCT_K4605 0x14C6
@@ -450,6 +451,10 @@ static void option_instat_callback(struct urb *urb); · 363 unmodified lines
450451 #define CHANGHONG_VENDOR_ID 0x2077
451452 #define CHANGHONG_PRODUCT_CH690 0x7001
452453
454+/* Inovia */
455+#define INOVIA_VENDOR_ID 0x20a6
456+#define INOVIA_SEW858 0x1105
457+
453458 /* some devices interfaces need special handling due to a number of reasons */
454459 enum option_blacklist_reason {
455460 OPTION_BLACKLIST_NONE = 0,
@@ -567,6 +572,8 @@ static const struct usb_device_id option_ids[] = { · 111 unmodified lines
567572 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) },
568573 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
569574 .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
575+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1750, 0xff, 0xff, 0xff),
576+ .driver_info = (kernel_ulong_t) &net_intf2_blacklist },
570577 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1441, USB_CLASS_COMM, 0x02, 0xff) },
571578 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1442, USB_CLASS_COMM, 0x02, 0xff) },
572579 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
@@ -686,6 +693,222 @@ static const struct usb_device_id option_ids[] = { · 113 unmodified lines
686693 { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7A) },
687694 { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7B) },
688695 { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x02, 0x7C) },
696+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x01) },
697+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x02) },
698+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x03) },
699+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x04) },
700+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x05) },
701+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x06) },
702+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0A) },
703+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0B) },
704+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0D) },
705+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0E) },
706+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x0F) },
707+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x10) },
708+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x12) },
709+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x13) },
710+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x14) },
711+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x15) },
712+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x17) },
713+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x18) },
714+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x19) },
715+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1A) },
716+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1B) },
717+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x1C) },
718+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x31) },
719+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x32) },
720+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x33) },
721+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x34) },
722+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x35) },
723+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x36) },
724+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3A) },
725+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3B) },
726+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3D) },
727+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3E) },
728+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x3F) },
729+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x48) },
730+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x49) },
731+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4A) },
732+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4B) },
733+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x4C) },
734+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x61) },
735+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x62) },
736+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x63) },
737+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x64) },
738+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x65) },
739+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x66) },
740+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6A) },
741+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6B) },
742+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6D) },
743+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6E) },
744+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x6F) },
745+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x78) },
746+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x79) },
747+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7A) },
748+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7B) },
749+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x03, 0x7C) },
750+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x01) },
751+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x02) },
752+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x03) },
753+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x04) },
754+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x05) },
755+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x06) },
756+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0A) },
757+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0B) },
758+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0D) },
759+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0E) },
760+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x0F) },
761+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x10) },
762+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x12) },
763+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x13) },
764+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x14) },
765+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x15) },
766+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x17) },
767+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x18) },
768+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x19) },
769+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x1A) },
770+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x1B) },
771+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x1C) },
772+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x31) },
773+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x32) },
774+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x33) },
775+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x34) },
776+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x35) },
777+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x36) },
778+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3A) },
779+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3B) },
780+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3D) },
781+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3E) },
782+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x3F) },
783+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x48) },
784+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x49) },
785+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x4A) },
786+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x4B) },
787+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x4C) },
788+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x61) },
789+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x62) },
790+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x63) },
791+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x64) },
792+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x65) },
793+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x66) },
794+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6A) },
795+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6B) },
796+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6D) },
797+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6E) },
798+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x6F) },
799+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x78) },
800+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x79) },
801+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x7A) },
802+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x7B) },
803+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x04, 0x7C) },
804+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x01) },
805+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x02) },
806+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x03) },
807+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x04) },
808+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x05) },
809+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x06) },
810+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0A) },
811+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0B) },
812+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0D) },
813+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0E) },
814+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x0F) },
815+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x10) },
816+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x12) },
817+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x13) },
818+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x14) },
819+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x15) },
820+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x17) },
821+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x18) },
822+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x19) },
823+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x1A) },
824+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x1B) },
825+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x1C) },
826+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x31) },
827+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x32) },
828+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x33) },
829+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x34) },
830+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x35) },
831+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x36) },
832+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3A) },
833+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3B) },
834+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3D) },
835+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3E) },
836+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x3F) },
837+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x48) },
838+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x49) },
839+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x4A) },
840+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x4B) },
841+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x4C) },
842+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x61) },
843+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x62) },
844+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x63) },
845+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x64) },
846+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x65) },
847+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x66) },
848+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6A) },
849+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6B) },
850+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6D) },
851+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6E) },
852+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x6F) },
853+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x78) },
854+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x79) },
855+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x7A) },
856+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x7B) },
857+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x05, 0x7C) },
858+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x01) },
859+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x02) },
860+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x03) },
861+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x04) },
862+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x05) },
863+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x06) },
864+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0A) },
865+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0B) },
866+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0D) },
867+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0E) },
868+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x0F) },
869+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x10) },
870+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x12) },
871+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x13) },
872+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x14) },
873+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x15) },
874+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x17) },
875+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x18) },
876+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x19) },
877+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x1A) },
878+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x1B) },
879+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x1C) },
880+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x31) },
881+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x32) },
882+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x33) },
883+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x34) },
884+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x35) },
885+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x36) },
886+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3A) },
887+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3B) },
888+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3D) },
889+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3E) },
890+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x3F) },
891+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x48) },
892+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x49) },
893+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x4A) },
894+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x4B) },
895+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x4C) },
896+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x61) },
897+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x62) },
898+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x63) },
899+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x64) },
900+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x65) },
901+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x66) },
902+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6A) },
903+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6B) },
904+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6D) },
905+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6E) },
906+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x6F) },
907+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x78) },
908+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x79) },
909+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7A) },
910+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7B) },
911+ { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7C) },
689912
690913
691914 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
@@ -1254,7 +1477,9 @@ static const struct usb_device_id option_ids[] = { · 562 unmodified lines
12541477
12551478 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
12561479 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) },
1257− { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200) },
1480+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200),
1481+ .driver_info = (kernel_ulong_t)&net_intf6_blacklist
1482+ },
12581483 { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
12591484 { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/
12601485 { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) },
@@ -1342,6 +1567,7 @@ static const struct usb_device_id option_ids[] = { · 81 unmodified lines
13421567 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) },
13431568 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */
13441569 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */
1570+ { USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) },
13451571 { } /* Terminating entry */
13461572 };
13471573 MODULE_DEVICE_TABLE(usb, option_ids);
drivers/usb/serial/ti_usb_3410_5052.c+1−0
@@ -190,6 +190,7 @@ static struct usb_device_id ti_id_table_combined[] = { · 189 unmodified lines
190190 { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
191191 { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
192192 { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) },
193+ { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_STRIP_PORT_ID) },
193194 { USB_DEVICE(TI_VENDOR_ID, FRI2_PRODUCT_ID) },
194195 { } /* terminator */
195196 };
drivers/usb/storage/scsiglue.c+4−1
@@ -211,8 +211,11 @@ static int slave_configure(struct scsi_device *sdev) · 210 unmodified lines
211211 /*
212212 * Many devices do not respond properly to READ_CAPACITY_16.
213213 * Tell the SCSI layer to try READ_CAPACITY_10 first.
214+ * However some USB 3.0 drive enclosures return capacity
215+ * modulo 2TB. Those must use READ_CAPACITY_16
214216 */
215− sdev->try_rc_10_first = 1;
217+ if (!(us->fflags & US_FL_NEEDS_CAP16))
218+ sdev->try_rc_10_first = 1;
216219
217220 /* assume SPC3 or latter devices support sense size > 18 */
218221 if (sdev->scsi_level > SCSI_SPC_2)
drivers/usb/storage/unusual_devs.h+7−0
@@ -1925,6 +1925,13 @@ UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201, · 1924 unmodified lines
19251925 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
19261926 US_FL_IGNORE_RESIDUE ),
19271927
1928+/* Reported by Oliver Neukum <oneukum@suse.com> */
1929+UNUSUAL_DEV( 0x174c, 0x55aa, 0x0100, 0x0100,
1930+ "ASMedia",
1931+ "AS2105",
1932+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1933+ US_FL_NEEDS_CAP16),
1934+
19281935 /* Reported by Jesse Feddema <jdfeddema@gmail.com> */
19291936 UNUSUAL_DEV( 0x177f, 0x0400, 0x0000, 0x0000,
19301937 "Yarvik",
drivers/vfio/vfio_iommu_type1.c+21−19
@@ -545,6 +545,8 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, · 544 unmodified lines
545545 long npage;
546546 int ret = 0, prot = 0;
547547 uint64_t mask;
548+ struct vfio_dma *dma = NULL;
549+ unsigned long pfn;
548550
549551 end = map->iova + map->size;
550552
@@ -587,8 +589,6 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, · 36 unmodified lines
587589 }
588590
589591 for (iova = map->iova; iova < end; iova += size, vaddr += size) {
590− struct vfio_dma *dma = NULL;
591− unsigned long pfn;
592592 long i;
593593
594594 /* Pin a contiguous chunk of memory */
@@ -597,16 +597,15 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, · 2 unmodified lines
597597 if (npage <= 0) {
598598 WARN_ON(!npage);
599599 ret = (int)npage;
600− break;
600+ goto out;
601601 }
602602
603603 /* Verify pages are not already mapped */
604604 for (i = 0; i < npage; i++) {
605605 if (iommu_iova_to_phys(iommu->domain,
606606 iova + (i << PAGE_SHIFT))) {
607− vfio_unpin_pages(pfn, npage, prot, true);
608607 ret = -EBUSY;
609− break;
608+ goto out_unpin;
610609 }
611610 }
612611
@@ -616,8 +615,7 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, · 3 unmodified lines
616615 if (ret) {
617616 if (ret != -EBUSY ||
618617 map_try_harder(iommu, iova, pfn, npage, prot)) {
619− vfio_unpin_pages(pfn, npage, prot, true);
620− break;
618+ goto out_unpin;
621619 }
622620 }
623621
@@ -672,9 +670,8 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, · 48 unmodified lines
672670 dma = kzalloc(sizeof(*dma), GFP_KERNEL);
673671 if (!dma) {
674672 iommu_unmap(iommu->domain, iova, size);
675− vfio_unpin_pages(pfn, npage, prot, true);
676673 ret = -ENOMEM;
677− break;
674+ goto out_unpin;
678675 }
679676
680677 dma->size = size;
@@ -685,16 +682,21 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, · 4 unmodified lines
685682 }
686683 }
687684
688− if (ret) {
689− struct vfio_dma *tmp;
690− iova = map->iova;
691− size = map->size;
692− while ((tmp = vfio_find_dma(iommu, iova, size))) {
693− int r = vfio_remove_dma_overlap(iommu, iova,
694− &size, tmp);
695− if (WARN_ON(r || !size))
696− break;
697− }
685+ WARN_ON(ret);
686+ mutex_unlock(&iommu->lock);
687+ return ret;
688+
689+out_unpin:
690+ vfio_unpin_pages(pfn, npage, prot, true);
691+
692+out:
693+ iova = map->iova;
694+ size = map->size;
695+ while ((dma = vfio_find_dma(iommu, iova, size))) {
696+ int r = vfio_remove_dma_overlap(iommu, iova,
697+ &size, dma);
698+ if (WARN_ON(r || !size))
699+ break;
698700 }
699701
700702 mutex_unlock(&iommu->lock);
drivers/vhost/scsi.c+6−1
@@ -728,7 +728,12 @@ vhost_scsi_get_tag(struct vhost_virtqueue *vq, · 727 unmodified lines
728728 }
729729 se_sess = tv_nexus->tvn_se_sess;
730730
731− tag = percpu_ida_alloc(&se_sess->sess_tag_pool, GFP_KERNEL);
731+ tag = percpu_ida_alloc(&se_sess->sess_tag_pool, GFP_ATOMIC);
732+ if (tag < 0) {
733+ pr_err("Unable to obtain tag for tcm_vhost_cmd\n");
734+ return ERR_PTR(-ENOMEM);
735+ }
736+
732737 cmd = &((struct tcm_vhost_cmd *)se_sess->sess_cmd_map)[tag];
733738 sg = cmd->tvc_sgl;
734739 pages = cmd->tvc_upages;
drivers/w1/w1.c+6−0
@@ -613,6 +613,9 @@ static int w1_bus_notify(struct notifier_block *nb, unsigned long action, · 612 unmodified lines
613613 sl = dev_to_w1_slave(dev);
614614 fops = sl->family->fops;
615615
616+ if (!fops)
617+ return 0;
618+
616619 switch (action) {
617620 case BUS_NOTIFY_ADD_DEVICE:
618621 /* if the family driver needs to initialize something... */
@@ -713,7 +716,10 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn) · 94 unmodified lines
713716 atomic_set(&sl->refcnt, 0);
714717 init_completion(&sl->released);
715718
719+ /* slave modules need to be loaded in a context with unlocked mutex */
720+ mutex_unlock(&dev->mutex);
716721 request_module("w1-family-0x%0x", rn->family);
722+ mutex_lock(&dev->mutex);
717723
718724 spin_lock(&w1_flock);
719725 f = w1_family_registered(rn->family);
drivers/watchdog/hpwdt.c+6−0
@@ -802,6 +802,12 @@ static int hpwdt_init_one(struct pci_dev *dev, · 801 unmodified lines
802802 return -ENODEV;
803803 }
804804
805+ /*
806+ * Ignore all auxilary iLO devices with the following PCI ID
807+ */
808+ if (dev->subsystem_device == 0x1979)
809+ return -ENODEV;
810+
805811 if (pci_enable_device(dev)) {
806812 dev_warn(&dev->dev,
807813 "Not possible to enable PCI Device: 0x%x:0x%x.\n",
drivers/watchdog/kempld_wdt.c+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535 #define KEMPLD_WDT_STAGE_TIMEOUT(x) (0x1b + (x) * 4)
3636 #define KEMPLD_WDT_STAGE_CFG(x) (0x18 + (x))
3737 #define STAGE_CFG_GET_PRESCALER(x) (((x) & 0x30) >> 4)
38−#define STAGE_CFG_SET_PRESCALER(x) (((x) & 0x30) << 4)
38+#define STAGE_CFG_SET_PRESCALER(x) (((x) & 0x3) << 4)
3939 #define STAGE_CFG_PRESCALER_MASK 0x30
4040 #define STAGE_CFG_ACTION_MASK 0x7
4141 #define STAGE_CFG_ASSERT (1 << 3)
drivers/watchdog/sunxi_wdt.c+2−2
@@ -146,7 +146,7 @@ static const struct watchdog_ops sunxi_wdt_ops = { · 145 unmodified lines
146146 .set_timeout = sunxi_wdt_set_timeout,
147147 };
148148
149−static int __init sunxi_wdt_probe(struct platform_device *pdev)
149+static int sunxi_wdt_probe(struct platform_device *pdev)
150150 {
151151 struct sunxi_wdt_dev *sunxi_wdt;
152152 struct resource *res;
@@ -187,7 +187,7 @@ static int __init sunxi_wdt_probe(struct platform_device *pdev) · 34 unmodified lines
187187 return 0;
188188 }
189189
190−static int __exit sunxi_wdt_remove(struct platform_device *pdev)
190+static int sunxi_wdt_remove(struct platform_device *pdev)
191191 {
192192 struct sunxi_wdt_dev *sunxi_wdt = platform_get_drvdata(pdev);
193193
drivers/watchdog/ts72xx_wdt.c+2−1
@@ -310,7 +310,8 @@ static long ts72xx_wdt_ioctl(struct file *file, unsigned int cmd, · 309 unmodified lines
310310
311311 case WDIOC_GETSTATUS:
312312 case WDIOC_GETBOOTSTATUS:
313− return put_user(0, p);
313+ error = put_user(0, p);
314+ break;
314315
315316 case WDIOC_KEEPALIVE:
316317 ts72xx_wdt_kick(wdt);
fs/aio.c+37−15
@@ -167,10 +167,25 @@ static int __init aio_setup(void) · 166 unmodified lines
167167 }
168168 __initcall(aio_setup);
169169
170+static void put_aio_ring_file(struct kioctx *ctx)
171+{
172+ struct file *aio_ring_file = ctx->aio_ring_file;
173+ if (aio_ring_file) {
174+ truncate_setsize(aio_ring_file->f_inode, 0);
175+
176+ /* Prevent further access to the kioctx from migratepages */
177+ spin_lock(&aio_ring_file->f_inode->i_mapping->private_lock);
178+ aio_ring_file->f_inode->i_mapping->private_data = NULL;
179+ ctx->aio_ring_file = NULL;
180+ spin_unlock(&aio_ring_file->f_inode->i_mapping->private_lock);
181+
182+ fput(aio_ring_file);
183+ }
184+}
185+
170186 static void aio_free_ring(struct kioctx *ctx)
171187 {
172188 int i;
173− struct file *aio_ring_file = ctx->aio_ring_file;
174189
175190 for (i = 0; i < ctx->nr_pages; i++) {
176191 pr_debug("pid(%d) [%d] page->count=%d\n", current->pid, i,
@@ -178,14 +193,10 @@ static void aio_free_ring(struct kioctx *ctx) · 1 unmodified line
178193 put_page(ctx->ring_pages[i]);
179194 }
180195
196+ put_aio_ring_file(ctx);
197+
181198 if (ctx->ring_pages && ctx->ring_pages != ctx->internal_pages)
182199 kfree(ctx->ring_pages);
183−
184− if (aio_ring_file) {
185− truncate_setsize(aio_ring_file->f_inode, 0);
186− fput(aio_ring_file);
187− ctx->aio_ring_file = NULL;
188− }
189200 }
190201
191202 static int aio_ring_mmap(struct file *file, struct vm_area_struct *vma)
@@ -207,9 +218,8 @@ static int aio_set_page_dirty(struct page *page) · 15 unmodified lines
207218 static int aio_migratepage(struct address_space *mapping, struct page *new,
208219 struct page *old, enum migrate_mode mode)
209220 {
210− struct kioctx *ctx = mapping->private_data;
221+ struct kioctx *ctx;
211222 unsigned long flags;
212− unsigned idx = old->index;
213223 int rc;
214224
215225 /* Writeback must be complete */
@@ -224,10 +234,23 @@ static int aio_migratepage(struct address_space *mapping, struct page *new, · 8 unmodified lines
224234
225235 get_page(new);
226236
227− spin_lock_irqsave(&ctx->completion_lock, flags);
228− migrate_page_copy(new, old);
229− ctx->ring_pages[idx] = new;
230− spin_unlock_irqrestore(&ctx->completion_lock, flags);
237+ /* We can potentially race against kioctx teardown here. Use the
238+ * address_space's private data lock to protect the mapping's
239+ * private_data.
240+ */
241+ spin_lock(&mapping->private_lock);
242+ ctx = mapping->private_data;
243+ if (ctx) {
244+ pgoff_t idx;
245+ spin_lock_irqsave(&ctx->completion_lock, flags);
246+ migrate_page_copy(new, old);
247+ idx = old->index;
248+ if (idx < (pgoff_t)ctx->nr_pages)
249+ ctx->ring_pages[idx] = new;
250+ spin_unlock_irqrestore(&ctx->completion_lock, flags);
251+ } else
252+ rc = -EBUSY;
253+ spin_unlock(&mapping->private_lock);
231254
232255 return rc;
233256 }
@@ -617,8 +640,7 @@ out_freepcpu: · 383 unmodified lines
617640 out_freeref:
618641 free_percpu(ctx->users.pcpu_count);
619642 out_freectx:
620− if (ctx->aio_ring_file)
621− fput(ctx->aio_ring_file);
643+ put_aio_ring_file(ctx);
622644 kmem_cache_free(kioctx_cachep, ctx);
623645 pr_debug("error allocating ioctx %d\n", err);
624646 return ERR_PTR(err);
fs/btrfs/async-thread.c+19−6
@@ -107,7 +107,8 @@ static void check_idle_worker(struct btrfs_worker_thread *worker) · 106 unmodified lines
107107 worker->idle = 1;
108108
109109 /* the list may be empty if the worker is just starting */
110− if (!list_empty(&worker->worker_list)) {
110+ if (!list_empty(&worker->worker_list) &&
111+ !worker->workers->stopping) {
111112 list_move(&worker->worker_list,
112113 &worker->workers->idle_list);
113114 }
@@ -127,7 +128,8 @@ static void check_busy_worker(struct btrfs_worker_thread *worker) · 13 unmodified lines
127128 spin_lock_irqsave(&worker->workers->lock, flags);
128129 worker->idle = 0;
129130
130− if (!list_empty(&worker->worker_list)) {
131+ if (!list_empty(&worker->worker_list) &&
132+ !worker->workers->stopping) {
131133 list_move_tail(&worker->worker_list,
132134 &worker->workers->worker_list);
133135 }
@@ -412,6 +414,7 @@ void btrfs_stop_workers(struct btrfs_workers *workers) · 278 unmodified lines
412414 int can_stop;
413415
414416 spin_lock_irq(&workers->lock);
417+ workers->stopping = 1;
415418 list_splice_init(&workers->idle_list, &workers->worker_list);
416419 while (!list_empty(&workers->worker_list)) {
417420 cur = workers->worker_list.next;
@@ -455,6 +458,7 @@ void btrfs_init_workers(struct btrfs_workers *workers, char *name, int max, · 37 unmodified lines
455458 workers->ordered = 0;
456459 workers->atomic_start_pending = 0;
457460 workers->atomic_worker_start = async_helper;
461+ workers->stopping = 0;
458462 }
459463
460464 /*
@@ -480,15 +484,19 @@ static int __btrfs_start_workers(struct btrfs_workers *workers) · 19 unmodified lines
480484 atomic_set(&worker->num_pending, 0);
481485 atomic_set(&worker->refs, 1);
482486 worker->workers = workers;
483− worker->task = kthread_run(worker_loop, worker,
484− "btrfs-%s-%d", workers->name,
485− workers->num_workers + 1);
487+ worker->task = kthread_create(worker_loop, worker,
488+ "btrfs-%s-%d", workers->name,
489+ workers->num_workers + 1);
486490 if (IS_ERR(worker->task)) {
487491 ret = PTR_ERR(worker->task);
488− kfree(worker);
489492 goto fail;
490493 }
494+
491495 spin_lock_irq(&workers->lock);
496+ if (workers->stopping) {
497+ spin_unlock_irq(&workers->lock);
498+ goto fail_kthread;
499+ }
492500 list_add_tail(&worker->worker_list, &workers->idle_list);
493501 worker->idle = 1;
494502 workers->num_workers++;
@@ -496,8 +504,13 @@ static int __btrfs_start_workers(struct btrfs_workers *workers) · 1 unmodified line
496504 WARN_ON(workers->num_workers_starting < 0);
497505 spin_unlock_irq(&workers->lock);
498506
507+ wake_up_process(worker->task);
499508 return 0;
509+
510+fail_kthread:
511+ kthread_stop(worker->task);
500512 fail:
513+ kfree(worker);
501514 spin_lock_irq(&workers->lock);
502515 workers->num_workers_starting--;
503516 spin_unlock_irq(&workers->lock);
fs/btrfs/async-thread.h+2−0
@@ -107,6 +107,8 @@ struct btrfs_workers { · 106 unmodified lines
107107
108108 /* extra name for this worker, used for current->name */
109109 char *name;
110+
111+ int stopping;
110112 };
111113
112114 void btrfs_queue_worker(struct btrfs_workers *workers, struct btrfs_work *work);
fs/btrfs/dev-replace.c+1−4
@@ -535,10 +535,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, · 534 unmodified lines
535535 list_add(&tgt_device->dev_alloc_list, &fs_info->fs_devices->alloc_list);
536536
537537 btrfs_rm_dev_replace_srcdev(fs_info, src_device);
538− if (src_device->bdev) {
539− /* zero out the old super */
540− btrfs_scratch_superblock(src_device);
541− }
538+
542539 /*
543540 * this is again a consistent state where no dev_replace procedure
544541 * is running, the target device is part of the filesystem, the
fs/btrfs/disk-io.c+5−4
@@ -1561,8 +1561,9 @@ int btrfs_insert_fs_root(struct btrfs_fs_info *fs_info, · 1560 unmodified lines
15611561 return ret;
15621562 }
15631563
1564−struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info,
1565− struct btrfs_key *location)
1564+struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
1565+ struct btrfs_key *location,
1566+ bool check_ref)
15661567 {
15671568 struct btrfs_root *root;
15681569 int ret;
@@ -1586,7 +1587,7 @@ struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, · 17 unmodified lines
15861587 again:
15871588 root = btrfs_lookup_fs_root(fs_info, location->objectid);
15881589 if (root) {
1589− if (btrfs_root_refs(&root->root_item) == 0)
1590+ if (check_ref && btrfs_root_refs(&root->root_item) == 0)
15901591 return ERR_PTR(-ENOENT);
15911592 return root;
15921593 }
@@ -1595,7 +1596,7 @@ again: · 2 unmodified lines
15951596 if (IS_ERR(root))
15961597 return root;
15971598
1598− if (btrfs_root_refs(&root->root_item) == 0) {
1599+ if (check_ref && btrfs_root_refs(&root->root_item) == 0) {
15991600 ret = -ENOENT;
16001601 goto fail;
16011602 }
fs/btrfs/disk-io.h+11−2
@@ -68,8 +68,17 @@ struct btrfs_root *btrfs_read_fs_root(struct btrfs_root *tree_root, · 67 unmodified lines
6868 int btrfs_init_fs_root(struct btrfs_root *root);
6969 int btrfs_insert_fs_root(struct btrfs_fs_info *fs_info,
7070 struct btrfs_root *root);
71−struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info,
72− struct btrfs_key *location);
71+
72+struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
73+ struct btrfs_key *key,
74+ bool check_ref);
75+static inline struct btrfs_root *
76+btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info,
77+ struct btrfs_key *location)
78+{
79+ return btrfs_get_fs_root(fs_info, location, true);
80+}
81+
7382 int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info);
7483 void btrfs_btree_balance_dirty(struct btrfs_root *root);
7584 void btrfs_btree_balance_dirty_nodelay(struct btrfs_root *root);
fs/btrfs/extent_io.c+13−9
@@ -145,8 +145,16 @@ int __init extent_io_init(void) · 144 unmodified lines
145145 offsetof(struct btrfs_io_bio, bio));
146146 if (!btrfs_bioset)
147147 goto free_buffer_cache;
148+
149+ if (bioset_integrity_create(btrfs_bioset, BIO_POOL_SIZE))
150+ goto free_bioset;
151+
148152 return 0;
149153
154+free_bioset:
155+ bioset_free(btrfs_bioset);
156+ btrfs_bioset = NULL;
157+
150158 free_buffer_cache:
151159 kmem_cache_destroy(extent_buffer_cache);
152160 extent_buffer_cache = NULL;
@@ -1482,10 +1490,8 @@ static noinline u64 find_delalloc_range(struct extent_io_tree *tree, · 1329 unmodified lines
14821490 cur_start = state->end + 1;
14831491 node = rb_next(node);
14841492 total_bytes += state->end - state->start + 1;
1485− if (total_bytes >= max_bytes) {
1486− *end = *start + max_bytes - 1;
1493+ if (total_bytes >= max_bytes)
14871494 break;
1488− }
14891495 if (!node)
14901496 break;
14911497 }
@@ -1614,7 +1620,7 @@ again: · 122 unmodified lines
16141620 *start = delalloc_start;
16151621 *end = delalloc_end;
16161622 free_extent_state(cached_state);
1617− return found;
1623+ return 0;
16181624 }
16191625
16201626 /*
@@ -1627,10 +1633,9 @@ again: · 6 unmodified lines
16271633
16281634 /*
16291635 * make sure to limit the number of pages we try to lock down
1630− * if we're looping.
16311636 */
1632− if (delalloc_end + 1 - delalloc_start > max_bytes && loops)
1633− delalloc_end = delalloc_start + PAGE_CACHE_SIZE - 1;
1637+ if (delalloc_end + 1 - delalloc_start > max_bytes)
1638+ delalloc_end = delalloc_start + max_bytes - 1;
16341639
16351640 /* step two, lock all the pages after the page that has start */
16361641 ret = lock_delalloc_pages(inode, locked_page,
@@ -1641,8 +1646,7 @@ again: · 4 unmodified lines
16411646 */
16421647 free_extent_state(cached_state);
16431648 if (!loops) {
1644− unsigned long offset = (*start) & (PAGE_CACHE_SIZE - 1);
1645− max_bytes = PAGE_CACHE_SIZE - offset;
1649+ max_bytes = PAGE_CACHE_SIZE;
16461650 loops = 1;
16471651 goto again;
16481652 } else {
fs/btrfs/inode.c+2−1
@@ -6437,6 +6437,7 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, · 6436 unmodified lines
64376437
64386438 if (btrfs_extent_readonly(root, disk_bytenr))
64396439 goto out;
6440+ btrfs_release_path(path);
64406441
64416442 /*
64426443 * look for other files referencing this extent, if we
@@ -7986,7 +7987,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 1543 unmodified lines
79867987
79877988
79887989 /* check for collisions, even if the name isn't there */
7989− ret = btrfs_check_dir_item_collision(root, new_dir->i_ino,
7990+ ret = btrfs_check_dir_item_collision(dest, new_dir->i_ino,
79907991 new_dentry->d_name.name,
79917992 new_dentry->d_name.len);
79927993
fs/btrfs/relocation.c+1−1
@@ -588,7 +588,7 @@ static struct btrfs_root *read_fs_root(struct btrfs_fs_info *fs_info, · 587 unmodified lines
588588 else
589589 key.offset = (u64)-1;
590590
591− return btrfs_read_fs_root_no_name(fs_info, &key);
591+ return btrfs_get_fs_root(fs_info, &key, false);
592592 }
593593
594594 #ifdef BTRFS_COMPAT_EXTENT_TREE_V0
fs/btrfs/root-tree.c+3−5
@@ -299,11 +299,6 @@ int btrfs_find_orphan_roots(struct btrfs_root *tree_root) · 298 unmodified lines
299299 continue;
300300 }
301301
302− if (btrfs_root_refs(&root->root_item) == 0) {
303− btrfs_add_dead_root(root);
304− continue;
305− }
306−
307302 err = btrfs_init_fs_root(root);
308303 if (err) {
309304 btrfs_free_fs_root(root);
@@ -318,6 +313,9 @@ int btrfs_find_orphan_roots(struct btrfs_root *tree_root) · 8 unmodified lines
318313 btrfs_free_fs_root(root);
319314 break;
320315 }
316+
317+ if (btrfs_root_refs(&root->root_item) == 0)
318+ btrfs_add_dead_root(root);
321319 }
322320
323321 btrfs_free_path(path);
fs/btrfs/transaction.c+2−5
@@ -1838,11 +1838,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, · 1837 unmodified lines
18381838 assert_qgroups_uptodate(trans);
18391839 update_super_roots(root);
18401840
1841− if (!root->fs_info->log_root_recovering) {
1842− btrfs_set_super_log_root(root->fs_info->super_copy, 0);
1843− btrfs_set_super_log_root_level(root->fs_info->super_copy, 0);
1844− }
1845−
1841+ btrfs_set_super_log_root(root->fs_info->super_copy, 0);
1842+ btrfs_set_super_log_root_level(root->fs_info->super_copy, 0);
18461843 memcpy(root->fs_info->super_for_commit, root->fs_info->super_copy,
18471844 sizeof(*root->fs_info->super_copy));
18481845
fs/btrfs/volumes.c+6−1
@@ -1716,6 +1716,7 @@ void btrfs_rm_dev_replace_srcdev(struct btrfs_fs_info *fs_info, · 1715 unmodified lines
17161716 struct btrfs_device *srcdev)
17171717 {
17181718 WARN_ON(!mutex_is_locked(&fs_info->fs_devices->device_list_mutex));
1719+
17191720 list_del_rcu(&srcdev->dev_list);
17201721 list_del_rcu(&srcdev->dev_alloc_list);
17211722 fs_info->fs_devices->num_devices--;
@@ -1725,9 +1726,13 @@ void btrfs_rm_dev_replace_srcdev(struct btrfs_fs_info *fs_info, · 3 unmodified lines
17251726 }
17261727 if (srcdev->can_discard)
17271728 fs_info->fs_devices->num_can_discard--;
1728− if (srcdev->bdev)
1729+ if (srcdev->bdev) {
17291730 fs_info->fs_devices->open_devices--;
17301731
1732+ /* zero out the old super */
1733+ btrfs_scratch_superblock(srcdev);
1734+ }
1735+
17311736 call_rcu(&srcdev->rcu, free_device);
17321737 }
17331738
fs/buffer.c+12−2
@@ -1005,9 +1005,19 @@ grow_dev_page(struct block_device *bdev, sector_t block, · 1004 unmodified lines
10051005 struct buffer_head *bh;
10061006 sector_t end_block;
10071007 int ret = 0; /* Will call free_more_memory() */
1008+ gfp_t gfp_mask;
10081009
1009− page = find_or_create_page(inode->i_mapping, index,
1010− (mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS)|__GFP_MOVABLE);
1010+ gfp_mask = mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS;
1011+ gfp_mask |= __GFP_MOVABLE;
1012+ /*
1013+ * XXX: __getblk_slow() can not really deal with failure and
1014+ * will endlessly loop on improvised global reclaim. Prefer
1015+ * looping in the allocator rather than here, at least that
1016+ * code knows what it's doing.
1017+ */
1018+ gfp_mask |= __GFP_NOFAIL;
1019+
1020+ page = find_or_create_page(inode->i_mapping, index, gfp_mask);
10111021 if (!page)
10121022 return ret;
10131023
fs/cifs/cifsfs.c+4−2
@@ -120,14 +120,16 @@ cifs_read_super(struct super_block *sb) · 119 unmodified lines
120120 {
121121 struct inode *inode;
122122 struct cifs_sb_info *cifs_sb;
123+ struct cifs_tcon *tcon;
123124 int rc = 0;
124125
125126 cifs_sb = CIFS_SB(sb);
127+ tcon = cifs_sb_master_tcon(cifs_sb);
126128
127129 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIXACL)
128130 sb->s_flags |= MS_POSIXACL;
129131
130− if (cifs_sb_master_tcon(cifs_sb)->ses->capabilities & CAP_LARGE_FILES)
132+ if (tcon->ses->capabilities & tcon->ses->server->vals->cap_large_files)
131133 sb->s_maxbytes = MAX_LFS_FILESIZE;
132134 else
133135 sb->s_maxbytes = MAX_NON_LFS;
@@ -147,7 +149,7 @@ cifs_read_super(struct super_block *sb) · 13 unmodified lines
147149 goto out_no_root;
148150 }
149151
150− if (cifs_sb_master_tcon(cifs_sb)->nocase)
152+ if (tcon->nocase)
151153 sb->s_d_op = &cifs_ci_dentry_ops;
152154 else
153155 sb->s_d_op = &cifs_dentry_ops;
fs/cifs/cifsfs.h+1−1
@@ -132,5 +132,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); · 131 unmodified lines
132132 extern const struct export_operations cifs_export_ops;
133133 #endif /* CONFIG_CIFS_NFSD_EXPORT */
134134
135−#define CIFS_VERSION "2.01"
135+#define CIFS_VERSION "2.02"
136136 #endif /* _CIFSFS_H */
fs/cifs/cifsglob.h+1−4
@@ -547,9 +547,6 @@ struct TCP_Server_Info { · 546 unmodified lines
547547 unsigned int max_rw; /* maxRw specifies the maximum */
548548 /* message size the server can send or receive for */
549549 /* SMB_COM_WRITE_RAW or SMB_COM_READ_RAW. */
550− unsigned int max_vcs; /* maximum number of smb sessions, at least
551− those that can be specified uniquely with
552− vcnumbers */
553550 unsigned int capabilities; /* selective disabling of caps by smb sess */
554551 int timeAdj; /* Adjust for difference in server time zone in sec */
555552 __u64 CurrentMid; /* multiplex id - rotating counter */
@@ -715,7 +712,6 @@ struct cifs_ses { · 159 unmodified lines
715712 enum statusEnum status;
716713 unsigned overrideSecFlg; /* if non-zero override global sec flags */
717714 __u16 ipc_tid; /* special tid for connection to IPC share */
718− __u16 vcnum;
719715 char *serverOS; /* name of operating system underlying server */
720716 char *serverNOS; /* name of network operating system of server */
721717 char *serverDomain; /* security realm of server */
@@ -1272,6 +1268,7 @@ struct dfs_info3_param { · 550 unmodified lines
12721268 #define CIFS_FATTR_DELETE_PENDING 0x2
12731269 #define CIFS_FATTR_NEED_REVAL 0x4
12741270 #define CIFS_FATTR_INO_COLLISION 0x8
1271+#define CIFS_FATTR_UNKNOWN_NLINK 0x10
12751272
12761273 struct cifs_fattr {
12771274 u32 cf_flags;
fs/cifs/cifspdu.h+24−28
@@ -1491,15 +1491,30 @@ struct file_notify_information { · 1490 unmodified lines
14911491 __u8 FileName[0];
14921492 } __attribute__((packed));
14931493
1494−struct reparse_data {
1495− __u32 ReparseTag;
1496− __u16 ReparseDataLength;
1494+/* For IO_REPARSE_TAG_SYMLINK */
1495+struct reparse_symlink_data {
1496+ __le32 ReparseTag;
1497+ __le16 ReparseDataLength;
14971498 __u16 Reserved;
1498− __u16 SubstituteNameOffset;
1499− __u16 SubstituteNameLength;
1500− __u16 PrintNameOffset;
1501− __u16 PrintNameLength;
1502− __u32 Flags;
1499+ __le16 SubstituteNameOffset;
1500+ __le16 SubstituteNameLength;
1501+ __le16 PrintNameOffset;
1502+ __le16 PrintNameLength;
1503+ __le32 Flags;
1504+ char PathBuffer[0];
1505+} __attribute__((packed));
1506+
1507+/* For IO_REPARSE_TAG_NFS */
1508+#define NFS_SPECFILE_LNK 0x00000000014B4E4C
1509+#define NFS_SPECFILE_CHR 0x0000000000524843
1510+#define NFS_SPECFILE_BLK 0x00000000004B4C42
1511+#define NFS_SPECFILE_FIFO 0x000000004F464946
1512+#define NFS_SPECFILE_SOCK 0x000000004B434F53
1513+struct reparse_posix_data {
1514+ __le32 ReparseTag;
1515+ __le16 ReparseDataLength;
1516+ __u16 Reserved;
1517+ __le64 InodeType; /* LNK, FIFO, CHR etc. */
15031518 char PathBuffer[0];
15041519 } __attribute__((packed));
15051520
@@ -2652,26 +2667,7 @@ typedef struct file_xattr_info { · 1146 unmodified lines
26522667 } __attribute__((packed)) FILE_XATTR_INFO; /* extended attribute info
26532668 level 0x205 */
26542669
2655−
2656−/* flags for chattr command */
2657−#define EXT_SECURE_DELETE 0x00000001 /* EXT3_SECRM_FL */
2658−#define EXT_ENABLE_UNDELETE 0x00000002 /* EXT3_UNRM_FL */
2659−/* Reserved for compress file 0x4 */
2660−#define EXT_SYNCHRONOUS 0x00000008 /* EXT3_SYNC_FL */
2661−#define EXT_IMMUTABLE_FL 0x00000010 /* EXT3_IMMUTABLE_FL */
2662−#define EXT_OPEN_APPEND_ONLY 0x00000020 /* EXT3_APPEND_FL */
2663−#define EXT_DO_NOT_BACKUP 0x00000040 /* EXT3_NODUMP_FL */
2664−#define EXT_NO_UPDATE_ATIME 0x00000080 /* EXT3_NOATIME_FL */
2665−/* 0x100 through 0x800 reserved for compression flags and are GET-ONLY */
2666−#define EXT_HASH_TREE_INDEXED_DIR 0x00001000 /* GET-ONLY EXT3_INDEX_FL */
2667−/* 0x2000 reserved for IMAGIC_FL */
2668−#define EXT_JOURNAL_THIS_FILE 0x00004000 /* GET-ONLY EXT3_JOURNAL_DATA_FL */
2669−/* 0x8000 reserved for EXT3_NOTAIL_FL */
2670−#define EXT_SYNCHRONOUS_DIR 0x00010000 /* EXT3_DIRSYNC_FL */
2671−#define EXT_TOPDIR 0x00020000 /* EXT3_TOPDIR_FL */
2672−
2673−#define EXT_SET_MASK 0x000300FF
2674−#define EXT_GET_MASK 0x0003DFFF
2670+/* flags for lsattr and chflags commands removed arein uapi/linux/fs.h */
26752671
26762672 typedef struct file_chattr_info {
26772673 __le64 mask; /* list of all possible attribute bits */
fs/cifs/cifssmb.c+34−7
@@ -463,7 +463,6 @@ decode_lanman_negprot_rsp(struct TCP_Server_Info *server, NEGOTIATE_RSP *pSMBr) · 462 unmodified lines
463463 cifs_max_pending);
464464 set_credits(server, server->maxReq);
465465 server->maxBuf = le16_to_cpu(rsp->MaxBufSize);
466− server->max_vcs = le16_to_cpu(rsp->MaxNumberVcs);
467466 /* even though we do not use raw we might as well set this
468467 accurately, in case we ever find a need for it */
469468 if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) {
@@ -3089,7 +3088,8 @@ CIFSSMBQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon, · 2619 unmodified lines
30893088 bool is_unicode;
30903089 unsigned int sub_len;
30913090 char *sub_start;
3092− struct reparse_data *reparse_buf;
3091+ struct reparse_symlink_data *reparse_buf;
3092+ struct reparse_posix_data *posix_buf;
30933093 __u32 data_offset, data_count;
30943094 char *end_of_smb;
30953095
@@ -3138,20 +3138,47 @@ CIFSSMBQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon, · 42 unmodified lines
31383138 goto qreparse_out;
31393139 }
31403140 end_of_smb = 2 + get_bcc(&pSMBr->hdr) + (char *)&pSMBr->ByteCount;
3141− reparse_buf = (struct reparse_data *)
3141+ reparse_buf = (struct reparse_symlink_data *)
31423142 ((char *)&pSMBr->hdr.Protocol + data_offset);
31433143 if ((char *)reparse_buf >= end_of_smb) {
31443144 rc = -EIO;
31453145 goto qreparse_out;
31463146 }
3147− if ((reparse_buf->PathBuffer + reparse_buf->PrintNameOffset +
3148− reparse_buf->PrintNameLength) > end_of_smb) {
3147+ if (reparse_buf->ReparseTag == cpu_to_le32(IO_REPARSE_TAG_NFS)) {
3148+ cifs_dbg(FYI, "NFS style reparse tag\n");
3149+ posix_buf = (struct reparse_posix_data *)reparse_buf;
3150+
3151+ if (posix_buf->InodeType != cpu_to_le64(NFS_SPECFILE_LNK)) {
3152+ cifs_dbg(FYI, "unsupported file type 0x%llx\n",
3153+ le64_to_cpu(posix_buf->InodeType));
3154+ rc = -EOPNOTSUPP;
3155+ goto qreparse_out;
3156+ }
3157+ is_unicode = true;
3158+ sub_len = le16_to_cpu(reparse_buf->ReparseDataLength);
3159+ if (posix_buf->PathBuffer + sub_len > end_of_smb) {
3160+ cifs_dbg(FYI, "reparse buf beyond SMB\n");
3161+ rc = -EIO;
3162+ goto qreparse_out;
3163+ }
3164+ *symlinkinfo = cifs_strndup_from_utf16(posix_buf->PathBuffer,
3165+ sub_len, is_unicode, nls_codepage);
3166+ goto qreparse_out;
3167+ } else if (reparse_buf->ReparseTag !=
3168+ cpu_to_le32(IO_REPARSE_TAG_SYMLINK)) {
3169+ rc = -EOPNOTSUPP;
3170+ goto qreparse_out;
3171+ }
3172+
3173+ /* Reparse tag is NTFS symlink */
3174+ sub_start = le16_to_cpu(reparse_buf->SubstituteNameOffset) +
3175+ reparse_buf->PathBuffer;
3176+ sub_len = le16_to_cpu(reparse_buf->SubstituteNameLength);
3177+ if (sub_start + sub_len > end_of_smb) {
31493178 cifs_dbg(FYI, "reparse buf beyond SMB\n");
31503179 rc = -EIO;
31513180 goto qreparse_out;
31523181 }
3153− sub_start = reparse_buf->SubstituteNameOffset + reparse_buf->PathBuffer;
3154− sub_len = reparse_buf->SubstituteNameLength;
31553182 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE)
31563183 is_unicode = true;
31573184 else
fs/cifs/file.c+8−0
@@ -3254,6 +3254,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, · 3253 unmodified lines
32543254 /*
32553255 * Reads as many pages as possible from fscache. Returns -ENOBUFS
32563256 * immediately if the cookie is negative
3257+ *
3258+ * After this point, every page in the list might have PG_fscache set,
3259+ * so we will need to clean that up off of every page we don't use.
32573260 */
32583261 rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list,
32593262 &num_pages);
@@ -3376,6 +3379,11 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, · 116 unmodified lines
33763379 kref_put(&rdata->refcount, cifs_readdata_release);
33773380 }
33783381
3382+ /* Any pages that have been shown to fscache but didn't get added to
3383+ * the pagecache must be uncached before they get returned to the
3384+ * allocator.
3385+ */
3386+ cifs_fscache_readpages_cancel(mapping->host, page_list);
33793387 return rc;
33803388 }
33813389
fs/cifs/fscache.c+7−0
@@ -223,6 +223,13 @@ void __cifs_readpage_to_fscache(struct inode *inode, struct page *page) · 222 unmodified lines
223223 fscache_uncache_page(CIFS_I(inode)->fscache, page);
224224 }
225225
226+void __cifs_fscache_readpages_cancel(struct inode *inode, struct list_head *pages)
227+{
228+ cifs_dbg(FYI, "%s: (fsc: %p, i: %p)\n",
229+ __func__, CIFS_I(inode)->fscache, inode);
230+ fscache_readpages_cancel(CIFS_I(inode)->fscache, pages);
231+}
232+
226233 void __cifs_fscache_invalidate_page(struct page *page, struct inode *inode)
227234 {
228235 struct cifsInodeInfo *cifsi = CIFS_I(inode);
fs/cifs/fscache.h+13−0
@@ -54,6 +54,7 @@ extern int __cifs_readpages_from_fscache(struct inode *, · 53 unmodified lines
5454 struct address_space *,
5555 struct list_head *,
5656 unsigned *);
57+extern void __cifs_fscache_readpages_cancel(struct inode *, struct list_head *);
5758
5859 extern void __cifs_readpage_to_fscache(struct inode *, struct page *);
5960
@@ -91,6 +92,13 @@ static inline void cifs_readpage_to_fscache(struct inode *inode, · 31 unmodified lines
9192 __cifs_readpage_to_fscache(inode, page);
9293 }
9394
95+static inline void cifs_fscache_readpages_cancel(struct inode *inode,
96+ struct list_head *pages)
97+{
98+ if (CIFS_I(inode)->fscache)
99+ return __cifs_fscache_readpages_cancel(inode, pages);
100+}
101+
94102 #else /* CONFIG_CIFS_FSCACHE */
95103 static inline int cifs_fscache_register(void) { return 0; }
96104 static inline void cifs_fscache_unregister(void) {}
@@ -131,6 +139,11 @@ static inline int cifs_readpages_from_fscache(struct inode *inode, · 34 unmodified lines
131139 static inline void cifs_readpage_to_fscache(struct inode *inode,
132140 struct page *page) {}
133141
142+static inline void cifs_fscache_readpages_cancel(struct inode *inode,
143+ struct list_head *pages)
144+{
145+}
146+
134147 #endif /* CONFIG_CIFS_FSCACHE */
135148
136149 #endif /* _CIFS_FSCACHE_H */
fs/cifs/inode.c+39−6
@@ -120,6 +120,33 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) · 119 unmodified lines
120120 cifs_i->invalid_mapping = true;
121121 }
122122
123+/*
124+ * copy nlink to the inode, unless it wasn't provided. Provide
125+ * sane values if we don't have an existing one and none was provided
126+ */
127+static void
128+cifs_nlink_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)
129+{
130+ /*
131+ * if we're in a situation where we can't trust what we
132+ * got from the server (readdir, some non-unix cases)
133+ * fake reasonable values
134+ */
135+ if (fattr->cf_flags & CIFS_FATTR_UNKNOWN_NLINK) {
136+ /* only provide fake values on a new inode */
137+ if (inode->i_state & I_NEW) {
138+ if (fattr->cf_cifsattrs & ATTR_DIRECTORY)
139+ set_nlink(inode, 2);
140+ else
141+ set_nlink(inode, 1);
142+ }
143+ return;
144+ }
145+
146+ /* we trust the server, so update it */
147+ set_nlink(inode, fattr->cf_nlink);
148+}
149+
123150 /* populate an inode with info from a cifs_fattr struct */
124151 void
125152 cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr)
@@ -134,7 +161,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) · 8 unmodified lines
134161 inode->i_mtime = fattr->cf_mtime;
135162 inode->i_ctime = fattr->cf_ctime;
136163 inode->i_rdev = fattr->cf_rdev;
137− set_nlink(inode, fattr->cf_nlink);
164+ cifs_nlink_fattr_to_inode(inode, fattr);
138165 inode->i_uid = fattr->cf_uid;
139166 inode->i_gid = fattr->cf_gid;
140167
@@ -541,6 +568,7 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, · 400 unmodified lines
541568 fattr->cf_bytes = le64_to_cpu(info->AllocationSize);
542569 fattr->cf_createtime = le64_to_cpu(info->CreationTime);
543570
571+ fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
544572 if (fattr->cf_cifsattrs & ATTR_DIRECTORY) {
545573 fattr->cf_mode = S_IFDIR | cifs_sb->mnt_dir_mode;
546574 fattr->cf_dtype = DT_DIR;
@@ -548,7 +576,8 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, · 1 unmodified line
548576 * Server can return wrong NumberOfLinks value for directories
549577 * when Unix extensions are disabled - fake it.
550578 */
551− fattr->cf_nlink = 2;
579+ if (!tcon->unix_ext)
580+ fattr->cf_flags |= CIFS_FATTR_UNKNOWN_NLINK;
552581 } else if (fattr->cf_cifsattrs & ATTR_REPARSE) {
553582 fattr->cf_mode = S_IFLNK;
554583 fattr->cf_dtype = DT_LNK;
@@ -561,11 +590,15 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, · 6 unmodified lines
561590 if (fattr->cf_cifsattrs & ATTR_READONLY)
562591 fattr->cf_mode &= ~(S_IWUGO);
563592
564− fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
565− if (fattr->cf_nlink < 1) {
566− cifs_dbg(1, "replacing bogus file nlink value %u\n",
593+ /*
594+ * Don't accept zero nlink from non-unix servers unless
595+ * delete is pending. Instead mark it as unknown.
596+ */
597+ if ((fattr->cf_nlink < 1) && !tcon->unix_ext &&
598+ !info->DeletePending) {
599+ cifs_dbg(1, "bogus file nlink value %u\n",
567600 fattr->cf_nlink);
568− fattr->cf_nlink = 1;
601+ fattr->cf_flags |= CIFS_FATTR_UNKNOWN_NLINK;
569602 }
570603 }
571604
fs/cifs/netmisc.c+3−1
@@ -780,7 +780,9 @@ static const struct { · 779 unmodified lines
780780 ERRDOS, ERRnoaccess, 0xc0000290}, {
781781 ERRDOS, ERRbadfunc, 0xc000029c}, {
782782 ERRDOS, ERRsymlink, NT_STATUS_STOPPED_ON_SYMLINK}, {
783− ERRDOS, ERRinvlevel, 0x007c0001}, };
783+ ERRDOS, ERRinvlevel, 0x007c0001}, {
784+ 0, 0, 0 }
785+};
784786
785787 /*****************************************************************************
786788 Print an error message from the status code
fs/cifs/readdir.c+3−0
@@ -180,6 +180,9 @@ cifs_fill_common_info(struct cifs_fattr *fattr, struct cifs_sb_info *cifs_sb) · 179 unmodified lines
180180 fattr->cf_dtype = DT_REG;
181181 }
182182
183+ /* non-unix readdir doesn't provide nlink */
184+ fattr->cf_flags |= CIFS_FATTR_UNKNOWN_NLINK;
185+
183186 if (fattr->cf_cifsattrs & ATTR_READONLY)
184187 fattr->cf_mode &= ~S_IWUGO;
185188
fs/cifs/sess.c+3−85
@@ -32,88 +32,6 @@ · 31 unmodified lines
3232 #include <linux/slab.h>
3333 #include "cifs_spnego.h"
3434
35−/*
36− * Checks if this is the first smb session to be reconnected after
37− * the socket has been reestablished (so we know whether to use vc 0).
38− * Called while holding the cifs_tcp_ses_lock, so do not block
39− */
40−static bool is_first_ses_reconnect(struct cifs_ses *ses)
41−{
42− struct list_head *tmp;
43− struct cifs_ses *tmp_ses;
44−
45− list_for_each(tmp, &ses->server->smb_ses_list) {
46− tmp_ses = list_entry(tmp, struct cifs_ses,
47− smb_ses_list);
48− if (tmp_ses->need_reconnect == false)
49− return false;
50− }
51− /* could not find a session that was already connected,
52− this must be the first one we are reconnecting */
53− return true;
54−}
55−
56−/*
57− * vc number 0 is treated specially by some servers, and should be the
58− * first one we request. After that we can use vcnumbers up to maxvcs,
59− * one for each smb session (some Windows versions set maxvcs incorrectly
60− * so maxvc=1 can be ignored). If we have too many vcs, we can reuse
61− * any vc but zero (some servers reset the connection on vcnum zero)
62− *
63− */
64−static __le16 get_next_vcnum(struct cifs_ses *ses)
65−{
66− __u16 vcnum = 0;
67− struct list_head *tmp;
68− struct cifs_ses *tmp_ses;
69− __u16 max_vcs = ses->server->max_vcs;
70− __u16 i;
71− int free_vc_found = 0;
72−
73− /* Quoting the MS-SMB specification: "Windows-based SMB servers set this
74− field to one but do not enforce this limit, which allows an SMB client
75− to establish more virtual circuits than allowed by this value ... but
76− other server implementations can enforce this limit." */
77− if (max_vcs < 2)
78− max_vcs = 0xFFFF;
79−
80− spin_lock(&cifs_tcp_ses_lock);
81− if ((ses->need_reconnect) && is_first_ses_reconnect(ses))
82− goto get_vc_num_exit; /* vcnum will be zero */
83− for (i = ses->server->srv_count - 1; i < max_vcs; i++) {
84− if (i == 0) /* this is the only connection, use vc 0 */
85− break;
86−
87− free_vc_found = 1;
88−
89− list_for_each(tmp, &ses->server->smb_ses_list) {
90− tmp_ses = list_entry(tmp, struct cifs_ses,
91− smb_ses_list);
92− if (tmp_ses->vcnum == i) {
93− free_vc_found = 0;
94− break; /* found duplicate, try next vcnum */
95− }
96− }
97− if (free_vc_found)
98− break; /* we found a vcnumber that will work - use it */
99− }
100−
101− if (i == 0)
102− vcnum = 0; /* for most common case, ie if one smb session, use
103− vc zero. Also for case when no free vcnum, zero
104− is safest to send (some clients only send zero) */
105− else if (free_vc_found == 0)
106− vcnum = 1; /* we can not reuse vc=0 safely, since some servers
107− reset all uids on that, but 1 is ok. */
108− else
109− vcnum = i;
110− ses->vcnum = vcnum;
111−get_vc_num_exit:
112− spin_unlock(&cifs_tcp_ses_lock);
113−
114− return cpu_to_le16(vcnum);
115−}
116−
11735 static __u32 cifs_ssetup_hdr(struct cifs_ses *ses, SESSION_SETUP_ANDX *pSMB)
11836 {
11937 __u32 capabilities = 0;
@@ -128,7 +46,7 @@ static __u32 cifs_ssetup_hdr(struct cifs_ses *ses, SESSION_SETUP_ANDX *pSMB) · 8 unmodified lines
12846 CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4,
12947 USHRT_MAX));
13048 pSMB->req.MaxMpxCount = cpu_to_le16(ses->server->maxReq);
131− pSMB->req.VcNumber = get_next_vcnum(ses);
49+ pSMB->req.VcNumber = __constant_cpu_to_le16(1);
13250
13351 /* Now no need to set SMBFLG_CASELESS or obsolete CANONICAL PATH */
13452
@@ -582,9 +500,9 @@ select_sectype(struct TCP_Server_Info *server, enum securityEnum requested) · 447 unmodified lines
582500 return NTLMv2;
583501 if (global_secflags & CIFSSEC_MAY_NTLM)
584502 return NTLM;
585− /* Fallthrough */
586503 default:
587− return Unspecified;
504+ /* Fallthrough to attempt LANMAN authentication next */
505+ break;
588506 }
589507 case CIFS_NEGFLAVOR_LANMAN:
590508 switch (requested) {
fs/cifs/smb2pdu.c+6−0
@@ -687,6 +687,10 @@ SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) · 686 unmodified lines
687687 else
688688 return -EIO;
689689
690+ /* no need to send SMB logoff if uid already closed due to reconnect */
691+ if (ses->need_reconnect)
692+ goto smb2_session_already_dead;
693+
690694 rc = small_smb2_init(SMB2_LOGOFF, NULL, (void **) &req);
691695 if (rc)
692696 return rc;
@@ -701,6 +705,8 @@ SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) · 8 unmodified lines
701705 * No tcon so can't do
702706 * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]);
703707 */
708+
709+smb2_session_already_dead:
704710 return rc;
705711 }
706712
fs/cifs/smbfsctl.h+14−0
@@ -97,9 +97,23 @@ · 96 unmodified lines
9797 #define FSCTL_QUERY_NETWORK_INTERFACE_INFO 0x001401FC /* BB add struct */
9898 #define FSCTL_SRV_READ_HASH 0x001441BB /* BB add struct */
9999
100+/* See FSCC 2.1.2.5 */
100101 #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
101102 #define IO_REPARSE_TAG_HSM 0xC0000004
102103 #define IO_REPARSE_TAG_SIS 0x80000007
104+#define IO_REPARSE_TAG_HSM2 0x80000006
105+#define IO_REPARSE_TAG_DRIVER_EXTENDER 0x80000005
106+/* Used by the DFS filter. See MS-DFSC */
107+#define IO_REPARSE_TAG_DFS 0x8000000A
108+/* Used by the DFS filter See MS-DFSC */
109+#define IO_REPARSE_TAG_DFSR 0x80000012
110+#define IO_REPARSE_TAG_FILTER_MANAGER 0x8000000B
111+/* See section MS-FSCC 2.1.2.4 */
112+#define IO_REPARSE_TAG_SYMLINK 0xA000000C
113+#define IO_REPARSE_TAG_DEDUP 0x80000013
114+#define IO_REPARSE_APPXSTREAM 0xC0000014
115+/* NFS symlinks, Win 8/SMB3 and later */
116+#define IO_REPARSE_TAG_NFS 0x80000014
103117
104118 /* fsctl flags */
105119 /* If Flags is set to this value, the request is an FSCTL not ioctl request */
fs/cifs/transport.c+7−2
@@ -410,8 +410,13 @@ static int · 409 unmodified lines
410410 wait_for_free_request(struct TCP_Server_Info *server, const int timeout,
411411 const int optype)
412412 {
413− return wait_for_free_credits(server, timeout,
414− server->ops->get_credits_field(server, optype));
413+ int *val;
414+
415+ val = server->ops->get_credits_field(server, optype);
416+ /* Since an echo is already inflight, no need to wait to send another */
417+ if (*val <= 0 && optype == CIFS_ECHO_OP)
418+ return -EAGAIN;
419+ return wait_for_free_credits(server, timeout, val);
415420 }
416421
417422 static int allocate_mid(struct cifs_ses *ses, struct smb_hdr *in_buf,
fs/dcache.c+7−8
@@ -1331,14 +1331,6 @@ rename_retry: · 1330 unmodified lines
13311331 * list is non-empty and continue searching.
13321332 */
13331333
1334−/**
1335− * have_submounts - check for mounts over a dentry
1336− * @parent: dentry to check.
1337− *
1338− * Return true if the parent or its subdirectories contain
1339− * a mount point
1340− */
1341−
13421334 static enum d_walk_ret check_mount(void *data, struct dentry *dentry)
13431335 {
13441336 int *ret = data;
@@ -1349,6 +1341,13 @@ static enum d_walk_ret check_mount(void *data, struct dentry *dentry) · 4 unmodified lines
13491341 return D_WALK_CONTINUE;
13501342 }
13511343
1344+/**
1345+ * have_submounts - check for mounts over a dentry
1346+ * @parent: dentry to check.
1347+ *
1348+ * Return true if the parent or its subdirectories contain
1349+ * a mount point
1350+ */
13521351 int have_submounts(struct dentry *parent)
13531352 {
13541353 int ret = 0;
fs/ext3/namei.c+2−3
@@ -1783,7 +1783,7 @@ retry: · 1782 unmodified lines
17831783 d_tmpfile(dentry, inode);
17841784 err = ext3_orphan_add(handle, inode);
17851785 if (err)
1786− goto err_drop_inode;
1786+ goto err_unlock_inode;
17871787 mark_inode_dirty(inode);
17881788 unlock_new_inode(inode);
17891789 }
@@ -1791,10 +1791,9 @@ retry: · 1 unmodified line
17911791 if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries))
17921792 goto retry;
17931793 return err;
1794−err_drop_inode:
1794+err_unlock_inode:
17951795 ext3_journal_stop(handle);
17961796 unlock_new_inode(inode);
1797− iput(inode);
17981797 return err;
17991798 }
18001799
fs/ext4/inode.c+1−1
@@ -2563,7 +2563,7 @@ retry: · 2562 unmodified lines
25632563 break;
25642564 }
25652565 blk_finish_plug(&plug);
2566− if (!ret && !cycled) {
2566+ if (!ret && !cycled && wbc->nr_to_write > 0) {
25672567 cycled = 1;
25682568 mpd.last_page = writeback_index - 1;
25692569 mpd.first_page = 0;
fs/ext4/namei.c+2−3
@@ -2319,7 +2319,7 @@ retry: · 2318 unmodified lines
23192319 d_tmpfile(dentry, inode);
23202320 err = ext4_orphan_add(handle, inode);
23212321 if (err)
2322− goto err_drop_inode;
2322+ goto err_unlock_inode;
23232323 mark_inode_dirty(inode);
23242324 unlock_new_inode(inode);
23252325 }
@@ -2328,10 +2328,9 @@ retry: · 2 unmodified lines
23282328 if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries))
23292329 goto retry;
23302330 return err;
2331−err_drop_inode:
2331+err_unlock_inode:
23322332 ext4_journal_stop(handle);
23332333 unlock_new_inode(inode);
2334− iput(inode);
23352334 return err;
23362335 }
23372336
fs/ext4/xattr.c+2−0
@@ -1350,6 +1350,8 @@ retry: · 1349 unmodified lines
13501350 s_min_extra_isize) {
13511351 tried_min_extra_isize++;
13521352 new_extra_isize = s_min_extra_isize;
1353+ kfree(is); is = NULL;
1354+ kfree(bs); bs = NULL;
13531355 goto retry;
13541356 }
13551357 error = -1;
fs/fuse/dir.c+13−7
@@ -182,6 +182,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) · 181 unmodified lines
182182 struct inode *inode;
183183 struct dentry *parent;
184184 struct fuse_conn *fc;
185+ struct fuse_inode *fi;
185186 int ret;
186187
187188 inode = ACCESS_ONCE(entry->d_inode);
@@ -228,7 +229,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) · 40 unmodified lines
228229 if (!err && !outarg.nodeid)
229230 err = -ENOENT;
230231 if (!err) {
231− struct fuse_inode *fi = get_fuse_inode(inode);
232+ fi = get_fuse_inode(inode);
232233 if (outarg.nodeid != get_node_id(inode)) {
233234 fuse_queue_forget(fc, forget, outarg.nodeid, 1);
234235 goto invalid;
@@ -246,8 +247,11 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) · 11 unmodified lines
246247 attr_version);
247248 fuse_change_entry_timeout(entry, &outarg);
248249 } else if (inode) {
249− fc = get_fuse_conn(inode);
250− if (fc->readdirplus_auto) {
250+ fi = get_fuse_inode(inode);
251+ if (flags & LOOKUP_RCU) {
252+ if (test_bit(FUSE_I_INIT_RDPLUS, &fi->state))
253+ return -ECHILD;
254+ } else if (test_and_clear_bit(FUSE_I_INIT_RDPLUS, &fi->state)) {
251255 parent = dget_parent(entry);
252256 fuse_advise_use_readdirplus(parent->d_inode);
253257 dput(parent);
@@ -259,7 +263,8 @@ out: · 5 unmodified lines
259263
260264 invalid:
261265 ret = 0;
262− if (check_submounts_and_drop(entry) != 0)
266+
267+ if (!(flags & LOOKUP_RCU) && check_submounts_and_drop(entry) != 0)
263268 ret = 1;
264269 goto out;
265270 }
@@ -1063,6 +1068,8 @@ static int fuse_access(struct inode *inode, int mask) · 797 unmodified lines
10631068 struct fuse_access_in inarg;
10641069 int err;
10651070
1071+ BUG_ON(mask & MAY_NOT_BLOCK);
1072+
10661073 if (fc->no_access)
10671074 return 0;
10681075
@@ -1150,9 +1157,6 @@ static int fuse_permission(struct inode *inode, int mask) · 81 unmodified lines
11501157 noticed immediately, only after the attribute
11511158 timeout has expired */
11521159 } else if (mask & (MAY_ACCESS | MAY_CHDIR)) {
1153− if (mask & MAY_NOT_BLOCK)
1154− return -ECHILD;
1155−
11561160 err = fuse_access(inode, mask);
11571161 } else if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode)) {
11581162 if (!(inode->i_mode & S_IXUGO)) {
@@ -1291,6 +1295,8 @@ static int fuse_direntplus_link(struct file *file, · 132 unmodified lines
12911295 }
12921296
12931297 found:
1298+ if (fc->readdirplus_auto)
1299+ set_bit(FUSE_I_INIT_RDPLUS, &get_fuse_inode(inode)->state);
12941300 fuse_change_entry_timeout(dentry, o);
12951301
12961302 err = 0;
fs/fuse/file.c+17−6
@@ -2467,6 +2467,7 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, · 2466 unmodified lines
24672467 {
24682468 struct fuse_file *ff = file->private_data;
24692469 struct inode *inode = file->f_inode;
2470+ struct fuse_inode *fi = get_fuse_inode(inode);
24702471 struct fuse_conn *fc = ff->fc;
24712472 struct fuse_req *req;
24722473 struct fuse_fallocate_in inarg = {
@@ -2484,10 +2485,20 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, · 11 unmodified lines
24842485
24852486 if (lock_inode) {
24862487 mutex_lock(&inode->i_mutex);
2487− if (mode & FALLOC_FL_PUNCH_HOLE)
2488− fuse_set_nowrite(inode);
2488+ if (mode & FALLOC_FL_PUNCH_HOLE) {
2489+ loff_t endbyte = offset + length - 1;
2490+ err = filemap_write_and_wait_range(inode->i_mapping,
2491+ offset, endbyte);
2492+ if (err)
2493+ goto out;
2494+
2495+ fuse_sync_writes(inode);
2496+ }
24892497 }
24902498
2499+ if (!(mode & FALLOC_FL_KEEP_SIZE))
2500+ set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);
2501+
24912502 req = fuse_get_req_nopages(fc);
24922503 if (IS_ERR(req)) {
24932504 err = PTR_ERR(req);
@@ -2520,11 +2531,11 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, · 26 unmodified lines
25202531 fuse_invalidate_attr(inode);
25212532
25222533 out:
2523− if (lock_inode) {
2524− if (mode & FALLOC_FL_PUNCH_HOLE)
2525− fuse_release_nowrite(inode);
2534+ if (!(mode & FALLOC_FL_KEEP_SIZE))
2535+ clear_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);
2536+
2537+ if (lock_inode)
25262538 mutex_unlock(&inode->i_mutex);
2527− }
25282539
25292540 return err;
25302541 }
fs/fuse/fuse_i.h+2−0
@@ -115,6 +115,8 @@ struct fuse_inode { · 114 unmodified lines
115115 enum {
116116 /** Advise readdirplus */
117117 FUSE_I_ADVISE_RDPLUS,
118+ /** Initialized with readdirplus */
119+ FUSE_I_INIT_RDPLUS,
118120 /** An operation changing file size is in progress */
119121 FUSE_I_SIZE_UNSTABLE,
120122 };
fs/jfs/jfs_inode.c+1−2
@@ -95,7 +95,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) · 94 unmodified lines
9595
9696 if (insert_inode_locked(inode) < 0) {
9797 rc = -EINVAL;
98− goto fail_unlock;
98+ goto fail_put;
9999 }
100100
101101 inode_init_owner(inode, parent, mode);
@@ -156,7 +156,6 @@ struct inode *ialloc(struct inode *parent, umode_t mode) · 54 unmodified lines
156156 fail_drop:
157157 dquot_drop(inode);
158158 inode->i_flags |= S_NOQUOTA;
159−fail_unlock:
160159 clear_nlink(inode);
161160 unlock_new_inode(inode);
162161 fail_put:
fs/namei.c+2−1
@@ -2294,10 +2294,11 @@ out: · 2293 unmodified lines
22942294 * path_mountpoint - look up a path to be umounted
22952295 * @dfd: directory file descriptor to start walk from
22962296 * @name: full pathname to walk
2297+ * @path: pointer to container for result
22972298 * @flags: lookup flags
22982299 *
22992300 * Look up the given name, but don't attempt to revalidate the last component.
2300− * Returns 0 and "path" will be valid on success; Retuns error otherwise.
2301+ * Returns 0 and "path" will be valid on success; Returns error otherwise.
23012302 */
23022303 static int
23032304 path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags)
fs/proc/inode.c+7−3
@@ -288,10 +288,14 @@ static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) · 287 unmodified lines
288288 static unsigned long proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags)
289289 {
290290 struct proc_dir_entry *pde = PDE(file_inode(file));
291− int rv = -EIO;
292− unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
291+ unsigned long rv = -EIO;
292+ unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long) = NULL;
293293 if (use_pde(pde)) {
294− get_unmapped_area = pde->proc_fops->get_unmapped_area;
294+#ifdef CONFIG_MMU
295+ get_unmapped_area = current->mm->get_unmapped_area;
296+#endif
297+ if (pde->proc_fops->get_unmapped_area)
298+ get_unmapped_area = pde->proc_fops->get_unmapped_area;
295299 if (get_unmapped_area)
296300 rv = get_unmapped_area(file, orig_addr, len, pgoff, flags);
297301 unuse_pde(pde);
fs/proc/task_mmu.c+3−1
@@ -941,6 +941,8 @@ static void pte_to_pagemap_entry(pagemap_entry_t *pme, struct pagemapread *pm, · 940 unmodified lines
941941 frame = pte_pfn(pte);
942942 flags = PM_PRESENT;
943943 page = vm_normal_page(vma, addr, pte);
944+ if (pte_soft_dirty(pte))
945+ flags2 |= __PM_SOFT_DIRTY;
944946 } else if (is_swap_pte(pte)) {
945947 swp_entry_t entry;
946948 if (pte_swp_soft_dirty(pte))
@@ -960,7 +962,7 @@ static void pte_to_pagemap_entry(pagemap_entry_t *pme, struct pagemapread *pm, · 13 unmodified lines
960962
961963 if (page && !PageAnon(page))
962964 flags |= PM_FILE;
963− if ((vma->vm_flags & VM_SOFTDIRTY) || pte_soft_dirty(pte))
965+ if ((vma->vm_flags & VM_SOFTDIRTY))
964966 flags2 |= __PM_SOFT_DIRTY;
965967
966968 *pme = make_pme(PM_PFRAME(frame) | PM_STATUS2(pm->v2, flags2) | flags);
fs/statfs.c+1−1
@@ -94,7 +94,7 @@ retry: · 93 unmodified lines
9494
9595 int fd_statfs(int fd, struct kstatfs *st)
9696 {
97− struct fd f = fdget(fd);
97+ struct fd f = fdget_raw(fd);
9898 int error = -EBADF;
9999 if (f.file) {
100100 error = vfs_statfs(&f.file->f_path, st);
fs/xfs/xfs_dir2_block.c+3−3
@@ -1158,7 +1158,7 @@ xfs_dir2_sf_to_block( · 1157 unmodified lines
11581158 /*
11591159 * Create entry for .
11601160 */
1161− dep = xfs_dir3_data_dot_entry_p(hdr);
1161+ dep = xfs_dir3_data_dot_entry_p(mp, hdr);
11621162 dep->inumber = cpu_to_be64(dp->i_ino);
11631163 dep->namelen = 1;
11641164 dep->name[0] = '.';
@@ -1172,7 +1172,7 @@ xfs_dir2_sf_to_block( · 7 unmodified lines
11721172 /*
11731173 * Create entry for ..
11741174 */
1175− dep = xfs_dir3_data_dotdot_entry_p(hdr);
1175+ dep = xfs_dir3_data_dotdot_entry_p(mp, hdr);
11761176 dep->inumber = cpu_to_be64(xfs_dir2_sf_get_parent_ino(sfp));
11771177 dep->namelen = 2;
11781178 dep->name[0] = dep->name[1] = '.';
@@ -1183,7 +1183,7 @@ xfs_dir2_sf_to_block( · 4 unmodified lines
11831183 blp[1].hashval = cpu_to_be32(xfs_dir_hash_dotdot);
11841184 blp[1].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp,
11851185 (char *)dep - (char *)hdr));
1186− offset = xfs_dir3_data_first_offset(hdr);
1186+ offset = xfs_dir3_data_first_offset(mp);
11871187 /*
11881188 * Loop over existing entries, stuff them in.
11891189 */
fs/xfs/xfs_dir2_format.h+20−31
@@ -497,69 +497,58 @@ xfs_dir3_data_unused_p(struct xfs_dir2_data_hdr *hdr) · 496 unmodified lines
497497 /*
498498 * Offsets of . and .. in data space (always block 0)
499499 *
500− * The macros are used for shortform directories as they have no headers to read
501− * the magic number out of. Shortform directories need to know the size of the
502− * data block header because the sfe embeds the block offset of the entry into
503− * it so that it doesn't change when format conversion occurs. Bad Things Happen
504− * if we don't follow this rule.
505− *
506500 * XXX: there is scope for significant optimisation of the logic here. Right
507501 * now we are checking for "dir3 format" over and over again. Ideally we should
508502 * only do it once for each operation.
509503 */
510−#define XFS_DIR3_DATA_DOT_OFFSET(mp) \
511− xfs_dir3_data_hdr_size(xfs_sb_version_hascrc(&(mp)->m_sb))
512−#define XFS_DIR3_DATA_DOTDOT_OFFSET(mp) \
513− (XFS_DIR3_DATA_DOT_OFFSET(mp) + xfs_dir3_data_entsize(mp, 1))
514−#define XFS_DIR3_DATA_FIRST_OFFSET(mp) \
515− (XFS_DIR3_DATA_DOTDOT_OFFSET(mp) + xfs_dir3_data_entsize(mp, 2))
516−
517504 static inline xfs_dir2_data_aoff_t
518−xfs_dir3_data_dot_offset(struct xfs_dir2_data_hdr *hdr)
505+xfs_dir3_data_dot_offset(struct xfs_mount *mp)
519506 {
520− return xfs_dir3_data_entry_offset(hdr);
507+ return xfs_dir3_data_hdr_size(xfs_sb_version_hascrc(&mp->m_sb));
521508 }
522509
523510 static inline xfs_dir2_data_aoff_t
524−xfs_dir3_data_dotdot_offset(struct xfs_dir2_data_hdr *hdr)
511+xfs_dir3_data_dotdot_offset(struct xfs_mount *mp)
525512 {
526− bool dir3 = hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) ||
527− hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC);
528− return xfs_dir3_data_dot_offset(hdr) +
529− __xfs_dir3_data_entsize(dir3, 1);
513+ return xfs_dir3_data_dot_offset(mp) +
514+ xfs_dir3_data_entsize(mp, 1);
530515 }
531516
532517 static inline xfs_dir2_data_aoff_t
533−xfs_dir3_data_first_offset(struct xfs_dir2_data_hdr *hdr)
518+xfs_dir3_data_first_offset(struct xfs_mount *mp)
534519 {
535− bool dir3 = hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) ||
536− hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC);
537− return xfs_dir3_data_dotdot_offset(hdr) +
538− __xfs_dir3_data_entsize(dir3, 2);
520+ return xfs_dir3_data_dotdot_offset(mp) +
521+ xfs_dir3_data_entsize(mp, 2);
539522 }
540523
541524 /*
542525 * location of . and .. in data space (always block 0)
543526 */
544527 static inline struct xfs_dir2_data_entry *
545−xfs_dir3_data_dot_entry_p(struct xfs_dir2_data_hdr *hdr)
528+xfs_dir3_data_dot_entry_p(
529+ struct xfs_mount *mp,
530+ struct xfs_dir2_data_hdr *hdr)
546531 {
547532 return (struct xfs_dir2_data_entry *)
548− ((char *)hdr + xfs_dir3_data_dot_offset(hdr));
533+ ((char *)hdr + xfs_dir3_data_dot_offset(mp));
549534 }
550535
551536 static inline struct xfs_dir2_data_entry *
552−xfs_dir3_data_dotdot_entry_p(struct xfs_dir2_data_hdr *hdr)
537+xfs_dir3_data_dotdot_entry_p(
538+ struct xfs_mount *mp,
539+ struct xfs_dir2_data_hdr *hdr)
553540 {
554541 return (struct xfs_dir2_data_entry *)
555− ((char *)hdr + xfs_dir3_data_dotdot_offset(hdr));
542+ ((char *)hdr + xfs_dir3_data_dotdot_offset(mp));
556543 }
557544
558545 static inline struct xfs_dir2_data_entry *
559−xfs_dir3_data_first_entry_p(struct xfs_dir2_data_hdr *hdr)
546+xfs_dir3_data_first_entry_p(
547+ struct xfs_mount *mp,
548+ struct xfs_dir2_data_hdr *hdr)
560549 {
561550 return (struct xfs_dir2_data_entry *)
562− ((char *)hdr + xfs_dir3_data_first_offset(hdr));
551+ ((char *)hdr + xfs_dir3_data_first_offset(mp));
563552 }
564553
565554 /*
fs/xfs/xfs_dir2_readdir.c+2−2
@@ -119,9 +119,9 @@ xfs_dir2_sf_getdents( · 118 unmodified lines
119119 * mp->m_dirdatablk.
120120 */
121121 dot_offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk,
122− XFS_DIR3_DATA_DOT_OFFSET(mp));
122+ xfs_dir3_data_dot_offset(mp));
123123 dotdot_offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk,
124− XFS_DIR3_DATA_DOTDOT_OFFSET(mp));
124+ xfs_dir3_data_dotdot_offset(mp));
125125
126126 /*
127127 * Put . entry unless we're starting past it.
fs/xfs/xfs_dir2_sf.c+3−3
@@ -557,7 +557,7 @@ xfs_dir2_sf_addname_hard( · 556 unmodified lines
557557 * to insert the new entry.
558558 * If it's going to end up at the end then oldsfep will point there.
559559 */
560− for (offset = XFS_DIR3_DATA_FIRST_OFFSET(mp),
560+ for (offset = xfs_dir3_data_first_offset(mp),
561561 oldsfep = xfs_dir2_sf_firstentry(oldsfp),
562562 add_datasize = xfs_dir3_data_entsize(mp, args->namelen),
563563 eof = (char *)oldsfep == &buf[old_isize];
@@ -640,7 +640,7 @@ xfs_dir2_sf_addname_pick( · 76 unmodified lines
640640
641641 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
642642 size = xfs_dir3_data_entsize(mp, args->namelen);
643− offset = XFS_DIR3_DATA_FIRST_OFFSET(mp);
643+ offset = xfs_dir3_data_first_offset(mp);
644644 sfep = xfs_dir2_sf_firstentry(sfp);
645645 holefit = 0;
646646 /*
@@ -713,7 +713,7 @@ xfs_dir2_sf_check( · 66 unmodified lines
713713 mp = dp->i_mount;
714714
715715 sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
716− offset = XFS_DIR3_DATA_FIRST_OFFSET(mp);
716+ offset = xfs_dir3_data_first_offset(mp);
717717 ino = xfs_dir2_sf_get_parent_ino(sfp);
718718 i8count = ino > XFS_DIR2_MAX_SHORT_INUM;
719719
fs/xfs/xfs_dquot.c+16−3
@@ -64,7 +64,8 @@ int xfs_dqerror_mod = 33; · 63 unmodified lines
6464 struct kmem_zone *xfs_qm_dqtrxzone;
6565 static struct kmem_zone *xfs_qm_dqzone;
6666
67−static struct lock_class_key xfs_dquot_other_class;
67+static struct lock_class_key xfs_dquot_group_class;
68+static struct lock_class_key xfs_dquot_project_class;
6869
6970 /*
7071 * This is called to free all the memory associated with a dquot
@@ -703,8 +704,20 @@ xfs_qm_dqread( · 632 unmodified lines
703704 * Make sure group quotas have a different lock class than user
704705 * quotas.
705706 */
706− if (!(type & XFS_DQ_USER))
707− lockdep_set_class(&dqp->q_qlock, &xfs_dquot_other_class);
707+ switch (type) {
708+ case XFS_DQ_USER:
709+ /* uses the default lock class */
710+ break;
711+ case XFS_DQ_GROUP:
712+ lockdep_set_class(&dqp->q_qlock, &xfs_dquot_group_class);
713+ break;
714+ case XFS_DQ_PROJ:
715+ lockdep_set_class(&dqp->q_qlock, &xfs_dquot_project_class);
716+ break;
717+ default:
718+ ASSERT(0);
719+ break;
720+ }
708721
709722 XFS_STATS_INC(xs_qm_dquot);
710723
fs/xfs/xfs_log_recover.c+1−0
@@ -1585,6 +1585,7 @@ xlog_recover_add_to_trans( · 1584 unmodified lines
15851585 "bad number of regions (%d) in inode log format",
15861586 in_f->ilf_size);
15871587 ASSERT(0);
1588+ kmem_free(ptr);
15881589 return XFS_ERROR(EIO);
15891590 }
15901591
include/acpi/acpi_bus.h+0−7
@@ -311,7 +311,6 @@ struct acpi_device { · 310 unmodified lines
311311 unsigned int physical_node_count;
312312 struct list_head physical_node_list;
313313 struct mutex physical_node_lock;
314− struct list_head power_dependent;
315314 void (*remove)(struct acpi_device *);
316315 };
317316
@@ -456,8 +455,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev, · 138 unmodified lines
456455 acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
457456 acpi_notify_handler handler);
458457 int acpi_pm_device_sleep_state(struct device *, int *, int);
459−void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
460−void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev);
461458 #else
462459 static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
463460 acpi_notify_handler handler,
@@ -478,10 +475,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) · 14 unmodified lines
478475 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ?
479476 m : ACPI_STATE_D0;
480477 }
481−static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
482− struct device *depdev) {}
483−static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,
484− struct device *depdev) {}
485478 #endif
486479
487480 #ifdef CONFIG_PM_RUNTIME
include/asm-generic/hugetlb.h+2−2
@@ -6,12 +6,12 @@ static inline pte_t mk_huge_pte(struct page *page, pgprot_t pgprot) · 5 unmodified lines
66 return mk_pte(page, pgprot);
77 }
88
9−static inline int huge_pte_write(pte_t pte)
9+static inline unsigned long huge_pte_write(pte_t pte)
1010 {
1111 return pte_write(pte);
1212 }
1313
14−static inline int huge_pte_dirty(pte_t pte)
14+static inline unsigned long huge_pte_dirty(pte_t pte)
1515 {
1616 return pte_dirty(pte);
1717 }
include/dt-bindings/pinctrl/omap.h+1−3
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #define PULL_UP (1 << 4)
2424 #define ALTELECTRICALSEL (1 << 5)
2525
26−/* 34xx specific mux bit defines */
26+/* omap3/4/5 specific mux bit defines */
2727 #define INPUT_EN (1 << 8)
2828 #define OFF_EN (1 << 9)
2929 #define OFFOUT_EN (1 << 10)
@@ -31,8 +31,6 @@ · 1 unmodified line
3131 #define OFF_PULL_EN (1 << 12)
3232 #define OFF_PULL_UP (1 << 13)
3333 #define WAKEUP_EN (1 << 14)
34−
35−/* 44xx specific mux bit defines */
3634 #define WAKEUP_EVENT (1 << 15)
3735
3836 /* Active pin states */
include/linux/compiler-gcc4.h+15−0
@@ -65,6 +65,21 @@ · 64 unmodified lines
6565 #define __visible __attribute__((externally_visible))
6666 #endif
6767
68+/*
69+ * GCC 'asm goto' miscompiles certain code sequences:
70+ *
71+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
72+ *
73+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
74+ * Fixed in GCC 4.8.2 and later versions.
75+ *
76+ * (asm goto is automatically volatile - the naming reflects this.)
77+ */
78+#if GCC_VERSION <= 40801
79+# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
80+#else
81+# define asm_volatile_goto(x...) do { asm goto(x); } while (0)
82+#endif
6883
6984 #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
7085 #if GCC_VERSION >= 40400
include/linux/intel-iommu.h+1−1
@@ -55,7 +55,7 @@ · 54 unmodified lines
5555 #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */
5656 #define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */
5757 #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */
58−#define DMAR_ICS_REG 0x98 /* Invalidation complete status register */
58+#define DMAR_ICS_REG 0x9c /* Invalidation complete status register */
5959 #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */
6060
6161 #define OFFSET_STRIDE (9)
include/linux/memcontrol.h+11−39
@@ -137,47 +137,24 @@ extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, · 136 unmodified lines
137137 extern void mem_cgroup_replace_page_cache(struct page *oldpage,
138138 struct page *newpage);
139139
140−/**
141− * mem_cgroup_toggle_oom - toggle the memcg OOM killer for the current task
142− * @new: true to enable, false to disable
143− *
144− * Toggle whether a failed memcg charge should invoke the OOM killer
145− * or just return -ENOMEM. Returns the previous toggle state.
146− *
147− * NOTE: Any path that enables the OOM killer before charging must
148− * call mem_cgroup_oom_synchronize() afterward to finalize the
149− * OOM handling and clean up.
150− */
151−static inline bool mem_cgroup_toggle_oom(bool new)
140+static inline void mem_cgroup_oom_enable(void)
152141 {
153− bool old;
154−
155− old = current->memcg_oom.may_oom;
156− current->memcg_oom.may_oom = new;
157−
158− return old;
142+ WARN_ON(current->memcg_oom.may_oom);
143+ current->memcg_oom.may_oom = 1;
159144 }
160145
161−static inline void mem_cgroup_enable_oom(void)
146+static inline void mem_cgroup_oom_disable(void)
162147 {
163− bool old = mem_cgroup_toggle_oom(true);
164−
165− WARN_ON(old == true);
166−}
167−
168−static inline void mem_cgroup_disable_oom(void)
169−{
170− bool old = mem_cgroup_toggle_oom(false);
171−
172− WARN_ON(old == false);
148+ WARN_ON(!current->memcg_oom.may_oom);
149+ current->memcg_oom.may_oom = 0;
173150 }
174151
175152 static inline bool task_in_memcg_oom(struct task_struct *p)
176153 {
177− return p->memcg_oom.in_memcg_oom;
154+ return p->memcg_oom.memcg;
178155 }
179156
180−bool mem_cgroup_oom_synchronize(void);
157+bool mem_cgroup_oom_synchronize(bool wait);
181158
182159 #ifdef CONFIG_MEMCG_SWAP
183160 extern int do_swap_account;
@@ -402,16 +379,11 @@ static inline void mem_cgroup_end_update_page_stat(struct page *page, · 218 unmodified lines
402379 {
403380 }
404381
405−static inline bool mem_cgroup_toggle_oom(bool new)
406−{
407− return false;
408−}
409−
410−static inline void mem_cgroup_enable_oom(void)
382+static inline void mem_cgroup_oom_enable(void)
411383 {
412384 }
413385
414−static inline void mem_cgroup_disable_oom(void)
386+static inline void mem_cgroup_oom_disable(void)
415387 {
416388 }
417389
@@ -420,7 +392,7 @@ static inline bool task_in_memcg_oom(struct task_struct *p) · 2 unmodified lines
420392 return false;
421393 }
422394
423−static inline bool mem_cgroup_oom_synchronize(void)
395+static inline bool mem_cgroup_oom_synchronize(bool wait)
424396 {
425397 return false;
426398 }
include/linux/miscdevice.h+1−0
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #define MAPPER_CTRL_MINOR 236
4646 #define LOOP_CTRL_MINOR 237
4747 #define VHOST_NET_MINOR 238
48+#define UHID_MINOR 239
4849 #define MISC_DYNAMIC_MINOR 255
4950
5051 struct device;
include/linux/mlx5/device.h+2−2
@@ -181,7 +181,7 @@ enum { · 180 unmodified lines
181181 MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39,
182182 MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40,
183183 MLX5_DEV_CAP_FLAG_DCT = 1LL << 41,
184− MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 1LL << 46,
184+ MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 3LL << 46,
185185 };
186186
187187 enum {
@@ -417,7 +417,7 @@ struct mlx5_init_seg { · 229 unmodified lines
417417 struct health_buffer health;
418418 __be32 rsvd2[884];
419419 __be32 health_counter;
420− __be32 rsvd3[1023];
420+ __be32 rsvd3[1019];
421421 __be64 ieee1588_clk;
422422 __be32 ieee1588_clk_type;
423423 __be32 clr_intx;
include/linux/mlx5/driver.h+2−4
@@ -82,7 +82,7 @@ enum { · 81 unmodified lines
8282 };
8383
8484 enum {
85− MLX5_MAX_EQ_NAME = 20
85+ MLX5_MAX_EQ_NAME = 32
8686 };
8787
8888 enum {
@@ -747,8 +747,7 @@ static inline u32 mlx5_idx_to_mkey(u32 mkey_idx) · 658 unmodified lines
747747
748748 enum {
749749 MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0,
750− MLX5_PROF_MASK_CMDIF_CSUM = (u64)1 << 1,
751− MLX5_PROF_MASK_MR_CACHE = (u64)1 << 2,
750+ MLX5_PROF_MASK_MR_CACHE = (u64)1 << 1,
752751 };
753752
754753 enum {
@@ -758,7 +757,6 @@ enum { · 3 unmodified lines
758757 struct mlx5_profile {
759758 u64 mask;
760759 u32 log_max_qp;
761− int cmdif_csum;
762760 struct {
763761 int size;
764762 int limit;
include/linux/of_reserved_mem.h+0−14
@@ -1,14 +0,0 @@
1−#ifndef __OF_RESERVED_MEM_H
2−#define __OF_RESERVED_MEM_H
3−
4−#ifdef CONFIG_OF_RESERVED_MEM
5−void of_reserved_mem_device_init(struct device *dev);
6−void of_reserved_mem_device_release(struct device *dev);
7−void early_init_dt_scan_reserved_mem(void);
8−#else
9−static inline void of_reserved_mem_device_init(struct device *dev) { }
10−static inline void of_reserved_mem_device_release(struct device *dev) { }
11−static inline void early_init_dt_scan_reserved_mem(void) { }
12−#endif
13−
14−#endif /* __OF_RESERVED_MEM_H */
include/linux/perf_event.h+23−1
@@ -294,9 +294,31 @@ struct ring_buffer; · 293 unmodified lines
294294 */
295295 struct perf_event {
296296 #ifdef CONFIG_PERF_EVENTS
297− struct list_head group_entry;
297+ /*
298+ * entry onto perf_event_context::event_list;
299+ * modifications require ctx->lock
300+ * RCU safe iterations.
301+ */
298302 struct list_head event_entry;
303+
304+ /*
305+ * XXX: group_entry and sibling_list should be mutually exclusive;
306+ * either you're a sibling on a group, or you're the group leader.
307+ * Rework the code to always use the same list element.
308+ *
309+ * Locked for modification by both ctx->mutex and ctx->lock; holding
310+ * either sufficies for read.
311+ */
312+ struct list_head group_entry;
299313 struct list_head sibling_list;
314+
315+ /*
316+ * We need storage to track the entries in perf_pmu_migrate_context; we
317+ * cannot use the event_entry because of RCU and we want to keep the
318+ * group in tact which avoids us using the other two entries.
319+ */
320+ struct list_head migrate_entry;
321+
300322 struct hlist_node hlist_entry;
301323 int nr_siblings;
302324 int group_flags;
include/linux/random.h+1−0
@@ -17,6 +17,7 @@ extern void add_interrupt_randomness(int irq, int irq_flags); · 16 unmodified lines
1717 extern void get_random_bytes(void *buf, int nbytes);
1818 extern void get_random_bytes_arch(void *buf, int nbytes);
1919 void generate_random_uuid(unsigned char uuid_out[16]);
20+extern int random_int_secret_init(void);
2021
2122 #ifndef MODULE
2223 extern const struct file_operations random_fops, urandom_fops;
include/linux/sched.h+3−4
@@ -1394,11 +1394,10 @@ struct task_struct { · 1393 unmodified lines
13941394 } memcg_batch;
13951395 unsigned int memcg_kmem_skip_account;
13961396 struct memcg_oom_info {
1397+ struct mem_cgroup *memcg;
1398+ gfp_t gfp_mask;
1399+ int order;
13971400 unsigned int may_oom:1;
1398− unsigned int in_memcg_oom:1;
1399− unsigned int oom_locked:1;
1400− int wakeups;
1401− struct mem_cgroup *wait_on_memcg;
14021401 } memcg_oom;
14031402 #endif
14041403 #ifdef CONFIG_UPROBES
include/linux/timex.h+14−0
@@ -64,6 +64,20 @@ · 63 unmodified lines
6464
6565 #include <asm/timex.h>
6666
67+#ifndef random_get_entropy
68+/*
69+ * The random_get_entropy() function is used by the /dev/random driver
70+ * in order to extract entropy via the relative unpredictability of
71+ * when an interrupt takes places versus a high speed, fine-grained
72+ * timing source or cycle counter. Since it will be occurred on every
73+ * single interrupt, it must have a very low cost/overhead.
74+ *
75+ * By default we use get_cycles() for this purpose, but individual
76+ * architectures may override this in their asm/timex.h header file.
77+ */
78+#define random_get_entropy() get_cycles()
79+#endif
80+
6781 /*
6882 * SHIFT_PLL is used as a dampening factor to define how much we
6983 * adjust the frequency correction for a given offset in PLL mode.
include/linux/usb/usb_phy_gen_xceiv.h+1−1
@@ -12,7 +12,7 @@ struct usb_phy_gen_xceiv_platform_data { · 11 unmodified lines
1212 unsigned int needs_reset:1;
1313 };
1414
15−#if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
15+#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
1616 /* sometimes transceivers are accessed only through e.g. ULPI */
1717 extern void usb_nop_xceiv_register(void);
1818 extern void usb_nop_xceiv_unregister(void);
include/linux/usb_usual.h+3−1
@@ -66,7 +66,9 @@ · 65 unmodified lines
6666 US_FLAG(INITIAL_READ10, 0x00100000) \
6767 /* Initial READ(10) (and others) must be retried */ \
6868 US_FLAG(WRITE_CACHE, 0x00200000) \
69− /* Write Cache status is not available */
69+ /* Write Cache status is not available */ \
70+ US_FLAG(NEEDS_CAP16, 0x00400000)
71+ /* cannot handle READ_CAPACITY_10 */
7072
7173 #define US_FLAG(name, value) US_FL_##name = value ,
7274 enum { US_DO_ALL_FLAGS };
include/linux/vgaarb.h+0−7
@@ -65,15 +65,8 @@ struct pci_dev; · 64 unmodified lines
6565 * out of the arbitration process (and can be safe to take
6666 * interrupts at any time.
6767 */
68−#if defined(CONFIG_VGA_ARB)
6968 extern void vga_set_legacy_decoding(struct pci_dev *pdev,
7069 unsigned int decodes);
71−#else
72−static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
73− unsigned int decodes)
74−{
75−}
76−#endif
7770
7871 /**
7972 * vga_get - acquire & locks VGA resources
include/linux/yam.h+1−1
@@ -77,6 +77,6 @@ struct yamdrv_ioctl_cfg { · 76 unmodified lines
7777
7878 struct yamdrv_ioctl_mcs {
7979 int cmd;
80− int bitrate;
80+ unsigned int bitrate;
8181 unsigned char bits[YAM_FPGA_SIZE];
8282 };
include/net/cipso_ipv4.h+4−2
@@ -290,6 +290,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, · 289 unmodified lines
290290 unsigned char err_offset = 0;
291291 u8 opt_len = opt[1];
292292 u8 opt_iter;
293+ u8 tag_len;
293294
294295 if (opt_len < 8) {
295296 err_offset = 1;
@@ -302,11 +303,12 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, · 6 unmodified lines
302303 }
303304
304305 for (opt_iter = 6; opt_iter < opt_len;) {
305− if (opt[opt_iter + 1] > (opt_len - opt_iter)) {
306+ tag_len = opt[opt_iter + 1];
307+ if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) {
306308 err_offset = opt_iter + 1;
307309 goto out;
308310 }
309− opt_iter += opt[opt_iter + 1];
311+ opt_iter += tag_len;
310312 }
311313
312314 out:
include/net/dst.h+12−0
@@ -478,10 +478,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net, · 477 unmodified lines
478478 {
479479 return dst_orig;
480480 }
481+
482+static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
483+{
484+ return NULL;
485+}
486+
481487 #else
482488 struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
483489 const struct flowi *fl, struct sock *sk,
484490 int flags);
491+
492+/* skb attached with this dst needs transformation if dst->xfrm is valid */
493+static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
494+{
495+ return dst->xfrm;
496+}
485497 #endif
486498
487499 #endif /* _NET_DST_H */
include/net/ip6_route.h+2−4
@@ -182,11 +182,9 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) · 181 unmodified lines
182182 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
183183 }
184184
185−static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest)
185+static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt)
186186 {
187− if (rt->rt6i_flags & RTF_GATEWAY)
188− return &rt->rt6i_gateway;
189− return dest;
187+ return &rt->rt6i_gateway;
190188 }
191189
192190 #endif
include/net/mac802154.h+1−1
@@ -133,7 +133,7 @@ struct ieee802154_ops { · 132 unmodified lines
133133
134134 /* Basic interface to register ieee802154 device */
135135 struct ieee802154_dev *
136−ieee802154_alloc_device(size_t priv_data_lex, struct ieee802154_ops *ops);
136+ieee802154_alloc_device(size_t priv_data_len, struct ieee802154_ops *ops);
137137 void ieee802154_free_device(struct ieee802154_dev *dev);
138138 int ieee802154_register_device(struct ieee802154_dev *dev);
139139 void ieee802154_unregister_device(struct ieee802154_dev *dev);
include/sound/rcar_snd.h+1−0
@@ -68,6 +68,7 @@ struct rsnd_scu_platform_info { · 67 unmodified lines
6868 *
6969 * A : generation
7070 */
71+#define RSND_GEN_MASK (0xF << 0)
7172 #define RSND_GEN1 (1 << 0) /* fixme */
7273 #define RSND_GEN2 (2 << 0) /* fixme */
7374
include/uapi/drm/drm_mode.h+2−0
@@ -223,6 +223,8 @@ struct drm_mode_get_connector { · 222 unmodified lines
223223 __u32 connection;
224224 __u32 mm_width, mm_height; /**< HxW in millimeters */
225225 __u32 subpixel;
226+
227+ __u32 pad;
226228 };
227229
228230 #define DRM_MODE_PROP_PENDING (1<<0)
include/uapi/rdma/ib_user_verbs.h+6−0
@@ -87,8 +87,10 @@ enum { · 86 unmodified lines
8787 IB_USER_VERBS_CMD_CLOSE_XRCD,
8888 IB_USER_VERBS_CMD_CREATE_XSRQ,
8989 IB_USER_VERBS_CMD_OPEN_QP,
90+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
9091 IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
9192 IB_USER_VERBS_CMD_DESTROY_FLOW
93+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
9294 };
9395
9496 /*
@@ -126,6 +128,7 @@ struct ib_uverbs_cmd_hdr { · 31 unmodified lines
126128 __u16 out_words;
127129 };
128130
131+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
129132 struct ib_uverbs_cmd_hdr_ex {
130133 __u32 command;
131134 __u16 in_words;
@@ -134,6 +137,7 @@ struct ib_uverbs_cmd_hdr_ex { · 2 unmodified lines
134137 __u16 provider_out_words;
135138 __u32 cmd_hdr_reserved;
136139 };
140+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
137141
138142 struct ib_uverbs_get_context {
139143 __u64 response;
@@ -696,6 +700,7 @@ struct ib_uverbs_detach_mcast { · 556 unmodified lines
696700 __u64 driver_data[0];
697701 };
698702
703+#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
699704 struct ib_kern_eth_filter {
700705 __u8 dst_mac[6];
701706 __u8 src_mac[6];
@@ -780,6 +785,7 @@ struct ib_uverbs_destroy_flow { · 78 unmodified lines
780785 __u32 comp_mask;
781786 __u32 flow_handle;
782787 };
788+#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
783789
784790 struct ib_uverbs_create_srq {
785791 __u64 response;
init/main.c+2−0
@@ -76,6 +76,7 @@ · 75 unmodified lines
7676 #include <linux/elevator.h>
7777 #include <linux/sched_clock.h>
7878 #include <linux/context_tracking.h>
79+#include <linux/random.h>
7980
8081 #include <asm/io.h>
8182 #include <asm/bugs.h>
@@ -787,6 +788,7 @@ static void __init do_basic_setup(void) · 705 unmodified lines
787788 do_ctors();
788789 usermodehelper_enable();
789790 do_initcalls();
791+ random_int_secret_init();
790792 }
791793
792794 static void __init do_pre_smp_initcalls(void)
ipc/sem.c+29−13
@@ -1282,6 +1282,12 @@ static int semctl_setval(struct ipc_namespace *ns, int semid, int semnum, · 1281 unmodified lines
12821282
12831283 sem_lock(sma, NULL, -1);
12841284
1285+ if (sma->sem_perm.deleted) {
1286+ sem_unlock(sma, -1);
1287+ rcu_read_unlock();
1288+ return -EIDRM;
1289+ }
1290+
12851291 curr = &sma->sem_base[semnum];
12861292
12871293 ipc_assert_locked_object(&sma->sem_perm);
@@ -1336,12 +1342,14 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, · 48 unmodified lines
13361342 int i;
13371343
13381344 sem_lock(sma, NULL, -1);
1345+ if (sma->sem_perm.deleted) {
1346+ err = -EIDRM;
1347+ goto out_unlock;
1348+ }
13391349 if(nsems > SEMMSL_FAST) {
13401350 if (!ipc_rcu_getref(sma)) {
1341− sem_unlock(sma, -1);
1342− rcu_read_unlock();
13431351 err = -EIDRM;
1344− goto out_free;
1352+ goto out_unlock;
13451353 }
13461354 sem_unlock(sma, -1);
13471355 rcu_read_unlock();
@@ -1354,10 +1362,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, · 6 unmodified lines
13541362 rcu_read_lock();
13551363 sem_lock_and_putref(sma);
13561364 if (sma->sem_perm.deleted) {
1357− sem_unlock(sma, -1);
1358− rcu_read_unlock();
13591365 err = -EIDRM;
1360− goto out_free;
1366+ goto out_unlock;
13611367 }
13621368 }
13631369 for (i = 0; i < sma->sem_nsems; i++)
@@ -1375,8 +1381,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, · 11 unmodified lines
13751381 struct sem_undo *un;
13761382
13771383 if (!ipc_rcu_getref(sma)) {
1378− rcu_read_unlock();
1379− return -EIDRM;
1384+ err = -EIDRM;
1385+ goto out_rcu_wakeup;
13801386 }
13811387 rcu_read_unlock();
13821388
@@ -1404,10 +1410,8 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, · 21 unmodified lines
14041410 rcu_read_lock();
14051411 sem_lock_and_putref(sma);
14061412 if (sma->sem_perm.deleted) {
1407− sem_unlock(sma, -1);
1408− rcu_read_unlock();
14091413 err = -EIDRM;
1410− goto out_free;
1414+ goto out_unlock;
14111415 }
14121416
14131417 for (i = 0; i < nsems; i++)
@@ -1431,6 +1435,10 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, · 17 unmodified lines
14311435 goto out_rcu_wakeup;
14321436
14331437 sem_lock(sma, NULL, -1);
1438+ if (sma->sem_perm.deleted) {
1439+ err = -EIDRM;
1440+ goto out_unlock;
1441+ }
14341442 curr = &sma->sem_base[semnum];
14351443
14361444 switch (cmd) {
@@ -1836,6 +1844,10 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, · 399 unmodified lines
18361844 if (error)
18371845 goto out_rcu_wakeup;
18381846
1847+ error = -EIDRM;
1848+ locknum = sem_lock(sma, sops, nsops);
1849+ if (sma->sem_perm.deleted)
1850+ goto out_unlock_free;
18391851 /*
18401852 * semid identifiers are not unique - find_alloc_undo may have
18411853 * allocated an undo structure, it was invalidated by an RMID
@@ -1843,8 +1855,6 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, · 1 unmodified line
18431855 * This case can be detected checking un->semid. The existence of
18441856 * "un" itself is guaranteed by rcu.
18451857 */
1846− error = -EIDRM;
1847− locknum = sem_lock(sma, sops, nsops);
18481858 if (un && un->semid == -1)
18491859 goto out_unlock_free;
18501860
@@ -2057,6 +2067,12 @@ void exit_sem(struct task_struct *tsk) · 206 unmodified lines
20572067 }
20582068
20592069 sem_lock(sma, NULL, -1);
2070+ /* exit_sem raced with IPC_RMID, nothing to do */
2071+ if (sma->sem_perm.deleted) {
2072+ sem_unlock(sma, -1);
2073+ rcu_read_unlock();
2074+ continue;
2075+ }
20602076 un = __lookup_undo(ulp, semid);
20612077 if (un == NULL) {
20622078 /* exit_sem raced with IPC_RMID+semget() that created
ipc/util.c+21−6
@@ -17,12 +17,27 @@ · 16 unmodified lines
1717 * Pavel Emelianov <xemul@openvz.org>
1818 *
1919 * General sysv ipc locking scheme:
20− * when doing ipc id lookups, take the ids->rwsem
21− * rcu_read_lock()
22− * obtain the ipc object (kern_ipc_perm)
23− * perform security, capabilities, auditing and permission checks, etc.
24− * acquire the ipc lock (kern_ipc_perm.lock) throught ipc_lock_object()
25− * perform data updates (ie: SET, RMID, LOCK/UNLOCK commands)
20+ * rcu_read_lock()
21+ * obtain the ipc object (kern_ipc_perm) by looking up the id in an idr
22+ * tree.
23+ * - perform initial checks (capabilities, auditing and permission,
24+ * etc).
25+ * - perform read-only operations, such as STAT, INFO commands.
26+ * acquire the ipc lock (kern_ipc_perm.lock) through
27+ * ipc_lock_object()
28+ * - perform data updates, such as SET, RMID commands and
29+ * mechanism-specific operations (semop/semtimedop,
30+ * msgsnd/msgrcv, shmat/shmdt).
31+ * drop the ipc lock, through ipc_unlock_object().
32+ * rcu_read_unlock()
33+ *
34+ * The ids->rwsem must be taken when:
35+ * - creating, removing and iterating the existing entries in ipc
36+ * identifier sets.
37+ * - iterating through files under /proc/sysvipc/
38+ *
39+ * Note that sems have a special fast path that avoids kern_ipc_perm.lock -
40+ * see sem_lock().
2641 */
2742
2843 #include <linux/mm.h>
kernel/cgroup.c+6−8
@@ -2039,7 +2039,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, · 2038 unmodified lines
20392039
20402040 /* @tsk either already exited or can't exit until the end */
20412041 if (tsk->flags & PF_EXITING)
2042− continue;
2042+ goto next;
20432043
20442044 /* as per above, nr_threads may decrease, but not increase. */
20452045 BUG_ON(i >= group_size);
@@ -2047,7 +2047,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, · 1 unmodified line
20472047 ent.cgrp = task_cgroup_from_root(tsk, root);
20482048 /* nothing to do if this task is already in the cgroup */
20492049 if (ent.cgrp == cgrp)
2050− continue;
2050+ goto next;
20512051 /*
20522052 * saying GFP_ATOMIC has no effect here because we did prealloc
20532053 * earlier, but it's good form to communicate our expectations.
@@ -2055,7 +2055,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, · 1 unmodified line
20552055 retval = flex_array_put(group, i, &ent, GFP_ATOMIC);
20562056 BUG_ON(retval != 0);
20572057 i++;
2058−
2058+ next:
20592059 if (!threadgroup)
20602060 break;
20612061 } while_each_thread(leader, tsk);
@@ -3188,11 +3188,9 @@ css_next_descendant_post(struct cgroup_subsys_state *pos, · 1126 unmodified lines
31883188
31893189 WARN_ON_ONCE(!rcu_read_lock_held());
31903190
3191− /* if first iteration, visit the leftmost descendant */
3192− if (!pos) {
3193− next = css_leftmost_descendant(root);
3194− return next != root ? next : NULL;
3195− }
3191+ /* if first iteration, visit leftmost descendant which may be @root */
3192+ if (!pos)
3193+ return css_leftmost_descendant(root);
31963194
31973195 /* if we visited @root, we're done */
31983196 if (pos == root)
kernel/events/core.c+3−3
@@ -7234,15 +7234,15 @@ void perf_pmu_migrate_context(struct pmu *pmu, int src_cpu, int dst_cpu) · 7233 unmodified lines
72347234 perf_remove_from_context(event);
72357235 unaccount_event_cpu(event, src_cpu);
72367236 put_ctx(src_ctx);
7237− list_add(&event->event_entry, &events);
7237+ list_add(&event->migrate_entry, &events);
72387238 }
72397239 mutex_unlock(&src_ctx->mutex);
72407240
72417241 synchronize_rcu();
72427242
72437243 mutex_lock(&dst_ctx->mutex);
7244− list_for_each_entry_safe(event, tmp, &events, event_entry) {
7245− list_del(&event->event_entry);
7244+ list_for_each_entry_safe(event, tmp, &events, migrate_entry) {
7245+ list_del(&event->migrate_entry);
72467246 if (event->state >= PERF_EVENT_STATE_OFF)
72477247 event->state = PERF_EVENT_STATE_INACTIVE;
72487248 account_event_cpu(event, dst_cpu);
kernel/power/snapshot.c+4−1
@@ -743,7 +743,10 @@ int create_basic_memory_bitmaps(void) · 742 unmodified lines
743743 struct memory_bitmap *bm1, *bm2;
744744 int error = 0;
745745
746− BUG_ON(forbidden_pages_map || free_pages_map);
746+ if (forbidden_pages_map && free_pages_map)
747+ return 0;
748+ else
749+ BUG_ON(forbidden_pages_map || free_pages_map);
747750
748751 bm1 = kzalloc(sizeof(struct memory_bitmap), GFP_KERNEL);
749752 if (!bm1)
kernel/power/user.c+8−0
@@ -39,6 +39,7 @@ static struct snapshot_data { · 38 unmodified lines
3939 char frozen;
4040 char ready;
4141 char platform_support;
42+ bool free_bitmaps;
4243 } snapshot_state;
4344
4445 atomic_t snapshot_device_available = ATOMIC_INIT(1);
@@ -82,6 +83,10 @@ static int snapshot_open(struct inode *inode, struct file *filp) · 37 unmodified lines
8283 data->swap = -1;
8384 data->mode = O_WRONLY;
8485 error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
86+ if (!error) {
87+ error = create_basic_memory_bitmaps();
88+ data->free_bitmaps = !error;
89+ }
8590 if (error)
8691 pm_notifier_call_chain(PM_POST_RESTORE);
8792 }
@@ -111,6 +116,8 @@ static int snapshot_release(struct inode *inode, struct file *filp) · 23 unmodified lines
111116 pm_restore_gfp_mask();
112117 free_basic_memory_bitmaps();
113118 thaw_processes();
119+ } else if (data->free_bitmaps) {
120+ free_basic_memory_bitmaps();
114121 }
115122 pm_notifier_call_chain(data->mode == O_RDONLY ?
116123 PM_POST_HIBERNATION : PM_POST_RESTORE);
@@ -231,6 +238,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, · 114 unmodified lines
231238 break;
232239 pm_restore_gfp_mask();
233240 free_basic_memory_bitmaps();
241+ data->free_bitmaps = false;
234242 thaw_processes();
235243 data->frozen = 0;
236244 break;
kernel/softirq.c+12−3
@@ -328,10 +328,19 @@ void irq_enter(void) · 327 unmodified lines
328328
329329 static inline void invoke_softirq(void)
330330 {
331− if (!force_irqthreads)
332− __do_softirq();
333− else
331+ if (!force_irqthreads) {
332+ /*
333+ * We can safely execute softirq on the current stack if
334+ * it is the irq stack, because it should be near empty
335+ * at this stage. But we have no way to know if the arch
336+ * calls irq_exit() on the irq stack. So call softirq
337+ * in its own stack to prevent from any overrun on top
338+ * of a potentially deep task stack.
339+ */
340+ do_softirq();
341+ } else {
334342 wakeup_softirqd();
343+ }
335344 }
336345
337346 static inline void tick_irq_exit(void)
lib/kobject.c+1−1
@@ -592,7 +592,7 @@ static void kobject_release(struct kref *kref) · 591 unmodified lines
592592 {
593593 struct kobject *kobj = container_of(kref, struct kobject, kref);
594594 #ifdef CONFIG_DEBUG_KOBJECT_RELEASE
595− pr_debug("kobject: '%s' (%p): %s, parent %p (delayed)\n",
595+ pr_info("kobject: '%s' (%p): %s, parent %p (delayed)\n",
596596 kobject_name(kobj), kobj, __func__, kobj->parent);
597597 INIT_DELAYED_WORK(&kobj->release, kobject_delayed_cleanup);
598598 schedule_delayed_work(&kobj->release, HZ);
lib/percpu-refcount.c+3−0
@@ -53,6 +53,7 @@ int percpu_ref_init(struct percpu_ref *ref, percpu_ref_func_t *release) · 52 unmodified lines
5353 ref->release = release;
5454 return 0;
5555 }
56+EXPORT_SYMBOL_GPL(percpu_ref_init);
5657
5758 /**
5859 * percpu_ref_cancel_init - cancel percpu_ref_init()
@@ -84,6 +85,7 @@ void percpu_ref_cancel_init(struct percpu_ref *ref) · 25 unmodified lines
8485 free_percpu(ref->pcpu_count);
8586 }
8687 }
88+EXPORT_SYMBOL_GPL(percpu_ref_cancel_init);
8789
8890 static void percpu_ref_kill_rcu(struct rcu_head *rcu)
8991 {
@@ -156,3 +158,4 @@ void percpu_ref_kill_and_confirm(struct percpu_ref *ref, · 66 unmodified lines
156158
157159 call_rcu_sched(&ref->rcu, percpu_ref_kill_rcu);
158160 }
161+EXPORT_SYMBOL_GPL(percpu_ref_kill_and_confirm);
mm/Kconfig+1−1
@@ -183,7 +183,7 @@ config MEMORY_HOTPLUG_SPARSE · 182 unmodified lines
183183 config MEMORY_HOTREMOVE
184184 bool "Allow for memory hot remove"
185185 select MEMORY_ISOLATION
186− select HAVE_BOOTMEM_INFO_NODE if X86_64
186+ select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
187187 depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
188188 depends on MIGRATION
189189
mm/filemap.c+1−10
@@ -1616,7 +1616,6 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) · 1615 unmodified lines
16161616 struct inode *inode = mapping->host;
16171617 pgoff_t offset = vmf->pgoff;
16181618 struct page *page;
1619− bool memcg_oom;
16201619 pgoff_t size;
16211620 int ret = 0;
16221621
@@ -1625,11 +1624,7 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) · 2 unmodified lines
16251624 return VM_FAULT_SIGBUS;
16261625
16271626 /*
1628− * Do we have something in the page cache already? Either
1629− * way, try readahead, but disable the memcg OOM killer for it
1630− * as readahead is optional and no errors are propagated up
1631− * the fault stack. The OOM killer is enabled while trying to
1632− * instantiate the faulting page individually below.
1627+ * Do we have something in the page cache already?
16331628 */
16341629 page = find_get_page(mapping, offset);
16351630 if (likely(page) && !(vmf->flags & FAULT_FLAG_TRIED)) {
@@ -1637,14 +1632,10 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf) · 1 unmodified line
16371632 * We found the page, so try async readahead before
16381633 * waiting for the lock.
16391634 */
1640− memcg_oom = mem_cgroup_toggle_oom(false);
16411635 do_async_mmap_readahead(vma, ra, file, page, offset);
1642− mem_cgroup_toggle_oom(memcg_oom);
16431636 } else if (!page) {
16441637 /* No page in the page cache at all */
1645− memcg_oom = mem_cgroup_toggle_oom(false);
16461638 do_sync_mmap_readahead(vma, ra, file, offset);
1647− mem_cgroup_toggle_oom(memcg_oom);
16481639 count_vm_event(PGMAJFAULT);
16491640 mem_cgroup_count_vm_event(vma->vm_mm, PGMAJFAULT);
16501641 ret = VM_FAULT_MAJOR;
mm/huge_memory.c+9−1
@@ -2697,6 +2697,7 @@ void __split_huge_page_pmd(struct vm_area_struct *vma, unsigned long address, · 2696 unmodified lines
26972697
26982698 mmun_start = haddr;
26992699 mmun_end = haddr + HPAGE_PMD_SIZE;
2700+again:
27002701 mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
27012702 spin_lock(&mm->page_table_lock);
27022703 if (unlikely(!pmd_trans_huge(*pmd))) {
@@ -2719,7 +2720,14 @@ void __split_huge_page_pmd(struct vm_area_struct *vma, unsigned long address, · 16 unmodified lines
27192720 split_huge_page(page);
27202721
27212722 put_page(page);
2722− BUG_ON(pmd_trans_huge(*pmd));
2723+
2724+ /*
2725+ * We don't always have down_write of mmap_sem here: a racing
2726+ * do_huge_pmd_wp_page() might have copied-on-write to another
2727+ * huge page before our split_huge_page() got the anon_vma lock.
2728+ */
2729+ if (unlikely(pmd_trans_huge(*pmd)))
2730+ goto again;
27232731 }
27242732
27252733 void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address,
mm/hugetlb.c+16−1
@@ -653,6 +653,7 @@ static void free_huge_page(struct page *page) · 652 unmodified lines
653653 BUG_ON(page_count(page));
654654 BUG_ON(page_mapcount(page));
655655 restore_reserve = PagePrivate(page);
656+ ClearPagePrivate(page);
656657
657658 spin_lock(&hugetlb_lock);
658659 hugetlb_cgroup_uncharge_page(hstate_index(h),
@@ -695,8 +696,22 @@ static void prep_compound_gigantic_page(struct page *page, unsigned long order) · 36 unmodified lines
695696 /* we rely on prep_new_huge_page to set the destructor */
696697 set_compound_order(page, order);
697698 __SetPageHead(page);
699+ __ClearPageReserved(page);
698700 for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) {
699701 __SetPageTail(p);
702+ /*
703+ * For gigantic hugepages allocated through bootmem at
704+ * boot, it's safer to be consistent with the not-gigantic
705+ * hugepages and clear the PG_reserved bit from all tail pages
706+ * too. Otherwse drivers using get_user_pages() to access tail
707+ * pages may get the reference counting wrong if they see
708+ * PG_reserved set on a tail page (despite the head page not
709+ * having PG_reserved set). Enforcing this consistency between
710+ * head and tail pages allows drivers to optimize away a check
711+ * on the head page when they need know if put_page() is needed
712+ * after get_user_pages().
713+ */
714+ __ClearPageReserved(p);
700715 set_page_count(p, 0);
701716 p->first_page = page;
702717 }
@@ -1329,9 +1344,9 @@ static void __init gather_bootmem_prealloc(void) · 626 unmodified lines
13291344 #else
13301345 page = virt_to_page(m);
13311346 #endif
1332− __ClearPageReserved(page);
13331347 WARN_ON(page_count(page) != 1);
13341348 prep_compound_huge_page(page, h->order);
1349+ WARN_ON(PageReserved(page));
13351350 prep_new_huge_page(h, page, page_to_nid(page));
13361351 /*
13371352 * If we had gigantic hugepages allocated at boot time, we need
mm/memcontrol.c+55−88
@@ -866,6 +866,7 @@ static unsigned long mem_cgroup_read_events(struct mem_cgroup *memcg, · 865 unmodified lines
866866 unsigned long val = 0;
867867 int cpu;
868868
869+ get_online_cpus();
869870 for_each_online_cpu(cpu)
870871 val += per_cpu(memcg->stat->events[idx], cpu);
871872 #ifdef CONFIG_HOTPLUG_CPU
@@ -873,6 +874,7 @@ static unsigned long mem_cgroup_read_events(struct mem_cgroup *memcg, · 1 unmodified line
873874 val += memcg->nocpu_base.events[idx];
874875 spin_unlock(&memcg->pcp_counter_lock);
875876 #endif
877+ put_online_cpus();
876878 return val;
877879 }
878880
@@ -2159,110 +2161,59 @@ static void memcg_oom_recover(struct mem_cgroup *memcg) · 1280 unmodified lines
21592161 memcg_wakeup_oom(memcg);
21602162 }
21612163
2162−/*
2163− * try to call OOM killer
2164− */
21652164 static void mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order)
21662165 {
2167− bool locked;
2168− int wakeups;
2169−
21702166 if (!current->memcg_oom.may_oom)
21712167 return;
2172−
2173− current->memcg_oom.in_memcg_oom = 1;
2174−
21752168 /*
2176− * As with any blocking lock, a contender needs to start
2177− * listening for wakeups before attempting the trylock,
2178− * otherwise it can miss the wakeup from the unlock and sleep
2179− * indefinitely. This is just open-coded because our locking
2180− * is so particular to memcg hierarchies.
2169+ * We are in the middle of the charge context here, so we
2170+ * don't want to block when potentially sitting on a callstack
2171+ * that holds all kinds of filesystem and mm locks.
2172+ *
2173+ * Also, the caller may handle a failed allocation gracefully
2174+ * (like optional page cache readahead) and so an OOM killer
2175+ * invocation might not even be necessary.
2176+ *
2177+ * That's why we don't do anything here except remember the
2178+ * OOM context and then deal with it at the end of the page
2179+ * fault when the stack is unwound, the locks are released,
2180+ * and when we know whether the fault was overall successful.
21812181 */
2182− wakeups = atomic_read(&memcg->oom_wakeups);
2183− mem_cgroup_mark_under_oom(memcg);
2184−
2185− locked = mem_cgroup_oom_trylock(memcg);
2186−
2187− if (locked)
2188− mem_cgroup_oom_notify(memcg);
2189−
2190− if (locked && !memcg->oom_kill_disable) {
2191− mem_cgroup_unmark_under_oom(memcg);
2192− mem_cgroup_out_of_memory(memcg, mask, order);
2193− mem_cgroup_oom_unlock(memcg);
2194− /*
2195− * There is no guarantee that an OOM-lock contender
2196− * sees the wakeups triggered by the OOM kill
2197− * uncharges. Wake any sleepers explicitely.
2198− */
2199− memcg_oom_recover(memcg);
2200− } else {
2201− /*
2202− * A system call can just return -ENOMEM, but if this
2203− * is a page fault and somebody else is handling the
2204− * OOM already, we need to sleep on the OOM waitqueue
2205− * for this memcg until the situation is resolved.
2206− * Which can take some time because it might be
2207− * handled by a userspace task.
2208− *
2209− * However, this is the charge context, which means
2210− * that we may sit on a large call stack and hold
2211− * various filesystem locks, the mmap_sem etc. and we
2212− * don't want the OOM handler to deadlock on them
2213− * while we sit here and wait. Store the current OOM
2214− * context in the task_struct, then return -ENOMEM.
2215− * At the end of the page fault handler, with the
2216− * stack unwound, pagefault_out_of_memory() will check
2217− * back with us by calling
2218− * mem_cgroup_oom_synchronize(), possibly putting the
2219− * task to sleep.
2220− */
2221− current->memcg_oom.oom_locked = locked;
2222− current->memcg_oom.wakeups = wakeups;
2223− css_get(&memcg->css);
2224− current->memcg_oom.wait_on_memcg = memcg;
2225− }
2182+ css_get(&memcg->css);
2183+ current->memcg_oom.memcg = memcg;
2184+ current->memcg_oom.gfp_mask = mask;
2185+ current->memcg_oom.order = order;
22262186 }
22272187
22282188 /**
22292189 * mem_cgroup_oom_synchronize - complete memcg OOM handling
2190+ * @handle: actually kill/wait or just clean up the OOM state
22302191 *
2231− * This has to be called at the end of a page fault if the the memcg
2232− * OOM handler was enabled and the fault is returning %VM_FAULT_OOM.
2192+ * This has to be called at the end of a page fault if the memcg OOM
2193+ * handler was enabled.
22332194 *
2234− * Memcg supports userspace OOM handling, so failed allocations must
2195+ * Memcg supports userspace OOM handling where failed allocations must
22352196 * sleep on a waitqueue until the userspace task resolves the
22362197 * situation. Sleeping directly in the charge context with all kinds
22372198 * of locks held is not a good idea, instead we remember an OOM state
22382199 * in the task and mem_cgroup_oom_synchronize() has to be called at
2239− * the end of the page fault to put the task to sleep and clean up the
2240− * OOM state.
2200+ * the end of the page fault to complete the OOM handling.
22412201 *
22422202 * Returns %true if an ongoing memcg OOM situation was detected and
2243− * finalized, %false otherwise.
2203+ * completed, %false otherwise.
22442204 */
2245−bool mem_cgroup_oom_synchronize(void)
2205+bool mem_cgroup_oom_synchronize(bool handle)
22462206 {
2207+ struct mem_cgroup *memcg = current->memcg_oom.memcg;
22472208 struct oom_wait_info owait;
2248− struct mem_cgroup *memcg;
2209+ bool locked;
22492210
22502211 /* OOM is global, do not handle */
2251− if (!current->memcg_oom.in_memcg_oom)
2252− return false;
2253−
2254− /*
2255− * We invoked the OOM killer but there is a chance that a kill
2256− * did not free up any charges. Everybody else might already
2257− * be sleeping, so restart the fault and keep the rampage
2258− * going until some charges are released.
2259− */
2260− memcg = current->memcg_oom.wait_on_memcg;
22612212 if (!memcg)
2262− goto out;
2213+ return false;
22632214
2264− if (test_thread_flag(TIF_MEMDIE) || fatal_signal_pending(current))
2265− goto out_memcg;
2215+ if (!handle)
2216+ goto cleanup;
22662217
22672218 owait.memcg = memcg;
22682219 owait.wait.flags = 0;
@@ -2271,13 +2222,25 @@ bool mem_cgroup_oom_synchronize(void) · 2 unmodified lines
22712222 INIT_LIST_HEAD(&owait.wait.task_list);
22722223
22732224 prepare_to_wait(&memcg_oom_waitq, &owait.wait, TASK_KILLABLE);
2274− /* Only sleep if we didn't miss any wakeups since OOM */
2275− if (atomic_read(&memcg->oom_wakeups) == current->memcg_oom.wakeups)
2225+ mem_cgroup_mark_under_oom(memcg);
2226+
2227+ locked = mem_cgroup_oom_trylock(memcg);
2228+
2229+ if (locked)
2230+ mem_cgroup_oom_notify(memcg);
2231+
2232+ if (locked && !memcg->oom_kill_disable) {
2233+ mem_cgroup_unmark_under_oom(memcg);
2234+ finish_wait(&memcg_oom_waitq, &owait.wait);
2235+ mem_cgroup_out_of_memory(memcg, current->memcg_oom.gfp_mask,
2236+ current->memcg_oom.order);
2237+ } else {
22762238 schedule();
2277− finish_wait(&memcg_oom_waitq, &owait.wait);
2278−out_memcg:
2279− mem_cgroup_unmark_under_oom(memcg);
2280− if (current->memcg_oom.oom_locked) {
2239+ mem_cgroup_unmark_under_oom(memcg);
2240+ finish_wait(&memcg_oom_waitq, &owait.wait);
2241+ }
2242+
2243+ if (locked) {
22812244 mem_cgroup_oom_unlock(memcg);
22822245 /*
22832246 * There is no guarantee that an OOM-lock contender
@@ -2286,10 +2249,9 @@ out_memcg: · 2 unmodified lines
22862249 */
22872250 memcg_oom_recover(memcg);
22882251 }
2252+cleanup:
2253+ current->memcg_oom.memcg = NULL;
22892254 css_put(&memcg->css);
2290− current->memcg_oom.wait_on_memcg = NULL;
2291−out:
2292− current->memcg_oom.in_memcg_oom = 0;
22932255 return true;
22942256 }
22952257
@@ -2703,6 +2665,9 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm, · 407 unmodified lines
27032665 || fatal_signal_pending(current)))
27042666 goto bypass;
27052667
2668+ if (unlikely(task_in_memcg_oom(current)))
2669+ goto bypass;
2670+
27062671 /*
27072672 * We always charge the cgroup the mm_struct belongs to.
27082673 * The mm_struct's mem_cgroup changes on task migration if the
@@ -2801,6 +2766,8 @@ done: · 92 unmodified lines
28012766 return 0;
28022767 nomem:
28032768 *ptr = NULL;
2769+ if (gfp_mask & __GFP_NOFAIL)
2770+ return 0;
28042771 return -ENOMEM;
28052772 bypass:
28062773 *ptr = root_mem_cgroup;
mm/memory.c+14−6
@@ -837,6 +837,8 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm, · 836 unmodified lines
837837 */
838838 make_migration_entry_read(&entry);
839839 pte = swp_entry_to_pte(entry);
840+ if (pte_swp_soft_dirty(*src_pte))
841+ pte = pte_swp_mksoft_dirty(pte);
840842 set_pte_at(src_mm, addr, src_pte, pte);
841843 }
842844 }
@@ -3863,15 +3865,21 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, · 3020 unmodified lines
38633865 * space. Kernel faults are handled more gracefully.
38643866 */
38653867 if (flags & FAULT_FLAG_USER)
3866− mem_cgroup_enable_oom();
3868+ mem_cgroup_oom_enable();
38673869
38683870 ret = __handle_mm_fault(mm, vma, address, flags);
38693871
3870− if (flags & FAULT_FLAG_USER)
3871− mem_cgroup_disable_oom();
3872−
3873− if (WARN_ON(task_in_memcg_oom(current) && !(ret & VM_FAULT_OOM)))
3874− mem_cgroup_oom_synchronize();
3872+ if (flags & FAULT_FLAG_USER) {
3873+ mem_cgroup_oom_disable();
3874+ /*
3875+ * The task may have entered a memcg OOM situation but
3876+ * if the allocation error was handled gracefully (no
3877+ * VM_FAULT_OOM), there is no need to kill anything.
3878+ * Just clean up the OOM state peacefully.
3879+ */
3880+ if (task_in_memcg_oom(current) && !(ret & VM_FAULT_OOM))
3881+ mem_cgroup_oom_synchronize(false);
3882+ }
38753883
38763884 return ret;
38773885 }
mm/migrate.c+2−0
@@ -161,6 +161,8 @@ static int remove_migration_pte(struct page *new, struct vm_area_struct *vma, · 160 unmodified lines
161161
162162 get_page(new);
163163 pte = pte_mkold(mk_pte(new, vma->vm_page_prot));
164+ if (pte_swp_soft_dirty(*ptep))
165+ pte = pte_mksoft_dirty(pte);
164166 if (is_write_migration_entry(entry))
165167 pte = pte_mkwrite(pte);
166168 #ifdef CONFIG_HUGETLB_PAGE
mm/mprotect.c+5−2
@@ -94,13 +94,16 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, · 93 unmodified lines
9494 swp_entry_t entry = pte_to_swp_entry(oldpte);
9595
9696 if (is_write_migration_entry(entry)) {
97+ pte_t newpte;
9798 /*
9899 * A protection check is difficult so
99100 * just be safe and disable write
100101 */
101102 make_migration_entry_read(&entry);
102− set_pte_at(mm, addr, pte,
103− swp_entry_to_pte(entry));
103+ newpte = swp_entry_to_pte(entry);
104+ if (pte_swp_soft_dirty(oldpte))
105+ newpte = pte_swp_mksoft_dirty(newpte);
106+ set_pte_at(mm, addr, pte, newpte);
104107 }
105108 pages++;
106109 }
mm/mremap.c+1−4
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 #include <asm/uaccess.h>
2626 #include <asm/cacheflush.h>
2727 #include <asm/tlbflush.h>
28−#include <asm/pgalloc.h>
2928
3029 #include "internal.h"
3130
@@ -63,10 +62,8 @@ static pmd_t *alloc_new_pmd(struct mm_struct *mm, struct vm_area_struct *vma, · 31 unmodified lines
6362 return NULL;
6463
6564 pmd = pmd_alloc(mm, pud, addr);
66− if (!pmd) {
67− pud_free(mm, pud);
65+ if (!pmd)
6866 return NULL;
69− }
7067
7168 VM_BUG_ON(pmd_trans_huge(*pmd));
7269
mm/oom_kill.c+1−1
@@ -680,7 +680,7 @@ void pagefault_out_of_memory(void) · 679 unmodified lines
680680 {
681681 struct zonelist *zonelist;
682682
683− if (mem_cgroup_oom_synchronize())
683+ if (mem_cgroup_oom_synchronize(true))
684684 return;
685685
686686 zonelist = node_zonelist(first_online_node, GFP_KERNEL);
mm/page-writeback.c+5−5
@@ -1210,11 +1210,11 @@ static unsigned long dirty_poll_interval(unsigned long dirty, · 1209 unmodified lines
12101210 return 1;
12111211 }
12121212
1213−static long bdi_max_pause(struct backing_dev_info *bdi,
1214− unsigned long bdi_dirty)
1213+static unsigned long bdi_max_pause(struct backing_dev_info *bdi,
1214+ unsigned long bdi_dirty)
12151215 {
1216− long bw = bdi->avg_write_bandwidth;
1217− long t;
1216+ unsigned long bw = bdi->avg_write_bandwidth;
1217+ unsigned long t;
12181218
12191219 /*
12201220 * Limit pause time for small memory systems. If sleeping for too long
@@ -1226,7 +1226,7 @@ static long bdi_max_pause(struct backing_dev_info *bdi, · 5 unmodified lines
12261226 t = bdi_dirty / (1 + bw / roundup_pow_of_two(1 + HZ / 8));
12271227 t++;
12281228
1229− return min_t(long, t, MAX_PAUSE);
1229+ return min_t(unsigned long, t, MAX_PAUSE);
12301230 }
12311231
12321232 static long bdi_min_pause(struct backing_dev_info *bdi,
mm/slab_common.c+2−0
@@ -56,6 +56,7 @@ static int kmem_cache_sanity_check(struct mem_cgroup *memcg, const char *name, · 55 unmodified lines
5656 continue;
5757 }
5858
59+#if !defined(CONFIG_SLUB) || !defined(CONFIG_SLUB_DEBUG_ON)
5960 /*
6061 * For simplicity, we won't check this in the list of memcg
6162 * caches. We have control over memcg naming, and if there
@@ -69,6 +70,7 @@ static int kmem_cache_sanity_check(struct mem_cgroup *memcg, const char *name, · 7 unmodified lines
6970 s = NULL;
7071 return -EINVAL;
7172 }
73+#endif
7274 }
7375
7476 WARN_ON(strchr(name, ' ')); /* It confuses parsers */
mm/swapfile.c+3−1
@@ -1824,6 +1824,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) · 1823 unmodified lines
18241824 struct filename *pathname;
18251825 int i, type, prev;
18261826 int err;
1827+ unsigned int old_block_size;
18271828
18281829 if (!capable(CAP_SYS_ADMIN))
18291830 return -EPERM;
@@ -1914,6 +1915,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) · 84 unmodified lines
19141915 }
19151916
19161917 swap_file = p->swap_file;
1918+ old_block_size = p->old_block_size;
19171919 p->swap_file = NULL;
19181920 p->max = 0;
19191921 swap_map = p->swap_map;
@@ -1938,7 +1940,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) · 18 unmodified lines
19381940 inode = mapping->host;
19391941 if (S_ISBLK(inode->i_mode)) {
19401942 struct block_device *bdev = I_BDEV(inode);
1941− set_blocksize(bdev, p->old_block_size);
1943+ set_blocksize(bdev, old_block_size);
19421944 blkdev_put(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL);
19431945 } else {
19441946 mutex_lock(&inode->i_mutex);
mm/vmscan.c+1−0
@@ -211,6 +211,7 @@ void unregister_shrinker(struct shrinker *shrinker) · 210 unmodified lines
211211 down_write(&shrinker_rwsem);
212212 list_del(&shrinker->list);
213213 up_write(&shrinker_rwsem);
214+ kfree(shrinker->nr_deferred);
214215 }
215216 EXPORT_SYMBOL(unregister_shrinker);
216217
mm/zswap.c+4−0
@@ -804,6 +804,10 @@ static void zswap_frontswap_invalidate_area(unsigned type) · 803 unmodified lines
804804 }
805805 tree->rbroot = RB_ROOT;
806806 spin_unlock(&tree->lock);
807+
808+ zbud_destroy_pool(tree->pool);
809+ kfree(tree);
810+ zswap_trees[type] = NULL;
807811 }
808812
809813 static struct zbud_ops zswap_zbud_ops = {
net/bridge/br_fdb.c+2−2
@@ -700,7 +700,7 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], · 699 unmodified lines
700700
701701 vid = nla_get_u16(tb[NDA_VLAN]);
702702
703− if (vid >= VLAN_N_VID) {
703+ if (!vid || vid >= VLAN_VID_MASK) {
704704 pr_info("bridge: RTM_NEWNEIGH with invalid vlan id %d\n",
705705 vid);
706706 return -EINVAL;
@@ -794,7 +794,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], · 87 unmodified lines
794794
795795 vid = nla_get_u16(tb[NDA_VLAN]);
796796
797− if (vid >= VLAN_N_VID) {
797+ if (!vid || vid >= VLAN_VID_MASK) {
798798 pr_info("bridge: RTM_NEWNEIGH with invalid vlan id %d\n",
799799 vid);
800800 return -EINVAL;
net/bridge/br_mdb.c+1−1
@@ -453,7 +453,7 @@ static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry) · 452 unmodified lines
453453 call_rcu_bh(&p->rcu, br_multicast_free_pg);
454454 err = 0;
455455
456− if (!mp->ports && !mp->mglist && mp->timer_armed &&
456+ if (!mp->ports && !mp->mglist &&
457457 netif_running(br->dev))
458458 mod_timer(&mp->timer, jiffies);
459459 break;
net/bridge/br_multicast.c+26−12
@@ -272,7 +272,7 @@ static void br_multicast_del_pg(struct net_bridge *br, · 271 unmodified lines
272272 del_timer(&p->timer);
273273 call_rcu_bh(&p->rcu, br_multicast_free_pg);
274274
275− if (!mp->ports && !mp->mglist && mp->timer_armed &&
275+ if (!mp->ports && !mp->mglist &&
276276 netif_running(br->dev))
277277 mod_timer(&mp->timer, jiffies);
278278
@@ -620,7 +620,6 @@ rehash: · 341 unmodified lines
620620
621621 mp->br = br;
622622 mp->addr = *group;
623−
624623 setup_timer(&mp->timer, br_multicast_group_expired,
625624 (unsigned long)mp);
626625
@@ -660,6 +659,7 @@ static int br_multicast_add_group(struct net_bridge *br, · 33 unmodified lines
660659 struct net_bridge_mdb_entry *mp;
661660 struct net_bridge_port_group *p;
662661 struct net_bridge_port_group __rcu **pp;
662+ unsigned long now = jiffies;
663663 int err;
664664
665665 spin_lock(&br->multicast_lock);
@@ -674,6 +674,7 @@ static int br_multicast_add_group(struct net_bridge *br, · 8 unmodified lines
674674
675675 if (!port) {
676676 mp->mglist = true;
677+ mod_timer(&mp->timer, now + br->multicast_membership_interval);
677678 goto out;
678679 }
679680
@@ -681,7 +682,7 @@ static int br_multicast_add_group(struct net_bridge *br, · 1 unmodified line
681682 (p = mlock_dereference(*pp, br)) != NULL;
682683 pp = &p->next) {
683684 if (p->port == port)
684− goto out;
685+ goto found;
685686 if ((unsigned long)p->port < (unsigned long)port)
686687 break;
687688 }
@@ -692,6 +693,8 @@ static int br_multicast_add_group(struct net_bridge *br, · 4 unmodified lines
692693 rcu_assign_pointer(*pp, p);
693694 br_mdb_notify(br->dev, port, group, RTM_NEWMDB);
694695
696+found:
697+ mod_timer(&p->timer, now + br->multicast_membership_interval);
695698 out:
696699 err = 0;
697700
@@ -1191,9 +1194,6 @@ static int br_ip4_multicast_query(struct net_bridge *br, · 493 unmodified lines
11911194 if (!mp)
11921195 goto out;
11931196
1194− mod_timer(&mp->timer, now + br->multicast_membership_interval);
1195− mp->timer_armed = true;
1196−
11971197 max_delay *= br->multicast_last_member_count;
11981198
11991199 if (mp->mglist &&
@@ -1270,9 +1270,6 @@ static int br_ip6_multicast_query(struct net_bridge *br, · 70 unmodified lines
12701270 if (!mp)
12711271 goto out;
12721272
1273− mod_timer(&mp->timer, now + br->multicast_membership_interval);
1274− mp->timer_armed = true;
1275−
12761273 max_delay *= br->multicast_last_member_count;
12771274 if (mp->mglist &&
12781275 (timer_pending(&mp->timer) ?
@@ -1358,7 +1355,7 @@ static void br_multicast_leave_group(struct net_bridge *br, · 79 unmodified lines
13581355 call_rcu_bh(&p->rcu, br_multicast_free_pg);
13591356 br_mdb_notify(br->dev, port, group, RTM_DELMDB);
13601357
1361− if (!mp->ports && !mp->mglist && mp->timer_armed &&
1358+ if (!mp->ports && !mp->mglist &&
13621359 netif_running(br->dev))
13631360 mod_timer(&mp->timer, jiffies);
13641361 }
@@ -1370,12 +1367,30 @@ static void br_multicast_leave_group(struct net_bridge *br, · 5 unmodified lines
13701367 br->multicast_last_member_interval;
13711368
13721369 if (!port) {
1373− if (mp->mglist && mp->timer_armed &&
1370+ if (mp->mglist &&
13741371 (timer_pending(&mp->timer) ?
13751372 time_after(mp->timer.expires, time) :
13761373 try_to_del_timer_sync(&mp->timer) >= 0)) {
13771374 mod_timer(&mp->timer, time);
13781375 }
1376+
1377+ goto out;
1378+ }
1379+
1380+ for (p = mlock_dereference(mp->ports, br);
1381+ p != NULL;
1382+ p = mlock_dereference(p->next, br)) {
1383+ if (p->port != port)
1384+ continue;
1385+
1386+ if (!hlist_unhashed(&p->mglist) &&
1387+ (timer_pending(&p->timer) ?
1388+ time_after(p->timer.expires, time) :
1389+ try_to_del_timer_sync(&p->timer) >= 0)) {
1390+ mod_timer(&p->timer, time);
1391+ }
1392+
1393+ break;
13791394 }
13801395 out:
13811396 spin_unlock(&br->multicast_lock);
@@ -1798,7 +1813,6 @@ void br_multicast_stop(struct net_bridge *br) · 416 unmodified lines
17981813 hlist_for_each_entry_safe(mp, n, &mdb->mhash[i],
17991814 hlist[ver]) {
18001815 del_timer(&mp->timer);
1801− mp->timer_armed = false;
18021816 call_rcu_bh(&mp->rcu, br_multicast_free_group);
18031817 }
18041818 }
net/bridge/br_netlink.c+1−1
@@ -243,7 +243,7 @@ static int br_afspec(struct net_bridge *br, · 242 unmodified lines
243243
244244 vinfo = nla_data(tb[IFLA_BRIDGE_VLAN_INFO]);
245245
246− if (vinfo->vid >= VLAN_N_VID)
246+ if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK)
247247 return -EINVAL;
248248
249249 switch (cmd) {
net/bridge/br_private.h+1−4
@@ -126,7 +126,6 @@ struct net_bridge_mdb_entry · 125 unmodified lines
126126 struct timer_list timer;
127127 struct br_ip addr;
128128 bool mglist;
129− bool timer_armed;
130129 };
131130
132131 struct net_bridge_mdb_htable
@@ -624,9 +623,7 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v) · 491 unmodified lines
624623 * vid wasn't set
625624 */
626625 smp_rmb();
627− return (v->pvid & VLAN_TAG_PRESENT) ?
628− (v->pvid & ~VLAN_TAG_PRESENT) :
629− VLAN_N_VID;
626+ return v->pvid ?: VLAN_N_VID;
630627 }
631628
632629 #else
net/bridge/br_stp_if.c+1−1
@@ -134,7 +134,7 @@ static void br_stp_start(struct net_bridge *br) · 133 unmodified lines
134134
135135 if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY)
136136 __br_set_forward_delay(br, BR_MIN_FORWARD_DELAY);
137− else if (br->bridge_forward_delay < BR_MAX_FORWARD_DELAY)
137+ else if (br->bridge_forward_delay > BR_MAX_FORWARD_DELAY)
138138 __br_set_forward_delay(br, BR_MAX_FORWARD_DELAY);
139139
140140 if (r == 0) {
net/bridge/br_vlan.c+67−58
@@ -45,37 +45,34 @@ static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags) · 44 unmodified lines
4545 return 0;
4646 }
4747
48− if (vid) {
49− if (v->port_idx) {
50− p = v->parent.port;
51− br = p->br;
52− dev = p->dev;
53− } else {
54− br = v->parent.br;
55− dev = br->dev;
56− }
57− ops = dev->netdev_ops;
58−
59− if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
60− /* Add VLAN to the device filter if it is supported.
61− * Stricly speaking, this is not necessary now, since
62− * devices are made promiscuous by the bridge, but if
63− * that ever changes this code will allow tagged
64− * traffic to enter the bridge.
65− */
66− err = ops->ndo_vlan_rx_add_vid(dev, htons(ETH_P_8021Q),
67− vid);
68− if (err)
69− return err;
70− }
71−
72− err = br_fdb_insert(br, p, dev->dev_addr, vid);
73− if (err) {
74− br_err(br, "failed insert local address into bridge "
75− "forwarding table\n");
76− goto out_filt;
77− }
48+ if (v->port_idx) {
49+ p = v->parent.port;
50+ br = p->br;
51+ dev = p->dev;
52+ } else {
53+ br = v->parent.br;
54+ dev = br->dev;
55+ }
56+ ops = dev->netdev_ops;
57+
58+ if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
59+ /* Add VLAN to the device filter if it is supported.
60+ * Stricly speaking, this is not necessary now, since
61+ * devices are made promiscuous by the bridge, but if
62+ * that ever changes this code will allow tagged
63+ * traffic to enter the bridge.
64+ */
65+ err = ops->ndo_vlan_rx_add_vid(dev, htons(ETH_P_8021Q),
66+ vid);
67+ if (err)
68+ return err;
69+ }
7870
71+ err = br_fdb_insert(br, p, dev->dev_addr, vid);
72+ if (err) {
73+ br_err(br, "failed insert local address into bridge "
74+ "forwarding table\n");
75+ goto out_filt;
7976 }
8077
8178 set_bit(vid, v->vlan_bitmap);
@@ -98,7 +95,7 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid) · 16 unmodified lines
9895 __vlan_delete_pvid(v, vid);
9996 clear_bit(vid, v->untagged_bitmap);
10097
101− if (v->port_idx && vid) {
98+ if (v->port_idx) {
10299 struct net_device *dev = v->parent.port->dev;
103100 const struct net_device_ops *ops = dev->netdev_ops;
104101
@@ -192,6 +189,8 @@ out: · 87 unmodified lines
192189 bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
193190 struct sk_buff *skb, u16 *vid)
194191 {
192+ int err;
193+
195194 /* If VLAN filtering is disabled on the bridge, all packets are
196195 * permitted.
197196 */
@@ -204,20 +203,32 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, · 6 unmodified lines
204203 if (!v)
205204 return false;
206205
207− if (br_vlan_get_tag(skb, vid)) {
206+ err = br_vlan_get_tag(skb, vid);
207+ if (!*vid) {
208208 u16 pvid = br_get_pvid(v);
209209
210− /* Frame did not have a tag. See if pvid is set
211− * on this port. That tells us which vlan untagged
212− * traffic belongs to.
210+ /* Frame had a tag with VID 0 or did not have a tag.
211+ * See if pvid is set on this port. That tells us which
212+ * vlan untagged or priority-tagged traffic belongs to.
213213 */
214214 if (pvid == VLAN_N_VID)
215215 return false;
216216
217− /* PVID is set on this port. Any untagged ingress
218− * frame is considered to belong to this vlan.
217+ /* PVID is set on this port. Any untagged or priority-tagged
218+ * ingress frame is considered to belong to this vlan.
219219 */
220− __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid);
220+ *vid = pvid;
221+ if (likely(err))
222+ /* Untagged Frame. */
223+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid);
224+ else
225+ /* Priority-tagged Frame.
226+ * At this point, We know that skb->vlan_tci had
227+ * VLAN_TAG_PRESENT bit and its VID field was 0x000.
228+ * We update only VID field and preserve PCP field.
229+ */
230+ skb->vlan_tci |= pvid;
231+
221232 return true;
222233 }
223234
@@ -248,7 +259,9 @@ bool br_allowed_egress(struct net_bridge *br, · 24 unmodified lines
248259 return false;
249260 }
250261
251−/* Must be protected by RTNL */
262+/* Must be protected by RTNL.
263+ * Must be called with vid in range from 1 to 4094 inclusive.
264+ */
252265 int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags)
253266 {
254267 struct net_port_vlans *pv = NULL;
@@ -278,7 +291,9 @@ out: · 23 unmodified lines
278291 return err;
279292 }
280293
281−/* Must be protected by RTNL */
294+/* Must be protected by RTNL.
295+ * Must be called with vid in range from 1 to 4094 inclusive.
296+ */
282297 int br_vlan_delete(struct net_bridge *br, u16 vid)
283298 {
284299 struct net_port_vlans *pv;
@@ -289,14 +304,9 @@ int br_vlan_delete(struct net_bridge *br, u16 vid) · 4 unmodified lines
289304 if (!pv)
290305 return -EINVAL;
291306
292− if (vid) {
293− /* If the VID !=0 remove fdb for this vid. VID 0 is special
294− * in that it's the default and is always there in the fdb.
295− */
296− spin_lock_bh(&br->hash_lock);
297− fdb_delete_by_addr(br, br->dev->dev_addr, vid);
298− spin_unlock_bh(&br->hash_lock);
299− }
307+ spin_lock_bh(&br->hash_lock);
308+ fdb_delete_by_addr(br, br->dev->dev_addr, vid);
309+ spin_unlock_bh(&br->hash_lock);
300310
301311 __vlan_del(pv, vid);
302312 return 0;
@@ -329,7 +339,9 @@ unlock: · 26 unmodified lines
329339 return 0;
330340 }
331341
332−/* Must be protected by RTNL */
342+/* Must be protected by RTNL.
343+ * Must be called with vid in range from 1 to 4094 inclusive.
344+ */
333345 int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags)
334346 {
335347 struct net_port_vlans *pv = NULL;
@@ -363,7 +375,9 @@ clean_up: · 27 unmodified lines
363375 return err;
364376 }
365377
366−/* Must be protected by RTNL */
378+/* Must be protected by RTNL.
379+ * Must be called with vid in range from 1 to 4094 inclusive.
380+ */
367381 int nbp_vlan_delete(struct net_bridge_port *port, u16 vid)
368382 {
369383 struct net_port_vlans *pv;
@@ -374,14 +388,9 @@ int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) · 4 unmodified lines
374388 if (!pv)
375389 return -EINVAL;
376390
377− if (vid) {
378− /* If the VID !=0 remove fdb for this vid. VID 0 is special
379− * in that it's the default and is always there in the fdb.
380− */
381− spin_lock_bh(&port->br->hash_lock);
382− fdb_delete_by_addr(port->br, port->dev->dev_addr, vid);
383− spin_unlock_bh(&port->br->hash_lock);
384− }
391+ spin_lock_bh(&port->br->hash_lock);
392+ fdb_delete_by_addr(port->br, port->dev->dev_addr, vid);
393+ spin_unlock_bh(&port->br->hash_lock);
385394
386395 return __vlan_del(pv, vid);
387396 }
net/core/secure_seq.c+2−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111
1212 #include <net/secure_seq.h>
1313
14+#if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_INET)
1415 #define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4)
1516
1617 static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned;
@@ -19,6 +20,7 @@ static __always_inline void net_secret_init(void) · 2 unmodified lines
1920 {
2021 net_get_random_once(net_secret, sizeof(net_secret));
2122 }
23+#endif
2224
2325 #ifdef CONFIG_INET
2426 static u32 seq_scale(u32 seq)
net/ipv4/ip_output.c+9−4
@@ -772,15 +772,20 @@ static inline int ip_ufo_append_data(struct sock *sk, · 771 unmodified lines
772772 /* initialize protocol header pointer */
773773 skb->transport_header = skb->network_header + fragheaderlen;
774774
775− skb->ip_summed = CHECKSUM_PARTIAL;
776775 skb->csum = 0;
777776
778− /* specify the length of each IP datagram fragment */
779− skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen;
780− skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
777+
781778 __skb_queue_tail(queue, skb);
779+ } else if (skb_is_gso(skb)) {
780+ goto append;
782781 }
783782
783+ skb->ip_summed = CHECKSUM_PARTIAL;
784+ /* specify the length of each IP datagram fragment */
785+ skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen;
786+ skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
787+
788+append:
784789 return skb_append_datato_frags(sk, skb, getfrag, from,
785790 (length - transhdrlen));
786791 }
net/ipv4/ip_vti.c+11−3
@@ -61,8 +61,17 @@ static int vti_rcv(struct sk_buff *skb) · 60 unmodified lines
6161 iph->saddr, iph->daddr, 0);
6262 if (tunnel != NULL) {
6363 struct pcpu_tstats *tstats;
64+ u32 oldmark = skb->mark;
65+ int ret;
6466
65− if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
67+
68+ /* temporarily mark the skb with the tunnel o_key, to
69+ * only match policies with this mark.
70+ */
71+ skb->mark = be32_to_cpu(tunnel->parms.o_key);
72+ ret = xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb);
73+ skb->mark = oldmark;
74+ if (!ret)
6675 return -1;
6776
6877 tstats = this_cpu_ptr(tunnel->dev->tstats);
@@ -71,7 +80,6 @@ static int vti_rcv(struct sk_buff *skb) · 2 unmodified lines
7180 tstats->rx_bytes += skb->len;
7281 u64_stats_update_end(&tstats->syncp);
7382
74− skb->mark = 0;
7583 secpath_reset(skb);
7684 skb->dev = tunnel->dev;
7785 return 1;
@@ -103,7 +111,7 @@ static netdev_tx_t vti_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) · 25 unmodified lines
103111
104112 memset(&fl4, 0, sizeof(fl4));
105113 flowi4_init_output(&fl4, tunnel->parms.link,
106− be32_to_cpu(tunnel->parms.i_key), RT_TOS(tos),
114+ be32_to_cpu(tunnel->parms.o_key), RT_TOS(tos),
107115 RT_SCOPE_UNIVERSE,
108116 IPPROTO_IPIP, 0,
109117 dst, tiph->saddr, 0, 0);
net/ipv4/tcp_input.c+3−1
@@ -3338,7 +3338,7 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) · 3337 unmodified lines
33383338 tcp_init_cwnd_reduction(sk, true);
33393339 tcp_set_ca_state(sk, TCP_CA_CWR);
33403340 tcp_end_cwnd_reduction(sk);
3341− tcp_set_ca_state(sk, TCP_CA_Open);
3341+ tcp_try_keep_open(sk);
33423342 NET_INC_STATS_BH(sock_net(sk),
33433343 LINUX_MIB_TCPLOSSPROBERECOVERY);
33443344 }
@@ -5751,6 +5751,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, · 2406 unmodified lines
57515751 } else
57525752 tcp_init_metrics(sk);
57535753
5754+ tcp_update_pacing_rate(sk);
5755+
57545756 /* Prevent spurious tcp_cwnd_restart() on first data packet */
57555757 tp->lsndtime = tcp_time_stamp;
57565758
net/ipv4/tcp_output.c+7−5
@@ -986,8 +986,10 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) · 985 unmodified lines
986986 static void tcp_set_skb_tso_segs(const struct sock *sk, struct sk_buff *skb,
987987 unsigned int mss_now)
988988 {
989− if (skb->len <= mss_now || !sk_can_gso(sk) ||
990− skb->ip_summed == CHECKSUM_NONE) {
989+ /* Make sure we own this skb before messing gso_size/gso_segs */
990+ WARN_ON_ONCE(skb_cloned(skb));
991+
992+ if (skb->len <= mss_now || skb->ip_summed == CHECKSUM_NONE) {
991993 /* Avoid the costly divide in the normal
992994 * non-TSO case.
993995 */
@@ -1067,9 +1069,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, · 73 unmodified lines
10671069 if (nsize < 0)
10681070 nsize = 0;
10691071
1070− if (skb_cloned(skb) &&
1071− skb_is_nonlinear(skb) &&
1072− pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
1072+ if (skb_unclone(skb, GFP_ATOMIC))
10731073 return -ENOMEM;
10741074
10751075 /* Get a new skb... force flag on. */
@@ -2344,6 +2344,8 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) · 1268 unmodified lines
23442344 int oldpcount = tcp_skb_pcount(skb);
23452345
23462346 if (unlikely(oldpcount > 1)) {
2347+ if (skb_unclone(skb, GFP_ATOMIC))
2348+ return -ENOMEM;
23472349 tcp_init_tso_segs(sk, skb, cur_mss);
23482350 tcp_adjust_pcount(sk, skb, oldpcount - tcp_skb_pcount(skb));
23492351 }
net/ipv4/xfrm4_policy.c+1−0
@@ -107,6 +107,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse) · 106 unmodified lines
107107
108108 memset(fl4, 0, sizeof(struct flowi4));
109109 fl4->flowi4_mark = skb->mark;
110+ fl4->flowi4_oif = skb_dst(skb)->dev->ifindex;
110111
111112 if (!ip_is_fragment(iph)) {
112113 switch (iph->protocol) {
net/ipv6/ah6.c+1−2
@@ -618,8 +618,7 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, · 617 unmodified lines
618618 struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset);
619619 struct xfrm_state *x;
620620
621− if (type != ICMPV6_DEST_UNREACH &&
622− type != ICMPV6_PKT_TOOBIG &&
621+ if (type != ICMPV6_PKT_TOOBIG &&
623622 type != NDISC_REDIRECT)
624623 return;
625624
net/ipv6/esp6.c+1−2
@@ -436,8 +436,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, · 435 unmodified lines
436436 struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data + offset);
437437 struct xfrm_state *x;
438438
439− if (type != ICMPV6_DEST_UNREACH &&
440− type != ICMPV6_PKT_TOOBIG &&
439+ if (type != ICMPV6_PKT_TOOBIG &&
441440 type != NDISC_REDIRECT)
442441 return;
443442
net/ipv6/ip6_gre.c+1−2
@@ -976,6 +976,7 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu) · 975 unmodified lines
976976 if (t->parms.o_flags&GRE_SEQ)
977977 addend += 4;
978978 }
979+ t->hlen = addend;
979980
980981 if (p->flags & IP6_TNL_F_CAP_XMIT) {
981982 int strict = (ipv6_addr_type(&p->raddr) &
@@ -1002,8 +1003,6 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu) · 20 unmodified lines
10021003 }
10031004 ip6_rt_put(rt);
10041005 }
1005−
1006− t->hlen = addend;
10071006 }
10081007
10091008 static int ip6gre_tnl_change(struct ip6_tnl *t,
net/ipv6/ip6_output.c+16−13
@@ -105,7 +105,7 @@ static int ip6_finish_output2(struct sk_buff *skb) · 104 unmodified lines
105105 }
106106
107107 rcu_read_lock_bh();
108− nexthop = rt6_nexthop((struct rt6_info *)dst, &ipv6_hdr(skb)->daddr);
108+ nexthop = rt6_nexthop((struct rt6_info *)dst);
109109 neigh = __ipv6_neigh_lookup_noref(dst->dev, nexthop);
110110 if (unlikely(!neigh))
111111 neigh = __neigh_create(&nd_tbl, nexthop, dst->dev, false);
@@ -874,7 +874,7 @@ static int ip6_dst_lookup_tail(struct sock *sk, · 762 unmodified lines
874874 */
875875 rt = (struct rt6_info *) *dst;
876876 rcu_read_lock_bh();
877− n = __ipv6_neigh_lookup_noref(rt->dst.dev, rt6_nexthop(rt, &fl6->daddr));
877+ n = __ipv6_neigh_lookup_noref(rt->dst.dev, rt6_nexthop(rt));
878878 err = n && !(n->nud_state & NUD_VALID) ? -EINVAL : 0;
879879 rcu_read_unlock_bh();
880880
@@ -1008,6 +1008,7 @@ static inline int ip6_ufo_append_data(struct sock *sk, · 127 unmodified lines
10081008
10091009 {
10101010 struct sk_buff *skb;
1011+ struct frag_hdr fhdr;
10111012 int err;
10121013
10131014 /* There is support for UDP large send offload by network
@@ -1015,8 +1016,6 @@ static inline int ip6_ufo_append_data(struct sock *sk, · 1 unmodified line
10151016 * udp datagram
10161017 */
10171018 if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) {
1018− struct frag_hdr fhdr;
1019−
10201019 skb = sock_alloc_send_skb(sk,
10211020 hh_len + fragheaderlen + transhdrlen + 20,
10221021 (flags & MSG_DONTWAIT), &err);
@@ -1036,20 +1035,24 @@ static inline int ip6_ufo_append_data(struct sock *sk, · 13 unmodified lines
10361035 skb->transport_header = skb->network_header + fragheaderlen;
10371036
10381037 skb->protocol = htons(ETH_P_IPV6);
1039− skb->ip_summed = CHECKSUM_PARTIAL;
10401038 skb->csum = 0;
10411039
1042− /* Specify the length of each IPv6 datagram fragment.
1043− * It has to be a multiple of 8.
1044− */
1045− skb_shinfo(skb)->gso_size = (mtu - fragheaderlen -
1046− sizeof(struct frag_hdr)) & ~7;
1047− skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
1048− ipv6_select_ident(&fhdr, rt);
1049− skb_shinfo(skb)->ip6_frag_id = fhdr.identification;
10501040 __skb_queue_tail(&sk->sk_write_queue, skb);
1041+ } else if (skb_is_gso(skb)) {
1042+ goto append;
10511043 }
10521044
1045+ skb->ip_summed = CHECKSUM_PARTIAL;
1046+ /* Specify the length of each IPv6 datagram fragment.
1047+ * It has to be a multiple of 8.
1048+ */
1049+ skb_shinfo(skb)->gso_size = (mtu - fragheaderlen -
1050+ sizeof(struct frag_hdr)) & ~7;
1051+ skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
1052+ ipv6_select_ident(&fhdr, rt);
1053+ skb_shinfo(skb)->ip6_frag_id = fhdr.identification;
1054+
1055+append:
10531056 return skb_append_datato_frags(sk, skb, getfrag, from,
10541057 (length - transhdrlen));
10551058 }
net/ipv6/ipcomp6.c+1−2
@@ -64,8 +64,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, · 63 unmodified lines
6464 (struct ip_comp_hdr *)(skb->data + offset);
6565 struct xfrm_state *x;
6666
67− if (type != ICMPV6_DEST_UNREACH &&
68− type != ICMPV6_PKT_TOOBIG &&
67+ if (type != ICMPV6_PKT_TOOBIG &&
6968 type != NDISC_REDIRECT)
7069 return;
7170
net/ipv6/route.c+37−9
@@ -476,6 +476,24 @@ out: · 475 unmodified lines
476476 }
477477
478478 #ifdef CONFIG_IPV6_ROUTER_PREF
479+struct __rt6_probe_work {
480+ struct work_struct work;
481+ struct in6_addr target;
482+ struct net_device *dev;
483+};
484+
485+static void rt6_probe_deferred(struct work_struct *w)
486+{
487+ struct in6_addr mcaddr;
488+ struct __rt6_probe_work *work =
489+ container_of(w, struct __rt6_probe_work, work);
490+
491+ addrconf_addr_solict_mult(&work->target, &mcaddr);
492+ ndisc_send_ns(work->dev, NULL, &work->target, &mcaddr, NULL);
493+ dev_put(work->dev);
494+ kfree(w);
495+}
496+
479497 static void rt6_probe(struct rt6_info *rt)
480498 {
481499 struct neighbour *neigh;
@@ -499,17 +517,23 @@ static void rt6_probe(struct rt6_info *rt) · 17 unmodified lines
499517
500518 if (!neigh ||
501519 time_after(jiffies, neigh->updated + rt->rt6i_idev->cnf.rtr_probe_interval)) {
502− struct in6_addr mcaddr;
503− struct in6_addr *target;
520+ struct __rt6_probe_work *work;
504521
505− if (neigh) {
522+ work = kmalloc(sizeof(*work), GFP_ATOMIC);
523+
524+ if (neigh && work)
506525 neigh->updated = jiffies;
526+
527+ if (neigh)
507528 write_unlock(&neigh->lock);
508− }
509529
510− target = (struct in6_addr *)&rt->rt6i_gateway;
511− addrconf_addr_solict_mult(target, &mcaddr);
512− ndisc_send_ns(rt->dst.dev, NULL, target, &mcaddr, NULL);
530+ if (work) {
531+ INIT_WORK(&work->work, rt6_probe_deferred);
532+ work->target = rt->rt6i_gateway;
533+ dev_hold(rt->dst.dev);
534+ work->dev = rt->dst.dev;
535+ schedule_work(&work->work);
536+ }
513537 } else {
514538 out:
515539 write_unlock(&neigh->lock);
@@ -851,7 +875,6 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort, · 335 unmodified lines
851875 if (ort->rt6i_dst.plen != 128 &&
852876 ipv6_addr_equal(&ort->rt6i_dst.addr, daddr))
853877 rt->rt6i_flags |= RTF_ANYCAST;
854− rt->rt6i_gateway = *daddr;
855878 }
856879
857880 rt->rt6i_flags |= RTF_CACHE;
@@ -1335,6 +1358,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev, · 477 unmodified lines
13351358 rt->dst.flags |= DST_HOST;
13361359 rt->dst.output = ip6_output;
13371360 atomic_set(&rt->dst.__refcnt, 1);
1361+ rt->rt6i_gateway = fl6->daddr;
13381362 rt->rt6i_dst.addr = fl6->daddr;
13391363 rt->rt6i_dst.plen = 128;
13401364 rt->rt6i_idev = idev;
@@ -1870,7 +1894,10 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort, · 529 unmodified lines
18701894 in6_dev_hold(rt->rt6i_idev);
18711895 rt->dst.lastuse = jiffies;
18721896
1873− rt->rt6i_gateway = ort->rt6i_gateway;
1897+ if (ort->rt6i_flags & RTF_GATEWAY)
1898+ rt->rt6i_gateway = ort->rt6i_gateway;
1899+ else
1900+ rt->rt6i_gateway = *dest;
18741901 rt->rt6i_flags = ort->rt6i_flags;
18751902 if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) ==
18761903 (RTF_DEFAULT | RTF_ADDRCONF))
@@ -2157,6 +2184,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, · 280 unmodified lines
21572184 else
21582185 rt->rt6i_flags |= RTF_LOCAL;
21592186
2187+ rt->rt6i_gateway = *addr;
21602188 rt->rt6i_dst.addr = *addr;
21612189 rt->rt6i_dst.plen = 128;
21622190 rt->rt6i_table = fib6_get_table(net, RT6_TABLE_LOCAL);
net/ipv6/udp.c+2−3
@@ -1243,9 +1243,6 @@ do_udp_sendmsg: · 1242 unmodified lines
12431243 if (tclass < 0)
12441244 tclass = np->tclass;
12451245
1246− if (dontfrag < 0)
1247− dontfrag = np->dontfrag;
1248−
12491246 if (msg->msg_flags&MSG_CONFIRM)
12501247 goto do_confirm;
12511248 back_from_confirm:
@@ -1264,6 +1261,8 @@ back_from_confirm: · 12 unmodified lines
12641261 up->pending = AF_INET6;
12651262
12661263 do_append_data:
1264+ if (dontfrag < 0)
1265+ dontfrag = np->dontfrag;
12671266 up->len += ulen;
12681267 getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag;
12691268 err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen,
net/ipv6/xfrm6_policy.c+1−0
@@ -138,6 +138,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse) · 137 unmodified lines
138138
139139 memset(fl6, 0, sizeof(struct flowi6));
140140 fl6->flowi6_mark = skb->mark;
141+ fl6->flowi6_oif = skb_dst(skb)->dev->ifindex;
141142
142143 fl6->daddr = reverse ? hdr->saddr : hdr->daddr;
143144 fl6->saddr = reverse ? hdr->daddr : hdr->saddr;
net/key/af_key.c+2−1
@@ -1098,7 +1098,8 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, · 1097 unmodified lines
10981098
10991099 x->id.proto = proto;
11001100 x->id.spi = sa->sadb_sa_spi;
1101− x->props.replay_window = sa->sadb_sa_replay;
1101+ x->props.replay_window = min_t(unsigned int, sa->sadb_sa_replay,
1102+ (sizeof(x->replay.bitmap) * 8));
11021103 if (sa->sadb_sa_flags & SADB_SAFLAGS_NOECN)
11031104 x->props.flags |= XFRM_STATE_NOECN;
11041105 if (sa->sadb_sa_flags & SADB_SAFLAGS_DECAP_DSCP)
net/l2tp/l2tp_ppp.c+4−0
@@ -353,7 +353,9 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh · 352 unmodified lines
353353 goto error_put_sess_tun;
354354 }
355355
356+ local_bh_disable();
356357 l2tp_xmit_skb(session, skb, session->hdr_len);
358+ local_bh_enable();
357359
358360 sock_put(ps->tunnel_sock);
359361 sock_put(sk);
@@ -422,7 +424,9 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) · 62 unmodified lines
422424 skb->data[0] = ppph[0];
423425 skb->data[1] = ppph[1];
424426
427+ local_bh_disable();
425428 l2tp_xmit_skb(session, skb, session->hdr_len);
429+ local_bh_enable();
426430
427431 sock_put(sk_tun);
428432 sock_put(sk);
net/mac80211/cfg.c+1−1
@@ -3564,7 +3564,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev, · 3563 unmodified lines
35643564 return -EINVAL;
35653565 }
35663566 band = chanctx_conf->def.chan->band;
3567− sta = sta_info_get(sdata, peer);
3567+ sta = sta_info_get_bss(sdata, peer);
35683568 if (sta) {
35693569 qos = test_sta_flag(sta, WLAN_STA_WME);
35703570 } else {
net/mac80211/ieee80211_i.h+3−0
@@ -893,6 +893,8 @@ struct tpt_led_trigger { · 892 unmodified lines
893893 * that the scan completed.
894894 * @SCAN_ABORTED: Set for our scan work function when the driver reported
895895 * a scan complete for an aborted scan.
896+ * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being
897+ * cancelled.
896898 */
897899 enum {
898900 SCAN_SW_SCANNING,
@@ -900,6 +902,7 @@ enum { · 1 unmodified line
900902 SCAN_ONCHANNEL_SCANNING,
901903 SCAN_COMPLETED,
902904 SCAN_ABORTED,
905+ SCAN_HW_CANCELLED,
903906 };
904907
905908 /**
net/mac80211/offchannel.c+2−0
@@ -394,6 +394,8 @@ void ieee80211_sw_roc_work(struct work_struct *work) · 393 unmodified lines
394394
395395 if (started)
396396 ieee80211_start_next_roc(local);
397+ else if (list_empty(&local->roc_list))
398+ ieee80211_run_deferred_scan(local);
397399 }
398400
399401 out_unlock:
net/mac80211/scan.c+19−0
@@ -238,6 +238,9 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) · 237 unmodified lines
238238 enum ieee80211_band band;
239239 int i, ielen, n_chans;
240240
241+ if (test_bit(SCAN_HW_CANCELLED, &local->scanning))
242+ return false;
243+
241244 do {
242245 if (local->hw_scan_band == IEEE80211_NUM_BANDS)
243246 return false;
@@ -939,7 +942,23 @@ void ieee80211_scan_cancel(struct ieee80211_local *local) · 695 unmodified lines
939942 if (!local->scan_req)
940943 goto out;
941944
945+ /*
946+ * We have a scan running and the driver already reported completion,
947+ * but the worker hasn't run yet or is stuck on the mutex - mark it as
948+ * cancelled.
949+ */
950+ if (test_bit(SCAN_HW_SCANNING, &local->scanning) &&
951+ test_bit(SCAN_COMPLETED, &local->scanning)) {
952+ set_bit(SCAN_HW_CANCELLED, &local->scanning);
953+ goto out;
954+ }
955+
942956 if (test_bit(SCAN_HW_SCANNING, &local->scanning)) {
957+ /*
958+ * Make sure that __ieee80211_scan_completed doesn't trigger a
959+ * scan on another band.
960+ */
961+ set_bit(SCAN_HW_CANCELLED, &local->scanning);
943962 if (local->ops->cancel_hw_scan)
944963 drv_cancel_hw_scan(local,
945964 rcu_dereference_protected(local->scan_sdata,
net/mac80211/status.c+3−0
@@ -180,6 +180,9 @@ static void ieee80211_frame_acked(struct sta_info *sta, struct sk_buff *skb) · 179 unmodified lines
180180 struct ieee80211_local *local = sta->local;
181181 struct ieee80211_sub_if_data *sdata = sta->sdata;
182182
183+ if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)
184+ sta->last_rx = jiffies;
185+
183186 if (ieee80211_is_data_qos(mgmt->frame_control)) {
184187 struct ieee80211_hdr *hdr = (void *) skb->data;
185188 u8 *qc = ieee80211_get_qos_ctl(hdr);
net/mac80211/tx.c+2−1
@@ -1120,7 +1120,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, · 1119 unmodified lines
11201120 tx->sta = rcu_dereference(sdata->u.vlan.sta);
11211121 if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr)
11221122 return TX_DROP;
1123− } else if (info->flags & IEEE80211_TX_CTL_INJECTED ||
1123+ } else if (info->flags & (IEEE80211_TX_CTL_INJECTED |
1124+ IEEE80211_TX_INTFL_NL80211_FRAME_TX) ||
11241125 tx->sdata->control_port_protocol == tx->skb->protocol) {
11251126 tx->sta = sta_info_get_bss(sdata, hdr->addr1);
11261127 }
net/mac80211/util.c+4−0
@@ -2236,6 +2236,10 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, · 2235 unmodified lines
22362236 }
22372237
22382238 rate = cfg80211_calculate_bitrate(&ri);
2239+ if (WARN_ONCE(!rate,
2240+ "Invalid bitrate: flags=0x%x, idx=%d, vht_nss=%d\n",
2241+ status->flag, status->rate_idx, status->vht_nss))
2242+ return 0;
22392243
22402244 /* rewind from end of MPDU */
22412245 if (status->flag & RX_FLAG_MACTIME_END)
net/netfilter/nf_conntrack_h323_main.c+2−2
@@ -778,8 +778,8 @@ static int callforward_do_filter(const union nf_inet_addr *src, · 777 unmodified lines
778778 flowi6_to_flowi(&fl1), false)) {
779779 if (!afinfo->route(&init_net, (struct dst_entry **)&rt2,
780780 flowi6_to_flowi(&fl2), false)) {
781− if (!memcmp(&rt1->rt6i_gateway, &rt2->rt6i_gateway,
782− sizeof(rt1->rt6i_gateway)) &&
781+ if (ipv6_addr_equal(rt6_nexthop(rt1),
782+ rt6_nexthop(rt2)) &&
783783 rt1->dst.dev == rt2->dst.dev)
784784 ret = 1;
785785 dst_release(&rt2->dst);
net/sched/sch_netem.c+17−0
@@ -358,6 +358,21 @@ static psched_time_t packet_len_2_sched_time(unsigned int len, struct netem_sche · 357 unmodified lines
358358 return PSCHED_NS2TICKS(ticks);
359359 }
360360
361+static void tfifo_reset(struct Qdisc *sch)
362+{
363+ struct netem_sched_data *q = qdisc_priv(sch);
364+ struct rb_node *p;
365+
366+ while ((p = rb_first(&q->t_root))) {
367+ struct sk_buff *skb = netem_rb_to_skb(p);
368+
369+ rb_erase(p, &q->t_root);
370+ skb->next = NULL;
371+ skb->prev = NULL;
372+ kfree_skb(skb);
373+ }
374+}
375+
361376 static void tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch)
362377 {
363378 struct netem_sched_data *q = qdisc_priv(sch);
@@ -520,6 +535,7 @@ static unsigned int netem_drop(struct Qdisc *sch) · 156 unmodified lines
520535 skb->next = NULL;
521536 skb->prev = NULL;
522537 len = qdisc_pkt_len(skb);
538+ sch->qstats.backlog -= len;
523539 kfree_skb(skb);
524540 }
525541 }
@@ -609,6 +625,7 @@ static void netem_reset(struct Qdisc *sch) · 83 unmodified lines
609625 struct netem_sched_data *q = qdisc_priv(sch);
610626
611627 qdisc_reset_queue(sch);
628+ tfifo_reset(sch);
612629 if (q->qdisc)
613630 qdisc_reset(q->qdisc);
614631 qdisc_watchdog_cancel(&q->watchdog);
net/sctp/output.c+2−1
@@ -536,7 +536,8 @@ int sctp_packet_transmit(struct sctp_packet *packet) · 535 unmodified lines
536536 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
537537 */
538538 if (!sctp_checksum_disable) {
539− if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
539+ if (!(dst->dev->features & NETIF_F_SCTP_CSUM) ||
540+ (dst_xfrm(dst) != NULL) || packet->ipfragok) {
540541 __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
541542
542543 /* 3) Put the resultant value into the checksum field in the
net/unix/af_unix.c+10−0
@@ -1246,6 +1246,15 @@ static int unix_socketpair(struct socket *socka, struct socket *sockb) · 1245 unmodified lines
12461246 return 0;
12471247 }
12481248
1249+static void unix_sock_inherit_flags(const struct socket *old,
1250+ struct socket *new)
1251+{
1252+ if (test_bit(SOCK_PASSCRED, &old->flags))
1253+ set_bit(SOCK_PASSCRED, &new->flags);
1254+ if (test_bit(SOCK_PASSSEC, &old->flags))
1255+ set_bit(SOCK_PASSSEC, &new->flags);
1256+}
1257+
12491258 static int unix_accept(struct socket *sock, struct socket *newsock, int flags)
12501259 {
12511260 struct sock *sk = sock->sk;
@@ -1280,6 +1289,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags) · 28 unmodified lines
12801289 /* attach accepted sock to socket */
12811290 unix_state_lock(tsk);
12821291 newsock->state = SS_CONNECTED;
1292+ unix_sock_inherit_flags(sock, newsock);
12831293 sock_graft(tsk, newsock);
12841294 unix_state_unlock(tsk);
12851295 return 0;
net/wireless/core.c+0−2
@@ -958,8 +958,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, · 957 unmodified lines
958958 case NETDEV_PRE_UP:
959959 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
960960 return notifier_from_errno(-EOPNOTSUPP);
961− if (rfkill_blocked(rdev->rfkill))
962− return notifier_from_errno(-ERFKILL);
963961 ret = cfg80211_can_add_interface(rdev, wdev->iftype);
964962 if (ret)
965963 return notifier_from_errno(ret);
net/wireless/core.h+3−0
@@ -402,6 +402,9 @@ static inline int · 401 unmodified lines
402402 cfg80211_can_add_interface(struct cfg80211_registered_device *rdev,
403403 enum nl80211_iftype iftype)
404404 {
405+ if (rfkill_blocked(rdev->rfkill))
406+ return -ERFKILL;
407+
405408 return cfg80211_can_change_interface(rdev, NULL, iftype);
406409 }
407410
net/wireless/radiotap.c+6−1
@@ -97,6 +97,10 @@ int ieee80211_radiotap_iterator_init( · 96 unmodified lines
9797 struct ieee80211_radiotap_header *radiotap_header,
9898 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns)
9999 {
100+ /* check the radiotap header can actually be present */
101+ if (max_length < sizeof(struct ieee80211_radiotap_header))
102+ return -EINVAL;
103+
100104 /* Linux only supports version 0 radiotap format */
101105 if (radiotap_header->it_version)
102106 return -EINVAL;
@@ -131,7 +135,8 @@ int ieee80211_radiotap_iterator_init( · 28 unmodified lines
131135 */
132136
133137 if ((unsigned long)iterator->_arg -
134− (unsigned long)iterator->_rtheader >
138+ (unsigned long)iterator->_rtheader +
139+ sizeof(uint32_t) >
135140 (unsigned long)iterator->_max_length)
136141 return -EINVAL;
137142 }
net/xfrm/xfrm_policy.c+21−7
@@ -334,7 +334,8 @@ static void xfrm_policy_kill(struct xfrm_policy *policy) · 333 unmodified lines
334334
335335 atomic_inc(&policy->genid);
336336
337− del_timer(&policy->polq.hold_timer);
337+ if (del_timer(&policy->polq.hold_timer))
338+ xfrm_pol_put(policy);
338339 xfrm_queue_purge(&policy->polq.hold_queue);
339340
340341 if (del_timer(&policy->timer))
@@ -589,7 +590,8 @@ static void xfrm_policy_requeue(struct xfrm_policy *old, · 248 unmodified lines
589590
590591 spin_lock_bh(&pq->hold_queue.lock);
591592 skb_queue_splice_init(&pq->hold_queue, &list);
592− del_timer(&pq->hold_timer);
593+ if (del_timer(&pq->hold_timer))
594+ xfrm_pol_put(old);
593595 spin_unlock_bh(&pq->hold_queue.lock);
594596
595597 if (skb_queue_empty(&list))
@@ -600,7 +602,8 @@ static void xfrm_policy_requeue(struct xfrm_policy *old, · 4 unmodified lines
600602 spin_lock_bh(&pq->hold_queue.lock);
601603 skb_queue_splice(&list, &pq->hold_queue);
602604 pq->timeout = XFRM_QUEUE_TMO_MIN;
603− mod_timer(&pq->hold_timer, jiffies);
605+ if (!mod_timer(&pq->hold_timer, jiffies))
606+ xfrm_pol_hold(new);
604607 spin_unlock_bh(&pq->hold_queue.lock);
605608 }
606609
@@ -1769,6 +1772,10 @@ static void xfrm_policy_queue_process(unsigned long arg) · 1162 unmodified lines
17691772
17701773 spin_lock(&pq->hold_queue.lock);
17711774 skb = skb_peek(&pq->hold_queue);
1775+ if (!skb) {
1776+ spin_unlock(&pq->hold_queue.lock);
1777+ goto out;
1778+ }
17721779 dst = skb_dst(skb);
17731780 sk = skb->sk;
17741781 xfrm_decode_session(skb, &fl, dst->ops->family);
@@ -1787,8 +1794,9 @@ static void xfrm_policy_queue_process(unsigned long arg) · 12 unmodified lines
17871794 goto purge_queue;
17881795
17891796 pq->timeout = pq->timeout << 1;
1790− mod_timer(&pq->hold_timer, jiffies + pq->timeout);
1791− return;
1797+ if (!mod_timer(&pq->hold_timer, jiffies + pq->timeout))
1798+ xfrm_pol_hold(pol);
1799+ goto out;
17921800 }
17931801
17941802 dst_release(dst);
@@ -1819,11 +1827,14 @@ static void xfrm_policy_queue_process(unsigned long arg) · 24 unmodified lines
18191827 err = dst_output(skb);
18201828 }
18211829
1830+out:
1831+ xfrm_pol_put(pol);
18221832 return;
18231833
18241834 purge_queue:
18251835 pq->timeout = 0;
18261836 xfrm_queue_purge(&pq->hold_queue);
1837+ xfrm_pol_put(pol);
18271838 }
18281839
18291840 static int xdst_queue_output(struct sk_buff *skb)
@@ -1831,7 +1842,8 @@ static int xdst_queue_output(struct sk_buff *skb) · 1 unmodified line
18311842 unsigned long sched_next;
18321843 struct dst_entry *dst = skb_dst(skb);
18331844 struct xfrm_dst *xdst = (struct xfrm_dst *) dst;
1834− struct xfrm_policy_queue *pq = &xdst->pols[0]->polq;
1845+ struct xfrm_policy *pol = xdst->pols[0];
1846+ struct xfrm_policy_queue *pq = &pol->polq;
18351847
18361848 if (pq->hold_queue.qlen > XFRM_MAX_QUEUE_LEN) {
18371849 kfree_skb(skb);
@@ -1850,10 +1862,12 @@ static int xdst_queue_output(struct sk_buff *skb) · 12 unmodified lines
18501862 if (del_timer(&pq->hold_timer)) {
18511863 if (time_before(pq->hold_timer.expires, sched_next))
18521864 sched_next = pq->hold_timer.expires;
1865+ xfrm_pol_put(pol);
18531866 }
18541867
18551868 __skb_queue_tail(&pq->hold_queue, skb);
1856− mod_timer(&pq->hold_timer, sched_next);
1869+ if (!mod_timer(&pq->hold_timer, sched_next))
1870+ xfrm_pol_hold(pol);
18571871
18581872 spin_unlock_bh(&pq->hold_queue.lock);
18591873
net/xfrm/xfrm_replay.c+28−26
@@ -61,9 +61,9 @@ static void xfrm_replay_notify(struct xfrm_state *x, int event) · 60 unmodified lines
6161
6262 switch (event) {
6363 case XFRM_REPLAY_UPDATE:
64− if (x->replay_maxdiff &&
65− (x->replay.seq - x->preplay.seq < x->replay_maxdiff) &&
66− (x->replay.oseq - x->preplay.oseq < x->replay_maxdiff)) {
64+ if (!x->replay_maxdiff ||
65+ ((x->replay.seq - x->preplay.seq < x->replay_maxdiff) &&
66+ (x->replay.oseq - x->preplay.oseq < x->replay_maxdiff))) {
6767 if (x->xflags & XFRM_TIME_DEFER)
6868 event = XFRM_REPLAY_TIMEOUT;
6969 else
@@ -129,8 +129,7 @@ static int xfrm_replay_check(struct xfrm_state *x, · 59 unmodified lines
129129 return 0;
130130
131131 diff = x->replay.seq - seq;
132− if (diff >= min_t(unsigned int, x->props.replay_window,
133− sizeof(x->replay.bitmap) * 8)) {
132+ if (diff >= x->props.replay_window) {
134133 x->stats.replay_window++;
135134 goto err;
136135 }
@@ -302,9 +301,10 @@ static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event) · 165 unmodified lines
302301
303302 switch (event) {
304303 case XFRM_REPLAY_UPDATE:
305− if (x->replay_maxdiff &&
306− (replay_esn->seq - preplay_esn->seq < x->replay_maxdiff) &&
307− (replay_esn->oseq - preplay_esn->oseq < x->replay_maxdiff)) {
304+ if (!x->replay_maxdiff ||
305+ ((replay_esn->seq - preplay_esn->seq < x->replay_maxdiff) &&
306+ (replay_esn->oseq - preplay_esn->oseq
307+ < x->replay_maxdiff))) {
308308 if (x->xflags & XFRM_TIME_DEFER)
309309 event = XFRM_REPLAY_TIMEOUT;
310310 else
@@ -353,28 +353,30 @@ static void xfrm_replay_notify_esn(struct xfrm_state *x, int event) · 42 unmodified lines
353353
354354 switch (event) {
355355 case XFRM_REPLAY_UPDATE:
356− if (!x->replay_maxdiff)
357− break;
358−
359− if (replay_esn->seq_hi == preplay_esn->seq_hi)
360− seq_diff = replay_esn->seq - preplay_esn->seq;
361− else
362− seq_diff = ~preplay_esn->seq + replay_esn->seq + 1;
363−
364− if (replay_esn->oseq_hi == preplay_esn->oseq_hi)
365− oseq_diff = replay_esn->oseq - preplay_esn->oseq;
366− else
367− oseq_diff = ~preplay_esn->oseq + replay_esn->oseq + 1;
368−
369− if (seq_diff < x->replay_maxdiff &&
370− oseq_diff < x->replay_maxdiff) {
356+ if (x->replay_maxdiff) {
357+ if (replay_esn->seq_hi == preplay_esn->seq_hi)
358+ seq_diff = replay_esn->seq - preplay_esn->seq;
359+ else
360+ seq_diff = ~preplay_esn->seq + replay_esn->seq
361+ + 1;
371362
372− if (x->xflags & XFRM_TIME_DEFER)
373− event = XFRM_REPLAY_TIMEOUT;
363+ if (replay_esn->oseq_hi == preplay_esn->oseq_hi)
364+ oseq_diff = replay_esn->oseq
365+ - preplay_esn->oseq;
374366 else
375− return;
367+ oseq_diff = ~preplay_esn->oseq
368+ + replay_esn->oseq + 1;
369+
370+ if (seq_diff >= x->replay_maxdiff ||
371+ oseq_diff >= x->replay_maxdiff)
372+ break;
376373 }
377374
375+ if (x->xflags & XFRM_TIME_DEFER)
376+ event = XFRM_REPLAY_TIMEOUT;
377+ else
378+ return;
379+
378380 break;
379381
380382 case XFRM_REPLAY_TIMEOUT:
net/xfrm/xfrm_user.c+3−2
@@ -446,7 +446,8 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info * · 445 unmodified lines
446446 memcpy(&x->sel, &p->sel, sizeof(x->sel));
447447 memcpy(&x->lft, &p->lft, sizeof(x->lft));
448448 x->props.mode = p->mode;
449− x->props.replay_window = p->replay_window;
449+ x->props.replay_window = min_t(unsigned int, p->replay_window,
450+ sizeof(x->replay.bitmap) * 8);
450451 x->props.reqid = p->reqid;
451452 x->props.family = p->family;
452453 memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr));
@@ -1856,7 +1857,7 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, · 1403 unmodified lines
18561857 if (x->km.state != XFRM_STATE_VALID)
18571858 goto out;
18581859
1859− err = xfrm_replay_verify_len(x->replay_esn, rp);
1860+ err = xfrm_replay_verify_len(x->replay_esn, re);
18601861 if (err)
18611862 goto out;
18621863
security/apparmor/apparmorfs.c+1−3
@@ -580,15 +580,13 @@ static struct aa_namespace *__next_namespace(struct aa_namespace *root, · 579 unmodified lines
580580
581581 /* check if the next ns is a sibling, parent, gp, .. */
582582 parent = ns->parent;
583− while (parent) {
583+ while (ns != root) {
584584 mutex_unlock(&ns->lock);
585585 next = list_entry_next(ns, base.list);
586586 if (!list_entry_is_head(next, &parent->sub_ns, base.list)) {
587587 mutex_lock(&next->lock);
588588 return next;
589589 }
590− if (parent == root)
591− return NULL;
592590 ns = parent;
593591 parent = parent->parent;
594592 }
security/apparmor/policy.c+1−0
@@ -610,6 +610,7 @@ void aa_free_profile(struct aa_profile *profile) · 609 unmodified lines
610610 aa_put_dfa(profile->policy.dfa);
611611 aa_put_replacedby(profile->replacedby);
612612
613+ kzfree(profile->hash);
613614 kzfree(profile);
614615 }
615616
security/selinux/avc.c+3−6
@@ -746,7 +746,6 @@ inline int avc_has_perm_noaudit(u32 ssid, u32 tsid, · 745 unmodified lines
746746 * @tclass: target security class
747747 * @requested: requested permissions, interpreted based on @tclass
748748 * @auditdata: auxiliary audit data
749− * @flags: VFS walk flags
750749 *
751750 * Check the AVC to determine whether the @requested permissions are granted
752751 * for the SID pair (@ssid, @tsid), interpreting the permissions
@@ -756,17 +755,15 @@ inline int avc_has_perm_noaudit(u32 ssid, u32 tsid, · 3 unmodified lines
756755 * permissions are granted, -%EACCES if any permissions are denied, or
757756 * another -errno upon other errors.
758757 */
759−int avc_has_perm_flags(u32 ssid, u32 tsid, u16 tclass,
760− u32 requested, struct common_audit_data *auditdata,
761− unsigned flags)
758+int avc_has_perm(u32 ssid, u32 tsid, u16 tclass,
759+ u32 requested, struct common_audit_data *auditdata)
762760 {
763761 struct av_decision avd;
764762 int rc, rc2;
765763
766764 rc = avc_has_perm_noaudit(ssid, tsid, tclass, requested, 0, &avd);
767765
768− rc2 = avc_audit(ssid, tsid, tclass, requested, &avd, rc, auditdata,
769− flags);
766+ rc2 = avc_audit(ssid, tsid, tclass, requested, &avd, rc, auditdata);
770767 if (rc2)
771768 return rc2;
772769 return rc;
security/selinux/hooks.c+7−8
@@ -1502,7 +1502,7 @@ static int cred_has_capability(const struct cred *cred, · 1501 unmodified lines
15021502
15031503 rc = avc_has_perm_noaudit(sid, sid, sclass, av, 0, &avd);
15041504 if (audit == SECURITY_CAP_AUDIT) {
1505− int rc2 = avc_audit(sid, sid, sclass, av, &avd, rc, &ad, 0);
1505+ int rc2 = avc_audit(sid, sid, sclass, av, &avd, rc, &ad);
15061506 if (rc2)
15071507 return rc2;
15081508 }
@@ -1525,8 +1525,7 @@ static int task_has_system(struct task_struct *tsk, · 16 unmodified lines
15251525 static int inode_has_perm(const struct cred *cred,
15261526 struct inode *inode,
15271527 u32 perms,
1528− struct common_audit_data *adp,
1529− unsigned flags)
1528+ struct common_audit_data *adp)
15301529 {
15311530 struct inode_security_struct *isec;
15321531 u32 sid;
@@ -1539,7 +1538,7 @@ static int inode_has_perm(const struct cred *cred, · 6 unmodified lines
15391538 sid = cred_sid(cred);
15401539 isec = inode->i_security;
15411540
1542− return avc_has_perm_flags(sid, isec->sid, isec->sclass, perms, adp, flags);
1541+ return avc_has_perm(sid, isec->sid, isec->sclass, perms, adp);
15431542 }
15441543
15451544 /* Same as inode_has_perm, but pass explicit audit data containing
@@ -1554,7 +1553,7 @@ static inline int dentry_has_perm(const struct cred *cred, · 8 unmodified lines
15541553
15551554 ad.type = LSM_AUDIT_DATA_DENTRY;
15561555 ad.u.dentry = dentry;
1557− return inode_has_perm(cred, inode, av, &ad, 0);
1556+ return inode_has_perm(cred, inode, av, &ad);
15581557 }
15591558
15601559 /* Same as inode_has_perm, but pass explicit audit data containing
@@ -1569,7 +1568,7 @@ static inline int path_has_perm(const struct cred *cred, · 8 unmodified lines
15691568
15701569 ad.type = LSM_AUDIT_DATA_PATH;
15711570 ad.u.path = *path;
1572− return inode_has_perm(cred, inode, av, &ad, 0);
1571+ return inode_has_perm(cred, inode, av, &ad);
15731572 }
15741573
15751574 /* Same as path_has_perm, but uses the inode from the file struct. */
@@ -1581,7 +1580,7 @@ static inline int file_path_has_perm(const struct cred *cred, · 5 unmodified lines
15811580
15821581 ad.type = LSM_AUDIT_DATA_PATH;
15831582 ad.u.path = file->f_path;
1584− return inode_has_perm(cred, file_inode(file), av, &ad, 0);
1583+ return inode_has_perm(cred, file_inode(file), av, &ad);
15851584 }
15861585
15871586 /* Check whether a task can use an open file descriptor to
@@ -1617,7 +1616,7 @@ static int file_has_perm(const struct cred *cred, · 29 unmodified lines
16171616 /* av is zero if only checking access to the descriptor. */
16181617 rc = 0;
16191618 if (av)
1620− rc = inode_has_perm(cred, inode, av, &ad, 0);
1619+ rc = inode_has_perm(cred, inode, av, &ad);
16211620
16221621 out:
16231622 return rc;
security/selinux/include/avc.h+5−13
@@ -130,7 +130,7 @@ static inline int avc_audit(u32 ssid, u32 tsid, · 129 unmodified lines
130130 u16 tclass, u32 requested,
131131 struct av_decision *avd,
132132 int result,
133− struct common_audit_data *a, unsigned flags)
133+ struct common_audit_data *a)
134134 {
135135 u32 audited, denied;
136136 audited = avc_audit_required(requested, avd, result, 0, &denied);
@@ -138,7 +138,7 @@ static inline int avc_audit(u32 ssid, u32 tsid, · 1 unmodified line
138138 return 0;
139139 return slow_avc_audit(ssid, tsid, tclass,
140140 requested, audited, denied,
141− a, flags);
141+ a, 0);
142142 }
143143
144144 #define AVC_STRICT 1 /* Ignore permissive mode. */
@@ -147,17 +147,9 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, · 2 unmodified lines
147147 unsigned flags,
148148 struct av_decision *avd);
149149
150−int avc_has_perm_flags(u32 ssid, u32 tsid,
151− u16 tclass, u32 requested,
152− struct common_audit_data *auditdata,
153− unsigned);
154−
155−static inline int avc_has_perm(u32 ssid, u32 tsid,
156− u16 tclass, u32 requested,
157− struct common_audit_data *auditdata)
158−{
159− return avc_has_perm_flags(ssid, tsid, tclass, requested, auditdata, 0);
160−}
150+int avc_has_perm(u32 ssid, u32 tsid,
151+ u16 tclass, u32 requested,
152+ struct common_audit_data *auditdata);
161153
162154 u32 avc_policy_seqno(void);
163155
sound/pci/ac97/ac97_codec.c+1−0
@@ -175,6 +175,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { · 174 unmodified lines
175175 { 0x54524106, 0xffffffff, "TR28026", NULL, NULL },
176176 { 0x54524108, 0xffffffff, "TR28028", patch_tritech_tr28028, NULL }, // added by xin jin [07/09/99]
177177 { 0x54524123, 0xffffffff, "TR28602", NULL, NULL }, // only guess --jk [TR28023 = eMicro EM28023 (new CT1297)]
178+{ 0x54584e03, 0xffffffff, "TLV320AIC27", NULL, NULL },
178179 { 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
179180 { 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232 with S/PDIF
180181 { 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF
sound/pci/hda/hda_generic.c+1−1
@@ -3531,7 +3531,7 @@ static int create_capture_mixers(struct hda_codec *codec) · 3530 unmodified lines
35313531 if (!multi)
35323532 err = create_single_cap_vol_ctl(codec, n, vol, sw,
35333533 inv_dmic);
3534− else if (!multi_cap_vol)
3534+ else if (!multi_cap_vol && !inv_dmic)
35353535 err = create_bind_cap_vol_ctl(codec, n, vol, sw);
35363536 else
35373537 err = create_multi_cap_vol_ctl(codec);
sound/pci/hda/patch_conexant.c+11−0
@@ -3231,6 +3231,7 @@ enum { · 3230 unmodified lines
32313231 CXT_FIXUP_INC_MIC_BOOST,
32323232 CXT_FIXUP_HEADPHONE_MIC_PIN,
32333233 CXT_FIXUP_HEADPHONE_MIC,
3234+ CXT_FIXUP_GPIO1,
32343235 };
32353236
32363237 static void cxt_fixup_stereo_dmic(struct hda_codec *codec,
@@ -3375,6 +3376,15 @@ static const struct hda_fixup cxt_fixups[] = { · 138 unmodified lines
33753376 .type = HDA_FIXUP_FUNC,
33763377 .v.func = cxt_fixup_headphone_mic,
33773378 },
3379+ [CXT_FIXUP_GPIO1] = {
3380+ .type = HDA_FIXUP_VERBS,
3381+ .v.verbs = (const struct hda_verb[]) {
3382+ { 0x01, AC_VERB_SET_GPIO_MASK, 0x01 },
3383+ { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01 },
3384+ { 0x01, AC_VERB_SET_GPIO_DATA, 0x01 },
3385+ { }
3386+ },
3387+ },
33783388 };
33793389
33803390 static const struct snd_pci_quirk cxt5051_fixups[] = {
@@ -3384,6 +3394,7 @@ static const struct snd_pci_quirk cxt5051_fixups[] = { · 3 unmodified lines
33843394
33853395 static const struct snd_pci_quirk cxt5066_fixups[] = {
33863396 SND_PCI_QUIRK(0x1025, 0x0543, "Acer Aspire One 522", CXT_FIXUP_STEREO_DMIC),
3397+ SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT_FIXUP_GPIO1),
33873398 SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN),
33883399 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
33893400 SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T410", CXT_PINCFG_LENOVO_TP410),
sound/pci/hda/patch_hdmi.c+8−10
@@ -936,6 +936,14 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, · 935 unmodified lines
936936 return;
937937 }
938938
939+ /*
940+ * always configure channel mapping, it may have been changed by the
941+ * user in the meantime
942+ */
943+ hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
944+ channels, per_pin->chmap,
945+ per_pin->chmap_set);
946+
939947 /*
940948 * sizeof(ai) is used instead of sizeof(*hdmi_ai) or
941949 * sizeof(*dp_ai) to avoid partial match/update problems when
@@ -947,20 +955,10 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, · 5 unmodified lines
947955 "pin=%d channels=%d\n",
948956 pin_nid,
949957 channels);
950− hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
951− channels, per_pin->chmap,
952− per_pin->chmap_set);
953958 hdmi_stop_infoframe_trans(codec, pin_nid);
954959 hdmi_fill_audio_infoframe(codec, pin_nid,
955960 ai.bytes, sizeof(ai));
956961 hdmi_start_infoframe_trans(codec, pin_nid);
957− } else {
958− /* For non-pcm audio switch, setup new channel mapping
959− * accordingly */
960− if (per_pin->non_pcm != non_pcm)
961− hdmi_setup_channel_mapping(codec, pin_nid, non_pcm, ca,
962− channels, per_pin->chmap,
963− per_pin->chmap_set);
964962 }
965963
966964 per_pin->non_pcm = non_pcm;
sound/pci/hda/patch_realtek.c+54−0
@@ -2819,6 +2819,15 @@ static void alc269_fixup_hweq(struct hda_codec *codec, · 2818 unmodified lines
28192819 alc_write_coef_idx(codec, 0x1e, coef | 0x80);
28202820 }
28212821
2822+static void alc269_fixup_headset_mic(struct hda_codec *codec,
2823+ const struct hda_fixup *fix, int action)
2824+{
2825+ struct alc_spec *spec = codec->spec;
2826+
2827+ if (action == HDA_FIXUP_ACT_PRE_PROBE)
2828+ spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
2829+}
2830+
28222831 static void alc271_fixup_dmic(struct hda_codec *codec,
28232832 const struct hda_fixup *fix, int action)
28242833 {
@@ -3496,6 +3505,15 @@ static void alc282_fixup_asus_tx300(struct hda_codec *codec, · 671 unmodified lines
34963505 }
34973506 }
34983507
3508+static void alc290_fixup_mono_speakers(struct hda_codec *codec,
3509+ const struct hda_fixup *fix, int action)
3510+{
3511+ if (action == HDA_FIXUP_ACT_PRE_PROBE)
3512+ /* Remove DAC node 0x03, as it seems to be
3513+ giving mono output */
3514+ snd_hda_override_wcaps(codec, 0x03, 0);
3515+}
3516+
34993517 enum {
35003518 ALC269_FIXUP_SONY_VAIO,
35013519 ALC275_FIXUP_SONY_VAIO_GPIO2,
@@ -3507,6 +3525,7 @@ enum { · 5 unmodified lines
35073525 ALC271_FIXUP_DMIC,
35083526 ALC269_FIXUP_PCM_44K,
35093527 ALC269_FIXUP_STEREO_DMIC,
3528+ ALC269_FIXUP_HEADSET_MIC,
35103529 ALC269_FIXUP_QUANTA_MUTE,
35113530 ALC269_FIXUP_LIFEBOOK,
35123531 ALC269_FIXUP_AMIC,
@@ -3519,9 +3538,11 @@ enum { · 6 unmodified lines
35193538 ALC269_FIXUP_HP_GPIO_LED,
35203539 ALC269_FIXUP_INV_DMIC,
35213540 ALC269_FIXUP_LENOVO_DOCK,
3541+ ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
35223542 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
35233543 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
35243544 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
3545+ ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
35253546 ALC269_FIXUP_HEADSET_MODE,
35263547 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
35273548 ALC269_FIXUP_ASUS_X101_FUNC,
@@ -3535,6 +3556,7 @@ enum { · 7 unmodified lines
35353556 ALC283_FIXUP_CHROME_BOOK,
35363557 ALC282_FIXUP_ASUS_TX300,
35373558 ALC283_FIXUP_INT_MIC,
3559+ ALC290_FIXUP_MONO_SPEAKERS,
35383560 };
35393561
35403562 static const struct hda_fixup alc269_fixups[] = {
@@ -3603,6 +3625,10 @@ static const struct hda_fixup alc269_fixups[] = { · 62 unmodified lines
36033625 .type = HDA_FIXUP_FUNC,
36043626 .v.func = alc269_fixup_stereo_dmic,
36053627 },
3628+ [ALC269_FIXUP_HEADSET_MIC] = {
3629+ .type = HDA_FIXUP_FUNC,
3630+ .v.func = alc269_fixup_headset_mic,
3631+ },
36063632 [ALC269_FIXUP_QUANTA_MUTE] = {
36073633 .type = HDA_FIXUP_FUNC,
36083634 .v.func = alc269_fixup_quanta_mute,
@@ -3712,6 +3738,15 @@ static const struct hda_fixup alc269_fixups[] = { · 103 unmodified lines
37123738 .chained = true,
37133739 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
37143740 },
3741+ [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
3742+ .type = HDA_FIXUP_PINS,
3743+ .v.pins = (const struct hda_pintbl[]) {
3744+ { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
3745+ { }
3746+ },
3747+ .chained = true,
3748+ .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
3749+ },
37153750 [ALC269_FIXUP_HEADSET_MODE] = {
37163751 .type = HDA_FIXUP_FUNC,
37173752 .v.func = alc_fixup_headset_mode,
@@ -3720,6 +3755,15 @@ static const struct hda_fixup alc269_fixups[] = { · 2 unmodified lines
37203755 .type = HDA_FIXUP_FUNC,
37213756 .v.func = alc_fixup_headset_mode_no_hp_mic,
37223757 },
3758+ [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
3759+ .type = HDA_FIXUP_PINS,
3760+ .v.pins = (const struct hda_pintbl[]) {
3761+ { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
3762+ { }
3763+ },
3764+ .chained = true,
3765+ .chain_id = ALC269_FIXUP_HEADSET_MIC
3766+ },
37233767 [ALC269_FIXUP_ASUS_X101_FUNC] = {
37243768 .type = HDA_FIXUP_FUNC,
37253769 .v.func = alc269_fixup_x101_headset_mic,
@@ -3804,6 +3848,12 @@ static const struct hda_fixup alc269_fixups[] = { · 78 unmodified lines
38043848 .chained = true,
38053849 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
38063850 },
3851+ [ALC290_FIXUP_MONO_SPEAKERS] = {
3852+ .type = HDA_FIXUP_FUNC,
3853+ .v.func = alc290_fixup_mono_speakers,
3854+ .chained = true,
3855+ .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
3856+ },
38073857 };
38083858
38093859 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -3845,6 +3895,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 35 unmodified lines
38453895 SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
38463896 SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
38473897 SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
3898+ SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_MONO_SPEAKERS),
38483899 SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
38493900 SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
38503901 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
@@ -3867,6 +3918,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 16 unmodified lines
38673918 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
38683919 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
38693920 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
3921+ SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
38703922 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
38713923 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
38723924 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
@@ -3952,6 +4004,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { · 79 unmodified lines
39524004 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
39534005 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
39544006 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
4007+ {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
39554008 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
39564009 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
39574010 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
@@ -4569,6 +4622,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { · 611 unmodified lines
45694622 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
45704623 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
45714624 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
4625+ SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_ASUS_MODE4),
45724626 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
45734627 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
45744628 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
sound/pci/rme9652/hdsp.c+1−0
@@ -4845,6 +4845,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne · 4844 unmodified lines
48454845 if ((err = hdsp_get_iobox_version(hdsp)) < 0)
48464846 return err;
48474847 }
4848+ memset(&hdsp_version, 0, sizeof(hdsp_version));
48484849 hdsp_version.io_type = hdsp->io_type;
48494850 hdsp_version.firmware_rev = hdsp->firmware_rev;
48504851 if ((err = copy_to_user(argp, &hdsp_version, sizeof(hdsp_version))))
sound/soc/blackfin/bf6xx-i2s.c+1−0
@@ -88,6 +88,7 @@ static int bfin_i2s_hw_params(struct snd_pcm_substream *substream, · 87 unmodified lines
8888 case SNDRV_PCM_FORMAT_S8:
8989 param.spctl |= 0x70;
9090 sport->wdsize = 1;
91+ break;
9192 case SNDRV_PCM_FORMAT_S16_LE:
9293 param.spctl |= 0xf0;
9394 sport->wdsize = 2;
sound/soc/codecs/88pm860x-codec.c+3−0
@@ -349,6 +349,9 @@ static int snd_soc_put_volsw_2r_st(struct snd_kcontrol *kcontrol, · 348 unmodified lines
349349 val = ucontrol->value.integer.value[0];
350350 val2 = ucontrol->value.integer.value[1];
351351
352+ if (val >= ARRAY_SIZE(st_table) || val2 >= ARRAY_SIZE(st_table))
353+ return -EINVAL;
354+
352355 err = snd_soc_update_bits(codec, reg, 0x3f, st_table[val].m);
353356 if (err < 0)
354357 return err;
sound/soc/codecs/ab8500-codec.c+6−1
@@ -1225,13 +1225,18 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol, · 1224 unmodified lines
12251225 struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
12261226 struct device *dev = codec->dev;
12271227 bool apply_fir, apply_iir;
1228− int req, status;
1228+ unsigned int req;
1229+ int status;
12291230
12301231 dev_dbg(dev, "%s: Enter.\n", __func__);
12311232
12321233 mutex_lock(&drvdata->anc_lock);
12331234
12341235 req = ucontrol->value.integer.value[0];
1236+ if (req >= ARRAY_SIZE(enum_anc_state)) {
1237+ status = -EINVAL;
1238+ goto cleanup;
1239+ }
12351240 if (req != ANC_APPLY_FIR_IIR && req != ANC_APPLY_FIR &&
12361241 req != ANC_APPLY_IIR) {
12371242 dev_err(dev, "%s: ERROR: Unsupported status to set '%s'!\n",
sound/soc/codecs/max98095.c+2−2
@@ -1863,7 +1863,7 @@ static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol, · 1862 unmodified lines
18631863 struct max98095_pdata *pdata = max98095->pdata;
18641864 int channel = max98095_get_eq_channel(kcontrol->id.name);
18651865 struct max98095_cdata *cdata;
1866− int sel = ucontrol->value.integer.value[0];
1866+ unsigned int sel = ucontrol->value.integer.value[0];
18671867 struct max98095_eq_cfg *coef_set;
18681868 int fs, best, best_val, i;
18691869 int regmask, regsave;
@@ -2016,7 +2016,7 @@ static int max98095_put_bq_enum(struct snd_kcontrol *kcontrol, · 146 unmodified lines
20162016 struct max98095_pdata *pdata = max98095->pdata;
20172017 int channel = max98095_get_bq_channel(codec, kcontrol->id.name);
20182018 struct max98095_cdata *cdata;
2019− int sel = ucontrol->value.integer.value[0];
2019+ unsigned int sel = ucontrol->value.integer.value[0];
20202020 struct max98095_biquad_cfg *coef_set;
20212021 int fs, best, best_val, i;
20222022 int regmask, regsave;
sound/soc/codecs/pcm1681.c+1−1
@@ -270,7 +270,7 @@ MODULE_DEVICE_TABLE(of, pcm1681_dt_ids); · 269 unmodified lines
270270 static const struct regmap_config pcm1681_regmap = {
271271 .reg_bits = 8,
272272 .val_bits = 8,
273− .max_register = ARRAY_SIZE(pcm1681_reg_defaults) + 1,
273+ .max_register = 0x13,
274274 .reg_defaults = pcm1681_reg_defaults,
275275 .num_reg_defaults = ARRAY_SIZE(pcm1681_reg_defaults),
276276 .writeable_reg = pcm1681_writeable_reg,
sound/soc/codecs/pcm1792a.c+1−1
@@ -188,7 +188,7 @@ MODULE_DEVICE_TABLE(of, pcm1792a_of_match); · 187 unmodified lines
188188 static const struct regmap_config pcm1792a_regmap = {
189189 .reg_bits = 8,
190190 .val_bits = 8,
191− .max_register = 24,
191+ .max_register = 23,
192192 .reg_defaults = pcm1792a_reg_defaults,
193193 .num_reg_defaults = ARRAY_SIZE(pcm1792a_reg_defaults),
194194 .writeable_reg = pcm1792a_writeable_reg,
sound/soc/codecs/tlv320aic3x.c+4−0
@@ -674,6 +674,8 @@ static const struct snd_soc_dapm_route intercon[] = { · 673 unmodified lines
674674 /* Left Input */
675675 {"Left Line1L Mux", "single-ended", "LINE1L"},
676676 {"Left Line1L Mux", "differential", "LINE1L"},
677+ {"Left Line1R Mux", "single-ended", "LINE1R"},
678+ {"Left Line1R Mux", "differential", "LINE1R"},
677679
678680 {"Left Line2L Mux", "single-ended", "LINE2L"},
679681 {"Left Line2L Mux", "differential", "LINE2L"},
@@ -690,6 +692,8 @@ static const struct snd_soc_dapm_route intercon[] = { · 10 unmodified lines
690692 /* Right Input */
691693 {"Right Line1R Mux", "single-ended", "LINE1R"},
692694 {"Right Line1R Mux", "differential", "LINE1R"},
695+ {"Right Line1L Mux", "single-ended", "LINE1L"},
696+ {"Right Line1L Mux", "differential", "LINE1L"},
693697
694698 {"Right Line2R Mux", "single-ended", "LINE2R"},
695699 {"Right Line2R Mux", "differential", "LINE2R"},
sound/soc/fsl/fsl_ssi.c+1−1
@@ -936,7 +936,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) · 935 unmodified lines
936936 ssi_private->ssi_phys = res.start;
937937
938938 ssi_private->irq = irq_of_parse_and_map(np, 0);
939− if (ssi_private->irq == NO_IRQ) {
939+ if (ssi_private->irq == 0) {
940940 dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
941941 return -ENXIO;
942942 }
sound/soc/fsl/imx-mc13783.c+1−1
@@ -112,7 +112,7 @@ static int imx_mc13783_probe(struct platform_device *pdev) · 111 unmodified lines
112112 return ret;
113113 }
114114
115− if (machine_is_mx31_3ds()) {
115+ if (machine_is_mx31_3ds() || machine_is_mx31moboard()) {
116116 imx_audmux_v2_configure_port(MX31_AUDMUX_PORT4_SSI_PINS_4,
117117 IMX_AUDMUX_V2_PTCR_SYN,
118118 IMX_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT1_SSI0) |
sound/soc/fsl/imx-sgtl5000.c+5−2
@@ -62,7 +62,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) · 61 unmodified lines
6262 struct device_node *ssi_np, *codec_np;
6363 struct platform_device *ssi_pdev;
6464 struct i2c_client *codec_dev;
65− struct imx_sgtl5000_data *data;
65+ struct imx_sgtl5000_data *data = NULL;
6666 int int_port, ext_port;
6767 int ret;
6868
@@ -128,7 +128,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) · 59 unmodified lines
128128 goto fail;
129129 }
130130
131− data->codec_clk = devm_clk_get(&codec_dev->dev, NULL);
131+ data->codec_clk = clk_get(&codec_dev->dev, NULL);
132132 if (IS_ERR(data->codec_clk)) {
133133 ret = PTR_ERR(data->codec_clk);
134134 goto fail;
@@ -172,6 +172,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) · 37 unmodified lines
172172 return 0;
173173
174174 fail:
175+ if (data && !IS_ERR(data->codec_clk))
176+ clk_put(data->codec_clk);
175177 if (ssi_np)
176178 of_node_put(ssi_np);
177179 if (codec_np)
@@ -185,6 +187,7 @@ static int imx_sgtl5000_remove(struct platform_device *pdev) · 7 unmodified lines
185187 struct imx_sgtl5000_data *data = platform_get_drvdata(pdev);
186188
187189 snd_soc_unregister_card(&data->card);
190+ clk_put(data->codec_clk);
188191
189192 return 0;
190193 }
sound/soc/fsl/imx-ssi.c+12−11
@@ -600,19 +600,17 @@ static int imx_ssi_probe(struct platform_device *pdev) · 599 unmodified lines
600600 ssi->fiq_params.dma_params_rx = &ssi->dma_params_rx;
601601 ssi->fiq_params.dma_params_tx = &ssi->dma_params_tx;
602602
603− ret = imx_pcm_fiq_init(pdev, &ssi->fiq_params);
604− if (ret)
605− goto failed_pcm_fiq;
603+ ssi->fiq_init = imx_pcm_fiq_init(pdev, &ssi->fiq_params);
604+ ssi->dma_init = imx_pcm_dma_init(pdev);
606605
607− ret = imx_pcm_dma_init(pdev);
608− if (ret)
609− goto failed_pcm_dma;
606+ if (ssi->fiq_init && ssi->dma_init) {
607+ ret = ssi->fiq_init;
608+ goto failed_pcm;
609+ }
610610
611611 return 0;
612612
613−failed_pcm_dma:
614− imx_pcm_fiq_exit(pdev);
615−failed_pcm_fiq:
613+failed_pcm:
616614 snd_soc_unregister_component(&pdev->dev);
617615 failed_register:
618616 release_mem_region(res->start, resource_size(res));
@@ -628,8 +626,11 @@ static int imx_ssi_remove(struct platform_device *pdev) · 9 unmodified lines
628626 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
629627 struct imx_ssi *ssi = platform_get_drvdata(pdev);
630628
631− imx_pcm_dma_exit(pdev);
632− imx_pcm_fiq_exit(pdev);
629+ if (!ssi->dma_init)
630+ imx_pcm_dma_exit(pdev);
631+
632+ if (!ssi->fiq_init)
633+ imx_pcm_fiq_exit(pdev);
633634
634635 snd_soc_unregister_component(&pdev->dev);
635636
sound/soc/fsl/imx-ssi.h+2−0
@@ -211,6 +211,8 @@ struct imx_ssi { · 210 unmodified lines
211211 struct imx_dma_data filter_data_rx;
212212 struct imx_pcm_fiq_params fiq_params;
213213
214+ int fiq_init;
215+ int dma_init;
214216 int enabled;
215217 };
216218
sound/soc/omap/Kconfig+2−2
@@ -1,6 +1,6 @@
11 config SND_OMAP_SOC
22 tristate "SoC Audio for the Texas Instruments OMAP chips"
3− depends on (ARCH_OMAP && DMA_OMAP) || (ARCH_ARM && COMPILE_TEST)
3+ depends on (ARCH_OMAP && DMA_OMAP) || (ARM && COMPILE_TEST)
44 select SND_DMAENGINE_PCM
55
66 config SND_OMAP_SOC_DMIC
@@ -26,7 +26,7 @@ config SND_OMAP_SOC_N810 · 19 unmodified lines
2626
2727 config SND_OMAP_SOC_RX51
2828 tristate "SoC Audio support for Nokia RX-51"
29− depends on SND_OMAP_SOC && ARCH_ARM && (MACH_NOKIA_RX51 || COMPILE_TEST)
29+ depends on SND_OMAP_SOC && ARM && (MACH_NOKIA_RX51 || COMPILE_TEST)
3030 select SND_OMAP_SOC_MCBSP
3131 select SND_SOC_TLV320AIC3X
3232 select SND_SOC_TPA6130A2
sound/soc/sh/rcar/rsnd.h+2−2
@@ -220,8 +220,8 @@ int rsnd_gen_path_exit(struct rsnd_priv *priv, · 219 unmodified lines
220220 void __iomem *rsnd_gen_reg_get(struct rsnd_priv *priv,
221221 struct rsnd_mod *mod,
222222 enum rsnd_reg reg);
223−#define rsnd_is_gen1(s) ((s)->info->flags & RSND_GEN1)
224−#define rsnd_is_gen2(s) ((s)->info->flags & RSND_GEN2)
223+#define rsnd_is_gen1(s) (((s)->info->flags & RSND_GEN_MASK) == RSND_GEN1)
224+#define rsnd_is_gen2(s) (((s)->info->flags & RSND_GEN_MASK) == RSND_GEN2)
225225
226226 /*
227227 * R-Car ADG
sound/soc/soc-core.c+0−1
@@ -1380,7 +1380,6 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order) · 1379 unmodified lines
13801380 return -ENODEV;
13811381
13821382 list_add(&cpu_dai->dapm.list, &card->dapm_list);
1383− snd_soc_dapm_new_dai_widgets(&cpu_dai->dapm, cpu_dai);
13841383 }
13851384
13861385 if (cpu_dai->driver->probe) {
sound/usb/usx2y/us122l.c+3−1
@@ -262,7 +262,9 @@ static int usb_stream_hwdep_mmap(struct snd_hwdep *hw, · 261 unmodified lines
262262 }
263263
264264 area->vm_ops = &usb_stream_hwdep_vm_ops;
265− area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
265+ area->vm_flags |= VM_DONTDUMP;
266+ if (!read)
267+ area->vm_flags |= VM_DONTEXPAND;
266268 area->vm_private_data = us122l;
267269 atomic_inc(&us122l->mmap_count);
268270 out:
sound/usb/usx2y/usbusx2yaudio.c+3−19
@@ -299,19 +299,6 @@ static void usX2Y_error_urb_status(struct usX2Ydev *usX2Y, · 298 unmodified lines
299299 usX2Y_clients_stop(usX2Y);
300300 }
301301
302−static void usX2Y_error_sequence(struct usX2Ydev *usX2Y,
303− struct snd_usX2Y_substream *subs, struct urb *urb)
304−{
305− snd_printk(KERN_ERR
306−"Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n"
307−"Most probably some urb of usb-frame %i is still missing.\n"
308−"Cause could be too long delays in usb-hcd interrupt handling.\n",
309− usb_get_current_frame_number(usX2Y->dev),
310− subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out",
311− usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame);
312− usX2Y_clients_stop(usX2Y);
313−}
314−
315302 static void i_usX2Y_urb_complete(struct urb *urb)
316303 {
317304 struct snd_usX2Y_substream *subs = urb->context;
@@ -328,12 +315,9 @@ static void i_usX2Y_urb_complete(struct urb *urb) · 10 unmodified lines
328315 usX2Y_error_urb_status(usX2Y, subs, urb);
329316 return;
330317 }
331− if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame & 0xFFFF)))
332− subs->completed_urb = urb;
333− else {
334− usX2Y_error_sequence(usX2Y, subs, urb);
335− return;
336− }
318+
319+ subs->completed_urb = urb;
320+
337321 {
338322 struct snd_usX2Y_substream *capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE],
339323 *playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
sound/usb/usx2y/usx2yhwdeppcm.c+1−6
@@ -244,13 +244,8 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb *urb) · 243 unmodified lines
244244 usX2Y_error_urb_status(usX2Y, subs, urb);
245245 return;
246246 }
247− if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame & 0xFFFF)))
248− subs->completed_urb = urb;
249− else {
250− usX2Y_error_sequence(usX2Y, subs, urb);
251− return;
252− }
253247
248+ subs->completed_urb = urb;
254249 capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE];
255250 capsubs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2];
256251 playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
tools/perf/Makefile+1−0
@@ -770,6 +770,7 @@ check: $(OUTPUT)common-cmds.h · 769 unmodified lines
770770 install-bin: all
771771 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
772772 $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'
773+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
773774 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
774775 ifndef NO_LIBPERL
775776 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
tools/perf/builtin-stat.c+1−0
@@ -457,6 +457,7 @@ static int __run_perf_stat(int argc, const char **argv) · 456 unmodified lines
457457 perror("failed to prepare workload");
458458 return -1;
459459 }
460+ child_pid = evsel_list->workload.pid;
460461 }
461462
462463 if (group)
tools/perf/config/feature-tests.mak+1−1
@@ -219,7 +219,7 @@ define SOURCE_LIBAUDIT · 218 unmodified lines
219219
220220 int main(void)
221221 {
222− printf(\"error message: %s\n\", audit_errno_to_name(0));
222+ printf(\"error message: %s\", audit_errno_to_name(0));
223223 return audit_open();
224224 }
225225 endef
tools/perf/util/dwarf-aux.c+21−4
@@ -426,7 +426,7 @@ static int __die_search_func_cb(Dwarf_Die *fn_die, void *data) · 425 unmodified lines
426426 * @die_mem: a buffer for result DIE
427427 *
428428 * Search a non-inlined function DIE which includes @addr. Stores the
429− * DIE to @die_mem and returns it if found. Returns NULl if failed.
429+ * DIE to @die_mem and returns it if found. Returns NULL if failed.
430430 */
431431 Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr,
432432 Dwarf_Die *die_mem)
@@ -453,16 +453,33 @@ static int __die_find_inline_cb(Dwarf_Die *die_mem, void *data) · 20 unmodified lines
453453 return DIE_FIND_CB_CONTINUE;
454454 }
455455
456+/**
457+ * die_find_top_inlinefunc - Search the top inlined function at given address
458+ * @sp_die: a subprogram DIE which including @addr
459+ * @addr: target address
460+ * @die_mem: a buffer for result DIE
461+ *
462+ * Search an inlined function DIE which includes @addr. Stores the
463+ * DIE to @die_mem and returns it if found. Returns NULL if failed.
464+ * Even if several inlined functions are expanded recursively, this
465+ * doesn't trace it down, and returns the topmost one.
466+ */
467+Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
468+ Dwarf_Die *die_mem)
469+{
470+ return die_find_child(sp_die, __die_find_inline_cb, &addr, die_mem);
471+}
472+
456473 /**
457474 * die_find_inlinefunc - Search an inlined function at given address
458− * @cu_die: a CU DIE which including @addr
475+ * @sp_die: a subprogram DIE which including @addr
459476 * @addr: target address
460477 * @die_mem: a buffer for result DIE
461478 *
462479 * Search an inlined function DIE which includes @addr. Stores the
463− * DIE to @die_mem and returns it if found. Returns NULl if failed.
480+ * DIE to @die_mem and returns it if found. Returns NULL if failed.
464481 * If several inlined functions are expanded recursively, this trace
465− * it and returns deepest one.
482+ * it down and returns deepest one.
466483 */
467484 Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
468485 Dwarf_Die *die_mem)
tools/perf/util/dwarf-aux.h+5−1
@@ -79,7 +79,11 @@ extern Dwarf_Die *die_find_child(Dwarf_Die *rt_die, · 78 unmodified lines
7979 extern Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr,
8080 Dwarf_Die *die_mem);
8181
82−/* Search an inlined function including given address */
82+/* Search the top inlined function including given address */
83+extern Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
84+ Dwarf_Die *die_mem);
85+
86+/* Search the deepest inlined function including given address */
8387 extern Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
8488 Dwarf_Die *die_mem);
8589
tools/perf/util/header.c+12−0
@@ -2768,6 +2768,18 @@ int perf_session__read_header(struct perf_session *session) · 2767 unmodified lines
27682768 if (perf_file_header__read(&f_header, header, fd) < 0)
27692769 return -EINVAL;
27702770
2771+ /*
2772+ * Sanity check that perf.data was written cleanly; data size is
2773+ * initialized to 0 and updated only if the on_exit function is run.
2774+ * If data size is still 0 then the file contains only partial
2775+ * information. Just warn user and process it as much as it can.
2776+ */
2777+ if (f_header.data.size == 0) {
2778+ pr_warning("WARNING: The %s file's data size field is 0 which is unexpected.\n"
2779+ "Was the 'perf record' command properly terminated?\n",
2780+ session->filename);
2781+ }
2782+
27712783 nr_attrs = f_header.attrs.size / f_header.attr_size;
27722784 lseek(fd, f_header.attrs.offset, SEEK_SET);
27732785
tools/perf/util/probe-finder.c+33−16
@@ -1327,8 +1327,8 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr, · 1326 unmodified lines
13271327 struct perf_probe_point *ppt)
13281328 {
13291329 Dwarf_Die cudie, spdie, indie;
1330− Dwarf_Addr _addr, baseaddr;
1331− const char *fname = NULL, *func = NULL, *tmp;
1330+ Dwarf_Addr _addr = 0, baseaddr = 0;
1331+ const char *fname = NULL, *func = NULL, *basefunc = NULL, *tmp;
13321332 int baseline = 0, lineno = 0, ret = 0;
13331333
13341334 /* Adjust address with bias */
@@ -1349,27 +1349,36 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr, · 14 unmodified lines
13491349 /* Find a corresponding function (name, baseline and baseaddr) */
13501350 if (die_find_realfunc(&cudie, (Dwarf_Addr)addr, &spdie)) {
13511351 /* Get function entry information */
1352− tmp = dwarf_diename(&spdie);
1353− if (!tmp ||
1352+ func = basefunc = dwarf_diename(&spdie);
1353+ if (!func ||
13541354 dwarf_entrypc(&spdie, &baseaddr) != 0 ||
1355− dwarf_decl_line(&spdie, &baseline) != 0)
1355+ dwarf_decl_line(&spdie, &baseline) != 0) {
1356+ lineno = 0;
13561357 goto post;
1357− func = tmp;
1358+ }
13581359
1359− if (addr == (unsigned long)baseaddr)
1360+ if (addr == (unsigned long)baseaddr) {
13601361 /* Function entry - Relative line number is 0 */
13611362 lineno = baseline;
1362− else if (die_find_inlinefunc(&spdie, (Dwarf_Addr)addr,
1363− &indie)) {
1363+ fname = dwarf_decl_file(&spdie);
1364+ goto post;
1365+ }
1366+
1367+ /* Track down the inline functions step by step */
1368+ while (die_find_top_inlinefunc(&spdie, (Dwarf_Addr)addr,
1369+ &indie)) {
1370+ /* There is an inline function */
13641371 if (dwarf_entrypc(&indie, &_addr) == 0 &&
1365− _addr == addr)
1372+ _addr == addr) {
13661373 /*
13671374 * addr is at an inline function entry.
13681375 * In this case, lineno should be the call-site
1369− * line number.
1376+ * line number. (overwrite lineinfo)
13701377 */
13711378 lineno = die_get_call_lineno(&indie);
1372− else {
1379+ fname = die_get_call_file(&indie);
1380+ break;
1381+ } else {
13731382 /*
13741383 * addr is in an inline function body.
13751384 * Since lineno points one of the lines
@@ -1377,19 +1386,27 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr, · 1 unmodified line
13771386 * be the entry line of the inline function.
13781387 */
13791388 tmp = dwarf_diename(&indie);
1380− if (tmp &&
1381− dwarf_decl_line(&spdie, &baseline) == 0)
1382− func = tmp;
1389+ if (!tmp ||
1390+ dwarf_decl_line(&indie, &baseline) != 0)
1391+ break;
1392+ func = tmp;
1393+ spdie = indie;
13831394 }
13841395 }
1396+ /* Verify the lineno and baseline are in a same file */
1397+ tmp = dwarf_decl_file(&spdie);
1398+ if (!tmp || strcmp(tmp, fname) != 0)
1399+ lineno = 0;
13851400 }
13861401
13871402 post:
13881403 /* Make a relative line number or an offset */
13891404 if (lineno)
13901405 ppt->line = lineno - baseline;
1391− else if (func)
1406+ else if (basefunc) {
13921407 ppt->offset = addr - (unsigned long)baseaddr;
1408+ func = basefunc;
1409+ }
13931410
13941411 /* Duplicate strings */
13951412 if (func) {
tools/perf/util/session.c+3−1
@@ -256,6 +256,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool) · 255 unmodified lines
256256 tool->sample = process_event_sample_stub;
257257 if (tool->mmap == NULL)
258258 tool->mmap = process_event_stub;
259+ if (tool->mmap2 == NULL)
260+ tool->mmap2 = process_event_stub;
259261 if (tool->comm == NULL)
260262 tool->comm = process_event_stub;
261263 if (tool->fork == NULL)
@@ -1310,7 +1312,7 @@ int __perf_session__process_events(struct perf_session *session, · 1048 unmodified lines
13101312 file_offset = page_offset;
13111313 head = data_offset - page_offset;
13121314
1313− if (data_offset + data_size < file_size)
1315+ if (data_size && (data_offset + data_size < file_size))
13141316 file_size = data_offset + data_size;
13151317
13161318 progress_next = file_size / 16;
tools/testing/selftests/timers/posix_timers.c+1−1
@@ -151,7 +151,7 @@ static int check_timer_create(int which) · 150 unmodified lines
151151 fflush(stdout);
152152
153153 done = 0;
154− timer_create(which, NULL, &id);
154+ err = timer_create(which, NULL, &id);
155155 if (err < 0) {
156156 perror("Can't create timer\n");
157157 return -1;
virt/kvm/kvm_main.c+4−2
@@ -1064,10 +1064,12 @@ EXPORT_SYMBOL_GPL(gfn_to_hva); · 1063 unmodified lines
10641064 unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable)
10651065 {
10661066 struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn);
1067− if (writable)
1067+ unsigned long hva = __gfn_to_hva_many(slot, gfn, NULL, false);
1068+
1069+ if (!kvm_is_error_hva(hva) && writable)
10681070 *writable = !memslot_is_readonly(slot);
10691071
1070− return __gfn_to_hva_many(gfn_to_memslot(kvm, gfn), gfn, NULL, false);
1072+ return hva;
10711073 }
10721074
10731075 static int kvm_read_hva(void *data, void __user *hva, int len)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

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

Repository code

Go to file
t