arm64: dts: rockchip: Fix gmac failure of rgmii-id from rk3566-roc-pc
Subsystems (13)
Sasha Levin
maintainerPATCH 1/39 arm64: dts: rockchip: Fix gmac failure of rgmii-id from rk3566-roc-pc
From: Furkan Kardame <[email protected]>
[ Upstream commit adbab347ec8861aa80d850693df3cd005ec65a99 ]
Lan does not work on rgmii-id, most rk356x devices lan is being switched to rgmii.
--- arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts +1 -1
@@ -130,7 +130,7 @@ &gmac1 { assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>; assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>, <&gmac1_clkin>; clock_in_out = "input"; - phy-mode = "rgmii-id"; + phy-mode = "rgmii"; phy-supply = <&vcc_3v3>; pinctrl-names = "default"; pinctrl-0 = <&gmac1m0_miim
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 2/39 arm64: dts: rockchip: Fix i2c3 pinctrl on rk3566-roc-pc
From: Furkan Kardame <[email protected]>
[ Upstream commit 2440ad0d851e404adcd1b9ad758f28bd59365bae ]
As per device schematic i2c3 pinctrl is connected to m0 instead of m1
--- arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts +1 -1
@@ -397,7 +397,7 @@ &i2c2 { &i2c3 { pinctrl-names = "default"; - pinctrl-0 = <&i2c3m1_xfer>; + pinctrl-0 = <&i2c3m0_xfer>; status = "okay"; };
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 3/39 arm64: dts: rockchip: remove i2c5 from rk3566-roc-pc
In reply to Sasha LevinFrom: Furkan Kardame <[email protected]>
[ Upstream commit b44bc59d0d279fa4f3dc11b895f2c8f77719885d ]
i2c5 is owned by hdmi port
--- arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts | 4 ---- 1 file changed, 4 deletions(-)
arch/arm64/boot/dts/rockchip/rk3566-roc-pc.dts +0 -4
@@ -401,10 +401,6 @@ &i2c3 { status = "okay"; }; -&i2c5 { - status = "okay"; -}; - &mdio1 { rgmii_phy1: ethernet-phy@0 { compatible = "ethernet-phy-ieee802.3-c22";
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 4/39 arm64: dts: rockchip: keep I2S1 disabled for GPIO function on ROCK Pi 4 series
In reply to Sasha LevinFrom: FUKAUMI Naoki <[email protected]>
[ Upstream commit 849c19d14940b87332d5d59c7fc581d73f2099fd ]
I2S1 pins are exposed on 40-pin header on Radxa ROCK Pi 4 series. their default function is GPIO, so I2S1 need to be disabled.
--- arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +0 -1
@@ -491,7 +491,6 @@ i2s0_p0_0: endpoint { &i2s1 { rockchip,playback-channels = <2>; rockchip,capture-channels = <2>; - status = "okay"; }; &i2s2 {
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 5/39 arm64: dts: rockchip: fix node name for hym8563 rtc
In reply to Sasha LevinFrom: Sebastian Reichel <[email protected]>
[ Upstream commit 67a9aeef44e42b1ac2becf5e61eae0880f48d9db ]
Fix the node name for hym8563 in all arm64 rockchip devicetrees.
--- arch/arm64/boot/dts/rockchip/rk3368-orion-r68-meta.dts | 2 +- arch/arm64/boot/dts/rockchip/rk3368-r88.dts | 2 +- arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts | 2 +- arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/rockchip/rk3368-orion-r68-meta.dts +1 -1
@@ -208,7 +208,7 @@ vdd_cpu: syr827@40 { vin-supply = <&vcc_sys>; }; - hym8563: hym8563@51 { + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>;
arch/arm64/boot/dts/rockchip/rk3368-r88.dts +1 -1
@@ -192,7 +192,7 @@ vdd_cpu: syr827@40 { vin-supply = <&vcc_sys>; }; - hym8563: hym8563@51 { + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>;
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts +1 -1
@@ -98,7 +98,7 @@ &fusb0 { }; &i2c0 { - hym8563: hym8563@51 { + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; interrupt-parent = <&gpio0>;
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi +1 -1
@@ -297,7 +297,7 @@ &i2c2 { clock-frequency = <400000>; status = "okay"; - hym8563: hym8563@51 { + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 6/39 arm: dts: rockchip: fix node name for hym8563 rtc
In reply to Sasha LevinFrom: Sebastian Reichel <[email protected]>
[ Upstream commit 17b57beafccb4569accbfc8c11390744cf59c021 ]
Fix the node name for hym8563 in all arm rockchip devicetrees.
--- arch/arm/boot/dts/rk3036-evb.dts | 2 +- arch/arm/boot/dts/rk3288-evb-act8846.dts | 2 +- arch/arm/boot/dts/rk3288-firefly.dtsi | 2 +- arch/arm/boot/dts/rk3288-miqi.dts | 2 +- arch/arm/boot/dts/rk3288-rock2-square.dts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/rk3036-evb.dts +1 -1
@@ -31,7 +31,7 @@ phy0: ethernet-phy@0 { &i2c1 { status = "okay"; - hym8563: hym8563@51 { + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>;
arch/arm/boot/dts/rk3288-evb-act8846.dts +1 -1
@@ -54,7 +54,7 @@ vdd_gpu: syr828@41 { vin-supply = <&vcc_sys>; }; - hym8563@51 { + rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>;
arch/arm/boot/dts/rk3288-firefly.dtsi +1 -1
@@ -233,7 +233,7 @@ vdd_gpu: syr828@41 { vin-supply = <&vcc_sys>; }; - hym8563: hym8563@51 { + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>;
arch/arm/boot/dts/rk3288-miqi.dts +1 -1
@@ -162,7 +162,7 @@ vdd_gpu: syr828@41 { vin-supply = <&vcc_sys>; }; - hym8563: hym8563@51 { + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>;
arch/arm/boot/dts/rk3288-rock2-square.dts +1 -1
@@ -165,7 +165,7 @@ &hdmi { }; &i2c0 { - hym8563: hym8563@51 { + hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 8/39 ARM: dts: rockchip: fix adc-keys sub node names
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit 942b35de22efeb4f9ded83f1ea7747f3fe5a3bb2 ]
Fix adc-keys sub node names on Rockchip boards,
so that they match with regex: '^button-'
--- arch/arm/boot/dts/rk3066a-mk808.dts | 2 +- arch/arm/boot/dts/rk3288-evb.dtsi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/rk3066a-mk808.dts +1 -1
@@ -32,7 +32,7 @@ adc-keys { keyup-threshold-microvolt = <2500000>; poll-interval = <100>; - recovery { + button-recovery { label = "recovery"; linux,code = <KEY_VENDOR>; press-threshold-microvolt = <0>;
arch/arm/boot/dts/rk3288-evb.dtsi +3 -3
@@ -28,19 +28,19 @@ button-down { press-threshold-microvolt = <300000>; }; - menu { + button-menu { label = "Menu"; linux,code = <KEY_MENU>; press-threshold-microvolt = <640000>; }; - esc { + button-esc { label = "Esc"; linux,code = <KEY_ESC>; press-threshold-microvolt = <1000000>; }; - home { + button-home { label = "Home"; linux,code = <KEY_HOME>; press-threshold-microvolt = <1300000>;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 7/39 arm: dts: rockchip: remove clock-frequency from rtc
In reply to Sasha LevinFrom: Sebastian Reichel <[email protected]>
[ Upstream commit 6122f3be70d90a1b2a1188d8910256fc218376a9 ]
'clock-frequency' is not part of the DT binding and not supported by the Linux driver.
--- arch/arm/boot/dts/rk3036-evb.dts | 1 - arch/arm/boot/dts/rk3288-firefly.dtsi | 1 - arch/arm/boot/dts/rk3288-miqi.dts | 1 - arch/arm/boot/dts/rk3288-rock2-square.dts | 1 - arch/arm/boot/dts/rk3288-vmarc-som.dtsi | 1 - 5 files changed, 5 deletions(-)
arch/arm/boot/dts/rk3036-evb.dts +0 -1
@@ -35,7 +35,6 @@ hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>; - clock-frequency = <32768>; clock-output-names = "xin32k"; }; };
arch/arm/boot/dts/rk3288-firefly.dtsi +0 -1
@@ -237,7 +237,6 @@ hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>; - clock-frequency = <32768>; clock-output-names = "xin32k"; interrupt-parent = <&gpio7>; interrupts = <RK_PA4 IRQ_TYPE_EDGE_FALLING>;
arch/arm/boot/dts/rk3288-miqi.dts +0 -1
@@ -166,7 +166,6 @@ hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>; - clock-frequency = <32768>; clock-output-names = "xin32k"; };
arch/arm/boot/dts/rk3288-rock2-square.dts +0 -1
@@ -169,7 +169,6 @@ hym8563: rtc@51 { compatible = "haoyu,hym8563"; reg = <0x51>; #clock-cells = <0>; - clock-frequency = <32768>; clock-output-names = "xin32k"; interrupt-parent = <&gpio0>; interrupts = <RK_PA4 IRQ_TYPE_EDGE_FALLING>;
arch/arm/boot/dts/rk3288-vmarc-som.dtsi +0 -1
@@ -241,7 +241,6 @@ hym8563: rtc@51 { interrupt-parent = <&gpio5>; interrupts = <RK_PC3 IRQ_TYPE_LEVEL_LOW>; #clock-cells = <0>; - clock-frequency = <32768>; clock-output-names = "hym8563"; pinctrl-names = "default"; pinctrl-0 = <&hym8563_int>;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 9/39 arm64: dts: rockchip: fix adc-keys sub node names
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit f2bd2e76d6ea13e12849975adae46145375532a4 ]
Fix adc-keys sub node names on Rockchip boards,
so that they match with regex: '^button-'
--- arch/arm64/boot/dts/rockchip/px30-evb.dts | 10 +++++----- arch/arm64/boot/dts/rockchip/rk3308-evb.dts | 12 ++++++------ arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts | 2 +- arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 2 +- arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts | 2 +- arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4b.dts | 2 +- arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts | 4 ++-- arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 2 +- .../boot/dts/rockchip/rk3399-sapphire-excavator.dts | 4 ++-- arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-)
arch/arm64/boot/dts/rockchip/px30-evb.dts +5 -5
@@ -30,31 +30,31 @@ adc-keys { keyup-threshold-microvolt = <1800000>; poll-interval = <100>; - esc-key { + button-esc { label = "esc"; linux,code = <KEY_ESC>; press-threshold-microvolt = <1310000>; }; - home-key { + button-home { label = "home"; linux,code = <KEY_HOME>; press-threshold-microvolt = <624000>; }; - menu-key { + button-menu { label = "menu"; linux,code = <KEY_MENU>; press-threshold-microvolt = <987000>; }; - vol-down-key { + button-down { label = "volume down"; linux,code = <KEY_VOLUMEDOWN>; press-threshold-microvolt = <300000>; }; - vol-up-key { + button-up { label = "volume up"; linux,code = <KEY_VOLUMEUP>; press-threshold-microvolt = <17000>;
arch/arm64/boot/dts/rockchip/rk3308-evb.dts +6 -6
@@ -23,7 +23,7 @@ adc-keys0 { poll-interval = <100>; keyup-threshold-microvolt = <1800000>; - func-key { + button-func { linux,code = <KEY_FN>; label = "function"; press-threshold-microvolt = <18000>;
@@ -37,31 +37,31 @@ adc-keys1 { poll-interval = <100>; keyup-threshold-microvolt = <1800000>; - esc-key { + button-esc { linux,code = <KEY_MICMUTE>; label = "micmute"; press-threshold-microvolt = <1130000>; }; - home-key { + button-home { linux,code = <KEY_MODE>; label = "mode"; press-threshold-microvolt = <901000>; }; - menu-key { + button-menu { linux,code = <KEY_PLAY>; label = "play"; press-threshold-microvolt = <624000>; }; - vol-down-key { + button-down { linux,code = <KEY_VOLUMEDOWN>; label = "volume down"; press-threshold-microvolt = <300000>; }; - vol-up-key { + button-up { linux,code = <KEY_VOLUMEUP>; label = "volume up"; press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts +1 -1
@@ -25,7 +25,7 @@ adc-keys { keyup-threshold-microvolt = <1800000>; poll-interval = <100>; - recovery { + button-recovery { label = "recovery"; linux,code = <KEY_VENDOR>; press-threshold-microvolt = <17000>;
arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi +1 -1
@@ -123,7 +123,7 @@ adc-keys { keyup-threshold-microvolt = <1800000>; poll-interval = <100>; - recovery { + button-recovery { label = "Recovery"; linux,code = <KEY_VENDOR>; press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts +1 -1
@@ -39,7 +39,7 @@ adc-keys { keyup-threshold-microvolt = <1800000>; poll-interval = <100>; - recovery { + button-recovery { label = "Recovery"; linux,code = <KEY_VENDOR>; press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3399-nanopi-m4b.dts +1 -1
@@ -19,7 +19,7 @@ adc-keys { keyup-threshold-microvolt = <1500000>; poll-interval = <100>; - recovery { + button-recovery { label = "Recovery"; linux,code = <KEY_VENDOR>; press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts +2 -2
@@ -52,13 +52,13 @@ button-down { press-threshold-microvolt = <300000>; }; - back { + button-back { label = "Back"; linux,code = <KEY_BACK>; press-threshold-microvolt = <985000>; }; - menu { + button-menu { label = "Menu"; linux,code = <KEY_MENU>; press-threshold-microvolt = <1314000>;
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi +1 -1
@@ -41,7 +41,7 @@ adc-keys { keyup-threshold-microvolt = <1500000>; poll-interval = <100>; - recovery { + button-recovery { label = "Recovery"; linux,code = <KEY_VENDOR>; press-threshold-microvolt = <18000>;
arch/arm64/boot/dts/rockchip/rk3399-sapphire-excavator.dts +2 -2
@@ -33,13 +33,13 @@ button-down { press-threshold-microvolt = <300000>; }; - back { + button-back { label = "Back"; linux,code = <KEY_BACK>; press-threshold-microvolt = <985000>; }; - menu { + button-menu { label = "Menu"; linux,code = <KEY_MENU>; press-threshold-microvolt = <1314000>;
arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi +1 -1
@@ -23,7 +23,7 @@ adc-keys { io-channel-names = "buttons"; keyup-threshold-microvolt = <1750000>; - recovery { + button-recovery { label = "recovery"; linux,code = <KEY_VENDOR>; press-threshold-microvolt = <0>;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 10/39 ARM: dts: rockchip: fix ir-receiver node names
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit dd847fe34cdf1e89afed1af24986359f13082bfb ]
Fix ir-receiver node names on Rockchip boards,
so that they match with regex: '^ir(-receiver)?(@[a-f0-9]+)?$'
--- arch/arm/boot/dts/rk3188-radxarock.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/rk3188-radxarock.dts +1 -1
@@ -71,7 +71,7 @@ spdif_out: spdif-out { #sound-dai-cells = <0>; }; - ir_recv: gpio-ir-receiver { + ir_recv: ir-receiver { compatible = "gpio-ir-receiver"; gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; pinctrl-names = "default";
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 11/39 arm64: dts: rockchip: fix ir-receiver node names
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit de0d04b9780a23eb928aedfb6f981285f78d58e5 ]
Fix ir-receiver node names on Rockchip boards,
so that they match with regex: '^ir(-receiver)?(@[a-f0-9]+)?$'
--- arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts +1 -1
@@ -19,7 +19,7 @@ chosen { stdout-path = "serial2:1500000n8"; }; - ir_rx { + ir-receiver { compatible = "gpio-ir-receiver"; gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>; pinctrl-names = "default";
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 22/39 ALSA: seq: Fix function prototype mismatch in snd_seq_expand_var_event
In reply to Sasha LevinFrom: Kees Cook <[email protected]>
[ Upstream commit 05530ef7cf7c7d700f6753f058999b1b5099a026 ]
With clang's kernel control flow integrity (kCFI, CONFIG_CFI_CLANG), indirect call targets are validated against the expected function pointer prototype to make sure the call target is valid to help mitigate ROP attacks. If they are not identical, there is a failure at run time, which manifests as either a kernel panic or thread getting killed.
seq_copy_in_user() and seq_copy_in_kernel() did not have prototypes matching snd_seq_dump_func_t. Adjust this and remove the casts. There are not resulting binary output differences.
This was found as a result of Clang's new -Wcast-function-type-strict flag, which is more sensitive than the simpler -Wcast-function-type, which only checks for type width mismatches.
--- sound/core/seq/seq_memory.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
sound/core/seq/seq_memory.c +7 -4
@@ -113,15 +113,19 @@ EXPORT_SYMBOL(snd_seq_dump_var_event);* expand the variable length event to linear buffer space. */ -static int seq_copy_in_kernel (char **bufptr,const void *src,int size) +static int seq_copy_in_kernel (void *ptr,void *src,int size) { +char **bufptr = ptr; +memcpy (*bufptr, src, size); *bufptr += size;return 0 ; } -static int seq_copy_in_user (char __user **bufptr,const void *src,int size) +static int seq_copy_in_user (void *ptr,void *src,int size) { +char __user **bufptr = ptr; +if (copy_to_user (*bufptr, src, size))return -EFAULT ; *bufptr += size;
@@ -151,8 +155,7 @@ int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, charreturn newlen; } err =snd_seq_dump_var_event (event, - in_kernel ? (snd_seq_dump_func_t )seq_copy_in_kernel : - (snd_seq_dump_func_t )seq_copy_in_user, + in_kernel ? seq_copy_in_kernel : seq_copy_in_user, &buf);return err <0 ? err : newlen; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 23/39 LoongArch: Makefile: Use "grep -E" instead of "egrep"
In reply to Sasha LevinFrom: Tiezhu Yang <[email protected]>
[ Upstream commit 83f638bca0ccd94942bc3c4eb9bcec24dd8a1cf9 ]
The latest version of grep claims the egrep is now obsolete so the build now contains warnings that look like:
egrep: warning: egrep is obsolescent; using grep -E
Fix this up by changing the LoongArch Makefile to use "grep -E" instead.
--- arch/loongarch/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/loongarch/Makefile +1 -1
@@ -68,7 +68,7 @@ KBUILD_LDFLAGS += -m $(ld-emul) ifdef CONFIG_LOONGARCH CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ - egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \ + grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \ sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g') endif
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 12/39 ARM: dts: rockchip: rk3188: fix lcdc1-rgb24 node name
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit 11871e20bcb23c00966e785a124fb72bc8340af4 ]
The lcdc1-rgb24 node name is out of line with the rest of the rk3188 lcdc1 node, so fix it.
--- arch/arm/boot/dts/rk3188.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/rk3188.dtsi +1 -1
@@ -379,7 +379,7 @@ lcdc1_vsync: lcdc1-vsync { rockchip,pins = <2 RK_PD3 1 &pcfg_pull_none>; }; - lcdc1_rgb24: ldcd1-rgb24 { + lcdc1_rgb24: lcdc1-rgb24 { rockchip,pins = <2 RK_PA0 1 &pcfg_pull_none>, <2 RK_PA1 1 &pcfg_pull_none>, <2 RK_PA2 1 &pcfg_pull_none>,
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 24/39 LoongArch: Combine acpi_boot_table_init() and acpi_boot_init()
In reply to Sasha LevinFrom: Huacai Chen <[email protected]>
[ Upstream commit 538eafc6deae12fbac5f277b89aa139b812bca49 ]
Combine acpi_boot_table_init() and acpi_boot_init() since they are very simple, and we don't need to check the return value of acpi_boot_init().
--- arch/loongarch/kernel/acpi.c | 31 ++++++++++--------------------- arch/loongarch/kernel/setup.c | 1 - 2 files changed, 10 insertions(+), 22 deletions(-)
arch/loongarch/kernel/acpi.c +10 -21
@@ -56,23 +56,6 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)return ioremap_cache (phys, size); } -void __init acpi_boot_table_init (void ) -{ -/* -* If acpi_disabled, bail out -*/ -if (acpi_disabled) -return ; - -/* -* Initialize the ACPI boot-time table parser. -*/ -if (acpi_table_init ()) { -disable_acpi (); -return ; - } -} -#ifdef CONFIG_SMP static int set_processor_mask (u32 id,u32 flags) {
@@ -156,13 +139,21 @@ static void __init acpi_process_madt(void) loongson_sysconf.nr_cpus = num_processors; } -int __init acpi_boot_init (void ) +void __init acpi_boot_table_init (void ) {/* * If acpi_disabled, bail out */ if (acpi_disabled) -return -1 ; +return ; + +/* +* Initialize the ACPI boot-time table parser. +*/ +if (acpi_table_init ()) { +disable_acpi (); +return ; + } loongson_sysconf.boot_cpu_id =read_csr_cpuid ();
@@ -173,8 +164,6 @@ int __init acpi_boot_init(void)/* Do not enable ACPI SPCR console by default */ acpi_parse_spcr (earlycon_acpi_spcr_enable, false); - -return 0 ; }#ifdef CONFIG_ACPI_NUMA
arch/loongarch/kernel/setup.c +0 -1
@@ -203,7 +203,6 @@ void __init platform_init(void)#ifdef CONFIG_ACPI acpi_gbl_use_default_register_widths = false;acpi_boot_table_init (); -acpi_boot_init ();#endif #ifdef CONFIG_NUMA
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 13/39 fs: use acquire ordering in __fget_light()
In reply to Sasha LevinFrom: Jann Horn <[email protected]>
[ Upstream commit 7ee47dcfff1835ff75a794d1075b6b5f5462cfed ]
We must prevent the CPU from reordering the files->count read with the FD table access like this, on architectures where read-read reordering is possible:
files_lookup_fd_raw()
close_fd()
put_files_struct()
atomic_read(&files->count)I would like to mark this for stable, but the stable rules explicitly say "no theoretical races", and given that the FD table pointer and files->count are explicitly stored in the same cacheline, this sort of reordering seems quite unlikely in practice...
--- fs/file.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
fs/file.c +10 -1
@@ -1002,7 +1002,16 @@ static unsigned long __fget_light(unsigned int fd, fmode_t mask)struct files_struct *files = current->files;struct file *file; -if (atomic_read (&files->count) ==1 ) { +/* +* If another thread is concurrently calling close_fd() followed +* by put_files_struct(), we must not observe the old table +* entry combined with the new refcount - otherwise we could +* return a file that is concurrently being freed. +* +* atomic_read_acquire() pairs with atomic_dec_and_test() in +* put_files_struct(). +*/ +if (atomic_read_acquire (&files->count) ==1 ) { file =files_lookup_fd_raw (files, fd);if (!file ||unlikely (file->f_mode & mask))return 0 ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 25/39 LoongArch: Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite()
In reply to Sasha LevinFrom: Huacai Chen <[email protected]>
[ Upstream commit 54e6cd42a183b602e3627ad3aaeeed44f7443e67 ]
Set _PAGE_DIRTY only if _PAGE_MODIFIED is set in {pmd,pte}_mkwrite(). Otherwise, _PAGE_DIRTY silences the TLB modify exception and make us have no chance to mark a pmd/pte dirty (_PAGE_MODIFIED) for software.
--- arch/loongarch/include/asm/pgtable.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/loongarch/include/asm/pgtable.h +6 -2
@@ -355,7 +355,9 @@ static inline pte_t pte_mkdirty(pte_t pte)static inline pte_t pte_mkwrite (pte_t pte) { -pte_val (pte) |= (_PAGE_WRITE | _PAGE_DIRTY); +pte_val (pte) |= _PAGE_WRITE; +if (pte_val (pte) & _PAGE_MODIFIED) +pte_val (pte) |= _PAGE_DIRTY;return pte; }
@@ -452,7 +454,9 @@ static inline int pmd_write(pmd_t pmd)static inline pmd_t pmd_mkwrite (pmd_t pmd) { -pmd_val (pmd) |= (_PAGE_WRITE | _PAGE_DIRTY); +pmd_val (pmd) |= _PAGE_WRITE; +if (pmd_val (pmd) & _PAGE_MODIFIED) +pmd_val (pmd) |= _PAGE_DIRTY;return pmd; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 14/39 ARM: 9251/1: perf: Fix stacktraces for tracepoint events in THUMB2 kernels
In reply to Sasha LevinFrom: Tomislav Novak <[email protected]>
[ Upstream commit 612695bccfdbd52004551308a55bae410e7cd22f ]
Store the frame address where arm_get_current_stackframe() looks for it (ARM_r7 instead of ARM_fp if CONFIG_THUMB2_KERNEL=y). Otherwise frame->fp gets set to 0, causing unwind_frame() to fail.
# bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }'
Attaching 1 probe...
@[
__schedule+1059
]: 1A typical first unwind instruction is 0x97 (SP = R7), so after executing it SP ends up being 0 and -URC_FAILURE is returned.
unwind_frame(pc = ac9da7d7 lr = 00000000 sp = c69bdda0 fp = 00000000) unwind_find_idx(ac9da7d7)
unwind_exec_insn: insn = 00000097
unwind_exec_insn: fp = 00000000 sp = 00000000 lr = 00000000 pc = 00000000
With this patch:
# bpftrace -e 't:sched:sched_switch { @[kstack] = count(); exit(); }'
Attaching 1 probe...
@[
__schedule+1059
__schedule+1059
schedule+79
schedule_hrtimeout_range_clock+163
schedule_hrtimeout_range+17
ep_poll+471
SyS_epoll_wait+111
sys_epoll_pwait+231
__ret_fast_syscall+1
]: 1--- arch/arm/include/asm/perf_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/perf_event.h +1 -1
@@ -17,7 +17,7 @@ extern unsigned long perf_misc_flags(struct pt_regs *regs);#define perf_arch_fetch_caller_regs (regs, __ip) { \ (regs)->ARM_pc = (__ip); \ - (regs)->ARM_fp = (unsigned long) __builtin_frame_address(0); \ + frame_pointer((regs)) = (unsigned long) __builtin_frame_address(0); \ (regs)->ARM_sp = current_stack_pointer; \ (regs)->ARM_cpsr = SVC_MODE; \ }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 26/39 LoongArch: Fix unsigned comparison with less than zero
In reply to Sasha LevinFrom: KaiLong Wang <[email protected]>
[ Upstream commit b96e74bb439f096168c78ba3ba1599e0b85cfd73 ]
Eliminate the following coccicheck warning:
./arch/loongarch/kernel/unwind_prologue.c:84:5-13: WARNING: Unsigned expression compared with zero: frame_ra < 0
--- arch/loongarch/kernel/unwind_prologue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/loongarch/kernel/unwind_prologue.c +2 -1
@@ -43,7 +43,8 @@ static bool unwind_by_prologue(struct unwind_state *state) {struct stack_info *info = &state->stack_info;union loongarch_instruction *ip, *ip_end; -unsigned long frame_size =0 , frame_ra =-1 ; +long frame_ra =-1 ; +unsigned long frame_size =0 ;unsigned long size, offset, pc = state->pc;if (state->sp >= info->end || state->sp < info->begin)
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 15/39 ARM: 9266/1: mm: fix no-MMU ZERO_PAGE() implementation
In reply to Sasha LevinFrom: Giulio Benetti <[email protected]>
[ Upstream commit 340a982825f76f1cff0daa605970fe47321b5ee7 ]
Actually in no-MMU SoCs(i.e. i.MXRT) ZERO_PAGE(vaddr) expands to
```
virt_to_page(0)
```
that in order expands to:
```
pfn_to_page(virt_to_pfn(0))
```
and then virt_to_pfn(0) to:
```
((((unsigned long)(0) - PAGE_OFFSET) >> PAGE_SHIFT) +
PHYS_PFN_OFFSET)
```where PAGE_OFFSET and PHYS_PFN_OFFSET are the DRAM offset(0x80000000) and PAGE_SHIFT is 12. This way we obtain 16MB(0x01000000) summed to the base of DRAM(0x80000000).
When ZERO_PAGE(0) is then used, for example in bio_add_page(), the page gets an address that is out of DRAM bounds.
So instead of using fake virtual page 0 let's allocate a dedicated zero_page during paging_init() and assign it to a global 'struct page * empty_zero_page' the same way mmu.c does and it's the same approach used in m68k with commit dc068f462179 as discussed here[0]. Then let's move ZERO_PAGE() definition to the top of pgtable.h to be in common between mmu.c and nommu.c.
[0]: https://lore.kernel.org/linux-m68k/[email protected]/T/#m1266ceb63ad140743174d6b3070364d3c9a5179b
--- arch/arm/include/asm/pgtable-nommu.h | 6 ------ arch/arm/include/asm/pgtable.h | 16 +++++++++------- arch/arm/mm/nommu.c | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 13 deletions(-)
arch/arm/include/asm/pgtable-nommu.h +0 -6
@@ -44,12 +44,6 @@typedef pte_t *pte_addr_t ; -/* -* ZERO_PAGE is a global shared page that is always zero: used -* for zero-mapped memory areas etc.. -*/ -#define ZERO_PAGE (vaddr) (virt_to_page(0)) -/* * Mark the prot value as uncacheable and unbufferable. */
arch/arm/include/asm/pgtable.h +9 -7
@@ -10,6 +10,15 @@#include <linux/const.h> #include <asm/proc-fns.h> +#ifndef __ASSEMBLY__ +/* +* ZERO_PAGE is a global shared page that is always zero: used +* for zero-mapped memory areas etc.. +*/ +extern struct page *empty_zero_page; +#define ZERO_PAGE (vaddr) (empty_zero_page) +#endif +#ifndef CONFIG_MMU #include <asm-generic/pgtable-nopud.h>
@@ -139,13 +148,6 @@ extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,*/ #ifndef __ASSEMBLY__ -/* -* ZERO_PAGE is a global shared page that is always zero: used -* for zero-mapped memory areas etc.. -*/ -extern struct page *empty_zero_page; -#define ZERO_PAGE (vaddr) (empty_zero_page) -extern pgd_t swapper_pg_dir[PTRS_PER_PGD ];
arch/arm/mm/nommu.c +19 -0
@@ -26,6 +26,13 @@unsigned long vectors_base; +/* +* empty_zero_page is a special page that is used for +* zero-initialized data and COW. +*/ +struct page *empty_zero_page; +EXPORT_SYMBOL (empty_zero_page); +#ifdef CONFIG_ARM_MPU struct mpu_rgn_info mpu_rgn_info;#endif
@@ -148,9 +155,21 @@ void __init adjust_lowmem_bounds(void)*/ void __init paging_init (const struct machine_desc *mdesc) { +void *zero_page; +early_trap_init ((void *)vectors_base);mpu_setup (); + +/* allocate the zero page. */ + zero_page =memblock_alloc (PAGE_SIZE ,PAGE_SIZE ); +if (!zero_page) +panic ("%s: Failed to allocate %lu bytes align=0x%lx\n" , + __func__,PAGE_SIZE ,PAGE_SIZE ); +bootmem_init (); + + empty_zero_page =virt_to_page (zero_page); +flush_dcache_page (empty_zero_page); }/*
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 16/39 ASoC: wm8962: Wait for updated value of WM8962_CLOCKING1 register
In reply to Sasha LevinFrom: Chancel Liu <[email protected]>
[ Upstream commit 3ca507bf99611c82dafced73e921c1b10ee12869 ]
DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate correct frequency of LRCLK and BCLK. Sometimes the read-only value can't be updated timely after enabling SYSCLK. This results in wrong calculation values. Delay is introduced here to wait for newest value from register. The time of the delay should be at least 500~1000us according to test.
--- sound/soc/codecs/wm8962.c | 8 ++++++++ 1 file changed, 8 insertions(+)
sound/soc/codecs/wm8962.c +8 -0
@@ -2503,6 +2503,14 @@ static void wm8962_configure_bclk(struct snd_soc_component *component)snd_soc_component_update_bits (component,WM8962_CLOCKING2 ,WM8962_SYSCLK_ENA_MASK ,WM8962_SYSCLK_ENA ); +/* DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate +* correct frequency of LRCLK and BCLK. Sometimes the read-only value +* can't be updated timely after enabling SYSCLK. This results in wrong +* calculation values. Delay is introduced here to wait for newest +* value from register. The time of the delay should be at least +* 500~1000us according to test. +*/ +usleep_range (500 ,1000 ); dspclk =snd_soc_component_read (component,WM8962_CLOCKING1 );if (snd_soc_component_get_bias_level (component) !=SND_SOC_BIAS_ON )
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 32/39 fbcon: Use kzalloc() in fbcon_prepare_logo()
In reply to Sasha LevinFrom: Tetsuo Handa <[email protected]>
[ Upstream commit a6a00d7e8ffd78d1cdb7a43f1278f081038c638f ]
A kernel built with syzbot's config file reported that
scr_memcpyw(q, save, array3_size(logo_lines, new_cols, 2))
causes uninitialized "save" to be copied.
----------
[drm] Initialized vgem 1.0.0 20120112 for vgem on minor 0 [drm] Initialized vkms 1.0.0 20180514 for vkms on minor 1
Console: switching to colour frame buffer device 128x48
=====================================================
BUG: KMSAN: uninit-value in do_update_region+0x4b8/0xba0 do_update_region+0x4b8/0xba0 update_region+0x40d/0x840 fbcon_switch+0x3364/0x35e0 redraw_screen+0xae3/0x18a0 do_bind_con_driver+0x1cb3/0x1df0 do_take_over_console+0x11cb/0x13f0 fbcon_fb_registered+0xacc/0xfd0 register_framebuffer+0x1179/0x1320 __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40 drm_fbdev_client_hotplug+0xbea/0xda0 drm_fbdev_generic_setup+0x65e/0x9d0 vkms_init+0x9f3/0xc76 (...snipped...)
Uninit was stored to memory at:
fbcon_prepare_logo+0x143b/0x1940 fbcon_init+0x2c1b/0x31c0 visual_init+0x3e7/0x820 do_bind_con_driver+0x14a4/0x1df0 do_take_over_console+0x11cb/0x13f0 fbcon_fb_registered+0xacc/0xfd0 register_framebuffer+0x1179/0x1320 __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40 drm_fbdev_client_hotplug+0xbea/0xda0 drm_fbdev_generic_setup+0x65e/0x9d0 vkms_init+0x9f3/0xc76 (...snipped...)
Uninit was created at:
__kmem_cache_alloc_node+0xb69/0x1020 __kmalloc+0x379/0x680 fbcon_prepare_logo+0x704/0x1940 fbcon_init+0x2c1b/0x31c0 visual_init+0x3e7/0x820 do_bind_con_driver+0x14a4/0x1df0 do_take_over_console+0x11cb/0x13f0 fbcon_fb_registered+0xacc/0xfd0 register_framebuffer+0x1179/0x1320 __drm_fb_helper_initial_config_and_unlock+0x23ad/0x2b40 drm_fbdev_client_hotplug+0xbea/0xda0 drm_fbdev_generic_setup+0x65e/0x9d0 vkms_init+0x9f3/0xc76 (...snipped...) CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.1.0-rc4-00356-g8f2975c2bb4c #924 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 ----------
--- drivers/video/fbdev/core/fbcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/core/fbcon.c +1 -1
@@ -577,7 +577,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,if (scr_readw (r) != vc->vc_video_erase_char)break ;if (r != q && new_rows >= rows + logo_lines) { - save =kmalloc (array3_size (logo_lines, new_cols,2 ), + save =kzalloc (array3_size (logo_lines, new_cols,2 ),GFP_KERNEL );if (save) {int i =min (cols, new_cols);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 36/39 drm/amd/display: Use viewport height for subvp mall allocation size
In reply to Sasha LevinFrom: Dillon Varone <[email protected]>
[ Upstream commit dd2c028c1395d622df7ddd6837f8ab2dc94008ee ]
[WHY?]
MALL allocation size depends on the viewport height, not the addressable vertical lines, which will not match when scaling.
[HOW?]
Base MALL allocation size calculations off viewport height.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +1 -1
@@ -101,7 +101,7 @@ uint32_t dcn32_helper_calculate_num_ways_for_subvp(struct dc *dc, struct dc_stat mall_alloc_width_blk_aligned = full_vp_width_blk_aligned;/* mall_alloc_height_blk_aligned_l/c = CEILING(sub_vp_height_l/c - 1, blk_height_l/c) + blk_height_l/c */ - mall_alloc_height_blk_aligned = (pipe->stream->timing.v_addressable -1 + mblk_height -1 ) / + mall_alloc_height_blk_aligned = (pipe->plane_res.scl_data.viewport.height -1 + mblk_height -1 ) / mblk_height * mblk_height + mblk_height;/* full_mblk_width_ub_l/c = mall_alloc_width_blk_aligned_l/c;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 17/39 spi: mediatek: Fix DEVAPC Violation at KO Remove
In reply to Sasha LevinFrom: Zhichao Liu <[email protected]>
[ Upstream commit 0d10e90cee9eb57882b0f7e19fd699033722e226 ]
A DEVAPC violation occurs when removing the module due to accessing HW registers without base clock. To fix this bug, the correct method is:
1. Call the runtime resume function to enable the clock;
2. Operate the registers to reset the HW;
3. Turn off the clocks and disable the device RPM mechanism.
--- drivers/spi/spi-mt65xx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/spi/spi-mt65xx.c +7 -1
@@ -1268,8 +1268,11 @@ static int mtk_spi_remove(struct platform_device *pdev) {struct spi_master *master =platform_get_drvdata (pdev);struct mtk_spi *mdata =spi_master_get_devdata (master); +int ret; -pm_runtime_disable (&pdev->dev); + ret =pm_runtime_resume_and_get (&pdev->dev); +if (ret <0 ) +return ret;mtk_spi_reset (mdata);
@@ -1278,6 +1281,9 @@ static int mtk_spi_remove(struct platform_device *pdev)clk_unprepare (mdata->spi_hclk); } +pm_runtime_put_noidle (&pdev->dev); +pm_runtime_disable (&pdev->dev); +return 0 ; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 18/39 ARM: dts: rockchip: disable arm_global_timer on rk3066 and rk3188
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit da74858a475782a3f16470907814c8cc5950ad68 ]
The clock source and the sched_clock provided by the arm_global_timer on Rockchip rk3066a/rk3188 are quite unstable because their rates depend on the CPU frequency.
Recent changes to the arm_global_timer driver makes it impossible to use.
On the other side, the arm_global_timer has a higher rating than the ROCKCHIP_TIMER, it will be selected by default by the time framework while we want to use the stable Rockchip clock source.
Keep the arm_global_timer disabled in order to have the DW_APB_TIMER (rk3066a) or ROCKCHIP_TIMER (rk3188) selected by default.
--- arch/arm/boot/dts/rk3188.dtsi | 1 - arch/arm/boot/dts/rk3xxx.dtsi | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
arch/arm/boot/dts/rk3188.dtsi +0 -1
@@ -607,7 +607,6 @@ &emac { &global_timer { interrupts = <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; - status = "disabled"; }; &local_timer {
arch/arm/boot/dts/rk3xxx.dtsi +7 -0
@@ -76,6 +76,13 @@ global_timer: global-timer@1013c200 { reg = <0x1013c200 0x20>; interrupts = <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_EDGE_RISING)>; clocks = <&cru CORE_PERI>; + status = "disabled"; + /* The clock source and the sched_clock provided by the arm_global_timer + * on Rockchip rk3066a/rk3188 are quite unstable because their rates + * depend on the CPU frequency. + * Keep the arm_global_timer disabled in order to have the + * DW_APB_TIMER (rk3066a) or ROCKCHIP_TIMER (rk3188) selected by default. + */ }; local_timer: local-timer@1013c600 {
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 19/39 ASoC: rt711-sdca: fix the latency time of clock stop prepare state machine transitions
In reply to Sasha LevinFrom: Shuming Fan <[email protected]>
[ Upstream commit c7d7d4e7bb1290cc473610b0bb96d9fa606d00e7 ]
Due to the hardware behavior, it takes some time for CBJ detection/impedance sensing/de-bounce. The ClockStop_NotFinished flag will be raised until these functions are completed. In ClockStopMode0 mode case, the SdW controller might check this flag from D3 to D0 when the jack detection interrupt happened.
--- sound/soc/codecs/rt711-sdca-sdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/rt711-sdca-sdw.c +1 -1
@@ -230,7 +230,7 @@ static int rt711_sdca_read_prop(struct sdw_slave *slave) }/* set the timeout values */ - prop->clk_stop_timeout =20 ; + prop->clk_stop_timeout =700 ;/* wake-up event */ prop->wake_capable =1 ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 20/39 9p/fd: Use P9_HDRSZ for header size
In reply to Sasha LevinFrom: GUO Zihua <[email protected]>
[ Upstream commit 6854fadbeee10891ed74246bdc05031906b6c8cf ]
Cleanup hardcoded header sizes to use P9_HDRSZ instead of '7'
[Dominique: commit message adjusted to make sense after offset size adjustment got removed]
--- net/9p/trans_fd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/9p/trans_fd.c +3 -3
@@ -120,7 +120,7 @@ struct p9_conn {struct list_head unsent_req_list;struct p9_req_t *rreq;struct p9_req_t *wreq; -char tmp_buf[7 ]; +char tmp_buf[P9_HDRSZ ];struct p9_fcall rc;int wpos;int wsize;
@@ -291,7 +291,7 @@ static void p9_read_work(struct work_struct *work)if (!m->rc.sdata) { m->rc.sdata = m->tmp_buf; m->rc.offset =0 ; - m->rc.capacity =7 ;/* start by reading header */ + m->rc.capacity =P9_HDRSZ ;/* start by reading header */ }clear_bit (Rpending, &m->wsched);
@@ -314,7 +314,7 @@ static void p9_read_work(struct work_struct *work)p9_debug (P9_DEBUG_TRANS ,"got new header\n" );/* Header size */ - m->rc.size =7 ; + m->rc.size =P9_HDRSZ ; err =p9_parse_header (&m->rc, &m->rc.size,NULL ,NULL ,0 );if (err) { p9_debug(P9_DEBUG_ERROR,
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 21/39 regulator: slg51000: Wait after asserting CS pin
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 0b24dfa587c6cc7484cfb170da5c7dd73451f670 ]
Sony's downstream driver [1], among some other changes, adds a seemingly random 10ms usleep_range, which turned out to be necessary for the hardware to function properly on at least Sony Xperia 1 IV. Without this, I2C transactions with the SLG51000 straight up fail.
Relax (10-10ms -> 10-11ms) and add the aforementioned sleep to make sure the hardware has some time to wake up.
(nagara-2.0.0-mlc/vendor/semc/hardware/camera-kernel-module/)
[1] https://developer.sony.com/file/download/open-source-archive-for-64-0-m-4-29/
--- drivers/regulator/slg51000-regulator.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/regulator/slg51000-regulator.c +2 -0
@@ -457,6 +457,8 @@ static int slg51000_i2c_probe(struct i2c_client *client) chip->cs_gpiod = cs_gpiod; } +usleep_range (10000 ,11000 ); +i2c_set_clientdata (client, chip); chip->chip_irq = client->irq; chip->dev = dev;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 37/39 drm/amd/display: Avoid setting pixel rate divider to N/A
In reply to Sasha LevinFrom: Taimur Hassan <[email protected]>
[ Upstream commit 2a5dd86a69ea5435f1a837bdb7fafcda609a7c91 ]
[Why]
Pixel rate divider values should never be set to N/A (0xF) as the K1/K2 field is only 1/2 bits wide.
[How]
Set valid divider values for virtual and FRL/DP2 cases.
--- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c | 7 +++++++ drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 4 +++- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 1 + 4 files changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c +7 -0
@@ -96,6 +96,13 @@ static void dccg314_set_pixel_rate_div(struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg);enum pixel_rate_div cur_k1 =PIXEL_RATE_DIV_NA , cur_k2 =PIXEL_RATE_DIV_NA ; +// Don't program 0xF into the register field. Not valid since +// K1 / K2 field is only 1 / 2 bits wide +if (k1 ==PIXEL_RATE_DIV_NA || k2 ==PIXEL_RATE_DIV_NA ) { +BREAK_TO_DEBUGGER (); +return ; + } +dccg314_get_pixel_rate_div (dccg, otg_inst, &cur_k1, &cur_k2);if (k1 ==PIXEL_RATE_DIV_NA || k2 ==PIXEL_RATE_DIV_NA || (k1 == cur_k1 && k2 == cur_k2))return ;
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c +2 -1
@@ -349,6 +349,7 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig odm_combine_factor =get_odm_config (pipe_ctx,NULL );if (is_dp_128b_132b_signal (pipe_ctx)) { + *k1_div =PIXEL_RATE_DIV_BY_1 ; *k2_div =PIXEL_RATE_DIV_BY_1 ; }else if (dc_is_hdmi_tmds_signal (pipe_ctx->stream->signal) ||dc_is_dvi_signal (pipe_ctx->stream->signal)) { *k1_div =PIXEL_RATE_DIV_BY_1 ;
@@ -356,7 +357,7 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsig *k2_div =PIXEL_RATE_DIV_BY_2 ; else *k2_div =PIXEL_RATE_DIV_BY_4 ; - }else if (dc_is_dp_signal (pipe_ctx->stream->signal)) { + }else if (dc_is_dp_signal (pipe_ctx->stream->signal) ||dc_is_virtual_signal (pipe_ctx->stream->signal)) {if (two_pix_per_container) { *k1_div =PIXEL_RATE_DIV_BY_1 ; *k2_div =PIXEL_RATE_DIV_BY_2 ;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +3 -1
@@ -96,8 +96,10 @@ static void dccg32_set_pixel_rate_div(// Don't program 0xF into the register field. Not valid since // K1 / K2 field is only 1 / 2 bits wide -if (k1 ==PIXEL_RATE_DIV_NA || k2 ==PIXEL_RATE_DIV_NA ) +if (k1 ==PIXEL_RATE_DIV_NA || k2 ==PIXEL_RATE_DIV_NA ) { +BREAK_TO_DEBUGGER ();return ; + }dccg32_get_pixel_rate_div (dccg, otg_inst, &cur_k1, &cur_k2);if (k1 == cur_k1 && k2 == cur_k2)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +1 -0
@@ -1186,6 +1186,7 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsign odm_combine_factor =get_odm_config (pipe_ctx,NULL );if (is_dp_128b_132b_signal (pipe_ctx)) { + *k1_div =PIXEL_RATE_DIV_BY_1 ; *k2_div =PIXEL_RATE_DIV_BY_1 ; }else if (dc_is_hdmi_tmds_signal (pipe_ctx->stream->signal) ||dc_is_dvi_signal (pipe_ctx->stream->signal)) { *k1_div =PIXEL_RATE_DIV_BY_1 ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 38/39 drm/amd/display: Use new num clk levels struct for max mclk index
In reply to Sasha LevinFrom: Dillon Varone <[email protected]>
[ Upstream commit e667ee3b0c049bf0c69426879586a2572bb28d26 ]
[WHY?]
When calculating watermark and dlg values, the max mclk level index and associated speed are needed to find the correlated dummy latency value. Currently the incorrect index is given due to a clock manager refactor.
[HOW?]
Use num_memclk_level from num_entries_per_clk struct for getting the correct max mem speed.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -1
@@ -1797,7 +1797,7 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,if (context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][maxMpcComb] == dm_dram_clock_change_unsupported) { -int min_dram_speed_mts_offset = dc->clk_mgr->bw_params->clk_table.num_entries -1 ; +int min_dram_speed_mts_offset = dc->clk_mgr->bw_params->clk_table.num_entries_per_clk.num_memclk_levels -1 ; min_dram_speed_mts = dc->clk_mgr->bw_params->clk_table.entries[min_dram_speed_mts_offset].memclk_mhz *16 ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 30/39 ASoC: soc-pcm: Add NULL check in BE reparenting
In reply to Sasha LevinFrom: Srinivasa Rao Mandadapu <[email protected]>
[ Upstream commit db8f91d424fe0ea6db337aca8bc05908bbce1498 ]
Add NULL check in dpcm_be_reparent API, to handle kernel NULL pointer dereference error. The issue occurred in fuzzing test.
--- sound/soc/soc-pcm.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/soc-pcm.c +2 -0
@@ -1247,6 +1247,8 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe,return ; be_substream =snd_soc_dpcm_get_substream (be, stream); +if (!be_substream) +return ;for_each_dpcm_fe (be, stream, dpcm) {if (dpcm->fe == fe)
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 39/39 drm/amdgpu: fix use-after-free during gpu recovery
In reply to Sasha LevinFrom: "Stanley.Yang" <[email protected]>
[ Upstream commit 3cb93f390453cde4d6afda1587aaa00e75e09617 ]
[Why]
[ 754.862560] refcount_t: underflow; use-after-free.
[ 754.862898] Call Trace:
[ 754.862903] <TASK>
[ 754.862913] amdgpu_job_free_cb+0xc2/0xe1 [amdgpu]
[ 754.863543] drm_sched_main.cold+0x34/0x39 [amd_sched][How]
The fw_fence may be not init, check whether dma_fence_init is performed before job free
--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +5 -1
@@ -150,7 +150,11 @@ static void amdgpu_job_free_cb(struct drm_sched_job *s_job)amdgpu_sync_free (&job->sync);amdgpu_sync_free (&job->sched_sync); -dma_fence_put (&job->hw_fence); +/* only put the hw fence if has embedded fence */ +if (!job->hw_fence.ops) +kfree (job); +else +dma_fence_put (&job->hw_fence); }void amdgpu_job_free (struct amdgpu_job *job)
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 27/39 selftests/net: Find nettest in current directory
In reply to Sasha LevinFrom: Daniel Díaz <[email protected]>
[ Upstream commit bd5e1e42826f18147afb0ba07e6a815f52cf8bcb ]
The nettest binary, built from selftests/net/nettest.c, was expected to be found in the path during test execution of fcnal-test.sh and pmtu.sh, leading to tests getting skipped when the binary is not installed in the system, as can be seen in these logs found in the wild [1]:
# TEST: vti4: PMTU exceptions [SKIP]
[ 350.600250] IPv6: ADDRCONF(NETDEV_CHANGE): veth_b: link becomes ready [ 350.607421] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready # 'nettest' command not found; skipping tests # xfrm6udp not supported # TEST: vti6: PMTU exceptions (ESP-in-UDP) [SKIP] [ 351.605102] IPv6: ADDRCONF(NETDEV_CHANGE): veth_b: link becomes ready [ 351.612243] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready # 'nettest' command not found; skipping tests # xfrm4udp not supported
The unicast_extensions.sh tests also rely on nettest, but it runs fine there because it looks for the binary in the current working directory [2]:
The same mechanism that works for the Unicast extensions tests is here copied over to the PMTU and functional tests.
[1] https://lkft.validation.linaro.org/scheduler/job/5839508#L6221
[2] https://lkft.validation.linaro.org/scheduler/job/5839508#L7958
--- tools/testing/selftests/net/fcnal-test.sh | 11 +++++++---- tools/testing/selftests/net/pmtu.sh | 10 ++++++---- 2 files changed, 13 insertions(+), 8 deletions(-)
tools/testing/selftests/net/fcnal-test.sh +7 -4
@@ -4196,10 +4196,13 @@ elif [ "$TESTS" = "ipv6" ]; then TESTS="$TESTS_IPV6" fi -which nettest >/dev/null -if [ $? -ne 0 ]; then - echo "'nettest' command not found; skipping tests" - exit $ksft_skip +# nettest can be run from PATH or from same directory as this selftest +if ! which nettest >/dev/null; then + PATH=$PWD:$PATH + if ! which nettest >/dev/null; then + echo "'nettest' command not found; skipping tests" + exit $ksft_skip + fi fi declare -i nfail=0
tools/testing/selftests/net/pmtu.sh +6 -4
@@ -686,10 +686,12 @@ setup_xfrm() { } setup_nettest_xfrm() { - which nettest >/dev/null - if [ $? -ne 0 ]; then - echo "'nettest' command not found; skipping tests" - return 1 + if ! which nettest >/dev/null; then + PATH=$PWD:$PATH + if ! which nettest >/dev/null; then + echo "'nettest' command not found; skipping tests" + return 1 + fi fi [ ${1} -eq 6 ] && proto="-6" || proto=""
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 28/39 btrfs: send: avoid unaligned encoded writes when attempting to clone range
In reply to Sasha LevinFrom: Filipe Manana <[email protected]>
[ Upstream commit a11452a3709e217492798cf3686ac2cc8eb3fb51 ]
When trying to see if we can clone a file range, there are cases where we end up sending two write operations in case the inode from the source root has an i_size that is not sector size aligned and the length from the current offset to its i_size is less than the remaining length we are trying to clone.
Issuing two write operations when we could instead issue a single write operation is not incorrect. However it is not optimal, specially if the extents are compressed and the flag BTRFS_SEND_FLAG_COMPRESSED was passed to the send ioctl. In that case we can end up sending an encoded write with an offset that is not sector size aligned, which makes the receiver fallback to decompressing the data and writing it using regular buffered IO (so re-compressing the data in case the fs is mounted with compression enabled), because encoded writes fail with -EINVAL when an offset is not sector size aligned.
The following example, which triggered a bug in the receiver code for the fallback logic of decompressing + regular buffer IO and is fixed by the patchset referred in a Link at the bottom of this changelog, is an example where we have the non-optimal behaviour due to an unaligned encoded write:
$ cat test.sh #!/bin/bash
DEV=/dev/sdj
MNT=/mnt/sdj
mkfs.btrfs -f $DEV > /dev/null
mount -o compress $DEV $MNT
# File foo has a size of 33K, not aligned to the sector size. xfs_io -f -c "pwrite -S 0xab 0 33K" $MNT/foo
xfs_io -f -c "pwrite -S 0xcd 0 64K" $MNT/bar
# Now clone the first 32K of file bar into foo at offset 0. xfs_io -c "reflink $MNT/bar 0 0 32K" $MNT/foo
# Snapshot the default subvolume and create a full send stream (v2). btrfs subvolume snapshot -r $MNT $MNT/snap
btrfs send --compressed-data -f /tmp/test.send $MNT/snap
echo -e "\nFile bar in the original filesystem:" od -A d -t x1 $MNT/snap/bar
umount $MNT
mkfs.btrfs -f $DEV > /dev/null
mount $DEV $MNT
echo -e "\nReceiving stream in a new filesystem..." btrfs receive -f /tmp/test.send $MNT
echo -e "\nFile bar in the new filesystem:"
od -A d -t x1 $MNT/snap/bar
umount $MNT
Before this patch, the send stream included one regular write and one encoded write for file 'bar', with the later being not sector size aligned and causing the receiver to fallback to decompression + buffered writes. The output of the btrfs receive command in verbose mode (-vvv):
(...)
mkfile o258-7-0
rename o258-7-0 -> bar
utimes
clone bar - source=foo source offset=0 offset=0 length=32768
write bar - offset=32768 length=1024
encoded_write bar - offset=33792, len=4096, unencoded_offset=33792, unencoded_file_len=31744, unencoded_len=65536, compression=1, encryption=0 encoded_write bar - falling back to decompress and write due to errno 22 ("Invalid argument")
(...)
This patch avoids the regular write followed by an unaligned encoded write so that we end up sending a single encoded write that is aligned. So after this patch the stream content is (output of btrfs receive -vvv):
(...)
mkfile o258-7-0
rename o258-7-0 -> bar
utimes
clone bar - source=foo source offset=0 offset=0 length=32768
encoded_write bar - offset=32768, len=4096, unencoded_offset=32768, unencoded_file_len=32768, unencoded_len=65536, compression=1, encryption=0 (...)
So we get more optimal behaviour and avoid the silent data loss bug in versions of btrfs-progs affected by the bug referred by the Link tag below (btrfs-progs v5.19, v5.19.1, v6.0 and v6.0.1).
--- fs/btrfs/send.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
fs/btrfs/send.c +23 -1
@@ -5615,6 +5615,7 @@ static int clone_range(struct send_ctx *sctx, struct btrfs_path *dst_path,u64 ext_len;u64 clone_len;u64 clone_data_offset; +bool crossed_src_i_size = false;if (slot >=btrfs_header_nritems (leaf)) { ret =btrfs_next_leaf (clone_root->root, path);
@@ -5672,8 +5673,10 @@ static int clone_range(struct send_ctx *sctx, struct btrfs_path *dst_path,if (key.offset >= clone_src_i_size)break ; -if (key.offset + ext_len > clone_src_i_size) +if (key.offset + ext_len > clone_src_i_size) { ext_len = clone_src_i_size - key.offset; + crossed_src_i_size = true; + } clone_data_offset =btrfs_file_extent_offset (leaf, ei);if (btrfs_file_extent_disk_bytenr (leaf, ei) == disk_byte) {
@@ -5734,6 +5737,25 @@ static int clone_range(struct send_ctx *sctx, struct btrfs_path *dst_path, ret =send_clone (sctx, offset, clone_len, clone_root); } + }else if (crossed_src_i_size && clone_len < len) { +/* +* If we are at i_size of the clone source inode and we +* can not clone from it, terminate the loop. This is +* to avoid sending two write operations, one with a +* length matching clone_len and the final one after +* this loop with a length of len - clone_len. +* +* When using encoded writes (BTRFS_SEND_FLAG_COMPRESSED +* was passed to the send ioctl), this helps avoid +* sending an encoded write for an offset that is not +* sector size aligned, in case the i_size of the source +* inode is not sector size aligned. That will make the +* receiver fallback to decompression of the data and +* writing it using regular buffered IO, therefore while +* not incorrect, it's not optimal due decompression and +* possible re-compression at the receiver. +*/ +break ; }else { ret =send_extent_data (sctx, dst_path, offset, clone_len);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 31/39 regulator: twl6030: fix get status of twl6032 regulators
In reply to Sasha LevinFrom: Andreas Kemnade <[email protected]>
[ Upstream commit 31a6297b89aabc81b274c093a308a7f5b55081a7 ]
Status is reported as always off in the 6032 case. Status reporting now matches the logic in the setters. Once of the differences to the 6030 is that there are no groups, therefore the state needs to be read out in the lower bits.
--- drivers/regulator/twl6030-regulator.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/regulator/twl6030-regulator.c +11 -4
@@ -67,6 +67,7 @@ struct twlreg_info {#define TWL6030_CFG_STATE_SLEEP 0x03#define TWL6030_CFG_STATE_GRP_SHIFT 5#define TWL6030_CFG_STATE_APP_SHIFT 2 +#define TWL6030_CFG_STATE_MASK 0x03#define TWL6030_CFG_STATE_APP_MASK (0x03 << TWL6030_CFG_STATE_APP_SHIFT)#define TWL6030_CFG_STATE_APP (v) (((v) & TWL6030_CFG_STATE_APP_MASK) >>\ TWL6030_CFG_STATE_APP_SHIFT)
@@ -128,13 +129,14 @@ static int twl6030reg_is_enabled(struct regulator_dev *rdev)if (grp <0 )return grp; grp &=P1_GRP_6030 ; + val =twlreg_read (info,TWL_MODULE_PM_RECEIVER ,VREG_STATE ); + val =TWL6030_CFG_STATE_APP (val); }else { + val =twlreg_read (info,TWL_MODULE_PM_RECEIVER ,VREG_STATE ); + val &=TWL6030_CFG_STATE_MASK ; grp =1 ; } - val =twlreg_read (info,TWL_MODULE_PM_RECEIVER ,VREG_STATE ); - val =TWL6030_CFG_STATE_APP (val); -return grp && (val ==TWL6030_CFG_STATE_ON ); }
@@ -187,7 +189,12 @@ static int twl6030reg_get_status(struct regulator_dev *rdev) val =twlreg_read (info,TWL_MODULE_PM_RECEIVER ,VREG_STATE ); -switch (TWL6030_CFG_STATE_APP (val)) { +if (info->features &TWL6032_SUBCLASS ) + val &=TWL6030_CFG_STATE_MASK ; +else + val =TWL6030_CFG_STATE_APP (val); + +switch (val) {case TWL6030_CFG_STATE_ON :return REGULATOR_STATUS_NORMAL ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 29/39 net/mlx5: Lag, avoid lockdep warnings
In reply to Sasha LevinFrom: Eli Cohen <[email protected]>
[ Upstream commit 0d4e8ed139d871fcb2844dd71075997753baeec8 ]
ldev->lock is used to serialize lag change operations. Since multiport eswtich functionality was added, we now change the mode dynamically. However, acquiring ldev->lock is not allowed as it could possibly lead to a deadlock as reported by the lockdep mechanism.
[ 836.154963] WARNING: possible circular locking dependency detected
[ 836.155850] 5.19.0-rc5_net_56b7df2 #1 Not tainted
[ 836.156549] ------------------------------------------------------
[ 836.157418] handler1/12198 is trying to acquire lock:
[ 836.158178] ffff888187d52b58 (&ldev->lock){+.+.}-{3:3}, at: mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core]
[ 836.159575]
[ 836.159575] but task is already holding lock:
[ 836.160474] ffff8881d4de2930 (&block->cb_lock){++++}-{3:3}, at: tc_setup_cb_add+0x5b/0x200
[ 836.161669] which lock already depends on the new lock.
[ 836.162905]
[ 836.162905] the existing dependency chain (in reverse order) is:
[ 836.164008] -> #3 (&block->cb_lock){++++}-{3:3}:
[ 836.164946] down_write+0x25/0x60
[ 836.165548] tcf_block_get_ext+0x1c6/0x5d0
[ 836.166253] ingress_init+0x74/0xa0 [sch_ingress]
[ 836.167028] qdisc_create.constprop.0+0x130/0x5e0
[ 836.167805] tc_modify_qdisc+0x481/0x9f0
[ 836.168490] rtnetlink_rcv_msg+0x16e/0x5a0
[ 836.169189] netlink_rcv_skb+0x4e/0xf0
[ 836.169861] netlink_unicast+0x190/0x250
[ 836.170543] netlink_sendmsg+0x243/0x4b0
[ 836.171226] sock_sendmsg+0x33/0x40
[ 836.171860] ____sys_sendmsg+0x1d1/0x1f0
[ 836.172535] ___sys_sendmsg+0xab/0xf0
[ 836.173183] __sys_sendmsg+0x51/0x90
[ 836.173836] do_syscall_64+0x3d/0x90
[ 836.174471] entry_SYSCALL_64_after_hwframe+0x46/0xb0
[ 836.175282][ 836.175282] -> #2 (rtnl_mutex){+.+.}-{3:3}:
[ 836.176190] __mutex_lock+0x6b/0xf80
[ 836.176830] register_netdevice_notifier+0x21/0x120
[ 836.177631] rtnetlink_init+0x2d/0x1e9
[ 836.178289] netlink_proto_init+0x163/0x179
[ 836.178994] do_one_initcall+0x63/0x300
[ 836.179672] kernel_init_freeable+0x2cb/0x31b
[ 836.180403] kernel_init+0x17/0x140
[ 836.181035] ret_from_fork+0x1f/0x30 [ 836.181687] -> #1 (pernet_ops_rwsem){+.+.}-{3:3}:
[ 836.182628] down_write+0x25/0x60
[ 836.183235] unregister_netdevice_notifier+0x1c/0xb0
[ 836.184029] mlx5_ib_roce_cleanup+0x94/0x120 [mlx5_ib]
[ 836.184855] __mlx5_ib_remove+0x35/0x60 [mlx5_ib]
[ 836.185637] mlx5_eswitch_unregister_vport_reps+0x22f/0x440 [mlx5_core]
[ 836.186698] auxiliary_bus_remove+0x18/0x30
[ 836.187409] device_release_driver_internal+0x1f6/0x270
[ 836.188253] bus_remove_device+0xef/0x160
[ 836.188939] device_del+0x18b/0x3f0
[ 836.189562] mlx5_rescan_drivers_locked+0xd6/0x2d0 [mlx5_core]
[ 836.190516] mlx5_lag_remove_devices+0x69/0xe0 [mlx5_core]
[ 836.191414] mlx5_do_bond_work+0x441/0x620 [mlx5_core]
[ 836.192278] process_one_work+0x25c/0x590
[ 836.192963] worker_thread+0x4f/0x3d0
[ 836.193609] kthread+0xcb/0xf0
[ 836.194189] ret_from_fork+0x1f/0x30[ 836.194826] -> #0 (&ldev->lock){+.+.}-{3:3}:
[ 836.195734] __lock_acquire+0x15b8/0x2a10
[ 836.196426] lock_acquire+0xce/0x2d0
[ 836.197057] __mutex_lock+0x6b/0xf80
[ 836.197708] mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core]
[ 836.198575] tc_act_parse_mirred+0x25b/0x800 [mlx5_core]
[ 836.199467] parse_tc_actions+0x168/0x5a0 [mlx5_core]
[ 836.200340] __mlx5e_add_fdb_flow+0x263/0x480 [mlx5_core]
[ 836.201241] mlx5e_configure_flower+0x8a0/0x1820 [mlx5_core]
[ 836.202187] tc_setup_cb_add+0xd7/0x200
[ 836.202856] fl_hw_replace_filter+0x14c/0x1f0 [cls_flower]
[ 836.203739] fl_change+0xbbe/0x1730 [cls_flower]
[ 836.204501] tc_new_tfilter+0x407/0xd90
[ 836.205168] rtnetlink_rcv_msg+0x406/0x5a0
[ 836.205877] netlink_rcv_skb+0x4e/0xf0
[ 836.206535] netlink_unicast+0x190/0x250
[ 836.207217] netlink_sendmsg+0x243/0x4b0
[ 836.207915] sock_sendmsg+0x33/0x40
[ 836.208538] ____sys_sendmsg+0x1d1/0x1f0
[ 836.209219] ___sys_sendmsg+0xab/0xf0
[ 836.209878] __sys_sendmsg+0x51/0x90
[ 836.210510] do_syscall_64+0x3d/0x90
[ 836.211137] entry_SYSCALL_64_after_hwframe+0x46/0xb0[ 836.211954] other info that might help us debug this:
[ 836.213174] Chain exists of:
[ 836.213174] &ldev->lock --> rtnl_mutex --> &block->cb_lock
836.214650] Possible unsafe locking scenario:
[ 836.214650]
[ 836.215574] CPU0 CPU1
[ 836.216255] ---- ----
[ 836.216943] lock(&block->cb_lock);
[ 836.217518] lock(rtnl_mutex);
[ 836.218348] lock(&block->cb_lock);
[ 836.219212] lock(&ldev->lock);
[ 836.219758]
[ 836.219758] *** DEADLOCK ***
[ 836.219758]
[ 836.220747] 2 locks held by handler1/12198:
[ 836.221390] #0: ffff8881d4de2930 (&block->cb_lock){++++}-{3:3}, at: tc_setup_cb_add+0x5b/0x200
[ 836.222646] #1: ffff88810c9a92c0 (&esw->mode_lock){++++}-{3:3}, at: mlx5_esw_hold+0x39/0x50 [mlx5_core][ 836.224063] stack backtrace: [ 836.224799] CPU: 6 PID: 12198 Comm: handler1 Not tainted 5.19.0-rc5_net_56b7df2 #1 [ 836.225923] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 836.227476] Call Trace: [ 836.227929] <TASK> [ 836.228332] dump_stack_lvl+0x57/0x7d [ 836.228924] check_noncircular+0x104/0x120 [ 836.229562] __lock_acquire+0x15b8/0x2a10 [ 836.230201] lock_acquire+0xce/0x2d0 [ 836.230776] ? mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.231614] ? find_held_lock+0x2b/0x80 [ 836.232221] __mutex_lock+0x6b/0xf80 [ 836.232799] ? mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.233636] ? mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.234451] ? xa_load+0xc3/0x190 [ 836.234995] mlx5_lag_do_mirred+0x3b/0x70 [mlx5_core] [ 836.235803] tc_act_parse_mirred+0x25b/0x800 [mlx5_core] [ 836.236636] ? tc_act_can_offload_mirred+0x135/0x210 [mlx5_core] [ 836.237550] parse_tc_actions+0x168/0x5a0 [mlx5_core] [ 836.238364] __mlx5e_add_fdb_flow+0x263/0x480 [mlx5_core] [ 836.239202] mlx5e_configure_flower+0x8a0/0x1820 [mlx5_core] [ 836.240076] ? lock_acquire+0xce/0x2d0 [ 836.240668] ? tc_setup_cb_add+0x5b/0x200 [ 836.241294] tc_setup_cb_add+0xd7/0x200 [ 836.241917] fl_hw_replace_filter+0x14c/0x1f0 [cls_flower] [ 836.242709] fl_change+0xbbe/0x1730 [cls_flower] [ 836.243408] tc_new_tfilter+0x407/0xd90 [ 836.244043] ? tc_del_tfilter+0x880/0x880 [ 836.244672] rtnetlink_rcv_msg+0x406/0x5a0 [ 836.245310] ? netlink_deliver_tap+0x7a/0x4b0 [ 836.245991] ? if_nlmsg_stats_size+0x2b0/0x2b0 [ 836.246675] netlink_rcv_skb+0x4e/0xf0 [ 836.258046] netlink_unicast+0x190/0x250 [ 836.258669] netlink_sendmsg+0x243/0x4b0 [ 836.259288] sock_sendmsg+0x33/0x40 [ 836.259857] ____sys_sendmsg+0x1d1/0x1f0 [ 836.260473] ___sys_sendmsg+0xab/0xf0 [ 836.261064] ? lock_acquire+0xce/0x2d0 [ 836.261669] ? find_held_lock+0x2b/0x80 [ 836.262272] ? __fget_files+0xb9/0x190 [ 836.262871] ? __fget_files+0xd3/0x190 [ 836.263462] __sys_sendmsg+0x51/0x90 [ 836.264064] do_syscall_64+0x3d/0x90 [ 836.264652] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [ 836.265425] RIP: 0033:0x7fdbe5e2677d
[ 836.266012] Code: 28 89 54 24 1c 48 89 74 24 10 89 7c 24 08 e8 ba ee ff ff 8b 54 24 1c 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 33 44 89 c7 48 89 44 24 08 e8 ee ee ff ff 48 [ 836.268485] RSP: 002b:00007fdbe48a75a0 EFLAGS: 00000293 ORIG_RAX: 000000000000002e [ 836.269598] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fdbe5e2677d [ 836.270576] RDX: 0000000000000000 RSI: 00007fdbe48a7640 RDI: 000000000000003c [ 836.271565] RBP: 00007fdbe48a8368 R08: 0000000000000000 R09: 0000000000000000 [ 836.272546] R10: 00007fdbe48a84b0 R11: 0000000000000293 R12: 0000557bd17dc860 [ 836.273527] R13: 0000000000000000 R14: 0000557bd17dc860 R15: 00007fdbe48a7640
[ 836.274521] </TASK>
To avoid using mode holding ldev->lock in the configure flow, we queue a work to the lag workqueue and cease wait on a completion object.
In addition, we remove the lock from mlx5_lag_do_mirred() since it is not really protecting anything.
It should be noted that an actual deadlock has not been observed.
--- .../net/ethernet/mellanox/mlx5/core/lag/lag.c | 3 +- .../net/ethernet/mellanox/mlx5/core/lag/lag.h | 14 ++- .../ethernet/mellanox/mlx5/core/lag/mpesw.c | 100 +++++++++++------- .../ethernet/mellanox/mlx5/core/lag/mpesw.h | 1 - 4 files changed, 78 insertions(+), 40 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +1 -2
@@ -201,9 +201,8 @@ static void mlx5_ldev_free(struct kref *ref)if (ldev->nb.notifier_call)unregister_netdevice_notifier_net (&init_net, &ldev->nb);mlx5_lag_mp_cleanup (ldev); -mlx5_lag_mpesw_cleanup (ldev); -cancel_work_sync (&ldev->mpesw_work);destroy_workqueue (ldev->wq); +mlx5_lag_mpesw_cleanup (ldev);mutex_destroy (&ldev->lock);kfree (ldev); }
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h +13 -1
@@ -50,6 +50,19 @@ struct lag_tracker {enum netdev_lag_hash hash_type; }; +enum mpesw_op { +MLX5_MPESW_OP_ENABLE , +MLX5_MPESW_OP_DISABLE , +}; + +struct mlx5_mpesw_work_st { +struct work_struct work; +struct mlx5_lag *lag; +enum mpesw_op op; +struct completion comp; +int result; +}; +/* LAG data of a ConnectX card. * It serves both its phys functions. */
@@ -66,7 +79,6 @@ struct mlx5_lag {struct lag_tracker tracker;struct workqueue_struct *wq;struct delayed_work bond_work; -struct work_struct mpesw_work;struct notifier_block nb;struct lag_mp lag_mp;struct mlx5_lag_port_sel port_sel;
drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c +64 -36
150 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.h +0 -1
@@ -12,7 +12,6 @@ struct lag_mpesw {atomic_t mpesw_rule_count; }; -void mlx5_mpesw_work (struct work_struct *work);int mlx5_lag_do_mirred (struct mlx5_core_dev *mdev,struct net_device *out_dev);bool mlx5_lag_mpesw_is_activated (struct mlx5_core_dev *dev);#if IS_ENABLED (CONFIG_MLX5_ESWITCH )
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 33/39 usb: dwc3: gadget: Disable GUSB2PHYCFG.SUSPHY for End Transfer
In reply to Sasha LevinFrom: Thinh Nguyen <[email protected]>
[ Upstream commit 3aa07f72894d209fcf922ad686cbb28cf005aaad ]
If there's a disconnection while operating in eSS, there may be a delay in VBUS drop response from the connector. In that case, the internal link state may drop to operate in usb2 speed while the controller thinks the VBUS is still high. The driver must make sure to disable GUSB2PHYCFG.SUSPHY when sending endpoint command while in usb2 speed. The End Transfer command may be called, and only that command needs to go through at this point. Let's keep it simple and unconditionally disable GUSB2PHYCFG.SUSPHY whenever we issue the command.
This scenario is not seen in real hardware. In a rare case, our prototype type-c controller/interface may have a slow response triggerring this issue.
--- drivers/usb/dwc3/gadget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/dwc3/gadget.c +2 -1
@@ -291,7 +291,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,* * DWC_usb3 3.30a and DWC_usb31 1.90a programming guide section 3.2.2 */ -if (dwc->gadget->speed <=USB_SPEED_HIGH ) { +if (dwc->gadget->speed <=USB_SPEED_HIGH || +DWC3_DEPCMD_CMD (cmd) ==DWC3_DEPCMD_ENDTRANSFER ) { reg =dwc3_readl (dwc->regs,DWC3_GUSB2PHYCFG (0 ));if (unlikely (reg &DWC3_GUSB2PHYCFG_SUSPHY )) { saved_config |=DWC3_GUSB2PHYCFG_SUSPHY ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 35/39 net: usb: qmi_wwan: add u-blox 0x1342 composition
In reply to Sasha LevinFrom: Davide Tronchin <[email protected]>
[ Upstream commit a487069e11b6527373f7c6f435d8998051d0b5d9 ]
Add RmNet support for LARA-L6.
LARA-L6 module can be configured (by AT interface) in three different USB modes:
* Default mode (Vendor ID: 0x1546 Product ID: 0x1341) with 4 serial interfaces
* RmNet mode (Vendor ID: 0x1546 Product ID: 0x1342) with 4 serial interfaces and 1 RmNet virtual network interface
* CDC-ECM mode (Vendor ID: 0x1546 Product ID: 0x1343) with 4 serial interface and 1 CDC-ECM virtual network interface
In RmNet mode LARA-L6 exposes the following interfaces:
If 0: Diagnostic
If 1: AT parser
If 2: AT parser
If 3: AT parset/alternative functions
If 4: RMNET interface
--- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1422,6 +1422,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */ {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/ {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */ + {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 *//* 4. Gobi 1000 devices */ {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 34/39 9p/xen: check logical size for buffer size
In reply to Sasha LevinFrom: Dominique Martinet <[email protected]>
[ Upstream commit 391c18cf776eb4569ecda1f7794f360fe0a45a26 ]
trans_xen did not check the data fits into the buffer before copying from the xen ring, but we probably should.
Add a check that just skips the request and return an error to userspace if it did not fit
--- net/9p/trans_xen.c | 9 +++++++++ 1 file changed, 9 insertions(+)
net/9p/trans_xen.c +9 -0
@@ -208,6 +208,14 @@ static void p9_xen_response(struct work_struct *work)continue ; } +if (h.size > req->rc.capacity) { +dev_warn (&priv->dev->dev, +"requested packet size too big: %d for tag %d with capacity %zd\n" , + h.size, h.tag, req->rc.capacity); + req->status =REQ_STATUS_ERROR ; + goto recv_error; + } +memcpy (&req->rc, &h,sizeof (h)); req->rc.offset =0 ;
@@ -217,6 +225,7 @@ static void p9_xen_response(struct work_struct *work) masked_prod, &masked_cons, XEN_9PFS_RING_SIZE(ring)); +recv_error:virt_mb (); cons += h.size; ring->intf->in_cons = cons;
Signature · 1 line
2.35.1