History

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

Conflicts: drivers/net/ethernet/emulex/benet/be_main.c drivers/net/ethernet/intel/igb/igb_main.c drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c include/net/scm.h net/batman-adv/routing.c net/ipv4/tcp_input.c The e{uid,gid} --> {uid,gid} credentials fix conflicted with the cleanup in net-next to now pass cred structs around. The be2net driver had a bug fix in 'net' that overlapped with the VLAN interface changes by Patrick McHardy in net-next. An IGB conflict existed because in 'net' the build_skb() support was reverted, and in 'net-next' there was a comment style fix within that code. Several batman-adv conflicts were resolved by making sure that all calls to batadv_is_my_mac() are changed to have a new bat_priv first argument. Eric Dumazet's TS ECR fix in TCP in 'net' conflicted with the F-RTO rewrite in 'net-next', mostly overlapping changes. Thanks to Stephen Rothwell and Antonio Quartulli for help with several of these merge resolutions.

David S. Miller committed 13 years ago

Commit 6e0895c2 parents 55fbbe4 60d509f345 files · +3679 −2383Browse files

Unified · Split

345 files
  1. Documentation/DocBook/device-drivers.tmpl +1 −1
  2. Documentation/kernel-parameters.txt +26 −3
  3. Documentation/scsi/LICENSE.qla2xxx +1 −1
  4. MAINTAINERS +10 −4
  5. Makefile +3 −2
  6. arch/alpha/Makefile +1 −1
  7. arch/alpha/include/asm/floppy.h +1 −1
  8. arch/alpha/kernel/irq.c +0 −7
  9. arch/alpha/kernel/irq_alpha.c +8 −2
  10. arch/alpha/kernel/sys_nautilus.c +5 −0
  11. arch/alpha/kernel/sys_titan.c +7 −7
  12. arch/arc/include/asm/irqflags.h +8 −4
  13. arch/arm/boot/dts/imx28-m28evk.dts +0 −1
  14. arch/arm/boot/dts/imx28-sps1.dts +0 −1
  15. arch/arm/boot/dts/imx6qdl.dtsi +1 −0
  16. arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +7 −7
  17. arch/arm/include/asm/glue-cache.h +0 −8
  18. arch/arm/include/asm/hardware/iop3xx.h +1 −1
  19. arch/arm/include/asm/pgtable-3level.h +1 −1
  20. arch/arm/include/asm/tlbflush.h +2 −9
  21. arch/arm/kernel/hw_breakpoint.c +1 −1
  22. arch/arm/kernel/perf_event.c +4 −1
  23. arch/arm/kernel/sched_clock.c +2 −2
  24. arch/arm/kernel/setup.c +0 −3
  25. arch/arm/kernel/tcm.c +0 −1
  26. arch/arm/kvm/arm.c +1 −0
  27. arch/arm/kvm/coproc.c +2 −2
  28. arch/arm/mach-highbank/hotplug.c +4 −6
  29. arch/arm/mach-imx/clk-imx35.c +2 −0
  30. arch/arm/mach-imx/clk-imx6q.c +1 −2
  31. arch/arm/mach-kirkwood/board-iomega_ix2_200.c +6 −1
  32. arch/arm/mach-mvebu/irq-armada-370-xp.c +5 −11
  33. arch/arm/mach-s3c24xx/include/mach/irqs.h +1 −3
  34. arch/arm/mach-s3c24xx/irq.c +1 −1
  35. arch/arm/mm/Kconfig +1 −4
  36. arch/arm/mm/Makefile +0 −1
  37. arch/arm/mm/cache-feroceon-l2.c +1 −0
  38. arch/arm/mm/cache-v3.S +0 −137
  39. arch/arm/mm/cache-v4.S +1 −1
  40. arch/arm/mm/mmu.c +2 −0
  41. arch/arm/mm/proc-arm740.S +17 −13
  42. arch/arm/mm/proc-arm920.S +1 −1
  43. arch/arm/mm/proc-arm926.S +1 −1
  44. arch/arm/mm/proc-mohawk.S +1 −1
  45. arch/arm/mm/proc-sa1100.S +1 −1
  46. arch/arm/mm/proc-syms.c +2 −0
  47. arch/arm/mm/proc-v6.S +1 −1
  48. arch/arm/mm/proc-xsc3.S +1 −1
  49. arch/arm/mm/proc-xscale.S +1 −1
  50. arch/arm/mm/tcm.h +0 −0
  51. arch/avr32/include/asm/io.h +4 −0
  52. arch/c6x/include/asm/irqflags.h +1 −1
  53. arch/ia64/kernel/palinfo.c +13 −64
  54. arch/m68k/include/asm/gpio.h +20 −0
  55. arch/powerpc/kernel/entry_64.S +2 −2
  56. arch/powerpc/kernel/process.c +2 −0
  57. arch/powerpc/kernel/signal_32.c +2 −0
  58. arch/powerpc/kernel/signal_64.c +2 −0
  59. arch/powerpc/kernel/tm.S +2 −0
  60. arch/powerpc/kvm/e500.h +8 −16
  61. arch/powerpc/kvm/e500_mmu_host.c +27 −57
  62. arch/powerpc/kvm/e500mc.c +6 −1
  63. arch/powerpc/platforms/pseries/lpar.c +7 −1
  64. arch/s390/include/asm/io.h +0 −4
  65. arch/s390/include/asm/pgtable.h +4 −0
  66. arch/sparc/include/asm/Kbuild +5 −0
  67. arch/sparc/include/asm/cputime.h +0 −6
  68. arch/sparc/include/asm/emergency-restart.h +0 −6
  69. arch/sparc/include/asm/mutex.h +0 −9
  70. arch/sparc/include/asm/pgtable_64.h +1 −0
  71. arch/sparc/include/asm/serial.h +0 −6
  72. arch/sparc/include/asm/smp_32.h +0 −5
  73. arch/sparc/include/asm/switch_to_64.h +1 −2
  74. arch/sparc/include/asm/tlbflush_64.h +31 −6
  75. arch/sparc/include/uapi/asm/Kbuild +0 −1
  76. arch/sparc/include/uapi/asm/types.h +0 −17
  77. arch/sparc/kernel/smp_64.c +37 −4
  78. arch/sparc/lib/bitext.c +1 −5
  79. arch/sparc/mm/iommu.c +1 −1
  80. arch/sparc/mm/srmmu.c +3 −1
  81. arch/sparc/mm/tlb.c +34 −4
  82. arch/sparc/mm/tsb.c +42 −15
  83. arch/sparc/mm/ultra.S +95 −24
  84. arch/tile/include/asm/irqflags.h +9 −1
  85. arch/x86/Kconfig +1 −0
  86. arch/x86/boot/compressed/Makefile +2 −3
  87. arch/x86/boot/compressed/eboot.c +47 −0
  88. arch/x86/include/asm/efi.h +7 −0
  89. arch/x86/include/asm/paravirt.h +4 −1
  90. arch/x86/include/asm/paravirt_types.h +2 −0
  91. arch/x86/include/asm/syscall.h +2 −2
  92. arch/x86/include/asm/tlb.h +1 −1
  93. arch/x86/include/uapi/asm/bootparam.h +1 −0
  94. arch/x86/kernel/cpu/mshyperv.c +5 −13
  95. arch/x86/kernel/cpu/perf_event_intel.c +16 −4
  96. arch/x86/kernel/cpu/perf_event_intel_ds.c +2 −1
  97. arch/x86/kernel/microcode_core_early.c +31 −7
  98. arch/x86/kernel/paravirt.c +13 −12
  99. arch/x86/kernel/setup.c +37 −8
  100. arch/x86/kvm/lapic.c +1 −1
  101. arch/x86/kvm/x86.c +6 −7
  102. arch/x86/lguest/boot.c +1 −0
  103. arch/x86/mm/fault.c +4 −2
  104. arch/x86/mm/pageattr-test.c +1 −1
  105. arch/x86/mm/pageattr.c +7 −5
  106. arch/x86/mm/pgtable.c +7 −0
  107. arch/x86/platform/efi/efi.c +163 −5
  108. arch/x86/xen/mmu.c +9 −4
  109. block/blk-core.c +1 −0
  110. block/blk-sysfs.c +2 −0
  111. block/partition-generic.c +0 −1
  112. crypto/gcm.c +14 −3
  113. drivers/acpi/pci_root.c +37 −39
  114. drivers/ata/ata_piix.c +13 −1
  115. drivers/ata/libata-core.c +5 −1
  116. drivers/ata/libata-scsi.c +4 −4
  117. drivers/base/regmap/regmap.c +2 −1
  118. drivers/block/loop.c +2 −19
  119. drivers/block/mtip32xx/mtip32xx.c +232 −95
  120. drivers/block/mtip32xx/mtip32xx.h +11 −7
  121. drivers/block/rbd.c +2 −1
  122. drivers/char/hpet.c +1 −13
  123. drivers/cpufreq/intel_pstate.c +0 −1
  124. drivers/crypto/ux500/cryp/cryp_core.c +1 −1
  125. drivers/dma/at_hdmac.c +4 −5
  126. drivers/dma/omap-dma.c +14 −6
  127. drivers/dma/pl330.c +27 −11
  128. drivers/eisa/pci_eisa.c +46 −21
  129. drivers/firmware/Kconfig +1 −0
  130. drivers/firmware/efivars.c +21 −77
  131. drivers/gpio/gpio-pca953x.c +1 −1
  132. drivers/gpu/drm/drm_fb_helper.c +5 −3
  133. drivers/gpu/drm/mgag200/mgag200_mode.c +3 −10
  134. drivers/gpu/drm/nouveau/core/subdev/bios/base.c +17 −0
  135. drivers/gpu/drm/nouveau/nv50_display.c +1 −1
  136. drivers/gpu/drm/radeon/radeon_bios.c +26 −0
  137. drivers/gpu/drm/udl/udl_connector.c +4 −0
  138. drivers/hwspinlock/hwspinlock_core.c +2 −0
  139. drivers/idle/intel_idle.c +1 −0
  140. drivers/input/tablet/wacom_wac.c +4 −4
  141. drivers/irqchip/irq-gic.c +2 −1
  142. drivers/md/dm-cache-target.c +38 −13
  143. drivers/md/dm.c +1 −0
  144. drivers/md/raid5.c +10 −1
  145. drivers/misc/vmw_vmci/Kconfig +1 −1
  146. drivers/mtd/mtdchar.c +2 −57
  147. drivers/net/bonding/bond_main.c +73 −28
  148. drivers/net/can/mcp251x.c +8 −2
  149. drivers/net/can/sja1000/sja1000_of_platform.c +15 −16
  150. drivers/net/ethernet/8390/ax88796.c +1 −1
  151. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +5 −2
  152. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +6 −1
  153. drivers/net/ethernet/emulex/benet/be_main.c +3 −2
  154. drivers/net/ethernet/freescale/fec_main.c +1 −0
  155. drivers/net/ethernet/intel/e100.c +25 −11
  156. drivers/net/ethernet/intel/igb/igb.h +0 −8
  157. drivers/net/ethernet/intel/igb/igb_main.c +4 −106
  158. drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +6 −0
  159. drivers/net/ethernet/marvell/Kconfig +1 −1
  160. drivers/net/ethernet/marvell/mvneta.c +9 −9
  161. drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +10 −5
  162. drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +1 −2
  163. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +2 −2
  164. drivers/net/ethernet/qlogic/qlge/qlge.h +1 −1
  165. drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c +1 −1
  166. drivers/net/ethernet/qlogic/qlge/qlge_main.c +29 −7
  167. drivers/net/ethernet/stmicro/stmmac/mmc_core.c +1 −0
  168. drivers/net/ethernet/ti/cpsw.c +1 −1
  169. drivers/net/hyperv/netvsc.c +12 −5
  170. drivers/net/hyperv/netvsc_drv.c +0 −2
  171. drivers/net/hyperv/rndis_filter.c +1 −13
  172. drivers/net/tun.c +1 −1
  173. drivers/net/usb/cdc_mbim.c +1 −1
  174. drivers/net/usb/qmi_wwan.c +104 −0
  175. drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h +1 −1
  176. drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c +2 −2
  177. drivers/net/wireless/ath/ath9k/dfs_pri_detector.c +2 −2
  178. drivers/net/wireless/ath/ath9k/htc_drv_init.c +1 −1
  179. drivers/net/wireless/b43/phy_n.c +2 −1
  180. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +1 −6
  181. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +132 −133
  182. drivers/pci/pci-acpi.c +8 −7
  183. drivers/pci/pci-driver.c +3 −2
  184. drivers/pci/pcie/portdrv_pci.c +0 −13
  185. drivers/pci/rom.c +31 −36
  186. drivers/platform/x86/hp-wmi.c +0 −4
  187. drivers/platform/x86/thinkpad_acpi.c +0 −10
  188. drivers/remoteproc/Kconfig +1 −1
  189. drivers/remoteproc/remoteproc_core.c +4 −2
  190. drivers/remoteproc/ste_modem_rproc.c +6 −1
  191. drivers/s390/net/qeth_core.h +3 −0
  192. drivers/s390/net/qeth_core_main.c +19 −0
  193. drivers/s390/net/qeth_l2_main.c +2 −0
  194. drivers/s390/net/qeth_l3_main.c +2 −0
  195. drivers/sbus/char/bbc_i2c.c +2 −2
  196. drivers/scsi/ibmvscsi/ibmvscsi.c +1 −1
  197. drivers/scsi/ipr.c +10 −3
  198. drivers/scsi/libsas/sas_expander.c +13 −1
  199. drivers/scsi/lpfc/lpfc_sli.c +2 −1
  200. drivers/scsi/qla2xxx/qla_attr.c +0 −5
  201. drivers/scsi/qla2xxx/qla_dbg.c +2 −1
  202. drivers/scsi/qla2xxx/qla_def.h +0 −1
  203. drivers/scsi/qla2xxx/qla_gbl.h +0 −3
  204. drivers/scsi/qla2xxx/qla_init.c +1 −3
  205. drivers/scsi/qla2xxx/qla_mbx.c +0 −58
  206. drivers/scsi/qla2xxx/qla_version.h +1 −1
  207. drivers/scsi/st.c +7 −1
  208. drivers/ssb/driver_chipcommon_pmu.c +29 −0
  209. drivers/target/target_core_alua.c +3 −0
  210. drivers/tty/mxser.c +4 −4
  211. drivers/tty/serial/8250/8250_pnp.c +5 −7
  212. drivers/tty/serial/omap-serial.c +11 −0
  213. drivers/vfio/pci/vfio_pci.c +2 −1
  214. drivers/vhost/tcm_vhost.c +130 −68
  215. drivers/video/fbmem.c +14 −25
  216. drivers/video/mmp/core.c +0 −2
  217. drivers/watchdog/Kconfig +1 −1
  218. drivers/xen/events.c +15 −4
  219. fs/binfmt_elf.c +1 −0
  220. fs/bio.c +0 −2
  221. fs/btrfs/tree-log.c +42 −6
  222. fs/cifs/connect.c +13 −3
  223. fs/ecryptfs/miscdev.c +2 −12
  224. fs/hfsplus/extents.c +1 −1
  225. fs/hugetlbfs/inode.c +1 −1
  226. fs/inode.c +1 −1
  227. fs/namespace.c +1 −1
  228. fs/nfs/nfs4client.c +29 −16
  229. fs/nfs/nfs4proc.c +1 −0
  230. fs/nfs/nfs4state.c +7 −1
  231. fs/proc/array.c +1 −0
  232. fs/proc/generic.c +89 −30
  233. include/asm-generic/tlb.h +6 −1
  234. include/linux/ata.h +1 −1
  235. include/linux/blktrace_api.h +0 −1
  236. include/linux/capability.h +2 −0
  237. include/linux/efi.h +8 −1
  238. include/linux/ftrace.h +4 −1
  239. include/linux/kexec.h +2 −0
  240. include/linux/kvm_host.h +1 −1
  241. include/linux/kvm_types.h +1 −0
  242. include/linux/libata.h +1 −0
  243. include/linux/mm.h +2 −0
  244. include/linux/netfilter/ipset/ip_set_ahash.h +23 −7
  245. include/linux/pci.h +1 −0
  246. include/linux/preempt.h +14 −8
  247. include/linux/proc_fs.h +2 −0
  248. include/linux/sched.h +3 −2
  249. include/linux/security.h +12 −0
  250. include/linux/spinlock_up.h +18 −11
  251. include/linux/ssb/ssb_driver_chipcommon.h +2 −0
  252. include/linux/swiotlb.h +1 −0
  253. include/linux/ucs2_string.h +14 −0
  254. include/net/addrconf.h +1 −0
  255. include/net/irda/irlmp.h +2 −1
  256. include/net/iucv/af_iucv.h +8 −0
  257. include/net/scm.h +1 −1
  258. include/trace/events/block.h +4 −4
  259. include/trace/events/sched.h +1 −1
  260. include/uapi/linux/fuse.h +216 −220
  261. kernel/capability.c +24 −0
  262. kernel/events/core.c +4 −2
  263. kernel/events/internal.h +1 −1
  264. kernel/events/ring_buffer.c +18 −4
  265. kernel/hrtimer.c +1 −2
  266. kernel/kexec.c +105 −13
  267. kernel/kprobes.c +13 −6
  268. kernel/kthread.c +28 −24
  269. kernel/sched/clock.c +26 −0
  270. kernel/sched/core.c +5 −3
  271. kernel/sched/cputime.c +1 −1
  272. kernel/signal.c +1 −1
  273. kernel/smpboot.c +12 −2
  274. kernel/sys.c +2 −1
  275. kernel/trace/blktrace.c +3 −23
  276. kernel/trace/ftrace.c +25 −29
  277. kernel/trace/trace.c +6 −3
  278. kernel/trace/trace_stack.c +1 −1
  279. kernel/user_namespace.c +13 −9
  280. lib/Kconfig +3 −0
  281. lib/Makefile +2 −0
  282. lib/kobject.c +8 −1
  283. lib/swiotlb.c +15 −4
  284. lib/ucs2_string.c +51 −0
  285. mm/hugetlb.c +11 −1
  286. mm/memory.c +48 −0
  287. mm/vmscan.c +1 −1
  288. net/802/mrp.c +4 −0
  289. net/batman-adv/main.c +10 −1
  290. net/batman-adv/main.h +1 −1
  291. net/batman-adv/network-coding.c +9 −8
  292. net/batman-adv/routing.c +21 −18
  293. net/batman-adv/translation-table.c +1 −1
  294. net/batman-adv/vis.c +2 −2
  295. net/bridge/br_if.c +2 −1
  296. net/bridge/br_private.h +1 −0
  297. net/bridge/br_stp_if.c +1 −0
  298. net/can/gw.c +3 −3
  299. net/core/dev.c +3 −0
  300. net/core/rtnetlink.c +2 −2
  301. net/ipv4/devinet.c +44 −16
  302. net/ipv4/esp4.c +3 −3
  303. net/ipv4/ip_fragment.c +10 −4
  304. net/ipv4/netfilter/ipt_rpfilter.c +7 −1
  305. net/ipv4/syncookies.c +2 −2
  306. net/ipv4/tcp_input.c +31 −33
  307. net/ipv4/tcp_output.c +7 −2
  308. net/ipv6/addrconf.c +3 −21
  309. net/ipv6/addrconf_core.c +19 −0
  310. net/ipv6/netfilter/ip6t_rpfilter.c +7 −1
  311. net/ipv6/reassembly.c +10 −2
  312. net/irda/iriap.c +2 −1
  313. net/irda/irlmp.c +9 −1
  314. net/iucv/af_iucv.c +16 −18
  315. net/mac80211/iface.c +19 −8
  316. net/mac80211/mlme.c +20 −4
  317. net/netfilter/ipset/ip_set_bitmap_ipmac.c +5 −1
  318. net/netfilter/ipset/ip_set_hash_ipportnet.c +18 −0
  319. net/netfilter/ipset/ip_set_hash_net.c +20 −2
  320. net/netfilter/ipset/ip_set_hash_netiface.c +20 −2
  321. net/netfilter/ipset/ip_set_hash_netport.c +18 −0
  322. net/netfilter/ipset/ip_set_list_set.c +7 −3
  323. net/netfilter/nf_conntrack_sip.c +2 −4
  324. net/netfilter/nf_nat_core.c +7 −33
  325. net/netrom/af_netrom.c +1 −1
  326. net/openvswitch/datapath.c +18 −12
  327. net/openvswitch/flow.c +1 −1
  328. net/sched/cls_fw.c +1 −1
  329. net/sunrpc/clnt.c +3 −8
  330. net/unix/af_unix.c +1 −1
  331. scripts/checkpatch.pl +1 −0
  332. security/capability.c +6 −0
  333. security/security.c +5 −0
  334. security/selinux/hooks.c +7 −0
  335. sound/core/pcm_native.c +2 −10
  336. sound/soc/codecs/wm5102.c +1 −1
  337. sound/soc/codecs/wm8903.c +2 −0
  338. sound/soc/samsung/i2s.c +12 −5
  339. sound/soc/soc-compress.c +11 −3
  340. sound/soc/soc-core.c +1 −1
  341. sound/soc/tegra/tegra_pcm.c +1 −23
  342. sound/usb/mixer_quirks.c +2 −2
  343. sound/usb/quirks.c +1 −1
  344. tools/power/x86/turbostat/turbostat.c +4 −1
  345. virt/kvm/kvm_main.c +37 −10
Documentation/DocBook/device-drivers.tmpl+1−1
@@ -227,7 +227,7 @@ X!Isound/sound_firmware.c · 226 unmodified lines
227227 <chapter id="uart16x50">
228228 <title>16x50 UART Driver</title>
229229 !Edrivers/tty/serial/serial_core.c
230−!Edrivers/tty/serial/8250/8250.c
230+!Edrivers/tty/serial/8250/8250_core.c
231231 </chapter>
232232
233233 <chapter id="fbdev">
Documentation/kernel-parameters.txt+26−3
@@ -596,9 +596,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 595 unmodified lines
596596 is selected automatically. Check
597597 Documentation/kdump/kdump.txt for further details.
598598
599− crashkernel_low=size[KMG]
600− [KNL, x86] parts under 4G.
601−
602599 crashkernel=range1:size1[,range2:size2,...][@offset]
603600 [KNL] Same as above, but depends on the memory
604601 in the running system. The syntax of range is
@@ -606,6 +603,26 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 1 unmodified line
606603 a memory unit (amount[KMG]). See also
607604 Documentation/kdump/kdump.txt for an example.
608605
606+ crashkernel=size[KMG],high
607+ [KNL, x86_64] range could be above 4G. Allow kernel
608+ to allocate physical memory region from top, so could
609+ be above 4G if system have more than 4G ram installed.
610+ Otherwise memory region will be allocated below 4G, if
611+ available.
612+ It will be ignored if crashkernel=X is specified.
613+ crashkernel=size[KMG],low
614+ [KNL, x86_64] range under 4G. When crashkernel=X,high
615+ is passed, kernel could allocate physical memory region
616+ above 4G, that cause second kernel crash on system
617+ that require some amount of low memory, e.g. swiotlb
618+ requires at least 64M+32K low memory. Kernel would
619+ try to allocate 72M below 4G automatically.
620+ This one let user to specify own low range under 4G
621+ for second kernel instead.
622+ 0: to disable low allocation.
623+ It will be ignored when crashkernel=X,high is not used
624+ or memory reserved is below 4G.
625+
609626 cs89x0_dma= [HW,NET]
610627 Format: <dma>
611628
@@ -788,6 +805,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 176 unmodified lines
788805 edd= [EDD]
789806 Format: {"off" | "on" | "skip[mbr]"}
790807
808+ efi_no_storage_paranoia [EFI; X86]
809+ Using this parameter you can use more than 50% of
810+ your efi variable storage. Use this parameter only if
811+ you are really sure that your UEFI does sane gc and
812+ fulfills the spec otherwise your board may brick.
813+
791814 eisa_irq_edge= [PARISC,HW]
792815 See header of drivers/parisc/eisa.c.
793816
Documentation/scsi/LICENSE.qla2xxx+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2003-2012 QLogic Corporation
1+Copyright (c) 2003-2013 QLogic Corporation
22 QLogic Linux FC-FCoE Driver
33
44 This program includes a device driver for Linux 3.x.
MAINTAINERS+10−4
@@ -4941,6 +4941,12 @@ W: logfs.org · 4940 unmodified lines
49414941 S: Maintained
49424942 F: fs/logfs/
49434943
4944+LPC32XX MACHINE SUPPORT
4945+M: Roland Stigge <stigge@antcom.de>
4946+L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
4947+S: Maintained
4948+F: arch/arm/mach-lpc32xx/
4949+
49444950 LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
49454951 M: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
49464952 M: Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
@@ -6627,7 +6633,7 @@ S: Supported · 1680 unmodified lines
66276633 F: fs/reiserfs/
66286634
66296635 REGISTER MAP ABSTRACTION
6630−M: Mark Brown <broonie@opensource.wolfsonmicro.com>
6636+M: Mark Brown <broonie@kernel.org>
66316637 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git
66326638 S: Supported
66336639 F: drivers/base/regmap/
@@ -7375,7 +7381,7 @@ F: sound/ · 741 unmodified lines
73757381
73767382 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
73777383 M: Liam Girdwood <lgirdwood@gmail.com>
7378−M: Mark Brown <broonie@opensource.wolfsonmicro.com>
7384+M: Mark Brown <broonie@kernel.org>
73797385 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
73807386 L: alsa-devel@alsa-project.org (moderated for non-subscribers)
73817387 W: http://alsa-project.org/main/index.php/ASoC
@@ -7464,7 +7470,7 @@ F: drivers/clk/spear/ · 82 unmodified lines
74647470
74657471 SPI SUBSYSTEM
74667472 M: Grant Likely <grant.likely@secretlab.ca>
7467−M: Mark Brown <broonie@opensource.wolfsonmicro.com>
7473+M: Mark Brown <broonie@kernel.org>
74687474 L: spi-devel-general@lists.sourceforge.net
74697475 Q: http://patchwork.kernel.org/project/spi-devel-general/list/
74707476 T: git git://git.secretlab.ca/git/linux-2.6.git
@@ -8709,7 +8715,7 @@ F: drivers/scsi/vmw_pvscsi.h · 1238 unmodified lines
87098715
87108716 VOLTAGE AND CURRENT REGULATOR FRAMEWORK
87118717 M: Liam Girdwood <lrg@ti.com>
8712−M: Mark Brown <broonie@opensource.wolfsonmicro.com>
8718+M: Mark Brown <broonie@kernel.org>
87138719 W: http://opensource.wolfsonmicro.com/node/15
87148720 W: http://www.slimlogic.co.uk/?p=48
87158721 T: git git://git.kernel.org/pub/scm/linux/kernel/git/lrg/regulator.git
Makefile+3−2
@@ -1,7 +1,7 @@
11 VERSION = 3
22 PATCHLEVEL = 9
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc5
4+EXTRAVERSION = -rc8
55 NAME = Unicycling Gorilla
66
77 # *DOCUMENTATION*
@@ -513,7 +513,8 @@ ifeq ($(KBUILD_EXTMOD),) · 505 unmodified lines
513513 # Carefully list dependencies so we do not try to build scripts twice
514514 # in parallel
515515 PHONY += scripts
516−scripts: scripts_basic include/config/auto.conf include/config/tristate.conf
516+scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
517+ asm-generic
517518 $(Q)$(MAKE) $(build)=$(@)
518519
519520 # Objects we will link into vmlinux / subdirs we need to visit
arch/alpha/Makefile+1−1
@@ -12,7 +12,7 @@ NM := $(NM) -B · 11 unmodified lines
1212
1313 LDFLAGS_vmlinux := -static -N #-relax
1414 CHECKFLAGS += -D__alpha__ -m64
15−cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data
15+cflags-y := -pipe -mno-fp-regs -ffixed-8
1616 cflags-y += $(call cc-option, -fno-jump-tables)
1717
1818 cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4
arch/alpha/include/asm/floppy.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #define fd_disable_irq() disable_irq(FLOPPY_IRQ)
2727 #define fd_cacheflush(addr,size) /* nothing */
2828 #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt,\
29− IRQF_DISABLED, "floppy", NULL)
29+ 0, "floppy", NULL)
3030 #define fd_free_irq() free_irq(FLOPPY_IRQ, NULL)
3131
3232 #ifdef CONFIG_PCI
arch/alpha/kernel/irq.c+0−7
@@ -117,13 +117,6 @@ handle_irq(int irq) · 116 unmodified lines
117117 return;
118118 }
119119
120− /*
121− * From here we must proceed with IPL_MAX. Note that we do not
122− * explicitly enable interrupts afterwards - some MILO PALcode
123− * (namely LX164 one) seems to have severe problems with RTI
124− * at IPL 0.
125− */
126− local_irq_disable();
127120 irq_enter();
128121 generic_handle_irq_desc(irq, desc);
129122 irq_exit();
arch/alpha/kernel/irq_alpha.c+8−2
@@ -45,6 +45,14 @@ do_entInt(unsigned long type, unsigned long vector, · 44 unmodified lines
4545 unsigned long la_ptr, struct pt_regs *regs)
4646 {
4747 struct pt_regs *old_regs;
48+
49+ /*
50+ * Disable interrupts during IRQ handling.
51+ * Note that there is no matching local_irq_enable() due to
52+ * severe problems with RTI at IPL0 and some MILO PALcode
53+ * (namely LX164).
54+ */
55+ local_irq_disable();
4856 switch (type) {
4957 case 0:
5058 #ifdef CONFIG_SMP
@@ -62,7 +70,6 @@ do_entInt(unsigned long type, unsigned long vector, · 11 unmodified lines
6270 {
6371 long cpu;
6472
65− local_irq_disable();
6673 smp_percpu_timer_interrupt(regs);
6774 cpu = smp_processor_id();
6875 if (cpu != boot_cpuid) {
@@ -222,7 +229,6 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr, · 153 unmodified lines
222229
223230 struct irqaction timer_irqaction = {
224231 .handler = timer_interrupt,
225− .flags = IRQF_DISABLED,
226232 .name = "timer",
227233 };
228234
arch/alpha/kernel/sys_nautilus.c+5−0
@@ -188,6 +188,10 @@ nautilus_machine_check(unsigned long vector, unsigned long la_ptr) · 187 unmodified lines
188188 extern void free_reserved_mem(void *, void *);
189189 extern void pcibios_claim_one_bus(struct pci_bus *);
190190
191+static struct resource irongate_io = {
192+ .name = "Irongate PCI IO",
193+ .flags = IORESOURCE_IO,
194+};
191195 static struct resource irongate_mem = {
192196 .name = "Irongate PCI MEM",
193197 .flags = IORESOURCE_MEM,
@@ -209,6 +213,7 @@ nautilus_init_pci(void) · 15 unmodified lines
209213
210214 irongate = pci_get_bus_and_slot(0, 0);
211215 bus->self = irongate;
216+ bus->resource[0] = &irongate_io;
212217 bus->resource[1] = &irongate_mem;
213218
214219 pci_bus_size_bridges(bus);
arch/alpha/kernel/sys_titan.c+7−7
@@ -280,15 +280,15 @@ titan_late_init(void) · 279 unmodified lines
280280 * all reported to the kernel as machine checks, so the handler
281281 * is a nop so it can be called to count the individual events.
282282 */
283− titan_request_irq(63+16, titan_intr_nop, IRQF_DISABLED,
283+ titan_request_irq(63+16, titan_intr_nop, 0,
284284 "CChip Error", NULL);
285− titan_request_irq(62+16, titan_intr_nop, IRQF_DISABLED,
285+ titan_request_irq(62+16, titan_intr_nop, 0,
286286 "PChip 0 H_Error", NULL);
287− titan_request_irq(61+16, titan_intr_nop, IRQF_DISABLED,
287+ titan_request_irq(61+16, titan_intr_nop, 0,
288288 "PChip 1 H_Error", NULL);
289− titan_request_irq(60+16, titan_intr_nop, IRQF_DISABLED,
289+ titan_request_irq(60+16, titan_intr_nop, 0,
290290 "PChip 0 C_Error", NULL);
291− titan_request_irq(59+16, titan_intr_nop, IRQF_DISABLED,
291+ titan_request_irq(59+16, titan_intr_nop, 0,
292292 "PChip 1 C_Error", NULL);
293293
294294 /*
@@ -348,9 +348,9 @@ privateer_init_pci(void) · 53 unmodified lines
348348 * Hook a couple of extra err interrupts that the
349349 * common titan code won't.
350350 */
351− titan_request_irq(53+16, titan_intr_nop, IRQF_DISABLED,
351+ titan_request_irq(53+16, titan_intr_nop, 0,
352352 "NMI", NULL);
353− titan_request_irq(50+16, titan_intr_nop, IRQF_DISABLED,
353+ titan_request_irq(50+16, titan_intr_nop, 0,
354354 "Temperature Warning", NULL);
355355
356356 /*
arch/arc/include/asm/irqflags.h+8−4
@@ -39,7 +39,7 @@ static inline long arch_local_irq_save(void) · 38 unmodified lines
3939 " flag.nz %0 \n"
4040 : "=r"(temp), "=r"(flags)
4141 : "n"((STATUS_E1_MASK | STATUS_E2_MASK))
42− : "cc");
42+ : "memory", "cc");
4343
4444 return flags;
4545 }
@@ -53,7 +53,8 @@ static inline void arch_local_irq_restore(unsigned long flags) · 7 unmodified lines
5353 __asm__ __volatile__(
5454 " flag %0 \n"
5555 :
56− : "r"(flags));
56+ : "r"(flags)
57+ : "memory");
5758 }
5859
5960 /*
@@ -73,7 +74,8 @@ static inline void arch_local_irq_disable(void) · 13 unmodified lines
7374 " and %0, %0, %1 \n"
7475 " flag %0 \n"
7576 : "=&r"(temp)
76− : "n"(~(STATUS_E1_MASK | STATUS_E2_MASK)));
77+ : "n"(~(STATUS_E1_MASK | STATUS_E2_MASK))
78+ : "memory");
7779 }
7880
7981 /*
@@ -85,7 +87,9 @@ static inline long arch_local_save_flags(void) · 5 unmodified lines
8587
8688 __asm__ __volatile__(
8789 " lr %0, [status32] \n"
88− : "=&r"(temp));
90+ : "=&r"(temp)
91+ :
92+ : "memory");
8993
9094 return temp;
9195 }
arch/arm/boot/dts/imx28-m28evk.dts+0−1
@@ -152,7 +152,6 @@ · 151 unmodified lines
152152 i2c0: i2c@80058000 {
153153 pinctrl-names = "default";
154154 pinctrl-0 = <&i2c0_pins_a>;
155− clock-frequency = <400000>;
156155 status = "okay";
157156
158157 sgtl5000: codec@0a {
arch/arm/boot/dts/imx28-sps1.dts+0−1
@@ -70,7 +70,6 @@ · 69 unmodified lines
7070 i2c0: i2c@80058000 {
7171 pinctrl-names = "default";
7272 pinctrl-0 = <&i2c0_pins_a>;
73− clock-frequency = <400000>;
7473 status = "okay";
7574
7675 rtc: rtc@51 {
arch/arm/boot/dts/imx6qdl.dtsi+1−0
@@ -91,6 +91,7 @@ · 90 unmodified lines
9191 compatible = "arm,cortex-a9-twd-timer";
9292 reg = <0x00a00600 0x20>;
9393 interrupts = <1 13 0xf01>;
94+ clocks = <&clks 15>;
9495 };
9596
9697 L2: l2-cache@00a02000 {
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts+7−7
@@ -96,11 +96,11 @@ · 95 unmodified lines
9696 marvell,function = "gpio";
9797 };
9898 pmx_led_rebuild_brt_ctrl_1: pmx-led-rebuild-brt-ctrl-1 {
99− marvell,pins = "mpp44";
99+ marvell,pins = "mpp46";
100100 marvell,function = "gpio";
101101 };
102102 pmx_led_rebuild_brt_ctrl_2: pmx-led-rebuild-brt-ctrl-2 {
103− marvell,pins = "mpp45";
103+ marvell,pins = "mpp47";
104104 marvell,function = "gpio";
105105 };
106106
@@ -157,14 +157,14 @@ · 50 unmodified lines
157157 gpios = <&gpio0 16 0>;
158158 linux,default-trigger = "default-on";
159159 };
160− health_led1 {
160+ rebuild_led {
161+ label = "status:white:rebuild_led";
162+ gpios = <&gpio1 4 0>;
163+ };
164+ health_led {
161165 label = "status:red:health_led";
162166 gpios = <&gpio1 5 0>;
163167 };
164− health_led2 {
165− label = "status:white:health_led";
166− gpios = <&gpio1 4 0>;
167− };
168168 backup_led {
169169 label = "status:blue:backup_led";
170170 gpios = <&gpio0 15 0>;
arch/arm/include/asm/glue-cache.h+0−8
@@ -19,14 +19,6 @@ · 18 unmodified lines
1919 #undef _CACHE
2020 #undef MULTI_CACHE
2121
22−#if defined(CONFIG_CPU_CACHE_V3)
23−# ifdef _CACHE
24−# define MULTI_CACHE 1
25−# else
26−# define _CACHE v3
27−# endif
28−#endif
29−
3022 #if defined(CONFIG_CPU_CACHE_V4)
3123 # ifdef _CACHE
3224 # define MULTI_CACHE 1
arch/arm/include/asm/hardware/iop3xx.h+1−1
@@ -37,7 +37,7 @@ extern int iop3xx_get_init_atu(void); · 36 unmodified lines
3737 * IOP3XX processor registers
3838 */
3939 #define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000
40−#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000
40+#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfedfe000
4141 #define IOP3XX_PERIPHERAL_SIZE 0x00002000
4242 #define IOP3XX_PERIPHERAL_UPPER_PA (IOP3XX_PERIPHERAL_PHYS_BASE +\
4343 IOP3XX_PERIPHERAL_SIZE - 1)
arch/arm/include/asm/pgtable-3level.h+1−1
@@ -111,7 +111,7 @@ · 110 unmodified lines
111111 #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */
112112 #define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */
113113 #define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */
114−#define L_PTE_S2_RDWR (_AT(pteval_t, 2) << 6) /* HAP[2:1] */
114+#define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */
115115
116116 /*
117117 * Hyp-mode PL2 PTE definitions for LPAE.
arch/arm/include/asm/tlbflush.h+2−9
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414
1515 #include <asm/glue.h>
1616
17−#define TLB_V3_PAGE (1 << 0)
1817 #define TLB_V4_U_PAGE (1 << 1)
1918 #define TLB_V4_D_PAGE (1 << 2)
2019 #define TLB_V4_I_PAGE (1 << 3)
@@ -22,7 +21,6 @@ · 1 unmodified line
2221 #define TLB_V6_D_PAGE (1 << 5)
2322 #define TLB_V6_I_PAGE (1 << 6)
2423
25−#define TLB_V3_FULL (1 << 8)
2624 #define TLB_V4_U_FULL (1 << 9)
2725 #define TLB_V4_D_FULL (1 << 10)
2826 #define TLB_V4_I_FULL (1 << 11)
@@ -52,7 +50,6 @@ · 23 unmodified lines
5250 * =============
5351 *
5452 * We have the following to choose from:
55− * v3 - ARMv3
5653 * v4 - ARMv4 without write buffer
5754 * v4wb - ARMv4 with write buffer without I TLB flush entry instruction
5855 * v4wbi - ARMv4 with write buffer with I TLB flush entry instruction
@@ -330,7 +327,6 @@ static inline void local_flush_tlb_all(void) · 271 unmodified lines
330327 if (tlb_flag(TLB_WB))
331328 dsb();
332329
333− tlb_op(TLB_V3_FULL, "c6, c0, 0", zero);
334330 tlb_op(TLB_V4_U_FULL | TLB_V6_U_FULL, "c8, c7, 0", zero);
335331 tlb_op(TLB_V4_D_FULL | TLB_V6_D_FULL, "c8, c6, 0", zero);
336332 tlb_op(TLB_V4_I_FULL | TLB_V6_I_FULL, "c8, c5, 0", zero);
@@ -351,9 +347,8 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) · 14 unmodified lines
351347 if (tlb_flag(TLB_WB))
352348 dsb();
353349
354− if (possible_tlb_flags & (TLB_V3_FULL|TLB_V4_U_FULL|TLB_V4_D_FULL|TLB_V4_I_FULL)) {
350+ if (possible_tlb_flags & (TLB_V4_U_FULL|TLB_V4_D_FULL|TLB_V4_I_FULL)) {
355351 if (cpumask_test_cpu(get_cpu(), mm_cpumask(mm))) {
356− tlb_op(TLB_V3_FULL, "c6, c0, 0", zero);
357352 tlb_op(TLB_V4_U_FULL, "c8, c7, 0", zero);
358353 tlb_op(TLB_V4_D_FULL, "c8, c6, 0", zero);
359354 tlb_op(TLB_V4_I_FULL, "c8, c5, 0", zero);
@@ -385,9 +380,8 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) · 25 unmodified lines
385380 if (tlb_flag(TLB_WB))
386381 dsb();
387382
388− if (possible_tlb_flags & (TLB_V3_PAGE|TLB_V4_U_PAGE|TLB_V4_D_PAGE|TLB_V4_I_PAGE|TLB_V4_I_FULL) &&
383+ if (possible_tlb_flags & (TLB_V4_U_PAGE|TLB_V4_D_PAGE|TLB_V4_I_PAGE|TLB_V4_I_FULL) &&
389384 cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
390− tlb_op(TLB_V3_PAGE, "c6, c0, 0", uaddr);
391385 tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", uaddr);
392386 tlb_op(TLB_V4_D_PAGE, "c8, c6, 1", uaddr);
393387 tlb_op(TLB_V4_I_PAGE, "c8, c5, 1", uaddr);
@@ -418,7 +412,6 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr) · 24 unmodified lines
418412 if (tlb_flag(TLB_WB))
419413 dsb();
420414
421− tlb_op(TLB_V3_PAGE, "c6, c0, 0", kaddr);
422415 tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", kaddr);
423416 tlb_op(TLB_V4_D_PAGE, "c8, c6, 1", kaddr);
424417 tlb_op(TLB_V4_I_PAGE, "c8, c5, 1", kaddr);
arch/arm/kernel/hw_breakpoint.c+1−1
@@ -1043,7 +1043,7 @@ static int dbg_cpu_pm_notify(struct notifier_block *self, unsigned long action, · 1042 unmodified lines
10431043 return NOTIFY_OK;
10441044 }
10451045
1046−static struct notifier_block __cpuinitdata dbg_cpu_pm_nb = {
1046+static struct notifier_block dbg_cpu_pm_nb = {
10471047 .notifier_call = dbg_cpu_pm_notify,
10481048 };
10491049
arch/arm/kernel/perf_event.c+4−1
@@ -253,7 +253,10 @@ validate_event(struct pmu_hw_events *hw_events, · 252 unmodified lines
253253 struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
254254 struct pmu *leader_pmu = event->group_leader->pmu;
255255
256− if (event->pmu != leader_pmu || event->state <= PERF_EVENT_STATE_OFF)
256+ if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
257+ return 1;
258+
259+ if (event->state == PERF_EVENT_STATE_OFF && !event->attr.enable_on_exec)
257260 return 1;
258261
259262 return armpmu->get_event_idx(hw_events, event) >= 0;
arch/arm/kernel/sched_clock.c+2−2
@@ -45,12 +45,12 @@ static u32 notrace jiffy_sched_clock_read(void) · 44 unmodified lines
4545
4646 static u32 __read_mostly (*read_sched_clock)(void) = jiffy_sched_clock_read;
4747
48−static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift)
48+static inline u64 notrace cyc_to_ns(u64 cyc, u32 mult, u32 shift)
4949 {
5050 return (cyc * mult) >> shift;
5151 }
5252
53−static unsigned long long cyc_to_sched_clock(u32 cyc, u32 mask)
53+static unsigned long long notrace cyc_to_sched_clock(u32 cyc, u32 mask)
5454 {
5555 u64 epoch_ns;
5656 u32 epoch_cyc;
arch/arm/kernel/setup.c+0−3
@@ -56,7 +56,6 @@ · 55 unmodified lines
5656 #include <asm/virt.h>
5757
5858 #include "atags.h"
59−#include "tcm.h"
6059
6160
6261 #if defined(CONFIG_FPE_NWFPE) || defined(CONFIG_FPE_FASTFPE)
@@ -798,8 +797,6 @@ void __init setup_arch(char **cmdline_p) · 735 unmodified lines
798797
799798 reserve_crashkernel();
800799
801− tcm_init();
802−
803800 #ifdef CONFIG_MULTI_IRQ_HANDLER
804801 handle_arch_irq = mdesc->handle_irq;
805802 #endif
arch/arm/kernel/tcm.c+0−1
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include <asm/mach/map.h>
1818 #include <asm/memory.h>
1919 #include <asm/system_info.h>
20−#include "tcm.h"
2120
2221 static struct gen_pool *tcm_pool;
2322 static bool dtcm_present;
arch/arm/kvm/arm.c+1−0
@@ -201,6 +201,7 @@ int kvm_dev_ioctl_check_extension(long ext) · 200 unmodified lines
201201 break;
202202 case KVM_CAP_ARM_SET_DEVICE_ADDR:
203203 r = 1;
204+ break;
204205 case KVM_CAP_NR_VCPUS:
205206 r = num_online_cpus();
206207 break;
arch/arm/kvm/coproc.c+2−2
@@ -79,11 +79,11 @@ static bool access_dcsw(struct kvm_vcpu *vcpu, · 78 unmodified lines
7979 u32 val;
8080 int cpu;
8181
82− cpu = get_cpu();
83−
8482 if (!p->is_write)
8583 return read_from_write_only(vcpu, p);
8684
85+ cpu = get_cpu();
86+
8787 cpumask_setall(&vcpu->arch.require_dcache_flush);
8888 cpumask_clear_cpu(cpu, &vcpu->arch.require_dcache_flush);
8989
arch/arm/mach-highbank/hotplug.c+4−6
@@ -28,13 +28,11 @@ extern void secondary_startup(void); · 27 unmodified lines
2828 */
2929 void __ref highbank_cpu_die(unsigned int cpu)
3030 {
31− flush_cache_all();
32−
3331 highbank_set_cpu_jump(cpu, phys_to_virt(0));
34− highbank_set_core_pwr();
3532
36− cpu_do_idle();
33+ flush_cache_louis();
34+ highbank_set_core_pwr();
3735
38− /* We should never return from idle */
39− panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu);
36+ while (1)
37+ cpu_do_idle();
4038 }
arch/arm/mach-imx/clk-imx35.c+2−0
@@ -257,6 +257,7 @@ int __init mx35_clocks_init(void) · 256 unmodified lines
257257 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
258258 clk_register_clkdev(clk[nfc_div], NULL, "imx25-nand.0");
259259 clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
260+ clk_register_clkdev(clk[admux_gate], "audmux", NULL);
260261
261262 clk_prepare_enable(clk[spba_gate]);
262263 clk_prepare_enable(clk[gpio1_gate]);
@@ -265,6 +266,7 @@ int __init mx35_clocks_init(void) · 2 unmodified lines
265266 clk_prepare_enable(clk[iim_gate]);
266267 clk_prepare_enable(clk[emi_gate]);
267268 clk_prepare_enable(clk[max_gate]);
269+ clk_prepare_enable(clk[iomuxc_gate]);
268270
269271 /*
270272 * SCC is needed to boot via mmc after a watchdog reset. The clock code
arch/arm/mach-imx/clk-imx6q.c+1−2
@@ -115,7 +115,7 @@ static const char *gpu2d_core_sels[] = { "axi", "pll3_usb_otg", "pll2_pfd0_352m" · 114 unmodified lines
115115 static const char *gpu3d_core_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll2_pfd2_396m", };
116116 static const char *gpu3d_shader_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll2_pfd1_594m", "pll2_pfd9_720m", };
117117 static const char *ipu_sels[] = { "mmdc_ch0_axi", "pll2_pfd2_396m", "pll3_120m", "pll3_pfd1_540m", };
118−static const char *ldb_di_sels[] = { "pll5_video", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_pfd1_540m", };
118+static const char *ldb_di_sels[] = { "pll5_video", "pll2_pfd0_352m", "pll2_pfd2_396m", "mmdc_ch1_axi", "pll3_usb_otg", };
119119 static const char *ipu_di_pre_sels[] = { "mmdc_ch0_axi", "pll3_usb_otg", "pll5_video", "pll2_pfd0_352m", "pll2_pfd2_396m", "pll3_pfd1_540m", };
120120 static const char *ipu1_di0_sels[] = { "ipu1_di0_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
121121 static const char *ipu1_di1_sels[] = { "ipu1_di1_pre", "dummy", "dummy", "ldb_di0", "ldb_di1", };
@@ -443,7 +443,6 @@ int __init mx6q_clocks_init(void) · 321 unmodified lines
443443
444444 clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0");
445445 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
446− clk_register_clkdev(clk[twd], NULL, "smp_twd");
447446 clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL);
448447 clk_register_clkdev(clk[ahb], "ahb", NULL);
449448 clk_register_clkdev(clk[cko1], "cko1", NULL);
arch/arm/mach-kirkwood/board-iomega_ix2_200.c+6−1
@@ -20,10 +20,15 @@ static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { · 19 unmodified lines
2020 .duplex = DUPLEX_FULL,
2121 };
2222
23+static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
24+ .phy_addr = MV643XX_ETH_PHY_ADDR(11),
25+};
26+
2327 void __init iomega_ix2_200_init(void)
2428 {
2529 /*
2630 * Basic setup. Needs to be called early.
2731 */
28− kirkwood_ge01_init(&iomega_ix2_200_ge00_data);
32+ kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
33+ kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
2934 }
arch/arm/mach-mvebu/irq-armada-370-xp.c+5−11
@@ -61,7 +61,6 @@ static struct irq_domain *armada_370_xp_mpic_domain; · 60 unmodified lines
6161 */
6262 static void armada_370_xp_irq_mask(struct irq_data *d)
6363 {
64−#ifdef CONFIG_SMP
6564 irq_hw_number_t hwirq = irqd_to_hwirq(d);
6665
6766 if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
@@ -70,15 +69,10 @@ static void armada_370_xp_irq_mask(struct irq_data *d) · 2 unmodified lines
7069 else
7170 writel(hwirq, per_cpu_int_base +
7271 ARMADA_370_XP_INT_SET_MASK_OFFS);
73−#else
74− writel(irqd_to_hwirq(d),
75− per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS);
76−#endif
7772 }
7873
7974 static void armada_370_xp_irq_unmask(struct irq_data *d)
8075 {
81−#ifdef CONFIG_SMP
8276 irq_hw_number_t hwirq = irqd_to_hwirq(d);
8377
8478 if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
@@ -87,10 +81,6 @@ static void armada_370_xp_irq_unmask(struct irq_data *d) · 2 unmodified lines
8781 else
8882 writel(hwirq, per_cpu_int_base +
8983 ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
90−#else
91− writel(irqd_to_hwirq(d),
92− per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
93−#endif
9484 }
9585
9686 #ifdef CONFIG_SMP
@@ -146,7 +136,11 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h, · 49 unmodified lines
146136 unsigned int virq, irq_hw_number_t hw)
147137 {
148138 armada_370_xp_irq_mask(irq_get_irq_data(virq));
149− writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
139+ if (hw != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
140+ writel(hw, per_cpu_int_base +
141+ ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
142+ else
143+ writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
150144 irq_set_status_flags(virq, IRQ_LEVEL);
151145
152146 if (hw == ARMADA_370_XP_TIMER0_PER_CPU_IRQ) {
arch/arm/mach-s3c24xx/include/mach/irqs.h+1−3
@@ -188,10 +188,8 @@ · 187 unmodified lines
188188
189189 #if defined(CONFIG_CPU_S3C2416)
190190 #define NR_IRQS (IRQ_S3C2416_I2S1 + 1)
191−#elif defined(CONFIG_CPU_S3C2443)
192−#define NR_IRQS (IRQ_S3C2443_AC97+1)
193191 #else
194−#define NR_IRQS (IRQ_S3C2440_AC97+1)
192+#define NR_IRQS (IRQ_S3C2443_AC97 + 1)
195193 #endif
196194
197195 /* compatibility define. */
arch/arm/mach-s3c24xx/irq.c+1−1
@@ -500,7 +500,7 @@ struct s3c_irq_intc *s3c24xx_init_intc(struct device_node *np, · 499 unmodified lines
500500 base = (void *)0xfd000000;
501501
502502 intc->reg_mask = base + 0xa4;
503− intc->reg_pending = base + 0x08;
503+ intc->reg_pending = base + 0xa8;
504504 irq_num = 20;
505505 irq_start = S3C2410_IRQ(32);
506506 irq_offset = 4;
arch/arm/mm/Kconfig+1−4
@@ -43,7 +43,7 @@ config CPU_ARM740T · 42 unmodified lines
4343 depends on !MMU
4444 select CPU_32v4T
4545 select CPU_ABRT_LV4T
46− select CPU_CACHE_V3 # although the core is v4t
46+ select CPU_CACHE_V4
4747 select CPU_CP15_MPU
4848 select CPU_PABRT_LEGACY
4949 help
@@ -469,9 +469,6 @@ config CPU_PABRT_V7 · 419 unmodified lines
469469 bool
470470
471471 # The cache model
472−config CPU_CACHE_V3
473− bool
474−
475472 config CPU_CACHE_V4
476473 bool
477474
arch/arm/mm/Makefile+0−1
@@ -33,7 +33,6 @@ obj-$(CONFIG_CPU_PABRT_LEGACY) += pabort-legacy.o · 32 unmodified lines
3333 obj-$(CONFIG_CPU_PABRT_V6) += pabort-v6.o
3434 obj-$(CONFIG_CPU_PABRT_V7) += pabort-v7.o
3535
36−obj-$(CONFIG_CPU_CACHE_V3) += cache-v3.o
3736 obj-$(CONFIG_CPU_CACHE_V4) += cache-v4.o
3837 obj-$(CONFIG_CPU_CACHE_V4WT) += cache-v4wt.o
3938 obj-$(CONFIG_CPU_CACHE_V4WB) += cache-v4wb.o
arch/arm/mm/cache-feroceon-l2.c+1−0
@@ -343,6 +343,7 @@ void __init feroceon_l2_init(int __l2_wt_override) · 342 unmodified lines
343343 outer_cache.inv_range = feroceon_l2_inv_range;
344344 outer_cache.clean_range = feroceon_l2_clean_range;
345345 outer_cache.flush_range = feroceon_l2_flush_range;
346+ outer_cache.inv_all = l2_inv_all;
346347
347348 enable_l2();
348349
arch/arm/mm/cache-v3.S+0−137
@@ -1,137 +0,0 @@
1−/*
2− * linux/arch/arm/mm/cache-v3.S
3− *
4− * Copyright (C) 1997-2002 Russell king
5− *
6− * This program is free software; you can redistribute it and/or modify
7− * it under the terms of the GNU General Public License version 2 as
8− * published by the Free Software Foundation.
9− */
10−#include <linux/linkage.h>
11−#include <linux/init.h>
12−#include <asm/page.h>
13−#include "proc-macros.S"
14−
15−/*
16− * flush_icache_all()
17− *
18− * Unconditionally clean and invalidate the entire icache.
19− */
20−ENTRY(v3_flush_icache_all)
21− mov pc, lr
22−ENDPROC(v3_flush_icache_all)
23−
24−/*
25− * flush_user_cache_all()
26− *
27− * Invalidate all cache entries in a particular address
28− * space.
29− *
30− * - mm - mm_struct describing address space
31− */
32−ENTRY(v3_flush_user_cache_all)
33− /* FALLTHROUGH */
34−/*
35− * flush_kern_cache_all()
36− *
37− * Clean and invalidate the entire cache.
38− */
39−ENTRY(v3_flush_kern_cache_all)
40− /* FALLTHROUGH */
41−
42−/*
43− * flush_user_cache_range(start, end, flags)
44− *
45− * Invalidate a range of cache entries in the specified
46− * address space.
47− *
48− * - start - start address (may not be aligned)
49− * - end - end address (exclusive, may not be aligned)
50− * - flags - vma_area_struct flags describing address space
51− */
52−ENTRY(v3_flush_user_cache_range)
53− mov ip, #0
54− mcreq p15, 0, ip, c7, c0, 0 @ flush ID cache
55− mov pc, lr
56−
57−/*
58− * coherent_kern_range(start, end)
59− *
60− * Ensure coherency between the Icache and the Dcache in the
61− * region described by start. If you have non-snooping
62− * Harvard caches, you need to implement this function.
63− *
64− * - start - virtual start address
65− * - end - virtual end address
66− */
67−ENTRY(v3_coherent_kern_range)
68− /* FALLTHROUGH */
69−
70−/*
71− * coherent_user_range(start, end)
72− *
73− * Ensure coherency between the Icache and the Dcache in the
74− * region described by start. If you have non-snooping
75− * Harvard caches, you need to implement this function.
76− *
77− * - start - virtual start address
78− * - end - virtual end address
79− */
80−ENTRY(v3_coherent_user_range)
81− mov r0, #0
82− mov pc, lr
83−
84−/*
85− * flush_kern_dcache_area(void *page, size_t size)
86− *
87− * Ensure no D cache aliasing occurs, either with itself or
88− * the I cache
89− *
90− * - addr - kernel address
91− * - size - region size
92− */
93−ENTRY(v3_flush_kern_dcache_area)
94− /* FALLTHROUGH */
95−
96−/*
97− * dma_flush_range(start, end)
98− *
99− * Clean and invalidate the specified virtual address range.
100− *
101− * - start - virtual start address
102− * - end - virtual end address
103− */
104−ENTRY(v3_dma_flush_range)
105− mov r0, #0
106− mcr p15, 0, r0, c7, c0, 0 @ flush ID cache
107− mov pc, lr
108−
109−/*
110− * dma_unmap_area(start, size, dir)
111− * - start - kernel virtual start address
112− * - size - size of region
113− * - dir - DMA direction
114− */
115−ENTRY(v3_dma_unmap_area)
116− teq r2, #DMA_TO_DEVICE
117− bne v3_dma_flush_range
118− /* FALLTHROUGH */
119−
120−/*
121− * dma_map_area(start, size, dir)
122− * - start - kernel virtual start address
123− * - size - size of region
124− * - dir - DMA direction
125− */
126−ENTRY(v3_dma_map_area)
127− mov pc, lr
128−ENDPROC(v3_dma_unmap_area)
129−ENDPROC(v3_dma_map_area)
130−
131− .globl v3_flush_kern_cache_louis
132− .equ v3_flush_kern_cache_louis, v3_flush_kern_cache_all
133−
134− __INITDATA
135−
136− @ define struct cpu_cache_fns (see <asm/cacheflush.h> and proc-macros.S)
137− define_cache_functions v3
arch/arm/mm/cache-v4.S+1−1
@@ -58,7 +58,7 @@ ENTRY(v4_flush_kern_cache_all) · 57 unmodified lines
5858 ENTRY(v4_flush_user_cache_range)
5959 #ifdef CONFIG_CPU_CP15
6060 mov ip, #0
61− mcreq p15, 0, ip, c7, c7, 0 @ flush ID cache
61+ mcr p15, 0, ip, c7, c7, 0 @ flush ID cache
6262 mov pc, lr
6363 #else
6464 /* FALLTHROUGH */
arch/arm/mm/mmu.c+2−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include <asm/mach/pci.h>
3535
3636 #include "mm.h"
37+#include "tcm.h"
3738
3839 /*
3940 * empty_zero_page is a special page that is used for
@@ -1277,6 +1278,7 @@ void __init paging_init(struct machine_desc *mdesc) · 1237 unmodified lines
12771278 dma_contiguous_remap();
12781279 devicemaps_init(mdesc);
12791280 kmap_init();
1281+ tcm_init();
12801282
12811283 top_pmd = pmd_off_k(0xffff0000);
12821284
arch/arm/mm/proc-arm740.S+17−13
@@ -77,24 +77,27 @@ __arm740_setup: · 76 unmodified lines
7777 mcr p15, 0, r0, c6, c0 @ set area 0, default
7878
7979 ldr r0, =(CONFIG_DRAM_BASE & 0xFFFFF000) @ base[31:12] of RAM
80− ldr r1, =(CONFIG_DRAM_SIZE >> 12) @ size of RAM (must be >= 4KB)
81− mov r2, #10 @ 11 is the minimum (4KB)
82−1: add r2, r2, #1 @ area size *= 2
83− mov r1, r1, lsr #1
80+ ldr r3, =(CONFIG_DRAM_SIZE >> 12) @ size of RAM (must be >= 4KB)
81+ mov r4, #10 @ 11 is the minimum (4KB)
82+1: add r4, r4, #1 @ area size *= 2
83+ movs r3, r3, lsr #1
8484 bne 1b @ count not zero r-shift
85− orr r0, r0, r2, lsl #1 @ the area register value
85+ orr r0, r0, r4, lsl #1 @ the area register value
8686 orr r0, r0, #1 @ set enable bit
8787 mcr p15, 0, r0, c6, c1 @ set area 1, RAM
8888
8989 ldr r0, =(CONFIG_FLASH_MEM_BASE & 0xFFFFF000) @ base[31:12] of FLASH
90− ldr r1, =(CONFIG_FLASH_SIZE >> 12) @ size of FLASH (must be >= 4KB)
91− mov r2, #10 @ 11 is the minimum (4KB)
92−1: add r2, r2, #1 @ area size *= 2
93− mov r1, r1, lsr #1
90+ ldr r3, =(CONFIG_FLASH_SIZE >> 12) @ size of FLASH (must be >= 4KB)
91+ cmp r3, #0
92+ moveq r0, #0
93+ beq 2f
94+ mov r4, #10 @ 11 is the minimum (4KB)
95+1: add r4, r4, #1 @ area size *= 2
96+ movs r3, r3, lsr #1
9497 bne 1b @ count not zero r-shift
95− orr r0, r0, r2, lsl #1 @ the area register value
98+ orr r0, r0, r4, lsl #1 @ the area register value
9699 orr r0, r0, #1 @ set enable bit
97− mcr p15, 0, r0, c6, c2 @ set area 2, ROM/FLASH
100+2: mcr p15, 0, r0, c6, c2 @ set area 2, ROM/FLASH
98101
99102 mov r0, #0x06
100103 mcr p15, 0, r0, c2, c0 @ Region 1&2 cacheable
@@ -137,13 +140,14 @@ __arm740_proc_info: · 36 unmodified lines
137140 .long 0x41807400
138141 .long 0xfffffff0
139142 .long 0
143+ .long 0
140144 b __arm740_setup
141145 .long cpu_arch_name
142146 .long cpu_elf_name
143− .long HWCAP_SWP | HWCAP_HALF | HWCAP_26BIT
147+ .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB | HWCAP_26BIT
144148 .long cpu_arm740_name
145149 .long arm740_processor_functions
146150 .long 0
147151 .long 0
148− .long v3_cache_fns @ cache model
152+ .long v4_cache_fns @ cache model
149153 .size __arm740_proc_info, . - __arm740_proc_info
arch/arm/mm/proc-arm920.S+1−1
@@ -387,7 +387,7 @@ ENTRY(cpu_arm920_set_pte_ext) · 386 unmodified lines
387387 /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
388388 .globl cpu_arm920_suspend_size
389389 .equ cpu_arm920_suspend_size, 4 * 3
390−#ifdef CONFIG_PM_SLEEP
390+#ifdef CONFIG_ARM_CPU_SUSPEND
391391 ENTRY(cpu_arm920_do_suspend)
392392 stmfd sp!, {r4 - r6, lr}
393393 mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-arm926.S+1−1
@@ -402,7 +402,7 @@ ENTRY(cpu_arm926_set_pte_ext) · 401 unmodified lines
402402 /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
403403 .globl cpu_arm926_suspend_size
404404 .equ cpu_arm926_suspend_size, 4 * 3
405−#ifdef CONFIG_PM_SLEEP
405+#ifdef CONFIG_ARM_CPU_SUSPEND
406406 ENTRY(cpu_arm926_do_suspend)
407407 stmfd sp!, {r4 - r6, lr}
408408 mrc p15, 0, r4, c13, c0, 0 @ PID
arch/arm/mm/proc-mohawk.S+1−1
@@ -350,7 +350,7 @@ ENTRY(cpu_mohawk_set_pte_ext) · 349 unmodified lines
350350
351351 .globl cpu_mohawk_suspend_size
352352 .equ cpu_mohawk_suspend_size, 4 * 6
353−#ifdef CONFIG_PM_SLEEP
353+#ifdef CONFIG_ARM_CPU_SUSPEND
354354 ENTRY(cpu_mohawk_do_suspend)
355355 stmfd sp!, {r4 - r9, lr}
356356 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-sa1100.S+1−1
@@ -172,7 +172,7 @@ ENTRY(cpu_sa1100_set_pte_ext) · 171 unmodified lines
172172
173173 .globl cpu_sa1100_suspend_size
174174 .equ cpu_sa1100_suspend_size, 4 * 3
175−#ifdef CONFIG_PM_SLEEP
175+#ifdef CONFIG_ARM_CPU_SUSPEND
176176 ENTRY(cpu_sa1100_do_suspend)
177177 stmfd sp!, {r4 - r6, lr}
178178 mrc p15, 0, r4, c3, c0, 0 @ domain ID
arch/arm/mm/proc-syms.c+2−0
@@ -17,7 +17,9 @@ · 16 unmodified lines
1717
1818 #ifndef MULTI_CPU
1919 EXPORT_SYMBOL(cpu_dcache_clean_area);
20+#ifdef CONFIG_MMU
2021 EXPORT_SYMBOL(cpu_set_pte_ext);
22+#endif
2123 #else
2224 EXPORT_SYMBOL(processor);
2325 #endif
arch/arm/mm/proc-v6.S+1−1
@@ -138,7 +138,7 @@ ENTRY(cpu_v6_set_pte_ext) · 137 unmodified lines
138138 /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */
139139 .globl cpu_v6_suspend_size
140140 .equ cpu_v6_suspend_size, 4 * 6
141−#ifdef CONFIG_PM_SLEEP
141+#ifdef CONFIG_ARM_CPU_SUSPEND
142142 ENTRY(cpu_v6_do_suspend)
143143 stmfd sp!, {r4 - r9, lr}
144144 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
arch/arm/mm/proc-xsc3.S+1−1
@@ -413,7 +413,7 @@ ENTRY(cpu_xsc3_set_pte_ext) · 412 unmodified lines
413413
414414 .globl cpu_xsc3_suspend_size
415415 .equ cpu_xsc3_suspend_size, 4 * 6
416−#ifdef CONFIG_PM_SLEEP
416+#ifdef CONFIG_ARM_CPU_SUSPEND
417417 ENTRY(cpu_xsc3_do_suspend)
418418 stmfd sp!, {r4 - r9, lr}
419419 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/proc-xscale.S+1−1
@@ -528,7 +528,7 @@ ENTRY(cpu_xscale_set_pte_ext) · 527 unmodified lines
528528
529529 .globl cpu_xscale_suspend_size
530530 .equ cpu_xscale_suspend_size, 4 * 6
531−#ifdef CONFIG_PM_SLEEP
531+#ifdef CONFIG_ARM_CPU_SUSPEND
532532 ENTRY(cpu_xscale_do_suspend)
533533 stmfd sp!, {r4 - r9, lr}
534534 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
arch/arm/mm/tcm.hrenamed from arch/arm/kernel/tcm.h+0−0

File renamed without changes.

arch/avr32/include/asm/io.h+4−0
@@ -165,6 +165,10 @@ BUILDIO_IOPORT(l, u32) · 164 unmodified lines
165165 #define readw_be __raw_readw
166166 #define readl_be __raw_readl
167167
168+#define writeb_relaxed writeb
169+#define writew_relaxed writew
170+#define writel_relaxed writel
171+
168172 #define writeb_be __raw_writeb
169173 #define writew_be __raw_writew
170174 #define writel_be __raw_writel
arch/c6x/include/asm/irqflags.h+1−1
@@ -27,7 +27,7 @@ static inline unsigned long arch_local_save_flags(void) · 26 unmodified lines
2727 /* set interrupt enabled status */
2828 static inline void arch_local_irq_restore(unsigned long flags)
2929 {
30− asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags));
30+ asm volatile (" mvc .s2 %0,CSR\n" : : "b"(flags) : "memory");
3131 }
3232
3333 /* unconditionally enable interrupts */
arch/ia64/kernel/palinfo.c+13−64
@@ -849,17 +849,6 @@ static palinfo_entry_t palinfo_entries[]={ · 848 unmodified lines
849849
850850 #define NR_PALINFO_ENTRIES (int) ARRAY_SIZE(palinfo_entries)
851851
852−/*
853− * this array is used to keep track of the proc entries we create. This is
854− * required in the module mode when we need to remove all entries. The procfs code
855− * does not do recursion of deletion
856− *
857− * Notes:
858− * - +1 accounts for the cpuN directory entry in /proc/pal
859− */
860−#define NR_PALINFO_PROC_ENTRIES (NR_CPUS*(NR_PALINFO_ENTRIES+1))
861−
862−static struct proc_dir_entry *palinfo_proc_entries[NR_PALINFO_PROC_ENTRIES];
863852 static struct proc_dir_entry *palinfo_dir;
864853
865854 /*
@@ -971,60 +960,32 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi · 105 unmodified lines
971960 static void __cpuinit
972961 create_palinfo_proc_entries(unsigned int cpu)
973962 {
974−# define CPUSTR "cpu%d"
975−
976963 pal_func_cpu_u_t f;
977− struct proc_dir_entry **pdir;
978964 struct proc_dir_entry *cpu_dir;
979965 int j;
980− char cpustr[sizeof(CPUSTR)];
981−
982−
983− /*
984− * we keep track of created entries in a depth-first order for
985− * cleanup purposes. Each entry is stored into palinfo_proc_entries
986− */
987− sprintf(cpustr,CPUSTR, cpu);
966+ char cpustr[3+4+1]; /* cpu numbers are up to 4095 on itanic */
967+ sprintf(cpustr, "cpu%d", cpu);
988968
989969 cpu_dir = proc_mkdir(cpustr, palinfo_dir);
970+ if (!cpu_dir)
971+ return;
990972
991973 f.req_cpu = cpu;
992974
993− /*
994− * Compute the location to store per cpu entries
995− * We dont store the top level entry in this list, but
996− * remove it finally after removing all cpu entries.
997− */
998− pdir = &palinfo_proc_entries[cpu*(NR_PALINFO_ENTRIES+1)];
999− *pdir++ = cpu_dir;
1000975 for (j=0; j < NR_PALINFO_ENTRIES; j++) {
1001976 f.func_id = j;
1002− *pdir = create_proc_read_entry(
1003− palinfo_entries[j].name, 0, cpu_dir,
1004− palinfo_read_entry, (void *)f.value);
1005− pdir++;
977+ create_proc_read_entry(
978+ palinfo_entries[j].name, 0, cpu_dir,
979+ palinfo_read_entry, (void *)f.value);
1006980 }
1007981 }
1008982
1009983 static void
1010984 remove_palinfo_proc_entries(unsigned int hcpu)
1011985 {
1012− int j;
1013− struct proc_dir_entry *cpu_dir, **pdir;
1014−
1015− pdir = &palinfo_proc_entries[hcpu*(NR_PALINFO_ENTRIES+1)];
1016− cpu_dir = *pdir;
1017− *pdir++=NULL;
1018− for (j=0; j < (NR_PALINFO_ENTRIES); j++) {
1019− if ((*pdir)) {
1020− remove_proc_entry ((*pdir)->name, cpu_dir);
1021− *pdir ++= NULL;
1022− }
1023− }
1024−
1025− if (cpu_dir) {
1026− remove_proc_entry(cpu_dir->name, palinfo_dir);
1027− }
986+ char cpustr[3+4+1]; /* cpu numbers are up to 4095 on itanic */
987+ sprintf(cpustr, "cpu%d", hcpu);
988+ remove_proc_subtree(cpustr, palinfo_dir);
1028989 }
1029990
1030991 static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb,
@@ -1058,6 +1019,8 @@ palinfo_init(void) · 27 unmodified lines
10581019
10591020 printk(KERN_INFO "PAL Information Facility v%s\n", PALINFO_VERSION);
10601021 palinfo_dir = proc_mkdir("pal", NULL);
1022+ if (!palinfo_dir)
1023+ return -ENOMEM;
10611024
10621025 /* Create palinfo dirs in /proc for all online cpus */
10631026 for_each_online_cpu(i) {
@@ -1073,22 +1036,8 @@ palinfo_init(void) · 9 unmodified lines
10731036 static void __exit
10741037 palinfo_exit(void)
10751038 {
1076− int i = 0;
1077−
1078− /* remove all nodes: depth first pass. Could optimize this */
1079− for_each_online_cpu(i) {
1080− remove_palinfo_proc_entries(i);
1081− }
1082−
1083− /*
1084− * Remove the top level entry finally
1085− */
1086− remove_proc_entry(palinfo_dir->name, NULL);
1087−
1088− /*
1089− * Unregister from cpu notifier callbacks
1090− */
10911039 unregister_hotcpu_notifier(&palinfo_cpu_notifier);
1040+ remove_proc_subtree("pal", NULL);
10921041 }
10931042
10941043 module_init(palinfo_init);
arch/m68k/include/asm/gpio.h+20−0
@@ -86,4 +86,24 @@ static inline int gpio_cansleep(unsigned gpio) · 85 unmodified lines
8686 return gpio < MCFGPIO_PIN_MAX ? 0 : __gpio_cansleep(gpio);
8787 }
8888
89+static inline int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
90+{
91+ int err;
92+
93+ err = gpio_request(gpio, label);
94+ if (err)
95+ return err;
96+
97+ if (flags & GPIOF_DIR_IN)
98+ err = gpio_direction_input(gpio);
99+ else
100+ err = gpio_direction_output(gpio,
101+ (flags & GPIOF_INIT_HIGH) ? 1 : 0);
102+
103+ if (err)
104+ gpio_free(gpio);
105+
106+ return err;
107+}
108+
89109 #endif
arch/powerpc/kernel/entry_64.S+2−2
@@ -304,7 +304,7 @@ syscall_exit_work: · 303 unmodified lines
304304 subi r12,r12,TI_FLAGS
305305
306306 4: /* Anything else left to do? */
307− SET_DEFAULT_THREAD_PPR(r3, r9) /* Set thread.ppr = 3 */
307+ SET_DEFAULT_THREAD_PPR(r3, r10) /* Set thread.ppr = 3 */
308308 andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
309309 beq .ret_from_except_lite
310310
@@ -657,7 +657,7 @@ resume_kernel: · 346 unmodified lines
657657 /* Clear _TIF_EMULATE_STACK_STORE flag */
658658 lis r11,_TIF_EMULATE_STACK_STORE@h
659659 addi r5,r9,TI_FLAGS
660− ldarx r4,0,r5
660+0: ldarx r4,0,r5
661661 andc r4,r4,r11
662662 stdcx. r4,0,r5
663663 bne- 0b
arch/powerpc/kernel/process.c+2−0
@@ -555,10 +555,12 @@ static inline void tm_recheckpoint_new_task(struct task_struct *new) · 554 unmodified lines
555555 new->thread.regs->msr |=
556556 (MSR_FP | new->thread.fpexc_mode);
557557 }
558+#ifdef CONFIG_ALTIVEC
558559 if (msr & MSR_VEC) {
559560 do_load_up_transact_altivec(&new->thread);
560561 new->thread.regs->msr |= MSR_VEC;
561562 }
563+#endif
562564 /* We may as well turn on VSX too since all the state is restored now */
563565 if (msr & MSR_VSX)
564566 new->thread.regs->msr |= MSR_VSX;
arch/powerpc/kernel/signal_32.c+2−0
@@ -866,10 +866,12 @@ static long restore_tm_user_regs(struct pt_regs *regs, · 865 unmodified lines
866866 do_load_up_transact_fpu(&current->thread);
867867 regs->msr |= (MSR_FP | current->thread.fpexc_mode);
868868 }
869+#ifdef CONFIG_ALTIVEC
869870 if (msr & MSR_VEC) {
870871 do_load_up_transact_altivec(&current->thread);
871872 regs->msr |= MSR_VEC;
872873 }
874+#endif
873875
874876 return 0;
875877 }
arch/powerpc/kernel/signal_64.c+2−0
@@ -522,10 +522,12 @@ static long restore_tm_sigcontexts(struct pt_regs *regs, · 521 unmodified lines
522522 do_load_up_transact_fpu(&current->thread);
523523 regs->msr |= (MSR_FP | current->thread.fpexc_mode);
524524 }
525+#ifdef CONFIG_ALTIVEC
525526 if (msr & MSR_VEC) {
526527 do_load_up_transact_altivec(&current->thread);
527528 regs->msr |= MSR_VEC;
528529 }
530+#endif
529531
530532 return err;
531533 }
arch/powerpc/kernel/tm.S+2−0
@@ -309,6 +309,7 @@ _GLOBAL(tm_recheckpoint) · 308 unmodified lines
309309 or r5, r6, r5 /* Set MSR.FP+.VSX/.VEC */
310310 mtmsr r5
311311
312+#ifdef CONFIG_ALTIVEC
312313 /* FP and VEC registers: These are recheckpointed from thread.fpr[]
313314 * and thread.vr[] respectively. The thread.transact_fpr[] version
314315 * is more modern, and will be loaded subsequently by any FPUnavailable
@@ -323,6 +324,7 @@ _GLOBAL(tm_recheckpoint) · 8 unmodified lines
323324 REST_32VRS(0, r5, r3) /* r5 scratch, r3 THREAD ptr */
324325 ld r5, THREAD_VRSAVE(r3)
325326 mtspr SPRN_VRSAVE, r5
327+#endif
326328
327329 dont_restore_vec:
328330 andi. r0, r4, MSR_FP
arch/powerpc/kvm/e500.h+8−16
@@ -26,17 +26,20 @@ · 25 unmodified lines
2626 #define E500_PID_NUM 3
2727 #define E500_TLB_NUM 2
2828
29−#define E500_TLB_VALID 1
30−#define E500_TLB_BITMAP 2
29+/* entry is mapped somewhere in host TLB */
30+#define E500_TLB_VALID (1 << 0)
31+/* TLB1 entry is mapped by host TLB1, tracked by bitmaps */
32+#define E500_TLB_BITMAP (1 << 1)
33+/* TLB1 entry is mapped by host TLB0 */
3134 #define E500_TLB_TLB0 (1 << 2)
3235
3336 struct tlbe_ref {
34− pfn_t pfn;
35− unsigned int flags; /* E500_TLB_* */
37+ pfn_t pfn; /* valid only for TLB0, except briefly */
38+ unsigned int flags; /* E500_TLB_* */
3639 };
3740
3841 struct tlbe_priv {
39− struct tlbe_ref ref; /* TLB0 only -- TLB1 uses tlb_refs */
42+ struct tlbe_ref ref;
4043 };
4144
4245 #ifdef CONFIG_KVM_E500V2
@@ -63,17 +66,6 @@ struct kvmppc_vcpu_e500 { · 20 unmodified lines
6366
6467 unsigned int gtlb_nv[E500_TLB_NUM];
6568
66− /*
67− * information associated with each host TLB entry --
68− * TLB1 only for now. If/when guest TLB1 entries can be
69− * mapped with host TLB0, this will be used for that too.
70− *
71− * We don't want to use this for guest TLB0 because then we'd
72− * have the overhead of doing the translation again even if
73− * the entry is still in the guest TLB (e.g. we swapped out
74− * and back, and our host TLB entries got evicted).
75− */
76− struct tlbe_ref *tlb_refs[E500_TLB_NUM];
7769 unsigned int host_tlb1_nv;
7870
7971 u32 svr;
arch/powerpc/kvm/e500_mmu_host.c+27−57
@@ -193,8 +193,11 @@ void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel, · 192 unmodified lines
193193 struct tlbe_ref *ref = &vcpu_e500->gtlb_priv[tlbsel][esel].ref;
194194
195195 /* Don't bother with unmapped entries */
196− if (!(ref->flags & E500_TLB_VALID))
197− return;
196+ if (!(ref->flags & E500_TLB_VALID)) {
197+ WARN(ref->flags & (E500_TLB_BITMAP | E500_TLB_TLB0),
198+ "%s: flags %x\n", __func__, ref->flags);
199+ WARN_ON(tlbsel == 1 && vcpu_e500->g2h_tlb1_map[esel]);
200+ }
198201
199202 if (tlbsel == 1 && ref->flags & E500_TLB_BITMAP) {
200203 u64 tmp = vcpu_e500->g2h_tlb1_map[esel];
@@ -248,7 +251,7 @@ static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref, · 47 unmodified lines
248251 pfn_t pfn)
249252 {
250253 ref->pfn = pfn;
251− ref->flags = E500_TLB_VALID;
254+ ref->flags |= E500_TLB_VALID;
252255
253256 if (tlbe_is_writable(gtlbe))
254257 kvm_set_pfn_dirty(pfn);
@@ -257,6 +260,7 @@ static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref, · 2 unmodified lines
257260 static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref)
258261 {
259262 if (ref->flags & E500_TLB_VALID) {
263+ /* FIXME: don't log bogus pfn for TLB1 */
260264 trace_kvm_booke206_ref_release(ref->pfn, ref->flags);
261265 ref->flags = 0;
262266 }
@@ -274,36 +278,23 @@ static void clear_tlb1_bitmap(struct kvmppc_vcpu_e500 *vcpu_e500) · 11 unmodified lines
274278
275279 static void clear_tlb_privs(struct kvmppc_vcpu_e500 *vcpu_e500)
276280 {
277− int tlbsel = 0;
278− int i;
279−
280− for (i = 0; i < vcpu_e500->gtlb_params[tlbsel].entries; i++) {
281− struct tlbe_ref *ref =
282− &vcpu_e500->gtlb_priv[tlbsel][i].ref;
283− kvmppc_e500_ref_release(ref);
284− }
285−}
286−
287−static void clear_tlb_refs(struct kvmppc_vcpu_e500 *vcpu_e500)
288−{
289− int stlbsel = 1;
281+ int tlbsel;
290282 int i;
291283
292− kvmppc_e500_tlbil_all(vcpu_e500);
293−
294− for (i = 0; i < host_tlb_params[stlbsel].entries; i++) {
295− struct tlbe_ref *ref =
296− &vcpu_e500->tlb_refs[stlbsel][i];
297− kvmppc_e500_ref_release(ref);
284+ for (tlbsel = 0; tlbsel <= 1; tlbsel++) {
285+ for (i = 0; i < vcpu_e500->gtlb_params[tlbsel].entries; i++) {
286+ struct tlbe_ref *ref =
287+ &vcpu_e500->gtlb_priv[tlbsel][i].ref;
288+ kvmppc_e500_ref_release(ref);
289+ }
298290 }
299−
300− clear_tlb_privs(vcpu_e500);
301291 }
302292
303293 void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu)
304294 {
305295 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
306− clear_tlb_refs(vcpu_e500);
296+ kvmppc_e500_tlbil_all(vcpu_e500);
297+ clear_tlb_privs(vcpu_e500);
307298 clear_tlb1_bitmap(vcpu_e500);
308299 }
309300
@@ -458,8 +449,6 @@ static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 148 unmodified lines
458449 gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1);
459450 }
460451
461− /* Drop old ref and setup new one. */
462− kvmppc_e500_ref_release(ref);
463452 kvmppc_e500_ref_setup(ref, gtlbe, pfn);
464453
465454 kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,
@@ -507,14 +496,15 @@ static int kvmppc_e500_tlb1_map_tlb1(struct kvmppc_vcpu_e500 *vcpu_e500, · 41 unmodified lines
507496 if (unlikely(vcpu_e500->host_tlb1_nv >= tlb1_max_shadow_size()))
508497 vcpu_e500->host_tlb1_nv = 0;
509498
510− vcpu_e500->tlb_refs[1][sesel] = *ref;
511− vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
512− vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
513499 if (vcpu_e500->h2g_tlb1_rmap[sesel]) {
514− unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel];
500+ unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel] - 1;
515501 vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel);
516502 }
517− vcpu_e500->h2g_tlb1_rmap[sesel] = esel;
503+
504+ vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
505+ vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
506+ vcpu_e500->h2g_tlb1_rmap[sesel] = esel + 1;
507+ WARN_ON(!(ref->flags & E500_TLB_VALID));
518508
519509 return sesel;
520510 }
@@ -526,13 +516,12 @@ static int kvmppc_e500_tlb1_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 5 unmodified lines
526516 u64 gvaddr, gfn_t gfn, struct kvm_book3e_206_tlb_entry *gtlbe,
527517 struct kvm_book3e_206_tlb_entry *stlbe, int esel)
528518 {
529− struct tlbe_ref ref;
519+ struct tlbe_ref *ref = &vcpu_e500->gtlb_priv[1][esel].ref;
530520 int sesel;
531521 int r;
532522
533− ref.flags = 0;
534523 r = kvmppc_e500_shadow_map(vcpu_e500, gvaddr, gfn, gtlbe, 1, stlbe,
535− &ref);
524+ ref);
536525 if (r)
537526 return r;
538527
@@ -544,7 +533,7 @@ static int kvmppc_e500_tlb1_map(struct kvmppc_vcpu_e500 *vcpu_e500, · 5 unmodified lines
544533 }
545534
546535 /* Otherwise map into TLB1 */
547− sesel = kvmppc_e500_tlb1_map_tlb1(vcpu_e500, &ref, esel);
536+ sesel = kvmppc_e500_tlb1_map_tlb1(vcpu_e500, ref, esel);
548537 write_stlbe(vcpu_e500, gtlbe, stlbe, 1, sesel);
549538
550539 return 0;
@@ -565,7 +554,7 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr, · 14 unmodified lines
565554 case 0:
566555 priv = &vcpu_e500->gtlb_priv[tlbsel][esel];
567556
568− /* Triggers after clear_tlb_refs or on initial mapping */
557+ /* Triggers after clear_tlb_privs or on initial mapping */
569558 if (!(priv->ref.flags & E500_TLB_VALID)) {
570559 kvmppc_e500_tlb0_map(vcpu_e500, esel, &stlbe);
571560 } else {
@@ -665,35 +654,16 @@ int e500_mmu_host_init(struct kvmppc_vcpu_e500 *vcpu_e500) · 93 unmodified lines
665654 host_tlb_params[0].entries / host_tlb_params[0].ways;
666655 host_tlb_params[1].sets = 1;
667656
668− vcpu_e500->tlb_refs[0] =
669− kzalloc(sizeof(struct tlbe_ref) * host_tlb_params[0].entries,
670− GFP_KERNEL);
671− if (!vcpu_e500->tlb_refs[0])
672− goto err;
673−
674− vcpu_e500->tlb_refs[1] =
675− kzalloc(sizeof(struct tlbe_ref) * host_tlb_params[1].entries,
676− GFP_KERNEL);
677− if (!vcpu_e500->tlb_refs[1])
678− goto err;
679−
680657 vcpu_e500->h2g_tlb1_rmap = kzalloc(sizeof(unsigned int) *
681658 host_tlb_params[1].entries,
682659 GFP_KERNEL);
683660 if (!vcpu_e500->h2g_tlb1_rmap)
684− goto err;
661+ return -EINVAL;
685662
686663 return 0;
687−
688−err:
689− kfree(vcpu_e500->tlb_refs[0]);
690− kfree(vcpu_e500->tlb_refs[1]);
691− return -EINVAL;
692664 }
693665
694666 void e500_mmu_host_uninit(struct kvmppc_vcpu_e500 *vcpu_e500)
695667 {
696668 kfree(vcpu_e500->h2g_tlb1_rmap);
697− kfree(vcpu_e500->tlb_refs[0]);
698− kfree(vcpu_e500->tlb_refs[1]);
699669 }
arch/powerpc/kvm/e500mc.c+6−1
@@ -108,6 +108,8 @@ void kvmppc_mmu_msr_notify(struct kvm_vcpu *vcpu, u32 old_msr) · 107 unmodified lines
108108 {
109109 }
110110
111+static DEFINE_PER_CPU(struct kvm_vcpu *, last_vcpu_on_cpu);
112+
111113 void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
112114 {
113115 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
@@ -136,8 +138,11 @@ void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu) · 22 unmodified lines
136138 mtspr(SPRN_GDEAR, vcpu->arch.shared->dar);
137139 mtspr(SPRN_GESR, vcpu->arch.shared->esr);
138140
139− if (vcpu->arch.oldpir != mfspr(SPRN_PIR))
141+ if (vcpu->arch.oldpir != mfspr(SPRN_PIR) ||
142+ __get_cpu_var(last_vcpu_on_cpu) != vcpu) {
140143 kvmppc_e500_tlbil_all(vcpu_e500);
144+ __get_cpu_var(last_vcpu_on_cpu) = vcpu;
145+ }
141146
142147 kvmppc_load_guest_fp(vcpu);
143148 }
arch/powerpc/platforms/pseries/lpar.c+7−1
@@ -186,7 +186,13 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group) · 185 unmodified lines
186186 (0x1UL << 4), &dummy1, &dummy2);
187187 if (lpar_rc == H_SUCCESS)
188188 return i;
189− BUG_ON(lpar_rc != H_NOT_FOUND);
189+
190+ /*
191+ * The test for adjunct partition is performed before the
192+ * ANDCOND test. H_RESOURCE may be returned, so we need to
193+ * check for that as well.
194+ */
195+ BUG_ON(lpar_rc != H_NOT_FOUND && lpar_rc != H_RESOURCE);
190196
191197 slot_offset++;
192198 slot_offset &= 0x7;
arch/s390/include/asm/io.h+0−4
@@ -50,10 +50,6 @@ void unxlate_dev_mem_ptr(unsigned long phys, void *addr); · 49 unmodified lines
5050 #define ioremap_nocache(addr, size) ioremap(addr, size)
5151 #define ioremap_wc ioremap_nocache
5252
53−/* TODO: s390 cannot support io_remap_pfn_range... */
54−#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
55− remap_pfn_range(vma, vaddr, pfn, size, prot)
56−
5753 static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
5854 {
5955 return (void __iomem *) offset;
arch/s390/include/asm/pgtable.h+4−0
@@ -57,6 +57,10 @@ extern unsigned long zero_page_mask; · 56 unmodified lines
5757 (((unsigned long)(vaddr)) &zero_page_mask))))
5858 #define __HAVE_COLOR_ZERO_PAGE
5959
60+/* TODO: s390 cannot support io_remap_pfn_range... */
61+#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
62+ remap_pfn_range(vma, vaddr, pfn, size, prot)
63+
6064 #endif /* !__ASSEMBLY__ */
6165
6266 /*
arch/sparc/include/asm/Kbuild+5−0
@@ -2,11 +2,16 @@ · 1 unmodified line
22
33
44 generic-y += clkdev.h
5+generic-y += cputime.h
56 generic-y += div64.h
7+generic-y += emergency-restart.h
68 generic-y += exec.h
79 generic-y += local64.h
10+generic-y += mutex.h
811 generic-y += irq_regs.h
912 generic-y += local.h
1013 generic-y += module.h
14+generic-y += serial.h
1115 generic-y += trace_clock.h
16+generic-y += types.h
1217 generic-y += word-at-a-time.h
arch/sparc/include/asm/cputime.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __SPARC_CPUTIME_H
2−#define __SPARC_CPUTIME_H
3−
4−#include <asm-generic/cputime.h>
5−
6−#endif /* __SPARC_CPUTIME_H */
arch/sparc/include/asm/emergency-restart.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef _ASM_EMERGENCY_RESTART_H
2−#define _ASM_EMERGENCY_RESTART_H
3−
4−#include <asm-generic/emergency-restart.h>
5−
6−#endif /* _ASM_EMERGENCY_RESTART_H */
arch/sparc/include/asm/mutex.h+0−9
@@ -1,9 +0,0 @@
1−/*
2− * Pull in the generic implementation for the mutex fastpath.
3− *
4− * TODO: implement optimized primitives instead, or leave the generic
5− * implementation in place, or pick the atomic_xchg() based generic
6− * implementation. (see asm-generic/mutex-xchg.h for details)
7− */
8−
9−#include <asm-generic/mutex-dec.h>
arch/sparc/include/asm/pgtable_64.h+1−0
@@ -915,6 +915,7 @@ static inline int io_remap_pfn_range(struct vm_area_struct *vma, · 914 unmodified lines
915915 return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot);
916916 }
917917
918+#include <asm/tlbflush.h>
918919 #include <asm-generic/pgtable.h>
919920
920921 /* We provide our own get_unmapped_area to cope with VA holes and
arch/sparc/include/asm/serial.h+0−6
@@ -1,6 +0,0 @@
1−#ifndef __SPARC_SERIAL_H
2−#define __SPARC_SERIAL_H
3−
4−#define BASE_BAUD ( 1843200 / 16 )
5−
6−#endif /* __SPARC_SERIAL_H */
arch/sparc/include/asm/smp_32.h+0−5
@@ -36,7 +36,6 @@ typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long, · 35 unmodified lines
3636 unsigned long, unsigned long);
3737
3838 void cpu_panic(void);
39−extern void smp4m_irq_rotate(int cpu);
4039
4140 /*
4241 * General functions that each host system must provide.
@@ -46,7 +45,6 @@ void sun4m_init_smp(void); · 3 unmodified lines
4645 void sun4d_init_smp(void);
4746
4847 void smp_callin(void);
49−void smp_boot_cpus(void);
5048 void smp_store_cpu_info(int);
5149
5250 void smp_resched_interrupt(void);
@@ -107,9 +105,6 @@ extern int hard_smp_processor_id(void); · 54 unmodified lines
107105
108106 #define raw_smp_processor_id() (current_thread_info()->cpu)
109107
110−#define prof_multiplier(__cpu) cpu_data(__cpu).multiplier
111−#define prof_counter(__cpu) cpu_data(__cpu).counter
112−
113108 void smp_setup_cpu_possible_map(void);
114109
115110 #endif /* !(__ASSEMBLY__) */
arch/sparc/include/asm/switch_to_64.h+1−2
@@ -18,8 +18,7 @@ do { \ · 17 unmodified lines
1818 * and 2 stores in this critical code path. -DaveM
1919 */
2020 #define switch_to(prev, next, last) \
21−do { flush_tlb_pending(); \
22− save_and_clear_fpu(); \
21+do { save_and_clear_fpu(); \
2322 /* If you are tempted to conditionalize the following */ \
2423 /* so that ASI is only written if it changes, think again. */ \
2524 __asm__ __volatile__("wr %%g0, %0, %%asi" \
arch/sparc/include/asm/tlbflush_64.h+31−6
@@ -11,24 +11,40 @@ · 10 unmodified lines
1111 struct tlb_batch {
1212 struct mm_struct *mm;
1313 unsigned long tlb_nr;
14+ unsigned long active;
1415 unsigned long vaddrs[TLB_BATCH_NR];
1516 };
1617
1718 extern void flush_tsb_kernel_range(unsigned long start, unsigned long end);
1819 extern void flush_tsb_user(struct tlb_batch *tb);
20+extern void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr);
1921
2022 /* TLB flush operations. */
2123
22−extern void flush_tlb_pending(void);
24+static inline void flush_tlb_mm(struct mm_struct *mm)
25+{
26+}
27+
28+static inline void flush_tlb_page(struct vm_area_struct *vma,
29+ unsigned long vmaddr)
30+{
31+}
32+
33+static inline void flush_tlb_range(struct vm_area_struct *vma,
34+ unsigned long start, unsigned long end)
35+{
36+}
37+
38+#define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
2339
24−#define flush_tlb_range(vma,start,end) \
25− do { (void)(start); flush_tlb_pending(); } while (0)
26−#define flush_tlb_page(vma,addr) flush_tlb_pending()
27−#define flush_tlb_mm(mm) flush_tlb_pending()
40+extern void flush_tlb_pending(void);
41+extern void arch_enter_lazy_mmu_mode(void);
42+extern void arch_leave_lazy_mmu_mode(void);
43+#define arch_flush_lazy_mmu_mode() do {} while (0)
2844
2945 /* Local cpu only. */
3046 extern void __flush_tlb_all(void);
31−
47+extern void __flush_tlb_page(unsigned long context, unsigned long vaddr);
3248 extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
3349
3450 #ifndef CONFIG_SMP
@@ -38,15 +54,24 @@ do { flush_tsb_kernel_range(start,end); \ · 3 unmodified lines
3854 __flush_tlb_kernel_range(start,end); \
3955 } while (0)
4056
57+static inline void global_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
58+{
59+ __flush_tlb_page(CTX_HWBITS(mm->context), vaddr);
60+}
61+
4162 #else /* CONFIG_SMP */
4263
4364 extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end);
65+extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr);
4466
4567 #define flush_tlb_kernel_range(start, end) \
4668 do { flush_tsb_kernel_range(start,end); \
4769 smp_flush_tlb_kernel_range(start, end); \
4870 } while (0)
4971
72+#define global_flush_tlb_page(mm, vaddr) \
73+ smp_flush_tlb_page(mm, vaddr)
74+
5075 #endif /* ! CONFIG_SMP */
5176
5277 #endif /* _SPARC64_TLBFLUSH_H */
arch/sparc/include/uapi/asm/Kbuild+0−1
@@ -44,7 +44,6 @@ header-y += swab.h · 43 unmodified lines
4444 header-y += termbits.h
4545 header-y += termios.h
4646 header-y += traps.h
47−header-y += types.h
4847 header-y += uctx.h
4948 header-y += unistd.h
5049 header-y += utrap.h
arch/sparc/include/uapi/asm/types.h+0−17
@@ -1,17 +0,0 @@
1−#ifndef _SPARC_TYPES_H
2−#define _SPARC_TYPES_H
3−/*
4− * This file is never included by application software unless
5− * explicitly requested (e.g., via linux/types.h) in which case the
6− * application is Linux specific so (user-) name space pollution is
7− * not a major issue. However, for interoperability, libraries still
8− * need to be careful to avoid a name clashes.
9− */
10−
11−#if defined(__sparc__)
12−
13−#include <asm-generic/int-ll64.h>
14−
15−#endif /* defined(__sparc__) */
16−
17−#endif /* defined(_SPARC_TYPES_H) */
arch/sparc/kernel/smp_64.c+37−4
@@ -849,7 +849,7 @@ void smp_tsb_sync(struct mm_struct *mm) · 848 unmodified lines
849849 }
850850
851851 extern unsigned long xcall_flush_tlb_mm;
852−extern unsigned long xcall_flush_tlb_pending;
852+extern unsigned long xcall_flush_tlb_page;
853853 extern unsigned long xcall_flush_tlb_kernel_range;
854854 extern unsigned long xcall_fetch_glob_regs;
855855 extern unsigned long xcall_fetch_glob_pmu;
@@ -1074,23 +1074,56 @@ local_flush_and_out: · 218 unmodified lines
10741074 put_cpu();
10751075 }
10761076
1077+struct tlb_pending_info {
1078+ unsigned long ctx;
1079+ unsigned long nr;
1080+ unsigned long *vaddrs;
1081+};
1082+
1083+static void tlb_pending_func(void *info)
1084+{
1085+ struct tlb_pending_info *t = info;
1086+
1087+ __flush_tlb_pending(t->ctx, t->nr, t->vaddrs);
1088+}
1089+
10771090 void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long *vaddrs)
10781091 {
10791092 u32 ctx = CTX_HWBITS(mm->context);
1093+ struct tlb_pending_info info;
10801094 int cpu = get_cpu();
10811095
1096+ info.ctx = ctx;
1097+ info.nr = nr;
1098+ info.vaddrs = vaddrs;
1099+
10821100 if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
10831101 cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
10841102 else
1085− smp_cross_call_masked(&xcall_flush_tlb_pending,
1086− ctx, nr, (unsigned long) vaddrs,
1087− mm_cpumask(mm));
1103+ smp_call_function_many(mm_cpumask(mm), tlb_pending_func,
1104+ &info, 1);
10881105
10891106 __flush_tlb_pending(ctx, nr, vaddrs);
10901107
10911108 put_cpu();
10921109 }
10931110
1111+void smp_flush_tlb_page(struct mm_struct *mm, unsigned long vaddr)
1112+{
1113+ unsigned long context = CTX_HWBITS(mm->context);
1114+ int cpu = get_cpu();
1115+
1116+ if (mm == current->mm && atomic_read(&mm->mm_users) == 1)
1117+ cpumask_copy(mm_cpumask(mm), cpumask_of(cpu));
1118+ else
1119+ smp_cross_call_masked(&xcall_flush_tlb_page,
1120+ context, vaddr, 0,
1121+ mm_cpumask(mm));
1122+ __flush_tlb_page(context, vaddr);
1123+
1124+ put_cpu();
1125+}
1126+
10941127 void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end)
10951128 {
10961129 start &= PAGE_MASK;
arch/sparc/lib/bitext.c+1−5
@@ -119,11 +119,7 @@ void bit_map_clear(struct bit_map *t, int offset, int len) · 118 unmodified lines
119119
120120 void bit_map_init(struct bit_map *t, unsigned long *map, int size)
121121 {
122−
123− if ((size & 07) != 0)
124− BUG();
125− memset(map, 0, size>>3);
126−
122+ bitmap_zero(map, size);
127123 memset(t, 0, sizeof *t);
128124 spin_lock_init(&t->lock);
129125 t->map = map;
arch/sparc/mm/iommu.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #define IOMMU_RNGE IOMMU_RNGE_256MB
3535 #define IOMMU_START 0xF0000000
3636 #define IOMMU_WINSIZE (256*1024*1024U)
37−#define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 265KB */
37+#define IOMMU_NPTES (IOMMU_WINSIZE/PAGE_SIZE) /* 64K PTEs, 256KB */
3838 #define IOMMU_ORDER 6 /* 4096 * (1<<6) */
3939
4040 /* srmmu.c */
arch/sparc/mm/srmmu.c+3−1
@@ -280,7 +280,9 @@ static void __init srmmu_nocache_init(void) · 279 unmodified lines
280280 SRMMU_NOCACHE_ALIGN_MAX, 0UL);
281281 memset(srmmu_nocache_pool, 0, srmmu_nocache_size);
282282
283− srmmu_nocache_bitmap = __alloc_bootmem(bitmap_bits >> 3, SMP_CACHE_BYTES, 0UL);
283+ srmmu_nocache_bitmap =
284+ __alloc_bootmem(BITS_TO_LONGS(bitmap_bits) * sizeof(long),
285+ SMP_CACHE_BYTES, 0UL);
284286 bit_map_init(&srmmu_nocache_map, srmmu_nocache_bitmap, bitmap_bits);
285287
286288 srmmu_swapper_pg_dir = __srmmu_get_nocache(SRMMU_PGD_TABLE_SIZE, SRMMU_PGD_TABLE_SIZE);
arch/sparc/mm/tlb.c+34−4
@@ -24,11 +24,17 @@ static DEFINE_PER_CPU(struct tlb_batch, tlb_batch); · 23 unmodified lines
2424 void flush_tlb_pending(void)
2525 {
2626 struct tlb_batch *tb = &get_cpu_var(tlb_batch);
27+ struct mm_struct *mm = tb->mm;
2728
28− if (tb->tlb_nr) {
29− flush_tsb_user(tb);
29+ if (!tb->tlb_nr)
30+ goto out;
3031
31− if (CTX_VALID(tb->mm->context)) {
32+ flush_tsb_user(tb);
33+
34+ if (CTX_VALID(mm->context)) {
35+ if (tb->tlb_nr == 1) {
36+ global_flush_tlb_page(mm, tb->vaddrs[0]);
37+ } else {
3238 #ifdef CONFIG_SMP
3339 smp_flush_tlb_pending(tb->mm, tb->tlb_nr,
3440 &tb->vaddrs[0]);
@@ -37,12 +43,30 @@ void flush_tlb_pending(void) · 2 unmodified lines
3743 tb->tlb_nr, &tb->vaddrs[0]);
3844 #endif
3945 }
40− tb->tlb_nr = 0;
4146 }
4247
48+ tb->tlb_nr = 0;
49+
50+out:
4351 put_cpu_var(tlb_batch);
4452 }
4553
54+void arch_enter_lazy_mmu_mode(void)
55+{
56+ struct tlb_batch *tb = &__get_cpu_var(tlb_batch);
57+
58+ tb->active = 1;
59+}
60+
61+void arch_leave_lazy_mmu_mode(void)
62+{
63+ struct tlb_batch *tb = &__get_cpu_var(tlb_batch);
64+
65+ if (tb->tlb_nr)
66+ flush_tlb_pending();
67+ tb->active = 0;
68+}
69+
4670 static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr,
4771 bool exec)
4872 {
@@ -60,6 +84,12 @@ static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr, · 11 unmodified lines
6084 nr = 0;
6185 }
6286
87+ if (!tb->active) {
88+ global_flush_tlb_page(mm, vaddr);
89+ flush_tsb_user_page(mm, vaddr);
90+ return;
91+ }
92+
6393 if (nr == 0)
6494 tb->mm = mm;
6595
arch/sparc/mm/tsb.c+42−15
@@ -7,11 +7,10 @@ · 6 unmodified lines
77 #include <linux/preempt.h>
88 #include <linux/slab.h>
99 #include <asm/page.h>
10−#include <asm/tlbflush.h>
11−#include <asm/tlb.h>
12−#include <asm/mmu_context.h>
1310 #include <asm/pgtable.h>
11+#include <asm/mmu_context.h>
1412 #include <asm/tsb.h>
13+#include <asm/tlb.h>
1514 #include <asm/oplib.h>
1615
1716 extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES];
@@ -46,23 +45,27 @@ void flush_tsb_kernel_range(unsigned long start, unsigned long end) · 28 unmodified lines
4645 }
4746 }
4847
49−static void __flush_tsb_one(struct tlb_batch *tb, unsigned long hash_shift,
50− unsigned long tsb, unsigned long nentries)
48+static void __flush_tsb_one_entry(unsigned long tsb, unsigned long v,
49+ unsigned long hash_shift,
50+ unsigned long nentries)
5151 {
52− unsigned long i;
52+ unsigned long tag, ent, hash;
5353
54− for (i = 0; i < tb->tlb_nr; i++) {
55− unsigned long v = tb->vaddrs[i];
56− unsigned long tag, ent, hash;
54+ v &= ~0x1UL;
55+ hash = tsb_hash(v, hash_shift, nentries);
56+ ent = tsb + (hash * sizeof(struct tsb));
57+ tag = (v >> 22UL);
5758
58− v &= ~0x1UL;
59+ tsb_flush(ent, tag);
60+}
5961
60− hash = tsb_hash(v, hash_shift, nentries);
61− ent = tsb + (hash * sizeof(struct tsb));
62− tag = (v >> 22UL);
62+static void __flush_tsb_one(struct tlb_batch *tb, unsigned long hash_shift,
63+ unsigned long tsb, unsigned long nentries)
64+{
65+ unsigned long i;
6366
64− tsb_flush(ent, tag);
65− }
67+ for (i = 0; i < tb->tlb_nr; i++)
68+ __flush_tsb_one_entry(tsb, tb->vaddrs[i], hash_shift, nentries);
6669 }
6770
6871 void flush_tsb_user(struct tlb_batch *tb)
@@ -90,6 +93,30 @@ void flush_tsb_user(struct tlb_batch *tb) · 21 unmodified lines
9093 spin_unlock_irqrestore(&mm->context.lock, flags);
9194 }
9295
96+void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr)
97+{
98+ unsigned long nentries, base, flags;
99+
100+ spin_lock_irqsave(&mm->context.lock, flags);
101+
102+ base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb;
103+ nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries;
104+ if (tlb_type == cheetah_plus || tlb_type == hypervisor)
105+ base = __pa(base);
106+ __flush_tsb_one_entry(base, vaddr, PAGE_SHIFT, nentries);
107+
108+#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
109+ if (mm->context.tsb_block[MM_TSB_HUGE].tsb) {
110+ base = (unsigned long) mm->context.tsb_block[MM_TSB_HUGE].tsb;
111+ nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries;
112+ if (tlb_type == cheetah_plus || tlb_type == hypervisor)
113+ base = __pa(base);
114+ __flush_tsb_one_entry(base, vaddr, HPAGE_SHIFT, nentries);
115+ }
116+#endif
117+ spin_unlock_irqrestore(&mm->context.lock, flags);
118+}
119+
93120 #define HV_PGSZ_IDX_BASE HV_PGSZ_IDX_8K
94121 #define HV_PGSZ_MASK_BASE HV_PGSZ_MASK_8K
95122
arch/sparc/mm/ultra.S+95−24
@@ -52,6 +52,33 @@ __flush_tlb_mm: /* 18 insns */ · 51 unmodified lines
5252 nop
5353 nop
5454
55+ .align 32
56+ .globl __flush_tlb_page
57+__flush_tlb_page: /* 22 insns */
58+ /* %o0 = context, %o1 = vaddr */
59+ rdpr %pstate, %g7
60+ andn %g7, PSTATE_IE, %g2
61+ wrpr %g2, %pstate
62+ mov SECONDARY_CONTEXT, %o4
63+ ldxa [%o4] ASI_DMMU, %g2
64+ stxa %o0, [%o4] ASI_DMMU
65+ andcc %o1, 1, %g0
66+ andn %o1, 1, %o3
67+ be,pn %icc, 1f
68+ or %o3, 0x10, %o3
69+ stxa %g0, [%o3] ASI_IMMU_DEMAP
70+1: stxa %g0, [%o3] ASI_DMMU_DEMAP
71+ membar #Sync
72+ stxa %g2, [%o4] ASI_DMMU
73+ sethi %hi(KERNBASE), %o4
74+ flush %o4
75+ retl
76+ wrpr %g7, 0x0, %pstate
77+ nop
78+ nop
79+ nop
80+ nop
81+
5582 .align 32
5683 .globl __flush_tlb_pending
5784 __flush_tlb_pending: /* 26 insns */
@@ -203,6 +230,31 @@ __cheetah_flush_tlb_mm: /* 19 insns */ · 145 unmodified lines
203230 retl
204231 wrpr %g7, 0x0, %pstate
205232
233+__cheetah_flush_tlb_page: /* 22 insns */
234+ /* %o0 = context, %o1 = vaddr */
235+ rdpr %pstate, %g7
236+ andn %g7, PSTATE_IE, %g2
237+ wrpr %g2, 0x0, %pstate
238+ wrpr %g0, 1, %tl
239+ mov PRIMARY_CONTEXT, %o4
240+ ldxa [%o4] ASI_DMMU, %g2
241+ srlx %g2, CTX_PGSZ1_NUC_SHIFT, %o3
242+ sllx %o3, CTX_PGSZ1_NUC_SHIFT, %o3
243+ or %o0, %o3, %o0 /* Preserve nucleus page size fields */
244+ stxa %o0, [%o4] ASI_DMMU
245+ andcc %o1, 1, %g0
246+ be,pn %icc, 1f
247+ andn %o1, 1, %o3
248+ stxa %g0, [%o3] ASI_IMMU_DEMAP
249+1: stxa %g0, [%o3] ASI_DMMU_DEMAP
250+ membar #Sync
251+ stxa %g2, [%o4] ASI_DMMU
252+ sethi %hi(KERNBASE), %o4
253+ flush %o4
254+ wrpr %g0, 0, %tl
255+ retl
256+ wrpr %g7, 0x0, %pstate
257+
206258 __cheetah_flush_tlb_pending: /* 27 insns */
207259 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
208260 rdpr %pstate, %g7
@@ -269,6 +321,20 @@ __hypervisor_flush_tlb_mm: /* 10 insns */ · 60 unmodified lines
269321 retl
270322 nop
271323
324+__hypervisor_flush_tlb_page: /* 11 insns */
325+ /* %o0 = context, %o1 = vaddr */
326+ mov %o0, %g2
327+ mov %o1, %o0 /* ARG0: vaddr + IMMU-bit */
328+ mov %g2, %o1 /* ARG1: mmu context */
329+ mov HV_MMU_ALL, %o2 /* ARG2: flags */
330+ srlx %o0, PAGE_SHIFT, %o0
331+ sllx %o0, PAGE_SHIFT, %o0
332+ ta HV_MMU_UNMAP_ADDR_TRAP
333+ brnz,pn %o0, __hypervisor_tlb_tl0_error
334+ mov HV_MMU_UNMAP_ADDR_TRAP, %o1
335+ retl
336+ nop
337+
272338 __hypervisor_flush_tlb_pending: /* 16 insns */
273339 /* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
274340 sllx %o1, 3, %g1
@@ -339,6 +405,13 @@ cheetah_patch_cachetlbops: · 64 unmodified lines
339405 call tlb_patch_one
340406 mov 19, %o2
341407
408+ sethi %hi(__flush_tlb_page), %o0
409+ or %o0, %lo(__flush_tlb_page), %o0
410+ sethi %hi(__cheetah_flush_tlb_page), %o1
411+ or %o1, %lo(__cheetah_flush_tlb_page), %o1
412+ call tlb_patch_one
413+ mov 22, %o2
414+
342415 sethi %hi(__flush_tlb_pending), %o0
343416 or %o0, %lo(__flush_tlb_pending), %o0
344417 sethi %hi(__cheetah_flush_tlb_pending), %o1
@@ -397,10 +470,9 @@ xcall_flush_tlb_mm: /* 21 insns */ · 52 unmodified lines
397470 nop
398471 nop
399472
400− .globl xcall_flush_tlb_pending
401−xcall_flush_tlb_pending: /* 21 insns */
402− /* %g5=context, %g1=nr, %g7=vaddrs[] */
403− sllx %g1, 3, %g1
473+ .globl xcall_flush_tlb_page
474+xcall_flush_tlb_page: /* 17 insns */
475+ /* %g5=context, %g1=vaddr */
404476 mov PRIMARY_CONTEXT, %g4
405477 ldxa [%g4] ASI_DMMU, %g2
406478 srlx %g2, CTX_PGSZ1_NUC_SHIFT, %g4
@@ -408,20 +480,16 @@ xcall_flush_tlb_pending: /* 21 insns */ · 1 unmodified line
408480 or %g5, %g4, %g5
409481 mov PRIMARY_CONTEXT, %g4
410482 stxa %g5, [%g4] ASI_DMMU
411−1: sub %g1, (1 << 3), %g1
412− ldx [%g7 + %g1], %g5
413− andcc %g5, 0x1, %g0
483+ andcc %g1, 0x1, %g0
414484 be,pn %icc, 2f
415−
416− andn %g5, 0x1, %g5
485+ andn %g1, 0x1, %g5
417486 stxa %g0, [%g5] ASI_IMMU_DEMAP
418487 2: stxa %g0, [%g5] ASI_DMMU_DEMAP
419488 membar #Sync
420− brnz,pt %g1, 1b
421− nop
422489 stxa %g2, [%g4] ASI_DMMU
423490 retry
424491 nop
492+ nop
425493
426494 .globl xcall_flush_tlb_kernel_range
427495 xcall_flush_tlb_kernel_range: /* 25 insns */
@@ -656,15 +724,13 @@ __hypervisor_xcall_flush_tlb_mm: /* 21 insns */ · 228 unmodified lines
656724 membar #Sync
657725 retry
658726
659− .globl __hypervisor_xcall_flush_tlb_pending
660−__hypervisor_xcall_flush_tlb_pending: /* 21 insns */
661− /* %g5=ctx, %g1=nr, %g7=vaddrs[], %g2,%g3,%g4,g6=scratch */
662− sllx %g1, 3, %g1
727+ .globl __hypervisor_xcall_flush_tlb_page
728+__hypervisor_xcall_flush_tlb_page: /* 17 insns */
729+ /* %g5=ctx, %g1=vaddr */
663730 mov %o0, %g2
664731 mov %o1, %g3
665732 mov %o2, %g4
666−1: sub %g1, (1 << 3), %g1
667− ldx [%g7 + %g1], %o0 /* ARG0: virtual address */
733+ mov %g1, %o0 /* ARG0: virtual address */
668734 mov %g5, %o1 /* ARG1: mmu context */
669735 mov HV_MMU_ALL, %o2 /* ARG2: flags */
670736 srlx %o0, PAGE_SHIFT, %o0
@@ -673,8 +739,6 @@ __hypervisor_xcall_flush_tlb_pending: /* 21 insns */ · 2 unmodified lines
673739 mov HV_MMU_UNMAP_ADDR_TRAP, %g6
674740 brnz,a,pn %o0, __hypervisor_tlb_xcall_error
675741 mov %o0, %g5
676− brnz,pt %g1, 1b
677− nop
678742 mov %g2, %o0
679743 mov %g3, %o1
680744 mov %g4, %o2
@@ -757,6 +821,13 @@ hypervisor_patch_cachetlbops: · 76 unmodified lines
757821 call tlb_patch_one
758822 mov 10, %o2
759823
824+ sethi %hi(__flush_tlb_page), %o0
825+ or %o0, %lo(__flush_tlb_page), %o0
826+ sethi %hi(__hypervisor_flush_tlb_page), %o1
827+ or %o1, %lo(__hypervisor_flush_tlb_page), %o1
828+ call tlb_patch_one
829+ mov 11, %o2
830+
760831 sethi %hi(__flush_tlb_pending), %o0
761832 or %o0, %lo(__flush_tlb_pending), %o0
762833 sethi %hi(__hypervisor_flush_tlb_pending), %o1
@@ -788,12 +859,12 @@ hypervisor_patch_cachetlbops: · 25 unmodified lines
788859 call tlb_patch_one
789860 mov 21, %o2
790861
791− sethi %hi(xcall_flush_tlb_pending), %o0
792− or %o0, %lo(xcall_flush_tlb_pending), %o0
793− sethi %hi(__hypervisor_xcall_flush_tlb_pending), %o1
794− or %o1, %lo(__hypervisor_xcall_flush_tlb_pending), %o1
862+ sethi %hi(xcall_flush_tlb_page), %o0
863+ or %o0, %lo(xcall_flush_tlb_page), %o0
864+ sethi %hi(__hypervisor_xcall_flush_tlb_page), %o1
865+ or %o1, %lo(__hypervisor_xcall_flush_tlb_page), %o1
795866 call tlb_patch_one
796− mov 21, %o2
867+ mov 17, %o2
797868
798869 sethi %hi(xcall_flush_tlb_kernel_range), %o0
799870 or %o0, %lo(xcall_flush_tlb_kernel_range), %o0
arch/tile/include/asm/irqflags.h+9−1
@@ -40,7 +40,15 @@ · 39 unmodified lines
4040 #include <asm/percpu.h>
4141 #include <arch/spr_def.h>
4242
43−/* Set and clear kernel interrupt masks. */
43+/*
44+ * Set and clear kernel interrupt masks.
45+ *
46+ * NOTE: __insn_mtspr() is a compiler builtin marked as a memory
47+ * clobber. We rely on it being equivalent to a compiler barrier in
48+ * this code since arch_local_irq_save() and friends must act as
49+ * compiler barriers. This compiler semantic is baked into enough
50+ * places that the compiler will maintain it going forward.
51+ */
4452 #if CHIP_HAS_SPLIT_INTR_MASK()
4553 #if INT_PERF_COUNT < 32 || INT_AUX_PERF_COUNT < 32 || INT_MEM_ERROR >= 32
4654 # error Fix assumptions about which word various interrupts are in
arch/x86/Kconfig+1−0
@@ -1549,6 +1549,7 @@ config X86_SMAP · 1548 unmodified lines
15491549 config EFI
15501550 bool "EFI runtime service support"
15511551 depends on ACPI
1552+ select UCS2_STRING
15521553 ---help---
15531554 This enables the kernel to use EFI runtime services that are
15541555 available (such as the EFI variable services).
arch/x86/boot/compressed/Makefile+2−3
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 # create a compressed vmlinux image from the original vmlinux
55 #
66
7−targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o
7+targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo
88
99 KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
1010 KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
@@ -29,7 +29,6 @@ VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ · 18 unmodified lines
2929 $(obj)/piggy.o
3030
3131 $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
32−$(obj)/efi_stub_$(BITS).o: KBUILD_CLFAGS += -fshort-wchar -mno-red-zone
3332
3433 ifeq ($(CONFIG_EFI_STUB), y)
3534 VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o
@@ -43,7 +42,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment -S · 7 unmodified lines
4342 $(obj)/vmlinux.bin: vmlinux FORCE
4443 $(call if_changed,objcopy)
4544
46−targets += vmlinux.bin.all vmlinux.relocs
45+targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs
4746
4847 CMD_RELOCS = arch/x86/tools/relocs
4948 quiet_cmd_relocs = RELOCS $@
arch/x86/boot/compressed/eboot.c+47−0
@@ -251,6 +251,51 @@ static void find_bits(unsigned long mask, u8 *pos, u8 *size) · 250 unmodified lines
251251 *size = len;
252252 }
253253
254+static efi_status_t setup_efi_vars(struct boot_params *params)
255+{
256+ struct setup_data *data;
257+ struct efi_var_bootdata *efidata;
258+ u64 store_size, remaining_size, var_size;
259+ efi_status_t status;
260+
261+ if (!sys_table->runtime->query_variable_info)
262+ return EFI_UNSUPPORTED;
263+
264+ data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
265+
266+ while (data && data->next)
267+ data = (struct setup_data *)(unsigned long)data->next;
268+
269+ status = efi_call_phys4(sys_table->runtime->query_variable_info,
270+ EFI_VARIABLE_NON_VOLATILE |
271+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
272+ EFI_VARIABLE_RUNTIME_ACCESS, &store_size,
273+ &remaining_size, &var_size);
274+
275+ if (status != EFI_SUCCESS)
276+ return status;
277+
278+ status = efi_call_phys3(sys_table->boottime->allocate_pool,
279+ EFI_LOADER_DATA, sizeof(*efidata), &efidata);
280+
281+ if (status != EFI_SUCCESS)
282+ return status;
283+
284+ efidata->data.type = SETUP_EFI_VARS;
285+ efidata->data.len = sizeof(struct efi_var_bootdata) -
286+ sizeof(struct setup_data);
287+ efidata->data.next = 0;
288+ efidata->store_size = store_size;
289+ efidata->remaining_size = remaining_size;
290+ efidata->max_var_size = var_size;
291+
292+ if (data)
293+ data->next = (unsigned long)efidata;
294+ else
295+ params->hdr.setup_data = (unsigned long)efidata;
296+
297+}
298+
254299 static efi_status_t setup_efi_pci(struct boot_params *params)
255300 {
256301 efi_pci_io_protocol *pci;
@@ -1157,6 +1202,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, · 900 unmodified lines
11571202
11581203 setup_graphics(boot_params);
11591204
1205+ setup_efi_vars(boot_params);
1206+
11601207 setup_efi_pci(boot_params);
11611208
11621209 status = efi_call_phys3(sys_table->boottime->allocate_pool,
arch/x86/include/asm/efi.h+7−0
@@ -102,6 +102,13 @@ extern void efi_call_phys_epilog(void); · 101 unmodified lines
102102 extern void efi_unmap_memmap(void);
103103 extern void efi_memory_uc(u64 addr, unsigned long size);
104104
105+struct efi_var_bootdata {
106+ struct setup_data data;
107+ u64 store_size;
108+ u64 remaining_size;
109+ u64 max_var_size;
110+};
111+
105112 #ifdef CONFIG_EFI
106113
107114 static inline bool efi_is_native(void)
arch/x86/include/asm/paravirt.h+4−1
@@ -703,7 +703,10 @@ static inline void arch_leave_lazy_mmu_mode(void) · 702 unmodified lines
703703 PVOP_VCALL0(pv_mmu_ops.lazy_mode.leave);
704704 }
705705
706−void arch_flush_lazy_mmu_mode(void);
706+static inline void arch_flush_lazy_mmu_mode(void)
707+{
708+ PVOP_VCALL0(pv_mmu_ops.lazy_mode.flush);
709+}
707710
708711 static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
709712 phys_addr_t phys, pgprot_t flags)
arch/x86/include/asm/paravirt_types.h+2−0
@@ -91,6 +91,7 @@ struct pv_lazy_ops { · 90 unmodified lines
9191 /* Set deferred update mode, used for batching operations. */
9292 void (*enter)(void);
9393 void (*leave)(void);
94+ void (*flush)(void);
9495 };
9596
9697 struct pv_time_ops {
@@ -679,6 +680,7 @@ void paravirt_end_context_switch(struct task_struct *next); · 582 unmodified lines
679680
680681 void paravirt_enter_lazy_mmu(void);
681682 void paravirt_leave_lazy_mmu(void);
683+void paravirt_flush_lazy_mmu(void);
682684
683685 void _paravirt_nop(void);
684686 u32 _paravirt_ident_32(u32);
arch/x86/include/asm/syscall.h+2−2
@@ -29,13 +29,13 @@ extern const unsigned long sys_call_table[]; · 28 unmodified lines
2929 */
3030 static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
3131 {
32− return regs->orig_ax & __SYSCALL_MASK;
32+ return regs->orig_ax;
3333 }
3434
3535 static inline void syscall_rollback(struct task_struct *task,
3636 struct pt_regs *regs)
3737 {
38− regs->ax = regs->orig_ax & __SYSCALL_MASK;
38+ regs->ax = regs->orig_ax;
3939 }
4040
4141 static inline long syscall_get_error(struct task_struct *task,
arch/x86/include/asm/tlb.h+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77
88 #define tlb_flush(tlb) \
99 { \
10− if (tlb->fullmm == 0) \
10+ if (!tlb->fullmm && !tlb->need_flush_all) \
1111 flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end, 0UL); \
1212 else \
1313 flush_tlb_mm_range(tlb->mm, 0UL, TLB_FLUSH_ALL, 0UL); \
arch/x86/include/uapi/asm/bootparam.h+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 #define SETUP_E820_EXT 1
77 #define SETUP_DTB 2
88 #define SETUP_PCI 3
9+#define SETUP_EFI_VARS 4
910
1011 /* ram_size flags */
1112 #define RAMDISK_IMAGE_START_MASK 0x07FF
arch/x86/kernel/cpu/mshyperv.c+5−13
@@ -35,13 +35,6 @@ static bool __init ms_hyperv_platform(void) · 34 unmodified lines
3535 if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
3636 return false;
3737
38− /*
39− * Xen emulates Hyper-V to support enlightened Windows.
40− * Check to see first if we are on a Xen Hypervisor.
41− */
42− if (xen_cpuid_base())
43− return false;
44−
4538 cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS,
4639 &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]);
4740
@@ -82,12 +75,6 @@ static void __init ms_hyperv_init_platform(void) · 34 unmodified lines
8275
8376 if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE)
8477 clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100);
85−#if IS_ENABLED(CONFIG_HYPERV)
86− /*
87− * Setup the IDT for hypervisor callback.
88− */
89− alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
90−#endif
9178 }
9279
9380 const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
@@ -103,6 +90,11 @@ static irq_handler_t vmbus_isr; · 9 unmodified lines
10390
10491 void hv_register_vmbus_handler(int irq, irq_handler_t handler)
10592 {
93+ /*
94+ * Setup the IDT for hypervisor callback.
95+ */
96+ alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector);
97+
10698 vmbus_irq = irq;
10799 vmbus_isr = handler;
108100 }
arch/x86/kernel/cpu/perf_event_intel.c+16−4
@@ -153,8 +153,14 @@ static struct event_constraint intel_gen_event_constraints[] __read_mostly = · 152 unmodified lines
153153 };
154154
155155 static struct extra_reg intel_snb_extra_regs[] __read_mostly = {
156− INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3fffffffffull, RSP_0),
157− INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3fffffffffull, RSP_1),
156+ INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3f807f8fffull, RSP_0),
157+ INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3f807f8fffull, RSP_1),
158+ EVENT_EXTRA_END
159+};
160+
161+static struct extra_reg intel_snbep_extra_regs[] __read_mostly = {
162+ INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3fffff8fffull, RSP_0),
163+ INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3fffff8fffull, RSP_1),
158164 EVENT_EXTRA_END
159165 };
160166
@@ -2097,7 +2103,10 @@ __init int intel_pmu_init(void) · 1936 unmodified lines
20972103 x86_pmu.event_constraints = intel_snb_event_constraints;
20982104 x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints;
20992105 x86_pmu.pebs_aliases = intel_pebs_aliases_snb;
2100− x86_pmu.extra_regs = intel_snb_extra_regs;
2106+ if (boot_cpu_data.x86_model == 45)
2107+ x86_pmu.extra_regs = intel_snbep_extra_regs;
2108+ else
2109+ x86_pmu.extra_regs = intel_snb_extra_regs;
21012110 /* all extra regs are per-cpu when HT is on */
21022111 x86_pmu.er_flags |= ERF_HAS_RSP_1;
21032112 x86_pmu.er_flags |= ERF_NO_HT_SHARING;
@@ -2123,7 +2132,10 @@ __init int intel_pmu_init(void) · 19 unmodified lines
21232132 x86_pmu.event_constraints = intel_ivb_event_constraints;
21242133 x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints;
21252134 x86_pmu.pebs_aliases = intel_pebs_aliases_snb;
2126− x86_pmu.extra_regs = intel_snb_extra_regs;
2135+ if (boot_cpu_data.x86_model == 62)
2136+ x86_pmu.extra_regs = intel_snbep_extra_regs;
2137+ else
2138+ x86_pmu.extra_regs = intel_snb_extra_regs;
21272139 /* all extra regs are per-cpu when HT is on */
21282140 x86_pmu.er_flags |= ERF_HAS_RSP_1;
21292141 x86_pmu.er_flags |= ERF_NO_HT_SHARING;
arch/x86/kernel/cpu/perf_event_intel_ds.c+2−1
@@ -314,10 +314,11 @@ int intel_pmu_drain_bts_buffer(void) · 313 unmodified lines
314314 if (top <= at)
315315 return 0;
316316
317+ memset(&regs, 0, sizeof(regs));
318+
317319 ds->bts_index = ds->bts_buffer_base;
318320
319321 perf_sample_data_init(&data, 0, event->hw.last_period);
320− regs.ip = 0;
321322
322323 /*
323324 * Prepare a generic sample, i.e. fill in the invariant fields.
arch/x86/kernel/microcode_core_early.c+31−7
@@ -45,9 +45,6 @@ static int __cpuinit x86_vendor(void) · 44 unmodified lines
4545 u32 eax = 0x00000000;
4646 u32 ebx, ecx = 0, edx;
4747
48− if (!have_cpuid_p())
49− return X86_VENDOR_UNKNOWN;
50−
5148 native_cpuid(&eax, &ebx, &ecx, &edx);
5249
5350 if (CPUID_IS(CPUID_INTEL1, CPUID_INTEL2, CPUID_INTEL3, ebx, ecx, edx))
@@ -59,18 +56,45 @@ static int __cpuinit x86_vendor(void) · 5 unmodified lines
5956 return X86_VENDOR_UNKNOWN;
6057 }
6158
59+static int __cpuinit x86_family(void)
60+{
61+ u32 eax = 0x00000001;
62+ u32 ebx, ecx = 0, edx;
63+ int x86;
64+
65+ native_cpuid(&eax, &ebx, &ecx, &edx);
66+
67+ x86 = (eax >> 8) & 0xf;
68+ if (x86 == 15)
69+ x86 += (eax >> 20) & 0xff;
70+
71+ return x86;
72+}
73+
6274 void __init load_ucode_bsp(void)
6375 {
64− int vendor = x86_vendor();
76+ int vendor, x86;
77+
78+ if (!have_cpuid_p())
79+ return;
6580
66− if (vendor == X86_VENDOR_INTEL)
81+ vendor = x86_vendor();
82+ x86 = x86_family();
83+
84+ if (vendor == X86_VENDOR_INTEL && x86 >= 6)
6785 load_ucode_intel_bsp();
6886 }
6987
7088 void __cpuinit load_ucode_ap(void)
7189 {
72− int vendor = x86_vendor();
90+ int vendor, x86;
91+
92+ if (!have_cpuid_p())
93+ return;
94+
95+ vendor = x86_vendor();
96+ x86 = x86_family();
7397
74− if (vendor == X86_VENDOR_INTEL)
98+ if (vendor == X86_VENDOR_INTEL && x86 >= 6)
7599 load_ucode_intel_ap();
76100 }
arch/x86/kernel/paravirt.c+13−12
@@ -263,6 +263,18 @@ void paravirt_leave_lazy_mmu(void) · 262 unmodified lines
263263 leave_lazy(PARAVIRT_LAZY_MMU);
264264 }
265265
266+void paravirt_flush_lazy_mmu(void)
267+{
268+ preempt_disable();
269+
270+ if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
271+ arch_leave_lazy_mmu_mode();
272+ arch_enter_lazy_mmu_mode();
273+ }
274+
275+ preempt_enable();
276+}
277+
266278 void paravirt_start_context_switch(struct task_struct *prev)
267279 {
268280 BUG_ON(preemptible());
@@ -292,18 +304,6 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void) · 23 unmodified lines
292304 return this_cpu_read(paravirt_lazy_mode);
293305 }
294306
295−void arch_flush_lazy_mmu_mode(void)
296−{
297− preempt_disable();
298−
299− if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
300− arch_leave_lazy_mmu_mode();
301− arch_enter_lazy_mmu_mode();
302− }
303−
304− preempt_enable();
305−}
306−
307307 struct pv_info pv_info = {
308308 .name = "bare hardware",
309309 .paravirt_enabled = 0,
@@ -475,6 +475,7 @@ struct pv_mmu_ops pv_mmu_ops = { · 165 unmodified lines
475475 .lazy_mode = {
476476 .enter = paravirt_nop,
477477 .leave = paravirt_nop,
478+ .flush = paravirt_nop,
478479 },
479480
480481 .set_fixmap = native_set_fixmap,
arch/x86/kernel/setup.c+37−8
@@ -507,11 +507,14 @@ static void __init memblock_x86_reserve_range_setup_data(void) · 506 unmodified lines
507507 /*
508508 * Keep the crash kernel below this limit. On 32 bits earlier kernels
509509 * would limit the kernel to the low 512 MiB due to mapping restrictions.
510+ * On 64bit, old kexec-tools need to under 896MiB.
510511 */
511512 #ifdef CONFIG_X86_32
512−# define CRASH_KERNEL_ADDR_MAX (512 << 20)
513+# define CRASH_KERNEL_ADDR_LOW_MAX (512 << 20)
514+# define CRASH_KERNEL_ADDR_HIGH_MAX (512 << 20)
513515 #else
514−# define CRASH_KERNEL_ADDR_MAX MAXMEM
516+# define CRASH_KERNEL_ADDR_LOW_MAX (896UL<<20)
517+# define CRASH_KERNEL_ADDR_HIGH_MAX MAXMEM
515518 #endif
516519
517520 static void __init reserve_crashkernel_low(void)
@@ -521,19 +524,35 @@ static void __init reserve_crashkernel_low(void) · 3 unmodified lines
521524 unsigned long long low_base = 0, low_size = 0;
522525 unsigned long total_low_mem;
523526 unsigned long long base;
527+ bool auto_set = false;
524528 int ret;
525529
526530 total_low_mem = memblock_mem_size(1UL<<(32-PAGE_SHIFT));
531+ /* crashkernel=Y,low */
527532 ret = parse_crashkernel_low(boot_command_line, total_low_mem,
528533 &low_size, &base);
529− if (ret != 0 || low_size <= 0)
530− return;
534+ if (ret != 0) {
535+ /*
536+ * two parts from lib/swiotlb.c:
537+ * swiotlb size: user specified with swiotlb= or default.
538+ * swiotlb overflow buffer: now is hardcoded to 32k.
539+ * We round it to 8M for other buffers that
540+ * may need to stay low too.
541+ */
542+ low_size = swiotlb_size_or_default() + (8UL<<20);
543+ auto_set = true;
544+ } else {
545+ /* passed with crashkernel=0,low ? */
546+ if (!low_size)
547+ return;
548+ }
531549
532550 low_base = memblock_find_in_range(low_size, (1ULL<<32),
533551 low_size, alignment);
534552
535553 if (!low_base) {
536− pr_info("crashkernel low reservation failed - No suitable area found.\n");
554+ if (!auto_set)
555+ pr_info("crashkernel low reservation failed - No suitable area found.\n");
537556
538557 return;
539558 }
@@ -554,14 +573,22 @@ static void __init reserve_crashkernel(void) · 14 unmodified lines
554573 const unsigned long long alignment = 16<<20; /* 16M */
555574 unsigned long long total_mem;
556575 unsigned long long crash_size, crash_base;
576+ bool high = false;
557577 int ret;
558578
559579 total_mem = memblock_phys_mem_size();
560580
581+ /* crashkernel=XM */
561582 ret = parse_crashkernel(boot_command_line, total_mem,
562583 &crash_size, &crash_base);
563− if (ret != 0 || crash_size <= 0)
564− return;
584+ if (ret != 0 || crash_size <= 0) {
585+ /* crashkernel=X,high */
586+ ret = parse_crashkernel_high(boot_command_line, total_mem,
587+ &crash_size, &crash_base);
588+ if (ret != 0 || crash_size <= 0)
589+ return;
590+ high = true;
591+ }
565592
566593 /* 0 means: find the address automatically */
567594 if (crash_base <= 0) {
@@ -569,7 +596,9 @@ static void __init reserve_crashkernel(void) · 1 unmodified line
569596 * kexec want bzImage is below CRASH_KERNEL_ADDR_MAX
570597 */
571598 crash_base = memblock_find_in_range(alignment,
572− CRASH_KERNEL_ADDR_MAX, crash_size, alignment);
599+ high ? CRASH_KERNEL_ADDR_HIGH_MAX :
600+ CRASH_KERNEL_ADDR_LOW_MAX,
601+ crash_size, alignment);
573602
574603 if (!crash_base) {
575604 pr_info("crashkernel reservation failed - No suitable area found.\n");
arch/x86/kvm/lapic.c+1−1
@@ -1857,7 +1857,7 @@ int kvm_lapic_enable_pv_eoi(struct kvm_vcpu *vcpu, u64 data) · 1856 unmodified lines
18571857 if (!pv_eoi_enabled(vcpu))
18581858 return 0;
18591859 return kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.pv_eoi.data,
1860− addr);
1860+ addr, sizeof(u8));
18611861 }
18621862
18631863 void kvm_lapic_init(void)
arch/x86/kvm/x86.c+6−7
@@ -1823,7 +1823,8 @@ static int kvm_pv_enable_async_pf(struct kvm_vcpu *vcpu, u64 data) · 1822 unmodified lines
18231823 return 0;
18241824 }
18251825
1826− if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.apf.data, gpa))
1826+ if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.apf.data, gpa,
1827+ sizeof(u32)))
18271828 return 1;
18281829
18291830 vcpu->arch.apf.send_user_only = !(data & KVM_ASYNC_PF_SEND_ALWAYS);
@@ -1952,12 +1953,9 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 122 unmodified lines
19521953
19531954 gpa_offset = data & ~(PAGE_MASK | 1);
19541955
1955− /* Check that the address is 32-byte aligned. */
1956− if (gpa_offset & (sizeof(struct pvclock_vcpu_time_info) - 1))
1957− break;
1958−
19591956 if (kvm_gfn_to_hva_cache_init(vcpu->kvm,
1960− &vcpu->arch.pv_time, data & ~1ULL))
1957+ &vcpu->arch.pv_time, data & ~1ULL,
1958+ sizeof(struct pvclock_vcpu_time_info)))
19611959 vcpu->arch.pv_time_enabled = false;
19621960 else
19631961 vcpu->arch.pv_time_enabled = true;
@@ -1977,7 +1975,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 13 unmodified lines
19771975 return 1;
19781976
19791977 if (kvm_gfn_to_hva_cache_init(vcpu->kvm, &vcpu->arch.st.stime,
1980− data & KVM_STEAL_VALID_BITS))
1978+ data & KVM_STEAL_VALID_BITS,
1979+ sizeof(struct kvm_steal_time)))
19811980 return 1;
19821981
19831982 vcpu->arch.st.msr_val = data;
arch/x86/lguest/boot.c+1−0
@@ -1334,6 +1334,7 @@ __init void lguest_init(void) · 1333 unmodified lines
13341334 pv_mmu_ops.read_cr3 = lguest_read_cr3;
13351335 pv_mmu_ops.lazy_mode.enter = paravirt_enter_lazy_mmu;
13361336 pv_mmu_ops.lazy_mode.leave = lguest_leave_lazy_mmu_mode;
1337+ pv_mmu_ops.lazy_mode.flush = paravirt_flush_lazy_mmu;
13371338 pv_mmu_ops.pte_update = lguest_pte_update;
13381339 pv_mmu_ops.pte_update_defer = lguest_pte_update;
13391340
arch/x86/mm/fault.c+4−2
@@ -378,10 +378,12 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) · 377 unmodified lines
378378 if (pgd_none(*pgd_ref))
379379 return -1;
380380
381− if (pgd_none(*pgd))
381+ if (pgd_none(*pgd)) {
382382 set_pgd(pgd, *pgd_ref);
383− else
383+ arch_flush_lazy_mmu_mode();
384+ } else {
384385 BUG_ON(pgd_page_vaddr(*pgd) != pgd_page_vaddr(*pgd_ref));
386+ }
385387
386388 /*
387389 * Below here mismatches are bugs because these lower tables
arch/x86/mm/pageattr-test.c+1−1
@@ -68,7 +68,7 @@ static int print_split(struct split_state *s) · 67 unmodified lines
6868 s->gpg++;
6969 i += GPS/PAGE_SIZE;
7070 } else if (level == PG_LEVEL_2M) {
71− if (!(pte_val(*pte) & _PAGE_PSE)) {
71+ if ((pte_val(*pte) & _PAGE_PRESENT) && !(pte_val(*pte) & _PAGE_PSE)) {
7272 printk(KERN_ERR
7373 "%lx level %d but not PSE %Lx\n",
7474 addr, level, (u64)pte_val(*pte));
arch/x86/mm/pageattr.c+7−5
@@ -467,7 +467,7 @@ try_preserve_large_page(pte_t *kpte, unsigned long address, · 466 unmodified lines
467467 * We are safe now. Check whether the new pgprot is the same:
468468 */
469469 old_pte = *kpte;
470− old_prot = new_prot = req_prot = pte_pgprot(old_pte);
470+ old_prot = req_prot = pte_pgprot(old_pte);
471471
472472 pgprot_val(req_prot) &= ~pgprot_val(cpa->mask_clr);
473473 pgprot_val(req_prot) |= pgprot_val(cpa->mask_set);
@@ -478,12 +478,12 @@ try_preserve_large_page(pte_t *kpte, unsigned long address, · 4 unmodified lines
478478 * a non present pmd. The canon_pgprot will clear _PAGE_GLOBAL
479479 * for the ancient hardware that doesn't support it.
480480 */
481− if (pgprot_val(new_prot) & _PAGE_PRESENT)
482− pgprot_val(new_prot) |= _PAGE_PSE | _PAGE_GLOBAL;
481+ if (pgprot_val(req_prot) & _PAGE_PRESENT)
482+ pgprot_val(req_prot) |= _PAGE_PSE | _PAGE_GLOBAL;
483483 else
484− pgprot_val(new_prot) &= ~(_PAGE_PSE | _PAGE_GLOBAL);
484+ pgprot_val(req_prot) &= ~(_PAGE_PSE | _PAGE_GLOBAL);
485485
486− new_prot = canon_pgprot(new_prot);
486+ req_prot = canon_pgprot(req_prot);
487487
488488 /*
489489 * old_pte points to the large page base address. So we need
@@ -1413,6 +1413,8 @@ void kernel_map_pages(struct page *page, int numpages, int enable) · 923 unmodified lines
14131413 * but that can deadlock->flush only current cpu:
14141414 */
14151415 __flush_tlb_all();
1416+
1417+ arch_flush_lazy_mmu_mode();
14161418 }
14171419
14181420 #ifdef CONFIG_HIBERNATION
arch/x86/mm/pgtable.c+7−0
@@ -58,6 +58,13 @@ void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte) · 57 unmodified lines
5858 void ___pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
5959 {
6060 paravirt_release_pmd(__pa(pmd) >> PAGE_SHIFT);
61+ /*
62+ * NOTE! For PAE, any changes to the top page-directory-pointer-table
63+ * entries need a full cr3 reload to flush.
64+ */
65+#ifdef CONFIG_X86_PAE
66+ tlb->need_flush_all = 1;
67+#endif
6168 tlb_remove_page(tlb, virt_to_page(pmd));
6269 }
6370
arch/x86/platform/efi/efi.c+163−5
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141 #include <linux/io.h>
4242 #include <linux/reboot.h>
4343 #include <linux/bcd.h>
44+#include <linux/ucs2_string.h>
4445
4546 #include <asm/setup.h>
4647 #include <asm/efi.h>
@@ -51,6 +52,13 @@ · 4 unmodified lines
5152
5253 #define EFI_DEBUG 1
5354
55+/*
56+ * There's some additional metadata associated with each
57+ * variable. Intel's reference implementation is 60 bytes - bump that
58+ * to account for potential alignment constraints
59+ */
60+#define VAR_METADATA_SIZE 64
61+
5462 struct efi __read_mostly efi = {
5563 .mps = EFI_INVALID_TABLE_ADDR,
5664 .acpi = EFI_INVALID_TABLE_ADDR,
@@ -69,6 +77,13 @@ struct efi_memory_map memmap; · 12 unmodified lines
6977 static struct efi efi_phys __initdata;
7078 static efi_system_table_t efi_systab __initdata;
7179
80+static u64 efi_var_store_size;
81+static u64 efi_var_remaining_size;
82+static u64 efi_var_max_var_size;
83+static u64 boot_used_size;
84+static u64 boot_var_size;
85+static u64 active_size;
86+
7287 unsigned long x86_efi_facility;
7388
7489 /*
@@ -98,6 +113,15 @@ static int __init setup_add_efi_memmap(char *arg) · 23 unmodified lines
98113 }
99114 early_param("add_efi_memmap", setup_add_efi_memmap);
100115
116+static bool efi_no_storage_paranoia;
117+
118+static int __init setup_storage_paranoia(char *arg)
119+{
120+ efi_no_storage_paranoia = true;
121+ return 0;
122+}
123+early_param("efi_no_storage_paranoia", setup_storage_paranoia);
124+
101125
102126 static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
103127 {
@@ -162,8 +186,53 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, · 58 unmodified lines
162186 efi_char16_t *name,
163187 efi_guid_t *vendor)
164188 {
165− return efi_call_virt3(get_next_variable,
166− name_size, name, vendor);
189+ efi_status_t status;
190+ static bool finished = false;
191+ static u64 var_size;
192+
193+ status = efi_call_virt3(get_next_variable,
194+ name_size, name, vendor);
195+
196+ if (status == EFI_NOT_FOUND) {
197+ finished = true;
198+ if (var_size < boot_used_size) {
199+ boot_var_size = boot_used_size - var_size;
200+ active_size += boot_var_size;
201+ } else {
202+ printk(KERN_WARNING FW_BUG "efi: Inconsistent initial sizes\n");
203+ }
204+ }
205+
206+ if (boot_used_size && !finished) {
207+ unsigned long size;
208+ u32 attr;
209+ efi_status_t s;
210+ void *tmp;
211+
212+ s = virt_efi_get_variable(name, vendor, &attr, &size, NULL);
213+
214+ if (s != EFI_BUFFER_TOO_SMALL || !size)
215+ return status;
216+
217+ tmp = kmalloc(size, GFP_ATOMIC);
218+
219+ if (!tmp)
220+ return status;
221+
222+ s = virt_efi_get_variable(name, vendor, &attr, &size, tmp);
223+
224+ if (s == EFI_SUCCESS && (attr & EFI_VARIABLE_NON_VOLATILE)) {
225+ var_size += size;
226+ var_size += ucs2_strsize(name, 1024);
227+ active_size += size;
228+ active_size += VAR_METADATA_SIZE;
229+ active_size += ucs2_strsize(name, 1024);
230+ }
231+
232+ kfree(tmp);
233+ }
234+
235+ return status;
167236 }
168237
169238 static efi_status_t virt_efi_set_variable(efi_char16_t *name,
@@ -172,9 +241,34 @@ static efi_status_t virt_efi_set_variable(efi_char16_t *name, · 2 unmodified lines
172241 unsigned long data_size,
173242 void *data)
174243 {
175− return efi_call_virt5(set_variable,
176− name, vendor, attr,
177− data_size, data);
244+ efi_status_t status;
245+ u32 orig_attr = 0;
246+ unsigned long orig_size = 0;
247+
248+ status = virt_efi_get_variable(name, vendor, &orig_attr, &orig_size,
249+ NULL);
250+
251+ if (status != EFI_BUFFER_TOO_SMALL)
252+ orig_size = 0;
253+
254+ status = efi_call_virt5(set_variable,
255+ name, vendor, attr,
256+ data_size, data);
257+
258+ if (status == EFI_SUCCESS) {
259+ if (orig_size) {
260+ active_size -= orig_size;
261+ active_size -= ucs2_strsize(name, 1024);
262+ active_size -= VAR_METADATA_SIZE;
263+ }
264+ if (data_size) {
265+ active_size += data_size;
266+ active_size += ucs2_strsize(name, 1024);
267+ active_size += VAR_METADATA_SIZE;
268+ }
269+ }
270+
271+ return status;
178272 }
179273
180274 static efi_status_t virt_efi_query_variable_info(u32 attr,
@@ -682,6 +776,9 @@ void __init efi_init(void) · 501 unmodified lines
682776 char vendor[100] = "unknown";
683777 int i = 0;
684778 void *tmp;
779+ struct setup_data *data;
780+ struct efi_var_bootdata *efi_var_data;
781+ u64 pa_data;
685782
686783 #ifdef CONFIG_X86_32
687784 if (boot_params.efi_info.efi_systab_hi ||
@@ -699,6 +796,22 @@ void __init efi_init(void) · 11 unmodified lines
699796 if (efi_systab_init(efi_phys.systab))
700797 return;
701798
799+ pa_data = boot_params.hdr.setup_data;
800+ while (pa_data) {
801+ data = early_ioremap(pa_data, sizeof(*efi_var_data));
802+ if (data->type == SETUP_EFI_VARS) {
803+ efi_var_data = (struct efi_var_bootdata *)data;
804+
805+ efi_var_store_size = efi_var_data->store_size;
806+ efi_var_remaining_size = efi_var_data->remaining_size;
807+ efi_var_max_var_size = efi_var_data->max_var_size;
808+ }
809+ pa_data = data->next;
810+ early_iounmap(data, sizeof(*efi_var_data));
811+ }
812+
813+ boot_used_size = efi_var_store_size - efi_var_remaining_size;
814+
702815 set_bit(EFI_SYSTEM_TABLES, &x86_efi_facility);
703816
704817 /*
@@ -999,3 +1112,48 @@ u64 efi_mem_attributes(unsigned long phys_addr) · 294 unmodified lines
9991112 }
10001113 return 0;
10011114 }
1115+
1116+/*
1117+ * Some firmware has serious problems when using more than 50% of the EFI
1118+ * variable store, i.e. it triggers bugs that can brick machines. Ensure that
1119+ * we never use more than this safe limit.
1120+ *
1121+ * Return EFI_SUCCESS if it is safe to write 'size' bytes to the variable
1122+ * store.
1123+ */
1124+efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
1125+{
1126+ efi_status_t status;
1127+ u64 storage_size, remaining_size, max_size;
1128+
1129+ status = efi.query_variable_info(attributes, &storage_size,
1130+ &remaining_size, &max_size);
1131+ if (status != EFI_SUCCESS)
1132+ return status;
1133+
1134+ if (!max_size && remaining_size > size)
1135+ printk_once(KERN_ERR FW_BUG "Broken EFI implementation"
1136+ " is returning MaxVariableSize=0\n");
1137+ /*
1138+ * Some firmware implementations refuse to boot if there's insufficient
1139+ * space in the variable store. We account for that by refusing the
1140+ * write if permitting it would reduce the available space to under
1141+ * 50%. However, some firmware won't reclaim variable space until
1142+ * after the used (not merely the actively used) space drops below
1143+ * a threshold. We can approximate that case with the value calculated
1144+ * above. If both the firmware and our calculations indicate that the
1145+ * available space would drop below 50%, refuse the write.
1146+ */
1147+
1148+ if (!storage_size || size > remaining_size ||
1149+ (max_size && size > max_size))
1150+ return EFI_OUT_OF_RESOURCES;
1151+
1152+ if (!efi_no_storage_paranoia &&
1153+ ((active_size + size + VAR_METADATA_SIZE > storage_size / 2) &&
1154+ (remaining_size - size < storage_size / 2)))
1155+ return EFI_OUT_OF_RESOURCES;
1156+
1157+ return EFI_SUCCESS;
1158+}
1159+EXPORT_SYMBOL_GPL(efi_query_variable_store);
arch/x86/xen/mmu.c+9−4
@@ -1748,14 +1748,18 @@ static void *m2v(phys_addr_t maddr) · 1747 unmodified lines
17481748 }
17491749
17501750 /* Set the page permissions on an identity-mapped pages */
1751−static void set_page_prot(void *addr, pgprot_t prot)
1751+static void set_page_prot_flags(void *addr, pgprot_t prot, unsigned long flags)
17521752 {
17531753 unsigned long pfn = __pa(addr) >> PAGE_SHIFT;
17541754 pte_t pte = pfn_pte(pfn, prot);
17551755
1756− if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, 0))
1756+ if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, flags))
17571757 BUG();
17581758 }
1759+static void set_page_prot(void *addr, pgprot_t prot)
1760+{
1761+ return set_page_prot_flags(addr, prot, UVMF_NONE);
1762+}
17591763 #ifdef CONFIG_X86_32
17601764 static void __init xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn)
17611765 {
@@ -1839,12 +1843,12 @@ static void __init check_pt_base(unsigned long *pt_base, unsigned long *pt_end, · 77 unmodified lines
18391843 unsigned long addr)
18401844 {
18411845 if (*pt_base == PFN_DOWN(__pa(addr))) {
1842− set_page_prot((void *)addr, PAGE_KERNEL);
1846+ set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG);
18431847 clear_page((void *)addr);
18441848 (*pt_base)++;
18451849 }
18461850 if (*pt_end == PFN_DOWN(__pa(addr))) {
1847− set_page_prot((void *)addr, PAGE_KERNEL);
1851+ set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG);
18481852 clear_page((void *)addr);
18491853 (*pt_end)--;
18501854 }
@@ -2196,6 +2200,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initconst = { · 345 unmodified lines
21962200 .lazy_mode = {
21972201 .enter = paravirt_enter_lazy_mmu,
21982202 .leave = xen_leave_lazy_mmu,
2203+ .flush = paravirt_flush_lazy_mmu,
21992204 },
22002205
22012206 .set_fixmap = xen_set_fixmap,
block/blk-core.c+1−0
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939
4040 EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_remap);
4141 EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap);
42+EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete);
4243 EXPORT_TRACEPOINT_SYMBOL_GPL(block_unplug);
4344
4445 DEFINE_IDA(blk_queue_ida);
block/blk-sysfs.c+2−0
@@ -229,6 +229,8 @@ queue_store_##name(struct request_queue *q, const char *page, size_t count) \ · 228 unmodified lines
229229 unsigned long val; \
230230 ssize_t ret; \
231231 ret = queue_var_store(&val, page, count); \
232+ if (ret < 0) \
233+ return ret; \
232234 if (neg) \
233235 val = !val; \
234236 \
block/partition-generic.c+0−1
@@ -257,7 +257,6 @@ void delete_partition(struct gendisk *disk, int partno) · 256 unmodified lines
257257
258258 hd_struct_put(part);
259259 }
260−EXPORT_SYMBOL(delete_partition);
261260
262261 static ssize_t whole_disk_show(struct device *dev,
263262 struct device_attribute *attr, char *buf)
crypto/gcm.c+14−3
@@ -44,6 +44,7 @@ struct crypto_rfc4543_ctx { · 43 unmodified lines
4444
4545 struct crypto_rfc4543_req_ctx {
4646 u8 auth_tag[16];
47+ u8 assocbuf[32];
4748 struct scatterlist cipher[1];
4849 struct scatterlist payload[2];
4950 struct scatterlist assoc[2];
@@ -1133,9 +1134,19 @@ static struct aead_request *crypto_rfc4543_crypt(struct aead_request *req, · 1083 unmodified lines
11331134 scatterwalk_crypto_chain(payload, dst, vdst == req->iv + 8, 2);
11341135 assoclen += 8 + req->cryptlen - (enc ? 0 : authsize);
11351136
1136− sg_init_table(assoc, 2);
1137− sg_set_page(assoc, sg_page(req->assoc), req->assoc->length,
1138− req->assoc->offset);
1137+ if (req->assoc->length == req->assoclen) {
1138+ sg_init_table(assoc, 2);
1139+ sg_set_page(assoc, sg_page(req->assoc), req->assoc->length,
1140+ req->assoc->offset);
1141+ } else {
1142+ BUG_ON(req->assoclen > sizeof(rctx->assocbuf));
1143+
1144+ scatterwalk_map_and_copy(rctx->assocbuf, req->assoc, 0,
1145+ req->assoclen, 0);
1146+
1147+ sg_init_table(assoc, 2);
1148+ sg_set_buf(assoc, rctx->assocbuf, req->assoclen);
1149+ }
11391150 scatterwalk_crypto_chain(assoc, payload, 0, 2);
11401151
11411152 aead_request_set_tfm(subreq, ctx->child);
drivers/acpi/pci_root.c+37−39
@@ -415,7 +415,6 @@ static int acpi_pci_root_add(struct acpi_device *device, · 414 unmodified lines
415415 struct acpi_pci_root *root;
416416 struct acpi_pci_driver *driver;
417417 u32 flags, base_flags;
418− bool is_osc_granted = false;
419418
420419 root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
421420 if (!root)
@@ -476,6 +475,30 @@ static int acpi_pci_root_add(struct acpi_device *device, · 54 unmodified lines
476475 flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT;
477476 acpi_pci_osc_support(root, flags);
478477
478+ /*
479+ * TBD: Need PCI interface for enumeration/configuration of roots.
480+ */
481+
482+ mutex_lock(&acpi_pci_root_lock);
483+ list_add_tail(&root->node, &acpi_pci_roots);
484+ mutex_unlock(&acpi_pci_root_lock);
485+
486+ /*
487+ * Scan the Root Bridge
488+ * --------------------
489+ * Must do this prior to any attempt to bind the root device, as the
490+ * PCI namespace does not get created until this call is made (and
491+ * thus the root bridge's pci_dev does not exist).
492+ */
493+ root->bus = pci_acpi_scan_root(root);
494+ if (!root->bus) {
495+ printk(KERN_ERR PREFIX
496+ "Bus %04x:%02x not present in PCI namespace\n",
497+ root->segment, (unsigned int)root->secondary.start);
498+ result = -ENODEV;
499+ goto out_del_root;
500+ }
501+
479502 /* Indicate support for various _OSC capabilities. */
480503 if (pci_ext_cfg_avail())
481504 flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
@@ -494,6 +517,7 @@ static int acpi_pci_root_add(struct acpi_device *device, · 12 unmodified lines
494517 flags = base_flags;
495518 }
496519 }
520+
497521 if (!pcie_ports_disabled
498522 && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
499523 flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL
@@ -514,54 +538,28 @@ static int acpi_pci_root_add(struct acpi_device *device, · 14 unmodified lines
514538 status = acpi_pci_osc_control_set(device->handle, &flags,
515539 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL);
516540 if (ACPI_SUCCESS(status)) {
517− is_osc_granted = true;
518541 dev_info(&device->dev,
519542 "ACPI _OSC control (0x%02x) granted\n", flags);
543+ if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
544+ /*
545+ * We have ASPM control, but the FADT indicates
546+ * that it's unsupported. Clear it.
547+ */
548+ pcie_clear_aspm(root->bus);
549+ }
520550 } else {
521− is_osc_granted = false;
522551 dev_info(&device->dev,
523552 "ACPI _OSC request failed (%s), "
524553 "returned control mask: 0x%02x\n",
525554 acpi_format_exception(status), flags);
555+ pr_info("ACPI _OSC control for PCIe not granted, "
556+ "disabling ASPM\n");
557+ pcie_no_aspm();
526558 }
527559 } else {
528560 dev_info(&device->dev,
529− "Unable to request _OSC control "
530− "(_OSC support mask: 0x%02x)\n", flags);
531− }
532−
533− /*
534− * TBD: Need PCI interface for enumeration/configuration of roots.
535− */
536−
537− mutex_lock(&acpi_pci_root_lock);
538− list_add_tail(&root->node, &acpi_pci_roots);
539− mutex_unlock(&acpi_pci_root_lock);
540−
541− /*
542− * Scan the Root Bridge
543− * --------------------
544− * Must do this prior to any attempt to bind the root device, as the
545− * PCI namespace does not get created until this call is made (and
546− * thus the root bridge's pci_dev does not exist).
547− */
548− root->bus = pci_acpi_scan_root(root);
549− if (!root->bus) {
550− printk(KERN_ERR PREFIX
551− "Bus %04x:%02x not present in PCI namespace\n",
552− root->segment, (unsigned int)root->secondary.start);
553− result = -ENODEV;
554− goto out_del_root;
555− }
556−
557− /* ASPM setting */
558− if (is_osc_granted) {
559− if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM)
560− pcie_clear_aspm(root->bus);
561− } else {
562− pr_info("ACPI _OSC control for PCIe not granted, "
563− "disabling ASPM\n");
564− pcie_no_aspm();
561+ "Unable to request _OSC control "
562+ "(_OSC support mask: 0x%02x)\n", flags);
565563 }
566564
567565 pci_acpi_add_bus_pm_notifier(device, root->bus);
drivers/ata/ata_piix.c+13−1
@@ -150,6 +150,7 @@ enum piix_controller_ids { · 149 unmodified lines
150150 tolapai_sata,
151151 piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */
152152 ich8_sata_snb,
153+ ich8_2port_sata_snb,
153154 };
154155
155156 struct piix_map_db {
@@ -304,7 +305,7 @@ static const struct pci_device_id piix_pci_tbl[] = { · 148 unmodified lines
304305 /* SATA Controller IDE (Lynx Point) */
305306 { 0x8086, 0x8c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb },
306307 /* SATA Controller IDE (Lynx Point) */
307− { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
308+ { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb },
308309 /* SATA Controller IDE (Lynx Point) */
309310 { 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
310311 /* SATA Controller IDE (Lynx Point-LP) */
@@ -439,6 +440,7 @@ static const struct piix_map_db *piix_map_db_table[] = { · 128 unmodified lines
439440 [ich8m_apple_sata] = &ich8m_apple_map_db,
440441 [tolapai_sata] = &tolapai_map_db,
441442 [ich8_sata_snb] = &ich8_map_db,
443+ [ich8_2port_sata_snb] = &ich8_2port_map_db,
442444 };
443445
444446 static struct pci_bits piix_enable_bits[] = {
@@ -1242,6 +1244,16 @@ static struct ata_port_info piix_port_info[] = { · 797 unmodified lines
12421244 .udma_mask = ATA_UDMA6,
12431245 .port_ops = &piix_sata_ops,
12441246 },
1247+
1248+ [ich8_2port_sata_snb] =
1249+ {
1250+ .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR
1251+ | PIIX_FLAG_PIO16,
1252+ .pio_mask = ATA_PIO4,
1253+ .mwdma_mask = ATA_MWDMA2,
1254+ .udma_mask = ATA_UDMA6,
1255+ .port_ops = &piix_sata_ops,
1256+ },
12451257 };
12461258
12471259 #define AHCI_PCI_BAR 5
drivers/ata/libata-core.c+5−1
@@ -2329,7 +2329,7 @@ int ata_dev_configure(struct ata_device *dev) · 2328 unmodified lines
23292329 * from SATA Settings page of Identify Device Data Log.
23302330 */
23312331 if (ata_id_has_devslp(dev->id)) {
2332− u8 sata_setting[ATA_SECT_SIZE];
2332+ u8 *sata_setting = ap->sector_buf;
23332333 int i, j;
23342334
23352335 dev->flags |= ATA_DFLAG_DEVSLP;
@@ -2439,6 +2439,9 @@ int ata_dev_configure(struct ata_device *dev) · 103 unmodified lines
24392439 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
24402440 dev->max_sectors);
24412441
2442+ if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48)
2443+ dev->max_sectors = ATA_MAX_SECTORS_LBA48;
2444+
24422445 if (ap->ops->dev_config)
24432446 ap->ops->dev_config(dev);
24442447
@@ -4100,6 +4103,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { · 1655 unmodified lines
41004103 /* Weird ATAPI devices */
41014104 { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 },
41024105 { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA },
4106+ { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 },
41034107
41044108 /* Devices we expect to fail diagnostics */
41054109
drivers/ata/libata-scsi.c+4−4
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) · 531 unmodified lines
532532 struct scsi_sense_hdr sshdr;
533533 scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
534534 &sshdr);
535− if (sshdr.sense_key == 0 &&
536− sshdr.asc == 0 && sshdr.ascq == 0)
535+ if (sshdr.sense_key == RECOVERED_ERROR &&
536+ sshdr.asc == 0 && sshdr.ascq == 0x1d)
537537 cmd_result &= ~SAM_STAT_CHECK_CONDITION;
538538 }
539539
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) · 78 unmodified lines
618618 struct scsi_sense_hdr sshdr;
619619 scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE,
620620 &sshdr);
621− if (sshdr.sense_key == 0 &&
622− sshdr.asc == 0 && sshdr.ascq == 0)
621+ if (sshdr.sense_key == RECOVERED_ERROR &&
622+ sshdr.asc == 0 && sshdr.ascq == 0x1d)
623623 cmd_result &= ~SAM_STAT_CHECK_CONDITION;
624624 }
625625
drivers/base/regmap/regmap.c+2−1
@@ -943,7 +943,8 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg, · 942 unmodified lines
943943 unsigned int ival;
944944 int val_bytes = map->format.val_bytes;
945945 for (i = 0; i < val_len / val_bytes; i++) {
946− ival = map->format.parse_val(val + (i * val_bytes));
946+ memcpy(map->work_buf, val + (i * val_bytes), val_bytes);
947+ ival = map->format.parse_val(map->work_buf);
947948 ret = regcache_write(map, reg + (i * map->reg_stride),
948949 ival);
949950 if (ret) {
drivers/block/loop.c+2−19
@@ -1051,29 +1051,12 @@ static int loop_clr_fd(struct loop_device *lo) · 1050 unmodified lines
10511051 lo->lo_state = Lo_unbound;
10521052 /* This is safe: open() is still holding a reference. */
10531053 module_put(THIS_MODULE);
1054+ if (lo->lo_flags & LO_FLAGS_PARTSCAN && bdev)
1055+ ioctl_by_bdev(bdev, BLKRRPART, 0);
10541056 lo->lo_flags = 0;
10551057 if (!part_shift)
10561058 lo->lo_disk->flags |= GENHD_FL_NO_PART_SCAN;
10571059 mutex_unlock(&lo->lo_ctl_mutex);
1058−
1059− /*
1060− * Remove all partitions, since BLKRRPART won't remove user
1061− * added partitions when max_part=0
1062− */
1063− if (bdev) {
1064− struct disk_part_iter piter;
1065− struct hd_struct *part;
1066−
1067− mutex_lock_nested(&bdev->bd_mutex, 1);
1068− invalidate_partition(bdev->bd_disk, 0);
1069− disk_part_iter_init(&piter, bdev->bd_disk,
1070− DISK_PITER_INCL_EMPTY);
1071− while ((part = disk_part_iter_next(&piter)))
1072− delete_partition(bdev->bd_disk, part->partno);
1073− disk_part_iter_exit(&piter);
1074− mutex_unlock(&bdev->bd_mutex);
1075− }
1076−
10771060 /*
10781061 * Need not hold lo_ctl_mutex to fput backing file.
10791062 * Calling fput holding lo_ctl_mutex triggers a circular
drivers/block/mtip32xx/mtip32xx.c+232−95
@@ -81,12 +81,17 @@ · 80 unmodified lines
8181 /* Device instance number, incremented each time a device is probed. */
8282 static int instance;
8383
84+struct list_head online_list;
85+struct list_head removing_list;
86+spinlock_t dev_lock;
87+
8488 /*
8589 * Global variable used to hold the major block device number
8690 * allocated in mtip_init().
8791 */
8892 static int mtip_major;
8993 static struct dentry *dfs_parent;
94+static struct dentry *dfs_device_status;
9095
9196 static u32 cpu_use[NR_CPUS];
9297
@@ -243,40 +248,31 @@ static inline void release_slot(struct mtip_port *port, int tag) · 150 unmodified lines
243248 /*
244249 * Reset the HBA (without sleeping)
245250 *
246− * Just like hba_reset, except does not call sleep, so can be
247− * run from interrupt/tasklet context.
248− *
249251 * @dd Pointer to the driver data structure.
250252 *
251253 * return value
252254 * 0 The reset was successful.
253255 * -1 The HBA Reset bit did not clear.
254256 */
255−static int hba_reset_nosleep(struct driver_data *dd)
257+static int mtip_hba_reset(struct driver_data *dd)
256258 {
257259 unsigned long timeout;
258260
259− /* Chip quirk: quiesce any chip function */
260− mdelay(10);
261−
262261 /* Set the reset bit */
263262 writel(HOST_RESET, dd->mmio + HOST_CTL);
264263
265264 /* Flush */
266265 readl(dd->mmio + HOST_CTL);
267266
268− /*
269− * Wait 10ms then spin for up to 1 second
270− * waiting for reset acknowledgement
271− */
272− timeout = jiffies + msecs_to_jiffies(1000);
273− mdelay(10);
274− while ((readl(dd->mmio + HOST_CTL) & HOST_RESET)
275− && time_before(jiffies, timeout))
276− mdelay(1);
267+ /* Spin for up to 2 seconds, waiting for reset acknowledgement */
268+ timeout = jiffies + msecs_to_jiffies(2000);
269+ do {
270+ mdelay(10);
271+ if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))
272+ return -1;
277273
278− if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))
279− return -1;
274+ } while ((readl(dd->mmio + HOST_CTL) & HOST_RESET)
275+ && time_before(jiffies, timeout));
280276
281277 if (readl(dd->mmio + HOST_CTL) & HOST_RESET)
282278 return -1;
@@ -481,7 +477,7 @@ static void mtip_restart_port(struct mtip_port *port) · 198 unmodified lines
481477 dev_warn(&port->dd->pdev->dev,
482478 "PxCMD.CR not clear, escalating reset\n");
483479
484− if (hba_reset_nosleep(port->dd))
480+ if (mtip_hba_reset(port->dd))
485481 dev_err(&port->dd->pdev->dev,
486482 "HBA reset escalation failed.\n");
487483
@@ -527,6 +523,26 @@ static void mtip_restart_port(struct mtip_port *port) · 39 unmodified lines
527523
528524 }
529525
526+static int mtip_device_reset(struct driver_data *dd)
527+{
528+ int rv = 0;
529+
530+ if (mtip_check_surprise_removal(dd->pdev))
531+ return 0;
532+
533+ if (mtip_hba_reset(dd) < 0)
534+ rv = -EFAULT;
535+
536+ mdelay(1);
537+ mtip_init_port(dd->port);
538+ mtip_start_port(dd->port);
539+
540+ /* Enable interrupts on the HBA. */
541+ writel(readl(dd->mmio + HOST_CTL) | HOST_IRQ_EN,
542+ dd->mmio + HOST_CTL);
543+ return rv;
544+}
545+
530546 /*
531547 * Helper function for tag logging
532548 */
@@ -632,7 +648,7 @@ static void mtip_timeout_function(unsigned long int data) · 99 unmodified lines
632648 if (cmdto_cnt) {
633649 print_tags(port->dd, "timed out", tagaccum, cmdto_cnt);
634650 if (!test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) {
635− mtip_restart_port(port);
651+ mtip_device_reset(port->dd);
636652 wake_up_interruptible(&port->svc_wait);
637653 }
638654 clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
@@ -1283,11 +1299,11 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 644 unmodified lines
12831299 int rv = 0, ready2go = 1;
12841300 struct mtip_cmd *int_cmd = &port->commands[MTIP_TAG_INTERNAL];
12851301 unsigned long to;
1302+ struct driver_data *dd = port->dd;
12861303
12871304 /* Make sure the buffer is 8 byte aligned. This is asic specific. */
12881305 if (buffer & 0x00000007) {
1289− dev_err(&port->dd->pdev->dev,
1290− "SG buffer is not 8 byte aligned\n");
1306+ dev_err(&dd->pdev->dev, "SG buffer is not 8 byte aligned\n");
12911307 return -EFAULT;
12921308 }
12931309
@@ -1300,23 +1316,21 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 6 unmodified lines
13001316 mdelay(100);
13011317 } while (time_before(jiffies, to));
13021318 if (!ready2go) {
1303− dev_warn(&port->dd->pdev->dev,
1319+ dev_warn(&dd->pdev->dev,
13041320 "Internal cmd active. new cmd [%02X]\n", fis->command);
13051321 return -EBUSY;
13061322 }
13071323 set_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
13081324 port->ic_pause_timer = 0;
13091325
1310− if (fis->command == ATA_CMD_SEC_ERASE_UNIT)
1311− clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags);
1312− else if (fis->command == ATA_CMD_DOWNLOAD_MICRO)
1313− clear_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags);
1326+ clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags);
1327+ clear_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags);
13141328
13151329 if (atomic == GFP_KERNEL) {
13161330 if (fis->command != ATA_CMD_STANDBYNOW1) {
13171331 /* wait for io to complete if non atomic */
13181332 if (mtip_quiesce_io(port, 5000) < 0) {
1319− dev_warn(&port->dd->pdev->dev,
1333+ dev_warn(&dd->pdev->dev,
13201334 "Failed to quiesce IO\n");
13211335 release_slot(port, MTIP_TAG_INTERNAL);
13221336 clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
@@ -1361,58 +1375,84 @@ static int mtip_exec_internal_command(struct mtip_port *port, · 38 unmodified lines
13611375 /* Issue the command to the hardware */
13621376 mtip_issue_non_ncq_command(port, MTIP_TAG_INTERNAL);
13631377
1364− /* Poll if atomic, wait_for_completion otherwise */
13651378 if (atomic == GFP_KERNEL) {
13661379 /* Wait for the command to complete or timeout. */
1367− if (wait_for_completion_timeout(
1380+ if (wait_for_completion_interruptible_timeout(
13681381 &wait,
1369− msecs_to_jiffies(timeout)) == 0) {
1370− dev_err(&port->dd->pdev->dev,
1371− "Internal command did not complete [%d] "
1372− "within timeout of %lu ms\n",
1373− atomic, timeout);
1374− if (mtip_check_surprise_removal(port->dd->pdev) ||
1382+ msecs_to_jiffies(timeout)) <= 0) {
1383+ if (rv == -ERESTARTSYS) { /* interrupted */
1384+ dev_err(&dd->pdev->dev,
1385+ "Internal command [%02X] was interrupted after %lu ms\n",
1386+ fis->command, timeout);
1387+ rv = -EINTR;
1388+ goto exec_ic_exit;
1389+ } else if (rv == 0) /* timeout */
1390+ dev_err(&dd->pdev->dev,
1391+ "Internal command did not complete [%02X] within timeout of %lu ms\n",
1392+ fis->command, timeout);
1393+ else
1394+ dev_err(&dd->pdev->dev,
1395+ "Internal command [%02X] wait returned code [%d] after %lu ms - unhandled\n",
1396+ fis->command, rv, timeout);
1397+
1398+ if (mtip_check_surprise_removal(dd->pdev) ||
13751399 test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1376− &port->dd->dd_flag)) {
1400+ &dd->dd_flag)) {
1401+ dev_err(&dd->pdev->dev,
1402+ "Internal command [%02X] wait returned due to SR\n",
1403+ fis->command);
13771404 rv = -ENXIO;
13781405 goto exec_ic_exit;
13791406 }
1407+ mtip_device_reset(dd); /* recover from timeout issue */
13801408 rv = -EAGAIN;
1409+ goto exec_ic_exit;
13811410 }
13821411 } else {
1412+ u32 hba_stat, port_stat;
1413+
13831414 /* Spin for <timeout> checking if command still outstanding */
13841415 timeout = jiffies + msecs_to_jiffies(timeout);
13851416 while ((readl(port->cmd_issue[MTIP_TAG_INTERNAL])
13861417 & (1 << MTIP_TAG_INTERNAL))
13871418 && time_before(jiffies, timeout)) {
1388− if (mtip_check_surprise_removal(port->dd->pdev)) {
1419+ if (mtip_check_surprise_removal(dd->pdev)) {
13891420 rv = -ENXIO;
13901421 goto exec_ic_exit;
13911422 }
13921423 if ((fis->command != ATA_CMD_STANDBYNOW1) &&
13931424 test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1394− &port->dd->dd_flag)) {
1425+ &dd->dd_flag)) {
13951426 rv = -ENXIO;
13961427 goto exec_ic_exit;
13971428 }
1398− if (readl(port->mmio + PORT_IRQ_STAT) & PORT_IRQ_ERR) {
1399− atomic_inc(&int_cmd->active); /* error */
1400− break;
1429+ port_stat = readl(port->mmio + PORT_IRQ_STAT);
1430+ if (!port_stat)
1431+ continue;
1432+
1433+ if (port_stat & PORT_IRQ_ERR) {
1434+ dev_err(&dd->pdev->dev,
1435+ "Internal command [%02X] failed\n",
1436+ fis->command);
1437+ mtip_device_reset(dd);
1438+ rv = -EIO;
1439+ goto exec_ic_exit;
1440+ } else {
1441+ writel(port_stat, port->mmio + PORT_IRQ_STAT);
1442+ hba_stat = readl(dd->mmio + HOST_IRQ_STAT);
1443+ if (hba_stat)
1444+ writel(hba_stat,
1445+ dd->mmio + HOST_IRQ_STAT);
14011446 }
1447+ break;
14021448 }
14031449 }
14041450
1405− if (atomic_read(&int_cmd->active) > 1) {
1406− dev_err(&port->dd->pdev->dev,
1407− "Internal command [%02X] failed\n", fis->command);
1408− rv = -EIO;
1409− }
14101451 if (readl(port->cmd_issue[MTIP_TAG_INTERNAL])
14111452 & (1 << MTIP_TAG_INTERNAL)) {
14121453 rv = -ENXIO;
1413− if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1414− &port->dd->dd_flag)) {
1415− mtip_restart_port(port);
1454+ if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) {
1455+ mtip_device_reset(dd);
14161456 rv = -EAGAIN;
14171457 }
14181458 }
@@ -1724,7 +1764,8 @@ static int mtip_get_smart_attr(struct mtip_port *port, unsigned int id, · 305 unmodified lines
17241764 * -EINVAL Invalid parameters passed in, trim not supported
17251765 * -EIO Error submitting trim request to hw
17261766 */
1727−static int mtip_send_trim(struct driver_data *dd, unsigned int lba, unsigned int len)
1767+static int mtip_send_trim(struct driver_data *dd, unsigned int lba,
1768+ unsigned int len)
17281769 {
17291770 int i, rv = 0;
17301771 u64 tlba, tlen, sect_left;
@@ -1810,45 +1851,6 @@ static bool mtip_hw_get_capacity(struct driver_data *dd, sector_t *sectors) · 79 unmodified lines
18101851 return (bool) !!port->identify_valid;
18111852 }
18121853
1813−/*
1814− * Reset the HBA.
1815− *
1816− * Resets the HBA by setting the HBA Reset bit in the Global
1817− * HBA Control register. After setting the HBA Reset bit the
1818− * function waits for 1 second before reading the HBA Reset
1819− * bit to make sure it has cleared. If HBA Reset is not clear
1820− * an error is returned. Cannot be used in non-blockable
1821− * context.
1822− *
1823− * @dd Pointer to the driver data structure.
1824− *
1825− * return value
1826− * 0 The reset was successful.
1827− * -1 The HBA Reset bit did not clear.
1828− */
1829−static int mtip_hba_reset(struct driver_data *dd)
1830−{
1831− mtip_deinit_port(dd->port);
1832−
1833− /* Set the reset bit */
1834− writel(HOST_RESET, dd->mmio + HOST_CTL);
1835−
1836− /* Flush */
1837− readl(dd->mmio + HOST_CTL);
1838−
1839− /* Wait for reset to clear */
1840− ssleep(1);
1841−
1842− /* Check the bit has cleared */
1843− if (readl(dd->mmio + HOST_CTL) & HOST_RESET) {
1844− dev_err(&dd->pdev->dev,
1845− "Reset bit did not clear.\n");
1846− return -1;
1847− }
1848−
1849− return 0;
1850−}
1851−
18521854 /*
18531855 * Display the identify command data.
18541856 *
@@ -2710,6 +2712,100 @@ static ssize_t mtip_hw_show_status(struct device *dev, · 855 unmodified lines
27102712
27112713 static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL);
27122714
2715+/* debugsfs entries */
2716+
2717+static ssize_t show_device_status(struct device_driver *drv, char *buf)
2718+{
2719+ int size = 0;
2720+ struct driver_data *dd, *tmp;
2721+ unsigned long flags;
2722+ char id_buf[42];
2723+ u16 status = 0;
2724+
2725+ spin_lock_irqsave(&dev_lock, flags);
2726+ size += sprintf(&buf[size], "Devices Present:\n");
2727+ list_for_each_entry_safe(dd, tmp, &online_list, online_list) {
2728+ if (dd->pdev) {
2729+ if (dd->port &&
2730+ dd->port->identify &&
2731+ dd->port->identify_valid) {
2732+ strlcpy(id_buf,
2733+ (char *) (dd->port->identify + 10), 21);
2734+ status = *(dd->port->identify + 141);
2735+ } else {
2736+ memset(id_buf, 0, 42);
2737+ status = 0;
2738+ }
2739+
2740+ if (dd->port &&
2741+ test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags)) {
2742+ size += sprintf(&buf[size],
2743+ " device %s %s (ftl rebuild %d %%)\n",
2744+ dev_name(&dd->pdev->dev),
2745+ id_buf,
2746+ status);
2747+ } else {
2748+ size += sprintf(&buf[size],
2749+ " device %s %s\n",
2750+ dev_name(&dd->pdev->dev),
2751+ id_buf);
2752+ }
2753+ }
2754+ }
2755+
2756+ size += sprintf(&buf[size], "Devices Being Removed:\n");
2757+ list_for_each_entry_safe(dd, tmp, &removing_list, remove_list) {
2758+ if (dd->pdev) {
2759+ if (dd->port &&
2760+ dd->port->identify &&
2761+ dd->port->identify_valid) {
2762+ strlcpy(id_buf,
2763+ (char *) (dd->port->identify+10), 21);
2764+ status = *(dd->port->identify + 141);
2765+ } else {
2766+ memset(id_buf, 0, 42);
2767+ status = 0;
2768+ }
2769+
2770+ if (dd->port &&
2771+ test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags)) {
2772+ size += sprintf(&buf[size],
2773+ " device %s %s (ftl rebuild %d %%)\n",
2774+ dev_name(&dd->pdev->dev),
2775+ id_buf,
2776+ status);
2777+ } else {
2778+ size += sprintf(&buf[size],
2779+ " device %s %s\n",
2780+ dev_name(&dd->pdev->dev),
2781+ id_buf);
2782+ }
2783+ }
2784+ }
2785+ spin_unlock_irqrestore(&dev_lock, flags);
2786+
2787+ return size;
2788+}
2789+
2790+static ssize_t mtip_hw_read_device_status(struct file *f, char __user *ubuf,
2791+ size_t len, loff_t *offset)
2792+{
2793+ int size = *offset;
2794+ char buf[MTIP_DFS_MAX_BUF_SIZE];
2795+
2796+ if (!len || *offset)
2797+ return 0;
2798+
2799+ size += show_device_status(NULL, buf);
2800+
2801+ *offset = size <= len ? size : len;
2802+ size = copy_to_user(ubuf, buf, *offset);
2803+ if (size)
2804+ return -EFAULT;
2805+
2806+ return *offset;
2807+}
2808+
27132809 static ssize_t mtip_hw_read_registers(struct file *f, char __user *ubuf,
27142810 size_t len, loff_t *offset)
27152811 {
@@ -2804,6 +2900,13 @@ static ssize_t mtip_hw_read_flags(struct file *f, char __user *ubuf, · 88 unmodified lines
28042900 return *offset;
28052901 }
28062902
2903+static const struct file_operations mtip_device_status_fops = {
2904+ .owner = THIS_MODULE,
2905+ .open = simple_open,
2906+ .read = mtip_hw_read_device_status,
2907+ .llseek = no_llseek,
2908+};
2909+
28072910 static const struct file_operations mtip_regs_fops = {
28082911 .owner = THIS_MODULE,
28092912 .open = simple_open,
@@ -4161,6 +4264,7 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 1351 unmodified lines
41614264 const struct cpumask *node_mask;
41624265 int cpu, i = 0, j = 0;
41634266 int my_node = NUMA_NO_NODE;
4267+ unsigned long flags;
41644268
41654269 /* Allocate memory for this devices private data. */
41664270 my_node = pcibus_to_node(pdev->bus);
@@ -4218,6 +4322,9 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 51 unmodified lines
42184322 dd->pdev = pdev;
42194323 dd->numa_node = my_node;
42204324
4325+ INIT_LIST_HEAD(&dd->online_list);
4326+ INIT_LIST_HEAD(&dd->remove_list);
4327+
42214328 memset(dd->workq_name, 0, 32);
42224329 snprintf(dd->workq_name, 31, "mtipq%d", dd->instance);
42234330
@@ -4305,6 +4412,14 @@ static int mtip_pci_probe(struct pci_dev *pdev, · 81 unmodified lines
43054412 instance++;
43064413 if (rv != MTIP_FTL_REBUILD_MAGIC)
43074414 set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag);
4415+ else
4416+ rv = 0; /* device in rebuild state, return 0 from probe */
4417+
4418+ /* Add to online list even if in ftl rebuild */
4419+ spin_lock_irqsave(&dev_lock, flags);
4420+ list_add(&dd->online_list, &online_list);
4421+ spin_unlock_irqrestore(&dev_lock, flags);
4422+
43084423 goto done;
43094424
43104425 block_initialize_err:
@@ -4338,9 +4453,15 @@ static void mtip_pci_remove(struct pci_dev *pdev) · 27 unmodified lines
43384453 {
43394454 struct driver_data *dd = pci_get_drvdata(pdev);
43404455 int counter = 0;
4456+ unsigned long flags;
43414457
43424458 set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag);
43434459
4460+ spin_lock_irqsave(&dev_lock, flags);
4461+ list_del_init(&dd->online_list);
4462+ list_add(&dd->remove_list, &removing_list);
4463+ spin_unlock_irqrestore(&dev_lock, flags);
4464+
43444465 if (mtip_check_surprise_removal(pdev)) {
43454466 while (!test_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag)) {
43464467 counter++;
@@ -4366,6 +4487,10 @@ static void mtip_pci_remove(struct pci_dev *pdev) · 19 unmodified lines
43664487
43674488 pci_disable_msi(pdev);
43684489
4490+ spin_lock_irqsave(&dev_lock, flags);
4491+ list_del_init(&dd->remove_list);
4492+ spin_unlock_irqrestore(&dev_lock, flags);
4493+
43694494 kfree(dd);
43704495 pcim_iounmap_regions(pdev, 1 << MTIP_ABAR);
43714496 }
@@ -4513,6 +4638,11 @@ static int __init mtip_init(void) · 141 unmodified lines
45134638
45144639 pr_info(MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n");
45154640
4641+ spin_lock_init(&dev_lock);
4642+
4643+ INIT_LIST_HEAD(&online_list);
4644+ INIT_LIST_HEAD(&removing_list);
4645+
45164646 /* Allocate a major block device number to use with this driver. */
45174647 error = register_blkdev(0, MTIP_DRV_NAME);
45184648 if (error <= 0) {
@@ -4522,11 +4652,18 @@ static int __init mtip_init(void) · 3 unmodified lines
45224652 }
45234653 mtip_major = error;
45244654
4525− if (!dfs_parent) {
4526− dfs_parent = debugfs_create_dir("rssd", NULL);
4527− if (IS_ERR_OR_NULL(dfs_parent)) {
4528− pr_warn("Error creating debugfs parent\n");
4529− dfs_parent = NULL;
4655+ dfs_parent = debugfs_create_dir("rssd", NULL);
4656+ if (IS_ERR_OR_NULL(dfs_parent)) {
4657+ pr_warn("Error creating debugfs parent\n");
4658+ dfs_parent = NULL;
4659+ }
4660+ if (dfs_parent) {
4661+ dfs_device_status = debugfs_create_file("device_status",
4662+ S_IRUGO, dfs_parent, NULL,
4663+ &mtip_device_status_fops);
4664+ if (IS_ERR_OR_NULL(dfs_device_status)) {
4665+ pr_err("Error creating device_status node\n");
4666+ dfs_device_status = NULL;
45304667 }
45314668 }
45324669
drivers/block/mtip32xx/mtip32xx.h+11−7
@@ -129,9 +129,9 @@ enum { · 128 unmodified lines
129129 MTIP_PF_EH_ACTIVE_BIT = 1, /* error handling */
130130 MTIP_PF_SE_ACTIVE_BIT = 2, /* secure erase */
131131 MTIP_PF_DM_ACTIVE_BIT = 3, /* download microcde */
132− MTIP_PF_PAUSE_IO = ((1 << MTIP_PF_IC_ACTIVE_BIT) | \
133− (1 << MTIP_PF_EH_ACTIVE_BIT) | \
134− (1 << MTIP_PF_SE_ACTIVE_BIT) | \
132+ MTIP_PF_PAUSE_IO = ((1 << MTIP_PF_IC_ACTIVE_BIT) |
133+ (1 << MTIP_PF_EH_ACTIVE_BIT) |
134+ (1 << MTIP_PF_SE_ACTIVE_BIT) |
135135 (1 << MTIP_PF_DM_ACTIVE_BIT)),
136136
137137 MTIP_PF_SVC_THD_ACTIVE_BIT = 4,
@@ -144,9 +144,9 @@ enum { · 6 unmodified lines
144144 MTIP_DDF_REMOVE_PENDING_BIT = 1,
145145 MTIP_DDF_OVER_TEMP_BIT = 2,
146146 MTIP_DDF_WRITE_PROTECT_BIT = 3,
147− MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | \
148− (1 << MTIP_DDF_SEC_LOCK_BIT) | \
149− (1 << MTIP_DDF_OVER_TEMP_BIT) | \
147+ MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) |
148+ (1 << MTIP_DDF_SEC_LOCK_BIT) |
149+ (1 << MTIP_DDF_OVER_TEMP_BIT) |
150150 (1 << MTIP_DDF_WRITE_PROTECT_BIT)),
151151
152152 MTIP_DDF_CLEANUP_BIT = 5,
@@ -180,7 +180,7 @@ struct mtip_work { · 27 unmodified lines
180180
181181 #define MTIP_TRIM_TIMEOUT_MS 240000
182182 #define MTIP_MAX_TRIM_ENTRIES 8
183−#define MTIP_MAX_TRIM_ENTRY_LEN 0xfff8
183+#define MTIP_MAX_TRIM_ENTRY_LEN 0xfff8
184184
185185 struct mtip_trim_entry {
186186 u32 lba; /* starting lba of region */
@@ -501,6 +501,10 @@ struct driver_data { · 314 unmodified lines
501501 atomic_t irq_workers_active;
502502
503503 int isr_binding;
504+
505+ struct list_head online_list; /* linkage for online list */
506+
507+ struct list_head remove_list; /* linkage for removing list */
504508 };
505509
506510 #endif
drivers/block/rbd.c+2−1
@@ -1742,9 +1742,10 @@ static int rbd_img_request_submit(struct rbd_img_request *img_request) · 1741 unmodified lines
17421742 struct rbd_device *rbd_dev = img_request->rbd_dev;
17431743 struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
17441744 struct rbd_obj_request *obj_request;
1745+ struct rbd_obj_request *next_obj_request;
17451746
17461747 dout("%s: img %p\n", __func__, img_request);
1747− for_each_obj_request(img_request, obj_request) {
1748+ for_each_obj_request_safe(img_request, obj_request, next_obj_request) {
17481749 int ret;
17491750
17501751 obj_request->callback = rbd_img_obj_callback;
drivers/char/hpet.c+1−13
@@ -373,26 +373,14 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma) · 372 unmodified lines
373373 struct hpet_dev *devp;
374374 unsigned long addr;
375375
376− if (((vma->vm_end - vma->vm_start) != PAGE_SIZE) || vma->vm_pgoff)
377− return -EINVAL;
378−
379376 devp = file->private_data;
380377 addr = devp->hd_hpets->hp_hpet_phys;
381378
382379 if (addr & (PAGE_SIZE - 1))
383380 return -ENOSYS;
384381
385− vma->vm_flags |= VM_IO;
386382 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
387−
388− if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT,
389− PAGE_SIZE, vma->vm_page_prot)) {
390− printk(KERN_ERR "%s: io_remap_pfn_range failed\n",
391− __func__);
392− return -EAGAIN;
393− }
394−
395− return 0;
383+ return vm_iomap_memory(vma, addr, PAGE_SIZE);
396384 #else
397385 return -ENOSYS;
398386 #endif
drivers/cpufreq/intel_pstate.c+0−1
@@ -502,7 +502,6 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu) · 501 unmodified lines
502502
503503 sample_time = cpu->pstate_policy->sample_rate_ms;
504504 delay = msecs_to_jiffies(sample_time);
505− delay -= jiffies % delay;
506505 mod_timer_pinned(&cpu->timer, jiffies + delay);
507506 }
508507
drivers/crypto/ux500/cryp/cryp_core.c+1−1
@@ -1750,7 +1750,7 @@ static struct platform_driver cryp_driver = { · 1749 unmodified lines
17501750 .shutdown = ux500_cryp_shutdown,
17511751 .driver = {
17521752 .owner = THIS_MODULE,
1753− .name = "cryp1"
1753+ .name = "cryp1",
17541754 .pm = &ux500_cryp_pm,
17551755 }
17561756 };
drivers/dma/at_hdmac.c+4−5
@@ -310,8 +310,6 @@ static void atc_complete_all(struct at_dma_chan *atchan) · 309 unmodified lines
310310
311311 dev_vdbg(chan2dev(&atchan->chan_common), "complete all\n");
312312
313− BUG_ON(atc_chan_is_enabled(atchan));
314−
315313 /*
316314 * Submit queued descriptors ASAP, i.e. before we go through
317315 * the completed ones.
@@ -368,6 +366,9 @@ static void atc_advance_work(struct at_dma_chan *atchan) · 50 unmodified lines
368366 {
369367 dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n");
370368
369+ if (atc_chan_is_enabled(atchan))
370+ return;
371+
371372 if (list_empty(&atchan->active_list) ||
372373 list_is_singular(&atchan->active_list)) {
373374 atc_complete_all(atchan);
@@ -1078,9 +1079,7 @@ static void atc_issue_pending(struct dma_chan *chan) · 704 unmodified lines
10781079 return;
10791080
10801081 spin_lock_irqsave(&atchan->lock, flags);
1081− if (!atc_chan_is_enabled(atchan)) {
1082− atc_advance_work(atchan);
1083− }
1082+ atc_advance_work(atchan);
10841083 spin_unlock_irqrestore(&atchan->lock, flags);
10851084 }
10861085
drivers/dma/omap-dma.c+14−6
@@ -276,12 +276,20 @@ static void omap_dma_issue_pending(struct dma_chan *chan) · 275 unmodified lines
276276
277277 spin_lock_irqsave(&c->vc.lock, flags);
278278 if (vchan_issue_pending(&c->vc) && !c->desc) {
279− struct omap_dmadev *d = to_omap_dma_dev(chan->device);
280− spin_lock(&d->lock);
281− if (list_empty(&c->node))
282− list_add_tail(&c->node, &d->pending);
283− spin_unlock(&d->lock);
284− tasklet_schedule(&d->task);
279+ /*
280+ * c->cyclic is used only by audio and in this case the DMA need
281+ * to be started without delay.
282+ */
283+ if (!c->cyclic) {
284+ struct omap_dmadev *d = to_omap_dma_dev(chan->device);
285+ spin_lock(&d->lock);
286+ if (list_empty(&c->node))
287+ list_add_tail(&c->node, &d->pending);
288+ spin_unlock(&d->lock);
289+ tasklet_schedule(&d->task);
290+ } else {
291+ omap_dma_start_desc(c);
292+ }
285293 }
286294 spin_unlock_irqrestore(&c->vc.lock, flags);
287295 }
drivers/dma/pl330.c+27−11
@@ -2882,7 +2882,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) · 2881 unmodified lines
28822882 {
28832883 struct dma_pl330_platdata *pdat;
28842884 struct dma_pl330_dmac *pdmac;
2885− struct dma_pl330_chan *pch;
2885+ struct dma_pl330_chan *pch, *_p;
28862886 struct pl330_info *pi;
28872887 struct dma_device *pd;
28882888 struct resource *res;
@@ -2984,7 +2984,16 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) · 95 unmodified lines
29842984 ret = dma_async_device_register(pd);
29852985 if (ret) {
29862986 dev_err(&adev->dev, "unable to register DMAC\n");
2987− goto probe_err2;
2987+ goto probe_err3;
2988+ }
2989+
2990+ if (adev->dev.of_node) {
2991+ ret = of_dma_controller_register(adev->dev.of_node,
2992+ of_dma_pl330_xlate, pdmac);
2993+ if (ret) {
2994+ dev_err(&adev->dev,
2995+ "unable to register DMA to the generic DT DMA helpers\n");
2996+ }
29882997 }
29892998
29902999 dev_info(&adev->dev,
@@ -2995,16 +3004,21 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) · 4 unmodified lines
29953004 pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan,
29963005 pi->pcfg.num_peri, pi->pcfg.num_events);
29973006
2998− ret = of_dma_controller_register(adev->dev.of_node,
2999− of_dma_pl330_xlate, pdmac);
3000− if (ret) {
3001− dev_err(&adev->dev,
3002− "unable to register DMA to the generic DT DMA helpers\n");
3003− goto probe_err2;
3004− }
3005−
30063007 return 0;
3008+probe_err3:
3009+ amba_set_drvdata(adev, NULL);
30073010
3011+ /* Idle the DMAC */
3012+ list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels,
3013+ chan.device_node) {
3014+
3015+ /* Remove the channel */
3016+ list_del(&pch->chan.device_node);
3017+
3018+ /* Flush the channel */
3019+ pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0);
3020+ pl330_free_chan_resources(&pch->chan);
3021+ }
30083022 probe_err2:
30093023 pl330_del(pi);
30103024 probe_err1:
@@ -3023,8 +3037,10 @@ static int pl330_remove(struct amba_device *adev) · 12 unmodified lines
30233037 if (!pdmac)
30243038 return 0;
30253039
3026− of_dma_controller_free(adev->dev.of_node);
3040+ if (adev->dev.of_node)
3041+ of_dma_controller_free(adev->dev.of_node);
30273042
3043+ dma_async_device_unregister(&pdmac->ddma);
30283044 amba_set_drvdata(adev, NULL);
30293045
30303046 /* Idle the DMAC */
drivers/eisa/pci_eisa.c+46−21
@@ -19,10 +19,10 @@ · 18 unmodified lines
1919 /* There is only *one* pci_eisa device per machine, right ? */
2020 static struct eisa_root_device pci_eisa_root;
2121
22−static int __init pci_eisa_init(struct pci_dev *pdev,
23− const struct pci_device_id *ent)
22+static int __init pci_eisa_init(struct pci_dev *pdev)
2423 {
25− int rc;
24+ int rc, i;
25+ struct resource *res, *bus_res = NULL;
2626
2727 if ((rc = pci_enable_device (pdev))) {
2828 printk (KERN_ERR "pci_eisa : Could not enable device %s\n",
@@ -30,9 +30,30 @@ static int __init pci_eisa_init(struct pci_dev *pdev, · 1 unmodified line
3030 return rc;
3131 }
3232
33+ /*
34+ * The Intel 82375 PCI-EISA bridge is a subtractive-decode PCI
35+ * device, so the resources available on EISA are the same as those
36+ * available on the 82375 bus. This works the same as a PCI-PCI
37+ * bridge in subtractive-decode mode (see pci_read_bridge_bases()).
38+ * We assume other PCI-EISA bridges are similar.
39+ *
40+ * eisa_root_register() can only deal with a single io port resource,
41+ * so we use the first valid io port resource.
42+ */
43+ pci_bus_for_each_resource(pdev->bus, res, i)
44+ if (res && (res->flags & IORESOURCE_IO)) {
45+ bus_res = res;
46+ break;
47+ }
48+
49+ if (!bus_res) {
50+ dev_err(&pdev->dev, "No resources available\n");
51+ return -1;
52+ }
53+
3354 pci_eisa_root.dev = &pdev->dev;
34− pci_eisa_root.res = pdev->bus->resource[0];
35− pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start;
55+ pci_eisa_root.res = bus_res;
56+ pci_eisa_root.bus_base_addr = bus_res->start;
3657 pci_eisa_root.slots = EISA_MAX_SLOTS;
3758 pci_eisa_root.dma_mask = pdev->dma_mask;
3859 dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root);
@@ -45,22 +66,26 @@ static int __init pci_eisa_init(struct pci_dev *pdev, · 6 unmodified lines
4566 return 0;
4667 }
4768
48−static struct pci_device_id pci_eisa_pci_tbl[] = {
49− { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
50− PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 },
51− { 0, }
52−};
69+/*
70+ * We have to call pci_eisa_init_early() before pnpacpi_init()/isapnp_init().
71+ * Otherwise pnp resource will get enabled early and could prevent eisa
72+ * to be initialized.
73+ * Also need to make sure pci_eisa_init_early() is called after
74+ * x86/pci_subsys_init().
75+ * So need to use subsys_initcall_sync with it.
76+ */
77+static int __init pci_eisa_init_early(void)
78+{
79+ struct pci_dev *dev = NULL;
80+ int ret;
5381
54−static struct pci_driver __refdata pci_eisa_driver = {
55− .name = "pci_eisa",
56− .id_table = pci_eisa_pci_tbl,
57− .probe = pci_eisa_init,
58−};
82+ for_each_pci_dev(dev)
83+ if ((dev->class >> 8) == PCI_CLASS_BRIDGE_EISA) {
84+ ret = pci_eisa_init(dev);
85+ if (ret)
86+ return ret;
87+ }
5988
60−static int __init pci_eisa_init_module (void)
61−{
62− return pci_register_driver (&pci_eisa_driver);
89+ return 0;
6390 }
64−
65−device_initcall(pci_eisa_init_module);
66−MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl);
91+subsys_initcall_sync(pci_eisa_init_early);
drivers/firmware/Kconfig+1−0
@@ -39,6 +39,7 @@ config FIRMWARE_MEMMAP · 38 unmodified lines
3939 config EFI_VARS
4040 tristate "EFI Variable Support via sysfs"
4141 depends on EFI
42+ select UCS2_STRING
4243 default n
4344 help
4445 If you say Y here, you are able to get EFI (Extensible Firmware
drivers/firmware/efivars.c+21−77
@@ -80,6 +80,7 @@ · 79 unmodified lines
8080 #include <linux/slab.h>
8181 #include <linux/pstore.h>
8282 #include <linux/ctype.h>
83+#include <linux/ucs2_string.h>
8384
8485 #include <linux/fs.h>
8586 #include <linux/ramfs.h>
@@ -172,51 +173,6 @@ static void efivar_update_sysfs_entries(struct work_struct *); · 86 unmodified lines
172173 static DECLARE_WORK(efivar_work, efivar_update_sysfs_entries);
173174 static bool efivar_wq_enabled = true;
174175
175−/* Return the number of unicode characters in data */
176−static unsigned long
177−utf16_strnlen(efi_char16_t *s, size_t maxlength)
178−{
179− unsigned long length = 0;
180−
181− while (*s++ != 0 && length < maxlength)
182− length++;
183− return length;
184−}
185−
186−static inline unsigned long
187−utf16_strlen(efi_char16_t *s)
188−{
189− return utf16_strnlen(s, ~0UL);
190−}
191−
192−/*
193− * Return the number of bytes is the length of this string
194− * Note: this is NOT the same as the number of unicode characters
195− */
196−static inline unsigned long
197−utf16_strsize(efi_char16_t *data, unsigned long maxlength)
198−{
199− return utf16_strnlen(data, maxlength/sizeof(efi_char16_t)) * sizeof(efi_char16_t);
200−}
201−
202−static inline int
203−utf16_strncmp(const efi_char16_t *a, const efi_char16_t *b, size_t len)
204−{
205− while (1) {
206− if (len == 0)
207− return 0;
208− if (*a < *b)
209− return -1;
210− if (*a > *b)
211− return 1;
212− if (*a == 0) /* implies *b == 0 */
213− return 0;
214− a++;
215− b++;
216− len--;
217− }
218−}
219−
220176 static bool
221177 validate_device_path(struct efi_variable *var, int match, u8 *buffer,
222178 unsigned long len)
@@ -268,7 +224,7 @@ validate_load_option(struct efi_variable *var, int match, u8 *buffer, · 45 unmodified lines
268224 u16 filepathlength;
269225 int i, desclength = 0, namelen;
270226
271− namelen = utf16_strnlen(var->VariableName, sizeof(var->VariableName));
227+ namelen = ucs2_strnlen(var->VariableName, sizeof(var->VariableName));
272228
273229 /* Either "Boot" or "Driver" followed by four digits of hex */
274230 for (i = match; i < match+4; i++) {
@@ -291,7 +247,7 @@ validate_load_option(struct efi_variable *var, int match, u8 *buffer, · 16 unmodified lines
291247 * There's no stored length for the description, so it has to be
292248 * found by hand
293249 */
294− desclength = utf16_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2;
250+ desclength = ucs2_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2;
295251
296252 /* Each boot entry must have a descriptor */
297253 if (!desclength)
@@ -436,24 +392,12 @@ static efi_status_t · 138 unmodified lines
436392 check_var_size_locked(struct efivars *efivars, u32 attributes,
437393 unsigned long size)
438394 {
439− u64 storage_size, remaining_size, max_size;
440− efi_status_t status;
441395 const struct efivar_operations *fops = efivars->ops;
442396
443− if (!efivars->ops->query_variable_info)
397+ if (!efivars->ops->query_variable_store)
444398 return EFI_UNSUPPORTED;
445399
446− status = fops->query_variable_info(attributes, &storage_size,
447− &remaining_size, &max_size);
448−
449− if (status != EFI_SUCCESS)
450− return status;
451−
452− if (!storage_size || size > remaining_size || size > max_size ||
453− (remaining_size - size) < (storage_size / 2))
454− return EFI_OUT_OF_RESOURCES;
455−
456− return status;
400+ return fops->query_variable_store(attributes, size);
457401 }
458402
459403
@@ -593,7 +537,7 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count) · 133 unmodified lines
593537 spin_lock_irq(&efivars->lock);
594538
595539 status = check_var_size_locked(efivars, new_var->Attributes,
596− new_var->DataSize + utf16_strsize(new_var->VariableName, 1024));
540+ new_var->DataSize + ucs2_strsize(new_var->VariableName, 1024));
597541
598542 if (status == EFI_SUCCESS || status == EFI_UNSUPPORTED)
599543 status = efivars->ops->set_variable(new_var->VariableName,
@@ -771,7 +715,7 @@ static ssize_t efivarfs_file_write(struct file *file, · 171 unmodified lines
771715 * QueryVariableInfo() isn't supported by the firmware.
772716 */
773717
774− varsize = datasize + utf16_strsize(var->var.VariableName, 1024);
718+ varsize = datasize + ucs2_strsize(var->var.VariableName, 1024);
775719 status = check_var_size(efivars, attributes, varsize);
776720
777721 if (status != EFI_SUCCESS) {
@@ -1223,7 +1167,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) · 445 unmodified lines
12231167
12241168 inode = NULL;
12251169
1226− len = utf16_strlen(entry->var.VariableName);
1170+ len = ucs2_strlen(entry->var.VariableName);
12271171
12281172 /* name, plus '-', plus GUID, plus NUL*/
12291173 name = kmalloc(len + 1 + GUID_LEN + 1, GFP_ATOMIC);
@@ -1481,8 +1425,8 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, · 251 unmodified lines
14811425
14821426 if (efi_guidcmp(entry->var.VendorGuid, vendor))
14831427 continue;
1484− if (utf16_strncmp(entry->var.VariableName, efi_name,
1485− utf16_strlen(efi_name))) {
1428+ if (ucs2_strncmp(entry->var.VariableName, efi_name,
1429+ ucs2_strlen(efi_name))) {
14861430 /*
14871431 * Check if an old format,
14881432 * which doesn't support holding
@@ -1494,8 +1438,8 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, · 5 unmodified lines
14941438 for (i = 0; i < DUMP_NAME_LEN; i++)
14951439 efi_name_old[i] = name_old[i];
14961440
1497− if (utf16_strncmp(entry->var.VariableName, efi_name_old,
1498− utf16_strlen(efi_name_old)))
1441+ if (ucs2_strncmp(entry->var.VariableName, efi_name_old,
1442+ ucs2_strlen(efi_name_old)))
14991443 continue;
15001444 }
15011445
@@ -1573,8 +1517,8 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, · 71 unmodified lines
15731517 * Does this variable already exist?
15741518 */
15751519 list_for_each_entry_safe(search_efivar, n, &efivars->list, list) {
1576− strsize1 = utf16_strsize(search_efivar->var.VariableName, 1024);
1577− strsize2 = utf16_strsize(new_var->VariableName, 1024);
1520+ strsize1 = ucs2_strsize(search_efivar->var.VariableName, 1024);
1521+ strsize2 = ucs2_strsize(new_var->VariableName, 1024);
15781522 if (strsize1 == strsize2 &&
15791523 !memcmp(&(search_efivar->var.VariableName),
15801524 new_var->VariableName, strsize1) &&
@@ -1590,7 +1534,7 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, · 9 unmodified lines
15901534 }
15911535
15921536 status = check_var_size_locked(efivars, new_var->Attributes,
1593− new_var->DataSize + utf16_strsize(new_var->VariableName, 1024));
1537+ new_var->DataSize + ucs2_strsize(new_var->VariableName, 1024));
15941538
15951539 if (status && status != EFI_UNSUPPORTED) {
15961540 spin_unlock_irq(&efivars->lock);
@@ -1614,7 +1558,7 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, · 17 unmodified lines
16141558
16151559 /* Create the entry in sysfs. Locking is not required here */
16161560 status = efivar_create_sysfs_entry(efivars,
1617− utf16_strsize(new_var->VariableName,
1561+ ucs2_strsize(new_var->VariableName,
16181562 1024),
16191563 new_var->VariableName,
16201564 &new_var->VendorGuid);
@@ -1644,8 +1588,8 @@ static ssize_t efivar_delete(struct file *filp, struct kobject *kobj, · 23 unmodified lines
16441588 * Does this variable already exist?
16451589 */
16461590 list_for_each_entry_safe(search_efivar, n, &efivars->list, list) {
1647− strsize1 = utf16_strsize(search_efivar->var.VariableName, 1024);
1648− strsize2 = utf16_strsize(del_var->VariableName, 1024);
1591+ strsize1 = ucs2_strsize(search_efivar->var.VariableName, 1024);
1592+ strsize2 = ucs2_strsize(del_var->VariableName, 1024);
16491593 if (strsize1 == strsize2 &&
16501594 !memcmp(&(search_efivar->var.VariableName),
16511595 del_var->VariableName, strsize1) &&
@@ -1691,9 +1635,9 @@ static bool variable_is_present(efi_char16_t *variable_name, efi_guid_t *vendor) · 39 unmodified lines
16911635 unsigned long strsize1, strsize2;
16921636 bool found = false;
16931637
1694− strsize1 = utf16_strsize(variable_name, 1024);
1638+ strsize1 = ucs2_strsize(variable_name, 1024);
16951639 list_for_each_entry_safe(entry, n, &efivars->list, list) {
1696− strsize2 = utf16_strsize(entry->var.VariableName, 1024);
1640+ strsize2 = ucs2_strsize(entry->var.VariableName, 1024);
16971641 if (strsize1 == strsize2 &&
16981642 !memcmp(variable_name, &(entry->var.VariableName),
16991643 strsize2) &&
@@ -2131,7 +2075,7 @@ efivars_init(void) · 431 unmodified lines
21312075 ops.get_variable = efi.get_variable;
21322076 ops.set_variable = efi.set_variable;
21332077 ops.get_next_variable = efi.get_next_variable;
2134− ops.query_variable_info = efi.query_variable_info;
2078+ ops.query_variable_store = efi_query_variable_store;
21352079
21362080 error = register_efivars(&__efivars, &ops, efi_kobj);
21372081 if (error)
drivers/gpio/gpio-pca953x.c+1−1
@@ -575,7 +575,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, · 574 unmodified lines
575575 chip->gpio_chip.ngpio,
576576 irq_base,
577577 &pca953x_irq_simple_ops,
578− NULL);
578+ chip);
579579 if (!chip->domain)
580580 return -ENODEV;
581581
drivers/gpu/drm/drm_fb_helper.c+5−3
@@ -1544,10 +1544,10 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) · 1543 unmodified lines
15441544 if (!fb_helper->fb)
15451545 return 0;
15461546
1547− drm_modeset_lock_all(dev);
1547+ mutex_lock(&fb_helper->dev->mode_config.mutex);
15481548 if (!drm_fb_helper_is_bound(fb_helper)) {
15491549 fb_helper->delayed_hotplug = true;
1550− drm_modeset_unlock_all(dev);
1550+ mutex_unlock(&fb_helper->dev->mode_config.mutex);
15511551 return 0;
15521552 }
15531553 DRM_DEBUG_KMS("\n");
@@ -1558,9 +1558,11 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) · 4 unmodified lines
15581558
15591559 count = drm_fb_helper_probe_connector_modes(fb_helper, max_width,
15601560 max_height);
1561+ mutex_unlock(&fb_helper->dev->mode_config.mutex);
1562+
1563+ drm_modeset_lock_all(dev);
15611564 drm_setup_crtcs(fb_helper);
15621565 drm_modeset_unlock_all(dev);
1563−
15641566 drm_fb_helper_set_par(fb_helper->fbdev);
15651567
15661568 return 0;
drivers/gpu/drm/mgag200/mgag200_mode.c+3−10
@@ -751,8 +751,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 750 unmodified lines
751751 int i;
752752 unsigned char misc = 0;
753753 unsigned char ext_vga[6];
754− unsigned char ext_vga_index24;
755− unsigned char dac_index90 = 0;
756754 u8 bppshift;
757755
758756 static unsigned char dacvalue[] = {
@@ -803,7 +801,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 44 unmodified lines
803801 option2 = 0x0000b000;
804802 break;
805803 case G200_ER:
806− dac_index90 = 0;
807804 break;
808805 }
809806
@@ -852,10 +849,8 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 42 unmodified lines
852849 WREG_DAC(i, dacvalue[i]);
853850 }
854851
855− if (mdev->type == G200_ER) {
856− WREG_DAC(0x90, dac_index90);
857− }
858−
852+ if (mdev->type == G200_ER)
853+ WREG_DAC(0x90, 0);
859854
860855 if (option)
861856 pci_write_config_dword(dev->pdev, PCI_MGA_OPTION, option);
@@ -952,8 +947,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 90 unmodified lines
952947 if (mdev->type == G200_WB)
953948 ext_vga[1] |= 0x88;
954949
955− ext_vga_index24 = 0x05;
956−
957950 /* Set pixel clocks */
958951 misc = 0x2d;
959952 WREG8(MGA_MISC_OUT, misc);
@@ -965,7 +958,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 5 unmodified lines
965958 }
966959
967960 if (mdev->type == G200_ER)
968− WREG_ECRT(24, ext_vga_index24);
961+ WREG_ECRT(0x24, 0x5);
969962
970963 if (mdev->type == G200_EV) {
971964 WREG_ECRT(6, 0);
drivers/gpu/drm/nouveau/core/subdev/bios/base.c+17−0
@@ -248,6 +248,22 @@ nouveau_bios_shadow_pci(struct nouveau_bios *bios) · 247 unmodified lines
248248 }
249249 }
250250
251+static void
252+nouveau_bios_shadow_platform(struct nouveau_bios *bios)
253+{
254+ struct pci_dev *pdev = nv_device(bios)->pdev;
255+ size_t size;
256+
257+ void __iomem *rom = pci_platform_rom(pdev, &size);
258+ if (rom && size) {
259+ bios->data = kmalloc(size, GFP_KERNEL);
260+ if (bios->data) {
261+ memcpy_fromio(bios->data, rom, size);
262+ bios->size = size;
263+ }
264+ }
265+}
266+
251267 static int
252268 nouveau_bios_score(struct nouveau_bios *bios, const bool writeable)
253269 {
@@ -288,6 +304,7 @@ nouveau_bios_shadow(struct nouveau_bios *bios) · 34 unmodified lines
288304 { "PROM", nouveau_bios_shadow_prom, false, 0, 0, NULL },
289305 { "ACPI", nouveau_bios_shadow_acpi, true, 0, 0, NULL },
290306 { "PCIROM", nouveau_bios_shadow_pci, true, 0, 0, NULL },
307+ { "PLATFORM", nouveau_bios_shadow_platform, true, 0, 0, NULL },
291308 {}
292309 };
293310 struct methods *mthd, *best;
drivers/gpu/drm/nouveau/nv50_display.c+1−1
@@ -479,7 +479,7 @@ nv50_display_flip_wait(void *data) · 478 unmodified lines
479479 {
480480 struct nv50_display_flip *flip = data;
481481 if (nouveau_bo_rd32(flip->disp->sync, flip->chan->addr / 4) ==
482− flip->chan->data);
482+ flip->chan->data)
483483 return true;
484484 usleep_range(1, 2);
485485 return false;
drivers/gpu/drm/radeon/radeon_bios.c+26−0
@@ -99,6 +99,29 @@ static bool radeon_read_bios(struct radeon_device *rdev) · 98 unmodified lines
9999 return true;
100100 }
101101
102+static bool radeon_read_platform_bios(struct radeon_device *rdev)
103+{
104+ uint8_t __iomem *bios;
105+ size_t size;
106+
107+ rdev->bios = NULL;
108+
109+ bios = pci_platform_rom(rdev->pdev, &size);
110+ if (!bios) {
111+ return false;
112+ }
113+
114+ if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
115+ return false;
116+ }
117+ rdev->bios = kmemdup(bios, size, GFP_KERNEL);
118+ if (rdev->bios == NULL) {
119+ return false;
120+ }
121+
122+ return true;
123+}
124+
102125 #ifdef CONFIG_ACPI
103126 /* ATRM is used to get the BIOS on the discrete cards in
104127 * dual-gpu systems.
@@ -620,6 +643,9 @@ bool radeon_get_bios(struct radeon_device *rdev) · 515 unmodified lines
620643 if (r == false) {
621644 r = radeon_read_disabled_bios(rdev);
622645 }
646+ if (r == false) {
647+ r = radeon_read_platform_bios(rdev);
648+ }
623649 if (r == false || rdev->bios == NULL) {
624650 DRM_ERROR("Unable to locate a BIOS ROM\n");
625651 rdev->bios = NULL;
drivers/gpu/drm/udl/udl_connector.c+4−0
@@ -61,6 +61,10 @@ static int udl_get_modes(struct drm_connector *connector) · 60 unmodified lines
6161 int ret;
6262
6363 edid = (struct edid *)udl_get_edid(udl);
64+ if (!edid) {
65+ drm_mode_connector_update_edid_property(connector, NULL);
66+ return 0;
67+ }
6468
6569 /*
6670 * We only read the main block, but if the monitor reports extension
drivers/hwspinlock/hwspinlock_core.c+2−0
@@ -416,6 +416,8 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock) · 415 unmodified lines
416416 ret = pm_runtime_get_sync(dev);
417417 if (ret < 0) {
418418 dev_err(dev, "%s: can't power on device\n", __func__);
419+ pm_runtime_put_noidle(dev);
420+ module_put(dev->driver->owner);
419421 return ret;
420422 }
421423
drivers/idle/intel_idle.c+1−0
@@ -465,6 +465,7 @@ static const struct x86_cpu_id intel_idle_ids[] = { · 464 unmodified lines
465465 ICPU(0x3c, idle_cpu_hsw),
466466 ICPU(0x3f, idle_cpu_hsw),
467467 ICPU(0x45, idle_cpu_hsw),
468+ ICPU(0x46, idle_cpu_hsw),
468469 {}
469470 };
470471 MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids);
drivers/input/tablet/wacom_wac.c+4−4
@@ -359,7 +359,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) · 358 unmodified lines
359359 case 0x802: /* Intuos4 General Pen */
360360 case 0x804: /* Intuos4 Marker Pen */
361361 case 0x40802: /* Intuos4 Classic Pen */
362− case 0x18803: /* DTH2242 Grip Pen */
362+ case 0x18802: /* DTH2242 Grip Pen */
363363 case 0x022:
364364 wacom->tool[idx] = BTN_TOOL_PEN;
365365 break;
@@ -1912,7 +1912,7 @@ static const struct wacom_features wacom_features_0xBB = · 1546 unmodified lines
19121912 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047,
19131913 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
19141914 static const struct wacom_features wacom_features_0xBC =
1915− { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047,
1915+ { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40640, 25400, 2047,
19161916 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
19171917 static const struct wacom_features wacom_features_0x26 =
19181918 { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
@@ -2144,7 +2144,7 @@ const struct usb_device_id wacom_ids[] = { · 225 unmodified lines
21442144 { USB_DEVICE_WACOM(0x44) },
21452145 { USB_DEVICE_WACOM(0x45) },
21462146 { USB_DEVICE_WACOM(0x59) },
2147− { USB_DEVICE_WACOM(0x5D) },
2147+ { USB_DEVICE_DETAILED(0x5D, USB_CLASS_HID, 0, 0) },
21482148 { USB_DEVICE_WACOM(0xB0) },
21492149 { USB_DEVICE_WACOM(0xB1) },
21502150 { USB_DEVICE_WACOM(0xB2) },
@@ -2209,7 +2209,7 @@ const struct usb_device_id wacom_ids[] = { · 58 unmodified lines
22092209 { USB_DEVICE_WACOM(0x47) },
22102210 { USB_DEVICE_WACOM(0xF4) },
22112211 { USB_DEVICE_WACOM(0xF8) },
2212− { USB_DEVICE_WACOM(0xF6) },
2212+ { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) },
22132213 { USB_DEVICE_WACOM(0xFA) },
22142214 { USB_DEVICE_LENOVO(0x6004) },
22152215 { }
drivers/irqchip/irq-gic.c+2−1
@@ -236,7 +236,8 @@ static int gic_retrigger(struct irq_data *d) · 235 unmodified lines
236236 if (gic_arch_extn.irq_retrigger)
237237 return gic_arch_extn.irq_retrigger(d);
238238
239− return -ENXIO;
239+ /* the genirq layer expects 0 if we can't retrigger in hardware */
240+ return 0;
240241 }
241242
242243 #ifdef CONFIG_SMP
drivers/md/dm-cache-target.c+38−13
@@ -6,6 +6,7 @@ · 5 unmodified lines
66
77 #include "dm.h"
88 #include "dm-bio-prison.h"
9+#include "dm-bio-record.h"
910 #include "dm-cache-metadata.h"
1011
1112 #include <linux/dm-io.h>
@@ -201,10 +202,15 @@ struct per_bio_data { · 189 unmodified lines
201202 unsigned req_nr:2;
202203 struct dm_deferred_entry *all_io_entry;
203204
204− /* writethrough fields */
205+ /*
206+ * writethrough fields. These MUST remain at the end of this
207+ * structure and the 'cache' member must be the first as it
208+ * is used to determine the offsetof the writethrough fields.
209+ */
205210 struct cache *cache;
206211 dm_cblock_t cblock;
207212 bio_end_io_t *saved_bi_end_io;
213+ struct dm_bio_details bio_details;
208214 };
209215
210216 struct dm_cache_migration {
@@ -513,16 +519,28 @@ static void save_stats(struct cache *cache) · 302 unmodified lines
513519 /*----------------------------------------------------------------
514520 * Per bio data
515521 *--------------------------------------------------------------*/
516−static struct per_bio_data *get_per_bio_data(struct bio *bio)
522+
523+/*
524+ * If using writeback, leave out struct per_bio_data's writethrough fields.
525+ */
526+#define PB_DATA_SIZE_WB (offsetof(struct per_bio_data, cache))
527+#define PB_DATA_SIZE_WT (sizeof(struct per_bio_data))
528+
529+static size_t get_per_bio_data_size(struct cache *cache)
530+{
531+ return cache->features.write_through ? PB_DATA_SIZE_WT : PB_DATA_SIZE_WB;
532+}
533+
534+static struct per_bio_data *get_per_bio_data(struct bio *bio, size_t data_size)
517535 {
518− struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data));
536+ struct per_bio_data *pb = dm_per_bio_data(bio, data_size);
519537 BUG_ON(!pb);
520538 return pb;
521539 }
522540
523−static struct per_bio_data *init_per_bio_data(struct bio *bio)
541+static struct per_bio_data *init_per_bio_data(struct bio *bio, size_t data_size)
524542 {
525− struct per_bio_data *pb = get_per_bio_data(bio);
543+ struct per_bio_data *pb = get_per_bio_data(bio, data_size);
526544
527545 pb->tick = false;
528546 pb->req_nr = dm_bio_get_target_bio_nr(bio);
@@ -556,7 +574,8 @@ static void remap_to_cache(struct cache *cache, struct bio *bio, · 27 unmodified lines
556574 static void check_if_tick_bio_needed(struct cache *cache, struct bio *bio)
557575 {
558576 unsigned long flags;
559− struct per_bio_data *pb = get_per_bio_data(bio);
577+ size_t pb_data_size = get_per_bio_data_size(cache);
578+ struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);
560579
561580 spin_lock_irqsave(&cache->lock, flags);
562581 if (cache->need_tick_bio &&
@@ -635,7 +654,7 @@ static void defer_writethrough_bio(struct cache *cache, struct bio *bio) · 72 unmodified lines
635654
636655 static void writethrough_endio(struct bio *bio, int err)
637656 {
638− struct per_bio_data *pb = get_per_bio_data(bio);
657+ struct per_bio_data *pb = get_per_bio_data(bio, PB_DATA_SIZE_WT);
639658 bio->bi_end_io = pb->saved_bi_end_io;
640659
641660 if (err) {
@@ -643,6 +662,7 @@ static void writethrough_endio(struct bio *bio, int err) · 1 unmodified line
643662 return;
644663 }
645664
665+ dm_bio_restore(&pb->bio_details, bio);
646666 remap_to_cache(pb->cache, bio, pb->cblock);
647667
648668 /*
@@ -662,11 +682,12 @@ static void writethrough_endio(struct bio *bio, int err) · 13 unmodified lines
662682 static void remap_to_origin_then_cache(struct cache *cache, struct bio *bio,
663683 dm_oblock_t oblock, dm_cblock_t cblock)
664684 {
665− struct per_bio_data *pb = get_per_bio_data(bio);
685+ struct per_bio_data *pb = get_per_bio_data(bio, PB_DATA_SIZE_WT);
666686
667687 pb->cache = cache;
668688 pb->cblock = cblock;
669689 pb->saved_bi_end_io = bio->bi_end_io;
690+ dm_bio_record(&pb->bio_details, bio);
670691 bio->bi_end_io = writethrough_endio;
671692
672693 remap_to_origin_clear_discard(pb->cache, bio, oblock);
@@ -1035,7 +1056,8 @@ static void defer_bio(struct cache *cache, struct bio *bio) · 362 unmodified lines
10351056
10361057 static void process_flush_bio(struct cache *cache, struct bio *bio)
10371058 {
1038− struct per_bio_data *pb = get_per_bio_data(bio);
1059+ size_t pb_data_size = get_per_bio_data_size(cache);
1060+ struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);
10391061
10401062 BUG_ON(bio->bi_size);
10411063 if (!pb->req_nr)
@@ -1107,7 +1129,8 @@ static void process_bio(struct cache *cache, struct prealloc *structs, · 65 unmodified lines
11071129 dm_oblock_t block = get_bio_block(cache, bio);
11081130 struct dm_bio_prison_cell *cell_prealloc, *old_ocell, *new_ocell;
11091131 struct policy_result lookup_result;
1110− struct per_bio_data *pb = get_per_bio_data(bio);
1132+ size_t pb_data_size = get_per_bio_data_size(cache);
1133+ struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);
11111134 bool discarded_block = is_discarded_oblock(cache, block);
11121135 bool can_migrate = discarded_block || spare_migration_bandwidth(cache);
11131136
@@ -1881,7 +1904,6 @@ static int cache_create(struct cache_args *ca, struct cache **result) · 767 unmodified lines
18811904
18821905 cache->ti = ca->ti;
18831906 ti->private = cache;
1884− ti->per_bio_data_size = sizeof(struct per_bio_data);
18851907 ti->num_flush_bios = 2;
18861908 ti->flush_supported = true;
18871909
@@ -1890,6 +1912,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) · 2 unmodified lines
18901912 ti->discard_zeroes_data_unsupported = true;
18911913
18921914 memcpy(&cache->features, &ca->features, sizeof(cache->features));
1915+ ti->per_bio_data_size = get_per_bio_data_size(cache);
18931916
18941917 cache->callbacks.congested_fn = cache_is_congested;
18951918 dm_table_add_target_callbacks(ti->table, &cache->callbacks);
@@ -2092,6 +2115,7 @@ static int cache_map(struct dm_target *ti, struct bio *bio) · 196 unmodified lines
20922115
20932116 int r;
20942117 dm_oblock_t block = get_bio_block(cache, bio);
2118+ size_t pb_data_size = get_per_bio_data_size(cache);
20952119 bool can_migrate = false;
20962120 bool discarded_block;
20972121 struct dm_bio_prison_cell *cell;
@@ -2108,7 +2132,7 @@ static int cache_map(struct dm_target *ti, struct bio *bio) · 10 unmodified lines
21082132 return DM_MAPIO_REMAPPED;
21092133 }
21102134
2111− pb = init_per_bio_data(bio);
2135+ pb = init_per_bio_data(bio, pb_data_size);
21122136
21132137 if (bio->bi_rw & (REQ_FLUSH | REQ_FUA | REQ_DISCARD)) {
21142138 defer_bio(cache, bio);
@@ -2193,7 +2217,8 @@ static int cache_end_io(struct dm_target *ti, struct bio *bio, int error) · 78 unmodified lines
21932217 {
21942218 struct cache *cache = ti->private;
21952219 unsigned long flags;
2196− struct per_bio_data *pb = get_per_bio_data(bio);
2220+ size_t pb_data_size = get_per_bio_data_size(cache);
2221+ struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size);
21972222
21982223 if (pb->tick) {
21992224 policy_tick(cache->policy);
drivers/md/dm.c+1−0
@@ -611,6 +611,7 @@ static void dec_pending(struct dm_io *io, int error) · 610 unmodified lines
611611 queue_io(md, bio);
612612 } else {
613613 /* done with normal IO or empty flush */
614+ trace_block_bio_complete(md->queue, bio, io_error);
614615 bio_endio(bio, io_error);
615616 }
616617 }
drivers/md/raid5.c+10−1
@@ -184,6 +184,8 @@ static void return_io(struct bio *return_bi) · 183 unmodified lines
184184 return_bi = bi->bi_next;
185185 bi->bi_next = NULL;
186186 bi->bi_size = 0;
187+ trace_block_bio_complete(bdev_get_queue(bi->bi_bdev),
188+ bi, 0);
187189 bio_endio(bi, 0);
188190 bi = return_bi;
189191 }
@@ -3914,6 +3916,8 @@ static void raid5_align_endio(struct bio *bi, int error) · 3724 unmodified lines
39143916 rdev_dec_pending(rdev, conf->mddev);
39153917
39163918 if (!error && uptodate) {
3919+ trace_block_bio_complete(bdev_get_queue(raid_bi->bi_bdev),
3920+ raid_bi, 0);
39173921 bio_endio(raid_bi, 0);
39183922 if (atomic_dec_and_test(&conf->active_aligned_reads))
39193923 wake_up(&conf->wait_for_stripe);
@@ -4382,6 +4386,8 @@ static void make_request(struct mddev *mddev, struct bio * bi) · 462 unmodified lines
43824386 if ( rw == WRITE )
43834387 md_write_end(mddev);
43844388
4389+ trace_block_bio_complete(bdev_get_queue(bi->bi_bdev),
4390+ bi, 0);
43854391 bio_endio(bi, 0);
43864392 }
43874393 }
@@ -4758,8 +4764,11 @@ static int retry_aligned_read(struct r5conf *conf, struct bio *raid_bio) · 370 unmodified lines
47584764 handled++;
47594765 }
47604766 remaining = raid5_dec_bi_active_stripes(raid_bio);
4761− if (remaining == 0)
4767+ if (remaining == 0) {
4768+ trace_block_bio_complete(bdev_get_queue(raid_bio->bi_bdev),
4769+ raid_bio, 0);
47624770 bio_endio(raid_bio, 0);
4771+ }
47634772 if (atomic_dec_and_test(&conf->active_aligned_reads))
47644773 wake_up(&conf->wait_for_stripe);
47654774 return handled;
drivers/misc/vmw_vmci/Kconfig+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 config VMWARE_VMCI
66 tristate "VMware VMCI Driver"
7− depends on X86 && PCI
7+ depends on X86 && PCI && NET
88 help
99 This is VMware's Virtual Machine Communication Interface. It enables
1010 high-speed communication between host and guest in a virtual
drivers/mtd/mtdchar.c+2−57
@@ -1123,33 +1123,6 @@ static unsigned long mtdchar_get_unmapped_area(struct file *file, · 1122 unmodified lines
11231123 }
11241124 #endif
11251125
1126−static inline unsigned long get_vm_size(struct vm_area_struct *vma)
1127−{
1128− return vma->vm_end - vma->vm_start;
1129−}
1130−
1131−static inline resource_size_t get_vm_offset(struct vm_area_struct *vma)
1132−{
1133− return (resource_size_t) vma->vm_pgoff << PAGE_SHIFT;
1134−}
1135−
1136−/*
1137− * Set a new vm offset.
1138− *
1139− * Verify that the incoming offset really works as a page offset,
1140− * and that the offset and size fit in a resource_size_t.
1141− */
1142−static inline int set_vm_offset(struct vm_area_struct *vma, resource_size_t off)
1143−{
1144− pgoff_t pgoff = off >> PAGE_SHIFT;
1145− if (off != (resource_size_t) pgoff << PAGE_SHIFT)
1146− return -EINVAL;
1147− if (off + get_vm_size(vma) - 1 < off)
1148− return -EINVAL;
1149− vma->vm_pgoff = pgoff;
1150− return 0;
1151−}
1152−
11531126 /*
11541127 * set up a mapping for shared memory segments
11551128 */
@@ -1159,45 +1132,17 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma) · 3 unmodified lines
11591132 struct mtd_file_info *mfi = file->private_data;
11601133 struct mtd_info *mtd = mfi->mtd;
11611134 struct map_info *map = mtd->priv;
1162− resource_size_t start, off;
1163− unsigned long len, vma_len;
11641135
11651136 /* This is broken because it assumes the MTD device is map-based
11661137 and that mtd->priv is a valid struct map_info. It should be
11671138 replaced with something that uses the mtd_get_unmapped_area()
11681139 operation properly. */
11691140 if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/) {
1170− off = get_vm_offset(vma);
1171− start = map->phys;
1172− len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size);
1173− start &= PAGE_MASK;
1174− vma_len = get_vm_size(vma);
1175−
1176− /* Overflow in off+len? */
1177− if (vma_len + off < off)
1178− return -EINVAL;
1179− /* Does it fit in the mapping? */
1180− if (vma_len + off > len)
1181− return -EINVAL;
1182−
1183− off += start;
1184− /* Did that overflow? */
1185− if (off < start)
1186− return -EINVAL;
1187− if (set_vm_offset(vma, off) < 0)
1188− return -EINVAL;
1189− vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
1190−
11911141 #ifdef pgprot_noncached
1192− if (file->f_flags & O_DSYNC || off >= __pa(high_memory))
1142+ if (file->f_flags & O_DSYNC || map->phys >= __pa(high_memory))
11931143 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
11941144 #endif
1195− if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
1196− vma->vm_end - vma->vm_start,
1197− vma->vm_page_prot))
1198− return -EAGAIN;
1199−
1200− return 0;
1145+ return vm_iomap_memory(vma, map->phys, map->size);
12011146 }
12021147 return -ENOSYS;
12031148 #else
drivers/net/bonding/bond_main.c+73−28
@@ -848,8 +848,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, · 847 unmodified lines
848848 if (bond->dev->flags & IFF_ALLMULTI)
849849 dev_set_allmulti(old_active->dev, -1);
850850
851+ netif_addr_lock_bh(bond->dev);
851852 netdev_for_each_mc_addr(ha, bond->dev)
852853 dev_mc_del(old_active->dev, ha->addr);
854+ netif_addr_unlock_bh(bond->dev);
853855 }
854856
855857 if (new_active) {
@@ -860,8 +862,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, · 4 unmodified lines
860862 if (bond->dev->flags & IFF_ALLMULTI)
861863 dev_set_allmulti(new_active->dev, 1);
862864
865+ netif_addr_lock_bh(bond->dev);
863866 netdev_for_each_mc_addr(ha, bond->dev)
864867 dev_mc_add(new_active->dev, ha->addr);
868+ netif_addr_unlock_bh(bond->dev);
865869 }
866870 }
867871
@@ -1903,11 +1907,29 @@ err_dest_symlinks: · 1035 unmodified lines
19031907 bond_destroy_slave_symlinks(bond_dev, slave_dev);
19041908
19051909 err_detach:
1910+ if (!USES_PRIMARY(bond->params.mode)) {
1911+ netif_addr_lock_bh(bond_dev);
1912+ bond_mc_list_flush(bond_dev, slave_dev);
1913+ netif_addr_unlock_bh(bond_dev);
1914+ }
1915+ bond_del_vlans_from_slave(bond, slave_dev);
19061916 write_lock_bh(&bond->lock);
19071917 bond_detach_slave(bond, new_slave);
1918+ if (bond->primary_slave == new_slave)
1919+ bond->primary_slave = NULL;
19081920 write_unlock_bh(&bond->lock);
1921+ if (bond->curr_active_slave == new_slave) {
1922+ read_lock(&bond->lock);
1923+ write_lock_bh(&bond->curr_slave_lock);
1924+ bond_change_active_slave(bond, NULL);
1925+ bond_select_active_slave(bond);
1926+ write_unlock_bh(&bond->curr_slave_lock);
1927+ read_unlock(&bond->lock);
1928+ }
1929+ slave_disable_netpoll(new_slave);
19091930
19101931 err_close:
1932+ slave_dev->priv_flags &= ~IFF_BONDING;
19111933 dev_close(slave_dev);
19121934
19131935 err_unset_master:
@@ -3172,11 +3194,20 @@ static int bond_slave_netdev_event(unsigned long event, · 1258 unmodified lines
31723194 struct net_device *slave_dev)
31733195 {
31743196 struct slave *slave = bond_slave_get_rtnl(slave_dev);
3175− struct bonding *bond = slave->bond;
3176− struct net_device *bond_dev = slave->bond->dev;
3197+ struct bonding *bond;
3198+ struct net_device *bond_dev;
31773199 u32 old_speed;
31783200 u8 old_duplex;
31793201
3202+ /* A netdev event can be generated while enslaving a device
3203+ * before netdev_rx_handler_register is called in which case
3204+ * slave will be NULL
3205+ */
3206+ if (!slave)
3207+ return NOTIFY_DONE;
3208+ bond_dev = slave->bond->dev;
3209+ bond = slave->bond;
3210+
31803211 switch (event) {
31813212 case NETDEV_UNREGISTER:
31823213 if (bond->setup_by_slave)
@@ -3290,20 +3321,22 @@ static int bond_xmit_hash_policy_l2(struct sk_buff *skb, int count) · 107 unmodified lines
32903321 */
32913322 static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count)
32923323 {
3293− struct ethhdr *data = (struct ethhdr *)skb->data;
3294− struct iphdr *iph;
3295− struct ipv6hdr *ipv6h;
3324+ const struct ethhdr *data;
3325+ const struct iphdr *iph;
3326+ const struct ipv6hdr *ipv6h;
32963327 u32 v6hash;
3297− __be32 *s, *d;
3328+ const __be32 *s, *d;
32983329
32993330 if (skb->protocol == htons(ETH_P_IP) &&
3300− skb_network_header_len(skb) >= sizeof(*iph)) {
3331+ pskb_network_may_pull(skb, sizeof(*iph))) {
33013332 iph = ip_hdr(skb);
3333+ data = (struct ethhdr *)skb->data;
33023334 return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^
33033335 (data->h_dest[5] ^ data->h_source[5])) % count;
33043336 } else if (skb->protocol == htons(ETH_P_IPV6) &&
3305− skb_network_header_len(skb) >= sizeof(*ipv6h)) {
3337+ pskb_network_may_pull(skb, sizeof(*ipv6h))) {
33063338 ipv6h = ipv6_hdr(skb);
3339+ data = (struct ethhdr *)skb->data;
33073340 s = &ipv6h->saddr.s6_addr32[0];
33083341 d = &ipv6h->daddr.s6_addr32[0];
33093342 v6hash = (s[1] ^ d[1]) ^ (s[2] ^ d[2]) ^ (s[3] ^ d[3]);
@@ -3322,33 +3355,36 @@ static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count) · 12 unmodified lines
33223355 static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count)
33233356 {
33243357 u32 layer4_xor = 0;
3325− struct iphdr *iph;
3326− struct ipv6hdr *ipv6h;
3327− __be32 *s, *d;
3328− __be16 *layer4hdr;
3358+ const struct iphdr *iph;
3359+ const struct ipv6hdr *ipv6h;
3360+ const __be32 *s, *d;
3361+ const __be16 *l4 = NULL;
3362+ __be16 _l4[2];
3363+ int noff = skb_network_offset(skb);
3364+ int poff;
33293365
33303366 if (skb->protocol == htons(ETH_P_IP) &&
3331− skb_network_header_len(skb) >= sizeof(*iph)) {
3367+ pskb_may_pull(skb, noff + sizeof(*iph))) {
33323368 iph = ip_hdr(skb);
3333− if (!ip_is_fragment(iph) &&
3334− (iph->protocol == IPPROTO_TCP ||
3335− iph->protocol == IPPROTO_UDP) &&
3336− (skb_headlen(skb) - skb_network_offset(skb) >=
3337− iph->ihl * sizeof(u32) + sizeof(*layer4hdr) * 2)) {
3338− layer4hdr = (__be16 *)((u32 *)iph + iph->ihl);
3339− layer4_xor = ntohs(*layer4hdr ^ *(layer4hdr + 1));
3369+ poff = proto_ports_offset(iph->protocol);
3370+
3371+ if (!ip_is_fragment(iph) && poff >= 0) {
3372+ l4 = skb_header_pointer(skb, noff + (iph->ihl << 2) + poff,
3373+ sizeof(_l4), &_l4);
3374+ if (l4)
3375+ layer4_xor = ntohs(l4[0] ^ l4[1]);
33403376 }
33413377 return (layer4_xor ^
33423378 ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count;
33433379 } else if (skb->protocol == htons(ETH_P_IPV6) &&
3344− skb_network_header_len(skb) >= sizeof(*ipv6h)) {
3380+ pskb_may_pull(skb, noff + sizeof(*ipv6h))) {
33453381 ipv6h = ipv6_hdr(skb);
3346− if ((ipv6h->nexthdr == IPPROTO_TCP ||
3347− ipv6h->nexthdr == IPPROTO_UDP) &&
3348− (skb_headlen(skb) - skb_network_offset(skb) >=
3349− sizeof(*ipv6h) + sizeof(*layer4hdr) * 2)) {
3350− layer4hdr = (__be16 *)(ipv6h + 1);
3351− layer4_xor = ntohs(*layer4hdr ^ *(layer4hdr + 1));
3382+ poff = proto_ports_offset(ipv6h->nexthdr);
3383+ if (poff >= 0) {
3384+ l4 = skb_header_pointer(skb, noff + sizeof(*ipv6h) + poff,
3385+ sizeof(_l4), &_l4);
3386+ if (l4)
3387+ layer4_xor = ntohs(l4[0] ^ l4[1]);
33523388 }
33533389 s = &ipv6h->saddr.s6_addr32[0];
33543390 d = &ipv6h->daddr.s6_addr32[0];
@@ -4882,9 +4918,18 @@ static int __net_init bond_net_init(struct net *net) · 1527 unmodified lines
48824918 static void __net_exit bond_net_exit(struct net *net)
48834919 {
48844920 struct bond_net *bn = net_generic(net, bond_net_id);
4921+ struct bonding *bond, *tmp_bond;
4922+ LIST_HEAD(list);
48854923
48864924 bond_destroy_sysfs(bn);
48874925 bond_destroy_proc_dir(bn);
4926+
4927+ /* Kill off any bonds created after unregistering bond rtnl ops */
4928+ rtnl_lock();
4929+ list_for_each_entry_safe(bond, tmp_bond, &bn->dev_list, bond_list)
4930+ unregister_netdevice_queue(bond->dev, &list);
4931+ unregister_netdevice_many(&list);
4932+ rtnl_unlock();
48884933 }
48894934
48904935 static struct pernet_operations bond_net_ops = {
@@ -4938,8 +4983,8 @@ static void __exit bonding_exit(void) · 47 unmodified lines
49384983
49394984 bond_destroy_debugfs();
49404985
4941− unregister_pernet_subsys(&bond_net_ops);
49424986 rtnl_link_unregister(&bond_link_ops);
4987+ unregister_pernet_subsys(&bond_net_ops);
49434988
49444989 #ifdef CONFIG_NET_POLL_CONTROLLER
49454990 /*
drivers/net/can/mcp251x.c+8−2
@@ -929,6 +929,7 @@ static int mcp251x_open(struct net_device *net) · 928 unmodified lines
929929 struct mcp251x_priv *priv = netdev_priv(net);
930930 struct spi_device *spi = priv->spi;
931931 struct mcp251x_platform_data *pdata = spi->dev.platform_data;
932+ unsigned long flags;
932933 int ret;
933934
934935 ret = open_candev(net);
@@ -945,9 +946,14 @@ static int mcp251x_open(struct net_device *net) · 10 unmodified lines
945946 priv->tx_skb = NULL;
946947 priv->tx_len = 0;
947948
949+ flags = IRQF_ONESHOT;
950+ if (pdata->irq_flags)
951+ flags |= pdata->irq_flags;
952+ else
953+ flags |= IRQF_TRIGGER_FALLING;
954+
948955 ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
949− pdata->irq_flags ? pdata->irq_flags : IRQF_TRIGGER_FALLING,
950− DEVICE_NAME, priv);
956+ flags, DEVICE_NAME, priv);
951957 if (ret) {
952958 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);
953959 if (pdata->transceiver_enable)
drivers/net/can/sja1000/sja1000_of_platform.c+15−16
@@ -96,8 +96,8 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) · 95 unmodified lines
9696 struct net_device *dev;
9797 struct sja1000_priv *priv;
9898 struct resource res;
99− const u32 *prop;
100− int err, irq, res_size, prop_size;
99+ u32 prop;
100+ int err, irq, res_size;
101101 void __iomem *base;
102102
103103 err = of_address_to_resource(np, 0, &res);
@@ -138,27 +138,27 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) · 34 unmodified lines
138138 priv->read_reg = sja1000_ofp_read_reg;
139139 priv->write_reg = sja1000_ofp_write_reg;
140140
141− prop = of_get_property(np, "nxp,external-clock-frequency", &prop_size);
142− if (prop && (prop_size == sizeof(u32)))
143− priv->can.clock.freq = *prop / 2;
141+ err = of_property_read_u32(np, "nxp,external-clock-frequency", &prop);
142+ if (!err)
143+ priv->can.clock.freq = prop / 2;
144144 else
145145 priv->can.clock.freq = SJA1000_OFP_CAN_CLOCK; /* default */
146146
147− prop = of_get_property(np, "nxp,tx-output-mode", &prop_size);
148− if (prop && (prop_size == sizeof(u32)))
149− priv->ocr |= *prop & OCR_MODE_MASK;
147+ err = of_property_read_u32(np, "nxp,tx-output-mode", &prop);
148+ if (!err)
149+ priv->ocr |= prop & OCR_MODE_MASK;
150150 else
151151 priv->ocr |= OCR_MODE_NORMAL; /* default */
152152
153− prop = of_get_property(np, "nxp,tx-output-config", &prop_size);
154− if (prop && (prop_size == sizeof(u32)))
155− priv->ocr |= (*prop << OCR_TX_SHIFT) & OCR_TX_MASK;
153+ err = of_property_read_u32(np, "nxp,tx-output-config", &prop);
154+ if (!err)
155+ priv->ocr |= (prop << OCR_TX_SHIFT) & OCR_TX_MASK;
156156 else
157157 priv->ocr |= OCR_TX0_PULLDOWN; /* default */
158158
159− prop = of_get_property(np, "nxp,clock-out-frequency", &prop_size);
160− if (prop && (prop_size == sizeof(u32)) && *prop) {
161− u32 divider = priv->can.clock.freq * 2 / *prop;
159+ err = of_property_read_u32(np, "nxp,clock-out-frequency", &prop);
160+ if (!err && prop) {
161+ u32 divider = priv->can.clock.freq * 2 / prop;
162162
163163 if (divider > 1)
164164 priv->cdr |= divider / 2 - 1;
@@ -168,8 +168,7 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) · 3 unmodified lines
168168 priv->cdr |= CDR_CLK_OFF; /* default */
169169 }
170170
171− prop = of_get_property(np, "nxp,no-comparator-bypass", NULL);
172− if (!prop)
171+ if (!of_property_read_bool(np, "nxp,no-comparator-bypass"))
173172 priv->cdr |= CDR_CBP; /* default */
174173
175174 priv->irq_flags = IRQF_SHARED;
drivers/net/ethernet/8390/ax88796.c+1−1
@@ -828,7 +828,7 @@ static int ax_probe(struct platform_device *pdev) · 827 unmodified lines
828828 struct ei_device *ei_local;
829829 struct ax_device *ax;
830830 struct resource *irq, *mem, *mem2;
831− resource_size_t mem_size, mem2_size = 0;
831+ unsigned long mem_size, mem2_size = 0;
832832 int ret = 0;
833833
834834 dev = ax__alloc_ei_netdev(sizeof(struct ax_device));
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+5−2
@@ -2615,6 +2615,9 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 2614 unmodified lines
26152615 }
26162616 }
26172617
2618+ /* initialize FW coalescing state machines in RAM */
2619+ bnx2x_update_coalesce(bp);
2620+
26182621 /* setup the leading queue */
26192622 rc = bnx2x_setup_leading(bp);
26202623 if (rc) {
@@ -4737,11 +4740,11 @@ static void storm_memset_hc_disable(struct bnx2x *bp, u8 port, · 2116 unmodified lines
47374740 u32 enable_flag = disable ? 0 : (1 << HC_INDEX_DATA_HC_ENABLED_SHIFT);
47384741 u32 addr = BAR_CSTRORM_INTMEM +
47394742 CSTORM_STATUS_BLOCK_DATA_FLAGS_OFFSET(fw_sb_id, sb_index);
4740− u16 flags = REG_RD16(bp, addr);
4743+ u8 flags = REG_RD8(bp, addr);
47414744 /* clear and set */
47424745 flags &= ~HC_INDEX_DATA_HC_ENABLED;
47434746 flags |= enable_flag;
4744− REG_WR16(bp, addr, flags);
4747+ REG_WR8(bp, addr, flags);
47454748 DP(NETIF_MSG_IFUP,
47464749 "port %x fw_sb_id %d sb_index %d disable %d\n",
47474750 port, fw_sb_id, sb_index, disable);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+6−1
@@ -4959,7 +4959,7 @@ static void bnx2x_after_function_update(struct bnx2x *bp) · 4958 unmodified lines
49594959 q);
49604960 }
49614961
4962− if (!NO_FCOE(bp)) {
4962+ if (!NO_FCOE(bp) && CNIC_ENABLED(bp)) {
49634963 fp = &bp->fp[FCOE_IDX(bp)];
49644964 queue_params.q_obj = &bnx2x_sp_obj(bp, fp).q_obj;
49654965
@@ -9946,6 +9946,10 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp) · 4980 unmodified lines
99469946 REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0);
99479947 }
99489948 }
9949+ if (!CHIP_IS_E1x(bp))
9950+ /* block FW from writing to host */
9951+ REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER, 0);
9952+
99499953 /* wait until BRB is empty */
99509954 tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS);
99519955 while (timer_count) {
@@ -13450,6 +13454,7 @@ static int bnx2x_unregister_cnic(struct net_device *dev) · 3498 unmodified lines
1345013454 RCU_INIT_POINTER(bp->cnic_ops, NULL);
1345113455 mutex_unlock(&bp->cnic_mutex);
1345213456 synchronize_rcu();
13457+ bp->cnic_enabled = false;
1345313458 kfree(bp->cnic_kwq);
1345413459 bp->cnic_kwq = NULL;
1345513460
drivers/net/ethernet/emulex/benet/be_main.c+3−2
@@ -772,8 +772,9 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter, · 771 unmodified lines
772772
773773 if (vlan_tx_tag_present(skb)) {
774774 vlan_tag = be_get_tx_vlan_tag(adapter, skb);
775− __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
776− skb->vlan_tci = 0;
775+ skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
776+ if (skb)
777+ skb->vlan_tci = 0;
777778 }
778779
779780 return skb;
drivers/net/ethernet/freescale/fec_main.c+1−0
@@ -997,6 +997,7 @@ static void fec_enet_adjust_link(struct net_device *ndev) · 996 unmodified lines
997997 } else {
998998 if (fep->link) {
999999 fec_stop(ndev);
1000+ fep->link = phy_dev->link;
10001001 status_change = 1;
10011002 }
10021003 }
drivers/net/ethernet/intel/e100.c+25−11
@@ -870,7 +870,7 @@ err_unlock: · 869 unmodified lines
870870 }
871871
872872 static int e100_exec_cb(struct nic *nic, struct sk_buff *skb,
873− void (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *))
873+ int (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *))
874874 {
875875 struct cb *cb;
876876 unsigned long flags;
@@ -888,10 +888,13 @@ static int e100_exec_cb(struct nic *nic, struct sk_buff *skb, · 11 unmodified lines
888888 nic->cbs_avail--;
889889 cb->skb = skb;
890890
891+ err = cb_prepare(nic, cb, skb);
892+ if (err)
893+ goto err_unlock;
894+
891895 if (unlikely(!nic->cbs_avail))
892896 err = -ENOSPC;
893897
894− cb_prepare(nic, cb, skb);
895898
896899 /* Order is important otherwise we'll be in a race with h/w:
897900 * set S-bit in current first, then clear S-bit in previous. */
@@ -1091,7 +1094,7 @@ static void e100_get_defaults(struct nic *nic) · 193 unmodified lines
10911094 nic->mii.mdio_write = mdio_write;
10921095 }
10931096
1094−static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
1097+static int e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
10951098 {
10961099 struct config *config = &cb->u.config;
10971100 u8 *c = (u8 *)config;
@@ -1181,6 +1184,7 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) · 83 unmodified lines
11811184 netif_printk(nic, hw, KERN_DEBUG, nic->netdev,
11821185 "[16-23]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n",
11831186 c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]);
1187+ return 0;
11841188 }
11851189
11861190 /*************************************************************************
@@ -1331,7 +1335,7 @@ static const struct firmware *e100_request_firmware(struct nic *nic) · 144 unmodified lines
13311335 return fw;
13321336 }
13331337
1334−static void e100_setup_ucode(struct nic *nic, struct cb *cb,
1338+static int e100_setup_ucode(struct nic *nic, struct cb *cb,
13351339 struct sk_buff *skb)
13361340 {
13371341 const struct firmware *fw = (void *)skb;
@@ -1358,6 +1362,7 @@ static void e100_setup_ucode(struct nic *nic, struct cb *cb, · 20 unmodified lines
13581362 cb->u.ucode[min_size] |= cpu_to_le32((BUNDLESMALL) ? 0xFFFF : 0xFF80);
13591363
13601364 cb->command = cpu_to_le16(cb_ucode | cb_el);
1365+ return 0;
13611366 }
13621367
13631368 static inline int e100_load_ucode_wait(struct nic *nic)
@@ -1400,18 +1405,20 @@ static inline int e100_load_ucode_wait(struct nic *nic) · 36 unmodified lines
14001405 return err;
14011406 }
14021407
1403−static void e100_setup_iaaddr(struct nic *nic, struct cb *cb,
1408+static int e100_setup_iaaddr(struct nic *nic, struct cb *cb,
14041409 struct sk_buff *skb)
14051410 {
14061411 cb->command = cpu_to_le16(cb_iaaddr);
14071412 memcpy(cb->u.iaaddr, nic->netdev->dev_addr, ETH_ALEN);
1413+ return 0;
14081414 }
14091415
1410−static void e100_dump(struct nic *nic, struct cb *cb, struct sk_buff *skb)
1416+static int e100_dump(struct nic *nic, struct cb *cb, struct sk_buff *skb)
14111417 {
14121418 cb->command = cpu_to_le16(cb_dump);
14131419 cb->u.dump_buffer_addr = cpu_to_le32(nic->dma_addr +
14141420 offsetof(struct mem, dump_buf));
1421+ return 0;
14151422 }
14161423
14171424 static int e100_phy_check_without_mii(struct nic *nic)
@@ -1581,7 +1588,7 @@ static int e100_hw_init(struct nic *nic) · 163 unmodified lines
15811588 return 0;
15821589 }
15831590
1584−static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
1591+static int e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
15851592 {
15861593 struct net_device *netdev = nic->netdev;
15871594 struct netdev_hw_addr *ha;
@@ -1596,6 +1603,7 @@ static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb) · 8 unmodified lines
15961603 memcpy(&cb->u.multi.addr[i++ * ETH_ALEN], &ha->addr,
15971604 ETH_ALEN);
15981605 }
1606+ return 0;
15991607 }
16001608
16011609 static void e100_set_multicast_list(struct net_device *netdev)
@@ -1756,11 +1764,18 @@ static void e100_watchdog(unsigned long data) · 154 unmodified lines
17561764 round_jiffies(jiffies + E100_WATCHDOG_PERIOD));
17571765 }
17581766
1759−static void e100_xmit_prepare(struct nic *nic, struct cb *cb,
1767+static int e100_xmit_prepare(struct nic *nic, struct cb *cb,
17601768 struct sk_buff *skb)
17611769 {
1770+ dma_addr_t dma_addr;
17621771 cb->command = nic->tx_command;
17631772
1773+ dma_addr = pci_map_single(nic->pdev,
1774+ skb->data, skb->len, PCI_DMA_TODEVICE);
1775+ /* If we can't map the skb, have the upper layer try later */
1776+ if (pci_dma_mapping_error(nic->pdev, dma_addr))
1777+ return -ENOMEM;
1778+
17641779 /*
17651780 * Use the last 4 bytes of the SKB payload packet as the CRC, used for
17661781 * testing, ie sending frames with bad CRC.
@@ -1777,11 +1792,10 @@ static void e100_xmit_prepare(struct nic *nic, struct cb *cb, · 10 unmodified lines
17771792 cb->u.tcb.tcb_byte_count = 0;
17781793 cb->u.tcb.threshold = nic->tx_threshold;
17791794 cb->u.tcb.tbd_count = 1;
1780− cb->u.tcb.tbd.buf_addr = cpu_to_le32(pci_map_single(nic->pdev,
1781− skb->data, skb->len, PCI_DMA_TODEVICE));
1782− /* check for mapping failure? */
1795+ cb->u.tcb.tbd.buf_addr = cpu_to_le32(dma_addr);
17831796 cb->u.tcb.tbd.size = cpu_to_le16(skb->len);
17841797 skb_tx_timestamp(skb);
1798+ return 0;
17851799 }
17861800
17871801 static netdev_tx_t e100_xmit_frame(struct sk_buff *skb,
drivers/net/ethernet/intel/igb/igb.h+0−8
@@ -293,18 +293,10 @@ struct igb_q_vector { · 292 unmodified lines
293293 enum e1000_ring_flags_t {
294294 IGB_RING_FLAG_RX_SCTP_CSUM,
295295 IGB_RING_FLAG_RX_LB_VLAN_BSWAP,
296− IGB_RING_FLAG_RX_BUILD_SKB_ENABLED,
297296 IGB_RING_FLAG_TX_CTX_IDX,
298297 IGB_RING_FLAG_TX_DETECT_HANG
299298 };
300299
301−#define ring_uses_build_skb(ring) \
302− test_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags)
303−#define set_ring_build_skb_enabled(ring) \
304− set_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags)
305−#define clear_ring_build_skb_enabled(ring) \
306− clear_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags)
307−
308300 #define IGB_TXD_DCMD (E1000_ADVTXD_DCMD_EOP | E1000_ADVTXD_DCMD_RS)
309301
310302 #define IGB_RX_DESC(R, i) \
drivers/net/ethernet/intel/igb/igb_main.c+4−106
@@ -3387,20 +3387,6 @@ void igb_configure_rx_ring(struct igb_adapter *adapter, · 3386 unmodified lines
33873387 wr32(E1000_RXDCTL(reg_idx), rxdctl);
33883388 }
33893389
3390−static void igb_set_rx_buffer_len(struct igb_adapter *adapter,
3391− struct igb_ring *rx_ring)
3392−{
3393−#define IGB_MAX_BUILD_SKB_SIZE \
3394− (SKB_WITH_OVERHEAD(IGB_RX_BUFSZ) - \
3395− (NET_SKB_PAD + NET_IP_ALIGN + IGB_TS_HDR_LEN))
3396−
3397− /* set build_skb flag */
3398− if (adapter->max_frame_size <= IGB_MAX_BUILD_SKB_SIZE)
3399− set_ring_build_skb_enabled(rx_ring);
3400− else
3401− clear_ring_build_skb_enabled(rx_ring);
3402−}
3403−
34043390 /**
34053391 * igb_configure_rx - Configure receive Unit after Reset
34063392 * @adapter: board private structure
@@ -3421,11 +3407,8 @@ static void igb_configure_rx(struct igb_adapter *adapter) · 14 unmodified lines
34213407 /* Setup the HW Rx Head and Tail Descriptor Pointers and
34223408 * the Base and Length of the Rx Descriptor Ring
34233409 */
3424− for (i = 0; i < adapter->num_rx_queues; i++) {
3425− struct igb_ring *rx_ring = adapter->rx_ring[i];
3426− igb_set_rx_buffer_len(adapter, rx_ring);
3427− igb_configure_rx_ring(adapter, rx_ring);
3428− }
3410+ for (i = 0; i < adapter->num_rx_queues; i++)
3411+ igb_configure_rx_ring(adapter, adapter->rx_ring[i]);
34293412 }
34303413
34313414 /**
@@ -6238,78 +6221,6 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring, · 2806 unmodified lines
62386221 return igb_can_reuse_rx_page(rx_buffer, page, truesize);
62396222 }
62406223
6241−static struct sk_buff *igb_build_rx_buffer(struct igb_ring *rx_ring,
6242− union e1000_adv_rx_desc *rx_desc)
6243−{
6244− struct igb_rx_buffer *rx_buffer;
6245− struct sk_buff *skb;
6246− struct page *page;
6247− void *page_addr;
6248− unsigned int size = le16_to_cpu(rx_desc->wb.upper.length);
6249−#if (PAGE_SIZE < 8192)
6250− unsigned int truesize = IGB_RX_BUFSZ;
6251−#else
6252− unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) +
6253− SKB_DATA_ALIGN(NET_SKB_PAD +
6254− NET_IP_ALIGN +
6255− size);
6256−#endif
6257−
6258− /* If we spanned a buffer we have a huge mess so test for it */
6259− BUG_ON(unlikely(!igb_test_staterr(rx_desc, E1000_RXD_STAT_EOP)));
6260−
6261− rx_buffer = &rx_ring->rx_buffer_info[rx_ring->next_to_clean];
6262− page = rx_buffer->page;
6263− prefetchw(page);
6264−
6265− page_addr = page_address(page) + rx_buffer->page_offset;
6266−
6267− /* prefetch first cache line of first page */
6268− prefetch(page_addr + NET_SKB_PAD + NET_IP_ALIGN);
6269−#if L1_CACHE_BYTES < 128
6270− prefetch(page_addr + L1_CACHE_BYTES + NET_SKB_PAD + NET_IP_ALIGN);
6271−#endif
6272−
6273− /* build an skb to around the page buffer */
6274− skb = build_skb(page_addr, truesize);
6275− if (unlikely(!skb)) {
6276− rx_ring->rx_stats.alloc_failed++;
6277− return NULL;
6278− }
6279−
6280− /* we are reusing so sync this buffer for CPU use */
6281− dma_sync_single_range_for_cpu(rx_ring->dev,
6282− rx_buffer->dma,
6283− rx_buffer->page_offset,
6284− IGB_RX_BUFSZ,
6285− DMA_FROM_DEVICE);
6286−
6287− /* update pointers within the skb to store the data */
6288− skb_reserve(skb, NET_IP_ALIGN + NET_SKB_PAD);
6289− __skb_put(skb, size);
6290−
6291− /* pull timestamp out of packet data */
6292− if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) {
6293− igb_ptp_rx_pktstamp(rx_ring->q_vector, skb->data, skb);
6294− __skb_pull(skb, IGB_TS_HDR_LEN);
6295− }
6296−
6297− if (igb_can_reuse_rx_page(rx_buffer, page, truesize)) {
6298− /* hand second half of page back to the ring */
6299− igb_reuse_rx_page(rx_ring, rx_buffer);
6300− } else {
6301− /* we are not reusing the buffer so unmap it */
6302− dma_unmap_page(rx_ring->dev, rx_buffer->dma,
6303− PAGE_SIZE, DMA_FROM_DEVICE);
6304− }
6305−
6306− /* clear contents of buffer_info */
6307− rx_buffer->dma = 0;
6308− rx_buffer->page = NULL;
6309−
6310− return skb;
6311−}
6312−
63136224 static struct sk_buff *igb_fetch_rx_buffer(struct igb_ring *rx_ring,
63146225 union e1000_adv_rx_desc *rx_desc,
63156226 struct sk_buff *skb)
@@ -6719,10 +6630,7 @@ static bool igb_clean_rx_irq(struct igb_q_vector *q_vector, const int budget) · 403 unmodified lines
67196630 rmb();
67206631
67216632 /* retrieve a buffer from the ring */
6722− if (ring_uses_build_skb(rx_ring))
6723− skb = igb_build_rx_buffer(rx_ring, rx_desc);
6724− else
6725− skb = igb_fetch_rx_buffer(rx_ring, rx_desc, skb);
6633+ skb = igb_fetch_rx_buffer(rx_ring, rx_desc, skb);
67266634
67276635 /* exit if we failed to retrieve a buffer */
67286636 if (!skb)
@@ -6808,14 +6716,6 @@ static bool igb_alloc_mapped_page(struct igb_ring *rx_ring, · 79 unmodified lines
68086716 return true;
68096717 }
68106718
6811−static inline unsigned int igb_rx_offset(struct igb_ring *rx_ring)
6812−{
6813− if (ring_uses_build_skb(rx_ring))
6814− return NET_SKB_PAD + NET_IP_ALIGN;
6815− else
6816− return 0;
6817−}
6818−
68196719 /**
68206720 * igb_alloc_rx_buffers - Replace used receive buffers; packet split
68216721 * @adapter: address of board private structure
@@ -6841,9 +6741,7 @@ void igb_alloc_rx_buffers(struct igb_ring *rx_ring, u16 cleaned_count) · 19 unmodified lines
68416741 /* Refresh the desc even if buffer_addrs didn't change
68426742 * because each write-back erases this info.
68436743 */
6844− rx_desc->read.pkt_addr = cpu_to_le64(bi->dma +
6845− bi->page_offset +
6846− igb_rx_offset(rx_ring));
6744+ rx_desc->read.pkt_addr = cpu_to_le64(bi->dma + bi->page_offset);
68476745
68486746 rx_desc++;
68496747 bi++;
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c+6−0
@@ -1052,6 +1052,12 @@ int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos) · 1051 unmodified lines
10521052 if ((vf >= adapter->num_vfs) || (vlan > 4095) || (qos > 7))
10531053 return -EINVAL;
10541054 if (vlan || qos) {
1055+ if (adapter->vfinfo[vf].pf_vlan)
1056+ err = ixgbe_set_vf_vlan(adapter, false,
1057+ adapter->vfinfo[vf].pf_vlan,
1058+ vf);
1059+ if (err)
1060+ goto out;
10551061 err = ixgbe_set_vf_vlan(adapter, true, vlan, vf);
10561062 if (err)
10571063 goto out;
drivers/net/ethernet/marvell/Kconfig+1−1
@@ -33,6 +33,7 @@ config MV643XX_ETH · 32 unmodified lines
3333
3434 config MVMDIO
3535 tristate "Marvell MDIO interface support"
36+ select PHYLIB
3637 ---help---
3738 This driver supports the MDIO interface found in the network
3839 interface units of the Marvell EBU SoCs (Kirkwood, Orion5x,
@@ -43,7 +44,6 @@ config MVMDIO · 4 unmodified lines
4344 config MVNETA
4445 tristate "Marvell Armada 370/XP network interface support"
4546 depends on MACH_ARMADA_370_XP
46− select PHYLIB
4747 select MVMDIO
4848 ---help---
4949 This driver supports the network interface units in the
drivers/net/ethernet/marvell/mvneta.c+9−9
@@ -374,7 +374,6 @@ static int rxq_number = 8; · 373 unmodified lines
374374 static int txq_number = 8;
375375
376376 static int rxq_def;
377−static int txq_def;
378377
379378 #define MVNETA_DRIVER_NAME "mvneta"
380379 #define MVNETA_DRIVER_VERSION "1.0"
@@ -1475,7 +1474,8 @@ error: · 1094 unmodified lines
14751474 static int mvneta_tx(struct sk_buff *skb, struct net_device *dev)
14761475 {
14771476 struct mvneta_port *pp = netdev_priv(dev);
1478− struct mvneta_tx_queue *txq = &pp->txqs[txq_def];
1477+ u16 txq_id = skb_get_queue_mapping(skb);
1478+ struct mvneta_tx_queue *txq = &pp->txqs[txq_id];
14791479 struct mvneta_tx_desc *tx_desc;
14801480 struct netdev_queue *nq;
14811481 int frags = 0;
@@ -1485,7 +1485,7 @@ static int mvneta_tx(struct sk_buff *skb, struct net_device *dev) · 3 unmodified lines
14851485 goto out;
14861486
14871487 frags = skb_shinfo(skb)->nr_frags + 1;
1488− nq = netdev_get_tx_queue(dev, txq_def);
1488+ nq = netdev_get_tx_queue(dev, txq_id);
14891489
14901490 /* Get a descriptor for the first part of the packet */
14911491 tx_desc = mvneta_txq_next_desc_get(txq);
@@ -2679,7 +2679,7 @@ static int mvneta_probe(struct platform_device *pdev) · 1187 unmodified lines
26792679 return -EINVAL;
26802680 }
26812681
2682− dev = alloc_etherdev_mq(sizeof(struct mvneta_port), 8);
2682+ dev = alloc_etherdev_mqs(sizeof(struct mvneta_port), txq_number, rxq_number);
26832683 if (!dev)
26842684 return -ENOMEM;
26852685
@@ -2761,16 +2761,17 @@ static int mvneta_probe(struct platform_device *pdev) · 75 unmodified lines
27612761
27622762 netif_napi_add(dev, &pp->napi, mvneta_poll, pp->weight);
27632763
2764+ dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
2765+ dev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM;
2766+ dev->vlan_features |= NETIF_F_SG | NETIF_F_IP_CSUM;
2767+ dev->priv_flags |= IFF_UNICAST_FLT;
2768+
27642769 err = register_netdev(dev);
27652770 if (err < 0) {
27662771 dev_err(&pdev->dev, "failed to register\n");
27672772 goto err_deinit;
27682773 }
27692774
2770− dev->features = NETIF_F_SG | NETIF_F_IP_CSUM;
2771− dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM;
2772− dev->priv_flags |= IFF_UNICAST_FLT;
2773−
27742775 netdev_info(dev, "mac: %pM\n", dev->dev_addr);
27752776
27762777 platform_set_drvdata(pdev, pp->dev);
@@ -2833,4 +2834,3 @@ module_param(rxq_number, int, S_IRUGO); · 56 unmodified lines
28332834 module_param(txq_number, int, S_IRUGO);
28342835
28352836 module_param(rxq_def, int, S_IRUGO);
2836−module_param(txq_def, int, S_IRUGO);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c+10−5
@@ -1619,6 +1619,12 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode) · 1618 unmodified lines
16191619 }
16201620 } while ((adapter->ahw->linkup && ahw->has_link_events) != 1);
16211621
1622+ /* Make sure carrier is off and queue is stopped during loopback */
1623+ if (netif_running(netdev)) {
1624+ netif_carrier_off(netdev);
1625+ netif_stop_queue(netdev);
1626+ }
1627+
16221628 ret = qlcnic_do_lb_test(adapter, mode);
16231629
16241630 qlcnic_83xx_clear_lb_mode(adapter, mode);
@@ -2944,6 +2950,7 @@ static u64 *qlcnic_83xx_fill_stats(struct qlcnic_adapter *adapter, · 1319 unmodified lines
29442950 void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data)
29452951 {
29462952 struct qlcnic_cmd_args cmd;
2953+ struct net_device *netdev = adapter->netdev;
29472954 int ret = 0;
29482955
29492956 qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_GET_STATISTICS);
@@ -2953,7 +2960,7 @@ void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) · 3 unmodified lines
29532960 data = qlcnic_83xx_fill_stats(adapter, &cmd, data,
29542961 QLC_83XX_STAT_TX, &ret);
29552962 if (ret) {
2956− dev_info(&adapter->pdev->dev, "Error getting MAC stats\n");
2963+ netdev_err(netdev, "Error getting Tx stats\n");
29572964 goto out;
29582965 }
29592966 /* Get MAC stats */
@@ -2963,8 +2970,7 @@ void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) · 3 unmodified lines
29632970 data = qlcnic_83xx_fill_stats(adapter, &cmd, data,
29642971 QLC_83XX_STAT_MAC, &ret);
29652972 if (ret) {
2966− dev_info(&adapter->pdev->dev,
2967− "Error getting Rx stats\n");
2973+ netdev_err(netdev, "Error getting MAC stats\n");
29682974 goto out;
29692975 }
29702976 /* Get Rx stats */
@@ -2974,8 +2980,7 @@ void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) · 3 unmodified lines
29742980 data = qlcnic_83xx_fill_stats(adapter, &cmd, data,
29752981 QLC_83XX_STAT_RX, &ret);
29762982 if (ret)
2977− dev_info(&adapter->pdev->dev,
2978− "Error getting Tx stats\n");
2983+ netdev_err(netdev, "Error getting Rx stats\n");
29792984 out:
29802985 qlcnic_free_mbx_args(&cmd);
29812986 }
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c+1−2
@@ -362,8 +362,7 @@ set_flags: · 361 unmodified lines
362362 memcpy(&first_desc->eth_addr, skb->data, ETH_ALEN);
363363 }
364364 opcode = TX_ETHER_PKT;
365− if ((adapter->netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) &&
366− skb_shinfo(skb)->gso_size > 0) {
365+ if (skb_is_gso(skb)) {
367366 hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
368367 first_desc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
369368 first_desc->total_hdr_length = hdr_len;
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c+2−2
@@ -198,10 +198,10 @@ beacon_err: · 197 unmodified lines
198198 }
199199
200200 err = qlcnic_config_led(adapter, b_state, b_rate);
201− if (!err)
201+ if (!err) {
202202 err = len;
203− else
204203 ahw->beacon_state = b_state;
204+ }
205205
206206 if (test_and_clear_bit(__QLCNIC_DIAG_RES_ALLOC, &adapter->state))
207207 qlcnic_diag_free_res(adapter->netdev, max_sds_rings);
drivers/net/ethernet/qlogic/qlge/qlge.h+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 */
1919 #define DRV_NAME "qlge"
2020 #define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver "
21−#define DRV_VERSION "v1.00.00.31"
21+#define DRV_VERSION "v1.00.00.32"
2222
2323 #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */
2424
drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c+1−1
@@ -379,13 +379,13 @@ static int ql_get_settings(struct net_device *ndev, · 378 unmodified lines
379379
380380 ecmd->supported = SUPPORTED_10000baseT_Full;
381381 ecmd->advertising = ADVERTISED_10000baseT_Full;
382− ecmd->autoneg = AUTONEG_ENABLE;
383382 ecmd->transceiver = XCVR_EXTERNAL;
384383 if ((qdev->link_status & STS_LINK_TYPE_MASK) ==
385384 STS_LINK_TYPE_10GBASET) {
386385 ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg);
387386 ecmd->advertising |= (ADVERTISED_TP | ADVERTISED_Autoneg);
388387 ecmd->port = PORT_TP;
388+ ecmd->autoneg = AUTONEG_ENABLE;
389389 } else {
390390 ecmd->supported |= SUPPORTED_FIBRE;
391391 ecmd->advertising |= ADVERTISED_FIBRE;
drivers/net/ethernet/qlogic/qlge/qlge_main.c+29−7
@@ -1432,11 +1432,13 @@ map_error: · 1431 unmodified lines
14321432 }
14331433
14341434 /* Categorizing receive firmware frame errors */
1435−static void ql_categorize_rx_err(struct ql_adapter *qdev, u8 rx_err)
1435+static void ql_categorize_rx_err(struct ql_adapter *qdev, u8 rx_err,
1436+ struct rx_ring *rx_ring)
14361437 {
14371438 struct nic_stats *stats = &qdev->nic_stats;
14381439
14391440 stats->rx_err_count++;
1441+ rx_ring->rx_errors++;
14401442
14411443 switch (rx_err & IB_MAC_IOCB_RSP_ERR_MASK) {
14421444 case IB_MAC_IOCB_RSP_ERR_CODE_ERR:
@@ -1472,6 +1474,12 @@ static void ql_process_mac_rx_gro_page(struct ql_adapter *qdev, · 29 unmodified lines
14721474 struct bq_desc *lbq_desc = ql_get_curr_lchunk(qdev, rx_ring);
14731475 struct napi_struct *napi = &rx_ring->napi;
14741476
1477+ /* Frame error, so drop the packet. */
1478+ if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1479+ ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring);
1480+ put_page(lbq_desc->p.pg_chunk.page);
1481+ return;
1482+ }
14751483 napi->dev = qdev->ndev;
14761484
14771485 skb = napi_get_frags(napi);
@@ -1525,6 +1533,12 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev, · 47 unmodified lines
15251533 addr = lbq_desc->p.pg_chunk.va;
15261534 prefetch(addr);
15271535
1536+ /* Frame error, so drop the packet. */
1537+ if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1538+ ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring);
1539+ goto err_out;
1540+ }
1541+
15281542 /* The max framesize filter on this chip is set higher than
15291543 * MTU since FCoE uses 2k frames.
15301544 */
@@ -1608,6 +1622,13 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev, · 77 unmodified lines
16081622 memcpy(skb_put(new_skb, length), skb->data, length);
16091623 skb = new_skb;
16101624
1625+ /* Frame error, so drop the packet. */
1626+ if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1627+ ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring);
1628+ dev_kfree_skb_any(skb);
1629+ return;
1630+ }
1631+
16111632 /* loopback self test for ethtool */
16121633 if (test_bit(QL_SELFTEST, &qdev->flags)) {
16131634 ql_check_lb_frame(qdev, skb);
@@ -1913,6 +1934,13 @@ static void ql_process_mac_split_rx_intr(struct ql_adapter *qdev, · 299 unmodified lines
19131934 return;
19141935 }
19151936
1937+ /* Frame error, so drop the packet. */
1938+ if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1939+ ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring);
1940+ dev_kfree_skb_any(skb);
1941+ return;
1942+ }
1943+
19161944 /* The max framesize filter on this chip is set higher than
19171945 * MTU since FCoE uses 2k frames.
19181946 */
@@ -1994,12 +2022,6 @@ static unsigned long ql_process_mac_rx_intr(struct ql_adapter *qdev, · 75 unmodified lines
19942022
19952023 QL_DUMP_IB_MAC_RSP(ib_mac_rsp);
19962024
1997− /* Frame error, so drop the packet. */
1998− if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) {
1999− ql_categorize_rx_err(qdev, ib_mac_rsp->flags2);
2000− return (unsigned long)length;
2001− }
2002−
20032025 if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) {
20042026 /* The data and headers are split into
20052027 * separate buffers.
drivers/net/ethernet/stmicro/stmmac/mmc_core.c+1−0
@@ -149,6 +149,7 @@ void dwmac_mmc_intr_all_mask(void __iomem *ioaddr) · 148 unmodified lines
149149 {
150150 writel(MMC_DEFAULT_MASK, ioaddr + MMC_RX_INTR_MASK);
151151 writel(MMC_DEFAULT_MASK, ioaddr + MMC_TX_INTR_MASK);
152+ writel(MMC_DEFAULT_MASK, ioaddr + MMC_RX_IPC_INTR_MASK);
152153 }
153154
154155 /* This reads the MAC core counters (if actaully supported).
drivers/net/ethernet/ti/cpsw.c+1−1
@@ -1520,7 +1520,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, · 1519 unmodified lines
15201520 memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN);
15211521
15221522 if (data->dual_emac) {
1523− if (of_property_read_u32(node, "dual_emac_res_vlan",
1523+ if (of_property_read_u32(slave_node, "dual_emac_res_vlan",
15241524 &prop)) {
15251525 pr_err("Missing dual_emac_res_vlan in DT.\n");
15261526 slave_data->dual_emac_res_vlan = i+1;
drivers/net/hyperv/netvsc.c+12−5
@@ -470,8 +470,10 @@ static void netvsc_send_completion(struct hv_device *device, · 469 unmodified lines
470470 packet->trans_id;
471471
472472 /* Notify the layer above us */
473− nvsc_packet->completion.send.send_completion(
474− nvsc_packet->completion.send.send_completion_ctx);
473+ if (nvsc_packet)
474+ nvsc_packet->completion.send.send_completion(
475+ nvsc_packet->completion.send.
476+ send_completion_ctx);
475477
476478 num_outstanding_sends =
477479 atomic_dec_return(&net_device->num_outstanding_sends);
@@ -498,6 +500,7 @@ int netvsc_send(struct hv_device *device, · 20 unmodified lines
498500 int ret = 0;
499501 struct nvsp_message sendMessage;
500502 struct net_device *ndev;
503+ u64 req_id;
501504
502505 net_device = get_outbound_net_device(device);
503506 if (!net_device)
@@ -518,20 +521,24 @@ int netvsc_send(struct hv_device *device, · 14 unmodified lines
518521 0xFFFFFFFF;
519522 sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0;
520523
524+ if (packet->completion.send.send_completion)
525+ req_id = (u64)packet;
526+ else
527+ req_id = 0;
528+
521529 if (packet->page_buf_cnt) {
522530 ret = vmbus_sendpacket_pagebuffer(device->channel,
523531 packet->page_buf,
524532 packet->page_buf_cnt,
525533 &sendMessage,
526534 sizeof(struct nvsp_message),
527− (unsigned long)packet);
535+ req_id);
528536 } else {
529537 ret = vmbus_sendpacket(device->channel, &sendMessage,
530538 sizeof(struct nvsp_message),
531− (unsigned long)packet,
539+ req_id,
532540 VM_PKT_DATA_INBAND,
533541 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
534−
535542 }
536543
537544 if (ret == 0) {
drivers/net/hyperv/netvsc_drv.c+0−2
@@ -241,13 +241,11 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, · 240 unmodified lines
241241
242242 if (status == 1) {
243243 netif_carrier_on(net);
244− netif_wake_queue(net);
245244 ndev_ctx = netdev_priv(net);
246245 schedule_delayed_work(&ndev_ctx->dwork, 0);
247246 schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20));
248247 } else {
249248 netif_carrier_off(net);
250− netif_tx_disable(net);
251249 }
252250 }
253251
drivers/net/hyperv/rndis_filter.c+1−13
@@ -61,9 +61,6 @@ struct rndis_request { · 60 unmodified lines
6161
6262 static void rndis_filter_send_completion(void *ctx);
6363
64−static void rndis_filter_send_request_completion(void *ctx);
65−
66−
6764
6865 static struct rndis_device *get_rndis_device(void)
6966 {
@@ -241,10 +238,7 @@ static int rndis_filter_send_request(struct rndis_device *dev, · 171 unmodified lines
241238 packet->page_buf[0].len;
242239 }
243240
244− packet->completion.send.send_completion_ctx = req;/* packet; */
245− packet->completion.send.send_completion =
246− rndis_filter_send_request_completion;
247− packet->completion.send.send_completion_tid = (unsigned long)dev;
241+ packet->completion.send.send_completion = NULL;
248242
249243 ret = netvsc_send(dev->net_dev->dev, packet);
250244 return ret;
@@ -999,9 +993,3 @@ static void rndis_filter_send_completion(void *ctx) · 748 unmodified lines
999993 /* Pass it back to the original handler */
1000994 filter_pkt->completion(filter_pkt->completion_ctx);
1001995 }
1002−
1003−
1004−static void rndis_filter_send_request_completion(void *ctx)
1005−{
1006− /* Noop */
1007−}
drivers/net/tun.c+1−1
@@ -1594,7 +1594,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) · 1593 unmodified lines
15941594
15951595 if (tun->flags & TUN_TAP_MQ &&
15961596 (tun->numqueues + tun->numdisabled > 1))
1597− return err;
1597+ return -EBUSY;
15981598 }
15991599 else {
16001600 char *name;
drivers/net/usb/cdc_mbim.c+1−1
@@ -134,7 +134,7 @@ static struct sk_buff *cdc_mbim_tx_fixup(struct usbnet *dev, struct sk_buff *skb · 133 unmodified lines
134134 goto error;
135135
136136 if (skb) {
137− if (skb->len <= sizeof(ETH_HLEN))
137+ if (skb->len <= ETH_HLEN)
138138 goto error;
139139
140140 /* mapping VLANs to MBIM sessions:
drivers/net/usb/qmi_wwan.c+104−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/module.h>
1414 #include <linux/netdevice.h>
1515 #include <linux/ethtool.h>
16+#include <linux/etherdevice.h>
1617 #include <linux/mii.h>
1718 #include <linux/usb.h>
1819 #include <linux/usb/cdc.h>
@@ -52,6 +53,96 @@ struct qmi_wwan_state { · 33 unmodified lines
5253 struct usb_interface *data;
5354 };
5455
56+/* default ethernet address used by the modem */
57+static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};
58+
59+/* Make up an ethernet header if the packet doesn't have one.
60+ *
61+ * A firmware bug common among several devices cause them to send raw
62+ * IP packets under some circumstances. There is no way for the
63+ * driver/host to know when this will happen. And even when the bug
64+ * hits, some packets will still arrive with an intact header.
65+ *
66+ * The supported devices are only capably of sending IPv4, IPv6 and
67+ * ARP packets on a point-to-point link. Any packet with an ethernet
68+ * header will have either our address or a broadcast/multicast
69+ * address as destination. ARP packets will always have a header.
70+ *
71+ * This means that this function will reliably add the appropriate
72+ * header iff necessary, provided our hardware address does not start
73+ * with 4 or 6.
74+ *
75+ * Another common firmware bug results in all packets being addressed
76+ * to 00:a0:c6:00:00:00 despite the host address being different.
77+ * This function will also fixup such packets.
78+ */
79+static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
80+{
81+ __be16 proto;
82+
83+ /* usbnet rx_complete guarantees that skb->len is at least
84+ * hard_header_len, so we can inspect the dest address without
85+ * checking skb->len
86+ */
87+ switch (skb->data[0] & 0xf0) {
88+ case 0x40:
89+ proto = htons(ETH_P_IP);
90+ break;
91+ case 0x60:
92+ proto = htons(ETH_P_IPV6);
93+ break;
94+ case 0x00:
95+ if (is_multicast_ether_addr(skb->data))
96+ return 1;
97+ /* possibly bogus destination - rewrite just in case */
98+ skb_reset_mac_header(skb);
99+ goto fix_dest;
100+ default:
101+ /* pass along other packets without modifications */
102+ return 1;
103+ }
104+ if (skb_headroom(skb) < ETH_HLEN)
105+ return 0;
106+ skb_push(skb, ETH_HLEN);
107+ skb_reset_mac_header(skb);
108+ eth_hdr(skb)->h_proto = proto;
109+ memset(eth_hdr(skb)->h_source, 0, ETH_ALEN);
110+fix_dest:
111+ memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN);
112+ return 1;
113+}
114+
115+/* very simplistic detection of IPv4 or IPv6 headers */
116+static bool possibly_iphdr(const char *data)
117+{
118+ return (data[0] & 0xd0) == 0x40;
119+}
120+
121+/* disallow addresses which may be confused with IP headers */
122+static int qmi_wwan_mac_addr(struct net_device *dev, void *p)
123+{
124+ int ret;
125+ struct sockaddr *addr = p;
126+
127+ ret = eth_prepare_mac_addr_change(dev, p);
128+ if (ret < 0)
129+ return ret;
130+ if (possibly_iphdr(addr->sa_data))
131+ return -EADDRNOTAVAIL;
132+ eth_commit_mac_addr_change(dev, p);
133+ return 0;
134+}
135+
136+static const struct net_device_ops qmi_wwan_netdev_ops = {
137+ .ndo_open = usbnet_open,
138+ .ndo_stop = usbnet_stop,
139+ .ndo_start_xmit = usbnet_start_xmit,
140+ .ndo_tx_timeout = usbnet_tx_timeout,
141+ .ndo_change_mtu = usbnet_change_mtu,
142+ .ndo_set_mac_address = qmi_wwan_mac_addr,
143+ .ndo_validate_addr = eth_validate_addr,
144+};
145+
55146 /* using a counter to merge subdriver requests with our own into a combined state */
56147 static int qmi_wwan_manage_power(struct usbnet *dev, int on)
57148 {
@@ -229,6 +320,18 @@ next_desc: · 171 unmodified lines
229320 usb_driver_release_interface(driver, info->data);
230321 }
231322
323+ /* Never use the same address on both ends of the link, even
324+ * if the buggy firmware told us to.
325+ */
326+ if (!compare_ether_addr(dev->net->dev_addr, default_modem_addr))
327+ eth_hw_addr_random(dev->net);
328+
329+ /* make MAC addr easily distinguishable from an IP header */
330+ if (possibly_iphdr(dev->net->dev_addr)) {
331+ dev->net->dev_addr[0] |= 0x02; /* set local assignment bit */
332+ dev->net->dev_addr[0] &= 0xbf; /* clear "IP" bit */
333+ }
334+ dev->net->netdev_ops = &qmi_wwan_netdev_ops;
232335 err:
233336 return status;
234337 }
@@ -307,6 +410,7 @@ static const struct driver_info qmi_wwan_info = { · 72 unmodified lines
307410 .bind = qmi_wwan_bind,
308411 .unbind = qmi_wwan_unbind,
309412 .manage_power = qmi_wwan_manage_power,
413+ .rx_fixup = qmi_wwan_rx_fixup,
310414 };
311415
312416 #define HUAWEI_VENDOR_ID 0x12D1
drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h+1−1
@@ -519,7 +519,7 @@ static const u32 ar9580_1p0_mac_core[][2] = { · 518 unmodified lines
519519 {0x00008258, 0x00000000},
520520 {0x0000825c, 0x40000000},
521521 {0x00008260, 0x00080922},
522− {0x00008264, 0x9bc00010},
522+ {0x00008264, 0x9d400010},
523523 {0x00008268, 0xffffffff},
524524 {0x0000826c, 0x0000ffff},
525525 {0x00008270, 0x00000000},
drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c+2−2
@@ -143,14 +143,14 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq) · 142 unmodified lines
143143 u32 sz, i;
144144 struct channel_detector *cd;
145145
146− cd = kmalloc(sizeof(*cd), GFP_KERNEL);
146+ cd = kmalloc(sizeof(*cd), GFP_ATOMIC);
147147 if (cd == NULL)
148148 goto fail;
149149
150150 INIT_LIST_HEAD(&cd->head);
151151 cd->freq = freq;
152152 sz = sizeof(cd->detectors) * dpd->num_radar_types;
153− cd->detectors = kzalloc(sz, GFP_KERNEL);
153+ cd->detectors = kzalloc(sz, GFP_ATOMIC);
154154 if (cd->detectors == NULL)
155155 goto fail;
156156
drivers/net/wireless/ath/ath9k/dfs_pri_detector.c+2−2
@@ -218,7 +218,7 @@ static bool pulse_queue_enqueue(struct pri_detector *pde, u64 ts) · 217 unmodified lines
218218 {
219219 struct pulse_elem *p = pool_get_pulse_elem();
220220 if (p == NULL) {
221− p = kmalloc(sizeof(*p), GFP_KERNEL);
221+ p = kmalloc(sizeof(*p), GFP_ATOMIC);
222222 if (p == NULL) {
223223 DFS_POOL_STAT_INC(pulse_alloc_error);
224224 return false;
@@ -299,7 +299,7 @@ static bool pseq_handler_create_sequences(struct pri_detector *pde, · 74 unmodified lines
299299 ps.deadline_ts = ps.first_ts + ps.dur;
300300 new_ps = pool_get_pseq_elem();
301301 if (new_ps == NULL) {
302− new_ps = kmalloc(sizeof(*new_ps), GFP_KERNEL);
302+ new_ps = kmalloc(sizeof(*new_ps), GFP_ATOMIC);
303303 if (new_ps == NULL) {
304304 DFS_POOL_STAT_INC(pseq_alloc_error);
305305 return false;
drivers/net/wireless/ath/ath9k/htc_drv_init.c+1−1
@@ -796,7 +796,7 @@ static int ath9k_init_firmware_version(struct ath9k_htc_priv *priv) · 795 unmodified lines
796796 * required version.
797797 */
798798 if (priv->fw_version_major != MAJOR_VERSION_REQ ||
799− priv->fw_version_minor != MINOR_VERSION_REQ) {
799+ priv->fw_version_minor < MINOR_VERSION_REQ) {
800800 dev_err(priv->dev, "ath9k_htc: Please upgrade to FW version %d.%d\n",
801801 MAJOR_VERSION_REQ, MINOR_VERSION_REQ);
802802 return -EINVAL;
drivers/net/wireless/b43/phy_n.c+2−1
@@ -5161,7 +5161,8 @@ static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid) · 5160 unmodified lines
51615161 #endif
51625162 #ifdef CONFIG_B43_SSB
51635163 case B43_BUS_SSB:
5164− /* FIXME */
5164+ ssb_pmu_spuravoid_pllupdate(&dev->dev->sdev->bus->chipco,
5165+ avoid);
51655166 break;
51665167 #endif
51675168 }
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c+1−6
@@ -4076,10 +4076,6 @@ static const struct ieee80211_iface_limit brcmf_iface_limits[] = { · 4075 unmodified lines
40764076 BIT(NL80211_IFTYPE_ADHOC) |
40774077 BIT(NL80211_IFTYPE_AP)
40784078 },
4079− {
4080− .max = 1,
4081− .types = BIT(NL80211_IFTYPE_P2P_DEVICE)
4082− },
40834079 {
40844080 .max = 1,
40854081 .types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
@@ -4142,8 +4138,7 @@ static struct wiphy *brcmf_setup_wiphy(struct device *phydev) · 56 unmodified lines
41424138 BIT(NL80211_IFTYPE_ADHOC) |
41434139 BIT(NL80211_IFTYPE_AP) |
41444140 BIT(NL80211_IFTYPE_P2P_CLIENT) |
4145− BIT(NL80211_IFTYPE_P2P_GO) |
4146− BIT(NL80211_IFTYPE_P2P_DEVICE);
4141+ BIT(NL80211_IFTYPE_P2P_GO);
41474142 wiphy->iface_combinations = brcmf_iface_combos;
41484143 wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos);
41494144 wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c+132−133
@@ -276,6 +276,130 @@ static void brcms_set_basic_rate(struct brcm_rateset *rs, u16 rate, bool is_br) · 275 unmodified lines
276276 }
277277 }
278278
279+/**
280+ * This function frees the WL per-device resources.
281+ *
282+ * This function frees resources owned by the WL device pointed to
283+ * by the wl parameter.
284+ *
285+ * precondition: can both be called locked and unlocked
286+ *
287+ */
288+static void brcms_free(struct brcms_info *wl)
289+{
290+ struct brcms_timer *t, *next;
291+
292+ /* free ucode data */
293+ if (wl->fw.fw_cnt)
294+ brcms_ucode_data_free(&wl->ucode);
295+ if (wl->irq)
296+ free_irq(wl->irq, wl);
297+
298+ /* kill dpc */
299+ tasklet_kill(&wl->tasklet);
300+
301+ if (wl->pub) {
302+ brcms_debugfs_detach(wl->pub);
303+ brcms_c_module_unregister(wl->pub, "linux", wl);
304+ }
305+
306+ /* free common resources */
307+ if (wl->wlc) {
308+ brcms_c_detach(wl->wlc);
309+ wl->wlc = NULL;
310+ wl->pub = NULL;
311+ }
312+
313+ /* virtual interface deletion is deferred so we cannot spinwait */
314+
315+ /* wait for all pending callbacks to complete */
316+ while (atomic_read(&wl->callbacks) > 0)
317+ schedule();
318+
319+ /* free timers */
320+ for (t = wl->timers; t; t = next) {
321+ next = t->next;
322+#ifdef DEBUG
323+ kfree(t->name);
324+#endif
325+ kfree(t);
326+ }
327+}
328+
329+/*
330+* called from both kernel as from this kernel module (error flow on attach)
331+* precondition: perimeter lock is not acquired.
332+*/
333+static void brcms_remove(struct bcma_device *pdev)
334+{
335+ struct ieee80211_hw *hw = bcma_get_drvdata(pdev);
336+ struct brcms_info *wl = hw->priv;
337+
338+ if (wl->wlc) {
339+ wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, false);
340+ wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy);
341+ ieee80211_unregister_hw(hw);
342+ }
343+
344+ brcms_free(wl);
345+
346+ bcma_set_drvdata(pdev, NULL);
347+ ieee80211_free_hw(hw);
348+}
349+
350+/*
351+ * Precondition: Since this function is called in brcms_pci_probe() context,
352+ * no locking is required.
353+ */
354+static void brcms_release_fw(struct brcms_info *wl)
355+{
356+ int i;
357+ for (i = 0; i < MAX_FW_IMAGES; i++) {
358+ release_firmware(wl->fw.fw_bin[i]);
359+ release_firmware(wl->fw.fw_hdr[i]);
360+ }
361+}
362+
363+/*
364+ * Precondition: Since this function is called in brcms_pci_probe() context,
365+ * no locking is required.
366+ */
367+static int brcms_request_fw(struct brcms_info *wl, struct bcma_device *pdev)
368+{
369+ int status;
370+ struct device *device = &pdev->dev;
371+ char fw_name[100];
372+ int i;
373+
374+ memset(&wl->fw, 0, sizeof(struct brcms_firmware));
375+ for (i = 0; i < MAX_FW_IMAGES; i++) {
376+ if (brcms_firmwares[i] == NULL)
377+ break;
378+ sprintf(fw_name, "%s-%d.fw", brcms_firmwares[i],
379+ UCODE_LOADER_API_VER);
380+ status = request_firmware(&wl->fw.fw_bin[i], fw_name, device);
381+ if (status) {
382+ wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n",
383+ KBUILD_MODNAME, fw_name);
384+ return status;
385+ }
386+ sprintf(fw_name, "%s_hdr-%d.fw", brcms_firmwares[i],
387+ UCODE_LOADER_API_VER);
388+ status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device);
389+ if (status) {
390+ wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n",
391+ KBUILD_MODNAME, fw_name);
392+ return status;
393+ }
394+ wl->fw.hdr_num_entries[i] =
395+ wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr));
396+ }
397+ wl->fw.fw_cnt = i;
398+ status = brcms_ucode_data_init(wl, &wl->ucode);
399+ brcms_release_fw(wl);
400+ return status;
401+}
402+
279403 static void brcms_ops_tx(struct ieee80211_hw *hw,
280404 struct ieee80211_tx_control *control,
281405 struct sk_buff *skb)
@@ -308,6 +432,14 @@ static int brcms_ops_start(struct ieee80211_hw *hw) · 26 unmodified lines
308432 if (!blocked)
309433 wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy);
310434
435+ if (!wl->ucode.bcm43xx_bomminor) {
436+ err = brcms_request_fw(wl, wl->wlc->hw->d11core);
437+ if (err) {
438+ brcms_remove(wl->wlc->hw->d11core);
439+ return -ENOENT;
440+ }
441+ }
442+
311443 spin_lock_bh(&wl->lock);
312444 /* avoid acknowledging frames before a non-monitor device is added */
313445 wl->mute_tx = true;
@@ -856,129 +988,6 @@ void brcms_dpc(unsigned long data) · 542 unmodified lines
856988 wake_up(&wl->tx_flush_wq);
857989 }
858990
859−/*
860− * Precondition: Since this function is called in brcms_pci_probe() context,
861− * no locking is required.
862− */
863−static int brcms_request_fw(struct brcms_info *wl, struct bcma_device *pdev)
864−{
865− int status;
866− struct device *device = &pdev->dev;
867− char fw_name[100];
868− int i;
869−
870− memset(&wl->fw, 0, sizeof(struct brcms_firmware));
871− for (i = 0; i < MAX_FW_IMAGES; i++) {
872− if (brcms_firmwares[i] == NULL)
873− break;
874− sprintf(fw_name, "%s-%d.fw", brcms_firmwares[i],
875− UCODE_LOADER_API_VER);
876− status = request_firmware(&wl->fw.fw_bin[i], fw_name, device);
877− if (status) {
878− wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n",
879− KBUILD_MODNAME, fw_name);
880− return status;
881− }
882− sprintf(fw_name, "%s_hdr-%d.fw", brcms_firmwares[i],
883− UCODE_LOADER_API_VER);
884− status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device);
885− if (status) {
886− wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n",
887− KBUILD_MODNAME, fw_name);
888− return status;
889− }
890− wl->fw.hdr_num_entries[i] =
891− wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr));
892− }
893− wl->fw.fw_cnt = i;
894− return brcms_ucode_data_init(wl, &wl->ucode);
895−}
896−
897−/*
898− * Precondition: Since this function is called in brcms_pci_probe() context,
899− * no locking is required.
900− */
901−static void brcms_release_fw(struct brcms_info *wl)
902−{
903− int i;
904− for (i = 0; i < MAX_FW_IMAGES; i++) {
905− release_firmware(wl->fw.fw_bin[i]);
906− release_firmware(wl->fw.fw_hdr[i]);
907− }
908−}
909−
910−/**
911− * This function frees the WL per-device resources.
912− *
913− * This function frees resources owned by the WL device pointed to
914− * by the wl parameter.
915− *
916− * precondition: can both be called locked and unlocked
917− *
918− */
919−static void brcms_free(struct brcms_info *wl)
920−{
921− struct brcms_timer *t, *next;
922−
923− /* free ucode data */
924− if (wl->fw.fw_cnt)
925− brcms_ucode_data_free(&wl->ucode);
926− if (wl->irq)
927− free_irq(wl->irq, wl);
928−
929− /* kill dpc */
930− tasklet_kill(&wl->tasklet);
931−
932− if (wl->pub) {
933− brcms_debugfs_detach(wl->pub);
934− brcms_c_module_unregister(wl->pub, "linux", wl);
935− }
936−
937− /* free common resources */
938− if (wl->wlc) {
939− brcms_c_detach(wl->wlc);
940− wl->wlc = NULL;
941− wl->pub = NULL;
942− }
943−
944− /* virtual interface deletion is deferred so we cannot spinwait */
945−
946− /* wait for all pending callbacks to complete */
947− while (atomic_read(&wl->callbacks) > 0)
948− schedule();
949−
950− /* free timers */
951− for (t = wl->timers; t; t = next) {
952− next = t->next;
953−#ifdef DEBUG
954− kfree(t->name);
955−#endif
956− kfree(t);
957− }
958−}
959−
960−/*
961−* called from both kernel as from this kernel module (error flow on attach)
962−* precondition: perimeter lock is not acquired.
963−*/
964−static void brcms_remove(struct bcma_device *pdev)
965−{
966− struct ieee80211_hw *hw = bcma_get_drvdata(pdev);
967− struct brcms_info *wl = hw->priv;
968−
969− if (wl->wlc) {
970− brcms_led_unregister(wl);
971− wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, false);
972− wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy);
973− ieee80211_unregister_hw(hw);
974− }
975−
976− brcms_free(wl);
977−
978− bcma_set_drvdata(pdev, NULL);
979− ieee80211_free_hw(hw);
980−}
981−
982991 static irqreturn_t brcms_isr(int irq, void *dev_id)
983992 {
984993 struct brcms_info *wl;
@@ -1120,18 +1129,8 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev) · 135 unmodified lines
11201129 spin_lock_init(&wl->lock);
11211130 spin_lock_init(&wl->isr_lock);
11221131
1123− /* prepare ucode */
1124− if (brcms_request_fw(wl, pdev) < 0) {
1125− wiphy_err(wl->wiphy, "%s: Failed to find firmware usually in "
1126− "%s\n", KBUILD_MODNAME, "/lib/firmware/brcm");
1127− brcms_release_fw(wl);
1128− brcms_remove(pdev);
1129− return NULL;
1130− }
1131−
11321132 /* common load-time initialization */
11331133 wl->wlc = brcms_c_attach((void *)wl, pdev, unit, false, &err);
1134− brcms_release_fw(wl);
11351134 if (!wl->wlc) {
11361135 wiphy_err(wl->wiphy, "%s: attach() failed with code %d\n",
11371136 KBUILD_MODNAME, err);
drivers/pci/pci-acpi.c+8−7
@@ -53,14 +53,15 @@ static void pci_acpi_wake_dev(acpi_handle handle, u32 event, void *context) · 52 unmodified lines
5353 return;
5454 }
5555
56− if (!pci_dev->pm_cap || !pci_dev->pme_support
57− || pci_check_pme_status(pci_dev)) {
58− if (pci_dev->pme_poll)
59− pci_dev->pme_poll = false;
56+ /* Clear PME Status if set. */
57+ if (pci_dev->pme_support)
58+ pci_check_pme_status(pci_dev);
6059
61− pci_wakeup_event(pci_dev);
62− pm_runtime_resume(&pci_dev->dev);
63− }
60+ if (pci_dev->pme_poll)
61+ pci_dev->pme_poll = false;
62+
63+ pci_wakeup_event(pci_dev);
64+ pm_runtime_resume(&pci_dev->dev);
6465
6566 if (pci_dev->subordinate)
6667 pci_pme_wakeup_bus(pci_dev->subordinate);
drivers/pci/pci-driver.c+3−2
@@ -390,9 +390,10 @@ static void pci_device_shutdown(struct device *dev) · 389 unmodified lines
390390
391391 /*
392392 * Turn off Bus Master bit on the device to tell it to not
393− * continue to do DMA
393+ * continue to do DMA. Don't touch devices in D3cold or unknown states.
394394 */
395− pci_clear_master(pci_dev);
395+ if (pci_dev->current_state <= PCI_D3hot)
396+ pci_clear_master(pci_dev);
396397 }
397398
398399 #ifdef CONFIG_PM
drivers/pci/pcie/portdrv_pci.c+0−13
@@ -184,14 +184,6 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = { · 183 unmodified lines
184184 #define PCIE_PORTDRV_PM_OPS NULL
185185 #endif /* !PM */
186186
187−/*
188− * PCIe port runtime suspend is broken for some chipsets, so use a
189− * black list to disable runtime PM for these chipsets.
190− */
191−static const struct pci_device_id port_runtime_pm_black_list[] = {
192− { /* end: all zeroes */ }
193−};
194−
195187 /*
196188 * pcie_portdrv_probe - Probe PCI-Express port devices
197189 * @dev: PCI-Express port device being probed
@@ -225,16 +217,11 @@ static int pcie_portdrv_probe(struct pci_dev *dev, · 27 unmodified lines
225217 * it by default.
226218 */
227219 dev->d3cold_allowed = false;
228− if (!pci_match_id(port_runtime_pm_black_list, dev))
229− pm_runtime_put_noidle(&dev->dev);
230−
231220 return 0;
232221 }
233222
234223 static void pcie_portdrv_remove(struct pci_dev *dev)
235224 {
236− if (!pci_match_id(port_runtime_pm_black_list, dev))
237− pm_runtime_get_noresume(&dev->dev);
238225 pcie_port_device_remove(dev);
239226 pci_disable_device(dev);
240227 }
drivers/pci/rom.c+31−36
@@ -100,27 +100,6 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size) · 99 unmodified lines
100100 return min((size_t)(image - rom), size);
101101 }
102102
103−static loff_t pci_find_rom(struct pci_dev *pdev, size_t *size)
104−{
105− struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
106− loff_t start;
107−
108− /* assign the ROM an address if it doesn't have one */
109− if (res->parent == NULL && pci_assign_resource(pdev, PCI_ROM_RESOURCE))
110− return 0;
111− start = pci_resource_start(pdev, PCI_ROM_RESOURCE);
112− *size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
113−
114− if (*size == 0)
115− return 0;
116−
117− /* Enable ROM space decodes */
118− if (pci_enable_rom(pdev))
119− return 0;
120−
121− return start;
122−}
123−
124103 /**
125104 * pci_map_rom - map a PCI ROM to kernel space
126105 * @pdev: pointer to pci device struct
@@ -135,7 +114,7 @@ static loff_t pci_find_rom(struct pci_dev *pdev, size_t *size) · 8 unmodified lines
135114 void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
136115 {
137116 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
138− loff_t start = 0;
117+ loff_t start;
139118 void __iomem *rom;
140119
141120 /*
@@ -154,21 +133,21 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) · 12 unmodified lines
154133 return (void __iomem *)(unsigned long)
155134 pci_resource_start(pdev, PCI_ROM_RESOURCE);
156135 } else {
157− start = pci_find_rom(pdev, size);
158− }
159− }
136+ /* assign the ROM an address if it doesn't have one */
137+ if (res->parent == NULL &&
138+ pci_assign_resource(pdev,PCI_ROM_RESOURCE))
139+ return NULL;
140+ start = pci_resource_start(pdev, PCI_ROM_RESOURCE);
141+ *size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
142+ if (*size == 0)
143+ return NULL;
160144
161− /*
162− * Some devices may provide ROMs via a source other than the BAR
163− */
164− if (!start && pdev->rom && pdev->romlen) {
165− *size = pdev->romlen;
166− return phys_to_virt(pdev->rom);
145+ /* Enable ROM space decodes */
146+ if (pci_enable_rom(pdev))
147+ return NULL;
148+ }
167149 }
168150
169− if (!start)
170− return NULL;
171−
172151 rom = ioremap(start, *size);
173152 if (!rom) {
174153 /* restore enable if ioremap fails */
@@ -202,8 +181,7 @@ void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom) · 27 unmodified lines
202181 if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY))
203182 return;
204183
205− if (!pdev->rom || !pdev->romlen)
206− iounmap(rom);
184+ iounmap(rom);
207185
208186 /* Disable again before continuing, leave enabled if pci=rom */
209187 if (!(res->flags & (IORESOURCE_ROM_ENABLE | IORESOURCE_ROM_SHADOW)))
@@ -227,7 +205,24 @@ void pci_cleanup_rom(struct pci_dev *pdev) · 17 unmodified lines
227205 }
228206 }
229207
208+/**
209+ * pci_platform_rom - provides a pointer to any ROM image provided by the
210+ * platform
211+ * @pdev: pointer to pci device struct
212+ * @size: pointer to receive size of pci window over ROM
213+ */
214+void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size)
215+{
216+ if (pdev->rom && pdev->romlen) {
217+ *size = pdev->romlen;
218+ return phys_to_virt((phys_addr_t)pdev->rom);
219+ }
220+
221+ return NULL;
222+}
223+
230224 EXPORT_SYMBOL(pci_map_rom);
231225 EXPORT_SYMBOL(pci_unmap_rom);
232226 EXPORT_SYMBOL_GPL(pci_enable_rom);
233227 EXPORT_SYMBOL_GPL(pci_disable_rom);
228+EXPORT_SYMBOL(pci_platform_rom);
drivers/platform/x86/hp-wmi.c+0−4
@@ -134,7 +134,6 @@ static const struct key_entry hp_wmi_keymap[] = { · 133 unmodified lines
134134 { KE_KEY, 0x2142, { KEY_MEDIA } },
135135 { KE_KEY, 0x213b, { KEY_INFO } },
136136 { KE_KEY, 0x2169, { KEY_DIRECTION } },
137− { KE_KEY, 0x216a, { KEY_SETUP } },
138137 { KE_KEY, 0x231b, { KEY_HELP } },
139138 { KE_END, 0 }
140139 };
@@ -925,9 +924,6 @@ static int __init hp_wmi_init(void) · 784 unmodified lines
925924 err = hp_wmi_input_setup();
926925 if (err)
927926 return err;
928−
929− //Enable magic for hotkeys that run on the SMBus
930− ec_write(0xe6,0x6e);
931927 }
932928
933929 if (bios_capable) {
drivers/platform/x86/thinkpad_acpi.c+0−10
@@ -1964,9 +1964,6 @@ struct tp_nvram_state { · 1963 unmodified lines
19641964 /* kthread for the hotkey poller */
19651965 static struct task_struct *tpacpi_hotkey_task;
19661966
1967−/* Acquired while the poller kthread is running, use to sync start/stop */
1968−static struct mutex hotkey_thread_mutex;
1969−
19701967 /*
19711968 * Acquire mutex to write poller control variables as an
19721969 * atomic block.
@@ -2462,8 +2459,6 @@ static int hotkey_kthread(void *data) · 489 unmodified lines
24622459 unsigned int poll_freq;
24632460 bool was_frozen;
24642461
2465− mutex_lock(&hotkey_thread_mutex);
2466−
24672462 if (tpacpi_lifecycle == TPACPI_LIFE_EXITING)
24682463 goto exit;
24692464
@@ -2523,7 +2518,6 @@ static int hotkey_kthread(void *data) · 53 unmodified lines
25232518 }
25242519
25252520 exit:
2526− mutex_unlock(&hotkey_thread_mutex);
25272521 return 0;
25282522 }
25292523
@@ -2533,9 +2527,6 @@ static void hotkey_poll_stop_sync(void) · 3 unmodified lines
25332527 if (tpacpi_hotkey_task) {
25342528 kthread_stop(tpacpi_hotkey_task);
25352529 tpacpi_hotkey_task = NULL;
2536− mutex_lock(&hotkey_thread_mutex);
2537− /* at this point, the thread did exit */
2538− mutex_unlock(&hotkey_thread_mutex);
25392530 }
25402531 }
25412532
@@ -3234,7 +3225,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) · 692 unmodified lines
32343225 mutex_init(&hotkey_mutex);
32353226
32363227 #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
3237− mutex_init(&hotkey_thread_mutex);
32383228 mutex_init(&hotkey_thread_data_mutex);
32393229 #endif
32403230
drivers/remoteproc/Kconfig+1−1
@@ -4,7 +4,7 @@ menu "Remoteproc drivers" · 3 unmodified lines
44 config REMOTEPROC
55 tristate
66 depends on HAS_DMA
7− select FW_CONFIG
7+ select FW_LOADER
88 select VIRTIO
99
1010 config OMAP_REMOTEPROC
drivers/remoteproc/remoteproc_core.c+4−2
@@ -217,7 +217,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i) · 216 unmodified lines
217217 * TODO: support predefined notifyids (via resource table)
218218 */
219219 ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL);
220− if (ret) {
220+ if (ret < 0) {
221221 dev_err(dev, "idr_alloc failed: %d\n", ret);
222222 dma_free_coherent(dev->parent, size, va, dma);
223223 return ret;
@@ -366,10 +366,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, · 142 unmodified lines
366366 /* it is now safe to add the virtio device */
367367 ret = rproc_add_virtio_dev(rvdev, rsc->id);
368368 if (ret)
369− goto free_rvdev;
369+ goto remove_rvdev;
370370
371371 return 0;
372372
373+remove_rvdev:
374+ list_del(&rvdev->node);
373375 free_rvdev:
374376 kfree(rvdev);
375377 return ret;
drivers/remoteproc/ste_modem_rproc.c+6−1
@@ -240,6 +240,8 @@ static int sproc_drv_remove(struct platform_device *pdev) · 239 unmodified lines
240240
241241 /* Unregister as remoteproc device */
242242 rproc_del(sproc->rproc);
243+ dma_free_coherent(sproc->rproc->dev.parent, SPROC_FW_SIZE,
244+ sproc->fw_addr, sproc->fw_dma_addr);
243245 rproc_put(sproc->rproc);
244246
245247 mdev->drv_data = NULL;
@@ -297,10 +299,13 @@ static int sproc_probe(struct platform_device *pdev) · 51 unmodified lines
297299 /* Register as a remoteproc device */
298300 err = rproc_add(rproc);
299301 if (err)
300− goto free_rproc;
302+ goto free_mem;
301303
302304 return 0;
303305
306+free_mem:
307+ dma_free_coherent(rproc->dev.parent, SPROC_FW_SIZE,
308+ sproc->fw_addr, sproc->fw_dma_addr);
304309 free_rproc:
305310 /* Reset device data upon error */
306311 mdev->drv_data = NULL;
drivers/s390/net/qeth_core.h+3−0
@@ -769,6 +769,7 @@ struct qeth_card { · 768 unmodified lines
769769 unsigned long thread_start_mask;
770770 unsigned long thread_allowed_mask;
771771 unsigned long thread_running_mask;
772+ struct task_struct *recovery_task;
772773 spinlock_t ip_lock;
773774 struct list_head ip_list;
774775 struct list_head *ip_tbd_list;
@@ -862,6 +863,8 @@ extern struct qeth_card_list_struct qeth_core_card_list; · 87 unmodified lines
862863 extern struct kmem_cache *qeth_core_header_cache;
863864 extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS];
864865
866+void qeth_set_recovery_task(struct qeth_card *);
867+void qeth_clear_recovery_task(struct qeth_card *);
865868 void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int);
866869 int qeth_threads_running(struct qeth_card *, unsigned long);
867870 int qeth_wait_for_threads(struct qeth_card *, unsigned long);
drivers/s390/net/qeth_core_main.c+19−0
@@ -177,6 +177,23 @@ const char *qeth_get_cardname_short(struct qeth_card *card) · 176 unmodified lines
177177 return "n/a";
178178 }
179179
180+void qeth_set_recovery_task(struct qeth_card *card)
181+{
182+ card->recovery_task = current;
183+}
184+EXPORT_SYMBOL_GPL(qeth_set_recovery_task);
185+
186+void qeth_clear_recovery_task(struct qeth_card *card)
187+{
188+ card->recovery_task = NULL;
189+}
190+EXPORT_SYMBOL_GPL(qeth_clear_recovery_task);
191+
192+static bool qeth_is_recovery_task(const struct qeth_card *card)
193+{
194+ return card->recovery_task == current;
195+}
196+
180197 void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads,
181198 int clear_start_mask)
182199 {
@@ -205,6 +222,8 @@ EXPORT_SYMBOL_GPL(qeth_threads_running); · 22 unmodified lines
205222
206223 int qeth_wait_for_threads(struct qeth_card *card, unsigned long threads)
207224 {
225+ if (qeth_is_recovery_task(card))
226+ return 0;
208227 return wait_event_interruptible(card->wait_q,
209228 qeth_threads_running(card, threads) == 0);
210229 }
drivers/s390/net/qeth_l2_main.c+2−0
@@ -1144,6 +1144,7 @@ static int qeth_l2_recover(void *ptr) · 1143 unmodified lines
11441144 QETH_CARD_TEXT(card, 2, "recover2");
11451145 dev_warn(&card->gdev->dev,
11461146 "A recovery process has been started for the device\n");
1147+ qeth_set_recovery_task(card);
11471148 __qeth_l2_set_offline(card->gdev, 1);
11481149 rc = __qeth_l2_set_online(card->gdev, 1);
11491150 if (!rc)
@@ -1154,6 +1155,7 @@ static int qeth_l2_recover(void *ptr) · 4 unmodified lines
11541155 dev_warn(&card->gdev->dev, "The qeth device driver "
11551156 "failed to recover an error on the device\n");
11561157 }
1158+ qeth_clear_recovery_task(card);
11571159 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
11581160 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD);
11591161 return 0;
drivers/s390/net/qeth_l3_main.c+2−0
@@ -3520,6 +3520,7 @@ static int qeth_l3_recover(void *ptr) · 3519 unmodified lines
35203520 QETH_CARD_TEXT(card, 2, "recover2");
35213521 dev_warn(&card->gdev->dev,
35223522 "A recovery process has been started for the device\n");
3523+ qeth_set_recovery_task(card);
35233524 __qeth_l3_set_offline(card->gdev, 1);
35243525 rc = __qeth_l3_set_online(card->gdev, 1);
35253526 if (!rc)
@@ -3530,6 +3531,7 @@ static int qeth_l3_recover(void *ptr) · 4 unmodified lines
35303531 dev_warn(&card->gdev->dev, "The qeth device driver "
35313532 "failed to recover an error on the device\n");
35323533 }
3534+ qeth_clear_recovery_task(card);
35333535 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
35343536 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD);
35353537 return 0;
drivers/sbus/char/bbc_i2c.c+2−2
@@ -282,7 +282,7 @@ static irqreturn_t bbc_i2c_interrupt(int irq, void *dev_id) · 281 unmodified lines
282282 return IRQ_HANDLED;
283283 }
284284
285−static void __init reset_one_i2c(struct bbc_i2c_bus *bp)
285+static void reset_one_i2c(struct bbc_i2c_bus *bp)
286286 {
287287 writeb(I2C_PCF_PIN, bp->i2c_control_regs + 0x0);
288288 writeb(bp->own, bp->i2c_control_regs + 0x1);
@@ -291,7 +291,7 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp) · 2 unmodified lines
291291 writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0);
292292 }
293293
294−static struct bbc_i2c_bus * __init attach_one_i2c(struct platform_device *op, int index)
294+static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index)
295295 {
296296 struct bbc_i2c_bus *bp;
297297 struct device_node *dp;
drivers/scsi/ibmvscsi/ibmvscsi.c+1−1
@@ -1899,8 +1899,8 @@ static int ibmvscsi_slave_configure(struct scsi_device *sdev) · 1898 unmodified lines
18991899 sdev->allow_restart = 1;
19001900 blk_queue_rq_timeout(sdev->request_queue, 120 * HZ);
19011901 }
1902− scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun);
19031902 spin_unlock_irqrestore(shost->host_lock, lock_flags);
1903+ scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun);
19041904 return 0;
19051905 }
19061906
drivers/scsi/ipr.c+10−3
@@ -5148,7 +5148,7 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd) · 5147 unmodified lines
51485148 ipr_trace;
51495149 }
51505150
5151− list_add_tail(&ipr_cmd->queue, &hrrq->hrrq_free_q);
5151+ list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
51525152 if (!ipr_is_naca_model(res))
51535153 res->needs_sync_complete = 1;
51545154
@@ -9349,7 +9349,10 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev) · 4194 unmodified lines
93499349 int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
93509350 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
93519351
9352− rc = request_irq(pdev->irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg);
9352+ if (ioa_cfg->intr_flag == IPR_USE_MSIX)
9353+ rc = request_irq(ioa_cfg->vectors_info[0].vec, ipr_test_intr, 0, IPR_NAME, ioa_cfg);
9354+ else
9355+ rc = request_irq(pdev->irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg);
93539356 if (rc) {
93549357 dev_err(&pdev->dev, "Can not assign irq %d\n", pdev->irq);
93559358 return rc;
@@ -9371,7 +9374,10 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev) · 15 unmodified lines
93719374
93729375 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
93739376
9374− free_irq(pdev->irq, ioa_cfg);
9377+ if (ioa_cfg->intr_flag == IPR_USE_MSIX)
9378+ free_irq(ioa_cfg->vectors_info[0].vec, ioa_cfg);
9379+ else
9380+ free_irq(pdev->irq, ioa_cfg);
93759381
93769382 LEAVE;
93779383
@@ -9722,6 +9728,7 @@ static void __ipr_remove(struct pci_dev *pdev) · 344 unmodified lines
97229728 spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags);
97239729 wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
97249730 flush_work(&ioa_cfg->work_q);
9731+ INIT_LIST_HEAD(&ioa_cfg->used_res_q);
97259732 spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags);
97269733
97279734 spin_lock(&ipr_driver_lock);
drivers/scsi/libsas/sas_expander.c+13−1
@@ -235,6 +235,17 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) · 234 unmodified lines
235235 linkrate = phy->linkrate;
236236 memcpy(sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE);
237237
238+ /* Handle vacant phy - rest of dr data is not valid so skip it */
239+ if (phy->phy_state == PHY_VACANT) {
240+ memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
241+ phy->attached_dev_type = NO_DEVICE;
242+ if (!test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) {
243+ phy->phy_id = phy_id;
244+ goto skip;
245+ } else
246+ goto out;
247+ }
248+
238249 phy->attached_dev_type = to_dev_type(dr);
239250 if (test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state))
240251 goto out;
@@ -272,6 +283,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) · 31 unmodified lines
272283 phy->phy->maximum_linkrate = dr->pmax_linkrate;
273284 phy->phy->negotiated_linkrate = phy->linkrate;
274285
286+ skip:
275287 if (new_phy)
276288 if (sas_phy_add(phy->phy)) {
277289 sas_phy_free(phy->phy);
@@ -388,7 +400,7 @@ int sas_ex_phy_discover(struct domain_device *dev, int single) · 110 unmodified lines
388400 if (!disc_req)
389401 return -ENOMEM;
390402
391− disc_resp = alloc_smp_req(DISCOVER_RESP_SIZE);
403+ disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE);
392404 if (!disc_resp) {
393405 kfree(disc_req);
394406 return -ENOMEM;
drivers/scsi/lpfc/lpfc_sli.c+2−1
@@ -438,11 +438,12 @@ lpfc_sli4_rq_put(struct lpfc_queue *hq, struct lpfc_queue *dq, · 437 unmodified lines
438438 struct lpfc_rqe *temp_hrqe;
439439 struct lpfc_rqe *temp_drqe;
440440 struct lpfc_register doorbell;
441− int put_index = hq->host_index;
441+ int put_index;
442442
443443 /* sanity check on queue memory */
444444 if (unlikely(!hq) || unlikely(!dq))
445445 return -ENOMEM;
446+ put_index = hq->host_index;
446447 temp_hrqe = hq->qe[hq->host_index].rqe;
447448 temp_drqe = dq->qe[dq->host_index].rqe;
448449
drivers/scsi/qla2xxx/qla_attr.c+0−5
@@ -1938,11 +1938,6 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) · 1937 unmodified lines
19381938 "Timer for the VP[%d] has stopped\n", vha->vp_idx);
19391939 }
19401940
1941− /* No pending activities shall be there on the vha now */
1942− if (ql2xextended_error_logging & ql_dbg_user)
1943− msleep(random32()%10); /* Just to see if something falls on
1944− * the net we have placed below */
1945−
19461941 BUG_ON(atomic_read(&vha->vref_count));
19471942
19481943 qla2x00_free_fcports(vha);
drivers/scsi/qla2xxx/qla_dbg.c+2−1
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 * | Mailbox commands | 0x115b | 0x111a-0x111b |
1616 * | | | 0x112c-0x112e |
1717 * | | | 0x113a |
18+ * | | | 0x1155-0x1158 |
1819 * | Device Discovery | 0x2087 | 0x2020-0x2022, |
1920 * | | | 0x2016 |
2021 * | Queue Command and IO tracing | 0x3031 | 0x3006-0x300b |
@@ -401,7 +402,7 @@ qla2xxx_copy_atioqueues(struct qla_hw_data *ha, void *ptr, · 380 unmodified lines
401402 void *ring;
402403 } aq, *aqp;
403404
404− if (!ha->tgt.atio_q_length)
405+ if (!ha->tgt.atio_ring)
405406 return ptr;
406407
407408 num_queues = 1;
drivers/scsi/qla2xxx/qla_def.h+0−1
@@ -863,7 +863,6 @@ typedef struct { · 862 unmodified lines
863863 #define MBX_1 BIT_1
864864 #define MBX_0 BIT_0
865865
866−#define RNID_TYPE_SET_VERSION 0x9
867866 #define RNID_TYPE_ASIC_TEMP 0xC
868867
869868 /*
drivers/scsi/qla2xxx/qla_gbl.h+0−3
@@ -357,9 +357,6 @@ qla2x00_enable_fce_trace(scsi_qla_host_t *, dma_addr_t, uint16_t , uint16_t *, · 356 unmodified lines
357357 extern int
358358 qla2x00_disable_fce_trace(scsi_qla_host_t *, uint64_t *, uint64_t *);
359359
360−extern int
361−qla2x00_set_driver_version(scsi_qla_host_t *, char *);
362−
363360 extern int
364361 qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint8_t *,
365362 uint16_t, uint16_t, uint16_t, uint16_t);
drivers/scsi/qla2xxx/qla_init.c+1−3
@@ -619,8 +619,6 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha) · 618 unmodified lines
619619 if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha))
620620 qla24xx_read_fcp_prio_cfg(vha);
621621
622− qla2x00_set_driver_version(vha, QLA2XXX_VERSION);
623−
624622 return (rval);
625623 }
626624
@@ -1399,7 +1397,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) · 772 unmodified lines
13991397 mq_size += ha->max_rsp_queues *
14001398 (rsp->length * sizeof(response_t));
14011399 }
1402− if (ha->tgt.atio_q_length)
1400+ if (ha->tgt.atio_ring)
14031401 mq_size += ha->tgt.atio_q_length * sizeof(request_t);
14041402 /* Allocate memory for Fibre Channel Event Buffer. */
14051403 if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha))
drivers/scsi/qla2xxx/qla_mbx.c+0−58
@@ -3866,64 +3866,6 @@ qla81xx_restart_mpi_firmware(scsi_qla_host_t *vha) · 3865 unmodified lines
38663866 return rval;
38673867 }
38683868
3869−int
3870−qla2x00_set_driver_version(scsi_qla_host_t *vha, char *version)
3871−{
3872− int rval;
3873− mbx_cmd_t mc;
3874− mbx_cmd_t *mcp = &mc;
3875− int len;
3876− uint16_t dwlen;
3877− uint8_t *str;
3878− dma_addr_t str_dma;
3879− struct qla_hw_data *ha = vha->hw;
3880−
3881− if (!IS_FWI2_CAPABLE(ha) || IS_QLA82XX(ha))
3882− return QLA_FUNCTION_FAILED;
3883−
3884− ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1155,
3885− "Entered %s.\n", __func__);
3886−
3887− str = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &str_dma);
3888− if (!str) {
3889− ql_log(ql_log_warn, vha, 0x1156,
3890− "Failed to allocate driver version param.\n");
3891− return QLA_MEMORY_ALLOC_FAILED;
3892− }
3893−
3894− memcpy(str, "\x7\x3\x11\x0", 4);
3895− dwlen = str[0];
3896− len = dwlen * sizeof(uint32_t) - 4;
3897− memset(str + 4, 0, len);
3898− if (len > strlen(version))
3899− len = strlen(version);
3900− memcpy(str + 4, version, len);
3901−
3902− mcp->mb[0] = MBC_SET_RNID_PARAMS;
3903− mcp->mb[1] = RNID_TYPE_SET_VERSION << 8 | dwlen;
3904− mcp->mb[2] = MSW(LSD(str_dma));
3905− mcp->mb[3] = LSW(LSD(str_dma));
3906− mcp->mb[6] = MSW(MSD(str_dma));
3907− mcp->mb[7] = LSW(MSD(str_dma));
3908− mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
3909− mcp->in_mb = MBX_0;
3910− mcp->tov = MBX_TOV_SECONDS;
3911− mcp->flags = 0;
3912− rval = qla2x00_mailbox_command(vha, mcp);
3913−
3914− if (rval != QLA_SUCCESS) {
3915− ql_dbg(ql_dbg_mbx, vha, 0x1157,
3916− "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]);
3917− } else {
3918− ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1158,
3919− "Done %s.\n", __func__);
3920− }
3921−
3922− dma_pool_free(ha->s_dma_pool, str, str_dma);
3923−
3924− return rval;
3925−}
3926−
39273869 static int
39283870 qla2x00_read_asic_temperature(scsi_qla_host_t *vha, uint16_t *temp)
39293871 {
drivers/scsi/qla2xxx/qla_version.h+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 /*
88 * Driver version
99 */
10−#define QLA2XXX_VERSION "8.04.00.08-k"
10+#define QLA2XXX_VERSION "8.04.00.13-k"
1111
1212 #define QLA_DRIVER_MAJOR_VER 8
1313 #define QLA_DRIVER_MINOR_VER 4
drivers/scsi/st.c+7−1
@@ -4112,6 +4112,10 @@ static int st_probe(struct device *dev) · 4111 unmodified lines
41124112 tpnt->disk = disk;
41134113 disk->private_data = &tpnt->driver;
41144114 disk->queue = SDp->request_queue;
4115+ /* SCSI tape doesn't register this gendisk via add_disk(). Manually
4116+ * take queue reference that release_disk() expects. */
4117+ if (!blk_get_queue(disk->queue))
4118+ goto out_put_disk;
41154119 tpnt->driver = &st_template;
41164120
41174121 tpnt->device = SDp;
@@ -4185,7 +4189,7 @@ static int st_probe(struct device *dev) · 67 unmodified lines
41854189 idr_preload_end();
41864190 if (error < 0) {
41874191 pr_warn("st: idr allocation failed: %d\n", error);
4188− goto out_put_disk;
4192+ goto out_put_queue;
41894193 }
41904194 tpnt->index = error;
41914195 sprintf(disk->disk_name, "st%d", tpnt->index);
@@ -4211,6 +4215,8 @@ out_remove_devs: · 19 unmodified lines
42114215 spin_lock(&st_index_lock);
42124216 idr_remove(&st_index_idr, tpnt->index);
42134217 spin_unlock(&st_index_lock);
4218+out_put_queue:
4219+ blk_put_queue(disk->queue);
42144220 out_put_disk:
42154221 put_disk(disk);
42164222 kfree(tpnt);
drivers/ssb/driver_chipcommon_pmu.c+29−0
@@ -670,3 +670,32 @@ u32 ssb_pmu_get_controlclock(struct ssb_chipcommon *cc) · 669 unmodified lines
670670 return 0;
671671 }
672672 }
673+
674+void ssb_pmu_spuravoid_pllupdate(struct ssb_chipcommon *cc, int spuravoid)
675+{
676+ u32 pmu_ctl = 0;
677+
678+ switch (cc->dev->bus->chip_id) {
679+ case 0x4322:
680+ ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL0, 0x11100070);
681+ ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL1, 0x1014140a);
682+ ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL5, 0x88888854);
683+ if (spuravoid == 1)
684+ ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL2, 0x05201828);
685+ else
686+ ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL2, 0x05001828);
687+ pmu_ctl = SSB_CHIPCO_PMU_CTL_PLL_UPD;
688+ break;
689+ case 43222:
690+ /* TODO: BCM43222 requires updating PLLs too */
691+ return;
692+ default:
693+ ssb_printk(KERN_ERR PFX
694+ "Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n",
695+ cc->dev->bus->chip_id);
696+ return;
697+ }
698+
699+ chipco_set32(cc, SSB_CHIPCO_PMU_CTL, pmu_ctl);
700+}
701+EXPORT_SYMBOL_GPL(ssb_pmu_spuravoid_pllupdate);
drivers/target/target_core_alua.c+3−0
@@ -409,6 +409,7 @@ static inline int core_alua_state_standby( · 408 unmodified lines
409409 case REPORT_LUNS:
410410 case RECEIVE_DIAGNOSTIC:
411411 case SEND_DIAGNOSTIC:
412+ return 0;
412413 case MAINTENANCE_IN:
413414 switch (cdb[1] & 0x1f) {
414415 case MI_REPORT_TARGET_PGS:
@@ -451,6 +452,7 @@ static inline int core_alua_state_unavailable( · 36 unmodified lines
451452 switch (cdb[0]) {
452453 case INQUIRY:
453454 case REPORT_LUNS:
455+ return 0;
454456 case MAINTENANCE_IN:
455457 switch (cdb[1] & 0x1f) {
456458 case MI_REPORT_TARGET_PGS:
@@ -491,6 +493,7 @@ static inline int core_alua_state_transition( · 34 unmodified lines
491493 switch (cdb[0]) {
492494 case INQUIRY:
493495 case REPORT_LUNS:
496+ return 0;
494497 case MAINTENANCE_IN:
495498 switch (cdb[1] & 0x1f) {
496499 case MI_REPORT_TARGET_PGS:
drivers/tty/mxser.c+4−4
@@ -2643,9 +2643,9 @@ static int mxser_probe(struct pci_dev *pdev, · 2642 unmodified lines
26432643 mxvar_sdriver, brd->idx + i, &pdev->dev);
26442644 if (IS_ERR(tty_dev)) {
26452645 retval = PTR_ERR(tty_dev);
2646− for (i--; i >= 0; i--)
2646+ for (; i > 0; i--)
26472647 tty_unregister_device(mxvar_sdriver,
2648− brd->idx + i);
2648+ brd->idx + i - 1);
26492649 goto err_relbrd;
26502650 }
26512651 }
@@ -2751,9 +2751,9 @@ static int __init mxser_module_init(void) · 99 unmodified lines
27512751 tty_dev = tty_port_register_device(&brd->ports[i].port,
27522752 mxvar_sdriver, brd->idx + i, NULL);
27532753 if (IS_ERR(tty_dev)) {
2754− for (i--; i >= 0; i--)
2754+ for (; i > 0; i--)
27552755 tty_unregister_device(mxvar_sdriver,
2756− brd->idx + i);
2756+ brd->idx + i - 1);
27572757 for (i = 0; i < brd->info->nports; i++)
27582758 tty_port_destroy(&brd->ports[i].port);
27592759 free_irq(brd->irq, brd);
drivers/tty/serial/8250/8250_pnp.c+5−7
@@ -429,7 +429,6 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) · 428 unmodified lines
429429 {
430430 struct uart_8250_port uart;
431431 int ret, line, flags = dev_id->driver_data;
432− struct resource *res = NULL;
433432
434433 if (flags & UNKNOWN_DEV) {
435434 ret = serial_pnp_guess_board(dev);
@@ -440,12 +439,11 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) · 4 unmodified lines
440439 memset(&uart, 0, sizeof(uart));
441440 if (pnp_irq_valid(dev, 0))
442441 uart.port.irq = pnp_irq(dev, 0);
443− if ((flags & CIR_PORT) && pnp_port_valid(dev, 2))
444− res = pnp_get_resource(dev, IORESOURCE_IO, 2);
445− else if (pnp_port_valid(dev, 0))
446− res = pnp_get_resource(dev, IORESOURCE_IO, 0);
447− if (pnp_resource_enabled(res)) {
448− uart.port.iobase = res->start;
442+ if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) {
443+ uart.port.iobase = pnp_port_start(dev, 2);
444+ uart.port.iotype = UPIO_PORT;
445+ } else if (pnp_port_valid(dev, 0)) {
446+ uart.port.iobase = pnp_port_start(dev, 0);
449447 uart.port.iotype = UPIO_PORT;
450448 } else if (pnp_mem_valid(dev, 0)) {
451449 uart.port.mapbase = pnp_mem_start(dev, 0);
drivers/tty/serial/omap-serial.c+11−0
@@ -886,6 +886,17 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, · 885 unmodified lines
886886 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
887887 /* FIFO ENABLE, DMA MODE */
888888
889+ up->scr |= OMAP_UART_SCR_RX_TRIG_GRANU1_MASK;
890+ /*
891+ * NOTE: Setting OMAP_UART_SCR_RX_TRIG_GRANU1_MASK
892+ * sets Enables the granularity of 1 for TRIGGER RX
893+ * level. Along with setting RX FIFO trigger level
894+ * to 1 (as noted below, 16 characters) and TLR[3:0]
895+ * to zero this will result RX FIFO threshold level
896+ * to 1 character, instead of 16 as noted in comment
897+ * below.
898+ */
899+
889900 /* Set receive FIFO threshold to 16 characters and
890901 * transmit FIFO threshold to 16 spaces
891902 */
drivers/vfio/pci/vfio_pci.c+2−1
@@ -346,6 +346,7 @@ static long vfio_pci_ioctl(void *device_data, · 345 unmodified lines
346346
347347 if (!(hdr.flags & VFIO_IRQ_SET_DATA_NONE)) {
348348 size_t size;
349+ int max = vfio_pci_get_irq_count(vdev, hdr.index);
349350
350351 if (hdr.flags & VFIO_IRQ_SET_DATA_BOOL)
351352 size = sizeof(uint8_t);
@@ -355,7 +356,7 @@ static long vfio_pci_ioctl(void *device_data, · 3 unmodified lines
355356 return -EINVAL;
356357
357358 if (hdr.argsz - minsz < hdr.count * size ||
358− hdr.count > vfio_pci_get_irq_count(vdev, hdr.index))
359+ hdr.start >= max || hdr.start + hdr.count > max)
359360 return -EINVAL;
360361
361362 data = memdup_user((void __user *)(arg + minsz),
drivers/vhost/tcm_vhost.c+130−68
@@ -74,9 +74,8 @@ enum { · 73 unmodified lines
7474
7575 struct vhost_scsi {
7676 /* Protected by vhost_scsi->dev.mutex */
77− struct tcm_vhost_tpg *vs_tpg[VHOST_SCSI_MAX_TARGET];
77+ struct tcm_vhost_tpg **vs_tpg;
7878 char vs_vhost_wwpn[TRANSPORT_IQN_LEN];
79− bool vs_endpoint;
8079
8180 struct vhost_dev dev;
8281 struct vhost_virtqueue vqs[VHOST_SCSI_MAX_VQ];
@@ -579,9 +578,27 @@ static void tcm_vhost_submission_work(struct work_struct *work) · 496 unmodified lines
579578 }
580579 }
581580
581+static void vhost_scsi_send_bad_target(struct vhost_scsi *vs,
582+ struct vhost_virtqueue *vq, int head, unsigned out)
583+{
584+ struct virtio_scsi_cmd_resp __user *resp;
585+ struct virtio_scsi_cmd_resp rsp;
586+ int ret;
587+
588+ memset(&rsp, 0, sizeof(rsp));
589+ rsp.response = VIRTIO_SCSI_S_BAD_TARGET;
590+ resp = vq->iov[out].iov_base;
591+ ret = __copy_to_user(resp, &rsp, sizeof(rsp));
592+ if (!ret)
593+ vhost_add_used_and_signal(&vs->dev, vq, head, 0);
594+ else
595+ pr_err("Faulted on virtio_scsi_cmd_resp\n");
596+}
597+
582598 static void vhost_scsi_handle_vq(struct vhost_scsi *vs,
583599 struct vhost_virtqueue *vq)
584600 {
601+ struct tcm_vhost_tpg **vs_tpg;
585602 struct virtio_scsi_cmd_req v_req;
586603 struct tcm_vhost_tpg *tv_tpg;
587604 struct tcm_vhost_cmd *tv_cmd;
@@ -590,8 +607,16 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, · 2 unmodified lines
590607 int head, ret;
591608 u8 target;
592609
593− /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */
594− if (unlikely(!vs->vs_endpoint))
610+ /*
611+ * We can handle the vq only after the endpoint is setup by calling the
612+ * VHOST_SCSI_SET_ENDPOINT ioctl.
613+ *
614+ * TODO: Check that we are running from vhost_worker which acts
615+ * as read-side critical section for vhost kind of RCU.
616+ * See the comments in struct vhost_virtqueue in drivers/vhost/vhost.h
617+ */
618+ vs_tpg = rcu_dereference_check(vq->private_data, 1);
619+ if (!vs_tpg)
595620 return;
596621
597622 mutex_lock(&vq->mutex);
@@ -661,23 +686,11 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, · 63 unmodified lines
661686
662687 /* Extract the tpgt */
663688 target = v_req.lun[1];
664− tv_tpg = vs->vs_tpg[target];
689+ tv_tpg = ACCESS_ONCE(vs_tpg[target]);
665690
666691 /* Target does not exist, fail the request */
667692 if (unlikely(!tv_tpg)) {
668− struct virtio_scsi_cmd_resp __user *resp;
669− struct virtio_scsi_cmd_resp rsp;
670−
671− memset(&rsp, 0, sizeof(rsp));
672− rsp.response = VIRTIO_SCSI_S_BAD_TARGET;
673− resp = vq->iov[out].iov_base;
674− ret = __copy_to_user(resp, &rsp, sizeof(rsp));
675− if (!ret)
676− vhost_add_used_and_signal(&vs->dev,
677− vq, head, 0);
678− else
679− pr_err("Faulted on virtio_scsi_cmd_resp\n");
680−
693+ vhost_scsi_send_bad_target(vs, vq, head, out);
681694 continue;
682695 }
683696
@@ -690,22 +703,13 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, · 6 unmodified lines
690703 if (IS_ERR(tv_cmd)) {
691704 vq_err(vq, "vhost_scsi_allocate_cmd failed %ld\n",
692705 PTR_ERR(tv_cmd));
693− break;
706+ goto err_cmd;
694707 }
695708 pr_debug("Allocated tv_cmd: %p exp_data_len: %d, data_direction"
696709 ": %d\n", tv_cmd, exp_data_len, data_direction);
697710
698711 tv_cmd->tvc_vhost = vs;
699712 tv_cmd->tvc_vq = vq;
700−
701− if (unlikely(vq->iov[out].iov_len !=
702− sizeof(struct virtio_scsi_cmd_resp))) {
703− vq_err(vq, "Expecting virtio_scsi_cmd_resp, got %zu"
704− " bytes, out: %d, in: %d\n",
705− vq->iov[out].iov_len, out, in);
706− break;
707− }
708−
709713 tv_cmd->tvc_resp = vq->iov[out].iov_base;
710714
711715 /*
@@ -725,7 +729,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, · 13 unmodified lines
725729 " exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n",
726730 scsi_command_size(tv_cmd->tvc_cdb),
727731 TCM_VHOST_MAX_CDB_SIZE);
728− break; /* TODO */
732+ goto err_free;
729733 }
730734 tv_cmd->tvc_lun = ((v_req.lun[2] << 8) | v_req.lun[3]) & 0x3FFF;
731735
@@ -738,7 +742,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, · 6 unmodified lines
738742 data_direction == DMA_TO_DEVICE);
739743 if (unlikely(ret)) {
740744 vq_err(vq, "Failed to map iov to sgl\n");
741− break; /* TODO */
745+ goto err_free;
742746 }
743747 }
744748
@@ -759,6 +763,13 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, · 14 unmodified lines
759763 }
760764
761765 mutex_unlock(&vq->mutex);
766+ return;
767+
768+err_free:
769+ vhost_scsi_free_cmd(tv_cmd);
770+err_cmd:
771+ vhost_scsi_send_bad_target(vs, vq, head, out);
772+ mutex_unlock(&vq->mutex);
762773 }
763774
764775 static void vhost_scsi_ctl_handle_kick(struct vhost_work *work)
@@ -780,6 +791,20 @@ static void vhost_scsi_handle_kick(struct vhost_work *work) · 15 unmodified lines
780791 vhost_scsi_handle_vq(vs, vq);
781792 }
782793
794+static void vhost_scsi_flush_vq(struct vhost_scsi *vs, int index)
795+{
796+ vhost_poll_flush(&vs->dev.vqs[index].poll);
797+}
798+
799+static void vhost_scsi_flush(struct vhost_scsi *vs)
800+{
801+ int i;
802+
803+ for (i = 0; i < VHOST_SCSI_MAX_VQ; i++)
804+ vhost_scsi_flush_vq(vs, i);
805+ vhost_work_flush(&vs->dev, &vs->vs_completion_work);
806+}
807+
783808 /*
784809 * Called from vhost_scsi_ioctl() context to walk the list of available
785810 * tcm_vhost_tpg with an active struct tcm_vhost_nexus
@@ -790,8 +815,10 @@ static int vhost_scsi_set_endpoint( · 4 unmodified lines
790815 {
791816 struct tcm_vhost_tport *tv_tport;
792817 struct tcm_vhost_tpg *tv_tpg;
818+ struct tcm_vhost_tpg **vs_tpg;
819+ struct vhost_virtqueue *vq;
820+ int index, ret, i, len;
793821 bool match = false;
794− int index, ret;
795822
796823 mutex_lock(&vs->dev.mutex);
797824 /* Verify that ring has been setup correctly. */
@@ -803,6 +830,15 @@ static int vhost_scsi_set_endpoint( · 5 unmodified lines
803830 }
804831 }
805832
833+ len = sizeof(vs_tpg[0]) * VHOST_SCSI_MAX_TARGET;
834+ vs_tpg = kzalloc(len, GFP_KERNEL);
835+ if (!vs_tpg) {
836+ mutex_unlock(&vs->dev.mutex);
837+ return -ENOMEM;
838+ }
839+ if (vs->vs_tpg)
840+ memcpy(vs_tpg, vs->vs_tpg, len);
841+
806842 mutex_lock(&tcm_vhost_mutex);
807843 list_for_each_entry(tv_tpg, &tcm_vhost_list, tv_tpg_list) {
808844 mutex_lock(&tv_tpg->tv_tpg_mutex);
@@ -817,14 +853,15 @@ static int vhost_scsi_set_endpoint( · 8 unmodified lines
817853 tv_tport = tv_tpg->tport;
818854
819855 if (!strcmp(tv_tport->tport_name, t->vhost_wwpn)) {
820− if (vs->vs_tpg[tv_tpg->tport_tpgt]) {
856+ if (vs->vs_tpg && vs->vs_tpg[tv_tpg->tport_tpgt]) {
821857 mutex_unlock(&tv_tpg->tv_tpg_mutex);
822858 mutex_unlock(&tcm_vhost_mutex);
823859 mutex_unlock(&vs->dev.mutex);
860+ kfree(vs_tpg);
824861 return -EEXIST;
825862 }
826863 tv_tpg->tv_tpg_vhost_count++;
827− vs->vs_tpg[tv_tpg->tport_tpgt] = tv_tpg;
864+ vs_tpg[tv_tpg->tport_tpgt] = tv_tpg;
828865 smp_mb__after_atomic_inc();
829866 match = true;
830867 }
@@ -835,12 +872,27 @@ static int vhost_scsi_set_endpoint( · 4 unmodified lines
835872 if (match) {
836873 memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn,
837874 sizeof(vs->vs_vhost_wwpn));
838− vs->vs_endpoint = true;
875+ for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) {
876+ vq = &vs->vqs[i];
877+ /* Flushing the vhost_work acts as synchronize_rcu */
878+ mutex_lock(&vq->mutex);
879+ rcu_assign_pointer(vq->private_data, vs_tpg);
880+ vhost_init_used(vq);
881+ mutex_unlock(&vq->mutex);
882+ }
839883 ret = 0;
840884 } else {
841885 ret = -EEXIST;
842886 }
843887
888+ /*
889+ * Act as synchronize_rcu to make sure access to
890+ * old vs->vs_tpg is finished.
891+ */
892+ vhost_scsi_flush(vs);
893+ kfree(vs->vs_tpg);
894+ vs->vs_tpg = vs_tpg;
895+
844896 mutex_unlock(&vs->dev.mutex);
845897 return ret;
846898 }
@@ -851,6 +903,8 @@ static int vhost_scsi_clear_endpoint( · 4 unmodified lines
851903 {
852904 struct tcm_vhost_tport *tv_tport;
853905 struct tcm_vhost_tpg *tv_tpg;
906+ struct vhost_virtqueue *vq;
907+ bool match = false;
854908 int index, ret, i;
855909 u8 target;
856910
@@ -862,9 +916,14 @@ static int vhost_scsi_clear_endpoint( · 5 unmodified lines
862916 goto err_dev;
863917 }
864918 }
919+
920+ if (!vs->vs_tpg) {
921+ mutex_unlock(&vs->dev.mutex);
922+ return 0;
923+ }
924+
865925 for (i = 0; i < VHOST_SCSI_MAX_TARGET; i++) {
866926 target = i;
867−
868927 tv_tpg = vs->vs_tpg[target];
869928 if (!tv_tpg)
870929 continue;
@@ -886,10 +945,27 @@ static int vhost_scsi_clear_endpoint( · 15 unmodified lines
886945 }
887946 tv_tpg->tv_tpg_vhost_count--;
888947 vs->vs_tpg[target] = NULL;
889− vs->vs_endpoint = false;
948+ match = true;
890949 mutex_unlock(&tv_tpg->tv_tpg_mutex);
891950 }
951+ if (match) {
952+ for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) {
953+ vq = &vs->vqs[i];
954+ /* Flushing the vhost_work acts as synchronize_rcu */
955+ mutex_lock(&vq->mutex);
956+ rcu_assign_pointer(vq->private_data, NULL);
957+ mutex_unlock(&vq->mutex);
958+ }
959+ }
960+ /*
961+ * Act as synchronize_rcu to make sure access to
962+ * old vs->vs_tpg is finished.
963+ */
964+ vhost_scsi_flush(vs);
965+ kfree(vs->vs_tpg);
966+ vs->vs_tpg = NULL;
892967 mutex_unlock(&vs->dev.mutex);
968+
893969 return 0;
894970
895971 err_tpg:
@@ -899,6 +975,24 @@ err_dev: · 3 unmodified lines
899975 return ret;
900976 }
901977
978+static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features)
979+{
980+ if (features & ~VHOST_SCSI_FEATURES)
981+ return -EOPNOTSUPP;
982+
983+ mutex_lock(&vs->dev.mutex);
984+ if ((features & (1 << VHOST_F_LOG_ALL)) &&
985+ !vhost_log_access_ok(&vs->dev)) {
986+ mutex_unlock(&vs->dev.mutex);
987+ return -EFAULT;
988+ }
989+ vs->dev.acked_features = features;
990+ smp_wmb();
991+ vhost_scsi_flush(vs);
992+ mutex_unlock(&vs->dev.mutex);
993+ return 0;
994+}
995+
902996 static int vhost_scsi_open(struct inode *inode, struct file *f)
903997 {
904998 struct vhost_scsi *s;
@@ -939,38 +1033,6 @@ static int vhost_scsi_release(struct inode *inode, struct file *f) · 34 unmodified lines
9391033 return 0;
9401034 }
9411035
942−static void vhost_scsi_flush_vq(struct vhost_scsi *vs, int index)
943−{
944− vhost_poll_flush(&vs->dev.vqs[index].poll);
945−}
946−
947−static void vhost_scsi_flush(struct vhost_scsi *vs)
948−{
949− int i;
950−
951− for (i = 0; i < VHOST_SCSI_MAX_VQ; i++)
952− vhost_scsi_flush_vq(vs, i);
953− vhost_work_flush(&vs->dev, &vs->vs_completion_work);
954−}
955−
956−static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features)
957−{
958− if (features & ~VHOST_SCSI_FEATURES)
959− return -EOPNOTSUPP;
960−
961− mutex_lock(&vs->dev.mutex);
962− if ((features & (1 << VHOST_F_LOG_ALL)) &&
963− !vhost_log_access_ok(&vs->dev)) {
964− mutex_unlock(&vs->dev.mutex);
965− return -EFAULT;
966− }
967− vs->dev.acked_features = features;
968− smp_wmb();
969− vhost_scsi_flush(vs);
970− mutex_unlock(&vs->dev.mutex);
971− return 0;
972−}
973−
9741036 static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,
9751037 unsigned long arg)
9761038 {
drivers/video/fbmem.c+14−25
@@ -1373,15 +1373,12 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) · 1372 unmodified lines
13731373 {
13741374 struct fb_info *info = file_fb_info(file);
13751375 struct fb_ops *fb;
1376− unsigned long off;
1376+ unsigned long mmio_pgoff;
13771377 unsigned long start;
13781378 u32 len;
13791379
13801380 if (!info)
13811381 return -ENODEV;
1382− if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
1383− return -EINVAL;
1384− off = vma->vm_pgoff << PAGE_SHIFT;
13851382 fb = info->fbops;
13861383 if (!fb)
13871384 return -ENODEV;
@@ -1393,32 +1390,24 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) · 5 unmodified lines
13931390 return res;
13941391 }
13951392
1396− /* frame buffer memory */
1393+ /*
1394+ * Ugh. This can be either the frame buffer mapping, or
1395+ * if pgoff points past it, the mmio mapping.
1396+ */
13971397 start = info->fix.smem_start;
1398− len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
1399− if (off >= len) {
1400− /* memory mapped io */
1401− off -= len;
1402− if (info->var.accel_flags) {
1403− mutex_unlock(&info->mm_lock);
1404− return -EINVAL;
1405− }
1398+ len = info->fix.smem_len;
1399+ mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT;
1400+ if (vma->vm_pgoff >= mmio_pgoff) {
1401+ vma->vm_pgoff -= mmio_pgoff;
14061402 start = info->fix.mmio_start;
1407− len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len);
1403+ len = info->fix.mmio_len;
14081404 }
14091405 mutex_unlock(&info->mm_lock);
1410− start &= PAGE_MASK;
1411− if ((vma->vm_end - vma->vm_start + off) > len)
1412− return -EINVAL;
1413− off += start;
1414− vma->vm_pgoff = off >> PAGE_SHIFT;
1415− /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by io_remap_pfn_range()*/
1406+
14161407 vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
1417− fb_pgprotect(file, vma, off);
1418− if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
1419− vma->vm_end - vma->vm_start, vma->vm_page_prot))
1420− return -EAGAIN;
1421− return 0;
1408+ fb_pgprotect(file, vma, start);
1409+
1410+ return vm_iomap_memory(vma, start, len);
14221411 }
14231412
14241413 static int
drivers/video/mmp/core.c+0−2
@@ -252,7 +252,5 @@ void mmp_unregister_path(struct mmp_path *path) · 251 unmodified lines
252252
253253 kfree(path);
254254 mutex_unlock(&disp_lock);
255−
256− dev_info(path->dev, "de-register %s\n", path->name);
257255 }
258256 EXPORT_SYMBOL_GPL(mmp_unregister_path);
drivers/watchdog/Kconfig+1−1
@@ -117,7 +117,7 @@ config ARM_SP805_WATCHDOG · 116 unmodified lines
117117
118118 config AT91RM9200_WATCHDOG
119119 tristate "AT91RM9200 watchdog"
120− depends on ARCH_AT91
120+ depends on ARCH_AT91RM9200
121121 help
122122 Watchdog timer embedded into AT91RM9200 chips. This will reboot your
123123 system when the timeout is reached.
drivers/xen/events.c+15−4
@@ -1316,7 +1316,7 @@ static void __xen_evtchn_do_upcall(void) · 1315 unmodified lines
13161316 {
13171317 int start_word_idx, start_bit_idx;
13181318 int word_idx, bit_idx;
1319− int i;
1319+ int i, irq;
13201320 int cpu = get_cpu();
13211321 struct shared_info *s = HYPERVISOR_shared_info;
13221322 struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);
@@ -1324,6 +1324,8 @@ static void __xen_evtchn_do_upcall(void) · 1 unmodified line
13241324
13251325 do {
13261326 xen_ulong_t pending_words;
1327+ xen_ulong_t pending_bits;
1328+ struct irq_desc *desc;
13271329
13281330 vcpu_info->evtchn_upcall_pending = 0;
13291331
@@ -1335,6 +1337,17 @@ static void __xen_evtchn_do_upcall(void) · 5 unmodified lines
13351337 * selector flag. xchg_xen_ulong must contain an
13361338 * appropriate barrier.
13371339 */
1340+ if ((irq = per_cpu(virq_to_irq, cpu)[VIRQ_TIMER]) != -1) {
1341+ int evtchn = evtchn_from_irq(irq);
1342+ word_idx = evtchn / BITS_PER_LONG;
1343+ pending_bits = evtchn % BITS_PER_LONG;
1344+ if (active_evtchns(cpu, s, word_idx) & (1ULL << pending_bits)) {
1345+ desc = irq_to_desc(irq);
1346+ if (desc)
1347+ generic_handle_irq_desc(irq, desc);
1348+ }
1349+ }
1350+
13381351 pending_words = xchg_xen_ulong(&vcpu_info->evtchn_pending_sel, 0);
13391352
13401353 start_word_idx = __this_cpu_read(current_word_idx);
@@ -1343,7 +1356,6 @@ static void __xen_evtchn_do_upcall(void) · 2 unmodified lines
13431356 word_idx = start_word_idx;
13441357
13451358 for (i = 0; pending_words != 0; i++) {
1346− xen_ulong_t pending_bits;
13471359 xen_ulong_t words;
13481360
13491361 words = MASK_LSBS(pending_words, word_idx);
@@ -1372,8 +1384,7 @@ static void __xen_evtchn_do_upcall(void) · 22 unmodified lines
13721384
13731385 do {
13741386 xen_ulong_t bits;
1375− int port, irq;
1376− struct irq_desc *desc;
1387+ int port;
13771388
13781389 bits = MASK_LSBS(pending_bits, bit_idx);
13791390
fs/binfmt_elf.c+1−0
@@ -1137,6 +1137,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, · 1136 unmodified lines
11371137 goto whole;
11381138 if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE))
11391139 goto whole;
1140+ return 0;
11401141 }
11411142
11421143 /* Do not dump I/O mapped devices or special mappings */
fs/bio.c+0−2
@@ -1428,8 +1428,6 @@ void bio_endio(struct bio *bio, int error) · 1427 unmodified lines
14281428 else if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
14291429 error = -EIO;
14301430
1431− trace_block_bio_complete(bio, error);
1432−
14331431 if (bio->bi_end_io)
14341432 bio->bi_end_io(bio, error);
14351433 }
fs/btrfs/tree-log.c+42−6
@@ -317,6 +317,7 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans, · 316 unmodified lines
317317 unsigned long src_ptr;
318318 unsigned long dst_ptr;
319319 int overwrite_root = 0;
320+ bool inode_item = key->type == BTRFS_INODE_ITEM_KEY;
320321
321322 if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID)
322323 overwrite_root = 1;
@@ -326,6 +327,9 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans, · 3 unmodified lines
326327
327328 /* look for the key in the destination tree */
328329 ret = btrfs_search_slot(NULL, root, key, path, 0, 0);
330+ if (ret < 0)
331+ return ret;
332+
329333 if (ret == 0) {
330334 char *src_copy;
331335 char *dst_copy;
@@ -367,6 +371,30 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans, · 35 unmodified lines
367371 return 0;
368372 }
369373
374+ /*
375+ * We need to load the old nbytes into the inode so when we
376+ * replay the extents we've logged we get the right nbytes.
377+ */
378+ if (inode_item) {
379+ struct btrfs_inode_item *item;
380+ u64 nbytes;
381+
382+ item = btrfs_item_ptr(path->nodes[0], path->slots[0],
383+ struct btrfs_inode_item);
384+ nbytes = btrfs_inode_nbytes(path->nodes[0], item);
385+ item = btrfs_item_ptr(eb, slot,
386+ struct btrfs_inode_item);
387+ btrfs_set_inode_nbytes(eb, item, nbytes);
388+ }
389+ } else if (inode_item) {
390+ struct btrfs_inode_item *item;
391+
392+ /*
393+ * New inode, set nbytes to 0 so that the nbytes comes out
394+ * properly when we replay the extents.
395+ */
396+ item = btrfs_item_ptr(eb, slot, struct btrfs_inode_item);
397+ btrfs_set_inode_nbytes(eb, item, 0);
370398 }
371399 insert:
372400 btrfs_release_path(path);
@@ -486,7 +514,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, · 113 unmodified lines
486514 int found_type;
487515 u64 extent_end;
488516 u64 start = key->offset;
489− u64 saved_nbytes;
517+ u64 nbytes = 0;
490518 struct btrfs_file_extent_item *item;
491519 struct inode *inode = NULL;
492520 unsigned long size;
@@ -496,10 +524,19 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, · 3 unmodified lines
496524 found_type = btrfs_file_extent_type(eb, item);
497525
498526 if (found_type == BTRFS_FILE_EXTENT_REG ||
499− found_type == BTRFS_FILE_EXTENT_PREALLOC)
500− extent_end = start + btrfs_file_extent_num_bytes(eb, item);
501− else if (found_type == BTRFS_FILE_EXTENT_INLINE) {
527+ found_type == BTRFS_FILE_EXTENT_PREALLOC) {
528+ nbytes = btrfs_file_extent_num_bytes(eb, item);
529+ extent_end = start + nbytes;
530+
531+ /*
532+ * We don't add to the inodes nbytes if we are prealloc or a
533+ * hole.
534+ */
535+ if (btrfs_file_extent_disk_bytenr(eb, item) == 0)
536+ nbytes = 0;
537+ } else if (found_type == BTRFS_FILE_EXTENT_INLINE) {
502538 size = btrfs_file_extent_inline_len(eb, item);
539+ nbytes = btrfs_file_extent_ram_bytes(eb, item);
503540 extent_end = ALIGN(start + size, root->sectorsize);
504541 } else {
505542 ret = 0;
@@ -548,7 +585,6 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, · 42 unmodified lines
548585 }
549586 btrfs_release_path(path);
550587
551− saved_nbytes = inode_get_bytes(inode);
552588 /* drop any overlapping extents */
553589 ret = btrfs_drop_extents(trans, root, inode, start, extent_end, 1);
554590 BUG_ON(ret);
@@ -635,7 +671,7 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, · 80 unmodified lines
635671 BUG_ON(ret);
636672 }
637673
638− inode_set_bytes(inode, saved_nbytes);
674+ inode_add_bytes(inode, nbytes);
639675 ret = btrfs_update_inode(trans, root, inode);
640676 out:
641677 if (inode)
fs/cifs/connect.c+13−3
@@ -1575,14 +1575,24 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, · 1574 unmodified lines
15751575 }
15761576 break;
15771577 case Opt_blank_pass:
1578− vol->password = NULL;
1579− break;
1580− case Opt_pass:
15811578 /* passwords have to be handled differently
15821579 * to allow the character used for deliminator
15831580 * to be passed within them
15841581 */
15851582
1583+ /*
1584+ * Check if this is a case where the password
1585+ * starts with a delimiter
1586+ */
1587+ tmp_end = strchr(data, '=');
1588+ tmp_end++;
1589+ if (!(tmp_end < end && tmp_end[1] == delim)) {
1590+ /* No it is not. Set the password to NULL */
1591+ vol->password = NULL;
1592+ break;
1593+ }
1594+ /* Yes it is. Drop down to Opt_pass below.*/
1595+ case Opt_pass:
15861596 /* Obtain the value string */
15871597 value = strchr(data, '=');
15881598 value++;
fs/ecryptfs/miscdev.c+2−12
@@ -80,13 +80,6 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file) · 79 unmodified lines
8080 int rc;
8181
8282 mutex_lock(&ecryptfs_daemon_hash_mux);
83− rc = try_module_get(THIS_MODULE);
84− if (rc == 0) {
85− rc = -EIO;
86− printk(KERN_ERR "%s: Error attempting to increment module use "
87− "count; rc = [%d]\n", __func__, rc);
88− goto out_unlock_daemon_list;
89− }
9083 rc = ecryptfs_find_daemon_by_euid(&daemon);
9184 if (!rc) {
9285 rc = -EINVAL;
@@ -96,7 +89,7 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file) · 3 unmodified lines
9689 if (rc) {
9790 printk(KERN_ERR "%s: Error attempting to spawn daemon; "
9891 "rc = [%d]\n", __func__, rc);
99− goto out_module_put_unlock_daemon_list;
92+ goto out_unlock_daemon_list;
10093 }
10194 mutex_lock(&daemon->mux);
10295 if (daemon->flags & ECRYPTFS_DAEMON_MISCDEV_OPEN) {
@@ -108,9 +101,6 @@ ecryptfs_miscdev_open(struct inode *inode, struct file *file) · 5 unmodified lines
108101 atomic_inc(&ecryptfs_num_miscdev_opens);
109102 out_unlock_daemon:
110103 mutex_unlock(&daemon->mux);
111−out_module_put_unlock_daemon_list:
112− if (rc)
113− module_put(THIS_MODULE);
114104 out_unlock_daemon_list:
115105 mutex_unlock(&ecryptfs_daemon_hash_mux);
116106 return rc;
@@ -147,7 +137,6 @@ ecryptfs_miscdev_release(struct inode *inode, struct file *file) · 30 unmodified lines
147137 "bug.\n", __func__, rc);
148138 BUG();
149139 }
150− module_put(THIS_MODULE);
151140 return rc;
152141 }
153142
@@ -471,6 +460,7 @@ out_free: · 317 unmodified lines
471460
472461
473462 static const struct file_operations ecryptfs_miscdev_fops = {
463+ .owner = THIS_MODULE,
474464 .open = ecryptfs_miscdev_open,
475465 .poll = ecryptfs_miscdev_poll,
476466 .read = ecryptfs_miscdev_read,
fs/hfsplus/extents.c+1−1
@@ -533,7 +533,7 @@ void hfsplus_file_truncate(struct inode *inode) · 532 unmodified lines
533533 struct address_space *mapping = inode->i_mapping;
534534 struct page *page;
535535 void *fsdata;
536− u32 size = inode->i_size;
536+ loff_t size = inode->i_size;
537537
538538 res = pagecache_write_begin(NULL, mapping, size, 0,
539539 AOP_FLAG_UNINTERRUPTIBLE,
fs/hugetlbfs/inode.c+1−1
@@ -110,7 +110,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) · 109 unmodified lines
110110 * way when do_mmap_pgoff unwinds (may be important on powerpc
111111 * and ia64).
112112 */
113− vma->vm_flags |= VM_HUGETLB | VM_DONTEXPAND | VM_DONTDUMP;
113+ vma->vm_flags |= VM_HUGETLB | VM_DONTEXPAND;
114114 vma->vm_ops = &hugetlb_vm_ops;
115115
116116 if (vma->vm_pgoff & (~huge_page_mask(h) >> PAGE_SHIFT))
fs/inode.c+1−1
@@ -725,7 +725,7 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan) · 724 unmodified lines
725725 * inode to the back of the list so we don't spin on it.
726726 */
727727 if (!spin_trylock(&inode->i_lock)) {
728− list_move_tail(&inode->i_lru, &sb->s_inode_lru);
728+ list_move(&inode->i_lru, &sb->s_inode_lru);
729729 continue;
730730 }
731731
fs/namespace.c+1−1
@@ -1690,7 +1690,7 @@ static int do_loopback(struct path *path, const char *old_name, · 1689 unmodified lines
16901690
16911691 if (IS_ERR(mnt)) {
16921692 err = PTR_ERR(mnt);
1693− goto out;
1693+ goto out2;
16941694 }
16951695
16961696 err = graft_tree(mnt, path);
fs/nfs/nfs4client.c+29−16
@@ -300,7 +300,7 @@ int nfs40_walk_client_list(struct nfs_client *new, · 299 unmodified lines
300300 struct rpc_cred *cred)
301301 {
302302 struct nfs_net *nn = net_generic(new->cl_net, nfs_net_id);
303− struct nfs_client *pos, *n, *prev = NULL;
303+ struct nfs_client *pos, *prev = NULL;
304304 struct nfs4_setclientid_res clid = {
305305 .clientid = new->cl_clientid,
306306 .confirm = new->cl_confirm,
@@ -308,10 +308,23 @@ int nfs40_walk_client_list(struct nfs_client *new, · 1 unmodified line
308308 int status = -NFS4ERR_STALE_CLIENTID;
309309
310310 spin_lock(&nn->nfs_client_lock);
311− list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) {
311+ list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
312312 /* If "pos" isn't marked ready, we can't trust the
313313 * remaining fields in "pos" */
314− if (pos->cl_cons_state < NFS_CS_READY)
314+ if (pos->cl_cons_state > NFS_CS_READY) {
315+ atomic_inc(&pos->cl_count);
316+ spin_unlock(&nn->nfs_client_lock);
317+
318+ if (prev)
319+ nfs_put_client(prev);
320+ prev = pos;
321+
322+ status = nfs_wait_client_init_complete(pos);
323+ spin_lock(&nn->nfs_client_lock);
324+ if (status < 0)
325+ continue;
326+ }
327+ if (pos->cl_cons_state != NFS_CS_READY)
315328 continue;
316329
317330 if (pos->rpc_ops != new->rpc_ops)
@@ -423,16 +436,16 @@ int nfs41_walk_client_list(struct nfs_client *new, · 105 unmodified lines
423436 struct rpc_cred *cred)
424437 {
425438 struct nfs_net *nn = net_generic(new->cl_net, nfs_net_id);
426− struct nfs_client *pos, *n, *prev = NULL;
439+ struct nfs_client *pos, *prev = NULL;
427440 int status = -NFS4ERR_STALE_CLIENTID;
428441
429442 spin_lock(&nn->nfs_client_lock);
430− list_for_each_entry_safe(pos, n, &nn->nfs_client_list, cl_share_link) {
443+ list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
431444 /* If "pos" isn't marked ready, we can't trust the
432445 * remaining fields in "pos", especially the client
433446 * ID and serverowner fields. Wait for CREATE_SESSION
434447 * to finish. */
435− if (pos->cl_cons_state < NFS_CS_READY) {
448+ if (pos->cl_cons_state > NFS_CS_READY) {
436449 atomic_inc(&pos->cl_count);
437450 spin_unlock(&nn->nfs_client_lock);
438451
@@ -440,18 +453,17 @@ int nfs41_walk_client_list(struct nfs_client *new, · 1 unmodified line
440453 nfs_put_client(prev);
441454 prev = pos;
442455
443− nfs4_schedule_lease_recovery(pos);
444456 status = nfs_wait_client_init_complete(pos);
445− if (status < 0) {
446− nfs_put_client(pos);
447− spin_lock(&nn->nfs_client_lock);
448− continue;
457+ if (status == 0) {
458+ nfs4_schedule_lease_recovery(pos);
459+ status = nfs4_wait_clnt_recover(pos);
449460 }
450− status = pos->cl_cons_state;
451461 spin_lock(&nn->nfs_client_lock);
452462 if (status < 0)
453463 continue;
454464 }
465+ if (pos->cl_cons_state != NFS_CS_READY)
466+ continue;
455467
456468 if (pos->rpc_ops != new->rpc_ops)
457469 continue;
@@ -469,17 +481,18 @@ int nfs41_walk_client_list(struct nfs_client *new, · 11 unmodified lines
469481 continue;
470482
471483 atomic_inc(&pos->cl_count);
472− spin_unlock(&nn->nfs_client_lock);
484+ *result = pos;
485+ status = 0;
473486 dprintk("NFS: <-- %s using nfs_client = %p ({%d})\n",
474487 __func__, pos, atomic_read(&pos->cl_count));
475−
476− *result = pos;
477− return 0;
488+ break;
478489 }
479490
480491 /* No matching nfs_client found. */
481492 spin_unlock(&nn->nfs_client_lock);
482493 dprintk("NFS: <-- %s status = %d\n", __func__, status);
494+ if (prev)
495+ nfs_put_client(prev);
483496 return status;
484497 }
485498 #endif /* CONFIG_NFS_V4_1 */
fs/nfs/nfs4proc.c+1−0
@@ -1046,6 +1046,7 @@ static struct nfs4_state *nfs4_try_open_cached(struct nfs4_opendata *opendata) · 1045 unmodified lines
10461046 /* Save the delegation */
10471047 nfs4_stateid_copy(&stateid, &delegation->stateid);
10481048 rcu_read_unlock();
1049+ nfs_release_seqid(opendata->o_arg.seqid);
10491050 ret = nfs_may_open(state->inode, state->owner->so_cred, open_mode);
10501051 if (ret != 0)
10511052 goto out;
fs/nfs/nfs4state.c+7−1
@@ -1886,7 +1886,13 @@ again: · 1885 unmodified lines
18861886 status = PTR_ERR(clnt);
18871887 break;
18881888 }
1889− clp->cl_rpcclient = clnt;
1889+ /* Note: this is safe because we haven't yet marked the
1890+ * client as ready, so we are the only user of
1891+ * clp->cl_rpcclient
1892+ */
1893+ clnt = xchg(&clp->cl_rpcclient, clnt);
1894+ rpc_shutdown_client(clnt);
1895+ clnt = clp->cl_rpcclient;
18901896 goto again;
18911897
18921898 case -NFS4ERR_MINOR_VERS_MISMATCH:
fs/proc/array.c+1−0
@@ -143,6 +143,7 @@ static const char * const task_state_array[] = { · 142 unmodified lines
143143 "x (dead)", /* 64 */
144144 "K (wakekill)", /* 128 */
145145 "W (waking)", /* 256 */
146+ "P (parked)", /* 512 */
146147 };
147148
148149 static inline const char *get_task_state(struct task_struct *tsk)
fs/proc/generic.c+89−30
@@ -755,37 +755,8 @@ void pde_put(struct proc_dir_entry *pde) · 754 unmodified lines
755755 free_proc_entry(pde);
756756 }
757757
758−/*
759− * Remove a /proc entry and free it if it's not currently in use.
760− */
761−void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
758+static void entry_rundown(struct proc_dir_entry *de)
762759 {
763− struct proc_dir_entry **p;
764− struct proc_dir_entry *de = NULL;
765− const char *fn = name;
766− unsigned int len;
767−
768− spin_lock(&proc_subdir_lock);
769− if (__xlate_proc_name(name, &parent, &fn) != 0) {
770− spin_unlock(&proc_subdir_lock);
771− return;
772− }
773− len = strlen(fn);
774−
775− for (p = &parent->subdir; *p; p=&(*p)->next ) {
776− if (proc_match(len, fn, *p)) {
777− de = *p;
778− *p = de->next;
779− de->next = NULL;
780− break;
781− }
782− }
783− spin_unlock(&proc_subdir_lock);
784− if (!de) {
785− WARN(1, "name '%s'\n", name);
786− return;
787− }
788−
789760 spin_lock(&de->pde_unload_lock);
790761 /*
791762 * Stop accepting new callers into module. If you're
@@ -817,6 +788,40 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) · 25 unmodified lines
817788 spin_lock(&de->pde_unload_lock);
818789 }
819790 spin_unlock(&de->pde_unload_lock);
791+}
792+
793+/*
794+ * Remove a /proc entry and free it if it's not currently in use.
795+ */
796+void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
797+{
798+ struct proc_dir_entry **p;
799+ struct proc_dir_entry *de = NULL;
800+ const char *fn = name;
801+ unsigned int len;
802+
803+ spin_lock(&proc_subdir_lock);
804+ if (__xlate_proc_name(name, &parent, &fn) != 0) {
805+ spin_unlock(&proc_subdir_lock);
806+ return;
807+ }
808+ len = strlen(fn);
809+
810+ for (p = &parent->subdir; *p; p=&(*p)->next ) {
811+ if (proc_match(len, fn, *p)) {
812+ de = *p;
813+ *p = de->next;
814+ de->next = NULL;
815+ break;
816+ }
817+ }
818+ spin_unlock(&proc_subdir_lock);
819+ if (!de) {
820+ WARN(1, "name '%s'\n", name);
821+ return;
822+ }
823+
824+ entry_rundown(de);
820825
821826 if (S_ISDIR(de->mode))
822827 parent->nlink--;
@@ -827,3 +832,57 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) · 4 unmodified lines
827832 pde_put(de);
828833 }
829834 EXPORT_SYMBOL(remove_proc_entry);
835+
836+int remove_proc_subtree(const char *name, struct proc_dir_entry *parent)
837+{
838+ struct proc_dir_entry **p;
839+ struct proc_dir_entry *root = NULL, *de, *next;
840+ const char *fn = name;
841+ unsigned int len;
842+
843+ spin_lock(&proc_subdir_lock);
844+ if (__xlate_proc_name(name, &parent, &fn) != 0) {
845+ spin_unlock(&proc_subdir_lock);
846+ return -ENOENT;
847+ }
848+ len = strlen(fn);
849+
850+ for (p = &parent->subdir; *p; p=&(*p)->next ) {
851+ if (proc_match(len, fn, *p)) {
852+ root = *p;
853+ *p = root->next;
854+ root->next = NULL;
855+ break;
856+ }
857+ }
858+ if (!root) {
859+ spin_unlock(&proc_subdir_lock);
860+ return -ENOENT;
861+ }
862+ de = root;
863+ while (1) {
864+ next = de->subdir;
865+ if (next) {
866+ de->subdir = next->next;
867+ next->next = NULL;
868+ de = next;
869+ continue;
870+ }
871+ spin_unlock(&proc_subdir_lock);
872+
873+ entry_rundown(de);
874+ next = de->parent;
875+ if (S_ISDIR(de->mode))
876+ next->nlink--;
877+ de->nlink = 0;
878+ if (de == root)
879+ break;
880+ pde_put(de);
881+
882+ spin_lock(&proc_subdir_lock);
883+ de = next;
884+ }
885+ pde_put(root);
886+ return 0;
887+}
888+EXPORT_SYMBOL(remove_proc_subtree);
include/asm-generic/tlb.h+6−1
@@ -99,7 +99,12 @@ struct mmu_gather { · 98 unmodified lines
9999 unsigned int need_flush : 1, /* Did free PTEs */
100100 fast_mode : 1; /* No batching */
101101
102− unsigned int fullmm;
102+ /* we are in the middle of an operation to clear
103+ * a full mm and can make some optimizations */
104+ unsigned int fullmm : 1,
105+ /* we have performed an operation which
106+ * requires a complete flush of the tlb */
107+ need_flush_all : 1;
103108
104109 struct mmu_gather_batch *active;
105110 struct mmu_gather_batch local;
include/linux/ata.h+1−1
@@ -954,7 +954,7 @@ static inline int atapi_cdb_len(const u16 *dev_id) · 953 unmodified lines
954954 }
955955 }
956956
957−static inline bool atapi_command_packet_set(const u16 *dev_id)
957+static inline int atapi_command_packet_set(const u16 *dev_id)
958958 {
959959 return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f;
960960 }
include/linux/blktrace_api.h+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212
1313 struct blk_trace {
1414 int trace_state;
15− bool rq_based;
1615 struct rchan *rchan;
1716 unsigned long __percpu *sequence;
1817 unsigned char __percpu *msg_data;
include/linux/capability.h+2−0
@@ -35,6 +35,7 @@ struct cpu_vfs_cap_data { · 34 unmodified lines
3535 #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t))
3636
3737
38+struct file;
3839 struct inode;
3940 struct dentry;
4041 struct user_namespace;
@@ -211,6 +212,7 @@ extern bool capable(int cap); · 170 unmodified lines
211212 extern bool ns_capable(struct user_namespace *ns, int cap);
212213 extern bool nsown_capable(int cap);
213214 extern bool inode_capable(const struct inode *inode, int cap);
215+extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
214216
215217 /* audit system wants to get cap info from files as well */
216218 extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
include/linux/efi.h+8−1
@@ -333,6 +333,7 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, · 332 unmodified lines
333333 unsigned long count,
334334 u64 *max_size,
335335 int *reset_type);
336+typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size);
336337
337338 /*
338339 * EFI Configuration Table and GUID definitions
@@ -575,9 +576,15 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos · 236 unmodified lines
575576 #ifdef CONFIG_X86
576577 extern void efi_late_init(void);
577578 extern void efi_free_boot_services(void);
579+extern efi_status_t efi_query_variable_store(u32 attributes, unsigned long size);
578580 #else
579581 static inline void efi_late_init(void) {}
580582 static inline void efi_free_boot_services(void) {}
583+
584+static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned long size)
585+{
586+ return EFI_SUCCESS;
587+}
581588 #endif
582589 extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr);
583590 extern u64 efi_get_iobase (void);
@@ -731,7 +738,7 @@ struct efivar_operations { · 147 unmodified lines
731738 efi_get_variable_t *get_variable;
732739 efi_get_next_variable_t *get_next_variable;
733740 efi_set_variable_t *set_variable;
734− efi_query_variable_info_t *query_variable_info;
741+ efi_query_variable_store_t *query_variable_store;
735742 };
736743
737744 struct efivars {
include/linux/ftrace.h+4−1
@@ -89,6 +89,7 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip, · 88 unmodified lines
8989 * that the call back has its own recursion protection. If it does
9090 * not set this, then the ftrace infrastructure will add recursion
9191 * protection for the caller.
92+ * STUB - The ftrace_ops is just a place holder.
9293 */
9394 enum {
9495 FTRACE_OPS_FL_ENABLED = 1 << 0,
@@ -98,6 +99,7 @@ enum { · 3 unmodified lines
9899 FTRACE_OPS_FL_SAVE_REGS = 1 << 4,
99100 FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5,
100101 FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6,
102+ FTRACE_OPS_FL_STUB = 1 << 7,
101103 };
102104
103105 struct ftrace_ops {
@@ -394,7 +396,6 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, · 290 unmodified lines
394396 size_t cnt, loff_t *ppos);
395397 ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
396398 size_t cnt, loff_t *ppos);
397−loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence);
398399 int ftrace_regex_release(struct inode *inode, struct file *file);
399400
400401 void __init
@@ -567,6 +568,8 @@ static inline int · 166 unmodified lines
567568 ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }
568569 #endif /* CONFIG_DYNAMIC_FTRACE */
569570
571+loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence);
572+
570573 /* totally disable ftrace - can not re-enable after this */
571574 void ftrace_kill(void);
572575
include/linux/kexec.h+2−0
@@ -200,6 +200,8 @@ extern size_t vmcoreinfo_max_size; · 199 unmodified lines
200200
201201 int __init parse_crashkernel(char *cmdline, unsigned long long system_ram,
202202 unsigned long long *crash_size, unsigned long long *crash_base);
203+int parse_crashkernel_high(char *cmdline, unsigned long long system_ram,
204+ unsigned long long *crash_size, unsigned long long *crash_base);
203205 int parse_crashkernel_low(char *cmdline, unsigned long long system_ram,
204206 unsigned long long *crash_size, unsigned long long *crash_base);
205207 int crash_shrink_memory(unsigned long new_size);
include/linux/kvm_host.h+1−1
@@ -518,7 +518,7 @@ int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, · 517 unmodified lines
518518 int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
519519 void *data, unsigned long len);
520520 int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
521− gpa_t gpa);
521+ gpa_t gpa, unsigned long len);
522522 int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len);
523523 int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len);
524524 struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
include/linux/kvm_types.h+1−0
@@ -71,6 +71,7 @@ struct gfn_to_hva_cache { · 70 unmodified lines
7171 u64 generation;
7272 gpa_t gpa;
7373 unsigned long hva;
74+ unsigned long len;
7475 struct kvm_memory_slot *memslot;
7576 };
7677
include/linux/libata.h+1−0
@@ -398,6 +398,7 @@ enum { · 397 unmodified lines
398398 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */
399399 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */
400400 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */
401+ ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */
401402
402403 /* DMA mask for user DMA control: User visible values; DO NOT
403404 renumber */
include/linux/mm.h+2−0
@@ -1611,6 +1611,8 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, · 1610 unmodified lines
16111611 unsigned long pfn);
16121612 int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
16131613 unsigned long pfn);
1614+int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len);
1615+
16141616
16151617 struct page *follow_page_mask(struct vm_area_struct *vma,
16161618 unsigned long address, unsigned int foll_flags,
include/linux/netfilter/ipset/ip_set_ahash.h+23−7
@@ -291,6 +291,7 @@ ip_set_hash_destroy(struct ip_set *set) · 290 unmodified lines
291291 #define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist)
292292 #define type_pf_data_next TOKEN(TYPE, PF, _data_next)
293293 #define type_pf_data_flags TOKEN(TYPE, PF, _data_flags)
294+#define type_pf_data_reset_flags TOKEN(TYPE, PF, _data_reset_flags)
294295 #ifdef IP_SET_HASH_WITH_NETS
295296 #define type_pf_data_match TOKEN(TYPE, PF, _data_match)
296297 #else
@@ -385,9 +386,9 @@ type_pf_resize(struct ip_set *set, bool retried) · 88 unmodified lines
385386 struct ip_set_hash *h = set->data;
386387 struct htable *t, *orig = h->table;
387388 u8 htable_bits = orig->htable_bits;
388− const struct type_pf_elem *data;
389+ struct type_pf_elem *data;
389390 struct hbucket *n, *m;
390− u32 i, j;
391+ u32 i, j, flags = 0;
391392 int ret;
392393
393394 retry:
@@ -412,9 +413,16 @@ retry: · 18 unmodified lines
412413 n = hbucket(orig, i);
413414 for (j = 0; j < n->pos; j++) {
414415 data = ahash_data(n, j);
416+#ifdef IP_SET_HASH_WITH_NETS
417+ flags = 0;
418+ type_pf_data_reset_flags(data, &flags);
419+#endif
415420 m = hbucket(t, HKEY(data, h->initval, htable_bits));
416− ret = type_pf_elem_add(m, data, AHASH_MAX(h), 0);
421+ ret = type_pf_elem_add(m, data, AHASH_MAX(h), flags);
417422 if (ret < 0) {
423+#ifdef IP_SET_HASH_WITH_NETS
424+ type_pf_data_flags(data, flags);
425+#endif
418426 read_unlock_bh(&set->lock);
419427 ahash_destroy(t);
420428 if (ret == -EAGAIN)
@@ -836,9 +844,9 @@ type_pf_tresize(struct ip_set *set, bool retried) · 415 unmodified lines
836844 struct ip_set_hash *h = set->data;
837845 struct htable *t, *orig = h->table;
838846 u8 htable_bits = orig->htable_bits;
839− const struct type_pf_elem *data;
847+ struct type_pf_elem *data;
840848 struct hbucket *n, *m;
841− u32 i, j;
849+ u32 i, j, flags = 0;
842850 int ret;
843851
844852 /* Try to cleanup once */
@@ -873,10 +881,17 @@ retry: · 28 unmodified lines
873881 n = hbucket(orig, i);
874882 for (j = 0; j < n->pos; j++) {
875883 data = ahash_tdata(n, j);
884+#ifdef IP_SET_HASH_WITH_NETS
885+ flags = 0;
886+ type_pf_data_reset_flags(data, &flags);
887+#endif
876888 m = hbucket(t, HKEY(data, h->initval, htable_bits));
877− ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0,
878− ip_set_timeout_get(type_pf_data_timeout(data)));
889+ ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), flags,
890+ ip_set_timeout_get(type_pf_data_timeout(data)));
879891 if (ret < 0) {
892+#ifdef IP_SET_HASH_WITH_NETS
893+ type_pf_data_flags(data, flags);
894+#endif
880895 read_unlock_bh(&set->lock);
881896 ahash_destroy(t);
882897 if (ret == -EAGAIN)
@@ -1187,6 +1202,7 @@ type_pf_gc_init(struct ip_set *set) · 304 unmodified lines
11871202 #undef type_pf_data_tlist
11881203 #undef type_pf_data_next
11891204 #undef type_pf_data_flags
1205+#undef type_pf_data_reset_flags
11901206 #undef type_pf_data_match
11911207
11921208 #undef type_pf_elem
include/linux/pci.h+1−0
@@ -916,6 +916,7 @@ void pci_disable_rom(struct pci_dev *pdev); · 915 unmodified lines
916916 void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
917917 void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);
918918 size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size);
919+void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size);
919920
920921 /* Power management related routines */
921922 int pci_save_state(struct pci_dev *dev);
include/linux/preempt.h+14−8
@@ -93,14 +93,20 @@ do { \ · 92 unmodified lines
9393
9494 #else /* !CONFIG_PREEMPT_COUNT */
9595
96−#define preempt_disable() do { } while (0)
97−#define sched_preempt_enable_no_resched() do { } while (0)
98−#define preempt_enable_no_resched() do { } while (0)
99−#define preempt_enable() do { } while (0)
100−
101−#define preempt_disable_notrace() do { } while (0)
102−#define preempt_enable_no_resched_notrace() do { } while (0)
103−#define preempt_enable_notrace() do { } while (0)
96+/*
97+ * Even if we don't have any preemption, we need preempt disable/enable
98+ * to be barriers, so that we don't have things like get_user/put_user
99+ * that can cause faults and scheduling migrate into our preempt-protected
100+ * region.
101+ */
102+#define preempt_disable() barrier()
103+#define sched_preempt_enable_no_resched() barrier()
104+#define preempt_enable_no_resched() barrier()
105+#define preempt_enable() barrier()
106+
107+#define preempt_disable_notrace() barrier()
108+#define preempt_enable_no_resched_notrace() barrier()
109+#define preempt_enable_notrace() barrier()
104110
105111 #endif /* CONFIG_PREEMPT_COUNT */
106112
include/linux/proc_fs.h+2−0
@@ -117,6 +117,7 @@ struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, · 116 unmodified lines
117117 const struct file_operations *proc_fops,
118118 void *data);
119119 extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
120+extern int remove_proc_subtree(const char *name, struct proc_dir_entry *parent);
120121
121122 struct pid_namespace;
122123
@@ -202,6 +203,7 @@ static inline struct proc_dir_entry *proc_create_data(const char *name, · 79 unmodified lines
202203 return NULL;
203204 }
204205 #define remove_proc_entry(name, parent) do {} while (0)
206+#define remove_proc_subtree(name, parent) do {} while (0)
205207
206208 static inline struct proc_dir_entry *proc_symlink(const char *name,
207209 struct proc_dir_entry *parent,const char *dest) {return NULL;}
include/linux/sched.h+3−2
@@ -163,9 +163,10 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) · 162 unmodified lines
163163 #define TASK_DEAD 64
164164 #define TASK_WAKEKILL 128
165165 #define TASK_WAKING 256
166−#define TASK_STATE_MAX 512
166+#define TASK_PARKED 512
167+#define TASK_STATE_MAX 1024
167168
168−#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW"
169+#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKWP"
169170
170171 extern char ___assert_task_state[1 - 2*!!(
171172 sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)];
include/linux/security.h+12−0
@@ -1012,6 +1012,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) · 1011 unmodified lines
10121012 * This hook can be used by the module to update any security state
10131013 * associated with the TUN device's security structure.
10141014 * @security pointer to the TUN devices's security structure.
1015+ * @skb_owned_by:
1016+ * This hook sets the packet's owning sock.
1017+ * @skb is the packet.
1018+ * @sk the sock which owns the packet.
10151019 *
10161020 * Security hooks for XFRM operations.
10171021 *
@@ -1638,6 +1642,7 @@ struct security_operations { · 620 unmodified lines
16381642 int (*tun_dev_attach_queue) (void *security);
16391643 int (*tun_dev_attach) (struct sock *sk, void *security);
16401644 int (*tun_dev_open) (void *security);
1645+ void (*skb_owned_by) (struct sk_buff *skb, struct sock *sk);
16411646 #endif /* CONFIG_SECURITY_NETWORK */
16421647
16431648 #ifdef CONFIG_SECURITY_NETWORK_XFRM
@@ -2588,6 +2593,8 @@ int security_tun_dev_attach_queue(void *security); · 944 unmodified lines
25882593 int security_tun_dev_attach(struct sock *sk, void *security);
25892594 int security_tun_dev_open(void *security);
25902595
2596+void security_skb_owned_by(struct sk_buff *skb, struct sock *sk);
2597+
25912598 #else /* CONFIG_SECURITY_NETWORK */
25922599 static inline int security_unix_stream_connect(struct sock *sock,
25932600 struct sock *other,
@@ -2779,6 +2786,11 @@ static inline int security_tun_dev_open(void *security) · 185 unmodified lines
27792786 {
27802787 return 0;
27812788 }
2789+
2790+static inline void security_skb_owned_by(struct sk_buff *skb, struct sock *sk)
2791+{
2792+}
2793+
27822794 #endif /* CONFIG_SECURITY_NETWORK */
27832795
27842796 #ifdef CONFIG_SECURITY_NETWORK_XFRM
include/linux/spinlock_up.h+18−11
@@ -16,7 +16,10 @@ · 15 unmodified lines
1616 * In the debug case, 1 means unlocked, 0 means locked. (the values
1717 * are inverted, to catch initialization bugs)
1818 *
19− * No atomicity anywhere, we are on UP.
19+ * No atomicity anywhere, we are on UP. However, we still need
20+ * the compiler barriers, because we do not want the compiler to
21+ * move potentially faulting instructions (notably user accesses)
22+ * into the locked sequence, resulting in non-atomic execution.
2023 */
2124
2225 #ifdef CONFIG_DEBUG_SPINLOCK
@@ -25,6 +28,7 @@ · 2 unmodified lines
2528 static inline void arch_spin_lock(arch_spinlock_t *lock)
2629 {
2730 lock->slock = 0;
31+ barrier();
2832 }
2933
3034 static inline void
@@ -32,6 +36,7 @@ arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags) · 1 unmodified line
3236 {
3337 local_irq_save(flags);
3438 lock->slock = 0;
39+ barrier();
3540 }
3641
3742 static inline int arch_spin_trylock(arch_spinlock_t *lock)
@@ -39,32 +44,34 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) · 1 unmodified line
3944 char oldval = lock->slock;
4045
4146 lock->slock = 0;
47+ barrier();
4248
4349 return oldval > 0;
4450 }
4551
4652 static inline void arch_spin_unlock(arch_spinlock_t *lock)
4753 {
54+ barrier();
4855 lock->slock = 1;
4956 }
5057
5158 /*
5259 * Read-write spinlocks. No debug version.
5360 */
54−#define arch_read_lock(lock) do { (void)(lock); } while (0)
55−#define arch_write_lock(lock) do { (void)(lock); } while (0)
56−#define arch_read_trylock(lock) ({ (void)(lock); 1; })
57−#define arch_write_trylock(lock) ({ (void)(lock); 1; })
58−#define arch_read_unlock(lock) do { (void)(lock); } while (0)
59−#define arch_write_unlock(lock) do { (void)(lock); } while (0)
61+#define arch_read_lock(lock) do { barrier(); (void)(lock); } while (0)
62+#define arch_write_lock(lock) do { barrier(); (void)(lock); } while (0)
63+#define arch_read_trylock(lock) ({ barrier(); (void)(lock); 1; })
64+#define arch_write_trylock(lock) ({ barrier(); (void)(lock); 1; })
65+#define arch_read_unlock(lock) do { barrier(); (void)(lock); } while (0)
66+#define arch_write_unlock(lock) do { barrier(); (void)(lock); } while (0)
6067
6168 #else /* DEBUG_SPINLOCK */
6269 #define arch_spin_is_locked(lock) ((void)(lock), 0)
6370 /* for sched.c and kernel_lock.c: */
64−# define arch_spin_lock(lock) do { (void)(lock); } while (0)
65−# define arch_spin_lock_flags(lock, flags) do { (void)(lock); } while (0)
66−# define arch_spin_unlock(lock) do { (void)(lock); } while (0)
67−# define arch_spin_trylock(lock) ({ (void)(lock); 1; })
71+# define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0)
72+# define arch_spin_lock_flags(lock, flags) do { barrier(); (void)(lock); } while (0)
73+# define arch_spin_unlock(lock) do { barrier(); (void)(lock); } while (0)
74+# define arch_spin_trylock(lock) ({ barrier(); (void)(lock); 1; })
6875 #endif /* DEBUG_SPINLOCK */
6976
7077 #define arch_spin_is_contended(lock) (((void)(lock), 0))
include/linux/ssb/ssb_driver_chipcommon.h+2−0
@@ -219,6 +219,7 @@ · 218 unmodified lines
219219 #define SSB_CHIPCO_PMU_CTL 0x0600 /* PMU control */
220220 #define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */
221221 #define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16
222+#define SSB_CHIPCO_PMU_CTL_PLL_UPD 0x00000400
222223 #define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */
223224 #define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */
224225 #define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080 /* ALP req enable */
@@ -667,5 +668,6 @@ enum ssb_pmu_ldo_volt_id { · 442 unmodified lines
667668 void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc,
668669 enum ssb_pmu_ldo_volt_id id, u32 voltage);
669670 void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on);
671+void ssb_pmu_spuravoid_pllupdate(struct ssb_chipcommon *cc, int spuravoid);
670672
671673 #endif /* LINUX_SSB_CHIPCO_H_ */
include/linux/swiotlb.h+1−0
@@ -25,6 +25,7 @@ extern int swiotlb_force; · 24 unmodified lines
2525 extern void swiotlb_init(int verbose);
2626 int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
2727 extern unsigned long swiotlb_nr_tbl(void);
28+unsigned long swiotlb_size_or_default(void);
2829 extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs);
2930
3031 /*
include/linux/ucs2_string.h+14−0
@@ -0,0 +1,14 @@
1+#ifndef _LINUX_UCS2_STRING_H_
2+#define _LINUX_UCS2_STRING_H_
3+
4+#include <linux/types.h> /* for size_t */
5+#include <linux/stddef.h> /* for NULL */
6+
7+typedef u16 ucs2_char_t;
8+
9+unsigned long ucs2_strnlen(const ucs2_char_t *s, size_t maxlength);
10+unsigned long ucs2_strlen(const ucs2_char_t *s);
11+unsigned long ucs2_strsize(const ucs2_char_t *data, unsigned long maxlength);
12+int ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len);
13+
14+#endif /* _LINUX_UCS2_STRING_H_ */
include/net/addrconf.h+1−0
@@ -199,6 +199,7 @@ extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, · 198 unmodified lines
199199 /* Device notifier */
200200 extern int register_inet6addr_notifier(struct notifier_block *nb);
201201 extern int unregister_inet6addr_notifier(struct notifier_block *nb);
202+extern int inet6addr_notifier_call_chain(unsigned long val, void *v);
202203
203204 extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
204205 struct ipv6_devconf *devconf);
include/net/irda/irlmp.h+2−1
@@ -256,7 +256,8 @@ static inline __u32 irlmp_get_daddr(const struct lsap_cb *self) · 255 unmodified lines
256256 return (self && self->lap) ? self->lap->daddr : 0;
257257 }
258258
259−extern const char *irlmp_reasons[];
259+const char *irlmp_reason_str(LM_REASON reason);
260+
260261 extern int sysctl_discovery_timeout;
261262 extern int sysctl_discovery_slots;
262263 extern int sysctl_discovery;
include/net/iucv/af_iucv.h+8−0
@@ -130,6 +130,14 @@ struct iucv_sock { · 129 unmodified lines
130130 enum iucv_tx_notify n);
131131 };
132132
133+struct iucv_skb_cb {
134+ u32 class; /* target class of message */
135+ u32 tag; /* tag associated with message */
136+ u32 offset; /* offset for skb receival */
137+};
138+
139+#define IUCV_SKB_CB(__skb) ((struct iucv_skb_cb *)&((__skb)->cb[0]))
140+
133141 /* iucv socket options (SOL_IUCV) */
134142 #define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */
135143 #define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */
include/net/scm.h+1−1
@@ -78,7 +78,7 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, · 77 unmodified lines
7878 scm->creds.uid = INVALID_UID;
7979 scm->creds.gid = INVALID_GID;
8080 if (forcecreds)
81− scm_set_cred(scm, task_tgid(current), current_euid(), current_egid());
81+ scm_set_cred(scm, task_tgid(current), current_uid(), current_gid());
8282 unix_get_peersec_dgram(sock, scm);
8383 if (msg->msg_controllen <= 0)
8484 return 0;
include/trace/events/block.h+4−4
@@ -257,6 +257,7 @@ TRACE_EVENT(block_bio_bounce, · 256 unmodified lines
257257
258258 /**
259259 * block_bio_complete - completed all work on the block operation
260+ * @q: queue holding the block operation
260261 * @bio: block operation completed
261262 * @error: io error value
262263 *
@@ -265,9 +266,9 @@ TRACE_EVENT(block_bio_bounce, · 2 unmodified lines
265266 */
266267 TRACE_EVENT(block_bio_complete,
267268
268− TP_PROTO(struct bio *bio, int error),
269+ TP_PROTO(struct request_queue *q, struct bio *bio, int error),
269270
270− TP_ARGS(bio, error),
271+ TP_ARGS(q, bio, error),
271272
272273 TP_STRUCT__entry(
273274 __field( dev_t, dev )
@@ -278,8 +279,7 @@ TRACE_EVENT(block_bio_complete, · 4 unmodified lines
278279 ),
279280
280281 TP_fast_assign(
281− __entry->dev = bio->bi_bdev ?
282− bio->bi_bdev->bd_dev : 0;
282+ __entry->dev = bio->bi_bdev->bd_dev;
283283 __entry->sector = bio->bi_sector;
284284 __entry->nr_sector = bio->bi_size >> 9;
285285 __entry->error = error;
include/trace/events/sched.h+1−1
@@ -147,7 +147,7 @@ TRACE_EVENT(sched_switch, · 146 unmodified lines
147147 __print_flags(__entry->prev_state & (TASK_STATE_MAX-1), "|",
148148 { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" },
149149 { 16, "Z" }, { 32, "X" }, { 64, "x" },
150− { 128, "W" }) : "R",
150+ { 128, "K" }, { 256, "W" }, { 512, "P" }) : "R",
151151 __entry->prev_state & TASK_STATE_MAX ? "+" : "",
152152 __entry->next_comm, __entry->next_pid, __entry->next_prio)
153153 );
include/uapi/linux/fuse.h+216−220
@@ -95,15 +95,10 @@ · 94 unmodified lines
9595 #ifndef _LINUX_FUSE_H
9696 #define _LINUX_FUSE_H
9797
98−#ifdef __linux__
98+#ifdef __KERNEL__
9999 #include <linux/types.h>
100100 #else
101101 #include <stdint.h>
102−#define __u64 uint64_t
103−#define __s64 int64_t
104−#define __u32 uint32_t
105−#define __s32 int32_t
106−#define __u16 uint16_t
107102 #endif
108103
109104 /*
@@ -139,42 +134,42 @@ · 29 unmodified lines
139134 userspace works under 64bit kernels */
140135
141136 struct fuse_attr {
142− __u64 ino;
143− __u64 size;
144− __u64 blocks;
145− __u64 atime;
146− __u64 mtime;
147− __u64 ctime;
148− __u32 atimensec;
149− __u32 mtimensec;
150− __u32 ctimensec;
151− __u32 mode;
152− __u32 nlink;
153− __u32 uid;
154− __u32 gid;
155− __u32 rdev;
156− __u32 blksize;
157− __u32 padding;
137+ uint64_t ino;
138+ uint64_t size;
139+ uint64_t blocks;
140+ uint64_t atime;
141+ uint64_t mtime;
142+ uint64_t ctime;
143+ uint32_t atimensec;
144+ uint32_t mtimensec;
145+ uint32_t ctimensec;
146+ uint32_t mode;
147+ uint32_t nlink;
148+ uint32_t uid;
149+ uint32_t gid;
150+ uint32_t rdev;
151+ uint32_t blksize;
152+ uint32_t padding;
158153 };
159154
160155 struct fuse_kstatfs {
161− __u64 blocks;
162− __u64 bfree;
163− __u64 bavail;
164− __u64 files;
165− __u64 ffree;
166− __u32 bsize;
167− __u32 namelen;
168− __u32 frsize;
169− __u32 padding;
170− __u32 spare[6];
156+ uint64_t blocks;
157+ uint64_t bfree;
158+ uint64_t bavail;
159+ uint64_t files;
160+ uint64_t ffree;
161+ uint32_t bsize;
162+ uint32_t namelen;
163+ uint32_t frsize;
164+ uint32_t padding;
165+ uint32_t spare[6];
171166 };
172167
173168 struct fuse_file_lock {
174− __u64 start;
175− __u64 end;
176− __u32 type;
177− __u32 pid; /* tgid */
169+ uint64_t start;
170+ uint64_t end;
171+ uint32_t type;
172+ uint32_t pid; /* tgid */
178173 };
179174
180175 /**
@@ -364,143 +359,143 @@ enum fuse_notify_code { · 183 unmodified lines
364359 #define FUSE_COMPAT_ENTRY_OUT_SIZE 120
365360
366361 struct fuse_entry_out {
367− __u64 nodeid; /* Inode ID */
368− __u64 generation; /* Inode generation: nodeid:gen must
369− be unique for the fs's lifetime */
370− __u64 entry_valid; /* Cache timeout for the name */
371− __u64 attr_valid; /* Cache timeout for the attributes */
372− __u32 entry_valid_nsec;
373− __u32 attr_valid_nsec;
362+ uint64_t nodeid; /* Inode ID */
363+ uint64_t generation; /* Inode generation: nodeid:gen must
364+ be unique for the fs's lifetime */
365+ uint64_t entry_valid; /* Cache timeout for the name */
366+ uint64_t attr_valid; /* Cache timeout for the attributes */
367+ uint32_t entry_valid_nsec;
368+ uint32_t attr_valid_nsec;
374369 struct fuse_attr attr;
375370 };
376371
377372 struct fuse_forget_in {
378− __u64 nlookup;
373+ uint64_t nlookup;
379374 };
380375
381376 struct fuse_forget_one {
382− __u64 nodeid;
383− __u64 nlookup;
377+ uint64_t nodeid;
378+ uint64_t nlookup;
384379 };
385380
386381 struct fuse_batch_forget_in {
387− __u32 count;
388− __u32 dummy;
382+ uint32_t count;
383+ uint32_t dummy;
389384 };
390385
391386 struct fuse_getattr_in {
392− __u32 getattr_flags;
393− __u32 dummy;
394− __u64 fh;
387+ uint32_t getattr_flags;
388+ uint32_t dummy;
389+ uint64_t fh;
395390 };
396391
397392 #define FUSE_COMPAT_ATTR_OUT_SIZE 96
398393
399394 struct fuse_attr_out {
400− __u64 attr_valid; /* Cache timeout for the attributes */
401− __u32 attr_valid_nsec;
402− __u32 dummy;
395+ uint64_t attr_valid; /* Cache timeout for the attributes */
396+ uint32_t attr_valid_nsec;
397+ uint32_t dummy;
403398 struct fuse_attr attr;
404399 };
405400
406401 #define FUSE_COMPAT_MKNOD_IN_SIZE 8
407402
408403 struct fuse_mknod_in {
409− __u32 mode;
410− __u32 rdev;
411− __u32 umask;
412− __u32 padding;
404+ uint32_t mode;
405+ uint32_t rdev;
406+ uint32_t umask;
407+ uint32_t padding;
413408 };
414409
415410 struct fuse_mkdir_in {
416− __u32 mode;
417− __u32 umask;
411+ uint32_t mode;
412+ uint32_t umask;
418413 };
419414
420415 struct fuse_rename_in {
421− __u64 newdir;
416+ uint64_t newdir;
422417 };
423418
424419 struct fuse_link_in {
425− __u64 oldnodeid;
420+ uint64_t oldnodeid;
426421 };
427422
428423 struct fuse_setattr_in {
429− __u32 valid;
430− __u32 padding;
431− __u64 fh;
432− __u64 size;
433− __u64 lock_owner;
434− __u64 atime;
435− __u64 mtime;
436− __u64 unused2;
437− __u32 atimensec;
438− __u32 mtimensec;
439− __u32 unused3;
440− __u32 mode;
441− __u32 unused4;
442− __u32 uid;
443− __u32 gid;
444− __u32 unused5;
424+ uint32_t valid;
425+ uint32_t padding;
426+ uint64_t fh;
427+ uint64_t size;
428+ uint64_t lock_owner;
429+ uint64_t atime;
430+ uint64_t mtime;
431+ uint64_t unused2;
432+ uint32_t atimensec;
433+ uint32_t mtimensec;
434+ uint32_t unused3;
435+ uint32_t mode;
436+ uint32_t unused4;
437+ uint32_t uid;
438+ uint32_t gid;
439+ uint32_t unused5;
445440 };
446441
447442 struct fuse_open_in {
448− __u32 flags;
449− __u32 unused;
443+ uint32_t flags;
444+ uint32_t unused;
450445 };
451446
452447 struct fuse_create_in {
453− __u32 flags;
454− __u32 mode;
455− __u32 umask;
456− __u32 padding;
448+ uint32_t flags;
449+ uint32_t mode;
450+ uint32_t umask;
451+ uint32_t padding;
457452 };
458453
459454 struct fuse_open_out {
460− __u64 fh;
461− __u32 open_flags;
462− __u32 padding;
455+ uint64_t fh;
456+ uint32_t open_flags;
457+ uint32_t padding;
463458 };
464459
465460 struct fuse_release_in {
466− __u64 fh;
467− __u32 flags;
468− __u32 release_flags;
469− __u64 lock_owner;
461+ uint64_t fh;
462+ uint32_t flags;
463+ uint32_t release_flags;
464+ uint64_t lock_owner;
470465 };
471466
472467 struct fuse_flush_in {
473− __u64 fh;
474− __u32 unused;
475− __u32 padding;
476− __u64 lock_owner;
468+ uint64_t fh;
469+ uint32_t unused;
470+ uint32_t padding;
471+ uint64_t lock_owner;
477472 };
478473
479474 struct fuse_read_in {
480− __u64 fh;
481− __u64 offset;
482− __u32 size;
483− __u32 read_flags;
484− __u64 lock_owner;
485− __u32 flags;
486− __u32 padding;
475+ uint64_t fh;
476+ uint64_t offset;
477+ uint32_t size;
478+ uint32_t read_flags;
479+ uint64_t lock_owner;
480+ uint32_t flags;
481+ uint32_t padding;
487482 };
488483
489484 #define FUSE_COMPAT_WRITE_IN_SIZE 24
490485
491486 struct fuse_write_in {
492− __u64 fh;
493− __u64 offset;
494− __u32 size;
495− __u32 write_flags;
496− __u64 lock_owner;
497− __u32 flags;
498− __u32 padding;
487+ uint64_t fh;
488+ uint64_t offset;
489+ uint32_t size;
490+ uint32_t write_flags;
491+ uint64_t lock_owner;
492+ uint32_t flags;
493+ uint32_t padding;
499494 };
500495
501496 struct fuse_write_out {
502− __u32 size;
503− __u32 padding;
497+ uint32_t size;
498+ uint32_t padding;
504499 };
505500
506501 #define FUSE_COMPAT_STATFS_SIZE 48
@@ -510,32 +505,32 @@ struct fuse_statfs_out { · 3 unmodified lines
510505 };
511506
512507 struct fuse_fsync_in {
513− __u64 fh;
514− __u32 fsync_flags;
515− __u32 padding;
508+ uint64_t fh;
509+ uint32_t fsync_flags;
510+ uint32_t padding;
516511 };
517512
518513 struct fuse_setxattr_in {
519− __u32 size;
520− __u32 flags;
514+ uint32_t size;
515+ uint32_t flags;
521516 };
522517
523518 struct fuse_getxattr_in {
524− __u32 size;
525− __u32 padding;
519+ uint32_t size;
520+ uint32_t padding;
526521 };
527522
528523 struct fuse_getxattr_out {
529− __u32 size;
530− __u32 padding;
524+ uint32_t size;
525+ uint32_t padding;
531526 };
532527
533528 struct fuse_lk_in {
534− __u64 fh;
535− __u64 owner;
529+ uint64_t fh;
530+ uint64_t owner;
536531 struct fuse_file_lock lk;
537− __u32 lk_flags;
538− __u32 padding;
532+ uint32_t lk_flags;
533+ uint32_t padding;
539534 };
540535
541536 struct fuse_lk_out {
@@ -543,134 +538,135 @@ struct fuse_lk_out { · 1 unmodified line
543538 };
544539
545540 struct fuse_access_in {
546− __u32 mask;
547− __u32 padding;
541+ uint32_t mask;
542+ uint32_t padding;
548543 };
549544
550545 struct fuse_init_in {
551− __u32 major;
552− __u32 minor;
553− __u32 max_readahead;
554− __u32 flags;
546+ uint32_t major;
547+ uint32_t minor;
548+ uint32_t max_readahead;
549+ uint32_t flags;
555550 };
556551
557552 struct fuse_init_out {
558− __u32 major;
559− __u32 minor;
560− __u32 max_readahead;
561− __u32 flags;
562− __u16 max_background;
563− __u16 congestion_threshold;
564− __u32 max_write;
553+ uint32_t major;
554+ uint32_t minor;
555+ uint32_t max_readahead;
556+ uint32_t flags;
557+ uint16_t max_background;
558+ uint16_t congestion_threshold;
559+ uint32_t max_write;
565560 };
566561
567562 #define CUSE_INIT_INFO_MAX 4096
568563
569564 struct cuse_init_in {
570− __u32 major;
571− __u32 minor;
572− __u32 unused;
573− __u32 flags;
565+ uint32_t major;
566+ uint32_t minor;
567+ uint32_t unused;
568+ uint32_t flags;
574569 };
575570
576571 struct cuse_init_out {
577− __u32 major;
578− __u32 minor;
579− __u32 unused;
580− __u32 flags;
581− __u32 max_read;
582− __u32 max_write;
583− __u32 dev_major; /* chardev major */
584− __u32 dev_minor; /* chardev minor */
585− __u32 spare[10];
572+ uint32_t major;
573+ uint32_t minor;
574+ uint32_t unused;
575+ uint32_t flags;
576+ uint32_t max_read;
577+ uint32_t max_write;
578+ uint32_t dev_major; /* chardev major */
579+ uint32_t dev_minor; /* chardev minor */
580+ uint32_t spare[10];
586581 };
587582
588583 struct fuse_interrupt_in {
589− __u64 unique;
584+ uint64_t unique;
590585 };
591586
592587 struct fuse_bmap_in {
593− __u64 block;
594− __u32 blocksize;
595− __u32 padding;
588+ uint64_t block;
589+ uint32_t blocksize;
590+ uint32_t padding;
596591 };
597592
598593 struct fuse_bmap_out {
599− __u64 block;
594+ uint64_t block;
600595 };
601596
602597 struct fuse_ioctl_in {
603− __u64 fh;
604− __u32 flags;
605− __u32 cmd;
606− __u64 arg;
607− __u32 in_size;
608− __u32 out_size;
598+ uint64_t fh;
599+ uint32_t flags;
600+ uint32_t cmd;
601+ uint64_t arg;
602+ uint32_t in_size;
603+ uint32_t out_size;
609604 };
610605
611606 struct fuse_ioctl_iovec {
612− __u64 base;
613− __u64 len;
607+ uint64_t base;
608+ uint64_t len;
614609 };
615610
616611 struct fuse_ioctl_out {
617− __s32 result;
618− __u32 flags;
619− __u32 in_iovs;
620− __u32 out_iovs;
612+ int32_t result;
613+ uint32_t flags;
614+ uint32_t in_iovs;
615+ uint32_t out_iovs;
621616 };
622617
623618 struct fuse_poll_in {
624− __u64 fh;
625− __u64 kh;
626− __u32 flags;
627− __u32 events;
619+ uint64_t fh;
620+ uint64_t kh;
621+ uint32_t flags;
622+ uint32_t events;
628623 };
629624
630625 struct fuse_poll_out {
631− __u32 revents;
632− __u32 padding;
626+ uint32_t revents;
627+ uint32_t padding;
633628 };
634629
635630 struct fuse_notify_poll_wakeup_out {
636− __u64 kh;
631+ uint64_t kh;
637632 };
638633
639634 struct fuse_fallocate_in {
640− __u64 fh;
641− __u64 offset;
642− __u64 length;
643− __u32 mode;
644− __u32 padding;
635+ uint64_t fh;
636+ uint64_t offset;
637+ uint64_t length;
638+ uint32_t mode;
639+ uint32_t padding;
645640 };
646641
647642 struct fuse_in_header {
648− __u32 len;
649− __u32 opcode;
650− __u64 unique;
651− __u64 nodeid;
652− __u32 uid;
653− __u32 gid;
654− __u32 pid;
655− __u32 padding;
643+ uint32_t len;
644+ uint32_t opcode;
645+ uint64_t unique;
646+ uint64_t nodeid;
647+ uint32_t uid;
648+ uint32_t gid;
649+ uint32_t pid;
650+ uint32_t padding;
656651 };
657652
658653 struct fuse_out_header {
659− __u32 len;
660− __s32 error;
661− __u64 unique;
654+ uint32_t len;
655+ int32_t error;
656+ uint64_t unique;
662657 };
663658
664659 struct fuse_dirent {
665− __u64 ino;
666− __u64 off;
667− __u32 namelen;
668− __u32 type;
660+ uint64_t ino;
661+ uint64_t off;
662+ uint32_t namelen;
663+ uint32_t type;
669664 char name[];
670665 };
671666
672667 #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
673−#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
668+#define FUSE_DIRENT_ALIGN(x) \
669+ (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
674670 #define FUSE_DIRENT_SIZE(d) \
675671 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
676672
@@ -685,47 +681,47 @@ struct fuse_direntplus { · 8 unmodified lines
685681 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
686682
687683 struct fuse_notify_inval_inode_out {
688− __u64 ino;
689− __s64 off;
690− __s64 len;
684+ uint64_t ino;
685+ int64_t off;
686+ int64_t len;
691687 };
692688
693689 struct fuse_notify_inval_entry_out {
694− __u64 parent;
695− __u32 namelen;
696− __u32 padding;
690+ uint64_t parent;
691+ uint32_t namelen;
692+ uint32_t padding;
697693 };
698694
699695 struct fuse_notify_delete_out {
700− __u64 parent;
701− __u64 child;
702− __u32 namelen;
703− __u32 padding;
696+ uint64_t parent;
697+ uint64_t child;
698+ uint32_t namelen;
699+ uint32_t padding;
704700 };
705701
706702 struct fuse_notify_store_out {
707− __u64 nodeid;
708− __u64 offset;
709− __u32 size;
710− __u32 padding;
703+ uint64_t nodeid;
704+ uint64_t offset;
705+ uint32_t size;
706+ uint32_t padding;
711707 };
712708
713709 struct fuse_notify_retrieve_out {
714− __u64 notify_unique;
715− __u64 nodeid;
716− __u64 offset;
717− __u32 size;
718− __u32 padding;
710+ uint64_t notify_unique;
711+ uint64_t nodeid;
712+ uint64_t offset;
713+ uint32_t size;
714+ uint32_t padding;
719715 };
720716
721717 /* Matches the size of fuse_write_in */
722718 struct fuse_notify_retrieve_in {
723− __u64 dummy1;
724− __u64 offset;
725− __u32 size;
726− __u32 dummy2;
727− __u64 dummy3;
728− __u64 dummy4;
719+ uint64_t dummy1;
720+ uint64_t offset;
721+ uint32_t size;
722+ uint32_t dummy2;
723+ uint64_t dummy3;
724+ uint64_t dummy4;
729725 };
730726
731727 #endif /* _LINUX_FUSE_H */
kernel/capability.c+24−0
@@ -392,6 +392,30 @@ bool ns_capable(struct user_namespace *ns, int cap) · 391 unmodified lines
392392 }
393393 EXPORT_SYMBOL(ns_capable);
394394
395+/**
396+ * file_ns_capable - Determine if the file's opener had a capability in effect
397+ * @file: The file we want to check
398+ * @ns: The usernamespace we want the capability in
399+ * @cap: The capability to be tested for
400+ *
401+ * Return true if task that opened the file had a capability in effect
402+ * when the file was opened.
403+ *
404+ * This does not set PF_SUPERPRIV because the caller may not
405+ * actually be privileged.
406+ */
407+bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap)
408+{
409+ if (WARN_ON_ONCE(!cap_valid(cap)))
410+ return false;
411+
412+ if (security_capable(file->f_cred, ns, cap) == 0)
413+ return true;
414+
415+ return false;
416+}
417+EXPORT_SYMBOL(file_ns_capable);
418+
395419 /**
396420 * capable - Determine if the current task has a superior capability in effect
397421 * @cap: The capability to be tested for
kernel/events/core.c+4−2
@@ -4737,7 +4737,8 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event) · 4736 unmodified lines
47374737 } else {
47384738 if (arch_vma_name(mmap_event->vma)) {
47394739 name = strncpy(tmp, arch_vma_name(mmap_event->vma),
4740− sizeof(tmp));
4740+ sizeof(tmp) - 1);
4741+ tmp[sizeof(tmp) - 1] = '\0';
47414742 goto got_name;
47424743 }
47434744
@@ -5330,7 +5331,7 @@ static void sw_perf_event_destroy(struct perf_event *event) · 586 unmodified lines
53305331
53315332 static int perf_swevent_init(struct perf_event *event)
53325333 {
5333− int event_id = event->attr.config;
5334+ u64 event_id = event->attr.config;
53345335
53355336 if (event->attr.type != PERF_TYPE_SOFTWARE)
53365337 return -ENOENT;
@@ -5986,6 +5987,7 @@ skip_type: · 649 unmodified lines
59865987 if (pmu->pmu_cpu_context)
59875988 goto got_cpu_context;
59885989
5990+ ret = -ENOMEM;
59895991 pmu->pmu_cpu_context = alloc_percpu(struct perf_cpu_context);
59905992 if (!pmu->pmu_cpu_context)
59915993 goto free_dev;
kernel/events/internal.h+1−1
@@ -16,7 +16,7 @@ struct ring_buffer { · 15 unmodified lines
1616 int page_order; /* allocation order */
1717 #endif
1818 int nr_pages; /* nr of data pages */
19− int writable; /* are we writable */
19+ int overwrite; /* can overwrite itself */
2020
2121 atomic_t poll; /* POLL_ for wakeups */
2222
kernel/events/ring_buffer.c+18−4
@@ -18,12 +18,24 @@ · 17 unmodified lines
1818 static bool perf_output_space(struct ring_buffer *rb, unsigned long tail,
1919 unsigned long offset, unsigned long head)
2020 {
21− unsigned long mask;
21+ unsigned long sz = perf_data_size(rb);
22+ unsigned long mask = sz - 1;
2223
23− if (!rb->writable)
24+ /*
25+ * check if user-writable
26+ * overwrite : over-write its own tail
27+ * !overwrite: buffer possibly drops events.
28+ */
29+ if (rb->overwrite)
2430 return true;
2531
26− mask = perf_data_size(rb) - 1;
32+ /*
33+ * verify that payload is not bigger than buffer
34+ * otherwise masking logic may fail to detect
35+ * the "not enough space" condition
36+ */
37+ if ((head - offset) > sz)
38+ return false;
2739
2840 offset = (offset - tail) & mask;
2941 head = (head - tail) & mask;
@@ -212,7 +224,9 @@ ring_buffer_init(struct ring_buffer *rb, long watermark, int flags) · 182 unmodified lines
212224 rb->watermark = max_size / 2;
213225
214226 if (flags & RING_BUFFER_WRITABLE)
215− rb->writable = 1;
227+ rb->overwrite = 0;
228+ else
229+ rb->overwrite = 1;
216230
217231 atomic_set(&rb->refcount, 1);
218232
kernel/hrtimer.c+1−2
@@ -63,6 +63,7 @@ · 62 unmodified lines
6363 DEFINE_PER_CPU(struct hrtimer_cpu_base, hrtimer_bases) =
6464 {
6565
66+ .lock = __RAW_SPIN_LOCK_UNLOCKED(hrtimer_bases.lock),
6667 .clock_base =
6768 {
6869 {
@@ -1642,8 +1643,6 @@ static void __cpuinit init_hrtimers_cpu(int cpu) · 1573 unmodified lines
16421643 struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
16431644 int i;
16441645
1645− raw_spin_lock_init(&cpu_base->lock);
1646−
16471646 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
16481647 cpu_base->clock_base[i].cpu_base = cpu_base;
16491648 timerqueue_init_head(&cpu_base->clock_base[i].active);
kernel/kexec.c+105−13
@@ -55,7 +55,7 @@ struct resource crashk_res = { · 54 unmodified lines
5555 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
5656 };
5757 struct resource crashk_low_res = {
58− .name = "Crash kernel low",
58+ .name = "Crash kernel",
5959 .start = 0,
6060 .end = 0,
6161 .flags = IORESOURCE_BUSY | IORESOURCE_MEM
@@ -1368,35 +1368,114 @@ static int __init parse_crashkernel_simple(char *cmdline, · 1306 unmodified lines
13681368 return 0;
13691369 }
13701370
1371+#define SUFFIX_HIGH 0
1372+#define SUFFIX_LOW 1
1373+#define SUFFIX_NULL 2
1374+static __initdata char *suffix_tbl[] = {
1375+ [SUFFIX_HIGH] = ",high",
1376+ [SUFFIX_LOW] = ",low",
1377+ [SUFFIX_NULL] = NULL,
1378+};
1379+
13711380 /*
1372− * That function is the entry point for command line parsing and should be
1373− * called from the arch-specific code.
1381+ * That function parses "suffix" crashkernel command lines like
1382+ *
1383+ * crashkernel=size,[high|low]
1384+ *
1385+ * It returns 0 on success and -EINVAL on failure.
13741386 */
1387+static int __init parse_crashkernel_suffix(char *cmdline,
1388+ unsigned long long *crash_size,
1389+ unsigned long long *crash_base,
1390+ const char *suffix)
1391+{
1392+ char *cur = cmdline;
1393+
1394+ *crash_size = memparse(cmdline, &cur);
1395+ if (cmdline == cur) {
1396+ pr_warn("crashkernel: memory value expected\n");
1397+ return -EINVAL;
1398+ }
1399+
1400+ /* check with suffix */
1401+ if (strncmp(cur, suffix, strlen(suffix))) {
1402+ pr_warn("crashkernel: unrecognized char\n");
1403+ return -EINVAL;
1404+ }
1405+ cur += strlen(suffix);
1406+ if (*cur != ' ' && *cur != '\0') {
1407+ pr_warn("crashkernel: unrecognized char\n");
1408+ return -EINVAL;
1409+ }
1410+
1411+ return 0;
1412+}
1413+
1414+static __init char *get_last_crashkernel(char *cmdline,
1415+ const char *name,
1416+ const char *suffix)
1417+{
1418+ char *p = cmdline, *ck_cmdline = NULL;
1419+
1420+ /* find crashkernel and use the last one if there are more */
1421+ p = strstr(p, name);
1422+ while (p) {
1423+ char *end_p = strchr(p, ' ');
1424+ char *q;
1425+
1426+ if (!end_p)
1427+ end_p = p + strlen(p);
1428+
1429+ if (!suffix) {
1430+ int i;
1431+
1432+ /* skip the one with any known suffix */
1433+ for (i = 0; suffix_tbl[i]; i++) {
1434+ q = end_p - strlen(suffix_tbl[i]);
1435+ if (!strncmp(q, suffix_tbl[i],
1436+ strlen(suffix_tbl[i])))
1437+ goto next;
1438+ }
1439+ ck_cmdline = p;
1440+ } else {
1441+ q = end_p - strlen(suffix);
1442+ if (!strncmp(q, suffix, strlen(suffix)))
1443+ ck_cmdline = p;
1444+ }
1445+next:
1446+ p = strstr(p+1, name);
1447+ }
1448+
1449+ if (!ck_cmdline)
1450+ return NULL;
1451+
1452+ return ck_cmdline;
1453+}
1454+
13751455 static int __init __parse_crashkernel(char *cmdline,
13761456 unsigned long long system_ram,
13771457 unsigned long long *crash_size,
13781458 unsigned long long *crash_base,
1379− const char *name)
1459+ const char *name,
1460+ const char *suffix)
13801461 {
1381− char *p = cmdline, *ck_cmdline = NULL;
13821462 char *first_colon, *first_space;
1463+ char *ck_cmdline;
13831464
13841465 BUG_ON(!crash_size || !crash_base);
13851466 *crash_size = 0;
13861467 *crash_base = 0;
13871468
1388− /* find crashkernel and use the last one if there are more */
1389− p = strstr(p, name);
1390− while (p) {
1391− ck_cmdline = p;
1392− p = strstr(p+1, name);
1393− }
1469+ ck_cmdline = get_last_crashkernel(cmdline, name, suffix);
13941470
13951471 if (!ck_cmdline)
13961472 return -EINVAL;
13971473
13981474 ck_cmdline += strlen(name);
13991475
1476+ if (suffix)
1477+ return parse_crashkernel_suffix(ck_cmdline, crash_size,
1478+ crash_base, suffix);
14001479 /*
14011480 * if the commandline contains a ':', then that's the extended
14021481 * syntax -- if not, it must be the classic syntax
@@ -1413,13 +1492,26 @@ static int __init __parse_crashkernel(char *cmdline, · 10 unmodified lines
14131492 return 0;
14141493 }
14151494
1495+/*
1496+ * That function is the entry point for command line parsing and should be
1497+ * called from the arch-specific code.
1498+ */
14161499 int __init parse_crashkernel(char *cmdline,
14171500 unsigned long long system_ram,
14181501 unsigned long long *crash_size,
14191502 unsigned long long *crash_base)
14201503 {
14211504 return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
1422− "crashkernel=");
1505+ "crashkernel=", NULL);
1506+}
1507+
1508+int __init parse_crashkernel_high(char *cmdline,
1509+ unsigned long long system_ram,
1510+ unsigned long long *crash_size,
1511+ unsigned long long *crash_base)
1512+{
1513+ return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
1514+ "crashkernel=", suffix_tbl[SUFFIX_HIGH]);
14231515 }
14241516
14251517 int __init parse_crashkernel_low(char *cmdline,
@@ -1428,7 +1520,7 @@ int __init parse_crashkernel_low(char *cmdline, · 2 unmodified lines
14281520 unsigned long long *crash_base)
14291521 {
14301522 return __parse_crashkernel(cmdline, system_ram, crash_size, crash_base,
1431− "crashkernel_low=");
1523+ "crashkernel=", suffix_tbl[SUFFIX_LOW]);
14321524 }
14331525
14341526 static void update_vmcoreinfo_note(void)
kernel/kprobes.c+13−6
@@ -794,16 +794,16 @@ out: · 793 unmodified lines
794794 }
795795
796796 #ifdef CONFIG_SYSCTL
797−/* This should be called with kprobe_mutex locked */
798797 static void __kprobes optimize_all_kprobes(void)
799798 {
800799 struct hlist_head *head;
801800 struct kprobe *p;
802801 unsigned int i;
803802
803+ mutex_lock(&kprobe_mutex);
804804 /* If optimization is already allowed, just return */
805805 if (kprobes_allow_optimization)
806− return;
806+ goto out;
807807
808808 kprobes_allow_optimization = true;
809809 for (i = 0; i < KPROBE_TABLE_SIZE; i++) {
@@ -813,18 +813,22 @@ static void __kprobes optimize_all_kprobes(void) · 3 unmodified lines
813813 optimize_kprobe(p);
814814 }
815815 printk(KERN_INFO "Kprobes globally optimized\n");
816+out:
817+ mutex_unlock(&kprobe_mutex);
816818 }
817819
818−/* This should be called with kprobe_mutex locked */
819820 static void __kprobes unoptimize_all_kprobes(void)
820821 {
821822 struct hlist_head *head;
822823 struct kprobe *p;
823824 unsigned int i;
824825
826+ mutex_lock(&kprobe_mutex);
825827 /* If optimization is already prohibited, just return */
826− if (!kprobes_allow_optimization)
828+ if (!kprobes_allow_optimization) {
829+ mutex_unlock(&kprobe_mutex);
827830 return;
831+ }
828832
829833 kprobes_allow_optimization = false;
830834 for (i = 0; i < KPROBE_TABLE_SIZE; i++) {
@@ -834,11 +838,14 @@ static void __kprobes unoptimize_all_kprobes(void) · 3 unmodified lines
834838 unoptimize_kprobe(p, false);
835839 }
836840 }
841+ mutex_unlock(&kprobe_mutex);
842+
837843 /* Wait for unoptimizing completion */
838844 wait_for_kprobe_optimizer();
839845 printk(KERN_INFO "Kprobes globally unoptimized\n");
840846 }
841847
848+static DEFINE_MUTEX(kprobe_sysctl_mutex);
842849 int sysctl_kprobes_optimization;
843850 int proc_kprobes_optimization_handler(struct ctl_table *table, int write,
844851 void __user *buffer, size_t *length,
@@ -846,7 +853,7 @@ int proc_kprobes_optimization_handler(struct ctl_table *table, int write, · 1 unmodified line
846853 {
847854 int ret;
848855
849− mutex_lock(&kprobe_mutex);
856+ mutex_lock(&kprobe_sysctl_mutex);
850857 sysctl_kprobes_optimization = kprobes_allow_optimization ? 1 : 0;
851858 ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
852859
@@ -854,7 +861,7 @@ int proc_kprobes_optimization_handler(struct ctl_table *table, int write, · 1 unmodified line
854861 optimize_all_kprobes();
855862 else
856863 unoptimize_all_kprobes();
857− mutex_unlock(&kprobe_mutex);
864+ mutex_unlock(&kprobe_sysctl_mutex);
858865
859866 return ret;
860867 }
kernel/kthread.c+28−24
@@ -124,12 +124,12 @@ void *kthread_data(struct task_struct *task) · 123 unmodified lines
124124
125125 static void __kthread_parkme(struct kthread *self)
126126 {
127− __set_current_state(TASK_INTERRUPTIBLE);
127+ __set_current_state(TASK_PARKED);
128128 while (test_bit(KTHREAD_SHOULD_PARK, &self->flags)) {
129129 if (!test_and_set_bit(KTHREAD_IS_PARKED, &self->flags))
130130 complete(&self->parked);
131131 schedule();
132− __set_current_state(TASK_INTERRUPTIBLE);
132+ __set_current_state(TASK_PARKED);
133133 }
134134 clear_bit(KTHREAD_IS_PARKED, &self->flags);
135135 __set_current_state(TASK_RUNNING);
@@ -256,8 +256,13 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), · 120 unmodified lines
256256 }
257257 EXPORT_SYMBOL(kthread_create_on_node);
258258
259−static void __kthread_bind(struct task_struct *p, unsigned int cpu)
259+static void __kthread_bind(struct task_struct *p, unsigned int cpu, long state)
260260 {
261+ /* Must have done schedule() in kthread() before we set_task_cpu */
262+ if (!wait_task_inactive(p, state)) {
263+ WARN_ON(1);
264+ return;
265+ }
261266 /* It's safe because the task is inactive. */
262267 do_set_cpus_allowed(p, cpumask_of(cpu));
263268 p->flags |= PF_THREAD_BOUND;
@@ -274,12 +279,7 @@ static void __kthread_bind(struct task_struct *p, unsigned int cpu) · 10 unmodified lines
274279 */
275280 void kthread_bind(struct task_struct *p, unsigned int cpu)
276281 {
277− /* Must have done schedule() in kthread() before we set_task_cpu */
278− if (!wait_task_inactive(p, TASK_UNINTERRUPTIBLE)) {
279− WARN_ON(1);
280− return;
281− }
282− __kthread_bind(p, cpu);
282+ __kthread_bind(p, cpu, TASK_UNINTERRUPTIBLE);
283283 }
284284 EXPORT_SYMBOL(kthread_bind);
285285
@@ -324,6 +324,22 @@ static struct kthread *task_get_live_kthread(struct task_struct *k) · 38 unmodified lines
324324 return NULL;
325325 }
326326
327+static void __kthread_unpark(struct task_struct *k, struct kthread *kthread)
328+{
329+ clear_bit(KTHREAD_SHOULD_PARK, &kthread->flags);
330+ /*
331+ * We clear the IS_PARKED bit here as we don't wait
332+ * until the task has left the park code. So if we'd
333+ * park before that happens we'd see the IS_PARKED bit
334+ * which might be about to be cleared.
335+ */
336+ if (test_and_clear_bit(KTHREAD_IS_PARKED, &kthread->flags)) {
337+ if (test_bit(KTHREAD_IS_PER_CPU, &kthread->flags))
338+ __kthread_bind(k, kthread->cpu, TASK_PARKED);
339+ wake_up_state(k, TASK_PARKED);
340+ }
341+}
342+
327343 /**
328344 * kthread_unpark - unpark a thread created by kthread_create().
329345 * @k: thread created by kthread_create().
@@ -336,20 +352,8 @@ void kthread_unpark(struct task_struct *k) · 6 unmodified lines
336352 {
337353 struct kthread *kthread = task_get_live_kthread(k);
338354
339− if (kthread) {
340− clear_bit(KTHREAD_SHOULD_PARK, &kthread->flags);
341− /*
342− * We clear the IS_PARKED bit here as we don't wait
343− * until the task has left the park code. So if we'd
344− * park before that happens we'd see the IS_PARKED bit
345− * which might be about to be cleared.
346− */
347− if (test_and_clear_bit(KTHREAD_IS_PARKED, &kthread->flags)) {
348− if (test_bit(KTHREAD_IS_PER_CPU, &kthread->flags))
349− __kthread_bind(k, kthread->cpu);
350− wake_up_process(k);
351− }
352− }
355+ if (kthread)
356+ __kthread_unpark(k, kthread);
353357 put_task_struct(k);
354358 }
355359
@@ -407,7 +411,7 @@ int kthread_stop(struct task_struct *k) · 51 unmodified lines
407411 trace_sched_kthread_stop(k);
408412 if (kthread) {
409413 set_bit(KTHREAD_SHOULD_STOP, &kthread->flags);
410− clear_bit(KTHREAD_SHOULD_PARK, &kthread->flags);
414+ __kthread_unpark(k, kthread);
411415 wake_up_process(k);
412416 wait_for_completion(&kthread->exited);
413417 }
kernel/sched/clock.c+26−0
@@ -176,10 +176,36 @@ static u64 sched_clock_remote(struct sched_clock_data *scd) · 175 unmodified lines
176176 u64 this_clock, remote_clock;
177177 u64 *ptr, old_val, val;
178178
179+#if BITS_PER_LONG != 64
180+again:
181+ /*
182+ * Careful here: The local and the remote clock values need to
183+ * be read out atomic as we need to compare the values and
184+ * then update either the local or the remote side. So the
185+ * cmpxchg64 below only protects one readout.
186+ *
187+ * We must reread via sched_clock_local() in the retry case on
188+ * 32bit as an NMI could use sched_clock_local() via the
189+ * tracer and hit between the readout of
190+ * the low32bit and the high 32bit portion.
191+ */
192+ this_clock = sched_clock_local(my_scd);
193+ /*
194+ * We must enforce atomic readout on 32bit, otherwise the
195+ * update on the remote cpu can hit inbetween the readout of
196+ * the low32bit and the high 32bit portion.
197+ */
198+ remote_clock = cmpxchg64(&scd->clock, 0, 0);
199+#else
200+ /*
201+ * On 64bit the read of [my]scd->clock is atomic versus the
202+ * update, so we can avoid the above 32bit dance.
203+ */
179204 sched_clock_local(my_scd);
180205 again:
181206 this_clock = my_scd->clock;
182207 remote_clock = scd->clock;
208+#endif
183209
184210 /*
185211 * Use the opportunity that we have both locks
kernel/sched/core.c+5−3
@@ -1498,8 +1498,10 @@ static void try_to_wake_up_local(struct task_struct *p) · 1497 unmodified lines
14981498 {
14991499 struct rq *rq = task_rq(p);
15001500
1501− BUG_ON(rq != this_rq());
1502− BUG_ON(p == current);
1501+ if (WARN_ON_ONCE(rq != this_rq()) ||
1502+ WARN_ON_ONCE(p == current))
1503+ return;
1504+
15031505 lockdep_assert_held(&rq->lock);
15041506
15051507 if (!raw_spin_trylock(&p->pi_lock)) {
@@ -4999,7 +5001,7 @@ static void sd_free_ctl_entry(struct ctl_table **tablep) · 3493 unmodified lines
49995001 }
50005002
50015003 static int min_load_idx = 0;
5002−static int max_load_idx = CPU_LOAD_IDX_MAX;
5004+static int max_load_idx = CPU_LOAD_IDX_MAX-1;
50035005
50045006 static void
50055007 set_table_entry(struct ctl_table *entry,
kernel/sched/cputime.c+1−1
@@ -310,7 +310,7 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) · 309 unmodified lines
310310
311311 t = tsk;
312312 do {
313− task_cputime(tsk, &utime, &stime);
313+ task_cputime(t, &utime, &stime);
314314 times->utime += utime;
315315 times->stime += stime;
316316 times->sum_exec_runtime += task_sched_runtime(t);
kernel/signal.c+1−1
@@ -2950,7 +2950,7 @@ do_send_specific(pid_t tgid, pid_t pid, int sig, struct siginfo *info) · 2949 unmodified lines
29502950
29512951 static int do_tkill(pid_t tgid, pid_t pid, int sig)
29522952 {
2953− struct siginfo info;
2953+ struct siginfo info = {};
29542954
29552955 info.si_signo = sig;
29562956 info.si_errno = 0;
kernel/smpboot.c+12−2
@@ -185,8 +185,18 @@ __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu) · 184 unmodified lines
185185 }
186186 get_task_struct(tsk);
187187 *per_cpu_ptr(ht->store, cpu) = tsk;
188− if (ht->create)
189− ht->create(cpu);
188+ if (ht->create) {
189+ /*
190+ * Make sure that the task has actually scheduled out
191+ * into park position, before calling the create
192+ * callback. At least the migration thread callback
193+ * requires that the task is off the runqueue.
194+ */
195+ if (!wait_task_inactive(tsk, TASK_PARKED))
196+ WARN_ON(1);
197+ else
198+ ht->create(cpu);
199+ }
190200 return 0;
191201 }
192202
kernel/sys.c+2−1
@@ -324,7 +324,6 @@ void kernel_restart_prepare(char *cmd) · 323 unmodified lines
324324 system_state = SYSTEM_RESTART;
325325 usermodehelper_disable();
326326 device_shutdown();
327− syscore_shutdown();
328327 }
329328
330329 /**
@@ -370,6 +369,7 @@ void kernel_restart(char *cmd) · 39 unmodified lines
370369 {
371370 kernel_restart_prepare(cmd);
372371 disable_nonboot_cpus();
372+ syscore_shutdown();
373373 if (!cmd)
374374 printk(KERN_EMERG "Restarting system.\n");
375375 else
@@ -395,6 +395,7 @@ static void kernel_shutdown_prepare(enum system_states state) · 19 unmodified lines
395395 void kernel_halt(void)
396396 {
397397 kernel_shutdown_prepare(SYSTEM_HALT);
398+ disable_nonboot_cpus();
398399 syscore_shutdown();
399400 printk(KERN_EMERG "System halted.\n");
400401 kmsg_dump(KMSG_DUMP_HALT);
kernel/trace/blktrace.c+3−23
@@ -739,12 +739,6 @@ static void blk_add_trace_rq_complete(void *ignore, · 738 unmodified lines
739739 struct request_queue *q,
740740 struct request *rq)
741741 {
742− struct blk_trace *bt = q->blk_trace;
743−
744− /* if control ever passes through here, it's a request based driver */
745− if (unlikely(bt && !bt->rq_based))
746− bt->rq_based = true;
747−
748742 blk_add_trace_rq(q, rq, BLK_TA_COMPLETE);
749743 }
750744
@@ -780,24 +774,10 @@ static void blk_add_trace_bio_bounce(void *ignore, · 29 unmodified lines
780774 blk_add_trace_bio(q, bio, BLK_TA_BOUNCE, 0);
781775 }
782776
783−static void blk_add_trace_bio_complete(void *ignore, struct bio *bio, int error)
777+static void blk_add_trace_bio_complete(void *ignore,
778+ struct request_queue *q, struct bio *bio,
779+ int error)
784780 {
785− struct request_queue *q;
786− struct blk_trace *bt;
787−
788− if (!bio->bi_bdev)
789− return;
790−
791− q = bdev_get_queue(bio->bi_bdev);
792− bt = q->blk_trace;
793−
794− /*
795− * Request based drivers will generate both rq and bio completions.
796− * Ignore bio ones.
797− */
798− if (likely(!bt) || bt->rq_based)
799− return;
800−
801781 blk_add_trace_bio(q, bio, BLK_TA_COMPLETE, error);
802782 }
803783
kernel/trace/ftrace.c+25−29
@@ -66,7 +66,7 @@ · 65 unmodified lines
6666
6767 static struct ftrace_ops ftrace_list_end __read_mostly = {
6868 .func = ftrace_stub,
69− .flags = FTRACE_OPS_FL_RECURSION_SAFE,
69+ .flags = FTRACE_OPS_FL_RECURSION_SAFE | FTRACE_OPS_FL_STUB,
7070 };
7171
7272 /* ftrace_enabled is a method to turn ftrace on or off */
@@ -694,7 +694,6 @@ int ftrace_profile_pages_init(struct ftrace_profile_stat *stat) · 621 unmodified lines
694694 free_page(tmp);
695695 }
696696
697− free_page((unsigned long)stat->pages);
698697 stat->pages = NULL;
699698 stat->start = NULL;
700699
@@ -1053,6 +1052,19 @@ static __init void ftrace_profile_debugfs(struct dentry *d_tracer) · 352 unmodified lines
10531052
10541053 static struct pid * const ftrace_swapper_pid = &init_struct_pid;
10551054
1055+loff_t
1056+ftrace_filter_lseek(struct file *file, loff_t offset, int whence)
1057+{
1058+ loff_t ret;
1059+
1060+ if (file->f_mode & FMODE_READ)
1061+ ret = seq_lseek(file, offset, whence);
1062+ else
1063+ file->f_pos = ret = 1;
1064+
1065+ return ret;
1066+}
1067+
10561068 #ifdef CONFIG_DYNAMIC_FTRACE
10571069
10581070 #ifndef CONFIG_FTRACE_MCOUNT_RECORD
@@ -2613,7 +2625,7 @@ static void ftrace_filter_reset(struct ftrace_hash *hash) · 1554 unmodified lines
26132625 * routine, you can use ftrace_filter_write() for the write
26142626 * routine if @flag has FTRACE_ITER_FILTER set, or
26152627 * ftrace_notrace_write() if @flag has FTRACE_ITER_NOTRACE set.
2616− * ftrace_regex_lseek() should be used as the lseek routine, and
2628+ * ftrace_filter_lseek() should be used as the lseek routine, and
26172629 * release must call ftrace_regex_release().
26182630 */
26192631 int
@@ -2697,19 +2709,6 @@ ftrace_notrace_open(struct inode *inode, struct file *file) · 77 unmodified lines
26972709 inode, file);
26982710 }
26992711
2700−loff_t
2701−ftrace_regex_lseek(struct file *file, loff_t offset, int whence)
2702−{
2703− loff_t ret;
2704−
2705− if (file->f_mode & FMODE_READ)
2706− ret = seq_lseek(file, offset, whence);
2707− else
2708− file->f_pos = ret = 1;
2709−
2710− return ret;
2711−}
2712−
27132712 static int ftrace_match(char *str, char *regex, int len, int type)
27142713 {
27152714 int matched = 0;
@@ -3441,14 +3440,14 @@ static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata; · 725 unmodified lines
34413440
34423441 static int __init set_ftrace_notrace(char *str)
34433442 {
3444− strncpy(ftrace_notrace_buf, str, FTRACE_FILTER_SIZE);
3443+ strlcpy(ftrace_notrace_buf, str, FTRACE_FILTER_SIZE);
34453444 return 1;
34463445 }
34473446 __setup("ftrace_notrace=", set_ftrace_notrace);
34483447
34493448 static int __init set_ftrace_filter(char *str)
34503449 {
3451− strncpy(ftrace_filter_buf, str, FTRACE_FILTER_SIZE);
3450+ strlcpy(ftrace_filter_buf, str, FTRACE_FILTER_SIZE);
34523451 return 1;
34533452 }
34543453 __setup("ftrace_filter=", set_ftrace_filter);
@@ -3571,7 +3570,7 @@ static const struct file_operations ftrace_filter_fops = { · 116 unmodified lines
35713570 .open = ftrace_filter_open,
35723571 .read = seq_read,
35733572 .write = ftrace_filter_write,
3574− .llseek = ftrace_regex_lseek,
3573+ .llseek = ftrace_filter_lseek,
35753574 .release = ftrace_regex_release,
35763575 };
35773576
@@ -3579,7 +3578,7 @@ static const struct file_operations ftrace_notrace_fops = { · 1 unmodified line
35793578 .open = ftrace_notrace_open,
35803579 .read = seq_read,
35813580 .write = ftrace_notrace_write,
3582− .llseek = ftrace_regex_lseek,
3581+ .llseek = ftrace_filter_lseek,
35833582 .release = ftrace_regex_release,
35843583 };
35853584
@@ -3784,8 +3783,8 @@ static const struct file_operations ftrace_graph_fops = { · 198 unmodified lines
37843783 .open = ftrace_graph_open,
37853784 .read = seq_read,
37863785 .write = ftrace_graph_write,
3786+ .llseek = ftrace_filter_lseek,
37873787 .release = ftrace_graph_release,
3788− .llseek = seq_lseek,
37893788 };
37903789 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
37913790
@@ -4131,7 +4130,8 @@ ftrace_ops_control_func(unsigned long ip, unsigned long parent_ip, · 339 unmodified lines
41314130 preempt_disable_notrace();
41324131 trace_recursion_set(TRACE_CONTROL_BIT);
41334132 do_for_each_ftrace_op(op, ftrace_control_list) {
4134− if (!ftrace_function_local_disabled(op) &&
4133+ if (!(op->flags & FTRACE_OPS_FL_STUB) &&
4134+ !ftrace_function_local_disabled(op) &&
41354135 ftrace_ops_test(op, ip))
41364136 op->func(ip, parent_ip, op, regs);
41374137 } while_for_each_ftrace_op(op);
@@ -4439,7 +4439,7 @@ static const struct file_operations ftrace_pid_fops = { · 301 unmodified lines
44394439 .open = ftrace_pid_open,
44404440 .write = ftrace_pid_write,
44414441 .read = seq_read,
4442− .llseek = seq_lseek,
4442+ .llseek = ftrace_filter_lseek,
44434443 .release = ftrace_pid_release,
44444444 };
44454445
@@ -4555,12 +4555,8 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, · 109 unmodified lines
45554555 ftrace_startup_sysctl();
45564556
45574557 /* we are starting ftrace again */
4558− if (ftrace_ops_list != &ftrace_list_end) {
4559− if (ftrace_ops_list->next == &ftrace_list_end)
4560− ftrace_trace_function = ftrace_ops_list->func;
4561− else
4562− ftrace_trace_function = ftrace_ops_list_func;
4563− }
4558+ if (ftrace_ops_list != &ftrace_list_end)
4559+ update_ftrace_function();
45644560
45654561 } else {
45664562 /* stopping ftrace calls (just send to ftrace_stub) */
kernel/trace/trace.c+6−3
@@ -132,7 +132,7 @@ static char *default_bootup_tracer; · 131 unmodified lines
132132
133133 static int __init set_cmdline_ftrace(char *str)
134134 {
135− strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
135+ strlcpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
136136 default_bootup_tracer = bootup_tracer_buf;
137137 /* We are using ftrace early, expand it */
138138 ring_buffer_expanded = 1;
@@ -162,7 +162,7 @@ static char *trace_boot_options __initdata; · 23 unmodified lines
162162
163163 static int __init set_trace_boot_options(char *str)
164164 {
165− strncpy(trace_boot_options_buf, str, MAX_TRACER_SIZE);
165+ strlcpy(trace_boot_options_buf, str, MAX_TRACER_SIZE);
166166 trace_boot_options = trace_boot_options_buf;
167167 return 0;
168168 }
@@ -744,8 +744,11 @@ update_max_tr_single(struct trace_array *tr, struct task_struct *tsk, int cpu) · 575 unmodified lines
744744 return;
745745
746746 WARN_ON_ONCE(!irqs_disabled());
747− if (WARN_ON_ONCE(!current_trace->allocated_snapshot))
747+ if (!current_trace->allocated_snapshot) {
748+ /* Only the nop tracer should hit this when disabling */
749+ WARN_ON_ONCE(current_trace != &nop_trace);
748750 return;
751+ }
749752
750753 arch_spin_lock(&ftrace_max_lock);
751754
kernel/trace/trace_stack.c+1−1
@@ -322,7 +322,7 @@ static const struct file_operations stack_trace_filter_fops = { · 321 unmodified lines
322322 .open = stack_trace_filter_open,
323323 .read = seq_read,
324324 .write = ftrace_filter_write,
325− .llseek = ftrace_regex_lseek,
325+ .llseek = ftrace_filter_lseek,
326326 .release = ftrace_regex_release,
327327 };
328328
kernel/user_namespace.c+13−9
@@ -25,7 +25,8 @@ · 24 unmodified lines
2525
2626 static struct kmem_cache *user_ns_cachep __read_mostly;
2727
28−static bool new_idmap_permitted(struct user_namespace *ns, int cap_setid,
28+static bool new_idmap_permitted(const struct file *file,
29+ struct user_namespace *ns, int cap_setid,
2930 struct uid_gid_map *map);
3031
3132 static void set_cred_user_ns(struct cred *cred, struct user_namespace *user_ns)
@@ -612,10 +613,10 @@ static ssize_t map_write(struct file *file, const char __user *buf, · 580 unmodified lines
612613 if (map->nr_extents != 0)
613614 goto out;
614615
615− /* Require the appropriate privilege CAP_SETUID or CAP_SETGID
616− * over the user namespace in order to set the id mapping.
616+ /*
617+ * Adjusting namespace settings requires capabilities on the target.
617618 */
618− if (cap_valid(cap_setid) && !ns_capable(ns, cap_setid))
619+ if (cap_valid(cap_setid) && !file_ns_capable(file, ns, CAP_SYS_ADMIN))
619620 goto out;
620621
621622 /* Get a buffer */
@@ -700,7 +701,7 @@ static ssize_t map_write(struct file *file, const char __user *buf, · 78 unmodified lines
700701
701702 ret = -EPERM;
702703 /* Validate the user is allowed to use user id's mapped to. */
703− if (!new_idmap_permitted(ns, cap_setid, &new_map))
704+ if (!new_idmap_permitted(file, ns, cap_setid, &new_map))
704705 goto out;
705706
706707 /* Map the lower ids from the parent user namespace to the
@@ -787,7 +788,8 @@ ssize_t proc_projid_map_write(struct file *file, const char __user *buf, size_t · 80 unmodified lines
787788 &ns->projid_map, &ns->parent->projid_map);
788789 }
789790
790−static bool new_idmap_permitted(struct user_namespace *ns, int cap_setid,
791+static bool new_idmap_permitted(const struct file *file,
792+ struct user_namespace *ns, int cap_setid,
791793 struct uid_gid_map *new_map)
792794 {
793795 /* Allow mapping to your own filesystem ids */
@@ -795,12 +797,12 @@ static bool new_idmap_permitted(struct user_namespace *ns, int cap_setid, · 1 unmodified line
795797 u32 id = new_map->extent[0].lower_first;
796798 if (cap_setid == CAP_SETUID) {
797799 kuid_t uid = make_kuid(ns->parent, id);
798− if (uid_eq(uid, current_fsuid()))
800+ if (uid_eq(uid, file->f_cred->fsuid))
799801 return true;
800802 }
801803 else if (cap_setid == CAP_SETGID) {
802804 kgid_t gid = make_kgid(ns->parent, id);
803− if (gid_eq(gid, current_fsgid()))
805+ if (gid_eq(gid, file->f_cred->fsgid))
804806 return true;
805807 }
806808 }
@@ -811,8 +813,10 @@ static bool new_idmap_permitted(struct user_namespace *ns, int cap_setid, · 4 unmodified lines
811813
812814 /* Allow the specified ids if we have the appropriate capability
813815 * (CAP_SETUID or CAP_SETGID) over the parent user namespace.
816+ * And the opener of the id file also had the approprpiate capability.
814817 */
815− if (ns_capable(ns->parent, cap_setid))
818+ if (ns_capable(ns->parent, cap_setid) &&
819+ file_ns_capable(file, ns->parent, cap_setid))
816820 return true;
817821
818822 return false;
lib/Kconfig+3−0
@@ -404,4 +404,7 @@ config OID_REGISTRY · 403 unmodified lines
404404 help
405405 Enable fast lookup object identifier registry.
406406
407+config UCS2_STRING
408+ tristate
409+
407410 endmenu
lib/Makefile+2−0
@@ -174,3 +174,5 @@ quiet_cmd_build_OID_registry = GEN $@ · 173 unmodified lines
174174 cmd_build_OID_registry = perl $(srctree)/$(src)/build_OID_registry $< $@
175175
176176 clean-files += oid_registry_data.c
177+
178+obj-$(CONFIG_UCS2_STRING) += ucs2_string.o
lib/kobject.c+8−1
@@ -529,6 +529,13 @@ struct kobject *kobject_get(struct kobject *kobj) · 528 unmodified lines
529529 return kobj;
530530 }
531531
532+static struct kobject *kobject_get_unless_zero(struct kobject *kobj)
533+{
534+ if (!kref_get_unless_zero(&kobj->kref))
535+ kobj = NULL;
536+ return kobj;
537+}
538+
532539 /*
533540 * kobject_cleanup - free kobject resources.
534541 * @kobj: object to cleanup
@@ -751,7 +758,7 @@ struct kobject *kset_find_obj(struct kset *kset, const char *name) · 216 unmodified lines
751758
752759 list_for_each_entry(k, &kset->list, entry) {
753760 if (kobject_name(k) && !strcmp(kobject_name(k), name)) {
754− ret = kobject_get(k);
761+ ret = kobject_get_unless_zero(k);
755762 break;
756763 }
757764 }
lib/swiotlb.c+15−4
@@ -105,9 +105,9 @@ setup_io_tlb_npages(char *str) · 104 unmodified lines
105105 if (!strcmp(str, "force"))
106106 swiotlb_force = 1;
107107
108− return 1;
108+ return 0;
109109 }
110−__setup("swiotlb=", setup_io_tlb_npages);
110+early_param("swiotlb", setup_io_tlb_npages);
111111 /* make io_tlb_overflow tunable too? */
112112
113113 unsigned long swiotlb_nr_tbl(void)
@@ -115,6 +115,18 @@ unsigned long swiotlb_nr_tbl(void) · 1 unmodified line
115115 return io_tlb_nslabs;
116116 }
117117 EXPORT_SYMBOL_GPL(swiotlb_nr_tbl);
118+
119+/* default to 64MB */
120+#define IO_TLB_DEFAULT_SIZE (64UL<<20)
121+unsigned long swiotlb_size_or_default(void)
122+{
123+ unsigned long size;
124+
125+ size = io_tlb_nslabs << IO_TLB_SHIFT;
126+
127+ return size ? size : (IO_TLB_DEFAULT_SIZE);
128+}
129+
118130 /* Note that this doesn't work with highmem page */
119131 static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev,
120132 volatile void *address)
@@ -188,8 +200,7 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) · 67 unmodified lines
188200 void __init
189201 swiotlb_init(int verbose)
190202 {
191− /* default to 64MB */
192− size_t default_size = 64UL<<20;
203+ size_t default_size = IO_TLB_DEFAULT_SIZE;
193204 unsigned char *vstart;
194205 unsigned long bytes;
195206
lib/ucs2_string.c+51−0
@@ -0,0 +1,51 @@
1+#include <linux/ucs2_string.h>
2+#include <linux/module.h>
3+
4+/* Return the number of unicode characters in data */
5+unsigned long
6+ucs2_strnlen(const ucs2_char_t *s, size_t maxlength)
7+{
8+ unsigned long length = 0;
9+
10+ while (*s++ != 0 && length < maxlength)
11+ length++;
12+ return length;
13+}
14+EXPORT_SYMBOL(ucs2_strnlen);
15+
16+unsigned long
17+ucs2_strlen(const ucs2_char_t *s)
18+{
19+ return ucs2_strnlen(s, ~0UL);
20+}
21+EXPORT_SYMBOL(ucs2_strlen);
22+
23+/*
24+ * Return the number of bytes is the length of this string
25+ * Note: this is NOT the same as the number of unicode characters
26+ */
27+unsigned long
28+ucs2_strsize(const ucs2_char_t *data, unsigned long maxlength)
29+{
30+ return ucs2_strnlen(data, maxlength/sizeof(ucs2_char_t)) * sizeof(ucs2_char_t);
31+}
32+EXPORT_SYMBOL(ucs2_strsize);
33+
34+int
35+ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len)
36+{
37+ while (1) {
38+ if (len == 0)
39+ return 0;
40+ if (*a < *b)
41+ return -1;
42+ if (*a > *b)
43+ return 1;
44+ if (*a == 0) /* implies *b == 0 */
45+ return 0;
46+ a++;
47+ b++;
48+ len--;
49+ }
50+}
51+EXPORT_SYMBOL(ucs2_strncmp);
mm/hugetlb.c+11−1
@@ -2961,7 +2961,17 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, · 2960 unmodified lines
29612961 break;
29622962 }
29632963
2964− if (absent ||
2964+ /*
2965+ * We need call hugetlb_fault for both hugepages under migration
2966+ * (in which case hugetlb_fault waits for the migration,) and
2967+ * hwpoisoned hugepages (in which case we need to prevent the
2968+ * caller from accessing to them.) In order to do this, we use
2969+ * here is_swap_pte instead of is_hugetlb_entry_migration and
2970+ * is_hugetlb_entry_hwpoisoned. This is because it simply covers
2971+ * both cases, and because we can't follow correct pages
2972+ * directly from any kind of swap entries.
2973+ */
2974+ if (absent || is_swap_pte(huge_ptep_get(pte)) ||
29652975 ((flags & FOLL_WRITE) && !pte_write(huge_ptep_get(pte)))) {
29662976 int ret;
29672977
mm/memory.c+48−0
@@ -216,6 +216,7 @@ void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm) · 215 unmodified lines
216216 tlb->mm = mm;
217217
218218 tlb->fullmm = fullmm;
219+ tlb->need_flush_all = 0;
219220 tlb->start = -1UL;
220221 tlb->end = 0;
221222 tlb->need_flush = 0;
@@ -2392,6 +2393,53 @@ int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, · 2170 unmodified lines
23922393 }
23932394 EXPORT_SYMBOL(remap_pfn_range);
23942395
2396+/**
2397+ * vm_iomap_memory - remap memory to userspace
2398+ * @vma: user vma to map to
2399+ * @start: start of area
2400+ * @len: size of area
2401+ *
2402+ * This is a simplified io_remap_pfn_range() for common driver use. The
2403+ * driver just needs to give us the physical memory range to be mapped,
2404+ * we'll figure out the rest from the vma information.
2405+ *
2406+ * NOTE! Some drivers might want to tweak vma->vm_page_prot first to get
2407+ * whatever write-combining details or similar.
2408+ */
2409+int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len)
2410+{
2411+ unsigned long vm_len, pfn, pages;
2412+
2413+ /* Check that the physical memory area passed in looks valid */
2414+ if (start + len < start)
2415+ return -EINVAL;
2416+ /*
2417+ * You *really* shouldn't map things that aren't page-aligned,
2418+ * but we've historically allowed it because IO memory might
2419+ * just have smaller alignment.
2420+ */
2421+ len += start & ~PAGE_MASK;
2422+ pfn = start >> PAGE_SHIFT;
2423+ pages = (len + ~PAGE_MASK) >> PAGE_SHIFT;
2424+ if (pfn + pages < pfn)
2425+ return -EINVAL;
2426+
2427+ /* We start the mapping 'vm_pgoff' pages into the area */
2428+ if (vma->vm_pgoff > pages)
2429+ return -EINVAL;
2430+ pfn += vma->vm_pgoff;
2431+ pages -= vma->vm_pgoff;
2432+
2433+ /* Can we fit all of the mapping? */
2434+ vm_len = vma->vm_end - vma->vm_start;
2435+ if (vm_len >> PAGE_SHIFT > pages)
2436+ return -EINVAL;
2437+
2438+ /* Ok, let it rip */
2439+ return io_remap_pfn_range(vma, vma->vm_start, pfn, vm_len, vma->vm_page_prot);
2440+}
2441+EXPORT_SYMBOL(vm_iomap_memory);
2442+
23952443 static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd,
23962444 unsigned long addr, unsigned long end,
23972445 pte_fn_t fn, void *data)
mm/vmscan.c+1−1
@@ -3188,9 +3188,9 @@ int kswapd_run(int nid) · 3187 unmodified lines
31883188 if (IS_ERR(pgdat->kswapd)) {
31893189 /* failure at boot is fatal */
31903190 BUG_ON(system_state == SYSTEM_BOOTING);
3191− pgdat->kswapd = NULL;
31923191 pr_err("Failed to start kswapd on node %d\n", nid);
31933192 ret = PTR_ERR(pgdat->kswapd);
3193+ pgdat->kswapd = NULL;
31943194 }
31953195 return ret;
31963196 }
net/802/mrp.c+4−0
@@ -870,8 +870,12 @@ void mrp_uninit_applicant(struct net_device *dev, struct mrp_application *appl) · 869 unmodified lines
870870 * all pending messages before the applicant is gone.
871871 */
872872 del_timer_sync(&app->join_timer);
873+
874+ spin_lock(&app->lock);
873875 mrp_mad_event(app, MRP_EVENT_TX);
874876 mrp_pdu_queue(app);
877+ spin_unlock(&app->lock);
878+
875879 mrp_queue_xmit(app);
876880
877881 dev_mc_del(dev, appl->group_address);
net/batman-adv/main.c+10−1
@@ -177,7 +177,13 @@ void batadv_mesh_free(struct net_device *soft_iface) · 176 unmodified lines
177177 atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);
178178 }
179179
180−int batadv_is_my_mac(const uint8_t *addr)
180+/**
181+ * batadv_is_my_mac - check if the given mac address belongs to any of the real
182+ * interfaces in the current mesh
183+ * @bat_priv: the bat priv with all the soft interface information
184+ * @addr: the address to check
185+ */
186+int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr)
181187 {
182188 const struct batadv_hard_iface *hard_iface;
183189
@@ -186,6 +192,9 @@ int batadv_is_my_mac(const uint8_t *addr) · 2 unmodified lines
186192 if (hard_iface->if_status != BATADV_IF_ACTIVE)
187193 continue;
188194
195+ if (hard_iface->soft_iface != bat_priv->soft_iface)
196+ continue;
197+
189198 if (batadv_compare_eth(hard_iface->net_dev->dev_addr, addr)) {
190199 rcu_read_unlock();
191200 return 1;
net/batman-adv/main.h+1−1
@@ -165,7 +165,7 @@ extern struct workqueue_struct *batadv_event_workqueue; · 164 unmodified lines
165165
166166 int batadv_mesh_init(struct net_device *soft_iface);
167167 void batadv_mesh_free(struct net_device *soft_iface);
168−int batadv_is_my_mac(const uint8_t *addr);
168+int batadv_is_my_mac(struct batadv_priv *bat_priv, const uint8_t *addr);
169169 struct batadv_hard_iface *
170170 batadv_seq_print_text_primary_if_get(struct seq_file *seq);
171171 int batadv_batman_skb_recv(struct sk_buff *skb, struct net_device *dev,
net/batman-adv/network-coding.c+9−8
@@ -1484,7 +1484,7 @@ void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv, · 1483 unmodified lines
14841484 {
14851485 struct ethhdr *ethhdr = (struct ethhdr *)skb_mac_header(skb);
14861486
1487− if (batadv_is_my_mac(ethhdr->h_dest))
1487+ if (batadv_is_my_mac(bat_priv, ethhdr->h_dest))
14881488 return;
14891489
14901490 /* Set data pointer to MAC header to mimic packets from our tx path */
@@ -1496,6 +1496,7 @@ void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv, · 5 unmodified lines
14961496 /**
14971497 * batadv_nc_skb_decode_packet - decode given skb using the decode data stored
14981498 * in nc_packet
1499+ * @bat_priv: the bat priv with all the soft interface information
14991500 * @skb: unicast skb to decode
15001501 * @nc_packet: decode data needed to decode the skb
15011502 *
@@ -1503,7 +1504,7 @@ void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv, · 1 unmodified line
15031504 * in case of an error.
15041505 */
15051506 static struct batadv_unicast_packet *
1506−batadv_nc_skb_decode_packet(struct sk_buff *skb,
1507+batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,
15071508 struct batadv_nc_packet *nc_packet)
15081509 {
15091510 const int h_size = sizeof(struct batadv_unicast_packet);
@@ -1537,7 +1538,7 @@ batadv_nc_skb_decode_packet(struct sk_buff *skb, · 27 unmodified lines
15371538 /* Select the correct unicast header information based on the location
15381539 * of our mac address in the coded_packet header
15391540 */
1540− if (batadv_is_my_mac(coded_packet_tmp.second_dest)) {
1541+ if (batadv_is_my_mac(bat_priv, coded_packet_tmp.second_dest)) {
15411542 /* If we are the second destination the packet was overheard,
15421543 * so the Ethernet address must be copied to h_dest and
15431544 * pkt_type changed from PACKET_OTHERHOST to PACKET_HOST
@@ -1608,7 +1609,7 @@ batadv_nc_find_decoding_packet(struct batadv_priv *bat_priv, · 64 unmodified lines
16081609
16091610 /* Select the correct packet id based on the location of our mac-addr */
16101611 dest = ethhdr->h_source;
1611− if (!batadv_is_my_mac(coded->second_dest)) {
1612+ if (!batadv_is_my_mac(bat_priv, coded->second_dest)) {
16121613 source = coded->second_source;
16131614 packet_id = coded->second_crc;
16141615 } else {
@@ -1675,12 +1676,12 @@ static int batadv_nc_recv_coded_packet(struct sk_buff *skb, · 60 unmodified lines
16751676 ethhdr = (struct ethhdr *)skb_mac_header(skb);
16761677
16771678 /* Verify frame is destined for us */
1678− if (!batadv_is_my_mac(ethhdr->h_dest) &&
1679− !batadv_is_my_mac(coded_packet->second_dest))
1679+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest) &&
1680+ !batadv_is_my_mac(bat_priv, coded_packet->second_dest))
16801681 return NET_RX_DROP;
16811682
16821683 /* Update stat counter */
1683− if (batadv_is_my_mac(coded_packet->second_dest))
1684+ if (batadv_is_my_mac(bat_priv, coded_packet->second_dest))
16841685 batadv_inc_counter(bat_priv, BATADV_CNT_NC_SNIFFED);
16851686
16861687 nc_packet = batadv_nc_find_decoding_packet(bat_priv, ethhdr,
@@ -1698,7 +1699,7 @@ static int batadv_nc_recv_coded_packet(struct sk_buff *skb, · 11 unmodified lines
16981699 goto free_nc_packet;
16991700
17001701 /* Decode the packet */
1701− unicast_packet = batadv_nc_skb_decode_packet(skb, nc_packet);
1702+ unicast_packet = batadv_nc_skb_decode_packet(bat_priv, skb, nc_packet);
17021703 if (!unicast_packet) {
17031704 batadv_inc_counter(bat_priv, BATADV_CNT_NC_DECODE_FAILED);
17041705 goto free_nc_packet;
net/batman-adv/routing.c+21−18
@@ -403,7 +403,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, · 402 unmodified lines
403403 goto out;
404404
405405 /* not for me */
406− if (!batadv_is_my_mac(ethhdr->h_dest))
406+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
407407 goto out;
408408
409409 icmp_packet = (struct batadv_icmp_packet_rr *)skb->data;
@@ -417,7 +417,7 @@ int batadv_recv_icmp_packet(struct sk_buff *skb, · 7 unmodified lines
417417 }
418418
419419 /* packet for me */
420− if (batadv_is_my_mac(icmp_packet->dst))
420+ if (batadv_is_my_mac(bat_priv, icmp_packet->dst))
421421 return batadv_recv_my_icmp_packet(bat_priv, skb, hdr_size);
422422
423423 /* TTL exceeded */
@@ -551,6 +551,7 @@ batadv_find_ifalter_router(struct batadv_orig_node *primary_orig, · 127 unmodified lines
551551
552552 /**
553553 * batadv_check_unicast_packet - Check for malformed unicast packets
554+ * @bat_priv: the bat priv with all the soft interface information
554555 * @skb: packet to check
555556 * @hdr_size: size of header to pull
556557 *
@@ -559,7 +560,8 @@ batadv_find_ifalter_router(struct batadv_orig_node *primary_orig, · 2 unmodified lines
559560 * reason: -ENODATA for bad header, -EBADR for broadcast destination or source,
560561 * and -EREMOTE for non-local (other host) destination.
561562 */
562−static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
563+static int batadv_check_unicast_packet(struct batadv_priv *bat_priv,
564+ struct sk_buff *skb, int hdr_size)
563565 {
564566 struct ethhdr *ethhdr;
565567
@@ -578,7 +580,7 @@ static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size) · 12 unmodified lines
578580 return -EBADR;
579581
580582 /* not for me */
581− if (!batadv_is_my_mac(ethhdr->h_dest))
583+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
582584 return -EREMOTE;
583585
584586 return 0;
@@ -593,7 +595,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct batadv_hard_iface *recv_if) · 8 unmodified lines
593595 char tt_flag;
594596 size_t packet_size;
595597
596− if (batadv_check_unicast_packet(skb, hdr_size) < 0)
598+ if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
597599 return NET_RX_DROP;
598600
599601 /* I could need to modify it */
@@ -625,7 +627,7 @@ int batadv_recv_tt_query(struct sk_buff *skb, struct batadv_hard_iface *recv_if) · 25 unmodified lines
625627 case BATADV_TT_RESPONSE:
626628 batadv_inc_counter(bat_priv, BATADV_CNT_TT_RESPONSE_RX);
627629
628− if (batadv_is_my_mac(tt_query->dst)) {
630+ if (batadv_is_my_mac(bat_priv, tt_query->dst)) {
629631 /* packet needs to be linearized to access the TT
630632 * changes
631633 */
@@ -668,14 +670,15 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct batadv_hard_iface *recv_if) · 36 unmodified lines
668670 struct batadv_roam_adv_packet *roam_adv_packet;
669671 struct batadv_orig_node *orig_node;
670672
671− if (batadv_check_unicast_packet(skb, sizeof(*roam_adv_packet)) < 0)
673+ if (batadv_check_unicast_packet(bat_priv, skb,
674+ sizeof(*roam_adv_packet)) < 0)
672675 goto out;
673676
674677 batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
675678
676679 roam_adv_packet = (struct batadv_roam_adv_packet *)skb->data;
677680
678− if (!batadv_is_my_mac(roam_adv_packet->dst))
681+ if (!batadv_is_my_mac(bat_priv, roam_adv_packet->dst))
679682 return batadv_route_unicast_packet(skb, recv_if);
680683
681684 /* check if it is a backbone gateway. we don't accept
@@ -981,7 +984,7 @@ static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv, · 299 unmodified lines
981984 * last time) the packet had an updated information or not
982985 */
983986 curr_ttvn = (uint8_t)atomic_read(&bat_priv->tt.vn);
984− if (!batadv_is_my_mac(unicast_packet->dest)) {
987+ if (!batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
985988 orig_node = batadv_orig_hash_find(bat_priv,
986989 unicast_packet->dest);
987990 /* if it is not possible to find the orig_node representing the
@@ -1059,7 +1062,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, · 71 unmodified lines
10591062 hdr_size = sizeof(*unicast_4addr_packet);
10601063
10611064 /* function returns -EREMOTE for promiscuous packets */
1062− check = batadv_check_unicast_packet(skb, hdr_size);
1065+ check = batadv_check_unicast_packet(bat_priv, skb, hdr_size);
10631066
10641067 /* Even though the packet is not for us, we might save it to use for
10651068 * decoding a later received coded packet
@@ -1074,7 +1077,7 @@ int batadv_recv_unicast_packet(struct sk_buff *skb, · 8 unmodified lines
10741077 return NET_RX_DROP;
10751078
10761079 /* packet for me */
1077− if (batadv_is_my_mac(unicast_packet->dest)) {
1080+ if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
10781081 if (is4addr) {
10791082 batadv_dat_inc_counter(bat_priv,
10801083 unicast_4addr_packet->subtype);
@@ -1111,7 +1114,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb, · 30 unmodified lines
11111114 struct sk_buff *new_skb = NULL;
11121115 int ret;
11131116
1114− if (batadv_check_unicast_packet(skb, hdr_size) < 0)
1117+ if (batadv_check_unicast_packet(bat_priv, skb, hdr_size) < 0)
11151118 return NET_RX_DROP;
11161119
11171120 if (!batadv_check_unicast_ttvn(bat_priv, skb))
@@ -1120,7 +1123,7 @@ int batadv_recv_ucast_frag_packet(struct sk_buff *skb, · 2 unmodified lines
11201123 unicast_packet = (struct batadv_unicast_frag_packet *)skb->data;
11211124
11221125 /* packet for me */
1123− if (batadv_is_my_mac(unicast_packet->dest)) {
1126+ if (batadv_is_my_mac(bat_priv, unicast_packet->dest)) {
11241127 ret = batadv_frag_reassemble_skb(skb, bat_priv, &new_skb);
11251128
11261129 if (ret == NET_RX_DROP)
@@ -1174,13 +1177,13 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, · 47 unmodified lines
11741177 goto out;
11751178
11761179 /* ignore broadcasts sent by myself */
1177− if (batadv_is_my_mac(ethhdr->h_source))
1180+ if (batadv_is_my_mac(bat_priv, ethhdr->h_source))
11781181 goto out;
11791182
11801183 bcast_packet = (struct batadv_bcast_packet *)skb->data;
11811184
11821185 /* ignore broadcasts originated by myself */
1183− if (batadv_is_my_mac(bcast_packet->orig))
1186+ if (batadv_is_my_mac(bat_priv, bcast_packet->orig))
11841187 goto out;
11851188
11861189 if (bcast_packet->header.ttl < 2)
@@ -1266,14 +1269,14 @@ int batadv_recv_vis_packet(struct sk_buff *skb, · 79 unmodified lines
12661269 ethhdr = (struct ethhdr *)skb_mac_header(skb);
12671270
12681271 /* not for me */
1269− if (!batadv_is_my_mac(ethhdr->h_dest))
1272+ if (!batadv_is_my_mac(bat_priv, ethhdr->h_dest))
12701273 return NET_RX_DROP;
12711274
12721275 /* ignore own packets */
1273− if (batadv_is_my_mac(vis_packet->vis_orig))
1276+ if (batadv_is_my_mac(bat_priv, vis_packet->vis_orig))
12741277 return NET_RX_DROP;
12751278
1276− if (batadv_is_my_mac(vis_packet->sender_orig))
1279+ if (batadv_is_my_mac(bat_priv, vis_packet->sender_orig))
12771280 return NET_RX_DROP;
12781281
12791282 switch (vis_packet->vis_type) {
net/batman-adv/translation-table.c+1−1
@@ -1940,7 +1940,7 @@ out: · 1939 unmodified lines
19401940 bool batadv_send_tt_response(struct batadv_priv *bat_priv,
19411941 struct batadv_tt_query_packet *tt_request)
19421942 {
1943− if (batadv_is_my_mac(tt_request->dst)) {
1943+ if (batadv_is_my_mac(bat_priv, tt_request->dst)) {
19441944 /* don't answer backbone gws! */
19451945 if (batadv_bla_is_backbone_gw_orig(bat_priv, tt_request->src))
19461946 return true;
net/batman-adv/vis.c+2−2
@@ -477,7 +477,7 @@ void batadv_receive_client_update_packet(struct batadv_priv *bat_priv, · 476 unmodified lines
477477
478478 /* Are we the target for this VIS packet? */
479479 if (vis_server == BATADV_VIS_TYPE_SERVER_SYNC &&
480− batadv_is_my_mac(vis_packet->target_orig))
480+ batadv_is_my_mac(bat_priv, vis_packet->target_orig))
481481 are_target = 1;
482482
483483 spin_lock_bh(&bat_priv->vis.hash_lock);
@@ -496,7 +496,7 @@ void batadv_receive_client_update_packet(struct batadv_priv *bat_priv, · 12 unmodified lines
496496 batadv_send_list_add(bat_priv, info);
497497
498498 /* ... we're not the recipient (and thus need to forward). */
499− } else if (!batadv_is_my_mac(packet->target_orig)) {
499+ } else if (!batadv_is_my_mac(bat_priv, packet->target_orig)) {
500500 batadv_send_list_add(bat_priv, info);
501501 }
502502
net/bridge/br_if.c+2−1
@@ -67,7 +67,8 @@ void br_port_carrier_check(struct net_bridge_port *p) · 66 unmodified lines
6767 struct net_device *dev = p->dev;
6868 struct net_bridge *br = p->br;
6969
70− if (netif_running(dev) && netif_oper_up(dev))
70+ if (!(p->flags & BR_ADMIN_COST) &&
71+ netif_running(dev) && netif_oper_up(dev))
7172 p->path_cost = port_cost(dev);
7273
7374 if (!netif_running(br->dev))
net/bridge/br_private.h+1−0
@@ -156,6 +156,7 @@ struct net_bridge_port · 155 unmodified lines
156156 #define BR_BPDU_GUARD 0x00000002
157157 #define BR_ROOT_BLOCK 0x00000004
158158 #define BR_MULTICAST_FAST_LEAVE 0x00000008
159+#define BR_ADMIN_COST 0x00000010
159160
160161 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
161162 u32 multicast_startup_queries_sent;
net/bridge/br_stp_if.c+1−0
@@ -288,6 +288,7 @@ int br_stp_set_path_cost(struct net_bridge_port *p, unsigned long path_cost) · 287 unmodified lines
288288 path_cost > BR_MAX_PATH_COST)
289289 return -ERANGE;
290290
291+ p->flags |= BR_ADMIN_COST;
291292 p->path_cost = path_cost;
292293 br_configuration_update(p->br);
293294 br_port_state_selection(p->br);
net/can/gw.c+3−3
@@ -466,7 +466,7 @@ static int cgw_notifier(struct notifier_block *nb, · 465 unmodified lines
466466 if (gwj->src.dev == dev || gwj->dst.dev == dev) {
467467 hlist_del(&gwj->list);
468468 cgw_unregister_filter(gwj);
469− kfree(gwj);
469+ kmem_cache_free(cgw_cache, gwj);
470470 }
471471 }
472472 }
@@ -863,7 +863,7 @@ static void cgw_remove_all_jobs(void) · 390 unmodified lines
863863 hlist_for_each_entry_safe(gwj, nx, &cgw_list, list) {
864864 hlist_del(&gwj->list);
865865 cgw_unregister_filter(gwj);
866− kfree(gwj);
866+ kmem_cache_free(cgw_cache, gwj);
867867 }
868868 }
869869
@@ -919,7 +919,7 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh) · 49 unmodified lines
919919
920920 hlist_del(&gwj->list);
921921 cgw_unregister_filter(gwj);
922− kfree(gwj);
922+ kmem_cache_free(cgw_cache, gwj);
923923 err = 0;
924924 break;
925925 }
net/core/dev.c+3−0
@@ -2146,6 +2146,9 @@ static void skb_warn_bad_offload(const struct sk_buff *skb) · 2145 unmodified lines
21462146 struct net_device *dev = skb->dev;
21472147 const char *driver = "";
21482148
2149+ if (!net_ratelimit())
2150+ return;
2151+
21492152 if (dev && dev->dev.parent)
21502153 driver = dev_driver_string(dev->dev.parent);
21512154
net/core/rtnetlink.c+2−2
@@ -1046,7 +1046,7 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) · 1045 unmodified lines
10461046 rcu_read_lock();
10471047 cb->seq = net->dev_base_seq;
10481048
1049− if (nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
1049+ if (nlmsg_parse(cb->nlh, sizeof(struct ifinfomsg), tb, IFLA_MAX,
10501050 ifla_policy) >= 0) {
10511051
10521052 if (tb[IFLA_EXT_MASK])
@@ -1896,7 +1896,7 @@ static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh) · 843 unmodified lines
18961896 u32 ext_filter_mask = 0;
18971897 u16 min_ifinfo_dump_size = 0;
18981898
1899− if (nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
1899+ if (nlmsg_parse(nlh, sizeof(struct ifinfomsg), tb, IFLA_MAX,
19001900 ifla_policy) >= 0) {
19011901 if (tb[IFLA_EXT_MASK])
19021902 ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
net/ipv4/devinet.c+44−16
@@ -587,13 +587,16 @@ static void check_lifetime(struct work_struct *work) · 586 unmodified lines
587587 {
588588 unsigned long now, next, next_sec, next_sched;
589589 struct in_ifaddr *ifa;
590+ struct hlist_node *n;
590591 int i;
591592
592593 now = jiffies;
593594 next = round_jiffies_up(now + ADDR_CHECK_FREQUENCY);
594595
595− rcu_read_lock();
596596 for (i = 0; i < IN4_ADDR_HSIZE; i++) {
597+ bool change_needed = false;
598+
599+ rcu_read_lock();
597600 hlist_for_each_entry_rcu(ifa, &inet_addr_lst[i], hash) {
598601 unsigned long age;
599602
@@ -606,16 +609,7 @@ static void check_lifetime(struct work_struct *work) · 6 unmodified lines
606609
607610 if (ifa->ifa_valid_lft != INFINITY_LIFE_TIME &&
608611 age >= ifa->ifa_valid_lft) {
609− struct in_ifaddr **ifap ;
610−
611− rtnl_lock();
612− for (ifap = &ifa->ifa_dev->ifa_list;
613− *ifap != NULL; ifap = &ifa->ifa_next) {
614− if (*ifap == ifa)
615− inet_del_ifa(ifa->ifa_dev,
616− ifap, 1);
617− }
618− rtnl_unlock();
612+ change_needed = true;
619613 } else if (ifa->ifa_preferred_lft ==
620614 INFINITY_LIFE_TIME) {
621615 continue;
@@ -625,10 +619,8 @@ static void check_lifetime(struct work_struct *work) · 3 unmodified lines
625619 next = ifa->ifa_tstamp +
626620 ifa->ifa_valid_lft * HZ;
627621
628− if (!(ifa->ifa_flags & IFA_F_DEPRECATED)) {
629− ifa->ifa_flags |= IFA_F_DEPRECATED;
630− rtmsg_ifa(RTM_NEWADDR, ifa, NULL, 0);
631− }
622+ if (!(ifa->ifa_flags & IFA_F_DEPRECATED))
623+ change_needed = true;
632624 } else if (time_before(ifa->ifa_tstamp +
633625 ifa->ifa_preferred_lft * HZ,
634626 next)) {
@@ -636,8 +628,42 @@ static void check_lifetime(struct work_struct *work) · 1 unmodified line
636628 ifa->ifa_preferred_lft * HZ;
637629 }
638630 }
631+ rcu_read_unlock();
632+ if (!change_needed)
633+ continue;
634+ rtnl_lock();
635+ hlist_for_each_entry_safe(ifa, n, &inet_addr_lst[i], hash) {
636+ unsigned long age;
637+
638+ if (ifa->ifa_flags & IFA_F_PERMANENT)
639+ continue;
640+
641+ /* We try to batch several events at once. */
642+ age = (now - ifa->ifa_tstamp +
643+ ADDRCONF_TIMER_FUZZ_MINUS) / HZ;
644+
645+ if (ifa->ifa_valid_lft != INFINITY_LIFE_TIME &&
646+ age >= ifa->ifa_valid_lft) {
647+ struct in_ifaddr **ifap;
648+
649+ for (ifap = &ifa->ifa_dev->ifa_list;
650+ *ifap != NULL; ifap = &(*ifap)->ifa_next) {
651+ if (*ifap == ifa) {
652+ inet_del_ifa(ifa->ifa_dev,
653+ ifap, 1);
654+ break;
655+ }
656+ }
657+ } else if (ifa->ifa_preferred_lft !=
658+ INFINITY_LIFE_TIME &&
659+ age >= ifa->ifa_preferred_lft &&
660+ !(ifa->ifa_flags & IFA_F_DEPRECATED)) {
661+ ifa->ifa_flags |= IFA_F_DEPRECATED;
662+ rtmsg_ifa(RTM_NEWADDR, ifa, NULL, 0);
663+ }
664+ }
665+ rtnl_unlock();
639666 }
640− rcu_read_unlock();
641667
642668 next_sec = round_jiffies_up(next);
643669 next_sched = next;
@@ -804,6 +830,8 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh) · 160 unmodified lines
804830 return -EEXIST;
805831 ifa = ifa_existing;
806832 set_ifa_lifetime(ifa, valid_lft, prefered_lft);
833+ cancel_delayed_work(&check_lifetime_work);
834+ schedule_delayed_work(&check_lifetime_work, 0);
807835 rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid);
808836 blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa);
809837 }
net/ipv4/esp4.c+3−3
@@ -139,8 +139,6 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) · 138 unmodified lines
139139
140140 /* skb is pure payload to encrypt */
141141
142− err = -ENOMEM;
143−
144142 esp = x->data;
145143 aead = esp->aead;
146144 alen = crypto_aead_authsize(aead);
@@ -176,8 +174,10 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) · 29 unmodified lines
176174 }
177175
178176 tmp = esp_alloc_tmp(aead, nfrags + sglists, seqhilen);
179− if (!tmp)
177+ if (!tmp) {
178+ err = -ENOMEM;
180179 goto error;
180+ }
181181
182182 seqhi = esp_tmp_seqhi(tmp);
183183 iv = esp_tmp_iv(aead, tmp, seqhilen);
net/ipv4/ip_fragment.c+10−4
@@ -219,8 +219,7 @@ static void ip_expire(unsigned long arg) · 218 unmodified lines
219219 if (!head->dev)
220220 goto out_rcu_unlock;
221221
222− /* skb dst is stale, drop it, and perform route lookup again */
223− skb_dst_drop(head);
222+ /* skb has no dst, perform route lookup again */
224223 iph = ip_hdr(head);
225224 err = ip_route_input_noref(head, iph->daddr, iph->saddr,
226225 iph->tos, head->dev);
@@ -494,9 +493,16 @@ found: · 267 unmodified lines
494493 qp->q.max_size = skb->len + ihl;
495494
496495 if (qp->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
497− qp->q.meat == qp->q.len)
498− return ip_frag_reasm(qp, prev, dev);
496+ qp->q.meat == qp->q.len) {
497+ unsigned long orefdst = skb->_skb_refdst;
499498
499+ skb->_skb_refdst = 0UL;
500+ err = ip_frag_reasm(qp, prev, dev);
501+ skb->_skb_refdst = orefdst;
502+ return err;
503+ }
504+
505+ skb_dst_drop(skb);
500506 inet_frag_lru_move(&qp->q);
501507 return -EINPROGRESS;
502508
net/ipv4/netfilter/ipt_rpfilter.c+7−1
@@ -66,6 +66,12 @@ static bool rpfilter_lookup_reverse(struct flowi4 *fl4, · 65 unmodified lines
6666 return dev_match;
6767 }
6868
69+static bool rpfilter_is_local(const struct sk_buff *skb)
70+{
71+ const struct rtable *rt = skb_rtable(skb);
72+ return rt && (rt->rt_flags & RTCF_LOCAL);
73+}
74+
6975 static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par)
7076 {
7177 const struct xt_rpfilter_info *info;
@@ -76,7 +82,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par) · 4 unmodified lines
7682 info = par->matchinfo;
7783 invert = info->flags & XT_RPFILTER_INVERT;
7884
79− if (par->in->flags & IFF_LOOPBACK)
85+ if (rpfilter_is_local(skb))
8086 return true ^ invert;
8187
8288 iph = ip_hdr(skb);
net/ipv4/syncookies.c+2−2
@@ -348,8 +348,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, · 347 unmodified lines
348348 * hasn't changed since we received the original syn, but I see
349349 * no easy way to do this.
350350 */
351− flowi4_init_output(&fl4, 0, sk->sk_mark, RT_CONN_FLAGS(sk),
352− RT_SCOPE_UNIVERSE, IPPROTO_TCP,
351+ flowi4_init_output(&fl4, sk->sk_bound_dev_if, sk->sk_mark,
352+ RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE, IPPROTO_TCP,
353353 inet_sk_flowi_flags(sk),
354354 (opt && opt->srr) ? opt->faddr : ireq->rmt_addr,
355355 ireq->loc_addr, th->source, th->dest);
net/ipv4/tcp_input.c+31−33
@@ -111,6 +111,7 @@ int sysctl_tcp_early_retrans __read_mostly = 3; · 110 unmodified lines
111111 #define FLAG_SND_UNA_ADVANCED 0x400 /* Snd_una was changed (!= FLAG_DATA_ACKED) */
112112 #define FLAG_DSACKING_ACK 0x800 /* SACK blocks contained D-SACK info */
113113 #define FLAG_SACK_RENEGING 0x2000 /* snd_una advanced to a sacked seq */
114+#define FLAG_UPDATE_TS_RECENT 0x4000 /* tcp_replace_ts_recent() */
114115
115116 #define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED)
116117 #define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
@@ -3265,6 +3266,27 @@ static void tcp_send_challenge_ack(struct sock *sk) · 3148 unmodified lines
32653266 }
32663267 }
32673268
3269+static void tcp_store_ts_recent(struct tcp_sock *tp)
3270+{
3271+ tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval;
3272+ tp->rx_opt.ts_recent_stamp = get_seconds();
3273+}
3274+
3275+static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq)
3276+{
3277+ if (tp->rx_opt.saw_tstamp && !after(seq, tp->rcv_wup)) {
3278+ /* PAWS bug workaround wrt. ACK frames, the PAWS discard
3279+ * extra check below makes sure this can only happen
3280+ * for pure ACK frames. -DaveM
3281+ *
3282+ * Not only, also it occurs for expired timestamps.
3283+ */
3284+
3285+ if (tcp_paws_check(&tp->rx_opt, 0))
3286+ tcp_store_ts_recent(tp);
3287+ }
3288+}
3289+
32683290 /* This routine deals with acks during a TLP episode.
32693291 * Ref: loss detection algorithm in draft-dukkipati-tcpm-tcp-loss-probe.
32703292 */
@@ -3340,6 +3362,12 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) · 69 unmodified lines
33403362 prior_fackets = tp->fackets_out;
33413363 prior_in_flight = tcp_packets_in_flight(tp);
33423364
3365+ /* ts_recent update must be made after we are sure that the packet
3366+ * is in window.
3367+ */
3368+ if (flag & FLAG_UPDATE_TS_RECENT)
3369+ tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
3370+
33433371 if (!(flag & FLAG_SLOWPATH) && after(ack, prior_snd_una)) {
33443372 /* Window is constant, pure forward advance.
33453373 * No more checks are required.
@@ -3636,27 +3664,6 @@ const u8 *tcp_parse_md5sig_option(const struct tcphdr *th) · 290 unmodified lines
36363664 EXPORT_SYMBOL(tcp_parse_md5sig_option);
36373665 #endif
36383666
3639−static inline void tcp_store_ts_recent(struct tcp_sock *tp)
3640−{
3641− tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval;
3642− tp->rx_opt.ts_recent_stamp = get_seconds();
3643−}
3644−
3645−static inline void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq)
3646−{
3647− if (tp->rx_opt.saw_tstamp && !after(seq, tp->rcv_wup)) {
3648− /* PAWS bug workaround wrt. ACK frames, the PAWS discard
3649− * extra check below makes sure this can only happen
3650− * for pure ACK frames. -DaveM
3651− *
3652− * Not only, also it occurs for expired timestamps.
3653− */
3654−
3655− if (tcp_paws_check(&tp->rx_opt, 0))
3656− tcp_store_ts_recent(tp);
3657− }
3658−}
3659−
36603667 /* Sorry, PAWS as specified is broken wrt. pure-ACKs -DaveM
36613668 *
36623669 * It is not fatal. If this ACK does _not_ change critical state (seqs, window)
@@ -5250,14 +5257,9 @@ slow_path: · 1587 unmodified lines
52505257 return 0;
52515258
52525259 step5:
5253− if (tcp_ack(sk, skb, FLAG_SLOWPATH) < 0)
5260+ if (tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT) < 0)
52545261 goto discard;
52555262
5256− /* ts_recent update must be made after we are sure that the packet
5257− * is in window.
5258− */
5259− tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
5260−
52615263 tcp_rcv_rtt_measure_ts(sk, skb);
52625264
52635265 /* Process urgent data. */
@@ -5666,7 +5668,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, · 402 unmodified lines
56665668
56675669 /* step 5: check the ACK field */
56685670 if (true) {
5669− int acceptable = tcp_ack(sk, skb, FLAG_SLOWPATH) > 0;
5671+ int acceptable = tcp_ack(sk, skb, FLAG_SLOWPATH |
5672+ FLAG_UPDATE_TS_RECENT) > 0;
56705673
56715674 switch (sk->sk_state) {
56725675 case TCP_SYN_RECV:
@@ -5817,11 +5820,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, · 144 unmodified lines
58175820 }
58185821 }
58195822
5820− /* ts_recent update must be made after we are sure that the packet
5821− * is in window.
5822− */
5823− tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
5824−
58255823 /* step 6: check the URG bit */
58265824 tcp_urg(sk, skb, th);
58275825
net/ipv4/tcp_output.c+7−2
@@ -2353,8 +2353,12 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) · 2352 unmodified lines
23532353 */
23542354 TCP_SKB_CB(skb)->when = tcp_time_stamp;
23552355
2356− /* make sure skb->data is aligned on arches that require it */
2357− if (unlikely(NET_IP_ALIGN && ((unsigned long)skb->data & 3))) {
2356+ /* make sure skb->data is aligned on arches that require it
2357+ * and check if ack-trimming & collapsing extended the headroom
2358+ * beyond what csum_start can cover.
2359+ */
2360+ if (unlikely((NET_IP_ALIGN && ((unsigned long)skb->data & 3)) ||
2361+ skb_headroom(skb) >= 0xFFFF)) {
23582362 struct sk_buff *nskb = __pskb_copy(skb, MAX_TCP_HEADER,
23592363 GFP_ATOMIC);
23602364 return nskb ? tcp_transmit_skb(sk, nskb, 0, GFP_ATOMIC) :
@@ -2666,6 +2670,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, · 305 unmodified lines
26662670 skb_reserve(skb, MAX_TCP_HEADER);
26672671
26682672 skb_dst_set(skb, dst);
2673+ security_skb_owned_by(skb, sk);
26692674
26702675 mss = dst_metric_advmss(dst);
26712676 if (tp->rx_opt.user_mss && tp->rx_opt.user_mss < mss)
net/ipv6/addrconf.c+3−21
@@ -169,8 +169,6 @@ static void inet6_prefix_notify(int event, struct inet6_dev *idev, · 168 unmodified lines
169169 static bool ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr,
170170 struct net_device *dev);
171171
172−static ATOMIC_NOTIFIER_HEAD(inet6addr_chain);
173−
174172 static struct ipv6_devconf ipv6_devconf __read_mostly = {
175173 .forwarding = 0,
176174 .hop_limit = IPV6_DEFAULT_HOPLIMIT,
@@ -910,7 +908,7 @@ out2: · 733 unmodified lines
910908 rcu_read_unlock_bh();
911909
912910 if (likely(err == 0))
913− atomic_notifier_call_chain(&inet6addr_chain, NETDEV_UP, ifa);
911+ inet6addr_notifier_call_chain(NETDEV_UP, ifa);
914912 else {
915913 kfree(ifa);
916914 ifa = ERR_PTR(err);
@@ -1000,7 +998,7 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) · 83 unmodified lines
1000998
1001999 ipv6_ifa_notify(RTM_DELADDR, ifp);
10021000
1003− atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifp);
1001+ inet6addr_notifier_call_chain(NETDEV_DOWN, ifp);
10041002
10051003 /*
10061004 * Purge or update corresponding prefix
@@ -3087,7 +3085,7 @@ static int addrconf_ifdown(struct net_device *dev, int how) · 2080 unmodified lines
30873085
30883086 if (state != INET6_IFADDR_STATE_DEAD) {
30893087 __ipv6_ifa_notify(RTM_DELADDR, ifa);
3090− atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa);
3088+ inet6addr_notifier_call_chain(NETDEV_DOWN, ifa);
30913089 }
30923090 in6_ifa_put(ifa);
30933091
@@ -5054,22 +5052,6 @@ static struct pernet_operations addrconf_ops = { · 1960 unmodified lines
50545052 .exit = addrconf_exit_net,
50555053 };
50565054
5057−/*
5058− * Device notifier
5059− */
5060−
5061−int register_inet6addr_notifier(struct notifier_block *nb)
5062−{
5063− return atomic_notifier_chain_register(&inet6addr_chain, nb);
5064−}
5065−EXPORT_SYMBOL(register_inet6addr_notifier);
5066−
5067−int unregister_inet6addr_notifier(struct notifier_block *nb)
5068−{
5069− return atomic_notifier_chain_unregister(&inet6addr_chain, nb);
5070−}
5071−EXPORT_SYMBOL(unregister_inet6addr_notifier);
5072−
50735055 static struct rtnl_af_ops inet6_ops = {
50745056 .family = AF_INET6,
50755057 .fill_link_af = inet6_fill_link_af,
net/ipv6/addrconf_core.c+19−0
@@ -78,3 +78,22 @@ int __ipv6_addr_type(const struct in6_addr *addr) · 77 unmodified lines
7878 }
7979 EXPORT_SYMBOL(__ipv6_addr_type);
8080
81+static ATOMIC_NOTIFIER_HEAD(inet6addr_chain);
82+
83+int register_inet6addr_notifier(struct notifier_block *nb)
84+{
85+ return atomic_notifier_chain_register(&inet6addr_chain, nb);
86+}
87+EXPORT_SYMBOL(register_inet6addr_notifier);
88+
89+int unregister_inet6addr_notifier(struct notifier_block *nb)
90+{
91+ return atomic_notifier_chain_unregister(&inet6addr_chain, nb);
92+}
93+EXPORT_SYMBOL(unregister_inet6addr_notifier);
94+
95+int inet6addr_notifier_call_chain(unsigned long val, void *v)
96+{
97+ return atomic_notifier_call_chain(&inet6addr_chain, val, v);
98+}
99+EXPORT_SYMBOL(inet6addr_notifier_call_chain);
net/ipv6/netfilter/ip6t_rpfilter.c+7−1
@@ -71,6 +71,12 @@ static bool rpfilter_lookup_reverse6(const struct sk_buff *skb, · 70 unmodified lines
7171 return ret;
7272 }
7373
74+static bool rpfilter_is_local(const struct sk_buff *skb)
75+{
76+ const struct rt6_info *rt = (const void *) skb_dst(skb);
77+ return rt && (rt->rt6i_flags & RTF_LOCAL);
78+}
79+
7480 static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par)
7581 {
7682 const struct xt_rpfilter_info *info = par->matchinfo;
@@ -78,7 +84,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par) · 1 unmodified line
7884 struct ipv6hdr *iph;
7985 bool invert = info->flags & XT_RPFILTER_INVERT;
8086
81− if (par->in->flags & IFF_LOOPBACK)
87+ if (rpfilter_is_local(skb))
8288 return true ^ invert;
8389
8490 iph = ipv6_hdr(skb);
net/ipv6/reassembly.c+10−2
@@ -342,9 +342,17 @@ found: · 341 unmodified lines
342342 }
343343
344344 if (fq->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
345− fq->q.meat == fq->q.len)
346− return ip6_frag_reasm(fq, prev, dev);
345+ fq->q.meat == fq->q.len) {
346+ int res;
347+ unsigned long orefdst = skb->_skb_refdst;
348+
349+ skb->_skb_refdst = 0UL;
350+ res = ip6_frag_reasm(fq, prev, dev);
351+ skb->_skb_refdst = orefdst;
352+ return res;
353+ }
347354
355+ skb_dst_drop(skb);
348356 inet_frag_lru_move(&fq->q);
349357 return -1;
350358
net/irda/iriap.c+2−1
@@ -303,7 +303,8 @@ static void iriap_disconnect_indication(void *instance, void *sap, · 302 unmodified lines
303303 {
304304 struct iriap_cb *self;
305305
306− IRDA_DEBUG(4, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]);
306+ IRDA_DEBUG(4, "%s(), reason=%s [%d]\n", __func__,
307+ irlmp_reason_str(reason), reason);
307308
308309 self = instance;
309310
net/irda/irlmp.c+9−1
@@ -66,8 +66,15 @@ const char *irlmp_reasons[] = { · 65 unmodified lines
6666 "LM_LAP_RESET",
6767 "LM_INIT_DISCONNECT",
6868 "ERROR, NOT USED",
69+ "UNKNOWN",
6970 };
7071
72+const char *irlmp_reason_str(LM_REASON reason)
73+{
74+ reason = min_t(size_t, reason, ARRAY_SIZE(irlmp_reasons) - 1);
75+ return irlmp_reasons[reason];
76+}
77+
7178 /*
7279 * Function irlmp_init (void)
7380 *
@@ -747,7 +754,8 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason, · 673 unmodified lines
747754 {
748755 struct lsap_cb *lsap;
749756
750− IRDA_DEBUG(1, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]);
757+ IRDA_DEBUG(1, "%s(), reason=%s [%d]\n", __func__,
758+ irlmp_reason_str(reason), reason);
751759 IRDA_ASSERT(self != NULL, return;);
752760 IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);
753761
net/iucv/af_iucv.c+16−18
@@ -49,12 +49,6 @@ static const u8 iprm_shutdown[8] = · 48 unmodified lines
4949
5050 #define TRGCLS_SIZE (sizeof(((struct iucv_message *)0)->class))
5151
52−/* macros to set/get socket control buffer at correct offset */
53−#define CB_TAG(skb) ((skb)->cb) /* iucv message tag */
54−#define CB_TAG_LEN (sizeof(((struct iucv_message *) 0)->tag))
55−#define CB_TRGCLS(skb) ((skb)->cb + CB_TAG_LEN) /* iucv msg target class */
56−#define CB_TRGCLS_LEN (TRGCLS_SIZE)
57−
5852 #define __iucv_sock_wait(sk, condition, timeo, ret) \
5953 do { \
6054 DEFINE_WAIT(__wait); \
@@ -1141,7 +1135,7 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock, · 1080 unmodified lines
11411135
11421136 /* increment and save iucv message tag for msg_completion cbk */
11431137 txmsg.tag = iucv->send_tag++;
1144− memcpy(CB_TAG(skb), &txmsg.tag, CB_TAG_LEN);
1138+ IUCV_SKB_CB(skb)->tag = txmsg.tag;
11451139
11461140 if (iucv->transport == AF_IUCV_TRANS_HIPER) {
11471141 atomic_inc(&iucv->msg_sent);
@@ -1224,7 +1218,7 @@ static int iucv_fragment_skb(struct sock *sk, struct sk_buff *skb, int len) · 76 unmodified lines
12241218 return -ENOMEM;
12251219
12261220 /* copy target class to control buffer of new skb */
1227− memcpy(CB_TRGCLS(nskb), CB_TRGCLS(skb), CB_TRGCLS_LEN);
1221+ IUCV_SKB_CB(nskb)->class = IUCV_SKB_CB(skb)->class;
12281222
12291223 /* copy data fragment */
12301224 memcpy(nskb->data, skb->data + copied, size);
@@ -1256,7 +1250,7 @@ static void iucv_process_message(struct sock *sk, struct sk_buff *skb, · 25 unmodified lines
12561250
12571251 /* store msg target class in the second 4 bytes of skb ctrl buffer */
12581252 /* Note: the first 4 bytes are reserved for msg tag */
1259− memcpy(CB_TRGCLS(skb), &msg->class, CB_TRGCLS_LEN);
1253+ IUCV_SKB_CB(skb)->class = msg->class;
12601254
12611255 /* check for special IPRM messages (e.g. iucv_sock_shutdown) */
12621256 if ((msg->flags & IUCV_IPRMDATA) && len > 7) {
@@ -1292,6 +1286,7 @@ static void iucv_process_message(struct sock *sk, struct sk_buff *skb, · 29 unmodified lines
12921286 }
12931287 }
12941288
1289+ IUCV_SKB_CB(skb)->offset = 0;
12951290 if (sock_queue_rcv_skb(sk, skb))
12961291 skb_queue_head(&iucv_sk(sk)->backlog_skb_q, skb);
12971292 }
@@ -1327,6 +1322,7 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, · 29 unmodified lines
13271322 unsigned int copied, rlen;
13281323 struct sk_buff *skb, *rskb, *cskb;
13291324 int err = 0;
1325+ u32 offset;
13301326
13311327 msg->msg_namelen = 0;
13321328
@@ -1348,13 +1344,14 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, · 15 unmodified lines
13481344 return err;
13491345 }
13501346
1351− rlen = skb->len; /* real length of skb */
1347+ offset = IUCV_SKB_CB(skb)->offset;
1348+ rlen = skb->len - offset; /* real length of skb */
13521349 copied = min_t(unsigned int, rlen, len);
13531350 if (!rlen)
13541351 sk->sk_shutdown = sk->sk_shutdown | RCV_SHUTDOWN;
13551352
13561353 cskb = skb;
1357− if (skb_copy_datagram_iovec(cskb, 0, msg->msg_iov, copied)) {
1354+ if (skb_copy_datagram_iovec(cskb, offset, msg->msg_iov, copied)) {
13581355 if (!(flags & MSG_PEEK))
13591356 skb_queue_head(&sk->sk_receive_queue, skb);
13601357 return -EFAULT;
@@ -1372,7 +1369,8 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, · 11 unmodified lines
13721369 * get the trgcls from the control buffer of the skb due to
13731370 * fragmentation of original iucv message. */
13741371 err = put_cmsg(msg, SOL_IUCV, SCM_IUCV_TRGCLS,
1375− CB_TRGCLS_LEN, CB_TRGCLS(skb));
1372+ sizeof(IUCV_SKB_CB(skb)->class),
1373+ (void *)&IUCV_SKB_CB(skb)->class);
13761374 if (err) {
13771375 if (!(flags & MSG_PEEK))
13781376 skb_queue_head(&sk->sk_receive_queue, skb);
@@ -1384,9 +1382,8 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, · 5 unmodified lines
13841382
13851383 /* SOCK_STREAM: re-queue skb if it contains unreceived data */
13861384 if (sk->sk_type == SOCK_STREAM) {
1387− skb_pull(skb, copied);
1388− if (skb->len) {
1389− skb_queue_head(&sk->sk_receive_queue, skb);
1385+ if (copied < rlen) {
1386+ IUCV_SKB_CB(skb)->offset = offset + copied;
13901387 goto done;
13911388 }
13921389 }
@@ -1405,6 +1402,7 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, · 12 unmodified lines
14051402 spin_lock_bh(&iucv->message_q.lock);
14061403 rskb = skb_dequeue(&iucv->backlog_skb_q);
14071404 while (rskb) {
1405+ IUCV_SKB_CB(rskb)->offset = 0;
14081406 if (sock_queue_rcv_skb(sk, rskb)) {
14091407 skb_queue_head(&iucv->backlog_skb_q,
14101408 rskb);
@@ -1833,7 +1831,7 @@ static void iucv_callback_txdone(struct iucv_path *path, · 422 unmodified lines
18331831 spin_lock_irqsave(&list->lock, flags);
18341832
18351833 while (list_skb != (struct sk_buff *)list) {
1836− if (!memcmp(&msg->tag, CB_TAG(list_skb), CB_TAG_LEN)) {
1834+ if (msg->tag != IUCV_SKB_CB(list_skb)->tag) {
18371835 this = list_skb;
18381836 break;
18391837 }
@@ -2094,6 +2092,7 @@ static int afiucv_hs_callback_rx(struct sock *sk, struct sk_buff *skb) · 254 unmodified lines
20942092 skb_pull(skb, sizeof(struct af_iucv_trans_hdr));
20952093 skb_reset_transport_header(skb);
20962094 skb_reset_network_header(skb);
2095+ IUCV_SKB_CB(skb)->offset = 0;
20972096 spin_lock(&iucv->message_q.lock);
20982097 if (skb_queue_empty(&iucv->backlog_skb_q)) {
20992098 if (sock_queue_rcv_skb(sk, skb)) {
@@ -2198,8 +2197,7 @@ static int afiucv_hs_rcv(struct sk_buff *skb, struct net_device *dev, · 98 unmodified lines
21982197 /* fall through and receive zero length data */
21992198 case 0:
22002199 /* plain data frame */
2201− memcpy(CB_TRGCLS(skb), &trans_hdr->iucv_hdr.class,
2202− CB_TRGCLS_LEN);
2200+ IUCV_SKB_CB(skb)->class = trans_hdr->iucv_hdr.class;
22032201 err = afiucv_hs_callback_rx(sk, skb);
22042202 break;
22052203 default:
net/mac80211/iface.c+19−8
@@ -78,7 +78,7 @@ void ieee80211_recalc_txpower(struct ieee80211_sub_if_data *sdata) · 77 unmodified lines
7878 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_TXPOWER);
7979 }
8080
81−u32 ieee80211_idle_off(struct ieee80211_local *local)
81+static u32 __ieee80211_idle_off(struct ieee80211_local *local)
8282 {
8383 if (!(local->hw.conf.flags & IEEE80211_CONF_IDLE))
8484 return 0;
@@ -87,7 +87,7 @@ u32 ieee80211_idle_off(struct ieee80211_local *local) · 2 unmodified lines
8787 return IEEE80211_CONF_CHANGE_IDLE;
8888 }
8989
90−static u32 ieee80211_idle_on(struct ieee80211_local *local)
90+static u32 __ieee80211_idle_on(struct ieee80211_local *local)
9191 {
9292 if (local->hw.conf.flags & IEEE80211_CONF_IDLE)
9393 return 0;
@@ -98,16 +98,18 @@ static u32 ieee80211_idle_on(struct ieee80211_local *local) · 4 unmodified lines
9898 return IEEE80211_CONF_CHANGE_IDLE;
9999 }
100100
101−void ieee80211_recalc_idle(struct ieee80211_local *local)
101+static u32 __ieee80211_recalc_idle(struct ieee80211_local *local,
102+ bool force_active)
102103 {
103104 bool working = false, scanning, active;
104105 unsigned int led_trig_start = 0, led_trig_stop = 0;
105106 struct ieee80211_roc_work *roc;
106− u32 change;
107107
108108 lockdep_assert_held(&local->mtx);
109109
110− active = !list_empty(&local->chanctx_list) || local->monitors;
110+ active = force_active ||
111+ !list_empty(&local->chanctx_list) ||
112+ local->monitors;
111113
112114 if (!local->ops->remain_on_channel) {
113115 list_for_each_entry(roc, &local->roc_list, list) {
@@ -132,9 +134,18 @@ void ieee80211_recalc_idle(struct ieee80211_local *local) · 18 unmodified lines
132134 ieee80211_mod_tpt_led_trig(local, led_trig_start, led_trig_stop);
133135
134136 if (working || scanning || active)
135− change = ieee80211_idle_off(local);
136− else
137− change = ieee80211_idle_on(local);
137+ return __ieee80211_idle_off(local);
138+ return __ieee80211_idle_on(local);
139+}
140+
141+u32 ieee80211_idle_off(struct ieee80211_local *local)
142+{
143+ return __ieee80211_recalc_idle(local, true);
144+}
145+
146+void ieee80211_recalc_idle(struct ieee80211_local *local)
147+{
148+ u32 change = __ieee80211_recalc_idle(local, false);
138149 if (change)
139150 ieee80211_hw_config(local, change);
140151 }
net/mac80211/mlme.c+20−4
@@ -3887,8 +3887,16 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, · 3886 unmodified lines
38873887 /* prep auth_data so we don't go into idle on disassoc */
38883888 ifmgd->auth_data = auth_data;
38893889
3890− if (ifmgd->associated)
3891− ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
3890+ if (ifmgd->associated) {
3891+ u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
3892+
3893+ ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
3894+ WLAN_REASON_UNSPECIFIED,
3895+ false, frame_buf);
3896+
3897+ __cfg80211_send_deauth(sdata->dev, frame_buf,
3898+ sizeof(frame_buf));
3899+ }
38923900
38933901 sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid);
38943902
@@ -3948,8 +3956,16 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, · 53 unmodified lines
39483956
39493957 mutex_lock(&ifmgd->mtx);
39503958
3951− if (ifmgd->associated)
3952− ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
3959+ if (ifmgd->associated) {
3960+ u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN];
3961+
3962+ ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
3963+ WLAN_REASON_UNSPECIFIED,
3964+ false, frame_buf);
3965+
3966+ __cfg80211_send_deauth(sdata->dev, frame_buf,
3967+ sizeof(frame_buf));
3968+ }
39533969
39543970 if (ifmgd->auth_data && !ifmgd->auth_data->done) {
39553971 err = -EBUSY;
net/netfilter/ipset/ip_set_bitmap_ipmac.c+5−1
@@ -339,7 +339,11 @@ bitmap_ipmac_tlist(const struct ip_set *set, · 338 unmodified lines
339339 nla_put_failure:
340340 nla_nest_cancel(skb, nested);
341341 ipset_nest_end(skb, atd);
342− return -EMSGSIZE;
342+ if (unlikely(id == first)) {
343+ cb->args[2] = 0;
344+ return -EMSGSIZE;
345+ }
346+ return 0;
343347 }
344348
345349 static int
net/netfilter/ipset/ip_set_hash_ipportnet.c+18−0
@@ -104,6 +104,15 @@ hash_ipportnet4_data_flags(struct hash_ipportnet4_elem *dst, u32 flags) · 103 unmodified lines
104104 dst->nomatch = !!(flags & IPSET_FLAG_NOMATCH);
105105 }
106106
107+static inline void
108+hash_ipportnet4_data_reset_flags(struct hash_ipportnet4_elem *dst, u32 *flags)
109+{
110+ if (dst->nomatch) {
111+ *flags = IPSET_FLAG_NOMATCH;
112+ dst->nomatch = 0;
113+ }
114+}
115+
107116 static inline int
108117 hash_ipportnet4_data_match(const struct hash_ipportnet4_elem *elem)
109118 {
@@ -414,6 +423,15 @@ hash_ipportnet6_data_flags(struct hash_ipportnet6_elem *dst, u32 flags) · 304 unmodified lines
414423 dst->nomatch = !!(flags & IPSET_FLAG_NOMATCH);
415424 }
416425
426+static inline void
427+hash_ipportnet6_data_reset_flags(struct hash_ipportnet6_elem *dst, u32 *flags)
428+{
429+ if (dst->nomatch) {
430+ *flags = IPSET_FLAG_NOMATCH;
431+ dst->nomatch = 0;
432+ }
433+}
434+
417435 static inline int
418436 hash_ipportnet6_data_match(const struct hash_ipportnet6_elem *elem)
419437 {
net/netfilter/ipset/ip_set_hash_net.c+20−2
@@ -87,7 +87,16 @@ hash_net4_data_copy(struct hash_net4_elem *dst, · 86 unmodified lines
8787 static inline void
8888 hash_net4_data_flags(struct hash_net4_elem *dst, u32 flags)
8989 {
90− dst->nomatch = flags & IPSET_FLAG_NOMATCH;
90+ dst->nomatch = !!(flags & IPSET_FLAG_NOMATCH);
91+}
92+
93+static inline void
94+hash_net4_data_reset_flags(struct hash_net4_elem *dst, u32 *flags)
95+{
96+ if (dst->nomatch) {
97+ *flags = IPSET_FLAG_NOMATCH;
98+ dst->nomatch = 0;
99+ }
91100 }
92101
93102 static inline int
@@ -308,7 +317,16 @@ hash_net6_data_copy(struct hash_net6_elem *dst, · 214 unmodified lines
308317 static inline void
309318 hash_net6_data_flags(struct hash_net6_elem *dst, u32 flags)
310319 {
311− dst->nomatch = flags & IPSET_FLAG_NOMATCH;
320+ dst->nomatch = !!(flags & IPSET_FLAG_NOMATCH);
321+}
322+
323+static inline void
324+hash_net6_data_reset_flags(struct hash_net6_elem *dst, u32 *flags)
325+{
326+ if (dst->nomatch) {
327+ *flags = IPSET_FLAG_NOMATCH;
328+ dst->nomatch = 0;
329+ }
312330 }
313331
314332 static inline int
net/netfilter/ipset/ip_set_hash_netiface.c+20−2
@@ -198,7 +198,16 @@ hash_netiface4_data_copy(struct hash_netiface4_elem *dst, · 197 unmodified lines
198198 static inline void
199199 hash_netiface4_data_flags(struct hash_netiface4_elem *dst, u32 flags)
200200 {
201− dst->nomatch = flags & IPSET_FLAG_NOMATCH;
201+ dst->nomatch = !!(flags & IPSET_FLAG_NOMATCH);
202+}
203+
204+static inline void
205+hash_netiface4_data_reset_flags(struct hash_netiface4_elem *dst, u32 *flags)
206+{
207+ if (dst->nomatch) {
208+ *flags = IPSET_FLAG_NOMATCH;
209+ dst->nomatch = 0;
210+ }
202211 }
203212
204213 static inline int
@@ -494,7 +503,7 @@ hash_netiface6_data_copy(struct hash_netiface6_elem *dst, · 289 unmodified lines
494503 static inline void
495504 hash_netiface6_data_flags(struct hash_netiface6_elem *dst, u32 flags)
496505 {
497− dst->nomatch = flags & IPSET_FLAG_NOMATCH;
506+ dst->nomatch = !!(flags & IPSET_FLAG_NOMATCH);
498507 }
499508
500509 static inline int
@@ -503,6 +512,15 @@ hash_netiface6_data_match(const struct hash_netiface6_elem *elem) · 2 unmodified lines
503512 return elem->nomatch ? -ENOTEMPTY : 1;
504513 }
505514
515+static inline void
516+hash_netiface6_data_reset_flags(struct hash_netiface6_elem *dst, u32 *flags)
517+{
518+ if (dst->nomatch) {
519+ *flags = IPSET_FLAG_NOMATCH;
520+ dst->nomatch = 0;
521+ }
522+}
523+
506524 static inline void
507525 hash_netiface6_data_zero_out(struct hash_netiface6_elem *elem)
508526 {
net/netfilter/ipset/ip_set_hash_netport.c+18−0
@@ -104,6 +104,15 @@ hash_netport4_data_flags(struct hash_netport4_elem *dst, u32 flags) · 103 unmodified lines
104104 dst->nomatch = !!(flags & IPSET_FLAG_NOMATCH);
105105 }
106106
107+static inline void
108+hash_netport4_data_reset_flags(struct hash_netport4_elem *dst, u32 *flags)
109+{
110+ if (dst->nomatch) {
111+ *flags = IPSET_FLAG_NOMATCH;
112+ dst->nomatch = 0;
113+ }
114+}
115+
107116 static inline int
108117 hash_netport4_data_match(const struct hash_netport4_elem *elem)
109118 {
@@ -375,6 +384,15 @@ hash_netport6_data_flags(struct hash_netport6_elem *dst, u32 flags) · 265 unmodified lines
375384 dst->nomatch = !!(flags & IPSET_FLAG_NOMATCH);
376385 }
377386
387+static inline void
388+hash_netport6_data_reset_flags(struct hash_netport6_elem *dst, u32 *flags)
389+{
390+ if (dst->nomatch) {
391+ *flags = IPSET_FLAG_NOMATCH;
392+ dst->nomatch = 0;
393+ }
394+}
395+
378396 static inline int
379397 hash_netport6_data_match(const struct hash_netport6_elem *elem)
380398 {
net/netfilter/ipset/ip_set_list_set.c+7−3
@@ -174,9 +174,13 @@ list_set_add(struct list_set *map, u32 i, ip_set_id_t id, · 173 unmodified lines
174174 {
175175 const struct set_elem *e = list_set_elem(map, i);
176176
177− if (i == map->size - 1 && e->id != IPSET_INVALID_ID)
178− /* Last element replaced: e.g. add new,before,last */
179− ip_set_put_byindex(e->id);
177+ if (e->id != IPSET_INVALID_ID) {
178+ const struct set_elem *x = list_set_elem(map, map->size - 1);
179+
180+ /* Last element replaced or pushed off */
181+ if (x->id != IPSET_INVALID_ID)
182+ ip_set_put_byindex(x->id);
183+ }
180184 if (with_timeout(map->timeout))
181185 list_elem_tadd(map, i, id, ip_set_timeout_set(timeout));
182186 else
net/netfilter/nf_conntrack_sip.c+2−4
@@ -1593,10 +1593,8 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff, · 1592 unmodified lines
15931593 end += strlen("\r\n\r\n") + clen;
15941594
15951595 msglen = origlen = end - dptr;
1596− if (msglen > datalen) {
1597− nf_ct_helper_log(skb, ct, "incomplete/bad SIP message");
1598− return NF_DROP;
1599− }
1596+ if (msglen > datalen)
1597+ return NF_ACCEPT;
16001598
16011599 ret = process_sip_msg(skb, ct, protoff, dataoff,
16021600 &dptr, &msglen);
net/netfilter/nf_nat_core.c+7−33
@@ -468,33 +468,22 @@ EXPORT_SYMBOL_GPL(nf_nat_packet); · 467 unmodified lines
468468 struct nf_nat_proto_clean {
469469 u8 l3proto;
470470 u8 l4proto;
471− bool hash;
472471 };
473472
474−/* Clear NAT section of all conntracks, in case we're loaded again. */
475−static int nf_nat_proto_clean(struct nf_conn *i, void *data)
473+/* kill conntracks with affected NAT section */
474+static int nf_nat_proto_remove(struct nf_conn *i, void *data)
476475 {
477476 const struct nf_nat_proto_clean *clean = data;
478477 struct nf_conn_nat *nat = nfct_nat(i);
479478
480479 if (!nat)
481480 return 0;
482− if (!(i->status & IPS_SRC_NAT_DONE))
483− return 0;
481+
484482 if ((clean->l3proto && nf_ct_l3num(i) != clean->l3proto) ||
485483 (clean->l4proto && nf_ct_protonum(i) != clean->l4proto))
486484 return 0;
487485
488− if (clean->hash) {
489− spin_lock_bh(&nf_nat_lock);
490− hlist_del_rcu(&nat->bysource);
491− spin_unlock_bh(&nf_nat_lock);
492− } else {
493− memset(nat, 0, sizeof(*nat));
494− i->status &= ~(IPS_NAT_MASK | IPS_NAT_DONE_MASK |
495− IPS_SEQ_ADJUST);
496− }
497− return 0;
486+ return i->status & IPS_NAT_MASK ? 1 : 0;
498487 }
499488
500489 static void nf_nat_l4proto_clean(u8 l3proto, u8 l4proto)
@@ -506,16 +495,8 @@ static void nf_nat_l4proto_clean(u8 l3proto, u8 l4proto) · 5 unmodified lines
506495 struct net *net;
507496
508497 rtnl_lock();
509− /* Step 1 - remove from bysource hash */
510− clean.hash = true;
511498 for_each_net(net)
512− nf_ct_iterate_cleanup(net, nf_nat_proto_clean, &clean);
513− synchronize_rcu();
514−
515− /* Step 2 - clean NAT section */
516− clean.hash = false;
517− for_each_net(net)
518− nf_ct_iterate_cleanup(net, nf_nat_proto_clean, &clean);
499+ nf_ct_iterate_cleanup(net, nf_nat_proto_remove, &clean);
519500 rtnl_unlock();
520501 }
521502
@@ -527,16 +508,9 @@ static void nf_nat_l3proto_clean(u8 l3proto) · 5 unmodified lines
527508 struct net *net;
528509
529510 rtnl_lock();
530− /* Step 1 - remove from bysource hash */
531− clean.hash = true;
532− for_each_net(net)
533− nf_ct_iterate_cleanup(net, nf_nat_proto_clean, &clean);
534− synchronize_rcu();
535511
536− /* Step 2 - clean NAT section */
537− clean.hash = false;
538512 for_each_net(net)
539− nf_ct_iterate_cleanup(net, nf_nat_proto_clean, &clean);
513+ nf_ct_iterate_cleanup(net, nf_nat_proto_remove, &clean);
540514 rtnl_unlock();
541515 }
542516
@@ -774,7 +748,7 @@ static void __net_exit nf_nat_net_exit(struct net *net) · 231 unmodified lines
774748 {
775749 struct nf_nat_proto_clean clean = {};
776750
777− nf_ct_iterate_cleanup(net, &nf_nat_proto_clean, &clean);
751+ nf_ct_iterate_cleanup(net, &nf_nat_proto_remove, &clean);
778752 synchronize_rcu();
779753 nf_ct_free_hashtable(net->ct.nat_bysource, net->ct.nat_htable_size);
780754 }
net/netrom/af_netrom.c+1−1
@@ -1173,7 +1173,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, · 1172 unmodified lines
11731173 }
11741174
11751175 if (sax != NULL) {
1176− memset(sax, 0, sizeof(sax));
1176+ memset(sax, 0, sizeof(*sax));
11771177 sax->sax25_family = AF_NETROM;
11781178 skb_copy_from_linear_data_offset(skb, 7, sax->sax25_call.ax25_call,
11791179 AX25_ADDR_LEN);
net/openvswitch/datapath.c+18−12
@@ -1681,10 +1681,8 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *vport, u32 portid, · 1680 unmodified lines
16811681 return ERR_PTR(-ENOMEM);
16821682
16831683 retval = ovs_vport_cmd_fill_info(vport, skb, portid, seq, 0, cmd);
1684− if (retval < 0) {
1685− kfree_skb(skb);
1686− return ERR_PTR(retval);
1687− }
1684+ BUG_ON(retval < 0);
1685+
16881686 return skb;
16891687 }
16901688
@@ -1814,25 +1812,33 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info) · 123 unmodified lines
18141812 nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type)
18151813 err = -EINVAL;
18161814
1815+ reply = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
1816+ if (!reply) {
1817+ err = -ENOMEM;
1818+ goto exit_unlock;
1819+ }
1820+
18171821 if (!err && a[OVS_VPORT_ATTR_OPTIONS])
18181822 err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]);
18191823 if (err)
1820− goto exit_unlock;
1824+ goto exit_free;
1825+
18211826 if (a[OVS_VPORT_ATTR_UPCALL_PID])
18221827 vport->upcall_portid = nla_get_u32(a[OVS_VPORT_ATTR_UPCALL_PID]);
18231828
1824− reply = ovs_vport_cmd_build_info(vport, info->snd_portid, info->snd_seq,
1825− OVS_VPORT_CMD_NEW);
1826− if (IS_ERR(reply)) {
1827− netlink_set_err(sock_net(skb->sk)->genl_sock, 0,
1828− ovs_dp_vport_multicast_group.id, PTR_ERR(reply));
1829− goto exit_unlock;
1830− }
1829+ err = ovs_vport_cmd_fill_info(vport, reply, info->snd_portid,
1830+ info->snd_seq, 0, OVS_VPORT_CMD_NEW);
1831+ BUG_ON(err < 0);
18311832
18321833 ovs_unlock();
18331834 ovs_notify(reply, info, &ovs_dp_vport_multicast_group);
18341835 return 0;
18351836
1837+ rtnl_unlock();
1838+ return 0;
1839+
1840+exit_free:
1841+ kfree_skb(reply);
18361842 exit_unlock:
18371843 ovs_unlock();
18381844 return err;
net/openvswitch/flow.c+1−1
@@ -795,9 +795,9 @@ void ovs_flow_tbl_insert(struct flow_table *table, struct sw_flow *flow) · 794 unmodified lines
795795
796796 void ovs_flow_tbl_remove(struct flow_table *table, struct sw_flow *flow)
797797 {
798+ BUG_ON(table->count == 0);
798799 hlist_del_rcu(&flow->hash_node[table->node_ver]);
799800 table->count--;
800− BUG_ON(table->count < 0);
801801 }
802802
803803 /* The size of the argument for each %OVS_KEY_ATTR_* Netlink attribute. */
net/sched/cls_fw.c+1−1
@@ -204,7 +204,6 @@ fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f, · 203 unmodified lines
204204 if (err < 0)
205205 return err;
206206
207− err = -EINVAL;
208207 if (tb[TCA_FW_CLASSID]) {
209208 f->res.classid = nla_get_u32(tb[TCA_FW_CLASSID]);
210209 tcf_bind_filter(tp, &f->res, base);
@@ -218,6 +217,7 @@ fw_change_attrs(struct net *net, struct tcf_proto *tp, struct fw_filter *f, · 7 unmodified lines
218217 }
219218 #endif /* CONFIG_NET_CLS_IND */
220219
220+ err = -EINVAL;
221221 if (tb[TCA_FW_MASK]) {
222222 mask = nla_get_u32(tb[TCA_FW_MASK]);
223223 if (mask != head->mask)
net/sunrpc/clnt.c+3−8
@@ -304,10 +304,8 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru · 303 unmodified lines
304304 err = rpciod_up();
305305 if (err)
306306 goto out_no_rpciod;
307− err = -EINVAL;
308− if (!xprt)
309− goto out_no_xprt;
310307
308+ err = -EINVAL;
311309 if (args->version >= program->nrvers)
312310 goto out_err;
313311 version = program->version[args->version];
@@ -382,10 +380,9 @@ out_no_principal: · 68 unmodified lines
382380 out_no_stats:
383381 kfree(clnt);
384382 out_err:
385− xprt_put(xprt);
386−out_no_xprt:
387383 rpciod_down();
388384 out_no_rpciod:
385+ xprt_put(xprt);
389386 return ERR_PTR(err);
390387 }
391388
@@ -512,7 +509,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args, · 120 unmodified lines
512509 new = rpc_new_client(args, xprt);
513510 if (IS_ERR(new)) {
514511 err = PTR_ERR(new);
515− goto out_put;
512+ goto out_err;
516513 }
517514
518515 atomic_inc(&clnt->cl_count);
@@ -525,8 +522,6 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args, · 6 unmodified lines
525522 new->cl_chatty = clnt->cl_chatty;
526523 return new;
527524
528−out_put:
529− xprt_put(xprt);
530525 out_err:
531526 dprintk("RPC: %s: returned error %d\n", __func__, err);
532527 return ERR_PTR(err);
net/unix/af_unix.c+1−1
@@ -1414,7 +1414,7 @@ static void maybe_add_creds(struct sk_buff *skb, const struct socket *sock, · 1413 unmodified lines
14141414 !other->sk_socket ||
14151415 test_bit(SOCK_PASSCRED, &other->sk_socket->flags)) {
14161416 UNIXCB(skb).pid = get_pid(task_tgid(current));
1417− current_euid_egid(&UNIXCB(skb).uid, &UNIXCB(skb).gid);
1417+ current_uid_gid(&UNIXCB(skb).uid, &UNIXCB(skb).gid);
14181418 }
14191419 }
14201420
scripts/checkpatch.pl+1−0
@@ -3016,6 +3016,7 @@ sub process { · 3015 unmodified lines
30163016 $dstat !~ /^'X'$/ && # character constants
30173017 $dstat !~ /$exceptions/ &&
30183018 $dstat !~ /^\.$Ident\s*=/ && # .foo =
3019+ $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo
30193020 $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...)
30203021 $dstat !~ /^for\s*$Constant$/ && # for (...)
30213022 $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar()
security/capability.c+6−0
@@ -737,6 +737,11 @@ static int cap_tun_dev_open(void *security) · 736 unmodified lines
737737 {
738738 return 0;
739739 }
740+
741+static void cap_skb_owned_by(struct sk_buff *skb, struct sock *sk)
742+{
743+}
744+
740745 #endif /* CONFIG_SECURITY_NETWORK */
741746
742747 #ifdef CONFIG_SECURITY_NETWORK_XFRM
@@ -1071,6 +1076,7 @@ void __init security_fixup_ops(struct security_operations *ops) · 328 unmodified lines
10711076 set_to_cap_if_null(ops, tun_dev_open);
10721077 set_to_cap_if_null(ops, tun_dev_attach_queue);
10731078 set_to_cap_if_null(ops, tun_dev_attach);
1079+ set_to_cap_if_null(ops, skb_owned_by);
10741080 #endif /* CONFIG_SECURITY_NETWORK */
10751081 #ifdef CONFIG_SECURITY_NETWORK_XFRM
10761082 set_to_cap_if_null(ops, xfrm_policy_alloc_security);
security/security.c+5−0
@@ -1290,6 +1290,11 @@ int security_tun_dev_open(void *security) · 1289 unmodified lines
12901290 }
12911291 EXPORT_SYMBOL(security_tun_dev_open);
12921292
1293+void security_skb_owned_by(struct sk_buff *skb, struct sock *sk)
1294+{
1295+ security_ops->skb_owned_by(skb, sk);
1296+}
1297+
12931298 #endif /* CONFIG_SECURITY_NETWORK */
12941299
12951300 #ifdef CONFIG_SECURITY_NETWORK_XFRM
security/selinux/hooks.c+7−0
@@ -51,6 +51,7 @@ · 50 unmodified lines
5151 #include <linux/tty.h>
5252 #include <net/icmp.h>
5353 #include <net/ip.h> /* for local_port_range[] */
54+#include <net/sock.h>
5455 #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */
5556 #include <net/net_namespace.h>
5657 #include <net/netlabel.h>
@@ -4363,6 +4364,11 @@ static void selinux_inet_conn_established(struct sock *sk, struct sk_buff *skb) · 4306 unmodified lines
43634364 selinux_skb_peerlbl_sid(skb, family, &sksec->peer_sid);
43644365 }
43654366
4367+static void selinux_skb_owned_by(struct sk_buff *skb, struct sock *sk)
4368+{
4369+ skb_set_owner_w(skb, sk);
4370+}
4371+
43664372 static int selinux_secmark_relabel_packet(u32 sid)
43674373 {
43684374 const struct task_security_struct *__tsec;
@@ -5664,6 +5670,7 @@ static struct security_operations selinux_ops = { · 1295 unmodified lines
56645670 .tun_dev_attach_queue = selinux_tun_dev_attach_queue,
56655671 .tun_dev_attach = selinux_tun_dev_attach,
56665672 .tun_dev_open = selinux_tun_dev_open,
5673+ .skb_owned_by = selinux_skb_owned_by,
56675674
56685675 #ifdef CONFIG_SECURITY_NETWORK_XFRM
56695676 .xfrm_policy_alloc_security = selinux_xfrm_policy_alloc,
sound/core/pcm_native.c+2−10
@@ -3222,18 +3222,10 @@ EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap); · 3221 unmodified lines
32223222 int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream,
32233223 struct vm_area_struct *area)
32243224 {
3225− long size;
3226− unsigned long offset;
3225+ struct snd_pcm_runtime *runtime = substream->runtime;;
32273226
32283227 area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
3229− area->vm_flags |= VM_IO;
3230− size = area->vm_end - area->vm_start;
3231− offset = area->vm_pgoff << PAGE_SHIFT;
3232− if (io_remap_pfn_range(area, area->vm_start,
3233− (substream->runtime->dma_addr + offset) >> PAGE_SHIFT,
3234− size, area->vm_page_prot))
3235− return -EAGAIN;
3236− return 0;
3228+ return vm_iomap_memory(area, runtime->dma_addr, runtime->dma_bytes);
32373229 }
32383230
32393231 EXPORT_SYMBOL(snd_pcm_lib_mmap_iomem);
sound/soc/codecs/wm5102.c+1−1
@@ -584,7 +584,7 @@ static int wm5102_sysclk_ev(struct snd_soc_dapm_widget *w, · 583 unmodified lines
584584 struct snd_kcontrol *kcontrol, int event)
585585 {
586586 struct snd_soc_codec *codec = w->codec;
587− struct arizona *arizona = dev_get_drvdata(codec->dev);
587+ struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
588588 struct regmap *regmap = codec->control_data;
589589 const struct reg_default *patch = NULL;
590590 int i, patch_size;
sound/soc/codecs/wm8903.c+2−0
@@ -1083,6 +1083,8 @@ static const struct snd_soc_dapm_route wm8903_intercon[] = { · 1082 unmodified lines
10831083 { "ROP", NULL, "Right Speaker PGA" },
10841084 { "RON", NULL, "Right Speaker PGA" },
10851085
1086+ { "Charge Pump", NULL, "CLK_DSP" },
1087+
10861088 { "Left Headphone Output PGA", NULL, "Charge Pump" },
10871089 { "Right Headphone Output PGA", NULL, "Charge Pump" },
10881090 { "Left Line Output PGA", NULL, "Charge Pump" },
sound/soc/samsung/i2s.c+12−5
@@ -972,6 +972,7 @@ static const struct snd_soc_dai_ops samsung_i2s_dai_ops = { · 971 unmodified lines
972972 static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
973973 {
974974 struct i2s_dai *i2s;
975+ int ret;
975976
976977 i2s = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dai), GFP_KERNEL);
977978 if (i2s == NULL)
@@ -996,15 +997,17 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) · 18 unmodified lines
996997 i2s->i2s_dai_drv.capture.channels_max = 2;
997998 i2s->i2s_dai_drv.capture.rates = SAMSUNG_I2S_RATES;
998999 i2s->i2s_dai_drv.capture.formats = SAMSUNG_I2S_FMTS;
1000+ dev_set_drvdata(&i2s->pdev->dev, i2s);
9991001 } else { /* Create a new platform_device for Secondary */
1000− i2s->pdev = platform_device_register_resndata(NULL,
1001− "samsung-i2s-sec", -1, NULL, 0, NULL, 0);
1002+ i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1);
10021003 if (IS_ERR(i2s->pdev))
10031004 return NULL;
1004− }
10051005
1006− /* Pre-assign snd_soc_dai_set_drvdata */
1007− dev_set_drvdata(&i2s->pdev->dev, i2s);
1006+ platform_set_drvdata(i2s->pdev, i2s);
1007+ ret = platform_device_add(i2s->pdev);
1008+ if (ret < 0)
1009+ return NULL;
1010+ }
10081011
10091012 return i2s;
10101013 }
@@ -1107,6 +1110,10 @@ static int samsung_i2s_probe(struct platform_device *pdev) · 96 unmodified lines
11071110
11081111 if (samsung_dai_type == TYPE_SEC) {
11091112 sec_dai = dev_get_drvdata(&pdev->dev);
1113+ if (!sec_dai) {
1114+ dev_err(&pdev->dev, "Unable to get drvdata\n");
1115+ return -EFAULT;
1116+ }
11101117 snd_soc_register_dai(&sec_dai->pdev->dev,
11111118 &sec_dai->i2s_dai_drv);
11121119 asoc_dma_platform_register(&pdev->dev);
sound/soc/soc-compress.c+11−3
@@ -211,19 +211,27 @@ static int soc_compr_set_params(struct snd_compr_stream *cstream, · 210 unmodified lines
211211 if (platform->driver->compr_ops && platform->driver->compr_ops->set_params) {
212212 ret = platform->driver->compr_ops->set_params(cstream, params);
213213 if (ret < 0)
214− goto out;
214+ goto err;
215215 }
216216
217217 if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->set_params) {
218218 ret = rtd->dai_link->compr_ops->set_params(cstream);
219219 if (ret < 0)
220− goto out;
220+ goto err;
221221 }
222222
223223 snd_soc_dapm_stream_event(rtd, SNDRV_PCM_STREAM_PLAYBACK,
224224 SND_SOC_DAPM_STREAM_START);
225225
226−out:
226+ /* cancel any delayed stream shutdown that is pending */
227+ rtd->pop_wait = 0;
228+ mutex_unlock(&rtd->pcm_mutex);
229+
230+ cancel_delayed_work_sync(&rtd->delayed_work);
231+
232+ return ret;
233+
234+err:
227235 mutex_unlock(&rtd->pcm_mutex);
228236 return ret;
229237 }
sound/soc/soc-core.c+1−1
@@ -2963,7 +2963,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, · 2962 unmodified lines
29632963 val = val << shift;
29642964
29652965 ret = snd_soc_update_bits_locked(codec, reg, val_mask, val);
2966− if (ret != 0)
2966+ if (ret < 0)
29672967 return ret;
29682968
29692969 if (snd_soc_volsw_is_stereo(mc)) {
sound/soc/tegra/tegra_pcm.c+1−23
@@ -43,8 +43,6 @@ · 42 unmodified lines
4343 static const struct snd_pcm_hardware tegra_pcm_hardware = {
4444 .info = SNDRV_PCM_INFO_MMAP |
4545 SNDRV_PCM_INFO_MMAP_VALID |
46− SNDRV_PCM_INFO_PAUSE |
47− SNDRV_PCM_INFO_RESUME |
4846 SNDRV_PCM_INFO_INTERLEAVED,
4947 .formats = SNDRV_PCM_FMTBIT_S16_LE,
5048 .channels_min = 2,
@@ -127,26 +125,6 @@ static int tegra_pcm_hw_free(struct snd_pcm_substream *substream) · 76 unmodified lines
127125 return 0;
128126 }
129127
130−static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
131−{
132− switch (cmd) {
133− case SNDRV_PCM_TRIGGER_START:
134− case SNDRV_PCM_TRIGGER_RESUME:
135− case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
136− return snd_dmaengine_pcm_trigger(substream,
137− SNDRV_PCM_TRIGGER_START);
138−
139− case SNDRV_PCM_TRIGGER_STOP:
140− case SNDRV_PCM_TRIGGER_SUSPEND:
141− case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
142− return snd_dmaengine_pcm_trigger(substream,
143− SNDRV_PCM_TRIGGER_STOP);
144− default:
145− return -EINVAL;
146− }
147− return 0;
148−}
149−
150128 static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
151129 struct vm_area_struct *vma)
152130 {
@@ -164,7 +142,7 @@ static struct snd_pcm_ops tegra_pcm_ops = { · 11 unmodified lines
164142 .ioctl = snd_pcm_lib_ioctl,
165143 .hw_params = tegra_pcm_hw_params,
166144 .hw_free = tegra_pcm_hw_free,
167− .trigger = tegra_pcm_trigger,
145+ .trigger = snd_dmaengine_pcm_trigger,
168146 .pointer = snd_dmaengine_pcm_pointer,
169147 .mmap = tegra_pcm_mmap,
170148 };
sound/usb/mixer_quirks.c+2−2
@@ -509,7 +509,7 @@ static int snd_nativeinstruments_control_get(struct snd_kcontrol *kcontrol, · 508 unmodified lines
509509 else
510510 ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), bRequest,
511511 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
512− 0, cpu_to_le16(wIndex),
512+ 0, wIndex,
513513 &tmp, sizeof(tmp), 1000);
514514 up_read(&mixer->chip->shutdown_rwsem);
515515
@@ -540,7 +540,7 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol, · 24 unmodified lines
540540 else
541541 ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), bRequest,
542542 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
543− cpu_to_le16(wValue), cpu_to_le16(wIndex),
543+ wValue, wIndex,
544544 NULL, 0, 1000);
545545 up_read(&mixer->chip->shutdown_rwsem);
546546
sound/usb/quirks.c+1−1
@@ -486,7 +486,7 @@ static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev) · 485 unmodified lines
486486 {
487487 int ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
488488 0xaf, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
489− cpu_to_le16(1), 0, NULL, 0, 1000);
489+ 1, 0, NULL, 0, 1000);
490490
491491 if (ret < 0)
492492 return ret;
tools/power/x86/turbostat/turbostat.c+4−1
@@ -1421,6 +1421,7 @@ int has_nehalem_turbo_ratio_limit(unsigned int family, unsigned int model) · 1420 unmodified lines
14211421 case 0x3C: /* HSW */
14221422 case 0x3F: /* HSW */
14231423 case 0x45: /* HSW */
1424+ case 0x46: /* HSW */
14241425 return 1;
14251426 case 0x2E: /* Nehalem-EX Xeon - Beckton */
14261427 case 0x2F: /* Westmere-EX Xeon - Eagleton */
@@ -1515,6 +1516,7 @@ void rapl_probe(unsigned int family, unsigned int model) · 88 unmodified lines
15151516 case 0x3C: /* HSW */
15161517 case 0x3F: /* HSW */
15171518 case 0x45: /* HSW */
1519+ case 0x46: /* HSW */
15181520 do_rapl = RAPL_PKG | RAPL_CORES | RAPL_GFX;
15191521 break;
15201522 case 0x2D:
@@ -1754,6 +1756,7 @@ int is_snb(unsigned int family, unsigned int model) · 233 unmodified lines
17541756 case 0x3C: /* HSW */
17551757 case 0x3F: /* HSW */
17561758 case 0x45: /* HSW */
1759+ case 0x46: /* HSW */
17571760 return 1;
17581761 }
17591762 return 0;
@@ -2276,7 +2279,7 @@ int main(int argc, char **argv) · 516 unmodified lines
22762279 cmdline(argc, argv);
22772280
22782281 if (verbose)
2279− fprintf(stderr, "turbostat v3.2 February 11, 2013"
2282+ fprintf(stderr, "turbostat v3.3 March 15, 2013"
22802283 " - Len Brown <lenb@kernel.org>\n");
22812284
22822285 turbostat_init();
virt/kvm/kvm_main.c+37−10
@@ -1541,21 +1541,38 @@ int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, · 1540 unmodified lines
15411541 }
15421542
15431543 int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
1544− gpa_t gpa)
1544+ gpa_t gpa, unsigned long len)
15451545 {
15461546 struct kvm_memslots *slots = kvm_memslots(kvm);
15471547 int offset = offset_in_page(gpa);
1548− gfn_t gfn = gpa >> PAGE_SHIFT;
1548+ gfn_t start_gfn = gpa >> PAGE_SHIFT;
1549+ gfn_t end_gfn = (gpa + len - 1) >> PAGE_SHIFT;
1550+ gfn_t nr_pages_needed = end_gfn - start_gfn + 1;
1551+ gfn_t nr_pages_avail;
15491552
15501553 ghc->gpa = gpa;
15511554 ghc->generation = slots->generation;
1552− ghc->memslot = gfn_to_memslot(kvm, gfn);
1553− ghc->hva = gfn_to_hva_many(ghc->memslot, gfn, NULL);
1554− if (!kvm_is_error_hva(ghc->hva))
1555+ ghc->len = len;
1556+ ghc->memslot = gfn_to_memslot(kvm, start_gfn);
1557+ ghc->hva = gfn_to_hva_many(ghc->memslot, start_gfn, &nr_pages_avail);
1558+ if (!kvm_is_error_hva(ghc->hva) && nr_pages_avail >= nr_pages_needed) {
15551559 ghc->hva += offset;
1556− else
1557− return -EFAULT;
1558−
1560+ } else {
1561+ /*
1562+ * If the requested region crosses two memslots, we still
1563+ * verify that the entire region is valid here.
1564+ */
1565+ while (start_gfn <= end_gfn) {
1566+ ghc->memslot = gfn_to_memslot(kvm, start_gfn);
1567+ ghc->hva = gfn_to_hva_many(ghc->memslot, start_gfn,
1568+ &nr_pages_avail);
1569+ if (kvm_is_error_hva(ghc->hva))
1570+ return -EFAULT;
1571+ start_gfn += nr_pages_avail;
1572+ }
1573+ /* Use the slow path for cross page reads and writes. */
1574+ ghc->memslot = NULL;
1575+ }
15591576 return 0;
15601577 }
15611578 EXPORT_SYMBOL_GPL(kvm_gfn_to_hva_cache_init);
@@ -1566,8 +1583,13 @@ int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, · 4 unmodified lines
15661583 struct kvm_memslots *slots = kvm_memslots(kvm);
15671584 int r;
15681585
1586+ BUG_ON(len > ghc->len);
1587+
15691588 if (slots->generation != ghc->generation)
1570− kvm_gfn_to_hva_cache_init(kvm, ghc, ghc->gpa);
1589+ kvm_gfn_to_hva_cache_init(kvm, ghc, ghc->gpa, ghc->len);
1590+
1591+ if (unlikely(!ghc->memslot))
1592+ return kvm_write_guest(kvm, ghc->gpa, data, len);
15711593
15721594 if (kvm_is_error_hva(ghc->hva))
15731595 return -EFAULT;
@@ -1587,8 +1609,13 @@ int kvm_read_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, · 13 unmodified lines
15871609 struct kvm_memslots *slots = kvm_memslots(kvm);
15881610 int r;
15891611
1612+ BUG_ON(len > ghc->len);
1613+
15901614 if (slots->generation != ghc->generation)
1591− kvm_gfn_to_hva_cache_init(kvm, ghc, ghc->gpa);
1615+ kvm_gfn_to_hva_cache_init(kvm, ghc, ghc->gpa, ghc->len);
1616+
1617+ if (unlikely(!ghc->memslot))
1618+ return kvm_read_guest(kvm, ghc->gpa, data, len);
15921619
15931620 if (kvm_is_error_hva(ghc->hva))
15941621 return -EFAULT;

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