History

Merge tag 'usb-serial-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes: USB-serial fixes for v4.6-rc3 Here are some new device ids.

Greg Kroah-Hartman committed 10 years ago

Commit 636c8a82 parents 39ec5cb d48d569241 files · +2174 −1421Browse files

Unified · Split

241 files
  1. .mailmap +1 −0
  2. Documentation/networking/switchdev.txt +1 −1
  3. Documentation/x86/topology.txt +208 −0
  4. MAINTAINERS +7 −4
  5. Makefile +1 −1
  6. arch/arm64/configs/defconfig +20 −8
  7. arch/arm64/include/asm/kvm_host.h +0 −1
  8. arch/arm64/include/asm/kvm_hyp.h +0 −1
  9. arch/arm64/include/asm/kvm_perf_event.h +0 −68
  10. arch/arm64/include/asm/opcodes.h +4 −0
  11. arch/arm64/include/asm/perf_event.h +47 −0
  12. arch/arm64/kernel/perf_event.c +19 −53
  13. arch/nios2/kernel/prom.c +1 −2
  14. arch/parisc/Kconfig +1 −0
  15. arch/parisc/include/asm/compat.h +7 −0
  16. arch/parisc/include/asm/syscall.h +13 −0
  17. arch/parisc/kernel/ptrace.c +7 −2
  18. arch/parisc/kernel/signal32.c +5 −0
  19. arch/parisc/kernel/syscall.S +2 −0
  20. arch/powerpc/include/asm/processor.h +1 −1
  21. arch/powerpc/kernel/process.c +1 −1
  22. arch/powerpc/mm/hugetlbpage.c +2 −2
  23. arch/s390/Kconfig +3 −0
  24. arch/s390/crypto/prng.c +2 −0
  25. arch/s390/include/asm/cache.h +3 −0
  26. arch/s390/include/uapi/asm/unistd.h +3 −1
  27. arch/s390/kernel/perf_cpum_cf.c +1 −0
  28. arch/s390/kernel/perf_cpum_sf.c +1 −1
  29. arch/s390/kernel/syscalls.S +2 −0
  30. arch/s390/mm/gup.c +5 −3
  31. arch/s390/mm/init.c +7 −3
  32. arch/s390/pci/pci_clp.c +1 −2
  33. arch/sparc/include/asm/compat_signal.h +4 −4
  34. arch/sparc/include/asm/obio.h +16 −16
  35. arch/sparc/include/asm/openprom.h +5 −5
  36. arch/sparc/include/asm/pgtable_64.h +1 −1
  37. arch/sparc/include/asm/processor_64.h +1 −1
  38. arch/sparc/include/asm/sigcontext.h +1 −1
  39. arch/sparc/include/asm/tsb.h +1 −1
  40. arch/sparc/include/uapi/asm/stat.h +2 −2
  41. arch/sparc/kernel/audit.c +6 −6
  42. arch/sparc/kernel/compat_audit.c +6 −6
  43. arch/sparc/kernel/entry.S +1 −1
  44. arch/sparc/kernel/ioport.c +3 −3
  45. arch/sparc/kernel/kernel.h +6 −6
  46. arch/sparc/kernel/leon_kernel.c +1 −1
  47. arch/sparc/kernel/process_64.c +1 −1
  48. arch/sparc/kernel/setup_32.c +1 −1
  49. arch/sparc/kernel/setup_64.c +1 −1
  50. arch/sparc/kernel/signal32.c +1 −1
  51. arch/sparc/kernel/sys_sparc_64.c +2 −2
  52. arch/sparc/kernel/sysfs.c +1 −1
  53. arch/sparc/kernel/unaligned_64.c +2 −2
  54. arch/sparc/mm/fault_32.c +4 −4
  55. arch/sparc/net/bpf_jit_comp.c +1 −1
  56. arch/tile/include/hv/drv_mpipe_intf.h +13 −13
  57. arch/tile/kernel/kgdb.c +8 −8
  58. arch/tile/kernel/pci_gx.c +1 −1
  59. arch/x86/events/amd/core.c +18 −3
  60. arch/x86/events/amd/ibs.c +45 −7
  61. arch/x86/events/perf_event.h +8 −3
  62. arch/x86/include/asm/msr-index.h +1 −7
  63. arch/x86/include/asm/pmem.h +9 −0
  64. arch/x86/include/asm/processor.h +0 −2
  65. arch/x86/include/asm/smp.h +1 −0
  66. arch/x86/include/asm/thread_info.h +2 −4
  67. arch/x86/include/asm/tlbflush.h +0 −6
  68. arch/x86/kernel/amd_nb.c +2 −4
  69. arch/x86/kernel/cpu/amd.c +4 −8
  70. arch/x86/kernel/cpu/mcheck/therm_throt.c +3 −0
  71. arch/x86/kernel/cpu/powerflags.c +2 −0
  72. arch/x86/kernel/smpboot.c +1 −1
  73. arch/x86/mm/tlb.c +10 −4
  74. arch/x86/ras/mce_amd_inj.c +2 −1
  75. crypto/asymmetric_keys/pkcs7_trust.c +2 −0
  76. drivers/acpi/acpi_processor.c +52 −0
  77. drivers/acpi/bus.c +3 −0
  78. drivers/acpi/internal.h +6 −0
  79. drivers/clk/mediatek/reset.c +1 −1
  80. drivers/clk/mmp/reset.c +1 −1
  81. drivers/clk/qcom/gcc-ipq4019.c +35 −35
  82. drivers/clk/qcom/reset.c +1 −1
  83. drivers/clk/qcom/reset.h +1 −1
  84. drivers/clk/rockchip/softrst.c +1 −1
  85. drivers/clk/sirf/clk-atlas7.c +1 −1
  86. drivers/clk/sunxi/clk-a10-ve.c +1 −1
  87. drivers/clk/sunxi/clk-sun9i-mmc.c +1 −1
  88. drivers/clk/sunxi/clk-usb.c +1 −1
  89. drivers/clk/tegra/clk.c +1 −1
  90. drivers/gpio/gpio-menz127.c +4 −5
  91. drivers/gpio/gpio-xgene.c +5 −0
  92. drivers/gpu/drm/amd/acp/Kconfig +6 −2
  93. drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +4 −0
  94. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +6 −0
  95. drivers/gpu/drm/drm_dp_helper.c +17 −10
  96. drivers/gpu/drm/msm/hdmi/hdmi.h +1 −1
  97. drivers/gpu/drm/msm/msm_drv.c +0 −3
  98. drivers/gpu/drm/msm/msm_kms.h +0 −1
  99. drivers/gpu/drm/radeon/radeon_object.c +4 −0
  100. drivers/gpu/drm/radeon/radeon_ttm.c +6 −0
  101. drivers/gpu/drm/radeon/si_dpm.c +6 −0
  102. drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +10 −3
  103. drivers/gpu/drm/rockchip/rockchip_drm_drv.c +22 −0
  104. drivers/gpu/drm/rockchip/rockchip_drm_drv.h +1 −0
  105. drivers/gpu/drm/rockchip/rockchip_drm_vop.c +67 −12
  106. drivers/gpu/drm/udl/udl_fb.c +1 −1
  107. drivers/gpu/drm/udl/udl_gem.c +1 −1
  108. drivers/hwmon/max1111.c +6 −0
  109. drivers/ide/icside.c +1 −1
  110. drivers/ide/palm_bk3710.c +2 −0
  111. drivers/infiniband/ulp/isert/ib_isert.c +4 −35
  112. drivers/infiniband/ulp/isert/ib_isert.h +0 −2
  113. drivers/isdn/hisax/isac.c +10 −5
  114. drivers/media/v4l2-core/v4l2-mc.c +1 −1
  115. drivers/net/dsa/mv88e6xxx.c +72 −13
  116. drivers/net/dsa/mv88e6xxx.h +8 −0
  117. drivers/net/ethernet/broadcom/bnxt/bnxt.c +7 −3
  118. drivers/net/ethernet/broadcom/bnxt/bnxt.h +2 −0
  119. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +2 −4
  120. drivers/net/ethernet/broadcom/genet/bcmgenet.c +11 −5
  121. drivers/net/ethernet/broadcom/genet/bcmgenet.h +6 −0
  122. drivers/net/ethernet/cadence/macb.c +55 −14
  123. drivers/net/ethernet/freescale/fec_main.c +1 −1
  124. drivers/net/ethernet/hisilicon/hns/hnae.h +1 −1
  125. drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c +23 −41
  126. drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c +2 −1
  127. drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c +6 −6
  128. drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c +22 −18
  129. drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c +92 −104
  130. drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h +12 −11
  131. drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h +3 −0
  132. drivers/net/ethernet/hisilicon/hns/hns_enet.c +7 −9
  133. drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +6 −4
  134. drivers/net/ethernet/intel/ixgbe/ixgbe.h +5 −5
  135. drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +2 −2
  136. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +76 −89
  137. drivers/net/ethernet/intel/ixgbe/ixgbe_model.h +6 −15
  138. drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +1 −1
  139. drivers/net/ethernet/intel/ixgbevf/ethtool.c +2 −2
  140. drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +2 −0
  141. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +10 −6
  142. drivers/net/ethernet/intel/ixgbevf/vf.c +3 −1
  143. drivers/net/ethernet/marvell/mvneta.c +17 −23
  144. drivers/net/ethernet/marvell/mvpp2.c +4 −14
  145. drivers/net/ethernet/qlogic/qed/qed_int.c +1 −1
  146. drivers/net/ethernet/qlogic/qlge/qlge.h +1 −1
  147. drivers/net/ethernet/renesas/ravb_main.c +1 −1
  148. drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c +2 −2
  149. drivers/net/ethernet/stmicro/stmmac/norm_desc.c +8 −8
  150. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +5 −11
  151. drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +1 −9
  152. drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +66 −25
  153. drivers/net/phy/bcm7xxx.c +4 −0
  154. drivers/net/team/team.c +5 −0
  155. drivers/net/tun.c +5 −3
  156. drivers/net/usb/cdc_ncm.c +7 −0
  157. drivers/net/usb/plusb.c +1 −1
  158. drivers/net/usb/qmi_wwan.c +1 −0
  159. drivers/nvdimm/pmem.c +2 −2
  160. drivers/platform/goldfish/goldfish_pipe.c +1 −2
  161. drivers/rapidio/devices/rio_mport_cdev.c +1 −1
  162. drivers/remoteproc/st_remoteproc.c +2 −2
  163. drivers/s390/block/dasd_alias.c +53 −173
  164. drivers/s390/block/dasd_eckd.c +29 −9
  165. drivers/s390/block/dasd_eckd.h +2 −1
  166. drivers/s390/block/dasd_int.h +2 −0
  167. drivers/target/iscsi/iscsi_target_configfs.c +11 −17
  168. drivers/target/target_core_fabric_configfs.c +13 −11
  169. drivers/usb/serial/cp210x.c +1 −0
  170. drivers/usb/serial/ftdi_sio.c +4 −0
  171. drivers/usb/serial/ftdi_sio_ids.h +8 −0
  172. drivers/usb/serial/option.c +2 −0
  173. fs/btrfs/disk-io.c +25 −20
  174. fs/dlm/config.c +1 −2
  175. fs/namei.c +6 −4
  176. fs/orangefs/dir.c +3 −5
  177. fs/orangefs/protocol.h +1 −1
  178. include/linux/atomic.h +17 −17
  179. include/linux/brcmphy.h +2 −0
  180. include/linux/configfs.h +2 −2
  181. include/linux/filter.h +4 −0
  182. include/linux/huge_mm.h +1 −1
  183. include/linux/netfilter/ipset/ip_set.h +4 −0
  184. include/linux/pmem.h +16 −6
  185. include/linux/sched.h +2 −2
  186. include/linux/stmmac.h +0 −1
  187. include/target/target_core_fabric.h +1 −1
  188. include/trace/events/page_isolation.h +1 −1
  189. include/uapi/linux/bpf.h +1 −0
  190. include/uapi/linux/stddef.h +4 −0
  191. init/Kconfig +2 −1
  192. kernel/bpf/syscall.c +4 −2
  193. kernel/events/core.c +13 −2
  194. kernel/locking/lockdep.c +77 −2
  195. kernel/sched/core.c +18 −0
  196. kernel/time/tick-sched.c +30 −31
  197. kernel/time/tick-sched.h +1 −1
  198. mm/kasan/kasan.c +1 −1
  199. mm/oom_kill.c +5 −1
  200. mm/page_isolation.c +5 −5
  201. mm/rmap.c +7 −21
  202. net/bridge/br_stp.c +1 −1
  203. net/bridge/netfilter/ebtables.c +4 −0
  204. net/bridge/netfilter/nft_reject_bridge.c +10 −10
  205. net/core/filter.c +25 −13
  206. net/core/netpoll.c +2 −1
  207. net/core/rtnetlink.c +1 −0
  208. net/ipv4/fou.c +16 −0
  209. net/ipv4/ip_tunnel_core.c +2 −2
  210. net/ipv4/netfilter/arp_tables.c +23 −20
  211. net/ipv4/netfilter/ip_tables.c +25 −23
  212. net/ipv4/netfilter/ipt_SYNPROXY.c +28 −26
  213. net/ipv6/netfilter/ip6_tables.c +25 −23
  214. net/ipv6/udp.c +2 −2
  215. net/netfilter/ipset/ip_set_bitmap_gen.h +1 −1
  216. net/netfilter/ipset/ip_set_core.c +28 −5
  217. net/netfilter/ipset/ip_set_hash_gen.h +1 −1
  218. net/netfilter/ipset/ip_set_list_set.c +1 −1
  219. net/netfilter/nfnetlink_queue.c +6 −1
  220. net/openvswitch/Kconfig +3 −1
  221. net/openvswitch/conntrack.c +13 −11
  222. net/sctp/output.c +3 −3
  223. net/switchdev/switchdev.c +1 −1
  224. net/xfrm/xfrm_input.c +3 −0
  225. sound/core/timer.c +15 −9
  226. sound/core/timer_compat.c +29 −1
  227. sound/firewire/dice/dice-stream.c +4 −10
  228. sound/pci/hda/hda_intel.c +4 −0
  229. sound/pci/hda/patch_realtek.c +18 −1
  230. sound/usb/quirks.c +4 −0
  231. sound/usb/stream.c +5 −1
  232. tools/lib/lockdep/run_tests.sh +8 −4
  233. tools/perf/MANIFEST +1 −0
  234. tools/perf/arch/powerpc/util/header.c +2 −0
  235. tools/perf/tests/perf-targz-src-pkg +1 −1
  236. tools/perf/ui/browsers/hists.c +1 −1
  237. tools/perf/util/event.c +16 −7
  238. tools/perf/util/genelf.h +10 −14
  239. tools/perf/util/intel-bts.c +1 −0
  240. tools/perf/util/intel-pt.c +3 −0
  241. tools/perf/util/jitdump.c +2 −0
.mailmap+1−0
@@ -33,6 +33,7 @@ Björn Steinbrink <B.Steinbrink@gmx.de> · 32 unmodified lines
3333 Brian Avery <b.avery@hp.com>
3434 Brian King <brking@us.ibm.com>
3535 Christoph Hellwig <hch@lst.de>
36+Christophe Ricard <christophe.ricard@gmail.com>
3637 Corey Minyard <minyard@acm.org>
3738 Damian Hobson-Garcia <dhobsong@igel.co.jp>
3839 David Brownell <david-b@pacbell.net>
Documentation/networking/switchdev.txt+1−1
@@ -386,7 +386,7 @@ used. First phase is to "prepare" anything needed, including various checks, · 385 unmodified lines
386386 memory allocation, etc. The goal is to handle the stuff that is not unlikely
387387 to fail here. The second phase is to "commit" the actual changes.
388388
389−Switchdev provides an inftrastructure for sharing items (for example memory
389+Switchdev provides an infrastructure for sharing items (for example memory
390390 allocations) between the two phases.
391391
392392 The object created by a driver in "prepare" phase and it is queued up by:
Documentation/x86/topology.txt+208−0
@@ -0,0 +1,208 @@
1+x86 Topology
2+============
3+
4+This documents and clarifies the main aspects of x86 topology modelling and
5+representation in the kernel. Update/change when doing changes to the
6+respective code.
7+
8+The architecture-agnostic topology definitions are in
9+Documentation/cputopology.txt. This file holds x86-specific
10+differences/specialities which must not necessarily apply to the generic
11+definitions. Thus, the way to read up on Linux topology on x86 is to start
12+with the generic one and look at this one in parallel for the x86 specifics.
13+
14+Needless to say, code should use the generic functions - this file is *only*
15+here to *document* the inner workings of x86 topology.
16+
17+Started by Thomas Gleixner <tglx@linutronix.de> and Borislav Petkov <bp@alien8.de>.
18+
19+The main aim of the topology facilities is to present adequate interfaces to
20+code which needs to know/query/use the structure of the running system wrt
21+threads, cores, packages, etc.
22+
23+The kernel does not care about the concept of physical sockets because a
24+socket has no relevance to software. It's an electromechanical component. In
25+the past a socket always contained a single package (see below), but with the
26+advent of Multi Chip Modules (MCM) a socket can hold more than one package. So
27+there might be still references to sockets in the code, but they are of
28+historical nature and should be cleaned up.
29+
30+The topology of a system is described in the units of:
31+
32+ - packages
33+ - cores
34+ - threads
35+
36+* Package:
37+
38+ Packages contain a number of cores plus shared resources, e.g. DRAM
39+ controller, shared caches etc.
40+
41+ AMD nomenclature for package is 'Node'.
42+
43+ Package-related topology information in the kernel:
44+
45+ - cpuinfo_x86.x86_max_cores:
46+
47+ The number of cores in a package. This information is retrieved via CPUID.
48+
49+ - cpuinfo_x86.phys_proc_id:
50+
51+ The physical ID of the package. This information is retrieved via CPUID
52+ and deduced from the APIC IDs of the cores in the package.
53+
54+ - cpuinfo_x86.logical_id:
55+
56+ The logical ID of the package. As we do not trust BIOSes to enumerate the
57+ packages in a consistent way, we introduced the concept of logical package
58+ ID so we can sanely calculate the number of maximum possible packages in
59+ the system and have the packages enumerated linearly.
60+
61+ - topology_max_packages():
62+
63+ The maximum possible number of packages in the system. Helpful for per
64+ package facilities to preallocate per package information.
65+
66+
67+* Cores:
68+
69+ A core consists of 1 or more threads. It does not matter whether the threads
70+ are SMT- or CMT-type threads.
71+
72+ AMDs nomenclature for a CMT core is "Compute Unit". The kernel always uses
73+ "core".
74+
75+ Core-related topology information in the kernel:
76+
77+ - smp_num_siblings:
78+
79+ The number of threads in a core. The number of threads in a package can be
80+ calculated by:
81+
82+ threads_per_package = cpuinfo_x86.x86_max_cores * smp_num_siblings
83+
84+
85+* Threads:
86+
87+ A thread is a single scheduling unit. It's the equivalent to a logical Linux
88+ CPU.
89+
90+ AMDs nomenclature for CMT threads is "Compute Unit Core". The kernel always
91+ uses "thread".
92+
93+ Thread-related topology information in the kernel:
94+
95+ - topology_core_cpumask():
96+
97+ The cpumask contains all online threads in the package to which a thread
98+ belongs.
99+
100+ The number of online threads is also printed in /proc/cpuinfo "siblings."
101+
102+ - topology_sibling_mask():
103+
104+ The cpumask contains all online threads in the core to which a thread
105+ belongs.
106+
107+ - topology_logical_package_id():
108+
109+ The logical package ID to which a thread belongs.
110+
111+ - topology_physical_package_id():
112+
113+ The physical package ID to which a thread belongs.
114+
115+ - topology_core_id();
116+
117+ The ID of the core to which a thread belongs. It is also printed in /proc/cpuinfo
118+ "core_id."
119+
120+
121+
122+System topology examples
123+
124+Note:
125+
126+The alternative Linux CPU enumeration depends on how the BIOS enumerates the
127+threads. Many BIOSes enumerate all threads 0 first and then all threads 1.
128+That has the "advantage" that the logical Linux CPU numbers of threads 0 stay
129+the same whether threads are enabled or not. That's merely an implementation
130+detail and has no practical impact.
131+
132+1) Single Package, Single Core
133+
134+ [package 0] -> [core 0] -> [thread 0] -> Linux CPU 0
135+
136+2) Single Package, Dual Core
137+
138+ a) One thread per core
139+
140+ [package 0] -> [core 0] -> [thread 0] -> Linux CPU 0
141+ -> [core 1] -> [thread 0] -> Linux CPU 1
142+
143+ b) Two threads per core
144+
145+ [package 0] -> [core 0] -> [thread 0] -> Linux CPU 0
146+ -> [thread 1] -> Linux CPU 1
147+ -> [core 1] -> [thread 0] -> Linux CPU 2
148+ -> [thread 1] -> Linux CPU 3
149+
150+ Alternative enumeration:
151+
152+ [package 0] -> [core 0] -> [thread 0] -> Linux CPU 0
153+ -> [thread 1] -> Linux CPU 2
154+ -> [core 1] -> [thread 0] -> Linux CPU 1
155+ -> [thread 1] -> Linux CPU 3
156+
157+ AMD nomenclature for CMT systems:
158+
159+ [node 0] -> [Compute Unit 0] -> [Compute Unit Core 0] -> Linux CPU 0
160+ -> [Compute Unit Core 1] -> Linux CPU 1
161+ -> [Compute Unit 1] -> [Compute Unit Core 0] -> Linux CPU 2
162+ -> [Compute Unit Core 1] -> Linux CPU 3
163+
164+4) Dual Package, Dual Core
165+
166+ a) One thread per core
167+
168+ [package 0] -> [core 0] -> [thread 0] -> Linux CPU 0
169+ -> [core 1] -> [thread 0] -> Linux CPU 1
170+
171+ [package 1] -> [core 0] -> [thread 0] -> Linux CPU 2
172+ -> [core 1] -> [thread 0] -> Linux CPU 3
173+
174+ b) Two threads per core
175+
176+ [package 0] -> [core 0] -> [thread 0] -> Linux CPU 0
177+ -> [thread 1] -> Linux CPU 1
178+ -> [core 1] -> [thread 0] -> Linux CPU 2
179+ -> [thread 1] -> Linux CPU 3
180+
181+ [package 1] -> [core 0] -> [thread 0] -> Linux CPU 4
182+ -> [thread 1] -> Linux CPU 5
183+ -> [core 1] -> [thread 0] -> Linux CPU 6
184+ -> [thread 1] -> Linux CPU 7
185+
186+ Alternative enumeration:
187+
188+ [package 0] -> [core 0] -> [thread 0] -> Linux CPU 0
189+ -> [thread 1] -> Linux CPU 4
190+ -> [core 1] -> [thread 0] -> Linux CPU 1
191+ -> [thread 1] -> Linux CPU 5
192+
193+ [package 1] -> [core 0] -> [thread 0] -> Linux CPU 2
194+ -> [thread 1] -> Linux CPU 6
195+ -> [core 1] -> [thread 0] -> Linux CPU 3
196+ -> [thread 1] -> Linux CPU 7
197+
198+ AMD nomenclature for CMT systems:
199+
200+ [node 0] -> [Compute Unit 0] -> [Compute Unit Core 0] -> Linux CPU 0
201+ -> [Compute Unit Core 1] -> Linux CPU 1
202+ -> [Compute Unit 1] -> [Compute Unit Core 0] -> Linux CPU 2
203+ -> [Compute Unit Core 1] -> Linux CPU 3
204+
205+ [node 1] -> [Compute Unit 0] -> [Compute Unit Core 0] -> Linux CPU 4
206+ -> [Compute Unit Core 1] -> Linux CPU 5
207+ -> [Compute Unit 1] -> [Compute Unit Core 0] -> Linux CPU 6
208+ -> [Compute Unit Core 1] -> Linux CPU 7
MAINTAINERS+7−4
@@ -5042,6 +5042,7 @@ F: include/linux/hw_random.h · 5041 unmodified lines
50425042 HARDWARE SPINLOCK CORE
50435043 M: Ohad Ben-Cohen <ohad@wizery.com>
50445044 M: Bjorn Andersson <bjorn.andersson@linaro.org>
5045+L: linux-remoteproc@vger.kernel.org
50455046 S: Maintained
50465047 T: git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock.git
50475048 F: Documentation/hwspinlock.txt
@@ -6402,7 +6403,7 @@ KPROBES · 1354 unmodified lines
64026403 M: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
64036404 M: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
64046405 M: "David S. Miller" <davem@davemloft.net>
6405−M: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
6406+M: Masami Hiramatsu <mhiramat@kernel.org>
64066407 S: Maintained
64076408 F: Documentation/kprobes.txt
64086409 F: include/linux/kprobes.h
@@ -8253,7 +8254,7 @@ F: Documentation/filesystems/overlayfs.txt · 1844 unmodified lines
82538254
82548255 ORANGEFS FILESYSTEM
82558256 M: Mike Marshall <hubcap@omnibond.com>
8256−L: pvfs2-developers@beowulf-underground.org
8257+L: pvfs2-developers@beowulf-underground.org (subscribers-only)
82578258 T: git git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux.git
82588259 S: Supported
82598260 F: fs/orangefs/
@@ -9314,6 +9315,7 @@ F: include/linux/regmap.h · 1054 unmodified lines
93149315 REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM
93159316 M: Ohad Ben-Cohen <ohad@wizery.com>
93169317 M: Bjorn Andersson <bjorn.andersson@linaro.org>
9318+L: linux-remoteproc@vger.kernel.org
93179319 T: git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc.git
93189320 S: Maintained
93199321 F: drivers/remoteproc/
@@ -9323,6 +9325,7 @@ F: include/linux/remoteproc.h · 3 unmodified lines
93239325 REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM
93249326 M: Ohad Ben-Cohen <ohad@wizery.com>
93259327 M: Bjorn Andersson <bjorn.andersson@linaro.org>
9328+L: linux-remoteproc@vger.kernel.org
93269329 T: git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg.git
93279330 S: Maintained
93289331 F: drivers/rpmsg/
@@ -11137,8 +11140,8 @@ F: include/uapi/linux/tipc*.h · 1808 unmodified lines
1113711140 F: net/tipc/
1113811141
1113911142 TILE ARCHITECTURE
11140−M: Chris Metcalf <cmetcalf@ezchip.com>
11141−W: http://www.ezchip.com/scm/
11143+M: Chris Metcalf <cmetcalf@mellanox.com>
11144+W: http://www.mellanox.com/repository/solutions/tile-scm/
1114211145 T: git git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile.git
1114311146 S: Supported
1114411147 F: arch/tile/
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 6
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc1
4+EXTRAVERSION = -rc2
55 NAME = Blurry Fish Butt
66
77 # *DOCUMENTATION*
arch/arm64/configs/defconfig+20−8
@@ -68,11 +68,13 @@ CONFIG_KSM=y · 67 unmodified lines
6868 CONFIG_TRANSPARENT_HUGEPAGE=y
6969 CONFIG_CMA=y
7070 CONFIG_XEN=y
71−CONFIG_CMDLINE="console=ttyAMA0"
7271 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
7372 CONFIG_COMPAT=y
7473 CONFIG_CPU_IDLE=y
7574 CONFIG_ARM_CPUIDLE=y
75+CONFIG_CPU_FREQ=y
76+CONFIG_ARM_BIG_LITTLE_CPUFREQ=y
77+CONFIG_ARM_SCPI_CPUFREQ=y
7678 CONFIG_NET=y
7779 CONFIG_PACKET=y
7880 CONFIG_UNIX=y
@@ -80,7 +82,6 @@ CONFIG_INET=y · 1 unmodified line
8082 CONFIG_IP_PNP=y
8183 CONFIG_IP_PNP_DHCP=y
8284 CONFIG_IP_PNP_BOOTP=y
83−# CONFIG_INET_LRO is not set
8485 # CONFIG_IPV6 is not set
8586 CONFIG_BPF_JIT=y
8687 # CONFIG_WIRELESS is not set
@@ -144,16 +145,18 @@ CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y · 57 unmodified lines
144145 CONFIG_SERIAL_MVEBU_UART=y
145146 CONFIG_VIRTIO_CONSOLE=y
146147 # CONFIG_HW_RANDOM is not set
147−CONFIG_I2C=y
148148 CONFIG_I2C_CHARDEV=y
149+CONFIG_I2C_DESIGNWARE_PLATFORM=y
149150 CONFIG_I2C_MV64XXX=y
150151 CONFIG_I2C_QUP=y
152+CONFIG_I2C_TEGRA=y
151153 CONFIG_I2C_UNIPHIER_F=y
152154 CONFIG_I2C_RCAR=y
153155 CONFIG_SPI=y
154156 CONFIG_SPI_PL022=y
155157 CONFIG_SPI_QUP=y
156158 CONFIG_SPMI=y
159+CONFIG_PINCTRL_SINGLE=y
157160 CONFIG_PINCTRL_MSM8916=y
158161 CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
159162 CONFIG_GPIO_SYSFS=y
@@ -196,6 +199,7 @@ CONFIG_USB_EHCI_HCD_PLATFORM=y · 36 unmodified lines
196199 CONFIG_USB_OHCI_HCD=y
197200 CONFIG_USB_OHCI_HCD_PLATFORM=y
198201 CONFIG_USB_STORAGE=y
202+CONFIG_USB_DWC2=y
199203 CONFIG_USB_CHIPIDEA=y
200204 CONFIG_USB_CHIPIDEA_UDC=y
201205 CONFIG_USB_CHIPIDEA_HOST=y
@@ -205,19 +209,20 @@ CONFIG_USB_MSM_OTG=y · 3 unmodified lines
205209 CONFIG_USB_ULPI=y
206210 CONFIG_USB_GADGET=y
207211 CONFIG_MMC=y
208−CONFIG_MMC_BLOCK_MINORS=16
212+CONFIG_MMC_BLOCK_MINORS=32
209213 CONFIG_MMC_ARMMMCI=y
210214 CONFIG_MMC_SDHCI=y
211215 CONFIG_MMC_SDHCI_PLTFM=y
212216 CONFIG_MMC_SDHCI_TEGRA=y
213217 CONFIG_MMC_SDHCI_MSM=y
214218 CONFIG_MMC_SPI=y
215−CONFIG_MMC_SUNXI=y
216219 CONFIG_MMC_DW=y
217220 CONFIG_MMC_DW_EXYNOS=y
218−CONFIG_MMC_BLOCK_MINORS=16
221+CONFIG_MMC_DW_K3=y
222+CONFIG_MMC_SUNXI=y
219223 CONFIG_NEW_LEDS=y
220224 CONFIG_LEDS_CLASS=y
225+CONFIG_LEDS_GPIO=y
221226 CONFIG_LEDS_SYSCON=y
222227 CONFIG_LEDS_TRIGGERS=y
223228 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
@@ -229,8 +234,8 @@ CONFIG_RTC_DRV_PL031=y · 5 unmodified lines
229234 CONFIG_RTC_DRV_SUN6I=y
230235 CONFIG_RTC_DRV_XGENE=y
231236 CONFIG_DMADEVICES=y
232−CONFIG_QCOM_BAM_DMA=y
233237 CONFIG_TEGRA20_APB_DMA=y
238+CONFIG_QCOM_BAM_DMA=y
234239 CONFIG_RCAR_DMAC=y
235240 CONFIG_VFIO=y
236241 CONFIG_VFIO_PCI=y
@@ -239,20 +244,26 @@ CONFIG_VIRTIO_BALLOON=y · 2 unmodified lines
239244 CONFIG_VIRTIO_MMIO=y
240245 CONFIG_XEN_GNTDEV=y
241246 CONFIG_XEN_GRANT_DEV_ALLOC=y
247+CONFIG_COMMON_CLK_SCPI=y
242248 CONFIG_COMMON_CLK_CS2000_CP=y
243249 CONFIG_COMMON_CLK_QCOM=y
244250 CONFIG_MSM_GCC_8916=y
245251 CONFIG_HWSPINLOCK_QCOM=y
252+CONFIG_MAILBOX=y
253+CONFIG_ARM_MHU=y
254+CONFIG_HI6220_MBOX=y
246255 CONFIG_ARM_SMMU=y
247256 CONFIG_QCOM_SMEM=y
248257 CONFIG_QCOM_SMD=y
249258 CONFIG_QCOM_SMD_RPM=y
250259 CONFIG_ARCH_TEGRA_132_SOC=y
251260 CONFIG_ARCH_TEGRA_210_SOC=y
252−CONFIG_HISILICON_IRQ_MBIGEN=y
253261 CONFIG_EXTCON_USB_GPIO=y
262+CONFIG_COMMON_RESET_HI6220=y
254263 CONFIG_PHY_RCAR_GEN3_USB2=y
264+CONFIG_PHY_HI6220_USB=y
255265 CONFIG_PHY_XGENE=y
266+CONFIG_ARM_SCPI_PROTOCOL=y
256267 CONFIG_EXT2_FS=y
257268 CONFIG_EXT3_FS=y
258269 CONFIG_FANOTIFY=y
@@ -264,6 +275,7 @@ CONFIG_CUSE=y · 5 unmodified lines
264275 CONFIG_VFAT_FS=y
265276 CONFIG_TMPFS=y
266277 CONFIG_HUGETLBFS=y
278+CONFIG_CONFIGFS_FS=y
267279 CONFIG_EFIVAR_FS=y
268280 CONFIG_SQUASHFS=y
269281 CONFIG_NFS_FS=y
arch/arm64/include/asm/kvm_host.h+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 #include <asm/kvm.h>
2828 #include <asm/kvm_asm.h>
2929 #include <asm/kvm_mmio.h>
30−#include <asm/kvm_perf_event.h>
3130
3231 #define __KVM_HAVE_ARCH_INTC_INITIALIZED
3332
arch/arm64/include/asm/kvm_hyp.h+0−1
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 #include <linux/compiler.h>
2222 #include <linux/kvm_host.h>
2323 #include <asm/kvm_mmu.h>
24−#include <asm/kvm_perf_event.h>
2524 #include <asm/sysreg.h>
2625
2726 #define __hyp_text __section(.hyp.text) notrace
arch/arm64/include/asm/kvm_perf_event.h+0−68
@@ -1,68 +0,0 @@
1−/*
2− * Copyright (C) 2012 ARM Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License version 2 as
6− * published by the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−#ifndef __ASM_KVM_PERF_EVENT_H
18−#define __ASM_KVM_PERF_EVENT_H
19−
20−#define ARMV8_PMU_MAX_COUNTERS 32
21−#define ARMV8_PMU_COUNTER_MASK (ARMV8_PMU_MAX_COUNTERS - 1)
22−
23−/*
24− * Per-CPU PMCR: config reg
25− */
26−#define ARMV8_PMU_PMCR_E (1 << 0) /* Enable all counters */
27−#define ARMV8_PMU_PMCR_P (1 << 1) /* Reset all counters */
28−#define ARMV8_PMU_PMCR_C (1 << 2) /* Cycle counter reset */
29−#define ARMV8_PMU_PMCR_D (1 << 3) /* CCNT counts every 64th cpu cycle */
30−#define ARMV8_PMU_PMCR_X (1 << 4) /* Export to ETM */
31−#define ARMV8_PMU_PMCR_DP (1 << 5) /* Disable CCNT if non-invasive debug*/
32−/* Determines which bit of PMCCNTR_EL0 generates an overflow */
33−#define ARMV8_PMU_PMCR_LC (1 << 6)
34−#define ARMV8_PMU_PMCR_N_SHIFT 11 /* Number of counters supported */
35−#define ARMV8_PMU_PMCR_N_MASK 0x1f
36−#define ARMV8_PMU_PMCR_MASK 0x7f /* Mask for writable bits */
37−
38−/*
39− * PMOVSR: counters overflow flag status reg
40− */
41−#define ARMV8_PMU_OVSR_MASK 0xffffffff /* Mask for writable bits */
42−#define ARMV8_PMU_OVERFLOWED_MASK ARMV8_PMU_OVSR_MASK
43−
44−/*
45− * PMXEVTYPER: Event selection reg
46− */
47−#define ARMV8_PMU_EVTYPE_MASK 0xc80003ff /* Mask for writable bits */
48−#define ARMV8_PMU_EVTYPE_EVENT 0x3ff /* Mask for EVENT bits */
49−
50−#define ARMV8_PMU_EVTYPE_EVENT_SW_INCR 0 /* Software increment event */
51−
52−/*
53− * Event filters for PMUv3
54− */
55−#define ARMV8_PMU_EXCLUDE_EL1 (1 << 31)
56−#define ARMV8_PMU_EXCLUDE_EL0 (1 << 30)
57−#define ARMV8_PMU_INCLUDE_EL2 (1 << 27)
58−
59−/*
60− * PMUSERENR: user enable reg
61− */
62−#define ARMV8_PMU_USERENR_MASK 0xf /* Mask for writable bits */
63−#define ARMV8_PMU_USERENR_EN (1 << 0) /* PMU regs can be accessed at EL0 */
64−#define ARMV8_PMU_USERENR_SW (1 << 1) /* PMSWINC can be written at EL0 */
65−#define ARMV8_PMU_USERENR_CR (1 << 2) /* Cycle counter can be read at EL0 */
66−#define ARMV8_PMU_USERENR_ER (1 << 3) /* Event counter can be read at EL0 */
67−
68−#endif
arch/arm64/include/asm/opcodes.h+4−0
@@ -1 +1,5 @@
1+#ifdef CONFIG_CPU_BIG_ENDIAN
2+#define CONFIG_CPU_ENDIAN_BE8 CONFIG_CPU_BIG_ENDIAN
3+#endif
4+
15 #include <../../arm/include/asm/opcodes.h>
arch/arm64/include/asm/perf_event.h+47−0
@@ -17,6 +17,53 @@ · 16 unmodified lines
1717 #ifndef __ASM_PERF_EVENT_H
1818 #define __ASM_PERF_EVENT_H
1919
20+#define ARMV8_PMU_MAX_COUNTERS 32
21+#define ARMV8_PMU_COUNTER_MASK (ARMV8_PMU_MAX_COUNTERS - 1)
22+
23+/*
24+ * Per-CPU PMCR: config reg
25+ */
26+#define ARMV8_PMU_PMCR_E (1 << 0) /* Enable all counters */
27+#define ARMV8_PMU_PMCR_P (1 << 1) /* Reset all counters */
28+#define ARMV8_PMU_PMCR_C (1 << 2) /* Cycle counter reset */
29+#define ARMV8_PMU_PMCR_D (1 << 3) /* CCNT counts every 64th cpu cycle */
30+#define ARMV8_PMU_PMCR_X (1 << 4) /* Export to ETM */
31+#define ARMV8_PMU_PMCR_DP (1 << 5) /* Disable CCNT if non-invasive debug*/
32+#define ARMV8_PMU_PMCR_LC (1 << 6) /* Overflow on 64 bit cycle counter */
33+#define ARMV8_PMU_PMCR_N_SHIFT 11 /* Number of counters supported */
34+#define ARMV8_PMU_PMCR_N_MASK 0x1f
35+#define ARMV8_PMU_PMCR_MASK 0x7f /* Mask for writable bits */
36+
37+/*
38+ * PMOVSR: counters overflow flag status reg
39+ */
40+#define ARMV8_PMU_OVSR_MASK 0xffffffff /* Mask for writable bits */
41+#define ARMV8_PMU_OVERFLOWED_MASK ARMV8_PMU_OVSR_MASK
42+
43+/*
44+ * PMXEVTYPER: Event selection reg
45+ */
46+#define ARMV8_PMU_EVTYPE_MASK 0xc800ffff /* Mask for writable bits */
47+#define ARMV8_PMU_EVTYPE_EVENT 0xffff /* Mask for EVENT bits */
48+
49+#define ARMV8_PMU_EVTYPE_EVENT_SW_INCR 0 /* Software increment event */
50+
51+/*
52+ * Event filters for PMUv3
53+ */
54+#define ARMV8_PMU_EXCLUDE_EL1 (1 << 31)
55+#define ARMV8_PMU_EXCLUDE_EL0 (1 << 30)
56+#define ARMV8_PMU_INCLUDE_EL2 (1 << 27)
57+
58+/*
59+ * PMUSERENR: user enable reg
60+ */
61+#define ARMV8_PMU_USERENR_MASK 0xf /* Mask for writable bits */
62+#define ARMV8_PMU_USERENR_EN (1 << 0) /* PMU regs can be accessed at EL0 */
63+#define ARMV8_PMU_USERENR_SW (1 << 1) /* PMSWINC can be written at EL0 */
64+#define ARMV8_PMU_USERENR_CR (1 << 2) /* Cycle counter can be read at EL0 */
65+#define ARMV8_PMU_USERENR_ER (1 << 3) /* Event counter can be read at EL0 */
66+
2067 #ifdef CONFIG_PERF_EVENTS
2168 struct pt_regs;
2269 extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
arch/arm64/kernel/perf_event.c+19−53
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 */
2121
2222 #include <asm/irq_regs.h>
23+#include <asm/perf_event.h>
2324 #include <asm/virt.h>
2425
2526 #include <linux/of.h>
@@ -384,9 +385,6 @@ static const struct attribute_group *armv8_pmuv3_attr_groups[] = { · 358 unmodified lines
384385 #define ARMV8_IDX_COUNTER_LAST(cpu_pmu) \
385386 (ARMV8_IDX_CYCLE_COUNTER + cpu_pmu->num_events - 1)
386387
387−#define ARMV8_MAX_COUNTERS 32
388−#define ARMV8_COUNTER_MASK (ARMV8_MAX_COUNTERS - 1)
389−
390388 /*
391389 * ARMv8 low level PMU access
392390 */
@@ -395,40 +393,7 @@ static const struct attribute_group *armv8_pmuv3_attr_groups[] = { · 2 unmodified lines
395393 * Perf Event to low level counters mapping
396394 */
397395 #define ARMV8_IDX_TO_COUNTER(x) \
398− (((x) - ARMV8_IDX_COUNTER0) & ARMV8_COUNTER_MASK)
399−
400−/*
401− * Per-CPU PMCR: config reg
402− */
403−#define ARMV8_PMCR_E (1 << 0) /* Enable all counters */
404−#define ARMV8_PMCR_P (1 << 1) /* Reset all counters */
405−#define ARMV8_PMCR_C (1 << 2) /* Cycle counter reset */
406−#define ARMV8_PMCR_D (1 << 3) /* CCNT counts every 64th cpu cycle */
407−#define ARMV8_PMCR_X (1 << 4) /* Export to ETM */
408−#define ARMV8_PMCR_DP (1 << 5) /* Disable CCNT if non-invasive debug*/
409−#define ARMV8_PMCR_LC (1 << 6) /* Overflow on 64 bit cycle counter */
410−#define ARMV8_PMCR_N_SHIFT 11 /* Number of counters supported */
411−#define ARMV8_PMCR_N_MASK 0x1f
412−#define ARMV8_PMCR_MASK 0x7f /* Mask for writable bits */
413−
414−/*
415− * PMOVSR: counters overflow flag status reg
416− */
417−#define ARMV8_OVSR_MASK 0xffffffff /* Mask for writable bits */
418−#define ARMV8_OVERFLOWED_MASK ARMV8_OVSR_MASK
419−
420−/*
421− * PMXEVTYPER: Event selection reg
422− */
423−#define ARMV8_EVTYPE_MASK 0xc800ffff /* Mask for writable bits */
424−#define ARMV8_EVTYPE_EVENT 0xffff /* Mask for EVENT bits */
425−
426−/*
427− * Event filters for PMUv3
428− */
429−#define ARMV8_EXCLUDE_EL1 (1 << 31)
430−#define ARMV8_EXCLUDE_EL0 (1 << 30)
431−#define ARMV8_INCLUDE_EL2 (1 << 27)
396+ (((x) - ARMV8_IDX_COUNTER0) & ARMV8_PMU_COUNTER_MASK)
432397
433398 static inline u32 armv8pmu_pmcr_read(void)
434399 {
@@ -439,14 +404,14 @@ static inline u32 armv8pmu_pmcr_read(void) · 4 unmodified lines
439404
440405 static inline void armv8pmu_pmcr_write(u32 val)
441406 {
442− val &= ARMV8_PMCR_MASK;
407+ val &= ARMV8_PMU_PMCR_MASK;
443408 isb();
444409 asm volatile("msr pmcr_el0, %0" :: "r" (val));
445410 }
446411
447412 static inline int armv8pmu_has_overflowed(u32 pmovsr)
448413 {
449− return pmovsr & ARMV8_OVERFLOWED_MASK;
414+ return pmovsr & ARMV8_PMU_OVERFLOWED_MASK;
450415 }
451416
452417 static inline int armv8pmu_counter_valid(struct arm_pmu *cpu_pmu, int idx)
@@ -512,7 +477,7 @@ static inline void armv8pmu_write_counter(struct perf_event *event, u32 value) · 59 unmodified lines
512477 static inline void armv8pmu_write_evtype(int idx, u32 val)
513478 {
514479 if (armv8pmu_select_counter(idx) == idx) {
515− val &= ARMV8_EVTYPE_MASK;
480+ val &= ARMV8_PMU_EVTYPE_MASK;
516481 asm volatile("msr pmxevtyper_el0, %0" :: "r" (val));
517482 }
518483 }
@@ -558,7 +523,7 @@ static inline u32 armv8pmu_getreset_flags(void) · 39 unmodified lines
558523 asm volatile("mrs %0, pmovsclr_el0" : "=r" (value));
559524
560525 /* Write to clear flags */
561− value &= ARMV8_OVSR_MASK;
526+ value &= ARMV8_PMU_OVSR_MASK;
562527 asm volatile("msr pmovsclr_el0, %0" :: "r" (value));
563528
564529 return value;
@@ -696,7 +661,7 @@ static void armv8pmu_start(struct arm_pmu *cpu_pmu) · 131 unmodified lines
696661
697662 raw_spin_lock_irqsave(&events->pmu_lock, flags);
698663 /* Enable all counters */
699− armv8pmu_pmcr_write(armv8pmu_pmcr_read() | ARMV8_PMCR_E);
664+ armv8pmu_pmcr_write(armv8pmu_pmcr_read() | ARMV8_PMU_PMCR_E);
700665 raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
701666 }
702667
@@ -707,7 +672,7 @@ static void armv8pmu_stop(struct arm_pmu *cpu_pmu) · 4 unmodified lines
707672
708673 raw_spin_lock_irqsave(&events->pmu_lock, flags);
709674 /* Disable all counters */
710− armv8pmu_pmcr_write(armv8pmu_pmcr_read() & ~ARMV8_PMCR_E);
675+ armv8pmu_pmcr_write(armv8pmu_pmcr_read() & ~ARMV8_PMU_PMCR_E);
711676 raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
712677 }
713678
@@ -717,7 +682,7 @@ static int armv8pmu_get_event_idx(struct pmu_hw_events *cpuc, · 3 unmodified lines
717682 int idx;
718683 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu);
719684 struct hw_perf_event *hwc = &event->hw;
720− unsigned long evtype = hwc->config_base & ARMV8_EVTYPE_EVENT;
685+ unsigned long evtype = hwc->config_base & ARMV8_PMU_EVTYPE_EVENT;
721686
722687 /* Always place a cycle counter into the cycle counter. */
723688 if (evtype == ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES) {
@@ -754,11 +719,11 @@ static int armv8pmu_set_event_filter(struct hw_perf_event *event, · 30 unmodified lines
754719 attr->exclude_kernel != attr->exclude_hv)
755720 return -EINVAL;
756721 if (attr->exclude_user)
757− config_base |= ARMV8_EXCLUDE_EL0;
722+ config_base |= ARMV8_PMU_EXCLUDE_EL0;
758723 if (!is_kernel_in_hyp_mode() && attr->exclude_kernel)
759− config_base |= ARMV8_EXCLUDE_EL1;
724+ config_base |= ARMV8_PMU_EXCLUDE_EL1;
760725 if (!attr->exclude_hv)
761− config_base |= ARMV8_INCLUDE_EL2;
726+ config_base |= ARMV8_PMU_INCLUDE_EL2;
762727
763728 /*
764729 * Install the filter into config_base as this is used to
@@ -784,35 +749,36 @@ static void armv8pmu_reset(void *info) · 19 unmodified lines
784749 * Initialize & Reset PMNC. Request overflow interrupt for
785750 * 64 bit cycle counter but cheat in armv8pmu_write_counter().
786751 */
787− armv8pmu_pmcr_write(ARMV8_PMCR_P | ARMV8_PMCR_C | ARMV8_PMCR_LC);
752+ armv8pmu_pmcr_write(ARMV8_PMU_PMCR_P | ARMV8_PMU_PMCR_C |
753+ ARMV8_PMU_PMCR_LC);
788754 }
789755
790756 static int armv8_pmuv3_map_event(struct perf_event *event)
791757 {
792758 return armpmu_map_event(event, &armv8_pmuv3_perf_map,
793759 &armv8_pmuv3_perf_cache_map,
794− ARMV8_EVTYPE_EVENT);
760+ ARMV8_PMU_EVTYPE_EVENT);
795761 }
796762
797763 static int armv8_a53_map_event(struct perf_event *event)
798764 {
799765 return armpmu_map_event(event, &armv8_a53_perf_map,
800766 &armv8_a53_perf_cache_map,
801− ARMV8_EVTYPE_EVENT);
767+ ARMV8_PMU_EVTYPE_EVENT);
802768 }
803769
804770 static int armv8_a57_map_event(struct perf_event *event)
805771 {
806772 return armpmu_map_event(event, &armv8_a57_perf_map,
807773 &armv8_a57_perf_cache_map,
808− ARMV8_EVTYPE_EVENT);
774+ ARMV8_PMU_EVTYPE_EVENT);
809775 }
810776
811777 static int armv8_thunder_map_event(struct perf_event *event)
812778 {
813779 return armpmu_map_event(event, &armv8_thunder_perf_map,
814780 &armv8_thunder_perf_cache_map,
815− ARMV8_EVTYPE_EVENT);
781+ ARMV8_PMU_EVTYPE_EVENT);
816782 }
817783
818784 static void armv8pmu_read_num_pmnc_events(void *info)
@@ -820,7 +786,7 @@ static void armv8pmu_read_num_pmnc_events(void *info) · 1 unmodified line
820786 int *nb_cnt = info;
821787
822788 /* Read the nb of CNTx counters supported from PMNC */
823− *nb_cnt = (armv8pmu_pmcr_read() >> ARMV8_PMCR_N_SHIFT) & ARMV8_PMCR_N_MASK;
789+ *nb_cnt = (armv8pmu_pmcr_read() >> ARMV8_PMU_PMCR_N_SHIFT) & ARMV8_PMU_PMCR_N_MASK;
824790
825791 /* Add the CPU cycles counter */
826792 *nb_cnt += 1;
arch/nios2/kernel/prom.c+1−2
@@ -97,8 +97,7 @@ static int __init early_init_dt_scan_serial(unsigned long node, · 96 unmodified lines
9797 return 0;
9898 #endif
9999
100− *addr64 = fdt_translate_address((const void *)initial_boot_params,
101− node);
100+ *addr64 = of_flat_dt_translate_address(node);
102101
103102 return *addr64 == OF_BAD_ADDR ? 0 : 1;
104103 }
arch/parisc/Kconfig+1−0
@@ -30,6 +30,7 @@ config PARISC · 29 unmodified lines
3030 select TTY # Needed for pdc_cons.c
3131 select HAVE_DEBUG_STACKOVERFLOW
3232 select HAVE_ARCH_AUDITSYSCALL
33+ select HAVE_ARCH_SECCOMP_FILTER
3334 select ARCH_NO_COHERENT_DMA_MMAP
3435
3536 help
arch/parisc/include/asm/compat.h+7−0
@@ -183,6 +183,13 @@ typedef struct compat_siginfo { · 182 unmodified lines
183183 int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
184184 int _fd;
185185 } _sigpoll;
186+
187+ /* SIGSYS */
188+ struct {
189+ compat_uptr_t _call_addr; /* calling user insn */
190+ int _syscall; /* triggering system call number */
191+ compat_uint_t _arch; /* AUDIT_ARCH_* of syscall */
192+ } _sigsys;
186193 } _sifields;
187194 } compat_siginfo_t;
188195
arch/parisc/include/asm/syscall.h+13−0
@@ -39,6 +39,19 @@ static inline void syscall_get_arguments(struct task_struct *tsk, · 38 unmodified lines
3939 }
4040 }
4141
42+static inline void syscall_set_return_value(struct task_struct *task,
43+ struct pt_regs *regs,
44+ int error, long val)
45+{
46+ regs->gr[28] = error ? error : val;
47+}
48+
49+static inline void syscall_rollback(struct task_struct *task,
50+ struct pt_regs *regs)
51+{
52+ /* do nothing */
53+}
54+
4255 static inline int syscall_get_arch(void)
4356 {
4457 int arch = AUDIT_ARCH_PARISC;
arch/parisc/kernel/ptrace.c+7−2
@@ -270,7 +270,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, · 269 unmodified lines
270270 long do_syscall_trace_enter(struct pt_regs *regs)
271271 {
272272 /* Do the secure computing check first. */
273− secure_computing_strict(regs->gr[20]);
273+ if (secure_computing() == -1)
274+ return -1;
274275
275276 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
276277 tracehook_report_syscall_entry(regs)) {
@@ -296,7 +297,11 @@ long do_syscall_trace_enter(struct pt_regs *regs) · 19 unmodified lines
296297 regs->gr[23] & 0xffffffff);
297298
298299 out:
299− return regs->gr[20];
300+ /*
301+ * Sign extend the syscall number to 64bit since it may have been
302+ * modified by a compat ptrace call
303+ */
304+ return (int) ((u32) regs->gr[20]);
300305 }
301306
302307 void do_syscall_trace_exit(struct pt_regs *regs)
arch/parisc/kernel/signal32.c+5−0
@@ -371,6 +371,11 @@ copy_siginfo_to_user32 (compat_siginfo_t __user *to, const siginfo_t *from) · 370 unmodified lines
371371 val = (compat_int_t)from->si_int;
372372 err |= __put_user(val, &to->si_int);
373373 break;
374+ case __SI_SYS >> 16:
375+ err |= __put_user(ptr_to_compat(from->si_call_addr), &to->si_call_addr);
376+ err |= __put_user(from->si_syscall, &to->si_syscall);
377+ err |= __put_user(from->si_arch, &to->si_arch);
378+ break;
374379 }
375380 }
376381 return err;
arch/parisc/kernel/syscall.S+2−0
@@ -329,6 +329,7 @@ tracesys_next: · 328 unmodified lines
329329
330330 ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
331331 LDREG TI_TASK(%r1), %r1
332+ LDREG TASK_PT_GR28(%r1), %r28 /* Restore return value */
332333 LDREG TASK_PT_GR26(%r1), %r26 /* Restore the users args */
333334 LDREG TASK_PT_GR25(%r1), %r25
334335 LDREG TASK_PT_GR24(%r1), %r24
@@ -342,6 +343,7 @@ tracesys_next: · 7 unmodified lines
342343 stw %r21, -56(%r30) /* 6th argument */
343344 #endif
344345
346+ cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */
345347 comiclr,>>= __NR_Linux_syscalls, %r20, %r0
346348 b,n .Ltracesys_nosys
347349
arch/powerpc/include/asm/processor.h+1−1
@@ -246,7 +246,7 @@ struct thread_struct { · 245 unmodified lines
246246 #endif /* CONFIG_ALTIVEC */
247247 #ifdef CONFIG_VSX
248248 /* VSR status */
249− int used_vsr; /* set if process has used altivec */
249+ int used_vsr; /* set if process has used VSX */
250250 #endif /* CONFIG_VSX */
251251 #ifdef CONFIG_SPE
252252 unsigned long evr[32]; /* upper 32-bits of SPE regs */
arch/powerpc/kernel/process.c+1−1
@@ -983,7 +983,7 @@ void restore_tm_state(struct pt_regs *regs) · 982 unmodified lines
983983 static inline void save_sprs(struct thread_struct *t)
984984 {
985985 #ifdef CONFIG_ALTIVEC
986− if (cpu_has_feature(cpu_has_feature(CPU_FTR_ALTIVEC)))
986+ if (cpu_has_feature(CPU_FTR_ALTIVEC))
987987 t->vrsave = mfspr(SPRN_VRSAVE);
988988 #endif
989989 #ifdef CONFIG_PPC_BOOK3S_64
arch/powerpc/mm/hugetlbpage.c+2−2
@@ -413,13 +413,13 @@ static void hugepd_free(struct mmu_gather *tlb, void *hugepte) · 412 unmodified lines
413413 {
414414 struct hugepd_freelist **batchp;
415415
416− batchp = this_cpu_ptr(&hugepd_freelist_cur);
416+ batchp = &get_cpu_var(hugepd_freelist_cur);
417417
418418 if (atomic_read(&tlb->mm->mm_users) < 2 ||
419419 cpumask_equal(mm_cpumask(tlb->mm),
420420 cpumask_of(smp_processor_id()))) {
421421 kmem_cache_free(hugepte_cache, hugepte);
422− put_cpu_var(hugepd_freelist_cur);
422+ put_cpu_var(hugepd_freelist_cur);
423423 return;
424424 }
425425
arch/s390/Kconfig+3−0
@@ -59,6 +59,9 @@ config PCI_QUIRKS · 58 unmodified lines
5959 config ARCH_SUPPORTS_UPROBES
6060 def_bool y
6161
62+config DEBUG_RODATA
63+ def_bool y
64+
6265 config S390
6366 def_bool y
6467 select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
arch/s390/crypto/prng.c+2−0
@@ -669,11 +669,13 @@ static const struct file_operations prng_tdes_fops = { · 668 unmodified lines
669669 static struct miscdevice prng_sha512_dev = {
670670 .name = "prandom",
671671 .minor = MISC_DYNAMIC_MINOR,
672+ .mode = 0644,
672673 .fops = &prng_sha512_fops,
673674 };
674675 static struct miscdevice prng_tdes_dev = {
675676 .name = "prandom",
676677 .minor = MISC_DYNAMIC_MINOR,
678+ .mode = 0644,
677679 .fops = &prng_tdes_fops,
678680 };
679681
arch/s390/include/asm/cache.h+3−0
@@ -15,4 +15,7 @@ · 14 unmodified lines
1515
1616 #define __read_mostly __attribute__((__section__(".data..read_mostly")))
1717
18+/* Read-only memory is marked before mark_rodata_ro() is called. */
19+#define __ro_after_init __read_mostly
20+
1821 #endif
arch/s390/include/uapi/asm/unistd.h+3−1
@@ -311,7 +311,9 @@ · 310 unmodified lines
311311 #define __NR_shutdown 373
312312 #define __NR_mlock2 374
313313 #define __NR_copy_file_range 375
314−#define NR_syscalls 376
314+#define __NR_preadv2 376
315+#define __NR_pwritev2 377
316+#define NR_syscalls 378
315317
316318 /*
317319 * There are some system calls that are not present on 64 bit, some
arch/s390/kernel/perf_cpum_cf.c+1−0
@@ -670,6 +670,7 @@ static int cpumf_pmu_notifier(struct notifier_block *self, unsigned long action, · 669 unmodified lines
670670
671671 switch (action & ~CPU_TASKS_FROZEN) {
672672 case CPU_ONLINE:
673+ case CPU_DOWN_FAILED:
673674 flags = PMC_INIT;
674675 smp_call_function_single(cpu, setup_pmc_cpu, &flags, 1);
675676 break;
arch/s390/kernel/perf_cpum_sf.c+1−1
@@ -1521,7 +1521,7 @@ static int cpumf_pmu_notifier(struct notifier_block *self, · 1520 unmodified lines
15211521
15221522 switch (action & ~CPU_TASKS_FROZEN) {
15231523 case CPU_ONLINE:
1524− case CPU_ONLINE_FROZEN:
1524+ case CPU_DOWN_FAILED:
15251525 flags = PMC_INIT;
15261526 smp_call_function_single(cpu, setup_pmc_cpu, &flags, 1);
15271527 break;
arch/s390/kernel/syscalls.S+2−0
@@ -384,3 +384,5 @@ SYSCALL(sys_recvmsg,compat_sys_recvmsg) · 383 unmodified lines
384384 SYSCALL(sys_shutdown,sys_shutdown)
385385 SYSCALL(sys_mlock2,compat_sys_mlock2)
386386 SYSCALL(sys_copy_file_range,compat_sys_copy_file_range) /* 375 */
387+SYSCALL(sys_preadv2,compat_sys_preadv2)
388+SYSCALL(sys_pwritev2,compat_sys_pwritev2)
arch/s390/mm/gup.c+5−3
@@ -20,9 +20,9 @@ · 19 unmodified lines
2020 static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr,
2121 unsigned long end, int write, struct page **pages, int *nr)
2222 {
23+ struct page *head, *page;
2324 unsigned long mask;
2425 pte_t *ptep, pte;
25− struct page *page;
2626
2727 mask = (write ? _PAGE_PROTECT : 0) | _PAGE_INVALID | _PAGE_SPECIAL;
2828
@@ -37,12 +37,14 @@ static inline int gup_pte_range(pmd_t *pmdp, pmd_t pmd, unsigned long addr, · 8 unmodified lines
3737 return 0;
3838 VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
3939 page = pte_page(pte);
40− if (!page_cache_get_speculative(page))
40+ head = compound_head(page);
41+ if (!page_cache_get_speculative(head))
4142 return 0;
4243 if (unlikely(pte_val(pte) != pte_val(*ptep))) {
43− put_page(page);
44+ put_page(head);
4445 return 0;
4546 }
47+ VM_BUG_ON_PAGE(compound_head(page) != head, page);
4648 pages[*nr] = page;
4749 (*nr)++;
4850
arch/s390/mm/init.c+7−3
@@ -108,6 +108,13 @@ void __init paging_init(void) · 107 unmodified lines
108108 free_area_init_nodes(max_zone_pfns);
109109 }
110110
111+void mark_rodata_ro(void)
112+{
113+ /* Text and rodata are already protected. Nothing to do here. */
114+ pr_info("Write protecting the kernel read-only data: %luk\n",
115+ ((unsigned long)&_eshared - (unsigned long)&_stext) >> 10);
116+}
117+
111118 void __init mem_init(void)
112119 {
113120 if (MACHINE_HAS_TLB_LC)
@@ -126,9 +133,6 @@ void __init mem_init(void) · 12 unmodified lines
126133 setup_zero_pages(); /* Setup zeroed pages. */
127134
128135 mem_init_print_info(NULL);
129− printk("Write protected kernel read-only data: %#lx - %#lx\n",
130− (unsigned long)&_stext,
131− PFN_ALIGN((unsigned long)&_eshared) - 1);
132136 }
133137
134138 void free_initmem(void)
arch/s390/pci/pci_clp.c+1−2
@@ -176,8 +176,7 @@ static int clp_query_pci_fn(struct zpci_dev *zdev, u32 fh) · 175 unmodified lines
176176 rc = clp_store_query_pci_fn(zdev, &rrb->response);
177177 if (rc)
178178 goto out;
179− if (rrb->response.pfgid)
180− rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid);
179+ rc = clp_query_pci_fngrp(zdev, rrb->response.pfgid);
181180 } else {
182181 zpci_err("Q PCI FN:\n");
183182 zpci_err_clp(rrb->response.hdr.rsp, rc);
arch/sparc/include/asm/compat_signal.h+4−4
@@ -6,17 +6,17 @@ · 5 unmodified lines
66
77 #ifdef CONFIG_COMPAT
88 struct __new_sigaction32 {
9− unsigned sa_handler;
9+ unsigned int sa_handler;
1010 unsigned int sa_flags;
11− unsigned sa_restorer; /* not used by Linux/SPARC yet */
11+ unsigned int sa_restorer; /* not used by Linux/SPARC yet */
1212 compat_sigset_t sa_mask;
1313 };
1414
1515 struct __old_sigaction32 {
16− unsigned sa_handler;
16+ unsigned int sa_handler;
1717 compat_old_sigset_t sa_mask;
1818 unsigned int sa_flags;
19− unsigned sa_restorer; /* not used by Linux/SPARC yet */
19+ unsigned int sa_restorer; /* not used by Linux/SPARC yet */
2020 };
2121 #endif
2222
arch/sparc/include/asm/obio.h+16−16
@@ -117,9 +117,9 @@ static inline void bw_clear_intr_mask(int sbus_level, int mask) · 116 unmodified lines
117117 "i" (ASI_M_CTL));
118118 }
119119
120−static inline unsigned bw_get_prof_limit(int cpu)
120+static inline unsigned int bw_get_prof_limit(int cpu)
121121 {
122− unsigned limit;
122+ unsigned int limit;
123123
124124 __asm__ __volatile__ ("lda [%1] %2, %0" :
125125 "=r" (limit) :
@@ -128,7 +128,7 @@ static inline unsigned bw_get_prof_limit(int cpu) · 2 unmodified lines
128128 return limit;
129129 }
130130
131−static inline void bw_set_prof_limit(int cpu, unsigned limit)
131+static inline void bw_set_prof_limit(int cpu, unsigned int limit)
132132 {
133133 __asm__ __volatile__ ("sta %0, [%1] %2" : :
134134 "r" (limit),
@@ -136,9 +136,9 @@ static inline void bw_set_prof_limit(int cpu, unsigned limit) · 1 unmodified line
136136 "i" (ASI_M_CTL));
137137 }
138138
139−static inline unsigned bw_get_ctrl(int cpu)
139+static inline unsigned int bw_get_ctrl(int cpu)
140140 {
141− unsigned ctrl;
141+ unsigned int ctrl;
142142
143143 __asm__ __volatile__ ("lda [%1] %2, %0" :
144144 "=r" (ctrl) :
@@ -147,7 +147,7 @@ static inline unsigned bw_get_ctrl(int cpu) · 2 unmodified lines
147147 return ctrl;
148148 }
149149
150−static inline void bw_set_ctrl(int cpu, unsigned ctrl)
150+static inline void bw_set_ctrl(int cpu, unsigned int ctrl)
151151 {
152152 __asm__ __volatile__ ("sta %0, [%1] %2" : :
153153 "r" (ctrl),
@@ -155,9 +155,9 @@ static inline void bw_set_ctrl(int cpu, unsigned ctrl) · 1 unmodified line
155155 "i" (ASI_M_CTL));
156156 }
157157
158−static inline unsigned cc_get_ipen(void)
158+static inline unsigned int cc_get_ipen(void)
159159 {
160− unsigned pending;
160+ unsigned int pending;
161161
162162 __asm__ __volatile__ ("lduha [%1] %2, %0" :
163163 "=r" (pending) :
@@ -166,7 +166,7 @@ static inline unsigned cc_get_ipen(void) · 2 unmodified lines
166166 return pending;
167167 }
168168
169−static inline void cc_set_iclr(unsigned clear)
169+static inline void cc_set_iclr(unsigned int clear)
170170 {
171171 __asm__ __volatile__ ("stha %0, [%1] %2" : :
172172 "r" (clear),
@@ -174,9 +174,9 @@ static inline void cc_set_iclr(unsigned clear) · 1 unmodified line
174174 "i" (ASI_M_MXCC));
175175 }
176176
177−static inline unsigned cc_get_imsk(void)
177+static inline unsigned int cc_get_imsk(void)
178178 {
179− unsigned mask;
179+ unsigned int mask;
180180
181181 __asm__ __volatile__ ("lduha [%1] %2, %0" :
182182 "=r" (mask) :
@@ -185,7 +185,7 @@ static inline unsigned cc_get_imsk(void) · 2 unmodified lines
185185 return mask;
186186 }
187187
188−static inline void cc_set_imsk(unsigned mask)
188+static inline void cc_set_imsk(unsigned int mask)
189189 {
190190 __asm__ __volatile__ ("stha %0, [%1] %2" : :
191191 "r" (mask),
@@ -193,9 +193,9 @@ static inline void cc_set_imsk(unsigned mask) · 1 unmodified line
193193 "i" (ASI_M_MXCC));
194194 }
195195
196−static inline unsigned cc_get_imsk_other(int cpuid)
196+static inline unsigned int cc_get_imsk_other(int cpuid)
197197 {
198− unsigned mask;
198+ unsigned int mask;
199199
200200 __asm__ __volatile__ ("lduha [%1] %2, %0" :
201201 "=r" (mask) :
@@ -204,7 +204,7 @@ static inline unsigned cc_get_imsk_other(int cpuid) · 2 unmodified lines
204204 return mask;
205205 }
206206
207−static inline void cc_set_imsk_other(int cpuid, unsigned mask)
207+static inline void cc_set_imsk_other(int cpuid, unsigned int mask)
208208 {
209209 __asm__ __volatile__ ("stha %0, [%1] %2" : :
210210 "r" (mask),
@@ -212,7 +212,7 @@ static inline void cc_set_imsk_other(int cpuid, unsigned mask) · 1 unmodified line
212212 "i" (ASI_M_CTL));
213213 }
214214
215−static inline void cc_set_igen(unsigned gen)
215+static inline void cc_set_igen(unsigned int gen)
216216 {
217217 __asm__ __volatile__ ("sta %0, [%1] %2" : :
218218 "r" (gen),
arch/sparc/include/asm/openprom.h+5−5
@@ -29,12 +29,12 @@ struct linux_dev_v0_funcs { · 28 unmodified lines
2929 /* V2 and later prom device operations. */
3030 struct linux_dev_v2_funcs {
3131 phandle (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */
32− char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
33− void (*v2_dumb_mem_free)(char *va, unsigned sz);
32+ char * (*v2_dumb_mem_alloc)(char *va, unsigned int sz);
33+ void (*v2_dumb_mem_free)(char *va, unsigned int sz);
3434
3535 /* To map devices into virtual I/O space. */
36− char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz);
37− void (*v2_dumb_munmap)(char *virta, unsigned size);
36+ char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned int paddr, unsigned int sz);
37+ void (*v2_dumb_munmap)(char *virta, unsigned int size);
3838
3939 int (*v2_dev_open)(char *devpath);
4040 void (*v2_dev_close)(int d);
@@ -50,7 +50,7 @@ struct linux_dev_v2_funcs { · 9 unmodified lines
5050 struct linux_mlist_v0 {
5151 struct linux_mlist_v0 *theres_more;
5252 unsigned int start_adr;
53− unsigned num_bytes;
53+ unsigned int num_bytes;
5454 };
5555
5656 struct linux_mem_v0 {
arch/sparc/include/asm/pgtable_64.h+1−1
@@ -218,7 +218,7 @@ extern pgprot_t PAGE_KERNEL_LOCKED; · 217 unmodified lines
218218 extern pgprot_t PAGE_COPY;
219219 extern pgprot_t PAGE_SHARED;
220220
221−/* XXX This uglyness is for the atyfb driver's sparc mmap() support. XXX */
221+/* XXX This ugliness is for the atyfb driver's sparc mmap() support. XXX */
222222 extern unsigned long _PAGE_IE;
223223 extern unsigned long _PAGE_E;
224224 extern unsigned long _PAGE_CACHE;
arch/sparc/include/asm/processor_64.h+1−1
@@ -201,7 +201,7 @@ unsigned long get_wchan(struct task_struct *task); · 200 unmodified lines
201201 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->u_regs[UREG_FP])
202202
203203 /* Please see the commentary in asm/backoff.h for a description of
204− * what these instructions are doing and how they have been choosen.
204+ * what these instructions are doing and how they have been chosen.
205205 * To make a long story short, we are trying to yield the current cpu
206206 * strand during busy loops.
207207 */
arch/sparc/include/asm/sigcontext.h+1−1
@@ -25,7 +25,7 @@ struct sigcontext32 { · 24 unmodified lines
2525 int sigc_oswins; /* outstanding windows */
2626
2727 /* stack ptrs for each regwin buf */
28− unsigned sigc_spbuf[__SUNOS_MAXWIN];
28+ unsigned int sigc_spbuf[__SUNOS_MAXWIN];
2929
3030 /* Windows to restore after signal */
3131 struct reg_window32 sigc_wbuf[__SUNOS_MAXWIN];
arch/sparc/include/asm/tsb.h+1−1
@@ -149,7 +149,7 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end; · 148 unmodified lines
149149 * page size in question. So for PMD mappings (which fall on
150150 * bit 23, for 8MB per PMD) we must propagate bit 22 for a
151151 * 4MB huge page. For huge PUDs (which fall on bit 33, for
152− * 8GB per PUD), we have to accomodate 256MB and 2GB huge
152+ * 8GB per PUD), we have to accommodate 256MB and 2GB huge
153153 * pages. So for those we propagate bits 32 to 28.
154154 */
155155 #define KERN_PGTABLE_WALK(VADDR, REG1, REG2, FAIL_LABEL) \
arch/sparc/include/uapi/asm/stat.h+2−2
@@ -6,13 +6,13 @@ · 5 unmodified lines
66 #if defined(__sparc__) && defined(__arch64__)
77 /* 64 bit sparc */
88 struct stat {
9− unsigned st_dev;
9+ unsigned int st_dev;
1010 ino_t st_ino;
1111 mode_t st_mode;
1212 short st_nlink;
1313 uid_t st_uid;
1414 gid_t st_gid;
15− unsigned st_rdev;
15+ unsigned int st_rdev;
1616 off_t st_size;
1717 time_t st_atime;
1818 time_t st_mtime;
arch/sparc/kernel/audit.c+6−6
@@ -5,27 +5,27 @@ · 4 unmodified lines
55
66 #include "kernel.h"
77
8−static unsigned dir_class[] = {
8+static unsigned int dir_class[] = {
99 #include <asm-generic/audit_dir_write.h>
1010 ~0U
1111 };
1212
13−static unsigned read_class[] = {
13+static unsigned int read_class[] = {
1414 #include <asm-generic/audit_read.h>
1515 ~0U
1616 };
1717
18−static unsigned write_class[] = {
18+static unsigned int write_class[] = {
1919 #include <asm-generic/audit_write.h>
2020 ~0U
2121 };
2222
23−static unsigned chattr_class[] = {
23+static unsigned int chattr_class[] = {
2424 #include <asm-generic/audit_change_attr.h>
2525 ~0U
2626 };
2727
28−static unsigned signal_class[] = {
28+static unsigned int signal_class[] = {
2929 #include <asm-generic/audit_signal.h>
3030 ~0U
3131 };
@@ -39,7 +39,7 @@ int audit_classify_arch(int arch) · 7 unmodified lines
3939 return 0;
4040 }
4141
42−int audit_classify_syscall(int abi, unsigned syscall)
42+int audit_classify_syscall(int abi, unsigned int syscall)
4343 {
4444 #ifdef CONFIG_COMPAT
4545 if (abi == AUDIT_ARCH_SPARC)
arch/sparc/kernel/compat_audit.c+6−6
@@ -2,32 +2,32 @@ · 1 unmodified line
22 #include <asm/unistd.h>
33 #include "kernel.h"
44
5−unsigned sparc32_dir_class[] = {
5+unsigned int sparc32_dir_class[] = {
66 #include <asm-generic/audit_dir_write.h>
77 ~0U
88 };
99
10−unsigned sparc32_chattr_class[] = {
10+unsigned int sparc32_chattr_class[] = {
1111 #include <asm-generic/audit_change_attr.h>
1212 ~0U
1313 };
1414
15−unsigned sparc32_write_class[] = {
15+unsigned int sparc32_write_class[] = {
1616 #include <asm-generic/audit_write.h>
1717 ~0U
1818 };
1919
20−unsigned sparc32_read_class[] = {
20+unsigned int sparc32_read_class[] = {
2121 #include <asm-generic/audit_read.h>
2222 ~0U
2323 };
2424
25−unsigned sparc32_signal_class[] = {
25+unsigned int sparc32_signal_class[] = {
2626 #include <asm-generic/audit_signal.h>
2727 ~0U
2828 };
2929
30−int sparc32_classify_syscall(unsigned syscall)
30+int sparc32_classify_syscall(unsigned int syscall)
3131 {
3232 switch(syscall) {
3333 case __NR_open:
arch/sparc/kernel/entry.S+1−1
@@ -1255,7 +1255,7 @@ flush_patch_exception: · 1254 unmodified lines
12551255 kuw_patch1_7win: sll %o3, 6, %o3
12561256
12571257 /* No matter how much overhead this routine has in the worst
1258− * case scenerio, it is several times better than taking the
1258+ * case scenario, it is several times better than taking the
12591259 * traps with the old method of just doing flush_user_windows().
12601260 */
12611261 kill_user_windows:
arch/sparc/kernel/ioport.c+3−3
@@ -131,7 +131,7 @@ void __iomem *ioremap(unsigned long offset, unsigned long size) · 130 unmodified lines
131131 EXPORT_SYMBOL(ioremap);
132132
133133 /*
134− * Comlimentary to ioremap().
134+ * Complementary to ioremap().
135135 */
136136 void iounmap(volatile void __iomem *virtual)
137137 {
@@ -233,7 +233,7 @@ _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) · 95 unmodified lines
233233 }
234234
235235 /*
236− * Comlimentary to _sparc_ioremap().
236+ * Complementary to _sparc_ioremap().
237237 */
238238 static void _sparc_free_io(struct resource *res)
239239 {
@@ -532,7 +532,7 @@ static void pci32_unmap_page(struct device *dev, dma_addr_t ba, size_t size, · 292 unmodified lines
532532 }
533533
534534 /* Map a set of buffers described by scatterlist in streaming
535− * mode for DMA. This is the scather-gather version of the
535+ * mode for DMA. This is the scatter-gather version of the
536536 * above pci_map_single interface. Here the scatter gather list
537537 * elements are each tagged with the appropriate dma address
538538 * and length. They are obtained via sg_dma_{address,length}(SG).
arch/sparc/kernel/kernel.h+6−6
@@ -54,12 +54,12 @@ void do_signal32(struct pt_regs * regs); · 53 unmodified lines
5454 asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp);
5555
5656 /* compat_audit.c */
57−extern unsigned sparc32_dir_class[];
58−extern unsigned sparc32_chattr_class[];
59−extern unsigned sparc32_write_class[];
60−extern unsigned sparc32_read_class[];
61−extern unsigned sparc32_signal_class[];
62−int sparc32_classify_syscall(unsigned syscall);
57+extern unsigned int sparc32_dir_class[];
58+extern unsigned int sparc32_chattr_class[];
59+extern unsigned int sparc32_write_class[];
60+extern unsigned int sparc32_read_class[];
61+extern unsigned int sparc32_signal_class[];
62+int sparc32_classify_syscall(unsigned int syscall);
6363 #endif
6464
6565 #ifdef CONFIG_SPARC32
arch/sparc/kernel/leon_kernel.c+1−1
@@ -203,7 +203,7 @@ static struct irq_chip leon_irq = { · 202 unmodified lines
203203
204204 /*
205205 * Build a LEON IRQ for the edge triggered LEON IRQ controller:
206− * Edge (normal) IRQ - handle_simple_irq, ack=DONT-CARE, never ack
206+ * Edge (normal) IRQ - handle_simple_irq, ack=DON'T-CARE, never ack
207207 * Level IRQ (PCI|Level-GPIO) - handle_fasteoi_irq, ack=1, ack after ISR
208208 * Per-CPU Edge - handle_percpu_irq, ack=0
209209 */
arch/sparc/kernel/process_64.c+1−1
@@ -103,7 +103,7 @@ static void show_regwindow32(struct pt_regs *regs) · 102 unmodified lines
103103 mm_segment_t old_fs;
104104
105105 __asm__ __volatile__ ("flushw");
106− rw = compat_ptr((unsigned)regs->u_regs[14]);
106+ rw = compat_ptr((unsigned int)regs->u_regs[14]);
107107 old_fs = get_fs();
108108 set_fs (USER_DS);
109109 if (copy_from_user (&r_w, rw, sizeof(r_w))) {
arch/sparc/kernel/setup_32.c+1−1
@@ -109,7 +109,7 @@ unsigned long cmdline_memory_size __initdata = 0; · 108 unmodified lines
109109 unsigned char boot_cpu_id = 0xff; /* 0xff will make it into DATA section... */
110110
111111 static void
112−prom_console_write(struct console *con, const char *s, unsigned n)
112+prom_console_write(struct console *con, const char *s, unsigned int n)
113113 {
114114 prom_write(s, n);
115115 }
arch/sparc/kernel/setup_64.c+1−1
@@ -77,7 +77,7 @@ struct screen_info screen_info = { · 76 unmodified lines
7777 };
7878
7979 static void
80−prom_console_write(struct console *con, const char *s, unsigned n)
80+prom_console_write(struct console *con, const char *s, unsigned int n)
8181 {
8282 prom_write(s, n);
8383 }
arch/sparc/kernel/signal32.c+1−1
@@ -144,7 +144,7 @@ void do_sigreturn32(struct pt_regs *regs) · 143 unmodified lines
144144 compat_uptr_t fpu_save;
145145 compat_uptr_t rwin_save;
146146 unsigned int psr;
147− unsigned pc, npc;
147+ unsigned int pc, npc;
148148 sigset_t set;
149149 compat_sigset_t seta;
150150 int err, i;
arch/sparc/kernel/sys_sparc_64.c+2−2
@@ -337,10 +337,10 @@ SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second · 336 unmodified lines
337337 switch (call) {
338338 case SEMOP:
339339 err = sys_semtimedop(first, ptr,
340− (unsigned)second, NULL);
340+ (unsigned int)second, NULL);
341341 goto out;
342342 case SEMTIMEDOP:
343− err = sys_semtimedop(first, ptr, (unsigned)second,
343+ err = sys_semtimedop(first, ptr, (unsigned int)second,
344344 (const struct timespec __user *)
345345 (unsigned long) fifth);
346346 goto out;
arch/sparc/kernel/sysfs.c+1−1
@@ -1,4 +1,4 @@
1−/* sysfs.c: Toplogy sysfs support code for sparc64.
1+/* sysfs.c: Topology sysfs support code for sparc64.
22 *
33 * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
44 */
arch/sparc/kernel/unaligned_64.c+2−2
@@ -209,8 +209,8 @@ static inline int do_int_store(int reg_num, int size, unsigned long *dst_addr, · 208 unmodified lines
209209 if (size == 16) {
210210 size = 8;
211211 zero = (((long)(reg_num ?
212− (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) |
213− (unsigned)fetch_reg(reg_num + 1, regs);
212+ (unsigned int)fetch_reg(reg_num, regs) : 0)) << 32) |
213+ (unsigned int)fetch_reg(reg_num + 1, regs);
214214 } else if (reg_num) {
215215 src_val_p = fetch_reg_addr(reg_num, regs);
216216 }
arch/sparc/mm/fault_32.c+4−4
@@ -303,10 +303,10 @@ no_context: · 302 unmodified lines
303303 fixup = search_extables_range(regs->pc, &g2);
304304 /* Values below 10 are reserved for other things */
305305 if (fixup > 10) {
306− extern const unsigned __memset_start[];
307− extern const unsigned __memset_end[];
308− extern const unsigned __csum_partial_copy_start[];
309− extern const unsigned __csum_partial_copy_end[];
306+ extern const unsigned int __memset_start[];
307+ extern const unsigned int __memset_end[];
308+ extern const unsigned int __csum_partial_copy_start[];
309+ extern const unsigned int __csum_partial_copy_end[];
310310
311311 #ifdef DEBUG_EXCEPTIONS
312312 printk("Exception: PC<%08lx> faddr<%08lx>\n",
arch/sparc/net/bpf_jit_comp.c+1−1
@@ -351,7 +351,7 @@ do { *prog++ = BR_OPC | WDISP22(OFF); \ · 350 unmodified lines
351351 *
352352 * Sometimes we need to emit a branch earlier in the code
353353 * sequence. And in these situations we adjust "destination"
354− * to accomodate this difference. For example, if we needed
354+ * to accommodate this difference. For example, if we needed
355355 * to emit a branch (and it's delay slot) right before the
356356 * final instruction emitted for a BPF opcode, we'd use
357357 * "destination + 4" instead of just plain "destination" above.
arch/tile/include/hv/drv_mpipe_intf.h+13−13
@@ -211,7 +211,7 @@ _gxio_mpipe_link_mac_t; · 210 unmodified lines
211211 * request shared data permission on the same link.
212212 *
213213 * No more than one of ::GXIO_MPIPE_LINK_DATA, ::GXIO_MPIPE_LINK_NO_DATA,
214− * or ::GXIO_MPIPE_LINK_EXCL_DATA may be specifed in a gxio_mpipe_link_open()
214+ * or ::GXIO_MPIPE_LINK_EXCL_DATA may be specified in a gxio_mpipe_link_open()
215215 * call. If none are specified, ::GXIO_MPIPE_LINK_DATA is assumed.
216216 */
217217 #define GXIO_MPIPE_LINK_DATA 0x00000001UL
@@ -219,7 +219,7 @@ _gxio_mpipe_link_mac_t; · 1 unmodified line
219219 /** Do not request data permission on the specified link.
220220 *
221221 * No more than one of ::GXIO_MPIPE_LINK_DATA, ::GXIO_MPIPE_LINK_NO_DATA,
222− * or ::GXIO_MPIPE_LINK_EXCL_DATA may be specifed in a gxio_mpipe_link_open()
222+ * or ::GXIO_MPIPE_LINK_EXCL_DATA may be specified in a gxio_mpipe_link_open()
223223 * call. If none are specified, ::GXIO_MPIPE_LINK_DATA is assumed.
224224 */
225225 #define GXIO_MPIPE_LINK_NO_DATA 0x00000002UL
@@ -230,7 +230,7 @@ _gxio_mpipe_link_mac_t; · 4 unmodified lines
230230 * data permission on it, this open will fail.
231231 *
232232 * No more than one of ::GXIO_MPIPE_LINK_DATA, ::GXIO_MPIPE_LINK_NO_DATA,
233− * or ::GXIO_MPIPE_LINK_EXCL_DATA may be specifed in a gxio_mpipe_link_open()
233+ * or ::GXIO_MPIPE_LINK_EXCL_DATA may be specified in a gxio_mpipe_link_open()
234234 * call. If none are specified, ::GXIO_MPIPE_LINK_DATA is assumed.
235235 */
236236 #define GXIO_MPIPE_LINK_EXCL_DATA 0x00000004UL
@@ -241,7 +241,7 @@ _gxio_mpipe_link_mac_t; · 4 unmodified lines
241241 * permission on the same link.
242242 *
243243 * No more than one of ::GXIO_MPIPE_LINK_STATS, ::GXIO_MPIPE_LINK_NO_STATS,
244− * or ::GXIO_MPIPE_LINK_EXCL_STATS may be specifed in a gxio_mpipe_link_open()
244+ * or ::GXIO_MPIPE_LINK_EXCL_STATS may be specified in a gxio_mpipe_link_open()
245245 * call. If none are specified, ::GXIO_MPIPE_LINK_STATS is assumed.
246246 */
247247 #define GXIO_MPIPE_LINK_STATS 0x00000008UL
@@ -249,7 +249,7 @@ _gxio_mpipe_link_mac_t; · 1 unmodified line
249249 /** Do not request stats permission on the specified link.
250250 *
251251 * No more than one of ::GXIO_MPIPE_LINK_STATS, ::GXIO_MPIPE_LINK_NO_STATS,
252− * or ::GXIO_MPIPE_LINK_EXCL_STATS may be specifed in a gxio_mpipe_link_open()
252+ * or ::GXIO_MPIPE_LINK_EXCL_STATS may be specified in a gxio_mpipe_link_open()
253253 * call. If none are specified, ::GXIO_MPIPE_LINK_STATS is assumed.
254254 */
255255 #define GXIO_MPIPE_LINK_NO_STATS 0x00000010UL
@@ -267,7 +267,7 @@ _gxio_mpipe_link_mac_t; · 11 unmodified lines
267267 * reset by other statistics programs.
268268 *
269269 * No more than one of ::GXIO_MPIPE_LINK_STATS, ::GXIO_MPIPE_LINK_NO_STATS,
270− * or ::GXIO_MPIPE_LINK_EXCL_STATS may be specifed in a gxio_mpipe_link_open()
270+ * or ::GXIO_MPIPE_LINK_EXCL_STATS may be specified in a gxio_mpipe_link_open()
271271 * call. If none are specified, ::GXIO_MPIPE_LINK_STATS is assumed.
272272 */
273273 #define GXIO_MPIPE_LINK_EXCL_STATS 0x00000020UL
@@ -278,7 +278,7 @@ _gxio_mpipe_link_mac_t; · 4 unmodified lines
278278 * permission on the same link.
279279 *
280280 * No more than one of ::GXIO_MPIPE_LINK_CTL, ::GXIO_MPIPE_LINK_NO_CTL,
281− * or ::GXIO_MPIPE_LINK_EXCL_CTL may be specifed in a gxio_mpipe_link_open()
281+ * or ::GXIO_MPIPE_LINK_EXCL_CTL may be specified in a gxio_mpipe_link_open()
282282 * call. If none are specified, ::GXIO_MPIPE_LINK_CTL is assumed.
283283 */
284284 #define GXIO_MPIPE_LINK_CTL 0x00000040UL
@@ -286,7 +286,7 @@ _gxio_mpipe_link_mac_t; · 1 unmodified line
286286 /** Do not request control permission on the specified link.
287287 *
288288 * No more than one of ::GXIO_MPIPE_LINK_CTL, ::GXIO_MPIPE_LINK_NO_CTL,
289− * or ::GXIO_MPIPE_LINK_EXCL_CTL may be specifed in a gxio_mpipe_link_open()
289+ * or ::GXIO_MPIPE_LINK_EXCL_CTL may be specified in a gxio_mpipe_link_open()
290290 * call. If none are specified, ::GXIO_MPIPE_LINK_CTL is assumed.
291291 */
292292 #define GXIO_MPIPE_LINK_NO_CTL 0x00000080UL
@@ -301,7 +301,7 @@ _gxio_mpipe_link_mac_t; · 8 unmodified lines
301301 * it prevents programs like mpipe-link from configuring the link.
302302 *
303303 * No more than one of ::GXIO_MPIPE_LINK_CTL, ::GXIO_MPIPE_LINK_NO_CTL,
304− * or ::GXIO_MPIPE_LINK_EXCL_CTL may be specifed in a gxio_mpipe_link_open()
304+ * or ::GXIO_MPIPE_LINK_EXCL_CTL may be specified in a gxio_mpipe_link_open()
305305 * call. If none are specified, ::GXIO_MPIPE_LINK_CTL is assumed.
306306 */
307307 #define GXIO_MPIPE_LINK_EXCL_CTL 0x00000100UL
@@ -311,7 +311,7 @@ _gxio_mpipe_link_mac_t; · 3 unmodified lines
311311 * change the desired state of the link when it is closed or the process
312312 * exits. No more than one of ::GXIO_MPIPE_LINK_AUTO_UP,
313313 * ::GXIO_MPIPE_LINK_AUTO_UPDOWN, ::GXIO_MPIPE_LINK_AUTO_DOWN, or
314− * ::GXIO_MPIPE_LINK_AUTO_NONE may be specifed in a gxio_mpipe_link_open()
314+ * ::GXIO_MPIPE_LINK_AUTO_NONE may be specified in a gxio_mpipe_link_open()
315315 * call. If none are specified, ::GXIO_MPIPE_LINK_AUTO_UPDOWN is assumed.
316316 */
317317 #define GXIO_MPIPE_LINK_AUTO_UP 0x00000200UL
@@ -322,7 +322,7 @@ _gxio_mpipe_link_mac_t; · 4 unmodified lines
322322 * open, set the desired state of the link to down. No more than one of
323323 * ::GXIO_MPIPE_LINK_AUTO_UP, ::GXIO_MPIPE_LINK_AUTO_UPDOWN,
324324 * ::GXIO_MPIPE_LINK_AUTO_DOWN, or ::GXIO_MPIPE_LINK_AUTO_NONE may be
325− * specifed in a gxio_mpipe_link_open() call. If none are specified,
325+ * specified in a gxio_mpipe_link_open() call. If none are specified,
326326 * ::GXIO_MPIPE_LINK_AUTO_UPDOWN is assumed.
327327 */
328328 #define GXIO_MPIPE_LINK_AUTO_UPDOWN 0x00000400UL
@@ -332,7 +332,7 @@ _gxio_mpipe_link_mac_t; · 3 unmodified lines
332332 * process has the link open, set the desired state of the link to down.
333333 * No more than one of ::GXIO_MPIPE_LINK_AUTO_UP,
334334 * ::GXIO_MPIPE_LINK_AUTO_UPDOWN, ::GXIO_MPIPE_LINK_AUTO_DOWN, or
335− * ::GXIO_MPIPE_LINK_AUTO_NONE may be specifed in a gxio_mpipe_link_open()
335+ * ::GXIO_MPIPE_LINK_AUTO_NONE may be specified in a gxio_mpipe_link_open()
336336 * call. If none are specified, ::GXIO_MPIPE_LINK_AUTO_UPDOWN is assumed.
337337 */
338338 #define GXIO_MPIPE_LINK_AUTO_DOWN 0x00000800UL
@@ -342,7 +342,7 @@ _gxio_mpipe_link_mac_t; · 3 unmodified lines
342342 * closed or the process exits. No more than one of
343343 * ::GXIO_MPIPE_LINK_AUTO_UP, ::GXIO_MPIPE_LINK_AUTO_UPDOWN,
344344 * ::GXIO_MPIPE_LINK_AUTO_DOWN, or ::GXIO_MPIPE_LINK_AUTO_NONE may be
345− * specifed in a gxio_mpipe_link_open() call. If none are specified,
345+ * specified in a gxio_mpipe_link_open() call. If none are specified,
346346 * ::GXIO_MPIPE_LINK_AUTO_UPDOWN is assumed.
347347 */
348348 #define GXIO_MPIPE_LINK_AUTO_NONE 0x00001000UL
arch/tile/kernel/kgdb.c+8−8
@@ -126,15 +126,15 @@ void · 125 unmodified lines
126126 sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
127127 {
128128 struct pt_regs *thread_regs;
129+ const int NGPRS = TREG_LAST_GPR + 1;
129130
130131 if (task == NULL)
131132 return;
132133
133− /* Initialize to zero. */
134− memset(gdb_regs, 0, NUMREGBYTES);
135−
136134 thread_regs = task_pt_regs(task);
137− memcpy(gdb_regs, thread_regs, TREG_LAST_GPR * sizeof(unsigned long));
135+ memcpy(gdb_regs, thread_regs, NGPRS * sizeof(unsigned long));
136+ memset(&gdb_regs[NGPRS], 0,
137+ (TILEGX_PC_REGNUM - NGPRS) * sizeof(unsigned long));
138138 gdb_regs[TILEGX_PC_REGNUM] = thread_regs->pc;
139139 gdb_regs[TILEGX_FAULTNUM_REGNUM] = thread_regs->faultnum;
140140 }
@@ -433,9 +433,9 @@ int kgdb_arch_handle_exception(int vector, int signo, int err_code, · 292 unmodified lines
433433 struct kgdb_arch arch_kgdb_ops;
434434
435435 /*
436− * kgdb_arch_init - Perform any architecture specific initalization.
436+ * kgdb_arch_init - Perform any architecture specific initialization.
437437 *
438− * This function will handle the initalization of any architecture
438+ * This function will handle the initialization of any architecture
439439 * specific callbacks.
440440 */
441441 int kgdb_arch_init(void)
@@ -447,9 +447,9 @@ int kgdb_arch_init(void) · 5 unmodified lines
447447 }
448448
449449 /*
450− * kgdb_arch_exit - Perform any architecture specific uninitalization.
450+ * kgdb_arch_exit - Perform any architecture specific uninitialization.
451451 *
452− * This function will handle the uninitalization of any architecture
452+ * This function will handle the uninitialization of any architecture
453453 * specific callbacks, for dynamic registration and unregistration.
454454 */
455455 void kgdb_arch_exit(void)
arch/tile/kernel/pci_gx.c+1−1
@@ -1326,7 +1326,7 @@ invalid_device: · 1325 unmodified lines
13261326
13271327
13281328 /*
1329− * See tile_cfg_read() for relevent comments.
1329+ * See tile_cfg_read() for relevant comments.
13301330 * Note that "val" is the value to write, not a pointer to that value.
13311331 */
13321332 static int tile_cfg_write(struct pci_bus *bus, unsigned int devfn, int offset,
arch/x86/events/amd/core.c+18−3
@@ -369,7 +369,7 @@ static int amd_pmu_cpu_prepare(int cpu) · 368 unmodified lines
369369
370370 WARN_ON_ONCE(cpuc->amd_nb);
371371
372− if (boot_cpu_data.x86_max_cores < 2)
372+ if (!x86_pmu.amd_nb_constraints)
373373 return NOTIFY_OK;
374374
375375 cpuc->amd_nb = amd_alloc_nb(cpu);
@@ -388,7 +388,7 @@ static void amd_pmu_cpu_starting(int cpu) · 12 unmodified lines
388388
389389 cpuc->perf_ctr_virt_mask = AMD64_EVENTSEL_HOSTONLY;
390390
391− if (boot_cpu_data.x86_max_cores < 2)
391+ if (!x86_pmu.amd_nb_constraints)
392392 return;
393393
394394 nb_id = amd_get_nb_id(cpu);
@@ -414,7 +414,7 @@ static void amd_pmu_cpu_dead(int cpu) · 19 unmodified lines
414414 {
415415 struct cpu_hw_events *cpuhw;
416416
417− if (boot_cpu_data.x86_max_cores < 2)
417+ if (!x86_pmu.amd_nb_constraints)
418418 return;
419419
420420 cpuhw = &per_cpu(cpu_hw_events, cpu);
@@ -648,6 +648,8 @@ static __initconst const struct x86_pmu amd_pmu = { · 227 unmodified lines
648648 .cpu_prepare = amd_pmu_cpu_prepare,
649649 .cpu_starting = amd_pmu_cpu_starting,
650650 .cpu_dead = amd_pmu_cpu_dead,
651+
652+ .amd_nb_constraints = 1,
651653 };
652654
653655 static int __init amd_core_pmu_init(void)
@@ -674,6 +676,11 @@ static int __init amd_core_pmu_init(void) · 20 unmodified lines
674676 x86_pmu.eventsel = MSR_F15H_PERF_CTL;
675677 x86_pmu.perfctr = MSR_F15H_PERF_CTR;
676678 x86_pmu.num_counters = AMD64_NUM_COUNTERS_CORE;
679+ /*
680+ * AMD Core perfctr has separate MSRs for the NB events, see
681+ * the amd/uncore.c driver.
682+ */
683+ x86_pmu.amd_nb_constraints = 0;
677684
678685 pr_cont("core perfctr, ");
679686 return 0;
@@ -693,6 +700,14 @@ __init int amd_pmu_init(void) · 13 unmodified lines
693700 if (ret)
694701 return ret;
695702
703+ if (num_possible_cpus() == 1) {
704+ /*
705+ * No point in allocating data structures to serialize
706+ * against other CPUs, when there is only the one CPU.
707+ */
708+ x86_pmu.amd_nb_constraints = 0;
709+ }
710+
696711 /* Events are common for all AMDs */
697712 memcpy(hw_cache_event_ids, amd_hw_cache_event_ids,
698713 sizeof(hw_cache_event_ids));
arch/x86/events/amd/ibs.c+45−7
@@ -28,10 +28,46 @@ static u32 ibs_caps; · 27 unmodified lines
2828 #define IBS_FETCH_CONFIG_MASK (IBS_FETCH_RAND_EN | IBS_FETCH_MAX_CNT)
2929 #define IBS_OP_CONFIG_MASK IBS_OP_MAX_CNT
3030
31+
32+/*
33+ * IBS states:
34+ *
35+ * ENABLED; tracks the pmu::add(), pmu::del() state, when set the counter is taken
36+ * and any further add()s must fail.
37+ *
38+ * STARTED/STOPPING/STOPPED; deal with pmu::start(), pmu::stop() state but are
39+ * complicated by the fact that the IBS hardware can send late NMIs (ie. after
40+ * we've cleared the EN bit).
41+ *
42+ * In order to consume these late NMIs we have the STOPPED state, any NMI that
43+ * happens after we've cleared the EN state will clear this bit and report the
44+ * NMI handled (this is fundamentally racy in the face or multiple NMI sources,
45+ * someone else can consume our BIT and our NMI will go unhandled).
46+ *
47+ * And since we cannot set/clear this separate bit together with the EN bit,
48+ * there are races; if we cleared STARTED early, an NMI could land in
49+ * between clearing STARTED and clearing the EN bit (in fact multiple NMIs
50+ * could happen if the period is small enough), and consume our STOPPED bit
51+ * and trigger streams of unhandled NMIs.
52+ *
53+ * If, however, we clear STARTED late, an NMI can hit between clearing the
54+ * EN bit and clearing STARTED, still see STARTED set and process the event.
55+ * If this event will have the VALID bit clear, we bail properly, but this
56+ * is not a given. With VALID set we can end up calling pmu::stop() again
57+ * (the throttle logic) and trigger the WARNs in there.
58+ *
59+ * So what we do is set STOPPING before clearing EN to avoid the pmu::stop()
60+ * nesting, and clear STARTED late, so that we have a well defined state over
61+ * the clearing of the EN bit.
62+ *
63+ * XXX: we could probably be using !atomic bitops for all this.
64+ */
65+
3166 enum ibs_states {
3267 IBS_ENABLED = 0,
3368 IBS_STARTED = 1,
3469 IBS_STOPPING = 2,
70+ IBS_STOPPED = 3,
3571
3672 IBS_MAX_STATES,
3773 };
@@ -377,11 +413,10 @@ static void perf_ibs_start(struct perf_event *event, int flags) · 339 unmodified lines
377413
378414 perf_ibs_set_period(perf_ibs, hwc, &period);
379415 /*
380− * Set STARTED before enabling the hardware, such that
381− * a subsequent NMI must observe it. Then clear STOPPING
382− * such that we don't consume NMIs by accident.
416+ * Set STARTED before enabling the hardware, such that a subsequent NMI
417+ * must observe it.
383418 */
384− set_bit(IBS_STARTED, pcpu->state);
419+ set_bit(IBS_STARTED, pcpu->state);
385420 clear_bit(IBS_STOPPING, pcpu->state);
386421 perf_ibs_enable_event(perf_ibs, hwc, period >> 4);
387422
@@ -396,6 +431,9 @@ static void perf_ibs_stop(struct perf_event *event, int flags) · 8 unmodified lines
396431 u64 config;
397432 int stopping;
398433
434+ if (test_and_set_bit(IBS_STOPPING, pcpu->state))
435+ return;
436+
399437 stopping = test_bit(IBS_STARTED, pcpu->state);
400438
401439 if (!stopping && (hwc->state & PERF_HES_UPTODATE))
@@ -405,12 +443,12 @@ static void perf_ibs_stop(struct perf_event *event, int flags) · 3 unmodified lines
405443
406444 if (stopping) {
407445 /*
408− * Set STOPPING before disabling the hardware, such that it
446+ * Set STOPPED before disabling the hardware, such that it
409447 * must be visible to NMIs the moment we clear the EN bit,
410448 * at which point we can generate an !VALID sample which
411449 * we need to consume.
412450 */
413− set_bit(IBS_STOPPING, pcpu->state);
451+ set_bit(IBS_STOPPED, pcpu->state);
414452 perf_ibs_disable_event(perf_ibs, hwc, config);
415453 /*
416454 * Clear STARTED after disabling the hardware; if it were
@@ -556,7 +594,7 @@ fail: · 139 unmodified lines
556594 * with samples that even have the valid bit cleared.
557595 * Mark all this NMIs as handled.
558596 */
559− if (test_and_clear_bit(IBS_STOPPING, pcpu->state))
597+ if (test_and_clear_bit(IBS_STOPPED, pcpu->state))
560598 return 1;
561599
562600 return 0;
arch/x86/events/perf_event.h+8−3
@@ -607,6 +607,11 @@ struct x86_pmu { · 606 unmodified lines
607607 */
608608 atomic_t lbr_exclusive[x86_lbr_exclusive_max];
609609
610+ /*
611+ * AMD bits
612+ */
613+ unsigned int amd_nb_constraints : 1;
614+
610615 /*
611616 * Extra registers for events
612617 */
@@ -795,6 +800,9 @@ ssize_t intel_event_sysfs_show(char *page, u64 config); · 182 unmodified lines
795800
796801 struct attribute **merge_attr(struct attribute **a, struct attribute **b);
797802
803+ssize_t events_sysfs_show(struct device *dev, struct device_attribute *attr,
804+ char *page);
805+
798806 #ifdef CONFIG_CPU_SUP_AMD
799807
800808 int amd_pmu_init(void);
@@ -925,9 +933,6 @@ int p6_pmu_init(void); · 124 unmodified lines
925933
926934 int knc_pmu_init(void);
927935
928−ssize_t events_sysfs_show(struct device *dev, struct device_attribute *attr,
929− char *page);
930−
931936 static inline int is_ht_workaround_enabled(void)
932937 {
933938 return !!(x86_pmu.flags & PMU_FL_EXCL_ENABLED);
arch/x86/include/asm/msr-index.h+1−7
@@ -190,6 +190,7 @@ · 189 unmodified lines
190190 #define MSR_PP1_ENERGY_STATUS 0x00000641
191191 #define MSR_PP1_POLICY 0x00000642
192192
193+/* Config TDP MSRs */
193194 #define MSR_CONFIG_TDP_NOMINAL 0x00000648
194195 #define MSR_CONFIG_TDP_LEVEL_1 0x00000649
195196 #define MSR_CONFIG_TDP_LEVEL_2 0x0000064A
@@ -210,13 +211,6 @@ · 14 unmodified lines
210211 #define MSR_GFX_PERF_LIMIT_REASONS 0x000006B0
211212 #define MSR_RING_PERF_LIMIT_REASONS 0x000006B1
212213
213−/* Config TDP MSRs */
214−#define MSR_CONFIG_TDP_NOMINAL 0x00000648
215−#define MSR_CONFIG_TDP_LEVEL1 0x00000649
216−#define MSR_CONFIG_TDP_LEVEL2 0x0000064A
217−#define MSR_CONFIG_TDP_CONTROL 0x0000064B
218−#define MSR_TURBO_ACTIVATION_RATIO 0x0000064C
219−
220214 /* Hardware P state interface */
221215 #define MSR_PPERF 0x0000064e
222216 #define MSR_PERF_LIMIT_REASONS 0x0000064f
arch/x86/include/asm/pmem.h+9−0
@@ -47,6 +47,15 @@ static inline void arch_memcpy_to_pmem(void __pmem *dst, const void *src, · 46 unmodified lines
4747 BUG();
4848 }
4949
50+static inline int arch_memcpy_from_pmem(void *dst, const void __pmem *src,
51+ size_t n)
52+{
53+ if (static_cpu_has(X86_FEATURE_MCE_RECOVERY))
54+ return memcpy_mcsafe(dst, (void __force *) src, n);
55+ memcpy(dst, (void __force *) src, n);
56+ return 0;
57+}
58+
5059 /**
5160 * arch_wmb_pmem - synchronize writes to persistent memory
5261 *
arch/x86/include/asm/processor.h+0−2
@@ -132,8 +132,6 @@ struct cpuinfo_x86 { · 131 unmodified lines
132132 u16 logical_proc_id;
133133 /* Core id: */
134134 u16 cpu_core_id;
135− /* Compute unit id */
136− u8 compute_unit_id;
137135 /* Index into per_cpu list: */
138136 u16 cpu_index;
139137 u32 microcode;
arch/x86/include/asm/smp.h+1−0
@@ -155,6 +155,7 @@ static inline int wbinvd_on_all_cpus(void) · 154 unmodified lines
155155 wbinvd();
156156 return 0;
157157 }
158+#define smp_num_siblings 1
158159 #endif /* CONFIG_SMP */
159160
160161 extern unsigned disabled_cpus;
arch/x86/include/asm/thread_info.h+2−4
@@ -276,11 +276,9 @@ static inline bool is_ia32_task(void) · 275 unmodified lines
276276 */
277277 #define force_iret() set_thread_flag(TIF_NOTIFY_RESUME)
278278
279−#endif /* !__ASSEMBLY__ */
280−
281−#ifndef __ASSEMBLY__
282279 extern void arch_task_cache_init(void);
283280 extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
284281 extern void arch_release_task_struct(struct task_struct *tsk);
285−#endif
282+#endif /* !__ASSEMBLY__ */
283+
286284 #endif /* _ASM_X86_THREAD_INFO_H */
arch/x86/include/asm/tlbflush.h+0−6
@@ -319,12 +319,6 @@ static inline void reset_lazy_tlbstate(void) · 318 unmodified lines
319319
320320 #endif /* SMP */
321321
322−/* Not inlined due to inc_irq_stat not being defined yet */
323−#define flush_tlb_local() { \
324− inc_irq_stat(irq_tlb_count); \
325− local_flush_tlb(); \
326−}
327−
328322 #ifndef CONFIG_PARAVIRT
329323 #define flush_tlb_others(mask, mm, start, end) \
330324 native_flush_tlb_others(mask, mm, start, end)
arch/x86/kernel/amd_nb.c+2−4
@@ -170,15 +170,13 @@ int amd_get_subcaches(int cpu) · 169 unmodified lines
170170 {
171171 struct pci_dev *link = node_to_amd_nb(amd_get_nb_id(cpu))->link;
172172 unsigned int mask;
173− int cuid;
174173
175174 if (!amd_nb_has_feature(AMD_NB_L3_PARTITIONING))
176175 return 0;
177176
178177 pci_read_config_dword(link, 0x1d4, &mask);
179178
180− cuid = cpu_data(cpu).compute_unit_id;
181− return (mask >> (4 * cuid)) & 0xf;
179+ return (mask >> (4 * cpu_data(cpu).cpu_core_id)) & 0xf;
182180 }
183181
184182 int amd_set_subcaches(int cpu, unsigned long mask)
@@ -204,7 +202,7 @@ int amd_set_subcaches(int cpu, unsigned long mask) · 19 unmodified lines
204202 pci_write_config_dword(nb->misc, 0x1b8, reg & ~0x180000);
205203 }
206204
207− cuid = cpu_data(cpu).compute_unit_id;
205+ cuid = cpu_data(cpu).cpu_core_id;
208206 mask <<= 4 * cuid;
209207 mask |= (0xf ^ (1 << cuid)) << 26;
210208
arch/x86/kernel/cpu/amd.c+4−8
@@ -300,7 +300,6 @@ static int nearby_node(int apicid) · 299 unmodified lines
300300 #ifdef CONFIG_SMP
301301 static void amd_get_topology(struct cpuinfo_x86 *c)
302302 {
303− u32 cores_per_cu = 1;
304303 u8 node_id;
305304 int cpu = smp_processor_id();
306305
@@ -313,8 +312,8 @@ static void amd_get_topology(struct cpuinfo_x86 *c) · 6 unmodified lines
313312
314313 /* get compute unit information */
315314 smp_num_siblings = ((ebx >> 8) & 3) + 1;
316− c->compute_unit_id = ebx & 0xff;
317− cores_per_cu += ((ebx >> 8) & 3);
315+ c->x86_max_cores /= smp_num_siblings;
316+ c->cpu_core_id = ebx & 0xff;
318317 } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) {
319318 u64 value;
320319
@@ -325,19 +324,16 @@ static void amd_get_topology(struct cpuinfo_x86 *c) · 4 unmodified lines
325324
326325 /* fixup multi-node processor information */
327326 if (nodes_per_socket > 1) {
328− u32 cores_per_node;
329327 u32 cus_per_node;
330328
331329 set_cpu_cap(c, X86_FEATURE_AMD_DCM);
332− cores_per_node = c->x86_max_cores / nodes_per_socket;
333− cus_per_node = cores_per_node / cores_per_cu;
330+ cus_per_node = c->x86_max_cores / nodes_per_socket;
334331
335332 /* store NodeID, use llc_shared_map to store sibling info */
336333 per_cpu(cpu_llc_id, cpu) = node_id;
337334
338335 /* core id has to be in the [0 .. cores_per_node - 1] range */
339− c->cpu_core_id %= cores_per_node;
340− c->compute_unit_id %= cus_per_node;
336+ c->cpu_core_id %= cus_per_node;
341337 }
342338 }
343339 #endif
arch/x86/kernel/cpu/mcheck/therm_throt.c+3−0
@@ -384,6 +384,9 @@ static void intel_thermal_interrupt(void) · 383 unmodified lines
384384 {
385385 __u64 msr_val;
386386
387+ if (static_cpu_has(X86_FEATURE_HWP))
388+ wrmsrl_safe(MSR_HWP_STATUS, 0);
389+
387390 rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
388391
389392 /* Check for violation of core thermal thresholds*/
arch/x86/kernel/cpu/powerflags.c+2−0
@@ -18,4 +18,6 @@ const char *const x86_power_flags[32] = { · 17 unmodified lines
1818 "", /* tsc invariant mapped to constant_tsc */
1919 "cpb", /* core performance boost */
2020 "eff_freq_ro", /* Readonly aperf/mperf */
21+ "proc_feedback", /* processor feedback interface */
22+ "acc_power", /* accumulated power mechanism */
2123 };
arch/x86/kernel/smpboot.c+1−1
@@ -422,7 +422,7 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) · 421 unmodified lines
422422
423423 if (c->phys_proc_id == o->phys_proc_id &&
424424 per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2) &&
425− c->compute_unit_id == o->compute_unit_id)
425+ c->cpu_core_id == o->cpu_core_id)
426426 return topology_sane(c, o, "smt");
427427
428428 } else if (c->phys_proc_id == o->phys_proc_id &&
arch/x86/mm/tlb.c+10−4
@@ -104,10 +104,8 @@ static void flush_tlb_func(void *info) · 103 unmodified lines
104104
105105 inc_irq_stat(irq_tlb_count);
106106
107− if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
107+ if (f->flush_mm && f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
108108 return;
109− if (!f->flush_end)
110− f->flush_end = f->flush_start + PAGE_SIZE;
111109
112110 count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED);
113111 if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) {
@@ -135,12 +133,20 @@ void native_flush_tlb_others(const struct cpumask *cpumask, · 21 unmodified lines
135133 unsigned long end)
136134 {
137135 struct flush_tlb_info info;
136+
137+ if (end == 0)
138+ end = start + PAGE_SIZE;
138139 info.flush_mm = mm;
139140 info.flush_start = start;
140141 info.flush_end = end;
141142
142143 count_vm_tlb_event(NR_TLB_REMOTE_FLUSH);
143− trace_tlb_flush(TLB_REMOTE_SEND_IPI, end - start);
144+ if (end == TLB_FLUSH_ALL)
145+ trace_tlb_flush(TLB_REMOTE_SEND_IPI, TLB_FLUSH_ALL);
146+ else
147+ trace_tlb_flush(TLB_REMOTE_SEND_IPI,
148+ (end - start) >> PAGE_SHIFT);
149+
144150 if (is_uv_system()) {
145151 unsigned int cpu;
146152
arch/x86/ras/mce_amd_inj.c+2−1
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/pci.h>
2121
2222 #include <asm/mce.h>
23+#include <asm/smp.h>
2324 #include <asm/amd_nb.h>
2425 #include <asm/irq_vectors.h>
2526
@@ -206,7 +207,7 @@ static u32 get_nbc_for_node(int node_id) · 180 unmodified lines
206207 struct cpuinfo_x86 *c = &boot_cpu_data;
207208 u32 cores_per_node;
208209
209− cores_per_node = c->x86_max_cores / amd_get_nodes_per_socket();
210+ cores_per_node = (c->x86_max_cores * smp_num_siblings) / amd_get_nodes_per_socket();
210211
211212 return cores_per_node * node_id;
212213 }
crypto/asymmetric_keys/pkcs7_trust.c+2−0
@@ -178,6 +178,8 @@ int pkcs7_validate_trust(struct pkcs7_message *pkcs7, · 177 unmodified lines
178178 int cached_ret = -ENOKEY;
179179 int ret;
180180
181+ *_trusted = false;
182+
181183 for (p = pkcs7->certs; p; p = p->next)
182184 p->seen = false;
183185
drivers/acpi/acpi_processor.c+52−0
@@ -491,6 +491,58 @@ static void acpi_processor_remove(struct acpi_device *device) · 490 unmodified lines
491491 }
492492 #endif /* CONFIG_ACPI_HOTPLUG_CPU */
493493
494+#ifdef CONFIG_X86
495+static bool acpi_hwp_native_thermal_lvt_set;
496+static acpi_status __init acpi_hwp_native_thermal_lvt_osc(acpi_handle handle,
497+ u32 lvl,
498+ void *context,
499+ void **rv)
500+{
501+ u8 sb_uuid_str[] = "4077A616-290C-47BE-9EBD-D87058713953";
502+ u32 capbuf[2];
503+ struct acpi_osc_context osc_context = {
504+ .uuid_str = sb_uuid_str,
505+ .rev = 1,
506+ .cap.length = 8,
507+ .cap.pointer = capbuf,
508+ };
509+
510+ if (acpi_hwp_native_thermal_lvt_set)
511+ return AE_CTRL_TERMINATE;
512+
513+ capbuf[0] = 0x0000;
514+ capbuf[1] = 0x1000; /* set bit 12 */
515+
516+ if (ACPI_SUCCESS(acpi_run_osc(handle, &osc_context))) {
517+ if (osc_context.ret.pointer && osc_context.ret.length > 1) {
518+ u32 *capbuf_ret = osc_context.ret.pointer;
519+
520+ if (capbuf_ret[1] & 0x1000) {
521+ acpi_handle_info(handle,
522+ "_OSC native thermal LVT Acked\n");
523+ acpi_hwp_native_thermal_lvt_set = true;
524+ }
525+ }
526+ kfree(osc_context.ret.pointer);
527+ }
528+
529+ return AE_OK;
530+}
531+
532+void __init acpi_early_processor_osc(void)
533+{
534+ if (boot_cpu_has(X86_FEATURE_HWP)) {
535+ acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
536+ ACPI_UINT32_MAX,
537+ acpi_hwp_native_thermal_lvt_osc,
538+ NULL, NULL, NULL);
539+ acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID,
540+ acpi_hwp_native_thermal_lvt_osc,
541+ NULL, NULL);
542+ }
543+}
544+#endif
545+
494546 /*
495547 * The following ACPI IDs are known to be suitable for representing as
496548 * processor devices.
drivers/acpi/bus.c+3−0
@@ -1019,6 +1019,9 @@ static int __init acpi_bus_init(void) · 1018 unmodified lines
10191019 goto error1;
10201020 }
10211021
1022+ /* Set capability bits for _OSC under processor scope */
1023+ acpi_early_processor_osc();
1024+
10221025 /*
10231026 * _OSC method may exist in module level code,
10241027 * so it must be run after ACPI_FULL_INITIALIZATION
drivers/acpi/internal.h+6−0
@@ -145,6 +145,12 @@ void acpi_early_processor_set_pdc(void); · 144 unmodified lines
145145 static inline void acpi_early_processor_set_pdc(void) {}
146146 #endif
147147
148+#ifdef CONFIG_X86
149+void acpi_early_processor_osc(void);
150+#else
151+static inline void acpi_early_processor_osc(void) {}
152+#endif
153+
148154 /* --------------------------------------------------------------------------
149155 Embedded Controller
150156 -------------------------------------------------------------------------- */
drivers/clk/mediatek/reset.c+1−1
@@ -57,7 +57,7 @@ static int mtk_reset(struct reset_controller_dev *rcdev, · 56 unmodified lines
5757 return mtk_reset_deassert(rcdev, id);
5858 }
5959
60−static struct reset_control_ops mtk_reset_ops = {
60+static const struct reset_control_ops mtk_reset_ops = {
6161 .assert = mtk_reset_assert,
6262 .deassert = mtk_reset_deassert,
6363 .reset = mtk_reset,
drivers/clk/mmp/reset.c+1−1
@@ -74,7 +74,7 @@ static int mmp_clk_reset_deassert(struct reset_controller_dev *rcdev, · 73 unmodified lines
7474 return 0;
7575 }
7676
77−static struct reset_control_ops mmp_clk_reset_ops = {
77+static const struct reset_control_ops mmp_clk_reset_ops = {
7878 .assert = mmp_clk_reset_assert,
7979 .deassert = mmp_clk_reset_deassert,
8080 };
drivers/clk/qcom/gcc-ipq4019.c+35−35
@@ -129,20 +129,10 @@ static const char * const gcc_xo_ddr_500_200[] = { · 128 unmodified lines
129129 };
130130
131131 #define F(f, s, h, m, n) { (f), (s), (2 * (h) - 1), (m), (n) }
132−#define P_XO 0
133−#define FE_PLL_200 1
134−#define FE_PLL_500 2
135−#define DDRC_PLL_666 3
136−
137−#define DDRC_PLL_666_SDCC 1
138−#define FE_PLL_125_DLY 1
139−
140−#define FE_PLL_WCSS2G 1
141−#define FE_PLL_WCSS5G 1
142132
143133 static const struct freq_tbl ftbl_gcc_audio_pwm_clk[] = {
144134 F(48000000, P_XO, 1, 0, 0),
145− F(200000000, FE_PLL_200, 1, 0, 0),
135+ F(200000000, P_FEPLL200, 1, 0, 0),
146136 { }
147137 };
148138
@@ -334,15 +324,15 @@ static struct clk_branch gcc_blsp1_qup2_spi_apps_clk = { · 185 unmodified lines
334324 };
335325
336326 static const struct freq_tbl ftbl_gcc_blsp1_uart1_2_apps_clk[] = {
337− F(1843200, FE_PLL_200, 1, 144, 15625),
338− F(3686400, FE_PLL_200, 1, 288, 15625),
339− F(7372800, FE_PLL_200, 1, 576, 15625),
340− F(14745600, FE_PLL_200, 1, 1152, 15625),
341− F(16000000, FE_PLL_200, 1, 2, 25),
327+ F(1843200, P_FEPLL200, 1, 144, 15625),
328+ F(3686400, P_FEPLL200, 1, 288, 15625),
329+ F(7372800, P_FEPLL200, 1, 576, 15625),
330+ F(14745600, P_FEPLL200, 1, 1152, 15625),
331+ F(16000000, P_FEPLL200, 1, 2, 25),
342332 F(24000000, P_XO, 1, 1, 2),
343− F(32000000, FE_PLL_200, 1, 4, 25),
344− F(40000000, FE_PLL_200, 1, 1, 5),
345− F(46400000, FE_PLL_200, 1, 29, 125),
333+ F(32000000, P_FEPLL200, 1, 4, 25),
334+ F(40000000, P_FEPLL200, 1, 1, 5),
335+ F(46400000, P_FEPLL200, 1, 29, 125),
346336 F(48000000, P_XO, 1, 0, 0),
347337 { }
348338 };
@@ -410,9 +400,9 @@ static struct clk_branch gcc_blsp1_uart2_apps_clk = { · 61 unmodified lines
410400 };
411401
412402 static const struct freq_tbl ftbl_gcc_gp_clk[] = {
413− F(1250000, FE_PLL_200, 1, 16, 0),
414− F(2500000, FE_PLL_200, 1, 8, 0),
415− F(5000000, FE_PLL_200, 1, 4, 0),
403+ F(1250000, P_FEPLL200, 1, 16, 0),
404+ F(2500000, P_FEPLL200, 1, 8, 0),
405+ F(5000000, P_FEPLL200, 1, 4, 0),
416406 { }
417407 };
418408
@@ -512,11 +502,11 @@ static struct clk_branch gcc_gp3_clk = { · 93 unmodified lines
512502 static const struct freq_tbl ftbl_gcc_sdcc1_apps_clk[] = {
513503 F(144000, P_XO, 1, 3, 240),
514504 F(400000, P_XO, 1, 1, 0),
515− F(20000000, FE_PLL_500, 1, 1, 25),
516− F(25000000, FE_PLL_500, 1, 1, 20),
517− F(50000000, FE_PLL_500, 1, 1, 10),
518− F(100000000, FE_PLL_500, 1, 1, 5),
519− F(193000000, DDRC_PLL_666_SDCC, 1, 0, 0),
505+ F(20000000, P_FEPLL500, 1, 1, 25),
506+ F(25000000, P_FEPLL500, 1, 1, 20),
507+ F(50000000, P_FEPLL500, 1, 1, 10),
508+ F(100000000, P_FEPLL500, 1, 1, 5),
509+ F(193000000, P_DDRPLL, 1, 0, 0),
520510 { }
521511 };
522512
@@ -536,9 +526,9 @@ static struct clk_rcg2 sdcc1_apps_clk_src = { · 13 unmodified lines
536526
537527 static const struct freq_tbl ftbl_gcc_apps_clk[] = {
538528 F(48000000, P_XO, 1, 0, 0),
539− F(200000000, FE_PLL_200, 1, 0, 0),
540− F(500000000, FE_PLL_500, 1, 0, 0),
541− F(626000000, DDRC_PLL_666, 1, 0, 0),
529+ F(200000000, P_FEPLL200, 1, 0, 0),
530+ F(500000000, P_FEPLL500, 1, 0, 0),
531+ F(626000000, P_DDRPLLAPSS, 1, 0, 0),
542532 { }
543533 };
544534
@@ -557,7 +547,7 @@ static struct clk_rcg2 apps_clk_src = { · 12 unmodified lines
557547
558548 static const struct freq_tbl ftbl_gcc_apps_ahb_clk[] = {
559549 F(48000000, P_XO, 1, 0, 0),
560− F(100000000, FE_PLL_200, 2, 0, 0),
550+ F(100000000, P_FEPLL200, 2, 0, 0),
561551 { }
562552 };
563553
@@ -940,7 +930,7 @@ static struct clk_branch gcc_usb2_mock_utmi_clk = { · 376 unmodified lines
940930 };
941931
942932 static const struct freq_tbl ftbl_gcc_usb30_mock_utmi_clk[] = {
943− F(2000000, FE_PLL_200, 10, 0, 0),
933+ F(2000000, P_FEPLL200, 10, 0, 0),
944934 { }
945935 };
946936
@@ -1007,7 +997,7 @@ static struct clk_branch gcc_usb3_mock_utmi_clk = { · 60 unmodified lines
1007997 };
1008998
1009999 static const struct freq_tbl ftbl_gcc_fephy_dly_clk[] = {
1010− F(125000000, FE_PLL_125_DLY, 1, 0, 0),
1000+ F(125000000, P_FEPLL125DLY, 1, 0, 0),
10111001 { }
10121002 };
10131003
@@ -1027,7 +1017,7 @@ static struct clk_rcg2 fephy_125m_dly_clk_src = { · 13 unmodified lines
10271017
10281018 static const struct freq_tbl ftbl_gcc_wcss2g_clk[] = {
10291019 F(48000000, P_XO, 1, 0, 0),
1030− F(250000000, FE_PLL_WCSS2G, 1, 0, 0),
1020+ F(250000000, P_FEPLLWCSS2G, 1, 0, 0),
10311021 { }
10321022 };
10331023
@@ -1097,7 +1087,7 @@ static struct clk_branch gcc_wcss2g_rtc_clk = { · 63 unmodified lines
10971087
10981088 static const struct freq_tbl ftbl_gcc_wcss5g_clk[] = {
10991089 F(48000000, P_XO, 1, 0, 0),
1100− F(250000000, FE_PLL_WCSS5G, 1, 0, 0),
1090+ F(250000000, P_FEPLLWCSS5G, 1, 0, 0),
11011091 { }
11021092 };
11031093
@@ -1325,6 +1315,16 @@ MODULE_DEVICE_TABLE(of, gcc_ipq4019_match_table); · 221 unmodified lines
13251315
13261316 static int gcc_ipq4019_probe(struct platform_device *pdev)
13271317 {
1318+ struct device *dev = &pdev->dev;
1319+
1320+ clk_register_fixed_rate(dev, "fepll125", "xo", 0, 200000000);
1321+ clk_register_fixed_rate(dev, "fepll125dly", "xo", 0, 200000000);
1322+ clk_register_fixed_rate(dev, "fepllwcss2g", "xo", 0, 200000000);
1323+ clk_register_fixed_rate(dev, "fepllwcss5g", "xo", 0, 200000000);
1324+ clk_register_fixed_rate(dev, "fepll200", "xo", 0, 200000000);
1325+ clk_register_fixed_rate(dev, "fepll500", "xo", 0, 200000000);
1326+ clk_register_fixed_rate(dev, "ddrpllapss", "xo", 0, 666000000);
1327+
13281328 return qcom_cc_probe(pdev, &gcc_ipq4019_desc);
13291329 }
13301330
drivers/clk/qcom/reset.c+1−1
@@ -55,7 +55,7 @@ qcom_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) · 54 unmodified lines
5555 return regmap_update_bits(rst->regmap, map->reg, mask, 0);
5656 }
5757
58−struct reset_control_ops qcom_reset_ops = {
58+const struct reset_control_ops qcom_reset_ops = {
5959 .reset = qcom_reset,
6060 .assert = qcom_reset_assert,
6161 .deassert = qcom_reset_deassert,
drivers/clk/qcom/reset.h+1−1
@@ -32,6 +32,6 @@ struct qcom_reset_controller { · 31 unmodified lines
3232 #define to_qcom_reset_controller(r) \
3333 container_of(r, struct qcom_reset_controller, rcdev);
3434
35−extern struct reset_control_ops qcom_reset_ops;
35+extern const struct reset_control_ops qcom_reset_ops;
3636
3737 #endif
drivers/clk/rockchip/softrst.c+1−1
@@ -81,7 +81,7 @@ static int rockchip_softrst_deassert(struct reset_controller_dev *rcdev, · 80 unmodified lines
8181 return 0;
8282 }
8383
84−static struct reset_control_ops rockchip_softrst_ops = {
84+static const struct reset_control_ops rockchip_softrst_ops = {
8585 .assert = rockchip_softrst_assert,
8686 .deassert = rockchip_softrst_deassert,
8787 };
drivers/clk/sirf/clk-atlas7.c+1−1
@@ -1423,7 +1423,7 @@ static int atlas7_reset_module(struct reset_controller_dev *rcdev, · 1422 unmodified lines
14231423 return 0;
14241424 }
14251425
1426−static struct reset_control_ops atlas7_rst_ops = {
1426+static const struct reset_control_ops atlas7_rst_ops = {
14271427 .reset = atlas7_reset_module,
14281428 };
14291429
drivers/clk/sunxi/clk-a10-ve.c+1−1
@@ -85,7 +85,7 @@ static int sunxi_ve_of_xlate(struct reset_controller_dev *rcdev, · 84 unmodified lines
8585 return 0;
8686 }
8787
88−static struct reset_control_ops sunxi_ve_reset_ops = {
88+static const struct reset_control_ops sunxi_ve_reset_ops = {
8989 .assert = sunxi_ve_reset_assert,
9090 .deassert = sunxi_ve_reset_deassert,
9191 };
drivers/clk/sunxi/clk-sun9i-mmc.c+1−1
@@ -83,7 +83,7 @@ static int sun9i_mmc_reset_deassert(struct reset_controller_dev *rcdev, · 82 unmodified lines
8383 return 0;
8484 }
8585
86−static struct reset_control_ops sun9i_mmc_reset_ops = {
86+static const struct reset_control_ops sun9i_mmc_reset_ops = {
8787 .assert = sun9i_mmc_reset_assert,
8888 .deassert = sun9i_mmc_reset_deassert,
8989 };
drivers/clk/sunxi/clk-usb.c+1−1
@@ -76,7 +76,7 @@ static int sunxi_usb_reset_deassert(struct reset_controller_dev *rcdev, · 75 unmodified lines
7676 return 0;
7777 }
7878
79−static struct reset_control_ops sunxi_usb_reset_ops = {
79+static const struct reset_control_ops sunxi_usb_reset_ops = {
8080 .assert = sunxi_usb_reset_assert,
8181 .deassert = sunxi_usb_reset_deassert,
8282 };
drivers/clk/tegra/clk.c+1−1
@@ -271,7 +271,7 @@ void __init tegra_init_from_table(struct tegra_clk_init_table *tbl, · 270 unmodified lines
271271 }
272272 }
273273
274−static struct reset_control_ops rst_ops = {
274+static const struct reset_control_ops rst_ops = {
275275 .assert = tegra_clk_rst_assert,
276276 .deassert = tegra_clk_rst_deassert,
277277 };
drivers/gpio/gpio-menz127.c+4−5
@@ -37,7 +37,6 @@ struct men_z127_gpio { · 36 unmodified lines
3737 void __iomem *reg_base;
3838 struct mcb_device *mdev;
3939 struct resource *mem;
40− spinlock_t lock;
4140 };
4241
4342 static int men_z127_debounce(struct gpio_chip *gc, unsigned gpio,
@@ -69,7 +68,7 @@ static int men_z127_debounce(struct gpio_chip *gc, unsigned gpio, · 25 unmodified lines
6968 debounce /= 50;
7069 }
7170
72− spin_lock(&priv->lock);
71+ spin_lock(&gc->bgpio_lock);
7372
7473 db_en = readl(priv->reg_base + MEN_Z127_DBER);
7574
@@ -84,7 +83,7 @@ static int men_z127_debounce(struct gpio_chip *gc, unsigned gpio, · 8 unmodified lines
8483 writel(db_en, priv->reg_base + MEN_Z127_DBER);
8584 writel(db_cnt, priv->reg_base + GPIO_TO_DBCNT_REG(gpio));
8685
87− spin_unlock(&priv->lock);
86+ spin_unlock(&gc->bgpio_lock);
8887
8988 return 0;
9089 }
@@ -97,7 +96,7 @@ static int men_z127_request(struct gpio_chip *gc, unsigned gpio_pin) · 6 unmodified lines
9796 if (gpio_pin >= gc->ngpio)
9897 return -EINVAL;
9998
100− spin_lock(&priv->lock);
99+ spin_lock(&gc->bgpio_lock);
101100 od_en = readl(priv->reg_base + MEN_Z127_ODER);
102101
103102 if (gpiochip_line_is_open_drain(gc, gpio_pin))
@@ -106,7 +105,7 @@ static int men_z127_request(struct gpio_chip *gc, unsigned gpio_pin) · 2 unmodified lines
106105 od_en &= ~BIT(gpio_pin);
107106
108107 writel(od_en, priv->reg_base + MEN_Z127_ODER);
109− spin_unlock(&priv->lock);
108+ spin_unlock(&gc->bgpio_lock);
110109
111110 return 0;
112111 }
drivers/gpio/gpio-xgene.c+5−0
@@ -173,6 +173,11 @@ static int xgene_gpio_probe(struct platform_device *pdev) · 172 unmodified lines
173173 }
174174
175175 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
176+ if (!res) {
177+ err = -EINVAL;
178+ goto err;
179+ }
180+
176181 gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
177182 resource_size(res));
178183 if (!gpio->base) {
drivers/gpu/drm/amd/acp/Kconfig+6−2
@@ -1,10 +1,14 @@
1−menu "ACP Configuration"
1+menu "ACP (Audio CoProcessor) Configuration"
22
33 config DRM_AMD_ACP
4− bool "Enable ACP IP support"
4+ bool "Enable AMD Audio CoProcessor IP support"
55 select MFD_CORE
66 select PM_GENERIC_DOMAINS if PM
77 help
88 Choose this option to enable ACP IP support for AMD SOCs.
9+ This adds the ACP (Audio CoProcessor) IP driver and wires
10+ it up into the amdgpu driver. The ACP block provides the DMA
11+ engine for the i2s-based ALSA driver. It is required for audio
12+ on APUs which utilize an i2s codec.
913
1014 endmenu
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c+4−0
@@ -608,6 +608,10 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) · 607 unmodified lines
608608 if ((offset + size) <= adev->mc.visible_vram_size)
609609 return 0;
610610
611+ /* Can't move a pinned BO to visible VRAM */
612+ if (abo->pin_count > 0)
613+ return -EINVAL;
614+
611615 /* hurrah the memory is not visible ! */
612616 amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM);
613617 lpfn = adev->mc.visible_vram_size >> PAGE_SHIFT;
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+6−0
@@ -384,9 +384,15 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, · 383 unmodified lines
384384 struct ttm_mem_reg *new_mem)
385385 {
386386 struct amdgpu_device *adev;
387+ struct amdgpu_bo *abo;
387388 struct ttm_mem_reg *old_mem = &bo->mem;
388389 int r;
389390
391+ /* Can't move a pinned BO */
392+ abo = container_of(bo, struct amdgpu_bo, tbo);
393+ if (WARN_ON_ONCE(abo->pin_count > 0))
394+ return -EINVAL;
395+
390396 adev = amdgpu_get_adev(bo->bdev);
391397 if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) {
392398 amdgpu_move_null(bo, new_mem);
drivers/gpu/drm/drm_dp_helper.c+17−10
@@ -179,7 +179,7 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, · 178 unmodified lines
179179 {
180180 struct drm_dp_aux_msg msg;
181181 unsigned int retry;
182− int err;
182+ int err = 0;
183183
184184 memset(&msg, 0, sizeof(msg));
185185 msg.address = offset;
@@ -187,6 +187,8 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, · 1 unmodified line
187187 msg.buffer = buffer;
188188 msg.size = size;
189189
190+ mutex_lock(&aux->hw_mutex);
191+
190192 /*
191193 * The specification doesn't give any recommendation on how often to
192194 * retry native transactions. We used to retry 7 times like for
@@ -195,25 +197,24 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, · 2 unmodified lines
195197 */
196198 for (retry = 0; retry < 32; retry++) {
197199
198− mutex_lock(&aux->hw_mutex);
199200 err = aux->transfer(aux, &msg);
200− mutex_unlock(&aux->hw_mutex);
201201 if (err < 0) {
202202 if (err == -EBUSY)
203203 continue;
204204
205− return err;
205+ goto unlock;
206206 }
207207
208208
209209 switch (msg.reply & DP_AUX_NATIVE_REPLY_MASK) {
210210 case DP_AUX_NATIVE_REPLY_ACK:
211211 if (err < size)
212− return -EPROTO;
213− return err;
212+ err = -EPROTO;
213+ goto unlock;
214214
215215 case DP_AUX_NATIVE_REPLY_NACK:
216− return -EIO;
216+ err = -EIO;
217+ goto unlock;
217218
218219 case DP_AUX_NATIVE_REPLY_DEFER:
219220 usleep_range(AUX_RETRY_INTERVAL, AUX_RETRY_INTERVAL + 100);
@@ -222,7 +223,11 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request, · 2 unmodified lines
222223 }
223224
224225 DRM_DEBUG_KMS("too many retries, giving up\n");
225− return -EIO;
226+ err = -EIO;
227+
228+unlock:
229+ mutex_unlock(&aux->hw_mutex);
230+ return err;
226231 }
227232
228233 /**
@@ -544,9 +549,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) · 315 unmodified lines
544549 int max_retries = max(7, drm_dp_i2c_retry_count(msg, dp_aux_i2c_speed_khz));
545550
546551 for (retry = 0, defer_i2c = 0; retry < (max_retries + defer_i2c); retry++) {
547− mutex_lock(&aux->hw_mutex);
548552 ret = aux->transfer(aux, msg);
549− mutex_unlock(&aux->hw_mutex);
550553 if (ret < 0) {
551554 if (ret == -EBUSY)
552555 continue;
@@ -685,6 +688,8 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, · 132 unmodified lines
685688
686689 memset(&msg, 0, sizeof(msg));
687690
691+ mutex_lock(&aux->hw_mutex);
692+
688693 for (i = 0; i < num; i++) {
689694 msg.address = msgs[i].addr;
690695 drm_dp_i2c_msg_set_request(&msg, &msgs[i]);
@@ -739,6 +744,8 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, · 48 unmodified lines
739744 msg.size = 0;
740745 (void)drm_dp_i2c_do_msg(aux, &msg);
741746
747+ mutex_unlock(&aux->hw_mutex);
748+
742749 return err;
743750 }
744751
drivers/gpu/drm/msm/hdmi/hdmi.h+1−1
@@ -196,7 +196,7 @@ void __exit msm_hdmi_phy_driver_unregister(void); · 195 unmodified lines
196196 int msm_hdmi_pll_8960_init(struct platform_device *pdev);
197197 int msm_hdmi_pll_8996_init(struct platform_device *pdev);
198198 #else
199−static inline int msm_hdmi_pll_8960_init(struct platform_device *pdev);
199+static inline int msm_hdmi_pll_8960_init(struct platform_device *pdev)
200200 {
201201 return -ENODEV;
202202 }
drivers/gpu/drm/msm/msm_drv.c+0−3
@@ -467,9 +467,6 @@ static void msm_preclose(struct drm_device *dev, struct drm_file *file) · 466 unmodified lines
467467 struct msm_file_private *ctx = file->driver_priv;
468468 struct msm_kms *kms = priv->kms;
469469
470− if (kms)
471− kms->funcs->preclose(kms, file);
472−
473470 mutex_lock(&dev->struct_mutex);
474471 if (ctx == priv->lastctx)
475472 priv->lastctx = NULL;
drivers/gpu/drm/msm/msm_kms.h+0−1
@@ -55,7 +55,6 @@ struct msm_kms_funcs { · 54 unmodified lines
5555 struct drm_encoder *slave_encoder,
5656 bool is_cmd_mode);
5757 /* cleanup: */
58− void (*preclose)(struct msm_kms *kms, struct drm_file *file);
5958 void (*destroy)(struct msm_kms *kms);
6059 };
6160
drivers/gpu/drm/radeon/radeon_object.c+4−0
@@ -799,6 +799,10 @@ int radeon_bo_fault_reserve_notify(struct ttm_buffer_object *bo) · 798 unmodified lines
799799 if ((offset + size) <= rdev->mc.visible_vram_size)
800800 return 0;
801801
802+ /* Can't move a pinned BO to visible VRAM */
803+ if (rbo->pin_count > 0)
804+ return -EINVAL;
805+
802806 /* hurrah the memory is not visible ! */
803807 radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_VRAM);
804808 lpfn = rdev->mc.visible_vram_size >> PAGE_SHIFT;
drivers/gpu/drm/radeon/radeon_ttm.c+6−0
@@ -397,9 +397,15 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, · 396 unmodified lines
397397 struct ttm_mem_reg *new_mem)
398398 {
399399 struct radeon_device *rdev;
400+ struct radeon_bo *rbo;
400401 struct ttm_mem_reg *old_mem = &bo->mem;
401402 int r;
402403
404+ /* Can't move a pinned BO */
405+ rbo = container_of(bo, struct radeon_bo, tbo);
406+ if (WARN_ON_ONCE(rbo->pin_count > 0))
407+ return -EINVAL;
408+
403409 rdev = radeon_get_rdev(bo->bdev);
404410 if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) {
405411 radeon_move_null(bo, new_mem);
drivers/gpu/drm/radeon/si_dpm.c+6−0
@@ -2926,9 +2926,11 @@ static struct si_dpm_quirk si_dpm_quirk_list[] = { · 2925 unmodified lines
29262926 /* PITCAIRN - https://bugs.freedesktop.org/show_bug.cgi?id=76490 */
29272927 { PCI_VENDOR_ID_ATI, 0x6810, 0x1462, 0x3036, 0, 120000 },
29282928 { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0xe271, 0, 120000 },
2929+ { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0x2015, 0, 120000 },
29292930 { PCI_VENDOR_ID_ATI, 0x6810, 0x174b, 0xe271, 85000, 90000 },
29302931 { PCI_VENDOR_ID_ATI, 0x6811, 0x1462, 0x2015, 0, 120000 },
29312932 { PCI_VENDOR_ID_ATI, 0x6811, 0x1043, 0x2015, 0, 120000 },
2933+ { PCI_VENDOR_ID_ATI, 0x6811, 0x148c, 0x2015, 0, 120000 },
29322934 { 0, 0, 0, 0 },
29332935 };
29342936
@@ -3008,6 +3010,10 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, · 73 unmodified lines
30083010 }
30093011 ++p;
30103012 }
3013+ /* limit mclk on all R7 370 parts for stability */
3014+ if (rdev->pdev->device == 0x6811 &&
3015+ rdev->pdev->revision == 0x81)
3016+ max_mclk = 120000;
30113017
30123018 if (rps->vce_active) {
30133019 rps->evclk = rdev->pm.dpm.vce_states[rdev->pm.dpm.vce_level].evclk;
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c+10−3
@@ -271,8 +271,6 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, · 270 unmodified lines
271271 if (!iores)
272272 return -ENXIO;
273273
274− platform_set_drvdata(pdev, hdmi);
275−
276274 encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);
277275 /*
278276 * If we failed to find the CRTC(s) which this encoder is
@@ -293,7 +291,16 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master, · 14 unmodified lines
293291 drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs,
294292 DRM_MODE_ENCODER_TMDS, NULL);
295293
296− return dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data);
294+ ret = dw_hdmi_bind(dev, master, data, encoder, iores, irq, plat_data);
295+
296+ /*
297+ * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(),
298+ * which would have called the encoder cleanup. Do it manually.
299+ */
300+ if (ret)
301+ drm_encoder_cleanup(encoder);
302+
303+ return ret;
297304 }
298305
299306 static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,
drivers/gpu/drm/rockchip/rockchip_drm_drv.c+22−0
@@ -251,6 +251,27 @@ static int rockchip_drm_unload(struct drm_device *drm_dev) · 250 unmodified lines
251251 return 0;
252252 }
253253
254+static void rockchip_drm_crtc_cancel_pending_vblank(struct drm_crtc *crtc,
255+ struct drm_file *file_priv)
256+{
257+ struct rockchip_drm_private *priv = crtc->dev->dev_private;
258+ int pipe = drm_crtc_index(crtc);
259+
260+ if (pipe < ROCKCHIP_MAX_CRTC &&
261+ priv->crtc_funcs[pipe] &&
262+ priv->crtc_funcs[pipe]->cancel_pending_vblank)
263+ priv->crtc_funcs[pipe]->cancel_pending_vblank(crtc, file_priv);
264+}
265+
266+static void rockchip_drm_preclose(struct drm_device *dev,
267+ struct drm_file *file_priv)
268+{
269+ struct drm_crtc *crtc;
270+
271+ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head)
272+ rockchip_drm_crtc_cancel_pending_vblank(crtc, file_priv);
273+}
274+
254275 void rockchip_drm_lastclose(struct drm_device *dev)
255276 {
256277 struct rockchip_drm_private *priv = dev->dev_private;
@@ -281,6 +302,7 @@ static struct drm_driver rockchip_drm_driver = { · 24 unmodified lines
281302 DRIVER_PRIME | DRIVER_ATOMIC,
282303 .load = rockchip_drm_load,
283304 .unload = rockchip_drm_unload,
305+ .preclose = rockchip_drm_preclose,
284306 .lastclose = rockchip_drm_lastclose,
285307 .get_vblank_counter = drm_vblank_no_hw_counter,
286308 .enable_vblank = rockchip_drm_crtc_enable_vblank,
drivers/gpu/drm/rockchip/rockchip_drm_drv.h+1−0
@@ -40,6 +40,7 @@ struct rockchip_crtc_funcs { · 39 unmodified lines
4040 int (*enable_vblank)(struct drm_crtc *crtc);
4141 void (*disable_vblank)(struct drm_crtc *crtc);
4242 void (*wait_for_update)(struct drm_crtc *crtc);
43+ void (*cancel_pending_vblank)(struct drm_crtc *crtc, struct drm_file *file_priv);
4344 };
4445
4546 struct rockchip_atomic_commit {
drivers/gpu/drm/rockchip/rockchip_drm_vop.c+67−12
@@ -499,10 +499,25 @@ err_disable_hclk: · 498 unmodified lines
499499 static void vop_crtc_disable(struct drm_crtc *crtc)
500500 {
501501 struct vop *vop = to_vop(crtc);
502+ int i;
502503
503504 if (!vop->is_enabled)
504505 return;
505506
507+ /*
508+ * We need to make sure that all windows are disabled before we
509+ * disable that crtc. Otherwise we might try to scan from a destroyed
510+ * buffer later.
511+ */
512+ for (i = 0; i < vop->data->win_size; i++) {
513+ struct vop_win *vop_win = &vop->win[i];
514+ const struct vop_win_data *win = vop_win->data;
515+
516+ spin_lock(&vop->reg_lock);
517+ VOP_WIN_SET(vop, win, enable, 0);
518+ spin_unlock(&vop->reg_lock);
519+ }
520+
506521 drm_crtc_vblank_off(crtc);
507522
508523 /*
@@ -549,6 +564,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, · 40 unmodified lines
549564 struct drm_plane_state *state)
550565 {
551566 struct drm_crtc *crtc = state->crtc;
567+ struct drm_crtc_state *crtc_state;
552568 struct drm_framebuffer *fb = state->fb;
553569 struct vop_win *vop_win = to_vop_win(plane);
554570 struct vop_plane_state *vop_plane_state = to_vop_plane_state(state);
@@ -563,12 +579,13 @@ static int vop_plane_atomic_check(struct drm_plane *plane, · 8 unmodified lines
563579 int max_scale = win->phy->scl ? FRAC_16_16(8, 1) :
564580 DRM_PLANE_HELPER_NO_SCALING;
565581
566− crtc = crtc ? crtc : plane->state->crtc;
567− /*
568− * Both crtc or plane->state->crtc can be null.
569− */
570582 if (!crtc || !fb)
571583 goto out_disable;
584+
585+ crtc_state = drm_atomic_get_existing_crtc_state(state->state, crtc);
586+ if (WARN_ON(!crtc_state))
587+ return -EINVAL;
588+
572589 src->x1 = state->src_x;
573590 src->y1 = state->src_y;
574591 src->x2 = state->src_x + state->src_w;
@@ -580,8 +597,8 @@ static int vop_plane_atomic_check(struct drm_plane *plane, · 5 unmodified lines
580597
581598 clip.x1 = 0;
582599 clip.y1 = 0;
583− clip.x2 = crtc->mode.hdisplay;
584− clip.y2 = crtc->mode.vdisplay;
600+ clip.x2 = crtc_state->adjusted_mode.hdisplay;
601+ clip.y2 = crtc_state->adjusted_mode.vdisplay;
585602
586603 ret = drm_plane_helper_check_update(plane, crtc, state->fb,
587604 src, dest, &clip,
@@ -873,10 +890,30 @@ static void vop_crtc_wait_for_update(struct drm_crtc *crtc) · 285 unmodified lines
873890 WARN_ON(!wait_for_completion_timeout(&vop->wait_update_complete, 100));
874891 }
875892
893+static void vop_crtc_cancel_pending_vblank(struct drm_crtc *crtc,
894+ struct drm_file *file_priv)
895+{
896+ struct drm_device *drm = crtc->dev;
897+ struct vop *vop = to_vop(crtc);
898+ struct drm_pending_vblank_event *e;
899+ unsigned long flags;
900+
901+ spin_lock_irqsave(&drm->event_lock, flags);
902+ e = vop->event;
903+ if (e && e->base.file_priv == file_priv) {
904+ vop->event = NULL;
905+
906+ e->base.destroy(&e->base);
907+ file_priv->event_space += sizeof(e->event);
908+ }
909+ spin_unlock_irqrestore(&drm->event_lock, flags);
910+}
911+
876912 static const struct rockchip_crtc_funcs private_crtc_funcs = {
877913 .enable_vblank = vop_crtc_enable_vblank,
878914 .disable_vblank = vop_crtc_disable_vblank,
879915 .wait_for_update = vop_crtc_wait_for_update,
916+ .cancel_pending_vblank = vop_crtc_cancel_pending_vblank,
880917 };
881918
882919 static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -885,9 +922,6 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, · 2 unmodified lines
885922 {
886923 struct vop *vop = to_vop(crtc);
887924
888− if (adjusted_mode->htotal == 0 || adjusted_mode->vtotal == 0)
889− return false;
890−
891925 adjusted_mode->clock =
892926 clk_round_rate(vop->dclk, mode->clock * 1000) / 1000;
893927
@@ -1108,7 +1142,7 @@ static int vop_create_crtc(struct vop *vop) · 214 unmodified lines
11081142 const struct vop_data *vop_data = vop->data;
11091143 struct device *dev = vop->dev;
11101144 struct drm_device *drm_dev = vop->drm_dev;
1111− struct drm_plane *primary = NULL, *cursor = NULL, *plane;
1145+ struct drm_plane *primary = NULL, *cursor = NULL, *plane, *tmp;
11121146 struct drm_crtc *crtc = &vop->crtc;
11131147 struct device_node *port;
11141148 int ret;
@@ -1148,7 +1182,7 @@ static int vop_create_crtc(struct vop *vop) · 33 unmodified lines
11481182 ret = drm_crtc_init_with_planes(drm_dev, crtc, primary, cursor,
11491183 &vop_crtc_funcs, NULL);
11501184 if (ret)
1151− return ret;
1185+ goto err_cleanup_planes;
11521186
11531187 drm_crtc_helper_add(crtc, &vop_crtc_helper_funcs);
11541188
@@ -1181,6 +1215,7 @@ static int vop_create_crtc(struct vop *vop) · 26 unmodified lines
11811215 if (!port) {
11821216 DRM_ERROR("no port node found in %s\n",
11831217 dev->of_node->full_name);
1218+ ret = -ENOENT;
11841219 goto err_cleanup_crtc;
11851220 }
11861221
@@ -1194,7 +1229,8 @@ static int vop_create_crtc(struct vop *vop) · 7 unmodified lines
11941229 err_cleanup_crtc:
11951230 drm_crtc_cleanup(crtc);
11961231 err_cleanup_planes:
1197− list_for_each_entry(plane, &drm_dev->mode_config.plane_list, head)
1232+ list_for_each_entry_safe(plane, tmp, &drm_dev->mode_config.plane_list,
1233+ head)
11981234 drm_plane_cleanup(plane);
11991235 return ret;
12001236 }
@@ -1202,9 +1238,28 @@ err_cleanup_planes: · 1 unmodified line
12021238 static void vop_destroy_crtc(struct vop *vop)
12031239 {
12041240 struct drm_crtc *crtc = &vop->crtc;
1241+ struct drm_device *drm_dev = vop->drm_dev;
1242+ struct drm_plane *plane, *tmp;
12051243
12061244 rockchip_unregister_crtc_funcs(crtc);
12071245 of_node_put(crtc->port);
1246+
1247+ /*
1248+ * We need to cleanup the planes now. Why?
1249+ *
1250+ * The planes are "&vop->win[i].base". That means the memory is
1251+ * all part of the big "struct vop" chunk of memory. That memory
1252+ * was devm allocated and associated with this component. We need to
1253+ * free it ourselves before vop_unbind() finishes.
1254+ */
1255+ list_for_each_entry_safe(plane, tmp, &drm_dev->mode_config.plane_list,
1256+ head)
1257+ vop_plane_destroy(plane);
1258+
1259+ /*
1260+ * Destroy CRTC after vop_plane_destroy() since vop_disable_plane()
1261+ * references the CRTC.
1262+ */
12081263 drm_crtc_cleanup(crtc);
12091264 }
12101265
drivers/gpu/drm/udl/udl_fb.c+1−1
@@ -536,7 +536,7 @@ static int udlfb_create(struct drm_fb_helper *helper, · 535 unmodified lines
536536 out_destroy_fbi:
537537 drm_fb_helper_release_fbi(helper);
538538 out_gfree:
539− drm_gem_object_unreference(&ufbdev->ufb.obj->base);
539+ drm_gem_object_unreference_unlocked(&ufbdev->ufb.obj->base);
540540 out:
541541 return ret;
542542 }
drivers/gpu/drm/udl/udl_gem.c+1−1
@@ -52,7 +52,7 @@ udl_gem_create(struct drm_file *file, · 51 unmodified lines
5252 return ret;
5353 }
5454
55− drm_gem_object_unreference(&obj->base);
55+ drm_gem_object_unreference_unlocked(&obj->base);
5656 *handle_p = handle;
5757 return 0;
5858 }
drivers/hwmon/max1111.c+6−0
@@ -85,6 +85,9 @@ static struct max1111_data *the_max1111; · 84 unmodified lines
8585
8686 int max1111_read_channel(int channel)
8787 {
88+ if (!the_max1111 || !the_max1111->spi)
89+ return -ENODEV;
90+
8891 return max1111_read(&the_max1111->spi->dev, channel);
8992 }
9093 EXPORT_SYMBOL(max1111_read_channel);
@@ -258,6 +261,9 @@ static int max1111_remove(struct spi_device *spi) · 167 unmodified lines
258261 {
259262 struct max1111_data *data = spi_get_drvdata(spi);
260263
264+#ifdef CONFIG_SHARPSL_PM
265+ the_max1111 = NULL;
266+#endif
261267 hwmon_device_unregister(data->hwmon_dev);
262268 sysfs_remove_group(&spi->dev.kobj, &max1110_attr_group);
263269 sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group);
drivers/ide/icside.c+1−1
@@ -451,7 +451,7 @@ err_free: · 450 unmodified lines
451451 return ret;
452452 }
453453
454−static const struct ide_port_info icside_v6_port_info __initconst = {
454+static const struct ide_port_info icside_v6_port_info = {
455455 .init_dma = icside_dma_off_init,
456456 .port_ops = &icside_v6_no_dma_port_ops,
457457 .host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
drivers/ide/palm_bk3710.c+2−0
@@ -325,6 +325,8 @@ static int __init palm_bk3710_probe(struct platform_device *pdev) · 324 unmodified lines
325325
326326 clk_enable(clk);
327327 rate = clk_get_rate(clk);
328+ if (!rate)
329+ return -EINVAL;
328330
329331 /* NOTE: round *down* to meet minimum timings; we count in clocks */
330332 ideclk_period = 1000000000UL / rate;
drivers/infiniband/ulp/isert/ib_isert.c+4−35
@@ -63,7 +63,6 @@ isert_rdma_accept(struct isert_conn *isert_conn); · 62 unmodified lines
6363 struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np);
6464
6565 static void isert_release_work(struct work_struct *work);
66−static void isert_wait4flush(struct isert_conn *isert_conn);
6766 static void isert_recv_done(struct ib_cq *cq, struct ib_wc *wc);
6867 static void isert_send_done(struct ib_cq *cq, struct ib_wc *wc);
6968 static void isert_login_recv_done(struct ib_cq *cq, struct ib_wc *wc);
@@ -141,7 +140,7 @@ isert_create_qp(struct isert_conn *isert_conn, · 71 unmodified lines
141140 attr.qp_context = isert_conn;
142141 attr.send_cq = comp->cq;
143142 attr.recv_cq = comp->cq;
144− attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS;
143+ attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS + 1;
145144 attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS + 1;
146145 attr.cap.max_send_sge = device->ib_device->attrs.max_sge;
147146 isert_conn->max_sge = min(device->ib_device->attrs.max_sge,
@@ -887,7 +886,7 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id, · 739 unmodified lines
887886 break;
888887 case ISER_CONN_UP:
889888 isert_conn_terminate(isert_conn);
890− isert_wait4flush(isert_conn);
889+ ib_drain_qp(isert_conn->qp);
891890 isert_handle_unbound_conn(isert_conn);
892891 break;
893892 case ISER_CONN_BOUND:
@@ -3213,36 +3212,6 @@ isert_wait4cmds(struct iscsi_conn *conn) · 2319 unmodified lines
32133212 }
32143213 }
32153214
3216−static void
3217−isert_beacon_done(struct ib_cq *cq, struct ib_wc *wc)
3218−{
3219− struct isert_conn *isert_conn = wc->qp->qp_context;
3220−
3221− isert_print_wc(wc, "beacon");
3222−
3223− isert_info("conn %p completing wait_comp_err\n", isert_conn);
3224− complete(&isert_conn->wait_comp_err);
3225−}
3226−
3227−static void
3228−isert_wait4flush(struct isert_conn *isert_conn)
3229−{
3230− struct ib_recv_wr *bad_wr;
3231− static struct ib_cqe cqe = { .done = isert_beacon_done };
3232−
3233− isert_info("conn %p\n", isert_conn);
3234−
3235− init_completion(&isert_conn->wait_comp_err);
3236− isert_conn->beacon.wr_cqe = &cqe;
3237− /* post an indication that all flush errors were consumed */
3238− if (ib_post_recv(isert_conn->qp, &isert_conn->beacon, &bad_wr)) {
3239− isert_err("conn %p failed to post beacon", isert_conn);
3240− return;
3241− }
3242−
3243− wait_for_completion(&isert_conn->wait_comp_err);
3244−}
3245−
32463215 /**
32473216 * isert_put_unsol_pending_cmds() - Drop commands waiting for
32483217 * unsolicitate dataout
@@ -3288,7 +3257,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) · 39 unmodified lines
32883257 isert_conn_terminate(isert_conn);
32893258 mutex_unlock(&isert_conn->mutex);
32903259
3291− isert_wait4flush(isert_conn);
3260+ ib_drain_qp(isert_conn->qp);
32923261 isert_put_unsol_pending_cmds(conn);
32933262 isert_wait4cmds(conn);
32943263 isert_wait4logout(isert_conn);
@@ -3300,7 +3269,7 @@ static void isert_free_conn(struct iscsi_conn *conn) · 5 unmodified lines
33003269 {
33013270 struct isert_conn *isert_conn = conn->context;
33023271
3303− isert_wait4flush(isert_conn);
3272+ ib_drain_qp(isert_conn->qp);
33043273 isert_put_conn(isert_conn);
33053274 }
33063275
drivers/infiniband/ulp/isert/ib_isert.h+0−2
@@ -209,14 +209,12 @@ struct isert_conn { · 208 unmodified lines
209209 struct ib_qp *qp;
210210 struct isert_device *device;
211211 struct mutex mutex;
212− struct completion wait_comp_err;
213212 struct kref kref;
214213 struct list_head fr_pool;
215214 int fr_pool_size;
216215 /* lock to protect fastreg pool */
217216 spinlock_t pool_lock;
218217 struct work_struct release_work;
219− struct ib_recv_wr beacon;
220218 bool logout_posted;
221219 bool snd_w_inv;
222220 };
drivers/isdn/hisax/isac.c+10−5
@@ -215,9 +215,11 @@ isac_interrupt(struct IsdnCardState *cs, u_char val) · 214 unmodified lines
215215 if (count == 0)
216216 count = 32;
217217 isac_empty_fifo(cs, count);
218− if ((count = cs->rcvidx) > 0) {
218+ count = cs->rcvidx;
219+ if (count > 0) {
219220 cs->rcvidx = 0;
220− if (!(skb = alloc_skb(count, GFP_ATOMIC)))
221+ skb = alloc_skb(count, GFP_ATOMIC);
222+ if (!skb)
221223 printk(KERN_WARNING "HiSax: D receive out of memory\n");
222224 else {
223225 memcpy(skb_put(skb, count), cs->rcvbuf, count);
@@ -251,7 +253,8 @@ isac_interrupt(struct IsdnCardState *cs, u_char val) · 27 unmodified lines
251253 cs->tx_skb = NULL;
252254 }
253255 }
254− if ((cs->tx_skb = skb_dequeue(&cs->sq))) {
256+ cs->tx_skb = skb_dequeue(&cs->sq);
257+ if (cs->tx_skb) {
255258 cs->tx_cnt = 0;
256259 isac_fill_fifo(cs);
257260 } else
@@ -313,7 +316,8 @@ afterXPR: · 55 unmodified lines
313316 #if ARCOFI_USE
314317 if (v1 & 0x08) {
315318 if (!cs->dc.isac.mon_rx) {
316− if (!(cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC))) {
319+ cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC);
320+ if (!cs->dc.isac.mon_rx) {
317321 if (cs->debug & L1_DEB_WARN)
318322 debugl1(cs, "ISAC MON RX out of memory!");
319323 cs->dc.isac.mocr &= 0xf0;
@@ -343,7 +347,8 @@ afterXPR: · 23 unmodified lines
343347 afterMONR0:
344348 if (v1 & 0x80) {
345349 if (!cs->dc.isac.mon_rx) {
346− if (!(cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC))) {
350+ cs->dc.isac.mon_rx = kmalloc(MAX_MON_FRAME, GFP_ATOMIC);
351+ if (!cs->dc.isac.mon_rx) {
347352 if (cs->debug & L1_DEB_WARN)
348353 debugl1(cs, "ISAC MON RX out of memory!");
349354 cs->dc.isac.mocr &= 0x0f;
drivers/media/v4l2-core/v4l2-mc.c+1−1
@@ -34,7 +34,7 @@ int v4l2_mc_create_media_graph(struct media_device *mdev) · 33 unmodified lines
3434 {
3535 struct media_entity *entity;
3636 struct media_entity *if_vid = NULL, *if_aud = NULL;
37− struct media_entity *tuner = NULL, *decoder = NULL, *dtv_demod = NULL;
37+ struct media_entity *tuner = NULL, *decoder = NULL;
3838 struct media_entity *io_v4l = NULL, *io_vbi = NULL, *io_swradio = NULL;
3939 bool is_webcam = false;
4040 u32 flags;
drivers/net/dsa/mv88e6xxx.c+72−13
@@ -2264,6 +2264,57 @@ static void mv88e6xxx_bridge_work(struct work_struct *work) · 2263 unmodified lines
22642264 mutex_unlock(&ps->smi_mutex);
22652265 }
22662266
2267+static int _mv88e6xxx_phy_page_write(struct dsa_switch *ds, int port, int page,
2268+ int reg, int val)
2269+{
2270+ int ret;
2271+
2272+ ret = _mv88e6xxx_phy_write_indirect(ds, port, 0x16, page);
2273+ if (ret < 0)
2274+ goto restore_page_0;
2275+
2276+ ret = _mv88e6xxx_phy_write_indirect(ds, port, reg, val);
2277+restore_page_0:
2278+ _mv88e6xxx_phy_write_indirect(ds, port, 0x16, 0x0);
2279+
2280+ return ret;
2281+}
2282+
2283+static int _mv88e6xxx_phy_page_read(struct dsa_switch *ds, int port, int page,
2284+ int reg)
2285+{
2286+ int ret;
2287+
2288+ ret = _mv88e6xxx_phy_write_indirect(ds, port, 0x16, page);
2289+ if (ret < 0)
2290+ goto restore_page_0;
2291+
2292+ ret = _mv88e6xxx_phy_read_indirect(ds, port, reg);
2293+restore_page_0:
2294+ _mv88e6xxx_phy_write_indirect(ds, port, 0x16, 0x0);
2295+
2296+ return ret;
2297+}
2298+
2299+static int mv88e6xxx_power_on_serdes(struct dsa_switch *ds)
2300+{
2301+ int ret;
2302+
2303+ ret = _mv88e6xxx_phy_page_read(ds, REG_FIBER_SERDES, PAGE_FIBER_SERDES,
2304+ MII_BMCR);
2305+ if (ret < 0)
2306+ return ret;
2307+
2308+ if (ret & BMCR_PDOWN) {
2309+ ret &= ~BMCR_PDOWN;
2310+ ret = _mv88e6xxx_phy_page_write(ds, REG_FIBER_SERDES,
2311+ PAGE_FIBER_SERDES, MII_BMCR,
2312+ ret);
2313+ }
2314+
2315+ return ret;
2316+}
2317+
22672318 static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port)
22682319 {
22692320 struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
@@ -2367,6 +2418,23 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port) · 97 unmodified lines
23672418 goto abort;
23682419 }
23692420
2421+ /* If this port is connected to a SerDes, make sure the SerDes is not
2422+ * powered down.
2423+ */
2424+ if (mv88e6xxx_6352_family(ds)) {
2425+ ret = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_STATUS);
2426+ if (ret < 0)
2427+ goto abort;
2428+ ret &= PORT_STATUS_CMODE_MASK;
2429+ if ((ret == PORT_STATUS_CMODE_100BASE_X) ||
2430+ (ret == PORT_STATUS_CMODE_1000BASE_X) ||
2431+ (ret == PORT_STATUS_CMODE_SGMII)) {
2432+ ret = mv88e6xxx_power_on_serdes(ds);
2433+ if (ret < 0)
2434+ goto abort;
2435+ }
2436+ }
2437+
23702438 /* Port Control 2: don't force a good FCS, set the maximum frame size to
23712439 * 10240 bytes, disable 802.1q tags checking, don't discard tagged or
23722440 * untagged frames on this port, do a destination address lookup on all
@@ -2714,13 +2782,9 @@ int mv88e6xxx_phy_page_read(struct dsa_switch *ds, int port, int page, int reg) · 341 unmodified lines
27142782 int ret;
27152783
27162784 mutex_lock(&ps->smi_mutex);
2717− ret = _mv88e6xxx_phy_write_indirect(ds, port, 0x16, page);
2718− if (ret < 0)
2719− goto error;
2720− ret = _mv88e6xxx_phy_read_indirect(ds, port, reg);
2721−error:
2722− _mv88e6xxx_phy_write_indirect(ds, port, 0x16, 0x0);
2785+ ret = _mv88e6xxx_phy_page_read(ds, port, page, reg);
27232786 mutex_unlock(&ps->smi_mutex);
2787+
27242788 return ret;
27252789 }
27262790
@@ -2731,14 +2795,9 @@ int mv88e6xxx_phy_page_write(struct dsa_switch *ds, int port, int page, · 4 unmodified lines
27312795 int ret;
27322796
27332797 mutex_lock(&ps->smi_mutex);
2734− ret = _mv88e6xxx_phy_write_indirect(ds, port, 0x16, page);
2735− if (ret < 0)
2736− goto error;
2737−
2738− ret = _mv88e6xxx_phy_write_indirect(ds, port, reg, val);
2739−error:
2740− _mv88e6xxx_phy_write_indirect(ds, port, 0x16, 0x0);
2798+ ret = _mv88e6xxx_phy_page_write(ds, port, page, reg, val);
27412799 mutex_unlock(&ps->smi_mutex);
2800+
27422801 return ret;
27432802 }
27442803
drivers/net/dsa/mv88e6xxx.h+8−0
@@ -28,6 +28,10 @@ · 27 unmodified lines
2828 #define SMI_CMD_OP_45_READ_DATA_INC ((3 << 10) | SMI_CMD_BUSY)
2929 #define SMI_DATA 0x01
3030
31+/* Fiber/SERDES Registers are located at SMI address F, page 1 */
32+#define REG_FIBER_SERDES 0x0f
33+#define PAGE_FIBER_SERDES 0x01
34+
3135 #define REG_PORT(p) (0x10 + (p))
3236 #define PORT_STATUS 0x00
3337 #define PORT_STATUS_PAUSE_EN BIT(15)
@@ -45,6 +49,10 @@ · 11 unmodified lines
4549 #define PORT_STATUS_MGMII BIT(6) /* 6185 */
4650 #define PORT_STATUS_TX_PAUSED BIT(5)
4751 #define PORT_STATUS_FLOW_CTRL BIT(4)
52+#define PORT_STATUS_CMODE_MASK 0x0f
53+#define PORT_STATUS_CMODE_100BASE_X 0x8
54+#define PORT_STATUS_CMODE_1000BASE_X 0x9
55+#define PORT_STATUS_CMODE_SGMII 0xa
4856 #define PORT_PCS_CTRL 0x01
4957 #define PORT_PCS_CTRL_RGMII_DELAY_RXCLK BIT(15)
5058 #define PORT_PCS_CTRL_RGMII_DELAY_TXCLK BIT(14)
drivers/net/ethernet/broadcom/bnxt/bnxt.c+7−3
@@ -2653,7 +2653,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len, · 2652 unmodified lines
26532653 /* Write request msg to hwrm channel */
26542654 __iowrite32_copy(bp->bar0, data, msg_len / 4);
26552655
2656− for (i = msg_len; i < HWRM_MAX_REQ_LEN; i += 4)
2656+ for (i = msg_len; i < BNXT_HWRM_MAX_REQ_LEN; i += 4)
26572657 writel(0, bp->bar0 + i);
26582658
26592659 /* currently supports only one outstanding message */
@@ -3391,11 +3391,11 @@ static int bnxt_hwrm_ring_alloc(struct bnxt *bp) · 731 unmodified lines
33913391 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
33923392 struct bnxt_ring_struct *ring = &cpr->cp_ring_struct;
33933393
3394+ cpr->cp_doorbell = bp->bar1 + i * 0x80;
33943395 rc = hwrm_ring_alloc_send_msg(bp, ring, HWRM_RING_ALLOC_CMPL, i,
33953396 INVALID_STATS_CTX_ID);
33963397 if (rc)
33973398 goto err_out;
3398− cpr->cp_doorbell = bp->bar1 + i * 0x80;
33993399 BNXT_CP_DB(cpr->cp_doorbell, cpr->cp_raw_cons);
34003400 bp->grp_info[i].cp_fw_ring_id = ring->fw_ring_id;
34013401 }
@@ -3830,6 +3830,7 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp) · 428 unmodified lines
38303830 struct hwrm_ver_get_input req = {0};
38313831 struct hwrm_ver_get_output *resp = bp->hwrm_cmd_resp_addr;
38323832
3833+ bp->hwrm_max_req_len = HWRM_MAX_REQ_LEN;
38333834 bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_VER_GET, -1, -1);
38343835 req.hwrm_intf_maj = HWRM_VERSION_MAJOR;
38353836 req.hwrm_intf_min = HWRM_VERSION_MINOR;
@@ -3855,6 +3856,9 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp) · 19 unmodified lines
38553856 if (!bp->hwrm_cmd_timeout)
38563857 bp->hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT;
38573858
3859+ if (resp->hwrm_intf_maj >= 1)
3860+ bp->hwrm_max_req_len = le16_to_cpu(resp->max_req_win_len);
3861+
38583862 hwrm_ver_get_exit:
38593863 mutex_unlock(&bp->hwrm_cmd_lock);
38603864 return rc;
@@ -4555,7 +4559,7 @@ bnxt_hwrm_set_pause_common(struct bnxt *bp, struct hwrm_port_phy_cfg_input *req) · 694 unmodified lines
45554559 if (bp->link_info.req_flow_ctrl & BNXT_LINK_PAUSE_RX)
45564560 req->auto_pause |= PORT_PHY_CFG_REQ_AUTO_PAUSE_RX;
45574561 if (bp->link_info.req_flow_ctrl & BNXT_LINK_PAUSE_TX)
4558− req->auto_pause |= PORT_PHY_CFG_REQ_AUTO_PAUSE_RX;
4562+ req->auto_pause |= PORT_PHY_CFG_REQ_AUTO_PAUSE_TX;
45594563 req->enables |=
45604564 cpu_to_le32(PORT_PHY_CFG_REQ_ENABLES_AUTO_PAUSE);
45614565 } else {
drivers/net/ethernet/broadcom/bnxt/bnxt.h+2−0
@@ -477,6 +477,7 @@ struct rx_tpa_end_cmp_ext { · 476 unmodified lines
477477 #define RING_CMP(idx) ((idx) & bp->cp_ring_mask)
478478 #define NEXT_CMP(idx) RING_CMP(ADV_RAW_CMP(idx, 1))
479479
480+#define BNXT_HWRM_MAX_REQ_LEN (bp->hwrm_max_req_len)
480481 #define DFLT_HWRM_CMD_TIMEOUT 500
481482 #define HWRM_CMD_TIMEOUT (bp->hwrm_cmd_timeout)
482483 #define HWRM_RESET_TIMEOUT ((HWRM_CMD_TIMEOUT) * 4)
@@ -953,6 +954,7 @@ struct bnxt { · 470 unmodified lines
953954 dma_addr_t hw_tx_port_stats_map;
954955 int hw_port_stats_size;
955956
957+ u16 hwrm_max_req_len;
956958 int hwrm_cmd_timeout;
957959 struct mutex hwrm_cmd_lock; /* serialize hwrm messages */
958960 struct hwrm_ver_get_output ver_resp;
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+2−4
@@ -855,10 +855,8 @@ static void bnxt_get_pauseparam(struct net_device *dev, · 854 unmodified lines
855855 if (BNXT_VF(bp))
856856 return;
857857 epause->autoneg = !!(link_info->autoneg & BNXT_AUTONEG_FLOW_CTRL);
858− epause->rx_pause =
859− ((link_info->auto_pause_setting & BNXT_LINK_PAUSE_RX) != 0);
860− epause->tx_pause =
861− ((link_info->auto_pause_setting & BNXT_LINK_PAUSE_TX) != 0);
858+ epause->rx_pause = !!(link_info->req_flow_ctrl & BNXT_LINK_PAUSE_RX);
859+ epause->tx_pause = !!(link_info->req_flow_ctrl & BNXT_LINK_PAUSE_TX);
862860 }
863861
864862 static int bnxt_set_pauseparam(struct net_device *dev,
drivers/net/ethernet/broadcom/genet/bcmgenet.c+11−5
@@ -1171,6 +1171,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev, · 1170 unmodified lines
11711171 struct enet_cb *tx_cb_ptr;
11721172 struct netdev_queue *txq;
11731173 unsigned int pkts_compl = 0;
1174+ unsigned int bytes_compl = 0;
11741175 unsigned int c_index;
11751176 unsigned int txbds_ready;
11761177 unsigned int txbds_processed = 0;
@@ -1193,16 +1194,13 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev, · 16 unmodified lines
11931194 tx_cb_ptr = &priv->tx_cbs[ring->clean_ptr];
11941195 if (tx_cb_ptr->skb) {
11951196 pkts_compl++;
1196− dev->stats.tx_packets++;
1197− dev->stats.tx_bytes += tx_cb_ptr->skb->len;
1197+ bytes_compl += GENET_CB(tx_cb_ptr->skb)->bytes_sent;
11981198 dma_unmap_single(&dev->dev,
11991199 dma_unmap_addr(tx_cb_ptr, dma_addr),
12001200 dma_unmap_len(tx_cb_ptr, dma_len),
12011201 DMA_TO_DEVICE);
12021202 bcmgenet_free_cb(tx_cb_ptr);
12031203 } else if (dma_unmap_addr(tx_cb_ptr, dma_addr)) {
1204− dev->stats.tx_bytes +=
1205− dma_unmap_len(tx_cb_ptr, dma_len);
12061204 dma_unmap_page(&dev->dev,
12071205 dma_unmap_addr(tx_cb_ptr, dma_addr),
12081206 dma_unmap_len(tx_cb_ptr, dma_len),
@@ -1220,6 +1218,9 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev, · 11 unmodified lines
12201218 ring->free_bds += txbds_processed;
12211219 ring->c_index = (ring->c_index + txbds_processed) & DMA_C_INDEX_MASK;
12221220
1221+ dev->stats.tx_packets += pkts_compl;
1222+ dev->stats.tx_bytes += bytes_compl;
1223+
12231224 if (ring->free_bds > (MAX_SKB_FRAGS + 1)) {
12241225 txq = netdev_get_tx_queue(dev, ring->queue);
12251226 if (netif_tx_queue_stopped(txq))
@@ -1296,7 +1297,7 @@ static int bcmgenet_xmit_single(struct net_device *dev, · 70 unmodified lines
12961297
12971298 tx_cb_ptr->skb = skb;
12981299
1299− skb_len = skb_headlen(skb) < ETH_ZLEN ? ETH_ZLEN : skb_headlen(skb);
1300+ skb_len = skb_headlen(skb);
13001301
13011302 mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE);
13021303 ret = dma_mapping_error(kdev, mapping);
@@ -1464,6 +1465,11 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) · 161 unmodified lines
14641465 goto out;
14651466 }
14661467
1468+ /* Retain how many bytes will be sent on the wire, without TSB inserted
1469+ * by transmit checksum offload
1470+ */
1471+ GENET_CB(skb)->bytes_sent = skb->len;
1472+
14671473 /* set the SKB transmit checksum */
14681474 if (priv->desc_64b_en) {
14691475 skb = bcmgenet_put_tx_csum(dev, skb);
drivers/net/ethernet/broadcom/genet/bcmgenet.h+6−0
@@ -531,6 +531,12 @@ struct bcmgenet_hw_params { · 530 unmodified lines
531531 u32 flags;
532532 };
533533
534+struct bcmgenet_skb_cb {
535+ unsigned int bytes_sent; /* bytes on the wire (no TSB) */
536+};
537+
538+#define GENET_CB(skb) ((struct bcmgenet_skb_cb *)((skb)->cb))
539+
534540 struct bcmgenet_tx_ring {
535541 spinlock_t lock; /* ring lock */
536542 struct napi_struct napi; /* NAPI per tx queue */
drivers/net/ethernet/cadence/macb.c+55−14
@@ -917,7 +917,10 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, · 916 unmodified lines
917917 unsigned int frag_len = bp->rx_buffer_size;
918918
919919 if (offset + frag_len > len) {
920− BUG_ON(frag != last_frag);
920+ if (unlikely(frag != last_frag)) {
921+ dev_kfree_skb_any(skb);
922+ return -1;
923+ }
921924 frag_len = len - offset;
922925 }
923926 skb_copy_to_linear_data_offset(skb, offset,
@@ -945,8 +948,23 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, · 21 unmodified lines
945948 return 0;
946949 }
947950
951+static inline void macb_init_rx_ring(struct macb *bp)
952+{
953+ dma_addr_t addr;
954+ int i;
955+
956+ addr = bp->rx_buffers_dma;
957+ for (i = 0; i < RX_RING_SIZE; i++) {
958+ bp->rx_ring[i].addr = addr;
959+ bp->rx_ring[i].ctrl = 0;
960+ addr += bp->rx_buffer_size;
961+ }
962+ bp->rx_ring[RX_RING_SIZE - 1].addr |= MACB_BIT(RX_WRAP);
963+}
964+
948965 static int macb_rx(struct macb *bp, int budget)
949966 {
967+ bool reset_rx_queue = false;
950968 int received = 0;
951969 unsigned int tail;
952970 int first_frag = -1;
@@ -972,10 +990,18 @@ static int macb_rx(struct macb *bp, int budget) · 19 unmodified lines
972990
973991 if (ctrl & MACB_BIT(RX_EOF)) {
974992 int dropped;
975− BUG_ON(first_frag == -1);
993+
994+ if (unlikely(first_frag == -1)) {
995+ reset_rx_queue = true;
996+ continue;
997+ }
976998
977999 dropped = macb_rx_frame(bp, first_frag, tail);
9781000 first_frag = -1;
1001+ if (unlikely(dropped < 0)) {
1002+ reset_rx_queue = true;
1003+ continue;
1004+ }
9791005 if (!dropped) {
9801006 received++;
9811007 budget--;
@@ -983,6 +1009,26 @@ static int macb_rx(struct macb *bp, int budget) · 1 unmodified line
9831009 }
9841010 }
9851011
1012+ if (unlikely(reset_rx_queue)) {
1013+ unsigned long flags;
1014+ u32 ctrl;
1015+
1016+ netdev_err(bp->dev, "RX queue corruption: reset it\n");
1017+
1018+ spin_lock_irqsave(&bp->lock, flags);
1019+
1020+ ctrl = macb_readl(bp, NCR);
1021+ macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
1022+
1023+ macb_init_rx_ring(bp);
1024+ macb_writel(bp, RBQP, bp->rx_ring_dma);
1025+
1026+ macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
1027+
1028+ spin_unlock_irqrestore(&bp->lock, flags);
1029+ return received;
1030+ }
1031+
9861032 if (first_frag != -1)
9871033 bp->rx_tail = first_frag;
9881034 else
@@ -1100,7 +1146,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) · 111 unmodified lines
11001146 macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
11011147
11021148 if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
1103− macb_writel(bp, ISR, MACB_BIT(RXUBR));
1149+ queue_writel(queue, ISR, MACB_BIT(RXUBR));
11041150 }
11051151
11061152 if (status & MACB_BIT(ISR_ROVR)) {
@@ -1523,15 +1569,8 @@ static void gem_init_rings(struct macb *bp) · 416 unmodified lines
15231569 static void macb_init_rings(struct macb *bp)
15241570 {
15251571 int i;
1526− dma_addr_t addr;
15271572
1528− addr = bp->rx_buffers_dma;
1529− for (i = 0; i < RX_RING_SIZE; i++) {
1530− bp->rx_ring[i].addr = addr;
1531− bp->rx_ring[i].ctrl = 0;
1532− addr += bp->rx_buffer_size;
1533− }
1534− bp->rx_ring[RX_RING_SIZE - 1].addr |= MACB_BIT(RX_WRAP);
1573+ macb_init_rx_ring(bp);
15351574
15361575 for (i = 0; i < TX_RING_SIZE; i++) {
15371576 bp->queues[0].tx_ring[i].addr = 0;
@@ -2957,9 +2996,10 @@ static int macb_probe(struct platform_device *pdev) · 1419 unmodified lines
29572996 phy_node = of_get_next_available_child(np, NULL);
29582997 if (phy_node) {
29592998 int gpio = of_get_named_gpio(phy_node, "reset-gpios", 0);
2960− if (gpio_is_valid(gpio))
2999+ if (gpio_is_valid(gpio)) {
29613000 bp->reset_gpio = gpio_to_desc(gpio);
2962− gpiod_direction_output(bp->reset_gpio, 1);
3001+ gpiod_direction_output(bp->reset_gpio, 1);
3002+ }
29633003 }
29643004 of_node_put(phy_node);
29653005
@@ -3029,7 +3069,8 @@ static int macb_remove(struct platform_device *pdev) · 63 unmodified lines
30293069 mdiobus_free(bp->mii_bus);
30303070
30313071 /* Shutdown the PHY if there is a GPIO reset */
3032− gpiod_set_value(bp->reset_gpio, 0);
3072+ if (bp->reset_gpio)
3073+ gpiod_set_value(bp->reset_gpio, 0);
30333074
30343075 unregister_netdev(dev);
30353076 clk_disable_unprepare(bp->tx_clk);
drivers/net/ethernet/freescale/fec_main.c+1−1
@@ -943,8 +943,8 @@ fec_restart(struct net_device *ndev) · 942 unmodified lines
943943 else
944944 val &= ~FEC_RACC_OPTIONS;
945945 writel(val, fep->hwp + FEC_RACC);
946+ writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
946947 }
947− writel(PKT_MAXBUF_SIZE, fep->hwp + FEC_FTRL);
948948 #endif
949949
950950 /*
drivers/net/ethernet/hisilicon/hns/hnae.h+1−1
@@ -469,7 +469,7 @@ struct hnae_ae_ops { · 468 unmodified lines
469469 u32 *tx_usecs, u32 *rx_usecs);
470470 void (*get_rx_max_coalesced_frames)(struct hnae_handle *handle,
471471 u32 *tx_frames, u32 *rx_frames);
472− void (*set_coalesce_usecs)(struct hnae_handle *handle, u32 timeout);
472+ int (*set_coalesce_usecs)(struct hnae_handle *handle, u32 timeout);
473473 int (*set_coalesce_frames)(struct hnae_handle *handle,
474474 u32 coalesce_frames);
475475 void (*set_promisc_mode)(struct hnae_handle *handle, u32 en);
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c+23−41
@@ -159,11 +159,6 @@ struct hnae_handle *hns_ae_get_handle(struct hnae_ae_dev *dev, · 158 unmodified lines
159159 ae_handle->qs[i]->tx_ring.q = ae_handle->qs[i];
160160
161161 ring_pair_cb->used_by_vf = 1;
162− if (port_idx < DSAF_SERVICE_PORT_NUM_PER_DSAF)
163− ring_pair_cb->port_id_in_dsa = port_idx;
164− else
165− ring_pair_cb->port_id_in_dsa = 0;
166−
167162 ring_pair_cb++;
168163 }
169164
@@ -453,59 +448,46 @@ static int hns_ae_set_pauseparam(struct hnae_handle *handle, · 283 unmodified lines
453448 static void hns_ae_get_coalesce_usecs(struct hnae_handle *handle,
454449 u32 *tx_usecs, u32 *rx_usecs)
455450 {
456− int port;
457−
458− port = hns_ae_map_eport_to_dport(handle->eport_id);
451+ struct ring_pair_cb *ring_pair =
452+ container_of(handle->qs[0], struct ring_pair_cb, q);
459453
460− *tx_usecs = hns_rcb_get_coalesce_usecs(
461− hns_ae_get_dsaf_dev(handle->dev),
462− hns_dsaf_get_comm_idx_by_port(port));
463− *rx_usecs = hns_rcb_get_coalesce_usecs(
464− hns_ae_get_dsaf_dev(handle->dev),
465− hns_dsaf_get_comm_idx_by_port(port));
454+ *tx_usecs = hns_rcb_get_coalesce_usecs(ring_pair->rcb_common,
455+ ring_pair->port_id_in_comm);
456+ *rx_usecs = hns_rcb_get_coalesce_usecs(ring_pair->rcb_common,
457+ ring_pair->port_id_in_comm);
466458 }
467459
468460 static void hns_ae_get_rx_max_coalesced_frames(struct hnae_handle *handle,
469461 u32 *tx_frames, u32 *rx_frames)
470462 {
471− int port;
463+ struct ring_pair_cb *ring_pair =
464+ container_of(handle->qs[0], struct ring_pair_cb, q);
472465
473− assert(handle);
474−
475− port = hns_ae_map_eport_to_dport(handle->eport_id);
476−
477− *tx_frames = hns_rcb_get_coalesced_frames(
478− hns_ae_get_dsaf_dev(handle->dev), port);
479− *rx_frames = hns_rcb_get_coalesced_frames(
480− hns_ae_get_dsaf_dev(handle->dev), port);
466+ *tx_frames = hns_rcb_get_coalesced_frames(ring_pair->rcb_common,
467+ ring_pair->port_id_in_comm);
468+ *rx_frames = hns_rcb_get_coalesced_frames(ring_pair->rcb_common,
469+ ring_pair->port_id_in_comm);
481470 }
482471
483−static void hns_ae_set_coalesce_usecs(struct hnae_handle *handle,
484− u32 timeout)
472+static int hns_ae_set_coalesce_usecs(struct hnae_handle *handle,
473+ u32 timeout)
485474 {
486− int port;
475+ struct ring_pair_cb *ring_pair =
476+ container_of(handle->qs[0], struct ring_pair_cb, q);
487477
488− assert(handle);
489−
490− port = hns_ae_map_eport_to_dport(handle->eport_id);
491−
492− hns_rcb_set_coalesce_usecs(hns_ae_get_dsaf_dev(handle->dev),
493− port, timeout);
478+ return hns_rcb_set_coalesce_usecs(
479+ ring_pair->rcb_common, ring_pair->port_id_in_comm, timeout);
494480 }
495481
496482 static int hns_ae_set_coalesce_frames(struct hnae_handle *handle,
497483 u32 coalesce_frames)
498484 {
499− int port;
500− int ret;
485+ struct ring_pair_cb *ring_pair =
486+ container_of(handle->qs[0], struct ring_pair_cb, q);
501487
502− assert(handle);
503−
504− port = hns_ae_map_eport_to_dport(handle->eport_id);
505−
506− ret = hns_rcb_set_coalesced_frames(hns_ae_get_dsaf_dev(handle->dev),
507− port, coalesce_frames);
508− return ret;
488+ return hns_rcb_set_coalesced_frames(
489+ ring_pair->rcb_common,
490+ ring_pair->port_id_in_comm, coalesce_frames);
509491 }
510492
511493 void hns_ae_update_stats(struct hnae_handle *handle,
drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c+2−1
@@ -664,7 +664,8 @@ static void hns_gmac_get_strings(u32 stringset, u8 *data) · 663 unmodified lines
664664 return;
665665
666666 for (i = 0; i < ARRAY_SIZE(g_gmac_stats_string); i++) {
667− snprintf(buff, ETH_GSTRING_LEN, g_gmac_stats_string[i].desc);
667+ snprintf(buff, ETH_GSTRING_LEN, "%s",
668+ g_gmac_stats_string[i].desc);
668669 buff = buff + ETH_GSTRING_LEN;
669670 }
670671 }
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c+6−6
@@ -2219,17 +2219,17 @@ void hns_dsaf_get_regs(struct dsaf_device *ddev, u32 port, void *data) · 2218 unmodified lines
22192219 /* dsaf onode registers */
22202220 for (i = 0; i < DSAF_XOD_NUM; i++) {
22212221 p[311 + i] = dsaf_read_dev(ddev,
2222− DSAF_XOD_ETS_TSA_TC0_TC3_CFG_0_REG + j * 0x90);
2222+ DSAF_XOD_ETS_TSA_TC0_TC3_CFG_0_REG + i * 0x90);
22232223 p[319 + i] = dsaf_read_dev(ddev,
2224− DSAF_XOD_ETS_TSA_TC4_TC7_CFG_0_REG + j * 0x90);
2224+ DSAF_XOD_ETS_TSA_TC4_TC7_CFG_0_REG + i * 0x90);
22252225 p[327 + i] = dsaf_read_dev(ddev,
2226− DSAF_XOD_ETS_BW_TC0_TC3_CFG_0_REG + j * 0x90);
2226+ DSAF_XOD_ETS_BW_TC0_TC3_CFG_0_REG + i * 0x90);
22272227 p[335 + i] = dsaf_read_dev(ddev,
2228− DSAF_XOD_ETS_BW_TC4_TC7_CFG_0_REG + j * 0x90);
2228+ DSAF_XOD_ETS_BW_TC4_TC7_CFG_0_REG + i * 0x90);
22292229 p[343 + i] = dsaf_read_dev(ddev,
2230− DSAF_XOD_ETS_BW_OFFSET_CFG_0_REG + j * 0x90);
2230+ DSAF_XOD_ETS_BW_OFFSET_CFG_0_REG + i * 0x90);
22312231 p[351 + i] = dsaf_read_dev(ddev,
2232− DSAF_XOD_ETS_TOKEN_CFG_0_REG + j * 0x90);
2232+ DSAF_XOD_ETS_TOKEN_CFG_0_REG + i * 0x90);
22332233 }
22342234
22352235 p[359] = dsaf_read_dev(ddev, DSAF_XOD_PFS_CFG_0_0_REG + port * 0x90);
drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c+22−18
@@ -244,31 +244,35 @@ void hns_ppe_com_srst(struct ppe_common_cb *ppe_common, u32 val) · 243 unmodified lines
244244 */
245245 phy_interface_t hns_mac_get_phy_if(struct hns_mac_cb *mac_cb)
246246 {
247− u32 hilink3_mode;
248− u32 hilink4_mode;
247+ u32 mode;
248+ u32 reg;
249+ u32 shift;
250+ bool is_ver1 = AE_IS_VER1(mac_cb->dsaf_dev->dsaf_ver);
249251 void __iomem *sys_ctl_vaddr = mac_cb->sys_ctl_vaddr;
250− int dev_id = mac_cb->mac_id;
252+ int mac_id = mac_cb->mac_id;
251253 phy_interface_t phy_if = PHY_INTERFACE_MODE_NA;
252254
253− hilink3_mode = dsaf_read_reg(sys_ctl_vaddr, HNS_MAC_HILINK3_REG);
254− hilink4_mode = dsaf_read_reg(sys_ctl_vaddr, HNS_MAC_HILINK4_REG);
255− if (dev_id >= 0 && dev_id <= 3) {
256− if (hilink4_mode == 0)
257− phy_if = PHY_INTERFACE_MODE_SGMII;
258− else
255+ if (is_ver1 && (mac_id >= 6 && mac_id <= 7)) {
256+ phy_if = PHY_INTERFACE_MODE_SGMII;
257+ } else if (mac_id >= 0 && mac_id <= 3) {
258+ reg = is_ver1 ? HNS_MAC_HILINK4_REG : HNS_MAC_HILINK4V2_REG;
259+ mode = dsaf_read_reg(sys_ctl_vaddr, reg);
260+ /* mac_id 0, 1, 2, 3 ---> hilink4 lane 0, 1, 2, 3 */
261+ shift = is_ver1 ? 0 : mac_id;
262+ if (dsaf_get_bit(mode, shift))
259263 phy_if = PHY_INTERFACE_MODE_XGMII;
260− } else if (dev_id >= 4 && dev_id <= 5) {
261− if (hilink3_mode == 0)
262− phy_if = PHY_INTERFACE_MODE_SGMII;
263264 else
265+ phy_if = PHY_INTERFACE_MODE_SGMII;
266+ } else if (mac_id >= 4 && mac_id <= 7) {
267+ reg = is_ver1 ? HNS_MAC_HILINK3_REG : HNS_MAC_HILINK3V2_REG;
268+ mode = dsaf_read_reg(sys_ctl_vaddr, reg);
269+ /* mac_id 4, 5, 6, 7 ---> hilink3 lane 2, 3, 0, 1 */
270+ shift = is_ver1 ? 0 : mac_id <= 5 ? mac_id - 2 : mac_id - 6;
271+ if (dsaf_get_bit(mode, shift))
264272 phy_if = PHY_INTERFACE_MODE_XGMII;
265− } else {
266− phy_if = PHY_INTERFACE_MODE_SGMII;
273+ else
274+ phy_if = PHY_INTERFACE_MODE_SGMII;
267275 }
268−
269− dev_dbg(mac_cb->dev,
270− "hilink3_mode=%d, hilink4_mode=%d dev_id=%d, phy_if=%d\n",
271− hilink3_mode, hilink4_mode, dev_id, phy_if);
272276 return phy_if;
273277 }
274278
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c+92−104
@@ -215,9 +215,9 @@ static void hns_rcb_ring_init(struct ring_pair_cb *ring_pair, int ring_type) · 214 unmodified lines
215215 dsaf_write_dev(q, RCB_RING_RX_RING_BD_LEN_REG,
216216 bd_size_type);
217217 dsaf_write_dev(q, RCB_RING_RX_RING_BD_NUM_REG,
218− ring_pair->port_id_in_dsa);
218+ ring_pair->port_id_in_comm);
219219 dsaf_write_dev(q, RCB_RING_RX_RING_PKTLINE_REG,
220− ring_pair->port_id_in_dsa);
220+ ring_pair->port_id_in_comm);
221221 } else {
222222 dsaf_write_dev(q, RCB_RING_TX_RING_BASEADDR_L_REG,
223223 (u32)dma);
@@ -227,9 +227,9 @@ static void hns_rcb_ring_init(struct ring_pair_cb *ring_pair, int ring_type) · 3 unmodified lines
227227 dsaf_write_dev(q, RCB_RING_TX_RING_BD_LEN_REG,
228228 bd_size_type);
229229 dsaf_write_dev(q, RCB_RING_TX_RING_BD_NUM_REG,
230− ring_pair->port_id_in_dsa);
230+ ring_pair->port_id_in_comm);
231231 dsaf_write_dev(q, RCB_RING_TX_RING_PKTLINE_REG,
232− ring_pair->port_id_in_dsa);
232+ ring_pair->port_id_in_comm);
233233 }
234234 }
235235
@@ -256,50 +256,16 @@ static void hns_rcb_set_port_desc_cnt(struct rcb_common_cb *rcb_common, · 20 unmodified lines
256256 desc_cnt);
257257 }
258258
259−/**
260− *hns_rcb_set_port_coalesced_frames - set rcb port coalesced frames
261− *@rcb_common: rcb_common device
262− *@port_idx:port index
263− *@coalesced_frames:BD num for coalesced frames
264− */
265−static int hns_rcb_set_port_coalesced_frames(struct rcb_common_cb *rcb_common,
266− u32 port_idx,
267− u32 coalesced_frames)
268−{
269− if (coalesced_frames >= rcb_common->desc_num ||
270− coalesced_frames > HNS_RCB_MAX_COALESCED_FRAMES)
271− return -EINVAL;
272−
273− dsaf_write_dev(rcb_common, RCB_CFG_PKTLINE_REG + port_idx * 4,
274− coalesced_frames);
275− return 0;
276−}
277−
278−/**
279− *hns_rcb_get_port_coalesced_frames - set rcb port coalesced frames
280− *@rcb_common: rcb_common device
281− *@port_idx:port index
282− * return coaleseced frames value
283− */
284−static u32 hns_rcb_get_port_coalesced_frames(struct rcb_common_cb *rcb_common,
285− u32 port_idx)
259+static void hns_rcb_set_port_timeout(
260+ struct rcb_common_cb *rcb_common, u32 port_idx, u32 timeout)
286261 {
287− if (port_idx >= HNS_RCB_SERVICE_NW_ENGINE_NUM)
288− port_idx = 0;
289−
290− return dsaf_read_dev(rcb_common,
291− RCB_CFG_PKTLINE_REG + port_idx * 4);
292−}
293−
294−/**
295− *hns_rcb_set_timeout - set rcb port coalesced time_out
296− *@rcb_common: rcb_common device
297− *@time_out:time for coalesced time_out
298− */
299−static void hns_rcb_set_timeout(struct rcb_common_cb *rcb_common,
300− u32 timeout)
301−{
302− dsaf_write_dev(rcb_common, RCB_CFG_OVERTIME_REG, timeout);
262+ if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver))
263+ dsaf_write_dev(rcb_common, RCB_CFG_OVERTIME_REG,
264+ timeout * HNS_RCB_CLK_FREQ_MHZ);
265+ else
266+ dsaf_write_dev(rcb_common,
267+ RCB_PORT_CFG_OVERTIME_REG + port_idx * 4,
268+ timeout);
303269 }
304270
305271 static int hns_rcb_common_get_port_num(struct rcb_common_cb *rcb_common)
@@ -361,10 +327,11 @@ int hns_rcb_common_init_hw(struct rcb_common_cb *rcb_common) · 55 unmodified lines
361327
362328 for (i = 0; i < port_num; i++) {
363329 hns_rcb_set_port_desc_cnt(rcb_common, i, rcb_common->desc_num);
364− (void)hns_rcb_set_port_coalesced_frames(
365− rcb_common, i, rcb_common->coalesced_frames);
330+ (void)hns_rcb_set_coalesced_frames(
331+ rcb_common, i, HNS_RCB_DEF_COALESCED_FRAMES);
332+ hns_rcb_set_port_timeout(
333+ rcb_common, i, HNS_RCB_DEF_COALESCED_USECS);
366334 }
367− hns_rcb_set_timeout(rcb_common, rcb_common->timeout);
368335
369336 dsaf_write_dev(rcb_common, RCB_COM_CFG_ENDIAN_REG,
370337 HNS_RCB_COMMON_ENDIAN);
@@ -460,7 +427,8 @@ static void hns_rcb_ring_pair_get_cfg(struct ring_pair_cb *ring_pair_cb) · 89 unmodified lines
460427 hns_rcb_ring_get_cfg(&ring_pair_cb->q, TX_RING);
461428 }
462429
463−static int hns_rcb_get_port(struct rcb_common_cb *rcb_common, int ring_idx)
430+static int hns_rcb_get_port_in_comm(
431+ struct rcb_common_cb *rcb_common, int ring_idx)
464432 {
465433 int comm_index = rcb_common->comm_index;
466434 int port;
@@ -470,7 +438,7 @@ static int hns_rcb_get_port(struct rcb_common_cb *rcb_common, int ring_idx) · 3 unmodified lines
470438 q_num = (int)rcb_common->max_q_per_vf * rcb_common->max_vfn;
471439 port = ring_idx / q_num;
472440 } else {
473− port = HNS_RCB_SERVICE_NW_ENGINE_NUM + comm_index - 1;
441+ port = 0; /* config debug-ports port_id_in_comm to 0*/
474442 }
475443
476444 return port;
@@ -518,7 +486,8 @@ void hns_rcb_get_cfg(struct rcb_common_cb *rcb_common) · 41 unmodified lines
518486 ring_pair_cb->index = i;
519487 ring_pair_cb->q.io_base =
520488 RCB_COMM_BASE_TO_RING_BASE(rcb_common->io_base, i);
521− ring_pair_cb->port_id_in_dsa = hns_rcb_get_port(rcb_common, i);
489+ ring_pair_cb->port_id_in_comm =
490+ hns_rcb_get_port_in_comm(rcb_common, i);
522491 ring_pair_cb->virq[HNS_RCB_IRQ_IDX_TX] =
523492 is_ver1 ? irq_of_parse_and_map(np, base_irq_idx + i * 2) :
524493 platform_get_irq(pdev, base_irq_idx + i * 3 + 1);
@@ -534,82 +503,95 @@ void hns_rcb_get_cfg(struct rcb_common_cb *rcb_common) · 9 unmodified lines
534503 /**
535504 *hns_rcb_get_coalesced_frames - get rcb port coalesced frames
536505 *@rcb_common: rcb_common device
537− *@comm_index:port index
538− *return coalesced_frames
506+ *@port_idx:port id in comm
507+ *
508+ *Returns: coalesced_frames
539509 */
540−u32 hns_rcb_get_coalesced_frames(struct dsaf_device *dsaf_dev, int port)
510+u32 hns_rcb_get_coalesced_frames(
511+ struct rcb_common_cb *rcb_common, u32 port_idx)
541512 {
542− int comm_index = hns_dsaf_get_comm_idx_by_port(port);
543− struct rcb_common_cb *rcb_comm = dsaf_dev->rcb_common[comm_index];
544−
545− return hns_rcb_get_port_coalesced_frames(rcb_comm, port);
513+ return dsaf_read_dev(rcb_common, RCB_CFG_PKTLINE_REG + port_idx * 4);
546514 }
547515
548516 /**
549517 *hns_rcb_get_coalesce_usecs - get rcb port coalesced time_out
550518 *@rcb_common: rcb_common device
551− *@comm_index:port index
552− *return time_out
519+ *@port_idx:port id in comm
520+ *
521+ *Returns: time_out
553522 */
554−u32 hns_rcb_get_coalesce_usecs(struct dsaf_device *dsaf_dev, int comm_index)
523+u32 hns_rcb_get_coalesce_usecs(
524+ struct rcb_common_cb *rcb_common, u32 port_idx)
555525 {
556− struct rcb_common_cb *rcb_comm = dsaf_dev->rcb_common[comm_index];
557−
558− return rcb_comm->timeout;
526+ if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver))
527+ return dsaf_read_dev(rcb_common, RCB_CFG_OVERTIME_REG) /
528+ HNS_RCB_CLK_FREQ_MHZ;
529+ else
530+ return dsaf_read_dev(rcb_common,
531+ RCB_PORT_CFG_OVERTIME_REG + port_idx * 4);
559532 }
560533
561534 /**
562535 *hns_rcb_set_coalesce_usecs - set rcb port coalesced time_out
563536 *@rcb_common: rcb_common device
564− *@comm_index: comm :index
565− *@etx_usecs:tx time for coalesced time_out
566− *@rx_usecs:rx time for coalesced time_out
537+ *@port_idx:port id in comm
538+ *@timeout:tx/rx time for coalesced time_out
539+ *
540+ * Returns:
541+ * Zero for success, or an error code in case of failure
567542 */
568−void hns_rcb_set_coalesce_usecs(struct dsaf_device *dsaf_dev,
569− int port, u32 timeout)
543+int hns_rcb_set_coalesce_usecs(
544+ struct rcb_common_cb *rcb_common, u32 port_idx, u32 timeout)
570545 {
571− int comm_index = hns_dsaf_get_comm_idx_by_port(port);
572− struct rcb_common_cb *rcb_comm = dsaf_dev->rcb_common[comm_index];
546+ u32 old_timeout = hns_rcb_get_coalesce_usecs(rcb_common, port_idx);
573547
574− if (rcb_comm->timeout == timeout)
575− return;
548+ if (timeout == old_timeout)
549+ return 0;
576550
577− if (comm_index == HNS_DSAF_COMM_SERVICE_NW_IDX) {
578− dev_err(dsaf_dev->dev,
579− "error: not support coalesce_usecs setting!\n");
580− return;
551+ if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) {
552+ if (rcb_common->comm_index == HNS_DSAF_COMM_SERVICE_NW_IDX) {
553+ dev_err(rcb_common->dsaf_dev->dev,
554+ "error: not support coalesce_usecs setting!\n");
555+ return -EINVAL;
556+ }
581557 }
582− rcb_comm->timeout = timeout;
583− hns_rcb_set_timeout(rcb_comm, rcb_comm->timeout);
558+ if (timeout > HNS_RCB_MAX_COALESCED_USECS) {
559+ dev_err(rcb_common->dsaf_dev->dev,
560+ "error: not support coalesce %dus!\n", timeout);
561+ return -EINVAL;
562+ }
563+ hns_rcb_set_port_timeout(rcb_common, port_idx, timeout);
564+ return 0;
584565 }
585566
586567 /**
587568 *hns_rcb_set_coalesced_frames - set rcb coalesced frames
588569 *@rcb_common: rcb_common device
589− *@tx_frames:tx BD num for coalesced frames
590− *@rx_frames:rx BD num for coalesced frames
591− *Return 0 on success, negative on failure
570+ *@port_idx:port id in comm
571+ *@coalesced_frames:tx/rx BD num for coalesced frames
572+ *
573+ * Returns:
574+ * Zero for success, or an error code in case of failure
592575 */
593−int hns_rcb_set_coalesced_frames(struct dsaf_device *dsaf_dev,
594− int port, u32 coalesced_frames)
576+int hns_rcb_set_coalesced_frames(
577+ struct rcb_common_cb *rcb_common, u32 port_idx, u32 coalesced_frames)
595578 {
596− int comm_index = hns_dsaf_get_comm_idx_by_port(port);
597− struct rcb_common_cb *rcb_comm = dsaf_dev->rcb_common[comm_index];
598− u32 coalesced_reg_val;
599− int ret;
579+ u32 old_waterline = hns_rcb_get_coalesced_frames(rcb_common, port_idx);
600580
601− coalesced_reg_val = hns_rcb_get_port_coalesced_frames(rcb_comm, port);
602−
603− if (coalesced_reg_val == coalesced_frames)
581+ if (coalesced_frames == old_waterline)
604582 return 0;
605583
606− if (coalesced_frames >= HNS_RCB_MIN_COALESCED_FRAMES) {
607− ret = hns_rcb_set_port_coalesced_frames(rcb_comm, port,
608− coalesced_frames);
609− return ret;
610− } else {
584+ if (coalesced_frames >= rcb_common->desc_num ||
585+ coalesced_frames > HNS_RCB_MAX_COALESCED_FRAMES ||
586+ coalesced_frames < HNS_RCB_MIN_COALESCED_FRAMES) {
587+ dev_err(rcb_common->dsaf_dev->dev,
588+ "error: not support coalesce_frames setting!\n");
611589 return -EINVAL;
612590 }
591+
592+ dsaf_write_dev(rcb_common, RCB_CFG_PKTLINE_REG + port_idx * 4,
593+ coalesced_frames);
594+ return 0;
613595 }
614596
615597 /**
@@ -749,8 +731,6 @@ int hns_rcb_common_get_cfg(struct dsaf_device *dsaf_dev, · 133 unmodified lines
749731 rcb_common->dsaf_dev = dsaf_dev;
750732
751733 rcb_common->desc_num = dsaf_dev->desc_num;
752− rcb_common->coalesced_frames = HNS_RCB_DEF_COALESCED_FRAMES;
753− rcb_common->timeout = HNS_RCB_MAX_TIME_OUT;
754734
755735 hns_rcb_get_queue_mode(dsaf_mode, comm_index, &max_vfn, &max_q_per_vf);
756736 rcb_common->max_vfn = max_vfn;
@@ -951,6 +931,10 @@ void hns_rcb_get_strings(int stringset, u8 *data, int index) · 194 unmodified lines
951931 void hns_rcb_get_common_regs(struct rcb_common_cb *rcb_com, void *data)
952932 {
953933 u32 *regs = data;
934+ bool is_ver1 = AE_IS_VER1(rcb_com->dsaf_dev->dsaf_ver);
935+ bool is_dbg = (rcb_com->comm_index != HNS_DSAF_COMM_SERVICE_NW_IDX);
936+ u32 reg_tmp;
937+ u32 reg_num_tmp;
954938 u32 i = 0;
955939
956940 /*rcb common registers */
@@ -1004,12 +988,16 @@ void hns_rcb_get_common_regs(struct rcb_common_cb *rcb_com, void *data) · 47 unmodified lines
1004988 = dsaf_read_dev(rcb_com, RCB_CFG_PKTLINE_REG + 4 * i);
1005989 }
1006990
1007− regs[70] = dsaf_read_dev(rcb_com, RCB_CFG_OVERTIME_REG);
1008− regs[71] = dsaf_read_dev(rcb_com, RCB_CFG_PKTLINE_INT_NUM_REG);
1009− regs[72] = dsaf_read_dev(rcb_com, RCB_CFG_OVERTIME_INT_NUM_REG);
991+ reg_tmp = is_ver1 ? RCB_CFG_OVERTIME_REG : RCB_PORT_CFG_OVERTIME_REG;
992+ reg_num_tmp = (is_ver1 || is_dbg) ? 1 : 6;
993+ for (i = 0; i < reg_num_tmp; i++)
994+ regs[70 + i] = dsaf_read_dev(rcb_com, reg_tmp);
995+
996+ regs[76] = dsaf_read_dev(rcb_com, RCB_CFG_PKTLINE_INT_NUM_REG);
997+ regs[77] = dsaf_read_dev(rcb_com, RCB_CFG_OVERTIME_INT_NUM_REG);
1010998
1011999 /* mark end of rcb common regs */
1012− for (i = 73; i < 80; i++)
1000+ for (i = 78; i < 80; i++)
10131001 regs[i] = 0xcccccccc;
10141002 }
10151003
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h+12−11
@@ -38,7 +38,9 @@ struct rcb_common_cb; · 37 unmodified lines
3838 #define HNS_RCB_MAX_COALESCED_FRAMES 1023
3939 #define HNS_RCB_MIN_COALESCED_FRAMES 1
4040 #define HNS_RCB_DEF_COALESCED_FRAMES 50
41−#define HNS_RCB_MAX_TIME_OUT 0x500
41+#define HNS_RCB_CLK_FREQ_MHZ 350
42+#define HNS_RCB_MAX_COALESCED_USECS 0x3ff
43+#define HNS_RCB_DEF_COALESCED_USECS 3
4244
4345 #define HNS_RCB_COMMON_ENDIAN 1
4446
@@ -82,7 +84,7 @@ struct ring_pair_cb { · 37 unmodified lines
8284
8385 int virq[HNS_RCB_IRQ_NUM_PER_QUEUE];
8486
85− u8 port_id_in_dsa;
87+ u8 port_id_in_comm;
8688 u8 used_by_vf;
8789
8890 struct hns_ring_hw_stats hw_stats;
@@ -97,8 +99,6 @@ struct rcb_common_cb { · 8 unmodified lines
9799
98100 u8 comm_index;
99101 u32 ring_num;
100− u32 coalesced_frames; /* frames threshold of rx interrupt */
101− u32 timeout; /* time threshold of rx interrupt */
102102 u32 desc_num; /* desc num per queue*/
103103
104104 struct ring_pair_cb ring_pair_cb[0];
@@ -125,13 +125,14 @@ void hns_rcbv2_int_clr_hw(struct hnae_queue *q, u32 flag); · 20 unmodified lines
125125 void hns_rcb_init_hw(struct ring_pair_cb *ring);
126126 void hns_rcb_reset_ring_hw(struct hnae_queue *q);
127127 void hns_rcb_wait_fbd_clean(struct hnae_queue **qs, int q_num, u32 flag);
128−
129−u32 hns_rcb_get_coalesced_frames(struct dsaf_device *dsaf_dev, int comm_index);
130−u32 hns_rcb_get_coalesce_usecs(struct dsaf_device *dsaf_dev, int comm_index);
131−void hns_rcb_set_coalesce_usecs(struct dsaf_device *dsaf_dev,
132− int comm_index, u32 timeout);
133−int hns_rcb_set_coalesced_frames(struct dsaf_device *dsaf_dev,
134− int comm_index, u32 coalesce_frames);
128+u32 hns_rcb_get_coalesced_frames(
129+ struct rcb_common_cb *rcb_common, u32 port_idx);
130+u32 hns_rcb_get_coalesce_usecs(
131+ struct rcb_common_cb *rcb_common, u32 port_idx);
132+int hns_rcb_set_coalesce_usecs(
133+ struct rcb_common_cb *rcb_common, u32 port_idx, u32 timeout);
134+int hns_rcb_set_coalesced_frames(
135+ struct rcb_common_cb *rcb_common, u32 port_idx, u32 coalesced_frames);
135136 void hns_rcb_update_stats(struct hnae_queue *queue);
136137
137138 void hns_rcb_get_stats(struct hnae_queue *queue, u64 *data);
drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h+3−0
@@ -103,6 +103,8 @@ · 102 unmodified lines
103103 /*serdes offset**/
104104 #define HNS_MAC_HILINK3_REG DSAF_SUB_SC_HILINK3_CRG_CTRL0_REG
105105 #define HNS_MAC_HILINK4_REG DSAF_SUB_SC_HILINK4_CRG_CTRL0_REG
106+#define HNS_MAC_HILINK3V2_REG DSAF_SUB_SC_HILINK3_CRG_CTRL1_REG
107+#define HNS_MAC_HILINK4V2_REG DSAF_SUB_SC_HILINK4_CRG_CTRL1_REG
106108 #define HNS_MAC_LANE0_CTLEDFE_REG 0x000BFFCCULL
107109 #define HNS_MAC_LANE1_CTLEDFE_REG 0x000BFFBCULL
108110 #define HNS_MAC_LANE2_CTLEDFE_REG 0x000BFFACULL
@@ -404,6 +406,7 @@ · 295 unmodified lines
404406 #define RCB_CFG_OVERTIME_REG 0x9300
405407 #define RCB_CFG_PKTLINE_INT_NUM_REG 0x9304
406408 #define RCB_CFG_OVERTIME_INT_NUM_REG 0x9308
409+#define RCB_PORT_CFG_OVERTIME_REG 0x9430
407410
408411 #define RCB_RING_RX_RING_BASEADDR_L_REG 0x00000
409412 #define RCB_RING_RX_RING_BASEADDR_H_REG 0x00004
drivers/net/ethernet/hisilicon/hns/hns_enet.c+7−9
@@ -913,10 +913,7 @@ static int hns_nic_tx_poll_one(struct hns_nic_ring_data *ring_data, · 912 unmodified lines
913913 static void hns_nic_tx_fini_pro(struct hns_nic_ring_data *ring_data)
914914 {
915915 struct hnae_ring *ring = ring_data->ring;
916− int head = ring->next_to_clean;
917−
918− /* for hardware bug fixed */
919− head = readl_relaxed(ring->io_base + RCB_REG_HEAD);
916+ int head = readl_relaxed(ring->io_base + RCB_REG_HEAD);
920917
921918 if (head != ring->next_to_clean) {
922919 ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
@@ -959,8 +956,8 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget) · 36 unmodified lines
959956 napi_complete(napi);
960957 ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
961958 ring_data->ring, 0);
962−
963− ring_data->fini_process(ring_data);
959+ if (ring_data->fini_process)
960+ ring_data->fini_process(ring_data);
964961 return 0;
965962 }
966963
@@ -1723,6 +1720,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv) · 756 unmodified lines
17231720 {
17241721 struct hnae_handle *h = priv->ae_handle;
17251722 struct hns_nic_ring_data *rd;
1723+ bool is_ver1 = AE_IS_VER1(priv->enet_ver);
17261724 int i;
17271725
17281726 if (h->q_num > NIC_MAX_Q_PER_VF) {
@@ -1740,7 +1738,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv) · 11 unmodified lines
17401738 rd->queue_index = i;
17411739 rd->ring = &h->qs[i]->tx_ring;
17421740 rd->poll_one = hns_nic_tx_poll_one;
1743− rd->fini_process = hns_nic_tx_fini_pro;
1741+ rd->fini_process = is_ver1 ? hns_nic_tx_fini_pro : NULL;
17441742
17451743 netif_napi_add(priv->netdev, &rd->napi,
17461744 hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM);
@@ -1752,7 +1750,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv) · 5 unmodified lines
17521750 rd->ring = &h->qs[i - h->q_num]->rx_ring;
17531751 rd->poll_one = hns_nic_rx_poll_one;
17541752 rd->ex_process = hns_nic_rx_up_pro;
1755− rd->fini_process = hns_nic_rx_fini_pro;
1753+ rd->fini_process = is_ver1 ? hns_nic_rx_fini_pro : NULL;
17561754
17571755 netif_napi_add(priv->netdev, &rd->napi,
17581756 hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM);
@@ -1816,7 +1814,7 @@ static int hns_nic_try_get_ae(struct net_device *ndev) · 57 unmodified lines
18161814 h = hnae_get_handle(&priv->netdev->dev,
18171815 priv->ae_node, priv->port_id, NULL);
18181816 if (IS_ERR_OR_NULL(h)) {
1819− ret = PTR_ERR(h);
1817+ ret = -ENODEV;
18201818 dev_dbg(priv->dev, "has not handle, register notifier!\n");
18211819 goto out;
18221820 }
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c+6−4
@@ -794,8 +794,10 @@ static int hns_set_coalesce(struct net_device *net_dev, · 793 unmodified lines
794794 (!ops->set_coalesce_frames))
795795 return -ESRCH;
796796
797− ops->set_coalesce_usecs(priv->ae_handle,
798− ec->rx_coalesce_usecs);
797+ ret = ops->set_coalesce_usecs(priv->ae_handle,
798+ ec->rx_coalesce_usecs);
799+ if (ret)
800+ return ret;
799801
800802 ret = ops->set_coalesce_frames(
801803 priv->ae_handle,
@@ -1013,8 +1015,8 @@ int hns_phy_led_set(struct net_device *netdev, int value) · 211 unmodified lines
10131015 struct phy_device *phy_dev = priv->phy;
10141016
10151017 retval = phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_LED);
1016− retval = phy_write(phy_dev, HNS_LED_FC_REG, value);
1017− retval = phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_COPPER);
1018+ retval |= phy_write(phy_dev, HNS_LED_FC_REG, value);
1019+ retval |= phy_write(phy_dev, HNS_PHY_PAGE_REG, HNS_PHY_PAGE_COPPER);
10181020 if (retval) {
10191021 netdev_err(netdev, "mdiobus_write fail !\n");
10201022 return retval;
drivers/net/ethernet/intel/ixgbe/ixgbe.h+5−5
@@ -661,9 +661,7 @@ struct ixgbe_adapter { · 660 unmodified lines
661661 #define IXGBE_FLAG2_RSS_FIELD_IPV6_UDP (u32)(1 << 9)
662662 #define IXGBE_FLAG2_PTP_PPS_ENABLED (u32)(1 << 10)
663663 #define IXGBE_FLAG2_PHY_INTERRUPT (u32)(1 << 11)
664−#ifdef CONFIG_IXGBE_VXLAN
665664 #define IXGBE_FLAG2_VXLAN_REREG_NEEDED BIT(12)
666−#endif
667665 #define IXGBE_FLAG2_VLAN_PROMISC BIT(13)
668666
669667 /* Tx fast path data */
@@ -675,6 +673,9 @@ struct ixgbe_adapter { · 5 unmodified lines
675673 int num_rx_queues;
676674 u16 rx_itr_setting;
677675
676+ /* Port number used to identify VXLAN traffic */
677+ __be16 vxlan_port;
678+
678679 /* TX */
679680 struct ixgbe_ring *tx_ring[MAX_TX_QUEUES] ____cacheline_aligned_in_smp;
680681
@@ -782,9 +783,6 @@ struct ixgbe_adapter { · 101 unmodified lines
782783 u32 timer_event_accumulator;
783784 u32 vferr_refcount;
784785 struct ixgbe_mac_addr *mac_table;
785−#ifdef CONFIG_IXGBE_VXLAN
786− u16 vxlan_port;
787−#endif
788786 struct kobject *info_kobj;
789787 #ifdef CONFIG_IXGBE_HWMON
790788 struct hwmon_buff *ixgbe_hwmon_buff;
@@ -879,6 +877,8 @@ extern const char ixgbe_driver_version[]; · 88 unmodified lines
879877 extern char ixgbe_default_device_descr[];
880878 #endif /* IXGBE_FCOE */
881879
880+int ixgbe_open(struct net_device *netdev);
881+int ixgbe_close(struct net_device *netdev);
882882 void ixgbe_up(struct ixgbe_adapter *adapter);
883883 void ixgbe_down(struct ixgbe_adapter *adapter);
884884 void ixgbe_reinit_locked(struct ixgbe_adapter *adapter);
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c+2−2
@@ -2053,7 +2053,7 @@ static void ixgbe_diag_test(struct net_device *netdev, · 2052 unmodified lines
20532053
20542054 if (if_running)
20552055 /* indicate we're in test mode */
2056− dev_close(netdev);
2056+ ixgbe_close(netdev);
20572057 else
20582058 ixgbe_reset(adapter);
20592059
@@ -2091,7 +2091,7 @@ skip_loopback: · 31 unmodified lines
20912091 /* clear testing bit and return adapter to previous state */
20922092 clear_bit(__IXGBE_TESTING, &adapter->state);
20932093 if (if_running)
2094− dev_open(netdev);
2094+ ixgbe_open(netdev);
20952095 else if (hw->mac.ops.disable_tx_laser)
20962096 hw->mac.ops.disable_tx_laser(hw);
20972097 } else {
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+76−89
@@ -4531,9 +4531,7 @@ static void ixgbe_clear_vxlan_port(struct ixgbe_adapter *adapter) · 4530 unmodified lines
45314531 case ixgbe_mac_X550:
45324532 case ixgbe_mac_X550EM_x:
45334533 IXGBE_WRITE_REG(&adapter->hw, IXGBE_VXLANCTRL, 0);
4534−#ifdef CONFIG_IXGBE_VXLAN
45354534 adapter->vxlan_port = 0;
4536−#endif
45374535 break;
45384536 default:
45394537 break;
@@ -5994,7 +5992,7 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu) · 1454 unmodified lines
59945992 * handler is registered with the OS, the watchdog timer is started,
59955993 * and the stack is notified that the interface is ready.
59965994 **/
5997−static int ixgbe_open(struct net_device *netdev)
5995+int ixgbe_open(struct net_device *netdev)
59985996 {
59995997 struct ixgbe_adapter *adapter = netdev_priv(netdev);
60005998 struct ixgbe_hw *hw = &adapter->hw;
@@ -6096,7 +6094,7 @@ static void ixgbe_close_suspend(struct ixgbe_adapter *adapter) · 95 unmodified lines
60966094 * needs to be disabled. A global MAC reset is issued to stop the
60976095 * hardware, and all transmit and receive resources are freed.
60986096 **/
6099−static int ixgbe_close(struct net_device *netdev)
6097+int ixgbe_close(struct net_device *netdev)
61006098 {
61016099 struct ixgbe_adapter *adapter = netdev_priv(netdev);
61026100
@@ -7560,11 +7558,10 @@ static void ixgbe_atr(struct ixgbe_ring *ring, · 1457 unmodified lines
75607558 struct ipv6hdr *ipv6;
75617559 } hdr;
75627560 struct tcphdr *th;
7561+ unsigned int hlen;
75637562 struct sk_buff *skb;
7564−#ifdef CONFIG_IXGBE_VXLAN
7565− u8 encap = false;
7566−#endif /* CONFIG_IXGBE_VXLAN */
75677563 __be16 vlan_id;
7564+ int l4_proto;
75687565
75697566 /* if ring doesn't have a interrupt vector, cannot perform ATR */
75707567 if (!q_vector)
@@ -7576,62 +7573,50 @@ static void ixgbe_atr(struct ixgbe_ring *ring, · 5 unmodified lines
75767573
75777574 ring->atr_count++;
75787575
7576+ /* currently only IPv4/IPv6 with TCP is supported */
7577+ if ((first->protocol != htons(ETH_P_IP)) &&
7578+ (first->protocol != htons(ETH_P_IPV6)))
7579+ return;
7580+
75797581 /* snag network header to get L4 type and address */
75807582 skb = first->skb;
75817583 hdr.network = skb_network_header(skb);
7582− if (!skb->encapsulation) {
7583− th = tcp_hdr(skb);
7584− } else {
75857584 #ifdef CONFIG_IXGBE_VXLAN
7585+ if (skb->encapsulation &&
7586+ first->protocol == htons(ETH_P_IP) &&
7587+ hdr.ipv4->protocol != IPPROTO_UDP) {
75867588 struct ixgbe_adapter *adapter = q_vector->adapter;
75877589
7588− if (!adapter->vxlan_port)
7589− return;
7590− if (first->protocol != htons(ETH_P_IP) ||
7591− hdr.ipv4->version != IPVERSION ||
7592− hdr.ipv4->protocol != IPPROTO_UDP) {
7593− return;
7594− }
7595− if (ntohs(udp_hdr(skb)->dest) != adapter->vxlan_port)
7596− return;
7597− encap = true;
7598− hdr.network = skb_inner_network_header(skb);
7599− th = inner_tcp_hdr(skb);
7600−#else
7601− return;
7602−#endif /* CONFIG_IXGBE_VXLAN */
7590+ /* verify the port is recognized as VXLAN */
7591+ if (adapter->vxlan_port &&
7592+ udp_hdr(skb)->dest == adapter->vxlan_port)
7593+ hdr.network = skb_inner_network_header(skb);
76037594 }
7595+#endif /* CONFIG_IXGBE_VXLAN */
76047596
76057597 /* Currently only IPv4/IPv6 with TCP is supported */
76067598 switch (hdr.ipv4->version) {
76077599 case IPVERSION:
7608− if (hdr.ipv4->protocol != IPPROTO_TCP)
7609− return;
7600+ /* access ihl as u8 to avoid unaligned access on ia64 */
7601+ hlen = (hdr.network[0] & 0x0F) << 2;
7602+ l4_proto = hdr.ipv4->protocol;
76107603 break;
76117604 case 6:
7612− if (likely((unsigned char *)th - hdr.network ==
7613− sizeof(struct ipv6hdr))) {
7614− if (hdr.ipv6->nexthdr != IPPROTO_TCP)
7615− return;
7616− } else {
7617− __be16 frag_off;
7618− u8 l4_hdr;
7619−
7620− ipv6_skip_exthdr(skb, hdr.network - skb->data +
7621− sizeof(struct ipv6hdr),
7622− &l4_hdr, &frag_off);
7623− if (unlikely(frag_off))
7624− return;
7625− if (l4_hdr != IPPROTO_TCP)
7626− return;
7627− }
7605+ hlen = hdr.network - skb->data;
7606+ l4_proto = ipv6_find_hdr(skb, &hlen, IPPROTO_TCP, NULL, NULL);
7607+ hlen -= hdr.network - skb->data;
76287608 break;
76297609 default:
76307610 return;
76317611 }
76327612
7633− /* skip this packet since it is invalid or the socket is closing */
7634− if (!th || th->fin)
7613+ if (l4_proto != IPPROTO_TCP)
7614+ return;
7615+
7616+ th = (struct tcphdr *)(hdr.network + hlen);
7617+
7618+ /* skip this packet since the socket is closing */
7619+ if (th->fin)
76357620 return;
76367621
76377622 /* sample on all syn packets or once every atr sample count */
@@ -7682,10 +7667,8 @@ static void ixgbe_atr(struct ixgbe_ring *ring, · 44 unmodified lines
76827667 break;
76837668 }
76847669
7685−#ifdef CONFIG_IXGBE_VXLAN
7686− if (encap)
7670+ if (hdr.network != skb_network_header(skb))
76877671 input.formatted.flow_type |= IXGBE_ATR_L4TYPE_TUNNEL_MASK;
7688−#endif /* CONFIG_IXGBE_VXLAN */
76897672
76907673 /* This assumes the Rx queue and Tx queue are bound to the same CPU */
76917674 ixgbe_fdir_add_signature_filter_82599(&q_vector->adapter->hw,
@@ -8209,10 +8192,17 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc) · 517 unmodified lines
82098192 static int ixgbe_delete_clsu32(struct ixgbe_adapter *adapter,
82108193 struct tc_cls_u32_offload *cls)
82118194 {
8195+ u32 uhtid = TC_U32_USERHTID(cls->knode.handle);
8196+ u32 loc;
82128197 int err;
82138198
8199+ if ((uhtid != 0x800) && (uhtid >= IXGBE_MAX_LINK_HANDLE))
8200+ return -EINVAL;
8201+
8202+ loc = cls->knode.handle & 0xfffff;
8203+
82148204 spin_lock(&adapter->fdir_perfect_lock);
8215− err = ixgbe_update_ethtool_fdir_entry(adapter, NULL, cls->knode.handle);
8205+ err = ixgbe_update_ethtool_fdir_entry(adapter, NULL, loc);
82168206 spin_unlock(&adapter->fdir_perfect_lock);
82178207 return err;
82188208 }
@@ -8221,20 +8211,30 @@ static int ixgbe_configure_clsu32_add_hnode(struct ixgbe_adapter *adapter, · 2 unmodified lines
82218211 __be16 protocol,
82228212 struct tc_cls_u32_offload *cls)
82238213 {
8214+ u32 uhtid = TC_U32_USERHTID(cls->hnode.handle);
8215+
8216+ if (uhtid >= IXGBE_MAX_LINK_HANDLE)
8217+ return -EINVAL;
8218+
82248219 /* This ixgbe devices do not support hash tables at the moment
82258220 * so abort when given hash tables.
82268221 */
82278222 if (cls->hnode.divisor > 0)
82288223 return -EINVAL;
82298224
8230− set_bit(TC_U32_USERHTID(cls->hnode.handle), &adapter->tables);
8225+ set_bit(uhtid - 1, &adapter->tables);
82318226 return 0;
82328227 }
82338228
82348229 static int ixgbe_configure_clsu32_del_hnode(struct ixgbe_adapter *adapter,
82358230 struct tc_cls_u32_offload *cls)
82368231 {
8237− clear_bit(TC_U32_USERHTID(cls->hnode.handle), &adapter->tables);
8232+ u32 uhtid = TC_U32_USERHTID(cls->hnode.handle);
8233+
8234+ if (uhtid >= IXGBE_MAX_LINK_HANDLE)
8235+ return -EINVAL;
8236+
8237+ clear_bit(uhtid - 1, &adapter->tables);
82388238 return 0;
82398239 }
82408240
@@ -8252,27 +8252,29 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, · 11 unmodified lines
82528252 #endif
82538253 int i, err = 0;
82548254 u8 queue;
8255− u32 handle;
8255+ u32 uhtid, link_uhtid;
82568256
82578257 memset(&mask, 0, sizeof(union ixgbe_atr_input));
8258− handle = cls->knode.handle;
8258+ uhtid = TC_U32_USERHTID(cls->knode.handle);
8259+ link_uhtid = TC_U32_USERHTID(cls->knode.link_handle);
82598260
8260− /* At the moment cls_u32 jumps to transport layer and skips past
8261+ /* At the moment cls_u32 jumps to network layer and skips past
82618262 * L2 headers. The canonical method to match L2 frames is to use
82628263 * negative values. However this is error prone at best but really
82638264 * just broken because there is no way to "know" what sort of hdr
8264− * is in front of the transport layer. Fix cls_u32 to support L2
8265+ * is in front of the network layer. Fix cls_u32 to support L2
82658266 * headers when needed.
82668267 */
82678268 if (protocol != htons(ETH_P_IP))
82688269 return -EINVAL;
82698270
8270− if (cls->knode.link_handle ||
8271− cls->knode.link_handle >= IXGBE_MAX_LINK_HANDLE) {
8271+ if (link_uhtid) {
82728272 struct ixgbe_nexthdr *nexthdr = ixgbe_ipv4_jumps;
8273− u32 uhtid = TC_U32_USERHTID(cls->knode.link_handle);
82748273
8275− if (!test_bit(uhtid, &adapter->tables))
8274+ if (link_uhtid >= IXGBE_MAX_LINK_HANDLE)
8275+ return -EINVAL;
8276+
8277+ if (!test_bit(link_uhtid - 1, &adapter->tables))
82768278 return -EINVAL;
82778279
82788280 for (i = 0; nexthdr[i].jump; i++) {
@@ -8288,10 +8290,7 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, · 9 unmodified lines
82888290 nexthdr->mask != cls->knode.sel->keys[0].mask)
82898291 return -EINVAL;
82908292
8291− if (uhtid >= IXGBE_MAX_LINK_HANDLE)
8292− return -EINVAL;
8293−
8294− adapter->jump_tables[uhtid] = nexthdr->jump;
8293+ adapter->jump_tables[link_uhtid] = nexthdr->jump;
82958294 }
82968295 return 0;
82978296 }
@@ -8308,13 +8307,13 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, · 10 unmodified lines
83088307 * To add support for new nodes update ixgbe_model.h parse structures
83098308 * this function _should_ be generic try not to hardcode values here.
83108309 */
8311− if (TC_U32_USERHTID(handle) == 0x800) {
8310+ if (uhtid == 0x800) {
83128311 field_ptr = adapter->jump_tables[0];
83138312 } else {
8314− if (TC_U32_USERHTID(handle) >= ARRAY_SIZE(adapter->jump_tables))
8313+ if (uhtid >= IXGBE_MAX_LINK_HANDLE)
83158314 return -EINVAL;
83168315
8317− field_ptr = adapter->jump_tables[TC_U32_USERHTID(handle)];
8316+ field_ptr = adapter->jump_tables[uhtid];
83188317 }
83198318
83208319 if (!field_ptr)
@@ -8332,8 +8331,7 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, · 11 unmodified lines
83328331 int j;
83338332
83348333 for (j = 0; field_ptr[j].val; j++) {
8335− if (field_ptr[j].off == off &&
8336− field_ptr[j].mask == m) {
8334+ if (field_ptr[j].off == off) {
83378335 field_ptr[j].val(input, &mask, val, m);
83388336 input->filter.formatted.flow_type |=
83398337 field_ptr[j].type;
@@ -8393,8 +8391,8 @@ err_out: · 53 unmodified lines
83938391 return -EINVAL;
83948392 }
83958393
8396−int __ixgbe_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
8397− struct tc_to_netdev *tc)
8394+static int __ixgbe_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
8395+ struct tc_to_netdev *tc)
83988396 {
83998397 struct ixgbe_adapter *adapter = netdev_priv(dev);
84008398
@@ -8554,7 +8552,6 @@ static void ixgbe_add_vxlan_port(struct net_device *dev, sa_family_t sa_family, · 153 unmodified lines
85548552 {
85558553 struct ixgbe_adapter *adapter = netdev_priv(dev);
85568554 struct ixgbe_hw *hw = &adapter->hw;
8557− u16 new_port = ntohs(port);
85588555
85598556 if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
85608557 return;
@@ -8562,18 +8559,18 @@ static void ixgbe_add_vxlan_port(struct net_device *dev, sa_family_t sa_family, · 1 unmodified line
85628559 if (sa_family == AF_INET6)
85638560 return;
85648561
8565− if (adapter->vxlan_port == new_port)
8562+ if (adapter->vxlan_port == port)
85668563 return;
85678564
85688565 if (adapter->vxlan_port) {
85698566 netdev_info(dev,
85708567 "Hit Max num of VXLAN ports, not adding port %d\n",
8571− new_port);
8568+ ntohs(port));
85728569 return;
85738570 }
85748571
8575− adapter->vxlan_port = new_port;
8576− IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, new_port);
8572+ adapter->vxlan_port = port;
8573+ IXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, ntohs(port));
85778574 }
85788575
85798576 /**
@@ -8586,7 +8583,6 @@ static void ixgbe_del_vxlan_port(struct net_device *dev, sa_family_t sa_family, · 6 unmodified lines
85868583 __be16 port)
85878584 {
85888585 struct ixgbe_adapter *adapter = netdev_priv(dev);
8589− u16 new_port = ntohs(port);
85908586
85918587 if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
85928588 return;
@@ -8594,9 +8590,9 @@ static void ixgbe_del_vxlan_port(struct net_device *dev, sa_family_t sa_family, · 1 unmodified line
85948590 if (sa_family == AF_INET6)
85958591 return;
85968592
8597− if (adapter->vxlan_port != new_port) {
8593+ if (adapter->vxlan_port != port) {
85988594 netdev_info(dev, "Port %d was not found, not deleting\n",
8599− new_port);
8595+ ntohs(port));
86008596 return;
86018597 }
86028598
@@ -9265,17 +9261,6 @@ skip_sriov: · 662 unmodified lines
92659261 netdev->priv_flags |= IFF_UNICAST_FLT;
92669262 netdev->priv_flags |= IFF_SUPP_NOFCS;
92679263
9268−#ifdef CONFIG_IXGBE_VXLAN
9269− switch (adapter->hw.mac.type) {
9270− case ixgbe_mac_X550:
9271− case ixgbe_mac_X550EM_x:
9272− netdev->hw_enc_features |= NETIF_F_RXCSUM;
9273− break;
9274− default:
9275− break;
9276− }
9277−#endif /* CONFIG_IXGBE_VXLAN */
9278−
92799264 #ifdef CONFIG_IXGBE_DCB
92809265 netdev->dcbnl_ops = &dcbnl_ops;
92819266 #endif
@@ -9329,6 +9314,8 @@ skip_sriov: · 47 unmodified lines
93299314 goto err_sw_init;
93309315 }
93319316
9317+ /* Set hw->mac.addr to permanent MAC address */
9318+ ether_addr_copy(hw->mac.addr, hw->mac.perm_addr);
93329319 ixgbe_mac_set_default_filter(adapter);
93339320
93349321 setup_timer(&adapter->service_timer, &ixgbe_service_timer,
drivers/net/ethernet/intel/ixgbe/ixgbe_model.h+6−15
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232
3333 struct ixgbe_mat_field {
3434 unsigned int off;
35− unsigned int mask;
3635 int (*val)(struct ixgbe_fdir_filter *input,
3736 union ixgbe_atr_input *mask,
3837 u32 val, u32 m);
@@ -58,35 +57,27 @@ static inline int ixgbe_mat_prgm_dip(struct ixgbe_fdir_filter *input, · 19 unmodified lines
5857 }
5958
6059 static struct ixgbe_mat_field ixgbe_ipv4_fields[] = {
61− { .off = 12, .mask = -1, .val = ixgbe_mat_prgm_sip,
60+ { .off = 12, .val = ixgbe_mat_prgm_sip,
6261 .type = IXGBE_ATR_FLOW_TYPE_IPV4},
63− { .off = 16, .mask = -1, .val = ixgbe_mat_prgm_dip,
62+ { .off = 16, .val = ixgbe_mat_prgm_dip,
6463 .type = IXGBE_ATR_FLOW_TYPE_IPV4},
6564 { .val = NULL } /* terminal node */
6665 };
6766
68−static inline int ixgbe_mat_prgm_sport(struct ixgbe_fdir_filter *input,
67+static inline int ixgbe_mat_prgm_ports(struct ixgbe_fdir_filter *input,
6968 union ixgbe_atr_input *mask,
7069 u32 val, u32 m)
7170 {
7271 input->filter.formatted.src_port = val & 0xffff;
7372 mask->formatted.src_port = m & 0xffff;
74− return 0;
75−};
73+ input->filter.formatted.dst_port = val >> 16;
74+ mask->formatted.dst_port = m >> 16;
7675
77−static inline int ixgbe_mat_prgm_dport(struct ixgbe_fdir_filter *input,
78− union ixgbe_atr_input *mask,
79− u32 val, u32 m)
80−{
81− input->filter.formatted.dst_port = val & 0xffff;
82− mask->formatted.dst_port = m & 0xffff;
8376 return 0;
8477 };
8578
8679 static struct ixgbe_mat_field ixgbe_tcp_fields[] = {
87− {.off = 0, .mask = 0xffff, .val = ixgbe_mat_prgm_sport,
88− .type = IXGBE_ATR_FLOW_TYPE_TCPV4},
89− {.off = 2, .mask = 0xffff, .val = ixgbe_mat_prgm_dport,
80+ {.off = 0, .val = ixgbe_mat_prgm_ports,
9081 .type = IXGBE_ATR_FLOW_TYPE_TCPV4},
9182 { .val = NULL } /* terminal node */
9283 };
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c+1−1
@@ -355,7 +355,7 @@ static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl) · 354 unmodified lines
355355 command = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL);
356356 if (!(command & IXGBE_SB_IOSF_CTRL_BUSY))
357357 break;
358− usleep_range(10, 20);
358+ udelay(10);
359359 }
360360 if (ctrl)
361361 *ctrl = command;
drivers/net/ethernet/intel/ixgbevf/ethtool.c+2−2
@@ -680,7 +680,7 @@ static void ixgbevf_diag_test(struct net_device *netdev, · 679 unmodified lines
680680
681681 if (if_running)
682682 /* indicate we're in test mode */
683− dev_close(netdev);
683+ ixgbevf_close(netdev);
684684 else
685685 ixgbevf_reset(adapter);
686686
@@ -692,7 +692,7 @@ static void ixgbevf_diag_test(struct net_device *netdev, · 5 unmodified lines
692692
693693 clear_bit(__IXGBEVF_TESTING, &adapter->state);
694694 if (if_running)
695− dev_open(netdev);
695+ ixgbevf_open(netdev);
696696 } else {
697697 hw_dbg(&adapter->hw, "online testing starting\n");
698698 /* Online tests */
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h+2−0
@@ -486,6 +486,8 @@ extern const struct ixgbe_mbx_operations ixgbevf_mbx_ops; · 485 unmodified lines
486486 extern const char ixgbevf_driver_name[];
487487 extern const char ixgbevf_driver_version[];
488488
489+int ixgbevf_open(struct net_device *netdev);
490+int ixgbevf_close(struct net_device *netdev);
489491 void ixgbevf_up(struct ixgbevf_adapter *adapter);
490492 void ixgbevf_down(struct ixgbevf_adapter *adapter);
491493 void ixgbevf_reinit_locked(struct ixgbevf_adapter *adapter);
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+10−6
@@ -3122,7 +3122,7 @@ static void ixgbevf_free_all_rx_resources(struct ixgbevf_adapter *adapter) · 3121 unmodified lines
31223122 * handler is registered with the OS, the watchdog timer is started,
31233123 * and the stack is notified that the interface is ready.
31243124 **/
3125−static int ixgbevf_open(struct net_device *netdev)
3125+int ixgbevf_open(struct net_device *netdev)
31263126 {
31273127 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
31283128 struct ixgbe_hw *hw = &adapter->hw;
@@ -3205,7 +3205,7 @@ err_setup_reset: · 76 unmodified lines
32053205 * needs to be disabled. A global MAC reset is issued to stop the
32063206 * hardware, and all transmit and receive resources are freed.
32073207 **/
3208−static int ixgbevf_close(struct net_device *netdev)
3208+int ixgbevf_close(struct net_device *netdev)
32093209 {
32103210 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
32113211
@@ -3692,19 +3692,23 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p) · 480 unmodified lines
36923692 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
36933693 struct ixgbe_hw *hw = &adapter->hw;
36943694 struct sockaddr *addr = p;
3695+ int err;
36953696
36963697 if (!is_valid_ether_addr(addr->sa_data))
36973698 return -EADDRNOTAVAIL;
36983699
3699− ether_addr_copy(netdev->dev_addr, addr->sa_data);
3700− ether_addr_copy(hw->mac.addr, addr->sa_data);
3701−
37023700 spin_lock_bh(&adapter->mbx_lock);
37033701
3704− hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0);
3702+ err = hw->mac.ops.set_rar(hw, 0, addr->sa_data, 0);
37053703
37063704 spin_unlock_bh(&adapter->mbx_lock);
37073705
3706+ if (err)
3707+ return -EPERM;
3708+
3709+ ether_addr_copy(hw->mac.addr, addr->sa_data);
3710+ ether_addr_copy(netdev->dev_addr, addr->sa_data);
3711+
37083712 return 0;
37093713 }
37103714
drivers/net/ethernet/intel/ixgbevf/vf.c+3−1
@@ -408,8 +408,10 @@ static s32 ixgbevf_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, · 407 unmodified lines
408408
409409 /* if nacked the address was rejected, use "perm_addr" */
410410 if (!ret_val &&
411− (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_NACK)))
411+ (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_NACK))) {
412412 ixgbevf_get_mac_addr_vf(hw, hw->mac.addr);
413+ return IXGBE_ERR_MBX;
414+ }
413415
414416 return ret_val;
415417 }
drivers/net/ethernet/marvell/mvneta.c+17−23
@@ -260,7 +260,6 @@ · 259 unmodified lines
260260
261261 #define MVNETA_VLAN_TAG_LEN 4
262262
263−#define MVNETA_CPU_D_CACHE_LINE_SIZE 32
264263 #define MVNETA_TX_CSUM_DEF_SIZE 1600
265264 #define MVNETA_TX_CSUM_MAX_SIZE 9800
266265 #define MVNETA_ACC_MODE_EXT1 1
@@ -300,7 +299,7 @@ · 33 unmodified lines
300299 #define MVNETA_RX_PKT_SIZE(mtu) \
301300 ALIGN((mtu) + MVNETA_MH_SIZE + MVNETA_VLAN_TAG_LEN + \
302301 ETH_HLEN + ETH_FCS_LEN, \
303− MVNETA_CPU_D_CACHE_LINE_SIZE)
302+ cache_line_size())
304303
305304 #define IS_TSO_HEADER(txq, addr) \
306305 ((addr >= txq->tso_hdrs_phys) && \
@@ -2764,9 +2763,6 @@ static int mvneta_rxq_init(struct mvneta_port *pp, · 2457 unmodified lines
27642763 if (rxq->descs == NULL)
27652764 return -ENOMEM;
27662765
2767− BUG_ON(rxq->descs !=
2768− PTR_ALIGN(rxq->descs, MVNETA_CPU_D_CACHE_LINE_SIZE));
2769−
27702766 rxq->last_desc = rxq->size - 1;
27712767
27722768 /* Set Rx descriptors queue starting address */
@@ -2837,10 +2833,6 @@ static int mvneta_txq_init(struct mvneta_port *pp, · 64 unmodified lines
28372833 if (txq->descs == NULL)
28382834 return -ENOMEM;
28392835
2840− /* Make sure descriptor address is cache line size aligned */
2841− BUG_ON(txq->descs !=
2842− PTR_ALIGN(txq->descs, MVNETA_CPU_D_CACHE_LINE_SIZE));
2843−
28442836 txq->last_desc = txq->size - 1;
28452837
28462838 /* Set maximum bandwidth for enabled TXQs */
@@ -3050,6 +3042,20 @@ static int mvneta_check_mtu_valid(struct net_device *dev, int mtu) · 203 unmodified lines
30503042 return mtu;
30513043 }
30523044
3045+static void mvneta_percpu_enable(void *arg)
3046+{
3047+ struct mvneta_port *pp = arg;
3048+
3049+ enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE);
3050+}
3051+
3052+static void mvneta_percpu_disable(void *arg)
3053+{
3054+ struct mvneta_port *pp = arg;
3055+
3056+ disable_percpu_irq(pp->dev->irq);
3057+}
3058+
30533059 /* Change the device mtu */
30543060 static int mvneta_change_mtu(struct net_device *dev, int mtu)
30553061 {
@@ -3074,6 +3080,7 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) · 18 unmodified lines
30743080 * reallocation of the queues
30753081 */
30763082 mvneta_stop_dev(pp);
3083+ on_each_cpu(mvneta_percpu_disable, pp, true);
30773084
30783085 mvneta_cleanup_txqs(pp);
30793086 mvneta_cleanup_rxqs(pp);
@@ -3097,6 +3104,7 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) · 17 unmodified lines
30973104 return ret;
30983105 }
30993106
3107+ on_each_cpu(mvneta_percpu_enable, pp, true);
31003108 mvneta_start_dev(pp);
31013109 mvneta_port_up(pp);
31023110
@@ -3250,20 +3258,6 @@ static void mvneta_mdio_remove(struct mvneta_port *pp) · 147 unmodified lines
32503258 pp->phy_dev = NULL;
32513259 }
32523260
3253−static void mvneta_percpu_enable(void *arg)
3254−{
3255− struct mvneta_port *pp = arg;
3256−
3257− enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE);
3258−}
3259−
3260−static void mvneta_percpu_disable(void *arg)
3261−{
3262− struct mvneta_port *pp = arg;
3263−
3264− disable_percpu_irq(pp->dev->irq);
3265−}
3266−
32673261 /* Electing a CPU must be done in an atomic way: it should be done
32683262 * after or before the removal/insertion of a CPU and this function is
32693263 * not reentrant.
drivers/net/ethernet/marvell/mvpp2.c+4−14
@@ -321,7 +321,6 @@ · 320 unmodified lines
321321 /* Lbtd 802.3 type */
322322 #define MVPP2_IP_LBDT_TYPE 0xfffa
323323
324−#define MVPP2_CPU_D_CACHE_LINE_SIZE 32
325324 #define MVPP2_TX_CSUM_MAX_SIZE 9800
326325
327326 /* Timeout constants */
@@ -377,7 +376,7 @@ · 49 unmodified lines
377376
378377 #define MVPP2_RX_PKT_SIZE(mtu) \
379378 ALIGN((mtu) + MVPP2_MH_SIZE + MVPP2_VLAN_TAG_LEN + \
380− ETH_HLEN + ETH_FCS_LEN, MVPP2_CPU_D_CACHE_LINE_SIZE)
379+ ETH_HLEN + ETH_FCS_LEN, cache_line_size())
381380
382381 #define MVPP2_RX_BUF_SIZE(pkt_size) ((pkt_size) + NET_SKB_PAD)
383382 #define MVPP2_RX_TOTAL_SIZE(buf_size) ((buf_size) + MVPP2_SKB_SHINFO_SIZE)
@@ -4493,10 +4492,6 @@ static int mvpp2_aggr_txq_init(struct platform_device *pdev, · 4109 unmodified lines
44934492 if (!aggr_txq->descs)
44944493 return -ENOMEM;
44954494
4496− /* Make sure descriptor address is cache line size aligned */
4497− BUG_ON(aggr_txq->descs !=
4498− PTR_ALIGN(aggr_txq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE));
4499−
45004495 aggr_txq->last_desc = aggr_txq->size - 1;
45014496
45024497 /* Aggr TXQ no reset WA */
@@ -4526,9 +4521,6 @@ static int mvpp2_rxq_init(struct mvpp2_port *port, · 23 unmodified lines
45264521 if (!rxq->descs)
45274522 return -ENOMEM;
45284523
4529− BUG_ON(rxq->descs !=
4530− PTR_ALIGN(rxq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE));
4531−
45324524 rxq->last_desc = rxq->size - 1;
45334525
45344526 /* Zero occupied and non-occupied counters - direct access */
@@ -4616,10 +4608,6 @@ static int mvpp2_txq_init(struct mvpp2_port *port, · 81 unmodified lines
46164608 if (!txq->descs)
46174609 return -ENOMEM;
46184610
4619− /* Make sure descriptor address is cache line size aligned */
4620− BUG_ON(txq->descs !=
4621− PTR_ALIGN(txq->descs, MVPP2_CPU_D_CACHE_LINE_SIZE));
4622−
46234611 txq->last_desc = txq->size - 1;
46244612
46254613 /* Set Tx descriptors queue starting address - indirect access */
@@ -6059,8 +6047,10 @@ static int mvpp2_port_init(struct mvpp2_port *port) · 1433 unmodified lines
60596047
60606048 /* Map physical Rx queue to port's logical Rx queue */
60616049 rxq = devm_kzalloc(dev, sizeof(*rxq), GFP_KERNEL);
6062− if (!rxq)
6050+ if (!rxq) {
6051+ err = -ENOMEM;
60636052 goto err_free_percpu;
6053+ }
60646054 /* Map this Rx queue to a physical queue */
60656055 rxq->id = port->first_rxq + queue;
60666056 rxq->port = port->id;
drivers/net/ethernet/qlogic/qed/qed_int.c+1−1
@@ -2750,7 +2750,7 @@ void qed_int_igu_enable_int(struct qed_hwfn *p_hwfn, · 2749 unmodified lines
27502750 int qed_int_igu_enable(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
27512751 enum qed_int_mode int_mode)
27522752 {
2753− int rc;
2753+ int rc = 0;
27542754
27552755 /* Configure AEU signal change to produce attentions */
27562756 qed_wr(p_hwfn, p_ptt, IGU_REG_ATTENTION_ENABLE, 0);
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 "1.00.00.34"
21+#define DRV_VERSION "1.00.00.35"
2222
2323 #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */
2424
drivers/net/ethernet/renesas/ravb_main.c+1−1
@@ -1377,11 +1377,11 @@ static netdev_tx_t ravb_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 1376 unmodified lines
13771377
13781378 /* TAG and timestamp required flag */
13791379 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
1380− skb_tx_timestamp(skb);
13811380 desc->tagh_tsr = (ts_skb->tag >> 4) | TX_TSR;
13821381 desc->ds_tagl |= le16_to_cpu(ts_skb->tag << 12);
13831382 }
13841383
1384+ skb_tx_timestamp(skb);
13851385 /* Descriptor type must be set after all the above writes */
13861386 dma_wmb();
13871387 desc->die_dt = DT_FEND;
drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c+2−2
@@ -155,11 +155,11 @@ static int sxgbe_platform_probe(struct platform_device *pdev) · 154 unmodified lines
155155 return 0;
156156
157157 err_rx_irq_unmap:
158− while (--i)
158+ while (i--)
159159 irq_dispose_mapping(priv->rxq[i]->irq_no);
160160 i = SXGBE_TX_QUEUES;
161161 err_tx_irq_unmap:
162− while (--i)
162+ while (i--)
163163 irq_dispose_mapping(priv->txq[i]->irq_no);
164164 irq_dispose_mapping(priv->irq);
165165 err_drv_remove:
drivers/net/ethernet/stmicro/stmmac/norm_desc.c+8−8
@@ -199,11 +199,6 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, · 198 unmodified lines
199199 {
200200 unsigned int tdes1 = p->des1;
201201
202− if (mode == STMMAC_CHAIN_MODE)
203− norm_set_tx_desc_len_on_chain(p, len);
204− else
205− norm_set_tx_desc_len_on_ring(p, len);
206−
207202 if (is_fs)
208203 tdes1 |= TDES1_FIRST_SEGMENT;
209204 else
@@ -217,10 +212,15 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, · 7 unmodified lines
217212 if (ls)
218213 tdes1 |= TDES1_LAST_SEGMENT;
219214
220− if (tx_own)
221− tdes1 |= TDES0_OWN;
222−
223215 p->des1 = tdes1;
216+
217+ if (mode == STMMAC_CHAIN_MODE)
218+ norm_set_tx_desc_len_on_chain(p, len);
219+ else
220+ norm_set_tx_desc_len_on_ring(p, len);
221+
222+ if (tx_own)
223+ p->des0 |= TDES0_OWN;
224224 }
225225
226226 static void ndesc_set_tx_ic(struct dma_desc *p)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+5−11
@@ -278,7 +278,6 @@ static void stmmac_eee_ctrl_timer(unsigned long arg) · 277 unmodified lines
278278 */
279279 bool stmmac_eee_init(struct stmmac_priv *priv)
280280 {
281− char *phy_bus_name = priv->plat->phy_bus_name;
282281 unsigned long flags;
283282 bool ret = false;
284283
@@ -290,7 +289,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv) · 5 unmodified lines
290289 goto out;
291290
292291 /* Never init EEE in case of a switch is attached */
293− if (phy_bus_name && (!strcmp(phy_bus_name, "fixed")))
292+ if (priv->phydev->is_pseudo_fixed_link)
294293 goto out;
295294
296295 /* MAC core supports the EEE feature. */
@@ -827,12 +826,8 @@ static int stmmac_init_phy(struct net_device *dev) · 530 unmodified lines
827826 phydev = of_phy_connect(dev, priv->plat->phy_node,
828827 &stmmac_adjust_link, 0, interface);
829828 } else {
830− if (priv->plat->phy_bus_name)
831− snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
832− priv->plat->phy_bus_name, priv->plat->bus_id);
833− else
834− snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
835− priv->plat->bus_id);
829+ snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
830+ priv->plat->bus_id);
836831
837832 snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
838833 priv->plat->phy_addr);
@@ -871,9 +866,8 @@ static int stmmac_init_phy(struct net_device *dev) · 32 unmodified lines
871866 }
872867
873868 /* If attached to a switch, there is no reason to poll phy handler */
874− if (priv->plat->phy_bus_name)
875− if (!strcmp(priv->plat->phy_bus_name, "fixed"))
876− phydev->irq = PHY_IGNORE_INTERRUPT;
869+ if (phydev->is_pseudo_fixed_link)
870+ phydev->irq = PHY_IGNORE_INTERRUPT;
877871
878872 pr_debug("stmmac_init_phy: %s: attached to PHY (UID 0x%x)"
879873 " Link = %d\n", dev->name, phydev->phy_id, phydev->link);
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c+1−9
@@ -198,20 +198,12 @@ int stmmac_mdio_register(struct net_device *ndev) · 197 unmodified lines
198198 struct mii_bus *new_bus;
199199 struct stmmac_priv *priv = netdev_priv(ndev);
200200 struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data;
201− int addr, found;
202201 struct device_node *mdio_node = priv->plat->mdio_node;
202+ int addr, found;
203203
204204 if (!mdio_bus_data)
205205 return 0;
206206
207− if (IS_ENABLED(CONFIG_OF)) {
208− if (mdio_node) {
209− netdev_dbg(ndev, "FOUND MDIO subnode\n");
210− } else {
211− netdev_warn(ndev, "No MDIO subnode found\n");
212− }
213− }
214−
215207 new_bus = mdiobus_alloc();
216208 if (new_bus == NULL)
217209 return -ENOMEM;
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c+66−25
@@ -131,6 +131,69 @@ static struct stmmac_axi *stmmac_axi_setup(struct platform_device *pdev) · 130 unmodified lines
131131 return axi;
132132 }
133133
134+/**
135+ * stmmac_dt_phy - parse device-tree driver parameters to allocate PHY resources
136+ * @plat: driver data platform structure
137+ * @np: device tree node
138+ * @dev: device pointer
139+ * Description:
140+ * The mdio bus will be allocated in case of a phy transceiver is on board;
141+ * it will be NULL if the fixed-link is configured.
142+ * If there is the "snps,dwmac-mdio" sub-node the mdio will be allocated
143+ * in any case (for DSA, mdio must be registered even if fixed-link).
144+ * The table below sums the supported configurations:
145+ * -------------------------------
146+ * snps,phy-addr | Y
147+ * -------------------------------
148+ * phy-handle | Y
149+ * -------------------------------
150+ * fixed-link | N
151+ * -------------------------------
152+ * snps,dwmac-mdio |
153+ * even if | Y
154+ * fixed-link |
155+ * -------------------------------
156+ *
157+ * It returns 0 in case of success otherwise -ENODEV.
158+ */
159+static int stmmac_dt_phy(struct plat_stmmacenet_data *plat,
160+ struct device_node *np, struct device *dev)
161+{
162+ bool mdio = true;
163+
164+ /* If phy-handle property is passed from DT, use it as the PHY */
165+ plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
166+ if (plat->phy_node)
167+ dev_dbg(dev, "Found phy-handle subnode\n");
168+
169+ /* If phy-handle is not specified, check if we have a fixed-phy */
170+ if (!plat->phy_node && of_phy_is_fixed_link(np)) {
171+ if ((of_phy_register_fixed_link(np) < 0))
172+ return -ENODEV;
173+
174+ dev_dbg(dev, "Found fixed-link subnode\n");
175+ plat->phy_node = of_node_get(np);
176+ mdio = false;
177+ }
178+
179+ /* If snps,dwmac-mdio is passed from DT, always register the MDIO */
180+ for_each_child_of_node(np, plat->mdio_node) {
181+ if (of_device_is_compatible(plat->mdio_node, "snps,dwmac-mdio"))
182+ break;
183+ }
184+
185+ if (plat->mdio_node) {
186+ dev_dbg(dev, "Found MDIO subnode\n");
187+ mdio = true;
188+ }
189+
190+ if (mdio)
191+ plat->mdio_bus_data =
192+ devm_kzalloc(dev, sizeof(struct stmmac_mdio_bus_data),
193+ GFP_KERNEL);
194+ return 0;
195+}
196+
134197 /**
135198 * stmmac_probe_config_dt - parse device-tree driver parameters
136199 * @pdev: platform_device structure
@@ -146,7 +209,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) · 9 unmodified lines
146209 struct device_node *np = pdev->dev.of_node;
147210 struct plat_stmmacenet_data *plat;
148211 struct stmmac_dma_cfg *dma_cfg;
149− struct device_node *child_node = NULL;
150212
151213 plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
152214 if (!plat)
@@ -166,36 +228,15 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) · 13 unmodified lines
166228 /* Default to phy auto-detection */
167229 plat->phy_addr = -1;
168230
169− /* If we find a phy-handle property, use it as the PHY */
170− plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
171−
172− /* If phy-handle is not specified, check if we have a fixed-phy */
173− if (!plat->phy_node && of_phy_is_fixed_link(np)) {
174− if ((of_phy_register_fixed_link(np) < 0))
175− return ERR_PTR(-ENODEV);
176−
177− plat->phy_node = of_node_get(np);
178− }
179−
180− for_each_child_of_node(np, child_node)
181− if (of_device_is_compatible(child_node, "snps,dwmac-mdio")) {
182− plat->mdio_node = child_node;
183− break;
184− }
185−
186231 /* "snps,phy-addr" is not a standard property. Mark it as deprecated
187232 * and warn of its use. Remove this when phy node support is added.
188233 */
189234 if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
190235 dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
191236
192− if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node)
193− plat->mdio_bus_data = NULL;
194− else
195− plat->mdio_bus_data =
196− devm_kzalloc(&pdev->dev,
197− sizeof(struct stmmac_mdio_bus_data),
198− GFP_KERNEL);
237+ /* To Configure PHY by using all device-tree supported properties */
238+ if (stmmac_dt_phy(plat, np, &pdev->dev))
239+ return ERR_PTR(-ENODEV);
199240
200241 of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);
201242
drivers/net/phy/bcm7xxx.c+4−0
@@ -339,6 +339,8 @@ static struct phy_driver bcm7xxx_driver[] = { · 338 unmodified lines
339339 BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"),
340340 BCM7XXX_28NM_GPHY(PHY_ID_BCM7439_2, "Broadcom BCM7439 (2)"),
341341 BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"),
342+ BCM7XXX_40NM_EPHY(PHY_ID_BCM7346, "Broadcom BCM7346"),
343+ BCM7XXX_40NM_EPHY(PHY_ID_BCM7362, "Broadcom BCM7362"),
342344 BCM7XXX_40NM_EPHY(PHY_ID_BCM7425, "Broadcom BCM7425"),
343345 BCM7XXX_40NM_EPHY(PHY_ID_BCM7429, "Broadcom BCM7429"),
344346 BCM7XXX_40NM_EPHY(PHY_ID_BCM7435, "Broadcom BCM7435"),
@@ -348,6 +350,8 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = { · 3 unmodified lines
348350 { PHY_ID_BCM7250, 0xfffffff0, },
349351 { PHY_ID_BCM7364, 0xfffffff0, },
350352 { PHY_ID_BCM7366, 0xfffffff0, },
353+ { PHY_ID_BCM7346, 0xfffffff0, },
354+ { PHY_ID_BCM7362, 0xfffffff0, },
351355 { PHY_ID_BCM7425, 0xfffffff0, },
352356 { PHY_ID_BCM7429, 0xfffffff0, },
353357 { PHY_ID_BCM7439, 0xfffffff0, },
drivers/net/team/team.c+5−0
@@ -1198,6 +1198,9 @@ static int team_port_add(struct team *team, struct net_device *port_dev) · 1197 unmodified lines
11981198 goto err_dev_open;
11991199 }
12001200
1201+ dev_uc_sync_multiple(port_dev, dev);
1202+ dev_mc_sync_multiple(port_dev, dev);
1203+
12011204 err = vlan_vids_add_by_dev(port_dev, dev);
12021205 if (err) {
12031206 netdev_err(dev, "Failed to add vlan ids to device %s\n",
@@ -1261,6 +1264,8 @@ err_enable_netpoll: · 57 unmodified lines
12611264 vlan_vids_del_by_dev(port_dev, dev);
12621265
12631266 err_vids_add:
1267+ dev_uc_unsync(port_dev, dev);
1268+ dev_mc_unsync(port_dev, dev);
12641269 dev_close(port_dev);
12651270
12661271 err_dev_open:
drivers/net/tun.c+5−3
@@ -622,7 +622,8 @@ static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filte · 621 unmodified lines
622622
623623 /* Re-attach the filter to persist device */
624624 if (!skip_filter && (tun->filter_attached == true)) {
625− err = sk_attach_filter(&tun->fprog, tfile->socket.sk);
625+ err = __sk_attach_filter(&tun->fprog, tfile->socket.sk,
626+ lockdep_rtnl_is_held());
626627 if (!err)
627628 goto out;
628629 }
@@ -1822,7 +1823,7 @@ static void tun_detach_filter(struct tun_struct *tun, int n) · 1193 unmodified lines
18221823
18231824 for (i = 0; i < n; i++) {
18241825 tfile = rtnl_dereference(tun->tfiles[i]);
1825− sk_detach_filter(tfile->socket.sk);
1826+ __sk_detach_filter(tfile->socket.sk, lockdep_rtnl_is_held());
18261827 }
18271828
18281829 tun->filter_attached = false;
@@ -1835,7 +1836,8 @@ static int tun_attach_filter(struct tun_struct *tun) · 6 unmodified lines
18351836
18361837 for (i = 0; i < tun->numqueues; i++) {
18371838 tfile = rtnl_dereference(tun->tfiles[i]);
1838− ret = sk_attach_filter(&tun->fprog, tfile->socket.sk);
1839+ ret = __sk_attach_filter(&tun->fprog, tfile->socket.sk,
1840+ lockdep_rtnl_is_held());
18391841 if (ret) {
18401842 tun_detach_filter(tun, i);
18411843 return ret;
drivers/net/usb/cdc_ncm.c+7−0
@@ -1626,6 +1626,13 @@ static const struct usb_device_id cdc_devs[] = { · 1625 unmodified lines
16261626 .driver_info = (unsigned long) &wwan_info,
16271627 },
16281628
1629+ /* Telit LE910 V2 */
1630+ { USB_DEVICE_AND_INTERFACE_INFO(0x1bc7, 0x0036,
1631+ USB_CLASS_COMM,
1632+ USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE),
1633+ .driver_info = (unsigned long)&wwan_noarp_info,
1634+ },
1635+
16291636 /* DW5812 LTE Verizon Mobile Broadband Card
16301637 * Unlike DW5550 this device requires FLAG_NOARP
16311638 */
drivers/net/usb/plusb.c+1−1
@@ -38,7 +38,7 @@ · 37 unmodified lines
3838 * HEADS UP: this handshaking isn't all that robust. This driver
3939 * gets confused easily if you unplug one end of the cable then
4040 * try to connect it again; you'll need to restart both ends. The
41− * "naplink" software (used by some PlayStation/2 deveopers) does
41+ * "naplink" software (used by some PlayStation/2 developers) does
4242 * the handshaking much better! Also, sometimes this hardware
4343 * seems to get wedged under load. Prolific docs are weak, and
4444 * don't identify differences between PL2301 and PL2302, much less
drivers/net/usb/qmi_wwan.c+1−0
@@ -844,6 +844,7 @@ static const struct usb_device_id products[] = { · 843 unmodified lines
844844 {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */
845845 {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */
846846 {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
847+ {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */
847848 {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
848849 {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
849850 {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
drivers/nvdimm/pmem.c+2−2
@@ -99,7 +99,7 @@ static int pmem_do_bvec(struct pmem_device *pmem, struct page *page, · 98 unmodified lines
9999 if (unlikely(bad_pmem))
100100 rc = -EIO;
101101 else {
102− memcpy_from_pmem(mem + off, pmem_addr, len);
102+ rc = memcpy_from_pmem(mem + off, pmem_addr, len);
103103 flush_dcache_page(page);
104104 }
105105 } else {
@@ -295,7 +295,7 @@ static int pmem_rw_bytes(struct nd_namespace_common *ndns, · 189 unmodified lines
295295
296296 if (unlikely(is_bad_pmem(&pmem->bb, offset / 512, sz_align)))
297297 return -EIO;
298− memcpy_from_pmem(buf, pmem->virt_addr + offset, size);
298+ return memcpy_from_pmem(buf, pmem->virt_addr + offset, size);
299299 } else {
300300 memcpy_to_pmem(pmem->virt_addr + offset, buf, size);
301301 wmb_pmem();
drivers/platform/goldfish/goldfish_pipe.c+1−2
@@ -309,8 +309,7 @@ static ssize_t goldfish_pipe_read_write(struct file *filp, char __user *buffer, · 308 unmodified lines
309309 * much memory to the process.
310310 */
311311 down_read(&current->mm->mmap_sem);
312− ret = get_user_pages(current, current->mm, address, 1,
313− !is_write, 0, &page, NULL);
312+ ret = get_user_pages(address, 1, !is_write, 0, &page, NULL);
314313 up_read(&current->mm->mmap_sem);
315314 if (ret < 0)
316315 break;
drivers/rapidio/devices/rio_mport_cdev.c+1−1
@@ -886,7 +886,7 @@ rio_dma_transfer(struct file *filp, uint32_t transfer_mode, · 885 unmodified lines
886886 }
887887
888888 down_read(&current->mm->mmap_sem);
889− pinned = get_user_pages(current, current->mm,
889+ pinned = get_user_pages(
890890 (unsigned long)xfer->loc_addr & PAGE_MASK,
891891 nr_pages, dir == DMA_FROM_DEVICE, 0,
892892 page_list, NULL);
drivers/remoteproc/st_remoteproc.c+2−2
@@ -189,9 +189,9 @@ static int st_rproc_parse_dt(struct platform_device *pdev) · 188 unmodified lines
189189 }
190190
191191 ddata->boot_base = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
192− if (!ddata->boot_base) {
192+ if (IS_ERR(ddata->boot_base)) {
193193 dev_err(dev, "Boot base not found\n");
194− return -EINVAL;
194+ return PTR_ERR(ddata->boot_base);
195195 }
196196
197197 err = of_property_read_u32_index(np, "st,syscfg", 1,
drivers/s390/block/dasd_alias.c+53−173
@@ -317,17 +317,17 @@ static int _add_device_to_lcu(struct alias_lcu *lcu, · 316 unmodified lines
317317 struct alias_pav_group *group;
318318 struct dasd_uid uid;
319319
320+ spin_lock(get_ccwdev_lock(device->cdev));
320321 private->uid.type = lcu->uac->unit[private->uid.real_unit_addr].ua_type;
321322 private->uid.base_unit_addr =
322323 lcu->uac->unit[private->uid.real_unit_addr].base_ua;
323324 uid = private->uid;
324−
325+ spin_unlock(get_ccwdev_lock(device->cdev));
325326 /* if we have no PAV anyway, we don't need to bother with PAV groups */
326327 if (lcu->pav == NO_PAV) {
327328 list_move(&device->alias_list, &lcu->active_devices);
328329 return 0;
329330 }
330−
331331 group = _find_group(lcu, &uid);
332332 if (!group) {
333333 group = kzalloc(sizeof(*group), GFP_ATOMIC);
@@ -397,130 +397,6 @@ suborder_not_supported(struct dasd_ccw_req *cqr) · 63 unmodified lines
397397 return 0;
398398 }
399399
400−/*
401− * This function tries to lock all devices on an lcu via trylock
402− * return NULL on success otherwise return first failed device
403− */
404−static struct dasd_device *_trylock_all_devices_on_lcu(struct alias_lcu *lcu,
405− struct dasd_device *pos)
406−
407−{
408− struct alias_pav_group *pavgroup;
409− struct dasd_device *device;
410−
411− list_for_each_entry(device, &lcu->active_devices, alias_list) {
412− if (device == pos)
413− continue;
414− if (!spin_trylock(get_ccwdev_lock(device->cdev)))
415− return device;
416− }
417− list_for_each_entry(device, &lcu->inactive_devices, alias_list) {
418− if (device == pos)
419− continue;
420− if (!spin_trylock(get_ccwdev_lock(device->cdev)))
421− return device;
422− }
423− list_for_each_entry(pavgroup, &lcu->grouplist, group) {
424− list_for_each_entry(device, &pavgroup->baselist, alias_list) {
425− if (device == pos)
426− continue;
427− if (!spin_trylock(get_ccwdev_lock(device->cdev)))
428− return device;
429− }
430− list_for_each_entry(device, &pavgroup->aliaslist, alias_list) {
431− if (device == pos)
432− continue;
433− if (!spin_trylock(get_ccwdev_lock(device->cdev)))
434− return device;
435− }
436− }
437− return NULL;
438−}
439−
440−/*
441− * unlock all devices except the one that is specified as pos
442− * stop if enddev is specified and reached
443− */
444−static void _unlock_all_devices_on_lcu(struct alias_lcu *lcu,
445− struct dasd_device *pos,
446− struct dasd_device *enddev)
447−
448−{
449− struct alias_pav_group *pavgroup;
450− struct dasd_device *device;
451−
452− list_for_each_entry(device, &lcu->active_devices, alias_list) {
453− if (device == pos)
454− continue;
455− if (device == enddev)
456− return;
457− spin_unlock(get_ccwdev_lock(device->cdev));
458− }
459− list_for_each_entry(device, &lcu->inactive_devices, alias_list) {
460− if (device == pos)
461− continue;
462− if (device == enddev)
463− return;
464− spin_unlock(get_ccwdev_lock(device->cdev));
465− }
466− list_for_each_entry(pavgroup, &lcu->grouplist, group) {
467− list_for_each_entry(device, &pavgroup->baselist, alias_list) {
468− if (device == pos)
469− continue;
470− if (device == enddev)
471− return;
472− spin_unlock(get_ccwdev_lock(device->cdev));
473− }
474− list_for_each_entry(device, &pavgroup->aliaslist, alias_list) {
475− if (device == pos)
476− continue;
477− if (device == enddev)
478− return;
479− spin_unlock(get_ccwdev_lock(device->cdev));
480− }
481− }
482−}
483−
484−/*
485− * this function is needed because the locking order
486− * device lock -> lcu lock
487− * needs to be assured when iterating over devices in an LCU
488− *
489− * if a device is specified in pos then the device lock is already hold
490− */
491−static void _trylock_and_lock_lcu_irqsave(struct alias_lcu *lcu,
492− struct dasd_device *pos,
493− unsigned long *flags)
494−{
495− struct dasd_device *failed;
496−
497− do {
498− spin_lock_irqsave(&lcu->lock, *flags);
499− failed = _trylock_all_devices_on_lcu(lcu, pos);
500− if (failed) {
501− _unlock_all_devices_on_lcu(lcu, pos, failed);
502− spin_unlock_irqrestore(&lcu->lock, *flags);
503− cpu_relax();
504− }
505− } while (failed);
506−}
507−
508−static void _trylock_and_lock_lcu(struct alias_lcu *lcu,
509− struct dasd_device *pos)
510−{
511− struct dasd_device *failed;
512−
513− do {
514− spin_lock(&lcu->lock);
515− failed = _trylock_all_devices_on_lcu(lcu, pos);
516− if (failed) {
517− _unlock_all_devices_on_lcu(lcu, pos, failed);
518− spin_unlock(&lcu->lock);
519− cpu_relax();
520− }
521− } while (failed);
522−}
523−
524400 static int read_unit_address_configuration(struct dasd_device *device,
525401 struct alias_lcu *lcu)
526402 {
@@ -615,7 +491,7 @@ static int _lcu_update(struct dasd_device *refdev, struct alias_lcu *lcu) · 88 unmodified lines
615491 if (rc)
616492 return rc;
617493
618− _trylock_and_lock_lcu_irqsave(lcu, NULL, &flags);
494+ spin_lock_irqsave(&lcu->lock, flags);
619495 lcu->pav = NO_PAV;
620496 for (i = 0; i < MAX_DEVICES_PER_LCU; ++i) {
621497 switch (lcu->uac->unit[i].ua_type) {
@@ -634,7 +510,6 @@ static int _lcu_update(struct dasd_device *refdev, struct alias_lcu *lcu) · 12 unmodified lines
634510 alias_list) {
635511 _add_device_to_lcu(lcu, device, refdev);
636512 }
637− _unlock_all_devices_on_lcu(lcu, NULL, NULL);
638513 spin_unlock_irqrestore(&lcu->lock, flags);
639514 return 0;
640515 }
@@ -722,8 +597,7 @@ int dasd_alias_add_device(struct dasd_device *device) · 81 unmodified lines
722597
723598 lcu = private->lcu;
724599 rc = 0;
725− spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
726− spin_lock(&lcu->lock);
600+ spin_lock_irqsave(&lcu->lock, flags);
727601 if (!(lcu->flags & UPDATE_PENDING)) {
728602 rc = _add_device_to_lcu(lcu, device, device);
729603 if (rc)
@@ -733,8 +607,7 @@ int dasd_alias_add_device(struct dasd_device *device) · 3 unmodified lines
733607 list_move(&device->alias_list, &lcu->active_devices);
734608 _schedule_lcu_update(lcu, device);
735609 }
736− spin_unlock(&lcu->lock);
737− spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
610+ spin_unlock_irqrestore(&lcu->lock, flags);
738611 return rc;
739612 }
740613
@@ -933,15 +806,27 @@ static void _stop_all_devices_on_lcu(struct alias_lcu *lcu) · 192 unmodified lines
933806 struct alias_pav_group *pavgroup;
934807 struct dasd_device *device;
935808
936− list_for_each_entry(device, &lcu->active_devices, alias_list)
809+ list_for_each_entry(device, &lcu->active_devices, alias_list) {
810+ spin_lock(get_ccwdev_lock(device->cdev));
937811 dasd_device_set_stop_bits(device, DASD_STOPPED_SU);
938− list_for_each_entry(device, &lcu->inactive_devices, alias_list)
812+ spin_unlock(get_ccwdev_lock(device->cdev));
813+ }
814+ list_for_each_entry(device, &lcu->inactive_devices, alias_list) {
815+ spin_lock(get_ccwdev_lock(device->cdev));
939816 dasd_device_set_stop_bits(device, DASD_STOPPED_SU);
817+ spin_unlock(get_ccwdev_lock(device->cdev));
818+ }
940819 list_for_each_entry(pavgroup, &lcu->grouplist, group) {
941− list_for_each_entry(device, &pavgroup->baselist, alias_list)
820+ list_for_each_entry(device, &pavgroup->baselist, alias_list) {
821+ spin_lock(get_ccwdev_lock(device->cdev));
942822 dasd_device_set_stop_bits(device, DASD_STOPPED_SU);
943− list_for_each_entry(device, &pavgroup->aliaslist, alias_list)
823+ spin_unlock(get_ccwdev_lock(device->cdev));
824+ }
825+ list_for_each_entry(device, &pavgroup->aliaslist, alias_list) {
826+ spin_lock(get_ccwdev_lock(device->cdev));
944827 dasd_device_set_stop_bits(device, DASD_STOPPED_SU);
828+ spin_unlock(get_ccwdev_lock(device->cdev));
829+ }
945830 }
946831 }
947832
@@ -950,15 +835,27 @@ static void _unstop_all_devices_on_lcu(struct alias_lcu *lcu) · 2 unmodified lines
950835 struct alias_pav_group *pavgroup;
951836 struct dasd_device *device;
952837
953− list_for_each_entry(device, &lcu->active_devices, alias_list)
838+ list_for_each_entry(device, &lcu->active_devices, alias_list) {
839+ spin_lock(get_ccwdev_lock(device->cdev));
954840 dasd_device_remove_stop_bits(device, DASD_STOPPED_SU);
955− list_for_each_entry(device, &lcu->inactive_devices, alias_list)
841+ spin_unlock(get_ccwdev_lock(device->cdev));
842+ }
843+ list_for_each_entry(device, &lcu->inactive_devices, alias_list) {
844+ spin_lock(get_ccwdev_lock(device->cdev));
956845 dasd_device_remove_stop_bits(device, DASD_STOPPED_SU);
846+ spin_unlock(get_ccwdev_lock(device->cdev));
847+ }
957848 list_for_each_entry(pavgroup, &lcu->grouplist, group) {
958− list_for_each_entry(device, &pavgroup->baselist, alias_list)
849+ list_for_each_entry(device, &pavgroup->baselist, alias_list) {
850+ spin_lock(get_ccwdev_lock(device->cdev));
959851 dasd_device_remove_stop_bits(device, DASD_STOPPED_SU);
960− list_for_each_entry(device, &pavgroup->aliaslist, alias_list)
852+ spin_unlock(get_ccwdev_lock(device->cdev));
853+ }
854+ list_for_each_entry(device, &pavgroup->aliaslist, alias_list) {
855+ spin_lock(get_ccwdev_lock(device->cdev));
961856 dasd_device_remove_stop_bits(device, DASD_STOPPED_SU);
857+ spin_unlock(get_ccwdev_lock(device->cdev));
858+ }
962859 }
963860 }
964861
@@ -984,48 +881,32 @@ static void summary_unit_check_handling_work(struct work_struct *work) · 19 unmodified lines
984881 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
985882 reset_summary_unit_check(lcu, device, suc_data->reason);
986883
987− _trylock_and_lock_lcu_irqsave(lcu, NULL, &flags);
884+ spin_lock_irqsave(&lcu->lock, flags);
988885 _unstop_all_devices_on_lcu(lcu);
989886 _restart_all_base_devices_on_lcu(lcu);
990887 /* 3. read new alias configuration */
991888 _schedule_lcu_update(lcu, device);
992889 lcu->suc_data.device = NULL;
993890 dasd_put_device(device);
994− _unlock_all_devices_on_lcu(lcu, NULL, NULL);
995891 spin_unlock_irqrestore(&lcu->lock, flags);
996892 }
997893
998−/*
999− * note: this will be called from int handler context (cdev locked)
1000− */
1001−void dasd_alias_handle_summary_unit_check(struct dasd_device *device,
1002− struct irb *irb)
894+void dasd_alias_handle_summary_unit_check(struct work_struct *work)
1003895 {
896+ struct dasd_device *device = container_of(work, struct dasd_device,
897+ suc_work);
1004898 struct dasd_eckd_private *private = device->private;
1005899 struct alias_lcu *lcu;
1006− char reason;
1007− char *sense;
1008−
1009− sense = dasd_get_sense(irb);
1010− if (sense) {
1011− reason = sense[8];
1012− DBF_DEV_EVENT(DBF_NOTICE, device, "%s %x",
1013− "eckd handle summary unit check: reason", reason);
1014− } else {
1015− DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1016− "eckd handle summary unit check:"
1017− " no reason code available");
1018− return;
1019− }
900+ unsigned long flags;
1020901
1021902 lcu = private->lcu;
1022903 if (!lcu) {
1023904 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1024905 "device not ready to handle summary"
1025906 " unit check (no lcu structure)");
1026− return;
907+ goto out;
1027908 }
1028− _trylock_and_lock_lcu(lcu, device);
909+ spin_lock_irqsave(&lcu->lock, flags);
1029910 /* If this device is about to be removed just return and wait for
1030911 * the next interrupt on a different device
1031912 */
@@ -1033,27 +914,26 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device, · 1 unmodified line
1033914 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1034915 "device is in offline processing,"
1035916 " don't do summary unit check handling");
1036− _unlock_all_devices_on_lcu(lcu, device, NULL);
1037− spin_unlock(&lcu->lock);
1038− return;
917+ goto out_unlock;
1039918 }
1040919 if (lcu->suc_data.device) {
1041920 /* already scheduled or running */
1042921 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1043922 "previous instance of summary unit check worker"
1044923 " still pending");
1045− _unlock_all_devices_on_lcu(lcu, device, NULL);
1046− spin_unlock(&lcu->lock);
1047− return ;
924+ goto out_unlock;
1048925 }
1049926 _stop_all_devices_on_lcu(lcu);
1050927 /* prepare for lcu_update */
1051− private->lcu->flags |= NEED_UAC_UPDATE | UPDATE_PENDING;
1052− lcu->suc_data.reason = reason;
928+ lcu->flags |= NEED_UAC_UPDATE | UPDATE_PENDING;
929+ lcu->suc_data.reason = private->suc_reason;
1053930 lcu->suc_data.device = device;
1054931 dasd_get_device(device);
1055− _unlock_all_devices_on_lcu(lcu, device, NULL);
1056− spin_unlock(&lcu->lock);
1057932 if (!schedule_work(&lcu->suc_data.worker))
1058933 dasd_put_device(device);
934+out_unlock:
935+ spin_unlock_irqrestore(&lcu->lock, flags);
936+out:
937+ clear_bit(DASD_FLAG_SUC, &device->flags);
938+ dasd_put_device(device);
1059939 };
drivers/s390/block/dasd_eckd.c+29−9
@@ -1682,6 +1682,8 @@ dasd_eckd_check_characteristics(struct dasd_device *device) · 1681 unmodified lines
16821682
16831683 /* setup work queue for validate server*/
16841684 INIT_WORK(&device->kick_validate, dasd_eckd_do_validate_server);
1685+ /* setup work queue for summary unit check */
1686+ INIT_WORK(&device->suc_work, dasd_alias_handle_summary_unit_check);
16851687
16861688 if (!ccw_device_is_pathgroup(device->cdev)) {
16871689 dev_warn(&device->cdev->dev,
@@ -2549,14 +2551,6 @@ static void dasd_eckd_check_for_device_change(struct dasd_device *device, · 861 unmodified lines
25492551 device->state == DASD_STATE_ONLINE &&
25502552 !test_bit(DASD_FLAG_OFFLINE, &device->flags) &&
25512553 !test_bit(DASD_FLAG_SUSPENDED, &device->flags)) {
2552− /*
2553− * the state change could be caused by an alias
2554− * reassignment remove device from alias handling
2555− * to prevent new requests from being scheduled on
2556− * the wrong alias device
2557− */
2558− dasd_alias_remove_device(device);
2559−
25602554 /* schedule worker to reload device */
25612555 dasd_reload_device(device);
25622556 }
@@ -2571,7 +2565,27 @@ static void dasd_eckd_check_for_device_change(struct dasd_device *device, · 8 unmodified lines
25712565 /* summary unit check */
25722566 if ((sense[27] & DASD_SENSE_BIT_0) && (sense[7] == 0x0D) &&
25732567 (scsw_dstat(&irb->scsw) & DEV_STAT_UNIT_CHECK)) {
2574− dasd_alias_handle_summary_unit_check(device, irb);
2568+ if (test_and_set_bit(DASD_FLAG_SUC, &device->flags)) {
2569+ DBF_DEV_EVENT(DBF_WARNING, device, "%s",
2570+ "eckd suc: device already notified");
2571+ return;
2572+ }
2573+ sense = dasd_get_sense(irb);
2574+ if (!sense) {
2575+ DBF_DEV_EVENT(DBF_WARNING, device, "%s",
2576+ "eckd suc: no reason code available");
2577+ clear_bit(DASD_FLAG_SUC, &device->flags);
2578+ return;
2579+
2580+ }
2581+ private->suc_reason = sense[8];
2582+ DBF_DEV_EVENT(DBF_NOTICE, device, "%s %x",
2583+ "eckd handle summary unit check: reason",
2584+ private->suc_reason);
2585+ dasd_get_device(device);
2586+ if (!schedule_work(&device->suc_work))
2587+ dasd_put_device(device);
2588+
25752589 return;
25762590 }
25772591
@@ -4495,6 +4509,12 @@ static int dasd_eckd_reload_device(struct dasd_device *device) · 1917 unmodified lines
44954509 struct dasd_uid uid;
44964510 unsigned long flags;
44974511
4512+ /*
4513+ * remove device from alias handling to prevent new requests
4514+ * from being scheduled on the wrong alias device
4515+ */
4516+ dasd_alias_remove_device(device);
4517+
44984518 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
44994519 old_base = private->uid.base_unit_addr;
45004520 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
drivers/s390/block/dasd_eckd.h+2−1
@@ -525,6 +525,7 @@ struct dasd_eckd_private { · 524 unmodified lines
525525 int count;
526526
527527 u32 fcx_max_data;
528+ char suc_reason;
528529 };
529530
530531
@@ -534,7 +535,7 @@ void dasd_alias_disconnect_device_from_lcu(struct dasd_device *); · 3 unmodified lines
534535 int dasd_alias_add_device(struct dasd_device *);
535536 int dasd_alias_remove_device(struct dasd_device *);
536537 struct dasd_device *dasd_alias_get_start_dev(struct dasd_device *);
537−void dasd_alias_handle_summary_unit_check(struct dasd_device *, struct irb *);
538+void dasd_alias_handle_summary_unit_check(struct work_struct *);
538539 void dasd_eckd_reset_ccw_to_base_io(struct dasd_ccw_req *);
539540 void dasd_alias_lcu_setup_complete(struct dasd_device *);
540541 void dasd_alias_wait_for_lcu_setup(struct dasd_device *);
drivers/s390/block/dasd_int.h+2−0
@@ -470,6 +470,7 @@ struct dasd_device { · 469 unmodified lines
470470 struct work_struct restore_device;
471471 struct work_struct reload_device;
472472 struct work_struct kick_validate;
473+ struct work_struct suc_work;
473474 struct timer_list timer;
474475
475476 debug_info_t *debug_area;
@@ -542,6 +543,7 @@ struct dasd_attention_data { · 66 unmodified lines
542543 #define DASD_FLAG_SAFE_OFFLINE_RUNNING 11 /* safe offline running */
543544 #define DASD_FLAG_ABORTALL 12 /* Abort all noretry requests */
544545 #define DASD_FLAG_PATH_VERIFY 13 /* Path verification worker running */
546+#define DASD_FLAG_SUC 14 /* unhandled summary unit check */
545547
546548 #define DASD_SLEEPON_START_TAG ((void *) 1)
547549 #define DASD_SLEEPON_END_TAG ((void *) 2)
drivers/target/iscsi/iscsi_target_configfs.c+11−17
@@ -779,14 +779,6 @@ static int lio_target_init_nodeacl(struct se_node_acl *se_nacl, · 778 unmodified lines
779779 return 0;
780780 }
781781
782−static void lio_target_cleanup_nodeacl( struct se_node_acl *se_nacl)
783−{
784− struct iscsi_node_acl *acl = container_of(se_nacl,
785− struct iscsi_node_acl, se_node_acl);
786−
787− configfs_remove_default_groups(&acl->se_node_acl.acl_fabric_stat_group);
788−}
789−
790782 /* End items for lio_target_acl_cit */
791783
792784 /* Start items for lio_target_tpg_attrib_cit */
@@ -1247,6 +1239,16 @@ static struct se_wwn *lio_target_call_coreaddtiqn( · 454 unmodified lines
12471239 if (IS_ERR(tiqn))
12481240 return ERR_CAST(tiqn);
12491241
1242+ pr_debug("LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->tiqn);
1243+ pr_debug("LIO_Target_ConfigFS: REGISTER -> Allocated Node:"
1244+ " %s\n", name);
1245+ return &tiqn->tiqn_wwn;
1246+}
1247+
1248+static void lio_target_add_wwn_groups(struct se_wwn *wwn)
1249+{
1250+ struct iscsi_tiqn *tiqn = container_of(wwn, struct iscsi_tiqn, tiqn_wwn);
1251+
12501252 config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_instance_group,
12511253 "iscsi_instance", &iscsi_stat_instance_cit);
12521254 configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_instance_group,
@@ -1271,12 +1273,6 @@ static struct se_wwn *lio_target_call_coreaddtiqn( · 18 unmodified lines
12711273 "iscsi_logout_stats", &iscsi_stat_logout_cit);
12721274 configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_logout_stats_group,
12731275 &tiqn->tiqn_wwn.fabric_stat_group);
1274−
1275−
1276− pr_debug("LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->tiqn);
1277− pr_debug("LIO_Target_ConfigFS: REGISTER -> Allocated Node:"
1278− " %s\n", name);
1279− return &tiqn->tiqn_wwn;
12801276 }
12811277
12821278 static void lio_target_call_coredeltiqn(
@@ -1284,8 +1280,6 @@ static void lio_target_call_coredeltiqn( · 1 unmodified line
12841280 {
12851281 struct iscsi_tiqn *tiqn = container_of(wwn, struct iscsi_tiqn, tiqn_wwn);
12861282
1287− configfs_remove_default_groups(&tiqn->tiqn_wwn.fabric_stat_group);
1288−
12891283 pr_debug("LIO_Target_ConfigFS: DEREGISTER -> %s\n",
12901284 tiqn->tiqn);
12911285 iscsit_del_tiqn(tiqn);
@@ -1660,12 +1654,12 @@ const struct target_core_fabric_ops iscsi_ops = { · 368 unmodified lines
16601654 .aborted_task = lio_aborted_task,
16611655 .fabric_make_wwn = lio_target_call_coreaddtiqn,
16621656 .fabric_drop_wwn = lio_target_call_coredeltiqn,
1657+ .add_wwn_groups = lio_target_add_wwn_groups,
16631658 .fabric_make_tpg = lio_target_tiqn_addtpg,
16641659 .fabric_drop_tpg = lio_target_tiqn_deltpg,
16651660 .fabric_make_np = lio_target_call_addnptotpg,
16661661 .fabric_drop_np = lio_target_call_delnpfromtpg,
16671662 .fabric_init_nodeacl = lio_target_init_nodeacl,
1668− .fabric_cleanup_nodeacl = lio_target_cleanup_nodeacl,
16691663
16701664 .tfc_discovery_attrs = lio_target_discovery_auth_attrs,
16711665 .tfc_wwn_attrs = lio_target_wwn_attrs,
drivers/target/target_core_fabric_configfs.c+13−11
@@ -338,10 +338,8 @@ static void target_fabric_nacl_base_release(struct config_item *item) · 337 unmodified lines
338338 {
339339 struct se_node_acl *se_nacl = container_of(to_config_group(item),
340340 struct se_node_acl, acl_group);
341− struct target_fabric_configfs *tf = se_nacl->se_tpg->se_tpg_wwn->wwn_tf;
342341
343− if (tf->tf_ops->fabric_cleanup_nodeacl)
344− tf->tf_ops->fabric_cleanup_nodeacl(se_nacl);
342+ configfs_remove_default_groups(&se_nacl->acl_fabric_stat_group);
345343 core_tpg_del_initiator_node_acl(se_nacl);
346344 }
347345
@@ -383,14 +381,6 @@ static struct config_group *target_fabric_make_nodeacl( · 35 unmodified lines
383381 if (IS_ERR(se_nacl))
384382 return ERR_CAST(se_nacl);
385383
386− if (tf->tf_ops->fabric_init_nodeacl) {
387− int ret = tf->tf_ops->fabric_init_nodeacl(se_nacl, name);
388− if (ret) {
389− core_tpg_del_initiator_node_acl(se_nacl);
390− return ERR_PTR(ret);
391− }
392− }
393−
394384 config_group_init_type_name(&se_nacl->acl_group, name,
395385 &tf->tf_tpg_nacl_base_cit);
396386
@@ -414,6 +404,15 @@ static struct config_group *target_fabric_make_nodeacl( · 17 unmodified lines
414404 configfs_add_default_group(&se_nacl->acl_fabric_stat_group,
415405 &se_nacl->acl_group);
416406
407+ if (tf->tf_ops->fabric_init_nodeacl) {
408+ int ret = tf->tf_ops->fabric_init_nodeacl(se_nacl, name);
409+ if (ret) {
410+ configfs_remove_default_groups(&se_nacl->acl_fabric_stat_group);
411+ core_tpg_del_initiator_node_acl(se_nacl);
412+ return ERR_PTR(ret);
413+ }
414+ }
415+
417416 return &se_nacl->acl_group;
418417 }
419418
@@ -892,6 +891,7 @@ static void target_fabric_release_wwn(struct config_item *item) · 472 unmodified lines
892891 struct se_wwn, wwn_group);
893892 struct target_fabric_configfs *tf = wwn->wwn_tf;
894893
894+ configfs_remove_default_groups(&wwn->fabric_stat_group);
895895 tf->tf_ops->fabric_drop_wwn(wwn);
896896 }
897897
@@ -945,6 +945,8 @@ static struct config_group *target_fabric_make_wwn( · 47 unmodified lines
945945 &tf->tf_wwn_fabric_stats_cit);
946946 configfs_add_default_group(&wwn->fabric_stat_group, &wwn->wwn_group);
947947
948+ if (tf->tf_ops->add_wwn_groups)
949+ tf->tf_ops->add_wwn_groups(wwn);
948950 return &wwn->wwn_group;
949951 }
950952
drivers/usb/serial/cp210x.c+1−0
@@ -165,6 +165,7 @@ static const struct usb_device_id id_table[] = { · 164 unmodified lines
165165 { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */
166166 { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */
167167 { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */
168+ { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
168169 { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */
169170 { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
170171 { USB_DEVICE(0x1B1C, 0x1C00) }, /* Corsair USB Dongle */
drivers/usb/serial/ftdi_sio.c+4−0
@@ -1004,6 +1004,10 @@ static const struct usb_device_id id_table_combined[] = { · 1003 unmodified lines
10041004 { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) },
10051005 { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) },
10061006 { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) },
1007+ /* ICP DAS I-756xU devices */
1008+ { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) },
1009+ { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) },
1010+ { USB_DEVICE(ICPDAS_VID, ICPDAS_I7563U_PID) },
10071011 { } /* Terminating entry */
10081012 };
10091013
drivers/usb/serial/ftdi_sio_ids.h+8−0
@@ -871,6 +871,14 @@ · 870 unmodified lines
871871 #define NOVITUS_VID 0x1a28
872872 #define NOVITUS_BONO_E_PID 0x6010
873873
874+/*
875+ * ICPDAS I-756*U devices
876+ */
877+#define ICPDAS_VID 0x1b5c
878+#define ICPDAS_I7560U_PID 0x0103
879+#define ICPDAS_I7561U_PID 0x0104
880+#define ICPDAS_I7563U_PID 0x0105
881+
874882 /*
875883 * RT Systems programming cables for various ham radios
876884 */
drivers/usb/serial/option.c+2−0
@@ -1818,6 +1818,8 @@ static const struct usb_device_id option_ids[] = { · 1817 unmodified lines
18181818 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d02, 0xff, 0x00, 0x00) },
18191819 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x02, 0x01) },
18201820 { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x7d03, 0xff, 0x00, 0x00) },
1821+ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e19, 0xff), /* D-Link DWM-221 B1 */
1822+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
18211823 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */
18221824 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */
18231825 { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */
fs/btrfs/disk-io.c+25−20
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 #include <linux/buffer_head.h>
2626 #include <linux/workqueue.h>
2727 #include <linux/kthread.h>
28−#include <linux/freezer.h>
2928 #include <linux/slab.h>
3029 #include <linux/migrate.h>
3130 #include <linux/ratelimit.h>
@@ -303,7 +302,7 @@ static int csum_tree_block(struct btrfs_fs_info *fs_info, · 271 unmodified lines
303302 err = map_private_extent_buffer(buf, offset, 32,
304303 &kaddr, &map_start, &map_len);
305304 if (err)
306− return 1;
305+ return err;
307306 cur_len = min(len, map_len - (offset - map_start));
308307 crc = btrfs_csum_data(kaddr + offset - map_start,
309308 crc, cur_len);
@@ -313,7 +312,7 @@ static int csum_tree_block(struct btrfs_fs_info *fs_info, · 3 unmodified lines
313312 if (csum_size > sizeof(inline_result)) {
314313 result = kzalloc(csum_size, GFP_NOFS);
315314 if (!result)
316− return 1;
315+ return -ENOMEM;
317316 } else {
318317 result = (char *)&inline_result;
319318 }
@@ -334,7 +333,7 @@ static int csum_tree_block(struct btrfs_fs_info *fs_info, · 14 unmodified lines
334333 val, found, btrfs_header_level(buf));
335334 if (result != (char *)&inline_result)
336335 kfree(result);
337− return 1;
336+ return -EUCLEAN;
338337 }
339338 } else {
340339 write_extent_buffer(buf, result, 0, csum_size);
@@ -513,11 +512,21 @@ static int csum_dirty_buffer(struct btrfs_fs_info *fs_info, struct page *page) · 172 unmodified lines
513512 eb = (struct extent_buffer *)page->private;
514513 if (page != eb->pages[0])
515514 return 0;
515+
516516 found_start = btrfs_header_bytenr(eb);
517− if (WARN_ON(found_start != start || !PageUptodate(page)))
518− return 0;
519− csum_tree_block(fs_info, eb, 0);
520− return 0;
517+ /*
518+ * Please do not consolidate these warnings into a single if.
519+ * It is useful to know what went wrong.
520+ */
521+ if (WARN_ON(found_start != start))
522+ return -EUCLEAN;
523+ if (WARN_ON(!PageUptodate(page)))
524+ return -EUCLEAN;
525+
526+ ASSERT(memcmp_extent_buffer(eb, fs_info->fsid,
527+ btrfs_header_fsid(), BTRFS_FSID_SIZE) == 0);
528+
529+ return csum_tree_block(fs_info, eb, 0);
521530 }
522531
523532 static int check_tree_block_fsid(struct btrfs_fs_info *fs_info,
@@ -661,10 +670,8 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio, · 137 unmodified lines
661670 eb, found_level);
662671
663672 ret = csum_tree_block(fs_info, eb, 1);
664− if (ret) {
665− ret = -EIO;
673+ if (ret)
666674 goto err;
667− }
668675
669676 /*
670677 * If this is a leaf block and it is corrupt, set the corrupt bit so
@@ -1831,7 +1838,7 @@ static int cleaner_kthread(void *arg) · 1160 unmodified lines
18311838 */
18321839 btrfs_delete_unused_bgs(root->fs_info);
18331840 sleep:
1834− if (!try_to_freeze() && !again) {
1841+ if (!again) {
18351842 set_current_state(TASK_INTERRUPTIBLE);
18361843 if (!kthread_should_stop())
18371844 schedule();
@@ -1921,14 +1928,12 @@ sleep: · 83 unmodified lines
19211928 if (unlikely(test_bit(BTRFS_FS_STATE_ERROR,
19221929 &root->fs_info->fs_state)))
19231930 btrfs_cleanup_transaction(root);
1924− if (!try_to_freeze()) {
1925− set_current_state(TASK_INTERRUPTIBLE);
1926− if (!kthread_should_stop() &&
1927− (!btrfs_transaction_blocked(root->fs_info) ||
1928− cannot_commit))
1929− schedule_timeout(delay);
1930− __set_current_state(TASK_RUNNING);
1931− }
1931+ set_current_state(TASK_INTERRUPTIBLE);
1932+ if (!kthread_should_stop() &&
1933+ (!btrfs_transaction_blocked(root->fs_info) ||
1934+ cannot_commit))
1935+ schedule_timeout(delay);
1936+ __set_current_state(TASK_RUNNING);
19321937 } while (!kthread_should_stop());
19331938 return 0;
19341939 }
fs/dlm/config.c+1−2
@@ -343,13 +343,12 @@ static struct config_group *make_cluster(struct config_group *g, · 342 unmodified lines
343343 struct dlm_cluster *cl = NULL;
344344 struct dlm_spaces *sps = NULL;
345345 struct dlm_comms *cms = NULL;
346− void *gps = NULL;
347346
348347 cl = kzalloc(sizeof(struct dlm_cluster), GFP_NOFS);
349348 sps = kzalloc(sizeof(struct dlm_spaces), GFP_NOFS);
350349 cms = kzalloc(sizeof(struct dlm_comms), GFP_NOFS);
351350
352− if (!cl || !gps || !sps || !cms)
351+ if (!cl || !sps || !cms)
353352 goto fail;
354353
355354 config_group_init_type_name(&cl->group, name, &cluster_type);
fs/namei.c+6−4
@@ -1740,15 +1740,17 @@ static int walk_component(struct nameidata *nd, int flags) · 1739 unmodified lines
17401740 nd->flags);
17411741 if (IS_ERR(path.dentry))
17421742 return PTR_ERR(path.dentry);
1743− if (unlikely(d_is_negative(path.dentry))) {
1744− dput(path.dentry);
1745− return -ENOENT;
1746− }
1743+
17471744 path.mnt = nd->path.mnt;
17481745 err = follow_managed(&path, nd);
17491746 if (unlikely(err < 0))
17501747 return err;
17511748
1749+ if (unlikely(d_is_negative(path.dentry))) {
1750+ path_to_nameidata(&path, nd);
1751+ return -ENOENT;
1752+ }
1753+
17521754 seq = 0; /* we are already out of RCU mode */
17531755 inode = d_backing_inode(path.dentry);
17541756 }
fs/orangefs/dir.c+3−5
@@ -235,7 +235,7 @@ get_new_buffer_index: · 234 unmodified lines
235235 if (ret == -EIO && op_state_purged(new_op)) {
236236 gossip_err("%s: Client is down. Aborting readdir call.\n",
237237 __func__);
238− goto out_slot;
238+ goto out_free_op;
239239 }
240240
241241 if (ret < 0 || new_op->downcall.status != 0) {
@@ -244,14 +244,14 @@ get_new_buffer_index: · 2 unmodified lines
244244 new_op->downcall.status);
245245 if (ret >= 0)
246246 ret = new_op->downcall.status;
247− goto out_slot;
247+ goto out_free_op;
248248 }
249249
250250 dents_buf = new_op->downcall.trailer_buf;
251251 if (dents_buf == NULL) {
252252 gossip_err("Invalid NULL buffer in readdir response\n");
253253 ret = -ENOMEM;
254− goto out_slot;
254+ goto out_free_op;
255255 }
256256
257257 bytes_decoded = decode_dirents(dents_buf, new_op->downcall.trailer_size,
@@ -363,8 +363,6 @@ out_destroy_handle: · 105 unmodified lines
363363 out_vfree:
364364 gossip_debug(GOSSIP_DIR_DEBUG, "vfree %p\n", dents_buf);
365365 vfree(dents_buf);
366−out_slot:
367− orangefs_readdir_index_put(buffer_index);
368366 out_free_op:
369367 op_release(new_op);
370368 gossip_debug(GOSSIP_DIR_DEBUG, "orangefs_readdir returning %d\n", ret);
fs/orangefs/protocol.h+1−1
@@ -407,7 +407,7 @@ enum { · 406 unmodified lines
407407 * space. Zero signifies the upstream version of the kernel module.
408408 */
409409 #define ORANGEFS_KERNEL_PROTO_VERSION 0
410−#define ORANGEFS_MINIMUM_USERSPACE_VERSION 20904
410+#define ORANGEFS_MINIMUM_USERSPACE_VERSION 20903
411411
412412 /*
413413 * describes memory regions to map in the ORANGEFS_DEV_MAP ioctl.
include/linux/atomic.h+17−17
@@ -559,25 +559,25 @@ static inline int atomic_dec_if_positive(atomic_t *v) · 558 unmodified lines
559559 #endif
560560
561561 /**
562− * fetch_or - perform *ptr |= mask and return old value of *ptr
563− * @ptr: pointer to value
564− * @mask: mask to OR on the value
565− *
566− * cmpxchg based fetch_or, macro so it works for different integer types
562+ * atomic_fetch_or - perform *p |= mask and return old value of *p
563+ * @p: pointer to atomic_t
564+ * @mask: mask to OR on the atomic_t
567565 */
568−#ifndef fetch_or
569−#define fetch_or(ptr, mask) \
570−({ typeof(*(ptr)) __old, __val = *(ptr); \
571− for (;;) { \
572− __old = cmpxchg((ptr), __val, __val | (mask)); \
573− if (__old == __val) \
574− break; \
575− __val = __old; \
576− } \
577− __old; \
578−})
579−#endif
566+#ifndef atomic_fetch_or
567+static inline int atomic_fetch_or(atomic_t *p, int mask)
568+{
569+ int old, val = atomic_read(p);
570+
571+ for (;;) {
572+ old = atomic_cmpxchg(p, val, val | mask);
573+ if (old == val)
574+ break;
575+ val = old;
576+ }
580577
578+ return old;
579+}
580+#endif
581581
582582 #ifdef CONFIG_GENERIC_ATOMIC64
583583 #include <asm-generic/atomic64.h>
include/linux/brcmphy.h+2−0
@@ -24,6 +24,8 @@ · 23 unmodified lines
2424 #define PHY_ID_BCM7250 0xae025280
2525 #define PHY_ID_BCM7364 0xae025260
2626 #define PHY_ID_BCM7366 0x600d8490
27+#define PHY_ID_BCM7346 0x600d8650
28+#define PHY_ID_BCM7362 0x600d84b0
2729 #define PHY_ID_BCM7425 0x600d86b0
2830 #define PHY_ID_BCM7429 0x600d8730
2931 #define PHY_ID_BCM7435 0x600d8750
include/linux/configfs.h+2−2
@@ -188,7 +188,7 @@ static struct configfs_bin_attribute _pfx##attr_##_name = { \ · 187 unmodified lines
188188 }
189189
190190 #define CONFIGFS_BIN_ATTR_RO(_pfx, _name, _priv, _maxsz) \
191−static struct configfs_attribute _pfx##attr_##_name = { \
191+static struct configfs_bin_attribute _pfx##attr_##_name = { \
192192 .cb_attr = { \
193193 .ca_name = __stringify(_name), \
194194 .ca_mode = S_IRUGO, \
@@ -200,7 +200,7 @@ static struct configfs_attribute _pfx##attr_##_name = { \ · 5 unmodified lines
200200 }
201201
202202 #define CONFIGFS_BIN_ATTR_WO(_pfx, _name, _priv, _maxsz) \
203−static struct configfs_attribute _pfx##attr_##_name = { \
203+static struct configfs_bin_attribute _pfx##attr_##_name = { \
204204 .cb_attr = { \
205205 .ca_name = __stringify(_name), \
206206 .ca_mode = S_IWUSR, \
include/linux/filter.h+4−0
@@ -465,10 +465,14 @@ int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog, · 464 unmodified lines
465465 void bpf_prog_destroy(struct bpf_prog *fp);
466466
467467 int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
468+int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk,
469+ bool locked);
468470 int sk_attach_bpf(u32 ufd, struct sock *sk);
469471 int sk_reuseport_attach_filter(struct sock_fprog *fprog, struct sock *sk);
470472 int sk_reuseport_attach_bpf(u32 ufd, struct sock *sk);
471473 int sk_detach_filter(struct sock *sk);
474+int __sk_detach_filter(struct sock *sk, bool locked);
475+
472476 int sk_get_filter(struct sock *sk, struct sock_filter __user *filter,
473477 unsigned int len);
474478
include/linux/huge_mm.h+1−1
@@ -127,7 +127,7 @@ static inline spinlock_t *pmd_trans_huge_lock(pmd_t *pmd, · 126 unmodified lines
127127 if (pmd_trans_huge(*pmd) || pmd_devmap(*pmd))
128128 return __pmd_trans_huge_lock(pmd, vma);
129129 else
130− return false;
130+ return NULL;
131131 }
132132 static inline int hpage_nr_pages(struct page *page)
133133 {
include/linux/netfilter/ipset/ip_set.h+4−0
@@ -234,6 +234,10 @@ struct ip_set { · 233 unmodified lines
234234 spinlock_t lock;
235235 /* References to the set */
236236 u32 ref;
237+ /* References to the set for netlink events like dump,
238+ * ref can be swapped out by ip_set_swap
239+ */
240+ u32 ref_netlink;
237241 /* The core set type */
238242 struct ip_set_type *type;
239243 /* The type variant doing the real job */
include/linux/pmem.h+16−6
@@ -42,6 +42,13 @@ static inline void arch_memcpy_to_pmem(void __pmem *dst, const void *src, · 41 unmodified lines
4242 BUG();
4343 }
4444
45+static inline int arch_memcpy_from_pmem(void *dst, const void __pmem *src,
46+ size_t n)
47+{
48+ BUG();
49+ return -EFAULT;
50+}
51+
4552 static inline size_t arch_copy_from_iter_pmem(void __pmem *addr, size_t bytes,
4653 struct iov_iter *i)
4754 {
@@ -66,14 +73,17 @@ static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) · 18 unmodified lines
6673 #endif
6774
6875 /*
69− * Architectures that define ARCH_HAS_PMEM_API must provide
70− * implementations for arch_memcpy_to_pmem(), arch_wmb_pmem(),
71− * arch_copy_from_iter_pmem(), arch_clear_pmem(), arch_wb_cache_pmem()
72− * and arch_has_wmb_pmem().
76+ * memcpy_from_pmem - read from persistent memory with error handling
77+ * @dst: destination buffer
78+ * @src: source buffer
79+ * @size: transfer length
80+ *
81+ * Returns 0 on success negative error code on failure.
7382 */
74−static inline void memcpy_from_pmem(void *dst, void __pmem const *src, size_t size)
83+static inline int memcpy_from_pmem(void *dst, void __pmem const *src,
84+ size_t size)
7585 {
76− memcpy(dst, (void __force const *) src, size);
86+ return arch_memcpy_from_pmem(dst, src, size);
7787 }
7888
7989 static inline bool arch_has_pmem_api(void)
include/linux/sched.h+2−2
@@ -720,7 +720,7 @@ struct signal_struct { · 719 unmodified lines
720720 struct task_cputime cputime_expires;
721721
722722 #ifdef CONFIG_NO_HZ_FULL
723− unsigned long tick_dep_mask;
723+ atomic_t tick_dep_mask;
724724 #endif
725725
726726 struct list_head cpu_timers[3];
@@ -1549,7 +1549,7 @@ struct task_struct { · 822 unmodified lines
15491549 #endif
15501550
15511551 #ifdef CONFIG_NO_HZ_FULL
1552− unsigned long tick_dep_mask;
1552+ atomic_t tick_dep_mask;
15531553 #endif
15541554 unsigned long nvcsw, nivcsw; /* context switch counts */
15551555 u64 start_time; /* monotonic time in nsec */
include/linux/stmmac.h+0−1
@@ -108,7 +108,6 @@ struct stmmac_axi { · 107 unmodified lines
108108 };
109109
110110 struct plat_stmmacenet_data {
111− char *phy_bus_name;
112111 int bus_id;
113112 int phy_addr;
114113 int interface;
include/target/target_core_fabric.h+1−1
@@ -76,6 +76,7 @@ struct target_core_fabric_ops { · 75 unmodified lines
7676 struct se_wwn *(*fabric_make_wwn)(struct target_fabric_configfs *,
7777 struct config_group *, const char *);
7878 void (*fabric_drop_wwn)(struct se_wwn *);
79+ void (*add_wwn_groups)(struct se_wwn *);
7980 struct se_portal_group *(*fabric_make_tpg)(struct se_wwn *,
8081 struct config_group *, const char *);
8182 void (*fabric_drop_tpg)(struct se_portal_group *);
@@ -87,7 +88,6 @@ struct target_core_fabric_ops { · 5 unmodified lines
8788 struct config_group *, const char *);
8889 void (*fabric_drop_np)(struct se_tpg_np *);
8990 int (*fabric_init_nodeacl)(struct se_node_acl *, const char *);
90− void (*fabric_cleanup_nodeacl)(struct se_node_acl *);
9191
9292 struct configfs_attribute **tfc_discovery_attrs;
9393 struct configfs_attribute **tfc_wwn_attrs;
include/trace/events/page_isolation.h+1−1
@@ -29,7 +29,7 @@ TRACE_EVENT(test_pages_isolated, · 28 unmodified lines
2929
3030 TP_printk("start_pfn=0x%lx end_pfn=0x%lx fin_pfn=0x%lx ret=%s",
3131 __entry->start_pfn, __entry->end_pfn, __entry->fin_pfn,
32− __entry->end_pfn == __entry->fin_pfn ? "success" : "fail")
32+ __entry->end_pfn <= __entry->fin_pfn ? "success" : "fail")
3333 );
3434
3535 #endif /* _TRACE_PAGE_ISOLATION_H */
include/uapi/linux/bpf.h+1−0
@@ -375,6 +375,7 @@ struct bpf_tunnel_key { · 374 unmodified lines
375375 };
376376 __u8 tunnel_tos;
377377 __u8 tunnel_ttl;
378+ __u16 tunnel_ext;
378379 __u32 tunnel_label;
379380 };
380381
include/uapi/linux/stddef.h+4−0
@@ -1 +1,5 @@
11 #include <linux/compiler.h>
2+
3+#ifndef __always_inline
4+#define __always_inline inline
5+#endif
init/Kconfig+2−1
@@ -272,8 +272,9 @@ config CROSS_MEMORY_ATTACH · 271 unmodified lines
272272 See the man page for more details.
273273
274274 config FHANDLE
275− bool "open by fhandle syscalls"
275+ bool "open by fhandle syscalls" if EXPERT
276276 select EXPORTFS
277+ default y
277278 help
278279 If you say Y here, a user level program will be able to map
279280 file names to handle and then later use the handle for
kernel/bpf/syscall.c+4−2
@@ -137,11 +137,13 @@ static void bpf_map_show_fdinfo(struct seq_file *m, struct file *filp) · 136 unmodified lines
137137 "map_type:\t%u\n"
138138 "key_size:\t%u\n"
139139 "value_size:\t%u\n"
140− "max_entries:\t%u\n",
140+ "max_entries:\t%u\n"
141+ "map_flags:\t%#x\n",
141142 map->map_type,
142143 map->key_size,
143144 map->value_size,
144− map->max_entries);
145+ map->max_entries,
146+ map->map_flags);
145147 }
146148 #endif
147149
kernel/events/core.c+13−2
@@ -2417,14 +2417,24 @@ static void ctx_sched_out(struct perf_event_context *ctx, · 2416 unmodified lines
24172417 cpuctx->task_ctx = NULL;
24182418 }
24192419
2420− is_active ^= ctx->is_active; /* changed bits */
2421−
2420+ /*
2421+ * Always update time if it was set; not only when it changes.
2422+ * Otherwise we can 'forget' to update time for any but the last
2423+ * context we sched out. For example:
2424+ *
2425+ * ctx_sched_out(.event_type = EVENT_FLEXIBLE)
2426+ * ctx_sched_out(.event_type = EVENT_PINNED)
2427+ *
2428+ * would only update time for the pinned events.
2429+ */
24222430 if (is_active & EVENT_TIME) {
24232431 /* update (and stop) ctx time */
24242432 update_context_time(ctx);
24252433 update_cgrp_time_from_cpuctx(cpuctx);
24262434 }
24272435
2436+ is_active ^= ctx->is_active; /* changed bits */
2437+
24282438 if (!ctx->nr_active || !(is_active & EVENT_ALL))
24292439 return;
24302440
@@ -8532,6 +8542,7 @@ SYSCALL_DEFINE5(perf_event_open, · 6101 unmodified lines
85328542 f_flags);
85338543 if (IS_ERR(event_file)) {
85348544 err = PTR_ERR(event_file);
8545+ event_file = NULL;
85358546 goto err_context;
85368547 }
85378548
kernel/locking/lockdep.c+77−2
@@ -1999,6 +1999,77 @@ static inline int get_first_held_lock(struct task_struct *curr, · 1998 unmodified lines
19991999 return ++i;
20002000 }
20012001
2002+/*
2003+ * Returns the next chain_key iteration
2004+ */
2005+static u64 print_chain_key_iteration(int class_idx, u64 chain_key)
2006+{
2007+ u64 new_chain_key = iterate_chain_key(chain_key, class_idx);
2008+
2009+ printk(" class_idx:%d -> chain_key:%016Lx",
2010+ class_idx,
2011+ (unsigned long long)new_chain_key);
2012+ return new_chain_key;
2013+}
2014+
2015+static void
2016+print_chain_keys_held_locks(struct task_struct *curr, struct held_lock *hlock_next)
2017+{
2018+ struct held_lock *hlock;
2019+ u64 chain_key = 0;
2020+ int depth = curr->lockdep_depth;
2021+ int i;
2022+
2023+ printk("depth: %u\n", depth + 1);
2024+ for (i = get_first_held_lock(curr, hlock_next); i < depth; i++) {
2025+ hlock = curr->held_locks + i;
2026+ chain_key = print_chain_key_iteration(hlock->class_idx, chain_key);
2027+
2028+ print_lock(hlock);
2029+ }
2030+
2031+ print_chain_key_iteration(hlock_next->class_idx, chain_key);
2032+ print_lock(hlock_next);
2033+}
2034+
2035+static void print_chain_keys_chain(struct lock_chain *chain)
2036+{
2037+ int i;
2038+ u64 chain_key = 0;
2039+ int class_id;
2040+
2041+ printk("depth: %u\n", chain->depth);
2042+ for (i = 0; i < chain->depth; i++) {
2043+ class_id = chain_hlocks[chain->base + i];
2044+ chain_key = print_chain_key_iteration(class_id + 1, chain_key);
2045+
2046+ print_lock_name(lock_classes + class_id);
2047+ printk("\n");
2048+ }
2049+}
2050+
2051+static void print_collision(struct task_struct *curr,
2052+ struct held_lock *hlock_next,
2053+ struct lock_chain *chain)
2054+{
2055+ printk("\n");
2056+ printk("======================\n");
2057+ printk("[chain_key collision ]\n");
2058+ print_kernel_ident();
2059+ printk("----------------------\n");
2060+ printk("%s/%d: ", current->comm, task_pid_nr(current));
2061+ printk("Hash chain already cached but the contents don't match!\n");
2062+
2063+ printk("Held locks:");
2064+ print_chain_keys_held_locks(curr, hlock_next);
2065+
2066+ printk("Locks in cached chain:");
2067+ print_chain_keys_chain(chain);
2068+
2069+ printk("\nstack backtrace:\n");
2070+ dump_stack();
2071+}
2072+
20022073 /*
20032074 * Checks whether the chain and the current held locks are consistent
20042075 * in depth and also in content. If they are not it most likely means
@@ -2014,14 +2085,18 @@ static int check_no_collision(struct task_struct *curr, · 9 unmodified lines
20142085
20152086 i = get_first_held_lock(curr, hlock);
20162087
2017− if (DEBUG_LOCKS_WARN_ON(chain->depth != curr->lockdep_depth - (i - 1)))
2088+ if (DEBUG_LOCKS_WARN_ON(chain->depth != curr->lockdep_depth - (i - 1))) {
2089+ print_collision(curr, hlock, chain);
20182090 return 0;
2091+ }
20192092
20202093 for (j = 0; j < chain->depth - 1; j++, i++) {
20212094 id = curr->held_locks[i].class_idx - 1;
20222095
2023− if (DEBUG_LOCKS_WARN_ON(chain_hlocks[chain->base + j] != id))
2096+ if (DEBUG_LOCKS_WARN_ON(chain_hlocks[chain->base + j] != id)) {
2097+ print_collision(curr, hlock, chain);
20242098 return 0;
2099+ }
20252100 }
20262101 #endif
20272102 return 1;
kernel/sched/core.c+18−0
@@ -321,6 +321,24 @@ static inline void init_hrtick(void) · 320 unmodified lines
321321 }
322322 #endif /* CONFIG_SCHED_HRTICK */
323323
324+/*
325+ * cmpxchg based fetch_or, macro so it works for different integer types
326+ */
327+#define fetch_or(ptr, mask) \
328+ ({ \
329+ typeof(ptr) _ptr = (ptr); \
330+ typeof(mask) _mask = (mask); \
331+ typeof(*_ptr) _old, _val = *_ptr; \
332+ \
333+ for (;;) { \
334+ _old = cmpxchg(_ptr, _val, _val | _mask); \
335+ if (_old == _val) \
336+ break; \
337+ _val = _old; \
338+ } \
339+ _old; \
340+})
341+
324342 #if defined(CONFIG_SMP) && defined(TIF_POLLING_NRFLAG)
325343 /*
326344 * Atomically set TIF_NEED_RESCHED and test for TIF_POLLING_NRFLAG,
kernel/time/tick-sched.c+30−31
@@ -157,52 +157,50 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) · 156 unmodified lines
157157 cpumask_var_t tick_nohz_full_mask;
158158 cpumask_var_t housekeeping_mask;
159159 bool tick_nohz_full_running;
160−static unsigned long tick_dep_mask;
160+static atomic_t tick_dep_mask;
161161
162−static void trace_tick_dependency(unsigned long dep)
162+static bool check_tick_dependency(atomic_t *dep)
163163 {
164− if (dep & TICK_DEP_MASK_POSIX_TIMER) {
164+ int val = atomic_read(dep);
165+
166+ if (val & TICK_DEP_MASK_POSIX_TIMER) {
165167 trace_tick_stop(0, TICK_DEP_MASK_POSIX_TIMER);
166− return;
168+ return true;
167169 }
168170
169− if (dep & TICK_DEP_MASK_PERF_EVENTS) {
171+ if (val & TICK_DEP_MASK_PERF_EVENTS) {
170172 trace_tick_stop(0, TICK_DEP_MASK_PERF_EVENTS);
171− return;
173+ return true;
172174 }
173175
174− if (dep & TICK_DEP_MASK_SCHED) {
176+ if (val & TICK_DEP_MASK_SCHED) {
175177 trace_tick_stop(0, TICK_DEP_MASK_SCHED);
176− return;
178+ return true;
177179 }
178180
179− if (dep & TICK_DEP_MASK_CLOCK_UNSTABLE)
181+ if (val & TICK_DEP_MASK_CLOCK_UNSTABLE) {
180182 trace_tick_stop(0, TICK_DEP_MASK_CLOCK_UNSTABLE);
183+ return true;
184+ }
185+
186+ return false;
181187 }
182188
183189 static bool can_stop_full_tick(struct tick_sched *ts)
184190 {
185191 WARN_ON_ONCE(!irqs_disabled());
186192
187− if (tick_dep_mask) {
188− trace_tick_dependency(tick_dep_mask);
193+ if (check_tick_dependency(&tick_dep_mask))
189194 return false;
190− }
191195
192− if (ts->tick_dep_mask) {
193− trace_tick_dependency(ts->tick_dep_mask);
196+ if (check_tick_dependency(&ts->tick_dep_mask))
194197 return false;
195− }
196198
197− if (current->tick_dep_mask) {
198− trace_tick_dependency(current->tick_dep_mask);
199+ if (check_tick_dependency(&current->tick_dep_mask))
199200 return false;
200− }
201201
202− if (current->signal->tick_dep_mask) {
203− trace_tick_dependency(current->signal->tick_dep_mask);
202+ if (check_tick_dependency(&current->signal->tick_dep_mask))
204203 return false;
205− }
206204
207205 return true;
208206 }
@@ -259,12 +257,12 @@ static void tick_nohz_full_kick_all(void) · 50 unmodified lines
259257 preempt_enable();
260258 }
261259
262−static void tick_nohz_dep_set_all(unsigned long *dep,
260+static void tick_nohz_dep_set_all(atomic_t *dep,
263261 enum tick_dep_bits bit)
264262 {
265− unsigned long prev;
263+ int prev;
266264
267− prev = fetch_or(dep, BIT_MASK(bit));
265+ prev = atomic_fetch_or(dep, BIT(bit));
268266 if (!prev)
269267 tick_nohz_full_kick_all();
270268 }
@@ -280,7 +278,7 @@ void tick_nohz_dep_set(enum tick_dep_bits bit) · 9 unmodified lines
280278
281279 void tick_nohz_dep_clear(enum tick_dep_bits bit)
282280 {
283− clear_bit(bit, &tick_dep_mask);
281+ atomic_andnot(BIT(bit), &tick_dep_mask);
284282 }
285283
286284 /*
@@ -289,12 +287,12 @@ void tick_nohz_dep_clear(enum tick_dep_bits bit) · 2 unmodified lines
289287 */
290288 void tick_nohz_dep_set_cpu(int cpu, enum tick_dep_bits bit)
291289 {
292− unsigned long prev;
290+ int prev;
293291 struct tick_sched *ts;
294292
295293 ts = per_cpu_ptr(&tick_cpu_sched, cpu);
296294
297− prev = fetch_or(&ts->tick_dep_mask, BIT_MASK(bit));
295+ prev = atomic_fetch_or(&ts->tick_dep_mask, BIT(bit));
298296 if (!prev) {
299297 preempt_disable();
300298 /* Perf needs local kick that is NMI safe */
@@ -313,7 +311,7 @@ void tick_nohz_dep_clear_cpu(int cpu, enum tick_dep_bits bit) · 12 unmodified lines
313311 {
314312 struct tick_sched *ts = per_cpu_ptr(&tick_cpu_sched, cpu);
315313
316− clear_bit(bit, &ts->tick_dep_mask);
314+ atomic_andnot(BIT(bit), &ts->tick_dep_mask);
317315 }
318316
319317 /*
@@ -331,7 +329,7 @@ void tick_nohz_dep_set_task(struct task_struct *tsk, enum tick_dep_bits bit) · 11 unmodified lines
331329
332330 void tick_nohz_dep_clear_task(struct task_struct *tsk, enum tick_dep_bits bit)
333331 {
334− clear_bit(bit, &tsk->tick_dep_mask);
332+ atomic_andnot(BIT(bit), &tsk->tick_dep_mask);
335333 }
336334
337335 /*
@@ -345,7 +343,7 @@ void tick_nohz_dep_set_signal(struct signal_struct *sig, enum tick_dep_bits bit) · 7 unmodified lines
345343
346344 void tick_nohz_dep_clear_signal(struct signal_struct *sig, enum tick_dep_bits bit)
347345 {
348− clear_bit(bit, &sig->tick_dep_mask);
346+ atomic_andnot(BIT(bit), &sig->tick_dep_mask);
349347 }
350348
351349 /*
@@ -366,7 +364,8 @@ void __tick_nohz_task_switch(void) · 14 unmodified lines
366364 ts = this_cpu_ptr(&tick_cpu_sched);
367365
368366 if (ts->tick_stopped) {
369− if (current->tick_dep_mask || current->signal->tick_dep_mask)
367+ if (atomic_read(&current->tick_dep_mask) ||
368+ atomic_read(&current->signal->tick_dep_mask))
370369 tick_nohz_full_kick();
371370 }
372371 out:
kernel/time/tick-sched.h+1−1
@@ -60,7 +60,7 @@ struct tick_sched { · 59 unmodified lines
6060 u64 next_timer;
6161 ktime_t idle_expires;
6262 int do_timer_last;
63− unsigned long tick_dep_mask;
63+ atomic_t tick_dep_mask;
6464 };
6565
6666 extern struct tick_sched *tick_get_tick_sched(int cpu);
mm/kasan/kasan.c+1−1
@@ -498,7 +498,7 @@ void kasan_slab_free(struct kmem_cache *cache, void *object) · 497 unmodified lines
498498 struct kasan_alloc_meta *alloc_info =
499499 get_alloc_info(cache, object);
500500 alloc_info->state = KASAN_STATE_FREE;
501− set_track(&free_info->track);
501+ set_track(&free_info->track, GFP_NOWAIT);
502502 }
503503 #endif
504504
mm/oom_kill.c+5−1
@@ -547,7 +547,11 @@ static int oom_reaper(void *unused) · 546 unmodified lines
547547
548548 static void wake_oom_reaper(struct task_struct *tsk)
549549 {
550− if (!oom_reaper_th || tsk->oom_reaper_list)
550+ if (!oom_reaper_th)
551+ return;
552+
553+ /* tsk is already queued? */
554+ if (tsk == oom_reaper_list || tsk->oom_reaper_list)
551555 return;
552556
553557 get_task_struct(tsk);
mm/page_isolation.c+5−5
@@ -215,7 +215,7 @@ int undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, · 214 unmodified lines
215215 * all pages in [start_pfn...end_pfn) must be in the same zone.
216216 * zone->lock must be held before call this.
217217 *
218− * Returns 1 if all pages in the range are isolated.
218+ * Returns the last tested pfn.
219219 */
220220 static unsigned long
221221 __test_page_isolated_in_pageblock(unsigned long pfn, unsigned long end_pfn,
@@ -289,11 +289,11 @@ struct page *alloc_migrate_target(struct page *page, unsigned long private, · 67 unmodified lines
289289 * now as a simple work-around, we use the next node for destination.
290290 */
291291 if (PageHuge(page)) {
292− nodemask_t src = nodemask_of_node(page_to_nid(page));
293− nodemask_t dst;
294− nodes_complement(dst, src);
292+ int node = next_online_node(page_to_nid(page));
293+ if (node == MAX_NUMNODES)
294+ node = first_online_node;
295295 return alloc_huge_page_node(page_hstate(compound_head(page)),
296− next_node(page_to_nid(page), dst));
296+ node);
297297 }
298298
299299 if (PageHighMem(page))
mm/rmap.c+7−21
@@ -569,19 +569,6 @@ void page_unlock_anon_vma_read(struct anon_vma *anon_vma) · 568 unmodified lines
569569 }
570570
571571 #ifdef CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
572−static void percpu_flush_tlb_batch_pages(void *data)
573−{
574− /*
575− * All TLB entries are flushed on the assumption that it is
576− * cheaper to flush all TLBs and let them be refilled than
577− * flushing individual PFNs. Note that we do not track mm's
578− * to flush as that might simply be multiple full TLB flushes
579− * for no gain.
580− */
581− count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED);
582− flush_tlb_local();
583−}
584−
585572 /*
586573 * Flush TLB entries for recently unmapped pages from remote CPUs. It is
587574 * important if a PTE was dirty when it was unmapped that it's flushed
@@ -598,15 +585,14 @@ void try_to_unmap_flush(void) · 10 unmodified lines
598585
599586 cpu = get_cpu();
600587
601− trace_tlb_flush(TLB_REMOTE_SHOOTDOWN, -1UL);
602−
603− if (cpumask_test_cpu(cpu, &tlb_ubc->cpumask))
604− percpu_flush_tlb_batch_pages(&tlb_ubc->cpumask);
605−
606− if (cpumask_any_but(&tlb_ubc->cpumask, cpu) < nr_cpu_ids) {
607− smp_call_function_many(&tlb_ubc->cpumask,
608− percpu_flush_tlb_batch_pages, (void *)tlb_ubc, true);
588+ if (cpumask_test_cpu(cpu, &tlb_ubc->cpumask)) {
589+ count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
590+ local_flush_tlb();
591+ trace_tlb_flush(TLB_LOCAL_SHOOTDOWN, TLB_FLUSH_ALL);
609592 }
593+
594+ if (cpumask_any_but(&tlb_ubc->cpumask, cpu) < nr_cpu_ids)
595+ flush_tlb_others(&tlb_ubc->cpumask, NULL, 0, TLB_FLUSH_ALL);
610596 cpumask_clear(&tlb_ubc->cpumask);
611597 tlb_ubc->flush_required = false;
612598 tlb_ubc->writable = false;
net/bridge/br_stp.c+1−1
@@ -582,7 +582,7 @@ int br_set_ageing_time(struct net_bridge *br, u32 ageing_time) · 581 unmodified lines
582582 int err;
583583
584584 err = switchdev_port_attr_set(br->dev, &attr);
585− if (err)
585+ if (err && err != -EOPNOTSUPP)
586586 return err;
587587
588588 br->ageing_time = t;
net/bridge/netfilter/ebtables.c+4−0
@@ -1521,6 +1521,8 @@ static int do_ebt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) · 1520 unmodified lines
15211521 if (copy_from_user(&tmp, user, sizeof(tmp)))
15221522 return -EFAULT;
15231523
1524+ tmp.name[sizeof(tmp.name) - 1] = '\0';
1525+
15241526 t = find_table_lock(net, tmp.name, &ret, &ebt_mutex);
15251527 if (!t)
15261528 return ret;
@@ -2332,6 +2334,8 @@ static int compat_do_ebt_get_ctl(struct sock *sk, int cmd, · 805 unmodified lines
23322334 if (copy_from_user(&tmp, user, sizeof(tmp)))
23332335 return -EFAULT;
23342336
2337+ tmp.name[sizeof(tmp.name) - 1] = '\0';
2338+
23352339 t = find_table_lock(net, tmp.name, &ret, &ebt_mutex);
23362340 if (!t)
23372341 return ret;
net/bridge/netfilter/nft_reject_bridge.c+10−10
@@ -40,7 +40,8 @@ static void nft_reject_br_push_etherhdr(struct sk_buff *oldskb, · 39 unmodified lines
4040 /* We cannot use oldskb->dev, it can be either bridge device (NF_BRIDGE INPUT)
4141 * or the bridge port (NF_BRIDGE PREROUTING).
4242 */
43−static void nft_reject_br_send_v4_tcp_reset(struct sk_buff *oldskb,
43+static void nft_reject_br_send_v4_tcp_reset(struct net *net,
44+ struct sk_buff *oldskb,
4445 const struct net_device *dev,
4546 int hook)
4647 {
@@ -48,7 +49,6 @@ static void nft_reject_br_send_v4_tcp_reset(struct sk_buff *oldskb, · 1 unmodified line
4849 struct iphdr *niph;
4950 const struct tcphdr *oth;
5051 struct tcphdr _oth;
51− struct net *net = sock_net(oldskb->sk);
5252
5353 if (!nft_bridge_iphdr_validate(oldskb))
5454 return;
@@ -75,7 +75,8 @@ static void nft_reject_br_send_v4_tcp_reset(struct sk_buff *oldskb, · 20 unmodified lines
7575 br_deliver(br_port_get_rcu(dev), nskb);
7676 }
7777
78−static void nft_reject_br_send_v4_unreach(struct sk_buff *oldskb,
78+static void nft_reject_br_send_v4_unreach(struct net *net,
79+ struct sk_buff *oldskb,
7980 const struct net_device *dev,
8081 int hook, u8 code)
8182 {
@@ -86,7 +87,6 @@ static void nft_reject_br_send_v4_unreach(struct sk_buff *oldskb, · 4 unmodified lines
8687 void *payload;
8788 __wsum csum;
8889 u8 proto;
89− struct net *net = sock_net(oldskb->sk);
9090
9191 if (oldskb->csum_bad || !nft_bridge_iphdr_validate(oldskb))
9292 return;
@@ -273,17 +273,17 @@ static void nft_reject_bridge_eval(const struct nft_expr *expr, · 180 unmodified lines
273273 case htons(ETH_P_IP):
274274 switch (priv->type) {
275275 case NFT_REJECT_ICMP_UNREACH:
276− nft_reject_br_send_v4_unreach(pkt->skb, pkt->in,
277− pkt->hook,
276+ nft_reject_br_send_v4_unreach(pkt->net, pkt->skb,
277+ pkt->in, pkt->hook,
278278 priv->icmp_code);
279279 break;
280280 case NFT_REJECT_TCP_RST:
281− nft_reject_br_send_v4_tcp_reset(pkt->skb, pkt->in,
282− pkt->hook);
281+ nft_reject_br_send_v4_tcp_reset(pkt->net, pkt->skb,
282+ pkt->in, pkt->hook);
283283 break;
284284 case NFT_REJECT_ICMPX_UNREACH:
285− nft_reject_br_send_v4_unreach(pkt->skb, pkt->in,
286− pkt->hook,
285+ nft_reject_br_send_v4_unreach(pkt->net, pkt->skb,
286+ pkt->in, pkt->hook,
287287 nft_reject_icmp_code(priv->icmp_code));
288288 break;
289289 }
net/core/filter.c+25−13
@@ -1149,7 +1149,8 @@ void bpf_prog_destroy(struct bpf_prog *fp) · 1148 unmodified lines
11491149 }
11501150 EXPORT_SYMBOL_GPL(bpf_prog_destroy);
11511151
1152−static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk)
1152+static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk,
1153+ bool locked)
11531154 {
11541155 struct sk_filter *fp, *old_fp;
11551156
@@ -1165,10 +1166,8 @@ static int __sk_attach_prog(struct bpf_prog *prog, struct sock *sk) · 9 unmodified lines
11651166 return -ENOMEM;
11661167 }
11671168
1168− old_fp = rcu_dereference_protected(sk->sk_filter,
1169− sock_owned_by_user(sk));
1169+ old_fp = rcu_dereference_protected(sk->sk_filter, locked);
11701170 rcu_assign_pointer(sk->sk_filter, fp);
1171−
11721171 if (old_fp)
11731172 sk_filter_uncharge(sk, old_fp);
11741173
@@ -1247,7 +1246,8 @@ struct bpf_prog *__get_filter(struct sock_fprog *fprog, struct sock *sk) · 72 unmodified lines
12471246 * occurs or there is insufficient memory for the filter a negative
12481247 * errno code is returned. On success the return is zero.
12491248 */
1250−int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
1249+int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk,
1250+ bool locked)
12511251 {
12521252 struct bpf_prog *prog = __get_filter(fprog, sk);
12531253 int err;
@@ -1255,7 +1255,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) · 1 unmodified line
12551255 if (IS_ERR(prog))
12561256 return PTR_ERR(prog);
12571257
1258− err = __sk_attach_prog(prog, sk);
1258+ err = __sk_attach_prog(prog, sk, locked);
12591259 if (err < 0) {
12601260 __bpf_prog_release(prog);
12611261 return err;
@@ -1263,7 +1263,12 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) · 1 unmodified line
12631263
12641264 return 0;
12651265 }
1266−EXPORT_SYMBOL_GPL(sk_attach_filter);
1266+EXPORT_SYMBOL_GPL(__sk_attach_filter);
1267+
1268+int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
1269+{
1270+ return __sk_attach_filter(fprog, sk, sock_owned_by_user(sk));
1271+}
12671272
12681273 int sk_reuseport_attach_filter(struct sock_fprog *fprog, struct sock *sk)
12691274 {
@@ -1309,7 +1314,7 @@ int sk_attach_bpf(u32 ufd, struct sock *sk) · 39 unmodified lines
13091314 if (IS_ERR(prog))
13101315 return PTR_ERR(prog);
13111316
1312− err = __sk_attach_prog(prog, sk);
1317+ err = __sk_attach_prog(prog, sk, sock_owned_by_user(sk));
13131318 if (err < 0) {
13141319 bpf_prog_put(prog);
13151320 return err;
@@ -1764,6 +1769,7 @@ static u64 bpf_skb_get_tunnel_key(u64 r1, u64 r2, u64 size, u64 flags, u64 r5) · 448 unmodified lines
17641769 if (unlikely(size != sizeof(struct bpf_tunnel_key))) {
17651770 switch (size) {
17661771 case offsetof(struct bpf_tunnel_key, tunnel_label):
1772+ case offsetof(struct bpf_tunnel_key, tunnel_ext):
17671773 goto set_compat;
17681774 case offsetof(struct bpf_tunnel_key, remote_ipv6[1]):
17691775 /* Fixup deprecated structure layouts here, so we have
@@ -1849,6 +1855,7 @@ static u64 bpf_skb_set_tunnel_key(u64 r1, u64 r2, u64 size, u64 flags, u64 r5) · 79 unmodified lines
18491855 if (unlikely(size != sizeof(struct bpf_tunnel_key))) {
18501856 switch (size) {
18511857 case offsetof(struct bpf_tunnel_key, tunnel_label):
1858+ case offsetof(struct bpf_tunnel_key, tunnel_ext):
18521859 case offsetof(struct bpf_tunnel_key, remote_ipv6[1]):
18531860 /* Fixup deprecated structure layouts here, so we have
18541861 * a common path later on.
@@ -1861,7 +1868,8 @@ static u64 bpf_skb_set_tunnel_key(u64 r1, u64 r2, u64 size, u64 flags, u64 r5) · 6 unmodified lines
18611868 return -EINVAL;
18621869 }
18631870 }
1864− if (unlikely(!(flags & BPF_F_TUNINFO_IPV6) && from->tunnel_label))
1871+ if (unlikely((!(flags & BPF_F_TUNINFO_IPV6) && from->tunnel_label) ||
1872+ from->tunnel_ext))
18651873 return -EINVAL;
18661874
18671875 skb_dst_drop(skb);
@@ -2247,7 +2255,7 @@ static int __init register_sk_filter_ops(void) · 379 unmodified lines
22472255 }
22482256 late_initcall(register_sk_filter_ops);
22492257
2250−int sk_detach_filter(struct sock *sk)
2258+int __sk_detach_filter(struct sock *sk, bool locked)
22512259 {
22522260 int ret = -ENOENT;
22532261 struct sk_filter *filter;
@@ -2255,8 +2263,7 @@ int sk_detach_filter(struct sock *sk) · 1 unmodified line
22552263 if (sock_flag(sk, SOCK_FILTER_LOCKED))
22562264 return -EPERM;
22572265
2258− filter = rcu_dereference_protected(sk->sk_filter,
2259− sock_owned_by_user(sk));
2266+ filter = rcu_dereference_protected(sk->sk_filter, locked);
22602267 if (filter) {
22612268 RCU_INIT_POINTER(sk->sk_filter, NULL);
22622269 sk_filter_uncharge(sk, filter);
@@ -2265,7 +2272,12 @@ int sk_detach_filter(struct sock *sk) · 2 unmodified lines
22652272
22662273 return ret;
22672274 }
2268−EXPORT_SYMBOL_GPL(sk_detach_filter);
2275+EXPORT_SYMBOL_GPL(__sk_detach_filter);
2276+
2277+int sk_detach_filter(struct sock *sk)
2278+{
2279+ return __sk_detach_filter(sk, sock_owned_by_user(sk));
2280+}
22692281
22702282 int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf,
22712283 unsigned int len)
net/core/netpoll.c+2−1
@@ -603,7 +603,6 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev) · 602 unmodified lines
603603 const struct net_device_ops *ops;
604604 int err;
605605
606− np->dev = ndev;
607606 strlcpy(np->dev_name, ndev->name, IFNAMSIZ);
608607 INIT_WORK(&np->cleanup_work, netpoll_async_cleanup);
609608
@@ -670,6 +669,7 @@ int netpoll_setup(struct netpoll *np) · 60 unmodified lines
670669 goto unlock;
671670 }
672671 dev_hold(ndev);
672+ np->dev = ndev;
673673
674674 if (netdev_master_upper_dev_get(ndev)) {
675675 np_err(np, "%s is a slave device, aborting\n", np->dev_name);
@@ -770,6 +770,7 @@ int netpoll_setup(struct netpoll *np) · 94 unmodified lines
770770 return 0;
771771
772772 put:
773+ np->dev = NULL;
773774 dev_put(ndev);
774775 unlock:
775776 rtnl_unlock();
net/core/rtnetlink.c+1−0
@@ -909,6 +909,7 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev, · 908 unmodified lines
909909 + rtnl_link_get_af_size(dev, ext_filter_mask) /* IFLA_AF_SPEC */
910910 + nla_total_size(MAX_PHYS_ITEM_ID_LEN) /* IFLA_PHYS_PORT_ID */
911911 + nla_total_size(MAX_PHYS_ITEM_ID_LEN) /* IFLA_PHYS_SWITCH_ID */
912+ + nla_total_size(IFNAMSIZ) /* IFLA_PHYS_PORT_NAME */
912913 + nla_total_size(1); /* IFLA_PROTO_DOWN */
913914
914915 }
net/ipv4/fou.c+16−0
@@ -195,6 +195,14 @@ static struct sk_buff **fou_gro_receive(struct sk_buff **head, · 194 unmodified lines
195195 u8 proto = NAPI_GRO_CB(skb)->proto;
196196 const struct net_offload **offloads;
197197
198+ /* We can clear the encap_mark for FOU as we are essentially doing
199+ * one of two possible things. We are either adding an L4 tunnel
200+ * header to the outer L3 tunnel header, or we are are simply
201+ * treating the GRE tunnel header as though it is a UDP protocol
202+ * specific header such as VXLAN or GENEVE.
203+ */
204+ NAPI_GRO_CB(skb)->encap_mark = 0;
205+
198206 rcu_read_lock();
199207 offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
200208 ops = rcu_dereference(offloads[proto]);
@@ -352,6 +360,14 @@ static struct sk_buff **gue_gro_receive(struct sk_buff **head, · 151 unmodified lines
352360 }
353361 }
354362
363+ /* We can clear the encap_mark for GUE as we are essentially doing
364+ * one of two possible things. We are either adding an L4 tunnel
365+ * header to the outer L3 tunnel header, or we are are simply
366+ * treating the GRE tunnel header as though it is a UDP protocol
367+ * specific header such as VXLAN or GENEVE.
368+ */
369+ NAPI_GRO_CB(skb)->encap_mark = 0;
370+
355371 rcu_read_lock();
356372 offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
357373 ops = rcu_dereference(offloads[guehdr->proto_ctype]);
net/ipv4/ip_tunnel_core.c+2−2
@@ -372,8 +372,8 @@ static int ip6_tun_fill_encap_info(struct sk_buff *skb, · 371 unmodified lines
372372 if (nla_put_be64(skb, LWTUNNEL_IP6_ID, tun_info->key.tun_id) ||
373373 nla_put_in6_addr(skb, LWTUNNEL_IP6_DST, &tun_info->key.u.ipv6.dst) ||
374374 nla_put_in6_addr(skb, LWTUNNEL_IP6_SRC, &tun_info->key.u.ipv6.src) ||
375− nla_put_u8(skb, LWTUNNEL_IP6_HOPLIMIT, tun_info->key.tos) ||
376− nla_put_u8(skb, LWTUNNEL_IP6_TC, tun_info->key.ttl) ||
375+ nla_put_u8(skb, LWTUNNEL_IP6_TC, tun_info->key.tos) ||
376+ nla_put_u8(skb, LWTUNNEL_IP6_HOPLIMIT, tun_info->key.ttl) ||
377377 nla_put_be16(skb, LWTUNNEL_IP6_FLAGS, tun_info->key.tun_flags))
378378 return -ENOMEM;
379379
net/ipv4/netfilter/arp_tables.c+23−20
@@ -359,11 +359,12 @@ unsigned int arpt_do_table(struct sk_buff *skb, · 358 unmodified lines
359359 }
360360
361361 /* All zeroes == unconditional rule. */
362−static inline bool unconditional(const struct arpt_arp *arp)
362+static inline bool unconditional(const struct arpt_entry *e)
363363 {
364364 static const struct arpt_arp uncond;
365365
366− return memcmp(arp, &uncond, sizeof(uncond)) == 0;
366+ return e->target_offset == sizeof(struct arpt_entry) &&
367+ memcmp(&e->arp, &uncond, sizeof(uncond)) == 0;
367368 }
368369
369370 /* Figures out from what hook each rule can be called: returns 0 if
@@ -402,11 +403,10 @@ static int mark_source_chains(const struct xt_table_info *newinfo, · 32 unmodified lines
402403 |= ((1 << hook) | (1 << NF_ARP_NUMHOOKS));
403404
404405 /* Unconditional return/END. */
405− if ((e->target_offset == sizeof(struct arpt_entry) &&
406+ if ((unconditional(e) &&
406407 (strcmp(t->target.u.user.name,
407408 XT_STANDARD_TARGET) == 0) &&
408− t->verdict < 0 && unconditional(&e->arp)) ||
409− visited) {
409+ t->verdict < 0) || visited) {
410410 unsigned int oldpos, size;
411411
412412 if ((strcmp(t->target.u.user.name,
@@ -474,14 +474,12 @@ next: · 61 unmodified lines
474474 return 1;
475475 }
476476
477−static inline int check_entry(const struct arpt_entry *e, const char *name)
477+static inline int check_entry(const struct arpt_entry *e)
478478 {
479479 const struct xt_entry_target *t;
480480
481− if (!arp_checkentry(&e->arp)) {
482− duprintf("arp_tables: arp check failed %p %s.\n", e, name);
481+ if (!arp_checkentry(&e->arp))
483482 return -EINVAL;
484− }
485483
486484 if (e->target_offset + sizeof(struct xt_entry_target) > e->next_offset)
487485 return -EINVAL;
@@ -522,10 +520,6 @@ find_check_entry(struct arpt_entry *e, const char *name, unsigned int size) · 34 unmodified lines
522520 struct xt_target *target;
523521 int ret;
524522
525− ret = check_entry(e, name);
526− if (ret)
527− return ret;
528−
529523 e->counters.pcnt = xt_percpu_counter_alloc();
530524 if (IS_ERR_VALUE(e->counters.pcnt))
531525 return -ENOMEM;
@@ -557,7 +551,7 @@ static bool check_underflow(const struct arpt_entry *e) · 25 unmodified lines
557551 const struct xt_entry_target *t;
558552 unsigned int verdict;
559553
560− if (!unconditional(&e->arp))
554+ if (!unconditional(e))
561555 return false;
562556 t = arpt_get_target_c(e);
563557 if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
@@ -576,9 +570,11 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, · 12 unmodified lines
576570 unsigned int valid_hooks)
577571 {
578572 unsigned int h;
573+ int err;
579574
580575 if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
581− (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
576+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
577+ (unsigned char *)e + e->next_offset > limit) {
582578 duprintf("Bad offset %p\n", e);
583579 return -EINVAL;
584580 }
@@ -590,6 +586,10 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, · 5 unmodified lines
590586 return -EINVAL;
591587 }
592588
589+ err = check_entry(e);
590+ if (err)
591+ return err;
592+
593593 /* Check hooks & underflows */
594594 for (h = 0; h < NF_ARP_NUMHOOKS; h++) {
595595 if (!(valid_hooks & (1 << h)))
@@ -598,9 +598,9 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, · 2 unmodified lines
598598 newinfo->hook_entry[h] = hook_entries[h];
599599 if ((unsigned char *)e - base == underflows[h]) {
600600 if (!check_underflow(e)) {
601− pr_err("Underflows must be unconditional and "
602− "use the STANDARD target with "
603− "ACCEPT/DROP\n");
601+ pr_debug("Underflows must be unconditional and "
602+ "use the STANDARD target with "
603+ "ACCEPT/DROP\n");
604604 return -EINVAL;
605605 }
606606 newinfo->underflow[h] = underflows[h];
@@ -969,6 +969,7 @@ static int get_entries(struct net *net, struct arpt_get_entries __user *uptr, · 362 unmodified lines
969969 sizeof(struct arpt_get_entries) + get.size);
970970 return -EINVAL;
971971 }
972+ get.name[sizeof(get.name) - 1] = '\0';
972973
973974 t = xt_find_table_lock(net, NFPROTO_ARP, get.name);
974975 if (!IS_ERR_OR_NULL(t)) {
@@ -1233,7 +1234,8 @@ check_compat_entry_size_and_hooks(struct compat_arpt_entry *e, · 258 unmodified lines
12331234
12341235 duprintf("check_compat_entry_size_and_hooks %p\n", e);
12351236 if ((unsigned long)e % __alignof__(struct compat_arpt_entry) != 0 ||
1236− (unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit) {
1237+ (unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit ||
1238+ (unsigned char *)e + e->next_offset > limit) {
12371239 duprintf("Bad offset %p, limit = %p\n", e, limit);
12381240 return -EINVAL;
12391241 }
@@ -1246,7 +1248,7 @@ check_compat_entry_size_and_hooks(struct compat_arpt_entry *e, · 6 unmodified lines
12461248 }
12471249
12481250 /* For purposes of check_entry casting the compat entry is fine */
1249− ret = check_entry((struct arpt_entry *)e, name);
1251+ ret = check_entry((struct arpt_entry *)e);
12501252 if (ret)
12511253 return ret;
12521254
@@ -1662,6 +1664,7 @@ static int compat_get_entries(struct net *net, · 409 unmodified lines
16621664 *len, sizeof(get) + get.size);
16631665 return -EINVAL;
16641666 }
1667+ get.name[sizeof(get.name) - 1] = '\0';
16651668
16661669 xt_compat_lock(NFPROTO_ARP);
16671670 t = xt_find_table_lock(net, NFPROTO_ARP, get.name);
net/ipv4/netfilter/ip_tables.c+25−23
@@ -168,11 +168,12 @@ get_entry(const void *base, unsigned int offset) · 167 unmodified lines
168168
169169 /* All zeroes == unconditional rule. */
170170 /* Mildly perf critical (only if packet tracing is on) */
171−static inline bool unconditional(const struct ipt_ip *ip)
171+static inline bool unconditional(const struct ipt_entry *e)
172172 {
173173 static const struct ipt_ip uncond;
174174
175− return memcmp(ip, &uncond, sizeof(uncond)) == 0;
175+ return e->target_offset == sizeof(struct ipt_entry) &&
176+ memcmp(&e->ip, &uncond, sizeof(uncond)) == 0;
176177 #undef FWINV
177178 }
178179
@@ -229,11 +230,10 @@ get_chainname_rulenum(const struct ipt_entry *s, const struct ipt_entry *e, · 50 unmodified lines
229230 } else if (s == e) {
230231 (*rulenum)++;
231232
232− if (s->target_offset == sizeof(struct ipt_entry) &&
233+ if (unconditional(s) &&
233234 strcmp(t->target.u.kernel.target->name,
234235 XT_STANDARD_TARGET) == 0 &&
235− t->verdict < 0 &&
236− unconditional(&s->ip)) {
236+ t->verdict < 0) {
237237 /* Tail of chains: STANDARD target (return/policy) */
238238 *comment = *chainname == hookname
239239 ? comments[NF_IP_TRACE_COMMENT_POLICY]
@@ -476,11 +476,10 @@ mark_source_chains(const struct xt_table_info *newinfo, · 236 unmodified lines
476476 e->comefrom |= ((1 << hook) | (1 << NF_INET_NUMHOOKS));
477477
478478 /* Unconditional return/END. */
479− if ((e->target_offset == sizeof(struct ipt_entry) &&
479+ if ((unconditional(e) &&
480480 (strcmp(t->target.u.user.name,
481481 XT_STANDARD_TARGET) == 0) &&
482− t->verdict < 0 && unconditional(&e->ip)) ||
483− visited) {
482+ t->verdict < 0) || visited) {
484483 unsigned int oldpos, size;
485484
486485 if ((strcmp(t->target.u.user.name,
@@ -569,14 +568,12 @@ static void cleanup_match(struct xt_entry_match *m, struct net *net) · 82 unmodified lines
569568 }
570569
571570 static int
572−check_entry(const struct ipt_entry *e, const char *name)
571+check_entry(const struct ipt_entry *e)
573572 {
574573 const struct xt_entry_target *t;
575574
576− if (!ip_checkentry(&e->ip)) {
577− duprintf("ip check failed %p %s.\n", e, name);
575+ if (!ip_checkentry(&e->ip))
578576 return -EINVAL;
579− }
580577
581578 if (e->target_offset + sizeof(struct xt_entry_target) >
582579 e->next_offset)
@@ -666,10 +663,6 @@ find_check_entry(struct ipt_entry *e, struct net *net, const char *name, · 83 unmodified lines
666663 struct xt_mtchk_param mtpar;
667664 struct xt_entry_match *ematch;
668665
669− ret = check_entry(e, name);
670− if (ret)
671− return ret;
672−
673666 e->counters.pcnt = xt_percpu_counter_alloc();
674667 if (IS_ERR_VALUE(e->counters.pcnt))
675668 return -ENOMEM;
@@ -721,7 +714,7 @@ static bool check_underflow(const struct ipt_entry *e) · 45 unmodified lines
721714 const struct xt_entry_target *t;
722715 unsigned int verdict;
723716
724− if (!unconditional(&e->ip))
717+ if (!unconditional(e))
725718 return false;
726719 t = ipt_get_target_c(e);
727720 if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
@@ -741,9 +734,11 @@ check_entry_size_and_hooks(struct ipt_entry *e, · 13 unmodified lines
741734 unsigned int valid_hooks)
742735 {
743736 unsigned int h;
737+ int err;
744738
745739 if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
746− (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
740+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
741+ (unsigned char *)e + e->next_offset > limit) {
747742 duprintf("Bad offset %p\n", e);
748743 return -EINVAL;
749744 }
@@ -755,6 +750,10 @@ check_entry_size_and_hooks(struct ipt_entry *e, · 5 unmodified lines
755750 return -EINVAL;
756751 }
757752
753+ err = check_entry(e);
754+ if (err)
755+ return err;
756+
758757 /* Check hooks & underflows */
759758 for (h = 0; h < NF_INET_NUMHOOKS; h++) {
760759 if (!(valid_hooks & (1 << h)))
@@ -763,9 +762,9 @@ check_entry_size_and_hooks(struct ipt_entry *e, · 2 unmodified lines
763762 newinfo->hook_entry[h] = hook_entries[h];
764763 if ((unsigned char *)e - base == underflows[h]) {
765764 if (!check_underflow(e)) {
766− pr_err("Underflows must be unconditional and "
767− "use the STANDARD target with "
768− "ACCEPT/DROP\n");
765+ pr_debug("Underflows must be unconditional and "
766+ "use the STANDARD target with "
767+ "ACCEPT/DROP\n");
769768 return -EINVAL;
770769 }
771770 newinfo->underflow[h] = underflows[h];
@@ -1157,6 +1156,7 @@ get_entries(struct net *net, struct ipt_get_entries __user *uptr, · 385 unmodified lines
11571156 *len, sizeof(get) + get.size);
11581157 return -EINVAL;
11591158 }
1159+ get.name[sizeof(get.name) - 1] = '\0';
11601160
11611161 t = xt_find_table_lock(net, AF_INET, get.name);
11621162 if (!IS_ERR_OR_NULL(t)) {
@@ -1493,7 +1493,8 @@ check_compat_entry_size_and_hooks(struct compat_ipt_entry *e, · 330 unmodified lines
14931493
14941494 duprintf("check_compat_entry_size_and_hooks %p\n", e);
14951495 if ((unsigned long)e % __alignof__(struct compat_ipt_entry) != 0 ||
1496− (unsigned char *)e + sizeof(struct compat_ipt_entry) >= limit) {
1496+ (unsigned char *)e + sizeof(struct compat_ipt_entry) >= limit ||
1497+ (unsigned char *)e + e->next_offset > limit) {
14971498 duprintf("Bad offset %p, limit = %p\n", e, limit);
14981499 return -EINVAL;
14991500 }
@@ -1506,7 +1507,7 @@ check_compat_entry_size_and_hooks(struct compat_ipt_entry *e, · 6 unmodified lines
15061507 }
15071508
15081509 /* For purposes of check_entry casting the compat entry is fine */
1509− ret = check_entry((struct ipt_entry *)e, name);
1510+ ret = check_entry((struct ipt_entry *)e);
15101511 if (ret)
15111512 return ret;
15121513
@@ -1935,6 +1936,7 @@ compat_get_entries(struct net *net, struct compat_ipt_get_entries __user *uptr, · 422 unmodified lines
19351936 *len, sizeof(get) + get.size);
19361937 return -EINVAL;
19371938 }
1939+ get.name[sizeof(get.name) - 1] = '\0';
19381940
19391941 xt_compat_lock(AF_INET);
19401942 t = xt_find_table_lock(net, AF_INET, get.name);
net/ipv4/netfilter/ipt_SYNPROXY.c+28−26
@@ -18,10 +18,10 @@ · 17 unmodified lines
1818 #include <net/netfilter/nf_conntrack_synproxy.h>
1919
2020 static struct iphdr *
21−synproxy_build_ip(struct sk_buff *skb, __be32 saddr, __be32 daddr)
21+synproxy_build_ip(struct net *net, struct sk_buff *skb, __be32 saddr,
22+ __be32 daddr)
2223 {
2324 struct iphdr *iph;
24− struct net *net = sock_net(skb->sk);
2525
2626 skb_reset_network_header(skb);
2727 iph = (struct iphdr *)skb_put(skb, sizeof(*iph));
@@ -40,14 +40,12 @@ synproxy_build_ip(struct sk_buff *skb, __be32 saddr, __be32 daddr) · 12 unmodified lines
4040 }
4141
4242 static void
43−synproxy_send_tcp(const struct synproxy_net *snet,
43+synproxy_send_tcp(struct net *net,
4444 const struct sk_buff *skb, struct sk_buff *nskb,
4545 struct nf_conntrack *nfct, enum ip_conntrack_info ctinfo,
4646 struct iphdr *niph, struct tcphdr *nth,
4747 unsigned int tcp_hdr_size)
4848 {
49− struct net *net = nf_ct_net(snet->tmpl);
50−
5149 nth->check = ~tcp_v4_check(tcp_hdr_size, niph->saddr, niph->daddr, 0);
5250 nskb->ip_summed = CHECKSUM_PARTIAL;
5351 nskb->csum_start = (unsigned char *)nth - nskb->head;
@@ -72,7 +70,7 @@ free_nskb: · 18 unmodified lines
7270 }
7371
7472 static void
75−synproxy_send_client_synack(const struct synproxy_net *snet,
73+synproxy_send_client_synack(struct net *net,
7674 const struct sk_buff *skb, const struct tcphdr *th,
7775 const struct synproxy_options *opts)
7876 {
@@ -91,7 +89,7 @@ synproxy_send_client_synack(const struct synproxy_net *snet, · 12 unmodified lines
9189 return;
9290 skb_reserve(nskb, MAX_TCP_HEADER);
9391
94− niph = synproxy_build_ip(nskb, iph->daddr, iph->saddr);
92+ niph = synproxy_build_ip(net, nskb, iph->daddr, iph->saddr);
9593
9694 skb_reset_transport_header(nskb);
9795 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size);
@@ -109,15 +107,16 @@ synproxy_send_client_synack(const struct synproxy_net *snet, · 11 unmodified lines
109107
110108 synproxy_build_options(nth, opts);
111109
112− synproxy_send_tcp(snet, skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY,
110+ synproxy_send_tcp(net, skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY,
113111 niph, nth, tcp_hdr_size);
114112 }
115113
116114 static void
117−synproxy_send_server_syn(const struct synproxy_net *snet,
115+synproxy_send_server_syn(struct net *net,
118116 const struct sk_buff *skb, const struct tcphdr *th,
119117 const struct synproxy_options *opts, u32 recv_seq)
120118 {
119+ struct synproxy_net *snet = synproxy_pernet(net);
121120 struct sk_buff *nskb;
122121 struct iphdr *iph, *niph;
123122 struct tcphdr *nth;
@@ -132,7 +131,7 @@ synproxy_send_server_syn(const struct synproxy_net *snet, · 8 unmodified lines
132131 return;
133132 skb_reserve(nskb, MAX_TCP_HEADER);
134133
135− niph = synproxy_build_ip(nskb, iph->saddr, iph->daddr);
134+ niph = synproxy_build_ip(net, nskb, iph->saddr, iph->daddr);
136135
137136 skb_reset_transport_header(nskb);
138137 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size);
@@ -153,12 +152,12 @@ synproxy_send_server_syn(const struct synproxy_net *snet, · 14 unmodified lines
153152
154153 synproxy_build_options(nth, opts);
155154
156− synproxy_send_tcp(snet, skb, nskb, &snet->tmpl->ct_general, IP_CT_NEW,
155+ synproxy_send_tcp(net, skb, nskb, &snet->tmpl->ct_general, IP_CT_NEW,
157156 niph, nth, tcp_hdr_size);
158157 }
159158
160159 static void
161−synproxy_send_server_ack(const struct synproxy_net *snet,
160+synproxy_send_server_ack(struct net *net,
162161 const struct ip_ct_tcp *state,
163162 const struct sk_buff *skb, const struct tcphdr *th,
164163 const struct synproxy_options *opts)
@@ -177,7 +176,7 @@ synproxy_send_server_ack(const struct synproxy_net *snet, · 12 unmodified lines
177176 return;
178177 skb_reserve(nskb, MAX_TCP_HEADER);
179178
180− niph = synproxy_build_ip(nskb, iph->daddr, iph->saddr);
179+ niph = synproxy_build_ip(net, nskb, iph->daddr, iph->saddr);
181180
182181 skb_reset_transport_header(nskb);
183182 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size);
@@ -193,11 +192,11 @@ synproxy_send_server_ack(const struct synproxy_net *snet, · 9 unmodified lines
193192
194193 synproxy_build_options(nth, opts);
195194
196− synproxy_send_tcp(snet, skb, nskb, NULL, 0, niph, nth, tcp_hdr_size);
195+ synproxy_send_tcp(net, skb, nskb, NULL, 0, niph, nth, tcp_hdr_size);
197196 }
198197
199198 static void
200−synproxy_send_client_ack(const struct synproxy_net *snet,
199+synproxy_send_client_ack(struct net *net,
201200 const struct sk_buff *skb, const struct tcphdr *th,
202201 const struct synproxy_options *opts)
203202 {
@@ -215,7 +214,7 @@ synproxy_send_client_ack(const struct synproxy_net *snet, · 11 unmodified lines
215214 return;
216215 skb_reserve(nskb, MAX_TCP_HEADER);
217216
218− niph = synproxy_build_ip(nskb, iph->saddr, iph->daddr);
217+ niph = synproxy_build_ip(net, nskb, iph->saddr, iph->daddr);
219218
220219 skb_reset_transport_header(nskb);
221220 nth = (struct tcphdr *)skb_put(nskb, tcp_hdr_size);
@@ -231,15 +230,16 @@ synproxy_send_client_ack(const struct synproxy_net *snet, · 9 unmodified lines
231230
232231 synproxy_build_options(nth, opts);
233232
234− synproxy_send_tcp(snet, skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY,
233+ synproxy_send_tcp(net, skb, nskb, skb->nfct, IP_CT_ESTABLISHED_REPLY,
235234 niph, nth, tcp_hdr_size);
236235 }
237236
238237 static bool
239−synproxy_recv_client_ack(const struct synproxy_net *snet,
238+synproxy_recv_client_ack(struct net *net,
240239 const struct sk_buff *skb, const struct tcphdr *th,
241240 struct synproxy_options *opts, u32 recv_seq)
242241 {
242+ struct synproxy_net *snet = synproxy_pernet(net);
243243 int mss;
244244
245245 mss = __cookie_v4_check(ip_hdr(skb), th, ntohl(th->ack_seq) - 1);
@@ -255,7 +255,7 @@ synproxy_recv_client_ack(const struct synproxy_net *snet, · 9 unmodified lines
255255 if (opts->options & XT_SYNPROXY_OPT_TIMESTAMP)
256256 synproxy_check_timestamp_cookie(opts);
257257
258− synproxy_send_server_syn(snet, skb, th, opts, recv_seq);
258+ synproxy_send_server_syn(net, skb, th, opts, recv_seq);
259259 return true;
260260 }
261261
@@ -263,7 +263,8 @@ static unsigned int · 1 unmodified line
263263 synproxy_tg4(struct sk_buff *skb, const struct xt_action_param *par)
264264 {
265265 const struct xt_synproxy_info *info = par->targinfo;
266− struct synproxy_net *snet = synproxy_pernet(par->net);
266+ struct net *net = par->net;
267+ struct synproxy_net *snet = synproxy_pernet(net);
267268 struct synproxy_options opts = {};
268269 struct tcphdr *th, _th;
269270
@@ -292,12 +293,12 @@ synproxy_tg4(struct sk_buff *skb, const struct xt_action_param *par) · 22 unmodified lines
292293 XT_SYNPROXY_OPT_SACK_PERM |
293294 XT_SYNPROXY_OPT_ECN);
294295
295− synproxy_send_client_synack(snet, skb, th, &opts);
296+ synproxy_send_client_synack(net, skb, th, &opts);
296297 return NF_DROP;
297298
298299 } else if (th->ack && !(th->fin || th->rst || th->syn)) {
299300 /* ACK from client */
300− synproxy_recv_client_ack(snet, skb, th, &opts, ntohl(th->seq));
301+ synproxy_recv_client_ack(net, skb, th, &opts, ntohl(th->seq));
301302 return NF_DROP;
302303 }
303304
@@ -308,7 +309,8 @@ static unsigned int ipv4_synproxy_hook(void *priv, · 4 unmodified lines
308309 struct sk_buff *skb,
309310 const struct nf_hook_state *nhs)
310311 {
311− struct synproxy_net *snet = synproxy_pernet(nhs->net);
312+ struct net *net = nhs->net;
313+ struct synproxy_net *snet = synproxy_pernet(net);
312314 enum ip_conntrack_info ctinfo;
313315 struct nf_conn *ct;
314316 struct nf_conn_synproxy *synproxy;
@@ -365,7 +367,7 @@ static unsigned int ipv4_synproxy_hook(void *priv, · 50 unmodified lines
365367 * therefore we need to add 1 to make the SYN sequence
366368 * number match the one of first SYN.
367369 */
368− if (synproxy_recv_client_ack(snet, skb, th, &opts,
370+ if (synproxy_recv_client_ack(net, skb, th, &opts,
369371 ntohl(th->seq) + 1))
370372 this_cpu_inc(snet->stats->cookie_retrans);
371373
@@ -391,12 +393,12 @@ static unsigned int ipv4_synproxy_hook(void *priv, · 19 unmodified lines
391393 XT_SYNPROXY_OPT_SACK_PERM);
392394
393395 swap(opts.tsval, opts.tsecr);
394− synproxy_send_server_ack(snet, state, skb, th, &opts);
396+ synproxy_send_server_ack(net, state, skb, th, &opts);
395397
396398 nf_ct_seqadj_init(ct, ctinfo, synproxy->isn - ntohl(th->seq));
397399
398400 swap(opts.tsval, opts.tsecr);
399− synproxy_send_client_ack(snet, skb, th, &opts);
401+ synproxy_send_client_ack(net, skb, th, &opts);
400402
401403 consume_skb(skb);
402404 return NF_STOLEN;
net/ipv6/netfilter/ip6_tables.c+25−23
@@ -198,11 +198,12 @@ get_entry(const void *base, unsigned int offset) · 197 unmodified lines
198198
199199 /* All zeroes == unconditional rule. */
200200 /* Mildly perf critical (only if packet tracing is on) */
201−static inline bool unconditional(const struct ip6t_ip6 *ipv6)
201+static inline bool unconditional(const struct ip6t_entry *e)
202202 {
203203 static const struct ip6t_ip6 uncond;
204204
205− return memcmp(ipv6, &uncond, sizeof(uncond)) == 0;
205+ return e->target_offset == sizeof(struct ip6t_entry) &&
206+ memcmp(&e->ipv6, &uncond, sizeof(uncond)) == 0;
206207 }
207208
208209 static inline const struct xt_entry_target *
@@ -258,11 +259,10 @@ get_chainname_rulenum(const struct ip6t_entry *s, const struct ip6t_entry *e, · 49 unmodified lines
258259 } else if (s == e) {
259260 (*rulenum)++;
260261
261− if (s->target_offset == sizeof(struct ip6t_entry) &&
262+ if (unconditional(s) &&
262263 strcmp(t->target.u.kernel.target->name,
263264 XT_STANDARD_TARGET) == 0 &&
264− t->verdict < 0 &&
265− unconditional(&s->ipv6)) {
265+ t->verdict < 0) {
266266 /* Tail of chains: STANDARD target (return/policy) */
267267 *comment = *chainname == hookname
268268 ? comments[NF_IP6_TRACE_COMMENT_POLICY]
@@ -488,11 +488,10 @@ mark_source_chains(const struct xt_table_info *newinfo, · 219 unmodified lines
488488 e->comefrom |= ((1 << hook) | (1 << NF_INET_NUMHOOKS));
489489
490490 /* Unconditional return/END. */
491− if ((e->target_offset == sizeof(struct ip6t_entry) &&
491+ if ((unconditional(e) &&
492492 (strcmp(t->target.u.user.name,
493493 XT_STANDARD_TARGET) == 0) &&
494− t->verdict < 0 &&
495− unconditional(&e->ipv6)) || visited) {
494+ t->verdict < 0) || visited) {
496495 unsigned int oldpos, size;
497496
498497 if ((strcmp(t->target.u.user.name,
@@ -581,14 +580,12 @@ static void cleanup_match(struct xt_entry_match *m, struct net *net) · 82 unmodified lines
581580 }
582581
583582 static int
584−check_entry(const struct ip6t_entry *e, const char *name)
583+check_entry(const struct ip6t_entry *e)
585584 {
586585 const struct xt_entry_target *t;
587586
588− if (!ip6_checkentry(&e->ipv6)) {
589− duprintf("ip_tables: ip check failed %p %s.\n", e, name);
587+ if (!ip6_checkentry(&e->ipv6))
590588 return -EINVAL;
591− }
592589
593590 if (e->target_offset + sizeof(struct xt_entry_target) >
594591 e->next_offset)
@@ -679,10 +676,6 @@ find_check_entry(struct ip6t_entry *e, struct net *net, const char *name, · 84 unmodified lines
679676 struct xt_mtchk_param mtpar;
680677 struct xt_entry_match *ematch;
681678
682− ret = check_entry(e, name);
683− if (ret)
684− return ret;
685−
686679 e->counters.pcnt = xt_percpu_counter_alloc();
687680 if (IS_ERR_VALUE(e->counters.pcnt))
688681 return -ENOMEM;
@@ -733,7 +726,7 @@ static bool check_underflow(const struct ip6t_entry *e) · 44 unmodified lines
733726 const struct xt_entry_target *t;
734727 unsigned int verdict;
735728
736− if (!unconditional(&e->ipv6))
729+ if (!unconditional(e))
737730 return false;
738731 t = ip6t_get_target_c(e);
739732 if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
@@ -753,9 +746,11 @@ check_entry_size_and_hooks(struct ip6t_entry *e, · 13 unmodified lines
753746 unsigned int valid_hooks)
754747 {
755748 unsigned int h;
749+ int err;
756750
757751 if ((unsigned long)e % __alignof__(struct ip6t_entry) != 0 ||
758− (unsigned char *)e + sizeof(struct ip6t_entry) >= limit) {
752+ (unsigned char *)e + sizeof(struct ip6t_entry) >= limit ||
753+ (unsigned char *)e + e->next_offset > limit) {
759754 duprintf("Bad offset %p\n", e);
760755 return -EINVAL;
761756 }
@@ -767,6 +762,10 @@ check_entry_size_and_hooks(struct ip6t_entry *e, · 5 unmodified lines
767762 return -EINVAL;
768763 }
769764
765+ err = check_entry(e);
766+ if (err)
767+ return err;
768+
770769 /* Check hooks & underflows */
771770 for (h = 0; h < NF_INET_NUMHOOKS; h++) {
772771 if (!(valid_hooks & (1 << h)))
@@ -775,9 +774,9 @@ check_entry_size_and_hooks(struct ip6t_entry *e, · 2 unmodified lines
775774 newinfo->hook_entry[h] = hook_entries[h];
776775 if ((unsigned char *)e - base == underflows[h]) {
777776 if (!check_underflow(e)) {
778− pr_err("Underflows must be unconditional and "
779− "use the STANDARD target with "
780− "ACCEPT/DROP\n");
777+ pr_debug("Underflows must be unconditional and "
778+ "use the STANDARD target with "
779+ "ACCEPT/DROP\n");
781780 return -EINVAL;
782781 }
783782 newinfo->underflow[h] = underflows[h];
@@ -1169,6 +1168,7 @@ get_entries(struct net *net, struct ip6t_get_entries __user *uptr, · 385 unmodified lines
11691168 *len, sizeof(get) + get.size);
11701169 return -EINVAL;
11711170 }
1171+ get.name[sizeof(get.name) - 1] = '\0';
11721172
11731173 t = xt_find_table_lock(net, AF_INET6, get.name);
11741174 if (!IS_ERR_OR_NULL(t)) {
@@ -1505,7 +1505,8 @@ check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e, · 330 unmodified lines
15051505
15061506 duprintf("check_compat_entry_size_and_hooks %p\n", e);
15071507 if ((unsigned long)e % __alignof__(struct compat_ip6t_entry) != 0 ||
1508− (unsigned char *)e + sizeof(struct compat_ip6t_entry) >= limit) {
1508+ (unsigned char *)e + sizeof(struct compat_ip6t_entry) >= limit ||
1509+ (unsigned char *)e + e->next_offset > limit) {
15091510 duprintf("Bad offset %p, limit = %p\n", e, limit);
15101511 return -EINVAL;
15111512 }
@@ -1518,7 +1519,7 @@ check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e, · 6 unmodified lines
15181519 }
15191520
15201521 /* For purposes of check_entry casting the compat entry is fine */
1521− ret = check_entry((struct ip6t_entry *)e, name);
1522+ ret = check_entry((struct ip6t_entry *)e);
15221523 if (ret)
15231524 return ret;
15241525
@@ -1944,6 +1945,7 @@ compat_get_entries(struct net *net, struct compat_ip6t_get_entries __user *uptr, · 419 unmodified lines
19441945 *len, sizeof(get) + get.size);
19451946 return -EINVAL;
19461947 }
1948+ get.name[sizeof(get.name) - 1] = '\0';
19471949
19481950 xt_compat_lock(AF_INET6);
19491951 t = xt_find_table_lock(net, AF_INET6, get.name);
net/ipv6/udp.c+2−2
@@ -843,8 +843,8 @@ start_lookup: · 842 unmodified lines
843843 flush_stack(stack, count, skb, count - 1);
844844 } else {
845845 if (!inner_flushed)
846− UDP_INC_STATS_BH(net, UDP_MIB_IGNOREDMULTI,
847− proto == IPPROTO_UDPLITE);
846+ UDP6_INC_STATS_BH(net, UDP_MIB_IGNOREDMULTI,
847+ proto == IPPROTO_UDPLITE);
848848 consume_skb(skb);
849849 }
850850 return 0;
net/netfilter/ipset/ip_set_bitmap_gen.h+1−1
@@ -95,7 +95,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb) · 94 unmodified lines
9595 if (!nested)
9696 goto nla_put_failure;
9797 if (mtype_do_head(skb, map) ||
98− nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
98+ nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref)) ||
9999 nla_put_net32(skb, IPSET_ATTR_MEMSIZE, htonl(memsize)))
100100 goto nla_put_failure;
101101 if (unlikely(ip_set_put_flags(skb, set)))
net/netfilter/ipset/ip_set_core.c+28−5
@@ -497,6 +497,26 @@ __ip_set_put(struct ip_set *set) · 496 unmodified lines
497497 write_unlock_bh(&ip_set_ref_lock);
498498 }
499499
500+/* set->ref can be swapped out by ip_set_swap, netlink events (like dump) need
501+ * a separate reference counter
502+ */
503+static inline void
504+__ip_set_get_netlink(struct ip_set *set)
505+{
506+ write_lock_bh(&ip_set_ref_lock);
507+ set->ref_netlink++;
508+ write_unlock_bh(&ip_set_ref_lock);
509+}
510+
511+static inline void
512+__ip_set_put_netlink(struct ip_set *set)
513+{
514+ write_lock_bh(&ip_set_ref_lock);
515+ BUG_ON(set->ref_netlink == 0);
516+ set->ref_netlink--;
517+ write_unlock_bh(&ip_set_ref_lock);
518+}
519+
500520 /* Add, del and test set entries from kernel.
501521 *
502522 * The set behind the index must exist and must be referenced
@@ -1002,7 +1022,7 @@ static int ip_set_destroy(struct net *net, struct sock *ctnl, · 499 unmodified lines
10021022 if (!attr[IPSET_ATTR_SETNAME]) {
10031023 for (i = 0; i < inst->ip_set_max; i++) {
10041024 s = ip_set(inst, i);
1005− if (s && s->ref) {
1025+ if (s && (s->ref || s->ref_netlink)) {
10061026 ret = -IPSET_ERR_BUSY;
10071027 goto out;
10081028 }
@@ -1024,7 +1044,7 @@ static int ip_set_destroy(struct net *net, struct sock *ctnl, · 15 unmodified lines
10241044 if (!s) {
10251045 ret = -ENOENT;
10261046 goto out;
1027− } else if (s->ref) {
1047+ } else if (s->ref || s->ref_netlink) {
10281048 ret = -IPSET_ERR_BUSY;
10291049 goto out;
10301050 }
@@ -1171,6 +1191,9 @@ static int ip_set_swap(struct net *net, struct sock *ctnl, struct sk_buff *skb, · 140 unmodified lines
11711191 from->family == to->family))
11721192 return -IPSET_ERR_TYPE_MISMATCH;
11731193
1194+ if (from->ref_netlink || to->ref_netlink)
1195+ return -EBUSY;
1196+
11741197 strncpy(from_name, from->name, IPSET_MAXNAMELEN);
11751198 strncpy(from->name, to->name, IPSET_MAXNAMELEN);
11761199 strncpy(to->name, from_name, IPSET_MAXNAMELEN);
@@ -1206,7 +1229,7 @@ ip_set_dump_done(struct netlink_callback *cb) · 29 unmodified lines
12061229 if (set->variant->uref)
12071230 set->variant->uref(set, cb, false);
12081231 pr_debug("release set %s\n", set->name);
1209− __ip_set_put_byindex(inst, index);
1232+ __ip_set_put_netlink(set);
12101233 }
12111234 return 0;
12121235 }
@@ -1328,7 +1351,7 @@ dump_last: · 115 unmodified lines
13281351 if (!cb->args[IPSET_CB_ARG0]) {
13291352 /* Start listing: make sure set won't be destroyed */
13301353 pr_debug("reference set\n");
1331− set->ref++;
1354+ set->ref_netlink++;
13321355 }
13331356 write_unlock_bh(&ip_set_ref_lock);
13341357 nlh = start_msg(skb, NETLINK_CB(cb->skb).portid,
@@ -1396,7 +1419,7 @@ release_refcount: · 61 unmodified lines
13961419 if (set->variant->uref)
13971420 set->variant->uref(set, cb, false);
13981421 pr_debug("release set %s\n", set->name);
1399− __ip_set_put_byindex(inst, index);
1422+ __ip_set_put_netlink(set);
14001423 cb->args[IPSET_CB_ARG0] = 0;
14011424 }
14021425 out:
net/netfilter/ipset/ip_set_hash_gen.h+1−1
@@ -1082,7 +1082,7 @@ mtype_head(struct ip_set *set, struct sk_buff *skb) · 1081 unmodified lines
10821082 if (nla_put_u32(skb, IPSET_ATTR_MARKMASK, h->markmask))
10831083 goto nla_put_failure;
10841084 #endif
1085− if (nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
1085+ if (nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref)) ||
10861086 nla_put_net32(skb, IPSET_ATTR_MEMSIZE, htonl(memsize)))
10871087 goto nla_put_failure;
10881088 if (unlikely(ip_set_put_flags(skb, set)))
net/netfilter/ipset/ip_set_list_set.c+1−1
@@ -458,7 +458,7 @@ list_set_head(struct ip_set *set, struct sk_buff *skb) · 457 unmodified lines
458458 if (!nested)
459459 goto nla_put_failure;
460460 if (nla_put_net32(skb, IPSET_ATTR_SIZE, htonl(map->size)) ||
461− nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
461+ nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref)) ||
462462 nla_put_net32(skb, IPSET_ATTR_MEMSIZE,
463463 htonl(sizeof(*map) + n * set->dsize)))
464464 goto nla_put_failure;
net/netfilter/nfnetlink_queue.c+6−1
@@ -582,7 +582,12 @@ __nfqnl_enqueue_packet(struct net *net, struct nfqnl_instance *queue, · 581 unmodified lines
582582 /* nfnetlink_unicast will either free the nskb or add it to a socket */
583583 err = nfnetlink_unicast(nskb, net, queue->peer_portid, MSG_DONTWAIT);
584584 if (err < 0) {
585− queue->queue_user_dropped++;
585+ if (queue->flags & NFQA_CFG_F_FAIL_OPEN) {
586+ failopen = 1;
587+ err = 0;
588+ } else {
589+ queue->queue_user_dropped++;
590+ }
586591 goto err_out_unlock;
587592 }
588593
net/openvswitch/Kconfig+3−1
@@ -7,7 +7,9 @@ config OPENVSWITCH · 6 unmodified lines
77 depends on INET
88 depends on !NF_CONNTRACK || \
99 (NF_CONNTRACK && ((!NF_DEFRAG_IPV6 || NF_DEFRAG_IPV6) && \
10− (!NF_NAT || NF_NAT)))
10+ (!NF_NAT || NF_NAT) && \
11+ (!NF_NAT_IPV4 || NF_NAT_IPV4) && \
12+ (!NF_NAT_IPV6 || NF_NAT_IPV6)))
1113 select LIBCRC32C
1214 select MPLS
1315 select NET_MPLS_GSO
net/openvswitch/conntrack.c+13−11
@@ -535,14 +535,15 @@ static int ovs_ct_nat_execute(struct sk_buff *skb, struct nf_conn *ct, · 534 unmodified lines
535535 switch (ctinfo) {
536536 case IP_CT_RELATED:
537537 case IP_CT_RELATED_REPLY:
538− if (skb->protocol == htons(ETH_P_IP) &&
538+ if (IS_ENABLED(CONFIG_NF_NAT_IPV4) &&
539+ skb->protocol == htons(ETH_P_IP) &&
539540 ip_hdr(skb)->protocol == IPPROTO_ICMP) {
540541 if (!nf_nat_icmp_reply_translation(skb, ct, ctinfo,
541542 hooknum))
542543 err = NF_DROP;
543544 goto push;
544−#if IS_ENABLED(CONFIG_NF_NAT_IPV6)
545− } else if (skb->protocol == htons(ETH_P_IPV6)) {
545+ } else if (IS_ENABLED(CONFIG_NF_NAT_IPV6) &&
546+ skb->protocol == htons(ETH_P_IPV6)) {
546547 __be16 frag_off;
547548 u8 nexthdr = ipv6_hdr(skb)->nexthdr;
548549 int hdrlen = ipv6_skip_exthdr(skb,
@@ -557,7 +558,6 @@ static int ovs_ct_nat_execute(struct sk_buff *skb, struct nf_conn *ct, · 8 unmodified lines
557558 err = NF_DROP;
558559 goto push;
559560 }
560−#endif
561561 }
562562 /* Non-ICMP, fall thru to initialize if needed. */
563563 case IP_CT_NEW:
@@ -664,11 +664,12 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key, · 100 unmodified lines
664664
665665 /* Determine NAT type.
666666 * Check if the NAT type can be deduced from the tracked connection.
667− * Make sure expected traffic is NATted only when committing.
667+ * Make sure new expected connections (IP_CT_RELATED) are NATted only
668+ * when committing.
668669 */
669670 if (info->nat & OVS_CT_NAT && ctinfo != IP_CT_NEW &&
670671 ct->status & IPS_NAT_MASK &&
671− (!(ct->status & IPS_EXPECTED_BIT) || info->commit)) {
672+ (ctinfo != IP_CT_RELATED || info->commit)) {
672673 /* NAT an established or related connection like before. */
673674 if (CTINFO2DIR(ctinfo) == IP_CT_DIR_REPLY)
674675 /* This is the REPLY direction for a connection
@@ -968,7 +969,8 @@ static int parse_nat(const struct nlattr *attr, · 293 unmodified lines
968969 break;
969970
970971 case OVS_NAT_ATTR_IP_MIN:
971− nla_memcpy(&info->range.min_addr, a, nla_len(a));
972+ nla_memcpy(&info->range.min_addr, a,
973+ sizeof(info->range.min_addr));
972974 info->range.flags |= NF_NAT_RANGE_MAP_IPS;
973975 break;
974976
@@ -1238,7 +1240,8 @@ static bool ovs_ct_nat_to_attr(const struct ovs_conntrack_info *info, · 263 unmodified lines
12381240 }
12391241
12401242 if (info->range.flags & NF_NAT_RANGE_MAP_IPS) {
1241− if (info->family == NFPROTO_IPV4) {
1243+ if (IS_ENABLED(CONFIG_NF_NAT_IPV4) &&
1244+ info->family == NFPROTO_IPV4) {
12421245 if (nla_put_in_addr(skb, OVS_NAT_ATTR_IP_MIN,
12431246 info->range.min_addr.ip) ||
12441247 (info->range.max_addr.ip
@@ -1246,8 +1249,8 @@ static bool ovs_ct_nat_to_attr(const struct ovs_conntrack_info *info, · 1 unmodified line
12461249 (nla_put_in_addr(skb, OVS_NAT_ATTR_IP_MAX,
12471250 info->range.max_addr.ip))))
12481251 return false;
1249−#if IS_ENABLED(CONFIG_NF_NAT_IPV6)
1250− } else if (info->family == NFPROTO_IPV6) {
1252+ } else if (IS_ENABLED(CONFIG_NF_NAT_IPV6) &&
1253+ info->family == NFPROTO_IPV6) {
12511254 if (nla_put_in6_addr(skb, OVS_NAT_ATTR_IP_MIN,
12521255 &info->range.min_addr.in6) ||
12531256 (memcmp(&info->range.max_addr.in6,
@@ -1256,7 +1259,6 @@ static bool ovs_ct_nat_to_attr(const struct ovs_conntrack_info *info, · 2 unmodified lines
12561259 (nla_put_in6_addr(skb, OVS_NAT_ATTR_IP_MAX,
12571260 &info->range.max_addr.in6))))
12581261 return false;
1259−#endif
12601262 } else {
12611263 return false;
12621264 }
net/sctp/output.c+3−3
@@ -401,7 +401,7 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp) · 400 unmodified lines
401401 sk = chunk->skb->sk;
402402
403403 /* Allocate the new skb. */
404− nskb = alloc_skb(packet->size + MAX_HEADER, GFP_ATOMIC);
404+ nskb = alloc_skb(packet->size + MAX_HEADER, gfp);
405405 if (!nskb)
406406 goto nomem;
407407
@@ -523,8 +523,8 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp) · 115 unmodified lines
523523 */
524524 if (auth)
525525 sctp_auth_calculate_hmac(asoc, nskb,
526− (struct sctp_auth_chunk *)auth,
527− GFP_ATOMIC);
526+ (struct sctp_auth_chunk *)auth,
527+ gfp);
528528
529529 /* 2) Calculate the Adler-32 checksum of the whole packet,
530530 * including the SCTP common header and all the
net/switchdev/switchdev.c+1−1
@@ -1079,7 +1079,7 @@ nla_put_failure: · 1078 unmodified lines
10791079 * @filter_dev: filter device
10801080 * @idx:
10811081 *
1082− * Delete FDB entry from switch device.
1082+ * Dump FDB entries from switch device.
10831083 */
10841084 int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
10851085 struct net_device *dev,
net/xfrm/xfrm_input.c+3−0
@@ -292,12 +292,15 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) · 291 unmodified lines
292292 XFRM_SKB_CB(skb)->seq.input.hi = seq_hi;
293293
294294 skb_dst_force(skb);
295+ dev_hold(skb->dev);
295296
296297 nexthdr = x->type->input(x, skb);
297298
298299 if (nexthdr == -EINPROGRESS)
299300 return 0;
300301 resume:
302+ dev_put(skb->dev);
303+
301304 spin_lock(&x->lock);
302305 if (nexthdr <= 0) {
303306 if (nexthdr == -EBADMSG) {
sound/core/timer.c+15−9
@@ -1019,8 +1019,8 @@ static int snd_timer_s_start(struct snd_timer * timer) · 1018 unmodified lines
10191019 njiff += timer->sticks - priv->correction;
10201020 priv->correction = 0;
10211021 }
1022− priv->last_expires = priv->tlist.expires = njiff;
1023− add_timer(&priv->tlist);
1022+ priv->last_expires = njiff;
1023+ mod_timer(&priv->tlist, njiff);
10241024 return 0;
10251025 }
10261026
@@ -1502,17 +1502,13 @@ static int snd_timer_user_ginfo(struct file *file, · 475 unmodified lines
15021502 return err;
15031503 }
15041504
1505−static int snd_timer_user_gparams(struct file *file,
1506− struct snd_timer_gparams __user *_gparams)
1505+static int timer_set_gparams(struct snd_timer_gparams *gparams)
15071506 {
1508− struct snd_timer_gparams gparams;
15091507 struct snd_timer *t;
15101508 int err;
15111509
1512− if (copy_from_user(&gparams, _gparams, sizeof(gparams)))
1513− return -EFAULT;
15141510 mutex_lock(&register_mutex);
1515− t = snd_timer_find(&gparams.tid);
1511+ t = snd_timer_find(&gparams->tid);
15161512 if (!t) {
15171513 err = -ENODEV;
15181514 goto _error;
@@ -1525,12 +1521,22 @@ static int snd_timer_user_gparams(struct file *file, · 6 unmodified lines
15251521 err = -ENOSYS;
15261522 goto _error;
15271523 }
1528− err = t->hw.set_period(t, gparams.period_num, gparams.period_den);
1524+ err = t->hw.set_period(t, gparams->period_num, gparams->period_den);
15291525 _error:
15301526 mutex_unlock(&register_mutex);
15311527 return err;
15321528 }
15331529
1530+static int snd_timer_user_gparams(struct file *file,
1531+ struct snd_timer_gparams __user *_gparams)
1532+{
1533+ struct snd_timer_gparams gparams;
1534+
1535+ if (copy_from_user(&gparams, _gparams, sizeof(gparams)))
1536+ return -EFAULT;
1537+ return timer_set_gparams(&gparams);
1538+}
1539+
15341540 static int snd_timer_user_gstatus(struct file *file,
15351541 struct snd_timer_gstatus __user *_gstatus)
15361542 {
sound/core/timer_compat.c+29−1
@@ -22,6 +22,19 @@ · 21 unmodified lines
2222
2323 #include <linux/compat.h>
2424
25+/*
26+ * ILP32/LP64 has different size for 'long' type. Additionally, the size
27+ * of storage alignment differs depending on architectures. Here, '__packed'
28+ * qualifier is used so that the size of this structure is multiple of 4 and
29+ * it fits to any architectures with 32 bit storage alignment.
30+ */
31+struct snd_timer_gparams32 {
32+ struct snd_timer_id tid;
33+ u32 period_num;
34+ u32 period_den;
35+ unsigned char reserved[32];
36+} __packed;
37+
2538 struct snd_timer_info32 {
2639 u32 flags;
2740 s32 card;
@@ -32,6 +45,19 @@ struct snd_timer_info32 { · 4 unmodified lines
3245 unsigned char reserved[64];
3346 };
3447
48+static int snd_timer_user_gparams_compat(struct file *file,
49+ struct snd_timer_gparams32 __user *user)
50+{
51+ struct snd_timer_gparams gparams;
52+
53+ if (copy_from_user(&gparams.tid, &user->tid, sizeof(gparams.tid)) ||
54+ get_user(gparams.period_num, &user->period_num) ||
55+ get_user(gparams.period_den, &user->period_den))
56+ return -EFAULT;
57+
58+ return timer_set_gparams(&gparams);
59+}
60+
3561 static int snd_timer_user_info_compat(struct file *file,
3662 struct snd_timer_info32 __user *_info)
3763 {
@@ -99,6 +125,7 @@ static int snd_timer_user_status_compat(struct file *file, · 61 unmodified lines
99125 */
100126
101127 enum {
128+ SNDRV_TIMER_IOCTL_GPARAMS32 = _IOW('T', 0x04, struct snd_timer_gparams32),
102129 SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct snd_timer_info32),
103130 SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct snd_timer_status32),
104131 #ifdef CONFIG_X86_X32
@@ -114,7 +141,6 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, uns · 9 unmodified lines
114141 case SNDRV_TIMER_IOCTL_PVERSION:
115142 case SNDRV_TIMER_IOCTL_TREAD:
116143 case SNDRV_TIMER_IOCTL_GINFO:
117− case SNDRV_TIMER_IOCTL_GPARAMS:
118144 case SNDRV_TIMER_IOCTL_GSTATUS:
119145 case SNDRV_TIMER_IOCTL_SELECT:
120146 case SNDRV_TIMER_IOCTL_PARAMS:
@@ -128,6 +154,8 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, uns · 7 unmodified lines
128154 case SNDRV_TIMER_IOCTL_PAUSE_OLD:
129155 case SNDRV_TIMER_IOCTL_NEXT_DEVICE:
130156 return snd_timer_user_ioctl(file, cmd, (unsigned long)argp);
157+ case SNDRV_TIMER_IOCTL_GPARAMS32:
158+ return snd_timer_user_gparams_compat(file, argp);
131159 case SNDRV_TIMER_IOCTL_INFO32:
132160 return snd_timer_user_info_compat(file, argp);
133161 case SNDRV_TIMER_IOCTL_STATUS32:
sound/firewire/dice/dice-stream.c+4−10
@@ -446,18 +446,12 @@ end: · 445 unmodified lines
446446
447447 void snd_dice_stream_destroy_duplex(struct snd_dice *dice)
448448 {
449− struct reg_params tx_params, rx_params;
450−
451− snd_dice_transaction_clear_enable(dice);
449+ unsigned int i;
452450
453− if (get_register_params(dice, &tx_params, &rx_params) == 0) {
454− stop_streams(dice, AMDTP_IN_STREAM, &tx_params);
455− stop_streams(dice, AMDTP_OUT_STREAM, &rx_params);
451+ for (i = 0; i < MAX_STREAMS; i++) {
452+ destroy_stream(dice, AMDTP_IN_STREAM, i);
453+ destroy_stream(dice, AMDTP_OUT_STREAM, i);
456454 }
457−
458− release_resources(dice);
459−
460− dice->substreams_counter = 0;
461455 }
462456
463457 void snd_dice_stream_update_duplex(struct snd_dice *dice)
sound/pci/hda/hda_intel.c+4−0
@@ -2361,6 +2361,10 @@ static const struct pci_device_id azx_ids[] = { · 2360 unmodified lines
23612361 .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
23622362 { PCI_DEVICE(0x1002, 0xaae8),
23632363 .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
2364+ { PCI_DEVICE(0x1002, 0xaae0),
2365+ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
2366+ { PCI_DEVICE(0x1002, 0xaaf0),
2367+ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS },
23642368 /* VIA VT8251/VT8237A */
23652369 { PCI_DEVICE(0x1106, 0x3288), .driver_data = AZX_DRIVER_VIA },
23662370 /* VIA GFX VT7122/VX900 */
sound/pci/hda/patch_realtek.c+18−1
@@ -4759,6 +4759,7 @@ enum { · 4758 unmodified lines
47594759 ALC255_FIXUP_DELL_SPK_NOISE,
47604760 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
47614761 ALC280_FIXUP_HP_HEADSET_MIC,
4762+ ALC221_FIXUP_HP_FRONT_MIC,
47624763 };
47634764
47644765 static const struct hda_fixup alc269_fixups[] = {
@@ -5401,6 +5402,13 @@ static const struct hda_fixup alc269_fixups[] = { · 636 unmodified lines
54015402 .chained = true,
54025403 .chain_id = ALC269_FIXUP_HEADSET_MIC,
54035404 },
5405+ [ALC221_FIXUP_HP_FRONT_MIC] = {
5406+ .type = HDA_FIXUP_PINS,
5407+ .v.pins = (const struct hda_pintbl[]) {
5408+ { 0x19, 0x02a19020 }, /* Front Mic */
5409+ { }
5410+ },
5411+ },
54045412 };
54055413
54065414 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -5506,6 +5514,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 99 unmodified lines
55065514 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
55075515 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
55085516 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
5517+ SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
55095518 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
55105519 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
55115520 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
@@ -6406,6 +6415,7 @@ enum { · 894 unmodified lines
64066415 ALC668_FIXUP_AUTO_MUTE,
64076416 ALC668_FIXUP_DELL_DISABLE_AAMIX,
64086417 ALC668_FIXUP_DELL_XPS13,
6418+ ALC662_FIXUP_ASUS_Nx50,
64096419 };
64106420
64116421 static const struct hda_fixup alc662_fixups[] = {
@@ -6646,6 +6656,12 @@ static const struct hda_fixup alc662_fixups[] = { · 234 unmodified lines
66466656 .type = HDA_FIXUP_FUNC,
66476657 .v.func = alc_fixup_bass_chmap,
66486658 },
6659+ [ALC662_FIXUP_ASUS_Nx50] = {
6660+ .type = HDA_FIXUP_FUNC,
6661+ .v.func = alc_fixup_auto_mute_via_amp,
6662+ .chained = true,
6663+ .chain_id = ALC662_FIXUP_BASS_1A
6664+ },
66496665 };
66506666
66516667 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -6668,8 +6684,9 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { · 16 unmodified lines
66686684 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
66696685 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
66706686 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
6671− SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A),
6687+ SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
66726688 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
6689+ SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
66736690 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
66746691 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
66756692 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
sound/usb/quirks.c+4−0
@@ -150,6 +150,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, · 149 unmodified lines
150150 usb_audio_err(chip, "cannot memdup\n");
151151 return -ENOMEM;
152152 }
153+ INIT_LIST_HEAD(&fp->list);
153154 if (fp->nr_rates > MAX_NR_RATES) {
154155 kfree(fp);
155156 return -EINVAL;
@@ -193,6 +194,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip, · 37 unmodified lines
193194 return 0;
194195
195196 error:
197+ list_del(&fp->list); /* unlink for avoiding double-free */
196198 kfree(fp);
197199 kfree(rate_table);
198200 return err;
@@ -469,6 +471,7 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip, · 270 unmodified lines
469471 fp->ep_attr = get_endpoint(alts, 0)->bmAttributes;
470472 fp->datainterval = 0;
471473 fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
474+ INIT_LIST_HEAD(&fp->list);
472475
473476 switch (fp->maxpacksize) {
474477 case 0x120:
@@ -492,6 +495,7 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip, · 17 unmodified lines
492495 ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK;
493496 err = snd_usb_add_audio_stream(chip, stream, fp);
494497 if (err < 0) {
498+ list_del(&fp->list); /* unlink for avoiding double-free */
495499 kfree(fp);
496500 return err;
497501 }
sound/usb/stream.c+5−1
@@ -316,7 +316,9 @@ static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, · 315 unmodified lines
316316 /*
317317 * add this endpoint to the chip instance.
318318 * if a stream with the same endpoint already exists, append to it.
319− * if not, create a new pcm stream.
319+ * if not, create a new pcm stream. note, fp is added to the substream
320+ * fmt_list and will be freed on the chip instance release. do not free
321+ * fp or do remove it from the substream fmt_list to avoid double-free.
320322 */
321323 int snd_usb_add_audio_stream(struct snd_usb_audio *chip,
322324 int stream,
@@ -677,6 +679,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) · 354 unmodified lines
677679 * (fp->maxpacksize & 0x7ff);
678680 fp->attributes = parse_uac_endpoint_attributes(chip, alts, protocol, iface_no);
679681 fp->clock = clock;
682+ INIT_LIST_HEAD(&fp->list);
680683
681684 /* some quirks for attributes here */
682685
@@ -725,6 +728,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) · 42 unmodified lines
725728 dev_dbg(&dev->dev, "%u:%d: add audio endpoint %#x\n", iface_no, altno, fp->endpoint);
726729 err = snd_usb_add_audio_stream(chip, stream, fp);
727730 if (err < 0) {
731+ list_del(&fp->list); /* unlink for avoiding double-free */
728732 kfree(fp->rate_table);
729733 kfree(fp->chmap);
730734 kfree(fp);
tools/lib/lockdep/run_tests.sh+8−4
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 make &> /dev/null
44
55 for i in `ls tests/*.c`; do
6− testname=$(basename -s .c "$i")
6+ testname=$(basename "$i" .c)
77 gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null
88 echo -ne "$testname... "
99 if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then
@@ -11,11 +11,13 @@ for i in `ls tests/*.c`; do · 1 unmodified line
1111 else
1212 echo "FAILED!"
1313 fi
14− rm tests/$testname
14+ if [ -f "tests/$testname" ]; then
15+ rm tests/$testname
16+ fi
1517 done
1618
1719 for i in `ls tests/*.c`; do
18− testname=$(basename -s .c "$i")
20+ testname=$(basename "$i" .c)
1921 gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null
2022 echo -ne "(PRELOAD) $testname... "
2123 if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then
@@ -23,5 +25,7 @@ for i in `ls tests/*.c`; do · 1 unmodified line
2325 else
2426 echo "FAILED!"
2527 fi
26− rm tests/$testname
28+ if [ -f "tests/$testname" ]; then
29+ rm tests/$testname
30+ fi
2731 done
tools/perf/MANIFEST+1−0
@@ -74,6 +74,7 @@ arch/*/include/uapi/asm/unistd*.h · 73 unmodified lines
7474 arch/*/include/uapi/asm/perf_regs.h
7575 arch/*/lib/memcpy*.S
7676 arch/*/lib/memset*.S
77+arch/*/include/asm/*features.h
7778 include/linux/poison.h
7879 include/linux/hw_breakpoint.h
7980 include/uapi/linux/perf_event.h
tools/perf/arch/powerpc/util/header.c+2−0
@@ -4,6 +4,8 @@ · 3 unmodified lines
44 #include <stdlib.h>
55 #include <string.h>
66 #include <linux/stringify.h>
7+#include "header.h"
8+#include "util.h"
79
810 #define mfspr(rn) ({unsigned long rval; \
911 asm volatile("mfspr %0," __stringify(rn) \
tools/perf/tests/perf-targz-src-pkg+1−1
@@ -15,7 +15,7 @@ TMP_DEST=$(mktemp -d) · 14 unmodified lines
1515 tar xf ${TARBALL} -C $TMP_DEST
1616 rm -f ${TARBALL}
1717 cd - > /dev/null
18−make -C $TMP_DEST/perf*/tools/perf > /dev/null 2>&1
18+make -C $TMP_DEST/perf*/tools/perf > /dev/null
1919 RC=$?
2020 rm -rf ${TMP_DEST}
2121 exit $RC
tools/perf/ui/browsers/hists.c+1−1
@@ -337,7 +337,7 @@ static void callchain_node__init_have_children(struct callchain_node *node, · 336 unmodified lines
337337 chain = list_entry(node->val.next, struct callchain_list, list);
338338 chain->has_children = has_sibling;
339339
340− if (node->val.next != node->val.prev) {
340+ if (!list_empty(&node->val)) {
341341 chain = list_entry(node->val.prev, struct callchain_list, list);
342342 chain->has_children = !RB_EMPTY_ROOT(&node->rb_root);
343343 }
tools/perf/util/event.c+16−7
@@ -56,13 +56,22 @@ const char *perf_event__name(unsigned int id) · 55 unmodified lines
5656 return perf_event__names[id];
5757 }
5858
59−static struct perf_sample synth_sample = {
59+static int perf_tool__process_synth_event(struct perf_tool *tool,
60+ union perf_event *event,
61+ struct machine *machine,
62+ perf_event__handler_t process)
63+{
64+ struct perf_sample synth_sample = {
6065 .pid = -1,
6166 .tid = -1,
6267 .time = -1,
6368 .stream_id = -1,
6469 .cpu = -1,
6570 .period = 1,
71+ .cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK,
72+ };
73+
74+ return process(tool, event, &synth_sample, machine);
6675 };
6776
6877 /*
@@ -186,7 +195,7 @@ pid_t perf_event__synthesize_comm(struct perf_tool *tool, · 117 unmodified lines
186195 if (perf_event__prepare_comm(event, pid, machine, &tgid, &ppid) != 0)
187196 return -1;
188197
189− if (process(tool, event, &synth_sample, machine) != 0)
198+ if (perf_tool__process_synth_event(tool, event, machine, process) != 0)
190199 return -1;
191200
192201 return tgid;
@@ -218,7 +227,7 @@ static int perf_event__synthesize_fork(struct perf_tool *tool, · 25 unmodified lines
218227
219228 event->fork.header.size = (sizeof(event->fork) + machine->id_hdr_size);
220229
221− if (process(tool, event, &synth_sample, machine) != 0)
230+ if (perf_tool__process_synth_event(tool, event, machine, process) != 0)
222231 return -1;
223232
224233 return 0;
@@ -344,7 +353,7 @@ out: · 119 unmodified lines
344353 event->mmap2.pid = tgid;
345354 event->mmap2.tid = pid;
346355
347− if (process(tool, event, &synth_sample, machine) != 0) {
356+ if (perf_tool__process_synth_event(tool, event, machine, process) != 0) {
348357 rc = -1;
349358 break;
350359 }
@@ -402,7 +411,7 @@ int perf_event__synthesize_modules(struct perf_tool *tool, · 51 unmodified lines
402411
403412 memcpy(event->mmap.filename, pos->dso->long_name,
404413 pos->dso->long_name_len + 1);
405− if (process(tool, event, &synth_sample, machine) != 0) {
414+ if (perf_tool__process_synth_event(tool, event, machine, process) != 0) {
406415 rc = -1;
407416 break;
408417 }
@@ -472,7 +481,7 @@ static int __event__synthesize_thread(union perf_event *comm_event, · 63 unmodified lines
472481 /*
473482 * Send the prepared comm event
474483 */
475− if (process(tool, comm_event, &synth_sample, machine) != 0)
484+ if (perf_tool__process_synth_event(tool, comm_event, machine, process) != 0)
476485 break;
477486
478487 rc = 0;
@@ -701,7 +710,7 @@ int perf_event__synthesize_kernel_mmap(struct perf_tool *tool, · 222 unmodified lines
701710 event->mmap.len = map->end - event->mmap.start;
702711 event->mmap.pid = machine->pid;
703712
704− err = process(tool, event, &synth_sample, machine);
713+ err = perf_tool__process_synth_event(tool, event, machine, process);
705714 free(event);
706715
707716 return err;
tools/perf/util/genelf.h+10−14
@@ -9,36 +9,32 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent · 8 unmodified lines
99
1010 #if defined(__arm__)
1111 #define GEN_ELF_ARCH EM_ARM
12−#define GEN_ELF_ENDIAN ELFDATA2LSB
1312 #define GEN_ELF_CLASS ELFCLASS32
1413 #elif defined(__aarch64__)
1514 #define GEN_ELF_ARCH EM_AARCH64
16−#define GEN_ELF_ENDIAN ELFDATA2LSB
1715 #define GEN_ELF_CLASS ELFCLASS64
1816 #elif defined(__x86_64__)
1917 #define GEN_ELF_ARCH EM_X86_64
20−#define GEN_ELF_ENDIAN ELFDATA2LSB
2118 #define GEN_ELF_CLASS ELFCLASS64
2219 #elif defined(__i386__)
2320 #define GEN_ELF_ARCH EM_386
24−#define GEN_ELF_ENDIAN ELFDATA2LSB
2521 #define GEN_ELF_CLASS ELFCLASS32
26−#elif defined(__ppcle__)
27−#define GEN_ELF_ARCH EM_PPC
28−#define GEN_ELF_ENDIAN ELFDATA2LSB
29−#define GEN_ELF_CLASS ELFCLASS64
30−#elif defined(__powerpc__)
31−#define GEN_ELF_ARCH EM_PPC64
32−#define GEN_ELF_ENDIAN ELFDATA2MSB
33−#define GEN_ELF_CLASS ELFCLASS64
34−#elif defined(__powerpcle__)
22+#elif defined(__powerpc64__)
3523 #define GEN_ELF_ARCH EM_PPC64
36−#define GEN_ELF_ENDIAN ELFDATA2LSB
3724 #define GEN_ELF_CLASS ELFCLASS64
25+#elif defined(__powerpc__)
26+#define GEN_ELF_ARCH EM_PPC
27+#define GEN_ELF_CLASS ELFCLASS32
3828 #else
3929 #error "unsupported architecture"
4030 #endif
4131
32+#if __BYTE_ORDER == __BIG_ENDIAN
33+#define GEN_ELF_ENDIAN ELFDATA2MSB
34+#else
35+#define GEN_ELF_ENDIAN ELFDATA2LSB
36+#endif
37+
4238 #if GEN_ELF_CLASS == ELFCLASS64
4339 #define elf_newehdr elf64_newehdr
4440 #define elf_getshdr elf64_getshdr
tools/perf/util/intel-bts.c+1−0
@@ -279,6 +279,7 @@ static int intel_bts_synth_branch_sample(struct intel_bts_queue *btsq, · 278 unmodified lines
279279 event.sample.header.misc = PERF_RECORD_MISC_USER;
280280 event.sample.header.size = sizeof(struct perf_event_header);
281281
282+ sample.cpumode = PERF_RECORD_MISC_USER;
282283 sample.ip = le64_to_cpu(branch->from);
283284 sample.pid = btsq->pid;
284285 sample.tid = btsq->tid;
tools/perf/util/intel-pt.c+3−0
@@ -979,6 +979,7 @@ static int intel_pt_synth_branch_sample(struct intel_pt_queue *ptq) · 978 unmodified lines
979979 if (!pt->timeless_decoding)
980980 sample.time = tsc_to_perf_time(ptq->timestamp, &pt->tc);
981981
982+ sample.cpumode = PERF_RECORD_MISC_USER;
982983 sample.ip = ptq->state->from_ip;
983984 sample.pid = ptq->pid;
984985 sample.tid = ptq->tid;
@@ -1035,6 +1036,7 @@ static int intel_pt_synth_instruction_sample(struct intel_pt_queue *ptq) · 50 unmodified lines
10351036 if (!pt->timeless_decoding)
10361037 sample.time = tsc_to_perf_time(ptq->timestamp, &pt->tc);
10371038
1039+ sample.cpumode = PERF_RECORD_MISC_USER;
10381040 sample.ip = ptq->state->from_ip;
10391041 sample.pid = ptq->pid;
10401042 sample.tid = ptq->tid;
@@ -1092,6 +1094,7 @@ static int intel_pt_synth_transaction_sample(struct intel_pt_queue *ptq) · 51 unmodified lines
10921094 if (!pt->timeless_decoding)
10931095 sample.time = tsc_to_perf_time(ptq->timestamp, &pt->tc);
10941096
1097+ sample.cpumode = PERF_RECORD_MISC_USER;
10951098 sample.ip = ptq->state->from_ip;
10961099 sample.pid = ptq->pid;
10971100 sample.tid = ptq->tid;
tools/perf/util/jitdump.c+2−0
@@ -417,6 +417,7 @@ static int jit_repipe_code_load(struct jit_buf_desc *jd, union jr_entry *jr) · 416 unmodified lines
417417 * use first address as sample address
418418 */
419419 memset(&sample, 0, sizeof(sample));
420+ sample.cpumode = PERF_RECORD_MISC_USER;
420421 sample.pid = pid;
421422 sample.tid = tid;
422423 sample.time = id->time;
@@ -505,6 +506,7 @@ static int jit_repipe_code_move(struct jit_buf_desc *jd, union jr_entry *jr) · 82 unmodified lines
505506 * use first address as sample address
506507 */
507508 memset(&sample, 0, sizeof(sample));
509+ sample.cpumode = PERF_RECORD_MISC_USER;
508510 sample.pid = pid;
509511 sample.tid = tid;
510512 sample.time = id->time;