History

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

Minor overlapping changes in the conflicts. In the macsec case, the change of the default ID macro name overlapped with the 64-bit netlink attribute alignment fixes in net-next.

David S. Miller committed 10 years ago

Commit c0cc5312 parents 8c14586 f28f20d137 files · +1416 −698Browse files

Unified · Split

137 files
  1. Documentation/devicetree/bindings/arm/cpus.txt +0 −1
  2. Documentation/devicetree/bindings/phy/rockchip-dp-phy.txt +11 −7
  3. Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt +14 −8
  4. Documentation/input/event-codes.txt +4 −0
  5. Documentation/x86/x86_64/mm.txt +3 −3
  6. MAINTAINERS +9 −0
  7. Makefile +3 −2
  8. arch/arm/boot/dts/am33xx.dtsi +1 −1
  9. arch/arm/boot/dts/am4372.dtsi +1 −1
  10. arch/arm/boot/dts/am57xx-beagle-x15.dts +0 −17
  11. arch/arm/boot/dts/dm814x-clocks.dtsi +212 −31
  12. arch/arm/boot/dts/dra62x-clocks.dtsi +26 −0
  13. arch/arm/boot/dts/dra7xx-clocks.dtsi +17 −1
  14. arch/arm/boot/dts/qcom-msm8974.dtsi +1 −13
  15. arch/arm/boot/dts/r8a7791-koelsch.dts +1 −0
  16. arch/arm/boot/dts/r8a7791-porter.dts +1 −13
  17. arch/arm/boot/dts/r8a7791.dtsi +1 −4
  18. arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c +3 −2
  19. arch/arm/mach-omap2/clockdomains7xx_data.c +1 −1
  20. arch/arm/mach-omap2/io.c +2 −1
  21. arch/arm/mach-omap2/omap-wakeupgen.c +7 −0
  22. arch/arm/mach-omap2/pm34xx.c +13 −10
  23. arch/arm/mach-shmobile/timer.c +11 −17
  24. arch/arm64/boot/dts/socionext/uniphier-ph1-ld20-ref.dts +0 −1
  25. arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi +5 −15
  26. arch/arm64/kernel/head.S +12 −1
  27. arch/arm64/kernel/smp_spin_table.c +6 −5
  28. arch/powerpc/include/uapi/asm/cputable.h +1 −0
  29. arch/powerpc/kernel/prom.c +15 −11
  30. arch/x86/include/asm/hugetlb.h +1 −0
  31. arch/x86/kernel/cpu/mshyperv.c +12 −0
  32. drivers/clocksource/tango_xtal.c +1 −1
  33. drivers/crypto/talitos.c +57 −30
  34. drivers/edac/sb_edac.c +26 −4
  35. drivers/firmware/psci.c +1 −1
  36. drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 −0
  37. drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +4 −0
  38. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 −1
  39. drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +3 −3
  40. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 −0
  41. drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +5 −0
  42. drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +1 −0
  43. drivers/gpu/drm/drm_dp_mst_topology.c +8 −1
  44. drivers/gpu/drm/i915/i915_drv.h +3 −2
  45. drivers/gpu/drm/i915/i915_gem_userptr.c +17 −12
  46. drivers/gpu/drm/i915/intel_lrc.c +11 −5
  47. drivers/gpu/drm/i915/intel_pm.c +28 −14
  48. drivers/gpu/drm/i915/intel_ringbuffer.c +11 −7
  49. drivers/gpu/drm/i915/intel_uncore.c +5 −1
  50. drivers/gpu/drm/nouveau/nouveau_connector.c +2 −2
  51. drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +2 −0
  52. drivers/gpu/drm/radeon/radeon_atpx_handler.c +7 −4
  53. drivers/gpu/drm/radeon/radeon_connectors.c +6 −1
  54. drivers/gpu/drm/radeon/radeon_device.c +4 −10
  55. drivers/gpu/drm/radeon/radeon_ttm.c +2 −0
  56. drivers/gpu/drm/radeon/si_dpm.c +1 −0
  57. drivers/infiniband/hw/mlx5/main.c +2 −2
  58. drivers/input/joystick/xpad.c +2 −0
  59. drivers/input/misc/arizona-haptics.c +0 −1
  60. drivers/input/misc/pmic8xxx-pwrkey.c +4 −3
  61. drivers/input/misc/twl4030-vibra.c +0 −1
  62. drivers/input/misc/twl6040-vibra.c +1 −7
  63. drivers/input/tablet/gtco.c +9 −1
  64. drivers/iommu/amd_iommu.c +76 −11
  65. drivers/iommu/arm-smmu.c +15 −7
  66. drivers/irqchip/irq-mips-gic.c +2 −2
  67. drivers/net/Kconfig +2 −3
  68. drivers/net/ethernet/mellanox/mlx4/en_tx.c +4 −2
  69. drivers/net/ethernet/mellanox/mlx5/core/en.h +1 −1
  70. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +4 −4
  71. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +57 −15
  72. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +18 −30
  73. drivers/net/ethernet/mellanox/mlx5/core/main.c +21 −4
  74. drivers/net/ethernet/mellanox/mlx5/core/port.c +5 −5
  75. drivers/net/ethernet/mellanox/mlx5/core/vport.c +40 −0
  76. drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +2 −2
  77. drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +16 −34
  78. drivers/net/macsec.c +40 −23
  79. drivers/perf/arm_pmu.c +13 −2
  80. drivers/phy/phy-rockchip-dp.c +5 −2
  81. drivers/phy/phy-rockchip-emmc.c +4 −1
  82. drivers/pinctrl/freescale/Kconfig +1 −0
  83. drivers/pinctrl/mediatek/pinctrl-mtk-common.c +5 −4
  84. drivers/pinctrl/pinctrl-single.c +3 −3
  85. drivers/scsi/cxgbi/libcxgbi.c +1 −0
  86. drivers/soc/mediatek/mtk-scpsys.c +6 −5
  87. drivers/thermal/Kconfig +2 −0
  88. drivers/thermal/mtk_thermal.c +1 −2
  89. drivers/thermal/of-thermal.c +2 −2
  90. drivers/thermal/power_allocator.c +1 −1
  91. drivers/thermal/thermal_core.c +4 −4
  92. drivers/tty/pty.c +8 −10
  93. drivers/tty/serial/8250/8250_port.c +10 −1
  94. drivers/tty/serial/8250/Kconfig +0 −1
  95. drivers/tty/serial/uartlite.c +4 −4
  96. drivers/tty/tty_io.c +3 −3
  97. drivers/usb/dwc3/core.c +22 −1
  98. drivers/usb/dwc3/debugfs.c +8 −5
  99. drivers/usb/dwc3/dwc3-omap.c +4 −8
  100. drivers/usb/dwc3/gadget.c +6 −0
  101. drivers/usb/gadget/composite.c +2 −0
  102. drivers/usb/gadget/function/f_fs.c +2 −3
  103. fs/devpts/inode.c +12 −41
  104. include/asm-generic/futex.h +6 −2
  105. include/drm/drm_cache.h +2 −0
  106. include/linux/devpts_fs.h +3 −3
  107. include/linux/mlx5/driver.h +4 −3
  108. include/linux/mlx5/port.h +3 −3
  109. include/linux/mlx5/vport.h +2 −0
  110. include/linux/thermal.h +2 −2
  111. include/linux/tty_driver.h +2 −2
  112. include/net/switchdev.h +4 −0
  113. include/sound/hda_regmap.h +2 −0
  114. include/uapi/asm-generic/unistd.h +5 −1
  115. include/uapi/linux/if_macsec.h +2 −2
  116. kernel/bpf/verifier.c +0 −1
  117. kernel/cpu.c +26 −7
  118. kernel/futex.c +23 −4
  119. kernel/irq/ipi.c +1 −0
  120. kernel/locking/qspinlock_stat.h +5 −3
  121. net/bridge/br_mdb.c +79 −45
  122. net/bridge/br_multicast.c +5 −3
  123. net/bridge/br_private.h +2 −2
  124. net/ipv4/fib_frontend.c +5 −1
  125. net/ipv6/addrconf.c +15 −33
  126. net/switchdev/switchdev.c +6 −0
  127. sound/hda/hdac_device.c +4 −6
  128. sound/hda/hdac_regmap.c +28 −12
  129. sound/pci/hda/hda_generic.c +4 −2
  130. sound/pci/hda/hda_intel.c +3 −0
  131. sound/pci/hda/patch_cirrus.c +14 −0
  132. sound/pci/hda/patch_hdmi.c +2 −0
  133. sound/pci/hda/patch_realtek.c +1 −0
  134. sound/pci/pcxhr/pcxhr_core.c +1 −0
  135. tools/objtool/Documentation/stack-validation.txt +29 −9
  136. tools/objtool/builtin-check.c +72 −25
  137. tools/perf/util/intel-pt.c +1 −1
Documentation/devicetree/bindings/arm/cpus.txt+0−1
@@ -192,7 +192,6 @@ nodes to be present and contain the properties described below. · 191 unmodified lines
192192 can be one of:
193193 "allwinner,sun6i-a31"
194194 "allwinner,sun8i-a23"
195− "arm,psci"
196195 "arm,realview-smp"
197196 "brcm,bcm-nsp-smp"
198197 "brcm,brahma-b15"
Documentation/devicetree/bindings/phy/rockchip-dp-phy.txt+11−7
@@ -8,15 +8,19 @@ Required properties: · 7 unmodified lines
88 of memory mapped region.
99 - clock-names: from common clock binding:
1010 Required elements: "24m"
11−- rockchip,grf: phandle to the syscon managing the "general register files"
1211 - #phy-cells : from the generic PHY bindings, must be 0;
1312
1413 Example:
1514
16−edp_phy: edp-phy {
17− compatible = "rockchip,rk3288-dp-phy";
18− rockchip,grf = <&grf>;
19− clocks = <&cru SCLK_EDP_24M>;
20− clock-names = "24m";
21− #phy-cells = <0>;
15+grf: syscon@ff770000 {
16+ compatible = "rockchip,rk3288-grf", "syscon", "simple-mfd";
17+
18+...
19+
20+ edp_phy: edp-phy {
21+ compatible = "rockchip,rk3288-dp-phy";
22+ clocks = <&cru SCLK_EDP_24M>;
23+ clock-names = "24m";
24+ #phy-cells = <0>;
25+ };
2226 };
Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt+14−8
@@ -3,17 +3,23 @@ Rockchip EMMC PHY · 2 unmodified lines
33
44 Required properties:
55 - compatible: rockchip,rk3399-emmc-phy
6− - rockchip,grf : phandle to the syscon managing the "general
7− register files"
86 - #phy-cells: must be 0
9− - reg: PHY configure reg address offset in "general
7+ - reg: PHY register address offset and length in "general
108 register files"
119
1210 Example:
1311
14−emmcphy: phy {
15− compatible = "rockchip,rk3399-emmc-phy";
16− rockchip,grf = <&grf>;
17− reg = <0xf780>;
18− #phy-cells = <0>;
12+
13+grf: syscon@ff770000 {
14+ compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";
15+ #address-cells = <1>;
16+ #size-cells = <1>;
17+
18+...
19+
20+ emmcphy: phy@f780 {
21+ compatible = "rockchip,rk3399-emmc-phy";
22+ reg = <0xf780 0x20>;
23+ #phy-cells = <0>;
24+ };
1925 };
Documentation/input/event-codes.txt+4−0
@@ -173,6 +173,10 @@ A few EV_ABS codes have special meanings: · 172 unmodified lines
173173 proximity of the device and while the value of the BTN_TOUCH code is 0. If
174174 the input device may be used freely in three dimensions, consider ABS_Z
175175 instead.
176+ - BTN_TOOL_<name> should be set to 1 when the tool comes into detectable
177+ proximity and set to 0 when the tool leaves detectable proximity.
178+ BTN_TOOL_<name> signals the type of tool that is currently detected by the
179+ hardware and is otherwise independent of ABS_DISTANCE and/or BTN_TOUCH.
176180
177181 * ABS_MT_<name>:
178182 - Used to describe multitouch input events. Please see
Documentation/x86/x86_64/mm.txt+3−3
@@ -19,7 +19,7 @@ ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks · 18 unmodified lines
1919 ffffffef00000000 - ffffffff00000000 (=64 GB) EFI region mapping space
2020 ... unused hole ...
2121 ffffffff80000000 - ffffffffa0000000 (=512 MB) kernel text mapping, from phys 0
22−ffffffffa0000000 - ffffffffff5fffff (=1525 MB) module mapping space
22+ffffffffa0000000 - ffffffffff5fffff (=1526 MB) module mapping space
2323 ffffffffff600000 - ffffffffffdfffff (=8 MB) vsyscalls
2424 ffffffffffe00000 - ffffffffffffffff (=2 MB) unused hole
2525
@@ -31,8 +31,8 @@ vmalloc space is lazily synchronized into the different PML4 pages of · 5 unmodified lines
3131 the processes using the page fault handler, with init_level4_pgt as
3232 reference.
3333
34−Current X86-64 implementations only support 40 bits of address space,
35−but we support up to 46 bits. This expands into MBZ space in the page tables.
34+Current X86-64 implementations support up to 46 bits of address space (64 TB),
35+which is our current limit. This expands into MBZ space in the page tables.
3636
3737 We map EFI runtime services in the 'efi_pgd' PGD in a 64Gb large virtual
3838 memory window (this size is arbitrary, it can be raised later if needed).
MAINTAINERS+9−0
@@ -11072,6 +11072,15 @@ S: Maintained · 11071 unmodified lines
1107211072 F: drivers/clk/ti/
1107311073 F: include/linux/clk/ti.h
1107411074
11075+TI ETHERNET SWITCH DRIVER (CPSW)
11076+M: Mugunthan V N <mugunthanvnm@ti.com>
11077+R: Grygorii Strashko <grygorii.strashko@ti.com>
11078+L: linux-omap@vger.kernel.org
11079+L: netdev@vger.kernel.org
11080+S: Maintained
11081+F: drivers/net/ethernet/ti/cpsw*
11082+F: drivers/net/ethernet/ti/davinci*
11083+
1107511084 TI FLASH MEDIA INTERFACE DRIVER
1107611085 M: Alex Dubov <oakad@yahoo.com>
1107711086 S: Maintained
Makefile+3−2
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 6
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc4
4+EXTRAVERSION = -rc5
55 NAME = Blurry Fish Butt
66
77 # *DOCUMENTATION*
@@ -1008,7 +1008,8 @@ prepare0: archprepare FORCE · 1000 unmodified lines
10081008 prepare: prepare0 prepare-objtool
10091009
10101010 ifdef CONFIG_STACK_VALIDATION
1011− has_libelf := $(shell echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf - &> /dev/null && echo 1 || echo 0)
1011+ has_libelf := $(call try-run,\
1012+ echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0)
10121013 ifeq ($(has_libelf),1)
10131014 objtool_target := tools/objtool FORCE
10141015 else
arch/arm/boot/dts/am33xx.dtsi+1−1
@@ -860,7 +860,7 @@ · 859 unmodified lines
860860 ti,no-idle-on-init;
861861 reg = <0x50000000 0x2000>;
862862 interrupts = <100>;
863− dmas = <&edma 52>;
863+ dmas = <&edma 52 0>;
864864 dma-names = "rxtx";
865865 gpmc,num-cs = <7>;
866866 gpmc,num-waitpins = <2>;
arch/arm/boot/dts/am4372.dtsi+1−1
@@ -884,7 +884,7 @@ · 883 unmodified lines
884884 gpmc: gpmc@50000000 {
885885 compatible = "ti,am3352-gpmc";
886886 ti,hwmods = "gpmc";
887− dmas = <&edma 52>;
887+ dmas = <&edma 52 0>;
888888 dma-names = "rxtx";
889889 clocks = <&l3s_gclk>;
890890 clock-names = "fck";
arch/arm/boot/dts/am57xx-beagle-x15.dts+0−17
@@ -99,13 +99,6 @@ · 98 unmodified lines
9999 #cooling-cells = <2>;
100100 };
101101
102− extcon_usb1: extcon_usb1 {
103− compatible = "linux,extcon-usb-gpio";
104− id-gpio = <&gpio7 25 GPIO_ACTIVE_HIGH>;
105− pinctrl-names = "default";
106− pinctrl-0 = <&extcon_usb1_pins>;
107− };
108−
109102 hdmi0: connector {
110103 compatible = "hdmi-connector";
111104 label = "hdmi";
@@ -349,12 +342,6 @@ · 237 unmodified lines
349342 >;
350343 };
351344
352− extcon_usb1_pins: extcon_usb1_pins {
353− pinctrl-single,pins = <
354− DRA7XX_CORE_IOPAD(0x37ec, PIN_INPUT_PULLUP | MUX_MODE14) /* uart1_rtsn.gpio7_25 */
355− >;
356− };
357−
358345 tpd12s015_pins: pinmux_tpd12s015_pins {
359346 pinctrl-single,pins = <
360347 DRA7XX_CORE_IOPAD(0x37b0, PIN_OUTPUT | MUX_MODE14) /* gpio7_10 CT_CP_HPD */
@@ -706,10 +693,6 @@ · 345 unmodified lines
706693 pinctrl-0 = <&usb1_pins>;
707694 };
708695
709−&omap_dwc3_1 {
710− extcon = <&extcon_usb1>;
711−};
712−
713696 &omap_dwc3_2 {
714697 extcon = <&extcon_usb2>;
715698 };
arch/arm/boot/dts/dm814x-clocks.dtsi+212−31
@@ -4,6 +4,157 @@ · 3 unmodified lines
44 * published by the Free Software Foundation.
55 */
66
7+&pllss {
8+ /*
9+ * See TRM "2.6.10 Connected outputso DPLLS" and
10+ * "2.6.11 Connected Outputs of DPLLJ". Only clkout is
11+ * connected except for hdmi and usb.
12+ */
13+ adpll_mpu_ck: adpll@40 {
14+ #clock-cells = <1>;
15+ compatible = "ti,dm814-adpll-s-clock";
16+ reg = <0x40 0x40>;
17+ clocks = <&devosc_ck &devosc_ck &devosc_ck>;
18+ clock-names = "clkinp", "clkinpulow", "clkinphif";
19+ clock-output-names = "481c5040.adpll.dcoclkldo",
20+ "481c5040.adpll.clkout",
21+ "481c5040.adpll.clkoutx2",
22+ "481c5040.adpll.clkouthif";
23+ };
24+
25+ adpll_dsp_ck: adpll@80 {
26+ #clock-cells = <1>;
27+ compatible = "ti,dm814-adpll-lj-clock";
28+ reg = <0x80 0x30>;
29+ clocks = <&devosc_ck &devosc_ck>;
30+ clock-names = "clkinp", "clkinpulow";
31+ clock-output-names = "481c5080.adpll.dcoclkldo",
32+ "481c5080.adpll.clkout",
33+ "481c5080.adpll.clkoutldo";
34+ };
35+
36+ adpll_sgx_ck: adpll@b0 {
37+ #clock-cells = <1>;
38+ compatible = "ti,dm814-adpll-lj-clock";
39+ reg = <0xb0 0x30>;
40+ clocks = <&devosc_ck &devosc_ck>;
41+ clock-names = "clkinp", "clkinpulow";
42+ clock-output-names = "481c50b0.adpll.dcoclkldo",
43+ "481c50b0.adpll.clkout",
44+ "481c50b0.adpll.clkoutldo";
45+ };
46+
47+ adpll_hdvic_ck: adpll@e0 {
48+ #clock-cells = <1>;
49+ compatible = "ti,dm814-adpll-lj-clock";
50+ reg = <0xe0 0x30>;
51+ clocks = <&devosc_ck &devosc_ck>;
52+ clock-names = "clkinp", "clkinpulow";
53+ clock-output-names = "481c50e0.adpll.dcoclkldo",
54+ "481c50e0.adpll.clkout",
55+ "481c50e0.adpll.clkoutldo";
56+ };
57+
58+ adpll_l3_ck: adpll@110 {
59+ #clock-cells = <1>;
60+ compatible = "ti,dm814-adpll-lj-clock";
61+ reg = <0x110 0x30>;
62+ clocks = <&devosc_ck &devosc_ck>;
63+ clock-names = "clkinp", "clkinpulow";
64+ clock-output-names = "481c5110.adpll.dcoclkldo",
65+ "481c5110.adpll.clkout",
66+ "481c5110.adpll.clkoutldo";
67+ };
68+
69+ adpll_isp_ck: adpll@140 {
70+ #clock-cells = <1>;
71+ compatible = "ti,dm814-adpll-lj-clock";
72+ reg = <0x140 0x30>;
73+ clocks = <&devosc_ck &devosc_ck>;
74+ clock-names = "clkinp", "clkinpulow";
75+ clock-output-names = "481c5140.adpll.dcoclkldo",
76+ "481c5140.adpll.clkout",
77+ "481c5140.adpll.clkoutldo";
78+ };
79+
80+ adpll_dss_ck: adpll@170 {
81+ #clock-cells = <1>;
82+ compatible = "ti,dm814-adpll-lj-clock";
83+ reg = <0x170 0x30>;
84+ clocks = <&devosc_ck &devosc_ck>;
85+ clock-names = "clkinp", "clkinpulow";
86+ clock-output-names = "481c5170.adpll.dcoclkldo",
87+ "481c5170.adpll.clkout",
88+ "481c5170.adpll.clkoutldo";
89+ };
90+
91+ adpll_video0_ck: adpll@1a0 {
92+ #clock-cells = <1>;
93+ compatible = "ti,dm814-adpll-lj-clock";
94+ reg = <0x1a0 0x30>;
95+ clocks = <&devosc_ck &devosc_ck>;
96+ clock-names = "clkinp", "clkinpulow";
97+ clock-output-names = "481c51a0.adpll.dcoclkldo",
98+ "481c51a0.adpll.clkout",
99+ "481c51a0.adpll.clkoutldo";
100+ };
101+
102+ adpll_video1_ck: adpll@1d0 {
103+ #clock-cells = <1>;
104+ compatible = "ti,dm814-adpll-lj-clock";
105+ reg = <0x1d0 0x30>;
106+ clocks = <&devosc_ck &devosc_ck>;
107+ clock-names = "clkinp", "clkinpulow";
108+ clock-output-names = "481c51d0.adpll.dcoclkldo",
109+ "481c51d0.adpll.clkout",
110+ "481c51d0.adpll.clkoutldo";
111+ };
112+
113+ adpll_hdmi_ck: adpll@200 {
114+ #clock-cells = <1>;
115+ compatible = "ti,dm814-adpll-lj-clock";
116+ reg = <0x200 0x30>;
117+ clocks = <&devosc_ck &devosc_ck>;
118+ clock-names = "clkinp", "clkinpulow";
119+ clock-output-names = "481c5200.adpll.dcoclkldo",
120+ "481c5200.adpll.clkout",
121+ "481c5200.adpll.clkoutldo";
122+ };
123+
124+ adpll_audio_ck: adpll@230 {
125+ #clock-cells = <1>;
126+ compatible = "ti,dm814-adpll-lj-clock";
127+ reg = <0x230 0x30>;
128+ clocks = <&devosc_ck &devosc_ck>;
129+ clock-names = "clkinp", "clkinpulow";
130+ clock-output-names = "481c5230.adpll.dcoclkldo",
131+ "481c5230.adpll.clkout",
132+ "481c5230.adpll.clkoutldo";
133+ };
134+
135+ adpll_usb_ck: adpll@260 {
136+ #clock-cells = <1>;
137+ compatible = "ti,dm814-adpll-lj-clock";
138+ reg = <0x260 0x30>;
139+ clocks = <&devosc_ck &devosc_ck>;
140+ clock-names = "clkinp", "clkinpulow";
141+ clock-output-names = "481c5260.adpll.dcoclkldo",
142+ "481c5260.adpll.clkout",
143+ "481c5260.adpll.clkoutldo";
144+ };
145+
146+ adpll_ddr_ck: adpll@290 {
147+ #clock-cells = <1>;
148+ compatible = "ti,dm814-adpll-lj-clock";
149+ reg = <0x290 0x30>;
150+ clocks = <&devosc_ck &devosc_ck>;
151+ clock-names = "clkinp", "clkinpulow";
152+ clock-output-names = "481c5290.adpll.dcoclkldo",
153+ "481c5290.adpll.clkout",
154+ "481c5290.adpll.clkoutldo";
155+ };
156+};
157+
7158 &pllss_clocks {
8159 timer1_fck: timer1_fck {
9160 #clock-cells = <0>;
@@ -23,6 +174,24 @@ · 13 unmodified lines
23174 reg = <0x2e0>;
24175 };
25176
177+ /* CPTS_RFT_CLK in RMII_REFCLK_SRC, usually sourced from auiod */
178+ cpsw_cpts_rft_clk: cpsw_cpts_rft_clk {
179+ #clock-cells = <0>;
180+ compatible = "ti,mux-clock";
181+ clocks = <&adpll_video0_ck 1
182+ &adpll_video1_ck 1
183+ &adpll_audio_ck 1>;
184+ ti,bit-shift = <1>;
185+ reg = <0x2e8>;
186+ };
187+
188+ /* REVISIT: Set up with a proper mux using RMII_REFCLK_SRC */
189+ cpsw_125mhz_gclk: cpsw_125mhz_gclk {
190+ #clock-cells = <0>;
191+ compatible = "fixed-clock";
192+ clock-frequency = <125000000>;
193+ };
194+
26195 sysclk18_ck: sysclk18_ck {
27196 #clock-cells = <0>;
28197 compatible = "ti,mux-clock";
@@ -79,37 +248,6 @@ · 50 unmodified lines
79248 compatible = "fixed-clock";
80249 clock-frequency = <1000000000>;
81250 };
82−
83− sysclk4_ck: sysclk4_ck {
84− #clock-cells = <0>;
85− compatible = "fixed-clock";
86− clock-frequency = <222000000>;
87− };
88−
89− sysclk6_ck: sysclk6_ck {
90− #clock-cells = <0>;
91− compatible = "fixed-clock";
92− clock-frequency = <100000000>;
93− };
94−
95− sysclk10_ck: sysclk10_ck {
96− #clock-cells = <0>;
97− compatible = "fixed-clock";
98− clock-frequency = <48000000>;
99− };
100−
101− cpsw_125mhz_gclk: cpsw_125mhz_gclk {
102− #clock-cells = <0>;
103− compatible = "fixed-clock";
104− clock-frequency = <125000000>;
105− };
106−
107− cpsw_cpts_rft_clk: cpsw_cpts_rft_clk {
108− #clock-cells = <0>;
109− compatible = "fixed-clock";
110− clock-frequency = <250000000>;
111− };
112−
113251 };
114252
115253 &prcm_clocks {
@@ -138,6 +276,49 @@ · 22 unmodified lines
138276 clock-div = <78125>;
139277 };
140278
279+ /* L4_HS 220 MHz*/
280+ sysclk4_ck: sysclk4_ck {
281+ #clock-cells = <0>;
282+ compatible = "ti,fixed-factor-clock";
283+ clocks = <&adpll_l3_ck 1>;
284+ ti,clock-mult = <1>;
285+ ti,clock-div = <1>;
286+ };
287+
288+ /* L4_FWCFG */
289+ sysclk5_ck: sysclk5_ck {
290+ #clock-cells = <0>;
291+ compatible = "ti,fixed-factor-clock";
292+ clocks = <&adpll_l3_ck 1>;
293+ ti,clock-mult = <1>;
294+ ti,clock-div = <2>;
295+ };
296+
297+ /* L4_LS 110 MHz */
298+ sysclk6_ck: sysclk6_ck {
299+ #clock-cells = <0>;
300+ compatible = "ti,fixed-factor-clock";
301+ clocks = <&adpll_l3_ck 1>;
302+ ti,clock-mult = <1>;
303+ ti,clock-div = <2>;
304+ };
305+
306+ sysclk8_ck: sysclk8_ck {
307+ #clock-cells = <0>;
308+ compatible = "ti,fixed-factor-clock";
309+ clocks = <&adpll_usb_ck 1>;
310+ ti,clock-mult = <1>;
311+ ti,clock-div = <1>;
312+ };
313+
314+ sysclk10_ck: sysclk10_ck {
315+ compatible = "ti,divider-clock";
316+ reg = <0x324>;
317+ ti,max-div = <7>;
318+ #clock-cells = <0>;
319+ clocks = <&adpll_usb_ck 1>;
320+ };
321+
141322 aud_clkin0_ck: aud_clkin0_ck {
142323 #clock-cells = <0>;
143324 compatible = "fixed-clock";
arch/arm/boot/dts/dra62x-clocks.dtsi+26−0
@@ -6,6 +6,32 @@ · 5 unmodified lines
66
77 #include "dm814x-clocks.dtsi"
88
9+/* Compared to dm814x, dra62x does not have hdic, l3 or dss PLLs */
10+&adpll_hdvic_ck {
11+ status = "disabled";
12+};
13+
14+&adpll_l3_ck {
15+ status = "disabled";
16+};
17+
18+&adpll_dss_ck {
19+ status = "disabled";
20+};
21+
22+/* Compared to dm814x, dra62x has interconnect clocks on isp PLL */
23+&sysclk4_ck {
24+ clocks = <&adpll_isp_ck 1>;
25+};
26+
27+&sysclk5_ck {
28+ clocks = <&adpll_isp_ck 1>;
29+};
30+
31+&sysclk6_ck {
32+ clocks = <&adpll_isp_ck 1>;
33+};
34+
935 /*
1036 * Compared to dm814x, dra62x has different shifts and more mux options.
1137 * Please add the extra options for ysclk_14 and 16 if really needed.
arch/arm/boot/dts/dra7xx-clocks.dtsi+17−1
@@ -98,12 +98,20 @@ · 97 unmodified lines
9898 clock-frequency = <32768>;
9999 };
100100
101− sys_32k_ck: sys_32k_ck {
101+ sys_clk32_crystal_ck: sys_clk32_crystal_ck {
102102 #clock-cells = <0>;
103103 compatible = "fixed-clock";
104104 clock-frequency = <32768>;
105105 };
106106
107+ sys_clk32_pseudo_ck: sys_clk32_pseudo_ck {
108+ #clock-cells = <0>;
109+ compatible = "fixed-factor-clock";
110+ clocks = <&sys_clkin1>;
111+ clock-mult = <1>;
112+ clock-div = <610>;
113+ };
114+
107115 virt_12000000_ck: virt_12000000_ck {
108116 #clock-cells = <0>;
109117 compatible = "fixed-clock";
@@ -2170,4 +2178,12 @@ · 2060 unmodified lines
21702178 ti,bit-shift = <22>;
21712179 reg = <0x0558>;
21722180 };
2181+
2182+ sys_32k_ck: sys_32k_ck {
2183+ #clock-cells = <0>;
2184+ compatible = "ti,mux-clock";
2185+ clocks = <&sys_clk32_crystal_ck>, <&sys_clk32_pseudo_ck>, <&sys_clk32_pseudo_ck>, <&sys_clk32_pseudo_ck>;
2186+ ti,bit-shift = <8>;
2187+ reg = <0x6c4>;
2188+ };
21732189 };
arch/arm/boot/dts/qcom-msm8974.dtsi+1−13
@@ -1,6 +1,6 @@
11 /dts-v1/;
22
3−#include <dt-bindings/interrupt-controller/arm-gic.h>
3+#include <dt-bindings/interrupt-controller/irq.h>
44 #include <dt-bindings/clock/qcom,gcc-msm8974.h>
55 #include "skeleton.dtsi"
66
@@ -460,8 +460,6 @@ · 453 unmodified lines
460460 clock-names = "core", "iface";
461461 #address-cells = <1>;
462462 #size-cells = <0>;
463− dmas = <&blsp2_dma 20>, <&blsp2_dma 21>;
464− dma-names = "tx", "rx";
465463 };
466464
467465 spmi_bus: spmi@fc4cf000 {
@@ -479,16 +477,6 @@ · 11 unmodified lines
479477 interrupt-controller;
480478 #interrupt-cells = <4>;
481479 };
482−
483− blsp2_dma: dma-controller@f9944000 {
484− compatible = "qcom,bam-v1.4.0";
485− reg = <0xf9944000 0x19000>;
486− interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
487− clocks = <&gcc GCC_BLSP2_AHB_CLK>;
488− clock-names = "bam_clk";
489− #dma-cells = <1>;
490− qcom,ee = <0>;
491− };
492480 };
493481
494482 smd {
arch/arm/boot/dts/r8a7791-koelsch.dts+1−0
@@ -661,6 +661,7 @@ · 660 unmodified lines
661661 };
662662
663663 &pcie_bus_clk {
664+ clock-frequency = <100000000>;
664665 status = "okay";
665666 };
666667
arch/arm/boot/dts/r8a7791-porter.dts+1−13
@@ -143,19 +143,11 @@ · 142 unmodified lines
143143 };
144144
145145 &pfc {
146− pinctrl-0 = <&scif_clk_pins>;
147− pinctrl-names = "default";
148−
149146 scif0_pins: serial0 {
150147 renesas,groups = "scif0_data_d";
151148 renesas,function = "scif0";
152149 };
153150
154− scif_clk_pins: scif_clk {
155− renesas,groups = "scif_clk";
156− renesas,function = "scif_clk";
157− };
158−
159151 ether_pins: ether {
160152 renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
161153 renesas,function = "eth";
@@ -229,11 +221,6 @@ · 67 unmodified lines
229221 status = "okay";
230222 };
231223
232−&scif_clk {
233− clock-frequency = <14745600>;
234− status = "okay";
235−};
236−
237224 &ether {
238225 pinctrl-0 = <&ether_pins &phy1_pins>;
239226 pinctrl-names = "default";
@@ -414,6 +401,7 @@ · 174 unmodified lines
414401 };
415402
416403 &pcie_bus_clk {
404+ clock-frequency = <100000000>;
417405 status = "okay";
418406 };
419407
arch/arm/boot/dts/r8a7791.dtsi+1−4
@@ -1083,9 +1083,8 @@ · 1082 unmodified lines
10831083 pcie_bus_clk: pcie_bus_clk {
10841084 compatible = "fixed-clock";
10851085 #clock-cells = <0>;
1086− clock-frequency = <100000000>;
1086+ clock-frequency = <0>;
10871087 clock-output-names = "pcie_bus";
1088− status = "disabled";
10891088 };
10901089
10911090 /* External SCIF clock */
@@ -1094,7 +1093,6 @@ · 2 unmodified lines
10941093 #clock-cells = <0>;
10951094 /* This value must be overridden by the board. */
10961095 clock-frequency = <0>;
1097− status = "disabled";
10981096 };
10991097
11001098 /* External USB clock - can be overridden by the board */
@@ -1112,7 +1110,6 @@ · 11 unmodified lines
11121110 /* This value must be overridden by the board. */
11131111 clock-frequency = <0>;
11141112 clock-output-names = "can_clk";
1115− status = "disabled";
11161113 };
11171114
11181115 /* Special CPG clocks */
arch/arm/mach-imx/devices/platform-sdhci-esdhc-imx.c+3−2
@@ -71,6 +71,7 @@ struct platform_device *__init imx_add_sdhci_esdhc_imx( · 70 unmodified lines
7171 if (!pdata)
7272 pdata = &default_esdhc_pdata;
7373
74− return imx_add_platform_device(data->devid, data->id, res,
75− ARRAY_SIZE(res), pdata, sizeof(*pdata));
74+ return imx_add_platform_device_dmamask(data->devid, data->id, res,
75+ ARRAY_SIZE(res), pdata, sizeof(*pdata),
76+ DMA_BIT_MASK(32));
7677 }
arch/arm/mach-omap2/clockdomains7xx_data.c+1−1
@@ -461,7 +461,7 @@ static struct clockdomain ipu_7xx_clkdm = { · 460 unmodified lines
461461 .cm_inst = DRA7XX_CM_CORE_AON_IPU_INST,
462462 .clkdm_offs = DRA7XX_CM_CORE_AON_IPU_IPU_CDOFFS,
463463 .dep_bit = DRA7XX_IPU_STATDEP_SHIFT,
464− .flags = CLKDM_CAN_HWSUP_SWSUP,
464+ .flags = CLKDM_CAN_SWSUP,
465465 };
466466
467467 static struct clockdomain mpu1_7xx_clkdm = {
arch/arm/mach-omap2/io.c+2−1
@@ -737,7 +737,8 @@ void __init omap5_init_late(void) · 736 unmodified lines
737737 #ifdef CONFIG_SOC_DRA7XX
738738 void __init dra7xx_init_early(void)
739739 {
740− omap2_set_globals_tap(-1, OMAP2_L4_IO_ADDRESS(DRA7XX_TAP_BASE));
740+ omap2_set_globals_tap(DRA7XX_CLASS,
741+ OMAP2_L4_IO_ADDRESS(DRA7XX_TAP_BASE));
741742 omap2_set_globals_prcm_mpu(OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE));
742743 omap2_control_base_init();
743744 omap4_pm_init_early();
arch/arm/mach-omap2/omap-wakeupgen.c+7−0
@@ -274,6 +274,10 @@ static inline void omap5_irq_save_context(void) · 273 unmodified lines
274274 */
275275 static void irq_save_context(void)
276276 {
277+ /* DRA7 has no SAR to save */
278+ if (soc_is_dra7xx())
279+ return;
280+
277281 if (!sar_base)
278282 sar_base = omap4_get_sar_ram_base();
279283
@@ -290,6 +294,9 @@ static void irq_sar_clear(void) · 10 unmodified lines
290294 {
291295 u32 val;
292296 u32 offset = SAR_BACKUP_STATUS_OFFSET;
297+ /* DRA7 has no SAR to save */
298+ if (soc_is_dra7xx())
299+ return;
293300
294301 if (soc_is_omap54xx())
295302 offset = OMAP5_SAR_BACKUP_STATUS_OFFSET;
arch/arm/mach-omap2/pm34xx.c+13−10
@@ -198,7 +198,6 @@ void omap_sram_idle(void) · 197 unmodified lines
198198 int per_next_state = PWRDM_POWER_ON;
199199 int core_next_state = PWRDM_POWER_ON;
200200 int per_going_off;
201− int core_prev_state;
202201 u32 sdrc_pwr = 0;
203202
204203 mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
@@ -278,16 +277,20 @@ void omap_sram_idle(void) · 73 unmodified lines
278277 sdrc_write_reg(sdrc_pwr, SDRC_POWER);
279278
280279 /* CORE */
281− if (core_next_state < PWRDM_POWER_ON) {
282− core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm);
283− if (core_prev_state == PWRDM_POWER_OFF) {
284− omap3_core_restore_context();
285− omap3_cm_restore_context();
286− omap3_sram_restore_context();
287− omap2_sms_restore_context();
288− }
280+ if (core_next_state < PWRDM_POWER_ON &&
281+ pwrdm_read_prev_pwrst(core_pwrdm) == PWRDM_POWER_OFF) {
282+ omap3_core_restore_context();
283+ omap3_cm_restore_context();
284+ omap3_sram_restore_context();
285+ omap2_sms_restore_context();
286+ } else {
287+ /*
288+ * In off-mode resume path above, omap3_core_restore_context
289+ * also handles the INTC autoidle restore done here so limit
290+ * this to non-off mode resume paths so we don't do it twice.
291+ */
292+ omap3_intc_resume_idle();
289293 }
290− omap3_intc_resume_idle();
291294
292295 pwrdm_post_transition(NULL);
293296
arch/arm/mach-shmobile/timer.c+11−17
@@ -40,8 +40,7 @@ static void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz, · 39 unmodified lines
4040 void __init shmobile_init_delay(void)
4141 {
4242 struct device_node *np, *cpus;
43− bool is_a7_a8_a9 = false;
44− bool is_a15 = false;
43+ unsigned int div = 0;
4544 bool has_arch_timer = false;
4645 u32 max_freq = 0;
4746
@@ -55,27 +54,22 @@ void __init shmobile_init_delay(void) · 7 unmodified lines
5554 if (!of_property_read_u32(np, "clock-frequency", &freq))
5655 max_freq = max(max_freq, freq);
5756
58− if (of_device_is_compatible(np, "arm,cortex-a8") ||
59− of_device_is_compatible(np, "arm,cortex-a9")) {
60− is_a7_a8_a9 = true;
61− } else if (of_device_is_compatible(np, "arm,cortex-a7")) {
62− is_a7_a8_a9 = true;
63− has_arch_timer = true;
64− } else if (of_device_is_compatible(np, "arm,cortex-a15")) {
65− is_a15 = true;
57+ if (of_device_is_compatible(np, "arm,cortex-a8")) {
58+ div = 2;
59+ } else if (of_device_is_compatible(np, "arm,cortex-a9")) {
60+ div = 1;
61+ } else if (of_device_is_compatible(np, "arm,cortex-a7") ||
62+ of_device_is_compatible(np, "arm,cortex-a15")) {
63+ div = 1;
6664 has_arch_timer = true;
6765 }
6866 }
6967
7068 of_node_put(cpus);
7169
72− if (!max_freq)
70+ if (!max_freq || !div)
7371 return;
7472
75− if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) {
76− if (is_a7_a8_a9)
77− shmobile_setup_delay_hz(max_freq, 1, 3);
78− else if (is_a15)
79− shmobile_setup_delay_hz(max_freq, 2, 4);
80− }
73+ if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER))
74+ shmobile_setup_delay_hz(max_freq, 1, div);
8175 }
arch/arm64/boot/dts/socionext/uniphier-ph1-ld20-ref.dts+0−1
@@ -70,7 +70,6 @@ · 69 unmodified lines
7070 i2c3 = &i2c3;
7171 i2c4 = &i2c4;
7272 i2c5 = &i2c5;
73− i2c6 = &i2c6;
7473 };
7574 };
7675
arch/arm64/boot/dts/socionext/uniphier-ph1-ld20.dtsi+5−15
@@ -201,15 +201,12 @@ · 200 unmodified lines
201201
202202 i2c2: i2c@58782000 {
203203 compatible = "socionext,uniphier-fi2c";
204− status = "disabled";
205204 reg = <0x58782000 0x80>;
206205 #address-cells = <1>;
207206 #size-cells = <0>;
208207 interrupts = <0 43 4>;
209− pinctrl-names = "default";
210− pinctrl-0 = <&pinctrl_i2c2>;
211208 clocks = <&i2c_clk>;
212− clock-frequency = <100000>;
209+ clock-frequency = <400000>;
213210 };
214211
215212 i2c3: i2c@58783000 {
@@ -227,12 +224,15 @@ · 11 unmodified lines
227224
228225 i2c4: i2c@58784000 {
229226 compatible = "socionext,uniphier-fi2c";
227+ status = "disabled";
230228 reg = <0x58784000 0x80>;
231229 #address-cells = <1>;
232230 #size-cells = <0>;
233231 interrupts = <0 45 4>;
232+ pinctrl-names = "default";
233+ pinctrl-0 = <&pinctrl_i2c4>;
234234 clocks = <&i2c_clk>;
235− clock-frequency = <400000>;
235+ clock-frequency = <100000>;
236236 };
237237
238238 i2c5: i2c@58785000 {
@@ -245,16 +245,6 @@ · 6 unmodified lines
245245 clock-frequency = <400000>;
246246 };
247247
248− i2c6: i2c@58786000 {
249− compatible = "socionext,uniphier-fi2c";
250− reg = <0x58786000 0x80>;
251− #address-cells = <1>;
252− #size-cells = <0>;
253− interrupts = <0 26 4>;
254− clocks = <&i2c_clk>;
255− clock-frequency = <400000>;
256− };
257−
258248 system_bus: system-bus@58c00000 {
259249 compatible = "socionext,uniphier-system-bus";
260250 status = "disabled";
arch/arm64/kernel/head.S+12−1
@@ -588,6 +588,15 @@ set_hcr: · 587 unmodified lines
588588 msr vpidr_el2, x0
589589 msr vmpidr_el2, x1
590590
591+ /*
592+ * When VHE is not in use, early init of EL2 and EL1 needs to be
593+ * done here.
594+ * When VHE _is_ in use, EL1 will not be used in the host and
595+ * requires no configuration, and all non-hyp-specific EL2 setup
596+ * will be done via the _EL1 system register aliases in __cpu_setup.
597+ */
598+ cbnz x2, 1f
599+
591600 /* sctlr_el1 */
592601 mov x0, #0x0800 // Set/clear RES{1,0} bits
593602 CPU_BE( movk x0, #0x33d0, lsl #16 ) // Set EE and E0E on BE systems
@@ -597,6 +606,7 @@ CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems · 3 unmodified lines
597606 /* Coprocessor traps. */
598607 mov x0, #0x33ff
599608 msr cptr_el2, x0 // Disable copro. traps to EL2
609+1:
600610
601611 #ifdef CONFIG_COMPAT
602612 msr hstr_el2, xzr // Disable CP15 traps to EL2
@@ -734,7 +744,8 @@ ENDPROC(__secondary_switched) · 131 unmodified lines
734744
735745 .macro update_early_cpu_boot_status status, tmp1, tmp2
736746 mov \tmp2, #\status
737− str_l \tmp2, __early_cpu_boot_status, \tmp1
747+ adr_l \tmp1, __early_cpu_boot_status
748+ str \tmp2, [\tmp1]
738749 dmb sy
739750 dc ivac, \tmp1 // Invalidate potentially stale cache line
740751 .endm
arch/arm64/kernel/smp_spin_table.c+6−5
@@ -52,6 +52,7 @@ static void write_pen_release(u64 val) · 51 unmodified lines
5252 static int smp_spin_table_cpu_init(unsigned int cpu)
5353 {
5454 struct device_node *dn;
55+ int ret;
5556
5657 dn = of_get_cpu_node(cpu, NULL);
5758 if (!dn)
@@ -60,15 +61,15 @@ static int smp_spin_table_cpu_init(unsigned int cpu) · 2 unmodified lines
6061 /*
6162 * Determine the address from which the CPU is polling.
6263 */
63− if (of_property_read_u64(dn, "cpu-release-addr",
64− &cpu_release_addr[cpu])) {
64+ ret = of_property_read_u64(dn, "cpu-release-addr",
65+ &cpu_release_addr[cpu]);
66+ if (ret)
6567 pr_err("CPU %d: missing or invalid cpu-release-addr property\n",
6668 cpu);
6769
68− return -1;
69− }
70+ of_node_put(dn);
7071
71− return 0;
72+ return ret;
7273 }
7374
7475 static int smp_spin_table_cpu_prepare(unsigned int cpu)
arch/powerpc/include/uapi/asm/cputable.h+1−0
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #define PPC_FEATURE_PSERIES_PERFMON_COMPAT \
3232 0x00000040
3333
34+/* Reserved - do not use 0x00000004 */
3435 #define PPC_FEATURE_TRUE_LE 0x00000002
3536 #define PPC_FEATURE_PPC_LE 0x00000001
3637
arch/powerpc/kernel/prom.c+15−11
@@ -148,23 +148,25 @@ static struct ibm_pa_feature { · 147 unmodified lines
148148 unsigned long cpu_features; /* CPU_FTR_xxx bit */
149149 unsigned long mmu_features; /* MMU_FTR_xxx bit */
150150 unsigned int cpu_user_ftrs; /* PPC_FEATURE_xxx bit */
151+ unsigned int cpu_user_ftrs2; /* PPC_FEATURE2_xxx bit */
151152 unsigned char pabyte; /* byte number in ibm,pa-features */
152153 unsigned char pabit; /* bit number (big-endian) */
153154 unsigned char invert; /* if 1, pa bit set => clear feature */
154155 } ibm_pa_features[] __initdata = {
155− {0, 0, PPC_FEATURE_HAS_MMU, 0, 0, 0},
156− {0, 0, PPC_FEATURE_HAS_FPU, 0, 1, 0},
157− {CPU_FTR_CTRL, 0, 0, 0, 3, 0},
158− {CPU_FTR_NOEXECUTE, 0, 0, 0, 6, 0},
159− {CPU_FTR_NODSISRALIGN, 0, 0, 1, 1, 1},
160− {0, MMU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0},
161− {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
156+ {0, 0, PPC_FEATURE_HAS_MMU, 0, 0, 0, 0},
157+ {0, 0, PPC_FEATURE_HAS_FPU, 0, 0, 1, 0},
158+ {CPU_FTR_CTRL, 0, 0, 0, 0, 3, 0},
159+ {CPU_FTR_NOEXECUTE, 0, 0, 0, 0, 6, 0},
160+ {CPU_FTR_NODSISRALIGN, 0, 0, 0, 1, 1, 1},
161+ {0, MMU_FTR_CI_LARGE_PAGE, 0, 0, 1, 2, 0},
162+ {CPU_FTR_REAL_LE, 0, PPC_FEATURE_TRUE_LE, 0, 5, 0, 0},
162163 /*
163− * If the kernel doesn't support TM (ie. CONFIG_PPC_TRANSACTIONAL_MEM=n),
164− * we don't want to turn on CPU_FTR_TM here, so we use CPU_FTR_TM_COMP
165− * which is 0 if the kernel doesn't support TM.
164+ * If the kernel doesn't support TM (ie CONFIG_PPC_TRANSACTIONAL_MEM=n),
165+ * we don't want to turn on TM here, so we use the *_COMP versions
166+ * which are 0 if the kernel doesn't support TM.
166167 */
167− {CPU_FTR_TM_COMP, 0, 0, 22, 0, 0},
168+ {CPU_FTR_TM_COMP, 0, 0,
169+ PPC_FEATURE2_HTM_COMP|PPC_FEATURE2_HTM_NOSC_COMP, 22, 0, 0},
168170 };
169171
170172 static void __init scan_features(unsigned long node, const unsigned char *ftrs,
@@ -195,10 +197,12 @@ static void __init scan_features(unsigned long node, const unsigned char *ftrs, · 24 unmodified lines
195197 if (bit ^ fp->invert) {
196198 cur_cpu_spec->cpu_features |= fp->cpu_features;
197199 cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs;
200+ cur_cpu_spec->cpu_user_features2 |= fp->cpu_user_ftrs2;
198201 cur_cpu_spec->mmu_features |= fp->mmu_features;
199202 } else {
200203 cur_cpu_spec->cpu_features &= ~fp->cpu_features;
201204 cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs;
205+ cur_cpu_spec->cpu_user_features2 &= ~fp->cpu_user_ftrs2;
202206 cur_cpu_spec->mmu_features &= ~fp->mmu_features;
203207 }
204208 }
arch/x86/include/asm/hugetlb.h+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 #include <asm/page.h>
55 #include <asm-generic/hugetlb.h>
66
7+#define hugepages_supported() cpu_has_pse
78
89 static inline int is_hugepage_only_range(struct mm_struct *mm,
910 unsigned long addr,
arch/x86/kernel/cpu/mshyperv.c+12−0
@@ -152,6 +152,11 @@ static struct clocksource hyperv_cs = { · 151 unmodified lines
152152 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
153153 };
154154
155+static unsigned char hv_get_nmi_reason(void)
156+{
157+ return 0;
158+}
159+
155160 static void __init ms_hyperv_init_platform(void)
156161 {
157162 /*
@@ -191,6 +196,13 @@ static void __init ms_hyperv_init_platform(void) · 33 unmodified lines
191196 machine_ops.crash_shutdown = hv_machine_crash_shutdown;
192197 #endif
193198 mark_tsc_unstable("running on Hyper-V");
199+
200+ /*
201+ * Generation 2 instances don't support reading the NMI status from
202+ * 0x61 port.
203+ */
204+ if (efi_enabled(EFI_BOOT))
205+ x86_platform.get_nmi_reason = hv_get_nmi_reason;
194206 }
195207
196208 const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
drivers/clocksource/tango_xtal.c+1−1
@@ -42,7 +42,7 @@ static void __init tango_clocksource_init(struct device_node *np) · 41 unmodified lines
4242
4343 ret = clocksource_mmio_init(xtal_in_cnt, "tango-xtal", xtal_freq, 350,
4444 32, clocksource_mmio_readl_up);
45− if (!ret) {
45+ if (ret) {
4646 pr_err("%s: registration failed\n", np->full_name);
4747 return;
4848 }
drivers/crypto/talitos.c+57−30
@@ -63,6 +63,14 @@ static void to_talitos_ptr(struct talitos_ptr *ptr, dma_addr_t dma_addr, · 62 unmodified lines
6363 ptr->eptr = upper_32_bits(dma_addr);
6464 }
6565
66+static void copy_talitos_ptr(struct talitos_ptr *dst_ptr,
67+ struct talitos_ptr *src_ptr, bool is_sec1)
68+{
69+ dst_ptr->ptr = src_ptr->ptr;
70+ if (!is_sec1)
71+ dst_ptr->eptr = src_ptr->eptr;
72+}
73+
6674 static void to_talitos_ptr_len(struct talitos_ptr *ptr, unsigned int len,
6775 bool is_sec1)
6876 {
@@ -1083,21 +1091,20 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, · 1014 unmodified lines
10831091 sg_count = dma_map_sg(dev, areq->src, edesc->src_nents ?: 1,
10841092 (areq->src == areq->dst) ? DMA_BIDIRECTIONAL
10851093 : DMA_TO_DEVICE);
1086−
10871094 /* hmac data */
10881095 desc->ptr[1].len = cpu_to_be16(areq->assoclen);
10891096 if (sg_count > 1 &&
10901097 (ret = sg_to_link_tbl_offset(areq->src, sg_count, 0,
10911098 areq->assoclen,
10921099 &edesc->link_tbl[tbl_off])) > 1) {
1093− tbl_off += ret;
1094−
10951100 to_talitos_ptr(&desc->ptr[1], edesc->dma_link_tbl + tbl_off *
10961101 sizeof(struct talitos_ptr), 0);
10971102 desc->ptr[1].j_extent = DESC_PTR_LNKTBL_JUMP;
10981103
10991104 dma_sync_single_for_device(dev, edesc->dma_link_tbl,
11001105 edesc->dma_len, DMA_BIDIRECTIONAL);
1106+
1107+ tbl_off += ret;
11011108 } else {
11021109 to_talitos_ptr(&desc->ptr[1], sg_dma_address(areq->src), 0);
11031110 desc->ptr[1].j_extent = 0;
@@ -1126,11 +1133,13 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, · 22 unmodified lines
11261133 if (edesc->desc.hdr & DESC_HDR_MODE1_MDEU_CICV)
11271134 sg_link_tbl_len += authsize;
11281135
1129− if (sg_count > 1 &&
1130− (ret = sg_to_link_tbl_offset(areq->src, sg_count, areq->assoclen,
1131− sg_link_tbl_len,
1132− &edesc->link_tbl[tbl_off])) > 1) {
1133− tbl_off += ret;
1136+ if (sg_count == 1) {
1137+ to_talitos_ptr(&desc->ptr[4], sg_dma_address(areq->src) +
1138+ areq->assoclen, 0);
1139+ } else if ((ret = sg_to_link_tbl_offset(areq->src, sg_count,
1140+ areq->assoclen, sg_link_tbl_len,
1141+ &edesc->link_tbl[tbl_off])) >
1142+ 1) {
11341143 desc->ptr[4].j_extent |= DESC_PTR_LNKTBL_JUMP;
11351144 to_talitos_ptr(&desc->ptr[4], edesc->dma_link_tbl +
11361145 tbl_off *
@@ -1138,8 +1147,10 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, · 1 unmodified line
11381147 dma_sync_single_for_device(dev, edesc->dma_link_tbl,
11391148 edesc->dma_len,
11401149 DMA_BIDIRECTIONAL);
1141− } else
1142− to_talitos_ptr(&desc->ptr[4], sg_dma_address(areq->src), 0);
1150+ tbl_off += ret;
1151+ } else {
1152+ copy_talitos_ptr(&desc->ptr[4], &edesc->link_tbl[tbl_off], 0);
1153+ }
11431154
11441155 /* cipher out */
11451156 desc->ptr[5].len = cpu_to_be16(cryptlen);
@@ -1151,11 +1162,13 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, · 5 unmodified lines
11511162
11521163 edesc->icv_ool = false;
11531164
1154− if (sg_count > 1 &&
1155− (sg_count = sg_to_link_tbl_offset(areq->dst, sg_count,
1165+ if (sg_count == 1) {
1166+ to_talitos_ptr(&desc->ptr[5], sg_dma_address(areq->dst) +
1167+ areq->assoclen, 0);
1168+ } else if ((sg_count =
1169+ sg_to_link_tbl_offset(areq->dst, sg_count,
11561170 areq->assoclen, cryptlen,
1157− &edesc->link_tbl[tbl_off])) >
1158− 1) {
1171+ &edesc->link_tbl[tbl_off])) > 1) {
11591172 struct talitos_ptr *tbl_ptr = &edesc->link_tbl[tbl_off];
11601173
11611174 to_talitos_ptr(&desc->ptr[5], edesc->dma_link_tbl +
@@ -1178,8 +1191,9 @@ static int ipsec_esp(struct talitos_edesc *edesc, struct aead_request *areq, · 16 unmodified lines
11781191 edesc->dma_len, DMA_BIDIRECTIONAL);
11791192
11801193 edesc->icv_ool = true;
1181− } else
1182− to_talitos_ptr(&desc->ptr[5], sg_dma_address(areq->dst), 0);
1194+ } else {
1195+ copy_talitos_ptr(&desc->ptr[5], &edesc->link_tbl[tbl_off], 0);
1196+ }
11831197
11841198 /* iv out */
11851199 map_single_talitos_ptr(dev, &desc->ptr[6], ivsize, ctx->iv,
@@ -2629,21 +2643,11 @@ struct talitos_crypto_alg { · 1443 unmodified lines
26292643 struct talitos_alg_template algt;
26302644 };
26312645
2632−static int talitos_cra_init(struct crypto_tfm *tfm)
2646+static int talitos_init_common(struct talitos_ctx *ctx,
2647+ struct talitos_crypto_alg *talitos_alg)
26332648 {
2634− struct crypto_alg *alg = tfm->__crt_alg;
2635− struct talitos_crypto_alg *talitos_alg;
2636− struct talitos_ctx *ctx = crypto_tfm_ctx(tfm);
26372649 struct talitos_private *priv;
26382650
2639− if ((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_AHASH)
2640− talitos_alg = container_of(__crypto_ahash_alg(alg),
2641− struct talitos_crypto_alg,
2642− algt.alg.hash);
2643− else
2644− talitos_alg = container_of(alg, struct talitos_crypto_alg,
2645− algt.alg.crypto);
2646−
26472651 /* update context with ptr to dev */
26482652 ctx->dev = talitos_alg->dev;
26492653
@@ -2661,10 +2665,33 @@ static int talitos_cra_init(struct crypto_tfm *tfm) · 11 unmodified lines
26612665 return 0;
26622666 }
26632667
2668+static int talitos_cra_init(struct crypto_tfm *tfm)
2669+{
2670+ struct crypto_alg *alg = tfm->__crt_alg;
2671+ struct talitos_crypto_alg *talitos_alg;
2672+ struct talitos_ctx *ctx = crypto_tfm_ctx(tfm);
2673+
2674+ if ((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_AHASH)
2675+ talitos_alg = container_of(__crypto_ahash_alg(alg),
2676+ struct talitos_crypto_alg,
2677+ algt.alg.hash);
2678+ else
2679+ talitos_alg = container_of(alg, struct talitos_crypto_alg,
2680+ algt.alg.crypto);
2681+
2682+ return talitos_init_common(ctx, talitos_alg);
2683+}
2684+
26642685 static int talitos_cra_init_aead(struct crypto_aead *tfm)
26652686 {
2666− talitos_cra_init(crypto_aead_tfm(tfm));
2667− return 0;
2687+ struct aead_alg *alg = crypto_aead_alg(tfm);
2688+ struct talitos_crypto_alg *talitos_alg;
2689+ struct talitos_ctx *ctx = crypto_aead_ctx(tfm);
2690+
2691+ talitos_alg = container_of(alg, struct talitos_crypto_alg,
2692+ algt.alg.aead);
2693+
2694+ return talitos_init_common(ctx, talitos_alg);
26682695 }
26692696
26702697 static int talitos_cra_init_ahash(struct crypto_tfm *tfm)
drivers/edac/sb_edac.c+26−4
@@ -362,6 +362,7 @@ struct sbridge_pvt { · 361 unmodified lines
362362
363363 /* Memory type detection */
364364 bool is_mirrored, is_lockstep, is_close_pg;
365+ bool is_chan_hash;
365366
366367 /* Fifo double buffers */
367368 struct mce mce_entry[MCE_LOG_LEN];
@@ -1060,6 +1061,20 @@ static inline u8 sad_pkg_ha(u8 pkg) · 692 unmodified lines
10601061 return (pkg >> 2) & 0x1;
10611062 }
10621063
1064+static int haswell_chan_hash(int idx, u64 addr)
1065+{
1066+ int i;
1067+
1068+ /*
1069+ * XOR even bits from 12:26 to bit0 of idx,
1070+ * odd bits from 13:27 to bit1
1071+ */
1072+ for (i = 12; i < 28; i += 2)
1073+ idx ^= (addr >> i) & 3;
1074+
1075+ return idx;
1076+}
1077+
10631078 /****************************************************************************
10641079 Memory check routines
10651080 ****************************************************************************/
@@ -1616,6 +1631,10 @@ static int get_dimm_config(struct mem_ctl_info *mci) · 550 unmodified lines
16161631 KNL_MAX_CHANNELS : NUM_CHANNELS;
16171632 u64 knl_mc_sizes[KNL_MAX_CHANNELS];
16181633
1634+ if (pvt->info.type == HASWELL || pvt->info.type == BROADWELL) {
1635+ pci_read_config_dword(pvt->pci_ha0, HASWELL_HASYSDEFEATURE2, &reg);
1636+ pvt->is_chan_hash = GET_BITFIELD(reg, 21, 21);
1637+ }
16191638 if (pvt->info.type == HASWELL || pvt->info.type == BROADWELL ||
16201639 pvt->info.type == KNIGHTS_LANDING)
16211640 pci_read_config_dword(pvt->pci_sad1, SAD_TARGET, &reg);
@@ -2118,12 +2137,15 @@ static int get_memory_error_data(struct mem_ctl_info *mci, · 496 unmodified lines
21182137 }
21192138
21202139 ch_way = TAD_CH(reg) + 1;
2121− sck_way = 1 << TAD_SOCK(reg);
2140+ sck_way = TAD_SOCK(reg);
21222141
21232142 if (ch_way == 3)
21242143 idx = addr >> 6;
2125− else
2144+ else {
21262145 idx = (addr >> (6 + sck_way + shiftup)) & 0x3;
2146+ if (pvt->is_chan_hash)
2147+ idx = haswell_chan_hash(idx, addr);
2148+ }
21272149 idx = idx % ch_way;
21282150
21292151 /*
@@ -2157,7 +2179,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, · 27 unmodified lines
21572179 switch(ch_way) {
21582180 case 2:
21592181 case 4:
2160− sck_xch = 1 << sck_way * (ch_way >> 1);
2182+ sck_xch = (1 << sck_way) * (ch_way >> 1);
21612183 break;
21622184 default:
21632185 sprintf(msg, "Invalid mirror set. Can't decode addr");
@@ -2193,7 +2215,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, · 29 unmodified lines
21932215
21942216 ch_addr = addr - offset;
21952217 ch_addr >>= (6 + shiftup);
2196− ch_addr /= ch_way * sck_way;
2218+ ch_addr /= sck_xch;
21972219 ch_addr <<= (6 + shiftup);
21982220 ch_addr |= addr & ((1 << (6 + shiftup)) - 1);
21992221
drivers/firmware/psci.c+1−1
@@ -360,7 +360,7 @@ static struct cpuidle_ops psci_cpuidle_ops __initdata = { · 359 unmodified lines
360360 .init = psci_dt_cpu_init_idle,
361361 };
362362
363−CPUIDLE_METHOD_OF_DECLARE(psci, "arm,psci", &psci_cpuidle_ops);
363+CPUIDLE_METHOD_OF_DECLARE(psci, "psci", &psci_cpuidle_ops);
364364 #endif
365365 #endif
366366
drivers/gpu/drm/amd/amdgpu/amdgpu.h+1−0
@@ -1591,6 +1591,7 @@ struct amdgpu_uvd { · 1590 unmodified lines
15911591 struct amdgpu_bo *vcpu_bo;
15921592 void *cpu_addr;
15931593 uint64_t gpu_addr;
1594+ unsigned fw_version;
15941595 void *saved_bo;
15951596 atomic_t handles[AMDGPU_MAX_UVD_HANDLES];
15961597 struct drm_file *filp[AMDGPU_MAX_UVD_HANDLES];
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c+4−0
@@ -425,6 +425,10 @@ static int acp_resume(void *handle) · 424 unmodified lines
425425 struct acp_pm_domain *apd;
426426 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
427427
428+ /* return early if no ACP */
429+ if (!adev->acp.acp_genpd)
430+ return 0;
431+
428432 /* SMU block will power on ACP irrespective of ACP runtime status.
429433 * Power off explicitly based on genpd ACP runtime status so that ACP
430434 * hw and ACP-genpd status are in sync.
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+1−1
@@ -303,7 +303,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 302 unmodified lines
303303 fw_info.feature = adev->vce.fb_version;
304304 break;
305305 case AMDGPU_INFO_FW_UVD:
306− fw_info.ver = 0;
306+ fw_info.ver = adev->uvd.fw_version;
307307 fw_info.feature = 0;
308308 break;
309309 case AMDGPU_INFO_FW_GMC:
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h+3−3
@@ -53,7 +53,7 @@ struct amdgpu_hpd; · 52 unmodified lines
5353
5454 #define AMDGPU_MAX_HPD_PINS 6
5555 #define AMDGPU_MAX_CRTCS 6
56−#define AMDGPU_MAX_AFMT_BLOCKS 7
56+#define AMDGPU_MAX_AFMT_BLOCKS 9
5757
5858 enum amdgpu_rmx_type {
5959 RMX_OFF,
@@ -309,8 +309,8 @@ struct amdgpu_mode_info { · 249 unmodified lines
309309 struct atom_context *atom_context;
310310 struct card_info *atom_card_info;
311311 bool mode_config_initialized;
312− struct amdgpu_crtc *crtcs[6];
313− struct amdgpu_afmt *afmt[7];
312+ struct amdgpu_crtc *crtcs[AMDGPU_MAX_CRTCS];
313+ struct amdgpu_afmt *afmt[AMDGPU_MAX_AFMT_BLOCKS];
314314 /* DVI-I properties */
315315 struct drm_property *coherent_mode_property;
316316 /* DAC enable load detect */
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+2−0
@@ -223,6 +223,8 @@ static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp) · 222 unmodified lines
223223 {
224224 struct amdgpu_bo *rbo = container_of(bo, struct amdgpu_bo, tbo);
225225
226+ if (amdgpu_ttm_tt_get_usermm(bo->ttm))
227+ return -EPERM;
226228 return drm_vma_node_verify_access(&rbo->gem_base.vma_node, filp);
227229 }
228230
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c+5−0
@@ -158,6 +158,9 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) · 157 unmodified lines
158158 DRM_INFO("Found UVD firmware Version: %hu.%hu Family ID: %hu\n",
159159 version_major, version_minor, family_id);
160160
161+ adev->uvd.fw_version = ((version_major << 24) | (version_minor << 16) |
162+ (family_id << 8));
163+
161164 bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8)
162165 + AMDGPU_UVD_STACK_SIZE + AMDGPU_UVD_HEAP_SIZE;
163166 r = amdgpu_bo_create(adev, bo_size, PAGE_SIZE, true,
@@ -255,6 +258,8 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev) · 91 unmodified lines
255258 if (i == AMDGPU_MAX_UVD_HANDLES)
256259 return 0;
257260
261+ cancel_delayed_work_sync(&adev->uvd.idle_work);
262+
258263 size = amdgpu_bo_size(adev->uvd.vcpu_bo);
259264 ptr = adev->uvd.cpu_addr;
260265
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c+1−0
@@ -234,6 +234,7 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev) · 233 unmodified lines
234234 if (i == AMDGPU_MAX_VCE_HANDLES)
235235 return 0;
236236
237+ cancel_delayed_work_sync(&adev->vce.idle_work);
237238 /* TODO: suspending running encoding sessions isn't supported */
238239 return -EINVAL;
239240 }
drivers/gpu/drm/drm_dp_mst_topology.c+8−1
@@ -1672,13 +1672,19 @@ static int drm_dp_payload_send_msg(struct drm_dp_mst_topology_mgr *mgr, · 1671 unmodified lines
16721672 u8 sinks[DRM_DP_MAX_SDP_STREAMS];
16731673 int i;
16741674
1675+ port = drm_dp_get_validated_port_ref(mgr, port);
1676+ if (!port)
1677+ return -EINVAL;
1678+
16751679 port_num = port->port_num;
16761680 mstb = drm_dp_get_validated_mstb_ref(mgr, port->parent);
16771681 if (!mstb) {
16781682 mstb = drm_dp_get_last_connected_port_and_mstb(mgr, port->parent, &port_num);
16791683
1680− if (!mstb)
1684+ if (!mstb) {
1685+ drm_dp_put_port(port);
16811686 return -EINVAL;
1687+ }
16821688 }
16831689
16841690 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
@@ -1707,6 +1713,7 @@ static int drm_dp_payload_send_msg(struct drm_dp_mst_topology_mgr *mgr, · 22 unmodified lines
17071713 kfree(txmsg);
17081714 fail_put:
17091715 drm_dp_put_mst_branch_device(mstb);
1716+ drm_dp_put_port(port);
17101717 return ret;
17111718 }
17121719
drivers/gpu/drm/i915/i915_drv.h+3−2
@@ -2634,8 +2634,9 @@ struct drm_i915_cmd_table { · 2633 unmodified lines
26342634
26352635 /* WaRsDisableCoarsePowerGating:skl,bxt */
26362636 #define NEEDS_WaRsDisableCoarsePowerGating(dev) (IS_BXT_REVID(dev, 0, BXT_REVID_A1) || \
2637− ((IS_SKL_GT3(dev) || IS_SKL_GT4(dev)) && \
2638− IS_SKL_REVID(dev, 0, SKL_REVID_F0)))
2637+ IS_SKL_GT3(dev) || \
2638+ IS_SKL_GT4(dev))
2639+
26392640 /*
26402641 * dp aux and gmbus irq on gen4 seems to be able to generate legacy interrupts
26412642 * even when in MSI mode. This results in spurious interrupt warnings if the
drivers/gpu/drm/i915/i915_gem_userptr.c+17−12
@@ -501,19 +501,24 @@ __i915_gem_userptr_get_pages_worker(struct work_struct *_work) · 500 unmodified lines
501501 if (pvec != NULL) {
502502 struct mm_struct *mm = obj->userptr.mm->mm;
503503
504− down_read(&mm->mmap_sem);
505− while (pinned < npages) {
506− ret = get_user_pages_remote(work->task, mm,
507− obj->userptr.ptr + pinned * PAGE_SIZE,
508− npages - pinned,
509− !obj->userptr.read_only, 0,
510− pvec + pinned, NULL);
511− if (ret < 0)
512− break;
513−
514− pinned += ret;
504+ ret = -EFAULT;
505+ if (atomic_inc_not_zero(&mm->mm_users)) {
506+ down_read(&mm->mmap_sem);
507+ while (pinned < npages) {
508+ ret = get_user_pages_remote
509+ (work->task, mm,
510+ obj->userptr.ptr + pinned * PAGE_SIZE,
511+ npages - pinned,
512+ !obj->userptr.read_only, 0,
513+ pvec + pinned, NULL);
514+ if (ret < 0)
515+ break;
516+
517+ pinned += ret;
518+ }
519+ up_read(&mm->mmap_sem);
520+ mmput(mm);
515521 }
516− up_read(&mm->mmap_sem);
517522 }
518523
519524 mutex_lock(&dev->struct_mutex);
drivers/gpu/drm/i915/intel_lrc.c+11−5
@@ -841,11 +841,11 @@ static int logical_ring_prepare(struct drm_i915_gem_request *req, int bytes) · 840 unmodified lines
841841 if (unlikely(total_bytes > remain_usable)) {
842842 /*
843843 * The base request will fit but the reserved space
844− * falls off the end. So only need to to wait for the
845− * reserved size after flushing out the remainder.
844+ * falls off the end. So don't need an immediate wrap
845+ * and only need to effectively wait for the reserved
846+ * size space from the start of ringbuffer.
846847 */
847848 wait_bytes = remain_actual + ringbuf->reserved_size;
848− need_wrap = true;
849849 } else if (total_bytes > ringbuf->space) {
850850 /* No wrapping required, just waiting. */
851851 wait_bytes = total_bytes;
@@ -1913,15 +1913,18 @@ static int gen8_emit_request_render(struct drm_i915_gem_request *request) · 1061 unmodified lines
19131913 struct intel_ringbuffer *ringbuf = request->ringbuf;
19141914 int ret;
19151915
1916− ret = intel_logical_ring_begin(request, 6 + WA_TAIL_DWORDS);
1916+ ret = intel_logical_ring_begin(request, 8 + WA_TAIL_DWORDS);
19171917 if (ret)
19181918 return ret;
19191919
1920+ /* We're using qword write, seqno should be aligned to 8 bytes. */
1921+ BUILD_BUG_ON(I915_GEM_HWS_INDEX & 1);
1922+
19201923 /* w/a for post sync ops following a GPGPU operation we
19211924 * need a prior CS_STALL, which is emitted by the flush
19221925 * following the batch.
19231926 */
1924− intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(5));
1927+ intel_logical_ring_emit(ringbuf, GFX_OP_PIPE_CONTROL(6));
19251928 intel_logical_ring_emit(ringbuf,
19261929 (PIPE_CONTROL_GLOBAL_GTT_IVB |
19271930 PIPE_CONTROL_CS_STALL |
@@ -1929,7 +1932,10 @@ static int gen8_emit_request_render(struct drm_i915_gem_request *request) · 1 unmodified line
19291932 intel_logical_ring_emit(ringbuf, hws_seqno_address(request->ring));
19301933 intel_logical_ring_emit(ringbuf, 0);
19311934 intel_logical_ring_emit(ringbuf, i915_gem_request_get_seqno(request));
1935+ /* We're thrashing one dword of HWS. */
1936+ intel_logical_ring_emit(ringbuf, 0);
19321937 intel_logical_ring_emit(ringbuf, MI_USER_INTERRUPT);
1938+ intel_logical_ring_emit(ringbuf, MI_NOOP);
19331939 return intel_logical_ring_advance_and_submit(request);
19341940 }
19351941
drivers/gpu/drm/i915/intel_pm.c+28−14
@@ -2876,25 +2876,28 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate, · 2875 unmodified lines
28762876 const struct drm_plane_state *pstate,
28772877 int y)
28782878 {
2879− struct intel_crtc *intel_crtc = to_intel_crtc(cstate->base.crtc);
2879+ struct intel_plane_state *intel_pstate = to_intel_plane_state(pstate);
28802880 struct drm_framebuffer *fb = pstate->fb;
2881+ uint32_t width = 0, height = 0;
2882+
2883+ width = drm_rect_width(&intel_pstate->src) >> 16;
2884+ height = drm_rect_height(&intel_pstate->src) >> 16;
2885+
2886+ if (intel_rotation_90_or_270(pstate->rotation))
2887+ swap(width, height);
28812888
28822889 /* for planar format */
28832890 if (fb->pixel_format == DRM_FORMAT_NV12) {
28842891 if (y) /* y-plane data rate */
2885− return intel_crtc->config->pipe_src_w *
2886− intel_crtc->config->pipe_src_h *
2892+ return width * height *
28872893 drm_format_plane_cpp(fb->pixel_format, 0);
28882894 else /* uv-plane data rate */
2889− return (intel_crtc->config->pipe_src_w/2) *
2890− (intel_crtc->config->pipe_src_h/2) *
2895+ return (width / 2) * (height / 2) *
28912896 drm_format_plane_cpp(fb->pixel_format, 1);
28922897 }
28932898
28942899 /* for packed formats */
2895− return intel_crtc->config->pipe_src_w *
2896− intel_crtc->config->pipe_src_h *
2897− drm_format_plane_cpp(fb->pixel_format, 0);
2900+ return width * height * drm_format_plane_cpp(fb->pixel_format, 0);
28982901 }
28992902
29002903 /*
@@ -2973,8 +2976,9 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate, · 72 unmodified lines
29732976 struct drm_framebuffer *fb = plane->state->fb;
29742977 int id = skl_wm_plane_id(intel_plane);
29752978
2976− if (fb == NULL)
2979+ if (!to_intel_plane_state(plane->state)->visible)
29772980 continue;
2981+
29782982 if (plane->type == DRM_PLANE_TYPE_CURSOR)
29792983 continue;
29802984
@@ -3000,7 +3004,7 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate, · 19 unmodified lines
30003004 uint16_t plane_blocks, y_plane_blocks = 0;
30013005 int id = skl_wm_plane_id(intel_plane);
30023006
3003− if (pstate->fb == NULL)
3007+ if (!to_intel_plane_state(pstate)->visible)
30043008 continue;
30053009 if (plane->type == DRM_PLANE_TYPE_CURSOR)
30063010 continue;
@@ -3123,26 +3127,36 @@ static bool skl_compute_plane_wm(const struct drm_i915_private *dev_priv, · 116 unmodified lines
31233127 {
31243128 struct drm_plane *plane = &intel_plane->base;
31253129 struct drm_framebuffer *fb = plane->state->fb;
3130+ struct intel_plane_state *intel_pstate =
3131+ to_intel_plane_state(plane->state);
31263132 uint32_t latency = dev_priv->wm.skl_latency[level];
31273133 uint32_t method1, method2;
31283134 uint32_t plane_bytes_per_line, plane_blocks_per_line;
31293135 uint32_t res_blocks, res_lines;
31303136 uint32_t selected_result;
31313137 uint8_t cpp;
3138+ uint32_t width = 0, height = 0;
31323139
3133− if (latency == 0 || !cstate->base.active || !fb)
3140+ if (latency == 0 || !cstate->base.active || !intel_pstate->visible)
31343141 return false;
31353142
3143+ width = drm_rect_width(&intel_pstate->src) >> 16;
3144+ height = drm_rect_height(&intel_pstate->src) >> 16;
3145+
3146+ if (intel_rotation_90_or_270(plane->state->rotation))
3147+ swap(width, height);
3148+
31363149 cpp = drm_format_plane_cpp(fb->pixel_format, 0);
31373150 method1 = skl_wm_method1(skl_pipe_pixel_rate(cstate),
31383151 cpp, latency);
31393152 method2 = skl_wm_method2(skl_pipe_pixel_rate(cstate),
31403153 cstate->base.adjusted_mode.crtc_htotal,
3141− cstate->pipe_src_w,
3142− cpp, fb->modifier[0],
3154+ width,
3155+ cpp,
3156+ fb->modifier[0],
31433157 latency);
31443158
3145− plane_bytes_per_line = cstate->pipe_src_w * cpp;
3159+ plane_bytes_per_line = width * cpp;
31463160 plane_blocks_per_line = DIV_ROUND_UP(plane_bytes_per_line, 512);
31473161
31483162 if (fb->modifier[0] == I915_FORMAT_MOD_Y_TILED ||
drivers/gpu/drm/i915/intel_ringbuffer.c+11−7
@@ -968,7 +968,7 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring) · 967 unmodified lines
968968
969969 /* WaForceContextSaveRestoreNonCoherent:skl,bxt */
970970 tmp = HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT;
971− if (IS_SKL_REVID(dev, SKL_REVID_F0, SKL_REVID_F0) ||
971+ if (IS_SKL_REVID(dev, SKL_REVID_F0, REVID_FOREVER) ||
972972 IS_BXT_REVID(dev, BXT_REVID_B0, REVID_FOREVER))
973973 tmp |= HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE;
974974 WA_SET_BIT_MASKED(HDC_CHICKEN0, tmp);
@@ -1085,7 +1085,8 @@ static int skl_init_workarounds(struct intel_engine_cs *ring) · 110 unmodified lines
10851085 WA_SET_BIT_MASKED(HIZ_CHICKEN,
10861086 BDW_HIZ_POWER_COMPILER_CLOCK_GATING_DISABLE);
10871087
1088− if (IS_SKL_REVID(dev, 0, SKL_REVID_F0)) {
1088+ /* This is tied to WaForceContextSaveRestoreNonCoherent */
1089+ if (IS_SKL_REVID(dev, 0, REVID_FOREVER)) {
10891090 /*
10901091 *Use Force Non-Coherent whenever executing a 3D context. This
10911092 * is a workaround for a possible hang in the unlikely event
@@ -2090,10 +2091,12 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev, · 998 unmodified lines
20902091 {
20912092 struct drm_i915_private *dev_priv = to_i915(dev);
20922093 struct drm_i915_gem_object *obj = ringbuf->obj;
2094+ /* Ring wraparound at offset 0 sometimes hangs. No idea why. */
2095+ unsigned flags = PIN_OFFSET_BIAS | 4096;
20932096 int ret;
20942097
20952098 if (HAS_LLC(dev_priv) && !obj->stolen) {
2096− ret = i915_gem_obj_ggtt_pin(obj, PAGE_SIZE, 0);
2099+ ret = i915_gem_obj_ggtt_pin(obj, PAGE_SIZE, flags);
20972100 if (ret)
20982101 return ret;
20992102
@@ -2109,7 +2112,8 @@ int intel_pin_and_map_ringbuffer_obj(struct drm_device *dev, · 9 unmodified lines
21092112 return -ENOMEM;
21102113 }
21112114 } else {
2112− ret = i915_gem_obj_ggtt_pin(obj, PAGE_SIZE, PIN_MAPPABLE);
2115+ ret = i915_gem_obj_ggtt_pin(obj, PAGE_SIZE,
2116+ flags | PIN_MAPPABLE);
21132117 if (ret)
21142118 return ret;
21152119
@@ -2454,11 +2458,11 @@ static int __intel_ring_prepare(struct intel_engine_cs *ring, int bytes) · 338 unmodified lines
24542458 if (unlikely(total_bytes > remain_usable)) {
24552459 /*
24562460 * The base request will fit but the reserved space
2457− * falls off the end. So only need to to wait for the
2458− * reserved size after flushing out the remainder.
2461+ * falls off the end. So don't need an immediate wrap
2462+ * and only need to effectively wait for the reserved
2463+ * size space from the start of ringbuffer.
24592464 */
24602465 wait_bytes = remain_actual + ringbuf->reserved_size;
2461− need_wrap = true;
24622466 } else if (total_bytes > ringbuf->space) {
24632467 /* No wrapping required, just waiting. */
24642468 wait_bytes = total_bytes;
drivers/gpu/drm/i915/intel_uncore.c+5−1
@@ -1189,7 +1189,11 @@ static void intel_uncore_fw_domains_init(struct drm_device *dev) · 1188 unmodified lines
11891189 } else if (IS_HASWELL(dev) || IS_BROADWELL(dev)) {
11901190 dev_priv->uncore.funcs.force_wake_get =
11911191 fw_domains_get_with_thread_status;
1192− dev_priv->uncore.funcs.force_wake_put = fw_domains_put;
1192+ if (IS_HASWELL(dev))
1193+ dev_priv->uncore.funcs.force_wake_put =
1194+ fw_domains_put_with_fifo;
1195+ else
1196+ dev_priv->uncore.funcs.force_wake_put = fw_domains_put;
11931197 fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER,
11941198 FORCEWAKE_MT, FORCEWAKE_ACK_HSW);
11951199 } else if (IS_IVYBRIDGE(dev)) {
drivers/gpu/drm/nouveau/nouveau_connector.c+2−2
@@ -1276,18 +1276,18 @@ nouveau_connector_create(struct drm_device *dev, int index) · 1275 unmodified lines
12761276 break;
12771277 default:
12781278 if (disp->dithering_mode) {
1279+ nv_connector->dithering_mode = DITHERING_MODE_AUTO;
12791280 drm_object_attach_property(&connector->base,
12801281 disp->dithering_mode,
12811282 nv_connector->
12821283 dithering_mode);
1283− nv_connector->dithering_mode = DITHERING_MODE_AUTO;
12841284 }
12851285 if (disp->dithering_depth) {
1286+ nv_connector->dithering_depth = DITHERING_DEPTH_AUTO;
12861287 drm_object_attach_property(&connector->base,
12871288 disp->dithering_depth,
12881289 nv_connector->
12891290 dithering_depth);
1290− nv_connector->dithering_depth = DITHERING_DEPTH_AUTO;
12911291 }
12921292 break;
12931293 }
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c+2−0
@@ -1832,6 +1832,8 @@ gf100_gr_init(struct gf100_gr *gr) · 1831 unmodified lines
18321832
18331833 gf100_gr_mmio(gr, gr->func->mmio);
18341834
1835+ nvkm_mask(device, TPC_UNIT(0, 0, 0x05c), 0x00000001, 0x00000001);
1836+
18351837 memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr));
18361838 for (i = 0, gpc = -1; i < gr->tpc_total; i++) {
18371839 do {
drivers/gpu/drm/radeon/radeon_atpx_handler.c+7−4
@@ -62,10 +62,6 @@ bool radeon_has_atpx(void) { · 61 unmodified lines
6262 return radeon_atpx_priv.atpx_detected;
6363 }
6464
65−bool radeon_has_atpx_dgpu_power_cntl(void) {
66− return radeon_atpx_priv.atpx.functions.power_cntl;
67−}
68−
6965 /**
7066 * radeon_atpx_call - call an ATPX method
7167 *
@@ -145,6 +141,13 @@ static void radeon_atpx_parse_functions(struct radeon_atpx_functions *f, u32 mas · 73 unmodified lines
145141 */
146142 static int radeon_atpx_validate(struct radeon_atpx *atpx)
147143 {
144+ /* make sure required functions are enabled */
145+ /* dGPU power control is required */
146+ if (atpx->functions.power_cntl == false) {
147+ printk("ATPX dGPU power cntl not present, forcing\n");
148+ atpx->functions.power_cntl = true;
149+ }
150+
148151 if (atpx->functions.px_params) {
149152 union acpi_object *info;
150153 struct atpx_px_params output;
drivers/gpu/drm/radeon/radeon_connectors.c+6−1
@@ -2002,10 +2002,12 @@ radeon_add_atom_connector(struct drm_device *dev, · 2001 unmodified lines
20022002 rdev->mode_info.dither_property,
20032003 RADEON_FMT_DITHER_DISABLE);
20042004
2005− if (radeon_audio != 0)
2005+ if (radeon_audio != 0) {
20062006 drm_object_attach_property(&radeon_connector->base.base,
20072007 rdev->mode_info.audio_property,
20082008 RADEON_AUDIO_AUTO);
2009+ radeon_connector->audio = RADEON_AUDIO_AUTO;
2010+ }
20092011 if (ASIC_IS_DCE5(rdev))
20102012 drm_object_attach_property(&radeon_connector->base.base,
20112013 rdev->mode_info.output_csc_property,
@@ -2130,6 +2132,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 118 unmodified lines
21302132 drm_object_attach_property(&radeon_connector->base.base,
21312133 rdev->mode_info.audio_property,
21322134 RADEON_AUDIO_AUTO);
2135+ radeon_connector->audio = RADEON_AUDIO_AUTO;
21332136 }
21342137 if (connector_type == DRM_MODE_CONNECTOR_DVII) {
21352138 radeon_connector->dac_load_detect = true;
@@ -2185,6 +2188,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 49 unmodified lines
21852188 drm_object_attach_property(&radeon_connector->base.base,
21862189 rdev->mode_info.audio_property,
21872190 RADEON_AUDIO_AUTO);
2191+ radeon_connector->audio = RADEON_AUDIO_AUTO;
21882192 }
21892193 if (ASIC_IS_DCE5(rdev))
21902194 drm_object_attach_property(&radeon_connector->base.base,
@@ -2237,6 +2241,7 @@ radeon_add_atom_connector(struct drm_device *dev, · 46 unmodified lines
22372241 drm_object_attach_property(&radeon_connector->base.base,
22382242 rdev->mode_info.audio_property,
22392243 RADEON_AUDIO_AUTO);
2244+ radeon_connector->audio = RADEON_AUDIO_AUTO;
22402245 }
22412246 if (ASIC_IS_DCE5(rdev))
22422247 drm_object_attach_property(&radeon_connector->base.base,
drivers/gpu/drm/radeon/radeon_device.c+4−10
@@ -103,12 +103,6 @@ static const char radeon_family_name[][16] = { · 102 unmodified lines
103103 "LAST",
104104 };
105105
106−#if defined(CONFIG_VGA_SWITCHEROO)
107−bool radeon_has_atpx_dgpu_power_cntl(void);
108−#else
109−static inline bool radeon_has_atpx_dgpu_power_cntl(void) { return false; }
110−#endif
111−
112106 #define RADEON_PX_QUIRK_DISABLE_PX (1 << 0)
113107 #define RADEON_PX_QUIRK_LONG_WAKEUP (1 << 1)
114108
@@ -1305,9 +1299,9 @@ int radeon_device_init(struct radeon_device *rdev, · 1190 unmodified lines
13051299 }
13061300 rdev->fence_context = fence_context_alloc(RADEON_NUM_RINGS);
13071301
1308− DRM_INFO("initializing kernel modesetting (%s 0x%04X:0x%04X 0x%04X:0x%04X).\n",
1309− radeon_family_name[rdev->family], pdev->vendor, pdev->device,
1310− pdev->subsystem_vendor, pdev->subsystem_device);
1302+ DRM_INFO("initializing kernel modesetting (%s 0x%04X:0x%04X 0x%04X:0x%04X 0x%02X).\n",
1303+ radeon_family_name[rdev->family], pdev->vendor, pdev->device,
1304+ pdev->subsystem_vendor, pdev->subsystem_device, pdev->revision);
13111305
13121306 /* mutex initialization are all done here so we
13131307 * can recall function without having locking issues */
@@ -1439,7 +1433,7 @@ int radeon_device_init(struct radeon_device *rdev, · 125 unmodified lines
14391433 * ignore it */
14401434 vga_client_register(rdev->pdev, rdev, NULL, radeon_vga_set_decode);
14411435
1442− if ((rdev->flags & RADEON_IS_PX) && radeon_has_atpx_dgpu_power_cntl())
1436+ if (rdev->flags & RADEON_IS_PX)
14431437 runtime = true;
14441438 vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime);
14451439 if (runtime)
drivers/gpu/drm/radeon/radeon_ttm.c+2−0
@@ -235,6 +235,8 @@ static int radeon_verify_access(struct ttm_buffer_object *bo, struct file *filp) · 234 unmodified lines
235235 {
236236 struct radeon_bo *rbo = container_of(bo, struct radeon_bo, tbo);
237237
238+ if (radeon_ttm_tt_has_userptr(bo->ttm))
239+ return -EPERM;
238240 return drm_vma_node_verify_access(&rbo->gem_base.vma_node, filp);
239241 }
240242
drivers/gpu/drm/radeon/si_dpm.c+1−0
@@ -2931,6 +2931,7 @@ static struct si_dpm_quirk si_dpm_quirk_list[] = { · 2930 unmodified lines
29312931 { PCI_VENDOR_ID_ATI, 0x6811, 0x1462, 0x2015, 0, 120000 },
29322932 { PCI_VENDOR_ID_ATI, 0x6811, 0x1043, 0x2015, 0, 120000 },
29332933 { PCI_VENDOR_ID_ATI, 0x6811, 0x148c, 0x2015, 0, 120000 },
2934+ { PCI_VENDOR_ID_ATI, 0x6810, 0x1682, 0x9275, 0, 120000 },
29342935 { 0, 0, 0, 0 },
29352936 };
29362937
drivers/infiniband/hw/mlx5/main.c+2−2
@@ -671,8 +671,8 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port, · 670 unmodified lines
671671 struct mlx5_ib_dev *dev = to_mdev(ibdev);
672672 struct mlx5_core_dev *mdev = dev->mdev;
673673 struct mlx5_hca_vport_context *rep;
674− int max_mtu;
675− int oper_mtu;
674+ u16 max_mtu;
675+ u16 oper_mtu;
676676 int err;
677677 u8 ib_link_width_oper;
678678 u8 vl_hw_cap;
drivers/input/joystick/xpad.c+2−0
@@ -153,6 +153,7 @@ static const struct xpad_device { · 152 unmodified lines
153153 { 0x0738, 0x4728, "Mad Catz Street Fighter IV FightPad", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
154154 { 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
155155 { 0x0738, 0x4740, "Mad Catz Beat Pad", 0, XTYPE_XBOX360 },
156+ { 0x0738, 0x4a01, "Mad Catz FightStick TE 2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
156157 { 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
157158 { 0x0738, 0xb726, "Mad Catz Xbox controller - MW2", 0, XTYPE_XBOX360 },
158159 { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad", XTYPE_XBOX360 },
@@ -304,6 +305,7 @@ static struct usb_device_id xpad_table[] = { · 145 unmodified lines
304305 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */
305306 XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */
306307 { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */
308+ XPAD_XBOXONE_VENDOR(0x0738), /* Mad Catz FightStick TE 2 */
307309 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */
308310 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */
309311 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
drivers/input/misc/arizona-haptics.c+0−1
@@ -178,7 +178,6 @@ static int arizona_haptics_probe(struct platform_device *pdev) · 177 unmodified lines
178178 input_set_drvdata(haptics->input_dev, haptics);
179179
180180 haptics->input_dev->name = "arizona:haptics";
181− haptics->input_dev->dev.parent = pdev->dev.parent;
182181 haptics->input_dev->close = arizona_haptics_close;
183182 __set_bit(FF_RUMBLE, haptics->input_dev->ffbit);
184183
drivers/input/misc/pmic8xxx-pwrkey.c+4−3
@@ -353,7 +353,8 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev) · 352 unmodified lines
353353 if (of_property_read_u32(pdev->dev.of_node, "debounce", &kpd_delay))
354354 kpd_delay = 15625;
355355
356− if (kpd_delay > 62500 || kpd_delay == 0) {
356+ /* Valid range of pwr key trigger delay is 1/64 sec to 2 seconds. */
357+ if (kpd_delay > USEC_PER_SEC * 2 || kpd_delay < USEC_PER_SEC / 64) {
357358 dev_err(&pdev->dev, "invalid power key trigger delay\n");
358359 return -EINVAL;
359360 }
@@ -385,8 +386,8 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev) · 25 unmodified lines
385386 pwr->name = "pmic8xxx_pwrkey";
386387 pwr->phys = "pmic8xxx_pwrkey/input0";
387388
388− delay = (kpd_delay << 10) / USEC_PER_SEC;
389− delay = 1 + ilog2(delay);
389+ delay = (kpd_delay << 6) / USEC_PER_SEC;
390+ delay = ilog2(delay);
390391
391392 err = regmap_read(regmap, PON_CNTL_1, &pon_cntl);
392393 if (err < 0) {
drivers/input/misc/twl4030-vibra.c+0−1
@@ -222,7 +222,6 @@ static int twl4030_vibra_probe(struct platform_device *pdev) · 221 unmodified lines
222222
223223 info->input_dev->name = "twl4030:vibrator";
224224 info->input_dev->id.version = 1;
225− info->input_dev->dev.parent = pdev->dev.parent;
226225 info->input_dev->close = twl4030_vibra_close;
227226 __set_bit(FF_RUMBLE, info->input_dev->ffbit);
228227
drivers/input/misc/twl6040-vibra.c+1−7
@@ -45,7 +45,6 @@ · 44 unmodified lines
4545 struct vibra_info {
4646 struct device *dev;
4747 struct input_dev *input_dev;
48− struct workqueue_struct *workqueue;
4948 struct work_struct play_work;
5049 struct mutex mutex;
5150 int irq;
@@ -213,11 +212,7 @@ static int vibra_play(struct input_dev *input, void *data, · 161 unmodified lines
213212 info->strong_speed = effect->u.rumble.strong_magnitude;
214213 info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1;
215214
216− ret = queue_work(info->workqueue, &info->play_work);
217− if (!ret) {
218− dev_info(&input->dev, "work is already on queue\n");
219− return ret;
220− }
215+ schedule_work(&info->play_work);
221216
222217 return 0;
223218 }
@@ -362,7 +357,6 @@ static int twl6040_vibra_probe(struct platform_device *pdev) · 138 unmodified lines
362357
363358 info->input_dev->name = "twl6040:vibrator";
364359 info->input_dev->id.version = 1;
365− info->input_dev->dev.parent = pdev->dev.parent;
366360 info->input_dev->close = twl6040_vibra_close;
367361 __set_bit(FF_RUMBLE, info->input_dev->ffbit);
368362
drivers/input/tablet/gtco.c+9−1
@@ -858,6 +858,14 @@ static int gtco_probe(struct usb_interface *usbinterface, · 857 unmodified lines
858858 goto err_free_buf;
859859 }
860860
861+ /* Sanity check that a device has an endpoint */
862+ if (usbinterface->altsetting[0].desc.bNumEndpoints < 1) {
863+ dev_err(&usbinterface->dev,
864+ "Invalid number of endpoints\n");
865+ error = -EINVAL;
866+ goto err_free_urb;
867+ }
868+
861869 /*
862870 * The endpoint is always altsetting 0, we know this since we know
863871 * this device only has one interrupt endpoint
@@ -879,7 +887,7 @@ static int gtco_probe(struct usb_interface *usbinterface, · 15 unmodified lines
879887 * HID report descriptor
880888 */
881889 if (usb_get_extra_descriptor(usbinterface->cur_altsetting,
882− HID_DEVICE_TYPE, &hid_desc) != 0){
890+ HID_DEVICE_TYPE, &hid_desc) != 0) {
883891 dev_err(&usbinterface->dev,
884892 "Can't retrieve exta USB descriptor to get hid report descriptor length\n");
885893 error = -EIO;
drivers/iommu/amd_iommu.c+76−11
@@ -92,6 +92,7 @@ struct iommu_dev_data { · 91 unmodified lines
9292 struct list_head dev_data_list; /* For global dev_data_list */
9393 struct protection_domain *domain; /* Domain the device is bound to */
9494 u16 devid; /* PCI Device ID */
95+ u16 alias; /* Alias Device ID */
9596 bool iommu_v2; /* Device can make use of IOMMUv2 */
9697 bool passthrough; /* Device is identity mapped */
9798 struct {
@@ -166,6 +167,13 @@ static struct protection_domain *to_pdomain(struct iommu_domain *dom) · 68 unmodified lines
166167 return container_of(dom, struct protection_domain, domain);
167168 }
168169
170+static inline u16 get_device_id(struct device *dev)
171+{
172+ struct pci_dev *pdev = to_pci_dev(dev);
173+
174+ return PCI_DEVID(pdev->bus->number, pdev->devfn);
175+}
176+
169177 static struct iommu_dev_data *alloc_dev_data(u16 devid)
170178 {
171179 struct iommu_dev_data *dev_data;
@@ -203,6 +211,68 @@ out_unlock: · 31 unmodified lines
203211 return dev_data;
204212 }
205213
214+static int __last_alias(struct pci_dev *pdev, u16 alias, void *data)
215+{
216+ *(u16 *)data = alias;
217+ return 0;
218+}
219+
220+static u16 get_alias(struct device *dev)
221+{
222+ struct pci_dev *pdev = to_pci_dev(dev);
223+ u16 devid, ivrs_alias, pci_alias;
224+
225+ devid = get_device_id(dev);
226+ ivrs_alias = amd_iommu_alias_table[devid];
227+ pci_for_each_dma_alias(pdev, __last_alias, &pci_alias);
228+
229+ if (ivrs_alias == pci_alias)
230+ return ivrs_alias;
231+
232+ /*
233+ * DMA alias showdown
234+ *
235+ * The IVRS is fairly reliable in telling us about aliases, but it
236+ * can't know about every screwy device. If we don't have an IVRS
237+ * reported alias, use the PCI reported alias. In that case we may
238+ * still need to initialize the rlookup and dev_table entries if the
239+ * alias is to a non-existent device.
240+ */
241+ if (ivrs_alias == devid) {
242+ if (!amd_iommu_rlookup_table[pci_alias]) {
243+ amd_iommu_rlookup_table[pci_alias] =
244+ amd_iommu_rlookup_table[devid];
245+ memcpy(amd_iommu_dev_table[pci_alias].data,
246+ amd_iommu_dev_table[devid].data,
247+ sizeof(amd_iommu_dev_table[pci_alias].data));
248+ }
249+
250+ return pci_alias;
251+ }
252+
253+ pr_info("AMD-Vi: Using IVRS reported alias %02x:%02x.%d "
254+ "for device %s[%04x:%04x], kernel reported alias "
255+ "%02x:%02x.%d\n", PCI_BUS_NUM(ivrs_alias), PCI_SLOT(ivrs_alias),
256+ PCI_FUNC(ivrs_alias), dev_name(dev), pdev->vendor, pdev->device,
257+ PCI_BUS_NUM(pci_alias), PCI_SLOT(pci_alias),
258+ PCI_FUNC(pci_alias));
259+
260+ /*
261+ * If we don't have a PCI DMA alias and the IVRS alias is on the same
262+ * bus, then the IVRS table may know about a quirk that we don't.
263+ */
264+ if (pci_alias == devid &&
265+ PCI_BUS_NUM(ivrs_alias) == pdev->bus->number) {
266+ pdev->dev_flags |= PCI_DEV_FLAGS_DMA_ALIAS_DEVFN;
267+ pdev->dma_alias_devfn = ivrs_alias & 0xff;
268+ pr_info("AMD-Vi: Added PCI DMA alias %02x.%d for %s\n",
269+ PCI_SLOT(ivrs_alias), PCI_FUNC(ivrs_alias),
270+ dev_name(dev));
271+ }
272+
273+ return ivrs_alias;
274+}
275+
206276 static struct iommu_dev_data *find_dev_data(u16 devid)
207277 {
208278 struct iommu_dev_data *dev_data;
@@ -215,13 +285,6 @@ static struct iommu_dev_data *find_dev_data(u16 devid) · 6 unmodified lines
215285 return dev_data;
216286 }
217287
218−static inline u16 get_device_id(struct device *dev)
219−{
220− struct pci_dev *pdev = to_pci_dev(dev);
221−
222− return PCI_DEVID(pdev->bus->number, pdev->devfn);
223−}
224−
225288 static struct iommu_dev_data *get_dev_data(struct device *dev)
226289 {
227290 return dev->archdata.iommu;
@@ -349,6 +412,8 @@ static int iommu_init_device(struct device *dev) · 121 unmodified lines
349412 if (!dev_data)
350413 return -ENOMEM;
351414
415+ dev_data->alias = get_alias(dev);
416+
352417 if (pci_iommuv2_capable(pdev)) {
353418 struct amd_iommu *iommu;
354419
@@ -369,7 +434,7 @@ static void iommu_ignore_device(struct device *dev) · 14 unmodified lines
369434 u16 devid, alias;
370435
371436 devid = get_device_id(dev);
372− alias = amd_iommu_alias_table[devid];
437+ alias = get_alias(dev);
373438
374439 memset(&amd_iommu_dev_table[devid], 0, sizeof(struct dev_table_entry));
375440 memset(&amd_iommu_dev_table[alias], 0, sizeof(struct dev_table_entry));
@@ -1061,7 +1126,7 @@ static int device_flush_dte(struct iommu_dev_data *dev_data) · 685 unmodified lines
10611126 int ret;
10621127
10631128 iommu = amd_iommu_rlookup_table[dev_data->devid];
1064− alias = amd_iommu_alias_table[dev_data->devid];
1129+ alias = dev_data->alias;
10651130
10661131 ret = iommu_flush_dte(iommu, dev_data->devid);
10671132 if (!ret && alias != dev_data->devid)
@@ -2039,7 +2104,7 @@ static void do_attach(struct iommu_dev_data *dev_data, · 971 unmodified lines
20392104 bool ats;
20402105
20412106 iommu = amd_iommu_rlookup_table[dev_data->devid];
2042− alias = amd_iommu_alias_table[dev_data->devid];
2107+ alias = dev_data->alias;
20432108 ats = dev_data->ats.enabled;
20442109
20452110 /* Update data structures */
@@ -2073,7 +2138,7 @@ static void do_detach(struct iommu_dev_data *dev_data) · 27 unmodified lines
20732138 return;
20742139
20752140 iommu = amd_iommu_rlookup_table[dev_data->devid];
2076− alias = amd_iommu_alias_table[dev_data->devid];
2141+ alias = dev_data->alias;
20772142
20782143 /* decrease reference counters */
20792144 dev_data->domain->dev_iommu[iommu->index] -= 1;
drivers/iommu/arm-smmu.c+15−7
@@ -826,6 +826,12 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, · 825 unmodified lines
826826 if (smmu_domain->smmu)
827827 goto out_unlock;
828828
829+ /* We're bypassing these SIDs, so don't allocate an actual context */
830+ if (domain->type == IOMMU_DOMAIN_DMA) {
831+ smmu_domain->smmu = smmu;
832+ goto out_unlock;
833+ }
834+
829835 /*
830836 * Mapping the requested stage onto what we support is surprisingly
831837 * complicated, mainly because the spec allows S1+S2 SMMUs without
@@ -948,7 +954,7 @@ static void arm_smmu_destroy_domain_context(struct iommu_domain *domain) · 116 unmodified lines
948954 void __iomem *cb_base;
949955 int irq;
950956
951− if (!smmu)
957+ if (!smmu || domain->type == IOMMU_DOMAIN_DMA)
952958 return;
953959
954960 /*
@@ -1089,18 +1095,20 @@ static int arm_smmu_domain_add_master(struct arm_smmu_domain *smmu_domain, · 134 unmodified lines
10891095 struct arm_smmu_device *smmu = smmu_domain->smmu;
10901096 void __iomem *gr0_base = ARM_SMMU_GR0(smmu);
10911097
1092− /* Devices in an IOMMU group may already be configured */
1093− ret = arm_smmu_master_configure_smrs(smmu, cfg);
1094− if (ret)
1095− return ret == -EEXIST ? 0 : ret;
1096−
10971098 /*
10981099 * FIXME: This won't be needed once we have IOMMU-backed DMA ops
1099− * for all devices behind the SMMU.
1100+ * for all devices behind the SMMU. Note that we need to take
1101+ * care configuring SMRs for devices both a platform_device and
1102+ * and a PCI device (i.e. a PCI host controller)
11001103 */
11011104 if (smmu_domain->domain.type == IOMMU_DOMAIN_DMA)
11021105 return 0;
11031106
1107+ /* Devices in an IOMMU group may already be configured */
1108+ ret = arm_smmu_master_configure_smrs(smmu, cfg);
1109+ if (ret)
1110+ return ret == -EEXIST ? 0 : ret;
1111+
11041112 for (i = 0; i < cfg->num_streamids; ++i) {
11051113 u32 idx, s2cr;
11061114
drivers/irqchip/irq-mips-gic.c+2−2
@@ -467,7 +467,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask, · 466 unmodified lines
467467 gic_map_to_vpe(irq, mips_cm_vp_id(cpumask_first(&tmp)));
468468
469469 /* Update the pcpu_masks */
470− for (i = 0; i < gic_vpes; i++)
470+ for (i = 0; i < min(gic_vpes, NR_CPUS); i++)
471471 clear_bit(irq, pcpu_masks[i].pcpu_mask);
472472 set_bit(irq, pcpu_masks[cpumask_first(&tmp)].pcpu_mask);
473473
@@ -707,7 +707,7 @@ static int gic_shared_irq_domain_map(struct irq_domain *d, unsigned int virq, · 233 unmodified lines
707707 spin_lock_irqsave(&gic_lock, flags);
708708 gic_map_to_pin(intr, gic_cpu_pin);
709709 gic_map_to_vpe(intr, vpe);
710− for (i = 0; i < gic_vpes; i++)
710+ for (i = 0; i < min(gic_vpes, NR_CPUS); i++)
711711 clear_bit(intr, pcpu_masks[i].pcpu_mask);
712712 set_bit(intr, pcpu_masks[vpe].pcpu_mask);
713713 spin_unlock_irqrestore(&gic_lock, flags);
drivers/net/Kconfig+2−3
@@ -62,9 +62,8 @@ config DUMMY · 61 unmodified lines
6262 this device is consigned into oblivion) with a configurable IP
6363 address. It is most commonly used in order to make your currently
6464 inactive SLIP address seem like a real address for local programs.
65− If you use SLIP or PPP, you might want to say Y here. Since this
66− thing often comes in handy, the default is Y. It won't enlarge your
67− kernel either. What a deal. Read about it in the Network
65+ If you use SLIP or PPP, you might want to say Y here. It won't
66+ enlarge your kernel. What a deal. Read about it in the Network
6867 Administrator's Guide, available from
6968 <http://www.tldp.org/docs.html#guide>.
7069
drivers/net/ethernet/mellanox/mlx4/en_tx.c+4−2
@@ -405,7 +405,6 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev, · 404 unmodified lines
405405 u32 packets = 0;
406406 u32 bytes = 0;
407407 int factor = priv->cqe_factor;
408− u64 timestamp = 0;
409408 int done = 0;
410409 int budget = priv->tx_work_limit;
411410 u32 last_nr_txbb;
@@ -445,9 +444,12 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev, · 33 unmodified lines
445444 new_index = be16_to_cpu(cqe->wqe_index) & size_mask;
446445
447446 do {
447+ u64 timestamp = 0;
448+
448449 txbbs_skipped += last_nr_txbb;
449450 ring_index = (ring_index + last_nr_txbb) & size_mask;
450− if (ring->tx_info[ring_index].ts_requested)
451+
452+ if (unlikely(ring->tx_info[ring_index].ts_requested))
451453 timestamp = mlx4_en_get_cqe_ts(cqe);
452454
453455 /* free next descriptor */
drivers/net/ethernet/mellanox/mlx5/core/en.h+1−1
@@ -510,7 +510,7 @@ enum mlx5e_link_mode { · 509 unmodified lines
510510 MLX5E_100GBASE_KR4 = 22,
511511 MLX5E_100GBASE_LR4 = 23,
512512 MLX5E_100BASE_TX = 24,
513− MLX5E_100BASE_T = 25,
513+ MLX5E_1000BASE_T = 25,
514514 MLX5E_10GBASE_T = 26,
515515 MLX5E_25GBASE_CR = 27,
516516 MLX5E_25GBASE_KR = 28,
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+4−4
@@ -138,10 +138,10 @@ static const struct { · 137 unmodified lines
138138 [MLX5E_100BASE_TX] = {
139139 .speed = 100,
140140 },
141− [MLX5E_100BASE_T] = {
142− .supported = SUPPORTED_100baseT_Full,
143− .advertised = ADVERTISED_100baseT_Full,
144− .speed = 100,
141+ [MLX5E_1000BASE_T] = {
142+ .supported = SUPPORTED_1000baseT_Full,
143+ .advertised = ADVERTISED_1000baseT_Full,
144+ .speed = 1000,
145145 },
146146 [MLX5E_10GBASE_T] = {
147147 .supported = SUPPORTED_10000baseT_Full,
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+57−15
@@ -1542,24 +1542,50 @@ static int mlx5e_refresh_tirs_self_loopback_enable(struct mlx5e_priv *priv) · 1541 unmodified lines
15421542 return 0;
15431543 }
15441544
1545−static int mlx5e_set_dev_port_mtu(struct net_device *netdev)
1545+static int mlx5e_set_mtu(struct mlx5e_priv *priv, u16 mtu)
15461546 {
1547− struct mlx5e_priv *priv = netdev_priv(netdev);
15481547 struct mlx5_core_dev *mdev = priv->mdev;
1549− int hw_mtu;
1548+ u16 hw_mtu = MLX5E_SW2HW_MTU(mtu);
15501549 int err;
15511550
1552− err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(netdev->mtu), 1);
1551+ err = mlx5_set_port_mtu(mdev, hw_mtu, 1);
15531552 if (err)
15541553 return err;
15551554
1556− mlx5_query_port_oper_mtu(mdev, &hw_mtu, 1);
1555+ /* Update vport context MTU */
1556+ mlx5_modify_nic_vport_mtu(mdev, hw_mtu);
1557+ return 0;
1558+}
15571559
1558− if (MLX5E_HW2SW_MTU(hw_mtu) != netdev->mtu)
1559− netdev_warn(netdev, "%s: Port MTU %d is different than netdev mtu %d\n",
1560− __func__, MLX5E_HW2SW_MTU(hw_mtu), netdev->mtu);
1560+static void mlx5e_query_mtu(struct mlx5e_priv *priv, u16 *mtu)
1561+{
1562+ struct mlx5_core_dev *mdev = priv->mdev;
1563+ u16 hw_mtu = 0;
1564+ int err;
15611565
1562− netdev->mtu = MLX5E_HW2SW_MTU(hw_mtu);
1566+ err = mlx5_query_nic_vport_mtu(mdev, &hw_mtu);
1567+ if (err || !hw_mtu) /* fallback to port oper mtu */
1568+ mlx5_query_port_oper_mtu(mdev, &hw_mtu, 1);
1569+
1570+ *mtu = MLX5E_HW2SW_MTU(hw_mtu);
1571+}
1572+
1573+static int mlx5e_set_dev_port_mtu(struct net_device *netdev)
1574+{
1575+ struct mlx5e_priv *priv = netdev_priv(netdev);
1576+ u16 mtu;
1577+ int err;
1578+
1579+ err = mlx5e_set_mtu(priv, netdev->mtu);
1580+ if (err)
1581+ return err;
1582+
1583+ mlx5e_query_mtu(priv, &mtu);
1584+ if (mtu != netdev->mtu)
1585+ netdev_warn(netdev, "%s: VPort MTU %d is different than netdev mtu %d\n",
1586+ __func__, mtu, netdev->mtu);
1587+
1588+ netdev->mtu = mtu;
15631589 return 0;
15641590 }
15651591
@@ -2257,22 +2283,27 @@ static int mlx5e_set_features(struct net_device *netdev, · 691 unmodified lines
22572283 return err ? -EINVAL : 0;
22582284 }
22592285
2286+#define MXL5_HW_MIN_MTU 64
2287+#define MXL5E_MIN_MTU (MXL5_HW_MIN_MTU + ETH_FCS_LEN)
2288+
22602289 static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu)
22612290 {
22622291 struct mlx5e_priv *priv = netdev_priv(netdev);
22632292 struct mlx5_core_dev *mdev = priv->mdev;
22642293 bool was_opened;
2265− int max_mtu;
2294+ u16 max_mtu;
2295+ u16 min_mtu;
22662296 int err = 0;
22672297
22682298 mlx5_query_port_max_mtu(mdev, &max_mtu, 1);
22692299
22702300 max_mtu = MLX5E_HW2SW_MTU(max_mtu);
2301+ min_mtu = MLX5E_HW2SW_MTU(MXL5E_MIN_MTU);
22712302
2272− if (new_mtu > max_mtu) {
2303+ if (new_mtu > max_mtu || new_mtu < min_mtu) {
22732304 netdev_err(netdev,
2274− "%s: Bad MTU (%d) > (%d) Max\n",
2275− __func__, new_mtu, max_mtu);
2305+ "%s: Bad MTU (%d), valid range is: [%d..%d]\n",
2306+ __func__, new_mtu, min_mtu, max_mtu);
22762307 return -EINVAL;
22772308 }
22782309
@@ -2966,7 +2997,16 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv) · 687 unmodified lines
29662997 schedule_work(&priv->set_rx_mode_work);
29672998 mlx5e_disable_async_events(priv);
29682999 flush_scheduled_work();
2969− unregister_netdev(netdev);
3000+ if (test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state)) {
3001+ netif_device_detach(netdev);
3002+ mutex_lock(&priv->state_lock);
3003+ if (test_bit(MLX5E_STATE_OPENED, &priv->state))
3004+ mlx5e_close_locked(netdev);
3005+ mutex_unlock(&priv->state_lock);
3006+ } else {
3007+ unregister_netdev(netdev);
3008+ }
3009+
29703010 mlx5e_tc_cleanup(priv);
29713011 mlx5e_vxlan_cleanup(priv);
29723012 mlx5e_destroy_q_counter(priv);
@@ -2981,7 +3021,9 @@ static void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, void *vpriv) · 8 unmodified lines
29813021 mlx5_core_dealloc_transport_domain(priv->mdev, priv->tdn);
29823022 mlx5_core_dealloc_pd(priv->mdev, priv->pdn);
29833023 mlx5_unmap_free_uar(priv->mdev, &priv->cq_uar);
2984− free_netdev(netdev);
3024+
3025+ if (!test_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &mdev->intf_state))
3026+ free_netdev(netdev);
29853027 }
29863028
29873029 static void *mlx5e_get_netdev(void *vpriv)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+18−30
@@ -1065,33 +1065,6 @@ unlock_fg: · 1064 unmodified lines
10651065 return rule;
10661066 }
10671067
1068−static struct mlx5_flow_rule *add_rule_to_auto_fg(struct mlx5_flow_table *ft,
1069− u8 match_criteria_enable,
1070− u32 *match_criteria,
1071− u32 *match_value,
1072− u8 action,
1073− u32 flow_tag,
1074− struct mlx5_flow_destination *dest)
1075−{
1076− struct mlx5_flow_rule *rule;
1077− struct mlx5_flow_group *g;
1078−
1079− g = create_autogroup(ft, match_criteria_enable, match_criteria);
1080− if (IS_ERR(g))
1081− return (void *)g;
1082−
1083− rule = add_rule_fg(g, match_value,
1084− action, flow_tag, dest);
1085− if (IS_ERR(rule)) {
1086− /* Remove assumes refcount > 0 and autogroup creates a group
1087− * with a refcount = 0.
1088− */
1089− tree_get_node(&g->node);
1090− tree_remove_node(&g->node);
1091− }
1092− return rule;
1093−}
1094−
10951068 static struct mlx5_flow_rule *
10961069 _mlx5_add_flow_rule(struct mlx5_flow_table *ft,
10971070 u8 match_criteria_enable,
@@ -1119,8 +1092,23 @@ _mlx5_add_flow_rule(struct mlx5_flow_table *ft, · 21 unmodified lines
11191092 goto unlock;
11201093 }
11211094
1122− rule = add_rule_to_auto_fg(ft, match_criteria_enable, match_criteria,
1123− match_value, action, flow_tag, dest);
1095+ g = create_autogroup(ft, match_criteria_enable, match_criteria);
1096+ if (IS_ERR(g)) {
1097+ rule = (void *)g;
1098+ goto unlock;
1099+ }
1100+
1101+ rule = add_rule_fg(g, match_value,
1102+ action, flow_tag, dest);
1103+ if (IS_ERR(rule)) {
1104+ /* Remove assumes refcount > 0 and autogroup creates a group
1105+ * with a refcount = 0.
1106+ */
1107+ unlock_ref_node(&ft->node);
1108+ tree_get_node(&g->node);
1109+ tree_remove_node(&g->node);
1110+ return rule;
1111+ }
11241112 unlock:
11251113 unlock_ref_node(&ft->node);
11261114 return rule;
@@ -1288,7 +1276,7 @@ struct mlx5_flow_namespace *mlx5_get_flow_namespace(struct mlx5_core_dev *dev, · 161 unmodified lines
12881276 {
12891277 struct mlx5_flow_root_namespace *root_ns = dev->priv.root_ns;
12901278 int prio;
1291− static struct fs_prio *fs_prio;
1279+ struct fs_prio *fs_prio;
12921280 struct mlx5_flow_namespace *ns;
12931281
12941282 if (!root_ns)
drivers/net/ethernet/mellanox/mlx5/core/main.c+21−4
@@ -966,7 +966,7 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv) · 965 unmodified lines
966966 int err;
967967
968968 mutex_lock(&dev->intf_state_mutex);
969− if (dev->interface_state == MLX5_INTERFACE_STATE_UP) {
969+ if (test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) {
970970 dev_warn(&dev->pdev->dev, "%s: interface is up, NOP\n",
971971 __func__);
972972 goto out;
@@ -1133,7 +1133,8 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv) · 160 unmodified lines
11331133 if (err)
11341134 pr_info("failed request module on %s\n", MLX5_IB_MOD);
11351135
1136− dev->interface_state = MLX5_INTERFACE_STATE_UP;
1136+ clear_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state);
1137+ set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
11371138 out:
11381139 mutex_unlock(&dev->intf_state_mutex);
11391140
@@ -1207,7 +1208,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv) · 67 unmodified lines
12071208 }
12081209
12091210 mutex_lock(&dev->intf_state_mutex);
1210− if (dev->interface_state == MLX5_INTERFACE_STATE_DOWN) {
1211+ if (test_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state)) {
12111212 dev_warn(&dev->pdev->dev, "%s: interface is down, NOP\n",
12121213 __func__);
12131214 goto out;
@@ -1241,7 +1242,8 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv) · 27 unmodified lines
12411242 mlx5_cmd_cleanup(dev);
12421243
12431244 out:
1244− dev->interface_state = MLX5_INTERFACE_STATE_DOWN;
1245+ clear_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
1246+ set_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state);
12451247 mutex_unlock(&dev->intf_state_mutex);
12461248 return err;
12471249 }
@@ -1452,6 +1454,18 @@ static const struct pci_error_handlers mlx5_err_handler = { · 204 unmodified lines
14521454 .resume = mlx5_pci_resume
14531455 };
14541456
1457+static void shutdown(struct pci_dev *pdev)
1458+{
1459+ struct mlx5_core_dev *dev = pci_get_drvdata(pdev);
1460+ struct mlx5_priv *priv = &dev->priv;
1461+
1462+ dev_info(&pdev->dev, "Shutdown was called\n");
1463+ /* Notify mlx5 clients that the kernel is being shut down */
1464+ set_bit(MLX5_INTERFACE_STATE_SHUTDOWN, &dev->intf_state);
1465+ mlx5_unload_one(dev, priv);
1466+ mlx5_pci_disable_device(dev);
1467+}
1468+
14551469 static const struct pci_device_id mlx5_core_pci_table[] = {
14561470 { PCI_VDEVICE(MELLANOX, 0x1011) }, /* Connect-IB */
14571471 { PCI_VDEVICE(MELLANOX, 0x1012), MLX5_PCI_DEV_IS_VF}, /* Connect-IB VF */
@@ -1459,6 +1473,8 @@ static const struct pci_device_id mlx5_core_pci_table[] = { · 1 unmodified line
14591473 { PCI_VDEVICE(MELLANOX, 0x1014), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4 VF */
14601474 { PCI_VDEVICE(MELLANOX, 0x1015) }, /* ConnectX-4LX */
14611475 { PCI_VDEVICE(MELLANOX, 0x1016), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4LX VF */
1476+ { PCI_VDEVICE(MELLANOX, 0x1017) }, /* ConnectX-5 */
1477+ { PCI_VDEVICE(MELLANOX, 0x1018), MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 VF */
14621478 { 0, }
14631479 };
14641480
@@ -1469,6 +1485,7 @@ static struct pci_driver mlx5_core_driver = { · 4 unmodified lines
14691485 .id_table = mlx5_core_pci_table,
14701486 .probe = init_one,
14711487 .remove = remove_one,
1488+ .shutdown = shutdown,
14721489 .err_handler = &mlx5_err_handler,
14731490 .sriov_configure = mlx5_core_sriov_configure,
14741491 };
drivers/net/ethernet/mellanox/mlx5/core/port.c+5−5
@@ -260,8 +260,8 @@ int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, · 259 unmodified lines
260260 }
261261 EXPORT_SYMBOL_GPL(mlx5_query_port_admin_status);
262262
263−static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, int *admin_mtu,
264− int *max_mtu, int *oper_mtu, u8 port)
263+static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, u16 *admin_mtu,
264+ u16 *max_mtu, u16 *oper_mtu, u8 port)
265265 {
266266 u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
267267 u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
@@ -281,7 +281,7 @@ static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, int *admin_mtu, · 13 unmodified lines
281281 *admin_mtu = MLX5_GET(pmtu_reg, out, admin_mtu);
282282 }
283283
284−int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port)
284+int mlx5_set_port_mtu(struct mlx5_core_dev *dev, u16 mtu, u8 port)
285285 {
286286 u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
287287 u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
@@ -296,14 +296,14 @@ int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port) · 8 unmodified lines
296296 }
297297 EXPORT_SYMBOL_GPL(mlx5_set_port_mtu);
298298
299−void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu,
299+void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, u16 *max_mtu,
300300 u8 port)
301301 {
302302 mlx5_query_port_mtu(dev, NULL, max_mtu, NULL, port);
303303 }
304304 EXPORT_SYMBOL_GPL(mlx5_query_port_max_mtu);
305305
306−void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu,
306+void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, u16 *oper_mtu,
307307 u8 port)
308308 {
309309 mlx5_query_port_mtu(dev, NULL, NULL, oper_mtu, port);
drivers/net/ethernet/mellanox/mlx5/core/vport.c+40−0
@@ -196,6 +196,46 @@ int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *mdev, · 195 unmodified lines
196196 }
197197 EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_mac_address);
198198
199+int mlx5_query_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 *mtu)
200+{
201+ int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out);
202+ u32 *out;
203+ int err;
204+
205+ out = mlx5_vzalloc(outlen);
206+ if (!out)
207+ return -ENOMEM;
208+
209+ err = mlx5_query_nic_vport_context(mdev, 0, out, outlen);
210+ if (!err)
211+ *mtu = MLX5_GET(query_nic_vport_context_out, out,
212+ nic_vport_context.mtu);
213+
214+ kvfree(out);
215+ return err;
216+}
217+EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_mtu);
218+
219+int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu)
220+{
221+ int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in);
222+ void *in;
223+ int err;
224+
225+ in = mlx5_vzalloc(inlen);
226+ if (!in)
227+ return -ENOMEM;
228+
229+ MLX5_SET(modify_nic_vport_context_in, in, field_select.mtu, 1);
230+ MLX5_SET(modify_nic_vport_context_in, in, nic_vport_context.mtu, mtu);
231+
232+ err = mlx5_modify_nic_vport_context(mdev, in, inlen);
233+
234+ kvfree(in);
235+ return err;
236+}
237+EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_mtu);
238+
199239 int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev,
200240 u32 vport,
201241 enum mlx5_list_type list_type,
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h+2−2
@@ -37,8 +37,8 @@ · 36 unmodified lines
3737
3838 #define _QLCNIC_LINUX_MAJOR 5
3939 #define _QLCNIC_LINUX_MINOR 3
40−#define _QLCNIC_LINUX_SUBVERSION 63
41−#define QLCNIC_LINUX_VERSIONID "5.3.63"
40+#define _QLCNIC_LINUX_SUBVERSION 64
41+#define QLCNIC_LINUX_VERSIONID "5.3.64"
4242 #define QLCNIC_DRV_IDC_VER 0x01
4343 #define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
4444 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c+16−34
@@ -49,7 +49,6 @@ struct socfpga_dwmac { · 48 unmodified lines
4949 u32 reg_shift;
5050 struct device *dev;
5151 struct regmap *sys_mgr_base_addr;
52− struct reset_control *stmmac_rst;
5352 void __iomem *splitter_base;
5453 bool f2h_ptp_ref_clk;
5554 };
@@ -92,15 +91,6 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device * · 36 unmodified lines
9291 struct device_node *np_splitter;
9392 struct resource res_splitter;
9493
95− dwmac->stmmac_rst = devm_reset_control_get(dev,
96− STMMAC_RESOURCE_NAME);
97− if (IS_ERR(dwmac->stmmac_rst)) {
98− dev_info(dev, "Could not get reset control!\n");
99− if (PTR_ERR(dwmac->stmmac_rst) == -EPROBE_DEFER)
100− return -EPROBE_DEFER;
101− dwmac->stmmac_rst = NULL;
102− }
103−
10494 dwmac->interface = of_get_phy_mode(np);
10595
10696 sys_mgr_base_addr = syscon_regmap_lookup_by_phandle(np, "altr,sysmgr-syscon");
@@ -194,30 +184,23 @@ static int socfpga_dwmac_setup(struct socfpga_dwmac *dwmac) · 87 unmodified lines
194184 return 0;
195185 }
196186
197−static void socfpga_dwmac_exit(struct platform_device *pdev, void *priv)
198−{
199− struct socfpga_dwmac *dwmac = priv;
200−
201− /* On socfpga platform exit, assert and hold reset to the
202− * enet controller - the default state after a hard reset.
203− */
204− if (dwmac->stmmac_rst)
205− reset_control_assert(dwmac->stmmac_rst);
206−}
207−
208187 static int socfpga_dwmac_init(struct platform_device *pdev, void *priv)
209188 {
210− struct socfpga_dwmac *dwmac = priv;
189+ struct socfpga_dwmac *dwmac = priv;
211190 struct net_device *ndev = platform_get_drvdata(pdev);
212191 struct stmmac_priv *stpriv = NULL;
213192 int ret = 0;
214193
215− if (ndev)
216− stpriv = netdev_priv(ndev);
194+ if (!ndev)
195+ return -EINVAL;
196+
197+ stpriv = netdev_priv(ndev);
198+ if (!stpriv)
199+ return -EINVAL;
217200
218201 /* Assert reset to the enet controller before changing the phy mode */
219− if (dwmac->stmmac_rst)
220− reset_control_assert(dwmac->stmmac_rst);
202+ if (stpriv->stmmac_rst)
203+ reset_control_assert(stpriv->stmmac_rst);
221204
222205 /* Setup the phy mode in the system manager registers according to
223206 * devicetree configuration
@@ -227,8 +210,8 @@ static int socfpga_dwmac_init(struct platform_device *pdev, void *priv) · 3 unmodified lines
227210 /* Deassert reset for the phy configuration to be sampled by
228211 * the enet controller, and operation to start in requested mode
229212 */
230− if (dwmac->stmmac_rst)
231− reset_control_deassert(dwmac->stmmac_rst);
213+ if (stpriv->stmmac_rst)
214+ reset_control_deassert(stpriv->stmmac_rst);
232215
233216 /* Before the enet controller is suspended, the phy is suspended.
234217 * This causes the phy clock to be gated. The enet controller is
@@ -245,7 +228,7 @@ static int socfpga_dwmac_init(struct platform_device *pdev, void *priv) · 10 unmodified lines
245228 * control register 0, and can be modified by the phy driver
246229 * framework.
247230 */
248− if (stpriv && stpriv->phydev)
231+ if (stpriv->phydev)
249232 phy_resume(stpriv->phydev);
250233
251234 return ret;
@@ -279,14 +262,13 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) · 27 unmodified lines
279262
280263 plat_dat->bsp_priv = dwmac;
281264 plat_dat->init = socfpga_dwmac_init;
282− plat_dat->exit = socfpga_dwmac_exit;
283265 plat_dat->fix_mac_speed = socfpga_dwmac_fix_mac_speed;
284266
285− ret = socfpga_dwmac_init(pdev, plat_dat->bsp_priv);
286− if (ret)
287− return ret;
267+ ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
268+ if (!ret)
269+ ret = socfpga_dwmac_init(pdev, dwmac);
288270
289− return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
271+ return ret;
290272 }
291273
292274 static const struct of_device_id socfpga_dwmac_match[] = {
drivers/net/macsec.c+40−23
@@ -880,12 +880,12 @@ static struct sk_buff *macsec_decrypt(struct sk_buff *skb, · 879 unmodified lines
880880 macsec_skb_cb(skb)->valid = false;
881881 skb = skb_share_check(skb, GFP_ATOMIC);
882882 if (!skb)
883− return NULL;
883+ return ERR_PTR(-ENOMEM);
884884
885885 req = aead_request_alloc(rx_sa->key.tfm, GFP_ATOMIC);
886886 if (!req) {
887887 kfree_skb(skb);
888− return NULL;
888+ return ERR_PTR(-ENOMEM);
889889 }
890890
891891 hdr = (struct macsec_eth_header *)skb->data;
@@ -905,7 +905,7 @@ static struct sk_buff *macsec_decrypt(struct sk_buff *skb, · 13 unmodified lines
905905 skb = skb_unshare(skb, GFP_ATOMIC);
906906 if (!skb) {
907907 aead_request_free(req);
908− return NULL;
908+ return ERR_PTR(-ENOMEM);
909909 }
910910 } else {
911911 /* integrity only: all headers + data authenticated */
@@ -921,14 +921,14 @@ static struct sk_buff *macsec_decrypt(struct sk_buff *skb, · 9 unmodified lines
921921 dev_hold(dev);
922922 ret = crypto_aead_decrypt(req);
923923 if (ret == -EINPROGRESS) {
924− return NULL;
924+ return ERR_PTR(ret);
925925 } else if (ret != 0) {
926926 /* decryption/authentication failed
927927 * 10.6 if validateFrames is disabled, deliver anyway
928928 */
929929 if (ret != -EBADMSG) {
930930 kfree_skb(skb);
931− skb = NULL;
931+ skb = ERR_PTR(ret);
932932 }
933933 } else {
934934 macsec_skb_cb(skb)->valid = true;
@@ -1146,8 +1146,10 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb) · 211 unmodified lines
11461146 secy->validate_frames != MACSEC_VALIDATE_DISABLED)
11471147 skb = macsec_decrypt(skb, dev, rx_sa, sci, secy);
11481148
1149− if (!skb) {
1150− macsec_rxsa_put(rx_sa);
1149+ if (IS_ERR(skb)) {
1150+ /* the decrypt callback needs the reference */
1151+ if (PTR_ERR(skb) != -EINPROGRESS)
1152+ macsec_rxsa_put(rx_sa);
11511153 rcu_read_unlock();
11521154 *pskb = NULL;
11531155 return RX_HANDLER_CONSUMED;
@@ -1161,7 +1163,8 @@ deliver: · 7 unmodified lines
11611163 macsec_extra_len(macsec_skb_cb(skb)->has_sci));
11621164 macsec_reset_skb(skb, secy->netdev);
11631165
1164− macsec_rxsa_put(rx_sa);
1166+ if (rx_sa)
1167+ macsec_rxsa_put(rx_sa);
11651168 count_rx(dev, skb->len);
11661169
11671170 rcu_read_unlock();
@@ -1623,8 +1626,9 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info) · 455 unmodified lines
16231626 }
16241627
16251628 rx_sa = kmalloc(sizeof(*rx_sa), GFP_KERNEL);
1626− if (init_rx_sa(rx_sa, nla_data(tb_sa[MACSEC_SA_ATTR_KEY]), secy->key_len,
1627− secy->icv_len)) {
1629+ if (!rx_sa || init_rx_sa(rx_sa, nla_data(tb_sa[MACSEC_SA_ATTR_KEY]),
1630+ secy->key_len, secy->icv_len)) {
1631+ kfree(rx_sa);
16281632 rtnl_unlock();
16291633 return -ENOMEM;
16301634 }
@@ -1769,6 +1773,7 @@ static int macsec_add_txsa(struct sk_buff *skb, struct genl_info *info) · 138 unmodified lines
17691773 tx_sa = kmalloc(sizeof(*tx_sa), GFP_KERNEL);
17701774 if (!tx_sa || init_tx_sa(tx_sa, nla_data(tb_sa[MACSEC_SA_ATTR_KEY]),
17711775 secy->key_len, secy->icv_len)) {
1776+ kfree(tx_sa);
17721777 rtnl_unlock();
17731778 return -ENOMEM;
17741779 }
@@ -2274,7 +2279,7 @@ static int nla_put_secy(struct macsec_secy *secy, struct sk_buff *skb) · 499 unmodified lines
22742279 if (nla_put_sci(skb, MACSEC_SECY_ATTR_SCI, secy->sci,
22752280 MACSEC_SECY_ATTR_PAD) ||
22762281 nla_put_u64_64bit(skb, MACSEC_SECY_ATTR_CIPHER_SUITE,
2277− DEFAULT_CIPHER_ID,
2282+ MACSEC_DEFAULT_CIPHER_ID,
22782283 MACSEC_SECY_ATTR_PAD) ||
22792284 nla_put_u8(skb, MACSEC_SECY_ATTR_ICV_LEN, secy->icv_len) ||
22802285 nla_put_u8(skb, MACSEC_SECY_ATTR_OPER, secy->operational) ||
@@ -2316,7 +2321,7 @@ static int dump_secy(struct macsec_secy *secy, struct net_device *dev, · 35 unmodified lines
23162321 if (!hdr)
23172322 return -EMSGSIZE;
23182323
2319− rtnl_lock();
2324+ genl_dump_check_consistent(cb, hdr, &macsec_fam);
23202325
23212326 if (nla_put_u32(skb, MACSEC_ATTR_IFINDEX, dev->ifindex))
23222327 goto nla_put_failure;
@@ -2482,18 +2487,17 @@ static int dump_secy(struct macsec_secy *secy, struct net_device *dev, · 159 unmodified lines
24822487
24832488 nla_nest_end(skb, rxsc_list);
24842489
2485− rtnl_unlock();
2486−
24872490 genlmsg_end(skb, hdr);
24882491
24892492 return 0;
24902493
24912494 nla_put_failure:
2492− rtnl_unlock();
24932495 genlmsg_cancel(skb, hdr);
24942496 return -EMSGSIZE;
24952497 }
24962498
2499+static int macsec_generation = 1; /* protected by RTNL */
2500+
24972501 static int macsec_dump_txsc(struct sk_buff *skb, struct netlink_callback *cb)
24982502 {
24992503 struct net *net = sock_net(skb->sk);
@@ -2503,6 +2507,10 @@ static int macsec_dump_txsc(struct sk_buff *skb, struct netlink_callback *cb) · 3 unmodified lines
25032507 dev_idx = cb->args[0];
25042508
25052509 d = 0;
2510+ rtnl_lock();
2511+
2512+ cb->seq = macsec_generation;
2513+
25062514 for_each_netdev(net, dev) {
25072515 struct macsec_secy *secy;
25082516
@@ -2520,6 +2528,7 @@ next: · 11 unmodified lines
25202528 }
25212529
25222530 done:
2531+ rtnl_unlock();
25232532 cb->args[0] = d;
25242533 return skb->len;
25252534 }
@@ -2973,10 +2982,14 @@ static void macsec_dellink(struct net_device *dev, struct list_head *head) · 447 unmodified lines
29732982 struct net_device *real_dev = macsec->real_dev;
29742983 struct macsec_rxh_data *rxd = macsec_data_rtnl(real_dev);
29752984
2985+ macsec_generation++;
2986+
29762987 unregister_netdevice_queue(dev, head);
29772988 list_del_rcu(&macsec->secys);
2978− if (list_empty(&rxd->secys))
2989+ if (list_empty(&rxd->secys)) {
29792990 netdev_rx_handler_unregister(real_dev);
2991+ kfree(rxd);
2992+ }
29802993
29812994 macsec_del_dev(macsec);
29822995 }
@@ -2998,8 +3011,10 @@ static int register_macsec_dev(struct net_device *real_dev, · 15 unmodified lines
29983011
29993012 err = netdev_rx_handler_register(real_dev, macsec_handle_frame,
30003013 rxd);
3001− if (err < 0)
3014+ if (err < 0) {
3015+ kfree(rxd);
30023016 return err;
3017+ }
30033018 }
30043019
30053020 list_add_tail_rcu(&macsec->secys, &rxd->secys);
@@ -3119,6 +3134,8 @@ static int macsec_newlink(struct net *net, struct net_device *dev, · 113 unmodified lines
31193134 if (err < 0)
31203135 goto del_dev;
31213136
3137+ macsec_generation++;
3138+
31223139 dev_hold(real_dev);
31233140
31243141 return 0;
@@ -3132,7 +3149,7 @@ unregister: · 7 unmodified lines
31323149
31333150 static int macsec_validate_attr(struct nlattr *tb[], struct nlattr *data[])
31343151 {
3135− u64 csid = DEFAULT_CIPHER_ID;
3152+ u64 csid = MACSEC_DEFAULT_CIPHER_ID;
31363153 u8 icv_len = DEFAULT_ICV_LEN;
31373154 int flag;
31383155 bool es, scb, sci;
@@ -3147,8 +3164,8 @@ static int macsec_validate_attr(struct nlattr *tb[], struct nlattr *data[]) · 8 unmodified lines
31473164 icv_len = nla_get_u8(data[IFLA_MACSEC_ICV_LEN]);
31483165
31493166 switch (csid) {
3150− case DEFAULT_CIPHER_ID:
3151− case DEFAULT_CIPHER_ALT:
3167+ case MACSEC_DEFAULT_CIPHER_ID:
3168+ case MACSEC_DEFAULT_CIPHER_ALT:
31523169 if (icv_len < MACSEC_MIN_ICV_LEN ||
31533170 icv_len > MACSEC_MAX_ICV_LEN)
31543171 return -EINVAL;
@@ -3182,8 +3199,8 @@ static int macsec_validate_attr(struct nlattr *tb[], struct nlattr *data[]) · 27 unmodified lines
31823199 nla_get_u8(data[IFLA_MACSEC_VALIDATION]) > MACSEC_VALIDATE_MAX)
31833200 return -EINVAL;
31843201
3185− if ((data[IFLA_MACSEC_PROTECT] &&
3186− nla_get_u8(data[IFLA_MACSEC_PROTECT])) &&
3202+ if ((data[IFLA_MACSEC_REPLAY_PROTECT] &&
3203+ nla_get_u8(data[IFLA_MACSEC_REPLAY_PROTECT])) &&
31873204 !data[IFLA_MACSEC_WINDOW])
31883205 return -EINVAL;
31893206
@@ -3223,7 +3240,7 @@ static int macsec_fill_info(struct sk_buff *skb, · 33 unmodified lines
32233240 IFLA_MACSEC_PAD) ||
32243241 nla_put_u8(skb, IFLA_MACSEC_ICV_LEN, secy->icv_len) ||
32253242 nla_put_u64_64bit(skb, IFLA_MACSEC_CIPHER_SUITE,
3226− DEFAULT_CIPHER_ID, IFLA_MACSEC_PAD) ||
3243+ MACSEC_DEFAULT_CIPHER_ID, IFLA_MACSEC_PAD) ||
32273244 nla_put_u8(skb, IFLA_MACSEC_ENCODING_SA, tx_sc->encoding_sa) ||
32283245 nla_put_u8(skb, IFLA_MACSEC_ENCRYPT, tx_sc->encrypt) ||
32293246 nla_put_u8(skb, IFLA_MACSEC_PROTECT, secy->protect_frames) ||
drivers/perf/arm_pmu.c+13−2
@@ -737,8 +737,19 @@ static void cpu_pm_pmu_setup(struct arm_pmu *armpmu, unsigned long cmd) · 736 unmodified lines
737737 break;
738738 case CPU_PM_EXIT:
739739 case CPU_PM_ENTER_FAILED:
740− /* Restore and enable the counter */
741− armpmu_start(event, PERF_EF_RELOAD);
740+ /*
741+ * Restore and enable the counter.
742+ * armpmu_start() indirectly calls
743+ *
744+ * perf_event_update_userpage()
745+ *
746+ * that requires RCU read locking to be functional,
747+ * wrap the call within RCU_NONIDLE to make the
748+ * RCU subsystem aware this cpu is not idle from
749+ * an RCU perspective for the armpmu_start() call
750+ * duration.
751+ */
752+ RCU_NONIDLE(armpmu_start(event, PERF_EF_RELOAD));
742753 break;
743754 default:
744755 break;
drivers/phy/phy-rockchip-dp.c+5−2
@@ -86,6 +86,9 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev) · 85 unmodified lines
8686 if (!np)
8787 return -ENODEV;
8888
89+ if (!dev->parent || !dev->parent->of_node)
90+ return -ENODEV;
91+
8992 dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
9093 if (IS_ERR(dp))
9194 return -ENOMEM;
@@ -104,9 +107,9 @@ static int rockchip_dp_phy_probe(struct platform_device *pdev) · 12 unmodified lines
104107 return ret;
105108 }
106109
107− dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
110+ dp->grf = syscon_node_to_regmap(dev->parent->of_node);
108111 if (IS_ERR(dp->grf)) {
109− dev_err(dev, "rk3288-dp needs rockchip,grf property\n");
112+ dev_err(dev, "rk3288-dp needs the General Register Files syscon\n");
110113 return PTR_ERR(dp->grf);
111114 }
112115
drivers/phy/phy-rockchip-emmc.c+4−1
@@ -176,7 +176,10 @@ static int rockchip_emmc_phy_probe(struct platform_device *pdev) · 175 unmodified lines
176176 struct regmap *grf;
177177 unsigned int reg_offset;
178178
179− grf = syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,grf");
179+ if (!dev->parent || !dev->parent->of_node)
180+ return -ENODEV;
181+
182+ grf = syscon_node_to_regmap(dev->parent->of_node);
180183 if (IS_ERR(grf)) {
181184 dev_err(dev, "Missing rockchip,grf property\n");
182185 return PTR_ERR(grf);
drivers/pinctrl/freescale/Kconfig+1−0
@@ -2,6 +2,7 @@ config PINCTRL_IMX · 1 unmodified line
22 bool
33 select PINMUX
44 select PINCONF
5+ select REGMAP
56
67 config PINCTRL_IMX1_CORE
78 bool
drivers/pinctrl/mediatek/pinctrl-mtk-common.c+5−4
@@ -1004,7 +1004,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, · 1003 unmodified lines
10041004 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
10051005 int eint_num, virq, eint_offset;
10061006 unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
1007− static const unsigned int dbnc_arr[] = {0 , 1, 16, 32, 64, 128, 256};
1007+ static const unsigned int debounce_time[] = {500, 1000, 16000, 32000, 64000,
1008+ 128000, 256000};
10081009 const struct mtk_desc_pin *pin;
10091010 struct irq_data *d;
10101011
@@ -1022,9 +1023,9 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, · 11 unmodified lines
10221023 if (!mtk_eint_can_en_debounce(pctl, eint_num))
10231024 return -ENOSYS;
10241025
1025− dbnc = ARRAY_SIZE(dbnc_arr);
1026− for (i = 0; i < ARRAY_SIZE(dbnc_arr); i++) {
1027− if (debounce <= dbnc_arr[i]) {
1026+ dbnc = ARRAY_SIZE(debounce_time);
1027+ for (i = 0; i < ARRAY_SIZE(debounce_time); i++) {
1028+ if (debounce <= debounce_time[i]) {
10281029 dbnc = i;
10291030 break;
10301031 }
drivers/pinctrl/pinctrl-single.c+3−3
@@ -1280,9 +1280,9 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs, · 1279 unmodified lines
12801280
12811281 /* Parse pins in each row from LSB */
12821282 while (mask) {
1283− bit_pos = ffs(mask);
1283+ bit_pos = __ffs(mask);
12841284 pin_num_from_lsb = bit_pos / pcs->bits_per_pin;
1285− mask_pos = ((pcs->fmask) << (bit_pos - 1));
1285+ mask_pos = ((pcs->fmask) << bit_pos);
12861286 val_pos = val & mask_pos;
12871287 submask = mask & mask_pos;
12881288
@@ -1852,7 +1852,7 @@ static int pcs_probe(struct platform_device *pdev) · 563 unmodified lines
18521852 ret = of_property_read_u32(np, "pinctrl-single,function-mask",
18531853 &pcs->fmask);
18541854 if (!ret) {
1855− pcs->fshift = ffs(pcs->fmask) - 1;
1855+ pcs->fshift = __ffs(pcs->fmask);
18561856 pcs->fmax = pcs->fmask >> pcs->fshift;
18571857 } else {
18581858 /* If mask property doesn't exist, function mux is invalid. */
drivers/scsi/cxgbi/libcxgbi.c+1−0
@@ -688,6 +688,7 @@ static struct rt6_info *find_route_ipv6(const struct in6_addr *saddr, · 687 unmodified lines
688688 {
689689 struct flowi6 fl;
690690
691+ memset(&fl, 0, sizeof(fl));
691692 if (saddr)
692693 memcpy(&fl.saddr, saddr, sizeof(struct in6_addr));
693694 if (daddr)
drivers/soc/mediatek/mtk-scpsys.c+6−5
@@ -491,13 +491,14 @@ static int scpsys_probe(struct platform_device *pdev) · 490 unmodified lines
491491 genpd->dev_ops.active_wakeup = scpsys_active_wakeup;
492492
493493 /*
494− * With CONFIG_PM disabled turn on all domains to make the
495− * hardware usable.
494+ * Initially turn on all domains to make the domains usable
495+ * with !CONFIG_PM and to get the hardware in sync with the
496+ * software. The unused domains will be switched off during
497+ * late_init time.
496498 */
497− if (!IS_ENABLED(CONFIG_PM))
498− genpd->power_on(genpd);
499+ genpd->power_on(genpd);
499500
500− pm_genpd_init(genpd, NULL, true);
501+ pm_genpd_init(genpd, NULL, false);
501502 }
502503
503504 /*
drivers/thermal/Kconfig+2−0
@@ -376,6 +376,8 @@ config MTK_THERMAL · 375 unmodified lines
376376 tristate "Temperature sensor driver for mediatek SoCs"
377377 depends on ARCH_MEDIATEK || COMPILE_TEST
378378 depends on HAS_IOMEM
379+ depends on NVMEM || NVMEM=n
380+ depends on RESET_CONTROLLER
379381 default y
380382 help
381383 Enable this option if you want to have support for thermal management
drivers/thermal/mtk_thermal.c+1−2
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 #include <linux/thermal.h>
2828 #include <linux/reset.h>
2929 #include <linux/types.h>
30−#include <linux/nvmem-consumer.h>
3130
3231 /* AUXADC Registers */
3332 #define AUXADC_CON0_V 0x000
@@ -619,7 +618,7 @@ static struct platform_driver mtk_thermal_driver = { · 585 unmodified lines
619618
620619 module_platform_driver(mtk_thermal_driver);
621620
622−MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de");
621+MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
623622 MODULE_AUTHOR("Hanyi Wu <hanyi.wu@mediatek.com>");
624623 MODULE_DESCRIPTION("Mediatek thermal driver");
625624 MODULE_LICENSE("GPL v2");
drivers/thermal/of-thermal.c+2−2
@@ -803,8 +803,8 @@ static int thermal_of_populate_trip(struct device_node *np, · 802 unmodified lines
803803 * otherwise, it returns a corresponding ERR_PTR(). Caller must
804804 * check the return value with help of IS_ERR() helper.
805805 */
806−static struct __thermal_zone *
807−thermal_of_build_thermal_zone(struct device_node *np)
806+static struct __thermal_zone
807+__init *thermal_of_build_thermal_zone(struct device_node *np)
808808 {
809809 struct device_node *child = NULL, *gchild;
810810 struct __thermal_zone *tz;
drivers/thermal/power_allocator.c+1−1
@@ -301,7 +301,7 @@ static void divvy_up_power(u32 *req_power, u32 *max_power, int num_actors, · 300 unmodified lines
301301 capped_extra_power = 0;
302302 extra_power = 0;
303303 for (i = 0; i < num_actors; i++) {
304− u64 req_range = req_power[i] * power_range;
304+ u64 req_range = (u64)req_power[i] * power_range;
305305
306306 granted_power[i] = DIV_ROUND_CLOSEST_ULL(req_range,
307307 total_req_power);
drivers/thermal/thermal_core.c+4−4
@@ -688,7 +688,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr, · 687 unmodified lines
688688 {
689689 struct thermal_zone_device *tz = to_thermal_zone(dev);
690690 int trip, ret;
691− unsigned long temperature;
691+ int temperature;
692692
693693 if (!tz->ops->set_trip_temp)
694694 return -EPERM;
@@ -696,7 +696,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr, · 1 unmodified line
696696 if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip))
697697 return -EINVAL;
698698
699− if (kstrtoul(buf, 10, &temperature))
699+ if (kstrtoint(buf, 10, &temperature))
700700 return -EINVAL;
701701
702702 ret = tz->ops->set_trip_temp(tz, trip, temperature);
@@ -899,9 +899,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr, · 196 unmodified lines
899899 {
900900 struct thermal_zone_device *tz = to_thermal_zone(dev);
901901 int ret = 0;
902− unsigned long temperature;
902+ int temperature;
903903
904− if (kstrtoul(buf, 10, &temperature))
904+ if (kstrtoint(buf, 10, &temperature))
905905 return -EINVAL;
906906
907907 if (!tz->ops->set_emul_temp) {
drivers/tty/pty.c+8−10
@@ -626,7 +626,7 @@ static int pty_unix98_ioctl(struct tty_struct *tty, · 625 unmodified lines
626626 */
627627
628628 static struct tty_struct *ptm_unix98_lookup(struct tty_driver *driver,
629− struct inode *ptm_inode, int idx)
629+ struct file *file, int idx)
630630 {
631631 /* Master must be open via /dev/ptmx */
632632 return ERR_PTR(-EIO);
@@ -642,12 +642,12 @@ static struct tty_struct *ptm_unix98_lookup(struct tty_driver *driver, · 9 unmodified lines
642642 */
643643
644644 static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
645− struct inode *pts_inode, int idx)
645+ struct file *file, int idx)
646646 {
647647 struct tty_struct *tty;
648648
649649 mutex_lock(&devpts_mutex);
650− tty = devpts_get_priv(pts_inode);
650+ tty = devpts_get_priv(file->f_path.dentry);
651651 mutex_unlock(&devpts_mutex);
652652 /* Master must be open before slave */
653653 if (!tty)
@@ -722,7 +722,7 @@ static int ptmx_open(struct inode *inode, struct file *filp) · 68 unmodified lines
722722 {
723723 struct pts_fs_info *fsi;
724724 struct tty_struct *tty;
725− struct inode *slave_inode;
725+ struct dentry *dentry;
726726 int retval;
727727 int index;
728728
@@ -769,14 +769,12 @@ static int ptmx_open(struct inode *inode, struct file *filp) · 40 unmodified lines
769769
770770 tty_add_file(tty, filp);
771771
772− slave_inode = devpts_pty_new(fsi,
773− MKDEV(UNIX98_PTY_SLAVE_MAJOR, index), index,
774− tty->link);
775− if (IS_ERR(slave_inode)) {
776− retval = PTR_ERR(slave_inode);
772+ dentry = devpts_pty_new(fsi, index, tty->link);
773+ if (IS_ERR(dentry)) {
774+ retval = PTR_ERR(dentry);
777775 goto err_release;
778776 }
779− tty->link->driver_data = slave_inode;
777+ tty->link->driver_data = dentry;
780778
781779 retval = ptm_driver->ops->open(tty, filp);
782780 if (retval)
drivers/tty/serial/8250/8250_port.c+10−1
@@ -1403,9 +1403,18 @@ static void __do_stop_tx_rs485(struct uart_8250_port *p) · 1402 unmodified lines
14031403 /*
14041404 * Empty the RX FIFO, we are not interested in anything
14051405 * received during the half-duplex transmission.
1406+ * Enable previously disabled RX interrupts.
14061407 */
1407− if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX))
1408+ if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) {
14081409 serial8250_clear_fifos(p);
1410+
1411+ serial8250_rpm_get(p);
1412+
1413+ p->ier |= UART_IER_RLSI | UART_IER_RDI;
1414+ serial_port_out(&p->port, UART_IER, p->ier);
1415+
1416+ serial8250_rpm_put(p);
1417+ }
14091418 }
14101419
14111420 static void serial8250_em485_handle_stop_tx(unsigned long arg)
drivers/tty/serial/8250/Kconfig+0−1
@@ -324,7 +324,6 @@ config SERIAL_8250_EM · 323 unmodified lines
324324 config SERIAL_8250_RT288X
325325 bool "Ralink RT288x/RT305x/RT3662/RT3883 serial port support"
326326 depends on SERIAL_8250
327− depends on MIPS || COMPILE_TEST
328327 default y if MIPS_ALCHEMY || SOC_RT288X || SOC_RT305X || SOC_RT3883 || SOC_MT7620
329328 help
330329 Selecting this option will add support for the alternate register
drivers/tty/serial/uartlite.c+4−4
@@ -72,7 +72,7 @@ static void uartlite_outbe32(u32 val, void __iomem *addr) · 71 unmodified lines
7272 iowrite32be(val, addr);
7373 }
7474
75−static const struct uartlite_reg_ops uartlite_be = {
75+static struct uartlite_reg_ops uartlite_be = {
7676 .in = uartlite_inbe32,
7777 .out = uartlite_outbe32,
7878 };
@@ -87,21 +87,21 @@ static void uartlite_outle32(u32 val, void __iomem *addr) · 8 unmodified lines
8787 iowrite32(val, addr);
8888 }
8989
90−static const struct uartlite_reg_ops uartlite_le = {
90+static struct uartlite_reg_ops uartlite_le = {
9191 .in = uartlite_inle32,
9292 .out = uartlite_outle32,
9393 };
9494
9595 static inline u32 uart_in32(u32 offset, struct uart_port *port)
9696 {
97− const struct uartlite_reg_ops *reg_ops = port->private_data;
97+ struct uartlite_reg_ops *reg_ops = port->private_data;
9898
9999 return reg_ops->in(port->membase + offset);
100100 }
101101
102102 static inline void uart_out32(u32 val, u32 offset, struct uart_port *port)
103103 {
104− const struct uartlite_reg_ops *reg_ops = port->private_data;
104+ struct uartlite_reg_ops *reg_ops = port->private_data;
105105
106106 reg_ops->out(val, port->membase + offset);
107107 }
drivers/tty/tty_io.c+3−3
@@ -1367,12 +1367,12 @@ static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p) · 1366 unmodified lines
13671367 * Locking: tty_mutex must be held. If the tty is found, bump the tty kref.
13681368 */
13691369 static struct tty_struct *tty_driver_lookup_tty(struct tty_driver *driver,
1370− struct inode *inode, int idx)
1370+ struct file *file, int idx)
13711371 {
13721372 struct tty_struct *tty;
13731373
13741374 if (driver->ops->lookup)
1375− tty = driver->ops->lookup(driver, inode, idx);
1375+ tty = driver->ops->lookup(driver, file, idx);
13761376 else
13771377 tty = driver->ttys[idx];
13781378
@@ -2040,7 +2040,7 @@ static struct tty_struct *tty_open_by_driver(dev_t device, struct inode *inode, · 661 unmodified lines
20402040 }
20412041
20422042 /* check whether we're reopening an existing tty */
2043− tty = tty_driver_lookup_tty(driver, inode, index);
2043+ tty = tty_driver_lookup_tty(driver, filp, index);
20442044 if (IS_ERR(tty)) {
20452045 mutex_unlock(&tty_mutex);
20462046 goto out;
drivers/usb/dwc3/core.c+22−1
@@ -1150,6 +1150,11 @@ static int dwc3_suspend(struct device *dev) · 1149 unmodified lines
11501150 phy_exit(dwc->usb2_generic_phy);
11511151 phy_exit(dwc->usb3_generic_phy);
11521152
1153+ usb_phy_set_suspend(dwc->usb2_phy, 1);
1154+ usb_phy_set_suspend(dwc->usb3_phy, 1);
1155+ WARN_ON(phy_power_off(dwc->usb2_generic_phy) < 0);
1156+ WARN_ON(phy_power_off(dwc->usb3_generic_phy) < 0);
1157+
11531158 pinctrl_pm_select_sleep_state(dev);
11541159
11551160 return 0;
@@ -1163,11 +1168,21 @@ static int dwc3_resume(struct device *dev) · 7 unmodified lines
11631168
11641169 pinctrl_pm_select_default_state(dev);
11651170
1171+ usb_phy_set_suspend(dwc->usb2_phy, 0);
1172+ usb_phy_set_suspend(dwc->usb3_phy, 0);
1173+ ret = phy_power_on(dwc->usb2_generic_phy);
1174+ if (ret < 0)
1175+ return ret;
1176+
1177+ ret = phy_power_on(dwc->usb3_generic_phy);
1178+ if (ret < 0)
1179+ goto err_usb2phy_power;
1180+
11661181 usb_phy_init(dwc->usb3_phy);
11671182 usb_phy_init(dwc->usb2_phy);
11681183 ret = phy_init(dwc->usb2_generic_phy);
11691184 if (ret < 0)
1170− return ret;
1185+ goto err_usb3phy_power;
11711186
11721187 ret = phy_init(dwc->usb3_generic_phy);
11731188 if (ret < 0)
@@ -1200,6 +1215,12 @@ static int dwc3_resume(struct device *dev) · 26 unmodified lines
12001215 err_usb2phy_init:
12011216 phy_exit(dwc->usb2_generic_phy);
12021217
1218+err_usb3phy_power:
1219+ phy_power_off(dwc->usb3_generic_phy);
1220+
1221+err_usb2phy_power:
1222+ phy_power_off(dwc->usb2_generic_phy);
1223+
12031224 return ret;
12041225 }
12051226
drivers/usb/dwc3/debugfs.c+8−5
@@ -645,7 +645,7 @@ int dwc3_debugfs_init(struct dwc3 *dwc) · 644 unmodified lines
645645 file = debugfs_create_regset32("regdump", S_IRUGO, root, dwc->regset);
646646 if (!file) {
647647 ret = -ENOMEM;
648− goto err1;
648+ goto err2;
649649 }
650650
651651 if (IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)) {
@@ -653,7 +653,7 @@ int dwc3_debugfs_init(struct dwc3 *dwc) · 1 unmodified line
653653 dwc, &dwc3_mode_fops);
654654 if (!file) {
655655 ret = -ENOMEM;
656− goto err1;
656+ goto err2;
657657 }
658658 }
659659
@@ -663,19 +663,22 @@ int dwc3_debugfs_init(struct dwc3 *dwc) · 3 unmodified lines
663663 dwc, &dwc3_testmode_fops);
664664 if (!file) {
665665 ret = -ENOMEM;
666− goto err1;
666+ goto err2;
667667 }
668668
669669 file = debugfs_create_file("link_state", S_IRUGO | S_IWUSR, root,
670670 dwc, &dwc3_link_state_fops);
671671 if (!file) {
672672 ret = -ENOMEM;
673− goto err1;
673+ goto err2;
674674 }
675675 }
676676
677677 return 0;
678678
679+err2:
680+ kfree(dwc->regset);
681+
679682 err1:
680683 debugfs_remove_recursive(root);
681684
@@ -686,5 +689,5 @@ err0: · 4 unmodified lines
686689 void dwc3_debugfs_exit(struct dwc3 *dwc)
687690 {
688691 debugfs_remove_recursive(dwc->root);
689− dwc->root = NULL;
692+ kfree(dwc->regset);
690693 }
drivers/usb/dwc3/dwc3-omap.c+4−8
@@ -496,7 +496,7 @@ static int dwc3_omap_probe(struct platform_device *pdev) · 495 unmodified lines
496496 ret = pm_runtime_get_sync(dev);
497497 if (ret < 0) {
498498 dev_err(dev, "get_sync failed with err %d\n", ret);
499− goto err0;
499+ goto err1;
500500 }
501501
502502 dwc3_omap_map_offset(omap);
@@ -516,28 +516,24 @@ static int dwc3_omap_probe(struct platform_device *pdev) · 13 unmodified lines
516516
517517 ret = dwc3_omap_extcon_register(omap);
518518 if (ret < 0)
519− goto err2;
519+ goto err1;
520520
521521 ret = of_platform_populate(node, NULL, NULL, dev);
522522 if (ret) {
523523 dev_err(&pdev->dev, "failed to create dwc3 core\n");
524− goto err3;
524+ goto err2;
525525 }
526526
527527 dwc3_omap_enable_irqs(omap);
528528
529529 return 0;
530530
531−err3:
531+err2:
532532 extcon_unregister_notifier(omap->edev, EXTCON_USB, &omap->vbus_nb);
533533 extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, &omap->id_nb);
534−err2:
535− dwc3_omap_disable_irqs(omap);
536534
537535 err1:
538536 pm_runtime_put_sync(dev);
539−
540−err0:
541537 pm_runtime_disable(dev);
542538
543539 return ret;
drivers/usb/dwc3/gadget.c+6−0
@@ -2936,6 +2936,9 @@ void dwc3_gadget_exit(struct dwc3 *dwc) · 2935 unmodified lines
29362936
29372937 int dwc3_gadget_suspend(struct dwc3 *dwc)
29382938 {
2939+ if (!dwc->gadget_driver)
2940+ return 0;
2941+
29392942 if (dwc->pullups_connected) {
29402943 dwc3_gadget_disable_irq(dwc);
29412944 dwc3_gadget_run_stop(dwc, true, true);
@@ -2954,6 +2957,9 @@ int dwc3_gadget_resume(struct dwc3 *dwc) · 12 unmodified lines
29542957 struct dwc3_ep *dep;
29552958 int ret;
29562959
2960+ if (!dwc->gadget_driver)
2961+ return 0;
2962+
29572963 /* Start with SuperSpeed Default */
29582964 dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(512);
29592965
drivers/usb/gadget/composite.c+2−0
@@ -651,6 +651,8 @@ static int bos_desc(struct usb_composite_dev *cdev) · 650 unmodified lines
651651 ssp_cap->bLength = USB_DT_USB_SSP_CAP_SIZE(1);
652652 ssp_cap->bDescriptorType = USB_DT_DEVICE_CAPABILITY;
653653 ssp_cap->bDevCapabilityType = USB_SSP_CAP_TYPE;
654+ ssp_cap->bReserved = 0;
655+ ssp_cap->wReserved = 0;
654656
655657 /* SSAC = 1 (2 attributes) */
656658 ssp_cap->bmAttributes = cpu_to_le32(1);
drivers/usb/gadget/function/f_fs.c+2−3
@@ -646,6 +646,7 @@ static void ffs_user_copy_worker(struct work_struct *work) · 645 unmodified lines
646646 work);
647647 int ret = io_data->req->status ? io_data->req->status :
648648 io_data->req->actual;
649+ bool kiocb_has_eventfd = io_data->kiocb->ki_flags & IOCB_EVENTFD;
649650
650651 if (io_data->read && ret > 0) {
651652 use_mm(io_data->mm);
@@ -657,13 +658,11 @@ static void ffs_user_copy_worker(struct work_struct *work) · 5 unmodified lines
657658
658659 io_data->kiocb->ki_complete(io_data->kiocb, ret, ret);
659660
660− if (io_data->ffs->ffs_eventfd &&
661− !(io_data->kiocb->ki_flags & IOCB_EVENTFD))
661+ if (io_data->ffs->ffs_eventfd && !kiocb_has_eventfd)
662662 eventfd_signal(io_data->ffs->ffs_eventfd, 1);
663663
664664 usb_ep_free_request(io_data->ep, io_data->req);
665665
666− io_data->kiocb->private = NULL;
667666 if (io_data->read)
668667 kfree(io_data->to_free);
669668 kfree(io_data->buf);
fs/devpts/inode.c+12−41
@@ -604,8 +604,7 @@ void devpts_put_ref(struct pts_fs_info *fsi) · 603 unmodified lines
604604 *
605605 * The created inode is returned. Remove it from /dev/pts/ by devpts_pty_kill.
606606 */
607−struct inode *devpts_pty_new(struct pts_fs_info *fsi, dev_t device, int index,
608− void *priv)
607+struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv)
609608 {
610609 struct dentry *dentry;
611610 struct super_block *sb;
@@ -629,25 +628,21 @@ struct inode *devpts_pty_new(struct pts_fs_info *fsi, dev_t device, int index, · 17 unmodified lines
629628 inode->i_uid = opts->setuid ? opts->uid : current_fsuid();
630629 inode->i_gid = opts->setgid ? opts->gid : current_fsgid();
631630 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
632− init_special_inode(inode, S_IFCHR|opts->mode, device);
633− inode->i_private = priv;
631+ init_special_inode(inode, S_IFCHR|opts->mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index));
634632
635633 sprintf(s, "%d", index);
636634
637− inode_lock(d_inode(root));
638−
639635 dentry = d_alloc_name(root, s);
640636 if (dentry) {
637+ dentry->d_fsdata = priv;
641638 d_add(dentry, inode);
642639 fsnotify_create(d_inode(root), dentry);
643640 } else {
644641 iput(inode);
645− inode = ERR_PTR(-ENOMEM);
642+ dentry = ERR_PTR(-ENOMEM);
646643 }
647644
648− inode_unlock(d_inode(root));
649−
650− return inode;
645+ return dentry;
651646 }
652647
653648 /**
@@ -656,24 +651,10 @@ struct inode *devpts_pty_new(struct pts_fs_info *fsi, dev_t device, int index, · 2 unmodified lines
656651 *
657652 * Returns whatever was passed as priv in devpts_pty_new for a given inode.
658653 */
659−void *devpts_get_priv(struct inode *pts_inode)
654+void *devpts_get_priv(struct dentry *dentry)
660655 {
661− struct dentry *dentry;
662− void *priv = NULL;
663−
664− BUG_ON(pts_inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR));
665−
666− /* Ensure dentry has not been deleted by devpts_pty_kill() */
667− dentry = d_find_alias(pts_inode);
668− if (!dentry)
669− return NULL;
670−
671− if (pts_inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC)
672− priv = pts_inode->i_private;
673−
674− dput(dentry);
675−
676− return priv;
656+ WARN_ON_ONCE(dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC);
657+ return dentry->d_fsdata;
677658 }
678659
679660 /**
@@ -682,24 +663,14 @@ void *devpts_get_priv(struct inode *pts_inode) · 2 unmodified lines
682663 *
683664 * This is an inverse operation of devpts_pty_new.
684665 */
685−void devpts_pty_kill(struct inode *inode)
666+void devpts_pty_kill(struct dentry *dentry)
686667 {
687− struct super_block *sb = pts_sb_from_inode(inode);
688− struct dentry *root = sb->s_root;
689− struct dentry *dentry;
668+ WARN_ON_ONCE(dentry->d_sb->s_magic != DEVPTS_SUPER_MAGIC);
690669
691− BUG_ON(inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR));
692−
693− inode_lock(d_inode(root));
694−
695− dentry = d_find_alias(inode);
696−
697− drop_nlink(inode);
670+ dentry->d_fsdata = NULL;
671+ drop_nlink(dentry->d_inode);
698672 d_delete(dentry);
699673 dput(dentry); /* d_alloc_name() in devpts_pty_new() */
700− dput(dentry); /* d_find_alias above */
701−
702− inode_unlock(d_inode(root));
703674 }
704675
705676 static int __init init_devpts_fs(void)
include/asm-generic/futex.h+6−2
@@ -108,11 +108,15 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, · 107 unmodified lines
108108 u32 val;
109109
110110 preempt_disable();
111− if (unlikely(get_user(val, uaddr) != 0))
111+ if (unlikely(get_user(val, uaddr) != 0)) {
112+ preempt_enable();
112113 return -EFAULT;
114+ }
113115
114− if (val == oldval && unlikely(put_user(newval, uaddr) != 0))
116+ if (val == oldval && unlikely(put_user(newval, uaddr) != 0)) {
117+ preempt_enable();
115118 return -EFAULT;
119+ }
116120
117121 *uval = val;
118122 preempt_enable();
include/drm/drm_cache.h+2−0
@@ -39,6 +39,8 @@ static inline bool drm_arch_can_wc_memory(void) · 38 unmodified lines
3939 {
4040 #if defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE)
4141 return false;
42+#elif defined(CONFIG_MIPS) && defined(CONFIG_CPU_LOONGSON3)
43+ return false;
4244 #else
4345 return true;
4446 #endif
include/linux/devpts_fs.h+3−3
@@ -27,11 +27,11 @@ int devpts_new_index(struct pts_fs_info *); · 26 unmodified lines
2727 void devpts_kill_index(struct pts_fs_info *, int);
2828
2929 /* mknod in devpts */
30−struct inode *devpts_pty_new(struct pts_fs_info *, dev_t, int, void *);
30+struct dentry *devpts_pty_new(struct pts_fs_info *, int, void *);
3131 /* get private structure */
32−void *devpts_get_priv(struct inode *pts_inode);
32+void *devpts_get_priv(struct dentry *);
3333 /* unlink */
34−void devpts_pty_kill(struct inode *inode);
34+void devpts_pty_kill(struct dentry *);
3535
3636 #endif
3737
include/linux/mlx5/driver.h+4−3
@@ -526,8 +526,9 @@ enum mlx5_device_state { · 525 unmodified lines
526526 };
527527
528528 enum mlx5_interface_state {
529− MLX5_INTERFACE_STATE_DOWN,
530− MLX5_INTERFACE_STATE_UP,
529+ MLX5_INTERFACE_STATE_DOWN = BIT(0),
530+ MLX5_INTERFACE_STATE_UP = BIT(1),
531+ MLX5_INTERFACE_STATE_SHUTDOWN = BIT(2),
531532 };
532533
533534 enum mlx5_pci_status {
@@ -551,7 +552,7 @@ struct mlx5_core_dev { · 17 unmodified lines
551552 enum mlx5_device_state state;
552553 /* sync interface state */
553554 struct mutex intf_state_mutex;
554− enum mlx5_interface_state interface_state;
555+ unsigned long intf_state;
555556 void (*event) (struct mlx5_core_dev *dev,
556557 enum mlx5_dev_event event,
557558 unsigned long param);
include/linux/mlx5/port.h+3−3
@@ -73,9 +73,9 @@ int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, · 72 unmodified lines
7373 enum mlx5_port_status *status);
7474 int mlx5_set_port_beacon(struct mlx5_core_dev *dev, u16 beacon_duration);
7575
76−int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port);
77−void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu, u8 port);
78−void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu,
76+int mlx5_set_port_mtu(struct mlx5_core_dev *dev, u16 mtu, u8 port);
77+void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, u16 *max_mtu, u8 port);
78+void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, u16 *oper_mtu,
7979 u8 port);
8080
8181 int mlx5_query_port_vl_hw_cap(struct mlx5_core_dev *dev,
include/linux/mlx5/vport.h+2−0
@@ -45,6 +45,8 @@ int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, · 44 unmodified lines
4545 u16 vport, u8 *addr);
4646 int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev,
4747 u16 vport, u8 *addr);
48+int mlx5_query_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 *mtu);
49+int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu);
4850 int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev,
4951 u64 *system_image_guid);
5052 int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid);
include/linux/thermal.h+2−2
@@ -352,8 +352,8 @@ struct thermal_zone_of_device_ops { · 351 unmodified lines
352352
353353 struct thermal_trip {
354354 struct device_node *np;
355− unsigned long int temperature;
356− unsigned long int hysteresis;
355+ int temperature;
356+ int hysteresis;
357357 enum thermal_trip_type type;
358358 };
359359
include/linux/tty_driver.h+2−2
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 * defined; unless noted otherwise, they are optional, and can be
88 * filled in with a null pointer.
99 *
10− * struct tty_struct * (*lookup)(struct tty_driver *self, int idx)
10+ * struct tty_struct * (*lookup)(struct tty_driver *self, struct file *, int idx)
1111 *
1212 * Return the tty device corresponding to idx, NULL if there is not
1313 * one currently in use and an ERR_PTR value on error. Called under
@@ -250,7 +250,7 @@ struct serial_icounter_struct; · 236 unmodified lines
250250
251251 struct tty_operations {
252252 struct tty_struct * (*lookup)(struct tty_driver *driver,
253− struct inode *inode, int idx);
253+ struct file *filp, int idx);
254254 int (*install)(struct tty_driver *driver, struct tty_struct *tty);
255255 void (*remove)(struct tty_driver *driver, struct tty_struct *tty);
256256 int (*open)(struct tty_struct * tty, struct file * filp);
include/net/switchdev.h+4−0
@@ -54,6 +54,8 @@ struct switchdev_attr { · 53 unmodified lines
5454 struct net_device *orig_dev;
5555 enum switchdev_attr_id id;
5656 u32 flags;
57+ void *complete_priv;
58+ void (*complete)(struct net_device *dev, int err, void *priv);
5759 union {
5860 struct netdev_phys_item_id ppid; /* PORT_PARENT_ID */
5961 u8 stp_state; /* PORT_STP_STATE */
@@ -75,6 +77,8 @@ struct switchdev_obj { · 15 unmodified lines
7577 struct net_device *orig_dev;
7678 enum switchdev_obj_id id;
7779 u32 flags;
80+ void *complete_priv;
81+ void (*complete)(struct net_device *dev, int err, void *priv);
7882 };
7983
8084 /* SWITCHDEV_OBJ_ID_PORT_VLAN */
include/sound/hda_regmap.h+2−0
@@ -17,6 +17,8 @@ int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec, · 16 unmodified lines
1717 unsigned int verb);
1818 int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg,
1919 unsigned int *val);
20+int snd_hdac_regmap_read_raw_uncached(struct hdac_device *codec,
21+ unsigned int reg, unsigned int *val);
2022 int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg,
2123 unsigned int val);
2224 int snd_hdac_regmap_update_raw(struct hdac_device *codec, unsigned int reg,
include/uapi/asm-generic/unistd.h+5−1
@@ -717,9 +717,13 @@ __SYSCALL(__NR_membarrier, sys_membarrier) · 716 unmodified lines
717717 __SYSCALL(__NR_mlock2, sys_mlock2)
718718 #define __NR_copy_file_range 285
719719 __SYSCALL(__NR_copy_file_range, sys_copy_file_range)
720+#define __NR_preadv2 286
721+__SYSCALL(__NR_preadv2, sys_preadv2)
722+#define __NR_pwritev2 287
723+__SYSCALL(__NR_pwritev2, sys_pwritev2)
720724
721725 #undef __NR_syscalls
722−#define __NR_syscalls 286
726+#define __NR_syscalls 288
723727
724728 /*
725729 * All syscalls below here should go away really,
include/uapi/linux/if_macsec.h+2−2
@@ -19,8 +19,8 @@ · 18 unmodified lines
1919
2020 #define MACSEC_MAX_KEY_LEN 128
2121
22−#define DEFAULT_CIPHER_ID 0x0080020001000001ULL
23−#define DEFAULT_CIPHER_ALT 0x0080C20001000001ULL
22+#define MACSEC_DEFAULT_CIPHER_ID 0x0080020001000001ULL
23+#define MACSEC_DEFAULT_CIPHER_ALT 0x0080C20001000001ULL
2424
2525 #define MACSEC_MIN_ICV_LEN 8
2626 #define MACSEC_MAX_ICV_LEN 32
kernel/bpf/verifier.c+0−1
@@ -2092,7 +2092,6 @@ static int replace_map_fd_with_map_ptr(struct verifier_env *env) · 2091 unmodified lines
20922092 if (IS_ERR(map)) {
20932093 verbose("fd %d is not pointing to valid bpf_map\n",
20942094 insn->imm);
2095− fdput(f);
20962095 return PTR_ERR(map);
20972096 }
20982097
kernel/cpu.c+26−7
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 * @target: The target state
3737 * @thread: Pointer to the hotplug thread
3838 * @should_run: Thread should execute
39+ * @rollback: Perform a rollback
3940 * @cb_stat: The state for a single callback (install/uninstall)
4041 * @cb: Single callback function (install/uninstall)
4142 * @result: Result of the operation
@@ -47,6 +48,7 @@ struct cpuhp_cpu_state { · 5 unmodified lines
4748 #ifdef CONFIG_SMP
4849 struct task_struct *thread;
4950 bool should_run;
51+ bool rollback;
5052 enum cpuhp_state cb_state;
5153 int (*cb)(unsigned int cpu);
5254 int result;
@@ -301,6 +303,11 @@ static int cpu_notify(unsigned long val, unsigned int cpu) · 248 unmodified lines
301303 return __cpu_notify(val, cpu, -1, NULL);
302304 }
303305
306+static void cpu_notify_nofail(unsigned long val, unsigned int cpu)
307+{
308+ BUG_ON(cpu_notify(val, cpu));
309+}
310+
304311 /* Notifier wrappers for transitioning to state machine */
305312 static int notify_prepare(unsigned int cpu)
306313 {
@@ -477,6 +484,16 @@ static void cpuhp_thread_fun(unsigned int cpu) · 170 unmodified lines
477484 } else {
478485 ret = cpuhp_invoke_callback(cpu, st->cb_state, st->cb);
479486 }
487+ } else if (st->rollback) {
488+ BUG_ON(st->state < CPUHP_AP_ONLINE_IDLE);
489+
490+ undo_cpu_down(cpu, st, cpuhp_ap_states);
491+ /*
492+ * This is a momentary workaround to keep the notifier users
493+ * happy. Will go away once we got rid of the notifiers.
494+ */
495+ cpu_notify_nofail(CPU_DOWN_FAILED, cpu);
496+ st->rollback = false;
480497 } else {
481498 /* Cannot happen .... */
482499 BUG_ON(st->state < CPUHP_AP_ONLINE_IDLE);
@@ -636,11 +653,6 @@ static inline void check_for_tasks(int dead_cpu) · 153 unmodified lines
636653 read_unlock(&tasklist_lock);
637654 }
638655
639−static void cpu_notify_nofail(unsigned long val, unsigned int cpu)
640−{
641− BUG_ON(cpu_notify(val, cpu));
642−}
643−
644656 static int notify_down_prepare(unsigned int cpu)
645657 {
646658 int err, nr_calls = 0;
@@ -721,9 +733,10 @@ static int takedown_cpu(unsigned int cpu) · 74 unmodified lines
721733 */
722734 err = stop_machine(take_cpu_down, NULL, cpumask_of(cpu));
723735 if (err) {
724− /* CPU didn't die: tell everyone. Can't complain. */
725− cpu_notify_nofail(CPU_DOWN_FAILED, cpu);
736+ /* CPU refused to die */
726737 irq_unlock_sparse();
738+ /* Unpark the hotplug thread so we can rollback there */
739+ kthread_unpark(per_cpu_ptr(&cpuhp_state, cpu)->thread);
727740 return err;
728741 }
729742 BUG_ON(cpu_online(cpu));
@@ -832,6 +845,11 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen, · 102 unmodified lines
832845 * to do the further cleanups.
833846 */
834847 ret = cpuhp_down_callbacks(cpu, st, cpuhp_bp_states, target);
848+ if (ret && st->state > CPUHP_TEARDOWN_CPU && st->state < prev_state) {
849+ st->target = prev_state;
850+ st->rollback = true;
851+ cpuhp_kick_ap_work(cpu);
852+ }
835853
836854 hasdied = prev_state != st->state && st->state == CPUHP_OFFLINE;
837855 out:
@@ -1249,6 +1267,7 @@ static struct cpuhp_step cpuhp_ap_states[] = { · 411 unmodified lines
12491267 .name = "notify:online",
12501268 .startup = notify_online,
12511269 .teardown = notify_down_prepare,
1270+ .skip_onerr = true,
12521271 },
12531272 #endif
12541273 /*
kernel/futex.c+23−4
@@ -1295,10 +1295,20 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this, · 1294 unmodified lines
12951295 if (unlikely(should_fail_futex(true)))
12961296 ret = -EFAULT;
12971297
1298− if (cmpxchg_futex_value_locked(&curval, uaddr, uval, newval))
1298+ if (cmpxchg_futex_value_locked(&curval, uaddr, uval, newval)) {
12991299 ret = -EFAULT;
1300− else if (curval != uval)
1301− ret = -EINVAL;
1300+ } else if (curval != uval) {
1301+ /*
1302+ * If a unconditional UNLOCK_PI operation (user space did not
1303+ * try the TID->0 transition) raced with a waiter setting the
1304+ * FUTEX_WAITERS flag between get_user() and locking the hash
1305+ * bucket lock, retry the operation.
1306+ */
1307+ if ((FUTEX_TID_MASK & curval) == uval)
1308+ ret = -EAGAIN;
1309+ else
1310+ ret = -EINVAL;
1311+ }
13021312 if (ret) {
13031313 raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock);
13041314 return ret;
@@ -1525,8 +1535,8 @@ void requeue_futex(struct futex_q *q, struct futex_hash_bucket *hb1, · 220 unmodified lines
15251535 if (likely(&hb1->chain != &hb2->chain)) {
15261536 plist_del(&q->list, &hb1->chain);
15271537 hb_waiters_dec(hb1);
1528− plist_add(&q->list, &hb2->chain);
15291538 hb_waiters_inc(hb2);
1539+ plist_add(&q->list, &hb2->chain);
15301540 q->lock_ptr = &hb2->lock;
15311541 }
15321542 get_futex_key_refs(key2);
@@ -2622,6 +2632,15 @@ retry: · 1089 unmodified lines
26222632 */
26232633 if (ret == -EFAULT)
26242634 goto pi_faulted;
2635+ /*
2636+ * A unconditional UNLOCK_PI op raced against a waiter
2637+ * setting the FUTEX_WAITERS bit. Try again.
2638+ */
2639+ if (ret == -EAGAIN) {
2640+ spin_unlock(&hb->lock);
2641+ put_futex_key(&key);
2642+ goto retry;
2643+ }
26252644 /*
26262645 * wake_futex_pi has detected invalid state. Tell user
26272646 * space.
kernel/irq/ipi.c+1−0
@@ -94,6 +94,7 @@ unsigned int irq_reserve_ipi(struct irq_domain *domain, · 93 unmodified lines
9494 data = irq_get_irq_data(virq + i);
9595 cpumask_copy(data->common->affinity, dest);
9696 data->common->ipi_offset = offset;
97+ irq_set_status_flags(virq + i, IRQ_NO_BALANCING);
9798 }
9899 return virq;
99100
kernel/locking/qspinlock_stat.h+5−3
@@ -136,10 +136,12 @@ static ssize_t qstat_read(struct file *file, char __user *user_buf, · 135 unmodified lines
136136 }
137137
138138 if (counter == qstat_pv_hash_hops) {
139− u64 frac;
139+ u64 frac = 0;
140140
141− frac = 100ULL * do_div(stat, kicks);
142− frac = DIV_ROUND_CLOSEST_ULL(frac, kicks);
141+ if (kicks) {
142+ frac = 100ULL * do_div(stat, kicks);
143+ frac = DIV_ROUND_CLOSEST_ULL(frac, kicks);
144+ }
143145
144146 /*
145147 * Return a X.XX decimal number
net/bridge/br_mdb.c+79−45
@@ -61,6 +61,19 @@ static void __mdb_entry_fill_flags(struct br_mdb_entry *e, unsigned char flags) · 60 unmodified lines
6161 e->flags |= MDB_FLAGS_OFFLOAD;
6262 }
6363
64+static void __mdb_entry_to_br_ip(struct br_mdb_entry *entry, struct br_ip *ip)
65+{
66+ memset(ip, 0, sizeof(struct br_ip));
67+ ip->vid = entry->vid;
68+ ip->proto = entry->addr.proto;
69+ if (ip->proto == htons(ETH_P_IP))
70+ ip->u.ip4 = entry->addr.u.ip4;
71+#if IS_ENABLED(CONFIG_IPV6)
72+ else
73+ ip->u.ip6 = entry->addr.u.ip6;
74+#endif
75+}
76+
6477 static int br_mdb_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
6578 struct net_device *dev)
6679 {
@@ -243,9 +256,45 @@ static inline size_t rtnl_mdb_nlmsg_size(void) · 176 unmodified lines
243256 + nla_total_size(sizeof(struct br_mdb_entry));
244257 }
245258
246−static void __br_mdb_notify(struct net_device *dev, struct br_mdb_entry *entry,
247− int type, struct net_bridge_port_group *pg)
259+struct br_mdb_complete_info {
260+ struct net_bridge_port *port;
261+ struct br_ip ip;
262+};
263+
264+static void br_mdb_complete(struct net_device *dev, int err, void *priv)
248265 {
266+ struct br_mdb_complete_info *data = priv;
267+ struct net_bridge_port_group __rcu **pp;
268+ struct net_bridge_port_group *p;
269+ struct net_bridge_mdb_htable *mdb;
270+ struct net_bridge_mdb_entry *mp;
271+ struct net_bridge_port *port = data->port;
272+ struct net_bridge *br = port->br;
273+
274+ if (err)
275+ goto err;
276+
277+ spin_lock_bh(&br->multicast_lock);
278+ mdb = mlock_dereference(br->mdb, br);
279+ mp = br_mdb_ip_get(mdb, &data->ip);
280+ if (!mp)
281+ goto out;
282+ for (pp = &mp->ports; (p = mlock_dereference(*pp, br)) != NULL;
283+ pp = &p->next) {
284+ if (p->port != port)
285+ continue;
286+ p->flags |= MDB_PG_FLAGS_OFFLOAD;
287+ }
288+out:
289+ spin_unlock_bh(&br->multicast_lock);
290+err:
291+ kfree(priv);
292+}
293+
294+static void __br_mdb_notify(struct net_device *dev, struct net_bridge_port *p,
295+ struct br_mdb_entry *entry, int type)
296+{
297+ struct br_mdb_complete_info *complete_info;
249298 struct switchdev_obj_port_mdb mdb = {
250299 .obj = {
251300 .id = SWITCHDEV_OBJ_ID_PORT_MDB,
@@ -268,9 +317,14 @@ static void __br_mdb_notify(struct net_device *dev, struct br_mdb_entry *entry, · 16 unmodified lines
268317
269318 mdb.obj.orig_dev = port_dev;
270319 if (port_dev && type == RTM_NEWMDB) {
271− err = switchdev_port_obj_add(port_dev, &mdb.obj);
272− if (!err && pg)
273− pg->flags |= MDB_PG_FLAGS_OFFLOAD;
320+ complete_info = kmalloc(sizeof(*complete_info), GFP_ATOMIC);
321+ if (complete_info) {
322+ complete_info->port = p;
323+ __mdb_entry_to_br_ip(entry, &complete_info->ip);
324+ mdb.obj.complete_priv = complete_info;
325+ mdb.obj.complete = br_mdb_complete;
326+ switchdev_port_obj_add(port_dev, &mdb.obj);
327+ }
274328 } else if (port_dev && type == RTM_DELMDB) {
275329 switchdev_port_obj_del(port_dev, &mdb.obj);
276330 }
@@ -291,21 +345,21 @@ errout: · 14 unmodified lines
291345 rtnl_set_sk_err(net, RTNLGRP_MDB, err);
292346 }
293347
294−void br_mdb_notify(struct net_device *dev, struct net_bridge_port_group *pg,
295− int type)
348+void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
349+ struct br_ip *group, int type, u8 flags)
296350 {
297351 struct br_mdb_entry entry;
298352
299353 memset(&entry, 0, sizeof(entry));
300− entry.ifindex = pg->port->dev->ifindex;
301− entry.addr.proto = pg->addr.proto;
302− entry.addr.u.ip4 = pg->addr.u.ip4;
354+ entry.ifindex = port->dev->ifindex;
355+ entry.addr.proto = group->proto;
356+ entry.addr.u.ip4 = group->u.ip4;
303357 #if IS_ENABLED(CONFIG_IPV6)
304− entry.addr.u.ip6 = pg->addr.u.ip6;
358+ entry.addr.u.ip6 = group->u.ip6;
305359 #endif
306− entry.vid = pg->addr.vid;
307− __mdb_entry_fill_flags(&entry, pg->flags);
308− __br_mdb_notify(dev, &entry, type, pg);
360+ entry.vid = group->vid;
361+ __mdb_entry_fill_flags(&entry, flags);
362+ __br_mdb_notify(dev, port, &entry, type);
309363 }
310364
311365 static int nlmsg_populate_rtr_fill(struct sk_buff *skb,
@@ -450,8 +504,7 @@ static int br_mdb_parse(struct sk_buff *skb, struct nlmsghdr *nlh, · 138 unmodified lines
450504 }
451505
452506 static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
453− struct br_ip *group, unsigned char state,
454− struct net_bridge_port_group **pg)
507+ struct br_ip *group, unsigned char state)
455508 {
456509 struct net_bridge_mdb_entry *mp;
457510 struct net_bridge_port_group *p;
@@ -482,7 +535,6 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, · 24 unmodified lines
482535 if (unlikely(!p))
483536 return -ENOMEM;
484537 rcu_assign_pointer(*pp, p);
485− *pg = p;
486538 if (state == MDB_TEMPORARY)
487539 mod_timer(&p->timer, now + br->multicast_membership_interval);
488540
@@ -490,8 +542,7 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port, · 1 unmodified line
490542 }
491543
492544 static int __br_mdb_add(struct net *net, struct net_bridge *br,
493− struct br_mdb_entry *entry,
494− struct net_bridge_port_group **pg)
545+ struct br_mdb_entry *entry)
495546 {
496547 struct br_ip ip;
497548 struct net_device *dev;
@@ -509,18 +560,10 @@ static int __br_mdb_add(struct net *net, struct net_bridge *br, · 11 unmodified lines
509560 if (!p || p->br != br || p->state == BR_STATE_DISABLED)
510561 return -EINVAL;
511562
512− memset(&ip, 0, sizeof(ip));
513− ip.vid = entry->vid;
514− ip.proto = entry->addr.proto;
515− if (ip.proto == htons(ETH_P_IP))
516− ip.u.ip4 = entry->addr.u.ip4;
517−#if IS_ENABLED(CONFIG_IPV6)
518− else
519− ip.u.ip6 = entry->addr.u.ip6;
520−#endif
563+ __mdb_entry_to_br_ip(entry, &ip);
521564
522565 spin_lock_bh(&br->multicast_lock);
523− ret = br_mdb_add_group(br, p, &ip, entry->state, pg);
566+ ret = br_mdb_add_group(br, p, &ip, entry->state);
524567 spin_unlock_bh(&br->multicast_lock);
525568 return ret;
526569 }
@@ -528,7 +571,6 @@ static int __br_mdb_add(struct net *net, struct net_bridge *br, · 1 unmodified line
528571 static int br_mdb_add(struct sk_buff *skb, struct nlmsghdr *nlh)
529572 {
530573 struct net *net = sock_net(skb->sk);
531− struct net_bridge_port_group *pg;
532574 struct net_bridge_vlan_group *vg;
533575 struct net_device *dev, *pdev;
534576 struct br_mdb_entry *entry;
@@ -558,15 +600,15 @@ static int br_mdb_add(struct sk_buff *skb, struct nlmsghdr *nlh) · 23 unmodified lines
558600 if (br_vlan_enabled(br) && vg && entry->vid == 0) {
559601 list_for_each_entry(v, &vg->vlan_list, vlist) {
560602 entry->vid = v->vid;
561− err = __br_mdb_add(net, br, entry, &pg);
603+ err = __br_mdb_add(net, br, entry);
562604 if (err)
563605 break;
564− __br_mdb_notify(dev, entry, RTM_NEWMDB, pg);
606+ __br_mdb_notify(dev, p, entry, RTM_NEWMDB);
565607 }
566608 } else {
567− err = __br_mdb_add(net, br, entry, &pg);
609+ err = __br_mdb_add(net, br, entry);
568610 if (!err)
569− __br_mdb_notify(dev, entry, RTM_NEWMDB, pg);
611+ __br_mdb_notify(dev, p, entry, RTM_NEWMDB);
570612 }
571613
572614 return err;
@@ -584,15 +626,7 @@ static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry) · 11 unmodified lines
584626 if (!netif_running(br->dev) || br->multicast_disabled)
585627 return -EINVAL;
586628
587− memset(&ip, 0, sizeof(ip));
588− ip.vid = entry->vid;
589− ip.proto = entry->addr.proto;
590− if (ip.proto == htons(ETH_P_IP))
591− ip.u.ip4 = entry->addr.u.ip4;
592−#if IS_ENABLED(CONFIG_IPV6)
593− else
594− ip.u.ip6 = entry->addr.u.ip6;
595−#endif
629+ __mdb_entry_to_br_ip(entry, &ip);
596630
597631 spin_lock_bh(&br->multicast_lock);
598632 mdb = mlock_dereference(br->mdb, br);
@@ -662,12 +696,12 @@ static int br_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh) · 63 unmodified lines
662696 entry->vid = v->vid;
663697 err = __br_mdb_del(br, entry);
664698 if (!err)
665− __br_mdb_notify(dev, entry, RTM_DELMDB, NULL);
699+ __br_mdb_notify(dev, p, entry, RTM_DELMDB);
666700 }
667701 } else {
668702 err = __br_mdb_del(br, entry);
669703 if (!err)
670− __br_mdb_notify(dev, entry, RTM_DELMDB, NULL);
704+ __br_mdb_notify(dev, p, entry, RTM_DELMDB);
671705 }
672706
673707 return err;
net/bridge/br_multicast.c+5−3
@@ -283,7 +283,8 @@ static void br_multicast_del_pg(struct net_bridge *br, · 282 unmodified lines
283283 rcu_assign_pointer(*pp, p->next);
284284 hlist_del_init(&p->mglist);
285285 del_timer(&p->timer);
286− br_mdb_notify(br->dev, p, RTM_DELMDB);
286+ br_mdb_notify(br->dev, p->port, &pg->addr, RTM_DELMDB,
287+ p->flags);
287288 call_rcu_bh(&p->rcu, br_multicast_free_pg);
288289
289290 if (!mp->ports && !mp->mglist &&
@@ -705,7 +706,7 @@ static int br_multicast_add_group(struct net_bridge *br, · 415 unmodified lines
705706 if (unlikely(!p))
706707 goto err;
707708 rcu_assign_pointer(*pp, p);
708− br_mdb_notify(br->dev, p, RTM_NEWMDB);
709+ br_mdb_notify(br->dev, port, group, RTM_NEWMDB, 0);
709710
710711 found:
711712 mod_timer(&p->timer, now + br->multicast_membership_interval);
@@ -1461,7 +1462,8 @@ br_multicast_leave_group(struct net_bridge *br, · 749 unmodified lines
14611462 hlist_del_init(&p->mglist);
14621463 del_timer(&p->timer);
14631464 call_rcu_bh(&p->rcu, br_multicast_free_pg);
1464− br_mdb_notify(br->dev, p, RTM_DELMDB);
1465+ br_mdb_notify(br->dev, port, group, RTM_DELMDB,
1466+ p->flags);
14651467
14661468 if (!mp->ports && !mp->mglist &&
14671469 netif_running(br->dev))
net/bridge/br_private.h+2−2
@@ -560,8 +560,8 @@ br_multicast_new_port_group(struct net_bridge_port *port, struct br_ip *group, · 559 unmodified lines
560560 unsigned char flags);
561561 void br_mdb_init(void);
562562 void br_mdb_uninit(void);
563−void br_mdb_notify(struct net_device *dev, struct net_bridge_port_group *pg,
564− int type);
563+void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
564+ struct br_ip *group, int type, u8 flags);
565565 void br_rtr_notify(struct net_device *dev, struct net_bridge_port *port,
566566 int type);
567567
net/ipv4/fib_frontend.c+5−1
@@ -904,7 +904,11 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim) · 903 unmodified lines
904904 if (ifa->ifa_flags & IFA_F_SECONDARY) {
905905 prim = inet_ifa_byprefix(in_dev, any, ifa->ifa_mask);
906906 if (!prim) {
907− pr_warn("%s: bug: prim == NULL\n", __func__);
907+ /* if the device has been deleted, we don't perform
908+ * address promotion
909+ */
910+ if (!in_dev->dead)
911+ pr_warn("%s: bug: prim == NULL\n", __func__);
908912 return;
909913 }
910914 if (iprim && iprim != prim) {
net/ipv6/addrconf.c+15−33
@@ -3175,35 +3175,9 @@ static void addrconf_gre_config(struct net_device *dev) · 3174 unmodified lines
31753175 }
31763176 #endif
31773177
3178−#if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV)
3179−/* If the host route is cached on the addr struct make sure it is associated
3180− * with the proper table. e.g., enslavement can change and if so the cached
3181− * host route needs to move to the new table.
3182− */
3183−static void l3mdev_check_host_rt(struct inet6_dev *idev,
3184− struct inet6_ifaddr *ifp)
3185−{
3186− if (ifp->rt) {
3187− u32 tb_id = l3mdev_fib_table(idev->dev) ? : RT6_TABLE_LOCAL;
3188−
3189− if (tb_id != ifp->rt->rt6i_table->tb6_id) {
3190− ip6_del_rt(ifp->rt);
3191− ifp->rt = NULL;
3192− }
3193− }
3194−}
3195−#else
3196−static void l3mdev_check_host_rt(struct inet6_dev *idev,
3197− struct inet6_ifaddr *ifp)
3198−{
3199−}
3200−#endif
3201−
32023178 static int fixup_permanent_addr(struct inet6_dev *idev,
32033179 struct inet6_ifaddr *ifp)
32043180 {
3205− l3mdev_check_host_rt(idev, ifp);
3206−
32073181 if (!ifp->rt) {
32083182 struct rt6_info *rt;
32093183
@@ -3303,6 +3277,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, · 93 unmodified lines
33033277 break;
33043278
33053279 if (event == NETDEV_UP) {
3280+ /* restore routes for permanent addresses */
3281+ addrconf_permanent_addr(dev);
3282+
33063283 if (!addrconf_qdisc_ok(dev)) {
33073284 /* device is not ready yet. */
33083285 pr_info("ADDRCONF(NETDEV_UP): %s: link is not ready\n",
@@ -3336,9 +3313,6 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, · 27 unmodified lines
33363313 run_pending = 1;
33373314 }
33383315
3339− /* restore routes for permanent addresses */
3340− addrconf_permanent_addr(dev);
3341−
33423316 switch (dev->type) {
33433317 #if IS_ENABLED(CONFIG_IPV6_SIT)
33443318 case ARPHRD_SIT:
@@ -3555,6 +3529,8 @@ restart: · 210 unmodified lines
35553529
35563530 INIT_LIST_HEAD(&del_list);
35573531 list_for_each_entry_safe(ifa, tmp, &idev->addr_list, if_list) {
3532+ struct rt6_info *rt = NULL;
3533+
35583534 addrconf_del_dad_work(ifa);
35593535
35603536 write_unlock_bh(&idev->lock);
@@ -3567,6 +3543,9 @@ restart: · 6 unmodified lines
35673543 ifa->state = 0;
35683544 if (!(ifa->flags & IFA_F_NODAD))
35693545 ifa->flags |= IFA_F_TENTATIVE;
3546+
3547+ rt = ifa->rt;
3548+ ifa->rt = NULL;
35703549 } else {
35713550 state = ifa->state;
35723551 ifa->state = INET6_IFADDR_STATE_DEAD;
@@ -3577,6 +3556,9 @@ restart: · 4 unmodified lines
35773556
35783557 spin_unlock_bh(&ifa->lock);
35793558
3559+ if (rt)
3560+ ip6_del_rt(rt);
3561+
35803562 if (state != INET6_IFADDR_STATE_DEAD) {
35813563 __ipv6_ifa_notify(RTM_DELADDR, ifa);
35823564 inet6addr_notifier_call_chain(NETDEV_DOWN, ifa);
@@ -5344,10 +5326,10 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) · 1761 unmodified lines
53445326 if (rt)
53455327 ip6_del_rt(rt);
53465328 }
5347− dst_hold(&ifp->rt->dst);
5348−
5349− ip6_del_rt(ifp->rt);
5350−
5329+ if (ifp->rt) {
5330+ dst_hold(&ifp->rt->dst);
5331+ ip6_del_rt(ifp->rt);
5332+ }
53515333 rt_genid_bump_ipv6(net);
53525334 break;
53535335 }
net/switchdev/switchdev.c+6−0
@@ -305,6 +305,8 @@ static void switchdev_port_attr_set_deferred(struct net_device *dev, · 304 unmodified lines
305305 if (err && err != -EOPNOTSUPP)
306306 netdev_err(dev, "failed (err=%d) to set attribute (id=%d)\n",
307307 err, attr->id);
308+ if (attr->complete)
309+ attr->complete(dev, err, attr->complete_priv);
308310 }
309311
310312 static int switchdev_port_attr_set_defer(struct net_device *dev,
@@ -434,6 +436,8 @@ static void switchdev_port_obj_add_deferred(struct net_device *dev, · 123 unmodified lines
434436 if (err && err != -EOPNOTSUPP)
435437 netdev_err(dev, "failed (err=%d) to add object (id=%d)\n",
436438 err, obj->id);
439+ if (obj->complete)
440+ obj->complete(dev, err, obj->complete_priv);
437441 }
438442
439443 static int switchdev_port_obj_add_defer(struct net_device *dev,
@@ -502,6 +506,8 @@ static void switchdev_port_obj_del_deferred(struct net_device *dev, · 62 unmodified lines
502506 if (err && err != -EOPNOTSUPP)
503507 netdev_err(dev, "failed (err=%d) to del object (id=%d)\n",
504508 err, obj->id);
509+ if (obj->complete)
510+ obj->complete(dev, err, obj->complete_priv);
505511 }
506512
507513 static int switchdev_port_obj_del_defer(struct net_device *dev,
sound/hda/hdac_device.c+4−6
@@ -299,13 +299,11 @@ EXPORT_SYMBOL_GPL(_snd_hdac_read_parm); · 298 unmodified lines
299299 int snd_hdac_read_parm_uncached(struct hdac_device *codec, hda_nid_t nid,
300300 int parm)
301301 {
302− int val;
302+ unsigned int cmd, val;
303303
304− if (codec->regmap)
305− regcache_cache_bypass(codec->regmap, true);
306− val = snd_hdac_read_parm(codec, nid, parm);
307− if (codec->regmap)
308− regcache_cache_bypass(codec->regmap, false);
304+ cmd = snd_hdac_regmap_encode_verb(nid, AC_VERB_PARAMETERS) | parm;
305+ if (snd_hdac_regmap_read_raw_uncached(codec, cmd, &val) < 0)
306+ return -1;
309307 return val;
310308 }
311309 EXPORT_SYMBOL_GPL(snd_hdac_read_parm_uncached);
sound/hda/hdac_regmap.c+28−12
@@ -453,14 +453,30 @@ int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg, · 452 unmodified lines
453453 EXPORT_SYMBOL_GPL(snd_hdac_regmap_write_raw);
454454
455455 static int reg_raw_read(struct hdac_device *codec, unsigned int reg,
456− unsigned int *val)
456+ unsigned int *val, bool uncached)
457457 {
458− if (!codec->regmap)
458+ if (uncached || !codec->regmap)
459459 return hda_reg_read(codec, reg, val);
460460 else
461461 return regmap_read(codec->regmap, reg, val);
462462 }
463463
464+static int __snd_hdac_regmap_read_raw(struct hdac_device *codec,
465+ unsigned int reg, unsigned int *val,
466+ bool uncached)
467+{
468+ int err;
469+
470+ err = reg_raw_read(codec, reg, val, uncached);
471+ if (err == -EAGAIN) {
472+ err = snd_hdac_power_up_pm(codec);
473+ if (!err)
474+ err = reg_raw_read(codec, reg, val, uncached);
475+ snd_hdac_power_down_pm(codec);
476+ }
477+ return err;
478+}
479+
464480 /**
465481 * snd_hdac_regmap_read_raw - read a pseudo register with power mgmt
466482 * @codec: the codec object
@@ -472,19 +488,19 @@ static int reg_raw_read(struct hdac_device *codec, unsigned int reg, · 5 unmodified lines
472488 int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg,
473489 unsigned int *val)
474490 {
475− int err;
476−
477− err = reg_raw_read(codec, reg, val);
478− if (err == -EAGAIN) {
479− err = snd_hdac_power_up_pm(codec);
480− if (!err)
481− err = reg_raw_read(codec, reg, val);
482− snd_hdac_power_down_pm(codec);
483− }
484− return err;
491+ return __snd_hdac_regmap_read_raw(codec, reg, val, false);
485492 }
486493 EXPORT_SYMBOL_GPL(snd_hdac_regmap_read_raw);
487494
495+/* Works like snd_hdac_regmap_read_raw(), but this doesn't read from the
496+ * cache but always via hda verbs.
497+ */
498+int snd_hdac_regmap_read_raw_uncached(struct hdac_device *codec,
499+ unsigned int reg, unsigned int *val)
500+{
501+ return __snd_hdac_regmap_read_raw(codec, reg, val, true);
502+}
503+
488504 /**
489505 * snd_hdac_regmap_update_raw - update a pseudo register with power mgmt
490506 * @codec: the codec object
sound/pci/hda/hda_generic.c+4−2
@@ -826,7 +826,7 @@ static hda_nid_t path_power_update(struct hda_codec *codec, · 825 unmodified lines
826826 bool allow_powerdown)
827827 {
828828 hda_nid_t nid, changed = 0;
829− int i, state;
829+ int i, state, power;
830830
831831 for (i = 0; i < path->depth; i++) {
832832 nid = path->path[i];
@@ -838,7 +838,9 @@ static hda_nid_t path_power_update(struct hda_codec *codec, · 5 unmodified lines
838838 state = AC_PWRST_D0;
839839 else
840840 state = AC_PWRST_D3;
841− if (!snd_hda_check_power_state(codec, nid, state)) {
841+ power = snd_hda_codec_read(codec, nid, 0,
842+ AC_VERB_GET_POWER_STATE, 0);
843+ if (power != (state | (state << 4))) {
842844 snd_hda_codec_write(codec, nid, 0,
843845 AC_VERB_SET_POWER_STATE, state);
844846 changed = nid;
sound/pci/hda/hda_intel.c+3−0
@@ -2232,6 +2232,9 @@ static const struct pci_device_id azx_ids[] = { · 2231 unmodified lines
22322232 /* Broxton-P(Apollolake) */
22332233 { PCI_DEVICE(0x8086, 0x5a98),
22342234 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BROXTON },
2235+ /* Broxton-T */
2236+ { PCI_DEVICE(0x8086, 0x1a98),
2237+ .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BROXTON },
22352238 /* Haswell */
22362239 { PCI_DEVICE(0x8086, 0x0a0c),
22372240 .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL },
sound/pci/hda/patch_cirrus.c+14−0
@@ -361,6 +361,7 @@ static int cs_parse_auto_config(struct hda_codec *codec) · 360 unmodified lines
361361 {
362362 struct cs_spec *spec = codec->spec;
363363 int err;
364+ int i;
364365
365366 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0);
366367 if (err < 0)
@@ -370,6 +371,19 @@ static int cs_parse_auto_config(struct hda_codec *codec) · 3 unmodified lines
370371 if (err < 0)
371372 return err;
372373
374+ /* keep the ADCs powered up when it's dynamically switchable */
375+ if (spec->gen.dyn_adc_switch) {
376+ unsigned int done = 0;
377+ for (i = 0; i < spec->gen.input_mux.num_items; i++) {
378+ int idx = spec->gen.dyn_adc_idx[i];
379+ if (done & (1 << idx))
380+ continue;
381+ snd_hda_gen_fix_pin_power(codec,
382+ spec->gen.adc_nids[idx]);
383+ done |= 1 << idx;
384+ }
385+ }
386+
373387 return 0;
374388 }
375389
sound/pci/hda/patch_hdmi.c+2−0
@@ -1858,6 +1858,8 @@ static void hdmi_set_chmap(struct hdac_device *hdac, int pcm_idx, · 1857 unmodified lines
18581858 struct hdmi_spec *spec = codec->spec;
18591859 struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx);
18601860
1861+ if (!per_pin)
1862+ return;
18611863 mutex_lock(&per_pin->lock);
18621864 per_pin->chmap_set = true;
18631865 memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap));
sound/pci/hda/patch_realtek.c+1−0
@@ -5449,6 +5449,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 5448 unmodified lines
54495449 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
54505450 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
54515451 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
5452+ SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
54525453 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
54535454 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
54545455 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
sound/pci/pcxhr/pcxhr_core.c+1−0
@@ -1341,5 +1341,6 @@ irqreturn_t pcxhr_threaded_irq(int irq, void *dev_id) · 1340 unmodified lines
13411341 }
13421342
13431343 pcxhr_msg_thread(mgr);
1344+ mutex_unlock(&mgr->lock);
13441345 return IRQ_HANDLED;
13451346 }
tools/objtool/Documentation/stack-validation.txt+29−9
@@ -299,18 +299,38 @@ they mean, and suggestions for how to fix them. · 298 unmodified lines
299299 Errors in .c files
300300 ------------------
301301
302−If you're getting an objtool error in a compiled .c file, chances are
303−the file uses an asm() statement which has a "call" instruction. An
304−asm() statement with a call instruction must declare the use of the
305−stack pointer in its output operand. For example, on x86_64:
302+1. c_file.o: warning: objtool: funcA() falls through to next function funcB()
306303
307− register void *__sp asm("rsp");
308− asm volatile("call func" : "+r" (__sp));
304+ This means that funcA() doesn't end with a return instruction or an
305+ unconditional jump, and that objtool has determined that the function
306+ can fall through into the next function. There could be different
307+ reasons for this:
309308
310−Otherwise the stack frame may not get created before the call.
309+ 1) funcA()'s last instruction is a call to a "noreturn" function like
310+ panic(). In this case the noreturn function needs to be added to
311+ objtool's hard-coded global_noreturns array. Feel free to bug the
312+ objtool maintainer, or you can submit a patch.
311313
312−Another possible cause for errors in C code is if the Makefile removes
313−-fno-omit-frame-pointer or adds -fomit-frame-pointer to the gcc options.
314+ 2) funcA() uses the unreachable() annotation in a section of code
315+ that is actually reachable.
316+
317+ 3) If funcA() calls an inline function, the object code for funcA()
318+ might be corrupt due to a gcc bug. For more details, see:
319+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646
320+
321+2. If you're getting any other objtool error in a compiled .c file, it
322+ may be because the file uses an asm() statement which has a "call"
323+ instruction. An asm() statement with a call instruction must declare
324+ the use of the stack pointer in its output operand. For example, on
325+ x86_64:
326+
327+ register void *__sp asm("rsp");
328+ asm volatile("call func" : "+r" (__sp));
329+
330+ Otherwise the stack frame may not get created before the call.
331+
332+3. Another possible cause for errors in C code is if the Makefile removes
333+ -fno-omit-frame-pointer or adds -fomit-frame-pointer to the gcc options.
314334
315335 Also see the above section for .S file errors for more information what
316336 the individual error messages mean.
tools/objtool/builtin-check.c+72−25
@@ -54,6 +54,7 @@ struct instruction { · 53 unmodified lines
5454 struct symbol *call_dest;
5555 struct instruction *jump_dest;
5656 struct list_head alts;
57+ struct symbol *func;
5758 };
5859
5960 struct alternative {
@@ -66,6 +67,7 @@ struct objtool_file { · 6 unmodified lines
6667 struct list_head insn_list;
6768 DECLARE_HASHTABLE(insn_hash, 16);
6869 struct section *rodata, *whitelist;
70+ bool ignore_unreachables, c_file;
6971 };
7072
7173 const char *objname;
@@ -228,7 +230,7 @@ static int __dead_end_function(struct objtool_file *file, struct symbol *func, · 156 unmodified lines
228230 }
229231 }
230232
231− if (insn->type == INSN_JUMP_DYNAMIC)
233+ if (insn->type == INSN_JUMP_DYNAMIC && list_empty(&insn->alts))
232234 /* sibling call */
233235 return 0;
234236 }
@@ -248,6 +250,7 @@ static int dead_end_function(struct objtool_file *file, struct symbol *func) · 13 unmodified lines
248250 static int decode_instructions(struct objtool_file *file)
249251 {
250252 struct section *sec;
253+ struct symbol *func;
251254 unsigned long offset;
252255 struct instruction *insn;
253256 int ret;
@@ -281,6 +284,21 @@ static int decode_instructions(struct objtool_file *file) · 27 unmodified lines
281284 hash_add(file->insn_hash, &insn->hash, insn->offset);
282285 list_add_tail(&insn->list, &file->insn_list);
283286 }
287+
288+ list_for_each_entry(func, &sec->symbol_list, list) {
289+ if (func->type != STT_FUNC)
290+ continue;
291+
292+ if (!find_insn(file, sec, func->offset)) {
293+ WARN("%s(): can't find starting instruction",
294+ func->name);
295+ return -1;
296+ }
297+
298+ func_for_each_insn(file, func, insn)
299+ if (!insn->func)
300+ insn->func = func;
301+ }
284302 }
285303
286304 return 0;
@@ -664,13 +682,40 @@ static int add_func_switch_tables(struct objtool_file *file, · 377 unmodified lines
664682 text_rela->addend);
665683
666684 /*
667− * TODO: Document where this is needed, or get rid of it.
668− *
669685 * rare case: jmpq *[addr](%rip)
686+ *
687+ * This check is for a rare gcc quirk, currently only seen in
688+ * three driver functions in the kernel, only with certain
689+ * obscure non-distro configs.
690+ *
691+ * As part of an optimization, gcc makes a copy of an existing
692+ * switch jump table, modifies it, and then hard-codes the jump
693+ * (albeit with an indirect jump) to use a single entry in the
694+ * table. The rest of the jump table and some of its jump
695+ * targets remain as dead code.
696+ *
697+ * In such a case we can just crudely ignore all unreachable
698+ * instruction warnings for the entire object file. Ideally we
699+ * would just ignore them for the function, but that would
700+ * require redesigning the code quite a bit. And honestly
701+ * that's just not worth doing: unreachable instruction
702+ * warnings are of questionable value anyway, and this is such
703+ * a rare issue.
704+ *
705+ * kbuild reports:
706+ * - https://lkml.kernel.org/r/201603231906.LWcVUpxm%25fengguang.wu@intel.com
707+ * - https://lkml.kernel.org/r/201603271114.K9i45biy%25fengguang.wu@intel.com
708+ * - https://lkml.kernel.org/r/201603291058.zuJ6ben1%25fengguang.wu@intel.com
709+ *
710+ * gcc bug:
711+ * - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70604
670712 */
671− if (!rodata_rela)
713+ if (!rodata_rela) {
672714 rodata_rela = find_rela_by_dest(file->rodata,
673715 text_rela->addend + 4);
716+ if (rodata_rela)
717+ file->ignore_unreachables = true;
718+ }
674719
675720 if (!rodata_rela)
676721 continue;
@@ -732,9 +777,6 @@ static int decode_sections(struct objtool_file *file) · 55 unmodified lines
732777 {
733778 int ret;
734779
735− file->whitelist = find_section_by_name(file->elf, "__func_stack_frame_non_standard");
736− file->rodata = find_section_by_name(file->elf, ".rodata");
737−
738780 ret = decode_instructions(file);
739781 if (ret)
740782 return ret;
@@ -799,6 +841,7 @@ static int validate_branch(struct objtool_file *file, · 58 unmodified lines
799841 struct alternative *alt;
800842 struct instruction *insn;
801843 struct section *sec;
844+ struct symbol *func = NULL;
802845 unsigned char state;
803846 int ret;
804847
@@ -813,6 +856,16 @@ static int validate_branch(struct objtool_file *file, · 8 unmodified lines
813856 }
814857
815858 while (1) {
859+ if (file->c_file && insn->func) {
860+ if (func && func != insn->func) {
861+ WARN("%s() falls through to next function %s()",
862+ func->name, insn->func->name);
863+ return 1;
864+ }
865+
866+ func = insn->func;
867+ }
868+
816869 if (insn->visited) {
817870 if (frame_state(insn->state) != frame_state(state)) {
818871 WARN_FUNC("frame pointer state mismatch",
@@ -823,13 +876,6 @@ static int validate_branch(struct objtool_file *file, · 4 unmodified lines
823876 return 0;
824877 }
825878
826− /*
827− * Catch a rare case where a noreturn function falls through to
828− * the next function.
829− */
830− if (is_fentry_call(insn) && (state & STATE_FENTRY))
831− return 0;
832−
833879 insn->visited = true;
834880 insn->state = state;
835881
@@ -1035,12 +1081,8 @@ static int validate_functions(struct objtool_file *file) · 199 unmodified lines
10351081 continue;
10361082
10371083 insn = find_insn(file, sec, func->offset);
1038− if (!insn) {
1039− WARN("%s(): can't find starting instruction",
1040− func->name);
1041− warnings++;
1084+ if (!insn)
10421085 continue;
1043− }
10441086
10451087 ret = validate_branch(file, insn, 0);
10461088 warnings += ret;
@@ -1056,13 +1098,14 @@ static int validate_functions(struct objtool_file *file) · 9 unmodified lines
10561098 if (insn->visited)
10571099 continue;
10581100
1059− if (!ignore_unreachable_insn(func, insn) &&
1060− !warnings) {
1061− WARN_FUNC("function has unreachable instruction", insn->sec, insn->offset);
1062− warnings++;
1063− }
1064−
10651101 insn->visited = true;
1102+
1103+ if (file->ignore_unreachables || warnings ||
1104+ ignore_unreachable_insn(func, insn))
1105+ continue;
1106+
1107+ WARN_FUNC("function has unreachable instruction", insn->sec, insn->offset);
1108+ warnings++;
10661109 }
10671110 }
10681111 }
@@ -1133,6 +1176,10 @@ int cmd_check(int argc, const char **argv) · 64 unmodified lines
11331176
11341177 INIT_LIST_HEAD(&file.insn_list);
11351178 hash_init(file.insn_hash);
1179+ file.whitelist = find_section_by_name(file.elf, "__func_stack_frame_non_standard");
1180+ file.rodata = find_section_by_name(file.elf, ".rodata");
1181+ file.ignore_unreachables = false;
1182+ file.c_file = find_section_by_name(file.elf, ".comment");
11361183
11371184 ret = decode_sections(&file);
11381185 if (ret < 0)
tools/perf/util/intel-pt.c+1−1
@@ -1130,7 +1130,7 @@ static int intel_pt_synth_transaction_sample(struct intel_pt_queue *ptq) · 1129 unmodified lines
11301130 pr_err("Intel Processor Trace: failed to deliver transaction event, error %d\n",
11311131 ret);
11321132
1133− if (pt->synth_opts.callchain)
1133+ if (pt->synth_opts.last_branch)
11341134 intel_pt_reset_last_branch_rb(ptq);
11351135
11361136 return ret;